Watt-32 tcp/ip: Watt-32 interface documentation

Watt-32 tcp/ip 2.2 dev-rel.10
  • Main Page
  • Related Pages
  • Data Structures
  • Files
Watt-32 interface documentation

Introduction

This document tries to describe the internals of Watt-32.

Sections:

  • pkt_drvr_init
  • winpcap_init
  • swsvpkt_init
Generated by doxygen 1.9.6


Watt-32 tcp/ip: Todo List

  • Data Structures
  • Files
Todo List
Global _arp_add_gateway (const char *config_string, DWORD ip)
Move to route.c and rename to route_add().
Global _arp_gateways_get (const struct gate_entry **)
: Move to route.c and prefix with '_route'.
Global _dx_real_alloc (int paras, WORD *para, WORD *largest)
Global _eth_arrived (WORD *type_ptr, BOOL *broadcast)
push back packet, else it's lost
Global _get_machine_name (char *buf, int size)
Global _ip4_handler (const in_Header *ip, BOOL broadcast)

check for LSRR option and replace ip->source with actual source-address burried in option (ref. RFC-1122)

handle compressed IP (use zlib)

Global _ip4_output (in_Header *ip, DWORD src_ip, DWORD dst_ip, BYTE protocol, BYTE ttl, BYTE tos, WORD ip_id, int data_len, const void *sock, const char *file, unsigned line)
Handle IP-fragments here (call ip4_send_fragments() when needed)
Global _ip4_send_fragments (sock_type *sk, BYTE proto, DWORD dest, const void *buf, unsigned len, const char *file, unsigned line)
Maybe send highest offset fragment first?
Global _ip6_output (in6_Header *ip, ip6_address *src_ip, ip6_address *dst_ip, BYTE next_hdr, unsigned data_len, int hop_lim, const void *sock, const char *file, unsigned line)
: Support fragments
Global _sock_append (_tcp_Socket **tcp)

Implement SYN-cookies. Ref. http://cr.yp.to/syncookies.html

Implement SYN-cookies and drop the segment if no match

drop the oldest (or a random) slot in the listen-queue.

Global _sock_set_rcv_buf (sock_type *s, size_t len)
allow user to define size using SO_RCVBUF/SO_SNDBUF before calling connect().
Global _TCP6_listen (Socket *socket, const void *host, WORD loc_port)
Support TCP listen() for AF_INET6
Global _TCP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port)

use mss from setsockopt()

Yield for IPv6 sockets

use TCP_NODELAY set in setsockopt()

Global _UDP6_listen (Socket *socket, const void *host, WORD port)
Support UDP listen() for AF_INET6
Global _UDP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port)
Support UDP connect() for AF_INET6
Global _w_watt_optarg

Add some internal aliases for getopt processing

make a wide-char version of getopt()

Global accept (int s, struct sockaddr *addr, socklen_t *addrlen)
Should maybe loop over all maxconn TCBs and accept the one with oldest 'syn_timestamp'.
Global bind (int, const struct sockaddr *, socklen_t)
check for "sleeping" ports (lport_inuse in pctcp.c) also. And return EADDRINUSE if local port not free.
Global crtdbg_exit (void)
: show a better MessageBox(). Show backtrace from where abort() was called; skip the 2 first CRT locations (raise, abort). Indent the printout 2 spaces.
Global dbg_mode_all
make them static.
Global DHCP_offer (const struct dhcp *in)
make a hook for SMB-lib
Class DNS_Header
Rewrite to use only 'struct DNS_Header'.
Global dump_data (const void *data_p, UINT datalen, const char *indent)
: print these too: 'ValidLifeTime', 'PreferredLifetime', 'LeaseLifetime', 'PrefixOrigin', 'SuffixOrigin' '(Address.lpSockaddr)->sa_family' for 'uca' and 'aca'
Global eth_ifnet (void)
fill info
Global exc_app_start
find the real application start
Global exc_select (int s, Socket *socket)
Only arrival of OOB-data should count here
Global except_handler (int sig)
Disassemble crash address. Don't confuse this yet-to-be function with the function ShowStack() in stkwalk.cpp. That one is for Win32 only.
Global expand_var_str (const char *str)
support several in one line and malloc the result.
Global fcntlsocket (int s, int cmd,...)
handle O_TEXT and O_BINARY
Global fix_llc_head (void **mac)
handle IEEE 802.3 encapsulation also.
Class gate_entry
Move the gateway/route stuff to route.c
Global get_if_type_swsvpkt (const void *u, WORD *type)
Fix me
Global get_phys_address (const void *a, ULONG len, BOOL show_manuf)
Get addresses such as 00:FF:DB:EF:7D:48 from a "Well Known Address" source. Ref. Wireshark's 'wka' file.
Global get_sol_opt (Socket *s, int opt, void *val, int *len)

Handle urgent (OOB) data

Handle these SOL_OPTIONS:

Global gethostbyaddr6_internal (const char *addr, struct _hostent6 *ret)

should check all addresses

should be the new aliases

Global gethostbyaddr_internal (const char *addr_name, int len, int type, struct _hostent *ret)

should be the new aliases

Should return all our addresses if we're multihomed.

Global gethostbyname_internal (const char *name, const char **alias, struct _hostent *ret)
should be canonical name
Global icmp4_dump (const in_Header *ip)
Handle debugging of these
Global icmp6_neigh_solic (const void *addr, eth_address *eth)
wait for Neighbor Advertisement
Global icmp_handler (const in_Header *ip, BOOL broadcast)

Handle cancelling raw sockets

!!

!!

send reply?

should store

send reply

send reply upwards

Global icmp_loopback (ICMP_PKT *icmp, unsigned icmp_len)
fall-through to another ICMP loopback handler
Global IDNA_convert_from_ACE (char *name, size_t *size)
Check for over-run on output.
Global iface_ioctrl (Socket *socket, long cmd, void *argp)

Handle deleting interface address

Handle add/change interface alias

Get point-to-point address

Set point-to-point address

Set interface metric

Global init_frag (int argc, char **argv)
Simulate fragment timeout
Global init_localport (void)

Make empherical port range configurable.

Use some hashing technique to speed up find_free_port().

Global init_misc (void)
Global init_timers (void)
check if 8254 PIT is really working
Global ip4_transmit (Socket *socket, const void *tx, unsigned len)
Handle sending fragments with IP optons
Global ip6_transmit (Socket *socket, const void *tx, unsigned len)
support fragmentation
Global is_watt32_func (const char *func)
Fill in the rest (use a generated table?)
Global main (int argc, char **argv)
Make a echo client/server test program
Global match_ip6_dest (const in6_Header *ip)
needs work
Global mtu_blackhole
Add PMTU blackhole detection
Global mtu_discover
Add PMTU discovery method
Global new_abort_handler (int sig)
: show a better MessageBox(). Show backtrace from where abort() was called; skip the 2 first CRT locations (raise, abort). Indent the printout 2 spaces.
Global ods_printf (const char *fmt, va_list arg)
: Needs to be rewritten to handle line-buffering. !!
Global open_wanpacket_adapter (const char *name)
File pcigmp.c
Support IGMP v3 (draft-ietf-idmr-igmp-v3-??.txt)
Global pkt_api_entry (IREGS *reg, unsigned line)
Use 32-bit API; accessing card via pmode driver
Global pkt_release (void)
We might be called between 1st and 2nd packet-driver upcall. Need to wait for 2nd upcall to finish or else freeing the RMCB too early could cause a crash or a stuck PKTDRVR.
Global pkt_send (const void *tx, int length)
Change this so that we doesn't retry if the driver was stuck for "too long". I've seen drivers using approx. 100 msec on each iteration below. Retrying if the driver is stuck is not worth the time.
Global pkt_strerror (int code)
Return strings for these: PDERR_GEN_FAIL PDERR_NO_DRIVER PDERR_NO_CLASS PDERR_NO_MULTICAST PDERR_NO_SPACE
  • GetLastError(). Use win_strerror()
Global PmGlueEnd (void)
Support 32-bit Watcom with X32VM
Global pppoe_start (void)
Fix-me: The new MTU/MSS affects all connections (also those which doesn't use PPPoE framing).
Global priv_addr (DWORD ip)
: rewrite using mask_len().
Global query_init_ip6 (struct DNS_query *q, const void *addr)
Use "ip6.arpa" bitstring format ?
Global raw6_rx_buf (_raw6_Socket *raw, DWORD size)
Support setting Rx-buffer size of raw IPv6 sockets
Global raw6_tx_buf (_raw6_Socket *raw, DWORD size)
Support setting Tx-buffer size of raw IPv6 sockets
Global raw_rx_buf (_raw_Socket *raw, DWORD size)
Support setting Rx-buffer size of raw IPv4 sockets
Global raw_tx_buf (_raw_Socket *raw, DWORD size)
Support setting Tx-buffer size of raw IPv4 sockets
Global ReadEthersFile (void)
: Assert that.
Global res_mkquery (int op, const char *dname, int Class, int type, const u_char *data, int datalen, const u_char *newrr_in, u_char *buf, int buflen)
Handle STATUS case
Global rmcb [MAX_WRAPPERS]
find the real application start
Class route_entry
: Move to route.c
Global sarp_receive (const struct sarp_Packet *sarp)
Global set_proto (int type, BOOL is_ip6, int *proto)
IPPROTO_XTP
Global set_vend_class (const char *value)
Support setting vendor class
Global sethostname (const char *fqdn, SETHOSTNAME_ARG2 len)
: should do complete alpha/digit/underscore check here
Global setup_pkt_inf (void)
Make dynamic allocation based on 'pkt_num_rx_bufs'. Allocate multiple 64kB blocks if needed (would involve messy 16-bit coding in asmpkt.nas).
Global shutdown (int, int)

For tcp, should send FIN when all Tx data has been ack'ed. close_s(s) should be same as shutdown(s,SHUT_WR)

For tcp, should send RST if we get incoming data. Don't send ICMP error.

Global sock_getcw (sock_type *s)
Wide character version of sock_getc()
Global sock_getsw (sock_type *s, wchar_t *data, int n)
Wide character version of sock_gets()
Global sock_packet_receive (Socket *sock, void *buf, unsigned len, struct sockaddr *from, size_t *fromlen)

This should loop until some packet is received.

should check fromlen is large enough

Global sock_putcw (sock_type *s, wchar_t ch)
Wide character versions of above functions.
Global sock_puts (sock_type *s, const BYTE *data)
suppport UDP frags
Global sock_putsw (sock_type *s, const wchar_t *data)
Wide character version of sock_puts()
Global sock_raw4_recv (const in_Header *ip)
Handle receiving bad IP-packets for SOCK_RAW sockets.
Global split_ip6 (struct pkt_split *, const in6_Header *)
Handle Fragment, ESP, AUTH, IPv6 encap
Global std_negotiation (struct ppp_state *state, struct ppp_xcp *xcp)
extract LCP_MRU option
File syslog.c
configure variables in syslog2.c when calling openlog() thus making syslog() independent of watt_sock_init().
Global tcp_listen (_tcp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler, WORD timeout)
use mss from setsockopt()
Global tcp_open (_tcp_Socket *s, WORD lport, DWORD ip, WORD rport, ProtoHandler handler)

use TCP_NODELAY set in setsockopt()

use mss from setsockopt()

Global tcp_process_data (_tcp_Socket *s, const tcp_Header *tcp, int len, int *flags)
Handle Out-of-Order urgent data. Raise SIGURG.
Global tcp_reassemble (_tcp_Socket *s, const tcp_Header *tcp, const BYTE *data, UINT len, int *flags)
Create a better TCP reassembler some day. Current logic only handles 1 missed segment. We should handle at least 2.
Global tcp_receive (Socket *sock, void *buf, int len, int flags, struct sockaddr *from, size_t *fromlen)
Handle receiving Out-of-Band data
Global tcp_Retransmitter (BOOL force)

Allow for 3 SYN before giving up

set "Slow-start" threshold

Global tcp_rtt_win (_tcp_Socket *s)
Use the threshold to signify "end-of-Slow-Start" (equilibrium)
Global tcp_Socket::missed_seq [2]
Make a proper re-assembly queue. missed_seq[0] is left edge of missing segment. missed_seq[1] is right edge (in peer's absolute SEQ space)
Global tcp_Socket::tx_wscale
window scales shifts, Tx/Rx
Global tcp_synsent_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
recalculate RTT-timer
Global tcp_tick (sock_type *s)
Limit the time spent here (clamp # of loops)
Global tcp_transmit (Socket *socket, const void *buf, unsigned len, int flags)
Allow non-blocking sockets to send in SYNSENT state
File tftp.c
Support option negotiation and ETFTP (RFC-1986)
File timer.c
To get rid of the timer problem once and for all we need a timer ISR that increments a 32-bit value no regard to day roll-over etc. Maybe hook up IRQ 8 to call a real-mode stub that we opy to DOS-memory (similar to the pkt_receiver stub code. Then far-peek at that timer variable.
Global tok_ifnet (void)
fill info
Global udp_demux (const in_Header *ip, BOOL ip_bcast, DWORD destin, WORD srcPort, WORD dstPort, BOOL *udp_err)
use some kind of hashing to speed up the search.
Global udp_loopback (udp_Header *udp, unsigned udp_len)

UDP loopback handler should handle DISCARD protocol

UDP loopback handler should handle ECHO protocol

Global udp_receive (Socket *sock, void *buf, int len, int flags, struct sockaddr *from, size_t *fromlen)
This needs a redesign
Global update_in_stat (void)

Count these IPv6 protocols

Count PPP protocols LCP and IPCP

Global update_out_stat (void)

Count the PPP protocols LCP and IPCP

Count these IPv6 protocols

Global user_name [MAX_VALUELEN+1]
PPP user/passwd not handled
Global W32_GCC_FUNC_TYPE_WARN_DEF () static void W32_CALL echo_discard_daemon(void)
handle jumbo packets (IP-fragments)
Global waterm_ioctrl (Socket *socket, long cmd, void *argp)

OOB data available?

set low watermark

get high watermark

set high watermark

get low watermark

Global watt_sock_init (size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
Use auto-configuration and set 'my_ip_addr' to 169.254/16
Global winpcap_recv_thread (void *arg)
: Take the 'adapter' info from 'arg' instead of using the global '_pkt_inf' structure.


Watt-32 tcp/ip: Deprecated List

Deprecated List
File bsdname.c
Oldstyle BSD similar functions are prefixed with '_'.
File netback.c
Background ISR.
File pcslip.h
Global set_ttimeout (unsigned ticks)
. Not needed in Watt-32. Return timeout from ticks.
Global tcp_cbrk (int mode)
. Actually simply a macro in <tcp.h>


Watt-32 tcp/ip: Data Structures

  • Data Structure Index
  • Data Fields
Data Structures
Here are the data structures with brief descriptions:
[detail level 123]
C __res_sort |
C __res_state |
►C __u_spcl |
C s_spcl |
C _code |
C _DOT11_AUTH_CIPHER_PAIR |
C _DOT11_SSID |
C _GEN_GET_NETCARD_TIME |
C _GEN_GET_TIME_CAPS |
C _hostent |
C _hostent6 |
C _MIB_IF_ROW2 |
C _MIB_IF_TABLE2 |
C _MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES |
C _MIB_IPFORWARD_ROW2 |
C _MIB_IPFORWARD_TABLE2 |
C _MIB_IPINTERFACE_ROW |
C _MIB_IPNET_ROW2 |
C _MIB_IPNET_TABLE2 |
C _NDIS_CO_LINK_SPEED |
C _NDIS_IRDA_PACKET_INFO |
C _NDIS_STATISTICS_VALUE |
C _NDIS_VAR_DATA_DESC |
C _NET_PNP_ID |
C _NET_PNP_TRANSLATE_LIST |
C _netent |
C _NL_BANDWIDTH_INFORMATION |
C _pkt |
C _protoent |
C _raw6_Socket |
C _raw_Socket |
C _servent |
C _SOCKET_ADDRESS |
C _WLAN_ASSOCIATION_ATTRIBUTES |
C _WLAN_AUTH_CIPHER_PAIR_LIST |
C _WLAN_AVAILABLE_NETWORK |
C _WLAN_AVAILABLE_NETWORK_LIST |
C _WLAN_BSS_ENTRY |
C _WLAN_BSS_LIST |
C _WLAN_CONNECTION_ATTRIBUTES |
C _WLAN_DEVICE_SERVICE_GUID_LIST2 |
C _WLAN_INTERFACE_CAPABILITY |
C _WLAN_INTERFACE_INFO |
C _WLAN_INTERFACE_INFO_LIST |
C _WLAN_MAC_FRAME_STATISTICS |
C _WLAN_PHY_FRAME_STATISTICS |
C _WLAN_PHY_RADIO_STATE |
C _WLAN_RADIO_STATE |
C _WLAN_RATE_SET |
C _WLAN_SECURITY_ATTRIBUTES |
C _WLAN_STATISTICS |
C _WSAQuerySetA |
C accepted_reply |
C ADAPTER | Describes an opened network adapter
C ADAPTER_INFO | Contains some information about a network adapter
C addrinfo |
C afd |
C ah |
C ah_algorithm |
C ah_algorithm_state |
C arc_header |
►C arccom |
C ac_frag |
C arcnet_Header |
C arcnet_Packet |
C arp |
C arp_entry |
C arp_Header |
C arpcom |
C arpreq |
C arptab |
C async_iocb |
C atm_pseudoioctl |
C atmllc |
►C AUTH |
C auth_ops |
C authdes_cred |
C authdes_fullname |
C authdes_verf |
C authunix_parms |
C ax25_Header |
C ax25_Packet |
C bootp |
C bootp_vend |
C bpf_d |
C bpf_hdr | Berkeley Packet Filter header
C bpf_if |
C bpf_insn |
C bpf_program |
C bpf_stat |
C bpf_version |
C cache_stat |
C call_body |
C callout |
►C CLIENT |
C clnt_ops |
C cmd_block | Run a COMMAND.COM/4DOS external/internal command
C cmsghdr |
C code |
C compressor |
C compstat |
C config_s |
C config_table |
C conv_t |
C cookieMessage |
C cr0 |
C cr0_bits |
C cryptkeyarg |
C cryptkeyres |
C cstate |
C ct_data_s |
C CTL_MSG |
C CTL_RESPONSE |
C datum |
C des_block |
C dhcp |
C DHCP_list |
C DNS_Header | Another definition of 'struct DNS_head'
C DNS_Query |
C DNS_query |
C DNS_resource |
C do_redirect |
C dom_binding |
C DPMI_callback |
C DPMI_regs |
C eflags |
C eflags_bits |
C Elem |
C esp |
C esp_algorithm |
C esptail |
C eth_Header |
C eth_Packet |
C ethent |
C ether_arp |
C ether_header |
C ether_multi |
C ether_multistep |
C explore |
C FAULT_STRUC |
C FCFILE |
C fd_set |
C fddi_Header |
C fddi_Packet |
C For |
C frag_bucket |
C frag_ctrl |
C frag_key |
C frmrinfo |
C full_tcpiphdr |
C gate_entry |
C getcredres |
C gz_stream |
C HEADER |
C hole |
C host_list |
C hostent |
C huge_ip |
C icmp |
C icmp6_cache |
C ICMP6_echo |
C icmp6_ifstat |
C ICMP6_MTU |
C icmp6_namelookup |
C ICMP6_nd_adv |
C ICMP6_nd_ra |
C ICMP6_nd_sol |
C icmp6_nodeinfo |
C ICMP6_PKT |
C ICMP6_pointer |
C ICMP6_route_adv |
C ICMP6_route_sol |
C icmp6_router_renum |
C ICMP6_unused |
C icmp6errstat |
C icmp6stat |
C ICMP_addr_mask |
C ICMP_echo |
C ICMP_info |
C ICMP_ip |
C ICMP_needfrag |
C ICMP_PKT |
C ICMP_pointer |
C ICMP_timestamp |
C ICMP_traceroute |
C ICMP_unused |
C icmpstat |
C iconv_table |
C if_data |
C if_msghdr |
C if_set |
C ifa_msghdr |
C ifaddr |
C ifaliasreq |
C ifconf |
C ifmedia_description |
C ifmediareq |
C ifnet |
C ifpppcstatsreq |
C ifpppstatsreq |
C ifprefix |
C ifqueue |
C ifreq |
C igmpmsg |
C igmpstat |
C IGMPv0_packet |
C IGMPv1_packet |
C IGMPv2_packet |
C IGMPv3_packet |
C in6_addr |
C in6_addrlifetime |
C in6_aliasreq |
C in6_defrouter |
C in6_drlist |
C in6_Header |
C in6_ifaddr |
C in6_ifreq |
C in6_ifstat |
C in6_multi |
C in6_multi_mship |
C in6_multistep |
C in6_nbrinfo |
C in6_ndifreq |
C in6_ndireq |
C in6_ondireq |
C in6_pktinfo |
C in6_prefix |
C in6_prefixreq |
C in6_prflags |
C in6_prlist |
►C in6_rrenumreq |
C irr_raflagmask |
C in_addr |
C in_aliasreq |
C in_Header |
C in_ifaddr |
C in_multi |
C inet6_ndpr_msghdr |
C inflate_state |
C inpcb |
C inpcbinfo |
C inpcbpolicy |
C internal_state |
C IOCTL_BUFFER |
C IOCTL_INFO |
C iovec |
C ip6_dest |
C ip6_ext |
C ip6_frag |
C ip6_fw |
C ip6_fw_chain |
C ip6_fw_if |
C ip6_hbh |
C ip6_moptions |
C ip6_packet |
C ip6_pktopts |
C ip6_RouteHdr |
C ip6_rthdr |
C ip6_rthdr0 |
C ip6asfrag |
C ip6aux |
C ip6ctlparam |
C ip6po_rhinfo |
C ip6protosw |
C ip6q |
C ip6stat |
C ip_fw |
C ip_fw_chain |
C ip_moptions |
C ip_mreq |
C ip_opts |
C ip_Packet |
►C ip_timestamp |
►C ipt_timestamp |
C ipt_ta |
C ipasfrag |
C ipcomp |
C ipcomp_algorithm |
C ipoption |
C ipsec_history |
C ipsec_output_state |
C ipsecrequest |
C ipsecstat |
C ipstat |
C ipv6_fraghdr |
C ipv6_mreq |
C ipv6_options |
C ipv6_rt0_hdr |
C ipv6_rt_hdr |
C IREGS |
C itimerval |
C Language |
C link_Packet |
C llc_Header |
C llc_Packet |
C llinfo_nd6 |
C LoadTable |
C macstat |
C mbuf |
C MD5_CTX |
C mf6c |
C mf6cctl |
C mfc |
C mfcctl |
C MIB_IPNETROW |
C MIB_IPNETTABLE |
C mif6 |
C mif6ctl |
C mld_hdr |
C mrt6msg |
C mrt6stat |
C mrtstat |
C msghdr |
C MultiCast | Multicast internal structure
C nd_defrouter |
C nd_ifinfo |
C nd_neighbor_advert |
C nd_neighbor_solicit |
C nd_opt_hdr |
C nd_opt_mtu |
C nd_opt_prefix_info |
C nd_opt_rd_hdr |
C nd_opt_route_info |
C nd_opts |
C nd_pfxrouter |
C nd_prefix |
C nd_redirect |
C nd_router_advert |
C nd_router_solicit |
C netauth |
C netent |
C netinfo |
C netobj |
C newah |
C newesp |
C ni_reply_fqdn |
C Node |
C npf_if_addr | Addresses of a network adapter
C npioctl |
C omrt6msg |
C one_addr |
C opaque_auth |
C option_state |
C ortentry |
C osockaddr |
C outmp |
C packet_mreq |
C PACKET_OID_DATA | Structure containing an OID request
C pim |
C pim6stat |
C ping_cache |
C ping_pkt |
C pkt_info | Placeholder for vital data accessed by capture thread
C pkt_ringbuf | FIFO style ring-buffer
C pkt_rx_element |
C pkt_split |
C PktParameters |
C PktStats |
C PM_driver |
C pmap |
C pmaplist |
C pollfd |
C ppp_comp_stats |
C ppp_dispatch |
C ppp_idle |
C ppp_option_data |
C ppp_softc |
C ppp_state |
C ppp_stats |
C ppp_xcp |
C pppoe_Header |
C pppoe_Packet |
C pppoestat |
C pppstat |
C prefix_table |
C prf_ra |
C prf_rr |
C proc |
C protoent |
C ptr_table_s |
C radix_mask |
C radix_node |
C radix_node_head |
C rarp |
C rawcb |
C REAL_regs |
C recv_buf |
C recv_data |
C rejected_reply |
C reply_body |
C rip |
C rip6stat |
C RMC_BLK |
C RMCB_record |
C RMI_BLK |
C rmtcallargs |
C rmtcallres |
C rmxp_tao |
C route |
C route_cb |
C route_entry |
C route_in6 |
C router_info |
►C rp_addr |
C ra_flags |
C rpc_createerr |
C rpc_err |
C rpc_msg |
C rpcent |
C rr_pco_match |
C rr_pco_use |
►C rr_prefix |
C rp_stateflags |
C rr_result |
C rrec |
C rt_addrinfo |
C rt_metrics |
C rt_msghdr |
C rtdetq |
C rtentry |
C rtstat |
C run_list | Register an on-startup/at-exit function
C sackblock |
C sadb_address |
C sadb_alg |
C sadb_comb |
C sadb_ext |
C sadb_ident |
C sadb_key |
C sadb_lifetime |
C sadb_msg |
C sadb_prop |
C sadb_sa |
C sadb_sens |
C sadb_spirange |
C sadb_supported |
C sadb_x_ipsecrequest |
C sadb_x_kmprivate |
C sadb_x_policy |
C sadb_x_sa2 |
C sarp_Auth |
C sarp_Packet |
C scoreboard |
C scrb_entry |
C sctp_ChunkDesc |
C sctp_CookiePreserve |
C sctp_CWR |
C sctp_DataPart |
C sctp_DNSName |
C sctp_ECN_echo |
C sctp_HBrequest |
C sctp_HBsender |
C sctp_HBunified |
C sctp_Header |
C sctp_Initiation |
C sctp_OpErrorCause |
C sctp_ParamDesc |
C sctp_RelChunkDesc |
C sctp_SelectiveAck |
C sctp_SelectiveFrag |
C sctp_SendableInit |
C sctp_Shutdown |
C sctp_TimeStamp |
C sctp_UnifiedAbort |
C sctp_UnifiedAbortHeavy |
C sctp_UnifiedAbortLight |
C sctp_UnifiedDatagram |
C sctp_UnifiedInit |
C sctp_UnifiedOpError |
C sctp_UnifiedSack |
C sctp_UnifiedShutdown |
C sctp_UnifiedSingleMsg |
C sctp_UnifiedStreamError |
C sctp_V4IpAddress |
C sctp_V6IpAddress |
C sctp_VendorSpecificParam |
C search_list |
C secpolicy |
C secpolicyindex |
C secspacq |
C selinfo |
C servent |
C setup_info_st |
C short_hand_verf |
C signal_table |
C sioc_mif_req6 |
C sioc_sg_req |
C sioc_sg_req6 |
C sioc_vif_req |
C sl_softc |
C slcompress |
C sock_packet_buf |
C sock_packet_pool |
C sock_type |
C sockaddr |
C sockaddr_dl |
C sockaddr_in |
C sockaddr_in6 |
C sockaddr_ll |
C sockaddr_pkt |
C sockaddr_storage |
C sockaddr_un |
C socket |
C Socket |
C sockinet |
C sockproto |
C SRxBuffer |
C staleCookieMsg |
C static_tree_desc_s |
C strip_softc |
C Summary16 |
C svc_req |
►C SVCXPRT |
C xp_ops |
C SWI_REGS |
C SwsVpktAdapterState |
C SwsVpktOpenInfo |
C SwsVpktUsr |
C SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION |
C tad_entry |
C tbf |
C tcp6_pkt |
C tcp_debug |
C tcp_Header |
C tcp_pkt |
C tcp_PseudoHeader |
C tcp_PseudoHeader6 |
C tcp_reasm |
C tcp_rtt |
C tcp_Socket |
C tcpcb |
C tcpopt |
C tcpstat |
C timespec |
C timeval |
C timezone |
C tms |
C tok |
C tok_Header |
C tok_Packet |
C token |
C tpacket_hdr |
C tpacket_req |
C tpacket_stats |
C tree_desc_s |
C tsp |
C tun_softc |
C udp_Header |
C udp_Socket | ARP definitions
C udphdr |
C ulong_long |
C unixcred |
C URL |
C vif |
C vifctl |
C vjstat |
C vlan_Header |
C vlan_Packet |
C watt_sockaddr |
►C whod |
C whoent |
C winsock_fd_set |
C WLAN_AUTH_CIPHER_PAIR_LIST2 |
C WSAData |
C wstat |
C xcp_type |
►C XDR |
C xdr_ops |
C xdr_discrim |
C ypall_callback |
C ypbind_binding |
C ypbind_resp |
C ypbind_setdom |
C ypmap_parms |
C ypmaplist |
C yppushresp_xfr |
C ypreq_key |
C ypreq_nokey |
C ypreq_xfr |
C ypresp_key_val |
C ypresp_maplist |
C ypresp_master |
C ypresp_order |
C ypresp_val |
C yy_buffer_state |
C yy_trans_info |
C z_stream_s |


Watt-32 tcp/ip: __res_sort Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
__res_sort Struct Reference
Collaboration diagram for __res_sort:
[legend]

Data Fields

struct in_addr | addr
u_long | mask

Detailed Description

Definition at line 120 of file resolv.h.

Field Documentation

◆ addr

struct in_addr __res_sort::addr

Definition at line 121 of file resolv.h.

◆ mask

u_long __res_sort::mask

Definition at line 122 of file resolv.h.


Watt-32 tcp/ip: __res_state Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
__res_state Struct Reference
Collaboration diagram for __res_state:
[legend]

Data Fields

int | retrans
int | retry
u_long | options
int | nscount
struct sockaddr_in | nsaddr_list [MAXNS]
u_short | id
char * | dnsrch [MAXDNSRCH+1]
char | defdname [MAXDNAME]
u_long | pfcode
unsigned | ndots: 4
unsigned | nsort: 4
char | unused [3]
struct __res_sort | sort_list [MAXRESOLVSORT]
char | pad [72]

Detailed Description

Definition at line 125 of file resolv.h.

Field Documentation

◆ defdname

char __res_state::defdname[MAXDNAME]

Definition at line 135 of file resolv.h.

◆ dnsrch

char* __res_state::dnsrch[MAXDNSRCH+1]

Definition at line 134 of file resolv.h.

◆ id

u_short __res_state::id

Definition at line 133 of file resolv.h.

◆ ndots

unsigned __res_state::ndots

Definition at line 137 of file resolv.h.

◆ nsaddr_list

struct sockaddr_in __res_state::nsaddr_list[MAXNS]

Definition at line 131 of file resolv.h.

◆ nscount

int __res_state::nscount

Definition at line 129 of file resolv.h.

◆ nsort

unsigned __res_state::nsort

Definition at line 138 of file resolv.h.

◆ options

u_long __res_state::options

Definition at line 128 of file resolv.h.

◆ pad

char __res_state::pad[72]

Definition at line 141 of file resolv.h.

◆ pfcode

u_long __res_state::pfcode

Definition at line 136 of file resolv.h.

◆ retrans

int __res_state::retrans

Definition at line 126 of file resolv.h.

◆ retry

int __res_state::retry

Definition at line 127 of file resolv.h.

◆ sort_list

struct __res_sort __res_state::sort_list[MAXRESOLVSORT]

Definition at line 140 of file resolv.h.

◆ unused

char __res_state::unused[3]

Definition at line 139 of file resolv.h.


Watt-32 tcp/ip: __u_spcl Union Reference

  • Data Structure Index
  • Data Fields
Data Structures | Data Fields
__u_spcl Union Reference
Collaboration diagram for __u_spcl:
[legend]

Data Structures

struct s_spcl

Data Fields

char | dummy [TP_BSIZE]
struct __u_spcl::s_spcl | s_spcl

Detailed Description

Definition at line 73 of file dumprest.h.

Field Documentation

◆ dummy

char __u_spcl::dummy[TP_BSIZE]

Definition at line 74 of file dumprest.h.


Watt-32 tcp/ip: __u_spcl::s_spcl Struct Reference

  • Data Structure Index
  • Data Fields
  • __u_spcl
  • s_spcl
Data Fields
__u_spcl::s_spcl Struct Reference
Collaboration diagram for __u_spcl::s_spcl:
[legend]

Data Fields

int32_t | c_type
time_t | c_date
time_t | c_ddate
int32_t | c_volume
daddr_t | c_tapea
u_int32_t | c_inumber
int32_t | c_magic
int32_t | c_checksum
int32_t | c_count
char | c_addr [TP_NINDIR]
char | c_label [LBLSIZE]
int32_t | c_level
char | c_filesys [NAMELEN]
char | c_dev [NAMELEN]
char | c_host [NAMELEN]
int32_t | c_flags
int32_t | c_firstrec
int32_t | c_spare [32]

Detailed Description

Definition at line 75 of file dumprest.h.

Field Documentation

◆ c_addr

char __u_spcl::s_spcl::c_addr[TP_NINDIR]

Definition at line 86 of file dumprest.h.

◆ c_checksum

int32_t __u_spcl::s_spcl::c_checksum

Definition at line 83 of file dumprest.h.

◆ c_count

int32_t __u_spcl::s_spcl::c_count

Definition at line 85 of file dumprest.h.

◆ c_date

time_t __u_spcl::s_spcl::c_date

Definition at line 77 of file dumprest.h.

◆ c_ddate

time_t __u_spcl::s_spcl::c_ddate

Definition at line 78 of file dumprest.h.

◆ c_dev

char __u_spcl::s_spcl::c_dev[NAMELEN]

Definition at line 90 of file dumprest.h.

◆ c_filesys

char __u_spcl::s_spcl::c_filesys[NAMELEN]

Definition at line 89 of file dumprest.h.

◆ c_firstrec

int32_t __u_spcl::s_spcl::c_firstrec

Definition at line 93 of file dumprest.h.

◆ c_flags

int32_t __u_spcl::s_spcl::c_flags

Definition at line 92 of file dumprest.h.

◆ c_host

char __u_spcl::s_spcl::c_host[NAMELEN]

Definition at line 91 of file dumprest.h.

◆ c_inumber

u_int32_t __u_spcl::s_spcl::c_inumber

Definition at line 81 of file dumprest.h.

◆ c_label

char __u_spcl::s_spcl::c_label[LBLSIZE]

Definition at line 87 of file dumprest.h.

◆ c_level

int32_t __u_spcl::s_spcl::c_level

Definition at line 88 of file dumprest.h.

◆ c_magic

int32_t __u_spcl::s_spcl::c_magic

Definition at line 82 of file dumprest.h.

◆ c_spare

int32_t __u_spcl::s_spcl::c_spare[32]

Definition at line 94 of file dumprest.h.

◆ c_tapea

daddr_t __u_spcl::s_spcl::c_tapea

Definition at line 80 of file dumprest.h.

◆ c_type

int32_t __u_spcl::s_spcl::c_type

Definition at line 76 of file dumprest.h.

◆ c_volume

int32_t __u_spcl::s_spcl::c_volume

Definition at line 79 of file dumprest.h.


Watt-32 tcp/ip: _code Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_code Struct Reference
Collaboration diagram for _code:
[legend]

Data Fields

unsigned long | c_val
const char * | c_name

Detailed Description

Definition at line 86 of file syslog.h.

Field Documentation

◆ c_name

const char* _code::c_name

Definition at line 88 of file syslog.h.

◆ c_val

unsigned long _code::c_val

Definition at line 87 of file syslog.h.


Watt-32 tcp/ip: _DOT11_AUTH_CIPHER_PAIR Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_DOT11_AUTH_CIPHER_PAIR Struct Reference
Collaboration diagram for _DOT11_AUTH_CIPHER_PAIR:
[legend]

Data Fields

DOT11_AUTH_ALGORITHM | AuthAlgoId
DOT11_CIPHER_ALGORITHM | CipherAlgoId

Detailed Description

Definition at line 577 of file winadinf.h.

Field Documentation

◆ AuthAlgoId

DOT11_AUTH_ALGORITHM _DOT11_AUTH_CIPHER_PAIR::AuthAlgoId

Definition at line 578 of file winadinf.h.

◆ CipherAlgoId

DOT11_CIPHER_ALGORITHM _DOT11_AUTH_CIPHER_PAIR::CipherAlgoId

Definition at line 579 of file winadinf.h.


Watt-32 tcp/ip: _DOT11_SSID Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_DOT11_SSID Struct Reference
Collaboration diagram for _DOT11_SSID:
[legend]

Data Fields

ULONG | uSSIDLength
UCHAR | ucSSID [DOT11_SSID_MAX_LENGTH]

Detailed Description

Definition at line 361 of file winadinf.h.

Field Documentation

◆ ucSSID

UCHAR _DOT11_SSID::ucSSID[DOT11_SSID_MAX_LENGTH]

Definition at line 363 of file winadinf.h.

◆ uSSIDLength

ULONG _DOT11_SSID::uSSIDLength

Definition at line 362 of file winadinf.h.


Watt-32 tcp/ip: _GEN_GET_NETCARD_TIME Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_GEN_GET_NETCARD_TIME Struct Reference
Collaboration diagram for _GEN_GET_NETCARD_TIME:
[legend]

Data Fields

ULONG ReadTime

Detailed Description

Definition at line 745 of file w32_ndis.h.

Field Documentation

◆ ReadTime

ULONG _GEN_GET_NETCARD_TIME::ReadTime

Definition at line 746 of file w32_ndis.h.


Watt-32 tcp/ip: _GEN_GET_TIME_CAPS Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_GEN_GET_TIME_CAPS Struct Reference
Collaboration diagram for _GEN_GET_TIME_CAPS:
[legend]

Data Fields

ULONG | Flags
ULONG | ClockPrecision

Detailed Description

Definition at line 730 of file w32_ndis.h.

Field Documentation

◆ ClockPrecision

ULONG _GEN_GET_TIME_CAPS::ClockPrecision

Definition at line 732 of file w32_ndis.h.

◆ Flags

ULONG _GEN_GET_TIME_CAPS::Flags

Definition at line 731 of file w32_ndis.h.


Watt-32 tcp/ip: _hostent Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_hostent Struct Reference

#include <get_xby.h>

Collaboration diagram for _hostent:
[legend]

Data Fields

char * | h_name
char * | h_aliases [MAX_HOST_ALIASES+1]
int | h_num_addr
DWORD | h_address [MAX_ADDRESSES+1]
DWORD | h_real_ttl
time_t | h_timeout
struct _hostent * | h_next

Detailed Description

Internal hostent structure.

Definition at line 53 of file get_xby.h.

Field Documentation

◆ h_address

DWORD _hostent::h_address[MAX_ADDRESSES+1]

Definition at line 57 of file get_xby.h.

◆ h_aliases

char* _hostent::h_aliases[MAX_HOST_ALIASES+1]

Definition at line 55 of file get_xby.h.

◆ h_name

char* _hostent::h_name

Definition at line 54 of file get_xby.h.

◆ h_next

struct _hostent* _hostent::h_next

Definition at line 60 of file get_xby.h.

◆ h_num_addr

int _hostent::h_num_addr

Definition at line 56 of file get_xby.h.

◆ h_real_ttl

DWORD _hostent::h_real_ttl

Definition at line 58 of file get_xby.h.

◆ h_timeout

time_t _hostent::h_timeout

Definition at line 59 of file get_xby.h.


Watt-32 tcp/ip: _hostent6 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_hostent6 Struct Reference

#include <get_xby.h>

Collaboration diagram for _hostent6:
[legend]

Data Fields

char * | h_name
char * | h_aliases [MAX_HOST_ALIASES+1]
int | h_num_addr
ip6_address | h_address [MAX_ADDRESSES+1]
DWORD | h_real_ttl
time_t | h_timeout
struct _hostent6 * | h_next

Detailed Description

Internal hostent6 structure.

Definition at line 66 of file get_xby.h.

Field Documentation

◆ h_address

ip6_address _hostent6::h_address[MAX_ADDRESSES+1]

Definition at line 70 of file get_xby.h.

◆ h_aliases

char* _hostent6::h_aliases[MAX_HOST_ALIASES+1]

Definition at line 68 of file get_xby.h.

◆ h_name

char* _hostent6::h_name

Definition at line 67 of file get_xby.h.

◆ h_next

struct _hostent6* _hostent6::h_next

Definition at line 73 of file get_xby.h.

◆ h_num_addr

int _hostent6::h_num_addr

Definition at line 69 of file get_xby.h.

◆ h_real_ttl

DWORD _hostent6::h_real_ttl

Definition at line 71 of file get_xby.h.

◆ h_timeout

time_t _hostent6::h_timeout

Definition at line 72 of file get_xby.h.


Watt-32 tcp/ip: _MIB_IF_ROW2 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_MIB_IF_ROW2 Struct Reference
Collaboration diagram for _MIB_IF_ROW2:
[legend]

Data Fields

NET_LUID | InterfaceLuid
NET_IFINDEX | InterfaceIndex
GUID | InterfaceGuid
WCHAR | Alias [IF_MAX_STRING_SIZE+1]
WCHAR | Description [IF_MAX_STRING_SIZE+1]
ULONG | PhysicalAddressLength
UCHAR | PhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH]
UCHAR | PermanentPhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH]
ULONG | Mtu
IFTYPE | Type
TUNNEL_TYPE | TunnelType
NDIS_MEDIUM | MediaType
NDIS_PHYSICAL_MEDIUM | PhysicalMediumType
NET_IF_ACCESS_TYPE | AccessType
NET_IF_DIRECTION_TYPE | DirectionType
struct {
BOOLEAN HardwareInterface: 1
BOOLEAN FilterInterface: 1
BOOLEAN ConnectorPresent: 1
BOOLEAN NotAuthenticated: 1
BOOLEAN NotMediaConnected: 1
BOOLEAN Paused: 1
BOOLEAN LowPower: 1
BOOLEAN EndPointInterface: 1
} InterfaceAndOperStatusFlags
IF_OPER_STATUS | OperStatus
NET_IF_ADMIN_STATUS | AdminStatus
NET_IF_MEDIA_CONNECT_STATE | MediaConnectState
NET_IF_NETWORK_GUID | NetworkGuid
NET_IF_CONNECTION_TYPE | ConnectionType
ULONG64 | TransmitLinkSpeed
ULONG64 | ReceiveLinkSpeed
ULONG64 | InOctets
ULONG64 | InUcastPkts
ULONG64 | InNUcastPkts
ULONG64 | InDiscards
ULONG64 | InErrors
ULONG64 | InUnknownProtos
ULONG64 | InUcastOctets
ULONG64 | InMulticastOctets
ULONG64 | InBroadcastOctets
ULONG64 | OutOctets
ULONG64 | OutUcastPkts
ULONG64 | OutNUcastPkts
ULONG64 | OutDiscards
ULONG64 | OutErrors
ULONG64 | OutUcastOctets
ULONG64 | OutMulticastOctets
ULONG64 | OutBroadcastOctets
ULONG64 | OutQLen

Detailed Description

Definition at line 282 of file winadinf.h.

Field Documentation

◆ AccessType

NET_IF_ACCESS_TYPE _MIB_IF_ROW2::AccessType

Definition at line 296 of file winadinf.h.

◆ AdminStatus

NET_IF_ADMIN_STATUS _MIB_IF_ROW2::AdminStatus

Definition at line 310 of file winadinf.h.

◆ Alias

WCHAR _MIB_IF_ROW2::Alias[IF_MAX_STRING_SIZE+1]

Definition at line 286 of file winadinf.h.

◆ ConnectionType

NET_IF_CONNECTION_TYPE _MIB_IF_ROW2::ConnectionType

Definition at line 313 of file winadinf.h.

◆ ConnectorPresent

BOOLEAN _MIB_IF_ROW2::ConnectorPresent

Definition at line 301 of file winadinf.h.

◆ Description

WCHAR _MIB_IF_ROW2::Description[IF_MAX_STRING_SIZE+1]

Definition at line 287 of file winadinf.h.

◆ DirectionType

NET_IF_DIRECTION_TYPE _MIB_IF_ROW2::DirectionType

Definition at line 297 of file winadinf.h.

◆ EndPointInterface

BOOLEAN _MIB_IF_ROW2::EndPointInterface

Definition at line 306 of file winadinf.h.

◆ FilterInterface

BOOLEAN _MIB_IF_ROW2::FilterInterface

Definition at line 300 of file winadinf.h.

◆ HardwareInterface

BOOLEAN _MIB_IF_ROW2::HardwareInterface

Definition at line 299 of file winadinf.h.

◆ InBroadcastOctets

ULONG64 _MIB_IF_ROW2::InBroadcastOctets

Definition at line 324 of file winadinf.h.

◆ InDiscards

ULONG64 _MIB_IF_ROW2::InDiscards

Definition at line 319 of file winadinf.h.

◆ InErrors

ULONG64 _MIB_IF_ROW2::InErrors

Definition at line 320 of file winadinf.h.

◆ InMulticastOctets

ULONG64 _MIB_IF_ROW2::InMulticastOctets

Definition at line 323 of file winadinf.h.

◆ InNUcastPkts

ULONG64 _MIB_IF_ROW2::InNUcastPkts

Definition at line 318 of file winadinf.h.

◆ InOctets

ULONG64 _MIB_IF_ROW2::InOctets

Definition at line 316 of file winadinf.h.

◆ InterfaceGuid

GUID _MIB_IF_ROW2::InterfaceGuid

Definition at line 285 of file winadinf.h.

◆ InterfaceIndex

NET_IFINDEX _MIB_IF_ROW2::InterfaceIndex

Definition at line 284 of file winadinf.h.

◆ InterfaceLuid

NET_LUID _MIB_IF_ROW2::InterfaceLuid

Definition at line 283 of file winadinf.h.

◆ InUcastOctets

ULONG64 _MIB_IF_ROW2::InUcastOctets

Definition at line 322 of file winadinf.h.

◆ InUcastPkts

ULONG64 _MIB_IF_ROW2::InUcastPkts

Definition at line 317 of file winadinf.h.

◆ InUnknownProtos

ULONG64 _MIB_IF_ROW2::InUnknownProtos

Definition at line 321 of file winadinf.h.

◆ LowPower

BOOLEAN _MIB_IF_ROW2::LowPower

Definition at line 305 of file winadinf.h.

◆ MediaConnectState

NET_IF_MEDIA_CONNECT_STATE _MIB_IF_ROW2::MediaConnectState

Definition at line 311 of file winadinf.h.

◆ MediaType

NDIS_MEDIUM _MIB_IF_ROW2::MediaType

Definition at line 294 of file winadinf.h.

◆ Mtu

ULONG _MIB_IF_ROW2::Mtu

Definition at line 291 of file winadinf.h.

◆ NetworkGuid

NET_IF_NETWORK_GUID _MIB_IF_ROW2::NetworkGuid

Definition at line 312 of file winadinf.h.

◆ NotAuthenticated

BOOLEAN _MIB_IF_ROW2::NotAuthenticated

Definition at line 302 of file winadinf.h.

◆ NotMediaConnected

BOOLEAN _MIB_IF_ROW2::NotMediaConnected

Definition at line 303 of file winadinf.h.

◆ OperStatus

IF_OPER_STATUS _MIB_IF_ROW2::OperStatus

Definition at line 309 of file winadinf.h.

◆ OutBroadcastOctets

ULONG64 _MIB_IF_ROW2::OutBroadcastOctets

Definition at line 332 of file winadinf.h.

◆ OutDiscards

ULONG64 _MIB_IF_ROW2::OutDiscards

Definition at line 328 of file winadinf.h.

◆ OutErrors

ULONG64 _MIB_IF_ROW2::OutErrors

Definition at line 329 of file winadinf.h.

◆ OutMulticastOctets

ULONG64 _MIB_IF_ROW2::OutMulticastOctets

Definition at line 331 of file winadinf.h.

◆ OutNUcastPkts

ULONG64 _MIB_IF_ROW2::OutNUcastPkts

Definition at line 327 of file winadinf.h.

◆ OutOctets

ULONG64 _MIB_IF_ROW2::OutOctets

Definition at line 325 of file winadinf.h.

◆ OutQLen

ULONG64 _MIB_IF_ROW2::OutQLen

Definition at line 333 of file winadinf.h.

◆ OutUcastOctets

ULONG64 _MIB_IF_ROW2::OutUcastOctets

Definition at line 330 of file winadinf.h.

◆ OutUcastPkts

ULONG64 _MIB_IF_ROW2::OutUcastPkts

Definition at line 326 of file winadinf.h.

◆ Paused

BOOLEAN _MIB_IF_ROW2::Paused

Definition at line 304 of file winadinf.h.

◆ PermanentPhysicalAddress

UCHAR _MIB_IF_ROW2::PermanentPhysicalAddress[IF_MAX_PHYS_ADDRESS_LENGTH]

Definition at line 290 of file winadinf.h.

◆ PhysicalAddress

UCHAR _MIB_IF_ROW2::PhysicalAddress[IF_MAX_PHYS_ADDRESS_LENGTH]

Definition at line 289 of file winadinf.h.

◆ PhysicalAddressLength

ULONG _MIB_IF_ROW2::PhysicalAddressLength

Definition at line 288 of file winadinf.h.

◆ PhysicalMediumType

NDIS_PHYSICAL_MEDIUM _MIB_IF_ROW2::PhysicalMediumType

Definition at line 295 of file winadinf.h.

◆ ReceiveLinkSpeed

ULONG64 _MIB_IF_ROW2::ReceiveLinkSpeed

Definition at line 315 of file winadinf.h.

◆ TransmitLinkSpeed

ULONG64 _MIB_IF_ROW2::TransmitLinkSpeed

Definition at line 314 of file winadinf.h.

◆ TunnelType

TUNNEL_TYPE _MIB_IF_ROW2::TunnelType

Definition at line 293 of file winadinf.h.

◆ Type

IFTYPE _MIB_IF_ROW2::Type

Definition at line 292 of file winadinf.h.


Watt-32 tcp/ip: _MIB_IF_TABLE2 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_MIB_IF_TABLE2 Struct Reference
Collaboration diagram for _MIB_IF_TABLE2:
[legend]

Data Fields

ULONG | NumEntries
MIB_IF_ROW2 | Table [1]

Detailed Description

Definition at line 336 of file winadinf.h.

Field Documentation

◆ NumEntries

ULONG _MIB_IF_TABLE2::NumEntries

Definition at line 337 of file winadinf.h.

◆ Table

MIB_IF_ROW2 _MIB_IF_TABLE2::Table[1]

Definition at line 338 of file winadinf.h.


Watt-32 tcp/ip: _MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES Struct Reference
Collaboration diagram for _MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES:
[legend]

Data Fields

NL_BANDWIDTH_INFORMATION InboundBandwidthInformation
NL_BANDWIDTH_INFORMATION OutboundBandwidthInformation

Detailed Description

Definition at line 1074 of file winadinf.h.

Field Documentation

◆ InboundBandwidthInformation

NL_BANDWIDTH_INFORMATION _MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES::InboundBandwidthInformation

Definition at line 1075 of file winadinf.h.

◆ OutboundBandwidthInformation

NL_BANDWIDTH_INFORMATION _MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES::OutboundBandwidthInformation

Definition at line 1076 of file winadinf.h.


Watt-32 tcp/ip: _MIB_IPFORWARD_ROW2 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_MIB_IPFORWARD_ROW2 Struct Reference
Collaboration diagram for _MIB_IPFORWARD_ROW2:
[legend]

Data Fields

char InterfaceLuid [1]

Detailed Description

Definition at line 1054 of file winadinf.h.

Field Documentation

◆ InterfaceLuid

char _MIB_IPFORWARD_ROW2::InterfaceLuid[1]

Definition at line 1055 of file winadinf.h.


Watt-32 tcp/ip: _MIB_IPFORWARD_TABLE2 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_MIB_IPFORWARD_TABLE2 Struct Reference
Collaboration diagram for _MIB_IPFORWARD_TABLE2:
[legend]

Data Fields

ULONG | NumEntries
MIB_IPFORWARD_ROW2 | Table [1]

Detailed Description

Definition at line 1063 of file winadinf.h.

Field Documentation

◆ NumEntries

ULONG _MIB_IPFORWARD_TABLE2::NumEntries

Definition at line 1064 of file winadinf.h.

◆ Table

MIB_IPFORWARD_ROW2 _MIB_IPFORWARD_TABLE2::Table[1]

Definition at line 1065 of file winadinf.h.


Watt-32 tcp/ip: _MIB_IPINTERFACE_ROW Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_MIB_IPINTERFACE_ROW Struct Reference
Collaboration diagram for _MIB_IPINTERFACE_ROW:
[legend]

Data Fields

char InterfaceLuid [1]

Detailed Description

Definition at line 1050 of file winadinf.h.

Field Documentation

◆ InterfaceLuid

char _MIB_IPINTERFACE_ROW::InterfaceLuid[1]

Definition at line 1051 of file winadinf.h.


Watt-32 tcp/ip: _MIB_IPNET_ROW2 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_MIB_IPNET_ROW2 Struct Reference
Collaboration diagram for _MIB_IPNET_ROW2:
[legend]

Data Fields

SOCKADDR_INET | Address
NET_IFINDEX | InterfaceIndex
NET_LUID | InterfaceLuid
UCHAR | PhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH]
ULONG | PhysicalAddressLength
NL_NEIGHBOR_STATE | State
union {
struct {
BOOLEAN IsRouter: 1
BOOLEAN IsUnreachable: 1
}
UCHAR Flags
};
union {
ULONG LastReachable
ULONG LastUnreachable
} ReachabilityTime

Detailed Description

Definition at line 1030 of file winadinf.h.

Field Documentation

◆ Address

SOCKADDR_INET _MIB_IPNET_ROW2::Address

Definition at line 1031 of file winadinf.h.

◆ Flags

UCHAR _MIB_IPNET_ROW2::Flags

Definition at line 1042 of file winadinf.h.

◆ InterfaceIndex

NET_IFINDEX _MIB_IPNET_ROW2::InterfaceIndex

Definition at line 1032 of file winadinf.h.

◆ InterfaceLuid

NET_LUID _MIB_IPNET_ROW2::InterfaceLuid

Definition at line 1033 of file winadinf.h.

◆ IsRouter

BOOLEAN _MIB_IPNET_ROW2::IsRouter

Definition at line 1039 of file winadinf.h.

◆ IsUnreachable

BOOLEAN _MIB_IPNET_ROW2::IsUnreachable

Definition at line 1040 of file winadinf.h.

◆ LastReachable

ULONG _MIB_IPNET_ROW2::LastReachable

Definition at line 1045 of file winadinf.h.

◆ LastUnreachable

ULONG _MIB_IPNET_ROW2::LastUnreachable

Definition at line 1046 of file winadinf.h.

◆ PhysicalAddress

UCHAR _MIB_IPNET_ROW2::PhysicalAddress[IF_MAX_PHYS_ADDRESS_LENGTH]

Definition at line 1034 of file winadinf.h.

◆ PhysicalAddressLength

ULONG _MIB_IPNET_ROW2::PhysicalAddressLength

Definition at line 1035 of file winadinf.h.

◆ State

NL_NEIGHBOR_STATE _MIB_IPNET_ROW2::State

Definition at line 1036 of file winadinf.h.


Watt-32 tcp/ip: _MIB_IPNET_TABLE2 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_MIB_IPNET_TABLE2 Struct Reference
Collaboration diagram for _MIB_IPNET_TABLE2:
[legend]

Data Fields

ULONG | NumEntries
MIB_IPNET_ROW2 | Table [1]

Detailed Description

Definition at line 1058 of file winadinf.h.

Field Documentation

◆ NumEntries

ULONG _MIB_IPNET_TABLE2::NumEntries

Definition at line 1059 of file winadinf.h.

◆ Table

MIB_IPNET_ROW2 _MIB_IPNET_TABLE2::Table[1]

Definition at line 1060 of file winadinf.h.


Watt-32 tcp/ip: _NDIS_CO_LINK_SPEED Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_NDIS_CO_LINK_SPEED Struct Reference
Collaboration diagram for _NDIS_CO_LINK_SPEED:
[legend]

Data Fields

ULONG | Outbound
ULONG | Inbound

Detailed Description

Definition at line 860 of file w32_ndis.h.

Field Documentation

◆ Inbound

ULONG _NDIS_CO_LINK_SPEED::Inbound

Definition at line 862 of file w32_ndis.h.

◆ Outbound

ULONG _NDIS_CO_LINK_SPEED::Outbound

Definition at line 861 of file w32_ndis.h.


Watt-32 tcp/ip: _NDIS_IRDA_PACKET_INFO Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_NDIS_IRDA_PACKET_INFO Struct Reference
Collaboration diagram for _NDIS_IRDA_PACKET_INFO:
[legend]

Data Fields

UINT | ExtraBOFs
UINT | MinTurnAroundTime

Detailed Description

Definition at line 922 of file w32_ndis.h.

Field Documentation

◆ ExtraBOFs

UINT _NDIS_IRDA_PACKET_INFO::ExtraBOFs

Definition at line 923 of file w32_ndis.h.

◆ MinTurnAroundTime

UINT _NDIS_IRDA_PACKET_INFO::MinTurnAroundTime

Definition at line 924 of file w32_ndis.h.


Watt-32 tcp/ip: _NDIS_STATISTICS_VALUE Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_NDIS_STATISTICS_VALUE Struct Reference
Collaboration diagram for _NDIS_STATISTICS_VALUE:
[legend]

Data Fields

NDIS_OID | Oid
ULONG | DataLength
UCHAR | Data [1]

Detailed Description

Definition at line 68 of file w32_ndis.h.

Field Documentation

◆ Data

UCHAR _NDIS_STATISTICS_VALUE::Data[1]

Definition at line 71 of file w32_ndis.h.

◆ DataLength

ULONG _NDIS_STATISTICS_VALUE::DataLength

Definition at line 70 of file w32_ndis.h.

◆ Oid

NDIS_OID _NDIS_STATISTICS_VALUE::Oid

Definition at line 69 of file w32_ndis.h.


Watt-32 tcp/ip: _NDIS_VAR_DATA_DESC Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_NDIS_VAR_DATA_DESC Struct Reference
Collaboration diagram for _NDIS_VAR_DATA_DESC:
[legend]

Data Fields

USHORT | Length
USHORT | MaximumLength
LONG | Offset

Detailed Description

Definition at line 90 of file w32_ndis.h.

Field Documentation

◆ Length

USHORT _NDIS_VAR_DATA_DESC::Length

Definition at line 91 of file w32_ndis.h.

◆ MaximumLength

USHORT _NDIS_VAR_DATA_DESC::MaximumLength

Definition at line 92 of file w32_ndis.h.

◆ Offset

LONG _NDIS_VAR_DATA_DESC::Offset

Definition at line 93 of file w32_ndis.h.


Watt-32 tcp/ip: _NET_PNP_ID Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_NET_PNP_ID Struct Reference
Collaboration diagram for _NET_PNP_ID:
[legend]

Data Fields

ULONG | ClassId
ULONG | Token

Detailed Description

Definition at line 77 of file w32_ndis.h.

Field Documentation

◆ ClassId

ULONG _NET_PNP_ID::ClassId

Definition at line 78 of file w32_ndis.h.

◆ Token

ULONG _NET_PNP_ID::Token

Definition at line 79 of file w32_ndis.h.


Watt-32 tcp/ip: _NET_PNP_TRANSLATE_LIST Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_NET_PNP_TRANSLATE_LIST Struct Reference
Collaboration diagram for _NET_PNP_TRANSLATE_LIST:
[legend]

Data Fields

ULONG | BytesNeeded
NET_PNP_ID | IdArray [ANYSIZE_ARRAY]

Detailed Description

Definition at line 82 of file w32_ndis.h.

Field Documentation

◆ BytesNeeded

ULONG _NET_PNP_TRANSLATE_LIST::BytesNeeded

Definition at line 83 of file w32_ndis.h.

◆ IdArray

NET_PNP_ID _NET_PNP_TRANSLATE_LIST::IdArray[ANYSIZE_ARRAY]

Definition at line 84 of file w32_ndis.h.


Watt-32 tcp/ip: _netent Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_netent Struct Reference

#include <get_xby.h>

Collaboration diagram for _netent:
[legend]

Data Fields

char * | n_name
char * | n_aliases [MAX_NETENT_ALIASES+1]
int | n_addrtype
DWORD | n_net
struct _netent * | n_next

Detailed Description

Internal netent structure.

Definition at line 79 of file get_xby.h.

Field Documentation

◆ n_addrtype

int _netent::n_addrtype

Definition at line 82 of file get_xby.h.

◆ n_aliases

char* _netent::n_aliases[MAX_NETENT_ALIASES+1]

Definition at line 81 of file get_xby.h.

◆ n_name

char* _netent::n_name

Definition at line 80 of file get_xby.h.

◆ n_net

DWORD _netent::n_net

Definition at line 83 of file get_xby.h.

◆ n_next

struct _netent* _netent::n_next

Definition at line 84 of file get_xby.h.


Watt-32 tcp/ip: _NL_BANDWIDTH_INFORMATION Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_NL_BANDWIDTH_INFORMATION Struct Reference
Collaboration diagram for _NL_BANDWIDTH_INFORMATION:
[legend]

Data Fields

ULONG64 | Bandwidth
ULONG64 | Instability
BOOLEAN | BandwidthPeaked

Detailed Description

Definition at line 1068 of file winadinf.h.

Field Documentation

◆ Bandwidth

ULONG64 _NL_BANDWIDTH_INFORMATION::Bandwidth

Definition at line 1069 of file winadinf.h.

◆ BandwidthPeaked

BOOLEAN _NL_BANDWIDTH_INFORMATION::BandwidthPeaked

Definition at line 1071 of file winadinf.h.

◆ Instability

ULONG64 _NL_BANDWIDTH_INFORMATION::Instability

Definition at line 1070 of file winadinf.h.


Watt-32 tcp/ip: _pkt Struct Reference

  • Data Structure Index
  • Data Fields
_pkt Struct Reference

Detailed Description

Definition at line 89 of file pcicmp.c.


Watt-32 tcp/ip: _protoent Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_protoent Struct Reference

#include <get_xby.h>

Collaboration diagram for _protoent:
[legend]

Data Fields

char * | p_name
char * | p_aliases [MAX_PROTO_ALIASES+1]
int | p_proto
struct _protoent * | p_next

Detailed Description

Internal protoent structure.

Definition at line 90 of file get_xby.h.

Field Documentation

◆ p_aliases

char* _protoent::p_aliases[MAX_PROTO_ALIASES+1]

Definition at line 92 of file get_xby.h.

◆ p_name

char* _protoent::p_name

Definition at line 91 of file get_xby.h.

◆ p_next

struct _protoent* _protoent::p_next

Definition at line 94 of file get_xby.h.

◆ p_proto

int _protoent::p_proto

Definition at line 93 of file get_xby.h.


Watt-32 tcp/ip: _raw6_Socket Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_raw6_Socket Struct Reference

#include <wattcp.h>

Collaboration diagram for _raw6_Socket:
[legend]

Data Fields

struct _raw6_Socket * | next
WORD | ip_type
BOOL | used
DWORD | seq_num
struct in6_Header | ip6
BYTE | rx_data [MAX_IP6_DATA]

Detailed Description

Raw IPv6 socket definition. Only used in BSD-socket API.

Definition at line 679 of file wattcp.h.

Field Documentation

◆ ip6

struct in6_Header _raw6_Socket::ip6

Definition at line 684 of file wattcp.h.

◆ ip_type

WORD _raw6_Socket::ip_type

Definition at line 681 of file wattcp.h.

◆ next

struct _raw6_Socket* _raw6_Socket::next

Definition at line 680 of file wattcp.h.

◆ rx_data

BYTE _raw6_Socket::rx_data[MAX_IP6_DATA]

Definition at line 685 of file wattcp.h.

◆ seq_num

DWORD _raw6_Socket::seq_num

Definition at line 683 of file wattcp.h.

◆ used

BOOL _raw6_Socket::used

Definition at line 682 of file wattcp.h.


Watt-32 tcp/ip: _raw_Socket Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_raw_Socket Struct Reference

#include <wattcp.h>

Collaboration diagram for _raw_Socket:
[legend]

Data Fields

struct _raw_Socket * | next
WORD | ip_type
same ofs as for udp/tcp Socket
BOOL | used
used flag; packet not read yet
DWORD | seq_num
counter for finding oldest pkt
struct in_Header | ip
BYTE | rx_data [MAX_FRAG_SIZE]
room for 1 jumbo IP packet

Detailed Description

Raw IPv4 socket definition. Only used in BSD-socket API.

Definition at line 665 of file wattcp.h.

Field Documentation

◆ ip

struct in_Header _raw_Socket::ip

Definition at line 670 of file wattcp.h.

◆ ip_type

WORD _raw_Socket::ip_type

same ofs as for udp/tcp Socket

Definition at line 667 of file wattcp.h.

◆ next

struct _raw_Socket* _raw_Socket::next

Definition at line 666 of file wattcp.h.

◆ rx_data

BYTE _raw_Socket::rx_data[MAX_FRAG_SIZE]

room for 1 jumbo IP packet

Definition at line 671 of file wattcp.h.

◆ seq_num

DWORD _raw_Socket::seq_num

counter for finding oldest pkt

Definition at line 669 of file wattcp.h.

◆ used

BOOL _raw_Socket::used

used flag; packet not read yet

Definition at line 668 of file wattcp.h.


Watt-32 tcp/ip: _servent Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_servent Struct Reference

#include <get_xby.h>

Collaboration diagram for _servent:
[legend]

Data Fields

char * | s_name
char * | s_aliases [MAX_SERV_ALIASES+1]
int | s_port
char * | s_proto
struct _servent * | s_next

Detailed Description

Internal servent structure.

Definition at line 100 of file get_xby.h.

Field Documentation

◆ s_aliases

char* _servent::s_aliases[MAX_SERV_ALIASES+1]

Definition at line 102 of file get_xby.h.

◆ s_name

char* _servent::s_name

Definition at line 101 of file get_xby.h.

◆ s_next

struct _servent* _servent::s_next

Definition at line 105 of file get_xby.h.

◆ s_port

int _servent::s_port

Definition at line 103 of file get_xby.h.

◆ s_proto

char* _servent::s_proto

Definition at line 104 of file get_xby.h.


Watt-32 tcp/ip: _SOCKET_ADDRESS Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_SOCKET_ADDRESS Struct Reference
Collaboration diagram for _SOCKET_ADDRESS:
[legend]

Data Fields

struct sockaddr | lpSockaddr
int | iSockaddrLength

Detailed Description

Definition at line 24 of file winsock2.h.

Field Documentation

◆ iSockaddrLength

int _SOCKET_ADDRESS::iSockaddrLength

Definition at line 26 of file winsock2.h.

◆ lpSockaddr

struct sockaddr _SOCKET_ADDRESS::lpSockaddr

Definition at line 25 of file winsock2.h.


Watt-32 tcp/ip: _WLAN_ASSOCIATION_ATTRIBUTES Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_ASSOCIATION_ATTRIBUTES Struct Reference
Collaboration diagram for _WLAN_ASSOCIATION_ATTRIBUTES:
[legend]

Data Fields

DOT11_SSID dot11Ssid
DOT11_BSS_TYPE | dot11BssType
DOT11_MAC_ADDRESS | dot11Bssid
DOT11_PHY_TYPE | dot11PhyType
ULONG | uDot11PhyIndex
ULONG | wlanSignalQuality
ULONG | ulRxRate
ULONG | ulTxRate

Detailed Description

Definition at line 551 of file winadinf.h.

Field Documentation

◆ dot11Bssid

DOT11_MAC_ADDRESS _WLAN_ASSOCIATION_ATTRIBUTES::dot11Bssid

Definition at line 554 of file winadinf.h.

◆ dot11BssType

DOT11_BSS_TYPE _WLAN_ASSOCIATION_ATTRIBUTES::dot11BssType

Definition at line 553 of file winadinf.h.

◆ dot11PhyType

DOT11_PHY_TYPE _WLAN_ASSOCIATION_ATTRIBUTES::dot11PhyType

Definition at line 555 of file winadinf.h.

◆ dot11Ssid

DOT11_SSID _WLAN_ASSOCIATION_ATTRIBUTES::dot11Ssid

Definition at line 552 of file winadinf.h.

◆ uDot11PhyIndex

ULONG _WLAN_ASSOCIATION_ATTRIBUTES::uDot11PhyIndex

Definition at line 556 of file winadinf.h.

◆ ulRxRate

ULONG _WLAN_ASSOCIATION_ATTRIBUTES::ulRxRate

Definition at line 558 of file winadinf.h.

◆ ulTxRate

ULONG _WLAN_ASSOCIATION_ATTRIBUTES::ulTxRate

Definition at line 559 of file winadinf.h.

◆ wlanSignalQuality

ULONG _WLAN_ASSOCIATION_ATTRIBUTES::wlanSignalQuality

Definition at line 557 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_AUTH_CIPHER_PAIR_LIST Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_AUTH_CIPHER_PAIR_LIST Struct Reference
Collaboration diagram for _WLAN_AUTH_CIPHER_PAIR_LIST:
[legend]

Data Fields

DWORD dwNumberOfItems
DOT11_AUTH_CIPHER_PAIR pAuthCipherPairList

Detailed Description

Definition at line 583 of file winadinf.h.

Field Documentation

◆ dwNumberOfItems

DWORD _WLAN_AUTH_CIPHER_PAIR_LIST::dwNumberOfItems

Definition at line 584 of file winadinf.h.

◆ pAuthCipherPairList

DOT11_AUTH_CIPHER_PAIR _WLAN_AUTH_CIPHER_PAIR_LIST::pAuthCipherPairList

Definition at line 585 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_AVAILABLE_NETWORK Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_AVAILABLE_NETWORK Struct Reference
Collaboration diagram for _WLAN_AVAILABLE_NETWORK:
[legend]

Data Fields

WCHAR | strProfileName [WLAN_MAX_NAME_LENGTH]
DOT11_SSID dot11Ssid
DOT11_BSS_TYPE | dot11BssType
ULONG | uNumberOfBssids
BOOL | bNetworkConnectable
DWORD | wlanNotConnectableReason
ULONG | uNumberOfPhyTypes
DOT11_PHY_TYPE | dot11PhyTypes [WLAN_MAX_PHY_TYPE_NUMBER]
BOOL | bMorePhyTypes
ULONG | wlanSignalQuality
BOOL | bSecurityEnabled
DOT11_AUTH_ALGORITHM | dot11DefaultAuthAlgorithm
DOT11_CIPHER_ALGORITHM | dot11DefaultCipherAlgorithm
DWORD | dwFlags
DWORD | dwReserved

Detailed Description

Definition at line 596 of file winadinf.h.

Field Documentation

◆ bMorePhyTypes

BOOL _WLAN_AVAILABLE_NETWORK::bMorePhyTypes

Definition at line 611 of file winadinf.h.

◆ bNetworkConnectable

BOOL _WLAN_AVAILABLE_NETWORK::bNetworkConnectable

Definition at line 601 of file winadinf.h.

◆ bSecurityEnabled

BOOL _WLAN_AVAILABLE_NETWORK::bSecurityEnabled

Definition at line 613 of file winadinf.h.

◆ dot11BssType

DOT11_BSS_TYPE _WLAN_AVAILABLE_NETWORK::dot11BssType

Definition at line 599 of file winadinf.h.

◆ dot11DefaultAuthAlgorithm

DOT11_AUTH_ALGORITHM _WLAN_AVAILABLE_NETWORK::dot11DefaultAuthAlgorithm

Definition at line 614 of file winadinf.h.

◆ dot11DefaultCipherAlgorithm

DOT11_CIPHER_ALGORITHM _WLAN_AVAILABLE_NETWORK::dot11DefaultCipherAlgorithm

Definition at line 615 of file winadinf.h.

◆ dot11PhyTypes

DOT11_PHY_TYPE _WLAN_AVAILABLE_NETWORK::dot11PhyTypes[WLAN_MAX_PHY_TYPE_NUMBER]

Definition at line 604 of file winadinf.h.

◆ dot11Ssid

DOT11_SSID _WLAN_AVAILABLE_NETWORK::dot11Ssid

Definition at line 598 of file winadinf.h.

◆ dwFlags

DWORD _WLAN_AVAILABLE_NETWORK::dwFlags

Definition at line 616 of file winadinf.h.

◆ dwReserved

DWORD _WLAN_AVAILABLE_NETWORK::dwReserved

Definition at line 617 of file winadinf.h.

◆ strProfileName

WCHAR _WLAN_AVAILABLE_NETWORK::strProfileName[WLAN_MAX_NAME_LENGTH]

Definition at line 597 of file winadinf.h.

◆ uNumberOfBssids

ULONG _WLAN_AVAILABLE_NETWORK::uNumberOfBssids

Definition at line 600 of file winadinf.h.

◆ uNumberOfPhyTypes

ULONG _WLAN_AVAILABLE_NETWORK::uNumberOfPhyTypes

Definition at line 603 of file winadinf.h.

◆ wlanNotConnectableReason

DWORD _WLAN_AVAILABLE_NETWORK::wlanNotConnectableReason

Definition at line 602 of file winadinf.h.

◆ wlanSignalQuality

ULONG _WLAN_AVAILABLE_NETWORK::wlanSignalQuality

Definition at line 612 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_AVAILABLE_NETWORK_LIST Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_AVAILABLE_NETWORK_LIST Struct Reference
Collaboration diagram for _WLAN_AVAILABLE_NETWORK_LIST:
[legend]

Data Fields

DWORD | dwNumberOfItems
DWORD | dwIndex
WLAN_AVAILABLE_NETWORK | Network [1]

Detailed Description

Definition at line 620 of file winadinf.h.

Field Documentation

◆ dwIndex

DWORD _WLAN_AVAILABLE_NETWORK_LIST::dwIndex

Definition at line 622 of file winadinf.h.

◆ dwNumberOfItems

DWORD _WLAN_AVAILABLE_NETWORK_LIST::dwNumberOfItems

Definition at line 621 of file winadinf.h.

◆ Network

WLAN_AVAILABLE_NETWORK _WLAN_AVAILABLE_NETWORK_LIST::Network[1]

Definition at line 623 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_BSS_ENTRY Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_BSS_ENTRY Struct Reference
Collaboration diagram for _WLAN_BSS_ENTRY:
[legend]

Data Fields

DOT11_SSID dot11Ssid
ULONG | uPhyId
DOT11_MAC_ADDRESS | dot11Bssid
DOT11_BSS_TYPE | dot11BssType
DOT11_PHY_TYPE | dot11BssPhyType
LONG | lRssi
ULONG | uLinkQuality
BOOLEAN | bInRegDomain
USHORT | usBeaconPeriod
ULONGLONG | ullTimestamp
ULONGLONG | ullHostTimestamp
USHORT | usCapabilityInformation
ULONG | ulChCenterFrequency
WLAN_RATE_SET wlanRateSet
ULONG | ulIeOffset
ULONG | ulIeSize

Detailed Description

Definition at line 626 of file winadinf.h.

Field Documentation

◆ bInRegDomain

BOOLEAN _WLAN_BSS_ENTRY::bInRegDomain

Definition at line 634 of file winadinf.h.

◆ dot11Bssid

DOT11_MAC_ADDRESS _WLAN_BSS_ENTRY::dot11Bssid

Definition at line 629 of file winadinf.h.

◆ dot11BssPhyType

DOT11_PHY_TYPE _WLAN_BSS_ENTRY::dot11BssPhyType

Definition at line 631 of file winadinf.h.

◆ dot11BssType

DOT11_BSS_TYPE _WLAN_BSS_ENTRY::dot11BssType

Definition at line 630 of file winadinf.h.

◆ dot11Ssid

DOT11_SSID _WLAN_BSS_ENTRY::dot11Ssid

Definition at line 627 of file winadinf.h.

◆ lRssi

LONG _WLAN_BSS_ENTRY::lRssi

Definition at line 632 of file winadinf.h.

◆ ulChCenterFrequency

ULONG _WLAN_BSS_ENTRY::ulChCenterFrequency

Definition at line 639 of file winadinf.h.

◆ ulIeOffset

ULONG _WLAN_BSS_ENTRY::ulIeOffset

Definition at line 641 of file winadinf.h.

◆ ulIeSize

ULONG _WLAN_BSS_ENTRY::ulIeSize

Definition at line 642 of file winadinf.h.

◆ uLinkQuality

ULONG _WLAN_BSS_ENTRY::uLinkQuality

Definition at line 633 of file winadinf.h.

◆ ullHostTimestamp

ULONGLONG _WLAN_BSS_ENTRY::ullHostTimestamp

Definition at line 637 of file winadinf.h.

◆ ullTimestamp

ULONGLONG _WLAN_BSS_ENTRY::ullTimestamp

Definition at line 636 of file winadinf.h.

◆ uPhyId

ULONG _WLAN_BSS_ENTRY::uPhyId

Definition at line 628 of file winadinf.h.

◆ usBeaconPeriod

USHORT _WLAN_BSS_ENTRY::usBeaconPeriod

Definition at line 635 of file winadinf.h.

◆ usCapabilityInformation

USHORT _WLAN_BSS_ENTRY::usCapabilityInformation

Definition at line 638 of file winadinf.h.

◆ wlanRateSet

WLAN_RATE_SET _WLAN_BSS_ENTRY::wlanRateSet

Definition at line 640 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_BSS_LIST Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_BSS_LIST Struct Reference
Collaboration diagram for _WLAN_BSS_LIST:
[legend]

Data Fields

DWORD | dwTotalSize
DWORD | dwNumberOfItems
WLAN_BSS_ENTRY | wlanBssEntries [1]

Detailed Description

Definition at line 645 of file winadinf.h.

Field Documentation

◆ dwNumberOfItems

DWORD _WLAN_BSS_LIST::dwNumberOfItems

Definition at line 647 of file winadinf.h.

◆ dwTotalSize

DWORD _WLAN_BSS_LIST::dwTotalSize

Definition at line 646 of file winadinf.h.

◆ wlanBssEntries

WLAN_BSS_ENTRY _WLAN_BSS_LIST::wlanBssEntries[1]

Definition at line 648 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_CONNECTION_ATTRIBUTES Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_CONNECTION_ATTRIBUTES Struct Reference
Collaboration diagram for _WLAN_CONNECTION_ATTRIBUTES:
[legend]

Data Fields

WLAN_INTERFACE_STATE | isState
WLAN_CONNECTION_MODE | wlanConnectionMode
WCHAR | strProfileName [WLAN_MAX_NAME_LENGTH]
WLAN_ASSOCIATION_ATTRIBUTES wlanAssociationAttributes
WLAN_SECURITY_ATTRIBUTES wlanSecurityAttributes

Detailed Description

Definition at line 588 of file winadinf.h.

Field Documentation

◆ isState

WLAN_INTERFACE_STATE _WLAN_CONNECTION_ATTRIBUTES::isState

Definition at line 589 of file winadinf.h.

◆ strProfileName

WCHAR _WLAN_CONNECTION_ATTRIBUTES::strProfileName[WLAN_MAX_NAME_LENGTH]

Definition at line 591 of file winadinf.h.

◆ wlanAssociationAttributes

WLAN_ASSOCIATION_ATTRIBUTES _WLAN_CONNECTION_ATTRIBUTES::wlanAssociationAttributes

Definition at line 592 of file winadinf.h.

◆ wlanConnectionMode

WLAN_CONNECTION_MODE _WLAN_CONNECTION_ATTRIBUTES::wlanConnectionMode

Definition at line 590 of file winadinf.h.

◆ wlanSecurityAttributes

WLAN_SECURITY_ATTRIBUTES _WLAN_CONNECTION_ATTRIBUTES::wlanSecurityAttributes

Definition at line 593 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_DEVICE_SERVICE_GUID_LIST2 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_DEVICE_SERVICE_GUID_LIST2 Struct Reference
Collaboration diagram for _WLAN_DEVICE_SERVICE_GUID_LIST2:
[legend]

Data Fields

DWORD | dwNumberOfItems
DWORD | dwIndex
GUID * | DeviceService [1]

Detailed Description

Definition at line 1019 of file winadinf.h.

Field Documentation

◆ DeviceService

GUID* _WLAN_DEVICE_SERVICE_GUID_LIST2::DeviceService[1]

Definition at line 1022 of file winadinf.h.

◆ dwIndex

DWORD _WLAN_DEVICE_SERVICE_GUID_LIST2::dwIndex

Definition at line 1021 of file winadinf.h.

◆ dwNumberOfItems

DWORD _WLAN_DEVICE_SERVICE_GUID_LIST2::dwNumberOfItems

Definition at line 1020 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_INTERFACE_CAPABILITY Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_INTERFACE_CAPABILITY Struct Reference
Collaboration diagram for _WLAN_INTERFACE_CAPABILITY:
[legend]

Data Fields

WLAN_INTERFACE_TYPE | interfaceType
BOOL | bDot11DSupported
DWORD | dwMaxDesiredSsidListSize
DWORD | dwMaxDesiredBssidListSize
DWORD | dwNumberOfSupportedPhys
DOT11_PHY_TYPE | dot11PhyTypes [WLAN_MAX_PHY_INDEX]

Detailed Description

Definition at line 435 of file winadinf.h.

Field Documentation

◆ bDot11DSupported

BOOL _WLAN_INTERFACE_CAPABILITY::bDot11DSupported

Definition at line 437 of file winadinf.h.

◆ dot11PhyTypes

DOT11_PHY_TYPE _WLAN_INTERFACE_CAPABILITY::dot11PhyTypes[WLAN_MAX_PHY_INDEX]

Definition at line 441 of file winadinf.h.

◆ dwMaxDesiredBssidListSize

DWORD _WLAN_INTERFACE_CAPABILITY::dwMaxDesiredBssidListSize

Definition at line 439 of file winadinf.h.

◆ dwMaxDesiredSsidListSize

DWORD _WLAN_INTERFACE_CAPABILITY::dwMaxDesiredSsidListSize

Definition at line 438 of file winadinf.h.

◆ dwNumberOfSupportedPhys

DWORD _WLAN_INTERFACE_CAPABILITY::dwNumberOfSupportedPhys

Definition at line 440 of file winadinf.h.

◆ interfaceType

WLAN_INTERFACE_TYPE _WLAN_INTERFACE_CAPABILITY::interfaceType

Definition at line 436 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_INTERFACE_INFO Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_INTERFACE_INFO Struct Reference
Collaboration diagram for _WLAN_INTERFACE_INFO:
[legend]

Data Fields

GUID | InterfaceGuid
WCHAR | strInterfaceDescription [WLAN_MAX_NAME_LENGTH]
WLAN_INTERFACE_STATE | isState

Detailed Description

Definition at line 455 of file winadinf.h.

Field Documentation

◆ InterfaceGuid

GUID _WLAN_INTERFACE_INFO::InterfaceGuid

Definition at line 456 of file winadinf.h.

◆ isState

WLAN_INTERFACE_STATE _WLAN_INTERFACE_INFO::isState

Definition at line 458 of file winadinf.h.

◆ strInterfaceDescription

WCHAR _WLAN_INTERFACE_INFO::strInterfaceDescription[WLAN_MAX_NAME_LENGTH]

Definition at line 457 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_INTERFACE_INFO_LIST Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_INTERFACE_INFO_LIST Struct Reference
Collaboration diagram for _WLAN_INTERFACE_INFO_LIST:
[legend]

Data Fields

DWORD | dwNumberOfItems
DWORD | dwIndex
WLAN_INTERFACE_INFO | InterfaceInfo [1]

Detailed Description

Definition at line 461 of file winadinf.h.

Field Documentation

◆ dwIndex

DWORD _WLAN_INTERFACE_INFO_LIST::dwIndex

Definition at line 463 of file winadinf.h.

◆ dwNumberOfItems

DWORD _WLAN_INTERFACE_INFO_LIST::dwNumberOfItems

Definition at line 462 of file winadinf.h.

◆ InterfaceInfo

WLAN_INTERFACE_INFO _WLAN_INTERFACE_INFO_LIST::InterfaceInfo[1]

Definition at line 464 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_MAC_FRAME_STATISTICS Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_MAC_FRAME_STATISTICS Struct Reference
Collaboration diagram for _WLAN_MAC_FRAME_STATISTICS:
[legend]

Data Fields

ULONGLONG | ullTransmittedFrameCount
ULONGLONG | ullReceivedFrameCount
ULONGLONG | ullWEPExcludedCount
ULONGLONG | ullTKIPLocalMICFailures
ULONGLONG | ullTKIPReplays
ULONGLONG | ullTKIPICVErrorCount
ULONGLONG | ullCCMPReplays
ULONGLONG | ullCCMPDecryptErrors
ULONGLONG | ullWEPUndecryptableCount
ULONGLONG | ullWEPICVErrorCount
ULONGLONG | ullDecryptSuccessCount
ULONGLONG | ullDecryptFailureCount

Detailed Description

Definition at line 467 of file winadinf.h.

Field Documentation

◆ ullCCMPDecryptErrors

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullCCMPDecryptErrors

Definition at line 475 of file winadinf.h.

◆ ullCCMPReplays

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullCCMPReplays

Definition at line 474 of file winadinf.h.

◆ ullDecryptFailureCount

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullDecryptFailureCount

Definition at line 479 of file winadinf.h.

◆ ullDecryptSuccessCount

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullDecryptSuccessCount

Definition at line 478 of file winadinf.h.

◆ ullReceivedFrameCount

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullReceivedFrameCount

Definition at line 469 of file winadinf.h.

◆ ullTKIPICVErrorCount

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullTKIPICVErrorCount

Definition at line 473 of file winadinf.h.

◆ ullTKIPLocalMICFailures

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullTKIPLocalMICFailures

Definition at line 471 of file winadinf.h.

◆ ullTKIPReplays

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullTKIPReplays

Definition at line 472 of file winadinf.h.

◆ ullTransmittedFrameCount

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullTransmittedFrameCount

Definition at line 468 of file winadinf.h.

◆ ullWEPExcludedCount

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullWEPExcludedCount

Definition at line 470 of file winadinf.h.

◆ ullWEPICVErrorCount

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullWEPICVErrorCount

Definition at line 477 of file winadinf.h.

◆ ullWEPUndecryptableCount

ULONGLONG _WLAN_MAC_FRAME_STATISTICS::ullWEPUndecryptableCount

Definition at line 476 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_PHY_FRAME_STATISTICS Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_PHY_FRAME_STATISTICS Struct Reference
Collaboration diagram for _WLAN_PHY_FRAME_STATISTICS:
[legend]

Data Fields

ULONGLONG | ullTransmittedFrameCount
ULONGLONG | ullMulticastTransmittedFrameCount
ULONGLONG | ullFailedCount
ULONGLONG | ullRetryCount
ULONGLONG | ullMultipleRetryCount
ULONGLONG | ullMaxTXLifetimeExceededCount
ULONGLONG | ullTransmittedFragmentCount
ULONGLONG | ullRTSSuccessCount
ULONGLONG | ullRTSFailureCount
ULONGLONG | ullACKFailureCount
ULONGLONG | ullReceivedFrameCount
ULONGLONG | ullMulticastReceivedFrameCount
ULONGLONG | ullPromiscuousReceivedFrameCount
ULONGLONG | ullMaxRXLifetimeExceededCount
ULONGLONG | ullFrameDuplicateCount
ULONGLONG | ullReceivedFragmentCount
ULONGLONG | ullPromiscuousReceivedFragmentCount
ULONGLONG | ullFCSErrorCount

Detailed Description

Definition at line 482 of file winadinf.h.

Field Documentation

◆ ullACKFailureCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullACKFailureCount

Definition at line 492 of file winadinf.h.

◆ ullFailedCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullFailedCount

Definition at line 485 of file winadinf.h.

◆ ullFCSErrorCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullFCSErrorCount

Definition at line 500 of file winadinf.h.

◆ ullFrameDuplicateCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullFrameDuplicateCount

Definition at line 497 of file winadinf.h.

◆ ullMaxRXLifetimeExceededCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullMaxRXLifetimeExceededCount

Definition at line 496 of file winadinf.h.

◆ ullMaxTXLifetimeExceededCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullMaxTXLifetimeExceededCount

Definition at line 488 of file winadinf.h.

◆ ullMulticastReceivedFrameCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullMulticastReceivedFrameCount

Definition at line 494 of file winadinf.h.

◆ ullMulticastTransmittedFrameCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullMulticastTransmittedFrameCount

Definition at line 484 of file winadinf.h.

◆ ullMultipleRetryCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullMultipleRetryCount

Definition at line 487 of file winadinf.h.

◆ ullPromiscuousReceivedFragmentCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullPromiscuousReceivedFragmentCount

Definition at line 499 of file winadinf.h.

◆ ullPromiscuousReceivedFrameCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullPromiscuousReceivedFrameCount

Definition at line 495 of file winadinf.h.

◆ ullReceivedFragmentCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullReceivedFragmentCount

Definition at line 498 of file winadinf.h.

◆ ullReceivedFrameCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullReceivedFrameCount

Definition at line 493 of file winadinf.h.

◆ ullRetryCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullRetryCount

Definition at line 486 of file winadinf.h.

◆ ullRTSFailureCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullRTSFailureCount

Definition at line 491 of file winadinf.h.

◆ ullRTSSuccessCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullRTSSuccessCount

Definition at line 490 of file winadinf.h.

◆ ullTransmittedFragmentCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullTransmittedFragmentCount

Definition at line 489 of file winadinf.h.

◆ ullTransmittedFrameCount

ULONGLONG _WLAN_PHY_FRAME_STATISTICS::ullTransmittedFrameCount

Definition at line 483 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_PHY_RADIO_STATE Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_PHY_RADIO_STATE Struct Reference
Collaboration diagram for _WLAN_PHY_RADIO_STATE:
[legend]

Data Fields

DWORD | dwPhyIndex
DOT11_RADIO_STATE | dot11SoftwareRadioState
DOT11_RADIO_STATE | dot11HardwareRadioState

Detailed Description

Definition at line 1085 of file winadinf.h.

Field Documentation

◆ dot11HardwareRadioState

DOT11_RADIO_STATE _WLAN_PHY_RADIO_STATE::dot11HardwareRadioState

Definition at line 1088 of file winadinf.h.

◆ dot11SoftwareRadioState

DOT11_RADIO_STATE _WLAN_PHY_RADIO_STATE::dot11SoftwareRadioState

Definition at line 1087 of file winadinf.h.

◆ dwPhyIndex

DWORD _WLAN_PHY_RADIO_STATE::dwPhyIndex

Definition at line 1086 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_RADIO_STATE Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_RADIO_STATE Struct Reference
Collaboration diagram for _WLAN_RADIO_STATE:
[legend]

Data Fields

DWORD | dwNumberOfPhys
WLAN_PHY_RADIO_STATE | PhyRadioState [64]

Detailed Description

Definition at line 1091 of file winadinf.h.

Field Documentation

◆ dwNumberOfPhys

DWORD _WLAN_RADIO_STATE::dwNumberOfPhys

Definition at line 1092 of file winadinf.h.

◆ PhyRadioState

WLAN_PHY_RADIO_STATE _WLAN_RADIO_STATE::PhyRadioState[64]

Definition at line 1093 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_RATE_SET Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_RATE_SET Struct Reference
Collaboration diagram for _WLAN_RATE_SET:
[legend]

Data Fields

ULONG | uRateSetLength
USHORT | usRateSet [DOT11_RATE_SET_MAX_LENGTH]

Detailed Description

Definition at line 572 of file winadinf.h.

Field Documentation

◆ uRateSetLength

ULONG _WLAN_RATE_SET::uRateSetLength

Definition at line 573 of file winadinf.h.

◆ usRateSet

USHORT _WLAN_RATE_SET::usRateSet[DOT11_RATE_SET_MAX_LENGTH]

Definition at line 574 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_SECURITY_ATTRIBUTES Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_SECURITY_ATTRIBUTES Struct Reference
Collaboration diagram for _WLAN_SECURITY_ATTRIBUTES:
[legend]

Data Fields

BOOL | bSecurityEnabled
BOOL | bOneXEnabled
DOT11_AUTH_ALGORITHM | dot11AuthAlgorithm
DOT11_CIPHER_ALGORITHM | dot11CipherAlgorithm

Detailed Description

Definition at line 562 of file winadinf.h.

Field Documentation

◆ bOneXEnabled

BOOL _WLAN_SECURITY_ATTRIBUTES::bOneXEnabled

Definition at line 564 of file winadinf.h.

◆ bSecurityEnabled

BOOL _WLAN_SECURITY_ATTRIBUTES::bSecurityEnabled

Definition at line 563 of file winadinf.h.

◆ dot11AuthAlgorithm

DOT11_AUTH_ALGORITHM _WLAN_SECURITY_ATTRIBUTES::dot11AuthAlgorithm

Definition at line 565 of file winadinf.h.

◆ dot11CipherAlgorithm

DOT11_CIPHER_ALGORITHM _WLAN_SECURITY_ATTRIBUTES::dot11CipherAlgorithm

Definition at line 566 of file winadinf.h.


Watt-32 tcp/ip: _WLAN_STATISTICS Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WLAN_STATISTICS Struct Reference
Collaboration diagram for _WLAN_STATISTICS:
[legend]

Data Fields

ULONGLONG | ullFourWayHandshakeFailures
ULONGLONG | ullTKIPCounterMeasuresInvoked
ULONGLONG | ullReserved
WLAN_MAC_FRAME_STATISTICS MacUcastCounters
WLAN_MAC_FRAME_STATISTICS MacMcastCounters
DWORD | dwNumberOfPhys
WLAN_PHY_FRAME_STATISTICS | PhyCounters [1]

Detailed Description

Definition at line 503 of file winadinf.h.

Field Documentation

◆ dwNumberOfPhys

DWORD _WLAN_STATISTICS::dwNumberOfPhys

Definition at line 509 of file winadinf.h.

◆ MacMcastCounters

WLAN_MAC_FRAME_STATISTICS _WLAN_STATISTICS::MacMcastCounters

Definition at line 508 of file winadinf.h.

◆ MacUcastCounters

WLAN_MAC_FRAME_STATISTICS _WLAN_STATISTICS::MacUcastCounters

Definition at line 507 of file winadinf.h.

◆ PhyCounters

WLAN_PHY_FRAME_STATISTICS _WLAN_STATISTICS::PhyCounters[1]

Definition at line 510 of file winadinf.h.

◆ ullFourWayHandshakeFailures

ULONGLONG _WLAN_STATISTICS::ullFourWayHandshakeFailures

Definition at line 504 of file winadinf.h.

◆ ullReserved

ULONGLONG _WLAN_STATISTICS::ullReserved

Definition at line 506 of file winadinf.h.

◆ ullTKIPCounterMeasuresInvoked

ULONGLONG _WLAN_STATISTICS::ullTKIPCounterMeasuresInvoked

Definition at line 505 of file winadinf.h.


Watt-32 tcp/ip: _WSAQuerySetA Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
_WSAQuerySetA Struct Reference
Collaboration diagram for _WSAQuerySetA:
[legend]

Data Fields

DWORD | dwSize
char * | lpszServiceInstanceName
GUID * | lpServiceClassId
WSAVERSION * | lpVersion
char * | lpszComment
DWORD | dwNameSpace
GUID * | lpNSProviderId
char * | lpszContext
DWORD | dwNumberOfProtocols
AFPROTOCOLS * | lpafpProtocols
char * | lpszQueryString
DWORD | dwNumberOfCsAddrs
CSADDR_INFO * | lpcsaBuffer
DWORD | dwOutputFlags
BLOB * | lpBlob

Detailed Description

Definition at line 654 of file winadinf.h.

Field Documentation

◆ dwNameSpace

DWORD _WSAQuerySetA::dwNameSpace

Definition at line 660 of file winadinf.h.

◆ dwNumberOfCsAddrs

DWORD _WSAQuerySetA::dwNumberOfCsAddrs

Definition at line 666 of file winadinf.h.

◆ dwNumberOfProtocols

DWORD _WSAQuerySetA::dwNumberOfProtocols

Definition at line 663 of file winadinf.h.

◆ dwOutputFlags

DWORD _WSAQuerySetA::dwOutputFlags

Definition at line 668 of file winadinf.h.

◆ dwSize

DWORD _WSAQuerySetA::dwSize

Definition at line 655 of file winadinf.h.

◆ lpafpProtocols

AFPROTOCOLS* _WSAQuerySetA::lpafpProtocols

Definition at line 664 of file winadinf.h.

◆ lpBlob

BLOB* _WSAQuerySetA::lpBlob

Definition at line 669 of file winadinf.h.

◆ lpcsaBuffer

CSADDR_INFO* _WSAQuerySetA::lpcsaBuffer

Definition at line 667 of file winadinf.h.

◆ lpNSProviderId

GUID* _WSAQuerySetA::lpNSProviderId

Definition at line 661 of file winadinf.h.

◆ lpServiceClassId

GUID* _WSAQuerySetA::lpServiceClassId

Definition at line 657 of file winadinf.h.

◆ lpszComment

char* _WSAQuerySetA::lpszComment

Definition at line 659 of file winadinf.h.

◆ lpszContext

char* _WSAQuerySetA::lpszContext

Definition at line 662 of file winadinf.h.

◆ lpszQueryString

char* _WSAQuerySetA::lpszQueryString

Definition at line 665 of file winadinf.h.

◆ lpszServiceInstanceName

char* _WSAQuerySetA::lpszServiceInstanceName

Definition at line 656 of file winadinf.h.

◆ lpVersion

WSAVERSION* _WSAQuerySetA::lpVersion

Definition at line 658 of file winadinf.h.


Watt-32 tcp/ip: accepted_reply Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
accepted_reply Struct Reference
Collaboration diagram for accepted_reply:
[legend]

Data Fields

struct opaque_auth | ar_verf
enum accept_stat | ar_stat
union {
struct {
u_long low
u_long high
} AR_versions
struct {
caddr_t where
xdrproc_t proc
} AR_results
} ru

Detailed Description

Definition at line 94 of file rpc_msg.h.

Field Documentation

◆ ar_stat

enum accept_stat accepted_reply::ar_stat

Definition at line 96 of file rpc_msg.h.

◆ ar_verf

struct opaque_auth accepted_reply::ar_verf

Definition at line 95 of file rpc_msg.h.

◆ high

u_long accepted_reply::high

Definition at line 100 of file rpc_msg.h.

◆ low

u_long accepted_reply::low

Definition at line 99 of file rpc_msg.h.

◆ proc

xdrproc_t accepted_reply::proc

Definition at line 104 of file rpc_msg.h.

◆ where

caddr_t accepted_reply::where

Definition at line 103 of file rpc_msg.h.


Watt-32 tcp/ip: ADAPTER Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ADAPTER Struct Reference

Describes an opened network adapter. More...

#include <packet32.h>

Collaboration diagram for ADAPTER:
[legend]

Data Fields

HANDLE | hFile
HANDLE | ReadEvent
UINT | ReadTimeOut
DWORD | flags
struct ADAPTER_INFO * | info

Detailed Description

Describes an opened network adapter.

Definition at line 194 of file packet32.h.

Field Documentation

◆ flags

DWORD ADAPTER::flags

Definition at line 198 of file packet32.h.

◆ hFile

HANDLE ADAPTER::hFile

Definition at line 195 of file packet32.h.

◆ info

struct ADAPTER_INFO* ADAPTER::info

Definition at line 199 of file packet32.h.

◆ ReadEvent

HANDLE ADAPTER::ReadEvent

Definition at line 196 of file packet32.h.

◆ ReadTimeOut

UINT ADAPTER::ReadTimeOut

Definition at line 197 of file packet32.h.


Watt-32 tcp/ip: ADAPTER_INFO Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ADAPTER_INFO Struct Reference

Contains some information about a network adapter. More...

#include <packet32.h>

Collaboration diagram for ADAPTER_INFO:
[legend]

Data Fields

struct ADAPTER_INFO * | Next
char | Name [ADAPTER_NAME_LENGTH+1]
int | NNetworkAddresses
struct npf_if_addr | NetworkAddresses [MAX_NETWORK_ADDRESSES]

Detailed Description

Contains some information about a network adapter.

Definition at line 184 of file packet32.h.

Field Documentation

◆ Name

char ADAPTER_INFO::Name[ADAPTER_NAME_LENGTH+1]

Definition at line 186 of file packet32.h.

◆ NetworkAddresses

struct npf_if_addr ADAPTER_INFO::NetworkAddresses[MAX_NETWORK_ADDRESSES]

Definition at line 188 of file packet32.h.

◆ Next

struct ADAPTER_INFO* ADAPTER_INFO::Next

Definition at line 185 of file packet32.h.

◆ NNetworkAddresses

int ADAPTER_INFO::NNetworkAddresses

Definition at line 187 of file packet32.h.


Watt-32 tcp/ip: addrinfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
addrinfo Struct Reference
Collaboration diagram for addrinfo:
[legend]

Data Fields

int | ai_flags
int | ai_family
int | ai_socktype
int | ai_protocol
int | ai_addrlen
char * | ai_canonname
struct sockaddr * | ai_addr
struct addrinfo * | ai_next

Detailed Description

Definition at line 137 of file netdb.h.

Field Documentation

◆ ai_addr

struct sockaddr* addrinfo::ai_addr

Definition at line 144 of file netdb.h.

◆ ai_addrlen

int addrinfo::ai_addrlen

Definition at line 142 of file netdb.h.

◆ ai_canonname

char* addrinfo::ai_canonname

Definition at line 143 of file netdb.h.

◆ ai_family

int addrinfo::ai_family

Definition at line 139 of file netdb.h.

◆ ai_flags

int addrinfo::ai_flags

Definition at line 138 of file netdb.h.

◆ ai_next

struct addrinfo* addrinfo::ai_next

Definition at line 145 of file netdb.h.

◆ ai_protocol

int addrinfo::ai_protocol

Definition at line 141 of file netdb.h.

◆ ai_socktype

int addrinfo::ai_socktype

Definition at line 140 of file netdb.h.


Watt-32 tcp/ip: afd Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
afd Struct Reference
Collaboration diagram for afd:
[legend]

Data Fields

int | a_af
int | a_addrlen
int | a_socklen
int | a_off
const char * | a_addrany
const char * | a_loopback
int | a_scoped

Detailed Description

Definition at line 62 of file get_ai.c.

Field Documentation

◆ a_addrany

const char* afd::a_addrany

Definition at line 67 of file get_ai.c.

◆ a_addrlen

int afd::a_addrlen

Definition at line 64 of file get_ai.c.

◆ a_af

int afd::a_af

Definition at line 63 of file get_ai.c.

◆ a_loopback

const char* afd::a_loopback

Definition at line 68 of file get_ai.c.

◆ a_off

int afd::a_off

Definition at line 66 of file get_ai.c.

◆ a_scoped

int afd::a_scoped

Definition at line 69 of file get_ai.c.

◆ a_socklen

int afd::a_socklen

Definition at line 65 of file get_ai.c.


Watt-32 tcp/ip: ah Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ah Struct Reference
Collaboration diagram for ah:
[legend]

Data Fields

u_int8_t | ah_nxt
u_int8_t | ah_len
u_int16_t | ah_reserve
u_int32_t | ah_spi

Detailed Description

Definition at line 45 of file ah.h.

Field Documentation

◆ ah_len

u_int8_t ah::ah_len

Definition at line 47 of file ah.h.

◆ ah_nxt

u_int8_t ah::ah_nxt

Definition at line 46 of file ah.h.

◆ ah_reserve

u_int16_t ah::ah_reserve

Definition at line 48 of file ah.h.

◆ ah_spi

u_int32_t ah::ah_spi

Definition at line 49 of file ah.h.


Watt-32 tcp/ip: ah_algorithm Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ah_algorithm Struct Reference
Collaboration diagram for ah_algorithm:
[legend]

Data Fields

int(* | sumsiz )(struct secasvar *)
int(* | mature )(struct secasvar *)
int | keymin
int | keymax
const char * | name
int(* | init )(struct ah_algorithm_state *, struct secasvar *)
void(* | update )(struct ah_algorithm_state *, caddr_t, size_t)
void(* | result )(struct ah_algorithm_state *, caddr_t)

Detailed Description

Definition at line 70 of file ah.h.

Field Documentation

◆ init

int(* ah_algorithm::init) (struct ah_algorithm_state *, struct secasvar *)

Definition at line 76 of file ah.h.

◆ keymax

int ah_algorithm::keymax

Definition at line 74 of file ah.h.

◆ keymin

int ah_algorithm::keymin

Definition at line 73 of file ah.h.

◆ mature

int(* ah_algorithm::mature) (struct secasvar *)

Definition at line 72 of file ah.h.

◆ name

const char* ah_algorithm::name

Definition at line 75 of file ah.h.

◆ result

void(* ah_algorithm::result) (struct ah_algorithm_state *, caddr_t)

Definition at line 78 of file ah.h.

◆ sumsiz

int(* ah_algorithm::sumsiz) (struct secasvar *)

Definition at line 71 of file ah.h.

◆ update

void(* ah_algorithm::update) (struct ah_algorithm_state *, caddr_t, size_t)

Definition at line 77 of file ah.h.


Watt-32 tcp/ip: ah_algorithm_state Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ah_algorithm_state Struct Reference
Collaboration diagram for ah_algorithm_state:
[legend]

Data Fields

struct secasvar * | sav
void * | foo

Detailed Description

Definition at line 65 of file ah.h.

Field Documentation

◆ foo

void* ah_algorithm_state::foo

Definition at line 67 of file ah.h.

◆ sav

struct secasvar* ah_algorithm_state::sav

Definition at line 66 of file ah.h.


Watt-32 tcp/ip: arc_header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
arc_header Struct Reference
Collaboration diagram for arc_header:
[legend]

Data Fields

u_int8_t | arc_shost
u_int8_t | arc_dhost
u_int8_t | arc_type
u_int8_t | arc_flag
u_int16_t | arc_seqid
u_int8_t | arc_type2
u_int8_t | arc_flag2
u_int16_t | arc_seqid2

Detailed Description

Definition at line 64 of file if_arc.h.

Field Documentation

◆ arc_dhost

u_int8_t arc_header::arc_dhost

Definition at line 66 of file if_arc.h.

◆ arc_flag

u_int8_t arc_header::arc_flag

Definition at line 72 of file if_arc.h.

◆ arc_flag2

u_int8_t arc_header::arc_flag2

Definition at line 79 of file if_arc.h.

◆ arc_seqid

u_int16_t arc_header::arc_seqid

Definition at line 73 of file if_arc.h.

◆ arc_seqid2

u_int16_t arc_header::arc_seqid2

Definition at line 80 of file if_arc.h.

◆ arc_shost

u_int8_t arc_header::arc_shost

Definition at line 65 of file if_arc.h.

◆ arc_type

u_int8_t arc_header::arc_type

Definition at line 67 of file if_arc.h.

◆ arc_type2

u_int8_t arc_header::arc_type2

Definition at line 78 of file if_arc.h.


Watt-32 tcp/ip: arccom Struct Reference

  • Data Structure Index
  • Data Fields
Data Structures | Data Fields
arccom Struct Reference
Collaboration diagram for arccom:
[legend]

Data Structures

struct ac_frag

Data Fields

struct ifnet | ac_if
u_int16_t | ac_seqid
struct arccom::ac_frag | ac_fragtab [256]

Detailed Description

Definition at line 111 of file if_arc.h.

Field Documentation

◆ ac_if

struct ifnet arccom::ac_if

Definition at line 112 of file if_arc.h.

◆ ac_seqid

u_int16_t arccom::ac_seqid

Definition at line 114 of file if_arc.h.


Watt-32 tcp/ip: arccom::ac_frag Struct Reference

  • Data Structure Index
  • Data Fields
  • arccom
  • ac_frag
Data Fields
arccom::ac_frag Struct Reference
Collaboration diagram for arccom::ac_frag:
[legend]

Data Fields

u_int8_t | af_maxflag
u_int8_t | af_lastseen
u_int16_t | af_seqid
struct mbuf * | af_packet

Detailed Description

Definition at line 116 of file if_arc.h.

Field Documentation

◆ af_lastseen

u_int8_t arccom::ac_frag::af_lastseen

Definition at line 118 of file if_arc.h.

◆ af_maxflag

u_int8_t arccom::ac_frag::af_maxflag

Definition at line 117 of file if_arc.h.

◆ af_packet

struct mbuf* arccom::ac_frag::af_packet

Definition at line 120 of file if_arc.h.

◆ af_seqid

u_int16_t arccom::ac_frag::af_seqid

Definition at line 119 of file if_arc.h.


Watt-32 tcp/ip: arcnet_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
arcnet_Header Struct Reference

#include <pcsed.h>

Collaboration diagram for arcnet_Header:
[legend]

Data Fields

BYTE | source
BYTE | destination
BYTE | type
BYTE | flags
WORD | sequence
BYTE | type2
BYTE | flags2
WORD | sequence2

Detailed Description

The ARCNET header.

Definition at line 180 of file pcsed.h.

Field Documentation

◆ destination

BYTE arcnet_Header::destination

Definition at line 182 of file pcsed.h.

◆ flags

BYTE arcnet_Header::flags

Definition at line 184 of file pcsed.h.

◆ flags2

BYTE arcnet_Header::flags2

Definition at line 190 of file pcsed.h.

◆ sequence

WORD arcnet_Header::sequence

Definition at line 185 of file pcsed.h.

◆ sequence2

WORD arcnet_Header::sequence2

Definition at line 191 of file pcsed.h.

◆ source

BYTE arcnet_Header::source

Definition at line 181 of file pcsed.h.

◆ type

BYTE arcnet_Header::type

Definition at line 183 of file pcsed.h.

◆ type2

BYTE arcnet_Header::type2

Definition at line 189 of file pcsed.h.


Watt-32 tcp/ip: arcnet_Packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
arcnet_Packet Struct Reference

#include <pcsed.h>

Collaboration diagram for arcnet_Packet:
[legend]

Data Fields

arcnet_Header head
BYTE data [ARCNET_MAX_DATA]

Detailed Description

The ARCNET header with data.

Definition at line 201 of file pcsed.h.

Field Documentation

◆ data

BYTE arcnet_Packet::data[ARCNET_MAX_DATA]

Definition at line 203 of file pcsed.h.

◆ head

arcnet_Header arcnet_Packet::head

Definition at line 202 of file pcsed.h.


Watt-32 tcp/ip: arp Struct Reference

  • Data Structure Index
  • Data Fields
arp Struct Reference


Watt-32 tcp/ip: arp_entry Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
arp_entry Struct Reference

#include <pcarp.h>

Collaboration diagram for arp_entry:
[legend]

Data Fields

DWORD | ip
IP address of ARP entry.
eth_address | hardware
MAC address of ARP entry.
DWORD | expiry
'pending timeout' or 'dynamic expiry'
DWORD | retransmit_to
used only for re-requesting MAC while 'pending'
WORD | flags
ARP flags, see below.

Detailed Description

ARP cache table.

Definition at line 23 of file pcarp.h.

Field Documentation

◆ expiry

DWORD arp_entry::expiry

'pending timeout' or 'dynamic expiry'

Definition at line 26 of file pcarp.h.

◆ flags

WORD arp_entry::flags

ARP flags, see below.

Definition at line 28 of file pcarp.h.

◆ hardware

eth_address arp_entry::hardware

MAC address of ARP entry.

Definition at line 25 of file pcarp.h.

◆ ip

DWORD arp_entry::ip

IP address of ARP entry.

Definition at line 24 of file pcarp.h.

◆ retransmit_to

DWORD arp_entry::retransmit_to

used only for re-requesting MAC while 'pending'

Definition at line 27 of file pcarp.h.


Watt-32 tcp/ip: arp_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
arp_Header Struct Reference

#include <wattcp.h>

Collaboration diagram for arp_Header:
[legend]

Data Fields

WORD | hwType
WORD | protType
BYTE | hwAddrLen
MAC addr.
BYTE | protoAddrLen
IP addr.
WORD | opcode
eth_address | srcEthAddr
DWORD | srcIPAddr
eth_address | dstEthAddr
DWORD | dstIPAddr

Detailed Description

ARP/RARP header.

Definition at line 476 of file wattcp.h.

Field Documentation

◆ dstEthAddr

eth_address arp_Header::dstEthAddr

Definition at line 484 of file wattcp.h.

◆ dstIPAddr

DWORD arp_Header::dstIPAddr

Definition at line 485 of file wattcp.h.

◆ hwAddrLen

BYTE arp_Header::hwAddrLen

MAC addr.

length (6)

Definition at line 479 of file wattcp.h.

◆ hwType

WORD arp_Header::hwType

Definition at line 477 of file wattcp.h.

◆ opcode

WORD arp_Header::opcode

Definition at line 481 of file wattcp.h.

◆ protoAddrLen

BYTE arp_Header::protoAddrLen

IP addr.

length (4)

Definition at line 480 of file wattcp.h.

◆ protType

WORD arp_Header::protType

Definition at line 478 of file wattcp.h.

◆ srcEthAddr

eth_address arp_Header::srcEthAddr

Definition at line 482 of file wattcp.h.

◆ srcIPAddr

DWORD arp_Header::srcIPAddr

Definition at line 483 of file wattcp.h.


Watt-32 tcp/ip: arpcom Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
arpcom Struct Reference
Collaboration diagram for arpcom:
[legend]

Data Fields

struct ifnet | ac_if
u_char | ac_enaddr [6]
struct in_addr | ac_ipaddr
struct ether_multi * | ac_multiaddrs
int | ac_multicnt

Detailed Description

Definition at line 139 of file if_ether.h.

Field Documentation

◆ ac_enaddr

u_char arpcom::ac_enaddr[6]

Definition at line 141 of file if_ether.h.

◆ ac_if

struct ifnet arpcom::ac_if

Definition at line 140 of file if_ether.h.

◆ ac_ipaddr

struct in_addr arpcom::ac_ipaddr

Definition at line 142 of file if_ether.h.

◆ ac_multiaddrs

struct ether_multi* arpcom::ac_multiaddrs

Definition at line 143 of file if_ether.h.

◆ ac_multicnt

int arpcom::ac_multicnt

Definition at line 144 of file if_ether.h.


Watt-32 tcp/ip: arpreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
arpreq Struct Reference
Collaboration diagram for arpreq:
[legend]

Data Fields

struct sockaddr | arp_pa
struct sockaddr | arp_ha
int | arp_flags

Detailed Description

Definition at line 103 of file if_arp.h.

Field Documentation

◆ arp_flags

int arpreq::arp_flags

Definition at line 106 of file if_arp.h.

◆ arp_ha

struct sockaddr arpreq::arp_ha

Definition at line 105 of file if_arp.h.

◆ arp_pa

struct sockaddr arpreq::arp_pa

Definition at line 104 of file if_arp.h.


Watt-32 tcp/ip: arptab Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
arptab Struct Reference
Collaboration diagram for arptab:
[legend]

Data Fields

struct in_addr | at_iaddr
u_char | at_enaddr [6]
u_char | at_timer
u_char | at_flags
struct mbuf * | at_hold
u_short | at_rcf
u_short | at_rseg [8]
u_long | at_millisec
int | at_interface

Detailed Description

Definition at line 151 of file if_ether.h.

Field Documentation

◆ at_enaddr

u_char arptab::at_enaddr[6]

Definition at line 153 of file if_ether.h.

◆ at_flags

u_char arptab::at_flags

Definition at line 155 of file if_ether.h.

◆ at_hold

struct mbuf* arptab::at_hold

Definition at line 156 of file if_ether.h.

◆ at_iaddr

struct in_addr arptab::at_iaddr

Definition at line 152 of file if_ether.h.

◆ at_interface

int arptab::at_interface

Definition at line 161 of file if_ether.h.

◆ at_millisec

u_long arptab::at_millisec

Definition at line 160 of file if_ether.h.

◆ at_rcf

u_short arptab::at_rcf

Definition at line 158 of file if_ether.h.

◆ at_rseg

u_short arptab::at_rseg[8]

Definition at line 159 of file if_ether.h.

◆ at_timer

u_char arptab::at_timer

Definition at line 154 of file if_ether.h.


Watt-32 tcp/ip: async_iocb Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
async_iocb Struct Reference
Collaboration diagram for async_iocb:
[legend]

Data Fields

DWORD | buffer
WORD | length
BYTE | flagbits
BYTE | code
DWORD | xmit_func
char | reserved [4]
char | priv_data [8]

Detailed Description

Definition at line 185 of file pcpkt.h.

Field Documentation

◆ buffer

DWORD async_iocb::buffer

Definition at line 186 of file pcpkt.h.

◆ code

BYTE async_iocb::code

Definition at line 189 of file pcpkt.h.

◆ flagbits

BYTE async_iocb::flagbits

Definition at line 188 of file pcpkt.h.

◆ length

WORD async_iocb::length

Definition at line 187 of file pcpkt.h.

◆ priv_data

char async_iocb::priv_data[8]

Definition at line 192 of file pcpkt.h.

◆ reserved

char async_iocb::reserved[4]

Definition at line 191 of file pcpkt.h.

◆ xmit_func

DWORD async_iocb::xmit_func

Definition at line 190 of file pcpkt.h.


Watt-32 tcp/ip: atm_pseudoioctl Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
atm_pseudoioctl Struct Reference
Collaboration diagram for atm_pseudoioctl:
[legend]

Data Fields

struct atm_pseudohdr | aph
void * | rxhand

Detailed Description

Definition at line 81 of file if_atm.h.

Field Documentation

◆ aph

struct atm_pseudohdr atm_pseudoioctl::aph

Definition at line 82 of file if_atm.h.

◆ rxhand

void* atm_pseudoioctl::rxhand

Definition at line 83 of file if_atm.h.


Watt-32 tcp/ip: atmllc Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
atmllc Struct Reference
Collaboration diagram for atmllc:
[legend]

Data Fields

u_int8_t | llchdr [6]
u_int8_t | type [2]

Detailed Description

Definition at line 93 of file if_atm.h.

Field Documentation

◆ llchdr

u_int8_t atmllc::llchdr[6]

Definition at line 94 of file if_atm.h.

◆ type

u_int8_t atmllc::type[2]

Definition at line 95 of file if_atm.h.


Watt-32 tcp/ip: AUTH Struct Reference

  • Data Structure Index
  • Data Fields
Data Structures | Data Fields
AUTH Struct Reference
Collaboration diagram for AUTH:
[legend]

Data Structures

struct auth_ops

Data Fields

struct opaque_auth | ah_cred
struct opaque_auth | ah_verf
union des_block | ah_key
struct AUTH::auth_ops * | ah_ops
caddr_t | ah_private

Detailed Description

Definition at line 108 of file auth.h.

Field Documentation

◆ ah_cred

struct opaque_auth AUTH::ah_cred

Definition at line 109 of file auth.h.

◆ ah_key

union des_block AUTH::ah_key

Definition at line 111 of file auth.h.

◆ ah_private

caddr_t AUTH::ah_private

Definition at line 119 of file auth.h.

◆ ah_verf

struct opaque_auth AUTH::ah_verf

Definition at line 110 of file auth.h.


Watt-32 tcp/ip: AUTH::auth_ops Struct Reference

  • Data Structure Index
  • Data Fields
  • AUTH
  • auth_ops
Data Fields
AUTH::auth_ops Struct Reference
Collaboration diagram for AUTH::auth_ops:
[legend]

Data Fields

void(* | ah_nextverf )()
int(* | ah_marshal )()
int(* | ah_validate )()
int(* | ah_refresh )()
void(* | ah_destroy )()

Detailed Description

Definition at line 112 of file auth.h.

Field Documentation

◆ ah_destroy

void(* AUTH::auth_ops::ah_destroy) ()

Definition at line 117 of file auth.h.

◆ ah_marshal

int(* AUTH::auth_ops::ah_marshal) ()

Definition at line 114 of file auth.h.

◆ ah_nextverf

void(* AUTH::auth_ops::ah_nextverf) ()

Definition at line 113 of file auth.h.

◆ ah_refresh

int(* AUTH::auth_ops::ah_refresh) ()

Definition at line 116 of file auth.h.

◆ ah_validate

int(* AUTH::auth_ops::ah_validate) ()

Definition at line 115 of file auth.h.


Watt-32 tcp/ip: authdes_cred Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
authdes_cred Struct Reference
Collaboration diagram for authdes_cred:
[legend]

Data Fields

enum authdes_namekind | adc_namekind
struct authdes_fullname | adc_fullname
u_long | adc_nickname

Detailed Description

Definition at line 66 of file auth_des.h.

Field Documentation

◆ adc_fullname

struct authdes_fullname authdes_cred::adc_fullname

Definition at line 68 of file auth_des.h.

◆ adc_namekind

enum authdes_namekind authdes_cred::adc_namekind

Definition at line 67 of file auth_des.h.

◆ adc_nickname

u_long authdes_cred::adc_nickname

Definition at line 69 of file auth_des.h.


Watt-32 tcp/ip: authdes_fullname Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
authdes_fullname Struct Reference
Collaboration diagram for authdes_fullname:
[legend]

Data Fields

char * | name
des_block key
u_long | window

Detailed Description

Definition at line 57 of file auth_des.h.

Field Documentation

◆ key

des_block authdes_fullname::key

Definition at line 59 of file auth_des.h.

◆ name

char* authdes_fullname::name

Definition at line 58 of file auth_des.h.

◆ window

u_long authdes_fullname::window

Definition at line 60 of file auth_des.h.


Watt-32 tcp/ip: authdes_verf Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
authdes_verf Struct Reference
Collaboration diagram for authdes_verf:
[legend]

Data Fields

union {
struct timeval adv_ctime
des_block adv_xtime
} adv_time_u
u_long adv_int_u

Detailed Description

Definition at line 75 of file auth_des.h.

Field Documentation

◆ adv_ctime

struct timeval authdes_verf::adv_ctime

Definition at line 77 of file auth_des.h.

◆ adv_int_u

u_long authdes_verf::adv_int_u

Definition at line 80 of file auth_des.h.

◆ adv_xtime

des_block authdes_verf::adv_xtime

Definition at line 78 of file auth_des.h.


Watt-32 tcp/ip: authunix_parms Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
authunix_parms Struct Reference
Collaboration diagram for authunix_parms:
[legend]

Data Fields

u_long | aup_time
char * | aup_machname
int | aup_uid
int | aup_gid
u_int | aup_len
int * | aup_gids

Detailed Description

Definition at line 61 of file auth_uni.h.

Field Documentation

◆ aup_gid

int authunix_parms::aup_gid

Definition at line 65 of file auth_uni.h.

◆ aup_gids

int* authunix_parms::aup_gids

Definition at line 67 of file auth_uni.h.

◆ aup_len

u_int authunix_parms::aup_len

Definition at line 66 of file auth_uni.h.

◆ aup_machname

char* authunix_parms::aup_machname

Definition at line 63 of file auth_uni.h.

◆ aup_time

u_long authunix_parms::aup_time

Definition at line 62 of file auth_uni.h.

◆ aup_uid

int authunix_parms::aup_uid

Definition at line 64 of file auth_uni.h.


Watt-32 tcp/ip: ax25_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ax25_Header Struct Reference
Collaboration diagram for ax25_Header:
[legend]

Data Fields

char | dest [AX25_ADDR_LEN]
char | source [AX25_ADDR_LEN]
char | digis [8][AX25_ADDR_LEN]

Detailed Description

Definition at line 214 of file pcsed.h.

Field Documentation

◆ dest

char ax25_Header::dest[AX25_ADDR_LEN]

Definition at line 215 of file pcsed.h.

◆ digis

char ax25_Header::digis[8][AX25_ADDR_LEN]

Definition at line 217 of file pcsed.h.

◆ source

char ax25_Header::source[AX25_ADDR_LEN]

Definition at line 216 of file pcsed.h.


Watt-32 tcp/ip: ax25_Packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ax25_Packet Struct Reference
Collaboration diagram for ax25_Packet:
[legend]

Data Fields

ax25_Header head
BYTE data [AX25_MAX_DATA]

Detailed Description

Definition at line 220 of file pcsed.h.

Field Documentation

◆ data

BYTE ax25_Packet::data[AX25_MAX_DATA]

Definition at line 222 of file pcsed.h.

◆ head

ax25_Header ax25_Packet::head

Definition at line 221 of file pcsed.h.


Watt-32 tcp/ip: bootp Struct Reference

  • Data Structure Index
  • Data Fields
bootp Struct Reference

#include <pcbootp.h>

Detailed Description

Structure for send and receive.

Definition at line 61 of file pcbootp.h.


Watt-32 tcp/ip: bootp_vend Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
bootp_vend Struct Reference

#include <pcbootp.h>

Collaboration diagram for bootp_vend:
[legend]

Data Fields

BYTE | v_magic [4]
DWORD | v_flags
BYTE | v_unused [56]

Detailed Description

"vendor" data permitted for Stanford boot clients.

Definition at line 109 of file pcbootp.h.

Field Documentation

◆ v_flags

DWORD bootp_vend::v_flags

Definition at line 111 of file pcbootp.h.

◆ v_magic

BYTE bootp_vend::v_magic[4]

Definition at line 110 of file pcbootp.h.

◆ v_unused

BYTE bootp_vend::v_unused[56]

Definition at line 112 of file pcbootp.h.


Watt-32 tcp/ip: bpf_d Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
bpf_d Struct Reference
Collaboration diagram for bpf_d:
[legend]

Data Fields

struct bpf_d * | bd_next
caddr_t | bd_sbuf
caddr_t | bd_hbuf
caddr_t | bd_fbuf
int | bd_slen
int | bd_hlen
int | bd_bufsize
struct bpf_if * | bd_bif
u_long | bd_rtout
struct bpf_insn * | bd_filter
u_long | bd_rcount
u_long | bd_dcount
u_char | bd_promisc
u_char | bd_state
u_char | bd_immediate
int | bd_async
int | bd_pgid
u_char | bd_pad
struct selinfo | bd_sel

Detailed Description

Definition at line 52 of file bpfdesc.h.

Field Documentation

◆ bd_async

int bpf_d::bd_async

Definition at line 80 of file bpfdesc.h.

◆ bd_bif

struct bpf_if* bpf_d::bd_bif

Definition at line 71 of file bpfdesc.h.

◆ bd_bufsize

int bpf_d::bd_bufsize

Definition at line 69 of file bpfdesc.h.

◆ bd_dcount

u_long bpf_d::bd_dcount

Definition at line 75 of file bpfdesc.h.

◆ bd_fbuf

caddr_t bpf_d::bd_fbuf

Definition at line 65 of file bpfdesc.h.

◆ bd_filter

struct bpf_insn* bpf_d::bd_filter

Definition at line 73 of file bpfdesc.h.

◆ bd_hbuf

caddr_t bpf_d::bd_hbuf

Definition at line 64 of file bpfdesc.h.

◆ bd_hlen

int bpf_d::bd_hlen

Definition at line 67 of file bpfdesc.h.

◆ bd_immediate

u_char bpf_d::bd_immediate

Definition at line 79 of file bpfdesc.h.

◆ bd_next

struct bpf_d* bpf_d::bd_next

Definition at line 53 of file bpfdesc.h.

◆ bd_pad

u_char bpf_d::bd_pad

Definition at line 82 of file bpfdesc.h.

◆ bd_pgid

int bpf_d::bd_pgid

Definition at line 81 of file bpfdesc.h.

◆ bd_promisc

u_char bpf_d::bd_promisc

Definition at line 77 of file bpfdesc.h.

◆ bd_rcount

u_long bpf_d::bd_rcount

Definition at line 74 of file bpfdesc.h.

◆ bd_rtout

u_long bpf_d::bd_rtout

Definition at line 72 of file bpfdesc.h.

◆ bd_sbuf

caddr_t bpf_d::bd_sbuf

Definition at line 63 of file bpfdesc.h.

◆ bd_sel

struct selinfo bpf_d::bd_sel

Definition at line 83 of file bpfdesc.h.

◆ bd_slen

int bpf_d::bd_slen

Definition at line 66 of file bpfdesc.h.

◆ bd_state

u_char bpf_d::bd_state

Definition at line 78 of file bpfdesc.h.


Watt-32 tcp/ip: bpf_hdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
bpf_hdr Struct Reference

Berkeley Packet Filter header. More...

#include <packet32.h>

Collaboration diagram for bpf_hdr:
[legend]

Data Fields

struct npf_driver_timeval | bh_tstamp
DWORD | bh_caplen
DWORD | bh_datalen
WORD | bh_hdrlen
struct timeval | bh_tstamp
u_int32_t | bh_caplen
u_int32_t | bh_datalen
u_int16_t | bh_hdrlen

Detailed Description

Berkeley Packet Filter header.

This structure defines the header associated with every packet delivered to the application.

Definition at line 241 of file packet32.h.

Field Documentation

◆ bh_caplen [1/2]

u_int32_t bpf_hdr::bh_caplen

Definition at line 152 of file bpf.h.

◆ bh_caplen [2/2]

DWORD bpf_hdr::bh_caplen

Definition at line 243 of file packet32.h.

◆ bh_datalen [1/2]

u_int32_t bpf_hdr::bh_datalen

Definition at line 153 of file bpf.h.

◆ bh_datalen [2/2]

DWORD bpf_hdr::bh_datalen

Definition at line 244 of file packet32.h.

◆ bh_hdrlen [1/2]

u_int16_t bpf_hdr::bh_hdrlen

Definition at line 154 of file bpf.h.

◆ bh_hdrlen [2/2]

WORD bpf_hdr::bh_hdrlen

Definition at line 245 of file packet32.h.

◆ bh_tstamp [1/2]

struct timeval bpf_hdr::bh_tstamp

Definition at line 151 of file bpf.h.

◆ bh_tstamp [2/2]

struct npf_driver_timeval bpf_hdr::bh_tstamp

Definition at line 242 of file packet32.h.


Watt-32 tcp/ip: bpf_if Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
bpf_if Struct Reference
Collaboration diagram for bpf_if:
[legend]

Data Fields

struct bpf_if * | bif_next
struct bpf_d * | bif_dlist
struct bpf_if ** | bif_driverp
u_int | bif_dlt
u_int | bif_hdrlen
struct ifnet * | bif_ifp

Detailed Description

Definition at line 89 of file bpfdesc.h.

Field Documentation

◆ bif_dlist

struct bpf_d* bpf_if::bif_dlist

Definition at line 91 of file bpfdesc.h.

◆ bif_dlt

u_int bpf_if::bif_dlt

Definition at line 93 of file bpfdesc.h.

◆ bif_driverp

struct bpf_if** bpf_if::bif_driverp

Definition at line 92 of file bpfdesc.h.

◆ bif_hdrlen

u_int bpf_if::bif_hdrlen

Definition at line 94 of file bpfdesc.h.

◆ bif_ifp

struct ifnet* bpf_if::bif_ifp

Definition at line 95 of file bpfdesc.h.

◆ bif_next

struct bpf_if* bpf_if::bif_next

Definition at line 90 of file bpfdesc.h.


Watt-32 tcp/ip: bpf_insn Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
bpf_insn Struct Reference
Collaboration diagram for bpf_insn:
[legend]

Data Fields

u_int16_t | code
u_char | jt
u_char | jf
int32_t | k

Detailed Description

Definition at line 247 of file bpf.h.

Field Documentation

◆ code

u_int16_t bpf_insn::code

Definition at line 248 of file bpf.h.

◆ jf

u_char bpf_insn::jf

Definition at line 250 of file bpf.h.

◆ jt

u_char bpf_insn::jt

Definition at line 249 of file bpf.h.

◆ k

int32_t bpf_insn::k

Definition at line 251 of file bpf.h.


Watt-32 tcp/ip: bpf_program Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
bpf_program Struct Reference
Collaboration diagram for bpf_program:
[legend]

Data Fields

u_int | bf_len
struct bpf_insn * | bf_insns

Detailed Description

Definition at line 73 of file bpf.h.

Field Documentation

◆ bf_insns

struct bpf_insn* bpf_program::bf_insns

Definition at line 75 of file bpf.h.

◆ bf_len

u_int bpf_program::bf_len

Definition at line 74 of file bpf.h.


Watt-32 tcp/ip: bpf_stat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
bpf_stat Struct Reference
Collaboration diagram for bpf_stat:
[legend]

Data Fields

DWORD | bs_recv
DWORD | bs_drop
DWORD | ps_ifdrop
DWORD | bs_capt
u_int | bs_recv
u_int | bs_drop

Detailed Description

Definition at line 251 of file packet32.h.

Field Documentation

◆ bs_capt

DWORD bpf_stat::bs_capt

Definition at line 255 of file packet32.h.

◆ bs_drop [1/2]

u_int bpf_stat::bs_drop

Definition at line 83 of file bpf.h.

◆ bs_drop [2/2]

DWORD bpf_stat::bs_drop

Definition at line 253 of file packet32.h.

◆ bs_recv [1/2]

u_int bpf_stat::bs_recv

Definition at line 82 of file bpf.h.

◆ bs_recv [2/2]

DWORD bpf_stat::bs_recv

Definition at line 252 of file packet32.h.

◆ ps_ifdrop

DWORD bpf_stat::ps_ifdrop

Definition at line 254 of file packet32.h.


Watt-32 tcp/ip: bpf_version Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
bpf_version Struct Reference
Collaboration diagram for bpf_version:
[legend]

Data Fields

u_short | bv_major
u_short | bv_minor

Detailed Description

Definition at line 97 of file bpf.h.

Field Documentation

◆ bv_major

u_short bpf_version::bv_major

Definition at line 98 of file bpf.h.

◆ bv_minor

u_short bpf_version::bv_minor

Definition at line 99 of file bpf.h.


Watt-32 tcp/ip: cache_stat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
cache_stat Struct Reference

#include <pcstat.h>

Collaboration diagram for cache_stat:
[legend]

Data Fields

DWORD | num_arp_search
DWORD | num_arp_hits
DWORD | num_arp_misses
DWORD | num_arp_overflow
DWORD | num_route_hits
DWORD | num_route_misses

Detailed Description

Statistics for various cache hits/misses.

Definition at line 83 of file pcstat.h.

Field Documentation

◆ num_arp_hits

DWORD cache_stat::num_arp_hits

Definition at line 85 of file pcstat.h.

◆ num_arp_misses

DWORD cache_stat::num_arp_misses

Definition at line 86 of file pcstat.h.

◆ num_arp_overflow

DWORD cache_stat::num_arp_overflow

Definition at line 87 of file pcstat.h.

◆ num_arp_search

DWORD cache_stat::num_arp_search

Definition at line 84 of file pcstat.h.

◆ num_route_hits

DWORD cache_stat::num_route_hits

Definition at line 88 of file pcstat.h.

◆ num_route_misses

DWORD cache_stat::num_route_misses

Definition at line 89 of file pcstat.h.


Watt-32 tcp/ip: call_body Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
call_body Struct Reference
Collaboration diagram for call_body:
[legend]

Data Fields

u_long | cb_rpcvers
u_long | cb_prog
u_long | cb_vers
u_long | cb_proc
struct opaque_auth | cb_cred
struct opaque_auth | cb_verf

Detailed Description

Definition at line 144 of file rpc_msg.h.

Field Documentation

◆ cb_cred

struct opaque_auth call_body::cb_cred

Definition at line 149 of file rpc_msg.h.

◆ cb_proc

u_long call_body::cb_proc

Definition at line 148 of file rpc_msg.h.

◆ cb_prog

u_long call_body::cb_prog

Definition at line 146 of file rpc_msg.h.

◆ cb_rpcvers

u_long call_body::cb_rpcvers

Definition at line 145 of file rpc_msg.h.

◆ cb_verf

struct opaque_auth call_body::cb_verf

Definition at line 150 of file rpc_msg.h.

◆ cb_vers

u_long call_body::cb_vers

Definition at line 147 of file rpc_msg.h.


Watt-32 tcp/ip: callout Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
callout Struct Reference
Collaboration diagram for callout:
[legend]

Data Fields

struct callout * | c_next
void * | c_arg
void(* | c_func )(void *)
int | c_time

Detailed Description

Definition at line 402 of file wtypes.h.

Field Documentation

◆ c_arg

void* callout::c_arg

Definition at line 404 of file wtypes.h.

◆ c_func

void(* callout::c_func) (void *)

Definition at line 405 of file wtypes.h.

◆ c_next

struct callout* callout::c_next

Definition at line 403 of file wtypes.h.

◆ c_time

int callout::c_time

Definition at line 406 of file wtypes.h.


Watt-32 tcp/ip: CLIENT Struct Reference

  • Data Structure Index
  • Data Fields
Data Structures | Data Fields
CLIENT Struct Reference
Collaboration diagram for CLIENT:
[legend]

Data Structures

struct clnt_ops

Data Fields

AUTH * cl_auth
struct CLIENT::clnt_ops * | cl_ops
caddr_t | cl_private

Detailed Description

Definition at line 120 of file clnt.h.

Field Documentation

◆ cl_auth

AUTH* CLIENT::cl_auth

Definition at line 121 of file clnt.h.

◆ cl_private

caddr_t CLIENT::cl_private

Definition at line 130 of file clnt.h.


Watt-32 tcp/ip: CLIENT::clnt_ops Struct Reference

  • Data Structure Index
  • Data Fields
  • CLIENT
  • clnt_ops
Data Fields
CLIENT::clnt_ops Struct Reference
Collaboration diagram for CLIENT::clnt_ops:
[legend]

Data Fields

enum clnt_stat(* | cl_call )()
void(* | cl_abort )()
void(* | cl_geterr )()
bool_t(* | cl_freeres )()
void(* | cl_destroy )()
bool_t(* | cl_control )()

Detailed Description

Definition at line 122 of file clnt.h.

Field Documentation

◆ cl_abort

void(* CLIENT::clnt_ops::cl_abort) ()

Definition at line 124 of file clnt.h.

◆ cl_call

enum clnt_stat(* CLIENT::clnt_ops::cl_call) ()

Definition at line 130 of file clnt.h.

◆ cl_control

bool_t(* CLIENT::clnt_ops::cl_control) ()

Definition at line 128 of file clnt.h.

◆ cl_destroy

void(* CLIENT::clnt_ops::cl_destroy) ()

Definition at line 127 of file clnt.h.

◆ cl_freeres

bool_t(* CLIENT::clnt_ops::cl_freeres) ()

Definition at line 126 of file clnt.h.

◆ cl_geterr

void(* CLIENT::clnt_ops::cl_geterr) ()

Definition at line 125 of file clnt.h.


Watt-32 tcp/ip: cmd_block Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
cmd_block Struct Reference

Run a COMMAND.COM/4DOS external/internal command. More...

Collaboration diagram for cmd_block:
[legend]

Data Fields

BYTE | len
char | buf [256]

Detailed Description

Run a COMMAND.COM/4DOS external/internal command.

Definition at line 1420 of file misc.c.

Field Documentation

◆ buf

char cmd_block::buf[256]

Definition at line 1422 of file misc.c.

◆ len

BYTE cmd_block::len

Definition at line 1421 of file misc.c.


Watt-32 tcp/ip: cmsghdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
cmsghdr Struct Reference
Collaboration diagram for cmsghdr:
[legend]

Data Fields

u_int | cmsg_len
int | cmsg_level
int | cmsg_type

Detailed Description

Definition at line 251 of file socket.h.

Field Documentation

◆ cmsg_len

u_int cmsghdr::cmsg_len

Definition at line 252 of file socket.h.

◆ cmsg_level

int cmsghdr::cmsg_level

Definition at line 253 of file socket.h.

◆ cmsg_type

int cmsghdr::cmsg_type

Definition at line 254 of file socket.h.


Watt-32 tcp/ip: code Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
code Struct Reference
Collaboration diagram for code:
[legend]

Data Fields

unsigned char | op
unsigned char | bits
unsigned short | val

Detailed Description

Definition at line 24 of file zinftree.h.

Field Documentation

◆ bits

unsigned char code::bits

Definition at line 26 of file zinftree.h.

◆ op

unsigned char code::op

Definition at line 25 of file zinftree.h.

◆ val

unsigned short code::val

Definition at line 27 of file zinftree.h.


Watt-32 tcp/ip: compressor Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
compressor Struct Reference
Collaboration diagram for compressor:
[legend]

Data Fields

int | compress_proto
void *(* | comp_alloc )(u_char *options, int opt_len)
void(* | comp_free )(void *state)
int(* | comp_init )(void *state, u_char *options, int opt_len, int unit, int hdrlen, int debug)
void(* | comp_reset )(void *state)
int(* | compress )(void *state, PACKETPTR *mret, PACKETPTR mp, int orig_len, int max_len)
void(* | comp_stat )(void *state, struct compstat *stats)
void *(* | decomp_alloc )(u_char *options, int opt_len)
void(* | decomp_free )(void *state)
int(* | decomp_init )(void *state, u_char *options, int opt_len, int unit, int hdrlen, int mru, int debug)
void(* | decomp_reset )(void *state)
int(* | decompress )(void *state, PACKETPTR mp, PACKETPTR *dmpp)
void(* | incomp )(void *state, PACKETPTR mp)
void(* | decomp_stat )(void *state, struct compstat *stats)

Detailed Description

Definition at line 54 of file ppp-comp.h.

Field Documentation

◆ comp_alloc

void *(* compressor::comp_alloc) (u_char *options, int opt_len)

Definition at line 58 of file ppp-comp.h.

◆ comp_free

void(* compressor::comp_free) (void *state)

Definition at line 61 of file ppp-comp.h.

◆ comp_init

int(* compressor::comp_init) (void *state, u_char *options, int opt_len, int unit, int hdrlen, int debug)

Definition at line 64 of file ppp-comp.h.

◆ comp_reset

void(* compressor::comp_reset) (void *state)

Definition at line 67 of file ppp-comp.h.

◆ comp_stat

void(* compressor::comp_stat) (void *state, struct compstat *stats)

Definition at line 74 of file ppp-comp.h.

◆ compress

int(* compressor::compress) (void *state, PACKETPTR *mret, PACKETPTR mp, int orig_len, int max_len)

Definition at line 70 of file ppp-comp.h.

◆ compress_proto

int compressor::compress_proto

Definition at line 55 of file ppp-comp.h.

◆ decomp_alloc

void *(* compressor::decomp_alloc) (u_char *options, int opt_len)

Definition at line 77 of file ppp-comp.h.

◆ decomp_free

void(* compressor::decomp_free) (void *state)

Definition at line 80 of file ppp-comp.h.

◆ decomp_init

int(* compressor::decomp_init) (void *state, u_char *options, int opt_len, int unit, int hdrlen, int mru, int debug)

Definition at line 83 of file ppp-comp.h.

◆ decomp_reset

void(* compressor::decomp_reset) (void *state)

Definition at line 86 of file ppp-comp.h.

◆ decomp_stat

void(* compressor::decomp_stat) (void *state, struct compstat *stats)

Definition at line 95 of file ppp-comp.h.

◆ decompress

int(* compressor::decompress) (void *state, PACKETPTR mp, PACKETPTR *dmpp)

Definition at line 89 of file ppp-comp.h.

◆ incomp

void(* compressor::incomp) (void *state, PACKETPTR mp)

Definition at line 92 of file ppp-comp.h.


Watt-32 tcp/ip: compstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
compstat Struct Reference
Collaboration diagram for compstat:
[legend]

Data Fields

unsigned int | unc_bytes
unsigned int | unc_packets
unsigned int | comp_bytes
unsigned int | comp_packets
unsigned int | inc_bytes
unsigned int | inc_packets
unsigned int | ratio

Detailed Description

Definition at line 171 of file ppp_defs.h.

Field Documentation

◆ comp_bytes

unsigned int compstat::comp_bytes

Definition at line 174 of file ppp_defs.h.

◆ comp_packets

unsigned int compstat::comp_packets

Definition at line 175 of file ppp_defs.h.

◆ inc_bytes

unsigned int compstat::inc_bytes

Definition at line 176 of file ppp_defs.h.

◆ inc_packets

unsigned int compstat::inc_packets

Definition at line 177 of file ppp_defs.h.

◆ ratio

unsigned int compstat::ratio

Definition at line 178 of file ppp_defs.h.

◆ unc_bytes

unsigned int compstat::unc_bytes

Definition at line 172 of file ppp_defs.h.

◆ unc_packets

unsigned int compstat::unc_packets

Definition at line 173 of file ppp_defs.h.


Watt-32 tcp/ip: config_s Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
config_s Struct Reference
Collaboration diagram for config_s:
[legend]

Data Fields

ush | good_length
ush | max_lazy
ush | nice_length
ush | max_chain
compress_func | func

Detailed Description

Definition at line 126 of file zdeflate.c.

Field Documentation

◆ func

compress_func config_s::func

Definition at line 131 of file zdeflate.c.

◆ good_length

ush config_s::good_length

Definition at line 127 of file zdeflate.c.

◆ max_chain

ush config_s::max_chain

Definition at line 130 of file zdeflate.c.

◆ max_lazy

ush config_s::max_lazy

Definition at line 128 of file zdeflate.c.

◆ nice_length

ush config_s::nice_length

Definition at line 129 of file zdeflate.c.


Watt-32 tcp/ip: config_table Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
config_table Struct Reference
Collaboration diagram for config_table:
[legend]

Data Fields

const char * | keyword
enum config_tab_types | type
void * arg_func

Detailed Description

Definition at line 461 of file tcp.h.

Field Documentation

◆ arg_func

void* config_table::arg_func

Definition at line 464 of file tcp.h.

◆ keyword

const char* config_table::keyword

Definition at line 462 of file tcp.h.

◆ type

enum config_tab_types config_table::type

Definition at line 463 of file tcp.h.


Watt-32 tcp/ip: conv_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
conv_t Struct Reference
Collaboration diagram for conv_t:
[legend]

Data Fields

int istate

Detailed Description

Definition at line 8 of file idna.h.

Field Documentation

◆ istate

int conv_t::istate

Definition at line 9 of file idna.h.


Watt-32 tcp/ip: cookieMessage Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
cookieMessage Struct Reference
Collaboration diagram for cookieMessage:
[legend]

Data Fields

DWORD | TieTag_curTag
DWORD | TieTag_hisTag
DWORD | cookieLife
struct sctp_TimeStamp | timeEnteringState
struct sctp_Initiation | initAckISent
DWORD | addressWhereISent [4]
DWORD | addrtype
WORD | locScope
WORD | siteScope

Detailed Description

Definition at line 646 of file sctp.h.

Field Documentation

◆ addressWhereISent

DWORD cookieMessage::addressWhereISent[4]

Definition at line 652 of file sctp.h.

◆ addrtype

DWORD cookieMessage::addrtype

Definition at line 653 of file sctp.h.

◆ cookieLife

DWORD cookieMessage::cookieLife

Definition at line 649 of file sctp.h.

◆ initAckISent

struct sctp_Initiation cookieMessage::initAckISent

Definition at line 651 of file sctp.h.

◆ locScope

WORD cookieMessage::locScope

Definition at line 654 of file sctp.h.

◆ siteScope

WORD cookieMessage::siteScope

Definition at line 655 of file sctp.h.

◆ TieTag_curTag

DWORD cookieMessage::TieTag_curTag

Definition at line 647 of file sctp.h.

◆ TieTag_hisTag

DWORD cookieMessage::TieTag_hisTag

Definition at line 648 of file sctp.h.

◆ timeEnteringState

struct sctp_TimeStamp cookieMessage::timeEnteringState

Definition at line 650 of file sctp.h.


Watt-32 tcp/ip: cr0 Union Reference

  • Data Structure Index
  • Data Fields
Data Fields
cr0 Union Reference
Collaboration diagram for cr0:
[legend]

Data Fields

unsigned long i

Detailed Description

Definition at line 172 of file register.h.

Field Documentation

◆ cr0

cr0_bits cr0::cr0

Definition at line 173 of file register.h.

◆ i

unsigned long cr0::i

Definition at line 174 of file register.h.


Watt-32 tcp/ip: cr0_bits Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
cr0_bits Struct Reference
Collaboration diagram for cr0_bits:
[legend]

Data Fields

unsigned int | protection_enable: 1
unsigned int | monitor_coproc: 1
unsigned int | coproc_soft_emul: 1
unsigned int | floating_instr_except: 1
unsigned int | extension_type: 1
unsigned int | numeric_error: 1
unsigned | int: 2
unsigned int | write_protect: 1
unsigned int | aligment_mask: 1
unsigned int | no_write_through: 1
unsigned int | page_level_cache_disable: 1
unsigned int | paging: 1

Detailed Description

Definition at line 137 of file register.h.

Field Documentation

◆ aligment_mask

unsigned int cr0_bits::aligment_mask

Definition at line 158 of file register.h.

◆ coproc_soft_emul

unsigned int cr0_bits::coproc_soft_emul

Definition at line 143 of file register.h.

◆ extension_type

unsigned int cr0_bits::extension_type

Definition at line 146 of file register.h.

◆ floating_instr_except

unsigned int cr0_bits::floating_instr_except

Definition at line 144 of file register.h.

◆ int

unsigned cr0_bits::int

Definition at line 148 of file register.h.

◆ monitor_coproc

unsigned int cr0_bits::monitor_coproc

Definition at line 142 of file register.h.

◆ no_write_through

unsigned int cr0_bits::no_write_through

Definition at line 167 of file register.h.

◆ numeric_error

unsigned int cr0_bits::numeric_error

Definition at line 147 of file register.h.

◆ page_level_cache_disable

unsigned int cr0_bits::page_level_cache_disable

Definition at line 168 of file register.h.

◆ paging

unsigned int cr0_bits::paging

Definition at line 169 of file register.h.

◆ protection_enable

unsigned int cr0_bits::protection_enable

Definition at line 141 of file register.h.

◆ write_protect

unsigned int cr0_bits::write_protect

Definition at line 156 of file register.h.


Watt-32 tcp/ip: cryptkeyarg Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
cryptkeyarg Struct Reference
Collaboration diagram for cryptkeyarg:
[legend]

Data Fields

netnamestr remotename
des_block deskey

Detailed Description

Definition at line 45 of file key_prot.h.

Field Documentation

◆ deskey

des_block cryptkeyarg::deskey

Definition at line 47 of file key_prot.h.

◆ remotename

netnamestr cryptkeyarg::remotename

Definition at line 46 of file key_prot.h.


Watt-32 tcp/ip: cryptkeyres Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
cryptkeyres Struct Reference
Collaboration diagram for cryptkeyres:
[legend]

Data Fields

keystatus status
union {
des_block deskey
} cryptkeyres_u

Detailed Description

Definition at line 52 of file key_prot.h.

Field Documentation

◆ deskey

des_block cryptkeyres::deskey

Definition at line 55 of file key_prot.h.

◆ status

keystatus cryptkeyres::status

Definition at line 53 of file key_prot.h.


Watt-32 tcp/ip: cstate Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
cstate Struct Reference
Collaboration diagram for cstate:
[legend]

Data Fields

BYTE | cs_this
WORD | cs_next
in_Header cs_ip
tcp_Header cs_tcp
BYTE | cs_ipopt [40]
BYTE | cs_tcpopt [40]
struct cstate * | cs_next
u_int16_t | cs_hlen
u_char | cs_id
u_char | cs_filler
union {
char csu_hdr [MAX_HDR]
struct ip csu_ip
} slcs_u

Detailed Description

Definition at line 135 of file pcpkt.h.

Field Documentation

◆ cs_filler

u_char cstate::cs_filler

Definition at line 139 of file slcompre.h.

◆ cs_hlen

u_int16_t cstate::cs_hlen

Definition at line 137 of file slcompre.h.

◆ cs_id

u_char cstate::cs_id

Definition at line 138 of file slcompre.h.

◆ cs_ip

in_Header cstate::cs_ip

Definition at line 138 of file pcpkt.h.

◆ cs_ipopt

BYTE cstate::cs_ipopt[40]

Definition at line 140 of file pcpkt.h.

◆ cs_next [1/2]

struct cstate* cstate::cs_next

Definition at line 136 of file slcompre.h.

◆ cs_next [2/2]

WORD cstate::cs_next

Definition at line 137 of file pcpkt.h.

◆ cs_tcp

tcp_Header cstate::cs_tcp

Definition at line 139 of file pcpkt.h.

◆ cs_tcpopt

BYTE cstate::cs_tcpopt[40]

Definition at line 141 of file pcpkt.h.

◆ cs_this

BYTE cstate::cs_this

Definition at line 136 of file pcpkt.h.

◆ csu_hdr

char cstate::csu_hdr[MAX_HDR]

Definition at line 141 of file slcompre.h.

◆ csu_ip

struct ip cstate::csu_ip

Definition at line 142 of file slcompre.h.


Watt-32 tcp/ip: ct_data_s Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ct_data_s Struct Reference
Collaboration diagram for ct_data_s:
[legend]

Data Fields

union {
ush freq
ush code
} fc
union {
ush dad
ush len
} dl

Detailed Description

Definition at line 58 of file zdeflate.h.

Field Documentation

◆ code

ush ct_data_s::code

Definition at line 61 of file zdeflate.h.

◆ dad

ush ct_data_s::dad

Definition at line 64 of file zdeflate.h.

◆ freq

ush ct_data_s::freq

Definition at line 60 of file zdeflate.h.

◆ len

ush ct_data_s::len

Definition at line 65 of file zdeflate.h.


Watt-32 tcp/ip: CTL_MSG Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
CTL_MSG Struct Reference
Collaboration diagram for CTL_MSG:
[legend]

Data Fields

u_char | vers
u_char | type
u_char | answer
u_char | pad
u_int32_t | id_num
struct osockaddr | addr
struct osockaddr | ctl_addr
int32_t | pid
char | l_name [NAME_SIZE]
char | r_name [NAME_SIZE]
char | r_tty [TTY_SIZE]

Detailed Description

Definition at line 66 of file talkd.h.

Field Documentation

◆ addr

struct osockaddr CTL_MSG::addr

Definition at line 72 of file talkd.h.

◆ answer

u_char CTL_MSG::answer

Definition at line 69 of file talkd.h.

◆ ctl_addr

struct osockaddr CTL_MSG::ctl_addr

Definition at line 73 of file talkd.h.

◆ id_num

u_int32_t CTL_MSG::id_num

Definition at line 71 of file talkd.h.

◆ l_name

char CTL_MSG::l_name[NAME_SIZE]

Definition at line 76 of file talkd.h.

◆ pad

u_char CTL_MSG::pad

Definition at line 70 of file talkd.h.

◆ pid

int32_t CTL_MSG::pid

Definition at line 74 of file talkd.h.

◆ r_name

char CTL_MSG::r_name[NAME_SIZE]

Definition at line 77 of file talkd.h.

◆ r_tty

char CTL_MSG::r_tty[TTY_SIZE]

Definition at line 79 of file talkd.h.

◆ type

u_char CTL_MSG::type

Definition at line 68 of file talkd.h.

◆ vers

u_char CTL_MSG::vers

Definition at line 67 of file talkd.h.


Watt-32 tcp/ip: CTL_RESPONSE Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
CTL_RESPONSE Struct Reference
Collaboration diagram for CTL_RESPONSE:
[legend]

Data Fields

u_char | vers
u_char | type
u_char | answer
u_char | pad
u_int32_t | id_num
struct osockaddr | addr

Detailed Description

Definition at line 85 of file talkd.h.

Field Documentation

◆ addr

struct osockaddr CTL_RESPONSE::addr

Definition at line 91 of file talkd.h.

◆ answer

u_char CTL_RESPONSE::answer

Definition at line 88 of file talkd.h.

◆ id_num

u_int32_t CTL_RESPONSE::id_num

Definition at line 90 of file talkd.h.

◆ pad

u_char CTL_RESPONSE::pad

Definition at line 89 of file talkd.h.

◆ type

u_char CTL_RESPONSE::type

Definition at line 87 of file talkd.h.

◆ vers

u_char CTL_RESPONSE::vers

Definition at line 86 of file talkd.h.


Watt-32 tcp/ip: datum Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
datum Struct Reference
Collaboration diagram for datum:
[legend]

Data Fields

char * | dptr
int | dsize

Detailed Description

Definition at line 116 of file yp_prot.h.

Field Documentation

◆ dptr

char* datum::dptr

Definition at line 117 of file yp_prot.h.

◆ dsize

int datum::dsize

Definition at line 118 of file yp_prot.h.


Watt-32 tcp/ip: des_block Union Reference

  • Data Structure Index
  • Data Fields
Data Fields
des_block Union Reference
Collaboration diagram for des_block:
[legend]

Data Fields

struct {
u_long high
u_long low
} key
char c [8]

Detailed Description

Definition at line 80 of file auth.h.

Field Documentation

◆ c

char des_block::c[8]

Definition at line 85 of file auth.h.

◆ high

u_long des_block::high

Definition at line 82 of file auth.h.

◆ low

u_long des_block::low

Definition at line 83 of file auth.h.


Watt-32 tcp/ip: dhcp Struct Reference

  • Data Structure Index
  • Data Fields
dhcp Struct Reference

#include <pcdhcp.h>

Detailed Description

Largest DHCP in/out packet.

Definition at line 125 of file pcdhcp.h.


Watt-32 tcp/ip: DHCP_list Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
DHCP_list Struct Reference
Collaboration diagram for DHCP_list:
[legend]

Data Fields

BYTE * | data
unsigned | size

Detailed Description

Definition at line 116 of file pcdhcp.h.

Field Documentation

◆ data

BYTE* DHCP_list::data

Definition at line 117 of file pcdhcp.h.

◆ size

unsigned DHCP_list::size

Definition at line 118 of file pcdhcp.h.


Watt-32 tcp/ip: DNS_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
DNS_Header Struct Reference

Another definition of 'struct DNS_head'. More...

#include <pcdns.h>

Collaboration diagram for DNS_Header:
[legend]

Data Fields

WORD | dns_id
WORD | dns_fl_rd: 1
WORD | dns_fl_tc: 1
WORD | dns_fl_aa: 1
WORD | dns_fl_opcode: 4
WORD | dns_fl_qr: 1
WORD | dns_fl_rcode: 4
WORD | dns_fl_cd: 1
WORD | dns_fl_ad: 1
WORD | dns_fl_unused: 1
WORD | dns_fl_ra: 1
WORD | dns_num_q
WORD | dns_num_ans
WORD | dns_num_auth
WORD | dns_num_add

Detailed Description

Another definition of 'struct DNS_head'.

Todo:
Rewrite to use only 'struct DNS_Header'.

Definition at line 96 of file pcdns.h.

Field Documentation

◆ dns_fl_aa

WORD DNS_Header::dns_fl_aa

Definition at line 100 of file pcdns.h.

◆ dns_fl_ad

WORD DNS_Header::dns_fl_ad

Definition at line 105 of file pcdns.h.

◆ dns_fl_cd

WORD DNS_Header::dns_fl_cd

Definition at line 104 of file pcdns.h.

◆ dns_fl_opcode

WORD DNS_Header::dns_fl_opcode

Definition at line 101 of file pcdns.h.

◆ dns_fl_qr

WORD DNS_Header::dns_fl_qr

Definition at line 102 of file pcdns.h.

◆ dns_fl_ra

WORD DNS_Header::dns_fl_ra

Definition at line 107 of file pcdns.h.

◆ dns_fl_rcode

WORD DNS_Header::dns_fl_rcode

Definition at line 103 of file pcdns.h.

◆ dns_fl_rd

WORD DNS_Header::dns_fl_rd

Definition at line 98 of file pcdns.h.

◆ dns_fl_tc

WORD DNS_Header::dns_fl_tc

Definition at line 99 of file pcdns.h.

◆ dns_fl_unused

WORD DNS_Header::dns_fl_unused

Definition at line 106 of file pcdns.h.

◆ dns_id

WORD DNS_Header::dns_id

Definition at line 97 of file pcdns.h.

◆ dns_num_add

WORD DNS_Header::dns_num_add

Definition at line 111 of file pcdns.h.

◆ dns_num_ans

WORD DNS_Header::dns_num_ans

Definition at line 109 of file pcdns.h.

◆ dns_num_auth

WORD DNS_Header::dns_num_auth

Definition at line 110 of file pcdns.h.

◆ dns_num_q

WORD DNS_Header::dns_num_q

Definition at line 108 of file pcdns.h.


Watt-32 tcp/ip: DNS_Query Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
DNS_Query Struct Reference
Collaboration diagram for DNS_Query:
[legend]

Data Fields

struct DNS_Header | head
BYTE | body [DOMSIZE]

Detailed Description

Definition at line 192 of file pcdns.h.

Field Documentation

◆ body

BYTE DNS_Query::body[DOMSIZE]

Definition at line 194 of file pcdns.h.

◆ head

struct DNS_Header DNS_Query::head

Definition at line 193 of file pcdns.h.


Watt-32 tcp/ip: DNS_query Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
DNS_query Struct Reference
Collaboration diagram for DNS_query:
[legend]

Data Fields

struct DNS_head | head
BYTE | body [DOMSIZE]

Detailed Description

Definition at line 187 of file pcdns.h.

Field Documentation

◆ body

BYTE DNS_query::body[DOMSIZE]

Definition at line 189 of file pcdns.h.

◆ head

struct DNS_head DNS_query::head

Definition at line 188 of file pcdns.h.


Watt-32 tcp/ip: DNS_resource Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
DNS_resource Struct Reference
Collaboration diagram for DNS_resource:
[legend]

Data Fields

WORD | rtype
WORD | rclass
DWORD | ttl
WORD | rdlength
BYTE | rdata [DOMSIZE-10]

Detailed Description

Definition at line 202 of file pcdns.h.

Field Documentation

◆ rclass

WORD DNS_resource::rclass

Definition at line 204 of file pcdns.h.

◆ rdata

BYTE DNS_resource::rdata[DOMSIZE-10]

Definition at line 207 of file pcdns.h.

◆ rdlength

WORD DNS_resource::rdlength

Definition at line 206 of file pcdns.h.

◆ rtype

WORD DNS_resource::rtype

Definition at line 203 of file pcdns.h.

◆ ttl

DWORD DNS_resource::ttl

Definition at line 205 of file pcdns.h.


Watt-32 tcp/ip: do_redirect Struct Reference

  • Data Structure Index
  • Data Fields
do_redirect Struct Reference

Detailed Description

Definition at line 101 of file pcicmp.c.


Watt-32 tcp/ip: dom_binding Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
dom_binding Struct Reference
Collaboration diagram for dom_binding:
[legend]

Data Fields

struct dom_binding * | dom_pnext
char | dom_domain [YPMAXDOMAIN+1]
struct sockaddr_in | dom_server_addr
u_short | dom_server_port
int | dom_socket
CLIENT * dom_client
u_short | dom_local_port
long | dom_vers

Detailed Description

Definition at line 222 of file yp_prot.h.

Field Documentation

◆ dom_client

CLIENT* dom_binding::dom_client

Definition at line 228 of file yp_prot.h.

◆ dom_domain

char dom_binding::dom_domain[YPMAXDOMAIN+1]

Definition at line 224 of file yp_prot.h.

◆ dom_local_port

u_short dom_binding::dom_local_port

Definition at line 229 of file yp_prot.h.

◆ dom_pnext

struct dom_binding* dom_binding::dom_pnext

Definition at line 223 of file yp_prot.h.

◆ dom_server_addr

struct sockaddr_in dom_binding::dom_server_addr

Definition at line 225 of file yp_prot.h.

◆ dom_server_port

u_short dom_binding::dom_server_port

Definition at line 226 of file yp_prot.h.

◆ dom_socket

int dom_binding::dom_socket

Definition at line 227 of file yp_prot.h.

◆ dom_vers

long dom_binding::dom_vers

Definition at line 230 of file yp_prot.h.


Watt-32 tcp/ip: DPMI_callback Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
DPMI_callback Struct Reference
Collaboration diagram for DPMI_callback:
[legend]

Data Fields

void(* | pm_func )(void)
BYTE * | wrapper
REALPTR | rm_addr
REAL_regs rm_regs

Detailed Description

Definition at line 33 of file powerpak.h.

Field Documentation

◆ pm_func

void(* DPMI_callback::pm_func) (void)

Definition at line 34 of file powerpak.h.

◆ rm_addr

REALPTR DPMI_callback::rm_addr

Definition at line 36 of file powerpak.h.

◆ rm_regs

REAL_regs DPMI_callback::rm_regs

Definition at line 37 of file powerpak.h.

◆ wrapper

BYTE* DPMI_callback::wrapper

Definition at line 35 of file powerpak.h.


Watt-32 tcp/ip: DPMI_regs Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
DPMI_regs Struct Reference
Collaboration diagram for DPMI_regs:
[legend]

Data Fields

DWORD | r_di
DWORD | r_si
DWORD | r_bp
DWORD | reserved
DWORD | r_bx
DWORD | r_dx
DWORD | r_cx
DWORD | r_ax
WORD | r_flags
WORD | r_es
WORD | r_ds
WORD | r_fs
WORD | r_gs
WORD | r_ip
WORD | r_cs
WORD | r_sp
WORD | r_ss

Detailed Description

Definition at line 589 of file misc.h.

Field Documentation

◆ r_ax

DWORD DPMI_regs::r_ax

Definition at line 597 of file misc.h.

◆ r_bp

DWORD DPMI_regs::r_bp

Definition at line 592 of file misc.h.

◆ r_bx

DWORD DPMI_regs::r_bx

Definition at line 594 of file misc.h.

◆ r_cs

WORD DPMI_regs::r_cs

Definition at line 600 of file misc.h.

◆ r_cx

DWORD DPMI_regs::r_cx

Definition at line 596 of file misc.h.

◆ r_di

DWORD DPMI_regs::r_di

Definition at line 590 of file misc.h.

◆ r_ds

WORD DPMI_regs::r_ds

Definition at line 599 of file misc.h.

◆ r_dx

DWORD DPMI_regs::r_dx

Definition at line 595 of file misc.h.

◆ r_es

WORD DPMI_regs::r_es

Definition at line 599 of file misc.h.

◆ r_flags

WORD DPMI_regs::r_flags

Definition at line 598 of file misc.h.

◆ r_fs

WORD DPMI_regs::r_fs

Definition at line 599 of file misc.h.

◆ r_gs

WORD DPMI_regs::r_gs

Definition at line 599 of file misc.h.

◆ r_ip

WORD DPMI_regs::r_ip

Definition at line 600 of file misc.h.

◆ r_si

DWORD DPMI_regs::r_si

Definition at line 591 of file misc.h.

◆ r_sp

WORD DPMI_regs::r_sp

Definition at line 600 of file misc.h.

◆ r_ss

WORD DPMI_regs::r_ss

Definition at line 600 of file misc.h.

◆ reserved

DWORD DPMI_regs::reserved

Definition at line 593 of file misc.h.


Watt-32 tcp/ip: eflags Union Reference

  • Data Structure Index
  • Data Fields
Data Fields
eflags Union Reference
Collaboration diagram for eflags:
[legend]

Data Fields

unsigned int i

Detailed Description

Definition at line 129 of file register.h.

Field Documentation

◆ eflags

eflags_bits eflags::eflags

Definition at line 130 of file register.h.

◆ i

unsigned int eflags::i

Definition at line 131 of file register.h.


Watt-32 tcp/ip: eflags_bits Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
eflags_bits Struct Reference
Collaboration diagram for eflags_bits:
[legend]

Data Fields

unsigned int | carry: 1
unsigned | int: 1
unsigned int | parity: 1
unsigned int | auxiliary_carry: 1
unsigned int | zero: 1
unsigned int | sign: 1
unsigned int | trap: 1
unsigned int | intr_enable: 1
unsigned int | direction: 1
unsigned int | overflow: 1
unsigned int | IO_privilege: 2
unsigned int | nested_task: 1
unsigned int | resume: 1
unsigned int | virtual_mode: 1
unsigned int | aligment_check: 1
unsigned int | virtual_intr: 1
unsigned int | virtual_intr_pending: 1
unsigned int | id: 1

Detailed Description

Definition at line 89 of file register.h.

Field Documentation

◆ aligment_check

unsigned int eflags_bits::aligment_check

Definition at line 118 of file register.h.

◆ auxiliary_carry

unsigned int eflags_bits::auxiliary_carry

Definition at line 98 of file register.h.

◆ carry

unsigned int eflags_bits::carry

Definition at line 93 of file register.h.

◆ direction

unsigned int eflags_bits::direction

Definition at line 107 of file register.h.

◆ id

unsigned int eflags_bits::id

Definition at line 121 of file register.h.

◆ int

unsigned eflags_bits::int

Definition at line 94 of file register.h.

◆ intr_enable

unsigned int eflags_bits::intr_enable

Definition at line 106 of file register.h.

◆ IO_privilege

unsigned int eflags_bits::IO_privilege

Definition at line 110 of file register.h.

◆ nested_task

unsigned int eflags_bits::nested_task

Definition at line 111 of file register.h.

◆ overflow

unsigned int eflags_bits::overflow

Definition at line 108 of file register.h.

◆ parity

unsigned int eflags_bits::parity

Definition at line 95 of file register.h.

◆ resume

unsigned int eflags_bits::resume

Definition at line 116 of file register.h.

◆ sign

unsigned int eflags_bits::sign

Definition at line 101 of file register.h.

◆ trap

unsigned int eflags_bits::trap

Definition at line 105 of file register.h.

◆ virtual_intr

unsigned int eflags_bits::virtual_intr

Definition at line 119 of file register.h.

◆ virtual_intr_pending

unsigned int eflags_bits::virtual_intr_pending

Definition at line 120 of file register.h.

◆ virtual_mode

unsigned int eflags_bits::virtual_mode

Definition at line 117 of file register.h.

◆ zero

unsigned int eflags_bits::zero

Definition at line 100 of file register.h.


Watt-32 tcp/ip: Elem Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
Elem Struct Reference
Collaboration diagram for Elem:
[legend]

Data Fields

DWORD | crc
const char * | string

Detailed Description

Definition at line 842 of file lang.c.

Field Documentation

◆ crc

DWORD Elem::crc

Definition at line 843 of file lang.c.

◆ string

const char* Elem::string

Definition at line 844 of file lang.c.


Watt-32 tcp/ip: esp Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
esp Struct Reference
Collaboration diagram for esp:
[legend]

Data Fields

u_int32_t esp_spi

Detailed Description

Definition at line 44 of file esp.h.

Field Documentation

◆ esp_spi

u_int32_t esp::esp_spi

Definition at line 45 of file esp.h.


Watt-32 tcp/ip: esp_algorithm Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
esp_algorithm Struct Reference
Collaboration diagram for esp_algorithm:
[legend]

Data Fields

size_t | padbound
int | ivlenval
int(* | mature )(struct secasvar *)
int | keymin
int | keymax
int(* | schedlen )(const struct esp_algorithm *)
const char * | name
int(* | ivlen )(const struct esp_algorithm *, struct secasvar *)
int(* | decrypt )(struct mbuf *, size_t, struct secasvar *, const struct esp_algorithm *, int)
int(* | encrypt )(struct mbuf *, size_t, size_t, struct secasvar *, const struct esp_algorithm *, int)
int(* | schedule )(const struct esp_algorithm *, struct secasvar *)
int(* | blockdecrypt )(const struct esp_algorithm *, struct secasvar *, u_int8_t *, u_int8_t *)
int(* | blockencrypt )(const struct esp_algorithm *, struct secasvar *, u_int8_t *, u_int8_t *)

Detailed Description

Definition at line 76 of file esp.h.

Field Documentation

◆ blockdecrypt

int(* esp_algorithm::blockdecrypt) (const struct esp_algorithm *, struct secasvar *, u_int8_t *, u_int8_t *)

Definition at line 91 of file esp.h.

◆ blockencrypt

int(* esp_algorithm::blockencrypt) (const struct esp_algorithm *, struct secasvar *, u_int8_t *, u_int8_t *)

Definition at line 93 of file esp.h.

◆ decrypt

int(* esp_algorithm::decrypt) (struct mbuf *, size_t, struct secasvar *, const struct esp_algorithm *, int)

Definition at line 85 of file esp.h.

◆ encrypt

int(* esp_algorithm::encrypt) (struct mbuf *, size_t, size_t, struct secasvar *, const struct esp_algorithm *, int)

Definition at line 87 of file esp.h.

◆ ivlen

int(* esp_algorithm::ivlen) (const struct esp_algorithm *, struct secasvar *)

Definition at line 84 of file esp.h.

◆ ivlenval

int esp_algorithm::ivlenval

Definition at line 78 of file esp.h.

◆ keymax

int esp_algorithm::keymax

Definition at line 81 of file esp.h.

◆ keymin

int esp_algorithm::keymin

Definition at line 80 of file esp.h.

◆ mature

int(* esp_algorithm::mature) (struct secasvar *)

Definition at line 79 of file esp.h.

◆ name

const char* esp_algorithm::name

Definition at line 83 of file esp.h.

◆ padbound

size_t esp_algorithm::padbound

Definition at line 77 of file esp.h.

◆ schedlen

int(* esp_algorithm::schedlen) (const struct esp_algorithm *)

Definition at line 82 of file esp.h.

◆ schedule

int(* esp_algorithm::schedule) (const struct esp_algorithm *, struct secasvar *)

Definition at line 90 of file esp.h.


Watt-32 tcp/ip: esptail Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
esptail Struct Reference
Collaboration diagram for esptail:
[legend]

Data Fields

u_int8_t | esp_padlen
u_int8_t | esp_nxt

Detailed Description

Definition at line 66 of file esp.h.

Field Documentation

◆ esp_nxt

u_int8_t esptail::esp_nxt

Definition at line 68 of file esp.h.

◆ esp_padlen

u_int8_t esptail::esp_padlen

Definition at line 67 of file esp.h.


Watt-32 tcp/ip: eth_Header Struct Reference

  • Data Structure Index
  • Data Fields
eth_Header Struct Reference

#include <pcsed.h>

Detailed Description

The DIX Ethernet header.

Definition at line 24 of file pcsed.h.


Watt-32 tcp/ip: eth_Packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
eth_Packet Struct Reference

#include <pcsed.h>

Collaboration diagram for eth_Packet:
[legend]

Data Fields

eth_Header head
BYTE data [ETH_MAX_DATA]

Detailed Description

The Ethernet header with data.

Definition at line 38 of file pcsed.h.

Field Documentation

◆ data

BYTE eth_Packet::data[ETH_MAX_DATA]

Definition at line 40 of file pcsed.h.

◆ head

eth_Header eth_Packet::head

Definition at line 39 of file pcsed.h.


Watt-32 tcp/ip: ethent Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ethent Struct Reference
Collaboration diagram for ethent:
[legend]

Data Fields

eth_address | eth_addr
DWORD | ip_addr
char * | name
struct ethent * | next

Detailed Description

Definition at line 65 of file geteth.c.

Field Documentation

◆ eth_addr

eth_address ethent::eth_addr

Definition at line 66 of file geteth.c.

◆ ip_addr

DWORD ethent::ip_addr

Definition at line 67 of file geteth.c.

◆ name

char* ethent::name

Definition at line 68 of file geteth.c.

◆ next

struct ethent* ethent::next

Definition at line 69 of file geteth.c.


Watt-32 tcp/ip: ether_arp Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ether_arp Struct Reference
Collaboration diagram for ether_arp:
[legend]

Data Fields

struct arphdr | ea_hdr
u_char | arp_sha [6]
u_char | arp_spa [4]
u_char | arp_tha [6]
u_char | arp_tpa [4]

Detailed Description

Definition at line 120 of file if_ether.h.

Field Documentation

◆ arp_sha

u_char ether_arp::arp_sha[6]

Definition at line 122 of file if_ether.h.

◆ arp_spa

u_char ether_arp::arp_spa[4]

Definition at line 123 of file if_ether.h.

◆ arp_tha

u_char ether_arp::arp_tha[6]

Definition at line 124 of file if_ether.h.

◆ arp_tpa

u_char ether_arp::arp_tpa[4]

Definition at line 125 of file if_ether.h.

◆ ea_hdr

struct arphdr ether_arp::ea_hdr

Definition at line 121 of file if_ether.h.


Watt-32 tcp/ip: ether_header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ether_header Struct Reference
Collaboration diagram for ether_header:
[legend]

Data Fields

u_char | ether_dhost [6]
u_char | ether_shost [6]
u_short | ether_type

Detailed Description

Definition at line 71 of file if_ether.h.

Field Documentation

◆ ether_dhost

u_char ether_header::ether_dhost[6]

Definition at line 72 of file if_ether.h.

◆ ether_shost

u_char ether_header::ether_shost[6]

Definition at line 73 of file if_ether.h.

◆ ether_type

u_short ether_header::ether_type

Definition at line 74 of file if_ether.h.


Watt-32 tcp/ip: ether_multi Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ether_multi Struct Reference
Collaboration diagram for ether_multi:
[legend]

Data Fields

u_char | enm_addrlo [6]
u_char | enm_addrhi [6]
struct arpcom * | enm_ac
u_int | enm_refcount
struct ether_multi * | enm_next

Detailed Description

Definition at line 177 of file if_ether.h.

Field Documentation

◆ enm_ac

struct arpcom* ether_multi::enm_ac

Definition at line 180 of file if_ether.h.

◆ enm_addrhi

u_char ether_multi::enm_addrhi[6]

Definition at line 179 of file if_ether.h.

◆ enm_addrlo

u_char ether_multi::enm_addrlo[6]

Definition at line 178 of file if_ether.h.

◆ enm_next

struct ether_multi* ether_multi::enm_next

Definition at line 182 of file if_ether.h.

◆ enm_refcount

u_int ether_multi::enm_refcount

Definition at line 181 of file if_ether.h.


Watt-32 tcp/ip: ether_multistep Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ether_multistep Struct Reference
Collaboration diagram for ether_multistep:
[legend]

Data Fields

struct ether_multi * e_enm

Detailed Description

Definition at line 189 of file if_ether.h.

Field Documentation

◆ e_enm

struct ether_multi* ether_multistep::e_enm

Definition at line 190 of file if_ether.h.


Watt-32 tcp/ip: explore Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
explore Struct Reference
Collaboration diagram for explore:
[legend]

Data Fields

int | e_af
int | e_socktype
int | e_protocol
const char * | e_protostr
int | e_wild

Detailed Description

Definition at line 72 of file get_ai.c.

Field Documentation

◆ e_af

int explore::e_af

Definition at line 73 of file get_ai.c.

◆ e_protocol

int explore::e_protocol

Definition at line 75 of file get_ai.c.

◆ e_protostr

const char* explore::e_protostr

Definition at line 76 of file get_ai.c.

◆ e_socktype

int explore::e_socktype

Definition at line 74 of file get_ai.c.

◆ e_wild

int explore::e_wild

Definition at line 77 of file get_ai.c.


Watt-32 tcp/ip: FAULT_STRUC Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
FAULT_STRUC Struct Reference
Collaboration diagram for FAULT_STRUC:
[legend]

Data Fields

DWORD | ebp
DWORD | edi
DWORD | esi
DWORD | edx
DWORD | ecx
DWORD | ebx
DWORD | eax
WORD | gs
WORD | fs
WORD | es
WORD | ds
DWORD | eip
WORD | cs
WORD | reserved1
DWORD | eflags
DWORD | esp
WORD | ss
WORD | reserved2
WORD | tr
DWORD | cr0
DWORD | cr1
DWORD | cr2
DWORD | cr3
DWORD | csAddr
DWORD | dsAddr
DWORD | esAddr
DWORD | fsAddr
DWORD | gsAddr
DWORD | ssAddr
WORD | fault_num
DWORD | code
BOOL | mode

Detailed Description

Definition at line 15 of file wdpmi.h.

Field Documentation

◆ code

DWORD FAULT_STRUC::code

Definition at line 31 of file wdpmi.h.

◆ cr0

DWORD FAULT_STRUC::cr0

Definition at line 23 of file wdpmi.h.

◆ cr1

DWORD FAULT_STRUC::cr1

Definition at line 23 of file wdpmi.h.

◆ cr2

DWORD FAULT_STRUC::cr2

Definition at line 23 of file wdpmi.h.

◆ cr3

DWORD FAULT_STRUC::cr3

Definition at line 23 of file wdpmi.h.

◆ cs

WORD FAULT_STRUC::cs

Definition at line 19 of file wdpmi.h.

◆ csAddr

DWORD FAULT_STRUC::csAddr

Definition at line 24 of file wdpmi.h.

◆ ds

WORD FAULT_STRUC::ds

Definition at line 17 of file wdpmi.h.

◆ dsAddr

DWORD FAULT_STRUC::dsAddr

Definition at line 25 of file wdpmi.h.

◆ eax

DWORD FAULT_STRUC::eax

Definition at line 16 of file wdpmi.h.

◆ ebp

DWORD FAULT_STRUC::ebp

Definition at line 16 of file wdpmi.h.

◆ ebx

DWORD FAULT_STRUC::ebx

Definition at line 16 of file wdpmi.h.

◆ ecx

DWORD FAULT_STRUC::ecx

Definition at line 16 of file wdpmi.h.

◆ edi

DWORD FAULT_STRUC::edi

Definition at line 16 of file wdpmi.h.

◆ edx

DWORD FAULT_STRUC::edx

Definition at line 16 of file wdpmi.h.

◆ eflags

DWORD FAULT_STRUC::eflags

Definition at line 20 of file wdpmi.h.

◆ eip

DWORD FAULT_STRUC::eip

Definition at line 18 of file wdpmi.h.

◆ es

WORD FAULT_STRUC::es

Definition at line 17 of file wdpmi.h.

◆ esAddr

DWORD FAULT_STRUC::esAddr

Definition at line 26 of file wdpmi.h.

◆ esi

DWORD FAULT_STRUC::esi

Definition at line 16 of file wdpmi.h.

◆ esp

DWORD FAULT_STRUC::esp

Definition at line 20 of file wdpmi.h.

◆ fault_num

WORD FAULT_STRUC::fault_num

Definition at line 30 of file wdpmi.h.

◆ fs

WORD FAULT_STRUC::fs

Definition at line 17 of file wdpmi.h.

◆ fsAddr

DWORD FAULT_STRUC::fsAddr

Definition at line 27 of file wdpmi.h.

◆ gs

WORD FAULT_STRUC::gs

Definition at line 17 of file wdpmi.h.

◆ gsAddr

DWORD FAULT_STRUC::gsAddr

Definition at line 28 of file wdpmi.h.

◆ mode

BOOL FAULT_STRUC::mode

Definition at line 32 of file wdpmi.h.

◆ reserved1

WORD FAULT_STRUC::reserved1

Definition at line 19 of file wdpmi.h.

◆ reserved2

WORD FAULT_STRUC::reserved2

Definition at line 21 of file wdpmi.h.

◆ ss

WORD FAULT_STRUC::ss

Definition at line 21 of file wdpmi.h.

◆ ssAddr

DWORD FAULT_STRUC::ssAddr

Definition at line 29 of file wdpmi.h.

◆ tr

WORD FAULT_STRUC::tr

Definition at line 22 of file wdpmi.h.


Watt-32 tcp/ip: FCFILE Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
FCFILE Struct Reference
Collaboration diagram for FCFILE:
[legend]

Data Fields

int | fd
char | cache [32]
short | cache_pos
short | cache_max

Detailed Description

Definition at line 68 of file pcconfig.h.

Field Documentation

◆ cache

char FCFILE::cache[32]

Definition at line 70 of file pcconfig.h.

◆ cache_max

short FCFILE::cache_max

Definition at line 72 of file pcconfig.h.

◆ cache_pos

short FCFILE::cache_pos

Definition at line 71 of file pcconfig.h.

◆ fd

int FCFILE::fd

Definition at line 69 of file pcconfig.h.


Watt-32 tcp/ip: fd_set Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
fd_set Struct Reference
Collaboration diagram for fd_set:
[legend]

Data Fields

unsigned char fd_bits [(FD_SETSIZE+7)/8]

Detailed Description

Definition at line 256 of file wtypes.h.

Field Documentation

◆ fd_bits

unsigned char fd_set::fd_bits[(FD_SETSIZE+7)/8]

Definition at line 257 of file wtypes.h.


Watt-32 tcp/ip: fddi_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
fddi_Header Struct Reference

#include <pcsed.h>

Collaboration diagram for fddi_Header:
[legend]

Data Fields

BYTE | frameCtrl
eth_address | destination
eth_address | source
BYTE | DSAP
BYTE | SSAP
BYTE | ctrl
BYTE | org [3]
WORD | type

Detailed Description

The FDDI header.

Definition at line 149 of file pcsed.h.

Field Documentation

◆ ctrl

BYTE fddi_Header::ctrl

Definition at line 155 of file pcsed.h.

◆ destination

eth_address fddi_Header::destination

Definition at line 151 of file pcsed.h.

◆ DSAP

BYTE fddi_Header::DSAP

Definition at line 153 of file pcsed.h.

◆ frameCtrl

BYTE fddi_Header::frameCtrl

Definition at line 150 of file pcsed.h.

◆ org

BYTE fddi_Header::org[3]

Definition at line 156 of file pcsed.h.

◆ source

eth_address fddi_Header::source

Definition at line 152 of file pcsed.h.

◆ SSAP

BYTE fddi_Header::SSAP

Definition at line 154 of file pcsed.h.

◆ type

WORD fddi_Header::type

Definition at line 157 of file pcsed.h.


Watt-32 tcp/ip: fddi_Packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
fddi_Packet Struct Reference

#include <pcsed.h>

Collaboration diagram for fddi_Packet:
[legend]

Data Fields

fddi_Header head
BYTE data [FDDI_MAX_DATA]

Detailed Description

The FDDI header with data.

Definition at line 164 of file pcsed.h.

Field Documentation

◆ data

BYTE fddi_Packet::data[FDDI_MAX_DATA]

Definition at line 166 of file pcsed.h.

◆ head

fddi_Header fddi_Packet::head

Definition at line 165 of file pcsed.h.


Watt-32 tcp/ip: For Struct Reference

  • Data Structure Index
  • Data Fields
For Struct Reference

Detailed Description

etc.


Watt-32 tcp/ip: frag_bucket Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
frag_bucket Struct Reference
Collaboration diagram for frag_bucket:
[legend]

Data Fields

BOOL | used
BOOL | got_ofs0
int | active
used_map | map
mac_address | mac_src
struct frag_key | key
struct huge_ip * | ip

Detailed Description

Definition at line 110 of file ip4_frag.c.

Field Documentation

◆ active

int frag_bucket::active

Definition at line 113 of file ip4_frag.c.

◆ got_ofs0

BOOL frag_bucket::got_ofs0

Definition at line 112 of file ip4_frag.c.

◆ ip

struct huge_ip* frag_bucket::ip

Definition at line 117 of file ip4_frag.c.

◆ key

struct frag_key frag_bucket::key

Definition at line 116 of file ip4_frag.c.

◆ mac_src

mac_address frag_bucket::mac_src

Definition at line 115 of file ip4_frag.c.

◆ map

used_map frag_bucket::map

Definition at line 114 of file ip4_frag.c.

◆ used

BOOL frag_bucket::used

Definition at line 111 of file ip4_frag.c.


Watt-32 tcp/ip: frag_ctrl Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
frag_ctrl Struct Reference
Collaboration diagram for frag_ctrl:
[legend]

Data Fields

BOOL | used
DWORD | timer
struct hole * | hole_first
in_Header * ip
BYTE * | data_offset

Detailed Description

Definition at line 126 of file ip4_frag.c.

Field Documentation

◆ data_offset

BYTE* frag_ctrl::data_offset

Definition at line 131 of file ip4_frag.c.

◆ hole_first

struct hole* frag_ctrl::hole_first

Definition at line 129 of file ip4_frag.c.

◆ ip

in_Header* frag_ctrl::ip

Definition at line 130 of file ip4_frag.c.

◆ timer

DWORD frag_ctrl::timer

Definition at line 128 of file ip4_frag.c.

◆ used

BOOL frag_ctrl::used

Definition at line 127 of file ip4_frag.c.


Watt-32 tcp/ip: frag_key Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
frag_key Struct Reference
Collaboration diagram for frag_key:
[legend]

Data Fields

DWORD | source
DWORD | destin
WORD | ident
BYTE | proto

Detailed Description

Definition at line 103 of file ip4_frag.c.

Field Documentation

◆ destin

DWORD frag_key::destin

Definition at line 105 of file ip4_frag.c.

◆ ident

WORD frag_key::ident

Definition at line 106 of file ip4_frag.c.

◆ proto

BYTE frag_key::proto

Definition at line 107 of file ip4_frag.c.

◆ source

DWORD frag_key::source

Definition at line 104 of file ip4_frag.c.


Watt-32 tcp/ip: frmrinfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
frmrinfo Struct Reference
Collaboration diagram for frmrinfo:
[legend]

Data Fields

u_int8_t | frmr_rej_pdu0
u_int8_t | frmr_rej_pdu1
u_int8_t | frmr_control
u_int8_t | frmr_control_ext
u_int8_t | frmr_cause

Detailed Description

Definition at line 97 of file if_llc.h.

Field Documentation

◆ frmr_cause

u_int8_t frmrinfo::frmr_cause

Definition at line 102 of file if_llc.h.

◆ frmr_control

u_int8_t frmrinfo::frmr_control

Definition at line 100 of file if_llc.h.

◆ frmr_control_ext

u_int8_t frmrinfo::frmr_control_ext

Definition at line 101 of file if_llc.h.

◆ frmr_rej_pdu0

u_int8_t frmrinfo::frmr_rej_pdu0

Definition at line 98 of file if_llc.h.

◆ frmr_rej_pdu1

u_int8_t frmrinfo::frmr_rej_pdu1

Definition at line 99 of file if_llc.h.


Watt-32 tcp/ip: full_tcpiphdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
full_tcpiphdr Struct Reference
Collaboration diagram for full_tcpiphdr:
[legend]

Data Fields

struct ipovly | ti_i
struct tcphdr | ti_t
char | ti_o [TCP_MAXOLEN]

Detailed Description

Definition at line 60 of file tcpip.h.

Field Documentation

◆ ti_i

struct ipovly full_tcpiphdr::ti_i

Definition at line 61 of file tcpip.h.

◆ ti_o

char full_tcpiphdr::ti_o[TCP_MAXOLEN]

Definition at line 63 of file tcpip.h.

◆ ti_t

struct tcphdr full_tcpiphdr::ti_t

Definition at line 62 of file tcpip.h.


Watt-32 tcp/ip: gate_entry Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
gate_entry Struct Reference

#include <pcarp.h>

Collaboration diagram for gate_entry:
[legend]

Data Fields

DWORD | gate_ip
The IP address of gateway.
DWORD | subnet
The subnet mask of gateway.
DWORD | mask
The netmask fgor the above entry.
BOOL | is_dead
BOOL | echo_pending
DWORD | chk_timer

Detailed Description

Gateway table.

Todo:
Move the gateway/route stuff to route.c

Definition at line 11 of file pcarp.h.

Field Documentation

◆ chk_timer

DWORD gate_entry::chk_timer

Definition at line 17 of file pcarp.h.

◆ echo_pending

BOOL gate_entry::echo_pending

Definition at line 16 of file pcarp.h.

◆ gate_ip

DWORD gate_entry::gate_ip

The IP address of gateway.

Definition at line 12 of file pcarp.h.

◆ is_dead

BOOL gate_entry::is_dead

Definition at line 15 of file pcarp.h.

◆ mask

DWORD gate_entry::mask

The netmask fgor the above entry.

Definition at line 14 of file pcarp.h.

◆ subnet

DWORD gate_entry::subnet

The subnet mask of gateway.

Definition at line 13 of file pcarp.h.


Watt-32 tcp/ip: getcredres Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
getcredres Struct Reference
Collaboration diagram for getcredres:
[legend]

Data Fields

keystatus status
union {
unixcred cred
} getcredres_u

Detailed Description

Definition at line 73 of file key_prot.h.

Field Documentation

◆ cred

unixcred getcredres::cred

Definition at line 76 of file key_prot.h.

◆ status

keystatus getcredres::status

Definition at line 74 of file key_prot.h.


Watt-32 tcp/ip: gz_stream Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
gz_stream Struct Reference
Collaboration diagram for gz_stream:
[legend]

Data Fields

z_stream stream
int | z_err
int | z_eof
FILE * | file
Byte * | inbuf
Byte * | outbuf
uLong | crc
char * | msg
char * | path
int | transparent
char | mode
z_off_t | start
z_off_t | in
z_off_t | out
int | back
int | last

Detailed Description

Definition at line 55 of file zgzio.c.

Field Documentation

◆ back

int gz_stream::back

Definition at line 70 of file zgzio.c.

◆ crc

uLong gz_stream::crc

Definition at line 62 of file zgzio.c.

◆ file

FILE* gz_stream::file

Definition at line 59 of file zgzio.c.

◆ in

z_off_t gz_stream::in

Definition at line 68 of file zgzio.c.

◆ inbuf

Byte* gz_stream::inbuf

Definition at line 60 of file zgzio.c.

◆ last

int gz_stream::last

Definition at line 71 of file zgzio.c.

◆ mode

char gz_stream::mode

Definition at line 66 of file zgzio.c.

◆ msg

char* gz_stream::msg

Definition at line 63 of file zgzio.c.

◆ out

z_off_t gz_stream::out

Definition at line 69 of file zgzio.c.

◆ outbuf

Byte* gz_stream::outbuf

Definition at line 61 of file zgzio.c.

◆ path

char* gz_stream::path

Definition at line 64 of file zgzio.c.

◆ start

z_off_t gz_stream::start

Definition at line 67 of file zgzio.c.

◆ stream

z_stream gz_stream::stream

Definition at line 56 of file zgzio.c.

◆ transparent

int gz_stream::transparent

Definition at line 65 of file zgzio.c.

◆ z_eof

int gz_stream::z_eof

Definition at line 58 of file zgzio.c.

◆ z_err

int gz_stream::z_err

Definition at line 57 of file zgzio.c.


Watt-32 tcp/ip: HEADER Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
HEADER Struct Reference
Collaboration diagram for HEADER:
[legend]

Data Fields

unsigned | id:16
query identification number
unsigned | qr: 1
response flag
unsigned | opcode: 4
purpose of message
unsigned | aa: 1
authoritive answer
unsigned | tc: 1
truncated message
unsigned | rd: 1
recursion desired
unsigned | ra: 1
recursion available
unsigned | unused:1
unused bits (MBZ as of 4.9.3a3)
unsigned | ad: 1
authentic data from named
unsigned | cd: 1
checking disabled by resolver
unsigned | rcode:4
response code
unsigned | qdcount:16
number of question entries
unsigned | ancount:16
number of answer entries
unsigned | nscount:16
number of authority entries
unsigned | arcount:16
number of resource entries

Detailed Description

Definition at line 50 of file nameser_compat.h.

Field Documentation

◆ aa

unsigned HEADER::aa

authoritive answer

Definition at line 56 of file nameser_compat.h.

◆ ad

unsigned HEADER::ad

authentic data from named

Definition at line 62 of file nameser_compat.h.

◆ ancount

unsigned HEADER::ancount

number of answer entries

Definition at line 82 of file nameser_compat.h.

◆ arcount

unsigned HEADER::arcount

number of resource entries

Definition at line 84 of file nameser_compat.h.

◆ cd

unsigned HEADER::cd

checking disabled by resolver

Definition at line 63 of file nameser_compat.h.

◆ id

unsigned HEADER::id

query identification number

Definition at line 51 of file nameser_compat.h.

◆ nscount

unsigned HEADER::nscount

number of authority entries

Definition at line 83 of file nameser_compat.h.

◆ opcode

unsigned HEADER::opcode

purpose of message

Definition at line 55 of file nameser_compat.h.

◆ qdcount

unsigned HEADER::qdcount

number of question entries

Definition at line 81 of file nameser_compat.h.

◆ qr

unsigned HEADER::qr

response flag

Definition at line 54 of file nameser_compat.h.

◆ ra

unsigned HEADER::ra

recursion available

Definition at line 60 of file nameser_compat.h.

◆ rcode

unsigned HEADER::rcode

response code

Definition at line 64 of file nameser_compat.h.

◆ rd

unsigned HEADER::rd

recursion desired

Definition at line 58 of file nameser_compat.h.

◆ tc

unsigned HEADER::tc

truncated message

Definition at line 57 of file nameser_compat.h.

◆ unused

unsigned HEADER::unused

unused bits (MBZ as of 4.9.3a3)

Definition at line 61 of file nameser_compat.h.


Watt-32 tcp/ip: hole Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
hole Struct Reference
Collaboration diagram for hole:
[legend]

Data Fields

struct hole * | next
long | start
long | end

Detailed Description

Definition at line 120 of file ip4_frag.c.

Field Documentation

◆ end

long hole::end

Definition at line 123 of file ip4_frag.c.

◆ next

struct hole* hole::next

Definition at line 121 of file ip4_frag.c.

◆ start

long hole::start

Definition at line 122 of file ip4_frag.c.


Watt-32 tcp/ip: host_list Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
host_list Struct Reference
Collaboration diagram for host_list:
[legend]

Data Fields

DWORD | ip
eth_address | mac
BOOL | secure
DSA * | dsa
struct host_list * | next

Detailed Description

Definition at line 54 of file pcsarp.c.

Field Documentation

◆ dsa

DSA* host_list::dsa

Definition at line 58 of file pcsarp.c.

◆ ip

DWORD host_list::ip

Definition at line 55 of file pcsarp.c.

◆ mac

eth_address host_list::mac

Definition at line 56 of file pcsarp.c.

◆ next

struct host_list* host_list::next

Definition at line 59 of file pcsarp.c.

◆ secure

BOOL host_list::secure

Definition at line 57 of file pcsarp.c.


Watt-32 tcp/ip: hostent Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
hostent Struct Reference
Collaboration diagram for hostent:
[legend]

Data Fields

char * | h_name
char ** | h_aliases
int | h_addrtype
int | h_length
char ** | h_addr_list

Detailed Description

Definition at line 104 of file netdb.h.

Field Documentation

◆ h_addr_list

char** hostent::h_addr_list

Definition at line 109 of file netdb.h.

◆ h_addrtype

int hostent::h_addrtype

Definition at line 107 of file netdb.h.

◆ h_aliases

char** hostent::h_aliases

Definition at line 106 of file netdb.h.

◆ h_length

int hostent::h_length

Definition at line 108 of file netdb.h.

◆ h_name

char* hostent::h_name

Definition at line 105 of file netdb.h.


Watt-32 tcp/ip: huge_ip Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
huge_ip Struct Reference
Collaboration diagram for huge_ip:
[legend]

Data Fields

in_Header hdr
BYTE | data [MAX_FRAG_SIZE]
DWORD | marker

Detailed Description

Definition at line 97 of file ip4_frag.c.

Field Documentation

◆ data

BYTE huge_ip::data[MAX_FRAG_SIZE]

Definition at line 99 of file ip4_frag.c.

◆ hdr

in_Header huge_ip::hdr

Definition at line 98 of file ip4_frag.c.

◆ marker

DWORD huge_ip::marker

Definition at line 100 of file ip4_frag.c.


Watt-32 tcp/ip: icmp Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
icmp Struct Reference
Collaboration diagram for icmp:
[legend]

Data Fields

u_char | icmp_type
u_char | icmp_code
u_short | icmp_cksum
union {
u_char ih_pptr
struct in_addr ih_gwaddr
struct ih_idseq {
n_short icd_id
n_short icd_seq
} ih_idseq
u_int32_t ih_void
struct ih_pmtu {
n_short ipm_void
n_short ipm_nextmtu
} ih_pmtu
struct ih_rtradv {
u_char irt_num_addrs
u_char irt_wpa
u_int16_t irt_lifetime
} ih_rtradv
} icmp_hun
union {
struct id_ts {
n_time its_otime
n_time its_rtime
n_time its_ttime
} id_ts
struct id_ip {
struct ip idi_ip
} id_ip
struct icmp_ra_addr id_radv
u_long id_mask
char id_data [1]
} icmp_dun

Detailed Description

Definition at line 66 of file ip_icmp.h.

Field Documentation

◆ icd_id

n_short icmp::icd_id

Definition at line 74 of file ip_icmp.h.

◆ icd_seq

n_short icmp::icd_seq

Definition at line 75 of file ip_icmp.h.

◆ icmp_cksum

u_short icmp::icmp_cksum

Definition at line 69 of file ip_icmp.h.

◆ icmp_code

u_char icmp::icmp_code

Definition at line 68 of file ip_icmp.h.

◆ icmp_type

u_char icmp::icmp_type

Definition at line 67 of file ip_icmp.h.

◆ id_data

char icmp::id_data[1]

Definition at line 113 of file ip_icmp.h.

◆ id_mask

u_long icmp::id_mask

Definition at line 112 of file ip_icmp.h.

◆ id_radv

struct icmp_ra_addr icmp::id_radv

Definition at line 111 of file ip_icmp.h.

◆ idi_ip

struct ip icmp::idi_ip

Definition at line 108 of file ip_icmp.h.

◆ ih_gwaddr

struct in_addr icmp::ih_gwaddr

Definition at line 72 of file ip_icmp.h.

◆ ih_pptr

u_char icmp::ih_pptr

Definition at line 71 of file ip_icmp.h.

◆ ih_void

u_int32_t icmp::ih_void

Definition at line 77 of file ip_icmp.h.

◆ ipm_nextmtu

n_short icmp::ipm_nextmtu

Definition at line 82 of file ip_icmp.h.

◆ ipm_void

n_short icmp::ipm_void

Definition at line 81 of file ip_icmp.h.

◆ irt_lifetime

u_int16_t icmp::irt_lifetime

Definition at line 88 of file ip_icmp.h.

◆ irt_num_addrs

u_char icmp::irt_num_addrs

Definition at line 86 of file ip_icmp.h.

◆ irt_wpa

u_char icmp::irt_wpa

Definition at line 87 of file ip_icmp.h.

◆ its_otime

n_time icmp::its_otime

Definition at line 103 of file ip_icmp.h.

◆ its_rtime

n_time icmp::its_rtime

Definition at line 104 of file ip_icmp.h.

◆ its_ttime

n_time icmp::its_ttime

Definition at line 105 of file ip_icmp.h.


Watt-32 tcp/ip: icmp6_cache Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
icmp6_cache Struct Reference
Collaboration diagram for icmp6_cache:
[legend]

Data Fields

ip6_address | ip
eth_address | eth
WORD | flags
enum ND_cacheState | state
time_t | expiry

Detailed Description

Definition at line 135 of file pcicmp6.h.

Field Documentation

◆ eth

eth_address icmp6_cache::eth

Definition at line 137 of file pcicmp6.h.

◆ expiry

time_t icmp6_cache::expiry

Definition at line 140 of file pcicmp6.h.

◆ flags

WORD icmp6_cache::flags

Definition at line 138 of file pcicmp6.h.

◆ ip

ip6_address icmp6_cache::ip

Definition at line 136 of file pcicmp6.h.

◆ state

enum ND_cacheState icmp6_cache::state

Definition at line 139 of file pcicmp6.h.


Watt-32 tcp/ip: ICMP6_echo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP6_echo Struct Reference
Collaboration diagram for ICMP6_echo:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
WORD | identifier
WORD | sequence

Detailed Description

Definition at line 63 of file pcicmp6.h.

Field Documentation

◆ checksum

WORD ICMP6_echo::checksum

Definition at line 66 of file pcicmp6.h.

◆ code

BYTE ICMP6_echo::code

Definition at line 65 of file pcicmp6.h.

◆ identifier

WORD ICMP6_echo::identifier

Definition at line 67 of file pcicmp6.h.

◆ sequence

WORD ICMP6_echo::sequence

Definition at line 68 of file pcicmp6.h.

◆ type

BYTE ICMP6_echo::type

Definition at line 64 of file pcicmp6.h.


Watt-32 tcp/ip: icmp6_ifstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
icmp6_ifstat Struct Reference
Collaboration diagram for icmp6_ifstat:
[legend]

Data Fields

u_quad_t | ifs6_in_msg
u_quad_t | ifs6_in_error
u_quad_t | ifs6_in_dstunreach
u_quad_t | ifs6_in_adminprohib
u_quad_t | ifs6_in_timeexceed
u_quad_t | ifs6_in_paramprob
u_quad_t | ifs6_in_pkttoobig
u_quad_t | ifs6_in_echo
u_quad_t | ifs6_in_echoreply
u_quad_t | ifs6_in_routersolicit
u_quad_t | ifs6_in_routeradvert
u_quad_t | ifs6_in_neighborsolicit
u_quad_t | ifs6_in_neighboradvert
u_quad_t | ifs6_in_redirect
u_quad_t | ifs6_in_mldquery
u_quad_t | ifs6_in_mldreport
u_quad_t | ifs6_in_mlddone
u_quad_t | ifs6_out_msg
u_quad_t | ifs6_out_error
u_quad_t | ifs6_out_dstunreach
u_quad_t | ifs6_out_adminprohib
u_quad_t | ifs6_out_timeexceed
u_quad_t | ifs6_out_paramprob
u_quad_t | ifs6_out_pkttoobig
u_quad_t | ifs6_out_echo
u_quad_t | ifs6_out_echoreply
u_quad_t | ifs6_out_routersolicit
u_quad_t | ifs6_out_routeradvert
u_quad_t | ifs6_out_neighborsolicit
u_quad_t | ifs6_out_neighboradvert
u_quad_t | ifs6_out_redirect
u_quad_t | ifs6_out_mldquery
u_quad_t | ifs6_out_mldreport
u_quad_t | ifs6_out_mlddone

Detailed Description

Definition at line 152 of file in6_var.h.

Field Documentation

◆ ifs6_in_adminprohib

u_quad_t icmp6_ifstat::ifs6_in_adminprohib

Definition at line 163 of file in6_var.h.

◆ ifs6_in_dstunreach

u_quad_t icmp6_ifstat::ifs6_in_dstunreach

Definition at line 161 of file in6_var.h.

◆ ifs6_in_echo

u_quad_t icmp6_ifstat::ifs6_in_echo

Definition at line 171 of file in6_var.h.

◆ ifs6_in_echoreply

u_quad_t icmp6_ifstat::ifs6_in_echoreply

Definition at line 173 of file in6_var.h.

◆ ifs6_in_error

u_quad_t icmp6_ifstat::ifs6_in_error

Definition at line 159 of file in6_var.h.

◆ ifs6_in_mlddone

u_quad_t icmp6_ifstat::ifs6_in_mlddone

Definition at line 189 of file in6_var.h.

◆ ifs6_in_mldquery

u_quad_t icmp6_ifstat::ifs6_in_mldquery

Definition at line 185 of file in6_var.h.

◆ ifs6_in_mldreport

u_quad_t icmp6_ifstat::ifs6_in_mldreport

Definition at line 187 of file in6_var.h.

◆ ifs6_in_msg

u_quad_t icmp6_ifstat::ifs6_in_msg

Definition at line 157 of file in6_var.h.

◆ ifs6_in_neighboradvert

u_quad_t icmp6_ifstat::ifs6_in_neighboradvert

Definition at line 181 of file in6_var.h.

◆ ifs6_in_neighborsolicit

u_quad_t icmp6_ifstat::ifs6_in_neighborsolicit

Definition at line 179 of file in6_var.h.

◆ ifs6_in_paramprob

u_quad_t icmp6_ifstat::ifs6_in_paramprob

Definition at line 167 of file in6_var.h.

◆ ifs6_in_pkttoobig

u_quad_t icmp6_ifstat::ifs6_in_pkttoobig

Definition at line 169 of file in6_var.h.

◆ ifs6_in_redirect

u_quad_t icmp6_ifstat::ifs6_in_redirect

Definition at line 183 of file in6_var.h.

◆ ifs6_in_routeradvert

u_quad_t icmp6_ifstat::ifs6_in_routeradvert

Definition at line 177 of file in6_var.h.

◆ ifs6_in_routersolicit

u_quad_t icmp6_ifstat::ifs6_in_routersolicit

Definition at line 175 of file in6_var.h.

◆ ifs6_in_timeexceed

u_quad_t icmp6_ifstat::ifs6_in_timeexceed

Definition at line 165 of file in6_var.h.

◆ ifs6_out_adminprohib

u_quad_t icmp6_ifstat::ifs6_out_adminprohib

Definition at line 201 of file in6_var.h.

◆ ifs6_out_dstunreach

u_quad_t icmp6_ifstat::ifs6_out_dstunreach

Definition at line 199 of file in6_var.h.

◆ ifs6_out_echo

u_quad_t icmp6_ifstat::ifs6_out_echo

Definition at line 209 of file in6_var.h.

◆ ifs6_out_echoreply

u_quad_t icmp6_ifstat::ifs6_out_echoreply

Definition at line 211 of file in6_var.h.

◆ ifs6_out_error

u_quad_t icmp6_ifstat::ifs6_out_error

Definition at line 197 of file in6_var.h.

◆ ifs6_out_mlddone

u_quad_t icmp6_ifstat::ifs6_out_mlddone

Definition at line 227 of file in6_var.h.

◆ ifs6_out_mldquery

u_quad_t icmp6_ifstat::ifs6_out_mldquery

Definition at line 223 of file in6_var.h.

◆ ifs6_out_mldreport

u_quad_t icmp6_ifstat::ifs6_out_mldreport

Definition at line 225 of file in6_var.h.

◆ ifs6_out_msg

u_quad_t icmp6_ifstat::ifs6_out_msg

Definition at line 195 of file in6_var.h.

◆ ifs6_out_neighboradvert

u_quad_t icmp6_ifstat::ifs6_out_neighboradvert

Definition at line 219 of file in6_var.h.

◆ ifs6_out_neighborsolicit

u_quad_t icmp6_ifstat::ifs6_out_neighborsolicit

Definition at line 217 of file in6_var.h.

◆ ifs6_out_paramprob

u_quad_t icmp6_ifstat::ifs6_out_paramprob

Definition at line 205 of file in6_var.h.

◆ ifs6_out_pkttoobig

u_quad_t icmp6_ifstat::ifs6_out_pkttoobig

Definition at line 207 of file in6_var.h.

◆ ifs6_out_redirect

u_quad_t icmp6_ifstat::ifs6_out_redirect

Definition at line 221 of file in6_var.h.

◆ ifs6_out_routeradvert

u_quad_t icmp6_ifstat::ifs6_out_routeradvert

Definition at line 215 of file in6_var.h.

◆ ifs6_out_routersolicit

u_quad_t icmp6_ifstat::ifs6_out_routersolicit

Definition at line 213 of file in6_var.h.

◆ ifs6_out_timeexceed

u_quad_t icmp6_ifstat::ifs6_out_timeexceed

Definition at line 203 of file in6_var.h.


Watt-32 tcp/ip: ICMP6_MTU Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP6_MTU Struct Reference
Collaboration diagram for ICMP6_MTU:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
DWORD | MTU

Detailed Description

Definition at line 54 of file pcicmp6.h.

Field Documentation

◆ checksum

WORD ICMP6_MTU::checksum

Definition at line 57 of file pcicmp6.h.

◆ code

BYTE ICMP6_MTU::code

Definition at line 56 of file pcicmp6.h.

◆ MTU

DWORD ICMP6_MTU::MTU

Definition at line 58 of file pcicmp6.h.

◆ type

BYTE ICMP6_MTU::type

Definition at line 55 of file pcicmp6.h.


Watt-32 tcp/ip: icmp6_namelookup Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
icmp6_namelookup Struct Reference
Collaboration diagram for icmp6_namelookup:
[legend]

Data Fields

struct icmp6_hdr | icmp6_nl_hdr
u_int8_t | icmp6_nl_nonce [8]
int32_t | icmp6_nl_ttl
u_int8_t | icmp6_nl_len
u_int8_t | icmp6_nl_name [3]

Detailed Description

Definition at line 358 of file icmp6.h.

Field Documentation

◆ icmp6_nl_hdr

struct icmp6_hdr icmp6_namelookup::icmp6_nl_hdr

Definition at line 359 of file icmp6.h.

◆ icmp6_nl_len

u_int8_t icmp6_namelookup::icmp6_nl_len

Definition at line 363 of file icmp6.h.

◆ icmp6_nl_name

u_int8_t icmp6_namelookup::icmp6_nl_name[3]

Definition at line 364 of file icmp6.h.

◆ icmp6_nl_nonce

u_int8_t icmp6_namelookup::icmp6_nl_nonce[8]

Definition at line 360 of file icmp6.h.

◆ icmp6_nl_ttl

int32_t icmp6_namelookup::icmp6_nl_ttl

Definition at line 361 of file icmp6.h.


Watt-32 tcp/ip: ICMP6_nd_adv Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP6_nd_adv Struct Reference
Collaboration diagram for ICMP6_nd_adv:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
BYTE | reserved1: 5
BYTE | override: 1
BYTE | solicited: 1
BYTE | router: 1
BYTE | reserved2
WORD | reserved3
ip6_address | target

Detailed Description

Definition at line 73 of file pcicmp6.h.

Field Documentation

◆ checksum

WORD ICMP6_nd_adv::checksum

Definition at line 76 of file pcicmp6.h.

◆ code

BYTE ICMP6_nd_adv::code

Definition at line 75 of file pcicmp6.h.

◆ override

BYTE ICMP6_nd_adv::override

Definition at line 78 of file pcicmp6.h.

◆ reserved1

BYTE ICMP6_nd_adv::reserved1

Definition at line 77 of file pcicmp6.h.

◆ reserved2

BYTE ICMP6_nd_adv::reserved2

Definition at line 81 of file pcicmp6.h.

◆ reserved3

WORD ICMP6_nd_adv::reserved3

Definition at line 82 of file pcicmp6.h.

◆ router

BYTE ICMP6_nd_adv::router

Definition at line 80 of file pcicmp6.h.

◆ solicited

BYTE ICMP6_nd_adv::solicited

Definition at line 79 of file pcicmp6.h.

◆ target

ip6_address ICMP6_nd_adv::target

Definition at line 83 of file pcicmp6.h.

◆ type

BYTE ICMP6_nd_adv::type

Definition at line 74 of file pcicmp6.h.


Watt-32 tcp/ip: ICMP6_nd_ra Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP6_nd_ra Struct Reference
Collaboration diagram for ICMP6_nd_ra:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
BYTE | hop_limit
BYTE | reserved: 6
BYTE | other: 1
BYTE | managed: 1
WORD | lifetime

Detailed Description

Definition at line 88 of file pcicmp6.h.

Field Documentation

◆ checksum

WORD ICMP6_nd_ra::checksum

Definition at line 91 of file pcicmp6.h.

◆ code

BYTE ICMP6_nd_ra::code

Definition at line 90 of file pcicmp6.h.

◆ hop_limit

BYTE ICMP6_nd_ra::hop_limit

Definition at line 92 of file pcicmp6.h.

◆ lifetime

WORD ICMP6_nd_ra::lifetime

Definition at line 96 of file pcicmp6.h.

◆ managed

BYTE ICMP6_nd_ra::managed

Definition at line 95 of file pcicmp6.h.

◆ other

BYTE ICMP6_nd_ra::other

Definition at line 94 of file pcicmp6.h.

◆ reserved

BYTE ICMP6_nd_ra::reserved

Definition at line 93 of file pcicmp6.h.

◆ type

BYTE ICMP6_nd_ra::type

Definition at line 89 of file pcicmp6.h.


Watt-32 tcp/ip: ICMP6_nd_sol Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP6_nd_sol Struct Reference
Collaboration diagram for ICMP6_nd_sol:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
DWORD | reserved
ip6_address | target

Detailed Description

Definition at line 101 of file pcicmp6.h.

Field Documentation

◆ checksum

WORD ICMP6_nd_sol::checksum

Definition at line 104 of file pcicmp6.h.

◆ code

BYTE ICMP6_nd_sol::code

Definition at line 103 of file pcicmp6.h.

◆ reserved

DWORD ICMP6_nd_sol::reserved

Definition at line 105 of file pcicmp6.h.

◆ target

ip6_address ICMP6_nd_sol::target

Definition at line 106 of file pcicmp6.h.

◆ type

BYTE ICMP6_nd_sol::type

Definition at line 102 of file pcicmp6.h.


Watt-32 tcp/ip: icmp6_nodeinfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
icmp6_nodeinfo Struct Reference
Collaboration diagram for icmp6_nodeinfo:
[legend]

Data Fields

struct icmp6_hdr | icmp6_ni_hdr
u_int8_t | icmp6_ni_nonce [8]

Detailed Description

Definition at line 372 of file icmp6.h.

Field Documentation

◆ icmp6_ni_hdr

struct icmp6_hdr icmp6_nodeinfo::icmp6_ni_hdr

Definition at line 373 of file icmp6.h.

◆ icmp6_ni_nonce

u_int8_t icmp6_nodeinfo::icmp6_ni_nonce[8]

Definition at line 374 of file icmp6.h.


Watt-32 tcp/ip: ICMP6_PKT Union Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP6_PKT Union Reference
Collaboration diagram for ICMP6_PKT:
[legend]

Data Fields

struct ICMP6_unused | unused
struct ICMP6_route_sol | rsolic
struct ICMP6_route_adv | radvert
struct ICMP6_pointer | pointer
struct ICMP6_MTU | MTU
struct ICMP6_echo | echo
struct ICMP6_nd_adv | nd_adv
struct ICMP6_nd_ra | nd_ra
struct ICMP6_nd_sol | nd_solic

Detailed Description

Definition at line 111 of file pcicmp6.h.

Field Documentation

◆ echo

struct ICMP6_echo ICMP6_PKT::echo

Definition at line 117 of file pcicmp6.h.

◆ MTU

struct ICMP6_MTU ICMP6_PKT::MTU

Definition at line 116 of file pcicmp6.h.

◆ nd_adv

struct ICMP6_nd_adv ICMP6_PKT::nd_adv

Definition at line 118 of file pcicmp6.h.

◆ nd_ra

struct ICMP6_nd_ra ICMP6_PKT::nd_ra

Definition at line 119 of file pcicmp6.h.

◆ nd_solic

struct ICMP6_nd_sol ICMP6_PKT::nd_solic

Definition at line 120 of file pcicmp6.h.

◆ pointer

struct ICMP6_pointer ICMP6_PKT::pointer

Definition at line 115 of file pcicmp6.h.

◆ radvert

struct ICMP6_route_adv ICMP6_PKT::radvert

Definition at line 114 of file pcicmp6.h.

◆ rsolic

struct ICMP6_route_sol ICMP6_PKT::rsolic

Definition at line 113 of file pcicmp6.h.

◆ unused

struct ICMP6_unused ICMP6_PKT::unused

Definition at line 112 of file pcicmp6.h.


Watt-32 tcp/ip: ICMP6_pointer Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP6_pointer Struct Reference
Collaboration diagram for ICMP6_pointer:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
DWORD | pointer

Detailed Description

Definition at line 45 of file pcicmp6.h.

Field Documentation

◆ checksum

WORD ICMP6_pointer::checksum

Definition at line 48 of file pcicmp6.h.

◆ code

BYTE ICMP6_pointer::code

Definition at line 47 of file pcicmp6.h.

◆ pointer

DWORD ICMP6_pointer::pointer

Definition at line 49 of file pcicmp6.h.

◆ type

BYTE ICMP6_pointer::type

Definition at line 46 of file pcicmp6.h.


Watt-32 tcp/ip: ICMP6_route_adv Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP6_route_adv Struct Reference
Collaboration diagram for ICMP6_route_adv:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
BYTE | hop_limit
BYTE | reserved: 6
BYTE | other: 1
BYTE | managed: 1
WORD | lifetime
DWORD | reach_time
DWORD | retrans_time

Detailed Description

Definition at line 30 of file pcicmp6.h.

Field Documentation

◆ checksum

WORD ICMP6_route_adv::checksum

Definition at line 33 of file pcicmp6.h.

◆ code

BYTE ICMP6_route_adv::code

Definition at line 32 of file pcicmp6.h.

◆ hop_limit

BYTE ICMP6_route_adv::hop_limit

Definition at line 34 of file pcicmp6.h.

◆ lifetime

WORD ICMP6_route_adv::lifetime

Definition at line 38 of file pcicmp6.h.

◆ managed

BYTE ICMP6_route_adv::managed

Definition at line 37 of file pcicmp6.h.

◆ other

BYTE ICMP6_route_adv::other

Definition at line 36 of file pcicmp6.h.

◆ reach_time

DWORD ICMP6_route_adv::reach_time

Definition at line 39 of file pcicmp6.h.

◆ reserved

BYTE ICMP6_route_adv::reserved

Definition at line 35 of file pcicmp6.h.

◆ retrans_time

DWORD ICMP6_route_adv::retrans_time

Definition at line 40 of file pcicmp6.h.

◆ type

BYTE ICMP6_route_adv::type

Definition at line 31 of file pcicmp6.h.


Watt-32 tcp/ip: ICMP6_route_sol Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP6_route_sol Struct Reference
Collaboration diagram for ICMP6_route_sol:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
DWORD | reserved

Detailed Description

Definition at line 21 of file pcicmp6.h.

Field Documentation

◆ checksum

WORD ICMP6_route_sol::checksum

Definition at line 24 of file pcicmp6.h.

◆ code

BYTE ICMP6_route_sol::code

Definition at line 23 of file pcicmp6.h.

◆ reserved

DWORD ICMP6_route_sol::reserved

Definition at line 25 of file pcicmp6.h.

◆ type

BYTE ICMP6_route_sol::type

Definition at line 22 of file pcicmp6.h.


Watt-32 tcp/ip: icmp6_router_renum Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
icmp6_router_renum Struct Reference
Collaboration diagram for icmp6_router_renum:
[legend]

Data Fields

struct icmp6_hdr | rr_hdr
u_int8_t | rr_segnum
u_int8_t | rr_flags
u_int16_t | rr_maxdelay
u_int32_t | rr_reserved

Detailed Description

Definition at line 444 of file icmp6.h.

Field Documentation

◆ rr_flags

u_int8_t icmp6_router_renum::rr_flags

Definition at line 447 of file icmp6.h.

◆ rr_hdr

struct icmp6_hdr icmp6_router_renum::rr_hdr

Definition at line 445 of file icmp6.h.

◆ rr_maxdelay

u_int16_t icmp6_router_renum::rr_maxdelay

Definition at line 448 of file icmp6.h.

◆ rr_reserved

u_int32_t icmp6_router_renum::rr_reserved

Definition at line 449 of file icmp6.h.

◆ rr_segnum

u_int8_t icmp6_router_renum::rr_segnum

Definition at line 446 of file icmp6.h.


Watt-32 tcp/ip: ICMP6_unused Struct Reference

  • Data Structure Index
  • Data Fields
ICMP6_unused Struct Reference

Detailed Description

Definition at line 10 of file pcicmp6.h.


Watt-32 tcp/ip: icmp6errstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
icmp6errstat Struct Reference
Collaboration diagram for icmp6errstat:
[legend]

Data Fields

u_quad_t | icp6errs_dst_unreach_noroute
u_quad_t | icp6errs_dst_unreach_admin
u_quad_t | icp6errs_dst_unreach_beyondscope
u_quad_t | icp6errs_dst_unreach_addr
u_quad_t | icp6errs_dst_unreach_noport
u_quad_t | icp6errs_packet_too_big
u_quad_t | icp6errs_time_exceed_transit
u_quad_t | icp6errs_time_exceed_reassembly
u_quad_t | icp6errs_paramprob_header
u_quad_t | icp6errs_paramprob_nextheader
u_quad_t | icp6errs_paramprob_option
u_quad_t | icp6errs_redirect
u_quad_t | icp6errs_unknown

Detailed Description

Definition at line 547 of file icmp6.h.

Field Documentation

◆ icp6errs_dst_unreach_addr

u_quad_t icmp6errstat::icp6errs_dst_unreach_addr

Definition at line 551 of file icmp6.h.

◆ icp6errs_dst_unreach_admin

u_quad_t icmp6errstat::icp6errs_dst_unreach_admin

Definition at line 549 of file icmp6.h.

◆ icp6errs_dst_unreach_beyondscope

u_quad_t icmp6errstat::icp6errs_dst_unreach_beyondscope

Definition at line 550 of file icmp6.h.

◆ icp6errs_dst_unreach_noport

u_quad_t icmp6errstat::icp6errs_dst_unreach_noport

Definition at line 552 of file icmp6.h.

◆ icp6errs_dst_unreach_noroute

u_quad_t icmp6errstat::icp6errs_dst_unreach_noroute

Definition at line 548 of file icmp6.h.

◆ icp6errs_packet_too_big

u_quad_t icmp6errstat::icp6errs_packet_too_big

Definition at line 553 of file icmp6.h.

◆ icp6errs_paramprob_header

u_quad_t icmp6errstat::icp6errs_paramprob_header

Definition at line 556 of file icmp6.h.

◆ icp6errs_paramprob_nextheader

u_quad_t icmp6errstat::icp6errs_paramprob_nextheader

Definition at line 557 of file icmp6.h.

◆ icp6errs_paramprob_option

u_quad_t icmp6errstat::icp6errs_paramprob_option

Definition at line 558 of file icmp6.h.

◆ icp6errs_redirect

u_quad_t icmp6errstat::icp6errs_redirect

Definition at line 559 of file icmp6.h.

◆ icp6errs_time_exceed_reassembly

u_quad_t icmp6errstat::icp6errs_time_exceed_reassembly

Definition at line 555 of file icmp6.h.

◆ icp6errs_time_exceed_transit

u_quad_t icmp6errstat::icp6errs_time_exceed_transit

Definition at line 554 of file icmp6.h.

◆ icp6errs_unknown

u_quad_t icmp6errstat::icp6errs_unknown

Definition at line 560 of file icmp6.h.


Watt-32 tcp/ip: icmp6stat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
icmp6stat Struct Reference
Collaboration diagram for icmp6stat:
[legend]

Data Fields

u_quad_t | icp6s_error
u_quad_t | icp6s_canterror
u_quad_t | icp6s_toofreq
u_quad_t | icp6s_outhist [256]
u_quad_t | icp6s_badcode
u_quad_t | icp6s_tooshort
u_quad_t | icp6s_checksum
u_quad_t | icp6s_badlen
u_quad_t | icp6s_reflect
u_quad_t | icp6s_inhist [256]
u_quad_t | icp6s_nd_toomanyopt
struct icmp6errstat | icp6s_outerrhist
u_quad_t | icp6s_pmtuchg
u_quad_t | icp6s_nd_badopt
u_quad_t | icp6s_badns
u_quad_t | icp6s_badna
u_quad_t | icp6s_badrs
u_quad_t | icp6s_badra
u_quad_t | icp6s_badredirect

Detailed Description

Definition at line 563 of file icmp6.h.

Field Documentation

◆ icp6s_badcode

u_quad_t icmp6stat::icp6s_badcode

Definition at line 571 of file icmp6.h.

◆ icp6s_badlen

u_quad_t icmp6stat::icp6s_badlen

Definition at line 574 of file icmp6.h.

◆ icp6s_badna

u_quad_t icmp6stat::icp6s_badna

Definition at line 604 of file icmp6.h.

◆ icp6s_badns

u_quad_t icmp6stat::icp6s_badns

Definition at line 603 of file icmp6.h.

◆ icp6s_badra

u_quad_t icmp6stat::icp6s_badra

Definition at line 606 of file icmp6.h.

◆ icp6s_badredirect

u_quad_t icmp6stat::icp6s_badredirect

Definition at line 607 of file icmp6.h.

◆ icp6s_badrs

u_quad_t icmp6stat::icp6s_badrs

Definition at line 605 of file icmp6.h.

◆ icp6s_canterror

u_quad_t icmp6stat::icp6s_canterror

Definition at line 566 of file icmp6.h.

◆ icp6s_checksum

u_quad_t icmp6stat::icp6s_checksum

Definition at line 573 of file icmp6.h.

◆ icp6s_error

u_quad_t icmp6stat::icp6s_error

Definition at line 565 of file icmp6.h.

◆ icp6s_inhist

u_quad_t icmp6stat::icp6s_inhist[256]

Definition at line 580 of file icmp6.h.

◆ icp6s_nd_badopt

u_quad_t icmp6stat::icp6s_nd_badopt

Definition at line 602 of file icmp6.h.

◆ icp6s_nd_toomanyopt

u_quad_t icmp6stat::icp6s_nd_toomanyopt

Definition at line 581 of file icmp6.h.

◆ icp6s_outerrhist

struct icmp6errstat icmp6stat::icp6s_outerrhist

Definition at line 582 of file icmp6.h.

◆ icp6s_outhist

u_quad_t icmp6stat::icp6s_outhist[256]

Definition at line 568 of file icmp6.h.

◆ icp6s_pmtuchg

u_quad_t icmp6stat::icp6s_pmtuchg

Definition at line 601 of file icmp6.h.

◆ icp6s_reflect

u_quad_t icmp6stat::icp6s_reflect

Definition at line 579 of file icmp6.h.

◆ icp6s_toofreq

u_quad_t icmp6stat::icp6s_toofreq

Definition at line 567 of file icmp6.h.

◆ icp6s_tooshort

u_quad_t icmp6stat::icp6s_tooshort

Definition at line 572 of file icmp6.h.


Watt-32 tcp/ip: ICMP_addr_mask Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP_addr_mask Struct Reference
Collaboration diagram for ICMP_addr_mask:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
WORD | identifier
WORD | sequence
DWORD | mask

Detailed Description

Definition at line 89 of file pcicmp.h.

Field Documentation

◆ checksum

WORD ICMP_addr_mask::checksum

Definition at line 92 of file pcicmp.h.

◆ code

BYTE ICMP_addr_mask::code

Definition at line 91 of file pcicmp.h.

◆ identifier

WORD ICMP_addr_mask::identifier

Definition at line 93 of file pcicmp.h.

◆ mask

DWORD ICMP_addr_mask::mask

Definition at line 95 of file pcicmp.h.

◆ sequence

WORD ICMP_addr_mask::sequence

Definition at line 94 of file pcicmp.h.

◆ type

BYTE ICMP_addr_mask::type

Definition at line 90 of file pcicmp.h.


Watt-32 tcp/ip: ICMP_echo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP_echo Struct Reference
Collaboration diagram for ICMP_echo:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
WORD | identifier
WORD | sequence
DWORD | index

Detailed Description

Definition at line 55 of file pcicmp.h.

Field Documentation

◆ checksum

WORD ICMP_echo::checksum

Definition at line 58 of file pcicmp.h.

◆ code

BYTE ICMP_echo::code

Definition at line 57 of file pcicmp.h.

◆ identifier

WORD ICMP_echo::identifier

Definition at line 59 of file pcicmp.h.

◆ index

DWORD ICMP_echo::index

Definition at line 61 of file pcicmp.h.

◆ sequence

WORD ICMP_echo::sequence

Definition at line 60 of file pcicmp.h.

◆ type

BYTE ICMP_echo::type

Definition at line 56 of file pcicmp.h.


Watt-32 tcp/ip: ICMP_info Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP_info Struct Reference
Collaboration diagram for ICMP_info:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
WORD | identifier
WORD | sequence

Detailed Description

Definition at line 79 of file pcicmp.h.

Field Documentation

◆ checksum

WORD ICMP_info::checksum

Definition at line 82 of file pcicmp.h.

◆ code

BYTE ICMP_info::code

Definition at line 81 of file pcicmp.h.

◆ identifier

WORD ICMP_info::identifier

Definition at line 83 of file pcicmp.h.

◆ sequence

WORD ICMP_info::sequence

Definition at line 84 of file pcicmp.h.

◆ type

BYTE ICMP_info::type

Definition at line 80 of file pcicmp.h.


Watt-32 tcp/ip: ICMP_ip Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP_ip Struct Reference
Collaboration diagram for ICMP_ip:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
DWORD | ipaddr
in_Header ip

Detailed Description

Definition at line 45 of file pcicmp.h.

Field Documentation

◆ checksum

WORD ICMP_ip::checksum

Definition at line 48 of file pcicmp.h.

◆ code

BYTE ICMP_ip::code

Definition at line 47 of file pcicmp.h.

◆ ip

in_Header ICMP_ip::ip

Definition at line 50 of file pcicmp.h.

◆ ipaddr

DWORD ICMP_ip::ipaddr

Definition at line 49 of file pcicmp.h.

◆ type

BYTE ICMP_ip::type

Definition at line 46 of file pcicmp.h.


Watt-32 tcp/ip: ICMP_needfrag Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP_needfrag Struct Reference

#include <pcicmp.h>

Collaboration diagram for ICMP_needfrag:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
WORD | unused
WORD | next_mtu

Detailed Description

RFC-1191 (for type ICMP_UNREACH, code ICMP_UNREACH_NEEDFRAG)

Definition at line 116 of file pcicmp.h.

Field Documentation

◆ checksum

WORD ICMP_needfrag::checksum

Definition at line 119 of file pcicmp.h.

◆ code

BYTE ICMP_needfrag::code

Definition at line 118 of file pcicmp.h.

◆ next_mtu

WORD ICMP_needfrag::next_mtu

Definition at line 121 of file pcicmp.h.

◆ type

BYTE ICMP_needfrag::type

Definition at line 117 of file pcicmp.h.

◆ unused

WORD ICMP_needfrag::unused

Definition at line 120 of file pcicmp.h.


Watt-32 tcp/ip: ICMP_PKT Union Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP_PKT Union Reference
Collaboration diagram for ICMP_PKT:
[legend]

Data Fields

struct ICMP_unused | unused
struct ICMP_pointer | pointer
struct ICMP_ip | ip
struct ICMP_echo | echo
struct ICMP_timestamp | timestamp
struct ICMP_info | info
struct ICMP_addr_mask | mask
struct ICMP_traceroute | tracert
struct ICMP_needfrag | needfrag

Detailed Description

Definition at line 126 of file pcicmp.h.

Field Documentation

◆ echo

struct ICMP_echo ICMP_PKT::echo

Definition at line 130 of file pcicmp.h.

◆ info

struct ICMP_info ICMP_PKT::info

Definition at line 132 of file pcicmp.h.

◆ ip

struct ICMP_ip ICMP_PKT::ip

Definition at line 129 of file pcicmp.h.

◆ mask

struct ICMP_addr_mask ICMP_PKT::mask

Definition at line 133 of file pcicmp.h.

◆ needfrag

struct ICMP_needfrag ICMP_PKT::needfrag

Definition at line 135 of file pcicmp.h.

◆ pointer

struct ICMP_pointer ICMP_PKT::pointer

Definition at line 128 of file pcicmp.h.

◆ timestamp

struct ICMP_timestamp ICMP_PKT::timestamp

Definition at line 131 of file pcicmp.h.

◆ tracert

struct ICMP_traceroute ICMP_PKT::tracert

Definition at line 134 of file pcicmp.h.

◆ unused

struct ICMP_unused ICMP_PKT::unused

Definition at line 127 of file pcicmp.h.


Watt-32 tcp/ip: ICMP_pointer Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP_pointer Struct Reference
Collaboration diagram for ICMP_pointer:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
BYTE | pointer
BYTE | unused [3]
in_Header ip

Detailed Description

Definition at line 33 of file pcicmp.h.

Field Documentation

◆ checksum

WORD ICMP_pointer::checksum

Definition at line 36 of file pcicmp.h.

◆ code

BYTE ICMP_pointer::code

Definition at line 35 of file pcicmp.h.

◆ ip

in_Header ICMP_pointer::ip

Definition at line 39 of file pcicmp.h.

◆ pointer

BYTE ICMP_pointer::pointer

Definition at line 37 of file pcicmp.h.

◆ type

BYTE ICMP_pointer::type

Definition at line 34 of file pcicmp.h.

◆ unused

BYTE ICMP_pointer::unused[3]

Definition at line 38 of file pcicmp.h.


Watt-32 tcp/ip: ICMP_timestamp Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP_timestamp Struct Reference
Collaboration diagram for ICMP_timestamp:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
WORD | identifier
WORD | sequence
DWORD | original
DWORD | receive
DWORD | transmit

Detailed Description

Definition at line 66 of file pcicmp.h.

Field Documentation

◆ checksum

WORD ICMP_timestamp::checksum

Definition at line 69 of file pcicmp.h.

◆ code

BYTE ICMP_timestamp::code

Definition at line 68 of file pcicmp.h.

◆ identifier

WORD ICMP_timestamp::identifier

Definition at line 70 of file pcicmp.h.

◆ original

DWORD ICMP_timestamp::original

Definition at line 72 of file pcicmp.h.

◆ receive

DWORD ICMP_timestamp::receive

Definition at line 73 of file pcicmp.h.

◆ sequence

WORD ICMP_timestamp::sequence

Definition at line 71 of file pcicmp.h.

◆ transmit

DWORD ICMP_timestamp::transmit

Definition at line 74 of file pcicmp.h.

◆ type

BYTE ICMP_timestamp::type

Definition at line 67 of file pcicmp.h.


Watt-32 tcp/ip: ICMP_traceroute Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ICMP_traceroute Struct Reference
Collaboration diagram for ICMP_traceroute:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
WORD | identifier
WORD | unused
WORD | outbound_hop
WORD | return_hop
DWORD | link_speed
DWORD | link_mtu

Detailed Description

Definition at line 100 of file pcicmp.h.

Field Documentation

◆ checksum

WORD ICMP_traceroute::checksum

Definition at line 103 of file pcicmp.h.

◆ code

BYTE ICMP_traceroute::code

Definition at line 102 of file pcicmp.h.

◆ identifier

WORD ICMP_traceroute::identifier

Definition at line 104 of file pcicmp.h.

◆ link_mtu

DWORD ICMP_traceroute::link_mtu

Definition at line 109 of file pcicmp.h.

◆ link_speed

DWORD ICMP_traceroute::link_speed

Definition at line 108 of file pcicmp.h.

◆ outbound_hop

WORD ICMP_traceroute::outbound_hop

Definition at line 106 of file pcicmp.h.

◆ return_hop

WORD ICMP_traceroute::return_hop

Definition at line 107 of file pcicmp.h.

◆ type

BYTE ICMP_traceroute::type

Definition at line 101 of file pcicmp.h.

◆ unused

WORD ICMP_traceroute::unused

Definition at line 105 of file pcicmp.h.


Watt-32 tcp/ip: ICMP_unused Struct Reference

  • Data Structure Index
  • Data Fields
ICMP_unused Struct Reference

#include <pcicmp.h>

Detailed Description

For ICMP_TIMXCEED etc.

Definition at line 19 of file pcicmp.h.


Watt-32 tcp/ip: icmpstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
icmpstat Struct Reference
Collaboration diagram for icmpstat:
[legend]

Data Fields

u_long | icps_error
u_long | icps_oldshort
u_long | icps_oldicmp
u_long | icps_outhist [ICMP_MAXTYPE+1]
u_long | icps_badcode
u_long | icps_tooshort
u_long | icps_checksum
u_long | icps_badlen
u_long | icps_reflect
u_long | icps_inhist [ICMP_MAXTYPE+1]
u_long | icps_bmcastecho
u_long | icps_bmcasttstamp
u_long | icps_badaddr
u_long | icps_noroute

Detailed Description

Definition at line 51 of file icmp_var.h.

Field Documentation

◆ icps_badaddr

u_long icmpstat::icps_badaddr

Definition at line 66 of file icmp_var.h.

◆ icps_badcode

u_long icmpstat::icps_badcode

Definition at line 58 of file icmp_var.h.

◆ icps_badlen

u_long icmpstat::icps_badlen

Definition at line 61 of file icmp_var.h.

◆ icps_bmcastecho

u_long icmpstat::icps_bmcastecho

Definition at line 64 of file icmp_var.h.

◆ icps_bmcasttstamp

u_long icmpstat::icps_bmcasttstamp

Definition at line 65 of file icmp_var.h.

◆ icps_checksum

u_long icmpstat::icps_checksum

Definition at line 60 of file icmp_var.h.

◆ icps_error

u_long icmpstat::icps_error

Definition at line 53 of file icmp_var.h.

◆ icps_inhist

u_long icmpstat::icps_inhist[ICMP_MAXTYPE+1]

Definition at line 63 of file icmp_var.h.

◆ icps_noroute

u_long icmpstat::icps_noroute

Definition at line 67 of file icmp_var.h.

◆ icps_oldicmp

u_long icmpstat::icps_oldicmp

Definition at line 55 of file icmp_var.h.

◆ icps_oldshort

u_long icmpstat::icps_oldshort

Definition at line 54 of file icmp_var.h.

◆ icps_outhist

u_long icmpstat::icps_outhist[ICMP_MAXTYPE+1]

Definition at line 56 of file icmp_var.h.

◆ icps_reflect

u_long icmpstat::icps_reflect

Definition at line 62 of file icmp_var.h.

◆ icps_tooshort

u_long icmpstat::icps_tooshort

Definition at line 59 of file icmp_var.h.


Watt-32 tcp/ip: iconv_table Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
iconv_table Struct Reference
Collaboration diagram for iconv_table:
[legend]

Data Fields

const char * | name
WORD | codepage
toUnicode | mbtowc
toAscii | wctomb

Detailed Description

Definition at line 84 of file idna.c.

Field Documentation

◆ codepage

WORD iconv_table::codepage

Definition at line 86 of file idna.c.

◆ mbtowc

toUnicode iconv_table::mbtowc

Definition at line 87 of file idna.c.

◆ name

const char* iconv_table::name

Definition at line 85 of file idna.c.

◆ wctomb

toAscii iconv_table::wctomb

Definition at line 88 of file idna.c.


Watt-32 tcp/ip: if_data Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
if_data Struct Reference
Collaboration diagram for if_data:
[legend]

Data Fields

u_char | ifi_type
u_char | ifi_addrlen
u_char | ifi_hdrlen
u_long | ifi_mtu
u_long | ifi_metric
u_long | ifi_baudrate
u_long | ifi_ipackets
u_long | ifi_ierrors
u_long | ifi_opackets
u_long | ifi_oerrors
u_long | ifi_collisions
u_long | ifi_ibytes
u_long | ifi_obytes
u_long | ifi_imcasts
u_long | ifi_omcasts
u_long | ifi_iqdrops
u_long | ifi_noproto
struct timeval | ifi_lastchange

Detailed Description

Definition at line 88 of file if.h.

Field Documentation

◆ ifi_addrlen

u_char if_data::ifi_addrlen

Definition at line 91 of file if.h.

◆ ifi_baudrate

u_long if_data::ifi_baudrate

Definition at line 95 of file if.h.

◆ ifi_collisions

u_long if_data::ifi_collisions

Definition at line 101 of file if.h.

◆ ifi_hdrlen

u_char if_data::ifi_hdrlen

Definition at line 92 of file if.h.

◆ ifi_ibytes

u_long if_data::ifi_ibytes

Definition at line 102 of file if.h.

◆ ifi_ierrors

u_long if_data::ifi_ierrors

Definition at line 98 of file if.h.

◆ ifi_imcasts

u_long if_data::ifi_imcasts

Definition at line 104 of file if.h.

◆ ifi_ipackets

u_long if_data::ifi_ipackets

Definition at line 97 of file if.h.

◆ ifi_iqdrops

u_long if_data::ifi_iqdrops

Definition at line 106 of file if.h.

◆ ifi_lastchange

struct timeval if_data::ifi_lastchange

Definition at line 108 of file if.h.

◆ ifi_metric

u_long if_data::ifi_metric

Definition at line 94 of file if.h.

◆ ifi_mtu

u_long if_data::ifi_mtu

Definition at line 93 of file if.h.

◆ ifi_noproto

u_long if_data::ifi_noproto

Definition at line 107 of file if.h.

◆ ifi_obytes

u_long if_data::ifi_obytes

Definition at line 103 of file if.h.

◆ ifi_oerrors

u_long if_data::ifi_oerrors

Definition at line 100 of file if.h.

◆ ifi_omcasts

u_long if_data::ifi_omcasts

Definition at line 105 of file if.h.

◆ ifi_opackets

u_long if_data::ifi_opackets

Definition at line 99 of file if.h.

◆ ifi_type

u_char if_data::ifi_type

Definition at line 90 of file if.h.


Watt-32 tcp/ip: if_msghdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
if_msghdr Struct Reference
Collaboration diagram for if_msghdr:
[legend]

Data Fields

u_short | ifm_msglen
u_char | ifm_version
u_char | ifm_type
int | ifm_addrs
int | ifm_flags
u_short | ifm_index
struct if_data | ifm_data

Detailed Description

Definition at line 269 of file if.h.

Field Documentation

◆ ifm_addrs

int if_msghdr::ifm_addrs

Definition at line 273 of file if.h.

◆ ifm_data

struct if_data if_msghdr::ifm_data

Definition at line 276 of file if.h.

◆ ifm_flags

int if_msghdr::ifm_flags

Definition at line 274 of file if.h.

◆ ifm_index

u_short if_msghdr::ifm_index

Definition at line 275 of file if.h.

◆ ifm_msglen

u_short if_msghdr::ifm_msglen

Definition at line 270 of file if.h.

◆ ifm_type

u_char if_msghdr::ifm_type

Definition at line 272 of file if.h.

◆ ifm_version

u_char if_msghdr::ifm_version

Definition at line 271 of file if.h.


Watt-32 tcp/ip: if_set Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
if_set Struct Reference
Collaboration diagram for if_set:
[legend]

Data Fields

if_mask ifs_bits [howmany(IF_SETSIZE, NIFBITS)]

Detailed Description

Definition at line 94 of file ip6_mrou.h.

Field Documentation

◆ ifs_bits

if_mask if_set::ifs_bits[howmany(IF_SETSIZE, NIFBITS)]

Definition at line 95 of file ip6_mrou.h.


Watt-32 tcp/ip: ifa_msghdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ifa_msghdr Struct Reference
Collaboration diagram for ifa_msghdr:
[legend]

Data Fields

u_short | ifam_msglen
u_char | ifam_version
u_char | ifam_type
int | ifam_addrs
int | ifam_flags
u_short | ifam_index
int | ifam_metric

Detailed Description

Definition at line 283 of file if.h.

Field Documentation

◆ ifam_addrs

int ifa_msghdr::ifam_addrs

Definition at line 287 of file if.h.

◆ ifam_flags

int ifa_msghdr::ifam_flags

Definition at line 288 of file if.h.

◆ ifam_index

u_short ifa_msghdr::ifam_index

Definition at line 289 of file if.h.

◆ ifam_metric

int ifa_msghdr::ifam_metric

Definition at line 290 of file if.h.

◆ ifam_msglen

u_short ifa_msghdr::ifam_msglen

Definition at line 284 of file if.h.

◆ ifam_type

u_char ifa_msghdr::ifam_type

Definition at line 286 of file if.h.

◆ ifam_version

u_char ifa_msghdr::ifam_version

Definition at line 285 of file if.h.


Watt-32 tcp/ip: ifaddr Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
ifaddr Struct Reference
Collaboration diagram for ifaddr:
[legend]

Public Member Functions

TAILQ_ENTRY (ifaddr) ifa_list
void ifa_rtrequest (int, struct rtentry *, struct sockaddr *)

Data Fields

struct sockaddr * | ifa_addr
struct sockaddr * | ifa_dstaddr
struct sockaddr * | ifa_netmask
struct ifnet * | ifa_ifp
u_short | ifa_flags
short | ifa_refcnt
int | ifa_metric

Detailed Description

Definition at line 250 of file if.h.

Field Documentation

◆ ifa_addr

struct sockaddr* ifaddr::ifa_addr

Definition at line 251 of file if.h.

◆ ifa_dstaddr

struct sockaddr* ifaddr::ifa_dstaddr

Definition at line 252 of file if.h.

◆ ifa_flags

u_short ifaddr::ifa_flags

Definition at line 259 of file if.h.

◆ ifa_ifp

struct ifnet* ifaddr::ifa_ifp

Definition at line 255 of file if.h.

◆ ifa_metric

int ifaddr::ifa_metric

Definition at line 261 of file if.h.

◆ ifa_netmask

struct sockaddr* ifaddr::ifa_netmask

Definition at line 254 of file if.h.

◆ ifa_refcnt

short ifaddr::ifa_refcnt

Definition at line 260 of file if.h.


Watt-32 tcp/ip: ifaliasreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ifaliasreq Struct Reference
Collaboration diagram for ifaliasreq:
[legend]

Data Fields

char | ifra_name [IFNAMSIZ]
struct sockaddr | ifra_addr
struct sockaddr | ifra_dstaddr
struct sockaddr | ifra_mask

Detailed Description

Definition at line 322 of file if.h.

Field Documentation

◆ ifra_addr

struct sockaddr ifaliasreq::ifra_addr

Definition at line 324 of file if.h.

◆ ifra_dstaddr

struct sockaddr ifaliasreq::ifra_dstaddr

Definition at line 325 of file if.h.

◆ ifra_mask

struct sockaddr ifaliasreq::ifra_mask

Definition at line 327 of file if.h.

◆ ifra_name

char ifaliasreq::ifra_name[IFNAMSIZ]

Definition at line 323 of file if.h.


Watt-32 tcp/ip: ifconf Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ifconf Struct Reference
Collaboration diagram for ifconf:
[legend]

Data Fields

int ifc_len
union {
caddr_t ifcu_buf
struct ifreq * ifcu_req
} ifc_ifcu

Detailed Description

Definition at line 346 of file if.h.

Field Documentation

◆ ifc_len

int ifconf::ifc_len

Definition at line 347 of file if.h.

◆ ifcu_buf

caddr_t ifconf::ifcu_buf

Definition at line 349 of file if.h.

◆ ifcu_req

struct ifreq* ifconf::ifcu_req

Definition at line 350 of file if.h.


Watt-32 tcp/ip: ifmedia_description Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ifmedia_description Struct Reference
Collaboration diagram for ifmedia_description:
[legend]

Data Fields

int | ifmt_word
const char * | ifmt_string

Detailed Description

Definition at line 149 of file if_media.h.

Field Documentation

◆ ifmt_string

const char* ifmedia_description::ifmt_string

Definition at line 151 of file if_media.h.

◆ ifmt_word

int ifmedia_description::ifmt_word

Definition at line 150 of file if_media.h.


Watt-32 tcp/ip: ifmediareq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ifmediareq Struct Reference
Collaboration diagram for ifmediareq:
[legend]

Data Fields

char | ifm_name [IFNAMSIZ]
int | ifm_current
int | ifm_mask
int | ifm_status
int | ifm_active
int | ifm_count
int * | ifm_ulist

Detailed Description

Definition at line 330 of file if.h.

Field Documentation

◆ ifm_active

int ifmediareq::ifm_active

Definition at line 335 of file if.h.

◆ ifm_count

int ifmediareq::ifm_count

Definition at line 336 of file if.h.

◆ ifm_current

int ifmediareq::ifm_current

Definition at line 332 of file if.h.

◆ ifm_mask

int ifmediareq::ifm_mask

Definition at line 333 of file if.h.

◆ ifm_name

char ifmediareq::ifm_name[IFNAMSIZ]

Definition at line 331 of file if.h.

◆ ifm_status

int ifmediareq::ifm_status

Definition at line 334 of file if.h.

◆ ifm_ulist

int* ifmediareq::ifm_ulist

Definition at line 337 of file if.h.


Watt-32 tcp/ip: ifnet Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
ifnet Struct Reference
Collaboration diagram for ifnet:
[legend]

Public Member Functions

TAILQ_ENTRY (ifnet) if_list
TAILQ_HEAD (xx, ifaddr) if_addrlist
int | if_output (struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *)
void | if_start (struct ifnet *)
int | if_ioctl (struct ifnet *, u_long, caddr_t)
int | if_reset (struct ifnet *)
void | if_watchdog (struct ifnet *)

Data Fields

void * | if_softc
char | if_xname [IFNAMSIZ]
int | if_pcount
caddr_t | if_bpf
u_short | if_index
short | if_timer
short | if_flags
short | if__pad1
struct if_data | if_data
struct ifqueue | if_snd
struct sockaddr_dl * | if_sadl
u_int8_t * | if_broadcastaddr

Detailed Description

Definition at line 136 of file if.h.

Field Documentation

◆ if__pad1

short ifnet::if__pad1

Definition at line 146 of file if.h.

◆ if_bpf

caddr_t ifnet::if_bpf

Definition at line 142 of file if.h.

◆ if_broadcastaddr

u_int8_t* ifnet::if_broadcastaddr

Definition at line 163 of file if.h.

◆ if_data

struct if_data ifnet::if_data

Definition at line 147 of file if.h.

◆ if_flags

short ifnet::if_flags

Definition at line 145 of file if.h.

◆ if_index

u_short ifnet::if_index

Definition at line 143 of file if.h.

◆ if_pcount

int ifnet::if_pcount

Definition at line 141 of file if.h.

◆ if_sadl

struct sockaddr_dl* ifnet::if_sadl

Definition at line 162 of file if.h.

◆ if_snd

struct ifqueue ifnet::if_snd

Definition at line 161 of file if.h.

◆ if_softc

void* ifnet::if_softc

Definition at line 137 of file if.h.

◆ if_timer

short ifnet::if_timer

Definition at line 144 of file if.h.

◆ if_xname

char ifnet::if_xname[IFNAMSIZ]

Definition at line 140 of file if.h.


Watt-32 tcp/ip: ifpppcstatsreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ifpppcstatsreq Struct Reference
Collaboration diagram for ifpppcstatsreq:
[legend]

Data Fields

char | ifr_name [IFNAMSIZ]
struct ppp_comp_stats | stats

Detailed Description

Definition at line 87 of file if_ppp.h.

Field Documentation

◆ ifr_name

char ifpppcstatsreq::ifr_name[IFNAMSIZ]

Definition at line 88 of file if_ppp.h.

◆ stats

struct ppp_comp_stats ifpppcstatsreq::stats

Definition at line 89 of file if_ppp.h.


Watt-32 tcp/ip: ifpppstatsreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ifpppstatsreq Struct Reference
Collaboration diagram for ifpppstatsreq:
[legend]

Data Fields

char | ifr_name [IFNAMSIZ]
struct ppp_stats | stats

Detailed Description

Definition at line 82 of file if_ppp.h.

Field Documentation

◆ ifr_name

char ifpppstatsreq::ifr_name[IFNAMSIZ]

Definition at line 83 of file if_ppp.h.

◆ stats

struct ppp_stats ifpppstatsreq::stats

Definition at line 84 of file if_ppp.h.


Watt-32 tcp/ip: ifprefix Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
ifprefix Struct Reference
Collaboration diagram for ifprefix:
[legend]

Public Member Functions

TAILQ_ENTRY (ifprefix) ifpr_list

Data Fields

struct sockaddr * | ifpr_prefix
struct ifnet * | ifpr_ifp
u_char | ifpr_plen
u_char | ifpr_type

Detailed Description

Definition at line 383 of file wtypes.h.

Field Documentation

◆ ifpr_ifp

struct ifnet* ifprefix::ifpr_ifp

Definition at line 385 of file wtypes.h.

◆ ifpr_plen

u_char ifprefix::ifpr_plen

Definition at line 387 of file wtypes.h.

◆ ifpr_prefix

struct sockaddr* ifprefix::ifpr_prefix

Definition at line 384 of file wtypes.h.

◆ ifpr_type

u_char ifprefix::ifpr_type

Definition at line 388 of file wtypes.h.


Watt-32 tcp/ip: ifqueue Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ifqueue Struct Reference
Collaboration diagram for ifqueue:
[legend]

Data Fields

struct mbuf * | ifq_head
struct mbuf * | ifq_tail
int | ifq_len
int | ifq_maxlen
int | ifq_drops

Detailed Description

Definition at line 128 of file if.h.

Field Documentation

◆ ifq_drops

int ifqueue::ifq_drops

Definition at line 133 of file if.h.

◆ ifq_head

struct mbuf* ifqueue::ifq_head

Definition at line 129 of file if.h.

◆ ifq_len

int ifqueue::ifq_len

Definition at line 131 of file if.h.

◆ ifq_maxlen

int ifqueue::ifq_maxlen

Definition at line 132 of file if.h.

◆ ifq_tail

struct mbuf* ifqueue::ifq_tail

Definition at line 130 of file if.h.


Watt-32 tcp/ip: ifreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ifreq Struct Reference
Collaboration diagram for ifreq:
[legend]

Data Fields

char ifr_name [IFNAMSIZ]
union {
struct sockaddr ifru_addr
struct sockaddr ifru_dstaddr
struct sockaddr ifru_hwaddr
struct sockaddr ifru_broadaddr
short ifru_flags
int ifru_metric
int ifru_mtu
caddr_t ifru_data
} ifr_ifru

Detailed Description

Definition at line 299 of file if.h.

Field Documentation

◆ ifr_name

char ifreq::ifr_name[IFNAMSIZ]

Definition at line 300 of file if.h.

◆ ifru_addr

struct sockaddr ifreq::ifru_addr

Definition at line 302 of file if.h.

◆ ifru_broadaddr

struct sockaddr ifreq::ifru_broadaddr

Definition at line 305 of file if.h.

◆ ifru_data

caddr_t ifreq::ifru_data

Definition at line 309 of file if.h.

◆ ifru_dstaddr

struct sockaddr ifreq::ifru_dstaddr

Definition at line 303 of file if.h.

◆ ifru_flags

short ifreq::ifru_flags

Definition at line 306 of file if.h.

◆ ifru_hwaddr

struct sockaddr ifreq::ifru_hwaddr

Definition at line 304 of file if.h.

◆ ifru_metric

int ifreq::ifru_metric

Definition at line 307 of file if.h.

◆ ifru_mtu

int ifreq::ifru_mtu

Definition at line 308 of file if.h.


Watt-32 tcp/ip: igmpmsg Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
igmpmsg Struct Reference
Collaboration diagram for igmpmsg:
[legend]

Data Fields

u_long | unused1
u_long | unused2
u_char | im_msgtype
u_char | im_mbz
u_char | im_vif
u_char | unused3
struct in_addr im_src | im_dst

Detailed Description

Definition at line 205 of file ip_mrout.h.

Field Documentation

◆ im_dst

struct in_addr im_src igmpmsg::im_dst

Definition at line 214 of file ip_mrout.h.

◆ im_mbz

u_char igmpmsg::im_mbz

Definition at line 211 of file ip_mrout.h.

◆ im_msgtype

u_char igmpmsg::im_msgtype

Definition at line 208 of file ip_mrout.h.

◆ im_vif

u_char igmpmsg::im_vif

Definition at line 212 of file ip_mrout.h.

◆ unused1

u_long igmpmsg::unused1

Definition at line 206 of file ip_mrout.h.

◆ unused2

u_long igmpmsg::unused2

Definition at line 207 of file ip_mrout.h.

◆ unused3

u_char igmpmsg::unused3

Definition at line 213 of file ip_mrout.h.


Watt-32 tcp/ip: igmpstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
igmpstat Struct Reference
Collaboration diagram for igmpstat:
[legend]

Data Fields

u_int | igps_rcv_total
u_int | igps_rcv_tooshort
u_int | igps_rcv_badsum
u_int | igps_rcv_queries
u_int | igps_rcv_badqueries
u_int | igps_rcv_reports
u_int | igps_rcv_badreports
u_int | igps_rcv_ourreports
u_int | igps_snd_reports

Detailed Description

Definition at line 56 of file igmp_var.h.

Field Documentation

◆ igps_rcv_badqueries

u_int igmpstat::igps_rcv_badqueries

Definition at line 61 of file igmp_var.h.

◆ igps_rcv_badreports

u_int igmpstat::igps_rcv_badreports

Definition at line 63 of file igmp_var.h.

◆ igps_rcv_badsum

u_int igmpstat::igps_rcv_badsum

Definition at line 59 of file igmp_var.h.

◆ igps_rcv_ourreports

u_int igmpstat::igps_rcv_ourreports

Definition at line 64 of file igmp_var.h.

◆ igps_rcv_queries

u_int igmpstat::igps_rcv_queries

Definition at line 60 of file igmp_var.h.

◆ igps_rcv_reports

u_int igmpstat::igps_rcv_reports

Definition at line 62 of file igmp_var.h.

◆ igps_rcv_tooshort

u_int igmpstat::igps_rcv_tooshort

Definition at line 58 of file igmp_var.h.

◆ igps_rcv_total

u_int igmpstat::igps_rcv_total

Definition at line 57 of file igmp_var.h.

◆ igps_snd_reports

u_int igmpstat::igps_snd_reports

Definition at line 65 of file igmp_var.h.


Watt-32 tcp/ip: IGMPv0_packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
IGMPv0_packet Struct Reference

#include <pcigmp.h>

Collaboration diagram for IGMPv0_packet:
[legend]

Data Fields

BYTE | type
BYTE | code
WORD | checksum
WORD | ident
DWORD | address
DWORD | access_key

Detailed Description

Internet Group Management Protocol packet version 0.

Definition at line 10 of file pcigmp.h.

Field Documentation

◆ access_key

DWORD IGMPv0_packet::access_key

Definition at line 16 of file pcigmp.h.

◆ address

DWORD IGMPv0_packet::address

Definition at line 15 of file pcigmp.h.

◆ checksum

WORD IGMPv0_packet::checksum

Definition at line 13 of file pcigmp.h.

◆ code

BYTE IGMPv0_packet::code

Definition at line 12 of file pcigmp.h.

◆ ident

WORD IGMPv0_packet::ident

Definition at line 14 of file pcigmp.h.

◆ type

BYTE IGMPv0_packet::type

Definition at line 11 of file pcigmp.h.


Watt-32 tcp/ip: IGMPv1_packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
IGMPv1_packet Struct Reference

#include <pcigmp.h>

Collaboration diagram for IGMPv1_packet:
[legend]

Data Fields

int | type: 4
int | version: 4
BYTE | unused
WORD | checksum
DWORD | address

Detailed Description

Internet Group Management Protocol packet version 1.

Definition at line 23 of file pcigmp.h.

Field Documentation

◆ address

DWORD IGMPv1_packet::address

Definition at line 28 of file pcigmp.h.

◆ checksum

WORD IGMPv1_packet::checksum

Definition at line 27 of file pcigmp.h.

◆ type

int IGMPv1_packet::type

Definition at line 24 of file pcigmp.h.

◆ unused

BYTE IGMPv1_packet::unused

Definition at line 26 of file pcigmp.h.

◆ version

int IGMPv1_packet::version

Definition at line 25 of file pcigmp.h.


Watt-32 tcp/ip: IGMPv2_packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
IGMPv2_packet Struct Reference

#include <pcigmp.h>

Collaboration diagram for IGMPv2_packet:
[legend]

Data Fields

BYTE | type
BYTE | max_resp
WORD | checksum
DWORD | address

Detailed Description

Internet Group Management Protocol packet version 2.

Definition at line 35 of file pcigmp.h.

Field Documentation

◆ address

DWORD IGMPv2_packet::address

Definition at line 39 of file pcigmp.h.

◆ checksum

WORD IGMPv2_packet::checksum

Definition at line 38 of file pcigmp.h.

◆ max_resp

BYTE IGMPv2_packet::max_resp

Definition at line 37 of file pcigmp.h.

◆ type

BYTE IGMPv2_packet::type

Definition at line 36 of file pcigmp.h.


Watt-32 tcp/ip: IGMPv3_packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
IGMPv3_packet Struct Reference

#include <pcigmp.h>

Collaboration diagram for IGMPv3_packet:
[legend]

Data Fields

BYTE | type
BYTE | max_resp
WORD | checksum
DWORD | address
int | QRV: 3
int | s_bit: 1
int | resv: 4
BYTE | QQIC
WORD | num_src
DWORD | src_addr

Detailed Description

Internet Group Management Protocol packet version 3.

Definition at line 46 of file pcigmp.h.

Field Documentation

◆ address

DWORD IGMPv3_packet::address

Definition at line 50 of file pcigmp.h.

◆ checksum

WORD IGMPv3_packet::checksum

Definition at line 49 of file pcigmp.h.

◆ max_resp

BYTE IGMPv3_packet::max_resp

Definition at line 48 of file pcigmp.h.

◆ num_src

WORD IGMPv3_packet::num_src

Definition at line 55 of file pcigmp.h.

◆ QQIC

BYTE IGMPv3_packet::QQIC

Definition at line 54 of file pcigmp.h.

◆ QRV

int IGMPv3_packet::QRV

Definition at line 51 of file pcigmp.h.

◆ resv

int IGMPv3_packet::resv

Definition at line 53 of file pcigmp.h.

◆ s_bit

int IGMPv3_packet::s_bit

Definition at line 52 of file pcigmp.h.

◆ src_addr

DWORD IGMPv3_packet::src_addr

Definition at line 56 of file pcigmp.h.

◆ type

BYTE IGMPv3_packet::type

Definition at line 47 of file pcigmp.h.


Watt-32 tcp/ip: in6_addr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_addr Struct Reference
Collaboration diagram for in6_addr:
[legend]

Data Fields

u_int8_t s6_addr [16]
union {
u_int8_t _S6_u8 [16]
u_int16_t _S6_u16 [8]
u_int32_t _S6_u32 [4]
} _S6_un
union {
uint8_t __u6_addr8 [16]
uint16_t __u6_addr16 [8]
uint32_t __u6_addr32 [4]
} __u6_addr

Detailed Description

Definition at line 151 of file in.h.

Field Documentation

◆ __u6_addr16

uint16_t in6_addr::__u6_addr16[8]

Definition at line 126 of file in6.h.

◆ __u6_addr32

uint32_t in6_addr::__u6_addr32[4]

Definition at line 127 of file in6.h.

◆ __u6_addr8

uint8_t in6_addr::__u6_addr8[16]

Definition at line 125 of file in6.h.

◆ _S6_u16

u_int16_t in6_addr::_S6_u16[8]

Definition at line 158 of file in.h.

◆ _S6_u32

u_int32_t in6_addr::_S6_u32[4]

Definition at line 159 of file in.h.

◆ _S6_u8

u_int8_t in6_addr::_S6_u8[16]

Definition at line 157 of file in.h.

◆ s6_addr

u_int8_t in6_addr::s6_addr[16]

Definition at line 152 of file in.h.


Watt-32 tcp/ip: in6_addrlifetime Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_addrlifetime Struct Reference
Collaboration diagram for in6_addrlifetime:
[legend]

Data Fields

time_t | ia6t_expire
time_t | ia6t_preferred
u_int32_t | ia6t_vltime
u_int32_t | ia6t_pltime

Detailed Description

Definition at line 84 of file in6_var.h.

Field Documentation

◆ ia6t_expire

time_t in6_addrlifetime::ia6t_expire

Definition at line 85 of file in6_var.h.

◆ ia6t_pltime

u_int32_t in6_addrlifetime::ia6t_pltime

Definition at line 88 of file in6_var.h.

◆ ia6t_preferred

time_t in6_addrlifetime::ia6t_preferred

Definition at line 86 of file in6_var.h.

◆ ia6t_vltime

u_int32_t in6_addrlifetime::ia6t_vltime

Definition at line 87 of file in6_var.h.


Watt-32 tcp/ip: in6_aliasreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_aliasreq Struct Reference
Collaboration diagram for in6_aliasreq:
[legend]

Data Fields

char | ifra_name [IFNAMSIZ]
struct sockaddr_in6 | ifra_addr
struct sockaddr_in6 | ifra_dstaddr
struct sockaddr_in6 | ifra_prefixmask
int | ifra_flags
struct in6_addrlifetime | ifra_lifetime

Detailed Description

Definition at line 265 of file in6_var.h.

Field Documentation

◆ ifra_addr

struct sockaddr_in6 in6_aliasreq::ifra_addr

Definition at line 267 of file in6_var.h.

◆ ifra_dstaddr

struct sockaddr_in6 in6_aliasreq::ifra_dstaddr

Definition at line 268 of file in6_var.h.

◆ ifra_flags

int in6_aliasreq::ifra_flags

Definition at line 270 of file in6_var.h.

◆ ifra_lifetime

struct in6_addrlifetime in6_aliasreq::ifra_lifetime

Definition at line 271 of file in6_var.h.

◆ ifra_name

char in6_aliasreq::ifra_name[IFNAMSIZ]

Definition at line 266 of file in6_var.h.

◆ ifra_prefixmask

struct sockaddr_in6 in6_aliasreq::ifra_prefixmask

Definition at line 269 of file in6_var.h.


Watt-32 tcp/ip: in6_defrouter Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_defrouter Struct Reference
Collaboration diagram for in6_defrouter:
[legend]

Data Fields

struct sockaddr_in6 | rtaddr
u_char | flags
u_short | rtlifetime
u_long | expire
u_short | if_index

Detailed Description

Definition at line 118 of file nd6.h.

Field Documentation

◆ expire

u_long in6_defrouter::expire

Definition at line 122 of file nd6.h.

◆ flags

u_char in6_defrouter::flags

Definition at line 120 of file nd6.h.

◆ if_index

u_short in6_defrouter::if_index

Definition at line 123 of file nd6.h.

◆ rtaddr

struct sockaddr_in6 in6_defrouter::rtaddr

Definition at line 119 of file nd6.h.

◆ rtlifetime

u_short in6_defrouter::rtlifetime

Definition at line 121 of file nd6.h.


Watt-32 tcp/ip: in6_drlist Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_drlist Struct Reference
Collaboration diagram for in6_drlist:
[legend]

Data Fields

char ifname [IFNAMSIZ]
struct {
struct in6_addr rtaddr
u_char flags
u_short rtlifetime
u_long expire
u_short if_index
} defrouter [DRLSTSIZ]

Detailed Description

Definition at line 107 of file nd6.h.

Field Documentation

◆ expire

u_long in6_drlist::expire

Definition at line 113 of file nd6.h.

◆ flags

u_char in6_drlist::flags

Definition at line 111 of file nd6.h.

◆ if_index

u_short in6_drlist::if_index

Definition at line 114 of file nd6.h.

◆ ifname

char in6_drlist::ifname[IFNAMSIZ]

Definition at line 108 of file nd6.h.

◆ rtaddr

struct in6_addr in6_drlist::rtaddr

Definition at line 110 of file nd6.h.

◆ rtlifetime

u_short in6_drlist::rtlifetime

Definition at line 112 of file nd6.h.


Watt-32 tcp/ip: in6_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_Header Struct Reference

#include <wattcp.h>

Collaboration diagram for in6_Header:
[legend]

Data Fields

BYTE | pri: 4
BYTE | ver: 4
BYTE | flow_lbl [3]
WORD | len
BYTE | next_hdr
BYTE | hop_limit
ip6_address | source
ip6_address | destination

Detailed Description

IPv6 header.

Definition at line 381 of file wattcp.h.

Field Documentation

◆ destination

ip6_address in6_Header::destination

Definition at line 389 of file wattcp.h.

◆ flow_lbl

BYTE in6_Header::flow_lbl[3]

Definition at line 384 of file wattcp.h.

◆ hop_limit

BYTE in6_Header::hop_limit

Definition at line 387 of file wattcp.h.

◆ len

WORD in6_Header::len

Definition at line 385 of file wattcp.h.

◆ next_hdr

BYTE in6_Header::next_hdr

Definition at line 386 of file wattcp.h.

◆ pri

BYTE in6_Header::pri

Definition at line 382 of file wattcp.h.

◆ source

ip6_address in6_Header::source

Definition at line 388 of file wattcp.h.

◆ ver

BYTE in6_Header::ver

Definition at line 383 of file wattcp.h.


Watt-32 tcp/ip: in6_ifaddr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_ifaddr Struct Reference
Collaboration diagram for in6_ifaddr:
[legend]

Data Fields

struct ifaddr | ia_ifa
struct sockaddr_in6 | ia_addr
struct sockaddr_in6 | ia_net
struct sockaddr_in6 | ia_dstaddr
struct sockaddr_in6 | ia_prefixmask
u_int32_t | ia_plen
struct in6_ifaddr * | ia_next
int | ia6_flags
struct in6_addrlifetime | ia6_lifetime
struct ifprefix * | ia6_ifpr
struct nd_prefix * | ia6_ndpr

Detailed Description

Definition at line 91 of file in6_var.h.

Field Documentation

◆ ia6_flags

int in6_ifaddr::ia6_flags

Definition at line 101 of file in6_var.h.

◆ ia6_ifpr

struct ifprefix* in6_ifaddr::ia6_ifpr

Definition at line 104 of file in6_var.h.

◆ ia6_lifetime

struct in6_addrlifetime in6_ifaddr::ia6_lifetime

Definition at line 103 of file in6_var.h.

◆ ia6_ndpr

struct nd_prefix* in6_ifaddr::ia6_ndpr

Definition at line 106 of file in6_var.h.

◆ ia_addr

struct sockaddr_in6 in6_ifaddr::ia_addr

Definition at line 95 of file in6_var.h.

◆ ia_dstaddr

struct sockaddr_in6 in6_ifaddr::ia_dstaddr

Definition at line 97 of file in6_var.h.

◆ ia_ifa

struct ifaddr in6_ifaddr::ia_ifa

Definition at line 92 of file in6_var.h.

◆ ia_net

struct sockaddr_in6 in6_ifaddr::ia_net

Definition at line 96 of file in6_var.h.

◆ ia_next

struct in6_ifaddr* in6_ifaddr::ia_next

Definition at line 100 of file in6_var.h.

◆ ia_plen

u_int32_t in6_ifaddr::ia_plen

Definition at line 99 of file in6_var.h.

◆ ia_prefixmask

struct sockaddr_in6 in6_ifaddr::ia_prefixmask

Definition at line 98 of file in6_var.h.


Watt-32 tcp/ip: in6_ifreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_ifreq Struct Reference
Collaboration diagram for in6_ifreq:
[legend]

Data Fields

struct in6_addr | ifr6_addr
unsigned long | ifr6_prefixlen
unsigned long | ifr6_ifindex
char | ifr_name [IFNAMSIZ]
union {
struct sockaddr_in6 ifru_addr
struct sockaddr_in6 ifru_dstaddr
short ifru_flags
int ifru_flags6
int ifru_metric
caddr_t ifru_data
struct in6_addrlifetime ifru_lifetime
struct in6_ifstat ifru_stat
struct icmp6_ifstat ifru_icmp6stat
u_int32_t ifru_scope_id [16]
} ifr_ifru

Detailed Description

Definition at line 72 of file ipv6.h.

Field Documentation

◆ ifr6_addr

struct in6_addr in6_ifreq::ifr6_addr

Definition at line 73 of file ipv6.h.

◆ ifr6_ifindex

unsigned long in6_ifreq::ifr6_ifindex

Definition at line 75 of file ipv6.h.

◆ ifr6_prefixlen

unsigned long in6_ifreq::ifr6_prefixlen

Definition at line 74 of file ipv6.h.

◆ ifr_name

char in6_ifreq::ifr_name[IFNAMSIZ]

Definition at line 234 of file in6_var.h.

◆ ifru_addr

struct sockaddr_in6 in6_ifreq::ifru_addr

Definition at line 236 of file in6_var.h.

◆ ifru_data

caddr_t in6_ifreq::ifru_data

Definition at line 241 of file in6_var.h.

◆ ifru_dstaddr

struct sockaddr_in6 in6_ifreq::ifru_dstaddr

Definition at line 237 of file in6_var.h.

◆ ifru_flags

short in6_ifreq::ifru_flags

Definition at line 238 of file in6_var.h.

◆ ifru_flags6

int in6_ifreq::ifru_flags6

Definition at line 239 of file in6_var.h.

◆ ifru_icmp6stat

struct icmp6_ifstat in6_ifreq::ifru_icmp6stat

Definition at line 244 of file in6_var.h.

◆ ifru_lifetime

struct in6_addrlifetime in6_ifreq::ifru_lifetime

Definition at line 242 of file in6_var.h.

◆ ifru_metric

int in6_ifreq::ifru_metric

Definition at line 240 of file in6_var.h.

◆ ifru_scope_id

u_int32_t in6_ifreq::ifru_scope_id[16]

Definition at line 245 of file in6_var.h.

◆ ifru_stat

struct in6_ifstat in6_ifreq::ifru_stat

Definition at line 243 of file in6_var.h.


Watt-32 tcp/ip: in6_ifstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_ifstat Struct Reference
Collaboration diagram for in6_ifstat:
[legend]

Data Fields

u_quad_t | ifs6_in_receive
u_quad_t | ifs6_in_hdrerr
u_quad_t | ifs6_in_toobig
u_quad_t | ifs6_in_noroute
u_quad_t | ifs6_in_addrerr
u_quad_t | ifs6_in_protounknown
u_quad_t | ifs6_in_truncated
u_quad_t | ifs6_in_discard
u_quad_t | ifs6_in_deliver
u_quad_t | ifs6_out_forward
u_quad_t | ifs6_out_request
u_quad_t | ifs6_out_discard
u_quad_t | ifs6_out_fragok
u_quad_t | ifs6_out_fragfail
u_quad_t | ifs6_out_fragcreat
u_quad_t | ifs6_reass_reqd
u_quad_t | ifs6_reass_ok
u_quad_t | ifs6_reass_fail
u_quad_t | ifs6_in_mcast
u_quad_t | ifs6_out_mcast

Detailed Description

Definition at line 114 of file in6_var.h.

Field Documentation

◆ ifs6_in_addrerr

u_quad_t in6_ifstat::ifs6_in_addrerr

Definition at line 119 of file in6_var.h.

◆ ifs6_in_deliver

u_quad_t in6_ifstat::ifs6_in_deliver

Definition at line 125 of file in6_var.h.

◆ ifs6_in_discard

u_quad_t in6_ifstat::ifs6_in_discard

Definition at line 123 of file in6_var.h.

◆ ifs6_in_hdrerr

u_quad_t in6_ifstat::ifs6_in_hdrerr

Definition at line 116 of file in6_var.h.

◆ ifs6_in_mcast

u_quad_t in6_ifstat::ifs6_in_mcast

Definition at line 144 of file in6_var.h.

◆ ifs6_in_noroute

u_quad_t in6_ifstat::ifs6_in_noroute

Definition at line 118 of file in6_var.h.

◆ ifs6_in_protounknown

u_quad_t in6_ifstat::ifs6_in_protounknown

Definition at line 120 of file in6_var.h.

◆ ifs6_in_receive

u_quad_t in6_ifstat::ifs6_in_receive

Definition at line 115 of file in6_var.h.

◆ ifs6_in_toobig

u_quad_t in6_ifstat::ifs6_in_toobig

Definition at line 117 of file in6_var.h.

◆ ifs6_in_truncated

u_quad_t in6_ifstat::ifs6_in_truncated

Definition at line 122 of file in6_var.h.

◆ ifs6_out_discard

u_quad_t in6_ifstat::ifs6_out_discard

Definition at line 131 of file in6_var.h.

◆ ifs6_out_forward

u_quad_t in6_ifstat::ifs6_out_forward

Definition at line 127 of file in6_var.h.

◆ ifs6_out_fragcreat

u_quad_t in6_ifstat::ifs6_out_fragcreat

Definition at line 134 of file in6_var.h.

◆ ifs6_out_fragfail

u_quad_t in6_ifstat::ifs6_out_fragfail

Definition at line 133 of file in6_var.h.

◆ ifs6_out_fragok

u_quad_t in6_ifstat::ifs6_out_fragok

Definition at line 132 of file in6_var.h.

◆ ifs6_out_mcast

u_quad_t in6_ifstat::ifs6_out_mcast

Definition at line 145 of file in6_var.h.

◆ ifs6_out_request

u_quad_t in6_ifstat::ifs6_out_request

Definition at line 129 of file in6_var.h.

◆ ifs6_reass_fail

u_quad_t in6_ifstat::ifs6_reass_fail

Definition at line 141 of file in6_var.h.

◆ ifs6_reass_ok

u_quad_t in6_ifstat::ifs6_reass_ok

Definition at line 138 of file in6_var.h.

◆ ifs6_reass_reqd

u_quad_t in6_ifstat::ifs6_reass_reqd

Definition at line 136 of file in6_var.h.


Watt-32 tcp/ip: in6_multi Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
in6_multi Struct Reference
Collaboration diagram for in6_multi:
[legend]

Public Member Functions

LIST_ENTRY (in6_multi) in6m_entry

Data Fields

struct in6_addr | in6m_addr
struct ifnet * | in6m_ifp
struct ifmultiaddr * | in6m_ifma
u_int | in6m_refcount
u_int | in6m_state
u_int | in6m_timer

Detailed Description

Definition at line 522 of file in6_var.h.

Field Documentation

◆ in6m_addr

struct in6_addr in6_multi::in6m_addr

Definition at line 524 of file in6_var.h.

◆ in6m_ifma

struct ifmultiaddr* in6_multi::in6m_ifma

Definition at line 526 of file in6_var.h.

◆ in6m_ifp

struct ifnet* in6_multi::in6m_ifp

Definition at line 525 of file in6_var.h.

◆ in6m_refcount

u_int in6_multi::in6m_refcount

Definition at line 527 of file in6_var.h.

◆ in6m_state

u_int in6_multi::in6m_state

Definition at line 528 of file in6_var.h.

◆ in6m_timer

u_int in6_multi::in6m_timer

Definition at line 529 of file in6_var.h.


Watt-32 tcp/ip: in6_multi_mship Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
in6_multi_mship Struct Reference
Collaboration diagram for in6_multi_mship:
[legend]

Public Member Functions

LIST_ENTRY (in6_multi_mship) i6mm_chain

Data Fields

struct in6_multi * i6mm_maddr

Detailed Description

Definition at line 517 of file in6_var.h.

Field Documentation

◆ i6mm_maddr

struct in6_multi* in6_multi_mship::i6mm_maddr

Definition at line 518 of file in6_var.h.


Watt-32 tcp/ip: in6_multistep Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_multistep Struct Reference
Collaboration diagram for in6_multistep:
[legend]

Data Fields

struct in6_ifaddr * | i_ia
struct in6_multi * | i_in6m

Detailed Description

Definition at line 539 of file in6_var.h.

Field Documentation

◆ i_ia

struct in6_ifaddr* in6_multistep::i_ia

Definition at line 540 of file in6_var.h.

◆ i_in6m

struct in6_multi* in6_multistep::i_in6m

Definition at line 541 of file in6_var.h.


Watt-32 tcp/ip: in6_nbrinfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_nbrinfo Struct Reference
Collaboration diagram for in6_nbrinfo:
[legend]

Data Fields

char | ifname [IFNAMSIZ]
struct in6_addr | addr
long | asked
int | isrouter
int | state
int | expire

Detailed Description

Definition at line 96 of file nd6.h.

Field Documentation

◆ addr

struct in6_addr in6_nbrinfo::addr

Definition at line 98 of file nd6.h.

◆ asked

long in6_nbrinfo::asked

Definition at line 99 of file nd6.h.

◆ expire

int in6_nbrinfo::expire

Definition at line 102 of file nd6.h.

◆ ifname

char in6_nbrinfo::ifname[IFNAMSIZ]

Definition at line 97 of file nd6.h.

◆ isrouter

int in6_nbrinfo::isrouter

Definition at line 100 of file nd6.h.

◆ state

int in6_nbrinfo::state

Definition at line 101 of file nd6.h.


Watt-32 tcp/ip: in6_ndifreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_ndifreq Struct Reference
Collaboration diagram for in6_ndifreq:
[legend]

Data Fields

char | ifname [IFNAMSIZ]
u_long | ifindex

Detailed Description

Definition at line 179 of file nd6.h.

Field Documentation

◆ ifindex

u_long in6_ndifreq::ifindex

Definition at line 181 of file nd6.h.

◆ ifname

char in6_ndifreq::ifname[IFNAMSIZ]

Definition at line 180 of file nd6.h.


Watt-32 tcp/ip: in6_ndireq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_ndireq Struct Reference
Collaboration diagram for in6_ndireq:
[legend]

Data Fields

char | ifname [IFNAMSIZ]
struct nd_ifinfo | ndi

Detailed Description

Definition at line 174 of file nd6.h.

Field Documentation

◆ ifname

char in6_ndireq::ifname[IFNAMSIZ]

Definition at line 175 of file nd6.h.

◆ ndi

struct nd_ifinfo in6_ndireq::ndi

Definition at line 176 of file nd6.h.


Watt-32 tcp/ip: in6_ondireq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_ondireq Struct Reference
Collaboration diagram for in6_ondireq:
[legend]

Data Fields

char ifname [IFNAMSIZ]
struct {
u_int32_t linkmtu
u_int32_t maxmtu
u_int32_t basereachable
u_int32_t reachable
u_int32_t retrans
u_int32_t flags
int recalctm
u_int8_t chlim
u_int8_t receivedra
} ndi

Detailed Description

Definition at line 158 of file nd6.h.

Field Documentation

◆ basereachable

u_int32_t in6_ondireq::basereachable

Definition at line 163 of file nd6.h.

◆ chlim

u_int8_t in6_ondireq::chlim

Definition at line 168 of file nd6.h.

◆ flags

u_int32_t in6_ondireq::flags

Definition at line 166 of file nd6.h.

◆ ifname

char in6_ondireq::ifname[IFNAMSIZ]

Definition at line 159 of file nd6.h.

◆ linkmtu

u_int32_t in6_ondireq::linkmtu

Definition at line 161 of file nd6.h.

◆ maxmtu

u_int32_t in6_ondireq::maxmtu

Definition at line 162 of file nd6.h.

◆ reachable

u_int32_t in6_ondireq::reachable

Definition at line 164 of file nd6.h.

◆ recalctm

int in6_ondireq::recalctm

Definition at line 167 of file nd6.h.

◆ receivedra

u_int8_t in6_ondireq::receivedra

Definition at line 169 of file nd6.h.

◆ retrans

u_int32_t in6_ondireq::retrans

Definition at line 165 of file nd6.h.


Watt-32 tcp/ip: in6_pktinfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_pktinfo Struct Reference
Collaboration diagram for in6_pktinfo:
[legend]

Data Fields

struct in6_addr | ipi6_addr
int | ipi6_ifindex
unsigned int | ipi6_ifindex

Detailed Description

Definition at line 67 of file ipv6.h.

Field Documentation

◆ ipi6_addr

struct in6_addr in6_pktinfo::ipi6_addr

Definition at line 68 of file ipv6.h.

◆ ipi6_ifindex [1/2]

int in6_pktinfo::ipi6_ifindex

Definition at line 69 of file ipv6.h.

◆ ipi6_ifindex [2/2]

unsigned int in6_pktinfo::ipi6_ifindex

Definition at line 359 of file in6.h.


Watt-32 tcp/ip: in6_prefix Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_prefix Struct Reference
Collaboration diagram for in6_prefix:
[legend]

Data Fields

struct sockaddr_in6 | prefix
struct prf_ra | raflags
u_char | prefixlen
u_char | origin
u_long | vltime
u_long | pltime
u_long | expire
u_int32_t | flags
int | refcnt
u_short | if_index
u_short | advrtrs

Detailed Description

Definition at line 142 of file nd6.h.

Field Documentation

◆ advrtrs

u_short in6_prefix::advrtrs

Definition at line 153 of file nd6.h.

◆ expire

u_long in6_prefix::expire

Definition at line 149 of file nd6.h.

◆ flags

u_int32_t in6_prefix::flags

Definition at line 150 of file nd6.h.

◆ if_index

u_short in6_prefix::if_index

Definition at line 152 of file nd6.h.

◆ origin

u_char in6_prefix::origin

Definition at line 146 of file nd6.h.

◆ pltime

u_long in6_prefix::pltime

Definition at line 148 of file nd6.h.

◆ prefix

struct sockaddr_in6 in6_prefix::prefix

Definition at line 143 of file nd6.h.

◆ prefixlen

u_char in6_prefix::prefixlen

Definition at line 145 of file nd6.h.

◆ raflags

struct prf_ra in6_prefix::raflags

Definition at line 144 of file nd6.h.

◆ refcnt

int in6_prefix::refcnt

Definition at line 151 of file nd6.h.

◆ vltime

u_long in6_prefix::vltime

Definition at line 147 of file nd6.h.


Watt-32 tcp/ip: in6_prefixreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_prefixreq Struct Reference
Collaboration diagram for in6_prefixreq:
[legend]

Data Fields

char | ipr_name [IFNAMSIZ]
u_char | ipr_origin
u_char | ipr_plen
u_int32_t | ipr_vltime
u_int32_t | ipr_pltime
struct in6_prflags | ipr_flags
struct sockaddr_in6 | ipr_prefix

Detailed Description

Definition at line 307 of file in6_var.h.

Field Documentation

◆ ipr_flags

struct in6_prflags in6_prefixreq::ipr_flags

Definition at line 313 of file in6_var.h.

◆ ipr_name

char in6_prefixreq::ipr_name[IFNAMSIZ]

Definition at line 308 of file in6_var.h.

◆ ipr_origin

u_char in6_prefixreq::ipr_origin

Definition at line 309 of file in6_var.h.

◆ ipr_plen

u_char in6_prefixreq::ipr_plen

Definition at line 310 of file in6_var.h.

◆ ipr_pltime

u_int32_t in6_prefixreq::ipr_pltime

Definition at line 312 of file in6_var.h.

◆ ipr_prefix

struct sockaddr_in6 in6_prefixreq::ipr_prefix

Definition at line 314 of file in6_var.h.

◆ ipr_vltime

u_int32_t in6_prefixreq::ipr_vltime

Definition at line 311 of file in6_var.h.


Watt-32 tcp/ip: in6_prflags Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_prflags Struct Reference
Collaboration diagram for in6_prflags:
[legend]

Data Fields

struct prf_ra | prf_ra
u_char | prf_reserved1
u_short | prf_reserved2
struct prf_rr | prf_rr
u_char | prf_reserved3
u_short | prf_reserved4

Detailed Description

Definition at line 296 of file in6_var.h.

Field Documentation

◆ prf_ra

struct prf_ra in6_prflags::prf_ra

Definition at line 297 of file in6_var.h.

◆ prf_reserved1

u_char in6_prflags::prf_reserved1

Definition at line 298 of file in6_var.h.

◆ prf_reserved2

u_short in6_prflags::prf_reserved2

Definition at line 299 of file in6_var.h.

◆ prf_reserved3

u_char in6_prflags::prf_reserved3

Definition at line 303 of file in6_var.h.

◆ prf_reserved4

u_short in6_prflags::prf_reserved4

Definition at line 304 of file in6_var.h.

◆ prf_rr

struct prf_rr in6_prflags::prf_rr

Definition at line 302 of file in6_var.h.


Watt-32 tcp/ip: in6_prlist Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in6_prlist Struct Reference
Collaboration diagram for in6_prlist:
[legend]

Data Fields

char ifname [IFNAMSIZ]
struct {
struct in6_addr prefix
struct prf_ra raflags
u_char prefixlen
u_char origin
u_int32_t vltime
u_int32_t pltime
time_t expire
u_short if_index
u_short advrtrs
struct in6_addr advrtr [DRLSTSIZ]
} prefix [PRLSTSIZ]

Detailed Description

Definition at line 126 of file nd6.h.

Field Documentation

◆ advrtr

struct in6_addr in6_prlist::advrtr[DRLSTSIZ]

Definition at line 138 of file nd6.h.

◆ advrtrs

u_short in6_prlist::advrtrs

Definition at line 137 of file nd6.h.

◆ expire

time_t in6_prlist::expire

Definition at line 135 of file nd6.h.

◆ if_index

u_short in6_prlist::if_index

Definition at line 136 of file nd6.h.

◆ ifname

char in6_prlist::ifname[IFNAMSIZ]

Definition at line 127 of file nd6.h.

◆ origin

u_char in6_prlist::origin

Definition at line 132 of file nd6.h.

◆ pltime

u_int32_t in6_prlist::pltime

Definition at line 134 of file nd6.h.

◆ prefix

struct in6_addr in6_prlist::prefix

Definition at line 129 of file nd6.h.

◆ prefixlen

u_char in6_prlist::prefixlen

Definition at line 131 of file nd6.h.

◆ raflags

struct prf_ra in6_prlist::raflags

Definition at line 130 of file nd6.h.

◆ vltime

u_int32_t in6_prlist::vltime

Definition at line 133 of file nd6.h.


Watt-32 tcp/ip: in6_rrenumreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Structures | Data Fields
in6_rrenumreq Struct Reference
Collaboration diagram for in6_rrenumreq:
[legend]

Data Structures

struct irr_raflagmask

Data Fields

char | irr_name [IFNAMSIZ]
u_char | irr_origin
u_char | irr_m_len
u_char | irr_m_minlen
u_char | irr_m_maxlen
u_char | irr_u_uselen
u_char | irr_u_keeplen
struct in6_rrenumreq::irr_raflagmask | irr_raflagmask
u_int32_t | irr_vltime
u_int32_t | irr_pltime
struct in6_prflags | irr_flags
struct sockaddr_in6 | irr_matchprefix
struct sockaddr_in6 | irr_useprefix

Detailed Description

Definition at line 330 of file in6_var.h.

Field Documentation

◆ irr_flags

struct in6_prflags in6_rrenumreq::irr_flags

Definition at line 345 of file in6_var.h.

◆ irr_m_len

u_char in6_rrenumreq::irr_m_len

Definition at line 333 of file in6_var.h.

◆ irr_m_maxlen

u_char in6_rrenumreq::irr_m_maxlen

Definition at line 335 of file in6_var.h.

◆ irr_m_minlen

u_char in6_rrenumreq::irr_m_minlen

Definition at line 334 of file in6_var.h.

◆ irr_matchprefix

struct sockaddr_in6 in6_rrenumreq::irr_matchprefix

Definition at line 346 of file in6_var.h.

◆ irr_name

char in6_rrenumreq::irr_name[IFNAMSIZ]

Definition at line 331 of file in6_var.h.

◆ irr_origin

u_char in6_rrenumreq::irr_origin

Definition at line 332 of file in6_var.h.

◆ irr_pltime

u_int32_t in6_rrenumreq::irr_pltime

Definition at line 344 of file in6_var.h.

◆ irr_u_keeplen

u_char in6_rrenumreq::irr_u_keeplen

Definition at line 337 of file in6_var.h.

◆ irr_u_uselen

u_char in6_rrenumreq::irr_u_uselen

Definition at line 336 of file in6_var.h.

◆ irr_useprefix

struct sockaddr_in6 in6_rrenumreq::irr_useprefix

Definition at line 347 of file in6_var.h.

◆ irr_vltime

u_int32_t in6_rrenumreq::irr_vltime

Definition at line 343 of file in6_var.h.


Watt-32 tcp/ip: in6_rrenumreq::irr_raflagmask Struct Reference

  • Data Structure Index
  • Data Fields
  • in6_rrenumreq
  • irr_raflagmask
Data Fields
in6_rrenumreq::irr_raflagmask Struct Reference
Collaboration diagram for in6_rrenumreq::irr_raflagmask:
[legend]

Data Fields

u_char | onlink: 1
u_char | autonomous: 1
u_char | reserved: 6

Detailed Description

Definition at line 338 of file in6_var.h.

Field Documentation

◆ autonomous

u_char in6_rrenumreq::irr_raflagmask::autonomous

Definition at line 340 of file in6_var.h.

◆ onlink

u_char in6_rrenumreq::irr_raflagmask::onlink

Definition at line 339 of file in6_var.h.

◆ reserved

u_char in6_rrenumreq::irr_raflagmask::reserved

Definition at line 341 of file in6_var.h.


Watt-32 tcp/ip: in_addr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in_addr Struct Reference
Collaboration diagram for in_addr:
[legend]

Data Fields

u_int32_t s_addr

Detailed Description

Definition at line 143 of file in.h.

Field Documentation

◆ s_addr

u_int32_t in_addr::s_addr

Definition at line 144 of file in.h.


Watt-32 tcp/ip: in_aliasreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
in_aliasreq Struct Reference
Collaboration diagram for in_aliasreq:
[legend]

Data Fields

char | ifra_name [IFNAMSIZ]
struct sockaddr_in | ifra_addr
struct sockaddr_in | ifra_broadaddr
struct sockaddr_in | ifra_mask

Detailed Description

Definition at line 70 of file in_var.h.

Field Documentation

◆ ifra_addr

struct sockaddr_in in_aliasreq::ifra_addr

Definition at line 72 of file in_var.h.

◆ ifra_broadaddr

struct sockaddr_in in_aliasreq::ifra_broadaddr

Definition at line 73 of file in_var.h.

◆ ifra_mask

struct sockaddr_in in_aliasreq::ifra_mask

Definition at line 75 of file in_var.h.

◆ ifra_name

char in_aliasreq::ifra_name[IFNAMSIZ]

Definition at line 71 of file in_var.h.


Watt-32 tcp/ip: in_Header Struct Reference

  • Data Structure Index
  • Data Fields
in_Header Struct Reference

#include <wattcp.h>

Detailed Description

The Internet (ip) Header.

Definition at line 333 of file wattcp.h.


Watt-32 tcp/ip: in_ifaddr Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
in_ifaddr Struct Reference
Collaboration diagram for in_ifaddr:
[legend]

Public Member Functions

LIST_HEAD (in_multihead, in_multi) ia_multiaddrs

Data Fields

struct ifaddr | ia_ifa
u_long | ia_net
u_long | ia_netmask
u_long | ia_subnet
u_long | ia_subnetmask
struct in_addr | ia_netbroadcast
struct in_ifaddr * | ia_next
struct sockaddr_in | ia_addr
struct sockaddr_in | ia_dstaddr
struct sockaddr_in | ia_sockmask

Detailed Description

Definition at line 51 of file in_var.h.

Field Documentation

◆ ia_addr

struct sockaddr_in in_ifaddr::ia_addr

Definition at line 62 of file in_var.h.

◆ ia_dstaddr

struct sockaddr_in in_ifaddr::ia_dstaddr

Definition at line 63 of file in_var.h.

◆ ia_ifa

struct ifaddr in_ifaddr::ia_ifa

Definition at line 52 of file in_var.h.

◆ ia_net

u_long in_ifaddr::ia_net

Definition at line 56 of file in_var.h.

◆ ia_netbroadcast

struct in_addr in_ifaddr::ia_netbroadcast

Definition at line 60 of file in_var.h.

◆ ia_netmask

u_long in_ifaddr::ia_netmask

Definition at line 57 of file in_var.h.

◆ ia_next

struct in_ifaddr* in_ifaddr::ia_next

Definition at line 61 of file in_var.h.

◆ ia_sockmask

struct sockaddr_in in_ifaddr::ia_sockmask

Definition at line 65 of file in_var.h.

◆ ia_subnet

u_long in_ifaddr::ia_subnet

Definition at line 58 of file in_var.h.

◆ ia_subnetmask

u_long in_ifaddr::ia_subnetmask

Definition at line 59 of file in_var.h.


Watt-32 tcp/ip: in_multi Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
in_multi Struct Reference
Collaboration diagram for in_multi:
[legend]

Public Member Functions

LIST_ENTRY (in_multi) inm_entry

Data Fields

struct in_addr | inm_addr
struct ifnet * | inm_ifp
struct in_ifaddr * | inm_ia
u_int | inm_refcount
u_int | inm_timer
u_int | inm_state
struct router_info * | inm_rti

Detailed Description

Definition at line 106 of file in_var.h.

Field Documentation

◆ inm_addr

struct in_addr in_multi::inm_addr

Definition at line 108 of file in_var.h.

◆ inm_ia

struct in_ifaddr* in_multi::inm_ia

Definition at line 110 of file in_var.h.

◆ inm_ifp

struct ifnet* in_multi::inm_ifp

Definition at line 109 of file in_var.h.

◆ inm_refcount

u_int in_multi::inm_refcount

Definition at line 111 of file in_var.h.

◆ inm_rti

struct router_info* in_multi::inm_rti

Definition at line 114 of file in_var.h.

◆ inm_state

u_int in_multi::inm_state

Definition at line 113 of file in_var.h.

◆ inm_timer

u_int in_multi::inm_timer

Definition at line 112 of file in_var.h.


Watt-32 tcp/ip: inet6_ndpr_msghdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
inet6_ndpr_msghdr Struct Reference
Collaboration diagram for inet6_ndpr_msghdr:
[legend]

Data Fields

u_short | inpm_msglen
u_char | inpm_version
u_char | inpm_type
struct in6_addr | inpm_prefix
u_long | prm_vltim
u_long | prm_pltime
u_long | prm_expire
u_long | prm_preferred
struct in6_prflags | prm_flags
u_short | prm_index
u_char | prm_plen

Detailed Description

Definition at line 257 of file nd6.h.

Field Documentation

◆ inpm_msglen

u_short inet6_ndpr_msghdr::inpm_msglen

Definition at line 258 of file nd6.h.

◆ inpm_prefix

struct in6_addr inet6_ndpr_msghdr::inpm_prefix

Definition at line 261 of file nd6.h.

◆ inpm_type

u_char inet6_ndpr_msghdr::inpm_type

Definition at line 260 of file nd6.h.

◆ inpm_version

u_char inet6_ndpr_msghdr::inpm_version

Definition at line 259 of file nd6.h.

◆ prm_expire

u_long inet6_ndpr_msghdr::prm_expire

Definition at line 264 of file nd6.h.

◆ prm_flags

struct in6_prflags inet6_ndpr_msghdr::prm_flags

Definition at line 266 of file nd6.h.

◆ prm_index

u_short inet6_ndpr_msghdr::prm_index

Definition at line 267 of file nd6.h.

◆ prm_plen

u_char inet6_ndpr_msghdr::prm_plen

Definition at line 268 of file nd6.h.

◆ prm_pltime

u_long inet6_ndpr_msghdr::prm_pltime

Definition at line 263 of file nd6.h.

◆ prm_preferred

u_long inet6_ndpr_msghdr::prm_preferred

Definition at line 265 of file nd6.h.

◆ prm_vltim

u_long inet6_ndpr_msghdr::prm_vltim

Definition at line 262 of file nd6.h.


Watt-32 tcp/ip: inflate_state Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
inflate_state Struct Reference
Collaboration diagram for inflate_state:
[legend]

Data Fields

inflate_mode | mode
int | last
int | wrap
int | havedict
int | flags
unsigned long | check
unsigned long | total
unsigned | wbits
unsigned | wsize
unsigned | whave
unsigned | write
unsigned char FAR * | window
unsigned long | hold
unsigned | bits
unsigned | length
unsigned | offset
unsigned | extra
code const FAR * | lencode
code const FAR * | distcode
unsigned | lenbits
unsigned | distbits
unsigned | ncode
unsigned | nlen
unsigned | ndist
unsigned | have
code FAR * | next
unsigned short | lens [320]
unsigned short | work [288]
code | codes [ENOUGH]

Detailed Description

Definition at line 81 of file zinflate.h.

Field Documentation

◆ bits

unsigned inflate_state::bits

Definition at line 97 of file zinflate.h.

◆ check

unsigned long inflate_state::check

Definition at line 87 of file zinflate.h.

◆ codes

code inflate_state::codes[ENOUGH]

Definition at line 116 of file zinflate.h.

◆ distbits

unsigned inflate_state::distbits

Definition at line 107 of file zinflate.h.

◆ distcode

code const FAR* inflate_state::distcode

Definition at line 105 of file zinflate.h.

◆ extra

unsigned inflate_state::extra

Definition at line 102 of file zinflate.h.

◆ flags

int inflate_state::flags

Definition at line 86 of file zinflate.h.

◆ have

unsigned inflate_state::have

Definition at line 112 of file zinflate.h.

◆ havedict

int inflate_state::havedict

Definition at line 85 of file zinflate.h.

◆ hold

unsigned long inflate_state::hold

Definition at line 96 of file zinflate.h.

◆ last

int inflate_state::last

Definition at line 83 of file zinflate.h.

◆ lenbits

unsigned inflate_state::lenbits

Definition at line 106 of file zinflate.h.

◆ lencode

code const FAR* inflate_state::lencode

Definition at line 104 of file zinflate.h.

◆ length

unsigned inflate_state::length

Definition at line 99 of file zinflate.h.

◆ lens

unsigned short inflate_state::lens[320]

Definition at line 114 of file zinflate.h.

◆ mode

inflate_mode inflate_state::mode

Definition at line 82 of file zinflate.h.

◆ ncode

unsigned inflate_state::ncode

Definition at line 109 of file zinflate.h.

◆ ndist

unsigned inflate_state::ndist

Definition at line 111 of file zinflate.h.

◆ next

code FAR* inflate_state::next

Definition at line 113 of file zinflate.h.

◆ nlen

unsigned inflate_state::nlen

Definition at line 110 of file zinflate.h.

◆ offset

unsigned inflate_state::offset

Definition at line 100 of file zinflate.h.

◆ total

unsigned long inflate_state::total

Definition at line 88 of file zinflate.h.

◆ wbits

unsigned inflate_state::wbits

Definition at line 90 of file zinflate.h.

◆ whave

unsigned inflate_state::whave

Definition at line 92 of file zinflate.h.

◆ window

unsigned char FAR* inflate_state::window

Definition at line 94 of file zinflate.h.

◆ work

unsigned short inflate_state::work[288]

Definition at line 115 of file zinflate.h.

◆ wrap

int inflate_state::wrap

Definition at line 84 of file zinflate.h.

◆ write

unsigned inflate_state::write

Definition at line 93 of file zinflate.h.

◆ wsize

unsigned inflate_state::wsize

Definition at line 91 of file zinflate.h.


Watt-32 tcp/ip: inpcb Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
inpcb Struct Reference
Collaboration diagram for inpcb:
[legend]

Public Member Functions

LIST_ENTRY (inpcb) inp_list
LIST_ENTRY (inpcb) inp_hash

Data Fields

struct inpcbinfo * | inp_pcbinfo
struct in_addr | inp_faddr
u_short | inp_fport
struct in_addr | inp_laddr
u_short | inp_lport
struct socket * | inp_socket
caddr_t | inp_ppcb
struct route | inp_route
int | inp_flags
struct ip | inp_ip
struct mbuf * | inp_options
struct ip_moptions * | inp_moptions

Detailed Description

Definition at line 61 of file in_pcb.h.

Field Documentation

◆ inp_faddr

struct in_addr inpcb::inp_faddr

Definition at line 65 of file in_pcb.h.

◆ inp_flags

int inpcb::inp_flags

Definition at line 72 of file in_pcb.h.

◆ inp_fport

u_short inpcb::inp_fport

Definition at line 66 of file in_pcb.h.

◆ inp_ip

struct ip inpcb::inp_ip

Definition at line 73 of file in_pcb.h.

◆ inp_laddr

struct in_addr inpcb::inp_laddr

Definition at line 67 of file in_pcb.h.

◆ inp_lport

u_short inpcb::inp_lport

Definition at line 68 of file in_pcb.h.

◆ inp_moptions

struct ip_moptions* inpcb::inp_moptions

Definition at line 75 of file in_pcb.h.

◆ inp_options

struct mbuf* inpcb::inp_options

Definition at line 74 of file in_pcb.h.

◆ inp_pcbinfo

struct inpcbinfo* inpcb::inp_pcbinfo

Definition at line 64 of file in_pcb.h.

◆ inp_ppcb

caddr_t inpcb::inp_ppcb

Definition at line 70 of file in_pcb.h.

◆ inp_route

struct route inpcb::inp_route

Definition at line 71 of file in_pcb.h.

◆ inp_socket

struct socket* inpcb::inp_socket

Definition at line 69 of file in_pcb.h.


Watt-32 tcp/ip: inpcbinfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
inpcbinfo Struct Reference
Collaboration diagram for inpcbinfo:
[legend]

Data Fields

struct inpcbhead * | listhead
struct inpcbhead * | hashbase
unsigned long | hashmask
unsigned short | lastport
unsigned short | lastlow
unsigned short | lasthi

Detailed Description

Definition at line 78 of file in_pcb.h.

Field Documentation

◆ hashbase

struct inpcbhead* inpcbinfo::hashbase

Definition at line 80 of file in_pcb.h.

◆ hashmask

unsigned long inpcbinfo::hashmask

Definition at line 81 of file in_pcb.h.

◆ lasthi

unsigned short inpcbinfo::lasthi

Definition at line 84 of file in_pcb.h.

◆ lastlow

unsigned short inpcbinfo::lastlow

Definition at line 83 of file in_pcb.h.

◆ lastport

unsigned short inpcbinfo::lastport

Definition at line 82 of file in_pcb.h.

◆ listhead

struct inpcbhead* inpcbinfo::listhead

Definition at line 79 of file in_pcb.h.


Watt-32 tcp/ip: inpcbpolicy Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
inpcbpolicy Struct Reference
Collaboration diagram for inpcbpolicy:
[legend]

Data Fields

struct secpolicy * | sp_in
struct secpolicy * | sp_out
int | priv

Detailed Description

Definition at line 115 of file ipsec.h.

Field Documentation

◆ priv

int inpcbpolicy::priv

Definition at line 118 of file ipsec.h.

◆ sp_in

struct secpolicy* inpcbpolicy::sp_in

Definition at line 116 of file ipsec.h.

◆ sp_out

struct secpolicy* inpcbpolicy::sp_out

Definition at line 117 of file ipsec.h.


Watt-32 tcp/ip: internal_state Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
internal_state Struct Reference
Collaboration diagram for internal_state:
[legend]

Data Fields

z_streamp | strm
int | status
Bytef * | pending_buf
ulg | pending_buf_size
Bytef * | pending_out
int | pending
int | wrap
Byte | data_type
Byte | method
int | last_flush
uInt | w_size
uInt | w_bits
uInt | w_mask
Bytef * | window
ulg | window_size
Posf * | prev
Posf * | head
uInt | ins_h
uInt | hash_size
uInt | hash_bits
uInt | hash_mask
uInt | hash_shift
long | block_start
uInt | match_length
IPos | prev_match
int | match_available
uInt | strstart
uInt | match_start
uInt | lookahead
uInt | prev_length
uInt | max_chain_length
uInt | max_lazy_match
int | level
int | strategy
uInt | good_match
int | nice_match
struct ct_data_s | dyn_ltree [HEAP_SIZE]
struct ct_data_s | dyn_dtree [2 *D_CODES+1]
struct ct_data_s | bl_tree [2 *BL_CODES+1]
struct tree_desc_s | l_desc
struct tree_desc_s | d_desc
struct tree_desc_s | bl_desc
ush | bl_count [MAX_BITS+1]
int | heap [2 *L_CODES+1]
int | heap_len
int | heap_max
uch | depth [2 *L_CODES+1]
uchf * | l_buf
uInt | lit_bufsize
uInt | last_lit
ushf * | d_buf
ulg | opt_len
ulg | static_len
uInt | matches
int | last_eob_len
ulg | compressed_len
ulg | bits_sent
ush | bi_buf
int | bi_valid
int | dummy

Detailed Description

Definition at line 90 of file zdeflate.h.

Field Documentation

◆ bi_buf

ush internal_state::bi_buf

Definition at line 249 of file zdeflate.h.

◆ bi_valid

int internal_state::bi_valid

Definition at line 253 of file zdeflate.h.

◆ bits_sent

ulg internal_state::bits_sent

Definition at line 246 of file zdeflate.h.

◆ bl_count

ush internal_state::bl_count[MAX_BITS+1]

Definition at line 195 of file zdeflate.h.

◆ bl_desc

struct tree_desc_s internal_state::bl_desc

Definition at line 193 of file zdeflate.h.

◆ bl_tree

struct ct_data_s internal_state::bl_tree[2 *BL_CODES+1]

Definition at line 189 of file zdeflate.h.

◆ block_start

long internal_state::block_start

Definition at line 143 of file zdeflate.h.

◆ compressed_len

ulg internal_state::compressed_len

Definition at line 245 of file zdeflate.h.

◆ d_buf

ushf* internal_state::d_buf

Definition at line 233 of file zdeflate.h.

◆ d_desc

struct tree_desc_s internal_state::d_desc

Definition at line 192 of file zdeflate.h.

◆ data_type

Byte internal_state::data_type

Definition at line 98 of file zdeflate.h.

◆ depth

uch internal_state::depth[2 *L_CODES+1]

Definition at line 205 of file zdeflate.h.

◆ dummy

int internal_state::dummy

Definition at line 23 of file zgzio.c.

◆ dyn_dtree

struct ct_data_s internal_state::dyn_dtree[2 *D_CODES+1]

Definition at line 188 of file zdeflate.h.

◆ dyn_ltree

struct ct_data_s internal_state::dyn_ltree[HEAP_SIZE]

Definition at line 187 of file zdeflate.h.

◆ good_match

uInt internal_state::good_match

Definition at line 180 of file zdeflate.h.

◆ hash_bits

uInt internal_state::hash_bits

Definition at line 133 of file zdeflate.h.

◆ hash_mask

uInt internal_state::hash_mask

Definition at line 134 of file zdeflate.h.

◆ hash_shift

uInt internal_state::hash_shift

Definition at line 136 of file zdeflate.h.

◆ hash_size

uInt internal_state::hash_size

Definition at line 132 of file zdeflate.h.

◆ head

Posf* internal_state::head

Definition at line 129 of file zdeflate.h.

◆ heap

int internal_state::heap[2 *L_CODES+1]

Definition at line 198 of file zdeflate.h.

◆ heap_len

int internal_state::heap_len

Definition at line 199 of file zdeflate.h.

◆ heap_max

int internal_state::heap_max

Definition at line 200 of file zdeflate.h.

◆ ins_h

uInt internal_state::ins_h

Definition at line 131 of file zdeflate.h.

◆ l_buf

uchf* internal_state::l_buf

Definition at line 209 of file zdeflate.h.

◆ l_desc

struct tree_desc_s internal_state::l_desc

Definition at line 191 of file zdeflate.h.

◆ last_eob_len

int internal_state::last_eob_len

Definition at line 242 of file zdeflate.h.

◆ last_flush

int internal_state::last_flush

Definition at line 100 of file zdeflate.h.

◆ last_lit

uInt internal_state::last_lit

Definition at line 231 of file zdeflate.h.

◆ level

int internal_state::level

Definition at line 177 of file zdeflate.h.

◆ lit_bufsize

uInt internal_state::lit_bufsize

Definition at line 211 of file zdeflate.h.

◆ lookahead

uInt internal_state::lookahead

Definition at line 153 of file zdeflate.h.

◆ match_available

int internal_state::match_available

Definition at line 150 of file zdeflate.h.

◆ match_length

uInt internal_state::match_length

Definition at line 148 of file zdeflate.h.

◆ match_start

uInt internal_state::match_start

Definition at line 152 of file zdeflate.h.

◆ matches

uInt internal_state::matches

Definition at line 241 of file zdeflate.h.

◆ max_chain_length

uInt internal_state::max_chain_length

Definition at line 160 of file zdeflate.h.

◆ max_lazy_match

uInt internal_state::max_lazy_match

Definition at line 166 of file zdeflate.h.

◆ method

Byte internal_state::method

Definition at line 99 of file zdeflate.h.

◆ nice_match

int internal_state::nice_match

Definition at line 183 of file zdeflate.h.

◆ opt_len

ulg internal_state::opt_len

Definition at line 239 of file zdeflate.h.

◆ pending

int internal_state::pending

Definition at line 96 of file zdeflate.h.

◆ pending_buf

Bytef* internal_state::pending_buf

Definition at line 93 of file zdeflate.h.

◆ pending_buf_size

ulg internal_state::pending_buf_size

Definition at line 94 of file zdeflate.h.

◆ pending_out

Bytef* internal_state::pending_out

Definition at line 95 of file zdeflate.h.

◆ prev

Posf* internal_state::prev

Definition at line 123 of file zdeflate.h.

◆ prev_length

uInt internal_state::prev_length

Definition at line 155 of file zdeflate.h.

◆ prev_match

IPos internal_state::prev_match

Definition at line 149 of file zdeflate.h.

◆ static_len

ulg internal_state::static_len

Definition at line 240 of file zdeflate.h.

◆ status

int internal_state::status

Definition at line 92 of file zdeflate.h.

◆ strategy

int internal_state::strategy

Definition at line 178 of file zdeflate.h.

◆ strm

z_streamp internal_state::strm

Definition at line 91 of file zdeflate.h.

◆ strstart

uInt internal_state::strstart

Definition at line 151 of file zdeflate.h.

◆ w_bits

uInt internal_state::w_bits

Definition at line 105 of file zdeflate.h.

◆ w_mask

uInt internal_state::w_mask

Definition at line 106 of file zdeflate.h.

◆ w_size

uInt internal_state::w_size

Definition at line 104 of file zdeflate.h.

◆ window

Bytef* internal_state::window

Definition at line 108 of file zdeflate.h.

◆ window_size

ulg internal_state::window_size

Definition at line 118 of file zdeflate.h.

◆ wrap

int internal_state::wrap

Definition at line 97 of file zdeflate.h.


Watt-32 tcp/ip: IOCTL_BUFFER Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
IOCTL_BUFFER Struct Reference
Collaboration diagram for IOCTL_BUFFER:
[legend]

Data Fields

void * | pv
DWORD | dwLen

Detailed Description

Definition at line 33 of file swsvpkt.h.

Field Documentation

◆ dwLen

DWORD IOCTL_BUFFER::dwLen

Definition at line 35 of file swsvpkt.h.

◆ pv

void* IOCTL_BUFFER::pv

Definition at line 34 of file swsvpkt.h.


Watt-32 tcp/ip: IOCTL_INFO Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
IOCTL_INFO Struct Reference
Collaboration diagram for IOCTL_INFO:
[legend]

Data Fields

BOOL | bPowerOn
BOOL | bMediaDisconnected
BOOL | bWan
BOOL | bWanDown

Detailed Description

Definition at line 42 of file swsvpkt.h.

Field Documentation

◆ bMediaDisconnected

BOOL IOCTL_INFO::bMediaDisconnected

Definition at line 44 of file swsvpkt.h.

◆ bPowerOn

BOOL IOCTL_INFO::bPowerOn

Definition at line 43 of file swsvpkt.h.

◆ bWan

BOOL IOCTL_INFO::bWan

Definition at line 45 of file swsvpkt.h.

◆ bWanDown

BOOL IOCTL_INFO::bWanDown

Definition at line 46 of file swsvpkt.h.


Watt-32 tcp/ip: iovec Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
iovec Struct Reference
Collaboration diagram for iovec:
[legend]

Data Fields

void * | iov_base
size_t | iov_len

Detailed Description

Definition at line 222 of file wtypes.h.

Field Documentation

◆ iov_base

void* iovec::iov_base

Definition at line 223 of file wtypes.h.

◆ iov_len

size_t iovec::iov_len

Definition at line 224 of file wtypes.h.


Watt-32 tcp/ip: ip6_dest Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6_dest Struct Reference
Collaboration diagram for ip6_dest:
[legend]

Data Fields

u_int8_t | ip6d_nxt
u_int8_t | ip6d_len

Detailed Description

Definition at line 142 of file ip6.h.

Field Documentation

◆ ip6d_len

u_int8_t ip6_dest::ip6d_len

Definition at line 144 of file ip6.h.

◆ ip6d_nxt

u_int8_t ip6_dest::ip6d_nxt

Definition at line 143 of file ip6.h.


Watt-32 tcp/ip: ip6_ext Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6_ext Struct Reference
Collaboration diagram for ip6_ext:
[legend]

Data Fields

u_int8_t | ip6e_nxt
u_int8_t | ip6e_len

Detailed Description

Definition at line 127 of file ip6.h.

Field Documentation

◆ ip6e_len

u_int8_t ip6_ext::ip6e_len

Definition at line 129 of file ip6.h.

◆ ip6e_nxt

u_int8_t ip6_ext::ip6e_nxt

Definition at line 128 of file ip6.h.


Watt-32 tcp/ip: ip6_frag Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6_frag Struct Reference
Collaboration diagram for ip6_frag:
[legend]

Data Fields

u_int8_t | ip6f_nxt
u_int8_t | ip6f_reserved
u_int16_t | ip6f_offlg
u_int32_t | ip6f_ident

Detailed Description

Definition at line 199 of file ip6.h.

Field Documentation

◆ ip6f_ident

u_int32_t ip6_frag::ip6f_ident

Definition at line 203 of file ip6.h.

◆ ip6f_nxt

u_int8_t ip6_frag::ip6f_nxt

Definition at line 200 of file ip6.h.

◆ ip6f_offlg

u_int16_t ip6_frag::ip6f_offlg

Definition at line 202 of file ip6.h.

◆ ip6f_reserved

u_int8_t ip6_frag::ip6f_reserved

Definition at line 201 of file ip6.h.


Watt-32 tcp/ip: ip6_fw Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6_fw Struct Reference
Collaboration diagram for ip6_fw:
[legend]

Data Fields

u_long | fw_pcnt
u_long | fw_bcnt
struct in6_addr fw_src | fw_dst
struct in6_addr fw_smsk | fw_dmsk
u_short | fw_number
u_short | fw_flg
u_int | fw_ipflg
u_short | fw_pts [IPV6_FW_MAX_PORTS]
u_char | fw_ip6opt
u_char | fw_ip6nopt
u_char | fw_tcpf
u_char | fw_tcpnf
unsigned | fw_icmp6types [IPV6_FW_ICMPTYPES_DIM]
long | timestamp
union ip6_fw_if fw_in_if | fw_out_if
union {
u_short fu_divert_port
u_short fu_skipto_rule
u_short fu_reject_code
} fw_un
u_char | fw_prot
u_char | fw_nports

Detailed Description

Definition at line 85 of file ip6_fw.h.

Field Documentation

◆ fu_divert_port

u_short ip6_fw::fu_divert_port

Definition at line 101 of file ip6_fw.h.

◆ fu_reject_code

u_short ip6_fw::fu_reject_code

Definition at line 103 of file ip6_fw.h.

◆ fu_skipto_rule

u_short ip6_fw::fu_skipto_rule

Definition at line 102 of file ip6_fw.h.

◆ fw_bcnt

u_long ip6_fw::fw_bcnt

Definition at line 86 of file ip6_fw.h.

◆ fw_dmsk

struct in6_addr fw_smsk ip6_fw::fw_dmsk

Definition at line 88 of file ip6_fw.h.

◆ fw_dst

struct in6_addr fw_src ip6_fw::fw_dst

Definition at line 87 of file ip6_fw.h.

◆ fw_flg

u_short ip6_fw::fw_flg

Definition at line 90 of file ip6_fw.h.

◆ fw_icmp6types

unsigned ip6_fw::fw_icmp6types[IPV6_FW_ICMPTYPES_DIM]

Definition at line 97 of file ip6_fw.h.

◆ fw_ip6nopt

u_char ip6_fw::fw_ip6nopt

Definition at line 94 of file ip6_fw.h.

◆ fw_ip6opt

u_char ip6_fw::fw_ip6opt

Definition at line 94 of file ip6_fw.h.

◆ fw_ipflg

u_int ip6_fw::fw_ipflg

Definition at line 92 of file ip6_fw.h.

◆ fw_nports

u_char ip6_fw::fw_nports

Definition at line 106 of file ip6_fw.h.

◆ fw_number

u_short ip6_fw::fw_number

Definition at line 89 of file ip6_fw.h.

◆ fw_out_if

union ip6_fw_if fw_in_if ip6_fw::fw_out_if

Definition at line 99 of file ip6_fw.h.

◆ fw_pcnt

u_long ip6_fw::fw_pcnt

Definition at line 86 of file ip6_fw.h.

◆ fw_prot

u_char ip6_fw::fw_prot

Definition at line 105 of file ip6_fw.h.

◆ fw_pts

u_short ip6_fw::fw_pts[IPV6_FW_MAX_PORTS]

Definition at line 93 of file ip6_fw.h.

◆ fw_tcpf

u_char ip6_fw::fw_tcpf

Definition at line 95 of file ip6_fw.h.

◆ fw_tcpnf

u_char ip6_fw::fw_tcpnf

Definition at line 95 of file ip6_fw.h.

◆ timestamp

long ip6_fw::timestamp

Definition at line 98 of file ip6_fw.h.


Watt-32 tcp/ip: ip6_fw_chain Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
ip6_fw_chain Struct Reference
Collaboration diagram for ip6_fw_chain:
[legend]

Public Member Functions

LIST_ENTRY (ip6_fw_chain) chain

Data Fields

struct ip6_fw * rule

Detailed Description

Definition at line 127 of file ip6_fw.h.

Field Documentation

◆ rule

struct ip6_fw* ip6_fw_chain::rule

Definition at line 129 of file ip6_fw.h.


Watt-32 tcp/ip: ip6_fw_if Union Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6_fw_if Union Reference
Collaboration diagram for ip6_fw_if:
[legend]

Data Fields

struct in6_addr fu_via_ip6
struct {
char name [IP6FW_IFNLEN]
short unit
} fu_via_if

Detailed Description

Definition at line 67 of file ip6_fw.h.

Field Documentation

◆ fu_via_ip6

struct in6_addr ip6_fw_if::fu_via_ip6

Definition at line 68 of file ip6_fw.h.

◆ name

char ip6_fw_if::name[IP6FW_IFNLEN]

Definition at line 71 of file ip6_fw.h.

◆ unit

short ip6_fw_if::unit

Definition at line 72 of file ip6_fw.h.


Watt-32 tcp/ip: ip6_hbh Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6_hbh Struct Reference
Collaboration diagram for ip6_hbh:
[legend]

Data Fields

u_int8_t | ip6h_nxt
u_int8_t | ip6h_len

Detailed Description

Definition at line 134 of file ip6.h.

Field Documentation

◆ ip6h_len

u_int8_t ip6_hbh::ip6h_len

Definition at line 136 of file ip6.h.

◆ ip6h_nxt

u_int8_t ip6_hbh::ip6h_nxt

Definition at line 135 of file ip6.h.


Watt-32 tcp/ip: ip6_moptions Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
ip6_moptions Struct Reference
Collaboration diagram for ip6_moptions:
[legend]

Public Member Functions

LIST_HEAD (dummy, in6_multi_mship) im6o_memberships

Data Fields

struct ifnet * | im6o_multicast_ifp
u_char | im6o_multicast_hlim
u_char | im6o_multicast_loop

Detailed Description

Definition at line 120 of file ip6_var.h.

Field Documentation

◆ im6o_multicast_hlim

u_char ip6_moptions::im6o_multicast_hlim

Definition at line 122 of file ip6_var.h.

◆ im6o_multicast_ifp

struct ifnet* ip6_moptions::im6o_multicast_ifp

Definition at line 121 of file ip6_var.h.

◆ im6o_multicast_loop

u_char ip6_moptions::im6o_multicast_loop

Definition at line 123 of file ip6_var.h.


Watt-32 tcp/ip: ip6_packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6_packet Struct Reference
Collaboration diagram for ip6_packet:
[legend]

Data Fields

in6_Header in
udp_Header udp

Detailed Description

Definition at line 84 of file pctcp.c.

Field Documentation

◆ in

in6_Header ip6_packet::in

Definition at line 85 of file pctcp.c.

◆ udp

udp_Header ip6_packet::udp

Definition at line 86 of file pctcp.c.


Watt-32 tcp/ip: ip6_pktopts Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6_pktopts Struct Reference
Collaboration diagram for ip6_pktopts:
[legend]

Data Fields

struct mbuf * | ip6po_m
int | ip6po_hlim
struct in6_pktinfo * | ip6po_pktinfo
struct sockaddr * | ip6po_nexthop
struct ip6_hbh * | ip6po_hbh
struct ip6_dest * | ip6po_dest1
struct ip6po_rhinfo | ip6po_rhinfo
struct ip6_dest * | ip6po_dest2

Detailed Description

Definition at line 148 of file ip6_var.h.

Field Documentation

◆ ip6po_dest1

struct ip6_dest* ip6_pktopts::ip6po_dest1

Definition at line 160 of file ip6_var.h.

◆ ip6po_dest2

struct ip6_dest* ip6_pktopts::ip6po_dest2

Definition at line 166 of file ip6_var.h.

◆ ip6po_hbh

struct ip6_hbh* ip6_pktopts::ip6po_hbh

Definition at line 157 of file ip6_var.h.

◆ ip6po_hlim

int ip6_pktopts::ip6po_hlim

Definition at line 150 of file ip6_var.h.

◆ ip6po_m

struct mbuf* ip6_pktopts::ip6po_m

Definition at line 149 of file ip6_var.h.

◆ ip6po_nexthop

struct sockaddr* ip6_pktopts::ip6po_nexthop

Definition at line 155 of file ip6_var.h.

◆ ip6po_pktinfo

struct in6_pktinfo* ip6_pktopts::ip6po_pktinfo

Definition at line 153 of file ip6_var.h.

◆ ip6po_rhinfo

struct ip6po_rhinfo ip6_pktopts::ip6po_rhinfo

Definition at line 163 of file ip6_var.h.


Watt-32 tcp/ip: ip6_RouteHdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6_RouteHdr Struct Reference
Collaboration diagram for ip6_RouteHdr:
[legend]

Data Fields

BYTE | next_hdr
BYTE | hdrlen
BYTE | type
BYTE | seg_left

Detailed Description

Definition at line 23 of file ip6_in.h.

Field Documentation

◆ hdrlen

BYTE ip6_RouteHdr::hdrlen

Definition at line 25 of file ip6_in.h.

◆ next_hdr

BYTE ip6_RouteHdr::next_hdr

Definition at line 24 of file ip6_in.h.

◆ seg_left

BYTE ip6_RouteHdr::seg_left

Definition at line 27 of file ip6_in.h.

◆ type

BYTE ip6_RouteHdr::type

Definition at line 26 of file ip6_in.h.


Watt-32 tcp/ip: ip6_rthdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6_rthdr Struct Reference
Collaboration diagram for ip6_rthdr:
[legend]

Data Fields

u_int8_t | ip6r_nxt
u_int8_t | ip6r_len
u_int8_t | ip6r_type
u_int8_t | ip6r_segleft

Detailed Description

Definition at line 179 of file ip6.h.

Field Documentation

◆ ip6r_len

u_int8_t ip6_rthdr::ip6r_len

Definition at line 181 of file ip6.h.

◆ ip6r_nxt

u_int8_t ip6_rthdr::ip6r_nxt

Definition at line 180 of file ip6.h.

◆ ip6r_segleft

u_int8_t ip6_rthdr::ip6r_segleft

Definition at line 183 of file ip6.h.

◆ ip6r_type

u_int8_t ip6_rthdr::ip6r_type

Definition at line 182 of file ip6.h.


Watt-32 tcp/ip: ip6_rthdr0 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6_rthdr0 Struct Reference
Collaboration diagram for ip6_rthdr0:
[legend]

Data Fields

u_int8_t | ip6r0_nxt
u_int8_t | ip6r0_len
u_int8_t | ip6r0_type
u_int8_t | ip6r0_segleft
u_int8_t | ip6r0_reserved
u_int8_t | ip6r0_slmap [3]
struct in6_addr | ip6r0_addr [1]

Detailed Description

Definition at line 188 of file ip6.h.

Field Documentation

◆ ip6r0_addr

struct in6_addr ip6_rthdr0::ip6r0_addr[1]

Definition at line 195 of file ip6.h.

◆ ip6r0_len

u_int8_t ip6_rthdr0::ip6r0_len

Definition at line 190 of file ip6.h.

◆ ip6r0_nxt

u_int8_t ip6_rthdr0::ip6r0_nxt

Definition at line 189 of file ip6.h.

◆ ip6r0_reserved

u_int8_t ip6_rthdr0::ip6r0_reserved

Definition at line 193 of file ip6.h.

◆ ip6r0_segleft

u_int8_t ip6_rthdr0::ip6r0_segleft

Definition at line 192 of file ip6.h.

◆ ip6r0_slmap

u_int8_t ip6_rthdr0::ip6r0_slmap[3]

Definition at line 194 of file ip6.h.

◆ ip6r0_type

u_int8_t ip6_rthdr0::ip6r0_type

Definition at line 191 of file ip6.h.


Watt-32 tcp/ip: ip6asfrag Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6asfrag Struct Reference
Collaboration diagram for ip6asfrag:
[legend]

Data Fields

u_int32_t | ip6af_head
u_int16_t | ip6af_len
u_int8_t | ip6af_nxt
u_int8_t | ip6af_hlim
struct ip6asfrag * | ip6af_down
struct ip6asfrag * | ip6af_up
struct mbuf * | ip6af_m
int | ip6af_offset
int | ip6af_frglen
int | ip6af_off
u_int16_t | ip6af_mff

Detailed Description

Definition at line 101 of file ip6_var.h.

Field Documentation

◆ ip6af_down

struct ip6asfrag* ip6asfrag::ip6af_down

Definition at line 109 of file ip6_var.h.

◆ ip6af_frglen

int ip6asfrag::ip6af_frglen

Definition at line 113 of file ip6_var.h.

◆ ip6af_head

u_int32_t ip6asfrag::ip6af_head

Definition at line 102 of file ip6_var.h.

◆ ip6af_hlim

u_int8_t ip6asfrag::ip6af_hlim

Definition at line 105 of file ip6_var.h.

◆ ip6af_len

u_int16_t ip6asfrag::ip6af_len

Definition at line 103 of file ip6_var.h.

◆ ip6af_m

struct mbuf* ip6asfrag::ip6af_m

Definition at line 111 of file ip6_var.h.

◆ ip6af_mff

u_int16_t ip6asfrag::ip6af_mff

Definition at line 115 of file ip6_var.h.

◆ ip6af_nxt

u_int8_t ip6asfrag::ip6af_nxt

Definition at line 104 of file ip6_var.h.

◆ ip6af_off

int ip6asfrag::ip6af_off

Definition at line 114 of file ip6_var.h.

◆ ip6af_offset

int ip6asfrag::ip6af_offset

Definition at line 112 of file ip6_var.h.

◆ ip6af_up

struct ip6asfrag* ip6asfrag::ip6af_up

Definition at line 110 of file ip6_var.h.


Watt-32 tcp/ip: ip6aux Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6aux Struct Reference
Collaboration diagram for ip6aux:
[legend]

Data Fields

u_int32_t | ip6a_flags
struct in6_addr | ip6a_careof
struct in6_addr | ip6a_home
u_int16_t | ip6a_bruid
struct in6_ifaddr * | ip6a_dstia6
u_int16_t | ip6a_rtalert

Detailed Description

Definition at line 241 of file ip6_var.h.

Field Documentation

◆ ip6a_bruid

u_int16_t ip6aux::ip6a_bruid

Definition at line 251 of file ip6_var.h.

◆ ip6a_careof

struct in6_addr ip6aux::ip6a_careof

Definition at line 249 of file ip6_var.h.

◆ ip6a_dstia6

struct in6_ifaddr* ip6aux::ip6a_dstia6

Definition at line 254 of file ip6_var.h.

◆ ip6a_flags

u_int32_t ip6aux::ip6a_flags

Definition at line 242 of file ip6_var.h.

◆ ip6a_home

struct in6_addr ip6aux::ip6a_home

Definition at line 250 of file ip6_var.h.

◆ ip6a_rtalert

u_int16_t ip6aux::ip6a_rtalert

Definition at line 257 of file ip6_var.h.


Watt-32 tcp/ip: ip6ctlparam Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6ctlparam Struct Reference
Collaboration diagram for ip6ctlparam:
[legend]

Data Fields

struct mbuf * | ip6c_m
struct icmp6_hdr * | ip6c_icmp6
struct ip6_hdr * | ip6c_ip6
int | ip6c_off
struct sockaddr_in6 * | ip6c_src
struct sockaddr_in6 * | ip6c_dst
struct in6_addr * | ip6c_finaldst
void * | ip6c_cmdarg
u_int8_t | ip6c_nxt

Detailed Description

Definition at line 107 of file ip6proto.h.

Field Documentation

◆ ip6c_cmdarg

void* ip6ctlparam::ip6c_cmdarg

Definition at line 115 of file ip6proto.h.

◆ ip6c_dst

struct sockaddr_in6* ip6ctlparam::ip6c_dst

Definition at line 113 of file ip6proto.h.

◆ ip6c_finaldst

struct in6_addr* ip6ctlparam::ip6c_finaldst

Definition at line 114 of file ip6proto.h.

◆ ip6c_icmp6

struct icmp6_hdr* ip6ctlparam::ip6c_icmp6

Definition at line 109 of file ip6proto.h.

◆ ip6c_ip6

struct ip6_hdr* ip6ctlparam::ip6c_ip6

Definition at line 110 of file ip6proto.h.

◆ ip6c_m

struct mbuf* ip6ctlparam::ip6c_m

Definition at line 108 of file ip6proto.h.

◆ ip6c_nxt

u_int8_t ip6ctlparam::ip6c_nxt

Definition at line 116 of file ip6proto.h.

◆ ip6c_off

int ip6ctlparam::ip6c_off

Definition at line 111 of file ip6proto.h.

◆ ip6c_src

struct sockaddr_in6* ip6ctlparam::ip6c_src

Definition at line 112 of file ip6proto.h.


Watt-32 tcp/ip: ip6po_rhinfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6po_rhinfo Struct Reference
Collaboration diagram for ip6po_rhinfo:
[legend]

Data Fields

struct ip6_rthdr * | ip6po_rhi_rthdr
struct route_in6 | ip6po_rhi_route

Detailed Description

Definition at line 141 of file ip6_var.h.

Field Documentation

◆ ip6po_rhi_route

struct route_in6 ip6po_rhinfo::ip6po_rhi_route

Definition at line 143 of file ip6_var.h.

◆ ip6po_rhi_rthdr

struct ip6_rthdr* ip6po_rhinfo::ip6po_rhi_rthdr

Definition at line 142 of file ip6_var.h.


Watt-32 tcp/ip: ip6protosw Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
ip6protosw Struct Reference
Collaboration diagram for ip6protosw:
[legend]

Public Member Functions

int | pr_input (struct mbuf **, int *, int)
int | pr_output (struct mbuf *,...)
void | pr_ctlinput (int, struct sockaddr *, void *)
int | pr_ctloutput (struct socket *, struct sockopt *)
int | pr_usrreq (struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct thread *)
void | pr_init (void)
void | pr_fasttimo (void)
void | pr_slowtimo (void)
void | pr_drain (void)

Data Fields

short | pr_type
struct domain * | pr_domain
short | pr_protocol
short | pr_flags
struct pr_usrreqs * | pr_usrreqs

Detailed Description

Definition at line 119 of file ip6proto.h.

Field Documentation

◆ pr_domain

struct domain* ip6protosw::pr_domain

Definition at line 121 of file ip6proto.h.

◆ pr_flags

short ip6protosw::pr_flags

Definition at line 123 of file ip6proto.h.

◆ pr_protocol

short ip6protosw::pr_protocol

Definition at line 122 of file ip6proto.h.

◆ pr_type

short ip6protosw::pr_type

Definition at line 120 of file ip6proto.h.

◆ pr_usrreqs

struct pr_usrreqs* ip6protosw::pr_usrreqs

Definition at line 150 of file ip6proto.h.


Watt-32 tcp/ip: ip6q Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6q Struct Reference
Collaboration diagram for ip6q:
[legend]

Data Fields

u_int32_t | ip6q_head
u_int16_t | ip6q_len
u_int8_t | ip6q_nxt
u_int8_t | ip6q_hlim
struct ip6asfrag * | ip6q_down
struct ip6asfrag * | ip6q_up
u_int32_t | ip6q_ident
u_int8_t | ip6q_arrive
u_int8_t | ip6q_ttl
struct in6_addr ip6q_src | ip6q_dst
struct ip6q * | ip6q_next
struct ip6q * | ip6q_prev
int | ip6q_unfrglen
u_char * | ip6q_nxtp

Detailed Description

Definition at line 82 of file ip6_var.h.

Field Documentation

◆ ip6q_arrive

u_int8_t ip6q::ip6q_arrive

Definition at line 90 of file ip6_var.h.

◆ ip6q_down

struct ip6asfrag* ip6q::ip6q_down

Definition at line 87 of file ip6_var.h.

◆ ip6q_dst

struct in6_addr ip6q_src ip6q::ip6q_dst

Definition at line 92 of file ip6_var.h.

◆ ip6q_head

u_int32_t ip6q::ip6q_head

Definition at line 83 of file ip6_var.h.

◆ ip6q_hlim

u_int8_t ip6q::ip6q_hlim

Definition at line 86 of file ip6_var.h.

◆ ip6q_ident

u_int32_t ip6q::ip6q_ident

Definition at line 89 of file ip6_var.h.

◆ ip6q_len

u_int16_t ip6q::ip6q_len

Definition at line 84 of file ip6_var.h.

◆ ip6q_next

struct ip6q* ip6q::ip6q_next

Definition at line 93 of file ip6_var.h.

◆ ip6q_nxt

u_int8_t ip6q::ip6q_nxt

Definition at line 85 of file ip6_var.h.

◆ ip6q_nxtp

u_char* ip6q::ip6q_nxtp

Definition at line 97 of file ip6_var.h.

◆ ip6q_prev

struct ip6q* ip6q::ip6q_prev

Definition at line 94 of file ip6_var.h.

◆ ip6q_ttl

u_int8_t ip6q::ip6q_ttl

Definition at line 91 of file ip6_var.h.

◆ ip6q_unfrglen

int ip6q::ip6q_unfrglen

Definition at line 95 of file ip6_var.h.

◆ ip6q_up

struct ip6asfrag* ip6q::ip6q_up

Definition at line 88 of file ip6_var.h.


Watt-32 tcp/ip: ip6stat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip6stat Struct Reference
Collaboration diagram for ip6stat:
[legend]

Data Fields

u_quad_t | ip6s_total
u_quad_t | ip6s_tooshort
u_quad_t | ip6s_toosmall
u_quad_t | ip6s_fragments
u_quad_t | ip6s_fragdropped
u_quad_t | ip6s_fragtimeout
u_quad_t | ip6s_fragoverflow
u_quad_t | ip6s_forward
u_quad_t | ip6s_cantforward
u_quad_t | ip6s_redirectsent
u_quad_t | ip6s_delivered
u_quad_t | ip6s_localout
u_quad_t | ip6s_odropped
u_quad_t | ip6s_reassembled
u_quad_t | ip6s_fragmented
u_quad_t | ip6s_ofragments
u_quad_t | ip6s_cantfrag
u_quad_t | ip6s_badoptions
u_quad_t | ip6s_noroute
u_quad_t | ip6s_badvers
u_quad_t | ip6s_rawout
u_quad_t | ip6s_badscope
u_quad_t | ip6s_notmember
u_quad_t | ip6s_nxthist [256]
u_quad_t | ip6s_m1
u_quad_t | ip6s_m2m [32]
u_quad_t | ip6s_mext1
u_quad_t | ip6s_mext2m
u_quad_t | ip6s_exthdrtoolong
u_quad_t | ip6s_nogif
u_quad_t | ip6s_toomanyhdr
u_quad_t | ip6s_sources_none
u_quad_t | ip6s_sources_sameif [16]
u_quad_t | ip6s_sources_otherif [16]
u_quad_t | ip6s_sources_samescope [16]
u_quad_t | ip6s_sources_otherscope [16]
u_quad_t | ip6s_sources_deprecated [16]
u_quad_t | ip6s_forward_cachehit
u_quad_t | ip6s_forward_cachemiss

Detailed Description

Definition at line 174 of file ip6_var.h.

Field Documentation

◆ ip6s_badoptions

u_quad_t ip6stat::ip6s_badoptions

Definition at line 192 of file ip6_var.h.

◆ ip6s_badscope

u_quad_t ip6stat::ip6s_badscope

Definition at line 196 of file ip6_var.h.

◆ ip6s_badvers

u_quad_t ip6stat::ip6s_badvers

Definition at line 194 of file ip6_var.h.

◆ ip6s_cantforward

u_quad_t ip6stat::ip6s_cantforward

Definition at line 183 of file ip6_var.h.

◆ ip6s_cantfrag

u_quad_t ip6stat::ip6s_cantfrag

Definition at line 191 of file ip6_var.h.

◆ ip6s_delivered

u_quad_t ip6stat::ip6s_delivered

Definition at line 185 of file ip6_var.h.

◆ ip6s_exthdrtoolong

u_quad_t ip6stat::ip6s_exthdrtoolong

Definition at line 203 of file ip6_var.h.

◆ ip6s_forward

u_quad_t ip6stat::ip6s_forward

Definition at line 182 of file ip6_var.h.

◆ ip6s_forward_cachehit

u_quad_t ip6stat::ip6s_forward_cachehit

Definition at line 231 of file ip6_var.h.

◆ ip6s_forward_cachemiss

u_quad_t ip6stat::ip6s_forward_cachemiss

Definition at line 232 of file ip6_var.h.

◆ ip6s_fragdropped

u_quad_t ip6stat::ip6s_fragdropped

Definition at line 179 of file ip6_var.h.

◆ ip6s_fragmented

u_quad_t ip6stat::ip6s_fragmented

Definition at line 189 of file ip6_var.h.

◆ ip6s_fragments

u_quad_t ip6stat::ip6s_fragments

Definition at line 178 of file ip6_var.h.

◆ ip6s_fragoverflow

u_quad_t ip6stat::ip6s_fragoverflow

Definition at line 181 of file ip6_var.h.

◆ ip6s_fragtimeout

u_quad_t ip6stat::ip6s_fragtimeout

Definition at line 180 of file ip6_var.h.

◆ ip6s_localout

u_quad_t ip6stat::ip6s_localout

Definition at line 186 of file ip6_var.h.

◆ ip6s_m1

u_quad_t ip6stat::ip6s_m1

Definition at line 199 of file ip6_var.h.

◆ ip6s_m2m

u_quad_t ip6stat::ip6s_m2m[32]

Definition at line 200 of file ip6_var.h.

◆ ip6s_mext1

u_quad_t ip6stat::ip6s_mext1

Definition at line 201 of file ip6_var.h.

◆ ip6s_mext2m

u_quad_t ip6stat::ip6s_mext2m

Definition at line 202 of file ip6_var.h.

◆ ip6s_nogif

u_quad_t ip6stat::ip6s_nogif

Definition at line 204 of file ip6_var.h.

◆ ip6s_noroute

u_quad_t ip6stat::ip6s_noroute

Definition at line 193 of file ip6_var.h.

◆ ip6s_notmember

u_quad_t ip6stat::ip6s_notmember

Definition at line 197 of file ip6_var.h.

◆ ip6s_nxthist

u_quad_t ip6stat::ip6s_nxthist[256]

Definition at line 198 of file ip6_var.h.

◆ ip6s_odropped

u_quad_t ip6stat::ip6s_odropped

Definition at line 187 of file ip6_var.h.

◆ ip6s_ofragments

u_quad_t ip6stat::ip6s_ofragments

Definition at line 190 of file ip6_var.h.

◆ ip6s_rawout

u_quad_t ip6stat::ip6s_rawout

Definition at line 195 of file ip6_var.h.

◆ ip6s_reassembled

u_quad_t ip6stat::ip6s_reassembled

Definition at line 188 of file ip6_var.h.

◆ ip6s_redirectsent

u_quad_t ip6stat::ip6s_redirectsent

Definition at line 184 of file ip6_var.h.

◆ ip6s_sources_deprecated

u_quad_t ip6stat::ip6s_sources_deprecated[16]

Definition at line 229 of file ip6_var.h.

◆ ip6s_sources_none

u_quad_t ip6stat::ip6s_sources_none

Definition at line 213 of file ip6_var.h.

◆ ip6s_sources_otherif

u_quad_t ip6stat::ip6s_sources_otherif[16]

Definition at line 217 of file ip6_var.h.

◆ ip6s_sources_otherscope

u_quad_t ip6stat::ip6s_sources_otherscope[16]

Definition at line 227 of file ip6_var.h.

◆ ip6s_sources_sameif

u_quad_t ip6stat::ip6s_sources_sameif[16]

Definition at line 215 of file ip6_var.h.

◆ ip6s_sources_samescope

u_quad_t ip6stat::ip6s_sources_samescope[16]

Definition at line 222 of file ip6_var.h.

◆ ip6s_toomanyhdr

u_quad_t ip6stat::ip6s_toomanyhdr

Definition at line 205 of file ip6_var.h.

◆ ip6s_tooshort

u_quad_t ip6stat::ip6s_tooshort

Definition at line 176 of file ip6_var.h.

◆ ip6s_toosmall

u_quad_t ip6stat::ip6s_toosmall

Definition at line 177 of file ip6_var.h.

◆ ip6s_total

u_quad_t ip6stat::ip6s_total

Definition at line 175 of file ip6_var.h.


Watt-32 tcp/ip: ip_fw Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip_fw Struct Reference
Collaboration diagram for ip_fw:
[legend]

Data Fields

u_long | fw_pcnt
u_long | fw_bcnt
struct in_addr fw_src | fw_dst
struct in_addr fw_smsk | fw_dmsk
union {
struct in_addr fu_via_ip
struct {
char fu_via_name [FW_IFNLEN]
short fu_via_unit
} fu_via_if
} fu_via_un
u_short | fw_number
u_short | fw_flg
u_short | fw_nsp
u_short | fw_ndp
u_short | fw_pts [IP_FW_MAX_PORTS]
u_char | fw_ipopt
u_char | fw_ipnopt
u_char | fw_tcpf
u_char | fw_tcpnf
unsigned | fw_icmptypes [IP_FW_ICMPTYPES_DIM]
long | timestamp
u_short | fw_divert_port
u_char | fw_prot

Detailed Description

Definition at line 33 of file ip_fw.h.

Field Documentation

◆ fu_via_ip

struct in_addr ip_fw::fu_via_ip

Definition at line 38 of file ip_fw.h.

◆ fu_via_name

char ip_fw::fu_via_name[FW_IFNLEN]

Definition at line 41 of file ip_fw.h.

◆ fu_via_unit

short ip_fw::fu_via_unit

Definition at line 42 of file ip_fw.h.

◆ fw_bcnt

u_long ip_fw::fw_bcnt

Definition at line 34 of file ip_fw.h.

◆ fw_divert_port

u_short ip_fw::fw_divert_port

Definition at line 61 of file ip_fw.h.

◆ fw_dmsk

struct in_addr fw_smsk ip_fw::fw_dmsk

Definition at line 36 of file ip_fw.h.

◆ fw_dst

struct in_addr fw_src ip_fw::fw_dst

Definition at line 35 of file ip_fw.h.

◆ fw_flg

u_short ip_fw::fw_flg

Definition at line 49 of file ip_fw.h.

◆ fw_icmptypes

unsigned ip_fw::fw_icmptypes[IP_FW_ICMPTYPES_DIM]

Definition at line 59 of file ip_fw.h.

◆ fw_ipnopt

u_char ip_fw::fw_ipnopt

Definition at line 56 of file ip_fw.h.

◆ fw_ipopt

u_char ip_fw::fw_ipopt

Definition at line 56 of file ip_fw.h.

◆ fw_ndp

u_short ip_fw::fw_ndp

Definition at line 50 of file ip_fw.h.

◆ fw_nsp

u_short ip_fw::fw_nsp

Definition at line 50 of file ip_fw.h.

◆ fw_number

u_short ip_fw::fw_number

Definition at line 48 of file ip_fw.h.

◆ fw_pcnt

u_long ip_fw::fw_pcnt

Definition at line 34 of file ip_fw.h.

◆ fw_prot

u_char ip_fw::fw_prot

Definition at line 62 of file ip_fw.h.

◆ fw_pts

u_short ip_fw::fw_pts[IP_FW_MAX_PORTS]

Definition at line 55 of file ip_fw.h.

◆ fw_tcpf

u_char ip_fw::fw_tcpf

Definition at line 57 of file ip_fw.h.

◆ fw_tcpnf

u_char ip_fw::fw_tcpnf

Definition at line 57 of file ip_fw.h.

◆ timestamp

long ip_fw::timestamp

Definition at line 60 of file ip_fw.h.


Watt-32 tcp/ip: ip_fw_chain Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
ip_fw_chain Struct Reference
Collaboration diagram for ip_fw_chain:
[legend]

Public Member Functions

LIST_ENTRY (ip_fw_chain) chain

Data Fields

struct ip_fw * rule

Detailed Description

Definition at line 65 of file ip_fw.h.

Field Documentation

◆ rule

struct ip_fw* ip_fw_chain::rule

Definition at line 67 of file ip_fw.h.


Watt-32 tcp/ip: ip_moptions Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip_moptions Struct Reference
Collaboration diagram for ip_moptions:
[legend]

Data Fields

struct ifnet * | imo_multicast_ifp
u_char | imo_multicast_ttl
u_char | imo_multicast_loop
u_short | imo_num_memberships
struct in_multi * | imo_membership [IP_MAX_MEMBERSHIPS]
u_long | imo_multicast_vif

Detailed Description

Definition at line 125 of file ip_var.h.

Field Documentation

◆ imo_membership

struct in_multi* ip_moptions::imo_membership[IP_MAX_MEMBERSHIPS]

Definition at line 130 of file ip_var.h.

◆ imo_multicast_ifp

struct ifnet* ip_moptions::imo_multicast_ifp

Definition at line 126 of file ip_var.h.

◆ imo_multicast_loop

u_char ip_moptions::imo_multicast_loop

Definition at line 128 of file ip_var.h.

◆ imo_multicast_ttl

u_char ip_moptions::imo_multicast_ttl

Definition at line 127 of file ip_var.h.

◆ imo_multicast_vif

u_long ip_moptions::imo_multicast_vif

Definition at line 131 of file ip_var.h.

◆ imo_num_memberships

u_short ip_moptions::imo_num_memberships

Definition at line 129 of file ip_var.h.


Watt-32 tcp/ip: ip_mreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip_mreq Struct Reference
Collaboration diagram for ip_mreq:
[legend]

Data Fields

struct in_addr | imr_multiaddr
struct in_addr | imr_interface

Detailed Description

Definition at line 317 of file in.h.

Field Documentation

◆ imr_interface

struct in_addr ip_mreq::imr_interface

Definition at line 319 of file in.h.

◆ imr_multiaddr

struct in_addr ip_mreq::imr_multiaddr

Definition at line 318 of file in.h.


Watt-32 tcp/ip: ip_opts Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip_opts Struct Reference
Collaboration diagram for ip_opts:
[legend]

Data Fields

struct in_addr | ip_dst
char | IP_opts [40]

Detailed Description

Definition at line 270 of file in.h.

Field Documentation

◆ ip_dst

struct in_addr ip_opts::ip_dst

Definition at line 271 of file in.h.

◆ IP_opts

char ip_opts::IP_opts[40]

Definition at line 272 of file in.h.


Watt-32 tcp/ip: ip_Packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ip_Packet Struct Reference

#include <wattcp.h>

Collaboration diagram for ip_Packet:
[legend]

Data Fields

in_Header head
BYTE data [MAX_IP4_DATA]

Detailed Description

IPv4 packet including header and data.

Definition at line 396 of file wattcp.h.

Field Documentation

◆ data

BYTE ip_Packet::data[MAX_IP4_DATA]

Definition at line 398 of file wattcp.h.

◆ head

in_Header ip_Packet::head

Definition at line 397 of file wattcp.h.


Watt-32 tcp/ip: ip_timestamp Struct Reference

  • Data Structure Index
  • Data Fields
Data Structures | Data Fields
ip_timestamp Struct Reference
Collaboration diagram for ip_timestamp:
[legend]

Data Structures

union ipt_timestamp

Data Fields

u_char | ipt_code
u_char | ipt_len
u_char | ipt_ptr
u_char | ipt_flg:4
u_char | ipt_oflw:4
union ip_timestamp::ipt_timestamp | ipt_timestamp

Detailed Description

Definition at line 151 of file ip.h.

Field Documentation

◆ ipt_code

u_char ip_timestamp::ipt_code

Definition at line 152 of file ip.h.

◆ ipt_flg

u_char ip_timestamp::ipt_flg

Definition at line 155 of file ip.h.

◆ ipt_len

u_char ip_timestamp::ipt_len

Definition at line 153 of file ip.h.

◆ ipt_oflw

u_char ip_timestamp::ipt_oflw

Definition at line 156 of file ip.h.

◆ ipt_ptr

u_char ip_timestamp::ipt_ptr

Definition at line 154 of file ip.h.


Watt-32 tcp/ip: ip_timestamp::ipt_timestamp Union Reference

  • Data Structure Index
  • Data Fields
  • ip_timestamp
  • ipt_timestamp
Data Structures | Data Fields
ip_timestamp::ipt_timestamp Union Reference
Collaboration diagram for ip_timestamp::ipt_timestamp:
[legend]

Data Structures

struct ipt_ta

Data Fields

n_long | ipt_time [1]
struct ip_timestamp::ipt_timestamp::ipt_ta | ipt_ta [1]

Detailed Description

Definition at line 157 of file ip.h.

Field Documentation

◆ ipt_time

n_long ip_timestamp::ipt_timestamp::ipt_time[1]

Definition at line 158 of file ip.h.


Watt-32 tcp/ip: ip_timestamp::ipt_timestamp::ipt_ta Struct Reference

  • Data Structure Index
  • Data Fields
  • ip_timestamp
  • ipt_timestamp
  • ipt_ta
Data Fields
ip_timestamp::ipt_timestamp::ipt_ta Struct Reference
Collaboration diagram for ip_timestamp::ipt_timestamp::ipt_ta:
[legend]

Data Fields

struct in_addr | ipt_addr
n_long | ipt_time

Detailed Description

Definition at line 159 of file ip.h.

Field Documentation

◆ ipt_addr

struct in_addr ip_timestamp::ipt_timestamp::ipt_ta::ipt_addr

Definition at line 160 of file ip.h.

◆ ipt_time

n_long ip_timestamp::ipt_timestamp::ipt_ta::ipt_time

Definition at line 161 of file ip.h.


Watt-32 tcp/ip: ipasfrag Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipasfrag Struct Reference
Collaboration diagram for ipasfrag:
[legend]

Data Fields

u_char | ip_hl:4
u_char | ip_v:4
u_char | ipf_mff
u_short | ip_len
u_short | ip_id
u_short | ip_off
u_char | ip_ttl
u_char | ip_p
u_short | ip_sum
struct ipasfrag * | ipf_next
struct ipasfrag * | ipf_prev

Detailed Description

Definition at line 69 of file ip_var.h.

Field Documentation

◆ ip_hl

u_char ipasfrag::ip_hl

Definition at line 70 of file ip_var.h.

◆ ip_id

u_short ipasfrag::ip_id

Definition at line 76 of file ip_var.h.

◆ ip_len

u_short ipasfrag::ip_len

Definition at line 75 of file ip_var.h.

◆ ip_off

u_short ipasfrag::ip_off

Definition at line 77 of file ip_var.h.

◆ ip_p

u_char ipasfrag::ip_p

Definition at line 79 of file ip_var.h.

◆ ip_sum

u_short ipasfrag::ip_sum

Definition at line 80 of file ip_var.h.

◆ ip_ttl

u_char ipasfrag::ip_ttl

Definition at line 78 of file ip_var.h.

◆ ip_v

u_char ipasfrag::ip_v

Definition at line 71 of file ip_var.h.

◆ ipf_mff

u_char ipasfrag::ipf_mff

Definition at line 72 of file ip_var.h.

◆ ipf_next

struct ipasfrag* ipasfrag::ipf_next

Definition at line 81 of file ip_var.h.

◆ ipf_prev

struct ipasfrag* ipasfrag::ipf_prev

Definition at line 82 of file ip_var.h.


Watt-32 tcp/ip: ipcomp Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipcomp Struct Reference
Collaboration diagram for ipcomp:
[legend]

Data Fields

u_int8_t | comp_nxt
u_int8_t | comp_flags
u_int16_t | comp_cpi

Detailed Description

Definition at line 44 of file ipcomp.h.

Field Documentation

◆ comp_cpi

u_int16_t ipcomp::comp_cpi

Definition at line 47 of file ipcomp.h.

◆ comp_flags

u_int8_t ipcomp::comp_flags

Definition at line 46 of file ipcomp.h.

◆ comp_nxt

u_int8_t ipcomp::comp_nxt

Definition at line 45 of file ipcomp.h.


Watt-32 tcp/ip: ipcomp_algorithm Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipcomp_algorithm Struct Reference
Collaboration diagram for ipcomp_algorithm:
[legend]

Data Fields

int(* | compress )(struct mbuf *, struct mbuf *, size_t *)
int(* | decompress )(struct mbuf *, struct mbuf *, size_t *)
size_t | minplen

Detailed Description

Definition at line 60 of file ipcomp.h.

Field Documentation

◆ compress

int(* ipcomp_algorithm::compress) (struct mbuf *, struct mbuf *, size_t *)

Definition at line 61 of file ipcomp.h.

◆ decompress

int(* ipcomp_algorithm::decompress) (struct mbuf *, struct mbuf *, size_t *)

Definition at line 62 of file ipcomp.h.

◆ minplen

size_t ipcomp_algorithm::minplen

Definition at line 63 of file ipcomp.h.


Watt-32 tcp/ip: ipoption Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipoption Struct Reference
Collaboration diagram for ipoption:
[legend]

Data Fields

struct in_addr | ipopt_dst
char | ipopt_list [MAX_IPOPTLEN]

Detailed Description

Definition at line 116 of file ip_var.h.

Field Documentation

◆ ipopt_dst

struct in_addr ipoption::ipopt_dst

Definition at line 117 of file ip_var.h.

◆ ipopt_list

char ipoption::ipopt_list[MAX_IPOPTLEN]

Definition at line 118 of file ip_var.h.


Watt-32 tcp/ip: ipsec_history Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipsec_history Struct Reference
Collaboration diagram for ipsec_history:
[legend]

Data Fields

int | ih_proto
u_int32_t | ih_spi

Detailed Description

Definition at line 280 of file ipsec.h.

Field Documentation

◆ ih_proto

int ipsec_history::ih_proto

Definition at line 281 of file ipsec.h.

◆ ih_spi

u_int32_t ipsec_history::ih_spi

Definition at line 282 of file ipsec.h.


Watt-32 tcp/ip: ipsec_output_state Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipsec_output_state Struct Reference
Collaboration diagram for ipsec_output_state:
[legend]

Data Fields

struct mbuf * | m
struct route * | ro
struct sockaddr * | dst

Detailed Description

Definition at line 274 of file ipsec.h.

Field Documentation

◆ dst

struct sockaddr* ipsec_output_state::dst

Definition at line 277 of file ipsec.h.

◆ m

struct mbuf* ipsec_output_state::m

Definition at line 275 of file ipsec.h.

◆ ro

struct route* ipsec_output_state::ro

Definition at line 276 of file ipsec.h.


Watt-32 tcp/ip: ipsecrequest Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipsecrequest Struct Reference
Collaboration diagram for ipsecrequest:
[legend]

Data Fields

struct ipsecrequest * | next
struct secasindex | saidx
u_int | level
struct secasvar * | sav
struct secpolicy * | sp

Detailed Description

Definition at line 102 of file ipsec.h.

Field Documentation

◆ level

u_int ipsecrequest::level

Definition at line 108 of file ipsec.h.

◆ next

struct ipsecrequest* ipsecrequest::next

Definition at line 103 of file ipsec.h.

◆ saidx

struct secasindex ipsecrequest::saidx

Definition at line 106 of file ipsec.h.

◆ sav

struct secasvar* ipsecrequest::sav

Definition at line 110 of file ipsec.h.

◆ sp

struct secpolicy* ipsecrequest::sp

Definition at line 111 of file ipsec.h.


Watt-32 tcp/ip: ipsecstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipsecstat Struct Reference
Collaboration diagram for ipsecstat:
[legend]

Data Fields

u_quad_t | in_success
u_quad_t | in_polvio
u_quad_t | in_nosa
u_quad_t | in_inval
u_quad_t | in_nomem
u_quad_t | in_badspi
u_quad_t | in_ahreplay
u_quad_t | in_espreplay
u_quad_t | in_ahauthsucc
u_quad_t | in_ahauthfail
u_quad_t | in_espauthsucc
u_quad_t | in_espauthfail
u_quad_t | in_esphist [256]
u_quad_t | in_ahhist [256]
u_quad_t | in_comphist [256]
u_quad_t | out_success
u_quad_t | out_polvio
u_quad_t | out_nosa
u_quad_t | out_inval
u_quad_t | out_nomem
u_quad_t | out_noroute
u_quad_t | out_esphist [256]
u_quad_t | out_ahhist [256]
u_quad_t | out_comphist [256]

Detailed Description

Definition at line 187 of file ipsec.h.

Field Documentation

◆ in_ahauthfail

u_quad_t ipsecstat::in_ahauthfail

Definition at line 198 of file ipsec.h.

◆ in_ahauthsucc

u_quad_t ipsecstat::in_ahauthsucc

Definition at line 197 of file ipsec.h.

◆ in_ahhist

u_quad_t ipsecstat::in_ahhist[256]

Definition at line 202 of file ipsec.h.

◆ in_ahreplay

u_quad_t ipsecstat::in_ahreplay

Definition at line 195 of file ipsec.h.

◆ in_badspi

u_quad_t ipsecstat::in_badspi

Definition at line 194 of file ipsec.h.

◆ in_comphist

u_quad_t ipsecstat::in_comphist[256]

Definition at line 203 of file ipsec.h.

◆ in_espauthfail

u_quad_t ipsecstat::in_espauthfail

Definition at line 200 of file ipsec.h.

◆ in_espauthsucc

u_quad_t ipsecstat::in_espauthsucc

Definition at line 199 of file ipsec.h.

◆ in_esphist

u_quad_t ipsecstat::in_esphist[256]

Definition at line 201 of file ipsec.h.

◆ in_espreplay

u_quad_t ipsecstat::in_espreplay

Definition at line 196 of file ipsec.h.

◆ in_inval

u_quad_t ipsecstat::in_inval

Definition at line 192 of file ipsec.h.

◆ in_nomem

u_quad_t ipsecstat::in_nomem

Definition at line 193 of file ipsec.h.

◆ in_nosa

u_quad_t ipsecstat::in_nosa

Definition at line 191 of file ipsec.h.

◆ in_polvio

u_quad_t ipsecstat::in_polvio

Definition at line 189 of file ipsec.h.

◆ in_success

u_quad_t ipsecstat::in_success

Definition at line 188 of file ipsec.h.

◆ out_ahhist

u_quad_t ipsecstat::out_ahhist[256]

Definition at line 212 of file ipsec.h.

◆ out_comphist

u_quad_t ipsecstat::out_comphist[256]

Definition at line 213 of file ipsec.h.

◆ out_esphist

u_quad_t ipsecstat::out_esphist[256]

Definition at line 211 of file ipsec.h.

◆ out_inval

u_quad_t ipsecstat::out_inval

Definition at line 208 of file ipsec.h.

◆ out_nomem

u_quad_t ipsecstat::out_nomem

Definition at line 209 of file ipsec.h.

◆ out_noroute

u_quad_t ipsecstat::out_noroute

Definition at line 210 of file ipsec.h.

◆ out_nosa

u_quad_t ipsecstat::out_nosa

Definition at line 207 of file ipsec.h.

◆ out_polvio

u_quad_t ipsecstat::out_polvio

Definition at line 205 of file ipsec.h.

◆ out_success

u_quad_t ipsecstat::out_success

Definition at line 204 of file ipsec.h.


Watt-32 tcp/ip: ipstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipstat Struct Reference
Collaboration diagram for ipstat:
[legend]

Data Fields

u_long | ips_total
u_long | ips_badsum
u_long | ips_tooshort
u_long | ips_toosmall
u_long | ips_badhlen
u_long | ips_badlen
u_long | ips_fragments
u_long | ips_fragdropped
u_long | ips_fragtimeout
u_long | ips_forward
u_long | ips_cantforward
u_long | ips_redirectsent
u_long | ips_noproto
u_long | ips_delivered
u_long | ips_localout
u_long | ips_odropped
u_long | ips_idropped
u_long | ips_reassembled
u_long | ips_fragmented
u_long | ips_ofragments
u_long | ips_cantfrag
u_long | ips_badoptions
u_long | ips_noroute
u_long | ips_badvers
u_long | ips_rawout
u_long | ips_toolong

Detailed Description

Definition at line 134 of file ip_var.h.

Field Documentation

◆ ips_badhlen

u_long ipstat::ips_badhlen

Definition at line 139 of file ip_var.h.

◆ ips_badlen

u_long ipstat::ips_badlen

Definition at line 140 of file ip_var.h.

◆ ips_badoptions

u_long ipstat::ips_badoptions

Definition at line 156 of file ip_var.h.

◆ ips_badsum

u_long ipstat::ips_badsum

Definition at line 136 of file ip_var.h.

◆ ips_badvers

u_long ipstat::ips_badvers

Definition at line 158 of file ip_var.h.

◆ ips_cantforward

u_long ipstat::ips_cantforward

Definition at line 145 of file ip_var.h.

◆ ips_cantfrag

u_long ipstat::ips_cantfrag

Definition at line 155 of file ip_var.h.

◆ ips_delivered

u_long ipstat::ips_delivered

Definition at line 148 of file ip_var.h.

◆ ips_forward

u_long ipstat::ips_forward

Definition at line 144 of file ip_var.h.

◆ ips_fragdropped

u_long ipstat::ips_fragdropped

Definition at line 142 of file ip_var.h.

◆ ips_fragmented

u_long ipstat::ips_fragmented

Definition at line 153 of file ip_var.h.

◆ ips_fragments

u_long ipstat::ips_fragments

Definition at line 141 of file ip_var.h.

◆ ips_fragtimeout

u_long ipstat::ips_fragtimeout

Definition at line 143 of file ip_var.h.

◆ ips_idropped

u_long ipstat::ips_idropped

Definition at line 151 of file ip_var.h.

◆ ips_localout

u_long ipstat::ips_localout

Definition at line 149 of file ip_var.h.

◆ ips_noproto

u_long ipstat::ips_noproto

Definition at line 147 of file ip_var.h.

◆ ips_noroute

u_long ipstat::ips_noroute

Definition at line 157 of file ip_var.h.

◆ ips_odropped

u_long ipstat::ips_odropped

Definition at line 150 of file ip_var.h.

◆ ips_ofragments

u_long ipstat::ips_ofragments

Definition at line 154 of file ip_var.h.

◆ ips_rawout

u_long ipstat::ips_rawout

Definition at line 159 of file ip_var.h.

◆ ips_reassembled

u_long ipstat::ips_reassembled

! new, lost in packets due to nobufs, etc.

Definition at line 152 of file ip_var.h.

◆ ips_redirectsent

u_long ipstat::ips_redirectsent

Definition at line 146 of file ip_var.h.

◆ ips_toolong

u_long ipstat::ips_toolong

Definition at line 160 of file ip_var.h.

◆ ips_tooshort

u_long ipstat::ips_tooshort

Definition at line 137 of file ip_var.h.

◆ ips_toosmall

u_long ipstat::ips_toosmall

Definition at line 138 of file ip_var.h.

◆ ips_total

u_long ipstat::ips_total

Definition at line 135 of file ip_var.h.


Watt-32 tcp/ip: ipv6_fraghdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipv6_fraghdr Struct Reference
Collaboration diagram for ipv6_fraghdr:
[legend]

Data Fields

unsigned char | nexthdr
unsigned char | reserved
unsigned short | frag_off
unsigned long | identification

Detailed Description

Definition at line 160 of file ipv6.h.

Field Documentation

◆ frag_off

unsigned short ipv6_fraghdr::frag_off

Definition at line 163 of file ipv6.h.

◆ identification

unsigned long ipv6_fraghdr::identification

Definition at line 164 of file ipv6.h.

◆ nexthdr

unsigned char ipv6_fraghdr::nexthdr

Definition at line 161 of file ipv6.h.

◆ reserved

unsigned char ipv6_fraghdr::reserved

Definition at line 162 of file ipv6.h.


Watt-32 tcp/ip: ipv6_mreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipv6_mreq Struct Reference
Collaboration diagram for ipv6_mreq:
[legend]

Data Fields

struct in6_addr | ipv6mr_multiaddr
unsigned long | ipv6mr_interface
unsigned int | ipv6mr_interface

Detailed Description

Definition at line 255 of file in.h.

Field Documentation

◆ ipv6mr_interface [1/2]

unsigned long ipv6_mreq::ipv6mr_interface

Definition at line 260 of file in.h.

◆ ipv6mr_interface [2/2]

unsigned int ipv6_mreq::ipv6mr_interface

Definition at line 350 of file in6.h.

◆ ipv6mr_multiaddr

struct in6_addr ipv6_mreq::ipv6mr_multiaddr

Definition at line 257 of file in.h.


Watt-32 tcp/ip: ipv6_options Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipv6_options Struct Reference
Collaboration diagram for ipv6_options:
[legend]

Data Fields

unsigned short | opt_flen
unsigned short | opt_nflen
struct ipv6_rt_hdr * | srcrt

Detailed Description

Definition at line 56 of file ipv6.h.

Field Documentation

◆ opt_flen

unsigned short ipv6_options::opt_flen

Definition at line 58 of file ipv6.h.

◆ opt_nflen

unsigned short ipv6_options::opt_nflen

Definition at line 59 of file ipv6.h.

◆ srcrt

struct ipv6_rt_hdr* ipv6_options::srcrt

Definition at line 64 of file ipv6.h.


Watt-32 tcp/ip: ipv6_rt0_hdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipv6_rt0_hdr Struct Reference
Collaboration diagram for ipv6_rt0_hdr:
[legend]

Data Fields

struct ipv6_rt_hdr | rt_hdr
unsigned long | bitmap
struct in6_addr | addr [0]

Detailed Description

Definition at line 98 of file ipv6.h.

Field Documentation

◆ addr

struct in6_addr ipv6_rt0_hdr::addr[0]

Definition at line 102 of file ipv6.h.

◆ bitmap

unsigned long ipv6_rt0_hdr::bitmap

Definition at line 100 of file ipv6.h.

◆ rt_hdr

struct ipv6_rt_hdr ipv6_rt0_hdr::rt_hdr

Definition at line 99 of file ipv6.h.


Watt-32 tcp/ip: ipv6_rt_hdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ipv6_rt_hdr Struct Reference
Collaboration diagram for ipv6_rt_hdr:
[legend]

Data Fields

unsigned char | nexthdr
unsigned char | hdrlen
unsigned char | type
unsigned char | segments_left

Detailed Description

Definition at line 84 of file ipv6.h.

Field Documentation

◆ hdrlen

unsigned char ipv6_rt_hdr::hdrlen

Definition at line 86 of file ipv6.h.

◆ nexthdr

unsigned char ipv6_rt_hdr::nexthdr

Definition at line 85 of file ipv6.h.

◆ segments_left

unsigned char ipv6_rt_hdr::segments_left

Definition at line 88 of file ipv6.h.

◆ type

unsigned char ipv6_rt_hdr::type

Definition at line 87 of file ipv6.h.


Watt-32 tcp/ip: IREGS Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
IREGS Struct Reference
Collaboration diagram for IREGS:
[legend]

Data Fields

WORD | r_ax
WORD | r_bx
WORD | r_cx
WORD | r_dx
WORD | r_bp
WORD | r_si
WORD | r_di
WORD | r_ds
WORD | r_es
WORD | r_flags

Detailed Description

Definition at line 610 of file misc.h.

Field Documentation

◆ r_ax

WORD IREGS::r_ax

Definition at line 611 of file misc.h.

◆ r_bp

WORD IREGS::r_bp

Definition at line 611 of file misc.h.

◆ r_bx

WORD IREGS::r_bx

Definition at line 611 of file misc.h.

◆ r_cx

WORD IREGS::r_cx

Definition at line 611 of file misc.h.

◆ r_di

WORD IREGS::r_di

Definition at line 612 of file misc.h.

◆ r_ds

WORD IREGS::r_ds

Definition at line 612 of file misc.h.

◆ r_dx

WORD IREGS::r_dx

Definition at line 611 of file misc.h.

◆ r_es

WORD IREGS::r_es

Definition at line 612 of file misc.h.

◆ r_flags

WORD IREGS::r_flags

Definition at line 612 of file misc.h.

◆ r_si

WORD IREGS::r_si

Definition at line 612 of file misc.h.


Watt-32 tcp/ip: itimerval Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
itimerval Struct Reference
Collaboration diagram for itimerval:
[legend]

Data Fields

struct timeval | it_interval
struct timeval | it_value

Detailed Description

Definition at line 75 of file wtime.h.

Field Documentation

◆ it_interval

struct timeval itimerval::it_interval

Definition at line 76 of file wtime.h.

◆ it_value

struct timeval itimerval::it_value

Definition at line 77 of file wtime.h.


Watt-32 tcp/ip: Language Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
Language Struct Reference
Collaboration diagram for Language:
[legend]

Data Fields

struct Node * | list
struct Elem * | array
char | prefix [4]
size_t | entries
unsigned | line

Detailed Description

Definition at line 847 of file lang.c.

Field Documentation

◆ array

struct Elem* Language::array

Definition at line 849 of file lang.c.

◆ entries

size_t Language::entries

Definition at line 851 of file lang.c.

◆ line

unsigned Language::line

Definition at line 852 of file lang.c.

◆ list

struct Node* Language::list

Definition at line 848 of file lang.c.

◆ prefix

char Language::prefix[4]

Definition at line 850 of file lang.c.


Watt-32 tcp/ip: link_Packet Union Reference

  • Data Structure Index
  • Data Fields
Data Fields
link_Packet Union Reference
Collaboration diagram for link_Packet:
[legend]

Data Fields

struct eth_Packet | eth
struct tok_Packet | tok
struct fddi_Packet | fddi
struct arcnet_Packet | arc
struct ip_Packet | ip
struct pppoe_Packet | pppoe
struct ax25_Packet | ax25
struct vlan_Packet | vlan

Detailed Description

Definition at line 247 of file pcsed.h.

Field Documentation

◆ arc

struct arcnet_Packet link_Packet::arc

Definition at line 251 of file pcsed.h.

◆ ax25

struct ax25_Packet link_Packet::ax25

Definition at line 254 of file pcsed.h.

◆ eth

struct eth_Packet link_Packet::eth

Definition at line 248 of file pcsed.h.

◆ fddi

struct fddi_Packet link_Packet::fddi

Definition at line 250 of file pcsed.h.

◆ ip

struct ip_Packet link_Packet::ip

Definition at line 252 of file pcsed.h.

◆ pppoe

struct pppoe_Packet link_Packet::pppoe

Definition at line 253 of file pcsed.h.

◆ tok

struct tok_Packet link_Packet::tok

Definition at line 249 of file pcsed.h.

◆ vlan

struct vlan_Packet link_Packet::vlan

Definition at line 255 of file pcsed.h.


Watt-32 tcp/ip: llc_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
llc_Header Struct Reference

#include <pcsed.h>

Collaboration diagram for llc_Header:
[legend]

Data Fields

BYTE | DSAP
BYTE | SSAP
union {
BYTE u_ctl
WORD is_ctl
struct {
BYTE snap_ui
BYTE snap_pi [5]
} snap
struct {
BYTE snap_ui
BYTE snap_orgcode [3]
BYTE snap_ethertype [2]
} snap_ether
} ctl

Detailed Description

LLC header format.

Definition at line 107 of file pcsed.h.

Field Documentation

◆ DSAP

BYTE llc_Header::DSAP

Definition at line 108 of file pcsed.h.

◆ is_ctl

WORD llc_Header::is_ctl

Definition at line 112 of file pcsed.h.

◆ snap_ethertype

BYTE llc_Header::snap_ethertype[2]

Definition at line 120 of file pcsed.h.

◆ snap_orgcode

BYTE llc_Header::snap_orgcode[3]

Definition at line 119 of file pcsed.h.

◆ snap_pi

BYTE llc_Header::snap_pi[5]

Definition at line 115 of file pcsed.h.

◆ snap_ui

BYTE llc_Header::snap_ui

Definition at line 114 of file pcsed.h.

◆ SSAP

BYTE llc_Header::SSAP

Definition at line 109 of file pcsed.h.

◆ u_ctl

BYTE llc_Header::u_ctl

Definition at line 111 of file pcsed.h.


Watt-32 tcp/ip: llc_Packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
llc_Packet Struct Reference
Collaboration diagram for llc_Packet:
[legend]

Data Fields

llc_Header head
BYTE data [LLC_MAX_DATA]

Detailed Description

Definition at line 129 of file pcsed.h.

Field Documentation

◆ data

BYTE llc_Packet::data[LLC_MAX_DATA]

Definition at line 131 of file pcsed.h.

◆ head

llc_Header llc_Packet::head

Definition at line 130 of file pcsed.h.


Watt-32 tcp/ip: llinfo_nd6 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
llinfo_nd6 Struct Reference
Collaboration diagram for llinfo_nd6:
[legend]

Data Fields

struct llinfo_nd6 * | ln_next
struct llinfo_nd6 * | ln_prev
struct rtentry * | ln_rt
struct mbuf * | ln_hold
long | ln_asked
u_long | ln_expire
short | ln_state
short | ln_router
int | ln_byhint

Detailed Description

Definition at line 49 of file nd6.h.

Field Documentation

◆ ln_asked

long llinfo_nd6::ln_asked

Definition at line 54 of file nd6.h.

◆ ln_byhint

int llinfo_nd6::ln_byhint

Definition at line 58 of file nd6.h.

◆ ln_expire

u_long llinfo_nd6::ln_expire

Definition at line 55 of file nd6.h.

◆ ln_hold

struct mbuf* llinfo_nd6::ln_hold

Definition at line 53 of file nd6.h.

◆ ln_next

struct llinfo_nd6* llinfo_nd6::ln_next

Definition at line 50 of file nd6.h.

◆ ln_prev

struct llinfo_nd6* llinfo_nd6::ln_prev

Definition at line 51 of file nd6.h.

◆ ln_router

short llinfo_nd6::ln_router

Definition at line 57 of file nd6.h.

◆ ln_rt

struct rtentry* llinfo_nd6::ln_rt

Definition at line 52 of file nd6.h.

◆ ln_state

short llinfo_nd6::ln_state

Definition at line 56 of file nd6.h.


Watt-32 tcp/ip: LoadTable Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
LoadTable Struct Reference
Collaboration diagram for LoadTable:
[legend]

Data Fields

HINSTANCE | mod_handle
const TCHAR * | mod_name
const char * | func_name
void ** | func_addr

Detailed Description

Definition at line 12 of file win_dll.h.

Field Documentation

◆ func_addr

void** LoadTable::func_addr

Definition at line 16 of file win_dll.h.

◆ func_name

const char* LoadTable::func_name

Definition at line 15 of file win_dll.h.

◆ mod_handle

HINSTANCE LoadTable::mod_handle

Definition at line 13 of file win_dll.h.

◆ mod_name

const TCHAR* LoadTable::mod_name

Definition at line 14 of file win_dll.h.


Watt-32 tcp/ip: macstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
macstat Struct Reference

#include <pcstat.h>

Collaboration diagram for macstat:
[legend]

Data Fields

DWORD | non_ip_recv
DWORD | non_ip_sent
DWORD | num_tx_err
DWORD | num_tx_retry
DWORD | num_tx_timeout
DWORD | num_unk_type
DWORD | num_llc_frames
DWORD | num_wrong_handle
DWORD | num_bad_sync
DWORD | num_too_large
DWORD | num_too_small
DWORD | num_mac_loop
DWORD | num_ip_recurse
struct {
DWORD request_recv
DWORD request_sent
DWORD reply_recv
DWORD reply_sent
} arp
struct {
DWORD request_recv
DWORD request_sent
DWORD reply_recv
DWORD reply_sent
} rarp

Detailed Description

MAC-layer statistics.

Definition at line 36 of file pcstat.h.

Field Documentation

◆ non_ip_recv

DWORD macstat::non_ip_recv

Definition at line 37 of file pcstat.h.

◆ non_ip_sent

DWORD macstat::non_ip_sent

Definition at line 38 of file pcstat.h.

◆ num_bad_sync

DWORD macstat::num_bad_sync

Definition at line 45 of file pcstat.h.

◆ num_ip_recurse

DWORD macstat::num_ip_recurse

Definition at line 49 of file pcstat.h.

◆ num_llc_frames

DWORD macstat::num_llc_frames

Definition at line 43 of file pcstat.h.

◆ num_mac_loop

DWORD macstat::num_mac_loop

Definition at line 48 of file pcstat.h.

◆ num_too_large

DWORD macstat::num_too_large

Definition at line 46 of file pcstat.h.

◆ num_too_small

DWORD macstat::num_too_small

Definition at line 47 of file pcstat.h.

◆ num_tx_err

DWORD macstat::num_tx_err

Definition at line 39 of file pcstat.h.

◆ num_tx_retry

DWORD macstat::num_tx_retry

Definition at line 40 of file pcstat.h.

◆ num_tx_timeout

DWORD macstat::num_tx_timeout

Definition at line 41 of file pcstat.h.

◆ num_unk_type

DWORD macstat::num_unk_type

Definition at line 42 of file pcstat.h.

◆ num_wrong_handle

DWORD macstat::num_wrong_handle

Definition at line 44 of file pcstat.h.

◆ reply_recv

DWORD macstat::reply_recv

Definition at line 55 of file pcstat.h.

◆ reply_sent

DWORD macstat::reply_sent

Definition at line 56 of file pcstat.h.

◆ request_recv

DWORD macstat::request_recv

Definition at line 53 of file pcstat.h.

◆ request_sent

DWORD macstat::request_sent

Definition at line 54 of file pcstat.h.


Watt-32 tcp/ip: mbuf Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
mbuf Struct Reference
Collaboration diagram for mbuf:
[legend]

Data Fields

struct mbuf * | next
struct mbuf * | anext
unsigned | size
int | refcnt
struct mbuf * | dup
char * | data
unsigned | cnt

Detailed Description

Definition at line 6 of file mbuf.h.

Field Documentation

◆ anext

struct mbuf* mbuf::anext

Definition at line 8 of file mbuf.h.

◆ cnt

unsigned mbuf::cnt

Definition at line 13 of file mbuf.h.

◆ data

char* mbuf::data

Definition at line 12 of file mbuf.h.

◆ dup

struct mbuf* mbuf::dup

Definition at line 11 of file mbuf.h.

◆ next

struct mbuf* mbuf::next

Definition at line 7 of file mbuf.h.

◆ refcnt

int mbuf::refcnt

Definition at line 10 of file mbuf.h.

◆ size

unsigned mbuf::size

Definition at line 9 of file mbuf.h.


Watt-32 tcp/ip: MD5_CTX Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
MD5_CTX Struct Reference
Collaboration diagram for MD5_CTX:
[legend]

Data Fields

DWORD | state [4]
DWORD | count [2]
BYTE | buffer [64]

Detailed Description

Definition at line 53 of file tcp_md5.c.

Field Documentation

◆ buffer

BYTE MD5_CTX::buffer[64]

Definition at line 56 of file tcp_md5.c.

◆ count

DWORD MD5_CTX::count[2]

Definition at line 55 of file tcp_md5.c.

◆ state

DWORD MD5_CTX::state[4]

Definition at line 54 of file tcp_md5.c.


Watt-32 tcp/ip: mf6c Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
mf6c Struct Reference
Collaboration diagram for mf6c:
[legend]

Data Fields

struct sockaddr_in6 | mf6c_origin
struct sockaddr_in6 | mf6c_mcastgrp
mifi_t | mf6c_parent
struct if_set | mf6c_ifset
u_quad_t | mf6c_pkt_cnt
u_quad_t | mf6c_byte_cnt
u_quad_t | mf6c_wrong_if
int | mf6c_expire
struct timeval | mf6c_last_assert
struct rtdetq * | mf6c_stall
struct mf6c * | mf6c_next

Detailed Description

Definition at line 236 of file ip6_mrou.h.

Field Documentation

◆ mf6c_byte_cnt

u_quad_t mf6c::mf6c_byte_cnt

Definition at line 243 of file ip6_mrou.h.

◆ mf6c_expire

int mf6c::mf6c_expire

Definition at line 245 of file ip6_mrou.h.

◆ mf6c_ifset

struct if_set mf6c::mf6c_ifset

Definition at line 240 of file ip6_mrou.h.

◆ mf6c_last_assert

struct timeval mf6c::mf6c_last_assert

Definition at line 246 of file ip6_mrou.h.

◆ mf6c_mcastgrp

struct sockaddr_in6 mf6c::mf6c_mcastgrp

Definition at line 238 of file ip6_mrou.h.

◆ mf6c_next

struct mf6c* mf6c::mf6c_next

Definition at line 248 of file ip6_mrou.h.

◆ mf6c_origin

struct sockaddr_in6 mf6c::mf6c_origin

Definition at line 237 of file ip6_mrou.h.

◆ mf6c_parent

mifi_t mf6c::mf6c_parent

Definition at line 239 of file ip6_mrou.h.

◆ mf6c_pkt_cnt

u_quad_t mf6c::mf6c_pkt_cnt

Definition at line 242 of file ip6_mrou.h.

◆ mf6c_stall

struct rtdetq* mf6c::mf6c_stall

Definition at line 247 of file ip6_mrou.h.

◆ mf6c_wrong_if

u_quad_t mf6c::mf6c_wrong_if

Definition at line 244 of file ip6_mrou.h.


Watt-32 tcp/ip: mf6cctl Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
mf6cctl Struct Reference
Collaboration diagram for mf6cctl:
[legend]

Data Fields

struct sockaddr_in6 | mf6cc_origin
struct sockaddr_in6 | mf6cc_mcastgrp
mifi_t | mf6cc_parent
struct if_set | mf6cc_ifset

Detailed Description

Definition at line 121 of file ip6_mrou.h.

Field Documentation

◆ mf6cc_ifset

struct if_set mf6cctl::mf6cc_ifset

Definition at line 125 of file ip6_mrou.h.

◆ mf6cc_mcastgrp

struct sockaddr_in6 mf6cctl::mf6cc_mcastgrp

Definition at line 123 of file ip6_mrou.h.

◆ mf6cc_origin

struct sockaddr_in6 mf6cctl::mf6cc_origin

Definition at line 122 of file ip6_mrou.h.

◆ mf6cc_parent

mifi_t mf6cctl::mf6cc_parent

Definition at line 124 of file ip6_mrou.h.


Watt-32 tcp/ip: mfc Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
mfc Struct Reference
Collaboration diagram for mfc:
[legend]

Data Fields

struct in_addr | mfc_origin
struct in_addr | mfc_mcastgrp
vifi_t | mfc_parent
u_char | mfc_ttls [MAXVIFS]
u_long | mfc_pkt_cnt
u_long | mfc_byte_cnt
u_long | mfc_wrong_if
int | mfc_expire
struct timeval | mfc_last_assert

Detailed Description

Definition at line 189 of file ip_mrout.h.

Field Documentation

◆ mfc_byte_cnt

u_long mfc::mfc_byte_cnt

Definition at line 195 of file ip_mrout.h.

◆ mfc_expire

int mfc::mfc_expire

Definition at line 197 of file ip_mrout.h.

◆ mfc_last_assert

struct timeval mfc::mfc_last_assert

Definition at line 198 of file ip_mrout.h.

◆ mfc_mcastgrp

struct in_addr mfc::mfc_mcastgrp

Definition at line 191 of file ip_mrout.h.

◆ mfc_origin

struct in_addr mfc::mfc_origin

Definition at line 190 of file ip_mrout.h.

◆ mfc_parent

vifi_t mfc::mfc_parent

Definition at line 192 of file ip_mrout.h.

◆ mfc_pkt_cnt

u_long mfc::mfc_pkt_cnt

Definition at line 194 of file ip_mrout.h.

◆ mfc_ttls

u_char mfc::mfc_ttls[MAXVIFS]

Definition at line 193 of file ip_mrout.h.

◆ mfc_wrong_if

u_long mfc::mfc_wrong_if

Definition at line 196 of file ip_mrout.h.


Watt-32 tcp/ip: mfcctl Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
mfcctl Struct Reference
Collaboration diagram for mfcctl:
[legend]

Data Fields

struct in_addr | mfcc_origin
struct in_addr | mfcc_mcastgrp
vifi_t | mfcc_parent
u_char | mfcc_ttls [MAXVIFS]

Detailed Description

Definition at line 115 of file ip_mrout.h.

Field Documentation

◆ mfcc_mcastgrp

struct in_addr mfcctl::mfcc_mcastgrp

Definition at line 117 of file ip_mrout.h.

◆ mfcc_origin

struct in_addr mfcctl::mfcc_origin

Definition at line 116 of file ip_mrout.h.

◆ mfcc_parent

vifi_t mfcctl::mfcc_parent

Definition at line 118 of file ip_mrout.h.

◆ mfcc_ttls

u_char mfcctl::mfcc_ttls[MAXVIFS]

Definition at line 119 of file ip_mrout.h.


Watt-32 tcp/ip: MIB_IPNETROW Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
MIB_IPNETROW Struct Reference
Collaboration diagram for MIB_IPNETROW:
[legend]

Data Fields

DWORD | dwIndex
DWORD | dwPhysAddrLen
BYTE | bPhysAddr [MAXLEN_PHYSADDR]
DWORD | dwAddr
DWORD | dwType

Detailed Description

Definition at line 260 of file winadinf.h.

Field Documentation

◆ bPhysAddr

BYTE MIB_IPNETROW::bPhysAddr[MAXLEN_PHYSADDR]

Definition at line 263 of file winadinf.h.

◆ dwAddr

DWORD MIB_IPNETROW::dwAddr

Definition at line 264 of file winadinf.h.

◆ dwIndex

DWORD MIB_IPNETROW::dwIndex

Definition at line 261 of file winadinf.h.

◆ dwPhysAddrLen

DWORD MIB_IPNETROW::dwPhysAddrLen

Definition at line 262 of file winadinf.h.

◆ dwType

DWORD MIB_IPNETROW::dwType

Definition at line 265 of file winadinf.h.


Watt-32 tcp/ip: MIB_IPNETTABLE Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
MIB_IPNETTABLE Struct Reference
Collaboration diagram for MIB_IPNETTABLE:
[legend]

Data Fields

DWORD | dwNumEntries
MIB_IPNETROW | table [1]

Detailed Description

Definition at line 268 of file winadinf.h.

Field Documentation

◆ dwNumEntries

DWORD MIB_IPNETTABLE::dwNumEntries

Definition at line 269 of file winadinf.h.

◆ table

MIB_IPNETROW MIB_IPNETTABLE::table[1]

Definition at line 270 of file winadinf.h.


Watt-32 tcp/ip: mif6 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
mif6 Struct Reference
Collaboration diagram for mif6:
[legend]

Data Fields

u_char | m6_flags
u_int | m6_rate_limit
struct tbf * | m6_tbf
struct in6_addr | m6_lcl_addr
struct ifnet * | m6_ifp
u_quad_t | m6_pkt_in
u_quad_t | m6_pkt_out
u_quad_t | m6_bytes_in
u_quad_t | m6_bytes_out
struct route_in6 | m6_route
u_int | m6_rsvp_on
struct socket * | m6_rsvpd

Detailed Description

Definition at line 214 of file ip6_mrou.h.

Field Documentation

◆ m6_bytes_in

u_quad_t mif6::m6_bytes_in

Definition at line 224 of file ip6_mrou.h.

◆ m6_bytes_out

u_quad_t mif6::m6_bytes_out

Definition at line 225 of file ip6_mrou.h.

◆ m6_flags

u_char mif6::m6_flags

Definition at line 215 of file ip6_mrou.h.

◆ m6_ifp

struct ifnet* mif6::m6_ifp

Definition at line 221 of file ip6_mrou.h.

◆ m6_lcl_addr

struct in6_addr mif6::m6_lcl_addr

Definition at line 220 of file ip6_mrou.h.

◆ m6_pkt_in

u_quad_t mif6::m6_pkt_in

Definition at line 222 of file ip6_mrou.h.

◆ m6_pkt_out

u_quad_t mif6::m6_pkt_out

Definition at line 223 of file ip6_mrou.h.

◆ m6_rate_limit

u_int mif6::m6_rate_limit

Definition at line 216 of file ip6_mrou.h.

◆ m6_route

struct route_in6 mif6::m6_route

Definition at line 226 of file ip6_mrou.h.

◆ m6_rsvp_on

u_int mif6::m6_rsvp_on

Definition at line 228 of file ip6_mrou.h.

◆ m6_rsvpd

struct socket* mif6::m6_rsvpd

Definition at line 229 of file ip6_mrou.h.

◆ m6_tbf

struct tbf* mif6::m6_tbf

Definition at line 218 of file ip6_mrou.h.


Watt-32 tcp/ip: mif6ctl Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
mif6ctl Struct Reference
Collaboration diagram for mif6ctl:
[legend]

Data Fields

mifi_t | mif6c_mifi
u_char | mif6c_flags
u_short | mif6c_pifi
u_int | mif6c_rate_limit

Detailed Description

Definition at line 107 of file ip6_mrou.h.

Field Documentation

◆ mif6c_flags

u_char mif6ctl::mif6c_flags

Definition at line 109 of file ip6_mrou.h.

◆ mif6c_mifi

mifi_t mif6ctl::mif6c_mifi

Definition at line 108 of file ip6_mrou.h.

◆ mif6c_pifi

u_short mif6ctl::mif6c_pifi

Definition at line 110 of file ip6_mrou.h.

◆ mif6c_rate_limit

u_int mif6ctl::mif6c_rate_limit

Definition at line 112 of file ip6_mrou.h.


Watt-32 tcp/ip: mld_hdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
mld_hdr Struct Reference
Collaboration diagram for mld_hdr:
[legend]

Data Fields

struct icmp6_hdr | mld_icmp6_hdr
struct in6_addr | mld_addr

Detailed Description

Definition at line 191 of file icmp6.h.

Field Documentation

◆ mld_addr

struct in6_addr mld_hdr::mld_addr

Definition at line 193 of file icmp6.h.

◆ mld_icmp6_hdr

struct icmp6_hdr mld_hdr::mld_icmp6_hdr

Definition at line 192 of file icmp6.h.


Watt-32 tcp/ip: mrt6msg Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
mrt6msg Struct Reference
Collaboration diagram for mrt6msg:
[legend]

Data Fields

u_char | im6_mbz
u_char | im6_msgtype
u_int16_t | im6_mif
u_int32_t | im6_pad
struct in6_addr im6_src | im6_dst

Detailed Description

Definition at line 176 of file ip6_mrou.h.

Field Documentation

◆ im6_dst

struct in6_addr im6_src mrt6msg::im6_dst

Definition at line 184 of file ip6_mrou.h.

◆ im6_mbz

u_char mrt6msg::im6_mbz

Definition at line 180 of file ip6_mrou.h.

◆ im6_mif

u_int16_t mrt6msg::im6_mif

Definition at line 182 of file ip6_mrou.h.

◆ im6_msgtype

u_char mrt6msg::im6_msgtype

Definition at line 181 of file ip6_mrou.h.

◆ im6_pad

u_int32_t mrt6msg::im6_pad

Definition at line 183 of file ip6_mrou.h.


Watt-32 tcp/ip: mrt6stat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
mrt6stat Struct Reference
Collaboration diagram for mrt6stat:
[legend]

Data Fields

u_quad_t | mrt6s_mfc_lookups
u_quad_t | mrt6s_mfc_misses
u_quad_t | mrt6s_upcalls
u_quad_t | mrt6s_no_route
u_quad_t | mrt6s_bad_tunnel
u_quad_t | mrt6s_cant_tunnel
u_quad_t | mrt6s_wrong_if
u_quad_t | mrt6s_upq_ovflw
u_quad_t | mrt6s_cache_cleanups
u_quad_t | mrt6s_drop_sel
u_quad_t | mrt6s_q_overflow
u_quad_t | mrt6s_pkt2large
u_quad_t | mrt6s_upq_sockfull

Detailed Description

Definition at line 131 of file ip6_mrou.h.

Field Documentation

◆ mrt6s_bad_tunnel

u_quad_t mrt6stat::mrt6s_bad_tunnel

Definition at line 136 of file ip6_mrou.h.

◆ mrt6s_cache_cleanups

u_quad_t mrt6stat::mrt6s_cache_cleanups

Definition at line 140 of file ip6_mrou.h.

◆ mrt6s_cant_tunnel

u_quad_t mrt6stat::mrt6s_cant_tunnel

Definition at line 137 of file ip6_mrou.h.

◆ mrt6s_drop_sel

u_quad_t mrt6stat::mrt6s_drop_sel

Definition at line 141 of file ip6_mrou.h.

◆ mrt6s_mfc_lookups

u_quad_t mrt6stat::mrt6s_mfc_lookups

Definition at line 132 of file ip6_mrou.h.

◆ mrt6s_mfc_misses

u_quad_t mrt6stat::mrt6s_mfc_misses

Definition at line 133 of file ip6_mrou.h.

◆ mrt6s_no_route

u_quad_t mrt6stat::mrt6s_no_route

Definition at line 135 of file ip6_mrou.h.

◆ mrt6s_pkt2large

u_quad_t mrt6stat::mrt6s_pkt2large

Definition at line 143 of file ip6_mrou.h.

◆ mrt6s_q_overflow

u_quad_t mrt6stat::mrt6s_q_overflow

Definition at line 142 of file ip6_mrou.h.

◆ mrt6s_upcalls

u_quad_t mrt6stat::mrt6s_upcalls

Definition at line 134 of file ip6_mrou.h.

◆ mrt6s_upq_ovflw

u_quad_t mrt6stat::mrt6s_upq_ovflw

Definition at line 139 of file ip6_mrou.h.

◆ mrt6s_upq_sockfull

u_quad_t mrt6stat::mrt6s_upq_sockfull

Definition at line 144 of file ip6_mrou.h.

◆ mrt6s_wrong_if

u_quad_t mrt6stat::mrt6s_wrong_if

Definition at line 138 of file ip6_mrou.h.


Watt-32 tcp/ip: mrtstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
mrtstat Struct Reference
Collaboration diagram for mrtstat:
[legend]

Data Fields

u_long | mrts_mfc_lookups
u_long | mrts_mfc_misses
u_long | mrts_upcalls
u_long | mrts_no_route
u_long | mrts_bad_tunnel
u_long | mrts_cant_tunnel
u_long | mrts_wrong_if
u_long | mrts_upq_ovflw
u_long | mrts_cache_cleanups
u_long | mrts_drop_sel
u_long | mrts_q_overflow
u_long | mrts_pkt2large
u_long | mrts_upq_sockfull

Detailed Description

Definition at line 125 of file ip_mrout.h.

Field Documentation

◆ mrts_bad_tunnel

u_long mrtstat::mrts_bad_tunnel

Definition at line 130 of file ip_mrout.h.

◆ mrts_cache_cleanups

u_long mrtstat::mrts_cache_cleanups

Definition at line 134 of file ip_mrout.h.

◆ mrts_cant_tunnel

u_long mrtstat::mrts_cant_tunnel

Definition at line 131 of file ip_mrout.h.

◆ mrts_drop_sel

u_long mrtstat::mrts_drop_sel

Definition at line 135 of file ip_mrout.h.

◆ mrts_mfc_lookups

u_long mrtstat::mrts_mfc_lookups

Definition at line 126 of file ip_mrout.h.

◆ mrts_mfc_misses

u_long mrtstat::mrts_mfc_misses

Definition at line 127 of file ip_mrout.h.

◆ mrts_no_route

u_long mrtstat::mrts_no_route

Definition at line 129 of file ip_mrout.h.

◆ mrts_pkt2large

u_long mrtstat::mrts_pkt2large

Definition at line 137 of file ip_mrout.h.

◆ mrts_q_overflow

u_long mrtstat::mrts_q_overflow

Definition at line 136 of file ip_mrout.h.

◆ mrts_upcalls

u_long mrtstat::mrts_upcalls

Definition at line 128 of file ip_mrout.h.

◆ mrts_upq_ovflw

u_long mrtstat::mrts_upq_ovflw

Definition at line 133 of file ip_mrout.h.

◆ mrts_upq_sockfull

u_long mrtstat::mrts_upq_sockfull

Definition at line 138 of file ip_mrout.h.

◆ mrts_wrong_if

u_long mrtstat::mrts_wrong_if

Definition at line 132 of file ip_mrout.h.


Watt-32 tcp/ip: msghdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
msghdr Struct Reference
Collaboration diagram for msghdr:
[legend]

Data Fields

char * | msg_name
socklen_t | msg_namelen
struct iovec * | msg_iov
int | msg_iovlen
char * | msg_accrights
int | msg_accrightslen
void * | msg_control
socklen_t | msg_controllen
int | msg_flags

Detailed Description

Definition at line 258 of file socket.h.

Field Documentation

◆ msg_accrights

char* msghdr::msg_accrights

Definition at line 263 of file socket.h.

◆ msg_accrightslen

int msghdr::msg_accrightslen

Definition at line 264 of file socket.h.

◆ msg_control

void* msghdr::msg_control

Definition at line 265 of file socket.h.

◆ msg_controllen

socklen_t msghdr::msg_controllen

Definition at line 266 of file socket.h.

◆ msg_flags

int msghdr::msg_flags

Definition at line 267 of file socket.h.

◆ msg_iov

struct iovec* msghdr::msg_iov

Definition at line 261 of file socket.h.

◆ msg_iovlen

int msghdr::msg_iovlen

Definition at line 262 of file socket.h.

◆ msg_name

char* msghdr::msg_name

Definition at line 259 of file socket.h.

◆ msg_namelen

socklen_t msghdr::msg_namelen

Definition at line 260 of file socket.h.


Watt-32 tcp/ip: MultiCast Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
MultiCast Struct Reference

Multicast internal structure. More...

#include <pcigmp.h>

Collaboration diagram for MultiCast:
[legend]

Data Fields

DWORD | ip
IP address of group.
eth_address | ethaddr
Ethernet address of group.
BYTE | processes
number of interested processes
DWORD | reply_timer
IGMP query reply timer.
BOOL | active
is this an active entry

Detailed Description

Multicast internal structure.

Definition at line 104 of file pcigmp.h.

Field Documentation

◆ active

BOOL MultiCast::active

is this an active entry

Definition at line 109 of file pcigmp.h.

◆ ethaddr

eth_address MultiCast::ethaddr

Ethernet address of group.

Definition at line 106 of file pcigmp.h.

◆ ip

DWORD MultiCast::ip

IP address of group.

Definition at line 105 of file pcigmp.h.

◆ processes

BYTE MultiCast::processes

number of interested processes

Definition at line 107 of file pcigmp.h.

◆ reply_timer

DWORD MultiCast::reply_timer

IGMP query reply timer.

Definition at line 108 of file pcigmp.h.


Watt-32 tcp/ip: nd_defrouter Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
nd_defrouter Struct Reference
Collaboration diagram for nd_defrouter:
[legend]

Public Member Functions

TAILQ_ENTRY (nd_defrouter) dr_entry

Data Fields

struct in6_addr | rtaddr
u_char | flags
u_short | rtlifetime
u_long | expire
u_long | advint
u_long | advint_expire
int | advints_lost
struct ifnet * | ifp

Detailed Description

Definition at line 211 of file nd6.h.

Field Documentation

◆ advint

u_long nd_defrouter::advint

Definition at line 217 of file nd6.h.

◆ advint_expire

u_long nd_defrouter::advint_expire

Definition at line 218 of file nd6.h.

◆ advints_lost

int nd_defrouter::advints_lost

Definition at line 219 of file nd6.h.

◆ expire

u_long nd_defrouter::expire

Definition at line 216 of file nd6.h.

◆ flags

u_char nd_defrouter::flags

Definition at line 214 of file nd6.h.

◆ ifp

struct ifnet* nd_defrouter::ifp

Definition at line 220 of file nd6.h.

◆ rtaddr

struct in6_addr nd_defrouter::rtaddr

Definition at line 213 of file nd6.h.

◆ rtlifetime

u_short nd_defrouter::rtlifetime

Definition at line 215 of file nd6.h.


Watt-32 tcp/ip: nd_ifinfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_ifinfo Struct Reference
Collaboration diagram for nd_ifinfo:
[legend]

Data Fields

u_int32_t | linkmtu
u_int32_t | maxmtu
u_int32_t | basereachable
u_int32_t | reachable
u_int32_t | retrans
u_int32_t | flags
int | recalctm
u_int8_t | chlim
u_int8_t | receivedra
u_int8_t | randomseed0 [8]
u_int8_t | randomseed1 [8]
u_int8_t | randomid [8]

Detailed Description

Definition at line 78 of file nd6.h.

Field Documentation

◆ basereachable

u_int32_t nd_ifinfo::basereachable

Definition at line 81 of file nd6.h.

◆ chlim

u_int8_t nd_ifinfo::chlim

Definition at line 86 of file nd6.h.

◆ flags

u_int32_t nd_ifinfo::flags

Definition at line 84 of file nd6.h.

◆ linkmtu

u_int32_t nd_ifinfo::linkmtu

Definition at line 79 of file nd6.h.

◆ maxmtu

u_int32_t nd_ifinfo::maxmtu

Definition at line 80 of file nd6.h.

◆ randomid

u_int8_t nd_ifinfo::randomid[8]

Definition at line 91 of file nd6.h.

◆ randomseed0

u_int8_t nd_ifinfo::randomseed0[8]

Definition at line 89 of file nd6.h.

◆ randomseed1

u_int8_t nd_ifinfo::randomseed1[8]

Definition at line 90 of file nd6.h.

◆ reachable

u_int32_t nd_ifinfo::reachable

Definition at line 82 of file nd6.h.

◆ recalctm

int nd_ifinfo::recalctm

Definition at line 85 of file nd6.h.

◆ receivedra

u_int8_t nd_ifinfo::receivedra

Definition at line 87 of file nd6.h.

◆ retrans

u_int32_t nd_ifinfo::retrans

Definition at line 83 of file nd6.h.


Watt-32 tcp/ip: nd_neighbor_advert Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_neighbor_advert Struct Reference
Collaboration diagram for nd_neighbor_advert:
[legend]

Data Fields

struct icmp6_hdr | nd_na_hdr
struct in6_addr | nd_na_target

Detailed Description

Definition at line 268 of file icmp6.h.

Field Documentation

◆ nd_na_hdr

struct icmp6_hdr nd_neighbor_advert::nd_na_hdr

Definition at line 269 of file icmp6.h.

◆ nd_na_target

struct in6_addr nd_neighbor_advert::nd_na_target

Definition at line 270 of file icmp6.h.


Watt-32 tcp/ip: nd_neighbor_solicit Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_neighbor_solicit Struct Reference
Collaboration diagram for nd_neighbor_solicit:
[legend]

Data Fields

struct icmp6_hdr | nd_ns_hdr
struct in6_addr | nd_ns_target

Detailed Description

Definition at line 257 of file icmp6.h.

Field Documentation

◆ nd_ns_hdr

struct icmp6_hdr nd_neighbor_solicit::nd_ns_hdr

Definition at line 258 of file icmp6.h.

◆ nd_ns_target

struct in6_addr nd_neighbor_solicit::nd_ns_target

Definition at line 259 of file icmp6.h.


Watt-32 tcp/ip: nd_opt_hdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_opt_hdr Struct Reference
Collaboration diagram for nd_opt_hdr:
[legend]

Data Fields

u_int8_t | nd_opt_type
u_int8_t | nd_opt_len

Detailed Description

Definition at line 302 of file icmp6.h.

Field Documentation

◆ nd_opt_len

u_int8_t nd_opt_hdr::nd_opt_len

Definition at line 304 of file icmp6.h.

◆ nd_opt_type

u_int8_t nd_opt_hdr::nd_opt_type

Definition at line 303 of file icmp6.h.


Watt-32 tcp/ip: nd_opt_mtu Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_opt_mtu Struct Reference
Collaboration diagram for nd_opt_mtu:
[legend]

Data Fields

u_int8_t | nd_opt_mtu_type
u_int8_t | nd_opt_mtu_len
u_int16_t | nd_opt_mtu_reserved
u_int32_t | nd_opt_mtu_mtu

Detailed Description

Definition at line 338 of file icmp6.h.

Field Documentation

◆ nd_opt_mtu_len

u_int8_t nd_opt_mtu::nd_opt_mtu_len

Definition at line 340 of file icmp6.h.

◆ nd_opt_mtu_mtu

u_int32_t nd_opt_mtu::nd_opt_mtu_mtu

Definition at line 342 of file icmp6.h.

◆ nd_opt_mtu_reserved

u_int16_t nd_opt_mtu::nd_opt_mtu_reserved

Definition at line 341 of file icmp6.h.

◆ nd_opt_mtu_type

u_int8_t nd_opt_mtu::nd_opt_mtu_type

Definition at line 339 of file icmp6.h.


Watt-32 tcp/ip: nd_opt_prefix_info Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_opt_prefix_info Struct Reference
Collaboration diagram for nd_opt_prefix_info:
[legend]

Data Fields

u_int8_t | nd_opt_pi_type
u_int8_t | nd_opt_pi_len
u_int8_t | nd_opt_pi_prefix_len
u_int8_t | nd_opt_pi_flags_reserved
u_int32_t | nd_opt_pi_valid_time
u_int32_t | nd_opt_pi_preferred_time
u_int32_t | nd_opt_pi_reserved2
struct in6_addr | nd_opt_pi_prefix

Detailed Description

Definition at line 316 of file icmp6.h.

Field Documentation

◆ nd_opt_pi_flags_reserved

u_int8_t nd_opt_prefix_info::nd_opt_pi_flags_reserved

Definition at line 320 of file icmp6.h.

◆ nd_opt_pi_len

u_int8_t nd_opt_prefix_info::nd_opt_pi_len

Definition at line 318 of file icmp6.h.

◆ nd_opt_pi_preferred_time

u_int32_t nd_opt_prefix_info::nd_opt_pi_preferred_time

Definition at line 322 of file icmp6.h.

◆ nd_opt_pi_prefix

struct in6_addr nd_opt_prefix_info::nd_opt_pi_prefix

Definition at line 324 of file icmp6.h.

◆ nd_opt_pi_prefix_len

u_int8_t nd_opt_prefix_info::nd_opt_pi_prefix_len

Definition at line 319 of file icmp6.h.

◆ nd_opt_pi_reserved2

u_int32_t nd_opt_prefix_info::nd_opt_pi_reserved2

Definition at line 323 of file icmp6.h.

◆ nd_opt_pi_type

u_int8_t nd_opt_prefix_info::nd_opt_pi_type

Definition at line 317 of file icmp6.h.

◆ nd_opt_pi_valid_time

u_int32_t nd_opt_prefix_info::nd_opt_pi_valid_time

Definition at line 321 of file icmp6.h.


Watt-32 tcp/ip: nd_opt_rd_hdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_opt_rd_hdr Struct Reference
Collaboration diagram for nd_opt_rd_hdr:
[legend]

Data Fields

u_int8_t | nd_opt_rh_type
u_int8_t | nd_opt_rh_len
u_int16_t | nd_opt_rh_reserved1
u_int32_t | nd_opt_rh_reserved2

Detailed Description

Definition at line 330 of file icmp6.h.

Field Documentation

◆ nd_opt_rh_len

u_int8_t nd_opt_rd_hdr::nd_opt_rh_len

Definition at line 332 of file icmp6.h.

◆ nd_opt_rh_reserved1

u_int16_t nd_opt_rd_hdr::nd_opt_rh_reserved1

Definition at line 333 of file icmp6.h.

◆ nd_opt_rh_reserved2

u_int32_t nd_opt_rd_hdr::nd_opt_rh_reserved2

Definition at line 334 of file icmp6.h.

◆ nd_opt_rh_type

u_int8_t nd_opt_rd_hdr::nd_opt_rh_type

Definition at line 331 of file icmp6.h.


Watt-32 tcp/ip: nd_opt_route_info Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_opt_route_info Struct Reference
Collaboration diagram for nd_opt_route_info:
[legend]

Data Fields

u_int8_t | nd_opt_rti_type
u_int8_t | nd_opt_rti_len
u_int8_t | nd_opt_rti_prefixlen
u_int8_t | nd_opt_rti_flags
u_int32_t | nd_opt_rti_lifetime

Detailed Description

Definition at line 345 of file icmp6.h.

Field Documentation

◆ nd_opt_rti_flags

u_int8_t nd_opt_route_info::nd_opt_rti_flags

Definition at line 349 of file icmp6.h.

◆ nd_opt_rti_len

u_int8_t nd_opt_route_info::nd_opt_rti_len

Definition at line 347 of file icmp6.h.

◆ nd_opt_rti_lifetime

u_int32_t nd_opt_route_info::nd_opt_rti_lifetime

Definition at line 350 of file icmp6.h.

◆ nd_opt_rti_prefixlen

u_int8_t nd_opt_route_info::nd_opt_rti_prefixlen

Definition at line 348 of file icmp6.h.

◆ nd_opt_rti_type

u_int8_t nd_opt_route_info::nd_opt_rti_type

Definition at line 346 of file icmp6.h.


Watt-32 tcp/ip: nd_opts Union Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_opts Union Reference
Collaboration diagram for nd_opts:
[legend]

Data Fields

struct nd_opt_hdr * nd_opt_array [9]
struct {
struct nd_opt_hdr * zero
struct nd_opt_hdr * src_lladdr
struct nd_opt_hdr * tgt_lladdr
struct nd_opt_prefix_info * pi_beg
struct nd_opt_rd_hdr * rh
struct nd_opt_mtu * mtu
struct nd_opt_hdr * six
struct nd_opt_advint * adv
struct nd_opt_hai * hai
struct nd_opt_hdr * search
struct nd_opt_hdr * last
int done
struct nd_opt_prefix_info * pi_end
} nd_opt_each

Detailed Description

Definition at line 316 of file nd6.h.

Field Documentation

◆ adv

struct nd_opt_advint* nd_opts::adv

Definition at line 326 of file nd6.h.

◆ done

int nd_opts::done

Definition at line 330 of file nd6.h.

◆ hai

struct nd_opt_hai* nd_opts::hai

Definition at line 327 of file nd6.h.

◆ last

struct nd_opt_hdr* nd_opts::last

Definition at line 329 of file nd6.h.

◆ mtu

struct nd_opt_mtu* nd_opts::mtu

Definition at line 324 of file nd6.h.

◆ nd_opt_array

struct nd_opt_hdr* nd_opts::nd_opt_array[9]

Definition at line 317 of file nd6.h.

◆ pi_beg

struct nd_opt_prefix_info* nd_opts::pi_beg

Definition at line 322 of file nd6.h.

◆ pi_end

struct nd_opt_prefix_info* nd_opts::pi_end

Definition at line 331 of file nd6.h.

◆ rh

struct nd_opt_rd_hdr* nd_opts::rh

Definition at line 323 of file nd6.h.

◆ search

struct nd_opt_hdr* nd_opts::search

Definition at line 328 of file nd6.h.

◆ six

struct nd_opt_hdr* nd_opts::six

Definition at line 325 of file nd6.h.

◆ src_lladdr

struct nd_opt_hdr* nd_opts::src_lladdr

Definition at line 320 of file nd6.h.

◆ tgt_lladdr

struct nd_opt_hdr* nd_opts::tgt_lladdr

Definition at line 321 of file nd6.h.

◆ zero

struct nd_opt_hdr* nd_opts::zero

Definition at line 319 of file nd6.h.


Watt-32 tcp/ip: nd_pfxrouter Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
nd_pfxrouter Struct Reference
Collaboration diagram for nd_pfxrouter:
[legend]

Public Member Functions

LIST_ENTRY (nd_pfxrouter) pfr_entry

Data Fields

struct nd_defrouter * router

Detailed Description

Definition at line 282 of file nd6.h.

Field Documentation

◆ router

struct nd_defrouter* nd_pfxrouter::router

Definition at line 286 of file nd6.h.


Watt-32 tcp/ip: nd_prefix Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
nd_prefix Struct Reference
Collaboration diagram for nd_prefix:
[legend]

Public Member Functions

LIST_ENTRY (nd_prefix) ndpr_entry
LIST_HEAD (pr_rtrhead, nd_pfxrouter) ndpr_advrtrs

Data Fields

struct ifnet * | ndpr_ifp
struct sockaddr_in6 | ndpr_prefix
struct in6_addr | ndpr_mask
struct in6_addr | ndpr_addr
u_int32_t | ndpr_vltime
u_int32_t | ndpr_pltime
time_t | ndpr_expire
time_t | ndpr_preferred
struct prf_ra | ndpr_flags
u_int32_t | ndpr_stateflags
u_char | ndpr_plen
int | ndpr_refcnt

Detailed Description

Definition at line 223 of file nd6.h.

Field Documentation

◆ ndpr_addr

struct in6_addr nd_prefix::ndpr_addr

Definition at line 228 of file nd6.h.

◆ ndpr_expire

time_t nd_prefix::ndpr_expire

Definition at line 231 of file nd6.h.

◆ ndpr_flags

struct prf_ra nd_prefix::ndpr_flags

Definition at line 233 of file nd6.h.

◆ ndpr_ifp

struct ifnet* nd_prefix::ndpr_ifp

Definition at line 224 of file nd6.h.

◆ ndpr_mask

struct in6_addr nd_prefix::ndpr_mask

Definition at line 227 of file nd6.h.

◆ ndpr_plen

u_char nd_prefix::ndpr_plen

Definition at line 237 of file nd6.h.

◆ ndpr_pltime

u_int32_t nd_prefix::ndpr_pltime

Definition at line 230 of file nd6.h.

◆ ndpr_preferred

time_t nd_prefix::ndpr_preferred

Definition at line 232 of file nd6.h.

◆ ndpr_prefix

struct sockaddr_in6 nd_prefix::ndpr_prefix

Definition at line 226 of file nd6.h.

◆ ndpr_refcnt

int nd_prefix::ndpr_refcnt

Definition at line 238 of file nd6.h.

◆ ndpr_stateflags

u_int32_t nd_prefix::ndpr_stateflags

Definition at line 234 of file nd6.h.

◆ ndpr_vltime

u_int32_t nd_prefix::ndpr_vltime

Definition at line 229 of file nd6.h.


Watt-32 tcp/ip: nd_redirect Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_redirect Struct Reference
Collaboration diagram for nd_redirect:
[legend]

Data Fields

struct icmp6_hdr | nd_rd_hdr
struct in6_addr | nd_rd_target
struct in6_addr | nd_rd_dst

Detailed Description

Definition at line 290 of file icmp6.h.

Field Documentation

◆ nd_rd_dst

struct in6_addr nd_redirect::nd_rd_dst

Definition at line 293 of file icmp6.h.

◆ nd_rd_hdr

struct icmp6_hdr nd_redirect::nd_rd_hdr

Definition at line 291 of file icmp6.h.

◆ nd_rd_target

struct in6_addr nd_redirect::nd_rd_target

Definition at line 292 of file icmp6.h.


Watt-32 tcp/ip: nd_router_advert Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_router_advert Struct Reference
Collaboration diagram for nd_router_advert:
[legend]

Data Fields

struct icmp6_hdr | nd_ra_hdr
u_int32_t | nd_ra_reachable
u_int32_t | nd_ra_retransmit

Detailed Description

Definition at line 228 of file icmp6.h.

Field Documentation

◆ nd_ra_hdr

struct icmp6_hdr nd_router_advert::nd_ra_hdr

Definition at line 229 of file icmp6.h.

◆ nd_ra_reachable

u_int32_t nd_router_advert::nd_ra_reachable

Definition at line 230 of file icmp6.h.

◆ nd_ra_retransmit

u_int32_t nd_router_advert::nd_ra_retransmit

Definition at line 231 of file icmp6.h.


Watt-32 tcp/ip: nd_router_solicit Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
nd_router_solicit Struct Reference
Collaboration diagram for nd_router_solicit:
[legend]

Data Fields

struct icmp6_hdr nd_rs_hdr

Detailed Description

Definition at line 218 of file icmp6.h.

Field Documentation

◆ nd_rs_hdr

struct icmp6_hdr nd_router_solicit::nd_rs_hdr

Definition at line 219 of file icmp6.h.


Watt-32 tcp/ip: netauth Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
netauth Struct Reference
Collaboration diagram for netauth:
[legend]

Data Fields

u_int16_t | a_family
u_int16_t | a_type
union {
u_int8_t au_pw [RIP_AUTH_PW_LEN]
struct a_md5 {
int16_t md5_pkt_len
int8_t md5_keyid
int8_t md5_auth_len
u_int32_t md5_seqno
u_int32_t rsvd [2]
} a_md5
} au

Detailed Description

Definition at line 91 of file routed.h.

Field Documentation

◆ a_family

u_int16_t netauth::a_family

Definition at line 92 of file routed.h.

◆ a_type

u_int16_t netauth::a_type

Definition at line 93 of file routed.h.

◆ au_pw

u_int8_t netauth::au_pw[RIP_AUTH_PW_LEN]

Definition at line 99 of file routed.h.

◆ md5_auth_len

int8_t netauth::md5_auth_len

Definition at line 103 of file routed.h.

◆ md5_keyid

int8_t netauth::md5_keyid

Definition at line 102 of file routed.h.

◆ md5_pkt_len

int16_t netauth::md5_pkt_len

Definition at line 101 of file routed.h.

◆ md5_seqno

u_int32_t netauth::md5_seqno

Definition at line 104 of file routed.h.

◆ rsvd

u_int32_t netauth::rsvd[2]

Definition at line 105 of file routed.h.


Watt-32 tcp/ip: netent Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
netent Struct Reference
Collaboration diagram for netent:
[legend]

Data Fields

char * | n_name
char ** | n_aliases
int | n_addrtype
unsigned long | n_net

Detailed Description

Definition at line 117 of file netdb.h.

Field Documentation

◆ n_addrtype

int netent::n_addrtype

Definition at line 120 of file netdb.h.

◆ n_aliases

char** netent::n_aliases

Definition at line 119 of file netdb.h.

◆ n_name

char* netent::n_name

Definition at line 118 of file netdb.h.

◆ n_net

unsigned long netent::n_net

Definition at line 121 of file netdb.h.


Watt-32 tcp/ip: netinfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
netinfo Struct Reference
Collaboration diagram for netinfo:
[legend]

Data Fields

u_int16_t | rip_family
u_int16_t | rip_tag
u_int32_t | rip_dst
u_int32_t | rip_dst_mask
u_int32_t | rip_router
u_int32_t | rip_metric
u_int16_t | n_family
u_int16_t | n_tag
u_int32_t | n_dst
u_int32_t | n_mask
u_int32_t | n_nhop
u_int32_t | n_metric

Detailed Description

Definition at line 67 of file routed.h.

Field Documentation

◆ n_dst

u_int32_t netinfo::n_dst

Definition at line 82 of file routed.h.

◆ n_family

u_int16_t netinfo::n_family

Definition at line 77 of file routed.h.

◆ n_mask

u_int32_t netinfo::n_mask

Definition at line 84 of file routed.h.

◆ n_metric

u_int32_t netinfo::n_metric

Definition at line 86 of file routed.h.

◆ n_nhop

u_int32_t netinfo::n_nhop

Definition at line 85 of file routed.h.

◆ n_tag

u_int16_t netinfo::n_tag

Definition at line 81 of file routed.h.

◆ rip_dst

u_int32_t netinfo::rip_dst

Definition at line 70 of file routed.h.

◆ rip_dst_mask

u_int32_t netinfo::rip_dst_mask

Definition at line 71 of file routed.h.

◆ rip_family

u_int16_t netinfo::rip_family

Definition at line 68 of file routed.h.

◆ rip_metric

u_int32_t netinfo::rip_metric

Definition at line 73 of file routed.h.

◆ rip_router

u_int32_t netinfo::rip_router

Definition at line 72 of file routed.h.

◆ rip_tag

u_int16_t netinfo::rip_tag

Definition at line 69 of file routed.h.


Watt-32 tcp/ip: netobj Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
netobj Struct Reference
Collaboration diagram for netobj:
[legend]

Data Fields

u_int | n_len
char * | n_bytes

Detailed Description

Definition at line 288 of file xdr.h.

Field Documentation

◆ n_bytes

char* netobj::n_bytes

Definition at line 290 of file xdr.h.

◆ n_len

u_int netobj::n_len

Definition at line 289 of file xdr.h.


Watt-32 tcp/ip: newah Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
newah Struct Reference
Collaboration diagram for newah:
[legend]

Data Fields

u_int8_t | ah_nxt
u_int8_t | ah_len
u_int16_t | ah_reserve
u_int32_t | ah_spi
u_int32_t | ah_seq

Detailed Description

Definition at line 53 of file ah.h.

Field Documentation

◆ ah_len

u_int8_t newah::ah_len

Definition at line 55 of file ah.h.

◆ ah_nxt

u_int8_t newah::ah_nxt

Definition at line 54 of file ah.h.

◆ ah_reserve

u_int16_t newah::ah_reserve

Definition at line 56 of file ah.h.

◆ ah_seq

u_int32_t newah::ah_seq

Definition at line 58 of file ah.h.

◆ ah_spi

u_int32_t newah::ah_spi

Definition at line 57 of file ah.h.


Watt-32 tcp/ip: newesp Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
newesp Struct Reference
Collaboration diagram for newesp:
[legend]

Data Fields

u_int32_t | esp_spi
u_int32_t | esp_seq

Detailed Description

Definition at line 55 of file esp.h.

Field Documentation

◆ esp_seq

u_int32_t newesp::esp_seq

Definition at line 57 of file esp.h.

◆ esp_spi

u_int32_t newesp::esp_spi

Definition at line 56 of file esp.h.


Watt-32 tcp/ip: ni_reply_fqdn Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ni_reply_fqdn Struct Reference
Collaboration diagram for ni_reply_fqdn:
[legend]

Data Fields

u_int32_t | ni_fqdn_ttl
u_int8_t | ni_fqdn_namelen
u_int8_t | ni_fqdn_name [3]

Detailed Description

Definition at line 435 of file icmp6.h.

Field Documentation

◆ ni_fqdn_name

u_int8_t ni_reply_fqdn::ni_fqdn_name[3]

Definition at line 438 of file icmp6.h.

◆ ni_fqdn_namelen

u_int8_t ni_reply_fqdn::ni_fqdn_namelen

Definition at line 437 of file icmp6.h.

◆ ni_fqdn_ttl

u_int32_t ni_reply_fqdn::ni_fqdn_ttl

Definition at line 436 of file icmp6.h.


Watt-32 tcp/ip: Node Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
Node Struct Reference
Collaboration diagram for Node:
[legend]

Data Fields

DWORD | crc
const char * | string
struct Node * | next

Detailed Description

Definition at line 836 of file lang.c.

Field Documentation

◆ crc

DWORD Node::crc

Definition at line 837 of file lang.c.

◆ next

struct Node* Node::next

Definition at line 839 of file lang.c.

◆ string

const char* Node::string

Definition at line 838 of file lang.c.


Watt-32 tcp/ip: npf_if_addr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
npf_if_addr Struct Reference

Addresses of a network adapter. More...

#include <packet32.h>

Collaboration diagram for npf_if_addr:
[legend]

Data Fields

struct sockaddr_storage | IPAddress
struct sockaddr_storage | SubnetMask
struct sockaddr_storage | Broadcast

Detailed Description

Addresses of a network adapter.

This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with an adapter.

Definition at line 168 of file packet32.h.

Field Documentation

◆ Broadcast

struct sockaddr_storage npf_if_addr::Broadcast

Definition at line 171 of file packet32.h.

◆ IPAddress

struct sockaddr_storage npf_if_addr::IPAddress

Definition at line 169 of file packet32.h.

◆ SubnetMask

struct sockaddr_storage npf_if_addr::SubnetMask

Definition at line 170 of file packet32.h.


Watt-32 tcp/ip: npioctl Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
npioctl Struct Reference
Collaboration diagram for npioctl:
[legend]

Data Fields

int | protocol
enum NPmode | mode

Detailed Description

Definition at line 70 of file if_ppp.h.

Field Documentation

◆ mode

enum NPmode npioctl::mode

Definition at line 72 of file if_ppp.h.

◆ protocol

int npioctl::protocol

Definition at line 71 of file if_ppp.h.


Watt-32 tcp/ip: omrt6msg Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
omrt6msg Struct Reference
Collaboration diagram for omrt6msg:
[legend]

Data Fields

u_long | unused1
u_char | im6_msgtype
u_char | im6_mbz
u_char | im6_mif
u_char | unused2
struct in6_addr im6_src | im6_dst

Detailed Description

Definition at line 153 of file ip6_mrou.h.

Field Documentation

◆ im6_dst

struct in6_addr im6_src omrt6msg::im6_dst

Definition at line 164 of file ip6_mrou.h.

◆ im6_mbz

u_char omrt6msg::im6_mbz

Definition at line 161 of file ip6_mrou.h.

◆ im6_mif

u_char omrt6msg::im6_mif

Definition at line 162 of file ip6_mrou.h.

◆ im6_msgtype

u_char omrt6msg::im6_msgtype

Definition at line 155 of file ip6_mrou.h.

◆ unused1

u_long omrt6msg::unused1

Definition at line 154 of file ip6_mrou.h.

◆ unused2

u_char omrt6msg::unused2

Definition at line 163 of file ip6_mrou.h.


Watt-32 tcp/ip: one_addr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
one_addr Struct Reference
Collaboration diagram for one_addr:
[legend]

Data Fields

char | addr [MAX_IP6_SZ]
int | family

Detailed Description

Definition at line 339 of file winadinf.c.

Field Documentation

◆ addr

char one_addr::addr[MAX_IP6_SZ]

Definition at line 340 of file winadinf.c.

◆ family

int one_addr::family

Definition at line 341 of file winadinf.c.


Watt-32 tcp/ip: opaque_auth Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
opaque_auth Struct Reference
Collaboration diagram for opaque_auth:
[legend]

Data Fields

enum_t | oa_flavor
caddr_t | oa_base
u_int | oa_length

Detailed Description

Definition at line 99 of file auth.h.

Field Documentation

◆ oa_base

caddr_t opaque_auth::oa_base

Definition at line 101 of file auth.h.

◆ oa_flavor

enum_t opaque_auth::oa_flavor

Definition at line 100 of file auth.h.

◆ oa_length

u_int opaque_auth::oa_length

Definition at line 102 of file auth.h.


Watt-32 tcp/ip: option_state Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
option_state Struct Reference
Collaboration diagram for option_state:
[legend]

Data Fields

DWORD | my_value
DWORD | peer_value
enum os_state | state

Detailed Description

Definition at line 90 of file ppp.h.

Field Documentation

◆ my_value

DWORD option_state::my_value

Definition at line 91 of file ppp.h.

◆ peer_value

DWORD option_state::peer_value

Definition at line 92 of file ppp.h.

◆ state

enum os_state option_state::state

Definition at line 93 of file ppp.h.


Watt-32 tcp/ip: ortentry Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ortentry Struct Reference
Collaboration diagram for ortentry:
[legend]

Data Fields

u_int32_t | rt_hash
struct sockaddr | rt_dst
struct sockaddr | rt_gateway
int16_t | rt_flags
int16_t | rt_refcnt
u_int32_t | rt_use
struct ifnet * | rt_ifp

Detailed Description

Definition at line 117 of file route.h.

Field Documentation

◆ rt_dst

struct sockaddr ortentry::rt_dst

Definition at line 119 of file route.h.

◆ rt_flags

int16_t ortentry::rt_flags

Definition at line 121 of file route.h.

◆ rt_gateway

struct sockaddr ortentry::rt_gateway

Definition at line 120 of file route.h.

◆ rt_hash

u_int32_t ortentry::rt_hash

Definition at line 118 of file route.h.

◆ rt_ifp

struct ifnet* ortentry::rt_ifp

Definition at line 124 of file route.h.

◆ rt_refcnt

int16_t ortentry::rt_refcnt

Definition at line 122 of file route.h.

◆ rt_use

u_int32_t ortentry::rt_use

Definition at line 123 of file route.h.


Watt-32 tcp/ip: osockaddr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
osockaddr Struct Reference
Collaboration diagram for osockaddr:
[legend]

Data Fields

char | sa_data [14]
unsigned short | sa_family

Detailed Description

Definition at line 394 of file wtypes.h.

Field Documentation

◆ sa_data

char osockaddr::sa_data[14]

Definition at line 395 of file wtypes.h.

◆ sa_family

unsigned short osockaddr::sa_family

Definition at line 396 of file wtypes.h.


Watt-32 tcp/ip: outmp Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
outmp Struct Reference
Collaboration diagram for outmp:
[legend]

Data Fields

char | out_line [8]
char | out_name [8]
int32_t | out_time

Detailed Description

Definition at line 49 of file rwhod.h.

Field Documentation

◆ out_line

char outmp::out_line[8]

Definition at line 50 of file rwhod.h.

◆ out_name

char outmp::out_name[8]

Definition at line 51 of file rwhod.h.

◆ out_time

int32_t outmp::out_time

Definition at line 52 of file rwhod.h.


Watt-32 tcp/ip: packet_mreq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
packet_mreq Struct Reference
Collaboration diagram for packet_mreq:
[legend]

Data Fields

int | mr_ifindex
unsigned short | mr_type
unsigned short | mr_alen
unsigned char | mr_address [8]

Detailed Description

Definition at line 96 of file if_packe.h.

Field Documentation

◆ mr_address

unsigned char packet_mreq::mr_address[8]

Definition at line 101 of file if_packe.h.

◆ mr_alen

unsigned short packet_mreq::mr_alen

Definition at line 100 of file if_packe.h.

◆ mr_ifindex

int packet_mreq::mr_ifindex

Definition at line 98 of file if_packe.h.

◆ mr_type

unsigned short packet_mreq::mr_type

Definition at line 99 of file if_packe.h.


Watt-32 tcp/ip: PACKET_OID_DATA Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
PACKET_OID_DATA Struct Reference

Structure containing an OID request. More...

#include <packet32.h>

Collaboration diagram for PACKET_OID_DATA:
[legend]

Data Fields

DWORD | Oid
DWORD | Length
BYTE | Data [1]

Detailed Description

Structure containing an OID request.

It is used by the PacketRequest() function to send an OID to the interface card driver. It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address, the list of the multicast groups defined on it, and so on.

Definition at line 218 of file packet32.h.

Field Documentation

◆ Data

BYTE PACKET_OID_DATA::Data[1]

Definition at line 221 of file packet32.h.

◆ Length

DWORD PACKET_OID_DATA::Length

Definition at line 220 of file packet32.h.

◆ Oid

DWORD PACKET_OID_DATA::Oid

Definition at line 219 of file packet32.h.


Watt-32 tcp/ip: pim Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pim Struct Reference
Collaboration diagram for pim:
[legend]

Data Fields

u_char | pim_type:4
u_char | pim_ver:4
u_char | pim_rsv
u_short | pim_cksum

Detailed Description

Definition at line 45 of file pim6.h.

Field Documentation

◆ pim_cksum

u_short pim::pim_cksum

Definition at line 58 of file pim6.h.

◆ pim_rsv

u_char pim::pim_rsv

Definition at line 57 of file pim6.h.

◆ pim_type

u_char pim::pim_type

Definition at line 47 of file pim6.h.

◆ pim_ver

u_char pim::pim_ver

Definition at line 52 of file pim6.h.


Watt-32 tcp/ip: pim6stat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pim6stat Struct Reference
Collaboration diagram for pim6stat:
[legend]

Data Fields

u_quad_t | pim6s_rcv_total
u_quad_t | pim6s_rcv_tooshort
u_quad_t | pim6s_rcv_badsum
u_quad_t | pim6s_rcv_badversion
u_quad_t | pim6s_rcv_registers
u_quad_t | pim6s_rcv_badregisters
u_quad_t | pim6s_snd_registers

Detailed Description

Definition at line 44 of file pim6_var.h.

Field Documentation

◆ pim6s_rcv_badregisters

u_quad_t pim6stat::pim6s_rcv_badregisters

Definition at line 50 of file pim6_var.h.

◆ pim6s_rcv_badsum

u_quad_t pim6stat::pim6s_rcv_badsum

Definition at line 47 of file pim6_var.h.

◆ pim6s_rcv_badversion

u_quad_t pim6stat::pim6s_rcv_badversion

Definition at line 48 of file pim6_var.h.

◆ pim6s_rcv_registers

u_quad_t pim6stat::pim6s_rcv_registers

Definition at line 49 of file pim6_var.h.

◆ pim6s_rcv_tooshort

u_quad_t pim6stat::pim6s_rcv_tooshort

Definition at line 46 of file pim6_var.h.

◆ pim6s_rcv_total

u_quad_t pim6stat::pim6s_rcv_total

Definition at line 45 of file pim6_var.h.

◆ pim6s_snd_registers

u_quad_t pim6stat::pim6s_snd_registers

Definition at line 51 of file pim6_var.h.


Watt-32 tcp/ip: ping_cache Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ping_cache Struct Reference
Collaboration diagram for ping_cache:
[legend]

Data Fields

DWORD | host
DWORD | time
DWORD | number

Detailed Description

Our little ping-cache.

Definition at line 29 of file pcping.c.

Field Documentation

◆ host

DWORD ping_cache::host

Definition at line 30 of file pcping.c.

◆ number

DWORD ping_cache::number

Definition at line 32 of file pcping.c.

◆ time

DWORD ping_cache::time

Definition at line 31 of file pcping.c.


Watt-32 tcp/ip: ping_pkt Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ping_pkt Struct Reference

#include <pcicmp.h>

Collaboration diagram for ping_pkt:
[legend]

Data Fields

in_Header in
struct ICMP_echo icmp

Detailed Description

The ping packet.

Definition at line 141 of file pcicmp.h.

Field Documentation

◆ icmp

struct ICMP_echo ping_pkt::icmp

Definition at line 143 of file pcicmp.h.

◆ in

in_Header ping_pkt::in

Definition at line 142 of file pcicmp.h.


Watt-32 tcp/ip: pkt_info Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pkt_info Struct Reference

Placeholder for vital data accessed by capture thread. More...

#include <winpkt.h>

Collaboration diagram for pkt_info:
[legend]

Data Fields

WORD | rm_sel
WORD | rm_seg
WORD | rm_ofs
WORD | dos_ds
WORD | use_near_ptr
WORD | handle
WORD | is_serial
WORD | pkt_ip_ofs
WORD | pkt_type_ofs
struct pkt_ringbuf | pkt_queue
struct pkt_rx_element | rx_buf [RX_BUFS]
const void * | adapter_info
const void * | adapter
void * | npf_buf
int | npf_buf_size
HANDLE | recv_thread
volatile BOOL | stop_thread
volatile BOOL | thread_stopped
const char * | api_name
const char * | sys_drvr_name
func_init | init_op
func_open | open_op
func_close | close_op
func_send | send_op
func_recv | recv_op
func_get_mac | get_mac_op
func_get_stats | get_stats_op
func_get_if_stat | get_if_stat_op
func_get_if_type | get_if_type_op
func_get_if_mtu | get_if_mtu_op
func_get_if_speed | get_if_speed_op
func_get_descr | get_descr_op
func_get_drv_ver | get_drv_ver_op
const char * | error

Detailed Description

Placeholder for vital data accessed by capture thread.

Definition at line 206 of file pcpkt.h.

Field Documentation

◆ adapter

const void* pkt_info::adapter

Definition at line 71 of file winpkt.h.

◆ adapter_info

const void* pkt_info::adapter_info

Definition at line 70 of file winpkt.h.

◆ api_name

const char* pkt_info::api_name

Definition at line 80 of file winpkt.h.

◆ close_op

func_close pkt_info::close_op

Definition at line 88 of file winpkt.h.

◆ dos_ds

WORD pkt_info::dos_ds

Definition at line 208 of file pcpkt.h.

◆ error

const char* pkt_info::error

Definition at line 100 of file winpkt.h.

◆ get_descr_op

func_get_descr pkt_info::get_descr_op

Definition at line 97 of file winpkt.h.

◆ get_drv_ver_op

func_get_drv_ver pkt_info::get_drv_ver_op

Definition at line 98 of file winpkt.h.

◆ get_if_mtu_op

func_get_if_mtu pkt_info::get_if_mtu_op

Definition at line 95 of file winpkt.h.

◆ get_if_speed_op

func_get_if_speed pkt_info::get_if_speed_op

Definition at line 96 of file winpkt.h.

◆ get_if_stat_op

func_get_if_stat pkt_info::get_if_stat_op

Definition at line 93 of file winpkt.h.

◆ get_if_type_op

func_get_if_type pkt_info::get_if_type_op

Definition at line 94 of file winpkt.h.

◆ get_mac_op

func_get_mac pkt_info::get_mac_op

Definition at line 91 of file winpkt.h.

◆ get_stats_op

func_get_stats pkt_info::get_stats_op

Definition at line 92 of file winpkt.h.

◆ handle

WORD pkt_info::handle

Definition at line 210 of file pcpkt.h.

◆ init_op

func_init pkt_info::init_op

Definition at line 86 of file winpkt.h.

◆ is_serial

WORD pkt_info::is_serial

Definition at line 211 of file pcpkt.h.

◆ npf_buf

void* pkt_info::npf_buf

Definition at line 72 of file winpkt.h.

◆ npf_buf_size

int pkt_info::npf_buf_size

Definition at line 73 of file winpkt.h.

◆ open_op

func_open pkt_info::open_op

Definition at line 87 of file winpkt.h.

◆ pkt_ip_ofs

WORD pkt_info::pkt_ip_ofs

Definition at line 212 of file pcpkt.h.

◆ pkt_queue

struct pkt_ringbuf pkt_info::pkt_queue

Definition at line 214 of file pcpkt.h.

◆ pkt_type_ofs

WORD pkt_info::pkt_type_ofs

Definition at line 213 of file pcpkt.h.

◆ recv_op

func_recv pkt_info::recv_op

Definition at line 90 of file winpkt.h.

◆ recv_thread

HANDLE pkt_info::recv_thread

Definition at line 74 of file winpkt.h.

◆ rm_ofs

WORD pkt_info::rm_ofs

Definition at line 207 of file pcpkt.h.

◆ rm_seg

WORD pkt_info::rm_seg

Definition at line 207 of file pcpkt.h.

◆ rm_sel

WORD pkt_info::rm_sel

Definition at line 207 of file pcpkt.h.

◆ rx_buf

struct pkt_rx_element pkt_info::rx_buf

Definition at line 219 of file pcpkt.h.

◆ send_op

func_send pkt_info::send_op

Definition at line 89 of file winpkt.h.

◆ stop_thread

volatile BOOL pkt_info::stop_thread

Definition at line 77 of file winpkt.h.

◆ sys_drvr_name

const char* pkt_info::sys_drvr_name

Definition at line 81 of file winpkt.h.

◆ thread_stopped

volatile BOOL pkt_info::thread_stopped

Definition at line 78 of file winpkt.h.

◆ use_near_ptr

WORD pkt_info::use_near_ptr

Definition at line 209 of file pcpkt.h.


Watt-32 tcp/ip: pkt_ringbuf Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pkt_ringbuf Struct Reference

FIFO style ring-buffer. More...

#include <pcqueue.h>

Collaboration diagram for pkt_ringbuf:
[legend]

Data Fields

volatile WORD | in_index
index ahead of last buffer put
WORD | out_index
index of buffer pulled out
WORD | buf_size
size of each buffer
WORD | num_buf
number of buffers
volatile DWORD | num_drop
number of dropped pkts
DWORD_PTR | buf_start
start of buffer pool (linear addr)
WORD | dos_ofs
offset of pool, used by rmode stub

Detailed Description

FIFO style ring-buffer.

Definition at line 81 of file pcqueue.h.

Field Documentation

◆ buf_size

WORD pkt_ringbuf::buf_size

size of each buffer

Definition at line 84 of file pcqueue.h.

◆ buf_start

DWORD_PTR pkt_ringbuf::buf_start

start of buffer pool (linear addr)

Definition at line 87 of file pcqueue.h.

◆ dos_ofs

WORD pkt_ringbuf::dos_ofs

offset of pool, used by rmode stub

Definition at line 89 of file pcqueue.h.

◆ in_index

volatile WORD pkt_ringbuf::in_index

index ahead of last buffer put

Definition at line 82 of file pcqueue.h.

◆ num_buf

WORD pkt_ringbuf::num_buf

number of buffers

Definition at line 85 of file pcqueue.h.

◆ num_drop

volatile DWORD pkt_ringbuf::num_drop

number of dropped pkts

Definition at line 86 of file pcqueue.h.

◆ out_index

WORD pkt_ringbuf::out_index

index of buffer pulled out

Definition at line 83 of file pcqueue.h.


Watt-32 tcp/ip: pkt_rx_element Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pkt_rx_element Struct Reference
Collaboration diagram for pkt_rx_element:
[legend]

Data Fields

uint64 tstamp_put
uint64 tstamp_get
WORD | rx_length
BYTE | rx_buf [ETH_MAX+10]
DWORD | tstamp_put [2]
DWORD | tstamp_get [2]
WORD | handle
WORD | rx_length_1
WORD | rx_length_2
WORD | filler

Detailed Description

Definition at line 54 of file pcqueue.h.

Field Documentation

◆ filler

WORD pkt_rx_element::filler

Definition at line 67 of file pcqueue.h.

◆ handle

WORD pkt_rx_element::handle

Definition at line 64 of file pcqueue.h.

◆ rx_buf

BYTE pkt_rx_element::rx_buf

Definition at line 58 of file pcqueue.h.

◆ rx_length

WORD pkt_rx_element::rx_length

Definition at line 57 of file pcqueue.h.

◆ rx_length_1

WORD pkt_rx_element::rx_length_1

Definition at line 65 of file pcqueue.h.

◆ rx_length_2

WORD pkt_rx_element::rx_length_2

Definition at line 66 of file pcqueue.h.

◆ tstamp_get [1/2]

uint64 pkt_rx_element::tstamp_get

Definition at line 56 of file pcqueue.h.

◆ tstamp_get [2/2]

DWORD pkt_rx_element::tstamp_get[2]

Definition at line 63 of file pcqueue.h.

◆ tstamp_put [1/2]

uint64 pkt_rx_element::tstamp_put

Definition at line 55 of file pcqueue.h.

◆ tstamp_put [2/2]

DWORD pkt_rx_element::tstamp_put[2]

Definition at line 62 of file pcqueue.h.


Watt-32 tcp/ip: pkt_split Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pkt_split Struct Reference
Collaboration diagram for pkt_split:
[legend]

Data Fields

enum Components | type
const void * | data
unsigned | len

Detailed Description

Definition at line 46 of file split.h.

Field Documentation

◆ data

const void* pkt_split::data

Definition at line 48 of file split.h.

◆ len

unsigned pkt_split::len

Definition at line 49 of file split.h.

◆ type

enum Components pkt_split::type

Definition at line 47 of file split.h.


Watt-32 tcp/ip: PktParameters Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
PktParameters Struct Reference
Collaboration diagram for PktParameters:
[legend]

Data Fields

int | dummy
BYTE | major_rev
BYTE | minor_rev
BYTE | length
BYTE | addr_len
WORD | mtu
WORD | multicast_avail
WORD | rcv_bufs
WORD | xmt_bufs
WORD | int_num

Detailed Description

Definition at line 830 of file tcp.h.

Field Documentation

◆ addr_len

BYTE PktParameters::addr_len

Definition at line 858 of file tcp.h.

◆ dummy

int PktParameters::dummy

Definition at line 831 of file tcp.h.

◆ int_num

WORD PktParameters::int_num

Definition at line 863 of file tcp.h.

◆ length

BYTE PktParameters::length

Definition at line 857 of file tcp.h.

◆ major_rev

BYTE PktParameters::major_rev

Definition at line 855 of file tcp.h.

◆ minor_rev

BYTE PktParameters::minor_rev

Definition at line 856 of file tcp.h.

◆ mtu

WORD PktParameters::mtu

Definition at line 859 of file tcp.h.

◆ multicast_avail

WORD PktParameters::multicast_avail

Definition at line 860 of file tcp.h.

◆ rcv_bufs

WORD PktParameters::rcv_bufs

Definition at line 861 of file tcp.h.

◆ xmt_bufs

WORD PktParameters::xmt_bufs

Definition at line 862 of file tcp.h.


Watt-32 tcp/ip: PktStats Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
PktStats Struct Reference
Collaboration diagram for PktStats:
[legend]

Data Fields

DWORD | in_packets
DWORD | out_packets
DWORD | in_bytes
DWORD | out_bytes
DWORD | in_errors
DWORD | out_errors
DWORD | lost

Detailed Description

Definition at line 806 of file tcp.h.

Field Documentation

◆ in_bytes

DWORD PktStats::in_bytes

Definition at line 809 of file tcp.h.

◆ in_errors

DWORD PktStats::in_errors

Definition at line 811 of file tcp.h.

◆ in_packets

DWORD PktStats::in_packets

Definition at line 807 of file tcp.h.

◆ lost

DWORD PktStats::lost

Definition at line 813 of file tcp.h.

◆ out_bytes

DWORD PktStats::out_bytes

Definition at line 810 of file tcp.h.

◆ out_errors

DWORD PktStats::out_errors

Definition at line 812 of file tcp.h.

◆ out_packets

DWORD PktStats::out_packets

Definition at line 808 of file tcp.h.


Watt-32 tcp/ip: PM_driver Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
PM_driver Struct Reference
Collaboration diagram for PM_driver:
[legend]

Data Fields

int | type
const char * | name

Detailed Description

Definition at line 18 of file pcpkt32.h.

Field Documentation

◆ name

const char* PM_driver::name

Definition at line 20 of file pcpkt32.h.

◆ type

int PM_driver::type

Definition at line 19 of file pcpkt32.h.


Watt-32 tcp/ip: pmap Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pmap Struct Reference
Collaboration diagram for pmap:
[legend]

Data Fields

long unsigned | pm_prog
long unsigned | pm_vers
long unsigned | pm_prot
long unsigned | pm_port

Detailed Description

Definition at line 88 of file pmap_pro.h.

Field Documentation

◆ pm_port

long unsigned pmap::pm_port

Definition at line 92 of file pmap_pro.h.

◆ pm_prog

long unsigned pmap::pm_prog

Definition at line 89 of file pmap_pro.h.

◆ pm_prot

long unsigned pmap::pm_prot

Definition at line 91 of file pmap_pro.h.

◆ pm_vers

long unsigned pmap::pm_vers

Definition at line 90 of file pmap_pro.h.


Watt-32 tcp/ip: pmaplist Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pmaplist Struct Reference
Collaboration diagram for pmaplist:
[legend]

Data Fields

struct pmap | pml_map
struct pmaplist * | pml_next

Detailed Description

Definition at line 95 of file pmap_pro.h.

Field Documentation

◆ pml_map

struct pmap pmaplist::pml_map

Definition at line 96 of file pmap_pro.h.

◆ pml_next

struct pmaplist* pmaplist::pml_next

Definition at line 97 of file pmap_pro.h.


Watt-32 tcp/ip: pollfd Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pollfd Struct Reference
Collaboration diagram for pollfd:
[legend]

Data Fields

int | fd
int | events
int | revents

Detailed Description

Definition at line 17 of file poll.h.

Field Documentation

◆ events

int pollfd::events

Definition at line 19 of file poll.h.

◆ fd

int pollfd::fd

Definition at line 18 of file poll.h.

◆ revents

int pollfd::revents

Definition at line 20 of file poll.h.


Watt-32 tcp/ip: ppp_comp_stats Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ppp_comp_stats Struct Reference
Collaboration diagram for ppp_comp_stats:
[legend]

Data Fields

struct compstat | c
struct compstat | d

Detailed Description

Definition at line 181 of file ppp_defs.h.

Field Documentation

◆ c

struct compstat ppp_comp_stats::c

Definition at line 182 of file ppp_defs.h.

◆ d

struct compstat ppp_comp_stats::d

Definition at line 183 of file ppp_defs.h.


Watt-32 tcp/ip: ppp_dispatch Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ppp_dispatch Struct Reference
Collaboration diagram for ppp_dispatch:
[legend]

Data Fields

enum xcp_state | next
enum xcp_action | act [3]

Detailed Description

Definition at line 97 of file ppp.c.

Field Documentation

◆ act

enum xcp_action ppp_dispatch::act[3]

Definition at line 99 of file ppp.c.

◆ next

enum xcp_state ppp_dispatch::next

Definition at line 98 of file ppp.c.


Watt-32 tcp/ip: ppp_idle Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ppp_idle Struct Reference
Collaboration diagram for ppp_idle:
[legend]

Data Fields

time_t | xmit_idle
time_t | recv_idle

Detailed Description

Definition at line 190 of file ppp_defs.h.

Field Documentation

◆ recv_idle

time_t ppp_idle::recv_idle

Definition at line 192 of file ppp_defs.h.

◆ xmit_idle

time_t ppp_idle::xmit_idle

Definition at line 191 of file ppp_defs.h.


Watt-32 tcp/ip: ppp_option_data Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ppp_option_data Struct Reference
Collaboration diagram for ppp_option_data:
[legend]

Data Fields

u_char * | ptr
u_int | length
int | transmit

Detailed Description

Definition at line 76 of file if_ppp.h.

Field Documentation

◆ length

u_int ppp_option_data::length

Definition at line 78 of file if_ppp.h.

◆ ptr

u_char* ppp_option_data::ptr

Definition at line 77 of file if_ppp.h.

◆ transmit

int ppp_option_data::transmit

Definition at line 79 of file if_ppp.h.


Watt-32 tcp/ip: ppp_softc Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ppp_softc Struct Reference
Collaboration diagram for ppp_softc:
[legend]

Data Fields

struct ifnet | sc_if
int | sc_unit
u_int | sc_flags
void * | sc_devp
void(* | sc_start )(struct ppp_softc *)
void(* | sc_ctlp )(struct ppp_softc *)
void(* | sc_relinq )(struct ppp_softc *)
u_int16_t | sc_mru
int | sc_xfer
struct ifqueue | sc_rawq
struct ifqueue | sc_inq
struct ifqueue | sc_fastq
struct mbuf * | sc_togo
struct mbuf * | sc_npqueue
struct mbuf ** | sc_npqtail
struct pppstat | sc_stats
caddr_t | sc_bpf
enum NPmode | sc_npmode [NUM_NP]
struct compressor * | sc_xcomp
void * | sc_xc_state
struct compressor * | sc_rcomp
void * | sc_rc_state
time_t | sc_last_sent
time_t | sc_last_recv
struct bpf_program | sc_pass_filt
struct bpf_program | sc_active_filt
struct slcompress * | sc_comp
ext_accm | sc_asyncmap
u_int32_t | sc_rasyncmap
struct mbuf * | sc_outm
struct mbuf * | sc_m
struct mbuf * | sc_mc
char * | sc_mp
u_int16_t | sc_ilen
u_int16_t | sc_fcs
u_int16_t | sc_outfcs
u_char | sc_rawin [16]
int | sc_rawin_count

Detailed Description

Definition at line 67 of file if_pppva.h.

Field Documentation

◆ sc_active_filt

struct bpf_program ppp_softc::sc_active_filt

Definition at line 94 of file if_pppva.h.

◆ sc_asyncmap

ext_accm ppp_softc::sc_asyncmap

Definition at line 101 of file if_pppva.h.

◆ sc_bpf

caddr_t ppp_softc::sc_bpf

Definition at line 84 of file if_pppva.h.

◆ sc_comp

struct slcompress* ppp_softc::sc_comp

Definition at line 97 of file if_pppva.h.

◆ sc_ctlp

void(* ppp_softc::sc_ctlp) (struct ppp_softc *)

Definition at line 73 of file if_pppva.h.

◆ sc_devp

void* ppp_softc::sc_devp

Definition at line 71 of file if_pppva.h.

◆ sc_fastq

struct ifqueue ppp_softc::sc_fastq

Definition at line 79 of file if_pppva.h.

◆ sc_fcs

u_int16_t ppp_softc::sc_fcs

Definition at line 108 of file if_pppva.h.

◆ sc_flags

u_int ppp_softc::sc_flags

Definition at line 70 of file if_pppva.h.

◆ sc_if

struct ifnet ppp_softc::sc_if

Definition at line 68 of file if_pppva.h.

◆ sc_ilen

u_int16_t ppp_softc::sc_ilen

Definition at line 107 of file if_pppva.h.

◆ sc_inq

struct ifqueue ppp_softc::sc_inq

Definition at line 78 of file if_pppva.h.

◆ sc_last_recv

time_t ppp_softc::sc_last_recv

Definition at line 91 of file if_pppva.h.

◆ sc_last_sent

time_t ppp_softc::sc_last_sent

Definition at line 90 of file if_pppva.h.

◆ sc_m

struct mbuf* ppp_softc::sc_m

Definition at line 104 of file if_pppva.h.

◆ sc_mc

struct mbuf* ppp_softc::sc_mc

Definition at line 105 of file if_pppva.h.

◆ sc_mp

char* ppp_softc::sc_mp

Definition at line 106 of file if_pppva.h.

◆ sc_mru

u_int16_t ppp_softc::sc_mru

Definition at line 75 of file if_pppva.h.

◆ sc_npmode

enum NPmode ppp_softc::sc_npmode[NUM_NP]

Definition at line 85 of file if_pppva.h.

◆ sc_npqtail

struct mbuf** ppp_softc::sc_npqtail

Definition at line 82 of file if_pppva.h.

◆ sc_npqueue

struct mbuf* ppp_softc::sc_npqueue

Definition at line 81 of file if_pppva.h.

◆ sc_outfcs

u_int16_t ppp_softc::sc_outfcs

Definition at line 109 of file if_pppva.h.

◆ sc_outm

struct mbuf* ppp_softc::sc_outm

Definition at line 103 of file if_pppva.h.

◆ sc_pass_filt

struct bpf_program ppp_softc::sc_pass_filt

Definition at line 93 of file if_pppva.h.

◆ sc_rasyncmap

u_int32_t ppp_softc::sc_rasyncmap

Definition at line 102 of file if_pppva.h.

◆ sc_rawin

u_char ppp_softc::sc_rawin[16]

Definition at line 110 of file if_pppva.h.

◆ sc_rawin_count

int ppp_softc::sc_rawin_count

Definition at line 111 of file if_pppva.h.

◆ sc_rawq

struct ifqueue ppp_softc::sc_rawq

Definition at line 77 of file if_pppva.h.

◆ sc_rc_state

void* ppp_softc::sc_rc_state

Definition at line 89 of file if_pppva.h.

◆ sc_rcomp

struct compressor* ppp_softc::sc_rcomp

Definition at line 88 of file if_pppva.h.

◆ sc_relinq

void(* ppp_softc::sc_relinq) (struct ppp_softc *)

Definition at line 74 of file if_pppva.h.

◆ sc_start

void(* ppp_softc::sc_start) (struct ppp_softc *)

Definition at line 72 of file if_pppva.h.

◆ sc_stats

struct pppstat ppp_softc::sc_stats

Definition at line 83 of file if_pppva.h.

◆ sc_togo

struct mbuf* ppp_softc::sc_togo

Definition at line 80 of file if_pppva.h.

◆ sc_unit

int ppp_softc::sc_unit

Definition at line 69 of file if_pppva.h.

◆ sc_xc_state

void* ppp_softc::sc_xc_state

Definition at line 87 of file if_pppva.h.

◆ sc_xcomp

struct compressor* ppp_softc::sc_xcomp

Definition at line 86 of file if_pppva.h.

◆ sc_xfer

int ppp_softc::sc_xfer

Definition at line 76 of file if_pppva.h.


Watt-32 tcp/ip: ppp_state Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ppp_state Struct Reference
Collaboration diagram for ppp_state:
[legend]

Data Fields

enum ppp_phase | phase
enum parse_state | parse_state
struct ppp_xcp | xcps [2]
int | timeout_period
int | mlen
DWORD | mymagic
DWORD | hismagic
BYTE * | bp
BYTE * | up
BYTE * | inbuffer
BYTE | outbuffer [PPP_MRU]

Detailed Description

Definition at line 114 of file ppp.h.

Field Documentation

◆ bp

BYTE* ppp_state::bp

Definition at line 123 of file ppp.h.

◆ hismagic

DWORD ppp_state::hismagic

Definition at line 122 of file ppp.h.

◆ inbuffer

BYTE* ppp_state::inbuffer

Definition at line 124 of file ppp.h.

◆ mlen

int ppp_state::mlen

Definition at line 121 of file ppp.h.

◆ mymagic

DWORD ppp_state::mymagic

Definition at line 122 of file ppp.h.

◆ outbuffer

BYTE ppp_state::outbuffer[PPP_MRU]

Definition at line 125 of file ppp.h.

◆ parse_state

enum parse_state ppp_state::parse_state

Definition at line 116 of file ppp.h.

◆ phase

enum ppp_phase ppp_state::phase

Definition at line 115 of file ppp.h.

◆ timeout_period

int ppp_state::timeout_period

Definition at line 120 of file ppp.h.

◆ up

BYTE * ppp_state::up

Definition at line 123 of file ppp.h.

◆ xcps

struct ppp_xcp ppp_state::xcps[2]

Definition at line 117 of file ppp.h.


Watt-32 tcp/ip: ppp_stats Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ppp_stats Struct Reference
Collaboration diagram for ppp_stats:
[legend]

Data Fields

struct pppstat | p
struct vjstat | vj

Detailed Description

Definition at line 166 of file ppp_defs.h.

Field Documentation

◆ p

struct pppstat ppp_stats::p

Definition at line 167 of file ppp_defs.h.

◆ vj

struct vjstat ppp_stats::vj

Definition at line 168 of file ppp_defs.h.


Watt-32 tcp/ip: ppp_xcp Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ppp_xcp Struct Reference
Collaboration diagram for ppp_xcp:
[legend]

Data Fields

const char * | name
enum xcp_state | state
int | restart
time_t | timeout
int | naks_sent
ppp_func | deliver
struct xcp_type * | types
struct option_state * | opts
WORD | proto
BYTE | ident

Detailed Description

Definition at line 96 of file ppp.h.

Field Documentation

◆ deliver

ppp_func ppp_xcp::deliver

Definition at line 102 of file ppp.h.

◆ ident

BYTE ppp_xcp::ident

Definition at line 106 of file ppp.h.

◆ naks_sent

int ppp_xcp::naks_sent

Definition at line 101 of file ppp.h.

◆ name

const char* ppp_xcp::name

Definition at line 97 of file ppp.h.

◆ opts

struct option_state* ppp_xcp::opts

Definition at line 104 of file ppp.h.

◆ proto

WORD ppp_xcp::proto

Definition at line 105 of file ppp.h.

◆ restart

int ppp_xcp::restart

Definition at line 99 of file ppp.h.

◆ state

enum xcp_state ppp_xcp::state

Definition at line 98 of file ppp.h.

◆ timeout

time_t ppp_xcp::timeout

Definition at line 100 of file ppp.h.

◆ types

struct xcp_type* ppp_xcp::types

Definition at line 103 of file ppp.h.


Watt-32 tcp/ip: pppoe_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pppoe_Header Struct Reference
Collaboration diagram for pppoe_Header:
[legend]

Data Fields

BYTE | ver: 4
BYTE | type: 4
BYTE | code
WORD | session
WORD | length

Detailed Description

Definition at line 229 of file pcsed.h.

Field Documentation

◆ code

BYTE pppoe_Header::code

Definition at line 232 of file pcsed.h.

◆ length

WORD pppoe_Header::length

Definition at line 234 of file pcsed.h.

◆ session

WORD pppoe_Header::session

Definition at line 233 of file pcsed.h.

◆ type

BYTE pppoe_Header::type

Definition at line 231 of file pcsed.h.

◆ ver

BYTE pppoe_Header::ver

Definition at line 230 of file pcsed.h.


Watt-32 tcp/ip: pppoe_Packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pppoe_Packet Struct Reference
Collaboration diagram for pppoe_Packet:
[legend]

Data Fields

pppoe_Header head
BYTE data [PPPOE_MAX_DATA]

Detailed Description

Definition at line 237 of file pcsed.h.

Field Documentation

◆ data

BYTE pppoe_Packet::data[PPPOE_MAX_DATA]

Definition at line 239 of file pcsed.h.

◆ head

pppoe_Header pppoe_Packet::head

Definition at line 238 of file pcsed.h.


Watt-32 tcp/ip: pppoestat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pppoestat Struct Reference

#include <pcstat.h>

Collaboration diagram for pppoestat:
[legend]

Data Fields

DWORD | num_disc_sent
DWORD | num_disc_recv
DWORD | num_sess_sent
DWORD | num_sess_recv

Detailed Description

PPP-over-Ethernet statistics.

Definition at line 72 of file pcstat.h.

Field Documentation

◆ num_disc_recv

DWORD pppoestat::num_disc_recv

Definition at line 74 of file pcstat.h.

◆ num_disc_sent

DWORD pppoestat::num_disc_sent

Definition at line 73 of file pcstat.h.

◆ num_sess_recv

DWORD pppoestat::num_sess_recv

Definition at line 76 of file pcstat.h.

◆ num_sess_sent

DWORD pppoestat::num_sess_sent

Definition at line 75 of file pcstat.h.


Watt-32 tcp/ip: pppstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
pppstat Struct Reference
Collaboration diagram for pppstat:
[legend]

Data Fields

unsigned int | ppp_ibytes
unsigned int | ppp_ipackets
unsigned int | ppp_ierrors
unsigned int | ppp_obytes
unsigned int | ppp_opackets
unsigned int | ppp_oerrors

Detailed Description

Definition at line 146 of file ppp_defs.h.

Field Documentation

◆ ppp_ibytes

unsigned int pppstat::ppp_ibytes

Definition at line 147 of file ppp_defs.h.

◆ ppp_ierrors

unsigned int pppstat::ppp_ierrors

Definition at line 149 of file ppp_defs.h.

◆ ppp_ipackets

unsigned int pppstat::ppp_ipackets

Definition at line 148 of file ppp_defs.h.

◆ ppp_obytes

unsigned int pppstat::ppp_obytes

Definition at line 150 of file ppp_defs.h.

◆ ppp_oerrors

unsigned int pppstat::ppp_oerrors

Definition at line 152 of file ppp_defs.h.

◆ ppp_opackets

unsigned int pppstat::ppp_opackets

Definition at line 151 of file ppp_defs.h.


Watt-32 tcp/ip: prefix_table Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
prefix_table Struct Reference

More...

Collaboration diagram for prefix_table:
[legend]

Data Fields

size_t | len
ip6_address | prefix

Detailed Description

Definition at line 66 of file pcicmp6.c.

Field Documentation

◆ len

size_t prefix_table::len

Definition at line 67 of file pcicmp6.c.

◆ prefix

ip6_address prefix_table::prefix

Definition at line 68 of file pcicmp6.c.


Watt-32 tcp/ip: prf_ra Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
prf_ra Struct Reference
Collaboration diagram for prf_ra:
[legend]

Data Fields

u_char | onlink: 1
u_char | autonomous: 1
u_char | reserved: 6

Detailed Description

Definition at line 279 of file in6_var.h.

Field Documentation

◆ autonomous

u_char prf_ra::autonomous

Definition at line 281 of file in6_var.h.

◆ onlink

u_char prf_ra::onlink

Definition at line 280 of file in6_var.h.

◆ reserved

u_char prf_ra::reserved

Definition at line 282 of file in6_var.h.


Watt-32 tcp/ip: prf_rr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
prf_rr Struct Reference
Collaboration diagram for prf_rr:
[legend]

Data Fields

u_char | decrvalid: 1
u_char | decrprefd: 1
u_char | reserved: 6

Detailed Description

Definition at line 286 of file in6_var.h.

Field Documentation

◆ decrprefd

u_char prf_rr::decrprefd

Definition at line 288 of file in6_var.h.

◆ decrvalid

u_char prf_rr::decrvalid

Definition at line 287 of file in6_var.h.

◆ reserved

u_char prf_rr::reserved

Definition at line 289 of file in6_var.h.


Watt-32 tcp/ip: proc Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
proc Struct Reference
Collaboration diagram for proc:
[legend]

Data Fields

int dummy

Detailed Description

Definition at line 81 of file if.h.

Field Documentation

◆ dummy

int proc::dummy

Definition at line 81 of file if.h.


Watt-32 tcp/ip: protoent Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
protoent Struct Reference
Collaboration diagram for protoent:
[legend]

Data Fields

char * | p_name
char ** | p_aliases
int | p_proto

Detailed Description

Definition at line 131 of file netdb.h.

Field Documentation

◆ p_aliases

char** protoent::p_aliases

Definition at line 133 of file netdb.h.

◆ p_name

char* protoent::p_name

Definition at line 132 of file netdb.h.

◆ p_proto

int protoent::p_proto

Definition at line 134 of file netdb.h.


Watt-32 tcp/ip: ptr_table_s Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ptr_table_s Struct Reference
Collaboration diagram for ptr_table_s:
[legend]

Data Fields

voidpf | org_ptr
voidpf | new_ptr

Detailed Description

Definition at line 184 of file zutil.c.

Field Documentation

◆ new_ptr

voidpf ptr_table_s::new_ptr

Definition at line 186 of file zutil.c.

◆ org_ptr

voidpf ptr_table_s::org_ptr

Definition at line 185 of file zutil.c.


Watt-32 tcp/ip: radix_mask Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
radix_mask Struct Reference
Collaboration diagram for radix_mask:
[legend]

Data Fields

short | rm_b
char | rm_unused
u_char | rm_flags
struct radix_mask * | rm_mklist
union {
caddr_t rmu_mask
struct radix_node * rmu_leaf
} rm_rmu
int | rm_refs

Detailed Description

Definition at line 97 of file radix.h.

Field Documentation

◆ rm_b

short radix_mask::rm_b

Definition at line 98 of file radix.h.

◆ rm_flags

u_char radix_mask::rm_flags

Definition at line 100 of file radix.h.

◆ rm_mklist

struct radix_mask* radix_mask::rm_mklist

Definition at line 101 of file radix.h.

◆ rm_refs

int radix_mask::rm_refs

Definition at line 106 of file radix.h.

◆ rm_unused

char radix_mask::rm_unused

Definition at line 99 of file radix.h.

◆ rmu_leaf

struct radix_node* radix_mask::rmu_leaf

Definition at line 104 of file radix.h.

◆ rmu_mask

caddr_t radix_mask::rmu_mask

Definition at line 103 of file radix.h.


Watt-32 tcp/ip: radix_node Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
radix_node Struct Reference
Collaboration diagram for radix_node:
[legend]

Data Fields

struct radix_mask * | rn_mklist
struct radix_node * | rn_p
short | rn_b
char | rn_bmask
u_char | rn_flags
union {
struct {
caddr_t rn_Key
caddr_t rn_Mask
struct radix_node * rn_Dupedkey
} rn_leaf
struct {
int rn_Off
struct radix_node * rn_L
struct radix_node * rn_R
} rn_node
} rn_u
int | rn_info
struct radix_node * | rn_twin
struct radix_node * | rn_ybro

Detailed Description

Definition at line 59 of file radix.h.

Field Documentation

◆ rn_b

short radix_node::rn_b

Definition at line 62 of file radix.h.

◆ rn_bmask

char radix_node::rn_bmask

Definition at line 63 of file radix.h.

◆ rn_Dupedkey

struct radix_node* radix_node::rn_Dupedkey

Definition at line 72 of file radix.h.

◆ rn_flags

u_char radix_node::rn_flags

Definition at line 64 of file radix.h.

◆ rn_info

int radix_node::rn_info

Definition at line 81 of file radix.h.

◆ rn_Key

caddr_t radix_node::rn_Key

Definition at line 70 of file radix.h.

◆ rn_L

struct radix_node* radix_node::rn_L

Definition at line 76 of file radix.h.

◆ rn_Mask

caddr_t radix_node::rn_Mask

Definition at line 71 of file radix.h.

◆ rn_mklist

struct radix_mask* radix_node::rn_mklist

Definition at line 60 of file radix.h.

◆ rn_Off

int radix_node::rn_Off

Definition at line 75 of file radix.h.

◆ rn_p

struct radix_node* radix_node::rn_p

Definition at line 61 of file radix.h.

◆ rn_R

struct radix_node* radix_node::rn_R

Definition at line 77 of file radix.h.

◆ rn_twin

struct radix_node* radix_node::rn_twin

Definition at line 82 of file radix.h.

◆ rn_ybro

struct radix_node* radix_node::rn_ybro

Definition at line 83 of file radix.h.


Watt-32 tcp/ip: radix_node_head Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
radix_node_head Struct Reference
Collaboration diagram for radix_node_head:
[legend]

Public Member Functions

struct radix_node * | rnh_addaddr (void *v, void *mask, struct radix_node_head *head, struct radix_node nodes[])
struct radix_node * | rnh_addpkt (void *v, void *mask, struct radix_node_head *head, struct radix_node nodes[])
struct radix_node * | rnh_deladdr (void *v, void *mask, struct radix_node_head *head)
struct radix_node * | rnh_delpkt (void *v, void *mask, struct radix_node_head *head)
struct radix_node * | rnh_matchaddr (void *v, struct radix_node_head *head)
struct radix_node * | rnh_lookup (void *v, void *mask, struct radix_node_head *head)
struct radix_node * | rnh_matchpkt (void *v, struct radix_node_head *head)
int | rnh_walktree (struct radix_node_head *, int(*)(struct radix_node *, void *), void *)

Data Fields

struct radix_node * | rnh_treetop
int | rnh_addrsize
int | rnh_pktsize
struct radix_node | rnh_nodes [3]

Detailed Description

Definition at line 125 of file radix.h.

Field Documentation

◆ rnh_addrsize

int radix_node_head::rnh_addrsize

Definition at line 127 of file radix.h.

◆ rnh_nodes

struct radix_node radix_node_head::rnh_nodes[3]

Definition at line 148 of file radix.h.

◆ rnh_pktsize

int radix_node_head::rnh_pktsize

Definition at line 128 of file radix.h.

◆ rnh_treetop

struct radix_node* radix_node_head::rnh_treetop

Definition at line 126 of file radix.h.


Watt-32 tcp/ip: rarp Struct Reference

  • Data Structure Index
  • Data Fields
rarp Struct Reference


Watt-32 tcp/ip: rawcb Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
rawcb Struct Reference
Collaboration diagram for rawcb:
[legend]

Public Member Functions

LIST_ENTRY (rawcb) rcb_list

Data Fields

struct socket * | rcb_socket
struct sockaddr * | rcb_faddr
struct sockaddr * | rcb_laddr
struct sockproto | rcb_proto

Detailed Description

Definition at line 48 of file raw_cb.h.

Field Documentation

◆ rcb_faddr

struct sockaddr* rawcb::rcb_faddr

Definition at line 51 of file raw_cb.h.

◆ rcb_laddr

struct sockaddr* rawcb::rcb_laddr

Definition at line 52 of file raw_cb.h.

◆ rcb_proto

struct sockproto rawcb::rcb_proto

Definition at line 53 of file raw_cb.h.

◆ rcb_socket

struct socket* rawcb::rcb_socket

Definition at line 50 of file raw_cb.h.


Watt-32 tcp/ip: REAL_regs Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
REAL_regs Struct Reference
Collaboration diagram for REAL_regs:
[legend]

Data Fields

DWORD | r_di
DWORD | r_si
DWORD | r_bp
DWORD | reserved
DWORD | r_bx
DWORD | r_dx
DWORD | r_cx
DWORD | r_ax
WORD | r_flags
WORD | r_es
WORD | r_ds
WORD | r_fs
WORD | r_gs
WORD | r_ip
WORD | r_cs
WORD | r_sp
WORD | r_ss

Detailed Description

Definition at line 17 of file powerpak.h.

Field Documentation

◆ r_ax

DWORD REAL_regs::r_ax

Definition at line 25 of file powerpak.h.

◆ r_bp

DWORD REAL_regs::r_bp

Definition at line 20 of file powerpak.h.

◆ r_bx

DWORD REAL_regs::r_bx

Definition at line 22 of file powerpak.h.

◆ r_cs

WORD REAL_regs::r_cs

Definition at line 28 of file powerpak.h.

◆ r_cx

DWORD REAL_regs::r_cx

Definition at line 24 of file powerpak.h.

◆ r_di

DWORD REAL_regs::r_di

Definition at line 18 of file powerpak.h.

◆ r_ds

WORD REAL_regs::r_ds

Definition at line 27 of file powerpak.h.

◆ r_dx

DWORD REAL_regs::r_dx

Definition at line 23 of file powerpak.h.

◆ r_es

WORD REAL_regs::r_es

Definition at line 27 of file powerpak.h.

◆ r_flags

WORD REAL_regs::r_flags

Definition at line 26 of file powerpak.h.

◆ r_fs

WORD REAL_regs::r_fs

Definition at line 27 of file powerpak.h.

◆ r_gs

WORD REAL_regs::r_gs

Definition at line 27 of file powerpak.h.

◆ r_ip

WORD REAL_regs::r_ip

Definition at line 28 of file powerpak.h.

◆ r_si

DWORD REAL_regs::r_si

Definition at line 19 of file powerpak.h.

◆ r_sp

WORD REAL_regs::r_sp

Definition at line 28 of file powerpak.h.

◆ r_ss

WORD REAL_regs::r_ss

Definition at line 28 of file powerpak.h.

◆ reserved

DWORD REAL_regs::reserved

Definition at line 21 of file powerpak.h.


Watt-32 tcp/ip: recv_buf Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
recv_buf Struct Reference
Collaboration diagram for recv_buf:
[legend]

Data Fields

DWORD | buf_sig
DWORD | buf_hisip
long | buf_seqnum
ip6_address | buf_hisip6
WORD | buf_hisport
short | buf_len
BYTE | buf_data [ETH_MAX]

Detailed Description

Definition at line 16 of file pcrecv.h.

Field Documentation

◆ buf_data

BYTE recv_buf::buf_data[ETH_MAX]

Definition at line 25 of file pcrecv.h.

◆ buf_hisip

DWORD recv_buf::buf_hisip

Definition at line 18 of file pcrecv.h.

◆ buf_hisip6

ip6_address recv_buf::buf_hisip6

Definition at line 21 of file pcrecv.h.

◆ buf_hisport

WORD recv_buf::buf_hisport

Definition at line 23 of file pcrecv.h.

◆ buf_len

short recv_buf::buf_len

Definition at line 24 of file pcrecv.h.

◆ buf_seqnum

long recv_buf::buf_seqnum

Definition at line 19 of file pcrecv.h.

◆ buf_sig

DWORD recv_buf::buf_sig

Definition at line 17 of file pcrecv.h.


Watt-32 tcp/ip: recv_data Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
recv_data Struct Reference
Collaboration diagram for recv_data:
[legend]

Data Fields

DWORD | recv_sig
BYTE * | recv_bufs
WORD | recv_bufnum

Detailed Description

Definition at line 8 of file pcrecv.h.

Field Documentation

◆ recv_bufnum

WORD recv_data::recv_bufnum

Definition at line 11 of file pcrecv.h.

◆ recv_bufs

BYTE* recv_data::recv_bufs

Definition at line 10 of file pcrecv.h.

◆ recv_sig

DWORD recv_data::recv_sig

Definition at line 9 of file pcrecv.h.


Watt-32 tcp/ip: rejected_reply Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rejected_reply Struct Reference
Collaboration diagram for rejected_reply:
[legend]

Data Fields

enum reject_stat rj_stat
union {
struct {
u_long low
u_long high
} RJ_versions
enum auth_stat RJ_why
} ru

Detailed Description

Definition at line 115 of file rpc_msg.h.

Field Documentation

◆ high

u_long rejected_reply::high

Definition at line 120 of file rpc_msg.h.

◆ low

u_long rejected_reply::low

Definition at line 119 of file rpc_msg.h.

◆ rj_stat

enum reject_stat rejected_reply::rj_stat

Definition at line 116 of file rpc_msg.h.

◆ RJ_why

enum auth_stat rejected_reply::RJ_why

Definition at line 122 of file rpc_msg.h.


Watt-32 tcp/ip: reply_body Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
reply_body Struct Reference
Collaboration diagram for reply_body:
[legend]

Data Fields

enum reply_stat rp_stat
union {
struct accepted_reply RP_ar
struct rejected_reply RP_dr
} ru

Detailed Description

Definition at line 131 of file rpc_msg.h.

Field Documentation

◆ RP_ar

struct accepted_reply reply_body::RP_ar

Definition at line 134 of file rpc_msg.h.

◆ RP_dr

struct rejected_reply reply_body::RP_dr

Definition at line 135 of file rpc_msg.h.

◆ rp_stat

enum reply_stat reply_body::rp_stat

Definition at line 132 of file rpc_msg.h.


Watt-32 tcp/ip: rip Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rip Struct Reference
Collaboration diagram for rip:
[legend]

Data Fields

u_int8_t | rip_cmd
u_int8_t | rip_vers
u_int16_t | rip_res1
union {
struct netinfo ru_nets [1]
int8_t ru_tracefile [1]
struct netauth ru_auth [1]
} ripun

Detailed Description

Definition at line 111 of file routed.h.

Field Documentation

◆ rip_cmd

u_int8_t rip::rip_cmd

Definition at line 112 of file routed.h.

◆ rip_res1

u_int16_t rip::rip_res1

Definition at line 114 of file routed.h.

◆ rip_vers

u_int8_t rip::rip_vers

Definition at line 113 of file routed.h.

◆ ru_auth

struct netauth rip::ru_auth[1]

Definition at line 118 of file routed.h.

◆ ru_nets

struct netinfo rip::ru_nets[1]

Definition at line 116 of file routed.h.

◆ ru_tracefile

int8_t rip::ru_tracefile[1]

Definition at line 117 of file routed.h.


Watt-32 tcp/ip: rip6stat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rip6stat Struct Reference
Collaboration diagram for rip6stat:
[legend]

Data Fields

u_quad_t | rip6s_ipackets
u_quad_t | rip6s_isum
u_quad_t | rip6s_badsum
u_quad_t | rip6s_nosock
u_quad_t | rip6s_nosockmcast
u_quad_t | rip6s_fullsock
u_quad_t | rip6s_opackets

Detailed Description

Definition at line 39 of file raw_ip6.h.

Field Documentation

◆ rip6s_badsum

u_quad_t rip6stat::rip6s_badsum

Definition at line 42 of file raw_ip6.h.

◆ rip6s_fullsock

u_quad_t rip6stat::rip6s_fullsock

Definition at line 45 of file raw_ip6.h.

◆ rip6s_ipackets

u_quad_t rip6stat::rip6s_ipackets

Definition at line 40 of file raw_ip6.h.

◆ rip6s_isum

u_quad_t rip6stat::rip6s_isum

Definition at line 41 of file raw_ip6.h.

◆ rip6s_nosock

u_quad_t rip6stat::rip6s_nosock

Definition at line 43 of file raw_ip6.h.

◆ rip6s_nosockmcast

u_quad_t rip6stat::rip6s_nosockmcast

Definition at line 44 of file raw_ip6.h.

◆ rip6s_opackets

u_quad_t rip6stat::rip6s_opackets

Definition at line 47 of file raw_ip6.h.


Watt-32 tcp/ip: RMC_BLK Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
RMC_BLK Struct Reference
Collaboration diagram for RMC_BLK:
[legend]

Data Fields

WORD | ds
WORD | es
WORD | fs
WORD | gs
DWORD | eax
DWORD | ebx
DWORD | ecx
DWORD | edx

Detailed Description

Definition at line 30 of file x32vm.h.

Field Documentation

◆ ds

WORD RMC_BLK::ds

Definition at line 31 of file x32vm.h.

◆ eax

DWORD RMC_BLK::eax

Definition at line 35 of file x32vm.h.

◆ ebx

DWORD RMC_BLK::ebx

Definition at line 36 of file x32vm.h.

◆ ecx

DWORD RMC_BLK::ecx

Definition at line 37 of file x32vm.h.

◆ edx

DWORD RMC_BLK::edx

Definition at line 38 of file x32vm.h.

◆ es

WORD RMC_BLK::es

Definition at line 32 of file x32vm.h.

◆ fs

WORD RMC_BLK::fs

Definition at line 33 of file x32vm.h.

◆ gs

WORD RMC_BLK::gs

Definition at line 34 of file x32vm.h.


Watt-32 tcp/ip: RMCB_record Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
RMCB_record Struct Reference
Collaboration diagram for RMCB_record:
[legend]

Data Fields

SWI_REGS rm_reg
REALPTR | dos_real
REALPTR | dos_para_addr
UINT | stack_size
UINT * | stack_bottom
UINT * | stack_top
pmodeHook | callback
DWORD | marker

Detailed Description

Definition at line 29 of file x32vm.c.

Field Documentation

◆ callback

pmodeHook RMCB_record::callback

Definition at line 36 of file x32vm.c.

◆ dos_para_addr

REALPTR RMCB_record::dos_para_addr

Definition at line 32 of file x32vm.c.

◆ dos_real

REALPTR RMCB_record::dos_real

Definition at line 31 of file x32vm.c.

◆ marker

DWORD RMCB_record::marker

Definition at line 37 of file x32vm.c.

◆ rm_reg

SWI_REGS RMCB_record::rm_reg

Definition at line 30 of file x32vm.c.

◆ stack_bottom

UINT* RMCB_record::stack_bottom

Definition at line 34 of file x32vm.c.

◆ stack_size

UINT RMCB_record::stack_size

Definition at line 33 of file x32vm.c.

◆ stack_top

UINT* RMCB_record::stack_top

Definition at line 35 of file x32vm.c.


Watt-32 tcp/ip: RMI_BLK Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
RMI_BLK Struct Reference
Collaboration diagram for RMI_BLK:
[legend]

Data Fields

WORD | inum
WORD | ds_reg
WORD | es_reg
WORD | fs_reg
WORD | gs_reg
DWORD | eax_reg
DWORD | edx_reg

Detailed Description

Definition at line 41 of file x32vm.h.

Field Documentation

◆ ds_reg

WORD RMI_BLK::ds_reg

Definition at line 43 of file x32vm.h.

◆ eax_reg

DWORD RMI_BLK::eax_reg

Definition at line 45 of file x32vm.h.

◆ edx_reg

DWORD RMI_BLK::edx_reg

Definition at line 45 of file x32vm.h.

◆ es_reg

WORD RMI_BLK::es_reg

Definition at line 43 of file x32vm.h.

◆ fs_reg

WORD RMI_BLK::fs_reg

Definition at line 44 of file x32vm.h.

◆ gs_reg

WORD RMI_BLK::gs_reg

Definition at line 44 of file x32vm.h.

◆ inum

WORD RMI_BLK::inum

Definition at line 42 of file x32vm.h.


Watt-32 tcp/ip: rmtcallargs Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rmtcallargs Struct Reference
Collaboration diagram for rmtcallargs:
[legend]

Data Fields

u_long | prog
u_long | vers
u_long | proc
u_long | arglen
caddr_t | args_ptr
xdrproc_t | xdr_args

Detailed Description

Definition at line 46 of file pmap_rmt.h.

Field Documentation

◆ arglen

u_long rmtcallargs::arglen

Definition at line 47 of file pmap_rmt.h.

◆ args_ptr

caddr_t rmtcallargs::args_ptr

Definition at line 48 of file pmap_rmt.h.

◆ proc

u_long rmtcallargs::proc

Definition at line 47 of file pmap_rmt.h.

◆ prog

u_long rmtcallargs::prog

Definition at line 47 of file pmap_rmt.h.

◆ vers

u_long rmtcallargs::vers

Definition at line 47 of file pmap_rmt.h.

◆ xdr_args

xdrproc_t rmtcallargs::xdr_args

Definition at line 49 of file pmap_rmt.h.


Watt-32 tcp/ip: rmtcallres Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rmtcallres Struct Reference
Collaboration diagram for rmtcallres:
[legend]

Data Fields

u_long * | port_ptr
u_long | resultslen
caddr_t | results_ptr
xdrproc_t | xdr_results

Detailed Description

Definition at line 52 of file pmap_rmt.h.

Field Documentation

◆ port_ptr

u_long* rmtcallres::port_ptr

Definition at line 53 of file pmap_rmt.h.

◆ results_ptr

caddr_t rmtcallres::results_ptr

Definition at line 55 of file pmap_rmt.h.

◆ resultslen

u_long rmtcallres::resultslen

Definition at line 54 of file pmap_rmt.h.

◆ xdr_results

xdrproc_t rmtcallres::xdr_results

Definition at line 56 of file pmap_rmt.h.


Watt-32 tcp/ip: rmxp_tao Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rmxp_tao Struct Reference
Collaboration diagram for rmxp_tao:
[legend]

Data Fields

tcp_cc | tao_cc
tcp_cc | tao_ccsent
u_short | tao_mssopt
u_short | tao_flags

Detailed Description

Definition at line 239 of file tcp_var.h.

Field Documentation

◆ tao_cc

tcp_cc rmxp_tao::tao_cc

Definition at line 240 of file tcp_var.h.

◆ tao_ccsent

tcp_cc rmxp_tao::tao_ccsent

Definition at line 241 of file tcp_var.h.

◆ tao_flags

u_short rmxp_tao::tao_flags

Definition at line 244 of file tcp_var.h.

◆ tao_mssopt

u_short rmxp_tao::tao_mssopt

Definition at line 242 of file tcp_var.h.


Watt-32 tcp/ip: route Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
route Struct Reference
Collaboration diagram for route:
[legend]

Data Fields

struct rtentry * | ro_rt
struct sockaddr | ro_dst

Detailed Description

Definition at line 55 of file route.h.

Field Documentation

◆ ro_dst

struct sockaddr route::ro_dst

Definition at line 57 of file route.h.

◆ ro_rt

struct rtentry* route::ro_rt

Definition at line 56 of file route.h.


Watt-32 tcp/ip: route_cb Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
route_cb Struct Reference
Collaboration diagram for route_cb:
[legend]

Data Fields

int | ip_count
int | ns_count
int | iso_count
int | any_count

Detailed Description

Definition at line 228 of file route.h.

Field Documentation

◆ any_count

int route_cb::any_count

Definition at line 232 of file route.h.

◆ ip_count

int route_cb::ip_count

Definition at line 229 of file route.h.

◆ iso_count

int route_cb::iso_count

Definition at line 231 of file route.h.

◆ ns_count

int route_cb::ns_count

Definition at line 230 of file route.h.


Watt-32 tcp/ip: route_entry Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
route_entry Struct Reference

#include <pcarp.h>

Collaboration diagram for route_entry:
[legend]

Data Fields

DWORD | host_ip
DWORD | gate_ip
DWORD | mask
DWORD | flags

Detailed Description

Routing table.

Todo:
: Move to route.c

Definition at line 43 of file pcarp.h.

Field Documentation

◆ flags

DWORD route_entry::flags

Definition at line 47 of file pcarp.h.

◆ gate_ip

DWORD route_entry::gate_ip

Definition at line 45 of file pcarp.h.

◆ host_ip

DWORD route_entry::host_ip

Definition at line 44 of file pcarp.h.

◆ mask

DWORD route_entry::mask

Definition at line 46 of file pcarp.h.


Watt-32 tcp/ip: route_in6 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
route_in6 Struct Reference
Collaboration diagram for route_in6:
[legend]

Data Fields

struct rtentry * | ro_rt
struct sockaddr_in6 | ro_dst

Detailed Description

Definition at line 287 of file in6.h.

Field Documentation

◆ ro_dst

struct sockaddr_in6 route_in6::ro_dst

Definition at line 289 of file in6.h.

◆ ro_rt

struct rtentry * route_in6::ro_rt

Definition at line 288 of file in6.h.


Watt-32 tcp/ip: router_info Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
router_info Struct Reference
Collaboration diagram for router_info:
[legend]

Data Fields

struct ifnet * | rti_ifp
int | rti_type
int | rti_time
struct router_info * | rti_next

Detailed Description

Definition at line 93 of file in_var.h.

Field Documentation

◆ rti_ifp

struct ifnet* router_info::rti_ifp

Definition at line 94 of file in_var.h.

◆ rti_next

struct router_info* router_info::rti_next

Definition at line 97 of file in_var.h.

◆ rti_time

int router_info::rti_time

Definition at line 96 of file in_var.h.

◆ rti_type

int router_info::rti_type

Definition at line 95 of file in_var.h.


Watt-32 tcp/ip: rp_addr Struct Reference

  • Data Structure Index
  • Data Fields
Data Structures | Public Member Functions | Data Fields
rp_addr Struct Reference
Collaboration diagram for rp_addr:
[legend]

Data Structures

struct ra_flags

Public Member Functions

LIST_ENTRY (rp_addr) ra_entry

Data Fields

struct in6_addr | ra_ifid
struct in6_ifaddr * | ra_addr
struct rp_addr::ra_flags | ra_flags

Detailed Description

Definition at line 78 of file in6_pref.h.

Field Documentation

◆ ra_addr

struct in6_ifaddr* rp_addr::ra_addr

Definition at line 81 of file in6_pref.h.

◆ ra_ifid

struct in6_addr rp_addr::ra_ifid

Definition at line 80 of file in6_pref.h.


Watt-32 tcp/ip: rp_addr::ra_flags Struct Reference

  • Data Structure Index
  • Data Fields
  • rp_addr
  • ra_flags
Data Fields
rp_addr::ra_flags Struct Reference
Collaboration diagram for rp_addr::ra_flags:
[legend]

Data Fields

u_char anycast: 1

Detailed Description

Definition at line 82 of file in6_pref.h.

Field Documentation

◆ anycast

u_char rp_addr::ra_flags::anycast

Definition at line 83 of file in6_pref.h.


Watt-32 tcp/ip: rpc_createerr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rpc_createerr Struct Reference
Collaboration diagram for rpc_createerr:
[legend]

Data Fields

enum clnt_stat | cf_stat
struct rpc_err | cf_error
const char * | cf_file
unsigned | cf_line

Detailed Description

Definition at line 340 of file clnt.h.

Field Documentation

◆ cf_error

struct rpc_err rpc_createerr::cf_error

Definition at line 342 of file clnt.h.

◆ cf_file

const char* rpc_createerr::cf_file

Definition at line 343 of file clnt.h.

◆ cf_line

unsigned rpc_createerr::cf_line

Definition at line 344 of file clnt.h.

◆ cf_stat

enum clnt_stat rpc_createerr::cf_stat

Definition at line 341 of file clnt.h.


Watt-32 tcp/ip: rpc_err Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rpc_err Struct Reference
Collaboration diagram for rpc_err:
[legend]

Data Fields

enum clnt_stat re_status
union {
int RE_errno
enum auth_stat RE_why
struct {
u_long low
u_long high
} RE_vers
struct {
long s1
long s2
} RE_lb
} ru

Detailed Description

Definition at line 94 of file clnt.h.

Field Documentation

◆ high

u_long rpc_err::high

Definition at line 101 of file clnt.h.

◆ low

u_long rpc_err::low

Definition at line 100 of file clnt.h.

◆ RE_errno

int rpc_err::RE_errno

Definition at line 97 of file clnt.h.

◆ re_status

enum clnt_stat rpc_err::re_status

Definition at line 95 of file clnt.h.

◆ RE_why

enum auth_stat rpc_err::RE_why

Definition at line 98 of file clnt.h.

◆ s1

long rpc_err::s1

Definition at line 104 of file clnt.h.

◆ s2

long rpc_err::s2

Definition at line 105 of file clnt.h.


Watt-32 tcp/ip: rpc_msg Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rpc_msg Struct Reference
Collaboration diagram for rpc_msg:
[legend]

Data Fields

u_long | rm_xid
enum msg_type | rm_direction
union {
struct call_body RM_cmb
struct reply_body RM_rmb
} ru

Detailed Description

Definition at line 156 of file rpc_msg.h.

Field Documentation

◆ RM_cmb

struct call_body rpc_msg::RM_cmb

Definition at line 160 of file rpc_msg.h.

◆ rm_direction

enum msg_type rpc_msg::rm_direction

Definition at line 158 of file rpc_msg.h.

◆ RM_rmb

struct reply_body rpc_msg::RM_rmb

Definition at line 161 of file rpc_msg.h.

◆ rm_xid

u_long rpc_msg::rm_xid

Definition at line 157 of file rpc_msg.h.


Watt-32 tcp/ip: rpcent Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rpcent Struct Reference
Collaboration diagram for rpcent:
[legend]

Data Fields

char * | r_name
char ** | r_aliases
long | r_number

Detailed Description

Definition at line 77 of file rpc.h.

Field Documentation

◆ r_aliases

char** rpcent::r_aliases

Definition at line 79 of file rpc.h.

◆ r_name

char* rpcent::r_name

Definition at line 78 of file rpc.h.

◆ r_number

long rpcent::r_number

Definition at line 80 of file rpc.h.


Watt-32 tcp/ip: rr_pco_match Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rr_pco_match Struct Reference
Collaboration diagram for rr_pco_match:
[legend]

Data Fields

u_int8_t | rpm_code
u_int8_t | rpm_len
u_int8_t | rpm_ordinal
u_int8_t | rpm_matchlen
u_int8_t | rpm_minlen
u_int8_t | rpm_maxlen
u_int16_t | rpm_reserved
struct in6_addr | rpm_prefix

Detailed Description

Definition at line 463 of file icmp6.h.

Field Documentation

◆ rpm_code

u_int8_t rr_pco_match::rpm_code

Definition at line 464 of file icmp6.h.

◆ rpm_len

u_int8_t rr_pco_match::rpm_len

Definition at line 465 of file icmp6.h.

◆ rpm_matchlen

u_int8_t rr_pco_match::rpm_matchlen

Definition at line 467 of file icmp6.h.

◆ rpm_maxlen

u_int8_t rr_pco_match::rpm_maxlen

Definition at line 469 of file icmp6.h.

◆ rpm_minlen

u_int8_t rr_pco_match::rpm_minlen

Definition at line 468 of file icmp6.h.

◆ rpm_ordinal

u_int8_t rr_pco_match::rpm_ordinal

Definition at line 466 of file icmp6.h.

◆ rpm_prefix

struct in6_addr rr_pco_match::rpm_prefix

Definition at line 471 of file icmp6.h.

◆ rpm_reserved

u_int16_t rr_pco_match::rpm_reserved

Definition at line 470 of file icmp6.h.


Watt-32 tcp/ip: rr_pco_use Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rr_pco_use Struct Reference
Collaboration diagram for rr_pco_use:
[legend]

Data Fields

u_int8_t | rpu_uselen
u_int8_t | rpu_keeplen
u_int8_t | rpu_ramask
u_int8_t | rpu_raflags
u_int32_t | rpu_vltime
u_int32_t | rpu_pltime
u_int32_t | rpu_flags
struct in6_addr | rpu_prefix

Detailed Description

Definition at line 479 of file icmp6.h.

Field Documentation

◆ rpu_flags

u_int32_t rr_pco_use::rpu_flags

Definition at line 486 of file icmp6.h.

◆ rpu_keeplen

u_int8_t rr_pco_use::rpu_keeplen

Definition at line 481 of file icmp6.h.

◆ rpu_pltime

u_int32_t rr_pco_use::rpu_pltime

Definition at line 485 of file icmp6.h.

◆ rpu_prefix

struct in6_addr rr_pco_use::rpu_prefix

Definition at line 487 of file icmp6.h.

◆ rpu_raflags

u_int8_t rr_pco_use::rpu_raflags

Definition at line 483 of file icmp6.h.

◆ rpu_ramask

u_int8_t rr_pco_use::rpu_ramask

Definition at line 482 of file icmp6.h.

◆ rpu_uselen

u_int8_t rr_pco_use::rpu_uselen

Definition at line 480 of file icmp6.h.

◆ rpu_vltime

u_int32_t rr_pco_use::rpu_vltime

Definition at line 484 of file icmp6.h.


Watt-32 tcp/ip: rr_prefix Struct Reference

  • Data Structure Index
  • Data Fields
Data Structures | Public Member Functions | Data Fields
rr_prefix Struct Reference
Collaboration diagram for rr_prefix:
[legend]

Data Structures

struct rp_stateflags

Public Member Functions

LIST_ENTRY (rr_prefix) rp_entry
LIST_HEAD (rp_addrhead, rp_addr) rp_addrhead

Data Fields

struct ifprefix | rp_ifpr
struct sockaddr_in6 | rp_prefix
u_int32_t | rp_vltime
u_int32_t | rp_pltime
time_t | rp_expire
time_t | rp_preferred
struct in6_prflags | rp_flags
u_char | rp_origin
struct rr_prefix::rp_stateflags | rp_stateflags

Detailed Description

Definition at line 45 of file in6_pref.h.

Field Documentation

◆ rp_expire

time_t rr_prefix::rp_expire

Definition at line 52 of file in6_pref.h.

◆ rp_flags

struct in6_prflags rr_prefix::rp_flags

Definition at line 54 of file in6_pref.h.

◆ rp_ifpr

struct ifprefix rr_prefix::rp_ifpr

Definition at line 46 of file in6_pref.h.

◆ rp_origin

u_char rr_prefix::rp_origin

Definition at line 55 of file in6_pref.h.

◆ rp_pltime

u_int32_t rr_prefix::rp_pltime

Definition at line 51 of file in6_pref.h.

◆ rp_preferred

time_t rr_prefix::rp_preferred

Definition at line 53 of file in6_pref.h.

◆ rp_prefix

struct sockaddr_in6 rr_prefix::rp_prefix

Definition at line 49 of file in6_pref.h.

◆ rp_vltime

u_int32_t rr_prefix::rp_vltime

Definition at line 50 of file in6_pref.h.


Watt-32 tcp/ip: rr_prefix::rp_stateflags Struct Reference

  • Data Structure Index
  • Data Fields
  • rr_prefix
  • rp_stateflags
Data Fields
rr_prefix::rp_stateflags Struct Reference
Collaboration diagram for rr_prefix::rp_stateflags:
[legend]

Data Fields

u_char | addmark: 1
u_char | delmark: 1

Detailed Description

Definition at line 56 of file in6_pref.h.

Field Documentation

◆ addmark

u_char rr_prefix::rp_stateflags::addmark

Definition at line 58 of file in6_pref.h.

◆ delmark

u_char rr_prefix::rp_stateflags::delmark

Definition at line 59 of file in6_pref.h.


Watt-32 tcp/ip: rr_result Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rr_result Struct Reference
Collaboration diagram for rr_result:
[legend]

Data Fields

u_int16_t | rrr_flags
u_int8_t | rrr_ordinal
u_int8_t | rrr_matchedlen
u_int32_t | rrr_ifid
struct in6_addr | rrr_prefix

Detailed Description

Definition at line 501 of file icmp6.h.

Field Documentation

◆ rrr_flags

u_int16_t rr_result::rrr_flags

Definition at line 502 of file icmp6.h.

◆ rrr_ifid

u_int32_t rr_result::rrr_ifid

Definition at line 505 of file icmp6.h.

◆ rrr_matchedlen

u_int8_t rr_result::rrr_matchedlen

Definition at line 504 of file icmp6.h.

◆ rrr_ordinal

u_int8_t rr_result::rrr_ordinal

Definition at line 503 of file icmp6.h.

◆ rrr_prefix

struct in6_addr rr_result::rrr_prefix

Definition at line 506 of file icmp6.h.


Watt-32 tcp/ip: rrec Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rrec Struct Reference
Collaboration diagram for rrec:
[legend]

Data Fields

u_short | r_zone
u_short | r_class
u_short | r_type
u_long | r_ttl
int | r_size
char * | r_data

Detailed Description

Definition at line 270 of file nameser.h.

Field Documentation

◆ r_class

u_short rrec::r_class

Definition at line 272 of file nameser.h.

◆ r_data

char* rrec::r_data

Definition at line 276 of file nameser.h.

◆ r_size

int rrec::r_size

Definition at line 275 of file nameser.h.

◆ r_ttl

u_long rrec::r_ttl

Definition at line 274 of file nameser.h.

◆ r_type

u_short rrec::r_type

Definition at line 273 of file nameser.h.

◆ r_zone

u_short rrec::r_zone

Definition at line 271 of file nameser.h.


Watt-32 tcp/ip: rt_addrinfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rt_addrinfo Struct Reference
Collaboration diagram for rt_addrinfo:
[legend]

Data Fields

int | rti_addrs
struct sockaddr * | rti_info [RTAX_MAX]

Detailed Description

Definition at line 223 of file route.h.

Field Documentation

◆ rti_addrs

int rt_addrinfo::rti_addrs

Definition at line 224 of file route.h.

◆ rti_info

struct sockaddr* rt_addrinfo::rti_info[RTAX_MAX]

Definition at line 225 of file route.h.


Watt-32 tcp/ip: rt_metrics Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rt_metrics Struct Reference
Collaboration diagram for rt_metrics:
[legend]

Data Fields

u_long | rmx_locks
u_long | rmx_mtu
u_long | rmx_hopcount
u_long | rmx_expire
u_long | rmx_recvpipe
u_long | rmx_sendpipe
u_long | rmx_ssthresh
u_long | rmx_rtt
u_long | rmx_rttvar
u_long | rmx_pksent

Detailed Description

Definition at line 64 of file route.h.

Field Documentation

◆ rmx_expire

u_long rt_metrics::rmx_expire

Definition at line 68 of file route.h.

◆ rmx_hopcount

u_long rt_metrics::rmx_hopcount

Definition at line 67 of file route.h.

◆ rmx_locks

u_long rt_metrics::rmx_locks

Definition at line 65 of file route.h.

◆ rmx_mtu

u_long rt_metrics::rmx_mtu

Definition at line 66 of file route.h.

◆ rmx_pksent

u_long rt_metrics::rmx_pksent

Definition at line 74 of file route.h.

◆ rmx_recvpipe

u_long rt_metrics::rmx_recvpipe

Definition at line 69 of file route.h.

◆ rmx_rtt

u_long rt_metrics::rmx_rtt

Definition at line 72 of file route.h.

◆ rmx_rttvar

u_long rt_metrics::rmx_rttvar

Definition at line 73 of file route.h.

◆ rmx_sendpipe

u_long rt_metrics::rmx_sendpipe

Definition at line 70 of file route.h.

◆ rmx_ssthresh

u_long rt_metrics::rmx_ssthresh

Definition at line 71 of file route.h.


Watt-32 tcp/ip: rt_msghdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rt_msghdr Struct Reference
Collaboration diagram for rt_msghdr:
[legend]

Data Fields

u_short | rtm_msglen
u_char | rtm_version
u_char | rtm_type
u_short | rtm_index
int | rtm_flags
int | rtm_addrs
int | rtm_pid
int | rtm_seq
int | rtm_errno
int | rtm_use
u_long | rtm_inits
struct rt_metrics | rtm_rmx

Detailed Description

Definition at line 157 of file route.h.

Field Documentation

◆ rtm_addrs

int rt_msghdr::rtm_addrs

Definition at line 163 of file route.h.

◆ rtm_errno

int rt_msghdr::rtm_errno

Definition at line 166 of file route.h.

◆ rtm_flags

int rt_msghdr::rtm_flags

Definition at line 162 of file route.h.

◆ rtm_index

u_short rt_msghdr::rtm_index

Definition at line 161 of file route.h.

◆ rtm_inits

u_long rt_msghdr::rtm_inits

Definition at line 168 of file route.h.

◆ rtm_msglen

u_short rt_msghdr::rtm_msglen

Definition at line 158 of file route.h.

◆ rtm_pid

int rt_msghdr::rtm_pid

Definition at line 164 of file route.h.

◆ rtm_rmx

struct rt_metrics rt_msghdr::rtm_rmx

Definition at line 169 of file route.h.

◆ rtm_seq

int rt_msghdr::rtm_seq

Definition at line 165 of file route.h.

◆ rtm_type

u_char rt_msghdr::rtm_type

Definition at line 160 of file route.h.

◆ rtm_use

int rt_msghdr::rtm_use

Definition at line 167 of file route.h.

◆ rtm_version

u_char rt_msghdr::rtm_version

Definition at line 159 of file route.h.


Watt-32 tcp/ip: rtdetq Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rtdetq Struct Reference
Collaboration diagram for rtdetq:
[legend]

Data Fields

struct mbuf * | m
struct ifnet * | ifp
vifi_t | xmt_vif
struct timeval | t
struct rtdetq * | next

Detailed Description

Definition at line 220 of file ip_mrout.h.

Field Documentation

◆ ifp

struct ifnet * rtdetq::ifp

Definition at line 222 of file ip_mrout.h.

◆ m

struct mbuf * rtdetq::m

Definition at line 221 of file ip_mrout.h.

◆ next

struct rtdetq* rtdetq::next

Definition at line 263 of file ip6_mrou.h.

◆ t

struct timeval rtdetq::t

Definition at line 225 of file ip_mrout.h.

◆ xmt_vif

vifi_t rtdetq::xmt_vif

Definition at line 223 of file ip_mrout.h.


Watt-32 tcp/ip: rtentry Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rtentry Struct Reference
Collaboration diagram for rtentry:
[legend]

Data Fields

struct radix_node | rt_nodes [2]
struct sockaddr * | rt_gateway
short | rt_flags
short | rt_refcnt
u_long | rt_use
struct ifnet * | rt_ifp
struct ifaddr * | rt_ifa
struct sockaddr * | rt_genmask
caddr_t | rt_llinfo
struct rt_metrics | rt_rmx
struct rtentry * | rt_gwroute

Detailed Description

Definition at line 97 of file route.h.

Field Documentation

◆ rt_flags

short rtentry::rt_flags

Definition at line 102 of file route.h.

◆ rt_gateway

struct sockaddr* rtentry::rt_gateway

Definition at line 101 of file route.h.

◆ rt_genmask

struct sockaddr* rtentry::rt_genmask

Definition at line 107 of file route.h.

◆ rt_gwroute

struct rtentry* rtentry::rt_gwroute

Definition at line 110 of file route.h.

◆ rt_ifa

struct ifaddr* rtentry::rt_ifa

Definition at line 106 of file route.h.

◆ rt_ifp

struct ifnet* rtentry::rt_ifp

Definition at line 105 of file route.h.

◆ rt_llinfo

caddr_t rtentry::rt_llinfo

Definition at line 108 of file route.h.

◆ rt_nodes

struct radix_node rtentry::rt_nodes[2]

Definition at line 98 of file route.h.

◆ rt_refcnt

short rtentry::rt_refcnt

Definition at line 103 of file route.h.

◆ rt_rmx

struct rt_metrics rtentry::rt_rmx

Definition at line 109 of file route.h.

◆ rt_use

u_long rtentry::rt_use

Definition at line 104 of file route.h.


Watt-32 tcp/ip: rtstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
rtstat Struct Reference
Collaboration diagram for rtstat:
[legend]

Data Fields

short | rts_badredirect
short | rts_dynamic
short | rts_newgateway
short | rts_unreach
short | rts_wildcard

Detailed Description

Definition at line 147 of file route.h.

Field Documentation

◆ rts_badredirect

short rtstat::rts_badredirect

Definition at line 148 of file route.h.

◆ rts_dynamic

short rtstat::rts_dynamic

Definition at line 149 of file route.h.

◆ rts_newgateway

short rtstat::rts_newgateway

Definition at line 150 of file route.h.

◆ rts_unreach

short rtstat::rts_unreach

Definition at line 151 of file route.h.

◆ rts_wildcard

short rtstat::rts_wildcard

Definition at line 152 of file route.h.


Watt-32 tcp/ip: run_list Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
run_list Struct Reference

Register an on-startup/at-exit function. More...

Collaboration diagram for run_list:
[legend]

Data Fields

_VoidProc | func
const char * | name
int | order
const char * | file
unsigned | line
BOOL | running

Detailed Description

Register an on-startup/at-exit function.

Insert the 'func' so functions with lowest order are run first. All registered functions (added with startup_add() or rundown_add()) must have different orders.

Definition at line 18 of file run.c.

Field Documentation

◆ file

const char* run_list::file

Definition at line 22 of file run.c.

◆ func

_VoidProc run_list::func

Definition at line 19 of file run.c.

◆ line

unsigned run_list::line

Definition at line 23 of file run.c.

◆ name

const char* run_list::name

Definition at line 20 of file run.c.

◆ order

int run_list::order

Definition at line 21 of file run.c.

◆ running

BOOL run_list::running

Definition at line 24 of file run.c.


Watt-32 tcp/ip: sackblock Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sackblock Struct Reference
Collaboration diagram for sackblock:
[legend]

Data Fields

tcp_seq | start
tcp_seq | end

Detailed Description

Definition at line 72 of file tcp_var.h.

Field Documentation

◆ end

tcp_seq sackblock::end

Definition at line 74 of file tcp_var.h.

◆ start

tcp_seq sackblock::start

Definition at line 73 of file tcp_var.h.


Watt-32 tcp/ip: sadb_address Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_address Struct Reference
Collaboration diagram for sadb_address:
[legend]

Data Fields

u_int16_t | sadb_address_len
u_int16_t | sadb_address_exttype
u_int8_t | sadb_address_proto
u_int8_t | sadb_address_prefixlen
u_int16_t | sadb_address_reserved

Detailed Description

Definition at line 118 of file pfkeyv2.h.

Field Documentation

◆ sadb_address_exttype

u_int16_t sadb_address::sadb_address_exttype

Definition at line 120 of file pfkeyv2.h.

◆ sadb_address_len

u_int16_t sadb_address::sadb_address_len

Definition at line 119 of file pfkeyv2.h.

◆ sadb_address_prefixlen

u_int8_t sadb_address::sadb_address_prefixlen

Definition at line 122 of file pfkeyv2.h.

◆ sadb_address_proto

u_int8_t sadb_address::sadb_address_proto

Definition at line 121 of file pfkeyv2.h.

◆ sadb_address_reserved

u_int16_t sadb_address::sadb_address_reserved

Definition at line 123 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_alg Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_alg Struct Reference
Collaboration diagram for sadb_alg:
[legend]

Data Fields

u_int8_t | sadb_alg_id
u_int8_t | sadb_alg_ivlen
u_int16_t | sadb_alg_minbits
u_int16_t | sadb_alg_maxbits
u_int16_t | sadb_alg_reserved

Detailed Description

Definition at line 184 of file pfkeyv2.h.

Field Documentation

◆ sadb_alg_id

u_int8_t sadb_alg::sadb_alg_id

Definition at line 185 of file pfkeyv2.h.

◆ sadb_alg_ivlen

u_int8_t sadb_alg::sadb_alg_ivlen

Definition at line 186 of file pfkeyv2.h.

◆ sadb_alg_maxbits

u_int16_t sadb_alg::sadb_alg_maxbits

Definition at line 188 of file pfkeyv2.h.

◆ sadb_alg_minbits

u_int16_t sadb_alg::sadb_alg_minbits

Definition at line 187 of file pfkeyv2.h.

◆ sadb_alg_reserved

u_int16_t sadb_alg::sadb_alg_reserved

Definition at line 189 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_comb Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_comb Struct Reference
Collaboration diagram for sadb_comb:
[legend]

Data Fields

u_int8_t | sadb_comb_auth
u_int8_t | sadb_comb_encrypt
u_int16_t | sadb_comb_flags
u_int16_t | sadb_comb_auth_minbits
u_int16_t | sadb_comb_auth_maxbits
u_int16_t | sadb_comb_encrypt_minbits
u_int16_t | sadb_comb_encrypt_maxbits
u_int32_t | sadb_comb_reserved
u_int32_t | sadb_comb_soft_allocations
u_int32_t | sadb_comb_hard_allocations
u_int64_t | sadb_comb_soft_bytes
u_int64_t | sadb_comb_hard_bytes
u_int64_t | sadb_comb_soft_addtime
u_int64_t | sadb_comb_hard_addtime
u_int64_t | sadb_comb_soft_usetime
u_int64_t | sadb_comb_hard_usetime

Detailed Description

Definition at line 159 of file pfkeyv2.h.

Field Documentation

◆ sadb_comb_auth

u_int8_t sadb_comb::sadb_comb_auth

Definition at line 160 of file pfkeyv2.h.

◆ sadb_comb_auth_maxbits

u_int16_t sadb_comb::sadb_comb_auth_maxbits

Definition at line 164 of file pfkeyv2.h.

◆ sadb_comb_auth_minbits

u_int16_t sadb_comb::sadb_comb_auth_minbits

Definition at line 163 of file pfkeyv2.h.

◆ sadb_comb_encrypt

u_int8_t sadb_comb::sadb_comb_encrypt

Definition at line 161 of file pfkeyv2.h.

◆ sadb_comb_encrypt_maxbits

u_int16_t sadb_comb::sadb_comb_encrypt_maxbits

Definition at line 166 of file pfkeyv2.h.

◆ sadb_comb_encrypt_minbits

u_int16_t sadb_comb::sadb_comb_encrypt_minbits

Definition at line 165 of file pfkeyv2.h.

◆ sadb_comb_flags

u_int16_t sadb_comb::sadb_comb_flags

Definition at line 162 of file pfkeyv2.h.

◆ sadb_comb_hard_addtime

u_int64_t sadb_comb::sadb_comb_hard_addtime

Definition at line 173 of file pfkeyv2.h.

◆ sadb_comb_hard_allocations

u_int32_t sadb_comb::sadb_comb_hard_allocations

Definition at line 169 of file pfkeyv2.h.

◆ sadb_comb_hard_bytes

u_int64_t sadb_comb::sadb_comb_hard_bytes

Definition at line 171 of file pfkeyv2.h.

◆ sadb_comb_hard_usetime

u_int64_t sadb_comb::sadb_comb_hard_usetime

Definition at line 175 of file pfkeyv2.h.

◆ sadb_comb_reserved

u_int32_t sadb_comb::sadb_comb_reserved

Definition at line 167 of file pfkeyv2.h.

◆ sadb_comb_soft_addtime

u_int64_t sadb_comb::sadb_comb_soft_addtime

Definition at line 172 of file pfkeyv2.h.

◆ sadb_comb_soft_allocations

u_int32_t sadb_comb::sadb_comb_soft_allocations

Definition at line 168 of file pfkeyv2.h.

◆ sadb_comb_soft_bytes

u_int64_t sadb_comb::sadb_comb_soft_bytes

Definition at line 170 of file pfkeyv2.h.

◆ sadb_comb_soft_usetime

u_int64_t sadb_comb::sadb_comb_soft_usetime

Definition at line 174 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_ext Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_ext Struct Reference
Collaboration diagram for sadb_ext:
[legend]

Data Fields

u_int16_t | sadb_ext_len
u_int16_t | sadb_ext_type

Detailed Description

Definition at line 93 of file pfkeyv2.h.

Field Documentation

◆ sadb_ext_len

u_int16_t sadb_ext::sadb_ext_len

Definition at line 94 of file pfkeyv2.h.

◆ sadb_ext_type

u_int16_t sadb_ext::sadb_ext_type

Definition at line 95 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_ident Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_ident Struct Reference
Collaboration diagram for sadb_ident:
[legend]

Data Fields

u_int16_t | sadb_ident_len
u_int16_t | sadb_ident_exttype
u_int16_t | sadb_ident_type
u_int16_t | sadb_ident_reserved
u_int64_t | sadb_ident_id

Detailed Description

Definition at line 133 of file pfkeyv2.h.

Field Documentation

◆ sadb_ident_exttype

u_int16_t sadb_ident::sadb_ident_exttype

Definition at line 135 of file pfkeyv2.h.

◆ sadb_ident_id

u_int64_t sadb_ident::sadb_ident_id

Definition at line 138 of file pfkeyv2.h.

◆ sadb_ident_len

u_int16_t sadb_ident::sadb_ident_len

Definition at line 134 of file pfkeyv2.h.

◆ sadb_ident_reserved

u_int16_t sadb_ident::sadb_ident_reserved

Definition at line 137 of file pfkeyv2.h.

◆ sadb_ident_type

u_int16_t sadb_ident::sadb_ident_type

Definition at line 136 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_key Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_key Struct Reference
Collaboration diagram for sadb_key:
[legend]

Data Fields

u_int16_t | sadb_key_len
u_int16_t | sadb_key_exttype
u_int16_t | sadb_key_bits
u_int16_t | sadb_key_reserved

Detailed Description

Definition at line 126 of file pfkeyv2.h.

Field Documentation

◆ sadb_key_bits

u_int16_t sadb_key::sadb_key_bits

Definition at line 129 of file pfkeyv2.h.

◆ sadb_key_exttype

u_int16_t sadb_key::sadb_key_exttype

Definition at line 128 of file pfkeyv2.h.

◆ sadb_key_len

u_int16_t sadb_key::sadb_key_len

Definition at line 127 of file pfkeyv2.h.

◆ sadb_key_reserved

u_int16_t sadb_key::sadb_key_reserved

Definition at line 130 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_lifetime Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_lifetime Struct Reference
Collaboration diagram for sadb_lifetime:
[legend]

Data Fields

u_int16_t | sadb_lifetime_len
u_int16_t | sadb_lifetime_exttype
u_int32_t | sadb_lifetime_allocations
u_int64_t | sadb_lifetime_bytes
u_int64_t | sadb_lifetime_addtime
u_int64_t | sadb_lifetime_usetime

Detailed Description

Definition at line 109 of file pfkeyv2.h.

Field Documentation

◆ sadb_lifetime_addtime

u_int64_t sadb_lifetime::sadb_lifetime_addtime

Definition at line 114 of file pfkeyv2.h.

◆ sadb_lifetime_allocations

u_int32_t sadb_lifetime::sadb_lifetime_allocations

Definition at line 112 of file pfkeyv2.h.

◆ sadb_lifetime_bytes

u_int64_t sadb_lifetime::sadb_lifetime_bytes

Definition at line 113 of file pfkeyv2.h.

◆ sadb_lifetime_exttype

u_int16_t sadb_lifetime::sadb_lifetime_exttype

Definition at line 111 of file pfkeyv2.h.

◆ sadb_lifetime_len

u_int16_t sadb_lifetime::sadb_lifetime_len

Definition at line 110 of file pfkeyv2.h.

◆ sadb_lifetime_usetime

u_int64_t sadb_lifetime::sadb_lifetime_usetime

Definition at line 115 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_msg Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_msg Struct Reference
Collaboration diagram for sadb_msg:
[legend]

Data Fields

u_int8_t | sadb_msg_version
u_int8_t | sadb_msg_type
u_int8_t | sadb_msg_errno
u_int8_t | sadb_msg_satype
u_int16_t | sadb_msg_len
u_int16_t | sadb_msg_reserved
u_int32_t | sadb_msg_seq
u_int32_t | sadb_msg_pid

Detailed Description

Definition at line 82 of file pfkeyv2.h.

Field Documentation

◆ sadb_msg_errno

u_int8_t sadb_msg::sadb_msg_errno

Definition at line 85 of file pfkeyv2.h.

◆ sadb_msg_len

u_int16_t sadb_msg::sadb_msg_len

Definition at line 87 of file pfkeyv2.h.

◆ sadb_msg_pid

u_int32_t sadb_msg::sadb_msg_pid

Definition at line 90 of file pfkeyv2.h.

◆ sadb_msg_reserved

u_int16_t sadb_msg::sadb_msg_reserved

Definition at line 88 of file pfkeyv2.h.

◆ sadb_msg_satype

u_int8_t sadb_msg::sadb_msg_satype

Definition at line 86 of file pfkeyv2.h.

◆ sadb_msg_seq

u_int32_t sadb_msg::sadb_msg_seq

Definition at line 89 of file pfkeyv2.h.

◆ sadb_msg_type

u_int8_t sadb_msg::sadb_msg_type

Definition at line 84 of file pfkeyv2.h.

◆ sadb_msg_version

u_int8_t sadb_msg::sadb_msg_version

Definition at line 83 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_prop Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_prop Struct Reference
Collaboration diagram for sadb_prop:
[legend]

Data Fields

u_int16_t | sadb_prop_len
u_int16_t | sadb_prop_exttype
u_int8_t | sadb_prop_replay
u_int8_t | sadb_prop_reserved [3]

Detailed Description

Definition at line 152 of file pfkeyv2.h.

Field Documentation

◆ sadb_prop_exttype

u_int16_t sadb_prop::sadb_prop_exttype

Definition at line 154 of file pfkeyv2.h.

◆ sadb_prop_len

u_int16_t sadb_prop::sadb_prop_len

Definition at line 153 of file pfkeyv2.h.

◆ sadb_prop_replay

u_int8_t sadb_prop::sadb_prop_replay

Definition at line 155 of file pfkeyv2.h.

◆ sadb_prop_reserved

u_int8_t sadb_prop::sadb_prop_reserved[3]

Definition at line 156 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_sa Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_sa Struct Reference
Collaboration diagram for sadb_sa:
[legend]

Data Fields

u_int16_t | sadb_sa_len
u_int16_t | sadb_sa_exttype
u_int32_t | sadb_sa_spi
u_int8_t | sadb_sa_replay
u_int8_t | sadb_sa_state
u_int8_t | sadb_sa_auth
u_int8_t | sadb_sa_encrypt
u_int32_t | sadb_sa_flags

Detailed Description

Definition at line 98 of file pfkeyv2.h.

Field Documentation

◆ sadb_sa_auth

u_int8_t sadb_sa::sadb_sa_auth

Definition at line 104 of file pfkeyv2.h.

◆ sadb_sa_encrypt

u_int8_t sadb_sa::sadb_sa_encrypt

Definition at line 105 of file pfkeyv2.h.

◆ sadb_sa_exttype

u_int16_t sadb_sa::sadb_sa_exttype

Definition at line 100 of file pfkeyv2.h.

◆ sadb_sa_flags

u_int32_t sadb_sa::sadb_sa_flags

Definition at line 106 of file pfkeyv2.h.

◆ sadb_sa_len

u_int16_t sadb_sa::sadb_sa_len

Definition at line 99 of file pfkeyv2.h.

◆ sadb_sa_replay

u_int8_t sadb_sa::sadb_sa_replay

Definition at line 102 of file pfkeyv2.h.

◆ sadb_sa_spi

u_int32_t sadb_sa::sadb_sa_spi

Definition at line 101 of file pfkeyv2.h.

◆ sadb_sa_state

u_int8_t sadb_sa::sadb_sa_state

Definition at line 103 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_sens Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_sens Struct Reference
Collaboration diagram for sadb_sens:
[legend]

Data Fields

u_int16_t | sadb_sens_len
u_int16_t | sadb_sens_exttype
u_int32_t | sadb_sens_dpd
u_int8_t | sadb_sens_sens_level
u_int8_t | sadb_sens_sens_len
u_int8_t | sadb_sens_integ_level
u_int8_t | sadb_sens_integ_len
u_int32_t | sadb_sens_reserved

Detailed Description

Definition at line 141 of file pfkeyv2.h.

Field Documentation

◆ sadb_sens_dpd

u_int32_t sadb_sens::sadb_sens_dpd

Definition at line 144 of file pfkeyv2.h.

◆ sadb_sens_exttype

u_int16_t sadb_sens::sadb_sens_exttype

Definition at line 143 of file pfkeyv2.h.

◆ sadb_sens_integ_len

u_int8_t sadb_sens::sadb_sens_integ_len

Definition at line 148 of file pfkeyv2.h.

◆ sadb_sens_integ_level

u_int8_t sadb_sens::sadb_sens_integ_level

Definition at line 147 of file pfkeyv2.h.

◆ sadb_sens_len

u_int16_t sadb_sens::sadb_sens_len

Definition at line 142 of file pfkeyv2.h.

◆ sadb_sens_reserved

u_int32_t sadb_sens::sadb_sens_reserved

Definition at line 149 of file pfkeyv2.h.

◆ sadb_sens_sens_len

u_int8_t sadb_sens::sadb_sens_sens_len

Definition at line 146 of file pfkeyv2.h.

◆ sadb_sens_sens_level

u_int8_t sadb_sens::sadb_sens_sens_level

Definition at line 145 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_spirange Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_spirange Struct Reference
Collaboration diagram for sadb_spirange:
[legend]

Data Fields

u_int16_t | sadb_spirange_len
u_int16_t | sadb_spirange_exttype
u_int32_t | sadb_spirange_min
u_int32_t | sadb_spirange_max
u_int32_t | sadb_spirange_reserved

Detailed Description

Definition at line 192 of file pfkeyv2.h.

Field Documentation

◆ sadb_spirange_exttype

u_int16_t sadb_spirange::sadb_spirange_exttype

Definition at line 194 of file pfkeyv2.h.

◆ sadb_spirange_len

u_int16_t sadb_spirange::sadb_spirange_len

Definition at line 193 of file pfkeyv2.h.

◆ sadb_spirange_max

u_int32_t sadb_spirange::sadb_spirange_max

Definition at line 196 of file pfkeyv2.h.

◆ sadb_spirange_min

u_int32_t sadb_spirange::sadb_spirange_min

Definition at line 195 of file pfkeyv2.h.

◆ sadb_spirange_reserved

u_int32_t sadb_spirange::sadb_spirange_reserved

Definition at line 197 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_supported Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_supported Struct Reference
Collaboration diagram for sadb_supported:
[legend]

Data Fields

u_int16_t | sadb_supported_len
u_int16_t | sadb_supported_exttype
u_int32_t | sadb_supported_reserved

Detailed Description

Definition at line 178 of file pfkeyv2.h.

Field Documentation

◆ sadb_supported_exttype

u_int16_t sadb_supported::sadb_supported_exttype

Definition at line 180 of file pfkeyv2.h.

◆ sadb_supported_len

u_int16_t sadb_supported::sadb_supported_len

Definition at line 179 of file pfkeyv2.h.

◆ sadb_supported_reserved

u_int32_t sadb_supported::sadb_supported_reserved

Definition at line 181 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_x_ipsecrequest Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_x_ipsecrequest Struct Reference
Collaboration diagram for sadb_x_ipsecrequest:
[legend]

Data Fields

u_int16_t | sadb_x_ipsecrequest_len
u_int16_t | sadb_x_ipsecrequest_proto
u_int8_t | sadb_x_ipsecrequest_mode
u_int8_t | sadb_x_ipsecrequest_level
u_int16_t | sadb_x_ipsecrequest_reqid

Detailed Description

Definition at line 244 of file pfkeyv2.h.

Field Documentation

◆ sadb_x_ipsecrequest_len

u_int16_t sadb_x_ipsecrequest::sadb_x_ipsecrequest_len

Definition at line 245 of file pfkeyv2.h.

◆ sadb_x_ipsecrequest_level

u_int8_t sadb_x_ipsecrequest::sadb_x_ipsecrequest_level

Definition at line 250 of file pfkeyv2.h.

◆ sadb_x_ipsecrequest_mode

u_int8_t sadb_x_ipsecrequest::sadb_x_ipsecrequest_mode

Definition at line 249 of file pfkeyv2.h.

◆ sadb_x_ipsecrequest_proto

u_int16_t sadb_x_ipsecrequest::sadb_x_ipsecrequest_proto

Definition at line 248 of file pfkeyv2.h.

◆ sadb_x_ipsecrequest_reqid

u_int16_t sadb_x_ipsecrequest::sadb_x_ipsecrequest_reqid

Definition at line 251 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_x_kmprivate Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_x_kmprivate Struct Reference
Collaboration diagram for sadb_x_kmprivate:
[legend]

Data Fields

u_int16_t | sadb_x_kmprivate_len
u_int16_t | sadb_x_kmprivate_exttype
u_int32_t | sadb_x_kmprivate_reserved

Detailed Description

Definition at line 200 of file pfkeyv2.h.

Field Documentation

◆ sadb_x_kmprivate_exttype

u_int16_t sadb_x_kmprivate::sadb_x_kmprivate_exttype

Definition at line 202 of file pfkeyv2.h.

◆ sadb_x_kmprivate_len

u_int16_t sadb_x_kmprivate::sadb_x_kmprivate_len

Definition at line 201 of file pfkeyv2.h.

◆ sadb_x_kmprivate_reserved

u_int32_t sadb_x_kmprivate::sadb_x_kmprivate_reserved

Definition at line 203 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_x_policy Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_x_policy Struct Reference
Collaboration diagram for sadb_x_policy:
[legend]

Data Fields

u_int16_t | sadb_x_policy_len
u_int16_t | sadb_x_policy_exttype
u_int16_t | sadb_x_policy_type
u_int8_t | sadb_x_policy_dir
u_int8_t | sadb_x_policy_reserved
u_int32_t | sadb_x_policy_id
u_int32_t | sadb_x_policy_reserved2

Detailed Description

Definition at line 224 of file pfkeyv2.h.

Field Documentation

◆ sadb_x_policy_dir

u_int8_t sadb_x_policy::sadb_x_policy_dir

Definition at line 228 of file pfkeyv2.h.

◆ sadb_x_policy_exttype

u_int16_t sadb_x_policy::sadb_x_policy_exttype

Definition at line 226 of file pfkeyv2.h.

◆ sadb_x_policy_id

u_int32_t sadb_x_policy::sadb_x_policy_id

Definition at line 230 of file pfkeyv2.h.

◆ sadb_x_policy_len

u_int16_t sadb_x_policy::sadb_x_policy_len

Definition at line 225 of file pfkeyv2.h.

◆ sadb_x_policy_reserved

u_int8_t sadb_x_policy::sadb_x_policy_reserved

Definition at line 229 of file pfkeyv2.h.

◆ sadb_x_policy_reserved2

u_int32_t sadb_x_policy::sadb_x_policy_reserved2

Definition at line 231 of file pfkeyv2.h.

◆ sadb_x_policy_type

u_int16_t sadb_x_policy::sadb_x_policy_type

Definition at line 227 of file pfkeyv2.h.


Watt-32 tcp/ip: sadb_x_sa2 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sadb_x_sa2 Struct Reference
Collaboration diagram for sadb_x_sa2:
[legend]

Data Fields

u_int16_t | sadb_x_sa2_len
u_int16_t | sadb_x_sa2_exttype
u_int8_t | sadb_x_sa2_mode
u_int8_t | sadb_x_sa2_reserved1
u_int16_t | sadb_x_sa2_reserved2
u_int32_t | sadb_x_sa2_sequence
u_int32_t | sadb_x_sa2_reqid

Detailed Description

Definition at line 212 of file pfkeyv2.h.

Field Documentation

◆ sadb_x_sa2_exttype

u_int16_t sadb_x_sa2::sadb_x_sa2_exttype

Definition at line 214 of file pfkeyv2.h.

◆ sadb_x_sa2_len

u_int16_t sadb_x_sa2::sadb_x_sa2_len

Definition at line 213 of file pfkeyv2.h.

◆ sadb_x_sa2_mode

u_int8_t sadb_x_sa2::sadb_x_sa2_mode

Definition at line 215 of file pfkeyv2.h.

◆ sadb_x_sa2_reqid

u_int32_t sadb_x_sa2::sadb_x_sa2_reqid

Definition at line 219 of file pfkeyv2.h.

◆ sadb_x_sa2_reserved1

u_int8_t sadb_x_sa2::sadb_x_sa2_reserved1

Definition at line 216 of file pfkeyv2.h.

◆ sadb_x_sa2_reserved2

u_int16_t sadb_x_sa2::sadb_x_sa2_reserved2

Definition at line 217 of file pfkeyv2.h.

◆ sadb_x_sa2_sequence

u_int32_t sadb_x_sa2::sadb_x_sa2_sequence

Definition at line 218 of file pfkeyv2.h.


Watt-32 tcp/ip: sarp_Auth Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sarp_Auth Struct Reference
Collaboration diagram for sarp_Auth:
[legend]

Data Fields

DWORD | magic
BYTE | type
BYTE | siglen
WORD | datalen
DWORD | timestamp

Detailed Description

Definition at line 10 of file pcsarp.h.

Field Documentation

◆ datalen

WORD sarp_Auth::datalen

Definition at line 14 of file pcsarp.h.

◆ magic

DWORD sarp_Auth::magic

Definition at line 11 of file pcsarp.h.

◆ siglen

BYTE sarp_Auth::siglen

Definition at line 13 of file pcsarp.h.

◆ timestamp

DWORD sarp_Auth::timestamp

Definition at line 15 of file pcsarp.h.

◆ type

BYTE sarp_Auth::type

Definition at line 12 of file pcsarp.h.


Watt-32 tcp/ip: sarp_Packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sarp_Packet Struct Reference
Collaboration diagram for sarp_Packet:
[legend]

Data Fields

struct arp_Header | arp
struct sarp_Auth | auth

Detailed Description

Definition at line 18 of file pcsarp.h.

Field Documentation

◆ arp

struct arp_Header sarp_Packet::arp

Definition at line 19 of file pcsarp.h.

◆ auth

struct sarp_Auth sarp_Packet::auth

Definition at line 20 of file pcsarp.h.


Watt-32 tcp/ip: scoreboard Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
scoreboard Struct Reference
Collaboration diagram for scoreboard:
[legend]

Public Member Functions

LIST_HEAD (scrb_head_internal, scrb_entry) head

Data Fields

tcp_seq last_ack

Detailed Description

Definition at line 89 of file tcp_scor.h.

Field Documentation

◆ last_ack

tcp_seq scoreboard::last_ack

Definition at line 90 of file tcp_scor.h.


Watt-32 tcp/ip: scrb_entry Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
scrb_entry Struct Reference
Collaboration diagram for scrb_entry:
[legend]

Public Member Functions

LIST_ENTRY (scrb_entry) ptrs

Data Fields

tcp_seq | start
tcp_seq | end
tcp_seq | retran
tcp_seq | snd_max
int | sack_cnt

Detailed Description

Definition at line 70 of file tcp_scor.h.

Field Documentation

◆ end

tcp_seq scrb_entry::end

Definition at line 73 of file tcp_scor.h.

◆ retran

tcp_seq scrb_entry::retran

Definition at line 74 of file tcp_scor.h.

◆ sack_cnt

int scrb_entry::sack_cnt

Definition at line 78 of file tcp_scor.h.

◆ snd_max

tcp_seq scrb_entry::snd_max

Definition at line 76 of file tcp_scor.h.

◆ start

tcp_seq scrb_entry::start

Definition at line 72 of file tcp_scor.h.


Watt-32 tcp/ip: sctp_ChunkDesc Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_ChunkDesc Struct Reference
Collaboration diagram for sctp_ChunkDesc:
[legend]

Data Fields

BYTE | chunkID
BYTE | chunkFlg
WORD | chunkLength

Detailed Description

Definition at line 577 of file sctp.h.

Field Documentation

◆ chunkFlg

BYTE sctp_ChunkDesc::chunkFlg

Definition at line 579 of file sctp.h.

◆ chunkID

BYTE sctp_ChunkDesc::chunkID

Definition at line 578 of file sctp.h.

◆ chunkLength

WORD sctp_ChunkDesc::chunkLength

Definition at line 580 of file sctp.h.


Watt-32 tcp/ip: sctp_CookiePreserve Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_CookiePreserve Struct Reference
Collaboration diagram for sctp_CookiePreserve:
[legend]

Data Fields

struct sctp_ParamDesc | p
DWORD | extraTime

Detailed Description

Definition at line 634 of file sctp.h.

Field Documentation

◆ extraTime

DWORD sctp_CookiePreserve::extraTime

Definition at line 636 of file sctp.h.

◆ p

struct sctp_ParamDesc sctp_CookiePreserve::p

Definition at line 635 of file sctp.h.


Watt-32 tcp/ip: sctp_CWR Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_CWR Struct Reference
Collaboration diagram for sctp_CWR:
[legend]

Data Fields

struct sctp_ChunkDesc | uh
DWORD | TSN_reduced_at

Detailed Description

Definition at line 820 of file sctp.h.

Field Documentation

◆ TSN_reduced_at

DWORD sctp_CWR::TSN_reduced_at

Definition at line 822 of file sctp.h.

◆ uh

struct sctp_ChunkDesc sctp_CWR::uh

Definition at line 821 of file sctp.h.


Watt-32 tcp/ip: sctp_DataPart Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_DataPart Struct Reference
Collaboration diagram for sctp_DataPart:
[legend]

Data Fields

DWORD | TSN
WORD | streamId
WORD | sequence
DWORD | payloadtype

Detailed Description

Definition at line 802 of file sctp.h.

Field Documentation

◆ payloadtype

DWORD sctp_DataPart::payloadtype

Definition at line 806 of file sctp.h.

◆ sequence

WORD sctp_DataPart::sequence

Definition at line 805 of file sctp.h.

◆ streamId

WORD sctp_DataPart::streamId

Definition at line 804 of file sctp.h.

◆ TSN

DWORD sctp_DataPart::TSN

Definition at line 803 of file sctp.h.


Watt-32 tcp/ip: sctp_DNSName Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_DNSName Struct Reference
Collaboration diagram for sctp_DNSName:
[legend]

Data Fields

struct sctp_ParamDesc | param
BYTE | name [1]

Detailed Description

Definition at line 628 of file sctp.h.

Field Documentation

◆ name

BYTE sctp_DNSName::name[1]

Definition at line 630 of file sctp.h.

◆ param

struct sctp_ParamDesc sctp_DNSName::param

Definition at line 629 of file sctp.h.


Watt-32 tcp/ip: sctp_ECN_echo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_ECN_echo Struct Reference
Collaboration diagram for sctp_ECN_echo:
[legend]

Data Fields

struct sctp_ChunkDesc | uh
DWORD | Lowest_TSN

Detailed Description

Definition at line 814 of file sctp.h.

Field Documentation

◆ Lowest_TSN

DWORD sctp_ECN_echo::Lowest_TSN

Definition at line 816 of file sctp.h.

◆ uh

struct sctp_ChunkDesc sctp_ECN_echo::uh

Definition at line 815 of file sctp.h.


Watt-32 tcp/ip: sctp_HBrequest Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_HBrequest Struct Reference
Collaboration diagram for sctp_HBrequest:
[legend]

Data Fields

DWORD | time_value_1
DWORD | time_value_2

Detailed Description

Definition at line 709 of file sctp.h.

Field Documentation

◆ time_value_1

DWORD sctp_HBrequest::time_value_1

Definition at line 710 of file sctp.h.

◆ time_value_2

DWORD sctp_HBrequest::time_value_2

Definition at line 711 of file sctp.h.


Watt-32 tcp/ip: sctp_HBsender Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_HBsender Struct Reference
Collaboration diagram for sctp_HBsender:
[legend]

Data Fields

struct sctp_ChunkDesc | hdr
struct sctp_ParamDesc | hb
struct sctp_HBrequest | rtt
BYTE | addrFmt [SCTP_ADDRMAX]
WORD | userreq

Detailed Description

Definition at line 722 of file sctp.h.

Field Documentation

◆ addrFmt

BYTE sctp_HBsender::addrFmt[SCTP_ADDRMAX]

Definition at line 726 of file sctp.h.

◆ hb

struct sctp_ParamDesc sctp_HBsender::hb

Definition at line 724 of file sctp.h.

◆ hdr

struct sctp_ChunkDesc sctp_HBsender::hdr

Definition at line 723 of file sctp.h.

◆ rtt

struct sctp_HBrequest sctp_HBsender::rtt

Definition at line 725 of file sctp.h.

◆ userreq

WORD sctp_HBsender::userreq

Definition at line 727 of file sctp.h.


Watt-32 tcp/ip: sctp_HBunified Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_HBunified Struct Reference
Collaboration diagram for sctp_HBunified:
[legend]

Data Fields

struct sctp_ChunkDesc | hdr
struct sctp_ParamDesc | hb

Detailed Description

Definition at line 715 of file sctp.h.

Field Documentation

◆ hb

struct sctp_ParamDesc sctp_HBunified::hb

Definition at line 717 of file sctp.h.

◆ hdr

struct sctp_ChunkDesc sctp_HBunified::hdr

Definition at line 716 of file sctp.h.


Watt-32 tcp/ip: sctp_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_Header Struct Reference
Collaboration diagram for sctp_Header:
[legend]

Data Fields

WORD | source
WORD | destination
DWORD | verificationTag
DWORD | adler32

Detailed Description

Definition at line 568 of file sctp.h.

Field Documentation

◆ adler32

DWORD sctp_Header::adler32

Definition at line 572 of file sctp.h.

◆ destination

WORD sctp_Header::destination

Definition at line 570 of file sctp.h.

◆ source

WORD sctp_Header::source

Definition at line 569 of file sctp.h.

◆ verificationTag

DWORD sctp_Header::verificationTag

Definition at line 571 of file sctp.h.


Watt-32 tcp/ip: sctp_Initiation Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_Initiation Struct Reference
Collaboration diagram for sctp_Initiation:
[legend]

Data Fields

DWORD | initTag
DWORD | rcvWindowCredit
WORD | NumPreopenStreams
WORD | MaxInboundStreams
DWORD | initialTSN

Detailed Description

Definition at line 608 of file sctp.h.

Field Documentation

◆ initialTSN

DWORD sctp_Initiation::initialTSN

Definition at line 613 of file sctp.h.

◆ initTag

DWORD sctp_Initiation::initTag

Definition at line 609 of file sctp.h.

◆ MaxInboundStreams

WORD sctp_Initiation::MaxInboundStreams

Definition at line 612 of file sctp.h.

◆ NumPreopenStreams

WORD sctp_Initiation::NumPreopenStreams

Definition at line 611 of file sctp.h.

◆ rcvWindowCredit

DWORD sctp_Initiation::rcvWindowCredit

Definition at line 610 of file sctp.h.


Watt-32 tcp/ip: sctp_OpErrorCause Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_OpErrorCause Struct Reference
Collaboration diagram for sctp_OpErrorCause:
[legend]

Data Fields

WORD | cause
WORD | causeLen

Detailed Description

Definition at line 768 of file sctp.h.

Field Documentation

◆ cause

WORD sctp_OpErrorCause::cause

Definition at line 769 of file sctp.h.

◆ causeLen

WORD sctp_OpErrorCause::causeLen

Definition at line 770 of file sctp.h.


Watt-32 tcp/ip: sctp_ParamDesc Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_ParamDesc Struct Reference
Collaboration diagram for sctp_ParamDesc:
[legend]

Data Fields

WORD | paramType
WORD | paramLength

Detailed Description

Definition at line 583 of file sctp.h.

Field Documentation

◆ paramLength

WORD sctp_ParamDesc::paramLength

Definition at line 585 of file sctp.h.

◆ paramType

WORD sctp_ParamDesc::paramType

Definition at line 584 of file sctp.h.


Watt-32 tcp/ip: sctp_RelChunkDesc Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_RelChunkDesc Struct Reference
Collaboration diagram for sctp_RelChunkDesc:
[legend]

Data Fields

struct sctp_ChunkDesc | chk
DWORD | serialNumber

Detailed Description

Definition at line 589 of file sctp.h.

Field Documentation

◆ chk

struct sctp_ChunkDesc sctp_RelChunkDesc::chk

Definition at line 590 of file sctp.h.

◆ serialNumber

DWORD sctp_RelChunkDesc::serialNumber

Definition at line 591 of file sctp.h.


Watt-32 tcp/ip: sctp_SelectiveAck Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_SelectiveAck Struct Reference
Collaboration diagram for sctp_SelectiveAck:
[legend]

Data Fields

DWORD | highestConseqTSN
DWORD | updatedRwnd
WORD | numberOfdesc
WORD | numDupTsns

Detailed Description

Definition at line 687 of file sctp.h.

Field Documentation

◆ highestConseqTSN

DWORD sctp_SelectiveAck::highestConseqTSN

Definition at line 688 of file sctp.h.

◆ numberOfdesc

WORD sctp_SelectiveAck::numberOfdesc

Definition at line 690 of file sctp.h.

◆ numDupTsns

WORD sctp_SelectiveAck::numDupTsns

Definition at line 691 of file sctp.h.

◆ updatedRwnd

DWORD sctp_SelectiveAck::updatedRwnd

Definition at line 689 of file sctp.h.


Watt-32 tcp/ip: sctp_SelectiveFrag Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_SelectiveFrag Struct Reference
Collaboration diagram for sctp_SelectiveFrag:
[legend]

Data Fields

WORD | fragmentStart
WORD | fragmentEnd

Detailed Description

Definition at line 694 of file sctp.h.

Field Documentation

◆ fragmentEnd

WORD sctp_SelectiveFrag::fragmentEnd

Definition at line 696 of file sctp.h.

◆ fragmentStart

WORD sctp_SelectiveFrag::fragmentStart

Definition at line 695 of file sctp.h.


Watt-32 tcp/ip: sctp_SendableInit Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_SendableInit Struct Reference
Collaboration diagram for sctp_SendableInit:
[legend]

Data Fields

struct sctp_Header | mh
struct sctp_UnifiedInit | msg

Detailed Description

Definition at line 674 of file sctp.h.

Field Documentation

◆ mh

struct sctp_Header sctp_SendableInit::mh

Definition at line 675 of file sctp.h.

◆ msg

struct sctp_UnifiedInit sctp_SendableInit::msg

Definition at line 676 of file sctp.h.


Watt-32 tcp/ip: sctp_Shutdown Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_Shutdown Struct Reference
Collaboration diagram for sctp_Shutdown:
[legend]

Data Fields

DWORD TSN_Seen

Detailed Description

Definition at line 755 of file sctp.h.

Field Documentation

◆ TSN_Seen

DWORD sctp_Shutdown::TSN_Seen

Definition at line 756 of file sctp.h.


Watt-32 tcp/ip: sctp_TimeStamp Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_TimeStamp Struct Reference
Collaboration diagram for sctp_TimeStamp:
[legend]

Data Fields

DWORD | ts_sec
DWORD | ts_usec

Detailed Description

Definition at line 640 of file sctp.h.

Field Documentation

◆ ts_sec

DWORD sctp_TimeStamp::ts_sec

Definition at line 641 of file sctp.h.

◆ ts_usec

DWORD sctp_TimeStamp::ts_usec

Definition at line 642 of file sctp.h.


Watt-32 tcp/ip: sctp_UnifiedAbort Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_UnifiedAbort Struct Reference
Collaboration diagram for sctp_UnifiedAbort:
[legend]

Data Fields

struct sctp_ChunkDesc uh

Detailed Description

Definition at line 736 of file sctp.h.

Field Documentation

◆ uh

struct sctp_ChunkDesc sctp_UnifiedAbort::uh

Definition at line 737 of file sctp.h.


Watt-32 tcp/ip: sctp_UnifiedAbortHeavy Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_UnifiedAbortHeavy Struct Reference
Collaboration diagram for sctp_UnifiedAbortHeavy:
[legend]

Data Fields

struct sctp_Header | mh
struct sctp_ChunkDesc | uh
WORD | causeCode
WORD | causeLen

Detailed Description

Definition at line 745 of file sctp.h.

Field Documentation

◆ causeCode

WORD sctp_UnifiedAbortHeavy::causeCode

Definition at line 748 of file sctp.h.

◆ causeLen

WORD sctp_UnifiedAbortHeavy::causeLen

Definition at line 749 of file sctp.h.

◆ mh

struct sctp_Header sctp_UnifiedAbortHeavy::mh

Definition at line 746 of file sctp.h.

◆ uh

struct sctp_ChunkDesc sctp_UnifiedAbortHeavy::uh

Definition at line 747 of file sctp.h.


Watt-32 tcp/ip: sctp_UnifiedAbortLight Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_UnifiedAbortLight Struct Reference
Collaboration diagram for sctp_UnifiedAbortLight:
[legend]

Data Fields

struct sctp_Header | mh
struct sctp_ChunkDesc | uh

Detailed Description

Definition at line 740 of file sctp.h.

Field Documentation

◆ mh

struct sctp_Header sctp_UnifiedAbortLight::mh

Definition at line 741 of file sctp.h.

◆ uh

struct sctp_ChunkDesc sctp_UnifiedAbortLight::uh

Definition at line 742 of file sctp.h.


Watt-32 tcp/ip: sctp_UnifiedDatagram Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_UnifiedDatagram Struct Reference
Collaboration diagram for sctp_UnifiedDatagram:
[legend]

Data Fields

struct sctp_ChunkDesc | uh
struct sctp_DataPart | dp

Detailed Description

Definition at line 809 of file sctp.h.

Field Documentation

◆ dp

struct sctp_DataPart sctp_UnifiedDatagram::dp

Definition at line 811 of file sctp.h.

◆ uh

struct sctp_ChunkDesc sctp_UnifiedDatagram::uh

Definition at line 810 of file sctp.h.


Watt-32 tcp/ip: sctp_UnifiedInit Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_UnifiedInit Struct Reference
Collaboration diagram for sctp_UnifiedInit:
[legend]

Data Fields

struct sctp_ChunkDesc | uh
struct sctp_Initiation | initm

Detailed Description

Definition at line 669 of file sctp.h.

Field Documentation

◆ initm

struct sctp_Initiation sctp_UnifiedInit::initm

Definition at line 671 of file sctp.h.

◆ uh

struct sctp_ChunkDesc sctp_UnifiedInit::uh

Definition at line 670 of file sctp.h.


Watt-32 tcp/ip: sctp_UnifiedOpError Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_UnifiedOpError Struct Reference
Collaboration diagram for sctp_UnifiedOpError:
[legend]

Data Fields

struct sctp_ChunkDesc | uh
struct sctp_OpErrorCause | c

Detailed Description

Definition at line 773 of file sctp.h.

Field Documentation

◆ c

struct sctp_OpErrorCause sctp_UnifiedOpError::c

Definition at line 775 of file sctp.h.

◆ uh

struct sctp_ChunkDesc sctp_UnifiedOpError::uh

Definition at line 774 of file sctp.h.


Watt-32 tcp/ip: sctp_UnifiedSack Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_UnifiedSack Struct Reference
Collaboration diagram for sctp_UnifiedSack:
[legend]

Data Fields

struct sctp_ChunkDesc | uh
struct sctp_SelectiveAck | sack

Detailed Description

Definition at line 700 of file sctp.h.

Field Documentation

◆ sack

struct sctp_SelectiveAck sctp_UnifiedSack::sack

Definition at line 702 of file sctp.h.

◆ uh

struct sctp_ChunkDesc sctp_UnifiedSack::uh

Definition at line 701 of file sctp.h.


Watt-32 tcp/ip: sctp_UnifiedShutdown Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_UnifiedShutdown Struct Reference
Collaboration diagram for sctp_UnifiedShutdown:
[legend]

Data Fields

struct sctp_ChunkDesc | uh
struct sctp_Shutdown | shut

Detailed Description

Definition at line 759 of file sctp.h.

Field Documentation

◆ shut

struct sctp_Shutdown sctp_UnifiedShutdown::shut

Definition at line 761 of file sctp.h.

◆ uh

struct sctp_ChunkDesc sctp_UnifiedShutdown::uh

Definition at line 760 of file sctp.h.


Watt-32 tcp/ip: sctp_UnifiedSingleMsg Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_UnifiedSingleMsg Struct Reference
Collaboration diagram for sctp_UnifiedSingleMsg:
[legend]

Data Fields

struct sctp_Header | mh
struct sctp_ChunkDesc | uh

Detailed Description

Definition at line 797 of file sctp.h.

Field Documentation

◆ mh

struct sctp_Header sctp_UnifiedSingleMsg::mh

Definition at line 798 of file sctp.h.

◆ uh

struct sctp_ChunkDesc sctp_UnifiedSingleMsg::uh

Definition at line 799 of file sctp.h.


Watt-32 tcp/ip: sctp_UnifiedStreamError Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_UnifiedStreamError Struct Reference
Collaboration diagram for sctp_UnifiedStreamError:
[legend]

Data Fields

struct sctp_Header | mh
struct sctp_ChunkDesc | uh
struct sctp_OpErrorCause | c
WORD | strmNum
WORD | reserved

Detailed Description

Definition at line 778 of file sctp.h.

Field Documentation

◆ c

struct sctp_OpErrorCause sctp_UnifiedStreamError::c

Definition at line 781 of file sctp.h.

◆ mh

struct sctp_Header sctp_UnifiedStreamError::mh

Definition at line 779 of file sctp.h.

◆ reserved

WORD sctp_UnifiedStreamError::reserved

Definition at line 783 of file sctp.h.

◆ strmNum

WORD sctp_UnifiedStreamError::strmNum

Definition at line 782 of file sctp.h.

◆ uh

struct sctp_ChunkDesc sctp_UnifiedStreamError::uh

Definition at line 780 of file sctp.h.


Watt-32 tcp/ip: sctp_V4IpAddress Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_V4IpAddress Struct Reference
Collaboration diagram for sctp_V4IpAddress:
[legend]

Data Fields

struct sctp_ParamDesc | p
DWORD | ipAddress

Detailed Description

Definition at line 617 of file sctp.h.

Field Documentation

◆ ipAddress

DWORD sctp_V4IpAddress::ipAddress

Definition at line 619 of file sctp.h.

◆ p

struct sctp_ParamDesc sctp_V4IpAddress::p

Definition at line 618 of file sctp.h.


Watt-32 tcp/ip: sctp_V6IpAddress Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_V6IpAddress Struct Reference
Collaboration diagram for sctp_V6IpAddress:
[legend]

Data Fields

struct sctp_ParamDesc | p
BYTE | ipAddress [16]

Detailed Description

Definition at line 623 of file sctp.h.

Field Documentation

◆ ipAddress

BYTE sctp_V6IpAddress::ipAddress[16]

Definition at line 625 of file sctp.h.

◆ p

struct sctp_ParamDesc sctp_V6IpAddress::p

Definition at line 624 of file sctp.h.


Watt-32 tcp/ip: sctp_VendorSpecificParam Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sctp_VendorSpecificParam Struct Reference
Collaboration diagram for sctp_VendorSpecificParam:
[legend]

Data Fields

struct sctp_ParamDesc | p
DWORD | vendorId
WORD | vendorSpecificType
WORD | vendorSpecificLen

Detailed Description

Definition at line 594 of file sctp.h.

Field Documentation

◆ p

struct sctp_ParamDesc sctp_VendorSpecificParam::p

Definition at line 595 of file sctp.h.

◆ vendorId

DWORD sctp_VendorSpecificParam::vendorId

Definition at line 596 of file sctp.h.

◆ vendorSpecificLen

WORD sctp_VendorSpecificParam::vendorSpecificLen

Definition at line 598 of file sctp.h.

◆ vendorSpecificType

WORD sctp_VendorSpecificParam::vendorSpecificType

Definition at line 597 of file sctp.h.


Watt-32 tcp/ip: search_list Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
search_list Struct Reference
Collaboration diagram for search_list:
[legend]

Data Fields

DWORD | type
const char * | name

Detailed Description

Definition at line 131 of file misc.h.

Field Documentation

◆ name

const char* search_list::name

Definition at line 133 of file misc.h.

◆ type

DWORD search_list::type

Definition at line 132 of file misc.h.


Watt-32 tcp/ip: secpolicy Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
secpolicy Struct Reference
Collaboration diagram for secpolicy:
[legend]

Public Member Functions

LIST_ENTRY (secpolicy) chain

Data Fields

int | refcnt
struct secpolicyindex | spidx
u_int32_t | id
u_int | state
u_int | policy
struct ipsecrequest * | req
long | created
long | lastused
long | lifetime
long | validtime

Detailed Description

Definition at line 73 of file ipsec.h.

Field Documentation

◆ created

long secpolicy::created

Definition at line 95 of file ipsec.h.

◆ id

u_int32_t secpolicy::id

Definition at line 78 of file ipsec.h.

◆ lastused

long secpolicy::lastused

Definition at line 96 of file ipsec.h.

◆ lifetime

long secpolicy::lifetime

Definition at line 97 of file ipsec.h.

◆ policy

u_int secpolicy::policy

Definition at line 83 of file ipsec.h.

◆ refcnt

int secpolicy::refcnt

Definition at line 76 of file ipsec.h.

◆ req

struct ipsecrequest* secpolicy::req

Definition at line 84 of file ipsec.h.

◆ spidx

struct secpolicyindex secpolicy::spidx

Definition at line 77 of file ipsec.h.

◆ state

u_int secpolicy::state

Definition at line 79 of file ipsec.h.

◆ validtime

long secpolicy::validtime

Definition at line 98 of file ipsec.h.


Watt-32 tcp/ip: secpolicyindex Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
secpolicyindex Struct Reference
Collaboration diagram for secpolicyindex:
[legend]

Data Fields

u_int8_t | dir
struct sockaddr_storage | src
struct sockaddr_storage | dst
u_int8_t | prefs
u_int8_t | prefd
u_int16_t | ul_proto
uid_t | uids
uid_t | uidd
gid_t | gids
gid_t | gidd

Detailed Description

Definition at line 57 of file ipsec.h.

Field Documentation

◆ dir

u_int8_t secpolicyindex::dir

Definition at line 58 of file ipsec.h.

◆ dst

struct sockaddr_storage secpolicyindex::dst

Definition at line 60 of file ipsec.h.

◆ gidd

gid_t secpolicyindex::gidd

Definition at line 68 of file ipsec.h.

◆ gids

gid_t secpolicyindex::gids

Definition at line 67 of file ipsec.h.

◆ prefd

u_int8_t secpolicyindex::prefd

Definition at line 62 of file ipsec.h.

◆ prefs

u_int8_t secpolicyindex::prefs

Definition at line 61 of file ipsec.h.

◆ src

struct sockaddr_storage secpolicyindex::src

Definition at line 59 of file ipsec.h.

◆ uidd

uid_t secpolicyindex::uidd

Definition at line 66 of file ipsec.h.

◆ uids

uid_t secpolicyindex::uids

Definition at line 65 of file ipsec.h.

◆ ul_proto

u_int16_t secpolicyindex::ul_proto

Definition at line 63 of file ipsec.h.


Watt-32 tcp/ip: secspacq Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
secspacq Struct Reference
Collaboration diagram for secspacq:
[legend]

Public Member Functions

LIST_ENTRY (secspacq) chain

Data Fields

struct secpolicyindex | spidx
long | created
int | count

Detailed Description

Definition at line 122 of file ipsec.h.

Field Documentation

◆ count

int secspacq::count

Definition at line 128 of file ipsec.h.

◆ created

long secspacq::created

Definition at line 127 of file ipsec.h.

◆ spidx

struct secpolicyindex secspacq::spidx

Definition at line 125 of file ipsec.h.


Watt-32 tcp/ip: selinfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
selinfo Struct Reference
Collaboration diagram for selinfo:
[legend]

Data Fields

int | si_seltid
short | si_flags

Detailed Description

Definition at line 364 of file wtypes.h.

Field Documentation

◆ si_flags

short selinfo::si_flags

Definition at line 367 of file wtypes.h.

◆ si_seltid

int selinfo::si_seltid

Definition at line 366 of file wtypes.h.


Watt-32 tcp/ip: servent Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
servent Struct Reference
Collaboration diagram for servent:
[legend]

Data Fields

char * | s_name
char ** | s_aliases
int | s_port
char * | s_proto

Detailed Description

Definition at line 124 of file netdb.h.

Field Documentation

◆ s_aliases

char** servent::s_aliases

Definition at line 126 of file netdb.h.

◆ s_name

char* servent::s_name

Definition at line 125 of file netdb.h.

◆ s_port

int servent::s_port

Definition at line 127 of file netdb.h.

◆ s_proto

char* servent::s_proto

Definition at line 128 of file netdb.h.


Watt-32 tcp/ip: setup_info_st Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
setup_info_st Struct Reference
Collaboration diagram for setup_info_st:
[legend]

Data Fields

char * | NetCfgInstanceId
char * | MatchingDeviceId
char * | DriverDate
char * | DriverVersion
char * | ComponentId
char * | DeviceInstanceID
ULONGLONG | NetworkInterfaceInstallTimestamp
unsigned | IfTypePreStart
struct setup_info_st * | next

Detailed Description

Definition at line 355 of file winadinf.c.

Field Documentation

◆ ComponentId

char* setup_info_st::ComponentId

Definition at line 360 of file winadinf.c.

◆ DeviceInstanceID

char* setup_info_st::DeviceInstanceID

Definition at line 361 of file winadinf.c.

◆ DriverDate

char* setup_info_st::DriverDate

Definition at line 358 of file winadinf.c.

◆ DriverVersion

char* setup_info_st::DriverVersion

Definition at line 359 of file winadinf.c.

◆ IfTypePreStart

unsigned setup_info_st::IfTypePreStart

Definition at line 363 of file winadinf.c.

◆ MatchingDeviceId

char* setup_info_st::MatchingDeviceId

Definition at line 357 of file winadinf.c.

◆ NetCfgInstanceId

char* setup_info_st::NetCfgInstanceId

Definition at line 356 of file winadinf.c.

◆ NetworkInterfaceInstallTimestamp

ULONGLONG setup_info_st::NetworkInterfaceInstallTimestamp

Definition at line 362 of file winadinf.c.

◆ next

struct setup_info_st* setup_info_st::next

Definition at line 364 of file winadinf.c.


Watt-32 tcp/ip: short_hand_verf Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
short_hand_verf Struct Reference
Collaboration diagram for short_hand_verf:
[legend]

Data Fields

struct opaque_auth new_cred

Detailed Description

Definition at line 81 of file auth_uni.h.

Field Documentation

◆ new_cred

struct opaque_auth short_hand_verf::new_cred

Definition at line 82 of file auth_uni.h.


Watt-32 tcp/ip: signal_table Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
signal_table Struct Reference
Collaboration diagram for signal_table:
[legend]

Public Member Functions

void (MS_CDECL *old)(int)

Data Fields

int | sig_num
const char * | sig_name
BOOL | caught
BOOL | exit

Detailed Description

Definition at line 60 of file signal.c.

Field Documentation

◆ caught

BOOL signal_table::caught

Definition at line 64 of file signal.c.

◆ exit

BOOL signal_table::exit

Definition at line 65 of file signal.c.

◆ sig_name

const char* signal_table::sig_name

Definition at line 63 of file signal.c.

◆ sig_num

int signal_table::sig_num

Definition at line 62 of file signal.c.


Watt-32 tcp/ip: sioc_mif_req6 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sioc_mif_req6 Struct Reference
Collaboration diagram for sioc_mif_req6:
[legend]

Data Fields

mifi_t | mifi
u_quad_t | icount
u_quad_t | ocount
u_quad_t | ibytes
u_quad_t | obytes

Detailed Description

Definition at line 202 of file ip6_mrou.h.

Field Documentation

◆ ibytes

u_quad_t sioc_mif_req6::ibytes

Definition at line 206 of file ip6_mrou.h.

◆ icount

u_quad_t sioc_mif_req6::icount

Definition at line 204 of file ip6_mrou.h.

◆ mifi

mifi_t sioc_mif_req6::mifi

Definition at line 203 of file ip6_mrou.h.

◆ obytes

u_quad_t sioc_mif_req6::obytes

Definition at line 207 of file ip6_mrou.h.

◆ ocount

u_quad_t sioc_mif_req6::ocount

Definition at line 205 of file ip6_mrou.h.


Watt-32 tcp/ip: sioc_sg_req Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sioc_sg_req Struct Reference
Collaboration diagram for sioc_sg_req:
[legend]

Data Fields

struct in_addr | src
struct in_addr | grp
u_long | pktcnt
u_long | bytecnt
u_long | wrong_if

Detailed Description

Definition at line 144 of file ip_mrout.h.

Field Documentation

◆ bytecnt

u_long sioc_sg_req::bytecnt

Definition at line 148 of file ip_mrout.h.

◆ grp

struct in_addr sioc_sg_req::grp

Definition at line 146 of file ip_mrout.h.

◆ pktcnt

u_long sioc_sg_req::pktcnt

Definition at line 147 of file ip_mrout.h.

◆ src

struct in_addr sioc_sg_req::src

Definition at line 145 of file ip_mrout.h.

◆ wrong_if

u_long sioc_sg_req::wrong_if

Definition at line 149 of file ip_mrout.h.


Watt-32 tcp/ip: sioc_sg_req6 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sioc_sg_req6 Struct Reference
Collaboration diagram for sioc_sg_req6:
[legend]

Data Fields

struct sockaddr_in6 | src
struct sockaddr_in6 | grp
u_quad_t | pktcnt
u_quad_t | bytecnt
u_quad_t | wrong_if

Detailed Description

Definition at line 191 of file ip6_mrou.h.

Field Documentation

◆ bytecnt

u_quad_t sioc_sg_req6::bytecnt

Definition at line 195 of file ip6_mrou.h.

◆ grp

struct sockaddr_in6 sioc_sg_req6::grp

Definition at line 193 of file ip6_mrou.h.

◆ pktcnt

u_quad_t sioc_sg_req6::pktcnt

Definition at line 194 of file ip6_mrou.h.

◆ src

struct sockaddr_in6 sioc_sg_req6::src

Definition at line 192 of file ip6_mrou.h.

◆ wrong_if

u_quad_t sioc_sg_req6::wrong_if

Definition at line 196 of file ip6_mrou.h.


Watt-32 tcp/ip: sioc_vif_req Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sioc_vif_req Struct Reference
Collaboration diagram for sioc_vif_req:
[legend]

Data Fields

vifi_t | vifi
u_long | icount
u_long | ocount
u_long | ibytes
u_long | obytes

Detailed Description

Definition at line 155 of file ip_mrout.h.

Field Documentation

◆ ibytes

u_long sioc_vif_req::ibytes

Definition at line 159 of file ip_mrout.h.

◆ icount

u_long sioc_vif_req::icount

Definition at line 157 of file ip_mrout.h.

◆ obytes

u_long sioc_vif_req::obytes

Definition at line 160 of file ip_mrout.h.

◆ ocount

u_long sioc_vif_req::ocount

Definition at line 158 of file ip_mrout.h.

◆ vifi

vifi_t sioc_vif_req::vifi

Definition at line 156 of file ip_mrout.h.


Watt-32 tcp/ip: sl_softc Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sl_softc Struct Reference
Collaboration diagram for sl_softc:
[legend]

Data Fields

struct ifnet | sc_if
int | sc_unit
struct ifqueue | sc_fastq
struct tty * | sc_ttyp
u_char * | sc_mp
u_char * | sc_ep
u_char * | sc_buf
u_char * | sc_xxx
u_int | sc_flags
u_int | sc_escape
long | sc_lasttime
long | sc_abortcount
long | sc_starttime
long | sc_oqlen
long | sc_otimeout
int | sc_oldbufsize
int | sc_oldbufquot
struct slcompress | sc_comp
caddr_t | sc_bpf

Detailed Description

Definition at line 49 of file if_slvar.h.

Field Documentation

◆ sc_abortcount

long sl_softc::sc_abortcount

Definition at line 61 of file if_slvar.h.

◆ sc_bpf

caddr_t sl_softc::sc_bpf

Definition at line 72 of file if_slvar.h.

◆ sc_buf

u_char* sl_softc::sc_buf

Definition at line 56 of file if_slvar.h.

◆ sc_comp

struct slcompress sl_softc::sc_comp

Definition at line 70 of file if_slvar.h.

◆ sc_ep

u_char* sl_softc::sc_ep

Definition at line 55 of file if_slvar.h.

◆ sc_escape

u_int sl_softc::sc_escape

Definition at line 59 of file if_slvar.h.

◆ sc_fastq

struct ifqueue sl_softc::sc_fastq

Definition at line 52 of file if_slvar.h.

◆ sc_flags

u_int sl_softc::sc_flags

Definition at line 58 of file if_slvar.h.

◆ sc_if

struct ifnet sl_softc::sc_if

Definition at line 50 of file if_slvar.h.

◆ sc_lasttime

long sl_softc::sc_lasttime

Definition at line 60 of file if_slvar.h.

◆ sc_mp

u_char* sl_softc::sc_mp

Definition at line 54 of file if_slvar.h.

◆ sc_oldbufquot

int sl_softc::sc_oldbufquot

Definition at line 67 of file if_slvar.h.

◆ sc_oldbufsize

int sl_softc::sc_oldbufsize

Definition at line 66 of file if_slvar.h.

◆ sc_oqlen

long sl_softc::sc_oqlen

Definition at line 63 of file if_slvar.h.

◆ sc_otimeout

long sl_softc::sc_otimeout

Definition at line 64 of file if_slvar.h.

◆ sc_starttime

long sl_softc::sc_starttime

Definition at line 62 of file if_slvar.h.

◆ sc_ttyp

struct tty* sl_softc::sc_ttyp

Definition at line 53 of file if_slvar.h.

◆ sc_unit

int sl_softc::sc_unit

Definition at line 51 of file if_slvar.h.

◆ sc_xxx

u_char* sl_softc::sc_xxx

Definition at line 57 of file if_slvar.h.


Watt-32 tcp/ip: slcompress Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
slcompress Struct Reference
Collaboration diagram for slcompress:
[legend]

Data Fields

WORD | cstate_ptr_tstate
WORD | cstate_ptr_rstate
BYTE | tslot_limit
BYTE | rslot_limit
BYTE | xmit_oldest
BYTE | xmit_current
BYTE | recv_current
BYTE | flags
DWORD | sls_o_nontcp
DWORD | sls_o_tcp
DWORD | sls_o_uncompressed
DWORD | sls_o_compressed
DWORD | sls_o_searches
DWORD | sls_o_misses
DWORD | sls_i_uncompressed
DWORD | sls_i_compressed
DWORD | sls_i_error
DWORD | sls_i_tossed
DWORD | sls_i_runt
DWORD | sls_i_badcheck
struct cstate * | last_cs
u_char | last_recv
u_char | last_xmit
u_int16_t | flags
int | sls_packets
int | sls_compressed
int | sls_searches
int | sls_misses
int | sls_uncompressedin
int | sls_compressedin
int | sls_errorin
int | sls_tossed
struct cstate | tstate [MAX_STATES]
struct cstate | rstate [MAX_STATES]

Detailed Description

Definition at line 148 of file pcpkt.h.

Field Documentation

◆ cstate_ptr_rstate

WORD slcompress::cstate_ptr_rstate

Definition at line 150 of file pcpkt.h.

◆ cstate_ptr_tstate

WORD slcompress::cstate_ptr_tstate

Definition at line 149 of file pcpkt.h.

◆ flags [1/2]

u_int16_t slcompress::flags

Definition at line 156 of file slcompre.h.

◆ flags [2/2]

BYTE slcompress::flags

Definition at line 158 of file pcpkt.h.

◆ last_cs

struct cstate* slcompress::last_cs

Definition at line 153 of file slcompre.h.

◆ last_recv

u_char slcompress::last_recv

Definition at line 154 of file slcompre.h.

◆ last_xmit

u_char slcompress::last_xmit

Definition at line 155 of file slcompre.h.

◆ recv_current

BYTE slcompress::recv_current

Definition at line 157 of file pcpkt.h.

◆ rslot_limit

BYTE slcompress::rslot_limit

Definition at line 153 of file pcpkt.h.

◆ rstate

struct cstate slcompress::rstate[MAX_STATES]

Definition at line 168 of file slcompre.h.

◆ sls_compressed

int slcompress::sls_compressed

Definition at line 159 of file slcompre.h.

◆ sls_compressedin

int slcompress::sls_compressedin

Definition at line 163 of file slcompre.h.

◆ sls_errorin

int slcompress::sls_errorin

Definition at line 164 of file slcompre.h.

◆ sls_i_badcheck

DWORD slcompress::sls_i_badcheck

Definition at line 173 of file pcpkt.h.

◆ sls_i_compressed

DWORD slcompress::sls_i_compressed

Definition at line 168 of file pcpkt.h.

◆ sls_i_error

DWORD slcompress::sls_i_error

Definition at line 169 of file pcpkt.h.

◆ sls_i_runt

DWORD slcompress::sls_i_runt

Definition at line 172 of file pcpkt.h.

◆ sls_i_tossed

DWORD slcompress::sls_i_tossed

Definition at line 170 of file pcpkt.h.

◆ sls_i_uncompressed

DWORD slcompress::sls_i_uncompressed

Definition at line 167 of file pcpkt.h.

◆ sls_misses

int slcompress::sls_misses

Definition at line 161 of file slcompre.h.

◆ sls_o_compressed

DWORD slcompress::sls_o_compressed

Definition at line 163 of file pcpkt.h.

◆ sls_o_misses

DWORD slcompress::sls_o_misses

Definition at line 165 of file pcpkt.h.

◆ sls_o_nontcp

DWORD slcompress::sls_o_nontcp

Definition at line 160 of file pcpkt.h.

◆ sls_o_searches

DWORD slcompress::sls_o_searches

Definition at line 164 of file pcpkt.h.

◆ sls_o_tcp

DWORD slcompress::sls_o_tcp

Definition at line 161 of file pcpkt.h.

◆ sls_o_uncompressed

DWORD slcompress::sls_o_uncompressed

Definition at line 162 of file pcpkt.h.

◆ sls_packets

int slcompress::sls_packets

Definition at line 158 of file slcompre.h.

◆ sls_searches

int slcompress::sls_searches

Definition at line 160 of file slcompre.h.

◆ sls_tossed

int slcompress::sls_tossed

Definition at line 165 of file slcompre.h.

◆ sls_uncompressedin

int slcompress::sls_uncompressedin

Definition at line 162 of file slcompre.h.

◆ tslot_limit

BYTE slcompress::tslot_limit

Definition at line 152 of file pcpkt.h.

◆ tstate

struct cstate slcompress::tstate[MAX_STATES]

Definition at line 167 of file slcompre.h.

◆ xmit_current

BYTE slcompress::xmit_current

Definition at line 156 of file pcpkt.h.

◆ xmit_oldest

BYTE slcompress::xmit_oldest

Definition at line 155 of file pcpkt.h.


Watt-32 tcp/ip: sock_packet_buf Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sock_packet_buf Struct Reference
Collaboration diagram for sock_packet_buf:
[legend]

Data Fields

WORD | rx_len
char | rx_buf [ETH_MAX+4]

Detailed Description

Definition at line 148 of file socket.h.

Field Documentation

◆ rx_buf

char sock_packet_buf::rx_buf[ETH_MAX+4]

Definition at line 150 of file socket.h.

◆ rx_len

WORD sock_packet_buf::rx_len

Definition at line 149 of file socket.h.


Watt-32 tcp/ip: sock_packet_pool Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sock_packet_pool Struct Reference
Collaboration diagram for sock_packet_pool:
[legend]

Data Fields

struct pkt_ringbuf | queue
struct sock_packet_buf | buf [MAX_PACKET_BUFS]

Detailed Description

Definition at line 153 of file socket.h.

Field Documentation

◆ buf

struct sock_packet_buf sock_packet_pool::buf[MAX_PACKET_BUFS]

Definition at line 155 of file socket.h.

◆ queue

struct pkt_ringbuf sock_packet_pool::queue

Definition at line 154 of file socket.h.


Watt-32 tcp/ip: sock_type Union Reference

  • Data Structure Index
  • Data Fields
Data Fields
sock_type Union Reference
Collaboration diagram for sock_type:
[legend]

Data Fields

_udp_Socket udp
_tcp_Socket tcp
_raw_Socket raw
_raw6_Socket raw6

Detailed Description

Definition at line 692 of file wattcp.h.

Field Documentation

◆ raw

_raw_Socket sock_type::raw

Definition at line 695 of file wattcp.h.

◆ raw6

_raw6_Socket sock_type::raw6

Definition at line 696 of file wattcp.h.

◆ tcp

_tcp_Socket sock_type::tcp

Definition at line 694 of file wattcp.h.

◆ udp

_udp_Socket sock_type::udp

Definition at line 693 of file wattcp.h.


Watt-32 tcp/ip: sockaddr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sockaddr Struct Reference
Collaboration diagram for sockaddr:
[legend]

Data Fields

sa_family_t | sa_family
char | sa_data [14]

Detailed Description

Definition at line 181 of file socket.h.

Field Documentation

◆ sa_data

char sockaddr::sa_data[14]

Definition at line 183 of file socket.h.

◆ sa_family

sa_family_t sockaddr::sa_family

Definition at line 182 of file socket.h.


Watt-32 tcp/ip: sockaddr_dl Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sockaddr_dl Struct Reference
Collaboration diagram for sockaddr_dl:
[legend]

Data Fields

u_char | sdl_len
u_char | sdl_family
u_int16_t | sdl_index
u_char | sdl_type
u_char | sdl_nlen
u_char | sdl_alen
u_char | sdl_slen
char | sdl_data [12]

Detailed Description

Definition at line 71 of file if_dl.h.

Field Documentation

◆ sdl_alen

u_char sockaddr_dl::sdl_alen

Definition at line 77 of file if_dl.h.

◆ sdl_data

char sockaddr_dl::sdl_data[12]

Definition at line 79 of file if_dl.h.

◆ sdl_family

u_char sockaddr_dl::sdl_family

Definition at line 73 of file if_dl.h.

◆ sdl_index

u_int16_t sockaddr_dl::sdl_index

Definition at line 74 of file if_dl.h.

◆ sdl_len

u_char sockaddr_dl::sdl_len

Definition at line 72 of file if_dl.h.

◆ sdl_nlen

u_char sockaddr_dl::sdl_nlen

Definition at line 76 of file if_dl.h.

◆ sdl_slen

u_char sockaddr_dl::sdl_slen

Definition at line 78 of file if_dl.h.

◆ sdl_type

u_char sockaddr_dl::sdl_type

Definition at line 75 of file if_dl.h.


Watt-32 tcp/ip: sockaddr_in Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sockaddr_in Struct Reference
Collaboration diagram for sockaddr_in:
[legend]

Data Fields

sa_family_t | sin_family
u_short | sin_port
struct in_addr | sin_addr
char | sin_zero [8]

Detailed Description

Definition at line 224 of file in.h.

Field Documentation

◆ sin_addr

struct in_addr sockaddr_in::sin_addr

Definition at line 227 of file in.h.

◆ sin_family

sa_family_t sockaddr_in::sin_family

Definition at line 225 of file in.h.

◆ sin_port

u_short sockaddr_in::sin_port

Definition at line 226 of file in.h.

◆ sin_zero

char sockaddr_in::sin_zero[8]

Definition at line 228 of file in.h.


Watt-32 tcp/ip: sockaddr_in6 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sockaddr_in6 Struct Reference
Collaboration diagram for sockaddr_in6:
[legend]

Data Fields

u_int16_t | sin6_family
u_int16_t | sin6_port
u_int32_t | sin6_flowinfo
struct in6_addr | sin6_addr
u_int32_t | sin6_scope_id
uint8_t | sin6_len
sa_family_t | sin6_family
uint16_t | sin6_port
uint32_t | sin6_flowinfo
uint32_t | sin6_scope_id

Detailed Description

Definition at line 231 of file in.h.

Field Documentation

◆ sin6_addr

struct in6_addr sockaddr_in6::sin6_addr

Definition at line 235 of file in.h.

◆ sin6_family [1/2]

u_int16_t sockaddr_in6::sin6_family

Definition at line 232 of file in.h.

◆ sin6_family [2/2]

sa_family_t sockaddr_in6::sin6_family

Definition at line 138 of file in6.h.

◆ sin6_flowinfo [1/2]

u_int32_t sockaddr_in6::sin6_flowinfo

Definition at line 234 of file in.h.

◆ sin6_flowinfo [2/2]

uint32_t sockaddr_in6::sin6_flowinfo

Definition at line 140 of file in6.h.

◆ sin6_len

uint8_t sockaddr_in6::sin6_len

Definition at line 137 of file in6.h.

◆ sin6_port [1/2]

u_int16_t sockaddr_in6::sin6_port

Definition at line 233 of file in.h.

◆ sin6_port [2/2]

uint16_t sockaddr_in6::sin6_port

Definition at line 139 of file in6.h.

◆ sin6_scope_id [1/2]

u_int32_t sockaddr_in6::sin6_scope_id

Definition at line 236 of file in.h.

◆ sin6_scope_id [2/2]

uint32_t sockaddr_in6::sin6_scope_id

Definition at line 142 of file in6.h.


Watt-32 tcp/ip: sockaddr_ll Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sockaddr_ll Struct Reference
Collaboration diagram for sockaddr_ll:
[legend]

Data Fields

unsigned short | sll_family
unsigned short | sll_protocol
int | sll_ifindex
unsigned short | sll_hatype
unsigned char | sll_pkttype
unsigned char | sll_halen
unsigned char | sll_addr [8]

Detailed Description

Definition at line 15 of file if_packe.h.

Field Documentation

◆ sll_addr

unsigned char sockaddr_ll::sll_addr[8]

Definition at line 23 of file if_packe.h.

◆ sll_family

unsigned short sockaddr_ll::sll_family

Definition at line 17 of file if_packe.h.

◆ sll_halen

unsigned char sockaddr_ll::sll_halen

Definition at line 22 of file if_packe.h.

◆ sll_hatype

unsigned short sockaddr_ll::sll_hatype

Definition at line 20 of file if_packe.h.

◆ sll_ifindex

int sockaddr_ll::sll_ifindex

Definition at line 19 of file if_packe.h.

◆ sll_pkttype

unsigned char sockaddr_ll::sll_pkttype

Definition at line 21 of file if_packe.h.

◆ sll_protocol

unsigned short sockaddr_ll::sll_protocol

Definition at line 18 of file if_packe.h.


Watt-32 tcp/ip: sockaddr_pkt Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sockaddr_pkt Struct Reference
Collaboration diagram for sockaddr_pkt:
[legend]

Data Fields

unsigned short | spkt_family
unsigned char | spkt_device [14]
unsigned short | spkt_protocol

Detailed Description

Definition at line 8 of file if_packe.h.

Field Documentation

◆ spkt_device

unsigned char sockaddr_pkt::spkt_device[14]

Definition at line 11 of file if_packe.h.

◆ spkt_family

unsigned short sockaddr_pkt::spkt_family

Definition at line 10 of file if_packe.h.

◆ spkt_protocol

unsigned short sockaddr_pkt::spkt_protocol

Definition at line 12 of file if_packe.h.


Watt-32 tcp/ip: sockaddr_storage Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sockaddr_storage Struct Reference
Collaboration diagram for sockaddr_storage:
[legend]

Data Fields

sa_family_t | ss_family
u_short | ss_len
char | __ss_pad1 [6]
long | __ss_align1
long | __ssalign2
char | __ss_pad2 [110]

Detailed Description

Definition at line 245 of file in.h.

Field Documentation

◆ __ss_align1

long sockaddr_storage::__ss_align1

Definition at line 249 of file in.h.

◆ __ss_pad1

char sockaddr_storage::__ss_pad1[6]

Definition at line 248 of file in.h.

◆ __ss_pad2

char sockaddr_storage::__ss_pad2[110]

Definition at line 250 of file in.h.

◆ __ssalign2

long sockaddr_storage::__ssalign2

Definition at line 249 of file in.h.

◆ ss_family

sa_family_t sockaddr_storage::ss_family

Definition at line 246 of file in.h.

◆ ss_len

u_short sockaddr_storage::ss_len

Definition at line 247 of file in.h.


Watt-32 tcp/ip: sockaddr_un Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sockaddr_un Struct Reference
Collaboration diagram for sockaddr_un:
[legend]

Data Fields

sa_family_t | sun_family
char | sun_path [UNIX_PATH_MAX]

Detailed Description

Definition at line 23 of file un.h.

Field Documentation

◆ sun_family

sa_family_t sockaddr_un::sun_family

Definition at line 24 of file un.h.

◆ sun_path

char sockaddr_un::sun_path[UNIX_PATH_MAX]

Definition at line 25 of file un.h.


Watt-32 tcp/ip: socket Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
socket Struct Reference
Collaboration diagram for socket:
[legend]

Data Fields

int dummy

Detailed Description

Definition at line 82 of file if.h.

Field Documentation

◆ dummy

int socket::dummy

Definition at line 82 of file if.h.


Watt-32 tcp/ip: Socket Struct Reference

  • Data Structure Index
  • Data Fields
Public Member Functions | Data Fields
Socket Struct Reference
Collaboration diagram for Socket:
[legend]

Public Member Functions

int (W32_CALL *old_eth_peek)(void *pkt)

Data Fields

int | fd
struct Socket * | next
struct sockaddr_in * | local_addr
struct sockaddr_in * | remote_addr
int | timeout
int | inp_flags
BYTE | ip_tos
BYTE | ip_ttl
struct ip_opts * | ip_opt
unsigned | ip_opt_len
int | so_options
int | so_proto
int | so_type
int | so_family
int | so_state
int | so_error
time_t | close_time
BOOL | linger_on
unsigned | linger_time
unsigned | fd_duped
DWORD | keepalive
DWORD | nb_timer
_udp_Socket * | udp_sock
_tcp_Socket * tcp_sock
_raw_Socket * raw_sock
_raw6_Socket * raw6_sock
recv_buf ** bcast_pool
unsigned | pool_size
sock_packet_pool * packet_pool
int | backlog
_tcp_Socket * | listen_queue [SOMAXCONN]
DWORD | syn_timestamp [SOMAXCONN]
unsigned | send_lowat
unsigned | recv_lowat
BOOL | msg_nosig
DWORD | cookie

Detailed Description

Definition at line 158 of file socket.h.

Field Documentation

◆ backlog

int Socket::backlog

Definition at line 198 of file socket.h.

◆ bcast_pool

recv_buf** Socket::bcast_pool

Definition at line 188 of file socket.h.

◆ close_time

time_t Socket::close_time

Definition at line 178 of file socket.h.

◆ cookie

DWORD Socket::cookie

Definition at line 205 of file socket.h.

◆ fd

int Socket::fd

Definition at line 159 of file socket.h.

◆ fd_duped

unsigned Socket::fd_duped

Definition at line 181 of file socket.h.

◆ inp_flags

int Socket::inp_flags

Definition at line 165 of file socket.h.

◆ ip_opt

struct ip_opts* Socket::ip_opt

Definition at line 169 of file socket.h.

◆ ip_opt_len

unsigned Socket::ip_opt_len

Definition at line 170 of file socket.h.

◆ ip_tos

BYTE Socket::ip_tos

Definition at line 166 of file socket.h.

◆ ip_ttl

BYTE Socket::ip_ttl

Definition at line 167 of file socket.h.

◆ keepalive

DWORD Socket::keepalive

Definition at line 182 of file socket.h.

◆ linger_on

BOOL Socket::linger_on

Definition at line 179 of file socket.h.

◆ linger_time

unsigned Socket::linger_time

Definition at line 180 of file socket.h.

◆ listen_queue

_tcp_Socket* Socket::listen_queue[SOMAXCONN]

Definition at line 199 of file socket.h.

◆ local_addr

struct sockaddr_in* Socket::local_addr

Definition at line 161 of file socket.h.

◆ msg_nosig

BOOL Socket::msg_nosig

Definition at line 204 of file socket.h.

◆ nb_timer

DWORD Socket::nb_timer

Definition at line 183 of file socket.h.

◆ next

struct Socket* Socket::next

Definition at line 160 of file socket.h.

◆ packet_pool

sock_packet_pool* Socket::packet_pool

Definition at line 193 of file socket.h.

◆ pool_size

unsigned Socket::pool_size

Definition at line 189 of file socket.h.

◆ raw6_sock

_raw6_Socket* Socket::raw6_sock

Definition at line 187 of file socket.h.

◆ raw_sock

_raw_Socket* Socket::raw_sock

Definition at line 186 of file socket.h.

◆ recv_lowat

unsigned Socket::recv_lowat

Definition at line 203 of file socket.h.

◆ remote_addr

struct sockaddr_in* Socket::remote_addr

Definition at line 162 of file socket.h.

◆ send_lowat

unsigned Socket::send_lowat

Definition at line 202 of file socket.h.

◆ so_error

int Socket::so_error

Definition at line 177 of file socket.h.

◆ so_family

int Socket::so_family

Definition at line 175 of file socket.h.

◆ so_options

int Socket::so_options

Definition at line 172 of file socket.h.

◆ so_proto

int Socket::so_proto

Definition at line 173 of file socket.h.

◆ so_state

int Socket::so_state

Definition at line 176 of file socket.h.

◆ so_type

int Socket::so_type

Definition at line 174 of file socket.h.

◆ syn_timestamp

DWORD Socket::syn_timestamp[SOMAXCONN]

Definition at line 200 of file socket.h.

◆ tcp_sock

_tcp_Socket* Socket::tcp_sock

Definition at line 185 of file socket.h.

◆ timeout

int Socket::timeout

Definition at line 164 of file socket.h.

◆ udp_sock

_udp_Socket* Socket::udp_sock

Definition at line 184 of file socket.h.


Watt-32 tcp/ip: sockinet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sockinet Struct Reference
Collaboration diagram for sockinet:
[legend]

Data Fields

BYTE | si_len
BYTE | si_family
WORD | si_port

Detailed Description

Definition at line 70 of file get_ni.c.

Field Documentation

◆ si_family

BYTE sockinet::si_family

Definition at line 72 of file get_ni.c.

◆ si_len

BYTE sockinet::si_len

Definition at line 71 of file get_ni.c.

◆ si_port

WORD sockinet::si_port

Definition at line 73 of file get_ni.c.


Watt-32 tcp/ip: sockproto Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
sockproto Struct Reference
Collaboration diagram for sockproto:
[legend]

Data Fields

u_short | sp_family
u_short | sp_protocol

Detailed Description

Definition at line 190 of file socket.h.

Field Documentation

◆ sp_family

u_short sockproto::sp_family

Definition at line 191 of file socket.h.

◆ sp_protocol

u_short sockproto::sp_protocol

Definition at line 192 of file socket.h.


Watt-32 tcp/ip: SRxBuffer Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
SRxBuffer Struct Reference
Collaboration diagram for SRxBuffer:
[legend]

Data Fields

OVERLAPPED | overlap
unsigned char | buffer [1514]

Detailed Description

Definition at line 65 of file swsvpkt.h.

Field Documentation

◆ buffer

unsigned char SRxBuffer::buffer[1514]

Definition at line 68 of file swsvpkt.h.

◆ overlap

OVERLAPPED SRxBuffer::overlap

Definition at line 66 of file swsvpkt.h.


Watt-32 tcp/ip: staleCookieMsg Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
staleCookieMsg Struct Reference
Collaboration diagram for staleCookieMsg:
[legend]

Data Fields

struct sctp_Header | mh
struct sctp_ChunkDesc | uh
struct sctp_OpErrorCause | c
DWORD | moretime

Detailed Description

Definition at line 786 of file sctp.h.

Field Documentation

◆ c

struct sctp_OpErrorCause staleCookieMsg::c

Definition at line 789 of file sctp.h.

◆ mh

struct sctp_Header staleCookieMsg::mh

Definition at line 787 of file sctp.h.

◆ moretime

DWORD staleCookieMsg::moretime

Definition at line 790 of file sctp.h.

◆ uh

struct sctp_ChunkDesc staleCookieMsg::uh

Definition at line 788 of file sctp.h.


Watt-32 tcp/ip: static_tree_desc_s Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
static_tree_desc_s Struct Reference
Collaboration diagram for static_tree_desc_s:
[legend]

Data Fields

int | dummy
const ct_data * | static_tree
const intf * | extra_bits
int | extra_base
int | elems
int | max_length

Detailed Description

Definition at line 164 of file zdeflate.c.

Field Documentation

◆ dummy

int static_tree_desc_s::dummy

Definition at line 164 of file zdeflate.c.

◆ elems

int static_tree_desc_s::elems

Definition at line 128 of file ztrees.c.

◆ extra_base

int static_tree_desc_s::extra_base

Definition at line 127 of file ztrees.c.

◆ extra_bits

const intf* static_tree_desc_s::extra_bits

Definition at line 126 of file ztrees.c.

◆ max_length

int static_tree_desc_s::max_length

Definition at line 129 of file ztrees.c.

◆ static_tree

const ct_data* static_tree_desc_s::static_tree

Definition at line 125 of file ztrees.c.


Watt-32 tcp/ip: strip_softc Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
strip_softc Struct Reference
Collaboration diagram for strip_softc:
[legend]

Data Fields

struct ifnet | sc_if
int | sc_unit
struct ifqueue | sc_fastq
struct tty * | sc_ttyp
u_char * | sc_mp
u_char * | sc_ep
u_char * | sc_buf
u_char * | sc_rxbuf
u_char * | sc_txbuf
u_char * | sc_xxx
u_int | sc_flags
long | sc_oqlen
long | sc_otimeout
int | sc_oldbufsize
int | sc_oldbufquot
struct slcompress | sc_comp
int | sc_state
long | sc_statetimo
caddr_t | sc_bpf

Detailed Description

Definition at line 17 of file if_strip.h.

Field Documentation

◆ sc_bpf

caddr_t strip_softc::sc_bpf

Definition at line 46 of file if_strip.h.

◆ sc_buf

u_char* strip_softc::sc_buf

Definition at line 24 of file if_strip.h.

◆ sc_comp

struct slcompress strip_softc::sc_comp

Definition at line 36 of file if_strip.h.

◆ sc_ep

u_char* strip_softc::sc_ep

Definition at line 23 of file if_strip.h.

◆ sc_fastq

struct ifqueue strip_softc::sc_fastq

Definition at line 20 of file if_strip.h.

◆ sc_flags

u_int strip_softc::sc_flags

Definition at line 28 of file if_strip.h.

◆ sc_if

struct ifnet strip_softc::sc_if

Definition at line 18 of file if_strip.h.

◆ sc_mp

u_char* strip_softc::sc_mp

Definition at line 22 of file if_strip.h.

◆ sc_oldbufquot

int strip_softc::sc_oldbufquot

Definition at line 33 of file if_strip.h.

◆ sc_oldbufsize

int strip_softc::sc_oldbufsize

Definition at line 32 of file if_strip.h.

◆ sc_oqlen

long strip_softc::sc_oqlen

Definition at line 29 of file if_strip.h.

◆ sc_otimeout

long strip_softc::sc_otimeout

Definition at line 30 of file if_strip.h.

◆ sc_rxbuf

u_char* strip_softc::sc_rxbuf

Definition at line 25 of file if_strip.h.

◆ sc_state

int strip_softc::sc_state

Definition at line 39 of file if_strip.h.

◆ sc_statetimo

long strip_softc::sc_statetimo

Definition at line 44 of file if_strip.h.

◆ sc_ttyp

struct tty* strip_softc::sc_ttyp

Definition at line 21 of file if_strip.h.

◆ sc_txbuf

u_char* strip_softc::sc_txbuf

Definition at line 26 of file if_strip.h.

◆ sc_unit

int strip_softc::sc_unit

Definition at line 19 of file if_strip.h.

◆ sc_xxx

u_char* strip_softc::sc_xxx

Definition at line 27 of file if_strip.h.


Watt-32 tcp/ip: Summary16 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
Summary16 Struct Reference
Collaboration diagram for Summary16:
[legend]

Data Fields

WORD | indx
WORD | used

Detailed Description

Definition at line 12 of file idna.h.

Field Documentation

◆ indx

WORD Summary16::indx

Definition at line 13 of file idna.h.

◆ used

WORD Summary16::used

Definition at line 14 of file idna.h.


Watt-32 tcp/ip: svc_req Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
svc_req Struct Reference
Collaboration diagram for svc_req:
[legend]

Data Fields

u_long | rq_prog
u_long | rq_vers
u_long | rq_proc
struct opaque_auth | rq_cred
caddr_t | rq_clntcred
SVCXPRT * rq_xprt

Detailed Description

Definition at line 159 of file svc.h.

Field Documentation

◆ rq_clntcred

caddr_t svc_req::rq_clntcred

Definition at line 164 of file svc.h.

◆ rq_cred

struct opaque_auth svc_req::rq_cred

Definition at line 163 of file svc.h.

◆ rq_proc

u_long svc_req::rq_proc

Definition at line 162 of file svc.h.

◆ rq_prog

u_long svc_req::rq_prog

Definition at line 160 of file svc.h.

◆ rq_vers

u_long svc_req::rq_vers

Definition at line 161 of file svc.h.

◆ rq_xprt

SVCXPRT* svc_req::rq_xprt

Definition at line 165 of file svc.h.


Watt-32 tcp/ip: SVCXPRT Struct Reference

  • Data Structure Index
  • Data Fields
Data Structures | Data Fields
SVCXPRT Struct Reference
Collaboration diagram for SVCXPRT:
[legend]

Data Structures

struct xp_ops

Data Fields

int | xp_sock
u_short | xp_port
struct SVCXPRT::xp_ops * | xp_ops
int | xp_addrlen
struct sockaddr_in | xp_raddr
struct opaque_auth | xp_verf
caddr_t | xp_p1
caddr_t | xp_p2

Detailed Description

Definition at line 88 of file svc.h.

Field Documentation

◆ xp_addrlen

int SVCXPRT::xp_addrlen

Definition at line 99 of file svc.h.

◆ xp_p1

caddr_t SVCXPRT::xp_p1

Definition at line 102 of file svc.h.

◆ xp_p2

caddr_t SVCXPRT::xp_p2

Definition at line 103 of file svc.h.

◆ xp_port

u_short SVCXPRT::xp_port

Definition at line 90 of file svc.h.

◆ xp_raddr

struct sockaddr_in SVCXPRT::xp_raddr

Definition at line 100 of file svc.h.

◆ xp_sock

int SVCXPRT::xp_sock

Definition at line 89 of file svc.h.

◆ xp_verf

struct opaque_auth SVCXPRT::xp_verf

Definition at line 101 of file svc.h.


Watt-32 tcp/ip: SVCXPRT::xp_ops Struct Reference

  • Data Structure Index
  • Data Fields
  • SVCXPRT
  • xp_ops
Data Fields
SVCXPRT::xp_ops Struct Reference
Collaboration diagram for SVCXPRT::xp_ops:
[legend]

Data Fields

bool_t(* | xp_recv )()
enum xprt_stat(* | xp_stat )()
bool_t(* | xp_getargs )()
bool_t(* | xp_reply )()
bool_t(* | xp_freeargs )()
void(* | xp_destroy )()

Detailed Description

Definition at line 91 of file svc.h.

Field Documentation

◆ xp_destroy

void(* SVCXPRT::xp_ops::xp_destroy) ()

Definition at line 97 of file svc.h.

◆ xp_freeargs

bool_t(* SVCXPRT::xp_ops::xp_freeargs) ()

Definition at line 96 of file svc.h.

◆ xp_getargs

bool_t(* SVCXPRT::xp_ops::xp_getargs) ()

Definition at line 94 of file svc.h.

◆ xp_recv

bool_t(* SVCXPRT::xp_ops::xp_recv) ()

Definition at line 92 of file svc.h.

◆ xp_reply

bool_t(* SVCXPRT::xp_ops::xp_reply) ()

Definition at line 95 of file svc.h.

◆ xp_stat

enum xprt_stat(* SVCXPRT::xp_ops::xp_stat) ()

Definition at line 92 of file svc.h.


Watt-32 tcp/ip: SWI_REGS Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
SWI_REGS Struct Reference
Collaboration diagram for SWI_REGS:
[legend]

Data Fields

DWORD | r_ax
DWORD | r_bx
DWORD | r_cx
DWORD | r_dx
DWORD | r_si
DWORD | r_di
WORD | r_ds
WORD | r_es
WORD | r_fs
WORD | r_gs
DWORD | r_flags

Detailed Description

Definition at line 16 of file x32vm.h.

Field Documentation

◆ r_ax

DWORD SWI_REGS::r_ax

Definition at line 17 of file x32vm.h.

◆ r_bx

DWORD SWI_REGS::r_bx

Definition at line 18 of file x32vm.h.

◆ r_cx

DWORD SWI_REGS::r_cx

Definition at line 19 of file x32vm.h.

◆ r_di

DWORD SWI_REGS::r_di

Definition at line 22 of file x32vm.h.

◆ r_ds

WORD SWI_REGS::r_ds

Definition at line 23 of file x32vm.h.

◆ r_dx

DWORD SWI_REGS::r_dx

Definition at line 20 of file x32vm.h.

◆ r_es

WORD SWI_REGS::r_es

Definition at line 24 of file x32vm.h.

◆ r_flags

DWORD SWI_REGS::r_flags

Definition at line 27 of file x32vm.h.

◆ r_fs

WORD SWI_REGS::r_fs

Definition at line 25 of file x32vm.h.

◆ r_gs

WORD SWI_REGS::r_gs

Definition at line 26 of file x32vm.h.

◆ r_si

DWORD SWI_REGS::r_si

Definition at line 21 of file x32vm.h.


Watt-32 tcp/ip: SwsVpktAdapterState Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
SwsVpktAdapterState Struct Reference
Collaboration diagram for SwsVpktAdapterState:
[legend]

Data Fields

unsigned int | isPowerOn: 1
unsigned int | isMediaConnected: 1
unsigned int | isWan: 1
unsigned int | isWanDown: 1

Detailed Description

Definition at line 96 of file swsvpkt.h.

Field Documentation

◆ isMediaConnected

unsigned int SwsVpktAdapterState::isMediaConnected

Definition at line 98 of file swsvpkt.h.

◆ isPowerOn

unsigned int SwsVpktAdapterState::isPowerOn

Definition at line 97 of file swsvpkt.h.

◆ isWan

unsigned int SwsVpktAdapterState::isWan

Definition at line 99 of file swsvpkt.h.

◆ isWanDown

unsigned int SwsVpktAdapterState::isWanDown

Definition at line 100 of file swsvpkt.h.


Watt-32 tcp/ip: SwsVpktOpenInfo Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
SwsVpktOpenInfo Struct Reference
Collaboration diagram for SwsVpktOpenInfo:
[legend]

Data Fields

SwsVpktRxFn * | pfnRx
unsigned | uRxBufs

Detailed Description

Definition at line 91 of file swsvpkt.h.

Field Documentation

◆ pfnRx

SwsVpktRxFn* SwsVpktOpenInfo::pfnRx

Definition at line 92 of file swsvpkt.h.

◆ uRxBufs

unsigned SwsVpktOpenInfo::uRxBufs

Definition at line 93 of file swsvpkt.h.


Watt-32 tcp/ip: SwsVpktUsr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
SwsVpktUsr Struct Reference
Collaboration diagram for SwsVpktUsr:
[legend]

Data Fields

HANDLE | hDevice
OVERLAPPED | txOverlap
HANDLE | hWorker
int | iWorkerExit
SwsVpktRxFn * | pfnRx
unsigned | uRxBufs
struct SRxBuffer | rxBuffer [1]

Detailed Description

Definition at line 81 of file swsvpkt.h.

Field Documentation

◆ hDevice

HANDLE SwsVpktUsr::hDevice

Definition at line 82 of file swsvpkt.h.

◆ hWorker

HANDLE SwsVpktUsr::hWorker

Definition at line 84 of file swsvpkt.h.

◆ iWorkerExit

int SwsVpktUsr::iWorkerExit

Definition at line 85 of file swsvpkt.h.

◆ pfnRx

SwsVpktRxFn* SwsVpktUsr::pfnRx

Definition at line 86 of file swsvpkt.h.

◆ rxBuffer

struct SRxBuffer SwsVpktUsr::rxBuffer[1]

Definition at line 88 of file swsvpkt.h.

◆ txOverlap

OVERLAPPED SwsVpktUsr::txOverlap

Definition at line 83 of file swsvpkt.h.

◆ uRxBufs

unsigned SwsVpktUsr::uRxBufs

Definition at line 87 of file swsvpkt.h.


Watt-32 tcp/ip: SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION Struct Reference
Collaboration diagram for SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION:
[legend]

Data Fields

LARGE_INTEGER | IdleTime
LARGE_INTEGER | KernelTime
LARGE_INTEGER | UserTime
LARGE_INTEGER | DpcTime
LARGE_INTEGER | InterruptTime
LONG | InterruptCount

Detailed Description

Definition at line 1069 of file winmisc.c.

Field Documentation

◆ DpcTime

LARGE_INTEGER SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION::DpcTime

Definition at line 1073 of file winmisc.c.

◆ IdleTime

LARGE_INTEGER SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION::IdleTime

Definition at line 1070 of file winmisc.c.

◆ InterruptCount

LONG SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION::InterruptCount

Definition at line 1075 of file winmisc.c.

◆ InterruptTime

LARGE_INTEGER SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION::InterruptTime

Definition at line 1074 of file winmisc.c.

◆ KernelTime

LARGE_INTEGER SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION::KernelTime

Definition at line 1071 of file winmisc.c.

◆ UserTime

LARGE_INTEGER SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION::UserTime

Definition at line 1072 of file winmisc.c.


Watt-32 tcp/ip: tad_entry Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tad_entry Struct Reference
Collaboration diagram for tad_entry:
[legend]

Data Fields

u_long | seq_no
struct timeval | time
u_long | snd_cwnd
u_long | sb_hiwat
u_long | sb_target_hiwat
u_long | sb_cc
u_long | m_clused
u_short | lport
u_short | rport
u_long | debug
tcp_seq | snd_max

Detailed Description

Definition at line 79 of file tcp_debu.h.

Field Documentation

◆ debug

u_long tad_entry::debug

Definition at line 89 of file tcp_debu.h.

◆ lport

u_short tad_entry::lport

Definition at line 87 of file tcp_debu.h.

◆ m_clused

u_long tad_entry::m_clused

Definition at line 86 of file tcp_debu.h.

◆ rport

u_short tad_entry::rport

Definition at line 88 of file tcp_debu.h.

◆ sb_cc

u_long tad_entry::sb_cc

Definition at line 85 of file tcp_debu.h.

◆ sb_hiwat

u_long tad_entry::sb_hiwat

Definition at line 83 of file tcp_debu.h.

◆ sb_target_hiwat

u_long tad_entry::sb_target_hiwat

Definition at line 84 of file tcp_debu.h.

◆ seq_no

u_long tad_entry::seq_no

Definition at line 80 of file tcp_debu.h.

◆ snd_cwnd

u_long tad_entry::snd_cwnd

Definition at line 82 of file tcp_debu.h.

◆ snd_max

tcp_seq tad_entry::snd_max

Definition at line 90 of file tcp_debu.h.

◆ time

struct timeval tad_entry::time

Definition at line 81 of file tcp_debu.h.


Watt-32 tcp/ip: tbf Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tbf Struct Reference
Collaboration diagram for tbf:
[legend]

Data Fields

struct timeval | tbf_last_pkt_t
u_long | tbf_n_tok
u_long | tbf_q_len
u_long | tbf_max_q_len
struct mbuf * | tbf_q
struct mbuf * | tbf_t

Detailed Description

Definition at line 247 of file ip_mrout.h.

Field Documentation

◆ tbf_last_pkt_t

struct timeval tbf::tbf_last_pkt_t

Definition at line 249 of file ip_mrout.h.

◆ tbf_max_q_len

u_long tbf::tbf_max_q_len

Definition at line 252 of file ip_mrout.h.

◆ tbf_n_tok

u_long tbf::tbf_n_tok

Definition at line 250 of file ip_mrout.h.

◆ tbf_q

struct mbuf* tbf::tbf_q

Definition at line 253 of file ip_mrout.h.

◆ tbf_q_len

u_long tbf::tbf_q_len

Definition at line 251 of file ip_mrout.h.

◆ tbf_t

struct mbuf* tbf::tbf_t

Definition at line 254 of file ip_mrout.h.


Watt-32 tcp/ip: tcp6_pkt Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcp6_pkt Struct Reference
Collaboration diagram for tcp6_pkt:
[legend]

Data Fields

in6_Header in
tcp_Header tcp

Detailed Description

Definition at line 95 of file pctcp.c.

Field Documentation

◆ in

in6_Header tcp6_pkt::in

Definition at line 96 of file pctcp.c.

◆ tcp

tcp_Header tcp6_pkt::tcp

Definition at line 97 of file pctcp.c.


Watt-32 tcp/ip: tcp_debug Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcp_debug Struct Reference
Collaboration diagram for tcp_debug:
[legend]

Data Fields

n_time | td_time
short | td_act
short | td_ostate
caddr_t | td_tcb
struct tcpiphdr | td_ti
short | td_req
struct tcpcb | td_cb

Detailed Description

Definition at line 44 of file tcp_debu.h.

Field Documentation

◆ td_act

short tcp_debug::td_act

Definition at line 46 of file tcp_debu.h.

◆ td_cb

struct tcpcb tcp_debug::td_cb

Definition at line 51 of file tcp_debu.h.

◆ td_ostate

short tcp_debug::td_ostate

Definition at line 47 of file tcp_debu.h.

◆ td_req

short tcp_debug::td_req

Definition at line 50 of file tcp_debu.h.

◆ td_tcb

caddr_t tcp_debug::td_tcb

Definition at line 48 of file tcp_debu.h.

◆ td_ti

struct tcpiphdr tcp_debug::td_ti

Definition at line 49 of file tcp_debu.h.

◆ td_time

n_time tcp_debug::td_time

Definition at line 45 of file tcp_debu.h.


Watt-32 tcp/ip: tcp_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcp_Header Struct Reference

#include <wattcp.h>

Collaboration diagram for tcp_Header:
[legend]

Data Fields

WORD | srcPort
WORD | dstPort
DWORD | seqnum
DWORD | acknum
BYTE | unused: 4
BYTE | offset: 4
BYTE | flags
WORD | window
WORD | checksum
WORD | urgent

Detailed Description

The TCP header.

Definition at line 418 of file wattcp.h.

Field Documentation

◆ acknum

DWORD tcp_Header::acknum

Definition at line 422 of file wattcp.h.

◆ checksum

WORD tcp_Header::checksum

Definition at line 428 of file wattcp.h.

◆ dstPort

WORD tcp_Header::dstPort

Definition at line 420 of file wattcp.h.

◆ flags

BYTE tcp_Header::flags

Definition at line 426 of file wattcp.h.

◆ offset

BYTE tcp_Header::offset

Definition at line 425 of file wattcp.h.

◆ seqnum

DWORD tcp_Header::seqnum

Definition at line 421 of file wattcp.h.

◆ srcPort

WORD tcp_Header::srcPort

Definition at line 419 of file wattcp.h.

◆ unused

BYTE tcp_Header::unused

Definition at line 424 of file wattcp.h.

◆ urgent

WORD tcp_Header::urgent

Definition at line 429 of file wattcp.h.

◆ window

WORD tcp_Header::window

Definition at line 427 of file wattcp.h.


Watt-32 tcp/ip: tcp_pkt Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcp_pkt Struct Reference
Collaboration diagram for tcp_pkt:
[legend]

Data Fields

in_Header in
tcp_Header tcp

Detailed Description

Definition at line 90 of file pctcp.c.

Field Documentation

◆ in

in_Header tcp_pkt::in

Definition at line 91 of file pctcp.c.

◆ tcp

tcp_Header tcp_pkt::tcp

Definition at line 92 of file pctcp.c.


Watt-32 tcp/ip: tcp_PseudoHeader Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcp_PseudoHeader Struct Reference

#include <wattcp.h>

Collaboration diagram for tcp_PseudoHeader:
[legend]

Data Fields

DWORD | src
DWORD | dst
BYTE | mbz
BYTE | protocol
WORD | length
WORD | checksum

Detailed Description

The TCP/UDP Pseudo Header (IPv4).

Definition at line 449 of file wattcp.h.

Field Documentation

◆ checksum

WORD tcp_PseudoHeader::checksum

Definition at line 455 of file wattcp.h.

◆ dst

DWORD tcp_PseudoHeader::dst

Definition at line 451 of file wattcp.h.

◆ length

WORD tcp_PseudoHeader::length

Definition at line 454 of file wattcp.h.

◆ mbz

BYTE tcp_PseudoHeader::mbz

Definition at line 452 of file wattcp.h.

◆ protocol

BYTE tcp_PseudoHeader::protocol

Definition at line 453 of file wattcp.h.

◆ src

DWORD tcp_PseudoHeader::src

Definition at line 450 of file wattcp.h.


Watt-32 tcp/ip: tcp_PseudoHeader6 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcp_PseudoHeader6 Struct Reference

#include <wattcp.h>

Collaboration diagram for tcp_PseudoHeader6:
[legend]

Data Fields

ip6_address | src
ip6_address | dst
WORD | length
BYTE | zero [3]
BYTE | next_hdr

Detailed Description

The TCP/UDP Pseudo Header (IPv6).

Definition at line 463 of file wattcp.h.

Field Documentation

◆ dst

ip6_address tcp_PseudoHeader6::dst

Definition at line 465 of file wattcp.h.

◆ length

WORD tcp_PseudoHeader6::length

Definition at line 466 of file wattcp.h.

◆ next_hdr

BYTE tcp_PseudoHeader6::next_hdr

Definition at line 468 of file wattcp.h.

◆ src

ip6_address tcp_PseudoHeader6::src

Definition at line 464 of file wattcp.h.

◆ zero

BYTE tcp_PseudoHeader6::zero[3]

Definition at line 467 of file wattcp.h.


Watt-32 tcp/ip: tcp_reasm Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcp_reasm Struct Reference
Collaboration diagram for tcp_reasm:
[legend]

Data Fields

struct {
DWORD left
DWORD right
} edge [MAX_REASM_SEG]
int idx

Detailed Description

Definition at line 83 of file tcp_fsm.c.

Field Documentation

◆ idx

int tcp_reasm::idx

Definition at line 88 of file tcp_fsm.c.

◆ left

DWORD tcp_reasm::left

Definition at line 85 of file tcp_fsm.c.

◆ right

DWORD tcp_reasm::right

Definition at line 86 of file tcp_fsm.c.


Watt-32 tcp/ip: tcp_rtt Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcp_rtt Struct Reference

#include <pctcp.h>

Collaboration diagram for tcp_rtt:
[legend]

Data Fields

DWORD | ip
IP-address of this entry.
UINT | rto
Round-trip timeout for this entry.
UINT | MTU
Path-MTU discovered for this entry.

Detailed Description

A simple RTT cache based on Phil Karn's KA9Q.

Definition at line 174 of file pctcp.h.

Field Documentation

◆ ip

DWORD tcp_rtt::ip

IP-address of this entry.

Definition at line 175 of file pctcp.h.

◆ MTU

UINT tcp_rtt::MTU

Path-MTU discovered for this entry.

Definition at line 177 of file pctcp.h.

◆ rto

UINT tcp_rtt::rto

Round-trip timeout for this entry.

Definition at line 176 of file pctcp.h.


Watt-32 tcp/ip: tcp_Socket Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcp_Socket Struct Reference

#include <wattcp.h>

Collaboration diagram for tcp_Socket:
[legend]

Data Fields

struct tcp_Socket * | next
link to next tcp-socket
UDP_TCP_COMMON
BYTE | rx_buf [tcp_MaxBufSize+1]
received data buffer
ip6_address | my6addr
our IPv6 address
ip6_address | his6addr
peer's IPv6 address
UINT | state
tcp connection state
DWORD | recv_next
SEQ number we expect to receive.
DWORD | send_next
SEQ we send but not ACK-ed by peer.
long | send_una
unacked send data, must be signed
DWORD | last_acknum [2]
for pcdbug.c; to follow SEQ/ACK
DWORD | last_seqnum [2]
increments
DWORD | timeout
timer for retrans etc.
BYTE | unhappy
flag, indicates retransmitting segt's
BYTE | recent
1 if recently transmitted
WORD | flags
TCP flags used in next Tx.
UINT | window
other guy's window
UINT | adv_win
our last advertised window
BYTE | cwindow
Congestion window.
BYTE | wwindow
Van Jacobson's algorithm.
WORD | fill_4
DWORD | vj_sa
VJ's alg, standard average (SRTT)
DWORD | vj_sd
VJ's alg, standard deviation (RTTVAR)
DWORD | vj_last
last transmit time
UINT | rto
retransmission timeout
BYTE | karn_count
count of packets
BYTE | tos
TOS from IP-header.
WORD | fill_5
DWORD | rtt_time
Round Trip Time value.
DWORD | rtt_lasttran
RTT at last transmission.
DWORD | ts_sent
last TimeStamp value sent
DWORD | ts_recent
last TimeStamp value received
DWORD | ts_echo
last TimeStamp echo received
UINT | max_seg
MSS for this connection.
DWORD | missed_seq [2]
S.
char * | secret
< linked-list of frags; not yet
DWORD | inactive_to
inactive timer (no Rx data)
DWORD | datatimer
inactive timer (no Tx data)
BYTE | tx_wscale
BYTE | rx_wscale
UINT | tx_queuelen
optional Tx queue length
const BYTE * | tx_queue
UINT | tx_datalen
number of bytes of data to send
UINT | max_tx_data
Last index for tx_data[].
BYTE * | tx_data
Tx data buffer (default tx_buf[])
BYTE | tx_buf [tcp_MaxTxBufSize+1]
data for transmission
DWORD | safetysig
magic marker
DWORD | safetytcp
extra magic marker
BYTE | undoc [W32_UNDOC_TCP_SOCKET_SIZE]

Detailed Description

TCP Socket definition (fields common to _udp_Socket must come first).

Definition at line 584 of file wattcp.h.

Field Documentation

◆ adv_win

UINT tcp_Socket::adv_win

our last advertised window

Definition at line 609 of file wattcp.h.

◆ cwindow

BYTE tcp_Socket::cwindow

Congestion window.

Definition at line 611 of file wattcp.h.

◆ datatimer

DWORD tcp_Socket::datatimer

inactive timer (no Tx data)

Definition at line 644 of file wattcp.h.

◆ fill_4

WORD tcp_Socket::fill_4

Definition at line 613 of file wattcp.h.

◆ fill_5

WORD tcp_Socket::fill_5

Definition at line 621 of file wattcp.h.

◆ flags

WORD tcp_Socket::flags

TCP flags used in next Tx.

Definition at line 606 of file wattcp.h.

◆ his6addr

ip6_address tcp_Socket::his6addr

peer's IPv6 address

Definition at line 592 of file wattcp.h.

◆ inactive_to

DWORD tcp_Socket::inactive_to

inactive timer (no Rx data)

Definition at line 643 of file wattcp.h.

◆ karn_count

BYTE tcp_Socket::karn_count

count of packets

Definition at line 619 of file wattcp.h.

◆ last_acknum

DWORD tcp_Socket::last_acknum[2]

for pcdbug.c; to follow SEQ/ACK

Definition at line 600 of file wattcp.h.

◆ last_seqnum

DWORD tcp_Socket::last_seqnum[2]

increments

Definition at line 601 of file wattcp.h.

◆ max_seg

UINT tcp_Socket::max_seg

MSS for this connection.

Definition at line 630 of file wattcp.h.

◆ max_tx_data

UINT tcp_Socket::max_tx_data

Last index for tx_data[].

Definition at line 653 of file wattcp.h.

◆ missed_seq

DWORD tcp_Socket::missed_seq[2]

S.

Lawson - handle one dropped segment.

Todo:
Make a proper re-assembly queue. missed_seq[0] is left edge of missing segment. missed_seq[1] is right edge (in peer's absolute SEQ space)

Definition at line 637 of file wattcp.h.

◆ my6addr

ip6_address tcp_Socket::my6addr

our IPv6 address

Definition at line 591 of file wattcp.h.

◆ next

struct tcp_Socket* tcp_Socket::next

link to next tcp-socket

Definition at line 585 of file wattcp.h.

◆ recent

BYTE tcp_Socket::recent

1 if recently transmitted

Definition at line 605 of file wattcp.h.

◆ recv_next

DWORD tcp_Socket::recv_next

SEQ number we expect to receive.

Definition at line 595 of file wattcp.h.

◆ rto

UINT tcp_Socket::rto

retransmission timeout

Definition at line 618 of file wattcp.h.

◆ rtt_lasttran

DWORD tcp_Socket::rtt_lasttran

RTT at last transmission.

Definition at line 624 of file wattcp.h.

◆ rtt_time

DWORD tcp_Socket::rtt_time

Round Trip Time value.

Definition at line 623 of file wattcp.h.

◆ rx_buf

BYTE tcp_Socket::rx_buf[tcp_MaxBufSize+1]

received data buffer

Definition at line 588 of file wattcp.h.

◆ rx_wscale

BYTE tcp_Socket::rx_wscale

Definition at line 648 of file wattcp.h.

◆ safetysig

DWORD tcp_Socket::safetysig

magic marker

Definition at line 656 of file wattcp.h.

◆ safetytcp

DWORD tcp_Socket::safetytcp

extra magic marker

Definition at line 657 of file wattcp.h.

◆ secret

char* tcp_Socket::secret

< linked-list of frags; not yet

Secret for MD5 finger-print

Definition at line 641 of file wattcp.h.

◆ send_next

DWORD tcp_Socket::send_next

SEQ we send but not ACK-ed by peer.

Definition at line 596 of file wattcp.h.

◆ send_una

long tcp_Socket::send_una

unacked send data, must be signed

Definition at line 597 of file wattcp.h.

◆ state

UINT tcp_Socket::state

tcp connection state

Definition at line 594 of file wattcp.h.

◆ timeout

DWORD tcp_Socket::timeout

timer for retrans etc.

Definition at line 603 of file wattcp.h.

◆ tos

BYTE tcp_Socket::tos

TOS from IP-header.

Definition at line 620 of file wattcp.h.

◆ ts_echo

DWORD tcp_Socket::ts_echo

last TimeStamp echo received

Definition at line 628 of file wattcp.h.

◆ ts_recent

DWORD tcp_Socket::ts_recent

last TimeStamp value received

Definition at line 627 of file wattcp.h.

◆ ts_sent

DWORD tcp_Socket::ts_sent

last TimeStamp value sent

Definition at line 626 of file wattcp.h.

◆ tx_buf

BYTE tcp_Socket::tx_buf[tcp_MaxTxBufSize+1]

data for transmission

Definition at line 655 of file wattcp.h.

◆ tx_data

BYTE* tcp_Socket::tx_data

Tx data buffer (default tx_buf[])

Definition at line 654 of file wattcp.h.

◆ tx_datalen

UINT tcp_Socket::tx_datalen

number of bytes of data to send

Definition at line 652 of file wattcp.h.

◆ tx_queue

const BYTE* tcp_Socket::tx_queue

Definition at line 650 of file wattcp.h.

◆ tx_queuelen

UINT tcp_Socket::tx_queuelen

optional Tx queue length

Definition at line 649 of file wattcp.h.

◆ tx_wscale

BYTE tcp_Socket::tx_wscale
Todo:
window scales shifts, Tx/Rx

Definition at line 647 of file wattcp.h.

◆ UDP_TCP_COMMON

tcp_Socket::UDP_TCP_COMMON

Definition at line 586 of file wattcp.h.

◆ undoc

BYTE tcp_Socket::undoc[W32_UNDOC_TCP_SOCKET_SIZE]

Definition at line 84 of file tcp.h.

◆ unhappy

BYTE tcp_Socket::unhappy

flag, indicates retransmitting segt's

Definition at line 604 of file wattcp.h.

◆ vj_last

DWORD tcp_Socket::vj_last

last transmit time

Definition at line 617 of file wattcp.h.

◆ vj_sa

DWORD tcp_Socket::vj_sa

VJ's alg, standard average (SRTT)

Definition at line 615 of file wattcp.h.

◆ vj_sd

DWORD tcp_Socket::vj_sd

VJ's alg, standard deviation (RTTVAR)

Definition at line 616 of file wattcp.h.

◆ window

UINT tcp_Socket::window

other guy's window

Definition at line 608 of file wattcp.h.

◆ wwindow

BYTE tcp_Socket::wwindow

Van Jacobson's algorithm.

Definition at line 612 of file wattcp.h.


Watt-32 tcp/ip: tcpcb Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcpcb Struct Reference
Collaboration diagram for tcpcb:
[legend]

Data Fields

struct tcpiphdr * | seg_next
struct tcpiphdr * | seg_prev
int | t_state
int | t_timer [TCPT_NTIMERS]
int | t_rxtshift
int | t_rxtcur
short | t_padd
short | t_dupacks
u_int | t_maxseg
u_int | t_maxopd
int | t_force
u_int | t_flags
struct tcpiphdr * | t_template
struct inpcb * | t_inpcb
tcp_seq | snd_una
tcp_seq | snd_nxt
tcp_seq | snd_up
tcp_seq | snd_wl1
tcp_seq | snd_wl2
tcp_seq | iss
u_long | snd_wnd
u_long | rcv_wnd
tcp_seq | rcv_nxt
tcp_seq | rcv_up
tcp_seq | irs
tcp_seq | rcv_adv
tcp_seq | snd_max
u_long | snd_cwnd
u_long | snd_ssthresh
u_int | t_idle
int | t_rtt
tcp_seq | t_rtseq
int | t_srtt
int | t_rttvar
u_int | t_rttmin
u_long | max_sndwnd
char | t_oobflags
char | t_iobc
int | t_softerror
u_char | snd_scale
u_char | rcv_scale
u_char | request_r_scale
u_char | requested_s_scale
u_long | ts_recent
u_long | ts_recent_age
tcp_seq | last_ack_sent
tcp_cc | cc_send
tcp_cc | cc_recv
u_long | t_duration
caddr_t | t_tuba_pcb
u_long | t_rttupdated
u_short | t_alt_flags
struct sackblock | sack_list [SACK_LIST_LEN]
struct scoreboard | scrb
int | snd_retran_data
tcp_seq | recover
int | pipe
tcp_seq | snd_fack
u_long | lothresh
u_long | hithresh

Detailed Description

Definition at line 81 of file tcp_var.h.

Field Documentation

◆ cc_recv

tcp_cc tcpcb::cc_recv

Definition at line 178 of file tcp_var.h.

◆ cc_send

tcp_cc tcpcb::cc_send

Definition at line 177 of file tcp_var.h.

◆ hithresh

u_long tcpcb::hithresh

Definition at line 213 of file tcp_var.h.

◆ irs

tcp_seq tcpcb::irs

Definition at line 133 of file tcp_var.h.

◆ iss

tcp_seq tcpcb::iss

Definition at line 127 of file tcp_var.h.

◆ last_ack_sent

tcp_seq tcpcb::last_ack_sent

Definition at line 175 of file tcp_var.h.

◆ lothresh

u_long tcpcb::lothresh

Definition at line 212 of file tcp_var.h.

◆ max_sndwnd

u_long tcpcb::max_sndwnd

Definition at line 159 of file tcp_var.h.

◆ pipe

int tcpcb::pipe

Definition at line 207 of file tcp_var.h.

◆ rcv_adv

tcp_seq tcpcb::rcv_adv

Definition at line 138 of file tcp_var.h.

◆ rcv_nxt

tcp_seq tcpcb::rcv_nxt

Definition at line 131 of file tcp_var.h.

◆ rcv_scale

u_char tcpcb::rcv_scale

Definition at line 170 of file tcp_var.h.

◆ rcv_up

tcp_seq tcpcb::rcv_up

Definition at line 132 of file tcp_var.h.

◆ rcv_wnd

u_long tcpcb::rcv_wnd

Definition at line 130 of file tcp_var.h.

◆ recover

tcp_seq tcpcb::recover

Definition at line 204 of file tcp_var.h.

◆ request_r_scale

u_char tcpcb::request_r_scale

Definition at line 171 of file tcp_var.h.

◆ requested_s_scale

u_char tcpcb::requested_s_scale

Definition at line 172 of file tcp_var.h.

◆ sack_list

struct sackblock tcpcb::sack_list[SACK_LIST_LEN]

Definition at line 201 of file tcp_var.h.

◆ scrb

struct scoreboard tcpcb::scrb

Definition at line 202 of file tcp_var.h.

◆ seg_next

struct tcpiphdr* tcpcb::seg_next

Definition at line 82 of file tcp_var.h.

◆ seg_prev

struct tcpiphdr* tcpcb::seg_prev

Definition at line 83 of file tcp_var.h.

◆ snd_cwnd

u_long tcpcb::snd_cwnd

Definition at line 144 of file tcp_var.h.

◆ snd_fack

tcp_seq tcpcb::snd_fack

Definition at line 210 of file tcp_var.h.

◆ snd_max

tcp_seq tcpcb::snd_max

Definition at line 140 of file tcp_var.h.

◆ snd_nxt

tcp_seq tcpcb::snd_nxt

Definition at line 123 of file tcp_var.h.

◆ snd_retran_data

int tcpcb::snd_retran_data

Definition at line 203 of file tcp_var.h.

◆ snd_scale

u_char tcpcb::snd_scale

Definition at line 169 of file tcp_var.h.

◆ snd_ssthresh

u_long tcpcb::snd_ssthresh

Definition at line 145 of file tcp_var.h.

◆ snd_una

tcp_seq tcpcb::snd_una

Definition at line 122 of file tcp_var.h.

◆ snd_up

tcp_seq tcpcb::snd_up

Definition at line 124 of file tcp_var.h.

◆ snd_wl1

tcp_seq tcpcb::snd_wl1

Definition at line 125 of file tcp_var.h.

◆ snd_wl2

tcp_seq tcpcb::snd_wl2

Definition at line 126 of file tcp_var.h.

◆ snd_wnd

u_long tcpcb::snd_wnd

Definition at line 128 of file tcp_var.h.

◆ t_alt_flags

u_short tcpcb::t_alt_flags

Definition at line 187 of file tcp_var.h.

◆ t_dupacks

short tcpcb::t_dupacks

Definition at line 92 of file tcp_var.h.

◆ t_duration

u_long tcpcb::t_duration

Definition at line 179 of file tcp_var.h.

◆ t_flags

u_int tcpcb::t_flags

Definition at line 97 of file tcp_var.h.

◆ t_force

int tcpcb::t_force

Definition at line 96 of file tcp_var.h.

◆ t_idle

u_int tcpcb::t_idle

Definition at line 153 of file tcp_var.h.

◆ t_inpcb

struct inpcb* tcpcb::t_inpcb

Definition at line 116 of file tcp_var.h.

◆ t_iobc

char tcpcb::t_iobc

Definition at line 163 of file tcp_var.h.

◆ t_maxopd

u_int tcpcb::t_maxopd

Definition at line 95 of file tcp_var.h.

◆ t_maxseg

u_int tcpcb::t_maxseg

Definition at line 94 of file tcp_var.h.

◆ t_oobflags

char tcpcb::t_oobflags

Definition at line 162 of file tcp_var.h.

◆ t_padd

short tcpcb::t_padd

Definition at line 90 of file tcp_var.h.

◆ t_rtseq

tcp_seq tcpcb::t_rtseq

Definition at line 155 of file tcp_var.h.

◆ t_rtt

int tcpcb::t_rtt

Definition at line 154 of file tcp_var.h.

◆ t_rttmin

u_int tcpcb::t_rttmin

Definition at line 158 of file tcp_var.h.

◆ t_rttupdated

u_long tcpcb::t_rttupdated

Definition at line 184 of file tcp_var.h.

◆ t_rttvar

int tcpcb::t_rttvar

Definition at line 157 of file tcp_var.h.

◆ t_rxtcur

int tcpcb::t_rxtcur

Definition at line 88 of file tcp_var.h.

◆ t_rxtshift

int tcpcb::t_rxtshift

Definition at line 87 of file tcp_var.h.

◆ t_softerror

int tcpcb::t_softerror

Definition at line 166 of file tcp_var.h.

◆ t_srtt

int tcpcb::t_srtt

Definition at line 156 of file tcp_var.h.

◆ t_state

int tcpcb::t_state

Definition at line 85 of file tcp_var.h.

◆ t_template

struct tcpiphdr* tcpcb::t_template

Definition at line 115 of file tcp_var.h.

◆ t_timer

int tcpcb::t_timer[TCPT_NTIMERS]

Definition at line 86 of file tcp_var.h.

◆ t_tuba_pcb

caddr_t tcpcb::t_tuba_pcb

Definition at line 182 of file tcp_var.h.

◆ ts_recent

u_long tcpcb::ts_recent

Definition at line 173 of file tcp_var.h.

◆ ts_recent_age

u_long tcpcb::ts_recent_age

Definition at line 174 of file tcp_var.h.


Watt-32 tcp/ip: tcpopt Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcpopt Struct Reference
Collaboration diagram for tcpopt:
[legend]

Data Fields

u_long | to_flag
u_long | to_tsval
u_long | to_tsecr
tcp_cc | to_cc
tcp_cc | to_ccecho

Detailed Description

Definition at line 223 of file tcp_var.h.

Field Documentation

◆ to_cc

tcp_cc tcpopt::to_cc

Definition at line 231 of file tcp_var.h.

◆ to_ccecho

tcp_cc tcpopt::to_ccecho

Definition at line 232 of file tcp_var.h.

◆ to_flag

u_long tcpopt::to_flag

Definition at line 224 of file tcp_var.h.

◆ to_tsecr

u_long tcpopt::to_tsecr

Definition at line 230 of file tcp_var.h.

◆ to_tsval

u_long tcpopt::to_tsval

Definition at line 229 of file tcp_var.h.


Watt-32 tcp/ip: tcpstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tcpstat Struct Reference
Collaboration diagram for tcpstat:
[legend]

Data Fields

u_long | tcps_connattempt
u_long | tcps_accepts
u_long | tcps_connects
u_long | tcps_drops
u_long | tcps_conndrops
u_long | tcps_closed
u_long | tcps_segstimed
u_long | tcps_rttupdated
u_long | tcps_delack
u_long | tcps_timeoutdrop
u_long | tcps_rexmttimeo
u_long | tcps_persisttimeo
u_long | tcps_keeptimeo
u_long | tcps_keepprobe
u_long | tcps_keepdrops
u_long | tcps_sndtotal
u_long | tcps_sndpack
u_long | tcps_sndbyte
u_long | tcps_sndrexmitpack
u_long | tcps_sndrexmitbyte
u_long | tcps_sndacks
u_long | tcps_sndprobe
u_long | tcps_sndurg
u_long | tcps_sndwinup
u_long | tcps_sndctrl
u_long | tcps_rcvtotal
u_long | tcps_rcvpack
u_long | tcps_rcvbyte
u_long | tcps_rcvbadsum
u_long | tcps_rcvbadoff
u_long | tcps_rcvshort
u_long | tcps_rcvduppack
u_long | tcps_rcvdupbyte
u_long | tcps_rcvpartduppack
u_long | tcps_rcvpartdupbyte
u_long | tcps_rcvoopack
u_long | tcps_rcvoobyte
u_long | tcps_rcvpackafterwin
u_long | tcps_rcvbyteafterwin
u_long | tcps_rcvafterclose
u_long | tcps_rcvwinprobe
u_long | tcps_rcvdupack
u_long | tcps_rcvacktoomuch
u_long | tcps_rcvackpack
u_long | tcps_rcvackbyte
u_long | tcps_rcvwinupd
u_long | tcps_pawsdrop
u_long | tcps_predack
u_long | tcps_preddat
u_long | tcps_pcbcachemiss
u_long | tcps_cachedrtt
u_long | tcps_cachedrttvar
u_long | tcps_cachedssthresh
u_long | tcps_usedrtt
u_long | tcps_usedrttvar
u_long | tcps_usedssthresh
u_long | tcps_persistdrop
u_long | tcps_badsyn
u_long | tcps_mturesent
u_long | tcps_listendrop
u_long | tcps_fack_recovery
u_long | tcps_fack_sndpack
u_long | tcps_fack_sndbyte
u_long | tcps_fack_sndrexmitpack
u_long | tcps_fack_sndrexmitbyte

Detailed Description

Definition at line 305 of file tcp_var.h.

Field Documentation

◆ tcps_accepts

u_long tcpstat::tcps_accepts

Definition at line 307 of file tcp_var.h.

◆ tcps_badsyn

u_long tcpstat::tcps_badsyn

Definition at line 365 of file tcp_var.h.

◆ tcps_cachedrtt

u_long tcpstat::tcps_cachedrtt

Definition at line 358 of file tcp_var.h.

◆ tcps_cachedrttvar

u_long tcpstat::tcps_cachedrttvar

Definition at line 359 of file tcp_var.h.

◆ tcps_cachedssthresh

u_long tcpstat::tcps_cachedssthresh

Definition at line 360 of file tcp_var.h.

◆ tcps_closed

u_long tcpstat::tcps_closed

Definition at line 311 of file tcp_var.h.

◆ tcps_connattempt

u_long tcpstat::tcps_connattempt

Definition at line 306 of file tcp_var.h.

◆ tcps_conndrops

u_long tcpstat::tcps_conndrops

Definition at line 310 of file tcp_var.h.

◆ tcps_connects

u_long tcpstat::tcps_connects

Definition at line 308 of file tcp_var.h.

◆ tcps_delack

u_long tcpstat::tcps_delack

Definition at line 314 of file tcp_var.h.

◆ tcps_drops

u_long tcpstat::tcps_drops

Definition at line 309 of file tcp_var.h.

◆ tcps_fack_recovery

u_long tcpstat::tcps_fack_recovery

Definition at line 373 of file tcp_var.h.

◆ tcps_fack_sndbyte

u_long tcpstat::tcps_fack_sndbyte

Definition at line 375 of file tcp_var.h.

◆ tcps_fack_sndpack

u_long tcpstat::tcps_fack_sndpack

Definition at line 374 of file tcp_var.h.

◆ tcps_fack_sndrexmitbyte

u_long tcpstat::tcps_fack_sndrexmitbyte

Definition at line 377 of file tcp_var.h.

◆ tcps_fack_sndrexmitpack

u_long tcpstat::tcps_fack_sndrexmitpack

Definition at line 376 of file tcp_var.h.

◆ tcps_keepdrops

u_long tcpstat::tcps_keepdrops

Definition at line 320 of file tcp_var.h.

◆ tcps_keepprobe

u_long tcpstat::tcps_keepprobe

Definition at line 319 of file tcp_var.h.

◆ tcps_keeptimeo

u_long tcpstat::tcps_keeptimeo

Definition at line 318 of file tcp_var.h.

◆ tcps_listendrop

u_long tcpstat::tcps_listendrop

Definition at line 367 of file tcp_var.h.

◆ tcps_mturesent

u_long tcpstat::tcps_mturesent

Definition at line 366 of file tcp_var.h.

◆ tcps_pawsdrop

u_long tcpstat::tcps_pawsdrop

Definition at line 354 of file tcp_var.h.

◆ tcps_pcbcachemiss

u_long tcpstat::tcps_pcbcachemiss

Definition at line 357 of file tcp_var.h.

◆ tcps_persistdrop

u_long tcpstat::tcps_persistdrop

Definition at line 364 of file tcp_var.h.

◆ tcps_persisttimeo

u_long tcpstat::tcps_persisttimeo

Definition at line 317 of file tcp_var.h.

◆ tcps_predack

u_long tcpstat::tcps_predack

Definition at line 355 of file tcp_var.h.

◆ tcps_preddat

u_long tcpstat::tcps_preddat

Definition at line 356 of file tcp_var.h.

◆ tcps_rcvackbyte

u_long tcpstat::tcps_rcvackbyte

Definition at line 352 of file tcp_var.h.

◆ tcps_rcvackpack

u_long tcpstat::tcps_rcvackpack

Definition at line 351 of file tcp_var.h.

◆ tcps_rcvacktoomuch

u_long tcpstat::tcps_rcvacktoomuch

Definition at line 350 of file tcp_var.h.

◆ tcps_rcvafterclose

u_long tcpstat::tcps_rcvafterclose

Definition at line 347 of file tcp_var.h.

◆ tcps_rcvbadoff

u_long tcpstat::tcps_rcvbadoff

Definition at line 337 of file tcp_var.h.

◆ tcps_rcvbadsum

u_long tcpstat::tcps_rcvbadsum

Definition at line 336 of file tcp_var.h.

◆ tcps_rcvbyte

u_long tcpstat::tcps_rcvbyte

Definition at line 335 of file tcp_var.h.

◆ tcps_rcvbyteafterwin

u_long tcpstat::tcps_rcvbyteafterwin

Definition at line 346 of file tcp_var.h.

◆ tcps_rcvdupack

u_long tcpstat::tcps_rcvdupack

Definition at line 349 of file tcp_var.h.

◆ tcps_rcvdupbyte

u_long tcpstat::tcps_rcvdupbyte

Definition at line 340 of file tcp_var.h.

◆ tcps_rcvduppack

u_long tcpstat::tcps_rcvduppack

Definition at line 339 of file tcp_var.h.

◆ tcps_rcvoobyte

u_long tcpstat::tcps_rcvoobyte

Definition at line 344 of file tcp_var.h.

◆ tcps_rcvoopack

u_long tcpstat::tcps_rcvoopack

Definition at line 343 of file tcp_var.h.

◆ tcps_rcvpack

u_long tcpstat::tcps_rcvpack

Definition at line 334 of file tcp_var.h.

◆ tcps_rcvpackafterwin

u_long tcpstat::tcps_rcvpackafterwin

Definition at line 345 of file tcp_var.h.

◆ tcps_rcvpartdupbyte

u_long tcpstat::tcps_rcvpartdupbyte

Definition at line 342 of file tcp_var.h.

◆ tcps_rcvpartduppack

u_long tcpstat::tcps_rcvpartduppack

Definition at line 341 of file tcp_var.h.

◆ tcps_rcvshort

u_long tcpstat::tcps_rcvshort

Definition at line 338 of file tcp_var.h.

◆ tcps_rcvtotal

u_long tcpstat::tcps_rcvtotal

Definition at line 333 of file tcp_var.h.

◆ tcps_rcvwinprobe

u_long tcpstat::tcps_rcvwinprobe

Definition at line 348 of file tcp_var.h.

◆ tcps_rcvwinupd

u_long tcpstat::tcps_rcvwinupd

Definition at line 353 of file tcp_var.h.

◆ tcps_rexmttimeo

u_long tcpstat::tcps_rexmttimeo

Definition at line 316 of file tcp_var.h.

◆ tcps_rttupdated

u_long tcpstat::tcps_rttupdated

Definition at line 313 of file tcp_var.h.

◆ tcps_segstimed

u_long tcpstat::tcps_segstimed

Definition at line 312 of file tcp_var.h.

◆ tcps_sndacks

u_long tcpstat::tcps_sndacks

Definition at line 327 of file tcp_var.h.

◆ tcps_sndbyte

u_long tcpstat::tcps_sndbyte

Definition at line 324 of file tcp_var.h.

◆ tcps_sndctrl

u_long tcpstat::tcps_sndctrl

Definition at line 331 of file tcp_var.h.

◆ tcps_sndpack

u_long tcpstat::tcps_sndpack

Definition at line 323 of file tcp_var.h.

◆ tcps_sndprobe

u_long tcpstat::tcps_sndprobe

Definition at line 328 of file tcp_var.h.

◆ tcps_sndrexmitbyte

u_long tcpstat::tcps_sndrexmitbyte

Definition at line 326 of file tcp_var.h.

◆ tcps_sndrexmitpack

u_long tcpstat::tcps_sndrexmitpack

Definition at line 325 of file tcp_var.h.

◆ tcps_sndtotal

u_long tcpstat::tcps_sndtotal

Definition at line 322 of file tcp_var.h.

◆ tcps_sndurg

u_long tcpstat::tcps_sndurg

Definition at line 329 of file tcp_var.h.

◆ tcps_sndwinup

u_long tcpstat::tcps_sndwinup

Definition at line 330 of file tcp_var.h.

◆ tcps_timeoutdrop

u_long tcpstat::tcps_timeoutdrop

Definition at line 315 of file tcp_var.h.

◆ tcps_usedrtt

u_long tcpstat::tcps_usedrtt

Definition at line 361 of file tcp_var.h.

◆ tcps_usedrttvar

u_long tcpstat::tcps_usedrttvar

Definition at line 362 of file tcp_var.h.

◆ tcps_usedssthresh

u_long tcpstat::tcps_usedssthresh

Definition at line 363 of file tcp_var.h.


Watt-32 tcp/ip: timespec Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
timespec Struct Reference
Collaboration diagram for timespec:
[legend]

Data Fields

long | tv_sec
long | tv_nsec

Detailed Description

Definition at line 121 of file wtime.h.

Field Documentation

◆ tv_nsec

long timespec::tv_nsec

Definition at line 123 of file wtime.h.

◆ tv_sec

long timespec::tv_sec

Definition at line 122 of file wtime.h.


Watt-32 tcp/ip: timeval Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
timeval Struct Reference
Collaboration diagram for timeval:
[legend]

Data Fields

long | tv_sec
long | tv_usec

Detailed Description

Definition at line 30 of file wtime.h.

Field Documentation

◆ tv_sec

long timeval::tv_sec

Definition at line 31 of file wtime.h.

◆ tv_usec

long timeval::tv_usec

Definition at line 32 of file wtime.h.


Watt-32 tcp/ip: timezone Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
timezone Struct Reference
Collaboration diagram for timezone:
[legend]

Data Fields

int | tz_minuteswest
int | tz_dsttime

Detailed Description

Definition at line 55 of file wtime.h.

Field Documentation

◆ tz_dsttime

int timezone::tz_dsttime

Definition at line 57 of file wtime.h.

◆ tz_minuteswest

int timezone::tz_minuteswest

Definition at line 56 of file wtime.h.


Watt-32 tcp/ip: tms Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tms Struct Reference
Collaboration diagram for tms:
[legend]

Data Fields

unsigned long | tms_utime
unsigned long | tms_cstime
unsigned long | tms_cutime
unsigned long | tms_stime

Detailed Description

Definition at line 61 of file wtime.h.

Field Documentation

◆ tms_cstime

unsigned long tms::tms_cstime

Definition at line 63 of file wtime.h.

◆ tms_cutime

unsigned long tms::tms_cutime

Definition at line 64 of file wtime.h.

◆ tms_stime

unsigned long tms::tms_stime

Definition at line 65 of file wtime.h.

◆ tms_utime

unsigned long tms::tms_utime

Definition at line 62 of file wtime.h.


Watt-32 tcp/ip: tok Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tok Struct Reference
Collaboration diagram for tok:
[legend]

Data Fields

unsigned | v
const char * | s

Detailed Description

Definition at line 13 of file oui-generated.c.

Field Documentation

◆ s

const char* tok::s

Definition at line 15 of file oui-generated.c.

◆ v

unsigned tok::v

Definition at line 14 of file oui-generated.c.


Watt-32 tcp/ip: tok_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tok_Header Struct Reference

#include <pcsed.h>

Collaboration diagram for tok_Header:
[legend]

Data Fields

BYTE | accessCtrl
BYTE | frameCtrl
mac_address | destination
mac_address | source
BYTE | DSAP
BYTE | SSAP
BYTE | ctrl
BYTE | org [3]
WORD | type

Detailed Description

Token-Ring header, refer RFC-1042, pg. 8.

Definition at line 70 of file pcsed.h.

Field Documentation

◆ accessCtrl

BYTE tok_Header::accessCtrl

Definition at line 73 of file pcsed.h.

◆ ctrl

BYTE tok_Header::ctrl

Definition at line 86 of file pcsed.h.

◆ destination

mac_address tok_Header::destination

Definition at line 75 of file pcsed.h.

◆ DSAP

BYTE tok_Header::DSAP

Definition at line 84 of file pcsed.h.

◆ frameCtrl

BYTE tok_Header::frameCtrl

Definition at line 74 of file pcsed.h.

◆ org

BYTE tok_Header::org[3]

Definition at line 90 of file pcsed.h.

◆ source

mac_address tok_Header::source

Definition at line 76 of file pcsed.h.

◆ SSAP

BYTE tok_Header::SSAP

Definition at line 85 of file pcsed.h.

◆ type

WORD tok_Header::type

Definition at line 91 of file pcsed.h.


Watt-32 tcp/ip: tok_Packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tok_Packet Struct Reference

#include <pcsed.h>

Collaboration diagram for tok_Packet:
[legend]

Data Fields

tok_Header head
BYTE data [TOK_MAX_DATA]

Detailed Description

Token-Ring header with data.

Definition at line 98 of file pcsed.h.

Field Documentation

◆ data

BYTE tok_Packet::data[TOK_MAX_DATA]

Definition at line 100 of file pcsed.h.

◆ head

tok_Header tok_Packet::head

Definition at line 99 of file pcsed.h.


Watt-32 tcp/ip: token Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
token Struct Reference
Collaboration diagram for token:
[legend]

Data Fields

int | v
const char * | s

Detailed Description

Definition at line 1473 of file pcdbug.c.

Field Documentation

◆ s

const char* token::s

Definition at line 1475 of file pcdbug.c.

◆ v

int token::v

Definition at line 1474 of file pcdbug.c.


Watt-32 tcp/ip: tpacket_hdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tpacket_hdr Struct Reference
Collaboration diagram for tpacket_hdr:
[legend]

Data Fields

unsigned long | tp_status
unsigned int | tp_len
unsigned int | tp_snaplen
unsigned short | tp_mac
unsigned short | tp_net
unsigned int | tp_sec
unsigned int | tp_usec

Detailed Description

Definition at line 55 of file if_packe.h.

Field Documentation

◆ tp_len

unsigned int tpacket_hdr::tp_len

Definition at line 63 of file if_packe.h.

◆ tp_mac

unsigned short tpacket_hdr::tp_mac

Definition at line 65 of file if_packe.h.

◆ tp_net

unsigned short tpacket_hdr::tp_net

Definition at line 66 of file if_packe.h.

◆ tp_sec

unsigned int tpacket_hdr::tp_sec

Definition at line 67 of file if_packe.h.

◆ tp_snaplen

unsigned int tpacket_hdr::tp_snaplen

Definition at line 64 of file if_packe.h.

◆ tp_status

unsigned long tpacket_hdr::tp_status

Definition at line 57 of file if_packe.h.

◆ tp_usec

unsigned int tpacket_hdr::tp_usec

Definition at line 68 of file if_packe.h.


Watt-32 tcp/ip: tpacket_req Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tpacket_req Struct Reference
Collaboration diagram for tpacket_req:
[legend]

Data Fields

unsigned int | tp_block_size
unsigned int | tp_block_nr
unsigned int | tp_frame_size
unsigned int | tp_frame_nr

Detailed Description

Definition at line 88 of file if_packe.h.

Field Documentation

◆ tp_block_nr

unsigned int tpacket_req::tp_block_nr

Definition at line 91 of file if_packe.h.

◆ tp_block_size

unsigned int tpacket_req::tp_block_size

Definition at line 90 of file if_packe.h.

◆ tp_frame_nr

unsigned int tpacket_req::tp_frame_nr

Definition at line 93 of file if_packe.h.

◆ tp_frame_size

unsigned int tpacket_req::tp_frame_size

Definition at line 92 of file if_packe.h.


Watt-32 tcp/ip: tpacket_stats Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tpacket_stats Struct Reference
Collaboration diagram for tpacket_stats:
[legend]

Data Fields

unsigned int | tp_packets
unsigned int | tp_drops

Detailed Description

Definition at line 49 of file if_packe.h.

Field Documentation

◆ tp_drops

unsigned int tpacket_stats::tp_drops

Definition at line 52 of file if_packe.h.

◆ tp_packets

unsigned int tpacket_stats::tp_packets

Definition at line 51 of file if_packe.h.


Watt-32 tcp/ip: tree_desc_s Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tree_desc_s Struct Reference
Collaboration diagram for tree_desc_s:
[legend]

Data Fields

ct_data * dyn_tree
int max_code
static_tree_desc * stat_desc

Detailed Description

Definition at line 76 of file zdeflate.h.

Field Documentation

◆ dyn_tree

ct_data* tree_desc_s::dyn_tree

Definition at line 77 of file zdeflate.h.

◆ max_code

int tree_desc_s::max_code

Definition at line 78 of file zdeflate.h.

◆ stat_desc

static_tree_desc* tree_desc_s::stat_desc

Definition at line 79 of file zdeflate.h.


Watt-32 tcp/ip: tsp Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tsp Struct Reference
Collaboration diagram for tsp:
[legend]

Data Fields

u_int8_t | tsp_type
u_int8_t | tsp_vers
u_int16_t | tsp_seq
union {
struct {
int32_t tv_sec
int32_t tv_usec
} tspu_time
char tspu_hopcnt
} tsp_u
char | tsp_name [MAXHOSTNAMELEN]

Detailed Description

Definition at line 53 of file timed.h.

Field Documentation

◆ tsp_name

char tsp::tsp_name[MAXHOSTNAMELEN]

Definition at line 64 of file timed.h.

◆ tsp_seq

u_int16_t tsp::tsp_seq

Definition at line 56 of file timed.h.

◆ tsp_type

u_int8_t tsp::tsp_type

Definition at line 54 of file timed.h.

◆ tsp_vers

u_int8_t tsp::tsp_vers

Definition at line 55 of file timed.h.

◆ tspu_hopcnt

char tsp::tspu_hopcnt

Definition at line 62 of file timed.h.

◆ tv_sec

int32_t tsp::tv_sec

Definition at line 59 of file timed.h.

◆ tv_usec

int32_t tsp::tv_usec

Definition at line 60 of file timed.h.


Watt-32 tcp/ip: tun_softc Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
tun_softc Struct Reference
Collaboration diagram for tun_softc:
[legend]

Data Fields

u_short | tun_flags
struct ifnet | tun_if
int | tun_pgrp
struct selinfo | tun_rsel
struct selinfo | tun_wsel
caddr_t | tun_bpf

Detailed Description

Definition at line 24 of file if_tun.h.

Field Documentation

◆ tun_bpf

caddr_t tun_softc::tun_bpf

Definition at line 43 of file if_tun.h.

◆ tun_flags

u_short tun_softc::tun_flags

Definition at line 25 of file if_tun.h.

◆ tun_if

struct ifnet tun_softc::tun_if

Definition at line 38 of file if_tun.h.

◆ tun_pgrp

int tun_softc::tun_pgrp

Definition at line 39 of file if_tun.h.

◆ tun_rsel

struct selinfo tun_softc::tun_rsel

Definition at line 40 of file if_tun.h.

◆ tun_wsel

struct selinfo tun_softc::tun_wsel

Definition at line 41 of file if_tun.h.


Watt-32 tcp/ip: udp_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
udp_Header Struct Reference

#include <wattcp.h>

Collaboration diagram for udp_Header:
[legend]

Data Fields

WORD | srcPort
WORD | dstPort
WORD | length
WORD | checksum

Detailed Description

The UDP header.

Definition at line 406 of file wattcp.h.

Field Documentation

◆ checksum

WORD udp_Header::checksum

Definition at line 410 of file wattcp.h.

◆ dstPort

WORD udp_Header::dstPort

Definition at line 408 of file wattcp.h.

◆ length

WORD udp_Header::length

Definition at line 409 of file wattcp.h.

◆ srcPort

WORD udp_Header::srcPort

Definition at line 407 of file wattcp.h.


Watt-32 tcp/ip: udp_Socket Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
udp_Socket Struct Reference

ARP definitions. More...

#include <wattcp.h>

Collaboration diagram for udp_Socket:
[legend]

Data Fields

BYTE undoc [W32_UNDOC_UDP_SOCKET_SIZE]

Detailed Description

ARP definitions.

TCP states, from tcp specification RFC-793.

Note
CLOSE-WAIT state is bypassed by automatically closing a connection when a FIN is received. This is easy to undo. RESOLVE is a pseudo state before SYN is sent in tcp_Retransmitter(). Fields common to UDP & TCP socket definition.

Tries to keep members on natural boundaries (words on word-boundary, dwords on dword boundary)

UDP socket definition.

Definition at line 87 of file tcp.h.

Field Documentation

◆ undoc

BYTE udp_Socket::undoc[W32_UNDOC_UDP_SOCKET_SIZE]

Definition at line 88 of file tcp.h.


Watt-32 tcp/ip: udphdr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
udphdr Struct Reference
Collaboration diagram for udphdr:
[legend]

Data Fields

u_short | uh_sport
u_short | uh_dport
u_short | uh_ulen
u_short | uh_sum

Detailed Description

Definition at line 47 of file udp.h.

Field Documentation

◆ uh_dport

u_short udphdr::uh_dport

Definition at line 49 of file udp.h.

◆ uh_sport

u_short udphdr::uh_sport

Definition at line 48 of file udp.h.

◆ uh_sum

u_short udphdr::uh_sum

Definition at line 51 of file udp.h.

◆ uh_ulen

u_short udphdr::uh_ulen

Definition at line 50 of file udp.h.


Watt-32 tcp/ip: ulong_long Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ulong_long Struct Reference
Collaboration diagram for ulong_long:
[legend]

Data Fields

DWORD | lo
DWORD | hi

Detailed Description

Definition at line 90 of file wattcp.h.

Field Documentation

◆ hi

DWORD ulong_long::hi

Definition at line 92 of file wattcp.h.

◆ lo

DWORD ulong_long::lo

Definition at line 91 of file wattcp.h.


Watt-32 tcp/ip: unixcred Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
unixcred Struct Reference
Collaboration diagram for unixcred:
[legend]

Data Fields

long | uid
long | gid
struct {
u_long gids_len
long * gids_val
} gids

Detailed Description

Definition at line 62 of file key_prot.h.

Field Documentation

◆ gid

long unixcred::gid

Definition at line 64 of file key_prot.h.

◆ gids_len

u_long unixcred::gids_len

Definition at line 66 of file key_prot.h.

◆ gids_val

long* unixcred::gids_val

Definition at line 67 of file key_prot.h.

◆ uid

long unixcred::uid

Definition at line 63 of file key_prot.h.


Watt-32 tcp/ip: URL Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
URL Struct Reference
Collaboration diagram for URL:
[legend]

Data Fields

char * | host
char * | get_req
WORD | port
BOOL | on_heap

Detailed Description

Definition at line 52 of file dynip.c.

Field Documentation

◆ get_req

char* URL::get_req

Definition at line 54 of file dynip.c.

◆ host

char* URL::host

Definition at line 53 of file dynip.c.

◆ on_heap

BOOL URL::on_heap

Definition at line 56 of file dynip.c.

◆ port

WORD URL::port

Definition at line 55 of file dynip.c.


Watt-32 tcp/ip: vif Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
vif Struct Reference
Collaboration diagram for vif:
[legend]

Data Fields

u_char | v_flags
u_char | v_threshold
u_int | v_rate_limit
struct tbf * | v_tbf
struct in_addr | v_lcl_addr
struct in_addr | v_rmt_addr
struct ifnet * | v_ifp
u_long | v_pkt_in
u_long | v_pkt_out
u_long | v_bytes_in
u_long | v_bytes_out
struct route | v_route
u_int | v_rsvp_on
struct socket * | v_rsvpd

Detailed Description

Definition at line 167 of file ip_mrout.h.

Field Documentation

◆ v_bytes_in

u_long vif::v_bytes_in

Definition at line 177 of file ip_mrout.h.

◆ v_bytes_out

u_long vif::v_bytes_out

Definition at line 178 of file ip_mrout.h.

◆ v_flags

u_char vif::v_flags

Definition at line 168 of file ip_mrout.h.

◆ v_ifp

struct ifnet* vif::v_ifp

Definition at line 174 of file ip_mrout.h.

◆ v_lcl_addr

struct in_addr vif::v_lcl_addr

Definition at line 172 of file ip_mrout.h.

◆ v_pkt_in

u_long vif::v_pkt_in

Definition at line 175 of file ip_mrout.h.

◆ v_pkt_out

u_long vif::v_pkt_out

Definition at line 176 of file ip_mrout.h.

◆ v_rate_limit

u_int vif::v_rate_limit

Definition at line 170 of file ip_mrout.h.

◆ v_rmt_addr

struct in_addr vif::v_rmt_addr

Definition at line 173 of file ip_mrout.h.

◆ v_route

struct route vif::v_route

Definition at line 179 of file ip_mrout.h.

◆ v_rsvp_on

u_int vif::v_rsvp_on

Definition at line 180 of file ip_mrout.h.

◆ v_rsvpd

struct socket* vif::v_rsvpd

Definition at line 181 of file ip_mrout.h.

◆ v_tbf

struct tbf* vif::v_tbf

Definition at line 171 of file ip_mrout.h.

◆ v_threshold

u_char vif::v_threshold

Definition at line 169 of file ip_mrout.h.


Watt-32 tcp/ip: vifctl Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
vifctl Struct Reference
Collaboration diagram for vifctl:
[legend]

Data Fields

vifi_t | vifc_vifi
u_char | vifc_flags
u_char | vifc_threshold
u_int | vifc_rate_limit
struct in_addr | vifc_lcl_addr
struct in_addr | vifc_rmt_addr

Detailed Description

Definition at line 99 of file ip_mrout.h.

Field Documentation

◆ vifc_flags

u_char vifctl::vifc_flags

Definition at line 101 of file ip_mrout.h.

◆ vifc_lcl_addr

struct in_addr vifctl::vifc_lcl_addr

Definition at line 104 of file ip_mrout.h.

◆ vifc_rate_limit

u_int vifctl::vifc_rate_limit

Definition at line 103 of file ip_mrout.h.

◆ vifc_rmt_addr

struct in_addr vifctl::vifc_rmt_addr

Definition at line 105 of file ip_mrout.h.

◆ vifc_threshold

u_char vifctl::vifc_threshold

Definition at line 102 of file ip_mrout.h.

◆ vifc_vifi

vifi_t vifctl::vifc_vifi

Definition at line 100 of file ip_mrout.h.


Watt-32 tcp/ip: vjstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
vjstat Struct Reference
Collaboration diagram for vjstat:
[legend]

Data Fields

unsigned int | vjs_packets
unsigned int | vjs_compressed
unsigned int | vjs_searches
unsigned int | vjs_misses
unsigned int | vjs_uncompressedin
unsigned int | vjs_compressedin
unsigned int | vjs_errorin
unsigned int | vjs_tossed

Detailed Description

Definition at line 155 of file ppp_defs.h.

Field Documentation

◆ vjs_compressed

unsigned int vjstat::vjs_compressed

Definition at line 157 of file ppp_defs.h.

◆ vjs_compressedin

unsigned int vjstat::vjs_compressedin

Definition at line 161 of file ppp_defs.h.

◆ vjs_errorin

unsigned int vjstat::vjs_errorin

Definition at line 162 of file ppp_defs.h.

◆ vjs_misses

unsigned int vjstat::vjs_misses

Definition at line 159 of file ppp_defs.h.

◆ vjs_packets

unsigned int vjstat::vjs_packets

Definition at line 156 of file ppp_defs.h.

◆ vjs_searches

unsigned int vjstat::vjs_searches

Definition at line 158 of file ppp_defs.h.

◆ vjs_tossed

unsigned int vjstat::vjs_tossed

Definition at line 163 of file ppp_defs.h.

◆ vjs_uncompressedin

unsigned int vjstat::vjs_uncompressedin

Definition at line 160 of file ppp_defs.h.


Watt-32 tcp/ip: vlan_Header Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
vlan_Header Struct Reference

#include <pcsed.h>

Collaboration diagram for vlan_Header:
[legend]

Data Fields

eth_address | destination
eth_address | source
WORD | proto
WORD | tci
WORD | encap_proto

Detailed Description

The 802.1Q VLAN header (on Ethernet).

Definition at line 48 of file pcsed.h.

Field Documentation

◆ destination

eth_address vlan_Header::destination

Definition at line 49 of file pcsed.h.

◆ encap_proto

WORD vlan_Header::encap_proto

Definition at line 53 of file pcsed.h.

◆ proto

WORD vlan_Header::proto

Definition at line 51 of file pcsed.h.

◆ source

eth_address vlan_Header::source

Definition at line 50 of file pcsed.h.

◆ tci

WORD vlan_Header::tci

Definition at line 52 of file pcsed.h.


Watt-32 tcp/ip: vlan_Packet Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
vlan_Packet Struct Reference

#include <pcsed.h>

Collaboration diagram for vlan_Packet:
[legend]

Data Fields

vlan_Header head
BYTE data [VLAN_MAX_DATA]

Detailed Description

The 802.1Q VLAN header with data.

Definition at line 60 of file pcsed.h.

Field Documentation

◆ data

BYTE vlan_Packet::data[VLAN_MAX_DATA]

Definition at line 62 of file pcsed.h.

◆ head

vlan_Header vlan_Packet::head

Definition at line 61 of file pcsed.h.


Watt-32 tcp/ip: watt_sockaddr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
watt_sockaddr Struct Reference
Collaboration diagram for watt_sockaddr:
[legend]

Data Fields

WORD | s_type
WORD | s_port
DWORD | s_ip
BYTE | s_spares [6]

Detailed Description

Definition at line 609 of file tcp.h.

Field Documentation

◆ s_ip

DWORD watt_sockaddr::s_ip

Definition at line 612 of file tcp.h.

◆ s_port

WORD watt_sockaddr::s_port

Definition at line 611 of file tcp.h.

◆ s_spares

BYTE watt_sockaddr::s_spares[6]

Definition at line 613 of file tcp.h.

◆ s_type

WORD watt_sockaddr::s_type

Definition at line 610 of file tcp.h.


Watt-32 tcp/ip: whod Struct Reference

  • Data Structure Index
  • Data Fields
Data Structures | Data Fields
whod Struct Reference
Collaboration diagram for whod:
[legend]

Data Structures

struct whoent

Data Fields

char | wd_vers
char | wd_type
char | wd_pad [2]
int32_t | wd_sendtime
int32_t | wd_recvtime
char | wd_hostname [32]
int32_t | wd_loadav [3]
int32_t | wd_boottime
struct whod::whoent | wd_we [1024/sizeof(struct whoent)]

Detailed Description

Definition at line 55 of file rwhod.h.

Field Documentation

◆ wd_boottime

int32_t whod::wd_boottime

Definition at line 63 of file rwhod.h.

◆ wd_hostname

char whod::wd_hostname[32]

Definition at line 61 of file rwhod.h.

◆ wd_loadav

int32_t whod::wd_loadav[3]

Definition at line 62 of file rwhod.h.

◆ wd_pad

char whod::wd_pad[2]

Definition at line 58 of file rwhod.h.

◆ wd_recvtime

int32_t whod::wd_recvtime

Definition at line 60 of file rwhod.h.

◆ wd_sendtime

int32_t whod::wd_sendtime

Definition at line 59 of file rwhod.h.

◆ wd_type

char whod::wd_type

Definition at line 57 of file rwhod.h.

◆ wd_vers

char whod::wd_vers

Definition at line 56 of file rwhod.h.


Watt-32 tcp/ip: whod::whoent Struct Reference

  • Data Structure Index
  • Data Fields
  • whod
  • whoent
Data Fields
whod::whoent Struct Reference
Collaboration diagram for whod::whoent:
[legend]

Data Fields

struct outmp | we_utmp
int32_t | we_idle

Detailed Description

Definition at line 64 of file rwhod.h.

Field Documentation

◆ we_idle

int32_t whod::whoent::we_idle

Definition at line 66 of file rwhod.h.

◆ we_utmp

struct outmp whod::whoent::we_utmp

Definition at line 65 of file rwhod.h.


Watt-32 tcp/ip: winsock_fd_set Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
winsock_fd_set Struct Reference
Collaboration diagram for winsock_fd_set:
[legend]

Data Fields

unsigned int | fd_count
int | fd_array [FD_SETSIZE]

Detailed Description

Definition at line 50 of file winsock.h.

Field Documentation

◆ fd_array

int winsock_fd_set::fd_array

Definition at line 52 of file winsock.h.

◆ fd_count

unsigned int winsock_fd_set::fd_count

Definition at line 51 of file winsock.h.


Watt-32 tcp/ip: WLAN_AUTH_CIPHER_PAIR_LIST2 Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
WLAN_AUTH_CIPHER_PAIR_LIST2 Struct Reference
Collaboration diagram for WLAN_AUTH_CIPHER_PAIR_LIST2:
[legend]

Data Fields

DWORD | dwNumberOfItems
DOT11_AUTH_CIPHER_PAIR | pAuthCipherPairList [16]

Detailed Description

Definition at line 1011 of file winadinf.h.

Field Documentation

◆ dwNumberOfItems

DWORD WLAN_AUTH_CIPHER_PAIR_LIST2::dwNumberOfItems

Definition at line 1012 of file winadinf.h.

◆ pAuthCipherPairList

DOT11_AUTH_CIPHER_PAIR WLAN_AUTH_CIPHER_PAIR_LIST2::pAuthCipherPairList[16]

Definition at line 1013 of file winadinf.h.


Watt-32 tcp/ip: WSAData Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
WSAData Struct Reference
Collaboration diagram for WSAData:
[legend]

Data Fields

unsigned short | wVersion
unsigned short | wHighVersion
char | szDescription [WSADESCRIPTION_LEN+1]
char | szSystemStatus [WSASYS_STATUS_LEN+1]
unsigned short | iMaxSockets
unsigned short | iMaxUdpDg
char * | lpVendorInfo

Detailed Description

Definition at line 27 of file winsock.h.

Field Documentation

◆ iMaxSockets

unsigned short WSAData::iMaxSockets

Definition at line 32 of file winsock.h.

◆ iMaxUdpDg

unsigned short WSAData::iMaxUdpDg

Definition at line 33 of file winsock.h.

◆ lpVendorInfo

char * WSAData::lpVendorInfo

Definition at line 34 of file winsock.h.

◆ szDescription

char WSAData::szDescription

Definition at line 30 of file winsock.h.

◆ szSystemStatus

char WSAData::szSystemStatus

Definition at line 31 of file winsock.h.

◆ wHighVersion

unsigned short WSAData::wHighVersion

Definition at line 29 of file winsock.h.

◆ wVersion

unsigned short WSAData::wVersion

Definition at line 28 of file winsock.h.


Watt-32 tcp/ip: wstat Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
wstat Struct Reference
Collaboration diagram for wstat:
[legend]

Data Fields

time_t | st_atime
time_t | st_ctime
dev_t | st_dev
gid_t | st_gid
ino_t | st_ino
mode_t | st_mode
time_t | st_mtime
nlink_t | st_nlink
off_t | st_size
blksize_t | st_blksize
uid_t | st_uid
dev_t | st_rdev

Detailed Description

Definition at line 56 of file fsext.c.

Field Documentation

◆ st_atime

time_t wstat::st_atime

Definition at line 57 of file fsext.c.

◆ st_blksize

blksize_t wstat::st_blksize

Definition at line 66 of file fsext.c.

◆ st_ctime

time_t wstat::st_ctime

Definition at line 58 of file fsext.c.

◆ st_dev

dev_t wstat::st_dev

Definition at line 59 of file fsext.c.

◆ st_gid

gid_t wstat::st_gid

Definition at line 60 of file fsext.c.

◆ st_ino

ino_t wstat::st_ino

Definition at line 61 of file fsext.c.

◆ st_mode

mode_t wstat::st_mode

Definition at line 62 of file fsext.c.

◆ st_mtime

time_t wstat::st_mtime

Definition at line 63 of file fsext.c.

◆ st_nlink

nlink_t wstat::st_nlink

Definition at line 64 of file fsext.c.

◆ st_rdev

dev_t wstat::st_rdev

Definition at line 68 of file fsext.c.

◆ st_size

off_t wstat::st_size

Definition at line 65 of file fsext.c.

◆ st_uid

uid_t wstat::st_uid

Definition at line 67 of file fsext.c.


Watt-32 tcp/ip: xcp_type Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
xcp_type Struct Reference
Collaboration diagram for xcp_type:
[legend]

Data Fields

char * | name
short | type
short | flag
BYTE | minlen
BYTE | maxlen
DWORD | default_value
xcp_func | validate_req
xcp_func | validate_nak
xcp_func | show

Detailed Description

Definition at line 73 of file ppp.h.

Field Documentation

◆ default_value

DWORD xcp_type::default_value

Definition at line 79 of file ppp.h.

◆ flag

short xcp_type::flag

Definition at line 76 of file ppp.h.

◆ maxlen

BYTE xcp_type::maxlen

Definition at line 78 of file ppp.h.

◆ minlen

BYTE xcp_type::minlen

Definition at line 77 of file ppp.h.

◆ name

char* xcp_type::name

Definition at line 74 of file ppp.h.

◆ show

xcp_func xcp_type::show

Definition at line 82 of file ppp.h.

◆ type

short xcp_type::type

Definition at line 75 of file ppp.h.

◆ validate_nak

xcp_func xcp_type::validate_nak

Definition at line 81 of file ppp.h.

◆ validate_req

xcp_func xcp_type::validate_req

Definition at line 80 of file ppp.h.


Watt-32 tcp/ip: XDR Struct Reference

  • Data Structure Index
  • Data Fields
Data Structures | Data Fields
XDR Struct Reference
Collaboration diagram for XDR:
[legend]

Data Structures

struct xdr_ops

Data Fields

enum xdr_op | x_op
struct XDR::xdr_ops * | x_ops
caddr_t | x_public
caddr_t | x_private
caddr_t | x_base
int | x_handy

Detailed Description

Definition at line 116 of file xdr.h.

Field Documentation

◆ x_base

caddr_t XDR::x_base

Definition at line 130 of file xdr.h.

◆ x_handy

int XDR::x_handy

Definition at line 131 of file xdr.h.

◆ x_op

enum xdr_op XDR::x_op

Definition at line 117 of file xdr.h.

◆ x_private

caddr_t XDR::x_private

Definition at line 129 of file xdr.h.

◆ x_public

caddr_t XDR::x_public

Definition at line 128 of file xdr.h.


Watt-32 tcp/ip: XDR::xdr_ops Struct Reference

  • Data Structure Index
  • Data Fields
  • XDR
  • xdr_ops
Data Fields
XDR::xdr_ops Struct Reference
Collaboration diagram for XDR::xdr_ops:
[legend]

Data Fields

bool_t(* | x_getlong )()
bool_t(* | x_putlong )()
bool_t(* | x_getbytes )()
bool_t(* | x_putbytes )()
u_int(* | x_getpostn )()
bool_t(* | x_setpostn )()
long *(* | x_inline )()
void(* | x_destroy )()

Detailed Description

Definition at line 118 of file xdr.h.

Field Documentation

◆ x_destroy

void(* XDR::xdr_ops::x_destroy) ()

Definition at line 126 of file xdr.h.

◆ x_getbytes

bool_t(* XDR::xdr_ops::x_getbytes) ()

Definition at line 121 of file xdr.h.

◆ x_getlong

bool_t(* XDR::xdr_ops::x_getlong) ()

Definition at line 119 of file xdr.h.

◆ x_getpostn

u_int(* XDR::xdr_ops::x_getpostn) ()

Definition at line 123 of file xdr.h.

◆ x_inline

long *(* XDR::xdr_ops::x_inline) ()

Definition at line 125 of file xdr.h.

◆ x_putbytes

bool_t(* XDR::xdr_ops::x_putbytes) ()

Definition at line 122 of file xdr.h.

◆ x_putlong

bool_t(* XDR::xdr_ops::x_putlong) ()

Definition at line 120 of file xdr.h.

◆ x_setpostn

bool_t(* XDR::xdr_ops::x_setpostn) ()

Definition at line 124 of file xdr.h.


Watt-32 tcp/ip: xdr_discrim Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
xdr_discrim Struct Reference
Collaboration diagram for xdr_discrim:
[legend]

Data Fields

int | value
xdrproc_t | proc

Detailed Description

Definition at line 209 of file xdr.h.

Field Documentation

◆ proc

xdrproc_t xdr_discrim::proc

Definition at line 211 of file xdr.h.

◆ value

int xdr_discrim::value

Definition at line 210 of file xdr.h.


Watt-32 tcp/ip: ypall_callback Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypall_callback Struct Reference
Collaboration diagram for ypall_callback:
[legend]

Data Fields

int(* | foreach )()
char * | data

Detailed Description

Definition at line 64 of file ypclnt.h.

Field Documentation

◆ data

char* ypall_callback::data

Definition at line 66 of file ypclnt.h.

◆ foreach

int(* ypall_callback::foreach) ()

Definition at line 65 of file ypclnt.h.


Watt-32 tcp/ip: ypbind_binding Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypbind_binding Struct Reference
Collaboration diagram for ypbind_binding:
[legend]

Data Fields

struct in_addr | ypbind_binding_addr
u_short | ypbind_binding_port

Detailed Description

Definition at line 263 of file yp_prot.h.

Field Documentation

◆ ypbind_binding_addr

struct in_addr ypbind_binding::ypbind_binding_addr

Definition at line 264 of file yp_prot.h.

◆ ypbind_binding_port

u_short ypbind_binding::ypbind_binding_port

Definition at line 265 of file yp_prot.h.


Watt-32 tcp/ip: ypbind_resp Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypbind_resp Struct Reference
Collaboration diagram for ypbind_resp:
[legend]

Data Fields

enum ypbind_resptype ypbind_status
union {
u_long ypbind_error
struct ypbind_binding ypbind_bindinfo
} ypbind_respbody

Detailed Description

Definition at line 268 of file yp_prot.h.

Field Documentation

◆ ypbind_bindinfo

struct ypbind_binding ypbind_resp::ypbind_bindinfo

Definition at line 272 of file yp_prot.h.

◆ ypbind_error

u_long ypbind_resp::ypbind_error

Definition at line 271 of file yp_prot.h.

◆ ypbind_status

enum ypbind_resptype ypbind_resp::ypbind_status

Definition at line 269 of file yp_prot.h.


Watt-32 tcp/ip: ypbind_setdom Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypbind_setdom Struct Reference
Collaboration diagram for ypbind_setdom:
[legend]

Data Fields

char | ypsetdom_domain [YPMAXDOMAIN+1]
struct ypbind_binding | ypsetdom_binding
u_short | ypsetdom_vers

Detailed Description

Definition at line 284 of file yp_prot.h.

Field Documentation

◆ ypsetdom_binding

struct ypbind_binding ypbind_setdom::ypsetdom_binding

Definition at line 286 of file yp_prot.h.

◆ ypsetdom_domain

char ypbind_setdom::ypsetdom_domain[YPMAXDOMAIN+1]

Definition at line 285 of file yp_prot.h.

◆ ypsetdom_vers

u_short ypbind_setdom::ypsetdom_vers

Definition at line 287 of file yp_prot.h.


Watt-32 tcp/ip: ypmap_parms Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypmap_parms Struct Reference
Collaboration diagram for ypmap_parms:
[legend]

Data Fields

char * | domain
char * | map
u_long | ordernum
char * | owner

Detailed Description

Definition at line 123 of file yp_prot.h.

Field Documentation

◆ domain

char* ypmap_parms::domain

Definition at line 124 of file yp_prot.h.

◆ map

char* ypmap_parms::map

Definition at line 125 of file yp_prot.h.

◆ ordernum

u_long ypmap_parms::ordernum

Definition at line 126 of file yp_prot.h.

◆ owner

char* ypmap_parms::owner

Definition at line 127 of file yp_prot.h.


Watt-32 tcp/ip: ypmaplist Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypmaplist Struct Reference
Collaboration diagram for ypmaplist:
[legend]

Data Fields

char | ypml_name [YPMAXMAP+1]
struct ypmaplist * | ypml_next

Detailed Description

Definition at line 173 of file yp_prot.h.

Field Documentation

◆ ypml_name

char ypmaplist::ypml_name[YPMAXMAP+1]

Definition at line 174 of file yp_prot.h.

◆ ypml_next

struct ypmaplist* ypmaplist::ypml_next

Definition at line 175 of file yp_prot.h.


Watt-32 tcp/ip: yppushresp_xfr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
yppushresp_xfr Struct Reference
Collaboration diagram for yppushresp_xfr:
[legend]

Data Fields

u_long | transid
u_long | status

Detailed Description

Definition at line 311 of file yp_prot.h.

Field Documentation

◆ status

u_long yppushresp_xfr::status

Definition at line 313 of file yp_prot.h.

◆ transid

u_long yppushresp_xfr::transid

Definition at line 312 of file yp_prot.h.


Watt-32 tcp/ip: ypreq_key Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypreq_key Struct Reference
Collaboration diagram for ypreq_key:
[legend]

Data Fields

char * | domain
char * | map
datum keydat

Detailed Description

Definition at line 130 of file yp_prot.h.

Field Documentation

◆ domain

char* ypreq_key::domain

Definition at line 131 of file yp_prot.h.

◆ keydat

datum ypreq_key::keydat

Definition at line 133 of file yp_prot.h.

◆ map

char* ypreq_key::map

Definition at line 132 of file yp_prot.h.


Watt-32 tcp/ip: ypreq_nokey Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypreq_nokey Struct Reference
Collaboration diagram for ypreq_nokey:
[legend]

Data Fields

char * | domain
char * | map

Detailed Description

Definition at line 136 of file yp_prot.h.

Field Documentation

◆ domain

char* ypreq_nokey::domain

Definition at line 137 of file yp_prot.h.

◆ map

char* ypreq_nokey::map

Definition at line 138 of file yp_prot.h.


Watt-32 tcp/ip: ypreq_xfr Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypreq_xfr Struct Reference
Collaboration diagram for ypreq_xfr:
[legend]

Data Fields

struct ypmap_parms | map_parms
u_long | transid
u_long | proto
u_short | port

Detailed Description

Definition at line 141 of file yp_prot.h.

Field Documentation

◆ map_parms

struct ypmap_parms ypreq_xfr::map_parms

Definition at line 142 of file yp_prot.h.

◆ port

u_short ypreq_xfr::port

Definition at line 145 of file yp_prot.h.

◆ proto

u_long ypreq_xfr::proto

Definition at line 144 of file yp_prot.h.

◆ transid

u_long ypreq_xfr::transid

Definition at line 143 of file yp_prot.h.


Watt-32 tcp/ip: ypresp_key_val Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypresp_key_val Struct Reference
Collaboration diagram for ypresp_key_val:
[legend]

Data Fields

u_long status
datum keydat
datum valdat

Detailed Description

Definition at line 157 of file yp_prot.h.

Field Documentation

◆ keydat

datum ypresp_key_val::keydat

Definition at line 159 of file yp_prot.h.

◆ status

u_long ypresp_key_val::status

Definition at line 158 of file yp_prot.h.

◆ valdat

datum ypresp_key_val::valdat

Definition at line 160 of file yp_prot.h.


Watt-32 tcp/ip: ypresp_maplist Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypresp_maplist Struct Reference
Collaboration diagram for ypresp_maplist:
[legend]

Data Fields

u_long | status
struct ypmaplist * | list

Detailed Description

Definition at line 178 of file yp_prot.h.

Field Documentation

◆ list

struct ypmaplist* ypresp_maplist::list

Definition at line 180 of file yp_prot.h.

◆ status

u_long ypresp_maplist::status

Definition at line 179 of file yp_prot.h.


Watt-32 tcp/ip: ypresp_master Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypresp_master Struct Reference
Collaboration diagram for ypresp_master:
[legend]

Data Fields

u_long | status
char * | master

Detailed Description

Definition at line 163 of file yp_prot.h.

Field Documentation

◆ master

char* ypresp_master::master

Definition at line 165 of file yp_prot.h.

◆ status

u_long ypresp_master::status

Definition at line 164 of file yp_prot.h.


Watt-32 tcp/ip: ypresp_order Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypresp_order Struct Reference
Collaboration diagram for ypresp_order:
[legend]

Data Fields

u_long | status
u_long | ordernum

Detailed Description

Definition at line 168 of file yp_prot.h.

Field Documentation

◆ ordernum

u_long ypresp_order::ordernum

Definition at line 170 of file yp_prot.h.

◆ status

u_long ypresp_order::status

Definition at line 169 of file yp_prot.h.


Watt-32 tcp/ip: ypresp_val Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
ypresp_val Struct Reference
Collaboration diagram for ypresp_val:
[legend]

Data Fields

u_long status
datum valdat

Detailed Description

Definition at line 152 of file yp_prot.h.

Field Documentation

◆ status

u_long ypresp_val::status

Definition at line 153 of file yp_prot.h.

◆ valdat

datum ypresp_val::valdat

Definition at line 154 of file yp_prot.h.


Watt-32 tcp/ip: yy_buffer_state Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
yy_buffer_state Struct Reference
Collaboration diagram for yy_buffer_state:
[legend]

Data Fields

FILE * | yy_input_file
char * | yy_ch_buf
char * | yy_buf_pos
int | yy_buf_size
int | yy_n_chars
int | yy_is_our_buffer
int | yy_is_interactive
int | yy_at_bol
int | yy_bs_lineno
The line count.
int | yy_bs_column
The column count.
int | yy_fill_buffer
int | yy_buffer_status

Detailed Description

Definition at line 463 of file lang.c.

Field Documentation

◆ yy_at_bol

int yy_buffer_state::yy_at_bol

Definition at line 497 of file lang.c.

◆ yy_bs_column

int yy_buffer_state::yy_bs_column

The column count.

Definition at line 500 of file lang.c.

◆ yy_bs_lineno

int yy_buffer_state::yy_bs_lineno

The line count.

Definition at line 499 of file lang.c.

◆ yy_buf_pos

char* yy_buffer_state::yy_buf_pos

Definition at line 468 of file lang.c.

◆ yy_buf_size

int yy_buffer_state::yy_buf_size

Definition at line 473 of file lang.c.

◆ yy_buffer_status

int yy_buffer_state::yy_buffer_status

Definition at line 507 of file lang.c.

◆ yy_ch_buf

char* yy_buffer_state::yy_ch_buf

Definition at line 467 of file lang.c.

◆ yy_fill_buffer

int yy_buffer_state::yy_fill_buffer

Definition at line 505 of file lang.c.

◆ yy_input_file

FILE* yy_buffer_state::yy_input_file

Definition at line 465 of file lang.c.

◆ yy_is_interactive

int yy_buffer_state::yy_is_interactive

Definition at line 491 of file lang.c.

◆ yy_is_our_buffer

int yy_buffer_state::yy_is_our_buffer

Definition at line 484 of file lang.c.

◆ yy_n_chars

int yy_buffer_state::yy_n_chars

Definition at line 478 of file lang.c.


Watt-32 tcp/ip: yy_trans_info Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
yy_trans_info Struct Reference
Collaboration diagram for yy_trans_info:
[legend]

Data Fields

flex_int32_t | yy_verify
flex_int32_t | yy_nxt

Detailed Description

Definition at line 636 of file lang.c.

Field Documentation

◆ yy_nxt

flex_int32_t yy_trans_info::yy_nxt

Definition at line 639 of file lang.c.

◆ yy_verify

flex_int32_t yy_trans_info::yy_verify

Definition at line 638 of file lang.c.


Watt-32 tcp/ip: z_stream_s Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
z_stream_s Struct Reference
Collaboration diagram for z_stream_s:
[legend]

Data Fields

Bytef * | next_in
uInt | avail_in
uLong | total_in
Bytef * | next_out
uInt | avail_out
uLong | total_out
char * | msg
struct internal_state FAR * | state
alloc_func | zalloc
free_func | zfree
voidpf | opaque
int | data_type
uLong | adler
uLong | reserved

Detailed Description

Definition at line 84 of file zlib.h.

Field Documentation

◆ adler

uLong z_stream_s::adler

Definition at line 101 of file zlib.h.

◆ avail_in

uInt z_stream_s::avail_in

Definition at line 86 of file zlib.h.

◆ avail_out

uInt z_stream_s::avail_out

Definition at line 90 of file zlib.h.

◆ data_type

int z_stream_s::data_type

Definition at line 100 of file zlib.h.

◆ msg

char* z_stream_s::msg

Definition at line 93 of file zlib.h.

◆ next_in

Bytef* z_stream_s::next_in

Definition at line 85 of file zlib.h.

◆ next_out

Bytef* z_stream_s::next_out

Definition at line 89 of file zlib.h.

◆ opaque

voidpf z_stream_s::opaque

Definition at line 98 of file zlib.h.

◆ reserved

uLong z_stream_s::reserved

Definition at line 102 of file zlib.h.

◆ state

struct internal_state FAR* z_stream_s::state

Definition at line 94 of file zlib.h.

◆ total_in

uLong z_stream_s::total_in

Definition at line 87 of file zlib.h.

◆ total_out

uLong z_stream_s::total_out

Definition at line 91 of file zlib.h.

◆ zalloc

alloc_func z_stream_s::zalloc

Definition at line 96 of file zlib.h.

◆ zfree

free_func z_stream_s::zfree

Definition at line 97 of file zlib.h.


Watt-32 tcp/ip: Data Structure Index

  • Data Structure Index
  • Data Fields
Data Structure Index
A | B | C | D | E | F | G | H | I | L | M | N | O | P | R | S | T | U | V | W | X | Y | Z | _
A
arccom::ac_frag
accepted_reply
ADAPTER
ADAPTER_INFO
addrinfo
afd
ah
ah_algorithm
ah_algorithm_state
arc_header
arccom
arcnet_Header
arcnet_Packet
arp
arp_entry
arp_Header
arpcom
arpreq
arptab
async_iocb
atm_pseudoioctl
atmllc
AUTH
AUTH::auth_ops
authdes_cred
authdes_fullname
authdes_verf
authunix_parms
ax25_Header
ax25_Packet
B
bootp
bootp_vend
bpf_d
bpf_hdr
bpf_if
bpf_insn
bpf_program
bpf_stat
bpf_version
C
cache_stat
call_body
callout
CLIENT
CLIENT::clnt_ops
cmd_block
cmsghdr
code
compressor
compstat
config_s
config_table
conv_t
cookieMessage
cr0
cr0_bits
cryptkeyarg
cryptkeyres
cstate
ct_data_s
CTL_MSG
CTL_RESPONSE
D
datum
des_block
dhcp
DHCP_list
DNS_Header
DNS_Query
DNS_query
DNS_resource
do_redirect
dom_binding
DPMI_callback
DPMI_regs
E
eflags
eflags_bits
Elem
esp
esp_algorithm
esptail
eth_Header
eth_Packet
ethent
ether_arp
ether_header
ether_multi
ether_multistep
explore
F
FAULT_STRUC
FCFILE
fd_set
fddi_Header
fddi_Packet
ICMP_ip::For
frag_bucket
frag_ctrl
frag_key
frmrinfo
full_tcpiphdr
G
gate_entry
getcredres
gz_stream
H
HEADER
hole
host_list
hostent
huge_ip
I
icmp
icmp6_cache
ICMP6_echo
icmp6_ifstat
ICMP6_MTU
icmp6_namelookup
ICMP6_nd_adv
ICMP6_nd_ra
ICMP6_nd_sol
icmp6_nodeinfo
ICMP6_PKT
ICMP6_pointer
ICMP6_route_adv
ICMP6_route_sol
icmp6_router_renum
ICMP6_unused
icmp6errstat
icmp6stat
ICMP_addr_mask
ICMP_echo
ICMP_info
ICMP_ip
ICMP_needfrag
ICMP_PKT
ICMP_pointer
ICMP_timestamp
ICMP_traceroute
ICMP_unused
icmpstat
iconv_table
if_data
if_msghdr
if_set
ifa_msghdr
ifaddr
ifaliasreq
ifconf
ifmedia_description
ifmediareq
ifnet
ifpppcstatsreq
ifpppstatsreq
ifprefix
ifqueue
ifreq
igmpmsg
igmpstat
IGMPv0_packet
IGMPv1_packet
IGMPv2_packet
IGMPv3_packet
in6_addr
in6_addrlifetime
in6_aliasreq
in6_defrouter
in6_drlist
in6_Header
in6_ifaddr
in6_ifreq
in6_ifstat
in6_multi
in6_multi_mship
in6_multistep
in6_nbrinfo
in6_ndifreq
in6_ndireq
in6_ondireq
in6_pktinfo
in6_prefix
in6_prefixreq
in6_prflags
in6_prlist
in6_rrenumreq
in_addr
in_aliasreq
in_Header
in_ifaddr
in_multi
inet6_ndpr_msghdr
inflate_state
inpcb
inpcbinfo
inpcbpolicy
internal_state
IOCTL_BUFFER
IOCTL_INFO
iovec
ip6_dest
ip6_ext
ip6_frag
ip6_fw
ip6_fw_chain
ip6_fw_if
ip6_hbh
ip6_moptions
ip6_packet
ip6_pktopts
ip6_RouteHdr
ip6_rthdr
ip6_rthdr0
ip6asfrag
ip6aux
ip6ctlparam
ip6po_rhinfo
ip6protosw
ip6q
ip6stat
ip_fw
ip_fw_chain
ip_moptions
ip_mreq
ip_opts
ip_Packet
ip_timestamp
ipasfrag
ipcomp
ipcomp_algorithm
ipoption
ipsec_history
ipsec_output_state
ipsecrequest
ipsecstat
ipstat
ip_timestamp::ipt_timestamp::ipt_ta
ip_timestamp::ipt_timestamp
ipv6_fraghdr
ipv6_mreq
ipv6_options
ipv6_rt0_hdr
ipv6_rt_hdr
IREGS
in6_rrenumreq::irr_raflagmask
itimerval
L
Language
link_Packet
llc_Header
llc_Packet
llinfo_nd6
LoadTable
M
macstat
mbuf
MD5_CTX
mf6c
mf6cctl
mfc
mfcctl
MIB_IPNETROW
MIB_IPNETTABLE
mif6
mif6ctl
mld_hdr
mrt6msg
mrt6stat
mrtstat
msghdr
MultiCast
N
nd_defrouter
nd_ifinfo
nd_neighbor_advert
nd_neighbor_solicit
nd_opt_hdr
nd_opt_mtu
nd_opt_prefix_info
nd_opt_rd_hdr
nd_opt_route_info
nd_opts
nd_pfxrouter
nd_prefix
nd_redirect
nd_router_advert
nd_router_solicit
netauth
netent
netinfo
netobj
newah
newesp
ni_reply_fqdn
Node
npf_if_addr
npioctl
O
omrt6msg
one_addr
opaque_auth
option_state
ortentry
osockaddr
outmp
P
packet_mreq
PACKET_OID_DATA
pim
pim6stat
ping_cache
ping_pkt
pkt_info
pkt_ringbuf
pkt_rx_element
pkt_split
PktParameters
PktStats
PM_driver
pmap
pmaplist
pollfd
ppp_comp_stats
ppp_dispatch
ppp_idle
ppp_option_data
ppp_softc
ppp_state
ppp_stats
ppp_xcp
pppoe_Header
pppoe_Packet
pppoestat
pppstat
prefix_table
prf_ra
prf_rr
proc
protoent
ptr_table_s
R
rp_addr::ra_flags
radix_mask
radix_node
radix_node_head
rarp
rawcb
REAL_regs
recv_buf
recv_data
rejected_reply
reply_body
rip
rip6stat
RMC_BLK
RMCB_record
RMI_BLK
rmtcallargs
rmtcallres
rmxp_tao
route
route_cb
route_entry
route_in6
router_info
rp_addr
rr_prefix::rp_stateflags
rpc_createerr
rpc_err
rpc_msg
rpcent
rr_pco_match
rr_pco_use
rr_prefix
rr_result
rrec
rt_addrinfo
rt_metrics
rt_msghdr
rtdetq
rtentry
rtstat
run_list
S
__u_spcl::s_spcl
sackblock
sadb_address
sadb_alg
sadb_comb
sadb_ext
sadb_ident
sadb_key
sadb_lifetime
sadb_msg
sadb_prop
sadb_sa
sadb_sens
sadb_spirange
sadb_supported
sadb_x_ipsecrequest
sadb_x_kmprivate
sadb_x_policy
sadb_x_sa2
sarp_Auth
sarp_Packet
scoreboard
scrb_entry
sctp_ChunkDesc
sctp_CookiePreserve
sctp_CWR
sctp_DataPart
sctp_DNSName
sctp_ECN_echo
sctp_HBrequest
sctp_HBsender
sctp_HBunified
sctp_Header
sctp_Initiation
sctp_OpErrorCause
sctp_ParamDesc
sctp_RelChunkDesc
sctp_SelectiveAck
sctp_SelectiveFrag
sctp_SendableInit
sctp_Shutdown
sctp_TimeStamp
sctp_UnifiedAbort
sctp_UnifiedAbortHeavy
sctp_UnifiedAbortLight
sctp_UnifiedDatagram
sctp_UnifiedInit
sctp_UnifiedOpError
sctp_UnifiedSack
sctp_UnifiedShutdown
sctp_UnifiedSingleMsg
sctp_UnifiedStreamError
sctp_V4IpAddress
sctp_V6IpAddress
sctp_VendorSpecificParam
search_list
secpolicy
secpolicyindex
secspacq
selinfo
servent
setup_info_st
short_hand_verf
signal_table
sioc_mif_req6
sioc_sg_req
sioc_sg_req6
sioc_vif_req
sl_softc
slcompress
sock_packet_buf
sock_packet_pool
sock_type
sockaddr
sockaddr_dl
sockaddr_in
sockaddr_in6
sockaddr_ll
sockaddr_pkt
sockaddr_storage
sockaddr_un
socket
Socket
sockinet
sockproto
SRxBuffer
staleCookieMsg
static_tree_desc_s
strip_softc
Summary16
svc_req
SVCXPRT
SWI_REGS
SwsVpktAdapterState
SwsVpktOpenInfo
SwsVpktUsr
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
T
tad_entry
tbf
tcp6_pkt
tcp_debug
tcp_Header
tcp_pkt
tcp_PseudoHeader
tcp_PseudoHeader6
tcp_reasm
tcp_rtt
tcp_Socket
tcpcb
tcpopt
tcpstat
timespec
timeval
timezone
tms
tok
tok_Header
tok_Packet
token
tpacket_hdr
tpacket_req
tpacket_stats
tree_desc_s
tsp
tun_softc
U
udp_Header
udp_Socket
udphdr
ulong_long
unixcred
URL
V
vif
vifctl
vjstat
vlan_Header
vlan_Packet
W
watt_sockaddr
whod
whod::whoent
winsock_fd_set
WLAN_AUTH_CIPHER_PAIR_LIST2
WSAData
wstat
X
xcp_type
XDR
xdr_discrim
XDR::xdr_ops
SVCXPRT::xp_ops
Y
ypall_callback
ypbind_binding
ypbind_resp
ypbind_setdom
ypmap_parms
ypmaplist
yppushresp_xfr
ypreq_key
ypreq_nokey
ypreq_xfr
ypresp_key_val
ypresp_maplist
ypresp_master
ypresp_order
ypresp_val
yy_buffer_state
yy_trans_info
Z
z_stream_s
_
__res_sort
__res_state
__u_spcl
_code
_DOT11_AUTH_CIPHER_PAIR
_DOT11_SSID
_GEN_GET_NETCARD_TIME
_GEN_GET_TIME_CAPS
_hostent
_hostent6
_MIB_IF_ROW2
_MIB_IF_TABLE2
_MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES
_MIB_IPFORWARD_ROW2
_MIB_IPFORWARD_TABLE2
_MIB_IPINTERFACE_ROW
_MIB_IPNET_ROW2
_MIB_IPNET_TABLE2
_NDIS_CO_LINK_SPEED
_NDIS_IRDA_PACKET_INFO
_NDIS_STATISTICS_VALUE
_NDIS_VAR_DATA_DESC
_NET_PNP_ID
_NET_PNP_TRANSLATE_LIST
_netent
_NL_BANDWIDTH_INFORMATION
_pkt
_protoent
_raw6_Socket
_raw_Socket
_servent
_SOCKET_ADDRESS
_WLAN_ASSOCIATION_ATTRIBUTES
_WLAN_AUTH_CIPHER_PAIR_LIST
_WLAN_AVAILABLE_NETWORK
_WLAN_AVAILABLE_NETWORK_LIST
_WLAN_BSS_ENTRY
_WLAN_BSS_LIST
_WLAN_CONNECTION_ATTRIBUTES
_WLAN_DEVICE_SERVICE_GUID_LIST2
_WLAN_INTERFACE_CAPABILITY
_WLAN_INTERFACE_INFO
_WLAN_INTERFACE_INFO_LIST
_WLAN_MAC_FRAME_STATISTICS
_WLAN_PHY_FRAME_STATISTICS
_WLAN_PHY_RADIO_STATE
_WLAN_RADIO_STATE
_WLAN_RATE_SET
_WLAN_SECURITY_ATTRIBUTES
_WLAN_STATISTICS
_WSAQuerySetA


Watt-32 tcp/ip: Data Fields

  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • y
Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:

- a -

  • aa : HEADER
  • active : MultiCast
  • ad : HEADER
  • adv_win : tcp_Socket
  • ancount : HEADER
  • arcount : HEADER

- b -

  • buf_size : pkt_ringbuf
  • buf_start : pkt_ringbuf

- c -

  • cd : HEADER
  • cwindow : tcp_Socket

- d -

  • datatimer : tcp_Socket
  • dos_ofs : pkt_ringbuf

- e -

  • ethaddr : MultiCast
  • expiry : arp_entry

- f -

  • flags : arp_entry, tcp_Socket

- g -

  • gate_ip : gate_entry

- h -

  • hardware : arp_entry
  • his6addr : tcp_Socket
  • hwAddrLen : arp_Header

- i -

  • id : HEADER
  • in_index : pkt_ringbuf
  • inactive_to : tcp_Socket
  • ip : arp_entry, MultiCast, tcp_rtt
  • ip_type : _raw_Socket
  • ips_reassembled : ipstat

- k -

  • karn_count : tcp_Socket

- l -

  • last_acknum : tcp_Socket
  • last_seqnum : tcp_Socket

- m -

  • mask : gate_entry
  • max_seg : tcp_Socket
  • max_tx_data : tcp_Socket
  • missed_seq : tcp_Socket
  • MTU : tcp_rtt
  • my6addr : tcp_Socket

- n -

  • next : tcp_Socket
  • nscount : HEADER
  • num_buf : pkt_ringbuf
  • num_drop : pkt_ringbuf

- o -

  • opcode : HEADER
  • out_index : pkt_ringbuf

- p -

  • processes : MultiCast
  • protoAddrLen : arp_Header

- q -

  • qdcount : HEADER
  • qr : HEADER

- r -

  • ra : HEADER
  • rcode : HEADER
  • rd : HEADER
  • recent : tcp_Socket
  • recv_next : tcp_Socket
  • reply_timer : MultiCast
  • retransmit_to : arp_entry
  • rto : tcp_rtt, tcp_Socket
  • rtt_lasttran : tcp_Socket
  • rtt_time : tcp_Socket
  • rx_buf : tcp_Socket
  • rx_data : _raw_Socket

- s -

  • safetysig : tcp_Socket
  • safetytcp : tcp_Socket
  • secret : tcp_Socket
  • send_next : tcp_Socket
  • send_una : tcp_Socket
  • seq_num : _raw_Socket
  • state : tcp_Socket
  • subnet : gate_entry

- t -

  • tc : HEADER
  • timeout : tcp_Socket
  • tos : tcp_Socket
  • ts_echo : tcp_Socket
  • ts_recent : tcp_Socket
  • ts_sent : tcp_Socket
  • tx_buf : tcp_Socket
  • tx_data : tcp_Socket
  • tx_datalen : tcp_Socket
  • tx_queuelen : tcp_Socket
  • tx_wscale : tcp_Socket

- u -

  • unhappy : tcp_Socket
  • unused : HEADER
  • used : _raw_Socket

- v -

  • vj_last : tcp_Socket
  • vj_sa : tcp_Socket
  • vj_sd : tcp_Socket

- w -

  • window : tcp_Socket
  • wwindow : tcp_Socket

- y -

  • yy_bs_column : yy_buffer_state
  • yy_bs_lineno : yy_buffer_state


Watt-32 tcp/ip: Data Fields - Variables

  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- a -

  • aa : HEADER
  • active : MultiCast
  • ad : HEADER
  • adv_win : tcp_Socket
  • ancount : HEADER
  • arcount : HEADER

- b -

  • buf_size : pkt_ringbuf
  • buf_start : pkt_ringbuf

- c -

  • cd : HEADER
  • cwindow : tcp_Socket

- d -

  • datatimer : tcp_Socket
  • dos_ofs : pkt_ringbuf

- e -

  • ethaddr : MultiCast
  • expiry : arp_entry

- f -

  • flags : arp_entry, tcp_Socket

- g -

  • gate_ip : gate_entry

- h -

  • hardware : arp_entry
  • his6addr : tcp_Socket
  • hwAddrLen : arp_Header

- i -

  • id : HEADER
  • in_index : pkt_ringbuf
  • inactive_to : tcp_Socket
  • ip : arp_entry, MultiCast, tcp_rtt
  • ip_type : _raw_Socket
  • ips_reassembled : ipstat

- k -

  • karn_count : tcp_Socket

- l -

  • last_acknum : tcp_Socket
  • last_seqnum : tcp_Socket

- m -

  • mask : gate_entry
  • max_seg : tcp_Socket
  • max_tx_data : tcp_Socket
  • missed_seq : tcp_Socket
  • MTU : tcp_rtt
  • my6addr : tcp_Socket

- n -

  • next : tcp_Socket
  • nscount : HEADER
  • num_buf : pkt_ringbuf
  • num_drop : pkt_ringbuf

- o -

  • opcode : HEADER
  • out_index : pkt_ringbuf

- p -

  • processes : MultiCast
  • protoAddrLen : arp_Header

- q -

  • qdcount : HEADER
  • qr : HEADER

- r -

  • ra : HEADER
  • rcode : HEADER
  • rd : HEADER
  • recent : tcp_Socket
  • recv_next : tcp_Socket
  • reply_timer : MultiCast
  • retransmit_to : arp_entry
  • rto : tcp_rtt, tcp_Socket
  • rtt_lasttran : tcp_Socket
  • rtt_time : tcp_Socket
  • rx_buf : tcp_Socket
  • rx_data : _raw_Socket

- s -

  • safetysig : tcp_Socket
  • safetytcp : tcp_Socket
  • secret : tcp_Socket
  • send_next : tcp_Socket
  • send_una : tcp_Socket
  • seq_num : _raw_Socket
  • state : tcp_Socket
  • subnet : gate_entry

- t -

  • tc : HEADER
  • timeout : tcp_Socket
  • tos : tcp_Socket
  • ts_echo : tcp_Socket
  • ts_recent : tcp_Socket
  • ts_sent : tcp_Socket
  • tx_buf : tcp_Socket
  • tx_data : tcp_Socket
  • tx_datalen : tcp_Socket
  • tx_queuelen : tcp_Socket
  • tx_wscale : tcp_Socket

- u -

  • unhappy : tcp_Socket
  • unused : HEADER
  • used : _raw_Socket

- v -

  • vj_last : tcp_Socket
  • vj_sa : tcp_Socket
  • vj_sd : tcp_Socket

- w -

  • window : tcp_Socket
  • wwindow : tcp_Socket

- y -

  • yy_bs_column : yy_buffer_state
  • yy_bs_lineno : yy_buffer_state


Watt-32 tcp/ip: File List

  • File List
  • Globals
File List
Here is a list of all documented files with brief descriptions:
[detail level 1234]
▼ WATT |
► inc |
► arpa |
ftp.h |
inet.h |
nameser.h |
nameser_compat.h |
telnet.h |
tftp.h |
► net |
bpf.h |
bpfdesc.h |
ethertyp.h |
if.h |
if_arc.h |
if_arp.h |
if_atm.h |
if_dl.h |
if_ether.h |
if_fddi.h |
if_llc.h |
if_media.h |
if_packe.h |
if_packet.h |
if_ppp.h |
if_pppva.h |
if_slvar.h |
if_strip.h |
if_tun.h |
if_types.h |
netisr.h |
pfil.h |
pfkeyv2.h |
ppp-comp.h |
ppp_defs.h |
radix.h |
raw_cb.h |
route.h |
slcompre.h |
slip.h |
► netinet |
icmp6.h |
icmp_var.h |
if_ether.h |
if_fddi.h |
igmp.h |
igmp_var.h |
in.h |
in_pcb.h |
in_systm.h |
in_var.h |
ip.h |
ip6.h |
ip_fw.h |
ip_icmp.h |
ip_mrout.h |
ip_var.h |
ipv6.h |
tcp.h |
tcp_debu.h |
tcp_fsm.h |
tcp_scor.h |
tcp_seq.h |
tcp_time.h |
tcp_var.h |
tcpip.h |
udp.h |
udp_var.h |
► netinet6 |
ah.h |
ah6.h |
esp.h |
esp6.h |
esp_rijn.h |
in6.h |
in6_gif.h |
in6_ifat.h |
in6_pcb.h |
in6_pref.h |
in6_var.h |
ip6_ecn.h |
ip6_fw.h |
ip6_mrou.h |
ip6_var.h |
ip6proto.h |
ipcomp.h |
ipcomp6.h |
ipsec.h |
ipsec6.h |
mld6_var.h |
nd6.h |
pim6.h |
pim6_var.h |
raw_ip6.h |
scope6_v.h |
tcp6_var.h |
udp6_var.h |
► protocol |
dumprest.h |
routed.h |
rwhod.h |
talkd.h |
timed.h |
► rpc |
auth.h |
auth_des.h |
auth_uni.h |
clnt.h |
key_prot.h |
pmap_cln.h |
pmap_pro.h |
pmap_rmt.h |
rpc.h |
rpc_msg.h |
svc.h |
svc_auth.h |
types.h |
xdr.h |
► rpcsvc |
yp_prot.h |
ypclnt.h |
► sys |
cdefs.h |
errno.h |
ioctl.h |
mbuf.h |
pack_off.h |
pack_on.h |
param.h |
poll.h |
queue.h |
select.h |
so_ioctl.h |
socket.h |
swap.h |
syslog.h |
uio.h |
un.h |
w32api.h |
werrno.h |
whide.h |
wtime.h |
wtypes.h |
► w32-fakes |
winsock.h |
winsock2.h |
ws2tcpip.h |
check_hdr.c |
err.h |
netdb.h |
poll.h |
resolv.h |
syslog.h |
tcp.h | Watt-32 public API
► src |
accept.c |
asmpkt.h |
bind.c |
bsddbug.c |
bsddbug.h |
bsdname.c |
bsdname.h |
btrace.h |
chksum.c |
chksum.h |
close.c |
config.h |
connect.c |
copyrigh.h |
country.c |
cpuid.c |
cpumodel.h |
crc.c |
crit.c |
dynip.c |
dynip.h |
echo.c |
echo.h |
enum_cp.c |
fcntl.c |
fsext.c |
gcc-cdecl.c |
get_ai.c |
get_ip.c |
get_ni.c |
get_xby.h |
geteth.c |
gethost.c |
gethost6.c |
getname.c |
getnet.c |
getopt.c |
getprot.c |
getput.c |
getserv.c |
gettod.c |
gettod.h |
hc_test.c |
hello.c |
highc.c |
idna.c |
idna.h |
ioctl.c |
ioport.h |
ip4_frag.c |
ip4_frag.h |
ip4_in.c |
ip4_in.h |
ip4_out.c |
ip4_out.h |
ip6_in.c |
ip6_in.h |
ip6_out.c |
ip6_out.h |
ip_info.c |
lang.c |
language.c |
language.h |
linkaddr.c |
listen.c |
lookup.c |
loopback.c |
loopback.h |
misc.c |
misc.h |
misc_str.c |
misc_str.h |
netaddr.c |
netaddr.h |
netback.c |
neterr.c |
nettime.c |
nochkstk.h |
nsapaddr.c |
oldstuff.c |
oui-generated.c |
packet32.c |
packet32.h |
pc_cbrk.c |
pcarp.c |
pcarp.h |
pcbootp.c |
pcbootp.h |
pcbuf.c |
pcbuf.h |
pcconfig.c |
pcconfig.h |
pcdbug.c |
pcdbug.h |
pcdhcp.c |
pcdhcp.h |
pcdns.c |
pcdns.h |
pcicmp.c |
pcicmp.h |
pcicmp6.c |
pcicmp6.h |
pcigmp.c |
pcigmp.h |
pcintr.c |
pcping.c |
pcpkt.c |
pcpkt.h |
pcpkt32.c |
pcpkt32.h |
pcqueue.c |
pcqueue.h |
pcrarp.c |
pcrarp.h |
pcrecv.c |
pcrecv.h |
pcsarp.c |
pcsarp.h |
pcsed.c |
pcsed.h |
pcslip.h |
pcstat.c |
pcstat.h |
pctcp.c |
pctcp.h |
ports.c |
powerpak.c |
powerpak.h |
ppp.c |
ppp.h |
pppoe.c |
pppoe.h |
presaddr.c |
printk.c |
printk.h |
profile.c |
profile.h |
punycode.c |
punycode.h |
qmsg.c |
receive.c |
register.h |
res_comp.c |
res_data.c |
res_debu.c |
res_init.c |
res_loc.c |
res_mkqu.c |
res_quer.c |
res_send.c |
resolver.h |
run.c |
run.h |
sctp.h |
select.c |
settod.c |
settod.h |
shutdown.c |
signal.c |
sock_dbu.c |
sock_in.c |
sock_ini.c |
sock_ini.h |
sock_io.c |
sock_prn.c |
sock_scn.c |
sock_sel.c |
socket.c |
socket.h |
sockopt.c |
split.c |
split.h |
stkwalk.h |
stream.c |
swsvpkt.c |
swsvpkt.h |
syslog.c |
syslog2.c |
syslog2.h |
target.h |
tcp_fsm.c |
tcp_md5.c |
teredo64.c |
teredo64.h |
tftp.c |
tftp.h |
timer.c |
timer.h |
transmit.c |
tst.c |
UBSAN-issue.c |
udp_rev.c |
version.c |
w32_ndis.h |
wattcp.c |
wattcp.h | Core definitions
wdpmi.c |
wdpmi.h |
win_dll.c |
win_dll.h |
winadinf.c |
winadinf.h |
winmisc.c |
winpkt.c |
winpkt.h |
x32vm.c |
x32vm.h |
zadler32.c |
zcompres.c |
zconf.h |
zcrc32.c |
zcrc32.h |
zdeflate.c |
zdeflate.h |
zgzio.c |
zinfback.c |
zinffast.c |
zinffast.h |
zinffix.h |
zinflate.c |
zinflate.h |
zinftree.c |
zinftree.h |
zlib.h |
ztrees.c |
ztrees.h |
zuncompr.c |
zutil.c |
zutil.h |


Watt-32 tcp/ip: E:/WATT Directory Reference

  • WATT
WATT Directory Reference

Directories

directory | inc
directory | src


Watt-32 tcp/ip: E:/WATT/inc Directory Reference

  • inc
inc Directory Reference
Directory dependency graph for inc:

Directories

directory | arpa
directory | net
directory | netinet
directory | netinet6
directory | protocol
directory | rpc
directory | rpcsvc
directory | sys
directory | w32-fakes

Files

file | check_hdr.c [code]
file | err.h [code]
file | netdb.h [code]
file | poll.h [code]
file | resolv.h [code]
file | syslog.h [code]
file | tcp.h [code]
Watt-32 public API.


Watt-32 tcp/ip: E:/WATT/inc/arpa Directory Reference

  • inc
  • arpa
arpa Directory Reference
Directory dependency graph for arpa:

Files

file | ftp.h [code]
file | inet.h [code]
file | nameser.h [code]
file | nameser_compat.h [code]
file | telnet.h [code]
file | tftp.h [code]


Watt-32 tcp/ip: E:/WATT/inc/arpa/ftp.h File Reference

  • inc
  • arpa
Variables
ftp.h File Reference

Go to the source code of this file.

Variables

const char * | typenames [] = {"0", "ASCII", "EBCDIC", "Image", "Local" }
const char * | formnames [] = {"0", "Nonprint", "Telnet", "Carriage-control" }
const char * | strunames [] = {"0", "File", "Record", "Page" }
const char * | modenames [] = {"0", "Stream", "Block", "Compressed" }
const char * | levelnames [] = {"0", "Clear", "Safe", "Private", "Confidential" }

Detailed Description

FTP definitions.

Definition in file ftp.h.

Variable Documentation

◆ formnames

const char* formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" }

Definition at line 72 of file ftp.h.

◆ levelnames

const char* levelnames[] = {"0", "Clear", "Safe", "Private", "Confidential" }

Definition at line 104 of file ftp.h.

◆ modenames

const char* modenames[] = {"0", "Stream", "Block", "Compressed" }

Definition at line 92 of file ftp.h.

◆ strunames

const char* strunames[] = {"0", "File", "Record", "Page" }

Definition at line 82 of file ftp.h.

◆ typenames

const char* typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" }

Definition at line 62 of file ftp.h.


Watt-32 tcp/ip: E:/WATT/inc/arpa/inet.h File Reference

  • inc
  • arpa
Functions
inet.h File Reference

Go to the source code of this file.

Functions

__BEGIN_DECLS W32_FUNC int W32_CALL | ascii2addr (int, const char *, void *)
W32_FUNC char *W32_CALL | addr2ascii (int, const void *, int, char *)
W32_FUNC struct in_addr W32_CALL | inet_makeaddr (u_long, u_long)
Formulate an Internet address from network + host (with subnet address).
W32_FUNC u_long W32_CALL | inet_addr (const char *)
W32_FUNC u_long W32_CALL | inet_lnaof (struct in_addr)
Return the local network address portion of an internet address; handles class A/B/C network number formats only.
W32_FUNC u_long W32_CALL | inet_netof (struct in_addr)
Return the network number from an internet address; handles class A/B/C network #'s.
W32_FUNC u_long W32_CALL | inet_network (const char *)
W32_FUNC int W32_CALL | inet_aton (const char *s, struct in_addr *adr)
W32_FUNC char *W32_CALL | inet_ntoa (struct in_addr)
W32_FUNC char *W32_CALL | inet_ntoa_r (struct in_addr adr, char *buf, int buflen)
W32_FUNC char *W32_CALL | inet_nsap_ntoa (int binlen, const u_char *binary, char *ascii)
W32_FUNC u_int W32_CALL | inet_nsap_addr (const char *ascii, u_char *binary, int maxlen)
W32_FUNC const char *W32_CALL | inet_ntop (int af, const void *src, char *dst, size_t size)
Convert a network format address to presentation format.
W32_FUNC int W32_CALL | inet_pton (int af, const char *src, void *dst)
Convert from presentation format (which usually means ASCII printable) to network format (which is usually some kind of binary format).

Detailed Description

Address conversions.

Definition in file inet.h.

Function Documentation

◆ addr2ascii()

W32_FUNC char *W32_CALL addr2ascii | ( | int | af,
 |  | const void * | addrp,
 |  | int | len,
 |  | char * | buf
 | ) |  |

Definition at line 480 of file netaddr.c.

◆ ascii2addr()

__BEGIN_DECLS W32_FUNC int W32_CALL ascii2addr | ( | int | af,
 |  | const char * | ascii,
 |  | void * | result
 | ) |  |

Definition at line 431 of file netaddr.c.

◆ inet_addr()

W32_FUNC u_long W32_CALL inet_addr ( const char * addr )

Definition at line 264 of file netaddr.c.

◆ inet_aton()

W32_FUNC int W32_CALL inet_aton | ( | const char * | s,
 |  | struct in_addr * | adr
 | ) |  |

Definition at line 254 of file netaddr.c.

◆ inet_lnaof()

W32_FUNC u_long W32_CALL inet_lnaof ( struct in_addr addr )

Return the local network address portion of an internet address; handles class A/B/C network number formats only.

Note
return value is host-order.

Definition at line 360 of file netaddr.c.

◆ inet_makeaddr()

W32_FUNC struct in_addr W32_CALL inet_makeaddr | ( | u_long | net,
 |  | u_long | host
 | ) |  |

Formulate an Internet address from network + host (with subnet address).

Note
'net' is on host-order.

Definition at line 377 of file netaddr.c.

◆ inet_netof()

W32_FUNC u_long W32_CALL inet_netof ( struct in_addr addr )

Return the network number from an internet address; handles class A/B/C network #'s.

Definition at line 341 of file netaddr.c.

◆ inet_network()

W32_FUNC u_long W32_CALL inet_network ( const char * name )

Definition at line 273 of file netaddr.c.

◆ inet_nsap_addr()

W32_FUNC u_int W32_CALL inet_nsap_addr | ( | const char * | ascii,
 |  | u_char * | binary,
 |  | int | maxlen
 | ) |  |

Definition at line 30 of file nsapaddr.c.

◆ inet_nsap_ntoa()

W32_FUNC char *W32_CALL inet_nsap_ntoa | ( | int | binlen,
 |  | const u_char * | binary,
 |  | char * | ascii
 | ) |  |

Definition at line 58 of file nsapaddr.c.

◆ inet_ntoa()

W32_FUNC char *W32_CALL inet_ntoa ( struct in_addr addr )

Definition at line 185 of file netaddr.c.

◆ inet_ntoa_r()

W32_FUNC char *W32_CALL inet_ntoa_r | ( | struct in_addr | adr,
 |  | char * | buf,
 |  | int | buflen
 | ) |  |

Definition at line 247 of file netaddr.c.

◆ inet_ntop()

W32_FUNC const char *W32_CALL inet_ntop | ( | int | af,
 |  | const void * | src,
 |  | char * | dst,
 |  | size_t | size
 | ) |  |

Convert a network format address to presentation format.

Return values
pointer | to presentation format address (‘dst’),
NULL | on error (see errno).
Author
Paul Vixie, 1996.

Definition at line 43 of file presaddr.c.

References inet_ntop4(), and inet_ntop6().

◆ inet_pton()

W32_FUNC int W32_CALL inet_pton | ( | int | af,
 |  | const char * | src,
 |  | void * | dst
 | ) |  |

Convert from presentation format (which usually means ASCII printable) to network format (which is usually some kind of binary format).

Return values
1 | the address was valid for the specified address family.
0 | the address wasn't valid (‘dst’ is untouched in this case).
-1 | some other error occurred (‘dst’ is untouched in this case, too).
Author
Paul Vixie, 1996.

Definition at line 73 of file presaddr.c.

References inet_pton4(), and inet_pton6().


Watt-32 tcp/ip: E:/WATT/inc/arpa/nameser.h File Reference

  • inc
  • arpa
Data Structures | Functions | Variables
nameser.h File Reference

Go to the source code of this file.

Data Structures

struct rrec

Functions

W32_CLANG_PACK_WARN_OFF () typedef struct
W32_CLANG_PACK_WARN_DEF () __BEGIN_DECLS W32_FUNC u_short W32_CALL _getshort(const u_char *)
W32_FUNC u_long W32_CALL _getlong (const u_char *)

Variables

HEADER

Detailed Description

Nameserver API.

Definition in file nameser.h.

Function Documentation

◆ _getlong()

W32_FUNC u_long W32_CALL _getlong ( const u_char * x )

Definition at line 87 of file getput.c.

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 226 of file nameser.h.

Variable Documentation

◆ HEADER

HEADER

Definition at line 259 of file nameser.h.


Watt-32 tcp/ip: E:/WATT/inc/arpa/nameser_compat.h Source File

  • inc
  • arpa
nameser_compat.h
1/* Copyright (c) 1983, 1989
2 * The Regents of the University of California. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 4. Neither the name of the University nor the names of its contributors
13 * may be used to endorse or promote products derived from this software
14 * without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29/*%
30 * from nameser.h 8.1 (Berkeley) 6/2/93
31 * $BINDId: nameser_compat.h,v 8.11 1999/01/02 08:00:58 vixie Exp $
32 */
33
34#ifndef _ARPA_NAMESER_COMPAT_H_
35#define _ARPA_NAMESER_COMPAT_H_
36
37#ifndef __SYS_SOCKET_H
38#include <sys/socket.h>
39#endif
40
41#define __BIND 19950621
43/*%
44 * Structure for query header. The order of the fields is machine- and
45 * compiler-dependent, depending on the byte/bit order and the layout
46 * of bit fields. We use bit fields only in int variables, as this
47 * is all ANSI requires. This requires a somewhat confusing rearrangement.
48 */
49
50typedef struct {
51 unsigned id :16;
52#if BYTE_ORDER == BIG_ENDIAN
53 /* fields in third byte */
54 unsigned qr: 1;
55 unsigned opcode: 4;
56 unsigned aa: 1;
57 unsigned tc: 1;
58 unsigned rd: 1;
59 /* fields in fourth byte */
60 unsigned ra: 1;
61 unsigned unused :1;
62 unsigned ad: 1;
63 unsigned cd: 1;
64 unsigned rcode :4;
65#endif
66#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
67 /* fields in third byte */
68 unsigned rd :1;
69 unsigned tc :1;
70 unsigned aa :1;
71 unsigned opcode :4;
72 unsigned qr :1;
73 /* fields in fourth byte */
74 unsigned rcode :4;
75 unsigned cd: 1;
76 unsigned ad: 1;
77 unsigned unused :1;
78 unsigned ra :1;
79#endif
80 /* remaining bytes */
81 unsigned qdcount :16;
82 unsigned ancount :16;
83 unsigned nscount :16;
84 unsigned arcount :16;
85} HEADER;
86
87#define PACKETSZ NS_PACKETSZ
88#define MAXDNAME NS_MAXDNAME
89#define MAXCDNAME NS_MAXCDNAME
90#define MAXLABEL NS_MAXLABEL
91#define HFIXEDSZ NS_HFIXEDSZ
92#define QFIXEDSZ NS_QFIXEDSZ
93#define RRFIXEDSZ NS_RRFIXEDSZ
94#define INT32SZ NS_INT32SZ
95#define INT16SZ NS_INT16SZ
96#define INT8SZ NS_INT8SZ
97#define INADDRSZ NS_INADDRSZ
98#define IN6ADDRSZ NS_IN6ADDRSZ
99#define INDIR_MASK NS_CMPRSFLGS
100#define NAMESERVER_PORT NS_DEFAULTPORT
101
102#define S_ZONE ns_s_zn
103#define S_PREREQ ns_s_pr
104#define S_UPDATE ns_s_ud
105#define S_ADDT ns_s_ar
106
107#define QUERY ns_o_query
108#define IQUERY ns_o_iquery
109#define STATUS ns_o_status
110#define NS_NOTIFY_OP ns_o_notify
111#define NS_UPDATE_OP ns_o_update
112
113#undef NOERROR
114#define NOERROR ns_r_noerror
115#define FORMERR ns_r_formerr
116#define SERVFAIL ns_r_servfail
117#define NXDOMAIN ns_r_nxdomain
118#define NOTIMP ns_r_notimpl
119#define REFUSED ns_r_refused
120#define YXDOMAIN ns_r_yxdomain
121#define YXRRSET ns_r_yxrrset
122#define NXRRSET ns_r_nxrrset
123#define NOTAUTH ns_r_notauth
124#define NOTZONE ns_r_notzone
125/*#define BADSIG ns_r_badsig */
126/*#define BADKEY ns_r_badkey */
127/*#define BADTIME ns_r_badtime */
128
129#undef DELETE
130#define DELETE ns_uop_delete
131#define ADD ns_uop_add
132
133#define T_A ns_t_a
134#define T_NS ns_t_ns
135#define T_MD ns_t_md
136#define T_MF ns_t_mf
137#define T_CNAME ns_t_cname
138#define T_SOA ns_t_soa
139#define T_MB ns_t_mb
140#define T_MG ns_t_mg
141#define T_MR ns_t_mr
142#define T_NULL ns_t_null
143#define T_WKS ns_t_wks
144#define T_PTR ns_t_ptr
145#define T_HINFO ns_t_hinfo
146#define T_MINFO ns_t_minfo
147#define T_MX ns_t_mx
148#define T_TXT ns_t_txt
149#define T_RP ns_t_rp
150#define T_AFSDB ns_t_afsdb
151#define T_X25 ns_t_x25
152#define T_ISDN ns_t_isdn
153#define T_RT ns_t_rt
154#define T_NSAP ns_t_nsap
155#define T_NSAP_PTR ns_t_nsap_ptr
156#define T_SIG ns_t_sig
157#define T_KEY ns_t_key
158#define T_PX ns_t_px
159#define T_GPOS ns_t_gpos
160#define T_AAAA ns_t_aaaa
161#define T_LOC ns_t_loc
162#define T_NXT ns_t_nxt
163#define T_EID ns_t_eid
164#define T_NIMLOC ns_t_nimloc
165#define T_SRV ns_t_srv
166#define T_ATMA ns_t_atma
167#define T_NAPTR ns_t_naptr
168#define T_A6 ns_t_a6
169#define T_DNAME ns_t_dname
170#define T_TSIG ns_t_tsig
171#define T_IXFR ns_t_ixfr
172#define T_AXFR ns_t_axfr
173#define T_MAILB ns_t_mailb
174#define T_MAILA ns_t_maila
175#define T_ANY ns_t_any
176
177#define C_IN ns_c_in
178#define C_CHAOS ns_c_chaos
179#define C_HS ns_c_hs
180
181/* BIND_UPDATE */
182#define C_NONE ns_c_none
183#define C_ANY ns_c_any
184
185#define GETSHORT NS_GET16
186#define GETLONG NS_GET32
187#define PUTSHORT NS_PUT16
188#define PUTLONG NS_PUT32
189
190#endif /* _ARPA_NAMESER_COMPAT_H_ */
191
socket.h
HEADER
Definition: nameser_compat.h:50
HEADER::rd
unsigned rd
recursion desired
Definition: nameser_compat.h:58
HEADER::nscount
unsigned nscount
number of authority entries
Definition: nameser_compat.h:83
HEADER::qdcount
unsigned qdcount
number of question entries
Definition: nameser_compat.h:81
HEADER::ad
unsigned ad
authentic data from named
Definition: nameser_compat.h:62
HEADER::unused
unsigned unused
unused bits (MBZ as of 4.9.3a3)
Definition: nameser_compat.h:61
HEADER::opcode
unsigned opcode
purpose of message
Definition: nameser_compat.h:55
HEADER::rcode
unsigned rcode
response code
Definition: nameser_compat.h:64
HEADER::arcount
unsigned arcount
number of resource entries
Definition: nameser_compat.h:84
HEADER::ancount
unsigned ancount
number of answer entries
Definition: nameser_compat.h:82
HEADER::tc
unsigned tc
truncated message
Definition: nameser_compat.h:57
HEADER::ra
unsigned ra
recursion available
Definition: nameser_compat.h:60
HEADER::aa
unsigned aa
authoritive answer
Definition: nameser_compat.h:56
HEADER::qr
unsigned qr
response flag
Definition: nameser_compat.h:54
HEADER::id
unsigned id
query identification number
Definition: nameser_compat.h:51
HEADER::cd
unsigned cd
checking disabled by resolver
Definition: nameser_compat.h:63


Watt-32 tcp/ip: E:/WATT/inc/arpa/telnet.h File Reference

  • inc
  • arpa
Variables
telnet.h File Reference

Go to the source code of this file.

Variables

const char * | telcmds []
const char * | telopts [NTELOPTS+1]
const char * | slc_names [] = { SLC_NAMELIST }
const char * | authtype_names []
const char * | encrypt_names []
const char * | enctype_names []

Detailed Description

Telnet definitions.

Definition in file telnet.h.

Variable Documentation

◆ authtype_names

W32_DATA const char * authtype_names
Initial value:
= {
"NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", "SRP", 0
}

Definition at line 289 of file telnet.h.

◆ encrypt_names

W32_DATA const char * encrypt_names
Initial value:
= {
"IS", "SUPPORT", "REPLY", "START", "END",
"REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
0
}

Definition at line 323 of file telnet.h.

◆ enctype_names

W32_DATA const char * enctype_names
Initial value:
= {
"ANY", "DES_CFB64", "DES_OFB64", "UNKNOWN", "UNKNOWN", "UNKNOWN",
"UNKNOWN", "UNKNOWN", "CAST5_40_CFB64", "CAST5_40_OFB64",
"CAST128_CFB64", "CAST128_OFB64", 0,
}

Definition at line 328 of file telnet.h.

◆ slc_names

W32_DATA const char * slc_names = { SLC_NAMELIST }

Definition at line 232 of file telnet.h.

◆ telcmds

W32_DATA const char * telcmds
Initial value:
= {
"EOF", "SUSP", "ABORT", "EOR",
"SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
"EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0
}

Definition at line 72 of file telnet.h.

◆ telopts

const char* telopts[NTELOPTS+1]
Initial value:
= {
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
"NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
"NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
"DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
"SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
"TACACS UID", "OUTPUT MARKING", "TTYLOC",
"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
"ENCRYPT", "NEW-ENVIRON", 0
}

Definition at line 134 of file telnet.h.


Watt-32 tcp/ip: E:/WATT/inc/arpa/tftp.h File Reference

  • inc
  • arpa
Functions
tftp.h File Reference

Go to the source code of this file.

Functions

W32_CLANG_PACK_WARN_OFF () struct tftphdr

Detailed Description

TFTP definitions.

Definition in file tftp.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 59 of file tftp.h.


Watt-32 tcp/ip: E:/WATT/inc/net Directory Reference

  • inc
  • net
net Directory Reference
Directory dependency graph for net:

Files

file | bpf.h [code]
file | bpfdesc.h [code]
file | ethertyp.h [code]
file | if.h [code]
file | if_arc.h [code]
file | if_arp.h [code]
file | if_atm.h [code]
file | if_dl.h [code]
file | if_ether.h [code]
file | if_fddi.h [code]
file | if_llc.h [code]
file | if_media.h [code]
file | if_packe.h [code]
file | if_packet.h [code]
file | if_ppp.h [code]
file | if_pppva.h [code]
file | if_slvar.h [code]
file | if_strip.h [code]
file | if_tun.h [code]
file | if_types.h [code]
file | netisr.h [code]
file | pfil.h [code]
file | pfkeyv2.h [code]
file | ppp-comp.h [code]
file | ppp_defs.h [code]
file | radix.h [code]
file | raw_cb.h [code]
file | route.h [code]
file | slcompre.h [code]
file | slip.h [code]


Watt-32 tcp/ip: E:/WATT/inc/net/bpf.h File Reference

  • inc
  • net
Data Structures | Typedefs | Functions
bpf.h File Reference

Go to the source code of this file.

Data Structures

struct | bpf_program
struct | bpf_stat
struct | bpf_version
struct | bpf_hdr
Berkeley Packet Filter header. More...
struct | bpf_insn

Typedefs

typedef long | bpf_int32
typedef u_int32_t | bpf_u_int32

Functions

u_int bpf_filter (struct bpf_insn *, u_char *, u_int, u_int)

Detailed Description

Berkeley Packet Filter.

Definition in file bpf.h.

Typedef Documentation

◆ bpf_int32

typedef long bpf_int32

Definition at line 56 of file bpf.h.

◆ bpf_u_int32

typedef u_int32_t bpf_u_int32

Definition at line 57 of file bpf.h.


Watt-32 tcp/ip: E:/WATT/inc/net/bpfdesc.h File Reference

  • inc
  • net
Data Structures
bpfdesc.h File Reference

Go to the source code of this file.

Data Structures

struct | bpf_d
struct | bpf_if

Detailed Description

Berkeley Packet Filter definitions.

Definition in file bpfdesc.h.


Watt-32 tcp/ip: E:/WATT/inc/net/ethertyp.h File Reference

  • inc
  • net
ethertyp.h File Reference

Go to the source code of this file.

Detailed Description

Ethernet protocol types.

Definition in file ethertyp.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if.h File Reference

  • inc
  • net
Data Structures | Functions
if.h File Reference

Go to the source code of this file.

Data Structures

struct | proc
struct | socket
struct | if_data
struct | ifqueue
struct | ifnet
struct | ifaddr
struct | if_msghdr
struct | ifa_msghdr
struct | ifreq
struct | ifaliasreq
struct | ifmediareq
struct | ifconf

Functions

TAILQ_HEAD (ifnet_head, ifnet)

Detailed Description

Network interface data.

Definition in file if.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_arc.h File Reference

  • inc
  • net
Data Structures | Functions
if_arc.h File Reference

Go to the source code of this file.

Data Structures

struct | arc_header
struct | arccom
struct | arccom::ac_frag

Functions

W32_CLANG_PACK_WARN_OFF () struct arc_addr

Detailed Description

ARC-net definitions.

Definition in file if_arc.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 48 of file if_arc.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_arp.h File Reference

  • inc
  • net
Data Structures | Functions
if_arp.h File Reference

Go to the source code of this file.

Data Structures

struct arpreq

Functions

W32_CLANG_PACK_WARN_OFF () struct arphdr

Detailed Description

ARP definitions.

Definition in file if_arp.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 54 of file if_arp.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_atm.h File Reference

  • inc
  • net
Data Structures | Functions
if_atm.h File Reference

Go to the source code of this file.

Data Structures

struct | atm_pseudoioctl
struct | atmllc

Functions

W32_CLANG_PACK_WARN_OFF () struct atm_pseudohdr

Detailed Description

ATM definitions.

Definition in file if_atm.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 47 of file if_atm.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_dl.h File Reference

  • inc
  • net
Data Structures | Functions
if_dl.h File Reference

Go to the source code of this file.

Data Structures

struct sockaddr_dl

Functions

__BEGIN_DECLS W32_FUNC void W32_CALL | link_addr (const char *, struct sockaddr_dl *)
W32_FUNC char *W32_CALL | link_ntoa (const struct sockaddr_dl *)

Detailed Description

Link-level sockaddr_dl definition.

Definition in file if_dl.h.

Function Documentation

◆ link_addr()

__BEGIN_DECLS W32_FUNC void W32_CALL link_addr | ( | const char * | addr,
 |  | struct sockaddr_dl * | sdl
 | ) |  |

Definition at line 57 of file linkaddr.c.

◆ link_ntoa()

W32_FUNC char *W32_CALL link_ntoa ( const struct sockaddr_dl * sdl )

Definition at line 135 of file linkaddr.c.


Watt-32 tcp/ip: E:/WATT/inc/net/if_ether.h Source File

  • inc
  • net
if_ether.h
1
4#include <netinet/if_ether.h>
5
if_ether.h


Watt-32 tcp/ip: E:/WATT/inc/net/if_fddi.h File Reference

  • inc
  • net
if_fddi.h File Reference

Go to the source code of this file.

Detailed Description

Compatability header.

Definition in file if_fddi.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_llc.h File Reference

  • inc
  • net
Data Structures | Functions
if_llc.h File Reference

Go to the source code of this file.

Data Structures

struct frmrinfo

Functions

W32_CLANG_PACK_WARN_OFF () struct llc

Detailed Description

IEEE 802.2 Link Level Control.

Definition in file if_llc.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 51 of file if_llc.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_media.h File Reference

  • inc
  • net
Data Structures
if_media.h File Reference

Go to the source code of this file.

Data Structures

struct ifmedia_description

Detailed Description

Network interface media selection.

Definition in file if_media.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_packe.h File Reference

  • inc
  • net
Data Structures
if_packe.h File Reference

Go to the source code of this file.

Data Structures

struct | sockaddr_pkt
struct | sockaddr_ll
struct | tpacket_stats
struct | tpacket_hdr
struct | tpacket_req
struct | packet_mreq

Detailed Description

Linux compatability header.

Definition in file if_packe.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_packet.h File Reference

  • inc
  • net
if_packet.h File Reference

Go to the source code of this file.


Watt-32 tcp/ip: E:/WATT/inc/net/if_ppp.h File Reference

  • inc
  • net
Data Structures
if_ppp.h File Reference

Go to the source code of this file.

Data Structures

struct | npioctl
struct | ppp_option_data
struct | ifpppstatsreq
struct | ifpppcstatsreq

Detailed Description

PPP definitions.

Definition in file if_ppp.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_pppva.h File Reference

  • inc
  • net
Data Structures
if_pppva.h File Reference

Go to the source code of this file.

Data Structures

struct ppp_softc

Detailed Description

PPP structures and declarations.

Definition in file if_pppva.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_slvar.h File Reference

  • inc
  • net
Data Structures
if_slvar.h File Reference

Go to the source code of this file.

Data Structures

struct sl_softc

Detailed Description

SLIP interface structures.

Definition in file if_slvar.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_strip.h File Reference

  • inc
  • net
Data Structures
if_strip.h File Reference

Go to the source code of this file.

Data Structures

struct strip_softc

Detailed Description

SLIP interface structures.

Definition in file if_strip.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_tun.h File Reference

  • inc
  • net
Data Structures
if_tun.h File Reference

Go to the source code of this file.

Data Structures

struct tun_softc

Detailed Description

Interface tunneling.

Definition in file if_tun.h.


Watt-32 tcp/ip: E:/WATT/inc/net/if_types.h File Reference

  • inc
  • net
if_types.h File Reference

Go to the source code of this file.

Detailed Description

Network interface types.

Definition in file if_types.h.


Watt-32 tcp/ip: E:/WATT/inc/net/netisr.h File Reference

  • inc
  • net
Variables
netisr.h File Reference

Go to the source code of this file.

Variables

int netisr


Watt-32 tcp/ip: E:/WATT/inc/net/pfil.h File Reference

  • inc
  • net
pfil.h File Reference

Go to the source code of this file.


Watt-32 tcp/ip: E:/WATT/inc/net/pfkeyv2.h Source File

  • inc
  • net
pfkeyv2.h
1/* $FreeBSD: src/sys/net/pfkeyv2.h,v 1.7 2001/08/06 19:39:59 ume Exp $ */
2/* $KAME: pfkeyv2.h,v 1.26 2001/06/27 10:49:49 sakane Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * This file has been derived rfc 2367,
35 * And added some flags of SADB_KEY_FLAGS_ as SADB_X_EXT_.
36 * sakane@ydc.co.jp
37 */
38
39#ifndef _NET_PFKEYV2_H_
40#define _NET_PFKEYV2_H_
41
42#include <sys/wtypes.h>
43
44/*
45This file defines structures and symbols for the PF_KEY Version 2
46key management interface. It was written at the U.S. Naval Research
47Laboratory. This file is in the public domain. The authors ask that
48you leave this credit intact on any copies of this file.
49*/
50#ifndef __PFKEY_V2_H
51#define __PFKEY_V2_H 1
52
53#define PF_KEY_V2 2
54#define PFKEYV2_REVISION 199806L
55
56#define SADB_RESERVED 0
57#define SADB_GETSPI 1
58#define SADB_UPDATE 2
59#define SADB_ADD 3
60#define SADB_DELETE 4
61#define SADB_GET 5
62#define SADB_ACQUIRE 6
63#define SADB_REGISTER 7
64#define SADB_EXPIRE 8
65#define SADB_FLUSH 9
66#define SADB_DUMP 10
67#define SADB_X_PROMISC 11
68#define SADB_X_PCHANGE 12
69
70#define SADB_X_SPDUPDATE 13
71#define SADB_X_SPDADD 14
72#define SADB_X_SPDDELETE 15 /* by policy index */
73#define SADB_X_SPDGET 16
74#define SADB_X_SPDACQUIRE 17
75#define SADB_X_SPDDUMP 18
76#define SADB_X_SPDFLUSH 19
77#define SADB_X_SPDSETIDX 20
78#define SADB_X_SPDEXPIRE 21
79#define SADB_X_SPDDELETE2 22 /* by policy id */
80#define SADB_MAX 22
81
82struct sadb_msg {
83 u_int8_t sadb_msg_version;
84 u_int8_t sadb_msg_type;
85 u_int8_t sadb_msg_errno;
86 u_int8_t sadb_msg_satype;
87 u_int16_t sadb_msg_len;
88 u_int16_t sadb_msg_reserved;
89 u_int32_t sadb_msg_seq;
90 u_int32_t sadb_msg_pid;
91};
92
93struct sadb_ext {
94 u_int16_t sadb_ext_len;
95 u_int16_t sadb_ext_type;
96};
97
98struct sadb_sa {
99 u_int16_t sadb_sa_len;
100 u_int16_t sadb_sa_exttype;
101 u_int32_t sadb_sa_spi;
102 u_int8_t sadb_sa_replay;
103 u_int8_t sadb_sa_state;
104 u_int8_t sadb_sa_auth;
105 u_int8_t sadb_sa_encrypt;
106 u_int32_t sadb_sa_flags;
107};
108
109struct sadb_lifetime {
110 u_int16_t sadb_lifetime_len;
111 u_int16_t sadb_lifetime_exttype;
112 u_int32_t sadb_lifetime_allocations;
113 u_int64_t sadb_lifetime_bytes;
114 u_int64_t sadb_lifetime_addtime;
115 u_int64_t sadb_lifetime_usetime;
116};
117
118struct sadb_address {
119 u_int16_t sadb_address_len;
120 u_int16_t sadb_address_exttype;
121 u_int8_t sadb_address_proto;
122 u_int8_t sadb_address_prefixlen;
123 u_int16_t sadb_address_reserved;
124};
125
126struct sadb_key {
127 u_int16_t sadb_key_len;
128 u_int16_t sadb_key_exttype;
129 u_int16_t sadb_key_bits;
130 u_int16_t sadb_key_reserved;
131};
132
133struct sadb_ident {
134 u_int16_t sadb_ident_len;
135 u_int16_t sadb_ident_exttype;
136 u_int16_t sadb_ident_type;
137 u_int16_t sadb_ident_reserved;
138 u_int64_t sadb_ident_id;
139};
140
141struct sadb_sens {
142 u_int16_t sadb_sens_len;
143 u_int16_t sadb_sens_exttype;
144 u_int32_t sadb_sens_dpd;
145 u_int8_t sadb_sens_sens_level;
146 u_int8_t sadb_sens_sens_len;
147 u_int8_t sadb_sens_integ_level;
148 u_int8_t sadb_sens_integ_len;
149 u_int32_t sadb_sens_reserved;
150};
151
152struct sadb_prop {
153 u_int16_t sadb_prop_len;
154 u_int16_t sadb_prop_exttype;
155 u_int8_t sadb_prop_replay;
156 u_int8_t sadb_prop_reserved[3];
157};
158
159struct sadb_comb {
160 u_int8_t sadb_comb_auth;
161 u_int8_t sadb_comb_encrypt;
162 u_int16_t sadb_comb_flags;
163 u_int16_t sadb_comb_auth_minbits;
164 u_int16_t sadb_comb_auth_maxbits;
165 u_int16_t sadb_comb_encrypt_minbits;
166 u_int16_t sadb_comb_encrypt_maxbits;
167 u_int32_t sadb_comb_reserved;
168 u_int32_t sadb_comb_soft_allocations;
169 u_int32_t sadb_comb_hard_allocations;
170 u_int64_t sadb_comb_soft_bytes;
171 u_int64_t sadb_comb_hard_bytes;
172 u_int64_t sadb_comb_soft_addtime;
173 u_int64_t sadb_comb_hard_addtime;
174 u_int64_t sadb_comb_soft_usetime;
175 u_int64_t sadb_comb_hard_usetime;
176};
177
178struct sadb_supported {
179 u_int16_t sadb_supported_len;
180 u_int16_t sadb_supported_exttype;
181 u_int32_t sadb_supported_reserved;
182};
183
184struct sadb_alg {
185 u_int8_t sadb_alg_id;
186 u_int8_t sadb_alg_ivlen;
187 u_int16_t sadb_alg_minbits;
188 u_int16_t sadb_alg_maxbits;
189 u_int16_t sadb_alg_reserved;
190};
191
192struct sadb_spirange {
193 u_int16_t sadb_spirange_len;
194 u_int16_t sadb_spirange_exttype;
195 u_int32_t sadb_spirange_min;
196 u_int32_t sadb_spirange_max;
197 u_int32_t sadb_spirange_reserved;
198};
199
200struct sadb_x_kmprivate {
201 u_int16_t sadb_x_kmprivate_len;
202 u_int16_t sadb_x_kmprivate_exttype;
203 u_int32_t sadb_x_kmprivate_reserved;
204};
205
206/*
207 * XXX Additional SA Extension.
208 * mode: tunnel or transport
209 * reqid: to make SA unique nevertheless the address pair of SA are same.
210 * Mainly it's for VPN.
211 */
212struct sadb_x_sa2 {
213 u_int16_t sadb_x_sa2_len;
214 u_int16_t sadb_x_sa2_exttype;
215 u_int8_t sadb_x_sa2_mode;
216 u_int8_t sadb_x_sa2_reserved1;
217 u_int16_t sadb_x_sa2_reserved2;
218 u_int32_t sadb_x_sa2_sequence;
219 u_int32_t sadb_x_sa2_reqid;
220};
221
222/* XXX Policy Extension */
223/* sizeof(struct sadb_x_policy) == 16 */
224struct sadb_x_policy {
225 u_int16_t sadb_x_policy_len;
226 u_int16_t sadb_x_policy_exttype;
227 u_int16_t sadb_x_policy_type; /* See policy type of ipsec.h */
228 u_int8_t sadb_x_policy_dir; /* direction, see ipsec.h */
229 u_int8_t sadb_x_policy_reserved;
230 u_int32_t sadb_x_policy_id;
231 u_int32_t sadb_x_policy_reserved2;
232};
233/*
234 * When policy_type == IPSEC, it is followed by some of
235 * the ipsec policy request.
236 * [total length of ipsec policy requests]
237 * = (sadb_x_policy_len * sizeof(uint64_t) - sizeof(struct sadb_x_policy))
238 */
239
240/* XXX IPsec Policy Request Extension */
241/*
242 * This structure is aligned 8 bytes.
243 */
244struct sadb_x_ipsecrequest {
245 u_int16_t sadb_x_ipsecrequest_len; /* structure length aligned to 8 bytes.
246 * This value is true length of bytes.
247 * Not in units of 64 bits. */
248 u_int16_t sadb_x_ipsecrequest_proto; /* See ipsec.h */
249 u_int8_t sadb_x_ipsecrequest_mode; /* See IPSEC_MODE_XX in ipsec.h. */
250 u_int8_t sadb_x_ipsecrequest_level; /* See IPSEC_LEVEL_XX in ipsec.h */
251 u_int16_t sadb_x_ipsecrequest_reqid; /* See ipsec.h */
252
253 /*
254 * followed by source IP address of SA, and immediately followed by
255 * destination IP address of SA. These encoded into two of sockaddr
256 * structure without any padding. Must set each sa_len exactly.
257 * Each of length of the sockaddr structure are not aligned to 64bits,
258 * but sum of x_request and addresses is aligned to 64bits.
259 */
260};
261
262#define SADB_EXT_RESERVED 0
263#define SADB_EXT_SA 1
264#define SADB_EXT_LIFETIME_CURRENT 2
265#define SADB_EXT_LIFETIME_HARD 3
266#define SADB_EXT_LIFETIME_SOFT 4
267#define SADB_EXT_ADDRESS_SRC 5
268#define SADB_EXT_ADDRESS_DST 6
269#define SADB_EXT_ADDRESS_PROXY 7
270#define SADB_EXT_KEY_AUTH 8
271#define SADB_EXT_KEY_ENCRYPT 9
272#define SADB_EXT_IDENTITY_SRC 10
273#define SADB_EXT_IDENTITY_DST 11
274#define SADB_EXT_SENSITIVITY 12
275#define SADB_EXT_PROPOSAL 13
276#define SADB_EXT_SUPPORTED_AUTH 14
277#define SADB_EXT_SUPPORTED_ENCRYPT 15
278#define SADB_EXT_SPIRANGE 16
279#define SADB_X_EXT_KMPRIVATE 17
280#define SADB_X_EXT_POLICY 18
281#define SADB_X_EXT_SA2 19
282#define SADB_EXT_MAX 19
283
284#define SADB_SATYPE_UNSPEC 0
285#define SADB_SATYPE_AH 2
286#define SADB_SATYPE_ESP 3
287#define SADB_SATYPE_RSVP 5
288#define SADB_SATYPE_OSPFV2 6
289#define SADB_SATYPE_RIPV2 7
290#define SADB_SATYPE_MIP 8
291#define SADB_X_SATYPE_IPCOMP 9
292#define SADB_X_SATYPE_POLICY 10
293#define SADB_SATYPE_MAX 11
294
295#define SADB_SASTATE_LARVAL 0
296#define SADB_SASTATE_MATURE 1
297#define SADB_SASTATE_DYING 2
298#define SADB_SASTATE_DEAD 3
299#define SADB_SASTATE_MAX 3
300
301#define SADB_SAFLAGS_PFS 1
302
303/* RFC2367 numbers - meets RFC2407 */
304#define SADB_AALG_NONE 0
305#define SADB_AALG_MD5HMAC 1 /*2*/
306#define SADB_AALG_SHA1HMAC 2 /*3*/
307#define SADB_AALG_MAX 8
308
309/* private allocations - based on RFC2407/IANA assignment */
310#define SADB_X_AALG_SHA2_256 6 /*5*/
311#define SADB_X_AALG_SHA2_384 7 /*6*/
312#define SADB_X_AALG_SHA2_512 8 /*7*/
313
314/* private allocations should use 249-255 (RFC2407) */
315#define SADB_X_AALG_MD5 3 /*249*/ /* Keyed MD5 */
316#define SADB_X_AALG_SHA 4 /*250*/ /* Keyed SHA */
317#define SADB_X_AALG_NULL 5 /*251*/ /* null authentication */
318
319/* RFC2367 numbers - meets RFC2407 */
320#define SADB_EALG_NONE 0
321#define SADB_EALG_DESCBC 1 /*2*/
322#define SADB_EALG_3DESCBC 2 /*3*/
323#define SADB_EALG_NULL 3 /*11*/
324#define SADB_EALG_MAX 12
325
326/* private allocations - based on RFC2407/IANA assignment */
327#define SADB_X_EALG_CAST128CBC 5 /*6*/
328#define SADB_X_EALG_BLOWFISHCBC 4 /*7*/
329#define SADB_X_EALG_RIJNDAELCBC 12
330#define SADB_X_EALG_AES 12
331/* private allocations should use 249-255 (RFC2407) */
332
333#if 1 /*nonstandard */
334#define SADB_X_CALG_NONE 0
335#define SADB_X_CALG_OUI 1
336#define SADB_X_CALG_DEFLATE 2
337#define SADB_X_CALG_LZS 3
338#define SADB_X_CALG_MAX 4
339#endif
340
341#define SADB_IDENTTYPE_RESERVED 0
342#define SADB_IDENTTYPE_PREFIX 1
343#define SADB_IDENTTYPE_FQDN 2
344#define SADB_IDENTTYPE_USERFQDN 3
345#define SADB_X_IDENTTYPE_ADDR 4
346#define SADB_IDENTTYPE_MAX 4
347
348/* `flags' in sadb_sa structure holds followings */
349#define SADB_X_EXT_NONE 0x0000 /* i.e. new format. */
350#define SADB_X_EXT_OLD 0x0001 /* old format. */
351
352#define SADB_X_EXT_IV4B 0x0010 /* IV length of 4 bytes in use */
353#define SADB_X_EXT_DERIV 0x0020 /* DES derived */
354#define SADB_X_EXT_CYCSEQ 0x0040 /* allowing to cyclic sequence. */
355
356 /* three of followings are exclusive flags each them */
357#define SADB_X_EXT_PSEQ 0x0000 /* sequencial padding for ESP */
358#define SADB_X_EXT_PRAND 0x0100 /* random padding for ESP */
359#define SADB_X_EXT_PZERO 0x0200 /* zero padding for ESP */
360#define SADB_X_EXT_PMASK 0x0300 /* mask for padding flag */
361
362#if 1
363#define SADB_X_EXT_RAWCPI 0x0080 /* use well known CPI (IPComp) */
364#endif
365
366#define SADB_KEY_FLAGS_MAX 0x0fff
367
368/* SPI size for PF_KEYv2 */
369#define PFKEY_SPI_SIZE sizeof(u_int32_t)
370
371/* Identifier for menber of lifetime structure */
372#define SADB_X_LIFETIME_ALLOCATIONS 0
373#define SADB_X_LIFETIME_BYTES 1
374#define SADB_X_LIFETIME_ADDTIME 2
375#define SADB_X_LIFETIME_USETIME 3
376
377/* The rate for SOFT lifetime against HARD one. */
378#define PFKEY_SOFT_LIFETIME_RATE 80
379
380/* Utilities */
381#define PFKEY_ALIGN8(a) (1 + (((a) - 1) | (8 - 1)))
382#define PFKEY_EXTLEN(msg) \
383 PFKEY_UNUNIT64(((struct sadb_ext *)(msg))->sadb_ext_len)
384
385#define PFKEY_ADDR_PREFIX(ext) \
386 (((struct sadb_address *)(ext))->sadb_address_prefixlen)
387
388#define PFKEY_ADDR_PROTO(ext) \
389 (((struct sadb_address *)(ext))->sadb_address_proto)
390
391#define PFKEY_ADDR_SADDR(ext) \
392 ((struct sockaddr *)((caddr_t)(ext) + sizeof(struct sadb_address)))
393
394/* in 64bits */
395#define PFKEY_UNUNIT64(a) ((a) << 3)
396#define PFKEY_UNIT64(a) ((a) >> 3)
397
398#endif /* __PFKEY_V2_H */
399
400#endif /* _NET_PFKEYV2_H_ */
sadb_address
Definition: pfkeyv2.h:118
sadb_alg
Definition: pfkeyv2.h:184
sadb_comb
Definition: pfkeyv2.h:159
sadb_ext
Definition: pfkeyv2.h:93
sadb_ident
Definition: pfkeyv2.h:133
sadb_key
Definition: pfkeyv2.h:126
sadb_lifetime
Definition: pfkeyv2.h:109
sadb_msg
Definition: pfkeyv2.h:82
sadb_prop
Definition: pfkeyv2.h:152
sadb_sa
Definition: pfkeyv2.h:98
sadb_sens
Definition: pfkeyv2.h:141
sadb_spirange
Definition: pfkeyv2.h:192
sadb_supported
Definition: pfkeyv2.h:178
sadb_x_ipsecrequest
Definition: pfkeyv2.h:244
sadb_x_kmprivate
Definition: pfkeyv2.h:200
sadb_x_policy
Definition: pfkeyv2.h:224
sadb_x_sa2
Definition: pfkeyv2.h:212
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/net/ppp-comp.h File Reference

  • inc
  • net
Data Structures
ppp-comp.h File Reference

Go to the source code of this file.

Data Structures

struct compressor

Detailed Description

PPP compression.

Definition in file ppp-comp.h.


Watt-32 tcp/ip: E:/WATT/inc/net/ppp_defs.h File Reference

  • inc
  • net
Data Structures | Typedefs | Enumerations
ppp_defs.h File Reference

Go to the source code of this file.

Data Structures

struct | pppstat
struct | vjstat
struct | ppp_stats
struct | compstat
struct | ppp_comp_stats
struct | ppp_idle

Typedefs

typedef UINT32_T | u_int32_t
typedef u_int32_t | ext_accm[8]

Enumerations

enum NPmode {
NPMODE_PASS ,
NPMODE_DROP ,
NPMODE_ERROR ,
NPMODE_QUEUE
}

Detailed Description

PPP definitions.

Definition in file ppp_defs.h.

Typedef Documentation

◆ ext_accm

typedef u_int32_t ext_accm[8]

Definition at line 131 of file ppp_defs.h.

◆ u_int32_t

typedef unsigned long u_int32_t

Definition at line 122 of file ppp_defs.h.

Enumeration Type Documentation

◆ NPmode

enum NPmode

Definition at line 136 of file ppp_defs.h.


Watt-32 tcp/ip: E:/WATT/inc/net/radix.h File Reference

  • inc
  • net
Data Structures | Functions | Variables
radix.h File Reference

Go to the source code of this file.

Data Structures

struct | radix_node
struct | radix_mask
struct | radix_node_head

Functions

W32_FUNC void W32_CALL | rn_init (void)
W32_FUNC int W32_CALL | rn_inithead (void **, int)
W32_FUNC int W32_CALL | rn_refines (void *, void *)
W32_FUNC int W32_CALL | rn_walktree (struct radix_node_head *, int(W32_CALL *)(struct radix_node *, void *), void *)
W32_FUNC struct radix_node *W32_CALL | rn_addroute (void *, void *, struct radix_node_head *, struct radix_node[2])
W32_FUNC struct radix_node *W32_CALL | rn_insert (void *, struct radix_node_head *, int *, struct radix_node[2])
W32_FUNC struct radix_node *W32_CALL | rn_newpair (void *, int, struct radix_node[2])
W32_FUNC struct radix_node *W32_CALL | rn_addmask (void *, int, int)
W32_FUNC struct radix_node *W32_CALL | rn_delete (void *, void *, struct radix_node_head *)
W32_FUNC struct radix_node *W32_CALL | rn_lookup (void *, void *, struct radix_node_head *)
W32_FUNC struct radix_node *W32_CALL | rn_match (void *, struct radix_node_head *)
W32_FUNC struct radix_node *W32_CALL | rn_search (void *, struct radix_node *)
W32_FUNC struct radix_node *W32_CALL | rn_search_m (void *, struct radix_node *, void *)

Variables

W32_DATA struct radix_mask * rn_mkfreelist

Detailed Description

Radix search trees.

Definition in file radix.h.

Variable Documentation

◆ rn_mkfreelist

W32_DATA struct radix_mask* rn_mkfreelist

Definition at line 109 of file radix.h.


Watt-32 tcp/ip: E:/WATT/inc/net/raw_cb.h File Reference

  • inc
  • net
Data Structures
raw_cb.h File Reference

Go to the source code of this file.

Data Structures

struct rawcb


Watt-32 tcp/ip: E:/WATT/inc/net/route.h File Reference

  • inc
  • net
Data Structures
route.h File Reference

Go to the source code of this file.

Data Structures

struct | route
struct | rt_metrics
struct | rtentry
struct | ortentry
struct | rtstat
struct | rt_msghdr
struct | rt_addrinfo
struct | route_cb

Detailed Description

Route handling.

Definition in file route.h.


Watt-32 tcp/ip: E:/WATT/inc/net/slcompre.h File Reference

  • inc
  • net
Data Structures | Functions
slcompre.h File Reference

Go to the source code of this file.

Data Structures

struct | cstate
struct | slcompress

Functions

void | sl_compress_init (struct slcompress *)
void | sl_compress_setup (struct slcompress *, int)
u_int | sl_compress_tcp (struct mbuf *, struct ip *, struct slcompress *, int)
int | sl_uncompress_tcp (u_char **, int, u_int, struct slcompress *)
int | sl_uncompress_tcp_core (u_char *, int, int, u_int, struct slcompress *, u_char **, u_int *)

Detailed Description

SLIP/PPP compression.

Definition in file slcompre.h.


Watt-32 tcp/ip: E:/WATT/inc/net/slip.h File Reference

  • inc
  • net
slip.h File Reference

Go to the source code of this file.

Detailed Description

BPF SLIP definitions.

Definition in file slip.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet Directory Reference

  • inc
  • netinet
netinet Directory Reference
Directory dependency graph for netinet:

Files

file | icmp6.h [code]
file | icmp_var.h [code]
file | if_ether.h [code]
file | if_fddi.h [code]
file | igmp.h [code]
file | igmp_var.h [code]
file | in.h [code]
file | in_pcb.h [code]
file | in_systm.h [code]
file | in_var.h [code]
file | ip.h [code]
file | ip6.h [code]
file | ip_fw.h [code]
file | ip_icmp.h [code]
file | ip_mrout.h [code]
file | ip_var.h [code]
file | ipv6.h [code]
file | tcp.h [code]
file | tcp_debu.h [code]
file | tcp_fsm.h [code]
file | tcp_scor.h [code]
file | tcp_seq.h [code]
file | tcp_time.h [code]
file | tcp_var.h [code]
file | tcpip.h [code]
file | udp.h [code]
file | udp_var.h [code]


Watt-32 tcp/ip: E:/WATT/inc/netinet/icmp6.h File Reference

  • inc
  • netinet
Data Structures | Functions | Variables
icmp6.h File Reference

Go to the source code of this file.

Data Structures

struct | mld_hdr
struct | nd_router_solicit
struct | nd_router_advert
struct | nd_neighbor_solicit
struct | nd_neighbor_advert
struct | nd_redirect
struct | nd_opt_hdr
struct | nd_opt_prefix_info
struct | nd_opt_rd_hdr
struct | nd_opt_mtu
struct | nd_opt_route_info
struct | icmp6_namelookup
struct | icmp6_nodeinfo
struct | ni_reply_fqdn
struct | icmp6_router_renum
struct | rr_pco_match
struct | rr_pco_use
struct | rr_result
struct | icmp6errstat
struct | icmp6stat

Functions

W32_CLANG_PACK_WARN_OFF () struct icmp6_hdr
W32_CLANG_PACK_WARN_DEF () struct icmp6_filter
This hook is to prevent the BSD-socket API being linked in by default.
void | icmp6_init (void)
void | icmp6_paramerror (struct mbuf *, int)
void | icmp6_error (struct mbuf *, int, int, int)
int | icmp6_input (struct mbuf **, int *, int)
void | icmp6_fasttimo (void)
void | icmp6_reflect (struct mbuf *, size_t)
void | icmp6_prepare (struct mbuf *)
void | icmp6_redirect_input (struct mbuf *, int)
void | icmp6_redirect_output (struct mbuf *, struct rtentry *)
void | icmp6_mtudisc_update (struct ip6ctlparam *, int)

Variables

int | icmp6_rediraccept
int | icmp6_redirtimeout

Detailed Description

ICMP for IPv6.

Definition in file icmp6.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_DEF()

W32_CLANG_PACK_WARN_DEF ( )

This hook is to prevent the BSD-socket API being linked in by default.

It is only set from the BSD functions when needed.

Definition at line 511 of file icmp6.h.

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 82 of file icmp6.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/icmp_var.h File Reference

  • inc
  • netinet
Data Structures
icmp_var.h File Reference

Go to the source code of this file.

Data Structures

struct icmpstat

Detailed Description

Internal ICMP statistics.

Definition in file icmp_var.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/if_ether.h File Reference

  • inc
  • netinet
Data Structures | Functions | Variables
if_ether.h File Reference

Go to the source code of this file.

Data Structures

struct | ether_header
struct | ether_arp
struct | arpcom
struct | arptab
struct | ether_multi
struct | ether_multistep

Functions

W32_CLANG_PACK_WARN_OFF () struct ether_addr

Variables

u_char | etherbroadcastaddr [6]
u_char | ether_ipmulticast_min [6]
u_char | ether_ipmulticast_max [6]

Detailed Description

Ethernet definitions.

Definition in file if_ether.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 56 of file if_ether.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/if_fddi.h File Reference

  • inc
  • netinet
Functions
if_fddi.h File Reference

Go to the source code of this file.

Functions

W32_CLANG_PACK_WARN_OFF () struct fddi_header

Detailed Description

FDDI header definition.

Definition in file if_fddi.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 46 of file if_fddi.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/igmp.h File Reference

  • inc
  • netinet
Functions
igmp.h File Reference

Go to the source code of this file.

Functions

W32_CLANG_PACK_WARN_OFF () struct igmp

Detailed Description

Internet Group Managment Protocol.

Definition in file igmp.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 58 of file igmp.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/igmp_var.h File Reference

  • inc
  • netinet
Data Structures
igmp_var.h File Reference

Go to the source code of this file.

Data Structures

struct igmpstat

Detailed Description

Internal IGMP statistics.

Definition in file igmp_var.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/in.h File Reference

  • inc
  • netinet
Data Structures | Variables
in.h File Reference

Go to the source code of this file.

Data Structures

struct | in_addr
struct | in6_addr
struct | sockaddr_in
struct | sockaddr_in6
struct | sockaddr_storage
struct | ipv6_mreq
struct | ip_opts
struct | ip_mreq

Variables

W32_DATA const struct in6_addr | in6addr_any
W32_DATA const struct in6_addr | in6addr_loopback

Detailed Description

IP address, options and definitions.

Definition in file in.h.

Variable Documentation

◆ in6addr_any

W32_DATA const struct in6_addr in6addr_any

Definition at line 211 of file in.h.

◆ in6addr_loopback

W32_DATA const struct in6_addr in6addr_loopback

Definition at line 212 of file in.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/in_pcb.h File Reference

  • inc
  • netinet
Data Structures | Functions
in_pcb.h File Reference

Go to the source code of this file.

Data Structures

struct | inpcb
struct | inpcbinfo

Functions

LIST_HEAD (inpcbhead, inpcb)

Detailed Description

Internal IP structures.

Definition in file in_pcb.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/in_systm.h File Reference

  • inc
  • netinet
Typedefs
in_systm.h File Reference

Go to the source code of this file.

Typedefs

typedef u_short | n_short
typedef u_long | n_long
typedef u_long | n_time

Detailed Description

Various typedefs.

Definition in file in_systm.h.

Typedef Documentation

◆ n_long

typedef u_long n_long

Definition at line 57 of file in_systm.h.

◆ n_short

typedef u_short n_short

Definition at line 56 of file in_systm.h.

◆ n_time

typedef u_long n_time

Definition at line 59 of file in_systm.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/in_var.h File Reference

  • inc
  • netinet
Data Structures
in_var.h File Reference

Go to the source code of this file.

Data Structures

struct | in_ifaddr
struct | in_aliasreq
struct | router_info
struct | in_multi

Detailed Description

IP interface address.

Definition in file in_var.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip.h File Reference

  • inc
  • netinet
Data Structures | Functions
ip.h File Reference

Go to the source code of this file.

Data Structures

struct | ip_timestamp
union | ip_timestamp::ipt_timestamp
struct | ip_timestamp::ipt_timestamp::ipt_ta

Functions

W32_CLANG_PACK_WARN_OFF () struct ip

Detailed Description

IPv4 header and options.

Definition in file ip.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 57 of file ip.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip6.h File Reference

  • inc
  • netinet
Data Structures | Functions
ip6.h File Reference

Go to the source code of this file.

Data Structures

struct | ip6_ext
struct | ip6_hbh
struct | ip6_dest
struct | ip6_rthdr
struct | ip6_rthdr0
struct | ip6_frag

Functions

W32_CLANG_PACK_WARN_OFF () struct ip6_hdr

Detailed Description

IPv6 definitions.

Definition in file ip6.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 79 of file ip6.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip_fw.h File Reference

  • inc
  • netinet
Data Structures
ip_fw.h File Reference

Go to the source code of this file.

Data Structures

struct | ip_fw
struct | ip_fw_chain

Detailed Description

IP firewall definitions.

Definition in file ip_fw.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip_icmp.h File Reference

  • inc
  • netinet
Data Structures | Functions
ip_icmp.h File Reference

Go to the source code of this file.

Data Structures

struct icmp

Functions

W32_CLANG_PACK_WARN_OFF () struct icmp_ra_addr

Detailed Description

ICMP definitions.

Definition in file ip_icmp.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 46 of file ip_icmp.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip_mrout.h File Reference

  • inc
  • netinet
Data Structures | Typedefs
ip_mrout.h File Reference

Go to the source code of this file.

Data Structures

struct | vifctl
struct | mfcctl
struct | mrtstat
struct | sioc_sg_req
struct | sioc_vif_req
struct | vif
struct | mfc
struct | igmpmsg
struct | rtdetq
struct | tbf

Typedefs

typedef u_long | vifbitmap_t
typedef u_short | vifi_t

Detailed Description

IP multicast forwarding.

Definition in file ip_mrout.h.

Typedef Documentation

◆ vifbitmap_t

typedef u_long vifbitmap_t

Definition at line 83 of file ip_mrout.h.

◆ vifi_t

typedef u_short vifi_t

Definition at line 84 of file ip_mrout.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip_var.h File Reference

  • inc
  • netinet
Data Structures | Functions
ip_var.h File Reference

Go to the source code of this file.

Data Structures

struct | ipasfrag
struct | ipoption
struct | ip_moptions
struct | ipstat

Functions

W32_CLANG_PACK_WARN_OFF () struct ipovly
W32_CLANG_PACK_WARN_DEF () struct ipq
This hook is to prevent the BSD-socket API being linked in by default.

Detailed Description

Internal IP definitions and statistics.

Definition in file ip_var.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_DEF()

W32_CLANG_PACK_WARN_DEF ( )

This hook is to prevent the BSD-socket API being linked in by default.

It is only set from the BSD functions when needed.

Definition at line 87 of file ip_var.h.

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 43 of file ip_var.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/ipv6.h File Reference

  • inc
  • netinet
Data Structures | Functions
ipv6.h File Reference

Go to the source code of this file.

Data Structures

struct | ipv6_options
struct | in6_pktinfo
struct | in6_ifreq
struct | ipv6_rt_hdr
struct | ipv6_rt0_hdr
struct | ipv6_fraghdr

Functions

W32_CLANG_PACK_WARN_OFF () struct ipv6hdr

Detailed Description

Linux IPv6 definitions.

Definition in file ipv6.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 31 of file ipv6.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp.h File Reference

  • inc
  • netinet
Typedefs | Functions
tcp.h File Reference

Go to the source code of this file.

Typedefs

typedef u_long | tcp_seq
typedef u_long | tcp_cc

Functions

W32_CLANG_PACK_WARN_OFF () struct tcphdr

Detailed Description

TCP header and options.

Definition in file tcp.h.

Typedef Documentation

◆ tcp_cc

typedef u_long tcp_cc

Definition at line 45 of file tcp.h.

◆ tcp_seq

typedef u_long tcp_seq

Definition at line 44 of file tcp.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 47 of file tcp.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_debu.h File Reference

  • inc
  • netinet
Data Structures | Variables
tcp_debu.h File Reference

Go to the source code of this file.

Data Structures

struct | tcp_debug
struct | tad_entry

Variables

static char * | tanames []
struct tad_entry | tad_table [TAD_ENTRIES]
struct tad_entry * | tad_index
u_long | tad_seq
u_long | tad_debug

Detailed Description

TCP debugging.

Definition in file tcp_debu.h.

Variable Documentation

◆ tanames

char* tanames[]
static
Initial value:
= {
"input", "output", "user", "respond", "drop"
}

Definition at line 61 of file tcp_debu.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_fsm.h File Reference

  • inc
  • netinet
Variables
tcp_fsm.h File Reference

Go to the source code of this file.

Variables

static u_char | tcp_outflags [TCP_NSTATES]
int | tcp_acounts [TCP_NSTATES][PRU_NREQ]
char * | tcpstates []

Detailed Description

TCP Finite State Machine.

Definition in file tcp_fsm.h.

Variable Documentation

◆ tcp_acounts

int tcp_acounts[TCP_NSTATES][PRU_NREQ]

Definition at line 82 of file tcp_fsm.h.

◆ tcp_outflags

u_char tcp_outflags[TCP_NSTATES]
static
Initial value:
= {
TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK,
TH_ACK, TH_ACK,
TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK,
}

Definition at line 74 of file tcp_fsm.h.

◆ tcpstates

char* tcpstates[]
Initial value:
= {
"CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD",
"ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING",
"LAST_ACK", "FIN_WAIT_2", "TIME_WAIT",
}

Definition at line 86 of file tcp_fsm.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_scor.h File Reference

  • inc
  • netinet
Data Structures
tcp_scor.h File Reference

Go to the source code of this file.

Data Structures

struct | scrb_entry
struct | scoreboard

Detailed Description

TCP scoreboard definitions (SACK).

Definition in file tcp_scor.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_seq.h File Reference

  • inc
  • netinet
Variables
tcp_seq.h File Reference

Go to the source code of this file.

Variables

tcp_seq tcp_iss

Detailed Description

TCP serquence number handling.

Definition in file tcp_seq.h.

Variable Documentation

◆ tcp_iss

tcp_seq tcp_iss

Definition at line 98 of file tcp_seq.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_time.h File Reference

  • inc
  • netinet
Variables
tcp_time.h File Reference

Go to the source code of this file.

Variables

static char * tcptimers []

Detailed Description

TCP timer definitions.

Definition in file tcp_time.h.

Variable Documentation

◆ tcptimers

char* tcptimers[]
static
Initial value:
=
{ "REXMT", "PERSIST", "KEEP", "2MSL" }

Definition at line 115 of file tcp_time.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_var.h File Reference

  • inc
  • netinet
Data Structures
tcp_var.h File Reference

Go to the source code of this file.

Data Structures

struct | sackblock
struct | tcpcb
struct | tcpopt
struct | rmxp_tao
struct | tcpstat

Detailed Description

Internal TCP structures and statistics.

Definition in file tcp_var.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcpip.h File Reference

  • inc
  • netinet
Data Structures | Functions
tcpip.h File Reference

Go to the source code of this file.

Data Structures

struct full_tcpiphdr

Functions

W32_CLANG_PACK_WARN_OFF () struct tcpiphdr

Detailed Description

TCP header definitions.

Definition in file tcpip.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 44 of file tcpip.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/udp.h File Reference

  • inc
  • netinet
Data Structures
udp.h File Reference

Go to the source code of this file.

Data Structures

struct udphdr

Detailed Description

UDP header.

Definition in file udp.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet/udp_var.h File Reference

  • inc
  • netinet
Functions
udp_var.h File Reference

Go to the source code of this file.

Functions

W32_CLANG_PACK_WARN_OFF () struct udpiphdr
W32_CLANG_PACK_WARN_DEF () struct udpstat
This hook is to prevent the BSD-socket API being linked in by default.

Detailed Description

Internal UDP statistics.

Definition in file udp_var.h.

Function Documentation

◆ W32_CLANG_PACK_WARN_DEF()

W32_CLANG_PACK_WARN_DEF ( )

This hook is to prevent the BSD-socket API being linked in by default.

It is only set from the BSD functions when needed.

Definition at line 58 of file udp_var.h.

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 47 of file udp_var.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet6 Directory Reference

  • inc
  • netinet6
netinet6 Directory Reference
Directory dependency graph for netinet6:

Files

file | ah.h [code]
file | ah6.h [code]
file | esp.h [code]
file | esp6.h [code]
file | esp_rijn.h [code]
file | in6.h [code]
file | in6_gif.h [code]
file | in6_ifat.h [code]
file | in6_pcb.h [code]
file | in6_pref.h [code]
file | in6_var.h [code]
file | ip6_ecn.h [code]
file | ip6_fw.h [code]
file | ip6_mrou.h [code]
file | ip6_var.h [code]
file | ip6proto.h [code]
file | ipcomp.h [code]
file | ipcomp6.h [code]
file | ipsec.h [code]
file | ipsec6.h [code]
file | mld6_var.h [code]
file | nd6.h [code]
file | pim6.h [code]
file | pim6_var.h [code]
file | raw_ip6.h [code]
file | scope6_v.h [code]
file | tcp6_var.h [code]
file | udp6_var.h [code]


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ah.h File Reference

  • inc
  • netinet6
Data Structures | Functions
ah.h File Reference

Go to the source code of this file.

Data Structures

struct | ah
struct | newah
struct | ah_algorithm_state
struct | ah_algorithm

Functions

const struct ah_algorithm * | ah_algorithm_lookup (int)
int | ah_hdrlen (struct secasvar *)
size_t | ah_hdrsiz (struct ipsecrequest *)
void | ah4_input (struct mbuf *, int)
int | ah4_output (struct mbuf *, struct ipsecrequest *)
int | ah4_calccksum (struct mbuf *, caddr_t, size_t, const struct ah_algorithm *, struct secasvar *)

Detailed Description

Authentication Header.

Definition in file ah.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ah6.h File Reference

  • inc
  • netinet6
Functions
ah6.h File Reference

Go to the source code of this file.

Functions

int | ah6_input (struct mbuf **, int *, int))
int | ah6_output (struct mbuf *, u_char *, struct mbuf *, struct ipsecrequest *)
int | ah6_calccksum (struct mbuf *, caddr_t, size_t, const struct ah_algorithm *, struct secasvar *)
void | ah6_ctlinput (int, struct sockaddr *, void *)

Detailed Description

IPv6 Authentication header.

Definition in file ah6.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet6/esp.h File Reference

  • inc
  • netinet6
Data Structures | Functions
esp.h File Reference

Go to the source code of this file.

Data Structures

struct | esp
struct | newesp
struct | esptail
struct | esp_algorithm

Functions

const struct esp_algorithm * | esp_algorithm_lookup (int)
int | esp_max_ivlen (void)
int | esp4_output (struct mbuf *, struct ipsecrequest *)
void | esp4_input (struct mbuf *, int)
size_t | esp_hdrsiz (struct ipsecrequest *)
int | esp_schedule (const struct esp_algorithm *, struct secasvar *)
int | esp_auth (struct mbuf *, size_t, size_t, struct secasvar *, u_char *)


Watt-32 tcp/ip: E:/WATT/inc/netinet6/esp6.h File Reference

  • inc
  • netinet6
Functions
esp6.h File Reference

Go to the source code of this file.

Functions

int | esp6_output (struct mbuf *, u_char *, struct mbuf *, struct ipsecrequest *)
int | esp6_input (struct mbuf **, int *, int)
void | esp6_ctlinput (int, struct sockaddr *, void *)


Watt-32 tcp/ip: E:/WATT/inc/netinet6/esp_rijn.h File Reference

  • inc
  • netinet6
Functions
esp_rijn.h File Reference

Go to the source code of this file.

Functions

int | esp_rijndael_schedlen (const struct esp_algorithm *)
int | esp_rijndael_schedule (const struct esp_algorithm *, struct secasvar *)
int | esp_rijndael_blockdecrypt (const struct esp_algorithm *, struct secasvar *, u_int8_t *, u_int8_t *)
int | esp_rijndael_blockencrypt (const struct esp_algorithm *, struct secasvar *, u_int8_t *, u_int8_t *)


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6.h File Reference

  • inc
  • netinet6
Data Structures | Functions | Variables
in6.h File Reference

Go to the source code of this file.

Data Structures

struct | in6_addr
struct | sockaddr_in6
struct | route_in6
struct | ipv6_mreq
struct | in6_pktinfo

Functions

int | inet6_option_space (int)
int | inet6_option_init (void *, struct cmsghdr **, int)
int | inet6_option_append (struct cmsghdr *, const uint8_t *, int, int)
uint8_t * | inet6_option_alloc (struct cmsghdr *, int, int, int)
int | inet6_option_next (const struct cmsghdr *, uint8_t **)
int | inet6_option_find (const struct cmsghdr *, uint8_t **, int)
size_t | inet6_rthdr_space (int, int)
struct cmsghdr * | inet6_rthdr_init (void *, int)
int | inet6_rthdr_add (struct cmsghdr *, const struct in6_addr *, unsigned int)
int | inet6_rthdr_lasthop (struct cmsghdr *, unsigned int)
int | inet6_rthdr_segments (const struct cmsghdr *)
struct in6_addr * | inet6_rthdr_getaddr (struct cmsghdr *, int)
int | inet6_rthdr_getflags (const struct cmsghdr *, int)
int | inet6_opt_init (void *, size_t)
int | inet6_opt_append (void *, size_t, int, uint8_t, size_t, uint8_t, void **)
int | inet6_opt_finish (void *, size_t, int)
int | inet6_opt_set_val (void *, size_t, void *, int)
int | inet6_opt_next (void *, size_t, int, uint8_t *, size_t *, void **)
int | inet6_opt_find (void *, size_t, int, uint8_t, size_t *, void **)
int | inet6_opt_get_val (void *, size_t, void *, int)
size_t | inet6_rth_space (int, int)
void * | inet6_rth_init (void *, int, int, int)
int | inet6_rth_add (void *, const struct in6_addr *)
int | inet6_rth_reverse (const void *, void *)
int | inet6_rth_segments (const void *)
struct in6_addr * | inet6_rth_getaddr (const void *, int)

Variables

W32_DATA const struct in6_addr | in6addr_any
W32_DATA const struct in6_addr | in6addr_loopback
W32_DATA const struct in6_addr | in6addr_nodelocal_allnodes
W32_DATA const struct in6_addr | in6addr_linklocal_allnodes
W32_DATA const struct in6_addr | in6addr_linklocal_allrouters

Variable Documentation

◆ in6addr_any

W32_DATA const struct in6_addr in6addr_any

Definition at line 166 of file in6.h.

◆ in6addr_linklocal_allnodes

W32_DATA const struct in6_addr in6addr_linklocal_allnodes

Definition at line 170 of file in6.h.

◆ in6addr_linklocal_allrouters

W32_DATA const struct in6_addr in6addr_linklocal_allrouters

Definition at line 171 of file in6.h.

◆ in6addr_loopback

W32_DATA const struct in6_addr in6addr_loopback

Definition at line 167 of file in6.h.

◆ in6addr_nodelocal_allnodes

W32_DATA const struct in6_addr in6addr_nodelocal_allnodes

Definition at line 169 of file in6.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6_gif.h File Reference

  • inc
  • netinet6
Functions
in6_gif.h File Reference

Go to the source code of this file.

Functions

int | in6_gif_input (struct mbuf **, int *, int)
int | in6_gif_output (struct ifnet *, int, struct mbuf *, struct rtentry *)
int | gif_encapcheck6 (const struct mbuf *, int, int, void *)


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6_ifat.h File Reference

  • inc
  • netinet6
Functions
in6_ifat.h File Reference

Go to the source code of this file.

Functions

void | in6_nigroup_attach (const char *, int)
void | in6_nigroup_detach (const char *, int)
void | in6_ifattach (struct ifnet *, struct ifnet *)
void | in6_ifdetach (struct ifnet *)
void | in6_get_tmpifid (struct ifnet *, u_int8_t *, const u_int8_t *, int)
void | in6_tmpaddrtimer (void *)
int | in6_nigroup (struct ifnet *, const char *, int, struct in6_addr *)


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6_pcb.h File Reference

  • inc
  • netinet6
Functions
in6_pcb.h File Reference

Go to the source code of this file.

Functions

void | in6_pcbpurgeif0 (struct in6pcb *, struct ifnet *)
void | in6_losing (struct inpcb *)
int | in6_pcballoc (struct socket *, struct inpcbinfo *, struct thread *))
int | in6_pcbbind (struct inpcb *, struct sockaddr *, struct thread *)
int | in6_pcbconnect (struct inpcb *, struct sockaddr *, struct thread *)
void | in6_pcbdetach (struct inpcb *)
void | in6_pcbdisconnect (struct inpcb *)
int | in6_pcbladdr (struct inpcb *, struct sockaddr *, struct in6_addr **)
struct inpcb * | in6_pcblookup_local (struct inpcbinfo *, struct in6_addr *, u_int, int)
struct inpcb * | in6_pcblookup_hash (struct inpcbinfo *, struct in6_addr *, u_int, struct in6_addr *, u_int, int, struct ifnet *)
void | in6_pcbnotify (struct inpcbhead *, struct sockaddr *, u_int, const struct sockaddr *, u_int, int, struct inpcb *(*)(struct inpcb *, int))
struct inpcb * | in6_rtchange (struct inpcb *, int)
int | in6_setpeeraddr (struct socket *so, struct sockaddr **nam)
int | in6_setsockaddr (struct socket *so, struct sockaddr **nam)
int | in6_mapped_sockaddr (struct socket *so, struct sockaddr **nam)
int | in6_mapped_peeraddr (struct socket *so, struct sockaddr **nam)
struct in6_addr * | in6_selectsrc (struct sockaddr_in6 *, struct ip6_pktopts *, struct ip6_moptions *, struct route_in6 *, struct in6_addr *, int *)
int | in6_selecthlim (struct in6pcb *, struct ifnet *)
int | in6_pcbsetport (struct in6_addr *, struct inpcb *, struct thread *)
void | init_sin6 (struct sockaddr_in6 *sin6, struct mbuf *m)


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6_pref.h File Reference

  • inc
  • netinet6
Data Structures | Functions | Variables
in6_pref.h File Reference

Go to the source code of this file.

Data Structures

struct | rr_prefix
struct | rr_prefix::rp_stateflags
struct | rp_addr
struct | rp_addr::ra_flags

Functions

LIST_HEAD (rr_prhead, rr_prefix)
void | in6_rr_timer (void *)
int | delete_each_prefix (struct rr_prefix *rpp, u_char origin)

Variables

struct rr_prhead | rr_prefix
struct callout | in6_rr_timer_ch


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6_var.h File Reference

  • inc
  • netinet6
Data Structures | Functions | Variables
in6_var.h File Reference

Go to the source code of this file.

Data Structures

struct | in6_addrlifetime
struct | in6_ifaddr
struct | in6_ifstat
struct | icmp6_ifstat
struct | in6_ifreq
struct | in6_aliasreq
struct | prf_ra
struct | prf_rr
struct | in6_prflags
struct | in6_prefixreq
struct | in6_rrenumreq
struct | in6_rrenumreq::irr_raflagmask
struct | in6_multi_mship
struct | in6_multi
struct | in6_multistep

Functions

MALLOC_DECLARE (M_IPMADDR)
LIST_HEAD (in6_multihead, in6_multi) in6_multihead
struct in6_multi * | in6_addmulti (struct in6_addr *, struct ifnet *, int *)
void | in6_delmulti (struct in6_multi *)
int | in6_ifindex2scopeid (int)
int | in6_mask2len (struct in6_addr *, u_char *)
void | in6_len2mask (struct in6_addr *, int)
int | in6_control (struct socket *, u_long, caddr_t, struct ifnet *, struct thread *)
int | in6_update_ifa (struct ifnet *, struct in6_aliasreq *, struct in6_ifaddr *)
void | in6_purgeaddr (struct ifaddr *)
int | in6if_do_dad (struct ifnet *)
void | in6_purgeif (struct ifnet *)
void | in6_savemkludge (struct in6_ifaddr *)
void | in6_setmaxmtu (void)
void | in6_restoremkludge (struct in6_ifaddr *, struct ifnet *)
void | in6_purgemkludge (struct ifnet *)
struct in6_ifaddr * | in6ifa_ifpforlinklocal (struct ifnet *, int)
struct in6_ifaddr * | in6ifa_ifpwithaddr (struct ifnet *, struct in6_addr *)
char * | ip6_sprintf (const struct in6_addr *)
int | in6_addr2scopeid (struct ifnet *, struct in6_addr *)
int | in6_matchlen (struct in6_addr *, struct in6_addr *)
int | in6_are_prefix_equal (struct in6_addr *p1, struct in6_addr *p2, int len)
void | in6_prefixlen2mask (struct in6_addr *maskp, int len)
int | in6_prefix_ioctl (struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
int | in6_prefix_add_ifid (int iilen, struct in6_ifaddr *ia)
void | in6_prefix_remove_ifid (int iilen, struct in6_ifaddr *ia)
void | in6_purgeprefix (struct ifnet *)
int | in6_is_addr_deprecated (struct sockaddr_in6 *)
int | in6_embedscope (struct in6_addr *, const struct sockaddr_in6 *, struct inpcb *, struct ifnet **)
int | in6_recoverscope (struct sockaddr_in6 *, const struct in6_addr *, struct ifnet *)
void | in6_clearscope (struct in6_addr *)

Variables

struct in6_ifaddr * | in6_ifaddr
struct in6_ifstat ** | in6_ifstat
size_t | in6_ifstatmax
struct icmp6stat | icmp6stat
struct icmp6_ifstat ** | icmp6_ifstat
size_t | icmp6_ifstatmax
struct ifqueue | ip6intrq
struct in6_addr | zeroin6_addr
u_char | inet6ctlerrmap []
unsigned long | in6_maxmtu


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ip6_ecn.h File Reference

  • inc
  • netinet6
Functions
ip6_ecn.h File Reference

Go to the source code of this file.

Functions

void | ip6_ecn_ingress (int, u_int32_t *, const u_int32_t *)
void | ip6_ecn_egress (int, const u_int32_t *, u_int32_t *)


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ip6_fw.h File Reference

  • inc
  • netinet6
Data Structures | Typedefs | Functions | Variables
ip6_fw.h File Reference

Go to the source code of this file.

Data Structures

union | ip6_fw_if
struct | ip6_fw
struct | ip6_fw_chain

Typedefs

typedef int | ip6_fw_chk_t(struct ip6_hdr **, struct ifnet *, u_short *, struct mbuf **)
typedef int | ip6_fw_ctl_t(int, struct mbuf **)

Functions

void ip6_fw_init (void)

Variables

ip6_fw_chk_t * | ip6_fw_chk_ptr
ip6_fw_ctl_t * | ip6_fw_ctl_ptr
int | ip6_fw_enable

Typedef Documentation

◆ ip6_fw_chk_t

typedef int ip6_fw_chk_t(struct ip6_hdr **, struct ifnet *, u_short *, struct mbuf **)

Definition at line 226 of file ip6_fw.h.

◆ ip6_fw_ctl_t

typedef int ip6_fw_ctl_t(int, struct mbuf **)

Definition at line 227 of file ip6_fw.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ip6_mrou.h File Reference

  • inc
  • netinet6
Data Structures | Typedefs | Functions
ip6_mrou.h File Reference

Go to the source code of this file.

Data Structures

struct | if_set
struct | mif6ctl
struct | mf6cctl
struct | mrt6stat
struct | omrt6msg
struct | mrt6msg
struct | sioc_sg_req6
struct | sioc_mif_req6
struct | mif6
struct | mf6c
struct | rtdetq

Typedefs

typedef u_short | mifi_t
typedef u_int32_t | if_mask
typedef struct if_set | if_set

Functions

int | ip6_mrouter_set (struct socket *so, struct sockopt *sopt)
int | ip6_mrouter_get (struct socket *so, struct sockopt *sopt)
int | ip6_mrouter_done (void)
int | mrt6_ioctl (int, caddr_t)

Typedef Documentation

◆ if_mask

typedef u_int32_t if_mask

Definition at line 87 of file ip6_mrou.h.

◆ mifi_t

typedef u_short mifi_t

Definition at line 80 of file ip6_mrou.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ip6_var.h File Reference

  • inc
  • netinet6
Data Structures | Functions | Variables
ip6_var.h File Reference

Go to the source code of this file.

Data Structures

struct | ip6q
struct | ip6asfrag
struct | ip6_moptions
struct | route_in6
struct | ip6po_rhinfo
struct | ip6_pktopts
struct | ip6stat
struct | ip6aux

Functions

int | icmp6_ctloutput (struct socket *, struct sockopt *sopt)
void | ip6_init (void)
void | ip6intr (void)
void | ip6_input (struct mbuf *)
struct in6_ifaddr * | ip6_getdstifaddr (struct mbuf *)
void | ip6_freepcbopts (struct ip6_pktopts *)
void | ip6_freemoptions (struct ip6_moptions *)
int | ip6_unknown_opt (u_int8_t *, struct mbuf *, int)
char * | ip6_get_prevhdr (struct mbuf *, int)
int | ip6_nexthdr (struct mbuf *, int, int, int *)
int | ip6_lasthdr (struct mbuf *, int, int, int *)
struct mbuf * | ip6_addaux (struct mbuf *)
struct mbuf * | ip6_findaux (struct mbuf *)
void | ip6_delaux (struct mbuf *)
int | ip6_mforward (struct ip6_hdr *, struct ifnet *, struct mbuf *)
int | ip6_process_hopopts (struct mbuf *, u_int8_t *, int, u_int32_t *, u_int32_t *)
void | ip6_savecontrol (struct inpcb *, struct mbuf **, struct ip6_hdr *, struct mbuf *)
void | ip6_notify_pmtu (struct inpcb *, struct sockaddr_in6 *, u_int32_t *)
int | ip6_sysctl (int *, u_int, void *, size_t *, void *, size_t)
void | ip6_forward (struct mbuf *, int)
void | ip6_mloopback (struct ifnet *, struct mbuf *, struct sockaddr_in6 *)
int | ip6_output (struct mbuf *, struct ip6_pktopts *, struct route_in6 *, int, struct ip6_moptions *, struct ifnet **)
int | ip6_ctloutput (struct socket *, struct sockopt *sopt)
void | init_ip6pktopts (struct ip6_pktopts *)
int | ip6_setpktoptions (struct mbuf *, struct ip6_pktopts *, int, int)
void | ip6_clearpktopts (struct ip6_pktopts *, int, int)
struct ip6_pktopts * | ip6_copypktopts (struct ip6_pktopts *, int)
int | ip6_optlen (struct inpcb *)
int | route6_input (struct mbuf **, int *, int)
void | frag6_init (void)
int | frag6_input (struct mbuf **, int *, int)
void | frag6_slowtimo (void)
void | frag6_drain (void)
void | rip6_init (void)
int | rip6_input (struct mbuf **mp, int *offp, int proto)
void | rip6_ctlinput (int, struct sockaddr *, void *)
int | rip6_ctloutput (struct socket *so, struct sockopt *sopt)
int | rip6_output (struct mbuf *,...)
int | rip6_usrreq (struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct thread *)
int | dest6_input (struct mbuf **, int *, int)
int | none_input (struct mbuf **, int *, int)

Variables

struct ip6stat | ip6stat
u_int32_t | ip6_id
int | ip6_defhlim
int | ip6_defmcasthlim
int | ip6_forwarding
int | ip6_forward_srcrt
int | ip6_gif_hlim
int | ip6_use_deprecated
int | ip6_rr_prune
int | ip6_v6only
struct socket * | ip6_mrouter
int | ip6_sendredirects
int | ip6_maxfragpackets
int | ip6_sourcecheck
int | ip6_sourcecheck_interval
int | ip6_accept_rtadv
int | ip6_keepfaith
int | ip6_log_interval
time_t | ip6_log_time
int | ip6_hdrnestlimit
int | ip6_dad_count
u_int32_t | ip6_flow_seq
int | ip6_auto_flowlabel
int | ip6_auto_linklocal
int | ip6_anonportmin
int | ip6_anonportmax
int | ip6_lowportmin
int | ip6_lowportmax
int | ip6_use_tempaddr
struct pr_usrreqs | rip6_usrreqs


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ip6proto.h File Reference

  • inc
  • netinet6
Data Structures | Variables
ip6proto.h File Reference

Go to the source code of this file.

Data Structures

struct | ip6ctlparam
struct | ip6protosw

Variables

struct ip6protosw inet6sw []


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ipcomp.h File Reference

  • inc
  • netinet6
Data Structures | Functions
ipcomp.h File Reference

Go to the source code of this file.

Data Structures

struct | ipcomp
struct | ipcomp_algorithm

Functions

const struct ipcomp_algorithm * | ipcomp_algorithm_lookup (int)
void | ipcomp4_input (struct mbuf *, int)
int | ipcomp4_output (struct mbuf *, struct ipsecrequest *)


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ipcomp6.h File Reference

  • inc
  • netinet6
Functions
ipcomp6.h File Reference

Go to the source code of this file.

Functions

int | ipcomp6_input (struct mbuf **, int *, int)
int | ipcomp6_output (struct mbuf *, u_char *, struct mbuf *, struct ipsecrequest *)


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ipsec.h File Reference

  • inc
  • netinet6
Data Structures | Functions | Variables
ipsec.h File Reference

Go to the source code of this file.

Data Structures

struct | secpolicyindex
struct | secpolicy
struct | ipsecrequest
struct | inpcbpolicy
struct | secspacq
struct | ipsecstat
struct | ipsec_output_state
struct | ipsec_history

Functions

struct secpolicy * | ipsec4_getpolicybysock (struct mbuf *, u_int, struct socket *, int *)
struct secpolicy * | ipsec4_getpolicybyaddr (struct mbuf *, u_int, int, int *)
int | ipsec_init_policy (struct socket *so, struct inpcbpolicy **)
int | ipsec_copy_policy (struct inpcbpolicy *, struct inpcbpolicy *)
u_int | ipsec_get_reqlevel (struct ipsecrequest *)
int | ipsec4_set_policy (struct inpcb *inp, int optname, caddr_t request, size_t len, int priv)
int | ipsec4_get_policy (struct inpcb *inpcb, caddr_t request, size_t len, struct mbuf **mp)
int | ipsec4_delete_pcbpolicy (struct inpcb *)
int | ipsec4_in_reject_so (struct mbuf *, struct socket *)
int | ipsec4_in_reject (struct mbuf *, struct inpcb *)
int | ipsec_chkreplay (u_int32_t, struct secasvar *)
int | ipsec_updatereplay (u_int32_t, struct secasvar *)
size_t | ipsec4_hdrsiz (struct mbuf *, u_int, struct inpcb *)
size_t | ipsec_hdrsiz_tcp (struct tcpcb *)
const char * | ipsec4_logpacketstr (struct ip *, u_int32_t)
const char * | ipsec_logsastr (struct secasvar *)
void | ipsec_dumpmbuf (struct mbuf *)
int | ipsec4_output (struct ipsec_output_state *, struct secpolicy *, int)
int | ipsec4_tunnel_validate (struct mbuf *, int, u_int, struct secasvar *)
struct mbuf * | ipsec_copypkt (struct mbuf *)
void | ipsec_delaux (struct mbuf *)
int | ipsec_setsocket (struct mbuf *, struct socket *)
struct socket * | ipsec_getsocket (struct mbuf *)
int | ipsec_addhist (struct mbuf *, int, u_int32_t)
struct ipsec_history * | ipsec_gethist (struct mbuf *, int *)
void | ipsec_clearhist (struct mbuf *)
caddr_t | ipsec_set_policy (char *, int)
int | ipsec_get_policylen (caddr_t)
char * | ipsec_dump_policy (caddr_t, char *)
const char * | ipsec_strerror (void)

Variables

int | ipsec_debug
struct ipsecstat | ipsecstat
struct secpolicy | ip4_def_policy
int | ip4_esp_trans_deflev
int | ip4_esp_net_deflev
int | ip4_ah_trans_deflev
int | ip4_ah_net_deflev
int | ip4_ah_cleartos
int | ip4_ah_offsetmask
int | ip4_ipsec_dfbit
int | ip4_ipsec_ecn
int | ip4_esp_randpad


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ipsec6.h File Reference

  • inc
  • netinet6
Functions | Variables
ipsec6.h File Reference

Go to the source code of this file.

Functions

struct secpolicy * | ipsec6_getpolicybysock (struct mbuf *, u_int, struct socket *, int *)
struct secpolicy * | ipsec6_getpolicybyaddr (struct mbuf *, u_int, int, int *)
int | ipsec6_in_reject_so (struct mbuf *, struct socket *)
int | ipsec6_delete_pcbpolicy (struct inpcb *)
int | ipsec6_set_policy (struct inpcb *inp, int optname, caddr_t request, size_t len, int priv)
int | ipsec6_get_policy (struct inpcb *inp, caddr_t request, size_t len, struct mbuf **mp)
int | ipsec6_in_reject (struct mbuf *, struct inpcb *)
size_t | ipsec6_hdrsiz (struct mbuf *, u_int, struct inpcb *)
const char * | ipsec6_logpacketstr (struct ip6_hdr *, u_int32_t)
int | ipsec6_output_trans (struct ipsec_output_state *, u_char *, struct mbuf *, struct secpolicy *, int, int *)
int | ipsec6_output_tunnel (struct ipsec_output_state *, struct secpolicy *, int)
int | ipsec6_tunnel_validate (struct mbuf *, int, u_int, struct secasvar *)

Variables

struct ipsecstat | ipsec6stat
struct secpolicy | ip6_def_policy
int | ip6_esp_trans_deflev
int | ip6_esp_net_deflev
int | ip6_ah_trans_deflev
int | ip6_ah_net_deflev
int | ip6_ipsec_ecn
int | ip6_esp_randpad


Watt-32 tcp/ip: E:/WATT/inc/netinet6/mld6_var.h File Reference

  • inc
  • netinet6
Functions
mld6_var.h File Reference

Go to the source code of this file.

Functions

void | mld6_init (void)
void | mld6_input (struct mbuf *, int)
void | mld6_start_listening (struct in6_multi *)
void | mld6_stop_listening (struct in6_multi *)
void | mld6_fasttimeo (void)


Watt-32 tcp/ip: E:/WATT/inc/netinet6/nd6.h File Reference

  • inc
  • netinet6
Data Structures | Functions | Variables
nd6.h File Reference

Go to the source code of this file.

Data Structures

struct | llinfo_nd6
struct | nd_ifinfo
struct | in6_nbrinfo
struct | in6_drlist
struct | in6_defrouter
struct | in6_prlist
struct | in6_prefix
struct | in6_ondireq
struct | in6_ndireq
struct | in6_ndifreq
struct | nd_defrouter
struct | nd_prefix
struct | inet6_ndpr_msghdr
struct | nd_pfxrouter
union | nd_opts

Functions

TAILQ_HEAD (nd_drhead, nd_defrouter)
LIST_HEAD (nd_prhead, nd_prefix)
void | nd6_init (void)
void | nd6_ifattach (struct ifnet *)
int | nd6_is_addr_neighbor (struct sockaddr_in6 *, struct ifnet *)
void | nd6_option_init (void *, int, union nd_opts *)
struct nd_opt_hdr * | nd6_option (union nd_opts *)
int | nd6_options (union nd_opts *)
struct rtentry * | nd6_lookup (struct in6_addr *, int, struct ifnet *)
void | nd6_setmtu (struct ifnet *)
void | nd6_timer (void *)
void | nd6_purge (struct ifnet *)
struct llinfo_nd6 * | nd6_free (struct rtentry *)
void | nd6_nud_hint (struct rtentry *, struct in6_addr *, int)
int | nd6_resolve (struct ifnet *, struct rtentry *, struct mbuf *, struct sockaddr *, u_char *)
void | nd6_rtrequest (int, struct rtentry *, struct rt_addrinfo *)
int | nd6_ioctl (u_long, caddr_t, struct ifnet *)
struct rtentry * | nd6_cache_lladdr (struct ifnet *, struct in6_addr *, char *, int, int, int)
int | nd6_output (struct ifnet *, struct ifnet *, struct mbuf *, struct sockaddr_in6 *, struct rtentry *)
int | nd6_storelladdr (struct ifnet *, struct rtentry *, struct mbuf *, struct sockaddr *, u_char *)
int | nd6_need_cache (struct ifnet *)
void | nd6_na_input (struct mbuf *, int, int)
void | nd6_na_output (struct ifnet *, const struct in6_addr *, const struct in6_addr *, u_long, int, struct sockaddr *)
void | nd6_ns_input (struct mbuf *, int, int)
void | nd6_ns_output (struct ifnet *, const struct in6_addr *, const struct in6_addr *, struct llinfo_nd6 *, int)
caddr_t | nd6_ifptomac (struct ifnet *)
void | nd6_dad_start (struct ifaddr *, int *)
void | nd6_dad_stop (struct ifaddr *)
void | nd6_dad_duplicated (struct ifaddr *)
void | nd6_rs_input (struct mbuf *, int, int)
void | nd6_ra_input (struct mbuf *, int, int)
void | prelist_del (struct nd_prefix *)
void | defrouter_addreq (struct nd_defrouter *)
void | defrouter_delreq (struct nd_defrouter *, int)
void | defrouter_select (void)
void | defrtrlist_del (struct nd_defrouter *)
void | prelist_remove (struct nd_prefix *)
int | prelist_update (struct nd_prefix *, struct nd_defrouter *, struct mbuf *)
int | nd6_prelist_add (struct nd_prefix *, struct nd_defrouter *, struct nd_prefix **)
int | nd6_prefix_onlink (struct nd_prefix *)
int | nd6_prefix_offlink (struct nd_prefix *)
void | pfxlist_onlink_check (void)
struct nd_defrouter * | defrouter_lookup (struct in6_addr *, struct ifnet *)
struct nd_prefix * | nd6_prefix_lookup (struct nd_prefix *)
int | in6_init_prefix_ltimes (struct nd_prefix *ndpr)
void | rt6_flush (struct in6_addr *, struct ifnet *)
int | nd6_setdefaultiface (int)
int | in6_tmpifadd (const struct in6_ifaddr *, int)

Variables

int | nd6_prune
int | nd6_delay
int | nd6_umaxtries
int | nd6_mmaxtries
int | nd6_useloopback
int | nd6_maxnudhint
int | nd6_gctimer
struct llinfo_nd6 | llinfo_nd6
struct nd_ifinfo * | nd_ifinfo
struct nd_drhead | nd_defrouter
struct nd_prhead | nd_prefix
int | nd6_debug
struct callout | nd6_timer_ch
int | nd6_defifindex
int | ip6_desync_factor
u_int32_t | ip6_temp_preferred_lifetime
u_int32_t | ip6_temp_valid_lifetime
int | ip6_temp_regen_advance

Detailed Description

IPv6 Neighbor Discovery.

Definition in file nd6.h.


Watt-32 tcp/ip: E:/WATT/inc/netinet6/pim6.h File Reference

  • inc
  • netinet6
Data Structures
pim6.h File Reference

Go to the source code of this file.

Data Structures

struct pim


Watt-32 tcp/ip: E:/WATT/inc/netinet6/pim6_var.h File Reference

  • inc
  • netinet6
Data Structures | Functions | Variables
pim6_var.h File Reference

Go to the source code of this file.

Data Structures

struct pim6stat

Functions

int pim6_input (struct mbuf **, int *, int)

Variables

struct pim6stat pim6stat


Watt-32 tcp/ip: E:/WATT/inc/netinet6/raw_ip6.h File Reference

  • inc
  • netinet6
Data Structures | Variables
raw_ip6.h File Reference

Go to the source code of this file.

Data Structures

struct rip6stat

Variables

struct rip6stat rip6stat


Watt-32 tcp/ip: E:/WATT/inc/netinet6/scope6_v.h File Reference

  • inc
  • netinet6
Functions
scope6_v.h File Reference

Go to the source code of this file.

Functions

void | scope6_ifattach (struct ifnet *)
int | scope6_set (struct ifnet *, u_int32_t *)
int | scope6_get (struct ifnet *, u_int32_t *)
void | scope6_setdefault (struct ifnet *)
int | scope6_get_default (u_int32_t *)
u_int32_t | scope6_in6_addrscope (struct in6_addr *)
u_int32_t | scope6_addr2default (struct in6_addr *)


Watt-32 tcp/ip: E:/WATT/inc/netinet6/tcp6_var.h File Reference

  • inc
  • netinet6
Functions | Variables
tcp6_var.h File Reference

Go to the source code of this file.

Functions

SYSCTL_DECL (_net_inet6_tcp6)
void | tcp6_ctlinput (int, struct sockaddr *, void *)
void | tcp6_init (void)
int | tcp6_input (struct mbuf **, int *, int)
struct rtentry * | tcp_rtlookup6 (struct in_conninfo *)

Variables

int | tcp_v6mssdflt
struct pr_usrreqs | tcp6_usrreqs


Watt-32 tcp/ip: E:/WATT/inc/netinet6/udp6_var.h File Reference

  • inc
  • netinet6
Functions | Variables
udp6_var.h File Reference

Go to the source code of this file.

Functions

SYSCTL_DECL (_net_inet6_udp6)
void | udp6_ctlinput (int, struct sockaddr *, void *)
int | udp6_input (struct mbuf **, int *, int)
int | udp6_output (struct inpcb *inp, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct thread *td)

Variables

struct pr_usrreqs udp6_usrreqs

Detailed Description

UDP in/out handling for IPv6.

Definition in file udp6_var.h.


Watt-32 tcp/ip: E:/WATT/inc/protocol Directory Reference

  • inc
  • protocol
protocol Directory Reference
Directory dependency graph for protocol:

Files

file | dumprest.h [code]
file | routed.h [code]
file | rwhod.h [code]
file | talkd.h [code]
file | timed.h [code]


Watt-32 tcp/ip: E:/WATT/inc/protocol/dumprest.h File Reference

  • inc
  • protocol
Data Structures | Typedefs | Variables
dumprest.h File Reference

Go to the source code of this file.

Data Structures

union | __u_spcl
struct | __u_spcl::s_spcl

Typedefs

typedef union __u_spcl __u_spcl

Variables

union __u_spcl u_spcl

Detailed Description

Dump/restore protocol definitions.

Definition in file dumprest.h.


Watt-32 tcp/ip: E:/WATT/inc/protocol/routed.h File Reference

  • inc
  • protocol
Data Structures | Variables
routed.h File Reference

Go to the source code of this file.

Data Structures

struct | netinfo
struct | netauth
struct | rip

Variables

char * ripcmds [RIPCMD_MAX]

Detailed Description

Route Daemon definitions.

Definition in file routed.h.

Variable Documentation

◆ ripcmds

char* ripcmds[RIPCMD_MAX]
Initial value:
= {
"#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF"
}

Definition at line 143 of file routed.h.


Watt-32 tcp/ip: E:/WATT/inc/protocol/rwhod.h File Reference

  • inc
  • protocol
Data Structures
rwhod.h File Reference

Go to the source code of this file.

Data Structures

struct | outmp
struct | whod
struct | whod::whoent

Detailed Description

Remote WHO daemon.

Definition in file rwhod.h.


Watt-32 tcp/ip: E:/WATT/inc/protocol/talkd.h File Reference

  • inc
  • protocol
Data Structures
talkd.h File Reference

Go to the source code of this file.

Data Structures

struct | CTL_MSG
struct | CTL_RESPONSE

Detailed Description

Talk server/client definitions.

Definition in file talkd.h.


Watt-32 tcp/ip: E:/WATT/inc/protocol/timed.h File Reference

  • inc
  • protocol
Data Structures | Variables
timed.h File Reference

Go to the source code of this file.

Data Structures

struct tsp

Variables

char * tsptype [TSPTYPENUMBER]

Detailed Description

Time Synchronisation Daemon.

Definition in file timed.h.

Variable Documentation

◆ tsptype

char* tsptype[TSPTYPENUMBER]
Initial value:
= {
"ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP",
"SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT",
"DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ",
"TEST", "SETDATE", "SETDATEREQ", "LOOP"
}

Definition at line 104 of file timed.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc Directory Reference

  • inc
  • rpc
rpc Directory Reference
Directory dependency graph for rpc:

Files

file | auth.h [code]
file | auth_des.h [code]
file | auth_uni.h [code]
file | clnt.h [code]
file | key_prot.h [code]
file | pmap_cln.h [code]
file | pmap_pro.h [code]
file | pmap_rmt.h [code]
file | rpc.h [code]
file | rpc_msg.h [code]
file | svc.h [code]
file | svc_auth.h [code]
file | types.h [code]
file | xdr.h [code]


Watt-32 tcp/ip: E:/WATT/inc/rpc/auth.h File Reference

  • inc
  • rpc
Data Structures | Typedefs | Enumerations | Functions | Variables
auth.h File Reference

Go to the source code of this file.

Data Structures

union | des_block
struct | opaque_auth
struct | AUTH
struct | AUTH::auth_ops

Typedefs

typedef union des_block des_block

Enumerations

enum auth_stat {
AUTH_OK = 0 ,
AUTH_BADCRED = 1 ,
AUTH_REJECTEDCRED = 2 ,
AUTH_BADVERF = 3 ,
AUTH_REJECTEDVERF = 4 ,
AUTH_TOOWEAK = 5 ,
AUTH_INVALIDRESP = 6 ,
AUTH_FAILED = 7
}

Functions

__BEGIN_DECLS bool_t | xdr_des_block (XDR *, des_block *)
__BEGIN_DECLS AUTH * | authunix_create (char *, int, int, int, int *)
AUTH * | authunix_create_default (void)
AUTH * | authnone_create (void)
AUTH * | authdes_create (char *, u_int, struct sockaddr *, des_block *)

Variables

struct opaque_auth _null_auth

Detailed Description

RPC authentication interface.

Definition in file auth.h.

Typedef Documentation

◆ des_block

typedef union des_block des_block

Definition at line 88 of file auth.h.

Enumeration Type Documentation

◆ auth_stat

enum auth_stat

Definition at line 63 of file auth.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/auth_des.h File Reference

  • inc
  • rpc
Data Structures | Enumerations
auth_des.h File Reference

Go to the source code of this file.

Data Structures

struct | authdes_fullname
struct | authdes_cred
struct | authdes_verf

Enumerations

enum authdes_namekind {
ADN_FULLNAME ,
ADN_NICKNAME
}

Detailed Description

RPC authentication.

Definition in file auth_des.h.

Enumeration Type Documentation

◆ authdes_namekind

enum authdes_namekind

Definition at line 48 of file auth_des.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/auth_uni.h File Reference

  • inc
  • rpc
Data Structures | Functions
auth_uni.h File Reference

Go to the source code of this file.

Data Structures

struct | authunix_parms
struct | short_hand_verf

Functions

__BEGIN_DECLS bool_t xdr_authunix_parms (XDR *, struct authunix_parms *)

Detailed Description

RPC authentication.

Definition in file auth_uni.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/clnt.h File Reference

  • inc
  • rpc
Data Structures | Enumerations | Functions | Variables
clnt.h File Reference

Go to the source code of this file.

Data Structures

struct | rpc_err
struct | CLIENT
struct | CLIENT::clnt_ops
struct | rpc_createerr

Enumerations

enum clnt_stat {
RPC_SUCCESS =0 ,
RPC_CANTENCODEARGS =1 ,
RPC_CANTDECODERES =2 ,
RPC_CANTSEND =3 ,
RPC_CANTRECV =4 ,
RPC_TIMEDOUT =5 ,
RPC_VERSMISMATCH =6 ,
RPC_AUTHERROR =7 ,
RPC_PROGUNAVAIL =8 ,
RPC_PROGVERSMISMATCH =9 ,
RPC_PROCUNAVAIL =10 ,
RPC_CANTDECODEARGS =11 ,
RPC_SYSTEMERROR =12 ,
RPC_UNKNOWNHOST =13 ,
RPC_UNKNOWNPROTO =17 ,
RPC_PMAPFAILURE =14 ,
RPC_PROGNOTREGISTERED =15 ,
RPC_FAILED =16
}

Functions

__BEGIN_DECLS CLIENT * | clntraw_create (u_long, u_long)
CLIENT * | clnt_create (char *, u_long, u_long, char *)
CLIENT * | clnttcp_create (struct sockaddr_in *, u_long, u_long, int *, u_int, u_int)
CLIENT * | clntudp_create (struct sockaddr_in *, u_long, u_long, struct timeval, int *)
CLIENT * | clntudp_bufcreate (struct sockaddr_in *, u_long, u_long, struct timeval, int *, u_int, u_int)
void | clnt_pcreateerror (char *)
char * | clnt_spcreateerror (char *)
void | clnt_perrno (enum clnt_stat)
char * | clnt_sperrno (enum clnt_stat)
void | clnt_perror (CLIENT *, char *)
char * | clnt_sperror (CLIENT *, char *)
int | callrpc (char *host, u_long prognum, u_long versnum, u_long procnum, xdrproc_t inproc, char *in, xdrproc_t outproc, char *out)

Variables

struct rpc_createerr rpc_createerr

Detailed Description

RPC client-side interface.

Definition in file clnt.h.

Enumeration Type Documentation

◆ clnt_stat

enum clnt_stat

Definition at line 52 of file clnt.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/key_prot.h File Reference

  • inc
  • rpc
Data Structures | Typedefs | Enumerations | Functions
key_prot.h File Reference

Go to the source code of this file.

Data Structures

struct | cryptkeyarg
struct | cryptkeyres
struct | unixcred
struct | getcredres

Typedefs

typedef enum keystatus | keystatus
typedef char | keybuf[HEXKEYBYTES]
typedef char * | netnamestr
typedef struct cryptkeyarg | cryptkeyarg
typedef struct cryptkeyres | cryptkeyres
typedef struct unixcred | unixcred
typedef struct getcredres | getcredres

Enumerations

enum keystatus {
KEY_SUCCESS = 0 ,
KEY_NOSECRET = 1 ,
KEY_UNKNOWN = 2 ,
KEY_SYSTEMERR = 3
}

Functions

bool_t | xdr_keystatus ()
bool_t | xdr_keybuf ()
bool_t | xdr_netnamestr ()
bool_t | xdr_cryptkeyarg ()
bool_t | xdr_cryptkeyres ()
bool_t | xdr_unixcred ()
bool_t | xdr_getcredres ()
long * | key_set_1 ()
cryptkeyres * | key_encrypt_1 ()
cryptkeyres * | key_decrypt_1 ()
des_block * | key_gen_1 ()
getcredres * | key_getcred_1 ()

Detailed Description

RPC key exchange protocol.

Definition in file key_prot.h.

Typedef Documentation

◆ keybuf

typedef char keybuf[HEXKEYBYTES]

Definition at line 36 of file key_prot.h.

◆ netnamestr

typedef char* netnamestr

Definition at line 41 of file key_prot.h.

Enumeration Type Documentation

◆ keystatus

enum keystatus

Definition at line 26 of file key_prot.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/pmap_cln.h File Reference

  • inc
  • rpc
Functions
pmap_cln.h File Reference

Go to the source code of this file.

Functions

__BEGIN_DECLS bool_t | pmap_set (u_long, u_long, int, int)
bool_t | pmap_unset (u_long, u_long)
struct pmaplist * | pmap_getmaps (struct sockaddr_in *)
enum clnt_stat | pmap_rmtcall (struct sockaddr_in *, u_long, u_long, u_long, xdrproc_t, caddr_t, xdrproc_t, caddr_t, struct timeval, u_long *)
enum clnt_stat | clnt_broadcast (u_long, u_long, u_long, xdrproc_t, char *, xdrproc_t, char *, bool_t(*)())
u_short | pmap_getport (struct sockaddr_in *, u_long, u_long, u_int)

Detailed Description

RPC portmapper (client-side).

Definition in file pmap_cln.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/pmap_pro.h File Reference

  • inc
  • rpc
Data Structures | Functions
pmap_pro.h File Reference

Go to the source code of this file.

Data Structures

struct | pmap
struct | pmaplist

Functions

__BEGIN_DECLS bool_t | xdr_pmap (XDR *, struct pmap *)
bool_t | xdr_pmaplist (XDR *, struct pmaplist **)

Detailed Description

RPC portmappper.

Definition in file pmap_pro.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/pmap_rmt.h File Reference

  • inc
  • rpc
Data Structures | Functions
pmap_rmt.h File Reference

Go to the source code of this file.

Data Structures

struct | rmtcallargs
struct | rmtcallres

Functions

__BEGIN_DECLS bool_t | xdr_rmtcall_args (XDR *, struct rmtcallargs *)
bool_t | xdr_rmtcallres (XDR *, struct rmtcallres *)

Detailed Description

RPC portmapper definitions.

Definition in file pmap_rmt.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/rpc.h File Reference

  • inc
  • rpc
Data Structures | Functions
rpc.h File Reference

Go to the source code of this file.

Data Structures

struct rpcent

Functions

__BEGIN_DECLS struct rpcent * | getrpcbyname (char *)
struct rpcent * | getrpcbynumber (long)
struct rpcent * | getrpcent (void)
void | setrpcent (int)
void | endrpcent (void)
void | rpc_init (void)
void | set_user_id (u_long uid)
void | set_group_id (u_long gid)
u_long | __geteuid (void)
u_long | __getegid (void)

Detailed Description

Main RPC header.

Definition in file rpc.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/rpc_msg.h File Reference

  • inc
  • rpc
Data Structures | Enumerations | Functions
rpc_msg.h File Reference

Go to the source code of this file.

Data Structures

struct | accepted_reply
struct | rejected_reply
struct | reply_body
struct | call_body
struct | rpc_msg

Enumerations

enum msg_type {
CALL =0 ,
REPLY =1
}
enum reply_stat {
MSG_ACCEPTED =0 ,
MSG_DENIED =1
}
enum accept_stat {
SUCCESS =0 ,
PROG_UNAVAIL =1 ,
PROG_MISMATCH =2 ,
PROC_UNAVAIL =3 ,
GARBAGE_ARGS =4 ,
SYSTEM_ERR =5
}
enum reject_stat {
RPC_MISMATCH =0 ,
AUTH_ERROR =1
}

Functions

__BEGIN_DECLS bool_t | xdr_callmsg (XDR *, struct rpc_msg *)
bool_t | xdr_callhdr (XDR *, struct rpc_msg *)
bool_t | xdr_replymsg (XDR *, struct rpc_msg *)
void | _seterr_reply (struct rpc_msg *, struct rpc_err *)

Detailed Description

RPC message definitions.

Definition in file rpc_msg.h.

Enumeration Type Documentation

◆ accept_stat

enum accept_stat

Definition at line 69 of file rpc_msg.h.

◆ msg_type

enum msg_type

Definition at line 57 of file rpc_msg.h.

◆ reject_stat

enum reject_stat

Definition at line 78 of file rpc_msg.h.

◆ reply_stat

enum reply_stat

Definition at line 62 of file rpc_msg.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/svc.h File Reference

  • inc
  • rpc
Data Structures | Enumerations | Functions | Variables
svc.h File Reference

Go to the source code of this file.

Data Structures

struct | SVCXPRT
struct | SVCXPRT::xp_ops
struct | svc_req

Enumerations

enum xprt_stat {
XPRT_DIED ,
XPRT_MOREREQS ,
XPRT_IDLE
}

Functions

__BEGIN_DECLS W32_FUNC bool_t W32_CALL | svc_register (SVCXPRT *, u_long, u_long, void(*)(), int)
W32_FUNC void W32_CALL | svc_unregister (u_long, u_long)
W32_FUNC void W32_CALL | xprt_register (SVCXPRT *)
W32_FUNC void W32_CALL | xprt_unregister (SVCXPRT *)
W32_FUNC bool_t W32_CALL | svc_sendreply (SVCXPRT *, xdrproc_t, char *)
W32_FUNC void W32_CALL | svcerr_decode (SVCXPRT *)
W32_FUNC void W32_CALL | svcerr_weakauth (SVCXPRT *)
W32_FUNC void W32_CALL | svcerr_noproc (SVCXPRT *)
W32_FUNC void W32_CALL | svcerr_progvers (SVCXPRT *, u_long, u_long)
W32_FUNC void W32_CALL | svcerr_auth (SVCXPRT *, enum auth_stat)
W32_FUNC void W32_CALL | svcerr_noprog (SVCXPRT *)
W32_FUNC void W32_CALL | svcerr_systemerr (SVCXPRT *)
W32_FUNC void | svc_getreqset (fd_set *)
W32_FUNC void W32_CALL | rpctest_service ()
W32_FUNC void W32_CALL | svc_getreq (int)
W32_FUNC void W32_CALL | svc_run (void)
W32_FUNC SVCXPRT *W32_CALL | svcraw_create (void)
W32_FUNC SVCXPRT *W32_CALL | svcudp_create (int)
W32_FUNC SVCXPRT *W32_CALL | svcudp_bufcreate (int, u_int, u_int)
W32_FUNC SVCXPRT *W32_CALL | svctcp_create (int, u_int, u_int)

Variables

W32_DATA fd_set | svc_fdset
W32_DATA int | svc_fds

Detailed Description

RPC server-side interface.

Definition in file svc.h.

Enumeration Type Documentation

◆ xprt_stat

enum xprt_stat

Definition at line 79 of file svc.h.

Variable Documentation

◆ svc_fds

W32_DATA int svc_fds

Definition at line 264 of file svc.h.

◆ svc_fdset

W32_DATA fd_set svc_fdset

Definition at line 261 of file svc.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/svc_auth.h File Reference

  • inc
  • rpc
Functions
svc_auth.h File Reference

Go to the source code of this file.

Functions

__BEGIN_DECLS enum auth_stat _authenticate (struct svc_req *, struct rpc_msg *)

Detailed Description

RPC authentication (server-side).

Definition in file svc_auth.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/types.h File Reference

  • inc
  • rpc
types.h File Reference

Go to the source code of this file.

Detailed Description

RPC type definitions.

Definition in file types.h.


Watt-32 tcp/ip: E:/WATT/inc/rpc/xdr.h File Reference

  • inc
  • rpc
Data Structures | Typedefs | Enumerations | Functions
xdr.h File Reference

Go to the source code of this file.

Data Structures

struct | XDR
struct | XDR::xdr_ops
struct | xdr_discrim
struct | netobj

Typedefs

typedef bool_t(* | xdrproc_t) ()
typedef struct netobj | netobj

Enumerations

enum xdr_op {
XDR_ENCODE = 0 ,
XDR_DECODE = 1 ,
XDR_FREE = 2
}

Functions

__BEGIN_DECLS bool_t | xdr_void (XDR *, caddr_t)
bool_t | xdr_int (XDR *, int *)
bool_t | xdr_u_int (XDR *, u_int *)
bool_t | xdr_long (XDR *, long *)
bool_t | xdr_u_long (XDR *, u_long *)
bool_t | xdr_short (XDR *, short *)
bool_t | xdr_u_short (XDR *, u_short *)
bool_t | xdr_bool (XDR *, bool_t *)
bool_t | xdr_enum (XDR *, enum_t *)
bool_t | xdr_array (XDR *, char **, u_int *, u_int, u_int, xdrproc_t)
bool_t | xdr_bytes (XDR *, char **, u_int *, u_int)
bool_t | __xdr_opaque (XDR *, caddr_t, u_int)
bool_t | xdr_string (XDR *, char **, u_int)
bool_t | xdr_union (XDR *, enum_t *, char *, struct xdr_discrim *, xdrproc_t)
bool_t | xdr_char (XDR *, char *)
bool_t | xdr_u_char (XDR *, char *)
bool_t | xdr_vector (XDR *, char *, u_int, u_int, xdrproc_t)
bool_t | xdr_float (XDR *, float *)
bool_t | xdr_double (XDR *, double *)
bool_t | xdr_reference (XDR *, caddr_t *, u_int, xdrproc_t)
bool_t | xdr_pointer (XDR *, caddr_t *, u_int, xdrproc_t)
bool_t | xdr_wrapstring (XDR *, char **)
void | xdr_free (xdrproc_t, char *)
__BEGIN_DECLS bool_t | xdr_netobj (XDR *, struct netobj *)
void | xdrmem_create (XDR *, char *, u_int, enum xdr_op)
void | xdrstdio_create (XDR *, FILE *, enum xdr_op)
void | xdrrec_create (XDR *, u_int, u_int, char *, int(*)(), int(*)())
bool_t | xdrrec_endofrecord (XDR *, int)
bool_t | xdrrec_skiprecord (XDR *)
bool_t | xdrrec_eof (XDR *)

Detailed Description

eXternal Data Representation.

Definition in file xdr.h.

Typedef Documentation

◆ netobj

typedef struct netobj netobj

Definition at line 292 of file xdr.h.

◆ xdrproc_t

typedef bool_t(* xdrproc_t) ()

Definition at line 108 of file xdr.h.

Enumeration Type Documentation

◆ xdr_op

enum xdr_op

Definition at line 86 of file xdr.h.


Watt-32 tcp/ip: E:/WATT/inc/rpcsvc Directory Reference

  • inc
  • rpcsvc
rpcsvc Directory Reference
Directory dependency graph for rpcsvc:

Files

file | yp_prot.h [code]
file | ypclnt.h [code]


Watt-32 tcp/ip: E:/WATT/inc/rpcsvc/yp_prot.h File Reference

  • inc
  • rpcsvc
Data Structures | Typedefs | Enumerations | Functions
yp_prot.h File Reference

Go to the source code of this file.

Data Structures

struct | datum
struct | ypmap_parms
struct | ypreq_key
struct | ypreq_nokey
struct | ypreq_xfr
struct | ypresp_val
struct | ypresp_key_val
struct | ypresp_master
struct | ypresp_order
struct | ypmaplist
struct | ypresp_maplist
struct | dom_binding
struct | ypbind_binding
struct | ypbind_resp
struct | ypbind_setdom
struct | yppushresp_xfr

Typedefs

typedef u_int bool

Enumerations

enum ypbind_resptype {
YPBIND_SUCC_VAL = 1 ,
YPBIND_FAIL_VAL = 2
}

Functions

bool_t | xdr_datum ()
bool_t | xdr_ypdomain_wrap_string ()
bool_t | xdr_ypmap_wrap_string ()
bool_t | xdr_ypreq_key ()
bool_t | xdr_ypreq_nokey ()
bool_t | xdr_ypreq_xfr ()
bool_t | xdr_ypresp_val ()
bool_t | xdr_ypresp_key_val ()
bool_t | xdr_ypbind_resp ()
bool_t | xdr_ypbind_setdom ()
bool_t | xdr_yp_inaddr ()
bool_t | xdr_ypmap_parms ()
bool_t | xdr_ypowner_wrap_string ()
bool_t | xdr_yppushresp_xfr ()
bool_t | xdr_ypresp_order ()
bool_t | xdr_ypresp_master ()
bool_t | xdr_ypall ()
bool_t | xdr_ypresp_maplist ()

Detailed Description

RPC service - Yellow Pages protocol definitions.

Definition in file yp_prot.h.

Typedef Documentation

◆ bool

typedef u_int bool

Definition at line 75 of file yp_prot.h.

Enumeration Type Documentation

◆ ypbind_resptype

enum ypbind_resptype

Definition at line 257 of file yp_prot.h.


Watt-32 tcp/ip: E:/WATT/inc/rpcsvc/ypclnt.h File Reference

  • inc
  • rpcsvc
Data Structures | Functions
ypclnt.h File Reference

Go to the source code of this file.

Data Structures

struct ypall_callback

Functions

int | yp_get_default_domain (char **domp)
int | yp_bind (char *dom)
int | _yp_dobind (char *dom, struct dom_binding **ypdb)
void | yp_unbind (char *dom)
int | yp_match (char *indomain, char *inmap, const char *inkey, int inkeylen, char **outval, int *outvallen)
int | yp_first (char *indomain, char *inmap, char **outkey, int *outkeylen, char **outval, int *outvallen)
int | yp_next (char *indomain, char *inmap, char *inkey, int inkeylen, char **outkey, int *outkeylen, char **outval, int *outvallen)
int | yp_master (char *indomain, char *inmap, char **outname)
int | yp_order (char *indomain, char *inmap, int *outorder)
int | yp_all (char *indomain, char *inmap, struct ypall_callback *incallback)
int | yp_invalid_domain (char *dom)
char * | yperr_string (int incode)
char * | ypbinderr_string (int incode)
int | ypprot_err (unsigned int incode)

Detailed Description

RPC service - Yellow Pages client.

Definition in file ypclnt.h.


Watt-32 tcp/ip: E:/WATT/inc/sys Directory Reference

  • inc
  • sys
sys Directory Reference
Directory dependency graph for sys:

Files

file | cdefs.h [code]
file | errno.h [code]
file | ioctl.h [code]
file | mbuf.h [code]
file | pack_off.h [code]
file | pack_on.h [code]
file | param.h [code]
file | poll.h [code]
file | queue.h [code]
file | select.h [code]
file | so_ioctl.h [code]
file | socket.h [code]
file | swap.h [code]
file | syslog.h [code]
file | uio.h [code]
file | un.h [code]
file | w32api.h [code]
file | werrno.h [code]
file | whide.h [code]
file | wtime.h [code]
file | wtypes.h [code]


Watt-32 tcp/ip: E:/WATT/inc/sys/cdefs.h File Reference

  • inc
  • sys
cdefs.h File Reference

Go to the source code of this file.

Detailed Description

C-compiler definitions. Ref for a long list of compiler built-in: https://sourceforge.net/p/predef/wiki/Compilers/

Definition in file cdefs.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/errno.h File Reference

  • inc
  • sys
errno.h File Reference

Go to the source code of this file.

Detailed Description

Compatibility header.

Definition in file errno.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/ioctl.h File Reference

  • inc
  • sys
ioctl.h File Reference

Go to the source code of this file.

Detailed Description

BSD socket I/O control.

Definition in file ioctl.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/mbuf.h Source File

  • inc
  • sys
mbuf.h
1#ifndef __SYS_MBUF_H
2#define __SYS_MBUF_H
3
4/* moved from <sys/cdefs.h>
5 */
6struct mbuf {
7 struct mbuf *next; /* Links mbufs belonging to single packets */
8 struct mbuf *anext; /* Links packets on queues */
9 unsigned size; /* Size of associated data buffer */
10 int refcnt; /* Reference count */
11 struct mbuf *dup; /* Pointer to duplicated mbuf */
12 char *data; /* Active working pointers */
13 unsigned cnt;
14 };
15
16#endif
mbuf
Definition: mbuf.h:6


Watt-32 tcp/ip: E:/WATT/inc/sys/pack_off.h File Reference

  • inc
  • sys
pack_off.h File Reference

Go to the source code of this file.

Detailed Description

Default packing of structures.

Definition in file pack_off.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/pack_on.h File Reference

  • inc
  • sys
pack_on.h File Reference

Go to the source code of this file.

Detailed Description

Sets structure packing to 1 byte.

Definition in file pack_on.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/param.h File Reference

  • inc
  • sys
param.h File Reference

Go to the source code of this file.

Detailed Description

Miscellaneous defines.

Definition in file param.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/poll.h File Reference

  • inc
  • sys
Data Structures | Functions
poll.h File Reference

Go to the source code of this file.

Data Structures

struct pollfd

Functions

__BEGIN_DECLS W32_FUNC int W32_CALL poll (struct pollfd *p, int num, int timeout)

Function Documentation

◆ poll()

__BEGIN_DECLS W32_FUNC int W32_CALL poll | ( | struct pollfd * | p,
 |  | int | num,
 |  | int | timeout
 | ) |  |

Definition at line 357 of file select.c.


Watt-32 tcp/ip: E:/WATT/inc/sys/queue.h File Reference

  • inc
  • sys
queue.h File Reference

Go to the source code of this file.


Watt-32 tcp/ip: E:/WATT/inc/sys/select.h File Reference

  • inc
  • sys
select.h File Reference

Go to the source code of this file.

Detailed Description

Compatibility header.

Definition in file select.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/so_ioctl.h File Reference

  • inc
  • sys
so_ioctl.h File Reference

Go to the source code of this file.

Detailed Description

BSD socket I/O control.

Definition in file so_ioctl.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/socket.h File Reference

  • inc
  • sys
Data Structures | Enumerations | Functions
socket.h File Reference

Go to the source code of this file.

Data Structures

struct | sockaddr
struct | sockproto
struct | cmsghdr
struct | msghdr

Enumerations

enum {
SHUT_RD = 0 ,
SHUT_RD = 0 ,
SHUT_WR ,
SHUT_WR
}

Functions

W32_CLANG_PACK_WARN_OFF () struct linger
W32_CLANG_PACK_WARN_DEF () __BEGIN_DECLS W32_FUNC int W32_CALL accept(int
This hook is to prevent the BSD-socket API being linked in by default.
struct sockaddr socklen_t *W32_FUNC int W32_CALL | bind (int, const struct sockaddr *, socklen_t)
bind() - bind name to socket.
W32_FUNC int W32_CALL | closesocket (int s)
W32_FUNC int W32_CALL | connect (int, const struct sockaddr *, socklen_t)
W32_FUNC int W32_CALL | ioctlsocket (int s, long cmd, void *argp)
W32_FUNC int MS_CDECL | fcntlsocket (int s, int cmd,...)
W32_FUNC int W32_CALL | getdomainname (char *name, size_t len)
BSD-style:
Return domain name of this host.
W32_FUNC int W32_CALL | setdomainname (const char *name, size_t len)
BSD-style:
Set the host's domain name.
W32_FUNC int W32_CALL | getpeername (int, struct sockaddr *, socklen_t *)
W32_FUNC int W32_CALL | getsockname (int, struct sockaddr *, socklen_t *)
W32_FUNC int W32_CALL | getsockopt (int, int, int, void *, socklen_t *)
W32_FUNC int W32_CALL | listen (int, int)
W32_FUNC int W32_CALL | recv (int, void *, int, int)
W32_FUNC int W32_CALL | recvfrom (int, void *, int, int, struct sockaddr *, socklen_t *)
W32_FUNC int W32_CALL | recvmsg (int, struct msghdr *, int)
W32_FUNC int W32_CALL | send (int, const void *, int, int)
W32_FUNC int W32_CALL | sendto (int, const void *, int, int, const struct sockaddr *, socklen_t)
W32_FUNC int W32_CALL | sendmsg (int, const struct msghdr *, int)
W32_FUNC int W32_CALL | setsockopt (int, int, int, const void *, socklen_t)
W32_FUNC int W32_CALL | shutdown (int, int)
W32_FUNC int W32_CALL | socket (int, int, int)
socket().
W32_FUNC int W32_CALL | gethostname (char *name, int len)
W32_FUNC int W32_CALL | gethostname (char *name, size_t len)
W32_FUNC long W32_CALL | gethostid (void)
BSD style: returns local IPv4-address.
W32_FUNC long W32_CALL | sethostid (u_long ip)
BSD-style: Sets local IPv4-address.
W32_FUNC int W32_CALL | sethostname (const char *name, size_t len)
W32_FUNC int W32_CALL | sethostname (const char *name, int len)

Detailed Description

BSD socket API.

Definition in file socket.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Definition at line 73 of file socket.h.

Function Documentation

◆ bind()

struct sockaddr socklen_t *W32_FUNC int W32_CALL bind | ( | int | s,
 |  | const struct sockaddr * | myaddr,
 |  | socklen_t | namelen
 | ) |  |

bind() - bind name to socket.

The purpose of bind is to fill in the information for the local IP address and local port (local_addr). In this respect, it is the opposite of connect(). connect() fills in the destination IP address and destination port (remote_addr). In most situations, one does not need to call bind().

Calling bind() on a

Precondition
SOCK_DGRAM socket and for multiple addresses ('myaddr->sin_addr.s_addr == INADDR_ANY' ) requires special attention: Wattcp's 'udp_handler()' doesn't store address information for broadcast.

We therefore install a 's->dataHandler' pointing to '_recvdaemon()' which queues up SOCK_DGRAM messages. This queue is polled (by 'sock_recv_from()') when we call 'receive()' on such a socket. Thus the '*from' address in 'receive()' will be correctly set to source address/port of peer.

Todo:
check for "sleeping" ports (lport_inuse in pctcp.c) also. And return EADDRINUSE if local port not free.

Definition at line 63 of file bind.c.

References _inet6_ntoa(), _sock_chk_sockaddr(), _socklist_find(), and _UDP6_listen().

◆ closesocket()

W32_FUNC int W32_CALL closesocket ( int s )

Definition at line 71 of file close.c.

◆ connect()

W32_FUNC int W32_CALL connect | ( | int | s,
 |  | const struct sockaddr * | servaddr,
 |  | socklen_t | addrlen
 | ) |  |

Definition at line 53 of file connect.c.

◆ fcntlsocket()

W32_FUNC int MS_CDECL fcntlsocket | ( | int | s,
 |  | int | cmd,
 |  |  | ...
 | ) |  |
Todo:
handle O_TEXT and O_BINARY

Definition at line 69 of file fcntl.c.

References _socklist_find(), and list_lookup().

◆ getdomainname()

W32_FUNC int W32_CALL getdomainname | ( | char * | buffer,
 |  | size_t | buflen
 | ) |  |

BSD-style:
Return domain name of this host.

As per BSD spec, the resultant buffer ... ... "will be null-terminated _unless_there_is_insufficient_space_";

Set errno on failure and return -1.

Definition at line 186 of file bsdname.c.

◆ gethostid()

W32_FUNC long W32_CALL gethostid ( void )

BSD style: returns local IPv4-address.

Return values
address on network order.

Definition at line 68 of file bsdname.c.

References my_ip_addr, and netdb_init().

◆ getpeername()

W32_FUNC int W32_CALL getpeername | ( | int | s,
 |  | struct sockaddr * | name,
 |  | socklen_t * | namelen
 | ) |  |

Definition at line 97 of file getname.c.

◆ getsockname()

W32_FUNC int W32_CALL getsockname | ( | int | s,
 |  | struct sockaddr * | name,
 |  | socklen_t * | namelen
 | ) |  |

Definition at line 43 of file getname.c.

◆ getsockopt()

W32_FUNC int W32_CALL getsockopt | ( | int | s,
 |  | int | level,
 |  | int | option,
 |  | void * | optval,
 |  | socklen_t * | optlen
 | ) |  |

Definition at line 125 of file sockopt.c.

◆ ioctlsocket()

W32_FUNC int W32_CALL ioctlsocket | ( | int | s,
 |  | long | cmd,
 |  | void * | argp
 | ) |  |

Definition at line 64 of file ioctl.c.

◆ listen()

W32_FUNC int W32_CALL listen | ( | int | s,
 |  | int | backlog
 | ) |  |

Definition at line 43 of file listen.c.

◆ recv()

W32_FUNC int W32_CALL recv | ( | int | s,
 |  | void * | buf,
 |  | int | len,
 |  | int | flags
 | ) |  |

Definition at line 218 of file receive.c.

◆ recvfrom()

W32_FUNC int W32_CALL recvfrom | ( | int | s,
 |  | void * | buf,
 |  | int | len,
 |  | int | flags,
 |  | struct sockaddr * | from,
 |  | socklen_t * | fromlen
 | ) |  |

Definition at line 207 of file receive.c.

◆ recvmsg()

W32_FUNC int W32_CALL recvmsg | ( | int | s,
 |  | struct msghdr * | msg,
 |  | int | flags
 | ) |  |

Definition at line 236 of file receive.c.

◆ send()

W32_FUNC int W32_CALL send | ( | int | s,
 |  | const void * | buf,
 |  | int | len,
 |  | int | flags
 | ) |  |

Definition at line 58 of file transmit.c.

◆ sendmsg()

W32_FUNC int W32_CALL sendmsg | ( | int | s,
 |  | const struct msghdr * | msg,
 |  | int | flags
 | ) |  |

Definition at line 129 of file transmit.c.

◆ sendto()

W32_FUNC int W32_CALL sendto | ( | int | s,
 |  | const void * | buf,
 |  | int | len,
 |  | int | flags,
 |  | const struct sockaddr * | to,
 |  | socklen_t | tolen
 | ) |  |

Definition at line 52 of file transmit.c.

◆ setdomainname()

W32_FUNC int W32_CALL setdomainname | ( | const char * | name,
 |  | size_t | len
 | ) |  |

BSD-style:
Set the host's domain name.

Set errno on failure and return -1.

Definition at line 213 of file bsdname.c.

References _strlcpy(), and defaultdomain.

◆ sethostid()

W32_FUNC long W32_CALL sethostid ( u_long ip )

BSD-style: Sets local IPv4-address.

Return values
address on host order.

Definition at line 79 of file bsdname.c.

References my_ip_addr.

◆ setsockopt()

W32_FUNC int W32_CALL setsockopt | ( | int | s,
 |  | int | level,
 |  | int | option,
 |  | const void * | optval,
 |  | socklen_t | optlen
 | ) |  |

Definition at line 71 of file sockopt.c.

◆ shutdown()

W32_FUNC int W32_CALL shutdown | ( | int | s,
 |  | int | how
 | ) |  |
Todo:
For tcp, should send RST if we get incoming data. Don't send ICMP error.
Todo:
For tcp, should send FIN when all Tx data has been ack'ed. close_s(s) should be same as shutdown(s,SHUT_WR)

Definition at line 42 of file shutdown.c.

References _socklist_find().

◆ socket()

W32_FUNC int W32_CALL socket | ( | int | family,
 |  | int | type,
 |  | int | protocol
 | ) |  |

socket().

  • family The protocol family. Supports the AF_INET, AF_INET6, AF_PACKET families.
  • type SOCK_STREAM (tcp), SOCK_DGRAM (udp), SOCK_RAW (ip) or SOCK_PACKET (link).
  • protocol IPPROTO_TCP, IPPROTO_UDP or 0/IPPROTO_IP.
Return values
The socket ID number

Definition at line 1733 of file socket.c.

References init_sockets(), set_proto(), socket_op_demux(), and socklist_add().

◆ W32_CLANG_PACK_WARN_DEF()

W32_CLANG_PACK_WARN_DEF ( )

This hook is to prevent the BSD-socket API being linked in by default.

It is only set from the BSD functions when needed.

Definition at line 260 of file pcsed.h.

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 130 of file socket.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/swap.h File Reference

  • inc
  • sys
Functions
swap.h File Reference

Go to the source code of this file.

Functions

__BEGIN_DECLS W32_FUNC unsigned short W32_CALL | ntohs (unsigned short)
W32_FUNC unsigned short W32_CALL | htons (unsigned short)
W32_FUNC unsigned long W32_CALL | ntohl (unsigned long)
W32_FUNC unsigned long W32_CALL | htonl (unsigned long)
W32_FUNC unsigned long W32_CDECL | _w32_intel (unsigned long x)
Convert 32-bit big-endian (network order) to intel (host order) format.
W32_FUNC unsigned short W32_CDECL | _w32_intel16 (unsigned short x)
Convert 16-bit big-endian (network order) to intel (host order) format.
W32_GCC_INLINE unsigned long | __NtoHL (unsigned long x)
W32_GCC_INLINE unsigned short | __NtoHS (unsigned short x)
__declspec (naked) static unsigned short __fastcall __NtoHS(unsigned short x)
W32_FUNC unsigned long W32_CDECL | intel (unsigned long x)
W32_FUNC unsigned short W32_CDECL | intel16 (unsigned short x)

Detailed Description

Swapping of short/long values.

Definition in file swap.h.

Function Documentation

◆ __declspec()

__declspec ( naked )

Definition at line 110 of file swap.h.

◆ __NtoHL()

unsigned long __NtoHL ( unsigned long x )

Definition at line 69 of file swap.h.

◆ __NtoHS()

unsigned short __NtoHS ( unsigned short x )

Definition at line 79 of file swap.h.

◆ _w32_intel()

W32_FUNC unsigned long W32_CDECL _w32_intel ( unsigned long val )

Convert 32-bit big-endian (network order) to intel (host order) format.

Or vice-versa. These are cdecl incase we patch them.

Definition at line 171 of file misc.c.

◆ _w32_intel16()

W32_FUNC unsigned short W32_CDECL _w32_intel16 ( unsigned short val )

Convert 16-bit big-endian (network order) to intel (host order) format.

Or vice-versa

Definition at line 183 of file misc.c.

◆ htonl()

W32_FUNC unsigned long W32_CALL htonl ( unsigned long val )

Definition at line 118 of file getput.c.

◆ htons()

W32_FUNC unsigned short W32_CALL htons ( unsigned short val )

Definition at line 126 of file getput.c.

◆ ntohl()

W32_FUNC unsigned long W32_CALL ntohl ( unsigned long val )

Definition at line 122 of file getput.c.

◆ ntohs()

__BEGIN_DECLS W32_FUNC unsigned short W32_CALL ntohs ( unsigned short val )

Definition at line 130 of file getput.c.


Watt-32 tcp/ip: E:/WATT/inc/sys/syslog.h File Reference

  • inc
  • sys
Data Structures | Typedefs | Functions | Variables
syslog.h File Reference

Go to the source code of this file.

Data Structures

struct _code

Typedefs

typedef struct _code CODE

Functions

__BEGIN_DECLS W32_FUNC void W32_CALL | closelog (void)
W32_FUNC void W32_CALL | openlog (const char *, int, int)
W32_FUNC int W32_CALL | setlogmask (int)
W32_FUNC char *W32_CALL | setlogtag (char *new_tag)
W32_FUNC void MS_CDECL | syslog (int, const char *,...)
W32_FUNC void W32_CALL | vsyslog (int, const char *, va_list)

Variables

W32_DATA CODE | prioritynames [13]
W32_DATA CODE | facilitynames [24]

Detailed Description

syslog() facility.

Definition in file syslog.h.

Function Documentation

◆ closelog()

__BEGIN_DECLS W32_FUNC void W32_CALL closelog ( void )

Definition at line 409 of file syslog.c.

◆ openlog()

W32_FUNC void W32_CALL openlog | ( | const char * | ident,
 |  | int | logstat,
 |  | int | logfac
 | ) |  |

Definition at line 318 of file syslog.c.

◆ setlogmask()

W32_FUNC int W32_CALL setlogmask ( int new_mask )

Definition at line 391 of file syslog.c.

◆ setlogtag()

W32_FUNC char *W32_CALL setlogtag ( char * new_tag )

Definition at line 400 of file syslog.c.

◆ syslog()

W32_FUNC void MS_CDECL syslog | ( | int | pri,
 |  | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 107 of file syslog.c.

◆ vsyslog()

W32_FUNC void W32_CALL vsyslog | ( | int | pri,
 |  | const char * | fmt,
 |  | va_list | ap
 | ) |  |

Definition at line 115 of file syslog.c.

Variable Documentation

◆ facilitynames

W32_DATA CODE facilitynames[24]

Definition at line 126 of file syslog.h.

◆ prioritynames

W32_DATA CODE prioritynames[13]

Definition at line 91 of file syslog.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/uio.h File Reference

  • inc
  • sys
uio.h File Reference

Go to the source code of this file.

Detailed Description

Dummy header.

Definition in file uio.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/un.h File Reference

  • inc
  • sys
Data Structures
un.h File Reference

Go to the source code of this file.

Data Structures

struct sockaddr_un

Detailed Description

Definitions for UNIX domain sockets.

Only added to keep the porting of some Posix programs simpler. Watt-32 does not implement Unix-sockets at all.

Definition in file un.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/w32api.h File Reference

  • inc
  • sys
w32api.h File Reference

Go to the source code of this file.

Detailed Description

Watt-32 API decoration for Win32 targets.

Definition in file w32api.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/werrno.h File Reference

  • inc
  • sys
Functions | Variables
werrno.h File Reference

Go to the source code of this file.

Functions

W32_FUNC void W32_CALL | perror_s (const char *str)
W32_FUNC char *W32_CALL | strerror_s_ (int errnum)
W32_FUNC void W32_CALL | perror (const char *str)
W32_FUNC char *W32_CALL | strerror (int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (i.e.
W32_FUNC int __stdcall | WSAGetLastError (void)
W32_FUNC void __stdcall | WSASetLastError (int err)

Variables

W32_DATA int | _w32_errno
W32_DATA int | _w32_sys_nerr
W32_DATA char * | _w32_sys_errlist []

Detailed Description

sys_errlist[] and errno's for compilers with limited errnos. For WIN32, we do NOT use the <winsock.h> WSAE* codes.

G. Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o 1998 - 2017

Definition in file werrno.h.

Function Documentation

◆ perror()

W32_FUNC void W32_CALL perror ( const char * str )

Definition at line 191 of file neterr.c.

◆ perror_s()

W32_FUNC void W32_CALL perror_s ( const char * str )

Definition at line 316 of file neterr.c.

◆ strerror()

W32_FUNC char *W32_CALL strerror ( int errnum )

For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (i.e.

*_sys_nerr_dll) should give the same effect (?).

Definition at line 207 of file neterr.c.

References _strlcpy().

◆ strerror_s_()

W32_FUNC char *W32_CALL strerror_s_ ( int errnum )

Definition at line 321 of file neterr.c.

◆ WSAGetLastError()

W32_FUNC int __stdcall WSAGetLastError ( void )

Definition at line 233 of file neterr.c.

◆ WSASetLastError()

W32_FUNC void __stdcall WSASetLastError ( int err )

Definition at line 240 of file neterr.c.

Variable Documentation

◆ _w32_errno

W32_DATA int _w32_errno

Definition at line 145 of file werrno.h.

◆ _w32_sys_errlist

W32_DATA char* _w32_sys_errlist[]

Definition at line 147 of file werrno.h.

◆ _w32_sys_nerr

W32_DATA int _w32_sys_nerr

Definition at line 146 of file werrno.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/whide.h File Reference

  • inc
  • sys
whide.h File Reference

Go to the source code of this file.

Detailed Description

Hide "private" symbols by prefixing with "_w32_".

Note: No symbols part of the BSD-socket API should be prefixed with "_w32_".

Definition in file whide.h.


Watt-32 tcp/ip: E:/WATT/inc/sys/wtime.h File Reference

  • inc
  • sys
Data Structures | Functions
wtime.h File Reference

Go to the source code of this file.

Data Structures

struct | timeval
struct | timezone
struct | tms
struct | itimerval
struct | timespec

Functions

W32_FUNC int W32_CALL | getitimer (int, struct itimerval *)
W32_FUNC int W32_CALL | setitimer (int, struct itimerval *, struct itimerval *)
W32_FUNC int W32_CALL | gettimeofday (struct timeval *, struct timezone *)
W32_FUNC int W32_CALL | _w32_gettimeofday (struct timeval *, struct timezone *)
__BEGIN_DECLS W32_FUNC unsigned long W32_CALL | net_times (struct tms *buffer)
W32_FUNC int W32_CALL | gettimeofday2 (struct timeval *, struct timezone *)

Detailed Description

Watt-32 time functions.

Definition in file wtime.h.

Function Documentation

◆ gettimeofday()

W32_FUNC int W32_CALL gettimeofday | ( | struct timeval * | tv,
 |  | struct timezone * | tz
 | ) |  |

Definition at line 200 of file gettod.c.

◆ gettimeofday2()

W32_FUNC int W32_CALL gettimeofday2 | ( | struct timeval * | tv,
 |  | struct timezone * | tz
 | ) |  |

Definition at line 424 of file gettod.c.

◆ net_times()

__BEGIN_DECLS W32_FUNC unsigned long W32_CALL net_times ( struct tms * buffer )

Definition at line 75 of file nettime.c.


Watt-32 tcp/ip: E:/WATT/inc/sys/wtypes.h File Reference

  • inc
  • sys
Data Structures | Typedefs
wtypes.h File Reference

Go to the source code of this file.

Data Structures

struct | iovec
struct | fd_set
struct | selinfo
struct | ifprefix
struct | osockaddr
struct | callout

Typedefs

typedef unsigned long long | u_int64_t
typedef unsigned char | u_char
typedef unsigned short | u_short
typedef unsigned short | ushort
typedef unsigned long | u_long
typedef unsigned long | u_int
typedef char * | caddr_t
typedef long | daddr_t
typedef unsigned char | u_int8_t
typedef unsigned short | u_int16_t
typedef unsigned long | u_int32_t
typedef short | int16_t
typedef long | int32_t
typedef int | socklen_t
typedef unsigned short | sa_family_t
typedef struct fd_set | fd_set
typedef int(W32_CALL * | icmp_upcall) (void *socket, BYTE icmp_type, BYTE icmp_code)

Detailed Description

Watt-32 type definitions.

Definition in file wtypes.h.

Typedef Documentation

◆ caddr_t

typedef char* caddr_t

Definition at line 176 of file wtypes.h.

◆ daddr_t

typedef long daddr_t

Definition at line 182 of file wtypes.h.

◆ icmp_upcall

typedef int(W32_CALL * icmp_upcall) (void *socket, BYTE icmp_type, BYTE icmp_code)

Definition at line 347 of file wtypes.h.

◆ int16_t

typedef short int16_t

Definition at line 201 of file wtypes.h.

◆ int32_t

typedef long int32_t

Definition at line 206 of file wtypes.h.

◆ sa_family_t

typedef _BSD_SA_FAMILY_T_ sa_family_t

Definition at line 234 of file wtypes.h.

◆ socklen_t

typedef int socklen_t

Definition at line 229 of file wtypes.h.

◆ u_char

typedef unsigned char u_char

Definition at line 142 of file wtypes.h.

◆ u_int

typedef unsigned int u_int

Definition at line 166 of file wtypes.h.

◆ u_int16_t

typedef unsigned short u_int16_t

Definition at line 192 of file wtypes.h.

◆ u_int32_t

typedef unsigned long u_int32_t

Definition at line 196 of file wtypes.h.

◆ u_int64_t

typedef unsigned __int64 u_int64_t

Definition at line 119 of file wtypes.h.

◆ u_int8_t

typedef unsigned char u_int8_t

Definition at line 188 of file wtypes.h.

◆ u_long

typedef unsigned long u_long

Definition at line 159 of file wtypes.h.

◆ u_short

typedef unsigned short u_short

Definition at line 148 of file wtypes.h.

◆ ushort

typedef unsigned short ushort

Definition at line 154 of file wtypes.h.


Watt-32 tcp/ip: E:/WATT/inc/w32-fakes Directory Reference

  • inc
  • w32-fakes
w32-fakes Directory Reference
Directory dependency graph for w32-fakes:

Files

file | winsock.h [code]
file | winsock2.h [code]
file | ws2tcpip.h [code]


Watt-32 tcp/ip: E:/WATT/inc/w32-fakes/winsock.h Source File

  • inc
  • w32-fakes
winsock.h
1#ifndef _WATT32_FAKE_WINSOCK_H
2#define _WATT32_FAKE_WINSOCK_H
3
4#ifndef __SYS_W32API_H
5#include <sys/w32api.h>
6#endif
7
8#ifndef __SYS_SOCKET_H
9#include <sys/socket.h>
10#endif
11
12#ifndef __SYS_WERRNO_H
13#include <sys/werrno.h>
14#endif
15
16#if !defined(WIN32) && !defined(_WIN32)
17#error This file is only for Watt-32 targeting Windows programs.
18#endif
19
20#if !defined(_WATT32_FAKE_WINSOCK2_H)
21
22#define WSADESCRIPTION_LEN 256
23#define WSASYS_STATUS_LEN 128
24
25__BEGIN_DECLS
26
27typedef struct WSAData {
28 unsigned short wVersion;
29 unsigned short wHighVersion;
30 char szDescription [WSADESCRIPTION_LEN+1];
31 char szSystemStatus [WSASYS_STATUS_LEN+1];
32 unsigned short iMaxSockets;
33 unsigned short iMaxUdpDg;
34 char *lpVendorInfo;
35 } WSADATA, *LPWSADATA;
36
37W32_FUNC int __stdcall WSAStartup (unsigned short wVersionRequired,
38 WSADATA *WSAData);
39
40W32_FUNC int __stdcall WSACleanup (void);
41
42#ifndef FD_SETSIZE
43#define FD_SETSIZE 64
44#endif
45
46/*
47 * Needed if user compiled with the normal <winsock*.h> and just relinked
48 * with Watt-32 (import) library.
49 */
50typedef struct winsock_fd_set {
51 unsigned int fd_count; /* how many are SET? */
52 int fd_array [FD_SETSIZE]; /* an array of sockets */
53 } winsock_fd_set;
54
55W32_FUNC int __stdcall __WSAFDIsSet (int s, winsock_fd_set *fd);
56
57__END_DECLS
58
59#endif /* _WATT32_FAKE_WINSOCK2_H */
60#endif /* _WATT32_FAKE_WINSOCK_H */
61
socket.h
WSAData
Definition: winsock.h:27
winsock_fd_set
Definition: winsock.h:50
w32api.h
werrno.h


Watt-32 tcp/ip: E:/WATT/inc/w32-fakes/winsock2.h Source File

  • inc
  • w32-fakes
winsock2.h
1#ifndef _WATT32_FAKE_WINSOCK2_H
2#define _WATT32_FAKE_WINSOCK2_H
3
4#ifndef __SYS_W32API_H
5#include <sys/w32api.h>
6#endif
7
8#ifndef __SYS_SOCKET_H
9#include <sys/socket.h>
10#endif
11
12#ifndef __SYS_WERRNO_H
13#include <sys/werrno.h>
14#endif
15
16#if !defined(WIN32) && !defined(_WIN32)
17#error This file is only for Watt-32 targeting Windows programs.
18#endif
19
20#if !defined(_WATT32_FAKE_WINSOCK_H)
21
22__BEGIN_DECLS
23
24typedef struct _SOCKET_ADDRESS {
25 struct sockaddr lpSockaddr;
26 int iSockaddrLength;
27 } SOCKET_ADDRESS, *PSOCKET_ADDRESS, *LPSOCKET_ADDRESS;
28
29#define WSADESCRIPTION_LEN 256
30#define WSASYS_STATUS_LEN 128
31
32typedef struct WSAData {
33 unsigned short wVersion;
34 unsigned short wHighVersion;
35 char szDescription[WSADESCRIPTION_LEN+1];
36 char szSystemStatus[WSASYS_STATUS_LEN+1];
37 unsigned short iMaxSockets;
38 unsigned short iMaxUdpDg;
39 char *lpVendorInfo;
40 } WSADATA, *LPWSADATA;
41
42W32_FUNC int __stdcall WSAStartup (unsigned short wVersionRequired,
43 WSADATA *WSAData);
44
45W32_FUNC int __stdcall WSACleanup (void);
46
47#ifndef FD_SETSIZE
48#define FD_SETSIZE 64
49#endif
50
51/*
52 * Needed if user compiled with the normal <winsock*.h> and just relinked
53 * with Watt-32 (import) library.
54 */
55typedef struct winsock_fd_set {
56 unsigned int fd_count; /* how many are SET? */
57 int fd_array [FD_SETSIZE]; /* an array of sockets */
58 } winsock_fd_set;
59
60W32_FUNC int __stdcall __WSAFDIsSet (int s, winsock_fd_set *fd);
61
62__END_DECLS
63
64#endif /* _WATT32_FAKE_WINSOCK_H */
65#endif /* _WATT32_FAKE_WINSOCK2_H */
66
socket.h
_SOCKET_ADDRESS
Definition: winsock2.h:24
WSAData
Definition: winsock.h:27
sockaddr
Definition: socket.h:181
winsock_fd_set
Definition: winsock.h:50
w32api.h
werrno.h


Watt-32 tcp/ip: E:/WATT/inc/w32-fakes/ws2tcpip.h Source File

  • inc
  • w32-fakes
ws2tcpip.h
1#ifndef _WATT32_FAKE_WS2TCPIP_H
2#define _WATT32_FAKE_WS2TCPIP_H
3
4#ifndef __SYS_SOCKET_H
5#include <sys/socket.h>
6#endif
7
8#if !defined(WIN32) && !defined(_WIN32)
9#error This file is only for Watt-32 targeting Windows programs.
10#endif
11
12#endif
13
socket.h


Watt-32 tcp/ip: E:/WATT/inc/check_hdr.c Source File

  • inc
check_hdr.c
1 /* Generated file. NO NOT EDIT!
2 */
3 #if defined(__clang__)
4 #pragma clang diagnostic ignored "-Wreserved-id-macro"
5 #pragma clang diagnostic ignored "-Wstrict-prototypes"
6 #pragma clang diagnostic ignored "-Wzero-length-array"
7 #pragma clang diagnostic ignored "-Wnonportable-system-include-path"
8
9 #if (__clang_major__ >= 13)
10 #pragma clang diagnostic ignored "-Wreserved-identifier"
11 //#pragma clang diagnostic ignored "-Wc2x-compat"
12 #endif
13 #endif
14
15 #include <tcp.h>
16
17 W32_GCC_PRAGMA (clang diagnostic ignored "-Wvisibility")
18 W32_GCC_PRAGMA (clang diagnostic ignored "-Wpragma-pack")
19
20 #include <sys/wtypes.h>
21 #include <sys/werrno.h>
22 #include <sys/whide.h>
23 #include <sys/wtime.h>
24
25 #include <err.h>
26 #include <netdb.h>
27 #include <poll.h>
28 #include <resolv.h>
29 #include <syslog.h>
30
31 #include <arpa/ftp.h>
32 #include <arpa/inet.h>
33 #include <arpa/nameser.h>
34 #include <arpa/telnet.h>
35 #include <arpa/tftp.h>
36
37 #include <net/bpf.h>
38 #include <net/bpfdesc.h>
39 #include <net/ethertyp.h>
40 #include <net/if.h>
41 #include <net/if_arc.h>
42 #include <net/if_arp.h>
43 #include <net/if_atm.h>
44 #include <net/if_dl.h>
45 #include <net/if_ether.h>
46 #include <net/if_fddi.h>
47 #include <net/if_llc.h>
48 #include <net/if_media.h>
49 #include <net/if_packe.h>
50 #include <net/if_packet.h>
51 #include <net/if_ppp.h>
52 #include <net/if_pppva.h>
53 #include <net/if_slvar.h>
54 #include <net/if_strip.h>
55 #include <net/if_tun.h>
56 #include <net/if_types.h>
57 #include <net/netisr.h>
58 #include <net/pfil.h>
59 #include <net/ppp-comp.h>
60 #include <net/ppp_defs.h>
61 #include <net/radix.h>
62 #include <net/raw_cb.h>
63 #include <net/route.h>
64 #include <net/slcompre.h>
65 #include <net/slip.h>
66
67 #include <netinet/icmp6.h>
68 #include <netinet/icmp_var.h>
69 #include <netinet/if_ether.h>
70 #include <netinet/if_fddi.h>
71 #include <netinet/igmp.h>
72 #include <netinet/igmp_var.h>
73 #include <netinet/ip.h>
74 #include <netinet/in.h>
75 #include <netinet/in_pcb.h>
76 #include <netinet/in_systm.h>
77 #include <netinet/in_var.h>
78 #include <netinet/ip6.h>
79 #include <netinet/ipv6.h>
80 #include <netinet/ip_fw.h>
81 #include <netinet/ip_icmp.h>
82 #include <netinet/ip_mrout.h>
83 #include <netinet/ip_var.h>
84 #include <netinet/tcp.h>
85 #include <netinet/tcpip.h>
86 #include <netinet/tcp_debu.h>
87 #include <netinet/tcp_fsm.h>
88 #include <netinet/tcp_scor.h>
89 #include <netinet/tcp_seq.h>
90 #include <netinet/tcp_time.h>
91 #include <netinet/tcp_var.h>
92 #include <netinet/udp.h>
93 #include <netinet/udp_var.h>
94
95 #include <netinet6/ipsec.h>
96 #include <netinet6/ipsec6.h>
97
98 #include <netinet6/ah.h>
99 #include <netinet6/ah6.h>
100 #include <netinet6/esp.h>
101 #include <netinet6/esp6.h>
102 #include <netinet6/esp_rijn.h>
103 #include <netinet6/in6.h>
104 #include <netinet6/in6_gif.h>
105 #include <netinet6/in6_ifat.h>
106 #include <netinet6/in6_pcb.h>
107 #include <netinet6/in6_pref.h>
108 #include <netinet6/in6_var.h>
109 #include <netinet6/ip6proto.h>
110 #include <netinet6/ip6_ecn.h>
111 #include <netinet6/ip6_fw.h>
112 #include <netinet6/ip6_mrou.h>
113 #include <netinet6/ip6_var.h>
114 #include <netinet6/ipcomp.h>
115 #include <netinet6/ipcomp6.h>
116 #include <netinet6/mld6_var.h>
117 #include <netinet6/nd6.h>
118 #include <netinet6/pim6.h>
119 #include <netinet6/pim6_var.h>
120 #include <netinet6/raw_ip6.h>
121 #include <netinet6/scope6_v.h>
122 #include <netinet6/tcp6_var.h>
123 #include <netinet6/udp6_var.h>
124
125 #include <protocol/dumprest.h>
126 #include <protocol/routed.h>
127 #include <protocol/rwhod.h>
128 #include <protocol/talkd.h>
129 #include <protocol/timed.h>
130
131 #include <rpc/auth.h>
132 #include <rpc/auth_des.h>
133 #include <rpc/auth_uni.h>
134 #include <rpc/clnt.h>
135 #include <rpc/key_prot.h>
136 #include <rpc/pmap_cln.h>
137 #include <rpc/pmap_pro.h>
138 #include <rpc/pmap_rmt.h>
139 #include <rpc/rpc.h>
140 #include <rpc/rpc_msg.h>
141 #include <rpc/svc.h>
142 #include <rpc/svc_auth.h>
143 #include <rpc/types.h>
144 #include <rpc/xdr.h>
145 #include <rpcsvc/ypclnt.h>
146 #include <rpcsvc/yp_prot.h>
147
148 #include <sys/cdefs.h>
149 #include <sys/errno.h>
150 #include <sys/ioctl.h>
151 #include <sys/mbuf.h>
152 #include <sys/param.h>
153 #include <sys/poll.h>
154 #include <sys/queue.h>
155 #include <sys/select.h>
156 #include <sys/socket.h>
157 #include <sys/so_ioctl.h>
158 #include <sys/swap.h>
159 #include <sys/syslog.h>
160 #include <sys/uio.h>
161 #include <sys/un.h>
162 #include <sys/w32api.h>
163
164 #include <w32-fakes/winsock.h>
165 #include <w32-fakes/winsock2.h>
166 #include <w32-fakes/ws2tcpip.h>
ah6.h
ah.h
auth.h
auth_des.h
auth_uni.h
bpf.h
bpfdesc.h
cdefs.h
clnt.h
dumprest.h
err.h
errno.h
esp6.h
esp.h
esp_rijn.h
ethertyp.h
ftp.h
icmp6.h
icmp_var.h
if.h
if_arc.h
if_arp.h
if_atm.h
if_dl.h
if_llc.h
if_media.h
if_packe.h
if_packet.h
if_ppp.h
if_pppva.h
if_slvar.h
if_strip.h
if_tun.h
if_types.h
igmp.h
igmp_var.h
in6.h
in6_gif.h
in6_ifat.h
in6_pcb.h
in6_pref.h
in6_var.h
in.h
in_pcb.h
in_systm.h
in_var.h
tftp.h
socket.h
inet.h
ioctl.h
ip6.h
ip6_ecn.h
ip6_fw.h
ip6_mrou.h
ip6_var.h
ip6proto.h
ip.h
ip_fw.h
ip_icmp.h
ip_mrout.h
ip_var.h
ipcomp6.h
ipcomp.h
ipsec6.h
ipsec.h
ipv6.h
key_prot.h
mld6_var.h
nameser.h
nd6.h
netdb.h
if_ether.h
if_fddi.h
tcp.h
netisr.h
param.h
pfil.h
pim6.h
pim6_var.h
pmap_cln.h
pmap_pro.h
pmap_rmt.h
ppp-comp.h
ppp_defs.h
queue.h
radix.h
raw_cb.h
raw_ip6.h
resolv.h
route.h
routed.h
rpc.h
rpc_msg.h
rwhod.h
scope6_v.h
select.h
slcompre.h
slip.h
so_ioctl.h
svc.h
svc_auth.h
swap.h
poll.h
syslog.h
talkd.h
tcp6_var.h
tcp_debu.h
tcp_fsm.h
tcp_scor.h
tcp_seq.h
tcp_time.h
tcp_var.h
tcpip.h
telnet.h
timed.h
types.h
udp6_var.h
udp.h
udp_var.h
uio.h
un.h
w32api.h
werrno.h
whide.h
wtime.h
xdr.h
yp_prot.h
ypclnt.h


Watt-32 tcp/ip: E:/WATT/inc/err.h File Reference

  • inc
err.h File Reference

Go to the source code of this file.

Detailed Description

Compatibility header (for Net/FreeBSD programs)

Definition in file err.h.


Watt-32 tcp/ip: E:/WATT/inc/netdb.h File Reference

  • inc
Data Structures | Functions | Variables
netdb.h File Reference

Go to the source code of this file.

Data Structures

struct | hostent
struct | netent
struct | servent
struct | protoent
struct | addrinfo

Functions

__BEGIN_DECLS W32_FUNC void W32_CALL | endhostent (void)
W32_FUNC void W32_CALL | endhostent6 (void)
W32_FUNC void W32_CALL | endnetent (void)
W32_FUNC void W32_CALL | endprotoent (void)
W32_FUNC void W32_CALL | endservent (void)
W32_FUNC struct hostent *W32_CALL | gethostbyaddr (const char *, socklen_t, int)
W32_FUNC struct hostent *W32_CALL | gethostbyaddr6 (const void *)
W32_FUNC struct hostent *W32_CALL | gethostbyname (const char *name)
W32_FUNC struct hostent *W32_CALL | gethostbyname2 (const char *name, int af)
W32_FUNC struct hostent *W32_CALL | gethostbyname6 (const char *name)
W32_FUNC struct hostent *W32_CALL | gethostent (void)
Return the next (non-commented) line from the host-file.
W32_FUNC struct hostent *W32_CALL | gethostent6 (void)
W32_FUNC struct hostent *W32_CALL | getipnodebyaddr (const void *, size_t, int, int *)
W32_FUNC struct hostent *W32_CALL | getipnodebyname (const char *, int, int, int *)
W32_FUNC struct netent *W32_CALL | getnetbyaddr (long, int)
W32_FUNC struct netent *W32_CALL | getnetbyname (const char *)
W32_FUNC struct netent *W32_CALL | getnetent (void)
W32_FUNC struct protoent *W32_CALL | getprotobyname (const char *)
W32_FUNC struct protoent *W32_CALL | getprotobynumber (int)
W32_FUNC struct protoent *W32_CALL | getprotoent (void)
W32_FUNC struct servent *W32_CALL | getservbyname (const char *, const char *)
W32_FUNC struct servent *W32_CALL | getservbyport (int, const char *)
W32_FUNC struct servent *W32_CALL | getservent (void)
W32_FUNC void W32_CALL | herror (const char *)
W32_FUNC const char *W32_CALL | hstrerror (int)
W32_FUNC void W32_CALL | sethostent (int stayopen)
W32_FUNC void W32_CALL | sethostent6 (int stayopen)
W32_FUNC void W32_CALL | setnetent (int)
W32_FUNC void W32_CALL | setprotoent (int)
W32_FUNC void W32_CALL | setservent (int)
W32_FUNC int W32_CALL | getnameinfo (const struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags)
W32_FUNC int W32_CALL | getaddrinfo (const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res)
W32_FUNC void W32_CALL | freeaddrinfo (struct addrinfo *ai)
W32_FUNC void W32_CALL | freehostent (struct hostent *)
W32_FUNC char *W32_CALL | gai_strerror (int ecode)
W32_FUNC int W32_CALL | if_nametoindex (const char *)
W32_FUNC char *W32_CALL | if_indextoname (int, char *)
W32_FUNC int *W32_CALL | __h_errno_location (void)
W32_FUNC int W32_CALL | gethostbyaddr_r (const void *addr, socklen_t len, int type, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop)
W32_FUNC int W32_CALL | gethostbyname_r (const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop)
W32_FUNC int W32_CALL | gethostent_r (struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop)
W32_FUNC int W32_CALL | getnetbyaddr_r (u_int32_t net, int type, struct netent *result_buf, char *buf, size_t buflen, struct netent **result, int *h_errnop)
W32_FUNC int W32_CALL | getnetbyname_r (const char *name, struct netent *result_buf, char *buf, size_t buflen, struct netent **result, int *h_errnop)
W32_FUNC int W32_CALL | getnetent_r (struct netent *result_buf, char *buf, size_t buflen, struct netent **result, int *h_errnop)
W32_FUNC int W32_CALL | getprotobyname_r (const char *name, struct protoent *result_buf, char *buf, size_t buflen, struct protoent **result)
W32_FUNC int W32_CALL | getprotobynumber_r (int proto, struct protoent *result_buf, char *buf, size_t buflen, struct protoent **result)
W32_FUNC int W32_CALL | getprotoent_r (struct protoent *result_buf, char *buf, size_t buflen, struct protoent **result)
W32_FUNC int W32_CALL | getservbyname_r (const char *name, const char *proto, struct servent *result_buf, char *buf, size_t buflen, struct servent **result)
W32_FUNC int W32_CALL | getservbyport_r (int port, const char *proto, struct servent *result_buf, char *buf, size_t buflen, struct servent **result)
W32_FUNC int W32_CALL | getservent_r (struct servent *result_buf, char *buf, size_t buflen, struct servent **result)
W32_FUNC int W32_CALL | sethostent_r (int stay_open, struct hostent *buffer)
W32_FUNC int W32_CALL | endhostent_r (struct hostent *buffer)
W32_FUNC int W32_CALL | setprotoent_r (int stay_open, struct protoent *buffer)
W32_FUNC int W32_CALL | endprotoent_r (struct protoent *buffer)

Variables

W32_DATA int h_errno

Detailed Description

BSD netdb functions.

Definition in file netdb.h.

Function Documentation

◆ __h_errno_location()

W32_FUNC int *W32_CALL __h_errno_location ( void )

Definition at line 638 of file gethost.c.

◆ endhostent()

__BEGIN_DECLS W32_FUNC void W32_CALL endhostent ( void )

Definition at line 486 of file gethost.c.

◆ endhostent6()

W32_FUNC void W32_CALL endhostent6 ( void )

Definition at line 402 of file gethost6.c.

◆ endnetent()

W32_FUNC void W32_CALL endnetent ( void )

Definition at line 286 of file getnet.c.

◆ endprotoent()

W32_FUNC void W32_CALL endprotoent ( void )

Definition at line 295 of file getprot.c.

◆ endservent()

W32_FUNC void W32_CALL endservent ( void )

Definition at line 319 of file getserv.c.

◆ freeaddrinfo()

W32_FUNC void W32_CALL freeaddrinfo ( struct addrinfo * ai )

Definition at line 245 of file get_ai.c.

◆ freehostent()

W32_FUNC void W32_CALL freehostent ( struct hostent * he )

Definition at line 241 of file get_ip.c.

◆ gai_strerror()

W32_FUNC char *W32_CALL gai_strerror ( int ecode )

Definition at line 178 of file get_ai.c.

◆ getaddrinfo()

W32_FUNC int W32_CALL getaddrinfo | ( | const char * | hostname,
 |  | const char * | servname,
 |  | const struct addrinfo * | hints,
 |  | struct addrinfo ** | res
 | ) |  |

Definition at line 307 of file get_ai.c.

◆ gethostbyaddr()

W32_FUNC struct hostent *W32_CALL gethostbyaddr | ( | const char * | addr_name,
 |  | socklen_t | len,
 |  | int | type
 | ) |  |

Definition at line 440 of file gethost.c.

◆ gethostbyaddr6()

W32_FUNC struct hostent *W32_CALL gethostbyaddr6 ( const void * addr )

Definition at line 430 of file gethost6.c.

◆ gethostbyname()

W32_FUNC struct hostent *W32_CALL gethostbyname ( const char * name )

Definition at line 275 of file gethost.c.

◆ gethostbyname2()

W32_FUNC struct hostent *W32_CALL gethostbyname2 | ( | const char * | name,
 |  | int | af
 | ) |  |

Definition at line 422 of file gethost.c.

◆ gethostbyname6()

W32_FUNC struct hostent *W32_CALL gethostbyname6 ( const char * name )

Definition at line 248 of file gethost6.c.

◆ gethostent()

W32_FUNC struct hostent *W32_CALL gethostent ( void )

Return the next (non-commented) line from the host-file.

Format is:

ip-address host-name [alias..] {\n | # ..}

Definition at line 219 of file gethost.c.

References _strlcpy(), isaddr(), netdb_init(), and strltrim().

◆ gethostent6()

W32_FUNC struct hostent *W32_CALL gethostent6 ( void )

Definition at line 196 of file gethost6.c.

◆ getipnodebyaddr()

W32_FUNC struct hostent *W32_CALL getipnodebyaddr | ( | const void * | src,
 |  | size_t | len,
 |  | int | af,
 |  | int * | error
 | ) |  |

Definition at line 163 of file get_ip.c.

◆ getipnodebyname()

W32_FUNC struct hostent *W32_CALL getipnodebyname | ( | const char * | name,
 |  | int | af,
 |  | int | flags,
 |  | int * | error
 | ) |  |

Definition at line 64 of file get_ip.c.

◆ getnameinfo()

W32_FUNC int W32_CALL getnameinfo | ( | const struct sockaddr * | sa,
 |  | socklen_t | salen,
 |  | char * | host,
 |  | socklen_t | hostlen,
 |  | char * | serv,
 |  | socklen_t | servlen,
 |  | int | flags
 | ) |  |

Definition at line 113 of file get_ni.c.

◆ getnetbyaddr()

W32_FUNC struct netent *W32_CALL getnetbyaddr | ( | long | net,
 |  | int | type
 | ) |  |

Definition at line 255 of file getnet.c.

◆ getnetbyname()

W32_FUNC struct netent *W32_CALL getnetbyname ( const char * name )

Definition at line 230 of file getnet.c.

◆ getnetent()

W32_FUNC struct netent *W32_CALL getnetent ( void )

Definition at line 180 of file getnet.c.

◆ getprotobyname()

W32_FUNC struct protoent *W32_CALL getprotobyname ( const char * proto )

Definition at line 215 of file getprot.c.

◆ getprotobynumber()

W32_FUNC struct protoent *W32_CALL getprotobynumber ( int proto )

Definition at line 262 of file getprot.c.

◆ getprotoent()

W32_FUNC struct protoent *W32_CALL getprotoent ( void )

Definition at line 166 of file getprot.c.

◆ getservbyname()

W32_FUNC struct servent *W32_CALL getservbyname | ( | const char * | serv,
 |  | const char * | proto
 | ) |  |

Definition at line 253 of file getserv.c.

◆ getservbyport()

W32_FUNC struct servent *W32_CALL getservbyport | ( | int | port,
 |  | const char * | proto
 | ) |  |

Definition at line 286 of file getserv.c.

◆ getservent()

W32_FUNC struct servent *W32_CALL getservent ( void )

Definition at line 181 of file getserv.c.

◆ herror()

W32_FUNC void W32_CALL herror ( const char * prefix )

Definition at line 115 of file res_data.c.

◆ hstrerror()

W32_FUNC const char *W32_CALL hstrerror ( int err )

Definition at line 127 of file res_data.c.

◆ if_indextoname()

W32_FUNC char *W32_CALL if_indextoname | ( | int | if_id,
 |  | char * | if_name
 | ) |  |

Definition at line 202 of file get_ai.c.

◆ if_nametoindex()

W32_FUNC int W32_CALL if_nametoindex ( const char * if_name )

Definition at line 190 of file get_ai.c.

◆ sethostent()

W32_FUNC void W32_CALL sethostent ( int stayopen )

Definition at line 475 of file gethost.c.

◆ sethostent6()

W32_FUNC void W32_CALL sethostent6 ( int stayopen )

Definition at line 389 of file gethost6.c.

◆ setnetent()

W32_FUNC void W32_CALL setnetent ( int stayopen )

Definition at line 271 of file getnet.c.

◆ setprotoent()

W32_FUNC void W32_CALL setprotoent ( int stayopen )

Definition at line 281 of file getprot.c.

◆ setservent()

W32_FUNC void W32_CALL setservent ( int stayopen )

Definition at line 306 of file getserv.c.

Variable Documentation

◆ h_errno

W32_DATA int h_errno

Definition at line 152 of file netdb.h.


Watt-32 tcp/ip: E:/WATT/inc/poll.h File Reference

  • inc
poll.h File Reference

Go to the source code of this file.


Watt-32 tcp/ip: E:/WATT/inc/resolv.h File Reference

  • inc
Data Structures | Typedefs | Enumerations | Functions | Variables
resolv.h File Reference

Go to the source code of this file.

Data Structures

struct | __res_sort
struct | __res_state

Typedefs

typedef res_sendhookact(W32_CALL * | res_send_qhook) (struct sockaddr_in *const *ns, const u_char **query, int *querylen, u_char *ans, int anssiz, int *resplen)
typedef res_sendhookact(W32_CALL * | res_send_rhook) (const struct sockaddr_in *ns, const u_char *query, int querylen, u_char *ans, int anssiz, int *resplen)

Enumerations

enum res_sendhookact {
res_goahead ,
res_nextns ,
res_modified ,
res_done ,
res_error
}

Functions

__BEGIN_DECLS W32_FUNC int W32_CALL | __res_hnok (const char *)
W32_FUNC int W32_CALL | __res_ownok (const char *)
W32_FUNC int W32_CALL | __res_mailok (const char *)
W32_FUNC int W32_CALL | __res_dnok (const char *)
W32_FUNC int W32_CALL | __loc_aton (const char *ascii, u_char *binary)
W32_FUNC char *W32_CALL | __loc_ntoa (const u_char *binary, char *ascii)
W32_FUNC int W32_CALL | __dn_skipname (const u_char *, const u_char *)
W32_FUNC void W32_CALL | __fp_resstat (struct __res_state *, FILE *)
W32_FUNC void W32_CALL | __fp_query (const u_char *, FILE *)
W32_FUNC void W32_CALL | __fp_nquery (const u_char *, int, FILE *)
W32_FUNC char *W32_CALL | __hostalias (const char *)
W32_FUNC void W32_CALL | __putlong (u_long, u_char *)
W32_FUNC void W32_CALL | __putshort (u_short, u_char *)
W32_FUNC char *W32_CALL | __p_time (u_long)
W32_FUNC void W32_CALL | __p_query (const u_char *)
W32_FUNC const u_char *W32_CALL | __p_cdnname (const u_char *, const u_char *, int, FILE *)
W32_FUNC const u_char *W32_CALL | __p_cdname (const u_char *, const u_char *, FILE *)
W32_FUNC const u_char *W32_CALL | __p_fqname (const u_char *, const u_char *, FILE *)
W32_FUNC const u_char *W32_CALL | __p_rr (const u_char *, const u_char *, FILE *)
W32_FUNC const char *W32_CALL | __p_type (int)
W32_FUNC const char *W32_CALL | __p_class (int)
W32_FUNC const char *W32_CALL | __p_option (u_long option)
W32_FUNC int W32_CALL | dn_comp (const char *, u_char *, int, u_char **, u_char **)
W32_FUNC int W32_CALL | dn_expand (const u_char *, const u_char *, const u_char *, char *, int)
W32_FUNC int W32_CALL | res_init (void)
W32_FUNC u_short W32_CALL | res_randomid (void)
W32_FUNC int W32_CALL | res_query (const char *, int, int, u_char *, int)
W32_FUNC int W32_CALL | res_search (const char *, int, int, u_char *, int)
W32_FUNC int W32_CALL | res_querydomain (const char *, const char *, int, int, u_char *, int)
W32_FUNC int W32_CALL | res_mkquery (int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int)
W32_FUNC int W32_CALL | res_send (const u_char *, int, u_char *, int)
W32_FUNC int W32_CALL | res_isourserver (const struct sockaddr_in *)
W32_FUNC int W32_CALL | res_nameinquery (const char *, int, int, const u_char *, const u_char *)
W32_FUNC int W32_CALL | res_queriesmatch (const u_char *, const u_char *, const u_char *, const u_char *)
W32_FUNC void W32_CALL | res_send_setqhook (res_send_qhook hook)
W32_FUNC void W32_CALL | res_send_setrhook (res_send_rhook hook)

Variables

W32_DATA struct __res_state | _res
W32_DATA int | h_errno

Detailed Description

Resolver API.

Definition in file resolv.h.

Typedef Documentation

◆ res_send_qhook

typedef res_sendhookact(W32_CALL * res_send_qhook) (struct sockaddr_in *const *ns, const u_char **query, int *querylen, u_char *ans, int anssiz, int *resplen)

Definition at line 193 of file resolv.h.

◆ res_send_rhook

typedef res_sendhookact(W32_CALL * res_send_rhook) (const struct sockaddr_in *ns, const u_char *query, int querylen, u_char *ans, int anssiz, int *resplen)

Definition at line 201 of file resolv.h.

Enumeration Type Documentation

◆ res_sendhookact

enum res_sendhookact

Definition at line 185 of file resolv.h.

Function Documentation

◆ __dn_skipname()

W32_FUNC int W32_CALL __dn_skipname | ( | const u_char * | comp_dn,
 |  | const u_char * | eom
 | ) |  |

Definition at line 258 of file res_comp.c.

◆ __fp_nquery()

W32_FUNC void W32_CALL __fp_nquery | ( | const u_char * | msg,
 |  | int | len,
 |  | FILE * | file
 | ) |  |

Definition at line 206 of file res_debu.c.

◆ __fp_query()

W32_FUNC void W32_CALL __fp_query | ( | const u_char * | msg,
 |  | FILE * | file
 | ) |  |

Definition at line 334 of file res_debu.c.

◆ __fp_resstat()

W32_FUNC void W32_CALL __fp_resstat | ( | struct __res_state * | statp,
 |  | FILE * | file
 | ) |  |

Definition at line 189 of file res_debu.c.

◆ __hostalias()

W32_FUNC char *W32_CALL __hostalias ( const char * name )

Definition at line 367 of file res_quer.c.

◆ __p_cdname()

W32_FUNC const u_char *W32_CALL __p_cdname | ( | const u_char * | cp,
 |  | const u_char * | msg,
 |  | FILE * | file
 | ) |  |

Definition at line 354 of file res_debu.c.

◆ __p_cdnname()

W32_FUNC const u_char *W32_CALL __p_cdnname | ( | const u_char * | cp,
 |  | const u_char * | msg,
 |  | int | len,
 |  | FILE * | file
 | ) |  |

Definition at line 339 of file res_debu.c.

◆ __p_class()

W32_FUNC const char *W32_CALL __p_class ( int Class )

Definition at line 715 of file res_debu.c.

◆ __p_fqname()

W32_FUNC const u_char *W32_CALL __p_fqname | ( | const u_char * | cp,
 |  | const u_char * | msg,
 |  | FILE * | file
 | ) |  |

Definition at line 362 of file res_debu.c.

◆ __p_option()

W32_FUNC const char *W32_CALL __p_option ( u_long option )

Definition at line 734 of file res_debu.c.

◆ __p_query()

W32_FUNC void W32_CALL __p_query ( const u_char * msg )

Definition at line 179 of file res_debu.c.

◆ __p_rr()

W32_FUNC const u_char *W32_CALL __p_rr | ( | const u_char * | cp,
 |  | const u_char * | msg,
 |  | FILE * | file
 | ) |  |

Definition at line 384 of file res_debu.c.

◆ __p_time()

W32_FUNC char *W32_CALL __p_time ( u_long value )

Definition at line 760 of file res_debu.c.

◆ __p_type()

W32_FUNC const char *W32_CALL __p_type ( int type )

Definition at line 662 of file res_debu.c.

◆ __putlong()

W32_FUNC void W32_CALL __putlong | ( | u_long | var,
 |  | u_char * | ptr
 | ) |  |

Definition at line 99 of file getput.c.

◆ __putshort()

W32_FUNC void W32_CALL __putshort | ( | u_short | var,
 |  | u_char * | ptr
 | ) |  |

Definition at line 94 of file getput.c.

◆ dn_comp()

W32_FUNC int W32_CALL dn_comp | ( | const char * | exp_dn,
 |  | u_char * | comp_dn,
 |  | int | length,
 |  | u_char ** | dnptrs,
 |  | u_char ** | lastdnptr
 | ) |  |

Definition at line 163 of file res_comp.c.

◆ dn_expand()

W32_FUNC int W32_CALL dn_expand | ( | const u_char * | msg,
 |  | const u_char * | eom_orig,
 |  | const u_char * | comp_dn,
 |  | char * | exp_dn,
 |  | int | length
 | ) |  |

Definition at line 73 of file res_comp.c.

◆ res_init()

W32_FUNC int W32_CALL res_init ( void )

Definition at line 176 of file res_init.c.

◆ res_isourserver()

W32_FUNC int W32_CALL res_isourserver ( const struct sockaddr_in * inp )

Definition at line 131 of file res_send.c.

◆ res_mkquery()

W32_FUNC int W32_CALL res_mkquery | ( | int | op,
 |  | const char * | dname,
 |  | int | Class,
 |  | int | type,
 |  | const u_char * | data,
 |  | int | datalen,
 |  | const u_char * | newrr_in,
 |  | u_char * | buf,
 |  | int | buflen
 | ) |  |
Todo:
Handle STATUS case

Definition at line 67 of file res_mkqu.c.

References HEADER::ancount, HEADER::arcount, HEADER::id, HEADER::opcode, HEADER::qdcount, HEADER::rcode, and HEADER::rd.

◆ res_nameinquery()

W32_FUNC int W32_CALL res_nameinquery | ( | const char * | name,
 |  | int | type,
 |  | int | Class,
 |  | const u_char * | buf,
 |  | const u_char * | eom
 | ) |  |

Definition at line 159 of file res_send.c.

◆ res_queriesmatch()

W32_FUNC int W32_CALL res_queriesmatch | ( | const u_char * | buf1,
 |  | const u_char * | eom1,
 |  | const u_char * | buf2,
 |  | const u_char * | eom2
 | ) |  |

Definition at line 196 of file res_send.c.

◆ res_query()

W32_FUNC int W32_CALL res_query | ( | const char * | name,
 |  | int | Class,
 |  | int | type,
 |  | u_char * | answer,
 |  | int | anslen
 | ) |  |

Definition at line 80 of file res_quer.c.

◆ res_querydomain()

W32_FUNC int W32_CALL res_querydomain | ( | const char * | name,
 |  | const char * | domain,
 |  | int | Class,
 |  | int | type,
 |  | u_char * | answer,
 |  | int | anslen
 | ) |  |

Definition at line 322 of file res_quer.c.

◆ res_randomid()

W32_FUNC u_short W32_CALL res_randomid ( void )

Definition at line 149 of file res_init.c.

◆ res_search()

W32_FUNC int W32_CALL res_search | ( | const char * | name,
 |  | int | Class,
 |  | int | type,
 |  | u_char * | answer,
 |  | int | anslen
 | ) |  |

Definition at line 153 of file res_quer.c.

◆ res_send()

W32_FUNC int W32_CALL res_send | ( | const u_char * | buf,
 |  | int | buflen,
 |  | u_char * | ans,
 |  | int | anssiz
 | ) |  |

Definition at line 233 of file res_send.c.

◆ res_send_setqhook()

W32_FUNC void W32_CALL res_send_setqhook ( res_send_qhook hook )

Definition at line 112 of file res_send.c.

◆ res_send_setrhook()

W32_FUNC void W32_CALL res_send_setrhook ( res_send_rhook hook )

Definition at line 117 of file res_send.c.

Variable Documentation

◆ _res

W32_DATA struct __res_state _res

Definition at line 209 of file resolv.h.

◆ h_errno

W32_DATA int h_errno

Definition at line 211 of file resolv.h.


Watt-32 tcp/ip: E:/WATT/inc/syslog.h File Reference

  • inc
syslog.h File Reference

Go to the source code of this file.

Detailed Description

syslog header.

Definition in file syslog.h.


Watt-32 tcp/ip: E:/WATT/inc/tcp.h File Reference

  • inc
Data Structures | Typedefs | Enumerations | Functions | Variables
tcp.h File Reference

Watt-32 public API. More...

Go to the source code of this file.

Data Structures

struct | tcp_Socket
struct | udp_Socket
ARP definitions. More...
struct | config_table
struct | watt_sockaddr
struct | PktStats
struct | PktParameters

Typedefs

typedef void | sock_type
typedef void | in_Header
typedef void | udp_Header
typedef void | tcp_Header
typedef long(W32_CALL * | WattUserConfigFunc) (int pass, const struct config_table *cfg)
typedef int(W32_CALL * | WattDHCPConfigFunc) (enum DHCP_config_op op, struct DHCP_config *cfg)

Enumerations

enum config_tab_types {
ARG_ATOI ,
ARG_ATOB ,
ARG_ATOW ,
ARG_ATOIP ,
ARG_ATOX_B ,
ARG_ATOX_W ,
ARG_ATOX_D ,
ARG_STRDUP ,
ARG_STRCPY ,
ARG_RESOLVE ,
ARG_FUNC
}
Convert 'arg_func' below to this type. More...
enum CHK_SOCKET_VAL {
VALID_UDP = 1 ,
VALID_TCP ,
VALID_IP4 ,
VALID_IP6
}
enum TCP_SIMPLE_STATE {
TCP_CLOSED ,
TCP_LISTENING ,
TCP_OPENING ,
TCP_OPEN ,
TCP_CLOSING
}
enum _watt_optmode {
GETOPT_UNIX ,
GETOPT_ANY ,
GETOPT_KEEP
}

Functions

W32_FUNC const char *W32_CALL | wattcpVersion (void)
Return string for Watt-32 version.
W32_FUNC const char *W32_CALL | wattcpCapabilities (void)
Return compiled-in capabilities and features.
W32_FUNC const char *W32_CALL | wattcpBuildCC (void)
Return the target/compiler.
W32_FUNC const char *W32_CALL | wattcpBuildCCexe (void)
Return the the name if the compiler used.
W32_FUNC const char *W32_CALL | wattcpBuildCflags (void)
W32_COMPILE_TIME_ASSERT (tcp_Socket, sizeof(tcp_Socket)<=W32_UNDOC_TCP_SOCKET_SIZE)
W32_COMPILE_TIME_ASSERT (udp_Socket, sizeof(udp_Socket)<=W32_UNDOC_UDP_SOCKET_SIZE)
W32_FUNC int W32_CALL | watt_sock_init (size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
W32_FUNC const char *W32_CALL | sock_init_err (int rc)
W32_FUNC void MS_CDECL | sock_exit (void)
Our only atexit() handler.
W32_FUNC void W32_CALL | dbug_init (void)
W32_FUNC void W32_CALL | init_misc (void)
Initialise various stuff.
W32_FUNC void W32_CALL | sock_sig_exit (const char *msg, int sigint)
Exit handler for unhandled signals.
W32_FUNC void W32_CALL | assert_fail_test (void)
W32_FUNC void W32_CALL | abort_test (void)
W32_FUNC void W32_CALL | leak_test (void)
W32_FUNC void W32_CALL | except_test (void)
W32_FUNC int W32_CALL | sock_read (sock_type *s, BYTE *dp, size_t len)
W32_FUNC int W32_CALL | sock_preread (const sock_type *s, BYTE *dp, int len)
W32_FUNC int W32_CALL | sock_fastread (sock_type *s, BYTE *dp, int len)
W32_FUNC int W32_CALL | sock_write (sock_type *s, const BYTE *dp, int len)
W32_FUNC int W32_CALL | sock_enqueue (sock_type *s, const BYTE *dp, int len)
W32_FUNC int W32_CALL | sock_fastwrite (sock_type *s, const BYTE *dp, int len)
W32_FUNC size_t W32_CALL | sock_setbuf (sock_type *s, BYTE *buf, size_t len)
W32_FUNC void W32_CALL | sock_flush (sock_type *s)
W32_FUNC void W32_CALL | sock_noflush (sock_type *s)
W32_FUNC void W32_CALL | sock_flushnext (sock_type *s)
W32_FUNC int W32_CALL | sock_puts (sock_type *s, const BYTE *dp)
W32_FUNC WORD W32_CALL | sock_gets (sock_type *s, BYTE *dp, int n)
W32_FUNC BYTE W32_CALL | sock_putc (sock_type *s, BYTE c)
W32_FUNC int W32_CALL | sock_getc (sock_type *s)
W32_FUNC WORD W32_CALL | sock_dataready (sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
W32_FUNC int W32_CALL | sock_established (sock_type *s)
W32_FUNC int W32_CALL | sock_close (sock_type *s)
W32_FUNC int W32_CALL | sock_abort (sock_type *s)
W32_FUNC WORD W32_CALL | sock_mode (sock_type *s, WORD mode)
W32_FUNC int W32_CALL | sock_sselect (const sock_type *s, int waitstate)
W32_FUNC int W32_CALL | sock_timeout (sock_type *s, int seconds)
W32_FUNC int W32_CALL | sock_recv (sock_type *s, void *buf, unsigned len)
W32_FUNC int W32_CALL | sock_recv_init (sock_type *s, void *buf, unsigned len)
W32_FUNC int W32_CALL | sock_recv_from (sock_type *s, DWORD *ip, WORD *port, void *buf, unsigned len, int peek)
W32_FUNC int W32_CALL | sock_recv_used (const sock_type *s)
W32_FUNC int W32_CALL | sock_keepalive (sock_type *s)
W32_FUNC size_t W32_CALL | sock_rbsize (const sock_type *s)
W32_FUNC size_t W32_CALL | sock_rbused (const sock_type *s)
W32_FUNC size_t W32_CALL | sock_rbleft (const sock_type *s)
W32_FUNC size_t W32_CALL | sock_tbsize (const sock_type *s)
W32_FUNC size_t W32_CALL | sock_tbused (const sock_type *s)
W32_FUNC size_t W32_CALL | sock_tbleft (const sock_type *s)
W32_FUNC int W32_CALL | sock_fgets (char *buf, int max, FILE *stream)
W32_FUNC int W32_CALL | sock_fputs (const char *text, FILE *stream)
W32_FUNC VoidProc W32_CALL | sock_yield (tcp_Socket *s, VoidProc fn)
W32_FUNC int MS_CDECL | sock_printf (sock_type *s, _Printf_format_string_ const char *fmt,...) W32_ATTR_PRINTF(2
W32_FUNC int MS_CDECL W32_FUNC int MS_CDECL | sock_scanf (sock_type *s, _Scanf_format_string_ const char *fmt,...) W32_ATTR_SCANF(2
W32_FUNC int MS_CDECL W32_FUNC int MS_CDECL W32_FUNC int W32_CALL | udp_open (udp_Socket *s, WORD lport, DWORD ina, WORD port, ProtoHandler handler)
W32_FUNC int W32_CALL | tcp_open (tcp_Socket *s, WORD lport, DWORD ina, WORD port, ProtoHandler handler)
Actively open a TCP connection.
W32_FUNC int W32_CALL | udp_listen (udp_Socket *s, WORD lport, DWORD ina, WORD port, ProtoHandler handler)
W32_FUNC int W32_CALL | tcp_listen (tcp_Socket *s, WORD lport, DWORD ina, WORD port, ProtoHandler handler, WORD timeout)
Passively opens TCP a connection.
W32_FUNC int W32_CALL | tcp_established (const tcp_Socket *s)
Returns 1 if TCP connection is established.
W32_FUNC int W32_CALL | tcp_cbreak (int mode)
Sets our break mode.
W32_FUNC char *W32_CALL | rip (char *s)
Removes end-of-line termination from a string.
W32_FUNC int W32_CALL | watt_kbhit (void)
A less CPU hogging kbhit().
W32_FUNC long W32_CALL | watt_filelength (int fd)
filelength() is needed in pcconfig.c and some applications.
W32_FUNC int W32_CALL | priv_addr (DWORD ip)
W32_FUNC int W32_CALL | tcp_cbrk (int mode)
Some deprecated functions.
W32_FUNC unsigned long W32_CALL | set_ttimeout (unsigned ticks)
W32_FUNC WORD W32_CALL | inchksum (const void *ptr, int len)
W32_FUNC const char *W32_CALL | tcp_md5_secret (tcp_Socket *s, const char *secret)
W32_FUNC void W32_CALL | make_md5_signature (const in_Header *ip, const tcp_Header *tcp, WORD datalen, const char *secret, BYTE *buf)
W32_FUNC BOOL W32_CALL | check_md5_signature (const tcp_Socket *s, const in_Header *ip)
W32_FUNC DWORD W32_CALL | set_timeout (DWORD msec)
Return time for when given timeout (msec) expires.
W32_FUNC int W32_CALL | chk_timeout (DWORD value)
Check if milli-sec value has expired:
W32_FUNC int W32_CALL | cmp_timers (DWORD t1, DWORD t2)
Compare two timers with expirary at 't1' and 't2'.
W32_FUNC int W32_CALL | set_timediff (long msec)
Must be called by user right before or after a time change occurs.
W32_FUNC long W32_CALL | get_timediff (DWORD now, DWORD t)
Return time difference between timers now and tim.
W32_FUNC int W32_CALL | hires_timer (int on)
Control use of high-resolution timer.
W32_FUNC double W32_CALL | timeval_diff (const struct timeval *a, const struct timeval *b)
Return difference (in micro-sec) between timevals *newer and *older.
W32_FUNC struct timeval W32_CALL | timeval_diff2 (struct timeval *a, struct timeval *b)
W32_FUNC void W32_CALL | init_timer_isr (void)
W32_FUNC void W32_CALL | exit_timer_isr (void)
W32_FUNC void W32_CALL | init_userSuppliedTimerTick (void)
init_userSuppliedTimerTick() - setup timer handling for programs that are already running a periodic interrupt or whatever (i.e.
W32_FUNC void W32_CALL | userTimerTick (DWORD)
Provide timer-ticks from an application.
W32_FUNC void W32_CALL | ip_timer_init (sock_type *s, unsigned delayseconds)
W32_FUNC int W32_CALL | ip_timer_expired (const sock_type *s)
W32_DATA | int (W32_CALL *loopback_handler)(in_Header *ip)
W32_FUNC void W32_CALL | sock_debugdump (const sock_type *s)
W32_FUNC long W32_CALL | tcp_config (const char *path)
W32_FUNC int W32_CALL | tcp_config_name (char *name, int max)
W32_FUNC WORD W32_CALL | tcp_tick (sock_type *s)
Must be called periodically by user application (or BSD socket API).
W32_FUNC void W32_CALL | tcp_set_debug_state (WORD x)
Old comptibility function.
W32_FUNC DWORD W32_CALL | resolve (const char *name)
Convert host name to an address.
W32_FUNC int W32_CALL | resolve_ip (DWORD ip, char *name, int len)
Resolve an IP-address to a name.
W32_FUNC int W32_CALL | resolve_ip6 (const char *name, void *addr)
W32_FUNC DWORD W32_CALL | lookup_host (const char *host, char *ip_str)
W32_FUNC const char *W32_CALL | dom_strerror (int err)
Return text for error code (dom_errno).
W32_FUNC char *W32_CALL | dom_remove_dot (char *name)
W32_FUNC int W32_CALL | _ip_delay0 (sock_type *s, int sec, UserHandler fn, int *statusptr)
W32_FUNC int W32_CALL | _ip_delay1 (sock_type *s, int sec, UserHandler fn, int *statusptr)
W32_FUNC int W32_CALL | _ip_delay2 (sock_type *s, int sec, UserHandler fn, int *statusptr)
W32_DATA | void (W32_CALL *usr_init)(const char *keyword
Hook to a function called after we're initialised.
W32_FUNC int W32_CALL | parse_config_table (const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
W32_FUNC void W32_CALL | tcp_inject_config (const struct config_table *cfg, const char *key, const char *value)
Callable from a user application to inject config values before the normal WATTCP.CFG is loaded and parsed.
W32_FUNC WattUserConfigFunc W32_CALL | _watt_user_config (WattUserConfigFunc fn)
A user application may call the ‘_watt_user_config()’ function prior to calling sock_init() to inject its own configuration values into the tcp_config() parser.
W32_CLANG_PACK_WARN_OFF () struct DHCP_config
W32_CLANG_PACK_WARN_DEF () enum DHCP_config_op
This hook is to prevent the BSD-socket API being linked in by default.
W32_FUNC WattDHCPConfigFunc W32_CALL | DHCP_set_config_func (WattDHCPConfigFunc fn)
Sets up an application hook for doing DHCP operations (DHCP_config_op)
W32_FUNC void W32_CALL | DHCP_release (BOOL force)
Possibly send a DHCP release.
W32_FUNC int W32_CALL | DHCP_read_config (void)
Called from watt_sock_init() after "\c WATTCP.CFG" has been parsed.
W32_FUNC DWORD W32_CALL | DHCP_get_server (void)
Return current DHCP server address.
W32_DATA | int (MS_CDECL *_printf)(_Printf_format_string_ const char *
W32_DATA | W32_ATTR_PRINTF (1, 2)
W32_FUNC void W32_CALL | outs (const char *s)
W32_FUNC void W32_CALL | outsnl (const char *s)
W32_FUNC void W32_CALL | outsn (const char *s, int n)
W32_FUNC void W32_CALL | outhexes (const char *s, int n)
W32_FUNC void W32_CALL | outhex (char ch)
W32_FUNC int W32_CALL | wintr_enable (void)
W32_FUNC void W32_CALL | wintr_disable (void)
W32_FUNC void W32_CALL | wintr_shutdown (void)
W32_FUNC void W32_CALL | wintr_init (void)
W32_FUNC int W32_CALL | _ping (DWORD host, DWORD num, const BYTE *pattern, size_t len)
Format and send an ICMP echo request (ping).
W32_FUNC DWORD W32_CALL | _chk_ping (DWORD host, DWORD *ping_num)
Check for ICMP echo reply in ping-cache.
W32_FUNC void W32_CALL | add_ping (DWORD host, DWORD tim, DWORD number)
Add an ICMP echo reply to the ping-cache.
W32_FUNC int W32_CALL | _eth_init (void)
Initialize the network driver interface.
W32_FUNC void W32_CALL | _eth_release (void)
Release the hardware driver.
W32_FUNC void *W32_CALL | _eth_formatpacket (const void *eth_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet.
W32_FUNC void W32_CALL | _eth_free (const void *buf)
Free an input buffer once it is no longer needed.
W32_FUNC void *W32_CALL | _eth_arrived (WORD *type, BOOL *brdcast)
Poll for arrival of new packets (IP/ARP/RARP/PPPoE protocol).
W32_FUNC int W32_CALL | _eth_send (WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
W32_FUNC int W32_CALL | _eth_set_addr (const void *addr)
Sets a new MAC address for our interface.
W32_FUNC BYTE W32_CALL | _eth_get_hwtype (BYTE *hwtype, BYTE *hwlen)
Fill in hardware address type/length for BOOTP/DHCP packets.
W32_DATA void *W32_CALL * | _eth_recv_hook (WORD *type)
W32_FUNC WORD W32_CALL | in_checksum (const void *buf, unsigned len)
This checksum routine is now used for all targets since in_checksum_fast() was removed.
W32_FUNC BOOL W32_CALL | _arp_resolve (DWORD ina, eth_address *eth)
The blocking lookup function visible to higher functions.
W32_FUNC int MS_CDECL | gui_printf (const char *fmt,...)
W32_FUNC char *W32_CALL | win_strerror (DWORD err)
Return err-number and string for 'err'.
W32_FUNC int W32_CALL | pkt_win_set_verbose_level (int level)
W32_FUNC int W32_CALL | pkt_win_get_verbose_level (void)
W32_FUNC int W32_CALL | pkt_win_print_GetIfTable (void)
W32_FUNC int W32_CALL | pkt_win_print_GetIfTable2 (void)
W32_FUNC int W32_CALL | pkt_win_print_GetIfTable2Ex (void)
W32_FUNC int W32_CALL | pkt_win_print_GetIpNetTable (void)
W32_FUNC int W32_CALL | pkt_win_print_GetIpNetTable2 (void)
W32_FUNC int W32_CALL | pkt_win_print_GetIpAddrTable (void)
W32_FUNC int W32_CALL | pkt_win_print_GetIpForwardTable2 (void)
W32_FUNC int W32_CALL | pkt_win_print_GetAdaptersAddresses (void)
W32_FUNC int W32_CALL | pkt_win_print_GetAdapterOrderMap (void)
W32_FUNC int W32_CALL | pkt_win_print_GetNetworkParams (void)
W32_FUNC int W32_CALL | pkt_win_print_RasEnumConnections (void)
W32_FUNC int W32_CALL | pkt_win_print_WlanEnumInterfaces (void)
W32_FUNC int W32_CALL | pkt_win_print_WSALookupServices (void)
W32_FUNC DWORD W32_CALL | _gethostid (void)
Core style: Returns local IPv4-address.
W32_FUNC DWORD W32_CALL | _sethostid (DWORD ip)
Core-style: Sets local IPv4-address.
W32_FUNC int W32_CALL | _getsockname (const sock_type *s, void *dest, int *len)
Core-style:
Return 'watt_sockaddr' for our side of a UDP/TCP connection.
W32_FUNC int W32_CALL | _getpeername (const sock_type *s, void *dest, int *len)
Core-style:
Return 'watt_sockaddr' for peer in a UDP/TCP connection.
W32_FUNC int W32_CALL | _chk_socket (const sock_type *s)
W32_FUNC void W32_CALL | psocket (const sock_type *s)
W32_FUNC void W32_CALL | sock_sturdy (sock_type *s, int level)
Keep the socket open inspite of receiving "ICMP Unreachable" For UDP or TCP socket.
W32_FUNC const char *W32_CALL | sockerr (const sock_type *s)
W32_FUNC void W32_CALL | sockerr_clear (sock_type *s)
W32_FUNC const char *W32_CALL | sockstate (const sock_type *s)
W32_FUNC enum TCP_SIMPLE_STATE W32_CALL | tcp_simple_state (const tcp_Socket *s)
W32_FUNC char *W32_CALL | _inet_ntoa (char *s, DWORD x)
Convert an IP-address 'ip' into a string.
W32_FUNC DWORD W32_CALL | _inet_addr (const char *name)
Convert a string into an IP-address.
W32_FUNC DWORD W32_CALL | aton (const char *name)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
W32_FUNC int W32_CALL | isaddr (const char *name)
Check if 'str' is simply an ip address.
W32_FUNC DWORD W32_CALL | aton_dotless (const char *str)
Converts ‘[dotless]’ or ‘dotless’ to 32 bit long (host order)
W32_FUNC BOOL W32_CALL | isaddr_dotless (const char *str, DWORD *ip)
Check if 'str' is a dotless ip address.
W32_FUNC int W32_CALL | addwattcpd (VoidProc p)
W32_FUNC int W32_CALL | delwattcpd (VoidProc p)
W32_FUNC void W32_CALL | stopwattcpd (void)
W32_FUNC int W32_CALL | close_s (int s)
W32_FUNC int W32_CALL | write_s (int s, const char *buf, int nbyte)
W32_FUNC int W32_CALL | read_s (int s, char *buf, int nbyte)
W32_FUNC int W32_CALL | writev_s (int s, const struct iovec *vector, size_t count)
W32_FUNC int W32_CALL | readv_s (int s, const struct iovec *vector, size_t count)
W32_FUNC int W32_CALL | select_s (int num_sockets, fd_set *read_events, fd_set *write_events, fd_set *except_events, struct timeval *timeout)
The select_s() function.
W32_FUNC int W32_CALL | select (int num_sockets, fd_set *read_events, fd_set *write_events, fd_set *except_events, struct timeval *timeout)
W32_FUNC int W32_CALL | gethostname (char *name, int len)
W32_FUNC int W32_CALL | gethostname (char *name, size_t len)
W32_FUNC long W32_CALL | gethostid (void)
BSD style: returns local IPv4-address.
W32_FUNC long W32_CALL | sethostid (u_long ip)
BSD-style: Sets local IPv4-address.
W32_FUNC int W32_CALL | sethostname (const char *name, size_t len)
W32_FUNC int W32_CALL | sethostname (const char *name, int len)
W32_FUNC int W32_CALL | join_mcast_group (DWORD ip)
W32_FUNC int W32_CALL | leave_mcast_group (DWORD ip)
W32_FUNC int W32_CALL | multi_to_eth (DWORD ip, eth_address *eth)
W32_FUNC int W32_CALL | udp_SetTTL (udp_Socket *s, BYTE ttl)
W32_FUNC int W32_CALL | num_mcast_active (void)
W32_FUNC int W32_CALL | watt_getopt (int argc, char *const *argv, const char *opt_str)
W32_FUNC int W32_CALL | _w_watt_getopt (int argc, wchar_t *const *argv, const wchar_t *opt_str)
W32_FUNC void W32_CALL | print_mac_stats (void)
W32_FUNC void W32_CALL | print_pkt_stats (void)
W32_FUNC void W32_CALL | print_vjc_stats (void)
W32_FUNC void W32_CALL | print_arp_stats (void)
W32_FUNC void W32_CALL | print_pppoe_stats (void)
W32_FUNC void W32_CALL | print_ip4_stats (void)
W32_FUNC void W32_CALL | print_ip6_stats (void)
W32_FUNC void W32_CALL | print_icmp_stats (void)
W32_FUNC void W32_CALL | print_igmp_stats (void)
W32_FUNC void W32_CALL | print_udp_stats (void)
W32_FUNC void W32_CALL | print_tcp_stats (void)
W32_FUNC void W32_CALL | print_cache_stats (void)
W32_FUNC void W32_CALL | print_rarp_stats (void)
W32_FUNC void W32_CALL | print_icmp6_stats (void)
W32_FUNC void W32_CALL | print_all_stats (void)
W32_FUNC void W32_CALL | reset_stats (void)
W32_FUNC int W32_CALL | sock_stats (sock_type *s, DWORD *days, WORD *inactive, WORD *cwindow, DWORD *avg, DWORD *sd)
W32_FUNC int W32_CALL | pkt_eth_init (mac_address *eth)
Initialise Packet driver interface.
W32_FUNC int W32_CALL | pkt_release (void)
W32_FUNC int W32_CALL | pkt_reset_handle (WORD handle)
Reset the driver-state associated with handle.
W32_FUNC int W32_CALL | pkt_send (const void *tx, int length)
Send a link-layer frame.
W32_FUNC int W32_CALL | pkt_buf_wipe (void)
Clear the receive queue.
W32_FUNC void W32_CALL | pkt_free_pkt (const void *pkt)
Release a packet from the receive queue.
W32_FUNC int W32_CALL | pkt_waiting (void)
Return number of packets waiting in queue.
W32_FUNC int W32_CALL | pkt_set_addr (const void *eth)
Set a new MAC source address.
W32_FUNC int W32_CALL | pkt_get_addr (mac_address *eth)
Return the MAC address.
W32_FUNC int W32_CALL | pkt_get_mtu (void)
Return PKTDRVR maximum-transmit-units (MTU).
W32_FUNC int W32_CALL | pkt_get_drvr_ver (WORD *major, WORD *minor, WORD *unused, WORD *build)
Return version of PKTDRVR.
W32_FUNC int W32_CALL | pkt_get_api_ver (WORD *ver)
Return version of spec.
W32_FUNC int W32_CALL | pkt_set_rcv_mode (int mode)
Sets the receive mode of the interface.
W32_FUNC int W32_CALL | pkt_get_rcv_mode (void)
Gets the receive mode of the interface (can never be mode 0).
W32_FUNC BOOL W32_CALL | pkt_check_address (DWORD my_ip)
W32_FUNC BOOL W32_CALL | pkt_is_init (void)
W32_FUNC int W32_CALL | pkt_get_params (struct PktParameters *params)
Get PKTDRVR parameters (MTU, version etc.)
W32_FUNC int W32_CALL | pkt_get_stats (struct PktStats *stats, struct PktStats *total)
Get PKTDRVR statistics.
W32_FUNC DWORD W32_CALL | pkt_dropped (void)
Return number of packets dropped.
W32_FUNC int W32_CALL | pkt_get_vector (void)
Return PKTDRVR vector.
W32_FUNC const char *W32_CALL | pkt_strerror (int code)
Return textual error representing error-code.
W32_FUNC const char *W32_CALL | pkt_get_device_name (void)
W32_FUNC const char *W32_CALL | pkt_get_drvr_name (void)
W32_FUNC const char *W32_CALL | pkt_get_drvr_descr (void)
W32_FUNC WORD W32_CALL | pkt_get_drvr_class (void)
W32_FUNC void W32_CALL | backgroundon (void)
W32_FUNC void W32_CALL | backgroundoff (void)
W32_FUNC void W32_CALL | backgroundfn (VoidProc func)
W32_FUNC int W32_CALL | _w32_kbhit (void)
W32_FUNC int W32_CALL | _w32_getch (void)
W32_FUNC char *W32_CALL | _w32_itoa (int value, char *buf, int radix)
W32_FUNC const char *W32_CALL | _w32_inet_ntop (int af, const void *src, char *dst, size_t size)
W32_FUNC int W32_CALL | _w32_inet_pton (int af, const char *src, void *dst)
W32_FUNC WORD W32_CALL | _w32_inchksum (const void *ptr, int len)
W32_FUNC const char *W32_CALL | _w32_ExpandVarStr (const char *str)
W32_FUNC int W32_CALL | _w32_ffs (int i)
W32_FUNC int W32_CALL | ffs (int mask)
W32_FUNC int W32_CALL | system (const char *cmd)
pragma | Alias (system, "_mw_watt_system")
W32_FUNC void W32_CALL | delay (unsigned int msec)
W32_FUNC time_t W32_CALL | dostounix (const struct date *d, const struct time *t)
W32_FUNC void W32_CALL | unixtodos (time_t time, struct date *d, struct time *t)
W32_FUNC unsigned W32_CALL | Random (unsigned a, unsigned b)
Returns a random integer in range [a..b].
W32_FUNC void W32_CALL | RandomWait (unsigned a, unsigned b)
Wait for a random period in range [a..b] millisec.

Variables

W32_DATA const char * | wattcpCopyright
W32_DATA DWORD | my_ip_addr
W32_DATA DWORD | sin_mask
W32_DATA int | sock_delay
W32_DATA int | sock_inactive
W32_DATA int | sock_data_timeout
W32_DATA WORD | multihomes
W32_DATA int | block_tcp
W32_DATA int | block_udp
W32_DATA int | block_icmp
W32_DATA int | block_ip
W32_DATA WORD | last_cookie
W32_DATA DWORD | Cookies [MAX_COOKIES]
W32_DATA BOOL | _watt_do_exit
W32_DATA BOOL | survive_eth
GvB 2002-09, allows us to survive without a (working) packet driver at all - in cases where life still has a meaning without TCP/IP.
W32_DATA BOOL | survive_bootp
W32_DATA BOOL | survive_dhcp
Survive a failed DHCP attempt.
W32_DATA BOOL | survive_rarp
W32_DATA unsigned | tcp_OPEN_TO
W32_DATA unsigned | tcp_CLOSE_TO
W32_DATA unsigned | tcp_RTO_ADD
W32_DATA unsigned | tcp_RTO_BASE
W32_DATA unsigned | tcp_RTO_SCALE
W32_DATA unsigned | tcp_RST_TIME
W32_DATA unsigned | tcp_RETRAN_TIME
W32_DATA unsigned | tcp_MAX_VJSA
W32_DATA unsigned | tcp_MAX_VJSD
W32_DATA DWORD | tcp_recv_win
W32_DATA WORD | dns_timeout
W32_DATA BOOL | dns_recurse
W32_DATA WORD | _watt_handle_cbreak
Turn off stack-checking here because stack may be out of bounds.
W32_DATA volatile int | _watt_cbroke
W32_DATA unsigned | _mtu
W32_DATA unsigned | _mss
W32_DATA int | ctrace_on
W32_DATA int | debug_on
W32_DATA int | has_rdtsc
W32_DATA DWORD | clocks_per_usec
W32_DATA unsigned | tcp_keep_idle
W32_DATA unsigned | tcp_keep_intvl
W32_DATA unsigned | tcp_max_idle
W32_DATA BOOL | _resolve_exit
W32_DATA BOOL | _resolve_timeout
W32_DATA char | defaultdomain [MAX_HOSTLEN+1]
W32_DATA char * | def_domain
W32_DATA DWORD | def_nameservers [MAX_NAMESERVERS]
W32_DATA WORD | last_nameserver
W32_DATA int | dom_errno
W32_DATA const char * | value
W32_DATA int | _watt_no_config
W32_DATA BOOL | DHCP_did_gratuitous_arp
W32_DATA size_t | length
W32_DATA unsigned | len
W32_DATA int | _multicast_on
W32_DATA int | _multicast_intvl
W32_DATA char * | watt_optarg
W32_DATA int | watt_optind
W32_DATA int | watt_opterr
W32_DATA int | watt_optopt
W32_DATA char * | watt_optswchar
W32_DATA wchar_t * | _w_watt_optarg
W32_DATA wchar_t * | _w_watt_optswchar

Detailed Description

Watt-32 public API.

Definition in file tcp.h.

Typedef Documentation

◆ in_Header

typedef struct in_Header

Definition at line 79 of file tcp.h.

◆ sock_type

typedef void sock_type

Definition at line 78 of file tcp.h.

◆ tcp_Header

typedef void tcp_Header

Definition at line 81 of file tcp.h.

◆ udp_Header

typedef void udp_Header

Definition at line 80 of file tcp.h.

◆ WattDHCPConfigFunc

typedef int(W32_CALL * WattDHCPConfigFunc) (enum DHCP_config_op op, struct DHCP_config *cfg)

Definition at line 524 of file tcp.h.

◆ WattUserConfigFunc

typedef long(W32_CALL * WattUserConfigFunc) (int pass, const struct config_table *cfg)

Definition at line 484 of file tcp.h.

Enumeration Type Documentation

◆ _watt_optmode

enum _watt_optmode

Definition at line 743 of file tcp.h.

◆ CHK_SOCKET_VAL

enum CHK_SOCKET_VAL

Definition at line 616 of file tcp.h.

◆ config_tab_types

enum config_tab_types

Convert 'arg_func' below to this type.

Enumerator
ARG_ATOI | convert to int
ARG_ATOB | convert to 8-bit byte
ARG_ATOW | convert to 16-bit word
ARG_ATOIP | convert to ip-address (host order)
ARG_ATOX_B | convert to hex-byte
ARG_ATOX_W | convert to hex-word
ARG_ATOX_D | convert to hex-dword
ARG_STRDUP | duplicate string value
ARG_STRCPY | copy string value
ARG_RESOLVE | resolve host to IPv4-address
ARG_FUNC | call convertion function

Definition at line 447 of file tcp.h.

◆ TCP_SIMPLE_STATE

enum TCP_SIMPLE_STATE

Definition at line 638 of file tcp.h.

Function Documentation

◆ _arp_resolve()

W32_FUNC BOOL W32_CALL _arp_resolve | ( | DWORD | ip,
 |  | eth_address * | eth
 | ) |  |

The blocking lookup function visible to higher functions.

Blocking ARP resolve functions.

Definition at line 1278 of file pcarp.c.

References _watt_cbroke, arp_check_common(), arp_daemon(), is_on_LAN(), LAN_lookup(), LAN_lookup_pending(), LAN_start_lookup(), route_lookup(), route_lookup_pending(), and route_start_lookup().

◆ _chk_ping()

W32_FUNC DWORD W32_CALL _chk_ping | ( | DWORD | host,
 |  | DWORD * | number
 | ) |  |

Check for ICMP echo reply in ping-cache.

Return values
reply | time in system ticks.
(DWORD)-1 | on failure

Definition at line 169 of file pcping.c.

◆ _chk_socket()

W32_FUNC int W32_CALL _chk_socket ( const sock_type * s )

Definition at line 254 of file pcbuf.c.

◆ _eth_arrived()

W32_FUNC void *W32_CALL _eth_arrived | ( | WORD * | type_ptr,
 |  | BOOL * | broadcast
 | ) |  |

Poll for arrival of new packets (IP/ARP/RARP/PPPoE protocol).

Sets protocol-type of packet received in 'type'.

For Ethernet/TokenRing-type drivers:

Return values
Pointer past the MAC-header to the IP/ARP/RARP protocol header. Also check for link-layer broadcast.

For PPP/SLIP-type drivers (no MAC-headers):

Return values
Pointer to the IP-packet itself. IP-protocol is assumed. Can never be link-layer broadcast.

<

Todo:
push back packet, else it's lost

Definition at line 996 of file pcsed.c.

References _eth_brdcast, _eth_free(), _eth_is_init, _eth_recv_hook(), _ip_recursion, _pktdevclass, _pktserial, fix_llc_head(), poll_recv_queue(), and update_in_stat().

◆ _eth_formatpacket()

W32_FUNC void *W32_CALL _eth_formatpacket | ( | const void * | mac_dest,
 |  | WORD | eth_type
 | ) |  |

_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet.

Returns
address of higher-level protocol (IP/RARP/RARP) header.

Definition at line 134 of file pcsed.c.

◆ _eth_free()

W32_FUNC void W32_CALL _eth_free ( const void * buf )

Free an input buffer once it is no longer needed.

Definition at line 769 of file pcsed.c.

References _eth_recv_hook(), pkt_buf_wipe(), and pkt_free_pkt().

◆ _eth_get_hwtype()

W32_FUNC BYTE W32_CALL _eth_get_hwtype | ( | BYTE * | hwtype,
 |  | BYTE * | hwlen
 | ) |  |

Fill in hardware address type/length for BOOTP/DHCP packets.

Also used for ARP/RARP packets. Should never be called for PPP/SLIP.

Definition at line 730 of file pcsed.c.

References _pktdevclass.

◆ _eth_init()

W32_FUNC int W32_CALL _eth_init ( void )

Initialize the network driver interface.

Returns
0 okay.
error-code otherwise.

Definition at line 634 of file pcsed.c.

References __eth_release(), _eth_addr, _eth_brdcast, _eth_get_hwtype(), _eth_is_init, _eth_loop_addr, _eth_mac_len, _eth_ndis3pkt, _eth_real_addr, _eth_SwsVpkt, _pktdevclass, arcnet_mac_format(), eth_mac_format(), eth_mac_xmit(), fddi_mac_format(), mac_tx_format, null_mac_format(), pkt_buf_wipe(), pkt_eth_init(), and tok_mac_format().

◆ _eth_release()

W32_FUNC void W32_CALL _eth_release ( void )

Release the hardware driver.

Definition at line 1349 of file pcsed.c.

References _eth_addr, _eth_is_init, _eth_real_addr, _pkt_rxmode, _pkt_rxmode0, _pktserial, _watt_fatal_error, pkt_dropped(), pkt_release(), pkt_set_addr(), and pkt_set_rcv_mode().

◆ _eth_send()

W32_FUNC int W32_CALL _eth_send | ( | WORD | len,
 |  | const void * | sock,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

_eth_send() does the actual transmission once we are complete with filling the buffer.

Do any last minute patches here, like fix the size. Send to "loopback" device if it's IP and destination matches loopback network (127.x.x.x.).

Return length of network-layer packet (not length of link-layer packet).

Definition at line 301 of file pcsed.c.

References _eth_is_init, _eth_last, _pkt_ip_ofs, _pktdevclass, has_rdtsc, send_loopback(), and update_out_stat().

◆ _eth_set_addr()

W32_FUNC int W32_CALL _eth_set_addr ( const void * addr )

Sets a new MAC address for our interface.

Definition at line 712 of file pcsed.c.

References _eth_addr, _pktdevclass, _pktserial, and pkt_set_addr().

◆ _gethostid()

W32_FUNC DWORD W32_CALL _gethostid ( void )

Core style: Returns local IPv4-address.

Return values
address on host order.

Definition at line 49 of file bsdname.c.

References my_ip_addr.

◆ _getpeername()

W32_FUNC int W32_CALL _getpeername | ( | const sock_type * | s,
 |  | void * | dest,
 |  | int * | len
 | ) |  |

Core-style:
Return 'watt_sockaddr' for peer in a UDP/TCP connection.

Definition at line 112 of file bsdname.c.

◆ _getsockname()

W32_FUNC int W32_CALL _getsockname | ( | const sock_type * | s,
 |  | void * | dest,
 |  | int * | len
 | ) |  |

Core-style:
Return 'watt_sockaddr' for our side of a UDP/TCP connection.

Definition at line 147 of file bsdname.c.

◆ _inet_addr()

W32_FUNC DWORD W32_CALL _inet_addr ( const char * s )

Convert a string into an IP-address.

Return values
address | on host order.
0 | string isn't a (dotless) address.

Definition at line 70 of file netaddr.c.

References aton(), isaddr(), and isaddr_dotless().

◆ _inet_ntoa()

W32_FUNC char *W32_CALL _inet_ntoa | ( | char * | s,
 |  | DWORD | ip
 | ) |  |

Convert an IP-address 'ip' into a string.

Return values
'p'.
Note
'ip' is on host order. Use 4 buffers in round-robin.

Definition at line 44 of file netaddr.c.

◆ _ip_delay0()

W32_FUNC int W32_CALL _ip_delay0 | ( | sock_type * | s,
 |  | int | sec,
 |  | UserHandler | fn,
 |  | int * | statusptr
 | ) |  |

Definition at line 45 of file sock_in.c.

◆ _ip_delay1()

W32_FUNC int W32_CALL _ip_delay1 | ( | sock_type * | s,
 |  | int | sec,
 |  | UserHandler | fn,
 |  | int * | statusptr
 | ) |  |

Definition at line 99 of file sock_in.c.

◆ _ip_delay2()

W32_FUNC int W32_CALL _ip_delay2 | ( | sock_type * | s,
 |  | int | sec,
 |  | UserHandler | fn,
 |  | int * | statusptr
 | ) |  |

Definition at line 153 of file sock_in.c.

◆ _ping()

W32_FUNC int W32_CALL _ping | ( | DWORD | host,
 |  | DWORD | countnum,
 |  | const BYTE * | pattern,
 |  | size_t | len
 | ) |  |

Format and send an ICMP echo request (ping).

  • countnum is the ICMP index value.
  • pattern optional data that will be sent.
  • len length of pattern data.
    Return values
    0 if ARP fails or error in lower layer.
    Note
    if pattern or len is 0, only an 12 byte ICMP echo header will be sent.
    Sends fragments if needed.

Definition at line 45 of file pcping.c.

References _arp_resolve(), _default_tos, _eth_formatpacket(), set_timeout(), and sin_mask.

◆ _sethostid()

W32_FUNC DWORD W32_CALL _sethostid ( DWORD ip )

Core-style: Sets local IPv4-address.

Return values
address on host order.

Definition at line 58 of file bsdname.c.

References my_ip_addr.

◆ _w32_ExpandVarStr()

W32_FUNC const char *W32_CALL _w32_ExpandVarStr ( const char * str )

Definition at line 267 of file pcconfig.c.

◆ _w32_ffs()

W32_FUNC int W32_CALL _w32_ffs ( int i )

Definition at line 1331 of file misc.c.

◆ _w32_inchksum()

W32_FUNC WORD W32_CALL _w32_inchksum | ( | const void * | ptr,
 |  | int | len
 | ) |  |

Definition at line 139 of file oldstuff.c.

◆ _w32_inet_ntop()

W32_FUNC const char *W32_CALL _w32_inet_ntop | ( | int | af,
 |  | const void * | src,
 |  | char * | dst,
 |  | size_t | size
 | ) |  |

Definition at line 59 of file presaddr.c.

◆ _w32_inet_pton()

W32_FUNC int W32_CALL _w32_inet_pton | ( | int | af,
 |  | const char * | src,
 |  | void * | dst
 | ) |  |

Definition at line 89 of file presaddr.c.

◆ _w_watt_getopt()

W32_FUNC int W32_CALL _w_watt_getopt | ( | int | argc,
 |  | wchar_t *const * | argv,
 |  | const wchar_t * | opt_str
 | ) |  |

Definition at line 194 of file getopt.c.

◆ _watt_user_config()

W32_FUNC WattUserConfigFunc W32_CALL _watt_user_config ( WattUserConfigFunc fn )

A user application may call the ‘_watt_user_config()’ function prior to calling sock_init() to inject its own configuration values into the tcp_config() parser.

Useful when running diskless and setting ‘_watt_no_config = 0’.

Example:

  • 'pass' is 1 for first pass (PKTDRVR/WinPcap configuration), 2 for second pass.
  • 'cfg' is a pointer to the configuration table and must be passed to tcp_inject_config() as-is.

In most cases 'pass' can probably be ignored.

static long my_config_fn (int pass, const struct config_table *cfg) { // Keyword case is not significant (tcp_inject_config will convert // all keys to uppercase)

tcp_inject_config (cfg, "My_IP", "192.168.0.98"); tcp_inject_config (cfg, "NetMask", "255.255.255.0"); tcp_inject_config (cfg, "Gateway", "192.168.0.1"); (void)pass; return (1); // Returning 0 would make tcp_config() return 0 too, // as if the config file was not found }

int main (void) { _watt_no_config = 1; _watt_user_config (my_config_fn); if (sock_init()) return (-1); ... }

Never called inside Watt-32.

Definition at line 200 of file sock_ini.c.

◆ abort_test()

W32_FUNC void W32_CALL abort_test ( void )

Definition at line 714 of file misc.c.

◆ add_ping()

W32_FUNC void W32_CALL add_ping | ( | DWORD | host,
 |  | DWORD | tim,
 |  | DWORD | number
 | ) |  |

Add an ICMP echo reply to the ping-cache.

Definition at line 147 of file pcping.c.

References compare().

◆ addwattcpd()

W32_FUNC int W32_CALL addwattcpd ( VoidProc p )

Definition at line 297 of file run.c.

◆ assert_fail_test()

W32_FUNC void W32_CALL assert_fail_test ( void )

Definition at line 702 of file misc.c.

◆ aton()

W32_FUNC DWORD W32_CALL aton ( const char * str )

Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.

Return values
0 | on error (safer than -1)
IPv4 | address (host order)

Definition at line 86 of file netaddr.c.

◆ aton_dotless()

W32_FUNC DWORD W32_CALL aton_dotless ( const char * str )

Converts ‘[dotless]’ or ‘dotless’ to 32 bit long (host order)

Return values
0 on error (safer than -1)

Definition at line 115 of file netaddr.c.

References isaddr_dotless().

◆ backgroundoff()

W32_FUNC void W32_CALL backgroundoff ( void )

Definition at line 81 of file netback.c.

◆ backgroundon()

W32_FUNC void W32_CALL backgroundon ( void )

Definition at line 19 of file netback.c.

◆ check_md5_signature()

W32_FUNC BOOL W32_CALL check_md5_signature | ( | const tcp_Socket * | s,
 |  | const in_Header * | ip
 | ) |  |

Definition at line 122 of file tcp_md5.c.

◆ chk_timeout()

W32_FUNC int W32_CALL chk_timeout ( DWORD value )

Check if milli-sec value has expired:

Return values

li TRUE timer expired

  • FALSE not expired (or value not set)

Definition at line 545 of file timer.c.

References has_8254, millisec_clock(), and set_timeout().

◆ close_s()

W32_FUNC int W32_CALL close_s ( int s )

Definition at line 46 of file close.c.

◆ cmp_timers()

W32_FUNC int W32_CALL cmp_timers | ( | DWORD | t1,
 |  | DWORD | t2
 | ) |  |

Compare two timers with expirary at 't1' and 't2'.

Return values

li -1 if t1 expires before t2

  • 0 if t1 == t2
  • +1 if t1 expires after t2
Note
This logic fails when timers approaches ULONG_MAX after approx. 50 days.

Definition at line 358 of file timer.c.

◆ dbug_init()

W32_FUNC void W32_CALL dbug_init ( void )

Definition at line 95 of file pcdbug.c.

◆ delay()

W32_FUNC void W32_CALL delay ( unsigned int msec )

Definition at line 804 of file timer.c.

◆ delwattcpd()

W32_FUNC int W32_CALL delwattcpd ( VoidProc p )

Definition at line 302 of file run.c.

◆ DHCP_get_server()

W32_FUNC DWORD W32_CALL DHCP_get_server ( void )

Return current DHCP server address.

Definition at line 764 of file pcdhcp.c.

◆ DHCP_read_config()

W32_FUNC int W32_CALL DHCP_read_config ( void )

Called from watt_sock_init() after "\c WATTCP.CFG" has been parsed.

Open and parse transient configuration from 'config_file' or call user-defined function to read transient configuration.

Definition at line 1826 of file pcdhcp.c.

References dhcp_open(), dhcp_set_timers(), and eval_timers().

◆ DHCP_release()

W32_FUNC void W32_CALL DHCP_release ( BOOL force )

Possibly send a DHCP release.

  • force If TRUE, release unconditionally.
    Note
    Send release if we are configured and remaining lease is below minimum lease (DHCP_MIN_LEASE = 10 sec).

Definition at line 732 of file pcdhcp.c.

References dhcp_fsm(), and DHCP_release_decline().

◆ DHCP_set_config_func()

W32_FUNC WattDHCPConfigFunc W32_CALL DHCP_set_config_func ( WattDHCPConfigFunc fn )

Sets up an application hook for doing DHCP operations (DHCP_config_op)

Definition at line 1865 of file pcdhcp.c.

◆ dom_remove_dot()

W32_FUNC char *W32_CALL dom_remove_dot ( char * name )

Definition at line 757 of file pcdns.c.

◆ dom_strerror()

W32_FUNC const char *W32_CALL dom_strerror ( int err )

Return text for error code (dom_errno).

Definition at line 742 of file pcdns.c.

References client_error(), and server_error().

◆ dostounix()

W32_FUNC time_t W32_CALL dostounix | ( | const struct date * | d,
 |  | const struct time * | t
 | ) |  |

Definition at line 93 of file oldstuff.c.

◆ except_test()

W32_FUNC void W32_CALL except_test ( void )

Definition at line 720 of file misc.c.

◆ exit_timer_isr()

W32_FUNC void W32_CALL exit_timer_isr ( void )

Definition at line 242 of file timer.c.

◆ get_timediff()

W32_FUNC long W32_CALL get_timediff | ( | DWORD | now,
 |  | DWORD | tim
 | ) |  |

Return time difference between timers now and tim.

Check for day rollover. Max timer distance is 24 hours. This function should be called immediately after chk_timeout() is called.

Definition at line 620 of file timer.c.

References has_8254.

◆ gethostid()

W32_FUNC long W32_CALL gethostid ( void )

BSD style: returns local IPv4-address.

Return values
address on network order.

Definition at line 68 of file bsdname.c.

◆ gui_printf()

W32_FUNC int MS_CDECL gui_printf | ( | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 160 of file winmisc.c.

◆ hires_timer()

W32_FUNC int W32_CALL hires_timer ( int on )

Control use of high-resolution timer.

When using Watt-32 together with programs that reprogram the PIT (8254 timer chip), the millisec_clock() function may return wrong values. In such cases it's best to use old-style 55ms timers. Using Watt-32 with Allegro graphics library is one such case where application program should call ‘hires_timer(0)’ after sock_init() has been called.

Definition at line 377 of file timer.c.

References chk_timeout(), and has_8254.

◆ in_checksum()

W32_FUNC WORD W32_CALL in_checksum | ( | const void * | buf,
 |  | unsigned | len
 | ) |  |

This checksum routine is now used for all targets since in_checksum_fast() was removed.

Definition at line 24 of file chksum.c.

◆ inchksum()

W32_FUNC WORD W32_CALL inchksum | ( | const void * | ptr,
 |  | int | len
 | ) |  |

Definition at line 130 of file oldstuff.c.

◆ init_misc()

W32_FUNC void W32_CALL init_misc ( void )

Initialise various stuff.

Todo:

Definition at line 345 of file misc.c.

References _watt_assert_buf, _watt_os_ver, has_rdtsc, init_timers(), qword_str(), and win32_dos_box.

◆ init_timer_isr()

W32_FUNC void W32_CALL init_timer_isr ( void )

Definition at line 286 of file timer.c.

◆ init_userSuppliedTimerTick()

W32_FUNC void W32_CALL init_userSuppliedTimerTick ( void )

init_userSuppliedTimerTick() - setup timer handling for programs that are already running a periodic interrupt or whatever (i.e.

ALLEGRO & more). This is called to signify that the 'user task' will periodically call userTimerTick() to supply the elapsed time since the last call. Best called once before sock_init(). There is no way to revert to original timer handling once this is called. By GvB 2002-09

Definition at line 169 of file timer.c.

References has_8254.

◆ ip_timer_expired()

W32_FUNC int W32_CALL ip_timer_expired ( const sock_type * s )

Definition at line 34 of file sock_in.c.

◆ ip_timer_init()

W32_FUNC void W32_CALL ip_timer_init | ( | sock_type * | s,
 |  | unsigned | delayseconds
 | ) |  |

Definition at line 27 of file sock_in.c.

◆ isaddr()

W32_FUNC int W32_CALL isaddr ( const char * str )

Check if 'str' is simply an ip address.

Accepts 'a.b.c.d' or '[a.b.c.d]' forms.

Return values
TRUE if 'str' is an IPv4 address.

Definition at line 128 of file netaddr.c.

◆ isaddr_dotless()

W32_FUNC BOOL W32_CALL isaddr_dotless | ( | const char * | str,
 |  | DWORD * | ip
 | ) |  |

Check if 'str' is a dotless ip address.

Accept "[ 0-9\[\]]+". Doesn't accept octal base.

Return values
TRUE if 'str' is a dotless address.

Definition at line 148 of file netaddr.c.

◆ join_mcast_group()

W32_FUNC int W32_CALL join_mcast_group ( DWORD ip )

Definition at line 118 of file pcigmp.c.

◆ leak_test()

W32_FUNC void W32_CALL leak_test ( void )

Definition at line 727 of file misc.c.

◆ leave_mcast_group()

W32_FUNC int W32_CALL leave_mcast_group ( DWORD ip )

Definition at line 181 of file pcigmp.c.

◆ lookup_host()

W32_FUNC DWORD W32_CALL lookup_host | ( | const char * | host,
 |  | char * | ip_str
 | ) |  |

Definition at line 45 of file lookup.c.

◆ make_md5_signature()

W32_FUNC void W32_CALL make_md5_signature | ( | const in_Header * | ip,
 |  | const tcp_Header * | tcp,
 |  | WORD | datalen,
 |  | const char * | secret,
 |  | BYTE * | buf
 | ) |  |

Definition at line 77 of file tcp_md5.c.

◆ multi_to_eth()

W32_FUNC int W32_CALL multi_to_eth | ( | DWORD | ip,
 |  | eth_address * | eth
 | ) |  |

Definition at line 94 of file pcigmp.c.

◆ num_mcast_active()

W32_FUNC int W32_CALL num_mcast_active ( void )

Definition at line 240 of file pcigmp.c.

◆ outhex()

W32_FUNC void W32_CALL outhex ( char ch )

Definition at line 152 of file misc_str.c.

◆ outhexes()

W32_FUNC void W32_CALL outhexes | ( | const char * | s,
 |  | int | n
 | ) |  |

Definition at line 171 of file misc_str.c.

◆ outs()

W32_FUNC void W32_CALL outs ( const char * s )

Definition at line 126 of file misc_str.c.

◆ outsn()

W32_FUNC void W32_CALL outsn | ( | const char * | s,
 |  | int | n
 | ) |  |

Definition at line 142 of file misc_str.c.

◆ outsnl()

W32_FUNC void W32_CALL outsnl ( const char * s )

Definition at line 136 of file misc_str.c.

◆ parse_config_table()

W32_FUNC int W32_CALL parse_config_table | ( | const struct config_table * | tab,
 |  | const char * | section,
 |  | const char * | name,
 |  | const char * | value
 | ) |  |

Parse the config-table and if a match is found for ('section'+'.

'+)'name' either store variable to 'value' or call function with 'value'.

Definition at line 382 of file pcconfig.c.

References _strlcpy(), ARG_ATOB, ARG_ATOI, ARG_ATOIP, ARG_ATOW, ARG_ATOX_B, ARG_ATOX_D, ARG_ATOX_W, ARG_FUNC, ARG_RESOLVE, ARG_STRCPY, ARG_STRDUP, aton(), isaddr(), resolve(), and set_value().

◆ pkt_buf_wipe()

W32_FUNC int W32_CALL pkt_buf_wipe ( void )

Clear the receive queue.

Definition at line 1331 of file pcpkt.c.

References _pkt_inf.

◆ pkt_check_address()

W32_FUNC BOOL W32_CALL pkt_check_address ( DWORD my_ip )

Definition at line 693 of file winpkt.c.

◆ pkt_dropped()

W32_FUNC DWORD W32_CALL pkt_dropped ( void )

Return number of packets dropped.

Definition at line 1391 of file pcpkt.c.

References _pkt_inf, and pkt_ringbuf::num_drop.

◆ pkt_eth_init()

W32_FUNC int W32_CALL pkt_eth_init ( mac_address * mac_addr )

Initialise Packet driver interface.

First determine vector to use; if WATTCP.CFG specifies a "PKT.VECTOR = 0xNN", use that vector, else search for PKTDRVR between PKT_FIRST_VEC and PKT_LAST_VEC (0x60 - 0x80). If the driver is outside this range, user must specify one with "PKT.VECTOR = 0x??".

If DOSX, probe and initialise protected-mode driver (not operational). Call pkt16_drvr_init() to initialise API.

Initialise Packet driver interface.

Definition at line 1446 of file pcpkt.c.

References _eth_SwsVpkt, _eth_wanpacket, _eth_win10pcap, _eth_winpcap, _pkt_errno, _pkt_forced_rxmode, _pkt_inf, _pkt_ip_ofs, _pkt_rxmode, _pkt_rxmode0, _pktdevclass, _strlcpy(), _watt_is_win9x, _watt_no_config, expand_var_str(), find_adapter(), fopen_excl(), legal_recv_mode(), open_swsvpkt_adapter(), open_wanpacket_adapter(), open_win10pcap_adapter(), open_winpcap_adapter(), parse_config_pass_1(), pkt16_drvr_init(), pkt_get_addr(), pkt_get_rcv_mode(), pkt_release(), pkt_set_rcv_mode(), strrtrim(), win_strerror(), and winpcap_recv_thread().

◆ pkt_free_pkt()

W32_FUNC void W32_CALL pkt_free_pkt ( const void * pkt )

Release a packet from the receive queue.

If USE_FAST_PKT, pkt has already been free'd. Just update drop count.

Definition at line 1346 of file pcpkt.c.

References _pkt_inf, _pkt_ip_ofs, and pkt_ringbuf::num_drop.

◆ pkt_get_addr()

W32_FUNC int W32_CALL pkt_get_addr ( mac_address * eth )

Return the MAC address.

Definition at line 1156 of file pcpkt.c.

References _pkt_errno, _pkt_inf, get_rmode_data(), and win_strerror().

◆ pkt_get_api_ver()

W32_FUNC int W32_CALL pkt_get_api_ver ( WORD * ver )

Return version of spec.

this PKTDRVR conforms to.

Return values
-1 on error. Return major version in upper 8 bit, minor in lower.

Definition at line 518 of file pcpkt.c.

References _eth_SwsVpkt, _eth_win10pcap, _eth_winpcap, and _pkt_inf.

◆ pkt_get_device_name()

W32_FUNC const char *W32_CALL pkt_get_device_name ( void )

Definition at line 561 of file pcpkt.c.

◆ pkt_get_drvr_class()

W32_FUNC WORD W32_CALL pkt_get_drvr_class ( void )

Definition at line 553 of file pcpkt.c.

◆ pkt_get_drvr_descr()

W32_FUNC const char *W32_CALL pkt_get_drvr_descr ( void )

Definition at line 1528 of file winpkt.c.

◆ pkt_get_drvr_name()

W32_FUNC const char *W32_CALL pkt_get_drvr_name ( void )

Definition at line 1510 of file winpkt.c.

◆ pkt_get_drvr_ver()

W32_FUNC int W32_CALL pkt_get_drvr_ver | ( | WORD * | major,
 |  | WORD * | minor,
 |  | WORD * | unused,
 |  | WORD * | build
 | ) |  |

Return version of PKTDRVR.

Definition at line 531 of file pcpkt.c.

References _pkt_inf.

◆ pkt_get_mtu()

W32_FUNC int W32_CALL pkt_get_mtu ( void )

Return PKTDRVR maximum-transmit-units (MTU).

Note
This includes length of MAC-header.

Definition at line 488 of file pcpkt.c.

References _pktdevclass.

◆ pkt_get_params()

W32_FUNC int W32_CALL pkt_get_params ( struct PktParameters * params )

Get PKTDRVR parameters (MTU, version etc.)

Definition at line 465 of file pcpkt.c.

References get_rmode_data().

◆ pkt_get_rcv_mode()

W32_FUNC int W32_CALL pkt_get_rcv_mode ( void )

Gets the receive mode of the interface (can never be mode 0).

Return values
!0 | Okay - _pkt_errno is 0, _pkt_rxmode and retval is current mode.
0 | Error - _pkt_errno is set.

_pkt_rxmode is one of the following modes: (upon successful return)

  • 1 - turn off receiver
  • 2 - receive only packets sent to this interface
  • 3 - mode 2 plus broadcast packets (default)
  • 4 - mode 3 plus limited multicast packets
  • 5 - mode 3 plus all multicast packets
  • 6 - all packets (a.k.a promiscuous mode)

Definition at line 1997 of file pcpkt.c.

References _eth_SwsVpkt, _pkt_errno, _pkt_inf, _pkt_rxmode, _pktdevlevel, and _pktserial.

◆ pkt_get_stats()

W32_FUNC int W32_CALL pkt_get_stats | ( | struct PktStats * | stats,
 |  | struct PktStats * | total
 | ) |  |

Get PKTDRVR statistics.

Return both 'stats' for current session and 'total' statistics since driver loaded.

Definition at line 1240 of file pcpkt.c.

References _pkt_inf, and get_rmode_data().

◆ pkt_get_vector()

W32_FUNC int W32_CALL pkt_get_vector ( void )

Return PKTDRVR vector.

Definition at line 545 of file pcpkt.c.

◆ pkt_is_init()

W32_FUNC BOOL W32_CALL pkt_is_init ( void )

Definition at line 257 of file pcpkt.c.

◆ pkt_release()

W32_FUNC int W32_CALL pkt_release ( void )
Todo:
We might be called between 1st and 2nd packet-driver upcall. Need to wait for 2nd upcall to finish or else freeing the RMCB too early could cause a crash or a stuck PKTDRVR.

Definition at line 837 of file pcpkt.c.

References _eth_win10pcap, _eth_winpcap, _pkt_inf, _watt_fatal_error, pkt_release_handle(), pkt_reset_handle(), and release_real_mem().

◆ pkt_reset_handle()

W32_FUNC int W32_CALL pkt_reset_handle ( WORD handle )

Reset the driver-state associated with handle.

Definition at line 726 of file pcpkt.c.

References _pkt_errno.

◆ pkt_send()

W32_FUNC int W32_CALL pkt_send | ( | const void * | tx,
 |  | int | length
 | ) |  |

Send a link-layer frame.

For PPP/SLIP 'tx' contains no MAC-header. For EtherNet, Token-Ring, ARCNET and FDDI, 'tx' contains the complete frame.

Todo:
Change this so that we doesn't retry if the driver was stuck for "too long". I've seen drivers using approx. 100 msec on each iteration below. Retrying if the driver is stuck is not worth the time.

Definition at line 1087 of file pcpkt.c.

References _eth_SwsVpkt, _pkt_inf, pkt_tx_buf(), and Wait().

◆ pkt_set_addr()

W32_FUNC int W32_CALL pkt_set_addr ( const void * eth )

Set a new MAC source address.

Definition at line 1195 of file pcpkt.c.

◆ pkt_set_rcv_mode()

W32_FUNC int W32_CALL pkt_set_rcv_mode ( int mode )

Sets the receive mode of the interface.

mode is one of the following modes:

  • 1 - turn off receiver
  • 2 - receive only packets sent to this interface
  • 3 - mode 2 plus broadcast packets (default)
  • 4 - mode 3 plus limited multicast packets
  • 5 - mode 3 plus all multicast packets
  • 6 - all packets (AKA promiscuous mode)
Return values
0 | - upon error - _pkt_errno is set
1 | - if the mode was set successfully

Definition at line 1953 of file pcpkt.c.

References _eth_SwsVpkt, _pkt_errno, _pkt_inf, _pkt_rxmode, _pktdevlevel, _pktserial, and win_strerror().

◆ pkt_strerror()

W32_FUNC const char *W32_CALL pkt_strerror ( int code )

Return textual error representing error-code.

Todo:
Return strings for these: PDERR_GEN_FAIL PDERR_NO_DRIVER PDERR_NO_CLASS PDERR_NO_MULTICAST PDERR_NO_SPACE
  • GetLastError(). Use win_strerror()

Definition at line 216 of file pcpkt.c.

References _strlcpy().

◆ pkt_waiting()

W32_FUNC int W32_CALL pkt_waiting ( void )

Return number of packets waiting in queue.

Definition at line 1375 of file pcpkt.c.

References _pkt_inf.

◆ pkt_win_get_verbose_level()

W32_FUNC int W32_CALL pkt_win_get_verbose_level ( void )

Definition at line 4142 of file winadinf.c.

◆ print_all_stats()

W32_FUNC void W32_CALL print_all_stats ( void )

Definition at line 92 of file pcstat.c.

◆ print_arp_stats()

W32_FUNC void W32_CALL print_arp_stats ( void )

Definition at line 173 of file pcstat.c.

◆ print_cache_stats()

W32_FUNC void W32_CALL print_cache_stats ( void )

Definition at line 91 of file pcstat.c.

◆ print_icmp6_stats()

W32_FUNC void W32_CALL print_icmp6_stats ( void )

Definition at line 87 of file pcstat.c.

◆ print_icmp_stats()

W32_FUNC void W32_CALL print_icmp_stats ( void )

Definition at line 86 of file pcstat.c.

◆ print_igmp_stats()

W32_FUNC void W32_CALL print_igmp_stats ( void )

Definition at line 88 of file pcstat.c.

◆ print_ip4_stats()

W32_FUNC void W32_CALL print_ip4_stats ( void )

Definition at line 84 of file pcstat.c.

◆ print_ip6_stats()

W32_FUNC void W32_CALL print_ip6_stats ( void )

Definition at line 85 of file pcstat.c.

◆ print_mac_stats()

W32_FUNC void W32_CALL print_mac_stats ( void )

Definition at line 81 of file pcstat.c.

◆ print_pkt_stats()

W32_FUNC void W32_CALL print_pkt_stats ( void )

Definition at line 83 of file pcstat.c.

◆ print_pppoe_stats()

W32_FUNC void W32_CALL print_pppoe_stats ( void )

Definition at line 312 of file pcstat.c.

◆ print_rarp_stats()

W32_FUNC void W32_CALL print_rarp_stats ( void )

Definition at line 183 of file pcstat.c.

◆ print_tcp_stats()

W32_FUNC void W32_CALL print_tcp_stats ( void )

Definition at line 90 of file pcstat.c.

◆ print_udp_stats()

W32_FUNC void W32_CALL print_udp_stats ( void )

Definition at line 89 of file pcstat.c.

◆ print_vjc_stats()

W32_FUNC void W32_CALL print_vjc_stats ( void )

Definition at line 82 of file pcstat.c.

◆ priv_addr()

W32_FUNC int W32_CALL priv_addr ( DWORD ip )

Check if 'ip' is a private addresses in the "black-hole range" (ref. RFC-1918):

10.0.0.0 - 10.255.255.255 172.16.0.0 - 172.31.255.255 192.168.0.0 - 192.168.255.255

Todo:
: rewrite using mask_len().

Definition at line 516 of file netaddr.c.

References aton().

◆ psocket()

W32_FUNC void W32_CALL psocket ( const sock_type * s )

Definition at line 55 of file oldstuff.c.

◆ Random()

W32_FUNC unsigned W32_CALL Random | ( | unsigned | a,
 |  | unsigned | b
 | ) |  |

Returns a random integer in range [a..b].

Definition at line 743 of file misc.c.

◆ RandomWait()

W32_FUNC void W32_CALL RandomWait | ( | unsigned | a,
 |  | unsigned | b
 | ) |  |

Wait for a random period in range [a..b] millisec.

Definition at line 760 of file misc.c.

References chk_timeout(), Random(), and set_timeout().

◆ read_s()

W32_FUNC int W32_CALL read_s | ( | int | s,
 |  | char * | buf,
 |  | int | nbyte
 | ) |  |

Definition at line 226 of file receive.c.

◆ readv_s()

W32_FUNC int W32_CALL readv_s | ( | int | s,
 |  | const struct iovec * | vector,
 |  | size_t | count
 | ) |  |

Definition at line 306 of file receive.c.

◆ reset_stats()

W32_FUNC void W32_CALL reset_stats ( void )

Definition at line 93 of file pcstat.c.

◆ resolve()

W32_FUNC DWORD W32_CALL resolve ( const char * name )

Convert host name to an address.

Returns 0 if name is unresolvable right now. Return value is host-order.

Definition at line 771 of file pcdns.c.

References aton(), called_from_resolve, dom_strerror(), isaddr(), lookup_domain(), my_ip_addr, next_domain(), query_init(), and set_timeout().

◆ resolve_ip()

W32_FUNC int W32_CALL resolve_ip | ( | DWORD | ip,
 |  | char * | name,
 |  | int | len
 | ) |  |

Resolve an IP-address to a name.

Definition at line 81 of file oldstuff.c.

◆ resolve_ip6()

W32_FUNC int W32_CALL resolve_ip6 | ( | const char * | name,
 |  | void * | addr
 | ) |  |

Definition at line 937 of file pcdns.c.

◆ rip()

W32_FUNC char *W32_CALL rip ( char * s )

Removes end-of-line termination from a string.

Removes "\n" (Unix), "\r" (MacOS) or "\r\n" (DOS/net-ascii) terminations, but not single "\n\r" (who uses that?).

Definition at line 185 of file misc_str.c.

◆ select()

W32_FUNC int W32_CALL select | ( | int | num_sockets,
 |  | fd_set * | read_events,
 |  | fd_set * | write_events,
 |  | fd_set * | except_events,
 |  | struct timeval * | timeout
 | ) |  |

Definition at line 347 of file select.c.

◆ select_s()

W32_FUNC int W32_CALL select_s | ( | int | nfds,
 |  | fd_set * | readfds,
 |  | fd_set * | writefds,
 |  | fd_set * | exceptfds,
 |  | struct timeval * | timeout
 | ) |  |

The select_s() function.

Note
It supports more sockets than would fit in a fd_set. I.e. it handles an array of 'fd_set's on input/output. Thus it is the user's responsibilty to not use a too high 'nfds' value. I.e. If nfs > 512*8 and user fd_set's on input is smaller than 512*, select_s() could trash the fd_set's on output.

Clear our "working" fd_sets.

Note
Don't use FD_ZERO() since our working fd_sets contain more than FD_SETSIZE sockets.

Definition at line 107 of file select.c.

References _sock_crit_start(), _sock_crit_stop(), and timeval_diff().

◆ set_timediff()

W32_FUNC int W32_CALL set_timediff ( long msec )

Must be called by user right before or after a time change occurs.

Not used in Watt-32.

Definition at line 606 of file timer.c.

◆ set_timeout()

W32_FUNC DWORD W32_CALL set_timeout ( DWORD msec )

Return time for when given timeout (msec) expires.

Make sure it never returns 0 (it will confuse chk_timeout()).

Definition at line 501 of file timer.c.

References has_8254, and millisec_clock().

◆ set_ttimeout()

W32_FUNC unsigned long W32_CALL set_ttimeout ( unsigned ticks )
Deprecated:
Not needed in Watt-32. Return timeout from ticks.

Definition at line 36 of file oldstuff.c.

References has_8254, and set_timeout().

◆ sethostid()

W32_FUNC long W32_CALL sethostid ( u_long ip )

BSD-style: Sets local IPv4-address.

Return values
address on host order.

Definition at line 79 of file bsdname.c.

◆ sock_dataready()

W32_FUNC WORD W32_CALL sock_dataready ( sock_type * s )

sock_dataready - returns number of bytes waiting to be read.

  • if in ASCII mode, return >0 if a terminated line is present or the buffer is full or state is LASTACK (tcp only).
  • if in binary mode (default), simply return number of bytes in receive buffer.
  • For UDP or TCP sockets only.

Definition at line 246 of file sock_io.c.

References _raw_Socket::ip_type, and tcp_Socket::state.

◆ sock_debugdump()

W32_FUNC void W32_CALL sock_debugdump ( const sock_type * s )

Definition at line 14 of file sock_dbu.c.

◆ sock_established()

W32_FUNC int W32_CALL sock_established ( sock_type * s )

Definition at line 221 of file sock_in.c.

◆ sock_exit()

W32_FUNC void MS_CDECL sock_exit ( void )

Our only atexit() handler.

Called only once during normal program shutdown. Exception handlers exit differently (see except_handler() above)

Definition at line 1058 of file sock_ini.c.

References _watt_fatal_error, _watt_is_init, sock_init_called, and tcp_shutdown().

◆ sock_fgets()

W32_FUNC int W32_CALL sock_fgets | ( | char * | buf,
 |  | int | max,
 |  | FILE * | stream
 | ) |  |

Definition at line 46 of file stream.c.

◆ sock_fputs()

W32_FUNC int W32_CALL sock_fputs | ( | const char * | text,
 |  | FILE * | stream
 | ) |  |

Definition at line 65 of file stream.c.

◆ sock_getc()

W32_FUNC int W32_CALL sock_getc ( sock_type * s )

Definition at line 232 of file sock_io.c.

◆ sock_gets()

W32_FUNC WORD W32_CALL sock_gets | ( | sock_type * | s,
 |  | BYTE * | dp,
 |  | int | n
 | ) |  |

Definition at line 90 of file sock_io.c.

◆ sock_init_err()

W32_FUNC const char *W32_CALL sock_init_err ( int rc )

Definition at line 714 of file sock_ini.c.

◆ sock_preread()

W32_FUNC int W32_CALL sock_preread | ( | const sock_type * | s,
 |  | BYTE * | dp,
 |  | int | len
 | ) |  |

Definition at line 230 of file pcbuf.c.

◆ sock_putc()

W32_FUNC BYTE W32_CALL sock_putc | ( | sock_type * | s,
 |  | BYTE | c
 | ) |  |

Definition at line 23 of file sock_io.c.

◆ sock_puts()

W32_FUNC int W32_CALL sock_puts | ( | sock_type * | s,
 |  | const BYTE * | dp
 | ) |  |

<

Todo:
suppport UDP frags

Definition at line 39 of file sock_io.c.

References _raw_Socket::ip_type.

◆ sock_rbleft()

W32_FUNC size_t W32_CALL sock_rbleft ( const sock_type * s )

Definition at line 88 of file pcbuf.c.

◆ sock_rbsize()

W32_FUNC size_t W32_CALL sock_rbsize ( const sock_type * s )

Definition at line 44 of file pcbuf.c.

◆ sock_rbused()

W32_FUNC size_t W32_CALL sock_rbused ( const sock_type * s )

Definition at line 62 of file pcbuf.c.

◆ sock_recv()

W32_FUNC int W32_CALL sock_recv | ( | sock_type * | s,
 |  | void * | buf,
 |  | unsigned | len
 | ) |  |

Definition at line 283 of file pcrecv.c.

◆ sock_recv_from()

W32_FUNC int W32_CALL sock_recv_from | ( | sock_type * | s,
 |  | DWORD * | ip,
 |  | WORD * | port,
 |  | void * | buf,
 |  | unsigned | len,
 |  | int | peek
 | ) |  |

Definition at line 176 of file pcrecv.c.

◆ sock_recv_init()

W32_FUNC int W32_CALL sock_recv_init | ( | sock_type * | s,
 |  | void * | buf,
 |  | unsigned | len
 | ) |  |

Definition at line 155 of file pcrecv.c.

◆ sock_recv_used()

W32_FUNC int W32_CALL sock_recv_used ( const sock_type * s )

Definition at line 123 of file pcrecv.c.

◆ sock_setbuf()

W32_FUNC size_t W32_CALL sock_setbuf | ( | sock_type * | s,
 |  | BYTE * | buf,
 |  | size_t | len
 | ) |  |

Definition at line 152 of file pcbuf.c.

◆ sock_sig_exit()

W32_FUNC void W32_CALL sock_sig_exit | ( | const char * | msg,
 |  | int | sigint
 | ) |  |

Exit handler for unhandled signals.

Definition at line 1076 of file sock_ini.c.

References _watt_cbroke, and sock_exit().

◆ sock_sselect()

W32_FUNC int W32_CALL sock_sselect | ( | const sock_type * | s,
 |  | int | waitstate
 | ) |  |

Definition at line 17 of file sock_sel.c.

◆ sock_stats()

W32_FUNC int W32_CALL sock_stats | ( | sock_type * | s,
 |  | DWORD * | days,
 |  | WORD * | inactive,
 |  | WORD * | cwindow,
 |  | DWORD * | avg,
 |  | DWORD * | sd
 | ) |  |

Definition at line 58 of file pcstat.c.

◆ sock_sturdy()

W32_FUNC void W32_CALL sock_sturdy | ( | sock_type * | s,
 |  | int | level
 | ) |  |

Keep the socket open inspite of receiving "ICMP Unreachable" For UDP or TCP socket.

Definition at line 71 of file oldstuff.c.

◆ sock_tbleft()

W32_FUNC size_t W32_CALL sock_tbleft ( const sock_type * s )

Definition at line 125 of file pcbuf.c.

◆ sock_tbsize()

W32_FUNC size_t W32_CALL sock_tbsize ( const sock_type * s )

Definition at line 110 of file pcbuf.c.

◆ sock_tbused()

W32_FUNC size_t W32_CALL sock_tbused ( const sock_type * s )

Definition at line 140 of file pcbuf.c.

◆ sock_timeout()

W32_FUNC int W32_CALL sock_timeout | ( | sock_type * | s,
 |  | int | seconds
 | ) |  |

Definition at line 205 of file sock_in.c.

◆ sockerr()

W32_FUNC const char *W32_CALL sockerr ( const sock_type * s )

Definition at line 274 of file pcbuf.c.

◆ sockerr_clear()

W32_FUNC void W32_CALL sockerr_clear ( sock_type * s )

Definition at line 281 of file pcbuf.c.

◆ sockstate()

W32_FUNC const char *W32_CALL sockstate ( const sock_type * s )

Definition at line 290 of file pcbuf.c.

◆ tcp_cbreak()

W32_FUNC int W32_CALL tcp_cbreak ( int mode )

Sets our break mode.

  • ‘mode’ is composed of the following flags
    • 0x01: disallow breakouts
    • 0x10: display a message upon ^C/^BREAK (default)

Definition at line 208 of file pc_cbrk.c.

References set_cbreak(), sig_handler_watt(), sock_sig_exit(), and win32_dos_box.

◆ tcp_cbrk()

W32_FUNC int W32_CALL tcp_cbrk ( int mode )

Some deprecated functions.

Deprecated:
Actually simply a macro in <tcp.h>

Definition at line 27 of file oldstuff.c.

References tcp_cbreak().

◆ tcp_config()

W32_FUNC long W32_CALL tcp_config ( const char * path )

Definition at line 1223 of file pcconfig.c.

◆ tcp_config_name()

W32_FUNC int W32_CALL tcp_config_name | ( | char * | name,
 |  | int | max
 | ) |  |

Definition at line 1158 of file pcconfig.c.

◆ tcp_established()

W32_FUNC int W32_CALL tcp_established ( const tcp_Socket * s )

Returns 1 if TCP connection is established.

Definition at line 639 of file pctcp.c.

References tcp_Socket::state.

◆ tcp_inject_config()

W32_FUNC void W32_CALL tcp_inject_config | ( | const struct config_table * | cfg,
 |  | const char * | key,
 |  | const char * | value
 | ) |  |

Callable from a user application to inject config values before the normal WATTCP.CFG is loaded and parsed.

See '_watt_user_config' in sock_ini.c.

Definition at line 897 of file pcconfig.c.

References strntrimcpy(), and tcp_inject_config_direct().

◆ tcp_listen()

W32_FUNC int W32_CALL tcp_listen | ( | _tcp_Socket * | s,
 |  | WORD | lport,
 |  | DWORD | ip,
 |  | WORD | port,
 |  | ProtoHandler | handler,
 |  | WORD | timeout
 | ) |  |

Passively opens TCP a connection.

Listen for a connection on a particular port

<

Todo:
use mss from setsockopt()

Definition at line 407 of file pctcp.c.

References _default_ttl, _eth_is_init, _inet_ntoa(), _tcp_allsocs, _tcp_unthread(), tcp_Socket::cwindow, tcp_Socket::max_seg, tcp_Socket::max_tx_data, tcp_Socket::next, tcp_Socket::rx_buf, tcp_Socket::safetysig, tcp_Socket::safetytcp, tcp_Socket::send_next, set_timeout(), tcp_Socket::state, tcp_nagle, tcp_Socket::timeout, tcp_Socket::tx_buf, tcp_Socket::tx_data, tcp_Socket::unhappy, tcp_Socket::vj_sa, and tcp_Socket::wwindow.

◆ tcp_md5_secret()

W32_FUNC const char *W32_CALL tcp_md5_secret | ( | tcp_Socket * | s,
 |  | const char * | secret
 | ) |  |

Definition at line 63 of file tcp_md5.c.

◆ tcp_open()

W32_FUNC int W32_CALL tcp_open | ( | _tcp_Socket * | s,
 |  | WORD | lport,
 |  | DWORD | ip,
 |  | WORD | rport,
 |  | ProtoHandler | handler
 | ) |  |

Actively open a TCP connection.

Make connection to a particular destination. Not used for IPv6 (see _TCP6_open()).

Return values
0 on error. 's->err_msg' filled.
Note
'lport' is local port to associate with the connection.
'rport' is remote port for same connection.

<

Todo:
use mss from setsockopt()
Todo:
use TCP_NODELAY set in setsockopt()

Definition at line 328 of file pctcp.c.

References _arp_start_lookup(), _default_ttl, _eth_is_init, _inet_ntoa(), _tcp_allsocs, _tcp_unthread(), tcp_Socket::cwindow, tcp_Socket::flags, tcp_Socket::max_seg, tcp_Socket::max_tx_data, my_ip_addr, tcp_Socket::next, tcp_Socket::rto, tcp_Socket::rx_buf, tcp_Socket::safetysig, tcp_Socket::safetytcp, tcp_Socket::send_next, tcp_Socket::state, tcp_nagle, tcp_OPEN_TO, tcp_Socket::tx_buf, tcp_Socket::tx_data, tcp_Socket::unhappy, tcp_Socket::vj_sa, and tcp_Socket::wwindow.

◆ tcp_set_debug_state()

W32_FUNC void W32_CALL tcp_set_debug_state ( WORD val )

Old comptibility function.

Callable from apps using Watt-32 only. Only allow apps to set a higher level than specified in cfg-file. Default: 'debug_on == 0'.

Definition at line 856 of file pcconfig.c.

◆ tcp_simple_state()

W32_FUNC enum TCP_SIMPLE_STATE W32_CALL tcp_simple_state ( const tcp_Socket * s )

Definition at line 42 of file sock_sel.c.

◆ tcp_tick()

W32_FUNC WORD W32_CALL tcp_tick ( sock_type * s )

Must be called periodically by user application (or BSD socket API).

  • if 's != NULL', check this socket for timeout.
  • if 's == NULL', check all sockets in list.
Return values
0 | if 's' is non-NULL and 's' closes.
!0 | if 's' is NULL or 's' is still open.

Don't enter this loop if reentered. That could return the same packet twice (before we call _eth_free() on the 1st packet).

Todo:
Limit the time spent here (clamp # of loops)

Definition at line 1395 of file pctcp.c.

References _arp_handler(), _eth_arrived(), _eth_free(), _ip4_handler(), _rarp_handler(), _tcp_unthread(), pppoe_handler(), tcp_Socket::state, and tcp_Retransmitter().

◆ timeval_diff()

W32_FUNC double W32_CALL timeval_diff | ( | const struct timeval * | a,
 |  | const struct timeval * | b
 | ) |  |

Return difference (in micro-sec) between timevals *newer and *older.

Definition at line 638 of file timer.c.

◆ timeval_diff2()

W32_FUNC struct timeval W32_CALL timeval_diff2 | ( | struct timeval * | a,
 |  | struct timeval * | b
 | ) |  |

Definition at line 652 of file timer.c.

◆ unixtodos()

W32_FUNC void W32_CALL unixtodos | ( | time_t | time,
 |  | struct date * | d,
 |  | struct time * | t
 | ) |  |

Definition at line 110 of file oldstuff.c.

◆ userTimerTick()

W32_FUNC void W32_CALL userTimerTick ( DWORD elapsed_time_msec )

Provide timer-ticks from an application.

This should be periodically called from user code to increment the timer count once activated via init_userSuppliedTimerTick(). Best called from a periodic interrupt handler (int 8/1Ch/70h) which is the case now with init_timer_isr().

by GvB 2002-09

Definition at line 198 of file timer.c.

◆ W32_CLANG_PACK_WARN_DEF()

W32_CLANG_PACK_WARN_DEF ( )

This hook is to prevent the BSD-socket API being linked in by default.

It is only set from the BSD functions when needed.

Definition at line 514 of file tcp.h.

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 492 of file tcp.h.

◆ watt_filelength()

W32_FUNC long W32_CALL watt_filelength ( int fd )

filelength() is needed in pcconfig.c and some applications.

So add this utility function here.

Definition at line 946 of file misc.c.

◆ watt_getopt()

W32_FUNC int W32_CALL watt_getopt | ( | int | argc,
 |  | char *const * | argv,
 |  | const char * | opt_str
 | ) |  |

Definition at line 50 of file getopt.c.

◆ watt_kbhit()

W32_FUNC int W32_CALL watt_kbhit ( void )

A less CPU hogging kbhit().

Definition at line 917 of file misc.c.

References _watt_cbroke.

◆ watt_sock_init()

W32_FUNC int W32_CALL watt_sock_init | ( | size_t | tcp_Sock_size,
 |  | size_t | udp_Sock_size,
 |  | size_t | time_t_size
 | ) |  |
Todo:
Use auto-configuration and set 'my_ip_addr' to 169.254/16

Definition at line 769 of file sock_ini.c.

References _arp_check_gateways(), _arp_init(), _bootp_on, _dhcp_on, _do_mask_req, _inet_ntoa(), _pkt_inf, _rarp_on, _watt_is_init, _watt_no_config, DHCP_init(), DHCP_read_config(), do_exit(), echo_discard_init(), init_misc(), my_ip_addr, old_break, pppoe_init(), pppoe_start(), reverse_lookup_myip(), setup_sig_handlers(), sin_mask, sock_exit(), sock_init_called, survive_eth, tcp_cbreak(), tcp_do_bootp(), tcp_init(), tcp_post_init(), tftp_boot_load(), and tftp_init().

◆ wattcpBuildCC()

W32_FUNC const char *W32_CALL wattcpBuildCC ( void )

Return the target/compiler.

E.g. "_MSC_VER" for MSVC.

Definition at line 556 of file version.c.

◆ wattcpBuildCCexe()

W32_FUNC const char *W32_CALL wattcpBuildCCexe ( void )

Return the the name if the compiler used.

E.g. "cl" for MSVC.

Definition at line 543 of file version.c.

◆ wattcpBuildCflags()

W32_FUNC const char *W32_CALL wattcpBuildCflags ( void )

Definition at line 587 of file version.c.

◆ wattcpCapabilities()

W32_FUNC const char *W32_CALL wattcpCapabilities ( void )

Return compiled-in capabilities and features.

These features are set in "config.h" or in the generated "*.mak" file.

Definition at line 743 of file version.c.

◆ wattcpVersion()

W32_FUNC const char *W32_CALL wattcpVersion ( void )

Return string for Watt-32 version.

Include this:

  • Name and version of compiler used to build Watt-32.
  • Target environment (if any).
  • Build date.

E.g. Watt-32 (2.2.11 Win32), GNU-C 4.5.3, CygWin 1.7.16, Aug 31 2012

Definition at line 77 of file version.c.

◆ win_strerror()

W32_FUNC char *W32_CALL win_strerror ( DWORD err )

Return err-number and string for 'err'.

Only use this with GetLastError(). (or WSAGetLastError() if Winsock is used somehow ... linked dynamically?). Does not handle libc errno's. Remove trailing [\r
.]

Definition at line 208 of file winmisc.c.

◆ wintr_disable()

W32_FUNC void W32_CALL wintr_disable ( void )

Definition at line 84 of file pcintr.c.

◆ wintr_enable()

W32_FUNC int W32_CALL wintr_enable ( void )

Definition at line 77 of file pcintr.c.

◆ wintr_init()

W32_FUNC void W32_CALL wintr_init ( void )

Definition at line 120 of file pcintr.c.

◆ wintr_shutdown()

W32_FUNC void W32_CALL wintr_shutdown ( void )

Definition at line 110 of file pcintr.c.

◆ write_s()

W32_FUNC int W32_CALL write_s | ( | int | s,
 |  | const char * | buf,
 |  | int | nbyte
 | ) |  |

Definition at line 63 of file transmit.c.

◆ writev_s()

W32_FUNC int W32_CALL writev_s | ( | int | s,
 |  | const struct iovec * | vector,
 |  | size_t | count
 | ) |  |

Definition at line 68 of file transmit.c.

Variable Documentation

◆ _mss

W32_DATA unsigned _mss

Definition at line 340 of file tcp.h.

◆ _mtu

W32_DATA unsigned _mtu

Definition at line 340 of file tcp.h.

◆ _multicast_intvl

W32_DATA int _multicast_intvl

Definition at line 712 of file tcp.h.

◆ _multicast_on

W32_DATA int _multicast_on

Definition at line 712 of file tcp.h.

◆ _resolve_exit

W32_DATA BOOL _resolve_exit

Definition at line 366 of file tcp.h.

◆ _resolve_timeout

W32_DATA BOOL _resolve_timeout

Definition at line 367 of file tcp.h.

◆ _w_watt_optarg

W32_DATA wchar_t* _w_watt_optarg
Todo:
Add some internal aliases for getopt processing

Definition at line 770 of file tcp.h.

◆ _w_watt_optswchar

W32_DATA wchar_t* _w_watt_optswchar

Definition at line 771 of file tcp.h.

◆ _watt_cbroke

W32_DATA volatile int _watt_cbroke

increment on SIGINT catch

Definition at line 339 of file tcp.h.

◆ _watt_do_exit

W32_DATA BOOL _watt_do_exit

Definition at line 278 of file tcp.h.

◆ _watt_handle_cbreak

W32_DATA WORD _watt_handle_cbreak

Turn off stack-checking here because stack may be out of bounds.

longjmp() hopefully fixes that. changes operation of the break stuff

Definition at line 338 of file tcp.h.

◆ _watt_no_config

W32_DATA int _watt_no_config

Definition at line 477 of file tcp.h.

◆ block_icmp

W32_DATA int block_icmp

Definition at line 273 of file tcp.h.

◆ block_ip

W32_DATA int block_ip

Definition at line 274 of file tcp.h.

◆ block_tcp

W32_DATA int block_tcp

Definition at line 271 of file tcp.h.

◆ block_udp

W32_DATA int block_udp

Definition at line 272 of file tcp.h.

◆ clocks_per_usec

W32_DATA DWORD clocks_per_usec

Definition at line 344 of file tcp.h.

◆ Cookies

W32_DATA DWORD Cookies[MAX_COOKIES]

Definition at line 276 of file tcp.h.

◆ ctrace_on

W32_DATA int ctrace_on

Definition at line 341 of file tcp.h.

◆ debug_on

W32_DATA int debug_on

Definition at line 342 of file tcp.h.

◆ def_domain

W32_DATA char* def_domain

Definition at line 370 of file tcp.h.

◆ def_nameservers

W32_DATA DWORD def_nameservers[MAX_NAMESERVERS]

Definition at line 371 of file tcp.h.

◆ defaultdomain

W32_DATA char defaultdomain[MAX_HOSTLEN+1]

Definition at line 369 of file tcp.h.

◆ DHCP_did_gratuitous_arp

W32_DATA BOOL DHCP_did_gratuitous_arp

Definition at line 522 of file tcp.h.

◆ dns_recurse

W32_DATA BOOL dns_recurse

Definition at line 337 of file tcp.h.

◆ dns_timeout

W32_DATA WORD dns_timeout

Definition at line 336 of file tcp.h.

◆ dom_errno

W32_DATA int dom_errno

Definition at line 373 of file tcp.h.

◆ has_rdtsc

W32_DATA int has_rdtsc

Definition at line 343 of file tcp.h.

◆ last_cookie

W32_DATA WORD last_cookie

Definition at line 275 of file tcp.h.

◆ last_nameserver

W32_DATA WORD last_nameserver

Definition at line 372 of file tcp.h.

◆ len

W32_DATA unsigned len

Definition at line 569 of file tcp.h.

◆ length

W32_DATA size_t length

Definition at line 540 of file tcp.h.

◆ multihomes

W32_DATA WORD multihomes

Definition at line 269 of file tcp.h.

◆ my_ip_addr

W32_DATA DWORD my_ip_addr

Definition at line 264 of file tcp.h.

◆ sin_mask

W32_DATA DWORD sin_mask

Definition at line 265 of file tcp.h.

◆ sock_data_timeout

W32_DATA int sock_data_timeout

Definition at line 268 of file tcp.h.

◆ sock_delay

W32_DATA int sock_delay

Definition at line 266 of file tcp.h.

◆ sock_inactive

W32_DATA int sock_inactive

Definition at line 267 of file tcp.h.

◆ survive_bootp

W32_DATA BOOL survive_bootp

Definition at line 280 of file tcp.h.

◆ survive_dhcp

W32_DATA BOOL survive_dhcp

Survive a failed DHCP attempt.

Don't survive a failed DHCP attempt.

Definition at line 281 of file tcp.h.

◆ survive_eth

W32_DATA BOOL survive_eth

GvB 2002-09, allows us to survive without a (working) packet driver at all - in cases where life still has a meaning without TCP/IP.

Definition at line 279 of file tcp.h.

◆ survive_rarp

W32_DATA BOOL survive_rarp

Definition at line 282 of file tcp.h.

◆ tcp_CLOSE_TO

W32_DATA unsigned tcp_CLOSE_TO

Definition at line 285 of file tcp.h.

◆ tcp_keep_idle

W32_DATA unsigned tcp_keep_idle

Definition at line 345 of file tcp.h.

◆ tcp_keep_intvl

W32_DATA unsigned tcp_keep_intvl

Definition at line 346 of file tcp.h.

◆ tcp_max_idle

W32_DATA unsigned tcp_max_idle

Definition at line 347 of file tcp.h.

◆ tcp_MAX_VJSA

W32_DATA unsigned tcp_MAX_VJSA

Definition at line 291 of file tcp.h.

◆ tcp_MAX_VJSD

W32_DATA unsigned tcp_MAX_VJSD

Definition at line 292 of file tcp.h.

◆ tcp_OPEN_TO

W32_DATA unsigned tcp_OPEN_TO

Definition at line 284 of file tcp.h.

◆ tcp_recv_win

W32_DATA DWORD tcp_recv_win

Definition at line 293 of file tcp.h.

◆ tcp_RETRAN_TIME

W32_DATA unsigned tcp_RETRAN_TIME

Definition at line 290 of file tcp.h.

◆ tcp_RST_TIME

W32_DATA unsigned tcp_RST_TIME

Definition at line 289 of file tcp.h.

◆ tcp_RTO_ADD

W32_DATA unsigned tcp_RTO_ADD

Definition at line 286 of file tcp.h.

◆ tcp_RTO_BASE

W32_DATA unsigned tcp_RTO_BASE

Definition at line 287 of file tcp.h.

◆ tcp_RTO_SCALE

W32_DATA unsigned tcp_RTO_SCALE

Definition at line 288 of file tcp.h.

◆ value

W32_DATA const char* value

Definition at line 441 of file tcp.h.

◆ watt_optarg

W32_DATA char* watt_optarg

Definition at line 749 of file tcp.h.

◆ watt_opterr

W32_DATA int watt_opterr

Definition at line 751 of file tcp.h.

◆ watt_optind

W32_DATA int watt_optind

Definition at line 750 of file tcp.h.

◆ watt_optopt

W32_DATA int watt_optopt

Definition at line 752 of file tcp.h.

◆ watt_optswchar

W32_DATA char* watt_optswchar

Definition at line 753 of file tcp.h.

◆ wattcpCopyright

W32_DATA const char* wattcpCopyright

Definition at line 57 of file tcp.h.


Watt-32 tcp/ip: E:/WATT/src Directory Reference

  • src
src Directory Reference
Directory dependency graph for src:

Files

file | accept.c [code]
file | asmpkt.h [code]
file | bind.c [code]
file | bsddbug.c [code]
file | bsddbug.h [code]
file | bsdname.c [code]
file | bsdname.h [code]
file | btrace.h [code]
file | chksum.c [code]
file | chksum.h [code]
file | close.c [code]
file | config.h [code]
file | connect.c [code]
file | copyrigh.h [code]
file | country.c [code]
file | cpuid.c [code]
file | cpumodel.h [code]
file | crc.c [code]
file | crit.c [code]
file | dynip.c [code]
file | dynip.h [code]
file | echo.c [code]
file | echo.h [code]
file | enum_cp.c [code]
file | fcntl.c [code]
file | fsext.c [code]
file | gcc-cdecl.c [code]
file | get_ai.c [code]
file | get_ip.c [code]
file | get_ni.c [code]
file | get_xby.h [code]
file | geteth.c [code]
file | gethost.c [code]
file | gethost6.c [code]
file | getname.c [code]
file | getnet.c [code]
file | getopt.c [code]
file | getprot.c [code]
file | getput.c [code]
file | getserv.c [code]
file | gettod.c [code]
file | gettod.h [code]
file | hc_test.c [code]
file | hello.c [code]
file | highc.c [code]
file | idna.c [code]
file | idna.h [code]
file | ioctl.c [code]
file | ioport.h [code]
file | ip4_frag.c [code]
file | ip4_frag.h [code]
file | ip4_in.c [code]
file | ip4_in.h [code]
file | ip4_out.c [code]
file | ip4_out.h [code]
file | ip6_in.c [code]
file | ip6_in.h [code]
file | ip6_out.c [code]
file | ip6_out.h [code]
file | ip_info.c [code]
file | lang.c [code]
file | language.c [code]
file | language.h [code]
file | linkaddr.c [code]
file | listen.c [code]
file | lookup.c [code]
file | loopback.c [code]
file | loopback.h [code]
file | misc.c [code]
file | misc.h [code]
file | misc_str.c [code]
file | misc_str.h [code]
file | netaddr.c [code]
file | netaddr.h [code]
file | netback.c [code]
file | neterr.c [code]
file | nettime.c [code]
file | nochkstk.h [code]
file | nsapaddr.c [code]
file | oldstuff.c [code]
file | oui-generated.c [code]
file | packet32.c [code]
file | packet32.h [code]
file | pc_cbrk.c [code]
file | pcarp.c [code]
file | pcarp.h [code]
file | pcbootp.c [code]
file | pcbootp.h [code]
file | pcbuf.c [code]
file | pcbuf.h [code]
file | pcconfig.c [code]
file | pcconfig.h [code]
file | pcdbug.c [code]
file | pcdbug.h [code]
file | pcdhcp.c [code]
file | pcdhcp.h [code]
file | pcdns.c [code]
file | pcdns.h [code]
file | pcicmp.c [code]
file | pcicmp.h [code]
file | pcicmp6.c [code]
file | pcicmp6.h [code]
file | pcigmp.c [code]
file | pcigmp.h [code]
file | pcintr.c [code]
file | pcping.c [code]
file | pcpkt.c [code]
file | pcpkt.h [code]
file | pcpkt32.c [code]
file | pcpkt32.h [code]
file | pcqueue.c [code]
file | pcqueue.h [code]
file | pcrarp.c [code]
file | pcrarp.h [code]
file | pcrecv.c [code]
file | pcrecv.h [code]
file | pcsarp.c [code]
file | pcsarp.h [code]
file | pcsed.c [code]
file | pcsed.h [code]
file | pcslip.h [code]
file | pcstat.c [code]
file | pcstat.h [code]
file | pctcp.c [code]
file | pctcp.h [code]
file | ports.c [code]
file | powerpak.c [code]
file | powerpak.h [code]
file | ppp.c [code]
file | ppp.h [code]
file | pppoe.c [code]
file | pppoe.h [code]
file | presaddr.c [code]
file | printk.c [code]
file | printk.h [code]
file | profile.c [code]
file | profile.h [code]
file | punycode.c [code]
file | punycode.h [code]
file | qmsg.c [code]
file | receive.c [code]
file | register.h [code]
file | res_comp.c [code]
file | res_data.c [code]
file | res_debu.c [code]
file | res_init.c [code]
file | res_loc.c [code]
file | res_mkqu.c [code]
file | res_quer.c [code]
file | res_send.c [code]
file | resolver.h [code]
file | run.c [code]
file | run.h [code]
file | sctp.h [code]
file | select.c [code]
file | settod.c [code]
file | settod.h [code]
file | shutdown.c [code]
file | signal.c [code]
file | sock_dbu.c [code]
file | sock_in.c [code]
file | sock_ini.c [code]
file | sock_ini.h [code]
file | sock_io.c [code]
file | sock_prn.c [code]
file | sock_scn.c [code]
file | sock_sel.c [code]
file | socket.c [code]
file | socket.h [code]
file | sockopt.c [code]
file | split.c [code]
file | split.h [code]
file | stkwalk.h [code]
file | stream.c [code]
file | swsvpkt.c [code]
file | swsvpkt.h [code]
file | syslog.c [code]
file | syslog2.c [code]
file | syslog2.h [code]
file | target.h [code]
file | tcp_fsm.c [code]
file | tcp_md5.c [code]
file | teredo64.c [code]
file | teredo64.h [code]
file | tftp.c [code]
file | tftp.h [code]
file | timer.c [code]
file | timer.h [code]
file | transmit.c [code]
file | tst.c [code]
file | UBSAN-issue.c [code]
file | udp_rev.c [code]
file | version.c [code]
file | w32_ndis.h [code]
file | wattcp.c [code]
file | wattcp.h [code]
Core definitions.
file | wdpmi.c [code]
file | wdpmi.h [code]
file | win_dll.c [code]
file | win_dll.h [code]
file | winadinf.c [code]
file | winadinf.h [code]
file | winmisc.c [code]
file | winpkt.c [code]
file | winpkt.h [code]
file | x32vm.c [code]
file | x32vm.h [code]
file | zadler32.c [code]
file | zcompres.c [code]
file | zconf.h [code]
file | zcrc32.c [code]
file | zcrc32.h [code]
file | zdeflate.c [code]
file | zdeflate.h [code]
file | zgzio.c [code]
file | zinfback.c [code]
file | zinffast.c [code]
file | zinffast.h [code]
file | zinffix.h [code]
file | zinflate.c [code]
file | zinflate.h [code]
file | zinftree.c [code]
file | zinftree.h [code]
file | zlib.h [code]
file | ztrees.c [code]
file | ztrees.h [code]
file | zuncompr.c [code]
file | zutil.c [code]
file | zutil.h [code]


Watt-32 tcp/ip: E:/WATT/src/accept.c File Reference

  • src
Functions
accept.c File Reference

Go to the source code of this file.

Functions

static int | dup_bind (Socket *socket, Socket **clone, int idx)
static int | alloc_addr (Socket *socket, Socket *clone)
static void | listen_free (Socket *socket, int idx)
int W32_CALL | accept (int s, struct sockaddr *addr, socklen_t *addrlen)
int | _sock_append (_tcp_Socket **tcp)
Called from tcp_fsm.c / tcp_listen_state() (via _bsd_socket_hook) to append a new connection to the listen-queue of socket 'sock'.

Detailed Description

BSD accept().

Definition in file accept.c.

Function Documentation

◆ _sock_append()

int _sock_append ( _tcp_Socket ** tcp )

Called from tcp_fsm.c / tcp_listen_state() (via _bsd_socket_hook) to append a new connection to the listen-queue of socket 'sock'.

TCB on input ('orig') has received a SYN. Replace TCB on output with a cloned TCB that we append to the listen-queue and eventually is used by accept() to create a new socket.

TCB on input ('orig') must still be listening for further connections on the same port as specified in call to _TCP_listen().

Todo:
Implement SYN-cookies. Ref. http://cr.yp.to/syncookies.html
Todo:
Implement SYN-cookies and drop the segment if no match
Todo:
drop the oldest (or a random) slot in the listen-queue.

Definition at line 426 of file accept.c.

References _sock_set_rcv_buf(), _tcp_allsocs, tcp_Socket::last_acknum, tcp_Socket::last_seqnum, tcp_Socket::max_tx_data, tcp_Socket::my6addr, tcp_Socket::next, tcp_Socket::send_next, set_timeout(), tcp_recv_win, tcp_Socket::tx_buf, tcp_Socket::tx_data, tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ accept()

int W32_CALL accept | ( | int | s,
 |  | struct sockaddr * | addr,
 |  | socklen_t * | addrlen
 | ) |  |
Todo:
Should maybe loop over all maxconn TCBs and accept the one with oldest 'syn_timestamp'.

Definition at line 67 of file accept.c.

References _inet6_ntoa(), _sock_crit_start(), _sock_crit_stop(), _sock_free_rcv_buf(), _socklist_find(), _tcp_unthread(), chk_timeout(), tcp_Socket::his6addr, set_timeout(), and tcp_Socket::state.

◆ alloc_addr()

static int alloc_addr | ( | Socket * | socket,
 |  | Socket * | clone
 | ) |  |
static

Definition at line 343 of file accept.c.

◆ dup_bind()

static int dup_bind | ( | Socket * | socket,
 |  | Socket ** | clone,
 |  | int | idx
 | ) |  |
static

Definition at line 307 of file accept.c.

◆ listen_free()

static void listen_free | ( | Socket * | socket,
 |  | int | idx
 | ) |  |
static

Definition at line 403 of file accept.c.


Watt-32 tcp/ip: E:/WATT/src/asmpkt.h File Reference

  • src
Functions | Variables
asmpkt.h File Reference

Go to the source code of this file.

Functions

void far cdecl | pkt_receiver_rm (void)
void cdecl | pkt_receiver4_start (void)
void cdecl | pkt_receiver4_rm (void)
void cdecl | pkt_receiver4_end (void)

Variables

WORD cdecl | asmpkt_size_chk
struct pkt_info *cdecl | asmpkt_inf

Detailed Description

Prototypes for functions in asmpkt.asm and asmpkt4.asm

Definition in file asmpkt.h.


Watt-32 tcp/ip: E:/WATT/src/bind.c File Reference

  • src
Functions
bind.c File Reference

Go to the source code of this file.

Functions

int W32_CALL | bind (int s, const struct sockaddr *myaddr, socklen_t namelen)
bind() - bind name to socket.
int | main (void)
int | main (int argc, char **argv)

Detailed Description

BSD bind().

Definition in file bind.c.

Function Documentation

◆ bind()

int W32_CALL bind | ( | int | s,
 |  | const struct sockaddr * | myaddr,
 |  | socklen_t | namelen
 | ) |  |

bind() - bind name to socket.

The purpose of bind is to fill in the information for the local IP address and local port (local_addr). In this respect, it is the opposite of connect(). connect() fills in the destination IP address and destination port (remote_addr). In most situations, one does not need to call bind().

Calling bind() on a

Precondition
SOCK_DGRAM socket and for multiple addresses ('myaddr->sin_addr.s_addr == INADDR_ANY' ) requires special attention: Wattcp's 'udp_handler()' doesn't store address information for broadcast.

We therefore install a 's->dataHandler' pointing to '_recvdaemon()' which queues up SOCK_DGRAM messages. This queue is polled (by 'sock_recv_from()') when we call 'receive()' on such a socket. Thus the '*from' address in 'receive()' will be correctly set to source address/port of peer.

Todo:
check for "sleeping" ports (lport_inuse in pctcp.c) also. And return EADDRINUSE if local port not free.

Definition at line 63 of file bind.c.

References _inet6_ntoa(), _sock_chk_sockaddr(), _socklist_find(), and _UDP6_listen().

◆ main() [1/2]

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 248 of file bind.c.

◆ main() [2/2]

int main ( void )

Definition at line 228 of file bind.c.


Watt-32 tcp/ip: E:/WATT/src/bsddbug.c File Reference

  • src
Functions | Variables
bsddbug.c File Reference

Go to the source code of this file.

Functions

static | void (W32_CALL *prev_hook)(const char *
static void W32_CALL | bsddbug_exit (void)
static void | bsddbug_close (void)
static int | ods_printf (const char *fmt, va_list arg)
int MS_CDECL | _sock_debugf (const char *fmt,...)
BOOL | _sock_dbug_active (void)
void | _sock_dbug_flush (void)
void | _sock_dbug_open (void)
static void | set_dbg_fname (const char *value)
static void | set_dbg_openmode (const char *value)
static void W32_CALL | dbug_parse (const char *name, const char *value)
void | _sock_dbug_init (void)
static void | show_local_ports_inuse (void)
void | _sock_enter_scope (void)
void | _sock_leave_scope (void)

Variables

static int | sk_scope = 0
static const char *static BOOL | dbg_use_ods = FALSE
static FILE * | dbg_file = NULL
static char | dbg_omode [5] = "w+"
static char | dbg_fname [MAX_PATHLEN+1] = ""

Detailed Description

BSD socket debugging.

Definition in file bsddbug.c.

Function Documentation

◆ _sock_dbug_active()

BOOL _sock_dbug_active ( void )

Definition at line 130 of file bsddbug.c.

◆ _sock_dbug_flush()

void _sock_dbug_flush ( void )

Definition at line 135 of file bsddbug.c.

◆ _sock_dbug_init()

void _sock_dbug_init ( void )

Definition at line 229 of file bsddbug.c.

◆ _sock_dbug_open()

void _sock_dbug_open ( void )

Definition at line 151 of file bsddbug.c.

◆ _sock_debugf()

int MS_CDECL _sock_debugf | ( | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 64 of file bsddbug.c.

◆ _sock_enter_scope()

void _sock_enter_scope ( void )

Definition at line 349 of file bsddbug.c.

◆ _sock_leave_scope()

void _sock_leave_scope ( void )

Definition at line 355 of file bsddbug.c.

◆ bsddbug_close()

static void bsddbug_close ( void )
static

Definition at line 318 of file bsddbug.c.

◆ bsddbug_exit()

static void W32_CALL bsddbug_exit ( void )
static

Definition at line 327 of file bsddbug.c.

◆ dbug_parse()

static void W32_CALL dbug_parse | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Definition at line 213 of file bsddbug.c.

◆ ods_printf()

static int ods_printf | ( | const char * | fmt,
 |  | va_list | arg
 | ) |  |
static
Todo:
: Needs to be rewritten to handle line-buffering. !!

Definition at line 270 of file bsddbug.c.

References elapsed_str(), set_timeout(), and sk_scope.

◆ set_dbg_fname()

static void set_dbg_fname ( const char * value )
static

Definition at line 186 of file bsddbug.c.

◆ set_dbg_openmode()

static void set_dbg_openmode ( const char * value )
static

Definition at line 200 of file bsddbug.c.

◆ show_local_ports_inuse()

static void show_local_ports_inuse ( void )
static

Definition at line 235 of file bsddbug.c.

Variable Documentation

◆ dbg_file

FILE* dbg_file = NULL
static

Definition at line 53 of file bsddbug.c.

◆ dbg_fname

char dbg_fname[MAX_PATHLEN+1] = ""
static

Definition at line 55 of file bsddbug.c.

◆ dbg_omode

char dbg_omode[5] = "w+"
static

Definition at line 54 of file bsddbug.c.

◆ dbg_use_ods

const char* static BOOL dbg_use_ods = FALSE
static

Definition at line 52 of file bsddbug.c.

◆ sk_scope

int sk_scope = 0
static

scope-level (indent printout)

Definition at line 48 of file bsddbug.c.


Watt-32 tcp/ip: E:/WATT/src/bsddbug.h File Reference

  • src
Functions
bsddbug.h File Reference

Go to the source code of this file.

Functions

_CRTCHK (printf, 2, 3) int _sock_debugf(const char *fmt
int MS_CDECL | _sock_debugf (_Printf_format_string_ const char *fmt,...) W32_ATTR_PRINTF(1
int MS_CDECL void | _sock_dbug_flush (void)
void | _sock_dbug_init (void)
void | _sock_dbug_open (void)
BOOL | _sock_dbug_active (void)
void | _sock_enter_scope (void)
void | _sock_leave_scope (void)

Function Documentation

◆ _sock_dbug_active()

BOOL _sock_dbug_active ( void )

Definition at line 130 of file bsddbug.c.

◆ _sock_dbug_flush()

int MS_CDECL void _sock_dbug_flush ( void )

Definition at line 135 of file bsddbug.c.

◆ _sock_dbug_init()

void _sock_dbug_init ( void )

Definition at line 229 of file bsddbug.c.

◆ _sock_dbug_open()

void _sock_dbug_open ( void )

Definition at line 151 of file bsddbug.c.

◆ _sock_enter_scope()

void _sock_enter_scope ( void )

Definition at line 349 of file bsddbug.c.

◆ _sock_leave_scope()

void _sock_leave_scope ( void )

Definition at line 355 of file bsddbug.c.


Watt-32 tcp/ip: E:/WATT/src/bsdname.c File Reference

  • src
Functions
bsdname.c File Reference

Go to the source code of this file.

Functions

DWORD W32_CALL | _gethostid (void)
Core style: Returns local IPv4-address.
DWORD W32_CALL | _sethostid (DWORD ip)
Core-style: Sets local IPv4-address.
XHOSTID_RETV W32_CALL | gethostid (void)
BSD style: returns local IPv4-address.
XHOSTID_RETV W32_CALL | sethostid (u_long ip)
BSD-style: Sets local IPv4-address.
const void * | _gethostid6 (void)
Core-style: Returns local IPv6-address.
void | _sethostid6 (const void *addr)
Core-style: Sets local IPv6-address.
int W32_CALL | _getpeername (const sock_type *s, void *dest, int *len)
Core-style:
Return 'watt_sockaddr' for peer in a UDP/TCP connection.
int W32_CALL | _getsockname (const sock_type *s, void *dest, int *len)
Core-style:
Return 'watt_sockaddr' for our side of a UDP/TCP connection.
int W32_CALL | getdomainname (char *buffer, size_t buflen)
BSD-style:
Return domain name of this host.
int W32_CALL | setdomainname (const char *name, size_t len)
BSD-style:
Set the host's domain name.
int W32_CALL | gethostname (char *buffer, GETHOSTNAME_ARG2 buflen)
int W32_CALL | sethostname (const char *fqdn, SETHOSTNAME_ARG2 len)
BSD-style:
Expects a "Fully Qualified Domain Name" in ‘fqdn’.
int | _get_machine_name (char *buf, int size)
Try asking a LAN extension of DOS for a host-name.

Detailed Description

BSD and core-style name function.

Deprecated:
Oldstyle BSD similar functions are prefixed with '_'.

Definition in file bsdname.c.

Function Documentation

◆ _get_machine_name()

int _get_machine_name | ( | char * | buf,
 |  | int | size
 | ) |  |

Try asking a LAN extension of DOS for a host-name.

Work for a DOS-box under Windows-XP.

Todo:

Definition at line 350 of file bsdname.c.

◆ _gethostid()

DWORD W32_CALL _gethostid ( void )

Core style: Returns local IPv4-address.

Return values
address on host order.

Definition at line 49 of file bsdname.c.

References my_ip_addr.

◆ _gethostid6()

const void * _gethostid6 ( void )

Core-style: Returns local IPv6-address.

Note
no BSD equivalent for this.
Return values
pointer to current local IPv6 address.

Definition at line 91 of file bsdname.c.

References netdb_init().

◆ _getpeername()

int W32_CALL _getpeername | ( | const sock_type * | s,
 |  | void * | dest,
 |  | int * | len
 | ) |  |

Core-style:
Return 'watt_sockaddr' for peer in a UDP/TCP connection.

Definition at line 112 of file bsdname.c.

◆ _getsockname()

int W32_CALL _getsockname | ( | const sock_type * | s,
 |  | void * | dest,
 |  | int * | len
 | ) |  |

Core-style:
Return 'watt_sockaddr' for our side of a UDP/TCP connection.

Definition at line 147 of file bsdname.c.

◆ _sethostid()

DWORD W32_CALL _sethostid ( DWORD ip )

Core-style: Sets local IPv4-address.

Return values
address on host order.

Definition at line 58 of file bsdname.c.

References my_ip_addr.

◆ _sethostid6()

void _sethostid6 ( const void * addr )

Core-style: Sets local IPv6-address.

Note
no BSD equivalent for this.

Definition at line 102 of file bsdname.c.

◆ getdomainname()

int W32_CALL getdomainname | ( | char * | buffer,
 |  | size_t | buflen
 | ) |  |

BSD-style:
Return domain name of this host.

As per BSD spec, the resultant buffer ... ... "will be null-terminated _unless_there_is_insufficient_space_";

Set errno on failure and return -1.

Definition at line 186 of file bsdname.c.

◆ gethostid()

W32_FUNC u_long W32_CALL gethostid ( void )

BSD style: returns local IPv4-address.

Return values
address on network order.

Definition at line 68 of file bsdname.c.

References my_ip_addr, and netdb_init().

◆ gethostname()

int W32_CALL gethostname | ( | char * | buffer,
 |  | GETHOSTNAME_ARG2 | buflen
 | ) |  |

Definition at line 238 of file bsdname.c.

◆ setdomainname()

int W32_CALL setdomainname | ( | const char * | name,
 |  | size_t | len
 | ) |  |

BSD-style:
Set the host's domain name.

Set errno on failure and return -1.

Definition at line 213 of file bsdname.c.

References _strlcpy(), and defaultdomain.

◆ sethostid()

W32_FUNC u_long W32_CALL sethostid ( u_long ip )

BSD-style: Sets local IPv4-address.

Return values
address on host order.

Definition at line 79 of file bsdname.c.

References my_ip_addr.

◆ sethostname()

int W32_CALL sethostname | ( | const char * | fqdn,
 |  | SETHOSTNAME_ARG2 | len
 | ) |  |

BSD-style:
Expects a "Fully Qualified Domain Name" in ‘fqdn’.

Split at first ‘.’ and extract ‘hostname’ and ‘def_domain’. Set errno on failure and return -1.

Todo:
: should do complete alpha/digit/underscore check here

Definition at line 292 of file bsdname.c.

References hostname, and setdomainname().


Watt-32 tcp/ip: E:/WATT/src/bsdname.h File Reference

  • src
Functions
bsdname.h File Reference

Go to the source code of this file.

Functions

int | _get_machine_name (char *buf, int size)
Try asking a LAN extension of DOS for a host-name.
void | _sethostid6 (const void *addr)
Core-style: Sets local IPv6-address.
const void * | _gethostid6 (void)
Core-style: Returns local IPv6-address.

Function Documentation

◆ _get_machine_name()

int _get_machine_name | ( | char * | buf,
 |  | int | size
 | ) |  |

Try asking a LAN extension of DOS for a host-name.

Work for a DOS-box under Windows-XP.

Todo:

Definition at line 350 of file bsdname.c.

◆ _gethostid6()

const void * _gethostid6 ( void )

Core-style: Returns local IPv6-address.

Note
no BSD equivalent for this.
Return values
pointer to current local IPv6 address.

Definition at line 91 of file bsdname.c.

References netdb_init().

◆ _sethostid6()

void _sethostid6 ( const void * addr )

Core-style: Sets local IPv6-address.

Note
no BSD equivalent for this.

Definition at line 102 of file bsdname.c.


Watt-32 tcp/ip: E:/WATT/src/btrace.h File Reference

  • src
Functions
btrace.h File Reference

Go to the source code of this file.

Functions

int | backtrace_init (const char *prog)
int | backtrace (void **buf, int size)
int | backtrace_symbols_fd (const void *buf, int size, int file)
int | traceback_exit (const void *caller)

Detailed Description

A simple stack-tracer inspired by glib. Handy for asserts and crashes.

NOT FINISHED.

Definition in file btrace.h.


Watt-32 tcp/ip: E:/WATT/src/chksum.c File Reference

  • src
Functions
chksum.c File Reference

Go to the source code of this file.

Functions

WORD W32_CALL | in_checksum (const void *ptr, unsigned len)
This checksum routine is now used for all targets since in_checksum_fast() was removed.
WORD | _ip6_checksum (const in6_Header *ip, WORD proto, const void *payload, unsigned payloadlen)
Generic IPv6 checksum function.
int | _ip6_tcp_checksum (const in6_Header *ip, const tcp_Header *tcp, unsigned len)
Check tcp header checksum of an IPv6 packet.
int | _ip6_udp_checksum (const in6_Header *ip, const udp_Header *udp, unsigned len)
Check udp header checksum of an IPv6 packet.
int | _ip6_icmp_checksum (const in6_Header *ip, const void *icmp, unsigned len)
int | do_checksum (const BYTE *buf, BYTE protocol, unsigned len)

Detailed Description

Compute internet checksum on data buffer. 1's complement (~) is done by caller.

Definition in file chksum.c.

Function Documentation

◆ _ip6_checksum()

WORD _ip6_checksum | ( | const in6_Header * | ip,
 |  | WORD | proto,
 |  | const void * | payload,
 |  | unsigned | payloadlen
 | ) |  |

Generic IPv6 checksum function.

Definition at line 48 of file chksum.c.

◆ _ip6_icmp_checksum()

int _ip6_icmp_checksum | ( | const in6_Header * | ip,
 |  | const void * | icmp,
 |  | unsigned | len
 | ) |  |

Definition at line 111 of file chksum.c.

◆ _ip6_tcp_checksum()

int _ip6_tcp_checksum | ( | const in6_Header * | ip,
 |  | const tcp_Header * | tcp,
 |  | unsigned | len
 | ) |  |

Check tcp header checksum of an IPv6 packet.

Definition at line 80 of file chksum.c.

References _ip6_checksum().

◆ _ip6_udp_checksum()

int _ip6_udp_checksum | ( | const in6_Header * | ip,
 |  | const udp_Header * | udp,
 |  | unsigned | len
 | ) |  |

Check udp header checksum of an IPv6 packet.

Definition at line 95 of file chksum.c.

References _ip6_checksum().

◆ do_checksum()

int do_checksum | ( | const BYTE * | buf,
 |  | BYTE | protocol,
 |  | unsigned | len
 | ) |  |

Definition at line 133 of file chksum.c.

◆ in_checksum()

WORD W32_CALL in_checksum | ( | const void * | ptr,
 |  | unsigned | len
 | ) |  |

This checksum routine is now used for all targets since in_checksum_fast() was removed.

Definition at line 24 of file chksum.c.


Watt-32 tcp/ip: E:/WATT/src/chksum.h File Reference

  • src
Functions
chksum.h File Reference

Go to the source code of this file.

Functions

int | do_checksum (const BYTE *buf, BYTE proto, unsigned len)
WORD | _ip6_checksum (const in6_Header *ip, WORD proto, const void *payload, unsigned payloadlen)
Generic IPv6 checksum function.
int | _ip6_tcp_checksum (const in6_Header *ip, const tcp_Header *tcp, unsigned len)
Check tcp header checksum of an IPv6 packet.
int | _ip6_udp_checksum (const in6_Header *ip, const udp_Header *udp, unsigned len)
Check udp header checksum of an IPv6 packet.
int | _ip6_icmp_checksum (const in6_Header *ip, const void *icmp, unsigned len)

Function Documentation

◆ _ip6_checksum()

WORD _ip6_checksum | ( | const in6_Header * | ip,
 |  | WORD | proto,
 |  | const void * | payload,
 |  | unsigned | payloadlen
 | ) |  |

Generic IPv6 checksum function.

Definition at line 48 of file chksum.c.

◆ _ip6_icmp_checksum()

int _ip6_icmp_checksum | ( | const in6_Header * | ip,
 |  | const void * | icmp,
 |  | unsigned | len
 | ) |  |

Definition at line 111 of file chksum.c.

◆ _ip6_tcp_checksum()

int _ip6_tcp_checksum | ( | const in6_Header * | ip,
 |  | const tcp_Header * | tcp,
 |  | unsigned | len
 | ) |  |

Check tcp header checksum of an IPv6 packet.

Definition at line 80 of file chksum.c.

References _ip6_checksum().

◆ _ip6_udp_checksum()

int _ip6_udp_checksum | ( | const in6_Header * | ip,
 |  | const udp_Header * | udp,
 |  | unsigned | len
 | ) |  |

Check udp header checksum of an IPv6 packet.

Definition at line 95 of file chksum.c.

References _ip6_checksum().

◆ do_checksum()

int do_checksum | ( | const BYTE * | buf,
 |  | BYTE | proto,
 |  | unsigned | len
 | ) |  |

Definition at line 133 of file chksum.c.


Watt-32 tcp/ip: E:/WATT/src/close.c File Reference

  • src
Functions
close.c File Reference

Go to the source code of this file.

Functions

static int | close_dgram (Socket *socket)
static int | close_stream (Socket *socket)
int W32_CALL | close_s (int s)
int W32_CALL | closesocket (int s)

Detailed Description

BSD close()

Definition in file close.c.

Function Documentation

◆ close_dgram()

static int close_dgram ( Socket * socket )
static

Definition at line 79 of file close.c.

◆ close_s()

int W32_CALL close_s ( int s )

Definition at line 46 of file close.c.

◆ close_stream()

static int close_stream ( Socket * socket )
static

Definition at line 95 of file close.c.

◆ closesocket()

int W32_CALL closesocket ( int s )

Definition at line 71 of file close.c.


Watt-32 tcp/ip: E:/WATT/src/config.h File Reference

  • src
config.h File Reference

Go to the source code of this file.

Detailed Description

Defines global library options.

Definition in file config.h.


Watt-32 tcp/ip: E:/WATT/src/connect.c File Reference

  • src
Functions
connect.c File Reference

Go to the source code of this file.

Functions

static int | tcp_connect (Socket *socket)
static int | udp_connect (Socket *socket)
static int | raw_connect (Socket *socket)
int W32_CALL | connect (int s, const struct sockaddr *servaddr, socklen_t addrlen)
static int | chk_signals (void)

Detailed Description

BSD connect().

Definition in file connect.c.

Function Documentation

◆ chk_signals()

static int chk_signals ( void )
static

Definition at line 311 of file connect.c.

◆ connect()

int W32_CALL connect | ( | int | s,
 |  | const struct sockaddr * | servaddr,
 |  | socklen_t | addrlen
 | ) |  |

Definition at line 53 of file connect.c.

◆ raw_connect()

static int raw_connect ( Socket * socket )
static

Definition at line 299 of file connect.c.

◆ tcp_connect()

static int tcp_connect ( Socket * socket )
static

Definition at line 326 of file connect.c.

◆ udp_connect()

static int udp_connect ( Socket * socket )
static

Definition at line 262 of file connect.c.


Watt-32 tcp/ip: E:/WATT/src/copyrigh.h File Reference

  • src
copyrigh.h File Reference

Go to the source code of this file.

Detailed Description

*
*   This copyright applies only to files that include copyright.h.
*   Other files have their licence stated in the top.
*
*   WATTCP - TCP/IP library routines
*
*   Copyright (c) 1990, 1991, 1992, 1993 Erick Engelke
*
*   Portions Copyright (c) 1993  The Regents of the University of California
*   Portions Copyright (c) 1993  Digital Equipment Corporation.
*   Portions Copyright (c) 1993  Quentin Smart
*   Portions Copyright (c) 1991  University of Waterloo
*   Portions Copyright (c) 1990  National Center for Supercomputer Applications
*   Portions Copyright (c) 1990  Clarkson University
*   Portions Copyright (c) 1983, 1986, Imagen Corporation
*
*      This software is distributed in the hope that it will be useful,
*      but without any warranty; without even the implied warranty of
*      merchantability or fitness for a particular purpose.
*
*   RESTRICTIONS
*   ------------
*   You may freely use this library to produce programs which you may give
*   away or sell in source format, or as compiled executables, or both.
*
*   You may not sell this library or a portion thereof or distribute modified
*   versions the library code in either source or OBJect or LIBrary format
*   without written permission from the author.  The author still maintains
*   copyright privileges and will assert the privileges of ownership for
*   purposes of royalties such distributions.
*
*   Portions of this code were written or enhanced by others and offerred
*   to me for distribution in WATTCP under my copyright.  To my knowledge,
*   all copyrights exercised are listed at the top of this file.  If this
*   is incorrect, please contact me so I can rectify the situation.
*
*
*   OFFICIAL SITE
*   -------------
*   The official distribution site for WATTCP (and many other TCP goodies)
*   is dorm.rutgers.edu in pub/msdos/wattcp  (thanks Jim!)
*
*   That is where I upload the latest libraries, my own free applications
*   and other applications I have collected and find useful.
*
*
*   DOCUMENTATION
*   -------------
*   A programmer's reference manual I wrote is now available from the
*   publisher.  They provide no additional support and cannot help
*   you with any aspect of the software.  But they do pay a royalty
*   to me which has been used to compensate my costs for developing
*   this software and extending it, so I am very appreciative.
*
*   That manual is copyrighted and protected by international law.
*   It may not be copied without the authors permission.  And its
*   sale does not constitute a warranty or an automatic license to
*   use WATTCP beyond the terms described in this file.
*
*   For payment they accept credit cards, cheques, checks, money orders
*   and P.O.s.  Credit card orders can be processed over the telephone.
*
*   Note that they are located in Canada and mail to them MAY REQUIRE
*   additional postage depending on where you live.  Also, be sure to
*   use the entire address, including the last line.  Canada is a heck
*   of a large country and that line really makes a difference.
*
*   Prices are listed in US dollars for convienence to our many
*   international readers.  The value charged on credit card items
*   will be the equivalent in Canadian dollars at the exchange rate
*   of the day.
*
*   WATTCP Manual          $ 40  US funds for each manual orderred
*                     ----------
*   Shipping + Handling    $  5  US funds to North America
*   (Air Mail)          or $ 10  US funds to anywhere else in the world
*
*                     ADD  $ 20  US funds IF YOU ARE USING PURCHASE ORDERS
*                                in which case payment is due in 30 days.
*                                Not necessary for cheques, credit cards, etc.
*                     ----------
*
*          WATTCP Manual
*          c/o Supro Network Software Inc.
*          P.O. Box 18,
*          Warsaw, Ont.
*          CANADA
*          K0L 3A0
*
*  Phone (705) 652-1572 and be certain to mention that you are talking
*  about the WATTCP manual.
*
*  Please note, I am not involved in the processing loop for the manual
*  and cannot tell you of the status of your order.  Use Supro's number
*  instead.
*
*
*  Developers' Meeting Place
*  -------------------------
*  Many of the key people involved in WATTCP frequent the
*  comp.protocols.tcp-ip.ibmpc Usenet newgroup, and there
*  are several people there who can answer most any question.
*
*  If you need my personal attention (I seem to have less and less
*  available) you will have to Email my address below.  I cannot take
*  phone calls relating to WATTCP at my place of occupation.
*
*
    Erick Engelke   \nbsp\nbsp  erick@dorm.rutgers.edu \n
    48 Daytona St.                                     \n
    Kitchener, Ont.                                    \n
    Canada                                             \n

Definition in file copyrigh.h.


Watt-32 tcp/ip: E:/WATT/src/country.c File Reference

  • src
Functions | Variables
country.c File Reference

Go to the source code of this file.

Functions

int | GetCountryCode (void)
int | GetCodePage (void)

Variables

static char country_info [35]

Detailed Description

Function for fetching DOS's country info.

Definition in file country.c.

Function Documentation

◆ GetCodePage()

int GetCodePage ( void )

Definition at line 111 of file country.c.

◆ GetCountryCode()

int GetCountryCode ( void )

Definition at line 53 of file country.c.

Variable Documentation

◆ country_info

char country_info[35]
static

Definition at line 51 of file country.c.


Watt-32 tcp/ip: E:/WATT/src/cpuid.c Source File

  • src
cpuid.c
1/*
2 * CPU-model tool. Uses CPUID to figure out a more
3 * excact name of the running processor. Supports these 32 and 64-bit
4 * CPUs:
5 * GenuineIntel, AuthenticAMD and CentaurHauls.
6 *
7 * Supports GNU-C 4+ and MSVC v16+ compilers.
8 *
9 * Some of the below code has been taken from the MPIR Library. cpuid.c.
10 *
11 * Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
12 * Free Software Foundation, Inc.
13 *
14 * Copyright 2008 William Hart.
15 *
16 * Copyright 2009,2010,2011 Jason Moxham
17 *
18 * Copyright 2010 Gonzalo Tornaria
19 *
20 * The rest has been taken from my Watt-32 tcp/ip stack at:
21 * http://www.watt-32.net
22 *
23 * G. Vanem <gvanem@yahoo.no> 2012.
24 *
25 * References:
26 * https://en.wikipedia.org/wiki/CPUID
27 * http://www.sandpile.org/x86/cpuid.htm
28 */
29
30#ifndef WIN32_LEAN_AND_MEAN
31#define WIN32_LEAN_AND_MEAN
32#endif
33
34#ifndef _CRT_SECURE_NO_WARNINGS
35#define _CRT_SECURE_NO_WARNINGS
36#endif
37
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>
41#include <windows.h>
42
43#if defined(__GNUC__)
44 #include <cpuid.h>
45
46#elif defined(_MSC_VER)
47 #include <intrin.h>
48#endif
49
50static int trace_level = 0;
51
52#define TRACE(level, fmt, ...) \
53 do { \
54 if (trace_level >= level) { \
55 if (trace_level >= 2) \
56 printf ("%s(%u): ", __FILE__, __LINE__); \
57 printf (fmt, ##__VA_ARGS__); \
58 } \
59 } while (0)
60
61static void print_reg (DWORD reg, const char *which)
62{
63 BYTE a = LOBYTE (reg);
64 BYTE b = HIBYTE (reg);
65 BYTE c = LOBYTE (reg >> 16);
66 BYTE d = HIBYTE (reg >> 16);
67
68 printf (" %s: %08lX, %c%c%c%c\n", which, reg,
69 isprint(a) ? a : '.',
70 isprint(b) ? b : '.',
71 isprint(c) ? c : '.',
72 isprint(d) ? d : '.');
73}
74
75#if defined(_MSC_VER)
76#if defined(_M_X64) || 1
77static void msvc_cpuid (DWORD level, DWORD *_eax, DWORD *_ebx, DWORD *_ecx, DWORD *_edx)
78{
79 int regs[4];
80
81 __cpuid (regs, level);
82 *_eax = (DWORD) regs[0];
83 *_ebx = (DWORD) regs[1];
84 *_ecx = (DWORD) regs[2];
85 *_edx = (DWORD) regs[3];
86}
87#else
88__declspec(naked) static void msvc_cpuid (DWORD level, DWORD *_eax, DWORD *_ebx, DWORD *_ecx, DWORD *_edx)
89{
90 __asm {
91 enter 0, 0
92 push ebx
93 push esi
94 mov eax, [ebp+8] /* EAX = level */
95 cpuid
96 mov esi, [ebp+12]
97 mov [esi], eax /* *_eax = EAX */
98 mov esi, [ebp+16]
99 mov [esi], ebx /* *_ebx = EBX */
100 mov esi, [ebp+20]
101 mov [esi], ecx /* *_ecx = ECX */
102 mov esi, [ebp+24]
103 mov [esi], edx /* *_edx = EDX */
104 pop esi
105 pop ebx
106 leave
107 ret
108 }
109}
110#endif
111#endif /* _MSC_VER */
112
113static unsigned int get_cpuid2 (int level, void *result)
114{
115 unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0;
116 unsigned int *res = (unsigned int*) result;
117 const char *cpuid_func;
118
119#if defined(__GNUC__)
120 cpuid_func = "__get_cpuid";
121 __get_cpuid (level, &eax, &ebx, &ecx, &edx);
122#elif defined(_MSC_VER)
123 cpuid_func = "msvc_cpuid";
124 msvc_cpuid (level, &eax, &ebx, &ecx, &edx);
125#endif
126
127 TRACE (1, "\nFrom %s (0x%08X):\n", cpuid_func, level);
128 print_reg (eax, "EAX");
129 print_reg (ebx, "EBX");
130 print_reg (ecx, "ECX");
131 print_reg (edx, "EDX");
132
133 res[0] = ebx;
134 res[1] = edx; /* Not a typo; we want EDX into 'res[1]' */
135 res[2] = ecx;
136 return (eax);
137}
138
139/*
140 * Returns a specific name for an "GenuineIntel" based on type, model and features.
141 */
142static const char *get_Intel_model (int type, int model, const void *features)
143{
144 char features2 [12];
145 int feat, id_max;
146
147 switch (type)
148 {
149 case 5:
150 if (model <= 2)
151 return ("Pentium");
152 if (model >= 4)
153 return ("PentiumMMX");
154
155 case 6:
156 if (model == 1)
157 return ("PentiumPro");
158 if (model <= 6)
159
160 return ("Pentium2");
161 if (model <= 13)
162 return ("Pentium3");
163
164 if (model == 14 || model == 16)
165 return ("Core");
166
167 if (model == 15 || model == 22)
168 return ("Core2");
169
170 if (model == 17 || model == 23 || model == 29)
171 return ("Penryn");
172
173 if (model == 25 || model == 37 || model == 44 || model == 47)
174 return ("Westmere");
175
176 if (model == 26 || model == 30 || model == 31 || model == 46)
177 return ("Nehalem");
178
179 if (model == 28 || model == 38 || model == 39 || model == 54 || model == 55)
180 return ("Atom");
181
182 if (model == 42)
183 {
184 feat = ((int*) features) [2];
185 if (feat & 0x10000000)
186 return ("Sandybridge");
187 return ("Westmere");
188 }
189
190 if (model == 43 || model == 45)
191 return ("Sandybridge");
192
193 if (model == 58 || model == 62)
194 return ("Ivybridge");
195
196 if (model == 60 || model == 63 || model == 69 || model == 70)
197 return ("Haswell");
198 break;
199
200 case 15:
201 id_max = get_cpuid2 (0x80000000, features2) & 0xff;
202 if (id_max >= 1)
203 {
204 get_cpuid2 (0x80000001, features2);
205 if (features2[8] & 1)
206 return ("Netburstlahf");
207 return ("Netburst");
208 }
209 if (model <= 6)
210 return ("Pentium4");
211 feat = ((int*)features)[2];
212 if (feat & 1)
213 return ("Prescott");
214 break;
215 }
216 return (NULL);
217}
218
219/*
220 * Returns a specific name for an "AuthenticAMD" CPU based on type and model.
221 */
222static const char *get_AMD_model (int type, int model)
223{
224 switch (type)
225 {
226 case 5:
227 if (model <= 3)
228 return ("K5");
229 if (model <= 7)
230 return ("K6");
231 if (model <= 8)
232 return ("K62");
233 if (model <= 9)
234 return ("K63");
235 break;
236
237 case 6:
238 return ("K7");
239
240 case 15:
241 return ("K8");
242
243 case 16:
244 if (model == 2)
245 return ("K10");
246 if (model == 4 || model == 5 || model == 6 || model == 8 || model == 9 || model == 10)
247 return ("K102");
248 break;
249
250 case 17:
251 return ("K8"); /* Low power k8 */
252
253 case 18:
254 return ("K103"); /* Like k102 but with hardware divider, this is lano */
255
256 case 20:
257 return ("Bobcat"); /* Fusion of Bobcat and GPU */
258
259 case 21:
260 if (model == 1)
261 return ("Bulldozer");
262 if (model == 2 || model == 3 || model == 16 || model == 18 || model == 19)
263 return ("Piledriver");
264
265 case 22:
266 return ("Jaguar");
267 }
268 return (NULL);
269}
270
271/*
272 * Returns a specific name for an "CentaurHauls" CPU based on type and model.
273 */
274static const char *get_Centaur_model (int type, int model)
275{
276 if (type != 6)
277 return (NULL);
278
279 if (model == 15)
280 return ("Nano");
281
282 if (model < 9)
283 return ("ViaC3");
284 return ("ViaC32");
285}
286
287const char *cpu_get_model (void)
288{
289 static char vendor_string[13];
290 char features[12];
291 int type, model, stepping;
292 DWORD id_max, fms;
293
294 vendor_string[0] = '\0';
295 id_max = get_cpuid2 (0, vendor_string);
296 vendor_string[12] = '\0';
297
298 TRACE (1, " id_max: %08lX.\n", id_max);
299
300 fms = get_cpuid2 (1, features);
301
302 type = (fms >> 8) & 0x0F;
303/*if (type == 15) */
304 type |= (fms >> 16) & 0xFF0; /* set extended family */
305
306 model = (fms >> 4) & 0x0F;
307/*if (model == 15) */
308 model |= (fms >> 12) & 0xF0; /* set extended model */
309
310 stepping = fms & 15;
311
312 TRACE (1, "Found vendor_string: \"%s\".\n", vendor_string);
313 TRACE (1, "Found type: %d.\n", type);
314 TRACE (1, "Found model: %d.\n", model);
315 TRACE (1, "Found stepping: %d.\n", stepping);
316
317 if (!strcmp(vendor_string, "GenuineIntel"))
318 return get_Intel_model (type, model, &features);
319
320 if (!strcmp(vendor_string, "AuthenticAMD"))
321 return get_AMD_model (type, model);
322
323 if (!strcmp(vendor_string, "CentaurHauls"))
324 return get_Centaur_model (type, model);
325
326 if (vendor_string[0])
327 return (vendor_string);
328
329 return (NULL);
330}
331
332const char *cpu_get_freq_info (void)
333{
334 static char result [100];
335 char info[13];
336 DWORD id_max = get_cpuid2 (0, info);
337 unsigned int eax = 0, ebx = 0, ecx = 0;
338
339 if (id_max < 0x16)
340 return (NULL);
341
342 eax = get_cpuid2 (0x16, info);
343 ebx = ((unsigned int*) info) [1];
344 ecx = ((unsigned int*) info) [2];
345
346 snprintf (result, sizeof(result), "Core base: %d, Core max: %d, Core bus: %d (MHz)",
347 eax & (1 << 15), ebx & (1 << 15), ecx & (1 << 15));
348 return (result);
349}
350
351int main (int argc, char **argv)
352{
353 const char *cpu, *freq;
354
355 if (argc > 1)
356 {
357 if (!strcmp(argv[1], "-d"))
358 trace_level = 1;
359 if (!strcmp(argv[1], "-dd"))
360 trace_level = 2;
361 }
362
363 cpu = cpu_get_model();
364 printf ("CPU-model: %s\n", cpu ? cpu : "<unknown>");
365
366 freq = cpu_get_freq_info();
367 printf ("CPU-freq info: %s\n", freq? freq : "<unknown>");
368 return 0;
369}
370


Watt-32 tcp/ip: E:/WATT/src/cpumodel.h File Reference

  • src
Functions | Variables
cpumodel.h File Reference

Go to the source code of this file.

Functions

void SYSCALL cdecl | CheckCpuType (void)
int SYSCALL cdecl | asm_ffs (int val)
WORD SYSCALL cdecl | MY_CS (void)
WORD SYSCALL cdecl | MY_DS (void)
WORD SYSCALL cdecl | MY_ES (void)
WORD SYSCALL cdecl | MY_SS (void)
DWORD SYSCALL cdecl | Get_CR4 (void)
BOOL SYSCALL cdecl | SelWriteable (WORD sel)
BOOL SYSCALL cdecl | SelReadable (WORD sel)
W32_GCC_INLINE void | get_cpuid (DWORD val, DWORD *eax, DWORD *ebx, DWORD *ecx, DWORD *edx)
W32_GCC_INLINE uint64 | get_rdtsc (void)
W32_GCC_INLINE void | get_rdtsc2 (struct ulong_long *tsc)
uint64 | win_get_rdtsc (void)
W32_INLINE BOOL | have_cpuid (void)
__declspec (naked) W32_INLINE BOOL have_cpuid(void)

Variables

char DATA_DECL | x86_type
char DATA_DECL | x86_model
char DATA_DECL | x86_mask
int DATA_DECL | x86_hard_math
DWORD DATA_DECL | x86_capability
int DATA_DECL | x86_have_cpuid
char DATA_DECL | x86_vendor_id [13]

Function Documentation

◆ __declspec()

__declspec ( naked )

Definition at line 320 of file cpumodel.h.

◆ CheckCpuType()

void SYSCALL cdecl CheckCpuType ( void )

Definition at line 98 of file misc.c.

◆ get_cpuid()

W32_INLINE void get_cpuid | ( | DWORD | val,
 |  | DWORD * | eax,
 |  | DWORD * | ebx,
 |  | DWORD * | ecx,
 |  | DWORD * | edx
 | ) |  |

Definition at line 135 of file cpumodel.h.

◆ get_rdtsc()

uint64 cdecl get_rdtsc ( void )

Definition at line 156 of file cpumodel.h.

◆ get_rdtsc2()

void cdecl get_rdtsc2 ( struct ulong_long * tsc )

Definition at line 165 of file cpumodel.h.

◆ have_cpuid()

W32_GCC_INLINE BOOL have_cpuid ( void )

Definition at line 279 of file cpumodel.h.

◆ win_get_rdtsc()

uint64 win_get_rdtsc ( void )

Definition at line 982 of file timer.c.

Variable Documentation

◆ x86_capability

DWORD DATA_DECL x86_capability
extern

Definition at line 91 of file misc.c.

◆ x86_hard_math

int DATA_DECL x86_hard_math
extern

Definition at line 95 of file misc.c.

◆ x86_have_cpuid

int DATA_DECL x86_have_cpuid
extern

Definition at line 90 of file misc.c.

◆ x86_mask

char DATA_DECL x86_mask
extern

Definition at line 94 of file misc.c.

◆ x86_model

char DATA_DECL x86_model
extern

Definition at line 93 of file misc.c.

◆ x86_type

char DATA_DECL x86_type
extern

Definition at line 92 of file misc.c.

◆ x86_vendor_id

char DATA_DECL x86_vendor_id[13]
extern

Definition at line 96 of file misc.c.


Watt-32 tcp/ip: E:/WATT/src/crc.c File Reference

  • src
Functions | Variables
crc.c File Reference

Go to the source code of this file.

Functions

static void | mk_crctbl (DWORD poly, DWORD *tab)
DWORD | crc_bytes (const char *buf, size_t len)
BOOL | crc_init (void)

Variables

DWORD * crc_table

Detailed Description

CRC calculation.

These CRC functions are derived from code in chapter 19 of the book "C Programmer's Guide to Serial Communications", by Joe Campbell.

Only used by the language module (ref. language.l)

Definition in file crc.c.

Function Documentation

◆ crc_bytes()

DWORD crc_bytes | ( | const char * | buf,
 |  | size_t | len
 | ) |  |

Definition at line 78 of file crc.c.

◆ crc_init()

BOOL crc_init ( void )

Definition at line 87 of file crc.c.

◆ mk_crctbl()

static void mk_crctbl | ( | DWORD | poly,
 |  | DWORD * | tab
 | ) |  |
static

Definition at line 48 of file crc.c.

Variable Documentation

◆ crc_table

DWORD* crc_table

Definition at line 35 of file crc.c.


Watt-32 tcp/ip: E:/WATT/src/crit.c File Reference

  • src
Functions | Variables
crit.c File Reference

Go to the source code of this file.

Functions

static void cdecl | int24_isr (SWI_REGS *reg)
void | int24_restore (void)
void | int24_init (void)
static int _far | int24_isr (unsigned dev_err, unsigned err_code, unsigned _far *dev_hdr)
static void | int24_isr (void)
static INTR_PROTOTYPE | int24_isr (bp, di, si, ds, es, dx, cx, bx, ax, ip, cs, flags)

Variables

static REALPTR | int24_old
static REALPTR | rmcb
static _go32_dpmi_seginfo | rm_cb
static __dpmi_regs | rm_reg

Detailed Description

Watt-32 critical error (int24h).

Definition in file crit.c.

Function Documentation

◆ int24_init()

void int24_init ( void )

Definition at line 79 of file crit.c.

◆ int24_isr() [1/4]

static INTR_PROTOTYPE int24_isr | ( | bp | ,
 |  | di | ,
 |  | si | ,
 |  | ds | ,
 |  | es | ,
 |  | dx | ,
 |  | cx | ,
 |  | bx | ,
 |  | ax | ,
 |  | ip | ,
 |  | cs | ,
 |  | flags |
 | ) |  |
static

Definition at line 153 of file crit.c.

◆ int24_isr() [2/4]

static void cdecl int24_isr ( SWI_REGS * reg )
static

Definition at line 64 of file crit.c.

◆ int24_isr() [3/4]

static int _far int24_isr | ( | unsigned | dev_err,
 |  | unsigned | err_code,
 |  | unsigned _far * | dev_hdr
 | ) |  |
static

Definition at line 98 of file crit.c.

◆ int24_isr() [4/4]

static void int24_isr ( void )
static

Definition at line 119 of file crit.c.

◆ int24_restore()

void int24_restore ( void )

Definition at line 69 of file crit.c.

Variable Documentation

◆ int24_old

static W32_IntrHandler int24_old
static

Definition at line 62 of file crit.c.

◆ rm_cb

_go32_dpmi_seginfo rm_cb
static

Definition at line 116 of file crit.c.

◆ rm_reg

__dpmi_regs rm_reg
static

Definition at line 117 of file crit.c.

◆ rmcb

REALPTR rmcb
static

Definition at line 62 of file crit.c.


Watt-32 tcp/ip: E:/WATT/src/dynip.c File Reference

  • src
Data Structures | Functions | Variables
dynip.c File Reference

Go to the source code of this file.

Data Structures

struct URL

Functions

static | void (W32_CALL *prev_hook)(const char *key
static int | get_url (const char *host, int port, const char *path, const char *user_pass)
Fetch a single URL optionally with authentication.
static const char * | parse_myip_address (const char *orig)
Parse response buffer and find the first IP-address.
static int | parse_dyndns_response (const char *buf)
Parse the status response from DynDNS.
static int | chkip_method (const char *value)
Select method of getting your public IP (WAN-side) address.
static int | dyndns_params (const char *value)
Extracts the host, port and request from the value.
static void | url_free (struct URL *url)
Free the URL.
static BOOL | url_parse (struct URL *res, const char *url)
Simple URL parser; accepts only "http://" prefixes (optional).
static void W32_CALL | dynip_config (const char *name, const char *value)
Parser for DYNIP configuration.
static void W32_CALL | dynip_exit (void)
Free allocated memory.
void | dynip_init (void)
int | dynip_exec (void)
static int | base64encode (const char *in, char *out, size_t out_len)
static BOOL | get_header (void *sock, long *cont_len_ptr)
Receive and parse the HTTP header.

Variables

static char | dyndns_user [MAX_VALUELEN+1] = ""
static char | dyndns_passwd [MAX_VALUELEN+1] = ""
static char | dyn_myhostname [MAX_VALUELEN+1] = ""
static char | dyn_myip [20] = ""
static BOOL | dynip_enable = FALSE
static int | dyndns_refresh = 3600
static int | trace_level = 0
static char | config_file [MAX_PATHLEN+1] = "$(TEMP)\\W32DYNIP.TMP"
static struct URL | dyndns
static struct URL | chkip = { NULL, NULL, 0, FALSE }
static char | resp_buf [2048]
static const char * | value

Detailed Description

Simple dynamic IP/hostname update client. Only updating using the DynDNS2 protocol is supported.

This code is based on the ddclient Perl-script by Paul Burry: http://members.rogers.com/ddclient/pub/ddclient.tar.gz

Definition in file dynip.c.

Function Documentation

◆ base64encode()

static int base64encode | ( | const char * | in,
 |  | char * | out,
 |  | size_t | out_len
 | ) |  |
static

Definition at line 427 of file dynip.c.

◆ chkip_method()

static int chkip_method ( const char * value )
static

Select method of getting your public IP (WAN-side) address.

Either a dotted IPv4 address or an URL to return your address.

Definition at line 370 of file dynip.c.

References _strlcpy(), isaddr(), url_free(), and url_parse().

◆ dyndns_params()

static int dyndns_params ( const char * value )
static

Extracts the host, port and request from the value.

Used for sending the DynDNS IP/host update.

Definition at line 386 of file dynip.c.

References url_free(), and url_parse().

◆ dynip_config()

static void W32_CALL dynip_config | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Parser for DYNIP configuration.

Matches all "\c DYNIP.xx" values from WATTCP.CFG file and make appropriate actions.

Definition at line 92 of file dynip.c.

References ARG_ATOI, ARG_FUNC, ARG_STRCPY, chkip_method(), dyndns_params(), and parse_config_table().

◆ dynip_exec()

int dynip_exec ( void )

Definition at line 151 of file dynip.c.

◆ dynip_exit()

static void W32_CALL dynip_exit ( void )
static

Free allocated memory.

Definition at line 114 of file dynip.c.

References _watt_fatal_error, and url_free().

◆ dynip_init()

void dynip_init ( void )

Definition at line 123 of file dynip.c.

◆ get_header()

static BOOL get_header | ( | void * | sock,
 |  | long * | cont_len_ptr
 | ) |  |
static

Receive and parse the HTTP header.

Return FALSE if header isn't correct. Return TRUE and extract "Content-Length" field.

Definition at line 475 of file dynip.c.

◆ get_url()

static int get_url | ( | const char * | host,
 |  | int | port,
 |  | const char * | path,
 |  | const char * | user_pass
 | ) |  |
static

Fetch a single URL optionally with authentication.

Definition at line 559 of file dynip.c.

References dom_strerror(), get_header(), resolve(), sock_dataready(), and tcp_open().

◆ parse_dyndns_response()

static int parse_dyndns_response ( const char * buf )
static

Parse the status response from DynDNS.

Definition at line 268 of file dynip.c.

◆ parse_myip_address()

static const char * parse_myip_address ( const char * orig )
static

Parse response buffer and find the first IP-address.

'buf' must be 0-terminated.

Definition at line 216 of file dynip.c.

References _strlcpy(), and aton().

◆ url_free()

static void url_free ( struct URL * url )
static

Free the URL.

Definition at line 356 of file dynip.c.

◆ url_parse()

static BOOL url_parse | ( | struct URL * | res,
 |  | const char * | url
 | ) |  |
static

Simple URL parser; accepts only "http://" prefixes (optional).

Extracts host, port and request parts ("/" if not present).

Definition at line 300 of file dynip.c.

References _strlcpy().

Variable Documentation

◆ chkip

struct URL chkip = { NULL, NULL, 0, FALSE }
static

Definition at line 72 of file dynip.c.

◆ config_file

char config_file[MAX_PATHLEN+1] = "$(TEMP)\\W32DYNIP.TMP"
static

Definition at line 66 of file dynip.c.

◆ dyn_myhostname

char dyn_myhostname[MAX_VALUELEN+1] = ""
static

Definition at line 61 of file dynip.c.

◆ dyn_myip

char dyn_myip[20] = ""
static

Definition at line 62 of file dynip.c.

◆ dyndns

struct URL dyndns
static
Initial value:
= { (char*) "members.dyndns.com",
(char*) "/nic/update?system=dyndns&hostname=%s",
80, FALSE
}

Definition at line 68 of file dynip.c.

◆ dyndns_passwd

char dyndns_passwd[MAX_VALUELEN+1] = ""
static

Definition at line 60 of file dynip.c.

◆ dyndns_refresh

int dyndns_refresh = 3600
static

Definition at line 64 of file dynip.c.

◆ dyndns_user

char dyndns_user[MAX_VALUELEN+1] = ""
static

Definition at line 59 of file dynip.c.

◆ dynip_enable

BOOL dynip_enable = FALSE
static

Definition at line 63 of file dynip.c.

◆ resp_buf

char resp_buf[2048]
static

Definition at line 74 of file dynip.c.

◆ trace_level

int trace_level = 0
static

Definition at line 65 of file dynip.c.

◆ value

const char* value

Definition at line 75 of file dynip.c.


Watt-32 tcp/ip: E:/WATT/src/dynip.h File Reference

  • src
Functions
dynip.h File Reference

Go to the source code of this file.

Functions

void | dynip_init (void)
int | dynip_exec (void)

Function Documentation

◆ dynip_exec()

int dynip_exec ( void )

Definition at line 151 of file dynip.c.

◆ dynip_init()

void dynip_init ( void )

Definition at line 123 of file dynip.c.


Watt-32 tcp/ip: E:/WATT/src/echo.c File Reference

  • src
Functions | Variables
echo.c File Reference

Go to the source code of this file.

Functions

static | void (W32_CALL *prev_hook)(const char *
static const char *static void W32_CALL | echo_discard_daemon (void)
static void W32_CALL | udp_handler (sock_type *s, void *data, int len, const tcp_PseudoHeader *ph, const void *udp)
Callback handler for echo + discard UDP sockets.
static void W32_CALL | echo_config (const char *name, const char *value)
static void W32_CALL | echo_discard_exit (void)
Don't bother resetting any connections.
void | echo_discard_init (void)
Called from watt_sock_init(): Setup config-file parser for "echo..." and "discard.." keywords.
W32_GCC_FUNC_TYPE_WARN_OFF () void echo_discard_start(void)
Make gcc 8+ shut up about this warning: echo.c:143:19: warning: cast between incompatible function types from 'void (*)(union sock_type *, void *, int, const tcp_PseudoHeader *, const void *)' to 'int (*)(void *, const BYTE *, unsigned int, const void *, const void *)' {aka 'int (*)(void *, const unsigned char *, unsigned int, const void *, const void *)'} [-Wcast-function-type] 143 | (ProtoHandler)udp_handler); | ^.
W32_GCC_FUNC_TYPE_WARN_DEF () static void W32_CALL echo_discard_daemon(void)
"background" process handling echo + discard TCP sockets.
int | main (int argc, char **argv)

Variables

static _udp_Socket * | udp_echo_sock
static _udp_Socket * | udp_disc_sock
static _tcp_Socket * | tcp_echo_sock
static _tcp_Socket * | tcp_disc_sock
static BOOL | do_echo = 0
static WORD | echo_port = 7
static DWORD | echo_host = 0
static BOOL | do_disc = 0
static WORD | disc_port = 9
static DWORD | disc_host = 0

Detailed Description

A simple echo/discard daemon. Listens for traffic on udp/tcp ports 7 and 9.

Definition in file echo.c.

Function Documentation

◆ echo_config()

static void W32_CALL echo_config | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Definition at line 73 of file echo.c.

◆ echo_discard_exit()

static void W32_CALL echo_discard_exit ( void )
static

Don't bother resetting any connections.

Just remove daemon and free allocated memory.

Definition at line 100 of file echo.c.

◆ echo_discard_init()

void echo_discard_init ( void )

Called from watt_sock_init(): Setup config-file parser for "echo..." and "discard.." keywords.

Definition at line 117 of file echo.c.

References echo_discard_exit().

◆ main()

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |
Todo:
Make a echo client/server test program

Definition at line 240 of file echo.c.

◆ udp_handler()

static void W32_CALL udp_handler | ( | sock_type * | s,
 |  | void * | data,
 |  | int | len,
 |  | const tcp_PseudoHeader * | ph,
 |  | const void * | udp_hdr
 | ) |  |
static

Callback handler for echo + discard UDP sockets.

Definition at line 217 of file echo.c.

References _inet_ntoa().

◆ W32_GCC_FUNC_TYPE_WARN_DEF()

W32_GCC_FUNC_TYPE_WARN_DEF ( )

"background" process handling echo + discard TCP sockets.

Todo:
handle jumbo packets (IP-fragments)

Definition at line 191 of file echo.c.

References sock_dataready().

◆ W32_GCC_FUNC_TYPE_WARN_OFF()

W32_GCC_FUNC_TYPE_WARN_OFF ( )

Make gcc 8+ shut up about this warning: echo.c:143:19: warning: cast between incompatible function types from 'void (*)(union sock_type *, void *, int, const tcp_PseudoHeader *, const void *)' to 'int (*)(void *, const BYTE *, unsigned int, const void *, const void *)' {aka 'int (*)(void *, const unsigned char *, unsigned int, const void *, const void *)'} [-Wcast-function-type] 143 | (ProtoHandler)udp_handler); | ^.

Starts the echo/discard services (udp/tcp).

Definition at line 135 of file echo.c.

References tcp_listen(), udp_handler(), and udp_listen().

Variable Documentation

◆ disc_host

DWORD disc_host = 0
static

Definition at line 60 of file echo.c.

◆ disc_port

WORD disc_port = 9
static

Definition at line 59 of file echo.c.

◆ do_disc

BOOL do_disc = 0
static

Definition at line 58 of file echo.c.

◆ do_echo

BOOL do_echo = 0
static

Definition at line 54 of file echo.c.

◆ echo_host

DWORD echo_host = 0
static

Definition at line 56 of file echo.c.

◆ echo_port

WORD echo_port = 7
static

Definition at line 55 of file echo.c.

◆ tcp_disc_sock

_tcp_Socket * tcp_disc_sock
static

Definition at line 52 of file echo.c.

◆ tcp_echo_sock

_tcp_Socket* tcp_echo_sock
static

Definition at line 52 of file echo.c.

◆ udp_disc_sock

_udp_Socket * udp_disc_sock
static

Definition at line 51 of file echo.c.

◆ udp_echo_sock

_udp_Socket* udp_echo_sock
static

Definition at line 51 of file echo.c.


Watt-32 tcp/ip: E:/WATT/src/echo.h File Reference

  • src
Functions
echo.h File Reference

Go to the source code of this file.

Functions

void | echo_discard_init (void)
Called from watt_sock_init(): Setup config-file parser for "echo..." and "discard.." keywords.
void | echo_discard_start (void)

Function Documentation

◆ echo_discard_init()

void echo_discard_init ( void )

Called from watt_sock_init(): Setup config-file parser for "echo..." and "discard.." keywords.

Definition at line 117 of file echo.c.

References echo_discard_exit().


Watt-32 tcp/ip: E:/WATT/src/enum_cp.c Source File

  • src
enum_cp.c
1#include <stdio.h>
2#include <windows.h>
3
4static BOOL CALLBACK callback (LPSTR cp)
5{
6 printf ("\t callback(): cp: \"%s\", valid: %d\n",
7 cp, IsValidCodePage(atoi(cp)));
8 return (TRUE);
9}
10
11int main (void)
12{
13 puts ("\nEnumerating codepages:");
14 EnumSystemCodePages (callback, CP_INSTALLED);
15 return 0;
16}


Watt-32 tcp/ip: E:/WATT/src/fcntl.c File Reference

  • src
Functions | Variables
fcntl.c File Reference

Go to the source code of this file.

Functions

int MS_CDECL fcntlsocket (int s, int cmd,...)

Variables

static const struct search_list commands []

Detailed Description

BSD fcntlsocket().

Definition in file fcntl.c.

Function Documentation

◆ fcntlsocket()

int MS_CDECL fcntlsocket | ( | int | s,
 |  | int | cmd,
 |  |  | ...
 | ) |  |
Todo:
handle O_TEXT and O_BINARY

Definition at line 69 of file fcntl.c.

References _socklist_find(), and list_lookup().

Variable Documentation

◆ commands

const struct search_list commands[]
static
Initial value:
= {
{ F_DUPFD, "F_DUPFD" },
{ F_GETFL, "F_GETFL" },
{ F_SETFL, "F_SETFL" },
{ F_GETFD, "F_GETFD" },
{ F_SETFD, "F_SETFD" },
{ F_GETLK, "F_GETLK" },
{ F_SETLK, "F_SETLK" },
{ F_SETLKW, "F_SETLKW" },
{ F_GETOWN, "F_GETOWN" },
{ F_SETOWN, "F_SETOWN" }
}

Definition at line 54 of file fcntl.c.


Watt-32 tcp/ip: E:/WATT/src/fsext.c File Reference

  • src
Data Structures | Functions | Variables
fsext.c File Reference

Go to the source code of this file.

Data Structures

struct wstat

Functions

int _fsext_demux (__FSEXT_Fnumber func, int *rv, va_list _args)

Variables

static const struct search_list fs_func []

Detailed Description

File System extensions for djgpp.

Definition in file fsext.c.

Function Documentation

◆ _fsext_demux()

int _fsext_demux | ( | __FSEXT_Fnumber | func,
 |  | int * | rv,
 |  | va_list | _args
 | ) |  |

Definition at line 110 of file fsext.c.

Variable Documentation

◆ fs_func

const struct search_list fs_func[]
static
Initial value:
= {
{ __FSEXT_nop, "nop" },
{ __FSEXT_open, "open" },
{ __FSEXT_creat, "creat" },
{ __FSEXT_read, "read" },
{ __FSEXT_write, "write" },
{ __FSEXT_ready, "ready" },
{ __FSEXT_close, "close" },
{ __FSEXT_fcntl, "fcntl" },
{ __FSEXT_ioctl, "ioctl" },
{ __FSEXT_lseek, "lseek" },
{ __FSEXT_link, "link" },
{ __FSEXT_unlink,"unlink" },
#if (DJGPP_MINOR >= 2)
{ __FSEXT_dup, "dup" },
{ __FSEXT_dup2, "dup2" },
{ __FSEXT_fstat, "fstat" },
{ __FSEXT_stat, "stat" },
#endif
#if (DJGPP_MINOR >= 4)
{ __FSEXT_llseek, "llseek" },
{ __FSEXT_readlink,"readlink" },
{ __FSEXT_symlink, "symlink" },
{ __FSEXT_fchown, "fchown" },
{ __FSEXT_chmod, "chmod", },
{ __FSEXT_chown, "chown", },
{ __FSEXT_fchmod, "fchmod" }
#endif
}

Definition at line 76 of file fsext.c.


Watt-32 tcp/ip: E:/WATT/src/gcc-cdecl.c Source File

  • src
gcc-cdecl.c
1/*
2 * Preprocess this file as:
3 * $(BIN_PREFIX)gcc -dM -E -I%WATT_ROOT%/inc gcc-cdecl.c | grep cdecl
4 *
5 * or
6 * $(BIN_PREFIX)g++ -dM -E -I%WATT_ROOT%/inc gcc-cdecl.c | grep cdecl
7 */
8#include <sys/socket.h> /* Includes <$WATT_ROOT/sys/cdecl.h> */
9#include <time.h>
10
11#ifdef __cplusplus
12#include <chrono>
13#endif
14
15__attribute__((cdecl)) void my_cdecl_func_1 (void)
16{
17}
18
19cdecl void my_cdecl_func_2 (void)
20{
21}
22
23#ifdef __cplusplus
24 [[gnu::cdecl]] void my_cdecl_func_3 (void)
25 {
26 }
27#endif
socket.h


Watt-32 tcp/ip: E:/WATT/src/get_ai.c File Reference

  • src
Data Structures | Functions | Variables
get_ai.c File Reference

Go to the source code of this file.

Data Structures

struct | afd
struct | explore

Functions

static int | str_isnumber (const char *)
static int | explore_fqdn (const struct addrinfo *, const char *, const char *, struct addrinfo **res)
static int | explore_null (const struct addrinfo *, const char *, struct addrinfo **)
static int | explore_numeric (const struct addrinfo *, const char *, const char *, struct addrinfo **)
static int | explore_numeric_scope (const struct addrinfo *, const char *, const char *, struct addrinfo **)
static int | get_name (const char *, const struct afd *, struct addrinfo **, char *, const struct addrinfo *, const char *)
static int | get_canonname (const struct addrinfo *, struct addrinfo *, const char *)
static struct addrinfo * | get_ai (const struct addrinfo *, const struct afd *, const char *)
static int | get_portmatch (const struct addrinfo *, const char *)
static int | get_port (struct addrinfo *, const char *, int)
static const struct afd * | find_afd (int)
char *W32_CALL | gai_strerror (int ecode)
int W32_CALL | if_nametoindex (const char *if_name)
char *W32_CALL | if_indextoname (int if_id, char *if_name)
int | __scope_ascii_to_id (const char *str)
int | __scope_id_to_ascii (int scope)
static void | free_addrinfo (struct addrinfo *ai)
void W32_CALL | freeaddrinfo (struct addrinfo *ai)
static void | afd_list_init (BOOL ip6_prio)
Initialise afd_list[].
int W32_CALL | getaddrinfo (const char *_hostname, const char *_servname, const struct addrinfo *hints, struct addrinfo **res)
int | main (void)
static void | dump_addrinfo (const struct addrinfo *ai)
static void | test_getaddrinfo (const char *host, const char *serv)

Variables

static struct explore | explore []
BOOL | called_from_getai = FALSE
static struct afd | afd_list [3]
static const char * | ai_errlist []

Detailed Description

BSD getaddrinfo().

Definition in file get_ai.c.

Function Documentation

◆ __scope_ascii_to_id()

int __scope_ascii_to_id ( const char * str )

Definition at line 217 of file get_ai.c.

◆ __scope_id_to_ascii()

int __scope_id_to_ascii ( int scope )

Definition at line 224 of file get_ai.c.

◆ afd_list_init()

static void afd_list_init ( BOOL ip6_prio )
static

Initialise afd_list[].

Give IPv6 protocol highest priority if 'ip6_prio' is TRUE.

Definition at line 268 of file get_ai.c.

◆ dump_addrinfo()

static void dump_addrinfo ( const struct addrinfo * ai )
static

Definition at line 1022 of file get_ai.c.

◆ explore_fqdn()

static int explore_fqdn | ( | const struct addrinfo * | pai,
 |  | const char * | _hostname,
 |  | const char * | _servname,
 |  | struct addrinfo ** | res
 | ) |  |
static

Definition at line 517 of file get_ai.c.

◆ explore_null()

static int explore_null | ( | const struct addrinfo * | pai,
 |  | const char * | servname,
 |  | struct addrinfo ** | res
 | ) |  |
static

Definition at line 644 of file get_ai.c.

◆ explore_numeric()

static int explore_numeric | ( | const struct addrinfo * | pai,
 |  | const char * | _hostname,
 |  | const char * | _servname,
 |  | struct addrinfo ** | res
 | ) |  |
static

Definition at line 707 of file get_ai.c.

◆ explore_numeric_scope()

static int explore_numeric_scope | ( | const struct addrinfo * | pai,
 |  | const char * | _hostname,
 |  | const char * | _servname,
 |  | struct addrinfo ** | res
 | ) |  |
static

Definition at line 793 of file get_ai.c.

◆ find_afd()

static const struct afd * find_afd ( int af )
static

Definition at line 999 of file get_ai.c.

◆ free_addrinfo()

static void free_addrinfo ( struct addrinfo * ai )
static

Definition at line 232 of file get_ai.c.

◆ freeaddrinfo()

void W32_CALL freeaddrinfo ( struct addrinfo * ai )

Definition at line 245 of file get_ai.c.

◆ gai_strerror()

char *W32_CALL gai_strerror ( int ecode )

Definition at line 178 of file get_ai.c.

◆ get_ai()

static struct addrinfo * get_ai | ( | const struct addrinfo * | pai,
 |  | const struct afd * | afd,
 |  | const char * | addr
 | ) |  |
static

Definition at line 902 of file get_ai.c.

◆ get_canonname()

static int get_canonname | ( | const struct addrinfo * | pai,
 |  | struct addrinfo * | ai,
 |  | const char * | str
 | ) |  |
static

Definition at line 890 of file get_ai.c.

◆ get_name()

static int get_name | ( | const char * | addr,
 |  | const struct afd * | afd,
 |  | struct addrinfo ** | res,
 |  | char * | numaddr,
 |  | const struct addrinfo * | pai,
 |  | const char * | servname
 | ) |  |
static

Definition at line 855 of file get_ai.c.

◆ get_port()

static int get_port | ( | struct addrinfo * | ai,
 |  | const char * | servname,
 |  | int | matchonly
 | ) |  |
static

Definition at line 929 of file get_ai.c.

◆ get_portmatch()

static int get_portmatch | ( | const struct addrinfo * | ai,
 |  | const char * | servname
 | ) |  |
static

Definition at line 923 of file get_ai.c.

◆ getaddrinfo()

int W32_CALL getaddrinfo | ( | const char * | _hostname,
 |  | const char * | _servname,
 |  | const struct addrinfo * | hints,
 |  | struct addrinfo ** | res
 | ) |  |

Definition at line 307 of file get_ai.c.

◆ if_indextoname()

char *W32_CALL if_indextoname | ( | int | if_id,
 |  | char * | if_name
 | ) |  |

Definition at line 202 of file get_ai.c.

◆ if_nametoindex()

int W32_CALL if_nametoindex ( const char * if_name )

Definition at line 190 of file get_ai.c.

◆ main()

int main ( void )

Definition at line 1015 of file get_ai.c.

◆ str_isnumber()

static int str_isnumber ( const char * p )
static

Definition at line 251 of file get_ai.c.

◆ test_getaddrinfo()

static void test_getaddrinfo | ( | const char * | host,
 |  | const char * | serv
 | ) |  |
static

Definition at line 1040 of file get_ai.c.

Variable Documentation

◆ afd_list

struct afd afd_list[3]
static

Definition at line 95 of file get_ai.c.

◆ ai_errlist

const char* ai_errlist[]
static
Initial value:
= {
"Success",
"Address family for hostname not supported",
"Temporary failure in name resolution",
"Invalid value for ai_flags",
"Non-recoverable failure in name resolution",
"ai_family not supported",
"Memory allocation failure",
"No address associated with hostname",
"hostname nor servname provided, or not known",
"servname not supported for ai_socktype",
"ai_socktype not supported",
"System error returned in errno",
"Invalid value for hints",
"Resolved protocol is unknown",
"Unknown error",
}

Definition at line 123 of file get_ai.c.

◆ called_from_getai

BOOL called_from_getai = FALSE

Definition at line 93 of file get_ai.c.

◆ explore

struct explore explore[]
static
Initial value:
= {
{ AF_INET6, SOCK_DGRAM, IPPROTO_UDP, "udp", 7 },
{ AF_INET6, SOCK_STREAM, IPPROTO_TCP, "tcp", 7 },
{ AF_INET6, SOCK_RAW, ANY, NULL, 5 },
{ AF_INET, SOCK_DGRAM, IPPROTO_UDP, "udp", 7 },
{ AF_INET, SOCK_STREAM, IPPROTO_TCP, "tcp", 7 },
{ AF_INET, SOCK_RAW, ANY, NULL, 5 },
{ -1, 0, 0, NULL, 0 }
}

Definition at line 83 of file get_ai.c.


Watt-32 tcp/ip: E:/WATT/src/get_ip.c File Reference

  • src
Functions
get_ip.c File Reference

Go to the source code of this file.

Functions

static struct hostent * | copyandmerge (const struct hostent *he1, const struct hostent *he2, int af, int *err)
static __inline void | scan_interface (BOOL *have_v4, BOOL *have_v6)
struct hostent *W32_CALL | getipnodebyname (const char *name, int af, int flags, int *error)
struct hostent *W32_CALL | getipnodebyaddr (const void *src, size_t len, int af, int *error)
void W32_CALL | freehostent (struct hostent *he)

Detailed Description

BSD getipnodebyX().

Definition in file get_ip.c.

Function Documentation

◆ copyandmerge()

static struct hostent * copyandmerge | ( | const struct hostent * | he1,
 |  | const struct hostent * | he2,
 |  | int | af,
 |  | int * | err
 | ) |  |
static

Definition at line 263 of file get_ip.c.

◆ freehostent()

void W32_CALL freehostent ( struct hostent * he )

Definition at line 241 of file get_ip.c.

◆ getipnodebyaddr()

struct hostent *W32_CALL getipnodebyaddr | ( | const void * | src,
 |  | size_t | len,
 |  | int | af,
 |  | int * | error
 | ) |  |

Definition at line 163 of file get_ip.c.

◆ getipnodebyname()

struct hostent *W32_CALL getipnodebyname | ( | const char * | name,
 |  | int | af,
 |  | int | flags,
 |  | int * | error
 | ) |  |

Definition at line 64 of file get_ip.c.

◆ scan_interface()

static __inline void scan_interface | ( | BOOL * | have_v4,
 |  | BOOL * | have_v6
 | ) |  |
static

Definition at line 39 of file get_ip.c.


Watt-32 tcp/ip: E:/WATT/src/get_ni.c File Reference

  • src
Data Structures | Functions | Variables
get_ni.c File Reference

Go to the source code of this file.

Data Structures

struct | afd
struct | sockinet

Functions

static void | afd_list_init (BOOL ip6_prio)
static int | gi_result (int err, const char *str, unsigned line)
int W32_CALL | getnameinfo (const struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags)
int | main (void)
static int | ip4_resolve (const char *name)
static int | ip6_resolve (const char *name)
int | main (int argc, char **argv)

Variables

static struct afd | afd_list [3]
static int | ni_flags = NI_NAMEREQD

Detailed Description

BSD getnameinfo(),

Definition in file get_ni.c.

Function Documentation

◆ afd_list_init()

static void afd_list_init ( BOOL ip6_prio )
static

Definition at line 79 of file get_ni.c.

◆ getnameinfo()

int W32_CALL getnameinfo | ( | const struct sockaddr * | sa,
 |  | socklen_t | salen,
 |  | char * | host,
 |  | socklen_t | hostlen,
 |  | char * | serv,
 |  | socklen_t | servlen,
 |  | int | flags
 | ) |  |

Definition at line 113 of file get_ni.c.

◆ gi_result()

static int gi_result | ( | int | err,
 |  | const char * | str,
 |  | unsigned | line
 | ) |  |
static

Definition at line 96 of file get_ni.c.

◆ ip4_resolve()

static int ip4_resolve ( const char * name )
static

Definition at line 315 of file get_ni.c.

◆ ip6_resolve()

static int ip6_resolve ( const char * name )
static

Definition at line 335 of file get_ni.c.

◆ main() [1/2]

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 355 of file get_ni.c.

◆ main() [2/2]

int main ( void )

Definition at line 304 of file get_ni.c.

Variable Documentation

◆ ni_flags

int ni_flags = NI_NAMEREQD
static

Definition at line 313 of file get_ni.c.


Watt-32 tcp/ip: E:/WATT/src/get_xby.h File Reference

  • src
Data Structures | Functions | Variables
get_xby.h File Reference

Go to the source code of this file.

Data Structures

struct | _hostent
struct | _hostent6
struct | _netent
struct | _protoent
struct | _servent

Functions

W32_FUNC void W32_CALL | ReadHostsFile (const char *fname)
W32_FUNC void W32_CALL | ReadServFile (const char *fname)
W32_FUNC void W32_CALL | ReadProtoFile (const char *fname)
W32_FUNC void W32_CALL | ReadNetworksFile (const char *fname)
W32_FUNC void W32_CALL | ReadEthersFile (void)
Read the /etc/ethers file.
W32_FUNC int W32_CALL | NumEtherEntries (void)
W32_FUNC void W32_CALL | InitEthersFile (const char *fname)
W32_FUNC void W32_CALL | CloseHostFile (void)
Close hosts-file.
W32_FUNC void W32_CALL | CloseServFile (void)
W32_FUNC void W32_CALL | CloseProtoFile (void)
W32_FUNC void W32_CALL | CloseNetworksFile (void)
W32_FUNC const char *W32_CALL | GetHostsFile (void)
Return name of hosts-file.
W32_FUNC const char *W32_CALL | GetServFile (void)
W32_FUNC const char *W32_CALL | GetProtoFile (void)
W32_FUNC const char *W32_CALL | GetNetFile (void)
W32_FUNC const char *W32_CALL | GetEthersFile (void)
W32_FUNC const char *W32_CALL | GetEtherName (const eth_address *eth)
W32_FUNC void W32_CALL | DumpHostsCache (void)
W32_FUNC void W32_CALL | DumpEthersCache (void)
W32_FUNC void W32_CALL | ReopenHostFile (void)
Reopen hosts-file.
W32_FUNC void W32_CALL | ReopenNetworksFile (void)
W32_FUNC void W32_CALL | ReopenProtoFile (void)
W32_FUNC void W32_CALL | ReopenServFile (void)
W32_FUNC void W32_CALL | ReadHosts6File (const char *fname)
W32_FUNC void W32_CALL | CloseHost6File (void)
W32_FUNC void W32_CALL | DumpHosts6Cache (void)
W32_FUNC const char *W32_CALL | GetHosts6File (void)
W32_FUNC void W32_CALL | ReopenHost6File (void)

Variables

BOOL | called_from_getai
unsigned | netdbCacheLife

Function Documentation

◆ CloseHost6File()

W32_FUNC void W32_CALL CloseHost6File ( void )

Definition at line 178 of file gethost6.c.

◆ CloseHostFile()

W32_FUNC void W32_CALL CloseHostFile ( void )

Close hosts-file.

To prevent running out of file-handles, one should close the hosts-file before spawning a new shell.

Definition at line 196 of file gethost.c.

◆ CloseNetworksFile()

W32_FUNC void W32_CALL CloseNetworksFile ( void )

Definition at line 160 of file getnet.c.

◆ CloseProtoFile()

W32_FUNC void W32_CALL CloseProtoFile ( void )

Definition at line 153 of file getprot.c.

◆ CloseServFile()

W32_FUNC void W32_CALL CloseServFile ( void )

Definition at line 165 of file getserv.c.

◆ DumpEthersCache()

W32_FUNC void W32_CALL DumpEthersCache ( void )

Definition at line 251 of file geteth.c.

◆ DumpHosts6Cache()

W32_FUNC void W32_CALL DumpHosts6Cache ( void )

Definition at line 664 of file gethost6.c.

◆ DumpHostsCache()

W32_FUNC void W32_CALL DumpHostsCache ( void )

Definition at line 803 of file gethost.c.

◆ GetEtherName()

W32_FUNC const char *W32_CALL GetEtherName ( const eth_address * eth )

Definition at line 273 of file geteth.c.

◆ GetEthersFile()

W32_FUNC const char *W32_CALL GetEthersFile ( void )

Definition at line 86 of file geteth.c.

◆ GetHosts6File()

W32_FUNC const char *W32_CALL GetHosts6File ( void )

Definition at line 169 of file gethost6.c.

◆ GetHostsFile()

W32_FUNC const char *W32_CALL GetHostsFile ( void )

Return name of hosts-file.

Note
Only returns the last 'hosts' file opened.

Definition at line 186 of file gethost.c.

◆ GetNetFile()

W32_FUNC const char *W32_CALL GetNetFile ( void )

Definition at line 151 of file getnet.c.

◆ GetProtoFile()

W32_FUNC const char *W32_CALL GetProtoFile ( void )

Definition at line 148 of file getprot.c.

◆ GetServFile()

W32_FUNC const char *W32_CALL GetServFile ( void )

Definition at line 157 of file getserv.c.

◆ InitEthersFile()

W32_FUNC void W32_CALL InitEthersFile ( const char * fname )

Definition at line 80 of file geteth.c.

◆ NumEtherEntries()

W32_FUNC int W32_CALL NumEtherEntries ( void )

Definition at line 91 of file geteth.c.

◆ ReadEthersFile()

W32_FUNC void W32_CALL ReadEthersFile ( void )

Read the /etc/ethers file.

This MUST be called after any /etc/hosts file has been read.

Todo:
: Assert that.

Definition at line 101 of file geteth.c.

References _arp_cache_add(), and called_from_resolve.

◆ ReadHosts6File()

W32_FUNC void W32_CALL ReadHosts6File ( const char * fname )

Definition at line 95 of file gethost6.c.

◆ ReadHostsFile()

W32_FUNC void W32_CALL ReadHostsFile ( const char * fname )

Definition at line 110 of file gethost.c.

◆ ReadNetworksFile()

W32_FUNC void W32_CALL ReadNetworksFile ( const char * fname )

Definition at line 75 of file getnet.c.

◆ ReadProtoFile()

W32_FUNC void W32_CALL ReadProtoFile ( const char * fname )

Definition at line 75 of file getprot.c.

◆ ReadServFile()

W32_FUNC void W32_CALL ReadServFile ( const char * fname )

Definition at line 99 of file getserv.c.

◆ ReopenHost6File()

W32_FUNC void W32_CALL ReopenHost6File ( void )

Definition at line 186 of file gethost6.c.

◆ ReopenHostFile()

W32_FUNC void W32_CALL ReopenHostFile ( void )

Reopen hosts-file.

Call this after e.g. system() returns.

Definition at line 207 of file gethost.c.

◆ ReopenNetworksFile()

W32_FUNC void W32_CALL ReopenNetworksFile ( void )

Definition at line 166 of file getnet.c.

◆ ReopenProtoFile()

W32_FUNC void W32_CALL ReopenProtoFile ( void )

Definition at line 159 of file getprot.c.

◆ ReopenServFile()

W32_FUNC void W32_CALL ReopenServFile ( void )

Definition at line 174 of file getserv.c.

Variable Documentation

◆ called_from_getai

BOOL called_from_getai
extern

Definition at line 93 of file get_ai.c.

◆ netdbCacheLife

unsigned netdbCacheLife
extern

Definition at line 80 of file gethost.c.


Watt-32 tcp/ip: E:/WATT/src/geteth.c File Reference

  • src
Data Structures | Functions | Variables
geteth.c File Reference

Go to the source code of this file.

Data Structures

struct ethent

Functions

static void W32_CALL | end_ether_entries (void)
static int | get_ether_entry (char *in_buf, eth_address *e, char *out_buf, size_t out_buf_size)
void W32_CALL | InitEthersFile (const char *fname)
const char *W32_CALL | GetEthersFile (void)
int W32_CALL | NumEtherEntries (void)
void W32_CALL | ReadEthersFile (void)
Read the /etc/ethers file.
void W32_CALL | DumpEthersCache (void)
const char *W32_CALL | GetEtherName (const eth_address *eth)
int | main (void)

Variables

static struct ethent * | eth0 = NULL
static int | num_entries = -1
static char | ethersFname [MAX_PATHLEN] = ""

Detailed Description

‘/etc/ethers’ file functions for Watt-32.

Definition in file geteth.c.

Function Documentation

◆ DumpEthersCache()

void W32_CALL DumpEthersCache ( void )

Definition at line 251 of file geteth.c.

◆ end_ether_entries()

static void W32_CALL end_ether_entries ( void )
static

Definition at line 234 of file geteth.c.

◆ get_ether_entry()

static int get_ether_entry | ( | char * | in_buf,
 |  | eth_address * | e,
 |  | char * | out_buf,
 |  | size_t | out_buf_size
 | ) |  |
static

Definition at line 182 of file geteth.c.

◆ GetEtherName()

const char *W32_CALL GetEtherName ( const eth_address * eth )

Definition at line 273 of file geteth.c.

◆ GetEthersFile()

const char *W32_CALL GetEthersFile ( void )

Definition at line 86 of file geteth.c.

◆ InitEthersFile()

void W32_CALL InitEthersFile ( const char * fname )

Definition at line 80 of file geteth.c.

◆ main()

int main ( void )

Definition at line 291 of file geteth.c.

◆ NumEtherEntries()

int W32_CALL NumEtherEntries ( void )

Definition at line 91 of file geteth.c.

◆ ReadEthersFile()

void W32_CALL ReadEthersFile ( void )

Read the /etc/ethers file.

This MUST be called after any /etc/hosts file has been read.

Todo:
: Assert that.

Definition at line 101 of file geteth.c.

References _arp_cache_add(), and called_from_resolve.

Variable Documentation

◆ eth0

struct ethent* eth0 = NULL
static

Definition at line 72 of file geteth.c.

◆ ethersFname

char ethersFname[MAX_PATHLEN] = ""
static

Definition at line 74 of file geteth.c.

◆ num_entries

int num_entries = -1
static

Definition at line 73 of file geteth.c.


Watt-32 tcp/ip: E:/WATT/src/gethost.c File Reference

  • src
Functions | Variables
gethost.c File Reference

Go to the source code of this file.

Functions

static BOOL | gethostbyname_internal (const char *name, const char **alias, struct _hostent *ret)
static BOOL | gethostbyaddr_internal (const char *addr_name, int len, int type, struct _hostent *ret)
static struct hostent * | fill_hostent (const struct _hostent *h)
static struct _hostent * | add_hostent (struct _hostent *h, const char *name, const char *cname, DWORD *alist, DWORD addr, DWORD ttl, BOOL windns)
static void W32_CALL | _endhostent (void)
void W32_CALL | ReadHostsFile (const char *fname)
const char *W32_CALL | GetHostsFile (void)
Return name of hosts-file.
void W32_CALL | CloseHostFile (void)
Close hosts-file.
void W32_CALL | ReopenHostFile (void)
Reopen hosts-file.
struct hostent *W32_CALL | gethostent (void)
Return the next (non-commented) line from the host-file.
struct hostent *W32_CALL | gethostbyname (const char *name)
struct hostent *W32_CALL | gethostbyname2 (const char *name, int family)
struct hostent *W32_CALL | gethostbyaddr (const char *addr_name, int len, int type)
void W32_CALL | sethostent (int stayopen)
void W32_CALL | endhostent (void)
void | uninit_warn (const char *func)
int *W32_CALL | __h_errno_location (void)
static BOOL | ReverseHostsList (void)
void W32_CALL | DumpHostsCache (void)
int | main (void)
static void | print_hosts (void)
void | do_sleep (int time)

Variables

int | h_errno = 0
unsigned | netdbCacheLife = MAX_CACHE_LIFE
static char * | hostFname = NULL
static FILE * | hostFile = NULL
static BOOL | hostClose = FALSE
static const char * | from_where = NULL
static struct _hostent * | host0 = NULL
static BOOL | did_lookup = FALSE
static BOOL | is_addr = FALSE

Detailed Description

BSD-like host-entry functions.

Definition in file gethost.c.

Function Documentation

◆ __h_errno_location()

int *W32_CALL __h_errno_location ( void )

Definition at line 638 of file gethost.c.

◆ _endhostent()

static void W32_CALL _endhostent ( void )
static

Definition at line 105 of file gethost.c.

◆ add_hostent()

static struct _hostent * add_hostent | ( | struct _hostent * | h,
 |  | const char * | name,
 |  | const char * | cname,
 |  | DWORD * | alist,
 |  | DWORD | addr,
 |  | DWORD | ttl,
 |  | BOOL | windns
 | ) |  |
static

Definition at line 678 of file gethost.c.

◆ CloseHostFile()

void W32_CALL CloseHostFile ( void )

Close hosts-file.

To prevent running out of file-handles, one should close the hosts-file before spawning a new shell.

Definition at line 196 of file gethost.c.

◆ do_sleep()

void do_sleep ( int time )

Definition at line 887 of file gethost.c.

◆ DumpHostsCache()

void W32_CALL DumpHostsCache ( void )

Definition at line 803 of file gethost.c.

◆ endhostent()

void W32_CALL endhostent ( void )

Definition at line 486 of file gethost.c.

◆ fill_hostent()

static struct hostent * fill_hostent ( const struct _hostent * h )
static

Definition at line 643 of file gethost.c.

◆ gethostbyaddr()

struct hostent *W32_CALL gethostbyaddr | ( | const char * | addr_name,
 |  | int | len,
 |  | int | type
 | ) |  |

Definition at line 440 of file gethost.c.

◆ gethostbyaddr_internal()

static BOOL gethostbyaddr_internal | ( | const char * | addr_name,
 |  | int | len,
 |  | int | type,
 |  | struct _hostent * | ret
 | ) |  |
static
Todo:
Should return all our addresses if we're multihomed.
Todo:
should be the new aliases

Definition at line 513 of file gethost.c.

References gethostid(), netdb_init(), and sin_mask.

◆ gethostbyname()

struct hostent *W32_CALL gethostbyname ( const char * name )

Definition at line 275 of file gethost.c.

◆ gethostbyname2()

struct hostent *W32_CALL gethostbyname2 | ( | const char * | name,
 |  | int | family
 | ) |  |

Definition at line 422 of file gethost.c.

◆ gethostbyname_internal()

static BOOL gethostbyname_internal | ( | const char * | name,
 |  | const char ** | alias,
 |  | struct _hostent * | ret
 | ) |  |
static
Todo:
should be canonical name

Definition at line 307 of file gethost.c.

References called_from_resolve, gethostid(), hostname, netdb_init(), and resolve().

◆ gethostent()

struct hostent *W32_CALL gethostent ( void )

Return the next (non-commented) line from the host-file.

Format is:

ip-address host-name [alias..] {\n | # ..}

Definition at line 219 of file gethost.c.

References _strlcpy(), isaddr(), netdb_init(), and strltrim().

◆ GetHostsFile()

const char *W32_CALL GetHostsFile ( void )

Return name of hosts-file.

Note
Only returns the last 'hosts' file opened.

Definition at line 186 of file gethost.c.

◆ main()

int main ( void )

Definition at line 855 of file gethost.c.

◆ print_hosts()

static void print_hosts ( void )
static

Definition at line 865 of file gethost.c.

◆ ReadHostsFile()

void W32_CALL ReadHostsFile ( const char * fname )

Definition at line 110 of file gethost.c.

◆ ReopenHostFile()

void W32_CALL ReopenHostFile ( void )

Reopen hosts-file.

Call this after e.g. system() returns.

Definition at line 207 of file gethost.c.

◆ ReverseHostsList()

static BOOL ReverseHostsList ( void )
static

Definition at line 772 of file gethost.c.

◆ sethostent()

void W32_CALL sethostent ( int stayopen )

Definition at line 475 of file gethost.c.

◆ uninit_warn()

void uninit_warn ( const char * func )

Definition at line 631 of file gethost.c.

Variable Documentation

◆ did_lookup

BOOL did_lookup = FALSE
static

Definition at line 88 of file gethost.c.

◆ from_where

const char* from_where = NULL
static

Definition at line 85 of file gethost.c.

◆ h_errno

int h_errno = 0

Definition at line 76 of file gethost.c.

◆ host0

struct _hostent* host0 = NULL
static

Definition at line 86 of file gethost.c.

◆ hostClose

BOOL hostClose = FALSE
static

Definition at line 84 of file gethost.c.

◆ hostFile

FILE* hostFile = NULL
static

Definition at line 83 of file gethost.c.

◆ hostFname

char* hostFname = NULL
static

Definition at line 82 of file gethost.c.

◆ is_addr

BOOL is_addr = FALSE
static

Definition at line 89 of file gethost.c.

◆ netdbCacheLife

unsigned netdbCacheLife = MAX_CACHE_LIFE

Definition at line 80 of file gethost.c.


Watt-32 tcp/ip: E:/WATT/src/gethost6.c File Reference

  • src
Functions | Variables
gethost6.c File Reference

Go to the source code of this file.

Functions

static BOOL | gethostbyname6_internal (const char *name, const char **alias, struct _hostent6 *ret)
static BOOL | gethostbyaddr6_internal (const char *addr, struct _hostent6 *ret)
static struct hostent * | fill_hostent6 (const struct _hostent6 *h)
static struct _hostent6 * | add_hostent6 (struct _hostent6 *h, const char *name, const char *cname, const void *addr_list, const void *addr, DWORD ttl)
static void W32_CALL | _endhostent6 (void)
void W32_CALL | ReadHosts6File (const char *fname)
const char *W32_CALL | GetHosts6File (void)
void W32_CALL | CloseHost6File (void)
void W32_CALL | ReopenHost6File (void)
struct hostent *W32_CALL | gethostent6 (void)
struct hostent *W32_CALL | gethostbyname6 (const char *name)
void W32_CALL | sethostent6 (int stayopen)
void W32_CALL | endhostent6 (void)
struct hostent *W32_CALL | gethostbyaddr6 (const void *addr)
static BOOL | ReverseHosts6List (void)
void W32_CALL | DumpHosts6Cache (void)
int | main (void)
static void | print_hosts (void)

Variables

static char * | host6Fname = NULL
static FILE * | host6file = NULL
static BOOL | hostClose = FALSE
static struct _hostent6 * | host0 = NULL
static BOOL | did_lookup = FALSE
static BOOL | is_addr = FALSE

Detailed Description

gethostbyname6() for IPv6.

Definition in file gethost6.c.

Function Documentation

◆ _endhostent6()

static void W32_CALL _endhostent6 ( void )
static

Definition at line 90 of file gethost6.c.

◆ add_hostent6()

static struct _hostent6 * add_hostent6 | ( | struct _hostent6 * | h,
 |  | const char * | name,
 |  | const char * | cname,
 |  | const void * | addr_list,
 |  | const void * | addr,
 |  | DWORD | ttl
 | ) |  |
static

Definition at line 562 of file gethost6.c.

◆ CloseHost6File()

void W32_CALL CloseHost6File ( void )

Definition at line 178 of file gethost6.c.

◆ DumpHosts6Cache()

void W32_CALL DumpHosts6Cache ( void )

Definition at line 664 of file gethost6.c.

◆ endhostent6()

void W32_CALL endhostent6 ( void )

Definition at line 402 of file gethost6.c.

◆ fill_hostent6()

static struct hostent * fill_hostent6 ( const struct _hostent6 * h )
static

Definition at line 527 of file gethost6.c.

◆ gethostbyaddr6()

struct hostent *W32_CALL gethostbyaddr6 ( const void * addr )

Definition at line 430 of file gethost6.c.

◆ gethostbyaddr6_internal()

static BOOL gethostbyaddr6_internal | ( | const char * | addr,
 |  | struct _hostent6 * | ret
 | ) |  |
static
Todo:
should check all addresses
Todo:
should be the new aliases

Definition at line 449 of file gethost6.c.

References netdb_init().

◆ gethostbyname6()

struct hostent *W32_CALL gethostbyname6 ( const char * name )

Definition at line 248 of file gethost6.c.

◆ gethostbyname6_internal()

static BOOL gethostbyname6_internal | ( | const char * | name,
 |  | const char ** | alias,
 |  | struct _hostent6 * | ret
 | ) |  |
static

Definition at line 278 of file gethost6.c.

◆ gethostent6()

struct hostent *W32_CALL gethostent6 ( void )

Definition at line 196 of file gethost6.c.

◆ GetHosts6File()

const char *W32_CALL GetHosts6File ( void )

Definition at line 169 of file gethost6.c.

◆ main()

int main ( void )

Definition at line 711 of file gethost6.c.

◆ print_hosts()

static void print_hosts ( void )
static

Definition at line 724 of file gethost6.c.

◆ ReadHosts6File()

void W32_CALL ReadHosts6File ( const char * fname )

Definition at line 95 of file gethost6.c.

◆ ReopenHost6File()

void W32_CALL ReopenHost6File ( void )

Definition at line 186 of file gethost6.c.

◆ ReverseHosts6List()

static BOOL ReverseHosts6List ( void )
static

Definition at line 633 of file gethost6.c.

◆ sethostent6()

void W32_CALL sethostent6 ( int stayopen )

Definition at line 389 of file gethost6.c.

Variable Documentation

◆ did_lookup

BOOL did_lookup = FALSE
static

Definition at line 71 of file gethost6.c.

◆ host0

struct _hostent6* host0 = NULL
static

Definition at line 69 of file gethost6.c.

◆ host6file

FILE* host6file = NULL
static

Definition at line 67 of file gethost6.c.

◆ host6Fname

char* host6Fname = NULL
static

Definition at line 66 of file gethost6.c.

◆ hostClose

BOOL hostClose = FALSE
static

Definition at line 68 of file gethost6.c.

◆ is_addr

BOOL is_addr = FALSE
static

Definition at line 72 of file gethost6.c.


Watt-32 tcp/ip: E:/WATT/src/getname.c File Reference

  • src
Functions
getname.c File Reference

Go to the source code of this file.

Functions

int W32_CALL | getsockname (int s, struct sockaddr *name, socklen_t *namelen)
int W32_CALL | getpeername (int s, struct sockaddr *name, socklen_t *namelen)

Detailed Description

BSD getsockname(), getpeername().

Definition in file getname.c.

Function Documentation

◆ getpeername()

int W32_CALL getpeername | ( | int | s,
 |  | struct sockaddr * | name,
 |  | socklen_t * | namelen
 | ) |  |

Definition at line 97 of file getname.c.

◆ getsockname()

int W32_CALL getsockname | ( | int | s,
 |  | struct sockaddr * | name,
 |  | socklen_t * | namelen
 | ) |  |

Definition at line 43 of file getname.c.


Watt-32 tcp/ip: E:/WATT/src/getnet.c File Reference

  • src
Functions | Variables
getnet.c File Reference

Go to the source code of this file.

Functions

static __inline struct netent * | fill_netent (const struct _netent *n)
static void W32_CALL | _endnetent (void)
void W32_CALL | ReadNetworksFile (const char *fname)
const char *W32_CALL | GetNetFile (void)
void W32_CALL | CloseNetworksFile (void)
void W32_CALL | ReopenNetworksFile (void)
struct netent *W32_CALL | getnetent (void)
struct netent *W32_CALL | getnetbyname (const char *name)
struct netent *W32_CALL | getnetbyaddr (long net, int type)
void W32_CALL | setnetent (int stayopen)
void W32_CALL | endnetent (void)

Variables

static struct _netent * | network0 = NULL
static char * | networkFname = NULL
static FILE * | networkFile = NULL
static BOOL | networkClose = FALSE

Detailed Description

Simple BSD-like network-entry functions.

Definition in file getnet.c.

Function Documentation

◆ _endnetent()

static void W32_CALL _endnetent ( void )
static

Definition at line 70 of file getnet.c.

◆ CloseNetworksFile()

void W32_CALL CloseNetworksFile ( void )

Definition at line 160 of file getnet.c.

◆ endnetent()

void W32_CALL endnetent ( void )

Definition at line 286 of file getnet.c.

◆ fill_netent()

static __inline struct netent * fill_netent ( const struct _netent * n )
static

Definition at line 56 of file getnet.c.

◆ getnetbyaddr()

struct netent *W32_CALL getnetbyaddr | ( | long | net,
 |  | int | type
 | ) |  |

Definition at line 255 of file getnet.c.

◆ getnetbyname()

struct netent *W32_CALL getnetbyname ( const char * name )

Definition at line 230 of file getnet.c.

◆ getnetent()

struct netent *W32_CALL getnetent ( void )

Definition at line 180 of file getnet.c.

◆ GetNetFile()

const char *W32_CALL GetNetFile ( void )

Definition at line 151 of file getnet.c.

◆ ReadNetworksFile()

void W32_CALL ReadNetworksFile ( const char * fname )

Definition at line 75 of file getnet.c.

◆ ReopenNetworksFile()

void W32_CALL ReopenNetworksFile ( void )

Definition at line 166 of file getnet.c.

◆ setnetent()

void W32_CALL setnetent ( int stayopen )

Definition at line 271 of file getnet.c.

Variable Documentation

◆ network0

struct _netent* network0 = NULL
static

Definition at line 51 of file getnet.c.

◆ networkClose

BOOL networkClose = FALSE
static

Definition at line 54 of file getnet.c.

◆ networkFile

FILE* networkFile = NULL
static

Definition at line 53 of file getnet.c.

◆ networkFname

char* networkFname = NULL
static

Definition at line 52 of file getnet.c.


Watt-32 tcp/ip: E:/WATT/src/getopt.c File Reference

  • src
Functions | Variables
getopt.c File Reference

Go to the source code of this file.

Functions

int W32_CALL | watt_getopt (int argc, char *const *_argv, const char *opt_str)
int W32_CALL | _w_watt_getopt (int argc, wchar_t *const *argv, const wchar_t *opt_str)

Variables

char * | watt_optarg = NULL
int | watt_optopt = 0
int | watt_optind = 0
int | watt_opterr = 1
char * | watt_optswchar = "-/"
enum _watt_optmode | watt_optmode = GETOPT_UNIX
static char * | next_opt
static char * | empty = ""
static BOOL | done
static char | sw_char
static char ** | options
static char ** | non_options
static int | options_count
static int | non_options_count
W32_DATA wchar_t * | _w_watt_optarg
W32_DATA wchar_t * | _w_watt_optswchar
wchar_t * | _w_next_opt
wchar_t * | _w_empty = L""
wchar_t | _w_sw_char
wchar_t ** | _w_options
wchar_t ** | _w_non_options

Detailed Description

Parse command-line options.

Definition in file getopt.c.

Function Documentation

◆ _w_watt_getopt()

int W32_CALL _w_watt_getopt | ( | int | argc,
 |  | wchar_t *const * | argv,
 |  | const wchar_t * | opt_str
 | ) |  |

Definition at line 194 of file getopt.c.

◆ watt_getopt()

int W32_CALL watt_getopt | ( | int | argc,
 |  | char *const * | _argv,
 |  | const char * | opt_str
 | ) |  |

Definition at line 50 of file getopt.c.

Variable Documentation

◆ _w_empty

wchar_t* _w_empty = L""

Definition at line 188 of file getopt.c.

◆ _w_next_opt

wchar_t* _w_next_opt

Definition at line 187 of file getopt.c.

◆ _w_non_options

wchar_t** _w_non_options

Definition at line 192 of file getopt.c.

◆ _w_options

wchar_t** _w_options

Definition at line 191 of file getopt.c.

◆ _w_sw_char

wchar_t _w_sw_char

Definition at line 189 of file getopt.c.

◆ _w_watt_optarg

W32_DATA wchar_t* _w_watt_optarg
Todo:
make a wide-char version of getopt()

Definition at line 184 of file getopt.c.

◆ _w_watt_optswchar

W32_DATA wchar_t* _w_watt_optswchar

Definition at line 185 of file getopt.c.

◆ done

BOOL done
static

Definition at line 28 of file getopt.c.

◆ empty

char* empty = ""
static

Definition at line 26 of file getopt.c.

◆ next_opt

char* next_opt
static

Definition at line 25 of file getopt.c.

◆ non_options

char** non_options
static

Definition at line 32 of file getopt.c.

◆ non_options_count

int non_options_count
static

Definition at line 34 of file getopt.c.

◆ options

char** options
static

Definition at line 31 of file getopt.c.

◆ options_count

int options_count
static

Definition at line 33 of file getopt.c.

◆ sw_char

char sw_char
static

Definition at line 29 of file getopt.c.

◆ watt_optarg

char* watt_optarg = NULL

Definition at line 17 of file getopt.c.

◆ watt_opterr

int watt_opterr = 1

Definition at line 20 of file getopt.c.

◆ watt_optind

int watt_optind = 0

Definition at line 19 of file getopt.c.

◆ watt_optmode

enum _watt_optmode watt_optmode = GETOPT_UNIX

Definition at line 23 of file getopt.c.

◆ watt_optopt

int watt_optopt = 0

Definition at line 18 of file getopt.c.

◆ watt_optswchar

char* watt_optswchar = "-/"

Definition at line 21 of file getopt.c.


Watt-32 tcp/ip: E:/WATT/src/getprot.c File Reference

  • src
Functions | Variables
getprot.c File Reference

Go to the source code of this file.

Functions

static __inline struct protoent * | fill_protoent (const struct _protoent *p)
static void W32_CALL | _endprotoent (void)
void W32_CALL | ReadProtoFile (const char *fname)
const char *W32_CALL | GetProtoFile (void)
void W32_CALL | CloseProtoFile (void)
void W32_CALL | ReopenProtoFile (void)
struct protoent *W32_CALL | getprotoent (void)
struct protoent *W32_CALL | getprotobyname (const char *proto)
struct protoent *W32_CALL | getprotobynumber (int proto)
void W32_CALL | setprotoent (int stayopen)
void W32_CALL | endprotoent (void)

Variables

static struct _protoent * | proto0 = NULL
static char * | protoFname = NULL
static FILE * | protoFile = NULL
static BOOL | protoClose = FALSE

Detailed Description

BSD getprotobyxx() functions.

Definition in file getprot.c.

Function Documentation

◆ _endprotoent()

static void W32_CALL _endprotoent ( void )
static

Definition at line 70 of file getprot.c.

◆ CloseProtoFile()

void W32_CALL CloseProtoFile ( void )

Definition at line 153 of file getprot.c.

◆ endprotoent()

void W32_CALL endprotoent ( void )

Definition at line 295 of file getprot.c.

◆ fill_protoent()

static __inline struct protoent * fill_protoent ( const struct _protoent * p )
static

Definition at line 56 of file getprot.c.

◆ getprotobyname()

struct protoent *W32_CALL getprotobyname ( const char * proto )

Definition at line 215 of file getprot.c.

◆ getprotobynumber()

struct protoent *W32_CALL getprotobynumber ( int proto )

Definition at line 262 of file getprot.c.

◆ getprotoent()

struct protoent *W32_CALL getprotoent ( void )

Definition at line 166 of file getprot.c.

◆ GetProtoFile()

const char *W32_CALL GetProtoFile ( void )

Definition at line 148 of file getprot.c.

◆ ReadProtoFile()

void W32_CALL ReadProtoFile ( const char * fname )

Definition at line 75 of file getprot.c.

◆ ReopenProtoFile()

void W32_CALL ReopenProtoFile ( void )

Definition at line 159 of file getprot.c.

◆ setprotoent()

void W32_CALL setprotoent ( int stayopen )

Definition at line 281 of file getprot.c.

Variable Documentation

◆ proto0

struct _protoent* proto0 = NULL
static

Definition at line 51 of file getprot.c.

◆ protoClose

BOOL protoClose = FALSE
static

Definition at line 54 of file getprot.c.

◆ protoFile

FILE* protoFile = NULL
static

Definition at line 53 of file getprot.c.

◆ protoFname

char* protoFname = NULL
static

Definition at line 52 of file getprot.c.


Watt-32 tcp/ip: E:/WATT/src/getput.c File Reference

  • src
Functions
getput.c File Reference

Go to the source code of this file.

Functions

u_short W32_CALL | _getshort (const u_char *x)
u_long W32_CALL | _getlong (const u_char *x)
void W32_CALL | __putshort (u_short var, u_char *ptr)
void W32_CALL | __putlong (u_long var, u_char *ptr)
unsigned long W32_CALL | htonl (unsigned long val)
unsigned long W32_CALL | ntohl (unsigned long val)
unsigned short W32_CALL | htons (unsigned short val)
unsigned short W32_CALL | ntohs (unsigned short val)

Detailed Description

get/put short/long functions for little-endian platforms.

Definition in file getput.c.

Function Documentation

◆ __putlong()

void W32_CALL __putlong | ( | u_long | var,
 |  | u_char * | ptr
 | ) |  |

Definition at line 99 of file getput.c.

◆ __putshort()

void W32_CALL __putshort | ( | u_short | var,
 |  | u_char * | ptr
 | ) |  |

Definition at line 94 of file getput.c.

◆ _getlong()

u_long W32_CALL _getlong ( const u_char * x )

Definition at line 87 of file getput.c.

◆ _getshort()

u_short W32_CALL _getshort ( const u_char * x )

Definition at line 80 of file getput.c.

◆ htonl()

unsigned long W32_CALL htonl ( unsigned long val )

Definition at line 118 of file getput.c.

◆ htons()

unsigned short W32_CALL htons ( unsigned short val )

Definition at line 126 of file getput.c.

◆ ntohl()

unsigned long W32_CALL ntohl ( unsigned long val )

Definition at line 122 of file getput.c.

◆ ntohs()

unsigned short W32_CALL ntohs ( unsigned short val )

Definition at line 130 of file getput.c.


Watt-32 tcp/ip: E:/WATT/src/getserv.c File Reference

  • src
Functions | Variables
getserv.c File Reference

Go to the source code of this file.

Functions

static __inline struct servent * | fill_servent (const struct _servent *s)
static void W32_CALL | _endservent (void)
void W32_CALL | ReadServFile (const char *fname)
const char *W32_CALL | GetServFile (void)
void W32_CALL | CloseServFile (void)
void W32_CALL | ReopenServFile (void)
struct servent *W32_CALL | getservent (void)
struct servent *W32_CALL | getservbyname (const char *serv, const char *proto)
struct servent *W32_CALL | getservbyport (int port, const char *proto)
void W32_CALL | setservent (int stayopen)
void W32_CALL | endservent (void)
int | main (void)

Variables

static struct _servent * | serv0 = NULL
static char * | servFname = NULL
static FILE * | servFile = NULL
static BOOL | servClose = FALSE
static struct _servent * | port_hash [PORT_HASH_SIZE]

Detailed Description

Simple BSD-like services functions.

Definition in file getserv.c.

Function Documentation

◆ _endservent()

static void W32_CALL _endservent ( void )
static

Definition at line 91 of file getserv.c.

◆ CloseServFile()

void W32_CALL CloseServFile ( void )

Definition at line 165 of file getserv.c.

◆ endservent()

void W32_CALL endservent ( void )

Definition at line 319 of file getserv.c.

◆ fill_servent()

static __inline struct servent * fill_servent ( const struct _servent * s )
static

Definition at line 75 of file getserv.c.

◆ getservbyname()

struct servent *W32_CALL getservbyname | ( | const char * | serv,
 |  | const char * | proto
 | ) |  |

Definition at line 253 of file getserv.c.

◆ getservbyport()

struct servent *W32_CALL getservbyport | ( | int | port,
 |  | const char * | proto
 | ) |  |

Definition at line 286 of file getserv.c.

◆ getservent()

struct servent *W32_CALL getservent ( void )

Definition at line 181 of file getserv.c.

◆ GetServFile()

const char *W32_CALL GetServFile ( void )

Definition at line 157 of file getserv.c.

◆ main()

int main ( void )

Definition at line 353 of file getserv.c.

◆ ReadServFile()

void W32_CALL ReadServFile ( const char * fname )

Definition at line 99 of file getserv.c.

◆ ReopenServFile()

void W32_CALL ReopenServFile ( void )

Definition at line 174 of file getserv.c.

◆ setservent()

void W32_CALL setservent ( int stayopen )

Definition at line 306 of file getserv.c.

Variable Documentation

◆ port_hash

struct _servent* port_hash[PORT_HASH_SIZE]
static

Definition at line 66 of file getserv.c.

◆ serv0

struct _servent* serv0 = NULL
static

Definition at line 55 of file getserv.c.

◆ servClose

BOOL servClose = FALSE
static

Definition at line 58 of file getserv.c.

◆ servFile

FILE* servFile = NULL
static

Definition at line 57 of file getserv.c.

◆ servFname

char* servFname = NULL
static

Definition at line 56 of file getserv.c.


Watt-32 tcp/ip: E:/WATT/src/gettod.c File Reference

  • src
Functions | Variables
gettod.c File Reference

Go to the source code of this file.

Functions

static void | get_zone (struct timezone *tz, time_t now)
uint64 | FILETIME_to_unix_epoch (const FILETIME *ft)
W32_GCC_PRAGMA (GCC diagnostic push) W32_GCC_PRAGMA(GCC diagnostic ignored "-Wformat") W32_GCC_PRAGMA(GCC diagnostic ignored "-Wformat-extra-args") const char *ULONGLONG_to_ctime(ULONGLONG ts) = 255
return (0)
void | set_utc_offset (void)
Called from init_timers() once.
int W32_CALL W32_NAMESPACE() | gettimeofday (struct timeval *tv, struct timezone *tz)
static __inline uint64 | microsec_clock (void)
static uint64 | tsc_microsec (const uint64 *base)
static void | adjust_cpu_clock (const struct timeval *tv)
BOOL | get_tv_from_tsc (const struct ulong_long *tsc, struct timeval *tv)
int W32_CALL | gettimeofday2 (struct timeval *tv, struct timezone *tz)
static __inline BOOL | day_rollover (void)
static void | usleep (DWORD usec)
int | main (int argc, char **argv)

Variables

static long | utc_offset = 0
struct timezone * | tz

Detailed Description

gettimeofday() for non-djgpp targets and
gettimeofday2() for higher accuracy timing.

Definition in file gettod.c.

Function Documentation

◆ adjust_cpu_clock()

static void adjust_cpu_clock ( const struct timeval * tv )
static

Definition at line 359 of file gettod.c.

◆ day_rollover()

static __inline BOOL day_rollover ( void )
static

Definition at line 504 of file gettod.c.

◆ FILETIME_to_unix_epoch()

uint64 FILETIME_to_unix_epoch ( const FILETIME * ft )

Definition at line 104 of file gettod.c.

◆ get_tv_from_tsc()

BOOL get_tv_from_tsc | ( | const struct ulong_long * | tsc,
 |  | struct timeval * | tv
 | ) |  |

Definition at line 400 of file gettod.c.

◆ get_zone()

static void get_zone | ( | struct timezone * | tz,
 |  | time_t | now
 | ) |  |
static

Definition at line 78 of file gettod.c.

◆ gettimeofday()

int W32_CALL W32_NAMESPACE() gettimeofday | ( | struct timeval * | tv,
 |  | struct timezone * | tz
 | ) |  |

Definition at line 200 of file gettod.c.

◆ gettimeofday2()

int W32_CALL gettimeofday2 | ( | struct timeval * | tv,
 |  | struct timezone * | tz
 | ) |  |

Definition at line 424 of file gettod.c.

◆ main()

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 537 of file gettod.c.

◆ microsec_clock()

static __inline uint64 microsec_clock ( void )
static

Definition at line 313 of file gettod.c.

◆ set_utc_offset()

void set_utc_offset ( void )

Called from init_timers() once.

Definition at line 173 of file gettod.c.

◆ tsc_microsec()

static uint64 tsc_microsec ( const uint64 * base )
static

Definition at line 335 of file gettod.c.

◆ usleep()

static void usleep ( DWORD usec )
static

Definition at line 515 of file gettod.c.

◆ W32_GCC_PRAGMA()

W32_GCC_PRAGMA ( GCC diagnostic push ) const = 255

Definition at line 114 of file gettod.c.

Variable Documentation

◆ tz

struct timezone* tz
Initial value:
{
if (!tv && !tz)
{
SOCK_ERRNO (EINVAL);
return (-1);
}
if (tv)
{
FILETIME ft;
uint64 tim;
if (p_GetSystemTimePreciseAsFileTime)
(*p_GetSystemTimePreciseAsFileTime) (&ft);
else GetSystemTimeAsFileTime (&ft);
tim = FILETIME_to_unix_epoch (&ft);
tv->tv_sec = (long) (tim / 1000000L);
tv->tv_usec = (long) (tim % 1000000L);
}
if (tz)
get_zone (tz, tv->tv_sec)
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65

Definition at line 143 of file gettod.c.

◆ utc_offset

long utc_offset = 0
static

Definition at line 58 of file gettod.c.


Watt-32 tcp/ip: E:/WATT/src/gettod.h File Reference

  • src
Functions
gettod.h File Reference

Go to the source code of this file.

Functions

void | set_utc_offset (void)
Called from init_timers() once.
BOOL | get_tv_from_tsc (const struct ulong_long *tsc, struct timeval *tv)
uint64 | FILETIME_to_unix_epoch (const FILETIME *ft)
const char * | ULONGLONG_to_ctime (ULONGLONG ts)

Function Documentation

◆ FILETIME_to_unix_epoch()

uint64 FILETIME_to_unix_epoch ( const FILETIME * ft )

Definition at line 104 of file gettod.c.

◆ get_tv_from_tsc()

BOOL get_tv_from_tsc | ( | const struct ulong_long * | tsc,
 |  | struct timeval * | tv
 | ) |  |

Definition at line 400 of file gettod.c.

◆ set_utc_offset()

void set_utc_offset ( void )

Called from init_timers() once.

Definition at line 173 of file gettod.c.


Watt-32 tcp/ip: E:/WATT/src/hc_test.c Source File

  • src
hc_test.c
1 /* Generated file. NO NOT EDIT!
2 */
3 #include "wattcp.h"
4
5 #include <sys/wtime.h>
6
7 #include <sys/wtypes.h>
8 #include "get_xbyr.c"
wattcp.h
Core definitions.
wtime.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/src/hello.c Source File

  • src
hello.c
1#include <stdio.h>
2#include <stdlib.h>
3
4int main (void)
5{
6 printf ("Hello, I'm __GNUC__ %d\n", __GNUC__);
7
8#ifdef __CYGWIN__
9 printf ("Hello, I'm __CYGWIN__ %d\n", __CYGWIN__);
10#if defined(__x86_64__)
11 printf ("On '__x86_64__'\n");
12#endif
13
14#endif
15
16 return (0);
17}
18


Watt-32 tcp/ip: E:/WATT/src/highc.c File Reference

  • src
Functions | Variables
highc.c File Reference

Go to the source code of this file.

Functions

static char * | setup_environment (void)
static int | execute (const char *path, const char *args, const char *env)
int | _mw_watt_system (const char *cmd)
void | TRACE_FILE (const char *fmt,...)
void | TRACE_CONSOLE (int level, const char *fmt,...)
static BOOL | is_watt32_func (const char *func)
void | _call_trace (const char *from, const char *module, unsigned line, const char *to)
void | _prolog_trace (const char *func)
void | _epilog_trace (const char *func)

Variables

static int | level = 0
static const char * | caller [MAX_LEVEL]

Detailed Description

Functions for Metaware's High-C.

This file is for Metaware HighC/C++ with Pharlap only. Handles tracing of entry/exit functions and replaces the buggy system() routine.

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file highc.c.

Function Documentation

◆ _call_trace()

void _call_trace | ( | const char * | from,
 |  | const char * | module,
 |  | unsigned | line,
 |  | const char * | to
 | ) |  |

Definition at line 209 of file highc.c.

◆ _epilog_trace()

void _epilog_trace ( const char * func )

Definition at line 241 of file highc.c.

◆ _mw_watt_system()

int _mw_watt_system ( const char * cmd )

Definition at line 127 of file highc.c.

◆ _prolog_trace()

void _prolog_trace ( const char * func )

Definition at line 232 of file highc.c.

◆ execute()

static int execute | ( | const char * | path,
 |  | const char * | args,
 |  | const char * | env
 | ) |  |
static

Definition at line 83 of file highc.c.

◆ is_watt32_func()

static BOOL is_watt32_func ( const char * func )
static

<

Todo:
Fill in the rest (use a generated table?)

Definition at line 184 of file highc.c.

◆ setup_environment()

static char * setup_environment ( void )
static

Definition at line 52 of file highc.c.

◆ TRACE_CONSOLE()

void TRACE_CONSOLE | ( | int | level,
 |  | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 157 of file highc.c.

◆ TRACE_FILE()

void TRACE_FILE | ( | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 152 of file highc.c.

Variable Documentation

◆ caller

const char* caller[MAX_LEVEL]
static

Definition at line 182 of file highc.c.

◆ level

int level = 0
static

Definition at line 181 of file highc.c.


Watt-32 tcp/ip: E:/WATT/src/idna.c Source File

  • src
idna.c
1/*
2 * Code for enabling lookup of names with non-ASCII letters via
3 * ACE and IDNA (Internationalizing Domain Names in Applications)
4 * Ref. RFC-3490.
5 *
6 */
7
8/* \version 0.1: Mar 19, 2004 :
9 * G. Vanem - Created.
10 *
11 */
12
13#include <stdio.h>
14#include <stdlib.h>
15#include <limits.h>
16#include <string.h>
17#include <ctype.h>
18
19#include "wattcp.h"
20#include "misc.h"
21#include "misc_str.h"
22#include "pcdbug.h"
23#include "punycode.h"
24#include "idna.h"
25
26#if defined(USE_IDNA)
27
28#define _FLUSHWC_H /* normal_flushwc() not needed */
29
30#ifdef _MSC_VER
31#pragma warning (disable:4244)
32#endif
33
34#include "iconv/ascii.h"
35#include "iconv/jisx0201.h"
36#include "iconv/jisx0208.h"
37#include "iconv/cp437.h"
38#include "iconv/cp737.h"
39#include "iconv/cp775.h"
40#include "iconv/cp850.h"
41#include "iconv/cp852.h"
42#include "iconv/cp853.h"
43#include "iconv/cp855.h"
44#include "iconv/cp856.h"
45#include "iconv/cp857.h"
46#include "iconv/cp858.h"
47#include "iconv/cp860.h"
48#include "iconv/cp861.h"
49#include "iconv/cp862.h"
50#include "iconv/cp863.h"
51#include "iconv/cp864.h"
52#include "iconv/cp865.h"
53#include "iconv/cp866.h"
54#include "iconv/cp869.h"
55#include "iconv/cp874.h"
56#include "iconv/cp922.h"
57#include "iconv/cp932.h"
58#include "iconv/cp943.h"
59#include "iconv/ksc5601.h"
60#include "iconv/cp949.h"
61#include "iconv/big5.h"
62#include "iconv/cp950.h"
63#include "iconv/cp1046.h"
64#include "iconv/cp1124.h"
65#include "iconv/cp1125.h"
66#include "iconv/cp1129.h"
67#include "iconv/cp1133.h"
68#include "iconv/cp1161.h"
69#include "iconv/cp1162.h"
70#include "iconv/cp1163.h"
71#include "iconv/cp1250.h"
72#include "iconv/cp1251.h"
73#include "iconv/cp1252.h"
74#include "iconv/cp1253.h"
75#include "iconv/cp1254.h"
76#include "iconv/cp1255.h"
77#include "iconv/cp1256.h"
78#include "iconv/cp1257.h"
79#include "iconv/cp1258.h"
80
81typedef int (*toUnicode) (conv_t, ucs4_t *, const unsigned char *, int);
82typedef int (*toAscii) (conv_t, unsigned char *, ucs4_t, int);
83
84struct iconv_table {
85 const char *name;
86 WORD codepage;
87 toUnicode mbtowc;
88 toAscii wctomb;
89 };
90
91static const struct iconv_table mappings[] = {
92 { "CP437", 437, cp437_mbtowc, cp437_wctomb },
93 { "CP737", 737, cp737_mbtowc, cp737_wctomb },
94 { "CP775", 775, cp775_mbtowc, cp775_wctomb },
95 { "CP850", 850, cp850_mbtowc, cp850_wctomb },
96 { "CP852", 852, cp852_mbtowc, cp852_wctomb },
97 { "CP853", 853, cp853_mbtowc, cp853_wctomb },
98 { "CP855", 855, cp855_mbtowc, cp855_wctomb },
99 { "CP856", 856, cp856_mbtowc, cp856_wctomb },
100 { "CP857", 857, cp857_mbtowc, cp857_wctomb },
101 { "CP858", 858, cp858_mbtowc, cp858_wctomb },
102 { "CP860", 860, cp860_mbtowc, cp860_wctomb },
103 { "CP861", 861, cp861_mbtowc, cp861_wctomb },
104 { "CP862", 862, cp862_mbtowc, cp862_wctomb },
105 { "CP863", 863, cp863_mbtowc, cp863_wctomb },
106 { "CP864", 864, cp864_mbtowc, cp864_wctomb },
107 { "CP865", 865, cp865_mbtowc, cp865_wctomb },
108 { "CP866", 866, cp866_mbtowc, cp866_wctomb },
109 { "CP869", 869, cp869_mbtowc, cp869_wctomb },
110 { "CP874", 874, cp874_mbtowc, cp874_wctomb },
111 { "CP922", 922, cp922_mbtowc, cp922_wctomb },
112 { "CP932", 932, cp932_mbtowc, cp932_wctomb },
113 { "CP943", 943, cp943_mbtowc, cp943_wctomb },
114 { "CP949", 949, cp949_mbtowc, cp949_wctomb },
115 { "CP950", 950, cp950_mbtowc, cp950_wctomb },
116 { "CP1046", 1046, cp1046_mbtowc, cp1046_wctomb },
117 { "CP1124", 1124, cp1124_mbtowc, cp1124_wctomb },
118 { "CP1125", 1125, cp1125_mbtowc, cp1125_wctomb },
119 { "CP1129", 1129, cp1129_mbtowc, cp1129_wctomb },
120 { "CP1133", 1133, cp1133_mbtowc, cp1133_wctomb },
121 { "CP1161", 1161, cp1161_mbtowc, cp1161_wctomb },
122 { "CP1162", 1162, cp1162_mbtowc, cp1162_wctomb },
123 { "CP1163", 1163, cp1163_mbtowc, cp1163_wctomb },
124 { "CP1250", 1250, cp1250_mbtowc, cp1250_wctomb },
125 { "CP1251", 1251, cp1251_mbtowc, cp1251_wctomb },
126 { "CP1252", 1252, cp1252_mbtowc, cp1252_wctomb },
127 { "CP1253", 1253, cp1253_mbtowc, cp1253_wctomb },
128 { "CP1254", 1254, cp1254_mbtowc, cp1254_wctomb },
129 { "CP1255", 1255, cp1255_mbtowc, cp1255_wctomb },
130 { "CP1256", 1256, cp1256_mbtowc, cp1256_wctomb },
131 { "CP1257", 1257, cp1257_mbtowc, cp1257_wctomb },
132 { "CP1258", 1258, cp1258_mbtowc, cp1258_wctomb }
133 };
134
135static const struct iconv_table *curr_mapping = NULL;
136static conv_t iconv;
137
138/* The following string is used to convert printable
139 * characters between ASCII and the native charset:
140 */
141static const char print_ascii[] = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
142 "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
143 " !\"#$%&'()*+,-./" "0123456789:;<=>?"
144 "@ABCDEFGHIJKLMNO"
145 "PQRSTUVWXYZ[\\]^_"
146 "`abcdefghijklmno"
147 "pqrstuvwxyz{|}~\n";
148#if defined(WIN32)
149 #define GET_CODEPAGE() GetACP()
150#else
151 #define GET_CODEPAGE() GetCodePage()
152#endif
153
157BOOL iconv_init (WORD cp)
158{
159 int i;
160
161 if (cp == 0)
162 cp = GET_CODEPAGE();
163
164 IDNA_DEBUG (2, ("iconv_init: codepage %u\n", cp));
165 if (!cp)
166 return (FALSE);
167
168 for (i = 0; i < DIM(mappings); i++)
169 if (cp == mappings[i].codepage)
170 break;
171 if (i == DIM(mappings))
172 return (FALSE);
173 curr_mapping = mappings + i;
174 return (TRUE);
175}
176
180const char *iconv_strerror (int rc)
181{
182 switch (rc)
183 {
184 case RET_ILUNI:
185 return ("Illegal Unicode");
186 case RET_ILSEQ:
187 return ("Illegal sequence");
188 case RET_TOOSMALL:
189 return ("Output buffer too small");
190 case RET_TOOFEW(0):
191 return ("Input sequence too short");
192 case RET_TOOFEW(1):
193 return ("Input sequence 1 byte too short");
194 case RET_TOOFEW(2):
195 return ("Input sequence 2 bytes too short");
196 case RET_TOOFEW(3):
197 return ("Input sequence 3 bytes too short");
198 default:
199 return ("Unknown");
200 }
201}
202
206static int iconv_to_unicode (char ch, ucs4_t *uc)
207{
208 ucs4_t res = 0;
209 int rc;
210
211 if (!curr_mapping)
212 return (0);
213 rc = (*curr_mapping->mbtowc) (iconv, &res, (unsigned char*)&ch, 1);
214 if (rc < 1)
215 {
216 IDNA_DEBUG (1, ("iconv_to_unicode failed; %d, %s\n",
217 rc, iconv_strerror(rc)));
218 return (0);
219 }
220 *uc = res;
221 return (rc);
222}
223
227static int iconv_to_ascii (ucs4_t uc, char *ch)
228{
229 int rc = 0;
230
231 if (curr_mapping)
232 {
233 unsigned char res[4] = { 0,0,0,0 };
234
235 rc = (*curr_mapping->wctomb) (iconv, res, uc, sizeof(res));
236 if (rc == 1)
237 *ch = (char) res[0];
238 else if (rc == 2)
239 *(WORD*)ch = *(WORD*)&res;
240 else if (rc > 2)
241 memcpy (ch, res, rc);
242 else
243 IDNA_DEBUG (1, ("iconv_to_ascii failed; %d, %s\n",
244 rc, iconv_strerror(rc)));
245 }
246 return (rc);
247}
248
252static char **split_labels (const char *name)
253{
254 static char buf [MAX_LABELS][MAX_HOSTLEN];
255 static char *res [MAX_LABELS+1];
256 const char *p = name;
257 int i;
258
259 for (i = 0; i < MAX_LABELS && *p; i++)
260 {
261 const char *dot = strchr (p, '.');
262
263 if (!dot)
264 {
265 res[i] = _strlcpy (buf[i], p, sizeof(buf[i]));
266 i++;
267 break;
268 }
269 res[i] = _strlcpy (buf[i], p, dot-p+1);
270 p = ++dot;
271 }
272 res[i] = NULL;
273 IDNA_DEBUG (3, ("split_labels: `%s', %d labels\n", name, i));
274 return (res);
275}
276
280static char *convert_to_ACE (const char *name)
281{
282 int i, c;
283 DWORD utf_input[MAX_HOSTLEN];
284 BYTE utf_case [MAX_HOSTLEN];
285 const char *p;
286 size_t in_len, out_len;
287 static char out_buf [2*MAX_HOSTLEN];
288 enum punycode_status status;
289
290 for (i = 0, p = name; *p; i++)
291 {
292 ucs4_t utf = 0;
293
294 c = (*p++) & 255;
295 iconv_to_unicode (c, &utf);
296 utf_input[i] = utf;
297 utf_case[i] = (BYTE) isupper (c);
298 if (utf > 0xFFFF)
299 IDNA_DEBUG (3, ("%c -> u+%08lX\n", c, utf));
300 else IDNA_DEBUG (3, ("%c -> u+%04lX\n", c, utf));
301 }
302 in_len = i;
303 out_len = sizeof(out_buf);
304 status = punycode_encode (in_len, utf_input, utf_case, &out_len, out_buf);
305
306 if (status != punycode_success)
307 out_len = 0;
308
309 for (i = 0; i < (int)out_len; i++)
310 {
311 c = out_buf [i];
312
313 if (c < 0 || c > 127)
314 {
315 IDNA_DEBUG (1, ("illegal Punycode result: %c (%d)\n", c, c));
316 return (NULL);
317 }
318 if (!print_ascii[c])
319 {
320 IDNA_DEBUG (1, ("Punycode not ASCII: %c (%d)\n", c, c));
321 return (NULL);
322 }
323 out_buf [i] = print_ascii [c];
324 }
325 out_buf[i] = '\0';
326 IDNA_DEBUG (2, ("punycode_encode: status %d, out_len %lu, out_buf `%s'\n",
327 status, (u_long)out_len, out_buf));
328 return (status == punycode_success ? out_buf : NULL);
329}
330
334static char *convert_from_ACE (const char *name)
335{
336 DWORD utf_output[MAX_HOSTLEN];
337 BYTE utf_case [MAX_HOSTLEN];
338 static char out_buf [MAX_HOSTLEN];
339 size_t utf_len, i, j;
340 enum punycode_status status;
341
342 utf_len = sizeof(utf_output);
343 status = punycode_decode (strlen(name), name, &utf_len, utf_output, utf_case);
344
345 if (status != punycode_success)
346 utf_len = 0;
347
348 for (i = j = 0; i < utf_len && j < sizeof(out_buf); i++)
349 {
350 ucs4_t utf = utf_output[i];
351 int len = iconv_to_ascii (utf, out_buf+j);
352
353 if (len <= 0)
354 break;
355 IDNA_DEBUG (3, ("%c+%04lX -> %*.s\n",
356 utf_case[i] ? 'U' : 'u', utf, len, out_buf+j));
357 j += len;
358 }
359 out_buf[j] = '\0';
360 IDNA_DEBUG (2, ("punycode_decode: status %d, out_len %lu, out_buf `%s'\n",
361 status, (u_long)utf_len, out_buf));
362 return (status == punycode_success ? out_buf : NULL);
363}
364
365
383BOOL IDNA_convert_to_ACE (
384 char *name, /* IN/OUT: native ASCII/ACE name */
385 size_t *size) /* IN: length of name buf, */
386{ /* OUT: ACE encoded length */
387 const char *ace;
388 char *in_name = name;
389 char **labels = split_labels (name);
390 int i;
391 size_t len = 0;
392
393 for (i = 0; labels[i]; i++)
394 {
395 const BYTE *p;
396 const char *label = labels[i];
397
398 ace = NULL;
399 if (strnicmp(label,"xn--",4)) /* if not already encoded */
400 {
401 for (p = (const BYTE*)label; *p; p++)
402 if (*p >= 0x80)
403 {
404 ace = convert_to_ACE (label);
405 if (!ace)
406 return (FALSE);
407 break;
408 }
409 }
410
411 if (ace)
412 {
413 if (len + 5 + strlen(ace) > *size)
414 {
415 IDNA_DEBUG (1, ("input length exceeded\n"));
416 return (FALSE);
417 }
418 name += sprintf (name, "xn--%s.", ace);
419 }
420 else /* pass through unchanged */
421 {
422 if (len + 1 + strlen(label) > *size)
423 {
424 IDNA_DEBUG (1, ("input length exceeded\n"));
425 return (FALSE);
426 }
427 name += sprintf (name, "%s.", label);
428 }
429 }
430 if (i > 0) /* drop trailing '.' */
431 name--;
432 len = name - in_name;
433 *name = '\0';
434 *size = len;
435 IDNA_DEBUG (2, ("IDNA_convert_to_ACE: `%s', %lu bytes\n",
436 in_name, (u_long)len));
437 return (TRUE);
438}
439
450BOOL IDNA_convert_from_ACE (
451 char *name, /* IN/OUT: ACE/native ASCII name */
452 size_t *size) /* IN: ACE raw string length, */
453{ /* OUT: ASCII deccoded length */
454 char *in_name = name;
455 char **labels = split_labels (name);
456 int i;
457 u_long dsize;
458
459 for (i = 0; labels[i]; i++)
460 {
461 const char *ascii = NULL;
462 const char *label = labels[i];
463
464 if (!strncmp(label,"xn--",4) && label[4])
465 {
466 ascii = convert_from_ACE (label+4);
467 if (!ascii)
468 return (FALSE);
469 }
470 name += sprintf (name, "%s.", ascii ? ascii : label);
471 }
472 *name = '\0';
473 *size = name - in_name;
474 dsize = *(u_long*) size;
475 IDNA_DEBUG (2, ("IDNA_convert_from_ACE: `%s', %lu bytes\n",
476 in_name, dsize));
477 return (TRUE);
478}
479#endif /* USE_IDNA */
480
481#if defined(TEST_PROG)
482
483#include <netdb.h>
484#include <arpa/inet.h>
485
486#include "sock_ini.h"
487#include "pcdns.h"
488#include "pcdbug.h"
489
490#if !defined(USE_IDNA)
491int main (void)
492{
493 puts ("This program needs '#define USE_IDNA'");
494 return (1);
495}
496#else /* rest of file */
497
498void dump_cp_list (void)
499{
500 int i;
501
502 printf ("Supported codepages:\n");
503 for (i = 0; i < DIM(mappings); i++)
504 printf (" %s\n", mappings[i].name);
505 exit (0);
506}
507
508void usage (void)
509{
510 printf ("IDNA [-d] [-c codepage] hostname | ip-address\n"
511 " -d debug level, \"-dd\" for more details\n"
512 " -c select codepage (active is CP%d).\n", GET_CODEPAGE());
513 printf (" use \"-c?\" to list supported codepages\n");
514 exit (0);
515}
516
517int main (int argc, char **argv)
518{
519 struct in_addr addr;
520 struct hostent *he;
521 const char *host;
522 WORD cp = 0;
523 int ch;
524 int debug = 0;
525
526 while ((ch = getopt(argc, argv, "c:dh?")) != EOF)
527 switch (ch)
528 {
529 case 'c':
530 if (*optarg == '?')
531 dump_cp_list();
532 cp = atoi (optarg);
533 break;
534 case 'd':
535 debug++;
536 break;
537 case '?':
538 case 'h':
539 default:
540 usage();
541 break;
542 }
543
544 argc -= optind;
545 argv += optind;
546 if (!*argv)
547 usage();
548
549 if (debug)
550 dbug_init();
551 sock_init();
552
553 if (!iconv_init(cp))
554 {
555 printf ("iconv_init() failed for CP %d\n", cp);
556 return (1);
557 }
558
559 debug_on = debug;
560 dns_do_idna = TRUE;
561 host = argv[0];
562 printf ("Resolving `%s'...", host);
563 fflush (stdout);
564
565 if (inet_aton(host,&addr))
566 {
567 he = gethostbyaddr ((char*)&addr, sizeof(addr), AF_INET);
568 if (he)
569 printf ("%s\n", he->h_name);
570 else printf ("failed; %s)\n", hstrerror(h_errno));
571 }
572 else
573 {
574 he = gethostbyname (host);
575 if (he)
576 printf ("%s\n", inet_ntoa(*(struct in_addr*)he->h_addr));
577 else printf ("failed; %s\n", hstrerror(h_errno));
578 }
579
580 debug_on = 0;
581 return (0);
582}
583#endif /* USE_IDNA */
584#endif /* TEST_PROG */
585
586
idna.h
inet.h
misc.h
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
netdb.h
pcdbug.h
pcdns.h
sock_ini.h
conv_t
Definition: idna.h:8
hostent
Definition: netdb.h:104
iconv_table
Definition: idna.c:84
in_addr
Definition: in.h:143
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/idna.h File Reference

  • src
Data Structures | Typedefs | Functions
idna.h File Reference

Go to the source code of this file.

Data Structures

struct | conv_t
struct | Summary16

Typedefs

typedef long ucs4_t

Functions

const char * | iconv_strerror (int rc)
Return textual error for 'rc'.
BOOL | iconv_init (WORD code_page)
Initialise iconv; find codepage and mapping functions to use.
BOOL | IDNA_convert_to_ACE (char *name, size_t *size)
Convert a possibly non-ASCII name into ACE-form.
BOOL | IDNA_convert_from_ACE (char *name, size_t *size)
Convert a possibly ACE-encoded name to a name in native codepage.

Typedef Documentation

◆ ucs4_t

typedef long ucs4_t

Definition at line 6 of file idna.h.

Function Documentation

◆ iconv_init()

BOOL iconv_init ( WORD code_page )

Initialise iconv; find codepage and mapping functions to use.

Definition at line 157 of file idna.c.

◆ iconv_strerror()

const char * iconv_strerror ( int rc )

Return textual error for 'rc'.

Definition at line 180 of file idna.c.

◆ IDNA_convert_from_ACE()

BOOL IDNA_convert_from_ACE | ( | char * | name,
 |  | size_t * | size
 | ) |  |

Convert a possibly ACE-encoded name to a name in native codepage.

Todo:
Check for over-run on output.

1) Pass through labels w/o "xn--" prefix unaltered. 2) Strip "xn--" prefix and pass to punycode_decode() 3) Repeat for all labels with "xn--" prefix. 4) Collect Unicode strings and convert to original codepage.

Definition at line 450 of file idna.c.

◆ IDNA_convert_to_ACE()

BOOL IDNA_convert_to_ACE | ( | char * | name,
 |  | size_t * | size
 | ) |  |

Convert a possibly non-ASCII name into ACE-form.

E.g. convert "www.troms›.no" to ACE:

1) Convert each label separately; "www", "troms›" and "no" 2) "troms›" -> u+0074 u+0072 u+006F u+006D u+0073 u+00F8 3) Pass this through ‘punycode_encode()’ which gives "troms-zua". 4) Repeat for all labels with non-ASCII letters. 5) Prepending "xn--" for each converted label gives "www.xn--troms-zua.no".

E.g. 2: "bl†b‘r.syltet›y.no" -> "xn--blbr-roah.xn--syltety-v1a.no"

Ref. http://www.imc.org/idna/do-idna.cgi http://www.norid.no/domenenavnbaser/ace/ace_technical.en.html

Definition at line 383 of file idna.c.


Watt-32 tcp/ip: E:/WATT/src/ioctl.c File Reference

  • src
Functions | Variables
ioctl.c File Reference

Go to the source code of this file.

Functions

static int | file_ioctrl (Socket *socket, long cmd, void *argp)
static int | iface_ioctrl (Socket *socket, long cmd, void *argp)
static int | arp_ioctrl (Socket *socket, long cmd, void *argp)
static int | waterm_ioctrl (Socket *socket, long cmd, void *argp)
static const char * | get_ioctl_cmd (long cmd)
int W32_CALL | ioctlsocket (int s, long cmd, void *argp)
void | __get_ifname (char *if_name)
void | __set_ifname (const char *if_name)
static struct ifnet * | eth_ifnet (void)
static struct ifnet * | tok_ifnet (void)
int | main (void)
void | __assert_fail (unsigned line)
const char * | eth_addr_string (struct ether_addr *eth)
const char * | if_flags_string (unsigned short flags)

Variables

static char | eth_ifname [IFNAMSIZ] = "eth0"
static char | arc_ifname [IFNAMSIZ] = "arch0"
static char | tok_ifname [IFNAMSIZ] = "tr0"
static char | fddi_ifname [IFNAMSIZ] = "fddi0"
static char | ppp_ifname [IFNAMSIZ] = "ppp0"
static char | slp_ifname [IFNAMSIZ] = "slp0"
static const struct search_list | commands []

Detailed Description

BSD ioctlsocket().

Definition in file ioctl.c.

Function Documentation

◆ __assert_fail()

void __assert_fail ( unsigned line )

Definition at line 700 of file ioctl.c.

◆ __get_ifname()

void __get_ifname ( char * if_name )

Definition at line 175 of file ioctl.c.

◆ __set_ifname()

void __set_ifname ( const char * if_name )

Definition at line 207 of file ioctl.c.

◆ arp_ioctrl()

static int arp_ioctrl | ( | Socket * | socket,
 |  | long | cmd,
 |  | void * | argp
 | ) |  |
static

Definition at line 553 of file ioctl.c.

◆ eth_addr_string()

const char * eth_addr_string ( struct ether_addr * eth )

Definition at line 707 of file ioctl.c.

◆ eth_ifnet()

static struct ifnet * eth_ifnet ( void )
static
Todo:
fill info

Definition at line 234 of file ioctl.c.

◆ file_ioctrl()

static int file_ioctrl | ( | Socket * | socket,
 |  | long | cmd,
 |  | void * | argp
 | ) |  |
static

Definition at line 93 of file ioctl.c.

◆ get_ioctl_cmd()

static const char * get_ioctl_cmd ( long cmd )
static

Definition at line 658 of file ioctl.c.

◆ if_flags_string()

const char * if_flags_string ( unsigned short flags )

Definition at line 721 of file ioctl.c.

◆ iface_ioctrl()

static int iface_ioctrl | ( | Socket * | socket,
 |  | long | cmd,
 |  | void * | argp
 | ) |  |
static
Todo:
Get point-to-point address
Todo:
Set point-to-point address
Todo:
Set interface metric
Todo:
Handle deleting interface address
Todo:
Handle add/change interface alias

Definition at line 270 of file ioctl.c.

References _eth_addr, _eth_is_init, _eth_set_addr(), _pkt_rxmode, _pktdevclass, my_ip_addr, RXMODE_MULTICAST2, RXMODE_PROMISCOUS, and sin_mask.

◆ ioctlsocket()

int W32_CALL ioctlsocket | ( | int | s,
 |  | long | cmd,
 |  | void * | argp
 | ) |  |

Definition at line 64 of file ioctl.c.

◆ main()

int main ( void )

Definition at line 690 of file ioctl.c.

◆ tok_ifnet()

static struct ifnet * tok_ifnet ( void )
static
Todo:
fill info

Definition at line 242 of file ioctl.c.

◆ waterm_ioctrl()

static int waterm_ioctrl | ( | Socket * | socket,
 |  | long | cmd,
 |  | void * | argp
 | ) |  |
static
Todo:
set high watermark
Todo:
get high watermark
Todo:
set low watermark
Todo:
get low watermark
Todo:
OOB data available?

Definition at line 515 of file ioctl.c.

Variable Documentation

◆ arc_ifname

char arc_ifname[IFNAMSIZ] = "arch0"
static

Definition at line 169 of file ioctl.c.

◆ commands

const struct search_list commands[]
static

Definition at line 613 of file ioctl.c.

◆ eth_ifname

char eth_ifname[IFNAMSIZ] = "eth0"
static

Definition at line 168 of file ioctl.c.

◆ fddi_ifname

char fddi_ifname[IFNAMSIZ] = "fddi0"
static

Definition at line 171 of file ioctl.c.

◆ ppp_ifname

char ppp_ifname[IFNAMSIZ] = "ppp0"
static

Definition at line 172 of file ioctl.c.

◆ slp_ifname

char slp_ifname[IFNAMSIZ] = "slp0"
static

Definition at line 173 of file ioctl.c.

◆ tok_ifname

char tok_ifname[IFNAMSIZ] = "tr0"
static

Definition at line 170 of file ioctl.c.


Watt-32 tcp/ip: E:/WATT/src/ioport.h File Reference

  • src
Functions
ioport.h File Reference

Go to the source code of this file.

Functions

W32_GCC_INLINE unsigned char | inportb (unsigned short port)
W32_GCC_INLINE unsigned short | inportw (unsigned short port)
W32_GCC_INLINE void | outportb (unsigned short port, unsigned char data)
W32_GCC_INLINE void | outportw (unsigned short port, unsigned short data)

Function Documentation

◆ inportb()

W32_GCC_INLINE unsigned char inportb ( unsigned short port )

Definition at line 71 of file ioport.h.

◆ inportw()

W32_GCC_INLINE unsigned short inportw ( unsigned short port )

Definition at line 81 of file ioport.h.

◆ outportb()

W32_GCC_INLINE void outportb | ( | unsigned short | port,
 |  | unsigned char | data
 | ) |  |

Definition at line 91 of file ioport.h.

◆ outportw()

W32_GCC_INLINE void outportw | ( | unsigned short | port,
 |  | unsigned short | data
 | ) |  |

Definition at line 99 of file ioport.h.


Watt-32 tcp/ip: E:/WATT/src/ip4_frag.c File Reference

  • src
Data Structures | Typedefs | Enumerations | Functions | Variables
ip4_frag.c File Reference

Go to the source code of this file.

Data Structures

struct | huge_ip
struct | frag_key
struct | frag_bucket
struct | hole
struct | frag_ctrl

Typedefs

typedef fd_set used_map[NUM_FD_SETS]

Enumerations

enum frag_bits {
IS_NONE = 0x00 ,
IS_FRAG = 0x01 ,
IS_LAST = 0x02 ,
IS_FIRST = 0x04
}

Functions

static void | TRACE_MSG (int color, const char *fmt,...)
static void | dump_frag_holes (const char *where, const struct frag_ctrl *fc, const struct hole *hole)
static const char * | decode_fbits (int fb)
static BOOL | match_frag (const in_Header *ip, int *slot, int *bucket, int *free_bucket)
static __inline BOOL | check_frag_ofs (const in_Header *ip, DWORD ofs, DWORD end)
static __inline void | set_fbits (DWORD offset, WORD flags)
static BOOL | setup_first_frag (const in_Header *ip, int idx)
int | ip4_defragment (const in_Header **ip_ptr, DWORD offset, WORD flags)
int | ip4_free_fragment (const in_Header *ip)
static void W32_CALL | chk_timeout_frags (void)
static void W32_CALL | free_frag_buckets (void)
void | ip4_frag_init (void)
int | main (void)
void | test_colors (void)
void | usage (const char *argv0)
BYTE * | init_frag (int argc, char **argv)
int | rand_packet (fd_set *fd, int max)
int | main (int argc, char **argv)

Variables

int | _ip4_frag_reasm = MAX_IP_HOLDTIME
static struct frag_ctrl | frag_control [MAX_IP_FRAGS][MAX_FRAGMENTS]
static struct frag_bucket | frag_buckets [MAX_IP_FRAGS]
static long | data_start
static long | data_end
static long | data_length
static enum frag_bits | fbits
static DWORD | to_host = 0
static WORD | frag_ofs = 0
static int | max_frags = 5
static int | frag_size = 1000
static int | rand_frag = 0
static int | rev_order = 0
static int | time_frag = 0
struct {
const char * col_name
int col_value
} colors []

Detailed Description

IP4 de-fragmenter.

Definition in file ip4_frag.c.

Typedef Documentation

◆ used_map

typedef fd_set used_map[NUM_FD_SETS]

Definition at line 95 of file ip4_frag.c.

Enumeration Type Documentation

◆ frag_bits

enum frag_bits

Definition at line 141 of file ip4_frag.c.

Function Documentation

◆ check_frag_ofs()

static __inline BOOL check_frag_ofs | ( | const in_Header * | ip,
 |  | DWORD | ofs,
 |  | DWORD | end
 | ) |  |
static

Definition at line 268 of file ip4_frag.c.

◆ chk_timeout_frags()

static void W32_CALL chk_timeout_frags ( void )
static

Definition at line 660 of file ip4_frag.c.

◆ decode_fbits()

static const char * decode_fbits ( int fb )
static

Definition at line 189 of file ip4_frag.c.

◆ dump_frag_holes()

static void dump_frag_holes | ( | const char * | where,
 |  | const struct frag_ctrl * | fc,
 |  | const struct hole * | hole
 | ) |  |
static

Definition at line 167 of file ip4_frag.c.

◆ free_frag_buckets()

static void W32_CALL free_frag_buckets ( void )
static

Definition at line 708 of file ip4_frag.c.

◆ init_frag()

BYTE * init_frag | ( | int | argc,
 |  | char ** | argv
 | ) |  |
Todo:
Simulate fragment timeout

Definition at line 844 of file ip4_frag.c.

◆ ip4_defragment()

int ip4_defragment | ( | const in_Header ** | ip_ptr,
 |  | DWORD | offset,
 |  | WORD | flags
 | ) |  |

Definition at line 426 of file ip4_frag.c.

◆ ip4_frag_init()

void ip4_frag_init ( void )

Definition at line 728 of file ip4_frag.c.

◆ ip4_free_fragment()

int ip4_free_fragment ( const in_Header * ip )

Definition at line 630 of file ip4_frag.c.

◆ main() [1/2]

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 932 of file ip4_frag.c.

◆ main() [2/2]

int main ( void )

Definition at line 756 of file ip4_frag.c.

◆ match_frag()

static BOOL match_frag | ( | const in_Header * | ip,
 |  | int * | slot,
 |  | int * | bucket,
 |  | int * | free_bucket
 | ) |  |
static

Definition at line 223 of file ip4_frag.c.

◆ rand_packet()

int rand_packet | ( | fd_set * | fd,
 |  | int | max
 | ) |  |

Definition at line 913 of file ip4_frag.c.

◆ set_fbits()

static __inline void set_fbits | ( | DWORD | offset,
 |  | WORD | flags
 | ) |  |
static

Definition at line 282 of file ip4_frag.c.

◆ setup_first_frag()

static BOOL setup_first_frag | ( | const in_Header * | ip,
 |  | int | idx
 | ) |  |
static

Definition at line 301 of file ip4_frag.c.

◆ test_colors()

void test_colors ( void )

Definition at line 813 of file ip4_frag.c.

◆ TRACE_MSG()

static void TRACE_MSG | ( | int | color,
 |  | const char * | fmt,
 |  |  | ...
 | ) |  |
static

Definition at line 63 of file ip4_frag.c.

◆ usage()

void usage ( const char * argv0 )

Definition at line 826 of file ip4_frag.c.

Variable Documentation

◆ _ip4_frag_reasm

int _ip4_frag_reasm = MAX_IP_HOLDTIME

Definition at line 58 of file ip4_frag.c.

◆ col_name

const char* col_name

Definition at line 792 of file ip4_frag.c.

◆ col_value

int col_value

Definition at line 793 of file ip4_frag.c.

◆

struct { ... } colors[]
Initial value:
= {
{ "black", 0 },
{ "blue", FOREGROUND_BLUE },
{ "green", FOREGROUND_GREEN },
{ "cyan", FOREGROUND_BLUE | FOREGROUND_GREEN },
{ "red", FOREGROUND_RED },
{ "magenta", FOREGROUND_BLUE | FOREGROUND_RED },
{ "brown", FOREGROUND_RED | FOREGROUND_GREEN },
{ "lightgray", FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED },
{ "darkgray", FOREGROUND_INTENSITY | 0 },
{ "lightblue", FOREGROUND_INTENSITY | FOREGROUND_BLUE },
{ "lightgreen", FOREGROUND_INTENSITY | FOREGROUND_GREEN },
{ "lightcyan", FOREGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_GREEN },
{ "lightred", FOREGROUND_INTENSITY | FOREGROUND_RED },
{ "lightmagenta", FOREGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_RED },
{ "yellow", FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN },
{ "white", FOREGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED }
}

◆ data_end

long data_end
static

Definition at line 138 of file ip4_frag.c.

◆ data_length

long data_length
static

Definition at line 139 of file ip4_frag.c.

◆ data_start

long data_start
static

Definition at line 137 of file ip4_frag.c.

◆ fbits

enum frag_bits fbits
static

Definition at line 164 of file ip4_frag.c.

◆ frag_buckets

struct frag_bucket frag_buckets[MAX_IP_FRAGS]
static

Definition at line 135 of file ip4_frag.c.

◆ frag_control

struct frag_ctrl frag_control[MAX_IP_FRAGS][MAX_FRAGMENTS]
static

Definition at line 134 of file ip4_frag.c.

◆ frag_ofs

WORD frag_ofs = 0
static

Definition at line 780 of file ip4_frag.c.

◆ frag_size

int frag_size = 1000
static

Definition at line 782 of file ip4_frag.c.

◆ max_frags

int max_frags = 5
static

Definition at line 781 of file ip4_frag.c.

◆ rand_frag

int rand_frag = 0
static

Definition at line 783 of file ip4_frag.c.

◆ rev_order

int rev_order = 0
static

Definition at line 784 of file ip4_frag.c.

◆ time_frag

int time_frag = 0
static

Definition at line 785 of file ip4_frag.c.

◆ to_host

DWORD to_host = 0
static

Definition at line 779 of file ip4_frag.c.


Watt-32 tcp/ip: E:/WATT/src/ip4_frag.h File Reference

  • src
Functions | Variables
ip4_frag.h File Reference

Go to the source code of this file.

Functions

void | ip4_frag_init (void)
int | ip4_defragment (const in_Header **ip, DWORD ofs, WORD flags)
int | ip4_free_fragment (const in_Header *ip)

Variables

int _ip4_frag_reasm

Function Documentation

◆ ip4_defragment()

int ip4_defragment | ( | const in_Header ** | ip,
 |  | DWORD | ofs,
 |  | WORD | flags
 | ) |  |

Definition at line 426 of file ip4_frag.c.

◆ ip4_frag_init()

void ip4_frag_init ( void )

Definition at line 728 of file ip4_frag.c.

◆ ip4_free_fragment()

int ip4_free_fragment ( const in_Header * ip )

Definition at line 630 of file ip4_frag.c.

Variable Documentation

◆ _ip4_frag_reasm

int _ip4_frag_reasm
extern

Definition at line 58 of file ip4_frag.c.


Watt-32 tcp/ip: E:/WATT/src/ip4_in.c File Reference

  • src
Functions
ip4_in.c File Reference

Go to the source code of this file.

Functions

int | _ip4_handler (const in_Header *ip, BOOL broadcast)
int | _chk_ip4_header (const in_Header *ip)
int | _ip4_is_local_addr (DWORD ip)
int | _ip4_is_loopback_addr (DWORD ip)
int | _ip4_is_unique_addr (DWORD ip)
int | _ip4_is_multihome_addr (DWORD ip)
int | _ip4_is_ip_brdcast (const in_Header *ip)
int | _ip4_is_multicast (DWORD ip)

Detailed Description

IPv4 input and address classifier functions.

Version

1.0 : Sep 18, 2001 : G. Vanem - moved from pctcp.c & ip_out.c

Definition in file ip4_in.c.

Function Documentation

◆ _chk_ip4_header()

int _chk_ip4_header ( const in_Header * ip )

Definition at line 140 of file ip4_in.c.

◆ _ip4_handler()

int _ip4_handler | ( | const in_Header * | ip,
 |  | BOOL | broadcast
 | ) |  |
Todo:
check for LSRR option and replace ip->source with actual source-address burried in option (ref. RFC-1122)
Todo:
handle compressed IP (use zlib)

Definition at line 33 of file ip4_in.c.

References _tcp_handler(), _udp_handler(), block_ip, icmp_handler(), and icmp_send_unreach().

◆ _ip4_is_ip_brdcast()

int _ip4_is_ip_brdcast ( const in_Header * ip )

Definition at line 207 of file ip4_in.c.

◆ _ip4_is_local_addr()

int _ip4_is_local_addr ( DWORD ip )

Definition at line 170 of file ip4_in.c.

◆ _ip4_is_loopback_addr()

int _ip4_is_loopback_addr ( DWORD ip )

Definition at line 177 of file ip4_in.c.

◆ _ip4_is_multicast()

int _ip4_is_multicast ( DWORD ip )

Definition at line 227 of file ip4_in.c.

◆ _ip4_is_multihome_addr()

int _ip4_is_multihome_addr ( DWORD ip )

Definition at line 195 of file ip4_in.c.

◆ _ip4_is_unique_addr()

int _ip4_is_unique_addr ( DWORD ip )

Definition at line 186 of file ip4_in.c.


Watt-32 tcp/ip: E:/WATT/src/ip4_in.h File Reference

  • src
Functions
ip4_in.h File Reference

Go to the source code of this file.

Functions

int | _ip4_handler (const in_Header *ip, BOOL broadcast)
int | _chk_ip4_header (const in_Header *ip)
int | _ip4_is_local_addr (DWORD ip)
int | _ip4_is_unique_addr (DWORD ip)
int | _ip4_is_multihome_addr (DWORD ip)
int | _ip4_is_ip_brdcast (const in_Header *ip)
int | _ip4_is_multicast (DWORD ip)
int | _ip4_is_loopback_addr (DWORD ip)

Function Documentation

◆ _chk_ip4_header()

int _chk_ip4_header ( const in_Header * ip )

Definition at line 140 of file ip4_in.c.

◆ _ip4_handler()

int _ip4_handler | ( | const in_Header * | ip,
 |  | BOOL | broadcast
 | ) |  |
Todo:
check for LSRR option and replace ip->source with actual source-address burried in option (ref. RFC-1122)
Todo:
handle compressed IP (use zlib)

Definition at line 33 of file ip4_in.c.

References _tcp_handler(), _udp_handler(), block_ip, icmp_handler(), and icmp_send_unreach().

◆ _ip4_is_ip_brdcast()

int _ip4_is_ip_brdcast ( const in_Header * ip )

Definition at line 207 of file ip4_in.c.

◆ _ip4_is_local_addr()

int _ip4_is_local_addr ( DWORD ip )

Definition at line 170 of file ip4_in.c.

◆ _ip4_is_loopback_addr()

int _ip4_is_loopback_addr ( DWORD ip )

Definition at line 177 of file ip4_in.c.

◆ _ip4_is_multicast()

int _ip4_is_multicast ( DWORD ip )

Definition at line 227 of file ip4_in.c.

◆ _ip4_is_multihome_addr()

int _ip4_is_multihome_addr ( DWORD ip )

Definition at line 195 of file ip4_in.c.

◆ _ip4_is_unique_addr()

int _ip4_is_unique_addr ( DWORD ip )

Definition at line 186 of file ip4_in.c.


Watt-32 tcp/ip: E:/WATT/src/ip4_out.c File Reference

  • src
Functions | Variables
ip4_out.c File Reference

Go to the source code of this file.

Functions

WORD | _get_ip4_id (void)
Increment IPv4-identifier before returning it.
WORD | _get_this_ip4_id (void)
Return IPv4-identifier but don't increment it.
int | _ip4_output (in_Header *ip, DWORD src_ip, DWORD dst_ip, BYTE protocol, BYTE ttl, BYTE tos, WORD ip_id, int data_len, const void *sock, const char *file, unsigned line)
The IP4 packet transmitter.
static __inline in_Header * | make_ip_pkt (DWORD host, BOOL first, char **data)
static in_Header * | make_tcp_pkt (const _tcp_Socket *s, BOOL first, char **data)
static __inline in_Header * | make_udp_pkt (const _udp_Socket *s, BOOL first, unsigned len, char **data)
int | _ip4_send_fragments (sock_type *s, BYTE proto, DWORD dest, const void *buf, unsigned len, const char *file, unsigned line)

Variables

BYTE | _default_tos = 0
int | _default_ttl = 254
int | _ip4_id_increment = 1
BOOL | _ip4_dont_frag = FALSE
static WORD | ip4_id = 0

Detailed Description

IPv4 output routines.

Definition in file ip4_out.c.

Function Documentation

◆ _get_ip4_id()

WORD _get_ip4_id ( void )

Increment IPv4-identifier before returning it.

Note: Use _get_this_ip4_id() for sending IP fragments.

Definition at line 65 of file ip4_out.c.

References _ip4_id_increment.

◆ _get_this_ip4_id()

WORD _get_this_ip4_id ( void )

Return IPv4-identifier but don't increment it.

Definition at line 74 of file ip4_out.c.

◆ _ip4_output()

int _ip4_output | ( | in_Header * | ip,
 |  | DWORD | src_ip,
 |  | DWORD | dst_ip,
 |  | BYTE | protocol,
 |  | BYTE | ttl,
 |  | BYTE | tos,
 |  | WORD | ip_id,
 |  | int | data_len,
 |  | const void * | sock,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

The IP4 packet transmitter.

Return values
'data_len | + sizeof(*ip)' on success.
0 | on fail.
Todo:
Handle IP-fragments here (call ip4_send_fragments() when needed)

Definition at line 86 of file ip4_out.c.

References _default_ttl, _eth_send(), _get_ip4_id(), _ip4_dont_frag, and my_ip_addr.

◆ _ip4_send_fragments()

int _ip4_send_fragments | ( | sock_type * | s,
 |  | BYTE | proto,
 |  | DWORD | dest,
 |  | const void * | buf,
 |  | unsigned | len,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |
Todo:
Maybe send highest offset fragment first?

Definition at line 235 of file ip4_out.c.

References _get_ip4_id(), _ip4_output(), and tcp_Socket::state.

◆ make_ip_pkt()

static __inline in_Header * make_ip_pkt | ( | DWORD | host,
 |  | BOOL | first,
 |  | char ** | data
 | ) |  |
static

Definition at line 132 of file ip4_out.c.

◆ make_tcp_pkt()

static in_Header * make_tcp_pkt | ( | const _tcp_Socket * | s,
 |  | BOOL | first,
 |  | char ** | data
 | ) |  |
static

Definition at line 154 of file ip4_out.c.

◆ make_udp_pkt()

static __inline in_Header * make_udp_pkt | ( | const _udp_Socket * | s,
 |  | BOOL | first,
 |  | unsigned | len,
 |  | char ** | data
 | ) |  |
static

Definition at line 195 of file ip4_out.c.

Variable Documentation

◆ _default_tos

BYTE _default_tos = 0

The default type-of-service for IP

Definition at line 53 of file ip4_out.c.

◆ _default_ttl

int _default_ttl = 254

The default time-to-live for IP

Definition at line 54 of file ip4_out.c.

◆ _ip4_dont_frag

BOOL _ip4_dont_frag = FALSE

Enable the IP_DF bit on output

Definition at line 56 of file ip4_out.c.

◆ _ip4_id_increment

int _ip4_id_increment = 1

The IP identifier increment

Definition at line 55 of file ip4_out.c.

◆ ip4_id

WORD ip4_id = 0
static

Definition at line 58 of file ip4_out.c.


Watt-32 tcp/ip: E:/WATT/src/ip4_out.h File Reference

  • src
Functions | Variables
ip4_out.h File Reference

Go to the source code of this file.

Functions

WORD | _get_ip4_id (void)
Increment IPv4-identifier before returning it.
WORD | _get_this_ip4_id (void)
Return IPv4-identifier but don't increment it.
int | _ip4_output (in_Header *ip, DWORD src_ip, DWORD dst_ip, BYTE protocol, BYTE ttl, BYTE tos, WORD ip_id, int data_len, const void *sock, const char *file, unsigned line)
The IP4 packet transmitter.
int | _ip4_send_fragments (sock_type *sk, BYTE proto, DWORD dest, const void *buf, unsigned len, const char *file, unsigned line)

Variables

BOOL | _ip4_dont_frag
int | _ip4_id_increment
int | _default_ttl
BYTE | _default_tos

Function Documentation

◆ _get_ip4_id()

WORD _get_ip4_id ( void )

Increment IPv4-identifier before returning it.

Note: Use _get_this_ip4_id() for sending IP fragments.

Definition at line 65 of file ip4_out.c.

References _ip4_id_increment.

◆ _get_this_ip4_id()

WORD _get_this_ip4_id ( void )

Return IPv4-identifier but don't increment it.

Definition at line 74 of file ip4_out.c.

◆ _ip4_output()

int _ip4_output | ( | in_Header * | ip,
 |  | DWORD | src_ip,
 |  | DWORD | dst_ip,
 |  | BYTE | protocol,
 |  | BYTE | ttl,
 |  | BYTE | tos,
 |  | WORD | ip_id,
 |  | int | data_len,
 |  | const void * | sock,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

The IP4 packet transmitter.

Return values
'data_len | + sizeof(*ip)' on success.
0 | on fail.
Todo:
Handle IP-fragments here (call ip4_send_fragments() when needed)

Definition at line 86 of file ip4_out.c.

References _default_ttl, _eth_send(), _get_ip4_id(), _ip4_dont_frag, and my_ip_addr.

◆ _ip4_send_fragments()

int _ip4_send_fragments | ( | sock_type * | sk,
 |  | BYTE | proto,
 |  | DWORD | dest,
 |  | const void * | buf,
 |  | unsigned | len,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |
Todo:
Maybe send highest offset fragment first?

Definition at line 235 of file ip4_out.c.

References _get_ip4_id(), _ip4_output(), and tcp_Socket::state.

Variable Documentation

◆ _default_tos

BYTE _default_tos
extern

The default type-of-service for IP

Definition at line 53 of file ip4_out.c.

◆ _default_ttl

int _default_ttl
extern

The default time-to-live for IP

Definition at line 54 of file ip4_out.c.

◆ _ip4_dont_frag

BOOL _ip4_dont_frag
extern

Enable the IP_DF bit on output

Definition at line 56 of file ip4_out.c.

◆ _ip4_id_increment

int _ip4_id_increment
extern

The IP identifier increment

Definition at line 55 of file ip4_out.c.


Watt-32 tcp/ip: E:/WATT/src/ip6_in.c File Reference

  • src
Functions | Variables
ip6_in.c File Reference

Go to the source code of this file.

Functions

int | _ip6_handler (const in6_Header *ip, BOOL broadcast)
int | _ip6_is_local_addr (const void *ip)
int | _ip6_is_addr_v4mapped (const void *ip)
int | _ip6_is_addr_loopback (const void *ip)
static | void (W32_CALL *prev_hook)(const char *
static const char *static void | set_my_ip6 (const char *value)
static void W32_CALL | ip6_config (const char *name, const char *value)
int | _ip6_init (void)
static void | set_default_ip (void)
int | _ip6_pkt_init (void)
void | _ip6_post_init (void)

Variables

static WORD v4_prefix [6] = { 0,0,0,0,0,0xFFFF }

Detailed Description

IPv6 input routines.

Definition in file ip6_in.c.

Function Documentation

◆ _ip6_handler()

int _ip6_handler | ( | const in6_Header * | ip,
 |  | BOOL | broadcast
 | ) |  |

Definition at line 69 of file ip6_in.c.

◆ _ip6_init()

int _ip6_init ( void )

Definition at line 198 of file ip6_in.c.

◆ _ip6_is_addr_loopback()

int _ip6_is_addr_loopback ( const void * ip )

Definition at line 167 of file ip6_in.c.

◆ _ip6_is_addr_v4mapped()

int _ip6_is_addr_v4mapped ( const void * ip )

Definition at line 160 of file ip6_in.c.

◆ _ip6_is_local_addr()

int _ip6_is_local_addr ( const void * ip )

Definition at line 146 of file ip6_in.c.

◆ _ip6_pkt_init()

int _ip6_pkt_init ( void )

Definition at line 230 of file ip6_in.c.

◆ _ip6_post_init()

void _ip6_post_init ( void )

Definition at line 248 of file ip6_in.c.

◆ ip6_config()

static void W32_CALL ip6_config | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Definition at line 186 of file ip6_in.c.

◆ set_default_ip()

static void set_default_ip ( void )
static

Definition at line 209 of file ip6_in.c.

◆ set_my_ip6()

static const char *static void set_my_ip6 ( const char * value )
static

Definition at line 178 of file ip6_in.c.

Variable Documentation

◆ v4_prefix

WORD v4_prefix[6] = { 0,0,0,0,0,0xFFFF }
static

Definition at line 158 of file ip6_in.c.


Watt-32 tcp/ip: E:/WATT/src/ip6_in.h File Reference

  • src
Data Structures | Typedefs | Functions
ip6_in.h File Reference

Go to the source code of this file.

Data Structures

struct ip6_RouteHdr

Typedefs

typedef struct ip6_RouteHdr ip6_RouteHdr

Functions

int | _ip6_handler (const in6_Header *ip, BOOL broadcast)
int | _ip6_init (void)
int | _ip6_pkt_init (void)
void | _ip6_post_init (void)
int | _ip6_is_local_addr (const void *ip)

Function Documentation

◆ _ip6_handler()

int _ip6_handler | ( | const in6_Header * | ip,
 |  | BOOL | broadcast
 | ) |  |

Definition at line 69 of file ip6_in.c.

◆ _ip6_init()

int _ip6_init ( void )

Definition at line 198 of file ip6_in.c.

◆ _ip6_is_local_addr()

int _ip6_is_local_addr ( const void * ip )

Definition at line 146 of file ip6_in.c.

◆ _ip6_pkt_init()

int _ip6_pkt_init ( void )

Definition at line 230 of file ip6_in.c.

◆ _ip6_post_init()

void _ip6_post_init ( void )

Definition at line 248 of file ip6_in.c.


Watt-32 tcp/ip: E:/WATT/src/ip6_out.c File Reference

  • src
Functions | Variables
ip6_out.c File Reference

Go to the source code of this file.

Functions

W32_GCC_PRAGMA (GCC diagnostic push) W32_GCC_PRAGMA(GCC diagnostic ignored "-Wmissing-braces") struct in6_addr in6addr_my_ip
int _ip6_output (in6_Header *ip, ip6_address *src_ip, ip6_address *dst_ip, BYTE protocol, unsigned data_len, int hop_lim, const void *sock, const char *file, unsigned line)

Variables

const struct in6_addr | in6addr_loopback
const struct in6_addr | in6addr_any
const struct in6_addr | in6addr_all_1
const struct in6_addr | in6addr_alln_mc
const struct in6_addr | in6addr_allr_mc
const BYTE | in6addr_mapped [12] = { 0,0,0,0, 0,0,0,0, 0,0,0xFF,0xFF }

Detailed Description

IPv6 output routines.

Definition in file ip6_out.c.

Function Documentation

◆ _ip6_output()

int _ip6_output | ( | in6_Header * | ip,
 |  | ip6_address * | src_ip,
 |  | ip6_address * | dst_ip,
 |  | BYTE | protocol,
 |  | unsigned | data_len,
 |  | int | hop_lim,
 |  | const void * | sock,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |
Todo:
: Support fragments

Definition at line 79 of file ip6_out.c.

References _eth_send().

◆ W32_GCC_PRAGMA()

W32_GCC_PRAGMA ( GCC diagnostic push )

Definition at line 160 of file oldstuff.c.

Variable Documentation

◆ in6addr_all_1

const struct in6_addr in6addr_all_1
Initial value:
= {{ 0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF }}

Definition at line 62 of file ip6_out.c.

◆ in6addr_alln_mc

const struct in6_addr in6addr_alln_mc
Initial value:
= {{ 0xFF,2,0,0,0,0,0,0,
0,0,0,0,0,0,0,1 }}

Definition at line 67 of file ip6_out.c.

◆ in6addr_allr_mc

const struct in6_addr in6addr_allr_mc
Initial value:
= {{ 0xFF,2,0,0,0,0,0,0,
0,0,0,0,0,0,0,2 }}

Definition at line 70 of file ip6_out.c.

◆ in6addr_any

const struct in6_addr in6addr_any
Initial value:
= {{ 0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0 }}

Definition at line 60 of file ip6_out.c.

◆ in6addr_loopback

const struct in6_addr in6addr_loopback
Initial value:
= {{ 0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,1 }}

Definition at line 58 of file ip6_out.c.

◆ in6addr_mapped

const BYTE in6addr_mapped[12] = { 0,0,0,0, 0,0,0,0, 0,0,0xFF,0xFF }

Definition at line 73 of file ip6_out.c.


Watt-32 tcp/ip: E:/WATT/src/ip6_out.h File Reference

  • src
Functions | Variables
ip6_out.h File Reference

Go to the source code of this file.

Functions

int _ip6_output (in6_Header *ip, ip6_address *src_ip, ip6_address *dst_ip, BYTE next_hdr, unsigned data_len, int hop_lim, const void *sock, const char *file, unsigned line)

Variables

W32_DATA struct in6_addr | in6addr_my_ip
const struct in6_addr | in6addr_all_1
const struct in6_addr | in6addr_alln_mc
const struct in6_addr | in6addr_allr_mc
const BYTE | in6addr_mapped [12]
int | _default6_ttl

Function Documentation

◆ _ip6_output()

int _ip6_output | ( | in6_Header * | ip,
 |  | ip6_address * | src_ip,
 |  | ip6_address * | dst_ip,
 |  | BYTE | next_hdr,
 |  | unsigned | data_len,
 |  | int | hop_lim,
 |  | const void * | sock,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |
Todo:
: Support fragments

Definition at line 79 of file ip6_out.c.

References _eth_send().

Variable Documentation

◆ in6addr_all_1

const struct in6_addr in6addr_all_1
extern

Definition at line 62 of file ip6_out.c.

◆ in6addr_alln_mc

const struct in6_addr in6addr_alln_mc
extern

Definition at line 67 of file ip6_out.c.

◆ in6addr_allr_mc

const struct in6_addr in6addr_allr_mc
extern

Definition at line 70 of file ip6_out.c.

◆ in6addr_mapped

const BYTE in6addr_mapped[12]
extern

Definition at line 73 of file ip6_out.c.

◆ in6addr_my_ip

W32_DATA struct in6_addr in6addr_my_ip

Definition at line 12 of file ip6_out.h.


Watt-32 tcp/ip: E:/WATT/src/ip_info.c Source File

  • src
ip_info.c
1/*
2 * This file is NOT part of Watt-32. It is just a test-program
3 * used during coding of winadinf.c.
4 *
5 * Building with:
6 * MinGW:
7 * gcc -Wall ip_info.c -o ip_info.exe -lws2_32 -liphlpapi
8 *
9 * MSVC:
10 * cl -nologo -W3 ip_info.c -Feip_info.exe ws2_32.lib iphlpapi.lib
11 *
12 * OpenWatcom:
13 * wcl386 -q -w3 -bt=nt ip_info.c ws2_32.lib iphlpapi.lib
14 */
15
16#define WIN32_LEAN_AND_MEAN
17
18#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0501)
19 #undef _WIN32_WINNT
20 #define _WIN32_WINNT 0x0501
21#endif
22
23#include <stdio.h>
24#include <malloc.h>
25#include <windows.h>
26#include <winsock2.h>
27#include <iptypes.h>
28#include <iphlpapi.h>
29
30#ifndef GAA_FLAG_INCLUDE_ALL_INTERFACES
31#define GAA_FLAG_INCLUDE_ALL_INTERFACES 0x0100L
32#endif
33
34/*
35 * Convert a wide-char string to UTF-8.
36 */
37static const char *utf8_str (const wchar_t *str)
38{
39 static char buf[100];
40 DWORD len = WideCharToMultiByte (CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL);
41
42 if (len == 0)
43 _snprintf (buf, sizeof(buf), "WideCharToMultiByte() failed: %ld", GetLastError());
44 return (buf);
45}
46
47void print_GetAdaptersAddresses (void)
48{
49 DWORD rc = 0;
50 ULONG family = AF_UNSPEC;
51 ULONG flags = GAA_FLAG_INCLUDE_ALL_INTERFACES;
52 ULONG outBufLen = 0;
53 IP_ADAPTER_ADDRESSES *addr;
54
55 printf ("Information from GetAdaptersAddresses():\n");
56
57 rc = GetAdaptersAddresses (family, flags, NULL, NULL, &outBufLen);
58 if (rc != ERROR_BUFFER_OVERFLOW)
59 return;
60
61 addr = alloca (outBufLen);
62 rc = GetAdaptersAddresses (family, flags, NULL, addr, &outBufLen);
63 if (rc != NO_ERROR)
64 {
65 printf ("\t\tError: %lu\n",rc);
66 return;
67 }
68
69 while (addr)
70 {
71 printf ("\tAdapter name: %s\n", addr->AdapterName);
72 printf ("\t Description: %s\n", utf8_str(addr->Description));
73 printf ("\t Friendly name: %s\n", utf8_str(addr->FriendlyName));
74 addr = addr->Next;
75 }
76}
77
78int main(void)
79{
80 print_GetAdaptersAddresses();
81 return (0);
82}


Watt-32 tcp/ip: E:/WATT/src/lang.c Source File

  • src
lang.c
1
2#line 2 "<stdout>"
3
4#define YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
8#define yy_create_buffer _w32__create_buffer
9#define yy_delete_buffer _w32__delete_buffer
10#define yy_scan_buffer _w32__scan_buffer
11#define yy_scan_string _w32__scan_string
12#define yy_scan_bytes _w32__scan_bytes
13#define yy_init_buffer _w32__init_buffer
14#define yy_flush_buffer _w32__flush_buffer
15#define yy_load_buffer_state _w32__load_buffer_state
16#define yy_switch_to_buffer _w32__switch_to_buffer
17#define yypush_buffer_state _w32_push_buffer_state
18#define yypop_buffer_state _w32_pop_buffer_state
19#define yyensure_buffer_stack _w32_ensure_buffer_stack
20#define yy_flex_debug _w32__flex_debug
21#define yyin _w32_in
22#define yyleng _w32_leng
23#define yylex _w32_lex
24#define yylineno _w32_lineno
25#define yyout _w32_out
26#define yyrestart _w32_restart
27#define yytext _w32_text
28#define yywrap _w32_wrap
29#define yyalloc _w32_alloc
30#define yyrealloc _w32_realloc
31#define yyfree _w32_free
32
33#define FLEX_SCANNER
34#define YY_FLEX_MAJOR_VERSION 2
35#define YY_FLEX_MINOR_VERSION 6
36#define YY_FLEX_SUBMINOR_VERSION 4
37#if YY_FLEX_SUBMINOR_VERSION > 0
38#define FLEX_BETA
39#endif
40
41#ifdef yy_create_buffer
42#define _w32__create_buffer_ALREADY_DEFINED
43#else
44#define yy_create_buffer _w32__create_buffer
45#endif
46
47#ifdef yy_delete_buffer
48#define _w32__delete_buffer_ALREADY_DEFINED
49#else
50#define yy_delete_buffer _w32__delete_buffer
51#endif
52
53#ifdef yy_scan_buffer
54#define _w32__scan_buffer_ALREADY_DEFINED
55#else
56#define yy_scan_buffer _w32__scan_buffer
57#endif
58
59#ifdef yy_scan_string
60#define _w32__scan_string_ALREADY_DEFINED
61#else
62#define yy_scan_string _w32__scan_string
63#endif
64
65#ifdef yy_scan_bytes
66#define _w32__scan_bytes_ALREADY_DEFINED
67#else
68#define yy_scan_bytes _w32__scan_bytes
69#endif
70
71#ifdef yy_init_buffer
72#define _w32__init_buffer_ALREADY_DEFINED
73#else
74#define yy_init_buffer _w32__init_buffer
75#endif
76
77#ifdef yy_flush_buffer
78#define _w32__flush_buffer_ALREADY_DEFINED
79#else
80#define yy_flush_buffer _w32__flush_buffer
81#endif
82
83#ifdef yy_load_buffer_state
84#define _w32__load_buffer_state_ALREADY_DEFINED
85#else
86#define yy_load_buffer_state _w32__load_buffer_state
87#endif
88
89#ifdef yy_switch_to_buffer
90#define _w32__switch_to_buffer_ALREADY_DEFINED
91#else
92#define yy_switch_to_buffer _w32__switch_to_buffer
93#endif
94
95#ifdef yypush_buffer_state
96#define _w32_push_buffer_state_ALREADY_DEFINED
97#else
98#define yypush_buffer_state _w32_push_buffer_state
99#endif
100
101#ifdef yypop_buffer_state
102#define _w32_pop_buffer_state_ALREADY_DEFINED
103#else
104#define yypop_buffer_state _w32_pop_buffer_state
105#endif
106
107#ifdef yyensure_buffer_stack
108#define _w32_ensure_buffer_stack_ALREADY_DEFINED
109#else
110#define yyensure_buffer_stack _w32_ensure_buffer_stack
111#endif
112
113#ifdef yylex
114#define _w32_lex_ALREADY_DEFINED
115#else
116#define yylex _w32_lex
117#endif
118
119#ifdef yyrestart
120#define _w32_restart_ALREADY_DEFINED
121#else
122#define yyrestart _w32_restart
123#endif
124
125#ifdef yylex_init
126#define _w32_lex_init_ALREADY_DEFINED
127#else
128#define yylex_init _w32_lex_init
129#endif
130
131#ifdef yylex_init_extra
132#define _w32_lex_init_extra_ALREADY_DEFINED
133#else
134#define yylex_init_extra _w32_lex_init_extra
135#endif
136
137#ifdef yylex_destroy
138#define _w32_lex_destroy_ALREADY_DEFINED
139#else
140#define yylex_destroy _w32_lex_destroy
141#endif
142
143#ifdef yyget_debug
144#define _w32_get_debug_ALREADY_DEFINED
145#else
146#define yyget_debug _w32_get_debug
147#endif
148
149#ifdef yyset_debug
150#define _w32_set_debug_ALREADY_DEFINED
151#else
152#define yyset_debug _w32_set_debug
153#endif
154
155#ifdef yyget_extra
156#define _w32_get_extra_ALREADY_DEFINED
157#else
158#define yyget_extra _w32_get_extra
159#endif
160
161#ifdef yyset_extra
162#define _w32_set_extra_ALREADY_DEFINED
163#else
164#define yyset_extra _w32_set_extra
165#endif
166
167#ifdef yyget_in
168#define _w32_get_in_ALREADY_DEFINED
169#else
170#define yyget_in _w32_get_in
171#endif
172
173#ifdef yyset_in
174#define _w32_set_in_ALREADY_DEFINED
175#else
176#define yyset_in _w32_set_in
177#endif
178
179#ifdef yyget_out
180#define _w32_get_out_ALREADY_DEFINED
181#else
182#define yyget_out _w32_get_out
183#endif
184
185#ifdef yyset_out
186#define _w32_set_out_ALREADY_DEFINED
187#else
188#define yyset_out _w32_set_out
189#endif
190
191#ifdef yyget_leng
192#define _w32_get_leng_ALREADY_DEFINED
193#else
194#define yyget_leng _w32_get_leng
195#endif
196
197#ifdef yyget_text
198#define _w32_get_text_ALREADY_DEFINED
199#else
200#define yyget_text _w32_get_text
201#endif
202
203#ifdef yyget_lineno
204#define _w32_get_lineno_ALREADY_DEFINED
205#else
206#define yyget_lineno _w32_get_lineno
207#endif
208
209#ifdef yyset_lineno
210#define _w32_set_lineno_ALREADY_DEFINED
211#else
212#define yyset_lineno _w32_set_lineno
213#endif
214
215#ifdef yywrap
216#define _w32_wrap_ALREADY_DEFINED
217#else
218#define yywrap _w32_wrap
219#endif
220
221#ifdef yyalloc
222#define _w32_alloc_ALREADY_DEFINED
223#else
224#define yyalloc _w32_alloc
225#endif
226
227#ifdef yyrealloc
228#define _w32_realloc_ALREADY_DEFINED
229#else
230#define yyrealloc _w32_realloc
231#endif
232
233#ifdef yyfree
234#define _w32_free_ALREADY_DEFINED
235#else
236#define yyfree _w32_free
237#endif
238
239#ifdef yytext
240#define _w32_text_ALREADY_DEFINED
241#else
242#define yytext _w32_text
243#endif
244
245#ifdef yyleng
246#define _w32_leng_ALREADY_DEFINED
247#else
248#define yyleng _w32_leng
249#endif
250
251#ifdef yyin
252#define _w32_in_ALREADY_DEFINED
253#else
254#define yyin _w32_in
255#endif
256
257#ifdef yyout
258#define _w32_out_ALREADY_DEFINED
259#else
260#define yyout _w32_out
261#endif
262
263#ifdef yy_flex_debug
264#define _w32__flex_debug_ALREADY_DEFINED
265#else
266#define yy_flex_debug _w32__flex_debug
267#endif
268
269#ifdef yylineno
270#define _w32_lineno_ALREADY_DEFINED
271#else
272#define yylineno _w32_lineno
273#endif
274
275/* First, we deal with platform-specific or compiler-specific issues. */
276
277/* begin standard C headers. */
278#include <stdio.h>
279#include <string.h>
280#include <errno.h>
281#include <stdlib.h>
282
283/* end standard C headers. */
284
285/* flex integer type definitions */
286
287#ifndef FLEXINT_H
288#define FLEXINT_H
289
290/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
291
292#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
293
294/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
295 * if you want the limit (max/min) macros for int types.
296 */
297#ifndef __STDC_LIMIT_MACROS
298#define __STDC_LIMIT_MACROS 1
299#endif
300
301#include <inttypes.h>
302typedef int8_t flex_int8_t;
303typedef uint8_t flex_uint8_t;
304typedef int16_t flex_int16_t;
305typedef uint16_t flex_uint16_t;
306typedef int32_t flex_int32_t;
307typedef uint32_t flex_uint32_t;
308#else
309typedef signed char flex_int8_t;
310typedef short int flex_int16_t;
311typedef int flex_int32_t;
312typedef unsigned char flex_uint8_t;
313typedef unsigned short int flex_uint16_t;
314typedef unsigned int flex_uint32_t;
315
316/* Limits of integral types. */
317#ifndef INT8_MIN
318#define INT8_MIN (-128)
319#endif
320#ifndef INT16_MIN
321#define INT16_MIN (-32767-1)
322#endif
323#ifndef INT32_MIN
324#define INT32_MIN (-2147483647-1)
325#endif
326#ifndef INT8_MAX
327#define INT8_MAX (127)
328#endif
329#ifndef INT16_MAX
330#define INT16_MAX (32767)
331#endif
332#ifndef INT32_MAX
333#define INT32_MAX (2147483647)
334#endif
335#ifndef UINT8_MAX
336#define UINT8_MAX (255U)
337#endif
338#ifndef UINT16_MAX
339#define UINT16_MAX (65535U)
340#endif
341#ifndef UINT32_MAX
342#define UINT32_MAX (4294967295U)
343#endif
344
345#ifndef SIZE_MAX
346#define SIZE_MAX (~(size_t)0)
347#endif
348
349#endif /* ! C99 */
350
351#endif /* ! FLEXINT_H */
352
353/* begin standard C++ headers. */
354
355/* TODO: this is always defined, so inline it */
356#define yyconst const
357
358#if defined(__GNUC__) && __GNUC__ >= 3
359#define yynoreturn __attribute__((__noreturn__))
360#else
361#define yynoreturn
362#endif
363
364/* Returned upon end-of-file. */
365#define YY_NULL 0
366
367/* Promotes a possibly negative, possibly signed char to an
368 * integer in range [0..255] for use as an array index.
369 */
370#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
371
372/* Enter a start condition. This macro really ought to take a parameter,
373 * but we do it the disgusting crufty way forced on us by the ()-less
374 * definition of BEGIN.
375 */
376#define BEGIN (yy_start) = 1 + 2 *
377/* Translate the current start state into a value that can be later handed
378 * to BEGIN to return to the state. The YYSTATE alias is for lex
379 * compatibility.
380 */
381#define YY_START (((yy_start) - 1) / 2)
382#define YYSTATE YY_START
383/* Action number for EOF rule of a given start state. */
384#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
385/* Special action meaning "start processing a new file". */
386#define YY_NEW_FILE yyrestart( yyin )
387#define YY_END_OF_BUFFER_CHAR 0
388
389/* Size of default input buffer. */
390#ifndef YY_BUF_SIZE
391#ifdef __ia64__
392/* On IA-64, the buffer size is 16k, not 8k.
393 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
394 * Ditto for the __ia64__ case accordingly.
395 */
396#define YY_BUF_SIZE 32768
397#else
398#define YY_BUF_SIZE 16384
399#endif /* __ia64__ */
400#endif
401
402/* The state buf must be large enough to hold one state per character in the main buffer.
403 */
404#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
405
406#ifndef YY_TYPEDEF_YY_BUFFER_STATE
407#define YY_TYPEDEF_YY_BUFFER_STATE
408typedef struct yy_buffer_state *YY_BUFFER_STATE;
409#endif
410
411#ifndef YY_TYPEDEF_YY_SIZE_T
412#define YY_TYPEDEF_YY_SIZE_T
413typedef size_t yy_size_t;
414#endif
415
416extern int yyleng;
417
418extern FILE *yyin, *yyout;
419
420#define EOB_ACT_CONTINUE_SCAN 0
421#define EOB_ACT_END_OF_FILE 1
422#define EOB_ACT_LAST_MATCH 2
423
424 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
425 * access to the local variable yy_act. Since yyless() is a macro, it would break
426 * existing scanners that call yyless() from OUTSIDE yylex.
427 * One obvious solution it to make yy_act a global. I tried that, and saw
428 * a 5% performance hit in a non-yylineno scanner, because yy_act is
429 * normally declared as a register variable-- so it is not worth it.
430 */
431 #define YY_LESS_LINENO(n) \
432 do { \
433 int yyl;\
434 for ( yyl = n; yyl < yyleng; ++yyl )\
435 if ( yytext[yyl] == '\n' )\
436 --yylineno;\
437 }while(0)
438 #define YY_LINENO_REWIND_TO(dst) \
439 do {\
440 const char *p;\
441 for ( p = yy_cp-1; p >= (dst); --p)\
442 if ( *p == '\n' )\
443 --yylineno;\
444 }while(0)
445
446/* Return all but the first "n" matched characters back to the input stream. */
447#define yyless(n) \
448 do \
449 { \
450 /* Undo effects of setting up yytext. */ \
451 int yyless_macro_arg = (n); \
452 YY_LESS_LINENO(yyless_macro_arg);\
453 *yy_cp = (yy_hold_char); \
454 YY_RESTORE_YY_MORE_OFFSET \
455 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
456 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
457 } \
458 while ( 0 )
459#define unput(c) yyunput( c, (yytext_ptr) )
460
461#ifndef YY_STRUCT_YY_BUFFER_STATE
462#define YY_STRUCT_YY_BUFFER_STATE
463struct yy_buffer_state
464 {
465 FILE *yy_input_file;
466
467 char *yy_ch_buf; /* input buffer */
468 char *yy_buf_pos; /* current position in input buffer */
469
470 /* Size of input buffer in bytes, not including room for EOB
471 * characters.
472 */
473 int yy_buf_size;
474
475 /* Number of characters read into yy_ch_buf, not including EOB
476 * characters.
477 */
478 int yy_n_chars;
479
480 /* Whether we "own" the buffer - i.e., we know we created it,
481 * and can realloc() it to grow it, and should free() it to
482 * delete it.
483 */
484 int yy_is_our_buffer;
485
486 /* Whether this is an "interactive" input source; if so, and
487 * if we're using stdio for input, then we want to use getc()
488 * instead of fread(), to make sure we stop fetching input after
489 * each newline.
490 */
491 int yy_is_interactive;
492
493 /* Whether we're considered to be at the beginning of a line.
494 * If so, '^' rules will be active on the next match, otherwise
495 * not.
496 */
497 int yy_at_bol;
498
499 int yy_bs_lineno;
500 int yy_bs_column;
502 /* Whether to try to fill the input buffer when we reach the
503 * end of it.
504 */
505 int yy_fill_buffer;
506
507 int yy_buffer_status;
508
509#define YY_BUFFER_NEW 0
510#define YY_BUFFER_NORMAL 1
511 /* When an EOF's been seen but there's still some text to process
512 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
513 * shouldn't try reading from the input source any more. We might
514 * still have a bunch of tokens to match, though, because of
515 * possible backing-up.
516 *
517 * When we actually see the EOF, we change the status to "new"
518 * (via yyrestart()), so that the user can continue scanning by
519 * just pointing yyin at a new input file.
520 */
521#define YY_BUFFER_EOF_PENDING 2
522
523 };
524#endif /* !YY_STRUCT_YY_BUFFER_STATE */
525
526/* Stack of input buffers. */
527static size_t yy_buffer_stack_top = 0;
528static size_t yy_buffer_stack_max = 0;
529static YY_BUFFER_STATE * yy_buffer_stack = NULL;
531/* We provide macros for accessing buffer states in case in the
532 * future we want to put the buffer states in a more general
533 * "scanner state".
534 *
535 * Returns the top of the stack, or NULL.
536 */
537#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
538 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
539 : NULL)
540/* Same as previous macro, but useful when we know that the buffer stack is not
541 * NULL or when we need an lvalue. For internal use only.
542 */
543#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
544
545/* yy_hold_char holds the character lost when yytext is formed. */
546static char yy_hold_char;
547static int yy_n_chars; /* number of characters read into yy_ch_buf */
548int yyleng;
549
550/* Points to current character in buffer. */
551static char *yy_c_buf_p = NULL;
552static int yy_init = 0; /* whether we need to initialize */
553static int yy_start = 0; /* start state number */
554
555/* Flag which is used to allow yywrap()'s to do buffer switches
556 * instead of setting up a fresh yyin. A bit of a hack ...
557 */
558static int yy_did_buffer_switch_on_eof;
559
560void yyrestart ( FILE *input_file );
561void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
562 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
563void yy_delete_buffer ( YY_BUFFER_STATE b );
564void yy_flush_buffer ( YY_BUFFER_STATE b );
565void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
566void yypop_buffer_state ( void );
567
568static void yyensure_buffer_stack ( void );
569static void yy_load_buffer_state ( void );
570static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
571#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
572
573 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
574 YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
575 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
576
577void *yyalloc ( yy_size_t );
578void *yyrealloc ( void *, yy_size_t );
579void yyfree ( void * );
580
581#define yy_new_buffer yy_create_buffer
582#define yy_set_interactive(is_interactive) \
583 { \
584 if ( ! YY_CURRENT_BUFFER ){ \
585 yyensure_buffer_stack (); \
586 YY_CURRENT_BUFFER_LVALUE = \
587 yy_create_buffer( yyin, YY_BUF_SIZE ); \
588 } \
589 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
590 }
591#define yy_set_bol(at_bol) \
592 { \
593 if ( ! YY_CURRENT_BUFFER ){\
594 yyensure_buffer_stack (); \
595 YY_CURRENT_BUFFER_LVALUE = \
596 yy_create_buffer( yyin, YY_BUF_SIZE ); \
597 } \
598 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
599 }
600#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
601
602/* Begin user sect3 */
603typedef flex_uint8_t YY_CHAR;
604
605FILE *yyin = NULL, *yyout = NULL;
606
607typedef int yy_state_type;
608
609extern int yylineno;
610int yylineno = 1;
611
612extern char *yytext;
613#ifdef yytext_ptr
614#undef yytext_ptr
615#endif
616#define yytext_ptr yytext
617
618static yy_state_type yy_get_previous_state ( void );
619static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
620static int yy_get_next_buffer ( void );
621static void yynoreturn yy_fatal_error ( const char* msg );
622
623/* Done after the current pattern has been matched and before the
624 * corresponding action - sets up yytext.
625 */
626#define YY_DO_BEFORE_ACTION \
627 (yytext_ptr) = yy_bp; \
628 yyleng = (int) (yy_cp - yy_bp); \
629 (yy_hold_char) = *yy_cp; \
630 *yy_cp = '\0'; \
631 (yy_c_buf_p) = yy_cp;
632#define YY_NUM_RULES 29
633#define YY_END_OF_BUFFER 30
634/* This struct is not used in this scanner,
635 but its presence is necessary. */
636struct yy_trans_info
637 {
638 flex_int32_t yy_verify;
639 flex_int32_t yy_nxt;
640 };
641static const flex_int16_t yy_accept[69] =
642 { 0,
643 0, 0, 0, 0, 0, 0, 0, 0, 30, 5,
644 1, 3, 5, 4, 5, 21, 20, 21, 6, 21,
645 24, 23, 24, 24, 28, 27, 28, 28, 28, 28,
646 28, 1, 3, 0, 2, 0, 20, 19, 15, 18,
647 18, 7, 8, 11, 10, 13, 12, 9, 19, 14,
648 23, 22, 27, 0, 26, 0, 0, 0, 0, 17,
649 18, 16, 25, 17, 18, 16, 17, 0
650 } ;
651
652static const YY_CHAR yy_ec[256] =
653 { 0,
654 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
655 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
656 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
657 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
658 1, 1, 1, 1, 1, 1, 1, 7, 8, 8,
659 8, 8, 8, 8, 8, 9, 9, 10, 6, 1,
660 1, 1, 1, 1, 11, 12, 13, 14, 15, 16,
661 1, 1, 1, 1, 1, 1, 1, 17, 18, 1,
662 1, 19, 20, 21, 1, 22, 1, 23, 1, 1,
663 1, 24, 1, 1, 1, 1, 25, 26, 13, 27,
664
665 28, 29, 1, 1, 1, 1, 1, 1, 1, 30,
666 31, 1, 1, 32, 33, 34, 1, 35, 1, 36,
667 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
668 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
669 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
670 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
671 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
672 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
673 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
674 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
675
676 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
677 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
678 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
679 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
680 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
681 1, 1, 1, 1, 1
682 } ;
683
684static const YY_CHAR yy_meta[37] =
685 { 0,
686 1, 1, 1, 1, 1, 1, 2, 2, 2, 1,
687 2, 2, 2, 2, 2, 2, 1, 1, 1, 1,
688 1, 1, 1, 1, 2, 2, 2, 2, 2, 1,
689 1, 1, 1, 1, 1, 1
690 } ;
691
692static const flex_int16_t yy_base[77] =
693 { 0,
694 0, 5, 9, 12, 15, 17, 39, 70, 82, 152,
695 79, 152, 77, 152, 19, 152, 152, 72, 152, 103,
696 152, 152, 68, 46, 152, 152, 65, 21, 12, 13,
697 12, 65, 152, 25, 152, 34, 152, 152, 152, 41,
698 53, 152, 152, 152, 152, 152, 152, 152, 0, 152,
699 152, 152, 152, 48, 152, 51, 36, 25, 22, 56,
700 70, 0, 152, 50, 152, 152, 152, 152, 139, 141,
701 143, 145, 147, 149, 28, 24
702 } ;
703
704static const flex_int16_t yy_def[77] =
705 { 0,
706 69, 69, 70, 70, 71, 71, 72, 72, 68, 68,
707 68, 68, 68, 68, 73, 68, 68, 68, 68, 68,
708 68, 68, 68, 68, 68, 68, 68, 74, 68, 68,
709 68, 68, 68, 73, 68, 73, 68, 68, 68, 68,
710 68, 68, 68, 68, 68, 68, 68, 68, 75, 68,
711 68, 68, 68, 74, 68, 74, 68, 68, 68, 68,
712 68, 76, 68, 68, 68, 68, 68, 0, 68, 68,
713 68, 68, 68, 68, 68, 68
714 } ;
715
716static const flex_int16_t yy_nxt[189] =
717 { 0,
718 68, 11, 12, 13, 14, 15, 11, 12, 13, 14,
719 15, 17, 18, 19, 17, 18, 19, 22, 23, 22,
720 23, 35, 36, 55, 56, 66, 57, 35, 36, 62,
721 58, 63, 20, 59, 63, 20, 35, 36, 24, 57,
722 24, 26, 27, 58, 28, 63, 59, 60, 60, 61,
723 55, 56, 29, 55, 56, 30, 67, 67, 31, 61,
724 61, 61, 64, 64, 65, 29, 32, 53, 30, 52,
725 51, 31, 26, 27, 37, 28, 65, 65, 65, 33,
726 32, 68, 68, 29, 68, 68, 30, 68, 68, 31,
727 68, 68, 68, 68, 68, 68, 29, 68, 68, 30,
728
729 68, 68, 31, 38, 38, 68, 38, 39, 38, 40,
730 41, 41, 38, 42, 43, 38, 38, 44, 45, 46,
731 38, 47, 38, 48, 38, 49, 50, 42, 43, 38,
732 44, 45, 46, 38, 47, 38, 48, 38, 49, 10,
733 10, 16, 16, 21, 21, 25, 25, 34, 34, 54,
734 54, 9, 68, 68, 68, 68, 68, 68, 68, 68,
735 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
736 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
737 68, 68, 68, 68, 68, 68, 68, 68
738 } ;
739
740static const flex_int16_t yy_chk[189] =
741 { 0,
742 0, 1, 1, 1, 1, 1, 2, 2, 2, 2,
743 2, 3, 3, 3, 4, 4, 4, 5, 5, 6,
744 6, 15, 15, 28, 28, 76, 29, 34, 34, 75,
745 30, 59, 3, 31, 58, 4, 36, 36, 5, 29,
746 6, 7, 7, 30, 7, 57, 31, 40, 40, 40,
747 54, 54, 7, 56, 56, 7, 64, 64, 7, 41,
748 41, 41, 60, 60, 60, 7, 32, 27, 7, 24,
749 23, 7, 8, 8, 18, 8, 61, 61, 61, 13,
750 11, 9, 0, 8, 0, 0, 8, 0, 0, 8,
751 0, 0, 0, 0, 0, 0, 8, 0, 0, 8,
752
753 0, 0, 8, 20, 20, 0, 20, 20, 20, 20,
754 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
755 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
756 20, 20, 20, 20, 20, 20, 20, 20, 20, 69,
757 69, 70, 70, 71, 71, 72, 72, 73, 73, 74,
758 74, 68, 68, 68, 68, 68, 68, 68, 68, 68,
759 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
760 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
761 68, 68, 68, 68, 68, 68, 68, 68
762 } ;
763
764/* Table of booleans, true if rule could match eol. */
765static const flex_int32_t yy_rule_can_match_eol[30] =
766 { 0,
7670, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
768 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, };
769
770static yy_state_type yy_last_accepting_state;
771static char *yy_last_accepting_cpos;
772
773extern int yy_flex_debug;
774int yy_flex_debug = 0;
775
776/* The intent behind this definition is that it'll catch
777 * any uses of REJECT which flex missed.
778 */
779#define REJECT reject_used_but_not_detected
780#define yymore() yymore_used_but_not_detected
781#define YY_MORE_ADJ 0
782#define YY_RESTORE_YY_MORE_OFFSET
783char *yytext;
784#line 1 "lang.l"
794#line 12 "lang.l"
795
796#if !defined(WATT32_COMPILE_LANG_C)
797#error lang.c MUST be included inside language.c.
798#endif
799
800#if !defined(_w32_MISC_H)
801#error Include misc.h prior to this.
802#endif
803
804#if defined(USE_LANGUAGE) /* Rest of file */
805
806#if defined(TEST_PROG)
807 #ifndef __CYGWIN__
808 #include <conio.h>
809 #endif
810 #define INCLINE() fprintf (stderr, " <line %u>\n", lang.line++)
811 #define DEBUG(fmt,arg) fprintf (stderr, fmt, arg)
812#else
813 #define INCLINE() lang.line++
814 #define DEBUG(fmt,arg) ((void)0)
815#endif
816
817#define BUF_SIZE 500
818
819static int yylex (void);
820static void AddChar (int ch);
821static void AddDecimal (const char *buf);
822static void AddHexcode (const char *buf);
823static void AddOctal (const char *buf);
824static void AddEntry (void);
825static void Fatal (const char *s1, const char *s2);
826static void Error (const char *err);
827
828static char buf [BUF_SIZE];
829static char *ptr = NULL;
830static char *end = buf+BUF_SIZE-1;
831static int line_cont = 0;
832static BOOL do_ref = TRUE; /* We're parsing the English reference string */
833static DWORD crc_ref = 0; /* The CRC-32 of the English reference string */
834static jmp_buf bail_out; /* The jmp_buf for getting out of here quickly */
835
836struct Node {
837 DWORD crc;
838 const char *string;
839 struct Node *next;
840 };
841
842struct Elem {
843 DWORD crc;
844 const char *string;
845 };
846
847static struct Language {
848 struct Node *list;
849 struct Elem *array;
850 char prefix[4]; /* "en:" etc. */
851 size_t entries;
852 unsigned line;
853 } lang = {
854 NULL, NULL, "en", 0L, 0L
855 };
856
857/*---------------------------------------------------------------------*/
858
859#if (W32_GCC_VERSION >= 43000)
860 /*
861 * Suppress warning
862 * lang.l:234:1: warning: label 'find_rule' defined but not used [-Wunused-label]
863 */
864 #pragma GCC diagnostic ignored "-Wunused-label"
865
866 W32_GCC_PRAGMA (GCC diagnostic push)
867 W32_GCC_PRAGMA (GCC diagnostic ignored "-Wunused-function")
868
869#elif defined(__clang__)
870 #pragma clang diagnostic ignored "-Wshadow"
871
872#elif defined(__WATCOMC__)
873 /*
874 * Warning! W202: Symbol 'yy_fatal_error' has been defined, but not referenced.
875 * Warning! W136: Comparison equivalent to 'unsigned == 0'
876 */
877 #pragma disable_message (202)
878 #pragma disable_message (136)
879#endif
880
881#line 881 "<stdout>"
964#line 964 "<stdout>"
965
966#define INITIAL 0
967#define STRING 1
968#define EO_LINE 2
969#define PREFIX 3
970
971#ifndef YY_NO_UNISTD_H
972/* Special case for "unistd.h", since it is non-ANSI. We include it way
973 * down here because we want the user's section 1 to have been scanned first.
974 * The user has a chance to override it with an option.
975 */
976#include <unistd.h>
977#endif
978
979#ifndef YY_EXTRA_TYPE
980#define YY_EXTRA_TYPE void *
981#endif
982
983static int yy_init_globals ( void );
984
985/* Accessor methods to globals.
986 These are made visible to non-reentrant scanners for convenience. */
987
988int yylex_destroy ( void );
989
990int yyget_debug ( void );
991
992void yyset_debug ( int debug_flag );
993
994YY_EXTRA_TYPE yyget_extra ( void );
995
996void yyset_extra ( YY_EXTRA_TYPE user_defined );
997
998FILE *yyget_in ( void );
999
1000void yyset_in ( FILE * _in_str );
1001
1002FILE *yyget_out ( void );
1003
1004void yyset_out ( FILE * _out_str );
1005
1006 int yyget_leng ( void );
1007
1008char *yyget_text ( void );
1009
1010int yyget_lineno ( void );
1011
1012void yyset_lineno ( int _line_number );
1013
1014/* Macros after this point can all be overridden by user definitions in
1015 * section 1.
1016 */
1017
1018#ifndef YY_SKIP_YYWRAP
1019#ifdef __cplusplus
1020extern "C" int yywrap ( void );
1021#else
1022extern int yywrap ( void );
1023#endif
1024#endif
1025
1026#ifndef YY_NO_UNPUT
1027
1028 static void yyunput ( int c, char *buf_ptr );
1029
1030#endif
1031
1032#ifndef yytext_ptr
1033static void yy_flex_strncpy ( char *, const char *, int );
1034#endif
1035
1036#ifdef YY_NEED_STRLEN
1037static int yy_flex_strlen ( const char * );
1038#endif
1039
1040#ifndef YY_NO_INPUT
1041#ifdef __cplusplus
1042static int yyinput ( void );
1043#else
1044static int input ( void );
1045#endif
1046
1047#endif
1048
1049/* Amount of stuff to slurp up with each read. */
1050#ifndef YY_READ_BUF_SIZE
1051#ifdef __ia64__
1052/* On IA-64, the buffer size is 16k, not 8k */
1053#define YY_READ_BUF_SIZE 16384
1054#else
1055#define YY_READ_BUF_SIZE 8192
1056#endif /* __ia64__ */
1057#endif
1058
1059/* Copy whatever the last rule matched to the standard output. */
1060#ifndef ECHO
1061/* This used to be an fputs(), but since the string might contain NUL's,
1062 * we now use fwrite().
1063 */
1064#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1065#endif
1066
1067/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1068 * is returned in "result".
1069 */
1070#ifndef YY_INPUT
1071#define YY_INPUT(buf,result,max_size) \
1072 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1073 { \
1074 int c = '*'; \
1075 int n; \
1076 for ( n = 0; n < max_size && \
1077 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1078 buf[n] = (char) c; \
1079 if ( c == '\n' ) \
1080 buf[n++] = (char) c; \
1081 if ( c == EOF && ferror( yyin ) ) \
1082 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1083 result = n; \
1084 } \
1085 else \
1086 { \
1087 errno=0; \
1088 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1089 { \
1090 if( errno != EINTR) \
1091 { \
1092 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1093 break; \
1094 } \
1095 errno=0; \
1096 clearerr(yyin); \
1097 } \
1098 }\
1099\
1100
1101#endif
1102
1103/* No semi-colon after return; correct usage is to write "yyterminate();" -
1104 * we don't want an extra ';' after the "return" because that will cause
1105 * some compilers to complain about unreachable statements.
1106 */
1107#ifndef yyterminate
1108#define yyterminate() return YY_NULL
1109#endif
1110
1111/* Number of entries by which start-condition stack grows. */
1112#ifndef YY_START_STACK_INCR
1113#define YY_START_STACK_INCR 25
1114#endif
1115
1116/* Report a fatal error. */
1117#ifndef YY_FATAL_ERROR
1118#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1119#endif
1120
1121/* end tables serialization structures and prototypes */
1122
1123/* Default declaration of generated scanner - a define so the user can
1124 * easily add parameters.
1125 */
1126#ifndef YY_DECL
1127#define YY_DECL_IS_OURS 1
1128
1129extern int yylex (void);
1130
1131#define YY_DECL int yylex (void)
1132#endif /* !YY_DECL */
1133
1134/* Code executed at the beginning of each rule, after yytext and yyleng
1135 * have been set up.
1136 */
1137#ifndef YY_USER_ACTION
1138#define YY_USER_ACTION
1139#endif
1140
1141/* Code executed at the end of each rule. */
1142#ifndef YY_BREAK
1143#define YY_BREAK /*LINTED*/break;
1144#endif
1145
1146#define YY_RULE_SETUP \
1147 YY_USER_ACTION
1148
1151YY_DECL
1152{
1153 yy_state_type yy_current_state;
1154 char *yy_cp, *yy_bp;
1155 int yy_act;
1156
1157 if ( !(yy_init) )
1158 {
1159 (yy_init) = 1;
1160
1161#ifdef YY_USER_INIT
1162 YY_USER_INIT;
1163#endif
1164
1165 if ( ! (yy_start) )
1166 (yy_start) = 1; /* first start state */
1167
1168 if ( ! yyin )
1169 yyin = stdin;
1170
1171 if ( ! yyout )
1172 yyout = stdout;
1173
1174 if ( ! YY_CURRENT_BUFFER ) {
1175 yyensure_buffer_stack ();
1176 YY_CURRENT_BUFFER_LVALUE =
1177 yy_create_buffer( yyin, YY_BUF_SIZE );
1178 }
1179
1180 yy_load_buffer_state( );
1181 }
1182
1183 {
1184#line 197 "lang.l"
1185
1186
1187#line 1187 "<stdout>"
1188
1189 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1190 {
1191 yy_cp = (yy_c_buf_p);
1192
1193 /* Support of yytext. */
1194 *yy_cp = (yy_hold_char);
1195
1196 /* yy_bp points to the position in yy_ch_buf of the start of
1197 * the current run.
1198 */
1199 yy_bp = yy_cp;
1200
1201 yy_current_state = (yy_start);
1202yy_match:
1203 do
1204 {
1205 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1206 if ( yy_accept[yy_current_state] )
1207 {
1208 (yy_last_accepting_state) = yy_current_state;
1209 (yy_last_accepting_cpos) = yy_cp;
1210 }
1211 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1212 {
1213 yy_current_state = (int) yy_def[yy_current_state];
1214 if ( yy_current_state >= 69 )
1215 yy_c = yy_meta[yy_c];
1216 }
1217 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1218 ++yy_cp;
1219 }
1220 while ( yy_current_state != 68 );
1221 yy_cp = (yy_last_accepting_cpos);
1222 yy_current_state = (yy_last_accepting_state);
1223
1224yy_find_action:
1225 yy_act = yy_accept[yy_current_state];
1226
1227 YY_DO_BEFORE_ACTION;
1228
1229 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1230 {
1231 int yyl;
1232 for ( yyl = 0; yyl < yyleng; ++yyl )
1233 if ( yytext[yyl] == '\n' )
1234
1235 yylineno++;
1236;
1237 }
1238
1239do_action: /* This label is used only to access EOF actions. */
1240
1241 switch ( yy_act )
1242 { /* beginning of action switch */
1243 case 0: /* must back up */
1244 /* undo the effects of YY_DO_BEFORE_ACTION */
1245 *yy_cp = (yy_hold_char);
1246 yy_cp = (yy_last_accepting_cpos);
1247 yy_current_state = (yy_last_accepting_state);
1248 goto yy_find_action;
1249
1250/* get reference string */
1251case 1:
1252YY_RULE_SETUP
1253#line 200 "lang.l"
1254/* discard */
1255 YY_BREAK
1256case 2:
1257/* rule 2 can match eol */
1258YY_RULE_SETUP
1259#line 201 "lang.l"
1260INCLINE();
1261 YY_BREAK
1262case 3:
1263/* rule 3 can match eol */
1264YY_RULE_SETUP
1265#line 202 "lang.l"
1266INCLINE();
1267 YY_BREAK
1268case 4:
1269YY_RULE_SETUP
1270#line 203 "lang.l"
1271{
1272 if (!line_cont)
1273 ptr = buf;
1274 BEGIN (STRING);
1275 }
1276 YY_BREAK
1277case 5:
1278YY_RULE_SETUP
1279#line 208 "lang.l"
1280{
1281 unput (yytext[0]);
1282 BEGIN (PREFIX);
1283 }
1284 YY_BREAK
1285
1286
1287case 6:
1288YY_RULE_SETUP
1289#line 215 "lang.l"
1290line_cont = 0; BEGIN (EO_LINE);
1291 YY_BREAK
1292case 7:
1293YY_RULE_SETUP
1294#line 216 "lang.l"
1295AddChar ('\7');
1296 YY_BREAK
1297case 8:
1298YY_RULE_SETUP
1299#line 217 "lang.l"
1300AddChar ('\b');
1301 YY_BREAK
1302case 9:
1303YY_RULE_SETUP
1304#line 218 "lang.l"
1305AddChar ('\t');
1306 YY_BREAK
1307case 10:
1308YY_RULE_SETUP
1309#line 219 "lang.l"
1310AddChar ('\f');
1311 YY_BREAK
1312case 11:
1313YY_RULE_SETUP
1314#line 220 "lang.l"
1315AddChar (27);
1316 YY_BREAK
1317case 12:
1318YY_RULE_SETUP
1319#line 221 "lang.l"
1320AddChar ('\r');
1321 YY_BREAK
1322case 13:
1323YY_RULE_SETUP
1324#line 222 "lang.l"
1325AddChar ('\n');
1326 YY_BREAK
1327case 14:
1328YY_RULE_SETUP
1329#line 223 "lang.l"
1330AddChar ('\\');
1331 YY_BREAK
1332case 15:
1333YY_RULE_SETUP
1334#line 224 "lang.l"
1335AddChar ('\"');
1336 YY_BREAK
1337case 16:
1338YY_RULE_SETUP
1339#line 225 "lang.l"
1340AddHexcode (yytext+2);
1341 YY_BREAK
1342case 17:
1343YY_RULE_SETUP
1344#line 226 "lang.l"
1345AddOctal (yytext+1);
1346 YY_BREAK
1347case 18:
1348YY_RULE_SETUP
1349#line 227 "lang.l"
1350AddDecimal (yytext+1);
1351 YY_BREAK
1352case 19:
1353YY_RULE_SETUP
1354#line 228 "lang.l"
1355Fatal ("Unknown ESC code: ", yytext);
1356 YY_BREAK
1357case 20:
1358/* rule 20 can match eol */
1359YY_RULE_SETUP
1360#line 229 "lang.l"
1361Fatal ("Unterminated line", NULL);
1362 YY_BREAK
1363case 21:
1364YY_RULE_SETUP
1365#line 230 "lang.l"
1366AddChar (yytext[0]);
1367 YY_BREAK
1368case YY_STATE_EOF(STRING):
1369#line 231 "lang.l"
1370Fatal ("Unexpected end-of-file", NULL);
1371 YY_BREAK
1372
1373
1374case 22:
1375YY_RULE_SETUP
1376#line 235 "lang.l"
1377{
1378 line_cont = 1;
1379 BEGIN (INITIAL);
1380 }
1381 YY_BREAK
1382case 23:
1383/* rule 23 can match eol */
1384YY_RULE_SETUP
1385#line 239 "lang.l"
1386{
1387 *ptr = '\0';
1388 ptr = NULL;
1389 if (do_ref)
1390 crc_ref = crc_bytes (buf, strlen(buf));
1391 else AddEntry();
1392 INCLINE();
1393 BEGIN (INITIAL);
1394 }
1395 YY_BREAK
1396case 24:
1397YY_RULE_SETUP
1398#line 248 "lang.l"
1399/* discard */
1400 YY_BREAK
1401case YY_STATE_EOF(EO_LINE):
1402#line 249 "lang.l"
1403Fatal ("Unexpected end-of-string", NULL);
1404 YY_BREAK
1405
1406
1407case 25:
1408YY_RULE_SETUP
1409#line 253 "lang.l"
1410{
1411 DEBUG ("lang `%s',\n", yytext);
1412 if (!strncmp(yytext,lang.prefix,3))
1413 {
1414 ptr = buf;
1415 do_ref = FALSE;
1416 }
1417 else
1418 {
1419 ptr = NULL;
1420 do_ref = TRUE;
1421 }
1422 BEGIN (INITIAL);
1423 }
1424 YY_BREAK
1425case 26:
1426/* rule 26 can match eol */
1427YY_RULE_SETUP
1428#line 267 "lang.l"
1429INCLINE();
1430 YY_BREAK
1431case 27:
1432/* rule 27 can match eol */
1433YY_RULE_SETUP
1434#line 268 "lang.l"
1435INCLINE();
1436 YY_BREAK
1437case 28:
1438YY_RULE_SETUP
1439#line 269 "lang.l"
1440Fatal ("Unknown language prefix: ", yytext);
1441 YY_BREAK
1442
1443case 29:
1444YY_RULE_SETUP
1445#line 272 "lang.l"
1446ECHO;
1447 YY_BREAK
1448#line 1448 "<stdout>"
1449case YY_STATE_EOF(INITIAL):
1450case YY_STATE_EOF(PREFIX):
1451 yyterminate();
1452
1453 case YY_END_OF_BUFFER:
1454 {
1455 /* Amount of text matched not including the EOB char. */
1456 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1457
1458 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1459 *yy_cp = (yy_hold_char);
1460 YY_RESTORE_YY_MORE_OFFSET
1461
1462 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1463 {
1464 /* We're scanning a new file or input source. It's
1465 * possible that this happened because the user
1466 * just pointed yyin at a new source and called
1467 * yylex(). If so, then we have to assure
1468 * consistency between YY_CURRENT_BUFFER and our
1469 * globals. Here is the right place to do so, because
1470 * this is the first action (other than possibly a
1471 * back-up) that will match for the new input source.
1472 */
1473 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1474 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1475 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1476 }
1477
1478 /* Note that here we test for yy_c_buf_p "<=" to the position
1479 * of the first EOB in the buffer, since yy_c_buf_p will
1480 * already have been incremented past the NUL character
1481 * (since all states make transitions on EOB to the
1482 * end-of-buffer state). Contrast this with the test
1483 * in input().
1484 */
1485 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1486 { /* This was really a NUL. */
1487 yy_state_type yy_next_state;
1488
1489 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1490
1491 yy_current_state = yy_get_previous_state( );
1492
1493 /* Okay, we're now positioned to make the NUL
1494 * transition. We couldn't have
1495 * yy_get_previous_state() go ahead and do it
1496 * for us because it doesn't know how to deal
1497 * with the possibility of jamming (and we don't
1498 * want to build jamming into it because then it
1499 * will run more slowly).
1500 */
1501
1502 yy_next_state = yy_try_NUL_trans( yy_current_state );
1503
1504 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1505
1506 if ( yy_next_state )
1507 {
1508 /* Consume the NUL. */
1509 yy_cp = ++(yy_c_buf_p);
1510 yy_current_state = yy_next_state;
1511 goto yy_match;
1512 }
1513
1514 else
1515 {
1516 yy_cp = (yy_last_accepting_cpos);
1517 yy_current_state = (yy_last_accepting_state);
1518 goto yy_find_action;
1519 }
1520 }
1521
1522 else switch ( yy_get_next_buffer( ) )
1523 {
1524 case EOB_ACT_END_OF_FILE:
1525 {
1526 (yy_did_buffer_switch_on_eof) = 0;
1527
1528 if ( yywrap( ) )
1529 {
1530 /* Note: because we've taken care in
1531 * yy_get_next_buffer() to have set up
1532 * yytext, we can now set up
1533 * yy_c_buf_p so that if some total
1534 * hoser (like flex itself) wants to
1535 * call the scanner after we return the
1536 * YY_NULL, it'll still work - another
1537 * YY_NULL will get returned.
1538 */
1539 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1540
1541 yy_act = YY_STATE_EOF(YY_START);
1542 goto do_action;
1543 }
1544
1545 else
1546 {
1547 if ( ! (yy_did_buffer_switch_on_eof) )
1548 YY_NEW_FILE;
1549 }
1550 break;
1551 }
1552
1553 case EOB_ACT_CONTINUE_SCAN:
1554 (yy_c_buf_p) =
1555 (yytext_ptr) + yy_amount_of_matched_text;
1556
1557 yy_current_state = yy_get_previous_state( );
1558
1559 yy_cp = (yy_c_buf_p);
1560 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1561 goto yy_match;
1562
1563 case EOB_ACT_LAST_MATCH:
1564 (yy_c_buf_p) =
1565 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1566
1567 yy_current_state = yy_get_previous_state( );
1568
1569 yy_cp = (yy_c_buf_p);
1570 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1571 goto yy_find_action;
1572 }
1573 break;
1574 }
1575
1576 default:
1577 YY_FATAL_ERROR(
1578 "fatal flex scanner internal error--no action found" );
1579 } /* end of action switch */
1580 } /* end of scanning one token */
1581 } /* end of user's declarations */
1582} /* end of yylex */
1583
1584/* yy_get_next_buffer - try to read in a new buffer
1585 *
1586 * Returns a code representing an action:
1587 * EOB_ACT_LAST_MATCH -
1588 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1589 * EOB_ACT_END_OF_FILE - end of file
1590 */
1591static int yy_get_next_buffer (void)
1592{
1593 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1594 char *source = (yytext_ptr);
1595 int number_to_move, i;
1596 int ret_val;
1597
1598 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1599 YY_FATAL_ERROR(
1600 "fatal flex scanner internal error--end of buffer missed" );
1601
1602 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1603 { /* Don't try to fill the buffer, so this is an EOF. */
1604 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1605 {
1606 /* We matched a single character, the EOB, so
1607 * treat this as a final EOF.
1608 */
1609 return EOB_ACT_END_OF_FILE;
1610 }
1611
1612 else
1613 {
1614 /* We matched some text prior to the EOB, first
1615 * process it.
1616 */
1617 return EOB_ACT_LAST_MATCH;
1618 }
1619 }
1620
1621 /* Try to read more data. */
1622
1623 /* First move last chars to start of buffer. */
1624 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1625
1626 for ( i = 0; i < number_to_move; ++i )
1627 *(dest++) = *(source++);
1628
1629 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1630 /* don't do the read, it's not guaranteed to return an EOF,
1631 * just force an EOF
1632 */
1633 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1634
1635 else
1636 {
1637 int num_to_read =
1638 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1639
1640 while ( num_to_read <= 0 )
1641 { /* Not enough room in the buffer - grow it. */
1642
1643 /* just a shorter name for the current buffer */
1644 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1645
1646 int yy_c_buf_p_offset =
1647 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1648
1649 if ( b->yy_is_our_buffer )
1650 {
1651 int new_size = b->yy_buf_size * 2;
1652
1653 if ( new_size <= 0 )
1654 b->yy_buf_size += b->yy_buf_size / 8;
1655 else
1656 b->yy_buf_size *= 2;
1657
1658 b->yy_ch_buf = (char *)
1659 /* Include room in for 2 EOB chars. */
1660 yyrealloc( (void *) b->yy_ch_buf,
1661 (yy_size_t) (b->yy_buf_size + 2) );
1662 }
1663 else
1664 /* Can't grow it, we don't own it. */
1665 b->yy_ch_buf = NULL;
1666
1667 if ( ! b->yy_ch_buf )
1668 YY_FATAL_ERROR(
1669 "fatal error - scanner input buffer overflow" );
1670
1671 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1672
1673 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1674 number_to_move - 1;
1675
1676 }
1677
1678 if ( num_to_read > YY_READ_BUF_SIZE )
1679 num_to_read = YY_READ_BUF_SIZE;
1680
1681 /* Read in more data. */
1682 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1683 (yy_n_chars), num_to_read );
1684
1685 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1686 }
1687
1688 if ( (yy_n_chars) == 0 )
1689 {
1690 if ( number_to_move == YY_MORE_ADJ )
1691 {
1692 ret_val = EOB_ACT_END_OF_FILE;
1693 yyrestart( yyin );
1694 }
1695
1696 else
1697 {
1698 ret_val = EOB_ACT_LAST_MATCH;
1699 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1700 YY_BUFFER_EOF_PENDING;
1701 }
1702 }
1703
1704 else
1705 ret_val = EOB_ACT_CONTINUE_SCAN;
1706
1707 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1708 /* Extend the array by 50%, plus the number we really need. */
1709 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1710 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1711 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1712 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1713 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1714 /* "- 2" to take care of EOB's */
1715 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1716 }
1717
1718 (yy_n_chars) += number_to_move;
1719 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1720 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1721
1722 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1723
1724 return ret_val;
1725}
1726
1727/* yy_get_previous_state - get the state just before the EOB char was reached */
1728
1729 static yy_state_type yy_get_previous_state (void)
1730{
1731 yy_state_type yy_current_state;
1732 char *yy_cp;
1733
1734 yy_current_state = (yy_start);
1735
1736 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1737 {
1738 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1739 if ( yy_accept[yy_current_state] )
1740 {
1741 (yy_last_accepting_state) = yy_current_state;
1742 (yy_last_accepting_cpos) = yy_cp;
1743 }
1744 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1745 {
1746 yy_current_state = (int) yy_def[yy_current_state];
1747 if ( yy_current_state >= 69 )
1748 yy_c = yy_meta[yy_c];
1749 }
1750 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1751 }
1752
1753 return yy_current_state;
1754}
1755
1756/* yy_try_NUL_trans - try to make a transition on the NUL character
1757 *
1758 * synopsis
1759 * next_state = yy_try_NUL_trans( current_state );
1760 */
1761 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1762{
1763 int yy_is_jam;
1764 char *yy_cp = (yy_c_buf_p);
1765
1766 YY_CHAR yy_c = 1;
1767 if ( yy_accept[yy_current_state] )
1768 {
1769 (yy_last_accepting_state) = yy_current_state;
1770 (yy_last_accepting_cpos) = yy_cp;
1771 }
1772 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1773 {
1774 yy_current_state = (int) yy_def[yy_current_state];
1775 if ( yy_current_state >= 69 )
1776 yy_c = yy_meta[yy_c];
1777 }
1778 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1779 yy_is_jam = (yy_current_state == 68);
1780
1781 return yy_is_jam ? 0 : yy_current_state;
1782}
1783
1784#ifndef YY_NO_UNPUT
1785
1786 static void yyunput (int c, char * yy_bp )
1787{
1788 char *yy_cp;
1789
1790 yy_cp = (yy_c_buf_p);
1791
1792 /* undo effects of setting up yytext */
1793 *yy_cp = (yy_hold_char);
1794
1795 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1796 { /* need to shift things up to make room */
1797 /* +2 for EOB chars. */
1798 int number_to_move = (yy_n_chars) + 2;
1799 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1800 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1801 char *source =
1802 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1803
1804 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1805 *--dest = *--source;
1806
1807 yy_cp += (int) (dest - source);
1808 yy_bp += (int) (dest - source);
1809 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1810 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1811
1812 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1813 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1814 }
1815
1816 *--yy_cp = (char) c;
1817
1818 if ( c == '\n' ){
1819 --yylineno;
1820 }
1821
1822 (yytext_ptr) = yy_bp;
1823 (yy_hold_char) = *yy_cp;
1824 (yy_c_buf_p) = yy_cp;
1825}
1826
1827#endif
1828
1829#ifndef YY_NO_INPUT
1830#ifdef __cplusplus
1831 static int yyinput (void)
1832#else
1833 static int input (void)
1834#endif
1835
1836{
1837 int c;
1838
1839 *(yy_c_buf_p) = (yy_hold_char);
1840
1841 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1842 {
1843 /* yy_c_buf_p now points to the character we want to return.
1844 * If this occurs *before* the EOB characters, then it's a
1845 * valid NUL; if not, then we've hit the end of the buffer.
1846 */
1847 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1848 /* This was really a NUL. */
1849 *(yy_c_buf_p) = '\0';
1850
1851 else
1852 { /* need more input */
1853 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1854 ++(yy_c_buf_p);
1855
1856 switch ( yy_get_next_buffer( ) )
1857 {
1858 case EOB_ACT_LAST_MATCH:
1859 /* This happens because yy_g_n_b()
1860 * sees that we've accumulated a
1861 * token and flags that we need to
1862 * try matching the token before
1863 * proceeding. But for input(),
1864 * there's no matching to consider.
1865 * So convert the EOB_ACT_LAST_MATCH
1866 * to EOB_ACT_END_OF_FILE.
1867 */
1868
1869 /* Reset buffer status. */
1870 yyrestart( yyin );
1871
1872 /*FALLTHROUGH*/
1873
1874 case EOB_ACT_END_OF_FILE:
1875 {
1876 if ( yywrap( ) )
1877 return 0;
1878
1879 if ( ! (yy_did_buffer_switch_on_eof) )
1880 YY_NEW_FILE;
1881#ifdef __cplusplus
1882 return yyinput();
1883#else
1884 return input();
1885#endif
1886 }
1887
1888 case EOB_ACT_CONTINUE_SCAN:
1889 (yy_c_buf_p) = (yytext_ptr) + offset;
1890 break;
1891 }
1892 }
1893 }
1894
1895 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1896 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1897 (yy_hold_char) = *++(yy_c_buf_p);
1898
1899 if ( c == '\n' )
1900
1901 yylineno++;
1902;
1903
1904 return c;
1905}
1906#endif /* ifndef YY_NO_INPUT */
1907
1913 void yyrestart (FILE * input_file )
1914{
1915
1916 if ( ! YY_CURRENT_BUFFER ){
1917 yyensure_buffer_stack ();
1918 YY_CURRENT_BUFFER_LVALUE =
1919 yy_create_buffer( yyin, YY_BUF_SIZE );
1920 }
1921
1922 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1923 yy_load_buffer_state( );
1924}
1925
1930 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1931{
1932
1933 /* TODO. We should be able to replace this entire function body
1934 * with
1935 * yypop_buffer_state();
1936 * yypush_buffer_state(new_buffer);
1937 */
1938 yyensure_buffer_stack ();
1939 if ( YY_CURRENT_BUFFER == new_buffer )
1940 return;
1941
1942 if ( YY_CURRENT_BUFFER )
1943 {
1944 /* Flush out information for old buffer. */
1945 *(yy_c_buf_p) = (yy_hold_char);
1946 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1947 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1948 }
1949
1950 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1951 yy_load_buffer_state( );
1952
1953 /* We don't actually know whether we did this switch during
1954 * EOF (yywrap()) processing, but the only time this flag
1955 * is looked at is after yywrap() is called, so it's safe
1956 * to go ahead and always set it.
1957 */
1958 (yy_did_buffer_switch_on_eof) = 1;
1959}
1960
1961static void yy_load_buffer_state (void)
1962{
1963 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1964 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1965 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1966 (yy_hold_char) = *(yy_c_buf_p);
1967}
1968
1975 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1976{
1977 YY_BUFFER_STATE b;
1978
1979 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1980 if ( ! b )
1981 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1982
1983 b->yy_buf_size = size;
1984
1985 /* yy_ch_buf has to be 2 characters longer than the size given because
1986 * we need to put in 2 end-of-buffer characters.
1987 */
1988 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1989 if ( ! b->yy_ch_buf )
1990 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1991
1992 b->yy_is_our_buffer = 1;
1993
1994 yy_init_buffer( b, file );
1995
1996 return b;
1997}
1998
2003 void yy_delete_buffer (YY_BUFFER_STATE b )
2004{
2005
2006 if ( ! b )
2007 return;
2008
2009 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2010 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2011
2012 if ( b->yy_is_our_buffer )
2013 yyfree( (void *) b->yy_ch_buf );
2014
2015 yyfree( (void *) b );
2016}
2017
2018/* Initializes or reinitializes a buffer.
2019 * This function is sometimes called more than once on the same buffer,
2020 * such as during a yyrestart() or at EOF.
2021 */
2022 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2023
2024{
2025 int oerrno = errno;
2026
2027 yy_flush_buffer( b );
2028
2029 b->yy_input_file = file;
2030 b->yy_fill_buffer = 1;
2031
2032 /* If b is the current buffer, then yy_init_buffer was _probably_
2033 * called from yyrestart() or through yy_get_next_buffer.
2034 * In that case, we don't want to reset the lineno or column.
2035 */
2036 if (b != YY_CURRENT_BUFFER){
2037 b->yy_bs_lineno = 1;
2038 b->yy_bs_column = 0;
2039 }
2040
2041 b->yy_is_interactive = 0;
2042
2043 errno = oerrno;
2044}
2045
2050 void yy_flush_buffer (YY_BUFFER_STATE b )
2051{
2052 if ( ! b )
2053 return;
2054
2055 b->yy_n_chars = 0;
2056
2057 /* We always need two end-of-buffer characters. The first causes
2058 * a transition to the end-of-buffer state. The second causes
2059 * a jam in that state.
2060 */
2061 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2062 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2063
2064 b->yy_buf_pos = &b->yy_ch_buf[0];
2065
2066 b->yy_at_bol = 1;
2067 b->yy_buffer_status = YY_BUFFER_NEW;
2068
2069 if ( b == YY_CURRENT_BUFFER )
2070 yy_load_buffer_state( );
2071}
2072
2079void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2080{
2081 if (new_buffer == NULL)
2082 return;
2083
2084 yyensure_buffer_stack();
2085
2086 /* This block is copied from yy_switch_to_buffer. */
2087 if ( YY_CURRENT_BUFFER )
2088 {
2089 /* Flush out information for old buffer. */
2090 *(yy_c_buf_p) = (yy_hold_char);
2091 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2092 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2093 }
2094
2095 /* Only push if top exists. Otherwise, replace top. */
2096 if (YY_CURRENT_BUFFER)
2097 (yy_buffer_stack_top)++;
2098 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2099
2100 /* copied from yy_switch_to_buffer. */
2101 yy_load_buffer_state( );
2102 (yy_did_buffer_switch_on_eof) = 1;
2103}
2104
2109void yypop_buffer_state (void)
2110{
2111 if (!YY_CURRENT_BUFFER)
2112 return;
2113
2114 yy_delete_buffer(YY_CURRENT_BUFFER );
2115 YY_CURRENT_BUFFER_LVALUE = NULL;
2116 if ((yy_buffer_stack_top) > 0)
2117 --(yy_buffer_stack_top);
2118
2119 if (YY_CURRENT_BUFFER) {
2120 yy_load_buffer_state( );
2121 (yy_did_buffer_switch_on_eof) = 1;
2122 }
2123}
2124
2125/* Allocates the stack if it does not exist.
2126 * Guarantees space for at least one push.
2127 */
2128static void yyensure_buffer_stack (void)
2129{
2130 yy_size_t num_to_alloc;
2131
2132 if (!(yy_buffer_stack)) {
2133
2134 /* First allocation is just for 2 elements, since we don't know if this
2135 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2136 * immediate realloc on the next call.
2137 */
2138 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2139 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2140 (num_to_alloc * sizeof(struct yy_buffer_state*)
2141 );
2142 if ( ! (yy_buffer_stack) )
2143 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2144
2145 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2146
2147 (yy_buffer_stack_max) = num_to_alloc;
2148 (yy_buffer_stack_top) = 0;
2149 return;
2150 }
2151
2152 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2153
2154 /* Increase the buffer to prepare for a possible push. */
2155 yy_size_t grow_size = 8 /* arbitrary grow size */;
2156
2157 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2158 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2159 ((yy_buffer_stack),
2160 num_to_alloc * sizeof(struct yy_buffer_state*)
2161 );
2162 if ( ! (yy_buffer_stack) )
2163 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2164
2165 /* zero only the new slots.*/
2166 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2167 (yy_buffer_stack_max) = num_to_alloc;
2168 }
2169}
2170
2177 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2178{
2179 YY_BUFFER_STATE b;
2180
2181 if ( size < 2 ||
2182 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2183 base[size-1] != YY_END_OF_BUFFER_CHAR )
2184 /* They forgot to leave room for the EOB's. */
2185 return NULL;
2186
2187 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2188 if ( ! b )
2189 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2190
2191 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2192 b->yy_buf_pos = b->yy_ch_buf = base;
2193 b->yy_is_our_buffer = 0;
2194 b->yy_input_file = NULL;
2195 b->yy_n_chars = b->yy_buf_size;
2196 b->yy_is_interactive = 0;
2197 b->yy_at_bol = 1;
2198 b->yy_fill_buffer = 0;
2199 b->yy_buffer_status = YY_BUFFER_NEW;
2200
2201 yy_switch_to_buffer( b );
2202
2203 return b;
2204}
2205
2214 YY_BUFFER_STATE yy_scan_string (const char * yystr )
2215{
2216
2217 return yy_scan_bytes( yystr, (int) strlen(yystr) );
2218}
2219
2227 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
2228{
2229 YY_BUFFER_STATE b;
2230 char *buf;
2231 yy_size_t n;
2232 int i;
2233
2234 /* Get memory for full buffer, including space for trailing EOB's. */
2235 n = (yy_size_t) (_yybytes_len + 2);
2236 buf = (char *) yyalloc( n );
2237 if ( ! buf )
2238 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2239
2240 for ( i = 0; i < _yybytes_len; ++i )
2241 buf[i] = yybytes[i];
2242
2243 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2244
2245 b = yy_scan_buffer( buf, n );
2246 if ( ! b )
2247 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2248
2249 /* It's okay to grow etc. this buffer, and we should throw it
2250 * away when we're done.
2251 */
2252 b->yy_is_our_buffer = 1;
2253
2254 return b;
2255}
2256
2257#ifndef YY_EXIT_FAILURE
2258#define YY_EXIT_FAILURE 2
2259#endif
2260
2261static void yynoreturn yy_fatal_error (const char* msg )
2262{
2263 fprintf( stderr, "%s\n", msg );
2264 exit( YY_EXIT_FAILURE );
2265}
2266
2267/* Redefine yyless() so it works in section 3 code. */
2268
2269#undef yyless
2270#define yyless(n) \
2271 do \
2272 { \
2273 /* Undo effects of setting up yytext. */ \
2274 int yyless_macro_arg = (n); \
2275 YY_LESS_LINENO(yyless_macro_arg);\
2276 yytext[yyleng] = (yy_hold_char); \
2277 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2278 (yy_hold_char) = *(yy_c_buf_p); \
2279 *(yy_c_buf_p) = '\0'; \
2280 yyleng = yyless_macro_arg; \
2281 } \
2282 while ( 0 )
2283
2284/* Accessor methods (get/set functions) to struct members. */
2285
2289int yyget_lineno (void)
2290{
2291
2292 return yylineno;
2293}
2294
2298FILE *yyget_in (void)
2299{
2300 return yyin;
2301}
2302
2306FILE *yyget_out (void)
2307{
2308 return yyout;
2309}
2310
2314int yyget_leng (void)
2315{
2316 return yyleng;
2317}
2318
2323char *yyget_text (void)
2324{
2325 return yytext;
2326}
2327
2332void yyset_lineno (int _line_number )
2333{
2334
2335 yylineno = _line_number;
2336}
2337
2344void yyset_in (FILE * _in_str )
2345{
2346 yyin = _in_str ;
2347}
2348
2349void yyset_out (FILE * _out_str )
2350{
2351 yyout = _out_str ;
2352}
2353
2354int yyget_debug (void)
2355{
2356 return yy_flex_debug;
2357}
2358
2359void yyset_debug (int _bdebug )
2360{
2361 yy_flex_debug = _bdebug ;
2362}
2363
2364static int yy_init_globals (void)
2365{
2366 /* Initialization is the same as for the non-reentrant scanner.
2367 * This function is called from yylex_destroy(), so don't allocate here.
2368 */
2369
2370 /* We do not touch yylineno unless the option is enabled. */
2371 yylineno = 1;
2372
2373 (yy_buffer_stack) = NULL;
2374 (yy_buffer_stack_top) = 0;
2375 (yy_buffer_stack_max) = 0;
2376 (yy_c_buf_p) = NULL;
2377 (yy_init) = 0;
2378 (yy_start) = 0;
2379
2380/* Defined in main.c */
2381#ifdef YY_STDINIT
2382 yyin = stdin;
2383 yyout = stdout;
2384#else
2385 yyin = NULL;
2386 yyout = NULL;
2387#endif
2388
2389 /* For future reference: Set errno on error, since we are called by
2390 * yylex_init()
2391 */
2392 return 0;
2393}
2394
2395/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2396int yylex_destroy (void)
2397{
2398
2399 /* Pop the buffer stack, destroying each element. */
2400 while(YY_CURRENT_BUFFER){
2401 yy_delete_buffer( YY_CURRENT_BUFFER );
2402 YY_CURRENT_BUFFER_LVALUE = NULL;
2403 yypop_buffer_state();
2404 }
2405
2406 /* Destroy the stack itself. */
2407 yyfree((yy_buffer_stack) );
2408 (yy_buffer_stack) = NULL;
2409
2410 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2411 * yylex() is called, initialization will occur. */
2412 yy_init_globals( );
2413
2414 return 0;
2415}
2416
2417/*
2418 * Internal utility routines.
2419 */
2420
2421#ifndef yytext_ptr
2422static void yy_flex_strncpy (char* s1, const char * s2, int n )
2423{
2424
2425 int i;
2426 for ( i = 0; i < n; ++i )
2427 s1[i] = s2[i];
2428}
2429#endif
2430
2431#ifdef YY_NEED_STRLEN
2432static int yy_flex_strlen (const char * s )
2433{
2434 int n;
2435 for ( n = 0; s[n]; ++n )
2436 ;
2437
2438 return n;
2439}
2440#endif
2441
2442void *yyalloc (yy_size_t size )
2443{
2444 return malloc(size);
2445}
2446
2447void *yyrealloc (void * ptr, yy_size_t size )
2448{
2449
2450 /* The cast to (char *) in the following accommodates both
2451 * implementations that use char* generic pointers, and those
2452 * that use void* generic pointers. It works with the latter
2453 * because both ANSI C and C++ allow castless assignment from
2454 * any pointer type to void*, and deal with argument conversions
2455 * as though doing an assignment.
2456 */
2457 return realloc(ptr, size);
2458}
2459
2460void yyfree (void * ptr )
2461{
2462 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2463}
2464
2465#define YYTABLES_NAME "yytables"
2466
2467#line 272 "lang.l"
2468
2469
2470/*---------------------------------------------------------------------*/
2471
2475int yywrap (void)
2476{
2477 return (1);
2478}
2479
2483static void AddChar (int ch)
2484{
2485 if (ptr)
2486 {
2487 DEBUG ("%c", ch);
2488 *ptr++ = ch;
2489 if (ptr >= end)
2490 Error ("string too large");
2491 }
2492}
2493
2497static void AddDecimal (const char *buf)
2498{
2499 if (ptr)
2500 {
2501 int dec;
2502 sscanf (buf, "%3d", &dec);
2503 DEBUG ("'dec <%d>'", dec);
2504 *ptr++ = dec;
2505 if (dec > 255)
2506 Fatal ("Illegal decimal", NULL);
2507 if (ptr >= end)
2508 Error ("String too large");
2509 }
2510}
2511
2515static void AddHexcode (const char *buf)
2516{
2517 if (ptr)
2518 {
2519 WORD hex;
2520 sscanf (buf, "%2hx", &hex);
2521 DEBUG ("'hex <%X>'", hex);
2522 *ptr++ = loBYTE (hex);
2523 if (ptr >= end)
2524 Error ("string too large");
2525 }
2526}
2527
2531static void AddOctal (const char *buf)
2532{
2533 if (ptr)
2534 {
2535 unsigned oct;
2536 sscanf (buf, "%3o", &oct);
2537 DEBUG ("'oct <%o>'", oct);
2538 *ptr++ = loBYTE (oct);
2539 if (ptr >= end)
2540 Error ("string too large");
2541 }
2542}
2543
2547static void AddEntry (void)
2548{
2549 const char *str = NULL;
2550 struct Node *list = NULL;
2551
2552 if ((str = strdup(buf)) == NULL ||
2553 (list = calloc(sizeof(*list),1)) == NULL)
2554 {
2555 (*_printf) ("Language file too big!\n");
2556 DO_FREE (str);
2557 DO_FREE (list);
2558 longjmp (bail_out, 1);
2559 }
2560
2561 list->next = lang.list;
2562 list->crc = crc_ref;
2563 list->string = str;
2564 lang.list = list;
2565 lang.entries++;
2566 do_ref = TRUE;
2567}
2568
2572static int MS_CDECL Compare (const void *_a, const void *_b)
2573{
2574 const struct Elem *a = _a;
2575 const struct Elem *b = _b;
2576
2577 if (a->crc > b->crc)
2578 return (1);
2579 if (a->crc < b->crc)
2580 return (-1);
2581 return (0);
2582}
2583
2587static int SortLanguageEntries (size_t num)
2588{
2589 struct Node *lng, *next;
2590 struct Elem *array = calloc (num, sizeof(*array));
2591
2592 lang.array = array;
2593 if (!array)
2594 return (0);
2595
2596 for (lng = lang.list; lng; lng = next, array++)
2597 {
2598 array->crc = lng->crc;
2599 array->string = lng->string;
2600 next = lng->next;
2601 free (lng);
2602 }
2603 lang.list = NULL;
2604 qsort (lang.array, num, sizeof(*array), (CmpFunc)Compare);
2605 return (1);
2606}
2607
2608/*
2609 * _w32_lex_destroy() isn't generated in all Flex'es. So make our own.
2610 */
2611static void __lex_destroy (void)
2612{
2613 /* Old Flex doesn't have this. But probably only on MSDOS where
2614 * freeing memory isn't so imporant.
2615 */
2616#if defined(YY_CURRENT_BUFFER_LVALUE)
2617 /* Pop the buffer stack, destroying each element. */
2618 while (YY_CURRENT_BUFFER)
2619 {
2620 _w32__delete_buffer (YY_CURRENT_BUFFER);
2621 YY_CURRENT_BUFFER_LVALUE = NULL;
2622 _w32_pop_buffer_state();
2623 }
2624
2625 /* Destroy the stack itself. */
2626 free (yy_buffer_stack);
2627 yy_buffer_stack = NULL;
2628#else
2629 yy_delete_buffer (YY_CURRENT_BUFFER);
2630#endif
2631}
2632
2633/*
2634 * Free memory allocated above.
2635 */
2636static void W32_CALL lang_exit (void)
2637{
2638 struct Elem *elem;
2639 size_t i;
2640
2641 if (crc_table)
2642 free (crc_table);
2643 crc_table = NULL;
2644
2645 if (!lang.array)
2646 return;
2647
2648 for (i = 0, elem = lang.array; i < lang.entries; i++, elem++)
2649 free ((void*)elem->string);
2650 free (lang.array);
2651 lang.array = NULL;
2652 lang.entries = 0;
2653 __lex_destroy();
2654}
2655
2667void lang_init (const char *value)
2668{
2669 FILE *langf;
2670 char *s, *fname;
2671
2672 if (!value)
2673 return;
2674
2675 s = strchr (value, ',');
2676 if (!s || (s - value) != 2)
2677 {
2678 Fatal ("Illegal LANGUAGE syntax", NULL);
2679 return;
2680 }
2681
2682 lang.line = 1;
2683 lang.prefix[0] = value[0];
2684 lang.prefix[1] = value[1];
2685 lang.prefix[2] = ':';
2686 lang.prefix[3] = '\0';
2687 strlwr (lang.prefix);
2688
2689 if (!strnicmp(lang.prefix,"en",2)) /* english is default language */
2690 return;
2691
2692 if (!crc_init())
2693 {
2694 Fatal ("CRC init failed", NULL);
2695 return;
2696 }
2697
2698 fname = ++s;
2699 langf = fopen (fname, "rb");
2700 if (!langf)
2701 {
2702 Fatal ("Cannot open language file ", fname);
2703 return;
2704 }
2705
2706 if (!setjmp(bail_out))
2707 {
2708 yyin = langf;
2709 yylex();
2710
2711 if (!SortLanguageEntries(lang.entries))
2712 {
2713 fclose (langf);
2714 Fatal ("Could not sort LANGUAGE entries", NULL);
2715 return;
2716 }
2717#if defined(TEST_PROG)
2718 printf ("file-name = `%s'\n", fname);
2719 printf ("lang.prefix = `%s'\n", lang.prefix);
2720 printf ("lang.entries = %u\n", (unsigned int)lang.entries);
2721 printf ("lang.lines = %u\n", lang.line);
2722 printf ("lang.list = %" ADDR_FMT "\n", ADDR_CAST(lang.list));
2723 printf ("lang.array = %" ADDR_FMT "\n\n", ADDR_CAST(lang.array));
2724
2725 {
2726 const struct Elem *elem;
2727 size_t i;
2728
2729 for (i = 0, elem = lang.array; i < lang.entries; i++, elem++)
2730 printf ("CRC = %08lX, <%s>\n", DWORD_CAST(elem->crc), elem->string);
2731 }
2732#endif
2733 }
2734
2735 fclose (langf);
2736 RUNDOWN_ADD (lang_exit, 302);
2737}
2738
2742const char *lang_xlate (const char *str)
2743{
2744 const struct Elem *elem;
2745 DWORD hash;
2746 size_t len;
2747
2748 if (!lang.entries || !str)
2749 return (str);
2750
2751 len = strlen (str);
2752 if (len == 0)
2753 return (str);
2754
2755 hash = crc_bytes (str, len);
2756
2757 elem = (const struct Elem*) bsearch (&hash, lang.array, lang.entries,
2758 sizeof(*elem), (CmpFunc)Compare);
2759
2760 if (!elem || !elem->string || !elem->string[0])
2761 return (str);
2762
2763 return (elem->string);
2764}
2765
2769static void Fatal (const char *s1, const char *s2)
2770{
2771 (*_printf) ("\n");
2772 if (lang.line > 0)
2773 (*_printf) ("line %u: ", lang.line);
2774 (*_printf) ("%s%s\n", s1, s2 ? s2 : "");
2775 lang_exit();
2776}
2777
2781static void Error (const char *err)
2782{
2783 (*_printf) ("%s at line %u\n", err, lang.line);
2784}
2785#endif
2786
2787#if defined(TEST_PROG)
2788int main (void)
2789{
2790 puts ("You must define a non-english language to parse the language-file.\n"
2791 "Use e.g: \"language = no,$(ETC)\\watlang.txt\" in WATTCP.CFG\n"
2792 "Press any key to initialise Watt-32.");
2793 getch();
2794 sock_init();
2795 return (0);
2796}
2797#endif /* TEST_PROG */
2798
2799
errno.h
Elem
Definition: lang.c:842
Language
Definition: lang.c:847
Node
Definition: lang.c:836
yy_buffer_state
Definition: lang.c:464
yy_buffer_state::yy_bs_column
int yy_bs_column
The column count.
Definition: lang.c:500
yy_buffer_state::yy_bs_lineno
int yy_bs_lineno
The line count.
Definition: lang.c:499
yy_trans_info
Definition: lang.c:637


Watt-32 tcp/ip: E:/WATT/src/language.c File Reference

  • src
Functions
language.c File Reference

Go to the source code of this file.

Functions

int main (void)

Detailed Description

The generated lang.c must be included below (and not compiled alone). This is needed to work around different definitions of e.g. INT8_MAX. In Watcom's <stdint.h>:

Precondition
#define INT_MAX 127

and in Flex generated lang.c:

Precondition
#define INT8_MAX (127)

The Watcom preprossesor doesn't understand they're equal :-(

Besides, the following YY_defines makes the code a bit smaller.

Definition in file language.c.

Function Documentation

◆ main()

int main ( void )

Definition at line 53 of file language.c.


Watt-32 tcp/ip: E:/WATT/src/language.h File Reference

  • src
Functions
language.h File Reference

Go to the source code of this file.

Functions

void | lang_init (const char *value)
const char * | lang_xlate (const char *str)

Detailed Description

Include file for Watt-32 foreign language translation facility.

Based on idea from PGP, but totally rewritten (using flex)

Strings with _LANG() around them are found by the ‘mklang’ tool and put into a text file to be translated into foreign language at run-time.

Definition in file language.h.


Watt-32 tcp/ip: E:/WATT/src/linkaddr.c File Reference

  • src
Functions
linkaddr.c File Reference

Go to the source code of this file.

Functions

void W32_CALL | link_addr (const char *addr, struct sockaddr_dl *sdl)
char *W32_CALL | link_ntoa (const struct sockaddr_dl *sdl)

Function Documentation

◆ link_addr()

void W32_CALL link_addr | ( | const char * | addr,
 |  | struct sockaddr_dl * | sdl
 | ) |  |

Definition at line 57 of file linkaddr.c.

◆ link_ntoa()

char *W32_CALL link_ntoa ( const struct sockaddr_dl * sdl )

Definition at line 135 of file linkaddr.c.


Watt-32 tcp/ip: E:/WATT/src/listen.c File Reference

  • src
Functions
listen.c File Reference

Go to the source code of this file.

Functions

int W32_CALL | listen (int s, int backlog)
int | main (void)

Detailed Description

BSD listen().

Definition in file listen.c.

Function Documentation

◆ listen()

int W32_CALL listen | ( | int | s,
 |  | int | backlog
 | ) |  |

Definition at line 43 of file listen.c.

◆ main()

int main ( void )

Definition at line 103 of file listen.c.


Watt-32 tcp/ip: E:/WATT/src/lookup.c File Reference

  • src
Functions
lookup.c File Reference

Go to the source code of this file.

Functions

DWORD W32_CALL lookup_host (const char *host, char *ip_str)

Detailed Description

Host lookup function.

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file lookup.c.

Function Documentation

◆ lookup_host()

DWORD W32_CALL lookup_host | ( | const char * | host,
 |  | char * | ip_str
 | ) |  |

Definition at line 45 of file lookup.c.


Watt-32 tcp/ip: E:/WATT/src/loopback.c File Reference

  • src
Functions | Variables
loopback.c File Reference

Go to the source code of this file.

Functions

A sketch of calls involved in sending receiving an IP packet Sending an IP packet Receiving an IP packet | tcp_tick ()|||_eth_formatpacket() -> buffer X|_eth_arrived()|||_ip4_output()|poll_recv_queue()||||||_eth_send() enqueue copy of||X to IP-queue|*----->loopback_device() -- *--> > > > > > -<-------pkt_poll_recv()|(1)|||||||||||||||||||||||_pkt_send() drop buffer X \||none _ip4_handler()||||||||\ ip4_defragment()|||||||protocol handlers|||||||_eth_free() v|||packet-driver|`-----------<-- pkt_free_pkt()|||Ethernet/PPP \ From the above it evident the current design cannot easily send IP-fragments. _ip4_output() must be rewritten to handle max. 64kB packets, split them in make_fragments(), format a link-layer packet using _eth_formatpacket() and repetively call _eth_send().(1):A future Win32 version could try enqueueing to the Winsock loopback handler. A TDI provider?? #endif int(W32_CALL *loopback_handler)(in_Header *)=NULL
static int | icmp_loopback (ICMP_PKT *icmp, unsigned icmp_len)
static int | udp_loopback (udp_Header *udp, unsigned udp_len)
int | loopback_device (in_Header *ip)

Variables

WORD loopback_mode = LBACK_MODE_ENABLE

Detailed Description

A simple loopback device.

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

A simple loopback device. At the moment it handles ICMP Echo-request and UDP sink/discard packets. It pased up the rest.

Add protocol handlers to ‘loopback_handler’ pointer as required.

The modified (src/dst IP swapped) ip packet is enqueued to the IP receive queue after loopback_device() returns.

The return value is: -1 if IP-packet should not be enqueued to IP input queue >0 length of (modified) IP-packet

Gisle Vanem 10 Dec. 1997

Definition in file loopback.c.

Function Documentation

◆ icmp_loopback()

static int icmp_loopback | ( | ICMP_PKT * | icmp,
 |  | unsigned | icmp_len
 | ) |  |
static
Todo:
fall-through to another ICMP loopback handler

Definition at line 213 of file loopback.c.

◆ loopback_device()

int loopback_device ( in_Header * ip )

Definition at line 122 of file loopback.c.

◆ udp_loopback()

static int udp_loopback | ( | udp_Header * | udp,
 |  | unsigned | udp_len
 | ) |  |
static
Todo:
UDP loopback handler should handle ECHO protocol
Todo:
UDP loopback handler should handle DISCARD protocol

Definition at line 234 of file loopback.c.

Variable Documentation

◆ loopback_mode

WORD loopback_mode = LBACK_MODE_ENABLE

Definition at line 62 of file loopback.c.


Watt-32 tcp/ip: E:/WATT/src/loopback.h File Reference

  • src
Functions | Variables
loopback.h File Reference

Go to the source code of this file.

Functions

int loopback_device (in_Header *)

Variables

WORD loopback_mode

Function Documentation

◆ loopback_device()

int loopback_device ( in_Header * ip )

Definition at line 122 of file loopback.c.

Variable Documentation

◆ loopback_mode

WORD loopback_mode
extern

Definition at line 62 of file loopback.c.


Watt-32 tcp/ip: E:/WATT/src/misc.c File Reference

  • src
Data Structures | Functions | Variables
misc.c File Reference

Go to the source code of this file.

Data Structures

struct cmd_block
Run a COMMAND.COM/4DOS external/internal command. More...

Functions

void cdecl | CheckCpuType (void)
static void | setup_dos_xfer_buf (void)
STATIC int | setup_stk_check (void)
void cdecl | _fatal_runtime_error (UINT stk)
void cdecl | _fatal_runtime_error_ (UINT stk)
STATIC void | test_stk_check (void)
unsigned long W32_CDECL | _w32_intel (unsigned long val)
Convert 32-bit big-endian (network order) to intel (host order) format.
unsigned short W32_CDECL | _w32_intel16 (unsigned short val)
Convert 16-bit big-endian (network order) to intel (host order) format.
static void | patch_with_bswap (void)
DWORD | get_day_num (void)
Simplified method of getting days since 1970-01-01.
static BOOL | RDTSC_enabled (void)
static BOOL | check_reg_struct (void)
void W32_CALL | init_misc (void)
Initialise various stuff.
FILE * | fopen_excl (const char *file, const char *mode)
WIN32: Open an existing file (or create) in share-mode but deny other processes to write to the file.
_CRTIMP _CRT_REPORT_HOOK __cdecl | _CrtSetReportHook2 (int, _CRT_REPORT_HOOK)
static void __cdecl | crtdbg_exit (void)
static const char * | report_name (int type)
static void __cdecl | crtdbg_dump (void *buf, size_t len)
static int __cdecl | crtdbg_report (int type, char *message, int *ret_val)
void | memdbg_init (void)
void | memdbg_post_init (void)
void | assert_fail (const char *file, unsigned line, const char *what)
Store the "assert fail" text for later before printing it.
void W32_CALL | assert_fail_test (void)
void W32_CALL | abort_test (void)
void W32_CALL | except_test (void)
void W32_CALL | leak_test (void)
unsigned W32_CALL | Random (unsigned a, unsigned b)
Returns a random integer in range [a..b].
void W32_CALL | RandomWait (unsigned a, unsigned b)
Wait for a random period in range [a..b] millisec.
void | Wait (unsigned msec)
Not all vendors have delay().
const char * | dos_extender_name (void)
void | os_yield (void)
BOOL | watt_check_break (void)
char * | ctime_r (const time_t *t, char *res)
A reentrant ctime().
struct tm * | localtime_r (const time_t *t, struct tm *res)
A reentrant localtime().
int W32_CALL | watt_kbhit (void)
A less CPU hogging kbhit().
long W32_CALL | watt_filelength (int fd)
filelength() is needed in pcconfig.c and some applications.
const char * | list_lookup (DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
const char * | list_lookupX (DWORD type, const struct search_list *list, int num)
const char * | MAC_address (const void *addr)
Return hexa-decimal string for an 6/7 byte MAC-address.
const char * | dword_str (DWORD val)
Return nicely formatted string "xx,xxx,xxx" with thousand separators (left adjusted).
const char * | qword_str (uint64 val)
The same as above.
void | unfinished (const char *func, const char *file, unsigned line)
void | unimplemented (const char *func, const char *file, unsigned line)
DWORD | get_ds_limit (void)
DWORD | get_cs_limit (void)
DWORD | get_ss_limit (void)
BOOL | valid_addr (const void *addr, unsigned len)
static void | free_selector (void)
int W32_CALL | _w32_ffs (int i)
void | watt_large_check (const void *sock, int size, const char *file, unsigned line)
BOOL | is_big_endian (void)
BOOL | shell_exec (const char *cmd)
void | _w32_intr (int int_no, IREGS *reg)
Microsoft/Digital Mars doesn't have intr() so we make our own.
STATIC void | stk_overflow (WORD ret_addr)
static void | stk_overflow (UINT ret_addr)
static int | stk_check_setup (void)
static void | stk_overflow (WORD cs, UINT eip)
void | FATAL_HANDLER (UINT stk)
static void | print_pkt_sizes (void)
static void | itoa_tests (void)
static BOOL | get_mem_strat (BYTE *strat)
static BOOL | set_mem_strat (BYTE strat)
void W32_CALL | foo_10 (void)
void W32_CALL | foo_20 (void)
void W32_CALL | foo_30 (void)
void W32_CALL | foo_40 (void)
void W32_CALL | foo_50 (void)
void W32_CALL | foo_60 (void)
void W32_CALL | foo_70 (void)
int | main (void)

Variables

const char | hex_chars_lower [] = "0123456789abcdef"
const char | hex_chars_upper [] = "0123456789ABCDEF"
BOOL | win32_dos_box = FALSE
BOOL | _watt_crtdbg_check = FALSE
BOOL | _watt_fatal_error = FALSE
WORD | _watt_os_ver = 0x622
char | _watt_assert_buf [256]
int | _w32_errno = 0
FARPTR | _watt_dosFp
int | x86_have_cpuid = TRUE
DWORD | x86_capability
char | x86_type
char | x86_model
char | x86_mask
int | x86_hard_math
char | x86_vendor_id [13]
char cdecl | __begtext
UINT cdecl | _x386_stacklow
char * | dummy_fatal_rte = (char*)&FATAL_HANDLER
static const BYTE | bswap32 []
static const BYTE | bswap16 []
static _CrtMemState | last_state
static BOOL | got_crt_assert
REALPTR | _watt_dosTbr = 0
DWORD | _watt_dosTbSize = 0
static WORD | rm_seg = 0
WORD | _watt_dosTbSeg = 0
WORD | _watt_dosTbSel = 0
WORD | _watt_dos_ds
int | __brklvl

Detailed Description

Module for various things:

  • host/network order (little/big endian) swapping of bytes.
  • initialize PEEK/POKE macros.
  • allocate transfer buffer for DOSX targets.
  • address validation for DOSX targets.
  • simple range limited random routine.
  • ffs() routine to find the first bit set.
  • initialize memory-debug; CrtDbg
  • stack checker exit routine for Borland/Watcom.

Definition in file misc.c.

Function Documentation

◆ _w32_ffs()

int W32_CALL _w32_ffs ( int i )

Definition at line 1331 of file misc.c.

◆ _w32_intel()

unsigned long W32_CDECL _w32_intel ( unsigned long val )

Convert 32-bit big-endian (network order) to intel (host order) format.

Or vice-versa. These are cdecl incase we patch them.

Definition at line 171 of file misc.c.

◆ _w32_intel16()

unsigned short W32_CDECL _w32_intel16 ( unsigned short val )

Convert 16-bit big-endian (network order) to intel (host order) format.

Or vice-versa

Definition at line 183 of file misc.c.

◆ _w32_intr()

void _w32_intr | ( | int | int_no,
 |  | IREGS * | reg
 | ) |  |

Microsoft/Digital Mars doesn't have intr() so we make our own.

Definition at line 1459 of file misc.c.

◆ abort_test()

void W32_CALL abort_test ( void )

Definition at line 714 of file misc.c.

◆ assert_fail()

void assert_fail | ( | const char * | file,
 |  | unsigned | line,
 |  | const char * | what
 | ) |  |

Store the "assert fail" text for later before printing it.

Definition at line 653 of file misc.c.

References _watt_assert_buf, _watt_fatal_error, and win_strerror().

◆ assert_fail_test()

void W32_CALL assert_fail_test ( void )

Definition at line 702 of file misc.c.

◆ check_reg_struct()

static BOOL check_reg_struct ( void )
static

Definition at line 304 of file misc.c.

◆ CheckCpuType()

void cdecl CheckCpuType ( void )

Definition at line 98 of file misc.c.

◆ crtdbg_dump()

static void __cdecl crtdbg_dump | ( | void * | buf,
 |  | size_t | len
 | ) |  |
static

Definition at line 511 of file misc.c.

◆ crtdbg_exit()

static void __cdecl crtdbg_exit ( void )
static
Todo:
: show a better MessageBox(). Show backtrace from where abort() was called; skip the 2 first CRT locations (raise, abort). Indent the printout 2 spaces.

Definition at line 544 of file misc.c.

References _eth_release(), and _watt_crtdbg_check.

◆ crtdbg_report()

static int __cdecl crtdbg_report | ( | int | type,
 |  | char * | message,
 |  | int * | ret_val
 | ) |  |
static

Definition at line 528 of file misc.c.

◆ ctime_r()

char * ctime_r | ( | const time_t * | t,
 |  | char * | res
 | ) |  |

A reentrant ctime().

Definition at line 887 of file misc.c.

◆ dos_extender_name()

const char * dos_extender_name ( void )

Definition at line 794 of file misc.c.

◆ dword_str()

const char * dword_str ( DWORD val )

Return nicely formatted string "xx,xxx,xxx" with thousand separators (left adjusted).

Definition at line 1022 of file misc.c.

References strltrim().

◆ except_test()

void W32_CALL except_test ( void )

Definition at line 720 of file misc.c.

◆ FATAL_HANDLER()

void FATAL_HANDLER ( UINT stk )

Definition at line 1630 of file misc.c.

◆ foo_10()

void W32_CALL foo_10 ( void )

Definition at line 1781 of file misc.c.

◆ foo_20()

void W32_CALL foo_20 ( void )

Definition at line 1782 of file misc.c.

◆ foo_30()

void W32_CALL foo_30 ( void )

Definition at line 1783 of file misc.c.

◆ foo_40()

void W32_CALL foo_40 ( void )

Definition at line 1784 of file misc.c.

◆ foo_50()

void W32_CALL foo_50 ( void )

Definition at line 1785 of file misc.c.

◆ foo_60()

void W32_CALL foo_60 ( void )

Definition at line 1786 of file misc.c.

◆ foo_70()

void W32_CALL foo_70 ( void )

Definition at line 1787 of file misc.c.

◆ fopen_excl()

FILE * fopen_excl | ( | const char * | file,
 |  | const char * | mode
 | ) |  |

WIN32: Open an existing file (or create) in share-mode but deny other processes to write to the file.

On Watcom, fopen() already seems to open with SH_DENYWR internally.

MSDOS/Watcom/CygWin: simply call fopen().

Definition at line 453 of file misc.c.

◆ free_selector()

static void free_selector ( void )
static

Definition at line 1208 of file misc.c.

◆ get_cs_limit()

DWORD get_cs_limit ( void )

Definition at line 1109 of file misc.c.

◆ get_day_num()

DWORD get_day_num ( void )

Simplified method of getting days since 1970-01-01.

Don't use time() since it will probably link in sprintf(). We don't need accuracy. Only a reference for sock_stats().

Definition at line 222 of file misc.c.

◆ get_ds_limit()

DWORD get_ds_limit ( void )

Definition at line 1099 of file misc.c.

◆ get_mem_strat()

static BOOL get_mem_strat ( BYTE * strat )
static

Definition at line 1754 of file misc.c.

◆ get_ss_limit()

DWORD get_ss_limit ( void )

Definition at line 1119 of file misc.c.

◆ init_misc()

void W32_CALL init_misc ( void )

Initialise various stuff.

Todo:

Definition at line 345 of file misc.c.

References _watt_assert_buf, _watt_os_ver, has_rdtsc, init_timers(), qword_str(), and win32_dos_box.

◆ is_big_endian()

BOOL is_big_endian ( void )

Definition at line 1402 of file misc.c.

◆ itoa_tests()

static void itoa_tests ( void )
static

Definition at line 1740 of file misc.c.

◆ leak_test()

void W32_CALL leak_test ( void )

Definition at line 727 of file misc.c.

◆ list_lookup()

const char * list_lookup | ( | DWORD | type,
 |  | const struct search_list * | list,
 |  | int | num
 | ) |  |

Search 'list' for 'type' and return it's name.

Definition at line 963 of file misc.c.

◆ list_lookupX()

const char * list_lookupX | ( | DWORD | type,
 |  | const struct search_list * | list,
 |  | int | num
 | ) |  |

Definition at line 978 of file misc.c.

◆ localtime_r()

struct tm * localtime_r | ( | const time_t * | t,
 |  | struct tm * | res
 | ) |  |

A reentrant localtime().

Definition at line 900 of file misc.c.

◆ MAC_address()

const char * MAC_address ( const void * addr )

Return hexa-decimal string for an 6/7 byte MAC-address.

Use 2 buffers in round-robin.

Definition at line 997 of file misc.c.

References _pktdevclass.

◆ main()

int main ( void )

Definition at line 1789 of file misc.c.

◆ memdbg_init()

void memdbg_init ( void )

Definition at line 595 of file misc.c.

◆ memdbg_post_init()

void memdbg_post_init ( void )

Definition at line 634 of file misc.c.

◆ os_yield()

void os_yield ( void )

Definition at line 823 of file misc.c.

◆ patch_with_bswap()

static void patch_with_bswap ( void )
static

Definition at line 208 of file misc.c.

◆ print_pkt_sizes()

static void print_pkt_sizes ( void )
static

Definition at line 1712 of file misc.c.

◆ qword_str()

const char * qword_str ( uint64 val )

The same as above.

But for a QWORD (64-bit unsigned). Assume given 'val' is 64-bit signed if 'val' > LLONG_MAX'.

Definition at line 1053 of file misc.c.

◆ Random()

unsigned W32_CALL Random | ( | unsigned | a,
 |  | unsigned | b
 | ) |  |

Returns a random integer in range [a..b].

Definition at line 743 of file misc.c.

◆ RandomWait()

void W32_CALL RandomWait | ( | unsigned | a,
 |  | unsigned | b
 | ) |  |

Wait for a random period in range [a..b] millisec.

Definition at line 760 of file misc.c.

References chk_timeout(), Random(), and set_timeout().

◆ RDTSC_enabled()

static BOOL RDTSC_enabled ( void )
static

Definition at line 246 of file misc.c.

◆ report_name()

static const char * report_name ( int type )
static

Definition at line 500 of file misc.c.

◆ set_mem_strat()

static BOOL set_mem_strat ( BYTE strat )
static

Definition at line 1767 of file misc.c.

◆ setup_dos_xfer_buf()

static void setup_dos_xfer_buf ( void )
static

Definition at line 1217 of file misc.c.

◆ setup_stk_check()

STATIC int setup_stk_check ( void )

Definition at line 1514 of file misc.c.

◆ shell_exec()

BOOL shell_exec ( const char * cmd )

Definition at line 1427 of file misc.c.

◆ stk_check_setup()

static int stk_check_setup ( void )
static

Definition at line 1589 of file misc.c.

◆ stk_overflow() [1/3]

static void stk_overflow ( UINT ret_addr )
static

Definition at line 1571 of file misc.c.

◆ stk_overflow() [2/3]

static void stk_overflow | ( | WORD | cs,
 |  | UINT | eip
 | ) |  |
static

Definition at line 1617 of file misc.c.

◆ stk_overflow() [3/3]

STATIC void stk_overflow ( WORD ret_addr )

Definition at line 1497 of file misc.c.

◆ test_stk_check()

STATIC void test_stk_check ( void )

Definition at line 151 of file misc.c.

◆ unfinished()

void unfinished | ( | const char * | func,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Definition at line 1082 of file misc.c.

◆ unimplemented()

void unimplemented | ( | const char * | func,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Definition at line 1090 of file misc.c.

◆ valid_addr()

BOOL valid_addr | ( | const void * | addr,
 |  | unsigned | len
 | ) |  |

Definition at line 1137 of file misc.c.

◆ Wait()

void Wait ( unsigned msec )

Not all vendors have delay().

Definition at line 777 of file misc.c.

References chk_timeout(), and set_timeout().

◆ watt_check_break()

BOOL watt_check_break ( void )

Definition at line 865 of file misc.c.

◆ watt_filelength()

long W32_CALL watt_filelength ( int fd )

filelength() is needed in pcconfig.c and some applications.

So add this utility function here.

Definition at line 946 of file misc.c.

◆ watt_kbhit()

int W32_CALL watt_kbhit ( void )

A less CPU hogging kbhit().

Definition at line 917 of file misc.c.

References _watt_cbroke.

◆ watt_large_check()

void watt_large_check | ( | const void * | sock,
 |  | int | size,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Definition at line 1382 of file misc.c.

Variable Documentation

◆ _w32_errno

int _w32_errno = 0

Definition at line 80 of file misc.c.

◆ _watt_assert_buf

char _watt_assert_buf[256]

Print this in dbug_exit()

Definition at line 75 of file misc.c.

◆ _watt_crtdbg_check

BOOL _watt_crtdbg_check = FALSE

MSVC/_DEBUG only. See below

Definition at line 72 of file misc.c.

◆ _watt_dos_ds

WORD _watt_dos_ds

Definition at line 1259 of file misc.c.

◆ _watt_dosFp

FARPTR _watt_dosFp

Definition at line 83 of file misc.c.

◆ _watt_dosTbr

DWORD _watt_dosTbr = 0

Definition at line 1204 of file misc.c.

◆ _watt_dosTbSeg

WORD _watt_dosTbSeg = 0

Definition at line 1237 of file misc.c.

◆ _watt_dosTbSel

WORD _watt_dosTbSel = 0

Definition at line 1238 of file misc.c.

◆ _watt_dosTbSize

DWORD _watt_dosTbSize = 0

Definition at line 1205 of file misc.c.

◆ _watt_fatal_error

BOOL _watt_fatal_error = FALSE

We're exiting via an exception handler

Definition at line 73 of file misc.c.

◆ _watt_os_ver

WORD _watt_os_ver = 0x622

True DOS/WinNT version MSB.LSB

Definition at line 74 of file misc.c.

◆ bswap16

const BYTE bswap16[]
static
Initial value:
= {
0x8B, 0x44, 0x24, 0x04,
0x0F, 0xC8,
0xC1, 0xE8, 0x10,
0xC3
}

Definition at line 195 of file misc.c.

◆ bswap32

const BYTE bswap32[]
static
Initial value:
= {
0x8B, 0x44, 0x24, 0x04,
0x0F, 0xC8,
0xC3
}

Definition at line 189 of file misc.c.

◆ dummy_fatal_rte

char* dummy_fatal_rte = (char*)&FATAL_HANDLER

Definition at line 136 of file misc.c.

◆ got_crt_assert

BOOL got_crt_assert
static

Definition at line 526 of file misc.c.

◆ hex_chars_lower

const char hex_chars_lower[] = "0123456789abcdef"

Definition at line 68 of file misc.c.

◆ hex_chars_upper

const char hex_chars_upper[] = "0123456789ABCDEF"

Definition at line 69 of file misc.c.

◆ last_state

_CrtMemState last_state
static

Definition at line 497 of file misc.c.

◆ rm_seg

WORD rm_seg = 0
static

Definition at line 1206 of file misc.c.

◆ win32_dos_box

BOOL win32_dos_box = FALSE

Running under Windows DOS-box

Definition at line 71 of file misc.c.

◆ x86_capability

DWORD x86_capability

Definition at line 91 of file misc.c.

◆ x86_hard_math

int x86_hard_math

Definition at line 95 of file misc.c.

◆ x86_have_cpuid

int x86_have_cpuid = TRUE

Definition at line 90 of file misc.c.

◆ x86_mask

char x86_mask

Definition at line 94 of file misc.c.

◆ x86_model

char x86_model

Definition at line 93 of file misc.c.

◆ x86_type

char x86_type

Definition at line 92 of file misc.c.

◆ x86_vendor_id

char x86_vendor_id[13]

Definition at line 96 of file misc.c.


Watt-32 tcp/ip: E:/WATT/src/misc.h File Reference

  • src
Data Structures | Typedefs | Functions | Variables
misc.h File Reference

Go to the source code of this file.

Data Structures

struct | search_list
struct | DPMI_regs
struct | IREGS

Typedefs

typedef int(MS_CDECL * | CmpFunc) (const void *, const void *)
typedef struct DPMI_regs | IREGS
typedef INTR_PROTOTYPE(* | W32_IntrHandler) ()

Functions

int __cdecl | kbhit (void)
int _RTLENTRY _EXPFUNC | getch (void)
int _RTLENTRY _EXPFUNC | cputs (const char *str)
void | Wait (unsigned msec)
Not all vendors have delay().
BOOL | valid_addr (const void *addr, unsigned len)
BOOL | is_in_stack (const void *ptr)
unsigned | used_stack (void)
unsigned | _get_frame_size (const char *x)
void | os_yield (void)
void | assert_fail (const char *file, unsigned line, const char *what)
Store the "assert fail" text for later before printing it.
DWORD | get_day_num (void)
Simplified method of getting days since 1970-01-01.
void | memdbg_init (void)
void | memdbg_post_init (void)
FILE * | fopen_excl (const char *file, const char *mode)
WIN32: Open an existing file (or create) in share-mode but deny other processes to write to the file.
void | unfinished (const char *func, const char *file, unsigned line)
void | unimplemented (const char *func, const char *file, unsigned line)
char * | ctime_r (const time_t *t, char *res)
A reentrant ctime().
struct tm * | localtime_r (const time_t *t, struct tm *res)
A reentrant localtime().
char * | strtok_r (char *ptr, const char *sep, char **end)
const char * | dos_extender_name (void)
const char * | dword_str (DWORD val)
Return nicely formatted string "xx,xxx,xxx" with thousand separators (left adjusted).
const char * | qword_str (uint64 val)
The same as above.
const char * | list_lookup (DWORD, const struct search_list *, int)
Search 'list' for 'type' and return it's name.
const char * | list_lookupX (DWORD, const struct search_list *, int)
const char * | MAC_address (const void *addr)
Return hexa-decimal string for an 6/7 byte MAC-address.
void | watt_large_check (const void *sock, int size, const char *file, unsigned line)
char * | itoa (int val, char *buf, int radix)
BOOL | init_win_misc (void)
BOOL | WinDnsQuery_A4 (const char *name, DWORD *ip4)
BOOL | WinDnsQuery_A6 (const char *name, void *ip6)
BOOL | WinDnsQuery_PTR4 (DWORD ip4, char *name, size_t size)
BOOL | WinDnsQuery_PTR6 (const void *ip6, char *name, size_t size)
BOOL | WinDnsCachePut_A4 (const char *name, DWORD ip4)
BOOL | WinDnsCachePut_A6 (const char *name, const void *ip6)
BOOL | get_file_version (const char *file, char *buf, size_t buf_len)
Returns the version of a PE image (.sys, .dll or .exe).
void | print_thread_times (HANDLE thread)
void | print_perf_times (void)
void | print_process_times (void)
BOOL | tcp_cbreak_off (void)
int | set_cbreak (int want_brk)
Sets normal and extended BREAK mode.
void MS_CDECL | sig_handler_watt (int sig)
SIGINT/SIGBREAK handler function.
int | GetCountryCode (void)
int | GetCodePage (void)
void | int24_init (void)
void | int24_restore (void)
void | dputch (char x)
void | dmsg (const char *s)
void | dhex1int (int x)
void | dhex2int (int x)
void | dhex4int (int x)
void | dhex8int (DWORD x)
BOOL | crc_init (void)
DWORD | crc_bytes (const char *buf, size_t len)
const char * | short_strerror (int errnum)
void | intr (int int_no, IREGS *regs)
void | STACK_SET (void far *stack)
void | STACK_RESTORE (void)
void | PUSHF_CLI (void)
void | POPF (void)
void | STACK_SET (void *stack)
WORD | watcom_MY_CS (void)
WORD | watcom_MY_DS (void)
DWORD | GET_LIMIT (WORD sel)
DWORD | get_ds_limit (void)
DWORD | get_cs_limit (void)
DWORD | get_ss_limit (void)
typedef | void (cdecl interrupt *W32_IntrHandler)()
W32_GCC_INLINE WORD | get_fs_reg (void)
W32_GCC_INLINE WORD | get_gs_reg (void)
W32_GCC_INLINE void | set_fs_reg (WORD sel)
W32_GCC_INLINE void | set_gs_reg (WORD sel)

Variables

const char | hex_chars_lower []
const char | hex_chars_upper []
BOOL | win32_dos_box
BOOL | _watt_fatal_error
BOOL | _watt_crtdbg_check
WORD | _watt_os_ver
char | _watt_assert_buf [256]
HANDLE | stdin_hnd
HANDLE | stdout_hnd
BOOL | _watt_is_win9x
BOOL | _watt_is_wow64
BOOL | _watt_is_gui_app
BOOL | _watt_use_bugtrap
CONSOLE_SCREEN_BUFFER_INFO | console_info
WORD | _watt_handle_cbreak
Turn off stack-checking here because stack may be out of bounds.
volatile int | _watt_cbroke
BYTE | dbg_colour
WORD | dbg_scrpos
WORD | dbg_scrstart
DWORD * | crc_table
int | pull_neterr_module

Typedef Documentation

◆ CmpFunc

typedef int(MS_CDECL * CmpFunc) (const void *, const void *)

Definition at line 254 of file misc.h.

◆ W32_IntrHandler

typedef void(* W32_IntrHandler)(int)

Definition at line 895 of file misc.h.

Function Documentation

◆ assert_fail()

void assert_fail | ( | const char * | file,
 |  | unsigned | line,
 |  | const char * | what
 | ) |  |

Store the "assert fail" text for later before printing it.

Definition at line 653 of file misc.c.

References _watt_assert_buf, _watt_fatal_error, and win_strerror().

◆ crc_bytes()

DWORD crc_bytes | ( | const char * | buf,
 |  | size_t | len
 | ) |  |

Definition at line 78 of file crc.c.

◆ crc_init()

BOOL crc_init ( void )

Definition at line 87 of file crc.c.

◆ ctime_r()

char * ctime_r | ( | const time_t * | t,
 |  | char * | res
 | ) |  |

A reentrant ctime().

Definition at line 887 of file misc.c.

◆ dhex1int()

void dhex1int ( int x )

Definition at line 61 of file qmsg.c.

◆ dhex2int()

void dhex2int ( int x )

Definition at line 70 of file qmsg.c.

◆ dhex4int()

void dhex4int ( int x )

Definition at line 77 of file qmsg.c.

◆ dhex8int()

void dhex8int ( DWORD x )

Definition at line 84 of file qmsg.c.

◆ dmsg()

void dmsg ( const char * s )

Definition at line 55 of file qmsg.c.

◆ dos_extender_name()

const char * dos_extender_name ( void )

Definition at line 794 of file misc.c.

◆ dputch()

void dputch ( char x )

Definition at line 33 of file qmsg.c.

◆ dword_str()

const char * dword_str ( DWORD val )

Return nicely formatted string "xx,xxx,xxx" with thousand separators (left adjusted).

Definition at line 1022 of file misc.c.

References strltrim().

◆ fopen_excl()

FILE * fopen_excl | ( | const char * | file,
 |  | const char * | mode
 | ) |  |

WIN32: Open an existing file (or create) in share-mode but deny other processes to write to the file.

On Watcom, fopen() already seems to open with SH_DENYWR internally.

MSDOS/Watcom/CygWin: simply call fopen().

Definition at line 453 of file misc.c.

◆ get_cs_limit()

DWORD get_cs_limit ( void )

Definition at line 1109 of file misc.c.

◆ get_day_num()

DWORD get_day_num ( void )

Simplified method of getting days since 1970-01-01.

Don't use time() since it will probably link in sprintf(). We don't need accuracy. Only a reference for sock_stats().

Definition at line 222 of file misc.c.

◆ get_ds_limit()

DWORD get_ds_limit ( void )

Definition at line 1099 of file misc.c.

◆ get_file_version()

BOOL get_file_version | ( | const char * | file,
 |  | char * | buf,
 |  | size_t | buf_len
 | ) |  |

Returns the version of a PE image (.sys, .dll or .exe).

Definition at line 227 of file winmisc.c.

References win_strerror().

◆ get_fs_reg()

W32_GCC_INLINE WORD get_fs_reg ( void )

Definition at line 954 of file misc.h.

◆ get_gs_reg()

W32_GCC_INLINE WORD get_gs_reg ( void )

Definition at line 962 of file misc.h.

◆ get_ss_limit()

DWORD get_ss_limit ( void )

Definition at line 1119 of file misc.c.

◆ getch()

int getch ( void )

Definition at line 916 of file winmisc.c.

◆ GetCodePage()

int GetCodePage ( void )

Definition at line 111 of file country.c.

◆ GetCountryCode()

int GetCountryCode ( void )

Definition at line 53 of file country.c.

◆ init_win_misc()

BOOL init_win_misc ( void )

Definition at line 410 of file winmisc.c.

◆ int24_init()

void int24_init ( void )

Definition at line 79 of file crit.c.

◆ int24_restore()

void int24_restore ( void )

Definition at line 69 of file crit.c.

◆ itoa()

char * itoa | ( | int | val,
 |  | char * | buf,
 |  | int | radix
 | ) |  |

Definition at line 937 of file winmisc.c.

◆ kbhit()

int kbhit ( void )

Definition at line 876 of file winmisc.c.

◆ list_lookup()

const char * list_lookup | ( | DWORD | type,
 |  | const struct search_list * | list,
 |  | int | num
 | ) |  |

Search 'list' for 'type' and return it's name.

Definition at line 963 of file misc.c.

◆ list_lookupX()

const char * list_lookupX | ( | DWORD | type,
 |  | const struct search_list * | list,
 |  | int | num
 | ) |  |

Definition at line 978 of file misc.c.

◆ localtime_r()

struct tm * localtime_r | ( | const time_t * | t,
 |  | struct tm * | res
 | ) |  |

A reentrant localtime().

Definition at line 900 of file misc.c.

◆ MAC_address()

const char * MAC_address ( const void * addr )

Return hexa-decimal string for an 6/7 byte MAC-address.

Use 2 buffers in round-robin.

Definition at line 997 of file misc.c.

References _pktdevclass.

◆ memdbg_init()

void memdbg_init ( void )

Definition at line 595 of file misc.c.

◆ memdbg_post_init()

void memdbg_post_init ( void )

Definition at line 634 of file misc.c.

◆ os_yield()

void os_yield ( void )

Definition at line 823 of file misc.c.

◆ print_perf_times()

void print_perf_times ( void )

Definition at line 1083 of file winmisc.c.

◆ print_process_times()

void print_process_times ( void )

Definition at line 1024 of file winmisc.c.

◆ print_thread_times()

void print_thread_times ( HANDLE thread )

Definition at line 987 of file winmisc.c.

◆ qword_str()

const char * qword_str ( uint64 val )

The same as above.

But for a QWORD (64-bit unsigned). Assume given 'val' is 64-bit signed if 'val' > LLONG_MAX'.

Definition at line 1053 of file misc.c.

◆ set_cbreak()

int set_cbreak ( int want_brk )

Sets normal and extended BREAK mode.

  • want_brk 0x0000: no ^BREAK checking.
  • want_brk 0x0001: normal ^BREAK checks.
  • want_brk 0x0101: extended ^BREAK checks.
Return values
normal BREAK state in LSB, extended BREAK state in MSB.

Definition at line 130 of file pc_cbrk.c.

◆ set_fs_reg()

W32_GCC_INLINE void set_fs_reg ( WORD sel )

Definition at line 970 of file misc.h.

◆ set_gs_reg()

W32_GCC_INLINE void set_gs_reg ( WORD sel )

Definition at line 976 of file misc.h.

◆ short_strerror()

const char * short_strerror ( int errnum )

Definition at line 291 of file neterr.c.

◆ sig_handler_watt()

void MS_CDECL sig_handler_watt ( int sig )

SIGINT/SIGBREAK handler function.

The Windows runtime docs at http://msdn.microsoft.com/library/en-us/vclib/html/_crt_signal.asp specifically forbid a number of things being done from a signal handler, including IO, memory allocation and system calls, and only allow jmpbuf if you are handling SIGFPE.

Hence sig_handler_watt() on Win32 simply increments the '_watt_cbroke' variable.

Also note the behaviour of Windows with SIGINT, which says this: Note SIGINT is not supported for any Win32 application, including Windows 98/Me and Windows NT/2000/XP. When a CTRL+C interrupt occurs, Win32 operating systems generate a new thread to specifically handle that interrupt. This can cause a single-thread application such as UNIX, to become multithreaded, resulting in unexpected behavior.

So a longjmp() from handler-thread to main-thread is out of the question.

Definition at line 74 of file pc_cbrk.c.

References _watt_cbroke, _watt_handle_cbreak, set_cbreak(), and sig_handler_watt().

◆ strtok_r()

char * strtok_r | ( | char * | ptr,
 |  | const char * | sep,
 |  | char ** | end
 | ) |  |

Definition at line 371 of file misc_str.c.

◆ tcp_cbreak_off()

BOOL tcp_cbreak_off ( void )

Definition at line 253 of file pc_cbrk.c.

◆ unfinished()

void unfinished | ( | const char * | func,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Definition at line 1082 of file misc.c.

◆ unimplemented()

void unimplemented | ( | const char * | func,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Definition at line 1090 of file misc.c.

◆ valid_addr()

BOOL valid_addr | ( | const void * | addr,
 |  | unsigned | len
 | ) |  |

Definition at line 1137 of file misc.c.

◆ Wait()

void Wait ( unsigned msec )

Not all vendors have delay().

Definition at line 777 of file misc.c.

References chk_timeout(), and set_timeout().

◆ watt_large_check()

void watt_large_check | ( | const void * | sock,
 |  | int | size,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Definition at line 1382 of file misc.c.

◆ WinDnsCachePut_A4()

BOOL WinDnsCachePut_A4 | ( | const char * | name,
 |  | DWORD | ip4
 | ) |  |

Definition at line 602 of file winmisc.c.

◆ WinDnsCachePut_A6()

BOOL WinDnsCachePut_A6 | ( | const char * | name,
 |  | const void * | ip6
 | ) |  |

Definition at line 642 of file winmisc.c.

◆ WinDnsQuery_A4()

BOOL WinDnsQuery_A4 | ( | const char * | name,
 |  | DWORD * | ip4
 | ) |  |

Definition at line 543 of file winmisc.c.

◆ WinDnsQuery_A6()

BOOL WinDnsQuery_A6 | ( | const char * | name,
 |  | void * | ip6
 | ) |  |

Definition at line 556 of file winmisc.c.

Variable Documentation

◆ _watt_assert_buf

char _watt_assert_buf[256]
extern

Print this in dbug_exit()

Definition at line 75 of file misc.c.

◆ _watt_cbroke

volatile int _watt_cbroke
extern

increment on SIGINT catch

Definition at line 48 of file pc_cbrk.c.

◆ _watt_crtdbg_check

BOOL _watt_crtdbg_check
extern

MSVC/_DEBUG only. See below

Definition at line 72 of file misc.c.

◆ _watt_fatal_error

BOOL _watt_fatal_error
extern

We're exiting via an exception handler

Definition at line 73 of file misc.c.

◆ _watt_handle_cbreak

WORD _watt_handle_cbreak
extern

Turn off stack-checking here because stack may be out of bounds.

longjmp() hopefully fixes that. changes operation of the break stuff

Definition at line 47 of file pc_cbrk.c.

◆ _watt_is_gui_app

BOOL _watt_is_gui_app
extern

Definition at line 52 of file winmisc.c.

◆ _watt_is_win9x

BOOL _watt_is_win9x
extern

Process is running under Win9x/ME.

Definition at line 49 of file winmisc.c.

◆ _watt_is_wow64

BOOL _watt_is_wow64

Definition at line 289 of file misc.h.

◆ _watt_os_ver

WORD _watt_os_ver
extern

True DOS/WinNT version MSB.LSB

Definition at line 74 of file misc.c.

◆ _watt_use_bugtrap

BOOL _watt_use_bugtrap

Definition at line 290 of file misc.h.

◆ console_info

CONSOLE_SCREEN_BUFFER_INFO console_info
extern

Definition at line 57 of file winmisc.c.

◆ crc_table

DWORD* crc_table
extern

Definition at line 35 of file crc.c.

◆ dbg_colour

BYTE dbg_colour
extern

Definition at line 27 of file qmsg.c.

◆ dbg_scrpos

WORD dbg_scrpos
extern

Definition at line 28 of file qmsg.c.

◆ dbg_scrstart

WORD dbg_scrstart
extern

Definition at line 29 of file qmsg.c.

◆ hex_chars_lower

const char hex_chars_lower[]
extern

Definition at line 68 of file misc.c.

◆ hex_chars_upper

const char hex_chars_upper[]
extern

Definition at line 69 of file misc.c.

◆ pull_neterr_module

int pull_neterr_module
extern

Definition at line 171 of file neterr.c.

◆ stdin_hnd

HANDLE stdin_hnd
extern

Definition at line 54 of file winmisc.c.

◆ stdout_hnd

HANDLE stdout_hnd

Definition at line 288 of file misc.h.

◆ win32_dos_box

BOOL win32_dos_box
extern

Running under Windows DOS-box

Definition at line 71 of file misc.c.


Watt-32 tcp/ip: E:/WATT/src/misc_str.c File Reference

  • src
Functions
misc_str.c File Reference

Go to the source code of this file.

Functions

void | _outchar (char c)
static int W32_CALL | outch (char chr)
int (W32_CALL *_outch)(char c) = NULL
int (MS_CDECL *_printf)(const char *
static int MS_CDECL | empty_printf (const char *fmt,...)
void W32_CALL | outs (const char *s)
void W32_CALL | outsnl (const char *s)
void W32_CALL | outsn (const char *s, int n)
void W32_CALL | outhex (char c)
void W32_CALL | outhexes (const char *s, int n)
char *W32_CALL | rip (char *s)
Removes end-of-line termination from a string.
BYTE | atox (const char *hex)
Convert hexstring "0x??" to hex.
char * | strreplace (int ch1, int ch2, char *str)
Replace 'ch1' to 'ch2' in string 'str'.
char * | _strlcpy (char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
char * | strltrim (char *s)
Return pointer to first non-blank (space/tab) in a string.
char * | strrtrim (char *s)
Return pointer to string with trailing blanks (space/tab) removed.
char * | strtrim (const char *orig, char *dest, size_t len)
Copy a string (to 'dest') with all excessive blanks (space/tab) removed.
char * | strreverse (char *str)
size_t | strntrimcpy (char *dst, const char *src, size_t n)
Copy a string, stripping leading and trailing blanks (space/tab).
char * | strtok_r (char *ptr, const char *sep, char **end)
int | isstring (const char *str, size_t len)
static const char * | wide_string (const wchar_t *in_str, UINT cp)
static const wchar_t * | ascii_string (const char *in_str, UINT cp)
const wchar_t * | astring_acp (const char *in_str)
const wchar_t * | astring_utf8 (const char *in_str)
const char * | wstring_acp (const wchar_t *in_str)
const char * | wstring_utf8 (const wchar_t *in_str)

Detailed Description

Printing to console and general string handling.

Definition in file misc_str.c.

Function Documentation

◆ _strlcpy()

char * _strlcpy | ( | char * | dst,
 |  | const char * | src,
 |  | size_t | len
 | ) |  |

Similar to strncpy(), but always returns 'dst' with 0-termination.

Definition at line 230 of file misc_str.c.

◆ ascii_string()

static const wchar_t * ascii_string | ( | const char * | in_str,
 |  | UINT | cp
 | ) |  |
static

Definition at line 443 of file misc_str.c.

◆ astring_acp()

const wchar_t * astring_acp ( const char * in_str )

Definition at line 456 of file misc_str.c.

◆ astring_utf8()

const wchar_t * astring_utf8 ( const char * in_str )

Definition at line 461 of file misc_str.c.

◆ atox()

BYTE atox ( const char * hex )

Convert hexstring "0x??" to hex.

Just assumes "??" are in the [0-9,a-fA-F] range. Don't call atox() unless they are or before checking for a "0x" prefix.

Definition at line 199 of file misc_str.c.

◆ empty_printf()

static int MS_CDECL empty_printf | ( | const char * | fmt,
 |  |  | ...
 | ) |  |
static

Definition at line 115 of file misc_str.c.

◆ isstring()

int isstring | ( | const char * | str,
 |  | size_t | len
 | ) |  |

Definition at line 410 of file misc_str.c.

◆ outch()

static int W32_CALL outch ( char chr )
static

Definition at line 40 of file misc_str.c.

◆ outhex()

void W32_CALL outhex ( char c )

Definition at line 152 of file misc_str.c.

◆ outhexes()

void W32_CALL outhexes | ( | const char * | s,
 |  | int | n
 | ) |  |

Definition at line 171 of file misc_str.c.

◆ outs()

void W32_CALL outs ( const char * s )

Definition at line 126 of file misc_str.c.

◆ outsn()

void W32_CALL outsn | ( | const char * | s,
 |  | int | n
 | ) |  |

Definition at line 142 of file misc_str.c.

◆ outsnl()

void W32_CALL outsnl ( const char * s )

Definition at line 136 of file misc_str.c.

◆ rip()

char *W32_CALL rip ( char * s )

Removes end-of-line termination from a string.

Removes "\n" (Unix), "\r" (MacOS) or "\r\n" (DOS/net-ascii) terminations, but not single "\n\r" (who uses that?).

Definition at line 185 of file misc_str.c.

◆ strltrim()

char * strltrim ( char * s )

Return pointer to first non-blank (space/tab) in a string.

Definition at line 250 of file misc_str.c.

◆ strntrimcpy()

size_t strntrimcpy | ( | char * | dst,
 |  | const char * | src,
 |  | size_t | n
 | ) |  |

Copy a string, stripping leading and trailing blanks (space/tab).

Note
This function does not work exactly like strncpy(), in that it expects the destination buffer to be at last (n+1) chars long.

Definition at line 332 of file misc_str.c.

◆ strreplace()

char * strreplace | ( | int | ch1,
 |  | int | ch2,
 |  | char * | str
 | ) |  |

Replace 'ch1' to 'ch2' in string 'str'.

Definition at line 212 of file misc_str.c.

◆ strreverse()

char * strreverse ( char * str )

Definition at line 313 of file misc_str.c.

◆ strrtrim()

char * strrtrim ( char * s )

Return pointer to string with trailing blanks (space/tab) removed.

Definition at line 262 of file misc_str.c.

◆ strtok_r()

char * strtok_r | ( | char * | ptr,
 |  | const char * | sep,
 |  | char ** | end
 | ) |  |

Definition at line 371 of file misc_str.c.

◆ strtrim()

char * strtrim | ( | const char * | orig,
 |  | char * | dest,
 |  | size_t | len
 | ) |  |

Copy a string (to 'dest') with all excessive blanks (space/tab) removed.

Definition at line 287 of file misc_str.c.

◆ wide_string()

static const char * wide_string | ( | const wchar_t * | in_str,
 |  | UINT | cp
 | ) |  |
static

Definition at line 431 of file misc_str.c.

◆ wstring_acp()

const char * wstring_acp ( const wchar_t * in_str )

Definition at line 466 of file misc_str.c.

◆ wstring_utf8()

const char * wstring_utf8 ( const wchar_t * in_str )

Definition at line 471 of file misc_str.c.


Watt-32 tcp/ip: E:/WATT/src/misc_str.h File Reference

  • src
Functions
misc_str.h File Reference

Go to the source code of this file.

Functions

char * | _strlcpy (char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
char * | strreplace (int ch1, int ch2, char *str)
Replace 'ch1' to 'ch2' in string 'str'.
size_t | strntrimcpy (char *dst, const char *src, size_t len)
Copy a string, stripping leading and trailing blanks (space/tab).
char * | strrtrim (char *src)
Return pointer to string with trailing blanks (space/tab) removed.
char * | strltrim (char *src)
Return pointer to first non-blank (space/tab) in a string.
char * | strtrim (const char *orig, char *dest, size_t len)
Copy a string (to 'dest') with all excessive blanks (space/tab) removed.
char * | strreverse (char *src)
BYTE | atox (const char *src)
Convert hexstring "0x??" to hex.
const char * | wstring_acp (const wchar_t *in_str)
const char * | wstring_utf8 (const wchar_t *in_str)
const wchar_t * | astring_acp (const char *in_str)
const wchar_t * | astring_utf8 (const char *in_str)

Function Documentation

◆ _strlcpy()

char * _strlcpy | ( | char * | dst,
 |  | const char * | src,
 |  | size_t | len
 | ) |  |

Similar to strncpy(), but always returns 'dst' with 0-termination.

Definition at line 230 of file misc_str.c.

◆ astring_acp()

const wchar_t * astring_acp ( const char * in_str )

Definition at line 456 of file misc_str.c.

◆ astring_utf8()

const wchar_t * astring_utf8 ( const char * in_str )

Definition at line 461 of file misc_str.c.

◆ atox()

BYTE atox ( const char * hex )

Convert hexstring "0x??" to hex.

Just assumes "??" are in the [0-9,a-fA-F] range. Don't call atox() unless they are or before checking for a "0x" prefix.

Definition at line 199 of file misc_str.c.

◆ strltrim()

char * strltrim ( char * src )

Return pointer to first non-blank (space/tab) in a string.

Definition at line 250 of file misc_str.c.

◆ strntrimcpy()

size_t strntrimcpy | ( | char * | dst,
 |  | const char * | src,
 |  | size_t | n
 | ) |  |

Copy a string, stripping leading and trailing blanks (space/tab).

Note
This function does not work exactly like strncpy(), in that it expects the destination buffer to be at last (n+1) chars long.

Definition at line 332 of file misc_str.c.

◆ strreplace()

char * strreplace | ( | int | ch1,
 |  | int | ch2,
 |  | char * | str
 | ) |  |

Replace 'ch1' to 'ch2' in string 'str'.

Definition at line 212 of file misc_str.c.

◆ strreverse()

char * strreverse ( char * src )

Definition at line 313 of file misc_str.c.

◆ strrtrim()

char * strrtrim ( char * src )

Return pointer to string with trailing blanks (space/tab) removed.

Definition at line 262 of file misc_str.c.

◆ strtrim()

char * strtrim | ( | const char * | orig,
 |  | char * | dest,
 |  | size_t | len
 | ) |  |

Copy a string (to 'dest') with all excessive blanks (space/tab) removed.

Definition at line 287 of file misc_str.c.

◆ wstring_acp()

const char * wstring_acp ( const wchar_t * in_str )

Definition at line 466 of file misc_str.c.

◆ wstring_utf8()

const char * wstring_utf8 ( const wchar_t * in_str )

Definition at line 471 of file misc_str.c.


Watt-32 tcp/ip: E:/WATT/src/netaddr.c File Reference

  • src
Functions
netaddr.c File Reference

Go to the source code of this file.

Functions

char *W32_CALL | _inet_ntoa (char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
DWORD W32_CALL | _inet_addr (const char *s)
Convert a string into an IP-address.
DWORD W32_CALL | aton (const char *str)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
DWORD W32_CALL | aton_dotless (const char *str)
Converts ‘[dotless]’ or ‘dotless’ to 32 bit long (host order)
BOOL W32_CALL | isaddr (const char *str)
Check if 'str' is simply an ip address.
BOOL W32_CALL | isaddr_dotless (const char *str, DWORD *ip)
Check if 'str' is a dotless ip address.
char *W32_CALL | inet_ntoa (struct in_addr addr)
const char * | _inet_atoeth (const char *src, eth_address *p_eth)
Parse string "ether-addr, ip-addr".
char *W32_CALL | inet_ntoa_r (struct in_addr addr, char *buf, int buflen)
int W32_CALL | inet_aton (const char *name, struct in_addr *addr)
u_long W32_CALL | inet_addr (const char *addr)
u_long W32_CALL | inet_network (const char *name)
u_long W32_CALL | inet_netof (struct in_addr addr)
Return the network number from an internet address; handles class A/B/C network #'s.
u_long W32_CALL | inet_lnaof (struct in_addr addr)
Return the local network address portion of an internet address; handles class A/B/C network number formats only.
struct in_addr W32_CALL | inet_makeaddr (u_long net, u_long host)
Formulate an Internet address from network + host (with subnet address).
const char * | _inet6_ntoa (const void *ip)
Convert an IPv6-address 'ip' into a string.
const ip6_address * | _inet6_addr (const char *str)
Convert a string 'str' into an IPv6-address.
int W32_CALL | ascii2addr (int af, const char *ascii, void *result)
char *W32_CALL | addr2ascii (int af, const void *addrp, int len, char *buf)
BOOL W32_CALL | priv_addr (DWORD ip)
int | mask_len (DWORD mask)
static DWORD | bit_set (DWORD v)
int | check_mask (DWORD mask)
int | check_mask2 (const char *mask)

Detailed Description

Provide some more BSD address functions. Gisle Vanem, Oct 12, 1995

inet_network() is Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved.

ascii2address() and addr2ascii() are Copyright 1996 Massachusetts Institute of Technology

Version
v0.0
Date
Jan 11, 1991
Author
E. Engelke
Version
v0.2
Date
Apr 10, 1995
Author
G. Vanem, function priv_addr()
Version
v0.3
Date
Nov 12, 2003
Author
G. Vanem, some functions moved from now obsolete udp_nds.c.

Definition in file netaddr.c.

Function Documentation

◆ _inet6_addr()

const ip6_address * _inet6_addr ( const char * str )

Convert a string 'str' into an IPv6-address.

Return values
static | buffer for address.
NULL | 'str' isn't a valid IPv6 address.

Definition at line 419 of file netaddr.c.

References inet_pton().

◆ _inet6_ntoa()

const char * _inet6_ntoa ( const void * ip )

Convert an IPv6-address 'ip' into a string.

Return values
static string.
Warning
Not reentrant.

Definition at line 401 of file netaddr.c.

References inet_ntop().

◆ _inet_addr()

DWORD W32_CALL _inet_addr ( const char * s )

Convert a string into an IP-address.

Return values
address | on host order.
0 | string isn't a (dotless) address.

Definition at line 70 of file netaddr.c.

References aton(), isaddr(), and isaddr_dotless().

◆ _inet_atoeth()

const char * _inet_atoeth | ( | const char * | src,
 |  | eth_address * | p_eth
 | ) |  |

Parse string "ether-addr, ip-addr".

DOSX == 0: Assumes 'src' contain only legal hex-codes and ':' separators (or '-' too for DOSX). Doesn't waste precious memory using sscanf() if DOSX==0.

Read 'src', dump to ethernet buffer ('*p_eth') and return pointer to "ip-addr".

Definition at line 205 of file netaddr.c.

References atox(), and strltrim().

◆ _inet_ntoa()

char *W32_CALL _inet_ntoa | ( | char * | s,
 |  | DWORD | ip
 | ) |  |

Convert an IP-address 'ip' into a string.

Return values
'p'.
Note
'ip' is on host order. Use 4 buffers in round-robin.

Definition at line 44 of file netaddr.c.

◆ addr2ascii()

char *W32_CALL addr2ascii | ( | int | af,
 |  | const void * | addrp,
 |  | int | len,
 |  | char * | buf
 | ) |  |

Definition at line 480 of file netaddr.c.

◆ ascii2addr()

int W32_CALL ascii2addr | ( | int | af,
 |  | const char * | ascii,
 |  | void * | result
 | ) |  |

Definition at line 431 of file netaddr.c.

◆ aton()

DWORD W32_CALL aton ( const char * str )

Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.

Return values
0 | on error (safer than -1)
IPv4 | address (host order)

Definition at line 86 of file netaddr.c.

◆ aton_dotless()

DWORD W32_CALL aton_dotless ( const char * str )

Converts ‘[dotless]’ or ‘dotless’ to 32 bit long (host order)

Return values
0 on error (safer than -1)

Definition at line 115 of file netaddr.c.

References isaddr_dotless().

◆ bit_set()

static DWORD bit_set ( DWORD v )
static

Definition at line 584 of file netaddr.c.

◆ check_mask()

int check_mask ( DWORD mask )

Definition at line 610 of file netaddr.c.

◆ check_mask2()

int check_mask2 ( const char * mask )

Definition at line 621 of file netaddr.c.

◆ inet_addr()

u_long W32_CALL inet_addr ( const char * addr )

Definition at line 264 of file netaddr.c.

◆ inet_aton()

int W32_CALL inet_aton | ( | const char * | name,
 |  | struct in_addr * | addr
 | ) |  |

Definition at line 254 of file netaddr.c.

◆ inet_lnaof()

u_long W32_CALL inet_lnaof ( struct in_addr addr )

Return the local network address portion of an internet address; handles class A/B/C network number formats only.

Note
return value is host-order.

Definition at line 360 of file netaddr.c.

◆ inet_makeaddr()

struct in_addr W32_CALL inet_makeaddr | ( | u_long | net,
 |  | u_long | host
 | ) |  |

Formulate an Internet address from network + host (with subnet address).

Note
'net' is on host-order.

Definition at line 377 of file netaddr.c.

◆ inet_netof()

u_long W32_CALL inet_netof ( struct in_addr addr )

Return the network number from an internet address; handles class A/B/C network #'s.

Definition at line 341 of file netaddr.c.

◆ inet_network()

u_long W32_CALL inet_network ( const char * name )

Definition at line 273 of file netaddr.c.

◆ inet_ntoa()

char *W32_CALL inet_ntoa ( struct in_addr addr )

Definition at line 185 of file netaddr.c.

◆ inet_ntoa_r()

char *W32_CALL inet_ntoa_r | ( | struct in_addr | addr,
 |  | char * | buf,
 |  | int | buflen
 | ) |  |

Definition at line 247 of file netaddr.c.

◆ isaddr()

BOOL W32_CALL isaddr ( const char * str )

Check if 'str' is simply an ip address.

Accepts 'a.b.c.d' or '[a.b.c.d]' forms.

Return values
TRUE if 'str' is an IPv4 address.

Definition at line 128 of file netaddr.c.

◆ isaddr_dotless()

BOOL W32_CALL isaddr_dotless | ( | const char * | str,
 |  | DWORD * | ip
 | ) |  |

Check if 'str' is a dotless ip address.

Accept "[ 0-9\[\]]+". Doesn't accept octal base.

Return values
TRUE if 'str' is a dotless address.

Definition at line 148 of file netaddr.c.

◆ mask_len()

int mask_len ( DWORD mask )

Definition at line 552 of file netaddr.c.

◆ priv_addr()

BOOL W32_CALL priv_addr ( DWORD ip )

Check if 'ip' is a private addresses in the "black-hole range" (ref. RFC-1918):

10.0.0.0 - 10.255.255.255 172.16.0.0 - 172.31.255.255 192.168.0.0 - 192.168.255.255

Todo:
: rewrite using mask_len().

Definition at line 516 of file netaddr.c.

References aton().


Watt-32 tcp/ip: E:/WATT/src/netaddr.h File Reference

  • src
Functions
netaddr.h File Reference

Go to the source code of this file.

Functions

int | mask_len (DWORD mask)
int | check_mask (DWORD mask)
int | check_mask2 (const char *mask)
const char * | _inet_atoeth (const char *src, eth_address *eth)
Parse string "ether-addr, ip-addr".
const char * | _inet6_ntoa (const void *ip)
Convert an IPv6-address 'ip' into a string.
const ip6_address * | _inet6_addr (const char *str)
Convert a string 'str' into an IPv6-address.

Function Documentation

◆ _inet6_addr()

const ip6_address * _inet6_addr ( const char * str )

Convert a string 'str' into an IPv6-address.

Return values
static | buffer for address.
NULL | 'str' isn't a valid IPv6 address.

Definition at line 419 of file netaddr.c.

References inet_pton().

◆ _inet6_ntoa()

const char * _inet6_ntoa ( const void * ip )

Convert an IPv6-address 'ip' into a string.

Return values
static string.
Warning
Not reentrant.

Definition at line 401 of file netaddr.c.

References inet_ntop().

◆ _inet_atoeth()

const char * _inet_atoeth | ( | const char * | src,
 |  | eth_address * | p_eth
 | ) |  |

Parse string "ether-addr, ip-addr".

DOSX == 0: Assumes 'src' contain only legal hex-codes and ':' separators (or '-' too for DOSX). Doesn't waste precious memory using sscanf() if DOSX==0.

Read 'src', dump to ethernet buffer ('*p_eth') and return pointer to "ip-addr".

Definition at line 205 of file netaddr.c.

References atox(), and strltrim().

◆ check_mask()

int check_mask ( DWORD mask )

Definition at line 610 of file netaddr.c.

◆ check_mask2()

int check_mask2 ( const char * mask )

Definition at line 621 of file netaddr.c.

◆ mask_len()

int mask_len ( DWORD mask )

Definition at line 552 of file netaddr.c.


Watt-32 tcp/ip: E:/WATT/src/netback.c File Reference

  • src
Functions | Variables
netback.c File Reference

Go to the source code of this file.

Functions

void | backgroundon (void)
static INTR_PROTOTYPE | newinterrupt (void)
void | backgroundoff (void)
void | backgroundfn (void(*fn)(void))

Variables

static void(* | user_routine )(void) = NULL
static int | inside = 0
static W32_IntrHandler | oldinterrupt

Detailed Description

Deprecated:
Background ISR.

Definition in file netback.c.

Function Documentation

◆ backgroundfn()

void backgroundfn ( void(*)(void) fn )

Definition at line 86 of file netback.c.

◆ backgroundoff()

void backgroundoff ( void )

Definition at line 81 of file netback.c.

◆ backgroundon()

void backgroundon ( void )

Definition at line 19 of file netback.c.

◆ newinterrupt()

static INTR_PROTOTYPE newinterrupt ( void )
static

Definition at line 32 of file netback.c.

Variable Documentation

◆ inside

int inside = 0
static

Definition at line 28 of file netback.c.

◆ oldinterrupt

W32_IntrHandler oldinterrupt
static

Definition at line 30 of file netback.c.

◆ user_routine

void(* user_routine) (void) ( void ) = NULL
static

Definition at line 27 of file netback.c.


Watt-32 tcp/ip: E:/WATT/src/neterr.c File Reference

  • src
Functions | Variables
neterr.c File Reference

Go to the source code of this file.

Functions

void MS_CDECL | perror (const char *str)
char *MS_CDECL | strerror (int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (i.e.
int __stdcall | WSAGetLastError (void)
void __stdcall | WSASetLastError (int err)
const char * | short_strerror (int errnum)
void W32_CALL | perror_s (const char *str)
char *W32_CALL | strerror_s_ (int errnum)

Variables

char | __syserr00 [] = "No Error"
char | __syserr000 [] = "No Error"
char | __syserr37 [] = "No Error"
int | pull_neterr_module = 0
int | _w32_sys_nerr = 120
int DATA_MOD | SYS_NERR = DIM(SYS_ERRLIST2)
int * | _sys_nerr_dll = &_w32_sys_nerr
int * | _imp___sys_nerr = &_w32_sys_nerr

Detailed Description

sys_errlist[] with BSD-socket support.

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

05.jan 1998 (GV) - Created

This module tries to add network related errno/strerror/perror for all supported Watt-32 targets.

Definition in file neterr.c.

Function Documentation

◆ perror()

void MS_CDECL perror ( const char * str )

Definition at line 191 of file neterr.c.

◆ perror_s()

void W32_CALL perror_s ( const char * str )

Definition at line 316 of file neterr.c.

◆ short_strerror()

const char * short_strerror ( int errnum )

Definition at line 291 of file neterr.c.

◆ strerror()

char *MS_CDECL strerror ( int errnum )

For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (i.e.

*_sys_nerr_dll) should give the same effect (?).

Definition at line 207 of file neterr.c.

References _strlcpy().

◆ strerror_s_()

char *W32_CALL strerror_s_ ( int errnum )

Definition at line 321 of file neterr.c.

◆ WSAGetLastError()

int __stdcall WSAGetLastError ( void )

Definition at line 233 of file neterr.c.

◆ WSASetLastError()

void __stdcall WSASetLastError ( int err )

Definition at line 240 of file neterr.c.

Variable Documentation

◆ __syserr00

char __syserr00[] = "No Error"

Definition at line 45 of file neterr.c.

◆ __syserr000

char __syserr000[] = "No Error"

Definition at line 46 of file neterr.c.

◆ __syserr37

char __syserr37[] = "No Error"

Definition at line 100 of file neterr.c.

◆ _imp___sys_nerr

int* _imp___sys_nerr = &_w32_sys_nerr

Definition at line 187 of file neterr.c.

◆ _sys_nerr_dll

int* _sys_nerr_dll = &_w32_sys_nerr

Definition at line 186 of file neterr.c.

◆ _w32_sys_nerr

int _w32_sys_nerr = 120

Definition at line 177 of file neterr.c.

◆ pull_neterr_module

int pull_neterr_module = 0

Definition at line 171 of file neterr.c.

◆ SYS_NERR

int DATA_MOD SYS_NERR = DIM(SYS_ERRLIST2)

Definition at line 183 of file neterr.c.


Watt-32 tcp/ip: E:/WATT/src/nettime.c File Reference

  • src
Functions | Variables
nettime.c File Reference

Go to the source code of this file.

Functions

void | _sock_start_timer (void)
void | _sock_stop_timer (void)
static DWORD | sys_time (void)
static DWORD | usr_time (void)
unsigned long W32_CALL | net_times (struct tms *tms)

Variables

static DWORD | sock_sys_time
static DWORD | start

Detailed Description

Counts user/system time.

Definition in file nettime.c.

Function Documentation

◆ _sock_start_timer()

void _sock_start_timer ( void )

Definition at line 51 of file nettime.c.

◆ _sock_stop_timer()

void _sock_stop_timer ( void )

Definition at line 56 of file nettime.c.

◆ net_times()

unsigned long W32_CALL net_times ( struct tms * tms )

Definition at line 75 of file nettime.c.

◆ sys_time()

static DWORD sys_time ( void )
static

Definition at line 65 of file nettime.c.

◆ usr_time()

static DWORD usr_time ( void )
static

Definition at line 70 of file nettime.c.

Variable Documentation

◆ sock_sys_time

DWORD sock_sys_time
static

Definition at line 48 of file nettime.c.

◆ start

DWORD start
static

Definition at line 49 of file nettime.c.


Watt-32 tcp/ip: E:/WATT/src/nochkstk.h File Reference

  • src
nochkstk.h File Reference

Go to the source code of this file.

Detailed Description

pragmas to disable stack-checking

Definition in file nochkstk.h.


Watt-32 tcp/ip: E:/WATT/src/nsapaddr.c File Reference

  • src
Functions
nsapaddr.c File Reference

Go to the source code of this file.

Functions

static __inline char | xtob (int c)
u_int W32_CALL | inet_nsap_addr (const char *ascii, u_char *binary, int maxlen)
char *W32_CALL | inet_nsap_ntoa (int binlen, const u_char *binary, char *ascii)

Detailed Description

inet_nsap_addr(), inet_nsap_ntoa().

Definition in file nsapaddr.c.

Function Documentation

◆ inet_nsap_addr()

u_int W32_CALL inet_nsap_addr | ( | const char * | ascii,
 |  | u_char * | binary,
 |  | int | maxlen
 | ) |  |

Definition at line 30 of file nsapaddr.c.

◆ inet_nsap_ntoa()

char *W32_CALL inet_nsap_ntoa | ( | int | binlen,
 |  | const u_char * | binary,
 |  | char * | ascii
 | ) |  |

Definition at line 58 of file nsapaddr.c.

◆ xtob()

static __inline char xtob ( int c )
static

Definition at line 25 of file nsapaddr.c.


Watt-32 tcp/ip: E:/WATT/src/oldstuff.c File Reference

  • src
Functions
oldstuff.c File Reference

Go to the source code of this file.

Functions

int | tcp_cbrk (int mode)
Some deprecated functions.
unsigned long | set_ttimeout (unsigned ticks)
void W32_CALL | psocket (const sock_type *s)
void W32_CALL | sock_sturdy (sock_type *s, int level)
Keep the socket open inspite of receiving "ICMP Unreachable" For UDP or TCP socket.
int W32_CALL | resolve_ip (DWORD ip, char *name, int len)
Resolve an IP-address to a name.
W32_FUNC time_t W32_CALL | dostounix (const struct date *d, const struct time *t)
W32_FUNC void W32_CALL | unixtodos (time_t time, struct date *d, struct time *t)
WORD | inchksum (const void *ptr, int len)
WORD | _w32_inchksum (const void *ptr, int len)
W32_GCC_PRAGMA (GCC diagnostic push) W32_GCC_PRAGMA(GCC diagnostic ignored "-Wmissing-prototypes") DWORD intel(DWORD val)
Language prefix.
WORD | intel16 (WORD val)
int | main (void)

Detailed Description

Some old functions are collected here.

Definition in file oldstuff.c.

Function Documentation

◆ _w32_inchksum()

WORD _w32_inchksum | ( | const void * | ptr,
 |  | int | len
 | ) |  |

Definition at line 139 of file oldstuff.c.

◆ dostounix()

W32_FUNC time_t W32_CALL dostounix | ( | const struct date * | d,
 |  | const struct time * | t
 | ) |  |

Definition at line 93 of file oldstuff.c.

◆ inchksum()

WORD inchksum | ( | const void * | ptr,
 |  | int | len
 | ) |  |

Definition at line 130 of file oldstuff.c.

◆ intel16()

WORD intel16 ( WORD val )

Definition at line 172 of file oldstuff.c.

◆ main()

int main ( void )

Definition at line 190 of file oldstuff.c.

◆ psocket()

void W32_CALL psocket ( const sock_type * s )

Definition at line 55 of file oldstuff.c.

◆ resolve_ip()

int W32_CALL resolve_ip | ( | DWORD | ip,
 |  | char * | name,
 |  | int | len
 | ) |  |

Resolve an IP-address to a name.

Definition at line 81 of file oldstuff.c.

◆ set_ttimeout()

unsigned long set_ttimeout ( unsigned ticks )
Deprecated:
Not needed in Watt-32. Return timeout from ticks.

Definition at line 36 of file oldstuff.c.

References has_8254, and set_timeout().

◆ sock_sturdy()

void W32_CALL sock_sturdy | ( | sock_type * | s,
 |  | int | level
 | ) |  |

Keep the socket open inspite of receiving "ICMP Unreachable" For UDP or TCP socket.

Definition at line 71 of file oldstuff.c.

◆ tcp_cbrk()

int tcp_cbrk ( int mode )

Some deprecated functions.

Deprecated:
Actually simply a macro in <tcp.h>

Definition at line 27 of file oldstuff.c.

References tcp_cbreak().

◆ unixtodos()

W32_FUNC void W32_CALL unixtodos | ( | time_t | time,
 |  | struct date * | d,
 |  | struct time * | t
 | ) |  |

Definition at line 110 of file oldstuff.c.

◆ W32_GCC_PRAGMA()

W32_GCC_PRAGMA ( GCC diagnostic push )

Language prefix.

Prefix normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple yacc generated parsers in the same program. Note that these are only the variables produced by yacc. If other parser generators (bison, byacc, etc) produce additional global names that conflict at link time, then those parser generators need to be fixed instead of adding those names to this list. Possible LANG codes are according to ISO 639.

Ref. http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html

aa Afar ba Bashkir ca Catalan ab Abkhazian be Byelorussian co Corsican af Afrikaans bg Bulgarian cs Czech am Amharic bh Bihari cy Welsh ar Arabic bi Bislama as Assamese bn Bengali; Bangla da Danish ay Aymara bo Tibetan de German az Azerbaijani br Breton dz Bhutani

el Greek fa Persian ga Irish en English fi Finnish gd Scots Gaelic eo Esperanto fj Fiji gl Galician es Spanish fo Faroese gn Guarani et Estonian fr French gu Gujarati eu Basque fy Frisian

ha Hausa ia Interlingua ja Japanese he Hebrew id Indonesian jw Javanese hi Hindi ie Interlingue hr Croatian ik Inupiak hu Hungarian is Icelandic hy Armenian it Italian iu Inuktitut ka Georgian mg Malagasy kk Kazakh la Latin mi Maori kl Greenlandic ln Lingala mk Macedonian km Cambodian lo Laothian ml Malayalam kn Kannada lt Lithuanian mn Mongolian ko Korean lv Latvian, Lettish mo Moldavian ks Kashmiri mr Marathi ku Kurdish ms Malay ky Kirghiz mt Maltese my Burmese na Nauru oc Occitan ne Nepali om (Afan) Oromo pa Punjabi nl Dutch or Oriya pl Polish no Norwegian ps Pashto, Pushto pt Portuguese qu Quechua

rm Rhaeto-Romance sa Sanskrit ta Tamil rn Kirundi sd Sindhi te Telugu ro Romanian sg Sangro tg Tajik ru Russian sh Serbo-Croatian th Thai rw Kinyarwanda si Sinhalese ti Tigrinya sk Slovak tk Turkmen ug Uighur sl Slovenian tl Tagalog uk Ukrainian sm Samoan tn Setswana ur Urdu sn Shona to Tonga uz Uzbek so Somali tr Turkish sq Albanian ts Tsonga vi Vietnamese sr Serbian tt Tatar vo Volapuk ss Siswati tw Twi st Sesotho wo Wolof su Sundanese sv Swedish xh Xhosa sw Swahili

yi Yiddish (formerly ji) yo Yoruba

za Zhuang zh Chinese zu Zulu

Definition at line 160 of file oldstuff.c.


Watt-32 tcp/ip: E:/WATT/src/oui-generated.c Source File

Main Page

Related Pages

Data Structures

Files

File List

Globals

WATT

src

oui-generated.c

1/*

2 * "Organizationally Unique Identifier" list

3 * obtained from http://standards-oui.ieee.org/oui.txt.

4 *

5 * This file was generated by E:\WATT\src\make-oui.py at

6 * Sat Dec 23 07:30:36 2023.

7 * DO NOT EDIT!

8 */

9#if defined(__clang__)

10#pragma clang diagnostic ignored "-Winvalid-source-encoding"

11#endif

12

13struct tok {

14 unsigned v; /* value */

15 const char *s; /* string */

16 };

17

18const struct tok oui_values[] = {

19 { 0x000000, "XEROX CORPORATION" },

20 { 0x000001, "XEROX CORPORATION" },

21 { 0x000002, "XEROX CORPORATION" },

22 { 0x000003, "XEROX CORPORATION" },

23 { 0x000004, "XEROX CORPORATION" },

24 { 0x000005, "XEROX CORPORATION" },

25 { 0x000006, "XEROX CORPORATION" },

26 { 0x000007, "XEROX CORPORATION" },

27 { 0x000008, "XEROX CORPORATION" },

28 { 0x000009, "XEROX CORPORATION" },

29 { 0x00000A, "OMRON TATEISI ELECTRONICS CO." },

30 { 0x00000B, "MATRIX CORPORATION" },

31 { 0x00000C, "Cisco Systems, Inc" },

32 { 0x00000D, "FIBRONICS LTD." },

33 { 0x00000E, "FUJITSU LIMITED" },

34 { 0x00000F, "NEXT, INC." },

35 { 0x000010, "SYTEK INC." },

36 { 0x000011, "NORMEREL SYSTEMES" },

37 { 0x000012, "INFORMATION TECHNOLOGY LIMITED" },

38 { 0x000013, "CAMEX" },

39 { 0x000014, "NETRONIX" },

40 { 0x000015, "DATAPOINT CORPORATION" },

41 { 0x000016, "DU PONT PIXEL SYSTEMS ." },

42 { 0x000017, "Oracle" },

43 { 0x000018, "WEBSTER COMPUTER CORPORATION" },

44 { 0x000019, "APPLIED DYNAMICS INTERNATIONAL" },

45 { 0x00001A, "ADVANCED MICRO DEVICES" },

46 { 0x00001B, "Novell, Inc." },

47 { 0x00001C, "BELL TECHNOLOGIES" },

48 { 0x00001D, "Cabletron Systems, Inc." },

49 { 0x00001E, "TELSIST INDUSTRIA ELECTRONICA" },

50 { 0x00001F, "Telco Systems, Inc." },

51 { 0x000020, "DATAINDUSTRIER DIAB AB" },

52 { 0x000021, "SUREMAN COMP. & COMMUN. CORP." },

53 { 0x000022, "VISUAL TECHNOLOGY INC." },

54 { 0x000023, "ABB INDUSTRIAL SYSTEMS AB" },

55 { 0x000024, "CONNECT AS" },

56 { 0x000025, "RAMTEK CORP." },

57 { 0x000026, "SHA-KEN CO., LTD." },

58 { 0x000027, "JAPAN RADIO COMPANY" },

59 { 0x000028, "PRODIGY SYSTEMS CORPORATION" },

60 { 0x000029, "IMC NETWORKS CORP." },

61 { 0x00002A, "TRW - SEDD/INP" },

62 { 0x00002B, "CRISP AUTOMATION, INC" },

63 { 0x00002C, "AUTOTOTE LIMITED" },

64 { 0x00002D, "CHROMATICS INC" },

65 { 0x00002E, "SOCIETE EVIRA" },

66 { 0x00002F, "TIMEPLEX INC." },

67 { 0x000030, "VG LABORATORY SYSTEMS LTD" },

68 { 0x000031, "QPSX COMMUNICATIONS, LTD." },

69 { 0x000032, "Marconi plc" },

70 { 0x000033, "EGAN MACHINERY COMPANY" },

71 { 0x000034, "NETWORK RESOURCES CORPORATION" },

72 { 0x000035, "SPECTRAGRAPHICS CORPORATION" },

73 { 0x000036, "ATARI CORPORATION" },

74 { 0x000037, "OXFORD METRICS LIMITED" },

75 { 0x000038, "CSS LABS" },

76 { 0x000039, "TOSHIBA CORPORATION" },

77 { 0x00003A, "CHYRON CORPORATION" },

78 { 0x00003B, "i Controls, Inc." },

79 { 0x00003C, "AUSPEX SYSTEMS INC." },

80 { 0x00003D, "UNISYS" },

81 { 0x00003E, "SIMPACT" },

82 { 0x00003F, "SYNTREX, INC." },

83 { 0x000040, "APPLICON, INC." },

84 { 0x000041, "ICE CORPORATION" },

85 { 0x000042, "METIER MANAGEMENT SYSTEMS LTD." },

86 { 0x000043, "MICRO TECHNOLOGY" },

87 { 0x000044, "CASTELLE CORPORATION" },

88 { 0x000045, "FORD AEROSPACE & COMM. CORP." },

89 { 0x000046, "OLIVETTI NORTH AMERICA" },

90 { 0x000047, "NICOLET INSTRUMENTS CORP." },

91 { 0x000048, "Seiko Epson Corporation" },

92 { 0x000049, "APRICOT COMPUTERS, LTD" },

93 { 0x00004A, "ADC CODENOLL TECHNOLOGY CORP." },

94 { 0x00004B, "ICL DATA OY" },

95 { 0x00004C, "NEC Corporation" },

96 { 0x00004D, "DCI CORPORATION" },

97 { 0x00004E, "AMPEX CORPORATION" },

98 { 0x00004F, "LOGICRAFT, INC." },

99 { 0x000050, "RADISYS CORPORATION" },

100 { 0x000051, "HOB ELECTRONIC GMBH & CO. KG" },

101 { 0x000052, "Intrusion.com, Inc." },

102 { 0x000053, "COMPUCORP" },

103 { 0x000054, "Schneider Electric" },

104 { 0x000055, "COMMISSARIAT A L`ENERGIE ATOM." },

105 { 0x000056, "DR. B. STRUCK" },

106 { 0x000057, "SCITEX CORPORATION LTD." },

107 { 0x000058, "RACORE COMPUTER PRODUCTS INC." },

108 { 0x000059, "Hellige GMBH" },

109 { 0x00005A, "SysKonnect GmbH" },

110 { 0x00005B, "ELTEC ELEKTRONIK AG" },

111 { 0x00005C, "TELEMATICS INTERNATIONAL INC." },

112 { 0x00005D, "CS TELECOM" },

113 { 0x00005E, "ICANN, IANA Department" },

114 { 0x00005F, "Sumitomo Electric Industries, Ltd" },

115 { 0x000060, "Kontron Europe GmbH" },

116 { 0x000061, "GATEWAY COMMUNICATIONS" },

117 { 0x000062, "BULL HN INFORMATION SYSTEMS" },

118 { 0x000063, "BARCO CONTROL ROOMS GMBH" },

119 { 0x000064, "Yokogawa Digital Computer Corporation" },

120 { 0x000065, "Network General Corporation" },

121 { 0x000066, "TALARIS SYSTEMS, INC." },

122 { 0x000067, "SOFT * RITE, INC." },

123 { 0x000068, "ROSEMOUNT CONTROLS" },

124 { 0x000069, "CONCORD COMMUNICATIONS INC" },

125 { 0x00006A, "COMPUTER CONSOLES INC." },

126 { 0x00006B, "Silicon Graphics" },

127 { 0x00006C, "Private" },

128 { 0x00006D, "CRAY COMMUNICATIONS, LTD." },

129 { 0x00006E, "Artisoft Inc." },

130 { 0x00006F, "Madge Ltd." },

131 { 0x000070, "HCL LIMITED" },

132 { 0x000071, "ADRA SYSTEMS INC." },

133 { 0x000072, "MINIWARE TECHNOLOGY" },

134 { 0x000073, "SIECOR CORPORATION" },

135 { 0x000074, "RICOH COMPANY LTD." },

136 { 0x000075, "Nortel Networks" },

137 { 0x000076, "ABEKAS VIDEO SYSTEM" },

138 { 0x000077, "INTERPHASE CORPORATION" },

139 { 0x000078, "LABTAM LIMITED" },

140 { 0x000079, "NETWORTH INCORPORATED" },

141 { 0x00007A, "DANA COMPUTER INC." },

142 { 0x00007B, "RESEARCH MACHINES" },

143 { 0x00007C, "AMPERE INCORPORATED" },

144 { 0x00007D, "Oracle Corporation" },

145 { 0x00007E, "CLUSTRIX CORPORATION" },

146 { 0x00007F, "LINOTYPE-HELL AG" },

147 { 0x000080, "CRAY COMMUNICATIONS A/S" },

148 { 0x000081, "Bay Networks" },

149 { 0x000082, "LECTRA SYSTEMES SA" },

150 { 0x000083, "TADPOLE TECHNOLOGY PLC" },

151 { 0x000084, "SUPERNET" },

152 { 0x000085, "CANON INC." },

153 { 0x000086, "MEGAHERTZ CORPORATION" },

154 { 0x000087, "HITACHI, LTD." },

155 { 0x000088, "Brocade Communications Systems LLC" },

156 { 0x000089, "CAYMAN SYSTEMS INC." },

157 { 0x00008A, "DATAHOUSE INFORMATION SYSTEMS" },

158 { 0x00008B, "INFOTRON" },

159 { 0x00008C, "Alloy Computer Products (Australia) Pty Ltd" },

160 { 0x00008D, "Cryptek Inc." },

161 { 0x00008E, "SOLBOURNE COMPUTER, INC." },

162 { 0x00008F, "Raytheon" },

163 { 0x000090, "MICROCOM" },

164 { 0x000091, "ANRITSU CORPORATION" },

165 { 0x000092, "COGENT DATA TECHNOLOGIES" },

166 { 0x000093, "PROTEON INC." },

167 { 0x000094, "ASANTE TECHNOLOGIES" },

168 { 0x000095, "SONY TEKTRONIX CORP." },

169 { 0x000096, "MARCONI ELECTRONICS LTD." },

170 { 0x000097, "Dell EMC" },

171 { 0x000098, "CROSSCOMM CORPORATION" },

172 { 0x000099, "MTX, INC." },

173 { 0x00009A, "RC COMPUTER A/S" },

174 { 0x00009B, "INFORMATION INTERNATIONAL, INC" },

175 { 0x00009C, "ROLM MIL-SPEC COMPUTERS" },

176 { 0x00009D, "LOCUS COMPUTING CORPORATION" },

177 { 0x00009E, "MARLI S.A." },

178 { 0x00009F, "AMERISTAR TECHNOLOGIES INC." },

179 { 0x0000A0, "SANYO Electric Co., Ltd." },

180 { 0x0000A1, "MARQUETTE ELECTRIC CO." },

181 { 0x0000A2, "Bay Networks" },

182 { 0x0000A3, "NETWORK APPLICATION TECHNOLOGY" },

183 { 0x0000A4, "ACORN COMPUTERS LIMITED" },

184 { 0x0000A5, "Tattile SRL" },

185 { 0x0000A6, "NETWORK GENERAL CORPORATION" },

186 { 0x0000A7, "NETWORK COMPUTING DEVICES INC." },

187 { 0x0000A8, "Stratus Technologies" },

188 { 0x0000A9, "NETWORK SYSTEMS CORP." },

189 { 0x0000AA, "XEROX CORPORATION" },

190 { 0x0000AB, "LOGIC MODELING CORPORATION" },

191 { 0x0000AC, "CONWARE COMPUTER CONSULTING" },

192 { 0x0000AD, "BRUKER INSTRUMENTS INC." },

193 { 0x0000AE, "DASSAULT ELECTRONIQUE" },

194 { 0x0000AF, "Canberra Industries, Inc." },

195 { 0x0000B0, "RND-RAD NETWORK DEVICES" },

196 { 0x0000B1, "Alpha Micro" },

197 { 0x0000B2, "TELEVIDEO SYSTEMS, INC." },

198 { 0x0000B3, "CIMLINC INCORPORATED" },

199 { 0x0000B4, "Edimax Technology Co. Ltd." },

200 { 0x0000B5, "DATABILITY SOFTWARE SYS. INC." },

201 { 0x0000B6, "MICRO-MATIC RESEARCH" },

202 { 0x0000B7, "DOVE COMPUTER CORPORATION" },

203 { 0x0000B8, "SEIKOSHA CO., LTD." },

204 { 0x0000B9, "MCDONNELL DOUGLAS COMPUTER SYS" },

205 { 0x0000BA, "SIIG, INC." },

206 { 0x0000BB, "TRI-DATA" },

207 { 0x0000BC, "Rockwell Automation" },

208 { 0x0000BD, "RYOSEI, Ltd." },

209 { 0x0000BE, "THE NTI GROUP" },

210 { 0x0000BF, "SYMMETRIC COMPUTER SYSTEMS" },

211 { 0x0000C0, "WESTERN DIGITAL CORPORATION" },

212 { 0x0000C1, "Madge Ltd." },

213 { 0x0000C2, "INFORMATION PRESENTATION TECH." },

214 { 0x0000C3, "Harris Corporation" },

215 { 0x0000C4, "WATERS DIV. OF MILLIPORE" },

216 { 0x0000C5, "ARRIS Group, Inc." },

217 { 0x0000C6, "EON SYSTEMS" },

218 { 0x0000C7, "ARIX CORPORATION" },

219 { 0x0000C8, "ALTOS COMPUTER SYSTEMS" },

220 { 0x0000C9, "Emulex Corporation" },

221 { 0x0000CA, "ARRIS Group, Inc." },

222 { 0x0000CB, "COMPU-SHACK ELECTRONIC GMBH" },

223 { 0x0000CC, "DENSAN CO., LTD." },

224 { 0x0000CD, "Allied Telesis Labs Ltd" },

225 { 0x0000CE, "MEGADATA CORP." },

226 { 0x0000CF, "HAYES MICROCOMPUTER PRODUCTS" },

227 { 0x0000D0, "DEVELCON ELECTRONICS LTD." },

228 { 0x0000D1, "ADAPTEC INCORPORATED" },

229 { 0x0000D2, "SBE, INC." },

230 { 0x0000D3, "WANG LABORATORIES INC." },

231 { 0x0000D4, "PURE DATA LTD." },

232 { 0x0000D5, "MICROGNOSIS INTERNATIONAL" },

233 { 0x0000D6, "PUNCH LINE HOLDING" },

234 { 0x0000D7, "DARTMOUTH COLLEGE" },

235 { 0x0000D8, "Novell, Inc." },

236 { 0x0000D9, "NIPPON TELEGRAPH & TELEPHONE" },

237 { 0x0000DA, "ATEX" },

238 { 0x0000DB, "British Telecommunications plc" },

239 { 0x0000DC, "HAYES MICROCOMPUTER PRODUCTS" },

240 { 0x0000DD, "TCL INCORPORATED" },

241 { 0x0000DE, "CETIA" },

242 { 0x0000DF, "BELL & HOWELL PUB SYS DIV" },

243 { 0x0000E0, "QUADRAM CORP." },

244 { 0x0000E1, "GRID SYSTEMS" },

245 { 0x0000E2, "ACER TECHNOLOGIES CORP." },

246 { 0x0000E3, "INTEGRATED MICRO PRODUCTS LTD" },

247 { 0x0000E4, "IN2 GROUPE INTERTECHNIQUE" },

248 { 0x0000E5, "SIGMEX LTD." },

249 { 0x0000E6, "APTOR PRODUITS DE COMM INDUST" },

250 { 0x0000E7, "Star Gate Technologies" },

251 { 0x0000E8, "ACCTON TECHNOLOGY CORP." },

252 { 0x0000E9, "ISICAD, INC." },

253 { 0x0000EA, "UPNOD AB" },

254 { 0x0000EB, "MATSUSHITA COMM. IND. CO. LTD." },

255 { 0x0000EC, "MICROPROCESS" },

256 { 0x0000ED, "APRIL" },

257 { 0x0000EE, "NETWORK DESIGNERS, LTD." },

258 { 0x0000EF, "KTI" },

259 { 0x0000F0, "Samsung Electronics Co.,Ltd" },

260 { 0x0000F1, "MAGNA COMPUTER CORPORATION" },

261 { 0x0000F2, "SPIDER COMMUNICATIONS" },

262 { 0x0000F3, "GANDALF DATA LIMITED" },

263 { 0x0000F4, "Allied Telesis, Inc." },

264 { 0x0000F5, "DIAMOND SALES LIMITED" },

265 { 0x0000F6, "APPLIED MICROSYSTEMS CORP." },

266 { 0x0000F7, "YOUTH KEEP ENTERPRISE CO LTD" },

267 { 0x0000F8, "DIGITAL EQUIPMENT CORPORATION" },

268 { 0x0000F9, "QUOTRON SYSTEMS INC." },

269 { 0x0000FA, "MICROSAGE COMPUTER SYSTEMS INC" },

270 { 0x0000FB, "RECHNER ZUR KOMMUNIKATION" },

271 { 0x0000FC, "MEIKO" },

272 { 0x0000FD, "HIGH LEVEL HARDWARE" },

273 { 0x0000FE, "Annapolis Micro Systems, Inc." },

274 { 0x0000FF, "CAMTEC ELECTRONICS LTD." },

275 { 0x000100, "EQUIP'TRANS" },

276 { 0x000101, "Private" },

277 { 0x000102, "3COM" },

278 { 0x000103, "3COM" },

279 { 0x000104, "DVICO Co., Ltd." },

280 { 0x000105, "Beckhoff Automation GmbH" },

281 { 0x000106, "Tews Datentechnik GmbH" },

282 { 0x000107, "Leiser GmbH" },

283 { 0x000108, "AVLAB Technology, Inc." },

284 { 0x000109, "Nagano Japan Radio Co., Ltd." },

285 { 0x00010A, "CIS TECHNOLOGY INC." },

286 { 0x00010B, "Space CyberLink, Inc." },

287 { 0x00010C, "System Talks Inc." },

288 { 0x00010D, "Teledyne DALSA Inc." },

289 { 0x00010E, "Bri-Link Technologies Co., Ltd" },

290 { 0x00010F, "Brocade Communications Systems LLC" },

291 { 0x000110, "Gotham Networks" },

292 { 0x000111, "iDigm Inc." },

293 { 0x000112, "Shark Multimedia Inc." },

294 { 0x000113, "OLYMPUS CORPORATION" },

295 { 0x000114, "KANDA TSUSHIN KOGYO CO., LTD." },

296 { 0x000115, "EXTRATECH CORPORATION" },

297 { 0x000116, "Netspect Technologies, Inc." },

298 { 0x000117, "Canal +" },

299 { 0x000118, "EZ Digital Co., Ltd." },

300 { 0x000119, "RTUnet (Australia)" },

301 { 0x00011A, "Hoffmann und Burmeister GbR" },

302 { 0x00011B, "Unizone Technologies, Inc." },

303 { 0x00011C, "Universal Talkware Corporation" },

304 { 0x00011D, "Centillium Communications" },

305 { 0x00011E, "Precidia Technologies, Inc." },

306 { 0x00011F, "RC Networks, Inc." },

307 { 0x000120, "OSCILLOQUARTZ S.A." },

308 { 0x000121, "WatchGuard Technologies, Inc." },

309 { 0x000122, "Trend Communications, Ltd." },

310 { 0x000123, "Schneider Electric Japan Holdings Ltd." },

311 { 0x000124, "Acer Incorporated" },

312 { 0x000125, "YAESU MUSEN CO., LTD." },

313 { 0x000126, "PAC Labs" },

314 { 0x000127, "OPEN Networks Pty Ltd" },

315 { 0x000128, "EnjoyWeb, Inc." },

316 { 0x000129, "DFI Inc." },

317 { 0x00012A, "Telematica Sistems Inteligente" },

318 { 0x00012B, "TELENET Co., Ltd." },

319 { 0x00012C, "Aravox Technologies, Inc." },

320 { 0x00012D, "Komodo Technology" },

321 { 0x00012E, "PC Partner Ltd." },

322 { 0x00012F, "Twinhead International Corp" },

323 { 0x000130, "Extreme Networks Headquarters" },

324 { 0x000131, "Bosch Security Systems, Inc." },

325 { 0x000132, "Dranetz - BMI" },

326 { 0x000133, "KYOWA Electronic Instruments C" },

327 { 0x000134, "Selectron Systems AG" },

328 { 0x000135, "KDC Corp." },

329 { 0x000136, "CyberTAN Technology Inc." },

330 { 0x000137, "IT Farm Corporation" },

331 { 0x000138, "XAVi Technologies Corp." },

332 { 0x000139, "Point Multimedia Systems" },

333 { 0x00013A, "SHELCAD COMMUNICATIONS, LTD." },

334 { 0x00013B, "BNA SYSTEMS" },

335 { 0x00013C, "TIW SYSTEMS" },

336 { 0x00013D, "RiscStation Ltd." },

337 { 0x00013E, "Ascom Tateco AB" },

338 { 0x00013F, "Neighbor World Co., Ltd." },

339 { 0x000140, "Sendtek Corporation" },

340 { 0x000141, "CABLE PRINT" },

341 { 0x000142, "Cisco Systems, Inc" },

342 { 0x000143, "Cisco Systems, Inc" },

343 { 0x000144, "Dell EMC" },

344 { 0x000145, "WINSYSTEMS, INC." },

345 { 0x000146, "Tesco Controls, Inc." },

346 { 0x000147, "DZS Inc." },

347 { 0x000148, "X-traWeb Inc." },

348 { 0x000149, "TDT AG" },

349 { 0x00014A, "Sony Corporation" },

350 { 0x00014B, "Ennovate Networks, Inc." },

351 { 0x00014C, "Berkeley Process Control" },

352 { 0x00014D, "Shin Kin Enterprises Co., Ltd" },

353 { 0x00014E, "WIN Enterprises, Inc." },

354 { 0x00014F, "Adtran Inc" },

355 { 0x000150, "GILAT COMMUNICATIONS, LTD." },

356 { 0x000151, "Ensemble Communications" },

357 { 0x000152, "CHROMATEK INC." },

358 { 0x000153, "ARCHTEK TELECOM CORPORATION" },

359 { 0x000154, "G3M Corporation" },

360 { 0x000155, "Promise Technology, Inc." },

361 { 0x000156, "FIREWIREDIRECT.COM, INC." },

362 { 0x000157, "SYSWAVE CO., LTD" },

363 { 0x000158, "Electro Industries/Gauge Tech" },

364 { 0x000159, "S1 Corporation" },

365 { 0x00015A, "Digital Video Broadcasting" },

366 { 0x00015B, "ITALTEL S.p.A/RF-UP-I" },

367 { 0x00015C, "CADANT INC." },

368 { 0x00015D, "Oracle Corporation" },

369 { 0x00015E, "BEST TECHNOLOGY CO., LTD." },

370 { 0x00015F, "DIGITAL DESIGN GmbH" },

371 { 0x000160, "ELMEX Co., LTD." },

372 { 0x000161, "Meta Machine Technology" },

373 { 0x000162, "Cygnet Technologies, Inc." },

374 { 0x000163, "Cisco Systems, Inc" },

375 { 0x000164, "Cisco Systems, Inc" },

376 { 0x000165, "AirSwitch Corporation" },

377 { 0x000166, "TC GROUP A/S" },

378 { 0x000167, "HIOKI E.E. CORPORATION" },

379 { 0x000168, "VITANA CORPORATION" },

380 { 0x000169, "Celestix Networks Pte Ltd." },

381 { 0x00016A, "ALITEC" },

382 { 0x00016B, "LightChip, Inc." },

383 { 0x00016C, "FOXCONN" },

384 { 0x00016D, "CarrierComm Inc." },

385 { 0x00016E, "Conklin Corporation" },

386 { 0x00016F, "Inkel Corp." },

387 { 0x000170, "ESE Embedded System Engineer'g" },

388 { 0x000171, "Allied Data Technologies" },

389 { 0x000172, "TechnoLand Co., LTD." },

390 { 0x000173, "AMCC" },

391 { 0x000174, "CyberOptics Corporation" },

392 { 0x000175, "Radiant Communications Corp." },

393 { 0x000176, "Orient Silver Enterprises" },

394 { 0x000177, "EDSL" },

395 { 0x000178, "MARGI Systems, Inc." },

396 { 0x000179, "WIRELESS TECHNOLOGY, INC." },

397 { 0x00017A, "Chengdu Maipu Electric Industrial Co., Ltd." },

398 { 0x00017B, "Heidelberger Druckmaschinen AG" },

399 { 0x00017C, "AG-E GmbH" },

400 { 0x00017D, "ThermoQuest" },

401 { 0x00017E, "ADTEK System Science Co., Ltd." },

402 { 0x00017F, "Experience Music Project" },

403 { 0x000180, "AOpen, Inc." },

404 { 0x000181, "Nortel Networks" },

405 { 0x000182, "DICA TECHNOLOGIES AG" },

406 { 0x000183, "ANITE TELECOMS" },

407 { 0x000184, "SIEB & MEYER AG" },

408 { 0x000185, "Hitachi Aloka Medical, Ltd." },

409 { 0x000186, "Uwe Disch" },

410 { 0x000187, "I2SE GmbH" },

411 { 0x000188, "LXCO Technologies ag" },

412 { 0x000189, "Refraction Technology, Inc." },

413 { 0x00018A, "ROI COMPUTER AG" },

414 { 0x00018B, "NetLinks Co., Ltd." },

415 { 0x00018C, "Mega Vision" },

416 { 0x00018D, "AudeSi Technologies" },

417 { 0x00018E, "Logitec Corporation" },

418 { 0x00018F, "Kenetec, Inc." },

419 { 0x000190, "SMK-M" },

420 { 0x000191, "SYRED Data Systems" },

421 { 0x000192, "Texas Digital Systems" },

422 { 0x000193, "Hanbyul Telecom Co., Ltd." },

423 { 0x000194, "Capital Equipment Corporation" },

424 { 0x000195, "Sena Technologies, Inc." },

425 { 0x000196, "Cisco Systems, Inc" },

426 { 0x000197, "Cisco Systems, Inc" },

427 { 0x000198, "Darim Vision" },

428 { 0x000199, "HeiSei Electronics" },

429 { 0x00019A, "LEUNIG GmbH" },

430 { 0x00019B, "Kyoto Microcomputer Co., Ltd." },

431 { 0x00019C, "Lumentum" },

432 { 0x00019D, "E-Control Systems, Inc." },

433 { 0x00019E, "ESS Technology, Inc." },

434 { 0x00019F, "ReadyNet" },

435 { 0x0001A0, "Infinilink Corporation" },

436 { 0x0001A1, "Mag-Tek, Inc." },

437 { 0x0001A2, "Logical Co., Ltd." },

438 { 0x0001A3, "GENESYS LOGIC, INC." },

439 { 0x0001A4, "Microlink Corporation" },

440 { 0x0001A5, "Nextcomm, Inc." },

441 { 0x0001A6, "Scientific-Atlanta Arcodan A/S" },

442 { 0x0001A7, "UNEX TECHNOLOGY CORPORATION" },

443 { 0x0001A8, "Welltech Computer Co., Ltd." },

444 { 0x0001A9, "BMW AG" },

445 { 0x0001AA, "Airspan Communications, Ltd." },

446 { 0x0001AB, "Main Street Networks" },

447 { 0x0001AC, "Sitara Networks, Inc." },

448 { 0x0001AD, "Coach Master International d.b.a. CMI Worldwide, Inc." },

449 { 0x0001AE, "Trex Enterprises" },

450 { 0x0001AF, "Artesyn Embedded Technologies" },

451 { 0x0001B0, "Fulltek Technology Co., Ltd." },

452 { 0x0001B1, "General Bandwidth" },

453 { 0x0001B2, "Digital Processing Systems, Inc." },

454 { 0x0001B3, "Precision Electronic Manufacturing" },

455 { 0x0001B4, "Wayport, Inc." },

456 { 0x0001B5, "Turin Networks, Inc." },

457 { 0x0001B6, "SAEJIN T&M Co., Ltd." },

458 { 0x0001B7, "Centos, Inc." },

459 { 0x0001B8, "Netsensity, Inc." },

460 { 0x0001B9, "SKF (U.K.) Limited" },

461 { 0x0001BA, "IC-Net, Inc." },

462 { 0x0001BB, "Frequentis" },

463 { 0x0001BC, "Brains Corporation" },

464 { 0x0001BD, "Peterson Electro-Musical Products, Inc." },

465 { 0x0001BE, "Gigalink Co., Ltd." },

466 { 0x0001BF, "Teleforce Co., Ltd." },

467 { 0x0001C0, "CompuLab, Ltd." },

468 { 0x0001C1, "Vitesse Semiconductor Corporation" },

469 { 0x0001C2, "ARK Research Corp." },

470 { 0x0001C3, "Acromag, Inc." },

471 { 0x0001C4, "NeoWave, Inc." },

472 { 0x0001C5, "Simpler Networks" },

473 { 0x0001C6, "Quarry Technologies" },

474 { 0x0001C7, "Cisco Systems, Inc" },

475 { 0x0001C8, "CONRAD CORP." },

476 { 0x0001C9, "Cisco Systems, Inc" },

477 { 0x0001CA, "Geocast Network Systems, Inc." },

478 { 0x0001CB, "EVR" },

479 { 0x0001CC, "Japan Total Design Communication Co., Ltd." },

480 { 0x0001CD, "ARtem" },

481 { 0x0001CE, "Custom Micro Products, Ltd." },

482 { 0x0001CF, "Alpha Data Parallel Systems, Ltd." },

483 { 0x0001D0, "VitalPoint, Inc." },

484 { 0x0001D1, "CoNet Communications, Inc." },

485 { 0x0001D2, "inXtron, Inc." },

486 { 0x0001D3, "PAXCOMM, Inc." },

487 { 0x0001D4, "Leisure Time, Inc." },

488 { 0x0001D5, "HAEDONG INFO & COMM CO., LTD" },

489 { 0x0001D6, "manroland AG" },

490 { 0x0001D7, "F5 Networks, Inc." },

491 { 0x0001D8, "Teltronics, Inc." },

492 { 0x0001D9, "Sigma, Inc." },

493 { 0x0001DA, "WINCOMM Corporation" },

494 { 0x0001DB, "Freecom Technologies GmbH" },

495 { 0x0001DC, "Activetelco" },

496 { 0x0001DD, "Avail Networks" },

497 { 0x0001DE, "Trango Systems, Inc." },

498 { 0x0001DF, "ISDN Communications, Ltd." },

499 { 0x0001E0, "Fast Systems, Inc." },

500 { 0x0001E1, "Kinpo Electronics, Inc." },

501 { 0x0001E2, "Ando Electric Corporation" },

502 { 0x0001E3, "Siemens AG" },

503 { 0x0001E4, "Sitera, Inc." },

504 { 0x0001E5, "Supernet, Inc." },

505 { 0x0001E6, "Hewlett Packard" },

506 { 0x0001E7, "Hewlett Packard" },

507 { 0x0001E8, "Force10 Networks, Inc." },

508 { 0x0001E9, "Litton Marine Systems B.V." },

509 { 0x0001EA, "Cirilium Corp." },

510 { 0x0001EB, "C-COM Corporation" },

511 { 0x0001EC, "Ericsson Group" },

512 { 0x0001ED, "SETA Corp." },

513 { 0x0001EE, "Comtrol Europe, Ltd." },

514 { 0x0001EF, "Camtel Technology Corp." },

515 { 0x0001F0, "Tridium, Inc." },

516 { 0x0001F1, "Innovative Concepts, Inc." },

517 { 0x0001F2, "Mark of the Unicorn, Inc." },

518 { 0x0001F3, "QPS, Inc." },

519 { 0x0001F4, "Enterasys" },

520 { 0x0001F5, "ERIM S.A." },

521 { 0x0001F6, "Association of Musical Electronics Industry" },

522 { 0x0001F7, "Image Display Systems, Inc." },

523 { 0x0001F8, "TEXIO TECHNOLOGY CORPORATION" },

524 { 0x0001F9, "TeraGlobal Communications Corp." },

525 { 0x0001FA, "HOROSCAS" },

526 { 0x0001FB, "DoTop Technology, Inc." },

527 { 0x0001FC, "Keyence Corporation" },

528 { 0x0001FD, "Digital Voice Systems, Inc." },

529 { 0x0001FE, "DIGITAL EQUIPMENT CORPORATION" },

530 { 0x0001FF, "Data Direct Networks, Inc." },

531 { 0x000200, "Net & Sys Co., Ltd." },

532 { 0x000201, "IFM Electronic gmbh" },

533 { 0x000202, "Amino Communications, Ltd." },

534 { 0x000203, "Woonsang Telecom, Inc." },

535 { 0x000204, "Bodmann Industries Elektronik GmbH" },

536 { 0x000205, "Hitachi Denshi, Ltd." },

537 { 0x000206, "Telital R&D Denmark A/S" },

538 { 0x000207, "VisionGlobal Network Corp." },

539 { 0x000208, "Unify Networks, Inc." },

540 { 0x000209, "Shenzhen SED Information Technology Co., Ltd." },

541 { 0x00020A, "Gefran Spa" },

542 { 0x00020B, "Native Networks, Inc." },

543 { 0x00020C, "Metro-Optix" },

544 { 0x00020D, "Micronpc.com" },

545 { 0x00020E, "ECI Telecom Ltd." },

546 { 0x00020F, "AATR" },

547 { 0x000210, "Fenecom" },

548 { 0x000211, "Nature Worldwide Technology Corp." },

549 { 0x000212, "SierraCom" },

550 { 0x000213, "S.D.E.L." },

551 { 0x000214, "DTVRO" },

552 { 0x000215, "Cotas Computer Technology A/B" },

553 { 0x000216, "Cisco Systems, Inc" },

554 { 0x000217, "Cisco Systems, Inc" },

555 { 0x000218, "Advanced Scientific Corp" },

556 { 0x000219, "Paralon Technologies" },

557 { 0x00021A, "Zuma Networks" },

558 { 0x00021B, "Kollmorgen-Servotronix" },

559 { 0x00021C, "Network Elements, Inc." },

560 { 0x00021D, "Data General Communication Ltd." },

561 { 0x00021E, "SIMTEL S.R.L." },

562 { 0x00021F, "Aculab PLC" },

563 { 0x000220, "CANON FINETECH INC." },

564 { 0x000221, "DSP Application, Ltd." },

565 { 0x000222, "Chromisys, Inc." },

566 { 0x000223, "ClickTV" },

567 { 0x000224, "C-COR" },

568 { 0x000225, "One Stop Systems" },

569 { 0x000226, "XESystems, Inc." },

570 { 0x000227, "ESD Electronic System Design GmbH" },

571 { 0x000228, "Necsom, Ltd." },

572 { 0x000229, "Adtec Corporation" },

573 { 0x00022A, "Asound Electronic" },

574 { 0x00022B, "SAXA, Inc." },

575 { 0x00022C, "ABB Bomem, Inc." },

576 { 0x00022D, "Agere Systems" },

577 { 0x00022E, "TEAC Corp. R& D" },

578 { 0x00022F, "P-Cube, Ltd." },

579 { 0x000230, "Intersoft Electronics" },

580 { 0x000231, "Ingersoll-Rand" },

581 { 0x000232, "Avision, Inc." },

582 { 0x000233, "Mantra Communications, Inc." },

583 { 0x000234, "Imperial Technology, Inc." },

584 { 0x000235, "Paragon Networks International" },

585 { 0x000236, "INIT GmbH" },

586 { 0x000237, "Cosmo Research Corp." },

587 { 0x000238, "Serome Technology, Inc." },

588 { 0x000239, "Visicom" },

589 { 0x00023A, "ZSK Stickmaschinen GmbH" },

590 { 0x00023B, "Ericsson" },

591 { 0x00023C, "Creative Technology, Ltd." },

592 { 0x00023D, "Cisco Systems, Inc" },

593 { 0x00023E, "Selta Telematica S.p.a" },

594 { 0x00023F, "Compal Electronics INC." },

595 { 0x000240, "Seedek Co., Ltd." },

596 { 0x000241, "Amer.com" },

597 { 0x000242, "Videoframe Systems" },

598 { 0x000243, "Raysis Co., Ltd." },

599 { 0x000244, "SURECOM Technology Co." },

600 { 0x000245, "Lampus Co, Ltd." },

601 { 0x000246, "All-Win Tech Co., Ltd." },

602 { 0x000247, "Great Dragon Information Technology (Group) Co., Ltd." },

603 { 0x000248, "Pilz GmbH & Co." },

604 { 0x000249, "Aviv Infocom Co, Ltd." },

605 { 0x00024A, "Cisco Systems, Inc" },

606 { 0x00024B, "Cisco Systems, Inc" },

607 { 0x00024C, "SiByte, Inc." },

608 { 0x00024D, "Mannesman Dematic Colby Pty. Ltd." },

609 { 0x00024E, "Datacard Group" },

610 { 0x00024F, "IPM Datacom S.R.L." },

611 { 0x000250, "Geyser Networks, Inc." },

612 { 0x000251, "Soma Networks, Inc." },

613 { 0x000252, "Carrier Corporation" },

614 { 0x000253, "Televideo, Inc." },

615 { 0x000254, "WorldGate" },

616 { 0x000255, "IBM Corp" },

617 { 0x000256, "Alpha Processor, Inc." },

618 { 0x000257, "Microcom Corp." },

619 { 0x000258, "Flying Packets Communications" },

620 { 0x000259, "Tsann Kuen China (Shanghai)Enterprise Co., Ltd. IT Group" },

621 { 0x00025A, "Catena Networks" },

622 { 0x00025B, "Cambridge Silicon Radio" },

623 { 0x00025C, "SCI Systems (Kunshan) Co., Ltd." },

624 { 0x00025D, "Calix Networks" },

625 { 0x00025E, "High Technology Ltd" },

626 { 0x00025F, "Nortel Networks" },

627 { 0x000260, "Accordion Networks, Inc." },

628 { 0x000261, "Tilgin AB" },

629 { 0x000262, "Soyo Group Soyo Com Tech Co., Ltd" },

630 { 0x000263, "RPS S.p.A." },

631 { 0x000264, "AudioRamp.com" },

632 { 0x000265, "Virditech Co. Ltd." },

633 { 0x000266, "Thermalogic Corporation" },

634 { 0x000267, "NODE RUNNER, INC." },

635 { 0x000268, "Harris Government Communications" },

636 { 0x000269, "Nadatel Co., Ltd" },

637 { 0x00026A, "Cocess Telecom Co., Ltd." },

638 { 0x00026B, "BCM Computers Co., Ltd." },

639 { 0x00026C, "Philips CFT" },

640 { 0x00026D, "Adept Telecom" },

641 { 0x00026E, "NeGeN Access, Inc." },

642 { 0x00026F, "Senao International Co., Ltd." },

643 { 0x000270, "Crewave Co., Ltd." },

644 { 0x000271, "DZS Inc." },

645 { 0x000272, "CC&C Technologies, Inc." },

646 { 0x000273, "Coriolis Networks" },

647 { 0x000274, "Tommy Technologies Corp." },

648 { 0x000275, "SMART Technologies, Inc." },

649 { 0x000276, "Primax Electronics Ltd." },

650 { 0x000277, "Cash Systemes Industrie" },

651 { 0x000278, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

652 { 0x000279, "Control Applications, Ltd." },

653 { 0x00027A, "IOI Technology Corporation" },

654 { 0x00027B, "Amplify Net, Inc." },

655 { 0x00027C, "Trilithic, Inc." },

656 { 0x00027D, "Cisco Systems, Inc" },

657 { 0x00027E, "Cisco Systems, Inc" },

658 { 0x00027F, "ask-technologies.com" },

659 { 0x000280, "Mu Net, Inc." },

660 { 0x000281, "Madge Ltd." },

661 { 0x000282, "ViaClix, Inc." },

662 { 0x000283, "Spectrum Controls, Inc." },

663 { 0x000284, "UK Grid Solutions Limited" },

664 { 0x000285, "Riverstone Networks" },

665 { 0x000286, "Occam Networks" },

666 { 0x000287, "Adapcom" },

667 { 0x000288, "GLOBAL VILLAGE COMMUNICATION" },

668 { 0x000289, "DNE Technologies" },

669 { 0x00028A, "Ambit Microsystems Corporation" },

670 { 0x00028B, "VDSL Systems OY" },

671 { 0x00028C, "Micrel-Synergy Semiconductor" },

672 { 0x00028D, "Movita Technologies, Inc." },

673 { 0x00028E, "Rapid 5 Networks, Inc." },

674 { 0x00028F, "Globetek, Inc." },

675 { 0x000290, "Woorigisool, Inc." },

676 { 0x000291, "Open Network Co., Ltd." },

677 { 0x000292, "Logic Innovations, Inc." },

678 { 0x000293, "Solid Data Systems" },

679 { 0x000294, "Tokyo Sokushin Co., Ltd." },

680 { 0x000295, "IP.Access Limited" },

681 { 0x000296, "Lectron Co,. Ltd." },

682 { 0x000297, "C-COR.net" },

683 { 0x000298, "Broadframe Corporation" },

684 { 0x000299, "Apex, Inc." },

685 { 0x00029A, "Storage Apps" },

686 { 0x00029B, "Kreatel Communications AB" },

687 { 0x00029C, "3COM" },

688 { 0x00029D, "Merix Corp." },

689 { 0x00029E, "Information Equipment Co., Ltd." },

690 { 0x00029F, "L-3 Communication Aviation Recorders" },

691 { 0x0002A0, "Flatstack Ltd." },

692 { 0x0002A1, "World Wide Packets" },

693 { 0x0002A2, "Hilscher GmbH" },

694 { 0x0002A3, "Hitachi Energy Switzerland Ltd" },

695 { 0x0002A4, "AddPac Technology Co., Ltd." },

696 { 0x0002A5, "Hewlett Packard" },

697 { 0x0002A6, "Effinet Systems Co., Ltd." },

698 { 0x0002A7, "Vivace Networks" },

699 { 0x0002A8, "Air Link Technology" },

700 { 0x0002A9, "RACOM, s.r.o." },

701 { 0x0002AA, "PLcom Co., Ltd." },

702 { 0x0002AB, "CTC Union Technologies Co., Ltd." },

703 { 0x0002AC, "3PAR data" },

704 { 0x0002AD, "HOYA Corporation" },

705 { 0x0002AE, "Scannex Electronics Ltd." },

706 { 0x0002AF, "TeleCruz Technology, Inc." },

707 { 0x0002B0, "Hokubu Communication & Industrial Co., Ltd." },

708 { 0x0002B1, "Anritsu, Ltd." },

709 { 0x0002B2, "Cablevision" },

710 { 0x0002B3, "Intel Corporation" },

711 { 0x0002B4, "DAPHNE" },

712 { 0x0002B5, "Avnet, Inc." },

713 { 0x0002B6, "Acrosser Technology Co., Ltd." },

714 { 0x0002B7, "Watanabe Electric Industry Co., Ltd." },

715 { 0x0002B8, "WHI KONSULT AB" },

716 { 0x0002B9, "Cisco Systems, Inc" },

717 { 0x0002BA, "Cisco Systems, Inc" },

718 { 0x0002BB, "Continuous Computing Corp" },

719 { 0x0002BC, "LVL 7 Systems, Inc." },

720 { 0x0002BD, "Bionet Co., Ltd." },

721 { 0x0002BE, "Totsu Engineering, Inc." },

722 { 0x0002BF, "dotRocket, Inc." },

723 { 0x0002C0, "Bencent Tzeng Industry Co., Ltd." },

724 { 0x0002C1, "Innovative Electronic Designs, Inc." },

725 { 0x0002C2, "Net Vision Telecom" },

726 { 0x0002C3, "Arelnet Ltd." },

727 { 0x0002C4, "OPT Machine Vision Tech Co., Ltd" },

728 { 0x0002C5, "Evertz Microsystems Ltd." },

729 { 0x0002C6, "Data Track Technology PLC" },

730 { 0x0002C7, "ALPSALPINE CO,.LTD" },

731 { 0x0002C8, "Technocom Communications Technology (pte) Ltd" },

732 { 0x0002C9, "Mellanox Technologies, Inc." },

733 { 0x0002CA, "EndPoints, Inc." },

734 { 0x0002CB, "TriState Ltd." },

735 { 0x0002CC, "M.C.C.I" },

736 { 0x0002CD, "TeleDream, Inc." },

737 { 0x0002CE, "FoxJet, Inc." },

738 { 0x0002CF, "ZyGate Communications, Inc." },

739 { 0x0002D0, "Comdial Corporation" },

740 { 0x0002D1, "Vivotek, Inc." },

741 { 0x0002D2, "Workstation AG" },

742 { 0x0002D3, "NetBotz, Inc." },

743 { 0x0002D4, "PDA Peripherals, Inc." },

744 { 0x0002D5, "ACR" },

745 { 0x0002D6, "NICE Systems" },

746 { 0x0002D7, "EMPEG Ltd" },

747 { 0x0002D8, "BRECIS Communications Corporation" },

748 { 0x0002D9, "Reliable Controls" },

749 { 0x0002DA, "ExiO Communications, Inc." },

750 { 0x0002DB, "NETSEC" },

751 { 0x0002DC, "Fujitsu General Limited" },

752 { 0x0002DD, "Bromax Communications, Ltd." },

753 { 0x0002DE, "Astrodesign, Inc." },

754 { 0x0002DF, "Net Com Systems, Inc." },

755 { 0x0002E0, "ETAS GmbH" },

756 { 0x0002E1, "Integrated Network Corporation" },

757 { 0x0002E2, "NDC Infared Engineering" },

758 { 0x0002E3, "LITE-ON Communications, Inc." },

759 { 0x0002E4, "JC HYUN Systems, Inc." },

760 { 0x0002E5, "Timeware Ltd." },

761 { 0x0002E6, "Gould Instrument Systems, Inc." },

762 { 0x0002E7, "CAB GmbH & Co KG" },

763 { 0x0002E8, "E.D.&A." },

764 { 0x0002E9, "CS Systemes De Securite - C3S" },

765 { 0x0002EA, "Focus Enhancements" },

766 { 0x0002EB, "Pico Communications" },

767 { 0x0002EC, "Maschoff Design Engineering" },

768 { 0x0002ED, "DXO Telecom Co., Ltd." },

769 { 0x0002EE, "Nokia Danmark A/S" },

770 { 0x0002EF, "CCC Network Systems Group Ltd." },

771 { 0x0002F0, "AME Optimedia Technology Co., Ltd." },

772 { 0x0002F1, "Pinetron Co., Ltd." },

773 { 0x0002F2, "eDevice, Inc." },

774 { 0x0002F3, "Media Serve Co., Ltd." },

775 { 0x0002F4, "PCTEL, Inc." },

776 { 0x0002F5, "VIVE Synergies, Inc." },

777 { 0x0002F6, "Equipe Communications" },

778 { 0x0002F7, "ARM" },

779 { 0x0002F8, "SEAKR Engineering, Inc." },

780 { 0x0002F9, "MIMOS Berhad" },

781 { 0x0002FA, "DX Antenna Co., Ltd." },

782 { 0x0002FB, "Baumuller Aulugen-Systemtechnik GmbH" },

783 { 0x0002FC, "Cisco Systems, Inc" },

784 { 0x0002FD, "Cisco Systems, Inc" },

785 { 0x0002FE, "Viditec, Inc." },

786 { 0x0002FF, "Handan BroadInfoCom" },

787 { 0x000300, "Barracuda Networks, Inc." },

788 { 0x000301, "EXFO" },

789 { 0x000302, "Charles Industries, Ltd." },

790 { 0x000303, "JAMA Electronics Co., Ltd." },

791 { 0x000304, "Pacific Broadband Communications" },

792 { 0x000305, "MSC Vertriebs GmbH" },

793 { 0x000306, "Fusion In Tech Co., Ltd." },

794 { 0x000307, "Secure Works, Inc." },

795 { 0x000308, "AM Communications, Inc." },

796 { 0x000309, "Texcel Technology PLC" },

797 { 0x00030A, "Argus Technologies" },

798 { 0x00030B, "Hunter Technology, Inc." },

799 { 0x00030C, "Telesoft Technologies Ltd." },

800 { 0x00030D, "Uniwill Computer Corp." },

801 { 0x00030E, "Core Communications Co., Ltd." },

802 { 0x00030F, "Digital China (Shanghai) Networks Ltd." },

803 { 0x000310, "E-Globaledge Corporation" },

804 { 0x000311, "Micro Technology Co., Ltd." },

805 { 0x000312, "TRsystems GmbH" },

806 { 0x000313, "Access Media SPA" },

807 { 0x000314, "Teleware Network Systems" },

808 { 0x000315, "Cidco Incorporated" },

809 { 0x000316, "Nobell Communications, Inc." },

810 { 0x000317, "Merlin Systems, Inc." },

811 { 0x000318, "Cyras Systems, Inc." },

812 { 0x000319, "Infineon AG" },

813 { 0x00031A, "Beijing Broad Telecom Ltd., China" },

814 { 0x00031B, "Cellvision Systems, Inc." },

815 { 0x00031C, "Svenska Hardvarufabriken AB" },

816 { 0x00031D, "Taiwan Commate Computer, Inc." },

817 { 0x00031E, "Optranet, Inc." },

818 { 0x00031F, "Condev Ltd." },

819 { 0x000320, "Xpeed, Inc." },

820 { 0x000321, "Reco Research Co., Ltd." },

821 { 0x000322, "IDIS Co., Ltd." },

822 { 0x000323, "Cornet Technology, Inc." },

823 { 0x000324, "LIMNO Co., Ltd." },

824 { 0x000325, "Arima Computer Corp." },

825 { 0x000326, "Iwasaki Information Systems Co., Ltd." },

826 { 0x000327, "HMS Industrial Networks" },

827 { 0x000328, "Mace Group, Inc." },

828 { 0x000329, "F3, Inc." },

829 { 0x00032A, "UniData Communication Systems, Inc." },

830 { 0x00032B, "GAI Datenfunksysteme GmbH" },

831 { 0x00032C, "ABB Switzerland Ltd" },

832 { 0x00032D, "IBASE Technology, Inc." },

833 { 0x00032E, "Scope Information Management, Ltd." },

834 { 0x00032F, "Global Sun Technology, Inc." },

835 { 0x000330, "Imagenics, Co., Ltd." },

836 { 0x000331, "Cisco Systems, Inc" },

837 { 0x000332, "Cisco Systems, Inc" },

838 { 0x000333, "Digitel Co., Ltd." },

839 { 0x000334, "Omega Engineering Inc." },

840 { 0x000335, "Mirae Technology" },

841 { 0x000336, "Zetes Technologies" },

842 { 0x000337, "Vaone, Inc." },

843 { 0x000338, "Oak Technology" },

844 { 0x000339, "Eurologic Systems, Ltd." },

845 { 0x00033A, "Silicon Wave, Inc." },

846 { 0x00033B, "TAMI Tech Co., Ltd." },

847 { 0x00033C, "Daiden Co., Ltd." },

848 { 0x00033D, "ILSHin Lab" },

849 { 0x00033E, "Tateyama System Laboratory Co., Ltd." },

850 { 0x00033F, "BigBand Networks, Ltd." },

851 { 0x000340, "Floware Wireless Systems, Ltd." },

852 { 0x000341, "Axon Digital Design" },

853 { 0x000342, "Nortel Networks" },

854 { 0x000343, "Martin Professional A/S" },

855 { 0x000344, "Tietech.Co., Ltd." },

856 { 0x000345, "Routrek Networks Corporation" },

857 { 0x000346, "Hitachi Kokusai Electric, Inc." },

858 { 0x000347, "Intel Corporation" },

859 { 0x000348, "Norscan Instruments, Ltd." },

860 { 0x000349, "Vidicode Datacommunicatie B.V." },

861 { 0x00034A, "RIAS Corporation" },

862 { 0x00034B, "Nortel Networks" },

863 { 0x00034C, "Shanghai DigiVision Technology Co., Ltd." },

864 { 0x00034D, "Chiaro Networks, Ltd." },

865 { 0x00034E, "Pos Data Company, Ltd." },

866 { 0x00034F, "Sur-Gard Security" },

867 { 0x000350, "BTICINO SPA" },

868 { 0x000351, "Diebold Nixdorf" },

869 { 0x000352, "Colubris Networks" },

870 { 0x000353, "Mitac, Inc." },

871 { 0x000354, "Fiber Logic Communications" },

872 { 0x000355, "TeraBeam Internet Systems" },

873 { 0x000356, "Diebold Nixdorf" },

874 { 0x000357, "Intervoice-Brite, Inc." },

875 { 0x000358, "Hanyang Digitech Co.Ltd" },

876 { 0x000359, "DigitalSis" },

877 { 0x00035A, "Photron Limited" },

878 { 0x00035B, "BridgeWave Communications" },

879 { 0x00035C, "Saint Song Corp." },

880 { 0x00035D, "Bosung Hi-Net Co., Ltd." },

881 { 0x00035E, "Metropolitan Area Networks, Inc." },

882 { 0x00035F, "Prüftechnik Condition Monitoring GmbH & Co. KG" },

883 { 0x000360, "PAC Interactive Technology, Inc." },

884 { 0x000361, "Widcomm, Inc." },

885 { 0x000362, "Vodtel Communications, Inc." },

886 { 0x000363, "Miraesys Co., Ltd." },

887 { 0x000364, "Scenix Semiconductor, Inc." },

888 { 0x000365, "Kira Information & Communications, Ltd." },

889 { 0x000366, "ASM Pacific Technology" },

890 { 0x000367, "Jasmine Networks, Inc." },

891 { 0x000368, "Embedone Co., Ltd." },

892 { 0x000369, "Nippon Antenna Co., Ltd." },

893 { 0x00036A, "Mainnet, Ltd." },

894 { 0x00036B, "Cisco Systems, Inc" },

895 { 0x00036C, "Cisco Systems, Inc" },

896 { 0x00036D, "Runtop, Inc." },

897 { 0x00036E, "Nicon Systems (Pty) Limited" },

898 { 0x00036F, "Telsey SPA" },

899 { 0x000370, "NXTV, Inc." },

900 { 0x000371, "Acomz Networks Corp." },

901 { 0x000372, "ULAN" },

902 { 0x000373, "Aselsan A.S" },

903 { 0x000374, "Control Microsystems" },

904 { 0x000375, "NetMedia, Inc." },

905 { 0x000376, "Graphtec Technology, Inc." },

906 { 0x000377, "Gigabit Wireless" },

907 { 0x000378, "HUMAX Co., Ltd." },

908 { 0x000379, "Proscend Communications, Inc." },

909 { 0x00037A, "Taiyo Yuden Co., Ltd." },

910 { 0x00037B, "IDEC IZUMI Corporation" },

911 { 0x00037C, "Coax Media" },

912 { 0x00037D, "Stellcom" },

913 { 0x00037E, "PORTech Communications, Inc." },

914 { 0x00037F, "Atheros Communications, Inc." },

915 { 0x000380, "SSH Communications Security Corp." },

916 { 0x000381, "Ingenico International" },

917 { 0x000382, "A-One Co., Ltd." },

918 { 0x000383, "Metera Networks, Inc." },

919 { 0x000384, "AETA" },

920 { 0x000385, "Actelis Networks, Inc." },

921 { 0x000386, "Ho Net, Inc." },

922 { 0x000387, "Blaze Network Products" },

923 { 0x000388, "Fastfame Technology Co., Ltd." },

924 { 0x000389, "PLANTRONICS, INC." },

925 { 0x00038A, "America Online, Inc." },

926 { 0x00038B, "PLUS-ONE I&T, Inc." },

927 { 0x00038C, "Total Impact" },

928 { 0x00038D, "PCS Revenue Control Systems, Inc." },

929 { 0x00038E, "Atoga Systems, Inc." },

930 { 0x00038F, "Weinschel Corporation" },

931 { 0x000390, "Digital Video Communications, Inc." },

932 { 0x000391, "Advanced Digital Broadcast, Ltd." },

933 { 0x000392, "Hyundai Teletek Co., Ltd." },

934 { 0x000393, "Apple, Inc." },

935 { 0x000394, "Connect One" },

936 { 0x000395, "California Amplifier" },

937 { 0x000396, "EZ Cast Co., Ltd." },

938 { 0x000397, "FireBrick Limited" },

939 { 0x000398, "WISI" },

940 { 0x000399, "Dongju Informations & Communications Co., Ltd." },

941 { 0x00039A, "SiConnect" },

942 { 0x00039B, "NetChip Technology, Inc." },

943 { 0x00039C, "OptiMight Communications, Inc." },

944 { 0x00039D, "Qisda Corporation" },

945 { 0x00039E, "Tera System Co., Ltd." },

946 { 0x00039F, "Cisco Systems, Inc" },

947 { 0x0003A0, "Cisco Systems, Inc" },

948 { 0x0003A1, "HIPER Information & Communication, Inc." },

949 { 0x0003A2, "Catapult Communications" },

950 { 0x0003A3, "MAVIX, Ltd." },

951 { 0x0003A4, "Imation Corp." },

952 { 0x0003A5, "Medea Corporation" },

953 { 0x0003A6, "Traxit Technology, Inc." },

954 { 0x0003A7, "Unixtar Technology, Inc." },

955 { 0x0003A8, "IDOT Computers, Inc." },

956 { 0x0003A9, "AXCENT Media AG" },

957 { 0x0003AA, "Watlow" },

958 { 0x0003AB, "Bridge Information Systems" },

959 { 0x0003AC, "Fronius Schweissmaschinen" },

960 { 0x0003AD, "Emerson Energy Systems AB" },

961 { 0x0003AE, "Allied Advanced Manufacturing Pte, Ltd." },

962 { 0x0003AF, "Paragea Communications" },

963 { 0x0003B0, "Xsense Technology Corp." },

964 { 0x0003B1, "ICU Medical, Inc." },

965 { 0x0003B2, "Radware" },

966 { 0x0003B3, "IA Link Systems Co., Ltd." },

967 { 0x0003B4, "Macrotek International Corp." },

968 { 0x0003B5, "Entra Technology Co." },

969 { 0x0003B6, "QSI Corporation" },

970 { 0x0003B7, "ZACCESS Systems" },

971 { 0x0003B8, "NetKit Solutions, LLC" },

972 { 0x0003B9, "Hualong Telecom Co., Ltd." },

973 { 0x0003BA, "Oracle Corporation" },

974 { 0x0003BB, "Signal Communications Limited" },

975 { 0x0003BC, "COT GmbH" },

976 { 0x0003BD, "OmniCluster Technologies, Inc." },

977 { 0x0003BE, "Netility" },

978 { 0x0003BF, "Centerpoint Broadband Technologies, Inc." },

979 { 0x0003C0, "RFTNC Co., Ltd." },

980 { 0x0003C1, "Packet Dynamics Ltd" },

981 { 0x0003C2, "Solphone K.K." },

982 { 0x0003C3, "Micronik Multimedia" },

983 { 0x0003C4, "Tomra Systems ASA" },

984 { 0x0003C5, "Mobotix AG" },

985 { 0x0003C6, "ICUE Systems, Inc." },

986 { 0x0003C7, "hopf Elektronik GmbH" },

987 { 0x0003C8, "CML Emergency Services" },

988 { 0x0003C9, "TECOM Co., Ltd." },

989 { 0x0003CA, "MTS Systems Corp." },

990 { 0x0003CB, "SystemGear Co., Ltd." },

991 { 0x0003CC, "Momentum Computer, Inc." },

992 { 0x0003CD, "Clovertech, Inc." },

993 { 0x0003CE, "ETEN Technologies, Inc." },

994 { 0x0003CF, "Muxcom, Inc." },

995 { 0x0003D0, "KOANKEISO Co., Ltd." },

996 { 0x0003D1, "Takaya Corporation" },

997 { 0x0003D2, "Crossbeam Systems, Inc." },

998 { 0x0003D3, "Internet Energy Systems, Inc." },

999 { 0x0003D4, "Alloptic, Inc." },

1000 { 0x0003D5, "Advanced Communications Co., Ltd." },

1001 { 0x0003D6, "RADVision, Ltd." },

1002 { 0x0003D7, "NextNet Wireless, Inc." },

1003 { 0x0003D8, "iMPath Networks, Inc." },

1004 { 0x0003D9, "Secheron SA" },

1005 { 0x0003DA, "Takamisawa Cybernetics Co., Ltd." },

1006 { 0x0003DB, "Apogee Electronics Corp." },

1007 { 0x0003DC, "Lexar Media, Inc." },

1008 { 0x0003DD, "Comark Interactive Solutions" },

1009 { 0x0003DE, "OTC Wireless" },

1010 { 0x0003DF, "Desana Systems" },

1011 { 0x0003E0, "ARRIS Group, Inc." },

1012 { 0x0003E1, "Winmate Communication, Inc." },

1013 { 0x0003E2, "Comspace Corporation" },

1014 { 0x0003E3, "Cisco Systems, Inc" },

1015 { 0x0003E4, "Cisco Systems, Inc" },

1016 { 0x0003E5, "Hermstedt SG" },

1017 { 0x0003E6, "Entone, Inc." },

1018 { 0x0003E7, "Logostek Co. Ltd." },

1019 { 0x0003E8, "Wavesight Limited" },

1020 { 0x0003E9, "Akara Canada, Inc." },

1021 { 0x0003EA, "Mega System Technologies, Inc." },

1022 { 0x0003EB, "Atrica" },

1023 { 0x0003EC, "ICG Research, Inc." },

1024 { 0x0003ED, "Shinkawa Electric Co., Ltd." },

1025 { 0x0003EE, "MKNet Corporation" },

1026 { 0x0003EF, "Oneline AG" },

1027 { 0x0003F0, "Redfern Broadband Networks" },

1028 { 0x0003F1, "Cicada Semiconductor, Inc." },

1029 { 0x0003F2, "Seneca Networks" },

1030 { 0x0003F3, "Dazzle Multimedia, Inc." },

1031 { 0x0003F4, "NetBurner" },

1032 { 0x0003F5, "Chip2Chip" },

1033 { 0x0003F6, "Allegro Networks, Inc." },

1034 { 0x0003F7, "Plast-Control GmbH" },

1035 { 0x0003F8, "SanCastle Technologies, Inc." },

1036 { 0x0003F9, "Pleiades Communications, Inc." },

1037 { 0x0003FA, "TiMetra Networks" },

1038 { 0x0003FB, "ENEGATE Co.,Ltd." },

1039 { 0x0003FC, "Intertex Data AB" },

1040 { 0x0003FD, "Cisco Systems, Inc" },

1041 { 0x0003FE, "Cisco Systems, Inc" },

1042 { 0x0003FF, "Microsoft Corporation" },

1043 { 0x000400, "LEXMARK INTERNATIONAL, INC." },

1044 { 0x000401, "Osaki Electric Co., Ltd." },

1045 { 0x000402, "Nexsan Technologies, Ltd." },

1046 { 0x000403, "Nexsi Corporation" },

1047 { 0x000404, "Makino Milling Machine Co., Ltd." },

1048 { 0x000405, "ACN Technologies" },

1049 { 0x000406, "Fa. Metabox AG" },

1050 { 0x000407, "Topcon Positioning Systems, Inc." },

1051 { 0x000408, "Sanko Electronics Co., Ltd." },

1052 { 0x000409, "Cratos Networks" },

1053 { 0x00040A, "Sage Systems" },

1054 { 0x00040B, "3COM EUROPE LTD" },

1055 { 0x00040C, "Kanno Works, Ltd." },

1056 { 0x00040D, "Avaya Inc" },

1057 { 0x00040E, "AVM GmbH" },

1058 { 0x00040F, "Asus Network Technologies, Inc." },

1059 { 0x000410, "Spinnaker Networks, Inc." },

1060 { 0x000411, "Inkra Networks, Inc." },

1061 { 0x000412, "WaveSmith Networks, Inc." },

1062 { 0x000413, "snom technology GmbH" },

1063 { 0x000414, "Umezawa Musen Denki Co., Ltd." },

1064 { 0x000415, "Rasteme Systems Co., Ltd." },

1065 { 0x000416, "Parks S/A Comunicacoes Digitais" },

1066 { 0x000417, "ELAU AG" },

1067 { 0x000418, "Teltronic S.A.U." },

1068 { 0x000419, "Fibercycle Networks, Inc." },

1069 { 0x00041A, "Ines Test and Measurement GmbH & CoKG" },

1070 { 0x00041B, "Bridgeworks Ltd." },

1071 { 0x00041C, "ipDialog, Inc." },

1072 { 0x00041D, "Corega of America" },

1073 { 0x00041E, "Shikoku Instrumentation Co., Ltd." },

1074 { 0x00041F, "Sony Interactive Entertainment Inc." },

1075 { 0x000420, "Slim Devices, Inc." },

1076 { 0x000421, "Ocular Networks" },

1077 { 0x000422, "Studio Technologies, Inc" },

1078 { 0x000423, "Intel Corporation" },

1079 { 0x000424, "TMC s.r.l." },

1080 { 0x000425, "Atmel Corporation" },

1081 { 0x000426, "Autosys" },

1082 { 0x000427, "Cisco Systems, Inc" },

1083 { 0x000428, "Cisco Systems, Inc" },

1084 { 0x000429, "Pixord Corporation" },

1085 { 0x00042A, "Wireless Networks, Inc." },

1086 { 0x00042B, "IT Access Co., Ltd." },

1087 { 0x00042C, "Minet, Inc." },

1088 { 0x00042D, "Sarian Systems, Ltd." },

1089 { 0x00042E, "Netous Technologies, Ltd." },

1090 { 0x00042F, "International Communications Products, Inc." },

1091 { 0x000430, "Netgem" },

1092 { 0x000431, "GlobalStreams, Inc." },

1093 { 0x000432, "Voyetra Turtle Beach, Inc." },

1094 { 0x000433, "Cyberboard A/S" },

1095 { 0x000434, "Accelent Systems, Inc." },

1096 { 0x000435, "InfiNet LLC" },

1097 { 0x000436, "ELANsat Technologies, Inc." },

1098 { 0x000437, "Powin Information Technology, Inc." },

1099 { 0x000438, "Nortel Networks" },

1100 { 0x000439, "Rosco Entertainment Technology, Inc." },

1101 { 0x00043A, "Intelligent Telecommunications, Inc." },

1102 { 0x00043B, "Lava Computer Mfg., Inc." },

1103 { 0x00043C, "SONOS Co., Ltd." },

1104 { 0x00043D, "INDEL AG" },

1105 { 0x00043E, "Telencomm" },

1106 { 0x00043F, "ESTeem Wireless Modems, Inc" },

1107 { 0x000440, "cyberPIXIE, Inc." },

1108 { 0x000441, "Half Dome Systems, Inc." },

1109 { 0x000442, "NACT" },

1110 { 0x000443, "Agilent Technologies, Inc." },

1111 { 0x000444, "Western Multiplex Corporation" },

1112 { 0x000445, "LMS Skalar Instruments GmbH" },

1113 { 0x000446, "CYZENTECH Co., Ltd." },

1114 { 0x000447, "Acrowave Systems Co., Ltd." },

1115 { 0x000448, "Polaroid Corporation" },

1116 { 0x000449, "Mapletree Networks" },

1117 { 0x00044A, "iPolicy Networks, Inc." },

1118 { 0x00044B, "NVIDIA" },

1119 { 0x00044C, "JENOPTIK" },

1120 { 0x00044D, "Cisco Systems, Inc" },

1121 { 0x00044E, "Cisco Systems, Inc" },

1122 { 0x00044F, "Schubert System Elektronik Gmbh" },

1123 { 0x000450, "DMD Computers SRL" },

1124 { 0x000451, "Medrad, Inc." },

1125 { 0x000452, "RocketLogix, Inc." },

1126 { 0x000453, "YottaYotta, Inc." },

1127 { 0x000454, "Quadriga UK" },

1128 { 0x000455, "ANTARA.net" },

1129 { 0x000456, "Cambium Networks Limited" },

1130 { 0x000457, "Universal Access Technology, Inc." },

1131 { 0x000458, "Fusion X Co., Ltd." },

1132 { 0x000459, "Veristar Corporation" },

1133 { 0x00045A, "The Linksys Group, Inc." },

1134 { 0x00045B, "Techsan Electronics Co., Ltd." },

1135 { 0x00045C, "Mobiwave Pte Ltd" },

1136 { 0x00045D, "BEKA Elektronik" },

1137 { 0x00045E, "PolyTrax Information Technology AG" },

1138 { 0x00045F, "Avalue Technology, Inc." },

1139 { 0x000460, "Knilink Technology, Inc." },

1140 { 0x000461, "EPOX Computer Co., Ltd." },

1141 { 0x000462, "DAKOS Data & Communication Co., Ltd." },

1142 { 0x000463, "Bosch Security Systems" },

1143 { 0x000464, "Pulse-Link Inc" },

1144 { 0x000465, "i.s.t isdn-support technik GmbH" },

1145 { 0x000466, "ARMITEL Co." },

1146 { 0x000467, "Wuhan Research Institute of MII" },

1147 { 0x000468, "Vivity, Inc." },

1148 { 0x000469, "Innocom, Inc." },

1149 { 0x00046A, "Navini Networks" },

1150 { 0x00046B, "Palm Wireless, Inc." },

1151 { 0x00046C, "Cyber Technology Co., Ltd." },

1152 { 0x00046D, "Cisco Systems, Inc" },

1153 { 0x00046E, "Cisco Systems, Inc" },

1154 { 0x00046F, "Digitel S/A Industria Eletronica" },

1155 { 0x000470, "ipUnplugged AB" },

1156 { 0x000471, "IPrad" },

1157 { 0x000472, "Telelynx, Inc." },

1158 { 0x000473, "Photonex Corporation" },

1159 { 0x000474, "LEGRAND" },

1160 { 0x000475, "3COM" },

1161 { 0x000476, "3COM" },

1162 { 0x000477, "Scalant Systems, Inc." },

1163 { 0x000478, "G. Star Technology Corporation" },

1164 { 0x000479, "Radius Co., Ltd." },

1165 { 0x00047A, "AXXESSIT ASA" },

1166 { 0x00047B, "Schlumberger" },

1167 { 0x00047C, "Skidata AG" },

1168 { 0x00047D, "Motorola Solutions Inc." },

1169 { 0x00047E, "Siqura B.V." },

1170 { 0x00047F, "Chr. Mayr GmbH & Co. KG" },

1171 { 0x000480, "Brocade Communications Systems LLC" },

1172 { 0x000481, "Econolite Control Products, Inc." },

1173 { 0x000482, "Medialogic Corp." },

1174 { 0x000483, "Deltron Technology, Inc." },

1175 { 0x000484, "Amann GmbH" },

1176 { 0x000485, "PicoLight" },

1177 { 0x000486, "ITTC, University of Kansas" },

1178 { 0x000487, "Cogency Semiconductor, Inc." },

1179 { 0x000488, "Eurotherm Controls" },

1180 { 0x000489, "YAFO Networks, Inc." },

1181 { 0x00048A, "Temia Vertriebs GmbH" },

1182 { 0x00048B, "Poscon Corporation" },

1183 { 0x00048C, "Nayna Networks, Inc." },

1184 { 0x00048D, "Teo Technologies, Inc" },

1185 { 0x00048E, "Ohm Tech Labs, Inc." },

1186 { 0x00048F, "TD Systems Corporation" },

1187 { 0x000490, "Optical Access" },

1188 { 0x000491, "Technovision, Inc." },

1189 { 0x000492, "Hive Internet, Ltd." },

1190 { 0x000493, "Tsinghua Unisplendour Co., Ltd." },

1191 { 0x000494, "Breezecom, Ltd." },

1192 { 0x000495, "Tejas Networks India Limited" },

1193 { 0x000496, "Extreme Networks Headquarters" },

1194 { 0x000497, "MacroSystem Digital Video AG" },

1195 { 0x000498, "Mahi Networks" },

1196 { 0x000499, "Chino Corporation" },

1197 { 0x00049A, "Cisco Systems, Inc" },

1198 { 0x00049B, "Cisco Systems, Inc" },

1199 { 0x00049C, "Surgient Networks, Inc." },

1200 { 0x00049D, "Ipanema Technologies" },

1201 { 0x00049E, "Wirelink Co., Ltd." },

1202 { 0x00049F, "Freescale Semiconductor" },

1203 { 0x0004A0, "Verity Instruments, Inc." },

1204 { 0x0004A1, "Pathway Connectivity" },

1205 { 0x0004A2, "L.S.I. Japan Co., Ltd." },

1206 { 0x0004A3, "Microchip Technology Inc." },

1207 { 0x0004A4, "NetEnabled, Inc." },

1208 { 0x0004A5, "Barco NV" },

1209 { 0x0004A6, "SAF Tehnika Ltd." },

1210 { 0x0004A7, "FabiaTech Corporation" },

1211 { 0x0004A8, "Broadmax Technologies, Inc." },

1212 { 0x0004A9, "SandStream Technologies, Inc." },

1213 { 0x0004AA, "Jetstream Communications" },

1214 { 0x0004AB, "Mavenir Inc." },

1215 { 0x0004AC, "IBM Corp" },

1216 { 0x0004AD, "Malibu Networks" },

1217 { 0x0004AE, "Sullair Corporation" },

1218 { 0x0004AF, "Digital Fountain, Inc." },

1219 { 0x0004B0, "ELESIGN Co., Ltd." },

1220 { 0x0004B1, "Signal Technology, Inc." },

1221 { 0x0004B2, "ESSEGI SRL" },

1222 { 0x0004B3, "Videotek, Inc." },

1223 { 0x0004B4, "CIAC" },

1224 { 0x0004B5, "Equitrac Corporation" },

1225 { 0x0004B6, "Stratex Networks, Inc." },

1226 { 0x0004B7, "AMB i.t. Holding" },

1227 { 0x0004B8, "Kumahira Co., Ltd." },

1228 { 0x0004B9, "S.I. Soubou, Inc." },

1229 { 0x0004BA, "KDD Media Will Corporation" },

1230 { 0x0004BB, "Bardac Corporation" },

1231 { 0x0004BC, "Giantec, Inc." },

1232 { 0x0004BD, "ARRIS Group, Inc." },

1233 { 0x0004BE, "OptXCon, Inc." },

1234 { 0x0004BF, "VersaLogic Corp." },

1235 { 0x0004C0, "Cisco Systems, Inc" },

1236 { 0x0004C1, "Cisco Systems, Inc" },

1237 { 0x0004C2, "Magnipix, Inc." },

1238 { 0x0004C3, "CASTOR Informatique" },

1239 { 0x0004C4, "Audiotonix Group Limited" },

1240 { 0x0004C5, "ASE Technologies, USA" },

1241 { 0x0004C6, "YAMAHA MOTOR CO.,LTD" },

1242 { 0x0004C7, "NetMount" },

1243 { 0x0004C8, "LIBA Maschinenfabrik GmbH" },

1244 { 0x0004C9, "Micro Electron Co., Ltd." },

1245 { 0x0004CA, "FreeMs Corp." },

1246 { 0x0004CB, "Tdsoft Communication, Ltd." },

1247 { 0x0004CC, "Peek Traffic B.V." },

1248 { 0x0004CD, "Extenway Solutions Inc" },

1249 { 0x0004CE, "Patria Ailon" },

1250 { 0x0004CF, "Seagate Technology" },

1251 { 0x0004D0, "Softlink s.r.o." },

1252 { 0x0004D1, "Drew Technologies, Inc." },

1253 { 0x0004D2, "Adcon Telemetry GmbH" },

1254 { 0x0004D3, "Toyokeiki Co., Ltd." },

1255 { 0x0004D4, "Proview Electronics Co., Ltd." },

1256 { 0x0004D5, "Hitachi Information & Communication Engineering, Ltd." },

1257 { 0x0004D6, "Takagi Industrial Co., Ltd." },

1258 { 0x0004D7, "Omitec Instrumentation Ltd." },

1259 { 0x0004D8, "IPWireless, Inc." },

1260 { 0x0004D9, "Titan Electronics, Inc." },

1261 { 0x0004DA, "Relax Technology, Inc." },

1262 { 0x0004DB, "Tellus Group Corp." },

1263 { 0x0004DC, "Nortel Networks" },

1264 { 0x0004DD, "Cisco Systems, Inc" },

1265 { 0x0004DE, "Cisco Systems, Inc" },

1266 { 0x0004DF, "TERACOM TELEMATICA S.A" },

1267 { 0x0004E0, "Procket Networks" },

1268 { 0x0004E1, "Infinior Microsystems" },

1269 { 0x0004E2, "SMC Networks, Inc." },

1270 { 0x0004E3, "Accton Technology Corp" },

1271 { 0x0004E4, "Daeryung Ind., Inc." },

1272 { 0x0004E5, "Glonet Systems, Inc." },

1273 { 0x0004E6, "Banyan Network Private Limited" },

1274 { 0x0004E7, "Lightpointe Communications, Inc" },

1275 { 0x0004E8, "IER, Inc." },

1276 { 0x0004E9, "Infiniswitch Corporation" },

1277 { 0x0004EA, "Hewlett Packard" },

1278 { 0x0004EB, "Paxonet Communications, Inc." },

1279 { 0x0004EC, "Memobox SA" },

1280 { 0x0004ED, "Billion Electric Co., Ltd." },

1281 { 0x0004EE, "Lincoln Electric Company" },

1282 { 0x0004EF, "Polestar Corp." },

1283 { 0x0004F0, "International Computers, Ltd" },

1284 { 0x0004F1, "WhereNet" },

1285 { 0x0004F2, "Polycom" },

1286 { 0x0004F3, "FS FORTH-SYSTEME GmbH" },

1287 { 0x0004F4, "Infinite Electronics Inc." },

1288 { 0x0004F5, "SnowShore Networks, Inc." },

1289 { 0x0004F6, "Amphus" },

1290 { 0x0004F7, "Omega Band, Inc." },

1291 { 0x0004F8, "QUALICABLE TV Industria E Com., Ltda" },

1292 { 0x0004F9, "Xtera Communications, Inc." },

1293 { 0x0004FA, "NBS Technologies Inc." },

1294 { 0x0004FB, "Commtech, Inc." },

1295 { 0x0004FC, "Stratus Technologies" },

1296 { 0x0004FD, "Japan Control Engineering Co., Ltd." },

1297 { 0x0004FE, "Pelago Networks" },

1298 { 0x0004FF, "Acronet Co., Ltd." },

1299 { 0x000500, "Cisco Systems, Inc" },

1300 { 0x000501, "Cisco Systems, Inc" },

1301 { 0x000502, "Apple, Inc." },

1302 { 0x000503, "ICONAG" },

1303 { 0x000504, "Naray Information & Communication Enterprise" },

1304 { 0x000505, "Systems Integration Solutions, Inc." },

1305 { 0x000506, "Reddo Networks AB" },

1306 { 0x000507, "Fine Appliance Corp." },

1307 { 0x000508, "Inetcam, Inc." },

1308 { 0x000509, "AVOC Nishimura Ltd." },

1309 { 0x00050A, "ICS Spa" },

1310 { 0x00050B, "SICOM Systems, Inc." },

1311 { 0x00050C, "Network Photonics, Inc." },

1312 { 0x00050D, "Midstream Technologies, Inc." },

1313 { 0x00050E, "3ware, Inc." },

1314 { 0x00050F, "Tanaka S/S Ltd." },

1315 { 0x000510, "Infinite Shanghai Communication Terminals Ltd." },

1316 { 0x000511, "Complementary Technologies Ltd" },

1317 { 0x000512, "Zebra Technologies Inc" },

1318 { 0x000513, "VTLinx Multimedia Systems, Inc." },

1319 { 0x000514, "KDT Systems Co., Ltd." },

1320 { 0x000515, "Nuark Co., Ltd." },

1321 { 0x000516, "SMART Modular Technologies" },

1322 { 0x000517, "Shellcomm, Inc." },

1323 { 0x000518, "Jupiters Technology" },

1324 { 0x000519, "Siemens Building Technologies AG," },

1325 { 0x00051A, "3COM EUROPE LTD" },

1326 { 0x00051B, "Magic Control Technology Corporation" },

1327 { 0x00051C, "Xnet Technology Corp." },

1328 { 0x00051D, "Airocon, Inc." },

1329 { 0x00051E, "Brocade Communications Systems LLC" },

1330 { 0x00051F, "Taijin Media Co., Ltd." },

1331 { 0x000520, "Smartronix, Inc." },

1332 { 0x000521, "Control Microsystems" },

1333 { 0x000522, "LEA*D Corporation, Inc." },

1334 { 0x000523, "AVL List GmbH" },

1335 { 0x000524, "BTL System (HK) Limited" },

1336 { 0x000525, "Puretek Industrial Co., Ltd." },

1337 { 0x000526, "IPAS GmbH" },

1338 { 0x000527, "SJ Tek Co. Ltd" },

1339 { 0x000528, "New Focus, Inc." },

1340 { 0x000529, "Shanghai Broadan Communication Technology Co., Ltd" },

1341 { 0x00052A, "Ikegami Tsushinki Co., Ltd." },

1342 { 0x00052B, "HORIBA, Ltd." },

1343 { 0x00052C, "Supreme Magic Corporation" },

1344 { 0x00052D, "Zoltrix International Limited" },

1345 { 0x00052E, "Cinta Networks" },

1346 { 0x00052F, "Leviton Network Solutions" },

1347 { 0x000530, "Andiamo Systems, Inc." },

1348 { 0x000531, "Cisco Systems, Inc" },

1349 { 0x000532, "Cisco Systems, Inc" },

1350 { 0x000533, "Brocade Communications Systems LLC" },

1351 { 0x000534, "Northstar Engineering Ltd." },

1352 { 0x000535, "Chip PC Ltd." },

1353 { 0x000536, "Danam Communications, Inc." },

1354 { 0x000537, "Nets Technology Co., Ltd." },

1355 { 0x000538, "Merilus, Inc." },

1356 { 0x000539, "A Brand New World in Sweden AB" },

1357 { 0x00053A, "Willowglen Services Pte Ltd" },

1358 { 0x00053B, "Harbour Networks Ltd., Co. Beijing" },

1359 { 0x00053C, "XIRCOM" },

1360 { 0x00053D, "Agere Systems" },

1361 { 0x00053E, "KID Systeme GmbH" },

1362 { 0x00053F, "VisionTek, Inc." },

1363 { 0x000540, "FAST Corporation" },

1364 { 0x000541, "Advanced Systems Co., Ltd." },

1365 { 0x000542, "Otari, Inc." },

1366 { 0x000543, "IQ Wireless GmbH" },

1367 { 0x000544, "Valley Technologies, Inc." },

1368 { 0x000545, "Internet Photonics" },

1369 { 0x000546, "KDDI Network & Solultions Inc." },

1370 { 0x000547, "Starent Networks" },

1371 { 0x000548, "Disco Corporation" },

1372 { 0x000549, "Salira Optical Network Systems" },

1373 { 0x00054A, "Ario Data Networks, Inc." },

1374 { 0x00054B, "Eaton Automation AG" },

1375 { 0x00054C, "RF Innovations Pty Ltd" },

1376 { 0x00054D, "Brans Technologies, Inc." },

1377 { 0x00054E, "Philips" },

1378 { 0x00054F, "Garmin International" },

1379 { 0x000550, "Vcomms Connect Limited" },

1380 { 0x000551, "F & S Elektronik Systeme GmbH" },

1381 { 0x000552, "Xycotec Computer GmbH" },

1382 { 0x000553, "DVC Company, Inc." },

1383 { 0x000554, "Rangestar Wireless" },

1384 { 0x000555, "Japan Cash Machine Co., Ltd." },

1385 { 0x000556, "360 Systems" },

1386 { 0x000557, "Agile TV Corporation" },

1387 { 0x000558, "Synchronous, Inc." },

1388 { 0x000559, "Intracom S.A." },

1389 { 0x00055A, "Power Dsine Ltd." },

1390 { 0x00055B, "Charles Industries, Ltd." },

1391 { 0x00055C, "Kowa Company, Ltd." },

1392 { 0x00055D, "D-LINK SYSTEMS, INC." },

1393 { 0x00055E, "Cisco Systems, Inc" },

1394 { 0x00055F, "Cisco Systems, Inc" },

1395 { 0x000560, "LEADER COMM.CO., LTD" },

1396 { 0x000561, "nac Image Technology, Inc." },

1397 { 0x000562, "Digital View Limited" },

1398 { 0x000563, "J-Works, Inc." },

1399 { 0x000564, "Tsinghua Bitway Co., Ltd." },

1400 { 0x000565, "Tailyn Communication Company Ltd." },

1401 { 0x000566, "Secui.com Corporation" },

1402 { 0x000567, "Etymonic Design, Inc." },

1403 { 0x000568, "Piltofish Networks AB" },

1404 { 0x000569, "VMware, Inc." },

1405 { 0x00056A, "Heuft Systemtechnik GmbH" },

1406 { 0x00056B, "C.P. Technology Co., Ltd." },

1407 { 0x00056C, "Hung Chang Co., Ltd." },

1408 { 0x00056D, "Pacific Corporation" },

1409 { 0x00056E, "National Enhance Technology, Inc." },

1410 { 0x00056F, "Innomedia Technologies Pvt. Ltd." },

1411 { 0x000570, "Baydel Ltd." },

1412 { 0x000571, "Seiwa Electronics Co." },

1413 { 0x000572, "Deonet Co., Ltd." },

1414 { 0x000573, "Cisco Systems, Inc" },

1415 { 0x000574, "Cisco Systems, Inc" },

1416 { 0x000575, "CDS-Electronics BV" },

1417 { 0x000576, "NSM Technology Ltd." },

1418 { 0x000577, "SM Information & Communication" },

1419 { 0x000578, "Private" },

1420 { 0x000579, "Universal Control Solution Corp." },

1421 { 0x00057A, "Overture Networks" },

1422 { 0x00057B, "Chung Nam Electronic Co., Ltd." },

1423 { 0x00057C, "RCO Security AB" },

1424 { 0x00057D, "Sun Communications, Inc." },

1425 { 0x00057E, "Eckelmann Steuerungstechnik GmbH" },

1426 { 0x00057F, "Acqis Technology" },

1427 { 0x000580, "FibroLAN Ltd." },

1428 { 0x000581, "Snell" },

1429 { 0x000582, "ClearCube Technology" },

1430 { 0x000583, "ImageCom Limited" },

1431 { 0x000584, "AbsoluteValue Systems, Inc." },

1432 { 0x000585, "Juniper Networks" },

1433 { 0x000586, "Lucent Technologies" },

1434 { 0x000587, "Locus, Incorporated" },

1435 { 0x000588, "Sensoria Corp." },

1436 { 0x000589, "National Datacomputer" },

1437 { 0x00058A, "Netcom Co., Ltd." },

1438 { 0x00058B, "IPmental, Inc." },

1439 { 0x00058C, "Opentech Inc." },

1440 { 0x00058D, "Lynx Photonic Networks, Inc." },

1441 { 0x00058E, "Flextronics International GmbH & Co. Nfg. KG" },

1442 { 0x00058F, "CLCsoft co." },

1443 { 0x000590, "Swissvoice Ltd." },

1444 { 0x000591, "Active Silicon Ltd" },

1445 { 0x000592, "Pultek Corp." },

1446 { 0x000593, "Grammar Engine Inc." },

1447 { 0x000594, "HMS Industrial Networks" },

1448 { 0x000595, "Alesis Corporation" },

1449 { 0x000596, "Genotech Co., Ltd." },

1450 { 0x000597, "Eagle Traffic Control Systems" },

1451 { 0x000598, "CRONOS S.r.l." },

1452 { 0x000599, "DRS Test and Energy Management or DRS-TEM" },

1453 { 0x00059A, "Cisco Systems, Inc" },

1454 { 0x00059B, "Cisco Systems, Inc" },

1455 { 0x00059C, "Kleinknecht GmbH, Ing. Büro" },

1456 { 0x00059D, "Daniel Computing Systems, Inc." },

1457 { 0x00059E, "Zinwell Corporation" },

1458 { 0x00059F, "Yotta Networks, Inc." },

1459 { 0x0005A0, "MOBILINE Kft." },

1460 { 0x0005A1, "Zenocom" },

1461 { 0x0005A2, "CELOX Networks" },

1462 { 0x0005A3, "QEI, Inc." },

1463 { 0x0005A4, "Lucid Voice Ltd." },

1464 { 0x0005A5, "KOTT" },

1465 { 0x0005A6, "Extron Electronics" },

1466 { 0x0005A7, "HYPERCHIP Inc." },

1467 { 0x0005A8, "WYLE ELECTRONICS" },

1468 { 0x0005A9, "Princeton Networks, Inc." },

1469 { 0x0005AA, "Moore Industries International Inc." },

1470 { 0x0005AB, "Cyber Fone, Inc." },

1471 { 0x0005AC, "Northern Digital, Inc." },

1472 { 0x0005AD, "Topspin Communications, Inc." },

1473 { 0x0005AE, "Mediaport USA" },

1474 { 0x0005AF, "InnoScan Computing A/S" },

1475 { 0x0005B0, "Korea Computer Technology Co., Ltd." },

1476 { 0x0005B1, "ASB Technology BV" },

1477 { 0x0005B2, "Medison Co., Ltd." },

1478 { 0x0005B3, "Asahi-Engineering Co., Ltd." },

1479 { 0x0005B4, "Aceex Corporation" },

1480 { 0x0005B5, "Broadcom Technologies" },

1481 { 0x0005B6, "INSYS Microelectronics GmbH" },

1482 { 0x0005B7, "Arbor Technology Corp." },

1483 { 0x0005B8, "Electronic Design Associates, Inc." },

1484 { 0x0005B9, "Airvana, Inc." },

1485 { 0x0005BA, "Area Netwoeks, Inc." },

1486 { 0x0005BB, "Myspace AB" },

1487 { 0x0005BC, "Resource Data Management Ltd" },

1488 { 0x0005BD, "ROAX BV" },

1489 { 0x0005BE, "Kongsberg Seatex AS" },

1490 { 0x0005BF, "JustEzy Technology, Inc." },

1491 { 0x0005C0, "Digital Network Alacarte Co., Ltd." },

1492 { 0x0005C1, "A-Kyung Motion, Inc." },

1493 { 0x0005C2, "Soronti, Inc." },

1494 { 0x0005C3, "Pacific Instruments, Inc." },

1495 { 0x0005C4, "Telect, Inc." },

1496 { 0x0005C5, "Flaga HF" },

1497 { 0x0005C6, "Triz Communications" },

1498 { 0x0005C7, "I/F-COM A/S" },

1499 { 0x0005C8, "VERYTECH" },

1500 { 0x0005C9, "LG Innotek" },

1501 { 0x0005CA, "Hitron Technology, Inc." },

1502 { 0x0005CB, "ROIS Technologies, Inc." },

1503 { 0x0005CC, "Sumtel Communications, Inc." },

1504 { 0x0005CD, "D&M Holdings Inc." },

1505 { 0x0005CE, "Prolink Microsystems Corporation" },

1506 { 0x0005CF, "Thunder River Technologies, Inc." },

1507 { 0x0005D0, "Solinet Systems" },

1508 { 0x0005D1, "Metavector Technologies" },

1509 { 0x0005D2, "DAP Technologies" },

1510 { 0x0005D3, "eProduction Solutions, Inc." },

1511 { 0x0005D4, "FutureSmart Networks, Inc." },

1512 { 0x0005D5, "Speedcom Wireless" },

1513 { 0x0005D6, "L-3 Linkabit" },

1514 { 0x0005D7, "Vista Imaging, Inc." },

1515 { 0x0005D8, "Arescom, Inc." },

1516 { 0x0005D9, "Techno Valley, Inc." },

1517 { 0x0005DA, "Apex Automationstechnik" },

1518 { 0x0005DB, "PSI Nentec GmbH" },

1519 { 0x0005DC, "Cisco Systems, Inc" },

1520 { 0x0005DD, "Cisco Systems, Inc" },

1521 { 0x0005DE, "Gi Fone Korea, Inc." },

1522 { 0x0005DF, "Electronic Innovation, Inc." },

1523 { 0x0005E0, "Empirix Corp." },

1524 { 0x0005E1, "Trellis Photonics, Ltd." },

1525 { 0x0005E2, "Creativ Network Technologies" },

1526 { 0x0005E3, "LightSand Communications, Inc." },

1527 { 0x0005E4, "Red Lion Controls Inc." },

1528 { 0x0005E5, "Renishaw PLC" },

1529 { 0x0005E6, "Egenera, Inc." },

1530 { 0x0005E7, "Netrake an AudioCodes Company" },

1531 { 0x0005E8, "TurboWave, Inc." },

1532 { 0x0005E9, "Unicess Network, Inc." },

1533 { 0x0005EA, "Rednix" },

1534 { 0x0005EB, "Blue Ridge Networks, Inc." },

1535 { 0x0005EC, "Mosaic Systems Inc." },

1536 { 0x0005ED, "Technikum Joanneum GmbH" },

1537 { 0x0005EE, "Vanderbilt International (SWE) AB" },

1538 { 0x0005EF, "ADOIR Digital Technology" },

1539 { 0x0005F0, "SATEC" },

1540 { 0x0005F1, "Vrcom, Inc." },

1541 { 0x0005F2, "Power R, Inc." },

1542 { 0x0005F3, "Webyn" },

1543 { 0x0005F4, "System Base Co., Ltd." },

1544 { 0x0005F5, "Geospace Technologies" },

1545 { 0x0005F6, "Young Chang Co. Ltd." },

1546 { 0x0005F7, "Analog Devices, Inc." },

1547 { 0x0005F8, "Real Time Access, Inc." },

1548 { 0x0005F9, "TOA Corporation" },

1549 { 0x0005FA, "IPOptical, Inc." },

1550 { 0x0005FB, "ShareGate, Inc." },

1551 { 0x0005FC, "Schenck Pegasus Corp." },

1552 { 0x0005FD, "PacketLight Networks Ltd." },

1553 { 0x0005FE, "Traficon N.V." },

1554 { 0x0005FF, "SNS Solutions, Inc." },

1555 { 0x000600, "Toshiba Teli Corporation" },

1556 { 0x000601, "Otanikeiki Co., Ltd." },

1557 { 0x000602, "Cirkitech Electronics Co." },

1558 { 0x000603, "Baker Hughes Inc." },

1559 { 0x000604, "@Track Communications, Inc." },

1560 { 0x000605, "Inncom International, Inc." },

1561 { 0x000606, "RapidWAN, Inc." },

1562 { 0x000607, "Omni Directional Control Technology Inc." },

1563 { 0x000608, "At-Sky SAS" },

1564 { 0x000609, "Crossport Systems" },

1565 { 0x00060A, "Blue2space" },

1566 { 0x00060B, "Artesyn Embedded Technologies" },

1567 { 0x00060C, "Melco Industries, Inc." },

1568 { 0x00060D, "Wave7 Optics" },

1569 { 0x00060E, "IGYS Systems, Inc." },

1570 { 0x00060F, "Narad Networks Inc" },

1571 { 0x000610, "Abeona Networks Inc" },

1572 { 0x000611, "Zeus Wireless, Inc." },

1573 { 0x000612, "Accusys, Inc." },

1574 { 0x000613, "Kawasaki Microelectronics Incorporated" },

1575 { 0x000614, "Prism Holdings" },

1576 { 0x000615, "Kimoto Electric Co., Ltd." },

1577 { 0x000616, "Tel Net Co., Ltd." },

1578 { 0x000617, "Redswitch Inc." },

1579 { 0x000618, "DigiPower Manufacturing Inc." },

1580 { 0x000619, "Connection Technology Systems" },

1581 { 0x00061A, "Zetari Inc." },

1582 { 0x00061B, "Notebook Development Lab. Lenovo Japan Ltd." },

1583 { 0x00061C, "Hoshino Metal Industries, Ltd." },

1584 { 0x00061D, "MIP Telecom, Inc." },

1585 { 0x00061E, "Maxan Systems" },

1586 { 0x00061F, "Vision Components GmbH" },

1587 { 0x000620, "Serial System Ltd." },

1588 { 0x000621, "Hinox, Co., Ltd." },

1589 { 0x000622, "Chung Fu Chen Yeh Enterprise Corp." },

1590 { 0x000623, "MGE UPS Systems France" },

1591 { 0x000624, "Gentner Communications Corp." },

1592 { 0x000625, "The Linksys Group, Inc." },

1593 { 0x000626, "MWE GmbH" },

1594 { 0x000627, "Uniwide Technologies, Inc." },

1595 { 0x000628, "Cisco Systems, Inc" },

1596 { 0x000629, "IBM Corp" },

1597 { 0x00062A, "Cisco Systems, Inc" },

1598 { 0x00062B, "INTRASERVER TECHNOLOGY" },

1599 { 0x00062C, "Bivio Networks" },

1600 { 0x00062D, "TouchStar Technologies, L.L.C." },

1601 { 0x00062E, "Aristos Logic Corp." },

1602 { 0x00062F, "Pivotech Systems Inc." },

1603 { 0x000630, "Adtranz Sweden" },

1604 { 0x000631, "Calix Inc." },

1605 { 0x000632, "Mesco Engineering GmbH" },

1606 { 0x000633, "Crossmatch Technologies/HID Global" },

1607 { 0x000634, "GTE Airfone Inc." },

1608 { 0x000635, "PacketAir Networks, Inc." },

1609 { 0x000636, "Jedai Broadband Networks" },

1610 { 0x000637, "Toptrend-Meta Information (ShenZhen) Inc." },

1611 { 0x000638, "Sungjin C&C Co., Ltd." },

1612 { 0x000639, "Newtec" },

1613 { 0x00063A, "Dura Micro, Inc." },

1614 { 0x00063B, "Arcturus Networks Inc." },

1615 { 0x00063C, "Intrinsyc Software International Inc." },

1616 { 0x00063D, "Microwave Data Systems Inc." },

1617 { 0x00063E, "Opthos Inc." },

1618 { 0x00063F, "Everex Communications Inc." },

1619 { 0x000640, "White Rock Networks" },

1620 { 0x000641, "ITCN" },

1621 { 0x000642, "Genetel Systems Inc." },

1622 { 0x000643, "SONO Computer Co., Ltd." },

1623 { 0x000644, "NextGen Business Solutions, Inc" },

1624 { 0x000645, "Meisei Electric Co. Ltd." },

1625 { 0x000646, "ShenZhen XunBao Network Technology Co Ltd" },

1626 { 0x000647, "Etrali S.A." },

1627 { 0x000648, "Seedsware, Inc." },

1628 { 0x000649, "3M Deutschland GmbH" },

1629 { 0x00064A, "Honeywell Co., Ltd. (KOREA)" },

1630 { 0x00064B, "Alexon Co., Ltd." },

1631 { 0x00064C, "Invicta Networks, Inc." },

1632 { 0x00064D, "Sencore" },

1633 { 0x00064E, "Broad Net Technology Inc." },

1634 { 0x00064F, "PRO-NETS Technology Corporation" },

1635 { 0x000650, "Tiburon Networks, Inc." },

1636 { 0x000651, "Aspen Networks Inc." },

1637 { 0x000652, "Cisco Systems, Inc" },

1638 { 0x000653, "Cisco Systems, Inc" },

1639 { 0x000654, "Winpresa Building Automation Technologies GmbH" },

1640 { 0x000655, "Yipee, Inc." },

1641 { 0x000656, "Tactel AB" },

1642 { 0x000657, "Market Central, Inc." },

1643 { 0x000658, "Helmut Fischer GmbH Institut für Elektronik und Messtechnik" },

1644 { 0x000659, "EAL (Apeldoorn) B.V." },

1645 { 0x00065A, "Strix Systems" },

1646 { 0x00065B, "Dell Inc." },

1647 { 0x00065C, "Malachite Technologies, Inc." },

1648 { 0x00065D, "Heidelberg Web Systems" },

1649 { 0x00065E, "Photuris, Inc." },

1650 { 0x00065F, "ECI Telecom Ltd." },

1651 { 0x000660, "NADEX Co., Ltd." },

1652 { 0x000661, "NIA Home Technologies Corp." },

1653 { 0x000662, "MBM Technology Ltd." },

1654 { 0x000663, "Human Technology Co., Ltd." },

1655 { 0x000664, "Fostex Corporation" },

1656 { 0x000665, "Sunny Giken, Inc." },

1657 { 0x000666, "Roving Networks" },

1658 { 0x000667, "Tripp Lite" },

1659 { 0x000668, "Vicon Industries Inc." },

1660 { 0x000669, "Datasound Laboratories Ltd" },

1661 { 0x00066A, "InfiniCon Systems, Inc." },

1662 { 0x00066B, "Sysmex Corporation" },

1663 { 0x00066C, "Robinson Corporation" },

1664 { 0x00066D, "Compuprint S.P.A." },

1665 { 0x00066E, "Delta Electronics, Inc." },

1666 { 0x00066F, "Korea Data Systems" },

1667 { 0x000670, "Upponetti Oy" },

1668 { 0x000671, "Softing AG" },

1669 { 0x000672, "Netezza" },

1670 { 0x000673, "TKH Security Solutions USA" },

1671 { 0x000674, "Spectrum Control, Inc." },

1672 { 0x000675, "Banderacom, Inc." },

1673 { 0x000676, "Novra Technologies Inc." },

1674 { 0x000677, "SICK AG" },

1675 { 0x000678, "D&M Holdings Inc." },

1676 { 0x000679, "Konami Corporation" },

1677 { 0x00067A, "JMP Systems" },

1678 { 0x00067B, "Toplink C&C Corporation" },

1679 { 0x00067C, "Cisco Systems, Inc" },

1680 { 0x00067D, "Takasago Ltd." },

1681 { 0x00067E, "WinCom Systems, Inc." },

1682 { 0x00067F, "Digeo, Inc." },

1683 { 0x000680, "Card Access, Inc." },

1684 { 0x000681, "Goepel Electronic GmbH" },

1685 { 0x000682, "Convedia" },

1686 { 0x000683, "Bravara Communications, Inc." },

1687 { 0x000684, "Biacore AB" },

1688 { 0x000685, "NetNearU Corporation" },

1689 { 0x000686, "ZARDCOM Co., Ltd." },

1690 { 0x000687, "Omnitron Systems Technology, Inc." },

1691 { 0x000688, "Telways Communication Co., Ltd." },

1692 { 0x000689, "yLez Technologies Pte Ltd" },

1693 { 0x00068A, "NeuronNet Co. Ltd. R&D Center" },

1694 { 0x00068B, "AirRunner Technologies, Inc." },

1695 { 0x00068C, "3COM" },

1696 { 0x00068D, "SEPATON, Inc." },

1697 { 0x00068E, "HID Corporation" },

1698 { 0x00068F, "Telemonitor, Inc." },

1699 { 0x000690, "Euracom Communication GmbH" },

1700 { 0x000691, "PT Inovacao" },

1701 { 0x000692, "Intruvert Networks, Inc." },

1702 { 0x000693, "Flexus Computer Technology, Inc." },

1703 { 0x000694, "Mobillian Corporation" },

1704 { 0x000695, "Ensure Technologies, Inc." },

1705 { 0x000696, "Advent Networks" },

1706 { 0x000697, "R & D Center" },

1707 { 0x000698, "egnite GmbH" },

1708 { 0x000699, "Vida Design Co." },

1709 { 0x00069A, "e & Tel" },

1710 { 0x00069B, "AVT Audio Video Technologies GmbH" },

1711 { 0x00069C, "Transmode Systems AB" },

1712 { 0x00069D, "Petards Ltd" },

1713 { 0x00069E, "UNIQA, Inc." },

1714 { 0x00069F, "Kuokoa Networks" },

1715 { 0x0006A0, "Mx Imaging" },

1716 { 0x0006A1, "Celsian Technologies, Inc." },

1717 { 0x0006A2, "Microtune, Inc." },

1718 { 0x0006A3, "Bitran Corporation" },

1719 { 0x0006A4, "INNOWELL Corp." },

1720 { 0x0006A5, "PINON Corp." },

1721 { 0x0006A6, "Artistic Licence Engineering Ltd" },

1722 { 0x0006A7, "Primarion" },

1723 { 0x0006A8, "KC Technology, Inc." },

1724 { 0x0006A9, "Universal Instruments Corp." },

1725 { 0x0006AA, "VT Miltope" },

1726 { 0x0006AB, "W-Link Systems, Inc." },

1727 { 0x0006AC, "Intersoft Co." },

1728 { 0x0006AD, "KB Electronics Ltd." },

1729 { 0x0006AE, "Himachal Futuristic Communications Ltd" },

1730 { 0x0006AF, "Xalted Networks" },

1731 { 0x0006B0, "Comtech EF Data Corp." },

1732 { 0x0006B1, "Sonicwall" },

1733 { 0x0006B2, "Linxtek Co." },

1734 { 0x0006B3, "Diagraph Corporation" },

1735 { 0x0006B4, "Vorne Industries, Inc." },

1736 { 0x0006B5, "Source Photonics, Inc." },

1737 { 0x0006B6, "Nir-Or Israel Ltd." },

1738 { 0x0006B7, "TELEM GmbH" },

1739 { 0x0006B8, "Bandspeed Pty Ltd" },

1740 { 0x0006B9, "A5TEK Corp." },

1741 { 0x0006BA, "Westwave Communications" },

1742 { 0x0006BB, "ATI Technologies Inc." },

1743 { 0x0006BC, "Macrolink, Inc." },

1744 { 0x0006BD, "BNTECHNOLOGY Co., Ltd." },

1745 { 0x0006BE, "Baumer Optronic GmbH" },

1746 { 0x0006BF, "Accella Technologies Co., Ltd." },

1747 { 0x0006C0, "United Internetworks, Inc." },

1748 { 0x0006C1, "Cisco Systems, Inc" },

1749 { 0x0006C2, "Smartmatic Corporation" },

1750 { 0x0006C3, "Schindler Elevator Ltd." },

1751 { 0x0006C4, "Piolink Inc." },

1752 { 0x0006C5, "INNOVI Technologies Limited" },

1753 { 0x0006C6, "lesswire AG" },

1754 { 0x0006C7, "RFNET Technologies Pte Ltd (S)" },

1755 { 0x0006C8, "Sumitomo Metal Micro Devices, Inc." },

1756 { 0x0006C9, "Technical Marketing Research, Inc." },

1757 { 0x0006CA, "American Computer & Digital Components, Inc. (ACDC)" },

1758 { 0x0006CB, "Jotron Electronics A/S" },

1759 { 0x0006CC, "JMI Electronics Co., Ltd." },

1760 { 0x0006CD, "Leaf Imaging Ltd." },

1761 { 0x0006CE, "DATENO" },

1762 { 0x0006CF, "Thales Avionics In-Flight Systems, LLC" },

1763 { 0x0006D0, "Elgar Electronics Corp." },

1764 { 0x0006D1, "Tahoe Networks, Inc." },

1765 { 0x0006D2, "Tundra Semiconductor Corp." },

1766 { 0x0006D3, "Alpha Telecom, Inc. U.S.A." },

1767 { 0x0006D4, "Interactive Objects, Inc." },

1768 { 0x0006D5, "Diamond Systems Corp." },

1769 { 0x0006D6, "Cisco Systems, Inc" },

1770 { 0x0006D7, "Cisco Systems, Inc" },

1771 { 0x0006D8, "Maple Optical Systems" },

1772 { 0x0006D9, "IPM-Net S.p.A." },

1773 { 0x0006DA, "ITRAN Communications Ltd." },

1774 { 0x0006DB, "ICHIPS Co., Ltd." },

1775 { 0x0006DC, "Syabas Technology (Amquest)" },

1776 { 0x0006DD, "AT & T Laboratories - Cambridge Ltd" },

1777 { 0x0006DE, "Flash Technology" },

1778 { 0x0006DF, "AIDONIC Corporation" },

1779 { 0x0006E0, "MAT Co., Ltd." },

1780 { 0x0006E1, "Techno Trade s.a" },

1781 { 0x0006E2, "Ceemax Technology Co., Ltd." },

1782 { 0x0006E3, "Quantitative Imaging Corporation" },

1783 { 0x0006E4, "Citel Technologies Ltd." },

1784 { 0x0006E5, "Fujian Newland Computer Ltd. Co." },

1785 { 0x0006E6, "DongYang Telecom Co., Ltd." },

1786 { 0x0006E7, "Bit Blitz Communications Inc." },

1787 { 0x0006E8, "Optical Network Testing, Inc." },

1788 { 0x0006E9, "Intime Corp." },

1789 { 0x0006EA, "ELZET80 Mikrocomputer GmbH&Co. KG" },

1790 { 0x0006EB, "Global Data" },

1791 { 0x0006EC, "Harris Corporation" },

1792 { 0x0006ED, "Inara Networks" },

1793 { 0x0006EE, "Shenyang Neu-era Information & Technology Stock Co., Ltd" },

1794 { 0x0006EF, "Maxxan Systems, Inc." },

1795 { 0x0006F0, "Digeo, Inc." },

1796 { 0x0006F1, "Optillion" },

1797 { 0x0006F2, "Platys Communications" },

1798 { 0x0006F3, "AcceLight Networks" },

1799 { 0x0006F4, "Prime Electronics & Satellitics Inc." },

1800 { 0x0006F5, "ALPSALPINE CO,.LTD" },

1801 { 0x0006F6, "Cisco Systems, Inc" },

1802 { 0x0006F7, "ALPSALPINE CO,.LTD" },

1803 { 0x0006F8, "The Boeing Company" },

1804 { 0x0006F9, "Mitsui Zosen Systems Research Inc." },

1805 { 0x0006FA, "IP SQUARE Co, Ltd." },

1806 { 0x0006FB, "Hitachi Printing Solutions, Ltd." },

1807 { 0x0006FC, "Fnet Co., Ltd." },

1808 { 0x0006FD, "Comjet Information Systems Corp." },

1809 { 0x0006FE, "Ambrado, Inc" },

1810 { 0x0006FF, "Sheba Systems Co., Ltd." },

1811 { 0x000700, "Zettamedia Korea" },

1812 { 0x000701, "RACAL-DATACOM" },

1813 { 0x000702, "Varex Imaging" },

1814 { 0x000703, "CSEE Transport" },

1815 { 0x000704, "ALPSALPINE CO,.LTD" },

1816 { 0x000705, "Endress & Hauser GmbH & Co" },

1817 { 0x000706, "Sanritz Corporation" },

1818 { 0x000707, "Interalia Inc." },

1819 { 0x000708, "Bitrage Inc." },

1820 { 0x000709, "Westerstrand Urfabrik AB" },

1821 { 0x00070A, "Unicom Automation Co., Ltd." },

1822 { 0x00070B, "Novabase SGPS, SA" },

1823 { 0x00070C, "SVA-Intrusion.com Co. Ltd." },

1824 { 0x00070D, "Cisco Systems, Inc" },

1825 { 0x00070E, "Cisco Systems, Inc" },

1826 { 0x00070F, "Fujant, Inc." },

1827 { 0x000710, "Adax, Inc." },

1828 { 0x000711, "Acterna" },

1829 { 0x000712, "JAL Information Technology" },

1830 { 0x000713, "IP One, Inc." },

1831 { 0x000714, "Brightcom" },

1832 { 0x000715, "General Research of Electronics, Inc." },

1833 { 0x000716, "J & S Marine Ltd." },

1834 { 0x000717, "Wieland Electric GmbH" },

1835 { 0x000718, "iCanTek Co., Ltd." },

1836 { 0x000719, "Mobiis Co., Ltd." },

1837 { 0x00071A, "Finedigital Inc." },

1838 { 0x00071B, "CDVI Americas Ltd" },

1839 { 0x00071C, "AT&T" },

1840 { 0x00071D, "Satelsa Sistemas Y Aplicaciones De Telecomunicaciones, S.A." },

1841 { 0x00071E, "Tri-M Engineering / Nupak Dev. Corp." },

1842 { 0x00071F, "European Systems Integration" },

1843 { 0x000720, "Trutzschler GmbH & Co. KG" },

1844 { 0x000721, "Formac Elektronik GmbH" },

1845 { 0x000722, "The Nielsen Company" },

1846 { 0x000723, "ELCON Systemtechnik GmbH" },

1847 { 0x000724, "Telemax Co., Ltd." },

1848 { 0x000725, "Bematech International Corp." },

1849 { 0x000726, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

1850 { 0x000727, "Zi Corporation (HK) Ltd." },

1851 { 0x000728, "Neo Telecom" },

1852 { 0x000729, "Kistler Instrumente AG" },

1853 { 0x00072A, "Innovance Networks" },

1854 { 0x00072B, "Jung Myung Telecom Co., Ltd." },

1855 { 0x00072C, "Fabricom" },

1856 { 0x00072D, "CNSystems" },

1857 { 0x00072E, "North Node AB" },

1858 { 0x00072F, "Intransa, Inc." },

1859 { 0x000730, "Hutchison OPTEL Telecom Technology Co., Ltd." },

1860 { 0x000731, "Ophir-Spiricon LLC" },

1861 { 0x000732, "AAEON Technology Inc." },

1862 { 0x000733, "DANCONTROL Engineering" },

1863 { 0x000734, "ONStor, Inc." },

1864 { 0x000735, "Flarion Technologies, Inc." },

1865 { 0x000736, "Data Video Technologies Co., Ltd." },

1866 { 0x000737, "Soriya Co. Ltd." },

1867 { 0x000738, "Young Technology Co., Ltd." },

1868 { 0x000739, "Scotty Group Austria Gmbh" },

1869 { 0x00073A, "INVENTEL" },

1870 { 0x00073B, "Tenovis GmbH & Co KG" },

1871 { 0x00073C, "Telecom Design" },

1872 { 0x00073D, "Nanjing Postel Telecommunications Co., Ltd." },

1873 { 0x00073E, "China Great-Wall Computer Shenzhen Co., Ltd." },

1874 { 0x00073F, "Woojyun Systec Co., Ltd." },

1875 { 0x000740, "BUFFALO.INC" },

1876 { 0x000741, "Sierra Automated Systems" },

1877 { 0x000742, "Ormazabal" },

1878 { 0x000743, "Chelsio Communications" },

1879 { 0x000744, "Unico, Inc." },

1880 { 0x000745, "Radlan Computer Communications Ltd." },

1881 { 0x000746, "TURCK, Inc." },

1882 { 0x000747, "Mecalc" },

1883 { 0x000748, "The Imaging Source Europe" },

1884 { 0x000749, "CENiX Inc." },

1885 { 0x00074A, "Carl Valentin GmbH" },

1886 { 0x00074B, "Daihen Corporation" },

1887 { 0x00074C, "Beicom Inc." },

1888 { 0x00074D, "Zebra Technologies Corp." },

1889 { 0x00074E, "IPFRONT Inc" },

1890 { 0x00074F, "Cisco Systems, Inc" },

1891 { 0x000750, "Cisco Systems, Inc" },

1892 { 0x000751, "m-u-t AG" },

1893 { 0x000752, "Rhythm Watch Co., Ltd." },

1894 { 0x000753, "Beijing Qxcomm Technology Co., Ltd." },

1895 { 0x000754, "Xyterra Computing, Inc." },

1896 { 0x000755, "Lafon" },

1897 { 0x000756, "Juyoung Telecom" },

1898 { 0x000757, "Topcall International AG" },

1899 { 0x000758, "DragonWave Inc." },

1900 { 0x000759, "Boris Manufacturing Corp." },

1901 { 0x00075A, "Air Products and Chemicals, Inc." },

1902 { 0x00075B, "Gibson Guitars" },

1903 { 0x00075C, "Eastman Kodak Company" },

1904 { 0x00075D, "Celleritas Inc." },

1905 { 0x00075E, "Ametek Power Instruments" },

1906 { 0x00075F, "VCS Video Communication Systems AG" },

1907 { 0x000760, "TOMIS Information & Telecom Corp." },

1908 { 0x000761, "29530" },

1909 { 0x000762, "Group Sense Limited" },

1910 { 0x000763, "Sunniwell Cyber Tech. Co., Ltd." },

1911 { 0x000764, "YoungWoo Telecom Co. Ltd." },

1912 { 0x000765, "Jade Quantum Technologies, Inc." },

1913 { 0x000766, "Chou Chin Industrial Co., Ltd." },

1914 { 0x000767, "Yuxing Electronics Company Limited" },

1915 { 0x000768, "Danfoss A/S" },

1916 { 0x000769, "Italiana Macchi SpA" },

1917 { 0x00076A, "NEXTEYE Co., Ltd." },

1918 { 0x00076B, "Stralfors AB" },

1919 { 0x00076C, "Daehanet, Inc." },

1920 { 0x00076D, "Flexlight Networks" },

1921 { 0x00076E, "Sinetica Corporation Limited" },

1922 { 0x00076F, "Synoptics Limited" },

1923 { 0x000770, "Ubiquoss Inc" },

1924 { 0x000771, "Embedded System Corporation" },

1925 { 0x000772, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

1926 { 0x000773, "Ascom Powerline Communications Ltd." },

1927 { 0x000774, "GuangZhou Thinker Technology Co. Ltd." },

1928 { 0x000775, "Valence Semiconductor, Inc." },

1929 { 0x000776, "Federal APD" },

1930 { 0x000777, "Motah Ltd." },

1931 { 0x000778, "GERSTEL GmbH & Co. KG" },

1932 { 0x000779, "Sungil Telecom Co., Ltd." },

1933 { 0x00077A, "Infoware System Co., Ltd." },

1934 { 0x00077B, "Millimetrix Broadband Networks" },

1935 { 0x00077C, "Westermo Network Technologies AB" },

1936 { 0x00077D, "Cisco Systems, Inc" },

1937 { 0x00077E, "Elrest GmbH" },

1938 { 0x00077F, "J Communications Co., Ltd." },

1939 { 0x000780, "Bluegiga Technologies OY" },

1940 { 0x000781, "Itron Inc." },

1941 { 0x000782, "Oracle Corporation" },

1942 { 0x000783, "SynCom Network, Inc." },

1943 { 0x000784, "Cisco Systems, Inc" },

1944 { 0x000785, "Cisco Systems, Inc" },

1945 { 0x000786, "Wireless Networks Inc." },

1946 { 0x000787, "Idea System Co., Ltd." },

1947 { 0x000788, "Clipcomm, Inc." },

1948 { 0x000789, "Allradio Co., Ltd" },

1949 { 0x00078A, "Mentor Data System Inc." },

1950 { 0x00078B, "Wegener Communications, Inc." },

1951 { 0x00078C, "Elektronikspecialisten i Borlange AB" },

1952 { 0x00078D, "NetEngines Ltd." },

1953 { 0x00078E, "Garz & Fricke GmbH" },

1954 { 0x00078F, "Emkay Innovative Products" },

1955 { 0x000790, "Tri-M Technologies (s) Limited" },

1956 { 0x000791, "International Data Communications, Inc." },

1957 { 0x000792, "Sütron Electronic GmbH" },

1958 { 0x000793, "Shin Satellite Public Company Limited" },

1959 { 0x000794, "Simple Devices, Inc." },

1960 { 0x000795, "Elitegroup Computer Systems Co.,Ltd." },

1961 { 0x000796, "LSI Systems, Inc." },

1962 { 0x000797, "Netpower Co., Ltd." },

1963 { 0x000798, "Selea SRL" },

1964 { 0x000799, "Tipping Point Technologies, Inc." },

1965 { 0x00079A, "Verint Systems Inc" },

1966 { 0x00079B, "Aurora Networks" },

1967 { 0x00079C, "Golden Electronics Technology Co., Ltd." },

1968 { 0x00079D, "Musashi Co., Ltd." },

1969 { 0x00079E, "Ilinx Co., Ltd." },

1970 { 0x00079F, "Action Digital Inc." },

1971 { 0x0007A0, "e-Watch Inc." },

1972 { 0x0007A1, "VIASYS Healthcare GmbH" },

1973 { 0x0007A2, "Opteon Corporation" },

1974 { 0x0007A3, "Ositis Software, Inc." },

1975 { 0x0007A4, "GN Netcom Ltd." },

1976 { 0x0007A5, "Y.D.K Co. Ltd." },

1977 { 0x0007A6, "Leviton Manufacturing Co., Inc." },

1978 { 0x0007A7, "A-Z Inc." },

1979 { 0x0007A8, "Haier Group Technologies Ltd" },

1980 { 0x0007A9, "Novasonics" },

1981 { 0x0007AA, "Quantum Data Inc." },

1982 { 0x0007AB, "Samsung Electronics Co.,Ltd" },

1983 { 0x0007AC, "Eolring" },

1984 { 0x0007AD, "Pentacon GmbH Foto-und Feinwerktechnik" },

1985 { 0x0007AE, "Britestream Networks, Inc." },

1986 { 0x0007AF, "Red Lion Controls, LP" },

1987 { 0x0007B0, "Office Details, Inc." },

1988 { 0x0007B1, "Equator Technologies" },

1989 { 0x0007B2, "Transaccess S.A." },

1990 { 0x0007B3, "Cisco Systems, Inc" },

1991 { 0x0007B4, "Cisco Systems, Inc" },

1992 { 0x0007B5, "Any One Wireless Ltd." },

1993 { 0x0007B6, "Telecom Technology Ltd." },

1994 { 0x0007B7, "Samurai Ind. Prods Eletronicos Ltda" },

1995 { 0x0007B8, "Corvalent Corporation" },

1996 { 0x0007B9, "Ginganet Corporation" },

1997 { 0x0007BA, "UTStarcom Inc" },

1998 { 0x0007BB, "Candera Inc." },

1999 { 0x0007BC, "Identix Inc." },

2000 { 0x0007BD, "Radionet Ltd." },

2001 { 0x0007BE, "DataLogic SpA" },

2002 { 0x0007BF, "Armillaire Technologies, Inc." },

2003 { 0x0007C0, "NetZerver Inc." },

2004 { 0x0007C1, "Overture Networks, Inc." },

2005 { 0x0007C2, "Netsys Telecom" },

2006 { 0x0007C3, "Thomson" },

2007 { 0x0007C4, "JEAN Co. Ltd." },

2008 { 0x0007C5, "Gcom, Inc." },

2009 { 0x0007C6, "VDS Vosskuhler GmbH" },

2010 { 0x0007C7, "Synectics Systems Limited" },

2011 { 0x0007C8, "Brain21, Inc." },

2012 { 0x0007C9, "Technol Seven Co., Ltd." },

2013 { 0x0007CA, "Creatix Polymedia Ges Fur Kommunikaitonssysteme" },

2014 { 0x0007CB, "FREEBOX SAS" },

2015 { 0x0007CC, "Kaba Benzing GmbH" },

2016 { 0x0007CD, "Kumoh Electronic Co, Ltd" },

2017 { 0x0007CE, "Cabletime Limited" },

2018 { 0x0007CF, "Anoto AB" },

2019 { 0x0007D0, "Automat Engenharia de Automação Ltda." },

2020 { 0x0007D1, "Spectrum Signal Processing Inc." },

2021 { 0x0007D2, "Logopak Systeme GmbH & Co. KG" },

2022 { 0x0007D3, "SPGPrints B.V." },

2023 { 0x0007D4, "Zhejiang Yutong Network Communication Co Ltd." },

2024 { 0x0007D5, "3e Technologies Int;., Inc." },

2025 { 0x0007D6, "Commil Ltd." },

2026 { 0x0007D7, "Caporis Networks AG" },

2027 { 0x0007D8, "Hitron Technologies. Inc" },

2028 { 0x0007D9, "Splicecom" },

2029 { 0x0007DA, "Neuro Telecom Co., Ltd." },

2030 { 0x0007DB, "Kirana Networks, Inc." },

2031 { 0x0007DC, "Atek Co, Ltd." },

2032 { 0x0007DD, "Cradle Technologies" },

2033 { 0x0007DE, "eCopilt AB" },

2034 { 0x0007DF, "Vbrick Systems Inc." },

2035 { 0x0007E0, "Palm Inc." },

2036 { 0x0007E1, "WIS Communications Co. Ltd." },

2037 { 0x0007E2, "Bitworks, Inc." },

2038 { 0x0007E3, "Navcom Technology, Inc." },

2039 { 0x0007E4, "SoftRadio Co., Ltd." },

2040 { 0x0007E5, "Coup Corporation" },

2041 { 0x0007E6, "edgeflow Canada Inc." },

2042 { 0x0007E7, "FreeWave Technologies" },

2043 { 0x0007E8, "EdgeWave" },

2044 { 0x0007E9, "Intel Corporation" },

2045 { 0x0007EA, "Massana, Inc." },

2046 { 0x0007EB, "Cisco Systems, Inc" },

2047 { 0x0007EC, "Cisco Systems, Inc" },

2048 { 0x0007ED, "Altera Corporation" },

2049 { 0x0007EE, "telco Informationssysteme GmbH" },

2050 { 0x0007EF, "Lockheed Martin Tactical Systems" },

2051 { 0x0007F0, "LogiSync LLC" },

2052 { 0x0007F1, "TeraBurst Networks Inc." },

2053 { 0x0007F2, "IOA Corporation" },

2054 { 0x0007F3, "Thinkengine Networks" },

2055 { 0x0007F4, "Eletex Co., Ltd." },

2056 { 0x0007F5, "Bridgeco Co AG" },

2057 { 0x0007F6, "Qqest Software Systems" },

2058 { 0x0007F7, "Galtronics" },

2059 { 0x0007F8, "ITDevices, Inc." },

2060 { 0x0007F9, "Sensaphone" },

2061 { 0x0007FA, "ITT Co., Ltd." },

2062 { 0x0007FB, "Giga Stream UMTS Technologies GmbH" },

2063 { 0x0007FC, "Adept Systems Inc." },

2064 { 0x0007FD, "LANergy Ltd." },

2065 { 0x0007FE, "Rigaku Corporation" },

2066 { 0x0007FF, "Gluon Networks" },

2067 { 0x000800, "MULTITECH SYSTEMS, INC." },

2068 { 0x000801, "HighSpeed Surfing Inc." },

2069 { 0x000802, "Hewlett Packard" },

2070 { 0x000803, "Cos Tron" },

2071 { 0x000804, "ICA Inc." },

2072 { 0x000805, "Techno-Holon Corporation" },

2073 { 0x000806, "Raonet Systems, Inc." },

2074 { 0x000807, "Access Devices Limited" },

2075 { 0x000808, "PPT Vision, Inc." },

2076 { 0x000809, "Systemonic AG" },

2077 { 0x00080A, "Espera-Werke GmbH" },

2078 { 0x00080B, "Birka BPA Informationssystem AB" },

2079 { 0x00080C, "VDA Group S.p.a." },

2080 { 0x00080D, "Toshiba" },

2081 { 0x00080E, "ARRIS Group, Inc." },

2082 { 0x00080F, "Proximion Fiber Optics AB" },

2083 { 0x000810, "Key Technology, Inc." },

2084 { 0x000811, "VOIX Corporation" },

2085 { 0x000812, "GM-2 Corporation" },

2086 { 0x000813, "Diskbank, Inc." },

2087 { 0x000814, "TIL Technologies" },

2088 { 0x000815, "CATS Co., Ltd." },

2089 { 0x000816, "Bluelon ApS" },

2090 { 0x000817, "EmergeCore Networks LLC" },

2091 { 0x000818, "Pixelworks, Inc." },

2092 { 0x000819, "Banksys" },

2093 { 0x00081A, "Sanrad Intelligence Storage Communications (2000) Ltd." },

2094 { 0x00081B, "Windigo Systems" },

2095 { 0x00081C, "@pos.com" },

2096 { 0x00081D, "Ipsil, Incorporated" },

2097 { 0x00081E, "Repeatit AB" },

2098 { 0x00081F, "Pou Yuen Tech Corp. Ltd." },

2099 { 0x000820, "Cisco Systems, Inc" },

2100 { 0x000821, "Cisco Systems, Inc" },

2101 { 0x000822, "InPro Comm" },

2102 { 0x000823, "Texa Corp." },

2103 { 0x000824, "Nuance Document Imaging" },

2104 { 0x000825, "Acme Packet" },

2105 { 0x000826, "Colorado Med Tech" },

2106 { 0x000827, "ADB Broadband Italia" },

2107 { 0x000828, "Koei Engineering Ltd." },

2108 { 0x000829, "TOKYO ELECTRON DEVICE NAGASAKI LIMITED" },

2109 { 0x00082A, "Powerwallz Network Security" },

2110 { 0x00082B, "Wooksung Electronics, Inc." },

2111 { 0x00082C, "Homag AG" },

2112 { 0x00082D, "Indus Teqsite Private Limited" },

2113 { 0x00082E, "Multitone Electronics PLC" },

2114 { 0x00082F, "Cisco Systems, Inc" },

2115 { 0x000830, "Cisco Systems, Inc" },

2116 { 0x000831, "Cisco Systems, Inc" },

2117 { 0x000832, "Cisco Systems, Inc" },

2118 { 0x00084E, "DivergeNet, Inc." },

2119 { 0x00084F, "Qualstar Corporation" },

2120 { 0x000850, "Arizona Instrument Corp." },

2121 { 0x000851, "Canadian Bank Note Company, Ltd." },

2122 { 0x000852, "Davolink Co. Inc." },

2123 { 0x000853, "Schleicher GmbH & Co. Relaiswerke KG" },

2124 { 0x000854, "Netronix, Inc." },

2125 { 0x000855, "NASA-Goddard Space Flight Center" },

2126 { 0x000856, "Gamatronic Electronic Industries Ltd." },

2127 { 0x000857, "Polaris Networks, Inc." },

2128 { 0x000858, "Novatechnology Inc." },

2129 { 0x000859, "ShenZhen Unitone Electronics Co., Ltd." },

2130 { 0x00085A, "IntiGate Inc." },

2131 { 0x00085B, "Hanbit Electronics Co., Ltd." },

2132 { 0x00085C, "Shanghai Dare Technologies Co. Ltd." },

2133 { 0x00085D, "Mitel Corporation" },

2134 { 0x00085E, "PCO AG" },

2135 { 0x00085F, "Picanol N.V." },

2136 { 0x000860, "LodgeNet Entertainment Corp." },

2137 { 0x000861, "SoftEnergy Co., Ltd." },

2138 { 0x000862, "NEC Eluminant Technologies, Inc." },

2139 { 0x000863, "Entrisphere Inc." },

2140 { 0x000864, "Fasy S.p.A." },

2141 { 0x000865, "JASCOM CO., LTD" },

2142 { 0x000866, "DSX Access Systems, Inc." },

2143 { 0x000867, "Uptime Devices" },

2144 { 0x000868, "PurOptix" },

2145 { 0x000869, "Command-e Technology Co.,Ltd." },

2146 { 0x00086A, "Securiton Gmbh" },

2147 { 0x00086B, "MIPSYS" },

2148 { 0x00086C, "Plasmon LMS" },

2149 { 0x00086D, "Missouri FreeNet" },

2150 { 0x00086E, "Hyglo AB" },

2151 { 0x00086F, "Resources Computer Network Ltd." },

2152 { 0x000870, "Rasvia Systems, Inc." },

2153 { 0x000871, "NORTHDATA Co., Ltd." },

2154 { 0x000872, "Sorenson Communications" },

2155 { 0x000873, "DapTechnology B.V." },

2156 { 0x000874, "Dell Inc." },

2157 { 0x000875, "Acorp Electronics Corp." },

2158 { 0x000876, "SDSystem" },

2159 { 0x000877, "Liebert-Hiross Spa" },

2160 { 0x000878, "Benchmark Storage Innovations" },

2161 { 0x000879, "CEM Corporation" },

2162 { 0x00087A, "Wipotec GmbH" },

2163 { 0x00087B, "RTX Telecom A/S" },

2164 { 0x00087C, "Cisco Systems, Inc" },

2165 { 0x00087D, "Cisco Systems, Inc" },

2166 { 0x00087E, "Bon Electro-Telecom Inc." },

2167 { 0x00087F, "SPAUN electronic GmbH & Co. KG" },

2168 { 0x000880, "BroadTel Canada Communications inc." },

2169 { 0x000881, "DIGITAL HANDS CO.,LTD." },

2170 { 0x000882, "SIGMA CORPORATION" },

2171 { 0x000883, "Hewlett Packard" },

2172 { 0x000884, "Index Braille AB" },

2173 { 0x000885, "EMS Dr. Thomas Wünsche" },

2174 { 0x000886, "Hansung Teliann, Inc." },

2175 { 0x000887, "Maschinenfabrik Reinhausen GmbH" },

2176 { 0x000888, "OULLIM Information Technology Inc,." },

2177 { 0x000889, "Dish Technologies Corp" },

2178 { 0x00088A, "Minds@Work" },

2179 { 0x00088B, "Tropic Networks Inc." },

2180 { 0x00088C, "Quanta Network Systems Inc." },

2181 { 0x00088D, "Sigma-Links Inc." },

2182 { 0x00088E, "Nihon Computer Co., Ltd." },

2183 { 0x00088F, "ADVANCED DIGITAL TECHNOLOGY" },

2184 { 0x000890, "AVILINKS SA" },

2185 { 0x000891, "Lyan Inc." },

2186 { 0x000892, "EM Solutions" },

2187 { 0x000893, "LE INFORMATION COMMUNICATION INC." },

2188 { 0x000894, "InnoVISION Multimedia Ltd." },

2189 { 0x000895, "DIRC Technologie GmbH & Co.KG" },

2190 { 0x000896, "Printronix, Inc." },

2191 { 0x000897, "Quake Technologies" },

2192 { 0x000898, "Gigabit Optics Corporation" },

2193 { 0x000899, "Netbind, Inc." },

2194 { 0x00089A, "Alcatel Microelectronics" },

2195 { 0x00089B, "ICP Electronics Inc." },

2196 { 0x00089C, "Elecs Industry Co., Ltd." },

2197 { 0x00089D, "UHD-Elektronik" },

2198 { 0x00089E, "Beijing Enter-Net co.LTD" },

2199 { 0x00089F, "EFM Networks" },

2200 { 0x0008A0, "Stotz Feinmesstechnik GmbH" },

2201 { 0x0008A1, "CNet Technology Inc." },

2202 { 0x0008A2, "ADI Engineering, Inc." },

2203 { 0x0008A3, "Cisco Systems, Inc" },

2204 { 0x0008A4, "Cisco Systems, Inc" },

2205 { 0x0008A5, "Peninsula Systems Inc." },

2206 { 0x0008A6, "Multiware & Image Co., Ltd." },

2207 { 0x0008A7, "iLogic Inc." },

2208 { 0x0008A8, "Systec Co., Ltd." },

2209 { 0x0008A9, "SangSang Technology, Inc." },

2210 { 0x0008AA, "KARAM" },

2211 { 0x0008AB, "EnerLinx.com, Inc." },

2212 { 0x0008AC, "BST GmbH" },

2213 { 0x0008AD, "Toyo-Linx Co., Ltd." },

2214 { 0x0008AE, "PacketFront Network Products AB" },

2215 { 0x0008AF, "Novatec Corporation" },

2216 { 0x0008B0, "HUBER+SUHNER BKtel GmbH" },

2217 { 0x0008B1, "ProQuent Systems" },

2218 { 0x0008B2, "SHENZHEN COMPASS TECHNOLOGY DEVELOPMENT CO.,LTD" },

2219 { 0x0008B3, "Fastwel" },

2220 { 0x0008B4, "SYSPOL" },

2221 { 0x0008B5, "TAI GUEN ENTERPRISE CO., LTD" },

2222 { 0x0008B6, "RouteFree, Inc." },

2223 { 0x0008B7, "HIT Incorporated" },

2224 { 0x0008B8, "E.F. Johnson" },

2225 { 0x0008B9, "Kaon Group Co., Ltd." },

2226 { 0x0008BA, "Erskine Systems Ltd" },

2227 { 0x0008BB, "NetExcell" },

2228 { 0x0008BC, "Ilevo AB" },

2229 { 0x0008BD, "TEPG-US" },

2230 { 0x0008BE, "XENPAK MSA Group" },

2231 { 0x0008BF, "Aptus Elektronik AB" },

2232 { 0x0008C0, "ASA SYSTEMS" },

2233 { 0x0008C1, "Avistar Communications Corporation" },

2234 { 0x0008C2, "Cisco Systems, Inc" },

2235 { 0x0008C3, "Contex A/S" },

2236 { 0x0008C4, "Hikari Co.,Ltd." },

2237 { 0x0008C5, "Liontech Co., Ltd." },

2238 { 0x0008C6, "Philips Consumer Communications" },

2239 { 0x0008C7, "Hewlett Packard" },

2240 { 0x0008C8, "Soneticom, Inc." },

2241 { 0x0008C9, "TechniSat Digital GmbH Daun" },

2242 { 0x0008CA, "TwinHan Technology Co.,Ltd" },

2243 { 0x0008CB, "Zeta Broadband Inc." },

2244 { 0x0008CC, "Remotec, Inc." },

2245 { 0x0008CD, "With-Net Inc" },

2246 { 0x0008CE, "IPMobileNet Inc." },

2247 { 0x0008CF, "Nippon Koei Power Systems Co., Ltd." },

2248 { 0x0008D0, "Musashi Engineering Co., LTD." },

2249 { 0x0008D1, "KAREL INC." },

2250 { 0x0008D2, "ZOOM Networks Inc." },

2251 { 0x0008D3, "Hercules Technologies S.A.S." },

2252 { 0x0008D4, "IneoQuest Technologies, Inc" },

2253 { 0x0008D5, "Vanguard Networks Solutions, LLC" },

2254 { 0x0008D6, "HASSNET Inc." },

2255 { 0x0008D7, "HOW CORPORATION" },

2256 { 0x0008D8, "Dowkey Microwave" },

2257 { 0x0008D9, "Mitadenshi Co.,LTD" },

2258 { 0x0008DA, "SofaWare Technologies Ltd." },

2259 { 0x0008DB, "Corrigent Systems" },

2260 { 0x0008DC, "Wiznet" },

2261 { 0x0008DD, "Telena Communications, Inc." },

2262 { 0x0008DE, "3UP Systems" },

2263 { 0x0008DF, "Alistel Inc." },

2264 { 0x0008E0, "ATO Technology Ltd." },

2265 { 0x0008E1, "Barix AG" },

2266 { 0x0008E2, "Cisco Systems, Inc" },

2267 { 0x0008E3, "Cisco Systems, Inc" },

2268 { 0x0008E4, "Envenergy Inc" },

2269 { 0x0008E5, "IDK Corporation" },

2270 { 0x0008E6, "Littlefeet" },

2271 { 0x0008E7, "SHI ControlSystems,Ltd." },

2272 { 0x0008E8, "Excel Master Ltd." },

2273 { 0x0008E9, "NextGig" },

2274 { 0x0008EA, "Motion Control Engineering, Inc" },

2275 { 0x0008EB, "ROMWin Co.,Ltd." },

2276 { 0x0008EC, "Optical Zonu Corporation" },

2277 { 0x0008ED, "ST&T Instrument Corp." },

2278 { 0x0008EE, "Logic Product Development" },

2279 { 0x0008EF, "DIBAL,S.A." },

2280 { 0x0008F0, "Next Generation Systems, Inc." },

2281 { 0x0008F1, "Voltaire" },

2282 { 0x0008F2, "C&S Technology" },

2283 { 0x0008F3, "WANY" },

2284 { 0x0008F4, "Bluetake Technology Co., Ltd." },

2285 { 0x0008F5, "YESTECHNOLOGY Co.,Ltd." },

2286 { 0x0008F6, "Sumitomo Electric Industries, Ltd" },

2287 { 0x0008F7, "Hitachi Ltd, Semiconductor & Integrated Circuits Gr" },

2288 { 0x0008F8, "UTC CCS" },

2289 { 0x0008F9, "Artesyn Embedded Technologies" },

2290 { 0x0008FA, "KEB Automation KG" },

2291 { 0x0008FB, "SonoSite, Inc." },

2292 { 0x0008FC, "Gigaphoton Inc." },

2293 { 0x0008FD, "BlueKorea Co., Ltd." },

2294 { 0x0008FE, "UNIK C&C Co.,Ltd." },

2295 { 0x0008FF, "Trilogy Communications Ltd" },

2296 { 0x000900, "TMT" },

2297 { 0x000901, "Shenzhen Shixuntong Information & Technoligy Co" },

2298 { 0x000902, "Redline Communications Inc." },

2299 { 0x000903, "Panasas, Inc" },

2300 { 0x000904, "MONDIAL electronic" },

2301 { 0x000905, "iTEC Technologies Ltd." },

2302 { 0x000906, "Esteem Networks" },

2303 { 0x000907, "Chrysalis Development" },

2304 { 0x000908, "VTech Technology Corp." },

2305 { 0x000909, "Telenor Connect A/S" },

2306 { 0x00090A, "SnedFar Technology Co., Ltd." },

2307 { 0x00090B, "MTL Instruments PLC" },

2308 { 0x00090C, "Mayekawa Mfg. Co. Ltd." },

2309 { 0x00090D, "LEADER ELECTRONICS CORP." },

2310 { 0x00090E, "Helix Technology Inc." },

2311 { 0x00090F, "Fortinet, Inc." },

2312 { 0x000910, "Simple Access Inc." },

2313 { 0x000911, "Cisco Systems, Inc" },

2314 { 0x000912, "Cisco Systems, Inc" },

2315 { 0x000913, "SystemK Corporation" },

2316 { 0x000914, "COMPUTROLS INC." },

2317 { 0x000915, "CAS Corp." },

2318 { 0x000916, "Listman Home Technologies, Inc." },

2319 { 0x000917, "WEM Technology Inc" },

2320 { 0x000918, "SAMSUNG TECHWIN CO.,LTD" },

2321 { 0x000919, "MDS Gateways" },

2322 { 0x00091A, "Macat Optics & Electronics Co., Ltd." },

2323 { 0x00091B, "Digital Generation Inc." },

2324 { 0x00091C, "CacheVision, Inc" },

2325 { 0x00091D, "Proteam Computer Corporation" },

2326 { 0x00091E, "Firstech Technology Corp." },

2327 { 0x00091F, "A&D Co., Ltd." },

2328 { 0x000920, "EpoX COMPUTER CO.,LTD." },

2329 { 0x000921, "Planmeca Oy" },

2330 { 0x000922, "TST Biometrics GmbH" },

2331 { 0x000923, "Heaman System Co., Ltd" },

2332 { 0x000924, "Telebau GmbH" },

2333 { 0x000925, "VSN Systemen BV" },

2334 { 0x000926, "YODA COMMUNICATIONS, INC." },

2335 { 0x000927, "TOYOKEIKI CO.,LTD." },

2336 { 0x000928, "Telecore" },

2337 { 0x000929, "Sanyo Industries (UK) Limited" },

2338 { 0x00092A, "MYTECS Co.,Ltd." },

2339 { 0x00092B, "iQstor Networks, Inc." },

2340 { 0x00092C, "Hitpoint Inc." },

2341 { 0x00092D, "HTC Corporation" },

2342 { 0x00092E, "B&Tech System Inc." },

2343 { 0x00092F, "Akom Technology Corporation" },

2344 { 0x000930, "AeroConcierge Inc." },

2345 { 0x000931, "Future Internet, Inc." },

2346 { 0x000932, "Omnilux" },

2347 { 0x000933, "Ophit Co.Ltd." },

2348 { 0x000934, "Dream-Multimedia-Tv GmbH" },

2349 { 0x000935, "Sandvine Incorporated" },

2350 { 0x000936, "Ipetronik GmbH & Co. KG" },

2351 { 0x000937, "Inventec Appliance Corp" },

2352 { 0x000938, "Allot Communications" },

2353 { 0x000939, "ShibaSoku Co.,Ltd." },

2354 { 0x00093A, "Molex CMS" },

2355 { 0x00093B, "HYUNDAI NETWORKS INC." },

2356 { 0x00093C, "Jacques Technologies P/L" },

2357 { 0x00093D, "Newisys,Inc." },

2358 { 0x00093E, "C&I Technologies" },

2359 { 0x00093F, "Double-Win Enterpirse CO., LTD" },

2360 { 0x000940, "AGFEO GmbH & Co. KG" },

2361 { 0x000941, "Allied Telesis K.K." },

2362 { 0x000942, "Wireless Technologies, Inc" },

2363 { 0x000943, "Cisco Systems, Inc" },

2364 { 0x000944, "Cisco Systems, Inc" },

2365 { 0x000945, "Palmmicro Communications Inc" },

2366 { 0x000946, "Cluster Labs GmbH" },

2367 { 0x000947, "Aztek, Inc." },

2368 { 0x000948, "Vista Control Systems, Corp." },

2369 { 0x000949, "Glyph Technologies Inc." },

2370 { 0x00094A, "Homenet Communications" },

2371 { 0x00094B, "FillFactory NV" },

2372 { 0x00094C, "Communication Weaver Co.,Ltd." },

2373 { 0x00094D, "Braintree Communications Pty Ltd" },

2374 { 0x00094E, "BARTECH SYSTEMS INTERNATIONAL, INC" },

2375 { 0x00094F, "elmegt GmbH & Co. KG" },

2376 { 0x000950, "Independent Storage Corporation" },

2377 { 0x000951, "Apogee Imaging Systems" },

2378 { 0x000952, "Auerswald GmbH & Co. KG" },

2379 { 0x000953, "Linkage System Integration Co.Ltd." },

2380 { 0x000954, "AMiT spol. s. r. o." },

2381 { 0x000955, "Young Generation International Corp." },

2382 { 0x000956, "Network Systems Group, Ltd. (NSG)" },

2383 { 0x000957, "Supercaller, Inc." },

2384 { 0x000958, "INTELNET S.A." },

2385 { 0x000959, "Sitecsoft" },

2386 { 0x00095A, "RACEWOOD TECHNOLOGY" },

2387 { 0x00095B, "NETGEAR" },

2388 { 0x00095C, "Philips Medical Systems - Cardiac and Monitoring Systems (CM" },

2389 { 0x00095D, "Dialogue Technology Corp." },

2390 { 0x00095E, "Masstech Group Inc." },

2391 { 0x00095F, "Telebyte, Inc." },

2392 { 0x000960, "YOZAN Inc." },

2393 { 0x000961, "Switchgear and Instrumentation Ltd" },

2394 { 0x000962, "Sonitor Technologies AS" },

2395 { 0x000963, "Dominion Lasercom Inc." },

2396 { 0x000964, "Hi-Techniques, Inc." },

2397 { 0x000965, "HyunJu Computer Co., Ltd." },

2398 { 0x000966, "TRIMBLE EUROPE BV" },

2399 { 0x000967, "Tachyon, Inc" },

2400 { 0x000968, "TECHNOVENTURE, INC." },

2401 { 0x000969, "Meret Optical Communications" },

2402 { 0x00096A, "Cloverleaf Communications Inc." },

2403 { 0x00096B, "IBM Corp" },

2404 { 0x00096C, "Imedia Semiconductor Corp." },

2405 { 0x00096D, "Powernet Technologies Corp." },

2406 { 0x00096E, "GIANT ELECTRONICS LTD." },

2407 { 0x00096F, "Beijing Zhongqing Elegant Tech. Corp.,Limited" },

2408 { 0x000970, "Vibration Research Corporation" },

2409 { 0x000971, "Time Management, Inc." },

2410 { 0x000972, "Securebase,Inc" },

2411 { 0x000973, "Lenten Technology Co., Ltd." },

2412 { 0x000974, "Innopia Technologies, Inc." },

2413 { 0x000975, "fSONA Communications Corporation" },

2414 { 0x000976, "Datasoft ISDN Systems GmbH" },

2415 { 0x000977, "Brunner Elektronik AG" },

2416 { 0x000978, "AIJI System Co., Ltd." },

2417 { 0x000979, "Advanced Television Systems Committee, Inc." },

2418 { 0x00097A, "Louis Design Labs." },

2419 { 0x00097B, "Cisco Systems, Inc" },

2420 { 0x00097C, "Cisco Systems, Inc" },

2421 { 0x00097D, "SecWell Networks Oy" },

2422 { 0x00097E, "IMI TECHNOLOGY CO., LTD" },

2423 { 0x00097F, "Vsecure 2000 LTD." },

2424 { 0x000980, "Power Zenith Inc." },

2425 { 0x000981, "Newport Networks" },

2426 { 0x000982, "Loewe Opta GmbH" },

2427 { 0x000983, "GlobalTop Technology, Inc." },

2428 { 0x000984, "MyCasa Network Inc." },

2429 { 0x000985, "Auto Telecom Company" },

2430 { 0x000986, "Metalink LTD." },

2431 { 0x000987, "NISHI NIPPON ELECTRIC WIRE & CABLE CO.,LTD." },

2432 { 0x000988, "Nudian Electron Co., Ltd." },

2433 { 0x000989, "VividLogic Inc." },

2434 { 0x00098A, "EqualLogic Inc" },

2435 { 0x00098B, "Entropic Communications, Inc." },

2436 { 0x00098C, "Option Wireless Sweden" },

2437 { 0x00098D, "Velocity Semiconductor" },

2438 { 0x00098E, "ipcas GmbH" },

2439 { 0x00098F, "Cetacean Networks" },

2440 { 0x000990, "ACKSYS Communications & systems" },

2441 { 0x000991, "Intelligent Platforms, LLC." },

2442 { 0x000992, "InterEpoch Technology,INC." },

2443 { 0x000993, "Visteon Corporation" },

2444 { 0x000994, "Cronyx Engineering" },

2445 { 0x000995, "Castle Technology Ltd" },

2446 { 0x000996, "RDI" },

2447 { 0x000997, "Nortel Networks" },

2448 { 0x000998, "Capinfo Company Limited" },

2449 { 0x000999, "CP GEORGES RENAULT" },

2450 { 0x00099A, "ELMO COMPANY, LIMITED" },

2451 { 0x00099B, "Western Telematic Inc." },

2452 { 0x00099C, "Naval Research Laboratory" },

2453 { 0x00099D, "Haliplex Communications" },

2454 { 0x00099E, "Testech, Inc." },

2455 { 0x00099F, "VIDEX INC." },

2456 { 0x0009A0, "Microtechno Corporation" },

2457 { 0x0009A1, "Telewise Communications, Inc." },

2458 { 0x0009A2, "Interface Co., Ltd." },

2459 { 0x0009A3, "Leadfly Techologies Corp. Ltd." },

2460 { 0x0009A4, "HARTEC Corporation" },

2461 { 0x0009A5, "HANSUNG ELETRONIC INDUSTRIES DEVELOPMENT CO., LTD" },

2462 { 0x0009A6, "Ignis Optics, Inc." },

2463 { 0x0009A7, "Bang & Olufsen A/S" },

2464 { 0x0009A8, "Eastmode Pte Ltd" },

2465 { 0x0009A9, "Ikanos Communications" },

2466 { 0x0009AA, "Data Comm for Business, Inc." },

2467 { 0x0009AB, "Netcontrol Oy" },

2468 { 0x0009AC, "LANVOICE" },

2469 { 0x0009AD, "HYUNDAI SYSCOMM, INC." },

2470 { 0x0009AE, "OKANO ELECTRIC CO.,LTD" },

2471 { 0x0009AF, "e-generis" },

2472 { 0x0009B0, "Onkyo Technology K.K." },

2473 { 0x0009B1, "Kanematsu Electronics, Ltd." },

2474 { 0x0009B2, "L&F Inc." },

2475 { 0x0009B3, "MCM Systems Ltd" },

2476 { 0x0009B4, "KISAN TELECOM CO., LTD." },

2477 { 0x0009B5, "3J Tech. Co., Ltd." },

2478 { 0x0009B6, "Cisco Systems, Inc" },

2479 { 0x0009B7, "Cisco Systems, Inc" },

2480 { 0x0009B8, "Entise Systems" },

2481 { 0x0009B9, "Action Imaging Solutions" },

2482 { 0x0009BA, "MAKU Informationstechik GmbH" },

2483 { 0x0009BB, "MathStar, Inc." },

2484 { 0x0009BC, "Utility, Inc" },

2485 { 0x0009BD, "Epygi Technologies, Ltd." },

2486 { 0x0009BE, "Mamiya-OP Co.,Ltd." },

2487 { 0x0009BF, "Nintendo Co., Ltd." },

2488 { 0x0009C0, "6WIND" },

2489 { 0x0009C1, "PROCES-DATA A/S" },

2490 { 0x0009C2, "Onity, Inc." },

2491 { 0x0009C3, "NETAS" },

2492 { 0x0009C4, "Medicore Co., Ltd" },

2493 { 0x0009C5, "KINGENE Technology Corporation" },

2494 { 0x0009C6, "Visionics Corporation" },

2495 { 0x0009C7, "Movistec" },

2496 { 0x0009C8, "SINAGAWA TSUSHIN KEISOU SERVICE" },

2497 { 0x0009C9, "BlueWINC Co., Ltd." },

2498 { 0x0009CA, "iMaxNetworks(Shenzhen)Limited." },

2499 { 0x0009CB, "HBrain" },

2500 { 0x0009CC, "Moog GmbH" },

2501 { 0x0009CD, "HUDSON SOFT CO.,LTD." },

2502 { 0x0009CE, "SpaceBridge Semiconductor Corp." },

2503 { 0x0009CF, "iAd GmbH" },

2504 { 0x0009D0, "Solacom Technologies Inc." },

2505 { 0x0009D1, "SERANOA NETWORKS INC" },

2506 { 0x0009D2, "Mai Logic Inc." },

2507 { 0x0009D3, "Western DataCom Co., Inc." },

2508 { 0x0009D4, "Transtech Networks" },

2509 { 0x0009D5, "Signal Communication, Inc." },

2510 { 0x0009D6, "KNC One GmbH" },

2511 { 0x0009D7, "DC Security Products" },

2512 { 0x0009D8, "Fält Communications AB" },

2513 { 0x0009D9, "Neoscale Systems, Inc" },

2514 { 0x0009DA, "Control Module Inc." },

2515 { 0x0009DB, "eSpace" },

2516 { 0x0009DC, "Galaxis Technology AG" },

2517 { 0x0009DD, "Mavin Technology Inc." },

2518 { 0x0009DE, "Samjin Information & Communications Co., Ltd." },

2519 { 0x0009DF, "Vestel Elektronik San ve Tic. A.S." },

2520 { 0x0009E0, "XEMICS S.A." },

2521 { 0x0009E1, "Gemtek Technology Co., Ltd." },

2522 { 0x0009E2, "Sinbon Electronics Co., Ltd." },

2523 { 0x0009E3, "Angel Iglesias S.A." },

2524 { 0x0009E4, "K Tech Infosystem Inc." },

2525 { 0x0009E5, "Hottinger Brüel & Kjaer GmbH" },

2526 { 0x0009E6, "Cyber Switching Inc." },

2527 { 0x0009E7, "ADC Techonology" },

2528 { 0x0009E8, "Cisco Systems, Inc" },

2529 { 0x0009E9, "Cisco Systems, Inc" },

2530 { 0x0009EA, "YEM Inc." },

2531 { 0x0009EB, "HuMANDATA LTD." },

2532 { 0x0009EC, "Daktronics, Inc." },

2533 { 0x0009ED, "CipherOptics" },

2534 { 0x0009EE, "MEIKYO ELECTRIC CO.,LTD" },

2535 { 0x0009EF, "Vocera Communications" },

2536 { 0x0009F0, "Shimizu Technology Inc." },

2537 { 0x0009F1, "Yamaki Electric Corporation" },

2538 { 0x0009F2, "Cohu, Inc., Electronics Division" },

2539 { 0x0009F3, "WELL Communication Corp." },

2540 { 0x0009F4, "Alcon Laboratories, Inc." },

2541 { 0x0009F5, "Emerson Network Power Co.,Ltd" },

2542 { 0x0009F6, "Shenzhen Eastern Digital Tech Ltd." },

2543 { 0x0009F7, "SED, a division of Calian" },

2544 { 0x0009F8, "UNIMO TECHNOLOGY CO., LTD." },

2545 { 0x0009F9, "ART JAPAN CO., LTD." },

2546 { 0x0009FB, "Philips Patient Monitoring" },

2547 { 0x0009FC, "IPFLEX Inc." },

2548 { 0x0009FD, "Ubinetics Limited" },

2549 { 0x0009FE, "Daisy Technologies, Inc." },

2550 { 0x0009FF, "X.net 2000 GmbH" },

2551 { 0x000A00, "Mediatek Corp." },

2552 { 0x000A01, "SOHOware, Inc." },

2553 { 0x000A02, "ANNSO CO., LTD." },

2554 { 0x000A03, "ENDESA SERVICIOS, S.L." },

2555 { 0x000A04, "3Com Ltd" },

2556 { 0x000A05, "Widax Corp." },

2557 { 0x000A06, "Teledex LLC" },

2558 { 0x000A07, "WebWayOne Ltd" },

2559 { 0x000A08, "Alps Alpine" },

2560 { 0x000A09, "TaraCom Integrated Products, Inc." },

2561 { 0x000A0A, "SUNIX Co., Ltd." },

2562 { 0x000A0B, "Sealevel Systems, Inc." },

2563 { 0x000A0C, "Scientific Research Corporation" },

2564 { 0x000A0D, "Amphenol" },

2565 { 0x000A0E, "Invivo Research Inc." },

2566 { 0x000A0F, "Ilryung Telesys, Inc" },

2567 { 0x000A10, "FAST media integrations AG" },

2568 { 0x000A11, "ExPet Technologies, Inc" },

2569 { 0x000A12, "Azylex Technology, Inc" },

2570 { 0x000A13, "Honeywell Video Systems" },

2571 { 0x000A14, "TECO a.s." },

2572 { 0x000A15, "Silicon Data, Inc" },

2573 { 0x000A16, "Lassen Research" },

2574 { 0x000A17, "NESTAR COMMUNICATIONS, INC" },

2575 { 0x000A18, "Vichel Inc." },

2576 { 0x000A19, "Valere Power, Inc." },

2577 { 0x000A1A, "Imerge Ltd" },

2578 { 0x000A1B, "Stream Labs" },

2579 { 0x000A1C, "Bridge Information Co., Ltd." },

2580 { 0x000A1D, "Optical Communications Products Inc." },

2581 { 0x000A1E, "Red-M Products Limited" },

2582 { 0x000A1F, "ART WARE Telecommunication Co., Ltd." },

2583 { 0x000A20, "SVA Networks, Inc." },

2584 { 0x000A21, "Integra Telecom Co. Ltd" },

2585 { 0x000A22, "Amperion Inc" },

2586 { 0x000A23, "Parama Networks Inc" },

2587 { 0x000A24, "Octave Communications" },

2588 { 0x000A25, "CERAGON NETWORKS" },

2589 { 0x000A26, "CEIA S.p.A." },

2590 { 0x000A27, "Apple, Inc." },

2591 { 0x000A28, "Motorola" },

2592 { 0x000A29, "Pan Dacom Networking AG" },

2593 { 0x000A2A, "QSI Systems Inc." },

2594 { 0x000A2B, "Etherstuff" },

2595 { 0x000A2C, "Active Tchnology Corporation" },

2596 { 0x000A2D, "Cabot Communications Limited" },

2597 { 0x000A2E, "MAPLE NETWORKS CO., LTD" },

2598 { 0x000A2F, "Artnix Inc." },

2599 { 0x000A30, "Visteon Corporation" },

2600 { 0x000A31, "HCV Consulting" },

2601 { 0x000A32, "Xsido Corporation" },

2602 { 0x000A33, "Emulex Corporation" },

2603 { 0x000A34, "Identicard Systems Incorporated" },

2604 { 0x000A35, "Xilinx" },

2605 { 0x000A36, "Synelec Telecom Multimedia" },

2606 { 0x000A37, "Procera Networks, Inc." },

2607 { 0x000A38, "Apani Networks" },

2608 { 0x000A39, "LoPA Information Technology" },

2609 { 0x000A3A, "J-THREE INTERNATIONAL Holding Co., Ltd." },

2610 { 0x000A3B, "GCT Semiconductor, Inc" },

2611 { 0x000A3C, "Enerpoint Ltd." },

2612 { 0x000A3D, "Elo Sistemas Eletronicos S.A." },

2613 { 0x000A3E, "EADS Telecom" },

2614 { 0x000A3F, "Data East Corporation" },

2615 { 0x000A40, "Crown Audio -- Harmanm International" },

2616 { 0x000A41, "Cisco Systems, Inc" },

2617 { 0x000A42, "Cisco Systems, Inc" },

2618 { 0x000A43, "Chunghwa Telecom Co., Ltd." },

2619 { 0x000A44, "Avery Dennison Deutschland GmbH" },

2620 { 0x000A45, "Audio-Technica Corp." },

2621 { 0x000A46, "ARO WELDING TECHNOLOGIES SAS" },

2622 { 0x000A47, "Allied Vision Technologies" },

2623 { 0x000A48, "Albatron Technology" },

2624 { 0x000A49, "F5 Networks, Inc." },

2625 { 0x000A4A, "Targa Systems Ltd." },

2626 { 0x000A4B, "DataPower Technology, Inc." },

2627 { 0x000A4C, "Molecular Devices Corporation" },

2628 { 0x000A4D, "Noritz Corporation" },

2629 { 0x000A4E, "UNITEK Electronics INC." },

2630 { 0x000A4F, "Brain Boxes Limited" },

2631 { 0x000A50, "REMOTEK CORPORATION" },

2632 { 0x000A51, "GyroSignal Technology Co., Ltd." },

2633 { 0x000A52, "AsiaRF Ltd." },

2634 { 0x000A53, "Intronics, Incorporated" },

2635 { 0x000A54, "Laguna Hills, Inc." },

2636 { 0x000A55, "MARKEM Corporation" },

2637 { 0x000A56, "HITACHI Maxell Ltd." },

2638 { 0x000A57, "Hewlett Packard" },

2639 { 0x000A58, "Freyer & Siegel Elektronik GmbH & Co. KG" },

2640 { 0x000A59, "HW server" },

2641 { 0x000A5A, "GreenNET Technologies Co.,Ltd." },

2642 { 0x000A5B, "Power-One as" },

2643 { 0x000A5C, "Carel s.p.a." },

2644 { 0x000A5D, "FingerTec Worldwide Sdn Bhd" },

2645 { 0x000A5E, "3COM" },

2646 { 0x000A5F, "almedio inc." },

2647 { 0x000A60, "Autostar Technology Pte Ltd" },

2648 { 0x000A61, "Cellinx Systems Inc." },

2649 { 0x000A62, "Crinis Networks, Inc." },

2650 { 0x000A63, "DHD GmbH" },

2651 { 0x000A64, "Eracom Technologies" },

2652 { 0x000A65, "GentechMedia.co.,ltd." },

2653 { 0x000A66, "MITSUBISHI ELECTRIC SYSTEM & SERVICE CO.,LTD." },

2654 { 0x000A67, "OngCorp" },

2655 { 0x000A68, "Solarflare Communications Inc." },

2656 { 0x000A69, "SUNNY bell Technology Co., Ltd." },

2657 { 0x000A6A, "SVM Microwaves s.r.o." },

2658 { 0x000A6B, "Tadiran Telecom Business Systems LTD" },

2659 { 0x000A6C, "Walchem Corporation" },

2660 { 0x000A6D, "EKS Elektronikservice GmbH" },

2661 { 0x000A6E, "Harmonic, Inc" },

2662 { 0x000A6F, "ZyFLEX Technologies Inc" },

2663 { 0x000A70, "MPLS Forum" },

2664 { 0x000A71, "Avrio Technologies, Inc" },

2665 { 0x000A72, "STEC, INC." },

2666 { 0x000A73, "Scientific Atlanta" },

2667 { 0x000A74, "Manticom Networks Inc." },

2668 { 0x000A75, "Caterpillar, Inc" },

2669 { 0x000A76, "Beida Jade Bird Huaguang Technology Co.,Ltd" },

2670 { 0x000A77, "Bluewire Technologies LLC" },

2671 { 0x000A78, "OLITEC" },

2672 { 0x000A79, "corega K.K" },

2673 { 0x000A7A, "Kyoritsu Electric Co., Ltd." },

2674 { 0x000A7B, "Cornelius Consult" },

2675 { 0x000A7C, "Tecton Ltd" },

2676 { 0x000A7D, "Valo, Inc." },

2677 { 0x000A7E, "The Advantage Group" },

2678 { 0x000A7F, "Teradon Industries, Inc" },

2679 { 0x000A80, "Telkonet Inc." },

2680 { 0x000A81, "TEIMA Audiotex S.L." },

2681 { 0x000A82, "TATSUTA SYSTEM ELECTRONICS CO.,LTD." },

2682 { 0x000A83, "SALTO SYSTEMS S.L." },

2683 { 0x000A84, "Rainsun Enterprise Co., Ltd." },

2684 { 0x000A85, "PLAT'C2,Inc" },

2685 { 0x000A86, "Lenze" },

2686 { 0x000A87, "Integrated Micromachines Inc." },

2687 { 0x000A88, "InCypher S.A." },

2688 { 0x000A89, "Creval Systems, Inc." },

2689 { 0x000A8A, "Cisco Systems, Inc" },

2690 { 0x000A8B, "Cisco Systems, Inc" },

2691 { 0x000A8C, "Guardware Systems Ltd." },

2692 { 0x000A8D, "EUROTHERM LIMITED" },

2693 { 0x000A8E, "Invacom Ltd" },

2694 { 0x000A8F, "Aska International Inc." },

2695 { 0x000A90, "Bayside Interactive, Inc." },

2696 { 0x000A91, "HemoCue AB" },

2697 { 0x000A92, "Presonus Corporation" },

2698 { 0x000A93, "W2 Networks, Inc." },

2699 { 0x000A94, "ShangHai cellink CO., LTD" },

2700 { 0x000A95, "Apple, Inc." },

2701 { 0x000A96, "MEWTEL TECHNOLOGY INC." },

2702 { 0x000A97, "SONICblue, Inc." },

2703 { 0x000A98, "M+F Gwinner GmbH & Co" },

2704 { 0x000A99, "Calamp Wireless Networks Inc" },

2705 { 0x000A9A, "Aiptek International Inc" },

2706 { 0x000A9B, "TB Group Inc" },

2707 { 0x000A9C, "Server Technology, Inc." },

2708 { 0x000A9D, "King Young Technology Co. Ltd." },

2709 { 0x000A9E, "BroadWeb Corportation" },

2710 { 0x000A9F, "Pannaway Technologies, Inc." },

2711 { 0x000AA0, "Cedar Point Communications" },

2712 { 0x000AA1, "V V S Limited" },

2713 { 0x000AA2, "SYSTEK INC." },

2714 { 0x000AA3, "SHIMAFUJI ELECTRIC CO.,LTD." },

2715 { 0x000AA4, "SHANGHAI SURVEILLANCE TECHNOLOGY CO,LTD" },

2716 { 0x000AA5, "MAXLINK INDUSTRIES LIMITED" },

2717 { 0x000AA6, "Hochiki Corporation" },

2718 { 0x000AA7, "FEI Electron Optics" },

2719 { 0x000AA8, "ePipe Pty. Ltd." },

2720 { 0x000AA9, "Brooks Automation GmbH" },

2721 { 0x000AAA, "AltiGen Communications Inc." },

2722 { 0x000AAB, "Toyota Technical Development Corporation" },

2723 { 0x000AAC, "TerraTec Electronic GmbH" },

2724 { 0x000AAD, "Stargames Corporation" },

2725 { 0x000AAE, "Rosemount Process Analytical" },

2726 { 0x000AAF, "Pipal Systems" },

2727 { 0x000AB0, "LOYTEC electronics GmbH" },

2728 { 0x000AB1, "GENETEC Corporation" },

2729 { 0x000AB2, "Fresnel Wireless Systems" },

2730 { 0x000AB3, "Fa. GIRA" },

2731 { 0x000AB4, "ETIC Telecommunications" },

2732 { 0x000AB5, "Digital Electronic Network" },

2733 { 0x000AB6, "COMPUNETIX, INC" },

2734 { 0x000AB7, "Cisco Systems, Inc" },

2735 { 0x000AB8, "Cisco Systems, Inc" },

2736 { 0x000AB9, "Astera Technologies Corp." },

2737 { 0x000ABA, "Arcon Technology Limited" },

2738 { 0x000ABB, "Taiwan Secom Co,. Ltd" },

2739 { 0x000ABC, "Seabridge Ltd." },

2740 { 0x000ABD, "Rupprecht & Patashnick Co." },

2741 { 0x000ABE, "OPNET Technologies CO., LTD." },

2742 { 0x000ABF, "HIROTA SS" },

2743 { 0x000AC0, "Fuyoh Video Industry CO., LTD." },

2744 { 0x000AC1, "Futuretel" },

2745 { 0x000AC2, "Wuhan FiberHome Digital Technology Co.,Ltd." },

2746 { 0x000AC3, "eM Technics Co., Ltd." },

2747 { 0x000AC4, "Daewoo Teletech Co., Ltd" },

2748 { 0x000AC5, "Color Kinetics" },

2749 { 0x000AC6, "Overture Networks." },

2750 { 0x000AC7, "Unication Group" },

2751 { 0x000AC8, "ZPSYS CO.,LTD. (Planning&Management)" },

2752 { 0x000AC9, "Zambeel Inc" },

2753 { 0x000ACA, "YOKOYAMA SHOKAI CO.,Ltd." },

2754 { 0x000ACB, "XPAK MSA Group" },

2755 { 0x000ACC, "Winnow Networks, Inc." },

2756 { 0x000ACD, "Sunrich Technology Limited" },

2757 { 0x000ACE, "RADIANTECH, INC." },

2758 { 0x000ACF, "PROVIDEO Multimedia Co. Ltd." },

2759 { 0x000AD0, "Niigata Develoment Center, F.I.T. Co., Ltd." },

2760 { 0x000AD1, "MWS" },

2761 { 0x000AD2, "JEPICO Corporation" },

2762 { 0x000AD3, "INITECH Co., Ltd" },

2763 { 0x000AD4, "CoreBell Systems Inc." },

2764 { 0x000AD5, "Brainchild Electronic Co., Ltd." },

2765 { 0x000AD6, "BeamReach Networks" },

2766 { 0x000AD7, "Origin Co., Ltd." },

2767 { 0x000AD8, "IPCserv Technology Corp." },

2768 { 0x000AD9, "Sony Corporation" },

2769 { 0x000ADA, "Vindicator Technologies" },

2770 { 0x000ADB, "Trilliant" },

2771 { 0x000ADC, "RuggedCom Inc." },

2772 { 0x000ADD, "Allworx Corp." },

2773 { 0x000ADE, "Happy Communication Co., Ltd." },

2774 { 0x000ADF, "Gennum Corporation" },

2775 { 0x000AE0, "Fujitsu Softek" },

2776 { 0x000AE1, "EG Technology" },

2777 { 0x000AE2, "Binatone Electronics International, Ltd" },

2778 { 0x000AE3, "YANG MEI TECHNOLOGY CO., LTD" },

2779 { 0x000AE4, "Wistron Corporation" },

2780 { 0x000AE5, "ScottCare Corporation" },

2781 { 0x000AE6, "Elitegroup Computer Systems Co.,Ltd." },

2782 { 0x000AE7, "ELIOP S.A." },

2783 { 0x000AE8, "Cathay Roxus Information Technology Co. LTD" },

2784 { 0x000AE9, "AirVast Technology Inc." },

2785 { 0x000AEA, "ADAM ELEKTRONIK LTD. ŞTI" },

2786 { 0x000AEB, "TP-LINK TECHNOLOGIES CO.,LTD." },

2787 { 0x000AEC, "Koatsu Gas Kogyo Co., Ltd." },

2788 { 0x000AED, "HARTING Electronics GmbH" },

2789 { 0x000AEE, "GCD Hard- & Software GmbH" },

2790 { 0x000AEF, "OTRUM ASA" },

2791 { 0x000AF0, "SHIN-OH ELECTRONICS CO., LTD. R&D" },

2792 { 0x000AF1, "Clarity Design, Inc." },

2793 { 0x000AF2, "NeoAxiom Corp." },

2794 { 0x000AF3, "Cisco Systems, Inc" },

2795 { 0x000AF4, "Cisco Systems, Inc" },

2796 { 0x000AF5, "Airgo Networks, Inc." },

2797 { 0x000AF6, "Emerson Climate Technologies Retail Solutions, Inc." },

2798 { 0x000AF7, "Broadcom" },

2799 { 0x000AF8, "American Telecare Inc." },

2800 { 0x000AF9, "HiConnect, Inc." },

2801 { 0x000AFA, "Traverse Technologies Australia" },

2802 { 0x000AFB, "Ambri Limited" },

2803 { 0x000AFC, "Core Tec Communications, LLC" },

2804 { 0x000AFD, "Kentec Electronics" },

2805 { 0x000AFE, "NovaPal Ltd" },

2806 { 0x000AFF, "Kilchherr Elektronik AG" },

2807 { 0x000B00, "FUJIAN START COMPUTER EQUIPMENT CO.,LTD" },

2808 { 0x000B01, "DAIICHI ELECTRONICS CO., LTD." },

2809 { 0x000B02, "Dallmeier electronic" },

2810 { 0x000B03, "Taekwang Industrial Co., Ltd" },

2811 { 0x000B04, "Volktek Corporation" },

2812 { 0x000B05, "Pacific Broadband Networks" },

2813 { 0x000B06, "ARRIS Group, Inc." },

2814 { 0x000B07, "Voxpath Networks" },

2815 { 0x000B08, "Pillar Data Systems" },

2816 { 0x000B09, "Ifoundry Systems Singapore" },

2817 { 0x000B0A, "dBm Optics" },

2818 { 0x000B0B, "Corrent Corporation" },

2819 { 0x000B0C, "Agile Systems Inc." },

2820 { 0x000B0D, "Air2U, Inc." },

2821 { 0x000B0E, "Trapeze Networks" },

2822 { 0x000B0F, "Bosch Rexroth" },

2823 { 0x000B10, "11wave Technonlogy Co.,Ltd" },

2824 { 0x000B11, "HIMEJI ABC TRADING CO.,LTD." },

2825 { 0x000B12, "NURI Telecom Co., Ltd." },

2826 { 0x000B13, "ZETRON INC" },

2827 { 0x000B14, "ViewSonic Corporation" },

2828 { 0x000B15, "Platypus Technology" },

2829 { 0x000B16, "Communication Machinery Corporation" },

2830 { 0x000B17, "MKS Instruments" },

2831 { 0x000B18, "Private" },

2832 { 0x000B19, "Vernier Networks, Inc." },

2833 { 0x000B1A, "Industrial Defender, Inc." },

2834 { 0x000B1B, "Systronix, Inc." },

2835 { 0x000B1C, "SIBCO bv" },

2836 { 0x000B1D, "LayerZero Power Systems, Inc." },

2837 { 0x000B1E, "KAPPA opto-electronics GmbH" },

2838 { 0x000B1F, "I CON Computer Co." },

2839 { 0x000B20, "Hirata corporation" },

2840 { 0x000B21, "G-Star Communications Inc." },

2841 { 0x000B22, "Environmental Systems and Services" },

2842 { 0x000B23, "Siemens Home & Office Comm. Devices" },

2843 { 0x000B24, "AirLogic" },

2844 { 0x000B25, "Aeluros" },

2845 { 0x000B26, "Wetek Corporation" },

2846 { 0x000B27, "Scion Corporation" },

2847 { 0x000B28, "Quatech Inc." },

2848 { 0x000B29, "LS(LG) Industrial Systems co.,Ltd" },

2849 { 0x000B2A, "HOWTEL Co., Ltd." },

2850 { 0x000B2B, "HOSTNET CORPORATION" },

2851 { 0x000B2C, "Eiki Industrial Co. Ltd." },

2852 { 0x000B2D, "Danfoss Inc." },

2853 { 0x000B2E, "Cal-Comp Electronics & Communications Company Ltd." },

2854 { 0x000B2F, "bplan GmbH" },

2855 { 0x000B30, "Beijing Gongye Science & Technology Co.,Ltd" },

2856 { 0x000B31, "Yantai ZhiYang Scientific and technology industry CO., LTD" },

2857 { 0x000B32, "VORMETRIC, INC." },

2858 { 0x000B33, "Vivato Technologies" },

2859 { 0x000B34, "ShangHai Broadband Technologies CO.LTD" },

2860 { 0x000B35, "Quad Bit System co., Ltd." },

2861 { 0x000B36, "Productivity Systems, Inc." },

2862 { 0x000B37, "MANUFACTURE DES MONTRES ROLEX SA" },

2863 { 0x000B38, "Knürr GmbH" },

2864 { 0x000B39, "Keisoku Giken Co.,Ltd." },

2865 { 0x000B3A, "PESA Inc." },

2866 { 0x000B3B, "devolo AG" },

2867 { 0x000B3C, "Cygnal Integrated Products, Inc." },

2868 { 0x000B3D, "CONTAL OK Ltd." },

2869 { 0x000B3E, "BittWare, Inc" },

2870 { 0x000B3F, "Anthology Solutions Inc." },

2871 { 0x000B40, "Cambridge Industries Group (CIG)" },

2872 { 0x000B41, "Ing. Büro Dr. Beutlhauser" },

2873 { 0x000B42, "commax Co., Ltd." },

2874 { 0x000B43, "Microscan Systems, Inc." },

2875 { 0x000B44, "Concord Idea Corp." },

2876 { 0x000B45, "Cisco Systems, Inc" },

2877 { 0x000B46, "Cisco Systems, Inc" },

2878 { 0x000B47, "Advanced Energy" },

2879 { 0x000B48, "sofrel" },

2880 { 0x000B49, "RF-Link System Inc." },

2881 { 0x000B4A, "Visimetrics (UK) Ltd" },

2882 { 0x000B4B, "VISIOWAVE SA" },

2883 { 0x000B4C, "Clarion (M) Sdn Bhd" },

2884 { 0x000B4D, "Emuzed" },

2885 { 0x000B4E, "Communications & Power Industries" },

2886 { 0x000B4F, "Verifone" },

2887 { 0x000B50, "Oxygnet" },

2888 { 0x000B51, "Micetek International Inc." },

2889 { 0x000B52, "JOYMAX ELECTRONICS CO. LTD." },

2890 { 0x000B53, "INITIUM Co., Ltd." },

2891 { 0x000B54, "BiTMICRO Networks, Inc." },

2892 { 0x000B55, "ADInstruments" },

2893 { 0x000B56, "Cybernetics" },

2894 { 0x000B57, "Silicon Laboratories" },

2895 { 0x000B58, "Astronautics C.A LTD" },

2896 { 0x000B59, "ScriptPro, LLC" },

2897 { 0x000B5A, "HyperEdge" },

2898 { 0x000B5B, "Rincon Research Corporation" },

2899 { 0x000B5C, "Newtech Co.,Ltd" },

2900 { 0x000B5D, "FUJITSU LIMITED" },

2901 { 0x000B5E, "Audio Engineering Society Inc." },

2902 { 0x000B5F, "Cisco Systems, Inc" },

2903 { 0x000B60, "Cisco Systems, Inc" },

2904 { 0x000B61, "Friedrich Lütze GmbH & Co. KG" },

2905 { 0x000B62, "ib-mohnen KG" },

2906 { 0x000B63, "Kaleidescape" },

2907 { 0x000B64, "Kieback & Peter GmbH & Co KG" },

2908 { 0x000B65, "Sy.A.C. srl" },

2909 { 0x000B66, "Teralink Communications" },

2910 { 0x000B67, "Topview Technology Corporation" },

2911 { 0x000B68, "Addvalue Communications Pte Ltd" },

2912 { 0x000B69, "Franke Finland Oy" },

2913 { 0x000B6A, "Asiarock Technology Limited" },

2914 { 0x000B6B, "Wistron Neweb Corporation" },

2915 { 0x000B6C, "Sychip Inc." },

2916 { 0x000B6D, "SOLECTRON JAPAN NAKANIIDA" },

2917 { 0x000B6E, "Neff Instrument Corp." },

2918 { 0x000B6F, "Media Streaming Networks Inc" },

2919 { 0x000B70, "Load Technology, Inc." },

2920 { 0x000B71, "Litchfield Communications Inc." },

2921 { 0x000B72, "Lawo AG" },

2922 { 0x000B73, "Kodeos Communications" },

2923 { 0x000B74, "Kingwave Technology Co., Ltd." },

2924 { 0x000B75, "Iosoft Ltd." },

2925 { 0x000B76, "ET&T Technology Co. Ltd." },

2926 { 0x000B77, "Cogent Systems, Inc." },

2927 { 0x000B78, "TAIFATECH INC." },

2928 { 0x000B79, "X-COM, Inc." },

2929 { 0x000B7A, "L-3 Linkabit" },

2930 { 0x000B7B, "Test-Um Inc." },

2931 { 0x000B7C, "Telex Communications" },

2932 { 0x000B7D, "SOLOMON EXTREME INTERNATIONAL LTD." },

2933 { 0x000B7E, "SAGINOMIYA Seisakusho Inc." },

2934 { 0x000B7F, "Align Engineering LLC" },

2935 { 0x000B80, "Lycium Networks" },

2936 { 0x000B81, "Kaparel Corporation" },

2937 { 0x000B82, "Grandstream Networks, Inc." },

2938 { 0x000B83, "DATAWATT B.V." },

2939 { 0x000B84, "BODET" },

2940 { 0x000B85, "Cisco Systems, Inc" },

2941 { 0x000B86, "Aruba, a Hewlett Packard Enterprise Company" },

2942 { 0x000B87, "American Reliance Inc." },

2943 { 0x000B88, "Vidisco ltd." },

2944 { 0x000B89, "Top Global Technology, Ltd." },

2945 { 0x000B8A, "MITEQ Inc." },

2946 { 0x000B8B, "KERAJET, S.A." },

2947 { 0x000B8C, "Flextronics" },

2948 { 0x000B8D, "Avvio Networks" },

2949 { 0x000B8E, "Ascent Corporation" },

2950 { 0x000B8F, "AKITA ELECTRONICS SYSTEMS CO.,LTD." },

2951 { 0x000B90, "ADVA Optical Networking Ltd." },

2952 { 0x000B91, "Aglaia Gesellschaft für Bildverarbeitung und Kommunikation mbH" },

2953 { 0x000B92, "Ascom Danmark A/S" },

2954 { 0x000B93, "Ritter Elektronik" },

2955 { 0x000B94, "Digital Monitoring Products, Inc." },

2956 { 0x000B95, "eBet Gaming Systems Pty Ltd" },

2957 { 0x000B96, "Innotrac Diagnostics Oy" },

2958 { 0x000B97, "Matsushita Electric Industrial Co.,Ltd." },

2959 { 0x000B98, "NiceTechVision" },

2960 { 0x000B99, "SensAble Technologies, Inc." },

2961 { 0x000B9A, "Shanghai Ulink Telecom Equipment Co. Ltd." },

2962 { 0x000B9B, "Sirius System Co, Ltd." },

2963 { 0x000B9C, "TriBeam Technologies, Inc." },

2964 { 0x000B9D, "TwinMOS Technologies Inc." },

2965 { 0x000B9E, "Yasing Technology Corp." },

2966 { 0x000B9F, "Neue ELSA GmbH" },

2967 { 0x000BA0, "T&L Information Inc." },

2968 { 0x000BA1, "Fujikura Solutions Ltd." },

2969 { 0x000BA2, "Sumitomo Electric Industries, Ltd" },

2970 { 0x000BA3, "Siemens AG" },

2971 { 0x000BA4, "Shiron Satellite Communications Ltd. (1996)" },

2972 { 0x000BA5, "Quasar Cipta Mandiri, PT" },

2973 { 0x000BA6, "Miyakawa Electric Works Ltd." },

2974 { 0x000BA7, "Maranti Networks" },

2975 { 0x000BA8, "HANBACK ELECTRONICS CO., LTD." },

2976 { 0x000BA9, "CloudShield Technologies, Inc." },

2977 { 0x000BAA, "Aiphone co.,Ltd" },

2978 { 0x000BAB, "Advantech Technology (CHINA) Co., Ltd." },

2979 { 0x000BAC, "3Com Ltd" },

2980 { 0x000BAD, "PC-PoS Inc." },

2981 { 0x000BAE, "Vitals System Inc." },

2982 { 0x000BAF, "WOOJU COMMUNICATIONS Co,.Ltd" },

2983 { 0x000BB0, "Sysnet Telematica srl" },

2984 { 0x000BB1, "Super Star Technology Co., Ltd." },

2985 { 0x000BB2, "SMALLBIG TECHNOLOGY" },

2986 { 0x000BB3, "RiT technologies Ltd." },

2987 { 0x000BB4, "RDC Semiconductor Inc.," },

2988 { 0x000BB5, "nStor Technologies, Inc." },

2989 { 0x000BB6, "Metalligence Technology Corp." },

2990 { 0x000BB7, "Micro Systems Co.,Ltd." },

2991 { 0x000BB8, "Kihoku Electronic Co." },

2992 { 0x000BB9, "Imsys AB" },

2993 { 0x000BBA, "Harmonic, Inc" },

2994 { 0x000BBB, "Etin Systems Co., Ltd" },

2995 { 0x000BBC, "En Garde Systems, Inc." },

2996 { 0x000BBD, "Connexionz Limited" },

2997 { 0x000BBE, "Cisco Systems, Inc" },

2998 { 0x000BBF, "Cisco Systems, Inc" },

2999 { 0x000BC0, "China IWNComm Co., Ltd." },

3000 { 0x000BC1, "Bay Microsystems, Inc." },

3001 { 0x000BC2, "Corinex Communication Corp." },

3002 { 0x000BC3, "Multiplex, Inc." },

3003 { 0x000BC4, "BIOTRONIK GmbH & Co" },

3004 { 0x000BC5, "SMC Networks, Inc." },

3005 { 0x000BC6, "ISAC, Inc." },

3006 { 0x000BC7, "ICET S.p.A." },

3007 { 0x000BC8, "AirFlow Networks" },

3008 { 0x000BC9, "Electroline Equipment" },

3009 { 0x000BCA, "DATAVAN TC" },

3010 { 0x000BCB, "Fagor Automation , S. Coop" },

3011 { 0x000BCC, "JUSAN, S.A." },

3012 { 0x000BCD, "Hewlett Packard" },

3013 { 0x000BCE, "Free2move AB" },

3014 { 0x000BCF, "AGFA NDT INC." },

3015 { 0x000BD0, "XiMeta Technology Americas Inc." },

3016 { 0x000BD1, "Aeronix, Inc." },

3017 { 0x000BD2, "Remopro Technology Inc." },

3018 { 0x000BD3, "cd3o" },

3019 { 0x000BD4, "Beijing Wise Technology & Science Development Co.Ltd" },

3020 { 0x000BD5, "Nvergence, Inc." },

3021 { 0x000BD6, "Paxton Access Ltd" },

3022 { 0x000BD7, "DORMA Time + Access GmbH" },

3023 { 0x000BD8, "Industrial Scientific Corp." },

3024 { 0x000BD9, "General Hydrogen" },

3025 { 0x000BDA, "EyeCross Co.,Inc." },

3026 { 0x000BDB, "Dell Inc." },

3027 { 0x000BDC, "AKCP" },

3028 { 0x000BDD, "TOHOKU RICOH Co., LTD." },

3029 { 0x000BDE, "TELDIX GmbH" },

3030 { 0x000BDF, "Shenzhen RouterD Networks Limited" },

3031 { 0x000BE0, "SercoNet Ltd." },

3032 { 0x000BE1, "Nokia NET Product Operations" },

3033 { 0x000BE2, "Lumenera Corporation" },

3034 { 0x000BE3, "Key Stream Co., Ltd." },

3035 { 0x000BE4, "Hosiden Corporation" },

3036 { 0x000BE5, "HIMS International Corporation" },

3037 { 0x000BE6, "Datel Electronics" },

3038 { 0x000BE7, "COMFLUX TECHNOLOGY INC." },

3039 { 0x000BE8, "AOIP" },

3040 { 0x000BE9, "Actel Corporation" },

3041 { 0x000BEA, "Zultys Technologies" },

3042 { 0x000BEB, "Systegra AG" },

3043 { 0x000BEC, "NIPPON ELECTRIC INSTRUMENT, INC." },

3044 { 0x000BED, "ELM Inc." },

3045 { 0x000BEE, "inc.jet, Incorporated" },

3046 { 0x000BEF, "Code Corporation" },

3047 { 0x000BF0, "MoTEX Products Co., Ltd." },

3048 { 0x000BF1, "LAP Laser Applikations" },

3049 { 0x000BF2, "Chih-Kan Technology Co., Ltd." },

3050 { 0x000BF3, "BAE SYSTEMS" },

3051 { 0x000BF4, "Private" },

3052 { 0x000BF5, "Shanghai Sibo Telecom Technology Co.,Ltd" },

3053 { 0x000BF6, "Nitgen Co., Ltd" },

3054 { 0x000BF7, "NIDEK CO.,LTD" },

3055 { 0x000BF8, "Infinera, Inc." },

3056 { 0x000BF9, "Gemstone Communications, Inc." },

3057 { 0x000BFA, "EXEMYS SRL" },

3058 { 0x000BFB, "D-NET International Corporation" },

3059 { 0x000BFC, "Cisco Systems, Inc" },

3060 { 0x000BFD, "Cisco Systems, Inc" },

3061 { 0x000BFE, "CASTEL Broadband Limited" },

3062 { 0x000BFF, "Berkeley Camera Engineering" },

3063 { 0x000C00, "BEB Industrie-Elektronik AG" },

3064 { 0x000C01, "Abatron AG" },

3065 { 0x000C02, "ABB Oy" },

3066 { 0x000C03, "HDMI Licensing, LLC" },

3067 { 0x000C04, "Tecnova" },

3068 { 0x000C05, "RPA Reserch Co., Ltd." },

3069 { 0x000C06, "Nixvue Systems Pte Ltd" },

3070 { 0x000C07, "Iftest AG" },

3071 { 0x000C08, "HUMEX Technologies Corp." },

3072 { 0x000C09, "Hitachi IE Systems Co., Ltd" },

3073 { 0x000C0A, "Guangdong Province Electronic Technology Research Institute" },

3074 { 0x000C0B, "Broadbus Technologies" },

3075 { 0x000C0C, "APPRO TECHNOLOGY INC." },

3076 { 0x000C0D, "Communications & Power Industries / Satcom Division" },

3077 { 0x000C0E, "XtremeSpectrum, Inc." },

3078 { 0x000C0F, "Techno-One Co., Ltd" },

3079 { 0x000C10, "PNI Corporation" },

3080 { 0x000C11, "NIPPON DEMPA CO.,LTD." },

3081 { 0x000C12, "Micro-Optronic-Messtechnik GmbH" },

3082 { 0x000C13, "MediaQ" },

3083 { 0x000C14, "Diagnostic Instruments, Inc." },

3084 { 0x000C15, "CyberPower Systems, Inc." },

3085 { 0x000C16, "Concorde Microsystems Inc." },

3086 { 0x000C17, "AJA Video Systems Inc" },

3087 { 0x000C18, "Zenisu Keisoku Inc." },

3088 { 0x000C19, "Telio Communications GmbH" },

3089 { 0x000C1A, "Quest Technical Solutions Inc." },

3090 { 0x000C1B, "ORACOM Co, Ltd." },

3091 { 0x000C1C, "MicroWeb Co., Ltd." },

3092 { 0x000C1D, "Mettler & Fuchs AG" },

3093 { 0x000C1E, "Global Cache" },

3094 { 0x000C1F, "Glimmerglass Networks" },

3095 { 0x000C20, "Fi WIn, Inc." },

3096 { 0x000C21, "Faculty of Science and Technology, Keio University" },

3097 { 0x000C22, "Double D Electronics Ltd" },

3098 { 0x000C23, "Beijing Lanchuan Tech. Co., Ltd." },

3099 { 0x000C24, "ANATOR" },

3100 { 0x000C25, "Allied Telesis Labs, Inc." },

3101 { 0x000C26, "Weintek Labs. Inc." },

3102 { 0x000C27, "Sammy Corporation" },

3103 { 0x000C28, "RIFATRON" },

3104 { 0x000C29, "VMware, Inc." },

3105 { 0x000C2A, "OCTTEL Communication Co., Ltd." },

3106 { 0x000C2B, "ELIAS Technology, Inc." },

3107 { 0x000C2C, "Enwiser Inc." },

3108 { 0x000C2D, "FullWave Technology Co., Ltd." },

3109 { 0x000C2E, "Openet information technology(shenzhen) Co., Ltd." },

3110 { 0x000C2F, "SeorimTechnology Co.,Ltd." },

3111 { 0x000C30, "Cisco Systems, Inc" },

3112 { 0x000C31, "Cisco Systems, Inc" },

3113 { 0x000C32, "Avionic Design GmbH" },

3114 { 0x000C33, "Compucase Enterprise Co. Ltd." },

3115 { 0x000C34, "Vixen Co., Ltd." },

3116 { 0x000C35, "KaVo Dental GmbH & Co. KG" },

3117 { 0x000C36, "S-Takaya Electronics Industry Co.,Ltd." },

3118 { 0x000C37, "Geomation, Inc." },

3119 { 0x000C38, "TelcoBridges Inc." },

3120 { 0x000C39, "Sentinel Wireless Inc." },

3121 { 0x000C3A, "Oxance" },

3122 { 0x000C3B, "Orion Electric Co., Ltd." },

3123 { 0x000C3C, "MediaChorus, Inc." },

3124 { 0x000C3D, "Glsystech Co., Ltd." },

3125 { 0x000C3E, "Crest Audio" },

3126 { 0x000C3F, "Cogent Defence & Security Networks," },

3127 { 0x000C40, "Altech Controls" },

3128 { 0x000C41, "Cisco-Linksys, LLC" },

3129 { 0x000C42, "Routerboard.com" },

3130 { 0x000C43, "Ralink Technology, Corp." },

3131 { 0x000C44, "Automated Interfaces, Inc." },

3132 { 0x000C45, "Animation Technologies Inc." },

3133 { 0x000C46, "Allied Telesyn Inc." },

3134 { 0x000C47, "SK Teletech(R&D Planning Team)" },

3135 { 0x000C48, "QoStek Corporation" },

3136 { 0x000C49, "Dangaard Telecom Denmark A/S" },

3137 { 0x000C4A, "Cygnus Microsystems (P) Limited" },

3138 { 0x000C4B, "Cheops Elektronik" },

3139 { 0x000C4C, "Arcor AG&Co." },

3140 { 0x000C4D, "Curtiss-Wright Controls Avionics & Electronics" },

3141 { 0x000C4E, "Winbest Technology CO,LT" },

3142 { 0x000C4F, "UDTech Japan Corporation" },

3143 { 0x000C50, "Seagate Technology" },

3144 { 0x000C51, "Scientific Technologies Inc." },

3145 { 0x000C52, "Roll Systems Inc." },

3146 { 0x000C53, "Private" },

3147 { 0x000C54, "Pedestal Networks, Inc" },

3148 { 0x000C55, "Microlink Communications Inc." },

3149 { 0x000C56, "Megatel Computer (1986) Corp." },

3150 { 0x000C57, "MACKIE Engineering Services Belgium BVBA" },

3151 { 0x000C58, "M&S Systems" },

3152 { 0x000C59, "Indyme Electronics, Inc." },

3153 { 0x000C5A, "IBSmm Embedded Electronics Consulting" },

3154 { 0x000C5B, "HANWANG TECHNOLOGY CO.,LTD" },

3155 { 0x000C5C, "GTN Systems B.V." },

3156 { 0x000C5D, "CHIC TECHNOLOGY (CHINA) CORP." },

3157 { 0x000C5E, "Calypso Medical" },

3158 { 0x000C5F, "Avtec, Inc." },

3159 { 0x000C60, "ACM Systems" },

3160 { 0x000C61, "AC Tech corporation DBA Advanced Digital" },

3161 { 0x000C62, "ABB AB, Cewe-Control" },

3162 { 0x000C63, "Zenith Electronics Corporation" },

3163 { 0x000C64, "X2 MSA Group" },

3164 { 0x000C65, "Sunin Telecom" },

3165 { 0x000C66, "Pronto Networks Inc" },

3166 { 0x000C67, "OYO ELECTRIC CO.,LTD" },

3167 { 0x000C68, "SigmaTel, Inc." },

3168 { 0x000C69, "National Radio Astronomy Observatory" },

3169 { 0x000C6A, "MBARI" },

3170 { 0x000C6B, "Kurz Industrie-Elektronik GmbH" },

3171 { 0x000C6C, "Eve Systems GmbH" },

3172 { 0x000C6D, "Edwards Ltd." },

3173 { 0x000C6E, "ASUSTek COMPUTER INC." },

3174 { 0x000C6F, "Amtek system co.,LTD." },

3175 { 0x000C70, "ACC GmbH" },

3176 { 0x000C71, "Wybron, Inc" },

3177 { 0x000C72, "Tempearl Industrial Co., Ltd." },

3178 { 0x000C73, "TELSON ELECTRONICS CO., LTD" },

3179 { 0x000C74, "RIVERTEC CORPORATION" },

3180 { 0x000C75, "Oriental integrated electronics. LTD" },

3181 { 0x000C76, "MICRO-STAR INTERNATIONAL CO., LTD." },

3182 { 0x000C77, "Life Racing Ltd" },

3183 { 0x000C78, "In-Tech Electronics Limited" },

3184 { 0x000C79, "Extel Communications P/L" },

3185 { 0x000C7A, "DaTARIUS Technologies GmbH" },

3186 { 0x000C7B, "ALPHA PROJECT Co.,Ltd." },

3187 { 0x000C7C, "Internet Information Image Inc." },

3188 { 0x000C7D, "TEIKOKU ELECTRIC MFG. CO., LTD" },

3189 { 0x000C7E, "Tellium Incorporated" },

3190 { 0x000C7F, "synertronixx GmbH" },

3191 { 0x000C80, "Opelcomm Inc." },

3192 { 0x000C81, "Schneider Electric (Australia)" },

3193 { 0x000C82, "NETWORK TECHNOLOGIES INC" },

3194 { 0x000C83, "Logical Solutions" },

3195 { 0x000C84, "Eazix, Inc." },

3196 { 0x000C85, "Cisco Systems, Inc" },

3197 { 0x000C86, "Cisco Systems, Inc" },

3198 { 0x000C87, "AMD" },

3199 { 0x000C88, "Apache Micro Peripherals, Inc." },

3200 { 0x000C89, "AC Electric Vehicles, Ltd." },

3201 { 0x000C8A, "Bose Corporation" },

3202 { 0x000C8B, "Connect Tech Inc" },

3203 { 0x000C8C, "KODICOM CO.,LTD." },

3204 { 0x000C8D, "Balluff MV GmbH" },

3205 { 0x000C8E, "Mentor Engineering Inc" },

3206 { 0x000C8F, "Nergal s.r.l." },

3207 { 0x000C90, "Octasic Inc." },

3208 { 0x000C91, "Riverhead Networks Inc." },

3209 { 0x000C92, "WolfVision Gmbh" },

3210 { 0x000C93, "Xeline Co., Ltd." },

3211 { 0x000C94, "United Electronic Industries, Inc. (EUI)" },

3212 { 0x000C95, "PrimeNet" },

3213 { 0x000C96, "OQO, Inc." },

3214 { 0x000C97, "NV ADB TTV Technologies SA" },

3215 { 0x000C98, "LETEK Communications Inc." },

3216 { 0x000C99, "HITEL LINK Co.,Ltd" },

3217 { 0x000C9A, "Hitech Electronics Corp." },

3218 { 0x000C9B, "EE Solutions, Inc" },

3219 { 0x000C9C, "Chongho information & communications" },

3220 { 0x000C9D, "UbeeAirWalk, Inc." },

3221 { 0x000C9E, "MemoryLink Corp." },

3222 { 0x000C9F, "NKE Corporation" },

3223 { 0x000CA0, "StorCase Technology, Inc." },

3224 { 0x000CA1, "SIGMACOM Co., LTD." },

3225 { 0x000CA2, "Harmonic Video Network" },

3226 { 0x000CA3, "Rancho Technology, Inc." },

3227 { 0x000CA4, "Prompttec Product Management GmbH" },

3228 { 0x000CA5, "Naman NZ LTd" },

3229 { 0x000CA6, "Mintera Corporation" },

3230 { 0x000CA7, "Metro (Suzhou) Technologies Co., Ltd." },

3231 { 0x000CA8, "Garuda Networks Corporation" },

3232 { 0x000CA9, "Ebtron Inc." },

3233 { 0x000CAA, "Cubic Transportation Systems Inc" },

3234 { 0x000CAB, "Commend International GmbH" },

3235 { 0x000CAC, "Citizen Watch Co., Ltd." },

3236 { 0x000CAD, "BTU International" },

3237 { 0x000CAE, "Ailocom Oy" },

3238 { 0x000CAF, "TRI TERM CO.,LTD." },

3239 { 0x000CB0, "Star Semiconductor Corporation" },

3240 { 0x000CB1, "Salland Engineering (Europe) BV" },

3241 { 0x000CB2, "UNION co., ltd." },

3242 { 0x000CB3, "ROUND Co.,Ltd." },

3243 { 0x000CB4, "AutoCell Laboratories, Inc." },

3244 { 0x000CB5, "Premier Technolgies, Inc" },

3245 { 0x000CB6, "NANJING SEU MOBILE & INTERNET TECHNOLOGY CO.,LTD" },

3246 { 0x000CB7, "Nanjing Huazhuo Electronics Co., Ltd." },

3247 { 0x000CB8, "MEDION AG" },

3248 { 0x000CB9, "LEA" },

3249 { 0x000CBA, "Jamex, Inc." },

3250 { 0x000CBB, "ISKRAEMECO" },

3251 { 0x000CBC, "Iscutum" },

3252 { 0x000CBD, "Interface Masters, Inc" },

3253 { 0x000CBE, "Innominate Security Technologies AG" },

3254 { 0x000CBF, "Holy Stone Ent. Co., Ltd." },

3255 { 0x000CC0, "Genera Oy" },

3256 { 0x000CC1, "Eaton Corporation" },

3257 { 0x000CC2, "ControlNet (India) Private Limited" },

3258 { 0x000CC3, "BeWAN systems" },

3259 { 0x000CC4, "Tiptel AG" },

3260 { 0x000CC5, "Nextlink Co., Ltd." },

3261 { 0x000CC6, "Ka-Ro electronics GmbH" },

3262 { 0x000CC7, "Intelligent Computer Solutions Inc." },

3263 { 0x000CC8, "Xytronix Research & Design, Inc." },

3264 { 0x000CC9, "ILWOO DATA & TECHNOLOGY CO.,LTD" },

3265 { 0x000CCA, "HGST a Western Digital Company" },

3266 { 0x000CCB, "Design Combus Ltd" },

3267 { 0x000CCC, "Aeroscout Ltd." },

3268 { 0x000CCD, "IEC - TC57" },

3269 { 0x000CCE, "Cisco Systems, Inc" },

3270 { 0x000CCF, "Cisco Systems, Inc" },

3271 { 0x000CD0, "Symetrix" },

3272 { 0x000CD1, "SFOM Technology Corp." },

3273 { 0x000CD2, "Schaffner EMV AG" },

3274 { 0x000CD3, "Prettl Elektronik Radeberg GmbH" },

3275 { 0x000CD4, "Positron Public Safety Systems inc." },

3276 { 0x000CD5, "Passave Inc." },

3277 { 0x000CD6, "PARTNER TECH" },

3278 { 0x000CD7, "Nallatech Ltd" },

3279 { 0x000CD8, "M. K. Juchheim GmbH & Co" },

3280 { 0x000CD9, "Itcare Co., Ltd" },

3281 { 0x000CDA, "FreeHand Systems, Inc." },

3282 { 0x000CDB, "Brocade Communications Systems LLC" },

3283 { 0x000CDC, "BECS Technology, Inc" },

3284 { 0x000CDD, "AOS technologies AG" },

3285 { 0x000CDE, "ABB STOTZ-KONTAKT GmbH" },

3286 { 0x000CDF, "JAI Manufacturing" },

3287 { 0x000CE0, "Trek Diagnostics Inc." },

3288 { 0x000CE1, "The Open Group" },

3289 { 0x000CE2, "Rolls-Royce" },

3290 { 0x000CE3, "Option International N.V." },

3291 { 0x000CE4, "NeuroCom International, Inc." },

3292 { 0x000CE5, "ARRIS Group, Inc." },

3293 { 0x000CE6, "Fortinet, Inc." },

3294 { 0x000CE7, "MediaTek Inc." },

3295 { 0x000CE8, "GuangZhou AnJuBao Co., Ltd" },

3296 { 0x000CE9, "BLOOMBERG L.P." },

3297 { 0x000CEA, "aphona Kommunikationssysteme" },

3298 { 0x000CEB, "CNMP Networks, Inc." },

3299 { 0x000CEC, "Safran Trusted 4D Inc." },

3300 { 0x000CED, "Real Digital Media" },

3301 { 0x000CEE, "jp-embedded" },

3302 { 0x000CEF, "ONE Investment Group Limited" },

3303 { 0x000CF0, "M & N GmbH" },

3304 { 0x000CF1, "Intel Corporation" },

3305 { 0x000CF2, "GAMESA Eólica" },

3306 { 0x000CF3, "CALL IMAGE SA" },

3307 { 0x000CF4, "AKATSUKI ELECTRIC MFG.CO.,LTD." },

3308 { 0x000CF5, "InfoExpress" },

3309 { 0x000CF6, "Sitecom Europe BV" },

3310 { 0x000CF7, "Nortel Networks" },

3311 { 0x000CF8, "Nortel Networks" },

3312 { 0x000CF9, "Xylem Water Solutions" },

3313 { 0x000CFA, "Digital Systems Corp" },

3314 { 0x000CFB, "Korea Network Systems" },

3315 { 0x000CFC, "S2io Technologies Corp" },

3316 { 0x000CFD, "Hyundai ImageQuest Co.,Ltd." },

3317 { 0x000CFE, "Grand Electronic Co., Ltd" },

3318 { 0x000CFF, "MRO-TEK Realty Limited" },

3319 { 0x000D00, "Seaway Networks Inc." },

3320 { 0x000D01, "P&E Microcomputer Systems, Inc." },

3321 { 0x000D02, "NEC Platforms, Ltd." },

3322 { 0x000D03, "Matrics, Inc." },

3323 { 0x000D04, "Foxboro Eckardt Development GmbH" },

3324 { 0x000D05, "cybernet manufacturing inc." },

3325 { 0x000D06, "Compulogic Limited" },

3326 { 0x000D07, "Calrec Audio Ltd" },

3327 { 0x000D08, "AboveCable, Inc." },

3328 { 0x000D09, "Yuehua(Zhuhai) Electronic CO. LTD" },

3329 { 0x000D0A, "Barco Projection Systems NV" },

3330 { 0x000D0B, "BUFFALO.INC" },

3331 { 0x000D0C, "MDI Security Systems" },

3332 { 0x000D0D, "ITSupported, LLC" },

3333 { 0x000D0E, "Inqnet Systems, Inc." },

3334 { 0x000D0F, "Finlux Ltd" },

3335 { 0x000D10, "Embedtronics Oy" },

3336 { 0x000D11, "DENTSPLY - Gendex" },

3337 { 0x000D12, "AXELL Corporation" },

3338 { 0x000D13, "Wilhelm Rutenbeck GmbH&Co.KG" },

3339 { 0x000D14, "Vtech Innovation LP dba Advanced American Telephones" },

3340 { 0x000D15, "Voipac s.r.o." },

3341 { 0x000D16, "UHS Systems Pty Ltd" },

3342 { 0x000D17, "Turbo Networks Co.Ltd" },

3343 { 0x000D18, "Mega-Trend Electronics CO., LTD." },

3344 { 0x000D19, "ROBE Show lighting" },

3345 { 0x000D1A, "Mustek System Inc." },

3346 { 0x000D1B, "Kyoto Electronics Manufacturing Co., Ltd." },

3347 { 0x000D1C, "Amesys Defense" },

3348 { 0x000D1D, "HIGH-TEK HARNESS ENT. CO., LTD." },

3349 { 0x000D1E, "Control Techniques" },

3350 { 0x000D1F, "AV Digital" },

3351 { 0x000D20, "ASAHIKASEI TECHNOSYSTEM CO.,LTD." },

3352 { 0x000D21, "WISCORE Inc." },

3353 { 0x000D22, "Unitronics LTD" },

3354 { 0x000D23, "Smart Solution, Inc" },

3355 { 0x000D24, "SENTEC E&E CO., LTD." },

3356 { 0x000D25, "SANDEN CORPORATION" },

3357 { 0x000D26, "Primagraphics Limited" },

3358 { 0x000D27, "MICROPLEX Printware AG" },

3359 { 0x000D28, "Cisco Systems, Inc" },

3360 { 0x000D29, "Cisco Systems, Inc" },

3361 { 0x000D2A, "Scanmatic AS" },

3362 { 0x000D2B, "Racal Instruments" },

3363 { 0x000D2C, "Lantronix" },

3364 { 0x000D2D, "NCT Deutschland GmbH" },

3365 { 0x000D2E, "Matsushita Avionics Systems Corporation" },

3366 { 0x000D2F, "AIN Comm.Tech.Co., LTD" },

3367 { 0x000D30, "IceFyre Semiconductor" },

3368 { 0x000D31, "Compellent Technologies, Inc." },

3369 { 0x000D32, "DispenseSource, Inc." },

3370 { 0x000D33, "Prediwave Corp." },

3371 { 0x000D34, "Shell International Exploration and Production, Inc." },

3372 { 0x000D35, "PAC International Ltd" },

3373 { 0x000D36, "Wu Han Routon Electronic Co., Ltd" },

3374 { 0x000D37, "WIPLUG" },

3375 { 0x000D38, "NISSIN INC." },

3376 { 0x000D39, "Nevion" },

3377 { 0x000D3A, "Microsoft Corp." },

3378 { 0x000D3B, "Microelectronics Technology Inc." },

3379 { 0x000D3C, "i.Tech Dynamic Ltd" },

3380 { 0x000D3D, "Hammerhead Systems, Inc." },

3381 { 0x000D3E, "APLUX Communications Ltd." },

3382 { 0x000D3F, "VTI Instruments Corporation" },

3383 { 0x000D40, "Verint Loronix Video Solutions" },

3384 { 0x000D41, "Siemens AG ICM MP UC RD IT KLF1" },

3385 { 0x000D42, "Newbest Development Limited" },

3386 { 0x000D43, "DRS Tactical Systems Inc." },

3387 { 0x000D44, "Audio BU - Logitech" },

3388 { 0x000D45, "Tottori SANYO Electric Co., Ltd." },

3389 { 0x000D46, "Parker SSD Drives" },

3390 { 0x000D47, "Collex" },

3391 { 0x000D48, "AEWIN Technologies Co., Ltd." },

3392 { 0x000D49, "Triton Systems of Delaware, Inc." },

3393 { 0x000D4A, "Steag ETA-Optik" },

3394 { 0x000D4B, "Roku, Inc." },

3395 { 0x000D4C, "Outline Electronics Ltd." },

3396 { 0x000D4D, "Ninelanes" },

3397 { 0x000D4E, "NDR Co.,LTD." },

3398 { 0x000D4F, "Kenwood Corporation" },

3399 { 0x000D50, "Galazar Networks" },

3400 { 0x000D51, "DIVR Systems, Inc." },

3401 { 0x000D52, "Comart system" },

3402 { 0x000D53, "Beijing 5w Communication Corp." },

3403 { 0x000D54, "3Com Ltd" },

3404 { 0x000D55, "SANYCOM Technology Co.,Ltd" },

3405 { 0x000D56, "Dell Inc." },

3406 { 0x000D57, "Fujitsu I-Network Systems Limited." },

3407 { 0x000D58, "Private" },

3408 { 0x000D59, "Amity Systems, Inc." },

3409 { 0x000D5A, "Tiesse SpA" },

3410 { 0x000D5B, "Smart Empire Investments Limited" },

3411 { 0x000D5C, "Robert Bosch GmbH, VT-ATMO" },

3412 { 0x000D5D, "Raritan Computer, Inc" },

3413 { 0x000D5E, "NEC Personal Products" },

3414 { 0x000D5F, "Minds Inc" },

3415 { 0x000D60, "IBM Corp" },

3416 { 0x000D61, "Giga-Byte Technology Co., Ltd." },

3417 { 0x000D62, "Funkwerk Dabendorf GmbH" },

3418 { 0x000D63, "DENT Instruments, Inc." },

3419 { 0x000D64, "COMAG Handels AG" },

3420 { 0x000D65, "Cisco Systems, Inc" },

3421 { 0x000D66, "Cisco Systems, Inc" },

3422 { 0x000D67, "Ericsson" },

3423 { 0x000D68, "Vinci Systems, Inc." },

3424 { 0x000D69, "TMT&D Corporation" },

3425 { 0x000D6A, "Redwood Technologies LTD" },

3426 { 0x000D6B, "Mita-Teknik A/S" },

3427 { 0x000D6C, "M-Audio" },

3428 { 0x000D6D, "K-Tech Devices Corp." },

3429 { 0x000D6E, "K-Patents Oy" },

3430 { 0x000D6F, "Ember Corporation" },

3431 { 0x000D70, "Datamax Corporation" },

3432 { 0x000D71, "boca systems" },

3433 { 0x000D72, "2Wire Inc" },

3434 { 0x000D73, "Technical Support, Inc." },

3435 { 0x000D74, "Sand Network Systems, Inc." },

3436 { 0x000D75, "Kobian Pte Ltd - Taiwan Branch" },

3437 { 0x000D76, "Hokuto Denshi Co,. Ltd." },

3438 { 0x000D77, "FalconStor Software" },

3439 { 0x000D78, "Engineering & Security" },

3440 { 0x000D79, "Dynamic Solutions Co,.Ltd." },

3441 { 0x000D7A, "DiGATTO Asia Pacific Pte Ltd" },

3442 { 0x000D7B, "Consensys Computers Inc." },

3443 { 0x000D7C, "Codian Ltd" },

3444 { 0x000D7D, "Afco Systems" },

3445 { 0x000D7E, "Axiowave Networks, Inc." },

3446 { 0x000D7F, "MIDAS COMMUNICATION TECHNOLOGIES PTE LTD ( Foreign Branch)" },

3447 { 0x000D80, "Online Development Inc" },

3448 { 0x000D81, "Pepperl+Fuchs GmbH" },

3449 { 0x000D82, "PHSNET" },

3450 { 0x000D83, "Sanmina-SCI Hungary Ltd." },

3451 { 0x000D84, "Makus Inc." },

3452 { 0x000D85, "Tapwave, Inc." },

3453 { 0x000D86, "Huber + Suhner AG" },

3454 { 0x000D87, "Elitegroup Computer Systems Co.,Ltd." },

3455 { 0x000D88, "D-Link Corporation" },

3456 { 0x000D89, "Bils Technology Inc" },

3457 { 0x000D8A, "Winners Electronics Co., Ltd." },

3458 { 0x000D8B, "T&D Corporation" },

3459 { 0x000D8C, "Shanghai Wedone Digital Ltd. CO." },

3460 { 0x000D8D, "Prosoft Technology, Inc" },

3461 { 0x000D8E, "Koden Electronics Co., Ltd." },

3462 { 0x000D8F, "King Tsushin Kogyo Co., LTD." },

3463 { 0x000D90, "Factum Electronics AB" },

3464 { 0x000D91, "Eclipse (HQ Espana) S.L." },

3465 { 0x000D92, "ARIMA Communications Corp." },

3466 { 0x000D93, "Apple, Inc." },

3467 { 0x000D94, "AFAR Communications,Inc" },

3468 { 0x000D95, "Opti-cell, Inc." },

3469 { 0x000D96, "Vtera Technology Inc." },

3470 { 0x000D97, "Hitachi Energy USA Inc." },

3471 { 0x000D98, "S.W.A.C. Schmitt-Walter Automation Consult GmbH" },

3472 { 0x000D99, "Orbital Sciences Corp.; Launch Systems Group" },

3473 { 0x000D9A, "INFOTEC LTD" },

3474 { 0x000D9B, "Heraeus Electro-Nite International N.V." },

3475 { 0x000D9C, "K.A. Schmersal GmbH & Co. KG" },

3476 { 0x000D9D, "Hewlett Packard" },

3477 { 0x000D9E, "TOKUDEN OHIZUMI SEISAKUSYO Co.,Ltd." },

3478 { 0x000D9F, "RF Micro Devices" },

3479 { 0x000DA0, "NEDAP N.V." },

3480 { 0x000DA1, "MIRAE ITS Co.,LTD." },

3481 { 0x000DA2, "Infrant Technologies, Inc." },

3482 { 0x000DA3, "Emerging Technologies Limited" },

3483 { 0x000DA4, "DOSCH & AMAND SYSTEMS AG" },

3484 { 0x000DA5, "Fabric7 Systems, Inc" },

3485 { 0x000DA6, "Universal Switching Corporation" },

3486 { 0x000DA7, "Private" },

3487 { 0x000DA8, "Teletronics Technology Corporation" },

3488 { 0x000DA9, "INGETEAM" },

3489 { 0x000DAA, "S.A.Tehnology co.,Ltd." },

3490 { 0x000DAB, "Parker Hannifin GmbH Electromechanical Division Europe" },

3491 { 0x000DAC, "Japan CBM Corporation" },

3492 { 0x000DAD, "Dataprobe, Inc." },

3493 { 0x000DAE, "SAMSUNG HEAVY INDUSTRIES CO., LTD." },

3494 { 0x000DAF, "Plexus Corp (UK) Ltd" },

3495 { 0x000DB0, "Olym-tech Co.,Ltd." },

3496 { 0x000DB1, "Japan Network Service Co., Ltd." },

3497 { 0x000DB2, "Ammasso, Inc." },

3498 { 0x000DB3, "SDO Communication Corperation" },

3499 { 0x000DB4, "Stormshield" },

3500 { 0x000DB5, "GLOBALSAT TECHNOLOGY CORPORATION" },

3501 { 0x000DB6, "Broadcom" },

3502 { 0x000DB7, "SANKO ELECTRIC CO,.LTD" },

3503 { 0x000DB8, "SCHILLER AG" },

3504 { 0x000DB9, "PC Engines GmbH" },

3505 { 0x000DBA, "Océ Document Technologies GmbH" },

3506 { 0x000DBB, "Nippon Dentsu Co.,Ltd." },

3507 { 0x000DBC, "Cisco Systems, Inc" },

3508 { 0x000DBD, "Cisco Systems, Inc" },

3509 { 0x000DBE, "Bel Fuse Europe Ltd.,UK" },

3510 { 0x000DBF, "TekTone Sound & Signal Mfg., Inc." },

3511 { 0x000DC0, "Spagat AS" },

3512 { 0x000DC1, "SafeWeb Inc" },

3513 { 0x000DC2, "Private" },

3514 { 0x000DC3, "First Communication, Inc." },

3515 { 0x000DC4, "Emcore Corporation" },

3516 { 0x000DC5, "EchoStar Global B.V." },

3517 { 0x000DC6, "DigiRose Technology Co., Ltd." },

3518 { 0x000DC7, "COSMIC ENGINEERING INC." },

3519 { 0x000DC8, "AirMagnet, Inc" },

3520 { 0x000DC9, "THALES Elektronik Systeme GmbH" },

3521 { 0x000DCA, "Tait Electronics" },

3522 { 0x000DCB, "Petcomkorea Co., Ltd." },

3523 { 0x000DCC, "NEOSMART Corp." },

3524 { 0x000DCD, "GROUPE TXCOM" },

3525 { 0x000DCE, "Dynavac Technology Pte Ltd" },

3526 { 0x000DCF, "Cidra Corp." },

3527 { 0x000DD0, "TetraTec Instruments GmbH" },

3528 { 0x000DD1, "Stryker Corporation" },

3529 { 0x000DD2, "Simrad Optronics ASA" },

3530 { 0x000DD3, "SAMWOO Telecommunication Co.,Ltd." },

3531 { 0x000DD4, "Symantec Corporation" },

3532 { 0x000DD5, "O'RITE TECHNOLOGY CO.,LTD" },

3533 { 0x000DD6, "ITI LTD" },

3534 { 0x000DD7, "Bright" },

3535 { 0x000DD8, "BBN" },

3536 { 0x000DD9, "Anton Paar GmbH" },

3537 { 0x000DDA, "ALLIED TELESIS K.K." },

3538 { 0x000DDB, "AIRWAVE TECHNOLOGIES INC." },

3539 { 0x000DDC, "VAC" },

3540 { 0x000DDD, "Profilo Telra Elektronik Sanayi ve Ticaret. A.Ş" },

3541 { 0x000DDE, "Joyteck Co., Ltd." },

3542 { 0x000DDF, "Japan Image & Network Inc." },

3543 { 0x000DE0, "ICPDAS Co.,LTD" },

3544 { 0x000DE1, "Control Products, Inc." },

3545 { 0x000DE2, "CMZ Sistemi Elettronici" },

3546 { 0x000DE3, "AT Sweden AB" },

3547 { 0x000DE4, "DIGINICS, Inc." },

3548 { 0x000DE5, "Samsung Thales" },

3549 { 0x000DE6, "YOUNGBO ENGINEERING CO.,LTD" },

3550 { 0x000DE7, "Snap-on OEM Group" },

3551 { 0x000DE8, "Nasaco Electronics Pte. Ltd" },

3552 { 0x000DE9, "Napatech Aps" },

3553 { 0x000DEA, "Kingtel Telecommunication Corp." },

3554 { 0x000DEB, "CompXs Limited" },

3555 { 0x000DEC, "Cisco Systems, Inc" },

3556 { 0x000DED, "Cisco Systems, Inc" },

3557 { 0x000DEE, "Andrew RF Power Amplifier Group" },

3558 { 0x000DEF, "Soc. Coop. Bilanciai" },

3559 { 0x000DF0, "QCOM TECHNOLOGY INC." },

3560 { 0x000DF1, "IONIX INC." },

3561 { 0x000DF2, "Private" },

3562 { 0x000DF3, "Asmax Solutions" },

3563 { 0x000DF4, "Watertek Co." },

3564 { 0x000DF5, "Teletronics International Inc." },

3565 { 0x000DF6, "Technology Thesaurus Corp." },

3566 { 0x000DF7, "Space Dynamics Lab" },

3567 { 0x000DF8, "ORGA Kartensysteme GmbH" },

3568 { 0x000DF9, "NDS Limited" },

3569 { 0x000DFA, "Micro Control Systems Ltd." },

3570 { 0x000DFB, "Komax AG" },

3571 { 0x000DFC, "ITFOR Inc." },

3572 { 0x000DFD, "Huges Hi-Tech Inc.," },

3573 { 0x000DFE, "Hauppauge Computer Works, Inc." },

3574 { 0x000DFF, "CHENMING MOLD INDUSTRY CORP." },

3575 { 0x000E00, "Atrie" },

3576 { 0x000E01, "ASIP Technologies Inc." },

3577 { 0x000E02, "Advantech AMT Inc." },

3578 { 0x000E03, "Emulex Corporation" },

3579 { 0x000E04, "CMA/Microdialysis AB" },

3580 { 0x000E05, "WIRELESS MATRIX CORP." },

3581 { 0x000E06, "Team Simoco Ltd" },

3582 { 0x000E07, "Sony Corporation" },

3583 { 0x000E08, "Cisco-Linksys, LLC" },

3584 { 0x000E09, "Shenzhen Coship Software Co.,LTD." },

3585 { 0x000E0A, "SAKUMA DESIGN OFFICE" },

3586 { 0x000E0B, "Netac Technology Co., Ltd." },

3587 { 0x000E0C, "Intel Corporation" },

3588 { 0x000E0D, "Hesch Schröder GmbH" },

3589 { 0x000E0E, "ESA elettronica S.P.A." },

3590 { 0x000E0F, "ERMME" },

3591 { 0x000E10, "C-guys, Inc." },

3592 { 0x000E11, "BDT Büro und Datentechnik GmbH & Co.KG" },

3593 { 0x000E12, "Adaptive Micro Systems Inc." },

3594 { 0x000E13, "Accu-Sort Systems inc." },

3595 { 0x000E14, "Visionary Solutions, Inc." },

3596 { 0x000E15, "Tadlys LTD" },

3597 { 0x000E16, "SouthWing S.L." },

3598 { 0x000E17, "Private" },

3599 { 0x000E18, "MyA Technology" },

3600 { 0x000E19, "LogicaCMG Pty Ltd" },

3601 { 0x000E1A, "JPS Communications" },

3602 { 0x000E1B, "IAV GmbH" },

3603 { 0x000E1C, "Hach Company" },

3604 { 0x000E1D, "ARION Technology Inc." },

3605 { 0x000E1E, "QLogic Corporation" },

3606 { 0x000E1F, "TCL Networks Equipment Co., Ltd." },

3607 { 0x000E20, "ACCESS Systems Americas, Inc." },

3608 { 0x000E21, "MTU Friedrichshafen GmbH" },

3609 { 0x000E22, "Private" },

3610 { 0x000E23, "Incipient, Inc." },

3611 { 0x000E24, "Huwell Technology Inc." },

3612 { 0x000E25, "Hannae Technology Co., Ltd" },

3613 { 0x000E26, "Gincom Technology Corp." },

3614 { 0x000E27, "Crere Networks, Inc." },

3615 { 0x000E28, "Dynamic Ratings P/L" },

3616 { 0x000E29, "Shester Communications Inc" },

3617 { 0x000E2A, "dormakaba USA Inc." },

3618 { 0x000E2B, "Safari Technologies" },

3619 { 0x000E2C, "Netcodec co." },

3620 { 0x000E2D, "Hyundai Digital Technology Co.,Ltd." },

3621 { 0x000E2E, "Edimax Technology Co. Ltd." },

3622 { 0x000E2F, "Roche Diagnostics GmbH" },

3623 { 0x000E30, "AERAS Networks, Inc." },

3624 { 0x000E31, "Olympus Soft Imaging Solutions GmbH" },

3625 { 0x000E32, "Kontron Medical" },

3626 { 0x000E33, "Shuko Electronics Co.,Ltd" },

3627 { 0x000E34, "NexGen City, LP" },

3628 { 0x000E35, "Intel Corporation" },

3629 { 0x000E36, "HEINESYS, Inc." },

3630 { 0x000E37, "Harms & Wende GmbH & Co.KG" },

3631 { 0x000E38, "Cisco Systems, Inc" },

3632 { 0x000E39, "Cisco Systems, Inc" },

3633 { 0x000E3A, "Cirrus Logic" },

3634 { 0x000E3B, "Hawking Technologies, Inc." },

3635 { 0x000E3C, "Transact Technologies Inc" },

3636 { 0x000E3D, "Televic N.V." },

3637 { 0x000E3E, "Sun Optronics Inc" },

3638 { 0x000E3F, "Soronti, Inc." },

3639 { 0x000E40, "Nortel Networks" },

3640 { 0x000E41, "NIHON MECHATRONICS CO.,LTD." },

3641 { 0x000E42, "Motic Incoporation Ltd." },

3642 { 0x000E43, "G-Tek Electronics Sdn. Bhd." },

3643 { 0x000E44, "Digital 5, Inc." },

3644 { 0x000E45, "Beijing Newtry Electronic Technology Ltd" },

3645 { 0x000E46, "Niigata Seimitsu Co.,Ltd." },

3646 { 0x000E47, "NCI System Co.,Ltd." },

3647 { 0x000E48, "Lipman TransAction Solutions" },

3648 { 0x000E49, "Forsway Scandinavia AB" },

3649 { 0x000E4A, "Changchun Huayu WEBPAD Co.,LTD" },

3650 { 0x000E4B, "atrium c and i" },

3651 { 0x000E4C, "Bermai Inc." },

3652 { 0x000E4D, "Numesa Inc." },

3653 { 0x000E4E, "Waveplus Technology Co., Ltd." },

3654 { 0x000E4F, "Trajet GmbH" },

3655 { 0x000E50, "Thomson Telecom Belgium" },

3656 { 0x000E51, "TECNA SpA" },

3657 { 0x000E52, "Optium Corporation" },

3658 { 0x000E53, "AV TECH CORPORATION" },

3659 { 0x000E54, "AlphaCell Wireless Ltd." },

3660 { 0x000E55, "AUVITRAN" },

3661 { 0x000E56, "4G Systems GmbH & Co. KG" },

3662 { 0x000E57, "Iworld Networking, Inc." },

3663 { 0x000E58, "Sonos, Inc." },

3664 { 0x000E59, "Sagemcom Broadband SAS" },

3665 { 0x000E5A, "TELEFIELD inc." },

3666 { 0x000E5B, "ParkerVision - Direct2Data" },

3667 { 0x000E5C, "ARRIS Group, Inc." },

3668 { 0x000E5D, "Triple Play Technologies A/S" },

3669 { 0x000E5E, "Raisecom Technology CO., LTD" },

3670 { 0x000E5F, "activ-net GmbH & Co. KG" },

3671 { 0x000E60, "360SUN Digital Broadband Corporation" },

3672 { 0x000E61, "MICROTROL LIMITED" },

3673 { 0x000E62, "Nortel Networks" },

3674 { 0x000E63, "Lemke Diagnostics GmbH" },

3675 { 0x000E64, "Elphel, Inc" },

3676 { 0x000E65, "TransCore" },

3677 { 0x000E66, "Hitachi Industry & Control Solutions, Ltd." },

3678 { 0x000E67, "Eltis Microelectronics Ltd." },

3679 { 0x000E68, "E-TOP Network Technology Inc." },

3680 { 0x000E69, "China Electric Power Research Institute" },

3681 { 0x000E6A, "3Com Ltd" },

3682 { 0x000E6B, "Janitza electronics GmbH" },

3683 { 0x000E6C, "Device Drivers Limited" },

3684 { 0x000E6D, "Murata Manufacturing Co., Ltd." },

3685 { 0x000E6E, "MAT S.A. (Mircrelec Advanced Technology)" },

3686 { 0x000E6F, "IRIS Corporation Berhad" },

3687 { 0x000E70, "in2 Networks" },

3688 { 0x000E71, "Gemstar Technology Development Ltd." },

3689 { 0x000E72, "Arca Technologies S.r.l." },

3690 { 0x000E73, "Tpack A/S" },

3691 { 0x000E74, "Solar Telecom. Tech" },

3692 { 0x000E75, "New York Air Brake Corp." },

3693 { 0x000E76, "GEMSOC INNOVISION INC." },

3694 { 0x000E77, "Decru, Inc." },

3695 { 0x000E78, "Amtelco" },

3696 { 0x000E79, "Ample Communications Inc." },

3697 { 0x000E7A, "GemWon Communications Co., Ltd." },

3698 { 0x000E7B, "Toshiba" },

3699 { 0x000E7C, "Televes S.A." },

3700 { 0x000E7D, "Electronics Line 3000 Ltd." },

3701 { 0x000E7E, "ionSign Oy" },

3702 { 0x000E7F, "Hewlett Packard" },

3703 { 0x000E80, "Thomson Technology Inc" },

3704 { 0x000E81, "Devicescape Software, Inc." },

3705 { 0x000E82, "Infinity Tech" },

3706 { 0x000E83, "Cisco Systems, Inc" },

3707 { 0x000E84, "Cisco Systems, Inc" },

3708 { 0x000E85, "Catalyst Enterprises, Inc." },

3709 { 0x000E86, "Alcatel North America" },

3710 { 0x000E87, "adp Gauselmann GmbH" },

3711 { 0x000E88, "VIDEOTRON CORP." },

3712 { 0x000E89, "CLEMATIC" },

3713 { 0x000E8A, "Avara Technologies Pty. Ltd." },

3714 { 0x000E8B, "Astarte Technology Co, Ltd." },

3715 { 0x000E8C, "Siemens AG" },

3716 { 0x000E8D, "Systems in Progress Holding GmbH" },

3717 { 0x000E8E, "SparkLAN Communications, Inc." },

3718 { 0x000E8F, "Sercomm Corporation." },

3719 { 0x000E90, "PONICO CORP." },

3720 { 0x000E91, "Navico Auckland Ltd" },

3721 { 0x000E92, "Open Telecom" },

3722 { 0x000E93, "Milénio 3 Sistemas Electrónicos, Lda." },

3723 { 0x000E94, "Maas International BV" },

3724 { 0x000E95, "Fujiya Denki Seisakusho Co.,Ltd." },

3725 { 0x000E96, "Cubic Defense Applications, Inc." },

3726 { 0x000E97, "Ultracker Technology CO., Inc" },

3727 { 0x000E98, "HME Clear-Com LTD." },

3728 { 0x000E99, "Spectrum Digital, Inc" },

3729 { 0x000E9A, "BOE TECHNOLOGY GROUP CO.,LTD" },

3730 { 0x000E9B, "Ambit Microsystems Corporation" },

3731 { 0x000E9C, "Benchmark Electronics" },

3732 { 0x000E9D, "Tiscali UK Ltd" },

3733 { 0x000E9E, "Topfield Co., Ltd" },

3734 { 0x000E9F, "TEMIC SDS GmbH" },

3735 { 0x000EA0, "NetKlass Technology Inc." },

3736 { 0x000EA1, "Formosa Teletek Corporation" },

3737 { 0x000EA2, "McAfee, Inc" },

3738 { 0x000EA3, "CNCR-IT CO.,LTD,HangZhou P.R.CHINA" },

3739 { 0x000EA4, "Quantum Corp." },

3740 { 0x000EA5, "BLIP Systems" },

3741 { 0x000EA6, "ASUSTek COMPUTER INC." },

3742 { 0x000EA7, "Endace Technology" },

3743 { 0x000EA8, "United Technologists Europe Limited" },

3744 { 0x000EA9, "Shanghai Xun Shi Communications Equipment Ltd. Co." },

3745 { 0x000EAA, "Scalent Systems, Inc." },

3746 { 0x000EAB, "Cray Inc" },

3747 { 0x000EAC, "MINTRON ENTERPRISE CO., LTD." },

3748 { 0x000EAD, "Metanoia Technologies, Inc." },

3749 { 0x000EAE, "GAWELL TECHNOLOGIES CORP." },

3750 { 0x000EAF, "CASTEL" },

3751 { 0x000EB0, "Solutions Radio BV" },

3752 { 0x000EB1, "Newcotech,Ltd" },

3753 { 0x000EB2, "Micro-Research Finland Oy" },

3754 { 0x000EB3, "Hewlett Packard" },

3755 { 0x000EB4, "GUANGZHOU GAOKE COMMUNICATIONS TECHNOLOGY CO.LTD." },

3756 { 0x000EB5, "Ecastle Electronics Co., Ltd." },

3757 { 0x000EB6, "Riverbed Technology, Inc." },

3758 { 0x000EB7, "Knovative, Inc." },

3759 { 0x000EB8, "Iiga co.,Ltd" },

3760 { 0x000EB9, "HASHIMOTO Electronics Industry Co.,Ltd." },

3761 { 0x000EBA, "HANMI SEMICONDUCTOR CO., LTD." },

3762 { 0x000EBB, "Everbee Networks" },

3763 { 0x000EBC, "Paragon Fidelity GmbH" },

3764 { 0x000EBD, "Burdick, a Quinton Compny" },

3765 { 0x000EBE, "B&B Electronics Manufacturing Co." },

3766 { 0x000EBF, "Remsdaq Limited" },

3767 { 0x000EC0, "Nortel Networks" },

3768 { 0x000EC1, "MYNAH Technologies" },

3769 { 0x000EC2, "Lowrance Electronics, Inc." },

3770 { 0x000EC3, "Logic Controls, Inc." },

3771 { 0x000EC4, "Iskra Transmission d.d." },

3772 { 0x000EC5, "Digital Multitools Inc" },

3773 { 0x000EC6, "ASIX ELECTRONICS CORP." },

3774 { 0x000EC7, "Motorola Korea" },

3775 { 0x000EC8, "Zoran Corporation" },

3776 { 0x000EC9, "YOKO Technology Corp." },

3777 { 0x000ECA, "WTSS Inc" },

3778 { 0x000ECB, "VineSys Technology" },

3779 { 0x000ECC, "Tableau, LLC" },

3780 { 0x000ECD, "SKOV A/S" },

3781 { 0x000ECE, "S.I.T.T.I. S.p.A." },

3782 { 0x000ECF, "PROFIBUS Nutzerorganisation e.V." },

3783 { 0x000ED0, "Privaris, Inc." },

3784 { 0x000ED1, "Osaka Micro Computer." },

3785 { 0x000ED2, "Filtronic plc" },

3786 { 0x000ED3, "Epicenter, Inc." },

3787 { 0x000ED4, "CRESITT INDUSTRIE" },

3788 { 0x000ED5, "COPAN Systems Inc." },

3789 { 0x000ED6, "Cisco Systems, Inc" },

3790 { 0x000ED7, "Cisco Systems, Inc" },

3791 { 0x000ED8, "Positron Access Solutions Corp" },

3792 { 0x000ED9, "Aksys, Ltd." },

3793 { 0x000EDA, "C-TECH UNITED CORP." },

3794 { 0x000EDB, "XiNCOM Corp." },

3795 { 0x000EDC, "Tellion INC." },

3796 { 0x000EDD, "SHURE INCORPORATED" },

3797 { 0x000EDE, "REMEC, Inc." },

3798 { 0x000EDF, "PLX Technology" },

3799 { 0x000EE0, "Mcharge" },

3800 { 0x000EE1, "ExtremeSpeed Inc." },

3801 { 0x000EE2, "Custom Engineering" },

3802 { 0x000EE3, "Chiyu Technology Co.,Ltd" },

3803 { 0x000EE4, "BOE TECHNOLOGY GROUP CO.,LTD" },

3804 { 0x000EE5, "bitWallet, Inc." },

3805 { 0x000EE6, "Adimos Systems LTD" },

3806 { 0x000EE7, "AAC ELECTRONICS CORP." },

3807 { 0x000EE8, "Zioncom Electronics (Shenzhen) Ltd." },

3808 { 0x000EE9, "WayTech Development, Inc." },

3809 { 0x000EEA, "Shadong Luneng Jicheng Electronics,Co.,Ltd" },

3810 { 0x000EEB, "Sandmartin(zhong shan)Electronics Co.,Ltd" },

3811 { 0x000EEC, "Orban" },

3812 { 0x000EED, "Nokia Danmark A/S" },

3813 { 0x000EEE, "Muco Industrie BV" },

3814 { 0x000EEF, "Private" },

3815 { 0x000EF0, "Festo AG & Co. KG" },

3816 { 0x000EF1, "EZQUEST INC." },

3817 { 0x000EF2, "Infinico Corporation" },

3818 { 0x000EF3, "Smartlabs, Inc." },

3819 { 0x000EF4, "Kasda Networks Inc" },

3820 { 0x000EF5, "iPAC Technology Co., Ltd." },

3821 { 0x000EF6, "E-TEN Information Systems Co., Ltd." },

3822 { 0x000EF7, "Vulcan Portals Inc" },

3823 { 0x000EF8, "SBC ASI" },

3824 { 0x000EF9, "REA Elektronik GmbH" },

3825 { 0x000EFA, "Optoway Technology Incorporation" },

3826 { 0x000EFB, "Macey Enterprises" },

3827 { 0x000EFC, "JTAG Technologies B.V." },

3828 { 0x000EFD, "FUJINON CORPORATION" },

3829 { 0x000EFE, "EndRun Technologies LLC" },

3830 { 0x000EFF, "Megasolution,Inc." },

3831 { 0x000F00, "Legra Systems, Inc." },

3832 { 0x000F01, "DIGITALKS INC" },

3833 { 0x000F02, "Digicube Technology Co., Ltd" },

3834 { 0x000F03, "COM&C CO., LTD" },

3835 { 0x000F04, "cim-usa inc" },

3836 { 0x000F05, "3B SYSTEM INC." },

3837 { 0x000F06, "Nortel Networks" },

3838 { 0x000F07, "Mangrove Systems, Inc." },

3839 { 0x000F08, "Indagon Oy" },

3840 { 0x000F09, "Private" },

3841 { 0x000F0A, "Clear Edge Networks" },

3842 { 0x000F0B, "Kentima Technologies AB" },

3843 { 0x000F0C, "SYNCHRONIC ENGINEERING" },

3844 { 0x000F0D, "Hunt Electronic Co., Ltd." },

3845 { 0x000F0E, "WaveSplitter Technologies, Inc." },

3846 { 0x000F0F, "Real ID Technology Co., Ltd." },

3847 { 0x000F10, "RDM Corporation" },

3848 { 0x000F11, "Prodrive B.V." },

3849 { 0x000F12, "Panasonic Europe Ltd." },

3850 { 0x000F13, "Nisca corporation" },

3851 { 0x000F14, "Mindray Co., Ltd." },

3852 { 0x000F15, "Icotera A/S" },

3853 { 0x000F16, "JAY HOW TECHNOLOGY CO.," },

3854 { 0x000F17, "Insta Elektro GmbH" },

3855 { 0x000F18, "Industrial Control Systems" },

3856 { 0x000F19, "Boston Scientific" },

3857 { 0x000F1A, "Gaming Support B.V." },

3858 { 0x000F1B, "Ego Systems Inc." },

3859 { 0x000F1C, "DigitAll World Co., Ltd" },

3860 { 0x000F1D, "Cosmo Techs Co., Ltd." },

3861 { 0x000F1E, "Chengdu KT Electric Co.of High & New Technology" },

3862 { 0x000F1F, "Dell Inc." },

3863 { 0x000F20, "Hewlett Packard" },

3864 { 0x000F21, "Scientific Atlanta, Inc" },

3865 { 0x000F22, "Helius, Inc." },

3866 { 0x000F23, "Cisco Systems, Inc" },

3867 { 0x000F24, "Cisco Systems, Inc" },

3868 { 0x000F25, "AimValley B.V." },

3869 { 0x000F26, "WorldAccxx LLC" },

3870 { 0x000F27, "TEAL Electronics, Inc." },

3871 { 0x000F28, "Itronix Corporation" },

3872 { 0x000F29, "Augmentix Corporation" },

3873 { 0x000F2A, "Cableware Electronics" },

3874 { 0x000F2B, "GREENBELL SYSTEMS" },

3875 { 0x000F2C, "Lantronix" },

3876 { 0x000F2D, "CHUNG-HSIN ELECTRIC & MACHINERY MFG.CORP." },

3877 { 0x000F2E, "Megapower International Corp." },

3878 { 0x000F2F, "W-LINX TECHNOLOGY CO., LTD." },

3879 { 0x000F30, "Raza Microelectronics Inc" },

3880 { 0x000F31, "Allied Vision Technologies Canada Inc" },

3881 { 0x000F32, "Lootom Telcovideo Network (Wuxi) Co Ltd" },

3882 { 0x000F33, "DUALi Inc." },

3883 { 0x000F34, "Cisco Systems, Inc" },

3884 { 0x000F35, "Cisco Systems, Inc" },

3885 { 0x000F36, "Accurate Techhnologies, Inc." },

3886 { 0x000F37, "Xambala Incorporated" },

3887 { 0x000F38, "Netstar" },

3888 { 0x000F39, "IRIS SENSORS" },

3889 { 0x000F3A, "HISHARP" },

3890 { 0x000F3B, "Fuji System Machines Co., Ltd." },

3891 { 0x000F3C, "Endeleo Limited" },

3892 { 0x000F3D, "D-Link Corporation" },

3893 { 0x000F3E, "CardioNet, Inc" },

3894 { 0x000F3F, "Big Bear Networks" },

3895 { 0x000F40, "Optical Internetworking Forum" },

3896 { 0x000F41, "Zipher Ltd" },

3897 { 0x000F42, "Xalyo Systems" },

3898 { 0x000F43, "Wasabi Systems Inc." },

3899 { 0x000F44, "Tivella Inc." },

3900 { 0x000F45, "Stretch, Inc." },

3901 { 0x000F46, "SINAR AG" },

3902 { 0x000F47, "ROBOX SPA" },

3903 { 0x000F48, "Polypix Inc." },

3904 { 0x000F49, "Northover Solutions Limited" },

3905 { 0x000F4A, "Kyushu-kyohan co.,ltd" },

3906 { 0x000F4B, "Oracle Corporation" },

3907 { 0x000F4C, "Elextech INC" },

3908 { 0x000F4D, "TalkSwitch" },

3909 { 0x000F4E, "Cellink" },

3910 { 0x000F4F, "PCS Systemtechnik GmbH" },

3911 { 0x000F50, "StreamScale Limited" },

3912 { 0x000F51, "Azul Systems, Inc." },

3913 { 0x000F52, "YORK Refrigeration, Marine & Controls" },

3914 { 0x000F53, "Solarflare Communications Inc." },

3915 { 0x000F54, "Entrelogic Corporation" },

3916 { 0x000F55, "Datawire Communication Networks Inc." },

3917 { 0x000F56, "Continuum Photonics Inc" },

3918 { 0x000F57, "CABLELOGIC Co., Ltd." },

3919 { 0x000F58, "Adder Technology Limited" },

3920 { 0x000F59, "Phonak AG" },

3921 { 0x000F5A, "Peribit Networks" },

3922 { 0x000F5B, "Delta Information Systems, Inc." },

3923 { 0x000F5C, "Day One Digital Media Limited" },

3924 { 0x000F5D, "Genexis BV" },

3925 { 0x000F5E, "Veo" },

3926 { 0x000F5F, "Nicety Technologies Inc. (NTS)" },

3927 { 0x000F60, "Lifetron Co.,Ltd" },

3928 { 0x000F61, "Hewlett Packard" },

3929 { 0x000F62, "Alcatel Bell Space N.V." },

3930 { 0x000F63, "Obzerv Technologies" },

3931 { 0x000F64, "D&R Electronica Weesp BV" },

3932 { 0x000F65, "icube Corp." },

3933 { 0x000F66, "Cisco-Linksys, LLC" },

3934 { 0x000F67, "West Instruments" },

3935 { 0x000F68, "Vavic Network Technology, Inc." },

3936 { 0x000F69, "SEW Eurodrive GmbH & Co. KG" },

3937 { 0x000F6A, "Nortel Networks" },

3938 { 0x000F6B, "GateWare Communications GmbH" },

3939 { 0x000F6C, "ADDI-DATA GmbH" },

3940 { 0x000F6D, "Midas Engineering" },

3941 { 0x000F6E, "BBox" },

3942 { 0x000F6F, "FTA Communication Technologies" },

3943 { 0x000F70, "Wintec Industries, inc." },

3944 { 0x000F71, "Sanmei Electronics Co.,Ltd" },

3945 { 0x000F72, "Sandburst" },

3946 { 0x000F73, "RS Automation Co., Ltd" },

3947 { 0x000F74, "Qamcom Technology AB" },

3948 { 0x000F75, "First Silicon Solutions" },

3949 { 0x000F76, "Digital Keystone, Inc." },

3950 { 0x000F77, "DENTUM CO.,LTD" },

3951 { 0x000F78, "Datacap Systems Inc" },

3952 { 0x000F79, "Bluetooth Interest Group Inc." },

3953 { 0x000F7A, "BeiJing NuQX Technology CO.,LTD" },

3954 { 0x000F7B, "Arce Sistemas, S.A." },

3955 { 0x000F7C, "ACTi Corporation" },

3956 { 0x000F7D, "Xirrus" },

3957 { 0x000F7E, "Ablerex Electronics Co., LTD" },

3958 { 0x000F7F, "UBSTORAGE Co.,Ltd." },

3959 { 0x000F80, "Trinity Security Systems,Inc." },

3960 { 0x000F81, "PAL Pacific Inc." },

3961 { 0x000F82, "Mortara Instrument, Inc." },

3962 { 0x000F83, "Brainium Technologies Inc." },

3963 { 0x000F84, "Astute Networks, Inc." },

3964 { 0x000F85, "ADDO-Japan Corporation" },

3965 { 0x000F86, "BlackBerry RTS" },

3966 { 0x000F87, "Maxcess International" },

3967 { 0x000F88, "AMETEK, Inc." },

3968 { 0x000F89, "Winnertec System Co., Ltd." },

3969 { 0x000F8A, "WideView" },

3970 { 0x000F8B, "Orion MultiSystems Inc" },

3971 { 0x000F8C, "Gigawavetech Pte Ltd" },

3972 { 0x000F8D, "FAST TV-Server AG" },

3973 { 0x000F8E, "DONGYANG TELECOM CO.,LTD." },

3974 { 0x000F8F, "Cisco Systems, Inc" },

3975 { 0x000F90, "Cisco Systems, Inc" },

3976 { 0x000F91, "Aerotelecom Co.,Ltd." },

3977 { 0x000F92, "Microhard Systems Inc." },

3978 { 0x000F93, "Landis+Gyr Ltd." },

3979 { 0x000F94, "Genexis BV" },

3980 { 0x000F95, "ELECOM Co.,LTD Laneed Division" },

3981 { 0x000F96, "Telco Systems, Inc." },

3982 { 0x000F97, "Avanex Corporation" },

3983 { 0x000F98, "Avamax Co. Ltd." },

3984 { 0x000F99, "APAC opto Electronics Inc." },

3985 { 0x000F9A, "Synchrony, Inc." },

3986 { 0x000F9B, "Ross Video Limited" },

3987 { 0x000F9C, "Panduit Corp" },

3988 { 0x000F9D, "DisplayLink (UK) Ltd" },

3989 { 0x000F9E, "Murrelektronik GmbH" },

3990 { 0x000F9F, "ARRIS Group, Inc." },

3991 { 0x000FA0, "Canon Korea Inc." },

3992 { 0x000FA1, "Gigabit Systems Inc." },

3993 { 0x000FA2, "2xWireless" },

3994 { 0x000FA3, "Alpha Networks Inc." },

3995 { 0x000FA4, "Sprecher Automation GmbH" },

3996 { 0x000FA5, "BWA Technology GmbH" },

3997 { 0x000FA6, "S2 Security Corporation" },

3998 { 0x000FA7, "Raptor Networks Technology" },

3999 { 0x000FA8, "Photometrics, Inc." },

4000 { 0x000FA9, "PC Fabrik" },

4001 { 0x000FAA, "Nexus Technologies" },

4002 { 0x000FAB, "Kyushu Electronics Systems Inc." },

4003 { 0x000FAC, "IEEE 802.11" },

4004 { 0x000FAD, "FMN communications GmbH" },

4005 { 0x000FAE, "E2O Communications" },

4006 { 0x000FAF, "Dialog Inc." },

4007 { 0x000FB0, "Compal Electronics INC." },

4008 { 0x000FB1, "Cognio Inc." },

4009 { 0x000FB2, "Broadband Pacenet (India) Pvt. Ltd." },

4010 { 0x000FB3, "Actiontec Electronics, Inc" },

4011 { 0x000FB4, "Timespace Technology" },

4012 { 0x000FB5, "NETGEAR" },

4013 { 0x000FB6, "Europlex Technologies" },

4014 { 0x000FB7, "Cavium" },

4015 { 0x000FB8, "CallURL Inc." },

4016 { 0x000FB9, "Adaptive Instruments" },

4017 { 0x000FBA, "Tevebox AB" },

4018 { 0x000FBB, "Nokia Siemens Networks GmbH & Co. KG." },

4019 { 0x000FBC, "Onkey Technologies, Inc." },

4020 { 0x000FBD, "MRV Communications (Networks) LTD" },

4021 { 0x000FBE, "e-w/you Inc." },

4022 { 0x000FBF, "DGT Sp. z o.o." },

4023 { 0x000FC0, "DELCOMp" },

4024 { 0x000FC1, "WAVE Corporation" },

4025 { 0x000FC2, "Uniwell Corporation" },

4026 { 0x000FC3, "PalmPalm Technology, Inc." },

4027 { 0x000FC4, "NST co.,LTD." },

4028 { 0x000FC5, "KeyMed Ltd" },

4029 { 0x000FC6, "Eurocom Industries A/S" },

4030 { 0x000FC7, "Dionica R&D Ltd." },

4031 { 0x000FC8, "Chantry Networks" },

4032 { 0x000FC9, "Allnet GmbH" },

4033 { 0x000FCA, "A-JIN TECHLINE CO, LTD" },

4034 { 0x000FCB, "3Com Ltd" },

4035 { 0x000FCC, "ARRIS Group, Inc." },

4036 { 0x000FCD, "Nortel Networks" },

4037 { 0x000FCE, "Kikusui Electronics Corp." },

4038 { 0x000FCF, "DataWind Research" },

4039 { 0x000FD0, "ASTRI" },

4040 { 0x000FD1, "Applied Wireless Identifications Group, Inc." },

4041 { 0x000FD2, "EWA Technologies, Inc." },

4042 { 0x000FD3, "Digium" },

4043 { 0x000FD4, "Soundcraft" },

4044 { 0x000FD5, "Schwechat - RISE" },

4045 { 0x000FD6, "Sarotech Co., Ltd" },

4046 { 0x000FD7, "Harman Music Group" },

4047 { 0x000FD8, "Force, Inc." },

4048 { 0x000FD9, "FlexDSL Telecommunications AG" },

4049 { 0x000FDA, "YAZAKI CORPORATION" },

4050 { 0x000FDB, "Westell Technologies Inc." },

4051 { 0x000FDC, "Ueda Japan Radio Co., Ltd." },

4052 { 0x000FDD, "SORDIN AB" },

4053 { 0x000FDE, "Sony Corporation" },

4054 { 0x000FDF, "SOLOMON Technology Corp." },

4055 { 0x000FE0, "NComputing Co.,Ltd." },

4056 { 0x000FE1, "ID DIGITAL CORPORATION" },

4057 { 0x000FE2, "Hangzhou H3C Technologies Co., Limited" },

4058 { 0x000FE3, "Damm Cellular Systems A/S" },

4059 { 0x000FE4, "Pantech Co.,Ltd" },

4060 { 0x000FE5, "MERCURY SECURITY CORPORATION" },

4061 { 0x000FE6, "MBTech Systems, Inc." },

4062 { 0x000FE7, "Lutron Electronics Co., Inc." },

4063 { 0x000FE8, "Lobos, Inc." },

4064 { 0x000FE9, "GW TECHNOLOGIES CO.,LTD." },

4065 { 0x000FEA, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

4066 { 0x000FEB, "Cylon Controls" },

4067 { 0x000FEC, "ARKUS Inc." },

4068 { 0x000FED, "Anam Electronics Co., Ltd" },

4069 { 0x000FEE, "XTec, Incorporated" },

4070 { 0x000FEF, "Thales e-Transactions GmbH" },

4071 { 0x000FF0, "Sunray Co. Ltd." },

4072 { 0x000FF1, "nex-G Systems Pte.Ltd" },

4073 { 0x000FF2, "Loud Technologies Inc." },

4074 { 0x000FF3, "Jung Myoung Communications&Technology" },

4075 { 0x000FF4, "Guntermann & Drunck GmbH" },

4076 { 0x000FF5, "GN&S company" },

4077 { 0x000FF6, "DARFON LIGHTING CORP" },

4078 { 0x000FF7, "Cisco Systems, Inc" },

4079 { 0x000FF8, "Cisco Systems, Inc" },

4080 { 0x000FF9, "Valcretec, Inc." },

4081 { 0x000FFA, "Optinel Systems, Inc." },

4082 { 0x000FFB, "Nippon Denso Industry Co., Ltd." },

4083 { 0x000FFC, "Merit Li-Lin Ent." },

4084 { 0x000FFD, "Glorytek Network Inc." },

4085 { 0x000FFE, "G-PRO COMPUTER" },

4086 { 0x000FFF, "Control4" },

4087 { 0x001000, "CABLE TELEVISION LABORATORIES, INC." },

4088 { 0x001001, "Citel" },

4089 { 0x001002, "ACTIA" },

4090 { 0x001003, "IMATRON, INC." },

4091 { 0x001004, "THE BRANTLEY COILE COMPANY,INC" },

4092 { 0x001005, "UEC COMMERCIAL" },

4093 { 0x001006, "Thales Contact Solutions Ltd." },

4094 { 0x001007, "Cisco Systems, Inc" },

4095 { 0x001008, "VIENNA SYSTEMS CORPORATION" },

4096 { 0x001009, "HORANET" },

4097 { 0x00100A, "WILLIAMS COMMUNICATIONS GROUP" },

4098 { 0x00100B, "Cisco Systems, Inc" },

4099 { 0x00100C, "ITO CO., LTD." },

4100 { 0x00100D, "Cisco Systems, Inc" },

4101 { 0x00100E, "MICRO LINEAR COPORATION" },

4102 { 0x00100F, "INDUSTRIAL CPU SYSTEMS" },

4103 { 0x001010, "INITIO CORPORATION" },

4104 { 0x001011, "Cisco Systems, Inc" },

4105 { 0x001012, "PROCESSOR SYSTEMS (I) PVT LTD" },

4106 { 0x001013, "Kontron America, Inc." },

4107 { 0x001014, "Cisco Systems, Inc" },

4108 { 0x001015, "OOmon Inc." },

4109 { 0x001016, "T.SQWARE" },

4110 { 0x001017, "Bosch Access Systems GmbH" },

4111 { 0x001018, "Broadcom" },

4112 { 0x001019, "SIRONA DENTAL SYSTEMS GmbH & Co. KG" },

4113 { 0x00101A, "PictureTel Corp." },

4114 { 0x00101B, "CORNET TECHNOLOGY, INC." },

4115 { 0x00101C, "OHM TECHNOLOGIES INTL, LLC" },

4116 { 0x00101D, "WINBOND ELECTRONICS CORP." },

4117 { 0x00101E, "MATSUSHITA ELECTRONIC INSTRUMENTS CORP." },

4118 { 0x00101F, "Cisco Systems, Inc" },

4119 { 0x001020, "Hand Held Products Inc" },

4120 { 0x001021, "ENCANTO NETWORKS, INC." },

4121 { 0x001022, "SatCom Media Corporation" },

4122 { 0x001023, "Network Equipment Technologies" },

4123 { 0x001024, "NAGOYA ELECTRIC WORKS CO., LTD" },

4124 { 0x001025, "Grayhill, Inc" },

4125 { 0x001026, "ACCELERATED NETWORKS, INC." },

4126 { 0x001027, "L-3 COMMUNICATIONS EAST" },

4127 { 0x001028, "COMPUTER TECHNICA, INC." },

4128 { 0x001029, "Cisco Systems, Inc" },

4129 { 0x00102A, "ZF MICROSYSTEMS, INC." },

4130 { 0x00102B, "UMAX DATA SYSTEMS, INC." },

4131 { 0x00102C, "Lasat Networks A/S" },

4132 { 0x00102D, "HITACHI SOFTWARE ENGINEERING" },

4133 { 0x00102E, "NETWORK SYSTEMS & TECHNOLOGIES PVT. LTD." },

4134 { 0x00102F, "Cisco Systems, Inc" },

4135 { 0x001030, "EION Inc." },

4136 { 0x001031, "OBJECTIVE COMMUNICATIONS, INC." },

4137 { 0x001032, "ALTA TECHNOLOGY" },

4138 { 0x001033, "ACCESSLAN COMMUNICATIONS, INC." },

4139 { 0x001034, "GNP Computers" },

4140 { 0x001035, "Elitegroup Computer Systems Co.,Ltd." },

4141 { 0x001036, "INTER-TEL INTEGRATED SYSTEMS" },

4142 { 0x001037, "CYQ've Technology Co., Ltd." },

4143 { 0x001038, "Micro Research Ltd." },

4144 { 0x001039, "Vectron Systems AG" },

4145 { 0x00103A, "DIAMOND NETWORK TECH" },

4146 { 0x00103B, "HIPPI NETWORKING FORUM" },

4147 { 0x00103C, "IC ENSEMBLE, INC." },

4148 { 0x00103D, "PHASECOM, LTD." },

4149 { 0x00103E, "NETSCHOOLS CORPORATION" },

4150 { 0x00103F, "TOLLGRADE COMMUNICATIONS, INC." },

4151 { 0x001040, "INTERMEC CORPORATION" },

4152 { 0x001041, "BRISTOL BABCOCK, INC." },

4153 { 0x001042, "Alacritech, Inc." },

4154 { 0x001043, "A2 CORPORATION" },

4155 { 0x001044, "InnoLabs Corporation" },

4156 { 0x001045, "Nortel Networks" },

4157 { 0x001046, "ALCORN MCBRIDE INC." },

4158 { 0x001047, "ECHO ELETRIC CO. LTD." },

4159 { 0x001048, "HTRC AUTOMATION, INC." },

4160 { 0x001049, "ShoreTel, Inc" },

4161 { 0x00104A, "The Parvus Corporation" },

4162 { 0x00104B, "3COM" },

4163 { 0x00104C, "Teledyne LeCroy, Inc" },

4164 { 0x00104D, "SURTEC INDUSTRIES, INC." },

4165 { 0x00104E, "CEOLOGIC" },

4166 { 0x00104F, "Oracle Corporation" },

4167 { 0x001050, "RION CO., LTD." },

4168 { 0x001051, "CMICRO CORPORATION" },

4169 { 0x001052, "METTLER-TOLEDO (ALBSTADT) GMBH" },

4170 { 0x001053, "COMPUTER TECHNOLOGY CORP." },

4171 { 0x001054, "Cisco Systems, Inc" },

4172 { 0x001055, "FUJITSU MICROELECTRONICS, INC." },

4173 { 0x001056, "SODICK CO., LTD." },

4174 { 0x001057, "Rebel.com, Inc." },

4175 { 0x001058, "ArrowPoint Communications" },

4176 { 0x001059, "DIABLO RESEARCH CO. LLC" },

4177 { 0x00105A, "3COM" },

4178 { 0x00105B, "NET INSIGHT AB" },

4179 { 0x00105C, "QUANTUM DESIGNS (H.K.) LTD." },

4180 { 0x00105D, "Draeger Medical" },

4181 { 0x00105E, "Spirent plc, Service Assurance Broadband" },

4182 { 0x00105F, "ZODIAC DATA SYSTEMS" },

4183 { 0x001060, "BILLIONTON SYSTEMS, INC." },

4184 { 0x001061, "HOSTLINK CORP." },

4185 { 0x001062, "NX SERVER, ILNC." },

4186 { 0x001063, "STARGUIDE DIGITAL NETWORKS" },

4187 { 0x001064, "DNPG, LLC" },

4188 { 0x001065, "RADYNE CORPORATION" },

4189 { 0x001066, "ADVANCED CONTROL SYSTEMS, INC." },

4190 { 0x001067, "Ericsson" },

4191 { 0x001068, "COMOS TELECOM" },

4192 { 0x001069, "HELIOSS COMMUNICATIONS, INC." },

4193 { 0x00106A, "DIGITAL MICROWAVE CORPORATION" },

4194 { 0x00106B, "SONUS NETWORKS, INC." },

4195 { 0x00106C, "EDNT GmbH" },

4196 { 0x00106D, "Axxcelera Broadband Wireless" },

4197 { 0x00106E, "TADIRAN COM. LTD." },

4198 { 0x00106F, "TRENTON TECHNOLOGY INC." },

4199 { 0x001070, "CARADON TREND LTD." },

4200 { 0x001071, "ADVANET INC." },

4201 { 0x001072, "GVN TECHNOLOGIES, INC." },

4202 { 0x001073, "TECHNOBOX, INC." },

4203 { 0x001074, "ATEN INTERNATIONAL CO., LTD." },

4204 { 0x001075, "Segate Technology LLC" },

4205 { 0x001076, "EUREM GmbH" },

4206 { 0x001077, "SAF DRIVE SYSTEMS, LTD." },

4207 { 0x001078, "NUERA COMMUNICATIONS, INC." },

4208 { 0x001079, "Cisco Systems, Inc" },

4209 { 0x00107A, "AmbiCom, Inc." },

4210 { 0x00107B, "Cisco Systems, Inc" },

4211 { 0x00107C, "P-COM, INC." },

4212 { 0x00107D, "AURORA COMMUNICATIONS, LTD." },

4213 { 0x00107E, "BACHMANN ELECTRONIC GmbH" },

4214 { 0x00107F, "CRESTRON ELECTRONICS, INC." },

4215 { 0x001080, "METAWAVE COMMUNICATIONS" },

4216 { 0x001081, "DPS, INC." },

4217 { 0x001082, "JNA TELECOMMUNICATIONS LIMITED" },

4218 { 0x001083, "Hewlett Packard" },

4219 { 0x001084, "K-BOT COMMUNICATIONS" },

4220 { 0x001085, "POLARIS COMMUNICATIONS, INC." },

4221 { 0x001086, "ATTO Technology, Inc." },

4222 { 0x001087, "XSTREAMIS PLC" },

4223 { 0x001088, "AMERICAN NETWORKS INC." },

4224 { 0x001089, "WebSonic" },

4225 { 0x00108A, "TeraLogic, Inc." },

4226 { 0x00108B, "LASERANIMATION SOLLINGER GMBH" },

4227 { 0x00108C, "Fujitsu Services Ltd" },

4228 { 0x00108D, "Johnson Controls, Inc." },

4229 { 0x00108E, "HUGH SYMONS CONCEPT Technologies Ltd." },

4230 { 0x00108F, "RAPTOR SYSTEMS" },

4231 { 0x001090, "CIMETRICS, INC." },

4232 { 0x001091, "NO WIRES NEEDED BV" },

4233 { 0x001092, "NETCORE INC." },

4234 { 0x001093, "CMS COMPUTERS, LTD." },

4235 { 0x001094, "Performance Analysis Broadband, Spirent plc" },

4236 { 0x001095, "Thomson Inc." },

4237 { 0x001096, "TRACEWELL SYSTEMS, INC." },

4238 { 0x001097, "WinNet Metropolitan Communications Systems, Inc." },

4239 { 0x001098, "STARNET TECHNOLOGIES, INC." },

4240 { 0x001099, "InnoMedia, Inc." },

4241 { 0x00109A, "NETLINE" },

4242 { 0x00109B, "Emulex Corporation" },

4243 { 0x00109C, "M-SYSTEM CO., LTD." },

4244 { 0x00109D, "CLARINET SYSTEMS, INC." },

4245 { 0x00109E, "AWARE, INC." },

4246 { 0x00109F, "PAVO, INC." },

4247 { 0x0010A0, "INNOVEX TECHNOLOGIES, INC." },

4248 { 0x0010A1, "KENDIN SEMICONDUCTOR, INC." },

4249 { 0x0010A2, "TNS" },

4250 { 0x0010A3, "OMNITRONIX, INC." },

4251 { 0x0010A4, "XIRCOM" },

4252 { 0x0010A5, "OXFORD INSTRUMENTS" },

4253 { 0x0010A6, "Cisco Systems, Inc" },

4254 { 0x0010A7, "UNEX TECHNOLOGY CORPORATION" },

4255 { 0x0010A8, "RELIANCE COMPUTER CORP." },

4256 { 0x0010A9, "ADHOC TECHNOLOGIES" },

4257 { 0x0010AA, "MEDIA4, INC." },

4258 { 0x0010AB, "KOITO ELECTRIC INDUSTRIES, LTD." },

4259 { 0x0010AC, "IMCI TECHNOLOGIES" },

4260 { 0x0010AD, "SOFTRONICS USB, INC." },

4261 { 0x0010AE, "SHINKO ELECTRIC INDUSTRIES CO." },

4262 { 0x0010AF, "TAC SYSTEMS, INC." },

4263 { 0x0010B0, "MERIDIAN TECHNOLOGY CORP." },

4264 { 0x0010B1, "FOR-A CO., LTD." },

4265 { 0x0010B2, "COACTIVE AESTHETICS" },

4266 { 0x0010B3, "NOKIA MULTIMEDIA TERMINALS" },

4267 { 0x0010B4, "ATMOSPHERE NETWORKS" },

4268 { 0x0010B5, "Accton Technology Corp" },

4269 { 0x0010B6, "ENTRATA COMMUNICATIONS CORP." },

4270 { 0x0010B7, "COYOTE TECHNOLOGIES, LLC" },

4271 { 0x0010B8, "ISHIGAKI COMPUTER SYSTEM CO." },

4272 { 0x0010B9, "MAXTOR CORP." },

4273 { 0x0010BA, "MARTINHO-DAVIS SYSTEMS, INC." },

4274 { 0x0010BB, "DATA & INFORMATION TECHNOLOGY" },

4275 { 0x0010BC, "Aastra Telecom" },

4276 { 0x0010BD, "THE TELECOMMUNICATION TECHNOLOGY COMMITTEE (TTC)" },

4277 { 0x0010BE, "MARCH NETWORKS CORPORATION" },

4278 { 0x0010BF, "InterAir Wireless" },

4279 { 0x0010C0, "ARMA, Inc." },

4280 { 0x0010C1, "OI ELECTRIC CO.,LTD" },

4281 { 0x0010C2, "WILLNET, INC." },

4282 { 0x0010C3, "CSI-CONTROL SYSTEMS" },

4283 { 0x0010C4, "MEDIA GLOBAL LINKS CO., LTD." },

4284 { 0x0010C5, "PROTOCOL TECHNOLOGIES, INC." },

4285 { 0x0010C6, "Universal Global Scientific Industrial Co., Ltd." },

4286 { 0x0010C7, "DATA TRANSMISSION NETWORK" },

4287 { 0x0010C8, "COMMUNICATIONS ELECTRONICS SECURITY GROUP" },

4288 { 0x0010C9, "MITSUBISHI ELECTRONICS LOGISTIC SUPPORT CO." },

4289 { 0x0010CA, "Telco Systems, Inc." },

4290 { 0x0010CB, "FACIT K.K." },

4291 { 0x0010CC, "CLP COMPUTER LOGISTIK PLANUNG GmbH" },

4292 { 0x0010CD, "INTERFACE CONCEPT" },

4293 { 0x0010CE, "VOLAMP, LTD." },

4294 { 0x0010CF, "FIBERLANE COMMUNICATIONS" },

4295 { 0x0010D0, "WITCOM, LTD." },

4296 { 0x0010D1, "Top Layer Networks, Inc." },

4297 { 0x0010D2, "NITTO TSUSHINKI CO., LTD" },

4298 { 0x0010D3, "GRIPS ELECTRONIC GMBH" },

4299 { 0x0010D4, "STORAGE COMPUTER CORPORATION" },

4300 { 0x0010D5, "IMASDE CANARIAS, S.A." },

4301 { 0x0010D6, "Exelis" },

4302 { 0x0010D7, "ARGOSY RESEARCH INC." },

4303 { 0x0010D8, "CALISTA" },

4304 { 0x0010D9, "IBM JAPAN, FUJISAWA MT+D" },

4305 { 0x0010DA, "Kollmorgen Corp" },

4306 { 0x0010DB, "Juniper Networks" },

4307 { 0x0010DC, "MICRO-STAR INTERNATIONAL CO., LTD." },

4308 { 0x0010DD, "ENABLE SEMICONDUCTOR, INC." },

4309 { 0x0010DE, "INTERNATIONAL DATACASTING CORPORATION" },

4310 { 0x0010DF, "RISE COMPUTER INC." },

4311 { 0x0010E0, "Oracle Corporation" },

4312 { 0x0010E1, "S.I. TECH, INC." },

4313 { 0x0010E2, "ArrayComm, Inc." },

4314 { 0x0010E3, "Hewlett Packard" },

4315 { 0x0010E4, "NSI CORPORATION" },

4316 { 0x0010E5, "SOLECTRON TEXAS" },

4317 { 0x0010E6, "APPLIED INTELLIGENT SYSTEMS, INC." },

4318 { 0x0010E7, "Breezecom, Ltd." },

4319 { 0x0010E8, "TELOCITY, INCORPORATED" },

4320 { 0x0010E9, "RAIDTEC LTD." },

4321 { 0x0010EA, "ADEPT TECHNOLOGY" },

4322 { 0x0010EB, "SELSIUS SYSTEMS, INC." },

4323 { 0x0010EC, "Embedded Planet" },

4324 { 0x0010ED, "SUNDANCE TECHNOLOGY, INC." },

4325 { 0x0010EE, "CTI PRODUCTS, INC." },

4326 { 0x0010EF, "DBTEL INCORPORATED" },

4327 { 0x0010F0, "RITTAL-WERK RUDOLF LOH GmbH & Co." },

4328 { 0x0010F1, "I-O CORPORATION" },

4329 { 0x0010F2, "ANTEC" },

4330 { 0x0010F3, "Nexcom International Co., Ltd." },

4331 { 0x0010F4, "Vertical Communications" },

4332 { 0x0010F5, "AMHERST SYSTEMS, INC." },

4333 { 0x0010F6, "Cisco Systems, Inc" },

4334 { 0x0010F7, "IRIICHI TECHNOLOGIES Inc." },

4335 { 0x0010F8, "TEXIO TECHNOLOGY CORPORATION" },

4336 { 0x0010F9, "UNIQUE SYSTEMS, INC." },

4337 { 0x0010FA, "Apple, Inc." },

4338 { 0x0010FB, "ZIDA TECHNOLOGIES LIMITED" },

4339 { 0x0010FC, "BROADBAND NETWORKS, INC." },

4340 { 0x0010FD, "COCOM A/S" },

4341 { 0x0010FE, "DIGITAL EQUIPMENT CORPORATION" },

4342 { 0x0010FF, "Cisco Systems, Inc" },

4343 { 0x001100, "Schneider Electric" },

4344 { 0x001101, "CET Technologies Pte Ltd" },

4345 { 0x001102, "Aurora Multimedia Corp." },

4346 { 0x001103, "kawamura electric inc." },

4347 { 0x001104, "TELEXY" },

4348 { 0x001105, "Sunplus Technology Co., Ltd." },

4349 { 0x001106, "Siemens NV (Belgium)" },

4350 { 0x001107, "RGB Networks Inc." },

4351 { 0x001108, "Orbital Data Corporation" },

4352 { 0x001109, "Micro-Star International" },

4353 { 0x00110A, "Hewlett Packard" },

4354 { 0x00110B, "Franklin Technology Systems" },

4355 { 0x00110C, "Atmark Techno, Inc." },

4356 { 0x00110D, "SANBlaze Technology, Inc." },

4357 { 0x00110E, "Tsurusaki Sealand Transportation Co. Ltd." },

4358 { 0x00110F, "netplat,Inc." },

4359 { 0x001110, "Maxanna Technology Co., Ltd." },

4360 { 0x001111, "Intel Corporation" },

4361 { 0x001112, "Honeywell CMSS" },

4362 { 0x001113, "Fraunhofer FOKUS" },

4363 { 0x001114, "EverFocus Electronics Corp." },

4364 { 0x001115, "EPIN Technologies, Inc." },

4365 { 0x001116, "COTEAU VERT CO., LTD." },

4366 { 0x001117, "CESNET" },

4367 { 0x001118, "BLX IC Design Corp., Ltd." },

4368 { 0x001119, "Solteras, Inc." },

4369 { 0x00111A, "ARRIS Group, Inc." },

4370 { 0x00111B, "Targa Systems Div L-3 Communications" },

4371 { 0x00111C, "Pleora Technologies Inc." },

4372 { 0x00111D, "Hectrix Limited" },

4373 { 0x00111E, "ETHERNET Powerlink Standarization Group (EPSG)" },

4374 { 0x00111F, "Doremi Labs, Inc." },

4375 { 0x001120, "Cisco Systems, Inc" },

4376 { 0x001121, "Cisco Systems, Inc" },

4377 { 0x001122, "CIMSYS Inc" },

4378 { 0x001123, "Appointech, Inc." },

4379 { 0x001124, "Apple, Inc." },

4380 { 0x001125, "IBM Corp" },

4381 { 0x001126, "Venstar Inc." },

4382 { 0x001127, "TASI, Inc" },

4383 { 0x001128, "Streamit" },

4384 { 0x001129, "Paradise Datacom Ltd." },

4385 { 0x00112A, "Niko NV" },

4386 { 0x00112B, "NetModule AG" },

4387 { 0x00112C, "IZT GmbH" },

4388 { 0x00112D, "iPulse Systems" },

4389 { 0x00112E, "CEICOM" },

4390 { 0x00112F, "ASUSTek COMPUTER INC." },

4391 { 0x001130, "Allied Telesis (Hong Kong) Ltd." },

4392 { 0x001131, "UNATECH. CO.,LTD" },

4393 { 0x001132, "Synology Incorporated" },

4394 { 0x001133, "Siemens AG Austria" },

4395 { 0x001134, "MediaCell, Inc." },

4396 { 0x001135, "Grandeye Ltd" },

4397 { 0x001136, "Goodrich Sensor Systems" },

4398 { 0x001137, "AICHI ELECTRIC CO., LTD." },

4399 { 0x001138, "TAISHIN CO., LTD." },

4400 { 0x001139, "STOEBER ANTRIEBSTECHNIK GmbH + Co. KG." },

4401 { 0x00113A, "SHINBORAM" },

4402 { 0x00113B, "Micronet Communications Inc." },

4403 { 0x00113C, "Micronas GmbH" },

4404 { 0x00113D, "KN SOLTEC CO.,LTD." },

4405 { 0x00113E, "JL Corporation" },

4406 { 0x00113F, "Alcatel DI" },

4407 { 0x001140, "Nanometrics Inc." },

4408 { 0x001141, "GoodMan Corporation" },

4409 { 0x001142, "e-SMARTCOM INC." },

4410 { 0x001143, "Dell Inc." },

4411 { 0x001144, "Assurance Technology Corp" },

4412 { 0x001145, "ValuePoint Networks" },

4413 { 0x001146, "Telecard-Pribor Ltd" },

4414 { 0x001147, "Secom-Industry co.LTD." },

4415 { 0x001148, "Prolon Control Systems" },

4416 { 0x001149, "Proliphix Inc." },

4417 { 0x00114A, "KAYABA INDUSTRY Co,.Ltd." },

4418 { 0x00114B, "Francotyp-Postalia GmbH" },

4419 { 0x00114C, "caffeina applied research ltd." },

4420 { 0x00114D, "Atsumi Electric Co.,LTD." },

4421 { 0x00114E, "690885 Ontario Inc." },

4422 { 0x00114F, "US Digital Television, Inc" },

4423 { 0x001150, "Belkin Corporation" },

4424 { 0x001151, "Mykotronx" },

4425 { 0x001152, "Eidsvoll Electronics AS" },

4426 { 0x001153, "Trident Tek, Inc." },

4427 { 0x001154, "Webpro Technologies Inc." },

4428 { 0x001155, "Sevis Systems" },

4429 { 0x001156, "Pharos Systems NZ" },

4430 { 0x001157, "Oki Electric Industry Co., Ltd." },

4431 { 0x001158, "Nortel Networks" },

4432 { 0x001159, "MATISSE NETWORKS INC" },

4433 { 0x00115A, "Ivoclar Vivadent AG" },

4434 { 0x00115B, "Elitegroup Computer Systems Co.,Ltd." },

4435 { 0x00115C, "Cisco Systems, Inc" },

4436 { 0x00115D, "Cisco Systems, Inc" },

4437 { 0x00115E, "ProMinent Dosiertechnik GmbH" },

4438 { 0x00115F, "ITX Security Co., Ltd." },

4439 { 0x001160, "ARTDIO Company Co., LTD" },

4440 { 0x001161, "NetStreams, LLC" },

4441 { 0x001162, "STAR MICRONICS CO.,LTD." },

4442 { 0x001163, "SYSTEM SPA DEPT. ELECTRONICS" },

4443 { 0x001164, "ACARD Technology Corp." },

4444 { 0x001165, "ZNYX Networks, Inc." },

4445 { 0x001166, "Taelim Electronics Co., Ltd." },

4446 { 0x001167, "Integrated System Solution Corp." },

4447 { 0x001168, "HomeLogic LLC" },

4448 { 0x001169, "EMS Satcom" },

4449 { 0x00116A, "Domo Ltd" },

4450 { 0x00116B, "Digital Data Communications Asia Co.,Ltd" },

4451 { 0x00116C, "Nanwang Multimedia Inc.,Ltd" },

4452 { 0x00116D, "American Time and Signal" },

4453 { 0x00116E, "Peplink International Ltd." },

4454 { 0x00116F, "Netforyou Co., LTD." },

4455 { 0x001170, "GSC SRL" },

4456 { 0x001171, "DEXTER Communications, Inc." },

4457 { 0x001172, "COTRON CORPORATION" },

4458 { 0x001173, "SMART Storage Systems" },

4459 { 0x001174, "Mojo Networks, Inc." },

4460 { 0x001175, "Intel Corporation" },

4461 { 0x001176, "Intellambda Systems, Inc." },

4462 { 0x001177, "Coaxial Networks, Inc." },

4463 { 0x001178, "Chiron Technology Ltd" },

4464 { 0x001179, "Singular Technology Co. Ltd." },

4465 { 0x00117A, "Singim International Corp." },

4466 { 0x00117B, "Büchi Labortechnik AG" },

4467 { 0x00117C, "e-zy.net" },

4468 { 0x00117D, "ZMD America, Inc." },

4469 { 0x00117E, "Midmark Corp" },

4470 { 0x00117F, "Neotune Information Technology Corporation,.LTD" },

4471 { 0x001180, "ARRIS Group, Inc." },

4472 { 0x001181, "InterEnergy Co.Ltd," },

4473 { 0x001182, "IMI Norgren Ltd" },

4474 { 0x001183, "Datalogic ADC, Inc." },

4475 { 0x001184, "Humo Laboratory,Ltd." },

4476 { 0x001185, "Hewlett Packard" },

4477 { 0x001186, "Prime Systems, Inc." },

4478 { 0x001187, "Category Solutions, Inc" },

4479 { 0x001188, "Enterasys" },

4480 { 0x001189, "Aerotech Inc" },

4481 { 0x00118A, "Viewtran Technology Limited" },

4482 { 0x00118B, "Alcatel-Lucent Enterprise" },

4483 { 0x00118C, "Missouri Department of Transportation" },

4484 { 0x00118D, "Hanchang System Corp." },

4485 { 0x00118E, "Halytech Mace" },

4486 { 0x00118F, "EUTECH INSTRUMENTS PTE. LTD." },

4487 { 0x001190, "Digital Design Corporation" },

4488 { 0x001191, "CTS-Clima Temperatur Systeme GmbH" },

4489 { 0x001192, "Cisco Systems, Inc" },

4490 { 0x001193, "Cisco Systems, Inc" },

4491 { 0x001194, "Chi Mei Communication Systems, Inc." },

4492 { 0x001195, "D-Link Corporation" },

4493 { 0x001196, "Actuality Systems, Inc." },

4494 { 0x001197, "Monitoring Technologies Limited" },

4495 { 0x001198, "Prism Media Products Limited" },

4496 { 0x001199, "2wcom Systems GmbH" },

4497 { 0x00119A, "Alkeria srl" },

4498 { 0x00119B, "Telesynergy Research Inc." },

4499 { 0x00119C, "EP&T Energy" },

4500 { 0x00119D, "Diginfo Technology Corporation" },

4501 { 0x00119E, "Solectron Brazil" },

4502 { 0x00119F, "Nokia Danmark A/S" },

4503 { 0x0011A0, "Vtech Engineering Canada Ltd" },

4504 { 0x0011A1, "VISION NETWARE CO.,LTD" },

4505 { 0x0011A2, "Manufacturing Technology Inc" },

4506 { 0x0011A3, "LanReady Technologies Inc." },

4507 { 0x0011A4, "JStream Technologies Inc." },

4508 { 0x0011A5, "Fortuna Electronic Corp." },

4509 { 0x0011A6, "Sypixx Networks" },

4510 { 0x0011A7, "Infilco Degremont Inc." },

4511 { 0x0011A8, "Quest Technologies" },

4512 { 0x0011A9, "Nurivoice Co., Ltd" },

4513 { 0x0011AA, "Uniclass Technology, Co., LTD" },

4514 { 0x0011AB, "TRUSTABLE TECHNOLOGY CO.,LTD." },

4515 { 0x0011AC, "Simtec Electronics" },

4516 { 0x0011AD, "Shanghai Ruijie Technology" },

4517 { 0x0011AE, "ARRIS Group, Inc." },

4518 { 0x0011AF, "Medialink-i,Inc" },

4519 { 0x0011B0, "Fortelink Inc." },

4520 { 0x0011B1, "BlueExpert Technology Corp." },

4521 { 0x0011B2, "2001 Technology Inc." },

4522 { 0x0011B3, "YOSHIMIYA CO.,LTD." },

4523 { 0x0011B4, "Westermo Network Technologies AB" },

4524 { 0x0011B5, "Shenzhen Powercom Co.,Ltd" },

4525 { 0x0011B6, "Open Systems International" },

4526 { 0x0011B7, "Octalix B.V." },

4527 { 0x0011B8, "Liebherr - Elektronik GmbH" },

4528 { 0x0011B9, "Inner Range Pty. Ltd." },

4529 { 0x0011BA, "Elexol Pty Ltd" },

4530 { 0x0011BB, "Cisco Systems, Inc" },

4531 { 0x0011BC, "Cisco Systems, Inc" },

4532 { 0x0011BD, "Bombardier Transportation" },

4533 { 0x0011BE, "AGP Telecom Co. Ltd" },

4534 { 0x0011BF, "AESYS S.p.A." },

4535 { 0x0011C0, "Aday Technology Inc" },

4536 { 0x0011C1, "4P MOBILE DATA PROCESSING" },

4537 { 0x0011C2, "United Fiber Optic Communication" },

4538 { 0x0011C3, "Transceiving System Technology Corporation" },

4539 { 0x0011C4, "Terminales de Telecomunicacion Terrestre, S.L." },

4540 { 0x0011C5, "TEN Technology" },

4541 { 0x0011C6, "Seagate Technology" },

4542 { 0x0011C7, "Raymarine UK Ltd" },

4543 { 0x0011C8, "Powercom Co., Ltd." },

4544 { 0x0011C9, "MTT Corporation" },

4545 { 0x0011CA, "Long Range Systems, Inc." },

4546 { 0x0011CB, "Jacobsons AB" },

4547 { 0x0011CC, "Guangzhou Jinpeng Group Co.,Ltd." },

4548 { 0x0011CD, "Axsun Technologies" },

4549 { 0x0011CE, "Ubisense Limited" },

4550 { 0x0011CF, "Thrane & Thrane A/S" },

4551 { 0x0011D0, "Tandberg Data ASA" },

4552 { 0x0011D1, "Soft Imaging System GmbH" },

4553 { 0x0011D2, "Perception Digital Ltd" },

4554 { 0x0011D3, "NextGenTel Holding ASA" },

4555 { 0x0011D4, "NetEnrich, Inc" },

4556 { 0x0011D5, "Hangzhou Sunyard System Engineering Co.,Ltd." },

4557 { 0x0011D6, "HandEra, Inc." },

4558 { 0x0011D7, "eWerks Inc" },

4559 { 0x0011D8, "ASUSTek COMPUTER INC." },

4560 { 0x0011D9, "TiVo" },

4561 { 0x0011DA, "Vivaas Technology Inc." },

4562 { 0x0011DB, "Land-Cellular Corporation" },

4563 { 0x0011DC, "Glunz & Jensen" },

4564 { 0x0011DD, "FROMUS TEC. Co., Ltd." },

4565 { 0x0011DE, "EURILOGIC" },

4566 { 0x0011DF, "Current Energy" },

4567 { 0x0011E0, "U-MEDIA Communications, Inc." },

4568 { 0x0011E1, "Arcelik A.S" },

4569 { 0x0011E2, "Hua Jung Components Co., Ltd." },

4570 { 0x0011E3, "Thomson, Inc." },

4571 { 0x0011E4, "Danelec Electronics A/S" },

4572 { 0x0011E5, "KCodes Corporation" },

4573 { 0x0011E6, "Scientific Atlanta" },

4574 { 0x0011E7, "WORLDSAT - Texas de France" },

4575 { 0x0011E8, "Tixi.Com" },

4576 { 0x0011E9, "STARNEX CO., LTD." },

4577 { 0x0011EA, "IWICS Inc." },

4578 { 0x0011EB, "Innovative Integration" },

4579 { 0x0011EC, "AVIX INC." },

4580 { 0x0011ED, "802 Global" },

4581 { 0x0011EE, "Estari, Inc." },

4582 { 0x0011EF, "Conitec Datensysteme GmbH" },

4583 { 0x0011F0, "Wideful Limited" },

4584 { 0x0011F1, "QinetiQ Ltd" },

4585 { 0x0011F2, "Institute of Network Technologies" },

4586 { 0x0011F3, "NeoMedia Europe AG" },

4587 { 0x0011F4, "woori-net" },

4588 { 0x0011F5, "ASKEY COMPUTER CORP" },

4589 { 0x0011F6, "Asia Pacific Microsystems , Inc." },

4590 { 0x0011F7, "Shenzhen Forward Industry Co., Ltd" },

4591 { 0x0011F8, "AIRAYA Corp" },

4592 { 0x0011F9, "Nortel Networks" },

4593 { 0x0011FA, "Rane Corporation" },

4594 { 0x0011FB, "Heidelberg Engineering GmbH" },

4595 { 0x0011FC, "HARTING Electronics GmbH" },

4596 { 0x0011FD, "KORG INC." },

4597 { 0x0011FE, "Keiyo System Research, Inc." },

4598 { 0x0011FF, "Digitro Tecnologia Ltda" },

4599 { 0x001200, "Cisco Systems, Inc" },

4600 { 0x001201, "Cisco Systems, Inc" },

4601 { 0x001202, "Decrane Aerospace - Audio International Inc." },

4602 { 0x001203, "ActivNetworks" },

4603 { 0x001204, "u10 Networks, Inc." },

4604 { 0x001205, "Terrasat Communications, Inc." },

4605 { 0x001206, "iQuest (NZ) Ltd" },

4606 { 0x001207, "Head Strong International Limited" },

4607 { 0x001208, "Gantner Instruments GmbH" },

4608 { 0x001209, "Fastrax Ltd" },

4609 { 0x00120A, "Emerson Climate Technologies GmbH" },

4610 { 0x00120B, "Chinasys Technologies Limited" },

4611 { 0x00120C, "CE-Infosys Pte Ltd" },

4612 { 0x00120D, "Advanced Telecommunication Technologies, Inc." },

4613 { 0x00120E, "AboCom" },

4614 { 0x00120F, "IEEE 802.3" },

4615 { 0x001210, "WideRay Corp" },

4616 { 0x001211, "Protechna Herbst GmbH & Co. KG" },

4617 { 0x001212, "PLUS Corporation" },

4618 { 0x001213, "Metrohm AG" },

4619 { 0x001214, "Koenig & Bauer AG" },

4620 { 0x001215, "iStor Networks, Inc." },

4621 { 0x001216, "ICP Internet Communication Payment AG" },

4622 { 0x001217, "Cisco-Linksys, LLC" },

4623 { 0x001218, "ARUZE Corporation" },

4624 { 0x001219, "General Datacomm LLC" },

4625 { 0x00121A, "Techno Soft Systemnics Inc." },

4626 { 0x00121B, "Sound Devices, LLC" },

4627 { 0x00121C, "PARROT SA" },

4628 { 0x00121D, "Netfabric Corporation" },

4629 { 0x00121E, "Juniper Networks" },

4630 { 0x00121F, "Harding Instruments" },

4631 { 0x001220, "Cadco Systems" },

4632 { 0x001221, "B.Braun Melsungen AG" },

4633 { 0x001222, "Skardin (UK) Ltd" },

4634 { 0x001223, "Pixim" },

4635 { 0x001224, "NexQL Corporation" },

4636 { 0x001225, "ARRIS Group, Inc." },

4637 { 0x001226, "Japan Direx Corporation" },

4638 { 0x001227, "Franklin Electric Co., Inc." },

4639 { 0x001228, "Data Ltd." },

4640 { 0x001229, "BroadEasy Technologies Co.,Ltd" },

4641 { 0x00122A, "VTech Telecommunications Ltd." },

4642 { 0x00122B, "Virbiage Pty Ltd" },

4643 { 0x00122C, "Soenen Controls N.V." },

4644 { 0x00122D, "SiNett Corporation" },

4645 { 0x00122E, "Signal Technology - AISD" },

4646 { 0x00122F, "Sanei Electric Inc." },

4647 { 0x001230, "Picaso Infocommunication CO., LTD." },

4648 { 0x001231, "Motion Control Systems, Inc." },

4649 { 0x001232, "LeWiz Communications Inc." },

4650 { 0x001233, "JRC TOKKI Co.,Ltd." },

4651 { 0x001234, "Camille Bauer" },

4652 { 0x001235, "Andrew Corporation" },

4653 { 0x001236, "ConSentry Networks" },

4654 { 0x001237, "Texas Instruments" },

4655 { 0x001238, "SetaBox Technology Co., Ltd." },

4656 { 0x001239, "S Net Systems Inc." },

4657 { 0x00123A, "Posystech Inc., Co." },

4658 { 0x00123B, "KeRo Systems ApS" },

4659 { 0x00123C, "Second Rule LLC" },

4660 { 0x00123D, "GES Co, Ltd" },

4661 { 0x00123E, "ERUNE technology Co., Ltd." },

4662 { 0x00123F, "Dell Inc." },

4663 { 0x001240, "AMOI ELECTRONICS CO.,LTD" },

4664 { 0x001241, "a2i marketing center" },

4665 { 0x001242, "Millennial Net" },

4666 { 0x001243, "Cisco Systems, Inc" },

4667 { 0x001244, "Cisco Systems, Inc" },

4668 { 0x001245, "Zellweger Analytics, Inc." },

4669 { 0x001246, "T.O.M TECHNOLOGY INC.." },

4670 { 0x001247, "Samsung Electronics Co.,Ltd" },

4671 { 0x001248, "Dell EMC" },

4672 { 0x001249, "Delta Elettronica S.p.A." },

4673 { 0x00124A, "Dedicated Devices, Inc." },

4674 { 0x00124B, "Texas Instruments" },

4675 { 0x00124C, "BBWM Corporation" },

4676 { 0x00124D, "Inducon BV" },

4677 { 0x00124E, "XAC AUTOMATION CORP." },

4678 { 0x00124F, "nVent" },

4679 { 0x001250, "Tokyo Aircaft Instrument Co., Ltd." },

4680 { 0x001251, "SILINK" },

4681 { 0x001252, "Citronix, LLC" },

4682 { 0x001253, "AudioDev AB" },

4683 { 0x001254, "Spectra Technologies Holdings Company Ltd" },

4684 { 0x001255, "NetEffect Incorporated" },

4685 { 0x001256, "LG INFORMATION & COMM." },

4686 { 0x001257, "LeapComm Communication Technologies Inc." },

4687 { 0x001258, "TechVoIP Sp z o.o." },

4688 { 0x001259, "THERMO ELECTRON KARLSRUHE" },

4689 { 0x00125A, "Microsoft Corporation" },

4690 { 0x00125B, "KAIMEI ELECTRONI" },

4691 { 0x00125C, "Green Hills Software, Inc." },

4692 { 0x00125D, "CyberNet Inc." },

4693 { 0x00125E, "CAEN" },

4694 { 0x00125F, "AWIND Inc." },

4695 { 0x001260, "Stanton Magnetics,inc." },

4696 { 0x001261, "Adaptix, Inc" },

4697 { 0x001262, "Nokia Danmark A/S" },

4698 { 0x001263, "Data Voice Technologies GmbH" },

4699 { 0x001264, "daum electronic gmbh" },

4700 { 0x001265, "Enerdyne Technologies, Inc." },

4701 { 0x001266, "Swisscom Hospitality Services SA" },

4702 { 0x001267, "Panasonic Corporation" },

4703 { 0x001268, "IPS d.o.o." },

4704 { 0x001269, "Value Electronics" },

4705 { 0x00126A, "OPTOELECTRONICS Co., Ltd." },

4706 { 0x00126B, "Ascalade Communications Limited" },

4707 { 0x00126C, "Visonic Technologies 1993 Ltd." },

4708 { 0x00126D, "University of California, Berkeley" },

4709 { 0x00126E, "Seidel Elektronik GmbH Nfg.KG" },

4710 { 0x00126F, "Rayson Technology Co., Ltd." },

4711 { 0x001270, "NGES Denro Systems" },

4712 { 0x001271, "Measurement Computing Corp" },

4713 { 0x001272, "Redux Communications Ltd." },

4714 { 0x001273, "Stoke Inc" },

4715 { 0x001274, "NIT lab" },

4716 { 0x001275, "Sentilla Corporation" },

4717 { 0x001276, "CG Power Systems Ireland Limited" },

4718 { 0x001277, "Beijer Electronics Corp." },

4719 { 0x001278, "International Bar Code" },

4720 { 0x001279, "Hewlett Packard" },

4721 { 0x00127A, "Sanyu Industry Co.,Ltd." },

4722 { 0x00127B, "VIA Networking Technologies, Inc." },

4723 { 0x00127C, "SWEGON AB" },

4724 { 0x00127D, "MobileAria" },

4725 { 0x00127E, "Digital Lifestyles Group, Inc." },

4726 { 0x00127F, "Cisco Systems, Inc" },

4727 { 0x001280, "Cisco Systems, Inc" },

4728 { 0x001281, "March Networks S.p.A." },

4729 { 0x001282, "Qovia" },

4730 { 0x001283, "Nortel Networks" },

4731 { 0x001284, "Lab33 Srl" },

4732 { 0x001285, "Gizmondo Europe Ltd" },

4733 { 0x001286, "ENDEVCO CORP" },

4734 { 0x001287, "Digital Everywhere Unterhaltungselektronik GmbH" },

4735 { 0x001288, "2Wire Inc" },

4736 { 0x001289, "Advance Sterilization Products" },

4737 { 0x00128A, "ARRIS Group, Inc." },

4738 { 0x00128B, "Sensory Networks Inc" },

4739 { 0x00128C, "Woodward Governor" },

4740 { 0x00128D, "STB Datenservice GmbH" },

4741 { 0x00128E, "Q-Free ASA" },

4742 { 0x00128F, "Montilio" },

4743 { 0x001290, "KYOWA Electric & Machinery Corp." },

4744 { 0x001291, "KWS Computersysteme GmbH" },

4745 { 0x001292, "Griffin Technology" },

4746 { 0x001293, "ABB Switzerland Ltd." },

4747 { 0x001294, "SUMITOMO ELECTRIC DEVICE INNOVATIONS, INC" },

4748 { 0x001295, "Aiware Inc." },

4749 { 0x001296, "Addlogix" },

4750 { 0x001297, "O2Micro, Inc." },

4751 { 0x001298, "MICO ELECTRIC(SHENZHEN) LIMITED" },

4752 { 0x001299, "Ktech Telecommunications Inc" },

4753 { 0x00129A, "IRT Electronics Pty Ltd" },

4754 { 0x00129B, "E2S Electronic Engineering Solutions, S.L." },

4755 { 0x00129C, "Yulinet" },

4756 { 0x00129D, "First International Computer do Brasil" },

4757 { 0x00129E, "Surf Communications Inc." },

4758 { 0x00129F, "RAE Systems" },

4759 { 0x0012A0, "NeoMeridian Sdn Bhd" },

4760 { 0x0012A1, "BluePacket Communications Co., Ltd." },

4761 { 0x0012A2, "VITA" },

4762 { 0x0012A3, "Trust International B.V." },

4763 { 0x0012A4, "ThingMagic, LLC" },

4764 { 0x0012A5, "Dolphin Interconnect Solutions AS" },

4765 { 0x0012A6, "Dolby Australia" },

4766 { 0x0012A7, "ISR TECHNOLOGIES Inc" },

4767 { 0x0012A8, "intec GmbH" },

4768 { 0x0012A9, "3Com Ltd" },

4769 { 0x0012AA, "IEE, Inc." },

4770 { 0x0012AB, "WiLife, Inc." },

4771 { 0x0012AC, "ONTIMETEK INC." },

4772 { 0x0012AD, "VIVAVIS AG" },

4773 { 0x0012AE, "HLS HARD-LINE Solutions Inc." },

4774 { 0x0012AF, "ELPRO Technologies" },

4775 { 0x0012B0, "Efore Oyj (Plc)" },

4776 { 0x0012B1, "Dai Nippon Printing Co., Ltd" },

4777 { 0x0012B2, "AVOLITES LTD." },

4778 { 0x0012B3, "Advance Wireless Technology Corp." },

4779 { 0x0012B4, "Work Microwave GmbH" },

4780 { 0x0012B5, "Vialta, Inc." },

4781 { 0x0012B6, "Santa Barbara Infrared, Inc." },

4782 { 0x0012B7, "PTW Freiburg" },

4783 { 0x0012B8, "G2 Microsystems" },

4784 { 0x0012B9, "Fusion Digital Technology" },

4785 { 0x0012BA, "FSI Systems, Inc." },

4786 { 0x0012BB, "Telecommunications Industry Association TR-41 Committee" },

4787 { 0x0012BC, "Echolab LLC" },

4788 { 0x0012BD, "Avantec Manufacturing Limited" },

4789 { 0x0012BE, "Astek Corporation" },

4790 { 0x0012BF, "Arcadyan Technology Corporation" },

4791 { 0x0012C0, "HotLava Systems, Inc." },

4792 { 0x0012C1, "Check Point Software Technologies" },

4793 { 0x0012C2, "Apex Electronics Factory" },

4794 { 0x0012C3, "WIT S.A." },

4795 { 0x0012C4, "Viseon, Inc." },

4796 { 0x0012C5, "V-Show Technology (China) Co.,Ltd" },

4797 { 0x0012C6, "TGC America, Inc" },

4798 { 0x0012C7, "SECURAY Technologies Ltd.Co." },

4799 { 0x0012C8, "Perfect tech" },

4800 { 0x0012C9, "ARRIS Group, Inc." },

4801 { 0x0012CA, "Mechatronic Brick Aps" },

4802 { 0x0012CB, "CSS Inc." },

4803 { 0x0012CC, "Bitatek CO., LTD" },

4804 { 0x0012CD, "ASEM SpA" },

4805 { 0x0012CE, "Advanced Cybernetics Group" },

4806 { 0x0012CF, "Accton Technology Corp" },

4807 { 0x0012D0, "Gossen-Metrawatt-GmbH" },

4808 { 0x0012D1, "Texas Instruments" },

4809 { 0x0012D2, "Texas Instruments" },

4810 { 0x0012D3, "Zetta Systems, Inc." },

4811 { 0x0012D4, "Princeton Technology, Ltd" },

4812 { 0x0012D5, "Motion Reality Inc." },

4813 { 0x0012D6, "Jiangsu Yitong High-Tech Co.,Ltd" },

4814 { 0x0012D7, "Invento Networks, Inc." },

4815 { 0x0012D8, "International Games System Co., Ltd." },

4816 { 0x0012D9, "Cisco Systems, Inc" },

4817 { 0x0012DA, "Cisco Systems, Inc" },

4818 { 0x0012DB, "ZIEHL industrie-elektronik GmbH + Co KG" },

4819 { 0x0012DC, "SunCorp Industrial Limited" },

4820 { 0x0012DD, "Shengqu Information Technology (Shanghai) Co., Ltd." },

4821 { 0x0012DE, "Radio Components Sweden AB" },

4822 { 0x0012DF, "Novomatic AG" },

4823 { 0x0012E0, "Codan Limited" },

4824 { 0x0012E1, "Alliant Networks, Inc" },

4825 { 0x0012E2, "ALAXALA Networks Corporation" },

4826 { 0x0012E3, "Agat Soft LLC" },

4827 { 0x0012E4, "ZIEHL industrie-electronik GmbH + Co KG" },

4828 { 0x0012E5, "Time America, Inc." },

4829 { 0x0012E6, "SPECTEC COMPUTER CO., LTD." },

4830 { 0x0012E7, "Projectek Networking Electronics Corp." },

4831 { 0x0012E8, "Fraunhofer IMS" },

4832 { 0x0012E9, "Abbey Systems Ltd" },

4833 { 0x0012EA, "Trane" },

4834 { 0x0012EB, "PDH Solutions, LLC" },

4835 { 0x0012EC, "Movacolor b.v." },

4836 { 0x0012ED, "AVG Advanced Technologies" },

4837 { 0x0012EE, "Sony Corporation" },

4838 { 0x0012EF, "OneAccess SA" },

4839 { 0x0012F0, "Intel Corporate" },

4840 { 0x0012F1, "IFOTEC" },

4841 { 0x0012F2, "Brocade Communications Systems LLC" },

4842 { 0x0012F3, "u-blox AG" },

4843 { 0x0012F4, "Belco International Co.,Ltd." },

4844 { 0x0012F5, "Imarda New Zealand Limited" },

4845 { 0x0012F6, "MDK CO.,LTD." },

4846 { 0x0012F7, "Xiamen Xinglian Electronics Co., Ltd." },

4847 { 0x0012F8, "WNI Resources, LLC" },

4848 { 0x0012F9, "URYU SEISAKU, LTD." },

4849 { 0x0012FA, "THX LTD" },

4850 { 0x0012FB, "Samsung Electronics Co.,Ltd" },

4851 { 0x0012FC, "PLANET System Co.,LTD" },

4852 { 0x0012FD, "OPTIMUS IC S.A." },

4853 { 0x0012FE, "Lenovo Mobile Communication Technology Ltd." },

4854 { 0x0012FF, "Lely Industries N.V." },

4855 { 0x001300, "IT-FACTORY, INC." },

4856 { 0x001301, "IronGate S.L." },

4857 { 0x001302, "Intel Corporate" },

4858 { 0x001303, "GateConnect" },

4859 { 0x001304, "Flaircomm Technologies Co. LTD" },

4860 { 0x001305, "Epicom, Inc." },

4861 { 0x001306, "Always On Wireless" },

4862 { 0x001307, "Paravirtual Corporation" },

4863 { 0x001308, "Nuvera Fuel Cells" },

4864 { 0x001309, "Ocean Broadband Networks" },

4865 { 0x00130A, "Nortel Networks" },

4866 { 0x00130B, "Mextal B.V." },

4867 { 0x00130C, "HF System Corporation" },

4868 { 0x00130D, "GALILEO AVIONICA" },

4869 { 0x00130E, "Focusrite Audio Engineering Limited" },

4870 { 0x00130F, "EGEMEN Bilgisayar Muh San ve Tic LTD STI" },

4871 { 0x001310, "Cisco-Linksys, LLC" },

4872 { 0x001311, "ARRIS Group, Inc." },

4873 { 0x001312, "Amedia Networks Inc." },

4874 { 0x001313, "GuangZhou Post & Telecom Equipment ltd" },

4875 { 0x001314, "Asiamajor Inc." },

4876 { 0x001315, "Sony Interactive Entertainment Inc." },

4877 { 0x001316, "L-S-B Broadcast Technologies GmbH" },

4878 { 0x001317, "GN Netcom A/S" },

4879 { 0x001318, "DGSTATION Co., Ltd." },

4880 { 0x001319, "Cisco Systems, Inc" },

4881 { 0x00131A, "Cisco Systems, Inc" },

4882 { 0x00131B, "BeCell Innovations Corp." },

4883 { 0x00131C, "LiteTouch, Inc." },

4884 { 0x00131D, "Scanvaegt International A/S" },

4885 { 0x00131E, "peiker acustic GmbH" },

4886 { 0x00131F, "NxtPhase T&D, Corp." },

4887 { 0x001320, "Intel Corporate" },

4888 { 0x001321, "Hewlett Packard" },

4889 { 0x001322, "DAQ Electronics, Inc." },

4890 { 0x001323, "Cap Co., Ltd." },

4891 { 0x001324, "Schneider Electric Ultra Terminal" },

4892 { 0x001325, "Cortina Systems Inc" },

4893 { 0x001326, "ECM Systems Ltd" },

4894 { 0x001327, "Data Acquisitions limited" },

4895 { 0x001328, "Westech Korea Inc.," },

4896 { 0x001329, "VSST Co., LTD" },

4897 { 0x00132A, "Sitronics Telecom Solutions" },

4898 { 0x00132B, "Phoenix Digital" },

4899 { 0x00132C, "MAZ Brandenburg GmbH" },

4900 { 0x00132D, "iWise Communications" },

4901 { 0x00132E, "ITian Coporation" },

4902 { 0x00132F, "Interactek" },

4903 { 0x001330, "EURO PROTECTION SURVEILLANCE" },

4904 { 0x001331, "CellPoint Connect" },

4905 { 0x001332, "Beijing Topsec Network Security Technology Co., Ltd." },

4906 { 0x001333, "BaudTec Corporation" },

4907 { 0x001334, "Arkados, Inc." },

4908 { 0x001335, "VS Industry Berhad" },

4909 { 0x001336, "Tianjin 712 Communication Broadcasting co., ltd." },

4910 { 0x001337, "Orient Power Home Network Ltd." },

4911 { 0x001338, "FRESENIUS-VIAL" },

4912 { 0x001339, "CCV Deutschland GmbH" },

4913 { 0x00133A, "VadaTech Inc." },

4914 { 0x00133B, "Speed Dragon Multimedia Limited" },

4915 { 0x00133C, "QUINTRON SYSTEMS INC." },

4916 { 0x00133D, "Micro Memory Curtiss Wright Co" },

4917 { 0x00133E, "MetaSwitch" },

4918 { 0x00133F, "Eppendorf Instrumente GmbH" },

4919 { 0x001340, "AD.EL s.r.l." },

4920 { 0x001341, "Shandong New Beiyang Information Technology Co.,Ltd" },

4921 { 0x001342, "Vision Research, Inc." },

4922 { 0x001343, "Matsushita Electronic Components (Europe) GmbH" },

4923 { 0x001344, "Fargo Electronics Inc." },

4924 { 0x001345, "Eaton Corporation" },

4925 { 0x001346, "D-Link Corporation" },

4926 { 0x001347, "Red Lion Controls, LP" },

4927 { 0x001348, "Artila Electronics Co., Ltd." },

4928 { 0x001349, "Zyxel Communications Corporation" },

4929 { 0x00134A, "Engim, Inc." },

4930 { 0x00134B, "ToGoldenNet Technology Inc." },

4931 { 0x00134C, "YDT Technology International" },

4932 { 0x00134D, "Inepro BV" },

4933 { 0x00134E, "Valox Systems, Inc." },

4934 { 0x00134F, "Rapidus Wireless Networks Inc." },

4935 { 0x001350, "Silver Spring Networks, Inc" },

4936 { 0x001351, "Niles Audio Corporation" },

4937 { 0x001352, "Naztec, Inc." },

4938 { 0x001353, "HYDAC Filtertechnik GMBH" },

4939 { 0x001354, "Zcomax Technologies, Inc." },

4940 { 0x001355, "TOMEN Cyber-business Solutions, Inc." },

4941 { 0x001356, "FLIR Radiation Inc" },

4942 { 0x001357, "Soyal Technology Co., Ltd." },

4943 { 0x001358, "Realm Systems, Inc." },

4944 { 0x001359, "ProTelevision Technologies A/S" },

4945 { 0x00135A, "Project T&E Limited" },

4946 { 0x00135B, "PanelLink Cinema, LLC" },

4947 { 0x00135C, "OnSite Systems, Inc." },

4948 { 0x00135D, "NTTPC Communications, Inc." },

4949 { 0x00135E, "EAB/RWI/K" },

4950 { 0x00135F, "Cisco Systems, Inc" },

4951 { 0x001360, "Cisco Systems, Inc" },

4952 { 0x001361, "Biospace Co., Ltd." },

4953 { 0x001362, "ShinHeung Precision Co., Ltd." },

4954 { 0x001363, "Verascape, Inc." },

4955 { 0x001364, "Paradigm Technology Inc.." },

4956 { 0x001365, "Nortel Networks" },

4957 { 0x001366, "Neturity Technologies Inc." },

4958 { 0x001367, "Narayon. Co., Ltd." },

4959 { 0x001368, "Saab Danmark A/S" },

4960 { 0x001369, "Honda Electron Co., LED." },

4961 { 0x00136A, "Hach Lange Sarl" },

4962 { 0x00136B, "E-TEC" },

4963 { 0x00136C, "TomTom" },

4964 { 0x00136D, "Tentaculus AB" },

4965 { 0x00136E, "Techmetro Corp." },

4966 { 0x00136F, "PacketMotion, Inc." },

4967 { 0x001370, "Nokia Danmark A/S" },

4968 { 0x001371, "ARRIS Group, Inc." },

4969 { 0x001372, "Dell Inc." },

4970 { 0x001373, "BLwave Electronics Co., Ltd" },

4971 { 0x001374, "Atheros Communications, Inc." },

4972 { 0x001375, "American Security Products Co." },

4973 { 0x001376, "Tabor Electronics Ltd." },

4974 { 0x001377, "Samsung Electronics Co.,Ltd" },

4975 { 0x001378, "Qsan Technology, Inc." },

4976 { 0x001379, "PONDER INFORMATION INDUSTRIES LTD." },

4977 { 0x00137A, "Netvox Technology Co., Ltd." },

4978 { 0x00137B, "Movon Corporation" },

4979 { 0x00137C, "Kaicom co., Ltd." },

4980 { 0x00137D, "Dynalab, Inc." },

4981 { 0x00137E, "CorEdge Networks, Inc." },

4982 { 0x00137F, "Cisco Systems, Inc" },

4983 { 0x001380, "Cisco Systems, Inc" },

4984 { 0x001381, "CHIPS & Systems, Inc." },

4985 { 0x001382, "Cetacea Networks Corporation" },

4986 { 0x001383, "Application Technologies and Engineering Research Laboratory" },

4987 { 0x001384, "Advanced Motion Controls" },

4988 { 0x001385, "Add-On Technology Co., LTD." },

4989 { 0x001386, "ABB Inc/Totalflow" },

4990 { 0x001387, "27M Technologies AB" },

4991 { 0x001388, "WiMedia Alliance" },

4992 { 0x001389, "Redes de Telefonía Móvil S.A." },

4993 { 0x00138A, "Qingdao GoerTek Technology Co., Ltd." },

4994 { 0x00138B, "Phantom Technologies LLC" },

4995 { 0x00138C, "Kumyoung.Co.Ltd" },

4996 { 0x00138D, "Kinghold" },

4997 { 0x00138E, "FOAB Elektronik AB" },

4998 { 0x00138F, "Asiarock Technology Limited" },

4999 { 0x001390, "Termtek Computer Co., Ltd" },

5000 { 0x001391, "OUEN CO.,LTD." },

5001 { 0x001392, "Ruckus Wireless" },

5002 { 0x001393, "Panta Systems, Inc." },

5003 { 0x001394, "Infohand Co.,Ltd" },

5004 { 0x001395, "congatec GmbH" },

5005 { 0x001396, "Acbel Polytech Inc." },

5006 { 0x001397, "Oracle Corporation" },

5007 { 0x001398, "TrafficSim Co.,Ltd" },

5008 { 0x001399, "STAC Corporation." },

5009 { 0x00139A, "K-ubique ID Corp." },

5010 { 0x00139B, "ioIMAGE Ltd." },

5011 { 0x00139C, "Exavera Technologies, Inc." },

5012 { 0x00139D, "MaxLinear Hispania S.L.U." },

5013 { 0x00139E, "Ciara Technologies Inc." },

5014 { 0x00139F, "Electronics Design Services, Co., Ltd." },

5015 { 0x0013A0, "ALGOSYSTEM Co., Ltd." },

5016 { 0x0013A1, "Crow Electronic Engeneering" },

5017 { 0x0013A2, "MaxStream, Inc" },

5018 { 0x0013A3, "Siemens Home & Office Comm. Devices" },

5019 { 0x0013A4, "KeyEye Communications" },

5020 { 0x0013A5, "General Solutions, LTD." },

5021 { 0x0013A6, "Extricom Ltd" },

5022 { 0x0013A7, "BATTELLE MEMORIAL INSTITUTE" },

5023 { 0x0013A8, "Tanisys Technology" },

5024 { 0x0013A9, "Sony Corporation" },

5025 { 0x0013AA, "ALS & TEC Ltd." },

5026 { 0x0013AB, "Telemotive AG" },

5027 { 0x0013AC, "Sunmyung Electronics Co., LTD" },

5028 { 0x0013AD, "Sendo Ltd" },

5029 { 0x0013AE, "Radiance Technologies, Inc." },

5030 { 0x0013AF, "NUMA Technology,Inc." },

5031 { 0x0013B0, "Jablotron" },

5032 { 0x0013B1, "Intelligent Control Systems (Asia) Pte Ltd" },

5033 { 0x0013B2, "Carallon Limited" },

5034 { 0x0013B3, "Ecom Communications Technology Co., Ltd." },

5035 { 0x0013B4, "Appear AS" },

5036 { 0x0013B5, "Wavesat" },

5037 { 0x0013B6, "Sling Media, Inc." },

5038 { 0x0013B7, "Scantech ID" },

5039 { 0x0013B8, "RyCo Electronic Systems Limited" },

5040 { 0x0013B9, "BM SPA" },

5041 { 0x0013BA, "ReadyLinks Inc" },

5042 { 0x0013BB, "Smartvue Corporation" },

5043 { 0x0013BC, "Artimi Ltd" },

5044 { 0x0013BD, "HYMATOM SA" },

5045 { 0x0013BE, "Virtual Conexions" },

5046 { 0x0013BF, "Media System Planning Corp." },

5047 { 0x0013C0, "Trix Tecnologia Ltda." },

5048 { 0x0013C1, "Asoka USA Corporation" },

5049 { 0x0013C2, "WACOM Co.,Ltd" },

5050 { 0x0013C3, "Cisco Systems, Inc" },

5051 { 0x0013C4, "Cisco Systems, Inc" },

5052 { 0x0013C5, "LIGHTRON FIBER-OPTIC DEVICES INC." },

5053 { 0x0013C6, "OpenGear, Inc" },

5054 { 0x0013C7, "IONOS Co.,Ltd." },

5055 { 0x0013C8, "ADB Broadband Italia" },

5056 { 0x0013C9, "Beyond Achieve Enterprises Ltd." },

5057 { 0x0013CA, "ATX" },

5058 { 0x0013CB, "Zenitel Norway AS" },

5059 { 0x0013CC, "Tall Maple Systems" },

5060 { 0x0013CD, "MTI co. LTD" },

5061 { 0x0013CE, "Intel Corporate" },

5062 { 0x0013CF, "4Access Communications" },

5063 { 0x0013D0, "t+ Medical Ltd" },

5064 { 0x0013D1, "KIRK telecom A/S" },

5065 { 0x0013D2, "PAGE IBERICA, S.A." },

5066 { 0x0013D3, "MICRO-STAR INTERNATIONAL CO., LTD." },

5067 { 0x0013D4, "ASUSTek COMPUTER INC." },

5068 { 0x0013D5, "RuggedCom" },

5069 { 0x0013D6, "TII NETWORK TECHNOLOGIES, INC." },

5070 { 0x0013D7, "SPIDCOM Technologies SA" },

5071 { 0x0013D8, "Princeton Instruments" },

5072 { 0x0013D9, "Matrix Product Development, Inc." },

5073 { 0x0013DA, "Diskware Co., Ltd" },

5074 { 0x0013DB, "SHOEI Electric Co.,Ltd" },

5075 { 0x0013DC, "IBTEK INC." },

5076 { 0x0013DD, "Abbott Diagnostics" },

5077 { 0x0013DE, "Adapt4, LLC" },

5078 { 0x0013DF, "Ryvor Corp." },

5079 { 0x0013E0, "Murata Manufacturing Co., Ltd." },

5080 { 0x0013E1, "Iprobe AB" },

5081 { 0x0013E2, "GeoVision Inc." },

5082 { 0x0013E3, "CoVi Technologies, Inc." },

5083 { 0x0013E4, "YANGJAE SYSTEMS CORP." },

5084 { 0x0013E5, "TENOSYS, INC." },

5085 { 0x0013E6, "Technolution" },

5086 { 0x0013E7, "Halcro" },

5087 { 0x0013E8, "Intel Corporate" },

5088 { 0x0013E9, "VeriWave, Inc." },

5089 { 0x0013EA, "Kamstrup A/S" },

5090 { 0x0013EB, "Sysmaster Corporation" },

5091 { 0x0013EC, "Netsnapper Technologies SARL" },

5092 { 0x0013ED, "PSIA" },

5093 { 0x0013EE, "JBX Designs Inc." },

5094 { 0x0013EF, "Kingjon Digital Technology Co.,Ltd" },

5095 { 0x0013F0, "Wavefront Semiconductor" },

5096 { 0x0013F1, "AMOD Technology Co., Ltd." },

5097 { 0x0013F2, "Klas Ltd" },

5098 { 0x0013F3, "Giga-byte Communications Inc." },

5099 { 0x0013F4, "Psitek (Pty) Ltd" },

5100 { 0x0013F5, "Akimbi Systems" },

5101 { 0x0013F6, "Cintech" },

5102 { 0x0013F7, "SMC Networks, Inc." },

5103 { 0x0013F8, "Dex Security Solutions" },

5104 { 0x0013F9, "Cavera Systems" },

5105 { 0x0013FA, "LifeSize Communications, Inc" },

5106 { 0x0013FB, "RKC INSTRUMENT INC." },

5107 { 0x0013FC, "SiCortex, Inc" },

5108 { 0x0013FD, "Nokia Danmark A/S" },

5109 { 0x0013FE, "GRANDTEC ELECTRONIC CORP." },

5110 { 0x0013FF, "Dage-MTI of MC, Inc." },

5111 { 0x001400, "MINERVA KOREA CO., LTD" },

5112 { 0x001401, "Rivertree Networks Corp." },

5113 { 0x001402, "kk-electronic a/s" },

5114 { 0x001403, "Renasis, LLC" },

5115 { 0x001404, "ARRIS Group, Inc." },

5116 { 0x001405, "OpenIB, Inc." },

5117 { 0x001406, "Go Networks" },

5118 { 0x001407, "Sperian Protection Instrumentation" },

5119 { 0x001408, "Eka Systems Inc." },

5120 { 0x001409, "MAGNETI MARELLI S.E. S.p.A." },

5121 { 0x00140A, "WEPIO Co., Ltd." },

5122 { 0x00140B, "FIRST INTERNATIONAL COMPUTER, INC." },

5123 { 0x00140C, "GKB CCTV CO., LTD." },

5124 { 0x00140D, "Nortel Networks" },

5125 { 0x00140E, "Nortel Networks" },

5126 { 0x00140F, "Federal State Unitary Enterprise Leningrad R&D Institute of" },

5127 { 0x001410, "Suzhou Keda Technology CO.,Ltd" },

5128 { 0x001411, "Deutschmann Automation GmbH & Co. KG" },

5129 { 0x001412, "S-TEC electronics AG" },

5130 { 0x001413, "Trebing & Himstedt Prozeßautomation GmbH & Co. KG" },

5131 { 0x001414, "Jumpnode Systems LLC." },

5132 { 0x001415, "Intec Automation inc." },

5133 { 0x001416, "Scosche Industries, Inc." },

5134 { 0x001417, "RSE Informations Technologie GmbH" },

5135 { 0x001418, "C4Line" },

5136 { 0x001419, "SIDSA" },

5137 { 0x00141A, "DEICY CORPORATION" },

5138 { 0x00141B, "Cisco Systems, Inc" },

5139 { 0x00141C, "Cisco Systems, Inc" },

5140 { 0x00141D, "KEBA Industrial Automation Germany GmbH" },

5141 { 0x00141E, "P.A. Semi, Inc." },

5142 { 0x00141F, "SunKwang Electronics Co., Ltd" },

5143 { 0x001420, "G-Links networking company" },

5144 { 0x001421, "Total Wireless Technologies Pte. Ltd." },

5145 { 0x001422, "Dell Inc." },

5146 { 0x001423, "J-S Co. NEUROCOM" },

5147 { 0x001424, "Merry Electrics CO., LTD." },

5148 { 0x001425, "Galactic Computing Corp." },

5149 { 0x001426, "NL Technology" },

5150 { 0x001427, "JazzMutant" },

5151 { 0x001428, "Vocollect Inc" },

5152 { 0x001429, "V Center Technologies Co., Ltd." },

5153 { 0x00142A, "Elitegroup Computer Systems Co.,Ltd." },

5154 { 0x00142B, "Edata Communication Inc." },

5155 { 0x00142C, "Koncept International, Inc." },

5156 { 0x00142D, "Toradex AG" },

5157 { 0x00142E, "77 Elektronika Kft." },

5158 { 0x00142F, "Savvius" },

5159 { 0x001430, "ViPowER, Inc" },

5160 { 0x001431, "PDL Electronics Ltd" },

5161 { 0x001432, "Tarallax Wireless, Inc." },

5162 { 0x001433, "Empower Technologies(Canada) Inc." },

5163 { 0x001434, "Keri Systems, Inc" },

5164 { 0x001435, "CityCom Corp." },

5165 { 0x001436, "Qwerty Elektronik AB" },

5166 { 0x001437, "GSTeletech Co.,Ltd." },

5167 { 0x001438, "Hewlett Packard Enterprise" },

5168 { 0x001439, "Blonder Tongue Laboratories, Inc" },

5169 { 0x00143A, "RAYTALK INTERNATIONAL SRL" },

5170 { 0x00143B, "Sensovation AG" },

5171 { 0x00143C, "Rheinmetall Canada Inc." },

5172 { 0x00143D, "Aevoe Inc." },

5173 { 0x00143E, "AirLink Communications, Inc." },

5174 { 0x00143F, "Hotway Technology Corporation" },

5175 { 0x001440, "ATOMIC Corporation" },

5176 { 0x001441, "Innovation Sound Technology Co., LTD." },

5177 { 0x001442, "ATTO CORPORATION" },

5178 { 0x001443, "Consultronics Europe Ltd" },

5179 { 0x001444, "Grundfos Holding" },

5180 { 0x001445, "Telefon-Gradnja d.o.o." },

5181 { 0x001446, "SuperVision Solutions LLC" },

5182 { 0x001447, "BOAZ Inc." },

5183 { 0x001448, "Inventec Multimedia & Telecom Corporation" },

5184 { 0x001449, "Sichuan Changhong Electric Ltd." },

5185 { 0x00144A, "Taiwan Thick-Film Ind. Corp." },

5186 { 0x00144B, "Hifn, Inc." },

5187 { 0x00144C, "General Meters Corp." },

5188 { 0x00144D, "Intelligent Systems" },

5189 { 0x00144E, "SRISA" },

5190 { 0x00144F, "Oracle Corporation" },

5191 { 0x001450, "Heim Systems GmbH" },

5192 { 0x001451, "Apple, Inc." },

5193 { 0x001452, "CALCULEX,INC." },

5194 { 0x001453, "ADVANTECH TECHNOLOGIES CO.,LTD" },

5195 { 0x001454, "Symwave" },

5196 { 0x001455, "Coder Electronics Corporation" },

5197 { 0x001456, "Edge Products" },

5198 { 0x001457, "Nevion" },

5199 { 0x001458, "HS Automatic ApS" },

5200 { 0x001459, "Moram Co., Ltd." },

5201 { 0x00145A, "Westermo Neratec AG" },

5202 { 0x00145B, "SeekerNet Inc." },

5203 { 0x00145C, "Intronics B.V." },

5204 { 0x00145D, "WJ Communications, Inc." },

5205 { 0x00145E, "IBM Corp" },

5206 { 0x00145F, "ADITEC CO. LTD" },

5207 { 0x001460, "Kyocera Wireless Corp." },

5208 { 0x001461, "CORONA CORPORATION" },

5209 { 0x001462, "Digiwell Technology, inc" },

5210 { 0x001463, "IDCS N.V." },

5211 { 0x001464, "Cryptosoft" },

5212 { 0x001465, "Novo Nordisk A/S" },

5213 { 0x001466, "Kleinhenz Elektronik GmbH" },

5214 { 0x001467, "ArrowSpan Inc." },

5215 { 0x001468, "CelPlan International, Inc." },

5216 { 0x001469, "Cisco Systems, Inc" },

5217 { 0x00146A, "Cisco Systems, Inc" },

5218 { 0x00146B, "Anagran, Inc." },

5219 { 0x00146C, "NETGEAR" },

5220 { 0x00146D, "RF Technologies" },

5221 { 0x00146E, "H. Stoll GmbH & Co. KG" },

5222 { 0x00146F, "Kohler Co" },

5223 { 0x001470, "Prokom Software SA" },

5224 { 0x001471, "Eastern Asia Technology Limited" },

5225 { 0x001472, "China Broadband Wireless IP Standard group(ChinaBWIPS)" },

5226 { 0x001473, "Bookham Inc" },

5227 { 0x001474, "K40 Electronics" },

5228 { 0x001475, "Wiline Networks, Inc." },

5229 { 0x001476, "MultiCom Industries Limited" },

5230 { 0x001477, "Trilliant" },

5231 { 0x001478, "TP-LINK TECHNOLOGIES CO.,LTD." },

5232 { 0x001479, "NEC Magnus Communications,Ltd." },

5233 { 0x00147A, "Eubus GmbH" },

5234 { 0x00147B, "Iteris, Inc." },

5235 { 0x00147C, "3Com Ltd" },

5236 { 0x00147D, "Aeon Digital International" },

5237 { 0x00147E, "InnerWireless" },

5238 { 0x00147F, "Thomson Telecom Belgium" },

5239 { 0x001480, "Hitachi-LG Data Storage Korea, Inc" },

5240 { 0x001481, "Multilink Inc" },

5241 { 0x001482, "Aurora Networks" },

5242 { 0x001483, "eXS Inc." },

5243 { 0x001484, "Cermate Technologies Inc." },

5244 { 0x001485, "Giga-Byte" },

5245 { 0x001486, "Echo Digital Audio Corporation" },

5246 { 0x001487, "American Technology Integrators" },

5247 { 0x001488, "Akorri" },

5248 { 0x001489, "B15402100 - JANDEI, S.L." },

5249 { 0x00148A, "Elin Ebg Traction Gmbh" },

5250 { 0x00148B, "Globo Electronic GmbH & Co. KG" },

5251 { 0x00148C, "General Dynamics Mission Systems" },

5252 { 0x00148D, "Cubic Defense Simulation Systems" },

5253 { 0x00148E, "Tele Power Inc." },

5254 { 0x00148F, "Protronic (Far East) Ltd." },

5255 { 0x001490, "ASP Corporation" },

5256 { 0x001491, "Daniels Electronics Ltd. dba Codan Radio Communications" },

5257 { 0x001492, "Liteon, Mobile Media Solution SBU" },

5258 { 0x001493, "Systimax Solutions" },

5259 { 0x001494, "ESU AG" },

5260 { 0x001495, "2Wire Inc" },

5261 { 0x001496, "Phonic Corp." },

5262 { 0x001497, "ZHIYUAN Eletronics co.,ltd." },

5263 { 0x001498, "Viking Design Technology" },

5264 { 0x001499, "Helicomm Inc" },

5265 { 0x00149A, "ARRIS Group, Inc." },

5266 { 0x00149B, "Nokota Communications, LLC" },

5267 { 0x00149C, "HF Company" },

5268 { 0x00149D, "Sound ID Inc." },

5269 { 0x00149E, "UbONE Co., Ltd" },

5270 { 0x00149F, "System and Chips, Inc." },

5271 { 0x0014A0, "Accsense, Inc." },

5272 { 0x0014A1, "Synchronous Communication Corp" },

5273 { 0x0014A2, "Core Micro Systems Inc." },

5274 { 0x0014A3, "Vitelec BV" },

5275 { 0x0014A4, "Hon Hai Precision Ind. Co.,Ltd." },

5276 { 0x0014A5, "Gemtek Technology Co., Ltd." },

5277 { 0x0014A6, "Teranetics, Inc." },

5278 { 0x0014A7, "Nokia Danmark A/S" },

5279 { 0x0014A8, "Cisco Systems, Inc" },

5280 { 0x0014A9, "Cisco Systems, Inc" },

5281 { 0x0014AA, "Ashly Audio, Inc." },

5282 { 0x0014AB, "Senhai Electronic Technology Co., Ltd." },

5283 { 0x0014AC, "Bountiful WiFi" },

5284 { 0x0014AD, "Gassner Wiege- und Meßtechnik GmbH" },

5285 { 0x0014AE, "Wizlogics Co., Ltd." },

5286 { 0x0014AF, "Datasym POS Inc." },

5287 { 0x0014B0, "Naeil Community" },

5288 { 0x0014B1, "Axell Wireless Limited" },

5289 { 0x0014B2, "mCubelogics Corporation" },

5290 { 0x0014B3, "CoreStar International Corp" },

5291 { 0x0014B4, "General Dynamics United Kingdom Ltd" },

5292 { 0x0014B5, "PHYSIOMETRIX,INC" },

5293 { 0x0014B6, "Enswer Technology Inc." },

5294 { 0x0014B7, "AR Infotek Inc." },

5295 { 0x0014B8, "Hill-Rom" },

5296 { 0x0014B9, "MSTAR SEMICONDUCTOR" },

5297 { 0x0014BA, "Carvers SA de CV" },

5298 { 0x0014BB, "Open Interface North America" },

5299 { 0x0014BC, "SYNECTIC TELECOM EXPORTS PVT. LTD." },

5300 { 0x0014BD, "incNETWORKS, Inc" },

5301 { 0x0014BE, "Wink communication technology CO.LTD" },

5302 { 0x0014BF, "Cisco-Linksys, LLC" },

5303 { 0x0014C0, "Symstream Technology Group Ltd" },

5304 { 0x0014C1, "U.S. Robotics Corporation" },

5305 { 0x0014C2, "Hewlett Packard" },

5306 { 0x0014C3, "Seagate Technology" },

5307 { 0x0014C4, "Vitelcom Mobile Technology" },

5308 { 0x0014C5, "Alive Technologies Pty Ltd" },

5309 { 0x0014C6, "Quixant Ltd" },

5310 { 0x0014C7, "Nortel Networks" },

5311 { 0x0014C8, "Contemporary Research Corp" },

5312 { 0x0014C9, "Brocade Communications Systems LLC" },

5313 { 0x0014CA, "Key Radio Systems Limited" },

5314 { 0x0014CB, "LifeSync Corporation" },

5315 { 0x0014CC, "Zetec, Inc." },

5316 { 0x0014CD, "DigitalZone Co., Ltd." },

5317 { 0x0014CE, "NF CORPORATION" },

5318 { 0x0014CF, "INVISIO Communications" },

5319 { 0x0014D0, "BTI Systems Inc." },

5320 { 0x0014D1, "TRENDnet, Inc." },

5321 { 0x0014D2, "Kyuden Technosystems Corporation" },

5322 { 0x0014D3, "SEPSA" },

5323 { 0x0014D4, "K Technology Corporation" },

5324 { 0x0014D5, "Datang Telecom Technology CO. , LCD,Optical Communication Br" },

5325 { 0x0014D6, "Jeongmin Electronics Co.,Ltd." },

5326 { 0x0014D7, "Datastore Technology Corp" },

5327 { 0x0014D8, "bio-logic SA" },

5328 { 0x0014D9, "IP Fabrics, Inc." },

5329 { 0x0014DA, "Huntleigh Healthcare" },

5330 { 0x0014DB, "Elma Trenew Electronic GmbH" },

5331 { 0x0014DC, "Communication System Design & Manufacturing (CSDM)" },

5332 { 0x0014DD, "Covergence Inc." },

5333 { 0x0014DE, "Sage Instruments Inc." },

5334 { 0x0014DF, "HI-P Tech Corporation" },

5335 { 0x0014E0, "LET'S Corporation" },

5336 { 0x0014E1, "Data Display AG" },

5337 { 0x0014E2, "datacom systems inc." },

5338 { 0x0014E3, "mm-lab GmbH" },

5339 { 0x0014E4, "infinias, LLC" },

5340 { 0x0014E5, "Alticast" },

5341 { 0x0014E6, "AIM Infrarotmodule GmbH" },

5342 { 0x0014E7, "Stolinx,. Inc" },

5343 { 0x0014E8, "ARRIS Group, Inc." },

5344 { 0x0014E9, "Nortech International" },

5345 { 0x0014EA, "S Digm Inc. (Safe Paradigm Inc.)" },

5346 { 0x0014EB, "AwarePoint Corporation" },

5347 { 0x0014EC, "Acro Telecom" },

5348 { 0x0014ED, "Airak, Inc." },

5349 { 0x0014EE, "Western Digital Technologies, Inc." },

5350 { 0x0014EF, "TZero Technologies, Inc." },

5351 { 0x0014F0, "Business Security OL AB" },

5352 { 0x0014F1, "Cisco Systems, Inc" },

5353 { 0x0014F2, "Cisco Systems, Inc" },

5354 { 0x0014F3, "ViXS Systems Inc" },

5355 { 0x0014F4, "DekTec Digital Video B.V." },

5356 { 0x0014F5, "OSI Security Devices" },

5357 { 0x0014F6, "Juniper Networks" },

5358 { 0x0014F7, "CREVIS Co., LTD" },

5359 { 0x0014F8, "Scientific Atlanta" },

5360 { 0x0014F9, "Vantage Controls" },

5361 { 0x0014FA, "AsGa S.A." },

5362 { 0x0014FB, "Technical Solutions Inc." },

5363 { 0x0014FC, "Extandon, Inc." },

5364 { 0x0014FD, "Thecus Technology Corp." },

5365 { 0x0014FE, "Artech Electronics" },

5366 { 0x0014FF, "Precise Automation, Inc." },

5367 { 0x001500, "Intel Corporate" },

5368 { 0x001501, "LexBox" },

5369 { 0x001502, "BETA tech" },

5370 { 0x001503, "PROFIcomms s.r.o." },

5371 { 0x001504, "GAME PLUS CO., LTD." },

5372 { 0x001505, "Actiontec Electronics, Inc" },

5373 { 0x001506, "Neo Photonics" },

5374 { 0x001507, "Renaissance Learning Inc" },

5375 { 0x001508, "Global Target Enterprise Inc" },

5376 { 0x001509, "Plus Technology Co., Ltd" },

5377 { 0x00150A, "Sonoa Systems, Inc" },

5378 { 0x00150B, "SAGE INFOTECH LTD." },

5379 { 0x00150C, "AVM GmbH" },

5380 { 0x00150D, "Hoana Medical, Inc." },

5381 { 0x00150E, "OPENBRAIN TECHNOLOGIES CO., LTD." },

5382 { 0x00150F, "mingjong" },

5383 { 0x001510, "Techsphere Co., Ltd" },

5384 { 0x001511, "Data Center Systems" },

5385 { 0x001512, "Zurich University of Applied Sciences" },

5386 { 0x001513, "EFS sas" },

5387 { 0x001514, "Hu Zhou NAVA Networks&Electronics Ltd." },

5388 { 0x001515, "Leipold+Co.GmbH" },

5389 { 0x001516, "URIEL SYSTEMS INC." },

5390 { 0x001517, "Intel Corporate" },

5391 { 0x001518, "Shenzhen 10MOONS Technology Development CO.,Ltd" },

5392 { 0x001519, "StoreAge Networking Technologies" },

5393 { 0x00151A, "Hunter Engineering Company" },

5394 { 0x00151B, "Isilon Systems Inc." },

5395 { 0x00151C, "LENECO" },

5396 { 0x00151D, "M2I CORPORATION" },

5397 { 0x00151E, "ETHERNET Powerlink Standarization Group (EPSG)" },

5398 { 0x00151F, "Multivision Intelligent Surveillance (Hong Kong) Ltd" },

5399 { 0x001520, "Radiocrafts AS" },

5400 { 0x001521, "Horoquartz" },

5401 { 0x001522, "Dea Security" },

5402 { 0x001523, "Meteor Communications Corporation" },

5403 { 0x001524, "Numatics, Inc." },

5404 { 0x001525, "Chamberlain Access Solutions" },

5405 { 0x001526, "Remote Technologies Inc" },

5406 { 0x001527, "Balboa Instruments" },

5407 { 0x001528, "Beacon Medical Products LLC d.b.a. BeaconMedaes" },

5408 { 0x001529, "N3 Corporation" },

5409 { 0x00152A, "Nokia Corporation" },

5410 { 0x00152B, "Cisco Systems, Inc" },

5411 { 0x00152C, "Cisco Systems, Inc" },

5412 { 0x00152D, "TenX Networks, LLC" },

5413 { 0x00152E, "PacketHop, Inc." },

5414 { 0x00152F, "ARRIS Group, Inc." },

5415 { 0x001530, "Dell EMC" },

5416 { 0x001531, "KOCOM" },

5417 { 0x001532, "Consumer Technologies Group, LLC" },

5418 { 0x001533, "NADAM.CO.,LTD" },

5419 { 0x001534, "A Beltrónica-Companhia de Comunicações, Lda" },

5420 { 0x001535, "OTE Spa" },

5421 { 0x001536, "Powertech co.,Ltd" },

5422 { 0x001537, "Ventus Networks" },

5423 { 0x001538, "RFID, Inc." },

5424 { 0x001539, "Technodrive srl" },

5425 { 0x00153A, "Shenzhen Syscan Technology Co.,Ltd." },

5426 { 0x00153B, "EMH metering GmbH & Co. KG" },

5427 { 0x00153C, "Kprotech Co., Ltd." },

5428 { 0x00153D, "ELIM PRODUCT CO." },

5429 { 0x00153E, "Q-Matic Sweden AB" },

5430 { 0x00153F, "Alcatel Alenia Space Italia" },

5431 { 0x001540, "Nortel Networks" },

5432 { 0x001541, "StrataLight Communications, Inc." },

5433 { 0x001542, "MICROHARD S.R.L." },

5434 { 0x001543, "Aberdeen Test Center" },

5435 { 0x001544, "coM.s.a.t. AG" },

5436 { 0x001545, "SEECODE Co., Ltd." },

5437 { 0x001546, "ITG Worldwide Sdn Bhd" },

5438 { 0x001547, "AiZen Solutions Inc." },

5439 { 0x001548, "CUBE TECHNOLOGIES" },

5440 { 0x001549, "Dixtal Biomedica Ind. Com. Ltda" },

5441 { 0x00154A, "WANSHIH ELECTRONIC CO., LTD" },

5442 { 0x00154B, "Wonde Proud Technology Co., Ltd" },

5443 { 0x00154C, "Saunders Electronics" },

5444 { 0x00154D, "Netronome Systems, Inc." },

5445 { 0x00154E, "IEC" },

5446 { 0x00154F, "one RF Technology" },

5447 { 0x001550, "Nits Technology Inc" },

5448 { 0x001551, "RadioPulse Inc." },

5449 { 0x001552, "Wi-Gear Inc." },

5450 { 0x001553, "Cytyc Corporation" },

5451 { 0x001554, "Atalum Wireless S.A." },

5452 { 0x001555, "DFM GmbH" },

5453 { 0x001556, "Sagemcom Broadband SAS" },

5454 { 0x001557, "Olivetti" },

5455 { 0x001558, "FOXCONN" },

5456 { 0x001559, "Securaplane Technologies, Inc." },

5457 { 0x00155A, "DAINIPPON PHARMACEUTICAL CO., LTD." },

5458 { 0x00155B, "Sampo Corporation" },

5459 { 0x00155C, "Dresser Wayne" },

5460 { 0x00155D, "Microsoft Corporation" },

5461 { 0x00155E, "Morgan Stanley" },

5462 { 0x00155F, "GreenPeak Technologies" },

5463 { 0x001560, "Hewlett Packard" },

5464 { 0x001561, "JJPlus Corporation" },

5465 { 0x001562, "Cisco Systems, Inc" },

5466 { 0x001563, "Cisco Systems, Inc" },

5467 { 0x001564, "BEHRINGER Spezielle Studiotechnik GmbH" },

5468 { 0x001565, "XIAMEN YEALINK NETWORK TECHNOLOGY CO.,LTD" },

5469 { 0x001566, "A-First Technology Co., Ltd." },

5470 { 0x001567, "RADWIN Inc." },

5471 { 0x001568, "Dilithium Networks" },

5472 { 0x001569, "PECO II, Inc." },

5473 { 0x00156A, "DG2L Technologies Pvt. Ltd." },

5474 { 0x00156B, "Perfisans Networks Corp." },

5475 { 0x00156C, "SANE SYSTEM CO., LTD" },

5476 { 0x00156D, "Ubiquiti Inc" },

5477 { 0x00156E, "A. W. Communication Systems Ltd" },

5478 { 0x00156F, "Xiranet Communications GmbH" },

5479 { 0x001570, "Zebra Technologies Inc" },

5480 { 0x001571, "Nolan Systems" },

5481 { 0x001572, "Red-Lemon" },

5482 { 0x001573, "NewSoft Technology Corporation" },

5483 { 0x001574, "Horizon Semiconductors Ltd." },

5484 { 0x001575, "Nevis Networks Inc." },

5485 { 0x001576, "LABiTec - Labor Biomedical Technologies GmbH" },

5486 { 0x001577, "Allied Telesis, Inc." },

5487 { 0x001578, "Audio / Video Innovations" },

5488 { 0x001579, "Lunatone Industrielle Elektronik GmbH" },

5489 { 0x00157A, "Telefin S.p.A." },

5490 { 0x00157B, "Leuze electronic GmbH + Co. KG" },

5491 { 0x00157C, "Dave Networks, Inc." },

5492 { 0x00157D, "POSDATA" },

5493 { 0x00157E, "Weidmüller Interface GmbH & Co. KG" },

5494 { 0x00157F, "ChuanG International Holding CO.,LTD." },

5495 { 0x001580, "U-WAY CORPORATION" },

5496 { 0x001581, "MAKUS Inc." },

5497 { 0x001582, "Pulse Eight Limited" },

5498 { 0x001583, "IVT corporation" },

5499 { 0x001584, "Schenck Process GmbH" },

5500 { 0x001585, "Aonvision Technolopy Corp." },

5501 { 0x001586, "Xiamen Overseas Chinese Electronic Co., Ltd." },

5502 { 0x001587, "Takenaka Seisakusho Co.,Ltd" },

5503 { 0x001588, "Salutica Allied Solutions Sdn Bhd" },

5504 { 0x001589, "D-MAX Technology Co.,Ltd" },

5505 { 0x00158A, "SURECOM Technology Corp." },

5506 { 0x00158B, "Park Air Systems Ltd" },

5507 { 0x00158C, "Liab ApS" },

5508 { 0x00158D, "Jennic Ltd" },

5509 { 0x00158E, "Plustek.INC" },

5510 { 0x00158F, "NTT Advanced Technology Corporation" },

5511 { 0x001590, "Hectronic GmbH" },

5512 { 0x001591, "RLW Inc." },

5513 { 0x001592, "Facom UK Ltd (Melksham)" },

5514 { 0x001593, "U4EA Technologies Inc." },

5515 { 0x001594, "BIXOLON CO.,LTD" },

5516 { 0x001595, "Quester Tangent Corporation" },

5517 { 0x001596, "ARRIS Group, Inc." },

5518 { 0x001597, "AETA AUDIO SYSTEMS" },

5519 { 0x001598, "Kolektor group" },

5520 { 0x001599, "Samsung Electronics Co.,Ltd" },

5521 { 0x00159A, "ARRIS Group, Inc." },

5522 { 0x00159B, "Nortel Networks" },

5523 { 0x00159C, "B-KYUNG SYSTEM Co.,Ltd." },

5524 { 0x00159D, "Tripp Lite" },

5525 { 0x00159E, "Mad Catz Interactive Inc" },

5526 { 0x00159F, "Terascala, Inc." },

5527 { 0x0015A0, "Nokia Danmark A/S" },

5528 { 0x0015A1, "ECA-SINTERS" },

5529 { 0x0015A2, "ARRIS Group, Inc." },

5530 { 0x0015A3, "ARRIS Group, Inc." },

5531 { 0x0015A4, "ARRIS Group, Inc." },

5532 { 0x0015A5, "DCI Co., Ltd." },

5533 { 0x0015A6, "Digital Electronics Products Ltd." },

5534 { 0x0015A7, "Robatech AG" },

5535 { 0x0015A8, "ARRIS Group, Inc." },

5536 { 0x0015A9, "KWANG WOO I&C CO.,LTD" },

5537 { 0x0015AA, "Rextechnik International Co.," },

5538 { 0x0015AB, "PRO CO SOUND INC" },

5539 { 0x0015AC, "Capelon AB" },

5540 { 0x0015AD, "Accedian Networks" },

5541 { 0x0015AE, "kyung il" },

5542 { 0x0015AF, "AzureWave Technology Inc." },

5543 { 0x0015B0, "AUTOTELENET CO.,LTD" },

5544 { 0x0015B1, "Ambient Corporation" },

5545 { 0x0015B2, "Advanced Industrial Computer, Inc." },

5546 { 0x0015B3, "Caretech AB" },

5547 { 0x0015B4, "Polymap Wireless LLC" },

5548 { 0x0015B5, "CI Network Corp." },

5549 { 0x0015B6, "ShinMaywa Industries, Ltd." },

5550 { 0x0015B7, "Toshiba" },

5551 { 0x0015B8, "Tahoe" },

5552 { 0x0015B9, "Samsung Electronics Co.,Ltd" },

5553 { 0x0015BA, "iba AG" },

5554 { 0x0015BB, "SMA Solar Technology AG" },

5555 { 0x0015BC, "Develco" },

5556 { 0x0015BD, "Group 4 Technology Ltd" },

5557 { 0x0015BE, "Iqua Ltd." },

5558 { 0x0015BF, "technicob" },

5559 { 0x0015C0, "DIGITAL TELEMEDIA CO.,LTD." },

5560 { 0x0015C1, "Sony Interactive Entertainment Inc." },

5561 { 0x0015C2, "3M Germany" },

5562 { 0x0015C3, "Ruf Telematik AG" },

5563 { 0x0015C4, "FLOVEL CO., LTD." },

5564 { 0x0015C5, "Dell Inc." },

5565 { 0x0015C6, "Cisco Systems, Inc" },

5566 { 0x0015C7, "Cisco Systems, Inc" },

5567 { 0x0015C8, "FlexiPanel Ltd" },

5568 { 0x0015C9, "Gumstix, Inc" },

5569 { 0x0015CA, "TeraRecon, Inc." },

5570 { 0x0015CB, "Surf Communication Solutions Ltd." },

5571 { 0x0015CC, "UQUEST, LTD." },

5572 { 0x0015CD, "Exartech International Corp." },

5573 { 0x0015CE, "ARRIS Group, Inc." },

5574 { 0x0015CF, "ARRIS Group, Inc." },

5575 { 0x0015D0, "ARRIS Group, Inc." },

5576 { 0x0015D1, "ARRIS Group, Inc." },

5577 { 0x0015D2, "Xantech Corporation" },

5578 { 0x0015D3, "Pantech&Curitel Communications, Inc." },

5579 { 0x0015D4, "Emitor AB" },

5580 { 0x0015D5, "NICEVT" },

5581 { 0x0015D6, "OSLiNK Sp. z o.o." },

5582 { 0x0015D7, "Reti Corporation" },

5583 { 0x0015D8, "Interlink Electronics" },

5584 { 0x0015D9, "PKC Electronics Oy" },

5585 { 0x0015DA, "IRITEL A.D." },

5586 { 0x0015DB, "Canesta Inc." },

5587 { 0x0015DC, "KT&C Co., Ltd." },

5588 { 0x0015DD, "IP Control Systems Ltd." },

5589 { 0x0015DE, "Nokia Danmark A/S" },

5590 { 0x0015DF, "Clivet S.p.A." },

5591 { 0x0015E0, "Ericsson" },

5592 { 0x0015E1, "Picochip Ltd" },

5593 { 0x0015E2, "Dr.Ing. Herbert Knauer GmbH" },

5594 { 0x0015E3, "Dream Technologies Corporation" },

5595 { 0x0015E4, "Zimmer Elektromedizin" },

5596 { 0x0015E5, "Cheertek Inc." },

5597 { 0x0015E6, "MOBILE TECHNIKA Inc." },

5598 { 0x0015E7, "Quantec Tontechnik" },

5599 { 0x0015E8, "Nortel Networks" },

5600 { 0x0015E9, "D-Link Corporation" },

5601 { 0x0015EA, "Tellumat (Pty) Ltd" },

5602 { 0x0015EB, "zte corporation" },

5603 { 0x0015EC, "Boca Devices LLC" },

5604 { 0x0015ED, "Fulcrum Microsystems, Inc." },

5605 { 0x0015EE, "Omnex Control Systems" },

5606 { 0x0015EF, "NEC TOKIN Corporation" },

5607 { 0x0015F0, "EGO BV" },

5608 { 0x0015F1, "KYLINK Communications Corp." },

5609 { 0x0015F2, "ASUSTek COMPUTER INC." },

5610 { 0x0015F3, "PELTOR AB" },

5611 { 0x0015F4, "Eventide" },

5612 { 0x0015F5, "Sustainable Energy Systems" },

5613 { 0x0015F6, "SCIENCE AND ENGINEERING SERVICES, INC." },

5614 { 0x0015F7, "Wintecronics Ltd." },

5615 { 0x0015F8, "Kingtronics Industrial Co. Ltd." },

5616 { 0x0015F9, "Cisco Systems, Inc" },

5617 { 0x0015FA, "Cisco Systems, Inc" },

5618 { 0x0015FB, "setex schermuly textile computer gmbh" },

5619 { 0x0015FC, "Littelfuse Startco" },

5620 { 0x0015FD, "Complete Media Systems" },

5621 { 0x0015FE, "SCHILLING ROBOTICS LLC" },

5622 { 0x0015FF, "Novatel Wireless Solutions, Inc." },

5623 { 0x001600, "CelleBrite Mobile Synchronization" },

5624 { 0x001601, "BUFFALO.INC" },

5625 { 0x001602, "CEYON TECHNOLOGY CO.,LTD." },

5626 { 0x001603, "COOLKSKY Co., LTD" },

5627 { 0x001604, "Sigpro" },

5628 { 0x001605, "YORKVILLE SOUND INC." },

5629 { 0x001606, "Ideal Industries" },

5630 { 0x001607, "Curves International Inc." },

5631 { 0x001608, "Sequans Communications" },

5632 { 0x001609, "Unitech electronics co., ltd." },

5633 { 0x00160A, "SWEEX Europe BV" },

5634 { 0x00160B, "TVWorks LLC" },

5635 { 0x00160C, "LPL DEVELOPMENT S.A. DE C.V" },

5636 { 0x00160D, "Be Here Corporation" },

5637 { 0x00160E, "Optica Technologies Inc." },

5638 { 0x00160F, "BADGER METER INC" },

5639 { 0x001610, "Carina Technology" },

5640 { 0x001611, "Altecon Srl" },

5641 { 0x001612, "Otsuka Electronics Co., Ltd." },

5642 { 0x001613, "LibreStream Technologies Inc." },

5643 { 0x001614, "Picosecond Pulse Labs" },

5644 { 0x001615, "Nittan Company, Limited" },

5645 { 0x001616, "BROWAN COMMUNICATIONS INCORPORATION" },

5646 { 0x001617, "MSI" },

5647 { 0x001618, "HIVION Co., Ltd." },

5648 { 0x001619, "Lancelan Technologies S.L." },

5649 { 0x00161A, "Dametric AB" },

5650 { 0x00161B, "Micronet Corporation" },

5651 { 0x00161C, "e:cue" },

5652 { 0x00161D, "Innovative Wireless Technologies, Inc." },

5653 { 0x00161E, "Woojinnet" },

5654 { 0x00161F, "SUNWAVETEC Co., Ltd." },

5655 { 0x001620, "Sony Corporation" },

5656 { 0x001621, "Colorado Vnet" },

5657 { 0x001622, "BBH SYSTEMS GMBH" },

5658 { 0x001623, "Interval Media" },

5659 { 0x001624, "Teneros, Inc." },

5660 { 0x001625, "Impinj, Inc." },

5661 { 0x001626, "ARRIS Group, Inc." },

5662 { 0x001627, "embedded-logic DESIGN AND MORE GmbH" },

5663 { 0x001628, "Magicard Ltd" },

5664 { 0x001629, "Nivus GmbH" },

5665 { 0x00162A, "Antik computers & communications s.r.o." },

5666 { 0x00162B, "Togami Electric Mfg.co.,Ltd." },

5667 { 0x00162C, "Xanboo" },

5668 { 0x00162D, "STNet Co., Ltd." },

5669 { 0x00162E, "Space Shuttle Hi-Tech Co., Ltd." },

5670 { 0x00162F, "Geutebrück GmbH" },

5671 { 0x001630, "Vativ Technologies" },

5672 { 0x001631, "Xteam" },

5673 { 0x001632, "Samsung Electronics Co.,Ltd" },

5674 { 0x001633, "Oxford Diagnostics Ltd." },

5675 { 0x001634, "Mathtech, Inc." },

5676 { 0x001635, "Hewlett Packard" },

5677 { 0x001636, "Quanta Computer Inc." },

5678 { 0x001637, "CITEL SpA" },

5679 { 0x001638, "TECOM Co., Ltd." },

5680 { 0x001639, "Ubiquam Co., Ltd." },

5681 { 0x00163A, "YVES TECHNOLOGY CO., LTD." },

5682 { 0x00163B, "Communications & Power Industries" },

5683 { 0x00163C, "Rebox B.V." },

5684 { 0x00163D, "Tsinghua Tongfang Legend Silicon Tech. Co., Ltd." },

5685 { 0x00163E, "Xensource, Inc." },

5686 { 0x00163F, "CReTE SYSTEMS Inc." },

5687 { 0x001640, "Asmobile Communication Inc." },

5688 { 0x001641, "Universal Global Scientific Industrial Co., Ltd." },

5689 { 0x001642, "Pangolin" },

5690 { 0x001643, "Sunhillo Corporation" },

5691 { 0x001644, "LITE-ON Technology Corp." },

5692 { 0x001645, "Power Distribution, Inc." },

5693 { 0x001646, "Cisco Systems, Inc" },

5694 { 0x001647, "Cisco Systems, Inc" },

5695 { 0x001648, "SSD Company Limited" },

5696 { 0x001649, "SetOne GmbH" },

5697 { 0x00164A, "Vibration Technology Limited" },

5698 { 0x00164B, "Quorion Data Systems GmbH" },

5699 { 0x00164C, "PLANET INT Co., Ltd" },

5700 { 0x00164D, "Alcatel-Lucent IPD" },

5701 { 0x00164E, "Nokia Danmark A/S" },

5702 { 0x00164F, "World Ethnic Broadcastin Inc." },

5703 { 0x001650, "Kratos EPD" },

5704 { 0x001651, "Exeo Systems" },

5705 { 0x001652, "Hoatech Technologies, Inc." },

5706 { 0x001653, "LEGO System A/S IE Electronics Division" },

5707 { 0x001654, "Flex-P Industries Sdn. Bhd." },

5708 { 0x001655, "FUHO TECHNOLOGY Co., LTD" },

5709 { 0x001656, "Nintendo Co., Ltd." },

5710 { 0x001657, "Aegate Ltd" },

5711 { 0x001658, "Fusiontech Technologies Inc." },

5712 { 0x001659, "Z.M.P. RADWAG" },

5713 { 0x00165A, "Harman Specialty Group" },

5714 { 0x00165B, "Grip Audio" },

5715 { 0x00165C, "Trackflow Ltd." },

5716 { 0x00165D, "AirDefense, Inc." },

5717 { 0x00165E, "Precision I/O" },

5718 { 0x00165F, "Fairmount Automation" },

5719 { 0x001660, "Nortel Networks" },

5720 { 0x001661, "Novatium Solutions (P) Ltd" },

5721 { 0x001662, "Liyuh Technology Ltd." },

5722 { 0x001663, "KBT Mobile" },

5723 { 0x001664, "Prod-El SpA" },

5724 { 0x001665, "Cellon France" },

5725 { 0x001666, "Quantier Communication Inc." },

5726 { 0x001667, "A-TEC Subsystem INC." },

5727 { 0x001668, "Eishin Electronics" },

5728 { 0x001669, "MRV Communication (Networks) LTD" },

5729 { 0x00166A, "TPS" },

5730 { 0x00166B, "Samsung Electronics Co.,Ltd" },

5731 { 0x00166C, "Samsung Electronics Co.,Ltd" },

5732 { 0x00166D, "Yulong Computer Telecommunication Scientific (Shenzhen) Co.,Ltd" },

5733 { 0x00166E, "Arbitron Inc." },

5734 { 0x00166F, "Intel Corporate" },

5735 { 0x001670, "SKNET Corporation" },

5736 { 0x001671, "Symphox Information Co." },

5737 { 0x001672, "Zenway enterprise ltd" },

5738 { 0x001673, "Bury GmbH & Co. KG" },

5739 { 0x001674, "EuroCB (Phils.), Inc." },

5740 { 0x001675, "ARRIS Group, Inc." },

5741 { 0x001676, "Intel Corporate" },

5742 { 0x001677, "Bihl + Wiedemann GmbH" },

5743 { 0x001678, "SHENZHEN BAOAN GAOKE ELECTRONICS CO., LTD" },

5744 { 0x001679, "eOn Communications" },

5745 { 0x00167A, "Skyworth Overseas Development Ltd." },

5746 { 0x00167B, "Haver&Boecker" },

5747 { 0x00167C, "iRex Technologies BV" },

5748 { 0x00167D, "Sky-Line Information Co., Ltd." },

5749 { 0x00167E, "DIBOSS.CO.,LTD" },

5750 { 0x00167F, "Bluebird Soft Inc." },

5751 { 0x001680, "Bally Gaming + Systems" },

5752 { 0x001681, "Vector Informatik GmbH" },

5753 { 0x001682, "OMS Motion" },

5754 { 0x001683, "WEBIO International Co.,.Ltd." },

5755 { 0x001684, "Donjin Co.,Ltd." },

5756 { 0x001685, "Elisa Oyj" },

5757 { 0x001686, "Karl Storz Imaging" },

5758 { 0x001687, "Chubb CSC-Vendor AP" },

5759 { 0x001688, "ServerEngines LLC" },

5760 { 0x001689, "Pilkor Electronics Co., Ltd" },

5761 { 0x00168A, "id-Confirm Inc" },

5762 { 0x00168B, "Paralan Corporation" },

5763 { 0x00168C, "DSL Partner AS" },

5764 { 0x00168D, "KORWIN CO., Ltd." },

5765 { 0x00168E, "Vimicro corporation" },

5766 { 0x00168F, "GN Netcom A/S" },

5767 { 0x001690, "J-TEK INCORPORATION" },

5768 { 0x001691, "Moser-Baer AG" },

5769 { 0x001692, "Scientific-Atlanta, Inc." },

5770 { 0x001693, "PowerLink Technology Inc." },

5771 { 0x001694, "Sennheiser Communications A/S" },

5772 { 0x001695, "AVC Technology (International) Limited" },

5773 { 0x001696, "QDI Technology (H.K.) Limited" },

5774 { 0x001697, "NEC Corporation" },

5775 { 0x001698, "T&A Mobile Phones" },

5776 { 0x001699, "Tonic DVB Marketing Ltd" },

5777 { 0x00169A, "Quadrics Ltd" },

5778 { 0x00169B, "Alstom Transport" },

5779 { 0x00169C, "Cisco Systems, Inc" },

5780 { 0x00169D, "Cisco Systems, Inc" },

5781 { 0x00169E, "TV One Ltd" },

5782 { 0x00169F, "Vimtron Electronics Co., Ltd." },

5783 { 0x0016A0, "Auto-Maskin" },

5784 { 0x0016A1, "3Leaf Networks" },

5785 { 0x0016A2, "CentraLite Systems, Inc." },

5786 { 0x0016A3, "INGETEAM" },

5787 { 0x0016A4, "Ezurio Ltd" },

5788 { 0x0016A5, "Tandberg Storage ASA" },

5789 { 0x0016A6, "Dovado FZ-LLC" },

5790 { 0x0016A7, "AWETA G&P" },

5791 { 0x0016A8, "CWT CO., LTD." },

5792 { 0x0016A9, "2EI" },

5793 { 0x0016AA, "Kei Communication Technology Inc." },

5794 { 0x0016AB, "Dansensor A/S" },

5795 { 0x0016AC, "Toho Technology Corp." },

5796 { 0x0016AD, "BT-Links Company Limited" },

5797 { 0x0016AE, "INVENTEL" },

5798 { 0x0016AF, "Shenzhen Union Networks Equipment Co.,Ltd." },

5799 { 0x0016B0, "VK Corporation" },

5800 { 0x0016B1, "KBS" },

5801 { 0x0016B2, "DriveCam Inc" },

5802 { 0x0016B3, "Photonicbridges (China) Co., Ltd." },

5803 { 0x0016B4, "Private" },

5804 { 0x0016B5, "ARRIS Group, Inc." },

5805 { 0x0016B6, "Cisco-Linksys, LLC" },

5806 { 0x0016B7, "Seoul Commtech" },

5807 { 0x0016B8, "Sony Corporation" },

5808 { 0x0016B9, "ProCurve Networking by HP" },

5809 { 0x0016BA, "WEATHERNEWS INC." },

5810 { 0x0016BB, "Law-Chain Computer Technology Co Ltd" },

5811 { 0x0016BC, "Nokia Danmark A/S" },

5812 { 0x0016BD, "ATI Industrial Automation" },

5813 { 0x0016BE, "INFRANET, Inc." },

5814 { 0x0016BF, "PaloDEx Group Oy" },

5815 { 0x0016C0, "Semtech Corporation" },

5816 { 0x0016C1, "Eleksen Ltd" },

5817 { 0x0016C2, "Avtec Systems Inc" },

5818 { 0x0016C3, "BA Systems Inc" },

5819 { 0x0016C4, "SiRF Technology, Inc." },

5820 { 0x0016C5, "Shenzhen Xing Feng Industry Co.,Ltd" },

5821 { 0x0016C6, "North Atlantic Industries" },

5822 { 0x0016C7, "Cisco Systems, Inc" },

5823 { 0x0016C8, "Cisco Systems, Inc" },

5824 { 0x0016C9, "NAT Seattle, Inc." },

5825 { 0x0016CA, "Nortel Networks" },

5826 { 0x0016CB, "Apple, Inc." },

5827 { 0x0016CC, "Xcute Mobile Corp." },

5828 { 0x0016CD, "HIJI HIGH-TECH CO., LTD." },

5829 { 0x0016CE, "Hon Hai Precision Ind. Co.,Ltd." },

5830 { 0x0016CF, "Hon Hai Precision Ind. Co.,Ltd." },

5831 { 0x0016D0, "ATech elektronika d.o.o." },

5832 { 0x0016D1, "ZAT a.s." },

5833 { 0x0016D2, "Caspian" },

5834 { 0x0016D3, "Wistron Corporation" },

5835 { 0x0016D4, "Compal Communications, Inc." },

5836 { 0x0016D5, "Synccom Co., Ltd" },

5837 { 0x0016D6, "TDA Tech Pty Ltd" },

5838 { 0x0016D7, "Sunways AG" },

5839 { 0x0016D8, "Senea AB" },

5840 { 0x0016D9, "NINGBO BIRD CO.,LTD." },

5841 { 0x0016DA, "Futronic Technology Co. Ltd." },

5842 { 0x0016DB, "Samsung Electronics Co.,Ltd" },

5843 { 0x0016DC, "ARCHOS" },

5844 { 0x0016DD, "Gigabeam Corporation" },

5845 { 0x0016DE, "FAST Inc" },

5846 { 0x0016DF, "Lundinova AB" },

5847 { 0x0016E0, "3Com Ltd" },

5848 { 0x0016E1, "SiliconStor, Inc." },

5849 { 0x0016E2, "American Fibertek, Inc." },

5850 { 0x0016E3, "ASKEY COMPUTER CORP" },

5851 { 0x0016E4, "VANGUARD SECURITY ENGINEERING CORP." },

5852 { 0x0016E5, "FORDLEY DEVELOPMENT LIMITED" },

5853 { 0x0016E6, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

5854 { 0x0016E7, "Dynamix Promotions Limited" },

5855 { 0x0016E8, "Lumissil Microsystems" },

5856 { 0x0016E9, "Tiba Medical Inc" },

5857 { 0x0016EA, "Intel Corporate" },

5858 { 0x0016EB, "Intel Corporate" },

5859 { 0x0016EC, "Elitegroup Computer Systems Co.,Ltd." },

5860 { 0x0016ED, "Utility, Inc" },

5861 { 0x0016EE, "Royaldigital Inc." },

5862 { 0x0016EF, "Koko Fitness, Inc." },

5863 { 0x0016F0, "Dell" },

5864 { 0x0016F1, "OmniSense, LLC" },

5865 { 0x0016F2, "Dmobile System Co., Ltd." },

5866 { 0x0016F3, "CAST Information Co., Ltd" },

5867 { 0x0016F4, "Eidicom Co., Ltd." },

5868 { 0x0016F5, "Dalian Golden Hualu Digital Technology Co.,Ltd" },

5869 { 0x0016F6, "Nevion" },

5870 { 0x0016F7, "L-3 Communications, Aviation Recorders" },

5871 { 0x0016F8, "AVIQTECH TECHNOLOGY CO., LTD." },

5872 { 0x0016F9, "CETRTA POT, d.o.o., Kranj" },

5873 { 0x0016FA, "ECI Telecom Ltd." },

5874 { 0x0016FB, "SHENZHEN MTC CO LTD" },

5875 { 0x0016FC, "TOHKEN CO.,LTD." },

5876 { 0x0016FD, "Jaty Electronics" },

5877 { 0x0016FE, "ALPSALPINE CO,.LTD" },

5878 { 0x0016FF, "Wamin Optocomm Mfg Corp" },

5879 { 0x001700, "ARRIS Group, Inc." },

5880 { 0x001701, "KDE, Inc." },

5881 { 0x001702, "Osung Midicom Co., Ltd" },

5882 { 0x001703, "MOSDAN Internation Co.,Ltd" },

5883 { 0x001704, "Shinco Electronics Group Co.,Ltd" },

5884 { 0x001705, "Methode Electronics" },

5885 { 0x001706, "Techfaithwireless Communication Technology Limited." },

5886 { 0x001707, "InGrid, Inc" },

5887 { 0x001708, "Hewlett Packard" },

5888 { 0x001709, "Exalt Communications" },

5889 { 0x00170A, "INEW DIGITAL COMPANY" },

5890 { 0x00170B, "Contela, Inc." },

5891 { 0x00170C, "Twig Com Ltd." },

5892 { 0x00170D, "Dust Networks Inc." },

5893 { 0x00170E, "Cisco Systems, Inc" },

5894 { 0x00170F, "Cisco Systems, Inc" },

5895 { 0x001710, "Casa Systems Inc." },

5896 { 0x001711, "Cytiva Sweden AB" },

5897 { 0x001712, "ISCO International" },

5898 { 0x001713, "Tiger NetCom" },

5899 { 0x001714, "BR Controls Nederland bv" },

5900 { 0x001715, "Qstik" },

5901 { 0x001716, "Qno Technology Inc." },

5902 { 0x001717, "Leica Geosystems AG" },

5903 { 0x001718, "Vansco Electronics Oy" },

5904 { 0x001719, "Audiocodes USA, Inc" },

5905 { 0x00171A, "Winegard Company" },

5906 { 0x00171B, "Innovation Lab Corp." },

5907 { 0x00171C, "NT MicroSystems, Inc." },

5908 { 0x00171D, "DIGIT" },

5909 { 0x00171E, "Theo Benning GmbH & Co. KG" },

5910 { 0x00171F, "IMV Corporation" },

5911 { 0x001720, "Image Sensing Systems, Inc." },

5912 { 0x001721, "FITRE S.p.A." },

5913 { 0x001722, "Hanazeder Electronic GmbH" },

5914 { 0x001723, "Summit Data Communications" },

5915 { 0x001724, "Studer Professional Audio GmbH" },

5916 { 0x001725, "Liquid Computing" },

5917 { 0x001726, "m2c Electronic Technology Ltd." },

5918 { 0x001727, "Thermo Ramsey Italia s.r.l." },

5919 { 0x001728, "Selex Communications" },

5920 { 0x001729, "Ubicod Co.LTD" },

5921 { 0x00172A, "Proware Technology Corp.(By Unifosa)" },

5922 { 0x00172B, "Global Technologies Inc." },

5923 { 0x00172C, "TAEJIN INFOTECH" },

5924 { 0x00172D, "Axcen Photonics Corporation" },

5925 { 0x00172E, "FXC Inc." },

5926 { 0x00172F, "NeuLion Incorporated" },

5927 { 0x001730, "Automation Electronics" },

5928 { 0x001731, "ASUSTek COMPUTER INC." },

5929 { 0x001732, "Science-Technical Center RISSA" },

5930 { 0x001733, "SFR" },

5931 { 0x001734, "ADC Telecommunications" },

5932 { 0x001735, "Intel Wireless Network Group" },

5933 { 0x001736, "iiTron Inc." },

5934 { 0x001737, "Industrie Dial Face S.p.A." },

5935 { 0x001738, "International Business Machines" },

5936 { 0x001739, "Bright Headphone Electronics Company" },

5937 { 0x00173A, "Cloudastructure Inc" },

5938 { 0x00173B, "Cisco Systems, Inc" },

5939 { 0x00173C, "Extreme Engineering Solutions" },

5940 { 0x00173D, "Neology" },

5941 { 0x00173E, "LeucotronEquipamentos Ltda." },

5942 { 0x00173F, "Belkin International Inc." },

5943 { 0x001740, "Bluberi Gaming Technologies Inc" },

5944 { 0x001741, "DEFIDEV" },

5945 { 0x001742, "FUJITSU LIMITED" },

5946 { 0x001743, "Deck Srl" },

5947 { 0x001744, "Araneo Ltd." },

5948 { 0x001745, "INNOTZ CO., Ltd" },

5949 { 0x001746, "Freedom9 Inc." },

5950 { 0x001747, "Trimble" },

5951 { 0x001748, "Neokoros Brasil Ltda" },

5952 { 0x001749, "HYUNDAE YONG-O-SA CO.,LTD" },

5953 { 0x00174A, "SOCOMEC" },

5954 { 0x00174B, "Nokia Danmark A/S" },

5955 { 0x00174C, "Millipore" },

5956 { 0x00174D, "DYNAMIC NETWORK FACTORY, INC." },

5957 { 0x00174E, "Parama-tech Co.,Ltd." },

5958 { 0x00174F, "iCatch Inc." },

5959 { 0x001750, "GSI Group, MicroE Systems" },

5960 { 0x001751, "Online Corporation" },

5961 { 0x001752, "DAGS, Inc" },

5962 { 0x001753, "nFore Technology Inc." },

5963 { 0x001754, "Arkino HiTOP Corporation Limited" },

5964 { 0x001755, "GE Security" },

5965 { 0x001756, "Vinci Labs Oy" },

5966 { 0x001757, "RIX TECHNOLOGY LIMITED" },

5967 { 0x001758, "ThruVision Ltd" },

5968 { 0x001759, "Cisco Systems, Inc" },

5969 { 0x00175A, "Cisco Systems, Inc" },

5970 { 0x00175B, "ACS Solutions Switzerland Ltd." },

5971 { 0x00175C, "SHARP CORPORATION" },

5972 { 0x00175D, "Dongseo system." },

5973 { 0x00175E, "Zed-3" },

5974 { 0x00175F, "XENOLINK Communications Co., Ltd." },

5975 { 0x001760, "Naito Densei Machida MFG.CO.,LTD" },

5976 { 0x001761, "Private" },

5977 { 0x001762, "Solar Technology, Inc." },

5978 { 0x001763, "Essentia S.p.A." },

5979 { 0x001764, "ATMedia GmbH" },

5980 { 0x001765, "Nortel Networks" },

5981 { 0x001766, "Accense Technology, Inc." },

5982 { 0x001767, "Earforce AS" },

5983 { 0x001768, "Zinwave Ltd" },

5984 { 0x001769, "Cymphonix Corp" },

5985 { 0x00176A, "Avago Technologies" },

5986 { 0x00176B, "Kiyon, Inc." },

5987 { 0x00176C, "Pivot3, Inc." },

5988 { 0x00176D, "CORE CORPORATION" },

5989 { 0x00176E, "DUCATI SISTEMI" },

5990 { 0x00176F, "PAX Computer Technology(Shenzhen) Ltd." },

5991 { 0x001770, "Arti Industrial Electronics Ltd." },

5992 { 0x001771, "APD Communications Ltd" },

5993 { 0x001772, "ASTRO Strobel Kommunikationssysteme GmbH" },

5994 { 0x001773, "Laketune Technologies Co. Ltd" },

5995 { 0x001774, "Elesta GmbH" },

5996 { 0x001775, "TTE Germany GmbH" },

5997 { 0x001776, "Meso Scale Diagnostics, LLC" },

5998 { 0x001777, "Obsidian Research Corporation" },

5999 { 0x001778, "Central Music Co." },

6000 { 0x001779, "QuickTel" },

6001 { 0x00177A, "ASSA ABLOY AB" },

6002 { 0x00177B, "Azalea Networks inc" },

6003 { 0x00177C, "Smartlink Network Systems Limited" },

6004 { 0x00177D, "IDT Technology Limited" },

6005 { 0x00177E, "Meshcom Technologies Inc." },

6006 { 0x00177F, "Worldsmart Retech" },

6007 { 0x001780, "Applied Biosystems B.V." },

6008 { 0x001781, "Greystone Data System, Inc." },

6009 { 0x001782, "LoBenn Inc." },

6010 { 0x001783, "Texas Instruments" },

6011 { 0x001784, "ARRIS Group, Inc." },

6012 { 0x001785, "Sparr Electronics Ltd" },

6013 { 0x001786, "wisembed" },

6014 { 0x001787, "Brother, Brother & Sons ApS" },

6015 { 0x001788, "Philips Lighting BV" },

6016 { 0x001789, "Zenitron Corporation" },

6017 { 0x00178A, "DARTS TECHNOLOGIES CORP." },

6018 { 0x00178B, "Teledyne Technologies Incorporated" },

6019 { 0x00178C, "Independent Witness, Inc" },

6020 { 0x00178D, "Checkpoint Systems, Inc." },

6021 { 0x00178E, "Gunnebo Cash Automation AB" },

6022 { 0x00178F, "NINGBO YIDONG ELECTRONIC CO.,LTD." },

6023 { 0x001790, "HYUNDAI DIGITECH Co, Ltd." },

6024 { 0x001791, "LinTech GmbH" },

6025 { 0x001792, "Falcom Wireless Comunications Gmbh" },

6026 { 0x001793, "Tigi Corporation" },

6027 { 0x001794, "Cisco Systems, Inc" },

6028 { 0x001795, "Cisco Systems, Inc" },

6029 { 0x001796, "Rittmeyer AG" },

6030 { 0x001797, "Telsy Elettronica S.p.A." },

6031 { 0x001798, "Azonic Technology Co., LTD" },

6032 { 0x001799, "SmarTire Systems Inc." },

6033 { 0x00179A, "D-Link Corporation" },

6034 { 0x00179B, "CHANT SINCERE CO.,LTD" },

6035 { 0x00179C, "DEPRAG SCHULZ GMBH u. CO." },

6036 { 0x00179D, "Kelman Limited" },

6037 { 0x00179E, "Sirit Inc" },

6038 { 0x00179F, "Apricorn" },

6039 { 0x0017A0, "RoboTech srl" },

6040 { 0x0017A1, "3soft inc." },

6041 { 0x0017A2, "Camrivox Ltd." },

6042 { 0x0017A3, "MIX s.r.l." },

6043 { 0x0017A4, "Hewlett Packard" },

6044 { 0x0017A5, "Ralink Technology Corp" },

6045 { 0x0017A6, "YOSIN ELECTRONICS CO., LTD." },

6046 { 0x0017A7, "Mobile Computing Promotion Consortium" },

6047 { 0x0017A8, "EDM Corporation" },

6048 { 0x0017A9, "Sentivision" },

6049 { 0x0017AA, "elab-experience inc." },

6050 { 0x0017AB, "Nintendo Co., Ltd." },

6051 { 0x0017AC, "O'Neil Product Development Inc." },

6052 { 0x0017AD, "AceNet Corporation" },

6053 { 0x0017AE, "GAI-Tronics" },

6054 { 0x0017AF, "Enermet" },

6055 { 0x0017B0, "Nokia Danmark A/S" },

6056 { 0x0017B1, "ACIST Medical Systems, Inc." },

6057 { 0x0017B2, "SK Telesys" },

6058 { 0x0017B3, "Aftek Infosys Limited" },

6059 { 0x0017B4, "Remote Security Systems, LLC" },

6060 { 0x0017B5, "Peerless Systems Corporation" },

6061 { 0x0017B6, "Aquantia Corporation" },

6062 { 0x0017B7, "Tonze Technology Co." },

6063 { 0x0017B8, "NOVATRON CO., LTD." },

6064 { 0x0017B9, "Gambro Lundia AB" },

6065 { 0x0017BA, "SEDO CO., LTD." },

6066 { 0x0017BB, "Syrinx Industrial Electronics" },

6067 { 0x0017BC, "Touchtunes Music Corporation" },

6068 { 0x0017BD, "Tibetsystem" },

6069 { 0x0017BE, "Tratec Telecom B.V." },

6070 { 0x0017BF, "Coherent Research Limited" },

6071 { 0x0017C0, "PureTech Systems, Inc." },

6072 { 0x0017C1, "CM Precision Technology LTD." },

6073 { 0x0017C2, "ADB Broadband Italia" },

6074 { 0x0017C3, "KTF Technologies Inc." },

6075 { 0x0017C4, "Quanta Microsystems, INC." },

6076 { 0x0017C5, "SonicWALL" },

6077 { 0x0017C6, "Cross Match Technologies Inc" },

6078 { 0x0017C7, "MARA Systems Consulting AB" },

6079 { 0x0017C8, "KYOCERA Display Corporation" },

6080 { 0x0017C9, "Samsung Electronics Co.,Ltd" },

6081 { 0x0017CA, "Qisda Corporation" },

6082 { 0x0017CB, "Juniper Networks" },

6083 { 0x0017CC, "Alcatel-Lucent" },

6084 { 0x0017CD, "CEC Wireless R&D Ltd." },

6085 { 0x0017CE, "Screen Service Spa" },

6086 { 0x0017CF, "iMCA-GmbH" },

6087 { 0x0017D0, "Opticom Communications, LLC" },

6088 { 0x0017D1, "Nortel Networks" },

6089 { 0x0017D2, "THINLINX PTY LTD" },

6090 { 0x0017D3, "Etymotic Research, Inc." },

6091 { 0x0017D4, "Monsoon Multimedia, Inc" },

6092 { 0x0017D5, "Samsung Electronics Co.,Ltd" },

6093 { 0x0017D6, "Bluechips Microhouse Co.,Ltd." },

6094 { 0x0017D7, "ION Geophysical Corporation Inc." },

6095 { 0x0017D8, "Magnum Semiconductor, Inc." },

6096 { 0x0017D9, "AAI Corporation" },

6097 { 0x0017DA, "Spans Logic" },

6098 { 0x0017DB, "CANKO TECHNOLOGIES INC." },

6099 { 0x0017DC, "DAEMYUNG ZERO1" },

6100 { 0x0017DD, "Clipsal Australia" },

6101 { 0x0017DE, "Advantage Six Ltd" },

6102 { 0x0017DF, "Cisco Systems, Inc" },

6103 { 0x0017E0, "Cisco Systems, Inc" },

6104 { 0x0017E1, "DACOS Technologies Co., Ltd." },

6105 { 0x0017E2, "ARRIS Group, Inc." },

6106 { 0x0017E3, "Texas Instruments" },

6107 { 0x0017E4, "Texas Instruments" },

6108 { 0x0017E5, "Texas Instruments" },

6109 { 0x0017E6, "Texas Instruments" },

6110 { 0x0017E7, "Texas Instruments" },

6111 { 0x0017E8, "Texas Instruments" },

6112 { 0x0017E9, "Texas Instruments" },

6113 { 0x0017EA, "Texas Instruments" },

6114 { 0x0017EB, "Texas Instruments" },

6115 { 0x0017EC, "Texas Instruments" },

6116 { 0x0017ED, "WooJooIT Ltd." },

6117 { 0x0017EE, "ARRIS Group, Inc." },

6118 { 0x0017EF, "IBM Corp" },

6119 { 0x0017F0, "SZCOM Broadband Network Technology Co.,Ltd" },

6120 { 0x0017F1, "Renu Electronics Pvt Ltd" },

6121 { 0x0017F2, "Apple, Inc." },

6122 { 0x0017F3, "Harris Corporation" },

6123 { 0x0017F4, "ZERON ALLIANCE" },

6124 { 0x0017F5, "LIG NEOPTEK" },

6125 { 0x0017F6, "Pyramid Meriden Inc." },

6126 { 0x0017F7, "CEM Solutions Pvt Ltd" },

6127 { 0x0017F8, "Motech Industries Inc." },

6128 { 0x0017F9, "Forcom Sp. z o.o." },

6129 { 0x0017FA, "Microsoft Corporation" },

6130 { 0x0017FB, "FA" },

6131 { 0x0017FC, "Suprema Inc." },

6132 { 0x0017FD, "Amulet Hotkey" },

6133 { 0x0017FE, "TALOS SYSTEM INC." },

6134 { 0x0017FF, "PLAYLINE Co.,Ltd." },

6135 { 0x001800, "UNIGRAND LTD" },

6136 { 0x001801, "Actiontec Electronics, Inc" },

6137 { 0x001802, "Alpha Networks Inc." },

6138 { 0x001803, "ArcSoft Shanghai Co. LTD" },

6139 { 0x001804, "E-TEK DIGITAL TECHNOLOGY LIMITED" },

6140 { 0x001805, "Beijing InHand Networking Technology Co.,Ltd." },

6141 { 0x001806, "Hokkei Industries Co., Ltd." },

6142 { 0x001807, "Fanstel Corp." },

6143 { 0x001808, "SightLogix, Inc." },

6144 { 0x001809, "CRESYN" },

6145 { 0x00180A, "Cisco Meraki" },

6146 { 0x00180B, "Brilliant Telecommunications" },

6147 { 0x00180C, "DZS Inc." },

6148 { 0x00180D, "Terabytes Server Storage Tech Corp" },

6149 { 0x00180E, "Avega Systems" },

6150 { 0x00180F, "Nokia Danmark A/S" },

6151 { 0x001810, "IPTrade S.A." },

6152 { 0x001811, "Neuros Technology International, LLC." },

6153 { 0x001812, "Beijing Xinwei Telecom Technology Co., Ltd." },

6154 { 0x001813, "Sony Corporation" },

6155 { 0x001814, "Mitutoyo Corporation" },

6156 { 0x001815, "GZ Technologies, Inc." },

6157 { 0x001816, "Ubixon Co., Ltd." },

6158 { 0x001817, "D. E. Shaw Research, LLC" },

6159 { 0x001818, "Cisco Systems, Inc" },

6160 { 0x001819, "Cisco Systems, Inc" },

6161 { 0x00181A, "AVerMedia Information Inc." },

6162 { 0x00181B, "TaiJin Metal Co., Ltd." },

6163 { 0x00181C, "VITEC" },

6164 { 0x00181D, "ASIA ELECTRONICS CO.,LTD" },

6165 { 0x00181E, "GDX Technologies Ltd." },

6166 { 0x00181F, "Palmmicro Communications" },

6167 { 0x001820, "w5networks" },

6168 { 0x001821, "SINDORICOH" },

6169 { 0x001822, "CEC TELECOM CO.,LTD." },

6170 { 0x001823, "Delta Electronics, Inc." },

6171 { 0x001824, "Kimaldi Electronics, S.L." },

6172 { 0x001825, "Private" },

6173 { 0x001826, "Cale Access AB" },

6174 { 0x001827, "NEC UNIFIED SOLUTIONS NEDERLAND B.V." },

6175 { 0x001828, "e2v technologies (UK) ltd." },

6176 { 0x001829, "Gatsometer" },

6177 { 0x00182A, "Taiwan Video & Monitor" },

6178 { 0x00182B, "Softier" },

6179 { 0x00182C, "Ascend Networks, Inc." },

6180 { 0x00182D, "Artec Design" },

6181 { 0x00182E, "XStreamHD" },

6182 { 0x00182F, "Texas Instruments" },

6183 { 0x001830, "Texas Instruments" },

6184 { 0x001831, "Texas Instruments" },

6185 { 0x001832, "Texas Instruments" },

6186 { 0x001833, "Texas Instruments" },

6187 { 0x001834, "Texas Instruments" },

6188 { 0x001835, "Thoratec / ITC" },

6189 { 0x001836, "REJ Co.,Ltd" },

6190 { 0x001837, "Universal ABIT Co., Ltd." },

6191 { 0x001838, "PanAccess Communications,Inc." },

6192 { 0x001839, "Cisco-Linksys, LLC" },

6193 { 0x00183A, "Westell Technologies Inc." },

6194 { 0x00183B, "CENITS Co., Ltd." },

6195 { 0x00183C, "Encore Software Limited" },

6196 { 0x00183D, "Vertex Link Corporation" },

6197 { 0x00183E, "Digilent, Inc" },

6198 { 0x00183F, "2Wire Inc" },

6199 { 0x001840, "3 Phoenix, Inc." },

6200 { 0x001841, "High Tech Computer Corp" },

6201 { 0x001842, "Nokia Danmark A/S" },

6202 { 0x001843, "Dawevision Ltd" },

6203 { 0x001844, "Heads Up Technologies, Inc." },

6204 { 0x001845, "Pulsar-Telecom LLC." },

6205 { 0x001846, "Crypto S.A." },

6206 { 0x001847, "AceNet Technology Inc." },

6207 { 0x001848, "Vecima Networks Inc." },

6208 { 0x001849, "nVent, Schroff GmbH" },

6209 { 0x00184A, "Catcher, Inc." },

6210 { 0x00184B, "Las Vegas Gaming, Inc." },

6211 { 0x00184C, "Bogen Communications" },

6212 { 0x00184D, "NETGEAR" },

6213 { 0x00184E, "Lianhe Technologies, Inc." },

6214 { 0x00184F, "8 Ways Technology Corp." },

6215 { 0x001850, "Secfone Kft" },

6216 { 0x001851, "SWsoft" },

6217 { 0x001852, "StorLink Semiconductors, Inc." },

6218 { 0x001853, "Atera Networks LTD." },

6219 { 0x001854, "Argard Co., Ltd" },

6220 { 0x001855, "Aeromaritime Systembau GmbH" },

6221 { 0x001856, "EyeFi, Inc" },

6222 { 0x001857, "Unilever R&D" },

6223 { 0x001858, "TagMaster AB" },

6224 { 0x001859, "Strawberry Linux Co.,Ltd." },

6225 { 0x00185A, "uControl, Inc." },

6226 { 0x00185B, "Network Chemistry, Inc" },

6227 { 0x00185C, "EDSLAB Technologies" },

6228 { 0x00185D, "TAIGUEN TECHNOLOGY (SHEN-ZHEN) CO., LTD." },

6229 { 0x00185E, "Nexterm Inc." },

6230 { 0x00185F, "TAC Inc." },

6231 { 0x001860, "SIM Technology Group Shanghai Simcom Ltd.," },

6232 { 0x001861, "Ooma, Inc." },

6233 { 0x001862, "Seagate Technology" },

6234 { 0x001863, "Veritech Electronics Limited" },

6235 { 0x001864, "Eaton Corporation" },

6236 { 0x001865, "Siemens Healthcare Diagnostics Manufacturing Ltd" },

6237 { 0x001866, "Leutron Vision" },

6238 { 0x001867, "Datalogic ADC" },

6239 { 0x001868, "Cisco SPVTG" },

6240 { 0x001869, "KINGJIM" },

6241 { 0x00186A, "Global Link Digital Technology Co,.LTD" },

6242 { 0x00186B, "Sambu Communics CO., LTD." },

6243 { 0x00186C, "Neonode AB" },

6244 { 0x00186D, "Zhenjiang Sapphire Electronic Industry CO." },

6245 { 0x00186E, "3Com Ltd" },

6246 { 0x00186F, "Setha Industria Eletronica LTDA" },

6247 { 0x001870, "E28 Shanghai Limited" },

6248 { 0x001871, "Hewlett Packard" },

6249 { 0x001872, "Expertise Engineering" },

6250 { 0x001873, "Cisco Systems, Inc" },

6251 { 0x001874, "Cisco Systems, Inc" },

6252 { 0x001875, "AnaCise Testnology Pte Ltd" },

6253 { 0x001876, "WowWee Ltd." },

6254 { 0x001877, "Amplex A/S" },

6255 { 0x001878, "Mackware GmbH" },

6256 { 0x001879, "dSys" },

6257 { 0x00187A, "Wiremold" },

6258 { 0x00187B, "4NSYS Co. Ltd." },

6259 { 0x00187C, "INTERCROSS, LLC" },

6260 { 0x00187D, "Armorlink Co .Ltd" },

6261 { 0x00187E, "RGB Spectrum" },

6262 { 0x00187F, "ZODIANET" },

6263 { 0x001880, "Maxim Integrated Products" },

6264 { 0x001881, "Buyang Electronics Industrial Co., Ltd" },

6265 { 0x001882, "HUAWEI TECHNOLOGIES CO.,LTD" },

6266 { 0x001883, "FORMOSA21 INC." },

6267 { 0x001884, "Fon Technology S.L." },

6268 { 0x001885, "Motorola Solutions Inc." },

6269 { 0x001886, "EL-TECH, INC." },

6270 { 0x001887, "Metasystem SpA" },

6271 { 0x001888, "GOTIVE a.s." },

6272 { 0x001889, "WinNet Solutions Limited" },

6273 { 0x00188A, "Infinova LLC" },

6274 { 0x00188B, "Dell Inc." },

6275 { 0x00188C, "Mobile Action Technology Inc." },

6276 { 0x00188D, "Nokia Danmark A/S" },

6277 { 0x00188E, "Ekahau, Inc." },

6278 { 0x00188F, "Montgomery Technology, Inc." },

6279 { 0x001890, "RadioCOM, s.r.o." },

6280 { 0x001891, "Zhongshan General K-mate Electronics Co., Ltd" },

6281 { 0x001892, "ads-tec GmbH" },

6282 { 0x001893, "SHENZHEN PHOTON BROADBAND TECHNOLOGY CO.,LTD" },

6283 { 0x001894, "NPCore, Inc." },

6284 { 0x001895, "Hansun Technologies Inc." },

6285 { 0x001896, "Great Well Electronic LTD" },

6286 { 0x001897, "JESS-LINK PRODUCTS Co., LTD" },

6287 { 0x001898, "KINGSTATE ELECTRONICS CORPORATION" },

6288 { 0x001899, "ShenZhen jieshun Science&Technology Industry CO,LTD." },

6289 { 0x00189A, "HANA Micron Inc." },

6290 { 0x00189B, "Thomson Inc." },

6291 { 0x00189C, "Weldex Corporation" },

6292 { 0x00189D, "Navcast Inc." },

6293 { 0x00189E, "OMNIKEY GmbH." },

6294 { 0x00189F, "Lenntek Corporation" },

6295 { 0x0018A0, "Cierma Ascenseurs" },

6296 { 0x0018A1, "Tiqit Computers, Inc." },

6297 { 0x0018A2, "XIP Technology AB" },

6298 { 0x0018A3, "ZIPPY TECHNOLOGY CORP." },

6299 { 0x0018A4, "ARRIS Group, Inc." },

6300 { 0x0018A5, "ADigit Technologies Corp." },

6301 { 0x0018A6, "Persistent Systems, LLC" },

6302 { 0x0018A7, "Yoggie Security Systems LTD." },

6303 { 0x0018A8, "AnNeal Technology Inc." },

6304 { 0x0018A9, "Ethernet Direct Corporation" },

6305 { 0x0018AA, "Protec Fire Detection plc" },

6306 { 0x0018AB, "BEIJING LHWT MICROELECTRONICS INC." },

6307 { 0x0018AC, "Shanghai Jiao Da HISYS Technology Co. Ltd." },

6308 { 0x0018AD, "NIDEC INSTRUMENTS CORPORATION" },

6309 { 0x0018AE, "TVT CO.,LTD" },

6310 { 0x0018AF, "Samsung Electronics Co.,Ltd" },

6311 { 0x0018B0, "Nortel Networks" },

6312 { 0x0018B1, "IBM Corp" },

6313 { 0x0018B2, "ADEUNIS RF" },

6314 { 0x0018B3, "TEC WizHome Co., Ltd." },

6315 { 0x0018B4, "Dawon Media Inc." },

6316 { 0x0018B5, "Magna Carta" },

6317 { 0x0018B6, "S3C, Inc." },

6318 { 0x0018B7, "D3 LED, LLC" },

6319 { 0x0018B8, "New Voice International AG" },

6320 { 0x0018B9, "Cisco Systems, Inc" },

6321 { 0x0018BA, "Cisco Systems, Inc" },

6322 { 0x0018BB, "Eliwell Controls srl" },

6323 { 0x0018BC, "ZAO NVP Bolid" },

6324 { 0x0018BD, "SHENZHEN DVBWORLD TECHNOLOGY CO., LTD." },

6325 { 0x0018BE, "ANSA Corporation" },

6326 { 0x0018BF, "Essence Technology Solution, Inc." },

6327 { 0x0018C0, "ARRIS Group, Inc." },

6328 { 0x0018C1, "Almitec Informática e Comércio" },

6329 { 0x0018C2, "Firetide, Inc" },

6330 { 0x0018C3, "CS Corporation" },

6331 { 0x0018C4, "Raba Technologies LLC" },

6332 { 0x0018C5, "Nokia Danmark A/S" },

6333 { 0x0018C6, "OPW Fuel Management Systems" },

6334 { 0x0018C7, "Real Time Automation" },

6335 { 0x0018C8, "ISONAS Inc." },

6336 { 0x0018C9, "EOps Technology Limited" },

6337 { 0x0018CA, "Viprinet GmbH" },

6338 { 0x0018CB, "Tecobest Technology Limited" },

6339 { 0x0018CC, "AXIOHM SAS" },

6340 { 0x0018CD, "Erae Electronics Industry Co., Ltd" },

6341 { 0x0018CE, "Dreamtech Co., Ltd" },

6342 { 0x0018CF, "Baldor Electric Company" },

6343 { 0x0018D0, "AtRoad, A Trimble Company" },

6344 { 0x0018D1, "Siemens Home & Office Comm. Devices" },

6345 { 0x0018D2, "High-Gain Antennas LLC" },

6346 { 0x0018D3, "TEAMCAST" },

6347 { 0x0018D4, "Unified Display Interface SIG" },

6348 { 0x0018D5, "REIGNCOM" },

6349 { 0x0018D6, "Swirlnet A/S" },

6350 { 0x0018D7, "JAVAD GNSS, Inc." },

6351 { 0x0018D8, "ARCH METER Corporation" },

6352 { 0x0018D9, "Santosha Internatonal, Inc" },

6353 { 0x0018DA, "Würth Elektronik eiSos GmbH & Co. KG" },

6354 { 0x0018DB, "EPL Technology Ltd" },

6355 { 0x0018DC, "Prostar Co., Ltd." },

6356 { 0x0018DD, "Silicondust Engineering Ltd" },

6357 { 0x0018DE, "Intel Corporate" },

6358 { 0x0018DF, "The Morey Corporation" },

6359 { 0x0018E0, "ANAVEO" },

6360 { 0x0018E1, "Verkerk Service Systemen" },

6361 { 0x0018E2, "Topdata Sistemas de Automacao Ltda" },

6362 { 0x0018E3, "Visualgate Systems, Inc." },

6363 { 0x0018E4, "YIGUANG" },

6364 { 0x0018E5, "Adhoco AG" },

6365 { 0x0018E6, "Computer Hardware Design SIA" },

6366 { 0x0018E7, "Cameo Communications, INC." },

6367 { 0x0018E8, "Hacetron Corporation" },

6368 { 0x0018E9, "Numata Corporation" },

6369 { 0x0018EA, "Alltec GmbH" },

6370 { 0x0018EB, "Blue Zen Enterprises Private Limited" },

6371 { 0x0018EC, "Welding Technology Corporation" },

6372 { 0x0018ED, "Accutech Ultrasystems Co., Ltd." },

6373 { 0x0018EE, "Videology Imaging Solutions, Inc." },

6374 { 0x0018EF, "Escape Communications, Inc." },

6375 { 0x0018F0, "JOYTOTO Co., Ltd." },

6376 { 0x0018F1, "Chunichi Denshi Co.,LTD." },

6377 { 0x0018F2, "Beijing Tianyu Communication Equipment Co., Ltd" },

6378 { 0x0018F3, "ASUSTek COMPUTER INC." },

6379 { 0x0018F4, "EO TECHNICS Co., Ltd." },

6380 { 0x0018F5, "Shenzhen Streaming Video Technology Company Limited" },

6381 { 0x0018F6, "Thomson Telecom Belgium" },

6382 { 0x0018F7, "Kameleon Technologies" },

6383 { 0x0018F8, "Cisco-Linksys, LLC" },

6384 { 0x0018F9, "VVOND, Inc." },

6385 { 0x0018FA, "Yushin Precision Equipment Co.,Ltd." },

6386 { 0x0018FB, "Compro Technology" },

6387 { 0x0018FC, "Altec Electronic AG" },

6388 { 0x0018FD, "Optimal Technologies International Inc." },

6389 { 0x0018FE, "Hewlett Packard" },

6390 { 0x0018FF, "PowerQuattro Co." },

6391 { 0x001900, "Intelliverese - DBA Voicecom" },

6392 { 0x001901, "F1MEDIA" },

6393 { 0x001902, "Cambridge Consultants Ltd" },

6394 { 0x001903, "Bigfoot Networks Inc" },

6395 { 0x001904, "WB Electronics Sp. z o.o." },

6396 { 0x001905, "SCHRACK Seconet AG" },

6397 { 0x001906, "Cisco Systems, Inc" },

6398 { 0x001907, "Cisco Systems, Inc" },

6399 { 0x001908, "Duaxes Corporation" },

6400 { 0x001909, "DEVI - Danfoss A/S" },

6401 { 0x00190A, "HASWARE INC." },

6402 { 0x00190B, "Southern Vision Systems, Inc." },

6403 { 0x00190C, "Encore Electronics, Inc." },

6404 { 0x00190D, "IEEE 1394c" },

6405 { 0x00190E, "Atech Technology Co., Ltd." },

6406 { 0x00190F, "Advansus Corp." },

6407 { 0x001910, "Knick Elektronische Messgeraete GmbH & Co. KG" },

6408 { 0x001911, "Just In Mobile Information Technologies (Shanghai) Co., Ltd." },

6409 { 0x001912, "Welcat Inc" },

6410 { 0x001913, "Chuang-Yi Network Equipment Co.Ltd." },

6411 { 0x001914, "Winix Co., Ltd" },

6412 { 0x001915, "TECOM Co., Ltd." },

6413 { 0x001916, "PayTec AG" },

6414 { 0x001917, "Posiflex Inc." },

6415 { 0x001918, "Interactive Wear AG" },

6416 { 0x001919, "ASTEL Inc." },

6417 { 0x00191A, "IRLINK" },

6418 { 0x00191B, "Sputnik Engineering AG" },

6419 { 0x00191C, "Sensicast Systems" },

6420 { 0x00191D, "Nintendo Co., Ltd." },

6421 { 0x00191E, "Beyondwiz Co., Ltd." },

6422 { 0x00191F, "Microlink communications Inc." },

6423 { 0x001920, "KUME electric Co.,Ltd." },

6424 { 0x001921, "Elitegroup Computer Systems Co.,Ltd." },

6425 { 0x001922, "CM Comandos Lineares" },

6426 { 0x001923, "Phonex Korea Co., LTD." },

6427 { 0x001924, "LBNL Engineering" },

6428 { 0x001925, "Intelicis Corporation" },

6429 { 0x001926, "BitsGen Co., Ltd." },

6430 { 0x001927, "ImCoSys Ltd" },

6431 { 0x001928, "Siemens AG, Transportation Systems" },

6432 { 0x001929, "2M2B Montadora de Maquinas Bahia Brasil LTDA" },

6433 { 0x00192A, "Antiope Associates" },

6434 { 0x00192B, "Aclara RF Systems Inc." },

6435 { 0x00192C, "ARRIS Group, Inc." },

6436 { 0x00192D, "Nokia Corporation" },

6437 { 0x00192E, "Spectral Instruments, Inc." },

6438 { 0x00192F, "Cisco Systems, Inc" },

6439 { 0x001930, "Cisco Systems, Inc" },

6440 { 0x001931, "Balluff GmbH" },

6441 { 0x001932, "Gude Systems GmbH" },

6442 { 0x001933, "Strix Systems, Inc." },

6443 { 0x001934, "TRENDON TOUCH TECHNOLOGY CORP." },

6444 { 0x001935, "DUERR DENTAL AG" },

6445 { 0x001936, "STERLITE OPTICAL TECHNOLOGIES LIMITED" },

6446 { 0x001937, "CommerceGuard AB" },

6447 { 0x001938, "UMB Communications Co., Ltd." },

6448 { 0x001939, "Gigamips" },

6449 { 0x00193A, "OESOLUTIONS" },

6450 { 0x00193B, "LigoWave" },

6451 { 0x00193C, "HighPoint Technologies Incorporated" },

6452 { 0x00193D, "GMC Guardian Mobility Corp." },

6453 { 0x00193E, "ADB Broadband Italia" },

6454 { 0x00193F, "RDI technology(Shenzhen) Co.,LTD" },

6455 { 0x001940, "Rackable Systems" },

6456 { 0x001941, "Pitney Bowes, Inc" },

6457 { 0x001942, "ON SOFTWARE INTERNATIONAL LIMITED" },

6458 { 0x001943, "Belden" },

6459 { 0x001944, "Fossil Partners, L.P." },

6460 { 0x001945, "RF COncepts, LLC" },

6461 { 0x001946, "Cianet Industria e Comercio S/A" },

6462 { 0x001947, "Cisco SPVTG" },

6463 { 0x001948, "AireSpider Networks" },

6464 { 0x001949, "TENTEL COMTECH CO., LTD." },

6465 { 0x00194A, "TESTO AG" },

6466 { 0x00194B, "Sagemcom Broadband SAS" },

6467 { 0x00194C, "Fujian Stelcom information & Technology CO.,Ltd" },

6468 { 0x00194D, "Avago Technologies Sdn Bhd" },

6469 { 0x00194E, "Ultra Electronics - TCS (Tactical Communication Systems)" },

6470 { 0x00194F, "Nokia Danmark A/S" },

6471 { 0x001950, "Harman Multimedia" },

6472 { 0x001951, "NETCONS, s.r.o." },

6473 { 0x001952, "ACOGITO Co., Ltd" },

6474 { 0x001953, "Chainleader Communications Corp." },

6475 { 0x001954, "Leaf Corporation." },

6476 { 0x001955, "Cisco Systems, Inc" },

6477 { 0x001956, "Cisco Systems, Inc" },

6478 { 0x001957, "Saafnet Canada Inc." },

6479 { 0x001958, "Bluetooth SIG, Inc." },

6480 { 0x001959, "Staccato Communications Inc." },

6481 { 0x00195A, "Jenaer Antriebstechnik GmbH" },

6482 { 0x00195B, "D-Link Corporation" },

6483 { 0x00195C, "Innotech Corporation" },

6484 { 0x00195D, "ShenZhen XinHuaTong Opto Electronics Co.,Ltd" },

6485 { 0x00195E, "ARRIS Group, Inc." },

6486 { 0x00195F, "Valemount Networks Corporation" },

6487 { 0x001960, "DoCoMo Systems, Inc." },

6488 { 0x001961, "Blaupunkt Embedded Systems GmbH" },

6489 { 0x001962, "Commerciant, LP" },

6490 { 0x001963, "Sony Corporation" },

6491 { 0x001964, "Doorking Inc." },

6492 { 0x001965, "YuHua TelTech (ShangHai) Co., Ltd." },

6493 { 0x001966, "Asiarock Technology Limited" },

6494 { 0x001967, "TELDAT Sp.J." },

6495 { 0x001968, "Digital Video Networks(Shanghai) CO. LTD." },

6496 { 0x001969, "Nortel Networks" },

6497 { 0x00196A, "MikroM GmbH" },

6498 { 0x00196B, "Danpex Corporation" },

6499 { 0x00196C, "ETROVISION TECHNOLOGY" },

6500 { 0x00196D, "Raybit Systems Korea, Inc" },

6501 { 0x00196E, "Metacom (Pty) Ltd." },

6502 { 0x00196F, "SensoPart GmbH" },

6503 { 0x001970, "Z-Com, Inc." },

6504 { 0x001971, "Guangzhou Unicomp Technology Co.,Ltd" },

6505 { 0x001972, "Plexus (Xiamen) Co.,ltd." },

6506 { 0x001973, "Zeugma Systems" },

6507 { 0x001974, "16063" },

6508 { 0x001975, "Beijing Huisen networks technology Inc" },

6509 { 0x001976, "Xipher Technologies, LLC" },

6510 { 0x001977, "Extreme Networks Headquarters" },

6511 { 0x001978, "Datum Systems, Inc." },

6512 { 0x001979, "Nokia Danmark A/S" },

6513 { 0x00197A, "MAZeT GmbH" },

6514 { 0x00197B, "Picotest Corp." },

6515 { 0x00197C, "Riedel Communications GmbH" },

6516 { 0x00197D, "Hon Hai Precision Ind. Co.,Ltd." },

6517 { 0x00197E, "Hon Hai Precision Ind. Co.,Ltd." },

6518 { 0x00197F, "PLANTRONICS, INC." },

6519 { 0x001980, "Gridpoint Systems" },

6520 { 0x001981, "Vivox Inc" },

6521 { 0x001982, "SmarDTV Corporation" },

6522 { 0x001983, "CCT R&D Limited" },

6523 { 0x001984, "ESTIC Corporation" },

6524 { 0x001985, "IT Watchdogs, Inc" },

6525 { 0x001986, "Cheng Hongjian" },

6526 { 0x001987, "Panasonic Mobile Communications Co.,Ltd." },

6527 { 0x001988, "Wi2Wi, Inc" },

6528 { 0x001989, "Sonitrol Corporation" },

6529 { 0x00198A, "Northrop Grumman Systems Corp." },

6530 { 0x00198B, "Novera Optics Korea, Inc." },

6531 { 0x00198C, "iXSea" },

6532 { 0x00198D, "Ocean Optics, Inc." },

6533 { 0x00198E, "Demant A/S" },

6534 { 0x00198F, "Nokia Bell N.V." },

6535 { 0x001990, "ELM DATA Co., Ltd." },

6536 { 0x001991, "avinfo" },

6537 { 0x001992, "Adtran Inc" },

6538 { 0x001993, "Changshu Switchgear MFG. Co.,Ltd. (Former Changshu Switchgea" },

6539 { 0x001994, "Jorjin Technologies Inc." },

6540 { 0x001995, "Jurong Hi-Tech (Suzhou)Co.ltd" },

6541 { 0x001996, "TurboChef Technologies Inc." },

6542 { 0x001997, "Soft Device Sdn Bhd" },

6543 { 0x001998, "SATO CORPORATION" },

6544 { 0x001999, "Fujitsu Technology Solutions GmbH" },

6545 { 0x00199A, "EDO-EVI" },

6546 { 0x00199B, "Diversified Technical Systems, Inc." },

6547 { 0x00199C, "CTRING" },

6548 { 0x00199D, "Vizio, Inc" },

6549 { 0x00199E, "Nifty" },

6550 { 0x00199F, "DKT A/S" },

6551 { 0x0019A0, "NIHON DATA SYSTENS, INC." },

6552 { 0x0019A1, "LG INFORMATION & COMM." },

6553 { 0x0019A2, "ORDYN TECHNOLOGIES" },

6554 { 0x0019A3, "asteel electronique atlantique" },

6555 { 0x0019A4, "Austar Technology (hang zhou) Co.,Ltd" },

6556 { 0x0019A5, "RadarFind Corporation" },

6557 { 0x0019A6, "ARRIS Group, Inc." },

6558 { 0x0019A7, "ITU-T" },

6559 { 0x0019A8, "WiQuest Communications" },

6560 { 0x0019A9, "Cisco Systems, Inc" },

6561 { 0x0019AA, "Cisco Systems, Inc" },

6562 { 0x0019AB, "Raycom CO ., LTD" },

6563 { 0x0019AC, "GSP SYSTEMS Inc." },

6564 { 0x0019AD, "BOBST SA" },

6565 { 0x0019AE, "Hopling Technologies b.v." },

6566 { 0x0019AF, "Rigol Technologies, Inc." },

6567 { 0x0019B0, "HanYang System" },

6568 { 0x0019B1, "Arrow7 Corporation" },

6569 { 0x0019B2, "XYnetsoft Co.,Ltd" },

6570 { 0x0019B3, "Stanford Research Systems" },

6571 { 0x0019B4, "Intellio Ltd" },

6572 { 0x0019B5, "Famar Fueguina S.A." },

6573 { 0x0019B6, "Euro Emme s.r.l." },

6574 { 0x0019B7, "Nokia Danmark A/S" },

6575 { 0x0019B8, "Boundary Devices" },

6576 { 0x0019B9, "Dell Inc." },

6577 { 0x0019BA, "Paradox Security Systems Ltd" },

6578 { 0x0019BB, "Hewlett Packard" },

6579 { 0x0019BC, "ELECTRO CHANCE SRL" },

6580 { 0x0019BD, "New Media Life" },

6581 { 0x0019BE, "Altai Technologies Limited" },

6582 { 0x0019BF, "Citiway technology Co.,ltd" },

6583 { 0x0019C0, "ARRIS Group, Inc." },

6584 { 0x0019C1, "ALPSALPINE CO,.LTD" },

6585 { 0x0019C2, "Equustek Solutions, Inc." },

6586 { 0x0019C3, "Qualitrol" },

6587 { 0x0019C4, "Infocrypt Inc." },

6588 { 0x0019C5, "Sony Interactive Entertainment Inc." },

6589 { 0x0019C6, "zte corporation" },

6590 { 0x0019C7, "Cambridge Industries(Group) Co.,Ltd." },

6591 { 0x0019C8, "AnyDATA Corporation" },

6592 { 0x0019C9, "S&C ELECTRIC COMPANY" },

6593 { 0x0019CA, "Broadata Communications, Inc" },

6594 { 0x0019CB, "Zyxel Communications Corporation" },

6595 { 0x0019CC, "RCG (HK) Ltd" },

6596 { 0x0019CD, "Chengdu ethercom information technology Ltd." },

6597 { 0x0019CE, "Progressive Gaming International" },

6598 { 0x0019CF, "SALICRU, S.A." },

6599 { 0x0019D0, "Cathexis" },

6600 { 0x0019D1, "Intel Corporate" },

6601 { 0x0019D2, "Intel Corporate" },

6602 { 0x0019D3, "TRAK Microwave" },

6603 { 0x0019D4, "ICX Technologies" },

6604 { 0x0019D5, "IP Innovations, Inc." },

6605 { 0x0019D6, "LS Cable and System Ltd." },

6606 { 0x0019D7, "FORTUNETEK CO., LTD" },

6607 { 0x0019D8, "MAXFOR" },

6608 { 0x0019D9, "Zeutschel GmbH" },

6609 { 0x0019DA, "Welltrans O&E Technology Co. , Ltd." },

6610 { 0x0019DB, "MICRO-STAR INTERNATIONAL CO., LTD." },

6611 { 0x0019DC, "ENENSYS Technologies" },

6612 { 0x0019DD, "FEI-Zyfer, Inc." },

6613 { 0x0019DE, "MOBITEK" },

6614 { 0x0019DF, "Thomson Inc." },

6615 { 0x0019E0, "TP-LINK TECHNOLOGIES CO.,LTD." },

6616 { 0x0019E1, "Nortel Networks" },

6617 { 0x0019E2, "Juniper Networks" },

6618 { 0x0019E3, "Apple, Inc." },

6619 { 0x0019E4, "2Wire Inc" },

6620 { 0x0019E5, "Lynx Studio Technology, Inc." },

6621 { 0x0019E6, "TOYO MEDIC CO.,LTD." },

6622 { 0x0019E7, "Cisco Systems, Inc" },

6623 { 0x0019E8, "Cisco Systems, Inc" },

6624 { 0x0019E9, "S-Information Technolgy, Co., Ltd." },

6625 { 0x0019EA, "TeraMage Technologies Co., Ltd." },

6626 { 0x0019EB, "Pyronix Ltd" },

6627 { 0x0019EC, "Sagamore Systems, Inc." },

6628 { 0x0019ED, "Axesstel Inc." },

6629 { 0x0019EE, "CARLO GAVAZZI CONTROLS SPA-Controls Division" },

6630 { 0x0019EF, "SHENZHEN LINNKING ELECTRONICS CO.,LTD" },

6631 { 0x0019F0, "UNION MAN TECHNOLOGY CO.,LTD" },

6632 { 0x0019F1, "Star Communication Network Technology Co.,Ltd" },

6633 { 0x0019F2, "Teradyne K.K." },

6634 { 0x0019F3, "Cetis, Inc" },

6635 { 0x0019F4, "Convergens Oy Ltd" },

6636 { 0x0019F5, "Imagination Technologies Ltd" },

6637 { 0x0019F6, "Acconet (PTE) Ltd" },

6638 { 0x0019F7, "Onset Computer Corporation" },

6639 { 0x0019F8, "Embedded Systems Design, Inc." },

6640 { 0x0019F9, "TDK-Lambda" },

6641 { 0x0019FA, "Cable Vision Electronics CO., LTD." },

6642 { 0x0019FB, "SKY UK LIMITED" },

6643 { 0x0019FC, "PT. Ufoakses Sukses Luarbiasa" },

6644 { 0x0019FD, "Nintendo Co., Ltd." },

6645 { 0x0019FE, "SHENZHEN SEECOMM TECHNOLOGY CO.,LTD." },

6646 { 0x0019FF, "Finnzymes" },

6647 { 0x001A00, "MATRIX INC." },

6648 { 0x001A01, "Smiths Medical" },

6649 { 0x001A02, "SECURE CARE PRODUCTS, INC" },

6650 { 0x001A03, "Angel Electronics Co., Ltd." },

6651 { 0x001A04, "Interay Solutions BV" },

6652 { 0x001A05, "OPTIBASE LTD" },

6653 { 0x001A06, "OpVista, Inc." },

6654 { 0x001A07, "Arecont Vision" },

6655 { 0x001A08, "Simoco Ltd." },

6656 { 0x001A09, "Wayfarer Transit Systems Ltd" },

6657 { 0x001A0A, "Adaptive Micro-Ware Inc." },

6658 { 0x001A0B, "BONA TECHNOLOGY INC." },

6659 { 0x001A0C, "Swe-Dish Satellite Systems AB" },

6660 { 0x001A0D, "HandHeld entertainment, Inc." },

6661 { 0x001A0E, "Cheng Uei Precision Industry Co.,Ltd" },

6662 { 0x001A0F, "ARTECHE GROUP" },

6663 { 0x001A10, "LUCENT TRANS ELECTRONICS CO.,LTD" },

6664 { 0x001A11, "Google, Inc." },

6665 { 0x001A12, "Essilor" },

6666 { 0x001A13, "Wanlida Group Co., LTD" },

6667 { 0x001A14, "Xin Hua Control Engineering Co.,Ltd." },

6668 { 0x001A15, "gemalto e-Payment" },

6669 { 0x001A16, "Nokia Danmark A/S" },

6670 { 0x001A17, "Teak Technologies, Inc." },

6671 { 0x001A18, "Advanced Simulation Technology inc." },

6672 { 0x001A19, "Computer Engineering Limited" },

6673 { 0x001A1A, "Gentex Corporation/Electro-Acoustic Products" },

6674 { 0x001A1B, "ARRIS Group, Inc." },

6675 { 0x001A1C, "GT&T Engineering Pte Ltd" },

6676 { 0x001A1D, "PChome Online Inc." },

6677 { 0x001A1E, "Aruba, a Hewlett Packard Enterprise Company" },

6678 { 0x001A1F, "Coastal Environmental Systems" },

6679 { 0x001A20, "CMOTECH Co. Ltd." },

6680 { 0x001A21, "Brookhuis Applied Technologies BV" },

6681 { 0x001A22, "eQ-3 Entwicklung GmbH" },

6682 { 0x001A23, "Ice Qube, Inc" },

6683 { 0x001A24, "Galaxy Telecom Technologies Ltd" },

6684 { 0x001A25, "DELTA DORE" },

6685 { 0x001A26, "Deltanode Solutions AB" },

6686 { 0x001A27, "Ubistar" },

6687 { 0x001A28, "ASWT Co., LTD. Taiwan Branch H.K." },

6688 { 0x001A29, "Johnson Outdoors Marine Electronics d/b/a Minnkota" },

6689 { 0x001A2A, "Arcadyan Technology Corporation" },

6690 { 0x001A2B, "Ayecom Technology Co., Ltd." },

6691 { 0x001A2C, "SATEC Co.,LTD" },

6692 { 0x001A2D, "The Navvo Group" },

6693 { 0x001A2E, "Ziova Coporation" },

6694 { 0x001A2F, "Cisco Systems, Inc" },

6695 { 0x001A30, "Cisco Systems, Inc" },

6696 { 0x001A31, "SCAN COIN AB" },

6697 { 0x001A32, "ACTIVA MULTIMEDIA" },

6698 { 0x001A33, "ASI Communications, Inc." },

6699 { 0x001A34, "Konka Group Co., Ltd." },

6700 { 0x001A35, "BARTEC GmbH" },

6701 { 0x001A36, "Aipermon GmbH & Co. KG" },

6702 { 0x001A37, "Lear Corporation" },

6703 { 0x001A38, "Sanmina-SCI" },

6704 { 0x001A39, "Merten GmbH&CoKG" },

6705 { 0x001A3A, "Dongahelecomm" },

6706 { 0x001A3B, "Doah Elecom Inc." },

6707 { 0x001A3C, "Technowave Ltd." },

6708 { 0x001A3D, "Ajin Vision Co.,Ltd" },

6709 { 0x001A3E, "Faster Technology LLC" },

6710 { 0x001A3F, "Intelbras" },

6711 { 0x001A40, "A-FOUR TECH CO., LTD." },

6712 { 0x001A41, "INOCOVA Co.,Ltd" },

6713 { 0x001A42, "Techcity Technology co., Ltd." },

6714 { 0x001A43, "Logical Link Communications" },

6715 { 0x001A44, "JWTrading Co., Ltd" },

6716 { 0x001A45, "GN Netcom A/S" },

6717 { 0x001A46, "Digital Multimedia Technology Co., Ltd" },

6718 { 0x001A47, "Agami Systems, Inc." },

6719 { 0x001A48, "Takacom Corporation" },

6720 { 0x001A49, "Micro Vision Co.,LTD" },

6721 { 0x001A4A, "Qumranet Inc." },

6722 { 0x001A4B, "Hewlett Packard" },

6723 { 0x001A4C, "Crossbow Technology, Inc" },

6724 { 0x001A4D, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

6725 { 0x001A4E, "NTI AG / LinMot" },

6726 { 0x001A4F, "AVM GmbH" },

6727 { 0x001A50, "PheeNet Technology Corp." },

6728 { 0x001A51, "Alfred Mann Foundation" },

6729 { 0x001A52, "Meshlinx Wireless Inc." },

6730 { 0x001A53, "Zylaya" },

6731 { 0x001A54, "Hip Shing Electronics Ltd." },

6732 { 0x001A55, "ACA-Digital Corporation" },

6733 { 0x001A56, "ViewTel Co,. Ltd." },

6734 { 0x001A57, "Matrix Design Group, LLC" },

6735 { 0x001A58, "CCV Deutschland GmbH - Celectronic eHealth Div." },

6736 { 0x001A59, "Ircona" },

6737 { 0x001A5A, "Korea Electric Power Data Network (KDN) Co., Ltd" },

6738 { 0x001A5B, "NetCare Service Co., Ltd." },

6739 { 0x001A5C, "Euchner GmbH+Co. KG" },

6740 { 0x001A5D, "Mobinnova Corp." },

6741 { 0x001A5E, "Thincom Technology Co.,Ltd" },

6742 { 0x001A5F, "KitWorks.fi Ltd." },

6743 { 0x001A60, "Wave Electronics Co.,Ltd." },

6744 { 0x001A61, "PacStar Corp." },

6745 { 0x001A62, "Data Robotics, Incorporated" },

6746 { 0x001A63, "Elster Solutions, LLC," },

6747 { 0x001A64, "IBM Corp" },

6748 { 0x001A65, "Seluxit" },

6749 { 0x001A66, "ARRIS Group, Inc." },

6750 { 0x001A67, "Infinite QL Sdn Bhd" },

6751 { 0x001A68, "Weltec Enterprise Co., Ltd." },

6752 { 0x001A69, "Wuhan Yangtze Optical Technology CO.,Ltd." },

6753 { 0x001A6A, "Tranzas, Inc." },

6754 { 0x001A6B, "Universal Global Scientific Industrial Co., Ltd." },

6755 { 0x001A6C, "Cisco Systems, Inc" },

6756 { 0x001A6D, "Cisco Systems, Inc" },

6757 { 0x001A6E, "Impro Technologies" },

6758 { 0x001A6F, "MI.TEL s.r.l." },

6759 { 0x001A70, "Cisco-Linksys, LLC" },

6760 { 0x001A71, "Diostech Co., Ltd." },

6761 { 0x001A72, "Mosart Semiconductor Corp." },

6762 { 0x001A73, "Gemtek Technology Co., Ltd." },

6763 { 0x001A74, "Procare International Co" },

6764 { 0x001A75, "Sony Corporation" },

6765 { 0x001A76, "SDT information Technology Co.,LTD." },

6766 { 0x001A77, "ARRIS Group, Inc." },

6767 { 0x001A78, "ubtos" },

6768 { 0x001A79, "TELECOMUNICATION TECHNOLOGIES LTD." },

6769 { 0x001A7A, "Lismore Instruments Limited" },

6770 { 0x001A7B, "Teleco, Inc." },

6771 { 0x001A7C, "Hirschmann Multimedia B.V." },

6772 { 0x001A7D, "cyber-blue(HK)Ltd" },

6773 { 0x001A7E, "LN Srithai Comm Ltd." },

6774 { 0x001A7F, "GCI Science & Technology Co.,LTD" },

6775 { 0x001A80, "Sony Corporation" },

6776 { 0x001A81, "Zelax" },

6777 { 0x001A82, "PROBA Building Automation Co.,LTD" },

6778 { 0x001A83, "Pegasus Technologies Inc." },

6779 { 0x001A84, "V One Multimedia Pte Ltd" },

6780 { 0x001A85, "NV Michel Van de Wiele" },

6781 { 0x001A86, "New Wave Design & Verification" },

6782 { 0x001A87, "Canhold International Limited" },

6783 { 0x001A88, "Venergy,Co,Ltd" },

6784 { 0x001A89, "Nokia Danmark A/S" },

6785 { 0x001A8A, "Samsung Electronics Co.,Ltd" },

6786 { 0x001A8B, "CHUNIL ELECTRIC IND., CO." },

6787 { 0x001A8C, "Sophos Ltd" },

6788 { 0x001A8D, "AVECS Bergen GmbH" },

6789 { 0x001A8E, "3Way Networks Ltd" },

6790 { 0x001A8F, "Nortel Networks" },

6791 { 0x001A90, "Trópico Sistemas e Telecomunicações da Amazônia LTDA." },

6792 { 0x001A91, "FusionDynamic Ltd." },

6793 { 0x001A92, "ASUSTek COMPUTER INC." },

6794 { 0x001A93, "ERCO Leuchten GmbH" },

6795 { 0x001A94, "Votronic GmbH" },

6796 { 0x001A95, "Hisense Mobile Communications Technoligy Co.,Ltd." },

6797 { 0x001A96, "ECLER S.A." },

6798 { 0x001A97, "fitivision technology Inc." },

6799 { 0x001A98, "Asotel Communication Limited Taiwan Branch" },

6800 { 0x001A99, "Smarty (HZ) Information Electronics Co., Ltd" },

6801 { 0x001A9A, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

6802 { 0x001A9B, "ADEC & Parter AG" },

6803 { 0x001A9C, "RightHand Technologies, Inc." },

6804 { 0x001A9D, "Skipper Wireless, Inc." },

6805 { 0x001A9E, "ICON Digital International Limited" },

6806 { 0x001A9F, "A-Link Ltd" },

6807 { 0x001AA0, "Dell Inc." },

6808 { 0x001AA1, "Cisco Systems, Inc" },

6809 { 0x001AA2, "Cisco Systems, Inc" },

6810 { 0x001AA3, "DELORME" },

6811 { 0x001AA4, "Future University-Hakodate" },

6812 { 0x001AA5, "BRN Phoenix" },

6813 { 0x001AA6, "Elbit Systems Deutschland GmbH & Co. KG" },

6814 { 0x001AA7, "Torian Wireless" },

6815 { 0x001AA8, "Mamiya Digital Imaging Co., Ltd." },

6816 { 0x001AA9, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

6817 { 0x001AAA, "Analogic Corp." },

6818 { 0x001AAB, "eWings s.r.l." },

6819 { 0x001AAC, "Corelatus AB" },

6820 { 0x001AAD, "ARRIS Group, Inc." },

6821 { 0x001AAE, "Savant Systems LLC" },

6822 { 0x001AAF, "BLUSENS TECHNOLOGY" },

6823 { 0x001AB0, "Signal Networks Pvt. Ltd.," },

6824 { 0x001AB1, "Asia Pacific Satellite Industries Co., Ltd." },

6825 { 0x001AB2, "Cyber Solutions Inc." },

6826 { 0x001AB3, "VISIONITE INC." },

6827 { 0x001AB4, "FFEI Ltd." },

6828 { 0x001AB5, "Home Network System" },

6829 { 0x001AB6, "Texas Instruments" },

6830 { 0x001AB7, "Ethos Networks LTD." },

6831 { 0x001AB8, "Anseri Corporation" },

6832 { 0x001AB9, "PMC" },

6833 { 0x001ABA, "Caton Overseas Limited" },

6834 { 0x001ABB, "Fontal Technology Incorporation" },

6835 { 0x001ABC, "U4EA Technologies Ltd" },

6836 { 0x001ABD, "Impatica Inc." },

6837 { 0x001ABE, "COMPUTER HI-TECH INC." },

6838 { 0x001ABF, "TRUMPF Laser Marking Systems AG" },

6839 { 0x001AC0, "JOYBIEN TECHNOLOGIES CO., LTD." },

6840 { 0x001AC1, "3Com Ltd" },

6841 { 0x001AC2, "YEC Co.,Ltd." },

6842 { 0x001AC3, "Scientific-Atlanta, Inc" },

6843 { 0x001AC4, "2Wire Inc" },

6844 { 0x001AC5, "Keysight Technologies, Inc." },

6845 { 0x001AC6, "Micro Control Designs" },

6846 { 0x001AC7, "UNIPOINT" },

6847 { 0x001AC8, "ISL (Instrumentation Scientifique de Laboratoire)" },

6848 { 0x001AC9, "SUZUKEN CO.,LTD" },

6849 { 0x001ACA, "Tilera Corporation" },

6850 { 0x001ACB, "Autocom Products Ltd" },

6851 { 0x001ACC, "Celestial Semiconductor, Ltd" },

6852 { 0x001ACD, "Tidel Engineering LP" },

6853 { 0x001ACE, "YUPITERU CORPORATION" },

6854 { 0x001ACF, "C.T. ELETTRONICA" },

6855 { 0x001AD0, "Albis Technologies AG" },

6856 { 0x001AD1, "FARGO CO., LTD." },

6857 { 0x001AD2, "Eletronica Nitron Ltda" },

6858 { 0x001AD3, "Vamp Ltd." },

6859 { 0x001AD4, "iPOX Technology Co., Ltd." },

6860 { 0x001AD5, "KMC CHAIN INDUSTRIAL CO., LTD." },

6861 { 0x001AD6, "JIAGNSU AETNA ELECTRIC CO.,LTD" },

6862 { 0x001AD7, "Christie Digital Systems, Inc." },

6863 { 0x001AD8, "AlsterAero GmbH" },

6864 { 0x001AD9, "International Broadband Electric Communications, Inc." },

6865 { 0x001ADA, "Biz-2-Me Inc." },

6866 { 0x001ADB, "ARRIS Group, Inc." },

6867 { 0x001ADC, "Nokia Danmark A/S" },

6868 { 0x001ADD, "PePWave Ltd" },

6869 { 0x001ADE, "ARRIS Group, Inc." },

6870 { 0x001ADF, "Interactivetv Pty Limited" },

6871 { 0x001AE0, "Mythology Tech Express Inc." },

6872 { 0x001AE1, "EDGE ACCESS INC" },

6873 { 0x001AE2, "Cisco Systems, Inc" },

6874 { 0x001AE3, "Cisco Systems, Inc" },

6875 { 0x001AE4, "Medicis Technologies Corporation" },

6876 { 0x001AE5, "Mvox Technologies Inc." },

6877 { 0x001AE6, "Atlanta Advanced Communications Holdings Limited" },

6878 { 0x001AE7, "Aztek Networks, Inc." },

6879 { 0x001AE8, "Unify Software and Solutions GmbH & Co. KG" },

6880 { 0x001AE9, "Nintendo Co., Ltd." },

6881 { 0x001AEA, "Radio Terminal Systems Pty Ltd" },

6882 { 0x001AEB, "Allied Telesis K.K." },

6883 { 0x001AEC, "Keumbee Electronics Co.,Ltd." },

6884 { 0x001AED, "INCOTEC GmbH" },

6885 { 0x001AEE, "Shenztech Ltd" },

6886 { 0x001AEF, "Loopcomm Technology, Inc." },

6887 { 0x001AF0, "Alcatel-Lucent IPD" },

6888 { 0x001AF1, "Embedded Artists AB" },

6889 { 0x001AF2, "Dynavisions Schweiz AG" },

6890 { 0x001AF3, "Samyoung Electronics" },

6891 { 0x001AF4, "Handreamnet" },

6892 { 0x001AF5, "PENTAONE. CO., LTD." },

6893 { 0x001AF6, "Woven Systems, Inc." },

6894 { 0x001AF7, "dataschalt e+a GmbH" },

6895 { 0x001AF8, "Copley Controls Corporation" },

6896 { 0x001AF9, "AeroVIronment (AV Inc)" },

6897 { 0x001AFA, "Welch Allyn, Inc." },

6898 { 0x001AFB, "Joby Inc." },

6899 { 0x001AFC, "ModusLink Corporation" },

6900 { 0x001AFD, "EVOLIS" },

6901 { 0x001AFE, "SOFACREAL" },

6902 { 0x001AFF, "Wizyoung Tech." },

6903 { 0x001B00, "Neopost Technologies" },

6904 { 0x001B01, "Applied Radio Technologies" },

6905 { 0x001B02, "ED Co.Ltd" },

6906 { 0x001B03, "Action Technology (SZ) Co., Ltd" },

6907 { 0x001B04, "Affinity International S.p.a" },

6908 { 0x001B05, "YMC AG" },

6909 { 0x001B06, "Ateliers R. LAUMONIER" },

6910 { 0x001B07, "Mendocino Software" },

6911 { 0x001B08, "Danfoss Drives A/S" },

6912 { 0x001B09, "MATRIX COMSEC PRIVATE LIMITED" },

6913 { 0x001B0A, "Intelligent Distributed Controls Ltd" },

6914 { 0x001B0B, "Phidgets Inc." },

6915 { 0x001B0C, "Cisco Systems, Inc" },

6916 { 0x001B0D, "Cisco Systems, Inc" },

6917 { 0x001B0E, "InoTec GmbH Organisationssysteme" },

6918 { 0x001B0F, "Petratec" },

6919 { 0x001B10, "ShenZhen Kang Hui Technology Co.,ltd" },

6920 { 0x001B11, "D-Link Corporation" },

6921 { 0x001B12, "Apprion" },

6922 { 0x001B13, "Icron Technologies Corporation" },

6923 { 0x001B14, "Carex Lighting Equipment Factory" },

6924 { 0x001B15, "Voxtel, Inc." },

6925 { 0x001B16, "Celtro Ltd." },

6926 { 0x001B17, "Palo Alto Networks" },

6927 { 0x001B18, "Tsuken Electric Ind. Co.,Ltd" },

6928 { 0x001B19, "IEEE I&M Society TC9" },

6929 { 0x001B1A, "e-trees Japan, Inc." },

6930 { 0x001B1B, "Siemens AG," },

6931 { 0x001B1C, "Coherent" },

6932 { 0x001B1D, "Phoenix International Co., Ltd" },

6933 { 0x001B1E, "HART Communication Foundation" },

6934 { 0x001B1F, "FORCE Technology" },

6935 { 0x001B20, "TPine Technology" },

6936 { 0x001B21, "Intel Corporate" },

6937 { 0x001B22, "Palit Microsystems ( H.K.) Ltd." },

6938 { 0x001B23, "SimpleComTools" },

6939 { 0x001B24, "Quanta Computer Inc." },

6940 { 0x001B25, "Nortel Networks" },

6941 { 0x001B26, "RON-Telecom ZAO" },

6942 { 0x001B27, "Merlin CSI" },

6943 { 0x001B28, "POLYGON, JSC" },

6944 { 0x001B29, "Avantis.Co.,Ltd" },

6945 { 0x001B2A, "Cisco Systems, Inc" },

6946 { 0x001B2B, "Cisco Systems, Inc" },

6947 { 0x001B2C, "ATRON electronic GmbH" },

6948 { 0x001B2D, "Med-Eng Systems Inc." },

6949 { 0x001B2E, "Sinkyo Electron Inc" },

6950 { 0x001B2F, "NETGEAR" },

6951 { 0x001B30, "Solitech Inc." },

6952 { 0x001B31, "Neural Image. Co. Ltd." },

6953 { 0x001B32, "QLogic Corporation" },

6954 { 0x001B33, "Nokia Danmark A/S" },

6955 { 0x001B34, "Focus System Inc." },

6956 { 0x001B35, "ChongQing JINOU Science & Technology Development CO.,Ltd" },

6957 { 0x001B36, "Tsubata Engineering Co.,Ltd. (Head Office)" },

6958 { 0x001B37, "Computec Oy" },

6959 { 0x001B38, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

6960 { 0x001B39, "Proxicast" },

6961 { 0x001B3A, "SIMS Corp." },

6962 { 0x001B3B, "Yi-Qing CO., LTD" },

6963 { 0x001B3C, "Software Technologies Group,Inc." },

6964 { 0x001B3D, "EuroTel Spa" },

6965 { 0x001B3E, "Curtis, Inc." },

6966 { 0x001B3F, "ProCurve Networking by HP" },

6967 { 0x001B40, "Network Automation mxc AB" },

6968 { 0x001B41, "General Infinity Co.,Ltd." },

6969 { 0x001B42, "Wise & Blue" },

6970 { 0x001B43, "Beijing DG Telecommunications equipment Co.,Ltd" },

6971 { 0x001B44, "SanDisk Corporation" },

6972 { 0x001B45, "ABB AS, Division Automation Products" },

6973 { 0x001B46, "Blueone Technology Co.,Ltd" },

6974 { 0x001B47, "Futarque A/S" },

6975 { 0x001B48, "Shenzhen Lantech Electronics Co., Ltd." },

6976 { 0x001B49, "Roberts Radio limited" },

6977 { 0x001B4A, "W&W Communications, Inc." },

6978 { 0x001B4B, "SANION Co., Ltd." },

6979 { 0x001B4C, "Signtech" },

6980 { 0x001B4D, "Areca Technology Corporation" },

6981 { 0x001B4E, "Navman New Zealand" },

6982 { 0x001B4F, "Avaya Inc" },

6983 { 0x001B50, "Nizhny Novgorod Factory named after M.Frunze, FSUE (NZiF)" },

6984 { 0x001B51, "Vector Technology Corp." },

6985 { 0x001B52, "ARRIS Group, Inc." },

6986 { 0x001B53, "Cisco Systems, Inc" },

6987 { 0x001B54, "Cisco Systems, Inc" },

6988 { 0x001B55, "Hurco Automation Ltd." },

6989 { 0x001B56, "Tehuti Networks Ltd." },

6990 { 0x001B57, "SEMINDIA SYSTEMS PRIVATE LIMITED" },

6991 { 0x001B58, "ACE CAD Enterprise Co., Ltd." },

6992 { 0x001B59, "Sony Corporation" },

6993 { 0x001B5A, "Apollo Imaging Technologies, Inc." },

6994 { 0x001B5B, "2Wire Inc" },

6995 { 0x001B5C, "Azuretec Co., Ltd." },

6996 { 0x001B5D, "Vololink Pty Ltd" },

6997 { 0x001B5E, "BPL Limited" },

6998 { 0x001B5F, "Alien Technology" },

6999 { 0x001B60, "NAVIGON AG" },

7000 { 0x001B61, "Digital Acoustics, LLC" },

7001 { 0x001B62, "JHT Optoelectronics Co.,Ltd." },

7002 { 0x001B63, "Apple, Inc." },

7003 { 0x001B64, "IsaacLandKorea Co., Ltd," },

7004 { 0x001B65, "China Gridcom Co., Ltd" },

7005 { 0x001B66, "Sennheiser electronic GmbH & Co. KG" },

7006 { 0x001B67, "Cisco Systems Inc" },

7007 { 0x001B68, "Modnnet Co., Ltd" },

7008 { 0x001B69, "Equaline Corporation" },

7009 { 0x001B6A, "Powerwave Technologies Sweden AB" },

7010 { 0x001B6B, "Swyx Solutions AG" },

7011 { 0x001B6C, "LookX Digital Media BV" },

7012 { 0x001B6D, "Midtronics, Inc." },

7013 { 0x001B6E, "Keysight Technologies, Inc." },

7014 { 0x001B6F, "Teletrak Ltd" },

7015 { 0x001B70, "IRI Ubiteq, INC." },

7016 { 0x001B71, "Telular Corp." },

7017 { 0x001B72, "Sicep s.p.a." },

7018 { 0x001B73, "DTL Broadcast Ltd" },

7019 { 0x001B74, "MiraLink Corporation" },

7020 { 0x001B75, "Hypermedia Systems" },

7021 { 0x001B76, "Ripcode, Inc." },

7022 { 0x001B77, "Intel Corporate" },

7023 { 0x001B78, "Hewlett Packard" },

7024 { 0x001B79, "FAIVELEY TRANSPORT" },

7025 { 0x001B7A, "Nintendo Co., Ltd." },

7026 { 0x001B7B, "The Tintometer Ltd" },

7027 { 0x001B7C, "A & R Cambridge" },

7028 { 0x001B7D, "CXR Anderson Jacobson" },

7029 { 0x001B7E, "Beckmann GmbH" },

7030 { 0x001B7F, "TMN Technologies Telecomunicacoes Ltda" },

7031 { 0x001B80, "LORD Corporation" },

7032 { 0x001B81, "DATAQ Instruments, Inc." },

7033 { 0x001B82, "Taiwan Semiconductor Co., Ltd." },

7034 { 0x001B83, "Finsoft Ltd" },

7035 { 0x001B84, "Scan Engineering Telecom" },

7036 { 0x001B85, "MAN Energy Solutions" },

7037 { 0x001B86, "Bosch Access Systems GmbH" },

7038 { 0x001B87, "Deepsound Tech. Co., Ltd" },

7039 { 0x001B88, "Divinet Access Technologies Ltd" },

7040 { 0x001B89, "EMZA Visual Sense Ltd." },

7041 { 0x001B8A, "2M Electronic A/S" },

7042 { 0x001B8B, "NEC Platforms, Ltd." },

7043 { 0x001B8C, "JMicron Technology Corp." },

7044 { 0x001B8D, "Electronic Computer Systems, Inc." },

7045 { 0x001B8E, "Hulu Sweden AB" },

7046 { 0x001B8F, "Cisco Systems, Inc" },

7047 { 0x001B90, "Cisco Systems, Inc" },

7048 { 0x001B91, "EFKON AG" },

7049 { 0x001B92, "l-acoustics" },

7050 { 0x001B93, "JC Decaux SA DNT" },

7051 { 0x001B94, "T.E.M.A. S.p.A." },

7052 { 0x001B95, "VIDEO SYSTEMS SRL" },

7053 { 0x001B96, "General Sensing" },

7054 { 0x001B97, "Violin Technologies" },

7055 { 0x001B98, "Samsung Electronics Co.,Ltd" },

7056 { 0x001B99, "KS System GmbH" },

7057 { 0x001B9A, "Apollo Fire Detectors Ltd" },

7058 { 0x001B9B, "Hose-McCann Communications" },

7059 { 0x001B9C, "SATEL sp. z o.o." },

7060 { 0x001B9D, "Novus Security Sp. z o.o." },

7061 { 0x001B9E, "ASKEY COMPUTER CORP" },

7062 { 0x001B9F, "Calyptech Pty Ltd" },

7063 { 0x001BA0, "Awox" },

7064 { 0x001BA1, "Åmic AB" },

7065 { 0x001BA2, "IDS Imaging Development Systems GmbH" },

7066 { 0x001BA3, "Flexit Group GmbH" },

7067 { 0x001BA4, "S.A.E Afikim" },

7068 { 0x001BA5, "MyungMin Systems, Inc." },

7069 { 0x001BA6, "intotech inc." },

7070 { 0x001BA7, "Lorica Solutions" },

7071 { 0x001BA8, "UBI&MOBI,.Inc" },

7072 { 0x001BA9, "Brother industries, LTD." },

7073 { 0x001BAA, "XenICs nv" },

7074 { 0x001BAB, "Telchemy, Incorporated" },

7075 { 0x001BAC, "Curtiss Wright Controls Embedded Computing" },

7076 { 0x001BAD, "iControl Incorporated" },

7077 { 0x001BAE, "Micro Control Systems, Inc" },

7078 { 0x001BAF, "Nokia Danmark A/S" },

7079 { 0x001BB0, "Bharat Electronics Limited" },

7080 { 0x001BB1, "Wistron Neweb Corporation" },

7081 { 0x001BB2, "Intellect International NV" },

7082 { 0x001BB3, "Condalo GmbH" },

7083 { 0x001BB4, "Airvod Limited" },

7084 { 0x001BB5, "Cherry GmbH" },

7085 { 0x001BB6, "Bird Electronic Corp." },

7086 { 0x001BB7, "Alta Heights Technology Corp." },

7087 { 0x001BB8, "BLUEWAY ELECTRONIC CO;LTD" },

7088 { 0x001BB9, "Elitegroup Computer Systems Co.,Ltd." },

7089 { 0x001BBA, "Nortel Networks" },

7090 { 0x001BBB, "RFTech Co.,Ltd" },

7091 { 0x001BBC, "Silver Peak Systems, Inc." },

7092 { 0x001BBD, "FMC Kongsberg Subsea AS" },

7093 { 0x001BBE, "ICOP Digital" },

7094 { 0x001BBF, "Sagemcom Broadband SAS" },

7095 { 0x001BC0, "Juniper Networks" },

7096 { 0x001BC1, "HOLUX Technology, Inc." },

7097 { 0x001BC2, "Integrated Control Technology Limitied" },

7098 { 0x001BC3, "Mobisolution Co.,Ltd" },

7099 { 0x001BC4, "Ultratec, Inc." },

7100 { 0x001BC5, "IEEE Registration Authority" },

7101 { 0x001BC6, "Strato Rechenzentrum AG" },

7102 { 0x001BC7, "StarVedia Technology Inc." },

7103 { 0x001BC8, "MIURA CO.,LTD" },

7104 { 0x001BC9, "FSN DISPLAY INC" },

7105 { 0x001BCA, "Beijing Run Technology LTD. Company" },

7106 { 0x001BCB, "PEMPEK SYSTEMS PTY LTD" },

7107 { 0x001BCC, "KINGTEK CCTV ALLIANCE CO., LTD." },

7108 { 0x001BCD, "DAVISCOMMS (S) PTE LTD" },

7109 { 0x001BCE, "Measurement Devices Ltd" },

7110 { 0x001BCF, "Dataupia Corporation" },

7111 { 0x001BD0, "IDENTEC SOLUTIONS" },

7112 { 0x001BD1, "SOGESTMATIC" },

7113 { 0x001BD2, "ULTRA-X ASIA PACIFIC Inc." },

7114 { 0x001BD3, "Panasonic Corporation AVC Networks Company" },

7115 { 0x001BD4, "Cisco Systems, Inc" },

7116 { 0x001BD5, "Cisco Systems, Inc" },

7117 { 0x001BD6, "Kelvin Hughes Ltd" },

7118 { 0x001BD7, "Cisco SPVTG" },

7119 { 0x001BD8, "FLIR Systems Inc" },

7120 { 0x001BD9, "Edgewater Wireless Systems Inc" },

7121 { 0x001BDA, "UTStarcom Inc" },

7122 { 0x001BDB, "Valeo VECS" },

7123 { 0x001BDC, "Vencer Co., Ltd." },

7124 { 0x001BDD, "ARRIS Group, Inc." },

7125 { 0x001BDE, "Renkus-Heinz, Inc." },

7126 { 0x001BDF, "Iskra Sistemi d.d." },

7127 { 0x001BE0, "TELENOT ELECTRONIC GmbH" },

7128 { 0x001BE1, "ViaLogy" },

7129 { 0x001BE2, "AhnLab,Inc." },

7130 { 0x001BE3, "Health Hero Network, Inc." },

7131 { 0x001BE4, "TOWNET SRL" },

7132 { 0x001BE5, "802automation Limited" },

7133 { 0x001BE6, "VR AG" },

7134 { 0x001BE7, "Postek Electronics Co., Ltd." },

7135 { 0x001BE8, "Ultratronik GmbH" },

7136 { 0x001BE9, "Broadcom" },

7137 { 0x001BEA, "Nintendo Co., Ltd." },

7138 { 0x001BEB, "DMP Electronics INC." },

7139 { 0x001BEC, "Netio Technologies Co., Ltd" },

7140 { 0x001BED, "Brocade Communications Systems LLC" },

7141 { 0x001BEE, "Nokia Danmark A/S" },

7142 { 0x001BEF, "Blossoms Digital Technology Co.,Ltd." },

7143 { 0x001BF0, "Value Platforms Limited" },

7144 { 0x001BF1, "Nanjing SilverNet Software Co., Ltd." },

7145 { 0x001BF2, "KWORLD COMPUTER CO., LTD" },

7146 { 0x001BF3, "TRANSRADIO SenderSysteme Berlin AG" },

7147 { 0x001BF4, "KENWIN INDUSTRIAL(HK) LTD." },

7148 { 0x001BF5, "Tellink Sistemas de Telecomunicación S.L." },

7149 { 0x001BF6, "CONWISE Technology Corporation Ltd." },

7150 { 0x001BF7, "Lund IP Products AB" },

7151 { 0x001BF8, "Digitrax Inc." },

7152 { 0x001BF9, "Intellitect Water Ltd" },

7153 { 0x001BFA, "G.i.N. mbH" },

7154 { 0x001BFB, "ALPSALPINE CO,.LTD" },

7155 { 0x001BFC, "ASUSTek COMPUTER INC." },

7156 { 0x001BFD, "Dignsys Inc." },

7157 { 0x001BFE, "Zavio Inc." },

7158 { 0x001BFF, "Millennia Media inc." },

7159 { 0x001C00, "Entry Point, LLC" },

7160 { 0x001C01, "ABB Oy Drives" },

7161 { 0x001C02, "Pano Logic" },

7162 { 0x001C03, "Betty TV Technology AG" },

7163 { 0x001C04, "Airgain, Inc." },

7164 { 0x001C05, "Nonin Medical Inc." },

7165 { 0x001C06, "Siemens Numerical Control Ltd., Nanjing" },

7166 { 0x001C07, "Cwlinux Limited" },

7167 { 0x001C08, "Echo360, Inc." },

7168 { 0x001C09, "SAE Electronic Co.,Ltd." },

7169 { 0x001C0A, "Shenzhen AEE Technology Co.,Ltd." },

7170 { 0x001C0B, "SmartAnt Telecom" },

7171 { 0x001C0C, "TANITA Corporation" },

7172 { 0x001C0D, "G-Technology, Inc." },

7173 { 0x001C0E, "Cisco Systems, Inc" },

7174 { 0x001C0F, "Cisco Systems, Inc" },

7175 { 0x001C10, "Cisco-Linksys, LLC" },

7176 { 0x001C11, "ARRIS Group, Inc." },

7177 { 0x001C12, "ARRIS Group, Inc." },

7178 { 0x001C13, "OPTSYS TECHNOLOGY CO., LTD." },

7179 { 0x001C14, "VMware, Inc." },

7180 { 0x001C15, "iPhotonix LLC" },

7181 { 0x001C16, "ThyssenKrupp Elevator" },

7182 { 0x001C17, "Nortel Networks" },

7183 { 0x001C18, "Sicert S.r.L." },

7184 { 0x001C19, "secunet Security Networks AG" },

7185 { 0x001C1A, "Thomas Instrumentation, Inc" },

7186 { 0x001C1B, "Hyperstone GmbH" },

7187 { 0x001C1C, "Center Communication Systems GmbH" },

7188 { 0x001C1D, "CHENZHOU GOSPELL DIGITAL TECHNOLOGY CO.,LTD" },

7189 { 0x001C1E, "emtrion GmbH" },

7190 { 0x001C1F, "Quest Retail Technology Pty Ltd" },

7191 { 0x001C20, "CLB Benelux" },

7192 { 0x001C21, "Nucsafe Inc." },

7193 { 0x001C22, "Aeris Elettronica s.r.l." },

7194 { 0x001C23, "Dell Inc." },

7195 { 0x001C24, "Formosa Wireless Systems Corp." },

7196 { 0x001C25, "Hon Hai Precision Ind. Co.,Ltd." },

7197 { 0x001C26, "Hon Hai Precision Ind. Co.,Ltd." },

7198 { 0x001C27, "Sunell Electronics Co." },

7199 { 0x001C28, "Sphairon Technologies GmbH" },

7200 { 0x001C29, "CORE DIGITAL ELECTRONICS CO., LTD" },

7201 { 0x001C2A, "Envisacor Technologies Inc." },

7202 { 0x001C2B, "Alertme.com Limited" },

7203 { 0x001C2C, "Synapse" },

7204 { 0x001C2D, "FlexRadio Systems" },

7205 { 0x001C2E, "HPN Supply Chain" },

7206 { 0x001C2F, "Pfister GmbH" },

7207 { 0x001C30, "Mode Lighting (UK ) Ltd." },

7208 { 0x001C31, "Mobile XP Technology Co., LTD" },

7209 { 0x001C32, "Telian Corporation" },

7210 { 0x001C33, "Sutron" },

7211 { 0x001C34, "HUEY CHIAO INTERNATIONAL CO., LTD." },

7212 { 0x001C35, "Nokia Danmark A/S" },

7213 { 0x001C36, "iNEWiT NV" },

7214 { 0x001C37, "Callpod, Inc." },

7215 { 0x001C38, "Bio-Rad Laboratories, Inc." },

7216 { 0x001C39, "S Netsystems Inc." },

7217 { 0x001C3A, "Element Labs, Inc." },

7218 { 0x001C3B, "AmRoad Technology Inc." },

7219 { 0x001C3C, "Seon Design Inc." },

7220 { 0x001C3D, "WaveStorm" },

7221 { 0x001C3E, "ECKey Corporation" },

7222 { 0x001C3F, "International Police Technologies, Inc." },

7223 { 0x001C40, "VDG-Security bv" },

7224 { 0x001C41, "scemtec Transponder Technology GmbH" },

7225 { 0x001C42, "Parallels, Inc." },

7226 { 0x001C43, "Samsung Electronics Co.,Ltd" },

7227 { 0x001C44, "Bosch Security Systems BV" },

7228 { 0x001C45, "Chenbro Micom Co., Ltd." },

7229 { 0x001C46, "QTUM" },

7230 { 0x001C47, "Hangzhou Hollysys Automation Co., Ltd" },

7231 { 0x001C48, "WiDeFi, Inc." },

7232 { 0x001C49, "Zoltan Technology Inc." },

7233 { 0x001C4A, "AVM GmbH" },

7234 { 0x001C4B, "Gener8, Inc." },

7235 { 0x001C4C, "Petrotest Instruments" },

7236 { 0x001C4D, "Aplix IP Holdings Corporation" },

7237 { 0x001C4E, "TASA International Limited" },

7238 { 0x001C4F, "MACAB AB" },

7239 { 0x001C50, "TCL Technoly Electronics (Huizhou) Co., Ltd." },

7240 { 0x001C51, "Celeno Communications" },

7241 { 0x001C52, "VISIONEE SRL" },

7242 { 0x001C53, "Synergy Lighting Controls" },

7243 { 0x001C54, "Hillstone Networks Inc" },

7244 { 0x001C55, "Shenzhen Kaifa Technology Co." },

7245 { 0x001C56, "Pado Systems, Inc." },

7246 { 0x001C57, "Cisco Systems, Inc" },

7247 { 0x001C58, "Cisco Systems, Inc" },

7248 { 0x001C59, "DEVON IT" },

7249 { 0x001C5A, "Advanced Relay Corporation" },

7250 { 0x001C5B, "Chubb Electronic Security Systems Ltd" },

7251 { 0x001C5C, "Integrated Medical Systems, Inc." },

7252 { 0x001C5D, "Leica Microsystems" },

7253 { 0x001C5E, "ASTON France" },

7254 { 0x001C5F, "Winland Electronics, Inc." },

7255 { 0x001C60, "CSP Frontier Technologies,Inc." },

7256 { 0x001C61, "Galaxy Microsystems LImited" },

7257 { 0x001C62, "LG Electronics (Mobile Communications)" },

7258 { 0x001C63, "TRUEN" },

7259 { 0x001C64, "Landis+Gyr" },

7260 { 0x001C65, "JoeScan, Inc." },

7261 { 0x001C66, "UCAMP CO.,LTD" },

7262 { 0x001C67, "Pumpkin Networks, Inc." },

7263 { 0x001C68, "Anhui Sun Create Electronics Co., Ltd" },

7264 { 0x001C69, "Packet Vision Ltd" },

7265 { 0x001C6A, "Weiss Engineering Ltd." },

7266 { 0x001C6B, "COVAX Co. Ltd" },

7267 { 0x001C6C, "30805" },

7268 { 0x001C6D, "KYOHRITSU ELECTRONIC INDUSTRY CO., LTD." },

7269 { 0x001C6E, "Newbury Networks, Inc." },

7270 { 0x001C6F, "Emfit Ltd" },

7271 { 0x001C70, "NOVACOMM LTDA" },

7272 { 0x001C71, "Emergent Electronics" },

7273 { 0x001C72, "Mayer & Cie GmbH & Co KG" },

7274 { 0x001C73, "Arista Networks" },

7275 { 0x001C74, "Syswan Technologies Inc." },

7276 { 0x001C75, "Segnet Ltd." },

7277 { 0x001C76, "The Wandsworth Group Ltd" },

7278 { 0x001C77, "Prodys" },

7279 { 0x001C78, "WYPLAY SAS" },

7280 { 0x001C79, "Cohesive Financial Technologies LLC" },

7281 { 0x001C7A, "Perfectone Netware Company Ltd" },

7282 { 0x001C7B, "Castlenet Technology Inc." },

7283 { 0x001C7C, "PERQ SYSTEMS CORPORATION" },

7284 { 0x001C7D, "Excelpoint Manufacturing Pte Ltd" },

7285 { 0x001C7E, "Toshiba" },

7286 { 0x001C7F, "Check Point Software Technologies" },

7287 { 0x001C80, "New Business Division/Rhea-Information CO., LTD." },

7288 { 0x001C81, "NextGen Venturi LTD" },

7289 { 0x001C82, "Genew Technologies" },

7290 { 0x001C83, "New Level Telecom Co., Ltd." },

7291 { 0x001C84, "STL Solution Co.,Ltd." },

7292 { 0x001C85, "Eunicorn" },

7293 { 0x001C86, "Cranite Systems, Inc." },

7294 { 0x001C87, "Uriver Inc." },

7295 { 0x001C88, "TRANSYSTEM INC." },

7296 { 0x001C89, "Force Communications, Inc." },

7297 { 0x001C8A, "Cirrascale Corporation" },

7298 { 0x001C8B, "MJ Innovations Ltd." },

7299 { 0x001C8C, "DIAL TECHNOLOGY LTD." },

7300 { 0x001C8D, "Mesa Imaging" },

7301 { 0x001C8E, "Alcatel-Lucent IPD" },

7302 { 0x001C8F, "Advanced Electronic Design, Inc." },

7303 { 0x001C90, "Empacket Corporation" },

7304 { 0x001C91, "Gefen LLC" },

7305 { 0x001C92, "Tervela" },

7306 { 0x001C93, "ExaDigm Inc" },

7307 { 0x001C94, "LI-COR Biosciences" },

7308 { 0x001C95, "Opticomm Corporation" },

7309 { 0x001C96, "Linkwise Technology Pte Ltd" },

7310 { 0x001C97, "Enzytek Technology Inc.," },

7311 { 0x001C98, "LUCKY TECHNOLOGY (HK) COMPANY LIMITED" },

7312 { 0x001C99, "Shunra Software Ltd." },

7313 { 0x001C9A, "Nokia Danmark A/S" },

7314 { 0x001C9B, "FEIG ELECTRONIC GmbH" },

7315 { 0x001C9C, "Nortel Networks" },

7316 { 0x001C9D, "Liecthi AG" },

7317 { 0x001C9E, "Dualtech IT AB" },

7318 { 0x001C9F, "Razorstream, LLC" },

7319 { 0x001CA0, "Production Resource Group, LLC" },

7320 { 0x001CA1, "AKAMAI TECHNOLOGIES, INC." },

7321 { 0x001CA2, "ADB Broadband Italia" },

7322 { 0x001CA3, "Terra" },

7323 { 0x001CA4, "Sony Corporation" },

7324 { 0x001CA5, "Zygo Corporation" },

7325 { 0x001CA6, "Win4NET" },

7326 { 0x001CA7, "International Quartz Limited" },

7327 { 0x001CA8, "AirTies Wireless Networks" },

7328 { 0x001CA9, "Audiomatica Srl" },

7329 { 0x001CAA, "Bellon Pty Ltd" },

7330 { 0x001CAB, "Meyer Sound Laboratories, Inc." },

7331 { 0x001CAC, "Qniq Technology Corp." },

7332 { 0x001CAD, "Wuhan Telecommunication Devices Co.,Ltd" },

7333 { 0x001CAE, "WiChorus, Inc." },

7334 { 0x001CAF, "Plato Networks Inc." },

7335 { 0x001CB0, "Cisco Systems, Inc" },

7336 { 0x001CB1, "Cisco Systems, Inc" },

7337 { 0x001CB2, "BPT SPA" },

7338 { 0x001CB3, "Apple, Inc." },

7339 { 0x001CB4, "Iridium Satellite LLC" },

7340 { 0x001CB5, "Neihua Network Technology Co.,LTD.(NHN)" },

7341 { 0x001CB6, "Duzon CNT Co., Ltd." },

7342 { 0x001CB7, "USC DigiArk Corporation" },

7343 { 0x001CB8, "CBC Co., Ltd" },

7344 { 0x001CB9, "KWANG SUNG ELECTRONICS CO., LTD." },

7345 { 0x001CBA, "VerScient, Inc." },

7346 { 0x001CBB, "MusicianLink" },

7347 { 0x001CBC, "CastGrabber, LLC" },

7348 { 0x001CBD, "Ezze Mobile Tech., Inc." },

7349 { 0x001CBE, "Nintendo Co., Ltd." },

7350 { 0x001CBF, "Intel Corporate" },

7351 { 0x001CC0, "Intel Corporate" },

7352 { 0x001CC1, "ARRIS Group, Inc." },

7353 { 0x001CC2, "Part II Research, Inc." },

7354 { 0x001CC3, "ARRIS Group, Inc." },

7355 { 0x001CC4, "Hewlett Packard" },

7356 { 0x001CC5, "3Com Ltd" },

7357 { 0x001CC6, "ProStor Systems" },

7358 { 0x001CC7, "Rembrandt Technologies, LLC d/b/a REMSTREAM" },

7359 { 0x001CC8, "INDUSTRONIC Industrie-Electronic GmbH & Co. KG" },

7360 { 0x001CC9, "Kaise Electronic Technology Co., Ltd." },

7361 { 0x001CCA, "Shanghai Gaozhi Science & Technology Development Co." },

7362 { 0x001CCB, "Forth Corporation Public Company Limited" },

7363 { 0x001CCC, "BlackBerry RTS" },

7364 { 0x001CCD, "Alektrona Corporation" },

7365 { 0x001CCE, "By Techdesign" },

7366 { 0x001CCF, "LIMETEK" },

7367 { 0x001CD0, "Circleone Co.,Ltd." },

7368 { 0x001CD1, "Waves Audio LTD" },

7369 { 0x001CD2, "King Champion (Hong Kong) Limited" },

7370 { 0x001CD3, "ZP Engineering SEL" },

7371 { 0x001CD4, "Nokia Danmark A/S" },

7372 { 0x001CD5, "ZeeVee, Inc." },

7373 { 0x001CD6, "Nokia Danmark A/S" },

7374 { 0x001CD7, "Harman/Becker Automotive Systems GmbH" },

7375 { 0x001CD8, "BlueAnt Wireless" },

7376 { 0x001CD9, "GlobalTop Technology Inc." },

7377 { 0x001CDA, "Exegin Technologies Limited" },

7378 { 0x001CDB, "CARPOINT CO.,LTD" },

7379 { 0x001CDC, "Custom Computer Services, Inc." },

7380 { 0x001CDD, "COWBELL ENGINEERING CO., LTD." },

7381 { 0x001CDE, "Interactive Multimedia eXchange Inc." },

7382 { 0x001CDF, "Belkin International Inc." },

7383 { 0x001CE0, "DASAN TPS" },

7384 { 0x001CE1, "INDRA SISTEMAS, S.A." },

7385 { 0x001CE2, "Attero Tech, LLC." },

7386 { 0x001CE3, "Optimedical Systems" },

7387 { 0x001CE4, "EleSy JSC" },

7388 { 0x001CE5, "MBS Electronic Systems GmbH" },

7389 { 0x001CE6, "INNES" },

7390 { 0x001CE7, "Rocon PLC Research Centre" },

7391 { 0x001CE8, "Cummins Inc" },

7392 { 0x001CE9, "Galaxy Technology Limited" },

7393 { 0x001CEA, "Scientific-Atlanta, Inc" },

7394 { 0x001CEB, "Nortel Networks" },

7395 { 0x001CEC, "Mobilesoft (Aust.) Pty Ltd" },

7396 { 0x001CED, "ENVIRONNEMENT SA" },

7397 { 0x001CEE, "SHARP Corporation" },

7398 { 0x001CEF, "Primax Electronics Ltd." },

7399 { 0x001CF0, "D-Link Corporation" },

7400 { 0x001CF1, "SUPoX Technology Co. , LTD." },

7401 { 0x001CF2, "Tenlon Technology Co.,Ltd." },

7402 { 0x001CF3, "EVS BROADCAST EQUIPMENT" },

7403 { 0x001CF4, "Media Technology Systems Inc" },

7404 { 0x001CF5, "Wiseblue Technology Limited" },

7405 { 0x001CF6, "Cisco Systems, Inc" },

7406 { 0x001CF7, "AudioScience" },

7407 { 0x001CF8, "Parade Technologies, Ltd." },

7408 { 0x001CF9, "Cisco Systems, Inc" },

7409 { 0x001CFA, "Alarm.com" },

7410 { 0x001CFB, "ARRIS Group, Inc." },

7411 { 0x001CFC, "Sumitomo Electric Industries, Ltd" },

7412 { 0x001CFD, "Universal Electronics, Inc." },

7413 { 0x001CFE, "Quartics Inc" },

7414 { 0x001CFF, "Napera Networks Inc" },

7415 { 0x001D00, "Brivo Systems, LLC" },

7416 { 0x001D01, "Neptune Digital" },

7417 { 0x001D02, "Cybertech Telecom Development" },

7418 { 0x001D03, "Design Solutions Inc." },

7419 { 0x001D04, "Zipit Wireless, Inc." },

7420 { 0x001D05, "Cooper Lighting Solutions" },

7421 { 0x001D06, "HM Electronics, Inc." },

7422 { 0x001D07, "Shenzhen Sang Fei Consumer Communications Co.,Ltd" },

7423 { 0x001D08, "Jiangsu Yinhe Electronics Co.,Ltd." },

7424 { 0x001D09, "Dell Inc." },

7425 { 0x001D0A, "Davis Instruments, Inc." },

7426 { 0x001D0B, "Power Standards Lab" },

7427 { 0x001D0C, "MobileCompia" },

7428 { 0x001D0D, "Sony Interactive Entertainment Inc." },

7429 { 0x001D0E, "Agapha Technology co., Ltd." },

7430 { 0x001D0F, "TP-LINK TECHNOLOGIES CO.,LTD." },

7431 { 0x001D10, "LightHaus Logic, Inc." },

7432 { 0x001D11, "Analogue & Micro Ltd" },

7433 { 0x001D12, "ROHM CO., LTD." },

7434 { 0x001D13, "NextGTV" },

7435 { 0x001D14, "SPERADTONE INFORMATION TECHNOLOGY LIMITED" },

7436 { 0x001D15, "Shenzhen Dolphin Electronic Co., Ltd" },

7437 { 0x001D16, "SFR" },

7438 { 0x001D17, "Digital Sky Corporation" },

7439 { 0x001D18, "Power Innovation GmbH" },

7440 { 0x001D19, "Arcadyan Technology Corporation" },

7441 { 0x001D1A, "OvisLink S.A." },

7442 { 0x001D1B, "Sangean Electronics Inc." },

7443 { 0x001D1C, "Gennet s.a." },

7444 { 0x001D1D, "Inter-M Corporation" },

7445 { 0x001D1E, "KYUSHU TEN CO.,LTD" },

7446 { 0x001D1F, "Siauliu Tauro Televizoriai, JSC" },

7447 { 0x001D20, "Comtrend Corporation" },

7448 { 0x001D21, "Alcad SL" },

7449 { 0x001D22, "Foss Analytical A/S" },

7450 { 0x001D23, "SENSUS" },

7451 { 0x001D24, "Aclara Power-Line Systems Inc." },

7452 { 0x001D25, "Samsung Electronics Co.,Ltd" },

7453 { 0x001D26, "Rockridgesound Technology Co." },

7454 { 0x001D27, "NAC-INTERCOM" },

7455 { 0x001D28, "Sony Corporation" },

7456 { 0x001D29, "Doro AB" },

7457 { 0x001D2A, "SHENZHEN BUL-TECH CO.,LTD." },

7458 { 0x001D2B, "Wuhan Pont Technology CO. , LTD" },

7459 { 0x001D2C, "Wavetrend Technologies (Pty) Limited" },

7460 { 0x001D2D, "Pylone, Inc." },

7461 { 0x001D2E, "Ruckus Wireless" },

7462 { 0x001D2F, "QuantumVision Corporation" },

7463 { 0x001D30, "YX Wireless S.A." },

7464 { 0x001D31, "HIGHPRO INTERNATIONAL R&D CO,.LTD." },

7465 { 0x001D32, "Longkay Communication & Technology (Shanghai) Co. Ltd" },

7466 { 0x001D33, "Maverick Systems Inc." },

7467 { 0x001D34, "SYRIS Technology Corp" },

7468 { 0x001D35, "Viconics Electronics Inc." },

7469 { 0x001D36, "ELECTRONICS CORPORATION OF INDIA LIMITED" },

7470 { 0x001D37, "Thales-Panda Transportation System" },

7471 { 0x001D38, "Seagate Technology" },

7472 { 0x001D39, "MOOHADIGITAL CO., LTD" },

7473 { 0x001D3A, "mh acoustics LLC" },

7474 { 0x001D3B, "Nokia Danmark A/S" },

7475 { 0x001D3C, "Muscle Corporation" },

7476 { 0x001D3D, "Avidyne Corporation" },

7477 { 0x001D3E, "SAKA TECHNO SCIENCE CO.,LTD" },

7478 { 0x001D3F, "Mitron Pty Ltd" },

7479 { 0x001D40, "Intel – GE Care Innovations LLC" },

7480 { 0x001D41, "Hardy Instruments" },

7481 { 0x001D42, "Nortel Networks" },

7482 { 0x001D43, "Shenzhen G-link Digital Technology Co., Ltd." },

7483 { 0x001D44, "Krohne" },

7484 { 0x001D45, "Cisco Systems, Inc" },

7485 { 0x001D46, "Cisco Systems, Inc" },

7486 { 0x001D47, "Covote GmbH & Co KG" },

7487 { 0x001D48, "Sensor-Technik Wiedemann GmbH" },

7488 { 0x001D49, "Innovation Wireless Inc." },

7489 { 0x001D4A, "Carestream Health, Inc." },

7490 { 0x001D4B, "Grid Connect Inc." },

7491 { 0x001D4C, "Alcatel-Lucent" },

7492 { 0x001D4D, "Adaptive Recognition Hungary, Inc" },

7493 { 0x001D4E, "TCM Mobile LLC" },

7494 { 0x001D4F, "Apple, Inc." },

7495 { 0x001D50, "SPINETIX SA" },

7496 { 0x001D51, "Babcock & Wilcox Power Generation Group, Inc" },

7497 { 0x001D52, "Defzone B.V." },

7498 { 0x001D53, "S&O Electronics (Malaysia) Sdn. Bhd." },

7499 { 0x001D54, "Sunnic Technology & Merchandise INC." },

7500 { 0x001D55, "ZANTAZ, Inc" },

7501 { 0x001D56, "Kramer Electronics Ltd." },

7502 { 0x001D57, "CAETEC Messtechnik" },

7503 { 0x001D58, "CQ Inc" },

7504 { 0x001D59, "Mitra Energy & Infrastructure" },

7505 { 0x001D5A, "2Wire Inc" },

7506 { 0x001D5B, "Tecvan Informatica Ltda" },

7507 { 0x001D5C, "Tom Communication Industrial Co.,Ltd." },

7508 { 0x001D5D, "Control Dynamics Pty. Ltd." },

7509 { 0x001D5E, "COMING MEDIA CORP." },

7510 { 0x001D5F, "OverSpeed SARL" },

7511 { 0x001D60, "ASUSTek COMPUTER INC." },

7512 { 0x001D61, "BIJ Corporation" },

7513 { 0x001D62, "InPhase Technologies" },

7514 { 0x001D63, "Miele & Cie. KG" },

7515 { 0x001D64, "Adam Communications Systems Int Ltd" },

7516 { 0x001D65, "Microwave Radio Communications" },

7517 { 0x001D66, "Hyundai Telecom" },

7518 { 0x001D67, "AMEC" },

7519 { 0x001D68, "Thomson Telecom Belgium" },

7520 { 0x001D69, "Knorr-Bremse IT-Services GmbH" },

7521 { 0x001D6A, "Alpha Networks Inc." },

7522 { 0x001D6B, "ARRIS Group, Inc." },

7523 { 0x001D6C, "ClariPhy Communications, Inc." },

7524 { 0x001D6D, "Confidant International LLC" },

7525 { 0x001D6E, "Nokia Danmark A/S" },

7526 { 0x001D6F, "Chainzone Technology Co., Ltd" },

7527 { 0x001D70, "Cisco Systems, Inc" },

7528 { 0x001D71, "Cisco Systems, Inc" },

7529 { 0x001D72, "Wistron Corporation" },

7530 { 0x001D73, "BUFFALO.INC" },

7531 { 0x001D74, "Tianjin China-Silicon Microelectronics Co., Ltd." },

7532 { 0x001D75, "Radioscape PLC" },

7533 { 0x001D76, "Eyeheight Ltd." },

7534 { 0x001D77, "NSGate" },

7535 { 0x001D78, "Invengo Information Technology Co.,Ltd" },

7536 { 0x001D79, "SIGNAMAX LLC" },

7537 { 0x001D7A, "Wideband Semiconductor, Inc." },

7538 { 0x001D7B, "Ice Energy, Inc." },

7539 { 0x001D7C, "ABE Elettronica S.p.A." },

7540 { 0x001D7D, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

7541 { 0x001D7E, "Cisco-Linksys, LLC" },

7542 { 0x001D7F, "Tekron International Ltd" },

7543 { 0x001D80, "Beijing Huahuan Eletronics Co.,Ltd" },

7544 { 0x001D81, "GUANGZHOU GATEWAY ELECTRONICS CO., LTD" },

7545 { 0x001D82, "GN Netcom A/S" },

7546 { 0x001D83, "Emitech Corporation" },

7547 { 0x001D84, "Gateway, Inc." },

7548 { 0x001D85, "Call Direct Cellular Solutions" },

7549 { 0x001D86, "Shinwa Industries(China) Ltd." },

7550 { 0x001D87, "VigTech Labs Sdn Bhd" },

7551 { 0x001D88, "Clearwire" },

7552 { 0x001D89, "VaultStor Corporation" },

7553 { 0x001D8A, "TechTrex Inc" },

7554 { 0x001D8B, "ADB Broadband Italia" },

7555 { 0x001D8C, "La Crosse Technology LTD" },

7556 { 0x001D8D, "Fluke Process Instruments GmbH" },

7557 { 0x001D8E, "Alereon, Inc." },

7558 { 0x001D8F, "PureWave Networks" },

7559 { 0x001D90, "EMCO Flow Systems" },

7560 { 0x001D91, "Digitize, Inc" },

7561 { 0x001D92, "MICRO-STAR INT'L CO.,LTD." },

7562 { 0x001D93, "Modacom" },

7563 { 0x001D94, "Climax Technology Co., Ltd" },

7564 { 0x001D95, "Flash, Inc." },

7565 { 0x001D96, "WatchGuard Video" },

7566 { 0x001D97, "Alertus Technologies LLC" },

7567 { 0x001D98, "Nokia Danmark A/S" },

7568 { 0x001D99, "Cyan Optic, Inc." },

7569 { 0x001D9A, "GODEX INTERNATIONAL CO., LTD" },

7570 { 0x001D9B, "Hokuyo Automatic Co., Ltd." },

7571 { 0x001D9C, "Rockwell Automation" },

7572 { 0x001D9D, "ARTJOY INTERNATIONAL LIMITED" },

7573 { 0x001D9E, "AXION TECHNOLOGIES" },

7574 { 0x001D9F, "MATT R.P.Traczynscy Sp.J." },

7575 { 0x001DA0, "Heng Yu Electronic Manufacturing Company Limited" },

7576 { 0x001DA1, "Cisco Systems, Inc" },

7577 { 0x001DA2, "Cisco Systems, Inc" },

7578 { 0x001DA3, "SabiOso" },

7579 { 0x001DA4, "Hangzhou System Technology CO., LTD" },

7580 { 0x001DA5, "WB Electronics" },

7581 { 0x001DA6, "Media Numerics Limited" },

7582 { 0x001DA7, "Seamless Internet" },

7583 { 0x001DA8, "Takahata Electronics Co.,Ltd" },

7584 { 0x001DA9, "Castles Technology, Co., LTD" },

7585 { 0x001DAA, "DrayTek Corp." },

7586 { 0x001DAB, "SwissQual License AG" },

7587 { 0x001DAC, "Gigamon Systems LLC" },

7588 { 0x001DAD, "Sinotech Engineering Consultants, Inc. Geotechnical Enginee" },

7589 { 0x001DAE, "CHANG TSENG TECHNOLOGY CO., LTD" },

7590 { 0x001DAF, "Nortel Networks" },

7591 { 0x001DB0, "FuJian HengTong Information Technology Co.,Ltd" },

7592 { 0x001DB1, "Crescendo Networks" },

7593 { 0x001DB2, "HOKKAIDO ELECTRIC ENGINEERING CO.,LTD." },

7594 { 0x001DB3, "HPN Supply Chain" },

7595 { 0x001DB4, "KUMHO ENG CO.,LTD" },

7596 { 0x001DB5, "Juniper Networks" },

7597 { 0x001DB6, "BestComm Networks, Inc." },

7598 { 0x001DB7, "Tendril Networks, Inc." },

7599 { 0x001DB8, "Intoto Inc." },

7600 { 0x001DB9, "Wellspring Wireless" },

7601 { 0x001DBA, "Sony Corporation" },

7602 { 0x001DBB, "Dynamic System Electronics Corp." },

7603 { 0x001DBC, "Nintendo Co., Ltd." },

7604 { 0x001DBD, "Versamed Inc." },

7605 { 0x001DBE, "ARRIS Group, Inc." },

7606 { 0x001DBF, "Radiient Technologies, Inc." },

7607 { 0x001DC0, "Enphase Energy" },

7608 { 0x001DC1, "Audinate Pty L" },

7609 { 0x001DC2, "XORTEC OY" },

7610 { 0x001DC3, "RIKOR TV, Ltd" },

7611 { 0x001DC4, "AIOI Systems Co., Ltd." },

7612 { 0x001DC5, "Beijing Jiaxun Feihong Electricial Co., Ltd." },

7613 { 0x001DC6, "SNR Inc." },

7614 { 0x001DC7, "L-3 Communications Geneva Aerospace" },

7615 { 0x001DC8, "Navionics Research Inc., dba SCADAmetrics" },

7616 { 0x001DC9, "GainSpan Corp." },

7617 { 0x001DCA, "PAV Electronics Limited" },

7618 { 0x001DCB, "Exéns Development Oy" },

7619 { 0x001DCC, "Ayon Cyber Security, Inc" },

7620 { 0x001DCD, "ARRIS Group, Inc." },

7621 { 0x001DCE, "ARRIS Group, Inc." },

7622 { 0x001DCF, "ARRIS Group, Inc." },

7623 { 0x001DD0, "ARRIS Group, Inc." },

7624 { 0x001DD1, "ARRIS Group, Inc." },

7625 { 0x001DD2, "ARRIS Group, Inc." },

7626 { 0x001DD3, "ARRIS Group, Inc." },

7627 { 0x001DD4, "ARRIS Group, Inc." },

7628 { 0x001DD5, "ARRIS Group, Inc." },

7629 { 0x001DD6, "ARRIS Group, Inc." },

7630 { 0x001DD7, "Algolith" },

7631 { 0x001DD8, "Microsoft Corporation" },

7632 { 0x001DD9, "Hon Hai Precision Ind. Co.,Ltd." },

7633 { 0x001DDA, "Mikroelektronika spol. s r. o." },

7634 { 0x001DDB, "C-BEL Corporation" },

7635 { 0x001DDC, "HangZhou DeChangLong Tech&Info Co.,Ltd" },

7636 { 0x001DDD, "DAT H.K. LIMITED" },

7637 { 0x001DDE, "Zhejiang Broadcast&Television Technology Co.,Ltd." },

7638 { 0x001DDF, "Sunitec Enterprise Co.,Ltd" },

7639 { 0x001DE0, "Intel Corporate" },

7640 { 0x001DE1, "Intel Corporate" },

7641 { 0x001DE2, "Radionor Communications" },

7642 { 0x001DE3, "Intuicom" },

7643 { 0x001DE4, "Visioneered Image Systems" },

7644 { 0x001DE5, "Cisco Systems, Inc" },

7645 { 0x001DE6, "Cisco Systems, Inc" },

7646 { 0x001DE7, "Marine Sonic Technology, Ltd." },

7647 { 0x001DE8, "Nikko Denki Tsushin Corporation(NDTC)" },

7648 { 0x001DE9, "Nokia Danmark A/S" },

7649 { 0x001DEA, "Commtest Instruments Ltd" },

7650 { 0x001DEB, "DINEC International" },

7651 { 0x001DEC, "Marusys" },

7652 { 0x001DED, "Grid Net, Inc." },

7653 { 0x001DEE, "NEXTVISION SISTEMAS DIGITAIS DE TELEVISÃO LTDA." },

7654 { 0x001DEF, "TRIMM, INC." },

7655 { 0x001DF0, "Vidient Systems, Inc." },

7656 { 0x001DF1, "Intego Systems, Inc." },

7657 { 0x001DF2, "Netflix, Inc." },

7658 { 0x001DF3, "SBS Science & Technology Co., Ltd" },

7659 { 0x001DF4, "Magellan Technology Pty Limited" },

7660 { 0x001DF5, "Sunshine Co,LTD" },

7661 { 0x001DF6, "Samsung Electronics Co.,Ltd" },

7662 { 0x001DF7, "R. STAHL Schaltgeräte GmbH" },

7663 { 0x001DF8, "Webpro Vision Technology Corporation" },

7664 { 0x001DF9, "Cybiotronics (Far East) Limited" },

7665 { 0x001DFA, "Fujian LANDI Commercial Equipment Co.,Ltd" },

7666 { 0x001DFB, "NETCLEUS Systems Corporation" },

7667 { 0x001DFC, "KSIC" },

7668 { 0x001DFD, "Nokia Danmark A/S" },

7669 { 0x001DFE, "Palm, Inc" },

7670 { 0x001DFF, "Network Critical Solutions Ltd" },

7671 { 0x001E00, "Shantou Institute of Ultrasonic Instruments" },

7672 { 0x001E01, "Renesas Technology Sales Co., Ltd." },

7673 { 0x001E02, "Sougou Keikaku Kougyou Co.,Ltd." },

7674 { 0x001E03, "LiComm Co., Ltd." },

7675 { 0x001E04, "Hanson Research Corporation" },

7676 { 0x001E05, "Xseed Technologies & Computing" },

7677 { 0x001E06, "WIBRAIN" },

7678 { 0x001E07, "Winy Technology Co., Ltd." },

7679 { 0x001E08, "Centec Networks Inc" },

7680 { 0x001E09, "ZEFATEK Co.,LTD" },

7681 { 0x001E0A, "Syba Tech Limited" },

7682 { 0x001E0B, "Hewlett Packard" },

7683 { 0x001E0C, "Sherwood Information Partners, Inc." },

7684 { 0x001E0D, "Micran Ltd." },

7685 { 0x001E0E, "MAXI VIEW HOLDINGS LIMITED" },

7686 { 0x001E0F, "Briot International" },

7687 { 0x001E10, "HUAWEI TECHNOLOGIES CO.,LTD" },

7688 { 0x001E11, "ELELUX INTERNATIONAL LTD" },

7689 { 0x001E12, "Ecolab" },

7690 { 0x001E13, "Cisco Systems, Inc" },

7691 { 0x001E14, "Cisco Systems, Inc" },

7692 { 0x001E15, "Beech Hill Electronics" },

7693 { 0x001E16, "Keytronix" },

7694 { 0x001E17, "STN BV" },

7695 { 0x001E18, "Radio Activity srl" },

7696 { 0x001E19, "GTRI" },

7697 { 0x001E1A, "Best Source Taiwan Inc." },

7698 { 0x001E1B, "Digital Stream Technology, Inc." },

7699 { 0x001E1C, "SWS Australia Pty Limited" },

7700 { 0x001E1D, "East Coast Datacom, Inc." },

7701 { 0x001E1E, "Honeywell Life Safety" },

7702 { 0x001E1F, "Nortel Networks" },

7703 { 0x001E20, "Intertain Inc." },

7704 { 0x001E21, "Qisda Corporation" },

7705 { 0x001E22, "ARVOO Imaging Products BV" },

7706 { 0x001E23, "Electronic Educational Devices, Inc" },

7707 { 0x001E24, "Zhejiang Bell Technology Co.,ltd" },

7708 { 0x001E25, "INTEK DIGITAL" },

7709 { 0x001E26, "Digifriends Co. Ltd" },

7710 { 0x001E27, "SBN TECH Co.,Ltd." },

7711 { 0x001E28, "Lumexis Corporation" },

7712 { 0x001E29, "Hypertherm Inc" },

7713 { 0x001E2A, "NETGEAR" },

7714 { 0x001E2B, "Radio Systems Design, Inc." },

7715 { 0x001E2C, "CyVerse Corporation" },

7716 { 0x001E2D, "STIM" },

7717 { 0x001E2E, "SIRTI S.p.A." },

7718 { 0x001E2F, "DiMoto Pty Ltd" },

7719 { 0x001E30, "Shireen Inc" },

7720 { 0x001E31, "infomark" },

7721 { 0x001E32, "Zensys" },

7722 { 0x001E33, "INVENTEC CORPORATION" },

7723 { 0x001E34, "CryptoMetrics" },

7724 { 0x001E35, "Nintendo Co., Ltd." },

7725 { 0x001E36, "IPTE" },

7726 { 0x001E37, "Universal Global Scientific Industrial Co., Ltd." },

7727 { 0x001E38, "Bluecard Software Technology Co., Ltd." },

7728 { 0x001E39, "Comsys Communication Ltd." },

7729 { 0x001E3A, "Nokia Danmark A/S" },

7730 { 0x001E3B, "Nokia Danmark A/S" },

7731 { 0x001E3C, "Lyngbox Media AB" },

7732 { 0x001E3D, "ALPSALPINE CO,.LTD" },

7733 { 0x001E3E, "KMW Inc." },

7734 { 0x001E3F, "TrellisWare Technologies, Inc." },

7735 { 0x001E40, "Shanghai DareGlobal Technologies Co.,Ltd" },

7736 { 0x001E41, "Microwave Communication & Component, Inc." },

7737 { 0x001E42, "Teltonika" },

7738 { 0x001E43, "AISIN CORPORATION" },

7739 { 0x001E44, "SANTEC" },

7740 { 0x001E45, "Sony Corporation" },

7741 { 0x001E46, "ARRIS Group, Inc." },

7742 { 0x001E47, "PT. Hariff Daya Tunggal Engineering" },

7743 { 0x001E48, "Wi-Links" },

7744 { 0x001E49, "Cisco Systems, Inc" },

7745 { 0x001E4A, "Cisco Systems, Inc" },

7746 { 0x001E4B, "City Theatrical" },

7747 { 0x001E4C, "Hon Hai Precision Ind. Co.,Ltd." },

7748 { 0x001E4D, "Welkin Sciences, LLC" },

7749 { 0x001E4E, "DAKO EDV-Ingenieur- und Systemhaus GmbH" },

7750 { 0x001E4F, "Dell Inc." },

7751 { 0x001E50, "BATTISTONI RESEARCH" },

7752 { 0x001E51, "Converter Industry Srl" },

7753 { 0x001E52, "Apple, Inc." },

7754 { 0x001E53, "Further Tech Co., LTD" },

7755 { 0x001E54, "TOYO ELECTRIC Corporation" },

7756 { 0x001E55, "COWON SYSTEMS,Inc." },

7757 { 0x001E56, "Bally Wulff Entertainment GmbH" },

7758 { 0x001E57, "ALCOMA, spol. s r.o." },

7759 { 0x001E58, "D-Link Corporation" },

7760 { 0x001E59, "Silicon Turnkey Express, LLC" },

7761 { 0x001E5A, "ARRIS Group, Inc." },

7762 { 0x001E5B, "Unitron Company, Inc." },

7763 { 0x001E5C, "RB GeneralEkonomik" },

7764 { 0x001E5D, "Holosys d.o.o." },

7765 { 0x001E5E, "COmputime Ltd." },

7766 { 0x001E5F, "KwikByte, LLC" },

7767 { 0x001E60, "Digital Lighting Systems, Inc" },

7768 { 0x001E61, "ITEC GmbH" },

7769 { 0x001E62, "Siemon" },

7770 { 0x001E63, "Vibro-Meter SA" },

7771 { 0x001E64, "Intel Corporate" },

7772 { 0x001E65, "Intel Corporate" },

7773 { 0x001E66, "RESOL Elektronische Regelungen GmbH" },

7774 { 0x001E67, "Intel Corporate" },

7775 { 0x001E68, "Quanta Computer Inc." },

7776 { 0x001E69, "Thomson Inc." },

7777 { 0x001E6A, "Beijing Bluexon Technology Co.,Ltd" },

7778 { 0x001E6B, "Cisco SPVTG" },

7779 { 0x001E6C, "Opaque Systems" },

7780 { 0x001E6D, "IT R&D Center" },

7781 { 0x001E6E, "Shenzhen First Mile Communications Ltd" },

7782 { 0x001E6F, "Magna-Power Electronics, Inc." },

7783 { 0x001E70, "Chelton Limited" },

7784 { 0x001E71, "MIrcom Group of Companies" },

7785 { 0x001E72, "PCS" },

7786 { 0x001E73, "zte corporation" },

7787 { 0x001E74, "Sagemcom Broadband SAS" },

7788 { 0x001E75, "LG Electronics (Mobile Communications)" },

7789 { 0x001E76, "Thermo Fisher Scientific" },

7790 { 0x001E77, "Air2App" },

7791 { 0x001E78, "Owitek Technology Ltd.," },

7792 { 0x001E79, "Cisco Systems, Inc" },

7793 { 0x001E7A, "Cisco Systems, Inc" },

7794 { 0x001E7B, "R.I.CO. S.r.l." },

7795 { 0x001E7C, "Taiwick Limited" },

7796 { 0x001E7D, "Samsung Electronics Co.,Ltd" },

7797 { 0x001E7E, "Nortel Networks" },

7798 { 0x001E7F, "CBM of America" },

7799 { 0x001E80, "Icotera A/S" },

7800 { 0x001E81, "CNB Technology Inc." },

7801 { 0x001E82, "SanDisk Corporation" },

7802 { 0x001E83, "LAN/MAN Standards Association (LMSC)" },

7803 { 0x001E84, "Pika Technologies Inc." },

7804 { 0x001E85, "Lagotek Corporation" },

7805 { 0x001E86, "MEL Co.,Ltd." },

7806 { 0x001E87, "Realease Limited" },

7807 { 0x001E88, "ANDOR SYSTEM SUPPORT CO., LTD." },

7808 { 0x001E89, "CRFS Limited" },

7809 { 0x001E8A, "eCopy, Inc" },

7810 { 0x001E8B, "Infra Access Korea Co., Ltd." },

7811 { 0x001E8C, "ASUSTek COMPUTER INC." },

7812 { 0x001E8D, "ARRIS Group, Inc." },

7813 { 0x001E8E, "Hunkeler AG" },

7814 { 0x001E8F, "CANON INC." },

7815 { 0x001E90, "Elitegroup Computer Systems Co.,Ltd." },

7816 { 0x001E91, "KIMIN Electronic Co., Ltd." },

7817 { 0x001E92, "JEULIN S.A." },

7818 { 0x001E93, "CiriTech Systems Inc" },

7819 { 0x001E94, "SUPERCOM TECHNOLOGY CORPORATION" },

7820 { 0x001E95, "SIGMALINK" },

7821 { 0x001E96, "Sepura Plc" },

7822 { 0x001E97, "Medium Link System Technology CO., LTD," },

7823 { 0x001E98, "GreenLine Communications" },

7824 { 0x001E99, "Vantanol Industrial Corporation" },

7825 { 0x001E9A, "HAMILTON Bonaduz AG" },

7826 { 0x001E9B, "San-Eisha, Ltd." },

7827 { 0x001E9C, "Fidustron INC" },

7828 { 0x001E9D, "Recall Technologies, Inc." },

7829 { 0x001E9E, "ddm hopt + schuler Gmbh + Co. KG" },

7830 { 0x001E9F, "Visioneering Systems, Inc." },

7831 { 0x001EA0, "XLN-t" },

7832 { 0x001EA1, "Brunata a/s" },

7833 { 0x001EA2, "Symx Systems, Inc." },

7834 { 0x001EA3, "Nokia Danmark A/S" },

7835 { 0x001EA4, "Nokia Danmark A/S" },

7836 { 0x001EA5, "ROBOTOUS, Inc." },

7837 { 0x001EA6, "Best IT World (India) Pvt. Ltd." },

7838 { 0x001EA7, "Actiontec Electronics, Inc" },

7839 { 0x001EA8, "Datang Mobile Communications Equipment CO.,LTD" },

7840 { 0x001EA9, "Nintendo Co., Ltd." },

7841 { 0x001EAA, "E-Senza Technologies GmbH" },

7842 { 0x001EAB, "TeleWell Oy" },

7843 { 0x001EAC, "Armadeus Systems" },

7844 { 0x001EAD, "Wingtech Group Limited" },

7845 { 0x001EAE, "Continental Automotive Systems Inc." },

7846 { 0x001EAF, "Ophir Optronics Ltd" },

7847 { 0x001EB0, "ImesD Electronica S.L." },

7848 { 0x001EB1, "Cryptsoft Pty Ltd" },

7849 { 0x001EB2, "LG Innotek" },

7850 { 0x001EB3, "Primex Wireless" },

7851 { 0x001EB4, "UNIFAT TECHNOLOGY LTD." },

7852 { 0x001EB5, "Ever Sparkle Technologies Ltd" },

7853 { 0x001EB6, "TAG Heuer SA" },

7854 { 0x001EB7, "TBTech, Co., Ltd." },

7855 { 0x001EB8, "Aloys, Inc" },

7856 { 0x001EB9, "Sing Fai Technology Limited" },

7857 { 0x001EBA, "High Density Devices AS" },

7858 { 0x001EBB, "BLUELIGHT TECHNOLOGY INC." },

7859 { 0x001EBC, "WINTECH AUTOMATION CO.,LTD." },

7860 { 0x001EBD, "Cisco Systems, Inc" },

7861 { 0x001EBE, "Cisco Systems, Inc" },

7862 { 0x001EBF, "Haas Automation Inc." },

7863 { 0x001EC0, "Microchip Technology Inc." },

7864 { 0x001EC1, "3COM EUROPE LTD" },

7865 { 0x001EC2, "Apple, Inc." },

7866 { 0x001EC3, "Kozio, Inc." },

7867 { 0x001EC4, "Celio Corp" },

7868 { 0x001EC5, "Middle Atlantic Products Inc" },

7869 { 0x001EC6, "Obvius Holdings LLC" },

7870 { 0x001EC7, "2Wire Inc" },

7871 { 0x001EC8, "Rapid Mobile (Pty) Ltd" },

7872 { 0x001EC9, "Dell Inc." },

7873 { 0x001ECA, "Nortel Networks" },

7874 { 0x001ECB, "RPC Energoautomatika Ltd" },

7875 { 0x001ECC, "CDVI" },

7876 { 0x001ECD, "KYLAND Technology Co. LTD" },

7877 { 0x001ECE, "BISA Technologies (Hong Kong) Limited" },

7878 { 0x001ECF, "PHILIPS ELECTRONICS UK LTD" },

7879 { 0x001ED0, "Ingespace" },

7880 { 0x001ED1, "Keyprocessor B.V." },

7881 { 0x001ED2, "Ray Shine Video Technology Inc" },

7882 { 0x001ED3, "Dot Technology Int'l Co., Ltd." },

7883 { 0x001ED4, "Doble Engineering" },

7884 { 0x001ED5, "Tekon-Automatics" },

7885 { 0x001ED6, "Alentec & Orion AB" },

7886 { 0x001ED7, "H-Stream Wireless, Inc." },

7887 { 0x001ED8, "Digital United Inc." },

7888 { 0x001ED9, "Mitsubishi Precision Co.,LTd." },

7889 { 0x001EDA, "Wesemann Elektrotechniek B.V." },

7890 { 0x001EDB, "Giken Trastem Co., Ltd." },

7891 { 0x001EDC, "Sony Corporation" },

7892 { 0x001EDD, "WASKO S.A." },

7893 { 0x001EDE, "BYD COMPANY LIMITED" },

7894 { 0x001EDF, "Master Industrialization Center Kista" },

7895 { 0x001EE0, "Urmet SpA" },

7896 { 0x001EE1, "Samsung Electronics Co.,Ltd" },

7897 { 0x001EE2, "Samsung Electronics Co.,Ltd" },

7898 { 0x001EE3, "T&W Electronics (ShenZhen) Co.,Ltd" },

7899 { 0x001EE4, "ACS Solutions France" },

7900 { 0x001EE5, "Cisco-Linksys, LLC" },

7901 { 0x001EE6, "Shenzhen Advanced Video Info-Tech Co., Ltd." },

7902 { 0x001EE7, "Epic Systems Inc" },

7903 { 0x001EE8, "Mytek" },

7904 { 0x001EE9, "Stoneridge Electronics AB" },

7905 { 0x001EEA, "Sensor Switch, Inc." },

7906 { 0x001EEB, "Talk-A-Phone Co." },

7907 { 0x001EEC, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

7908 { 0x001EED, "Adventiq Ltd." },

7909 { 0x001EEE, "ETL Systems Ltd" },

7910 { 0x001EEF, "Cantronic International Limited" },

7911 { 0x001EF0, "Gigafin Networks" },

7912 { 0x001EF1, "Servimat" },

7913 { 0x001EF2, "Micro Motion Inc" },

7914 { 0x001EF3, "From2" },

7915 { 0x001EF4, "L-3 Communications Display Systems" },

7916 { 0x001EF5, "Hitek Automated Inc." },

7917 { 0x001EF6, "Cisco Systems, Inc" },

7918 { 0x001EF7, "Cisco Systems, Inc" },

7919 { 0x001EF8, "Emfinity Inc." },

7920 { 0x001EF9, "Pascom Kommunikations systeme GmbH." },

7921 { 0x001EFA, "PROTEI Ltd." },

7922 { 0x001EFB, "Trio Motion Technology Ltd" },

7923 { 0x001EFC, "JSC MASSA-K" },

7924 { 0x001EFD, "Microbit 2.0 AB" },

7925 { 0x001EFE, "LEVEL s.r.o." },

7926 { 0x001EFF, "Mueller-Elektronik GmbH & Co. KG" },

7927 { 0x001F00, "Nokia Danmark A/S" },

7928 { 0x001F01, "Nokia Danmark A/S" },

7929 { 0x001F02, "Pixelmetrix Corporation Pte Ltd" },

7930 { 0x001F03, "NUM AG" },

7931 { 0x001F04, "Granch Ltd." },

7932 { 0x001F05, "iTAS Technology Corp." },

7933 { 0x001F06, "Integrated Dispatch Solutions" },

7934 { 0x001F07, "AZTEQ Mobile" },

7935 { 0x001F08, "RISCO LTD" },

7936 { 0x001F09, "Jastec" },

7937 { 0x001F0A, "Nortel Networks" },

7938 { 0x001F0B, "Federal State Unitary Enterprise Industrial UnionElectropribor" },

7939 { 0x001F0C, "Intelligent Digital Services GmbH" },

7940 { 0x001F0D, "L3 Communications - Telemetry West" },

7941 { 0x001F0E, "Japan Kyastem Co., Ltd" },

7942 { 0x001F0F, "Select Engineered Systems" },

7943 { 0x001F10, "TOLEDO DO BRASIL INDUSTRIA DE BALANCAS LTDA" },

7944 { 0x001F11, "OPENMOKO, INC." },

7945 { 0x001F12, "Juniper Networks" },

7946 { 0x001F13, "S.& A.S. Ltd." },

7947 { 0x001F14, "NexG" },

7948 { 0x001F15, "Bioscrypt Inc" },

7949 { 0x001F16, "Wistron Corporation" },

7950 { 0x001F17, "IDX Company, Ltd." },

7951 { 0x001F18, "Hakusan.Mfg.Co,.Ltd" },

7952 { 0x001F19, "BEN-RI ELECTRONICA S.A." },

7953 { 0x001F1A, "Prominvest" },

7954 { 0x001F1B, "RoyalTek Company Ltd." },

7955 { 0x001F1C, "KOBISHI ELECTRIC Co.,Ltd." },

7956 { 0x001F1D, "Atlas Material Testing Technology LLC" },

7957 { 0x001F1E, "Astec Technology Co., Ltd" },

7958 { 0x001F1F, "Edimax Technology Co. Ltd." },

7959 { 0x001F20, "Logitech Europe SA" },

7960 { 0x001F21, "Inner Mongolia Yin An Science & Technology Development Co.,L" },

7961 { 0x001F22, "Source Photonics, Inc." },

7962 { 0x001F23, "Interacoustics" },

7963 { 0x001F24, "DIGITVIEW TECHNOLOGY CO., LTD." },

7964 { 0x001F25, "MBS GmbH" },

7965 { 0x001F26, "Cisco Systems, Inc" },

7966 { 0x001F27, "Cisco Systems, Inc" },

7967 { 0x001F28, "HPN Supply Chain" },

7968 { 0x001F29, "Hewlett Packard" },

7969 { 0x001F2A, "ACCM" },

7970 { 0x001F2B, "Orange Logic" },

7971 { 0x001F2C, "Starbridge Networks" },

7972 { 0x001F2D, "Electro-Optical Imaging, Inc." },

7973 { 0x001F2E, "Triangle Research Int'l Pte Ltd" },

7974 { 0x001F2F, "Berker GmbH & Co. KG" },

7975 { 0x001F30, "Travelping" },

7976 { 0x001F31, "Radiocomp" },

7977 { 0x001F32, "Nintendo Co., Ltd." },

7978 { 0x001F33, "NETGEAR" },

7979 { 0x001F34, "Lung Hwa Electronics Co., Ltd." },

7980 { 0x001F35, "AIR802 LLC" },

7981 { 0x001F36, "Bellwin Information Co. Ltd.," },

7982 { 0x001F37, "Genesis I&C" },

7983 { 0x001F38, "POSITRON" },

7984 { 0x001F39, "Construcciones y Auxiliar de Ferrocarriles, S.A." },

7985 { 0x001F3A, "Hon Hai Precision Ind. Co.,Ltd." },

7986 { 0x001F3B, "Intel Corporate" },

7987 { 0x001F3C, "Intel Corporate" },

7988 { 0x001F3D, "Qbit GmbH" },

7989 { 0x001F3E, "RP-Technik e.K." },

7990 { 0x001F3F, "AVM GmbH" },

7991 { 0x001F40, "Speakercraft Inc." },

7992 { 0x001F41, "Ruckus Wireless" },

7993 { 0x001F42, "Etherstack plc" },

7994 { 0x001F43, "ENTES ELEKTRONIK" },

7995 { 0x001F44, "GE Transportation Systems" },

7996 { 0x001F45, "Enterasys" },

7997 { 0x001F46, "Nortel Networks" },

7998 { 0x001F47, "MCS Logic Inc." },

7999 { 0x001F48, "Mojix Inc." },

8000 { 0x001F49, "Manhattan TV Ltd" },

8001 { 0x001F4A, "Albentia Systems S.A." },

8002 { 0x001F4B, "Lineage Power" },

8003 { 0x001F4C, "Roseman Engineering Ltd" },

8004 { 0x001F4D, "Segnetics LLC" },

8005 { 0x001F4E, "ConMed Linvatec" },

8006 { 0x001F4F, "Thinkware Co. Ltd." },

8007 { 0x001F50, "Swissdis AG" },

8008 { 0x001F51, "HD Communications Corp" },

8009 { 0x001F52, "UVT Unternehmensberatung fur Verkehr und Technik GmbH" },

8010 { 0x001F53, "GEMAC Chemnitz GmbH" },

8011 { 0x001F54, "Lorex Technology Inc." },

8012 { 0x001F55, "Honeywell Security (China) Co., Ltd." },

8013 { 0x001F56, "DIGITAL FORECAST" },

8014 { 0x001F57, "Phonik Innovation Co.,LTD" },

8015 { 0x001F58, "EMH Energiemesstechnik GmbH" },

8016 { 0x001F59, "Kronback Tracers" },

8017 { 0x001F5A, "Beckwith Electric Co." },

8018 { 0x001F5B, "Apple, Inc." },

8019 { 0x001F5C, "Nokia Danmark A/S" },

8020 { 0x001F5D, "Nokia Danmark A/S" },

8021 { 0x001F5E, "Dyna Technology Co.,Ltd." },

8022 { 0x001F5F, "Blatand GmbH" },

8023 { 0x001F60, "COMPASS SYSTEMS CORP." },

8024 { 0x001F61, "Talent Communication Networks Inc." },

8025 { 0x001F62, "JSC Stilsoft" },

8026 { 0x001F63, "JSC Goodwin-Europa" },

8027 { 0x001F64, "Beijing Autelan Technology Inc." },

8028 { 0x001F65, "KOREA ELECTRIC TERMINAL CO., LTD." },

8029 { 0x001F66, "PLANAR LLC" },

8030 { 0x001F67, "Hitachi,Ltd." },

8031 { 0x001F68, "Martinsson Elektronik AB" },

8032 { 0x001F69, "Pingood Technology Co., Ltd." },

8033 { 0x001F6A, "PacketFlux Technologies, Inc." },

8034 { 0x001F6B, "LG Electronics (Mobile Communications)" },

8035 { 0x001F6C, "Cisco Systems, Inc" },

8036 { 0x001F6D, "Cisco Systems, Inc" },

8037 { 0x001F6E, "Vtech Engineering Corporation" },

8038 { 0x001F6F, "Fujian Sunnada Communication Co.,Ltd." },

8039 { 0x001F70, "Botik Technologies LTD" },

8040 { 0x001F71, "xG Technology, Inc." },

8041 { 0x001F72, "QingDao Hiphone Technology Co,.Ltd" },

8042 { 0x001F73, "Teraview Technology Co., Ltd." },

8043 { 0x001F74, "Eigen Development" },

8044 { 0x001F75, "GiBahn Media" },

8045 { 0x001F76, "AirLogic Systems Inc." },

8046 { 0x001F77, "HEOL DESIGN" },

8047 { 0x001F78, "Blue Fox Porini Textile" },

8048 { 0x001F79, "Lodam Electronics A/S" },

8049 { 0x001F7A, "WiWide Inc." },

8050 { 0x001F7B, "TechNexion Ltd." },

8051 { 0x001F7C, "Witelcom AS" },

8052 { 0x001F7D, "Embedded Wireless GmbH" },

8053 { 0x001F7E, "ARRIS Group, Inc." },

8054 { 0x001F7F, "Phabrix Limited" },

8055 { 0x001F80, "Lucas Holding bv" },

8056 { 0x001F81, "Accel Semiconductor Corp" },

8057 { 0x001F82, "Cal-Comp Electronics & Communications Company Ltd." },

8058 { 0x001F83, "Teleplan Technology Services Sdn Bhd" },

8059 { 0x001F84, "Gigle Semiconductor" },

8060 { 0x001F85, "Apriva ISS, LLC" },

8061 { 0x001F86, "digEcor" },

8062 { 0x001F87, "Skydigital Inc." },

8063 { 0x001F88, "FMS Force Measuring Systems AG" },

8064 { 0x001F89, "Signalion GmbH" },

8065 { 0x001F8A, "Ellion Digital Inc." },

8066 { 0x001F8B, "Cache IQ" },

8067 { 0x001F8C, "CCS Inc." },

8068 { 0x001F8D, "Ingenieurbuero Stark GmbH und Ko. KG" },

8069 { 0x001F8E, "Metris USA Inc." },

8070 { 0x001F8F, "Shanghai Bellmann Digital Source Co.,Ltd." },

8071 { 0x001F90, "Actiontec Electronics, Inc" },

8072 { 0x001F91, "DBS Lodging Technologies, LLC" },

8073 { 0x001F92, "Motorola Solutions Inc." },

8074 { 0x001F93, "Xiotech Corporation" },

8075 { 0x001F94, "Lascar Electronics Ltd" },

8076 { 0x001F95, "Sagemcom Broadband SAS" },

8077 { 0x001F96, "APROTECH CO.LTD" },

8078 { 0x001F97, "BERTANA srl" },

8079 { 0x001F98, "DAIICHI-DENTSU LTD." },

8080 { 0x001F99, "SERONICS co.ltd" },

8081 { 0x001F9A, "Nortel Networks" },

8082 { 0x001F9B, "POSBRO" },

8083 { 0x001F9C, "Havis Inc." },

8084 { 0x001F9D, "Cisco Systems, Inc" },

8085 { 0x001F9E, "Cisco Systems, Inc" },

8086 { 0x001F9F, "Thomson Telecom Belgium" },

8087 { 0x001FA0, "A10 Networks" },

8088 { 0x001FA1, "Gtran Inc" },

8089 { 0x001FA2, "Datron World Communications, Inc." },

8090 { 0x001FA3, "T&W Electronics(Shenzhen)Co.,Ltd." },

8091 { 0x001FA4, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

8092 { 0x001FA5, "Blue-White Industries" },

8093 { 0x001FA6, "Stilo srl" },

8094 { 0x001FA7, "Sony Interactive Entertainment Inc." },

8095 { 0x001FA8, "Smart Energy Instruments Inc." },

8096 { 0x001FA9, "Atlanta DTH, Inc." },

8097 { 0x001FAA, "Taseon, Inc." },

8098 { 0x001FAB, "I.S HIGH TECH.INC" },

8099 { 0x001FAC, "Goodmill Systems Ltd" },

8100 { 0x001FAD, "Brown Innovations, Inc" },

8101 { 0x001FAE, "Blick South Africa (Pty) Ltd" },

8102 { 0x001FAF, "NextIO, Inc." },

8103 { 0x001FB0, "TimeIPS, Inc." },

8104 { 0x001FB1, "Cybertech Inc." },

8105 { 0x001FB2, "Sontheim Industrie Elektronik GmbH" },

8106 { 0x001FB3, "2Wire Inc" },

8107 { 0x001FB4, "SmartShare Systems" },

8108 { 0x001FB5, "I/O Interconnect Inc." },

8109 { 0x001FB6, "Chi Lin Technology Co., Ltd." },

8110 { 0x001FB7, "WiMate Technologies Corp." },

8111 { 0x001FB8, "Universal Remote Control, Inc." },

8112 { 0x001FB9, "Paltronics" },

8113 { 0x001FBA, "Boyoung Tech" },

8114 { 0x001FBB, "Xenatech Co.,LTD" },

8115 { 0x001FBC, "EVGA Corporation" },

8116 { 0x001FBD, "Kyocera Wireless Corp." },

8117 { 0x001FBE, "Shenzhen Mopnet Industrial Co.,Ltd" },

8118 { 0x001FBF, "Fulhua Microelectronics Corp. Taiwan Branch" },

8119 { 0x001FC0, "Control Express Finland Oy" },

8120 { 0x001FC1, "Hanlong Technology Co.,LTD" },

8121 { 0x001FC2, "Jow Tong Technology Co Ltd" },

8122 { 0x001FC3, "SmartSynch, Inc" },

8123 { 0x001FC4, "ARRIS Group, Inc." },

8124 { 0x001FC5, "Nintendo Co., Ltd." },

8125 { 0x001FC6, "ASUSTek COMPUTER INC." },

8126 { 0x001FC7, "Casio Hitachi Mobile Communications Co., Ltd." },

8127 { 0x001FC8, "Up-Today Industrial Co., Ltd." },

8128 { 0x001FC9, "Cisco Systems, Inc" },

8129 { 0x001FCA, "Cisco Systems, Inc" },

8130 { 0x001FCB, "NIW Solutions" },

8131 { 0x001FCC, "Samsung Electronics Co.,Ltd" },

8132 { 0x001FCD, "Samsung Electronics Co.,Ltd" },

8133 { 0x001FCE, "QTECH LLC" },

8134 { 0x001FCF, "MSI Technology GmbH" },

8135 { 0x001FD0, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

8136 { 0x001FD1, "OPTEX CO.,LTD." },

8137 { 0x001FD2, "COMMTECH TECHNOLOGY MACAO COMMERCIAL OFFSHORE LTD." },

8138 { 0x001FD3, "RIVA Networks Inc." },

8139 { 0x001FD4, "4IPNET, INC." },

8140 { 0x001FD5, "MICRORISC s.r.o." },

8141 { 0x001FD6, "Shenzhen Allywll" },

8142 { 0x001FD7, "TELERAD SA" },

8143 { 0x001FD8, "A-TRUST COMPUTER CORPORATION" },

8144 { 0x001FD9, "RSD Communications Ltd" },

8145 { 0x001FDA, "Nortel Networks" },

8146 { 0x001FDB, "Network Supply Corp.," },

8147 { 0x001FDC, "Mobile Safe Track Ltd" },

8148 { 0x001FDD, "GDI LLC" },

8149 { 0x001FDE, "Nokia Danmark A/S" },

8150 { 0x001FDF, "Nokia Danmark A/S" },

8151 { 0x001FE0, "EdgeVelocity Corp" },

8152 { 0x001FE1, "Hon Hai Precision Ind. Co.,Ltd." },

8153 { 0x001FE2, "Hon Hai Precision Ind. Co.,Ltd." },

8154 { 0x001FE3, "LG Electronics (Mobile Communications)" },

8155 { 0x001FE4, "Sony Corporation" },

8156 { 0x001FE5, "In-Circuit GmbH" },

8157 { 0x001FE6, "Alphion Corporation" },

8158 { 0x001FE7, "Simet" },

8159 { 0x001FE8, "KURUSUGAWA Electronics Industry Inc,." },

8160 { 0x001FE9, "Printrex, Inc." },

8161 { 0x001FEA, "Applied Media Technologies Corporation" },

8162 { 0x001FEB, "Trio Datacom Pty Ltd" },

8163 { 0x001FEC, "Synapse Électronique" },

8164 { 0x001FED, "Tecan Systems Inc." },

8165 { 0x001FEE, "ubisys technologies GmbH" },

8166 { 0x001FEF, "SHINSEI INDUSTRIES CO.,LTD" },

8167 { 0x001FF0, "Audio Partnership" },

8168 { 0x001FF1, "Paradox Hellas S.A." },

8169 { 0x001FF2, "VIA Technologies, Inc." },

8170 { 0x001FF3, "Apple, Inc." },

8171 { 0x001FF4, "Power Monitors, Inc." },

8172 { 0x001FF5, "Kongsberg Defence & Aerospace" },

8173 { 0x001FF6, "PS Audio International" },

8174 { 0x001FF7, "Nakajima All Precision Co., Ltd." },

8175 { 0x001FF8, "Siemens AG, Sector Industry, Drive Technologies, Motion Control Systems" },

8176 { 0x001FF9, "Advanced Knowledge Associates" },

8177 { 0x001FFA, "Coretree, Co, Ltd" },

8178 { 0x001FFB, "Green Packet Bhd" },

8179 { 0x001FFC, "Riccius+Sohn GmbH" },

8180 { 0x001FFD, "Indigo Mobile Technologies Corp." },

8181 { 0x001FFE, "HPN Supply Chain" },

8182 { 0x001FFF, "Respironics, Inc." },

8183 { 0x002000, "LEXMARK INTERNATIONAL, INC." },

8184 { 0x002001, "DSP SOLUTIONS, INC." },

8185 { 0x002002, "SERITECH ENTERPRISE CO., LTD." },

8186 { 0x002003, "PIXEL POWER LTD." },

8187 { 0x002004, "YAMATAKE-HONEYWELL CO., LTD." },

8188 { 0x002005, "SIMPLE TECHNOLOGY" },

8189 { 0x002006, "GARRETT COMMUNICATIONS, INC." },

8190 { 0x002007, "SFA, INC." },

8191 { 0x002008, "CABLE & COMPUTER TECHNOLOGY" },

8192 { 0x002009, "PACKARD BELL ELEC., INC." },

8193 { 0x00200A, "SOURCE-COMM CORP." },

8194 { 0x00200B, "OCTAGON SYSTEMS CORP." },

8195 { 0x00200C, "ADASTRA SYSTEMS CORP." },

8196 { 0x00200D, "CARL ZEISS" },

8197 { 0x00200E, "NSSLGlobal Technologies AS" },

8198 { 0x00200F, "EBRAINS Inc" },

8199 { 0x002010, "JEOL SYSTEM TECHNOLOGY CO. LTD" },

8200 { 0x002011, "CANOPUS CO., LTD." },

8201 { 0x002012, "CAMTRONICS MEDICAL SYSTEMS" },

8202 { 0x002013, "DIVERSIFIED TECHNOLOGY, INC." },

8203 { 0x002014, "GLOBAL VIEW CO., LTD." },

8204 { 0x002015, "ACTIS COMPUTER SA" },

8205 { 0x002016, "SHOWA ELECTRIC WIRE & CABLE CO" },

8206 { 0x002017, "ORBOTECH" },

8207 { 0x002018, "CIS TECHNOLOGY INC." },

8208 { 0x002019, "OHLER GMBH" },

8209 { 0x00201A, "MRV Communications, Inc." },

8210 { 0x00201B, "NORTHERN TELECOM/NETWORK" },

8211 { 0x00201C, "EXCEL, INC." },

8212 { 0x00201D, "KATANA PRODUCTS" },

8213 { 0x00201E, "NETQUEST CORPORATION" },

8214 { 0x00201F, "BEST POWER TECHNOLOGY, INC." },

8215 { 0x002020, "MEGATRON COMPUTER INDUSTRIES PTY, LTD." },

8216 { 0x002021, "ALGORITHMS SOFTWARE PVT. LTD." },

8217 { 0x002022, "NMS Communications" },

8218 { 0x002023, "T.C. TECHNOLOGIES PTY. LTD" },

8219 { 0x002024, "PACIFIC COMMUNICATION SCIENCES" },

8220 { 0x002025, "CONTROL TECHNOLOGY, INC." },

8221 { 0x002026, "AMKLY SYSTEMS, INC." },

8222 { 0x002027, "MING FORTUNE INDUSTRY CO., LTD" },

8223 { 0x002028, "WEST EGG SYSTEMS, INC." },

8224 { 0x002029, "TELEPROCESSING PRODUCTS, INC." },

8225 { 0x00202A, "N.V. DZINE" },

8226 { 0x00202B, "ADVANCED TELECOMMUNICATIONS MODULES, LTD." },

8227 { 0x00202C, "WELLTRONIX CO., LTD." },

8228 { 0x00202D, "TAIYO CORPORATION" },

8229 { 0x00202E, "DAYSTAR DIGITAL" },

8230 { 0x00202F, "ZETA COMMUNICATIONS, LTD." },

8231 { 0x002030, "ANALOG & DIGITAL SYSTEMS" },

8232 { 0x002031, "Tattile SRL" },

8233 { 0x002032, "ALCATEL TAISEL" },

8234 { 0x002033, "SYNAPSE TECHNOLOGIES, INC." },

8235 { 0x002034, "ROTEC INDUSTRIEAUTOMATION GMBH" },

8236 { 0x002035, "IBM Corp" },

8237 { 0x002036, "BMC SOFTWARE" },

8238 { 0x002037, "Seagate Technology" },

8239 { 0x002038, "VME MICROSYSTEMS INTERNATIONAL CORPORATION" },

8240 { 0x002039, "SCINETS" },

8241 { 0x00203A, "DIGITAL BI0METRICS INC." },

8242 { 0x00203B, "WISDM LTD." },

8243 { 0x00203C, "EUROTIME AB" },

8244 { 0x00203D, "Honeywell Environmental & Combustion Controls" },

8245 { 0x00203E, "LogiCan Technologies, Inc." },

8246 { 0x00203F, "JUKI CORPORATION" },

8247 { 0x002040, "ARRIS Group, Inc." },

8248 { 0x002041, "DATA NET" },

8249 { 0x002042, "DATAMETRICS CORP." },

8250 { 0x002043, "NEURON COMPANY LIMITED" },

8251 { 0x002044, "GENITECH PTY LTD" },

8252 { 0x002045, "ION Networks, Inc." },

8253 { 0x002046, "CIPRICO, INC." },

8254 { 0x002047, "STEINBRECHER CORP." },

8255 { 0x002048, "Marconi Communications" },

8256 { 0x002049, "COMTRON, INC." },

8257 { 0x00204A, "PRONET GMBH" },

8258 { 0x00204B, "AUTOCOMPUTER CO., LTD." },

8259 { 0x00204C, "MITRON COMPUTER PTE LTD." },

8260 { 0x00204D, "INOVIS GMBH" },

8261 { 0x00204E, "NETWORK SECURITY SYSTEMS, INC." },

8262 { 0x00204F, "DEUTSCHE AEROSPACE AG" },

8263 { 0x002050, "KOREA COMPUTER INC." },

8264 { 0x002051, "Verilink Corporation" },

8265 { 0x002052, "RAGULA SYSTEMS" },

8266 { 0x002053, "HUNTSVILLE MICROSYSTEMS, INC." },

8267 { 0x002054, "Sycamore Networks" },

8268 { 0x002055, "ALTECH CO., LTD." },

8269 { 0x002056, "NEOPRODUCTS" },

8270 { 0x002057, "TITZE DATENTECHNIK GmbH" },

8271 { 0x002058, "ALLIED SIGNAL INC." },

8272 { 0x002059, "MIRO COMPUTER PRODUCTS AG" },

8273 { 0x00205A, "COMPUTER IDENTICS" },

8274 { 0x00205B, "Kentrox, LLC" },

8275 { 0x00205C, "InterNet Systems of Florida, Inc." },

8276 { 0x00205D, "NANOMATIC OY" },

8277 { 0x00205E, "CASTLE ROCK, INC." },

8278 { 0x00205F, "GAMMADATA COMPUTER GMBH" },

8279 { 0x002060, "ALCATEL ITALIA S.p.A." },

8280 { 0x002061, "GarrettCom, Inc." },

8281 { 0x002062, "SCORPION LOGIC, LTD." },

8282 { 0x002063, "WIPRO INFOTECH LTD." },

8283 { 0x002064, "PROTEC MICROSYSTEMS, INC." },

8284 { 0x002065, "SUPERNET NETWORKING INC." },

8285 { 0x002066, "GENERAL MAGIC, INC." },

8286 { 0x002067, "Private" },

8287 { 0x002068, "ISDYNE" },

8288 { 0x002069, "ISDN SYSTEMS CORPORATION" },

8289 { 0x00206A, "OSAKA COMPUTER CORP." },

8290 { 0x00206B, "KONICA MINOLTA HOLDINGS, INC." },

8291 { 0x00206C, "EVERGREEN TECHNOLOGY CORP." },

8292 { 0x00206D, "DATA RACE, INC." },

8293 { 0x00206E, "XACT, INC." },

8294 { 0x00206F, "FLOWPOINT CORPORATION" },

8295 { 0x002070, "HYNET, LTD." },

8296 { 0x002071, "IBR GMBH" },

8297 { 0x002072, "WORKLINK INNOVATIONS" },

8298 { 0x002073, "FUSION SYSTEMS CORPORATION" },

8299 { 0x002074, "SUNGWOON SYSTEMS" },

8300 { 0x002075, "MOTOROLA COMMUNICATION ISRAEL" },

8301 { 0x002076, "REUDO CORPORATION" },

8302 { 0x002077, "KARDIOS SYSTEMS CORP." },

8303 { 0x002078, "RUNTOP, INC." },

8304 { 0x002079, "MIKRON GMBH" },

8305 { 0x00207A, "WiSE Communications, Inc." },

8306 { 0x00207B, "Intel Corporation" },

8307 { 0x00207C, "AUTEC GMBH" },

8308 { 0x00207D, "ADVANCED COMPUTER APPLICATIONS" },

8309 { 0x00207E, "FINECOM CO., LTD." },

8310 { 0x00207F, "KYOEI SANGYO CO., LTD." },

8311 { 0x002080, "SYNERGY (UK) LTD." },

8312 { 0x002081, "TITAN ELECTRONICS" },

8313 { 0x002082, "ONEAC CORPORATION" },

8314 { 0x002083, "PRESTICOM INCORPORATED" },

8315 { 0x002084, "OCE PRINTING SYSTEMS, GMBH" },

8316 { 0x002085, "Eaton Corporation" },

8317 { 0x002086, "MICROTECH ELECTRONICS LIMITED" },

8318 { 0x002087, "MEMOTEC, INC." },

8319 { 0x002088, "GLOBAL VILLAGE COMMUNICATION" },

8320 { 0x002089, "T3PLUS NETWORKING, INC." },

8321 { 0x00208A, "SONIX COMMUNICATIONS, LTD." },

8322 { 0x00208B, "LAPIS TECHNOLOGIES, INC." },

8323 { 0x00208C, "GALAXY NETWORKS, INC." },

8324 { 0x00208D, "CMD TECHNOLOGY" },

8325 { 0x00208E, "CHEVIN SOFTWARE ENG. LTD." },

8326 { 0x00208F, "ECI Telecom Ltd." },

8327 { 0x002090, "ADVANCED COMPRESSION TECHNOLOGY, INC." },

8328 { 0x002091, "J125, NATIONAL SECURITY AGENCY" },

8329 { 0x002092, "CHESS ENGINEERING B.V." },

8330 { 0x002093, "LANDINGS TECHNOLOGY CORP." },

8331 { 0x002094, "CUBIX CORPORATION" },

8332 { 0x002095, "RIVA ELECTRONICS" },

8333 { 0x002096, "Invensys" },

8334 { 0x002097, "APPLIED SIGNAL TECHNOLOGY" },

8335 { 0x002098, "HECTRONIC AB" },

8336 { 0x002099, "BON ELECTRIC CO., LTD." },

8337 { 0x00209A, "THE 3DO COMPANY" },

8338 { 0x00209B, "ERSAT ELECTRONIC GMBH" },

8339 { 0x00209C, "PRIMARY ACCESS CORP." },

8340 { 0x00209D, "LIPPERT AUTOMATIONSTECHNIK" },

8341 { 0x00209E, "BROWN'S OPERATING SYSTEM SERVICES, LTD." },

8342 { 0x00209F, "MERCURY COMPUTER SYSTEMS, INC." },

8343 { 0x0020A0, "OA LABORATORY CO., LTD." },

8344 { 0x0020A1, "DOVATRON" },

8345 { 0x0020A2, "GALCOM NETWORKING LTD." },

8346 { 0x0020A3, "Harmonic, Inc" },

8347 { 0x0020A4, "MULTIPOINT NETWORKS" },

8348 { 0x0020A5, "API ENGINEERING" },

8349 { 0x0020A6, "Proxim Wireless" },

8350 { 0x0020A7, "PAIRGAIN TECHNOLOGIES, INC." },

8351 { 0x0020A8, "SAST TECHNOLOGY CORP." },

8352 { 0x0020A9, "WHITE HORSE INDUSTRIAL" },

8353 { 0x0020AA, "Ericsson Television Limited" },

8354 { 0x0020AB, "MICRO INDUSTRIES CORP." },

8355 { 0x0020AC, "INTERFLEX DATENSYSTEME GMBH" },

8356 { 0x0020AD, "LINQ SYSTEMS" },

8357 { 0x0020AE, "ORNET DATA COMMUNICATION TECH." },

8358 { 0x0020AF, "3COM" },

8359 { 0x0020B0, "GATEWAY DEVICES, INC." },

8360 { 0x0020B1, "COMTECH RESEARCH INC." },

8361 { 0x0020B2, "GKD Gesellschaft Fur Kommunikation Und Datentechnik" },

8362 { 0x0020B3, "Tattile SRL" },

8363 { 0x0020B4, "TERMA ELEKTRONIK AS" },

8364 { 0x0020B5, "YASKAWA ELECTRIC CORPORATION" },

8365 { 0x0020B6, "AGILE NETWORKS, INC." },

8366 { 0x0020B7, "NAMAQUA COMPUTERWARE" },

8367 { 0x0020B8, "PRIME OPTION, INC." },

8368 { 0x0020B9, "METRICOM, INC." },

8369 { 0x0020BA, "CENTER FOR HIGH PERFORMANCE" },

8370 { 0x0020BB, "ZAX CORPORATION" },

8371 { 0x0020BC, "Long Reach Networks Pty Ltd" },

8372 { 0x0020BD, "NIOBRARA R & D CORPORATION" },

8373 { 0x0020BE, "LAN ACCESS CORP." },

8374 { 0x0020BF, "AEHR TEST SYSTEMS" },

8375 { 0x0020C0, "PULSE ELECTRONICS, INC." },

8376 { 0x0020C1, "SAXA, Inc." },

8377 { 0x0020C2, "TEXAS MEMORY SYSTEMS, INC." },

8378 { 0x0020C3, "COUNTER SOLUTIONS LTD." },

8379 { 0x0020C4, "INET,INC." },

8380 { 0x0020C5, "EAGLE TECHNOLOGY" },

8381 { 0x0020C6, "NECTEC" },

8382 { 0x0020C7, "AKAI Professional M.I. Corp." },

8383 { 0x0020C8, "LARSCOM INCORPORATED" },

8384 { 0x0020C9, "VICTRON BV" },

8385 { 0x0020CA, "DIGITAL OCEAN" },

8386 { 0x0020CB, "PRETEC ELECTRONICS CORP." },

8387 { 0x0020CC, "DIGITAL SERVICES, LTD." },

8388 { 0x0020CD, "HYBRID NETWORKS, INC." },

8389 { 0x0020CE, "LOGICAL DESIGN GROUP, INC." },

8390 { 0x0020CF, "TEST & MEASUREMENT SYSTEMS INC" },

8391 { 0x0020D0, "VERSALYNX CORPORATION" },

8392 { 0x0020D1, "MICROCOMPUTER SYSTEMS (M) SDN." },

8393 { 0x0020D2, "RAD DATA COMMUNICATIONS, LTD." },

8394 { 0x0020D3, "OST (OUEST STANDARD TELEMATIQU" },

8395 { 0x0020D4, "Cabletron Systems, Inc." },

8396 { 0x0020D5, "VIPA GMBH" },

8397 { 0x0020D6, "Breezecom, Ltd." },

8398 { 0x0020D7, "JAPAN MINICOMPUTER SYSTEMS CO., Ltd." },

8399 { 0x0020D8, "Nortel Networks" },

8400 { 0x0020D9, "PANASONIC TECHNOLOGIES, INC./MIECO-US" },

8401 { 0x0020DA, "Alcatel-Lucent Enterprise" },

8402 { 0x0020DB, "XNET TECHNOLOGY, INC." },

8403 { 0x0020DC, "DENSITRON TAIWAN LTD." },

8404 { 0x0020DD, "Cybertec Pty Ltd" },

8405 { 0x0020DE, "JAPAN DIGITAL LABORAT'Y CO.LTD" },

8406 { 0x0020DF, "KYOSAN ELECTRIC MFG. CO., LTD." },

8407 { 0x0020E0, "Actiontec Electronics, Inc" },

8408 { 0x0020E1, "ALAMAR ELECTRONICS" },

8409 { 0x0020E2, "INFORMATION RESOURCE ENGINEERING" },

8410 { 0x0020E3, "MCD KENCOM CORPORATION" },

8411 { 0x0020E4, "HSING TECH ENTERPRISE CO., LTD" },

8412 { 0x0020E5, "APEX DATA, INC." },

8413 { 0x0020E6, "LIDKOPING MACHINE TOOLS AB" },

8414 { 0x0020E7, "B&W NUCLEAR SERVICE COMPANY" },

8415 { 0x0020E8, "DATATREK CORPORATION" },

8416 { 0x0020E9, "DANTEL" },

8417 { 0x0020EA, "EFFICIENT NETWORKS, INC." },

8418 { 0x0020EB, "CINCINNATI MICROWAVE, INC." },

8419 { 0x0020EC, "TECHWARE SYSTEMS CORP." },

8420 { 0x0020ED, "GIGA-BYTE TECHNOLOGY CO., LTD." },

8421 { 0x0020EE, "GTECH CORPORATION" },

8422 { 0x0020EF, "USC CORPORATION" },

8423 { 0x0020F0, "UNIVERSAL MICROELECTRONICS CO." },

8424 { 0x0020F1, "ALTOS INDIA LIMITED" },

8425 { 0x0020F2, "Oracle Corporation" },

8426 { 0x0020F3, "RAYNET CORPORATION" },

8427 { 0x0020F4, "SPECTRIX CORPORATION" },

8428 { 0x0020F5, "PANDATEL AG" },

8429 { 0x0020F6, "NET TEK AND KARLNET, INC." },

8430 { 0x0020F7, "CYBERDATA CORPORATION" },

8431 { 0x0020F8, "CARRERA COMPUTERS, INC." },

8432 { 0x0020F9, "PARALINK NETWORKS, INC." },

8433 { 0x0020FA, "GDE SYSTEMS, INC." },

8434 { 0x0020FB, "OCTEL COMMUNICATIONS CORP." },

8435 { 0x0020FC, "Matrox Central Services Inc" },

8436 { 0x0020FD, "ITV TECHNOLOGIES, INC." },

8437 { 0x0020FE, "TOPWARE INC. / GRAND COMPUTER" },

8438 { 0x0020FF, "SYMMETRICAL TECHNOLOGIES" },

8439 { 0x002100, "Gemtek Technology Co., Ltd." },

8440 { 0x002101, "Aplicaciones Electronicas Quasar (AEQ)" },

8441 { 0x002102, "UpdateLogic Inc." },

8442 { 0x002103, "GHI Electronics, LLC" },

8443 { 0x002104, "Gigaset Communications GmbH" },

8444 { 0x002105, "Alcatel-Lucent IPD" },

8445 { 0x002106, "RIM Testing Services" },

8446 { 0x002107, "Seowonintech Co Ltd." },

8447 { 0x002108, "Nokia Danmark A/S" },

8448 { 0x002109, "Nokia Danmark A/S" },

8449 { 0x00210A, "byd:sign Corporation" },

8450 { 0x00210B, "GEMINI TRAZE RFID PVT. LTD." },

8451 { 0x00210C, "Cymtec Systems, Inc." },

8452 { 0x00210D, "SAMSIN INNOTEC" },

8453 { 0x00210E, "Orpak Systems L.T.D." },

8454 { 0x00210F, "Cernium Corp" },

8455 { 0x002110, "Clearbox Systems" },

8456 { 0x002111, "Uniphone Inc." },

8457 { 0x002112, "WISCOM SYSTEM CO.,LTD" },

8458 { 0x002113, "Padtec S/A" },

8459 { 0x002114, "Hylab Technology Inc." },

8460 { 0x002115, "PHYWE Systeme GmbH & Co. KG" },

8461 { 0x002116, "Transcon Electronic Systems, spol. s r. o." },

8462 { 0x002117, "Tellord" },

8463 { 0x002118, "Athena Tech, Inc." },

8464 { 0x002119, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

8465 { 0x00211A, "LInTech Corporation" },

8466 { 0x00211B, "Cisco Systems, Inc" },

8467 { 0x00211C, "Cisco Systems, Inc" },

8468 { 0x00211D, "Dataline AB" },

8469 { 0x00211E, "ARRIS Group, Inc." },

8470 { 0x00211F, "SHINSUNG DELTATECH CO.,LTD." },

8471 { 0x002120, "Sequel Technologies" },

8472 { 0x002121, "VRmagic GmbH" },

8473 { 0x002122, "Chip-pro Ltd." },

8474 { 0x002123, "Aerosat Avionics" },

8475 { 0x002124, "Optos Plc" },

8476 { 0x002125, "KUK JE TONG SHIN Co.,LTD" },

8477 { 0x002126, "Shenzhen Torch Equipment Co., Ltd." },

8478 { 0x002127, "TP-LINK TECHNOLOGIES CO.,LTD." },

8479 { 0x002128, "Oracle Corporation" },

8480 { 0x002129, "Cisco-Linksys, LLC" },

8481 { 0x00212A, "Audiovox Corporation" },

8482 { 0x00212B, "MSA Auer" },

8483 { 0x00212C, "SemIndia System Private Limited" },

8484 { 0x00212D, "SCIMOLEX CORPORATION" },

8485 { 0x00212E, "dresden-elektronik" },

8486 { 0x00212F, "Phoebe Micro Inc." },

8487 { 0x002130, "Keico Hightech Inc." },

8488 { 0x002131, "Blynke Inc." },

8489 { 0x002132, "Masterclock, Inc." },

8490 { 0x002133, "Building B, Inc" },

8491 { 0x002134, "Brandywine Communications" },

8492 { 0x002135, "ALCATEL-LUCENT" },

8493 { 0x002136, "ARRIS Group, Inc." },

8494 { 0x002137, "Bay Controls, LLC" },

8495 { 0x002138, "Cepheid" },

8496 { 0x002139, "Escherlogic Inc." },

8497 { 0x00213A, "Winchester Systems Inc." },

8498 { 0x00213B, "Berkshire Products, Inc" },

8499 { 0x00213C, "AliphCom" },

8500 { 0x00213D, "Cermetek Microelectronics, Inc." },

8501 { 0x00213E, "TomTom International BV" },

8502 { 0x00213F, "A-Team Technology Ltd." },

8503 { 0x002140, "EN Technologies Inc." },

8504 { 0x002141, "RADLIVE" },

8505 { 0x002142, "Advanced Control Systems doo" },

8506 { 0x002143, "ARRIS Group, Inc." },

8507 { 0x002144, "SS Telecoms" },

8508 { 0x002145, "Semptian Technologies Ltd." },

8509 { 0x002146, "Sanmina-SCI" },

8510 { 0x002147, "Nintendo Co., Ltd." },

8511 { 0x002148, "Kaco Solar Korea" },

8512 { 0x002149, "China Daheng Group ,Inc." },

8513 { 0x00214A, "Pixel Velocity, Inc" },

8514 { 0x00214B, "Shenzhen HAMP Science & Technology Co.,Ltd" },

8515 { 0x00214C, "Samsung Electronics Co.,Ltd" },

8516 { 0x00214D, "Guangzhou Skytone Transmission Technology Com. Ltd." },

8517 { 0x00214E, "GS Yuasa Power Supply Ltd." },

8518 { 0x00214F, "ALPSALPINE CO,.LTD" },

8519 { 0x002150, "EYEVIEW ELECTRONICS" },

8520 { 0x002151, "Millinet Co., Ltd." },

8521 { 0x002152, "General Satellite Research & Development Limited" },

8522 { 0x002153, "SeaMicro Inc." },

8523 { 0x002154, "D-TACQ Solutions Ltd" },

8524 { 0x002155, "Cisco Systems, Inc" },

8525 { 0x002156, "Cisco Systems, Inc" },

8526 { 0x002157, "National Datacast, Inc." },

8527 { 0x002158, "Style Flying Technology Co." },

8528 { 0x002159, "Juniper Networks" },

8529 { 0x00215A, "Hewlett Packard" },

8530 { 0x00215B, "SenseAnywhere" },

8531 { 0x00215C, "Intel Corporate" },

8532 { 0x00215D, "Intel Corporate" },

8533 { 0x00215E, "IBM Corp" },

8534 { 0x00215F, "IHSE GmbH" },

8535 { 0x002160, "Hidea Solutions Co. Ltd." },

8536 { 0x002161, "Yournet Inc." },

8537 { 0x002162, "Nortel Networks" },

8538 { 0x002163, "ASKEY COMPUTER CORP" },

8539 { 0x002164, "Special Design Bureau for Seismic Instrumentation" },

8540 { 0x002165, "Presstek Inc." },

8541 { 0x002166, "NovAtel Inc." },

8542 { 0x002167, "HWA JIN T&I Corp." },

8543 { 0x002168, "iVeia, LLC" },

8544 { 0x002169, "Prologix, LLC." },

8545 { 0x00216A, "Intel Corporate" },

8546 { 0x00216B, "Intel Corporate" },

8547 { 0x00216C, "ODVA" },

8548 { 0x00216D, "Soltech Co., Ltd." },

8549 { 0x00216E, "Function ATI (Huizhou) Telecommunications Co., Ltd." },

8550 { 0x00216F, "SymCom, Inc." },

8551 { 0x002170, "Dell Inc." },

8552 { 0x002171, "Wesung TNC Co., Ltd." },

8553 { 0x002172, "Seoultek Valley" },

8554 { 0x002173, "Ion Torrent Systems, Inc." },

8555 { 0x002174, "AvaLAN Wireless" },

8556 { 0x002175, "Pacific Satellite International Ltd." },

8557 { 0x002176, "YMax Telecom Ltd." },

8558 { 0x002177, "W. L. Gore & Associates" },

8559 { 0x002178, "Matuschek Messtechnik GmbH" },

8560 { 0x002179, "IOGEAR, Inc." },

8561 { 0x00217A, "Sejin Electron, Inc." },

8562 { 0x00217B, "Bastec AB" },

8563 { 0x00217C, "2Wire Inc" },

8564 { 0x00217D, "PYXIS S.R.L." },

8565 { 0x00217E, "Telit Communication s.p.a" },

8566 { 0x00217F, "Intraco Technology Pte Ltd" },

8567 { 0x002180, "ARRIS Group, Inc." },

8568 { 0x002181, "Si2 Microsystems Limited" },

8569 { 0x002182, "SandLinks Systems, Ltd." },

8570 { 0x002183, "ANDRITZ HYDRO GmbH" },

8571 { 0x002184, "POWERSOFT SRL" },

8572 { 0x002185, "MICRO-STAR INT'L CO.,LTD." },

8573 { 0x002186, "Universal Global Scientific Industrial Co., Ltd." },

8574 { 0x002187, "Imacs GmbH" },

8575 { 0x002188, "EMC Corporation" },

8576 { 0x002189, "AppTech, Inc." },

8577 { 0x00218A, "Electronic Design and Manufacturing Company" },

8578 { 0x00218B, "Wescon Technology, Inc." },

8579 { 0x00218C, "TopControl GMBH" },

8580 { 0x00218D, "AP Router Ind. Eletronica LTDA" },

8581 { 0x00218E, "MEKICS CO., LTD." },

8582 { 0x00218F, "Avantgarde Acoustic Lautsprechersysteme GmbH" },

8583 { 0x002190, "Goliath Solutions" },

8584 { 0x002191, "D-Link Corporation" },

8585 { 0x002192, "Baoding Galaxy Electronic Technology Co.,Ltd" },

8586 { 0x002193, "Videofon MV" },

8587 { 0x002194, "Ping Communication" },

8588 { 0x002195, "GWD Media Limited" },

8589 { 0x002196, "Telsey S.p.A." },

8590 { 0x002197, "Elitegroup Computer Systems Co.,Ltd." },

8591 { 0x002198, "Thai Radio Co, LTD" },

8592 { 0x002199, "Vacon Plc" },

8593 { 0x00219A, "Cambridge Visual Networks Ltd" },

8594 { 0x00219B, "Dell Inc." },

8595 { 0x00219C, "Honeywld Technology Corp." },

8596 { 0x00219D, "Adesys BV" },

8597 { 0x00219E, "Sony Corporation" },

8598 { 0x00219F, "SATEL OY" },

8599 { 0x0021A0, "Cisco Systems, Inc" },

8600 { 0x0021A1, "Cisco Systems, Inc" },

8601 { 0x0021A2, "EKE-Electronics Ltd." },

8602 { 0x0021A3, "Micromint" },

8603 { 0x0021A4, "Dbii Networks" },

8604 { 0x0021A5, "ERLPhase Power Technologies Ltd." },

8605 { 0x0021A6, "Videotec Spa" },

8606 { 0x0021A7, "Hantle System Co., Ltd." },

8607 { 0x0021A8, "Telephonics Corporation" },

8608 { 0x0021A9, "Mobilink Telecom Co.,Ltd" },

8609 { 0x0021AA, "Nokia Danmark A/S" },

8610 { 0x0021AB, "Nokia Danmark A/S" },

8611 { 0x0021AC, "Infrared Integrated Systems Ltd" },

8612 { 0x0021AD, "Nordic ID Oy" },

8613 { 0x0021AE, "ALCATEL-LUCENT FRANCE - WTD" },

8614 { 0x0021AF, "Radio Frequency Systems" },

8615 { 0x0021B0, "Tyco Telecommunications" },

8616 { 0x0021B1, "DIGITAL SOLUTIONS LTD" },

8617 { 0x0021B2, "Fiberblaze A/S" },

8618 { 0x0021B3, "Ross Controls" },

8619 { 0x0021B4, "APRO MEDIA CO., LTD" },

8620 { 0x0021B5, "Galvanic Ltd" },

8621 { 0x0021B6, "Triacta Power Technologies Inc." },

8622 { 0x0021B7, "LEXMARK INTERNATIONAL, INC." },

8623 { 0x0021B8, "Inphi Corporation" },

8624 { 0x0021B9, "Universal Devices Inc." },

8625 { 0x0021BA, "Texas Instruments" },

8626 { 0x0021BB, "Riken Keiki Co., Ltd." },

8627 { 0x0021BC, "ZALA COMPUTER" },

8628 { 0x0021BD, "Nintendo Co., Ltd." },

8629 { 0x0021BE, "Cisco SPVTG" },

8630 { 0x0021BF, "Hitachi High-Tech Control Systems Corporation" },

8631 { 0x0021C0, "Mobile Appliance, Inc." },

8632 { 0x0021C1, "ABB Oy / Medium Voltage Products" },

8633 { 0x0021C2, "GL Communications Inc" },

8634 { 0x0021C3, "CORNELL Communications, Inc." },

8635 { 0x0021C4, "Consilium AB" },

8636 { 0x0021C5, "3DSP Corp" },

8637 { 0x0021C6, "CSJ Global, Inc." },

8638 { 0x0021C7, "Russound" },

8639 { 0x0021C8, "LOHUIS Networks" },

8640 { 0x0021C9, "Wavecom Asia Pacific Limited" },

8641 { 0x0021CA, "ART System Co., Ltd." },

8642 { 0x0021CB, "SMS TECNOLOGIA ELETRONICA LTDA" },

8643 { 0x0021CC, "Flextronics International" },

8644 { 0x0021CD, "LiveTV" },

8645 { 0x0021CE, "NTC-Metrotek" },

8646 { 0x0021CF, "The Crypto Group" },

8647 { 0x0021D0, "Global Display Solutions Spa" },

8648 { 0x0021D1, "Samsung Electronics Co.,Ltd" },

8649 { 0x0021D2, "Samsung Electronics Co.,Ltd" },

8650 { 0x0021D3, "BOCOM SECURITY(ASIA PACIFIC) LIMITED" },

8651 { 0x0021D4, "Vollmer Werke GmbH" },

8652 { 0x0021D5, "X2E GmbH" },

8653 { 0x0021D6, "LXI Consortium" },

8654 { 0x0021D7, "Cisco Systems, Inc" },

8655 { 0x0021D8, "Cisco Systems, Inc" },

8656 { 0x0021D9, "SEKONIC CORPORATION" },

8657 { 0x0021DA, "Automation Products Group Inc." },

8658 { 0x0021DB, "Santachi Video Technology (Shenzhen) Co., Ltd." },

8659 { 0x0021DC, "TECNOALARM S.r.l." },

8660 { 0x0021DD, "Northstar Systems Corp" },

8661 { 0x0021DE, "Firepro Wireless" },

8662 { 0x0021DF, "Martin Christ GmbH" },

8663 { 0x0021E0, "CommAgility Ltd" },

8664 { 0x0021E1, "Nortel Networks" },

8665 { 0x0021E2, "visago Systems & Controls GmbH & Co. KG" },

8666 { 0x0021E3, "SerialTek LLC" },

8667 { 0x0021E4, "I-WIN" },

8668 { 0x0021E5, "Display Solution AG" },

8669 { 0x0021E6, "Starlight Video Limited" },

8670 { 0x0021E7, "Informatics Services Corporation" },

8671 { 0x0021E8, "Murata Manufacturing Co., Ltd." },

8672 { 0x0021E9, "Apple, Inc." },

8673 { 0x0021EA, "Bystronic Laser AG" },

8674 { 0x0021EB, "ESP SYSTEMS, LLC" },

8675 { 0x0021EC, "Solutronic GmbH" },

8676 { 0x0021ED, "Telegesis" },

8677 { 0x0021EE, "Full Spectrum Inc." },

8678 { 0x0021EF, "Kapsys" },

8679 { 0x0021F0, "EW3 Technologies LLC" },

8680 { 0x0021F1, "Tutus Data AB" },

8681 { 0x0021F2, "EASY3CALL Technology Limited" },

8682 { 0x0021F3, "Si14 SpA" },

8683 { 0x0021F4, "INRange Systems, Inc" },

8684 { 0x0021F5, "Western Engravers Supply, Inc." },

8685 { 0x0021F6, "Oracle Corporation" },

8686 { 0x0021F7, "HPN Supply Chain" },

8687 { 0x0021F8, "Enseo, Inc." },

8688 { 0x0021F9, "WIRECOM Technologies" },

8689 { 0x0021FA, "A4SP Technologies Ltd." },

8690 { 0x0021FB, "LG Electronics (Mobile Communications)" },

8691 { 0x0021FC, "Nokia Danmark A/S" },

8692 { 0x0021FD, "LACROIX TRAFFIC S.A.U" },

8693 { 0x0021FE, "Nokia Danmark A/S" },

8694 { 0x0021FF, "Cyfrowy Polsat SA" },

8695 { 0x002200, "IBM Corp" },

8696 { 0x002201, "Aksys Networks Inc" },

8697 { 0x002202, "Excito Elektronik i Skåne AB" },

8698 { 0x002203, "Glensound Electronics Ltd" },

8699 { 0x002204, "KORATEK" },

8700 { 0x002205, "WeLink Solutions, Inc." },

8701 { 0x002206, "Cyberdyne Inc." },

8702 { 0x002207, "Inteno Broadband Technology AB" },

8703 { 0x002208, "Certicom Corp" },

8704 { 0x002209, "Omron Healthcare Co., Ltd" },

8705 { 0x00220A, "OnLive, Inc" },

8706 { 0x00220B, "National Source Coding Center" },

8707 { 0x00220C, "Cisco Systems, Inc" },

8708 { 0x00220D, "Cisco Systems, Inc" },

8709 { 0x00220E, "Indigo Security Co., Ltd." },

8710 { 0x00220F, "MoCA (Multimedia over Coax Alliance)" },

8711 { 0x002210, "ARRIS Group, Inc." },

8712 { 0x002211, "Rohati Systems" },

8713 { 0x002212, "CAI Networks, Inc." },

8714 { 0x002213, "PCI CORPORATION" },

8715 { 0x002214, "RINNAI KOREA" },

8716 { 0x002215, "ASUSTek COMPUTER INC." },

8717 { 0x002216, "SHIBAURA VENDING MACHINE CORPORATION" },

8718 { 0x002217, "Neat Electronics" },

8719 { 0x002218, "AKAMAI TECHNOLOGIES INC" },

8720 { 0x002219, "Dell Inc." },

8721 { 0x00221A, "Audio Precision" },

8722 { 0x00221B, "Morega Systems" },

8723 { 0x00221C, "Private" },

8724 { 0x00221D, "Freegene Technology LTD" },

8725 { 0x00221E, "Media Devices Co., Ltd." },

8726 { 0x00221F, "eSang Technologies Co., Ltd." },

8727 { 0x002220, "Mitac Technology Corp" },

8728 { 0x002221, "ITOH DENKI CO,LTD." },

8729 { 0x002222, "Schaffner Deutschland GmbH" },

8730 { 0x002223, "TimeKeeping Systems, Inc." },

8731 { 0x002224, "Good Will Instrument Co., Ltd." },

8732 { 0x002225, "Thales Avionics Ltd" },

8733 { 0x002226, "Avaak, Inc." },

8734 { 0x002227, "uv-electronic GmbH" },

8735 { 0x002228, "Breeze Innovations Ltd." },

8736 { 0x002229, "Compumedics Ltd" },

8737 { 0x00222A, "SoundEar A/S" },

8738 { 0x00222B, "Nucomm, Inc." },

8739 { 0x00222C, "Ceton Corp" },

8740 { 0x00222D, "SMC Networks Inc." },

8741 { 0x00222E, "maintech GmbH" },

8742 { 0x00222F, "Open Grid Computing, Inc." },

8743 { 0x002230, "FutureLogic Inc." },

8744 { 0x002231, "SMT&C Co., Ltd." },

8745 { 0x002232, "Design Design Technology Ltd" },

8746 { 0x002233, "ADB Broadband Italia" },

8747 { 0x002234, "Corventis Inc." },

8748 { 0x002235, "Strukton Systems bv" },

8749 { 0x002236, "VECTOR SP. Z O.O." },

8750 { 0x002237, "Shinhint Group" },

8751 { 0x002238, "LOGIPLUS" },

8752 { 0x002239, "Indiana Life Sciences Incorporated" },

8753 { 0x00223A, "Cisco SPVTG" },

8754 { 0x00223B, "Communication Networks, LLC" },

8755 { 0x00223C, "RATIO Entwicklungen GmbH" },

8756 { 0x00223D, "JumpGen Systems, LLC" },

8757 { 0x00223E, "IRTrans GmbH" },

8758 { 0x00223F, "NETGEAR" },

8759 { 0x002240, "Universal Telecom S/A" },

8760 { 0x002241, "Apple, Inc." },

8761 { 0x002242, "Alacron Inc." },

8762 { 0x002243, "AzureWave Technology Inc." },

8763 { 0x002244, "Chengdu Linkon Communications Device Co., Ltd" },

8764 { 0x002245, "Leine & Linde AB" },

8765 { 0x002246, "Evoc Intelligent Technology Co.,Ltd." },

8766 { 0x002247, "DAC ENGINEERING CO., LTD." },

8767 { 0x002248, "Microsoft Corporation" },

8768 { 0x002249, "HOME MULTIENERGY SL" },

8769 { 0x00224A, "RAYLASE AG" },

8770 { 0x00224B, "AIRTECH TECHNOLOGIES, INC." },

8771 { 0x00224C, "Nintendo Co., Ltd." },

8772 { 0x00224D, "MITAC INTERNATIONAL CORP." },

8773 { 0x00224E, "SEEnergy Corp." },

8774 { 0x00224F, "Byzoro Networks Ltd." },

8775 { 0x002250, "Point Six Wireless, LLC" },

8776 { 0x002251, "Lumasense Technologies" },

8777 { 0x002252, "ZOLL Lifecor Corporation" },

8778 { 0x002253, "Entorian Technologies" },

8779 { 0x002254, "Bigelow Aerospace" },

8780 { 0x002255, "Cisco Systems, Inc" },

8781 { 0x002256, "Cisco Systems, Inc" },

8782 { 0x002257, "3COM EUROPE LTD" },

8783 { 0x002258, "Taiyo Yuden Co., Ltd." },

8784 { 0x002259, "Guangzhou New Postcom Equipment Co.,Ltd." },

8785 { 0x00225A, "Garde Security AB" },

8786 { 0x00225B, "Teradici Corporation" },

8787 { 0x00225C, "Multimedia & Communication Technology" },

8788 { 0x00225D, "Digicable Network India Pvt. Ltd." },

8789 { 0x00225E, "Uwin Technologies Co.,LTD" },

8790 { 0x00225F, "Liteon Technology Corporation" },

8791 { 0x002260, "AFREEY Inc." },

8792 { 0x002261, "Frontier Silicon Ltd" },

8793 { 0x002262, "BEP Marine" },

8794 { 0x002263, "Koos Technical Services, Inc." },

8795 { 0x002264, "Hewlett Packard" },

8796 { 0x002265, "Nokia Danmark A/S" },

8797 { 0x002266, "Nokia Danmark A/S" },

8798 { 0x002267, "Nortel Networks" },

8799 { 0x002268, "Hon Hai Precision Ind. Co.,Ltd." },

8800 { 0x002269, "Hon Hai Precision Ind. Co.,Ltd." },

8801 { 0x00226A, "Honeywell" },

8802 { 0x00226B, "Cisco-Linksys, LLC" },

8803 { 0x00226C, "LinkSprite Technologies, Inc." },

8804 { 0x00226D, "Shenzhen GIEC Electronics Co., Ltd." },

8805 { 0x00226E, "Gowell Electronic Limited" },

8806 { 0x00226F, "3onedata Technology Co. Ltd." },

8807 { 0x002270, "ABK North America, LLC" },

8808 { 0x002271, "Jäger Computergesteuerte Meßtechnik GmbH." },

8809 { 0x002272, "American Micro-Fuel Device Corp." },

8810 { 0x002273, "Techway" },

8811 { 0x002274, "FamilyPhone AB" },

8812 { 0x002275, "Belkin International Inc." },

8813 { 0x002276, "Triple EYE B.V." },

8814 { 0x002277, "NEC Australia Pty Ltd" },

8815 { 0x002278, "Shenzhen Tongfang Multimedia Technology Co.,Ltd." },

8816 { 0x002279, "Nippon Conlux Co., Ltd." },

8817 { 0x00227A, "Telecom Design" },

8818 { 0x00227B, "Apogee Labs, Inc." },

8819 { 0x00227C, "Woori SMT Co.,ltd" },

8820 { 0x00227D, "YE DATA INC." },

8821 { 0x00227E, "Chengdu 30Kaitian Communication Industry Co.Ltd" },

8822 { 0x00227F, "Ruckus Wireless" },

8823 { 0x002280, "A2B Electronics AB" },

8824 { 0x002281, "Daintree Networks Pty" },

8825 { 0x002282, "8086 Consultancy" },

8826 { 0x002283, "Juniper Networks" },

8827 { 0x002284, "DESAY A&V SCIENCE AND TECHNOLOGY CO.,LTD" },

8828 { 0x002285, "NOMUS COMM SYSTEMS" },

8829 { 0x002286, "ASTRON" },

8830 { 0x002287, "Titan Wireless LLC" },

8831 { 0x002288, "Sagrad, Inc." },

8832 { 0x002289, "Vanderlande APC inc." },

8833 { 0x00228A, "Teratronik elektronische systeme gmbh" },

8834 { 0x00228B, "Kensington Computer Products Group" },

8835 { 0x00228C, "Photon Europe GmbH" },

8836 { 0x00228D, "GBS Laboratories LLC" },

8837 { 0x00228E, "TV-NUMERIC" },

8838 { 0x00228F, "CNRS" },

8839 { 0x002290, "Cisco Systems, Inc" },

8840 { 0x002291, "Cisco Systems, Inc" },

8841 { 0x002292, "Cinetal" },

8842 { 0x002293, "zte corporation" },

8843 { 0x002294, "KYOCERA CORPORATION" },

8844 { 0x002295, "SGM Technology for lighting spa" },

8845 { 0x002296, "LinoWave Corporation" },

8846 { 0x002297, "XMOS Semiconductor" },

8847 { 0x002298, "Sony Corporation" },

8848 { 0x002299, "SeaMicro Inc." },

8849 { 0x00229A, "Lastar, Inc." },

8850 { 0x00229B, "AverLogic Technologies, Inc." },

8851 { 0x00229C, "Verismo Networks Inc" },

8852 { 0x00229D, "PYUNG-HWA IND.CO.,LTD" },

8853 { 0x00229E, "Social Aid Research Co., Ltd." },

8854 { 0x00229F, "Sensys Traffic AB" },

8855 { 0x0022A0, "APTIV SERVICES US, LLC" },

8856 { 0x0022A1, "Huawei Symantec Technologies Co.,Ltd." },

8857 { 0x0022A2, "Xtramus Technologies" },

8858 { 0x0022A3, "California Eastern Laboratories" },

8859 { 0x0022A4, "2Wire Inc" },

8860 { 0x0022A5, "Texas Instruments" },

8861 { 0x0022A6, "Sony Computer Entertainment America" },

8862 { 0x0022A7, "Tyco Electronics AMP GmbH" },

8863 { 0x0022A8, "Ouman Oy" },

8864 { 0x0022A9, "LG Electronics (Mobile Communications)" },

8865 { 0x0022AA, "Nintendo Co., Ltd." },

8866 { 0x0022AB, "Shenzhen Turbosight Technology Ltd" },

8867 { 0x0022AC, "Hangzhou Siyuan Tech. Co., Ltd" },

8868 { 0x0022AD, "TELESIS TECHNOLOGIES, INC." },

8869 { 0x0022AE, "Mattel Inc." },

8870 { 0x0022AF, "Safety Vision, LLC" },

8871 { 0x0022B0, "D-Link Corporation" },

8872 { 0x0022B1, "Elbit Systems Ltd." },

8873 { 0x0022B2, "4RF Communications Ltd" },

8874 { 0x0022B3, "Sei S.p.A." },

8875 { 0x0022B4, "ARRIS Group, Inc." },

8876 { 0x0022B5, "NOVITA" },

8877 { 0x0022B6, "Superflow Technologies Group" },

8878 { 0x0022B7, "GSS Grundig SAT-Systems GmbH" },

8879 { 0x0022B8, "Norcott" },

8880 { 0x0022B9, "Analogix Seminconductor, Inc" },

8881 { 0x0022BA, "HUTH Elektronik Systeme GmbH" },

8882 { 0x0022BB, "beyerdynamic GmbH & Co. KG" },

8883 { 0x0022BC, "JDSU France SAS" },

8884 { 0x0022BD, "Cisco Systems, Inc" },

8885 { 0x0022BE, "Cisco Systems, Inc" },

8886 { 0x0022BF, "SieAmp Group of Companies" },

8887 { 0x0022C0, "Shenzhen Forcelink Electronic Co, Ltd" },

8888 { 0x0022C1, "Active Storage Inc." },

8889 { 0x0022C2, "Proview Eletrônica do Brasil LTDA" },

8890 { 0x0022C3, "Zeeport Technology Inc." },

8891 { 0x0022C4, "epro GmbH" },

8892 { 0x0022C5, "INFORSON Co,Ltd." },

8893 { 0x0022C6, "Sutus Inc" },

8894 { 0x0022C7, "SEGGER Microcontroller GmbH & Co. KG" },

8895 { 0x0022C8, "Applied Instruments B.V." },

8896 { 0x0022C9, "Lenord, Bauer & Co GmbH" },

8897 { 0x0022CA, "Anviz Biometric Tech. Co., Ltd." },

8898 { 0x0022CB, "IONODES Inc." },

8899 { 0x0022CC, "SciLog, Inc." },

8900 { 0x0022CD, "Ared Technology Co., Ltd." },

8901 { 0x0022CE, "Cisco SPVTG" },

8902 { 0x0022CF, "PLANEX COMMUNICATIONS INC." },

8903 { 0x0022D0, "Polar Electro Oy" },

8904 { 0x0022D1, "Albrecht Jung GmbH & Co. KG" },

8905 { 0x0022D2, "All Earth Comércio de Eletrônicos LTDA." },

8906 { 0x0022D3, "Hub-Tech" },

8907 { 0x0022D4, "ComWorth Co., Ltd." },

8908 { 0x0022D5, "Eaton Corp. Electrical Group Data Center Solutions - Pulizzi" },

8909 { 0x0022D6, "Cypak AB" },

8910 { 0x0022D7, "Nintendo Co., Ltd." },

8911 { 0x0022D8, "Shenzhen GST Security and Safety Technology Limited" },

8912 { 0x0022D9, "Fortex Industrial Ltd." },

8913 { 0x0022DA, "ANATEK, LLC" },

8914 { 0x0022DB, "Translogic Corporation" },

8915 { 0x0022DC, "Vigil Health Solutions Inc." },

8916 { 0x0022DD, "Protecta Electronics Ltd" },

8917 { 0x0022DE, "OPPO Digital, Inc." },

8918 { 0x0022DF, "TAMUZ Monitors" },

8919 { 0x0022E0, "Atlantic Software Technologies S.r.L." },

8920 { 0x0022E1, "ZORT Labs, LLC." },

8921 { 0x0022E2, "WABTEC Transit Division" },

8922 { 0x0022E3, "Amerigon" },

8923 { 0x0022E4, "APASS TECHNOLOGY CO., LTD." },

8924 { 0x0022E5, "Fisher-Rosemount Systems Inc." },

8925 { 0x0022E6, "Intelligent Data" },

8926 { 0x0022E7, "WPS Parking Systems" },

8927 { 0x0022E8, "Applition Co., Ltd." },

8928 { 0x0022E9, "ProVision Communications" },

8929 { 0x0022EA, "Rustelcom Inc." },

8930 { 0x0022EB, "Data Respons A/S" },

8931 { 0x0022EC, "IDEALBT TECHNOLOGY CORPORATION" },

8932 { 0x0022ED, "TSI Power Corporation" },

8933 { 0x0022EE, "Algo Communication Products Ltd" },

8934 { 0x0022EF, "iWDL Technologies" },

8935 { 0x0022F0, "3 Greens Aviation Limited" },

8936 { 0x0022F1, "Private" },

8937 { 0x0022F2, "SunPower Corp" },

8938 { 0x0022F3, "SHARP Corporation" },

8939 { 0x0022F4, "AMPAK Technology, Inc." },

8940 { 0x0022F5, "Advanced Realtime Tracking GmbH" },

8941 { 0x0022F6, "Syracuse Research Corporation" },

8942 { 0x0022F7, "Conceptronic" },

8943 { 0x0022F8, "PIMA Electronic Systems Ltd." },

8944 { 0x0022F9, "Pollin Electronic GmbH" },

8945 { 0x0022FA, "Intel Corporate" },

8946 { 0x0022FB, "Intel Corporate" },

8947 { 0x0022FC, "Nokia Danmark A/S" },

8948 { 0x0022FD, "Nokia Danmark A/S" },

8949 { 0x0022FE, "Advanced Illumination" },

8950 { 0x0022FF, "NIVIS LLC" },

8951 { 0x002300, "Cayee Computer Ltd." },

8952 { 0x002301, "Witron Technology Limited" },

8953 { 0x002302, "Cobalt Digital, Inc." },

8954 { 0x002303, "LITE-ON IT Corporation" },

8955 { 0x002304, "Cisco Systems, Inc" },

8956 { 0x002305, "Cisco Systems, Inc" },

8957 { 0x002306, "ALPSALPINE CO,.LTD" },

8958 { 0x002307, "FUTURE INNOVATION TECH CO.,LTD" },

8959 { 0x002308, "Arcadyan Technology Corporation" },

8960 { 0x002309, "Janam Technologies LLC" },

8961 { 0x00230A, "ARBURG GmbH & Co KG" },

8962 { 0x00230B, "ARRIS Group, Inc." },

8963 { 0x00230C, "CLOVER ELECTRONICS CO.,LTD." },

8964 { 0x00230D, "Nortel Networks" },

8965 { 0x00230E, "Gorba AG" },

8966 { 0x00230F, "Hirsch Electronics Corporation" },

8967 { 0x002310, "LNC Technology Co., Ltd." },

8968 { 0x002311, "Gloscom Co., Ltd." },

8969 { 0x002312, "Apple, Inc." },

8970 { 0x002313, "Qool Technologies Ltd." },

8971 { 0x002314, "Intel Corporate" },

8972 { 0x002315, "Intel Corporate" },

8973 { 0x002316, "KISAN ELECTRONICS CO" },

8974 { 0x002317, "Lasercraft Inc" },

8975 { 0x002318, "Toshiba" },

8976 { 0x002319, "Sielox LLC" },

8977 { 0x00231A, "ITF Co., Ltd." },

8978 { 0x00231B, "Danaher Motion - Kollmorgen" },

8979 { 0x00231C, "Fourier Systems Ltd." },

8980 { 0x00231D, "Deltacom Electronics Ltd" },

8981 { 0x00231E, "Cezzer Multimedia Technologies" },

8982 { 0x00231F, "Guangda Electronic & Telecommunication Technology Development Co., Ltd." },

8983 { 0x002320, "Nicira Networks" },

8984 { 0x002321, "Avitech International Corp" },

8985 { 0x002322, "KISS Teknical Solutions, Inc." },

8986 { 0x002323, "Zylin AS" },

8987 { 0x002324, "G-PRO COMPUTER" },

8988 { 0x002325, "IOLAN Holding" },

8989 { 0x002326, "FUJITSU LIMITED" },

8990 { 0x002327, "Shouyo Electronics CO., LTD" },

8991 { 0x002328, "ALCON TELECOMMUNICATIONS CO., LTD." },

8992 { 0x002329, "DDRdrive LLC" },

8993 { 0x00232A, "eonas IT-Beratung und -Entwicklung GmbH" },

8994 { 0x00232B, "IRD A/S" },

8995 { 0x00232C, "Senticare" },

8996 { 0x00232D, "SandForce" },

8997 { 0x00232E, "Kedah Electronics Engineering, LLC" },

8998 { 0x00232F, "Advanced Card Systems Ltd." },

8999 { 0x002330, "DIZIPIA, INC." },

9000 { 0x002331, "Nintendo Co., Ltd." },

9001 { 0x002332, "Apple, Inc." },

9002 { 0x002333, "Cisco Systems, Inc" },

9003 { 0x002334, "Cisco Systems, Inc" },

9004 { 0x002335, "Linkflex Co.,Ltd" },

9005 { 0x002336, "METEL s.r.o." },

9006 { 0x002337, "Global Star Solutions ULC" },

9007 { 0x002338, "OJ-Electronics A/S" },

9008 { 0x002339, "Samsung Electronics Co.,Ltd" },

9009 { 0x00233A, "Samsung Electronics Co.,Ltd" },

9010 { 0x00233B, "C-Matic Systems Ltd" },

9011 { 0x00233C, "Alflex" },

9012 { 0x00233D, "Laird Technologies" },

9013 { 0x00233E, "Alcatel-Lucent IPD" },

9014 { 0x00233F, "Purechoice Inc" },

9015 { 0x002340, "MiXTelematics" },

9016 { 0x002341, "Vanderbilt International (SWE) AB" },

9017 { 0x002342, "Coffee Equipment Company" },

9018 { 0x002343, "TEM AG" },

9019 { 0x002344, "Objective Interface Systems, Inc." },

9020 { 0x002345, "Sony Corporation" },

9021 { 0x002346, "Vestac" },

9022 { 0x002347, "ProCurve Networking by HP" },

9023 { 0x002348, "Sagemcom Broadband SAS" },

9024 { 0x002349, "Helmholtz Centre Berlin for Material and Energy" },

9025 { 0x00234A, "Private" },

9026 { 0x00234B, "Inyuan Technology Inc." },

9027 { 0x00234C, "KTC AB" },

9028 { 0x00234D, "Hon Hai Precision Ind. Co.,Ltd." },

9029 { 0x00234E, "Hon Hai Precision Ind. Co.,Ltd." },

9030 { 0x00234F, "Luminous Power Technologies Pvt. Ltd." },

9031 { 0x002350, "RDC, Inc. dba LynTec" },

9032 { 0x002351, "2Wire Inc" },

9033 { 0x002352, "DATASENSOR S.p.A." },

9034 { 0x002353, "F E T Elettronica snc" },

9035 { 0x002354, "ASUSTek COMPUTER INC." },

9036 { 0x002355, "Kinco Automation(Shanghai) Ltd." },

9037 { 0x002356, "Packet Forensics LLC" },

9038 { 0x002357, "Pitronot Technologies and Engineering P.T.E. Ltd." },

9039 { 0x002358, "SYSTEL SA" },

9040 { 0x002359, "Benchmark Electronics ( Thailand ) Public Company Limited" },

9041 { 0x00235A, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

9042 { 0x00235B, "Gulfstream" },

9043 { 0x00235C, "Aprius, Inc." },

9044 { 0x00235D, "Cisco Systems, Inc" },

9045 { 0x00235E, "Cisco Systems, Inc" },

9046 { 0x00235F, "Silicon Micro Sensors GmbH" },

9047 { 0x002360, "Lookit Technology Co., Ltd" },

9048 { 0x002361, "Unigen Corporation" },

9049 { 0x002362, "Goldline Controls" },

9050 { 0x002363, "Zhuhai Raysharp Technology Co.,Ltd" },

9051 { 0x002364, "Power Instruments Pte Ltd" },

9052 { 0x002365, "Insta Elektro GmbH" },

9053 { 0x002366, "Beijing Siasun Electronic System Co.,Ltd." },

9054 { 0x002367, "UniControls a.s." },

9055 { 0x002368, "Zebra Technologies Inc" },

9056 { 0x002369, "Cisco-Linksys, LLC" },

9057 { 0x00236A, "SmartRG Inc" },

9058 { 0x00236B, "Xembedded, Inc." },

9059 { 0x00236C, "Apple, Inc." },

9060 { 0x00236D, "ResMed Ltd" },

9061 { 0x00236E, "Burster GmbH & Co KG" },

9062 { 0x00236F, "DAQ System" },

9063 { 0x002370, "Snell" },

9064 { 0x002371, "SOAM Systel" },

9065 { 0x002372, "MORE STAR INDUSTRIAL GROUP LIMITED" },

9066 { 0x002373, "GridIron Systems, Inc." },

9067 { 0x002374, "ARRIS Group, Inc." },

9068 { 0x002375, "ARRIS Group, Inc." },

9069 { 0x002376, "HTC Corporation" },

9070 { 0x002377, "Isotek Electronics Ltd" },

9071 { 0x002378, "GN Netcom A/S" },

9072 { 0x002379, "Union Business Machines Co. Ltd." },

9073 { 0x00237A, "RIM" },

9074 { 0x00237B, "WHDI LLC" },

9075 { 0x00237C, "NEOTION" },

9076 { 0x00237D, "Hewlett Packard" },

9077 { 0x00237E, "ELSTER GMBH" },

9078 { 0x00237F, "PLANTRONICS, INC." },

9079 { 0x002380, "Nanoteq" },

9080 { 0x002381, "Lengda Technology(Xiamen) Co.,Ltd." },

9081 { 0x002382, "Lih Rong electronic Enterprise Co., Ltd." },

9082 { 0x002383, "InMage Systems Inc" },

9083 { 0x002384, "GGH Engineering s.r.l." },

9084 { 0x002385, "ANTIPODE" },

9085 { 0x002386, "IMI Hydronic Engineering international SA" },

9086 { 0x002387, "ThinkFlood, Inc." },

9087 { 0x002388, "V.T. Telematica S.p.a." },

9088 { 0x002389, "Hangzhou H3C Technologies Co., Limited" },

9089 { 0x00238A, "Ciena Corporation" },

9090 { 0x00238B, "Quanta Computer Inc." },

9091 { 0x00238C, "Private" },

9092 { 0x00238D, "Techno Design Co., Ltd." },

9093 { 0x00238E, "ADB Broadband Italia" },

9094 { 0x00238F, "NIDEC COPAL CORPORATION" },

9095 { 0x002390, "Algolware Corporation" },

9096 { 0x002391, "Maxian" },

9097 { 0x002392, "Proteus Industries Inc." },

9098 { 0x002393, "AJINEXTEK" },

9099 { 0x002394, "Samjeon" },

9100 { 0x002395, "ARRIS Group, Inc." },

9101 { 0x002396, "ANDES TECHNOLOGY CORPORATION" },

9102 { 0x002397, "Westell Technologies Inc." },

9103 { 0x002398, "Vutlan sro" },

9104 { 0x002399, "Samsung Electronics Co.,Ltd" },

9105 { 0x00239A, "EasyData Hardware GmbH" },

9106 { 0x00239B, "Elster Solutions, LLC" },

9107 { 0x00239C, "Juniper Networks" },

9108 { 0x00239D, "Mapower Electronics Co., Ltd" },

9109 { 0x00239E, "Jiangsu Lemote Technology Corporation Limited" },

9110 { 0x00239F, "Institut für Prüftechnik" },

9111 { 0x0023A0, "Hana CNS Co., LTD." },

9112 { 0x0023A1, "Trend Electronics Ltd" },

9113 { 0x0023A2, "ARRIS Group, Inc." },

9114 { 0x0023A3, "ARRIS Group, Inc." },

9115 { 0x0023A4, "New Concepts Development Corp." },

9116 { 0x0023A5, "SageTV, LLC" },

9117 { 0x0023A6, "E-Mon" },

9118 { 0x0023A7, "Redpine Signals, Inc." },

9119 { 0x0023A8, "Marshall Electronics" },

9120 { 0x0023A9, "Beijing Detianquan Electromechanical Equipment Co., Ltd" },

9121 { 0x0023AA, "HFR, Inc." },

9122 { 0x0023AB, "Cisco Systems, Inc" },

9123 { 0x0023AC, "Cisco Systems, Inc" },

9124 { 0x0023AD, "Xmark Corporation" },

9125 { 0x0023AE, "Dell Inc." },

9126 { 0x0023AF, "ARRIS Group, Inc." },

9127 { 0x0023B0, "COMXION Technology Inc." },

9128 { 0x0023B1, "Longcheer Technology (Singapore) Pte Ltd" },

9129 { 0x0023B2, "Intelligent Mechatronic Systems Inc" },

9130 { 0x0023B3, "Lyyn AB" },

9131 { 0x0023B4, "Nokia Danmark A/S" },

9132 { 0x0023B5, "ORTANA LTD" },

9133 { 0x0023B6, "SECURITE COMMUNICATIONS / HONEYWELL" },

9134 { 0x0023B7, "Q-Light Co., Ltd." },

9135 { 0x0023B8, "Sichuan Jiuzhou Electronic Technology Co.,Ltd" },

9136 { 0x0023B9, "Airbus Defence and Space Deutschland GmbH" },

9137 { 0x0023BA, "Chroma" },

9138 { 0x0023BB, "Accretech SBS, Inc." },

9139 { 0x0023BC, "EQ-SYS GmbH" },

9140 { 0x0023BD, "Digital Ally, Inc." },

9141 { 0x0023BE, "Cisco SPVTG" },

9142 { 0x0023BF, "Mainpine, Inc." },

9143 { 0x0023C0, "Broadway Networks" },

9144 { 0x0023C1, "Securitas Direct AB" },

9145 { 0x0023C2, "SAMSUNG Electronics. Co. LTD" },

9146 { 0x0023C3, "LogMeIn, Inc." },

9147 { 0x0023C4, "Lux Lumen" },

9148 { 0x0023C5, "Radiation Safety and Control Services Inc" },

9149 { 0x0023C6, "SMC Corporation" },

9150 { 0x0023C7, "AVSystem sp. z o. o." },

9151 { 0x0023C8, "TEAM-R" },

9152 { 0x0023C9, "Sichuan Tianyi Information Science & Technology Stock CO.,LTD" },

9153 { 0x0023CA, "Behind The Set, LLC" },

9154 { 0x0023CB, "Shenzhen Full-join Technology Co.,Ltd" },

9155 { 0x0023CC, "Nintendo Co., Ltd." },

9156 { 0x0023CD, "TP-LINK TECHNOLOGIES CO.,LTD." },

9157 { 0x0023CE, "KITA DENSHI CORPORATION" },

9158 { 0x0023CF, "CUMMINS-ALLISON CORP." },

9159 { 0x0023D0, "Uniloc USA Inc." },

9160 { 0x0023D1, "TRG" },

9161 { 0x0023D2, "Inhand Electronics, Inc." },

9162 { 0x0023D3, "AirLink WiFi Networking Corp." },

9163 { 0x0023D4, "Texas Instruments" },

9164 { 0x0023D5, "WAREMA Renkhoff SE" },

9165 { 0x0023D6, "Samsung Electronics Co.,Ltd" },

9166 { 0x0023D7, "Samsung Electronics Co.,Ltd" },

9167 { 0x0023D8, "Ball-It Oy" },

9168 { 0x0023D9, "Banner Engineering" },

9169 { 0x0023DA, "Industrial Computer Source (Deutschland)GmbH" },

9170 { 0x0023DB, "saxnet gmbh" },

9171 { 0x0023DC, "Benein, Inc" },

9172 { 0x0023DD, "ELGIN S.A." },

9173 { 0x0023DE, "Ansync Inc." },

9174 { 0x0023DF, "Apple, Inc." },

9175 { 0x0023E0, "INO Therapeutics LLC" },

9176 { 0x0023E1, "Cavena Image Products AB" },

9177 { 0x0023E2, "SEA Signalisation" },

9178 { 0x0023E3, "Microtronic AG" },

9179 { 0x0023E4, "IPnect co. ltd." },

9180 { 0x0023E5, "IPaXiom Networks" },

9181 { 0x0023E6, "Innovation Farm, Inc." },

9182 { 0x0023E7, "Hinke A/S" },

9183 { 0x0023E8, "Demco Corp." },

9184 { 0x0023E9, "F5 Networks, Inc." },

9185 { 0x0023EA, "Cisco Systems, Inc" },

9186 { 0x0023EB, "Cisco Systems, Inc" },

9187 { 0x0023EC, "Algorithmix GmbH" },

9188 { 0x0023ED, "ARRIS Group, Inc." },

9189 { 0x0023EE, "ARRIS Group, Inc." },

9190 { 0x0023EF, "Zuend Systemtechnik AG" },

9191 { 0x0023F0, "Shanghai Jinghan Weighing Apparatus Co. Ltd." },

9192 { 0x0023F1, "Sony Corporation" },

9193 { 0x0023F2, "TVLogic" },

9194 { 0x0023F3, "Glocom, Inc." },

9195 { 0x0023F4, "Masternaut" },

9196 { 0x0023F5, "WILO SE" },

9197 { 0x0023F6, "Softwell Technology Co., Ltd." },

9198 { 0x0023F7, "Private" },

9199 { 0x0023F8, "Zyxel Communications Corporation" },

9200 { 0x0023F9, "Double-Take Software, INC." },

9201 { 0x0023FA, "RG Nets, Inc." },

9202 { 0x0023FB, "IP Datatel, LLC." },

9203 { 0x0023FC, "Ultra Stereo Labs, Inc" },

9204 { 0x0023FD, "AFT Atlas Fahrzeugtechnik GmbH" },

9205 { 0x0023FE, "Biodevices, SA" },

9206 { 0x0023FF, "Beijing HTTC Technology Ltd." },

9207 { 0x002400, "Nortel Networks" },

9208 { 0x002401, "D-Link Corporation" },

9209 { 0x002402, "Op-Tection GmbH" },

9210 { 0x002403, "Nokia Danmark A/S" },

9211 { 0x002404, "Nokia Danmark A/S" },

9212 { 0x002405, "Dilog Nordic AB" },

9213 { 0x002406, "Pointmobile" },

9214 { 0x002407, "TELEM SAS" },

9215 { 0x002408, "Pacific Biosciences" },

9216 { 0x002409, "The Toro Company" },

9217 { 0x00240A, "US Beverage Net" },

9218 { 0x00240B, "Virtual Computer Inc." },

9219 { 0x00240C, "DELEC GmbH" },

9220 { 0x00240D, "OnePath Networks LTD." },

9221 { 0x00240E, "Inventec Besta Co., Ltd." },

9222 { 0x00240F, "Ishii Tool & Engineering Corporation" },

9223 { 0x002410, "NUETEQ Technology,Inc." },

9224 { 0x002411, "PharmaSmart LLC" },

9225 { 0x002412, "Benign Technologies Co, Ltd." },

9226 { 0x002413, "Cisco Systems, Inc" },

9227 { 0x002414, "Cisco Systems, Inc" },

9228 { 0x002415, "Magnetic Autocontrol GmbH" },

9229 { 0x002416, "Any Use" },

9230 { 0x002417, "Thomson Telecom Belgium" },

9231 { 0x002418, "Nextwave Semiconductor" },

9232 { 0x002419, "Private" },

9233 { 0x00241A, "Red Beetle Inc." },

9234 { 0x00241B, "iWOW Communications Pte Ltd" },

9235 { 0x00241C, "FuGang Electronic (DG) Co.,Ltd" },

9236 { 0x00241D, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

9237 { 0x00241E, "Nintendo Co., Ltd." },

9238 { 0x00241F, "DCT-Delta GmbH" },

9239 { 0x002420, "NetUP Inc." },

9240 { 0x002421, "MICRO-STAR INT'L CO., LTD." },

9241 { 0x002422, "Knapp Logistik Automation GmbH" },

9242 { 0x002423, "AzureWave Technologies (Shanghai) Inc." },

9243 { 0x002424, "Ace Axis Limited" },

9244 { 0x002425, "Shenzhenshi chuangzhicheng Technology Co.,Ltd" },

9245 { 0x002426, "NOHMI BOSAI LTD." },

9246 { 0x002427, "SSI COMPUTER CORP" },

9247 { 0x002428, "EnergyICT" },

9248 { 0x002429, "MK MASTER INC." },

9249 { 0x00242A, "Hittite Microwave Corporation" },

9250 { 0x00242B, "Hon Hai Precision Ind. Co.,Ltd." },

9251 { 0x00242C, "Hon Hai Precision Ind. Co.,Ltd." },

9252 { 0x00242E, "Datastrip Inc." },

9253 { 0x00242F, "Micron" },

9254 { 0x002430, "Ruby Tech Corp." },

9255 { 0x002431, "Uni-v co.,ltd" },

9256 { 0x002432, "Neostar Technology Co.,LTD" },

9257 { 0x002433, "ALPSALPINE CO,.LTD" },

9258 { 0x002434, "Lectrosonics, Inc." },

9259 { 0x002435, "WIDE CORPORATION" },

9260 { 0x002436, "Apple, Inc." },

9261 { 0x002437, "Motorola - BSG" },

9262 { 0x002438, "Brocade Communications Systems LLC" },

9263 { 0x002439, "Digital Barriers Advanced Technologies" },

9264 { 0x00243A, "Ludl Electronic Products" },

9265 { 0x00243B, "CSSI (S) Pte Ltd" },

9266 { 0x00243C, "S.A.A.A." },

9267 { 0x00243D, "Emerson Appliance Motors and Controls" },

9268 { 0x00243F, "Storwize, Inc." },

9269 { 0x002440, "Halo Monitoring, Inc." },

9270 { 0x002441, "Wanzl Metallwarenfabrik GmbH" },

9271 { 0x002442, "Axona Limited" },

9272 { 0x002443, "Nortel Networks" },

9273 { 0x002444, "Nintendo Co., Ltd." },

9274 { 0x002445, "Adtran Inc" },

9275 { 0x002446, "MMB Research Inc." },

9276 { 0x002447, "Kaztek Systems" },

9277 { 0x002448, "SpiderCloud Wireless, Inc" },

9278 { 0x002449, "Shen Zhen Lite Star Electronics Technology Co., Ltd" },

9279 { 0x00244A, "Voyant International" },

9280 { 0x00244B, "PERCEPTRON INC" },

9281 { 0x00244C, "Solartron Metrology Ltd" },

9282 { 0x00244D, "Hokkaido Electronics Corporation" },

9283 { 0x00244E, "RadChips, Inc." },

9284 { 0x00244F, "Asantron Technologies Ltd." },

9285 { 0x002450, "Cisco Systems, Inc" },

9286 { 0x002451, "Cisco Systems, Inc" },

9287 { 0x002452, "Silicon Software GmbH" },

9288 { 0x002453, "Initra d.o.o." },

9289 { 0x002454, "Samsung Electronics Co.,Ltd" },

9290 { 0x002455, "MuLogic BV" },

9291 { 0x002456, "2Wire Inc" },

9292 { 0x002458, "PA Bastion CC" },

9293 { 0x002459, "ABB Automation products GmbH" },

9294 { 0x00245A, "Nanjing Panda Electronics Company Limited" },

9295 { 0x00245B, "RAIDON TECHNOLOGY, INC." },

9296 { 0x00245C, "Design-Com Technologies Pty. Ltd." },

9297 { 0x00245D, "Terberg besturingstechniek B.V." },

9298 { 0x00245E, "Hivision Co.,ltd" },

9299 { 0x00245F, "Vine Telecom CO.,Ltd." },

9300 { 0x002460, "Giaval Science Development Co. Ltd." },

9301 { 0x002461, "Shin Wang Tech." },

9302 { 0x002462, "Rayzone Corporation" },

9303 { 0x002463, "Phybridge Inc" },

9304 { 0x002464, "Bridge Technologies Co AS" },

9305 { 0x002465, "Elentec" },

9306 { 0x002466, "Unitron nv" },

9307 { 0x002467, "AOC International (Europe) GmbH" },

9308 { 0x002468, "Sumavision Technologies Co.,Ltd" },

9309 { 0x002469, "Fasttel - Smart Doorphones" },

9310 { 0x00246A, "Solid Year Co., Ltd." },

9311 { 0x00246B, "Covia, Inc." },

9312 { 0x00246C, "Aruba, a Hewlett Packard Enterprise Company" },

9313 { 0x00246D, "Weinzierl Engineering GmbH" },

9314 { 0x00246E, "Phihong USA Corp." },

9315 { 0x00246F, "Onda Communication spa" },

9316 { 0x002470, "AUROTECH ultrasound AS." },

9317 { 0x002471, "Fusion MultiSystems dba Fusion-io" },

9318 { 0x002472, "ReDriven Power Inc." },

9319 { 0x002473, "3COM EUROPE LTD" },

9320 { 0x002474, "Autronica Fire And Securirty" },

9321 { 0x002475, "Compass System(Embedded Dept.)" },

9322 { 0x002476, "TAP.tv" },

9323 { 0x002477, "Tibbo Technology" },

9324 { 0x002478, "Mag Tech Electronics Co Limited" },

9325 { 0x002479, "Optec Displays, Inc." },

9326 { 0x00247A, "FU YI CHENG Technology Co., Ltd." },

9327 { 0x00247B, "Actiontec Electronics, Inc" },

9328 { 0x00247C, "Nokia Danmark A/S" },

9329 { 0x00247D, "Nokia Danmark A/S" },

9330 { 0x00247E, "Universal Global Scientific Industrial Co., Ltd." },

9331 { 0x00247F, "Nortel Networks" },

9332 { 0x002480, "Meteocontrol GmbH" },

9333 { 0x002481, "Hewlett Packard" },

9334 { 0x002482, "Ruckus Wireless" },

9335 { 0x002483, "LG Electronics (Mobile Communications)" },

9336 { 0x002484, "Bang and Olufsen Medicom a/s" },

9337 { 0x002485, "ConteXtream Ltd" },

9338 { 0x002486, "DesignArt Networks" },

9339 { 0x002487, "Transact Campus, Inc." },

9340 { 0x002488, "Centre For Development Of Telematics" },

9341 { 0x002489, "Vodafone Omnitel N.V." },

9342 { 0x00248A, "Kaga Electronics Co., Ltd." },

9343 { 0x00248B, "HYBUS CO., LTD." },

9344 { 0x00248C, "ASUSTek COMPUTER INC." },

9345 { 0x00248D, "Sony Interactive Entertainment Inc." },

9346 { 0x00248E, "Infoware ZRt." },

9347 { 0x00248F, "DO-MONIX" },

9348 { 0x002490, "Samsung Electronics Co.,Ltd" },

9349 { 0x002491, "Samsung Electronics Co.,Ltd" },

9350 { 0x002492, "Motorola, Broadband Solutions Group" },

9351 { 0x002493, "ARRIS Group, Inc." },

9352 { 0x002494, "Shenzhen Baoxin Tech CO., Ltd." },

9353 { 0x002495, "ARRIS Group, Inc." },

9354 { 0x002496, "Ginzinger electronic systems" },

9355 { 0x002497, "Cisco Systems, Inc" },

9356 { 0x002498, "Cisco Systems, Inc" },

9357 { 0x002499, "Aquila Technologies" },

9358 { 0x00249A, "Beijing Zhongchuang Telecommunication Test Co., Ltd." },

9359 { 0x00249B, "Action Star Enterprise Co., Ltd." },

9360 { 0x00249C, "Bimeng Comunication System Co. Ltd" },

9361 { 0x00249D, "NES Technology Inc." },

9362 { 0x00249E, "ADC-Elektronik GmbH" },

9363 { 0x00249F, "RIM Testing Services" },

9364 { 0x0024A0, "ARRIS Group, Inc." },

9365 { 0x0024A1, "ARRIS Group, Inc." },

9366 { 0x0024A2, "Hong Kong Middleware Technology Limited" },

9367 { 0x0024A3, "Sonim Technologies Inc" },

9368 { 0x0024A4, "Siklu Communication" },

9369 { 0x0024A5, "BUFFALO.INC" },

9370 { 0x0024A6, "TELESTAR DIGITAL GmbH" },

9371 { 0x0024A7, "Advanced Video Communications Inc." },

9372 { 0x0024A8, "ProCurve Networking by HP" },

9373 { 0x0024A9, "Ag Leader Technology" },

9374 { 0x0024AA, "Dycor Technologies Ltd." },

9375 { 0x0024AB, "A7 Engineering, Inc." },

9376 { 0x0024AC, "Hangzhou DPtech Technologies Co., Ltd." },

9377 { 0x0024AD, "Adolf Thies Gmbh & Co. KG" },

9378 { 0x0024AE, "IDEMIA" },

9379 { 0x0024AF, "Dish Technologies Corp" },

9380 { 0x0024B0, "ESAB AB" },

9381 { 0x0024B1, "Coulomb Technologies" },

9382 { 0x0024B2, "NETGEAR" },

9383 { 0x0024B3, "Graf-Syteco GmbH & Co. KG" },

9384 { 0x0024B4, "ESCATRONIC GmbH" },

9385 { 0x0024B5, "Nortel Networks" },

9386 { 0x0024B6, "Seagate Technology" },

9387 { 0x0024B7, "GridPoint, Inc." },

9388 { 0x0024B8, "free alliance sdn bhd" },

9389 { 0x0024B9, "Wuhan Higheasy Electronic Technology Development Co.Ltd" },

9390 { 0x0024BA, "Texas Instruments" },

9391 { 0x0024BB, "CENTRAL Corporation" },

9392 { 0x0024BC, "HuRob Co.,Ltd" },

9393 { 0x0024BD, "Hainzl Industriesysteme GmbH" },

9394 { 0x0024BE, "Sony Corporation" },

9395 { 0x0024BF, "Carrier Culoz SA" },

9396 { 0x0024C0, "NTI COMODO INC" },

9397 { 0x0024C1, "ARRIS Group, Inc." },

9398 { 0x0024C2, "Asumo Co.,Ltd." },

9399 { 0x0024C3, "Cisco Systems, Inc" },

9400 { 0x0024C4, "Cisco Systems, Inc" },

9401 { 0x0024C5, "Meridian Audio Limited" },

9402 { 0x0024C6, "Hager Electro SAS" },

9403 { 0x0024C7, "Mobilarm Ltd" },

9404 { 0x0024C8, "Broadband Solutions Group" },

9405 { 0x0024C9, "Broadband Solutions Group" },

9406 { 0x0024CA, "Tobii Technology AB" },

9407 { 0x0024CB, "Autonet Mobile" },

9408 { 0x0024CC, "Fascinations Toys and Gifts, Inc." },

9409 { 0x0024CD, "Willow Garage, Inc." },

9410 { 0x0024CE, "Exeltech Inc" },

9411 { 0x0024CF, "Inscape Data Corporation" },

9412 { 0x0024D0, "Shenzhen SOGOOD Industry CO.,LTD." },

9413 { 0x0024D1, "Thomson Inc." },

9414 { 0x0024D2, "ASKEY COMPUTER CORP" },

9415 { 0x0024D3, "QUALICA Inc." },

9416 { 0x0024D4, "FREEBOX SAS" },

9417 { 0x0024D5, "Winward Industrial Limited" },

9418 { 0x0024D6, "Intel Corporate" },

9419 { 0x0024D7, "Intel Corporate" },

9420 { 0x0024D8, "IlSung Precision" },

9421 { 0x0024D9, "BICOM, Inc." },

9422 { 0x0024DA, "Innovar Systems Limited" },

9423 { 0x0024DB, "Alcohol Monitoring Systems" },

9424 { 0x0024DC, "Juniper Networks" },

9425 { 0x0024DD, "Centrak, Inc." },

9426 { 0x0024DE, "GLOBAL Technology Inc." },

9427 { 0x0024DF, "Digitalbox Europe GmbH" },

9428 { 0x0024E0, "DS Tech, LLC" },

9429 { 0x0024E1, "Convey Computer Corp." },

9430 { 0x0024E2, "HASEGAWA ELECTRIC CO.,LTD." },

9431 { 0x0024E3, "CAO Group" },

9432 { 0x0024E4, "Withings" },

9433 { 0x0024E5, "Seer Technology, Inc" },

9434 { 0x0024E6, "In Motion Technology Inc." },

9435 { 0x0024E7, "Plaster Networks" },

9436 { 0x0024E8, "Dell Inc." },

9437 { 0x0024E9, "Samsung Electronics Co.,Ltd" },

9438 { 0x0024EA, "iris-GmbH infrared & intelligent sensors" },

9439 { 0x0024EB, "ClearPath Networks, Inc." },

9440 { 0x0024EC, "United Information Technology Co.,Ltd." },

9441 { 0x0024ED, "YT Elec. Co,.Ltd." },

9442 { 0x0024EE, "Wynmax Inc." },

9443 { 0x0024EF, "Sony Corporation" },

9444 { 0x0024F0, "Seanodes" },

9445 { 0x0024F1, "Shenzhen Fanhai Sanjiang Electronics Co., Ltd." },

9446 { 0x0024F2, "Uniphone Telecommunication Co., Ltd." },

9447 { 0x0024F3, "Nintendo Co., Ltd." },

9448 { 0x0024F4, "Kaminario, Ltd." },

9449 { 0x0024F5, "NDS Surgical Imaging" },

9450 { 0x0024F6, "MIYOSHI ELECTRONICS CORPORATION" },

9451 { 0x0024F7, "Cisco Systems, Inc" },

9452 { 0x0024F8, "Technical Solutions Company Ltd." },

9453 { 0x0024F9, "Cisco Systems, Inc" },

9454 { 0x0024FA, "Hilger u. Kern GMBH" },

9455 { 0x0024FB, "Private" },

9456 { 0x0024FC, "QuoPin Co., Ltd." },

9457 { 0x0024FD, "Accedian Networks Inc" },

9458 { 0x0024FE, "AVM GmbH" },

9459 { 0x0024FF, "QLogic Corporation" },

9460 { 0x002500, "Apple, Inc." },

9461 { 0x002501, "JSC Supertel" },

9462 { 0x002502, "NaturalPoint" },

9463 { 0x002503, "IBM Corp" },

9464 { 0x002504, "Valiant Communications Limited" },

9465 { 0x002505, "eks Engel GmbH & Co. KG" },

9466 { 0x002506, "A.I. ANTITACCHEGGIO ITALIA SRL" },

9467 { 0x002507, "ASTAK Inc." },

9468 { 0x002508, "Maquet Cardiopulmonary AG" },

9469 { 0x002509, "SHARETRONIC Group LTD" },

9470 { 0x00250A, "Security Expert Co. Ltd" },

9471 { 0x00250B, "CENTROFACTOR INC" },

9472 { 0x00250C, "Senet Inc" },

9473 { 0x00250D, "GZT Telkom-Telmor sp. z o.o." },

9474 { 0x00250E, "gt german telematics gmbh" },

9475 { 0x00250F, "On-Ramp Wireless, Inc." },

9476 { 0x002510, "Pico-Tesla Magnetic Therapies" },

9477 { 0x002511, "Elitegroup Computer Systems Co.,Ltd." },

9478 { 0x002512, "zte corporation" },

9479 { 0x002513, "CXP DIGITAL BV" },

9480 { 0x002514, "PC Worth Int'l Co., Ltd." },

9481 { 0x002515, "SFR" },

9482 { 0x002516, "Integrated Design Tools, Inc." },

9483 { 0x002517, "Venntis, LLC" },

9484 { 0x002518, "Power PLUS Communications AG" },

9485 { 0x002519, "Viaas Inc" },

9486 { 0x00251A, "Psiber Data Systems Inc." },

9487 { 0x00251B, "Philips CareServant" },

9488 { 0x00251C, "EDT" },

9489 { 0x00251D, "DSA Encore, LLC" },

9490 { 0x00251E, "ROTEL TECHNOLOGIES" },

9491 { 0x00251F, "ZYNUS VISION INC." },

9492 { 0x002520, "SMA Railway Technology GmbH" },

9493 { 0x002521, "Logitek Electronic Systems, Inc." },

9494 { 0x002522, "ASRock Incorporation" },

9495 { 0x002523, "OCP Inc." },

9496 { 0x002524, "Lightcomm Technology Co., Ltd" },

9497 { 0x002525, "CTERA Networks Ltd." },

9498 { 0x002526, "Genuine Technologies Co., Ltd." },

9499 { 0x002527, "Bitrode Corp." },

9500 { 0x002528, "Daido Signal Co., Ltd." },

9501 { 0x002529, "COMELIT GROUP S.P.A" },

9502 { 0x00252A, "Chengdu GeeYa Technology Co.,LTD" },

9503 { 0x00252B, "Stirling Energy Systems" },

9504 { 0x00252C, "Entourage Systems, Inc." },

9505 { 0x00252D, "Kiryung Electronics" },

9506 { 0x00252E, "Cisco SPVTG" },

9507 { 0x00252F, "Energy, Inc." },

9508 { 0x002530, "Aetas Systems Inc." },

9509 { 0x002531, "Cloud Engines, Inc." },

9510 { 0x002532, "Digital Recorders" },

9511 { 0x002533, "WITTENSTEIN AG" },

9512 { 0x002535, "Minimax GmbH & Co KG" },

9513 { 0x002536, "Oki Electric Industry Co., Ltd." },

9514 { 0x002537, "Runcom Technologies Ltd." },

9515 { 0x002538, "Samsung Electronics Co., Ltd., Memory Division" },

9516 { 0x002539, "IfTA GmbH" },

9517 { 0x00253A, "CEVA, Ltd." },

9518 { 0x00253B, "din Dietmar Nocker Facilitymanagement GmbH" },

9519 { 0x00253C, "2Wire Inc" },

9520 { 0x00253D, "DRS Consolidated Controls" },

9521 { 0x00253E, "Sensus Metering Systems" },

9522 { 0x002540, "Quasar Technologies, Inc." },

9523 { 0x002541, "Maquet Critical Care AB" },

9524 { 0x002542, "Pittasoft" },

9525 { 0x002543, "MONEYTECH" },

9526 { 0x002544, "LoJack Corporation" },

9527 { 0x002545, "Cisco Systems, Inc" },

9528 { 0x002546, "Cisco Systems, Inc" },

9529 { 0x002547, "Nokia Danmark A/S" },

9530 { 0x002548, "Nokia Danmark A/S" },

9531 { 0x002549, "Jeorich Tech. Co.,Ltd." },

9532 { 0x00254A, "RingCube Technologies, Inc." },

9533 { 0x00254B, "Apple, Inc." },

9534 { 0x00254C, "Videon Central, Inc." },

9535 { 0x00254D, "Singapore Technologies Electronics Limited" },

9536 { 0x00254E, "Vertex Wireless Co., Ltd." },

9537 { 0x00254F, "ELETTROLAB Srl" },

9538 { 0x002550, "Riverbed Technology, Inc." },

9539 { 0x002551, "SE-Elektronic GmbH" },

9540 { 0x002552, "VXi Corporation" },

9541 { 0x002553, "ADB Broadband Italia" },

9542 { 0x002554, "Pixel8 Networks" },

9543 { 0x002555, "Visonic Technologies 1993 Ltd." },

9544 { 0x002556, "Hon Hai Precision Ind. Co.,Ltd." },

9545 { 0x002557, "BlackBerry RTS" },

9546 { 0x002558, "MPEDIA" },

9547 { 0x002559, "Syphan Technologies Ltd" },

9548 { 0x00255A, "Tantalus Systems Corp." },

9549 { 0x00255B, "CoachComm, LLC" },

9550 { 0x00255C, "NEC Corporation" },

9551 { 0x00255D, "Morningstar Corporation" },

9552 { 0x00255E, "Shanghai Dare Technologies Co.,Ltd." },

9553 { 0x00255F, "SenTec AG" },

9554 { 0x002560, "Ibridge Networks & Communications Ltd." },

9555 { 0x002561, "ProCurve Networking by HP" },

9556 { 0x002562, "interbro Co. Ltd." },

9557 { 0x002563, "Luxtera Inc" },

9558 { 0x002564, "Dell Inc." },

9559 { 0x002565, "Vizimax Inc." },

9560 { 0x002566, "Samsung Electronics Co.,Ltd" },

9561 { 0x002567, "Samsung Electronics Co.,Ltd" },

9562 { 0x002568, "HUAWEI TECHNOLOGIES CO.,LTD" },

9563 { 0x002569, "Sagemcom Broadband SAS" },

9564 { 0x00256A, "inIT - Institut Industrial IT" },

9565 { 0x00256B, "ATENIX E.E. s.r.l." },

9566 { 0x00256C, "Azimut Production Association JSC" },

9567 { 0x00256D, "Broadband Forum" },

9568 { 0x00256E, "Van Breda B.V." },

9569 { 0x00256F, "Dantherm Power" },

9570 { 0x002570, "Eastern Communications Company Limited" },

9571 { 0x002571, "Zhejiang Tianle Digital Electric Co.,Ltd" },

9572 { 0x002572, "Nemo-Q International AB" },

9573 { 0x002573, "ST Electronics (Info-Security) Pte Ltd" },

9574 { 0x002574, "KUNIMI MEDIA DEVICE Co., Ltd." },

9575 { 0x002575, "FiberPlex Technologies, LLC" },

9576 { 0x002576, "NELI TECHNOLOGIES" },

9577 { 0x002577, "D-BOX Technologies" },

9578 { 0x002578, "JSC Concern Sozvezdie" },

9579 { 0x002579, "J & F Labs" },

9580 { 0x00257A, "CAMCO Produktions- und Vertriebs-GmbH für Beschallungs- und Beleuchtungsanlagen" },

9581 { 0x00257B, "STJ ELECTRONICS PVT LTD" },

9582 { 0x00257C, "Huachentel Technology Development Co., Ltd" },

9583 { 0x00257D, "PointRed Telecom Private Ltd." },

9584 { 0x00257E, "NEW POS TECHNOLOGY LIMITED" },

9585 { 0x00257F, "CallTechSolution Co.,Ltd" },

9586 { 0x002580, "Equipson S.A." },

9587 { 0x002581, "x-star networks Inc." },

9588 { 0x002582, "Maksat Technologies (P) Ltd" },

9589 { 0x002583, "Cisco Systems, Inc" },

9590 { 0x002584, "Cisco Systems, Inc" },

9591 { 0x002585, "KOKUYO S&T Co., Ltd." },

9592 { 0x002586, "TP-LINK TECHNOLOGIES CO.,LTD." },

9593 { 0x002587, "Vitality, Inc." },

9594 { 0x002588, "Genie Industries, Inc." },

9595 { 0x002589, "Hills Industries Limited" },

9596 { 0x00258A, "Pole/Zero Corporation" },

9597 { 0x00258B, "Mellanox Technologies, Inc." },

9598 { 0x00258C, "ESUS ELEKTRONIK SAN. VE DIS. TIC. LTD. STI." },

9599 { 0x00258D, "Haier" },

9600 { 0x00258E, "The Weather Channel" },

9601 { 0x00258F, "Trident Microsystems, Inc." },

9602 { 0x002590, "Super Micro Computer, Inc." },

9603 { 0x002591, "NEXTEK, Inc." },

9604 { 0x002592, "Guangzhou Shirui Electronic Co., Ltd" },

9605 { 0x002593, "DatNet Informatikai Kft." },

9606 { 0x002594, "Eurodesign BG LTD" },

9607 { 0x002595, "Northwest Signal Supply, Inc" },

9608 { 0x002596, "GIGAVISION srl" },

9609 { 0x002597, "Kalki Communication Technologies" },

9610 { 0x002598, "Zhong Shan City Litai Electronic Industrial Co. Ltd" },

9611 { 0x002599, "Hedon e.d. B.V." },

9612 { 0x00259A, "CEStronics GmbH" },

9613 { 0x00259B, "Beijing PKUNITY Microsystems Technology Co., Ltd" },

9614 { 0x00259C, "Cisco-Linksys, LLC" },

9615 { 0x00259D, "Private" },

9616 { 0x00259E, "HUAWEI TECHNOLOGIES CO.,LTD" },

9617 { 0x00259F, "TechnoDigital Technologies GmbH" },

9618 { 0x0025A0, "Nintendo Co., Ltd." },

9619 { 0x0025A1, "Enalasys" },

9620 { 0x0025A2, "Alta Definicion LINCEO S.L." },

9621 { 0x0025A3, "Trimax Wireless, Inc." },

9622 { 0x0025A4, "EuroDesign embedded technologies GmbH" },

9623 { 0x0025A5, "Walnut Media Network" },

9624 { 0x0025A6, "Central Network Solution Co., Ltd." },

9625 { 0x0025A7, "itron" },

9626 { 0x0025A8, "Kontron (BeiJing) Technology Co.,Ltd" },

9627 { 0x0025A9, "Shanghai Embedway Information Technologies Co.,Ltd" },

9628 { 0x0025AA, "Beijing Soul Technology Co.,Ltd." },

9629 { 0x0025AB, "AIO LCD PC BU / TPV" },

9630 { 0x0025AC, "I-Tech corporation" },

9631 { 0x0025AD, "Manufacturing Resources International" },

9632 { 0x0025AE, "Microsoft Corporation" },

9633 { 0x0025AF, "COMFILE Technology" },

9634 { 0x0025B0, "Schmartz Inc" },

9635 { 0x0025B1, "Maya-Creation Corporation" },

9636 { 0x0025B2, "MBDA Deutschland GmbH" },

9637 { 0x0025B3, "Hewlett Packard" },

9638 { 0x0025B4, "Cisco Systems, Inc" },

9639 { 0x0025B5, "Cisco Systems, Inc" },

9640 { 0x0025B6, "Telecom FM" },

9641 { 0x0025B7, "Costar electronics, inc.," },

9642 { 0x0025B8, "Agile Communications, Inc." },

9643 { 0x0025B9, "Cypress Solutions Inc" },

9644 { 0x0025BA, "Alcatel-Lucent IPD" },

9645 { 0x0025BB, "INNERINT Co., Ltd." },

9646 { 0x0025BC, "Apple, Inc." },

9647 { 0x0025BD, "Italdata Ingegneria dell'Idea S.p.A." },

9648 { 0x0025BE, "Tektrap Systems Inc." },

9649 { 0x0025BF, "Wireless Cables Inc." },

9650 { 0x0025C0, "ZillionTV Corporation" },

9651 { 0x0025C1, "Nawoo Korea Corp." },

9652 { 0x0025C2, "RingBell Co.,Ltd." },

9653 { 0x0025C3, "21168" },

9654 { 0x0025C4, "Ruckus Wireless" },

9655 { 0x0025C5, "Star Link Communication Pvt. Ltd." },

9656 { 0x0025C6, "kasercorp, ltd" },

9657 { 0x0025C7, "altek Corporation" },

9658 { 0x0025C8, "S-Access GmbH" },

9659 { 0x0025C9, "SHENZHEN HUAPU DIGITAL CO., LTD" },

9660 { 0x0025CA, "Laird Connectivity" },

9661 { 0x0025CB, "Reiner SCT" },

9662 { 0x0025CC, "Mobile Communications Korea Incorporated" },

9663 { 0x0025CD, "Skylane Optics" },

9664 { 0x0025CE, "InnerSpace" },

9665 { 0x0025CF, "Nokia Danmark A/S" },

9666 { 0x0025D0, "Nokia Danmark A/S" },

9667 { 0x0025D1, "Eastern Asia Technology Limited" },

9668 { 0x0025D2, "InpegVision Co., Ltd" },

9669 { 0x0025D3, "AzureWave Technology Inc." },

9670 { 0x0025D4, "General Dynamics Mission Systems" },

9671 { 0x0025D5, "Robonica (Pty) Ltd" },

9672 { 0x0025D6, "The Kroger Co." },

9673 { 0x0025D7, "CEDO" },

9674 { 0x0025D8, "KOREA MAINTENANCE" },

9675 { 0x0025D9, "DataFab Systems Inc." },

9676 { 0x0025DA, "Secura Key" },

9677 { 0x0025DB, "ATI Electronics(Shenzhen) Co., LTD" },

9678 { 0x0025DC, "Sumitomo Electric Industries, Ltd" },

9679 { 0x0025DD, "SUNNYTEK INFORMATION CO., LTD." },

9680 { 0x0025DE, "Probits Co., LTD." },

9681 { 0x0025DF, "Taser International Inc." },

9682 { 0x0025E0, "CeedTec Sdn Bhd" },

9683 { 0x0025E1, "SHANGHAI SEEYOO ELECTRONIC & TECHNOLOGY CO., LTD" },

9684 { 0x0025E2, "Everspring Industry Co., Ltd." },

9685 { 0x0025E3, "Hanshinit Inc." },

9686 { 0x0025E4, "OMNI-WiFi, LLC" },

9687 { 0x0025E5, "LG Electronics (Mobile Communications)" },

9688 { 0x0025E6, "Belgian Monitoring Systems bvba" },

9689 { 0x0025E7, "Sony Corporation" },

9690 { 0x0025E8, "Idaho Technology" },

9691 { 0x0025E9, "i-mate Development, Inc." },

9692 { 0x0025EA, "Iphion BV" },

9693 { 0x0025EB, "Reutech Radar Systems (PTY) Ltd" },

9694 { 0x0025EC, "Humanware" },

9695 { 0x0025ED, "NuVo Technologies LLC" },

9696 { 0x0025EE, "Avtex Ltd" },

9697 { 0x0025EF, "I-TEC Co., Ltd." },

9698 { 0x0025F0, "Suga Electronics Limited" },

9699 { 0x0025F1, "ARRIS Group, Inc." },

9700 { 0x0025F2, "ARRIS Group, Inc." },

9701 { 0x0025F3, "Nordwestdeutsche Zählerrevision" },

9702 { 0x0025F4, "KoCo Connector AG" },

9703 { 0x0025F5, "DVS Korea, Co., Ltd" },

9704 { 0x0025F6, "netTALK.com, Inc." },

9705 { 0x0025F7, "Ansaldo STS USA" },

9706 { 0x0025F9, "GMK electronic design GmbH" },

9707 { 0x0025FA, "J&M Analytik AG" },

9708 { 0x0025FB, "Tunstall Healthcare A/S" },

9709 { 0x0025FC, "ENDA ENDUSTRIYEL ELEKTRONIK LTD. STI." },

9710 { 0x0025FD, "OBR Centrum Techniki Morskiej S.A." },

9711 { 0x0025FE, "Pilot Electronics Corporation" },

9712 { 0x0025FF, "CreNova Multimedia Co., Ltd" },

9713 { 0x002600, "TEAC Australia Pty Ltd." },

9714 { 0x002601, "Cutera Inc" },

9715 { 0x002602, "SMART Temps LLC" },

9716 { 0x002603, "Shenzhen Wistar Technology Co., Ltd" },

9717 { 0x002604, "WorldCast Systems" },

9718 { 0x002605, "CC Systems AB" },

9719 { 0x002606, "RAUMFELD GmbH" },

9720 { 0x002607, "Enabling Technology Pty Ltd" },

9721 { 0x002608, "Apple, Inc." },

9722 { 0x002609, "Phyllis Co., Ltd." },

9723 { 0x00260A, "Cisco Systems, Inc" },

9724 { 0x00260B, "Cisco Systems, Inc" },

9725 { 0x00260C, "Dataram" },

9726 { 0x00260D, "Mercury Systems, Inc." },

9727 { 0x00260E, "Ablaze Systems, LLC" },

9728 { 0x00260F, "Linn Products Ltd" },

9729 { 0x002610, "Apacewave Technologies" },

9730 { 0x002611, "Licera AB" },

9731 { 0x002612, "Space Exploration Technologies" },

9732 { 0x002613, "Engel Axil S.L." },

9733 { 0x002614, "KTNF" },

9734 { 0x002615, "Teracom Limited" },

9735 { 0x002616, "Rosemount Inc." },

9736 { 0x002617, "OEM Worldwide" },

9737 { 0x002618, "ASUSTek COMPUTER INC." },

9738 { 0x002619, "FRC" },

9739 { 0x00261A, "Femtocomm System Technology Corp." },

9740 { 0x00261B, "LAUREL BANK MACHINES CO., LTD." },

9741 { 0x00261C, "NEOVIA INC." },

9742 { 0x00261D, "COP SECURITY SYSTEM CORP." },

9743 { 0x00261E, "QINGBANG ELEC(SZ) CO., LTD" },

9744 { 0x00261F, "SAE Magnetics (H.K.) Ltd." },

9745 { 0x002620, "ISGUS GmbH" },

9746 { 0x002621, "InteliCloud Technology Inc." },

9747 { 0x002622, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

9748 { 0x002623, "JRD Communication Inc" },

9749 { 0x002624, "Thomson Inc." },

9750 { 0x002625, "MediaSputnik" },

9751 { 0x002626, "Geophysical Survey Systems, Inc." },

9752 { 0x002627, "Truesell" },

9753 { 0x002628, "companytec automação e controle ltda." },

9754 { 0x002629, "Juphoon System Software Inc." },

9755 { 0x00262A, "Proxense, LLC" },

9756 { 0x00262B, "Wongs Electronics Co. Ltd." },

9757 { 0x00262C, "IKT Advanced Technologies s.r.o." },

9758 { 0x00262D, "Wistron Corporation" },

9759 { 0x00262E, "Chengdu Jiuzhou Electronic Technology Inc" },

9760 { 0x00262F, "HAMAMATSU TOA ELECTRONICS" },

9761 { 0x002630, "ACOREL S.A.S" },

9762 { 0x002631, "COMMTACT LTD" },

9763 { 0x002632, "Instrumentation Technologies d.d." },

9764 { 0x002633, "MIR - Medical International Research" },

9765 { 0x002634, "Infineta Systems, Inc" },

9766 { 0x002635, "Bluetechnix GmbH" },

9767 { 0x002636, "ARRIS Group, Inc." },

9768 { 0x002637, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

9769 { 0x002638, "Xia Men Joyatech Co., Ltd." },

9770 { 0x002639, "T.M. Electronics, Inc." },

9771 { 0x00263A, "Digitec Systems" },

9772 { 0x00263B, "Onbnetech" },

9773 { 0x00263C, "Bachmann Technology GmbH & Co. KG" },

9774 { 0x00263D, "MIA Corporation" },

9775 { 0x00263E, "Trapeze Networks" },

9776 { 0x00263F, "LIOS Technology GmbH" },

9777 { 0x002640, "Baustem Broadband Technologies, Ltd." },

9778 { 0x002641, "ARRIS Group, Inc." },

9779 { 0x002642, "ARRIS Group, Inc." },

9780 { 0x002643, "ALPSALPINE CO,.LTD" },

9781 { 0x002644, "Thomson Telecom Belgium" },

9782 { 0x002645, "Circontrol S.A." },

9783 { 0x002646, "SHENYANG TONGFANG MULTIMEDIA TECHNOLOGY COMPANY LIMITED" },

9784 { 0x002647, "WFE TECHNOLOGY CORP." },

9785 { 0x002648, "Emitech Corp." },

9786 { 0x00264A, "Apple, Inc." },

9787 { 0x00264C, "Shanghai DigiVision Technology Co., Ltd." },

9788 { 0x00264D, "Arcadyan Technology Corporation" },

9789 { 0x00264E, "r2p GmbH" },

9790 { 0x00264F, "Krüger &Gothe GmbH" },

9791 { 0x002650, "2Wire Inc" },

9792 { 0x002651, "Cisco Systems, Inc" },

9793 { 0x002652, "Cisco Systems, Inc" },

9794 { 0x002653, "DaySequerra Corporation" },

9795 { 0x002654, "3COM" },

9796 { 0x002655, "Hewlett Packard" },

9797 { 0x002656, "Sansonic Electronics USA" },

9798 { 0x002657, "OOO NPP EKRA" },

9799 { 0x002658, "T-Platforms (Cyprus) Limited" },

9800 { 0x002659, "Nintendo Co., Ltd." },

9801 { 0x00265A, "D-Link Corporation" },

9802 { 0x00265B, "Hitron Technologies. Inc" },

9803 { 0x00265C, "Hon Hai Precision Ind. Co.,Ltd." },

9804 { 0x00265D, "Samsung Electronics Co.,Ltd" },

9805 { 0x00265E, "Hon Hai Precision Ind. Co.,Ltd." },

9806 { 0x00265F, "Samsung Electronics Co.,Ltd" },

9807 { 0x002660, "Logiways" },

9808 { 0x002661, "Irumtek Co., Ltd." },

9809 { 0x002662, "Actiontec Electronics, Inc" },

9810 { 0x002663, "Shenzhen Huitaiwei Tech. Ltd, co." },

9811 { 0x002664, "Core System Japan" },

9812 { 0x002665, "ProtectedLogic Corporation" },

9813 { 0x002666, "EFM Networks" },

9814 { 0x002667, "CARECOM CO.,LTD." },

9815 { 0x002668, "Nokia Danmark A/S" },

9816 { 0x002669, "Nokia Danmark A/S" },

9817 { 0x00266A, "ESSENSIUM NV" },

9818 { 0x00266B, "SHINE UNION ENTERPRISE LIMITED" },

9819 { 0x00266C, "INVENTEC CORPORATION" },

9820 { 0x00266D, "MobileAccess Networks" },

9821 { 0x00266E, "Nissho-denki Co.,LTD." },

9822 { 0x00266F, "Coordiwise Technology Corp." },

9823 { 0x002670, "Cinch Connectors" },

9824 { 0x002671, "AUTOVISION Co., Ltd" },

9825 { 0x002672, "AAMP of America" },

9826 { 0x002673, "RICOH COMPANY,LTD." },

9827 { 0x002674, "Hunter Douglas" },

9828 { 0x002675, "Aztech Electronics Pte Ltd" },

9829 { 0x002676, "COMMidt AS" },

9830 { 0x002677, "DEIF A/S" },

9831 { 0x002678, "Logic Instrument SA" },

9832 { 0x002679, "Euphonic Technologies, Inc." },

9833 { 0x00267A, "wuhan hongxin telecommunication technologies co.,ltd" },

9834 { 0x00267B, "GSI Helmholtzzentrum für Schwerionenforschung GmbH" },

9835 { 0x00267C, "Metz-Werke GmbH & Co KG" },

9836 { 0x00267D, "A-Max Technology Macao Commercial Offshore Company Limited" },

9837 { 0x00267E, "PARROT SA" },

9838 { 0x00267F, "Oregan Networks Ltd." },

9839 { 0x002680, "SIL3 Pty.Ltd" },

9840 { 0x002681, "Interspiro AB" },

9841 { 0x002682, "Gemtek Technology Co., Ltd." },

9842 { 0x002683, "Ajoho Enterprise Co., Ltd." },

9843 { 0x002684, "KISAN SYSTEM" },

9844 { 0x002685, "Digital Innovation" },

9845 { 0x002686, "Quantenna Communcations, Inc." },

9846 { 0x002687, "corega K.K" },

9847 { 0x002688, "Juniper Networks" },

9848 { 0x002689, "General Dynamics Robotic Systems" },

9849 { 0x00268A, "Terrier SC Ltd" },

9850 { 0x00268B, "Guangzhou Escene Computer Technology Limited" },

9851 { 0x00268C, "StarLeaf Ltd." },

9852 { 0x00268D, "CellTel S.p.A." },

9853 { 0x00268E, "Alta Solutions, Inc." },

9854 { 0x00268F, "MTA SpA" },

9855 { 0x002690, "I DO IT" },

9856 { 0x002691, "Sagemcom Broadband SAS" },

9857 { 0x002692, "Mitsubishi Electric Corporation" },

9858 { 0x002693, "QVidium Technologies, Inc." },

9859 { 0x002694, "Senscient Ltd" },

9860 { 0x002695, "ZT Group Int'l Inc" },

9861 { 0x002696, "NOOLIX Co., Ltd" },

9862 { 0x002697, "Alpha Technologies Inc." },

9863 { 0x002698, "Cisco Systems, Inc" },

9864 { 0x002699, "Cisco Systems, Inc" },

9865 { 0x00269A, "Carina System Co., Ltd." },

9866 { 0x00269B, "SOKRAT Ltd." },

9867 { 0x00269C, "ITUS JAPAN CO. LTD" },

9868 { 0x00269D, "M2Mnet Co., Ltd." },

9869 { 0x00269E, "Quanta Computer Inc." },

9870 { 0x00269F, "Private" },

9871 { 0x0026A0, "moblic" },

9872 { 0x0026A1, "Megger" },

9873 { 0x0026A2, "Instrumentation Technology Systems" },

9874 { 0x0026A3, "FQ Ingenieria Electronica S.A." },

9875 { 0x0026A4, "Novus Produtos Eletronicos Ltda" },

9876 { 0x0026A5, "MICROROBOT.CO.,LTD" },

9877 { 0x0026A6, "TRIXELL" },

9878 { 0x0026A7, "CONNECT SRL" },

9879 { 0x0026A8, "DAEHAP HYPER-TECH" },

9880 { 0x0026A9, "Strong Technologies Pty Ltd" },

9881 { 0x0026AA, "Kenmec Mechanical Engineering Co., Ltd." },

9882 { 0x0026AB, "Seiko Epson Corporation" },

9883 { 0x0026AC, "Shanghai LUSTER Teraband photonic Co., Ltd." },

9884 { 0x0026AD, "Arada Systems, Inc." },

9885 { 0x0026AE, "Wireless Measurement Ltd" },

9886 { 0x0026AF, "Duelco A/S" },

9887 { 0x0026B0, "Apple, Inc." },

9888 { 0x0026B1, "Navis Auto Motive Systems, Inc." },

9889 { 0x0026B2, "Setrix GmbH" },

9890 { 0x0026B3, "Thales Communications Inc" },

9891 { 0x0026B4, "Ford Motor Company" },

9892 { 0x0026B5, "ICOMM Tele Ltd" },

9893 { 0x0026B6, "ASKEY COMPUTER CORP" },

9894 { 0x0026B7, "Kingston Technology Company, Inc." },

9895 { 0x0026B8, "Actiontec Electronics, Inc" },

9896 { 0x0026B9, "Dell Inc." },

9897 { 0x0026BA, "ARRIS Group, Inc." },

9898 { 0x0026BB, "Apple, Inc." },

9899 { 0x0026BC, "General Jack Technology Ltd." },

9900 { 0x0026BD, "JTEC Card &amp; Communication Co., Ltd" },

9901 { 0x0026BE, "Schoonderbeek Elektronica Systemen B.V." },

9902 { 0x0026BF, "ShenZhen Temobi Science&Tech Development Co.,Ltd" },

9903 { 0x0026C0, "EnergyHub" },

9904 { 0x0026C1, "ARTRAY CO., LTD." },

9905 { 0x0026C2, "SCDI Co. LTD" },

9906 { 0x0026C3, "Insightek Corp." },

9907 { 0x0026C4, "Cadmos microsystems S.r.l." },

9908 { 0x0026C5, "Guangdong Gosun Telecommunications Co.,Ltd" },

9909 { 0x0026C6, "Intel Corporate" },

9910 { 0x0026C7, "Intel Corporate" },

9911 { 0x0026C8, "System Sensor" },

9912 { 0x0026C9, "Proventix Systems, Inc." },

9913 { 0x0026CA, "Cisco Systems, Inc" },

9914 { 0x0026CB, "Cisco Systems, Inc" },

9915 { 0x0026CC, "Nokia Danmark A/S" },

9916 { 0x0026CD, "PurpleComm, Inc." },

9917 { 0x0026CE, "Kozumi USA Corp." },

9918 { 0x0026CF, "DEKA R&D" },

9919 { 0x0026D0, "Semihalf" },

9920 { 0x0026D1, "S Squared Innovations Inc." },

9921 { 0x0026D2, "Pcube Systems, Inc." },

9922 { 0x0026D3, "Zeno Information System" },

9923 { 0x0026D4, "IRCA SpA" },

9924 { 0x0026D5, "Ory Solucoes em Comercio de Informatica Ltda." },

9925 { 0x0026D6, "Ningbo Andy Optoelectronic Co., Ltd." },

9926 { 0x0026D7, "KM Electornic Technology Co., Ltd." },

9927 { 0x0026D8, "Magic Point Inc." },

9928 { 0x0026D9, "ARRIS Group, Inc." },

9929 { 0x0026DA, "Universal Media Corporation /Slovakia/ s.r.o." },

9930 { 0x0026DB, "Ionics EMS Inc." },

9931 { 0x0026DC, "Optical Systems Design" },

9932 { 0x0026DD, "Fival Science & Technology Co.,Ltd." },

9933 { 0x0026DE, "FDI MATELEC" },

9934 { 0x0026DF, "TaiDoc Technology Corp." },

9935 { 0x0026E0, "ASITEQ" },

9936 { 0x0026E1, "Stanford University, OpenFlow Group" },

9937 { 0x0026E2, "LG Electronics (Mobile Communications)" },

9938 { 0x0026E3, "DTI" },

9939 { 0x0026E4, "Canal +" },

9940 { 0x0026E5, "AEG Power Solutions" },

9941 { 0x0026E6, "Visionhitech Co., Ltd." },

9942 { 0x0026E7, "Shanghai ONLAN Communication Tech. Co., Ltd." },

9943 { 0x0026E8, "Murata Manufacturing Co., Ltd." },

9944 { 0x0026E9, "SP Corp" },

9945 { 0x0026EA, "Cheerchip Electronic Technology (ShangHai) Co., Ltd." },

9946 { 0x0026EB, "Advanced Spectrum Technology Co., Ltd." },

9947 { 0x0026EC, "Legrand Home Systems, Inc" },

9948 { 0x0026ED, "zte corporation" },

9949 { 0x0026EE, "TKM GmbH" },

9950 { 0x0026EF, "Technology Advancement Group, Inc." },

9951 { 0x0026F0, "cTrixs International GmbH." },

9952 { 0x0026F1, "ProCurve Networking by HP" },

9953 { 0x0026F2, "NETGEAR" },

9954 { 0x0026F3, "SMC Networks" },

9955 { 0x0026F4, "Nesslab" },

9956 { 0x0026F5, "XRPLUS Inc." },

9957 { 0x0026F6, "Military Communication Institute" },

9958 { 0x0026F7, "Nivetti Systems Pvt. Ltd." },

9959 { 0x0026F8, "Golden Highway Industry Development Co., Ltd." },

9960 { 0x0026F9, "S.E.M. srl" },

9961 { 0x0026FA, "BandRich Inc." },

9962 { 0x0026FB, "AirDio Wireless, Inc." },

9963 { 0x0026FC, "AcSiP Technology Corp." },

9964 { 0x0026FD, "Interactive Intelligence" },

9965 { 0x0026FE, "MKD Technology Inc." },

9966 { 0x0026FF, "BlackBerry RTS" },

9967 { 0x002700, "Shenzhen Siglent Technology Co., Ltd." },

9968 { 0x002701, "INCOstartec GmbH" },

9969 { 0x002702, "SolarEdge Technologies" },

9970 { 0x002703, "Testech Electronics Pte Ltd" },

9971 { 0x002704, "Accelerated Concepts, Inc" },

9972 { 0x002705, "Sectronic" },

9973 { 0x002706, "YOISYS" },

9974 { 0x002707, "Lift Complex DS, JSC" },

9975 { 0x002708, "Nordiag ASA" },

9976 { 0x002709, "Nintendo Co., Ltd." },

9977 { 0x00270A, "IEE S.A." },

9978 { 0x00270B, "Adura Technologies" },

9979 { 0x00270C, "Cisco Systems, Inc" },

9980 { 0x00270D, "Cisco Systems, Inc" },

9981 { 0x00270E, "Intel Corporate" },

9982 { 0x00270F, "Envisionnovation Inc" },

9983 { 0x002710, "Intel Corporate" },

9984 { 0x002711, "LanPro Inc" },

9985 { 0x002712, "MaxVision LLC" },

9986 { 0x002713, "Universal Global Scientific Industrial Co., Ltd." },

9987 { 0x002714, "Grainmustards, Co,ltd." },

9988 { 0x002715, "Rebound Telecom. Co., Ltd" },

9989 { 0x002716, "Adachi-Syokai Co., Ltd." },

9990 { 0x002717, "CE Digital(Zhenjiang)Co.,Ltd" },

9991 { 0x002718, "Suzhou NEW SEAUNION Video Technology Co.,Ltd" },

9992 { 0x002719, "TP-LINK TECHNOLOGIES CO.,LTD." },

9993 { 0x00271A, "Geenovo Technology Ltd." },

9994 { 0x00271B, "Alec Sicherheitssysteme GmbH" },

9995 { 0x00271C, "MERCURY CORPORATION" },

9996 { 0x00271D, "Comba Telecom Systems (China) Ltd." },

9997 { 0x00271E, "Xagyl Communications" },

9998 { 0x00271F, "MIPRO Electronics Co., Ltd" },

9999 { 0x002720, "NEW-SOL COM" },

10000 { 0x002721, "Shenzhen Baoan Fenda Industrial Co., Ltd" },

10001 { 0x002722, "Ubiquiti Inc" },

10002 { 0x002790, "Cisco Systems, Inc" },

10003 { 0x0027E3, "Cisco Systems, Inc" },

10004 { 0x0027F8, "Brocade Communications Systems LLC" },

10005 { 0x00289F, "Semptian Co., Ltd." },

10006 { 0x0028F8, "Intel Corporate" },

10007 { 0x002926, "Applied Optoelectronics, Inc Taiwan Branch" },

10008 { 0x0029C2, "Cisco Systems, Inc" },

10009 { 0x002A10, "Cisco Systems, Inc" },

10010 { 0x002A6A, "Cisco Systems, Inc" },

10011 { 0x002AAF, "LARsys-Automation GmbH" },

10012 { 0x002B67, "LCFC(HeFei) Electronics Technology co., ltd" },

10013 { 0x002BF5, "BUFFALO.INC" },

10014 { 0x002CC8, "Cisco Systems, Inc" },

10015 { 0x002D76, "TITECH GmbH" },

10016 { 0x002DB3, "AMPAK Technology,Inc." },

10017 { 0x002EC7, "HUAWEI TECHNOLOGIES CO.,LTD" },

10018 { 0x002F5C, "Cisco Systems, Inc" },

10019 { 0x002FD9, "Fiberhome Telecommunication Technologies Co.,LTD" },

10020 { 0x003000, "ALLWELL TECHNOLOGY CORP." },

10021 { 0x003001, "SMP" },

10022 { 0x003002, "Expand Networks" },

10023 { 0x003003, "Phasys Ltd." },

10024 { 0x003004, "LEADTEK RESEARCH INC." },

10025 { 0x003005, "Fujitsu Siemens Computers" },

10026 { 0x003006, "SUPERPOWER COMPUTER" },

10027 { 0x003007, "OPTI, INC." },

10028 { 0x003008, "AVIO DIGITAL, INC." },

10029 { 0x003009, "Tachion Networks, Inc." },

10030 { 0x00300A, "Aztech Electronics Pte Ltd" },

10031 { 0x00300B, "mPHASE Technologies, Inc." },

10032 { 0x00300C, "CONGRUENCY, LTD." },

10033 { 0x00300D, "MMC Technology, Inc." },

10034 { 0x00300E, "Klotz Digital AG" },

10035 { 0x00300F, "IMT - Information Management T" },

10036 { 0x003010, "VISIONETICS INTERNATIONAL" },

10037 { 0x003011, "HMS Industrial Networks" },

10038 { 0x003012, "DIGITAL ENGINEERING LTD." },

10039 { 0x003013, "NEC Corporation" },

10040 { 0x003014, "DIVIO, INC." },

10041 { 0x003015, "CP CLARE CORP." },

10042 { 0x003016, "ISHIDA CO., LTD." },

10043 { 0x003017, "BlueArc UK Ltd" },

10044 { 0x003018, "Jetway Information Co., Ltd." },

10045 { 0x003019, "Cisco Systems, Inc" },

10046 { 0x00301A, "SMARTBRIDGES PTE. LTD." },

10047 { 0x00301B, "SHUTTLE, INC." },

10048 { 0x00301C, "ALTVATER AIRDATA SYSTEMS" },

10049 { 0x00301D, "SKYSTREAM, INC." },

10050 { 0x00301E, "3COM EUROPE LTD" },

10051 { 0x00301F, "OPTICAL NETWORKS, INC." },

10052 { 0x003020, "TSI, Inc.." },

10053 { 0x003021, "HSING TECH. ENTERPRISE CO.,LTD" },

10054 { 0x003022, "Fong Kai Industrial Co., Ltd." },

10055 { 0x003023, "COGENT COMPUTER SYSTEMS, INC." },

10056 { 0x003024, "Cisco Systems, Inc" },

10057 { 0x003025, "CHECKOUT COMPUTER SYSTEMS, LTD" },

10058 { 0x003026, "HeiTel Digital Video GmbH" },

10059 { 0x003027, "KERBANGO, INC." },

10060 { 0x003028, "FASE Saldatura srl" },

10061 { 0x003029, "OPICOM" },

10062 { 0x00302A, "SOUTHERN INFORMATION" },

10063 { 0x00302B, "Inalp Solutions AG" },

10064 { 0x00302C, "SYLANTRO SYSTEMS CORPORATION" },

10065 { 0x00302D, "QUANTUM BRIDGE COMMUNICATIONS" },

10066 { 0x00302E, "Hoft & Wessel AG" },

10067 { 0x00302F, "GE Aviation System" },

10068 { 0x003030, "HARMONIX CORPORATION" },

10069 { 0x003031, "LIGHTWAVE COMMUNICATIONS, INC." },

10070 { 0x003032, "MagicRam, Inc." },

10071 { 0x003033, "ORIENT TELECOM CO., LTD." },

10072 { 0x003034, "SET ENGINEERING" },

10073 { 0x003035, "Corning Incorporated" },

10074 { 0x003036, "RMP ELEKTRONIKSYSTEME GMBH" },

10075 { 0x003037, "Packard Bell Nec Services" },

10076 { 0x003038, "XCP, INC." },

10077 { 0x003039, "SOFTBOOK PRESS" },

10078 { 0x00303A, "MAATEL" },

10079 { 0x00303B, "PowerCom Technology" },

10080 { 0x00303C, "ONNTO CORP." },

10081 { 0x00303D, "IVA CORPORATION" },

10082 { 0x00303E, "Radcom Ltd." },

10083 { 0x00303F, "TurboComm Tech Inc." },

10084 { 0x003040, "Cisco Systems, Inc" },

10085 { 0x003041, "SAEJIN T & M CO., LTD." },

10086 { 0x003042, "DeTeWe-Deutsche Telephonwerke" },

10087 { 0x003043, "IDREAM TECHNOLOGIES, PTE. LTD." },

10088 { 0x003044, "CradlePoint, Inc" },

10089 { 0x003045, "Village Networks, Inc. (VNI)" },

10090 { 0x003046, "Controlled Electronic Manageme" },

10091 { 0x003047, "NISSEI ELECTRIC CO., LTD." },

10092 { 0x003048, "Super Micro Computer, Inc." },

10093 { 0x003049, "BRYANT TECHNOLOGY, LTD." },

10094 { 0x00304A, "Fraunhofer IPMS" },

10095 { 0x00304B, "ORBACOM SYSTEMS, INC." },

10096 { 0x00304C, "APPIAN COMMUNICATIONS, INC." },

10097 { 0x00304D, "ESI" },

10098 { 0x00304E, "BUSTEC PRODUCTION LTD." },

10099 { 0x00304F, "PLANET Technology Corporation" },

10100 { 0x003050, "Versa Technology" },

10101 { 0x003051, "ORBIT AVIONIC & COMMUNICATION" },

10102 { 0x003052, "DZS Inc." },

10103 { 0x003053, "Basler AG" },

10104 { 0x003054, "Castlenet Technology Inc." },

10105 { 0x003055, "Renesas Technology America, Inc." },

10106 { 0x003056, "HMS Industrial Networks" },

10107 { 0x003057, "QTelNet, Inc." },

10108 { 0x003058, "API MOTION" },

10109 { 0x003059, "Kontron Europe GmbH" },

10110 { 0x00305A, "TELGEN CORPORATION" },

10111 { 0x00305B, "Toko Inc." },

10112 { 0x00305C, "SMAR Laboratories Corp." },

10113 { 0x00305D, "DIGITRA SYSTEMS, INC." },

10114 { 0x00305E, "Abelko Innovation" },

10115 { 0x00305F, "Hasselblad" },

10116 { 0x003060, "Powerfile, Inc." },

10117 { 0x003061, "MobyTEL" },

10118 { 0x003062, "IP Video Networks Inc" },

10119 { 0x003063, "SANTERA SYSTEMS, INC." },

10120 { 0x003064, "ADLINK TECHNOLOGY, INC." },

10121 { 0x003065, "Apple, Inc." },

10122 { 0x003066, "RFM" },

10123 { 0x003067, "BIOSTAR Microtech Int'l Corp." },

10124 { 0x003068, "CYBERNETICS TECH. CO., LTD." },

10125 { 0x003069, "IMPACCT TECHNOLOGY CORP." },

10126 { 0x00306A, "PENTA MEDIA CO., LTD." },

10127 { 0x00306B, "CMOS SYSTEMS, INC." },

10128 { 0x00306C, "Hitex Holding GmbH" },

10129 { 0x00306D, "LUCENT TECHNOLOGIES" },

10130 { 0x00306E, "Hewlett Packard" },

10131 { 0x00306F, "SEYEON TECH. CO., LTD." },

10132 { 0x003070, "1Net Corporation" },

10133 { 0x003071, "Cisco Systems, Inc" },

10134 { 0x003072, "Intellibyte Inc." },

10135 { 0x003073, "International Microsystems, In" },

10136 { 0x003074, "EQUIINET LTD." },

10137 { 0x003075, "ADTECH" },

10138 { 0x003076, "Akamba Corporation" },

10139 { 0x003077, "ONPREM NETWORKS" },

10140 { 0x003078, "Cisco Systems, Inc" },

10141 { 0x003079, "CQOS, INC." },

10142 { 0x00307A, "Advanced Technology & Systems" },

10143 { 0x00307B, "Cisco Systems, Inc" },

10144 { 0x00307C, "ADID SA" },

10145 { 0x00307D, "GRE AMERICA, INC." },

10146 { 0x00307E, "Redflex Communication Systems" },

10147 { 0x00307F, "IRLAN LTD." },

10148 { 0x003080, "Cisco Systems, Inc" },

10149 { 0x003081, "ALTOS C&C" },

10150 { 0x003082, "TAIHAN ELECTRIC WIRE CO., LTD." },

10151 { 0x003083, "Ivron Systems" },

10152 { 0x003084, "ALLIED TELESYN INTERNAIONAL" },

10153 { 0x003085, "Cisco Systems, Inc" },

10154 { 0x003086, "Transistor Devices, Inc." },

10155 { 0x003087, "VEGA GRIESHABER KG" },

10156 { 0x003088, "Ericsson" },

10157 { 0x003089, "Spectrapoint Wireless, LLC" },

10158 { 0x00308A, "NICOTRA SISTEMI S.P.A" },

10159 { 0x00308B, "Brix Networks" },

10160 { 0x00308C, "Quantum Corporation" },

10161 { 0x00308D, "Pinnacle Systems, Inc." },

10162 { 0x00308E, "Crossmatch Technologies/HID Global" },

10163 { 0x00308F, "MICRILOR, Inc." },

10164 { 0x003090, "CYRA TECHNOLOGIES, INC." },

10165 { 0x003091, "TAIWAN FIRST LINE ELEC. CORP." },

10166 { 0x003092, "Kontron Electronics AG" },

10167 { 0x003093, "Sonnet Technologies, Inc" },

10168 { 0x003094, "Cisco Systems, Inc" },

10169 { 0x003095, "Procomp Informatics, Ltd." },

10170 { 0x003096, "Cisco Systems, Inc" },

10171 { 0x003097, "AB Regin" },

10172 { 0x003098, "Global Converging Technologies" },

10173 { 0x003099, "BOENIG UND KALLENBACH OHG" },

10174 { 0x00309A, "ASTRO TERRA CORP." },

10175 { 0x00309B, "Smartware" },

10176 { 0x00309C, "Timing Applications, Inc." },

10177 { 0x00309D, "Nimble Microsystems, Inc." },

10178 { 0x00309E, "WORKBIT CORPORATION." },

10179 { 0x00309F, "AMBER NETWORKS" },

10180 { 0x0030A0, "TYCO SUBMARINE SYSTEMS, LTD." },

10181 { 0x0030A1, "WEBGATE Inc." },

10182 { 0x0030A2, "Lightner Engineering" },

10183 { 0x0030A3, "Cisco Systems, Inc" },

10184 { 0x0030A4, "Woodwind Communications System" },

10185 { 0x0030A5, "ACTIVE POWER" },

10186 { 0x0030A6, "VIANET TECHNOLOGIES, LTD." },

10187 { 0x0030A7, "SCHWEITZER ENGINEERING" },

10188 { 0x0030A8, "OL'E COMMUNICATIONS, INC." },

10189 { 0x0030A9, "Netiverse, Inc." },

10190 { 0x0030AA, "AXUS MICROSYSTEMS, INC." },

10191 { 0x0030AB, "DELTA NETWORKS, INC." },

10192 { 0x0030AC, "Systeme Lauer GmbH & Co., Ltd." },

10193 { 0x0030AD, "SHANGHAI COMMUNICATION" },

10194 { 0x0030AE, "Times N System, Inc." },

10195 { 0x0030AF, "Honeywell GmbH" },

10196 { 0x0030B0, "Convergenet Technologies" },

10197 { 0x0030B1, "TrunkNet" },

10198 { 0x0030B2, "L-3 Sonoma EO" },

10199 { 0x0030B3, "San Valley Systems, Inc." },

10200 { 0x0030B4, "INTERSIL CORP." },

10201 { 0x0030B5, "Tadiran Microwave Networks" },

10202 { 0x0030B6, "Cisco Systems, Inc" },

10203 { 0x0030B7, "Teletrol Systems, Inc." },

10204 { 0x0030B8, "RiverDelta Networks" },

10205 { 0x0030B9, "ECTEL" },

10206 { 0x0030BA, "AC&T SYSTEM CO., LTD." },

10207 { 0x0030BB, "CacheFlow, Inc." },

10208 { 0x0030BC, "Optronic AG" },

10209 { 0x0030BD, "BELKIN COMPONENTS" },

10210 { 0x0030BE, "City-Net Technology, Inc." },

10211 { 0x0030BF, "MULTIDATA GMBH" },

10212 { 0x0030C0, "Lara Technology, Inc." },

10213 { 0x0030C1, "Hewlett Packard" },

10214 { 0x0030C2, "COMONE" },

10215 { 0x0030C3, "FLUECKIGER ELEKTRONIK AG" },

10216 { 0x0030C4, "Canon Imaging Systems Inc." },

10217 { 0x0030C5, "CADENCE DESIGN SYSTEMS, INC." },

10218 { 0x0030C6, "CONTROL SOLUTIONS, INC." },

10219 { 0x0030C7, "Macromate Corp." },

10220 { 0x0030C8, "GAD LINE, LTD." },

10221 { 0x0030C9, "LuxN, N" },

10222 { 0x0030CA, "Discovery Com" },

10223 { 0x0030CB, "OMNI FLOW COMPUTERS, INC." },

10224 { 0x0030CC, "Tenor Networks, Inc." },

10225 { 0x0030CD, "CONEXANT SYSTEMS, INC." },

10226 { 0x0030CE, "Zaffire" },

10227 { 0x0030CF, "TWO TECHNOLOGIES, INC." },

10228 { 0x0030D0, "Tellabs" },

10229 { 0x0030D1, "INOVA CORPORATION" },

10230 { 0x0030D2, "WIN TECHNOLOGIES, CO., LTD." },

10231 { 0x0030D3, "Agilent Technologies, Inc." },

10232 { 0x0030D4, "AAE Systems, Inc." },

10233 { 0x0030D5, "DResearch GmbH" },

10234 { 0x0030D6, "MSC VERTRIEBS GMBH" },

10235 { 0x0030D7, "Innovative Systems, L.L.C." },

10236 { 0x0030D8, "SITEK" },

10237 { 0x0030D9, "DATACORE SOFTWARE CORP." },

10238 { 0x0030DA, "Comtrend Corporation" },

10239 { 0x0030DB, "Mindready Solutions, Inc." },

10240 { 0x0030DC, "RIGHTECH CORPORATION" },

10241 { 0x0030DD, "INDIGITA CORPORATION" },

10242 { 0x0030DE, "WAGO Kontakttechnik GmbH" },

10243 { 0x0030DF, "KB/TEL TELECOMUNICACIONES" },

10244 { 0x0030E0, "OXFORD SEMICONDUCTOR LTD." },

10245 { 0x0030E1, "Network Equipment Technologies, Inc." },

10246 { 0x0030E2, "GARNET SYSTEMS CO., LTD." },

10247 { 0x0030E3, "SEDONA NETWORKS CORP." },

10248 { 0x0030E4, "CHIYODA SYSTEM RIKEN" },

10249 { 0x0030E5, "Amper Datos S.A." },

10250 { 0x0030E6, "Draeger Medical Systems, Inc." },

10251 { 0x0030E7, "CNF MOBILE SOLUTIONS, INC." },

10252 { 0x0030E8, "ENSIM CORP." },

10253 { 0x0030E9, "GMA COMMUNICATION MANUFACT'G" },

10254 { 0x0030EA, "TeraForce Technology Corporation" },

10255 { 0x0030EB, "TURBONET COMMUNICATIONS, INC." },

10256 { 0x0030EC, "BORGARDT" },

10257 { 0x0030ED, "Expert Magnetics Corp." },

10258 { 0x0030EE, "DSG Technology, Inc." },

10259 { 0x0030EF, "NEON TECHNOLOGY, INC." },

10260 { 0x0030F0, "Uniform Industrial Corp." },

10261 { 0x0030F1, "Accton Technology Corp" },

10262 { 0x0030F2, "Cisco Systems, Inc" },

10263 { 0x0030F3, "At Work Computers" },

10264 { 0x0030F4, "STARDOT TECHNOLOGIES" },

10265 { 0x0030F5, "Wild Lab. Ltd." },

10266 { 0x0030F6, "SECURELOGIX CORPORATION" },

10267 { 0x0030F7, "RAMIX INC." },

10268 { 0x0030F8, "Dynapro Systems, Inc." },

10269 { 0x0030F9, "Sollae Systems Co., Ltd." },

10270 { 0x0030FA, "TELICA, INC." },

10271 { 0x0030FB, "AZS Technology AG" },

10272 { 0x0030FC, "Terawave Communications, Inc." },

10273 { 0x0030FD, "INTEGRATED SYSTEMS DESIGN" },

10274 { 0x0030FE, "DSA GmbH" },

10275 { 0x0030FF, "DataFab Systems Inc." },

10276 { 0x003126, "Nokia" },

10277 { 0x003146, "Juniper Networks" },

10278 { 0x003192, "TP-Link Corporation Limited" },

10279 { 0x003217, "Cisco Systems, Inc" },

10280 { 0x00323A, "so-logic" },

10281 { 0x003358, "Ruckus Wireless" },

10282 { 0x00336C, "SynapSense Corporation" },

10283 { 0x0034A1, "RF-LAMBDA USA INC." },

10284 { 0x0034DA, "LG Electronics (Mobile Communications)" },

10285 { 0x0034F1, "Radicom Research, Inc." },

10286 { 0x0034FE, "HUAWEI TECHNOLOGIES CO.,LTD" },

10287 { 0x00351A, "Cisco Systems, Inc" },

10288 { 0x003532, "Electro-Metrics Corporation" },

10289 { 0x003560, "Rosen Aviation" },

10290 { 0x0035FF, "Texas Instruments" },

10291 { 0x003676, "ARRIS Group, Inc." },

10292 { 0x0036BE, "Northwest Towers" },

10293 { 0x0036D7, "Keltron IOT Corp." },

10294 { 0x0036F8, "Conti Temic microelectronic GmbH" },

10295 { 0x0036FE, "SuperVision" },

10296 { 0x00376D, "Murata Manufacturing Co., Ltd." },

10297 { 0x0037B7, "Sagemcom Broadband SAS" },

10298 { 0x0038DF, "Cisco Systems, Inc" },

10299 { 0x003969, "Air-Weigh Incorporated" },

10300 { 0x003A7D, "Cisco Systems, Inc" },

10301 { 0x003A98, "Cisco Systems, Inc" },

10302 { 0x003A99, "Cisco Systems, Inc" },

10303 { 0x003A9A, "Cisco Systems, Inc" },

10304 { 0x003A9B, "Cisco Systems, Inc" },

10305 { 0x003A9C, "Cisco Systems, Inc" },

10306 { 0x003A9D, "NEC Platforms, Ltd." },

10307 { 0x003AAF, "BlueBit Ltd." },

10308 { 0x003C10, "Cisco Systems, Inc" },

10309 { 0x003C84, "Silicon Laboratories" },

10310 { 0x003CC5, "WONWOO Engineering Co., Ltd" },

10311 { 0x003D41, "Hatteland Computer AS" },

10312 { 0x003DE1, "Huawei Device Co., Ltd." },

10313 { 0x003DE8, "LG Electronics (Mobile Communications)" },

10314 { 0x003E73, "Mist Systems, Inc." },

10315 { 0x003EE1, "Apple, Inc." },

10316 { 0x003F10, "Shenzhen GainStrong Technology Co., Ltd." },

10317 { 0x004000, "PCI COMPONENTES DA AMZONIA LTD" },

10318 { 0x004001, "Zero One Technology Co. Ltd." },

10319 { 0x004002, "PERLE SYSTEMS LIMITED" },

10320 { 0x004003, "Emerson Process Management Power & Water Solutions, Inc." },

10321 { 0x004004, "ICM CO. LTD." },

10322 { 0x004005, "ANI COMMUNICATIONS INC." },

10323 { 0x004006, "SAMPO TECHNOLOGY CORPORATION" },

10324 { 0x004007, "TELMAT INFORMATIQUE" },

10325 { 0x004008, "A PLUS INFO CORPORATION" },

10326 { 0x004009, "TACHIBANA TECTRON CO., LTD." },

10327 { 0x00400A, "PIVOTAL TECHNOLOGIES, INC." },

10328 { 0x00400B, "Cisco Systems, Inc" },

10329 { 0x00400C, "GENERAL MICRO SYSTEMS, INC." },

10330 { 0x00400D, "LANNET DATA COMMUNICATIONS,LTD" },

10331 { 0x00400E, "MEMOTEC, INC." },

10332 { 0x00400F, "DATACOM TECHNOLOGIES" },

10333 { 0x004010, "SONIC SYSTEMS, INC." },

10334 { 0x004011, "ANDOVER CONTROLS CORPORATION" },

10335 { 0x004012, "WINDATA, INC." },

10336 { 0x004013, "NTT DATA COMM. SYSTEMS CORP." },

10337 { 0x004014, "COMSOFT GMBH" },

10338 { 0x004015, "ASCOM INFRASYS AG" },

10339 { 0x004016, "ADC - Global Connectivity Solutions Division" },

10340 { 0x004017, "Silex Technology America" },

10341 { 0x004018, "ADOBE SYSTEMS, INC." },

10342 { 0x004019, "AEON SYSTEMS, INC." },

10343 { 0x00401A, "FUJI ELECTRIC CO., LTD." },

10344 { 0x00401B, "PRINTER SYSTEMS CORP." },

10345 { 0x00401C, "AST RESEARCH, INC." },

10346 { 0x00401D, "INVISIBLE SOFTWARE, INC." },

10347 { 0x00401E, "ICC" },

10348 { 0x00401F, "COLORGRAPH LTD" },

10349 { 0x004020, "CommScope Inc" },

10350 { 0x004021, "RASTER GRAPHICS" },

10351 { 0x004022, "KLEVER COMPUTERS, INC." },

10352 { 0x004023, "LOGIC CORPORATION" },

10353 { 0x004024, "COMPAC INC." },

10354 { 0x004025, "MOLECULAR DYNAMICS" },

10355 { 0x004026, "BUFFALO.INC" },

10356 { 0x004027, "SMC MASSACHUSETTS, INC." },

10357 { 0x004028, "NETCOMM LIMITED" },

10358 { 0x004029, "Compex" },

10359 { 0x00402A, "Canoga Perkins Corporation" },

10360 { 0x00402B, "TRIGEM COMPUTER, INC." },

10361 { 0x00402C, "ISIS DISTRIBUTED SYSTEMS, INC." },

10362 { 0x00402D, "HARRIS ADACOM CORPORATION" },

10363 { 0x00402E, "PRECISION SOFTWARE, INC." },

10364 { 0x00402F, "XLNT DESIGNS INC." },

10365 { 0x004030, "GK COMPUTER" },

10366 { 0x004031, "KOKUSAI ELECTRIC CO., LTD" },

10367 { 0x004032, "DIGITAL COMMUNICATIONS" },

10368 { 0x004033, "ADDTRON TECHNOLOGY CO., LTD." },

10369 { 0x004034, "BUSTEK CORPORATION" },

10370 { 0x004035, "OPCOM" },

10371 { 0x004036, "Minim Inc." },

10372 { 0x004037, "SEA-ILAN, INC." },

10373 { 0x004038, "TALENT ELECTRIC INCORPORATED" },

10374 { 0x004039, "OPTEC DAIICHI DENKO CO., LTD." },

10375 { 0x00403A, "IMPACT TECHNOLOGIES" },

10376 { 0x00403B, "SYNERJET INTERNATIONAL CORP." },

10377 { 0x00403C, "FORKS, INC." },

10378 { 0x00403D, "Teradata Corporation" },

10379 { 0x00403E, "RASTER OPS CORPORATION" },

10380 { 0x00403F, "SSANGYONG COMPUTER SYSTEMS" },

10381 { 0x004040, "RING ACCESS, INC." },

10382 { 0x004041, "FUJIKURA LTD." },

10383 { 0x004042, "N.A.T. GMBH" },

10384 { 0x004043, "Nokia Siemens Networks GmbH & Co. KG." },

10385 { 0x004044, "QNIX COMPUTER CO., LTD." },

10386 { 0x004045, "TWINHEAD CORPORATION" },

10387 { 0x004046, "UDC RESEARCH LIMITED" },

10388 { 0x004047, "WIND RIVER SYSTEMS" },

10389 { 0x004048, "SMD INFORMATICA S.A." },

10390 { 0x004049, "Roche Diagnostics International Ltd." },

10391 { 0x00404A, "WEST AUSTRALIAN DEPARTMENT" },

10392 { 0x00404B, "MAPLE COMPUTER SYSTEMS" },

10393 { 0x00404C, "HYPERTEC PTY LTD." },

10394 { 0x00404D, "TELECOMMUNICATIONS TECHNIQUES" },

10395 { 0x00404E, "FLUENT, INC." },

10396 { 0x00404F, "SPACE & NAVAL WARFARE SYSTEMS" },

10397 { 0x004050, "IRONICS, INCORPORATED" },

10398 { 0x004051, "Garbee and Garbee" },

10399 { 0x004052, "STAR TECHNOLOGIES, INC." },

10400 { 0x004053, "AMPRO COMPUTERS" },

10401 { 0x004054, "CONNECTION MACHINES SERVICES" },

10402 { 0x004055, "METRONIX GMBH" },

10403 { 0x004056, "MCM JAPAN LTD." },

10404 { 0x004057, "LOCKHEED - SANDERS" },

10405 { 0x004058, "UKG" },

10406 { 0x004059, "YOSHIDA KOGYO K. K." },

10407 { 0x00405A, "GOLDSTAR INFORMATION & COMM." },

10408 { 0x00405B, "FUNASSET LIMITED" },

10409 { 0x00405C, "FUTURE SYSTEMS, INC." },

10410 { 0x00405D, "STAR-TEK, INC." },

10411 { 0x00405E, "NORTH HILLS ISRAEL" },

10412 { 0x00405F, "AFE COMPUTERS LTD." },

10413 { 0x004060, "COMENDEC LTD" },

10414 { 0x004061, "DATATECH ENTERPRISES CO., LTD." },

10415 { 0x004062, "E-SYSTEMS, INC./GARLAND DIV." },

10416 { 0x004063, "VIA TECHNOLOGIES, INC." },

10417 { 0x004064, "KLA INSTRUMENTS CORPORATION" },

10418 { 0x004065, "GTE SPACENET" },

10419 { 0x004066, "APRESIA Systems Ltd" },

10420 { 0x004067, "OMNIBYTE CORPORATION" },

10421 { 0x004068, "EXTENDED SYSTEMS" },

10422 { 0x004069, "LEMCOM SYSTEMS, INC." },

10423 { 0x00406A, "KENTEK INFORMATION SYSTEMS,INC" },

10424 { 0x00406B, "SYSGEN" },

10425 { 0x00406C, "COPERNIQUE" },

10426 { 0x00406D, "LANCO, INC." },

10427 { 0x00406E, "COROLLARY, INC." },

10428 { 0x00406F, "SYNC RESEARCH INC." },

10429 { 0x004070, "INTERWARE CO., LTD." },

10430 { 0x004071, "ATM COMPUTER GMBH" },

10431 { 0x004072, "Applied Innovation Inc." },

10432 { 0x004073, "BASS ASSOCIATES" },

10433 { 0x004074, "CABLE AND WIRELESS" },

10434 { 0x004075, "Tattile SRL" },

10435 { 0x004076, "Sun Conversion Technologies" },

10436 { 0x004077, "MAXTON TECHNOLOGY CORPORATION" },

10437 { 0x004078, "WEARNES AUTOMATION PTE LTD" },

10438 { 0x004079, "JUKO MANUFACTURE COMPANY, LTD." },

10439 { 0x00407A, "SOCIETE D'EXPLOITATION DU CNIT" },

10440 { 0x00407B, "SCIENTIFIC ATLANTA" },

10441 { 0x00407C, "QUME CORPORATION" },

10442 { 0x00407D, "EXTENSION TECHNOLOGY CORP." },

10443 { 0x00407E, "EVERGREEN SYSTEMS, INC." },

10444 { 0x00407F, "FLIR Systems" },

10445 { 0x004080, "ATHENIX CORPORATION" },

10446 { 0x004081, "MANNESMANN SCANGRAPHIC GMBH" },

10447 { 0x004082, "LABORATORY EQUIPMENT CORP." },

10448 { 0x004083, "TDA INDUSTRIA DE PRODUTOS" },

10449 { 0x004084, "Honeywell" },

10450 { 0x004085, "SAAB INSTRUMENTS AB" },

10451 { 0x004086, "MICHELS & KLEBERHOFF COMPUTER" },

10452 { 0x004087, "UBITREX CORPORATION" },

10453 { 0x004088, "MOBIUS TECHNOLOGIES, INC." },

10454 { 0x004089, "MEIDENSHA CORPORATION" },

10455 { 0x00408A, "TPS TELEPROCESSING SYS. GMBH" },

10456 { 0x00408B, "RAYLAN CORPORATION" },

10457 { 0x00408C, "Axis Communications AB" },

10458 { 0x00408D, "THE GOODYEAR TIRE & RUBBER CO." },

10459 { 0x00408E, "Tattile SRL" },

10460 { 0x00408F, "WM-DATA MINFO AB" },

10461 { 0x004090, "ANSEL COMMUNICATIONS" },

10462 { 0x004091, "PROCOMP INDUSTRIA ELETRONICA" },

10463 { 0x004092, "ASP COMPUTER PRODUCTS, INC." },

10464 { 0x004093, "PAXDATA NETWORKS LTD." },

10465 { 0x004094, "SHOGRAPHICS, INC." },

10466 { 0x004095, "R.P.T. INTERGROUPS INT'L LTD." },

10467 { 0x004096, "Cisco Systems, Inc" },

10468 { 0x004097, "DATEX DIVISION OF" },

10469 { 0x004098, "DRESSLER GMBH & CO." },

10470 { 0x004099, "NEWGEN SYSTEMS CORP." },

10471 { 0x00409A, "NETWORK EXPRESS, INC." },

10472 { 0x00409B, "HAL COMPUTER SYSTEMS INC." },

10473 { 0x00409C, "TRANSWARE" },

10474 { 0x00409D, "DigiBoard" },

10475 { 0x00409E, "Concurrent Technologies Ltd." },

10476 { 0x00409F, "Telco Systems, Inc." },

10477 { 0x0040A0, "GOLDSTAR CO., LTD." },

10478 { 0x0040A1, "ERGO COMPUTING" },

10479 { 0x0040A2, "KINGSTAR TECHNOLOGY INC." },

10480 { 0x0040A3, "MICROUNITY SYSTEMS ENGINEERING" },

10481 { 0x0040A4, "ROSE ELECTRONICS" },

10482 { 0x0040A5, "CLINICOMP INTL." },

10483 { 0x0040A6, "Cray, Inc." },

10484 { 0x0040A7, "ITAUTEC PHILCO S.A." },

10485 { 0x0040A8, "IMF INTERNATIONAL LTD." },

10486 { 0x0040A9, "DATACOM INC." },

10487 { 0x0040AA, "Valmet Automation" },

10488 { 0x0040AB, "ROLAND DG CORPORATION" },

10489 { 0x0040AC, "SUPER WORKSTATION, INC." },

10490 { 0x0040AD, "SMA REGELSYSTEME GMBH" },

10491 { 0x0040AE, "DELTA CONTROLS, INC." },

10492 { 0x0040AF, "DIGITAL PRODUCTS, INC." },

10493 { 0x0040B0, "BYTEX CORPORATION, ENGINEERING" },

10494 { 0x0040B1, "CODONICS INC." },

10495 { 0x0040B2, "SYSTEMFORSCHUNG" },

10496 { 0x0040B3, "ParTech Inc." },

10497 { 0x0040B4, "NEXTCOM K.K." },

10498 { 0x0040B5, "VIDEO TECHNOLOGY COMPUTERS LTD" },

10499 { 0x0040B6, "COMPUTERM CORPORATION" },

10500 { 0x0040B7, "STEALTH COMPUTER SYSTEMS" },

10501 { 0x0040B8, "IDEA ASSOCIATES" },

10502 { 0x0040B9, "MACQ ELECTRONIQUE SA" },

10503 { 0x0040BA, "ALLIANT COMPUTER SYSTEMS CORP." },

10504 { 0x0040BB, "GOLDSTAR CABLE CO., LTD." },

10505 { 0x0040BC, "ALGORITHMICS LTD." },

10506 { 0x0040BD, "STARLIGHT NETWORKS, INC." },

10507 { 0x0040BE, "BOEING DEFENSE & SPACE" },

10508 { 0x0040BF, "CHANNEL SYSTEMS INTERN'L INC." },

10509 { 0x0040C0, "VISTA CONTROLS CORPORATION" },

10510 { 0x0040C1, "BIZERBA-WERKE WILHEIM KRAUT" },

10511 { 0x0040C2, "APPLIED COMPUTING DEVICES" },

10512 { 0x0040C3, "FISCHER AND PORTER CO." },

10513 { 0x0040C4, "KINKEI SYSTEM CORPORATION" },

10514 { 0x0040C5, "MICOM COMMUNICATIONS INC." },

10515 { 0x0040C6, "FIBERNET RESEARCH, INC." },

10516 { 0x0040C7, "RUBY TECH CORPORATION" },

10517 { 0x0040C8, "MILAN TECHNOLOGY CORPORATION" },

10518 { 0x0040C9, "NCUBE" },

10519 { 0x0040CA, "FIRST INTERNAT'L COMPUTER, INC" },

10520 { 0x0040CB, "LANWAN TECHNOLOGIES" },

10521 { 0x0040CC, "SILCOM MANUF'G TECHNOLOGY INC." },

10522 { 0x0040CD, "TERA MICROSYSTEMS, INC." },

10523 { 0x0040CE, "NET-SOURCE, INC." },

10524 { 0x0040CF, "STRAWBERRY TREE, INC." },

10525 { 0x0040D0, "MITAC INTERNATIONAL CORP." },

10526 { 0x0040D1, "FUKUDA DENSHI CO., LTD." },

10527 { 0x0040D2, "PAGINE CORPORATION" },

10528 { 0x0040D3, "KIMPSION INTERNATIONAL CORP." },

10529 { 0x0040D4, "GAGE TALKER CORP." },

10530 { 0x0040D5, "Sartorius Mechatronics T&H GmbH" },

10531 { 0x0040D6, "LOCAMATION B.V." },

10532 { 0x0040D7, "STUDIO GEN INC." },

10533 { 0x0040D8, "OCEAN OFFICE AUTOMATION LTD." },

10534 { 0x0040D9, "AMERICAN MEGATRENDS INC." },

10535 { 0x0040DA, "TELSPEC LTD" },

10536 { 0x0040DB, "ADVANCED TECHNICAL SOLUTIONS" },

10537 { 0x0040DC, "TRITEC ELECTRONIC GMBH" },

10538 { 0x0040DD, "HONG TECHNOLOGIES" },

10539 { 0x0040DE, "Elsag Datamat spa" },

10540 { 0x0040DF, "DIGALOG SYSTEMS, INC." },

10541 { 0x0040E0, "ATOMWIDE LTD." },

10542 { 0x0040E1, "MARNER INTERNATIONAL, INC." },

10543 { 0x0040E2, "MESA RIDGE TECHNOLOGIES, INC." },

10544 { 0x0040E3, "QUIN SYSTEMS LTD" },

10545 { 0x0040E4, "E-M TECHNOLOGY, INC." },

10546 { 0x0040E5, "SYBUS CORPORATION" },

10547 { 0x0040E6, "C.A.E.N." },

10548 { 0x0040E7, "ARNOS INSTRUMENTS & COMPUTER" },

10549 { 0x0040E8, "CHARLES RIVER DATA SYSTEMS,INC" },

10550 { 0x0040E9, "ACCORD SYSTEMS, INC." },

10551 { 0x0040EA, "PLAIN TREE SYSTEMS INC" },

10552 { 0x0040EB, "MARTIN MARIETTA CORPORATION" },

10553 { 0x0040EC, "MIKASA SYSTEM ENGINEERING" },

10554 { 0x0040ED, "NETWORK CONTROLS INT'NATL INC." },

10555 { 0x0040EE, "OPTIMEM" },

10556 { 0x0040EF, "HYPERCOM, INC." },

10557 { 0x0040F0, "MicroBrain,Inc." },

10558 { 0x0040F1, "CHUO ELECTRONICS CO., LTD." },

10559 { 0x0040F2, "JANICH & KLASS COMPUTERTECHNIK" },

10560 { 0x0040F3, "NETCOR" },

10561 { 0x0040F4, "CAMEO COMMUNICATIONS, INC." },

10562 { 0x0040F5, "OEM ENGINES" },

10563 { 0x0040F6, "KATRON COMPUTERS INC." },

10564 { 0x0040F7, "Polaroid Corporation" },

10565 { 0x0040F8, "SYSTEMHAUS DISCOM" },

10566 { 0x0040F9, "COMBINET" },

10567 { 0x0040FA, "MICROBOARDS, INC." },

10568 { 0x0040FB, "CASCADE COMMUNICATIONS" },

10569 { 0x0040FC, "IBR COMPUTER TECHNIK GMBH" },

10570 { 0x0040FD, "LXE" },

10571 { 0x0040FE, "SYMPLEX COMMUNICATIONS" },

10572 { 0x0040FF, "TELEBIT CORPORATION" },

10573 { 0x00410E, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

10574 { 0x0041B4, "Wuxi Zhongxing Optoelectronics Technology Co.,Ltd." },

10575 { 0x0041D2, "Cisco Systems, Inc" },

10576 { 0x004238, "Intel Corporate" },

10577 { 0x004252, "RLX Technologies" },

10578 { 0x00425A, "Cisco Systems, Inc" },

10579 { 0x004268, "Cisco Systems, Inc" },

10580 { 0x004279, "Sunitec Enterprise Co.,Ltd" },

10581 { 0x0043FF, "KETRON S.R.L." },

10582 { 0x004501, "Midmark RTLS" },

10583 { 0x00451D, "Cisco Systems, Inc" },

10584 { 0x0045E2, "CyberTAN Technology Inc." },

10585 { 0x00464B, "HUAWEI TECHNOLOGIES CO.,LTD" },

10586 { 0x004A77, "zte corporation" },

10587 { 0x004BF3, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

10588 { 0x004CE5, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

10589 { 0x004D32, "Andon Health Co.,Ltd." },

10590 { 0x004E01, "Dell Inc." },

10591 { 0x004E35, "Hewlett Packard Enterprise" },

10592 { 0x004F1A, "HUAWEI TECHNOLOGIES CO.,LTD" },

10593 { 0x005000, "NEXO COMMUNICATIONS, INC." },

10594 { 0x005001, "YAMASHITA SYSTEMS CORP." },

10595 { 0x005002, "OMNISEC AG" },

10596 { 0x005003, "Xrite Inc" },

10597 { 0x005004, "3COM" },

10598 { 0x005006, "TAC AB" },

10599 { 0x005007, "SIEMENS TELECOMMUNICATION SYSTEMS LIMITED" },

10600 { 0x005008, "TIVA MICROCOMPUTER CORP. (TMC)" },

10601 { 0x005009, "PHILIPS BROADBAND NETWORKS" },

10602 { 0x00500A, "IRIS TECHNOLOGIES, INC." },

10603 { 0x00500B, "Cisco Systems, Inc" },

10604 { 0x00500C, "e-Tek Labs, Inc." },

10605 { 0x00500D, "SATORI ELECTORIC CO., LTD." },

10606 { 0x00500E, "CHROMATIS NETWORKS, INC." },

10607 { 0x00500F, "Cisco Systems, Inc" },

10608 { 0x005010, "NovaNET Learning, Inc." },

10609 { 0x005012, "CBL - GMBH" },

10610 { 0x005013, "Seagate Cloud Systems Inc" },

10611 { 0x005014, "Cisco Systems, Inc" },

10612 { 0x005015, "BRIGHT STAR ENGINEERING" },

10613 { 0x005016, "Molex Canada Ltd" },

10614 { 0x005017, "RSR S.R.L." },

10615 { 0x005018, "AMIT, Inc." },

10616 { 0x005019, "SPRING TIDE NETWORKS, INC." },

10617 { 0x00501A, "IQinVision" },

10618 { 0x00501B, "ABL CANADA, INC." },

10619 { 0x00501C, "JATOM SYSTEMS, INC." },

10620 { 0x00501E, "Grass Valley, A Belden Brand" },

10621 { 0x00501F, "MRG SYSTEMS, LTD." },

10622 { 0x005020, "MEDIASTAR CO., LTD." },

10623 { 0x005021, "EIS INTERNATIONAL, INC." },

10624 { 0x005022, "ZONET TECHNOLOGY, INC." },

10625 { 0x005023, "PG DESIGN ELECTRONICS, INC." },

10626 { 0x005024, "NAVIC SYSTEMS, INC." },

10627 { 0x005026, "COSYSTEMS, INC." },

10628 { 0x005027, "GENICOM CORPORATION" },

10629 { 0x005028, "AVAL COMMUNICATIONS" },

10630 { 0x005029, "1394 PRINTER WORKING GROUP" },

10631 { 0x00502A, "Cisco Systems, Inc" },

10632 { 0x00502B, "GENRAD LTD." },

10633 { 0x00502C, "SOYO COMPUTER, INC." },

10634 { 0x00502D, "ACCEL, INC." },

10635 { 0x00502E, "CAMBEX CORPORATION" },

10636 { 0x00502F, "TollBridge Technologies, Inc." },

10637 { 0x005030, "FUTURE PLUS SYSTEMS" },

10638 { 0x005031, "AEROFLEX LABORATORIES, INC." },

10639 { 0x005032, "PICAZO COMMUNICATIONS, INC." },

10640 { 0x005033, "MAYAN NETWORKS" },

10641 { 0x005036, "NETCAM, LTD." },

10642 { 0x005037, "KOGA ELECTRONICS CO." },

10643 { 0x005038, "DAIN TELECOM CO., LTD." },

10644 { 0x005039, "MARINER NETWORKS" },

10645 { 0x00503A, "DATONG ELECTRONICS LTD." },

10646 { 0x00503B, "MEDIAFIRE CORPORATION" },

10647 { 0x00503C, "TSINGHUA NOVEL ELECTRONICS" },

10648 { 0x00503E, "Cisco Systems, Inc" },

10649 { 0x00503F, "ANCHOR GAMES" },

10650 { 0x005040, "Panasonic Electric Works Co., Ltd." },

10651 { 0x005041, "Coretronic Corporation" },

10652 { 0x005042, "SCI MANUFACTURING SINGAPORE PTE, LTD." },

10653 { 0x005043, "MARVELL SEMICONDUCTOR, INC." },

10654 { 0x005044, "ASACA CORPORATION" },

10655 { 0x005045, "RIOWORKS SOLUTIONS, INC." },

10656 { 0x005046, "MENICX INTERNATIONAL CO., LTD." },

10657 { 0x005047, "Private" },

10658 { 0x005048, "INFOLIBRIA" },

10659 { 0x005049, "Arbor Networks Inc" },

10660 { 0x00504A, "ELTECO A.S." },

10661 { 0x00504B, "BARCONET N.V." },

10662 { 0x00504C, "Galil Motion Control" },

10663 { 0x00504D, "Tokyo Electron Device Limited" },

10664 { 0x00504E, "SIERRA MONITOR CORP." },

10665 { 0x00504F, "OLENCOM ELECTRONICS" },

10666 { 0x005050, "Cisco Systems, Inc" },

10667 { 0x005051, "IWATSU ELECTRIC CO., LTD." },

10668 { 0x005052, "TIARA NETWORKS, INC." },

10669 { 0x005053, "Cisco Systems, Inc" },

10670 { 0x005054, "Cisco Systems, Inc" },

10671 { 0x005055, "DOMS A/S" },

10672 { 0x005056, "VMware, Inc." },

10673 { 0x005057, "BROADBAND ACCESS SYSTEMS" },

10674 { 0x005058, "Sangoma Technologies" },

10675 { 0x005059, "iBAHN" },

10676 { 0x00505A, "NETWORK ALCHEMY, INC." },

10677 { 0x00505B, "KAWASAKI LSI U.S.A., INC." },

10678 { 0x00505C, "TUNDO CORPORATION" },

10679 { 0x00505E, "DIGITEK MICROLOGIC S.A." },

10680 { 0x00505F, "BRAND INNOVATORS" },

10681 { 0x005060, "TANDBERG TELECOM AS" },

10682 { 0x005062, "KOUWELL ELECTRONICS CORP. **" },

10683 { 0x005063, "OY COMSEL SYSTEM AB" },

10684 { 0x005064, "CAE ELECTRONICS" },

10685 { 0x005065, "TDK-Lambda Corporation" },

10686 { 0x005066, "AtecoM GmbH advanced telecomunication modules" },

10687 { 0x005067, "AEROCOMM, INC." },

10688 { 0x005068, "ELECTRONIC INDUSTRIES ASSOCIATION" },

10689 { 0x005069, "PixStream Incorporated" },

10690 { 0x00506A, "EDEVA, INC." },

10691 { 0x00506B, "SPX-ATEG" },

10692 { 0x00506C, "Beijer Electronics Products AB" },

10693 { 0x00506D, "VIDEOJET SYSTEMS" },

10694 { 0x00506E, "CORDER ENGINEERING CORPORATION" },

10695 { 0x00506F, "G-CONNECT" },

10696 { 0x005070, "CHAINTECH COMPUTER CO., LTD." },

10697 { 0x005071, "AIWA CO., LTD." },

10698 { 0x005072, "CORVIS CORPORATION" },

10699 { 0x005073, "Cisco Systems, Inc" },

10700 { 0x005074, "ADVANCED HI-TECH CORP." },

10701 { 0x005075, "KESTREL SOLUTIONS" },

10702 { 0x005076, "IBM Corp" },

10703 { 0x005077, "PROLIFIC TECHNOLOGY, INC." },

10704 { 0x005078, "MEGATON HOUSE, LTD." },

10705 { 0x005079, "Private" },

10706 { 0x00507A, "XPEED, INC." },

10707 { 0x00507B, "MERLOT COMMUNICATIONS" },

10708 { 0x00507C, "VIDEOCON AG" },

10709 { 0x00507D, "IFP" },

10710 { 0x00507E, "NEWER TECHNOLOGY" },

10711 { 0x00507F, "DrayTek Corp." },

10712 { 0x005080, "Cisco Systems, Inc" },

10713 { 0x005081, "MURATA MACHINERY, LTD." },

10714 { 0x005082, "FORESSON CORPORATION" },

10715 { 0x005083, "GILBARCO, INC." },

10716 { 0x005084, "Quantum Corp." },

10717 { 0x005086, "TELKOM SA, LTD." },

10718 { 0x005087, "TERASAKI ELECTRIC CO., LTD." },

10719 { 0x005088, "AMANO CORPORATION" },

10720 { 0x005089, "SAFETY MANAGEMENT SYSTEMS" },

10721 { 0x00508B, "Hewlett Packard" },

10722 { 0x00508C, "RSI SYSTEMS" },

10723 { 0x00508D, "ABIT COMPUTER CORPORATION" },

10724 { 0x00508E, "OPTIMATION, INC." },

10725 { 0x00508F, "ASITA TECHNOLOGIES INT'L LTD." },

10726 { 0x005090, "DCTRI" },

10727 { 0x005091, "NETACCESS, INC." },

10728 { 0x005092, "Rigaku Corporation Osaka Plant" },

10729 { 0x005093, "BOEING" },

10730 { 0x005094, "ARRIS Group, Inc." },

10731 { 0x005095, "PERACOM NETWORKS" },

10732 { 0x005096, "SALIX TECHNOLOGIES, INC." },

10733 { 0x005097, "MMC-EMBEDDED COMPUTERTECHNIK GmbH" },

10734 { 0x005098, "GLOBALOOP, LTD." },

10735 { 0x005099, "3COM EUROPE LTD" },

10736 { 0x00509A, "TAG ELECTRONIC SYSTEMS" },

10737 { 0x00509B, "SWITCHCORE AB" },

10738 { 0x00509C, "BETA RESEARCH" },

10739 { 0x00509D, "THE INDUSTREE B.V." },

10740 { 0x00509E, "Les Technologies SoftAcoustik Inc." },

10741 { 0x00509F, "HORIZON COMPUTER" },

10742 { 0x0050A0, "DELTA COMPUTER SYSTEMS, INC." },

10743 { 0x0050A1, "CARLO GAVAZZI, INC." },

10744 { 0x0050A2, "Cisco Systems, Inc" },

10745 { 0x0050A3, "TransMedia Communications, Inc." },

10746 { 0x0050A4, "IO TECH, INC." },

10747 { 0x0050A5, "CAPITOL BUSINESS SYSTEMS, LTD." },

10748 { 0x0050A6, "OPTRONICS" },

10749 { 0x0050A7, "Cisco Systems, Inc" },

10750 { 0x0050A8, "OpenCon Systems, Inc." },

10751 { 0x0050A9, "MOLDAT WIRELESS TECHNOLGIES" },

10752 { 0x0050AA, "KONICA MINOLTA HOLDINGS, INC." },

10753 { 0x0050AB, "NALTEC, Inc." },

10754 { 0x0050AC, "MAPLE COMPUTER CORPORATION" },

10755 { 0x0050AD, "CommUnique Wireless Corp." },

10756 { 0x0050AE, "FDK Co., Ltd" },

10757 { 0x0050AF, "INTERGON, INC." },

10758 { 0x0050B0, "TECHNOLOGY ATLANTA CORPORATION" },

10759 { 0x0050B1, "GIDDINGS & LEWIS" },

10760 { 0x0050B2, "BRODEL GmbH" },

10761 { 0x0050B3, "VOICEBOARD CORPORATION" },

10762 { 0x0050B4, "SATCHWELL CONTROL SYSTEMS, LTD" },

10763 { 0x0050B5, "FICHET SECURITE ELECTRONIQUE" },

10764 { 0x0050B6, "GOOD WAY IND. CO., LTD." },

10765 { 0x0050B7, "BOSER TECHNOLOGY CO., LTD." },

10766 { 0x0050B8, "INOVA COMPUTERS GMBH & CO. KG" },

10767 { 0x0050B9, "XITRON TECHNOLOGIES, INC." },

10768 { 0x0050BA, "D-Link Corporation" },

10769 { 0x0050BB, "CMS TECHNOLOGIES" },

10770 { 0x0050BC, "HAMMER STORAGE SOLUTIONS" },

10771 { 0x0050BD, "Cisco Systems, Inc" },

10772 { 0x0050BE, "FAST MULTIMEDIA AG" },

10773 { 0x0050BF, "Metalligence Technology Corp." },

10774 { 0x0050C0, "GATAN, INC." },

10775 { 0x0050C1, "GEMFLEX NETWORKS, LTD." },

10776 { 0x0050C2, "IEEE Registration Authority" },

10777 { 0x0050C4, "IMD" },

10778 { 0x0050C5, "ADS Technologies, Inc" },

10779 { 0x0050C6, "LOOP TELECOMMUNICATION INTERNATIONAL, INC." },

10780 { 0x0050C7, "Private" },

10781 { 0x0050C8, "Addonics Technologies, Inc." },

10782 { 0x0050C9, "MASPRO DENKOH CORP." },

10783 { 0x0050CA, "DZS Inc." },

10784 { 0x0050CB, "Bucher Automation AG" },

10785 { 0x0050CC, "Seagate Cloud Systems Inc" },

10786 { 0x0050CD, "DIGIANSWER A/S" },

10787 { 0x0050CE, "LG INTERNATIONAL CORP." },

10788 { 0x0050CF, "VANLINK COMMUNICATION TECHNOLOGY RESEARCH INSTITUTE" },

10789 { 0x0050D0, "MINERVA SYSTEMS" },

10790 { 0x0050D1, "Cisco Systems, Inc" },

10791 { 0x0050D2, "CMC Electronics Inc" },

10792 { 0x0050D3, "DIGITAL AUDIO PROCESSING PTY. LTD." },

10793 { 0x0050D4, "JOOHONG INFORMATION &" },

10794 { 0x0050D5, "AD SYSTEMS CORP." },

10795 { 0x0050D6, "ATLAS COPCO TOOLS AB" },

10796 { 0x0050D7, "TELSTRAT" },

10797 { 0x0050D8, "UNICORN COMPUTER CORP." },

10798 { 0x0050D9, "ENGETRON-ENGENHARIA ELETRONICA IND. e COM. LTDA" },

10799 { 0x0050DA, "3COM" },

10800 { 0x0050DB, "CONTEMPORARY CONTROL" },

10801 { 0x0050DC, "TAS TELEFONBAU A. SCHWABE GMBH & CO. KG" },

10802 { 0x0050DD, "SERRA SOLDADURA, S.A." },

10803 { 0x0050DE, "SIGNUM SYSTEMS CORP." },

10804 { 0x0050DF, "AirFiber, Inc." },

10805 { 0x0050E1, "NS TECH ELECTRONICS SDN BHD" },

10806 { 0x0050E2, "Cisco Systems, Inc" },

10807 { 0x0050E3, "ARRIS Group, Inc." },

10808 { 0x0050E4, "Apple, Inc." },

10809 { 0x0050E6, "HAKUSAN CORPORATION" },

10810 { 0x0050E7, "PARADISE INNOVATIONS (ASIA)" },

10811 { 0x0050E8, "Nomadix, Inc" },

10812 { 0x0050EA, "XEL COMMUNICATIONS, INC." },

10813 { 0x0050EB, "ALPHA-TOP CORPORATION" },

10814 { 0x0050EC, "OLICOM A/S" },

10815 { 0x0050ED, "ANDA NETWORKS" },

10816 { 0x0050EE, "TEK DIGITEL CORPORATION" },

10817 { 0x0050EF, "SPE Systemhaus GmbH" },

10818 { 0x0050F0, "Cisco Systems, Inc" },

10819 { 0x0050F1, "Maxlinear, Inc" },

10820 { 0x0050F2, "MICROSOFT CORP." },

10821 { 0x0050F3, "GLOBAL NET INFORMATION CO., Ltd." },

10822 { 0x0050F4, "SIGMATEK GMBH & CO. KG" },

10823 { 0x0050F6, "PAN-INTERNATIONAL INDUSTRIAL CORP." },

10824 { 0x0050F7, "VENTURE MANUFACTURING (SINGAPORE) LTD." },

10825 { 0x0050F8, "ENTREGA TECHNOLOGIES, INC." },

10826 { 0x0050F9, "Sensormatic Electronics LLC" },

10827 { 0x0050FA, "OXTEL, LTD." },

10828 { 0x0050FB, "VSK ELECTRONICS" },

10829 { 0x0050FC, "Edimax Technology Co. Ltd." },

10830 { 0x0050FD, "VISIONCOMM CO., LTD." },

10831 { 0x0050FE, "PCTVnet ASA" },

10832 { 0x0050FF, "HAKKO ELECTRONICS CO., LTD." },

10833 { 0x0051ED, "LG Innotek" },

10834 { 0x005218, "Wuxi Keboda Electron Co.Ltd" },

10835 { 0x0052C2, "peiker acustic GmbH" },

10836 { 0x0052C8, "Made Studio Design Ltd." },

10837 { 0x00549F, "Avaya Inc" },

10838 { 0x0054AF, "Continental Automotive Systems Inc." },

10839 { 0x0054BD, "Swelaser AB" },

10840 { 0x0055B1, "Shanghai Baud Data Communication Co.,Ltd." },

10841 { 0x0055DA, "IEEE Registration Authority" },

10842 { 0x00562B, "Cisco Systems, Inc" },

10843 { 0x00566D, "Huawei Device Co., Ltd." },

10844 { 0x0056CD, "Apple, Inc." },

10845 { 0x0057C1, "LG Electronics (Mobile Communications)" },

10846 { 0x0057D2, "Cisco Systems, Inc" },

10847 { 0x005828, "Axon Networks Inc." },

10848 { 0x00583F, "PC Aquarius" },

10849 { 0x005907, "LenovoEMC Products USA, LLC" },

10850 { 0x005979, "Networked Energy Services" },

10851 { 0x0059AC, "KPN. B.V." },

10852 { 0x0059DC, "Cisco Systems, Inc" },

10853 { 0x005A13, "HUAWEI TECHNOLOGIES CO.,LTD" },

10854 { 0x005A39, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

10855 { 0x005B94, "Apple, Inc." },

10856 { 0x005BA1, "shanghai huayuan chuangxin software CO., LTD." },

10857 { 0x005C86, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

10858 { 0x005CB1, "Gospell DIGITAL TECHNOLOGY CO., LTD" },

10859 { 0x005CC2, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

10860 { 0x005D03, "Xilinx, Inc" },

10861 { 0x005D73, "Cisco Systems, Inc" },

10862 { 0x005E0C, "HMD Global Oy" },

10863 { 0x005F67, "TP-Link Corporation Limited" },

10864 { 0x005F86, "Cisco Systems, Inc" },

10865 { 0x005FBF, "Toshiba Corp." },

10866 { 0x006000, "XYCOM INC." },

10867 { 0x006001, "InnoSys, Inc." },

10868 { 0x006002, "SCREEN SUBTITLING SYSTEMS, LTD" },

10869 { 0x006003, "TERAOKA WEIGH SYSTEM PTE, LTD." },

10870 { 0x006004, "COMPUTADORES MODULARES SA" },

10871 { 0x006005, "Touchstar ATC Limited" },

10872 { 0x006006, "SOTEC CO., LTD" },

10873 { 0x006007, "ACRES GAMING, INC." },

10874 { 0x006008, "3COM" },

10875 { 0x006009, "Cisco Systems, Inc" },

10876 { 0x00600A, "SORD COMPUTER CORPORATION" },

10877 { 0x00600B, "LOGWARE GmbH" },

10878 { 0x00600C, "Eurotech Inc." },

10879 { 0x00600D, "Digital Logic GmbH" },

10880 { 0x00600E, "WAVENET INTERNATIONAL, INC." },

10881 { 0x00600F, "Westell Technologies Inc." },

10882 { 0x006010, "NETWORK MACHINES, INC." },

10883 { 0x006011, "CRYSTAL SEMICONDUCTOR CORP." },

10884 { 0x006012, "POWER COMPUTING CORPORATION" },

10885 { 0x006013, "NETSTAL MASCHINEN AG" },

10886 { 0x006014, "EDEC CO., LTD." },

10887 { 0x006015, "NET2NET CORPORATION" },

10888 { 0x006016, "CLARIION" },

10889 { 0x006017, "TOKIMEC INC." },

10890 { 0x006018, "STELLAR ONE CORPORATION" },

10891 { 0x006019, "Roche Diagnostics" },

10892 { 0x00601A, "KEITHLEY INSTRUMENTS" },

10893 { 0x00601B, "MESA ELECTRONICS" },

10894 { 0x00601C, "TELXON CORPORATION" },

10895 { 0x00601D, "LUCENT TECHNOLOGIES" },

10896 { 0x00601E, "SOFTLAB, INC." },

10897 { 0x00601F, "STALLION TECHNOLOGIES" },

10898 { 0x006020, "PIVOTAL NETWORKING, INC." },

10899 { 0x006021, "DSC CORPORATION" },

10900 { 0x006022, "VICOM SYSTEMS, INC." },

10901 { 0x006023, "PERICOM SEMICONDUCTOR CORP." },

10902 { 0x006024, "GRADIENT TECHNOLOGIES, INC." },

10903 { 0x006025, "ACTIVE IMAGING PLC" },

10904 { 0x006026, "VIKING Modular Solutions" },

10905 { 0x006027, "Superior Modular Products" },

10906 { 0x006028, "MACROVISION CORPORATION" },

10907 { 0x006029, "CARY PERIPHERALS INC." },

10908 { 0x00602A, "SYMICRON COMPUTER COMMUNICATIONS, LTD." },

10909 { 0x00602B, "PEAK AUDIO" },

10910 { 0x00602C, "LINX Data Terminals, Inc." },

10911 { 0x00602D, "ALERTON TECHNOLOGIES, INC." },

10912 { 0x00602E, "CYCLADES CORPORATION" },

10913 { 0x00602F, "Cisco Systems, Inc" },

10914 { 0x006030, "VILLAGE TRONIC ENTWICKLUNG" },

10915 { 0x006031, "HRK SYSTEMS" },

10916 { 0x006032, "I-CUBE, INC." },

10917 { 0x006033, "ACUITY IMAGING, INC." },

10918 { 0x006034, "ROBERT BOSCH GmbH" },

10919 { 0x006035, "DALLAS SEMICONDUCTOR, INC." },

10920 { 0x006036, "AIT Austrian Institute of Technology GmbH" },

10921 { 0x006037, "NXP Semiconductors" },

10922 { 0x006038, "Nortel Networks" },

10923 { 0x006039, "SanCom Technology, Inc." },

10924 { 0x00603A, "QUICK CONTROLS LTD." },

10925 { 0x00603B, "AMTEC spa" },

10926 { 0x00603C, "HAGIWARA SYS-COM CO., LTD." },

10927 { 0x00603D, "3CX" },

10928 { 0x00603E, "Cisco Systems, Inc" },

10929 { 0x00603F, "PATAPSCO DESIGNS" },

10930 { 0x006040, "NETRO CORP." },

10931 { 0x006041, "Yokogawa Digital Computer Corporation" },

10932 { 0x006042, "TKS (USA), INC." },

10933 { 0x006043, "iDirect, INC." },

10934 { 0x006044, "LITTON/POLY-SCIENTIFIC" },

10935 { 0x006045, "PATHLIGHT TECHNOLOGIES" },

10936 { 0x006046, "VMETRO, INC." },

10937 { 0x006047, "Cisco Systems, Inc" },

10938 { 0x006048, "Dell EMC" },

10939 { 0x006049, "VINA TECHNOLOGIES" },

10940 { 0x00604A, "SAIC IDEAS GROUP" },

10941 { 0x00604B, "Safe-com GmbH & Co. KG" },

10942 { 0x00604C, "Sagemcom Broadband SAS" },

10943 { 0x00604D, "MMC NETWORKS, INC." },

10944 { 0x00604E, "CYCLE COMPUTER CORPORATION, INC." },

10945 { 0x00604F, "Tattile SRL" },

10946 { 0x006050, "INTERNIX INC." },

10947 { 0x006051, "QUALITY SEMICONDUCTOR" },

10948 { 0x006052, "PERIPHERALS ENTERPRISE CO., Ltd." },

10949 { 0x006053, "TOYODA MACHINE WORKS, LTD." },

10950 { 0x006054, "CONTROLWARE GMBH" },

10951 { 0x006055, "CORNELL UNIVERSITY" },

10952 { 0x006056, "NETWORK TOOLS, INC." },

10953 { 0x006057, "Murata Manufacturing Co., Ltd." },

10954 { 0x006058, "COPPER MOUNTAIN COMMUNICATIONS, INC." },

10955 { 0x006059, "TECHNICAL COMMUNICATIONS CORP." },

10956 { 0x00605A, "CELCORE, INC." },

10957 { 0x00605B, "IntraServer Technology, Inc." },

10958 { 0x00605C, "Cisco Systems, Inc" },

10959 { 0x00605D, "SCANIVALVE CORP." },

10960 { 0x00605E, "LIBERTY TECHNOLOGY NETWORKING" },

10961 { 0x00605F, "NIPPON UNISOFT CORPORATION" },

10962 { 0x006060, "Data Innovations North America" },

10963 { 0x006061, "WHISTLE COMMUNICATIONS CORP." },

10964 { 0x006062, "TELESYNC, INC." },

10965 { 0x006063, "PSION DACOM PLC." },

10966 { 0x006064, "NETCOMM LIMITED" },

10967 { 0x006065, "B&R Industrial Automation GmbH" },

10968 { 0x006066, "LACROIX Trafic" },

10969 { 0x006067, "ACER NETXUS INC." },

10970 { 0x006068, "Dialogic Corporation" },

10971 { 0x006069, "Brocade Communications Systems LLC" },

10972 { 0x00606A, "MITSUBISHI WIRELESS COMMUNICATIONS. INC." },

10973 { 0x00606B, "Synclayer Inc." },

10974 { 0x00606C, "ARESCOM" },

10975 { 0x00606D, "DIGITAL EQUIPMENT CORP." },

10976 { 0x00606E, "DAVICOM SEMICONDUCTOR, INC." },

10977 { 0x00606F, "CLARION CORPORATION OF AMERICA" },

10978 { 0x006070, "Cisco Systems, Inc" },

10979 { 0x006071, "MIDAS LAB, INC." },

10980 { 0x006072, "VXL INSTRUMENTS, LIMITED" },

10981 { 0x006073, "REDCREEK COMMUNICATIONS, INC." },

10982 { 0x006074, "QSC LLC" },

10983 { 0x006075, "PENTEK, INC." },

10984 { 0x006076, "SCHLUMBERGER TECHNOLOGIES RETAIL PETROLEUM SYSTEMS" },

10985 { 0x006077, "PRISA NETWORKS" },

10986 { 0x006078, "POWER MEASUREMENT LTD." },

10987 { 0x006079, "Mainstream Data, Inc." },

10988 { 0x00607A, "DVS GMBH" },

10989 { 0x00607B, "FORE SYSTEMS, INC." },

10990 { 0x00607C, "WaveAccess, Ltd." },

10991 { 0x00607D, "SENTIENT NETWORKS INC." },

10992 { 0x00607E, "GIGALABS, INC." },

10993 { 0x00607F, "AURORA TECHNOLOGIES, INC." },

10994 { 0x006080, "MICROTRONIX DATACOM LTD." },

10995 { 0x006081, "TV/COM INTERNATIONAL" },

10996 { 0x006082, "NOVALINK TECHNOLOGIES, INC." },

10997 { 0x006083, "Cisco Systems, Inc" },

10998 { 0x006084, "DIGITAL VIDEO" },

10999 { 0x006085, "Storage Concepts" },

11000 { 0x006086, "LOGIC REPLACEMENT TECH. LTD." },

11001 { 0x006087, "KANSAI ELECTRIC CO., LTD." },

11002 { 0x006088, "Analog Devices, Inc." },

11003 { 0x006089, "XATA" },

11004 { 0x00608A, "CITADEL COMPUTER" },

11005 { 0x00608B, "ConferTech International" },

11006 { 0x00608C, "3COM" },

11007 { 0x00608D, "UNIPULSE CORP." },

11008 { 0x00608E, "HE ELECTRONICS, TECHNOLOGIE & SYSTEMTECHNIK GmbH" },

11009 { 0x00608F, "TEKRAM TECHNOLOGY CO., LTD." },

11010 { 0x006090, "Artiza Networks Inc" },

11011 { 0x006091, "FIRST PACIFIC NETWORKS, INC." },

11012 { 0x006092, "MICRO/SYS, INC." },

11013 { 0x006093, "VARIAN" },

11014 { 0x006094, "IBM Corp" },

11015 { 0x006095, "ACCU-TIME SYSTEMS, INC." },

11016 { 0x006096, "T.S. MICROTECH INC." },

11017 { 0x006097, "3COM" },

11018 { 0x006098, "HT COMMUNICATIONS" },

11019 { 0x006099, "SBE, Inc." },

11020 { 0x00609A, "NJK TECHNO CO." },

11021 { 0x00609B, "AstroNova, Inc" },

11022 { 0x00609C, "Perkin-Elmer Incorporated" },

11023 { 0x00609D, "PMI FOOD EQUIPMENT GROUP" },

11024 { 0x00609E, "ASC X3 - INFORMATION TECHNOLOGY STANDARDS SECRETARIATS" },

11025 { 0x00609F, "PHAST CORPORATION" },

11026 { 0x0060A0, "SWITCHED NETWORK TECHNOLOGIES, INC." },

11027 { 0x0060A1, "VPNet, Inc." },

11028 { 0x0060A2, "NIHON UNISYS LIMITED CO." },

11029 { 0x0060A3, "CONTINUUM TECHNOLOGY CORP." },

11030 { 0x0060A4, "GEW Technologies (PTY)Ltd" },

11031 { 0x0060A5, "PERFORMANCE TELECOM CORP." },

11032 { 0x0060A6, "PARTICLE MEASURING SYSTEMS" },

11033 { 0x0060A7, "MICROSENS GmbH & CO. KG" },

11034 { 0x0060A8, "TIDOMAT AB" },

11035 { 0x0060A9, "GESYTEC MBH" },

11036 { 0x0060AA, "INTELLIGENT DEVICES INC. (IDI)" },

11037 { 0x0060AB, "LARSCOM INCORPORATED" },

11038 { 0x0060AC, "RESILIENCE CORPORATION" },

11039 { 0x0060AD, "MegaChips Corporation" },

11040 { 0x0060AE, "TRIO INFORMATION SYSTEMS AB" },

11041 { 0x0060AF, "PACIFIC MICRO DATA, INC." },

11042 { 0x0060B0, "Hewlett Packard" },

11043 { 0x0060B1, "Input/Output, Inc." },

11044 { 0x0060B2, "PROCESS CONTROL CORP." },

11045 { 0x0060B3, "Z-COM, INC." },

11046 { 0x0060B4, "GLENAYRE R&D INC." },

11047 { 0x0060B5, "KEBA GmbH" },

11048 { 0x0060B6, "LAND COMPUTER CO., LTD." },

11049 { 0x0060B7, "CHANNELMATIC, INC." },

11050 { 0x0060B8, "CORELIS Inc." },

11051 { 0x0060B9, "NEC Platforms, Ltd" },

11052 { 0x0060BA, "SAHARA NETWORKS, INC." },

11053 { 0x0060BB, "Cabletron Systems, Inc." },

11054 { 0x0060BC, "KeunYoung Electronics & Communication Co., Ltd." },

11055 { 0x0060BD, "Enginuity Communications" },

11056 { 0x0060BE, "WEBTRONICS" },

11057 { 0x0060BF, "MACRAIGOR SYSTEMS, INC." },

11058 { 0x0060C0, "Nera Networks AS" },

11059 { 0x0060C1, "WaveSpan Corporation" },

11060 { 0x0060C2, "MPL AG" },

11061 { 0x0060C3, "NETVISION CORPORATION" },

11062 { 0x0060C4, "SOLITON SYSTEMS K.K." },

11063 { 0x0060C5, "ANCOT CORP." },

11064 { 0x0060C6, "DCS AG" },

11065 { 0x0060C7, "AMATI COMMUNICATIONS CORP." },

11066 { 0x0060C8, "KUKA WELDING SYSTEMS & ROBOTS" },

11067 { 0x0060C9, "ControlNet, Inc." },

11068 { 0x0060CA, "HARMONIC SYSTEMS INCORPORATED" },

11069 { 0x0060CB, "HITACHI ZOSEN CORPORATION" },

11070 { 0x0060CC, "EMTRAK, INCORPORATED" },

11071 { 0x0060CD, "VideoServer, Inc." },

11072 { 0x0060CE, "ACCLAIM COMMUNICATIONS" },

11073 { 0x0060CF, "ALTEON NETWORKS, INC." },

11074 { 0x0060D0, "SNMP RESEARCH INCORPORATED" },

11075 { 0x0060D1, "CASCADE COMMUNICATIONS" },

11076 { 0x0060D2, "LUCENT TECHNOLOGIES TAIWAN TELECOMMUNICATIONS CO., LTD." },

11077 { 0x0060D3, "AT&T" },

11078 { 0x0060D4, "ELDAT COMMUNICATION LTD." },

11079 { 0x0060D5, "AMADA MIYACHI Co., Ltd" },

11080 { 0x0060D6, "NovAtel Inc." },

11081 { 0x0060D7, "ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE (EPFL)" },

11082 { 0x0060D8, "ELMIC SYSTEMS, INC." },

11083 { 0x0060D9, "TRANSYS NETWORKS INC." },

11084 { 0x0060DA, "Red Lion Controls, LP" },

11085 { 0x0060DB, "NTP ELEKTRONIK A/S" },

11086 { 0x0060DC, "NEC Magnus Communications,Ltd." },

11087 { 0x0060DD, "MYRICOM, INC." },

11088 { 0x0060DE, "Kayser-Threde GmbH" },

11089 { 0x0060DF, "Brocade Communications Systems LLC" },

11090 { 0x0060E0, "AXIOM TECHNOLOGY CO., LTD." },

11091 { 0x0060E1, "ORCKIT COMMUNICATIONS LTD." },

11092 { 0x0060E2, "QUEST ENGINEERING & DEVELOPMENT" },

11093 { 0x0060E3, "ARBIN INSTRUMENTS" },

11094 { 0x0060E4, "COMPUSERVE, INC." },

11095 { 0x0060E5, "FUJI AUTOMATION CO., LTD." },

11096 { 0x0060E6, "SHOMITI SYSTEMS INCORPORATED" },

11097 { 0x0060E7, "RANDATA" },

11098 { 0x0060E8, "HITACHI COMPUTER PRODUCTS (AMERICA), INC." },

11099 { 0x0060E9, "ATOP TECHNOLOGIES, INC." },

11100 { 0x0060EA, "StreamLogic" },

11101 { 0x0060EB, "FOURTHTRACK SYSTEMS" },

11102 { 0x0060EC, "HERMARY OPTO ELECTRONICS INC." },

11103 { 0x0060ED, "RICARDO TEST AUTOMATION LTD." },

11104 { 0x0060EE, "APOLLO" },

11105 { 0x0060EF, "FLYTECH TECHNOLOGY CO., LTD." },

11106 { 0x0060F0, "JOHNSON & JOHNSON MEDICAL, INC" },

11107 { 0x0060F1, "EXP COMPUTER, INC." },

11108 { 0x0060F2, "LASERGRAPHICS, INC." },

11109 { 0x0060F3, "Performance Analysis Broadband, Spirent plc" },

11110 { 0x0060F4, "ADVANCED COMPUTER SOLUTIONS, Inc." },

11111 { 0x0060F5, "ICON WEST, INC." },

11112 { 0x0060F6, "NEXTEST COMMUNICATIONS PRODUCTS, INC." },

11113 { 0x0060F7, "DATAFUSION SYSTEMS" },

11114 { 0x0060F8, "Loran International Technologies Inc." },

11115 { 0x0060F9, "DIAMOND LANE COMMUNICATIONS" },

11116 { 0x0060FA, "EDUCATIONAL TECHNOLOGY RESOURCES, INC." },

11117 { 0x0060FB, "PACKETEER, INC." },

11118 { 0x0060FC, "CONSERVATION THROUGH INNOVATION LTD." },

11119 { 0x0060FD, "NetICs, Inc." },

11120 { 0x0060FE, "LYNX SYSTEM DEVELOPERS, INC." },

11121 { 0x0060FF, "QuVis, Inc." },

11122 { 0x006151, "HUAWEI TECHNOLOGIES CO.,LTD" },

11123 { 0x006171, "Apple, Inc." },

11124 { 0x00620B, "Broadcom Limited" },

11125 { 0x0062EC, "Cisco Systems, Inc" },

11126 { 0x0063DE, "CLOUDWALK TECHNOLOGY CO.,LTD" },

11127 { 0x006440, "Cisco Systems, Inc" },

11128 { 0x0064A6, "Maquet CardioVascular" },

11129 { 0x0064AF, "Dish Technologies Corp" },

11130 { 0x00651E, "Amcrest Technologies" },

11131 { 0x006619, "Huawei Device Co., Ltd." },

11132 { 0x00664B, "HUAWEI TECHNOLOGIES CO.,LTD" },

11133 { 0x006762, "Fiberhome Telecommunication Technologies Co.,LTD" },

11134 { 0x00682B, "Huawei Device Co., Ltd." },

11135 { 0x0068EB, "HP Inc." },

11136 { 0x00692D, "Sunnovo International Limited" },

11137 { 0x006967, "IEEE Registration Authority" },

11138 { 0x006B6F, "HUAWEI TECHNOLOGIES CO.,LTD" },

11139 { 0x006B8E, "Shanghai Feixun Communication Co.,Ltd." },

11140 { 0x006B9E, "Vizio, Inc" },

11141 { 0x006BA0, "SHENZHEN UNIVERSAL INTELLISYS PTE LTD" },

11142 { 0x006BF1, "Cisco Systems, Inc" },

11143 { 0x006CBC, "Cisco Systems, Inc" },

11144 { 0x006CFD, "Sichuan Changhong Electric Ltd." },

11145 { 0x006D52, "Apple, Inc." },

11146 { 0x006D61, "Guangzhou V-SOLUTION Electronic Technology Co., Ltd." },

11147 { 0x006DFB, "Vutrix Technologies Ltd" },

11148 { 0x006E02, "Xovis AG" },

11149 { 0x006F64, "Samsung Electronics Co.,Ltd" },

11150 { 0x006FF2, "MITSUMI ELECTRIC CO.,LTD." },

11151 { 0x0070B0, "M/A-COM INC. COMPANIES" },

11152 { 0x0070B3, "DATA RECALL LTD." },

11153 { 0x007147, "Amazon Technologies Inc." },

11154 { 0x0071C2, "PEGATRON CORPORATION" },

11155 { 0x0071CC, "Hon Hai Precision Ind. Co.,Ltd." },

11156 { 0x007204, "Samsung Electronics Co., Ltd. ARTIK" },

11157 { 0x007263, "Netis Technology Co., Ltd." },

11158 { 0x007278, "Cisco Systems, Inc" },

11159 { 0x00738D, "Shenzhen TINNO Mobile Technology Corp." },

11160 { 0x0073E0, "Samsung Electronics Co.,Ltd" },

11161 { 0x00749C, "Ruijie Networks Co.,LTD" },

11162 { 0x007532, "INID BV" },

11163 { 0x0075E1, "Ampt, LLC" },

11164 { 0x00763D, "Veea" },

11165 { 0x007686, "Cisco Systems, Inc" },

11166 { 0x0076B1, "Somfy-Protect By Myfox SAS" },

11167 { 0x00778D, "Cisco Systems, Inc" },

11168 { 0x0077E4, "Nokia Solutions and Networks GmbH & Co. KG" },

11169 { 0x007839, "Nokia" },

11170 { 0x007888, "Cisco Systems, Inc" },

11171 { 0x00789E, "Sagemcom Broadband SAS" },

11172 { 0x0078CD, "Ignition Design Labs" },

11173 { 0x007B18, "SENTRY Co., LTD." },

11174 { 0x007C2D, "Samsung Electronics Co.,Ltd" },

11175 { 0x007D60, "Apple, Inc." },

11176 { 0x007DFA, "Volkswagen Group of America" },

11177 { 0x007E56, "China Dragon Technology Limited" },

11178 { 0x007E95, "Cisco Systems, Inc" },

11179 { 0x007F28, "Actiontec Electronics, Inc" },

11180 { 0x008000, "MULTITECH SYSTEMS, INC." },

11181 { 0x008001, "PERIPHONICS CORPORATION" },

11182 { 0x008002, "SATELCOM (UK) LTD" },

11183 { 0x008003, "HYTEC ELECTRONICS LTD." },

11184 { 0x008004, "ANTLOW COMMUNICATIONS, LTD." },

11185 { 0x008005, "CACTUS COMPUTER INC." },

11186 { 0x008006, "COMPUADD CORPORATION" },

11187 { 0x008007, "DLOG NC-SYSTEME" },

11188 { 0x008008, "DYNATECH COMPUTER SYSTEMS" },

11189 { 0x008009, "JUPITER SYSTEMS, INC." },

11190 { 0x00800A, "JAPAN COMPUTER CORP." },

11191 { 0x00800B, "CSK CORPORATION" },

11192 { 0x00800C, "VIDECOM LIMITED" },

11193 { 0x00800D, "VOSSWINKEL F.U." },

11194 { 0x00800E, "ATLANTIX CORPORATION" },

11195 { 0x00800F, "STANDARD MICROSYSTEMS" },

11196 { 0x008010, "COMMODORE INTERNATIONAL" },

11197 { 0x008011, "DIGITAL SYSTEMS INT'L. INC." },

11198 { 0x008012, "INTEGRATED MEASUREMENT SYSTEMS" },

11199 { 0x008013, "THOMAS-CONRAD CORPORATION" },

11200 { 0x008014, "ESPRIT SYSTEMS" },

11201 { 0x008015, "SEIKO SYSTEMS, INC." },

11202 { 0x008016, "WANDEL AND GOLTERMANN" },

11203 { 0x008017, "PFU LIMITED" },

11204 { 0x008018, "KOBE STEEL, LTD." },

11205 { 0x008019, "DAYNA COMMUNICATIONS, INC." },

11206 { 0x00801A, "BELL ATLANTIC" },

11207 { 0x00801B, "KODIAK TECHNOLOGY" },

11208 { 0x00801C, "NEWPORT SYSTEMS SOLUTIONS" },

11209 { 0x00801D, "INTEGRATED INFERENCE MACHINES" },

11210 { 0x00801E, "XINETRON, INC." },

11211 { 0x00801F, "KRUPP ATLAS ELECTRONIK GMBH" },

11212 { 0x008020, "NETWORK PRODUCTS" },

11213 { 0x008021, "Alcatel Canada Inc." },

11214 { 0x008022, "SCAN-OPTICS" },

11215 { 0x008023, "INTEGRATED BUSINESS NETWORKS" },

11216 { 0x008024, "KALPANA, INC." },

11217 { 0x008025, "Telit Wireless Solutions GmbH" },

11218 { 0x008026, "NETWORK PRODUCTS CORPORATION" },

11219 { 0x008027, "ADAPTIVE SYSTEMS, INC." },

11220 { 0x008028, "TRADPOST (HK) LTD" },

11221 { 0x008029, "EAGLE TECHNOLOGY, INC." },

11222 { 0x00802A, "TEST SYSTEMS & SIMULATIONS INC" },

11223 { 0x00802B, "INTEGRATED MARKETING CO" },

11224 { 0x00802C, "THE SAGE GROUP PLC" },

11225 { 0x00802D, "XYLOGICS INC" },

11226 { 0x00802E, "CASTLE ROCK COMPUTING" },

11227 { 0x00802F, "NATIONAL INSTRUMENTS CORP." },

11228 { 0x008030, "NEXUS ELECTRONICS" },

11229 { 0x008031, "BASYS, CORP." },

11230 { 0x008032, "ACCESS CO., LTD." },

11231 { 0x008033, "EMS Aviation, Inc." },

11232 { 0x008034, "SMT GOUPIL" },

11233 { 0x008035, "TECHNOLOGY WORKS, INC." },

11234 { 0x008036, "REFLEX MANUFACTURING SYSTEMS" },

11235 { 0x008037, "Ericsson Group" },

11236 { 0x008038, "DATA RESEARCH & APPLICATIONS" },

11237 { 0x008039, "ALCATEL STC AUSTRALIA" },

11238 { 0x00803A, "VARITYPER, INC." },

11239 { 0x00803B, "APT COMMUNICATIONS, INC." },

11240 { 0x00803C, "TVS ELECTRONICS LTD" },

11241 { 0x00803D, "SURIGIKEN CO., LTD." },

11242 { 0x00803E, "SYNERNETICS" },

11243 { 0x00803F, "TATUNG COMPANY" },

11244 { 0x008040, "JOHN FLUKE MANUFACTURING CO." },

11245 { 0x008041, "VEB KOMBINAT ROBOTRON" },

11246 { 0x008042, "Artesyn Embedded Technologies" },

11247 { 0x008043, "NETWORLD, INC." },

11248 { 0x008044, "SYSTECH COMPUTER CORP." },

11249 { 0x008045, "MATSUSHITA ELECTRIC IND. CO" },

11250 { 0x008046, "Tattile SRL" },

11251 { 0x008047, "IN-NET CORP." },

11252 { 0x008048, "COMPEX INCORPORATED" },

11253 { 0x008049, "NISSIN ELECTRIC CO., LTD." },

11254 { 0x00804A, "PRO-LOG" },

11255 { 0x00804B, "EAGLE TECHNOLOGIES PTY.LTD." },

11256 { 0x00804C, "CONTEC CO., LTD." },

11257 { 0x00804D, "CYCLONE MICROSYSTEMS, INC." },

11258 { 0x00804E, "APEX COMPUTER COMPANY" },

11259 { 0x00804F, "DAIKIN INDUSTRIES, LTD." },

11260 { 0x008050, "ZIATECH CORPORATION" },

11261 { 0x008051, "FIBERMUX" },

11262 { 0x008052, "TECHNICALLY ELITE CONCEPTS" },

11263 { 0x008053, "INTELLICOM, INC." },

11264 { 0x008054, "FRONTIER TECHNOLOGIES CORP." },

11265 { 0x008055, "FERMILAB" },

11266 { 0x008056, "SPHINX Electronics GmbH & Co KG" },

11267 { 0x008057, "ADSOFT, LTD." },

11268 { 0x008058, "PRINTER SYSTEMS CORP." },

11269 { 0x008059, "STANLEY ELECTRIC CO., LTD" },

11270 { 0x00805A, "TULIP COMPUTERS INTERNAT'L B.V" },

11271 { 0x00805B, "CONDOR SYSTEMS, INC." },

11272 { 0x00805C, "AGILIS CORPORATION" },

11273 { 0x00805D, "CANSTAR" },

11274 { 0x00805E, "LSI LOGIC CORPORATION" },

11275 { 0x00805F, "Hewlett Packard" },

11276 { 0x008060, "NETWORK INTERFACE CORPORATION" },

11277 { 0x008061, "LITTON SYSTEMS, INC." },

11278 { 0x008062, "INTERFACE CO." },

11279 { 0x008063, "Hirschmann Automation and Control GmbH" },

11280 { 0x008064, "WYSE TECHNOLOGY LLC" },

11281 { 0x008065, "CYBERGRAPHIC SYSTEMS PTY LTD." },

11282 { 0x008066, "Eurotech S.p.A." },

11283 { 0x008067, "SQUARE D COMPANY" },

11284 { 0x008068, "YAMATECH SCIENTIFIC LTD." },

11285 { 0x008069, "COMPUTONE SYSTEMS" },

11286 { 0x00806A, "ERI (EMPAC RESEARCH INC.)" },

11287 { 0x00806B, "SCHMID TELECOMMUNICATION" },

11288 { 0x00806C, "Secure Systems & Services" },

11289 { 0x00806D, "CENTURY SYSTEMS CORP." },

11290 { 0x00806E, "NIPPON STEEL CORPORATION" },

11291 { 0x00806F, "ONELAN LTD." },

11292 { 0x008070, "COMPUTADORAS MICRON" },

11293 { 0x008071, "SAI TECHNOLOGY" },

11294 { 0x008072, "MICROPLEX SYSTEMS LTD." },

11295 { 0x008073, "DWB ASSOCIATES" },

11296 { 0x008074, "FISHER CONTROLS" },

11297 { 0x008075, "PARSYTEC GMBH" },

11298 { 0x008076, "MCNC" },

11299 { 0x008077, "Brother industries, LTD." },

11300 { 0x008078, "PRACTICAL PERIPHERALS, INC." },

11301 { 0x008079, "MICROBUS DESIGNS LTD." },

11302 { 0x00807A, "AITECH SYSTEMS LTD." },

11303 { 0x00807B, "ARTEL COMMUNICATIONS CORP." },

11304 { 0x00807C, "FIBERCOM, INC." },

11305 { 0x00807D, "EQUINOX SYSTEMS INC." },

11306 { 0x00807E, "SOUTHERN PACIFIC LTD." },

11307 { 0x00807F, "DY-4 INCORPORATED" },

11308 { 0x008080, "DATAMEDIA CORPORATION" },

11309 { 0x008081, "KENDALL SQUARE RESEARCH CORP." },

11310 { 0x008082, "PEP MODULAR COMPUTERS GMBH" },

11311 { 0x008083, "AMDAHL" },

11312 { 0x008084, "THE CLOUD INC." },

11313 { 0x008085, "H-THREE SYSTEMS CORPORATION" },

11314 { 0x008086, "COMPUTER GENERATION INC." },

11315 { 0x008087, "OKI ELECTRIC INDUSTRY CO., LTD" },

11316 { 0x008088, "VICTOR COMPANY OF JAPAN, LTD." },

11317 { 0x008089, "TECNETICS (PTY) LTD." },

11318 { 0x00808A, "SUMMIT MICROSYSTEMS CORP." },

11319 { 0x00808B, "DACOLL LIMITED" },

11320 { 0x00808C, "NETSCOUT SYSTEMS INC" },

11321 { 0x00808D, "WESTCOAST TECHNOLOGY B.V." },

11322 { 0x00808E, "RADSTONE TECHNOLOGY" },

11323 { 0x00808F, "C. ITOH ELECTRONICS, INC." },

11324 { 0x008090, "MICROTEK INTERNATIONAL, INC." },

11325 { 0x008091, "TOKYO ELECTRIC CO.,LTD" },

11326 { 0x008092, "Silex Technology, Inc." },

11327 { 0x008093, "XYRON CORPORATION" },

11328 { 0x008094, "ALFA LAVAL AUTOMATION AB" },

11329 { 0x008095, "BASIC MERTON HANDELSGES.M.B.H." },

11330 { 0x008096, "HUMAN DESIGNED SYSTEMS, INC." },

11331 { 0x008097, "CENTRALP AUTOMATISMES" },

11332 { 0x008098, "TDK CORPORATION" },

11333 { 0x008099, "Eaton Industries GmbH" },

11334 { 0x00809A, "NOVUS NETWORKS LTD" },

11335 { 0x00809B, "JUSTSYSTEM CORPORATION" },

11336 { 0x00809C, "LUXCOM, INC." },

11337 { 0x00809D, "Commscraft Ltd." },

11338 { 0x00809E, "DATUS GMBH" },

11339 { 0x00809F, "ALE International" },

11340 { 0x0080A0, "Hewlett Packard" },

11341 { 0x0080A1, "MICROTEST, INC." },

11342 { 0x0080A2, "CREATIVE ELECTRONIC SYSTEMS" },

11343 { 0x0080A3, "Lantronix" },

11344 { 0x0080A4, "LIBERTY ELECTRONICS" },

11345 { 0x0080A5, "SPEED INTERNATIONAL" },

11346 { 0x0080A6, "REPUBLIC TECHNOLOGY, INC." },

11347 { 0x0080A7, "Honeywell International Inc" },

11348 { 0x0080A8, "VITACOM CORPORATION" },

11349 { 0x0080A9, "CLEARPOINT RESEARCH" },

11350 { 0x0080AA, "MAXPEED" },

11351 { 0x0080AB, "DUKANE NETWORK INTEGRATION" },

11352 { 0x0080AC, "IMLOGIX, DIVISION OF GENESYS" },

11353 { 0x0080AD, "CNET TECHNOLOGY, INC." },

11354 { 0x0080AE, "HUGHES NETWORK SYSTEMS" },

11355 { 0x0080AF, "ALLUMER CO., LTD." },

11356 { 0x0080B0, "ADVANCED INFORMATION" },

11357 { 0x0080B1, "SOFTCOM A/S" },

11358 { 0x0080B2, "NETWORK EQUIPMENT TECHNOLOGIES" },

11359 { 0x0080B3, "AVAL DATA CORPORATION" },

11360 { 0x0080B4, "SOPHIA SYSTEMS" },

11361 { 0x0080B5, "UNITED NETWORKS INC." },

11362 { 0x0080B6, "Mercury Systems – Trusted Mission Solutions, Inc." },

11363 { 0x0080B7, "STELLAR COMPUTER" },

11364 { 0x0080B8, "DMG MORI Digital Co., LTD" },

11365 { 0x0080B9, "ARCHE TECHNOLIGIES INC." },

11366 { 0x0080BA, "SPECIALIX (ASIA) PTE, LTD" },

11367 { 0x0080BB, "HUGHES LAN SYSTEMS" },

11368 { 0x0080BC, "HITACHI ENGINEERING CO., LTD" },

11369 { 0x0080BD, "THE FURUKAWA ELECTRIC CO., LTD" },

11370 { 0x0080BE, "ARIES RESEARCH" },

11371 { 0x0080BF, "TAKAOKA ELECTRIC MFG. CO. LTD." },

11372 { 0x0080C0, "PENRIL DATACOMM" },

11373 { 0x0080C1, "LANEX CORPORATION" },

11374 { 0x0080C2, "IEEE 802.1 Chair" },

11375 { 0x0080C3, "BICC INFORMATION SYSTEMS & SVC" },

11376 { 0x0080C4, "DOCUMENT TECHNOLOGIES, INC." },

11377 { 0x0080C5, "NOVELLCO DE MEXICO" },

11378 { 0x0080C6, "NATIONAL DATACOMM CORPORATION" },

11379 { 0x0080C7, "XIRCOM" },

11380 { 0x0080C8, "D-LINK SYSTEMS, INC." },

11381 { 0x0080C9, "ALBERTA MICROELECTRONIC CENTRE" },

11382 { 0x0080CA, "NETCOM RESEARCH INCORPORATED" },

11383 { 0x0080CB, "FALCO DATA PRODUCTS" },

11384 { 0x0080CC, "MICROWAVE BYPASS SYSTEMS" },

11385 { 0x0080CD, "MICRONICS COMPUTER, INC." },

11386 { 0x0080CE, "BROADCAST TELEVISION SYSTEMS" },

11387 { 0x0080CF, "EMBEDDED PERFORMANCE INC." },

11388 { 0x0080D0, "COMPUTER PERIPHERALS, INC." },

11389 { 0x0080D1, "KIMTRON CORPORATION" },

11390 { 0x0080D2, "SHINNIHONDENKO CO., LTD." },

11391 { 0x0080D3, "SHIVA CORP." },

11392 { 0x0080D4, "CHASE RESEARCH LTD." },

11393 { 0x0080D5, "CADRE TECHNOLOGIES" },

11394 { 0x0080D6, "NUVOTECH, INC." },

11395 { 0x0080D7, "Fantum Engineering" },

11396 { 0x0080D8, "NETWORK PERIPHERALS INC." },

11397 { 0x0080D9, "EMK Elektronik GmbH & Co. KG" },

11398 { 0x0080DA, "Hottinger Brüel & Kjær A/S" },

11399 { 0x0080DB, "GRAPHON CORPORATION" },

11400 { 0x0080DC, "PICKER INTERNATIONAL" },

11401 { 0x0080DD, "GMX INC/GIMIX" },

11402 { 0x0080DE, "GIPSI S.A." },

11403 { 0x0080DF, "ADC CODENOLL TECHNOLOGY CORP." },

11404 { 0x0080E0, "XTP SYSTEMS, INC." },

11405 { 0x0080E1, "STMicroelectronics SRL" },

11406 { 0x0080E2, "T.D.I. CO., LTD." },

11407 { 0x0080E3, "CORAL NETWORK CORPORATION" },

11408 { 0x0080E4, "NORTHWEST DIGITAL SYSTEMS, INC" },

11409 { 0x0080E5, "NetApp" },

11410 { 0x0080E6, "PEER NETWORKS, INC." },

11411 { 0x0080E7, "Leonardo UK Ltd" },

11412 { 0x0080E8, "CUMULUS CORPORATIION" },

11413 { 0x0080E9, "Madge Ltd." },

11414 { 0x0080EA, "ADVA Optical Networking Ltd." },

11415 { 0x0080EB, "COMPCONTROL B.V." },

11416 { 0x0080EC, "SUPERCOMPUTING SOLUTIONS, INC." },

11417 { 0x0080ED, "IQ TECHNOLOGIES, INC." },

11418 { 0x0080EE, "THOMSON CSF" },

11419 { 0x0080EF, "RATIONAL" },

11420 { 0x0080F0, "Panasonic Communications Co., Ltd." },

11421 { 0x0080F1, "OPUS SYSTEMS" },

11422 { 0x0080F2, "RAYCOM SYSTEMS INC" },

11423 { 0x0080F3, "SUN ELECTRONICS CORP." },

11424 { 0x0080F4, "TELEMECANIQUE ELECTRIQUE" },

11425 { 0x0080F5, "Quantel Ltd" },

11426 { 0x0080F6, "SYNERGY MICROSYSTEMS" },

11427 { 0x0080F7, "Zenith Electronics Corporation" },

11428 { 0x0080F8, "MIZAR, INC." },

11429 { 0x0080F9, "HEURIKON CORPORATION" },

11430 { 0x0080FA, "RWT GMBH" },

11431 { 0x0080FB, "BVM LIMITED" },

11432 { 0x0080FC, "AVATAR CORPORATION" },

11433 { 0x0080FD, "EXSCEED CORPRATION" },

11434 { 0x0080FE, "AZURE TECHNOLOGIES, INC." },

11435 { 0x0080FF, "SOC. DE TELEINFORMATIQUE RTC" },

11436 { 0x0081C4, "Cisco Systems, Inc" },

11437 { 0x0081F9, "Texas Instruments" },

11438 { 0x00841E, "Cisco Meraki" },

11439 { 0x0084ED, "LEXMARK INTERNATIONAL, INC." },

11440 { 0x00869C, "Palo Alto Networks" },

11441 { 0x0086A0, "Private" },

11442 { 0x008701, "Samsung Electronics Co.,Ltd" },

11443 { 0x008731, "Cisco Systems, Inc" },

11444 { 0x008764, "Cisco Systems, Inc" },

11445 { 0x008865, "Apple, Inc." },

11446 { 0x0088BA, "NC&C" },

11447 { 0x008A55, "Huawei Device Co., Ltd." },

11448 { 0x008A76, "Apple, Inc." },

11449 { 0x008A96, "Cisco Systems, Inc" },

11450 { 0x008B43, "RFTECH" },

11451 { 0x008BFC, "mixi,Inc." },

11452 { 0x008C10, "Black Box Corp." },

11453 { 0x008C54, "ADB Broadband Italia" },

11454 { 0x008CFA, "INVENTEC CORPORATION" },

11455 { 0x008D4E, "CJSC NII STT" },

11456 { 0x008DDA, "Link One Co., Ltd." },

11457 { 0x008DF4, "IEEE Registration Authority" },

11458 { 0x008E73, "Cisco Systems, Inc" },

11459 { 0x008EF2, "NETGEAR" },

11460 { 0x009000, "DIAMOND MULTIMEDIA" },

11461 { 0x009001, "NISHIMU ELECTRONICS INDUSTRIES CO., LTD." },

11462 { 0x009002, "ALLGON AB" },

11463 { 0x009003, "APLIO" },

11464 { 0x009004, "3COM EUROPE LTD" },

11465 { 0x009005, "PROTECH SYSTEMS CO., LTD." },

11466 { 0x009006, "Hamamatsu Photonics K.K." },

11467 { 0x009007, "DOMEX TECHNOLOGY CORP." },

11468 { 0x009008, "HanA Systems Inc." },

11469 { 0x009009, "I Controls, Inc." },

11470 { 0x00900A, "PROTON ELECTRONIC INDUSTRIAL CO., LTD." },

11471 { 0x00900B, "LANNER ELECTRONICS, INC." },

11472 { 0x00900C, "Cisco Systems, Inc" },

11473 { 0x00900D, "Overland Storage Inc." },

11474 { 0x00900E, "HANDLINK TECHNOLOGIES, INC." },

11475 { 0x00900F, "KAWASAKI HEAVY INDUSTRIES, LTD" },

11476 { 0x009010, "SIMULATION LABORATORIES, INC." },

11477 { 0x009011, "WAVTrace, Inc." },

11478 { 0x009012, "GLOBESPAN SEMICONDUCTOR, INC." },

11479 { 0x009013, "SAMSAN CORP." },

11480 { 0x009014, "ROTORK INSTRUMENTS, LTD." },

11481 { 0x009015, "CENTIGRAM COMMUNICATIONS CORP." },

11482 { 0x009016, "ZAC" },

11483 { 0x009017, "Zypcom, Inc" },

11484 { 0x009018, "ITO ELECTRIC INDUSTRY CO, LTD." },

11485 { 0x009019, "HERMES ELECTRONICS CO., LTD." },

11486 { 0x00901A, "UNISPHERE SOLUTIONS" },

11487 { 0x00901B, "DIGITAL CONTROLS" },

11488 { 0x00901C, "mps Software Gmbh" },

11489 { 0x00901D, "PEC (NZ) LTD." },

11490 { 0x00901E, "Selesta Ingegneria S.p.A." },

11491 { 0x00901F, "ADTEC PRODUCTIONS, INC." },

11492 { 0x009020, "PHILIPS ANALYTICAL X-RAY B.V." },

11493 { 0x009021, "Cisco Systems, Inc" },

11494 { 0x009022, "IVEX" },

11495 { 0x009023, "ZILOG INC." },

11496 { 0x009024, "PIPELINKS, INC." },

11497 { 0x009025, "BAE Systems Australia (Electronic Systems) Pty Ltd" },

11498 { 0x009026, "ADVANCED SWITCHING COMMUNICATIONS, INC." },

11499 { 0x009027, "Intel Corporation" },

11500 { 0x009028, "NIPPON SIGNAL CO., LTD." },

11501 { 0x009029, "CRYPTO AG" },

11502 { 0x00902A, "COMMUNICATION DEVICES, INC." },

11503 { 0x00902B, "Cisco Systems, Inc" },

11504 { 0x00902C, "DATA & CONTROL EQUIPMENT LTD." },

11505 { 0x00902D, "DATA ELECTRONICS (AUST.) PTY, LTD." },

11506 { 0x00902E, "NAMCO LIMITED" },

11507 { 0x00902F, "NETCORE SYSTEMS, INC." },

11508 { 0x009030, "HONEYWELL-DATING" },

11509 { 0x009031, "MYSTICOM, LTD." },

11510 { 0x009032, "PELCOMBE GROUP LTD." },

11511 { 0x009033, "INNOVAPHONE AG" },

11512 { 0x009034, "IMAGIC, INC." },

11513 { 0x009035, "ALPHA TELECOM, INC." },

11514 { 0x009036, "ens, inc." },

11515 { 0x009037, "ACUCOMM, INC." },

11516 { 0x009038, "FOUNTAIN TECHNOLOGIES, INC." },

11517 { 0x009039, "SHASTA NETWORKS" },

11518 { 0x00903A, "NIHON MEDIA TOOL INC." },

11519 { 0x00903B, "TriEMS Research Lab, Inc." },

11520 { 0x00903C, "ATLANTIC NETWORK SYSTEMS" },

11521 { 0x00903D, "BIOPAC SYSTEMS, INC." },

11522 { 0x00903E, "N.V. PHILIPS INDUSTRIAL ACTIVITIES" },

11523 { 0x00903F, "WorldCast Systems" },

11524 { 0x009040, "Siemens Network Convergence LLC" },

11525 { 0x009041, "APPLIED DIGITAL ACCESS" },

11526 { 0x009042, "ECCS, Inc." },

11527 { 0x009043, "Tattile SRL" },

11528 { 0x009044, "ASSURED DIGITAL, INC." },

11529 { 0x009045, "Marconi Communications" },

11530 { 0x009046, "DEXDYNE, LTD." },

11531 { 0x009047, "GIGA FAST E. LTD." },

11532 { 0x009048, "ZEAL CORPORATION" },

11533 { 0x009049, "ENTRIDIA CORPORATION" },

11534 { 0x00904A, "CONCUR SYSTEM TECHNOLOGIES" },

11535 { 0x00904B, "Gemtek Technology Co., Ltd." },

11536 { 0x00904C, "Epigram, Inc." },

11537 { 0x00904D, "SPEC S.A." },

11538 { 0x00904E, "DELEM BV" },

11539 { 0x00904F, "ABB POWER T&D COMPANY, INC." },

11540 { 0x009050, "Teleste Corporation" },

11541 { 0x009051, "ULTIMATE TECHNOLOGY CORP." },

11542 { 0x009052, "SELCOM ELETTRONICA S.R.L." },

11543 { 0x009053, "DAEWOO ELECTRONICS CO., LTD." },

11544 { 0x009054, "INNOVATIVE SEMICONDUCTORS, INC" },

11545 { 0x009055, "PARKER HANNIFIN CORPORATION COMPUMOTOR DIVISION" },

11546 { 0x009056, "TELESTREAM, INC." },

11547 { 0x009057, "AANetcom, Inc." },

11548 { 0x009058, "Ultra Electronics Command & Control Systems" },

11549 { 0x009059, "TELECOM DEVICE K.K." },

11550 { 0x00905A, "DEARBORN GROUP, INC." },

11551 { 0x00905B, "RAYMOND AND LAE ENGINEERING" },

11552 { 0x00905C, "EDMI" },

11553 { 0x00905D, "NETCOM SICHERHEITSTECHNIK GMBH" },

11554 { 0x00905E, "RAULAND-BORG CORPORATION" },

11555 { 0x00905F, "Cisco Systems, Inc" },

11556 { 0x009060, "SYSTEM CREATE CORP." },

11557 { 0x009061, "PACIFIC RESEARCH & ENGINEERING CORPORATION" },

11558 { 0x009062, "ICP VORTEX COMPUTERSYSTEME GmbH" },

11559 { 0x009063, "COHERENT COMMUNICATIONS SYSTEMS CORPORATION" },

11560 { 0x009064, "Thomson Inc." },

11561 { 0x009065, "FINISAR CORPORATION" },

11562 { 0x009066, "Troika Networks, Inc." },

11563 { 0x009067, "WalkAbout Computers, Inc." },

11564 { 0x009068, "DVT CORP." },

11565 { 0x009069, "Juniper Networks" },

11566 { 0x00906A, "TURNSTONE SYSTEMS, INC." },

11567 { 0x00906B, "APPLIED RESOURCES, INC." },

11568 { 0x00906C, "Sartorius Hamburg GmbH" },

11569 { 0x00906D, "Cisco Systems, Inc" },

11570 { 0x00906E, "PRAXON, INC." },

11571 { 0x00906F, "Cisco Systems, Inc" },

11572 { 0x009070, "NEO NETWORKS, INC." },

11573 { 0x009071, "Applied Innovation Inc." },

11574 { 0x009072, "SIMRAD AS" },

11575 { 0x009073, "GAIO TECHNOLOGY" },

11576 { 0x009074, "ARGON NETWORKS, INC." },

11577 { 0x009075, "NEC DO BRASIL S.A." },

11578 { 0x009076, "FMT AIRCRAFT GATE SUPPORT SYSTEMS AB" },

11579 { 0x009077, "ADVANCED FIBRE COMMUNICATIONS" },

11580 { 0x009078, "MER TELEMANAGEMENT SOLUTIONS, LTD." },

11581 { 0x009079, "ClearOne, Inc." },

11582 { 0x00907A, "Spectralink, Inc" },

11583 { 0x00907B, "E-TECH, INC." },

11584 { 0x00907C, "DIGITALCAST, INC." },

11585 { 0x00907D, "Lake Communications" },

11586 { 0x00907E, "VETRONIX CORP." },

11587 { 0x00907F, "WatchGuard Technologies, Inc." },

11588 { 0x009080, "NOT LIMITED, INC." },

11589 { 0x009081, "ALOHA NETWORKS, INC." },

11590 { 0x009082, "FORCE INSTITUTE" },

11591 { 0x009083, "TURBO COMMUNICATION, INC." },

11592 { 0x009084, "ATECH SYSTEM" },

11593 { 0x009085, "GOLDEN ENTERPRISES, INC." },

11594 { 0x009086, "Cisco Systems, Inc" },

11595 { 0x009087, "ITIS" },

11596 { 0x009088, "BAXALL SECURITY LTD." },

11597 { 0x009089, "SOFTCOM MICROSYSTEMS, INC." },

11598 { 0x00908A, "BAYLY COMMUNICATIONS, INC." },

11599 { 0x00908B, "Tattile SRL" },

11600 { 0x00908C, "ETREND ELECTRONICS, INC." },

11601 { 0x00908D, "VICKERS ELECTRONICS SYSTEMS" },

11602 { 0x00908E, "Nortel Networks Broadband Access" },

11603 { 0x00908F, "AUDIO CODES LTD." },

11604 { 0x009090, "I-BUS" },

11605 { 0x009091, "DigitalScape, Inc." },

11606 { 0x009092, "Cisco Systems, Inc" },

11607 { 0x009093, "EIZO Corporation" },

11608 { 0x009094, "OSPREY TECHNOLOGIES, INC." },

11609 { 0x009095, "UNIVERSAL AVIONICS" },

11610 { 0x009096, "ASKEY COMPUTER CORP" },

11611 { 0x009097, "Sycamore Networks" },

11612 { 0x009098, "SBC DESIGNS, INC." },

11613 { 0x009099, "ALLIED TELESIS, K.K." },

11614 { 0x00909A, "ONE WORLD SYSTEMS, INC." },

11615 { 0x00909B, "MARKEM-IMAJE" },

11616 { 0x00909C, "ARRIS Group, Inc." },

11617 { 0x00909D, "NovaTech Process Solutions, LLC" },

11618 { 0x00909E, "Critical IO, LLC" },

11619 { 0x00909F, "DIGI-DATA CORPORATION" },

11620 { 0x0090A0, "8X8 INC." },

11621 { 0x0090A1, "Flying Pig Systems/High End Systems Inc." },

11622 { 0x0090A2, "CyberTAN Technology Inc." },

11623 { 0x0090A3, "Corecess Inc." },

11624 { 0x0090A4, "ALTIGA NETWORKS" },

11625 { 0x0090A5, "SPECTRA LOGIC" },

11626 { 0x0090A6, "Cisco Systems, Inc" },

11627 { 0x0090A7, "CLIENTEC CORPORATION" },

11628 { 0x0090A8, "NineTiles Networks, Ltd." },

11629 { 0x0090A9, "WESTERN DIGITAL" },

11630 { 0x0090AA, "INDIGO ACTIVE VISION SYSTEMS LIMITED" },

11631 { 0x0090AB, "Cisco Systems, Inc" },

11632 { 0x0090AC, "OPTIVISION, INC." },

11633 { 0x0090AD, "ASPECT ELECTRONICS, INC." },

11634 { 0x0090AE, "ITALTEL S.p.A/RF-UP-I" },

11635 { 0x0090AF, "J. MORITA MFG. CORP." },

11636 { 0x0090B0, "VADEM" },

11637 { 0x0090B1, "Cisco Systems, Inc" },

11638 { 0x0090B2, "AVICI SYSTEMS INC." },

11639 { 0x0090B3, "AGRANAT SYSTEMS" },

11640 { 0x0090B4, "WILLOWBROOK TECHNOLOGIES" },

11641 { 0x0090B5, "NIKON CORPORATION" },

11642 { 0x0090B6, "FIBEX SYSTEMS" },

11643 { 0x0090B7, "DIGITAL LIGHTWAVE, INC." },

11644 { 0x0090B8, "ROHDE & SCHWARZ GMBH & CO. KG" },

11645 { 0x0090B9, "BERAN INSTRUMENTS LTD." },

11646 { 0x0090BA, "VALID NETWORKS, INC." },

11647 { 0x0090BB, "TAINET COMMUNICATION SYSTEM Corp." },

11648 { 0x0090BC, "TELEMANN CO., LTD." },

11649 { 0x0090BD, "OMNIA COMMUNICATIONS, INC." },

11650 { 0x0090BE, "IBC/INTEGRATED BUSINESS COMPUTERS" },

11651 { 0x0090BF, "Cisco Systems, Inc" },

11652 { 0x0090C0, "K.J. LAW ENGINEERS, INC." },

11653 { 0x0090C1, "Peco II, Inc." },

11654 { 0x0090C2, "JK microsystems, Inc." },

11655 { 0x0090C3, "TOPIC SEMICONDUCTOR CORP." },

11656 { 0x0090C4, "JAVELIN SYSTEMS, INC." },

11657 { 0x0090C5, "INTERNET MAGIC, INC." },

11658 { 0x0090C6, "OPTIM SYSTEMS, INC." },

11659 { 0x0090C7, "ICOM INC." },

11660 { 0x0090C8, "WAVERIDER COMMUNICATIONS (CANADA) INC." },

11661 { 0x0090C9, "DPAC Technologies" },

11662 { 0x0090CA, "ACCORD VIDEO TELECOMMUNICATIONS, LTD." },

11663 { 0x0090CB, "Wireless OnLine, Inc." },

11664 { 0x0090CC, "PLANEX COMMUNICATIONS INC." },

11665 { 0x0090CD, "ENT-EMPRESA NACIONAL DE TELECOMMUNICACOES, S.A." },

11666 { 0x0090CE, "avateramedical Mechatronics GmbH" },

11667 { 0x0090CF, "NORTEL" },

11668 { 0x0090D0, "Thomson Telecom Belgium" },

11669 { 0x0090D1, "LEICHU ENTERPRISE CO., LTD." },

11670 { 0x0090D2, "Artel Video Systems" },

11671 { 0x0090D3, "GIESECKE & DEVRIENT GmbH" },

11672 { 0x0090D4, "BindView Development Corp." },

11673 { 0x0090D5, "EUPHONIX, INC." },

11674 { 0x0090D6, "Crystal Group, Inc." },

11675 { 0x0090D7, "NetBoost Corp." },

11676 { 0x0090D8, "WHITECROSS SYSTEMS" },

11677 { 0x0090D9, "Cisco Systems, Inc" },

11678 { 0x0090DA, "DYNARC, INC." },

11679 { 0x0090DB, "NEXT LEVEL COMMUNICATIONS" },

11680 { 0x0090DC, "TECO INFORMATION SYSTEMS" },

11681 { 0x0090DD, "MIHARU COMMUNICATIONS Inc" },

11682 { 0x0090DE, "CARDKEY SYSTEMS, INC." },

11683 { 0x0090DF, "MITSUBISHI CHEMICAL AMERICA, INC." },

11684 { 0x0090E0, "SYSTRAN CORP." },

11685 { 0x0090E1, "TELENA S.P.A." },

11686 { 0x0090E2, "DISTRIBUTED PROCESSING TECHNOLOGY" },

11687 { 0x0090E3, "AVEX ELECTRONICS INC." },

11688 { 0x0090E4, "NEC AMERICA, INC." },

11689 { 0x0090E5, "TEKNEMA, INC." },

11690 { 0x0090E6, "ALi Corporation" },

11691 { 0x0090E7, "HORSCH ELEKTRONIK AG" },

11692 { 0x0090E8, "MOXA TECHNOLOGIES CORP., LTD." },

11693 { 0x0090E9, "JANZ COMPUTER AG" },

11694 { 0x0090EA, "ALPHA TECHNOLOGIES, INC." },

11695 { 0x0090EB, "SENTRY TELECOM SYSTEMS" },

11696 { 0x0090EC, "PYRESCOM" },

11697 { 0x0090ED, "CENTRAL SYSTEM RESEARCH CO., LTD." },

11698 { 0x0090EE, "PERSONAL COMMUNICATIONS TECHNOLOGIES" },

11699 { 0x0090EF, "INTEGRIX, INC." },

11700 { 0x0090F0, "Harmonic Video Systems Ltd." },

11701 { 0x0090F1, "Seagate Cloud Systems Inc" },

11702 { 0x0090F2, "Cisco Systems, Inc" },

11703 { 0x0090F3, "ASPECT COMMUNICATIONS" },

11704 { 0x0090F4, "LIGHTNING INSTRUMENTATION" },

11705 { 0x0090F5, "CLEVO CO." },

11706 { 0x0090F6, "ESCALATE NETWORKS, INC." },

11707 { 0x0090F7, "NBASE COMMUNICATIONS LTD." },

11708 { 0x0090F8, "MEDIATRIX TELECOM" },

11709 { 0x0090F9, "Imagine Communications" },

11710 { 0x0090FA, "Emulex Corporation" },

11711 { 0x0090FB, "PORTWELL, INC." },

11712 { 0x0090FC, "NETWORK COMPUTING DEVICES" },

11713 { 0x0090FD, "CopperCom, Inc." },

11714 { 0x0090FE, "ELECOM CO., LTD. (LANEED DIV.)" },

11715 { 0x0090FF, "TELLUS TECHNOLOGY INC." },

11716 { 0x00919E, "Intel Corporate" },

11717 { 0x0091D6, "Crystal Group, Inc." },

11718 { 0x0091EB, "Renesas Electronics (Penang) Sdn. Bhd." },

11719 { 0x0091FA, "Synapse Product Development" },

11720 { 0x00927D, "Ficosa Internationa(Taicang) C0.,Ltd." },

11721 { 0x0092A5, "LG Innotek" },

11722 { 0x0092FA, "SHENZHEN WISKY TECHNOLOGY CO.,LTD" },

11723 { 0x009337, "Intel Corporate" },

11724 { 0x009363, "Uni-Link Technology Co., Ltd." },

11725 { 0x0094A1, "F5 Networks, Inc." },

11726 { 0x0094EC, "Huawei Device Co., Ltd." },

11727 { 0x009569, "LSD Science and Technology Co.,Ltd." },

11728 { 0x0097FF, "Heimann Sensor GmbH" },

11729 { 0x00991D, "HUAWEI TECHNOLOGIES CO.,LTD" },

11730 { 0x009ACD, "HUAWEI TECHNOLOGIES CO.,LTD" },

11731 { 0x009AD2, "Cisco Systems, Inc" },

11732 { 0x009C02, "Hewlett Packard" },

11733 { 0x009CC0, "vivo Mobile Communication Co., Ltd." },

11734 { 0x009D6B, "Murata Manufacturing Co., Ltd." },

11735 { 0x009D8E, "CARDIAC RECORDERS, INC." },

11736 { 0x009E1E, "Cisco Systems, Inc" },

11737 { 0x009EC8, "Xiaomi Communications Co Ltd" },

11738 { 0x009EEE, "Positivo Tecnologia S.A." },

11739 { 0x00A000, "CENTILLION NETWORKS, INC." },

11740 { 0x00A001, "DRS Signal Solutions" },

11741 { 0x00A002, "LEEDS & NORTHRUP AUSTRALIA PTY LTD" },

11742 { 0x00A003, "Siemens Switzerland Ltd., I B T HVP" },

11743 { 0x00A004, "NETPOWER, INC." },

11744 { 0x00A005, "DANIEL INSTRUMENTS, LTD." },

11745 { 0x00A006, "IMAGE DATA PROCESSING SYSTEM GROUP" },

11746 { 0x00A007, "APEXX TECHNOLOGY, INC." },

11747 { 0x00A008, "NETCORP" },

11748 { 0x00A009, "WHITETREE NETWORK" },

11749 { 0x00A00A, "Airspan" },

11750 { 0x00A00B, "COMPUTEX CO., LTD." },

11751 { 0x00A00C, "KINGMAX TECHNOLOGY, INC." },

11752 { 0x00A00D, "THE PANDA PROJECT" },

11753 { 0x00A00E, "NETSCOUT SYSTEMS INC" },

11754 { 0x00A00F, "Broadband Technologies" },

11755 { 0x00A010, "SYSLOGIC DATENTECHNIK AG" },

11756 { 0x00A011, "MUTOH INDUSTRIES LTD." },

11757 { 0x00A012, "Telco Systems, Inc." },

11758 { 0x00A013, "TELTREND LTD." },

11759 { 0x00A014, "CSIR" },

11760 { 0x00A015, "WYLE" },

11761 { 0x00A016, "MICROPOLIS CORP." },

11762 { 0x00A017, "J B M CORPORATION" },

11763 { 0x00A018, "CREATIVE CONTROLLERS, INC." },

11764 { 0x00A019, "NEBULA CONSULTANTS, INC." },

11765 { 0x00A01A, "BINAR ELEKTRONIK AB" },

11766 { 0x00A01B, "DZS Inc." },

11767 { 0x00A01C, "NASCENT NETWORKS CORPORATION" },

11768 { 0x00A01D, "Red Lion Controls, LP" },

11769 { 0x00A01E, "EST CORPORATION" },

11770 { 0x00A01F, "TRICORD SYSTEMS, INC." },

11771 { 0x00A020, "CITICORP/TTI" },

11772 { 0x00A021, "General Dynamics Mission Systems" },

11773 { 0x00A022, "CENTRE FOR DEVELOPMENT OF ADVANCED COMPUTING" },

11774 { 0x00A023, "APPLIED CREATIVE TECHNOLOGY, INC." },

11775 { 0x00A024, "3COM" },

11776 { 0x00A025, "REDCOM LABS INC." },

11777 { 0x00A026, "TELDAT, S.A." },

11778 { 0x00A027, "FIREPOWER SYSTEMS, INC." },

11779 { 0x00A028, "CONNER PERIPHERALS" },

11780 { 0x00A029, "COULTER CORPORATION" },

11781 { 0x00A02A, "TRANCELL SYSTEMS" },

11782 { 0x00A02B, "TRANSITIONS RESEARCH CORP." },

11783 { 0x00A02C, "interWAVE Communications" },

11784 { 0x00A02D, "1394 Trade Association" },

11785 { 0x00A02E, "BRAND COMMUNICATIONS, LTD." },

11786 { 0x00A02F, "ADB Broadband Italia" },

11787 { 0x00A030, "CAPTOR NV/SA" },

11788 { 0x00A031, "HAZELTINE CORPORATION, MS 1-17" },

11789 { 0x00A032, "GES SINGAPORE PTE. LTD." },

11790 { 0x00A033, "imc MeBsysteme GmbH" },

11791 { 0x00A034, "AXEL" },

11792 { 0x00A035, "CYLINK CORPORATION" },

11793 { 0x00A036, "APPLIED NETWORK TECHNOLOGY" },

11794 { 0x00A037, "Mindray DS USA, Inc." },

11795 { 0x00A038, "EMAIL ELECTRONICS" },

11796 { 0x00A039, "ROSS TECHNOLOGY, INC." },

11797 { 0x00A03A, "KUBOTEK CORPORATION" },

11798 { 0x00A03B, "TOSHIN ELECTRIC CO., LTD." },

11799 { 0x00A03C, "EG&G NUCLEAR INSTRUMENTS" },

11800 { 0x00A03D, "OPTO-22" },

11801 { 0x00A03E, "ATM FORUM" },

11802 { 0x00A03F, "COMPUTER SOCIETY MICROPROCESSOR & MICROPROCESSOR STANDARDS C" },

11803 { 0x00A040, "Apple, Inc." },

11804 { 0x00A041, "INFICON" },

11805 { 0x00A042, "SPUR PRODUCTS CORP." },

11806 { 0x00A043, "AMERICAN TECHNOLOGY LABS, INC." },

11807 { 0x00A044, "NTT IT CO., LTD." },

11808 { 0x00A045, "PHOENIX CONTACT Electronics GmbH" },

11809 { 0x00A046, "SCITEX CORP. LTD." },

11810 { 0x00A047, "INTEGRATED FITNESS CORP." },

11811 { 0x00A048, "QUESTECH, LTD." },

11812 { 0x00A049, "DIGITECH INDUSTRIES, INC." },

11813 { 0x00A04A, "NISSHIN ELECTRIC CO., LTD." },

11814 { 0x00A04B, "TFL LAN INC." },

11815 { 0x00A04C, "INNOVATIVE SYSTEMS & TECHNOLOGIES, INC." },

11816 { 0x00A04D, "EDA INSTRUMENTS, INC." },

11817 { 0x00A04E, "VOELKER TECHNOLOGIES, INC." },

11818 { 0x00A04F, "AMERITEC CORP." },

11819 { 0x00A050, "CYPRESS SEMICONDUCTOR" },

11820 { 0x00A051, "ANGIA COMMUNICATIONS. INC." },

11821 { 0x00A052, "STANILITE ELECTRONICS PTY. LTD" },

11822 { 0x00A053, "COMPACT DEVICES, INC." },

11823 { 0x00A054, "Private" },

11824 { 0x00A055, "Data Device Corporation" },

11825 { 0x00A056, "MICROPROSS" },

11826 { 0x00A057, "LANCOM Systems GmbH" },

11827 { 0x00A058, "GLORY, LTD." },

11828 { 0x00A059, "HAMILTON HALLMARK" },

11829 { 0x00A05A, "KOFAX IMAGE PRODUCTS" },

11830 { 0x00A05B, "MARQUIP, INC." },

11831 { 0x00A05C, "INVENTORY CONVERSION, INC./" },

11832 { 0x00A05D, "CS COMPUTER SYSTEME GmbH" },

11833 { 0x00A05E, "MYRIAD LOGIC INC." },

11834 { 0x00A05F, "BTG Electronics Design BV" },

11835 { 0x00A060, "ACER PERIPHERALS, INC." },

11836 { 0x00A061, "PURITAN BENNETT" },

11837 { 0x00A062, "AES PRODATA" },

11838 { 0x00A063, "JRL SYSTEMS, INC." },

11839 { 0x00A064, "KVB/ANALECT" },

11840 { 0x00A065, "Symantec Corporation" },

11841 { 0x00A066, "ISA CO., LTD." },

11842 { 0x00A067, "NETWORK SERVICES GROUP" },

11843 { 0x00A068, "BHP LIMITED" },

11844 { 0x00A069, "Symmetricom, Inc." },

11845 { 0x00A06A, "Verilink Corporation" },

11846 { 0x00A06B, "DMS DORSCH MIKROSYSTEM GMBH" },

11847 { 0x00A06C, "SHINDENGEN ELECTRIC MFG. CO., LTD." },

11848 { 0x00A06D, "MANNESMANN TALLY CORPORATION" },

11849 { 0x00A06E, "AUSTRON, INC." },

11850 { 0x00A06F, "Color Sentinel Systems, LLC" },

11851 { 0x00A070, "COASTCOM" },

11852 { 0x00A071, "VIDEO LOTTERY TECHNOLOGIES,INC" },

11853 { 0x00A072, "OVATION SYSTEMS LTD." },

11854 { 0x00A073, "COM21, INC." },

11855 { 0x00A074, "PERCEPTION TECHNOLOGY" },

11856 { 0x00A075, "MICRON TECHNOLOGY, INC." },

11857 { 0x00A076, "CARDWARE LAB, INC." },

11858 { 0x00A077, "FUJITSU NEXION, INC." },

11859 { 0x00A078, "Marconi Communications" },

11860 { 0x00A079, "ALPS ELECTRIC (USA), INC." },

11861 { 0x00A07A, "ADVANCED PERIPHERALS TECHNOLOGIES, INC." },

11862 { 0x00A07B, "DAWN COMPUTER INCORPORATION" },

11863 { 0x00A07C, "TONYANG NYLON CO., LTD." },

11864 { 0x00A07D, "SEEQ TECHNOLOGY, INC." },

11865 { 0x00A07E, "AVID TECHNOLOGY, INC." },

11866 { 0x00A07F, "GSM-SYNTEL, LTD." },

11867 { 0x00A080, "Tattile SRL" },

11868 { 0x00A081, "ALCATEL DATA NETWORKS" },

11869 { 0x00A082, "NKT ELEKTRONIK A/S" },

11870 { 0x00A083, "ASIMMPHONY TURKEY" },

11871 { 0x00A084, "Dataplex Pty Ltd" },

11872 { 0x00A085, "Private" },

11873 { 0x00A086, "AMBER WAVE SYSTEMS, INC." },

11874 { 0x00A087, "Microsemi Corporation" },

11875 { 0x00A088, "ESSENTIAL COMMUNICATIONS" },

11876 { 0x00A089, "XPOINT TECHNOLOGIES, INC." },

11877 { 0x00A08A, "BROOKTROUT TECHNOLOGY, INC." },

11878 { 0x00A08B, "ASTON ELECTRONIC DESIGNS LTD." },

11879 { 0x00A08C, "MultiMedia LANs, Inc." },

11880 { 0x00A08D, "JACOMO CORPORATION" },

11881 { 0x00A08E, "Check Point Software Technologies" },

11882 { 0x00A08F, "DESKNET SYSTEMS, INC." },

11883 { 0x00A090, "TimeStep Corporation" },

11884 { 0x00A091, "APPLICOM INTERNATIONAL" },

11885 { 0x00A092, "H. BOLLMANN MANUFACTURERS, LTD" },

11886 { 0x00A093, "B/E AEROSPACE, Inc." },

11887 { 0x00A094, "COMSAT CORPORATION" },

11888 { 0x00A095, "ACACIA NETWORKS, INC." },

11889 { 0x00A096, "MITSUMI ELECTRIC CO.,LTD." },

11890 { 0x00A097, "JC INFORMATION SYSTEMS" },

11891 { 0x00A098, "NetApp" },

11892 { 0x00A099, "K-NET LTD." },

11893 { 0x00A09A, "NIHON KOHDEN AMERICA" },

11894 { 0x00A09B, "QPSX COMMUNICATIONS, LTD." },

11895 { 0x00A09C, "Xyplex, Inc." },

11896 { 0x00A09D, "JOHNATHON FREEMAN TECHNOLOGIES" },

11897 { 0x00A09E, "ICTV" },

11898 { 0x00A09F, "COMMVISION CORP." },

11899 { 0x00A0A0, "COMPACT DATA, LTD." },

11900 { 0x00A0A1, "EPIC DATA INC." },

11901 { 0x00A0A2, "B810 S.R.L." },

11902 { 0x00A0A3, "RELIABLE POWER METERS" },

11903 { 0x00A0A4, "Oracle Corporation" },

11904 { 0x00A0A5, "TEKNOR MICROSYSTEME, INC." },

11905 { 0x00A0A6, "M.I. SYSTEMS, K.K." },

11906 { 0x00A0A7, "VORAX CORPORATION" },

11907 { 0x00A0A8, "RENEX CORPORATION" },

11908 { 0x00A0A9, "NAVTEL COMMUNICATIONS INC." },

11909 { 0x00A0AA, "SPACELABS MEDICAL" },

11910 { 0x00A0AB, "NETCS INFORMATIONSTECHNIK GMBH" },

11911 { 0x00A0AC, "GILAT SATELLITE NETWORKS, LTD." },

11912 { 0x00A0AD, "MARCONI SPA" },

11913 { 0x00A0AE, "NUCOM SYSTEMS, INC." },

11914 { 0x00A0AF, "WMS INDUSTRIES" },

11915 { 0x00A0B0, "I-O DATA DEVICE,INC." },

11916 { 0x00A0B1, "FIRST VIRTUAL CORPORATION" },

11917 { 0x00A0B2, "SHIMA SEIKI" },

11918 { 0x00A0B3, "ZYKRONIX" },

11919 { 0x00A0B4, "TEXAS MICROSYSTEMS, INC." },

11920 { 0x00A0B5, "3H TECHNOLOGY" },

11921 { 0x00A0B6, "SANRITZ AUTOMATION CO., LTD." },

11922 { 0x00A0B7, "CORDANT, INC." },

11923 { 0x00A0B8, "NetApp" },

11924 { 0x00A0B9, "EAGLE TECHNOLOGY, INC." },

11925 { 0x00A0BA, "PATTON ELECTRONICS CO." },

11926 { 0x00A0BB, "HILAN GMBH" },

11927 { 0x00A0BC, "VIASAT, INCORPORATED" },

11928 { 0x00A0BD, "I-TECH CORP." },

11929 { 0x00A0BE, "INTEGRATED CIRCUIT SYSTEMS, INC. COMMUNICATIONS GROUP" },

11930 { 0x00A0BF, "WIRELESS DATA GROUP MOTOROLA" },

11931 { 0x00A0C0, "DIGITAL LINK CORP." },

11932 { 0x00A0C1, "ORTIVUS MEDICAL AB" },

11933 { 0x00A0C2, "R.A. SYSTEMS CO., LTD." },

11934 { 0x00A0C3, "UNICOMPUTER GMBH" },

11935 { 0x00A0C4, "CRISTIE ELECTRONICS LTD." },

11936 { 0x00A0C5, "Zyxel Communications Corporation" },

11937 { 0x00A0C6, "Qualcomm Inc." },

11938 { 0x00A0C7, "TADIRAN TELECOMMUNICATIONS" },

11939 { 0x00A0C8, "Adtran Inc" },

11940 { 0x00A0C9, "Intel Corporation" },

11941 { 0x00A0CA, "FUJITSU DENSO LTD." },

11942 { 0x00A0CB, "ARK TELECOMMUNICATIONS, INC." },

11943 { 0x00A0CC, "LITE-ON COMMUNICATIONS, INC." },

11944 { 0x00A0CD, "DR. JOHANNES HEIDENHAIN GmbH" },

11945 { 0x00A0CE, "Ecessa" },

11946 { 0x00A0CF, "SOTAS, INC." },

11947 { 0x00A0D0, "TEN X TECHNOLOGY, INC." },

11948 { 0x00A0D1, "INVENTEC CORPORATION" },

11949 { 0x00A0D2, "ALLIED TELESIS INTERNATIONAL CORPORATION" },

11950 { 0x00A0D3, "INSTEM COMPUTER SYSTEMS, LTD." },

11951 { 0x00A0D4, "RADIOLAN, INC." },

11952 { 0x00A0D5, "Sierra Wireless, ULC" },

11953 { 0x00A0D6, "SBE, Inc." },

11954 { 0x00A0D7, "KASTEN CHASE APPLIED RESEARCH" },

11955 { 0x00A0D8, "SPECTRA - TEK" },

11956 { 0x00A0D9, "CONVEX COMPUTER CORPORATION" },

11957 { 0x00A0DA, "INTEGRATED SYSTEMS Technology, Inc." },

11958 { 0x00A0DB, "FISHER & PAYKEL PRODUCTION" },

11959 { 0x00A0DC, "O.N. ELECTRONIC CO., LTD." },

11960 { 0x00A0DD, "AZONIX CORPORATION" },

11961 { 0x00A0DE, "YAMAHA CORPORATION" },

11962 { 0x00A0DF, "STS TECHNOLOGIES, INC." },

11963 { 0x00A0E0, "TENNYSON TECHNOLOGIES PTY LTD" },

11964 { 0x00A0E1, "WESTPORT RESEARCH ASSOCIATES, INC." },

11965 { 0x00A0E2, "Keisokugiken Corporation" },

11966 { 0x00A0E3, "XKL SYSTEMS CORP." },

11967 { 0x00A0E4, "OPTIQUEST" },

11968 { 0x00A0E5, "NHC COMMUNICATIONS" },

11969 { 0x00A0E6, "DIALOGIC CORPORATION" },

11970 { 0x00A0E7, "CENTRAL DATA CORPORATION" },

11971 { 0x00A0E8, "REUTERS HOLDINGS PLC" },

11972 { 0x00A0E9, "ELECTRONIC RETAILING SYSTEMS INTERNATIONAL" },

11973 { 0x00A0EA, "ETHERCOM CORP." },

11974 { 0x00A0EB, "Encore Networks, Inc." },

11975 { 0x00A0EC, "TRANSMITTON LTD." },

11976 { 0x00A0ED, "Brooks Automation, Inc." },

11977 { 0x00A0EE, "NASHOBA NETWORKS" },

11978 { 0x00A0EF, "LUCIDATA LTD." },

11979 { 0x00A0F0, "TORONTO MICROELECTRONICS INC." },

11980 { 0x00A0F1, "MTI" },

11981 { 0x00A0F2, "INFOTEK COMMUNICATIONS, INC." },

11982 { 0x00A0F3, "STAUBLI" },

11983 { 0x00A0F4, "GE" },

11984 { 0x00A0F5, "RADGUARD LTD." },

11985 { 0x00A0F6, "AutoGas Systems Inc." },

11986 { 0x00A0F7, "V.I COMPUTER CORP." },

11987 { 0x00A0F8, "Zebra Technologies Inc" },

11988 { 0x00A0F9, "BINTEC COMMUNICATIONS GMBH" },

11989 { 0x00A0FA, "Marconi Communication GmbH" },

11990 { 0x00A0FB, "Toray Engineering D Solutions Co., Ltd." },

11991 { 0x00A0FC, "IMAGE SCIENCES, INC." },

11992 { 0x00A0FD, "SCITEX DIGITAL PRINTING, INC." },

11993 { 0x00A0FE, "BOSTON TECHNOLOGY, INC." },

11994 { 0x00A0FF, "TELLABS OPERATIONS, INC." },

11995 { 0x00A1DE, "ShenZhen ShiHua Technology CO.,LTD" },

11996 { 0x00A265, "M2Motive Technology Inc." },

11997 { 0x00A289, "Cisco Systems, Inc" },

11998 { 0x00A2DA, "INAT GmbH" },

11999 { 0x00A2EE, "Cisco Systems, Inc" },

12000 { 0x00A2F5, "Guangzhou Yuanyun Network Technology Co.,Ltd" },

12001 { 0x00A2FF, "abatec group AG" },

12002 { 0x00A388, "SKY UK LIMITED" },

12003 { 0x00A38E, "Cisco Systems, Inc" },

12004 { 0x00A3D1, "Cisco Systems, Inc" },

12005 { 0x00A45F, "Huawei Device Co., Ltd." },

12006 { 0x00A509, "WigWag Inc." },

12007 { 0x00A554, "Intel Corporate" },

12008 { 0x00A5BF, "Cisco Systems, Inc" },

12009 { 0x00A6CA, "Cisco Systems, Inc" },

12010 { 0x00A742, "Cisco Systems, Inc" },

12011 { 0x00A784, "ITX security" },

12012 { 0x00AA00, "Intel Corporation" },

12013 { 0x00AA01, "Intel Corporation" },

12014 { 0x00AA02, "Intel Corporation" },

12015 { 0x00AA3C, "OLIVETTI TELECOM SPA (OLTECO)" },

12016 { 0x00AA6E, "Cisco Systems, Inc" },

12017 { 0x00AA70, "LG Electronics (Mobile Communications)" },

12018 { 0x00AB48, "eero inc." },

12019 { 0x00ACE0, "ARRIS Group, Inc." },

12020 { 0x00AD24, "D-Link International" },

12021 { 0x00AD63, "Dedicated Micros Malta LTD" },

12022 { 0x00ADD5, "Huawei Device Co., Ltd." },

12023 { 0x00AECD, "Pensando Systems" },

12024 { 0x00AEFA, "Murata Manufacturing Co., Ltd." },

12025 { 0x00AF1F, "Cisco Systems, Inc" },

12026 { 0x00B009, "Grass Valley, A Belden Brand" },

12027 { 0x00B017, "InfoGear Technology Corp." },

12028 { 0x00B019, "UTC CCS" },

12029 { 0x00B01C, "Westport Technologies" },

12030 { 0x00B01E, "Rantic Labs, Inc." },

12031 { 0x00B02A, "ORSYS GmbH" },

12032 { 0x00B02D, "ViaGate Technologies, Inc." },

12033 { 0x00B033, "OAO Izhevskiy radiozavod" },

12034 { 0x00B03B, "HiQ Networks" },

12035 { 0x00B048, "Marconi Communications Inc." },

12036 { 0x00B04A, "Cisco Systems, Inc" },

12037 { 0x00B052, "Atheros Communications" },

12038 { 0x00B064, "Cisco Systems, Inc" },

12039 { 0x00B069, "Honewell Oy" },

12040 { 0x00B06D, "Jones Futurex Inc." },

12041 { 0x00B080, "Mannesmann Ipulsys B.V." },

12042 { 0x00B086, "LocSoft Limited" },

12043 { 0x00B08E, "Cisco Systems, Inc" },

12044 { 0x00B091, "Transmeta Corp." },

12045 { 0x00B094, "Alaris, Inc." },

12046 { 0x00B09A, "Morrow Technologies Corp." },

12047 { 0x00B09D, "Point Grey Research Inc." },

12048 { 0x00B0AC, "SIAE-Microelettronica S.p.A." },

12049 { 0x00B0AE, "Symmetricom" },

12050 { 0x00B0B3, "XSTREAMIS PLC" },

12051 { 0x00B0C2, "Cisco Systems, Inc" },

12052 { 0x00B0C7, "Tellabs Operations, Inc." },

12053 { 0x00B0CE, "Viveris Technologies" },

12054 { 0x00B0D0, "Dell Inc." },

12055 { 0x00B0DB, "Nextcell, Inc." },

12056 { 0x00B0DF, "Starboard Storage Systems" },

12057 { 0x00B0E1, "Cisco Systems, Inc" },

12058 { 0x00B0E7, "British Federal Ltd." },

12059 { 0x00B0EC, "EACEM" },

12060 { 0x00B0EE, "Ajile Systems, Inc." },

12061 { 0x00B0F0, "CALY NETWORKS" },

12062 { 0x00B0F5, "NetWorth Technologies, Inc." },

12063 { 0x00B1E3, "Cisco Systems, Inc" },

12064 { 0x00B338, "Kontron Asia Pacific Design Sdn. Bhd" },

12065 { 0x00B342, "MacroSAN Technologies Co., Ltd." },

12066 { 0x00B362, "Apple, Inc." },

12067 { 0x00B4F5, "DongGuan Siyoto Electronics Co., Ltd" },

12068 { 0x00B56D, "David Electronics Co., LTD." },

12069 { 0x00B5D0, "Samsung Electronics Co.,Ltd" },

12070 { 0x00B5D6, "Omnibit Inc." },

12071 { 0x00B600, "VOIM Co., Ltd." },

12072 { 0x00B670, "Cisco Systems, Inc" },

12073 { 0x00B69F, "Latch" },

12074 { 0x00B771, "Cisco Systems, Inc" },

12075 { 0x00B78D, "Nanjing Shining Electric Automation Co., Ltd" },

12076 { 0x00B7A8, "Heinzinger electronic GmbH" },

12077 { 0x00B810, "Yichip Microelectronics (Hangzhou) Co.,Ltd" },

12078 { 0x00B881, "New platforms LLC" },

12079 { 0x00B8B3, "Cisco Systems, Inc" },

12080 { 0x00B8B6, "Motorola Mobility LLC, a Lenovo Company" },

12081 { 0x00B8C2, "Heights Telecom T ltd" },

12082 { 0x00B9F6, "Shenzhen Super Rich Electronics Co.,Ltd" },

12083 { 0x00BAC0, "Biometric Access Company" },

12084 { 0x00BB01, "OCTOTHORPE CORP." },

12085 { 0x00BB1C, "Huawei Device Co., Ltd." },

12086 { 0x00BB3A, "Amazon Technologies Inc." },

12087 { 0x00BB60, "Intel Corporate" },

12088 { 0x00BB8E, "HME Co., Ltd." },

12089 { 0x00BBC1, "CANON INC." },

12090 { 0x00BBF0, "UNGERMANN-BASS INC." },

12091 { 0x00BC60, "Cisco Systems, Inc" },

12092 { 0x00BD27, "Exar Corp." },

12093 { 0x00BD3A, "Nokia Corporation" },

12094 { 0x00BD3E, "Vizio, Inc" },

12095 { 0x00BD82, "Shenzhen YOUHUA Technology Co., Ltd" },

12096 { 0x00BE3B, "HUAWEI TECHNOLOGIES CO.,LTD" },

12097 { 0x00BE43, "Dell Inc." },

12098 { 0x00BE75, "Cisco Systems, Inc" },

12099 { 0x00BE9E, "Fiberhome Telecommunication Technologies Co.,LTD" },

12100 { 0x00BED5, "New H3C Technologies Co., Ltd" },

12101 { 0x00BF15, "Genetec Inc." },

12102 { 0x00BF61, "Samsung Electronics Co.,Ltd" },

12103 { 0x00BF77, "Cisco Systems, Inc" },

12104 { 0x00BFAF, "Hui Zhou Gaoshengda Technology Co.,LTD" },

12105 { 0x00C000, "LANOPTICS, LTD." },

12106 { 0x00C001, "DIATEK PATIENT MANAGMENT" },

12107 { 0x00C002, "Sercomm Corporation." },

12108 { 0x00C003, "GLOBALNET COMMUNICATIONS" },

12109 { 0x00C004, "JAPAN BUSINESS COMPUTER CO.LTD" },

12110 { 0x00C005, "LIVINGSTON ENTERPRISES, INC." },

12111 { 0x00C006, "NIPPON AVIONICS CO., LTD." },

12112 { 0x00C007, "PINNACLE DATA SYSTEMS, INC." },

12113 { 0x00C008, "SECO SRL" },

12114 { 0x00C009, "KT TECHNOLOGY (S) PTE LTD" },

12115 { 0x00C00A, "MICRO CRAFT" },

12116 { 0x00C00B, "NORCONTROL A.S." },

12117 { 0x00C00C, "RELIA TECHNOLGIES" },

12118 { 0x00C00D, "ADVANCED LOGIC RESEARCH, INC." },

12119 { 0x00C00E, "PSITECH, INC." },

12120 { 0x00C00F, "QUANTUM SOFTWARE SYSTEMS LTD." },

12121 { 0x00C010, "HIRAKAWA HEWTECH CORP." },

12122 { 0x00C011, "INTERACTIVE COMPUTING DEVICES" },

12123 { 0x00C012, "NETSPAN CORPORATION" },

12124 { 0x00C013, "NETRIX" },

12125 { 0x00C014, "TELEMATICS CALABASAS INT'L,INC" },

12126 { 0x00C015, "NEW MEDIA CORPORATION" },

12127 { 0x00C016, "ELECTRONIC THEATRE CONTROLS" },

12128 { 0x00C017, "NetAlly" },

12129 { 0x00C018, "LANART CORPORATION" },

12130 { 0x00C019, "LEAP TECHNOLOGY, INC." },

12131 { 0x00C01A, "COROMETRICS MEDICAL SYSTEMS" },

12132 { 0x00C01B, "SOCKET COMMUNICATIONS, INC." },

12133 { 0x00C01C, "INTERLINK COMMUNICATIONS LTD." },

12134 { 0x00C01D, "GRAND JUNCTION NETWORKS, INC." },

12135 { 0x00C01E, "LA FRANCAISE DES JEUX" },

12136 { 0x00C01F, "S.E.R.C.E.L." },

12137 { 0x00C020, "ARCO ELECTRONIC, CONTROL LTD." },

12138 { 0x00C021, "NETEXPRESS" },

12139 { 0x00C022, "LASERMASTER TECHNOLOGIES, INC." },

12140 { 0x00C023, "TUTANKHAMON ELECTRONICS" },

12141 { 0x00C024, "EDEN SISTEMAS DE COMPUTACAO SA" },

12142 { 0x00C025, "DATAPRODUCTS CORPORATION" },

12143 { 0x00C026, "LANS TECHNOLOGY CO., LTD." },

12144 { 0x00C027, "CIPHER SYSTEMS, INC." },

12145 { 0x00C028, "JASCO CORPORATION" },

12146 { 0x00C029, "Nexans Deutschland GmbH - ANS" },

12147 { 0x00C02A, "OHKURA ELECTRIC CO., LTD." },

12148 { 0x00C02B, "GERLOFF GESELLSCHAFT FUR" },

12149 { 0x00C02C, "CENTRUM COMMUNICATIONS, INC." },

12150 { 0x00C02D, "FUJI PHOTO FILM CO., LTD." },

12151 { 0x00C02E, "NETWIZ" },

12152 { 0x00C02F, "OKUMA CORPORATION" },

12153 { 0x00C030, "INTEGRATED ENGINEERING B. V." },

12154 { 0x00C031, "DESIGN RESEARCH SYSTEMS, INC." },

12155 { 0x00C032, "I-CUBED LIMITED" },

12156 { 0x00C033, "TELEBIT COMMUNICATIONS APS" },

12157 { 0x00C034, "TRANSACTION NETWORK" },

12158 { 0x00C035, "QUINTAR COMPANY" },

12159 { 0x00C036, "RAYTECH ELECTRONIC CORP." },

12160 { 0x00C037, "DYNATEM" },

12161 { 0x00C038, "RASTER IMAGE PROCESSING SYSTEM" },

12162 { 0x00C039, "Teridian Semiconductor Corporation" },

12163 { 0x00C03A, "duagon Germany GmbH" },

12164 { 0x00C03B, "MULTIACCESS COMPUTING CORP." },

12165 { 0x00C03C, "TOWER TECH S.R.L." },

12166 { 0x00C03D, "WIESEMANN & THEIS GMBH" },

12167 { 0x00C03E, "FA. GEBR. HELLER GMBH" },

12168 { 0x00C03F, "STORES AUTOMATED SYSTEMS, INC." },

12169 { 0x00C040, "ECCI" },

12170 { 0x00C041, "DIGITAL TRANSMISSION SYSTEMS" },

12171 { 0x00C042, "DATALUX CORP." },

12172 { 0x00C043, "STRATACOM" },

12173 { 0x00C044, "EMCOM CORPORATION" },

12174 { 0x00C045, "ISOLATION SYSTEMS, LTD." },

12175 { 0x00C046, "Blue Chip Technology Ltd" },

12176 { 0x00C047, "UNIMICRO SYSTEMS, INC." },

12177 { 0x00C048, "BAY TECHNICAL ASSOCIATES" },

12178 { 0x00C049, "U.S. ROBOTICS, INC." },

12179 { 0x00C04A, "GROUP 2000 AG" },

12180 { 0x00C04B, "CREATIVE MICROSYSTEMS" },

12181 { 0x00C04C, "DEPARTMENT OF FOREIGN AFFAIRS" },

12182 { 0x00C04D, "MITEC, INC." },

12183 { 0x00C04E, "COMTROL CORPORATION" },

12184 { 0x00C04F, "Dell Inc." },

12185 { 0x00C050, "TOYO DENKI SEIZO K.K." },

12186 { 0x00C051, "ADVANCED INTEGRATION RESEARCH" },

12187 { 0x00C052, "BURR-BROWN" },

12188 { 0x00C053, "Aspect Software Inc." },

12189 { 0x00C054, "NETWORK PERIPHERALS, LTD." },

12190 { 0x00C055, "MODULAR COMPUTING TECHNOLOGIES" },

12191 { 0x00C056, "SOMELEC" },

12192 { 0x00C057, "MYCO ELECTRONICS" },

12193 { 0x00C058, "DATAEXPERT CORP." },

12194 { 0x00C059, "DENSO CORPORATION" },

12195 { 0x00C05A, "SEMAPHORE COMMUNICATIONS CORP." },

12196 { 0x00C05B, "NETWORKS NORTHWEST, INC." },

12197 { 0x00C05C, "ELONEX PLC" },

12198 { 0x00C05D, "L&N TECHNOLOGIES" },

12199 { 0x00C05E, "VARI-LITE, INC." },

12200 { 0x00C05F, "FINE-PAL COMPANY LIMITED" },

12201 { 0x00C060, "ID SCANDINAVIA AS" },

12202 { 0x00C061, "SOLECTEK CORPORATION" },

12203 { 0x00C062, "IMPULSE TECHNOLOGY" },

12204 { 0x00C063, "MORNING STAR TECHNOLOGIES, INC" },

12205 { 0x00C064, "General Datacomm LLC" },

12206 { 0x00C065, "SCOPE COMMUNICATIONS, INC." },

12207 { 0x00C066, "DOCUPOINT, INC." },

12208 { 0x00C067, "UNITED BARCODE INDUSTRIES" },

12209 { 0x00C068, "HME Clear-Com LTD." },

12210 { 0x00C069, "Axxcelera Broadband Wireless" },

12211 { 0x00C06A, "Zahner-Elektrik Ingeborg Zahner-Schiller GmbH & Co. KG." },

12212 { 0x00C06B, "OSI PLUS CORPORATION" },

12213 { 0x00C06C, "SVEC COMPUTER CORP." },

12214 { 0x00C06D, "BOCA RESEARCH, INC." },

12215 { 0x00C06E, "HAFT TECHNOLOGY, INC." },

12216 { 0x00C06F, "KOMATSU LTD." },

12217 { 0x00C070, "SECTRA SECURE-TRANSMISSION AB" },

12218 { 0x00C071, "AREANEX COMMUNICATIONS, INC." },

12219 { 0x00C072, "KNX LTD." },

12220 { 0x00C073, "XEDIA CORPORATION" },

12221 { 0x00C074, "TOYODA AUTOMATIC LOOM" },

12222 { 0x00C075, "XANTE CORPORATION" },

12223 { 0x00C076, "I-DATA INTERNATIONAL A-S" },

12224 { 0x00C077, "DAEWOO TELECOM LTD." },

12225 { 0x00C078, "COMPUTER SYSTEMS ENGINEERING" },

12226 { 0x00C079, "FONSYS CO.,LTD." },

12227 { 0x00C07A, "PRIVA B.V." },

12228 { 0x00C07B, "ASCEND COMMUNICATIONS, INC." },

12229 { 0x00C07C, "HIGHTECH INFORMATION" },

12230 { 0x00C07D, "RISC DEVELOPMENTS LTD." },

12231 { 0x00C07E, "KUBOTA CORPORATION ELECTRONIC" },

12232 { 0x00C07F, "NUPON COMPUTING CORP." },

12233 { 0x00C080, "NETSTAR, INC." },

12234 { 0x00C081, "METRODATA LTD." },

12235 { 0x00C082, "MOORE PRODUCTS CO." },

12236 { 0x00C083, "TRACE MOUNTAIN PRODUCTS, INC." },

12237 { 0x00C084, "DATA LINK CORP. LTD." },

12238 { 0x00C085, "ELECTRONICS FOR IMAGING, INC." },

12239 { 0x00C086, "THE LYNK CORPORATION" },

12240 { 0x00C087, "UUNET TECHNOLOGIES, INC." },

12241 { 0x00C088, "EKF ELEKTRONIK GMBH" },

12242 { 0x00C089, "TELINDUS DISTRIBUTION" },

12243 { 0x00C08A, "Lauterbach GmbH" },

12244 { 0x00C08B, "RISQ MODULAR SYSTEMS, INC." },

12245 { 0x00C08C, "PERFORMANCE TECHNOLOGIES, INC." },

12246 { 0x00C08D, "TRONIX PRODUCT DEVELOPMENT" },

12247 { 0x00C08E, "NETWORK INFORMATION TECHNOLOGY" },

12248 { 0x00C08F, "Panasonic Electric Works Co., Ltd." },

12249 { 0x00C090, "PRAIM S.R.L." },

12250 { 0x00C091, "JABIL CIRCUIT, INC." },

12251 { 0x00C092, "MENNEN MEDICAL INC." },

12252 { 0x00C093, "ALTA RESEARCH CORP." },

12253 { 0x00C094, "VMX INC." },

12254 { 0x00C095, "ZNYX Networks, Inc." },

12255 { 0x00C096, "TAMURA CORPORATION" },

12256 { 0x00C097, "ARCHIPEL SA" },

12257 { 0x00C098, "CHUNTEX ELECTRONIC CO., LTD." },

12258 { 0x00C099, "YOSHIKI INDUSTRIAL CO.,LTD." },

12259 { 0x00C09A, "PHOTONICS CORPORATION" },

12260 { 0x00C09B, "Tellabs Enterprise, Inc." },

12261 { 0x00C09C, "HIOKI E.E. CORPORATION" },

12262 { 0x00C09D, "DISTRIBUTED SYSTEMS INT'L, INC" },

12263 { 0x00C09E, "CACHE COMPUTERS, INC." },

12264 { 0x00C09F, "Quanta Computer Inc." },

12265 { 0x00C0A0, "ADVANCE MICRO RESEARCH, INC." },

12266 { 0x00C0A1, "TOKYO DENSHI SEKEI CO." },

12267 { 0x00C0A2, "INTERMEDIUM A/S" },

12268 { 0x00C0A3, "DUAL ENTERPRISES CORPORATION" },

12269 { 0x00C0A4, "UNIGRAF OY" },

12270 { 0x00C0A5, "DICKENS DATA SYSTEMS" },

12271 { 0x00C0A6, "EXICOM AUSTRALIA PTY. LTD" },

12272 { 0x00C0A7, "SEEL LTD." },

12273 { 0x00C0A8, "GVC CORPORATION" },

12274 { 0x00C0A9, "BARRON MCCANN LTD." },

12275 { 0x00C0AA, "SILICON VALLEY COMPUTER" },

12276 { 0x00C0AB, "Telco Systems, Inc." },

12277 { 0x00C0AC, "GAMBIT COMPUTER COMMUNICATIONS" },

12278 { 0x00C0AD, "MARBEN COMMUNICATION SYSTEMS" },

12279 { 0x00C0AE, "TOWERCOM CO. INC. DBA PC HOUSE" },

12280 { 0x00C0AF, "TEKLOGIX INC." },

12281 { 0x00C0B0, "GCC TECHNOLOGIES,INC." },

12282 { 0x00C0B1, "GENIUS NET CO." },

12283 { 0x00C0B2, "NORAND CORPORATION" },

12284 { 0x00C0B3, "COMSTAT DATACOMM CORPORATION" },

12285 { 0x00C0B4, "MYSON TECHNOLOGY, INC." },

12286 { 0x00C0B5, "CORPORATE NETWORK SYSTEMS,INC." },

12287 { 0x00C0B6, "HVE, Inc." },

12288 { 0x00C0B7, "AMERICAN POWER CONVERSION CORP" },

12289 { 0x00C0B8, "FRASER'S HILL LTD." },

12290 { 0x00C0B9, "FUNK SOFTWARE, INC." },

12291 { 0x00C0BA, "NETVANTAGE" },

12292 { 0x00C0BB, "FORVAL CREATIVE, INC." },

12293 { 0x00C0BC, "TELECOM AUSTRALIA/CSSC" },

12294 { 0x00C0BD, "INEX TECHNOLOGIES, INC." },

12295 { 0x00C0BE, "ALCATEL - SEL" },

12296 { 0x00C0BF, "TECHNOLOGY CONCEPTS, LTD." },

12297 { 0x00C0C0, "SHORE MICROSYSTEMS, INC." },

12298 { 0x00C0C1, "QUAD/GRAPHICS, INC." },

12299 { 0x00C0C2, "INFINITE NETWORKS LTD." },

12300 { 0x00C0C3, "ACUSON COMPUTED SONOGRAPHY" },

12301 { 0x00C0C4, "COMPUTER OPERATIONAL" },

12302 { 0x00C0C5, "SID INFORMATICA" },

12303 { 0x00C0C6, "PERSONAL MEDIA CORP." },

12304 { 0x00C0C7, "SPARKTRUM MICROSYSTEMS, INC." },

12305 { 0x00C0C8, "MICRO BYTE PTY. LTD." },

12306 { 0x00C0C9, "ELSAG BAILEY PROCESS" },

12307 { 0x00C0CA, "ALFA, INC." },

12308 { 0x00C0CB, "CONTROL TECHNOLOGY CORPORATION" },

12309 { 0x00C0CC, "TELESCIENCES CO SYSTEMS, INC." },

12310 { 0x00C0CD, "COMELTA, S.A." },

12311 { 0x00C0CE, "CEI SYSTEMS & ENGINEERING PTE" },

12312 { 0x00C0CF, "IMATRAN VOIMA OY" },

12313 { 0x00C0D0, "RATOC SYSTEM INC." },

12314 { 0x00C0D1, "COMTREE TECHNOLOGY CORPORATION" },

12315 { 0x00C0D2, "SYNTELLECT, INC." },

12316 { 0x00C0D3, "OLYMPUS IMAGE SYSTEMS, INC." },

12317 { 0x00C0D4, "AXON NETWORKS, INC." },

12318 { 0x00C0D5, "Werbeagentur Jürgen Siebert" },

12319 { 0x00C0D6, "J1 SYSTEMS, INC." },

12320 { 0x00C0D7, "TAIWAN TRADING CENTER DBA" },

12321 { 0x00C0D8, "UNIVERSAL DATA SYSTEMS" },

12322 { 0x00C0D9, "QUINTE NETWORK CONFIDENTIALITY" },

12323 { 0x00C0DA, "NICE SYSTEMS LTD." },

12324 { 0x00C0DB, "IPC CORPORATION (PTE) LTD." },

12325 { 0x00C0DC, "EOS TECHNOLOGIES, INC." },

12326 { 0x00C0DD, "QLogic Corporation" },

12327 { 0x00C0DE, "ZCOMM, INC." },

12328 { 0x00C0DF, "KYE Systems Corp." },

12329 { 0x00C0E0, "DSC COMMUNICATION CORP." },

12330 { 0x00C0E1, "SONIC SOLUTIONS" },

12331 { 0x00C0E2, "CALCOMP, INC." },

12332 { 0x00C0E3, "OSITECH COMMUNICATIONS, INC." },

12333 { 0x00C0E4, "SIEMENS BUILDING" },

12334 { 0x00C0E5, "GESPAC, S.A." },

12335 { 0x00C0E6, "Verilink Corporation" },

12336 { 0x00C0E7, "FIBERDATA AB" },

12337 { 0x00C0E8, "PLEXCOM, INC." },

12338 { 0x00C0E9, "OAK SOLUTIONS, LTD." },

12339 { 0x00C0EA, "ARRAY TECHNOLOGY LTD." },

12340 { 0x00C0EB, "SEH COMPUTERTECHNIK GMBH" },

12341 { 0x00C0EC, "DAUPHIN TECHNOLOGY" },

12342 { 0x00C0ED, "US ARMY ELECTRONIC" },

12343 { 0x00C0EE, "KYOCERA Display Corporation" },

12344 { 0x00C0EF, "ABIT CORPORATION" },

12345 { 0x00C0F0, "Kingston Technology Company, Inc." },

12346 { 0x00C0F1, "SHINKO ELECTRIC CO., LTD." },

12347 { 0x00C0F2, "Lantronix" },

12348 { 0x00C0F3, "NETWORK COMMUNICATIONS CORP." },

12349 { 0x00C0F4, "INTERLINK SYSTEM CO., LTD." },

12350 { 0x00C0F5, "METACOMP, INC." },

12351 { 0x00C0F6, "CELAN TECHNOLOGY INC." },

12352 { 0x00C0F7, "ENGAGE COMMUNICATION, INC." },

12353 { 0x00C0F8, "ABOUT COMPUTING INC." },

12354 { 0x00C0F9, "Artesyn Embedded Technologies" },

12355 { 0x00C0FA, "CANARY COMMUNICATIONS, INC." },

12356 { 0x00C0FB, "ADVANCED TECHNOLOGY LABS" },

12357 { 0x00C0FC, "ELASTIC REALITY, INC." },

12358 { 0x00C0FD, "PROSUM" },

12359 { 0x00C0FE, "APTEC COMPUTER SYSTEMS, INC." },

12360 { 0x00C0FF, "Seagate Cloud Systems Inc" },

12361 { 0x00C14F, "DDL Co,.ltd." },

12362 { 0x00C164, "Cisco Systems, Inc" },

12363 { 0x00C1B1, "Cisco Systems, Inc" },

12364 { 0x00C28F, "Allied Telesis K.K." },

12365 { 0x00C2C6, "Intel Corporate" },

12366 { 0x00C30A, "Xiaomi Communications Co Ltd" },

12367 { 0x00C343, "E-T-A Circuit Breakers Ltd" },

12368 { 0x00C3F4, "Samsung Electronics Co.,Ltd" },

12369 { 0x00C52C, "Juniper Networks" },

12370 { 0x00C585, "Apple, Inc." },

12371 { 0x00C5DB, "Datatech Sistemas Digitales Avanzados SL" },

12372 { 0x00C610, "Apple, Inc." },

12373 { 0x00C711, "ITEL MOBILE LIMITED" },

12374 { 0x00C88B, "Cisco Systems, Inc" },

12375 { 0x00C896, "CIG SHANGHAI CO LTD" },

12376 { 0x00CAE0, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

12377 { 0x00CAE5, "Cisco Systems, Inc" },

12378 { 0x00CB00, "Private" },

12379 { 0x00CB51, "Sagemcom Broadband SAS" },

12380 { 0x00CB7A, "Vantiva USA LLC" },

12381 { 0x00CBB4, "SHENZHEN ATEKO PHOTOELECTRICITY CO.,LTD" },

12382 { 0x00CBBD, "Cambridge Broadband Networks Group" },

12383 { 0x00CC34, "Juniper Networks" },

12384 { 0x00CC3F, "Universal Electronics, Inc." },

12385 { 0x00CCFC, "Cisco Systems, Inc" },

12386 { 0x00CD90, "MAS Elektronik AG" },

12387 { 0x00CDFE, "Apple, Inc." },

12388 { 0x00CE30, "Express LUCK Industrial Ltd." },

12389 { 0x00CF1C, "Communication Machinery Corporation" },

12390 { 0x00CFC0, "China Mobile Group Device Co.,Ltd." },

12391 { 0x00D000, "FERRAN SCIENTIFIC, INC." },

12392 { 0x00D001, "VST TECHNOLOGIES, INC." },

12393 { 0x00D002, "DITECH CORPORATION" },

12394 { 0x00D003, "COMDA ENTERPRISES CORP." },

12395 { 0x00D004, "PENTACOM LTD." },

12396 { 0x00D005, "ZHS ZEITMANAGEMENTSYSTEME" },

12397 { 0x00D006, "Cisco Systems, Inc" },

12398 { 0x00D007, "MIC ASSOCIATES, INC." },

12399 { 0x00D008, "MACTELL CORPORATION" },

12400 { 0x00D009, "HSING TECH. ENTERPRISE CO. LTD" },

12401 { 0x00D00A, "LANACCESS TELECOM S.A." },

12402 { 0x00D00B, "RHK TECHNOLOGY, INC." },

12403 { 0x00D00C, "SNIJDER MICRO SYSTEMS" },

12404 { 0x00D00D, "MICROMERITICS INSTRUMENT" },

12405 { 0x00D00E, "PLURIS, INC." },

12406 { 0x00D00F, "SPEECH DESIGN GMBH" },

12407 { 0x00D010, "CONVERGENT NETWORKS, INC." },

12408 { 0x00D011, "PRISM VIDEO, INC." },

12409 { 0x00D012, "GATEWORKS CORP." },

12410 { 0x00D013, "PRIMEX AEROSPACE COMPANY" },

12411 { 0x00D014, "ROOT, INC." },

12412 { 0x00D015, "UNIVEX MICROTECHNOLOGY CORP." },

12413 { 0x00D016, "SCM MICROSYSTEMS, INC." },

12414 { 0x00D017, "SYNTECH INFORMATION CO., LTD." },

12415 { 0x00D018, "QWES. COM, INC." },

12416 { 0x00D019, "DAINIPPON SCREEN CORPORATE" },

12417 { 0x00D01A, "URMET TLC S.P.A." },

12418 { 0x00D01B, "MIMAKI ENGINEERING CO., LTD." },

12419 { 0x00D01C, "SBS TECHNOLOGIES," },

12420 { 0x00D01D, "FURUNO ELECTRIC CO., LTD." },

12421 { 0x00D01E, "PINGTEL CORP." },

12422 { 0x00D01F, "Senetas Corporation Ltd" },

12423 { 0x00D020, "AIM SYSTEM, INC." },

12424 { 0x00D021, "REGENT ELECTRONICS CORP." },

12425 { 0x00D022, "INCREDIBLE TECHNOLOGIES, INC." },

12426 { 0x00D023, "INFORTREND TECHNOLOGY, INC." },

12427 { 0x00D024, "Cognex Corporation" },

12428 { 0x00D025, "XROSSTECH, INC." },

12429 { 0x00D026, "HIRSCHMANN AUSTRIA GMBH" },

12430 { 0x00D027, "APPLIED AUTOMATION, INC." },

12431 { 0x00D028, "Harmonic, Inc" },

12432 { 0x00D029, "WAKEFERN FOOD CORPORATION" },

12433 { 0x00D02A, "Voxent Systems Ltd." },

12434 { 0x00D02B, "JETCELL, INC." },

12435 { 0x00D02C, "CAMPBELL SCIENTIFIC, INC." },

12436 { 0x00D02D, "Resideo" },

12437 { 0x00D02E, "COMMUNICATION AUTOMATION CORP." },

12438 { 0x00D02F, "VLSI TECHNOLOGY INC." },

12439 { 0x00D030, "Safetran Systems Corp" },

12440 { 0x00D031, "INDUSTRIAL LOGIC CORPORATION" },

12441 { 0x00D032, "YANO ELECTRIC CO., LTD." },

12442 { 0x00D033, "DALIAN DAXIAN NETWORK" },

12443 { 0x00D034, "ORMEC SYSTEMS CORP." },

12444 { 0x00D035, "BEHAVIOR TECH. COMPUTER CORP." },

12445 { 0x00D036, "TECHNOLOGY ATLANTA CORP." },

12446 { 0x00D037, "ARRIS Group, Inc." },

12447 { 0x00D038, "FIVEMERE, LTD." },

12448 { 0x00D039, "UTILICOM, INC." },

12449 { 0x00D03A, "ZONEWORX, INC." },

12450 { 0x00D03B, "VISION PRODUCTS PTY. LTD." },

12451 { 0x00D03C, "Vieo, Inc." },

12452 { 0x00D03D, "GALILEO TECHNOLOGY, LTD." },

12453 { 0x00D03E, "ROCKETCHIPS, INC." },

12454 { 0x00D03F, "AMERICAN COMMUNICATION" },

12455 { 0x00D040, "SYSMATE CO., LTD." },

12456 { 0x00D041, "AMIGO TECHNOLOGY CO., LTD." },

12457 { 0x00D042, "MAHLO GMBH & CO. UG" },

12458 { 0x00D043, "ZONAL RETAIL DATA SYSTEMS" },

12459 { 0x00D044, "ALIDIAN NETWORKS, INC." },

12460 { 0x00D045, "KVASER AB" },

12461 { 0x00D046, "DOLBY LABORATORIES, INC." },

12462 { 0x00D047, "XN TECHNOLOGIES" },

12463 { 0x00D048, "ECTON, INC." },

12464 { 0x00D049, "IMPRESSTEK CO., LTD." },

12465 { 0x00D04A, "PRESENCE TECHNOLOGY GMBH" },

12466 { 0x00D04B, "LA CIE GROUP S.A." },

12467 { 0x00D04C, "Eseye Design Ltd" },

12468 { 0x00D04D, "DIV OF RESEARCH & STATISTICS" },

12469 { 0x00D04E, "LOGIBAG" },

12470 { 0x00D04F, "BITRONICS, INC." },

12471 { 0x00D050, "Iskratel d.o.o." },

12472 { 0x00D051, "O2 MICRO, INC." },

12473 { 0x00D052, "ASCEND COMMUNICATIONS, INC." },

12474 { 0x00D053, "CONNECTED SYSTEMS" },

12475 { 0x00D054, "SAS INSTITUTE INC." },

12476 { 0x00D055, "KATHREIN-WERKE KG" },

12477 { 0x00D056, "SOMAT CORPORATION" },

12478 { 0x00D057, "ULTRAK, INC." },

12479 { 0x00D058, "Cisco Systems, Inc" },

12480 { 0x00D059, "AMBIT MICROSYSTEMS CORP." },

12481 { 0x00D05A, "SYMBIONICS, LTD." },

12482 { 0x00D05B, "ACROLOOP MOTION CONTROL" },

12483 { 0x00D05C, "KATHREIN TechnoTrend GmbH" },

12484 { 0x00D05D, "INTELLIWORXX, INC." },

12485 { 0x00D05E, "STRATABEAM TECHNOLOGY, INC." },

12486 { 0x00D05F, "VALCOM, INC." },

12487 { 0x00D060, "Panasonic Europe Ltd." },

12488 { 0x00D061, "TREMON ENTERPRISES CO., LTD." },

12489 { 0x00D062, "DIGIGRAM" },

12490 { 0x00D063, "Cisco Systems, Inc" },

12491 { 0x00D064, "MULTITEL" },

12492 { 0x00D065, "TOKO ELECTRIC" },

12493 { 0x00D066, "WINTRISS ENGINEERING CORP." },

12494 { 0x00D067, "CAMPIO COMMUNICATIONS" },

12495 { 0x00D068, "IWILL CORPORATION" },

12496 { 0x00D069, "TECHNOLOGIC SYSTEMS" },

12497 { 0x00D06A, "LINKUP SYSTEMS CORPORATION" },

12498 { 0x00D06B, "SR TELECOM INC." },

12499 { 0x00D06C, "SHAREWAVE, INC." },

12500 { 0x00D06D, "ACRISON, INC." },

12501 { 0x00D06E, "TRENDVIEW RECORDERS LTD." },

12502 { 0x00D06F, "KMC CONTROLS" },

12503 { 0x00D070, "LONG WELL ELECTRONICS CORP." },

12504 { 0x00D071, "ECHELON CORP." },

12505 { 0x00D072, "BROADLOGIC" },

12506 { 0x00D073, "ACN ADVANCED COMMUNICATIONS" },

12507 { 0x00D074, "TAQUA SYSTEMS, INC." },

12508 { 0x00D075, "ALARIS MEDICAL SYSTEMS, INC." },

12509 { 0x00D076, "Bank of America" },

12510 { 0x00D077, "LUCENT TECHNOLOGIES" },

12511 { 0x00D078, "Eltex of Sweden AB" },

12512 { 0x00D079, "Cisco Systems, Inc" },

12513 { 0x00D07A, "AMAQUEST COMPUTER CORP." },

12514 { 0x00D07B, "COMCAM INTERNATIONAL INC" },

12515 { 0x00D07C, "JTEKT ELECTRONICS CORPORATION" },

12516 { 0x00D07D, "COSINE COMMUNICATIONS" },

12517 { 0x00D07E, "KEYCORP LTD." },

12518 { 0x00D07F, "STRATEGY & TECHNOLOGY, LIMITED" },

12519 { 0x00D080, "EXABYTE CORPORATION" },

12520 { 0x00D081, "RTD Embedded Technologies, Inc." },

12521 { 0x00D082, "IOWAVE INC." },

12522 { 0x00D083, "INVERTEX, INC." },

12523 { 0x00D084, "NEXCOMM SYSTEMS, INC." },

12524 { 0x00D085, "OTIS ELEVATOR COMPANY" },

12525 { 0x00D086, "FOVEON, INC." },

12526 { 0x00D087, "MICROFIRST INC." },

12527 { 0x00D088, "ARRIS Group, Inc." },

12528 { 0x00D089, "DYNACOLOR, INC." },

12529 { 0x00D08A, "PHOTRON USA" },

12530 { 0x00D08B, "ADVA Optical Networking Ltd." },

12531 { 0x00D08C, "GENOA TECHNOLOGY, INC." },

12532 { 0x00D08D, "PHOENIX GROUP, INC." },

12533 { 0x00D08E, "Grass Valley, A Belden Brand" },

12534 { 0x00D08F, "ARDENT TECHNOLOGIES, INC." },

12535 { 0x00D090, "Cisco Systems, Inc" },

12536 { 0x00D091, "SMARTSAN SYSTEMS, INC." },

12537 { 0x00D092, "GLENAYRE WESTERN MULTIPLEX" },

12538 { 0x00D093, "TQ - COMPONENTS GMBH" },

12539 { 0x00D094, "Seeion Control LLC" },

12540 { 0x00D095, "Alcatel-Lucent Enterprise" },

12541 { 0x00D096, "3COM EUROPE LTD" },

12542 { 0x00D097, "Cisco Systems, Inc" },

12543 { 0x00D098, "Photon Dynamics Canada Inc." },

12544 { 0x00D099, "Elcard Wireless Systems Oy" },

12545 { 0x00D09A, "FILANET CORPORATION" },

12546 { 0x00D09B, "SPECTEL LTD." },

12547 { 0x00D09C, "KAPADIA COMMUNICATIONS" },

12548 { 0x00D09D, "VERIS INDUSTRIES" },

12549 { 0x00D09E, "2Wire Inc" },

12550 { 0x00D09F, "NOVTEK TEST SYSTEMS" },

12551 { 0x00D0A0, "MIPS DENMARK" },

12552 { 0x00D0A1, "OSKAR VIERLING GMBH + CO. KG" },

12553 { 0x00D0A2, "INTEGRATED DEVICE" },

12554 { 0x00D0A3, "VOCAL DATA, INC." },

12555 { 0x00D0A4, "ALANTRO COMMUNICATIONS" },

12556 { 0x00D0A5, "AMERICAN ARIUM" },

12557 { 0x00D0A6, "LANBIRD TECHNOLOGY CO., LTD." },

12558 { 0x00D0A7, "TOKYO SOKKI KENKYUJO CO., LTD." },

12559 { 0x00D0A8, "NETWORK ENGINES, INC." },

12560 { 0x00D0A9, "SHINANO KENSHI CO., LTD." },

12561 { 0x00D0AA, "CHASE COMMUNICATIONS" },

12562 { 0x00D0AB, "DELTAKABEL TELECOM CV" },

12563 { 0x00D0AC, "Commscope, Inc" },

12564 { 0x00D0AD, "TL INDUSTRIES" },

12565 { 0x00D0AE, "ORESIS COMMUNICATIONS, INC." },

12566 { 0x00D0AF, "CUTLER-HAMMER, INC." },

12567 { 0x00D0B0, "BITSWITCH LTD." },

12568 { 0x00D0B1, "OMEGA ELECTRONICS SA" },

12569 { 0x00D0B2, "Xiotech Corporation" },

12570 { 0x00D0B3, "DRS Technologies Canada Ltd" },

12571 { 0x00D0B4, "KATSUJIMA CO., LTD." },

12572 { 0x00D0B5, "IPricot formerly DotCom" },

12573 { 0x00D0B6, "CRESCENT NETWORKS, INC." },

12574 { 0x00D0B7, "Intel Corporation" },

12575 { 0x00D0B8, "Iomega Corporation" },

12576 { 0x00D0B9, "MICROTEK INTERNATIONAL, INC." },

12577 { 0x00D0BA, "Cisco Systems, Inc" },

12578 { 0x00D0BB, "Cisco Systems, Inc" },

12579 { 0x00D0BC, "Cisco Systems, Inc" },

12580 { 0x00D0BD, "Lattice Semiconductor Corp. (LPA)" },

12581 { 0x00D0BE, "EMUTEC INC." },

12582 { 0x00D0BF, "PIVOTAL TECHNOLOGIES" },

12583 { 0x00D0C0, "Cisco Systems, Inc" },

12584 { 0x00D0C1, "HARMONIC DATA SYSTEMS, LTD." },

12585 { 0x00D0C2, "BALTHAZAR TECHNOLOGY AB" },

12586 { 0x00D0C3, "VIVID TECHNOLOGY PTE, LTD." },

12587 { 0x00D0C4, "TERATECH CORPORATION" },

12588 { 0x00D0C5, "COMPUTATIONAL SYSTEMS, INC." },

12589 { 0x00D0C6, "THOMAS & BETTS CORP." },

12590 { 0x00D0C7, "PATHWAY, INC." },

12591 { 0x00D0C8, "Prevas A/S" },

12592 { 0x00D0C9, "ADVANTECH CO., LTD." },

12593 { 0x00D0CA, "Intrinsyc Software International Inc." },

12594 { 0x00D0CB, "DASAN CO., LTD." },

12595 { 0x00D0CC, "TECHNOLOGIES LYRE INC." },

12596 { 0x00D0CD, "ATAN TECHNOLOGY INC." },

12597 { 0x00D0CE, "iSystem Labs" },

12598 { 0x00D0CF, "MORETON BAY" },

12599 { 0x00D0D0, "ZHONGXING TELECOM LTD." },

12600 { 0x00D0D1, "Sycamore Networks" },

12601 { 0x00D0D2, "EPILOG CORPORATION" },

12602 { 0x00D0D3, "Cisco Systems, Inc" },

12603 { 0x00D0D4, "V-BITS, INC." },

12604 { 0x00D0D5, "GRUNDIG AG" },

12605 { 0x00D0D6, "AETHRA TELECOMUNICAZIONI" },

12606 { 0x00D0D7, "B2C2, INC." },

12607 { 0x00D0D8, "3COM" },

12608 { 0x00D0D9, "DEDICATED MICROCOMPUTERS" },

12609 { 0x00D0DA, "TAICOM DATA SYSTEMS CO., LTD." },

12610 { 0x00D0DB, "MCQUAY INTERNATIONAL" },

12611 { 0x00D0DC, "MODULAR MINING SYSTEMS, INC." },

12612 { 0x00D0DD, "SUNRISE TELECOM, INC." },

12613 { 0x00D0DE, "PHILIPS MULTIMEDIA NETWORK" },

12614 { 0x00D0DF, "KUZUMI ELECTRONICS, INC." },

12615 { 0x00D0E0, "DOOIN ELECTRONICS CO." },

12616 { 0x00D0E1, "AVIONITEK ISRAEL INC." },

12617 { 0x00D0E2, "MRT MICRO, INC." },

12618 { 0x00D0E3, "ELE-CHEM ENGINEERING CO., LTD." },

12619 { 0x00D0E4, "Cisco Systems, Inc" },

12620 { 0x00D0E5, "SOLIDUM SYSTEMS CORP." },

12621 { 0x00D0E6, "IBOND INC." },

12622 { 0x00D0E7, "VCON TELECOMMUNICATION LTD." },

12623 { 0x00D0E8, "MAC SYSTEM CO., LTD." },

12624 { 0x00D0E9, "Advantage Century Telecommunication Corp." },

12625 { 0x00D0EA, "NEXTONE COMMUNICATIONS, INC." },

12626 { 0x00D0EB, "LIGHTERA NETWORKS, INC." },

12627 { 0x00D0EC, "NAKAYO Inc" },

12628 { 0x00D0ED, "XIOX" },

12629 { 0x00D0EE, "DICTAPHONE CORPORATION" },

12630 { 0x00D0EF, "IGT" },

12631 { 0x00D0F0, "CONVISION TECHNOLOGY GMBH" },

12632 { 0x00D0F1, "SEGA ENTERPRISES, LTD." },

12633 { 0x00D0F2, "MONTEREY NETWORKS" },

12634 { 0x00D0F3, "SOLARI DI UDINE SPA" },

12635 { 0x00D0F4, "CARINTHIAN TECH INSTITUTE" },

12636 { 0x00D0F5, "ORANGE MICRO, INC." },

12637 { 0x00D0F6, "Nokia" },

12638 { 0x00D0F7, "NEXT NETS CORPORATION" },

12639 { 0x00D0F8, "FUJIAN STAR TERMINAL" },

12640 { 0x00D0F9, "ACUTE COMMUNICATIONS CORP." },

12641 { 0x00D0FA, "Thales e-Security Ltd." },

12642 { 0x00D0FB, "TEK MICROSYSTEMS, INCORPORATED" },

12643 { 0x00D0FC, "GRANITE MICROSYSTEMS" },

12644 { 0x00D0FD, "OPTIMA TELE.COM, INC." },

12645 { 0x00D0FE, "ASTRAL POINT" },

12646 { 0x00D0FF, "Cisco Systems, Inc" },

12647 { 0x00D11C, "ACETEL" },

12648 { 0x00D279, "VINGROUP JOINT STOCK COMPANY" },

12649 { 0x00D2B1, "TPV Display Technology (Xiamen) Co.,Ltd." },

12650 { 0x00D318, "SPG Controls" },

12651 { 0x00D38D, "Hotel Technology Next Generation" },

12652 { 0x00D49E, "Intel Corporate" },

12653 { 0x00D598, "BOPEL MOBILE TECHNOLOGY CO.,LIMITED" },

12654 { 0x00D632, "GE Energy" },

12655 { 0x00D6FE, "Cisco Systems, Inc" },

12656 { 0x00D76D, "Intel Corporate" },

12657 { 0x00D78F, "Cisco Systems, Inc" },

12658 { 0x00D861, "Micro-Star INTL CO., LTD." },

12659 { 0x00D8A2, "Huawei Device Co., Ltd." },

12660 { 0x00D9D1, "Sony Interactive Entertainment Inc." },

12661 { 0x00DA55, "Cisco Systems, Inc" },

12662 { 0x00DB1E, "Albedo Telecom SL" },

12663 { 0x00DB45, "THAMWAY CO.,LTD." },

12664 { 0x00DB70, "Apple, Inc." },

12665 { 0x00DBDF, "Intel Corporate" },

12666 { 0x00DCB2, "Extreme Networks Headquarters" },

12667 { 0x00DD00, "UNGERMANN-BASS INC." },

12668 { 0x00DD01, "UNGERMANN-BASS INC." },

12669 { 0x00DD02, "UNGERMANN-BASS INC." },

12670 { 0x00DD03, "UNGERMANN-BASS INC." },

12671 { 0x00DD04, "UNGERMANN-BASS INC." },

12672 { 0x00DD05, "UNGERMANN-BASS INC." },

12673 { 0x00DD06, "UNGERMANN-BASS INC." },

12674 { 0x00DD07, "UNGERMANN-BASS INC." },

12675 { 0x00DD08, "UNGERMANN-BASS INC." },

12676 { 0x00DD09, "UNGERMANN-BASS INC." },

12677 { 0x00DD0A, "UNGERMANN-BASS INC." },

12678 { 0x00DD0B, "UNGERMANN-BASS INC." },

12679 { 0x00DD0C, "UNGERMANN-BASS INC." },

12680 { 0x00DD0D, "UNGERMANN-BASS INC." },

12681 { 0x00DD0E, "UNGERMANN-BASS INC." },

12682 { 0x00DD0F, "UNGERMANN-BASS INC." },

12683 { 0x00DD25, "Shenzhen hechengdong Technology Co., Ltd" },

12684 { 0x00DDB6, "New H3C Technologies Co., Ltd" },

12685 { 0x00DEFB, "Cisco Systems, Inc" },

12686 { 0x00DF1D, "Cisco Systems, Inc" },

12687 { 0x00E000, "FUJITSU LIMITED" },

12688 { 0x00E001, "STRAND LIGHTING LIMITED" },

12689 { 0x00E002, "CROSSROADS SYSTEMS, INC." },

12690 { 0x00E003, "NOKIA WIRELESS BUSINESS COMMUN" },

12691 { 0x00E004, "PMC-SIERRA, INC." },

12692 { 0x00E005, "TECHNICAL CORP." },

12693 { 0x00E006, "SILICON INTEGRATED SYS. CORP." },

12694 { 0x00E007, "Avaya ECS Ltd" },

12695 { 0x00E008, "AMAZING CONTROLS! INC." },

12696 { 0x00E009, "Stratus Technologies" },

12697 { 0x00E00A, "DIBA, INC." },

12698 { 0x00E00B, "ROOFTOP COMMUNICATIONS CORP." },

12699 { 0x00E00C, "MOTOROLA" },

12700 { 0x00E00D, "RADIANT SYSTEMS" },

12701 { 0x00E00E, "AVALON IMAGING SYSTEMS, INC." },

12702 { 0x00E00F, "Shanghai Baud Data Communication Co.,Ltd." },

12703 { 0x00E010, "HESS SB-AUTOMATENBAU GmbH" },

12704 { 0x00E011, "UNIDEN CORPORATION" },

12705 { 0x00E012, "PLUTO TECHNOLOGIES INTERNATIONAL INC." },

12706 { 0x00E013, "EASTERN ELECTRONIC CO., LTD." },

12707 { 0x00E014, "Cisco Systems, Inc" },

12708 { 0x00E015, "HEIWA CORPORATION" },

12709 { 0x00E016, "RAPID CITY COMMUNICATIONS" },

12710 { 0x00E017, "EXXACT GmbH" },

12711 { 0x00E018, "ASUSTek COMPUTER INC." },

12712 { 0x00E019, "ING. GIORDANO ELETTRONICA" },

12713 { 0x00E01A, "COMTEC SYSTEMS. CO., LTD." },

12714 { 0x00E01B, "SPHERE COMMUNICATIONS, INC." },

12715 { 0x00E01C, "CradlePoint, Inc" },

12716 { 0x00E01D, "WebTV NETWORKS, INC." },

12717 { 0x00E01E, "Cisco Systems, Inc" },

12718 { 0x00E01F, "AVIDIA Systems, Inc." },

12719 { 0x00E020, "TECNOMEN OY" },

12720 { 0x00E021, "FREEGATE CORP." },

12721 { 0x00E022, "Analog Devices, Inc." },

12722 { 0x00E023, "TELRAD" },

12723 { 0x00E024, "GADZOOX NETWORKS" },

12724 { 0x00E025, "dit Co., Ltd." },

12725 { 0x00E026, "Redlake MASD LLC" },

12726 { 0x00E027, "DUX, INC." },

12727 { 0x00E028, "APTIX CORPORATION" },

12728 { 0x00E029, "STANDARD MICROSYSTEMS CORP." },

12729 { 0x00E02A, "TANDBERG TELEVISION AS" },

12730 { 0x00E02B, "Extreme Networks Headquarters" },

12731 { 0x00E02C, "AST COMPUTER" },

12732 { 0x00E02D, "InnoMediaLogic, Inc." },

12733 { 0x00E02E, "SPC ELECTRONICS CORPORATION" },

12734 { 0x00E02F, "MCNS HOLDINGS, L.P." },

12735 { 0x00E030, "MELITA INTERNATIONAL CORP." },

12736 { 0x00E031, "HAGIWARA ELECTRIC CO., LTD." },

12737 { 0x00E032, "MISYS FINANCIAL SYSTEMS, LTD." },

12738 { 0x00E033, "E.E.P.D. GmbH" },

12739 { 0x00E034, "Cisco Systems, Inc" },

12740 { 0x00E035, "Artesyn Embedded Technologies" },

12741 { 0x00E036, "PIONEER CORPORATION" },

12742 { 0x00E037, "CENTURY CORPORATION" },

12743 { 0x00E038, "PROXIMA CORPORATION" },

12744 { 0x00E039, "PARADYNE CORP." },

12745 { 0x00E03A, "Cabletron Systems, Inc." },

12746 { 0x00E03B, "PROMINET CORPORATION" },

12747 { 0x00E03C, "AdvanSys" },

12748 { 0x00E03D, "FOCON ELECTRONIC SYSTEMS A/S" },

12749 { 0x00E03E, "ALFATECH, INC." },

12750 { 0x00E03F, "JATON CORPORATION" },

12751 { 0x00E040, "DeskStation Technology, Inc." },

12752 { 0x00E041, "CSPI" },

12753 { 0x00E042, "Pacom Systems Ltd." },

12754 { 0x00E043, "VitalCom" },

12755 { 0x00E044, "LSICS CORPORATION" },

12756 { 0x00E045, "TOUCHWAVE, INC." },

12757 { 0x00E046, "BENTLY NEVADA CORP." },

12758 { 0x00E047, "InFocus Corporation" },

12759 { 0x00E048, "SDL COMMUNICATIONS, INC." },

12760 { 0x00E049, "MICROWI ELECTRONIC GmbH" },

12761 { 0x00E04A, "ZX Technologies, Inc" },

12762 { 0x00E04B, "JUMP INDUSTRIELLE COMPUTERTECHNIK GmbH" },

12763 { 0x00E04C, "REALTEK SEMICONDUCTOR CORP." },

12764 { 0x00E04D, "INTERNET INITIATIVE JAPAN, INC" },

12765 { 0x00E04E, "SANYO DENKI CO., LTD." },

12766 { 0x00E04F, "Cisco Systems, Inc" },

12767 { 0x00E050, "EXECUTONE INFORMATION SYSTEMS, INC." },

12768 { 0x00E051, "TALX CORPORATION" },

12769 { 0x00E052, "Brocade Communications Systems LLC" },

12770 { 0x00E053, "CELLPORT LABS, INC." },

12771 { 0x00E054, "KODAI HITEC CO., LTD." },

12772 { 0x00E055, "INGENIERIA ELECTRONICA COMERCIAL INELCOM S.A." },

12773 { 0x00E056, "HOLONTECH CORPORATION" },

12774 { 0x00E057, "HAN MICROTELECOM. CO., LTD." },

12775 { 0x00E058, "PHASE ONE DENMARK A/S" },

12776 { 0x00E059, "CONTROLLED ENVIRONMENTS, LTD." },

12777 { 0x00E05A, "GALEA NETWORK SECURITY" },

12778 { 0x00E05B, "WEST END SYSTEMS CORP." },

12779 { 0x00E05C, "PHC Corporation" },

12780 { 0x00E05D, "UNITEC CO., LTD." },

12781 { 0x00E05E, "JAPAN AVIATION ELECTRONICS INDUSTRY, LTD." },

12782 { 0x00E05F, "e-Net, Inc." },

12783 { 0x00E060, "SHERWOOD" },

12784 { 0x00E061, "EdgePoint Networks, Inc." },

12785 { 0x00E062, "HOST ENGINEERING" },

12786 { 0x00E063, "Cabletron Systems, Inc." },

12787 { 0x00E064, "SAMSUNG ELECTRONICS" },

12788 { 0x00E065, "OPTICAL ACCESS INTERNATIONAL" },

12789 { 0x00E066, "ProMax Systems, Inc." },

12790 { 0x00E067, "eac AUTOMATION-CONSULTING GmbH" },

12791 { 0x00E068, "MERRIMAC SYSTEMS INC." },

12792 { 0x00E069, "JAYCOR" },

12793 { 0x00E06A, "KAPSCH AG" },

12794 { 0x00E06B, "W&G SPECIAL PRODUCTS" },

12795 { 0x00E06C, "Ultra Electronics Command & Control Systems" },

12796 { 0x00E06D, "COMPUWARE CORPORATION" },

12797 { 0x00E06E, "FAR SYSTEMS S.p.A." },

12798 { 0x00E06F, "ARRIS Group, Inc." },

12799 { 0x00E070, "DH TECHNOLOGY" },

12800 { 0x00E071, "EPIS MICROCOMPUTER" },

12801 { 0x00E072, "LYNK" },

12802 { 0x00E073, "NATIONAL AMUSEMENT NETWORK, INC." },

12803 { 0x00E074, "TIERNAN COMMUNICATIONS, INC." },

12804 { 0x00E075, "Verilink Corporation" },

12805 { 0x00E076, "DEVELOPMENT CONCEPTS, INC." },

12806 { 0x00E077, "WEBGEAR, INC." },

12807 { 0x00E078, "BERKELEY NETWORKS" },

12808 { 0x00E079, "A.T.N.R." },

12809 { 0x00E07A, "MIKRODIDAKT AB" },

12810 { 0x00E07B, "BAY NETWORKS" },

12811 { 0x00E07C, "METTLER-TOLEDO, INC." },

12812 { 0x00E07D, "NETRONIX, INC." },

12813 { 0x00E07E, "WALT DISNEY IMAGINEERING" },

12814 { 0x00E07F, "LOGISTISTEM s.r.l." },

12815 { 0x00E080, "CONTROL RESOURCES CORPORATION" },

12816 { 0x00E081, "TYAN COMPUTER CORP." },

12817 { 0x00E082, "ANERMA" },

12818 { 0x00E083, "JATO TECHNOLOGIES, INC." },

12819 { 0x00E084, "COMPULITE R&D" },

12820 { 0x00E085, "GLOBAL MAINTECH, INC." },

12821 { 0x00E086, "Emerson Network Power, Avocent Division" },

12822 { 0x00E087, "LeCroy - Networking Productions Division" },

12823 { 0x00E088, "LTX-Credence CORPORATION" },

12824 { 0x00E089, "ION Networks, Inc." },

12825 { 0x00E08A, "GEC AVERY, LTD." },

12826 { 0x00E08B, "QLogic Corporation" },

12827 { 0x00E08C, "NEOPARADIGM LABS, INC." },

12828 { 0x00E08D, "PRESSURE SYSTEMS, INC." },

12829 { 0x00E08E, "UTSTARCOM" },

12830 { 0x00E08F, "Cisco Systems, Inc" },

12831 { 0x00E090, "BECKMAN LAB. AUTOMATION DIV." },

12832 { 0x00E091, "LG Electronics" },

12833 { 0x00E092, "ADMTEK INCORPORATED" },

12834 { 0x00E093, "ACKFIN NETWORKS" },

12835 { 0x00E094, "OSAI SRL" },

12836 { 0x00E095, "ADVANCED-VISION TECHNOLGIES CORP." },

12837 { 0x00E096, "SHIMADZU CORPORATION" },

12838 { 0x00E097, "CARRIER ACCESS CORPORATION" },

12839 { 0x00E098, "AboCom" },

12840 { 0x00E099, "SAMSON AG" },

12841 { 0x00E09A, "Positron Inc." },

12842 { 0x00E09B, "ENGAGE NETWORKS, INC." },

12843 { 0x00E09C, "MII" },

12844 { 0x00E09D, "SARNOFF CORPORATION" },

12845 { 0x00E09E, "Quantum Corporation" },

12846 { 0x00E09F, "PIXEL VISION" },

12847 { 0x00E0A0, "WILTRON CO." },

12848 { 0x00E0A1, "HIMA PAUL HILDEBRANDT GmbH Co. KG" },

12849 { 0x00E0A2, "MICROSLATE INC." },

12850 { 0x00E0A3, "Cisco Systems, Inc" },

12851 { 0x00E0A4, "ESAOTE S.p.A." },

12852 { 0x00E0A5, "ComCore Semiconductor, Inc." },

12853 { 0x00E0A6, "TELOGY NETWORKS, INC." },

12854 { 0x00E0A7, "IPC INFORMATION SYSTEMS, INC." },

12855 { 0x00E0A8, "SAT GmbH & Co." },

12856 { 0x00E0A9, "FUNAI ELECTRIC CO., LTD." },

12857 { 0x00E0AA, "ELECTROSONIC LTD." },

12858 { 0x00E0AB, "DIMAT S.A." },

12859 { 0x00E0AC, "MIDSCO, INC." },

12860 { 0x00E0AD, "EES TECHNOLOGY, LTD." },

12861 { 0x00E0AE, "XAQTI CORPORATION" },

12862 { 0x00E0AF, "GENERAL DYNAMICS INFORMATION SYSTEMS" },

12863 { 0x00E0B0, "Cisco Systems, Inc" },

12864 { 0x00E0B1, "Alcatel-Lucent Enterprise" },

12865 { 0x00E0B2, "TELMAX COMMUNICATIONS CORP." },

12866 { 0x00E0B3, "EtherWAN Systems, Inc." },

12867 { 0x00E0B4, "TECHNO SCOPE CO., LTD." },

12868 { 0x00E0B5, "ARDENT COMMUNICATIONS CORP." },

12869 { 0x00E0B6, "Entrada Networks" },

12870 { 0x00E0B7, "Cosworth Electronics Ltd" },

12871 { 0x00E0B8, "GATEWAY 2000" },

12872 { 0x00E0B9, "BYAS SYSTEMS" },

12873 { 0x00E0BA, "BERGHOF AUTOMATIONSTECHNIK GmbH" },

12874 { 0x00E0BB, "NBX CORPORATION" },

12875 { 0x00E0BC, "SYMON COMMUNICATIONS, INC." },

12876 { 0x00E0BD, "INTERFACE SYSTEMS, INC." },

12877 { 0x00E0BE, "GENROCO INTERNATIONAL, INC." },

12878 { 0x00E0BF, "TORRENT NETWORKING TECHNOLOGIES CORP." },

12879 { 0x00E0C0, "SEIWA ELECTRIC MFG. CO., LTD." },

12880 { 0x00E0C1, "MEMOREX TELEX JAPAN, LTD." },

12881 { 0x00E0C2, "NECSY S.p.A." },

12882 { 0x00E0C3, "SAKAI SYSTEM DEVELOPMENT CORP." },

12883 { 0x00E0C4, "HORNER ELECTRIC, INC." },

12884 { 0x00E0C5, "BCOM ELECTRONICS INC." },

12885 { 0x00E0C6, "LINK2IT, L.L.C." },

12886 { 0x00E0C7, "EUROTECH SRL" },

12887 { 0x00E0C8, "VIRTUAL ACCESS, LTD." },

12888 { 0x00E0C9, "AutomatedLogic Corporation" },

12889 { 0x00E0CA, "BEST DATA PRODUCTS" },

12890 { 0x00E0CB, "RESON, INC." },

12891 { 0x00E0CC, "HERO SYSTEMS, LTD." },

12892 { 0x00E0CD, "SAAB SENSIS CORPORATION" },

12893 { 0x00E0CE, "ARN" },

12894 { 0x00E0CF, "INTEGRATED DEVICE" },

12895 { 0x00E0D0, "NETSPEED, INC." },

12896 { 0x00E0D1, "TELSIS LIMITED" },

12897 { 0x00E0D2, "VERSANET COMMUNICATIONS, INC." },

12898 { 0x00E0D3, "DATENTECHNIK GmbH" },

12899 { 0x00E0D4, "EXCELLENT COMPUTER" },

12900 { 0x00E0D5, "Emulex Corporation" },

12901 { 0x00E0D6, "COMPUTER & COMMUNICATION RESEARCH LAB." },

12902 { 0x00E0D7, "SUNSHINE ELECTRONICS, INC." },

12903 { 0x00E0D8, "LANBit Computer, Inc." },

12904 { 0x00E0D9, "TAZMO CO., LTD." },

12905 { 0x00E0DA, "Alcatel-Lucent Enterprise" },

12906 { 0x00E0DB, "ViaVideo Communications, Inc." },

12907 { 0x00E0DC, "NEXWARE CORP." },

12908 { 0x00E0DD, "Zenith Electronics Corporation" },

12909 { 0x00E0DE, "DATAX NV" },

12910 { 0x00E0DF, "DZS Inc." },

12911 { 0x00E0E0, "SI ELECTRONICS, LTD." },

12912 { 0x00E0E1, "G2 NETWORKS, INC." },

12913 { 0x00E0E2, "INNOVA CORP." },

12914 { 0x00E0E3, "SK-ELEKTRONIK GMBH" },

12915 { 0x00E0E4, "FANUC ROBOTICS NORTH AMERICA, Inc." },

12916 { 0x00E0E5, "CINCO NETWORKS, INC." },

12917 { 0x00E0E6, "INCAA Computers" },

12918 { 0x00E0E7, "RAYTHEON E-SYSTEMS, INC." },

12919 { 0x00E0E8, "GRETACODER Data Systems AG" },

12920 { 0x00E0E9, "DATA LABS, INC." },

12921 { 0x00E0EA, "INNOVAT COMMUNICATIONS, INC." },

12922 { 0x00E0EB, "DIGICOM SYSTEMS, INCORPORATED" },

12923 { 0x00E0EC, "CELESTICA INC." },

12924 { 0x00E0ED, "SILICOM, LTD." },

12925 { 0x00E0EE, "MAREL HF" },

12926 { 0x00E0EF, "DIONEX" },

12927 { 0x00E0F0, "ABLER TECHNOLOGY, INC." },

12928 { 0x00E0F1, "THAT CORPORATION" },

12929 { 0x00E0F2, "ARLOTTO COMNET, INC." },

12930 { 0x00E0F3, "WebSprint Communications, Inc." },

12931 { 0x00E0F4, "INSIDE Technology A/S" },

12932 { 0x00E0F5, "TELES AG" },

12933 { 0x00E0F6, "DECISION EUROPE" },

12934 { 0x00E0F7, "Cisco Systems, Inc" },

12935 { 0x00E0F8, "DICNA CONTROL AB" },

12936 { 0x00E0F9, "Cisco Systems, Inc" },

12937 { 0x00E0FA, "TRL TECHNOLOGY, LTD." },

12938 { 0x00E0FB, "LEIGHTRONIX, INC." },

12939 { 0x00E0FC, "HUAWEI TECHNOLOGIES CO.,LTD" },

12940 { 0x00E0FD, "A-TREND TECHNOLOGY CO., LTD." },

12941 { 0x00E0FE, "Cisco Systems, Inc" },

12942 { 0x00E0FF, "SECURITY DYNAMICS TECHNOLOGIES, Inc." },

12943 { 0x00E16D, "Cisco Systems, Inc" },

12944 { 0x00E175, "AK-Systems Ltd" },

12945 { 0x00E18C, "Intel Corporate" },

12946 { 0x00E22C, "China Mobile Group Device Co.,Ltd." },

12947 { 0x00E3B2, "Samsung Electronics Co.,Ltd" },

12948 { 0x00E400, "Sichuan Changhong Electric Ltd." },

12949 { 0x00E406, "HUAWEI TECHNOLOGIES CO.,LTD" },

12950 { 0x00E421, "Sony Interactive Entertainment Inc." },

12951 { 0x00E5E4, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

12952 { 0x00E5F1, "BUFFALO.INC" },

12953 { 0x00E60E, "Extreme Networks Headquarters" },

12954 { 0x00E63A, "Ruckus Wireless" },

12955 { 0x00E666, "ARIMA Communications Corp." },

12956 { 0x00E6D3, "NIXDORF COMPUTER CORP." },

12957 { 0x00E6E8, "Netzin Technology Corporation,.Ltd." },

12958 { 0x00E7E3, "zte corporation" },

12959 { 0x00E8AB, "Meggitt Training Systems, Inc." },

12960 { 0x00E93A, "AzureWave Technology Inc." },

12961 { 0x00EABD, "Cisco Systems, Inc" },

12962 { 0x00EB2D, "Sony Corporation" },

12963 { 0x00EBD5, "Cisco Systems, Inc" },

12964 { 0x00EBD8, "MERCUSYS TECHNOLOGIES CO., LTD." },

12965 { 0x00EC0A, "Xiaomi Communications Co Ltd" },

12966 { 0x00EDB8, "KYOCERA Corporation" },

12967 { 0x00EE01, "Enablers Solucoes e Consultoria em Dispositivos" },

12968 { 0x00EEAB, "Cisco Systems, Inc" },

12969 { 0x00EEBD, "HTC Corporation" },

12970 { 0x00F051, "KWB Gmbh" },

12971 { 0x00F22C, "Shanghai B-star Technology Co.,Ltd." },

12972 { 0x00F28B, "Cisco Systems, Inc" },

12973 { 0x00F361, "Amazon Technologies Inc." },

12974 { 0x00F39F, "Apple, Inc." },

12975 { 0x00F3DB, "WOO Sports" },

12976 { 0x00F403, "Orbis Systems Oy" },

12977 { 0x00F46F, "Samsung Electronics Co.,Ltd" },

12978 { 0x00F48D, "Liteon Technology Corporation" },

12979 { 0x00F4B9, "Apple, Inc." },

12980 { 0x00F620, "Google, Inc." },

12981 { 0x00F663, "Cisco Systems, Inc" },

12982 { 0x00F76F, "Apple, Inc." },

12983 { 0x00F7AD, "HUAWEI TECHNOLOGIES CO.,LTD" },

12984 { 0x00F81C, "HUAWEI TECHNOLOGIES CO.,LTD" },

12985 { 0x00F82C, "Cisco Systems, Inc" },

12986 { 0x00F860, "PT. Panggung Electric Citrabuana" },

12987 { 0x00F871, "Demant A/S" },

12988 { 0x00F952, "HUAWEI TECHNOLOGIES CO.,LTD" },

12989 { 0x00FA21, "Samsung Electronics Co.,Ltd" },

12990 { 0x00FA3B, "CLOOS ELECTRONIC GMBH" },

12991 { 0x00FAB6, "Kontakt Micro-Location Sp z o.o." },

12992 { 0x00FBF9, "Axiado Corporation" },

12993 { 0x00FC58, "WebSilicon Ltd." },

12994 { 0x00FC70, "Intrepid Control Systems, Inc." },

12995 { 0x00FC8B, "Amazon Technologies Inc." },

12996 { 0x00FC8D, "Hitron Technologies. Inc" },

12997 { 0x00FCBA, "Cisco Systems, Inc" },

12998 { 0x00FD22, "Cisco Systems, Inc" },

12999 { 0x00FD45, "Hewlett Packard Enterprise" },

13000 { 0x00FD4C, "NEVATEC" },

13001 { 0x00FEC8, "Cisco Systems, Inc" },

13002 { 0x020701, "RACAL-DATACOM" },

13003 { 0x021C7C, "PERQ SYSTEMS CORPORATION" },

13004 { 0x026086, "LOGIC REPLACEMENT TECH. LTD." },

13005 { 0x02608C, "3COM" },

13006 { 0x027001, "RACAL-DATACOM" },

13007 { 0x0270B0, "M/A-COM INC. COMPANIES" },

13008 { 0x0270B3, "DATA RECALL LTD." },

13009 { 0x029D8E, "CARDIAC RECORDERS, INC." },

13010 { 0x02AA3C, "OLIVETTI TELECOMM SPA (OLTECO)" },

13011 { 0x02BB01, "OCTOTHORPE CORP." },

13012 { 0x02C08C, "3COM" },

13013 { 0x02CF1C, "Communication Machinery Corporation" },

13014 { 0x02E6D3, "NIXDORF COMPUTER CORP." },

13015 { 0x040067, "Stanley Black & Decker" },

13016 { 0x0401BB, "TECNO MOBILE LIMITED" },

13017 { 0x04021F, "HUAWEI TECHNOLOGIES CO.,LTD" },

13018 { 0x0402CA, "Shenzhen Vtsonic Co.,ltd" },

13019 { 0x040312, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

13020 { 0x0403D6, "Nintendo Co.,Ltd" },

13021 { 0x0404B8, "China Hualu Panasonic AVC Networks Co., LTD." },

13022 { 0x0404EA, "Valens Semiconductor Ltd." },

13023 { 0x0405DD, "Shenzhen Cultraview Digital Technology Co., Ltd" },

13024 { 0x04072E, "VTech Electronics Ltd." },

13025 { 0x040973, "Hewlett Packard Enterprise" },

13026 { 0x040986, "Arcadyan Corporation" },

13027 { 0x0409A5, "HFR, Inc." },

13028 { 0x040A83, "Alcatel-Lucent" },

13029 { 0x040AE0, "XMIT AG COMPUTER NETWORKS" },

13030 { 0x040CCE, "Apple, Inc." },

13031 { 0x040D84, "Silicon Laboratories" },

13032 { 0x040E3C, "HP Inc." },

13033 { 0x040EC2, "ViewSonic Mobile China Limited" },

13034 { 0x04106B, "Xiaomi Communications Co Ltd" },

13035 { 0x041119, "IEEE Registration Authority" },

13036 { 0x041471, "HUAWEI TECHNOLOGIES CO.,LTD" },

13037 { 0x041552, "Apple, Inc." },

13038 { 0x0415D9, "Viwone" },

13039 { 0x0417B6, "Smart Innovation LLC" },

13040 { 0x04180F, "Samsung Electronics Co.,Ltd" },

13041 { 0x041892, "HUAWEI TECHNOLOGIES CO.,LTD" },

13042 { 0x0418B6, "Private" },

13043 { 0x0418D6, "Ubiquiti Inc" },

13044 { 0x04197F, "Grasphere Japan" },

13045 { 0x041A04, "WaveIP" },

13046 { 0x041B6D, "LG Electronics (Mobile Communications)" },

13047 { 0x041B94, "Host Mobility AB" },

13048 { 0x041BBA, "Samsung Electronics Co.,Ltd" },

13049 { 0x041D10, "Dream Ware Inc." },

13050 { 0x041DC7, "zte corporation" },

13051 { 0x041E64, "Apple, Inc." },

13052 { 0x041E7A, "DSPWorks" },

13053 { 0x041EFA, "BISSELL Homecare, Inc." },

13054 { 0x042084, "zte corporation" },

13055 { 0x04209A, "Panasonic Corporation AVC Networks Company" },

13056 { 0x042144, "Sunitec Enterprise Co.,Ltd" },

13057 { 0x04214C, "Insight Energy Ventures LLC" },

13058 { 0x042234, "Wireless Standard Extensions" },

13059 { 0x0425C5, "HUAWEI TECHNOLOGIES CO.,LTD" },

13060 { 0x0425E0, "Taicang T&W Electronics" },

13061 { 0x0425E8, "Texas Instruments" },

13062 { 0x0425F0, "Nokia" },

13063 { 0x042605, "Bosch Building Automation GmbH" },

13064 { 0x042665, "Apple, Inc." },

13065 { 0x042728, "Microsoft Corporation" },

13066 { 0x042758, "HUAWEI TECHNOLOGIES CO.,LTD" },

13067 { 0x04292E, "Samsung Electronics Co.,Ltd" },

13068 { 0x042AE2, "Cisco Systems, Inc" },

13069 { 0x042B58, "Shenzhen Hanzsung Technology Co.,Ltd" },

13070 { 0x042BBB, "PicoCELA, Inc." },

13071 { 0x042DAD, "Areus GmbH" },

13072 { 0x042DB4, "First Property (Beijing) Co., Ltd Modern MOMA Branch" },

13073 { 0x042F56, "ATOCS (Shenzhen) LTD" },

13074 { 0x043110, "Inspur Group Co., Ltd." },

13075 { 0x043201, "Broadcom Limited" },

13076 { 0x0432F4, "Partron" },

13077 { 0x04331F, "Huawei Device Co., Ltd." },

13078 { 0x043385, "Nanchang BlackShark Co.,Ltd." },

13079 { 0x043389, "HUAWEI TECHNOLOGIES CO.,LTD" },

13080 { 0x0433C2, "Intel Corporate" },

13081 { 0x0434F6, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

13082 { 0x043604, "Gyeyoung I&T" },

13083 { 0x0436B8, "I&C Technology" },

13084 { 0x043855, "Scopus International Pvt. Ltd." },

13085 { 0x0438DC, "China Unicom Online Information Technology Co.,Ltd" },

13086 { 0x043926, "China Dragon Technology Limited" },

13087 { 0x043A0D, "SM Optics S.r.l." },

13088 { 0x043CE8, "Shenzhen SuperElectron Technology Co.,Ltd." },

13089 { 0x043D98, "ChongQing QingJia Electronics CO.,LTD" },

13090 { 0x043F72, "Mellanox Technologies, Inc." },

13091 { 0x0440A9, "New H3C Technologies Co., Ltd" },

13092 { 0x044169, "GoPro" },

13093 { 0x04421A, "ASUSTek COMPUTER INC." },

13094 { 0x0443FD, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

13095 { 0x0444A1, "TELECON GALICIA,S.A." },

13096 { 0x044562, "ANDRA Sp. z o. o." },

13097 { 0x0445A1, "NIRIT- Xinwei Telecom Technology Co., Ltd." },

13098 { 0x044665, "Murata Manufacturing Co., Ltd." },

13099 { 0x0446CF, "Beijing Venustech Cybervision Co.,Ltd." },

13100 { 0x04472A, "Palo Alto Networks" },

13101 { 0x04489A, "Apple, Inc." },

13102 { 0x04495D, "Huawei Device Co., Ltd." },

13103 { 0x044A50, "Ramaxel Technology (Shenzhen) limited company" },

13104 { 0x044A6A, "niliwi nanjing big data Co,.Ltd" },

13105 { 0x044A6C, "HUAWEI TECHNOLOGIES CO.,LTD" },

13106 { 0x044AC6, "Aipon Electronics Co., Ltd" },

13107 { 0x044BA5, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

13108 { 0x044BED, "Apple, Inc." },

13109 { 0x044BFF, "GuangZhou Hedy Digital Technology Co., Ltd" },

13110 { 0x044CEF, "Fujian Sanao Technology Co.,Ltd" },

13111 { 0x044E06, "Ericsson AB" },

13112 { 0x044E5A, "ARRIS Group, Inc." },

13113 { 0x044EAF, "LG Innotek" },

13114 { 0x044F17, "HUMAX Co., Ltd." },

13115 { 0x044F4C, "HUAWEI TECHNOLOGIES CO.,LTD" },

13116 { 0x044F7A, "China Mobile Group Device Co.,Ltd." },

13117 { 0x044F8B, "Adapteva, Inc." },

13118 { 0x044FAA, "Ruckus Wireless" },

13119 { 0x0450DA, "Qiku Internet Network Scientific (Shenzhen) Co., Ltd" },

13120 { 0x045170, "Zhongshan K-mate General Electronics Co.,Ltd" },

13121 { 0x0452C7, "Bose Corporation" },

13122 { 0x0452F3, "Apple, Inc." },

13123 { 0x0453D5, "Sysorex Global Holdings" },

13124 { 0x045453, "Apple, Inc." },

13125 { 0x0455CA, "BriView (Xiamen) Corp." },

13126 { 0x045604, "Gionee Communication Equipment Co.,Ltd." },

13127 { 0x0456E5, "Intel Corporate" },

13128 { 0x04572F, "Sertel Electronics UK Ltd" },

13129 { 0x045747, "GoPro" },

13130 { 0x045791, "Shenzhenshi Xinzhongxin Technology Co.Ltd" },

13131 { 0x04586F, "Sichuan Whayer information industry Co.,LTD" },

13132 { 0x045A95, "Nokia Corporation" },

13133 { 0x045C06, "Zmodo Technology Corporation" },

13134 { 0x045C6C, "Juniper Networks" },

13135 { 0x045C8E, "gosund GROUP CO.,LTD" },

13136 { 0x045D4B, "Sony Corporation" },

13137 { 0x045D56, "camtron industrial inc." },

13138 { 0x045EA4, "Netis Technology Co., Ltd." },

13139 { 0x045FA7, "Shenzhen Yichen Technology Development Co.,LTD" },

13140 { 0x045FB9, "Cisco Systems, Inc" },

13141 { 0x046169, "MEDIA GLOBAL LINKS CO., LTD." },

13142 { 0x046273, "Cisco Systems, Inc" },

13143 { 0x0462D7, "ALSTOM HYDRO FRANCE" },

13144 { 0x0463D0, "Huawei Device Co., Ltd." },

13145 { 0x0463E0, "Nome Oy" },

13146 { 0x046565, "Testop" },

13147 { 0x046785, "scemtec Hard- und Software fuer Mess- und Steuerungstechnik GmbH" },

13148 { 0x046865, "Apple, Inc." },

13149 { 0x046874, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

13150 { 0x04698F, "Juniper Networks" },

13151 { 0x0469F8, "Apple, Inc." },

13152 { 0x046B1B, "SYSDINE Co., Ltd." },

13153 { 0x046B25, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

13154 { 0x046C59, "Intel Corporate" },

13155 { 0x046C9D, "Cisco Systems, Inc" },

13156 { 0x046D42, "Bryston Ltd." },

13157 { 0x046E02, "OpenRTLS Group" },

13158 { 0x046E49, "TaiYear Electronic Technology (Suzhou) Co., Ltd" },

13159 { 0x047056, "Arcadyan Corporation" },

13160 { 0x0470BC, "Globalstar Inc." },

13161 { 0x04714B, "IEEE Registration Authority" },

13162 { 0x047153, "SERNET (SUZHOU) TECHNOLOGIES CORPORATION" },

13163 { 0x047295, "Apple, Inc." },

13164 { 0x0474A1, "Aligera Equipamentos Digitais Ltda" },

13165 { 0x047503, "HUAWEI TECHNOLOGIES CO.,LTD" },

13166 { 0x0475F5, "CSST" },

13167 { 0x0475F9, "Taicang T&W Electronics" },

13168 { 0x04766E, "ALPSALPINE CO,.LTD" },

13169 { 0x0476B0, "Cisco Systems, Inc" },

13170 { 0x047863, "Shanghai MXCHIP Information Technology Co., Ltd." },

13171 { 0x047970, "HUAWEI TECHNOLOGIES CO.,LTD" },

13172 { 0x047975, "Honor Device Co., Ltd." },

13173 { 0x0479B7, "Texas Instruments" },

13174 { 0x0479FD, "Ciena Corporation" },

13175 { 0x047A0B, "Beijing Xiaomi Electronics Co., Ltd." },

13176 { 0x047AAE, "Huawei Device Co., Ltd." },

13177 { 0x047BCB, "Universal Global Scientific Industrial Co., Ltd." },

13178 { 0x047C16, "Micro-Star INTL CO., LTD." },

13179 { 0x047D50, "Shenzhen Kang Ying Technology Co.Ltd." },

13180 { 0x047D7B, "Quanta Computer Inc." },

13181 { 0x047E23, "China Mobile IOT Company Limited" },

13182 { 0x047E4A, "moobox CO., Ltd." },

13183 { 0x047F0E, "Barrot Technology Co.,LTD" },

13184 { 0x0480A7, "ShenZhen TianGang Micro Technology CO.LTD" },

13185 { 0x04819B, "SKY UK LIMITED" },

13186 { 0x0481AE, "Clack Corporation" },

13187 { 0x04848A, "7INOVA TECHNOLOGY LIMITED" },

13188 { 0x048680, "Quectel Wireless Solutions Co.,Ltd." },

13189 { 0x048727, "Silicon Laboratories" },

13190 { 0x04885F, "HUAWEI TECHNOLOGIES CO.,LTD" },

13191 { 0x04888C, "Eifelwerk Butler Systeme GmbH" },

13192 { 0x0488E2, "Beats Electronics LLC" },

13193 { 0x048A15, "Avaya Inc" },

13194 { 0x048AE1, "FLEXTRONICS MANUFACTURING(ZHUHAI)CO.,LTD." },

13195 { 0x048B42, "Skspruce Technologies" },

13196 { 0x048C03, "ThinPAD Technology (Shenzhen)CO.,LTD" },

13197 { 0x048C16, "HUAWEI TECHNOLOGIES CO.,LTD" },

13198 { 0x048C9A, "Huawei Device Co., Ltd." },

13199 { 0x048D38, "Netis Technology Co., Ltd." },

13200 { 0x049081, "Pensando Systems, Inc." },

13201 { 0x049162, "Microchip Technology Inc." },

13202 { 0x049226, "ASUSTek COMPUTER INC." },

13203 { 0x0492EE, "iway AG" },

13204 { 0x04946B, "TECNO MOBILE LIMITED" },

13205 { 0x0494A1, "CATCH THE WIND INC" },

13206 { 0x049573, "zte corporation" },

13207 { 0x0495E6, "Tenda Technology Co.,Ltd.Dongguan branch" },

13208 { 0x049645, "WUXI SKY CHIP INTERCONNECTION TECHNOLOGY CO.,LTD." },

13209 { 0x049790, "Lartech telecom LLC" },

13210 { 0x0498F3, "ALPSALPINE CO,.LTD" },

13211 { 0x0499B9, "Apple, Inc." },

13212 { 0x0499BB, "Apple, Inc." },

13213 { 0x0499E6, "Shenzhen Yoostar Technology Co., Ltd" },

13214 { 0x049B9C, "Eadingcore Intelligent Technology Co., Ltd." },

13215 { 0x049C62, "BMT Medical Technology s.r.o." },

13216 { 0x049D05, "Apple, Inc." },

13217 { 0x049DFE, "Hivesystem" },

13218 { 0x049F06, "Smobile Co., Ltd." },

13219 { 0x049F15, "Humane" },

13220 { 0x049F81, "NETSCOUT SYSTEMS INC" },

13221 { 0x049FCA, "HUAWEI TECHNOLOGIES CO.,LTD" },

13222 { 0x04A151, "NETGEAR" },

13223 { 0x04A222, "Arcadyan Corporation" },

13224 { 0x04A2F3, "Fiberhome Telecommunication Technologies Co.,LTD" },

13225 { 0x04A316, "Texas Instruments" },

13226 { 0x04A3F3, "Emicon" },

13227 { 0x04A526, "Nokia" },

13228 { 0x04A741, "Cisco Systems, Inc" },

13229 { 0x04A81C, "HUAWEI TECHNOLOGIES CO.,LTD" },

13230 { 0x04A82A, "Nokia Corporation" },

13231 { 0x04A959, "New H3C Technologies Co., Ltd" },

13232 { 0x04AAE1, "BEIJING MICROVISION TECHNOLOGY CO.,LTD" },

13233 { 0x04AB08, "Shenzhen Skyworth Digital Technology CO., Ltd" },

13234 { 0x04AB18, "ELECOM CO.,LTD." },

13235 { 0x04AB6A, "Chun-il Co.,Ltd." },

13236 { 0x04AC44, "Holtek Semiconductor Inc." },

13237 { 0x04AEC7, "Marquardt" },

13238 { 0x04B0E7, "HUAWEI TECHNOLOGIES CO.,LTD" },

13239 { 0x04B167, "Xiaomi Communications Co Ltd" },

13240 { 0x04B1A1, "Samsung Electronics Co.,Ltd" },

13241 { 0x04B3B6, "Seamap (UK) Ltd" },

13242 { 0x04B429, "Samsung Electronics Co.,Ltd" },

13243 { 0x04B466, "BSP Co., Ltd." },

13244 { 0x04B4FE, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

13245 { 0x04B648, "ZENNER" },

13246 { 0x04B6BE, "CIG SHANGHAI CO LTD" },

13247 { 0x04B86A, "SKY UK LIMITED" },

13248 { 0x04B97D, "AiVIS Co., Itd." },

13249 { 0x04B9E3, "Samsung Electronics Co.,Ltd" },

13250 { 0x04BA1C, "Huawei Device Co., Ltd." },

13251 { 0x04BA36, "Li Seng Technology Ltd" },

13252 { 0x04BA8D, "Samsung Electronics Co.,Ltd" },

13253 { 0x04BAD6, "D-Link Corporation" },

13254 { 0x04BBF9, "Pavilion Data Systems Inc" },

13255 { 0x04BC6D, "Apple, Inc." },

13256 { 0x04BC87, "Shenzhen JustLink Technology Co., LTD" },

13257 { 0x04BC9F, "Calix Inc." },

13258 { 0x04BD70, "HUAWEI TECHNOLOGIES CO.,LTD" },

13259 { 0x04BD88, "Aruba, a Hewlett Packard Enterprise Company" },

13260 { 0x04BD97, "Cisco Systems, Inc" },

13261 { 0x04BDBF, "Samsung Electronics Co.,Ltd" },

13262 { 0x04BF1B, "Dell Inc." },

13263 { 0x04BF6D, "Zyxel Communications Corporation" },

13264 { 0x04BFA8, "ISB Corporation" },

13265 { 0x04C05B, "Tigo Energy" },

13266 { 0x04C06F, "HUAWEI TECHNOLOGIES CO.,LTD" },

13267 { 0x04C09C, "Tellabs Inc." },

13268 { 0x04C103, "Clover Network, Inc." },

13269 { 0x04C1B9, "Fiberhome Telecommunication Technologies Co.,LTD" },

13270 { 0x04C1D8, "Huawei Device Co., Ltd." },

13271 { 0x04C23E, "HTC Corporation" },

13272 { 0x04C241, "Nokia" },

13273 { 0x04C29B, "Aura Home, Inc." },

13274 { 0x04C3E6, "IEEE Registration Authority" },

13275 { 0x04C461, "Murata Manufacturing Co., Ltd." },

13276 { 0x04C5A4, "Cisco Systems, Inc" },

13277 { 0x04C807, "Xiaomi Communications Co Ltd" },

13278 { 0x04C880, "Samtec Inc" },

13279 { 0x04C991, "Phistek INC." },

13280 { 0x04C9D9, "Dish Technologies Corp" },

13281 { 0x04CAED, "HUAWEI TECHNOLOGIES CO.,LTD" },

13282 { 0x04CB1D, "Traka plc" },

13283 { 0x04CB88, "Shenzhen Jingxun Software Telecommunication Technology Co.,Ltd" },

13284 { 0x04CCBC, "HUAWEI TECHNOLOGIES CO.,LTD" },

13285 { 0x04CD15, "Silicon Laboratories" },

13286 { 0x04CE09, "Shenzhen Skyworth Digital Technology CO., Ltd" },

13287 { 0x04CE14, "Wilocity LTD." },

13288 { 0x04CE7E, "NXP France Semiconductors France" },

13289 { 0x04CF25, "MANYCOLORS, INC." },

13290 { 0x04CF4B, "Intel Corporate" },

13291 { 0x04CF8C, "XIAOMI Electronics,CO.,LTD" },

13292 { 0x04D13A, "Xiaomi Communications Co Ltd" },

13293 { 0x04D168, "Sunplus Technology Co., Ltd." },

13294 { 0x04D16E, "IEEE Registration Authority" },

13295 { 0x04D320, "ITEL MOBILE LIMITED" },

13296 { 0x04D395, "Motorola Mobility LLC, a Lenovo Company" },

13297 { 0x04D3B0, "Intel Corporate" },

13298 { 0x04D3B5, "Huawei Device Co., Ltd." },

13299 { 0x04D3CF, "Apple, Inc." },

13300 { 0x04D437, "ZNV" },

13301 { 0x04D442, "GUANGDONG GENIUS TECHNOLOGY CO., LTD." },

13302 { 0x04D4C4, "ASUSTek COMPUTER INC." },

13303 { 0x04D590, "Fortinet, Inc." },

13304 { 0x04D60E, "FUNAI ELECTRIC CO., LTD." },

13305 { 0x04D6AA, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

13306 { 0x04D6F4, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

13307 { 0x04D783, "Y&H E&C Co.,LTD." },

13308 { 0x04D7A5, "New H3C Technologies Co., Ltd" },

13309 { 0x04D921, "Occuspace" },

13310 { 0x04D9C8, "Hon Hai Precision Industry Co., Ltd." },

13311 { 0x04D9F5, "ASUSTek COMPUTER INC." },

13312 { 0x04DA28, "Chongqing Zhouhai Intelligent Technology Co., Ltd" },

13313 { 0x04DAD2, "Cisco Systems, Inc" },

13314 { 0x04DB56, "Apple, Inc." },

13315 { 0x04DB8A, "Suntech International Ltd." },

13316 { 0x04DD4C, "Velocytech" },

13317 { 0x04DEDB, "Rockport Networks Inc" },

13318 { 0x04DEF2, "Shenzhen ECOM Technology Co. Ltd" },

13319 { 0x04DF69, "Car Connectivity Consortium" },

13320 { 0x04E0B0, "Shenzhen YOUHUA Technology Co., Ltd" },

13321 { 0x04E0C4, "TRIUMPH-ADLER AG" },

13322 { 0x04E1C8, "IMS Soluções em Energia Ltda." },

13323 { 0x04E229, "Qingdao Haier Technology Co.,Ltd" },

13324 { 0x04E2F8, "AEP Ticketing solutions srl" },

13325 { 0x04E31A, "Sagemcom Broadband SAS" },

13326 { 0x04E451, "Texas Instruments" },

13327 { 0x04E4B6, "Samsung Electronics Co.,Ltd" },

13328 { 0x04E536, "Apple, Inc." },

13329 { 0x04E548, "Cohda Wireless Pty Ltd" },

13330 { 0x04E56E, "THUB Co., ltd." },

13331 { 0x04E598, "Xiaomi Communications Co Ltd" },

13332 { 0x04E662, "Acroname Inc." },

13333 { 0x04E676, "AMPAK Technology, Inc." },

13334 { 0x04E69E, "ZHONGGUANCUN XINHAIZEYOU TECHNOLOGY CO.,LTD" },

13335 { 0x04E77E, "We Corporation Inc." },

13336 { 0x04E795, "HUAWEI TECHNOLOGIES CO.,LTD" },

13337 { 0x04E892, "SHENNAN CIRCUITS CO.,LTD" },

13338 { 0x04E8B9, "Intel Corporate" },

13339 { 0x04E9E5, "PJRC.COM, LLC" },

13340 { 0x04EA56, "Intel Corporate" },

13341 { 0x04EB40, "Cisco Systems, Inc" },

13342 { 0x04ECBB, "Fiberhome Telecommunication Technologies Co.,LTD" },

13343 { 0x04ECD8, "Intel Corporate" },

13344 { 0x04ED33, "Intel Corporate" },

13345 { 0x04EE03, "Texas Instruments" },

13346 { 0x04EE91, "x-fabric GmbH" },

13347 { 0x04EEE8, "IEEE Registration Authority" },

13348 { 0x04EEEE, "Laplace System Co., Ltd." },

13349 { 0x04F021, "Compex Systems Pte Ltd" },

13350 { 0x04F03E, "Huawei Device Co., Ltd." },

13351 { 0x04F0E4, "ShenZhen Hosecom Electronic Technology Co.,LTD" },

13352 { 0x04F128, "HMD Global Oy" },

13353 { 0x04F13E, "Apple, Inc." },

13354 { 0x04F169, "Huawei Device Co., Ltd." },

13355 { 0x04F17D, "Tarana Wireless" },

13356 { 0x04F352, "HUAWEI TECHNOLOGIES CO.,LTD" },

13357 { 0x04F4BC, "Xena Networks" },

13358 { 0x04F4D8, "Hui Zhou Gaoshengda Technology Co.,LTD" },

13359 { 0x04F5F4, "Proxim Wireless" },

13360 { 0x04F778, "Sony Interactive Entertainment Inc." },

13361 { 0x04F7E4, "Apple, Inc." },

13362 { 0x04F8C2, "Flaircomm Microelectronics, Inc." },

13363 { 0x04F8F8, "Edgecore Networks Corporation" },

13364 { 0x04F938, "HUAWEI TECHNOLOGIES CO.,LTD" },

13365 { 0x04F993, "Infinix mobility limited" },

13366 { 0x04F9D9, "Speaker Electronic(Jiashan) Co.,Ltd" },

13367 { 0x04F9F8, "TP-LINK TECHNOLOGIES CO.,LTD." },

13368 { 0x04FA3F, "OptiCore Inc." },

13369 { 0x04FA83, "Qingdao Haier Technology Co.,Ltd" },

13370 { 0x04FE31, "Samsung Electronics Co.,Ltd" },

13371 { 0x04FE7F, "Cisco Systems, Inc" },

13372 { 0x04FE8D, "HUAWEI TECHNOLOGIES CO.,LTD" },

13373 { 0x04FEA1, "Fihonest communication co.,Ltd" },

13374 { 0x04FF08, "Huawei Device Co., Ltd." },

13375 { 0x04FF51, "NOVAMEDIA INNOVISION SP. Z O.O." },

13376 { 0x080001, "COMPUTERVISION CORPORATION" },

13377 { 0x080002, "BRIDGE COMMUNICATIONS INC." },

13378 { 0x080003, "ADVANCED COMPUTER COMM." },

13379 { 0x080004, "CROMEMCO INCORPORATED" },

13380 { 0x080005, "SYMBOLICS INC." },

13381 { 0x080006, "SIEMENS AG" },

13382 { 0x080007, "Apple, Inc." },

13383 { 0x080008, "BOLT BERANEK AND NEWMAN INC." },

13384 { 0x080009, "Hewlett Packard" },

13385 { 0x08000A, "NESTAR SYSTEMS INCORPORATED" },

13386 { 0x08000B, "UNISYS CORPORATION" },

13387 { 0x08000C, "MIKLYN DEVELOPMENT CO." },

13388 { 0x08000D, "International Computers, Ltd" },

13389 { 0x08000E, "NCR CORPORATION" },

13390 { 0x08000F, "MITEL CORPORATION" },

13391 { 0x080011, "TEKTRONIX INC." },

13392 { 0x080012, "BELL ATLANTIC INTEGRATED SYST." },

13393 { 0x080013, "Exxon" },

13394 { 0x080014, "EXCELAN" },

13395 { 0x080015, "STC BUSINESS SYSTEMS" },

13396 { 0x080016, "BARRISTER INFO SYS CORP" },

13397 { 0x080017, "NATIONAL SEMICONDUCTOR" },

13398 { 0x080018, "PIRELLI FOCOM NETWORKS" },

13399 { 0x080019, "GENERAL ELECTRIC CORPORATION" },

13400 { 0x08001A, "TIARA/ 10NET" },

13401 { 0x08001B, "Dell EMC" },

13402 { 0x08001C, "KDD-KOKUSAI DEBNSIN DENWA CO." },

13403 { 0x08001D, "ABLE COMMUNICATIONS INC." },

13404 { 0x08001E, "APOLLO COMPUTER INC." },

13405 { 0x08001F, "SHARP CORPORATION" },

13406 { 0x080020, "Oracle Corporation" },

13407 { 0x080021, "3M COMPANY" },

13408 { 0x080022, "NBI INC." },

13409 { 0x080023, "Panasonic Communications Co., Ltd." },

13410 { 0x080024, "10NET COMMUNICATIONS/DCA" },

13411 { 0x080025, "CONTROL DATA" },

13412 { 0x080026, "NORSK DATA A.S." },

13413 { 0x080027, "PCS Systemtechnik GmbH" },

13414 { 0x080028, "Texas Instruments" },

13415 { 0x080029, "Megatek Corporation" },

13416 { 0x08002A, "MOSAIC TECHNOLOGIES INC." },

13417 { 0x08002B, "DIGITAL EQUIPMENT CORPORATION" },

13418 { 0x08002C, "BRITTON LEE INC." },

13419 { 0x08002D, "LAN-TEC INC." },

13420 { 0x08002E, "METAPHOR COMPUTER SYSTEMS" },

13421 { 0x08002F, "PRIME COMPUTER INC." },

13422 { 0x080030, "CERN" },

13423 { 0x080031, "LITTLE MACHINES INC." },

13424 { 0x080032, "TIGAN INCORPORATED" },

13425 { 0x080033, "BAUSCH & LOMB" },

13426 { 0x080034, "FILENET CORPORATION" },

13427 { 0x080035, "MICROFIVE CORPORATION" },

13428 { 0x080036, "INTERGRAPH CORPORATION" },

13429 { 0x080037, "FUJIFILM Business Innovation Corp." },

13430 { 0x080038, "BULL S.A.S." },

13431 { 0x080039, "SPIDER SYSTEMS LIMITED" },

13432 { 0x08003A, "ORCATECH INC." },

13433 { 0x08003B, "TORUS SYSTEMS LIMITED" },

13434 { 0x08003C, "SCHLUMBERGER WELL SERVICES" },

13435 { 0x08003D, "CADNETIX CORPORATIONS" },

13436 { 0x08003E, "CODEX CORPORATION" },

13437 { 0x08003F, "FRED KOSCHARA ENTERPRISES" },

13438 { 0x080040, "FERRANTI COMPUTER SYS. LIMITED" },

13439 { 0x080041, "RACAL-MILGO INFORMATION SYS.." },

13440 { 0x080042, "MACNICA, Inc." },

13441 { 0x080043, "PIXEL COMPUTER INC." },

13442 { 0x080044, "DAVID SYSTEMS INC." },

13443 { 0x080045, "CONCURRENT COMPUTER CORP." },

13444 { 0x080046, "Sony Corporation" },

13445 { 0x080047, "SEQUENT COMPUTER SYSTEMS INC." },

13446 { 0x080048, "EUROTHERM GAUGING SYSTEMS" },

13447 { 0x080049, "UNIVATION" },

13448 { 0x08004A, "BANYAN SYSTEMS INC." },

13449 { 0x08004B, "Planning Research Corp." },

13450 { 0x08004C, "HYDRA COMPUTER SYSTEMS INC." },

13451 { 0x08004D, "CORVUS SYSTEMS INC." },

13452 { 0x08004E, "3COM EUROPE LTD" },

13453 { 0x08004F, "CYGNET SYSTEMS" },

13454 { 0x080050, "DAISY SYSTEMS CORP." },

13455 { 0x080051, "ExperData" },

13456 { 0x080052, "INSYSTEC" },

13457 { 0x080053, "MIDDLE EAST TECH. UNIVERSITY" },

13458 { 0x080055, "STANFORD TELECOMM. INC." },

13459 { 0x080056, "STANFORD LINEAR ACCEL. CENTER" },

13460 { 0x080057, "Evans & Sutherland" },

13461 { 0x080058, "SYSTEMS CONCEPTS" },

13462 { 0x080059, "A/S MYCRON" },

13463 { 0x08005A, "IBM Corp" },

13464 { 0x08005B, "VTA TECHNOLOGIES INC." },

13465 { 0x08005C, "FOUR PHASE SYSTEMS" },

13466 { 0x08005D, "GOULD INC." },

13467 { 0x08005E, "COUNTERPOINT COMPUTER INC." },

13468 { 0x08005F, "SABER TECHNOLOGY CORP." },

13469 { 0x080060, "INDUSTRIAL NETWORKING INC." },

13470 { 0x080061, "JAROGATE LTD." },

13471 { 0x080062, "General Dynamics" },

13472 { 0x080063, "PLESSEY" },

13473 { 0x080064, "Sitasys AG" },

13474 { 0x080065, "GENRAD INC." },

13475 { 0x080066, "AGFA CORPORATION" },

13476 { 0x080067, "ComDesign" },

13477 { 0x080068, "RIDGE COMPUTERS" },

13478 { 0x080069, "Silicon Graphics" },

13479 { 0x08006A, "AT&T" },

13480 { 0x08006B, "ACCEL TECHNOLOGIES INC." },

13481 { 0x08006C, "SUNTEK TECHNOLOGY INT'L" },

13482 { 0x08006D, "WHITECHAPEL COMPUTER WORKS" },

13483 { 0x08006E, "MASSCOMP" },

13484 { 0x08006F, "PHILIPS APELDOORN B.V." },

13485 { 0x080070, "Mitsubishi Precision Co.,LTd." },

13486 { 0x080071, "MATRA (DSIE)" },

13487 { 0x080072, "XEROX CORP UNIV GRANT PROGRAM" },

13488 { 0x080073, "TECMAR INC." },

13489 { 0x080074, "CASIO COMPUTER CO. LTD." },

13490 { 0x080075, "DANSK DATA ELECTRONIK" },

13491 { 0x080076, "PC LAN TECHNOLOGIES" },

13492 { 0x080077, "TSL COMMUNICATIONS LTD." },

13493 { 0x080078, "ACCELL CORPORATION" },

13494 { 0x080079, "THE DROID WORKS" },

13495 { 0x08007A, "INDATA" },

13496 { 0x08007B, "SANYO ELECTRIC CO. LTD." },

13497 { 0x08007C, "VITALINK COMMUNICATIONS CORP." },

13498 { 0x08007E, "AMALGAMATED WIRELESS(AUS) LTD" },

13499 { 0x08007F, "CARNEGIE-MELLON UNIVERSITY" },

13500 { 0x080080, "AES DATA INC." },

13501 { 0x080081, "ASTECH INC." },

13502 { 0x080082, "VERITAS SOFTWARE" },

13503 { 0x080083, "Seiko Instruments Inc." },

13504 { 0x080084, "TOMEN ELECTRONICS CORP." },

13505 { 0x080085, "ELXSI" },

13506 { 0x080086, "KONICA MINOLTA HOLDINGS, INC." },

13507 { 0x080087, "Xyplex, Inc." },

13508 { 0x080088, "Brocade Communications Systems LLC" },

13509 { 0x080089, "Kinetics" },

13510 { 0x08008A, "PerfTech, Inc." },

13511 { 0x08008B, "PYRAMID TECHNOLOGY CORP." },

13512 { 0x08008C, "NETWORK RESEARCH CORPORATION" },

13513 { 0x08008D, "XYVISION INC." },

13514 { 0x08008E, "Tandem Computers" },

13515 { 0x08008F, "CHIPCOM CORPORATION" },

13516 { 0x080090, "SONOMA SYSTEMS" },

13517 { 0x08010F, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

13518 { 0x080205, "HUAWEI TECHNOLOGIES CO.,LTD" },

13519 { 0x08028E, "NETGEAR" },

13520 { 0x080342, "Palo Alto Networks" },

13521 { 0x080371, "KRG CORPORATE" },

13522 { 0x0804B4, "Texas Instruments" },

13523 { 0x080581, "Roku, Inc." },

13524 { 0x0805CD, "DongGuang EnMai Electronic Product Co.Ltd." },

13525 { 0x0805E2, "Juniper Networks" },

13526 { 0x08085C, "Luna Products" },

13527 { 0x0808C2, "Samsung Electronics Co.,Ltd" },

13528 { 0x0808EA, "AMSC" },

13529 { 0x0809B6, "Masimo Corp" },

13530 { 0x0809C7, "Zhuhai Unitech Power Technology Co., Ltd." },

13531 { 0x080A4E, "Planet Bingo® — 3rd Rock Gaming®" },

13532 { 0x080C0B, "SysMik GmbH Dresden" },

13533 { 0x080CC9, "Mission Technology Group, dba Magma" },

13534 { 0x080D84, "GECO, Inc." },

13535 { 0x080EA8, "Velex s.r.l." },

13536 { 0x080FFA, "KSP INC." },

13537 { 0x081086, "NEC Platforms, Ltd." },

13538 { 0x08115E, "Bitel Co., Ltd." },

13539 { 0x081196, "Intel Corporate" },

13540 { 0x0812A5, "Amazon Technologies Inc." },

13541 { 0x081443, "UNIBRAIN S.A." },

13542 { 0x08152F, "Samsung Electronics Co., Ltd. ARTIK" },

13543 { 0x0815AE, "China Mobile Group Device Co.,Ltd." },

13544 { 0x081605, "Vodafone Italia S.p.A." },

13545 { 0x081651, "SHENZHEN SEA STAR TECHNOLOGY CO.,LTD" },

13546 { 0x0816D5, "GOERTEK INC." },

13547 { 0x081735, "Cisco Systems, Inc" },

13548 { 0x0817F4, "IBM Corp" },

13549 { 0x08181A, "zte corporation" },

13550 { 0x08184C, "A. S. Thomas, Inc." },

13551 { 0x0819A6, "HUAWEI TECHNOLOGIES CO.,LTD" },

13552 { 0x081A1E, "Shenzhen iComm Semiconductor CO.,LTD" },

13553 { 0x081AFD, "Huawei Device Co., Ltd." },

13554 { 0x081C6E, "Xiaomi Communications Co Ltd" },

13555 { 0x081DC4, "Thermo Fisher Scientific Messtechnik GmbH" },

13556 { 0x081DFB, "Shanghai Mexon Communication Technology Co.,Ltd" },

13557 { 0x081F3F, "WondaLink Inc." },

13558 { 0x081F71, "TP-LINK TECHNOLOGIES CO.,LTD." },

13559 { 0x081FEB, "BinCube" },

13560 { 0x081FF3, "Cisco Systems, Inc" },

13561 { 0x0821EF, "Samsung Electronics Co.,Ltd" },

13562 { 0x0823B2, "vivo Mobile Communication Co., Ltd." },

13563 { 0x0823C6, "HUAWEI TECHNOLOGIES CO.,LTD" },

13564 { 0x082522, "ADVANSEE" },

13565 { 0x082525, "Xiaomi Communications Co Ltd" },

13566 { 0x082573, "Apple, Inc." },

13567 { 0x082697, "Zyxel Communications Corporation" },

13568 { 0x0826AE, "IEEE Registration Authority" },

13569 { 0x082719, "APS systems/electronic AG" },

13570 { 0x08276B, "Huawei Device Co., Ltd." },

13571 { 0x0827CE, "NAGANO KEIKI CO., LTD." },

13572 { 0x082802, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

13573 { 0x082AD0, "SRD Innovations Inc." },

13574 { 0x082CB0, "Network Instruments" },

13575 { 0x082CB6, "Apple, Inc." },

13576 { 0x082CED, "Technity Solutions Inc." },

13577 { 0x082E36, "Huawei Device Co., Ltd." },

13578 { 0x082E5F, "Hewlett Packard" },

13579 { 0x082FE9, "HUAWEI TECHNOLOGIES CO.,LTD" },

13580 { 0x08306B, "Palo Alto Networks" },

13581 { 0x0830CE, "Fiberhome Telecommunication Technologies Co.,LTD" },

13582 { 0x08318B, "HUAWEI TECHNOLOGIES CO.,LTD" },

13583 { 0x0831A4, "Huawei Device Co., Ltd." },

13584 { 0x0833ED, "ASKEY COMPUTER CORP" },

13585 { 0x08351B, "Shenzhen Jialihua Electronic Technology Co., Ltd" },

13586 { 0x083571, "CASwell INC." },

13587 { 0x0835B2, "CoreEdge Networks Co., Ltd" },

13588 { 0x0836C9, "NETGEAR" },

13589 { 0x08373D, "Samsung Electronics Co.,Ltd" },

13590 { 0x08379C, "Topaz Co. LTD." },

13591 { 0x083869, "Hong Kong AMobile Intelligent Corp. Limited Taiwan Branch" },

13592 { 0x0838A5, "Funkwerk plettac electronic GmbH" },

13593 { 0x0838E6, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

13594 { 0x083A2F, "Guangzhou Juan Intelligent Tech Joint Stock Co.,Ltd" },

13595 { 0x083A38, "New H3C Technologies Co., Ltd" },

13596 { 0x083A5C, "Junilab, Inc." },

13597 { 0x083A88, "Universal Global Scientific Industrial Co., Ltd." },

13598 { 0x083A8D, "Espressif Inc." },

13599 { 0x083AB8, "Shinoda Plasma Co., Ltd." },

13600 { 0x083AF2, "Espressif Inc." },

13601 { 0x083D88, "Samsung Electronics Co.,Ltd" },

13602 { 0x083E0C, "ARRIS Group, Inc." },

13603 { 0x083E5D, "Sagemcom Broadband SAS" },

13604 { 0x083E8E, "Hon Hai Precision Ind. Co.,Ltd." },

13605 { 0x083F3E, "WSH GmbH" },

13606 { 0x083F76, "Intellian Technologies, Inc." },

13607 { 0x083FBC, "zte corporation" },

13608 { 0x084027, "Gridstore Inc." },

13609 { 0x0840F3, "Tenda Technology Co.,Ltd.Dongguan branch" },

13610 { 0x084218, "Asyril SA" },

13611 { 0x084296, "Mobile Technology Solutions LLC" },

13612 { 0x0845D1, "Cisco Systems, Inc" },

13613 { 0x084656, "VEO-LABS" },

13614 { 0x0846C7, "Fiberhome Telecommunication Technologies Co.,LTD" },

13615 { 0x08474C, "Nokia" },

13616 { 0x0847D0, "Nokia Shanghai Bell Co., Ltd." },

13617 { 0x08482C, "Raycore Taiwan Co., LTD." },

13618 { 0x084ACF, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

13619 { 0x084E1C, "H2A Systems, LLC" },

13620 { 0x084EBF, "Sumitomo Electric Industries, Ltd" },

13621 { 0x084F0A, "HUAWEI TECHNOLOGIES CO.,LTD" },

13622 { 0x084FA9, "Cisco Systems, Inc" },

13623 { 0x084FF9, "Cisco Systems, Inc" },

13624 { 0x085104, "Huawei Device Co., Ltd." },

13625 { 0x085114, "QINGDAO TOPSCOMM COMMUNICATION CO., LTD" },

13626 { 0x08512E, "Orion Diagnostica Oy" },

13627 { 0x085240, "EbV Elektronikbau- und Vertriebs GmbH" },

13628 { 0x085411, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

13629 { 0x0854BB, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

13630 { 0x085531, "Routerboard.com" },

13631 { 0x08569B, "WiZ" },

13632 { 0x085700, "TP-LINK TECHNOLOGIES CO.,LTD." },

13633 { 0x0857FB, "Amazon Technologies Inc." },

13634 { 0x0858A5, "Beijing Vrv Software Corpoaration Limited." },

13635 { 0x085A11, "D-Link International" },

13636 { 0x085AE0, "Recovision Technology Co., Ltd." },

13637 { 0x085B0E, "Fortinet, Inc." },

13638 { 0x085BD6, "Intel Corporate" },

13639 { 0x085BDA, "CliniCare LTD" },

13640 { 0x085C1B, "HUAWEI TECHNOLOGIES CO.,LTD" },

13641 { 0x085DDD, "MERCURY CORPORATION" },

13642 { 0x08606E, "ASUSTek COMPUTER INC." },

13643 { 0x086083, "zte corporation" },

13644 { 0x086195, "Rockwell Automation" },

13645 { 0x086266, "ASUSTek COMPUTER INC." },

13646 { 0x086361, "HUAWEI TECHNOLOGIES CO.,LTD" },

13647 { 0x086518, "Apple, Inc." },

13648 { 0x0865F0, "JM Zengge Co., Ltd" },

13649 { 0x08661F, "Palo Alto Networks" },

13650 { 0x086698, "Apple, Inc." },

13651 { 0x08674E, "Hisense broadband multimedia technology Co.,Ltd" },

13652 { 0x08688D, "New H3C Technologies Co., Ltd" },

13653 { 0x0868D0, "Japan System Design" },

13654 { 0x0868EA, "EITO ELECTRONICS CO., LTD." },

13655 { 0x086A0A, "ASKEY COMPUTER CORP" },

13656 { 0x086AC5, "Intel Corporate" },

13657 { 0x086AE5, "Amazon Technologies Inc." },

13658 { 0x086BD1, "Shenzhen SuperElectron Technology Co.,Ltd." },

13659 { 0x086BD7, "Silicon Laboratories" },

13660 { 0x086D41, "Apple, Inc." },

13661 { 0x086DF2, "Shenzhen MIMOWAVE Technology Co.,Ltd" },

13662 { 0x086E9C, "Huawei Device Co., Ltd." },

13663 { 0x086F48, "Shenzhen iComm Semiconductor CO.,LTD" },

13664 { 0x087045, "Apple, Inc." },

13665 { 0x087073, "HUAWEI TECHNOLOGIES CO.,LTD" },

13666 { 0x087190, "Intel Corporate" },

13667 { 0x087402, "Apple, Inc." },

13668 { 0x087458, "Fiberhome Telecommunication Technologies Co.,LTD" },

13669 { 0x0874F6, "Winterhalter Gastronom GmbH" },

13670 { 0x087572, "Obelux Oy" },

13671 { 0x087618, "ViE Technologies Sdn. Bhd." },

13672 { 0x087695, "Auto Industrial Co., Ltd." },

13673 { 0x0876FF, "Thomson Telecom Belgium" },

13674 { 0x087808, "Samsung Electronics Co.,Ltd" },

13675 { 0x08798C, "HUAWEI TECHNOLOGIES CO.,LTD" },

13676 { 0x087999, "AIM GmbH" },

13677 { 0x087A4C, "HUAWEI TECHNOLOGIES CO.,LTD" },

13678 { 0x087B12, "Sagemcom Broadband SAS" },

13679 { 0x087B87, "Cisco Systems, Inc" },

13680 { 0x087BAA, "SVYAZKOMPLEKTSERVICE, LLC" },

13681 { 0x087C39, "Amazon Technologies Inc." },

13682 { 0x087CBE, "Quintic Corp." },

13683 { 0x087D21, "Altasec technology corporation" },

13684 { 0x087E64, "Vantiva USA LLC" },

13685 { 0x087F98, "vivo Mobile Communication Co., Ltd." },

13686 { 0x088039, "Cisco SPVTG" },

13687 { 0x0881B2, "Logitech (China) Technology Co., Ltd" },

13688 { 0x0881BC, "HongKong Ipro Technology Co., Limited" },

13689 { 0x0881F4, "Juniper Networks" },

13690 { 0x088466, "Novartis Pharma AG" },

13691 { 0x08849D, "Amazon Technologies Inc." },

13692 { 0x08855B, "Kontron Europe GmbH" },

13693 { 0x088620, "TECNO MOBILE LIMITED" },

13694 { 0x08863B, "Belkin International Inc." },

13695 { 0x0887C6, "INGRAM MICRO SERVICES" },

13696 { 0x0887C7, "Apple, Inc." },

13697 { 0x088C2C, "Samsung Electronics Co.,Ltd" },

13698 { 0x088DC8, "Ryowa Electronics Co.,Ltd" },

13699 { 0x088E4F, "SF Software Solutions" },

13700 { 0x088E90, "Intel Corporate" },

13701 { 0x088EDC, "Apple, Inc." },

13702 { 0x088F2C, "Amber Technology Ltd." },

13703 { 0x088FC3, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

13704 { 0x0890BA, "Danlaw Inc" },

13705 { 0x089115, "Amazon Technologies Inc." },

13706 { 0x0891A3, "Amazon Technologies Inc." },

13707 { 0x089204, "Dell Inc." },

13708 { 0x089356, "HUAWEI TECHNOLOGIES CO.,LTD" },

13709 { 0x0894EF, "Wistron Infocomm (Zhongshan) Corporation" },

13710 { 0x08952A, "Vantiva USA LLC" },

13711 { 0x089542, "Apple, Inc." },

13712 { 0x0896AD, "Cisco Systems, Inc" },

13713 { 0x0896D7, "AVM GmbH" },

13714 { 0x089734, "Hewlett Packard Enterprise" },

13715 { 0x089758, "Shenzhen Strong Rising Electronics Co.,Ltd DongGuan Subsidiary" },

13716 { 0x089798, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

13717 { 0x0899E8, "KEMAS GmbH" },

13718 { 0x089AC7, "zte corporation" },

13719 { 0x089B4B, "iKuai Networks" },

13720 { 0x089BB9, "Nokia Solutions and Networks GmbH & Co. KG" },

13721 { 0x089BF1, "eero inc." },

13722 { 0x089C86, "Nokia Shanghai Bell Co., Ltd." },

13723 { 0x089DF4, "Intel Corporate" },

13724 { 0x089E01, "Quanta Computer Inc." },

13725 { 0x089E08, "Google, Inc." },

13726 { 0x089E84, "HUAWEI TECHNOLOGIES CO.,LTD" },

13727 { 0x089F97, "LEROY AUTOMATION" },

13728 { 0x08A12B, "ShenZhen EZL Technology Co., Ltd" },

13729 { 0x08A189, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

13730 { 0x08A5C8, "Sunnovo International Limited" },

13731 { 0x08A5DF, "Samsung Electronics Co.,Ltd" },

13732 { 0x08A6BC, "Amazon Technologies Inc." },

13733 { 0x08A7C0, "Vantiva USA LLC" },

13734 { 0x08A842, "Huawei Device Co., Ltd." },

13735 { 0x08A8A1, "Cyclotronics Power Concepts, Inc" },

13736 { 0x08A95A, "AzureWave Technology Inc." },

13737 { 0x08AA55, "Motorola Mobility LLC, a Lenovo Company" },

13738 { 0x08AA89, "zte corporation" },

13739 { 0x08ACA5, "Benu Video, Inc." },

13740 { 0x08ACC4, "FMTech" },

13741 { 0x08AED6, "Samsung Electronics Co.,Ltd" },

13742 { 0x08AF78, "Totus Solutions, Inc." },

13743 { 0x08B055, "ASKEY COMPUTER CORP" },

13744 { 0x08B0A7, "Truebeyond Co., Ltd" },

13745 { 0x08B258, "Juniper Networks" },

13746 { 0x08B2A3, "Cynny Italia S.r.L." },

13747 { 0x08B3AF, "vivo Mobile Communication Co., Ltd." },

13748 { 0x08B49D, "TECNO MOBILE LIMITED" },

13749 { 0x08B4B1, "Google, Inc." },

13750 { 0x08B4CF, "Abicom International" },

13751 { 0x08B61F, "Espressif Inc." },

13752 { 0x08B738, "Lite-On Technogy Corp." },

13753 { 0x08B7EC, "Wireless Seismic" },

13754 { 0x08BA22, "Swaive Corporation" },

13755 { 0x08BA5F, "Qingdao Hisense Electronics Co.,Ltd." },

13756 { 0x08BB3C, "Flextronics Tech.(Ind) Pvt Ltd" },

13757 { 0x08BBCC, "AK-NORD EDV VERTRIEBSGES. mbH" },

13758 { 0x08BC20, "Hangzhou Royal Cloud Technology Co., Ltd" },

13759 { 0x08BD43, "NETGEAR" },

13760 { 0x08BE09, "Astrol Electronic AG" },

13761 { 0x08BE77, "Green Electronics" },

13762 { 0x08BEAC, "Edimax Technology Co. Ltd." },

13763 { 0x08BFA0, "Samsung Electronics Co.,Ltd" },

13764 { 0x08BFB8, "ASUSTek COMPUTER INC." },

13765 { 0x08C021, "HUAWEI TECHNOLOGIES CO.,LTD" },

13766 { 0x08C06C, "Huawei Device Co., Ltd." },

13767 { 0x08C0EB, "Mellanox Technologies, Inc." },

13768 { 0x08C224, "Amazon Technologies Inc." },

13769 { 0x08C3B3, "TCL King Electrical Appliances(Huizhou)Co.,Ltd" },

13770 { 0x08C5E1, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

13771 { 0x08C6B3, "QTECH LLC" },

13772 { 0x08C729, "Apple, Inc." },

13773 { 0x08C7F5, "Vantiva Connected Home - Technologies Telco" },

13774 { 0x08C8C2, "GN Audio A/S" },

13775 { 0x08CA45, "Toyou Feiji Electronics Co., Ltd." },

13776 { 0x08CBE5, "R3 Solutions GmbH" },

13777 { 0x08CC27, "Motorola Mobility LLC, a Lenovo Company" },

13778 { 0x08CC68, "Cisco Systems, Inc" },

13779 { 0x08CC81, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

13780 { 0x08CCA7, "Cisco Systems, Inc" },

13781 { 0x08CD9B, "samtec automotive electronics & software GmbH" },

13782 { 0x08D09F, "Cisco Systems, Inc" },

13783 { 0x08D0B7, "Qingdao Hisense Communications Co.,Ltd." },

13784 { 0x08D1F9, "Espressif Inc." },

13785 { 0x08D23E, "Intel Corporate" },

13786 { 0x08D29A, "Proformatique" },

13787 { 0x08D34B, "Techman Electronics (Changshu) Co., Ltd." },

13788 { 0x08D40C, "Intel Corporate" },

13789 { 0x08D42B, "Samsung Electronics Co.,Ltd" },

13790 { 0x08D46A, "LG Electronics (Mobile Communications)" },

13791 { 0x08D59D, "Sagemcom Broadband SAS" },

13792 { 0x08D5C0, "Seers Technology Co., Ltd" },

13793 { 0x08D833, "Shenzhen RF Technology Co., Ltd" },

13794 { 0x08DF1F, "Bose Corporation" },

13795 { 0x08DFCB, "Systrome Networks" },

13796 { 0x08E021, "Honor Device Co., Ltd." },

13797 { 0x08E342, "Cear, Inc." },

13798 { 0x08E4DF, "Shenzhen Sande Dacom Electronics Co., Ltd" },

13799 { 0x08E5DA, "NANJING FUJITSU COMPUTER PRODUCTS CO.,LTD." },

13800 { 0x08E63B, "zte corporation" },

13801 { 0x08E672, "JEBSEE ELECTRONICS CO.,LTD." },

13802 { 0x08E689, "Apple, Inc." },

13803 { 0x08E6C9, "Business-intelligence of Oriental Nations Corporation Ltd." },

13804 { 0x08E7E5, "Huawei Device Co., Ltd." },

13805 { 0x08E84F, "HUAWEI TECHNOLOGIES CO.,LTD" },

13806 { 0x08E9F6, "AMPAK Technology,Inc." },

13807 { 0x08EA40, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

13808 { 0x08EA44, "Extreme Networks Headquarters" },

13809 { 0x08EB29, "Jiangsu Huitong Group Co.,Ltd." },

13810 { 0x08EB74, "HUMAX Co., Ltd." },

13811 { 0x08EBED, "World Elite Technology Co.,LTD" },

13812 { 0x08EBF6, "HUAWEI TECHNOLOGIES CO.,LTD" },

13813 { 0x08ECA9, "Samsung Electronics Co.,Ltd" },

13814 { 0x08ECF5, "Cisco Systems, Inc" },

13815 { 0x08ED02, "IEEE Registration Authority" },

13816 { 0x08ED9D, "TECNO MOBILE LIMITED" },

13817 { 0x08EDB9, "Hon Hai Precision Ind. Co.,Ltd." },

13818 { 0x08EDED, "Zhejiang Dahua Technology Co., Ltd." },

13819 { 0x08EE8B, "Samsung Electronics Co.,Ltd" },

13820 { 0x08EF3B, "MCS Logic Inc." },

13821 { 0x08EFAB, "SAYME WIRELESS SENSOR NETWORK" },

13822 { 0x08F01E, "eero inc." },

13823 { 0x08F1B3, "Cisco Meraki" },

13824 { 0x08F1B7, "Towerstream Corpration" },

13825 { 0x08F1EA, "Hewlett Packard Enterprise" },

13826 { 0x08F2F4, "Net One Partners Co.,Ltd." },

13827 { 0x08F3FB, "Cisco Systems, Inc" },

13828 { 0x08F458, "Huawei Device Co., Ltd." },

13829 { 0x08F4AB, "Apple, Inc." },

13830 { 0x08F606, "zte corporation" },

13831 { 0x08F69C, "Apple, Inc." },

13832 { 0x08F6F8, "GET Engineering" },

13833 { 0x08F728, "GLOBO Multimedia Sp. z o.o. Sp.k." },

13834 { 0x08F7E9, "HRCP Research and Development Partnership" },

13835 { 0x08F80D, "IEEE Registration Authority" },

13836 { 0x08F8BC, "Apple, Inc." },

13837 { 0x08F9E0, "Espressif Inc." },

13838 { 0x08FA28, "HUAWEI TECHNOLOGIES CO.,LTD" },

13839 { 0x08FA79, "vivo Mobile Communication Co., Ltd." },

13840 { 0x08FAE0, "Fohhn Audio AG" },

13841 { 0x08FBEA, "AMPAK Technology,Inc." },

13842 { 0x08FC52, "OpenXS BV" },

13843 { 0x08FC88, "Samsung Electronics Co.,Ltd" },

13844 { 0x08FD0E, "Samsung Electronics Co.,Ltd" },

13845 { 0x08FF24, "Shenzhen Skyworth Digital Technology CO., Ltd" },

13846 { 0x08FF44, "Apple, Inc." },

13847 { 0x0C014B, "zte corporation" },

13848 { 0x0C01C8, "DENSO Co.,Ltd" },

13849 { 0x0C01DB, "Infinix mobility limited" },

13850 { 0x0C0227, "Vantiva USA LLC" },

13851 { 0x0C02BD, "Samsung Electronics Co.,Ltd" },

13852 { 0x0C0400, "Jantar d.o.o." },

13853 { 0x0C0535, "Juniper Systems" },

13854 { 0x0C08B4, "HUMAX Co., Ltd." },

13855 { 0x0C0E76, "D-Link International" },

13856 { 0x0C1105, "AKUVOX (XIAMEN) NETWORKS CO., LTD" },

13857 { 0x0C1167, "Cisco Systems, Inc" },

13858 { 0x0C1262, "zte corporation" },

13859 { 0x0C130B, "Uniqoteq Ltd." },

13860 { 0x0C1420, "Samsung Electronics Co.,Ltd" },

13861 { 0x0C14D2, "China Mobile Group Device Co.,Ltd." },

13862 { 0x0C1539, "Apple, Inc." },

13863 { 0x0C15C5, "SDTEC Co., Ltd." },

13864 { 0x0C1773, "Huawei Device Co., Ltd." },

13865 { 0x0C17F1, "TELECSYS" },

13866 { 0x0C184E, "HUAWEI TECHNOLOGIES CO.,LTD" },

13867 { 0x0C191F, "Inform Electronik" },

13868 { 0x0C19F8, "Apple, Inc." },

13869 { 0x0C1A10, "Acoustic Stream" },

13870 { 0x0C1C19, "LONGCONN ELECTRONICS(SHENZHEN) CO.,LTD" },

13871 { 0x0C1C1A, "eero inc." },

13872 { 0x0C1C20, "Kakao Corp" },

13873 { 0x0C1C57, "Texas Instruments" },

13874 { 0x0C1DAF, "Xiaomi Communications Co Ltd" },

13875 { 0x0C1DC2, "SeAH Networks" },

13876 { 0x0C1EF7, "Omni-ID" },

13877 { 0x0C2026, "noax Technologies AG" },

13878 { 0x0C20D3, "vivo Mobile Communication Co., Ltd." },

13879 { 0x0C2138, "Hengstler GmbH" },

13880 { 0x0C2369, "Honeywell SPS" },

13881 { 0x0C2576, "LONGCHEER TELECOMMUNICATION LIMITED" },

13882 { 0x0C2724, "Cisco Systems, Inc" },

13883 { 0x0C2755, "Valuable Techologies Limited" },

13884 { 0x0C298F, "Tesla,Inc." },

13885 { 0x0C29EF, "Dell Inc." },

13886 { 0x0C2A69, "electric imp, incorporated" },

13887 { 0x0C2A86, "Fiberhome Telecommunication Technologies Co.,LTD" },

13888 { 0x0C2AE7, "Beijing General Research Institute of Mining and Metallurgy" },

13889 { 0x0C2C54, "HUAWEI TECHNOLOGIES CO.,LTD" },

13890 { 0x0C2D89, "QiiQ Communications Inc." },

13891 { 0x0C2E57, "HUAWEI TECHNOLOGIES CO.,LTD" },

13892 { 0x0C2FB0, "Samsung Electronics Co.,Ltd" },

13893 { 0x0C3021, "Apple, Inc." },

13894 { 0x0C31DC, "HUAWEI TECHNOLOGIES CO.,LTD" },

13895 { 0x0C3526, "Microsoft Corporation" },

13896 { 0x0C354F, "Nokia" },

13897 { 0x0C35FE, "Fiberhome Telecommunication Technologies Co.,LTD" },

13898 { 0x0C3747, "zte corporation" },

13899 { 0x0C3796, "BIZLINK TECHNOLOGY, INC." },

13900 { 0x0C37DC, "HUAWEI TECHNOLOGIES CO.,LTD" },

13901 { 0x0C383E, "Fanvil Technology Co., Ltd." },

13902 { 0x0C3956, "Observator instruments" },

13903 { 0x0C3AFA, "New H3C Technologies Co., Ltd" },

13904 { 0x0C3B50, "Apple, Inc." },

13905 { 0x0C3C65, "Dome Imaging Inc" },

13906 { 0x0C3CCD, "Universal Global Scientific Industrial Co., Ltd." },

13907 { 0x0C3E9F, "Apple, Inc." },

13908 { 0x0C4101, "Ruichi Auto Technology (Guangzhou) Co., Ltd." },

13909 { 0x0C413E, "Microsoft Corporation" },

13910 { 0x0C41E9, "HUAWEI TECHNOLOGIES CO.,LTD" },

13911 { 0x0C42A1, "Mellanox Technologies, Inc." },

13912 { 0x0C4314, "Silicon Laboratories" },

13913 { 0x0C43F9, "Amazon Technologies Inc." },

13914 { 0x0C45BA, "HUAWEI TECHNOLOGIES CO.,LTD" },

13915 { 0x0C469D, "MS Sedco" },

13916 { 0x0C473D, "Hitron Technologies. Inc" },

13917 { 0x0C47C9, "Amazon Technologies Inc." },

13918 { 0x0C4885, "LG Electronics (Mobile Communications)" },

13919 { 0x0C48C6, "CELESTICA INC." },

13920 { 0x0C4933, "Sichuan Jiuzhou Electronic Technology Co., Ltd." },

13921 { 0x0C4B48, "Nokia" },

13922 { 0x0C4B54, "TP-LINK TECHNOLOGIES CO.,LTD." },

13923 { 0x0C4C39, "MitraStar Technology Corp." },

13924 { 0x0C4DE9, "Apple, Inc." },

13925 { 0x0C4EC0, "Maxlinear Inc" },

13926 { 0x0C4F5A, "ASA-RT s.r.l." },

13927 { 0x0C4F9B, "HUAWEI TECHNOLOGIES CO.,LTD" },

13928 { 0x0C5101, "Apple, Inc." },

13929 { 0x0C517E, "Apple, Inc." },

13930 { 0x0C51F7, "CHAUVIN ARNOUX" },

13931 { 0x0C5203, "AGM GROUP LIMITED" },

13932 { 0x0C5331, "ETH Zurich" },

13933 { 0x0C53B7, "Apple, Inc." },

13934 { 0x0C5415, "Intel Corporate" },

13935 { 0x0C54A5, "PEGATRON CORPORATION" },

13936 { 0x0C54B9, "Nokia" },

13937 { 0x0C5521, "Axiros GmbH" },

13938 { 0x0C565C, "HyBroad Vision (Hong Kong) Technology Co Ltd" },

13939 { 0x0C57EB, "Mueller Systems" },

13940 { 0x0C5842, "DME Micro" },

13941 { 0x0C599C, "Juniper Networks" },

13942 { 0x0C5A19, "Axtion Sdn Bhd" },

13943 { 0x0C5A9E, "Wi-SUN Alliance" },

13944 { 0x0C5CB5, "IEEE Registration Authority" },

13945 { 0x0C5CD8, "DOLI Elektronik GmbH" },

13946 { 0x0C5F35, "Niagara Video Corporation" },

13947 { 0x0C6046, "vivo Mobile Communication Co., Ltd." },

13948 { 0x0C6076, "Hon Hai Precision Ind. Co.,Ltd." },

13949 { 0x0C6111, "Anda Technologies SAC" },

13950 { 0x0C6127, "Actiontec Electronics, Inc" },

13951 { 0x0C61CF, "Texas Instruments" },

13952 { 0x0C62A6, "Hui Zhou Gaoshengda Technology Co.,LTD" },

13953 { 0x0C63FC, "Nanjing Signway Technology Co., Ltd" },

13954 { 0x0C6422, "Beijing Wiseasy Technology Co.,Ltd." },

13955 { 0x0C659A, "Panasonic Automotive Systems Company of America" },

13956 { 0x0C6714, "SERNET (SUZHOU) TECHNOLOGIES CORPORATION" },

13957 { 0x0C6743, "HUAWEI TECHNOLOGIES CO.,LTD" },

13958 { 0x0C6803, "Cisco Systems, Inc" },

13959 { 0x0C6ABC, "Fiberhome Telecommunication Technologies Co.,LTD" },

13960 { 0x0C6AC4, "Apple, Inc." },

13961 { 0x0C6AE6, "Stanley Security Solutions" },

13962 { 0x0C6E4F, "PrimeVOLT Co., Ltd." },

13963 { 0x0C6F9C, "Shaw Communications Inc." },

13964 { 0x0C7043, "Sony Interactive Entertainment Inc." },

13965 { 0x0C704A, "HUAWEI TECHNOLOGIES CO.,LTD" },

13966 { 0x0C715D, "Samsung Electronics Co.,Ltd" },

13967 { 0x0C718C, "TCT mobile ltd" },

13968 { 0x0C722C, "TP-LINK TECHNOLOGIES CO.,LTD." },

13969 { 0x0C7274, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

13970 { 0x0C72D9, "zte corporation" },

13971 { 0x0C7329, "Sercomm Corporation." },

13972 { 0x0C73BE, "Dongguan Haimai Electronie Technology Co.,Ltd" },

13973 { 0x0C73EB, "IEEE Registration Authority" },

13974 { 0x0C74C2, "Apple, Inc." },

13975 { 0x0C7512, "Shenzhen Kunlun TongTai Technology Co.,Ltd." },

13976 { 0x0C7523, "BEIJING GEHUA CATV NETWORK CO.,LTD" },

13977 { 0x0C756C, "Anaren Microwave, Inc." },

13978 { 0x0C75BD, "Cisco Systems, Inc" },

13979 { 0x0C75D2, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

13980 { 0x0C771A, "Apple, Inc." },

13981 { 0x0C7A15, "Intel Corporate" },

13982 { 0x0C7BC8, "Cisco Meraki" },

13983 { 0x0C7C28, "Nokia Solutions and Networks GmbH & Co. KG" },

13984 { 0x0C7D7C, "Kexiang Information Technology Co, Ltd." },

13985 { 0x0C7FB2, "ARRIS Group, Inc." },

13986 { 0x0C7FED, "IEEE Registration Authority" },

13987 { 0x0C8063, "TP-LINK TECHNOLOGIES CO.,LTD." },

13988 { 0x0C8112, "Private" },

13989 { 0x0C8126, "Juniper Networks" },

13990 { 0x0C817D, "EEP Elektro-Elektronik Pranjic GmbH" },

13991 { 0x0C8230, "SHENZHEN MAGNUS TECHNOLOGIES CO.,LTD" },

13992 { 0x0C8268, "TP-LINK TECHNOLOGIES CO.,LTD." },

13993 { 0x0C826A, "Wuhan Huagong Genuine Optics Technology Co., Ltd" },

13994 { 0x0C82D5, "Maxio Technology Hangzhou Co., Ltd." },

13995 { 0x0C8306, "Huawei Device Co., Ltd." },

13996 { 0x0C839A, "Huawei Device Co., Ltd." },

13997 { 0x0C83CC, "Alpha Networks Inc." },

13998 { 0x0C8408, "HUAWEI TECHNOLOGIES CO.,LTD" },

13999 { 0x0C8411, "A.O. Smith Water Products" },

14000 { 0x0C8447, "Fiberhome Telecommunication Technologies Co.,LTD" },

14001 { 0x0C8484, "Zenovia Electronics Inc." },

14002 { 0x0C84DC, "Hon Hai Precision Ind. Co.,Ltd." },

14003 { 0x0C8525, "Cisco Systems, Inc" },

14004 { 0x0C8610, "Juniper Networks" },

14005 { 0x0C8629, "IEEE Registration Authority" },

14006 { 0x0C86C7, "Jabil Circuit (Guangzhou) Limited" },

14007 { 0x0C8772, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

14008 { 0x0C8910, "Samsung Electronics Co.,Ltd" },

14009 { 0x0C8A87, "AgLogica Holdings, Inc" },

14010 { 0x0C8B7D, "Vizio, Inc" },

14011 { 0x0C8B95, "Espressif Inc." },

14012 { 0x0C8BD3, "ITEL MOBILE LIMITED" },

14013 { 0x0C8BFD, "Intel Corporate" },

14014 { 0x0C8C24, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

14015 { 0x0C8C69, "Shenzhen elink smart Co., ltd" },

14016 { 0x0C8C8F, "Kamo Technology Limited" },

14017 { 0x0C8CDC, "Suunto Oy" },

14018 { 0x0C8D7A, "RADiflow" },

14019 { 0x0C8D98, "TOP EIGHT IND CORP" },

14020 { 0x0C8DCA, "Samsung Electronics Co.,Ltd" },

14021 { 0x0C8DDB, "Cisco Meraki" },

14022 { 0x0C8E29, "Arcadyan Corporation" },

14023 { 0x0C8FFF, "HUAWEI TECHNOLOGIES CO.,LTD" },

14024 { 0x0C9043, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

14025 { 0x0C9160, "Hui Zhou Gaoshengda Technology Co.,LTD" },

14026 { 0x0C9192, "Intel Corporate" },

14027 { 0x0C924E, "Rice Lake Weighing Systems" },

14028 { 0x0C9301, "PT. Prasimax Inovasi Teknologi" },

14029 { 0x0C938F, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

14030 { 0x0C93FB, "BNS Solutions" },

14031 { 0x0C9505, "The Chamberlain Group, Inc" },

14032 { 0x0C9541, "CHIPSEA TECHNOLOGIES (SHENZHEN) CORP." },

14033 { 0x0C96BF, "HUAWEI TECHNOLOGIES CO.,LTD" },

14034 { 0x0C96CD, "MERCURY CORPORATION" },

14035 { 0x0C96E6, "Cloud Network Technology (Samoa) Limited" },

14036 { 0x0C975F, "Aruba, a Hewlett Packard Enterprise Company" },

14037 { 0x0C9838, "Xiaomi Communications Co Ltd" },

14038 { 0x0C9A3C, "Intel Corporate" },

14039 { 0x0C9A42, "FN-LINK TECHNOLOGY LIMITED" },

14040 { 0x0C9B13, "Shanghai Magic Mobile Telecommunication Co.Ltd." },

14041 { 0x0C9B78, "Extreme Networks Headquarters" },

14042 { 0x0C9D56, "Consort Controls Ltd" },

14043 { 0x0C9D92, "ASUSTek COMPUTER INC." },

14044 { 0x0C9E91, "Sankosha Corporation" },

14045 { 0x0C9F71, "Dolphin Electronics (DongGuan) Co., Ltd." },

14046 { 0x0CA06C, "Industrial Cyber Sensing Inc." },

14047 { 0x0CA138, "BLiNQ Networks Inc." },

14048 { 0x0CA2F4, "Chameleon Technology (UK) Limited" },

14049 { 0x0CA402, "Alcatel-Lucent IPD" },

14050 { 0x0CA42A, "OB Telecom Electronic Technology Co., Ltd" },

14051 { 0x0CA694, "Sunitec Enterprise Co.,Ltd" },

14052 { 0x0CA8A7, "Samsung Electronics Co.,Ltd" },

14053 { 0x0CAAEE, "Ansjer Electronics Co., Ltd." },

14054 { 0x0CAC05, "Unitend Technologies Inc." },

14055 { 0x0CAC8A, "Sagemcom Broadband SAS" },

14056 { 0x0CAE5F, "Silicon Laboratories" },

14057 { 0x0CAE7D, "Texas Instruments" },

14058 { 0x0CAEBD, "Edifier International" },

14059 { 0x0CAF31, "Cisco Systems, Inc" },

14060 { 0x0CAF5A, "GENUS POWER INFRASTRUCTURES LIMITED" },

14061 { 0x0CB088, "AITelecom" },

14062 { 0x0CB2B7, "Texas Instruments" },

14063 { 0x0CB319, "Samsung Electronics Co.,Ltd" },

14064 { 0x0CB34F, "Shenzhen Xiaoqi Intelligent Technology Co., Ltd." },

14065 { 0x0CB459, "Marketech International Corp." },

14066 { 0x0CB4A4, "Xintai Automobile Intelligent Network Technology" },

14067 { 0x0CB4EF, "Digience Co.,Ltd." },

14068 { 0x0CB527, "HUAWEI TECHNOLOGIES CO.,LTD" },

14069 { 0x0CB5DE, "Alcatel Lucent" },

14070 { 0x0CB6D2, "D-Link International" },

14071 { 0x0CB771, "ARRIS Group, Inc." },

14072 { 0x0CB789, "Honor Device Co., Ltd." },

14073 { 0x0CB815, "Espressif Inc." },

14074 { 0x0CB8E8, "Renesas Electronics (Penang) Sdn. Bhd." },

14075 { 0x0CB912, "JM-DATA GmbH" },

14076 { 0x0CB937, "Ubee Interactive Co., Limited" },

14077 { 0x0CB983, "Honor Device Co., Ltd." },

14078 { 0x0CBC9F, "Apple, Inc." },

14079 { 0x0CBD51, "TCT mobile ltd" },

14080 { 0x0CBD75, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

14081 { 0x0CBEF1, "Huawei Device Co., Ltd." },

14082 { 0x0CBF15, "Genetec Inc." },

14083 { 0x0CBF3F, "Shenzhen Lencotion Technology Co.,Ltd" },

14084 { 0x0CBF74, "Morse Micro" },

14085 { 0x0CC0C0, "MAGNETI MARELLI SISTEMAS ELECTRONICOS MEXICO" },

14086 { 0x0CC3A7, "Meritec" },

14087 { 0x0CC413, "Google, Inc." },

14088 { 0x0CC47A, "Super Micro Computer, Inc." },

14089 { 0x0CC47E, "EUCAST Co., Ltd." },

14090 { 0x0CC655, "Wuxi YSTen Technology Co.,Ltd." },

14091 { 0x0CC66A, "Nokia Corporation" },

14092 { 0x0CC6AC, "DAGS" },

14093 { 0x0CC6CC, "HUAWEI TECHNOLOGIES CO.,LTD" },

14094 { 0x0CC6FD, "Xiaomi Communications Co Ltd" },

14095 { 0x0CC731, "Currant, Inc." },

14096 { 0x0CC81F, "Summer Infant, Inc." },

14097 { 0x0CC844, "Cambridge Mobile Telematics, Inc." },

14098 { 0x0CC9C6, "Samwin Hong Kong Limited" },

14099 { 0x0CCAFB, "TPVision Europe B.V" },

14100 { 0x0CCB0C, "iSYS RTS GmbH" },

14101 { 0x0CCB85, "Motorola Mobility LLC, a Lenovo Company" },

14102 { 0x0CCB8D, "ASCO Numatics GmbH" },

14103 { 0x0CCC26, "Airenetworks" },

14104 { 0x0CCC47, "IEEE Registration Authority" },

14105 { 0x0CCDD3, "EASTRIVER TECHNOLOGY CO., LTD." },

14106 { 0x0CCDFB, "EDIC Systems Inc." },

14107 { 0x0CCEF6, "Guizhou Fortuneship Technology Co., Ltd" },

14108 { 0x0CCF89, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

14109 { 0x0CCFD1, "SPRINGWAVE Co., Ltd" },

14110 { 0x0CD0F8, "Cisco Systems, Inc" },

14111 { 0x0CD292, "Intel Corporate" },

14112 { 0x0CD2B5, "Binatone Telecommunication Pvt. Ltd" },

14113 { 0x0CD502, "Westell Technologies Inc." },

14114 { 0x0CD5D3, "Cisco Systems, Inc" },

14115 { 0x0CD696, "Amimon Ltd" },

14116 { 0x0CD6BD, "HUAWEI TECHNOLOGIES CO.,LTD" },

14117 { 0x0CD746, "Apple, Inc." },

14118 { 0x0CD7C2, "Axium Technologies, Inc." },

14119 { 0x0CD86C, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

14120 { 0x0CD923, "GOCLOUD Networks(GAOKE Networks)" },

14121 { 0x0CD996, "Cisco Systems, Inc" },

14122 { 0x0CD9C1, "Visteon Corporation" },

14123 { 0x0CDA41, "Hangzhou H3C Technologies Co., Limited" },

14124 { 0x0CDBEA, "Apple, Inc." },

14125 { 0x0CDC7E, "Espressif Inc." },

14126 { 0x0CDC91, "Amazon Technologies Inc." },

14127 { 0x0CDCCC, "Inala Technologies" },

14128 { 0x0CDD24, "Intel Corporate" },

14129 { 0x0CDDEF, "Nokia Corporation" },

14130 { 0x0CDFA4, "Samsung Electronics Co.,Ltd" },

14131 { 0x0CE041, "iDruide" },

14132 { 0x0CE0DC, "Samsung Electronics Co.,Ltd" },

14133 { 0x0CE0E4, "PLANTRONICS, INC." },

14134 { 0x0CE159, "Shenzhen iStartek Technology Co., Ltd." },

14135 { 0x0CE441, "Apple, Inc." },

14136 { 0x0CE4A0, "Huawei Device Co., Ltd." },

14137 { 0x0CE5A3, "SharkNinja" },

14138 { 0x0CE5B5, "HUAWEI TECHNOLOGIES CO.,LTD" },

14139 { 0x0CE5D3, "DH electronics GmbH" },

14140 { 0x0CE709, "Fox Crypto B.V." },

14141 { 0x0CE725, "Microsoft Corporation" },

14142 { 0x0CE82F, "Bonfiglioli Vectron GmbH" },

14143 { 0x0CE936, "ELIMOS srl" },

14144 { 0x0CE99A, "ATLS ALTEC" },

14145 { 0x0CEAC9, "ARRIS Group, Inc." },

14146 { 0x0CEC80, "Texas Instruments" },

14147 { 0x0CEC84, "Shenzhen TINNO Mobile Technology Corp." },

14148 { 0x0CEC8D, "Motorola Mobility LLC, a Lenovo Company" },

14149 { 0x0CEE99, "Amazon Technologies Inc." },

14150 { 0x0CEEE6, "Hon Hai Precision Ind. Co.,Ltd." },

14151 { 0x0CEF7C, "AnaCom Inc" },

14152 { 0x0CEFAF, "IEEE Registration Authority" },

14153 { 0x0CEFF6, "Silicon Laboratories" },

14154 { 0x0CF019, "Malgn Technology Co., Ltd." },

14155 { 0x0CF0B4, "Globalsat International Technology Ltd" },

14156 { 0x0CF346, "Xiaomi Communications Co Ltd" },

14157 { 0x0CF361, "Java Information" },

14158 { 0x0CF3EE, "EM Microelectronic" },

14159 { 0x0CF405, "Beijing Signalway Technologies Co.,Ltd" },

14160 { 0x0CF475, "Zliide Technologies ApS" },

14161 { 0x0CF4D5, "Ruckus Wireless" },

14162 { 0x0CF5A4, "Cisco Systems, Inc" },

14163 { 0x0CF893, "ARRIS Group, Inc." },

14164 { 0x0CF9C0, "SKY UK LIMITED" },

14165 { 0x0CFC18, "HUAWEI TECHNOLOGIES CO.,LTD" },

14166 { 0x0CFC83, "Airoha Technology Corp.," },

14167 { 0x0CFD37, "SUSE Linux GmbH" },

14168 { 0x0CFE45, "Sony Interactive Entertainment Inc." },

14169 { 0x0CFE5D, "IEEE Registration Authority" },

14170 { 0x100000, "Private" },

14171 { 0x100020, "Apple, Inc." },

14172 { 0x10005A, "IBM Corp" },

14173 { 0x1000E8, "NATIONAL SEMICONDUCTOR" },

14174 { 0x1000FD, "LaonPeople" },

14175 { 0x100177, "HUAWEI TECHNOLOGIES CO.,LTD" },

14176 { 0x1001CA, "Ashley Butterworth" },

14177 { 0x1002B5, "Intel Corporate" },

14178 { 0x1004C1, "JD Cloud Computing Co., Ltd." },

14179 { 0x100501, "PEGATRON CORPORATION" },

14180 { 0x1005B1, "ARRIS Group, Inc." },

14181 { 0x1005CA, "Cisco Systems, Inc" },

14182 { 0x1005E1, "Nokia" },

14183 { 0x10061C, "Espressif Inc." },

14184 { 0x100645, "Sagemcom Broadband SAS" },

14185 { 0x100648, "IEEE Registration Authority" },

14186 { 0x1006ED, "Cisco Systems, Inc" },

14187 { 0x10071D, "Fiberhome Telecommunication Technologies Co.,LTD" },

14188 { 0x100723, "IEEE Registration Authority" },

14189 { 0x1007B6, "Samsung Electronics Co.,Ltd" },

14190 { 0x10082C, "Texas Instruments" },

14191 { 0x1008B1, "Hon Hai Precision Ind. Co.,Ltd." },

14192 { 0x10090C, "JANOME Corporation" },

14193 { 0x1009F9, "Amazon Technologies Inc." },

14194 { 0x100BA9, "Intel Corporate" },

14195 { 0x100C24, "pomdevices, LLC" },

14196 { 0x100C29, "Shenzhen NORCO lntelligent Technology Co.,Ltd" },

14197 { 0x100C6B, "NETGEAR" },

14198 { 0x100D2F, "Online Security Pty. Ltd." },

14199 { 0x100D32, "Embedian, Inc." },

14200 { 0x100D7F, "NETGEAR" },

14201 { 0x100E2B, "NEC CASIO Mobile Communications" },

14202 { 0x100E7E, "Juniper Networks" },

14203 { 0x100F18, "Fu Gang Electronic(KunShan)CO.,LTD" },

14204 { 0x101081, "zte corporation" },

14205 { 0x1010B6, "McCain Inc" },

14206 { 0x101212, "Vivo International Corporation Pty Ltd" },

14207 { 0x101218, "Korins Inc." },

14208 { 0x101248, "ITG, Inc." },

14209 { 0x101250, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

14210 { 0x1012B4, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

14211 { 0x1012D0, "zte corporation" },

14212 { 0x1012FB, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

14213 { 0x101331, "Technicolor Delivery Technologies Belgium NV" },

14214 { 0x1013EE, "Justec International Technology INC." },

14215 { 0x1015C1, "Zhanzuo (Beijing) Technology Co., Ltd." },

14216 { 0x101849, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

14217 { 0x10189E, "Elmo Motion Control" },

14218 { 0x101965, "New H3C Technologies Co., Ltd" },

14219 { 0x101B54, "HUAWEI TECHNOLOGIES CO.,LTD" },

14220 { 0x101C0C, "Apple, Inc." },

14221 { 0x101D51, "8Mesh Networks Limited" },

14222 { 0x101DC0, "Samsung Electronics Co.,Ltd" },

14223 { 0x101EDA, "INGENICO TERMINALS SAS" },

14224 { 0x101F74, "Hewlett Packard" },

14225 { 0x102279, "ZeroDesktop, Inc." },

14226 { 0x102407, "HUAWEI TECHNOLOGIES CO.,LTD" },

14227 { 0x102779, "Sadel S.p.A." },

14228 { 0x1027BE, "TVIP" },

14229 { 0x1027F5, "TP-Link Corporation Limited" },

14230 { 0x102831, "Morion Inc." },

14231 { 0x102834, "SALZ Automation GmbH" },

14232 { 0x102874, "Shenzhen Jingxun Technology Co., Ltd." },

14233 { 0x102959, "Apple, Inc." },

14234 { 0x1029AB, "Samsung Electronics Co.,Ltd" },

14235 { 0x102AB3, "Xiaomi Communications Co Ltd" },

14236 { 0x102B41, "Samsung Electronics Co.,Ltd" },

14237 { 0x102C6B, "AMPAK Technology, Inc." },

14238 { 0x102C83, "XIMEA" },

14239 { 0x102C8D, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

14240 { 0x102CB1, "Smart Innovation LLC" },

14241 { 0x102CEF, "EMU Electronic AG" },

14242 { 0x102D31, "Shenzhen Americas Trading Company LLC" },

14243 { 0x102D41, "Sichuan AI-Link Technology Co., Ltd." },

14244 { 0x102D96, "Looxcie Inc." },

14245 { 0x102E00, "Intel Corporate" },

14246 { 0x102EAF, "Texas Instruments" },

14247 { 0x102F6B, "Microsoft Corporation" },

14248 { 0x102FA3, "Shenzhen Uvision-tech Technology Co.Ltd" },

14249 { 0x103025, "Apple, Inc." },

14250 { 0x103034, "Cara Systems" },

14251 { 0x103047, "Samsung Electronics Co.,Ltd" },

14252 { 0x10321D, "HUAWEI TECHNOLOGIES CO.,LTD" },

14253 { 0x10322C, "Murata Manufacturing Co., Ltd." },

14254 { 0x10327E, "Huawei Device Co., Ltd." },

14255 { 0x103378, "FLECTRON Co., LTD" },

14256 { 0x1033BF, "Vantiva USA LLC" },

14257 { 0x10341B, "Spacelink" },

14258 { 0x10364A, "Boston Dynamics" },

14259 { 0x103711, "NORBIT ITS" },

14260 { 0x10381F, "Sichuan AI-Link Technology Co., Ltd." },

14261 { 0x103917, "Samsung Electronics Co.,Ltd" },

14262 { 0x10394E, "Hisense broadband multimedia technology Co.,Ltd" },

14263 { 0x1039E9, "Juniper Networks" },

14264 { 0x103B59, "Samsung Electronics Co.,Ltd" },

14265 { 0x103C59, "zte corporation" },

14266 { 0x103D0A, "Hui Zhou Gaoshengda Technology Co.,LTD" },

14267 { 0x103D1C, "Intel Corporate" },

14268 { 0x103D3E, "China Mobile Group Device Co.,Ltd." },

14269 { 0x103DEA, "HFC Technology (Beijing) Ltd. Co." },

14270 { 0x103F44, "Xiaomi Communications Co Ltd" },

14271 { 0x1040F3, "Apple, Inc." },

14272 { 0x104121, "TELLESCOM INDUSTRIA E COMERCIO EM TELECOMUNICACAO" },

14273 { 0x10417F, "Apple, Inc." },

14274 { 0x104369, "Soundmax Electronic Limited" },

14275 { 0x104400, "HUAWEI TECHNOLOGIES CO.,LTD" },

14276 { 0x10445A, "Shaanxi Hitech Electronic Co., LTD" },

14277 { 0x1045BE, "Norphonic AS" },

14278 { 0x1045F8, "LNT-Automation GmbH" },

14279 { 0x1046B4, "FormericaOE" },

14280 { 0x104738, "Nokia Shanghai Bell Co., Ltd." },

14281 { 0x104780, "HUAWEI TECHNOLOGIES CO.,LTD" },

14282 { 0x1048B1, "Beijing Duokan Technology Limited" },

14283 { 0x104963, "HARTING K.K." },

14284 { 0x104A7D, "Intel Corporate" },

14285 { 0x104B46, "Mitsubishi Electric Corporation" },

14286 { 0x104C43, "Fiberhome Telecommunication Technologies Co.,LTD" },

14287 { 0x104D15, "Viaanix Inc" },

14288 { 0x104D77, "Innovative Computer Engineering" },

14289 { 0x104E07, "Shanghai Genvision Industries Co.,Ltd" },

14290 { 0x104E89, "Garmin International" },

14291 { 0x104F58, "Aruba, a Hewlett Packard Enterprise Company" },

14292 { 0x104FA8, "Sony Corporation" },

14293 { 0x105072, "Sercomm Corporation." },

14294 { 0x105107, "Intel Corporate" },

14295 { 0x105172, "HUAWEI TECHNOLOGIES CO.,LTD" },

14296 { 0x10521C, "Espressif Inc." },

14297 { 0x105403, "INTARSO GmbH" },

14298 { 0x1054D2, "IEEE Registration Authority" },

14299 { 0x1055E4, "Shenzhen Skyworth Digital Technology CO., Ltd" },

14300 { 0x105611, "ARRIS Group, Inc." },

14301 { 0x1056CA, "Peplink International Ltd." },

14302 { 0x105887, "Fiberhome Telecommunication Technologies Co.,LTD" },

14303 { 0x105917, "Tonal" },

14304 { 0x105932, "Roku, Inc" },

14305 { 0x105A17, "Tuya Smart Inc." },

14306 { 0x105AF7, "ADB Italia" },

14307 { 0x105BAD, "Mega Well Limited" },

14308 { 0x105C3B, "Perma-Pipe, Inc." },

14309 { 0x105CBF, "DuroByte Inc" },

14310 { 0x105DDC, "Huawei Device Co., Ltd." },

14311 { 0x105F02, "Private" },

14312 { 0x105F06, "Actiontec Electronics, Inc" },

14313 { 0x105F49, "Cisco SPVTG" },

14314 { 0x105FD4, "Tendyron Corporation" },

14315 { 0x10604B, "Hewlett Packard" },

14316 { 0x1062C9, "Adatis GmbH & Co. KG" },

14317 { 0x1062D0, "Vantiva USA LLC" },

14318 { 0x1062E5, "Hewlett Packard" },

14319 { 0x1062EB, "D-Link International" },

14320 { 0x10634B, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

14321 { 0x1063C8, "Liteon Technology Corporation" },

14322 { 0x1064E2, "ADFweb.com s.r.l." },

14323 { 0x106530, "Dell Inc." },

14324 { 0x1065A3, "Panamax LLC" },

14325 { 0x1065CF, "IQSIM" },

14326 { 0x106650, "Robert Bosch JuP1" },

14327 { 0x106682, "NEC Platforms, Ltd." },

14328 { 0x106838, "AzureWave Technology Inc." },

14329 { 0x10683F, "LG Electronics (Mobile Communications)" },

14330 { 0x106F3F, "BUFFALO.INC" },

14331 { 0x106FD9, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

14332 { 0x106FEF, "Ad-Sol Nissin Corp" },

14333 { 0x1070FD, "Mellanox Technologies, Inc." },

14334 { 0x107100, "Huawei Device Co., Ltd." },

14335 { 0x1071B3, "Zyxel Communications Corporation" },

14336 { 0x1071F9, "Cloud Telecomputers, LLC" },

14337 { 0x1071FA, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

14338 { 0x107223, "TELLESCOM INDUSTRIA E COMERCIO EM TELECOMUNICACAO" },

14339 { 0x1073C6, "August Internet Limited" },

14340 { 0x1073EB, "Infiniti Electro-Optics" },

14341 { 0x10746F, "MOTOROLA SOLUTIONS MALAYSIA SDN. BHD." },

14342 { 0x107636, "Earda Technologies co Ltd" },

14343 { 0x10768A, "EoCell" },

14344 { 0x107717, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

14345 { 0x1077B0, "Fiberhome Telecommunication Technologies Co.,LTD" },

14346 { 0x1077B1, "Samsung Electronics Co.,Ltd" },

14347 { 0x10785B, "Actiontec Electronics, Inc" },

14348 { 0x107873, "Shenzhen Jinkeyi Communication Co., Ltd." },

14349 { 0x1078CE, "Hanvit SI, Inc." },

14350 { 0x1078D2, "Elitegroup Computer Systems Co.,Ltd." },

14351 { 0x107A86, "U&U ENGINEERING INC." },

14352 { 0x107B44, "ASUSTek COMPUTER INC." },

14353 { 0x107B93, "Zhen Shi Information Technology (Shanghai) Co., Ltd." },

14354 { 0x107BA4, "Olive & Dove Co.,Ltd." },

14355 { 0x107BCE, "Nokia" },

14356 { 0x107BEF, "Zyxel Communications Corporation" },

14357 { 0x107C61, "ASUSTek COMPUTER INC." },

14358 { 0x107D1A, "Dell Inc." },

14359 { 0x1081B4, "Hunan Greatwall Galaxy Science and Technology Co.,Ltd." },

14360 { 0x10823D, "Ruijie Networks Co.,LTD" },

14361 { 0x108286, "Luxshare Precision Industry Co.,Ltd" },

14362 { 0x1082D7, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

14363 { 0x1083D2, "Microseven Systems, LLC" },

14364 { 0x10868C, "ARRIS Group, Inc." },

14365 { 0x10880F, "Daruma Telecomunicações e Informática S.A." },

14366 { 0x1088CE, "Fiberhome Telecommunication Technologies Co.,LTD" },

14367 { 0x1089FB, "Samsung Electronics Co.,Ltd" },

14368 { 0x108A1B, "RAONIX Inc." },

14369 { 0x108A7B, "Nokia" },

14370 { 0x108B6A, "Antailiye Technology Co.,Ltd" },

14371 { 0x108CCF, "Cisco Systems, Inc" },

14372 { 0x108EBA, "Molekule" },

14373 { 0x108EE0, "Samsung Electronics Co.,Ltd" },

14374 { 0x108FFE, "HUAWEI TECHNOLOGIES CO.,LTD" },

14375 { 0x1090FA, "New H3C Technologies Co., Ltd" },

14376 { 0x1091A8, "Espressif Inc." },

14377 { 0x1091D1, "Intel Corporate" },

14378 { 0x109266, "Samsung Electronics Co.,Ltd" },

14379 { 0x109397, "ARRIS Group, Inc." },

14380 { 0x1093E9, "Apple, Inc." },

14381 { 0x109497, "Logitech Hong Kong" },

14382 { 0x1094BB, "Apple, Inc." },

14383 { 0x10954B, "Megabyte Ltd." },

14384 { 0x10961A, "CHIPSEA TECHNOLOGIES (SHENZHEN) CORP." },

14385 { 0x109693, "Amazon Technologies Inc." },

14386 { 0x1097BD, "Espressif Inc." },

14387 { 0x109826, "Nokia" },

14388 { 0x109836, "Dell Inc." },

14389 { 0x1098C3, "Murata Manufacturing Co., Ltd." },

14390 { 0x109AB9, "Tosibox Oy" },

14391 { 0x109ADD, "Apple, Inc." },

14392 { 0x109C70, "Prusa Research s.r.o." },

14393 { 0x109D7A, "Huawei Device Co., Ltd." },

14394 { 0x109D9C, "EM Microelectronic" },

14395 { 0x109E3A, "Zhejiang Tmall Technology Co., Ltd." },

14396 { 0x109F41, "Apple, Inc." },

14397 { 0x109F47, "Shenzhen Skyworth Digital Technology CO., Ltd" },

14398 { 0x109F4F, "New H3C Intelligence Terminal Co., Ltd." },

14399 { 0x109FA9, "Actiontec Electronics, Inc" },

14400 { 0x10A13B, "FUJIKURA RUBBER LTD." },

14401 { 0x10A24E, "GOLD3LINK ELECTRONICS CO., LTD" },

14402 { 0x10A2D3, "Apple, Inc." },

14403 { 0x10A3B8, "Iskratel d.o.o." },

14404 { 0x10A4B9, "Baidu Online Network Technology (Beijing) Co., Ltd" },

14405 { 0x10A4BE, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

14406 { 0x10A4DA, "HUAWEI TECHNOLOGIES CO.,LTD" },

14407 { 0x10A51D, "Intel Corporate" },

14408 { 0x10A562, "Iton Technology Corp." },

14409 { 0x10A5D0, "Murata Manufacturing Co., Ltd." },

14410 { 0x10A659, "Mobile Create Co.,Ltd." },

14411 { 0x10A743, "SK Mtek Limited" },

14412 { 0x10A793, "Vantiva USA LLC" },

14413 { 0x10A829, "Cisco Systems, Inc" },

14414 { 0x10A932, "Beijing Cyber Cloud Technology Co. ,Ltd." },

14415 { 0x10AE60, "Amazon Technologies Inc." },

14416 { 0x10AEA5, "Duskrise inc." },

14417 { 0x10AF78, "Shenzhen ATUE Technology Co., Ltd" },

14418 { 0x10B1DF, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

14419 { 0x10B1F8, "HUAWEI TECHNOLOGIES CO.,LTD" },

14420 { 0x10B232, "Qingdao Intelligent&Precise Electronics Co.,Ltd." },

14421 { 0x10B26B, "base Co.,Ltd." },

14422 { 0x10B36F, "Bowei Technology Company Limited" },

14423 { 0x10B3C6, "Cisco Systems, Inc" },

14424 { 0x10B3D5, "Cisco Systems, Inc" },

14425 { 0x10B3D6, "Cisco Systems, Inc" },

14426 { 0x10B588, "Apple, Inc." },

14427 { 0x10B713, "Private" },

14428 { 0x10B7A8, "CableFree Networks Limited" },

14429 { 0x10B7F6, "Plastoform Industries Ltd." },

14430 { 0x10B9C4, "Apple, Inc." },

14431 { 0x10B9F7, "Niko-Servodan" },

14432 { 0x10B9FE, "Lika srl" },

14433 { 0x10BAA5, "GANA I&C CO., LTD" },

14434 { 0x10BBF3, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

14435 { 0x10BC97, "vivo Mobile Communication Co., Ltd." },

14436 { 0x10BD18, "Cisco Systems, Inc" },

14437 { 0x10BD3A, "Apple, Inc." },

14438 { 0x10BD55, "Q-Lab Corporation" },

14439 { 0x10BE99, "Netberg" },

14440 { 0x10BEF5, "D-Link International" },

14441 { 0x10BF48, "ASUSTek COMPUTER INC." },

14442 { 0x10BF67, "Amazon Technologies Inc." },

14443 { 0x10C07C, "Blu-ray Disc Association" },

14444 { 0x10C172, "HUAWEI TECHNOLOGIES CO.,LTD" },

14445 { 0x10C22F, "China Entropy Co., Ltd." },

14446 { 0x10C25A, "Vantiva USA LLC" },

14447 { 0x10C2BA, "UTT Co., Ltd." },

14448 { 0x10C37B, "ASUSTek COMPUTER INC." },

14449 { 0x10C3AB, "HUAWEI TECHNOLOGIES CO.,LTD" },

14450 { 0x10C4CA, "HUMAX Co., Ltd." },

14451 { 0x10C586, "BIO SOUND LAB CO., LTD." },

14452 { 0x10C595, "Lenovo" },

14453 { 0x10C60C, "Domino UK Ltd" },

14454 { 0x10C61F, "HUAWEI TECHNOLOGIES CO.,LTD" },

14455 { 0x10C65E, "Adapt-IP" },

14456 { 0x10C67E, "SHENZHEN JUCHIN TECHNOLOGY CO., LTD" },

14457 { 0x10C6FC, "Garmin International" },

14458 { 0x10C73F, "Midas Klark Teknik Ltd" },

14459 { 0x10C753, "Qingdao Intelligent&Precise Electronics Co.,Ltd." },

14460 { 0x10C9CA, "Ace Technology Corp." },

14461 { 0x10CA81, "PRECIA" },

14462 { 0x10CABF, "Texas Instruments" },

14463 { 0x10CC1B, "Liverock technologies,INC" },

14464 { 0x10CCDB, "AXIMUM PRODUITS ELECTRONIQUES" },

14465 { 0x10CD6E, "FISYS" },

14466 { 0x10CDAE, "Avaya Inc" },

14467 { 0x10CDB6, "Essential Products, Inc." },

14468 { 0x10CE02, "Amazon Technologies Inc." },

14469 { 0x10CE45, "Miromico AG" },

14470 { 0x10CEA9, "Texas Instruments" },

14471 { 0x10CEE9, "Apple, Inc." },

14472 { 0x10CF0F, "Apple, Inc." },

14473 { 0x10D07A, "AMPAK Technology, Inc." },

14474 { 0x10D0AB, "zte corporation" },

14475 { 0x10D1DC, "INSTAR Deutschland GmbH" },

14476 { 0x10D38A, "Samsung Electronics Co.,Ltd" },

14477 { 0x10D542, "Samsung Electronics Co.,Ltd" },

14478 { 0x10D561, "Tuya Smart Inc." },

14479 { 0x10D680, "Tendyron Corporation" },

14480 { 0x10D7B0, "Sagemcom Broadband SAS" },

14481 { 0x10DA43, "NETGEAR" },

14482 { 0x10DA49, "Huawei Device Co., Ltd." },

14483 { 0x10DC4A, "Fiberhome Telecommunication Technologies Co.,LTD" },

14484 { 0x10DCB6, "IEEE Registration Authority" },

14485 { 0x10DDB1, "Apple, Inc." },

14486 { 0x10DDF4, "Maxway Electronics CO.,LTD" },

14487 { 0x10DEE4, "automationNEXT GmbH" },

14488 { 0x10DF8B, "Shenzhen CareDear Communication Technology Co.,Ltd" },

14489 { 0x10DFFC, "Siemens AG" },

14490 { 0x10E177, "ARRIS Group, Inc." },

14491 { 0x10E2C9, "Apple, Inc." },

14492 { 0x10E2D5, "Qi Hardware Inc." },

14493 { 0x10E3C7, "Seohwa Telecom" },

14494 { 0x10E4AF, "APR, LLC" },

14495 { 0x10E4C2, "Samsung Electronics Co.,Ltd" },

14496 { 0x10E68F, "KWANGSUNG ELECTRONICS KOREA CO.,LTD." },

14497 { 0x10E6AE, "Source Technologies, LLC" },

14498 { 0x10E77A, "STMicrolectronics International NV" },

14499 { 0x10E7C6, "Hewlett Packard" },

14500 { 0x10E83A, "FIBERX DISTRIBUIDORA DE PRODUTOS DE TELECOMUNICACAO LTDA" },

14501 { 0x10E840, "ZOWEE TECHNOLOGY(HEYUAN) CO., LTD." },

14502 { 0x10E878, "Nokia" },

14503 { 0x10E8A7, "Wistron Neweb Corporation" },

14504 { 0x10E8EE, "PhaseSpace" },

14505 { 0x10E953, "Huawei Device Co., Ltd." },

14506 { 0x10E992, "INGRAM MICRO SERVICES" },

14507 { 0x10EA59, "Cisco SPVTG" },

14508 { 0x10EC81, "Samsung Electronics Co.,Ltd" },

14509 { 0x10EED9, "Canoga Perkins Corporation" },

14510 { 0x10F005, "Intel Corporate" },

14511 { 0x10F068, "Ruckus Wireless" },

14512 { 0x10F163, "TNK CO.,LTD" },

14513 { 0x10F1F2, "LG Electronics (Mobile Communications)" },

14514 { 0x10F311, "Cisco Systems, Inc" },

14515 { 0x10F3DB, "Gridco Systems, Inc." },

14516 { 0x10F49A, "T3 Innovation" },

14517 { 0x10F605, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

14518 { 0x10F60A, "Intel Corporate" },

14519 { 0x10F681, "vivo Mobile Communication Co., Ltd." },

14520 { 0x10F920, "Cisco Systems, Inc" },

14521 { 0x10F96F, "LG Electronics (Mobile Communications)" },

14522 { 0x10F9EB, "Industria Fueguina de Relojería Electrónica s.a." },

14523 { 0x10F9EE, "Nokia Corporation" },

14524 { 0x10FACE, "Reacheng Communication Technology Co.,Ltd" },

14525 { 0x10FBF0, "KangSheng LTD." },

14526 { 0x10FC33, "Huawei Device Co., Ltd." },

14527 { 0x10FC54, "Shany Electronic Co., Ltd." },

14528 { 0x10FCB6, "mirusystems CO.,LTD" },

14529 { 0x10FEED, "TP-LINK TECHNOLOGIES CO.,LTD." },

14530 { 0x10FFE0, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

14531 { 0x1100AA, "Private" },

14532 { 0x111111, "Private" },

14533 { 0x140020, "LongSung Technology (Shanghai) Co.,Ltd." },

14534 { 0x14007D, "zte corporation" },

14535 { 0x1400E9, "Mitel Networks Corporation" },

14536 { 0x140152, "Samsung Electronics Co.,Ltd" },

14537 { 0x14019C, "Ubyon Inc." },

14538 { 0x1402EC, "Hewlett Packard Enterprise" },

14539 { 0x140467, "SNK Technologies Co.,Ltd." },

14540 { 0x14064C, "Vogl Electronic GmbH" },

14541 { 0x140708, "CP PLUS GMBH & CO. KG" },

14542 { 0x1407E0, "Abrantix AG" },

14543 { 0x1409B4, "zte corporation" },

14544 { 0x1409DC, "HUAWEI TECHNOLOGIES CO.,LTD" },

14545 { 0x140A29, "Tiinlab Corporation" },

14546 { 0x140AC5, "Amazon Technologies Inc." },

14547 { 0x140C5B, "PLNetworks" },

14548 { 0x140C76, "FREEBOX SAS" },

14549 { 0x140D4F, "Flextronics International" },

14550 { 0x140F42, "Nokia" },

14551 { 0x140FA6, "Renesas Electronics (Penang) Sdn. Bhd." },

14552 { 0x14109F, "Apple, Inc." },

14553 { 0x141114, "TECNO MOBILE LIMITED" },

14554 { 0x14115D, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

14555 { 0x14130B, "Garmin International" },

14556 { 0x141330, "Anakreon UK LLP" },

14557 { 0x141333, "AzureWave Technology Inc." },

14558 { 0x141346, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

14559 { 0x141357, "ATP Electronics, Inc." },

14560 { 0x1413FB, "HUAWEI TECHNOLOGIES CO.,LTD" },

14561 { 0x14144B, "Ruijie Networks Co.,LTD" },

14562 { 0x141459, "Vodafone Italia S.p.A." },

14563 { 0x1414E6, "Ningbo Sanhe Digital Co.,Ltd" },

14564 { 0x14157C, "TOKYO COSMOS ELECTRIC CO.,LTD." },

14565 { 0x14169D, "Cisco Systems, Inc" },

14566 { 0x14169E, "Wingtech Group (HongKong）Limited" },

14567 { 0x14172A, "Fiberhome Telecommunication Technologies Co.,LTD" },

14568 { 0x141844, "Xenon Smart Teknoloji Ltd." },

14569 { 0x141877, "Dell Inc." },

14570 { 0x1418C3, "Intel Corporate" },

14571 { 0x141973, "Beijing Yunyi Times Technology Co.,Ltd" },

14572 { 0x141A51, "Treetech Sistemas Digitais" },

14573 { 0x141A97, "Apple, Inc." },

14574 { 0x141AA3, "Motorola Mobility LLC, a Lenovo Company" },

14575 { 0x141AAA, "Metal Work SpA" },

14576 { 0x141B30, "Shenzhen Yipingfang Network Technology Co., Ltd." },

14577 { 0x141BBD, "Volex Inc." },

14578 { 0x141BF0, "Intellimedia Systems Ltd" },

14579 { 0x141F78, "Samsung Electronics Co.,Ltd" },

14580 { 0x141FBA, "IEEE Registration Authority" },

14581 { 0x14205E, "Apple, Inc." },

14582 { 0x142103, "Calix Inc." },

14583 { 0x142233, "Fiberhome Telecommunication Technologies Co.,LTD" },

14584 { 0x14223B, "Google, Inc." },

14585 { 0x1422DB, "eero inc." },

14586 { 0x14230A, "HUAWEI TECHNOLOGIES CO.,LTD" },

14587 { 0x1423D7, "EUTRONIX CO., LTD." },

14588 { 0x1423F2, "Broadcom Limited" },

14589 { 0x142475, "4DReplay, Inc" },

14590 { 0x142882, "MIDICOM ELECTRONICS CO.LTD" },

14591 { 0x142971, "NEMOA ELECTRONICS (HK) CO. LTD" },

14592 { 0x142A14, "ShenZhen Selenview Digital Technology Co.,Ltd" },

14593 { 0x142B2F, "Espressif Inc." },

14594 { 0x142BD2, "Armtel Ltd." },

14595 { 0x142BD6, "Guangdong Appscomm Co.,Ltd" },

14596 { 0x142C78, "GooWi Wireless Technology Co., Limited" },

14597 { 0x142D27, "Hon Hai Precision Ind. Co.,Ltd." },

14598 { 0x142D41, "Silicon Laboratories" },

14599 { 0x142D4D, "Apple, Inc." },

14600 { 0x142D79, "Fiberhome Telecommunication Technologies Co.,LTD" },

14601 { 0x142D8B, "Incipio Technologies, Inc" },

14602 { 0x142DF5, "Amphitech" },

14603 { 0x142E5E, "Sercomm Corporation." },

14604 { 0x142FFD, "LT SECURITY INC" },

14605 { 0x143004, "HUAWEI TECHNOLOGIES CO.,LTD" },

14606 { 0x14307A, "Avermetrics" },

14607 { 0x1430C6, "Motorola Mobility LLC, a Lenovo Company" },

14608 { 0x1432D1, "Samsung Electronics Co.,Ltd" },

14609 { 0x143365, "TEM Mobile Limited" },

14610 { 0x143375, "Zyxel Communications Corporation" },

14611 { 0x1434F6, "LV SOLUTION SDN. BHD." },

14612 { 0x14358B, "Mediabridge Products, LLC." },

14613 { 0x1435B3, "Future Designs, Inc." },

14614 { 0x143605, "Nokia Corporation" },

14615 { 0x1436C6, "Lenovo Mobile Communication Technology Ltd." },

14616 { 0x143719, "PT Prakarsa Visi Valutama" },

14617 { 0x14373B, "PROCOM Systems" },

14618 { 0x143AEA, "Dynapower Company LLC" },

14619 { 0x143B42, "Realfit(Shenzhen) Intelligent Technology Co., Ltd" },

14620 { 0x143B51, "Huawei Device Co., Ltd." },

14621 { 0x143CC3, "HUAWEI TECHNOLOGIES CO.,LTD" },

14622 { 0x143DF2, "Beijing Shidai Hongyuan Network Communication Co.,Ltd" },

14623 { 0x143E60, "Nokia" },

14624 { 0x143EBF, "zte corporation" },

14625 { 0x143F27, "Noccela Oy" },

14626 { 0x143FA6, "Sony Home Entertainment&Sound Products Inc" },

14627 { 0x143FC3, "SnapAV" },

14628 { 0x144146, "Honeywell (China) Co., LTD" },

14629 { 0x1441E2, "Monaco Enterprises, Inc." },

14630 { 0x1442FC, "Texas Instruments" },

14631 { 0x144319, "Creative&Link Technology Limited" },

14632 { 0x14444A, "Apollo Seiko Ltd." },

14633 { 0x14448F, "Edgecore Networks Corporation" },

14634 { 0x144658, "HUAWEI TECHNOLOGIES CO.,LTD" },

14635 { 0x1446E4, "AVISTEL" },

14636 { 0x14472D, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

14637 { 0x144802, "THE YEOLRIM Co.,Ltd." },

14638 { 0x14488B, "Shenzhen Doov Technology Co.,Ltd" },

14639 { 0x144920, "HUAWEI TECHNOLOGIES CO.,LTD" },

14640 { 0x144978, "Digital Control Incorporated" },

14641 { 0x1449BC, "DrayTek Corp." },

14642 { 0x1449D4, "Xiaomi Communications Co Ltd" },

14643 { 0x1449E0, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

14644 { 0x144C1A, "Max Communication GmbH" },

14645 { 0x144D67, "Zioncom Electronics (Shenzhen) Ltd." },

14646 { 0x144E2A, "Ciena Corporation" },

14647 { 0x144E34, "Remote Solution" },

14648 { 0x144F8A, "Intel Corporate" },

14649 { 0x144FD7, "IEEE Registration Authority" },

14650 { 0x145051, "SHARP Corporation" },

14651 { 0x145120, "Huawei Device Co., Ltd." },

14652 { 0x14517E, "New H3C Technologies Co., Ltd" },

14653 { 0x145290, "KNS Group LLC (YADRO Company)" },

14654 { 0x145412, "Entis Co., Ltd." },

14655 { 0x145594, "Huawei Device Co., Ltd." },

14656 { 0x1455B9, "Nokia Solutions and Networks GmbH & Co. KG" },

14657 { 0x14563A, "Huawei Device Co., Ltd." },

14658 { 0x145645, "Savitech Corp." },

14659 { 0x14568E, "Samsung Electronics Co.,Ltd" },

14660 { 0x145790, "Qingdao Haier Technology Co.,Ltd" },

14661 { 0x14579F, "HUAWEI TECHNOLOGIES CO.,LTD" },

14662 { 0x145808, "Taicang T&W Electronics" },

14663 { 0x1458D0, "Hewlett Packard" },

14664 { 0x1459C0, "NETGEAR" },

14665 { 0x1459C3, "Creative Chips GmbH" },

14666 { 0x145A05, "Apple, Inc." },

14667 { 0x145A83, "Logi-D inc" },

14668 { 0x145AFC, "Liteon Technology Corporation" },

14669 { 0x145BB9, "ConMet" },

14670 { 0x145BD1, "ARRIS Group, Inc." },

14671 { 0x145BE1, "nyantec GmbH" },

14672 { 0x145E45, "Bamboo Systems Group" },

14673 { 0x145E69, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

14674 { 0x145F94, "HUAWEI TECHNOLOGIES CO.,LTD" },

14675 { 0x146080, "zte corporation" },

14676 { 0x1460CB, "Apple, Inc." },

14677 { 0x146102, "Alps Alpine" },

14678 { 0x14612F, "Avaya Inc" },

14679 { 0x1461A4, "Honor Device Co., Ltd." },

14680 { 0x146308, "JABIL CIRCUIT (SHANGHAI) LTD." },

14681 { 0x14656A, "HUAWEI TECHNOLOGIES CO.,LTD" },

14682 { 0x1466B7, "Advanced Design Technology Pty Ltd" },

14683 { 0x1469A2, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

14684 { 0x146A0B, "Cypress Electronics Limited" },

14685 { 0x146B72, "Shenzhen Fortune Ship Technology Co., Ltd." },

14686 { 0x146B9A, "zte corporation" },

14687 { 0x146B9C, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

14688 { 0x146E0A, "Private" },

14689 { 0x147373, "TUBITAK UEKAE" },

14690 { 0x147411, "RIM" },

14691 { 0x14755B, "Intel Corporate" },

14692 { 0x147590, "TP-LINK TECHNOLOGIES CO.,LTD." },

14693 { 0x147740, "Huawei Device Co., Ltd." },

14694 { 0x14780B, "Varex Imaging Deutschland AG" },

14695 { 0x1479F3, "China Mobile Group Device Co.,Ltd." },

14696 { 0x147BAC, "Nokia" },

14697 { 0x147D05, "SERCOMM PHILIPPINES INC" },

14698 { 0x147DB3, "JOA TELECOM.CO.,LTD" },

14699 { 0x147DC5, "Murata Manufacturing Co., Ltd." },

14700 { 0x147DDA, "Apple, Inc." },

14701 { 0x147EA1, "Britania Eletrônicos S.A." },

14702 { 0x147F0F, "Texas Instruments" },

14703 { 0x147F67, "LG Innotek" },

14704 { 0x14825B, "Hefei Radio Communication Technology Co., Ltd" },

14705 { 0x148430, "MITAC COMPUTING TECHNOLOGY CORPORATION" },

14706 { 0x148473, "Cisco Systems, Inc" },

14707 { 0x148477, "New H3C Technologies Co., Ltd" },

14708 { 0x148509, "Apple, Inc." },

14709 { 0x148554, "Earda Technologies co Ltd" },

14710 { 0x14857F, "Intel Corporate" },

14711 { 0x148692, "TP-LINK TECHNOLOGIES CO.,LTD." },

14712 { 0x14876A, "Apple, Inc." },

14713 { 0x1488E6, "Apple, Inc." },

14714 { 0x148919, "2bps" },

14715 { 0x14893E, "VIXTEL TECHNOLOGIES LIMTED" },

14716 { 0x1489CB, "HUAWEI TECHNOLOGIES CO.,LTD" },

14717 { 0x1489FD, "Samsung Electronics Co.,Ltd" },

14718 { 0x148A70, "ADS GmbH" },

14719 { 0x148C4A, "HUAWEI TECHNOLOGIES CO.,LTD" },

14720 { 0x148F21, "Garmin International" },

14721 { 0x148FC6, "Apple, Inc." },

14722 { 0x149090, "KongTop industrial(shen zhen)CO.,LTD" },

14723 { 0x149138, "Amazon Technologies Inc." },

14724 { 0x149182, "Belkin International Inc." },

14725 { 0x149346, "PNI sensor corporation" },

14726 { 0x14942F, "USYS CO.,LTD." },

14727 { 0x149448, "BLU CASTLE S.A." },

14728 { 0x14946C, "Apple, Inc." },

14729 { 0x1495CE, "Apple, Inc." },

14730 { 0x14962D, "New H3C Technologies Co., Ltd" },

14731 { 0x1496E5, "Samsung Electronics Co.,Ltd" },

14732 { 0x149877, "Apple, Inc." },

14733 { 0x14987D, "Vantiva USA LLC" },

14734 { 0x14993E, "Xiaomi Communications Co Ltd" },

14735 { 0x1499E2, "Apple, Inc." },

14736 { 0x149A10, "Microsoft Corporation" },

14737 { 0x149B2F, "JiangSu ZhongXie Intelligent Technology co., LTD" },

14738 { 0x149BD7, "MULI MUWAI FURNITURE QIDONG CO., LTD" },

14739 { 0x149BF3, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

14740 { 0x149CEF, "Texas Instruments" },

14741 { 0x149D09, "HUAWEI TECHNOLOGIES CO.,LTD" },

14742 { 0x149D99, "Apple, Inc." },

14743 { 0x149E5D, "JSC IB Reform" },

14744 { 0x149ECF, "Dell Inc." },

14745 { 0x149F3C, "Samsung Electronics Co.,Ltd" },

14746 { 0x149F43, "Cisco Meraki" },

14747 { 0x149FB6, "GUANGDONG GENIUS TECHNOLOGY CO., LTD." },

14748 { 0x149FE8, "Lenovo Mobile Communication Technology Ltd." },

14749 { 0x14A0F8, "HUAWEI TECHNOLOGIES CO.,LTD" },

14750 { 0x14A1BF, "ASSA ABLOY Korea Co., Ltd Unilock" },

14751 { 0x14A1DF, "China Mobile Group Device Co.,Ltd." },

14752 { 0x14A2A0, "Cisco Systems, Inc" },

14753 { 0x14A32F, "Huawei Device Co., Ltd." },

14754 { 0x14A364, "Samsung Electronics Co.,Ltd" },

14755 { 0x14A3B4, "Huawei Device Co., Ltd." },

14756 { 0x14A417, "Shenzhen Belon Technology CO.,LTD" },

14757 { 0x14A51A, "HUAWEI TECHNOLOGIES CO.,LTD" },

14758 { 0x14A62C, "S.M. Dezac S.A." },

14759 { 0x14A72B, "currentoptronics Pvt.Ltd" },

14760 { 0x14A78B, "Zhejiang Dahua Technology Co., Ltd." },

14761 { 0x14A86B, "ShenZhen Telacom Science&Technology Co., Ltd" },

14762 { 0x14A9D0, "F5 Networks, Inc." },

14763 { 0x14A9E3, "MST CORPORATION" },

14764 { 0x14AB02, "HUAWEI TECHNOLOGIES CO.,LTD" },

14765 { 0x14AB56, "WUXI FUNIDE DIGITAL CO.,LTD" },

14766 { 0x14ABC5, "Intel Corporate" },

14767 { 0x14ABEC, "Aruba, a Hewlett Packard Enterprise Company" },

14768 { 0x14ABF0, "ARRIS Group, Inc." },

14769 { 0x14AC60, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

14770 { 0x14ADCA, "China Mobile Iot Limited company" },

14771 { 0x14AE68, "KLG Smartec" },

14772 { 0x14AE85, "IEEE Registration Authority" },

14773 { 0x14AEDB, "VTech Telecommunications Ltd." },

14774 { 0x14B126, "Industrial Software Co" },

14775 { 0x14B1C8, "InfiniWing, Inc." },

14776 { 0x14B2E5, "Shenzhen iComm Semiconductor CO.,LTD" },

14777 { 0x14B31F, "Dell Inc." },

14778 { 0x14B370, "Gigaset Digital Technology (Shenzhen) Co., Ltd." },

14779 { 0x14B3A1, "Juniper Networks" },

14780 { 0x14B457, "Silicon Laboratories" },

14781 { 0x14B484, "Samsung Electronics Co.,Ltd" },

14782 { 0x14B73D, "ARCHEAN Technologies" },

14783 { 0x14B7F8, "Vantiva USA LLC" },

14784 { 0x14B837, "Shenzhen YOUHUA Technology Co., Ltd" },

14785 { 0x14B968, "HUAWEI TECHNOLOGIES CO.,LTD" },

14786 { 0x14BB6E, "Samsung Electronics Co.,Ltd" },

14787 { 0x14BD61, "Apple, Inc." },

14788 { 0x14C03E, "ARRIS Group, Inc." },

14789 { 0x14C050, "GUANGDONG GENIUS TECHNOLOGY CO., LTD." },

14790 { 0x14C089, "DUNE HD LTD" },

14791 { 0x14C0A1, "UCloud Technology Co., Ltd." },

14792 { 0x14C126, "Nokia Corporation" },

14793 { 0x14C14E, "Google, Inc." },

14794 { 0x14C1FF, "ShenZhen QianHai Comlan communication Co.,LTD" },

14795 { 0x14C213, "Apple, Inc." },

14796 { 0x14C21D, "Sabtech Industries" },

14797 { 0x14C35E, "FibRSol Global Network Limited" },

14798 { 0x14C3C2, "K.A. Schmersal GmbH & Co. KG" },

14799 { 0x14C67D, "Vizio, Inc" },

14800 { 0x14C697, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

14801 { 0x14C88B, "Apple, Inc." },

14802 { 0x14C913, "LG Electronics" },

14803 { 0x14C9CF, "Sigmastar Technology Ltd." },

14804 { 0x14CA56, "zte corporation" },

14805 { 0x14CAA0, "Hu&Co" },

14806 { 0x14CB19, "HP Inc." },

14807 { 0x14CB49, "Habolink Technology Co.,LTD" },

14808 { 0x14CB65, "Microsoft Corporation" },

14809 { 0x14CC20, "TP-LINK TECHNOLOGIES CO.,LTD." },

14810 { 0x14CCB3, "AO GK NATEKS" },

14811 { 0x14CF8D, "OHSUNG" },

14812 { 0x14CF92, "TP-LINK TECHNOLOGIES CO.,LTD." },

14813 { 0x14CFE2, "ARRIS Group, Inc." },

14814 { 0x14D00D, "Apple, Inc." },

14815 { 0x14D11F, "HUAWEI TECHNOLOGIES CO.,LTD" },

14816 { 0x14D169, "HUAWEI TECHNOLOGIES CO.,LTD" },

14817 { 0x14D19E, "Apple, Inc." },

14818 { 0x14D424, "AzureWave Technology Inc." },

14819 { 0x14D4FE, "ARRIS Group, Inc." },

14820 { 0x14D64D, "D-Link International" },

14821 { 0x14D76E, "CONCH ELECTRONIC Co.,Ltd" },

14822 { 0x14D864, "TP-LINK TECHNOLOGIES CO.,LTD." },

14823 { 0x14DAB9, "Huawei Device Co., Ltd." },

14824 { 0x14DAE9, "ASUSTek COMPUTER INC." },

14825 { 0x14DB85, "S NET MEDIA" },

14826 { 0x14DC51, "Xiamen Cheerzing IOT Technology Co.,Ltd." },

14827 { 0x14DCE2, "THALES AVS France" },

14828 { 0x14DD02, "Liangang Optoelectronic Technology CO., Ltd." },

14829 { 0x14DD9C, "vivo Mobile Communication Co., Ltd." },

14830 { 0x14DDA9, "ASUSTek COMPUTER INC." },

14831 { 0x14DDE5, "MPMKVVCL" },

14832 { 0x14DE39, "Huawei Device Co., Ltd." },

14833 { 0x14E4EC, "mLogic LLC" },

14834 { 0x14E6E4, "TP-LINK TECHNOLOGIES CO.,LTD." },

14835 { 0x14E7C8, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

14836 { 0x14E9B2, "Fiberhome Telecommunication Technologies Co.,LTD" },

14837 { 0x14EB08, "HUAWEI TECHNOLOGIES CO.,LTD" },

14838 { 0x14EB33, "BSMediasoft Co., Ltd." },

14839 { 0x14EBB6, "TP-Link Corporation Limited" },

14840 { 0x14EDA5, "Wächter GmbH Sicherheitssysteme" },

14841 { 0x14EDBB, "2Wire Inc" },

14842 { 0x14EDE4, "Kaiam Corporation" },

14843 { 0x14EE9D, "AirNav Systems LLC" },

14844 { 0x14EFCF, "SCHREDER" },

14845 { 0x14F0C5, "Xtremio Ltd." },

14846 { 0x14F287, "Apple, Inc." },

14847 { 0x14F28E, "ShenYang ZhongKe-Allwin Technology Co.LTD" },

14848 { 0x14F42A, "Samsung Electronics Co.,Ltd" },

14849 { 0x14F592, "Shenzhen SDG DONZHI Technology Co., Ltd" },

14850 { 0x14F5F9, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

14851 { 0x14F65A, "Xiaomi Communications Co Ltd" },

14852 { 0x14F6D8, "Intel Corporate" },

14853 { 0x14F893, "Wuhan FiberHome Digital Technology Co.,Ltd." },

14854 { 0x14FB70, "Huawei Device Co., Ltd." },

14855 { 0x14FEAF, "SAGITTAR LIMITED" },

14856 { 0x14FEB5, "Dell Inc." },

14857 { 0x18002D, "Sony Corporation" },

14858 { 0x1800DB, "Fitbit Inc." },

14859 { 0x18017D, "Harbin Arteor technology co., LTD" },

14860 { 0x1801E3, "Bittium Wireless Ltd" },

14861 { 0x1801F1, "Xiaomi Communications Co Ltd" },

14862 { 0x18022D, "HUAWEI TECHNOLOGIES CO.,LTD" },

14863 { 0x1802AE, "vivo Mobile Communication Co., Ltd." },

14864 { 0x180373, "Dell Inc." },

14865 { 0x1803FA, "IBT Interfaces" },

14866 { 0x1804ED, "Texas Instruments" },

14867 { 0x180675, "Dilax Intelcom GmbH" },

14868 { 0x1806F5, "RAD Data Communications, Ltd." },

14869 { 0x1806FF, "Acer Computer(Shanghai) Limited." },

14870 { 0x180712, "Shenzhen Dazoo Technologies CO.,Ltd" },

14871 { 0x180B52, "Nanotron Technologies GmbH" },

14872 { 0x180C14, "iSonea Limited" },

14873 { 0x180C77, "Westinghouse Electric Company, LLC" },

14874 { 0x180CAC, "CANON INC." },

14875 { 0x180D2C, "Intelbras" },

14876 { 0x180EAC, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

14877 { 0x180F76, "D-Link International" },

14878 { 0x18104E, "CEDINT-UPM" },

14879 { 0x181171, "Guangzhou Doctorpai Education & Technology Co.,Ltd" },

14880 { 0x181212, "Cepton Technologies" },

14881 { 0x18132D, "zte corporation" },

14882 { 0x181420, "TEB SAS" },

14883 { 0x181456, "Nokia Corporation" },

14884 { 0x18146C, "Zhejiang Tmall Technology Co., Ltd." },

14885 { 0x1814AE, "Nokia" },

14886 { 0x1816C9, "Samsung Electronics Co.,Ltd" },

14887 { 0x1816E8, "Siliconware Precision Industries Co., Ltd." },

14888 { 0x181714, "DAEWOOIS" },

14889 { 0x181725, "Cameo Communications, Inc." },

14890 { 0x18188B, "FCNT LMITED" },

14891 { 0x18193F, "Tamtron Oy" },

14892 { 0x1819D6, "Samsung Electronics Co.,Ltd" },

14893 { 0x181BEB, "Actiontec Electronics, Inc" },

14894 { 0x181DEA, "Intel Corporate" },

14895 { 0x181E78, "Sagemcom Broadband SAS" },

14896 { 0x181E95, "AuVerte" },

14897 { 0x181EB0, "Samsung Electronics Co.,Ltd" },

14898 { 0x182012, "Aztech Associates Inc." },

14899 { 0x182032, "Apple, Inc." },

14900 { 0x18204C, "Kummler+Matter AG" },

14901 { 0x1820A6, "Sage Co., Ltd." },

14902 { 0x1820D5, "ARRIS Group, Inc." },

14903 { 0x182195, "Samsung Electronics Co.,Ltd" },

14904 { 0x18227E, "Samsung Electronics Co.,Ltd" },

14905 { 0x182649, "Intel Corporate" },

14906 { 0x182654, "Samsung Electronics Co.,Ltd" },

14907 { 0x182666, "Samsung Electronics Co.,Ltd" },

14908 { 0x182861, "AirTies Wireless Networks" },

14909 { 0x182A44, "HIROSE ELECTRONIC SYSTEM" },

14910 { 0x182A57, "HUAWEI TECHNOLOGIES CO.,LTD" },

14911 { 0x182A7B, "Nintendo Co., Ltd." },

14912 { 0x182AD3, "Juniper Networks" },

14913 { 0x182B05, "8D Technologies" },

14914 { 0x182C65, "Texas Instruments" },

14915 { 0x182C91, "Concept Development, Inc." },

14916 { 0x182CB4, "Nectarsoft Co., Ltd." },

14917 { 0x182D98, "Jinwoo Industrial system" },

14918 { 0x182DF7, "JY COMPANY" },

14919 { 0x183009, "Woojin Industrial Systems Co., Ltd." },

14920 { 0x18300C, "Hisense Electric Co.,Ltd" },

14921 { 0x18314F, "AIDIN ROBOTICS" },

14922 { 0x1831BF, "ASUSTek COMPUTER INC." },

14923 { 0x183219, "EM Microelectronic" },

14924 { 0x1832A2, "LAON TECHNOLOGY CO., LTD." },

14925 { 0x18339D, "Cisco Systems, Inc" },

14926 { 0x183451, "Apple, Inc." },

14927 { 0x1834AF, "Kaon Group Co., Ltd." },

14928 { 0x1835D1, "ARRIS Group, Inc." },

14929 { 0x183672, "Shaoxing ShunChuang Technology CO.,LTD" },

14930 { 0x1836FC, "Elecsys International Corporation" },

14931 { 0x183825, "Wuhan Lingjiu High-tech Co.,Ltd." },

14932 { 0x183864, "CAP-TECH INTERNATIONAL CO., LTD." },

14933 { 0x1838AE, "CONSPIN SOLUTION" },

14934 { 0x183919, "Unicoi Systems" },

14935 { 0x18396E, "SUNSEA TELECOMMUNICATIONS CO.,LTD." },

14936 { 0x18399C, "Skorpios Technologies" },

14937 { 0x183A2D, "Samsung Electronics Co.,Ltd" },

14938 { 0x183A48, "VostroNet" },

14939 { 0x183BD2, "BYD Precision Manufacture Company Ltd." },

14940 { 0x183C98, "Shenzhen Hengyi Technology Co., LTD" },

14941 { 0x183CB7, "Huawei Device Co., Ltd." },

14942 { 0x183D5E, "HUAWEI TECHNOLOGIES CO.,LTD" },

14943 { 0x183DA2, "Intel Corporate" },

14944 { 0x183EEF, "Apple, Inc." },

14945 { 0x183F47, "Samsung Electronics Co.,Ltd" },

14946 { 0x183F70, "Apple, Inc." },

14947 { 0x1840A4, "Shenzhen Trylong Smart Science and Technology Co., Ltd." },

14948 { 0x1841FE, "Digital 14" },

14949 { 0x18421D, "Private" },

14950 { 0x18422F, "Alcatel Lucent" },

14951 { 0x1842D4, "Wuhan Hosan Telecommunication Technology Co.,Ltd" },

14952 { 0x184462, "Riava Networks, Inc." },

14953 { 0x1844CF, "B+L Industrial Measurements GmbH" },

14954 { 0x1844E6, "zte corporation" },

14955 { 0x184516, "Texas Instruments" },

14956 { 0x184593, "Taicang T&W Electronics" },

14957 { 0x1845B3, "IEEE Registration Authority" },

14958 { 0x184617, "Samsung Electronics Co.,Ltd" },

14959 { 0x184644, "Home Control Singapore Pte Ltd" },

14960 { 0x18473D, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

14961 { 0x184859, "Castlenet Technology Inc." },

14962 { 0x1848BE, "Amazon Technologies Inc." },

14963 { 0x1848CA, "Murata Manufacturing Co., Ltd." },

14964 { 0x1848D8, "Fastback Networks" },

14965 { 0x1849F8, "Extreme Networks Headquarters" },

14966 { 0x184A53, "Apple, Inc." },

14967 { 0x184A6F, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

14968 { 0x184B0D, "Ruckus Wireless" },

14969 { 0x184BDF, "Caavo Inc" },

14970 { 0x184C08, "Rockwell Automation" },

14971 { 0x184CAE, "CONTINENTAL" },

14972 { 0x184E03, "HMD Global Oy" },

14973 { 0x184E16, "Samsung Electronics Co.,Ltd" },

14974 { 0x184E94, "MESSOA TECHNOLOGIES INC." },

14975 { 0x184ECB, "Samsung Electronics Co.,Ltd" },

14976 { 0x184F32, "Hon Hai Precision Ind. Co.,Ltd." },

14977 { 0x184F5D, "JRC Mobility Inc." },

14978 { 0x18502A, "SOARNEX" },

14979 { 0x185207, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

14980 { 0x18523D, "Xiamen Jiwu Technology CO.,Ltd" },

14981 { 0x185253, "Pixord Corporation" },

14982 { 0x185282, "Fiberhome Telecommunication Technologies Co.,LTD" },

14983 { 0x185345, "Nokia" },

14984 { 0x1853E0, "Hanyang Digitech Co.Ltd" },

14985 { 0x1854CF, "Samsung Electronics Co.,Ltd" },

14986 { 0x18550F, "Cisco SPVTG" },

14987 { 0x1855E3, "Apple, Inc." },

14988 { 0x185644, "HUAWEI TECHNOLOGIES CO.,LTD" },

14989 { 0x185680, "Intel Corporate" },

14990 { 0x1856C3, "Apple, Inc." },

14991 { 0x185869, "Sailer Electronic Co., Ltd" },

14992 { 0x185880, "Arcadyan Corporation" },

14993 { 0x185933, "Cisco SPVTG" },

14994 { 0x185936, "Xiaomi Communications Co Ltd" },

14995 { 0x1859F5, "Cisco Systems, Inc" },

14996 { 0x185A58, "Dell Inc." },

14997 { 0x185AE8, "Zenotech.Co.,Ltd" },

14998 { 0x185B00, "Nokia" },

14999 { 0x185BB3, "Samsung Electronics Co.,Ltd" },

15000 { 0x185D6F, "N3com" },

15001 { 0x185D9A, "BobjGear LLC" },

15002 { 0x185E0B, "zte corporation" },

15003 { 0x185E0F, "Intel Corporate" },

15004 { 0x186024, "Hewlett Packard" },

15005 { 0x1861C7, "lemonbeat GmbH" },

15006 { 0x18622C, "Sagemcom Broadband SAS" },

15007 { 0x1862E4, "Texas Instruments" },

15008 { 0x186472, "Aruba, a Hewlett Packard Enterprise Company" },

15009 { 0x186571, "Top Victory Electronics (Taiwan) Co., Ltd." },

15010 { 0x186590, "Apple, Inc." },

15011 { 0x1865C7, "Dongguan YIMO Technology Co.LTD" },

15012 { 0x1866C7, "Shenzhen Libre Technology Co., Ltd" },

15013 { 0x1866DA, "Dell Inc." },

15014 { 0x1866E3, "Veros Systems, Inc." },

15015 { 0x1866F0, "Jupiter Systems" },

15016 { 0x18673F, "Hanover Displays Limited" },

15017 { 0x186751, "KOMEG Industrielle Messtechnik GmbH" },

15018 { 0x1867B0, "Samsung Electronics Co.,Ltd" },

15019 { 0x18686A, "zte corporation" },

15020 { 0x186882, "Beward R&D Co., Ltd." },

15021 { 0x1868CB, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

15022 { 0x1869D4, "Samsung Electronics Co.,Ltd" },

15023 { 0x1869D8, "Tuya Smart Inc." },

15024 { 0x1869DA, "China Mobile Group Device Co.,Ltd." },

15025 { 0x186A81, "Sagemcom Broadband SAS" },

15026 { 0x186D99, "Adanis Inc." },

15027 { 0x186F2D, "Shenzhen Sundray Technologies Company Limited" },

15028 { 0x18703B, "Huawei Device Co., Ltd." },

15029 { 0x187117, "eta plus electronic gmbh" },

15030 { 0x1871D5, "Hazens Automotive Electronics(SZ)Co.,Ltd." },

15031 { 0x18742E, "Amazon Technologies Inc." },

15032 { 0x1874E2, "IEEE Registration Authority" },

15033 { 0x187532, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

15034 { 0x187758, "Audoo Limited (UK)" },

15035 { 0x1878D4, "Verizon" },

15036 { 0x1879A2, "GMJ ELECTRIC LIMITED" },

15037 { 0x1879FD, "zte corporation" },

15038 { 0x187A3B, "Aruba, a Hewlett Packard Enterprise Company" },

15039 { 0x187A3E, "Silicon Laboratories" },

15040 { 0x187A93, "AMICCOM Electronics Corporation" },

15041 { 0x187C0B, "Ruckus Wireless" },

15042 { 0x187C81, "Valeo Vision Systems" },

15043 { 0x187CAA, "China Mobile Group Device Co.,Ltd." },

15044 { 0x187EB9, "Apple, Inc." },

15045 { 0x187ED5, "shenzhen kaism technology Co. Ltd" },

15046 { 0x187F88, "Ring LLC" },

15047 { 0x188025, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

15048 { 0x188090, "Cisco Systems, Inc" },

15049 { 0x1880CE, "Barberry Solutions Ltd" },

15050 { 0x1880F5, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

15051 { 0x18810E, "Apple, Inc." },

15052 { 0x188219, "Alibaba Cloud Computing Ltd." },

15053 { 0x18828C, "Arcadyan Corporation" },

15054 { 0x188331, "Samsung Electronics Co.,Ltd" },

15055 { 0x1883BF, "Arcadyan Technology Corporation" },

15056 { 0x188410, "CoreTrust Inc." },

15057 { 0x1884C1, "Guangzhou Shiyuan Electronic Technology Company Limited" },

15058 { 0x18863A, "DIGITAL ART SYSTEM" },

15059 { 0x1886AC, "Nokia Danmark A/S" },

15060 { 0x188740, "Xiaomi Communications Co Ltd" },

15061 { 0x188796, "HTC Corporation" },

15062 { 0x188857, "Beijing Jinhong Xi-Dian Information Technology Corp." },

15063 { 0x18895B, "Samsung Electronics Co.,Ltd" },

15064 { 0x1889A0, "Wuhan Funshion Online Technologies Co.,Ltd" },

15065 { 0x1889CF, "TECNO MOBILE LIMITED" },

15066 { 0x1889DF, "OMNIVISION" },

15067 { 0x188A6A, "AVPro Global Hldgs" },

15068 { 0x188B15, "ShenZhen ZhongRuiJing Technology co.,LTD" },

15069 { 0x188B45, "Cisco Systems, Inc" },

15070 { 0x188B9D, "Cisco Systems, Inc" },

15071 { 0x188ED5, "TP Vision Belgium N.V. - innovation site Brugge" },

15072 { 0x188EF9, "G2C Co. Ltd." },

15073 { 0x189088, "eero inc." },

15074 { 0x1890D8, "Sagemcom Broadband SAS" },

15075 { 0x18922C, "Virtual Instruments" },

15076 { 0x1892A4, "Ciena Corporation" },

15077 { 0x189341, "Intel Corporate" },

15078 { 0x18937F, "AMPAK Technology, Inc." },

15079 { 0x1893D7, "Texas Instruments" },

15080 { 0x1894C6, "ShenZhen Chenyee Technology Co., Ltd." },

15081 { 0x189552, "1MORE" },

15082 { 0x189578, "DENSO Corporation" },

15083 { 0x1897FF, "TechFaith Wireless Technology Limited" },

15084 { 0x1899F5, "Sichuan Changhong Electric Ltd." },

15085 { 0x189A67, "CSE-Servelec Limited" },

15086 { 0x189BA5, "IEEE Registration Authority" },

15087 { 0x189C27, "ARRIS Group, Inc." },

15088 { 0x189C5D, "Cisco Systems, Inc" },

15089 { 0x189E2C, "Huawei Device Co., Ltd." },

15090 { 0x189EAD, "Shenzhen Chengqian Information Technology Co., Ltd" },

15091 { 0x189EFC, "Apple, Inc." },

15092 { 0x18A28A, "Essel-T Co., Ltd" },

15093 { 0x18A3E8, "Fiberhome Telecommunication Technologies Co.,LTD" },

15094 { 0x18A4A9, "Vanu Inc." },

15095 { 0x18A59C, "IEEE Registration Authority" },

15096 { 0x18A5FF, "Arcadyan Corporation" },

15097 { 0x18A6F7, "TP-LINK TECHNOLOGIES CO.,LTD." },

15098 { 0x18A788, "Shenzhen MEK Intellisys Pte Ltd" },

15099 { 0x18A7F1, "Qingdao Haier Technology Co.,Ltd" },

15100 { 0x18A905, "Hewlett Packard" },

15101 { 0x18A958, "PROVISION THAI CO., LTD." },

15102 { 0x18A99B, "Dell Inc." },

15103 { 0x18A9A6, "Nebra Ltd" },

15104 { 0x18AA0F, "Huawei Device Co., Ltd." },

15105 { 0x18AA1E, "Shenzhen Skyworth Digital Technology CO., Ltd" },

15106 { 0x18AA45, "Fon Technology" },

15107 { 0x18AACA, "Sichuan tianyi kanghe communications co., LTD" },

15108 { 0x18AB1D, "Samsung Electronics Co.,Ltd" },

15109 { 0x18ABF5, "Ultra Electronics Electrics" },

15110 { 0x18AC9E, "ITEL MOBILE LIMITED" },

15111 { 0x18AD4D, "Polostar Technology Corporation" },

15112 { 0x18AEBB, "Siemens Convergence Creators GmbH&Co.KG" },

15113 { 0x18AF61, "Apple, Inc." },

15114 { 0x18AF8F, "Apple, Inc." },

15115 { 0x18AF9F, "DIGITRONIC Automationsanlagen GmbH" },

15116 { 0x18AFA1, "Shenzhen Yifang Network Technology Co., Ltd." },

15117 { 0x18B169, "Sonicwall" },

15118 { 0x18B185, "Qiao Information Technology (Zhengzhou) Co., Ltd." },

15119 { 0x18B209, "Torrey Pines Logic, Inc" },

15120 { 0x18B3BA, "Netlogic AB" },

15121 { 0x18B430, "Nest Labs Inc." },

15122 { 0x18B591, "I-Storm" },

15123 { 0x18B6CC, "We Corporation Inc." },

15124 { 0x18B6F7, "NEW POS TECHNOLOGY LIMITED" },

15125 { 0x18B79E, "Invoxia" },

15126 { 0x18B81F, "ARRIS Group, Inc." },

15127 { 0x18B905, "Hong Kong Bouffalo Lab Limited" },

15128 { 0x18B96E, "Dongguan Liesheng Electronic Co., Ltd." },

15129 { 0x18BB1C, "Huawei Device Co., Ltd." },

15130 { 0x18BB26, "FN-LINK TECHNOLOGY LIMITED" },

15131 { 0x18BB41, "Huawei Device Co., Ltd." },

15132 { 0x18BC57, "ADVA Optical Networking Ltd." },

15133 { 0x18BC5A, "Zhejiang Tmall Technology Co., Ltd." },

15134 { 0x18BDAD, "L-TECH CORPORATION" },

15135 { 0x18BE92, "Delta Networks, Inc." },

15136 { 0x18BF1C, "Jiangsu Huitong Group Co.,Ltd." },

15137 { 0x18BFB3, "Samsung Electronics Co., Ltd., Memory Division" },

15138 { 0x18C007, "Huawei Device Co., Ltd." },

15139 { 0x18C009, "New H3C Technologies Co., Ltd" },

15140 { 0x18C04D, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

15141 { 0x18C086, "Broadcom" },

15142 { 0x18C19D, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

15143 { 0x18C23C, "Lumi United Technology Co., Ltd" },

15144 { 0x18C241, "SonicWall" },

15145 { 0x18C293, "Laird Connectivity" },

15146 { 0x18C2BF, "BUFFALO.INC" },

15147 { 0x18C300, "Nokia" },

15148 { 0x18C3F4, "IEEE Registration Authority" },

15149 { 0x18C451, "Tucson Embedded Systems" },

15150 { 0x18C501, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

15151 { 0x18C58A, "HUAWEI TECHNOLOGIES CO.,LTD" },

15152 { 0x18C8E7, "Shenzhen Hualistone Technology Co.,Ltd" },

15153 { 0x18CAA7, "zte corporation" },

15154 { 0x18CC18, "Intel Corporate" },

15155 { 0x18CC23, "Philio Technology Corporation" },

15156 { 0x18CC88, "Hitachi Johnson Controls Air" },

15157 { 0x18CE94, "Samsung Electronics Co.,Ltd" },

15158 { 0x18CF24, "HUAWEI TECHNOLOGIES CO.,LTD" },

15159 { 0x18CF5E, "Liteon Technology Corporation" },

15160 { 0x18D071, "DASAN CO., LTD." },

15161 { 0x18D0C5, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

15162 { 0x18D225, "Fiberhome Telecommunication Technologies Co.,LTD" },

15163 { 0x18D276, "HUAWEI TECHNOLOGIES CO.,LTD" },

15164 { 0x18D5B6, "SMG Holdings LLC" },

15165 { 0x18D61C, "Shenzhen TINNO Mobile Technology Corp." },

15166 { 0x18D66A, "Inmarsat" },

15167 { 0x18D6C7, "TP-LINK TECHNOLOGIES CO.,LTD." },

15168 { 0x18D6CF, "Kurth Electronic GmbH" },

15169 { 0x18D6DD, "HUAWEI TECHNOLOGIES CO.,LTD" },

15170 { 0x18D717, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

15171 { 0x18D793, "IEEE Registration Authority" },

15172 { 0x18D949, "Qvis Labs, LLC" },

15173 { 0x18D98F, "Huawei Device Co., Ltd." },

15174 { 0x18D9EF, "Shuttle Inc." },

15175 { 0x18DBF2, "Dell Inc." },

15176 { 0x18DC56, "Yulong Computer Telecommunication Scientific (Shenzhen) Co.,Ltd" },

15177 { 0x18DE50, "Tuya Smart Inc." },

15178 { 0x18DED7, "HUAWEI TECHNOLOGIES CO.,LTD" },

15179 { 0x18DFB4, "BOSUNG POWERTEC CO.,LTD." },

15180 { 0x18DFC1, "Aetheros" },

15181 { 0x18E1CA, "wanze" },

15182 { 0x18E1DE, "Chengdu ChipIntelli Technology Co., Ltd" },

15183 { 0x18E215, "Nokia" },

15184 { 0x18E288, "STT Condigi" },

15185 { 0x18E29F, "vivo Mobile Communication Co., Ltd." },

15186 { 0x18E2C2, "Samsung Electronics Co.,Ltd" },

15187 { 0x18E3BC, "TCT mobile ltd" },

15188 { 0x18E728, "Cisco Systems, Inc" },

15189 { 0x18E777, "vivo Mobile Communication Co., Ltd." },

15190 { 0x18E7B0, "Apple, Inc." },

15191 { 0x18E7F4, "Apple, Inc." },

15192 { 0x18E80F, "Viking Electronics Inc." },

15193 { 0x18E829, "Ubiquiti Inc" },

15194 { 0x18E83B, "Citadel Wallet LLC" },

15195 { 0x18E8DD, "MODULETEK" },

15196 { 0x18E91D, "HUAWEI TECHNOLOGIES CO.,LTD" },

15197 { 0x18ECE7, "BUFFALO.INC" },

15198 { 0x18EE69, "Apple, Inc." },

15199 { 0x18EE86, "Novatel Wireless Solutions, Inc." },

15200 { 0x18EF3A, "Sichuan AI-Link Technology Co., Ltd." },

15201 { 0x18EF63, "Cisco Systems, Inc" },

15202 { 0x18F0E4, "Xiaomi Communications Co Ltd" },

15203 { 0x18F145, "NetComm Wireless Limited" },

15204 { 0x18F18E, "ChipER Technology co. ltd" },

15205 { 0x18F1D8, "Apple, Inc." },

15206 { 0x18F22C, "TP-LINK TECHNOLOGIES CO.,LTD." },

15207 { 0x18F292, "Shannon Systems" },

15208 { 0x18F46A, "Hon Hai Precision Ind. Co.,Ltd." },

15209 { 0x18F46B, "Telenor Connexion AB" },

15210 { 0x18F643, "Apple, Inc." },

15211 { 0x18F650, "Multimedia Pacific Limited" },

15212 { 0x18F697, "Axiom Memory Solutions, Inc." },

15213 { 0x18F76B, "Zhejiang Winsight Technology CO.,LTD" },

15214 { 0x18F87A, "i3 International Inc." },

15215 { 0x18F87F, "Wha Yu Industrial Co., Ltd." },

15216 { 0x18F935, "Cisco Systems, Inc" },

15217 { 0x18F9C4, "BAE Systems" },

15218 { 0x18FA6F, "ISC applied systems corp" },

15219 { 0x18FAB7, "Apple, Inc." },

15220 { 0x18FB7B, "Dell Inc." },

15221 { 0x18FC26, "Qorvo International Pte. Ltd." },

15222 { 0x18FC9F, "Changhe Electronics Co., Ltd." },

15223 { 0x18FD74, "Routerboard.com" },

15224 { 0x18FDCB, "IEEE Registration Authority" },

15225 { 0x18FE34, "Espressif Inc." },

15226 { 0x18FF0F, "Intel Corporate" },

15227 { 0x18FF2E, "Shenzhen Rui Ying Da Technology Co., Ltd" },

15228 { 0x1C0042, "NARI Technology Co., Ltd." },

15229 { 0x1C012D, "Ficer Technology" },

15230 { 0x1C0219, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

15231 { 0x1C05B7, "Chongqing Trantor Technology Co., Ltd." },

15232 { 0x1C0656, "IDY Corporation" },

15233 { 0x1C08C1, "LG Innotek" },

15234 { 0x1C0B52, "EPICOM S.A" },

15235 { 0x1C0D7D, "Apple, Inc." },

15236 { 0x1C0ED3, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

15237 { 0x1C0FAF, "Lucid Vision Labs" },

15238 { 0x1C0FCF, "Sypro Optics GmbH" },

15239 { 0x1C1161, "Ciena Corporation" },

15240 { 0x1C11E1, "Wartsila Finland Oy" },

15241 { 0x1C129D, "IEEE PES PSRC/SUB" },

15242 { 0x1C12B0, "Amazon Technologies Inc." },

15243 { 0x1C1338, "Kimball Electronics Group, LLC" },

15244 { 0x1C1386, "Huawei Device Co., Ltd." },

15245 { 0x1C1448, "ARRIS Group, Inc." },

15246 { 0x1C14B3, "Airwire Technologies" },

15247 { 0x1C151F, "HUAWEI TECHNOLOGIES CO.,LTD" },

15248 { 0x1C17D3, "Cisco Systems, Inc" },

15249 { 0x1C184A, "ShenZhen RicherLink Technologies Co.,LTD" },

15250 { 0x1C19DE, "eyevis GmbH" },

15251 { 0x1C1A1B, "Shanghai Sunmi Technology Co.,Ltd." },

15252 { 0x1C1AC0, "Apple, Inc." },

15253 { 0x1C1ADF, "Microsoft Corporation" },

15254 { 0x1C1B0D, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

15255 { 0x1C1B68, "ARRIS Group, Inc." },

15256 { 0x1C1BB5, "Intel Corporate" },

15257 { 0x1C1CFD, "Dalian Hi-Think Computer Technology, Corp" },

15258 { 0x1C1D67, "HUAWEI TECHNOLOGIES CO.,LTD" },

15259 { 0x1C1D86, "Cisco Systems, Inc" },

15260 { 0x1C1E38, "PCCW Global, Inc." },

15261 { 0x1C1EE3, "Hui Zhou Gaoshengda Technology Co.,LTD" },

15262 { 0x1C1FD4, "LifeBEAM Technologies LTD" },

15263 { 0x1C1FF1, "Huawei Device Co., Ltd." },

15264 { 0x1C20DB, "HUAWEI TECHNOLOGIES CO.,LTD" },

15265 { 0x1C2156, "Smappee NV" },

15266 { 0x1C21D1, "IEEE Registration Authority" },

15267 { 0x1C2285, "Serrature Meroni SpA" },

15268 { 0x1C232C, "Samsung Electronics Co.,Ltd" },

15269 { 0x1C234F, "EDMI Europe Ltd" },

15270 { 0x1C24CD, "ASKEY COMPUTER CORP" },

15271 { 0x1C24EB, "Burlywood" },

15272 { 0x1C25E1, "China Mobile IOT Company Limited" },

15273 { 0x1C2704, "zte corporation" },

15274 { 0x1C27DD, "Datang Gohighsec(zhejiang)Information Technology Co.,Ltd." },

15275 { 0x1C28AF, "Aruba, a Hewlett Packard Enterprise Company" },

15276 { 0x1C2A8B, "Nokia" },

15277 { 0x1C2AA3, "Shenzhen HongRui Optical Technology Co., Ltd." },

15278 { 0x1C2AB0, "Beijing Xiaomi Electronics Co.,Ltd" },

15279 { 0x1C2CE0, "Shanghai Mountain View Silicon" },

15280 { 0x1C2E1B, "Suzhou Tremenet Communication Technology Co., Ltd." },

15281 { 0x1C2FA2, "Guangzhou Shiyuan Electronic Technology Company Limited" },

15282 { 0x1C3008, "Hui Zhou Gaoshengda Technology Co.,LTD" },

15283 { 0x1C3283, "COMTTI Intelligent Technology(Shenzhen) Co., Ltd." },

15284 { 0x1C330E, "PernixData" },

15285 { 0x1C334D, "ITS Telecom" },

15286 { 0x1C3477, "Innovation Wireless" },

15287 { 0x1C34DA, "Mellanox Technologies, Inc." },

15288 { 0x1C34F1, "Silicon Laboratories" },

15289 { 0x1C35F1, "NEW Lift Neue Elektronische Wege Steuerungsbau GmbH" },

15290 { 0x1C36BB, "Apple, Inc." },

15291 { 0x1C37BF, "Cloudium Systems Ltd." },

15292 { 0x1C3929, "OHSUNG" },

15293 { 0x1C3947, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

15294 { 0x1C398A, "Fiberhome Telecommunication Technologies Co.,LTD" },

15295 { 0x1C3A4F, "AccuSpec Electronics, LLC" },

15296 { 0x1C3A60, "Ruckus Wireless" },

15297 { 0x1C3ADE, "Samsung Electronics Co.,Ltd" },

15298 { 0x1C3B01, "Shanghai Xiaodu Technology Limited" },

15299 { 0x1C3B62, "HMD Global Oy" },

15300 { 0x1C3B8F, "Selve GmbH & Co. KG" },

15301 { 0x1C3BF3, "TP-LINK TECHNOLOGIES CO.,LTD." },

15302 { 0x1C3CD4, "HUAWEI TECHNOLOGIES CO.,LTD" },

15303 { 0x1C3D2F, "HUAWEI TECHNOLOGIES CO.,LTD" },

15304 { 0x1C3DE7, "Sigma Koki Co.,Ltd." },

15305 { 0x1C3E84, "Hon Hai Precision Ind. Co.,Ltd." },

15306 { 0x1C4024, "Dell Inc." },

15307 { 0x1C40E8, "SHENZHEN PROGRESS&WIN TECHNOLOGY CO.,LTD" },

15308 { 0x1C4158, "Gemalto M2M GmbH" },

15309 { 0x1C4176, "China Mobile Group Device Co.,Ltd." },

15310 { 0x1C4190, "Universal Electronics, Inc." },

15311 { 0x1C427D, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

15312 { 0x1C4363, "HUAWEI TECHNOLOGIES CO.,LTD" },

15313 { 0x1C43EC, "JAPAN CIRCUIT CO.,LTD" },

15314 { 0x1C4419, "TP-LINK TECHNOLOGIES CO.,LTD." },

15315 { 0x1C4455, "Sieb & Meyer AG" },

15316 { 0x1C4586, "Nintendo Co.,Ltd" },

15317 { 0x1C4593, "Texas Instruments" },

15318 { 0x1C45C2, "Huizhou City Sunsin lntelligent Technology Co.,Ltd" },

15319 { 0x1C46D1, "SKY UK LIMITED" },

15320 { 0x1C472F, "Huawei Device Co., Ltd." },

15321 { 0x1C47F6, "Zhidao Network Technology(Shenzhen) Co.,Ltd" },

15322 { 0x1C4840, "IMS Messsysteme GmbH" },

15323 { 0x1C48CE, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

15324 { 0x1C48F9, "GN Netcom A/S" },

15325 { 0x1C497B, "Gemtek Technology Co., Ltd." },

15326 { 0x1C4AF7, "AMON INC" },

15327 { 0x1C4BB9, "SMG ENTERPRISE, LLC" },

15328 { 0x1C4BD6, "AzureWave Technology Inc." },

15329 { 0x1C4C27, "World WLAN Application Alliance" },

15330 { 0x1C4C48, "ITEL MOBILE LIMITED" },

15331 { 0x1C4D66, "Amazon Technologies Inc." },

15332 { 0x1C4D70, "Intel Corporate" },

15333 { 0x1C501E, "Sunplus Technology Co., Ltd." },

15334 { 0x1C51B5, "Techaya LTD" },

15335 { 0x1C5216, "DONGGUAN HELE ELECTRONICS CO., LTD" },

15336 { 0x1C52D6, "FLAT DISPLAY TECHNOLOGY CORPORATION" },

15337 { 0x1C53F9, "Google, Inc." },

15338 { 0x1C549E, "Universal Electronics, Inc." },

15339 { 0x1C54E6, "Shenzhen Yisheng Technology Co.,Ltd" },

15340 { 0x1C553A, "QianGua Corp." },

15341 { 0x1C568E, "Zioncom Electronics (Shenzhen) Ltd." },

15342 { 0x1C56FE, "Motorola Mobility LLC, a Lenovo Company" },

15343 { 0x1C573E, "Altice Labs S.A." },

15344 { 0x1C57D8, "Kraftway Corporation PLC" },

15345 { 0x1C57DC, "Apple, Inc." },

15346 { 0x1C5974, "IEEE Registration Authority" },

15347 { 0x1C599B, "HUAWEI TECHNOLOGIES CO.,LTD" },

15348 { 0x1C5A0B, "Tegile Systems" },

15349 { 0x1C5A3E, "Samsung Electronics Co.,Ltd" },

15350 { 0x1C5A6B, "Philips Electronics Nederland BV" },

15351 { 0x1C5C55, "PRIMA Cinema, Inc" },

15352 { 0x1C5C60, "Shenzhen Belzon Technology Co.,LTD." },

15353 { 0x1C5CF2, "Apple, Inc." },

15354 { 0x1C5D80, "Mitubishi Hitachi Power Systems Industries Co., Ltd." },

15355 { 0x1C5EE6, "SHENZHEN TWOWING TECHNOLOGIES CO.,LTD." },

15356 { 0x1C5F2B, "D-Link International" },

15357 { 0x1C5FFF, "Beijing Ereneben Information Technology Co.,Ltd Shenzhen Branch" },

15358 { 0x1C6066, "TEJAS NETWORKS LTD" },

15359 { 0x1C60D2, "Fiberhome Telecommunication Technologies Co.,LTD" },

15360 { 0x1C60DE, "MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

15361 { 0x1C61B4, "TP-Link Corporation Limited" },

15362 { 0x1C62B8, "Samsung Electronics Co.,Ltd" },

15363 { 0x1C6349, "Texas Instruments" },

15364 { 0x1C63A5, "securityplatform" },

15365 { 0x1C63B7, "OpenProducts 237 AB" },

15366 { 0x1C63BF, "SHENZHEN BROADTEL TELECOM CO.,LTD" },

15367 { 0x1C6499, "Comtrend Corporation" },

15368 { 0x1C659D, "Liteon Technology Corporation" },

15369 { 0x1C666D, "Hon Hai Precision Ind. Co.,Ltd." },

15370 { 0x1C66AA, "Samsung Electronics Co.,Ltd" },

15371 { 0x1C674A, "zte corporation" },

15372 { 0x1C6758, "HUAWEI TECHNOLOGIES CO.,LTD" },

15373 { 0x1C6760, "Phonesuite" },

15374 { 0x1C687E, "Shenzhen Qihu Intelligent Technology Company Limited" },

15375 { 0x1C697A, "EliteGroup Computer Systems Co., LTD" },

15376 { 0x1C69A5, "BlackBerry RTS" },

15377 { 0x1C6A76, "Apple, Inc." },

15378 { 0x1C6A7A, "Cisco Systems, Inc" },

15379 { 0x1C6BCA, "Mitsunami Co., Ltd." },

15380 { 0x1C6E4C, "Logistic Service & Engineering Co.,Ltd" },

15381 { 0x1C6E74, "EnOcean Edge Inc." },

15382 { 0x1C6E76, "Quarion Technology Inc" },

15383 { 0x1C6EE6, "NHNETWORKS" },

15384 { 0x1C6F65, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

15385 { 0x1C7022, "Murata Manufacturing Co., Ltd." },

15386 { 0x1C70C9, "Jiangsu Aisida Electronic Co., Ltd" },

15387 { 0x1C7125, "Apple, Inc." },

15388 { 0x1C721D, "Dell Inc." },

15389 { 0x1C7328, "Connected Home" },

15390 { 0x1C7370, "Neotech" },

15391 { 0x1C73E2, "HUAWEI TECHNOLOGIES CO.,LTD" },

15392 { 0x1C740D, "Zyxel Communications Corporation" },

15393 { 0x1C7508, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

15394 { 0x1C76CA, "Terasic Technologies Inc." },

15395 { 0x1C76F2, "Samsung Electronics Co.,Ltd" },

15396 { 0x1C77F6, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

15397 { 0x1C7839, "Shenzhen Tencent Computer System Co., Ltd." },

15398 { 0x1C784E, "China Mobile Iot Limited company" },

15399 { 0x1C7ACF, "vivo Mobile Communication Co., Ltd." },

15400 { 0x1C7B21, "Sony Corporation" },

15401 { 0x1C7B23, "Qingdao Hisense Communications Co.,Ltd." },

15402 { 0x1C7C11, "EID" },

15403 { 0x1C7C45, "Vitek Industrial Video Products, Inc." },

15404 { 0x1C7C98, "NEC Platforms, Ltd." },

15405 { 0x1C7CC7, "Coriant GmbH" },

15406 { 0x1C7D22, "FUJIFILM Business Innovation Corp." },

15407 { 0x1C7E51, "3bumen.com" },

15408 { 0x1C7EE5, "D-Link International" },

15409 { 0x1C7F2C, "HUAWEI TECHNOLOGIES CO.,LTD" },

15410 { 0x1C8259, "IEEE Registration Authority" },

15411 { 0x1C8341, "Hefei Bitland Information Technology Co.Ltd" },

15412 { 0x1C83B0, "Linked IP GmbH" },

15413 { 0x1C8464, "FORMOSA WIRELESS COMMUNICATION CORP." },

15414 { 0x1C860B, "Guangdong Taiying Technology Co.,Ltd" },

15415 { 0x1C8682, "Apple, Inc." },

15416 { 0x1C869A, "Samsung Electronics Co.,Ltd" },

15417 { 0x1C86AD, "MCT CO., LTD." },

15418 { 0x1C872C, "ASUSTek COMPUTER INC." },

15419 { 0x1C87E3, "TECNO MOBILE LIMITED" },

15420 { 0x1C880C, "Shenzhen Skyworth Digital Technology CO., Ltd" },

15421 { 0x1C8B76, "Calix Inc." },

15422 { 0x1C8BEF, "Beijing Xiaomi Electronics Co.,Ltd" },

15423 { 0x1C8E5C, "HUAWEI TECHNOLOGIES CO.,LTD" },

15424 { 0x1C8E8E, "DB Communication & Systems Co., ltd." },

15425 { 0x1C8F8A, "Phase Motion Control SpA" },

15426 { 0x1C90BE, "Ericsson AB" },

15427 { 0x1C90FF, "Tuya Smart Inc." },

15428 { 0x1C9148, "Apple, Inc." },

15429 { 0x1C9179, "Integrated System Technologies Ltd" },

15430 { 0x1C9180, "Apple, Inc." },

15431 { 0x1C919D, "Dongguan Liesheng Electronic Co., Ltd." },

15432 { 0x1C937C, "ARRIS Group, Inc." },

15433 { 0x1C93C4, "Amazon Technologies Inc." },

15434 { 0x1C9492, "RUAG Schweiz AG" },

15435 { 0x1C955D, "I-LAX ELECTRONICS INC." },

15436 { 0x1C959F, "Veethree Electronics And Marine LLC" },

15437 { 0x1C965A, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

15438 { 0x1C973D, "PRICOM Design" },

15439 { 0x1C97C5, "Ynomia Pty Ltd" },

15440 { 0x1C97FB, "CoolBitX Ltd." },

15441 { 0x1C98C1, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

15442 { 0x1C98EC, "Hewlett Packard Enterprise" },

15443 { 0x1C994C, "Murata Manufacturing Co., Ltd." },

15444 { 0x1C9957, "Intel Corporate" },

15445 { 0x1C9C26, "Zoovel Technologies" },

15446 { 0x1C9C8C, "Juniper Networks" },

15447 { 0x1C9D3E, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

15448 { 0x1C9D72, "Vantiva USA LLC" },

15449 { 0x1C9DC2, "Espressif Inc." },

15450 { 0x1C9E46, "Apple, Inc." },

15451 { 0x1C9ECB, "Beijing Nari Smartchip Microelectronics Company Limited" },

15452 { 0x1C9ECC, "Vantiva USA LLC" },

15453 { 0x1C9F4E, "COOSEA GROUP (HK) COMPANY LIMITED" },

15454 { 0x1CA0B8, "Hon Hai Precision Industry Co., Ltd." },

15455 { 0x1CA0D3, "IEEE Registration Authority" },

15456 { 0x1CA0EF, "IEEE Registration Authority" },

15457 { 0x1CA2B1, "ruwido austria gmbh" },

15458 { 0x1CA410, "Amlogic, Inc." },

15459 { 0x1CA532, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

15460 { 0x1CA681, "HUAWEI TECHNOLOGIES CO.,LTD" },

15461 { 0x1CA770, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

15462 { 0x1CA852, "SENSAIO PTE LTD" },

15463 { 0x1CAA07, "Cisco Systems, Inc" },

15464 { 0x1CAB01, "Innovolt" },

15465 { 0x1CAB34, "New H3C Technologies Co., Ltd" },

15466 { 0x1CAB48, "TECNO MOBILE LIMITED" },

15467 { 0x1CABA7, "Apple, Inc." },

15468 { 0x1CABC0, "Hitron Technologies. Inc" },

15469 { 0x1CADD1, "Bosung Electronics Co., Ltd." },

15470 { 0x1CAE3E, "IEEE Registration Authority" },

15471 { 0x1CAECB, "HUAWEI TECHNOLOGIES CO.,LTD" },

15472 { 0x1CAF05, "Samsung Electronics Co.,Ltd" },

15473 { 0x1CAF4A, "Samsung Electronics Co.,Ltd" },

15474 { 0x1CAFF7, "D-Link International" },

15475 { 0x1CB044, "ASKEY COMPUTER CORP" },

15476 { 0x1CB094, "HTC Corporation" },

15477 { 0x1CB17F, "NEC Platforms, Ltd." },

15478 { 0x1CB243, "TDC A/S" },

15479 { 0x1CB3C9, "Apple, Inc." },

15480 { 0x1CB3E9, "Shenzhen Zhongke United Communication Technology" },

15481 { 0x1CB72C, "ASUSTek COMPUTER INC." },

15482 { 0x1CB796, "HUAWEI TECHNOLOGIES CO.,LTD" },

15483 { 0x1CB857, "Becon Technologies Co,.Ltd." },

15484 { 0x1CB8BA, "XIAMEN LEELEN TECHNOLOGY CO., LTD" },

15485 { 0x1CB9C4, "Ruckus Wireless" },

15486 { 0x1CBA8C, "Texas Instruments" },

15487 { 0x1CBBA8, "OJSC Ufimskiy Zavod Promsvyaz" },

15488 { 0x1CBCEC, "silex technology, Inc." },

15489 { 0x1CBD0E, "Amplified Engineering Pty Ltd" },

15490 { 0x1CBDB9, "D-Link International" },

15491 { 0x1CBFC0, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

15492 { 0x1CBFCE, "Shenzhen Century Xinyang Technology Co., Ltd" },

15493 { 0x1CC035, "PLANEX COMMUNICATIONS INC." },

15494 { 0x1CC0E1, "IEEE Registration Authority" },

15495 { 0x1CC10C, "Intel Corporate" },

15496 { 0x1CC11A, "Wavetronix" },

15497 { 0x1CC1BC, "Yichip Microelectronics (Hangzhou) Co.,Ltd" },

15498 { 0x1CC1DE, "Hewlett Packard" },

15499 { 0x1CC316, "Xiamen Milesight IoT Co., Ltd." },

15500 { 0x1CC3EB, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

15501 { 0x1CC586, "Absolute Acoustics" },

15502 { 0x1CC63C, "Arcadyan Technology Corporation" },

15503 { 0x1CC72D, "Shenzhen Huapu Digital CO.,Ltd" },

15504 { 0x1CC992, "Honor Device Co., Ltd." },

15505 { 0x1CCA41, "AO" },

15506 { 0x1CCAE3, "IEEE Registration Authority" },

15507 { 0x1CCB99, "TCT mobile ltd" },

15508 { 0x1CCCD6, "Xiaomi Communications Co Ltd" },

15509 { 0x1CCDE5, "Shanghai Wind Technologies Co.,Ltd" },

15510 { 0x1CCE51, "AzureWave Technology Inc." },

15511 { 0x1CD107, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

15512 { 0x1CD1BA, "Fiberhome Telecommunication Technologies Co.,LTD" },

15513 { 0x1CD1E0, "Cisco Systems, Inc" },

15514 { 0x1CD40C, "Kriwan Industrie-Elektronik GmbH" },

15515 { 0x1CD5E2, "Shenzhen YOUHUA Technology Co., Ltd" },

15516 { 0x1CD6BD, "LEEDARSON LIGHTING CO., LTD." },

15517 { 0x1CD6BE, "Wistron Neweb Corporation" },

15518 { 0x1CDA27, "vivo Mobile Communication Co., Ltd." },

15519 { 0x1CDDEA, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

15520 { 0x1CDE57, "Fiberhome Telecommunication Technologies Co.,LTD" },

15521 { 0x1CDEA7, "Cisco Systems, Inc" },

15522 { 0x1CDF0F, "Cisco Systems, Inc" },

15523 { 0x1CDF52, "Texas Instruments" },

15524 { 0x1CE165, "Marshal Corporation" },

15525 { 0x1CE192, "Qisda Corporation" },

15526 { 0x1CE2CC, "Texas Instruments" },

15527 { 0x1CE504, "HUAWEI TECHNOLOGIES CO.,LTD" },

15528 { 0x1CE57F, "Samsung Electronics Co.,Ltd" },

15529 { 0x1CE61D, "Samsung Electronics Co.,Ltd" },

15530 { 0x1CE62B, "Apple, Inc." },

15531 { 0x1CE639, "HUAWEI TECHNOLOGIES CO.,LTD" },

15532 { 0x1CE6AD, "Huawei Device Co., Ltd." },

15533 { 0x1CE6C7, "Cisco Systems, Inc" },

15534 { 0x1CE85D, "Cisco Systems, Inc" },

15535 { 0x1CEA0B, "Edgecore Networks Corporation" },

15536 { 0x1CEA1B, "Nokia" },

15537 { 0x1CEC72, "Allradio Co., Ltd" },

15538 { 0x1CED6F, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

15539 { 0x1CEEC9, "Elo touch solutions" },

15540 { 0x1CEEE8, "Ilshin Elecom" },

15541 { 0x1CEF03, "Guangzhou V-SOLUTION Electronic Technology Co., Ltd." },

15542 { 0x1CEFCE, "bebro electronic GmbH" },

15543 { 0x1CF03E, "Wearhaus Inc." },

15544 { 0x1CF061, "SCAPS GmbH" },

15545 { 0x1CF29A, "Google, Inc." },

15546 { 0x1CF42B, "Huawei Device Co., Ltd." },

15547 { 0x1CF4CA, "Private" },

15548 { 0x1CF5E7, "Turtle Industry Co., Ltd." },

15549 { 0x1CF8D0, "Samsung Electronics Co.,Ltd" },

15550 { 0x1CFA68, "TP-LINK TECHNOLOGIES CO.,LTD." },

15551 { 0x1CFC17, "Cisco Systems, Inc" },

15552 { 0x1CFCBB, "Realfiction ApS" },

15553 { 0x1CFD08, "IEEE Registration Authority" },

15554 { 0x1CFE2B, "Amazon Technologies Inc." },

15555 { 0x1CFEA7, "IDentytech Solutins Ltd." },

15556 { 0x1CFF59, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

15557 { 0x20014F, "Linea Research Ltd" },

15558 { 0x2002AF, "Murata Manufacturing Co., Ltd." },

15559 { 0x2002FE, "Hangzhou Dangbei Network Technology Co., Ltd" },

15560 { 0x20040F, "Dell Inc." },

15561 { 0x200484, "Apple, Inc." },

15562 { 0x2004F3, "Honor Device Co., Ltd." },

15563 { 0x200505, "RADMAX COMMUNICATION PRIVATE LIMITED" },

15564 { 0x2005E8, "OOO InProMedia" },

15565 { 0x200889, "zte corporation" },

15566 { 0x2008ED, "HUAWEI TECHNOLOGIES CO.,LTD" },

15567 { 0x200A0D, "IEEE Registration Authority" },

15568 { 0x200A5E, "Xiangshan Giant Eagle Technology Developing Co., Ltd." },

15569 { 0x200B16, "Texas Instruments" },

15570 { 0x200B74, "AzureWave Technology Inc." },

15571 { 0x200BC5, "Cisco Systems, Inc" },

15572 { 0x200BC7, "HUAWEI TECHNOLOGIES CO.,LTD" },

15573 { 0x200BCF, "Nintendo Co.,Ltd" },

15574 { 0x200C86, "GX India Pvt Ltd" },

15575 { 0x200CC8, "NETGEAR" },

15576 { 0x200DB0, "Shenzhen Four Seas Global Link Network Technology Co., Ltd." },

15577 { 0x200E2B, "Apple, Inc." },

15578 { 0x200E95, "IEC – TC9 WG43" },

15579 { 0x200F70, "FOXTECH" },

15580 { 0x20107A, "Gemtek Technology Co., Ltd." },

15581 { 0x20108A, "zte corporation" },

15582 { 0x20114E, "MeteRSit S.R.L." },

15583 { 0x201257, "Most Lucky Trading Ltd" },

15584 { 0x2012D5, "Scientech Materials Corporation" },

15585 { 0x2013E0, "Samsung Electronics Co.,Ltd" },

15586 { 0x201582, "Apple, Inc." },

15587 { 0x2015DE, "Samsung Electronics Co.,Ltd" },

15588 { 0x20163D, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

15589 { 0x201642, "Microsoft Corporation" },

15590 { 0x2016B9, "Intel Corporate" },

15591 { 0x2016D8, "Liteon Technology Corporation" },

15592 { 0x201742, "LG Electronics" },

15593 { 0x201746, "Paradromics, Inc." },

15594 { 0x20180E, "Shenzhen Sunchip Technology Co., Ltd" },

15595 { 0x201A06, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

15596 { 0x201A94, "Apple, Inc." },

15597 { 0x201B88, "Dongguan Liesheng Electronic Co., Ltd." },

15598 { 0x201BC9, "Juniper Networks" },

15599 { 0x201C3A, "Nintendo Co.,Ltd" },

15600 { 0x201D03, "Elatec GmbH" },

15601 { 0x201E88, "Intel Corporate" },

15602 { 0x201F31, "Inteno Broadband Technology AB" },

15603 { 0x201F3B, "Google, Inc." },

15604 { 0x201F54, "Raisecom Technology CO., LTD" },

15605 { 0x202027, "Shenzhen Sundray Technologies Company Limited" },

15606 { 0x202141, "Universal Electronics BV" },

15607 { 0x2021A5, "LG Electronics (Mobile Communications)" },

15608 { 0x202564, "PEGATRON CORPORATION" },

15609 { 0x202598, "Teleview" },

15610 { 0x2025D2, "Fiberhome Telecommunication Technologies Co.,LTD" },

15611 { 0x202681, "TECNO MOBILE LIMITED" },

15612 { 0x20283E, "HUAWEI TECHNOLOGIES CO.,LTD" },

15613 { 0x2028BC, "Visionscape Co,. Ltd." },

15614 { 0x2029B9, "Ikotek technology SH Co., Ltd" },

15615 { 0x202AC5, "Petite-En" },

15616 { 0x202B20, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

15617 { 0x202BC1, "HUAWEI TECHNOLOGIES CO.,LTD" },

15618 { 0x202CB7, "Kong Yue Electronics & Information Industry (Xinhui) Ltd." },

15619 { 0x202D07, "Samsung Electronics Co.,Ltd" },

15620 { 0x202D23, "Collinear Networks Inc." },

15621 { 0x202DF8, "Digital Media Cartridge Ltd." },

15622 { 0x20311C, "vivo Mobile Communication Co., Ltd." },

15623 { 0x20318D, "Giax GmbH" },

15624 { 0x2031EB, "HDSN" },

15625 { 0x203233, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

15626 { 0x20326C, "Samsung Electronics Co.,Ltd" },

15627 { 0x2032C6, "Apple, Inc." },

15628 { 0x2034FB, "Xiaomi Communications Co Ltd" },

15629 { 0x203626, "TP-Link Corporation Limited" },

15630 { 0x20365B, "Megafone Limited" },

15631 { 0x2036D7, "Shanghai Reacheng Communication Technology Co.,Ltd" },

15632 { 0x203706, "Cisco Systems, Inc" },

15633 { 0x2037A5, "Apple, Inc." },

15634 { 0x2037BC, "Kuipers Electronic Engineering BV" },

15635 { 0x203956, "HMD Global Oy" },

15636 { 0x203A07, "Cisco Systems, Inc" },

15637 { 0x203A43, "Intel Corporate" },

15638 { 0x203AEB, "zte corporation" },

15639 { 0x203AEF, "Sivantos GmbH" },

15640 { 0x203B69, "vivo Mobile Communication Co., Ltd." },

15641 { 0x203CAE, "Apple, Inc." },

15642 { 0x203CC0, "Beijing Tosee Technology Co., Ltd." },

15643 { 0x203D66, "ARRIS Group, Inc." },

15644 { 0x203DB2, "HUAWEI TECHNOLOGIES CO.,LTD" },

15645 { 0x203DBD, "LG Innotek" },

15646 { 0x204005, "feno GmbH" },

15647 { 0x20406A, "AMPAK Technology,Inc." },

15648 { 0x20415A, "Smarteh d.o.o." },

15649 { 0x204181, "ESYSE GmbH Embedded Systems Engineering" },

15650 { 0x20443A, "Schneider Electric Asia Pacific Ltd" },

15651 { 0x204441, "Remote Solution" },

15652 { 0x204569, "ITEL MOBILE LIMITED" },

15653 { 0x2046A1, "VECOW Co., Ltd" },

15654 { 0x2046F9, "Advanced Network Devices (dba:AND)" },

15655 { 0x204747, "Dell Inc." },

15656 { 0x2047B5, "Sagemcom Broadband SAS" },

15657 { 0x2047DA, "Xiaomi Communications Co Ltd" },

15658 { 0x2047ED, "SKY UK LIMITED" },

15659 { 0x204AAA, "Hanscan Spain S.A." },

15660 { 0x204B22, "Sunnovo International Limited" },

15661 { 0x204C03, "Aruba, a Hewlett Packard Enterprise Company" },

15662 { 0x204C6D, "Hugo Brennenstuhl Gmbh & Co. KG." },

15663 { 0x204C9E, "Cisco Systems, Inc" },

15664 { 0x204E6B, "Axxana(israel) ltd" },

15665 { 0x204E71, "Juniper Networks" },

15666 { 0x204E7F, "NETGEAR" },

15667 { 0x204EF6, "AzureWave Technology Inc." },

15668 { 0x2050E7, "AMPAK Technology,Inc." },

15669 { 0x205383, "HUAWEI TECHNOLOGIES CO.,LTD" },

15670 { 0x2053CA, "Risk Technology Ltd" },

15671 { 0x205476, "Sony Corporation" },

15672 { 0x2054FA, "HUAWEI TECHNOLOGIES CO.,LTD" },

15673 { 0x205531, "Samsung Electronics Co.,Ltd" },

15674 { 0x205532, "Gotech International Technology Limited" },

15675 { 0x205721, "Salix Technology CO., Ltd." },

15676 { 0x20579E, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

15677 { 0x2057AF, "Shenzhen FH-NET OPTOELECTRONICS CO.,LTD" },

15678 { 0x205869, "Ruckus Wireless" },

15679 { 0x2059A0, "Paragon Technologies Inc." },

15680 { 0x205A00, "Coval" },

15681 { 0x205A1D, "zte corporation" },

15682 { 0x205B2A, "Private" },

15683 { 0x205B5E, "Shenzhen Wonhe Technology Co., Ltd" },

15684 { 0x205CFA, "Yangzhou ChangLian Network Technology Co,ltd." },

15685 { 0x205D47, "vivo Mobile Communication Co., Ltd." },

15686 { 0x205E64, "Huawei Device Co., Ltd." },

15687 { 0x205E97, "Nokia" },

15688 { 0x205EF7, "Samsung Electronics Co.,Ltd" },

15689 { 0x205F3D, "Adtran Inc" },

15690 { 0x206274, "Microsoft Corporation" },

15691 { 0x206296, "Shenzhen Malio Technology Co.,Ltd" },

15692 { 0x20635F, "Abeeway" },

15693 { 0x206432, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

15694 { 0x2064CB, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

15695 { 0x2064DE, "Sunitec Enterprise Co.,Ltd" },

15696 { 0x20658E, "HUAWEI TECHNOLOGIES CO.,LTD" },

15697 { 0x2066CF, "FREEBOX SAS" },

15698 { 0x2066FD, "CONSTELL8 NV" },

15699 { 0x20677C, "Hewlett Packard Enterprise" },

15700 { 0x2067B1, "Pluto inc." },

15701 { 0x2067E0, "Shenzhen iComm Semiconductor CO.,LTD" },

15702 { 0x20689D, "Liteon Technology Corporation" },

15703 { 0x206980, "Apple, Inc." },

15704 { 0x206A8A, "Wistron Infocomm (Zhongshan) Corporation" },

15705 { 0x206A94, "Hitron Technologies. Inc" },

15706 { 0x206AFF, "Atlas Elektronik UK Limited" },

15707 { 0x206BE7, "TP-LINK TECHNOLOGIES CO.,LTD." },

15708 { 0x206BF4, "Huawei Device Co., Ltd." },

15709 { 0x206C8A, "Extreme Networks Headquarters" },

15710 { 0x206D31, "FIREWALLA INC" },

15711 { 0x206E9C, "Samsung Electronics Co.,Ltd" },

15712 { 0x206FEC, "Braemac CA LLC" },

15713 { 0x20719E, "SF Technology Co.,Ltd" },

15714 { 0x2072A9, "Beijing Xiaomi Electronics Co.,Ltd" },

15715 { 0x207355, "ARRIS Group, Inc." },

15716 { 0x207454, "vivo Mobile Communication Co., Ltd." },

15717 { 0x2074CF, "Shenzhen Voxtech Co.,Ltd" },

15718 { 0x207600, "Actiontec Electronics, Inc" },

15719 { 0x20768F, "Apple, Inc." },

15720 { 0x207693, "Lenovo (Beijing) Limited." },

15721 { 0x207759, "OPTICAL NETWORK VIDEO TECHNOLOGIES (SHENZHEN) CO., LTD." },

15722 { 0x20780B, "Delta Faucet Company" },

15723 { 0x207852, "Nokia Solutions and Networks GmbH & Co. KG" },

15724 { 0x2078CD, "Apple, Inc." },

15725 { 0x2078F0, "Apple, Inc." },

15726 { 0x207918, "Intel Corporate" },

15727 { 0x207BD2, "ASIX Electronics Corporation" },

15728 { 0x207C14, "Qotom" },

15729 { 0x207C8F, "Quanta Microsystems,Inc." },

15730 { 0x207D74, "Apple, Inc." },

15731 { 0x208058, "Ciena Corporation" },

15732 { 0x208097, "Shenzhen OXO Technology limited" },

15733 { 0x20826A, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

15734 { 0x2082C0, "Xiaomi Communications Co Ltd" },

15735 { 0x2083F8, "Advanced Digital Broadcast SA" },

15736 { 0x2084F5, "Yufei Innovation Software(Shenzhen) Co., Ltd." },

15737 { 0x20858C, "Assa" },

15738 { 0x208593, "IEEE Registration Authority" },

15739 { 0x208756, "SIEMENS AG" },

15740 { 0x2087AC, "AES motomation" },

15741 { 0x2087EC, "HUAWEI TECHNOLOGIES CO.,LTD" },

15742 { 0x208810, "Dell Inc." },

15743 { 0x20896F, "Fiberhome Telecommunication Technologies Co.,LTD" },

15744 { 0x208984, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

15745 { 0x208986, "zte corporation" },

15746 { 0x20898A, "Shenzhen Skyworth Digital Technology CO., Ltd" },

15747 { 0x208B37, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

15748 { 0x208BD1, "NXP Semiconductor (Tianjin) LTD." },

15749 { 0x208C47, "Tenstorrent Inc" },

15750 { 0x208C86, "HUAWEI TECHNOLOGIES CO.,LTD" },

15751 { 0x20906F, "Shenzhen Tencent Computer System Co., Ltd." },

15752 { 0x209148, "Texas Instruments" },

15753 { 0x20918A, "PROFALUX" },

15754 { 0x2091D9, "I'M SPA" },

15755 { 0x2091DF, "Apple, Inc." },

15756 { 0x209339, "Juniper Networks" },

15757 { 0x20934D, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

15758 { 0x20968A, "China Mobile (Hangzhou) Information Technology Co., Ltd." },

15759 { 0x209727, "TELTONIKA NETWORKS UAB" },

15760 { 0x2098D8, "Shenzhen Yingdakang Technology CO., LTD" },

15761 { 0x209A7D, "Sagemcom Broadband SAS" },

15762 { 0x209AE9, "Volacomm Co., Ltd" },

15763 { 0x209BA5, "JIAXING GLEAD Electronics Co.,Ltd" },

15764 { 0x209BCD, "Apple, Inc." },

15765 { 0x209BE6, "Guangzhou Shiyuan Electronic Technology Company Limited" },

15766 { 0x209CB4, "Aruba, a Hewlett Packard Enterprise Company" },

15767 { 0x209E79, "Universal Electronics, Inc." },

15768 { 0x209EF7, "Extreme Networks Headquarters" },

15769 { 0x20A171, "Amazon Technologies Inc." },

15770 { 0x20A2E4, "Apple, Inc." },

15771 { 0x20A2E7, "Lee-Dickens Ltd" },

15772 { 0x20A5CB, "Apple, Inc." },

15773 { 0x20A60C, "Xiaomi Communications Co Ltd" },

15774 { 0x20A680, "HUAWEI TECHNOLOGIES CO.,LTD" },

15775 { 0x20A6CD, "Hewlett Packard Enterprise" },

15776 { 0x20A766, "HUAWEI TECHNOLOGIES CO.,LTD" },

15777 { 0x20A783, "miControl GmbH" },

15778 { 0x20A787, "Bointec Taiwan Corporation Limited" },

15779 { 0x20A7F9, "SHENZHEN OLANBOA TECHNOLOGY CO., LTD" },

15780 { 0x20A8B9, "SIEMENS AG" },

15781 { 0x20A90E, "TCT mobile ltd" },

15782 { 0x20A99B, "Microsoft Corporation" },

15783 { 0x20AA25, "IP-NET LLC" },

15784 { 0x20AA4B, "Cisco-Linksys, LLC" },

15785 { 0x20AB37, "Apple, Inc." },

15786 { 0x20AB48, "HUAWEI TECHNOLOGIES CO.,LTD" },

15787 { 0x20AC9C, "China Telecom Corporation Limited" },

15788 { 0x20AD56, "Continental Automotive Systems Inc." },

15789 { 0x20AF1B, "SteelSeries ApS" },

15790 { 0x20B001, "Technicolor Delivery Technologies Belgium NV" },

15791 { 0x20B0F7, "Enclustra GmbH" },

15792 { 0x20B399, "Enterasys" },

15793 { 0x20B5C6, "Mimosa Networks" },

15794 { 0x20B730, "TeconGroup, Inc" },

15795 { 0x20B780, "Toshiba Visual Solutions Corporation Co.,Ltd" },

15796 { 0x20B7C0, "OMICRON electronics GmbH" },

15797 { 0x20B82B, "Sagemcom Broadband SAS" },

15798 { 0x20B868, "Motorola Mobility LLC, a Lenovo Company" },

15799 { 0x20BA36, "u-blox AG" },

15800 { 0x20BB76, "COL GIOVANNI PAOLO SpA" },

15801 { 0x20BBBC, "Hangzhou Ezviz Software Co.,Ltd." },

15802 { 0x20BBC0, "Cisco Systems, Inc" },

15803 { 0x20BBC6, "Jabil Circuit Hungary Ltd." },

15804 { 0x20BECD, "eero inc." },

15805 { 0x20BFDB, "DVL" },

15806 { 0x20C047, "Verizon" },

15807 { 0x20C06D, "SHENZHEN SPACETEK TECHNOLOGY CO.,LTD" },

15808 { 0x20C19B, "Intel Corporate" },

15809 { 0x20C1AF, "i Wit Digital Co., Limited" },

15810 { 0x20C38F, "Texas Instruments" },

15811 { 0x20C3A4, "RetailNext" },

15812 { 0x20C60D, "Shanghai annijie Information technology Co.,LTD" },

15813 { 0x20C6EB, "Panasonic Corporation AVC Networks Company" },

15814 { 0x20C74F, "SensorPush" },

15815 { 0x20C792, "Wuhan Maiwe communication Co.,Ltd" },

15816 { 0x20C8B3, "SHENZHEN BUL-TECH CO.,LTD." },

15817 { 0x20C9D0, "Apple, Inc." },

15818 { 0x20CC27, "Cisco Systems, Inc" },

15819 { 0x20CD39, "Texas Instruments" },

15820 { 0x20CD6E, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

15821 { 0x20CE2A, "IEEE Registration Authority" },

15822 { 0x20CEC4, "Peraso Technologies" },

15823 { 0x20CF30, "ASUSTek COMPUTER INC." },

15824 { 0x20CFAE, "Cisco Systems, Inc" },

15825 { 0x20D160, "Private" },

15826 { 0x20D21F, "Wincal Technology Corp." },

15827 { 0x20D25F, "SmartCap Technologies" },

15828 { 0x20D276, "ITEL MOBILE LIMITED" },

15829 { 0x20D390, "Samsung Electronics Co.,Ltd" },

15830 { 0x20D5AB, "Korea Infocom Co.,Ltd." },

15831 { 0x20D5BF, "Samsung Electronics Co.,Ltd" },

15832 { 0x20D607, "Nokia Corporation" },

15833 { 0x20D75A, "Posh Mobile Limited" },

15834 { 0x20D778, "Texas Instruments" },

15835 { 0x20D80B, "Juniper Networks" },

15836 { 0x20D906, "Iota, Inc." },

15837 { 0x20DA22, "HUAWEI TECHNOLOGIES CO.,LTD" },

15838 { 0x20DBAB, "Samsung Electronics Co., Ltd." },

15839 { 0x20DC93, "Cheetah Hi-Tech, Inc." },

15840 { 0x20DCE6, "TP-LINK TECHNOLOGIES CO.,LTD." },

15841 { 0x20DCFD, "Huawei Device Co., Ltd." },

15842 { 0x20DE1E, "Nokia" },

15843 { 0x20DE88, "IC Realtime LLC" },

15844 { 0x20DF3F, "Nanjing SAC Power Grid Automation Co., Ltd." },

15845 { 0x20DF73, "HUAWEI TECHNOLOGIES CO.,LTD" },

15846 { 0x20DFB9, "Google, Inc." },

15847 { 0x20E09C, "Nokia" },

15848 { 0x20E2A8, "Apple, Inc." },

15849 { 0x20E407, "Spark srl" },

15850 { 0x20E46F, "vivo Mobile Communication Co., Ltd." },

15851 { 0x20E52A, "NETGEAR" },

15852 { 0x20E564, "ARRIS Group, Inc." },

15853 { 0x20E6DF, "eero inc." },

15854 { 0x20E791, "Siemens Healthcare Diagnostics, Inc" },

15855 { 0x20E7B6, "Universal Electronics, Inc." },

15856 { 0x20E874, "Apple, Inc." },

15857 { 0x20E882, "zte corporation" },

15858 { 0x20EAC7, "SHENZHEN RIOPINE ELECTRONICS CO., LTD" },

15859 { 0x20ED47, "Juniper Networks" },

15860 { 0x20ED74, "Ability enterprise co.,Ltd." },

15861 { 0x20EE28, "Apple, Inc." },

15862 { 0x20EEC6, "Elefirst Science & Tech Co ., ltd" },

15863 { 0x20EFBD, "Roku, Inc" },

15864 { 0x20F002, "MTData Developments Pty. Ltd." },

15865 { 0x20F17C, "HUAWEI TECHNOLOGIES CO.,LTD" },

15866 { 0x20F19E, "ARRIS Group, Inc." },

15867 { 0x20F375, "ARRIS Group, Inc." },

15868 { 0x20F3A3, "HUAWEI TECHNOLOGIES CO.,LTD" },

15869 { 0x20F41B, "Shenzhen Bilian electronic CO.,LTD" },

15870 { 0x20F44F, "Nokia" },

15871 { 0x20F452, "Shanghai IUV Software Development Co. Ltd" },

15872 { 0x20F478, "Xiaomi Communications Co Ltd" },

15873 { 0x20F510, "Codex Digital Limited" },

15874 { 0x20F543, "Hui Zhou Gaoshengda Technology Co.,LTD" },

15875 { 0x20F597, "Maasiv, LLC" },

15876 { 0x20F77C, "vivo Mobile Communication Co., Ltd." },

15877 { 0x20F83B, "Nabu Casa, Inc." },

15878 { 0x20F85E, "Delta Electronics" },

15879 { 0x20FABB, "Cambridge Executive Limited" },

15880 { 0x20FADB, "Huahao Kunpeng Technology (chengDu) Co.,Ltd." },

15881 { 0x20FDF1, "3COM EUROPE LTD" },

15882 { 0x20FE00, "Amazon Technologies Inc." },

15883 { 0x20FECD, "System In Frontier Inc." },

15884 { 0x20FEDB, "M2M Solution S.A.S." },

15885 { 0x20FF36, "IFLYTEK CO.,LTD." },

15886 { 0x2400BA, "HUAWEI TECHNOLOGIES CO.,LTD" },

15887 { 0x2400FA, "China Mobile (Hangzhou) Information Technology Co., Ltd" },

15888 { 0x24016F, "Huawei Device Co., Ltd." },

15889 { 0x2401C7, "Cisco Systems, Inc" },

15890 { 0x240462, "Siemens Energy Global GmbH & Co.KG - GT PRM" },

15891 { 0x24050F, "MTN Electronic Co. Ltd" },

15892 { 0x240588, "Google, Inc." },

15893 { 0x2405F5, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

15894 { 0x2406AA, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

15895 { 0x2406F2, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

15896 { 0x24085D, "Continental Aftermarket & Services GmbH" },

15897 { 0x240917, "Devlin Electronics Limited" },

15898 { 0x240935, "Samsung Electronics Co.,Ltd" },

15899 { 0x240995, "HUAWEI TECHNOLOGIES CO.,LTD" },

15900 { 0x240A11, "TCT mobile ltd" },

15901 { 0x240A63, "ARRIS Group, Inc." },

15902 { 0x240A64, "AzureWave Technology Inc." },

15903 { 0x240AC4, "Espressif Inc." },

15904 { 0x240B0A, "Palo Alto Networks" },

15905 { 0x240B2A, "Viettel Group" },

15906 { 0x240B88, "Taicang T&W Electronics" },

15907 { 0x240BB1, "KOSTAL Industrie Elektrik GmbH" },

15908 { 0x240D65, "Shenzhen Vsun Communication Technology Co., Ltd." },

15909 { 0x240D6C, "SMND" },

15910 { 0x240DC2, "TCT mobile ltd" },

15911 { 0x240F5E, "Shenzhen z-router Technology Co., Ltd" },

15912 { 0x240F9B, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

15913 { 0x241064, "Shenzhen Ecsino Tecnical Co. Ltd" },

15914 { 0x241125, "Hutek Co., Ltd." },

15915 { 0x241145, "Xiaomi Communications Co Ltd" },

15916 { 0x241148, "Entropix, LLC" },

15917 { 0x241153, "Samsung Electronics Co.,Ltd" },

15918 { 0x2411D0, "Chongqing Ehs Science and Technology Development Co.,Ltd." },

15919 { 0x241281, "China Mobile Group Device Co.,Ltd." },

15920 { 0x241407, "Xiamen Sigmastar Technology Ltd." },

15921 { 0x241510, "IEEE Registration Authority" },

15922 { 0x241551, "Huawei Device Co., Ltd." },

15923 { 0x24161B, "Cisco Systems, Inc" },

15924 { 0x24166D, "HUAWEI TECHNOLOGIES CO.,LTD" },

15925 { 0x24169D, "Cisco Systems, Inc" },

15926 { 0x24181D, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

15927 { 0x2418C0, "E. Wehrle GmbH" },

15928 { 0x2418C6, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

15929 { 0x241A8C, "Squarehead Technology AS" },

15930 { 0x241AE6, "Huawei Device Co., Ltd." },

15931 { 0x241B13, "Shanghai Nutshell Electronic Co., Ltd." },

15932 { 0x241B44, "Hangzhou Tuners Electronics Co., Ltd" },

15933 { 0x241B7A, "Apple, Inc." },

15934 { 0x241C04, "SHENZHEN JEHE TECHNOLOGY DEVELOPMENT CO., LTD." },

15935 { 0x241D48, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

15936 { 0x241E2B, "Zhejiang Cainiao Supply Chain Management Co., Ltd" },

15937 { 0x241EEB, "Apple, Inc." },

15938 { 0x241F2C, "Calsys, Inc." },

15939 { 0x241FA0, "HUAWEI TECHNOLOGIES CO.,LTD" },

15940 { 0x241FBD, "Extreme Networks Headquarters" },

15941 { 0x2420C7, "Sagemcom Broadband SAS" },

15942 { 0x242124, "Nokia" },

15943 { 0x2421AB, "Sony Corporation" },

15944 { 0x242361, "vivo Mobile Communication Co., Ltd." },

15945 { 0x24240E, "Apple, Inc." },

15946 { 0x242642, "SHARP Corporation." },

15947 { 0x2426BA, "Shenzhen Toptel Technology Co., Ltd." },

15948 { 0x2426D6, "HUAWEI TECHNOLOGIES CO.,LTD" },

15949 { 0x242730, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

15950 { 0x2428FD, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

15951 { 0x242934, "Google, Inc." },

15952 { 0x2429FE, "KYOCERA Corporation" },

15953 { 0x242A04, "Cisco Systems, Inc" },

15954 { 0x242CFE, "Zhejiang Tmall Technology Co., Ltd." },

15955 { 0x242D6C, "eero inc." },

15956 { 0x242E02, "HUAWEI TECHNOLOGIES CO.,LTD" },

15957 { 0x242E90, "PALIT MICROSYSTEMS, LTD" },

15958 { 0x242FD0, "TP-LINK CORPORATION PTE. LTD." },

15959 { 0x242FFA, "Toshiba Global Commerce Solutions" },

15960 { 0x2430F8, "Huawei Device Co., Ltd." },

15961 { 0x243154, "HUAWEI TECHNOLOGIES CO.,LTD" },

15962 { 0x243184, "SHARP Corporation" },

15963 { 0x2432AE, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

15964 { 0x24336C, "Private" },

15965 { 0x2435CC, "Zhongshan Scinan Internet of Things Co.,Ltd." },

15966 { 0x2436DA, "Cisco Systems, Inc" },

15967 { 0x24374C, "Cisco SPVTG" },

15968 { 0x2437EF, "EMC Electronic Media Communication SA" },

15969 { 0x243A82, "IRTS" },

15970 { 0x243C20, "Dynamode Group" },

15971 { 0x243F30, "Oxygen Broadband s.a." },

15972 { 0x243FAA, "Huawei Device Co., Ltd." },

15973 { 0x2440AE, "NIIC Technology Co., Ltd." },

15974 { 0x24418C, "Intel Corporate" },

15975 { 0x2442BC, "Alinco,incorporated" },

15976 { 0x2443E2, "DASAN Network Solutions" },

15977 { 0x244427, "HUAWEI TECHNOLOGIES CO.,LTD" },

15978 { 0x24456B, "Huawei Device Co., Ltd." },

15979 { 0x244597, "GEMUE Gebr. Mueller Apparatebau" },

15980 { 0x2446C8, "Motorola Mobility LLC, a Lenovo Company" },

15981 { 0x2446E4, "HUAWEI TECHNOLOGIES CO.,LTD" },

15982 { 0x24470E, "PentronicAB" },

15983 { 0x244845, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

15984 { 0x24497B, "Innovative Converged Devices Inc" },

15985 { 0x244B03, "Samsung Electronics Co.,Ltd" },

15986 { 0x244B81, "Samsung Electronics Co.,Ltd" },

15987 { 0x244BF1, "HUAWEI TECHNOLOGIES CO.,LTD" },

15988 { 0x244BFE, "ASUSTek COMPUTER INC." },

15989 { 0x244C07, "HUAWEI TECHNOLOGIES CO.,LTD" },

15990 { 0x244CAB, "Espressif Inc." },

15991 { 0x244CE3, "Amazon Technologies Inc." },

15992 { 0x244E7B, "IEEE Registration Authority" },

15993 { 0x244F1D, "iRule LLC" },

15994 { 0x24526A, "Zhejiang Dahua Technology Co., Ltd." },

15995 { 0x2453BF, "Enernet" },

15996 { 0x24586E, "zte corporation" },

15997 { 0x24587C, "Espressif Inc." },

15998 { 0x245880, "VIZEO" },

15999 { 0x24590B, "White Sky Inc. Limited" },

16000 { 0x2459E5, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

16001 { 0x245A4C, "Ubiquiti Inc" },

16002 { 0x245AB5, "Samsung Electronics Co.,Ltd" },

16003 { 0x245B83, "Renesas Electronics (Penang) Sdn. Bhd." },

16004 { 0x245BA7, "Apple, Inc." },

16005 { 0x245BF0, "Liteon, Inc." },

16006 { 0x245CBF, "NCSE" },

16007 { 0x245CC5, "Huawei Device Co., Ltd." },

16008 { 0x245CCB, "AXIe Consortium, Inc." },

16009 { 0x245DFC, "IEEE Registration Authority" },

16010 { 0x245E48, "Apple, Inc." },

16011 { 0x245EBE, "QNAP Systems, Inc." },

16012 { 0x245F9F, "Huawei Device Co., Ltd." },

16013 { 0x245FDF, "KYOCERA CORPORATION" },

16014 { 0x246081, "razberi technologies" },

16015 { 0x24615A, "China Mobile Group Device Co.,Ltd." },

16016 { 0x246278, "sysmocom - systems for mobile communications GmbH" },

16017 { 0x2462AB, "Espressif Inc." },

16018 { 0x2462CE, "Aruba, a Hewlett Packard Enterprise Company" },

16019 { 0x24649F, "Huawei Device Co., Ltd." },

16020 { 0x2464EF, "CYG SUNRI CO.,LTD." },

16021 { 0x246511, "AVM GmbH" },

16022 { 0x246830, "Shenzhen Shokzhear Co., Ltd" },

16023 { 0x246880, "Braveridge.co.,ltd." },

16024 { 0x2468B0, "Samsung Electronics Co.,Ltd" },

16025 { 0x24693E, "innodisk Corporation" },

16026 { 0x24694A, "Jasmine Systems Inc." },

16027 { 0x246968, "TP-LINK TECHNOLOGIES CO.,LTD." },

16028 { 0x24698E, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

16029 { 0x2469A5, "HUAWEI TECHNOLOGIES CO.,LTD" },

16030 { 0x246AAB, "IT-IS International" },

16031 { 0x246C60, "Huawei Device Co., Ltd." },

16032 { 0x246C84, "Cisco Systems, Inc" },

16033 { 0x246C8A, "YUKAI Engineering" },

16034 { 0x246E96, "Dell Inc." },

16035 { 0x246F28, "Espressif Inc." },

16036 { 0x246F8C, "Huawei Device Co., Ltd." },

16037 { 0x247152, "Dell Inc." },

16038 { 0x247189, "Texas Instruments" },

16039 { 0x24724A, "Nile Global Inc" },

16040 { 0x247260, "IOTTECH Corp" },

16041 { 0x2474F7, "GoPro" },

16042 { 0x24753A, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

16043 { 0x2475FC, "zte corporation" },

16044 { 0x247625, "Texas Instruments" },

16045 { 0x247656, "Shanghai Net Miles Fiber Optics Technology Co., LTD." },

16046 { 0x24767D, "Cisco SPVTG" },

16047 { 0x247703, "Intel Corporate" },

16048 { 0x247823, "Panasonic Entertainment & Communication Co., Ltd." },

16049 { 0x24792A, "Ruckus Wireless" },

16050 { 0x2479EF, "Greenpacket Berhad, Taiwan" },

16051 { 0x2479F3, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

16052 { 0x2479F8, "KUPSON spol. s r.o." },

16053 { 0x247C4C, "Herman Miller" },

16054 { 0x247D4D, "Texas Instruments" },

16055 { 0x247E12, "Cisco Systems, Inc" },

16056 { 0x247E51, "zte corporation" },

16057 { 0x247F20, "Sagemcom Broadband SAS" },

16058 { 0x247F3C, "HUAWEI TECHNOLOGIES CO.,LTD" },

16059 { 0x248000, "Westcontrol AS" },

16060 { 0x24813B, "Cisco Systems, Inc" },

16061 { 0x2481AA, "KSH International Co., Ltd." },

16062 { 0x2481C7, "Huawei Device Co., Ltd." },

16063 { 0x24828A, "Prowave Technologies Ltd." },

16064 { 0x248498, "Beijing Jiaoda Microunion Tech.Co.,Ltd." },

16065 { 0x2486F4, "Ctek, Inc." },

16066 { 0x248707, "SEnergy Corporation" },

16067 { 0x248894, "shenzhen lensun Communication Technology LTD" },

16068 { 0x248A07, "Mellanox Technologies, Inc." },

16069 { 0x248BE0, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

16070 { 0x249038, "Universal Biosensors Pty Ltd" },

16071 { 0x2491BB, "HUAWEI TECHNOLOGIES CO.,LTD" },

16072 { 0x24920E, "Samsung Electronics Co.,Ltd" },

16073 { 0x2493CA, "Voxtronic Austria" },

16074 { 0x249442, "OPEN ROAD SOLUTIONS , INC." },

16075 { 0x249493, "FibRSol Global Network Limited" },

16076 { 0x249494, "Hong Kong Bouffalo Lab Limited" },

16077 { 0x2494CB, "ARRIS Group, Inc." },

16078 { 0x249504, "SFR" },

16079 { 0x24952F, "Google, Inc." },

16080 { 0x249745, "HUAWEI TECHNOLOGIES CO.,LTD" },

16081 { 0x2497ED, "Techvision Intelligent Technology Limited" },

16082 { 0x249AC8, "Shenzhen Skyworth Digital Technology CO., Ltd" },

16083 { 0x249AD8, "YEALINK(XIAMEN) NETWORK TECHNOLOGY CO.,LTD." },

16084 { 0x249D2A, "LinkData Technology (Tianjin) Co., LTD" },

16085 { 0x249EAB, "HUAWEI TECHNOLOGIES CO.,LTD" },

16086 { 0x249F89, "Texas Instruments" },

16087 { 0x24A074, "Apple, Inc." },

16088 { 0x24A160, "Espressif Inc." },

16089 { 0x24A186, "ARRIS Group, Inc." },

16090 { 0x24A2E1, "Apple, Inc." },

16091 { 0x24A42C, "NETIO products a.s." },

16092 { 0x24A43C, "Ubiquiti Inc" },

16093 { 0x24A487, "Huawei Device Co., Ltd." },

16094 { 0x24A495, "Thales Canada Inc." },

16095 { 0x24A52C, "HUAWEI TECHNOLOGIES CO.,LTD" },

16096 { 0x24A534, "SynTrust Tech International Ltd." },

16097 { 0x24A65E, "zte corporation" },

16098 { 0x24A6FA, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

16099 { 0x24A799, "Huawei Device Co., Ltd." },

16100 { 0x24A7DC, "SKY UK LIMITED" },

16101 { 0x24A87D, "Panasonic Automotive Systems Asia Pacific(Thailand)Co.,Ltd." },

16102 { 0x24A937, "PURE Storage" },

16103 { 0x24AB81, "Apple, Inc." },

16104 { 0x24ACAC, "Polar Electro Oy" },

16105 { 0x24AF4A, "Alcatel-Lucent IPD" },

16106 { 0x24AF54, "NEXGEN Mediatech Inc." },

16107 { 0x24B0A9, "Shanghai Mobiletek Communication Ltd." },

16108 { 0x24B105, "Prama Hikvision India Private Limited" },

16109 { 0x24B209, "Avaya Inc" },

16110 { 0x24B2DE, "Espressif Inc." },

16111 { 0x24B657, "Cisco Systems, Inc" },

16112 { 0x24B6B8, "FRIEM SPA" },

16113 { 0x24B6FD, "Dell Inc." },

16114 { 0x24B72A, "China Dragon Technology Limited" },

16115 { 0x24B7DA, "Fiberhome Telecommunication Technologies Co.,LTD" },

16116 { 0x24B88C, "Crenus Co.,Ltd." },

16117 { 0x24B8D2, "Opzoon Technology Co.,Ltd." },

16118 { 0x24BA13, "RISO KAGAKU CORPORATION" },

16119 { 0x24BA30, "Technical Consumer Products, Inc." },

16120 { 0x24BBC1, "Absolute Analysis" },

16121 { 0x24BBC9, "Shenzhen SuperElectron Technology Co.,Ltd." },

16122 { 0x24BC82, "Dali Wireless, Inc." },

16123 { 0x24BCF8, "HUAWEI TECHNOLOGIES CO.,LTD" },

16124 { 0x24BE05, "Hewlett Packard" },

16125 { 0x24BE18, "DADOUTEK COMPANY LIMITED" },

16126 { 0x24BF74, "Hamamatsu Photonics K.K." },

16127 { 0x24C0B3, "RSF" },

16128 { 0x24C17A, "BEIJING IACTIVE NETWORK CO.,LTD" },

16129 { 0x24C1BD, "CRRC DALIAN R&D CO.,LTD." },

16130 { 0x24C3F9, "Securitas Direct AB" },

16131 { 0x24C42F, "Philips Lifeline" },

16132 { 0x24C44A, "zte corporation" },

16133 { 0x24C613, "Samsung Electronics Co.,Ltd" },

16134 { 0x24C696, "Samsung Electronics Co.,Ltd" },

16135 { 0x24C848, "mywerk Portal GmbH" },

16136 { 0x24C86E, "Chaney Instrument Co." },

16137 { 0x24C8D3, "McWane India Pvt Ltd" },

16138 { 0x24C9A1, "Ruckus Wireless" },

16139 { 0x24C9DE, "Genoray" },

16140 { 0x24CACB, "Fiberhome Telecommunication Technologies Co.,LTD" },

16141 { 0x24CBE7, "MYK, Inc." },

16142 { 0x24CD8D, "Murata Manufacturing Co., Ltd." },

16143 { 0x24CE33, "Amazon Technologies Inc." },

16144 { 0x24CF21, "Shenzhen State Micro Technology Co., Ltd" },

16145 { 0x24CF24, "Beijing Xiaomi Mobile Software Co., Ltd" },

16146 { 0x24D0DF, "Apple, Inc." },

16147 { 0x24D13F, "MEXUS CO.,LTD" },

16148 { 0x24D208, "Sensata Technologies Inc." },

16149 { 0x24D2CC, "SmartDrive Systems Inc." },

16150 { 0x24D337, "Xiaomi Communications Co Ltd" },

16151 { 0x24D3F2, "zte corporation" },

16152 { 0x24D51C, "Zhongtian broadband technology co., LTD" },

16153 { 0x24D5E4, "Cisco Systems, Inc" },

16154 { 0x24D76B, "Syntronic AB" },

16155 { 0x24D79C, "Cisco Systems, Inc" },

16156 { 0x24D7EB, "Espressif Inc." },

16157 { 0x24D81E, "MirWifi,Joint-Stock Company" },

16158 { 0x24D904, "Sichuan Changhong Network Technologies Co., Ltd." },

16159 { 0x24D921, "Avaya Inc" },

16160 { 0x24DA11, "NO NDA Inc" },

16161 { 0x24DA33, "HUAWEI TECHNOLOGIES CO.,LTD" },

16162 { 0x24DA9B, "Motorola Mobility LLC, a Lenovo Company" },

16163 { 0x24DAB6, "Sistemas de Gestión Energética S.A. de C.V" },

16164 { 0x24DBAC, "HUAWEI TECHNOLOGIES CO.,LTD" },

16165 { 0x24DBAD, "ShopperTrak RCT Corporation" },

16166 { 0x24DBED, "Samsung Electronics Co.,Ltd" },

16167 { 0x24DC0F, "Phytium Technology Co.,Ltd." },

16168 { 0x24DCC3, "Espressif Inc." },

16169 { 0x24DEC6, "Aruba, a Hewlett Packard Enterprise Company" },

16170 { 0x24DF6A, "HUAWEI TECHNOLOGIES CO.,LTD" },

16171 { 0x24DFA7, "Hangzhou BroadLink Technology Co.,Ltd" },

16172 { 0x24E124, "Xiamen Milesight IoT Co., Ltd." },

16173 { 0x24E271, "Qingdao Hisense Communications Co.,Ltd." },

16174 { 0x24E29D, "Huawei Device Co., Ltd." },

16175 { 0x24E314, "Apple, Inc." },

16176 { 0x24E3DE, "China Telecom Fufu Information Technology Co., Ltd." },

16177 { 0x24E43F, "Wenzhou Kunmei Communication Technology Co.,Ltd." },

16178 { 0x24E4C8, "Fiberhome Telecommunication Technologies Co.,LTD" },

16179 { 0x24E4CE, "Kaon Group Co., Ltd." },

16180 { 0x24E50F, "Google, Inc." },

16181 { 0x24E5AA, "Philips Oral Healthcare, Inc." },

16182 { 0x24E6BA, "JSC Zavod im. Kozitsky" },

16183 { 0x24E853, "LG Innotek" },

16184 { 0x24E8CE, "Qingdao Haier Technology Co.,Ltd" },

16185 { 0x24E8E5, "Shenzhen Skyworth Digital Technology CO., Ltd" },

16186 { 0x24E927, "TomTom International BV" },

16187 { 0x24E9B3, "Cisco Systems, Inc" },

16188 { 0x24E9CA, "Huawei Device Co., Ltd." },

16189 { 0x24EA40, "Helmholz GmbH & Co. KG" },

16190 { 0x24EB65, "SAET I.S. S.r.l." },

16191 { 0x24EBED, "HUAWEI TECHNOLOGIES CO.,LTD" },

16192 { 0x24EC51, "ADF Technologies Sdn Bhd" },

16193 { 0x24EC99, "ASKEY COMPUTER CORP" },

16194 { 0x24ECD6, "CSG Science & Technology Co.,Ltd.Hefei" },

16195 { 0x24EDFD, "Siemens Canada Limited" },

16196 { 0x24EE3A, "Chengdu Yingji Electronic Hi-tech Co Ltd" },

16197 { 0x24EE9A, "Intel Corporate" },

16198 { 0x24F094, "Apple, Inc." },

16199 { 0x24F0D3, "Samsung Electronics Co.,Ltd" },

16200 { 0x24F0FF, "GHT Co., Ltd." },

16201 { 0x24F128, "Telstra" },

16202 { 0x24F150, "Guangzhou Qi'an Technology Co., Ltd." },

16203 { 0x24F27F, "Hewlett Packard Enterprise" },

16204 { 0x24F2DD, "Radiant Zemax LLC" },

16205 { 0x24F57E, "HWH CO., LTD." },

16206 { 0x24F5A2, "Belkin International Inc." },

16207 { 0x24F5AA, "Samsung Electronics Co.,Ltd" },

16208 { 0x24F603, "HUAWEI TECHNOLOGIES CO.,LTD" },

16209 { 0x24F677, "Apple, Inc." },

16210 { 0x24FAF3, "Shanghai Flexem Technology Co.,Ltd." },

16211 { 0x24FB65, "HUAWEI TECHNOLOGIES CO.,LTD" },

16212 { 0x24FC4E, "Juniper Networks" },

16213 { 0x24FCE5, "Samsung Electronics Co.,Ltd" },

16214 { 0x24FD0D, "Intelbras" },

16215 { 0x24FD52, "Liteon Technology Corporation" },

16216 { 0x24FD5B, "SmartThings, Inc." },

16217 { 0x24FDFA, "Private" },

16218 { 0x24FE9A, "CyberTAN Technology Inc." },

16219 { 0x2800AF, "Dell Inc." },

16220 { 0x28011C, "zte corporation" },

16221 { 0x28022E, "Apple, Inc." },

16222 { 0x280244, "Apple, Inc." },

16223 { 0x280245, "Konze System Technology Co.,Ltd." },

16224 { 0x2802D8, "Samsung Electronics Co.,Ltd" },

16225 { 0x2804C6, "Wanan Hongsheng Electronic Co.Ltd" },

16226 { 0x2804E0, "FERMAX ELECTRONICA S.A.U." },

16227 { 0x28052E, "Dematic Corp" },

16228 { 0x28061E, "NINGBO GLOBAL USEFUL ELECTRIC CO.,LTD" },

16229 { 0x28068D, "ITL, LLC" },

16230 { 0x28070D, "GUANGZHOU WINSOUND INFORMATION TECHNOLOGY CO.,LTD." },

16231 { 0x280AEE, "Renesas Electronics (Penang) Sdn. Bhd." },

16232 { 0x280B5C, "Apple, Inc." },

16233 { 0x280C28, "Unigen DataStorage Corporation" },

16234 { 0x280C2D, "QUALVISION TECHNOLOGY CO.,LTD" },

16235 { 0x280CB8, "Mikrosay Yazilim ve Elektronik A.S." },

16236 { 0x280DFC, "Sony Interactive Entertainment Inc." },

16237 { 0x280E8B, "Beijing Spirit Technology Development Co., Ltd." },

16238 { 0x280FC5, "Beijing Leadsec Technology Co., Ltd." },

16239 { 0x280FEB, "LG Innotek" },

16240 { 0x28101B, "MagnaCom" },

16241 { 0x28107B, "D-Link International" },

16242 { 0x2811A5, "Bose Corporation" },

16243 { 0x2811A8, "Intel Corporate" },

16244 { 0x2811EC, "HUAWEI TECHNOLOGIES CO.,LTD" },

16245 { 0x281293, "Honor Device Co., Ltd." },

16246 { 0x281471, "Lantis co., LTD." },

16247 { 0x28162E, "2Wire Inc" },

16248 { 0x28167F, "Xiaomi Communications Co Ltd" },

16249 { 0x2816A8, "Microsoft Corporation" },

16250 { 0x2816AD, "Intel Corporate" },

16251 { 0x281709, "HUAWEI TECHNOLOGIES CO.,LTD" },

16252 { 0x2817CE, "Omnisense Ltd" },

16253 { 0x281878, "Microsoft Corporation" },

16254 { 0x2818FD, "Aditya Infotech Ltd." },

16255 { 0x281B04, "Zalliant LLC" },

16256 { 0x281D21, "IN ONE SMART TECHNOLOGY(H,K,)LIMITED" },

16257 { 0x282246, "Beijing Sinoix Communication Co., LTD" },

16258 { 0x282373, "Digita" },

16259 { 0x2823F5, "China Mobile (Hangzhou) Information Technology Co., Ltd." },

16260 { 0x2824FF, "Wistron Neweb Corporation" },

16261 { 0x282536, "SHENZHEN HOLATEK CO.,LTD" },

16262 { 0x2826A6, "PBR electronics GmbH" },

16263 { 0x2827BF, "Samsung Electronics Co.,Ltd" },

16264 { 0x28285D, "Zyxel Communications Corporation" },

16265 { 0x282947, "Chipsea Technologies (Shenzhen) Corp." },

16266 { 0x282986, "APC by Schneider Electric" },

16267 { 0x2829CC, "Corsa Technology Incorporated" },

16268 { 0x2829D9, "GlobalBeiMing technology (Beijing)Co. Ltd" },

16269 { 0x282A87, "ITEL MOBILE LIMITED" },

16270 { 0x282B96, "Huawei Device Co., Ltd." },

16271 { 0x282BB9, "Shenzhen Xiongxin Technology Co.,Ltd" },

16272 { 0x282C02, "IEEE Registration Authority" },

16273 { 0x282CB2, "TP-LINK TECHNOLOGIES CO.,LTD." },

16274 { 0x282D06, "AMPAK Technology,Inc." },

16275 { 0x282D7F, "Apple, Inc." },

16276 { 0x282FC2, "Automotive Data Solutions" },

16277 { 0x2830AC, "Frontiir Co. Ltd." },

16278 { 0x283152, "HUAWEI TECHNOLOGIES CO.,LTD" },

16279 { 0x283166, "vivo Mobile Communication Co., Ltd." },

16280 { 0x28317E, "Hongkong Nano IC Technologies Co., Ltd" },

16281 { 0x2831F8, "HUAWEI TECHNOLOGIES CO.,LTD" },

16282 { 0x2832C5, "HUMAX Co., Ltd." },

16283 { 0x283334, "Huawei Device Co., Ltd." },

16284 { 0x283410, "Enigma Diagnostics Limited" },

16285 { 0x2834A2, "Cisco Systems, Inc" },

16286 { 0x2834FF, "Apple, Inc." },

16287 { 0x283545, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

16288 { 0x283613, "IEEE Registration Authority" },

16289 { 0x283638, "IEEE Registration Authority" },

16290 { 0x283713, "Shenzhen 3Nod Digital Technology Co., Ltd." },

16291 { 0x283737, "Apple, Inc." },

16292 { 0x28385C, "FLEXTRONICS" },

16293 { 0x2838CF, "Gen2wave" },

16294 { 0x283926, "CyberTAN Technology Inc." },

16295 { 0x28395E, "Samsung Electronics Co.,Ltd" },

16296 { 0x2839E7, "Preceno Technology Pte.Ltd." },

16297 { 0x283A4D, "Cloud Network Technology (Samoa) Limited" },

16298 { 0x283B82, "D-Link International" },

16299 { 0x283B96, "Cool Control LTD" },

16300 { 0x283C90, "Texas Instruments" },

16301 { 0x283CE4, "HUAWEI TECHNOLOGIES CO.,LTD" },

16302 { 0x283DC2, "Samsung Electronics Co.,Ltd" },

16303 { 0x283E0C, "Preferred Robotics, Inc." },

16304 { 0x283E76, "Common Networks" },

16305 { 0x283F69, "Sony Corporation" },

16306 { 0x28401A, "C8 MediSensors, Inc." },

16307 { 0x284121, "OptiSense Network, LLC" },

16308 { 0x2841C6, "HUAWEI TECHNOLOGIES CO.,LTD" },

16309 { 0x2841EC, "HUAWEI TECHNOLOGIES CO.,LTD" },

16310 { 0x284430, "Arcade Communications Ltd." },

16311 { 0x2847AA, "Nokia Corporation" },

16312 { 0x284846, "GridCentric Inc." },

16313 { 0x2848E7, "Huawei Device Co., Ltd." },

16314 { 0x284C53, "Intune Networks" },

16315 { 0x284D92, "Luminator" },

16316 { 0x284E44, "HUAWEI TECHNOLOGIES CO.,LTD" },

16317 { 0x284ED7, "OutSmart Power Systems, Inc." },

16318 { 0x284EE9, "mercury corperation" },

16319 { 0x284FCE, "Liaoning Wontel Science and Technology Development Co.,Ltd." },

16320 { 0x285132, "Shenzhen Prayfly Technology Co.,Ltd" },

16321 { 0x285261, "Cisco Systems, Inc" },

16322 { 0x2852E0, "Layon international Electronic & Telecom Co.,Ltd" },

16323 { 0x2852F9, "Zhongxin Intelligent Times (Shenzhen) Co., Ltd." },

16324 { 0x28534E, "HUAWEI TECHNOLOGIES CO.,LTD" },

16325 { 0x2853E0, "Sintela Ltd" },

16326 { 0x285471, "Huawei Device Co., Ltd." },

16327 { 0x28563A, "Fiberhome Telecommunication Technologies Co.,LTD" },

16328 { 0x28565A, "Hon Hai Precision Ind. Co.,Ltd." },

16329 { 0x2856C1, "Harman/Becker Automotive Systems GmbH" },

16330 { 0x285767, "Dish Technologies Corp" },

16331 { 0x2857BE, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

16332 { 0x285AEB, "Apple, Inc." },

16333 { 0x285B0C, "Sichuan Jiuzhou Electronic Technology Co., Ltd." },

16334 { 0x285F2F, "RNware Co.,Ltd." },

16335 { 0x285FDB, "HUAWEI TECHNOLOGIES CO.,LTD" },

16336 { 0x286046, "Lantech Communications Global, Inc." },

16337 { 0x286094, "CAPELEC" },

16338 { 0x286336, "Siemens AG" },

16339 { 0x2863BD, "APTIV SERVICES US, LLC" },

16340 { 0x2864B0, "Huawei Device Co., Ltd." },

16341 { 0x2864EF, "Shenzhen Fsan Intelligent Technology Co.,Ltd" },

16342 { 0x28656B, "Keystone Microtech Corporation" },

16343 { 0x2866E3, "AzureWave Technology Inc." },

16344 { 0x2868D2, "HUAWEI TECHNOLOGIES CO.,LTD" },

16345 { 0x286AB8, "Apple, Inc." },

16346 { 0x286ABA, "Apple, Inc." },

16347 { 0x286B35, "Intel Corporate" },

16348 { 0x286C07, "XIAOMI Electronics,CO.,LTD" },

16349 { 0x286D97, "SAMJIN Co., Ltd." },

16350 { 0x286DCD, "Beijing Winner Microelectronics Co.,Ltd." },

16351 { 0x286ED4, "HUAWEI TECHNOLOGIES CO.,LTD" },

16352 { 0x286F40, "Tonly Technology Co. Ltd" },

16353 { 0x286F7F, "Cisco Systems, Inc" },

16354 { 0x286FB9, "Nokia Shanghai Bell Co., Ltd." },

16355 { 0x28704E, "Ubiquiti Inc" },

16356 { 0x287184, "Spire Payments" },

16357 { 0x2872C5, "Smartmatic Corp" },

16358 { 0x2872F0, "ATHENA" },

16359 { 0x2873F6, "Amazon Technologies Inc." },

16360 { 0x2874F5, "Nokia Solutions and Networks GmbH & Co. KG" },

16361 { 0x2875D8, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

16362 { 0x287610, "IgniteNet" },

16363 { 0x287681, "Silicon Laboratories" },

16364 { 0x2876CD, "Funshion Online Technologies Co.,Ltd" },

16365 { 0x287777, "zte corporation" },

16366 { 0x2877B1, "Tri plus grupa d.o.o." },

16367 { 0x2877F1, "Apple, Inc." },

16368 { 0x287994, "Realplay Digital Technology(Shenzhen) Co.,Ltd" },

16369 { 0x287AEE, "ARRIS Group, Inc." },

16370 { 0x287B09, "zte corporation" },

16371 { 0x287CDB, "Hefei Toycloud Technology Co.,ltd" },

16372 { 0x287E80, "Hui Zhou Gaoshengda Technology Co.,LTD" },

16373 { 0x287FCF, "Intel Corporate" },

16374 { 0x288023, "Hewlett Packard" },

16375 { 0x288088, "NETGEAR" },

16376 { 0x28808A, "HUAWEI TECHNOLOGIES CO.,LTD" },

16377 { 0x2880A2, "Novatel Wireless Solutions, Inc." },

16378 { 0x28827C, "Bosch Automative products(Suzhou)Co.,Ltd Changzhou Branch" },

16379 { 0x288335, "Samsung Electronics Co.,Ltd" },

16380 { 0x2883C9, "Apple, Inc." },

16381 { 0x28840E, "silicon valley immigration service" },

16382 { 0x2884FA, "SHARP Corporation" },

16383 { 0x28852D, "Touch Networks" },

16384 { 0x2885BB, "Zen Exim Pvt. Ltd." },

16385 { 0x2887BA, "TP-Link Corporation Limited" },

16386 { 0x288915, "CashGuard Sverige AB" },

16387 { 0x288A1C, "Juniper Networks" },

16388 { 0x288CB8, "zte corporation" },

16389 { 0x288EB9, "Wacom Co.,Ltd." },

16390 { 0x288EEC, "Apple, Inc." },

16391 { 0x288FF6, "Apple, Inc." },

16392 { 0x2891D0, "Stage Tec Entwicklungsgesellschaft für professionelle Audiotechnik mbH" },

16393 { 0x28924A, "Hewlett Packard" },

16394 { 0x28937D, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

16395 { 0x2893FE, "Cisco Systems, Inc" },

16396 { 0x289401, "NETGEAR" },

16397 { 0x28940F, "Cisco Systems, Inc" },

16398 { 0x2894AF, "Samhwa Telecom" },

16399 { 0x2897B8, "myenergi Ltd" },

16400 { 0x28987B, "Samsung Electronics Co.,Ltd" },

16401 { 0x28993A, "Arista Networks" },

16402 { 0x2899C7, "LINDSAY BROADBAND INC" },

16403 { 0x289A4B, "SteelSeries ApS" },

16404 { 0x289AF7, "ADVA Optical Networking Ltd." },

16405 { 0x289AFA, "TCT mobile ltd" },

16406 { 0x289C6E, "Shanghai High-Flying Electronics Technology Co., Ltd" },

16407 { 0x289E97, "HUAWEI TECHNOLOGIES CO.,LTD" },

16408 { 0x289EDF, "Danfoss Turbocor Compressors, Inc" },

16409 { 0x289EFC, "Sagemcom Broadband SAS" },

16410 { 0x28A02B, "Apple, Inc." },

16411 { 0x28A183, "ALPSALPINE CO,.LTD" },

16412 { 0x28A186, "enblink" },

16413 { 0x28A192, "GERP Solution" },

16414 { 0x28A1EB, "ETEK TECHNOLOGY (SHENZHEN) CO.,LTD" },

16415 { 0x28A241, "exlar corp" },

16416 { 0x28A24B, "Juniper Networks" },

16417 { 0x28A331, "Sierra Wireless, ULC" },

16418 { 0x28A53F, "vivo Mobile Communication Co., Ltd." },

16419 { 0x28A574, "Miller Electric Mfg. Co." },

16420 { 0x28A5EE, "Shenzhen SDGI CATV Co., Ltd" },

16421 { 0x28A6AC, "seca gmbh & co. kg" },

16422 { 0x28A6DB, "HUAWEI TECHNOLOGIES CO.,LTD" },

16423 { 0x28AC67, "Mach Power, Rappresentanze Internazionali s.r.l." },

16424 { 0x28AC9E, "Cisco Systems, Inc" },

16425 { 0x28AD18, "Hui Zhou Gaoshengda Technology Co.,LTD" },

16426 { 0x28AD3E, "Shenzhen TONG BO WEI Technology CO.,LTD" },

16427 { 0x28AF0A, "Sirius XM Radio Inc" },

16428 { 0x28AF42, "Samsung Electronics Co.,Ltd" },

16429 { 0x28AFFD, "Cisco Systems, Inc" },

16430 { 0x28B0CC, "Xenya d.o.o." },

16431 { 0x28B133, "SHINEMAN(SHENZHEN) Tech. Cor., Ltd." },

16432 { 0x28B2BD, "Intel Corporate" },

16433 { 0x28B371, "Ruckus Wireless" },

16434 { 0x28B3AB, "Genmark Automation" },

16435 { 0x28B448, "HUAWEI TECHNOLOGIES CO.,LTD" },

16436 { 0x28B4FB, "Sprocomm Technologies CO.,LTD." },

16437 { 0x28B5E8, "Texas Instruments" },

16438 { 0x28B77C, "IEEE Registration Authority" },

16439 { 0x28B829, "Juniper Networks" },

16440 { 0x28B9D9, "Radisys Corporation" },

16441 { 0x28BA18, "NextNav, LLC" },

16442 { 0x28BAB5, "Samsung Electronics Co.,Ltd" },

16443 { 0x28BB59, "RNET Technologies, Inc." },

16444 { 0x28BBED, "Bouffalo Lab (Nanjing) Co., Ltd." },

16445 { 0x28BC05, "BLU Products Inc" },

16446 { 0x28BC18, "SourcingOverseas Co. Ltd" },

16447 { 0x28BC56, "EMAC, Inc." },

16448 { 0x28BD89, "Google, Inc." },

16449 { 0x28BE03, "TCT mobile ltd" },

16450 { 0x28BE43, "vivo Mobile Communication Co., Ltd." },

16451 { 0x28BE9B, "Vantiva USA LLC" },

16452 { 0x28BEF3, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

16453 { 0x28BF89, "Fiberhome Telecommunication Technologies Co.,LTD" },

16454 { 0x28C01B, "Shenzhen Skyworth Digital Technology CO., Ltd" },

16455 { 0x28C0DA, "Juniper Networks" },

16456 { 0x28C13C, "Hon Hai Precision Industry Co., Ltd." },

16457 { 0x28C1A0, "Apple, Inc." },

16458 { 0x28C21F, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

16459 { 0x28C2DD, "AzureWave Technology Inc." },

16460 { 0x28C538, "Apple, Inc." },

16461 { 0x28C5D2, "Intel Corporate" },

16462 { 0x28C63F, "Intel Corporate" },

16463 { 0x28C671, "Yota Devices OY" },

16464 { 0x28C68E, "NETGEAR" },

16465 { 0x28C709, "Apple, Inc." },

16466 { 0x28C718, "Altierre" },

16467 { 0x28C7CE, "Cisco Systems, Inc" },

16468 { 0x28C825, "DellKing Industrial Co., Ltd" },

16469 { 0x28C87A, "ARRIS Group, Inc." },

16470 { 0x28C87C, "zte corporation" },

16471 { 0x28C914, "Taimag Corporation" },

16472 { 0x28CA09, "ThyssenKrupp Elevators (Shanghai) Co.,Ltd" },

16473 { 0x28CB5C, "Shenzhen CPETEK Technology Co.,Ltd." },

16474 { 0x28CBEB, "One" },

16475 { 0x28CC01, "Samsung Electronics Co.,Ltd" },

16476 { 0x28CCFF, "Corporacion Empresarial Altra SL" },

16477 { 0x28CD1C, "Espotel Oy" },

16478 { 0x28CD4C, "Individual Computers GmbH" },

16479 { 0x28CD9C, "Shenzhen Dynamax Software Development Co.,Ltd." },

16480 { 0x28CDC1, "Raspberry Pi Trading Ltd" },

16481 { 0x28CDC4, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

16482 { 0x28CF08, "ESSYS" },

16483 { 0x28CF51, "Nintendo Co.,Ltd" },

16484 { 0x28CFDA, "Apple, Inc." },

16485 { 0x28CFE9, "Apple, Inc." },

16486 { 0x28D044, "Shenzhen Xinyin technology company" },

16487 { 0x28D0CB, "Adtran Inc" },

16488 { 0x28D0EA, "Intel Corporate" },

16489 { 0x28D0F5, "Ruijie Networks Co.,LTD" },

16490 { 0x28D127, "Beijing Xiaomi Mobile Software Co., Ltd" },

16491 { 0x28D1AF, "Nokia Corporation" },

16492 { 0x28D1B7, "Shenzhen YOUHUA Technology Co., Ltd" },

16493 { 0x28D244, "LCFC(HeFei) Electronics Technology co., ltd" },

16494 { 0x28D25A, "Infinix mobility limited" },

16495 { 0x28D3EA, "Huawei Device Co., Ltd." },

16496 { 0x28D436, "Jiangsu dewosi electric co., LTD" },

16497 { 0x28D576, "Premier Wireless, Inc." },

16498 { 0x28D93E, "Telecor Inc." },

16499 { 0x28D98A, "Hangzhou Konke Technology Co.,Ltd." },

16500 { 0x28D997, "Yuduan Mobile Co., Ltd." },

16501 { 0x28DB81, "Shanghai Guao Electronic Technology Co., Ltd" },

16502 { 0x28DBA7, "Silicon Laboratories" },

16503 { 0x28DE65, "Aruba, a Hewlett Packard Enterprise Company" },

16504 { 0x28DEA8, "zte corporation" },

16505 { 0x28DEE5, "HUAWEI TECHNOLOGIES CO.,LTD" },

16506 { 0x28DEF6, "bioMerieux Inc." },

16507 { 0x28DFEB, "Intel Corporate" },

16508 { 0x28E02C, "Apple, Inc." },

16509 { 0x28E14C, "Apple, Inc." },

16510 { 0x28E297, "Shanghai InfoTM Microelectronics Co.,Ltd" },

16511 { 0x28E31F, "Xiaomi Communications Co Ltd" },

16512 { 0x28E347, "Liteon Technology Corporation" },

16513 { 0x28E34E, "HUAWEI TECHNOLOGIES CO.,LTD" },

16514 { 0x28E424, "New H3C Technologies Co., Ltd" },

16515 { 0x28E476, "Pi-Coral" },

16516 { 0x28E5B0, "HUAWEI TECHNOLOGIES CO.,LTD" },

16517 { 0x28E608, "Tokheim" },

16518 { 0x28E6A9, "Samsung Electronics Co.,Ltd" },

16519 { 0x28E6E9, "SIS Sat Internet Services GmbH" },

16520 { 0x28E71D, "Arista Networks" },

16521 { 0x28E794, "Microtime Computer Inc." },

16522 { 0x28E7CF, "Apple, Inc." },

16523 { 0x28E98E, "Mitsubishi Electric Corporation" },

16524 { 0x28EA0B, "Microsoft Corporation" },

16525 { 0x28EA2D, "Apple, Inc." },

16526 { 0x28EB0A, "Rolling Wireless S.a.r.l. Luxembourg" },

16527 { 0x28EBA6, "Nex-T LLC" },

16528 { 0x28EC22, "eero inc." },

16529 { 0x28EC95, "Apple, Inc." },

16530 { 0x28EC9A, "Texas Instruments" },

16531 { 0x28ED58, "JAG Jakob AG" },

16532 { 0x28ED6A, "Apple, Inc." },

16533 { 0x28EDE0, "AMPAK Technology, Inc." },

16534 { 0x28EE2C, "Frontline Test Equipment" },

16535 { 0x28EE52, "TP-LINK TECHNOLOGIES CO.,LTD." },

16536 { 0x28EED3, "Shenzhen Super D Technology Co., Ltd" },

16537 { 0x28EF01, "Amazon Technologies Inc." },

16538 { 0x28F033, "Apple, Inc." },

16539 { 0x28F076, "Apple, Inc." },

16540 { 0x28F10E, "Dell Inc." },

16541 { 0x28F358, "2C - Trifonov & Co" },

16542 { 0x28F366, "Shenzhen Bilian electronic CO.,LTD" },

16543 { 0x28F49B, "LEETEK" },

16544 { 0x28F532, "ADD-Engineering BV" },

16545 { 0x28F537, "IEEE Registration Authority" },

16546 { 0x28F5D1, "ARRIS Group, Inc." },

16547 { 0x28F606, "Syes srl" },

16548 { 0x28F7D6, "Fiberhome Telecommunication Technologies Co.,LTD" },

16549 { 0x28F8C6, "IEEE Registration Authority" },

16550 { 0x28FA19, "Shenzhen Jingxun Software Telecommunication Technology Co.,Ltd" },

16551 { 0x28FA7A, "Zhejiang Tmall Technology Co., Ltd." },

16552 { 0x28FAA0, "vivo Mobile Communication Co., Ltd." },

16553 { 0x28FBAE, "HUAWEI TECHNOLOGIES CO.,LTD" },

16554 { 0x28FBD3, "Ragentek Technology Group" },

16555 { 0x28FC51, "The Electric Controller and Manufacturing Co., LLC" },

16556 { 0x28FCF6, "Shenzhen Xin KingBrand enterprises Co.,Ltd" },

16557 { 0x28FD80, "IEEE Registration Authority" },

16558 { 0x28FE65, "DongGuan Siyoto Electronics Co., Ltd" },

16559 { 0x28FECD, "Lemobile Information Technology (Beijing) Co., Ltd." },

16560 { 0x28FEDE, "COMESTA, Inc." },

16561 { 0x28FF3C, "Apple, Inc." },

16562 { 0x28FF3E, "zte corporation" },

16563 { 0x28FF5F, "HG Genuine Intelligent Terminal (Xiaogan) Co.,Ltd." },

16564 { 0x28FFB2, "Toshiba Corp." },

16565 { 0x2C002A, "Shenzhen TINNO Mobile Technology Corp." },

16566 { 0x2C002C, "UNOWHY" },

16567 { 0x2C0033, "EControls, LLC" },

16568 { 0x2C00AB, "ARRIS Group, Inc." },

16569 { 0x2C00F7, "XOS" },

16570 { 0x2C010B, "NASCENT Technology, LLC - RemKon" },

16571 { 0x2C01B5, "Cisco Systems, Inc" },

16572 { 0x2C029F, "3ALogics" },

16573 { 0x2C0547, "Shenzhen Phaten Tech. LTD" },

16574 { 0x2C0623, "Win Leader Inc." },

16575 { 0x2C073C, "DEVLINE LIMITED" },

16576 { 0x2C0786, "Huawei Device Co., Ltd." },

16577 { 0x2C07F6, "SKG Health Technologies Co., Ltd." },

16578 { 0x2C081C, "OVH" },

16579 { 0x2C0823, "Sercomm France Sarl" },

16580 { 0x2C088C, "HUMAX Co., Ltd." },

16581 { 0x2C08B4, "Huawei Device Co., Ltd." },

16582 { 0x2C094D, "Raptor Engineering, LLC" },

16583 { 0x2C09CB, "COBS AB" },

16584 { 0x2C0BAB, "HUAWEI TECHNOLOGIES CO.,LTD" },

16585 { 0x2C0BE9, "Cisco Systems, Inc" },

16586 { 0x2C0DA7, "Intel Corporate" },

16587 { 0x2C0E3D, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

16588 { 0x2C10C1, "Nintendo Co., Ltd." },

16589 { 0x2C1165, "Silicon Laboratories" },

16590 { 0x2C15BF, "Samsung Electronics Co.,Ltd" },

16591 { 0x2C15D9, "HUAWEI TECHNOLOGIES CO.,LTD" },

16592 { 0x2C15E1, "Phicomm (Shanghai) Co., Ltd." },

16593 { 0x2C16BD, "IEEE Registration Authority" },

16594 { 0x2C17E0, "SYSTEMES ET TECHNOLOGIES IDENTIFICATION (STid)" },

16595 { 0x2C1809, "Apple, Inc." },

16596 { 0x2C1875, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

16597 { 0x2C18AE, "Trend Electronics Co., Ltd." },

16598 { 0x2C1984, "IDN Telecom, Inc." },

16599 { 0x2C1A01, "HUAWEI TECHNOLOGIES CO.,LTD" },

16600 { 0x2C1A05, "Cisco Systems, Inc" },

16601 { 0x2C1A31, "Electronics Company Limited" },

16602 { 0x2C1BC8, "Hunan Topview Network System CO.,LTD" },

16603 { 0x2C1CF6, "Alien Green LLC" },

16604 { 0x2C1DB8, "ARRIS Group, Inc." },

16605 { 0x2C1E4F, "Chengdu Qianli Network Technology Co., Ltd." },

16606 { 0x2C1EEA, "AERODEV" },

16607 { 0x2C1F23, "Apple, Inc." },

16608 { 0x2C200B, "Apple, Inc." },

16609 { 0x2C2080, "Huawei Device Co., Ltd." },

16610 { 0x2C2131, "Juniper Networks" },

16611 { 0x2C2172, "Juniper Networks" },

16612 { 0x2C21D7, "IMAX Corporation" },

16613 { 0x2C228B, "CTR SRL" },

16614 { 0x2C233A, "Hewlett Packard" },

16615 { 0x2C245F, "Babolat VS" },

16616 { 0x2C2617, "Oculus VR, LLC" },

16617 { 0x2C265F, "IEEE Registration Authority" },

16618 { 0x2C26C5, "zte corporation" },

16619 { 0x2C2768, "HUAWEI TECHNOLOGIES CO.,LTD" },

16620 { 0x2C279E, "IEEE Registration Authority" },

16621 { 0x2C27D7, "Hewlett Packard" },

16622 { 0x2C282D, "BBK EDUCATIONAL ELECTRONICS CORP.,LTD." },

16623 { 0x2C28B7, "Hangzhou Ruiying technology co., LTD" },

16624 { 0x2C2997, "Microsoft Corporation" },

16625 { 0x2C2BF9, "LG Innotek" },

16626 { 0x2C2D48, "bct electronic GesmbH" },

16627 { 0x2C301A, "Technicolor CH USA Inc for Telus" },

16628 { 0x2C3033, "NETGEAR" },

16629 { 0x2C3068, "Pantech Co.,Ltd" },

16630 { 0x2C3124, "Cisco Systems, Inc" },

16631 { 0x2C326A, "Apple, Inc." },

16632 { 0x2C3311, "Cisco Systems, Inc" },

16633 { 0x2C3341, "China Mobile IOT Company Limited" },

16634 { 0x2C3358, "Intel Corporate" },

16635 { 0x2C3361, "Apple, Inc." },

16636 { 0x2C337A, "Hon Hai Precision Ind. Co.,Ltd." },

16637 { 0x2C3427, "ERCO & GENER" },

16638 { 0x2C3557, "ELIIY Power CO., Ltd." },

16639 { 0x2C36A0, "Capisco Limited" },

16640 { 0x2C36F8, "Cisco Systems, Inc" },

16641 { 0x2C3731, "SHENZHEN YIFANG DIGITAL TECHNOLOGY CO.,LTD." },

16642 { 0x2C3796, "CYBO CO.,LTD." },

16643 { 0x2C37C5, "Qingdao Haier Intelligent Home Appliance Technology Co.,Ltd" },

16644 { 0x2C3996, "Sagemcom Broadband SAS" },

16645 { 0x2C39C1, "Ciena Corporation" },

16646 { 0x2C3A28, "Fagor Electrónica" },

16647 { 0x2C3A91, "Huawei Device Co., Ltd." },

16648 { 0x2C3AE8, "Espressif Inc." },

16649 { 0x2C3AFD, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

16650 { 0x2C3B70, "AzureWave Technology Inc." },

16651 { 0x2C3BFD, "Netstor Technology Co., Ltd." },

16652 { 0x2C3C05, "Marinesync Corp" },

16653 { 0x2C3EBF, "HOSIN Global Electronics Co., Ltd." },

16654 { 0x2C3ECF, "Cisco Systems, Inc" },

16655 { 0x2C3F0B, "Cisco Meraki" },

16656 { 0x2C3F38, "Cisco Systems, Inc" },

16657 { 0x2C3F3E, "Alge-Timing GmbH" },

16658 { 0x2C402B, "Smart iBlue Technology Limited" },

16659 { 0x2C4053, "Samsung Electronics Co.,Ltd" },

16660 { 0x2C4138, "Hewlett Packard" },

16661 { 0x2C41A1, "Bose Corporation" },

16662 { 0x2C4205, "Lytx" },

16663 { 0x2C431A, "Shenzhen YOUHUA Technology Co., Ltd" },

16664 { 0x2C43BE, "Sunnovo International Limited" },

16665 { 0x2C4401, "Samsung Electronics Co.,Ltd" },

16666 { 0x2C441B, "Spectrum Medical Limited" },

16667 { 0x2C44FD, "Hewlett Packard" },

16668 { 0x2C459A, "Dixon Technologies (India) Limited" },

16669 { 0x2C4759, "Beijing MEGA preponderance Science & Technology Co. Ltd" },

16670 { 0x2C4835, "IEEE Registration Authority" },

16671 { 0x2C4881, "vivo Mobile Communication Co., Ltd." },

16672 { 0x2C4A11, "Ciena Corporation" },

16673 { 0x2C4C15, "Juniper Networks" },

16674 { 0x2C4CC6, "Murata Manufacturing Co., Ltd." },

16675 { 0x2C4D54, "ASUSTek COMPUTER INC." },

16676 { 0x2C4D79, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

16677 { 0x2C4DDE, "TECNO MOBILE LIMITED" },

16678 { 0x2C4E7D, "Chunghua Intelligent Network Equipment Inc." },

16679 { 0x2C4F52, "Cisco Systems, Inc" },

16680 { 0x2C5089, "Shenzhen Kaixuan Visual Technology Co.,Limited" },

16681 { 0x2C52AF, "HUAWEI TECHNOLOGIES CO.,LTD" },

16682 { 0x2C532B, "TCT mobile ltd" },

16683 { 0x2C534A, "Shenzhen Winyao Electronic Limited" },

16684 { 0x2C53D7, "Sonova AG" },

16685 { 0x2C542D, "Cisco Systems, Inc" },

16686 { 0x2C5491, "Microsoft Corporation" },

16687 { 0x2C54CF, "LG Electronics (Mobile Communications)" },

16688 { 0x2C553C, "Vecima Networks Inc." },

16689 { 0x2C557C, "Shenzhen YOUHUA Technology Co., Ltd" },

16690 { 0x2C55D3, "HUAWEI TECHNOLOGIES CO.,LTD" },

16691 { 0x2C56DC, "ASUSTek COMPUTER INC." },

16692 { 0x2C572C, "Allwinner Technology Co., Ltd" },

16693 { 0x2C5731, "Wingtech Group (HongKong）Limited" },

16694 { 0x2C5741, "Cisco Systems, Inc" },

16695 { 0x2C57CE, "Apple, Inc." },

16696 { 0x2C584F, "ARRIS Group, Inc." },

16697 { 0x2C58B9, "HP Inc." },

16698 { 0x2C58E8, "HUAWEI TECHNOLOGIES CO.,LTD" },

16699 { 0x2C598A, "LG Electronics (Mobile Communications)" },

16700 { 0x2C59E5, "Hewlett Packard" },

16701 { 0x2C5A05, "Nokia Corporation" },

16702 { 0x2C5A0F, "Cisco Systems, Inc" },

16703 { 0x2C5A8D, "SYSTRONIK Elektronik u. Systemtechnik GmbH" },

16704 { 0x2C5AA3, "PROMATE ELECTRONIC CO.LTD" },

16705 { 0x2C5BB8, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

16706 { 0x2C5BE1, "Centripetal Networks, Inc" },

16707 { 0x2C5D34, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

16708 { 0x2C5D93, "Ruckus Wireless" },

16709 { 0x2C5FF3, "Pertronic Industries" },

16710 { 0x2C600C, "Quanta Computer Inc." },

16711 { 0x2C60CD, "NR ELECTRIC CO., LTD" },

16712 { 0x2C6104, "SHENZHEN FENGLIAN TECHNOLOGY CO., LTD." },

16713 { 0x2C61F6, "Apple, Inc." },

16714 { 0x2C625A, "Finest Security Systems Co., Ltd" },

16715 { 0x2C6289, "Regenersis (Glenrothes) Ltd" },

16716 { 0x2C6373, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

16717 { 0x2C641F, "Vizio, Inc" },

16718 { 0x2C64F6, "Wu Qi Technologies,Inc." },

16719 { 0x2C6798, "InTalTech Ltd." },

16720 { 0x2C67AB, "EZELINK TELECOM" },

16721 { 0x2C67BE, "DWnet Technologies(Suzhou) Corporation" },

16722 { 0x2C67FB, "ShenZhen Zhengjili Electronics Co., LTD" },

16723 { 0x2C691D, "IEEE Registration Authority" },

16724 { 0x2C693E, "HUAWEI TECHNOLOGIES CO.,LTD" },

16725 { 0x2C69BA, "RF Controls, LLC" },

16726 { 0x2C69CC, "Valeo Detection Systems" },

16727 { 0x2C6A6F, "IEEE Registration Authority" },

16728 { 0x2C6B7D, "Texas Instruments" },

16729 { 0x2C6BF5, "Juniper Networks" },

16730 { 0x2C6DC1, "Intel Corporate" },

16731 { 0x2C6E85, "Intel Corporate" },

16732 { 0x2C6F4E, "Hubei Yuan Times Technology Co.,Ltd." },

16733 { 0x2C6F51, "Herospeed Digital Technology Limited" },

16734 { 0x2C6FC9, "Hon Hai Precision Ind. Co.,Ltd." },

16735 { 0x2C704F, "zte corporation" },

16736 { 0x2C7155, "HiveMotion" },

16737 { 0x2C71FF, "Amazon Technologies Inc." },

16738 { 0x2C72C3, "Soundmatters" },

16739 { 0x2C7360, "Earda Technologies co Ltd" },

16740 { 0x2C73A0, "Cisco Systems, Inc" },

16741 { 0x2C750F, "Shanghai Dongzhou-Lawton Communication Technology Co. Ltd." },

16742 { 0x2C75CB, "Novitec Co., Ltd." },

16743 { 0x2C7600, "Apple, Inc." },

16744 { 0x2C768A, "Hewlett Packard" },

16745 { 0x2C780E, "Huawei Device Co., Ltd." },

16746 { 0x2C784C, "Iton Technology Corp." },

16747 { 0x2C793D, "Boditech Med" },

16748 { 0x2C79D7, "Sagemcom Broadband SAS" },

16749 { 0x2C7B5A, "Milper Ltd" },

16750 { 0x2C7B84, "OOO Petr Telegin" },

16751 { 0x2C7BA0, "Intel Corporate" },

16752 { 0x2C7CE4, "Wuhan Tianyu Information Industry Co., Ltd." },

16753 { 0x2C7CF2, "Apple, Inc." },

16754 { 0x2C7E81, "ARRIS Group, Inc." },

16755 { 0x2C7ECF, "Onzo Ltd" },

16756 { 0x2C8065, "HARTING Inc. of North America" },

16757 { 0x2C8158, "Hon Hai Precision Ind. Co.,Ltd." },

16758 { 0x2C81BF, "Apple, Inc." },

16759 { 0x2C8217, "Apple, Inc." },

16760 { 0x2C86D2, "Cisco Systems, Inc" },

16761 { 0x2C8A72, "HTC Corporation" },

16762 { 0x2C8AC7, "Ubee Interactive Co., Limited" },

16763 { 0x2C8BF2, "Hitachi Metals America Ltd" },

16764 { 0x2C8D37, "Virtium" },

16765 { 0x2C8DB1, "Intel Corporate" },

16766 { 0x2C9127, "Eintechno Corporation" },

16767 { 0x2C91AB, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

16768 { 0x2C922C, "Kishu Giken Kogyou Company Ltd,." },

16769 { 0x2C93FB, "Sercomm France Sarl" },

16770 { 0x2C9452, "HUAWEI TECHNOLOGIES CO.,LTD" },

16771 { 0x2C9464, "Cincoze Co., Ltd." },

16772 { 0x2C9569, "ARRIS Group, Inc." },

16773 { 0x2C957F, "zte corporation" },

16774 { 0x2C9662, "Invenit BV" },

16775 { 0x2C9682, "MitraStar Technology Corp." },

16776 { 0x2C9717, "I.C.Y. B.V." },

16777 { 0x2C97B1, "HUAWEI TECHNOLOGIES CO.,LTD" },

16778 { 0x2C97ED, "Sony Imaging Products & Solutions Inc." },

16779 { 0x2C9811, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

16780 { 0x2C9924, "ARRIS Group, Inc." },

16781 { 0x2C9975, "Samsung Electronics Co.,Ltd" },

16782 { 0x2C9AA4, "Eolo SpA" },

16783 { 0x2C9C58, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

16784 { 0x2C9D1E, "HUAWEI TECHNOLOGIES CO.,LTD" },

16785 { 0x2C9D65, "vivo Mobile Communication Co., Ltd." },

16786 { 0x2C9E00, "Sony Interactive Entertainment Inc." },

16787 { 0x2C9E5F, "ARRIS Group, Inc." },

16788 { 0x2C9EE0, "Cavli Inc." },

16789 { 0x2C9EEC, "Jabil Circuit Penang" },

16790 { 0x2C9EFC, "CANON INC." },

16791 { 0x2C9FFB, "Wistron Neweb Corporation" },

16792 { 0x2CA02F, "Veroguard Systems Pty Ltd" },

16793 { 0x2CA042, "Huawei Device Co., Ltd." },

16794 { 0x2CA157, "acromate, Inc." },

16795 { 0x2CA17D, "ARRIS Group, Inc." },

16796 { 0x2CA2B4, "Fortify Technologies, LLC" },

16797 { 0x2CA30E, "POWER DRAGON DEVELOPMENT LIMITED" },

16798 { 0x2CA327, "Oraimo Technology Limited" },

16799 { 0x2CA539, "Parallel Wireless, Inc" },

16800 { 0x2CA59C, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

16801 { 0x2CA774, "Texas Instruments" },

16802 { 0x2CA780, "True Technologies Inc." },

16803 { 0x2CA79E, "HUAWEI TECHNOLOGIES CO.,LTD" },

16804 { 0x2CA7EF, "OnePlus Technology (Shenzhen) Co., Ltd" },

16805 { 0x2CA835, "RIM" },

16806 { 0x2CA89C, "Creatz inc." },

16807 { 0x2CA9F0, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

16808 { 0x2CAA8E, "Wyze Labs Inc" },

16809 { 0x2CAB00, "HUAWEI TECHNOLOGIES CO.,LTD" },

16810 { 0x2CAB25, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

16811 { 0x2CAB33, "Texas Instruments" },

16812 { 0x2CAB46, "Ruckus Wireless" },

16813 { 0x2CABA4, "Cisco SPVTG" },

16814 { 0x2CABEB, "Cisco Systems, Inc" },

16815 { 0x2CAC44, "CONEXTOP" },

16816 { 0x2CAD13, "SHENZHEN ZHILU TECHNOLOGY CO.,LTD" },

16817 { 0x2CAE2B, "Samsung Electronics Co.,Ltd" },

16818 { 0x2CB05D, "NETGEAR" },

16819 { 0x2CB0DF, "Soliton Technologies Pvt Ltd" },

16820 { 0x2CB0FD, "Shenzhen MiaoMing Intelligent Technology Co.,Ltd" },

16821 { 0x2CB115, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

16822 { 0x2CB21A, "Phicomm (Shanghai) Co., Ltd." },

16823 { 0x2CB301, "Honor Device Co., Ltd." },

16824 { 0x2CB43A, "Apple, Inc." },

16825 { 0x2CB693, "Radware" },

16826 { 0x2CB69D, "RED Digital Cinema" },

16827 { 0x2CB6C8, "Raisecom Technology CO., LTD" },

16828 { 0x2CB8ED, "SonicWall" },

16829 { 0x2CBABA, "Samsung Electronics Co.,Ltd" },

16830 { 0x2CBACA, "Cosonic Electroacoustic Technology Co., Ltd." },

16831 { 0x2CBC87, "Apple, Inc." },

16832 { 0x2CBE08, "Apple, Inc." },

16833 { 0x2CBE97, "Ingenieurbuero Bickele und Buehler GmbH" },

16834 { 0x2CBEEB, "Nothing Technology Limited" },

16835 { 0x2CC253, "Apple, Inc." },

16836 { 0x2CC260, "Oracle Corporation" },

16837 { 0x2CC3E6, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

16838 { 0x2CC407, "machineQ" },

16839 { 0x2CC44F, "IEEE Registration Authority" },

16840 { 0x2CC546, "Huawei Device Co., Ltd." },

16841 { 0x2CC548, "IAdea Corporation" },

16842 { 0x2CC5D3, "Ruckus Wireless" },

16843 { 0x2CC6A0, "Lumacron Technology Ltd." },

16844 { 0x2CC81B, "Routerboard.com" },

16845 { 0x2CC8F5, "Huawei Device Co., Ltd." },

16846 { 0x2CCA0C, "WITHUS PLANET" },

16847 { 0x2CCA75, "Robert Bosch GmbH AnP" },

16848 { 0x2CCC15, "Nokia Corporation" },

16849 { 0x2CCC44, "Sony Interactive Entertainment Inc." },

16850 { 0x2CCCE6, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

16851 { 0x2CCD27, "Precor Inc" },

16852 { 0x2CCD43, "Summit Technology Group" },

16853 { 0x2CCD69, "Aqavi.com" },

16854 { 0x2CCE1E, "Cloudtronics Pty Ltd" },

16855 { 0x2CCF58, "HUAWEI TECHNOLOGIES CO.,LTD" },

16856 { 0x2CD02D, "Cisco Systems, Inc" },

16857 { 0x2CD05A, "Liteon Technology Corporation" },

16858 { 0x2CD066, "Xiaomi Communications Co Ltd" },

16859 { 0x2CD141, "IEEE Registration Authority" },

16860 { 0x2CD1C6, "Murata Manufacturing Co., Ltd." },

16861 { 0x2CD1DA, "Keysight Technologies, Inc." },

16862 { 0x2CD26B, "FN-LINK TECHNOLOGY LIMITED" },

16863 { 0x2CD2E3, "Guangzhou Aoshi Electronic Co.,Ltd" },

16864 { 0x2CD2E7, "Nokia Corporation" },

16865 { 0x2CD444, "FUJITSU LIMITED" },

16866 { 0x2CD7FF, "LANCOM Systems GmbH" },

16867 { 0x2CD974, "Hui Zhou Gaoshengda Technology Co.,LTD" },

16868 { 0x2CDB07, "Intel Corporate" },

16869 { 0x2CDC78, "Descartes Systems (USA) LLC" },

16870 { 0x2CDCAD, "Wistron Neweb Corporation" },

16871 { 0x2CDCD7, "AzureWave Technology Inc." },

16872 { 0x2CDD0C, "Discovergy GmbH" },

16873 { 0x2CDD5F, "Shenzhen iComm Semiconductor CO.,LTD" },

16874 { 0x2CDD95, "Taicang T&W Electronics" },

16875 { 0x2CDDA3, "Point Grey Research Inc." },

16876 { 0x2CDDE9, "Arista Networks" },

16877 { 0x2CE032, "TCL King Electrical Appliances(Huizhou)Co.,Ltd" },

16878 { 0x2CE2A8, "DeviceDesign" },

16879 { 0x2CE310, "Stratacache" },

16880 { 0x2CE412, "Sagemcom Broadband SAS" },

16881 { 0x2CE6CC, "Ruckus Wireless" },

16882 { 0x2CE871, "Alert Metalguard ApS" },

16883 { 0x2CEA7F, "Dell Inc." },

16884 { 0x2CEADC, "ASKEY COMPUTER CORP" },

16885 { 0x2CECF7, "Shenzhen SDMC Technology CO.,Ltd." },

16886 { 0x2CEDB0, "HUAWEI TECHNOLOGIES CO.,LTD" },

16887 { 0x2CEDEB, "Alpheus Digital Company Limited" },

16888 { 0x2CEE26, "Petroleum Geo-Services" },

16889 { 0x2CF05D, "Micro-Star INTL CO., LTD." },

16890 { 0x2CF0A2, "Apple, Inc." },

16891 { 0x2CF0EE, "Apple, Inc." },

16892 { 0x2CF1BB, "zte corporation" },

16893 { 0x2CF203, "EMKO ELEKTRONIK SAN VE TIC AS" },

16894 { 0x2CF295, "Huawei Device Co., Ltd." },

16895 { 0x2CF2A5, "Sagemcom Broadband SAS" },

16896 { 0x2CF432, "Espressif Inc." },

16897 { 0x2CF4C5, "Avaya Inc" },

16898 { 0x2CF7F1, "Seeed Technology Inc." },

16899 { 0x2CF89B, "Cisco Systems, Inc" },

16900 { 0x2CFAA2, "Alcatel-Lucent Enterprise" },

16901 { 0x2CFC8B, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

16902 { 0x2CFCE4, "CTEK Sweden AB" },

16903 { 0x2CFD37, "Blue Calypso, Inc." },

16904 { 0x2CFDA1, "ASUSTek COMPUTER INC." },

16905 { 0x2CFDAB, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

16906 { 0x2CFDB3, "Tonly Technology Co. Ltd" },

16907 { 0x2CFDB4, "Shenzhen Jingxun Software Telecommunication Technology Co.,Ltd" },

16908 { 0x2CFE4F, "Xiaomi Communications Co Ltd" },

16909 { 0x2CFEE2, "Qingdao Hisense Communications Co.,Ltd." },

16910 { 0x2CFF65, "Oki Electric Industry Co., Ltd." },

16911 { 0x2CFFEE, "vivo Mobile Communication Co., Ltd." },

16912 { 0x3003C8, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

16913 { 0x30045C, "Shenzhen SuperElectron Technology Co.,Ltd." },

16914 { 0x300505, "Intel Corporate" },

16915 { 0x30053F, "JTI Co.,Ltd." },

16916 { 0x30055C, "Brother industries, LTD." },

16917 { 0x30074D, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

16918 { 0x3009C0, "Motorola Mobility LLC, a Lenovo Company" },

16919 { 0x3009F9, "IEEE Registration Authority" },

16920 { 0x300A60, "IEEE Registration Authority" },

16921 { 0x300AC5, "Ruio telecommunication technologies Co., Limited" },

16922 { 0x300B9C, "Delta Mobile Systems, Inc." },

16923 { 0x300C23, "zte corporation" },

16924 { 0x300D2A, "Zhejiang Wellcom Technology Co.,Ltd." },

16925 { 0x300D43, "Microsoft Mobile Oy" },

16926 { 0x300D9E, "Ruijie Networks Co.,LTD" },

16927 { 0x300EB8, "LG Electronics" },

16928 { 0x300ED5, "Hon Hai Precision Ind. Co.,Ltd." },

16929 { 0x300EE3, "Aquantia Corporation" },

16930 { 0x3010B3, "Liteon Technology Corporation" },

16931 { 0x3010E4, "Apple, Inc." },

16932 { 0x301389, "Siemens AG, Automations & Drives," },

16933 { 0x30142D, "Piciorgros GmbH" },

16934 { 0x30144A, "Wistron Neweb Corporation" },

16935 { 0x301518, "Ubiquitous Communication Co. ltd." },

16936 { 0x30168D, "ProLon" },

16937 { 0x30169D, "MERCUSYS TECHNOLOGIES CO., LTD." },

16938 { 0x3017C8, "Sony Corporation" },

16939 { 0x3018CF, "DEOS control systems GmbH" },

16940 { 0x301966, "Samsung Electronics Co.,Ltd" },

16941 { 0x301984, "HUAWEI TECHNOLOGIES CO.,LTD" },

16942 { 0x301A28, "Mako Networks Ltd" },

16943 { 0x301A30, "Mako Networks Ltd" },

16944 { 0x301ABA, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

16945 { 0x301B97, "Lierda Science & Technology Group Co.,Ltd" },

16946 { 0x301D49, "Firmus Technologies Pty Ltd" },

16947 { 0x301F48, "zte corporation" },

16948 { 0x301F9A, "IEEE Registration Authority" },

16949 { 0x30215B, "Shenzhen Ostar Display Electronic Co.,Ltd" },

16950 { 0x302303, "Belkin International Inc." },

16951 { 0x302364, "Nokia Shanghai Bell Co., Ltd." },

16952 { 0x302432, "Intel Corporate" },

16953 { 0x302478, "Sagemcom Broadband SAS" },

16954 { 0x3024A9, "HP Inc." },

16955 { 0x3027CF, "Canopy Growth Corp" },

16956 { 0x302952, "Hillstone Networks Inc" },

16957 { 0x3029BE, "Shanghai MRDcom Co.,Ltd" },

16958 { 0x302BDC, "Top-Unum Electronics Co., LTD" },

16959 { 0x302DE8, "JDA, LLC (JDA Systems)" },

16960 { 0x302F1E, "SIEMENS AG" },

16961 { 0x302FAC, "Zhejiang HuaRay Technology Co.,Ltd" },

16962 { 0x3030F9, "Espressif Inc." },

16963 { 0x30317D, "Hosiden Corporation" },

16964 { 0x303180, "Shenzhen Skyworth Digital Technology CO., Ltd" },

16965 { 0x303235, "Qingdao Intelligent&Precise Electronics Co.,Ltd." },

16966 { 0x303294, "W-IE-NE-R Plein & Baus GmbH" },

16967 { 0x3032D4, "Hanilstm Co., Ltd." },

16968 { 0x303335, "Boosty" },

16969 { 0x303422, "eero inc." },

16970 { 0x3034D2, "Availink, Inc." },

16971 { 0x3035AD, "Apple, Inc." },

16972 { 0x3035C5, "Huawei Device Co., Ltd." },

16973 { 0x3037A6, "Cisco Systems, Inc" },

16974 { 0x3037B3, "HUAWEI TECHNOLOGIES CO.,LTD" },

16975 { 0x303855, "Nokia Corporation" },

16976 { 0x303926, "Sony Corporation" },

16977 { 0x303955, "Shenzhen Jinhengjia Electronic Co., Ltd." },

16978 { 0x3039A9, "Hongshan Information Science and Technology (HangZhou) Co.,Ltd." },

16979 { 0x3039F2, "ADB Broadband Italia" },

16980 { 0x303A64, "Intel Corporate" },

16981 { 0x303ABA, "Guangzhou BaoLun Electronics Co., Ltd" },

16982 { 0x303D08, "GLINTT TES S.A." },

16983 { 0x303D51, "IEEE Registration Authority" },

16984 { 0x303EA7, "Intel Corporate" },

16985 { 0x303EAD, "Sonavox Canada Inc" },

16986 { 0x303F5D, "PT HAN SUNG ELECTORONICS INDONESIA" },

16987 { 0x303F7B, "Shenzhen YOUHUA Technology Co., Ltd" },

16988 { 0x303FBB, "Hewlett Packard Enterprise" },

16989 { 0x304074, "zte corporation" },

16990 { 0x304174, "ALTEC LANSING LLC" },

16991 { 0x304225, "BURG-WÄCHTER KG" },

16992 { 0x304240, "zte corporation" },

16993 { 0x3042A1, "ilumisys Inc. DBA Toggled" },

16994 { 0x3043D7, "IEEE Registration Authority" },

16995 { 0x304449, "PLATH Signal Products GmbH & Co. KG" },

16996 { 0x304487, "Hefei Radio Communication Technology Co., Ltd" },

16997 { 0x3044A1, "Shanghai Nanchao Information Technology" },

16998 { 0x304511, "Texas Instruments" },

16999 { 0x304596, "HUAWEI TECHNOLOGIES CO.,LTD" },

17000 { 0x30469A, "NETGEAR" },

17001 { 0x30493B, "Nanjing Z-Com Wireless Co.,Ltd" },

17002 { 0x304950, "IEEE Registration Authority" },

17003 { 0x30499E, "HUAWEI TECHNOLOGIES CO.,LTD" },

17004 { 0x304A26, "Shenzhen Trolink Technology CO, LTD" },

17005 { 0x304B07, "Motorola Mobility LLC, a Lenovo Company" },

17006 { 0x304C7E, "Panasonic Electric Works Automation Controls Techno Co.,Ltd." },

17007 { 0x304E1B, "Huawei Device Co., Ltd." },

17008 { 0x304EC3, "Tianjin Techua Technology Co., Ltd." },

17009 { 0x304F00, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

17010 { 0x304F75, "DZS Inc." },

17011 { 0x305075, "GN Audio A/S" },

17012 { 0x3050CE, "Xiaomi Communications Co Ltd" },

17013 { 0x3050F1, "Ennoconn Corporation." },

17014 { 0x3050FD, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

17015 { 0x3051F8, "BYK-Gardner GmbH" },

17016 { 0x30525A, "NST Co., LTD" },

17017 { 0x3052CB, "Liteon Technology Corporation" },

17018 { 0x3053C1, "CRESYN" },

17019 { 0x3055ED, "Trex Network LLC" },

17020 { 0x305684, "SHENZHEN YUNJI INTELLIGENT TECHNOLOGY CO.,LTD" },

17021 { 0x305696, "Infinix mobility limited" },

17022 { 0x305714, "Apple, Inc." },

17023 { 0x30578E, "eero inc." },

17024 { 0x3057AC, "IRLAB LTD." },

17025 { 0x305890, "Frontier Silicon Ltd" },

17026 { 0x30595B, "streamnow AG" },

17027 { 0x3059B7, "Microsoft" },

17028 { 0x305A3A, "ASUSTek COMPUTER INC." },

17029 { 0x305A99, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

17030 { 0x305D38, "Beissbarth" },

17031 { 0x305DA6, "ADVALY SYSTEM Inc." },

17032 { 0x305F77, "New H3C Technologies Co., Ltd" },

17033 { 0x30600A, "CIG SHANGHAI CO LTD" },

17034 { 0x306023, "ARRIS Group, Inc." },

17035 { 0x306112, "PAV GmbH" },

17036 { 0x306118, "Paradom Inc." },

17037 { 0x30636B, "Apple, Inc." },

17038 { 0x306371, "Shenzhenshi Xinzhongxin Technology Co.Ltd" },

17039 { 0x3065EC, "Wistron (ChongQing)" },

17040 { 0x3066D0, "Huawei Device Co., Ltd." },

17041 { 0x3067A1, "Sagemcom Broadband SAS" },

17042 { 0x30688C, "Reach Technology Inc." },

17043 { 0x30694B, "RIM" },

17044 { 0x306A85, "Samsung Electronics Co.,Ltd" },

17045 { 0x306CBE, "Skymotion Technology (HK) Limited" },

17046 { 0x306E5C, "Validus Technologies" },

17047 { 0x306F07, "Nations Technologies Inc." },

17048 { 0x3071B2, "Hangzhou Prevail Optoelectronic Equipment Co.,LTD." },

17049 { 0x307350, "Inpeco SA" },

17050 { 0x307467, "Samsung Electronics Co.,Ltd" },

17051 { 0x307496, "HUAWEI TECHNOLOGIES CO.,LTD" },

17052 { 0x307512, "Sony Corporation" },

17053 { 0x30766F, "LG Electronics (Mobile Communications)" },

17054 { 0x3077CB, "Maike Industry(Shenzhen)CO.,LTD" },

17055 { 0x30785C, "Partow Tamas Novin (Parman)" },

17056 { 0x30786B, "TIANJIN Golden Pentagon Electronics Co., Ltd." },

17057 { 0x3078C2, "Innowireless / QUCELL Networks" },

17058 { 0x3078D3, "Virgilant Technologies Ltd." },

17059 { 0x307A57, "Accuenergy (CANADA) Inc" },

17060 { 0x307BAC, "New H3C Technologies Co., Ltd" },

17061 { 0x307BC9, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

17062 { 0x307C30, "RIM" },

17063 { 0x307C4A, "Huawei Device Co., Ltd." },

17064 { 0x307C5E, "Juniper Networks" },

17065 { 0x307CB2, "ANOV FRANCE" },

17066 { 0x307ECB, "SFR" },

17067 { 0x307F10, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

17068 { 0x30809B, "New H3C Technologies Co., Ltd" },

17069 { 0x308216, "Apple, Inc." },

17070 { 0x308398, "Espressif Inc." },

17071 { 0x3083D2, "Motorola Mobility LLC, a Lenovo Company" },

17072 { 0x308454, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

17073 { 0x3085A9, "ASUSTek COMPUTER INC." },

17074 { 0x3085EB, "Fiberhome Telecommunication Technologies Co.,LTD" },

17075 { 0x30862D, "Arista Network, Inc." },

17076 { 0x3086F1, "Fiberhome Telecommunication Technologies Co.,LTD" },

17077 { 0x308730, "HUAWEI TECHNOLOGIES CO.,LTD" },

17078 { 0x3087D9, "Ruckus Wireless" },

17079 { 0x308841, "Sichuan AI-Link Technology Co., Ltd." },

17080 { 0x308944, "DEVA Broadcast Ltd." },

17081 { 0x30894A, "Intel Corporate" },

17082 { 0x308976, "DALIAN LAMBA TECHNOLOGY CO.,LTD" },

17083 { 0x308999, "Guangdong East Power Co.," },

17084 { 0x3089D3, "HONGKONG UCLOUDLINK NETWORK TECHNOLOGY LIMITED" },

17085 { 0x308AF7, "Huawei Device Co., Ltd." },

17086 { 0x308BB2, "Cisco Systems, Inc" },

17087 { 0x308CFB, "Dropcam" },

17088 { 0x308D99, "Hewlett Packard" },

17089 { 0x308DD4, "HUAWEI TECHNOLOGIES CO.,LTD" },

17090 { 0x308E7A, "Shenzhen iComm Semiconductor CO.,LTD" },

17091 { 0x308ECF, "HUAWEI TECHNOLOGIES CO.,LTD" },

17092 { 0x309048, "Apple, Inc." },

17093 { 0x3090AB, "Apple, Inc." },

17094 { 0x309176, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

17095 { 0x30918F, "Technicolor Delivery Technologies Belgium NV" },

17096 { 0x3092F6, "SHANGHAI SUNMON COMMUNICATION TECHNOGY CO.,LTD" },

17097 { 0x3093BC, "Sagemcom Broadband SAS" },

17098 { 0x309435, "vivo Mobile Communication Co., Ltd." },

17099 { 0x309587, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

17100 { 0x3095E3, "SHANGHAI SIMCOM LIMITED" },

17101 { 0x309610, "Huawei Device Co., Ltd." },

17102 { 0x30963B, "Huawei Device Co., Ltd." },

17103 { 0x3096FB, "Samsung Electronics Co.,Ltd" },

17104 { 0x309935, "zte corporation" },

17105 { 0x309BAD, "BBK EDUCATIONAL ELECTRONICS CORP.,LTD." },

17106 { 0x309C23, "Micro-Star INTL CO., LTD." },

17107 { 0x309E1D, "OHSUNG" },

17108 { 0x309FFB, "Ardomus Networks Corporation" },

17109 { 0x30A023, "ROCK PATH S.R.L" },

17110 { 0x30A176, "Fiberhome Telecommunication Technologies Co.,LTD" },

17111 { 0x30A1FA, "HUAWEI TECHNOLOGIES CO.,LTD" },

17112 { 0x30A220, "ARG Telecom" },

17113 { 0x30A243, "Shenzhen Prifox Innovation Technology Co., Ltd." },

17114 { 0x30A2C2, "Huawei Device Co., Ltd." },

17115 { 0x30A30F, "HUAWEI TECHNOLOGIES CO.,LTD" },

17116 { 0x30A452, "Arrival Elements BV" },

17117 { 0x30A612, "ShenZhen Hugsun Technology Co.,Ltd." },

17118 { 0x30A889, "DECIMATOR DESIGN" },

17119 { 0x30A8DB, "Sony Corporation" },

17120 { 0x30A998, "Huawei Device Co., Ltd." },

17121 { 0x30A9DE, "LG Innotek" },

17122 { 0x30AABD, "Shanghai Reallytek Information Technology Co.,Ltd" },

17123 { 0x30AAE4, "Huawei Device Co., Ltd." },

17124 { 0x30AB6A, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

17125 { 0x30AE7B, "Deqing Dusun Electron CO., LTD" },

17126 { 0x30AEA4, "Espressif Inc." },

17127 { 0x30AEF6, "Radio Mobile Access" },

17128 { 0x30AF7E, "Texas Instruments" },

17129 { 0x30AFCE, "vivo Mobile Communication Co., Ltd." },

17130 { 0x30B037, "New H3C Technologies Co., Ltd" },

17131 { 0x30B0EA, "Shenzhen Chuangxin Internet Communication Technology Co., Ltd" },

17132 { 0x30B164, "Power Electronics International Inc." },

17133 { 0x30B1B5, "Arcadyan Corporation" },

17134 { 0x30B216, "Hitachi Energy Germany AG" },

17135 { 0x30B237, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

17136 { 0x30B29F, "EVIDENT CORPORATION" },

17137 { 0x30B346, "CJSC NORSI-TRANS" },

17138 { 0x30B3A2, "Shenzhen Heguang Measurement & Control Technology Co.,Ltd" },

17139 { 0x30B49E, "TP-LINK TECHNOLOGIES CO.,LTD." },

17140 { 0x30B4B8, "LG Electronics" },

17141 { 0x30B5C2, "TP-LINK TECHNOLOGIES CO.,LTD." },

17142 { 0x30B5F1, "Aitexin Technology Co., Ltd" },

17143 { 0x30B62D, "Mojo Networks, Inc." },

17144 { 0x30B64F, "Juniper Networks" },

17145 { 0x30B7D4, "Hitron Technologies. Inc" },

17146 { 0x30B851, "Siemens AG" },

17147 { 0x30B930, "zte corporation" },

17148 { 0x30B9B0, "Intracom Asia Co., Ltd" },

17149 { 0x30BB7D, "OnePlus Technology (Shenzhen) Co., Ltd" },

17150 { 0x30BE3B, "Mitsubishi Electric Corporation" },

17151 { 0x30C01B, "Shenzhen Jingxun Software Telecommunication Technology Co.,Ltd" },

17152 { 0x30C3D9, "ALPSALPINE CO,.LTD" },

17153 { 0x30C507, "ECI Telecom Ltd." },

17154 { 0x30C50F, "HUAWEI TECHNOLOGIES CO.,LTD" },

17155 { 0x30C6D7, "New H3C Technologies Co., Ltd" },

17156 { 0x30C6F7, "Espressif Inc." },

17157 { 0x30C750, "MIC Technology Group" },

17158 { 0x30C7AE, "Samsung Electronics Co.,Ltd" },

17159 { 0x30C82A, "WI-BIZ srl" },

17160 { 0x30C922, "Espressif Inc." },

17161 { 0x30C9AB, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

17162 { 0x30CB36, "Belden Singapore Pte. Ltd." },

17163 { 0x30CBC7, "Cambium Networks Limited" },

17164 { 0x30CBF8, "Samsung Electronics Co.,Ltd" },

17165 { 0x30CC21, "zte corporation" },

17166 { 0x30CDA7, "Samsung Electronics Co.,Ltd" },

17167 { 0x30D042, "Dell Inc." },

17168 { 0x30D16B, "Liteon Technology Corporation" },

17169 { 0x30D17E, "HUAWEI TECHNOLOGIES CO.,LTD" },

17170 { 0x30D32D, "devolo AG" },

17171 { 0x30D357, "Logosol, Inc." },

17172 { 0x30D386, "zte corporation" },

17173 { 0x30D46A, "Autosales Incorporated" },

17174 { 0x30D53E, "Apple, Inc." },

17175 { 0x30D587, "Samsung Electronics Co.,Ltd" },

17176 { 0x30D659, "Merging Technologies SA" },

17177 { 0x30D6C9, "Samsung Electronics Co.,Ltd" },

17178 { 0x30D7A1, "Apple, Inc." },

17179 { 0x30D875, "Apple, Inc." },

17180 { 0x30D941, "Raydium Semiconductor Corp." },

17181 { 0x30D959, "Shanghai Longcheer Technology Co., Ltd." },

17182 { 0x30D97F, "Tech4home, Lda" },

17183 { 0x30D9D9, "Apple, Inc." },

17184 { 0x30DCE7, "zte corporation" },

17185 { 0x30DE4B, "TP-Link Corporation Limited" },

17186 { 0x30DE86, "Cedac Software S.r.l." },

17187 { 0x30DF17, "ALPSALPINE CO,.LTD" },

17188 { 0x30DF8D, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

17189 { 0x30E04F, "Apple, Inc." },

17190 { 0x30E090, "Genevisio Ltd." },

17191 { 0x30E171, "Hewlett Packard" },

17192 { 0x30E1F1, "Intelbras" },

17193 { 0x30E283, "Texas Instruments" },

17194 { 0x30E37A, "Intel Corporate" },

17195 { 0x30E396, "Huawei Device Co., Ltd." },

17196 { 0x30E3D6, "Spotify USA Inc." },

17197 { 0x30E48E, "Vodafone UK" },

17198 { 0x30E4DB, "Cisco Systems, Inc" },

17199 { 0x30E7BC, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

17200 { 0x30E8E4, "Qorvo International Pte. Ltd." },

17201 { 0x30E98E, "HUAWEI TECHNOLOGIES CO.,LTD" },

17202 { 0x30EA26, "Sycada BV" },

17203 { 0x30EB1F, "Skylab M&C Technology Co.,Ltd" },

17204 { 0x30EB25, "INTEK DIGITAL" },

17205 { 0x30EB5A, "LANDIS + GYR" },

17206 { 0x30EC7C, "Shenzhen Along Electronics Co., Ltd" },

17207 { 0x30EFD1, "Alstom Strongwish (Shenzhen) Co., Ltd." },

17208 { 0x30F31D, "zte corporation" },

17209 { 0x30F335, "HUAWEI TECHNOLOGIES CO.,LTD" },

17210 { 0x30F33A, "+plugg srl" },

17211 { 0x30F42F, "ESP" },

17212 { 0x30F6B9, "Ecocentric Energy" },

17213 { 0x30F6EF, "Intel Corporate" },

17214 { 0x30F70D, "Cisco Systems, Inc" },

17215 { 0x30F772, "Hon Hai Precision Ind. Co.,Ltd." },

17216 { 0x30F77F, "S Mobile Devices Limited" },

17217 { 0x30F7C5, "Apple, Inc." },

17218 { 0x30F7D7, "Thread Technology Co., Ltd" },

17219 { 0x30F94B, "Universal Electronics, Inc." },

17220 { 0x30F9ED, "Sony Corporation" },

17221 { 0x30FAB7, "Tunai Creative" },

17222 { 0x30FB10, "Silicon Laboratories" },

17223 { 0x30FB68, "Wuhan Zmvision Technology Co. Ltd." },

17224 { 0x30FB94, "Shanghai Fangzhiwei Information Technology CO.,Ltd." },

17225 { 0x30FBB8, "HUAWEI TECHNOLOGIES CO.,LTD" },

17226 { 0x30FC68, "TP-LINK TECHNOLOGIES CO.,LTD." },

17227 { 0x30FCEB, "LG Electronics (Mobile Communications)" },

17228 { 0x30FD11, "MACROTECH (USA) INC." },

17229 { 0x30FD38, "Google, Inc." },

17230 { 0x30FD65, "HUAWEI TECHNOLOGIES CO.,LTD" },

17231 { 0x30FE31, "Nokia" },

17232 { 0x30FFF6, "HangZhou KuoHeng Technology Co.,ltd" },

17233 { 0x30FFFD, "HUAWEI TECHNOLOGIES CO.,LTD" },

17234 { 0x34008A, "IEEE Registration Authority" },

17235 { 0x3400A3, "HUAWEI TECHNOLOGIES CO.,LTD" },

17236 { 0x340286, "Intel Corporate" },

17237 { 0x34029B, "Plexonics Technologies LImited" },

17238 { 0x3403DE, "Texas Instruments" },

17239 { 0x34049E, "IEEE Registration Authority" },

17240 { 0x34074F, "AccelStor, Inc." },

17241 { 0x3407FB, "Ericsson AB" },

17242 { 0x340804, "D-Link Corporation" },

17243 { 0x3408BC, "Apple, Inc." },

17244 { 0x3408E1, "Texas Instruments" },

17245 { 0x340962, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

17246 { 0x340A22, "TOP-ACCESS ELECTRONICS CO LTD" },

17247 { 0x340A33, "D-Link International" },

17248 { 0x340A98, "HUAWEI TECHNOLOGIES CO.,LTD" },

17249 { 0x340AFF, "Qingdao Hisense Communications Co.,Ltd." },

17250 { 0x340B40, "MIOS ELETTRONICA SRL" },

17251 { 0x340CED, "Moduel AB" },

17252 { 0x340F66, "Web Sensing LLC" },

17253 { 0x3410F4, "Silicon Laboratories" },

17254 { 0x341290, "Treeview Co.,Ltd." },

17255 { 0x341298, "Apple, Inc." },

17256 { 0x3412F9, "HUAWEI TECHNOLOGIES CO.,LTD" },

17257 { 0x341343, "GE Lighting" },

17258 { 0x3413A8, "Mediplan Limited" },

17259 { 0x3413E8, "Intel Corporate" },

17260 { 0x34145F, "Samsung Electronics Co.,Ltd" },

17261 { 0x3414B5, "Texas Instruments" },

17262 { 0x341513, "Texas Instruments" },

17263 { 0x341593, "Ruckus Wireless" },

17264 { 0x34159E, "Apple, Inc." },

17265 { 0x3417EB, "Dell Inc." },

17266 { 0x341A35, "Fiberhome Telecommunication Technologies Co.,LTD" },

17267 { 0x341A4C, "SHENZHEN WEIBU ELECTRONICS CO.,LTD." },

17268 { 0x341B22, "Grandbeing Technology Co., Ltd" },

17269 { 0x341B2D, "Cisco Systems, Inc" },

17270 { 0x341CF0, "Xiaomi Communications Co Ltd" },

17271 { 0x341E6B, "HUAWEI TECHNOLOGIES CO.,LTD" },

17272 { 0x341FE4, "ARRIS Group, Inc." },

17273 { 0x342003, "Shenzhen Feitengyun Technology Co.,LTD" },

17274 { 0x3420E3, "Ruckus Wireless" },

17275 { 0x342109, "Jensen Scandinavia AS" },

17276 { 0x342387, "Hon Hai Precision Ind. Co.,Ltd." },

17277 { 0x3423BA, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

17278 { 0x34243E, "zte corporation" },

17279 { 0x34255D, "Shenzhen Loadcom Technology Co.,Ltd" },

17280 { 0x3425B4, "Silicon Laboratories" },

17281 { 0x3425BE, "Amazon Technologies Inc." },

17282 { 0x342606, "CarePredict, Inc." },

17283 { 0x342792, "FREEBOX SAS" },

17284 { 0x342840, "Apple, Inc." },

17285 { 0x3428F0, "ATN International Limited" },

17286 { 0x342912, "HUAWEI TECHNOLOGIES CO.,LTD" },

17287 { 0x34298F, "IEEE Registration Authority" },

17288 { 0x3429EA, "MCD ELECTRONICS SP. Z O.O." },

17289 { 0x3429EF, "Qingdao Haier Technology Co.,Ltd" },

17290 { 0x342AF1, "Texas Instruments" },

17291 { 0x342B6E, "Apple, Inc." },

17292 { 0x342B70, "Arris" },

17293 { 0x342CC4, "Compal Broadband Networks, Inc." },

17294 { 0x342D0D, "Samsung Electronics Co.,Ltd" },

17295 { 0x342DA3, "Fiberhome Telecommunication Technologies Co.,LTD" },

17296 { 0x342EB6, "HUAWEI TECHNOLOGIES CO.,LTD" },

17297 { 0x342EB7, "Intel Corporate" },

17298 { 0x342F6E, "Anywire corporation" },

17299 { 0x342FBD, "Nintendo Co.,Ltd" },

17300 { 0x343111, "Samsung Electronics Co.,Ltd" },

17301 { 0x34317F, "Panasonic Appliances Company" },

17302 { 0x34318F, "Apple, Inc." },

17303 { 0x3431C4, "AVM GmbH" },

17304 { 0x3432E6, "Panasonic Industrial Devices Europe GmbH" },

17305 { 0x34363B, "Apple, Inc." },

17306 { 0x343654, "zte corporation" },

17307 { 0x343759, "zte corporation" },

17308 { 0x343794, "Hamee Corp." },

17309 { 0x3438AF, "Inlab Networks GmbH" },

17310 { 0x3438B7, "HUMAX Co., Ltd." },

17311 { 0x343A20, "Aruba, a Hewlett Packard Enterprise Company" },

17312 { 0x343D98, "JinQianMao Technology Co.,Ltd." },

17313 { 0x343DC4, "BUFFALO.INC" },

17314 { 0x343EA4, "Ring LLC" },

17315 { 0x3440B5, "IBM" },

17316 { 0x34415D, "Intel Corporate" },

17317 { 0x3441A8, "ER-Telecom" },

17318 { 0x344262, "Apple, Inc." },

17319 { 0x34466F, "HiTEM Engineering" },

17320 { 0x3446EC, "Huawei Device Co., Ltd." },

17321 { 0x34479A, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

17322 { 0x3447D4, "Chengdu Quanjing Intelligent Technology Co.,Ltd" },

17323 { 0x3448ED, "Dell Inc." },

17324 { 0x34495B, "Sagemcom Broadband SAS" },

17325 { 0x344AC3, "HuNan ZiKun Information Technology CO., Ltd" },

17326 { 0x344B3D, "Fiberhome Telecommunication Technologies Co.,LTD" },

17327 { 0x344B50, "zte corporation" },

17328 { 0x344CA4, "amazipoint technology Ltd." },

17329 { 0x344CC8, "Echodyne Corp" },

17330 { 0x344DEA, "zte corporation" },

17331 { 0x344DF7, "LG Electronics (Mobile Communications)" },

17332 { 0x344E2F, "LEAR" },

17333 { 0x344F3F, "IO-Power Technology Co., Ltd." },

17334 { 0x344F5C, "R&amp;M AG" },

17335 { 0x344F69, "EKINOPS SAS" },

17336 { 0x345180, "TCL King Electrical Appliances (Huizhou) Co., Ltd" },

17337 { 0x345184, "Huawei Device Co., Ltd." },

17338 { 0x3451AA, "JID GLOBAL" },

17339 { 0x3451C9, "Apple, Inc." },

17340 { 0x3453D2, "Sagemcom Broadband SAS" },

17341 { 0x34543C, "TAKAOKA TOKO CO.,LTD." },

17342 { 0x345594, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

17343 { 0x3456FE, "Cisco Meraki" },

17344 { 0x345760, "MitraStar Technology Corp." },

17345 { 0x345840, "HUAWEI TECHNOLOGIES CO.,LTD" },

17346 { 0x34587C, "MIRAE INFORMATION TECHNOLOGY CO., LTD." },

17347 { 0x345A06, "SHARP Corporation" },

17348 { 0x345ABA, "tcloud intelligence" },

17349 { 0x345B11, "EVI HEAT AB" },

17350 { 0x345B98, "EM Microelectronic" },

17351 { 0x345BBB, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

17352 { 0x345C40, "Cargt Holdings LLC" },

17353 { 0x345D10, "Wytek" },

17354 { 0x345D9E, "Sagemcom Broadband SAS" },

17355 { 0x345DA8, "Cisco Systems, Inc" },

17356 { 0x345E08, "Roku, Inc" },

17357 { 0x345EE7, "Hangzhou ChengFengErLai Digial Technology Co.,Ltd." },

17358 { 0x3460F9, "TP-Link Corporation Limited" },

17359 { 0x346178, "The Boeing Company" },

17360 { 0x346288, "Cisco Systems, Inc" },

17361 { 0x3462B4, "Renesas Electronics (Penang) Sdn. Bhd." },

17362 { 0x3463D4, "BIONIX SUPPLYCHAIN TECHNOLOGIES SLU" },

17363 { 0x3464A9, "Hewlett Packard" },

17364 { 0x346679, "HUAWEI TECHNOLOGIES CO.,LTD" },

17365 { 0x3466EA, "VERTU INTERNATIONAL CORPORATION LIMITED" },

17366 { 0x34684A, "Teraworks Co., Ltd." },

17367 { 0x346893, "Tecnovideo Srl" },

17368 { 0x346895, "Hon Hai Precision Ind. Co.,Ltd." },

17369 { 0x3468B5, "Texas Instruments" },

17370 { 0x346987, "zte corporation" },

17371 { 0x346AC2, "HUAWEI TECHNOLOGIES CO.,LTD" },

17372 { 0x346B46, "Sagemcom Broadband SAS" },

17373 { 0x346B5B, "New H3C Technologies Co., Ltd" },

17374 { 0x346BD3, "HUAWEI TECHNOLOGIES CO.,LTD" },

17375 { 0x346C0F, "Pramod Telecom Pvt. Ltd" },

17376 { 0x346D9C, "Carrier Corporation" },

17377 { 0x346E8A, "Ecosense" },

17378 { 0x346E9D, "Ericsson AB" },

17379 { 0x346F24, "AzureWave Technology Inc." },

17380 { 0x346F71, "TenaFe Inc." },

17381 { 0x346F90, "Cisco Systems, Inc" },

17382 { 0x346F92, "White Rodgers Division" },

17383 { 0x346FED, "Enovation Controls" },

17384 { 0x347146, "Huawei Device Co., Ltd." },

17385 { 0x34732D, "Cisco Systems, Inc" },

17386 { 0x34735A, "Dell Inc." },

17387 { 0x347379, "xFusion Digital Technologies Co., Limited" },

17388 { 0x347563, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

17389 { 0x3475C7, "Avaya Inc" },

17390 { 0x3476C5, "I-O DATA DEVICE,INC." },

17391 { 0x347839, "zte corporation" },

17392 { 0x347877, "O-Net Communications (Shenzhen) Limited" },

17393 { 0x3478D7, "Gionee Communication Equipment Co.,Ltd." },

17394 { 0x347916, "HUAWEI TECHNOLOGIES CO.,LTD" },

17395 { 0x347A60, "ARRIS Group, Inc." },

17396 { 0x347C25, "Apple, Inc." },

17397 { 0x347DE4, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

17398 { 0x347DF6, "Intel Corporate" },

17399 { 0x347E00, "Huawei Device Co., Ltd." },

17400 { 0x347E39, "Nokia Danmark A/S" },

17401 { 0x347E5C, "Sonos, Inc." },

17402 { 0x347ECA, "NEXTWILL" },

17403 { 0x34800D, "Cavium Inc" },

17404 { 0x3480B3, "Xiaomi Communications Co Ltd" },

17405 { 0x348137, "UNICARD SA" },

17406 { 0x3481C4, "AVM GmbH" },

17407 { 0x3481F4, "SST Taiwan Ltd." },

17408 { 0x3482C5, "Samsung Electronics Co.,Ltd" },

17409 { 0x3482DE, "Kiio Inc" },

17410 { 0x348302, "iFORCOM Co., Ltd" },

17411 { 0x348446, "Ericsson AB" },

17412 { 0x3484E4, "Texas Instruments" },

17413 { 0x348511, "Shenzhen Skyworth Digital Technology CO., Ltd" },

17414 { 0x348518, "Espressif Inc." },

17415 { 0x348584, "Extreme Networks Headquarters" },

17416 { 0x34862A, "Heinz Lackmann GmbH & Co KG" },

17417 { 0x34865D, "Espressif Inc." },

17418 { 0x34873D, "Quectel Wireless Solutions Co.,Ltd." },

17419 { 0x348818, "Cisco Systems, Inc" },

17420 { 0x34885D, "Logitech Far East" },

17421 { 0x348A12, "Aruba, a Hewlett Packard Enterprise Company" },

17422 { 0x348A7B, "Samsung Electronics Co.,Ltd" },

17423 { 0x348AAE, "Sagemcom Broadband SAS" },

17424 { 0x348B75, "LAVA INTERNATIONAL(H.K) LIMITED" },

17425 { 0x348C5E, "Apple, Inc." },

17426 { 0x348D52, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

17427 { 0x348F27, "Ruckus Wireless" },

17428 { 0x34916F, "UserGate Ltd." },

17429 { 0x3492C2, "Square Route Co., Ltd." },

17430 { 0x349342, "TTE Corporation" },

17431 { 0x349454, "Espressif Inc." },

17432 { 0x3495DB, "Logitec Corporation" },

17433 { 0x349672, "TP-LINK TECHNOLOGIES CO.,LTD." },

17434 { 0x349677, "zte corporation" },

17435 { 0x34976F, "Rootech, Inc." },

17436 { 0x3497F6, "ASUSTek COMPUTER INC." },

17437 { 0x3497FB, "ADVANCED RF TECHNOLOGIES INC" },

17438 { 0x34987A, "Espressif Inc." },

17439 { 0x3498B5, "NETGEAR" },

17440 { 0x34996F, "VPI Engineering" },

17441 { 0x349971, "Quanta Storage Inc." },

17442 { 0x3499D7, "Universal Flow Monitors, Inc." },

17443 { 0x349A0D, "ZBD Displays Ltd" },

17444 { 0x349B5B, "Maquet GmbH" },

17445 { 0x349D90, "Heinzmann GmbH & CO. KG" },

17446 { 0x349E34, "Evervictory Electronic Co.Ltd" },

17447 { 0x349F7B, "CANON INC." },

17448 { 0x34A183, "AWare, Inc" },

17449 { 0x34A2A2, "HUAWEI TECHNOLOGIES CO.,LTD" },

17450 { 0x34A395, "Apple, Inc." },

17451 { 0x34A3BF, "Terewave. Inc." },

17452 { 0x34A55D, "TECHNOSOFT INTERNATIONAL SRL" },

17453 { 0x34A5B4, "NAVTECH PTE LTD" },

17454 { 0x34A5E1, "Sensorist ApS" },

17455 { 0x34A68C, "Shine Profit Development Limited" },

17456 { 0x34A709, "Trevil srl" },

17457 { 0x34A7BA, "Fischer International Systems Corporation" },

17458 { 0x34A843, "KYOCERA Display Corporation" },

17459 { 0x34A84E, "Cisco Systems, Inc" },

17460 { 0x34A8EB, "Apple, Inc." },

17461 { 0x34AA31, "Shenzhen Skyworth Digital Technology CO., Ltd" },

17462 { 0x34AA8B, "Samsung Electronics Co.,Ltd" },

17463 { 0x34AA99, "Nokia" },

17464 { 0x34AAEE, "Mikrovisatos Servisas UAB" },

17465 { 0x34AB37, "Apple, Inc." },

17466 { 0x34AB95, "Espressif Inc." },

17467 { 0x34AC11, "China Mobile Group Device Co.,Ltd." },

17468 { 0x34AD61, "CELESTICA INC." },

17469 { 0x34ADE4, "Shanghai Chint Power Systems Co., Ltd." },

17470 { 0x34AF2C, "Nintendo Co., Ltd." },

17471 { 0x34AFA3, "Recogni Inc" },

17472 { 0x34AFB3, "Amazon Technologies Inc." },

17473 { 0x34B1EB, "Apple, Inc." },

17474 { 0x34B1F7, "Texas Instruments" },

17475 { 0x34B20A, "Huawei Device Co., Ltd." },

17476 { 0x34B354, "HUAWEI TECHNOLOGIES CO.,LTD" },

17477 { 0x34B472, "Espressif Inc." },

17478 { 0x34B571, "PLDS" },

17479 { 0x34B5A3, "CIG SHANGHAI CO LTD" },

17480 { 0x34B7DA, "Espressif Inc." },

17481 { 0x34B7FD, "Guangzhou Younghead Electronic Technology Co.,Ltd" },

17482 { 0x34B883, "Cisco Systems, Inc" },

17483 { 0x34B98D, "Xiaomi Communications Co Ltd" },

17484 { 0x34BA38, "PAL MOHAN ELECTRONICS PVT LTD" },

17485 { 0x34BA51, "Se-Kure Controls, Inc." },

17486 { 0x34BA75, "Everest Networks, Inc" },

17487 { 0x34BA9A, "Asiatelco Technologies Co." },

17488 { 0x34BB1F, "BlackBerry RTS" },

17489 { 0x34BB26, "Motorola Mobility LLC, a Lenovo Company" },

17490 { 0x34BCA6, "Beijing Ding Qing Technology, Ltd." },

17491 { 0x34BD20, "Hangzhou Hikrobot Technology Co., Ltd." },

17492 { 0x34BDC8, "Cisco Systems, Inc" },

17493 { 0x34BDF9, "Shanghai WDK Industrial Co.,Ltd." },

17494 { 0x34BDFA, "Cisco SPVTG" },

17495 { 0x34BE00, "Samsung Electronics Co.,Ltd" },

17496 { 0x34BF90, "Fiberhome Telecommunication Technologies Co.,LTD" },

17497 { 0x34C059, "Apple, Inc." },

17498 { 0x34C0F9, "Rockwell Automation" },

17499 { 0x34C103, "Hangzhou Huamu Technology Co.,Ltd." },

17500 { 0x34C3AC, "Samsung Electronics Co.,Ltd" },

17501 { 0x34C3D2, "FN-LINK TECHNOLOGY LIMITED" },

17502 { 0x34C515, "Aruba, a Hewlett Packard Enterprise Company" },

17503 { 0x34C5D0, "Hagleitner Hygiene International GmbH" },

17504 { 0x34C69A, "Enecsys Ltd" },

17505 { 0x34C731, "ALPSALPINE CO,.LTD" },

17506 { 0x34C7E9, "Google, Inc." },

17507 { 0x34C803, "Nokia Corporation" },

17508 { 0x34C93D, "Intel Corporate" },

17509 { 0x34C99D, "EIDOLON COMMUNICATIONS TECHNOLOGY CO. LTD." },

17510 { 0x34C9F0, "LM Technologies Ltd" },

17511 { 0x34CA81, "New H3C Intelligence Terminal Co., Ltd." },

17512 { 0x34CB1A, "Procter & Gamble Company" },

17513 { 0x34CC28, "Nexpring Co. LTD.," },

17514 { 0x34CD6D, "CommSky Technologies" },

17515 { 0x34CDBE, "HUAWEI TECHNOLOGIES CO.,LTD" },

17516 { 0x34CE00, "XIAOMI Electronics,CO.,LTD" },

17517 { 0x34CE69, "Nokia Solutions and Networks GmbH & Co. KG" },

17518 { 0x34CE94, "Parsec (Pty) Ltd" },

17519 { 0x34CF6C, "Hangzhou Taili wireless communication equipment Co.,Ltd" },

17520 { 0x34CFF6, "Intel Corporate" },

17521 { 0x34D09B, "MobilMAX Technology Inc." },

17522 { 0x34D0B8, "IEEE Registration Authority" },

17523 { 0x34D262, "SZ DJI TECHNOLOGY CO.,LTD" },

17524 { 0x34D270, "Amazon Technologies Inc." },

17525 { 0x34D2C4, "RENA GmbH Print Systeme" },

17526 { 0x34D4E3, "Atom Power, Inc." },

17527 { 0x34D693, "Huawei Device Co., Ltd." },

17528 { 0x34D712, "Smartisan Digital Co., Ltd" },

17529 { 0x34D737, "IBG Industriebeteiligungsgesellschaft mbH &b Co. KG" },

17530 { 0x34D772, "Xiamen Yudian Automation Technology Co., Ltd" },

17531 { 0x34D7B4, "Tributary Systems, Inc." },

17532 { 0x34D856, "Shenzhen Skyworth Digital Technology CO., Ltd" },

17533 { 0x34D954, "WiBotic Inc." },

17534 { 0x34DAB7, "zte corporation" },

17535 { 0x34DAC1, "SAE Technologies Development(Dongguan) Co., Ltd." },

17536 { 0x34DB9C, "Sagemcom Broadband SAS" },

17537 { 0x34DBFD, "Cisco Systems, Inc" },

17538 { 0x34DC99, "New H3C Technologies Co., Ltd" },

17539 { 0x34DD04, "Minut AB" },

17540 { 0x34DD7E, "Umeox Innovations Co.,Ltd" },

17541 { 0x34DE1A, "Intel Corporate" },

17542 { 0x34DE34, "zte corporation" },

17543 { 0x34DF20, "Shenzhen Comstar .Technology Co.,Ltd" },

17544 { 0x34DF2A, "Fujikon Industrial Co.,Limited" },

17545 { 0x34E0CF, "zte corporation" },

17546 { 0x34E0D7, "DONGGUAN QISHENG ELECTRONICS INDUSTRIAL CO., LTD" },

17547 { 0x34E12D, "Intel Corporate" },

17548 { 0x34E1D1, "IEEE Registration Authority" },

17549 { 0x34E2FD, "Apple, Inc." },

17550 { 0x34E380, "Genexis B.V." },

17551 { 0x34E3DA, "Hoval Aktiengesellschaft" },

17552 { 0x34E42A, "Automatic Bar Controls Inc." },

17553 { 0x34E5EC, "Palo Alto Networks" },

17554 { 0x34E6AD, "Intel Corporate" },

17555 { 0x34E6D7, "Dell Inc." },

17556 { 0x34E70B, "HAN Networks Co., Ltd" },

17557 { 0x34E71C, "Shenzhen YOUHUA Technology Co., Ltd" },

17558 { 0x34E894, "TP-LINK TECHNOLOGIES CO.,LTD." },

17559 { 0x34E911, "vivo Mobile Communication Co., Ltd." },

17560 { 0x34E9FE, "Metis Co., Ltd." },

17561 { 0x34EA34, "HangZhou Gubei Electronics Technology Co.,Ltd" },

17562 { 0x34EAE7, "Shanghai High-Flying Electronics Technology Co., Ltd" },

17563 { 0x34ECB6, "Phyplus Microelectronics Limited" },

17564 { 0x34ED0B, "Shanghai XZ-COM.CO.,Ltd." },

17565 { 0x34ED1B, "Cisco Systems, Inc" },

17566 { 0x34EE16, "Apple, Inc." },

17567 { 0x34EE2A, "ConMet" },

17568 { 0x34EF44, "2Wire Inc" },

17569 { 0x34EF8B, "NTT Communications Corporation" },

17570 { 0x34EFB6, "Edgecore Networks Corporation" },

17571 { 0x34F043, "Samsung Electronics Co.,Ltd" },

17572 { 0x34F0CA, "Shenzhen Linghangyuan Digital Technology Co.,Ltd." },

17573 { 0x34F150, "Hui Zhou Gaoshengda Technology Co.,LTD" },

17574 { 0x34F223, "Fujian Newland Communication Science Technology Co.,Ltd." },

17575 { 0x34F39A, "Intel Corporate" },

17576 { 0x34F39B, "WizLAN Ltd." },

17577 { 0x34F62D, "SHARP Corporation" },

17578 { 0x34F64B, "Intel Corporate" },

17579 { 0x34F6D2, "Panasonic Taiwan Co.,Ltd." },

17580 { 0x34F716, "TP-LINK TECHNOLOGIES CO.,LTD." },

17581 { 0x34F86E, "Parker Hannifin Corporation" },

17582 { 0x34F8E7, "Cisco Systems, Inc" },

17583 { 0x34F968, "ATEK Products, LLC" },

17584 { 0x34FA40, "Guangzhou Robustel Technologies Co., Limited" },

17585 { 0x34FA9F, "Ruckus Wireless" },

17586 { 0x34FC6F, "ALCEA" },

17587 { 0x34FCA1, "Micronet union Technology(Chengdu)Co., Ltd." },

17588 { 0x34FCB9, "Hewlett Packard Enterprise" },

17589 { 0x34FCEF, "LG Electronics (Mobile Communications)" },

17590 { 0x34FD6A, "Apple, Inc." },

17591 { 0x34FE1C, "CHOUNG HWA TECH CO.,LTD" },

17592 { 0x34FE77, "Apple, Inc." },

17593 { 0x34FE9E, "Fujitsu Limited" },

17594 { 0x34FEC5, "Shenzhen Sunwoda intelligent hardware Co.,Ltd" },

17595 { 0x380025, "Intel Corporate" },

17596 { 0x380118, "ULVAC,Inc." },

17597 { 0x380146, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

17598 { 0x380195, "Samsung Electronics Co.,Ltd" },

17599 { 0x380197, "TSST Global,Inc" },

17600 { 0x38019F, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

17601 { 0x3802DE, "Sercomm Corporation." },

17602 { 0x3802E3, "YICHEN (SHENZHEN) TECHNOLOGY CO.,LTD" },

17603 { 0x380546, "Foctek Photonics, Inc." },

17604 { 0x3805AC, "Piller Group GmbH" },

17605 { 0x3806B4, "A.D.C. GmbH" },

17606 { 0x380716, "FREEBOX SAS" },

17607 { 0x3807D4, "Zeppelin Systems GmbH" },

17608 { 0x3808FD, "Silca Spa" },

17609 { 0x3809A4, "Firefly Integrations" },

17610 { 0x380A0A, "Sky-City Communication and Electronics Limited Company" },

17611 { 0x380A4F, "PRACHI ENTERPRISES" },

17612 { 0x380A94, "Samsung Electronics Co.,Ltd" },

17613 { 0x380AAB, "Formlabs" },

17614 { 0x380B3C, "Texas Instruments" },

17615 { 0x380B40, "Samsung Electronics Co.,Ltd" },

17616 { 0x380DD4, "Primax Electronics Ltd." },

17617 { 0x380E4D, "Cisco Systems, Inc" },

17618 { 0x380E7B, "V.P.S. Thai Co., Ltd" },

17619 { 0x380F4A, "Apple, Inc." },

17620 { 0x380FAD, "HUAWEI TECHNOLOGIES CO.,LTD" },

17621 { 0x380FE4, "Dedicated Network Partners Oy" },

17622 { 0x3810D5, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

17623 { 0x3810F0, "Aruba, a Hewlett Packard Enterprise Company" },

17624 { 0x38127B, "Crenet Labs Co., Ltd." },

17625 { 0x38141B, "Secure Letter Inc." },

17626 { 0x381428, "Dell Inc." },

17627 { 0x38144E, "Fiberhome Telecommunication Technologies Co.,LTD" },

17628 { 0x381672, "Shenzhen SuperElectron Technology Co.,Ltd." },

17629 { 0x3816D1, "Samsung Electronics Co.,Ltd" },

17630 { 0x381730, "Ulrich Lippert GmbH & Co KG" },

17631 { 0x381766, "PROMZAKAZ LTD." },

17632 { 0x3817C3, "Hewlett Packard Enterprise" },

17633 { 0x3817E1, "Vantiva USA LLC" },

17634 { 0x38184C, "Sony Home Entertainment&Sound Products Inc" },

17635 { 0x38192F, "Nokia Corporation" },

17636 { 0x381A52, "Seiko Epson Corporation" },

17637 { 0x381C1A, "Cisco Systems, Inc" },

17638 { 0x381C23, "Hilan Technology CO.,LTD" },

17639 { 0x381C4A, "SIMCom Wireless Solutions Co.,Ltd." },

17640 { 0x381D14, "Skydio Inc." },

17641 { 0x381DD9, "FN-LINK TECHNOLOGY LIMITED" },

17642 { 0x381EC7, "Chipsea Technologies(Shenzhen) Corp." },

17643 { 0x381F26, "IEEE Registration Authority" },

17644 { 0x381F8D, "Tuya Smart Inc." },

17645 { 0x382028, "HUAWEI TECHNOLOGIES CO.,LTD" },

17646 { 0x382056, "Cisco Systems, Inc" },

17647 { 0x3820A8, "ColorTokens, Inc." },

17648 { 0x382187, "Midea Group Co., Ltd." },

17649 { 0x3821C7, "Aruba, a Hewlett Packard Enterprise Company" },

17650 { 0x38229D, "ADB Broadband Italia" },

17651 { 0x3822D6, "Hangzhou H3C Technologies Co., Limited" },

17652 { 0x3822E2, "HP Inc." },

17653 { 0x3822F4, "Huawei Device Co., Ltd." },

17654 { 0x38256B, "Microsoft Mobile Oy" },

17655 { 0x38262B, "UTran Technology" },

17656 { 0x382656, "TCL King Electrical Appliances(Huizhou)Co.,Ltd" },

17657 { 0x3826CD, "ANDTEK" },

17658 { 0x3828EA, "Fujian Netcom Technology Co., LTD" },

17659 { 0x38295A, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

17660 { 0x3829DD, "ONvocal Inc" },

17661 { 0x382A19, "Technica Engineering GmbH" },

17662 { 0x382B78, "ECO PLUGS ENTERPRISE CO., LTD" },

17663 { 0x382C4A, "ASUSTek COMPUTER INC." },

17664 { 0x382DD1, "Samsung Electronics Co.,Ltd" },

17665 { 0x382DE8, "Samsung Electronics Co.,Ltd" },

17666 { 0x3830F9, "LG Electronics (Mobile Communications)" },

17667 { 0x38315A, "Rinnai" },

17668 { 0x3831AC, "WEG" },

17669 { 0x3835FB, "Sagemcom Broadband SAS" },

17670 { 0x38378B, "HUAWEI TECHNOLOGIES CO.,LTD" },

17671 { 0x38384B, "vivo Mobile Communication Co., Ltd." },

17672 { 0x3838A6, "Arista Networks" },

17673 { 0x38396C, "Huawei Device Co., Ltd." },

17674 { 0x38398F, "Silicon Laboratories" },

17675 { 0x383A21, "IEEE Registration Authority" },

17676 { 0x383B26, "Jiangsu Qinheng Co., Ltd." },

17677 { 0x383BC8, "2Wire Inc" },

17678 { 0x383C9C, "Fujian Newland Payment Technology Co.,Ltd." },

17679 { 0x383D5B, "Fiberhome Telecommunication Technologies Co.,LTD" },

17680 { 0x383F10, "DBL Technology Ltd." },

17681 { 0x383FB3, "Vantiva USA LLC" },

17682 { 0x38420B, "Sonos, Inc." },

17683 { 0x384233, "Wildeboer Bauteile GmbH" },

17684 { 0x3842A6, "Ingenieurbuero Stahlkopf" },

17685 { 0x384369, "Patrol Products Consortium LLC" },

17686 { 0x38437D, "Compal Broadband Networks, Inc." },

17687 { 0x3843E5, "Grotech Inc" },

17688 { 0x38453B, "Ruckus Wireless" },

17689 { 0x38454C, "Light Labs, Inc." },

17690 { 0x384554, "Harman/Becker Automotive Systems GmbH" },

17691 { 0x38458C, "MyCloud Technology corporation" },

17692 { 0x384608, "zte corporation" },

17693 { 0x3847BC, "HUAWEI TECHNOLOGIES CO.,LTD" },

17694 { 0x3847F2, "Recogni Inc" },

17695 { 0x38484C, "Apple, Inc." },

17696 { 0x384A80, "Samsung Electronics Co.,Ltd" },

17697 { 0x384B24, "SIEMENS AG" },

17698 { 0x384B5B, "ZTRON TECHNOLOGY LIMITED" },

17699 { 0x384B76, "AIRTAME ApS" },

17700 { 0x384C4F, "HUAWEI TECHNOLOGIES CO.,LTD" },

17701 { 0x384C90, "ARRIS Group, Inc." },

17702 { 0x384F49, "Juniper Networks" },

17703 { 0x384FF0, "AzureWave Technology Inc." },

17704 { 0x38521A, "Nokia" },

17705 { 0x385247, "Huawei Device Co., Ltd." },

17706 { 0x385319, "34ED LLC DBA Centegix" },

17707 { 0x38539C, "Apple, Inc." },

17708 { 0x38549B, "zte corporation" },

17709 { 0x385610, "CANDY HOUSE, Inc." },

17710 { 0x38563D, "Microsoft Corporation" },

17711 { 0x3856B5, "Peerbridge Health Inc" },

17712 { 0x38580C, "Panaccess Systems GmbH" },

17713 { 0x3859F8, "MindMade Sp. z o.o." },

17714 { 0x3859F9, "Hon Hai Precision Ind. Co.,Ltd." },

17715 { 0x385AA8, "Beijing Zhongdun Security Technology Development Co." },

17716 { 0x385B44, "Silicon Laboratories" },

17717 { 0x385C76, "PLANTRONICS, INC." },

17718 { 0x385CFB, "Silicon Laboratories" },

17719 { 0x385F66, "Cisco SPVTG" },

17720 { 0x385FC3, "Yu Jeong System, Co.Ltd" },

17721 { 0x386077, "PEGATRON CORPORATION" },

17722 { 0x3861A5, "Grabango Co" },

17723 { 0x38637F, "Fiberhome Telecommunication Technologies Co.,LTD" },

17724 { 0x3863BB, "Hewlett Packard" },

17725 { 0x3863F6, "3NOD MULTIMEDIA(SHENZHEN)CO.,LTD" },

17726 { 0x386407, "Qingdao Intelligent&Precise Electronics Co.,Ltd." },

17727 { 0x386504, "Honor Device Co., Ltd." },

17728 { 0x3865B2, "Apple, Inc." },

17729 { 0x386645, "OOSIC Technology CO.,Ltd" },

17730 { 0x3866F0, "Apple, Inc." },

17731 { 0x386793, "Asia Optical Co., Inc." },

17732 { 0x386893, "Intel Corporate" },

17733 { 0x3868A4, "Samsung Electronics Co.,Ltd" },

17734 { 0x3868BE, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

17735 { 0x3868DD, "INVENTEC CORPORATION" },

17736 { 0x386A77, "Samsung Electronics Co.,Ltd" },

17737 { 0x386B1C, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

17738 { 0x386BBB, "ARRIS Group, Inc." },

17739 { 0x386C9B, "Ivy Biomedical" },

17740 { 0x386E21, "Wasion Group Ltd." },

17741 { 0x386E88, "zte corporation" },

17742 { 0x386EA2, "vivo Mobile Communication Co., Ltd." },

17743 { 0x386F6B, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

17744 { 0x38700C, "ARRIS Group, Inc." },

17745 { 0x3871DE, "Apple, Inc." },

17746 { 0x3872C0, "Comtrend Corporation" },

17747 { 0x3873EA, "IEEE Registration Authority" },

17748 { 0x387605, "Inogeni" },

17749 { 0x3876CA, "Shenzhen Smart Intelligent Technology Co.Ltd" },

17750 { 0x3876D1, "Euronda SpA" },

17751 { 0x387862, "Sony Corporation" },

17752 { 0x387A0E, "Intel Corporate" },

17753 { 0x387A3C, "Fiberhome Telecommunication Technologies Co.,LTD" },

17754 { 0x387B47, "AKELA, Inc." },

17755 { 0x387C76, "Universal Global Scientific Industrial Co., Ltd." },

17756 { 0x3880DF, "Motorola Mobility LLC, a Lenovo Company" },

17757 { 0x3881D7, "Texas Instruments" },

17758 { 0x388345, "TP-LINK TECHNOLOGIES CO.,LTD." },

17759 { 0x38839A, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

17760 { 0x388479, "Cisco Meraki" },

17761 { 0x388602, "Flexoptix GmbH" },

17762 { 0x3886F7, "Google, Inc." },

17763 { 0x3887D5, "Intel Corporate" },

17764 { 0x38881E, "HUAWEI TECHNOLOGIES CO.,LTD" },

17765 { 0x388871, "ASKEY COMPUTER CORP" },

17766 { 0x3888A4, "Apple, Inc." },

17767 { 0x38892C, "Apple, Inc." },

17768 { 0x3889DC, "Opticon Sensors Europe B.V." },

17769 { 0x388A06, "Samsung Electronics Co.,Ltd" },

17770 { 0x388A21, "UAB Teltonika Telematics" },

17771 { 0x388AB7, "ITC Networks" },

17772 { 0x388ABE, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

17773 { 0x388B59, "Google, Inc." },

17774 { 0x388C50, "LG Electronics" },

17775 { 0x388E7A, "AUTOIT" },

17776 { 0x388EE7, "Fanhattan LLC" },

17777 { 0x388F30, "Samsung Electronics Co.,Ltd" },

17778 { 0x389052, "HUAWEI TECHNOLOGIES CO.,LTD" },

17779 { 0x3890A5, "Cisco Systems, Inc" },

17780 { 0x3890AF, "zte corporation" },

17781 { 0x3891B7, "Cisco Systems, Inc" },

17782 { 0x3891D5, "Hangzhou H3C Technologies Co., Limited" },

17783 { 0x3891FB, "Xenox Holding BV" },

17784 { 0x38922E, "ArrayComm" },

17785 { 0x389461, "Renesas Electronics (Penang) Sdn. Bhd." },

17786 { 0x389496, "Samsung Electronics Co.,Ltd" },

17787 { 0x3894E0, "Syrotech Networks. Ltd." },

17788 { 0x3894ED, "NETGEAR" },

17789 { 0x389592, "Tendyron Corporation" },

17790 { 0x3897A4, "ELECOM CO.,LTD." },

17791 { 0x3897D6, "Hangzhou H3C Technologies Co., Limited" },

17792 { 0x3898D8, "MERITECH CO.,LTD" },

17793 { 0x3898E9, "Huawei Device Co., Ltd." },

17794 { 0x389AF6, "Samsung Electronics Co.,Ltd" },

17795 { 0x389CB2, "Apple, Inc." },

17796 { 0x389D92, "Seiko Epson Corporation" },

17797 { 0x389E80, "zte corporation" },

17798 { 0x389F5A, "C-Kur TV Inc." },

17799 { 0x389F83, "OTN Systems N.V." },

17800 { 0x38A067, "Nokia Solutions and Networks GmbH & Co. KG" },

17801 { 0x38A28C, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

17802 { 0x38A44B, "Huawei Device Co., Ltd." },

17803 { 0x38A4ED, "Xiaomi Communications Co Ltd" },

17804 { 0x38A53C, "COMECER Netherlands" },

17805 { 0x38A5B6, "SHENZHEN MEGMEET ELECTRICAL CO.,LTD" },

17806 { 0x38A659, "Sagemcom Broadband SAS" },

17807 { 0x38A6CE, "SKY UK LIMITED" },

17808 { 0x38A746, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

17809 { 0x38A851, "Quickset Defense Technologies, LLC" },

17810 { 0x38A86B, "Orga BV" },

17811 { 0x38A89B, "Fiberhome Telecommunication Technologies Co.,LTD" },

17812 { 0x38A8CD, "IEEE Registration Authority" },

17813 { 0x38A91C, "New H3C Technologies Co., Ltd" },

17814 { 0x38A95F, "Actifio Inc" },

17815 { 0x38A9EA, "HK DAPU ELECTRONIC TECHNOLOGY CO., LIMITED" },

17816 { 0x38AA3C, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

17817 { 0x38AB16, "NPO RTT LLC" },

17818 { 0x38AB41, "Texas Instruments" },

17819 { 0x38AC3D, "Nephos Inc" },

17820 { 0x38AD2B, "Hitron Technologies. Inc" },

17821 { 0x38AD8E, "New H3C Technologies Co., Ltd" },

17822 { 0x38ADBE, "New H3C Technologies Co., Ltd" },

17823 { 0x38AF29, "Zhejiang Dahua Technology Co., Ltd." },

17824 { 0x38AFD0, "Nevro" },

17825 { 0x38AFD7, "FUJITSU LIMITED" },

17826 { 0x38B12D, "Sonotronic Nagel GmbH" },

17827 { 0x38B19E, "IEEE Registration Authority" },

17828 { 0x38B1DB, "Hon Hai Precision Ind. Co.,Ltd." },

17829 { 0x38B3F7, "Huawei Device Co., Ltd." },

17830 { 0x38B4D3, "BSH Hausgeraete GmbH" },

17831 { 0x38B54D, "Apple, Inc." },

17832 { 0x38B5BD, "E.G.O. Elektro-Ger" },

17833 { 0x38B5C9, "INGRAM MICRO SERVICES" },

17834 { 0x38B5D3, "SecuWorks" },

17835 { 0x38B725, "Wistron Infocomm (Zhongshan) Corporation" },

17836 { 0x38B74D, "Fijowave Limited" },

17837 { 0x38B800, "Wistron Neweb Corporation" },

17838 { 0x38B8EB, "IEEE Registration Authority" },

17839 { 0x38BAB0, "Broadcom" },

17840 { 0x38BAF8, "Intel Corporate" },

17841 { 0x38BB23, "OzVision America LLC" },

17842 { 0x38BB3C, "Avaya Inc" },

17843 { 0x38BC01, "HUAWEI TECHNOLOGIES CO.,LTD" },

17844 { 0x38BC1A, "MEIZU Technology Co., Ltd." },

17845 { 0x38BC61, "Starkoff Co., Ltd." },

17846 { 0x38BD7A, "Aruba, a Hewlett Packard Enterprise Company" },

17847 { 0x38BEAB, "AltoBeam (China) Inc." },

17848 { 0x38BF2F, "Espec Corp." },

17849 { 0x38BF33, "NEC CASIO Mobile Communications" },

17850 { 0x38C096, "ALPSALPINE CO,.LTD" },

17851 { 0x38C0EA, "Fortinet, Inc." },

17852 { 0x38C2BA, "CCTV NEOTECH" },

17853 { 0x38C4E8, "NSS Sp. z o.o." },

17854 { 0x38C6BD, "Xiaomi Communications Co Ltd" },

17855 { 0x38C70A, "WiFiSong" },

17856 { 0x38C7BA, "CS Services Co.,Ltd." },

17857 { 0x38C804, "Hui Zhou Gaoshengda Technology Co.,LTD" },

17858 { 0x38C85C, "Cisco SPVTG" },

17859 { 0x38C986, "Apple, Inc." },

17860 { 0x38C9A9, "SMART High Reliability Solutions, Inc." },

17861 { 0x38CA73, "Shenzhen MiaoMing Intelligent Technology Co.,Ltd" },

17862 { 0x38CA84, "HP Inc." },

17863 { 0x38CA97, "Contour Design LLC" },

17864 { 0x38CADA, "Apple, Inc." },

17865 { 0x38CD07, "Beijing FaceCam Technology Co., Ltd." },

17866 { 0x38D135, "EasyIO Corporation Sdn. Bhd." },

17867 { 0x38D269, "Texas Instruments" },

17868 { 0x38D2CA, "Zhejiang Tmall Technology Co., Ltd." },

17869 { 0x38D40B, "Samsung Electronics Co.,Ltd" },

17870 { 0x38D547, "ASUSTek COMPUTER INC." },

17871 { 0x38D57A, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

17872 { 0x38D620, "Limidea Concept Pte. Ltd." },

17873 { 0x38D7CA, "7HUGS LABS" },

17874 { 0x38D82F, "zte corporation" },

17875 { 0x38D9A5, "Mikotek Information Inc." },

17876 { 0x38DBBB, "Sunbow Telecom Co., Ltd." },

17877 { 0x38DE60, "Mohlenhoff GmbH" },

17878 { 0x38DEAD, "Intel Corporate" },

17879 { 0x38E08E, "Mitsubishi Electric Corporation" },

17880 { 0x38E1AA, "zte corporation" },

17881 { 0x38E1F4, "Sagemcom Broadband SAS" },

17882 { 0x38E26E, "ShenZhen Sweet Rain Electronics Co.,Ltd." },

17883 { 0x38E2CA, "Katun Corporation" },

17884 { 0x38E2DD, "zte corporation" },

17885 { 0x38E39F, "Motorola Mobility LLC, a Lenovo Company" },

17886 { 0x38E3C5, "Taicang T&W Electronics" },

17887 { 0x38E595, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

17888 { 0x38E60A, "Xiaomi Communications Co Ltd" },

17889 { 0x38E7C0, "Hui Zhou Gaoshengda Technology Co.,LTD" },

17890 { 0x38E7D8, "HTC Corporation" },

17891 { 0x38E8DF, "b gmbh medien + datenbanken" },

17892 { 0x38E8EE, "Nanjing Youkuo Electric Technology Co., Ltd" },

17893 { 0x38E98C, "Reco S.p.A." },

17894 { 0x38EAA7, "Hewlett Packard" },

17895 { 0x38EB47, "HUAWEI TECHNOLOGIES CO.,LTD" },

17896 { 0x38EC0D, "Apple, Inc." },

17897 { 0x38EC11, "Novatek Microelectronics Corp." },

17898 { 0x38ECE4, "Samsung Electronics Co.,Ltd" },

17899 { 0x38ED18, "Cisco Systems, Inc" },

17900 { 0x38EE9D, "Anedo Ltd." },

17901 { 0x38EFE3, "INGENICO TERMINALS SAS" },

17902 { 0x38F098, "Vapor Stone Rail Systems" },

17903 { 0x38F0C8, "Logitech" },

17904 { 0x38F135, "SensorTec-Canada" },

17905 { 0x38F23E, "Microsoft Mobile Oy" },

17906 { 0x38F32E, "Skullcandy" },

17907 { 0x38F33F, "TATSUNO CORPORATION" },

17908 { 0x38F3AB, "LCFC(HeFei) Electronics Technology co., ltd" },

17909 { 0x38F3FB, "Asperiq" },

17910 { 0x38F45E, "H1-Radio co.,ltd" },

17911 { 0x38F554, "HISENSE ELECTRIC CO.,LTD" },

17912 { 0x38F557, "JOLATA, INC." },

17913 { 0x38F597, "home2net GmbH" },

17914 { 0x38F601, "Solid State Storage Technology Corporation" },

17915 { 0x38F6CF, "zte corporation" },

17916 { 0x38F6ED, "EVK DI Kerschhaggl GmbH" },

17917 { 0x38F708, "National Resource Management, Inc." },

17918 { 0x38F73D, "Amazon Technologies Inc." },

17919 { 0x38F7B2, "SEOJUN ELECTRIC" },

17920 { 0x38F7CD, "IEEE Registration Authority" },

17921 { 0x38F7F1, "Huawei Device Co., Ltd." },

17922 { 0x38F85E, "HUMAX Co., Ltd." },

17923 { 0x38F889, "HUAWEI TECHNOLOGIES CO.,LTD" },

17924 { 0x38F8B7, "V2COM PARTICIPACOES S.A." },

17925 { 0x38F8CA, "OWIN Inc." },

17926 { 0x38F8F6, "Adtran Inc" },

17927 { 0x38F9D3, "Apple, Inc." },

17928 { 0x38F9F5, "Garmin International" },

17929 { 0x38FACA, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

17930 { 0x38FB14, "HUAWEI TECHNOLOGIES CO.,LTD" },

17931 { 0x38FC34, "Huawei Device Co., Ltd." },

17932 { 0x38FC98, "Intel Corporate" },

17933 { 0x38FDF5, "Renesas Electronics (Penang) Sdn. Bhd." },

17934 { 0x38FDF8, "Cisco Systems, Inc" },

17935 { 0x38FDFE, "IEEE Registration Authority" },

17936 { 0x38FEC5, "Ellips B.V." },

17937 { 0x38FF13, "Joint Stock Company Research Instinite Masshtab" },

17938 { 0x38FF36, "Ruckus Wireless" },

17939 { 0x3C01EF, "Sony Corporation" },

17940 { 0x3C0268, "Infinera, Inc." },

17941 { 0x3C02B1, "Creation Technologies LP" },

17942 { 0x3C0461, "ARRIS Group, Inc." },

17943 { 0x3C04BF, "PRAVIS SYSTEMS Co.Ltd.," },

17944 { 0x3C0518, "Samsung Electronics Co.,Ltd" },

17945 { 0x3C058E, "HUAWEI TECHNOLOGIES CO.,LTD" },

17946 { 0x3C05AB, "Product Creation Studio" },

17947 { 0x3C0630, "Apple, Inc." },

17948 { 0x3C0664, "Beijing Leagrid Technology Co.,Ltd." },

17949 { 0x3C06A7, "TP-LINK TECHNOLOGIES CO.,LTD." },

17950 { 0x3C0754, "Apple, Inc." },

17951 { 0x3C0771, "Sony Corporation" },

17952 { 0x3C081E, "Beijing Yupont Electric Power Technology Co.,Ltd" },

17953 { 0x3C08CD, "Juniper Networks" },

17954 { 0x3C08F6, "Cisco Systems, Inc" },

17955 { 0x3C096D, "Powerhouse Dynamics" },

17956 { 0x3C0AF3, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

17957 { 0x3C0B4F, "Intertech Services AG" },

17958 { 0x3C0C48, "Servergy, Inc." },

17959 { 0x3C0C7D, "Tiny Mesh AS" },

17960 { 0x3C0CDB, "UNION MAN TECHNOLOGY CO.,LTD" },

17961 { 0x3C0D2C, "Liquid-Markets GmbH" },

17962 { 0x3C0E23, "Cisco Systems, Inc" },

17963 { 0x3C0FC1, "KBC Networks" },

17964 { 0x3C1040, "daesung network" },

17965 { 0x3C1060, "Fiberhome Telecommunication Technologies Co.,LTD" },

17966 { 0x3C106F, "ALBAHITH TECHNOLOGIES" },

17967 { 0x3C10E6, "PHAZR Inc." },

17968 { 0x3C11B2, "Fraunhofer FIT" },

17969 { 0x3C135A, "Xiaomi Communications Co Ltd" },

17970 { 0x3C13BB, "HUAWEI TECHNOLOGIES CO.,LTD" },

17971 { 0x3C13CC, "Cisco Systems, Inc" },

17972 { 0x3C1512, "Shenzhen Huanhu Technology Co.,Ltd" },

17973 { 0x3C15C2, "Apple, Inc." },

17974 { 0x3C15EA, "TESCOM CO., LTD." },

17975 { 0x3C15FB, "HUAWEI TECHNOLOGIES CO.,LTD" },

17976 { 0x3C1710, "Sagemcom Broadband SAS" },

17977 { 0x3C189F, "Nokia Corporation" },

17978 { 0x3C18A0, "Luxshare Precision Industry Company Limited" },

17979 { 0x3C1915, "GFI Chrono Time" },

17980 { 0x3C195E, "Samsung Electronics Co.,Ltd" },

17981 { 0x3C197D, "Ericsson AB" },

17982 { 0x3C19CB, "TECNO MOBILE LIMITED" },

17983 { 0x3C1A0F, "ClearSky Data" },

17984 { 0x3C1A57, "Cardiopulmonary Corp" },

17985 { 0x3C1A79, "Huayuan Technology CO.,LTD" },

17986 { 0x3C1A9E, "VitalThings AS" },

17987 { 0x3C1BF8, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

17988 { 0x3C1CBE, "JADAK LLC" },

17989 { 0x3C1E04, "D-Link International" },

17990 { 0x3C1E13, "HANGZHOU SUNRISE TECHNOLOGY CO., LTD" },

17991 { 0x3C1EB5, "Apple, Inc." },

17992 { 0x3C2093, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

17993 { 0x3C20F6, "Samsung Electronics Co.,Ltd" },

17994 { 0x3C219C, "Intel Corporate" },

17995 { 0x3C22FB, "Apple, Inc." },

17996 { 0x3C24F0, "IEEE Registration Authority" },

17997 { 0x3C25D7, "Nokia Corporation" },

17998 { 0x3C25F8, "Dell Inc." },

17999 { 0x3C26D5, "Sotera Wireless" },

18000 { 0x3C26E4, "Cisco Systems, Inc" },

18001 { 0x3C2763, "SLE quality engineering GmbH & Co. KG" },

18002 { 0x3C286D, "Google, Inc." },

18003 { 0x3C28A6, "Alcatel-Lucent Enterprise (China)" },

18004 { 0x3C2AF4, "Brother Industries, LTD." },

18005 { 0x3C2C30, "Dell Inc." },

18006 { 0x3C2C94, "杭州德澜科技有限公司（HangZhou Delan Technology Co.,Ltd）" },

18007 { 0x3C2C99, "Edgecore Networks Corporation" },

18008 { 0x3C2CA6, "Beijing Xiaomi Electronics Co.,Ltd" },

18009 { 0x3C2D9E, "Vantiva - Connected Home" },

18010 { 0x3C2DB7, "Texas Instruments" },

18011 { 0x3C2EF5, "Silicon Laboratories" },

18012 { 0x3C2EF9, "Apple, Inc." },

18013 { 0x3C2EFF, "Apple, Inc." },

18014 { 0x3C2F3A, "SFORZATO Corp." },

18015 { 0x3C300C, "Dewar Electronics Pty Ltd" },

18016 { 0x3C306F, "HUAWEI TECHNOLOGIES CO.,LTD" },

18017 { 0x3C3174, "Google, Inc." },

18018 { 0x3C3178, "Qolsys Inc." },

18019 { 0x3C3300, "Shenzhen Bilian electronic CO.,LTD" },

18020 { 0x3C3332, "D-Link Corporation" },

18021 { 0x3C3556, "Cognitec Systems GmbH" },

18022 { 0x3C363D, "Nokia Corporation" },

18023 { 0x3C366A, "HUAWEI TECHNOLOGIES CO.,LTD" },

18024 { 0x3C36E4, "ARRIS Group, Inc." },

18025 { 0x3C3712, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

18026 { 0x3C3786, "NETGEAR" },

18027 { 0x3C3888, "ConnectQuest, llc" },

18028 { 0x3C38F4, "Sony Corporation" },

18029 { 0x3C39C3, "JW Electronics Co., Ltd." },

18030 { 0x3C39C8, "Apple, Inc." },

18031 { 0x3C39E7, "IEEE Registration Authority" },

18032 { 0x3C3A73, "Avaya Inc" },

18033 { 0x3C3B4D, "Toyo Seisakusho Kaisha, Limited" },

18034 { 0x3C3B99, "ITEL MOBILE LIMITED" },

18035 { 0x3C3F51, "2CRSI" },

18036 { 0x3C404F, "GUANGDONG PISEN ELECTRONICS CO.,LTD" },

18037 { 0x3C410E, "Cisco Systems, Inc" },

18038 { 0x3C427E, "IEEE Registration Authority" },

18039 { 0x3C438E, "ARRIS Group, Inc." },

18040 { 0x3C450B, "Sentry Equipment Corp." },

18041 { 0x3C457A, "SKY UK LIMITED" },

18042 { 0x3C4645, "Shanghai Infinity Wireless Technologies Co.,Ltd." },

18043 { 0x3C46A1, "Ruckus Wireless" },

18044 { 0x3C46D8, "TP-LINK TECHNOLOGIES CO.,LTD." },

18045 { 0x3C4711, "HUAWEI TECHNOLOGIES CO.,LTD" },

18046 { 0x3C479B, "Theissen Training Systems, Inc." },

18047 { 0x3C4937, "ASSMANN Electronic GmbH" },

18048 { 0x3C4A92, "Hewlett Packard" },

18049 { 0x3C4C69, "Infinity System S.L." },

18050 { 0x3C4CD0, "CERAGON NETWORKS" },

18051 { 0x3C4DBE, "Apple, Inc." },

18052 { 0x3C4E47, "Etronic A/S" },

18053 { 0x3C4E56, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

18054 { 0x3C510E, "Cisco Systems, Inc" },

18055 { 0x3C5282, "Hewlett Packard" },

18056 { 0x3C52A1, "TP-Link Corporation Limited" },

18057 { 0x3C53D7, "CEDES AG" },

18058 { 0x3C5447, "HUAWEI TECHNOLOGIES CO.,LTD" },

18059 { 0x3C5576, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

18060 { 0x3C55DB, "Shenzhen Skyworth Digital Technology CO., Ltd" },

18061 { 0x3C5731, "Cisco Systems, Inc" },

18062 { 0x3C574F, "China Mobile Group Device Co.,Ltd." },

18063 { 0x3C576C, "Samsung Electronics Co.,Ltd" },

18064 { 0x3C57BD, "Kessler Crane Inc." },

18065 { 0x3C57D5, "FiveCo" },

18066 { 0x3C585D, "Sagemcom Broadband SAS" },

18067 { 0x3C58C2, "Intel Corporate" },

18068 { 0x3C591E, "TCL King Electrical Appliances (Huizhou) Co., Ltd" },

18069 { 0x3C5A37, "Samsung Electronics Co.,Ltd" },

18070 { 0x3C5AB4, "Google, Inc." },

18071 { 0x3C5CC3, "Shenzhen First Blue Chip Technology Ltd" },

18072 { 0x3C5CC4, "Amazon Technologies Inc." },

18073 { 0x3C5CF1, "eero inc." },

18074 { 0x3C5D29, "Zhejiang Tmall Technology Co., Ltd." },

18075 { 0x3C5EC3, "Cisco Systems, Inc" },

18076 { 0x3C5F01, "Synerchip Co., Ltd." },

18077 { 0x3C6104, "Juniper Networks" },

18078 { 0x3C6105, "Espressif Inc." },

18079 { 0x3C6200, "Samsung Electronics Co.,Ltd" },

18080 { 0x3C6278, "SHENZHEN JETNET TECHNOLOGY CO.,LTD." },

18081 { 0x3C62F0, "Sercomm Corporation." },

18082 { 0x3C6716, "Lily Robotics" },

18083 { 0x3C672C, "Sciovid Inc." },

18084 { 0x3C678C, "HUAWEI TECHNOLOGIES CO.,LTD" },

18085 { 0x3C6816, "VXi Corporation" },

18086 { 0x3C69D1, "ADC Automotive Distance Control System GmbH" },

18087 { 0x3C6A2C, "IEEE Registration Authority" },

18088 { 0x3C6A48, "TP-LINK TECHNOLOGIES CO.,LTD." },

18089 { 0x3C6A7D, "Niigata Power Systems Co., Ltd." },

18090 { 0x3C6A9D, "Dexatek Technology LTD." },

18091 { 0x3C6AA7, "Intel Corporate" },

18092 { 0x3C6D66, "NVIDIA Corporation" },

18093 { 0x3C6D89, "Apple, Inc." },

18094 { 0x3C6E63, "Mitron OY" },

18095 { 0x3C6F45, "Fiberpro Inc." },

18096 { 0x3C6F9B, "zte corporation" },

18097 { 0x3C6FEA, "Panasonic India Pvt. Ltd." },

18098 { 0x3C6FF7, "EnTek Systems, Inc." },

18099 { 0x3C7059, "MakerBot Industries" },

18100 { 0x3C71BF, "Espressif Inc." },

18101 { 0x3C7437, "RIM" },

18102 { 0x3C754A, "ARRIS Group, Inc." },

18103 { 0x3C77E6, "Hon Hai Precision Ind. Co.,Ltd." },

18104 { 0x3C7843, "HUAWEI TECHNOLOGIES CO.,LTD" },

18105 { 0x3C7873, "Airsonics" },

18106 { 0x3C792B, "Dongguan Auklink TechnologyCo.,Ltd" },

18107 { 0x3C7A8A, "ARRIS Group, Inc." },

18108 { 0x3C7AAA, "China Dragon Technology Limited" },

18109 { 0x3C7AC4, "Chemtronics" },

18110 { 0x3C7AF0, "ITEL MOBILE LIMITED" },

18111 { 0x3C7C3F, "ASUSTek COMPUTER INC." },

18112 { 0x3C7D0A, "Apple, Inc." },

18113 { 0x3C7DB1, "Texas Instruments" },

18114 { 0x3C7F6F, "Telechips, Inc." },

18115 { 0x3C806B, "Hunan Voc Acoustics Technology Co., Ltd." },

18116 { 0x3C80AA, "Ransnet Singapore Pte Ltd" },

18117 { 0x3C81D8, "Sagemcom Broadband SAS" },

18118 { 0x3C82C0, "Vantiva USA LLC" },

18119 { 0x3C831E, "CKD Corporation" },

18120 { 0x3C8375, "Microsoft Corporation" },

18121 { 0x3C83B5, "Advance Vision Electronics Co. Ltd." },

18122 { 0x3C8427, "Espressif Inc." },

18123 { 0x3C846A, "TP-LINK TECHNOLOGIES CO.,LTD." },

18124 { 0x3C869A, "HUAWEI TECHNOLOGIES CO.,LTD" },

18125 { 0x3C86A8, "Sangshin elecom .co,, LTD" },

18126 { 0x3C86D1, "vivo Mobile Communication Co., Ltd." },

18127 { 0x3C894D, "Dr. Ing. h.c. F. Porsche AG" },

18128 { 0x3C8970, "Neosfar" },

18129 { 0x3C8994, "SKY UK LIMITED" },

18130 { 0x3C89A6, "KAPELSE" },

18131 { 0x3C8AB0, "Juniper Networks" },

18132 { 0x3C8AE5, "Tensun Information Technology(Hangzhou) Co.,LTD" },

18133 { 0x3C8B7F, "Cisco Systems, Inc" },

18134 { 0x3C8BCD, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

18135 { 0x3C8BFE, "Samsung Electronics Co.,Ltd" },

18136 { 0x3C8C40, "Hangzhou H3C Technologies Co., Limited" },

18137 { 0x3C8C93, "Juniper Networks" },

18138 { 0x3C8CF8, "TRENDnet, Inc." },

18139 { 0x3C8D20, "Google, Inc." },

18140 { 0x3C8F06, "Shenzhen Libtor Technology Co.,Ltd" },

18141 { 0x3C9066, "SmartRG, Inc." },

18142 { 0x3C90E0, "HUAWEI TECHNOLOGIES CO.,LTD" },

18143 { 0x3C912B, "Vexata Inc" },

18144 { 0x3C9157, "Yulong Computer Telecommunication Scientific (Shenzhen) Co.,Ltd" },

18145 { 0x3C9174, "ALONG COMMUNICATION TECHNOLOGY" },

18146 { 0x3C9180, "Liteon Technology Corporation" },

18147 { 0x3C92DC, "Octopod Technology Co. Ltd." },

18148 { 0x3C93F4, "HUAWEI TECHNOLOGIES CO.,LTD" },

18149 { 0x3C94D5, "Juniper Networks" },

18150 { 0x3C9509, "Liteon Technology Corporation" },

18151 { 0x3C970E, "Wistron InfoComm(Kunshan)Co.,Ltd." },

18152 { 0x3C977E, "IPS Technology Limited" },

18153 { 0x3C9872, "Sercomm Corporation." },

18154 { 0x3C98BF, "Quest Controls, Inc." },

18155 { 0x3C998C, "Houwa System Design Corp." },

18156 { 0x3C99F7, "Lansentechnology AB" },

18157 { 0x3C9A77, "Vantiva USA LLC" },

18158 { 0x3C9BC6, "Huawei Device Co., Ltd." },

18159 { 0x3C9BD6, "Vizio, Inc" },

18160 { 0x3C9C0F, "Intel Corporate" },

18161 { 0x3C9D56, "HUAWEI TECHNOLOGIES CO.,LTD" },

18162 { 0x3C9EC7, "SKY UK LIMITED" },

18163 { 0x3C9F81, "Shenzhen CATIC Bit Communications Technology Co.,Ltd" },

18164 { 0x3C9FC3, "Beijing Sinead Technology Co., Ltd." },

18165 { 0x3CA067, "Liteon Technology Corporation" },

18166 { 0x3CA10D, "Samsung Electronics Co.,Ltd" },

18167 { 0x3CA161, "HUAWEI TECHNOLOGIES CO.,LTD" },

18168 { 0x3CA2C3, "vivo Mobile Communication Co., Ltd." },

18169 { 0x3CA308, "Texas Instruments" },

18170 { 0x3CA315, "Bless Information & Communications Co., Ltd" },

18171 { 0x3CA31A, "Oilfind International LLC" },

18172 { 0x3CA348, "vivo Mobile Communication Co., Ltd." },

18173 { 0x3CA37E, "HUAWEI TECHNOLOGIES CO.,LTD" },

18174 { 0x3CA581, "vivo Mobile Communication Co., Ltd." },

18175 { 0x3CA616, "vivo Mobile Communication Co., Ltd." },

18176 { 0x3CA62F, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

18177 { 0x3CA6F6, "Apple, Inc." },

18178 { 0x3CA72B, "MRV Communications (Networks) LTD" },

18179 { 0x3CA7AE, "zte corporation" },

18180 { 0x3CA82A, "Hewlett Packard" },

18181 { 0x3CA8ED, "smart light technology" },

18182 { 0x3CA916, "Huawei Device Co., Ltd." },

18183 { 0x3CA9F4, "Intel Corporate" },

18184 { 0x3CAA3F, "iKey, Ltd." },

18185 { 0x3CAB8E, "Apple, Inc." },

18186 { 0x3CAE69, "ESA Elektroschaltanlagen Grimma GmbH" },

18187 { 0x3CB07E, "Arounds Intelligent Equipment Co., Ltd." },

18188 { 0x3CB0ED, "Nothing Technology Limited" },

18189 { 0x3CB15B, "Avaya Inc" },

18190 { 0x3CB17F, "Wattwatchers Pty Ld" },

18191 { 0x3CB233, "Huawei Device Co., Ltd." },

18192 { 0x3CB43D, "SZ Tenveo video technology co., Ltd" },

18193 { 0x3CB53D, "HUNAN GOKE MICROELECTRONICS CO.,LTD" },

18194 { 0x3CB6B7, "vivo Mobile Communication Co., Ltd." },

18195 { 0x3CB72B, "PLUMgrid Inc" },

18196 { 0x3CB74B, "Vantiva USA LLC" },

18197 { 0x3CB792, "Hitachi Maxell, Ltd., Optronics Division" },

18198 { 0x3CB87A, "Private" },

18199 { 0x3CB8D6, "Bluebank Communication Technology Co.,Ltd." },

18200 { 0x3CB9A6, "Belden Deutschland GmbH" },

18201 { 0x3CBB73, "Shenzhen Xinguodu Technology Co., Ltd." },

18202 { 0x3CBBFD, "Samsung Electronics Co.,Ltd" },

18203 { 0x3CBCD0, "zte corporation" },

18204 { 0x3CBD3E, "Beijing Xiaomi Electronics Co., Ltd." },

18205 { 0x3CBDC5, "Arcadyan Corporation" },

18206 { 0x3CBDD8, "LG ELECTRONICS INC" },

18207 { 0x3CBEE1, "NIKON CORPORATION" },

18208 { 0x3CBF60, "Apple, Inc." },

18209 { 0x3CC03E, "HUAWEI TECHNOLOGIES CO.,LTD" },

18210 { 0x3CC079, "Shenzhen One-Nine Intelligent Electronic Science and Technology Co., Ltd" },

18211 { 0x3CC0C6, "d&b audiotechnik GmbH" },

18212 { 0x3CC12C, "AES Corporation" },

18213 { 0x3CC1F6, "Melange Systems Pvt. Ltd." },

18214 { 0x3CC243, "Nokia Corporation" },

18215 { 0x3CC2E1, "XINHUA CONTROL ENGINEERING CO.,LTD" },

18216 { 0x3CC786, "DONGGUAN HUARONG COMMUNICATION TECHNOLOGIES CO.,LTD." },

18217 { 0x3CC99E, "Huiyang Technology Co., Ltd" },

18218 { 0x3CCA87, "Iders Incorporated" },

18219 { 0x3CCB4D, "Avikus Co., Ltd" },

18220 { 0x3CCB7C, "TCT mobile ltd" },

18221 { 0x3CCD36, "Apple, Inc." },

18222 { 0x3CCD57, "Beijing Xiaomi Mobile Software Co., Ltd" },

18223 { 0x3CCD5A, "Technische Alternative GmbH" },

18224 { 0x3CCD5D, "HUAWEI TECHNOLOGIES CO.,LTD" },

18225 { 0x3CCD73, "Nebula Electronic Technology Corporation" },

18226 { 0x3CCD93, "LG ELECTRONICS INC" },

18227 { 0x3CCE0D, "Shenzhen juduoping Technology Co.,Ltd" },

18228 { 0x3CCE15, "Mercedes-Benz USA, LLC" },

18229 { 0x3CCE73, "Cisco Systems, Inc" },

18230 { 0x3CCF5B, "ICOMM HK LIMITED" },

18231 { 0x3CCFB4, "Telink Semiconductor (Shanghai) Co., Ltd." },

18232 { 0x3CD0F8, "Apple, Inc." },

18233 { 0x3CD16E, "Telepower Communication Co., Ltd" },

18234 { 0x3CD2E5, "New H3C Technologies Co., Ltd" },

18235 { 0x3CD4D6, "WirelessWERX, Inc" },

18236 { 0x3CD7DA, "SK Mtek microelectronics(shenzhen)limited" },

18237 { 0x3CD92B, "Hewlett Packard" },

18238 { 0x3CD9CE, "Eclipse WiFi" },

18239 { 0x3CDA2A, "zte corporation" },

18240 { 0x3CDA6D, "Tiandy Technologies CO.,LTD" },

18241 { 0x3CDCBC, "Samsung Electronics Co.,Ltd" },

18242 { 0x3CDD89, "SOMO HOLDINGS & TECH. CO.,LTD." },

18243 { 0x3CDF1E, "Cisco Systems, Inc" },

18244 { 0x3CDFA9, "ARRIS Group, Inc." },

18245 { 0x3CDFBD, "HUAWEI TECHNOLOGIES CO.,LTD" },

18246 { 0x3CE002, "Texas Instruments" },

18247 { 0x3CE038, "Omnifi Inc." },

18248 { 0x3CE064, "Texas Instruments" },

18249 { 0x3CE072, "Apple, Inc." },

18250 { 0x3CE1A1, "Universal Global Scientific Industrial Co., Ltd." },

18251 { 0x3CE36B, "Zhejiang Dahua Technology Co., Ltd." },

18252 { 0x3CE3E7, "China Mobile Group Device Co.,Ltd." },

18253 { 0x3CE441, "Amazon Technologies Inc." },

18254 { 0x3CE4B0, "Texas Instruments" },

18255 { 0x3CE5A6, "Hangzhou H3C Technologies Co., Limited" },

18256 { 0x3CE5B4, "KIDASEN INDUSTRIA E COMERCIO DE ANTENAS LTDA" },

18257 { 0x3CE624, "LG Display" },

18258 { 0x3CE824, "HUAWEI TECHNOLOGIES CO.,LTD" },

18259 { 0x3CE90E, "Espressif Inc." },

18260 { 0x3CE9F7, "Intel Corporate" },

18261 { 0x3CEA4F, "2Wire Inc" },

18262 { 0x3CEAF9, "JUBIXCOLTD" },

18263 { 0x3CEAFB, "NSE AG" },

18264 { 0x3CECDE, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

18265 { 0x3CECEF, "Super Micro Computer, Inc." },

18266 { 0x3CEF42, "TCT mobile ltd" },

18267 { 0x3CEF8C, "Zhejiang Dahua Technology Co., Ltd." },

18268 { 0x3CF011, "Intel Corporate" },

18269 { 0x3CF392, "Virtualtek. Co. Ltd" },

18270 { 0x3CF4F9, "Moda-InnoChips" },

18271 { 0x3CF52C, "DSPECIALISTS GmbH" },

18272 { 0x3CF591, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

18273 { 0x3CF5CC, "New H3C Technologies Co., Ltd" },

18274 { 0x3CF652, "zte corporation" },

18275 { 0x3CF692, "Huawei Device Co., Ltd." },

18276 { 0x3CF72A, "Nokia Corporation" },

18277 { 0x3CF748, "Shenzhen Linsn Technology Development Co.,Ltd" },

18278 { 0x3CF7A4, "Samsung Electronics Co.,Ltd" },

18279 { 0x3CF7D1, "OMRON Corporation" },

18280 { 0x3CF808, "HUAWEI TECHNOLOGIES CO.,LTD" },

18281 { 0x3CF862, "Intel Corporate" },

18282 { 0x3CF9F0, "zte corporation" },

18283 { 0x3CFA06, "Microsoft Corporation" },

18284 { 0x3CFA30, "Palo Alto Networks" },

18285 { 0x3CFA43, "HUAWEI TECHNOLOGIES CO.,LTD" },

18286 { 0x3CFAD3, "IEEE Registration Authority" },

18287 { 0x3CFB5C, "Fiberhome Telecommunication Technologies Co.,LTD" },

18288 { 0x3CFB96, "Emcraft Systems LLC" },

18289 { 0x3CFDFE, "Intel Corporate" },

18290 { 0x3CFEAC, "Cisco Systems, Inc" },

18291 { 0x3CFFD8, "HUAWEI TECHNOLOGIES CO.,LTD" },

18292 { 0x4000E0, "Derek(Shaoguan)Limited" },

18293 { 0x400107, "Arista Corp" },

18294 { 0x40017A, "Cisco Systems, Inc" },

18295 { 0x4001C6, "3COM EUROPE LTD" },

18296 { 0x40040C, "A&T" },

18297 { 0x400589, "T-Mobile, USA" },

18298 { 0x400634, "Huawei Device Co., Ltd." },

18299 { 0x4006A0, "Texas Instruments" },

18300 { 0x4006D5, "Cisco Systems, Inc" },

18301 { 0x4007C0, "Railtec Systems GmbH" },

18302 { 0x400D10, "ARRIS Group, Inc." },

18303 { 0x400E67, "Tremol Ltd." },

18304 { 0x400E85, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

18305 { 0x400EF3, "zte corporation" },

18306 { 0x400FC1, "Vantiva USA LLC" },

18307 { 0x401175, "IEEE Registration Authority" },

18308 { 0x4011C3, "Samsung Electronics Co.,Ltd" },

18309 { 0x4011DC, "Sonance" },

18310 { 0x4012E4, "Compass-EOS" },

18311 { 0x4013D9, "Global ES" },

18312 { 0x401482, "Cisco Systems, Inc" },

18313 { 0x4014AD, "Huawei Device Co., Ltd." },

18314 { 0x401597, "Protect America, Inc." },

18315 { 0x40163B, "Samsung Electronics Co.,Ltd" },

18316 { 0x40167E, "ASUSTek COMPUTER INC." },

18317 { 0x40169F, "TP-LINK TECHNOLOGIES CO.,LTD." },

18318 { 0x4016FA, "EKM Metering" },

18319 { 0x4017E2, "INTAI TECHNOLOGY CORP." },

18320 { 0x4017F6, "TKH SECURITY,S.L.U." },

18321 { 0x4018B1, "Extreme Networks Headquarters" },

18322 { 0x4018D7, "Smartronix, Inc." },

18323 { 0x401920, "Movon Corporation" },

18324 { 0x401A58, "Wistron Neweb Corporation" },

18325 { 0x401B5F, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

18326 { 0x401C83, "Intel Corporate" },

18327 { 0x401D59, "Biometric Associates, LP" },

18328 { 0x402230, "Shenzhen SuperElectron Technology Co.,Ltd." },

18329 { 0x4022D8, "Espressif Inc." },

18330 { 0x4022ED, "Digital Projection Ltd" },

18331 { 0x402343, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

18332 { 0x4024B2, "Sichuan AI-Link Technology Co., Ltd." },

18333 { 0x4025C2, "Intel Corporate" },

18334 { 0x402619, "Apple, Inc." },

18335 { 0x40270B, "Mobileeco Co., Ltd" },

18336 { 0x402814, "RFI Engineering" },

18337 { 0x402A8F, "Shanghai High-Flying Electronics Technology Co., Ltd" },

18338 { 0x402B50, "ARRIS Group, Inc." },

18339 { 0x402B69, "Kumho Electric Inc." },

18340 { 0x402BA1, "Sony Corporation" },

18341 { 0x402C76, "IEEE Registration Authority" },

18342 { 0x402CF4, "Universal Global Scientific Industrial Co., Ltd." },

18343 { 0x402E28, "MiXTelematics" },

18344 { 0x402E71, "Texas Instruments" },

18345 { 0x402F86, "LG Innotek" },

18346 { 0x403004, "Apple, Inc." },

18347 { 0x403067, "Conlog (Pty) Ltd" },

18348 { 0x40313C, "XIAOMI Electronics,CO.,LTD" },

18349 { 0x40329D, "Union Image Co.,Ltd" },

18350 { 0x403306, "Taicang T&W Electronics" },

18351 { 0x40331A, "Apple, Inc." },

18352 { 0x40336C, "Godrej & Boyce Mfg. co. ltd" },

18353 { 0x4035E6, "Samsung Electronics Co.,Ltd" },

18354 { 0x403668, "E&B TELECOM" },

18355 { 0x4037AD, "Macro Image Technology, Inc." },

18356 { 0x403B7B, "Huawei Device Co., Ltd." },

18357 { 0x403CFC, "Apple, Inc." },

18358 { 0x403DEC, "HUMAX Co., Ltd." },

18359 { 0x403F8C, "TP-LINK TECHNOLOGIES CO.,LTD." },

18360 { 0x404022, "ZIV" },

18361 { 0x404028, "ZIV" },

18362 { 0x40406B, "Icomera" },

18363 { 0x40406C, "Icomera" },

18364 { 0x4040A7, "Sony Corporation" },

18365 { 0x404101, "Rockwell Automation" },

18366 { 0x40410D, "HUAWEI TECHNOLOGIES CO.,LTD" },

18367 { 0x404229, "Layer3TV, Inc" },

18368 { 0x404244, "Cisco Systems, Inc" },

18369 { 0x4044FD, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

18370 { 0x4045C4, "HUAWEI TECHNOLOGIES CO.,LTD" },

18371 { 0x4045DA, "Spreadtrum Communications (Shanghai) Co., Ltd." },

18372 { 0x40475E, "eero inc." },

18373 { 0x40476A, "Astro Gaming" },

18374 { 0x4048FD, "IEEE Registration Authority" },

18375 { 0x40490F, "Hon Hai Precision Ind. Co.,Ltd." },

18376 { 0x40498A, "Synapticon GmbH" },

18377 { 0x404A03, "Zyxel Communications Corporation" },

18378 { 0x404A18, "Addrek Smart Solutions" },

18379 { 0x404AD4, "Widex A/S" },

18380 { 0x404C77, "ARRIS Group, Inc." },

18381 { 0x404CCA, "Espressif Inc." },

18382 { 0x404D7F, "Apple, Inc." },

18383 { 0x404D8E, "HUAWEI TECHNOLOGIES CO.,LTD" },

18384 { 0x404E36, "HTC Corporation" },

18385 { 0x404EEB, "Higher Way Electronic Co., Ltd." },

18386 { 0x404F42, "HUAWEI TECHNOLOGIES CO.,LTD" },

18387 { 0x4050B5, "Shenzhen New Species Technology Co., Ltd." },

18388 { 0x4050E0, "Milton Security Group LLC" },

18389 { 0x40516C, "Grandex International Corporation" },

18390 { 0x40520D, "Pico Technology" },

18391 { 0x4054E4, "Wearsafe Labs Inc" },

18392 { 0x405539, "Cisco Systems, Inc" },

18393 { 0x405582, "Nokia" },

18394 { 0x40560C, "In Home Displays Ltd" },

18395 { 0x40562D, "Smartron India Pvt ltd" },

18396 { 0x405662, "GuoTengShengHua Electronics LTD." },

18397 { 0x405899, "Logitech Far East" },

18398 { 0x405A9B, "ANOVO" },

18399 { 0x405BD8, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

18400 { 0x405CFD, "Dell Inc." },

18401 { 0x405D82, "NETGEAR" },

18402 { 0x405EE1, "Shenzhen H&T Intelligent Control Co.,Ltd." },

18403 { 0x405EF6, "Samsung Electronics Co.,Ltd" },

18404 { 0x405F7D, "TCT mobile ltd" },

18405 { 0x405FBE, "RIM" },

18406 { 0x405FC2, "Texas Instruments" },

18407 { 0x40605A, "Hawkeye Tech Co. Ltd" },

18408 { 0x406186, "MICRO-STAR INT'L CO.,LTD" },

18409 { 0x40618E, "Stella-Green Co" },

18410 { 0x406231, "GIFA" },

18411 { 0x406234, "Telink Semiconductor (Shanghai) Co., Ltd." },

18412 { 0x4062B6, "Tele system communication" },

18413 { 0x4062EA, "China Mobile Group Device Co.,Ltd." },

18414 { 0x4064A4, "THE FURUKAWA ELECTRIC CO., LTD" },

18415 { 0x4064DC, "X-speed lnformation Technology Co.,Ltd" },

18416 { 0x4065A3, "Sagemcom Broadband SAS" },

18417 { 0x40667A, "mediola - connected living AG" },

18418 { 0x40679B, "Shenzhen Skyworth Digital Technology CO., Ltd" },

18419 { 0x406826, "Thales UK Limited" },

18420 { 0x406A8E, "Hangzhou Puwell OE Tech Ltd." },

18421 { 0x406AAB, "RIM" },

18422 { 0x406C8F, "Apple, Inc." },

18423 { 0x406F27, "HUAWEI TECHNOLOGIES CO.,LTD" },

18424 { 0x406F2A, "BlackBerry RTS" },

18425 { 0x407009, "ARRIS Group, Inc." },

18426 { 0x40704A, "Power Idea Technology Limited" },

18427 { 0x407074, "Life Technology (China) Co., Ltd" },

18428 { 0x4070F5, "Apple, Inc." },

18429 { 0x407183, "Juniper Networks" },

18430 { 0x407218, "Tonly Technology Co. Ltd" },

18431 { 0x407496, "aFUN TECHNOLOGY INC." },

18432 { 0x4074E0, "Intel Corporate" },

18433 { 0x4075C3, "Vantiva USA LLC" },

18434 { 0x4076A9, "Huawei Device Co., Ltd." },

18435 { 0x4077A9, "New H3C Technologies Co., Ltd" },

18436 { 0x40786A, "Motorola Mobility LLC, a Lenovo Company" },

18437 { 0x407875, "IMBEL - Industria de Material Belico do Brasil" },

18438 { 0x407912, "Texas Instruments" },

18439 { 0x407A80, "Nokia Corporation" },

18440 { 0x407B1B, "Mettle Networks Inc." },

18441 { 0x407C7D, "Nokia" },

18442 { 0x407D0F, "HUAWEI TECHNOLOGIES CO.,LTD" },

18443 { 0x407F5F, "Juniper Networks" },

18444 { 0x407FE0, "Glory Star Technics (ShenZhen) Limited" },

18445 { 0x4080E1, "FN-LINK TECHNOLOGY Ltd." },

18446 { 0x408256, "Continental Automotive GmbH" },

18447 { 0x40831D, "Apple, Inc." },

18448 { 0x4083DE, "Zebra Technologies Inc" },

18449 { 0x408432, "Microchip Technology Inc." },

18450 { 0x408493, "Clavister AB" },

18451 { 0x40862E, "JDM MOBILE INTERNET SOLUTION CO., LTD." },

18452 { 0x4086CB, "D-Link Corporation" },

18453 { 0x408805, "Motorola Mobility LLC, a Lenovo Company" },

18454 { 0x40882F, "Extreme Networks Headquarters" },

18455 { 0x4088E0, "Beijing Ereneben Information Technology Limited Shenzhen Branch" },

18456 { 0x4089A8, "WiredIQ, LLC" },

18457 { 0x408A9A, "TITENG CO., Ltd." },

18458 { 0x408B07, "Actiontec Electronics, Inc" },

18459 { 0x408BF6, "Shenzhen TCL New Technology Co., Ltd" },

18460 { 0x408C1F, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

18461 { 0x408C4C, "Shenzhen MiaoMing Intelligent Technology Co.,Ltd" },

18462 { 0x408D5C, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

18463 { 0x408E2C, "Microsoft Corporation" },

18464 { 0x408EDF, "Huawei Device Co., Ltd." },

18465 { 0x408EF6, "Infinix mobility limited" },

18466 { 0x408F9D, "Juniper Networks" },

18467 { 0x409151, "Espressif Inc." },

18468 { 0x40921A, "Apple, Inc." },

18469 { 0x409505, "ACOINFO TECHNOLOGY CO.,LTD" },

18470 { 0x409558, "Aisino Corporation" },

18471 { 0x4095BD, "NTmore.Co.,Ltd" },

18472 { 0x4097D1, "BK Electronics cc" },

18473 { 0x40984C, "Casacom Solutions AG" },

18474 { 0x40984E, "Texas Instruments" },

18475 { 0x40987B, "Aisino Corporation" },

18476 { 0x4098AD, "Apple, Inc." },

18477 { 0x409922, "AzureWave Technology Inc." },

18478 { 0x4099E3, "Guangzhou Mudi Information Technology Co., Ltd" },

18479 { 0x409A30, "TECNO MOBILE LIMITED" },

18480 { 0x409B0D, "Shenzhen Yourf Kwan Industrial Co., Ltd" },

18481 { 0x409B21, "Nokia" },

18482 { 0x409BCD, "D-Link International" },

18483 { 0x409C28, "Apple, Inc." },

18484 { 0x409CA6, "Curvalux" },

18485 { 0x409CA7, "CHINA DRAGON TECHNOLOGY LIMITED" },

18486 { 0x409EA4, "Juniper Networks" },

18487 { 0x409F38, "AzureWave Technology Inc." },

18488 { 0x409F87, "Jide Technology (Hong Kong) Limited" },

18489 { 0x409FC7, "BAEKCHUN I&C Co., Ltd." },

18490 { 0x40A108, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

18491 { 0x40A2DB, "Amazon Technologies Inc." },

18492 { 0x40A3CC, "Intel Corporate" },

18493 { 0x40A53B, "Nokia" },

18494 { 0x40A5EF, "Shenzhen Four Seas Global Link Network Technology Co., Ltd." },

18495 { 0x40A63D, "SignalFire Telemetry" },

18496 { 0x40A677, "Juniper Networks" },

18497 { 0x40A6A4, "PassivSystems Ltd" },

18498 { 0x40A6B7, "Intel Corporate" },

18499 { 0x40A6D9, "Apple, Inc." },

18500 { 0x40A6E8, "Cisco Systems, Inc" },

18501 { 0x40A8F0, "Hewlett Packard" },

18502 { 0x40A93F, "Pivotal Commware, Inc." },

18503 { 0x40A9CF, "Amazon Technologies Inc." },

18504 { 0x40AA56, "China Dragon Technology Limited" },

18505 { 0x40AC8D, "Data Management, Inc." },

18506 { 0x40ACBF, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

18507 { 0x40AE30, "TP-LINK CORPORATION PTE. LTD." },

18508 { 0x40B02F, "Miele & Cie. KG" },

18509 { 0x40B034, "Hewlett Packard" },

18510 { 0x40B076, "ASUSTek COMPUTER INC." },

18511 { 0x40B0A1, "VALCOM CO.,LTD." },

18512 { 0x40B0FA, "LG Electronics (Mobile Communications)" },

18513 { 0x40B15C, "HUAWEI TECHNOLOGIES CO.,LTD" },

18514 { 0x40B2C8, "Nortel Networks" },

18515 { 0x40B30E, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

18516 { 0x40B31E, "Universal Electronics, Inc." },

18517 { 0x40B395, "Apple, Inc." },

18518 { 0x40B3CD, "Chiyoda Electronics Co.,Ltd." },

18519 { 0x40B3FC, "Logital Co. Limited" },

18520 { 0x40B4CD, "Amazon Technologies Inc." },

18521 { 0x40B4F0, "Juniper Networks" },

18522 { 0x40B5C1, "Cisco Systems, Inc" },

18523 { 0x40B607, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

18524 { 0x40B688, "LEGIC Identsystems AG" },

18525 { 0x40B6B1, "SUNGSAM CO,.Ltd" },

18526 { 0x40B6E7, "Huawei Device Co., Ltd." },

18527 { 0x40B70E, "Huawei Device Co., Ltd." },

18528 { 0x40B7F3, "ARRIS Group, Inc." },

18529 { 0x40B7FC, "Phyplus Microelectronics Limited" },

18530 { 0x40B82D, "Ruckus Wireless" },

18531 { 0x40B837, "Sony Corporation" },

18532 { 0x40B89A, "Hon Hai Precision Ind. Co.,Ltd." },

18533 { 0x40B8C2, "OSMOZIS" },

18534 { 0x40B93C, "Hewlett Packard Enterprise" },

18535 { 0x40BA61, "ARIMA Communications Corp." },

18536 { 0x40BC60, "Apple, Inc." },

18537 { 0x40BC68, "Wuhan Funshion Online Technologies Co.,Ltd" },

18538 { 0x40BC73, "Cronoplast S.L." },

18539 { 0x40BC8B, "itelio GmbH" },

18540 { 0x40BD32, "Texas Instruments" },

18541 { 0x40BD9E, "Physio-Control, Inc" },

18542 { 0x40BEEE, "Shenzhen Yunding Information Technology Co.,Ltd" },

18543 { 0x40BF17, "Digistar Telecom. SA" },

18544 { 0x40C0EE, "365mesh Pty Ltd" },

18545 { 0x40C1F6, "Shenzhen Jingxun Technology Co., Ltd." },

18546 { 0x40C245, "Shenzhen Hexicom Technology Co., Ltd." },

18547 { 0x40C2BA, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

18548 { 0x40C3BC, "Huawei Device Co., Ltd." },

18549 { 0x40C3C6, "SnapRoute" },

18550 { 0x40C48C, "N-iTUS CO.,LTD." },

18551 { 0x40C4D6, "ChongQing Camyu Technology Development Co.,Ltd." },

18552 { 0x40C62A, "Shanghai Jing Ren Electronic Technology Co., Ltd." },

18553 { 0x40C711, "Apple, Inc." },

18554 { 0x40C729, "Sagemcom Broadband SAS" },

18555 { 0x40C7C9, "Naviit Inc." },

18556 { 0x40C81F, "Shenzhen Xinguodu Technology Co., Ltd." },

18557 { 0x40C8CB, "AM Telecom co., Ltd." },

18558 { 0x40CA63, "Seongji Industry Company" },

18559 { 0x40CBA8, "HUAWEI TECHNOLOGIES CO.,LTD" },

18560 { 0x40CBC0, "Apple, Inc." },

18561 { 0x40CD3A, "Z3 Technology" },

18562 { 0x40CD7A, "Qingdao Hisense Communications Co.,Ltd." },

18563 { 0x40CE24, "Cisco Systems, Inc" },

18564 { 0x40D25F, "ITEL MOBILE LIMITED" },

18565 { 0x40D28A, "Nintendo Co., Ltd." },

18566 { 0x40D32D, "Apple, Inc." },

18567 { 0x40D357, "Ison Technology Co., Ltd." },

18568 { 0x40D3AE, "Samsung Electronics Co.,Ltd" },

18569 { 0x40D40E, "Biodata Ltd" },

18570 { 0x40D4BD, "SK Networks Service CO., LTD." },

18571 { 0x40D4F6, "Honor Device Co., Ltd." },

18572 { 0x40D559, "MICRO S.E.R.I." },

18573 { 0x40D563, "HANA Electronics" },

18574 { 0x40D63C, "Equitech Industrial(DongGuan)Co.,Ltd" },

18575 { 0x40D855, "IEEE Registration Authority" },

18576 { 0x40D95A, "AMPAK Technology,Inc." },

18577 { 0x40DC9D, "HAJEN" },

18578 { 0x40DCA5, "Huawei Device Co., Ltd." },

18579 { 0x40DDD1, "Beautiful Card Corporation" },

18580 { 0x40DE17, "Shenzhen Lanfeng Times Industrial Co.,Ltd." },

18581 { 0x40DEAD, "Juniper Networks" },

18582 { 0x40DF02, "LINE BIZ Plus" },

18583 { 0x40E11C, "shenzhen Cloud High Communication Technology Co.,Ltd" },

18584 { 0x40E171, "Jiangsu Huitong Group Co.,Ltd." },

18585 { 0x40E1E4, "Nokia Solutions and Networks GmbH & Co. KG" },

18586 { 0x40E230, "AzureWave Technology Inc." },

18587 { 0x40E317, "Extreme Networks Headquarters" },

18588 { 0x40E3D6, "Aruba, a Hewlett Packard Enterprise Company" },

18589 { 0x40E64B, "Apple, Inc." },

18590 { 0x40E730, "DEY Storage Systems, Inc." },

18591 { 0x40E793, "Shenzhen Siviton Technology Co.,Ltd" },

18592 { 0x40E99B, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

18593 { 0x40EACE, "FOUNDER BROADBAND NETWORK SERVICE CO.,LTD" },

18594 { 0x40EC99, "Intel Corporate" },

18595 { 0x40ECF8, "Siemens AG" },

18596 { 0x40ED00, "TP-Link Corporation Limited" },

18597 { 0x40ED98, "IEEE Registration Authority" },

18598 { 0x40EDCF, "Apple, Inc." },

18599 { 0x40EE15, "Zioncom Electronics (Shenzhen) Ltd." },

18600 { 0x40EEDD, "HUAWEI TECHNOLOGIES CO.,LTD" },

18601 { 0x40EF4C, "Fihonest communication co.,Ltd" },

18602 { 0x40F02F, "Liteon Technology Corporation" },

18603 { 0x40F04E, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

18604 { 0x40F078, "Cisco Systems, Inc" },

18605 { 0x40F14C, "ISE Europe SPRL" },

18606 { 0x40F201, "Sagemcom Broadband SAS" },

18607 { 0x40F21C, "DZS Inc." },

18608 { 0x40F2E9, "IBM" },

18609 { 0x40F308, "Murata Manufacturing Co., Ltd." },

18610 { 0x40F385, "IEEE Registration Authority" },

18611 { 0x40F3B0, "Texas Instruments" },

18612 { 0x40F407, "Nintendo Co., Ltd." },

18613 { 0x40F413, "Rubezh" },

18614 { 0x40F420, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

18615 { 0x40F4EC, "Cisco Systems, Inc" },

18616 { 0x40F4FD, "UNION MAN TECHNOLOGY CO.,LTD" },

18617 { 0x40F520, "Espressif Inc." },

18618 { 0x40F52E, "Leica Microsystems (Schweiz) AG" },

18619 { 0x40F6BC, "Amazon Technologies Inc." },

18620 { 0x40F8DF, "CANON INC." },

18621 { 0x40F946, "Apple, Inc." },

18622 { 0x40F9D5, "Tecore Networks" },

18623 { 0x40FA7F, "Preh Car Connect GmbH" },

18624 { 0x40FAFE, "Motorola Mobility LLC, a Lenovo Company" },

18625 { 0x40FC89, "ARRIS Group, Inc." },

18626 { 0x40FDF3, "AMPAK Technology,Inc." },

18627 { 0x40FE0D, "MAXIO" },

18628 { 0x40FE95, "New H3C Technologies Co., Ltd" },

18629 { 0x40FF40, "GloquadTech" },

18630 { 0x440010, "Apple, Inc." },

18631 { 0x440049, "Amazon Technologies Inc." },

18632 { 0x44004D, "HUAWEI TECHNOLOGIES CO.,LTD" },

18633 { 0x4401BB, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

18634 { 0x44032C, "Intel Corporate" },

18635 { 0x440377, "IEEE Registration Authority" },

18636 { 0x4403A7, "Cisco Systems, Inc" },

18637 { 0x440444, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

18638 { 0x44053F, "Sagemcom Broadband SAS" },

18639 { 0x4405E8, "twareLAB" },

18640 { 0x44070B, "Google, Inc." },

18641 { 0x4409B8, "Salcomp (Shenzhen) CO., LTD." },

18642 { 0x440CEE, "Robert Bosch Elektronikai Kft." },

18643 { 0x440CFD, "NetMan Co., Ltd." },

18644 { 0x4410FE, "Huizhou Foryou General Electronics Co., Ltd." },

18645 { 0x441102, "EDMI Europe Ltd" },

18646 { 0x4411C2, "Telegartner Karl Gartner GmbH" },

18647 { 0x441244, "Aruba, a Hewlett Packard Enterprise Company" },

18648 { 0x441319, "WKK TECHNOLOGY LTD." },

18649 { 0x4413D0, "zte corporation" },

18650 { 0x441441, "AudioControl Inc." },

18651 { 0x441622, "Microsoft Corporation" },

18652 { 0x4416FA, "Samsung Electronics Co.,Ltd" },

18653 { 0x441793, "Espressif Inc." },

18654 { 0x441847, "HUNAN SCROWN ELECTRONIC INFORMATION TECH.CO.,LTD" },

18655 { 0x44184F, "Fitview" },

18656 { 0x4418FD, "Apple, Inc." },

18657 { 0x4419B6, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

18658 { 0x441A4C, "xFusion Digital Technologies Co.,Ltd." },

18659 { 0x441A84, "Quectel Wireless Solutions Co.,Ltd." },

18660 { 0x441AAC, "Elektrik Uretim AS EOS" },

18661 { 0x441AFA, "New H3C Technologies Co., Ltd" },

18662 { 0x441B88, "Apple, Inc." },

18663 { 0x441C12, "Vantiva USA LLC" },

18664 { 0x441C7F, "Motorola Mobility LLC, a Lenovo Company" },

18665 { 0x441CA8, "Hon Hai Precision Ind. Co.,Ltd." },

18666 { 0x441DB1, "APTIV SERVICES US, LLC" },

18667 { 0x441E91, "ARVIDA Intelligent Electronics Technology Co.,Ltd." },

18668 { 0x441E98, "Ruckus Wireless" },

18669 { 0x441EA1, "Hewlett Packard" },

18670 { 0x442063, "Continental Automotive Technologies GmbH" },

18671 { 0x44227C, "HUAWEI TECHNOLOGIES CO.,LTD" },

18672 { 0x442295, "China Mobile Iot Limited company" },

18673 { 0x4422F1, "S.FAC, INC" },

18674 { 0x44237C, "Beijing Xiaomi Mobile Software Co., Ltd" },

18675 { 0x4423AA, "Farmage Co., Ltd." },

18676 { 0x4425BB, "Bamboo Entertainment Corporation" },

18677 { 0x44272E, "Huawei Device Co., Ltd." },

18678 { 0x4427F3, "70mai Co.,Ltd." },

18679 { 0x4428A3, "Jiangsu fulian Communication Technology Co., Ltd." },

18680 { 0x44291E, "AltoBeam (China) Inc." },

18681 { 0x442938, "NietZsche enterprise Co.Ltd." },

18682 { 0x442A60, "Apple, Inc." },

18683 { 0x442AFF, "E3 Technology, Inc." },

18684 { 0x442B03, "Cisco Systems, Inc" },

18685 { 0x442C05, "AMPAK Technology, Inc." },

18686 { 0x44303F, "HUAWEI TECHNOLOGIES CO.,LTD" },

18687 { 0x443192, "Hewlett Packard" },

18688 { 0x44322A, "Avaya Inc" },

18689 { 0x443262, "zte corporation" },

18690 { 0x4432C2, "GOAL Co., Ltd." },

18691 { 0x4432C8, "Vantiva USA LLC" },

18692 { 0x44334C, "Shenzhen Bilian electronic CO.,LTD" },

18693 { 0x44348F, "MXT INDUSTRIAL LTDA" },

18694 { 0x4434A7, "ARRIS Group, Inc." },

18695 { 0x44356F, "Neterix Ltd" },

18696 { 0x443583, "Apple, Inc." },

18697 { 0x4435D3, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

18698 { 0x44365D, "Shenzhen HippStor Technology Co., Ltd" },

18699 { 0x443708, "MRV Comunications" },

18700 { 0x443719, "2 Save Energy Ltd" },

18701 { 0x44376F, "Young Electric Sign Co" },

18702 { 0x4437E6, "Hon Hai Precision Ind. Co.,Ltd." },

18703 { 0x443839, "Cumulus Networks, inc" },

18704 { 0x4439C4, "Universal Global Scientific Industrial Co., Ltd." },

18705 { 0x443B32, "Intelbras" },

18706 { 0x443C88, "FICOSA MAROC INTERNATIONAL" },

18707 { 0x443C9C, "Pintsch GmbH" },

18708 { 0x443D21, "Nuvolt" },

18709 { 0x443D54, "Amazon Technologies Inc." },

18710 { 0x443E07, "Electrolux" },

18711 { 0x443EB2, "DEOTRON Co., LTD." },

18712 { 0x4441F0, "zte corporation" },

18713 { 0x444201, "Amazon Technologies Inc." },

18714 { 0x44422F, "TESTOP CO.,LTD." },

18715 { 0x444450, "OttoQ" },

18716 { 0x44456F, "SHENZHEN ONEGA TECHNOLOGY CO.,LTD" },

18717 { 0x444687, "Realme Chongqing MobileTelecommunications Corp Ltd" },

18718 { 0x4447CC, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

18719 { 0x444891, "HDMI Licensing, LLC" },

18720 { 0x4448B9, "MitraStar Technology Corp." },

18721 { 0x4448C1, "Hewlett Packard Enterprise" },

18722 { 0x4448FF, "Qingdao Haier Technology Co.,Ltd" },

18723 { 0x444988, "Intel Corporate" },

18724 { 0x444A65, "Silverflare Ltd." },

18725 { 0x444AB0, "Zhejiang Moorgen Intelligence Technology Co., Ltd" },

18726 { 0x444AD6, "Shenzhen Rinocloud Technology Co.,Ltd." },

18727 { 0x444ADB, "Apple, Inc." },

18728 { 0x444B5D, "GE Healthcare" },

18729 { 0x444B7E, "Fiberhome Telecommunication Technologies Co.,LTD" },

18730 { 0x444C0C, "Apple, Inc." },

18731 { 0x444CA8, "Arista Networks" },

18732 { 0x444E1A, "Samsung Electronics Co.,Ltd" },

18733 { 0x444E6D, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

18734 { 0x444F5E, "Pan Studios Co.,Ltd." },

18735 { 0x444F8E, "WiZ" },

18736 { 0x4451DB, "Raytheon BBN Technologies" },

18737 { 0x4454C0, "Thompson Aerospace" },

18738 { 0x4455B1, "HUAWEI TECHNOLOGIES CO.,LTD" },

18739 { 0x4455C4, "Huawei Device Co., Ltd." },

18740 { 0x44568D, "PNC Technologies Co., Ltd." },

18741 { 0x4456B7, "Spawn Labs, Inc" },

18742 { 0x4456E2, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

18743 { 0x445829, "Cisco SPVTG" },

18744 { 0x445925, "Square Inc." },

18745 { 0x445943, "zte corporation" },

18746 { 0x44599F, "Criticare Systems, Inc" },

18747 { 0x4459E3, "HUAWEI TECHNOLOGIES CO.,LTD" },

18748 { 0x445ADF, "MIKAMI & CO., LTD." },

18749 { 0x445BED, "Aruba, a Hewlett Packard Enterprise Company" },

18750 { 0x445CE9, "Samsung Electronics Co.,Ltd" },

18751 { 0x445D5E, "SHENZHEN Coolkit Technology CO.,LTD" },

18752 { 0x445ECD, "Razer Inc" },

18753 { 0x445EF3, "Tonalite Holding B.V." },

18754 { 0x445F7A, "Shihlin Electric & Engineering Corp." },

18755 { 0x445F8C, "Intercel Group Limited" },

18756 { 0x446132, "ecobee inc" },

18757 { 0x44619C, "FONsystem co. ltd." },

18758 { 0x446246, "Comat AG" },

18759 { 0x446370, "LCFC(HeFei) Electronics Technology co., ltd" },

18760 { 0x44643C, "Cisco Systems, Inc" },

18761 { 0x44650D, "Amazon Technologies Inc." },

18762 { 0x44656A, "Mega Video Electronic(HK) Industry Co., Ltd" },

18763 { 0x44657F, "Calix Inc." },

18764 { 0x44666E, "IP-LINE" },

18765 { 0x4466FC, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

18766 { 0x446747, "HUAWEI TECHNOLOGIES CO.,LTD" },

18767 { 0x446752, "Wistron INFOCOMM (Zhongshan) CORPORATION" },

18768 { 0x446755, "Orbit Irrigation" },

18769 { 0x44680C, "Wacom Co.,Ltd." },

18770 { 0x4468AB, "JUIN COMPANY, LIMITED" },

18771 { 0x446A2E, "HUAWEI TECHNOLOGIES CO.,LTD" },

18772 { 0x446AB7, "ARRIS Group, Inc." },

18773 { 0x446B1F, "Texas Instruments" },

18774 { 0x446C24, "Reallin Electronic Co.,Ltd" },

18775 { 0x446D05, "NoTraffic" },

18776 { 0x446D57, "Liteon Technology Corporation" },

18777 { 0x446D6C, "Samsung Electronics Co.,Ltd" },

18778 { 0x446D7F, "Amazon Technologies Inc." },

18779 { 0x446EE5, "HUAWEI TECHNOLOGIES CO.,LTD" },

18780 { 0x446FD8, "IEEE Registration Authority" },

18781 { 0x446FF8, "Dyson Limited" },

18782 { 0x44700B, "IFFU" },

18783 { 0x447098, "MING HONG TECHNOLOGY (SHEN ZHEN) LIMITED" },

18784 { 0x447147, "Beijing Xiaomi Electronics Co.,Ltd" },

18785 { 0x4473D6, "Logitech" },

18786 { 0x44746C, "Sony Corporation" },

18787 { 0x447654, "HUAWEI TECHNOLOGIES CO.,LTD" },

18788 { 0x44783E, "Samsung Electronics Co.,Ltd" },

18789 { 0x447BBB, "Shenzhen YOUHUA Technology Co., Ltd" },

18790 { 0x447BC4, "DualShine Technology(SZ)Co.,Ltd" },

18791 { 0x447C7F, "Innolight Technology Corporation" },

18792 { 0x447DA5, "VTION INFORMATION TECHNOLOGY (FUJIAN) CO.,LTD" },

18793 { 0x447E76, "Trek Technology (S) Pte Ltd" },

18794 { 0x447E95, "Alpha and Omega, Inc" },

18795 { 0x447F77, "Connected Home" },

18796 { 0x4480EB, "Motorola Mobility LLC, a Lenovo Company" },

18797 { 0x4482E5, "HUAWEI TECHNOLOGIES CO.,LTD" },

18798 { 0x448312, "Star-Net" },

18799 { 0x448500, "Intel Corporate" },

18800 { 0x448502, "Shenzhen SuperElectron Technology Co.,Ltd." },

18801 { 0x4486C1, "Siemens Low Voltage & Products" },

18802 { 0x448723, "HOYA SERVICE CORPORATION" },

18803 { 0x4487DB, "Tymphany Acoustic Technology (Huizhou) Co., Ltd." },

18804 { 0x4487FC, "Elitegroup Computer Systems Co.,Ltd." },

18805 { 0x448816, "Cisco Systems, Inc" },

18806 { 0x4488CB, "Camco Technologies NV" },

18807 { 0x448A5B, "Micro-Star INT'L CO., LTD." },

18808 { 0x448C00, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

18809 { 0x448C52, "KTIS CO., Ltd" },

18810 { 0x448CAB, "Beijing Flitlink Vientiane Technology Co., LTD" },

18811 { 0x448DBF, "Rhino Mobility LLC" },

18812 { 0x448E12, "DT Research, Inc." },

18813 { 0x448E81, "VIG" },

18814 { 0x448EEC, "China Mobile Group Device Co.,Ltd." },

18815 { 0x448F17, "Samsung Electronics Co., Ltd. ARTIK" },

18816 { 0x4490BB, "Apple, Inc." },

18817 { 0x449160, "Murata Manufacturing Co., Ltd." },

18818 { 0x44917C, "HMD Global Oy" },

18819 { 0x4491DB, "Shanghai Huaqin Telecom Technology Co.,Ltd" },

18820 { 0x4494FC, "NETGEAR" },

18821 { 0x44953B, "RLTech India Private Limited" },

18822 { 0x4495FA, "Qingdao Santong Digital Technology Co.Ltd" },

18823 { 0x44962B, "Aidon Oy" },

18824 { 0x44975A, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

18825 { 0x449B78, "The Now Factory" },

18826 { 0x449BC1, "HUAWEI TECHNOLOGIES CO.,LTD" },

18827 { 0x449CB5, "Alcomp, Inc" },

18828 { 0x449EF9, "vivo Mobile Communication Co., Ltd." },

18829 { 0x449F46, "Huawei Device Co., Ltd." },

18830 { 0x449F7F, "DataCore Software Corporation" },

18831 { 0x44A038, "Huawei Device Co., Ltd." },

18832 { 0x44A191, "HUAWEI TECHNOLOGIES CO.,LTD" },

18833 { 0x44A3C7, "zte corporation" },

18834 { 0x44A42D, "TCT mobile ltd" },

18835 { 0x44A466, "GROUPE LDLC" },

18836 { 0x44A54E, "Qorvo International Pte. Ltd." },

18837 { 0x44A56E, "NETGEAR" },

18838 { 0x44A61E, "INGRAM MICRO SERVICES" },

18839 { 0x44A642, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

18840 { 0x44A689, "PROMAX ELECTRONICA SA" },

18841 { 0x44A6E5, "THINKING TECHNOLOGY CO.,LTD" },

18842 { 0x44A7CF, "Murata Manufacturing Co., Ltd." },

18843 { 0x44A842, "Dell Inc." },

18844 { 0x44A8C2, "SEWOO TECH CO., LTD" },

18845 { 0x44A8FC, "Apple, Inc." },

18846 { 0x44A92C, "IEEE Registration Authority" },

18847 { 0x44AA27, "udworks Co., Ltd." },

18848 { 0x44AA50, "Juniper Networks" },

18849 { 0x44AAE8, "Nanotec Electronic GmbH & Co. KG" },

18850 { 0x44AAF5, "ARRIS Group, Inc." },

18851 { 0x44AD19, "XINGFEI （H.K）LIMITED" },

18852 { 0x44ADB1, "Sagemcom Broadband SAS" },

18853 { 0x44ADD9, "Cisco Systems, Inc" },

18854 { 0x44AE25, "Cisco Systems, Inc" },

18855 { 0x44AE44, "Huawei Device Co., Ltd." },

18856 { 0x44AEAB, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

18857 { 0x44AF28, "Intel Corporate" },

18858 { 0x44B295, "Sichuan AI-Link Technology Co., Ltd." },

18859 { 0x44B32D, "TP-LINK TECHNOLOGIES CO.,LTD." },

18860 { 0x44B382, "Kuang-chi Institute of Advanced Technology" },

18861 { 0x44B412, "SIUS AG" },

18862 { 0x44B433, "tide.co.,ltd" },

18863 { 0x44B462, "Flextronics Tech.(Ind) Pvt Ltd" },

18864 { 0x44B4B2, "Amazon Technologies Inc." },

18865 { 0x44B59C, "Tenet Networks Private Limited" },

18866 { 0x44B6BE, "Cisco Systems, Inc" },

18867 { 0x44B7D0, "Microchip Technology Inc." },

18868 { 0x44B994, "Douglas Lighting Controls" },

18869 { 0x44BA46, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

18870 { 0x44BB3B, "Google, Inc." },

18871 { 0x44BDDE, "BHTC GmbH" },

18872 { 0x44BFE3, "Shenzhen Longtech Electronics Co.,Ltd" },

18873 { 0x44C15C, "Texas Instruments" },

18874 { 0x44C233, "Guangzhou Comet Technology Development Co.Ltd" },

18875 { 0x44C306, "SIFROM Inc." },

18876 { 0x44C346, "HUAWEI TECHNOLOGIES CO.,LTD" },

18877 { 0x44C39B, "OOO RUBEZH NPO" },

18878 { 0x44C3B6, "HUAWEI TECHNOLOGIES CO.,LTD" },

18879 { 0x44C4A9, "Opticom Communication, LLC" },

18880 { 0x44C56F, "NGN Easy Satfinder (Tianjin) Electronic Co., Ltd" },

18881 { 0x44C65D, "Apple, Inc." },

18882 { 0x44C69B, "Wuhan Feng Tian Information Network CO.,LTD" },

18883 { 0x44C7FC, "Huawei Device Co., Ltd." },

18884 { 0x44C874, "China Mobile Group Device Co.,Ltd." },

18885 { 0x44C9A2, "Greenwald Industries" },

18886 { 0x44CB8B, "LG Innotek" },

18887 { 0x44CD0E, "FLEXTRONICS MANUFACTURING(ZHUHAI)CO.,LTD." },

18888 { 0x44CE3A, "Jiangsu Huacun Electronic Technology Co., Ltd." },

18889 { 0x44CE7D, "SFR" },

18890 { 0x44D15E, "Shanghai Kingto Information Technology Ltd" },

18891 { 0x44D1FA, "Shenzhen Yunlink Technology Co., Ltd" },

18892 { 0x44D244, "Seiko Epson Corporation" },

18893 { 0x44D267, "Snorble" },

18894 { 0x44D2CA, "Anvia TV Oy" },

18895 { 0x44D3AD, "Shenzhen TINNO Mobile Technology Corp." },

18896 { 0x44D3CA, "Cisco Systems, Inc" },

18897 { 0x44D437, "Inteno Broadband Technology AB" },

18898 { 0x44D453, "Sagemcom Broadband SAS" },

18899 { 0x44D454, "Sagemcom Broadband SAS" },

18900 { 0x44D465, "NXP Semiconductors Taiwan Ltd." },

18901 { 0x44D47F, "INGENICO TERMINALS SAS" },

18902 { 0x44D4E0, "Sony Corporation" },

18903 { 0x44D506, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

18904 { 0x44D5A5, "AddOn Computer" },

18905 { 0x44D5C1, "EM Microelectronic" },

18906 { 0x44D5CC, "Amazon Technologies Inc." },

18907 { 0x44D5F2, "IEEE Registration Authority" },

18908 { 0x44D63D, "Talari Networks" },

18909 { 0x44D6E1, "Snuza International Pty. Ltd." },

18910 { 0x44D77E, "Robert Bosch GmbH" },

18911 { 0x44D791, "HUAWEI TECHNOLOGIES CO.,LTD" },

18912 { 0x44D832, "AzureWave Technology Inc." },

18913 { 0x44D878, "Hui Zhou Gaoshengda Technology Co.,LTD" },

18914 { 0x44D884, "Apple, Inc." },

18915 { 0x44D980, "EVERYBOT INC." },

18916 { 0x44D9E7, "Ubiquiti Inc" },

18917 { 0x44DA30, "Apple, Inc." },

18918 { 0x44DB60, "Nanjing Baihezhengliu Technology Co., Ltd" },

18919 { 0x44DBD2, "YEALINK(XIAMEN) NETWORK TECHNOLOGY CO.,LTD." },

18920 { 0x44DC4E, "ITEL MOBILE LIMITED" },

18921 { 0x44DC91, "PLANEX COMMUNICATIONS INC." },

18922 { 0x44DCCB, "SEMINDIA SYSTEMS PVT LTD" },

18923 { 0x44DF65, "Beijing Xiaomi Mobile Software Co., Ltd" },

18924 { 0x44E08E, "Cisco SPVTG" },

18925 { 0x44E137, "ARRIS Group, Inc." },

18926 { 0x44E2F1, "NewRadio Technologies Co. , Ltd." },

18927 { 0x44E2F8, "Silicon Laboratories" },

18928 { 0x44E49A, "OMNITRONICS PTY LTD" },

18929 { 0x44E4D9, "Cisco Systems, Inc" },

18930 { 0x44E4E6, "Extreme Networks Headquarters" },

18931 { 0x44E4EE, "Wistron Neweb Corporation" },

18932 { 0x44E517, "Intel Corporate" },

18933 { 0x44E66E, "Apple, Inc." },

18934 { 0x44E6B0, "China Mobile IOT Company Limited" },

18935 { 0x44E761, "Infinix mobility limited" },

18936 { 0x44E8A5, "Myreka Technologies Sdn. Bhd." },

18937 { 0x44E968, "HUAWEI TECHNOLOGIES CO.,LTD" },

18938 { 0x44E9DD, "Sagemcom Broadband SAS" },

18939 { 0x44EA30, "Samsung Electronics Co.,Ltd" },

18940 { 0x44EA4B, "Actlas Inc." },

18941 { 0x44EAD8, "Texas Instruments" },

18942 { 0x44EB2E, "ALPSALPINE CO,.LTD" },

18943 { 0x44ECCE, "Juniper Networks" },

18944 { 0x44ED57, "Longicorn, inc." },

18945 { 0x44EE02, "MTI Ltd." },

18946 { 0x44EE14, "Texas Instruments" },

18947 { 0x44EE30, "Budelmann Elektronik GmbH" },

18948 { 0x44EFBF, "China Dragon Technology Limited" },

18949 { 0x44EFCF, "UGENE SOLUTION inc." },

18950 { 0x44F034, "Kaon Group Co., Ltd." },

18951 { 0x44F09E, "Apple, Inc." },

18952 { 0x44F21B, "Apple, Inc." },

18953 { 0x44F436, "zte corporation" },

18954 { 0x44F459, "Samsung Electronics Co.,Ltd" },

18955 { 0x44F477, "Juniper Networks" },

18956 { 0x44F4E7, "Cohesity Inc" },

18957 { 0x44F849, "Union Pacific Railroad" },

18958 { 0x44F971, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

18959 { 0x44FA66, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

18960 { 0x44FB42, "Apple, Inc." },

18961 { 0x44FB5A, "zte corporation" },

18962 { 0x44FDA3, "Everysight LTD." },

18963 { 0x44FE3B, "Arcadyan Corporation" },

18964 { 0x44FFBA, "zte corporation" },

18965 { 0x480020, "Aruba, a Hewlett Packard Enterprise Company" },

18966 { 0x480031, "HUAWEI TECHNOLOGIES CO.,LTD" },

18967 { 0x480033, "Vantiva USA LLC" },

18968 { 0x48007D, "DTS ELEKTRONIK SAN. TIC. LTD. STI." },

18969 { 0x4801C5, "OnePlus Technology (Shenzhen) Co., Ltd" },

18970 { 0x48022A, "B-Link Electronic Limited" },

18971 { 0x480286, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

18972 { 0x4802AF, "Telit Communication s.p.a" },

18973 { 0x480362, "DESAY ELECTRONICS(HUIZHOU)CO.,LTD" },

18974 { 0x48049F, "ELECOM CO., LTD" },

18975 { 0x4805E2, "Huawei Device Co., Ltd." },

18976 { 0x48062B, "Private" },

18977 { 0x48066A, "Tempered Networks, Inc." },

18978 { 0x480BB2, "IEEE Registration Authority" },

18979 { 0x480C49, "NAKAYO Inc" },

18980 { 0x480EEC, "TP-LINK TECHNOLOGIES CO.,LTD." },

18981 { 0x480FCF, "Hewlett Packard" },

18982 { 0x481063, "NTT Innovation Institute, Inc." },

18983 { 0x481249, "Luxcom Technologies Inc." },

18984 { 0x481258, "HUAWEI TECHNOLOGIES CO.,LTD" },

18985 { 0x48128F, "HUAWEI TECHNOLOGIES CO.,LTD" },

18986 { 0x48137E, "Samsung Electronics Co.,Ltd" },

18987 { 0x4813F3, "BBK EDUCATIONAL ELECTRONICS CORP.,LTD." },

18988 { 0x481693, "Lear Corporation GmbH" },

18989 { 0x48174C, "MicroPower technologies" },

18990 { 0x481842, "Shanghai Winaas Co. Equipment Co. Ltd." },

18991 { 0x48188D, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

18992 { 0x4818FA, "Nocsys" },

18993 { 0x481A84, "Pointer Telocation Ltd" },

18994 { 0x481B40, "Vantiva USA LLC" },

18995 { 0x481BA4, "Cisco Systems, Inc" },

18996 { 0x481BD2, "Intron Scientific co., ltd." },

18997 { 0x481CB9, "SZ DJI TECHNOLOGY CO.,LTD" },

18998 { 0x481D70, "Cisco SPVTG" },

18999 { 0x481F2D, "Shenzhen Jie Shi Lian Industrial Co.,LTD" },

19000 { 0x481F66, "China Mobile Group Device Co.,Ltd." },

19001 { 0x48210B, "PEGATRON CORPORATION" },

19002 { 0x48216C, "China Mobile IOT Company Limited" },

19003 { 0x482218, "Shenzhen Yipingfang Network Technology Co., Ltd." },

19004 { 0x482254, "TP-Link Corporation Limited" },

19005 { 0x482335, "Dialog Semiconductor Hellas SA" },

19006 { 0x482567, "Poly" },

19007 { 0x4825F3, "Huawei Device Co., Ltd." },

19008 { 0x48262C, "Apple, Inc." },

19009 { 0x4826E8, "Tek-Air Systems, Inc." },

19010 { 0x482759, "Levven Electronics Ltd." },

19011 { 0x4827C5, "HUAWEI TECHNOLOGIES CO.,LTD" },

19012 { 0x4827E2, "Espressif Inc." },

19013 { 0x4827EA, "Samsung Electronics Co.,Ltd" },

19014 { 0x48282F, "zte corporation" },

19015 { 0x482952, "Sagemcom Broadband SAS" },

19016 { 0x4829D6, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19017 { 0x4829E4, "AO" },

19018 { 0x482AE3, "Wistron InfoComm(Kunshan)Co.,Ltd." },

19019 { 0x482CA0, "Xiaomi Communications Co Ltd" },

19020 { 0x482CD0, "HUAWEI TECHNOLOGIES CO.,LTD" },

19021 { 0x482CEA, "Motorola Inc Business Light Radios" },

19022 { 0x482D63, "Wavarts Technologies Co., Ltd" },

19023 { 0x482E72, "Cisco Systems, Inc" },

19024 { 0x482F6B, "Aruba, a Hewlett Packard Enterprise Company" },

19025 { 0x482FD7, "HUAWEI TECHNOLOGIES CO.,LTD" },

19026 { 0x483133, "Robert Bosch Elektronika Kft." },

19027 { 0x483177, "Nintendo Co.,Ltd" },

19028 { 0x4831B7, "Espressif Inc." },

19029 { 0x4831DB, "Huawei Device Co., Ltd." },

19030 { 0x4833DD, "ZENNIO AVANCE Y TECNOLOGIA, S.L." },

19031 { 0x48343D, "IEP GmbH" },

19032 { 0x48352B, "Apple, Inc." },

19033 { 0x48352E, "Shenzhen Wolck Network Product Co.,LTD" },

19034 { 0x483543, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19035 { 0x48365F, "Wintecronics Ltd." },

19036 { 0x483871, "Huawei Device Co., Ltd." },

19037 { 0x4838B6, "Auhui Taoyun Technology Co., Ltd" },

19038 { 0x483974, "Proware Technologies Co., Ltd." },

19039 { 0x483B38, "Apple, Inc." },

19040 { 0x483C0C, "HUAWEI TECHNOLOGIES CO.,LTD" },

19041 { 0x483D32, "Syscor Controls &amp; Automation" },

19042 { 0x483E5E, "SERNET (SUZHOU) TECHNOLOGIES CORPORATION" },

19043 { 0x483FDA, "Espressif Inc." },

19044 { 0x483FE9, "HUAWEI TECHNOLOGIES CO.,LTD" },

19045 { 0x48417B, "Nokia Solutions and Networks GmbH & Co. KG" },

19046 { 0x48435A, "HUAWEI TECHNOLOGIES CO.,LTD" },

19047 { 0x48437C, "Apple, Inc." },

19048 { 0x4843DD, "Amazon Technologies Inc." },

19049 { 0x484487, "Cisco SPVTG" },

19050 { 0x4844F7, "Samsung Electronics Co.,Ltd" },

19051 { 0x484520, "Intel Corporate" },

19052 { 0x4845CF, "LLC Proizvodstvennaya Kompania TransService" },

19053 { 0x48468D, "Zepcam B.V." },

19054 { 0x4846C1, "FN-LINK TECHNOLOGY LIMITED" },

19055 { 0x4846F1, "Uros Oy" },

19056 { 0x4846FB, "HUAWEI TECHNOLOGIES CO.,LTD" },

19057 { 0x48474B, "Huawei Device Co., Ltd." },

19058 { 0x4849C7, "Samsung Electronics Co.,Ltd" },

19059 { 0x484A30, "George Robotics Limited" },

19060 { 0x484AE9, "Hewlett Packard Enterprise" },

19061 { 0x484BAA, "Apple, Inc." },

19062 { 0x484BD4, "Vantiva USA LLC" },

19063 { 0x484C29, "HUAWEI TECHNOLOGIES CO.,LTD" },

19064 { 0x484C86, "Huawei Device Co., Ltd." },

19065 { 0x484D7E, "Dell Inc." },

19066 { 0x484EFC, "ARRIS Group, Inc." },

19067 { 0x485073, "Microsoft Corporation" },

19068 { 0x485169, "Samsung Electronics Co.,Ltd" },

19069 { 0x4851B7, "Intel Corporate" },

19070 { 0x4851C5, "Intel Corporate" },

19071 { 0x4851CF, "Intelbras" },

19072 { 0x4851D0, "Jiangsu Xinsheng Intelligent Technology Co., Ltd." },

19073 { 0x485261, "SOREEL" },

19074 { 0x485415, "NET RULES TECNOLOGIA EIRELI" },

19075 { 0x485519, "Espressif Inc." },

19076 { 0x485541, "Iskratel d.o.o." },

19077 { 0x48555C, "Wu Qi Technologies,Inc." },

19078 { 0x48555E, "Shenzhen Skyworth Digital Technology CO., Ltd" },

19079 { 0x48555F, "Fiberhome Telecommunication Technologies Co.,LTD" },

19080 { 0x485702, "HUAWEI TECHNOLOGIES CO.,LTD" },

19081 { 0x4857D2, "Broadcom Limited" },

19082 { 0x4857DD, "Facebook Inc" },

19083 { 0x485929, "LG Electronics (Mobile Communications)" },

19084 { 0x4859A4, "zte corporation" },

19085 { 0x485A0D, "Juniper Networks" },

19086 { 0x485A3F, "WISOL" },

19087 { 0x485A67, "Shaanxi Ruixun Electronic Information Technology Co., Ltd" },

19088 { 0x485AB6, "Hon Hai Precision Ind. Co.,Ltd." },

19089 { 0x485AEA, "Fiberhome Telecommunication Technologies Co.,LTD" },

19090 { 0x485B39, "ASUSTek COMPUTER INC." },

19091 { 0x485D35, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

19092 { 0x485D36, "Verizon" },

19093 { 0x485D60, "AzureWave Technology Inc." },

19094 { 0x485DEB, "Just Add Power" },

19095 { 0x485DED, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

19096 { 0x485F08, "TP-LINK TECHNOLOGIES CO.,LTD." },

19097 { 0x485F99, "Cloud Network Technology (Samoa) Limited" },

19098 { 0x485FDF, "zte corporation" },

19099 { 0x48605F, "LG Electronics (Mobile Communications)" },

19100 { 0x4860BC, "Apple, Inc." },

19101 { 0x4861A3, "Concern Axion JSC" },

19102 { 0x4861EE, "Samsung Electronics Co.,Ltd" },

19103 { 0x486276, "HUAWEI TECHNOLOGIES CO.,LTD" },

19104 { 0x486345, "Huawei Device Co., Ltd." },

19105 { 0x4865EE, "IEEE Registration Authority" },

19106 { 0x486834, "Silicon Motion, Inc." },

19107 { 0x48684A, "Intel Corporate" },

19108 { 0x486B2C, "BBK EDUCATIONAL ELECTRONICS CORP.,LTD." },

19109 { 0x486B91, "Fleetwood Group Inc." },

19110 { 0x486DBB, "Vestel Elektronik San ve Tic. A.S." },

19111 { 0x486E70, "Zhejiang Tmall Technology Co., Ltd." },

19112 { 0x486E73, "Pica8, Inc." },

19113 { 0x486EFB, "Davit System Technology Co., Ltd." },

19114 { 0x486F33, "KYUNGWOO.SYSTEM, INC." },

19115 { 0x486FD2, "StorSimple Inc" },

19116 { 0x48701E, "Texas Instruments" },

19117 { 0x48706F, "HUAWEI TECHNOLOGIES CO.,LTD" },

19118 { 0x487119, "SGB GROUP LTD." },

19119 { 0x487310, "Juniper Networks" },

19120 { 0x487397, "New H3C Technologies Co., Ltd" },

19121 { 0x4873CB, "Tiinlab Corporation" },

19122 { 0x487412, "OnePlus Technology (Shenzhen) Co., Ltd" },

19123 { 0x48746E, "Apple, Inc." },

19124 { 0x487583, "Intellion AG" },

19125 { 0x487604, "Private" },

19126 { 0x487706, "NXP Semiconductor (Tianjin) LTD." },

19127 { 0x487746, "Calix Inc." },

19128 { 0x4877BD, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19129 { 0x48785E, "Amazon Technologies Inc." },

19130 { 0x48794D, "Samsung Electronics Co.,Ltd" },

19131 { 0x487A55, "ALE International" },

19132 { 0x487ADA, "Hangzhou H3C Technologies Co., Limited" },

19133 { 0x487AF6, "NCS ELECTRICAL SDN BHD" },

19134 { 0x487AFF, "ESSYS" },

19135 { 0x487B5E, "SMT TELECOMM HK" },

19136 { 0x487B6B, "HUAWEI TECHNOLOGIES CO.,LTD" },

19137 { 0x487D2E, "TP-LINK TECHNOLOGIES CO.,LTD." },

19138 { 0x487E48, "Earda Technologies co Ltd" },

19139 { 0x488002, "Cisco Systems, Inc" },

19140 { 0x48814E, "E&M SOLUTION CO,.Ltd" },

19141 { 0x4881D4, "Ruijie Networks Co.,LTD" },

19142 { 0x488244, "Life Fitness / Div. of Brunswick" },

19143 { 0x4882F2, "Appel Elektronik GmbH" },

19144 { 0x48836F, "EM Microelectronic" },

19145 { 0x4883B4, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19146 { 0x4883C7, "Sagemcom Broadband SAS" },

19147 { 0x48849D, "Texas Instruments" },

19148 { 0x4886E8, "Microsoft Corporation" },

19149 { 0x48872D, "SHEN ZHEN DA XIA LONG QUE TECHNOLOGY CO.,LTD" },

19150 { 0x488759, "Xiaomi Communications Co Ltd" },

19151 { 0x488764, "vivo Mobile Communication Co., Ltd." },

19152 { 0x4887B8, "TCL King Electrical Appliances(Huizhou)Co.,Ltd" },

19153 { 0x488803, "ManTechnology Inc." },

19154 { 0x48881E, "EthoSwitch LLC" },

19155 { 0x488899, "Shenzhen SuperElectron Technology Co.,Ltd." },

19156 { 0x4888CA, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

19157 { 0x4889E7, "Intel Corporate" },

19158 { 0x488AD2, "MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

19159 { 0x488AE8, "vivo Mobile Communication Co., Ltd." },

19160 { 0x488B0A, "Cisco Systems, Inc" },

19161 { 0x488C63, "Huawei Device Co., Ltd." },

19162 { 0x488D36, "Arcadyan Corporation" },

19163 { 0x488E42, "DIGALOG GmbH" },

19164 { 0x488EB7, "Zebra Technologies Inc." },

19165 { 0x488EEF, "HUAWEI TECHNOLOGIES CO.,LTD" },

19166 { 0x488F4C, "shenzhen trolink Technology Co.,Ltd" },

19167 { 0x488F5A, "Routerboard.com" },

19168 { 0x48902F, "LG Electronics (Mobile Communications)" },

19169 { 0x489153, "Weinmann Geräte für Medizin GmbH + Co. KG" },

19170 { 0x4891D5, "Cisco Systems, Inc" },

19171 { 0x4891F6, "Shenzhen Reach software technology CO.,LTD" },

19172 { 0x4893DC, "UNIWAY INFOCOM PVT LTD" },

19173 { 0x489507, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19174 { 0x4898CA, "Sichuan AI-Link Technology Co., Ltd." },

19175 { 0x489A42, "Technomate Ltd" },

19176 { 0x489A5B, "Shenzhen iComm Semiconductor CO.,LTD" },

19177 { 0x489BD5, "Extreme Networks Headquarters" },

19178 { 0x489BE0, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

19179 { 0x489BE2, "SCI Innovations Ltd" },

19180 { 0x489D18, "Flashbay Limited" },

19181 { 0x489D24, "BlackBerry RTS" },

19182 { 0x489DD1, "Samsung Electronics Co.,Ltd" },

19183 { 0x489E9D, "Hui Zhou Gaoshengda Technology Co.,LTD" },

19184 { 0x489EBD, "HP Inc." },

19185 { 0x489ECB, "Hewlett Packard Enterprise" },

19186 { 0x48A0F8, "Fiberhome Telecommunication Technologies Co.,LTD" },

19187 { 0x48A195, "Apple, Inc." },

19188 { 0x48A22D, "Shenzhen Huaxuchang Telecom Technology Co.,Ltd" },

19189 { 0x48A2B7, "Kodofon JSC" },

19190 { 0x48A2B8, "Chengdu Vision-Zenith Tech.Co,.Ltd" },

19191 { 0x48A2E6, "Resideo" },

19192 { 0x48A380, "Gionee Communication Equipment Co.,Ltd." },

19193 { 0x48A472, "Intel Corporate" },

19194 { 0x48A493, "TAIYO YUDEN CO.,LTD" },

19195 { 0x48A516, "Huawei Device Co., Ltd." },

19196 { 0x48A5E7, "Nintendo Co.,Ltd" },

19197 { 0x48A6B8, "Sonos, Inc." },

19198 { 0x48A6D2, "GJsun Optical Science and Tech Co.,Ltd." },

19199 { 0x48A73C, "Sichuan tianyi kanghe communications co., LTD" },

19200 { 0x48A74E, "zte corporation" },

19201 { 0x48A91C, "Apple, Inc." },

19202 { 0x48A98A, "Routerboard.com" },

19203 { 0x48A9D2, "Wistron Neweb Corporation" },

19204 { 0x48AA5D, "Store Electronic Systems" },

19205 { 0x48AD08, "HUAWEI TECHNOLOGIES CO.,LTD" },

19206 { 0x48AD9A, "Intel Corporate" },

19207 { 0x48B02D, "NVIDIA Corporation" },

19208 { 0x48B253, "Marketaxess Corporation" },

19209 { 0x48B25D, "HUAWEI TECHNOLOGIES CO.,LTD" },

19210 { 0x48B423, "Amazon Technologies Inc." },

19211 { 0x48B4C3, "Aruba, a Hewlett Packard Enterprise Company" },

19212 { 0x48B5A7, "Glory Horse Industries Ltd." },

19213 { 0x48B620, "ROLI Ltd." },

19214 { 0x48B8A3, "Apple, Inc." },

19215 { 0x48B8DE, "HOMEWINS TECHNOLOGY CO.,LTD." },

19216 { 0x48B977, "PulseOn Oy" },

19217 { 0x48B9C2, "Teletics Inc." },

19218 { 0x48BA4E, "Hewlett Packard" },

19219 { 0x48BCA6, "​ASUNG TECHNO CO.,Ltd" },

19220 { 0x48BCE1, "Samsung Electronics Co.,Ltd" },

19221 { 0x48BD0E, "Quanta Storage Inc." },

19222 { 0x48BD3D, "New H3C Technologies Co., Ltd" },

19223 { 0x48BD4A, "HUAWEI TECHNOLOGIES CO.,LTD" },

19224 { 0x48BDA7, "Honor Device Co., Ltd." },

19225 { 0x48BDCE, "Vantiva USA LLC" },

19226 { 0x48BE2D, "Symanitron" },

19227 { 0x48BF6B, "Apple, Inc." },

19228 { 0x48BF74, "Baicells Technologies Co.,LTD" },

19229 { 0x48C049, "Broad Telecom SA" },

19230 { 0x48C093, "Xirrus, Inc." },

19231 { 0x48C1AC, "PLANTRONICS, INC." },

19232 { 0x48C1EE, "Honor Device Co., Ltd." },

19233 { 0x48C35A, "LENOVO(BEIJING)CO., LTD." },

19234 { 0x48C3B0, "Pharos Co.Ltd" },

19235 { 0x48C461, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19236 { 0x48C58D, "Lear Corporation GmbH" },

19237 { 0x48C663, "GTO Access Systems LLC" },

19238 { 0x48C796, "Samsung Electronics Co.,Ltd" },

19239 { 0x48C862, "Simo Wireless,Inc." },

19240 { 0x48C8B6, "SysTec GmbH" },

19241 { 0x48CAC6, "UNION MAN TECHNOLOGY CO.,LTD" },

19242 { 0x48CB6E, "Cello Electronics (UK) Ltd" },

19243 { 0x48CDD3, "HUAWEI TECHNOLOGIES CO.,LTD" },

19244 { 0x48D017, "Telecom Infra Project" },

19245 { 0x48D0CF, "Universal Electronics, Inc." },

19246 { 0x48D18E, "Metis Communication Co.,Ltd" },

19247 { 0x48D224, "Liteon Technology Corporation" },

19248 { 0x48D24F, "Sagemcom Broadband SAS" },

19249 { 0x48D343, "ARRIS Group, Inc." },

19250 { 0x48D35D, "Private" },

19251 { 0x48D475, "Lampuga GmbH" },

19252 { 0x48D539, "HUAWEI TECHNOLOGIES CO.,LTD" },

19253 { 0x48D54C, "Jeda Networks" },

19254 { 0x48D6D5, "Google, Inc." },

19255 { 0x48D705, "Apple, Inc." },

19256 { 0x48D7FF, "BLANKOM Antennentechnik GmbH" },

19257 { 0x48D845, "Shenzhen Mainuoke Electronics Co., Ltd" },

19258 { 0x48D855, "Telvent" },

19259 { 0x48D875, "China TransInfo Technology Co., Ltd" },

19260 { 0x48D890, "FN-LINK TECHNOLOGY LIMITED" },

19261 { 0x48D8FE, "ClarIDy Solutions, Inc." },

19262 { 0x48DA35, "IEEE Registration Authority" },

19263 { 0x48DA96, "Eddy Smart Home Solutions Inc." },

19264 { 0x48DB50, "HUAWEI TECHNOLOGIES CO.,LTD" },

19265 { 0x48DC2D, "HUAWEI TECHNOLOGIES CO.,LTD" },

19266 { 0x48DC9D, "Grandprint(Beijing) Technology Co., LTD." },

19267 { 0x48DCFB, "Nokia Corporation" },

19268 { 0x48DD0C, "eero inc." },

19269 { 0x48DD9D, "ITEL MOBILE LIMITED" },

19270 { 0x48DF1C, "Wuhan NEC Fibre Optic Communications industry Co. Ltd" },

19271 { 0x48DF37, "Hewlett Packard Enterprise" },

19272 { 0x48E15C, "Apple, Inc." },

19273 { 0x48E1AF, "Vity" },

19274 { 0x48E1E9, "Chengdu Meross Technology Co., Ltd." },

19275 { 0x48E244, "Hon Hai Precision Ind. Co.,Ltd." },

19276 { 0x48E3C3, "JENOPTIK Advanced Systems GmbH" },

19277 { 0x48E533, "Sunnovo International Limited" },

19278 { 0x48E695, "Insigma Inc" },

19279 { 0x48E6C0, "SIMCom Wireless Solutions Co.,Ltd." },

19280 { 0x48E729, "Espressif Inc." },

19281 { 0x48E7DA, "AzureWave Technology Inc." },

19282 { 0x48E9F1, "Apple, Inc." },

19283 { 0x48EA63, "Zhejiang Uniview Technologies Co., Ltd." },

19284 { 0x48EB30, "ETERNA TECHNOLOGY, INC." },

19285 { 0x48EB62, "Murata Manufacturing Co., Ltd." },

19286 { 0x48EB65, "Henan KunLun Technologies CO.,Ltd." },

19287 { 0x48EC5B, "Nokia Solutions and Networks GmbH & Co. KG" },

19288 { 0x48ED80, "daesung eltec" },

19289 { 0x48EDE6, "Zyxel Communications Corporation" },

19290 { 0x48EE07, "Silver Palm Technologies LLC" },

19291 { 0x48EE0C, "D-Link International" },

19292 { 0x48EE86, "UTStarcom (China) Co.,Ltd" },

19293 { 0x48EF61, "Huawei Device Co., Ltd." },

19294 { 0x48F027, "Chengdu newifi Co.,Ltd" },

19295 { 0x48F07B, "ALPSALPINE CO,.LTD" },

19296 { 0x48F17F, "Intel Corporate" },

19297 { 0x48F230, "Ubizcore Co.,LTD" },

19298 { 0x48F317, "Private" },

19299 { 0x48F3F3, "Baidu Online Network Technology (Beijing) Co., Ltd" },

19300 { 0x48F47D, "TechVision Holding Internation Limited" },

19301 { 0x48F7C0, "Vantiva USA LLC" },

19302 { 0x48F7F1, "Nokia" },

19303 { 0x48F8B3, "Cisco-Linksys, LLC" },

19304 { 0x48F8DB, "HUAWEI TECHNOLOGIES CO.,LTD" },

19305 { 0x48F8E1, "Nokia" },

19306 { 0x48F8FF, "CHENGDU KT ELECTRONIC HI-TECH CO.,LTD" },

19307 { 0x48F925, "Maestronic" },

19308 { 0x48F97C, "Fiberhome Telecommunication Technologies Co.,LTD" },

19309 { 0x48FCB6, "LAVA INTERNATIONAL(H.K) LIMITED" },

19310 { 0x48FCB8, "Woodstream Corporation" },

19311 { 0x48FD8E, "HUAWEI TECHNOLOGIES CO.,LTD" },

19312 { 0x48FDA3, "Xiaomi Communications Co Ltd" },

19313 { 0x48FEEA, "HOMA B.V." },

19314 { 0x4C0082, "Cisco Systems, Inc" },

19315 { 0x4C0143, "eero inc." },

19316 { 0x4C0220, "Xiaomi Communications Co Ltd" },

19317 { 0x4C022E, "CMR KOREA CO., LTD" },

19318 { 0x4C0289, "LEX COMPUTECH CO., LTD" },

19319 { 0x4C034F, "Intel Corporate" },

19320 { 0x4C0617, "Taicang T&W Electronics" },

19321 { 0x4C068A, "Basler Electric Company" },

19322 { 0x4C06B7, "ProDVX Europe B.V." },

19323 { 0x4C07C9, "COMPUTER OFFICE Co.,Ltd." },

19324 { 0x4C09B4, "zte corporation" },

19325 { 0x4C09D4, "Arcadyan Technology Corporation" },

19326 { 0x4C09FA, "FRONTIER SMART TECHNOLOGIES LTD" },

19327 { 0x4C0A3D, "ADNACOM INC." },

19328 { 0x4C0B3A, "TCT mobile ltd" },

19329 { 0x4C0BBE, "Microsoft" },

19330 { 0x4C0DEE, "JABIL CIRCUIT (SHANGHAI) LTD." },

19331 { 0x4C0F6E, "Hon Hai Precision Ind. Co.,Ltd." },

19332 { 0x4C0FC7, "Earda Technologies co Ltd" },

19333 { 0x4C1154, "Mobiwire Mobiles (NingBo) Co., LTD" },

19334 { 0x4C1159, "Vision Information & Communications" },

19335 { 0x4C11AE, "Espressif Inc." },

19336 { 0x4C11BF, "Zhejiang Dahua Technology Co., Ltd." },

19337 { 0x4C1265, "ARRIS Group, Inc." },

19338 { 0x4C12E8, "VIETNAM POST AND TELECOMMUNICATION INDUSTRY TECHNOLOGY JOIN STOCK COMPANY" },

19339 { 0x4C1365, "Emplus Technologies" },

19340 { 0x4C1480, "NOREGON SYSTEMS, INC" },

19341 { 0x4C14A3, "TCL Technoly Electronics (Huizhou) Co., Ltd." },

19342 { 0x4C1694, "shenzhen sibituo Technology Co., Ltd" },

19343 { 0x4C16F1, "zte corporation" },

19344 { 0x4C16FC, "Juniper Networks" },

19345 { 0x4C1744, "Amazon Technologies Inc." },

19346 { 0x4C17EB, "Sagemcom Broadband SAS" },

19347 { 0x4C189A, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19348 { 0x4C195D, "Sagemcom Broadband SAS" },

19349 { 0x4C1A3A, "PRIMA Research And Production Enterprise Ltd." },

19350 { 0x4C1A3D, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19351 { 0x4C1A95, "Novakon Co., Ltd." },

19352 { 0x4C1B86, "Arcadyan Corporation" },

19353 { 0x4C1D96, "Intel Corporate" },

19354 { 0x4C1FCC, "HUAWEI TECHNOLOGIES CO.,LTD" },

19355 { 0x4C20B8, "Apple, Inc." },

19356 { 0x4C2113, "Nokia Shanghai Bell Co., Ltd." },

19357 { 0x4C218C, "Panasonic India Private limited" },

19358 { 0x4C21D0, "Sony Corporation" },

19359 { 0x4C2219, "YUANFUDAO HK LIMTED" },

19360 { 0x4C2258, "cozybit, Inc." },

19361 { 0x4C22F3, "Arcadyan Corporation" },

19362 { 0x4C231A, "Extreme Networks Headquarters" },

19363 { 0x4C2498, "Texas Instruments" },

19364 { 0x4C24CE, "Sichuan AI-Link Technology Co., Ltd." },

19365 { 0x4C2578, "Nokia Corporation" },

19366 { 0x4C26E7, "Welgate Co., Ltd." },

19367 { 0x4C2C80, "Beijing Skyway Technologies Co.,Ltd" },

19368 { 0x4C2C83, "Zhejiang KaNong Network Technology Co.,Ltd." },

19369 { 0x4C2E5E, "Samsung Electronics Co.,Ltd" },

19370 { 0x4C2EB4, "Apple, Inc." },

19371 { 0x4C2EFE, "Shenzhen Comnect Technology Co.,LTD" },

19372 { 0x4C2F9D, "ICM Controls" },

19373 { 0x4C2FD7, "Huawei Device Co., Ltd." },

19374 { 0x4C3089, "Thales Transportation Systems GmbH" },

19375 { 0x4C312D, "Sichuan AI-Link Technology Co., Ltd." },

19376 { 0x4C322D, "TELEDATA NETWORKS" },

19377 { 0x4C3275, "Apple, Inc." },

19378 { 0x4C32D9, "M Rutty Holdings Pty. Ltd." },

19379 { 0x4C3329, "Sweroam" },

19380 { 0x4C334E, "HIGHTECH" },

19381 { 0x4C3488, "Intel Corporate" },

19382 { 0x4C364E, "Panasonic Connect Co., Ltd." },

19383 { 0x4C38D5, "MITAC COMPUTING TECHNOLOGY CORPORATION" },

19384 { 0x4C38D8, "ARRIS Group, Inc." },

19385 { 0x4C3909, "HPL Electric & Power Private Limited" },

19386 { 0x4C3910, "Newtek Electronics co., Ltd." },

19387 { 0x4C3B6C, "GARO AB" },

19388 { 0x4C3B74, "VOGTEC(H.K.) Co., Ltd" },

19389 { 0x4C3BDF, "Microsoft Corporation" },

19390 { 0x4C3C16, "Samsung Electronics Co.,Ltd" },

19391 { 0x4C3FA7, "uGrid Network Inc." },

19392 { 0x4C3FD3, "Texas Instruments" },

19393 { 0x4C4088, "SANSHIN ELECTRONICS CO.,LTD." },

19394 { 0x4C421E, "Cisco Systems, Inc" },

19395 { 0x4C4341, "Calix Inc." },

19396 { 0x4C445B, "Intel Corporate" },

19397 { 0x4C4576, "China Mobile(Hangzhou) Information Technology Co.,Ltd." },

19398 { 0x4C48DA, "Beijing Autelan Technology Co.,Ltd" },

19399 { 0x4C494F, "zte corporation" },

19400 { 0x4C496C, "Intel Corporate" },

19401 { 0x4C49E3, "Xiaomi Communications Co Ltd" },

19402 { 0x4C4B68, "Mobile Device, Inc." },

19403 { 0x4C4BF9, "IEEE Registration Authority" },

19404 { 0x4C4CD8, "zte corporation" },

19405 { 0x4C4D66, "Nanjing Jiahao Technology Co., Ltd." },

19406 { 0x4C4E03, "TCT mobile ltd" },

19407 { 0x4C4E35, "Cisco Systems, Inc" },

19408 { 0x4C4FEE, "OnePlus Technology (Shenzhen) Co., Ltd" },

19409 { 0x4C5077, "Huawei Device Co., Ltd." },

19410 { 0x4C50DD, "Hui Zhou Gaoshengda Technology Co.,LTD" },

19411 { 0x4C50F1, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19412 { 0x4C5262, "Fujitsu Technology Solutions GmbH" },

19413 { 0x4C52EC, "SOLARWATT GmbH" },

19414 { 0x4C5369, "YanFeng Visteon(ChongQing) Automotive Electronic Co.,Ltd" },

19415 { 0x4C53FD, "Amazon Technologies Inc." },

19416 { 0x4C5427, "Linepro Sp. z o.o." },

19417 { 0x4C5499, "HUAWEI TECHNOLOGIES CO.,LTD" },

19418 { 0x4C5585, "Hamilton Systems" },

19419 { 0x4C55B8, "Turkcell Teknoloji" },

19420 { 0x4C55CC, "Zentri Pty Ltd" },

19421 { 0x4C569D, "Apple, Inc." },

19422 { 0x4C56DF, "Targus US LLC" },

19423 { 0x4C5739, "Samsung Electronics Co.,Ltd" },

19424 { 0x4C57CA, "Apple, Inc." },

19425 { 0x4C5BB3, "Silicon Laboratories" },

19426 { 0x4C5CDF, "ITEL MOBILE LIMITED" },

19427 { 0x4C5D3C, "Cisco Systems, Inc" },

19428 { 0x4C5DCD, "Oy Finnish Electric Vehicle Technologies Ltd" },

19429 { 0x4C5E0C, "Routerboard.com" },

19430 { 0x4C5ED3, "Unisyue Technologies Co; LTD." },

19431 { 0x4C5F70, "Intel Corporate" },

19432 { 0x4C5FD2, "Alcatel-Lucent" },

19433 { 0x4C60BA, "AltoBeam Inc." },

19434 { 0x4C60D5, "airPointe of New Hampshire" },

19435 { 0x4C60DE, "NETGEAR" },

19436 { 0x4C617E, "Huawei Device Co., Ltd." },

19437 { 0x4C6255, "SANMINA-SCI SYSTEM DE MEXICO S.A. DE C.V." },

19438 { 0x4C627B, "SmartCow AI Technologies Taiwan Ltd." },

19439 { 0x4C62CD, "Nokia" },

19440 { 0x4C62DF, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

19441 { 0x4C6371, "Xiaomi Communications Co Ltd" },

19442 { 0x4C63AD, "Huawei Device Co., Ltd." },

19443 { 0x4C63EB, "Application Solutions (Electronics and Vision) Ltd" },

19444 { 0x4C64D9, "Guangdong Leawin Group Co., Ltd" },

19445 { 0x4C65A8, "IEEE Registration Authority" },

19446 { 0x4C6641, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

19447 { 0x4C66A6, "Samsung Electronics Co.,Ltd" },

19448 { 0x4C6AF6, "HMD Global Oy" },

19449 { 0x4C6BE8, "Apple, Inc." },

19450 { 0x4C6C13, "IoT Company Solucoes Tecnologicas Ltda" },

19451 { 0x4C6D58, "Juniper Networks" },

19452 { 0x4C6E6E, "Comnect Technology CO.,LTD" },

19453 { 0x4C6F9C, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19454 { 0x4C70CC, "Blyott NV" },

19455 { 0x4C710C, "Cisco Systems, Inc" },

19456 { 0x4C710D, "Cisco Systems, Inc" },

19457 { 0x4C7167, "PoLabs d.o.o." },

19458 { 0x4C7274, "Shenzhenshi Xinzhongxin Technology Co.Ltd" },

19459 { 0x4C72B9, "PEGATRON CORPORATION" },

19460 { 0x4C734F, "Juniper Networks" },

19461 { 0x4C7367, "Genius Bytes Software Solutions GmbH" },

19462 { 0x4C73A5, "KOVE" },

19463 { 0x4C7403, "BQ" },

19464 { 0x4C7487, "Leader Phone Communication Technology Co., Ltd." },

19465 { 0x4C74A7, "IEEE Registration Authority" },

19466 { 0x4C74BF, "Apple, Inc." },

19467 { 0x4C7525, "Espressif Inc." },

19468 { 0x4C7625, "Dell Inc." },

19469 { 0x4C7713, "Renesas Electronics (Penang) Sdn. Bhd." },

19470 { 0x4C774F, "Embedded Wireless Labs" },

19471 { 0x4C7766, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

19472 { 0x4C776D, "Cisco Systems, Inc" },

19473 { 0x4C77CB, "Intel Corporate" },

19474 { 0x4C7872, "Cav. Uff. Giacomo Cimberio S.p.A." },

19475 { 0x4C7897, "Arrowhead Alarm Products Ltd" },

19476 { 0x4C796E, "Intel Corporate" },

19477 { 0x4C7975, "Apple, Inc." },

19478 { 0x4C79BA, "Intel Corporate" },

19479 { 0x4C7A48, "Nippon Seiki (Europe) B.V." },

19480 { 0x4C7C5F, "Apple, Inc." },

19481 { 0x4C7CD9, "Apple, Inc." },

19482 { 0x4C7F62, "Nokia Corporation" },

19483 { 0x4C804F, "Armstrong Monitoring Corp" },

19484 { 0x4C8093, "Intel Corporate" },

19485 { 0x4C80BA, "Wuhan Tianyu Information Industry Co., Ltd." },

19486 { 0x4C8120, "Taicang T&W Electronics" },

19487 { 0x4C82A9, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

19488 { 0x4C82CF, "Dish Technologies Corp" },

19489 { 0x4C83DE, "Cisco SPVTG" },

19490 { 0x4C875D, "Bose Corporation" },

19491 { 0x4C889E, "Huawei Device Co., Ltd." },

19492 { 0x4C8B30, "Actiontec Electronics, Inc" },

19493 { 0x4C8B55, "Grupo Digicon" },

19494 { 0x4C8BEF, "HUAWEI TECHNOLOGIES CO.,LTD" },

19495 { 0x4C8D53, "HUAWEI TECHNOLOGIES CO.,LTD" },

19496 { 0x4C8D79, "Apple, Inc." },

19497 { 0x4C8ECC, "SILKAN SA" },

19498 { 0x4C8FA5, "Jastec" },

19499 { 0x4C90DB, "JL Audio" },

19500 { 0x4C910C, "Lanix Internacional, S.A. de C.V." },

19501 { 0x4C9157, "Fujian LANDI Commercial Equipment Co.,Ltd" },

19502 { 0x4C917A, "IEEE Registration Authority" },

19503 { 0x4C93A6, "IEEE Registration Authority" },

19504 { 0x4C9614, "Juniper Networks" },

19505 { 0x4C962D, "Fresh AB" },

19506 { 0x4C968A, "Wacom Co.,Ltd." },

19507 { 0x4C97CC, "Apple, Inc." },

19508 { 0x4C98EF, "Zeo" },

19509 { 0x4C9992, "vivo Mobile Communication Co., Ltd." },

19510 { 0x4C9B63, "LG Innotek" },

19511 { 0x4C9D22, "ACES Co.,Ltd" },

19512 { 0x4C9E6C, "BROADEX TECHNOLOGIES CO.LTD" },

19513 { 0x4C9E80, "KYOKKO ELECTRIC Co., Ltd." },

19514 { 0x4C9EE4, "Hanyang Navicom Co.,Ltd." },

19515 { 0x4C9EFF, "Zyxel Communications Corporation" },

19516 { 0x4CA003, "VITEC" },

19517 { 0x4CA0D4, "Telink Semiconductor (Shanghai) Co., Ltd." },

19518 { 0x4CA161, "Rain Bird Corporation" },

19519 { 0x4CA3A7, "TECNO MOBILE LIMITED" },

19520 { 0x4CA515, "Baikal Electronics JSC" },

19521 { 0x4CA56D, "Samsung Electronics Co.,Ltd" },

19522 { 0x4CA64D, "Cisco Systems, Inc" },

19523 { 0x4CA74B, "Alcatel Lucent" },

19524 { 0x4CA919, "Tuya Smart Inc." },

19525 { 0x4CA928, "Insensi" },

19526 { 0x4CAA16, "AzureWave Technologies (Shanghai) Inc." },

19527 { 0x4CAB33, "KST technology" },

19528 { 0x4CAB4F, "Apple, Inc." },

19529 { 0x4CABF8, "ASKEY COMPUTER CORP" },

19530 { 0x4CABFC, "zte corporation" },

19531 { 0x4CAC0A, "zte corporation" },

19532 { 0x4CADA8, "PANOPTICS CORP." },

19533 { 0x4CAE13, "HUAWEI TECHNOLOGIES CO.,LTD" },

19534 { 0x4CAE1C, "SaiNXT Technologies LLP" },

19535 { 0x4CAE31, "ShengHai Electronics (Shenzhen) Ltd" },

19536 { 0x4CAEA3, "Hewlett Packard Enterprise" },

19537 { 0x4CAEEC, "Guangzhou limee technology co.,LTD" },

19538 { 0x4CB008, "Shenzhen Gwelltimes Technology Co.,Ltd" },

19539 { 0x4CB087, "HUAWEI TECHNOLOGIES CO.,LTD" },

19540 { 0x4CB0E8, "Beijing RongZhi xinghua technology co., LTD" },

19541 { 0x4CB16C, "HUAWEI TECHNOLOGIES CO.,LTD" },

19542 { 0x4CB199, "Apple, Inc." },

19543 { 0x4CB1CD, "Ruckus Wireless" },

19544 { 0x4CB21C, "Maxphotonics Co.,Ltd" },

19545 { 0x4CB44A, "NANOWAVE Technologies Inc." },

19546 { 0x4CB4EA, "HRD (S) PTE., LTD." },

19547 { 0x4CB76D, "Novi Security" },

19548 { 0x4CB7E0, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

19549 { 0x4CB81C, "SAM Electronics GmbH" },

19550 { 0x4CB82C, "Cambridge Mobile Telematics, Inc." },

19551 { 0x4CB8B5, "Shenzhen YOUHUA Technology Co., Ltd" },

19552 { 0x4CB910, "Apple, Inc." },

19553 { 0x4CB911, "Raisecom Technology CO., LTD" },

19554 { 0x4CB99B, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

19555 { 0x4CB9C8, "CONET CO., LTD." },

19556 { 0x4CB9EA, "iRobot Corporation" },

19557 { 0x4CBA7D, "Gemtek Technology Co., Ltd." },

19558 { 0x4CBAA3, "Bison Electronics Inc." },

19559 { 0x4CBAD7, "LG Innotek" },

19560 { 0x4CBB58, "Chicony Electronics Co., Ltd." },

19561 { 0x4CBC42, "Shenzhen Hangsheng Electronics Co.,Ltd." },

19562 { 0x4CBC48, "Cisco Systems, Inc" },

19563 { 0x4CBC72, "Primex Wireless" },

19564 { 0x4CBC98, "IEEE Registration Authority" },

19565 { 0x4CBCA5, "Samsung Electronics Co.,Ltd" },

19566 { 0x4CBCB4, "ABB SpA - DIN Rail" },

19567 { 0x4CBCE9, "LG Innotek" },

19568 { 0x4CBD8F, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

19569 { 0x4CC00A, "vivo Mobile Communication Co., Ltd." },

19570 { 0x4CC206, "Somfy" },

19571 { 0x4CC449, "Icotera A/S" },

19572 { 0x4CC452, "Shang Hai Tyd. Electon Technology Ltd." },

19573 { 0x4CC53E, "Zyxel Communications Corporation" },

19574 { 0x4CC602, "Radios, Inc." },

19575 { 0x4CC64C, "Beijing Xiaomi Mobile Software Co., Ltd" },

19576 { 0x4CC681, "Shenzhen Aisat Electronic Co., Ltd." },

19577 { 0x4CC7D6, "FLEXTRONICS MANUFACTURING(ZHUHAI)CO.,LTD." },

19578 { 0x4CC844, "Maipu Communication Technology Co.,Ltd." },

19579 { 0x4CC8A1, "Cisco Meraki" },

19580 { 0x4CC94F, "Nokia" },

19581 { 0x4CC95E, "Samsung Electronics Co.,Ltd" },

19582 { 0x4CCA53, "Skyera, Inc." },

19583 { 0x4CCBF5, "zte corporation" },

19584 { 0x4CCC34, "Motorola Solutions Inc." },

19585 { 0x4CCC6A, "Micro-Star INTL CO., LTD." },

19586 { 0x4CCE2D, "Danlaw Inc" },

19587 { 0x4CD08A, "HUMAX Co., Ltd." },

19588 { 0x4CD0CB, "HUAWEI TECHNOLOGIES CO.,LTD" },

19589 { 0x4CD0DD, "HUAWEI TECHNOLOGIES CO.,LTD" },

19590 { 0x4CD1A1, "HUAWEI TECHNOLOGIES CO.,LTD" },

19591 { 0x4CD2FB, "UNIONMAN TECHNOLOGY CO.,LTD" },

19592 { 0x4CD3AF, "HMD Global Oy" },

19593 { 0x4CD577, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

19594 { 0x4CD587, "Aruba, a Hewlett Packard Enterprise Company" },

19595 { 0x4CD629, "HUAWEI TECHNOLOGIES CO.,LTD" },

19596 { 0x4CD637, "Qsono Electronics Co., Ltd" },

19597 { 0x4CD717, "Dell Inc." },

19598 { 0x4CD7B6, "Helmer Scientific" },

19599 { 0x4CD98F, "Dell Inc." },

19600 { 0x4CD9C4, "Magneti Marelli Automotive Electronics (Guangzhou) Co. Ltd" },

19601 { 0x4CDC0D, "Coral Telecom Limited" },

19602 { 0x4CDD31, "Samsung Electronics Co.,Ltd" },

19603 { 0x4CDD7D, "LHP Telematics LLC" },

19604 { 0x4CDF3D, "TEAM ENGINEERS ADVANCE TECHNOLOGIES INDIA PVT LTD" },

19605 { 0x4CE0DB, "Xiaomi Communications Co Ltd" },

19606 { 0x4CE136, "Private" },

19607 { 0x4CE173, "IEEE Registration Authority" },

19608 { 0x4CE175, "Cisco Systems, Inc" },

19609 { 0x4CE176, "Cisco Systems, Inc" },

19610 { 0x4CE19E, "TECNO MOBILE LIMITED" },

19611 { 0x4CE1BB, "Zhuhai HiFocus Technology Co., Ltd." },

19612 { 0x4CE2F1, "Udino srl" },

19613 { 0x4CE5AE, "Tianjin Beebox Intelligent Technology Co.,Ltd." },

19614 { 0x4CE676, "BUFFALO.INC" },

19615 { 0x4CE6C0, "Apple, Inc." },

19616 { 0x4CE705, "Siemens Industrial Automation Products Ltd., Chengdu" },

19617 { 0x4CE933, "RailComm, LLC" },

19618 { 0x4CE9E4, "New H3C Technologies Co., Ltd" },

19619 { 0x4CEA41, "IEEE Registration Authority" },

19620 { 0x4CEAAE, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19621 { 0x4CEB42, "Intel Corporate" },

19622 { 0x4CEB76, "Murrelektronik GmbH" },

19623 { 0x4CEBBD, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

19624 { 0x4CEBD6, "Espressif Inc." },

19625 { 0x4CEC0F, "Cisco Systems, Inc" },

19626 { 0x4CECEF, "Soraa, Inc." },

19627 { 0x4CEDDE, "ASKEY COMPUTER CORP" },

19628 { 0x4CEDFB, "ASUSTek COMPUTER INC." },

19629 { 0x4CEEB0, "SHC Netzwerktechnik GmbH" },

19630 { 0x4CEF56, "Shenzhen Sundray Technologies Company Limited" },

19631 { 0x4CEFC0, "Amazon Technologies Inc." },

19632 { 0x4CF02E, "Vifa Denmark A/S" },

19633 { 0x4CF19E, "Groupe Atlantic" },

19634 { 0x4CF202, "Xiaomi Communications Co Ltd" },

19635 { 0x4CF2BF, "Cambridge Industries(Group) Co.,Ltd." },

19636 { 0x4CF45B, "Blue Clover Devices" },

19637 { 0x4CF55B, "HUAWEI TECHNOLOGIES CO.,LTD" },

19638 { 0x4CF5A0, "Scalable Network Technologies Inc" },

19639 { 0x4CF5DC, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

19640 { 0x4CF737, "SamJi Electronics Co., Ltd" },

19641 { 0x4CF95D, "HUAWEI TECHNOLOGIES CO.,LTD" },

19642 { 0x4CFACA, "Cambridge Industries(Group) Co.,Ltd." },

19643 { 0x4CFB45, "HUAWEI TECHNOLOGIES CO.,LTD" },

19644 { 0x4CFBF4, "Optimal Audio Ltd" },

19645 { 0x4CFBFE, "Sercomm Japan Corporation" },

19646 { 0x4CFC22, "SHANGHAI HI-TECH CONTROL SYSTEM CO.,LTD." },

19647 { 0x4CFCAA, "Tesla,Inc." },

19648 { 0x4CFE2E, "DongGuan Siyoto Electronics Co., Ltd" },

19649 { 0x4CFF12, "Fuze Entertainment Co., ltd" },

19650 { 0x500084, "Siemens Canada" },

19651 { 0x50008C, "Hong Kong Telecommunications (HKT) Limited" },

19652 { 0x50016B, "HUAWEI TECHNOLOGIES CO.,LTD" },

19653 { 0x5001BB, "Samsung Electronics Co.,Ltd" },

19654 { 0x5001D9, "HUAWEI TECHNOLOGIES CO.,LTD" },

19655 { 0x500238, "Nokia Shanghai Bell Co., Ltd." },

19656 { 0x500291, "Espressif Inc." },

19657 { 0x5004B8, "HUAWEI TECHNOLOGIES CO.,LTD" },

19658 { 0x50053D, "CyWee Group Ltd" },

19659 { 0x500604, "Cisco Systems, Inc" },

19660 { 0x5006AB, "Cisco Systems, Inc" },

19661 { 0x5007C3, "Amazon Technologies Inc." },

19662 { 0x500959, "Vantiva USA LLC" },

19663 { 0x5009E5, "Drimsys,Inc" },

19664 { 0x500A52, "Huiwan Technologies Co. Ltd" },

19665 { 0x500B26, "HUAWEI TECHNOLOGIES CO.,LTD" },

19666 { 0x500B32, "Foxda Technology Industrial(ShenZhen)Co.,LTD" },

19667 { 0x500B91, "IEEE Registration Authority" },

19668 { 0x500E6D, "TrafficCast International" },

19669 { 0x500F59, "STMicrolectronics International NV" },

19670 { 0x500F80, "Cisco Systems, Inc" },

19671 { 0x500FF5, "Tenda Technology Co.,Ltd.Dongguan branch" },

19672 { 0x5011EB, "SilverNet Ltd" },

19673 { 0x50131D, "Motorola Mobility LLC, a Lenovo Company" },

19674 { 0x501395, "Sichuan AI-Link Technology Co., Ltd." },

19675 { 0x501408, "AiNET" },

19676 { 0x501479, "iRobot Corporation" },

19677 { 0x5014B5, "Richfit Information Technology Co., Ltd" },

19678 { 0x5014C1, "HUAWEI TECHNOLOGIES CO.,LTD" },

19679 { 0x5016F4, "Motorola Mobility LLC, a Lenovo Company" },

19680 { 0x5017FF, "Cisco Systems, Inc" },

19681 { 0x50184C, "Platina Systems Inc." },

19682 { 0x501AA5, "GN Netcom A/S" },

19683 { 0x501AC5, "Microsoft" },

19684 { 0x501B32, "Taicang T&W Electronics" },

19685 { 0x501CB0, "Cisco Systems, Inc" },

19686 { 0x501CBF, "Cisco Systems, Inc" },

19687 { 0x501D93, "HUAWEI TECHNOLOGIES CO.,LTD" },

19688 { 0x501E2D, "StreamUnlimited Engineering GmbH" },

19689 { 0x501FC6, "Apple, Inc." },

19690 { 0x502065, "Quectel Wireless Solutions Co.,Ltd." },

19691 { 0x50206B, "Copeland - Transportation Solutions ApS" },

19692 { 0x5021EC, "Huawei Device Co., Ltd." },

19693 { 0x502267, "PixeLINK" },

19694 { 0x50236D, "Nintendo Co.,Ltd" },

19695 { 0x5023A2, "Apple, Inc." },

19696 { 0x50252B, "Nethra Imaging Incorporated" },

19697 { 0x502690, "FUJITSU LIMITED" },

19698 { 0x5026EF, "Murata Manufacturing Co., Ltd." },

19699 { 0x5027A9, "eero inc." },

19700 { 0x5027C7, "TECHNART Co.,Ltd" },

19701 { 0x50284A, "Intel Corporate" },

19702 { 0x502873, "Huawei Device Co., Ltd." },

19703 { 0x50294D, "NANJING IOT SENSOR TECHNOLOGY CO,LTD" },

19704 { 0x50297B, "China Mobile Group Device Co.,Ltd." },

19705 { 0x5029F5, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19706 { 0x502A7E, "Smart electronic GmbH" },

19707 { 0x502A8B, "Telekom Research and Development Sdn Bhd" },

19708 { 0x502B73, "Tenda Technology Co.,Ltd.Dongguan branch" },

19709 { 0x502B98, "Es-tech International" },

19710 { 0x502CC6, "GREE ELECTRIC APPLIANCES, INC. OF ZHUHAI" },

19711 { 0x502D1D, "Nokia Corporation" },

19712 { 0x502DA2, "Intel Corporate" },

19713 { 0x502DBB, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

19714 { 0x502DF4, "Phytec Messtechnik GmbH" },

19715 { 0x502DFB, "IGShare Co., Ltd." },

19716 { 0x502E5C, "HTC Corporation" },

19717 { 0x502ECE, "Asahi Electronics Co.,Ltd" },

19718 { 0x502F9B, "Intel Corporate" },

19719 { 0x502FA8, "Cisco Systems, Inc" },

19720 { 0x5030F4, "Exascend, Inc." },

19721 { 0x5031AD, "ABB Global Industries and Services Private Limited" },

19722 { 0x503237, "Apple, Inc." },

19723 { 0x50325F, "Silicon Laboratories" },

19724 { 0x503275, "Samsung Electronics Co.,Ltd" },

19725 { 0x50338B, "Texas Instruments" },

19726 { 0x5033F0, "YICHEN (SHENZHEN) TECHNOLOGY CO.LTD" },

19727 { 0x50382F, "ASE Group Chung-Li" },

19728 { 0x50392F, "INGRAM MICRO SERVICES" },

19729 { 0x503955, "Cisco SPVTG" },

19730 { 0x503A7D, "AlphaTech PLC Int’l Co., Ltd." },

19731 { 0x503AA0, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

19732 { 0x503CC4, "Lenovo Mobile Communication Technology Ltd." },

19733 { 0x503CCA, "TECNO MOBILE LIMITED" },

19734 { 0x503CEA, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19735 { 0x503DA1, "Samsung Electronics Co.,Ltd" },

19736 { 0x503DC6, "Xiaomi Communications Co Ltd" },

19737 { 0x503DE5, "Cisco Systems, Inc" },

19738 { 0x503DEB, "Zhejiang Tmall Technology Co., Ltd." },

19739 { 0x503E7C, "LeiShen Intelligent System Co.Ltd" },

19740 { 0x503EAA, "TP-LINK TECHNOLOGIES CO.,LTD." },

19741 { 0x503F50, "Huawei Device Co., Ltd." },

19742 { 0x503F56, "Syncmold Enterprise Corp" },

19743 { 0x503F98, "CMITECH" },

19744 { 0x504061, "Nokia" },

19745 { 0x504074, "Alarm.com" },

19746 { 0x50411C, "AMPAK Technology,Inc." },

19747 { 0x504172, "HUAWEI TECHNOLOGIES CO.,LTD" },

19748 { 0x5041B9, "I-O DATA DEVICE,INC." },

19749 { 0x504289, "zte corporation" },

19750 { 0x504348, "ThingsMatrix Inc." },

19751 { 0x5043B9, "OktoInform RUS" },

19752 { 0x504594, "Radisys" },

19753 { 0x5045F7, "Liuhe Intelligence Technology Ltd." },

19754 { 0x50464A, "HUAWEI TECHNOLOGIES CO.,LTD" },

19755 { 0x50465D, "ASUSTek COMPUTER INC." },

19756 { 0x5046AE, "MERCURY CORPORATION" },

19757 { 0x50482C, "IEEE Registration Authority" },

19758 { 0x504877, "Honor Device Co., Ltd." },

19759 { 0x5048EB, "BEIJING HAIHEJINSHENG NETWORK TECHNOLOGY CO. LTD." },

19760 { 0x504921, "Cisco Systems, Inc" },

19761 { 0x5049B0, "Samsung Electronics Co.,Ltd" },

19762 { 0x504A5E, "Masimo Corporation" },

19763 { 0x504A6E, "NETGEAR" },

19764 { 0x504B5B, "CONTROLtronic GmbH" },

19765 { 0x504B9E, "Huawei Device Co., Ltd." },

19766 { 0x504C7E, "THE 41ST INSTITUTE OF CETC" },

19767 { 0x504EDC, "Ping Communication" },

19768 { 0x504F94, "Loxone Electronics GmbH" },

19769 { 0x50502A, "Egardia" },

19770 { 0x505065, "TAKT Corporation" },

19771 { 0x5050A4, "Samsung Electronics Co.,Ltd" },

19772 { 0x5050CE, "Hangzhou Dianyixia Communication Technology Co. Ltd." },

19773 { 0x5051A9, "Texas Instruments" },

19774 { 0x50523B, "Nokia" },

19775 { 0x5052D2, "Hangzhou Telin Technologies Co., Limited" },

19776 { 0x50547B, "Nanjing Qinheng Microelectronics Co., Ltd." },

19777 { 0x505527, "LG Electronics (Mobile Communications)" },

19778 { 0x50558D, "China Mobile IOT Company Limited" },

19779 { 0x505663, "Texas Instruments" },

19780 { 0x5056A8, "Jolla Ltd" },

19781 { 0x5056BF, "Samsung Electronics Co.,Ltd" },

19782 { 0x50578A, "Apple, Inc." },

19783 { 0x50579C, "Seiko Epson Corporation" },

19784 { 0x5057A8, "Cisco Systems, Inc" },

19785 { 0x505800, "WyTec International, Inc." },

19786 { 0x50584F, "waytotec,Inc." },

19787 { 0x50586F, "Huawei Device Co., Ltd." },

19788 { 0x5058B0, "Hunan Greatwall Computer System Co., Ltd." },

19789 { 0x505967, "Intent Solutions Inc" },

19790 { 0x505A65, "AzureWave Technology Inc." },

19791 { 0x505AC6, "GUANGDONG SUPER TELECOM CO.,LTD." },

19792 { 0x505B1D, "Shenzhen C-Data Technology Co., Ltd." },

19793 { 0x505BC2, "Liteon Technology Corporation" },

19794 { 0x505D7A, "zte corporation" },

19795 { 0x505DAC, "HUAWEI TECHNOLOGIES CO.,LTD" },

19796 { 0x505E24, "zte corporation" },

19797 { 0x505E5C, "SUNITEC TECHNOLOGY CO.,LIMITED" },

19798 { 0x505FB5, "ASKEY COMPUTER CORP" },

19799 { 0x506028, "Xirrus Inc." },

19800 { 0x506184, "Avaya Inc" },

19801 { 0x5061BF, "Cisco Systems, Inc" },

19802 { 0x5061D6, "Indu-Sol GmbH" },

19803 { 0x5061F6, "Universal Electronics, Inc." },

19804 { 0x506255, "IEEE Registration Authority" },

19805 { 0x506313, "Hon Hai Precision Ind. Co.,Ltd." },

19806 { 0x506391, "HUAWEI TECHNOLOGIES CO.,LTD" },

19807 { 0x50642B, "XIAOMI Electronics,CO.,LTD" },

19808 { 0x506441, "Greenlee" },

19809 { 0x506583, "Texas Instruments" },

19810 { 0x5065F3, "Hewlett Packard" },

19811 { 0x5066E5, "Huawei Device Co., Ltd." },

19812 { 0x506787, "Planet Networks" },

19813 { 0x5067AE, "Cisco Systems, Inc" },

19814 { 0x5067F0, "Zyxel Communications Corporation" },

19815 { 0x50680A, "HUAWEI TECHNOLOGIES CO.,LTD" },

19816 { 0x5068AC, "Huawei Device Co., Ltd." },

19817 { 0x506A03, "NETGEAR" },

19818 { 0x506B4B, "Mellanox Technologies, Inc." },

19819 { 0x506B8D, "Nutanix" },

19820 { 0x506CBE, "InnosiliconTechnology Ltd" },

19821 { 0x506E92, "Innocent Technology Co., Ltd." },

19822 { 0x506F0C, "Sagemcom Broadband SAS" },

19823 { 0x506F77, "HUAWEI TECHNOLOGIES CO.,LTD" },

19824 { 0x506F98, "Sehaj Synergy Technologies Private Limited" },

19825 { 0x506F9A, "Wi-Fi Alliance" },

19826 { 0x507043, "SKY UK LIMITED" },

19827 { 0x507097, "China Mobile Group Device Co.,Ltd." },

19828 { 0x5070E5, "He Shan World Fair Electronics Technology Limited" },

19829 { 0x507224, "Texas Instruments" },

19830 { 0x50724D, "BEG Brueck Electronic GmbH" },

19831 { 0x5075F1, "ARRIS Group, Inc." },

19832 { 0x507691, "Tekpea, Inc." },

19833 { 0x5076A6, "Ecil Informatica Ind. Com. Ltda" },

19834 { 0x5076AF, "Intel Corporate" },

19835 { 0x507705, "Samsung Electronics Co.,Ltd" },

19836 { 0x5078B0, "Huawei Device Co., Ltd." },

19837 { 0x5078B3, "zte corporation" },

19838 { 0x50795B, "Interexport Telecomunicaciones S.A." },

19839 { 0x507A55, "Apple, Inc." },

19840 { 0x507AC5, "Apple, Inc." },

19841 { 0x507B91, "Sigmastar Technology Ltd." },

19842 { 0x507B9D, "LCFC(HeFei) Electronics Technology co., ltd" },

19843 { 0x507C6F, "Intel Corporate" },

19844 { 0x507D02, "BIODIT" },

19845 { 0x507E5D, "Arcadyan Technology Corporation" },

19846 { 0x50804A, "Quectel Wireless Solutions Co.,Ltd." },

19847 { 0x508140, "HP Inc." },

19848 { 0x5082D5, "Apple, Inc." },

19849 { 0x508492, "Intel Corporate" },

19850 { 0x508569, "Samsung Electronics Co.,Ltd" },

19851 { 0x50874D, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

19852 { 0x508789, "Cisco Systems, Inc" },

19853 { 0x5087B8, "Nuvyyo Inc" },

19854 { 0x508811, "Beijing Xiaomi Mobile Software Co., Ltd" },

19855 { 0x508965, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

19856 { 0x5089D1, "Huawei Device Co., Ltd." },

19857 { 0x508A06, "Tuya Smart Inc." },

19858 { 0x508A0F, "SHENZHEN FISE TECHNOLOGY HOLDING CO.,LTD." },

19859 { 0x508A42, "Uptmate Technology Co., LTD" },

19860 { 0x508ACB, "SHENZHEN MAXMADE TECHNOLOGY CO., LTD." },

19861 { 0x508BB9, "Tuya Smart Inc." },

19862 { 0x508C77, "DIRMEIER Schanktechnik GmbH &Co KG" },

19863 { 0x508CB1, "Texas Instruments" },

19864 { 0x508CF5, "China Mobile Group Device Co.,Ltd." },

19865 { 0x508D6F, "CHAHOO Limited" },

19866 { 0x508E49, "Xiaomi Communications Co Ltd" },

19867 { 0x508F4C, "Xiaomi Communications Co Ltd" },

19868 { 0x5091E3, "TP-Link Corporation Limited" },

19869 { 0x5092B9, "Samsung Electronics Co.,Ltd" },

19870 { 0x50934F, "Gradual Tecnologia Ltda." },

19871 { 0x509551, "ARRIS Group, Inc." },

19872 { 0x509707, "Xiamen Paperang Technology Co.,Ltd." },

19873 { 0x509744, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

19874 { 0x509772, "Westinghouse Digital" },

19875 { 0x509839, "Xiaomi Communications Co Ltd" },

19876 { 0x509871, "Inventum Technologies Private Limited" },

19877 { 0x509893, "Texas Instruments" },

19878 { 0x5098B8, "New H3C Technologies Co., Ltd" },

19879 { 0x5098F3, "Rheem Australia Pty Ltd" },

19880 { 0x509A46, "Safetrust Inc" },

19881 { 0x509A4C, "Dell Inc." },

19882 { 0x509A88, "HUAWEI TECHNOLOGIES CO.,LTD" },

19883 { 0x509EA7, "Samsung Electronics Co.,Ltd" },

19884 { 0x509F27, "HUAWEI TECHNOLOGIES CO.,LTD" },

19885 { 0x509F3B, "OI ELECTRIC CO.,LTD" },

19886 { 0x50A009, "Xiaomi Communications Co Ltd" },

19887 { 0x50A015, "Shenzhen Yipingfang Network Technology Co., Ltd." },

19888 { 0x50A030, "IEEE Registration Authority" },

19889 { 0x50A054, "Actineon" },

19890 { 0x50A0A4, "Nokia" },

19891 { 0x50A0BF, "Alba Fiber Systems Inc." },

19892 { 0x50A132, "Shenzhen MiaoMing Intelligent Technology Co.,Ltd" },

19893 { 0x50A1F3, "Huawei Device Co., Ltd." },

19894 { 0x50A4C8, "Samsung Electronics Co.,Ltd" },

19895 { 0x50A4D0, "IEEE Registration Authority" },

19896 { 0x50A5DC, "ARRIS Group, Inc." },

19897 { 0x50A67F, "Apple, Inc." },

19898 { 0x50A6D8, "Apple, Inc." },

19899 { 0x50A6E3, "David Clark Company" },

19900 { 0x50A715, "Aboundi, Inc." },

19901 { 0x50A72B, "HUAWEI TECHNOLOGIES CO.,LTD" },

19902 { 0x50A733, "Ruckus Wireless" },

19903 { 0x50A83A, "S Mobile Devices Limited" },

19904 { 0x50A9DE, "Smartcom - Bulgaria AD" },

19905 { 0x50AB3E, "Qibixx AG" },

19906 { 0x50ABBF, "Hoseo Telecom" },

19907 { 0x50AD71, "Tessolve Semiconductor Private Limited" },

19908 { 0x50AD92, "NX Technologies" },

19909 { 0x50ADD5, "Dynalec Corporation" },

19910 { 0x50AE86, "Linkintec Co., Ltd" },

19911 { 0x50AF4D, "zte corporation" },

19912 { 0x50AF73, "Shenzhen Bitland Information Technology Co., Ltd." },

19913 { 0x50B127, "Apple, Inc." },

19914 { 0x50B363, "Digitron da Amazonia S/A" },

19915 { 0x50B3B4, "Shenzhen Furuilian Electronic Co.,Ltd." },

19916 { 0x50B695, "Micropoint Biotechnologies,Inc." },

19917 { 0x50B7C3, "Samsung Electronics Co.,Ltd" },

19918 { 0x50B888, "wi2be Tecnologia S/A" },

19919 { 0x50B8A2, "ImTech Technologies LLC," },

19920 { 0x50BC96, "Apple, Inc." },

19921 { 0x50BD5F, "TP-LINK TECHNOLOGIES CO.,LTD." },

19922 { 0x50C006, "Carmanah Signs" },

19923 { 0x50C0F0, "Artek Microelectronics Co.,Ltd." },

19924 { 0x50C1F0, "NXP Semiconductor (Tianjin) LTD." },

19925 { 0x50C271, "SECURETECH INC" },

19926 { 0x50C275, "GN Audio A/S" },

19927 { 0x50C2E8, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

19928 { 0x50C2ED, "GN Audio A/S" },

19929 { 0x50C3A2, "nFore Technology Co.,Ltd." },

19930 { 0x50C4DD, "BUFFALO.INC" },

19931 { 0x50C58D, "Juniper Networks" },

19932 { 0x50C68E, "Biwin Semiconductor (HK) Company Limted" },

19933 { 0x50C6AD, "Fiberhome Telecommunication Technologies Co.,LTD" },

19934 { 0x50C709, "Juniper Networks" },

19935 { 0x50C7BF, "TP-LINK TECHNOLOGIES CO.,LTD." },

19936 { 0x50C8E5, "Samsung Electronics Co.,Ltd" },

19937 { 0x50C971, "GN Netcom A/S" },

19938 { 0x50C9A0, "SKIPPER AS" },

19939 { 0x50CCF8, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

19940 { 0x50CD22, "Avaya Inc" },

19941 { 0x50CD32, "NanJing Chaoran Science & Technology Co.,Ltd." },

19942 { 0x50CE75, "Measy Electronics Co., Ltd." },

19943 { 0x50CEE3, "Gigafirm.co.LTD" },

19944 { 0x50D065, "ESYLUX GmbH" },

19945 { 0x50D213, "CviLux Corporation" },

19946 { 0x50D274, "Steffes Corporation" },

19947 { 0x50D2F5, "Beijing Xiaomi Mobile Software Co., Ltd" },

19948 { 0x50D33B, "cloudnineinfo" },

19949 { 0x50D37F, "Yu Fly Mikly Way Science and Technology Co., Ltd." },

19950 { 0x50D45C, "Amazon Technologies Inc." },

19951 { 0x50D4F7, "TP-LINK TECHNOLOGIES CO.,LTD." },

19952 { 0x50D59C, "Thai Habel Industrial Co., Ltd." },

19953 { 0x50D6D7, "Takahata Precision" },

19954 { 0x50D753, "CONELCOM GmbH" },

19955 { 0x50DA00, "Hangzhou H3C Technologies Co., Limited" },

19956 { 0x50DAD6, "Xiaomi Communications Co Ltd" },

19957 { 0x50DB3F, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

19958 { 0x50DCD0, "Observint Technologies, Inc." },

19959 { 0x50DCE7, "Amazon Technologies Inc." },

19960 { 0x50DCFC, "ECOCOM" },

19961 { 0x50DD4F, "Automation Components, Inc" },

19962 { 0x50DE06, "Apple, Inc." },

19963 { 0x50DE19, "IEEE Registration Authority" },

19964 { 0x50DF95, "Lytx" },

19965 { 0x50E039, "Zyxel Communications Corporation" },

19966 { 0x50E085, "Intel Corporate" },

19967 { 0x50E0C7, "TurControlSystme AG" },

19968 { 0x50E0EF, "Nokia" },

19969 { 0x50E14A, "Private" },

19970 { 0x50E24E, "zte corporation" },

19971 { 0x50E452, "Chipsea Technologies (Shenzhen) Corp." },

19972 { 0x50E478, "Sichuan AI-Link Technology Co., Ltd." },

19973 { 0x50E4E0, "Aruba, a Hewlett Packard Enterprise Company" },

19974 { 0x50E538, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

19975 { 0x50E549, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

19976 { 0x50E636, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

19977 { 0x50E666, "Shenzhen Techtion Electronics Co., Ltd." },

19978 { 0x50E7A0, "Renesas Electronics (Penang) Sdn. Bhd." },

19979 { 0x50E7B7, "vivo Mobile Communication Co., Ltd." },

19980 { 0x50E971, "Jibo, Inc." },

19981 { 0x50E9DF, "Quectel Wireless Solutions Co.,Ltd." },

19982 { 0x50EAD6, "Apple, Inc." },

19983 { 0x50EB1A, "Brocade Communications Systems LLC" },

19984 { 0x50EB71, "Intel Corporate" },

19985 { 0x50EBF6, "ASUSTek COMPUTER INC." },

19986 { 0x50EC50, "Beijing Xiaomi Mobile Software Co., Ltd" },

19987 { 0x50ED3C, "Apple, Inc." },

19988 { 0x50ED78, "Changzhou Yongse Infotech Co.,Ltd" },

19989 { 0x50ED94, "EGATEL SL" },

19990 { 0x50F003, "Open Stack, Inc." },

19991 { 0x50F0D3, "Samsung Electronics Co.,Ltd" },

19992 { 0x50F14A, "Texas Instruments" },

19993 { 0x50F222, "EM Microelectronic" },

19994 { 0x50F261, "Photon Sail Technologies" },

19995 { 0x50F43C, "Leeo Inc" },

19996 { 0x50F4EB, "Apple, Inc." },

19997 { 0x50F520, "Samsung Electronics Co.,Ltd" },

19998 { 0x50F5DA, "Amazon Technologies Inc." },

19999 { 0x50F61A, "Kunshan JADE Technologies co., Ltd." },

20000 { 0x50F722, "Cisco Systems, Inc" },

20001 { 0x50F7ED, "Huawei Device Co., Ltd." },

20002 { 0x50F8A5, "eWBM Co., Ltd." },

20003 { 0x50F908, "Wizardlab Co., Ltd." },

20004 { 0x50F958, "Huawei Device Co., Ltd." },

20005 { 0x50FA84, "TP-LINK TECHNOLOGIES CO.,LTD." },

20006 { 0x50FAAB, "L-tek d.o.o." },

20007 { 0x50FB19, "CHIPSEA TECHNOLOGIES (SHENZHEN) CORP." },

20008 { 0x50FC30, "Treehouse Labs" },

20009 { 0x50FC9F, "Samsung Electronics Co.,Ltd" },

20010 { 0x50FDD5, "SJI Industry Company" },

20011 { 0x50FE0C, "AzureWave Technology Inc." },

20012 { 0x50FEF2, "Sify Technologies Ltd" },

20013 { 0x50FF20, "Keenetic Limited" },

20014 { 0x50FF99, "IEEE Registration Authority" },

20015 { 0x540237, "Teltronic AG" },

20016 { 0x540295, "HUAWEI TECHNOLOGIES CO.,LTD" },

20017 { 0x540384, "Hongkong Nano IC Technologies Co., Ltd" },

20018 { 0x5403F5, "EBN Technology Corp." },

20019 { 0x540496, "Gigawave LTD" },

20020 { 0x5404A6, "ASUSTek COMPUTER INC." },

20021 { 0x540536, "Vivago Oy" },

20022 { 0x54055F, "Alcatel Lucent" },

20023 { 0x540593, "WOORI ELEC Co.,Ltd" },

20024 { 0x5405DB, "LCFC(HeFei) Electronics Technology co., ltd" },

20025 { 0x54068B, "Ningbo Deli Kebei Technology Co.LTD" },

20026 { 0x540764, "Huawei Device Co., Ltd." },

20027 { 0x54077D, "NETGEAR" },

20028 { 0x54083B, "IEEE Registration Authority" },

20029 { 0x540910, "Apple, Inc." },

20030 { 0x540929, "Inventus Power Eletronica do Brasil LTDA" },

20031 { 0x540955, "zte corporation" },

20032 { 0x54098D, "deister electronic GmbH" },

20033 { 0x540DF9, "Huawei Device Co., Ltd." },

20034 { 0x540E2D, "vivo Mobile Communication Co., Ltd." },

20035 { 0x540E58, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

20036 { 0x540F57, "Silicon Laboratories" },

20037 { 0x54102E, "HUAWEI TECHNOLOGIES CO.,LTD" },

20038 { 0x541031, "SMARTO" },

20039 { 0x54104F, "Samsung Electronics Co.,Ltd" },

20040 { 0x5410EC, "Microchip Technology Inc." },

20041 { 0x54112F, "Sulzer Pump Solutions Finland Oy" },

20042 { 0x541149, "vivo Mobile Communication Co., Ltd." },

20043 { 0x541159, "Nettrix Information Industry co.LTD" },

20044 { 0x54115F, "Atamo Pty Ltd" },

20045 { 0x5412CB, "HUAWEI TECHNOLOGIES CO.,LTD" },

20046 { 0x541310, "HUAWEI TECHNOLOGIES CO.,LTD" },

20047 { 0x541379, "Hon Hai Precision Ind. Co.,Ltd." },

20048 { 0x5413CA, "ITEL MOBILE LIMITED" },

20049 { 0x541473, "Wingtech Group (HongKong）Limited" },

20050 { 0x5414A7, "Nanjing Qinheng Microelectronics Co., Ltd." },

20051 { 0x5414F3, "Intel Corporate" },

20052 { 0x5414FD, "Orbbec 3D Technology International" },

20053 { 0x541589, "MCS Logic Inc." },

20054 { 0x541651, "Ruijie Networks Co.,LTD" },

20055 { 0x5419C8, "vivo Mobile Communication Co., Ltd." },

20056 { 0x541B5D, "Techno-Innov" },

20057 { 0x541D61, "YEESTOR Microelectronics Co., Ltd" },

20058 { 0x541DFB, "Freestyle Energy Ltd" },

20059 { 0x541E56, "Juniper Networks" },

20060 { 0x541F8D, "zte corporation" },

20061 { 0x541FD5, "Advantage Electronics" },

20062 { 0x542018, "Tely Labs" },

20063 { 0x54211D, "Huawei Device Co., Ltd." },

20064 { 0x542160, "Alula" },

20065 { 0x54219D, "Samsung Electronics Co.,Ltd" },

20066 { 0x5421A9, "ITEL MOBILE LIMITED" },

20067 { 0x542259, "HUAWEI TECHNOLOGIES CO.,LTD" },

20068 { 0x5422E0, "Adtran Inc" },

20069 { 0x5422F8, "zte corporation" },

20070 { 0x5425EA, "HUAWEI TECHNOLOGIES CO.,LTD" },

20071 { 0x542696, "Apple, Inc." },

20072 { 0x54271E, "AzureWave Technology Inc." },

20073 { 0x542758, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

20074 { 0x54276C, "Jiangsu Houge Technology Corp." },

20075 { 0x54278D, "NXP (China) Management Ltd." },

20076 { 0x542A1B, "Sonos, Inc." },

20077 { 0x542A9C, "LSY Defense, LLC." },

20078 { 0x542AA2, "Alpha Networks Inc." },

20079 { 0x542B57, "Night Owl SP" },

20080 { 0x542B8D, "Apple, Inc." },

20081 { 0x542BDE, "New H3C Technologies Co., Ltd" },

20082 { 0x542CEA, "PROTECTRON" },

20083 { 0x542F04, "Shanghai Longcheer Technology Co., Ltd." },

20084 { 0x542F89, "Euclid Laboratories, Inc." },

20085 { 0x542F8A, "TELLESCOM INDUSTRIA E COMERCIO EM TELECOMUNICACAO" },

20086 { 0x543131, "Raster Vision Ltd" },

20087 { 0x5431D4, "TGW Mechanics GmbH" },

20088 { 0x543204, "Espressif Inc." },

20089 { 0x5432C7, "Apple, Inc." },

20090 { 0x5433C6, "Mist Systems, Inc." },

20091 { 0x5433CB, "Apple, Inc." },

20092 { 0x5434EF, "HUAWEI TECHNOLOGIES CO.,LTD" },

20093 { 0x543530, "Hon Hai Precision Ind. Co.,Ltd." },

20094 { 0x5435DF, "Symeo GmbH" },

20095 { 0x54369B, "1Verge Internet Technology (Beijing) Co., Ltd." },

20096 { 0x5437BB, "Taicang T&W Electronics" },

20097 { 0x543968, "Edgewater Networks Inc" },

20098 { 0x5439DF, "HUAWEI TECHNOLOGIES CO.,LTD" },

20099 { 0x543AD6, "Samsung Electronics Co.,Ltd" },

20100 { 0x543B30, "duagon AG" },

20101 { 0x543D37, "Ruckus Wireless" },

20102 { 0x543D92, "WIRELESS-TEK TECHNOLOGY LIMITED" },

20103 { 0x543E64, "Fiberhome Telecommunication Technologies Co.,LTD" },

20104 { 0x5440AD, "Samsung Electronics Co.,Ltd" },

20105 { 0x544249, "Sony Corporation" },

20106 { 0x5443B2, "Espressif Inc." },

20107 { 0x544408, "Nokia Corporation" },

20108 { 0x54443B, "HUAWEI TECHNOLOGIES CO.,LTD" },

20109 { 0x5444A3, "Samsung Electronics Co.,Ltd" },

20110 { 0x544538, "Texas Instruments" },

20111 { 0x544617, "zte corporation" },

20112 { 0x54466B, "Shenzhen CZTIC Electronic Technology Co., Ltd" },

20113 { 0x544741, "XCHENG HOLDING" },

20114 { 0x5447CC, "Sagemcom Broadband SAS" },

20115 { 0x5447D3, "TSAT AS" },

20116 { 0x5447E8, "Syrotech Networks. Ltd." },

20117 { 0x544810, "Dell Inc." },

20118 { 0x54489C, "CDOUBLES ELECTRONICS CO. LTD." },

20119 { 0x5448E6, "Beijing Xiaomi Mobile Software Co., Ltd" },

20120 { 0x5449DF, "Peloton Interactive, Inc" },

20121 { 0x5449FC, "Ubee Interactive Co., Limited" },

20122 { 0x544A00, "Cisco Systems, Inc" },

20123 { 0x544A05, "wenglor sensoric gmbh" },

20124 { 0x544A16, "Texas Instruments" },

20125 { 0x544B8C, "Juniper Networks" },

20126 { 0x544C8A, "Microsoft Corporation" },

20127 { 0x544E45, "Private" },

20128 { 0x544E90, "Apple, Inc." },

20129 { 0x54511B, "HUAWEI TECHNOLOGIES CO.,LTD" },

20130 { 0x545146, "AMG Systems Ltd." },

20131 { 0x5451DE, "Cisco Systems, Inc" },

20132 { 0x545284, "Huawei Device Co., Ltd." },

20133 { 0x5453ED, "Sony Corporation" },

20134 { 0x545414, "Digital RF Corea, Inc" },

20135 { 0x5454CF, "PROBEDIGITAL CO.,LTD" },

20136 { 0x5455D5, "Huawei Device Co., Ltd." },

20137 { 0x545AA6, "Espressif Inc." },

20138 { 0x545DD9, "EDISTEC" },

20139 { 0x545EBD, "NL Technologies" },

20140 { 0x545FA7, "Jibaiyou Technology Co.,Ltd." },

20141 { 0x545FA9, "Teracom Limited" },

20142 { 0x546009, "Google, Inc." },

20143 { 0x54606D, "HUAWEI TECHNOLOGIES CO.,LTD" },

20144 { 0x546172, "ZODIAC AEROSPACE SAS" },

20145 { 0x5461EA, "Zaplox AB" },

20146 { 0x5462E2, "Apple, Inc." },

20147 { 0x5464BC, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

20148 { 0x5464D9, "Sagemcom Broadband SAS" },

20149 { 0x5464DE, "u-blox AG" },

20150 { 0x546503, "Quectel Wireless Solutions Co.,Ltd." },

20151 { 0x5465DE, "ARRIS Group, Inc." },

20152 { 0x54666C, "Shenzhen YOUHUA Technology Co., Ltd" },

20153 { 0x5466F9, "ConMet" },

20154 { 0x546706, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

20155 { 0x546751, "Compal Broadband Networks, Inc." },

20156 { 0x5467E6, "SHENZHEN MTC CO LTD" },

20157 { 0x546925, "PS INODIC CO., LTD." },

20158 { 0x546990, "HUAWEI TECHNOLOGIES CO.,LTD" },

20159 { 0x546AD8, "Elster Water Metering" },

20160 { 0x546C0E, "Texas Instruments" },

20161 { 0x546CEB, "Intel Corporate" },

20162 { 0x546D52, "TOPVIEW OPTRONICS CORP." },

20163 { 0x546F71, "uAvionix Corporation" },

20164 { 0x547068, "VTech Communications Limited" },

20165 { 0x5471DD, "Huawei Device Co., Ltd." },

20166 { 0x54724F, "Apple, Inc." },

20167 { 0x54725E, "UNION MAN TECHNOLOGY CO.,LTD" },

20168 { 0x547398, "Toyo Electronics Corporation" },

20169 { 0x5474E6, "Webtech Wireless" },

20170 { 0x547595, "TP-LINK TECHNOLOGIES CO.,LTD." },

20171 { 0x5475D0, "Cisco Systems, Inc" },

20172 { 0x5476B2, "Raisecom Technology CO., LTD" },

20173 { 0x547787, "Earda Technologies co Ltd" },

20174 { 0x54778A, "Hewlett Packard Enterprise" },

20175 { 0x54781A, "Cisco Systems, Inc" },

20176 { 0x547885, "SHENZHEN GIEC DIGITAL CO.,LTD" },

20177 { 0x5478C9, "AMPAK Technology,Inc." },

20178 { 0x547975, "Nokia Corporation" },

20179 { 0x547A52, "CTE International srl" },

20180 { 0x547C69, "Cisco Systems, Inc" },

20181 { 0x547D40, "Powervision Tech Inc." },

20182 { 0x547DCD, "Texas Instruments" },

20183 { 0x547F54, "INGENICO" },

20184 { 0x547FA8, "TELCO systems, s.r.o." },

20185 { 0x547FBC, "iodyne" },

20186 { 0x547FEE, "Cisco Systems, Inc" },

20187 { 0x548028, "Hewlett Packard Enterprise" },

20188 { 0x54812D, "PAX Computer Technology(Shenzhen) Ltd." },

20189 { 0x5481AD, "Eagle Research Corporation" },

20190 { 0x54833A, "Zyxel Communications Corporation" },

20191 { 0x54847B, "Digital Devices GmbH" },

20192 { 0x5484DC, "zte corporation" },

20193 { 0x5486BC, "Cisco Systems, Inc" },

20194 { 0x54880E, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

20195 { 0x5488DE, "Cisco Systems, Inc" },

20196 { 0x5488FE, "Xiaoniu network technology (Shanghai) Co., Ltd." },

20197 { 0x548922, "Zelfy Inc" },

20198 { 0x548998, "HUAWEI TECHNOLOGIES CO.,LTD" },

20199 { 0x548ABA, "Cisco Systems, Inc" },

20200 { 0x548C81, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

20201 { 0x548CA0, "Liteon Technology Corporation" },

20202 { 0x548D5A, "Intel Corporate" },

20203 { 0x5491AF, "IEEE Registration Authority" },

20204 { 0x549209, "HUAWEI TECHNOLOGIES CO.,LTD" },

20205 { 0x5492BE, "Samsung Electronics Co.,Ltd" },

20206 { 0x549359, "SHENZHEN TWOWING TECHNOLOGIES CO.,LTD." },

20207 { 0x549478, "Silvershore Technology Partners" },

20208 { 0x549963, "Apple, Inc." },

20209 { 0x549A11, "IEEE Registration Authority" },

20210 { 0x549A16, "Uzushio Electric Co.,Ltd." },

20211 { 0x549A4C, "GUANGDONG HOMECARE TECHNOLOGY CO.,LTD." },

20212 { 0x549A8F, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

20213 { 0x549B12, "Samsung Electronics Co.,Ltd" },

20214 { 0x549B49, "NEC Platforms, Ltd." },

20215 { 0x549B72, "Ericsson AB" },

20216 { 0x549C27, "Plasma Cloud Limited" },

20217 { 0x549D85, "EnerAccess inc" },

20218 { 0x549F06, "Nokia Shanghai Bell Co., Ltd." },

20219 { 0x549F13, "Apple, Inc." },

20220 { 0x549F35, "Dell Inc." },

20221 { 0x549FAE, "iBASE Gaming Inc" },

20222 { 0x549FC6, "Cisco Systems, Inc" },

20223 { 0x54A04F, "t-mac Technologies Ltd" },

20224 { 0x54A050, "ASUSTek COMPUTER INC." },

20225 { 0x54A274, "Cisco Systems, Inc" },

20226 { 0x54A31B, "Shenzhen Linkworld Technology Co,.LTD" },

20227 { 0x54A3FA, "BQT Solutions (Australia)Pty Ltd" },

20228 { 0x54A493, "IEEE Registration Authority" },

20229 { 0x54A51B, "HUAWEI TECHNOLOGIES CO.,LTD" },

20230 { 0x54A54B, "NSC Communications Siberia Ltd" },

20231 { 0x54A619, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

20232 { 0x54A65C, "Vantiva USA LLC" },

20233 { 0x54A6DB, "Huawei Device Co., Ltd." },

20234 { 0x54A703, "TP-LINK TECHNOLOGIES CO.,LTD." },

20235 { 0x54A7A0, "HUNAN AIMAG INTELLIGENT TECHNOLOGY CO.,LTD" },

20236 { 0x54A9C8, "Home Control Singapore Pte Ltd" },

20237 { 0x54A9D4, "Minibar Systems" },

20238 { 0x54AB3A, "Quanta Computer Inc." },

20239 { 0x54ACFC, "LIZN ApS" },

20240 { 0x54AE27, "Apple, Inc." },

20241 { 0x54AED0, "DASAN Networks, Inc." },

20242 { 0x54AED2, "CSL Dualcom Ltd" },

20243 { 0x54AF97, "TP-Link Corporation Limited" },

20244 { 0x54B121, "HUAWEI TECHNOLOGIES CO.,LTD" },

20245 { 0x54B203, "PEGATRON CORPORATION" },

20246 { 0x54B56C, "Xi'an NovaStar Tech Co., Ltd" },

20247 { 0x54B620, "SUHDOL E&C Co.Ltd." },

20248 { 0x54B753, "Hunan Fenghui Yinjia Science And Technology Co.,Ltd" },

20249 { 0x54B7BD, "Arcadyan Corporation" },

20250 { 0x54B7E5, "Rayson Technology Co., Ltd." },

20251 { 0x54B802, "Samsung Electronics Co.,Ltd" },

20252 { 0x54B80A, "D-Link International" },

20253 { 0x54B874, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

20254 { 0x54BAD6, "HUAWEI TECHNOLOGIES CO.,LTD" },

20255 { 0x54BD79, "Samsung Electronics Co.,Ltd" },

20256 { 0x54BE53, "zte corporation" },

20257 { 0x54BEF7, "PEGATRON CORPORATION" },

20258 { 0x54BF64, "Dell Inc." },

20259 { 0x54C078, "Infinix mobility limited" },

20260 { 0x54C250, "Iskratel d.o.o." },

20261 { 0x54C33E, "Ciena Corporation" },

20262 { 0x54C415, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

20263 { 0x54C45B, "Arcadyan Corporation" },

20264 { 0x54C480, "HUAWEI TECHNOLOGIES CO.,LTD" },

20265 { 0x54C57A, "Sunnovo International Limited" },

20266 { 0x54C6A6, "Hubei Yangtze Mason Semiconductor Technology Co., Ltd." },

20267 { 0x54C6FF, "New H3C Technologies Co., Ltd" },

20268 { 0x54C80F, "TP-LINK TECHNOLOGIES CO.,LTD." },

20269 { 0x54C9DF, "FN-LINK TECHNOLOGY LIMITED" },

20270 { 0x54CD10, "Panasonic Mobile Communications Co.,Ltd." },

20271 { 0x54CDA7, "Fujian Shenzhou Electronic Co.,Ltd" },

20272 { 0x54CDEE, "ShenZhen Apexis Electronic Co.,Ltd" },

20273 { 0x54CE69, "Hikari Trading Co.,Ltd." },

20274 { 0x54CE82, "zte corporation" },

20275 { 0x54CF8D, "HUAWEI TECHNOLOGIES CO.,LTD" },

20276 { 0x54D0B4, "Xiamen Four-Faith Communication Technology Co.,Ltd" },

20277 { 0x54D0ED, "AXIM Communications" },

20278 { 0x54D163, "MAX-TECH,INC" },

20279 { 0x54D17D, "Samsung Electronics Co.,Ltd" },

20280 { 0x54D1B0, "Universal Laser Systems, Inc" },

20281 { 0x54D272, "Nuki Home Solutions GmbH" },

20282 { 0x54D46F, "Cisco SPVTG" },

20283 { 0x54D60D, "Hangzhou Ezviz Software Co.,Ltd." },

20284 { 0x54D751, "Proximus" },

20285 { 0x54D7E3, "Aruba, a Hewlett Packard Enterprise Company" },

20286 { 0x54D9C6, "Huawei Device Co., Ltd." },

20287 { 0x54D9E4, "BRILLIANTTS CO., LTD" },

20288 { 0x54DBA2, "Fibrain" },

20289 { 0x54DC1D, "Yulong Computer Telecommunication Scientific (Shenzhen) Co.,Ltd" },

20290 { 0x54DED0, "Sevio Srl" },

20291 { 0x54DED3, "zte corporation" },

20292 { 0x54DF00, "Ulterius Technologies, LLC" },

20293 { 0x54DF1B, "Vestel Elektronik San ve Tic. A.S." },

20294 { 0x54DF24, "Fiberhome Telecommunication Technologies Co.,LTD" },

20295 { 0x54DF63, "Intrakey technologies GmbH" },

20296 { 0x54E005, "Fiberhome Telecommunication Technologies Co.,LTD" },

20297 { 0x54E019, "Ring LLC" },

20298 { 0x54E032, "Juniper Networks" },

20299 { 0x54E061, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

20300 { 0x54E140, "INGENICO" },

20301 { 0x54E15B, "Huawei Device Co., Ltd." },

20302 { 0x54E1AD, "LCFC(HeFei) Electronics Technology co., ltd" },

20303 { 0x54E1B6, "Renesas Electronics (Penang) Sdn. Bhd." },

20304 { 0x54E2C8, "Dongguan Aoyuan Electronics Technology Co., Ltd" },

20305 { 0x54E2E0, "ARRIS Group, Inc." },

20306 { 0x54E3B0, "JVL Industri Elektronik" },

20307 { 0x54E3F6, "Alcatel-Lucent" },

20308 { 0x54E43A, "Apple, Inc." },

20309 { 0x54E4A9, "BHR Tech GmbH" },

20310 { 0x54E4BD, "FN-LINK TECHNOLOGY LIMITED" },

20311 { 0x54E61B, "Apple, Inc." },

20312 { 0x54E63F, "ShenZhen LingKeWeiEr Technology Co., Ltd." },

20313 { 0x54E6FC, "TP-LINK TECHNOLOGIES CO.,LTD." },

20314 { 0x54E7D5, "Sun Cupid Technology (HK) LTD" },

20315 { 0x54EAA8, "Apple, Inc." },

20316 { 0x54EBE9, "Apple, Inc." },

20317 { 0x54EC2F, "Ruckus Wireless" },

20318 { 0x54ECB0, "Sercomm France Sarl" },

20319 { 0x54EDA3, "Navdy, Inc." },

20320 { 0x54EE75, "Wistron InfoComm(Kunshan)Co.,Ltd." },

20321 { 0x54EF33, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

20322 { 0x54EF43, "HUAWEI TECHNOLOGIES CO.,LTD" },

20323 { 0x54EF44, "Lumi United Technology Co., Ltd" },

20324 { 0x54EF92, "Shenzhen Elink Technology Co., LTD" },

20325 { 0x54EFFE, "Fullpower Technologies, Inc." },

20326 { 0x54F0B1, "Aruba, a Hewlett Packard Enterprise Company" },

20327 { 0x54F15F, "Sichuan AI-Link Technology Co., Ltd." },

20328 { 0x54F201, "Samsung Electronics Co.,Ltd" },

20329 { 0x54F294, "Huawei Device Co., Ltd." },

20330 { 0x54F29F, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

20331 { 0x54F5B6, "ORIENTAL PACIFIC INTERNATIONAL LIMITED" },

20332 { 0x54F607, "Huawei Device Co., Ltd." },

20333 { 0x54F666, "Berthold Technologies GmbH and Co.KG" },

20334 { 0x54F6C5, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

20335 { 0x54F6E2, "HUAWEI TECHNOLOGIES CO.,LTD" },

20336 { 0x54F82A, "u-blox AG" },

20337 { 0x54F876, "ABB AG" },

20338 { 0x54F8F0, "Tesla Inc" },

20339 { 0x54FA3E, "Samsung Electronics Co.,Ltd" },

20340 { 0x54FA96, "Nokia Solutions and Networks GmbH & Co. KG" },

20341 { 0x54FB58, "WISEWARE, Lda" },

20342 { 0x54FCF0, "Samsung Electronics Co.,Ltd" },

20343 { 0x54FDBF, "Scheidt & Bachmann GmbH" },

20344 { 0x54FF82, "Davit Solution co." },

20345 { 0x54FFCF, "Mopria Alliance" },

20346 { 0x580032, "Genexis B.V." },

20347 { 0x5800BB, "Juniper Networks" },

20348 { 0x5800E3, "Liteon Technology Corporation" },

20349 { 0x5803FB, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

20350 { 0x580454, "ICOMM HK LIMITED" },

20351 { 0x5804CB, "Tianjin Huisun Technology Co.,Ltd." },

20352 { 0x580528, "LABRIS NETWORKS" },

20353 { 0x580556, "Elettronica GF S.r.L." },

20354 { 0x5807F8, "Nokia Solutions and Networks GmbH & Co. KG" },

20355 { 0x5808FA, "Fiber Optic & telecommunication INC." },

20356 { 0x580943, "Private" },

20357 { 0x5809E5, "Kivic Inc." },

20358 { 0x580A20, "Cisco Systems, Inc" },

20359 { 0x580AD4, "Apple, Inc." },

20360 { 0x581031, "Hon Hai Precision IND.CO.,LTD" },

20361 { 0x58108C, "Intelbras" },

20362 { 0x5810B7, "Infinix mobility limited" },

20363 { 0x581122, "ASUSTek COMPUTER INC." },

20364 { 0x581243, "AcSiP Technology Corp." },

20365 { 0x5813D3, "Gemtek Technology Co., Ltd." },

20366 { 0x581626, "Avaya Inc" },

20367 { 0x5816D7, "ALPSALPINE CO,.LTD" },

20368 { 0x58170C, "Sony Corporation" },

20369 { 0x5819F8, "ARRIS Group, Inc." },

20370 { 0x581CBD, "Affinegy" },

20371 { 0x581CF8, "Intel Corporate" },

20372 { 0x581D91, "Advanced Mobile Telecom co.,ltd." },

20373 { 0x581DC9, "MSE CO.,LTD." },

20374 { 0x581DD8, "Sagemcom Broadband SAS" },

20375 { 0x581F28, "HUAWEI TECHNOLOGIES CO.,LTD" },

20376 { 0x581F67, "Open-m technology limited" },

20377 { 0x581FAA, "Apple, Inc." },

20378 { 0x581FEF, "Tuttnaer LTD" },

20379 { 0x582059, "Xiaomi Communications Co Ltd" },

20380 { 0x582071, "Samsung Electronics Co.,Ltd" },

20381 { 0x58208A, "IEEE Registration Authority" },

20382 { 0x5820B1, "Hewlett Packard" },

20383 { 0x582136, "KMB systems, s.r.o." },

20384 { 0x5821E9, "TWPI" },

20385 { 0x58238C, "Vantiva USA LLC" },

20386 { 0x582429, "Google, Inc." },

20387 { 0x582575, "HUAWEI TECHNOLOGIES CO.,LTD" },

20388 { 0x58278C, "BUFFALO.INC" },

20389 { 0x582AF7, "HUAWEI TECHNOLOGIES CO.,LTD" },

20390 { 0x582B0A, "Texas Instruments" },

20391 { 0x582BDB, "Pax AB" },

20392 { 0x582D34, "Qingping Electronics (Suzhou) Co., Ltd" },

20393 { 0x582EFE, "Lighting Science Group" },

20394 { 0x582F40, "Nintendo Co.,Ltd" },

20395 { 0x582F42, "Universal Electric Corporation" },

20396 { 0x582FF7, "Sagemcom Broadband SAS" },

20397 { 0x58305B, "Shanghai Junqian Sensing Technology Co.,LTD" },

20398 { 0x58306E, "Nokia" },

20399 { 0x583112, "DRUST" },

20400 { 0x583277, "Reliance Communications LLC" },

20401 { 0x58343B, "Glovast Technology Ltd." },

20402 { 0x58350F, "EM Microelectronic" },

20403 { 0x583526, "DEEPLET TECHNOLOGY CORP" },

20404 { 0x58355D, "Huawei Device Co., Ltd." },

20405 { 0x58356B, "TECNO MOBILE LIMITED" },

20406 { 0x5835D9, "Cisco Systems, Inc" },

20407 { 0x583653, "Apple, Inc." },

20408 { 0x583879, "RICOH COMPANY, LTD." },

20409 { 0x583BC2, "Silicon Laboratories" },

20410 { 0x583BD9, "Fiberhome Telecommunication Technologies Co.,LTD" },

20411 { 0x583CC6, "Omneality Ltd." },

20412 { 0x583F54, "LG Electronics (Mobile Communications)" },

20413 { 0x58404E, "Apple, Inc." },

20414 { 0x584120, "TP-LINK TECHNOLOGIES CO.,LTD." },

20415 { 0x5842E4, "Baxter International Inc" },

20416 { 0x5843AB, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

20417 { 0x584498, "Xiaomi Communications Co Ltd" },

20418 { 0x58454C, "Ericsson AB" },

20419 { 0x58468F, "Koncar Electronics and Informatics" },

20420 { 0x5846E1, "Baxter International Inc" },

20421 { 0x584704, "Shenzhen Webridge Technology Co.,Ltd" },

20422 { 0x5847CA, "IEEE Registration Authority" },

20423 { 0x584822, "Sony Corporation" },

20424 { 0x584849, "IEEE Registration Authority" },

20425 { 0x5848C0, "COFLEC" },

20426 { 0x584925, "E3 Enterprise" },

20427 { 0x58493B, "Palo Alto Networks" },

20428 { 0x5849BA, "Chitai Electronic Corp." },

20429 { 0x584C19, "Chongqing Guohong Technology Development Company Limited" },

20430 { 0x584CEE, "Digital One Technologies, Limited" },

20431 { 0x584D42, "Dragos, Inc." },

20432 { 0x585076, "Linear Equipamentos Eletronicos SA" },

20433 { 0x5850AB, "TLS Corporation" },

20434 { 0x5850E6, "Best Buy Corporation" },

20435 { 0x5850ED, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

20436 { 0x58528A, "Mitsubishi Electric Corporation" },

20437 { 0x5853C0, "Beijing Guang Runtong Technology Development Company co.,Ltd" },

20438 { 0x585595, "Apple, Inc." },

20439 { 0x5855CA, "Apple, Inc." },

20440 { 0x58569F, "Cisco Systems, Inc" },

20441 { 0x5856C2, "HUAWEI TECHNOLOGIES CO.,LTD" },

20442 { 0x5856E8, "ARRIS Group, Inc." },

20443 { 0x58570D, "Danfoss Solar Inverters" },

20444 { 0x5858CD, "Extreme Networks Headquarters" },

20445 { 0x5859C2, "Extreme Networks Headquarters" },

20446 { 0x585B69, "TVT CO., LTD" },

20447 { 0x585FF6, "zte corporation" },

20448 { 0x58605F, "HUAWEI TECHNOLOGIES CO.,LTD" },

20449 { 0x5860D8, "ARRIS Group, Inc." },

20450 { 0x586163, "Quantum Networks (SG) Pte. Ltd." },

20451 { 0x586356, "FN-LINK TECHNOLOGY LIMITED" },

20452 { 0x58639A, "TPL SYSTEMES" },

20453 { 0x5864C4, "Apple, Inc." },

20454 { 0x5865E6, "infomark" },

20455 { 0x5866BA, "Hangzhou H3C Technologies Co., Limited" },

20456 { 0x58671A, "Barnes&Noble" },

20457 { 0x58677F, "Clare Controls Inc." },

20458 { 0x58685D, "Tempo Australia Pty Ltd" },

20459 { 0x586861, "VIASAT, INCORPORATED" },

20460 { 0x58687A, "Sagemcom Broadband SAS" },

20461 { 0x58696C, "Ruijie Networks Co.,LTD" },

20462 { 0x5869F9, "Fusion Transactive Ltd." },

20463 { 0x586AB1, "Hangzhou H3C Technologies Co., Limited" },

20464 { 0x586B14, "Apple, Inc." },

20465 { 0x586C25, "Intel Corporate" },

20466 { 0x586D67, "Intel Corporate" },

20467 { 0x586D8F, "Cisco-Linksys, LLC" },

20468 { 0x586ED6, "Private" },

20469 { 0x58707F, "Ericsson AB" },

20470 { 0x5870C6, "Shanghai Xiaoyi Technology Co., Ltd." },

20471 { 0x5873D1, "HUAWEI TECHNOLOGIES CO.,LTD" },

20472 { 0x5873D8, "Apple, Inc." },

20473 { 0x587521, "CJSC RTSoft" },

20474 { 0x587675, "Beijing ECHO Technologies Co.,Ltd" },

20475 { 0x5876AC, "SERNET (SUZHOU) TECHNOLOGIES CORPORATION" },

20476 { 0x5876B3, "Ubee Interactive Co., Limited" },

20477 { 0x5876C5, "DIGI I'S LTD" },

20478 { 0x587A4D, "Stonesoft Corporation" },

20479 { 0x587A62, "Texas Instruments" },

20480 { 0x587A6A, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

20481 { 0x587BE9, "AirPro Technology India Pvt. Ltd" },

20482 { 0x587DB6, "Northern Data AG" },

20483 { 0x587E61, "Qingdao Hisense Communications Co.,Ltd." },

20484 { 0x587F57, "Apple, Inc." },

20485 { 0x587F66, "HUAWEI TECHNOLOGIES CO.,LTD" },

20486 { 0x587FB7, "SONAR INDUSTRIAL CO., LTD." },

20487 { 0x587FC8, "S2M" },

20488 { 0x58821D, "H. Schomäcker GmbH" },

20489 { 0x5882A8, "Microsoft" },

20490 { 0x5884E4, "IP500 Alliance e.V." },

20491 { 0x58856E, "QSC AG" },

20492 { 0x5885A2, "Realme Chongqing MobileTelecommunications Corp Ltd" },

20493 { 0x5885E9, "Realme Chongqing MobileTelecommunications Corp Ltd" },

20494 { 0x588694, "EFM Networks" },

20495 { 0x58874C, "LITE-ON CLEAN ENERGY TECHNOLOGY CORP." },

20496 { 0x58879F, "Huawei Device Co., Ltd." },

20497 { 0x5887E2, "Shenzhen Coship Electronics Co., Ltd." },

20498 { 0x588A5A, "Dell Inc." },

20499 { 0x588B1C, "Cisco Systems, Inc" },

20500 { 0x588BF3, "Zyxel Communications Corporation" },

20501 { 0x588D09, "Cisco Systems, Inc" },

20502 { 0x588D64, "Xi'an Clevbee Technology Co.,Ltd" },

20503 { 0x588E81, "Silicon Laboratories" },

20504 { 0x588FCF, "Hangzhou Ezviz Software Co.,Ltd." },

20505 { 0x589043, "Sagemcom Broadband SAS" },

20506 { 0x589153, "China Mobile IOT Company Limited" },

20507 { 0x5891CF, "Intel Corporate" },

20508 { 0x58920D, "Kinetic Avionics Limited" },

20509 { 0x589351, "Huawei Device Co., Ltd." },

20510 { 0x589396, "Ruckus Wireless" },

20511 { 0x5893D8, "Texas Instruments" },

20512 { 0x58946B, "Intel Corporate" },

20513 { 0x5894A2, "KETEK GmbH" },

20514 { 0x5894AE, "Huawei Device Co., Ltd." },

20515 { 0x5894B2, "BrainCo" },

20516 { 0x5894CF, "Vertex Standard LMR, Inc." },

20517 { 0x58957E, "Huawei Device Co., Ltd." },

20518 { 0x5895D8, "IEEE Registration Authority" },

20519 { 0x58961D, "Intel Corporate" },

20520 { 0x589630, "Vantiva USA LLC" },

20521 { 0x589671, "Wistron Neweb Corporation" },

20522 { 0x58971E, "Cisco Systems, Inc" },

20523 { 0x5897BD, "Cisco Systems, Inc" },

20524 { 0x589835, "Technicolor Delivery Technologies Belgium NV" },

20525 { 0x58986F, "Revolution Display" },

20526 { 0x589A3E, "Amazon Technologies Inc." },

20527 { 0x589B0B, "Shineway Technologies, Inc." },

20528 { 0x589B4A, "DWnet Technologies(Suzhou) Corporation" },

20529 { 0x589BF7, "Hefei Radio Communication Technology Co., Ltd" },

20530 { 0x589CFC, "FreeBSD Foundation" },

20531 { 0x589EC6, "Gigaset Communications GmbH" },

20532 { 0x58A023, "Intel Corporate" },

20533 { 0x58A0CB, "TrackNet, Inc" },

20534 { 0x58A15F, "Texas Instruments" },

20535 { 0x58A2B5, "LG Electronics (Mobile Communications)" },

20536 { 0x58A2E1, "Mellanox Technologies, Inc." },

20537 { 0x58A48E, "PixArt Imaging Inc." },

20538 { 0x58A639, "Samsung Electronics Co.,Ltd" },

20539 { 0x58A76F, "iD corporation" },

20540 { 0x58A839, "Intel Corporate" },

20541 { 0x58A87B, "Fitbit, Inc." },

20542 { 0x58AC78, "Cisco Systems, Inc" },

20543 { 0x58AD12, "Apple, Inc." },

20544 { 0x58AE2B, "Huawei Device Co., Ltd." },

20545 { 0x58AEA8, "HUAWEI TECHNOLOGIES CO.,LTD" },

20546 { 0x58AEF1, "Fiberhome Telecommunication Technologies Co.,LTD" },

20547 { 0x58B035, "Apple, Inc." },

20548 { 0x58B03E, "Nintendo Co.,Ltd" },

20549 { 0x58B0D4, "ZuniData Systems Inc." },

20550 { 0x58B0FE, "Team EPS GmbH" },

20551 { 0x58B10F, "Samsung Electronics Co.,Ltd" },

20552 { 0x58B38F, "New H3C Technologies Co., Ltd" },

20553 { 0x58B3FC, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

20554 { 0x58B42D, "YSTen Technology Co.,Ltd" },

20555 { 0x58B568, "SECURITAS DIRECT ESPAÑA, SAU" },

20556 { 0x58B623, "Beijing Xiaomi Mobile Software Co., Ltd" },

20557 { 0x58B633, "Ruckus Wireless" },

20558 { 0x58B961, "SOLEM Electronique" },

20559 { 0x58B965, "Apple, Inc." },

20560 { 0x58B9E1, "Crystalfontz America, Inc." },

20561 { 0x58BAD3, "NANJING CASELA TECHNOLOGIES CORPORATION LIMITED" },

20562 { 0x58BAD4, "HUAWEI TECHNOLOGIES CO.,LTD" },

20563 { 0x58BC27, "Cisco Systems, Inc" },

20564 { 0x58BC8F, "Cognitive Systems Corp." },

20565 { 0x58BDA3, "Nintendo Co., Ltd." },

20566 { 0x58BDF9, "Sigrand" },

20567 { 0x58BE72, "HUAWEI TECHNOLOGIES CO.,LTD" },

20568 { 0x58BF25, "Espressif Inc." },

20569 { 0x58BFEA, "Cisco Systems, Inc" },

20570 { 0x58C17A, "Cambium Networks Limited" },

20571 { 0x58C232, "NEC Corporation" },

20572 { 0x58C356, "EM Microelectronic" },

20573 { 0x58C38B, "Samsung Electronics Co.,Ltd" },

20574 { 0x58C41E, "IEEE Registration Authority" },

20575 { 0x58C57E, "Fiberhome Telecommunication Technologies Co.,LTD" },

20576 { 0x58C583, "ITEL MOBILE LIMITED" },

20577 { 0x58C5CB, "Samsung Electronics Co.,Ltd" },

20578 { 0x58C6F0, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

20579 { 0x58C7AC, "New H3C Technologies Co., Ltd" },

20580 { 0x58C876, "China Mobile (Hangzhou) Information Technology Co., Ltd." },

20581 { 0x58C935, "Chiun Mai Communication System, Inc" },

20582 { 0x58CB52, "Google, Inc." },

20583 { 0x58CDC9, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

20584 { 0x58CE2A, "Intel Corporate" },

20585 { 0x58CF4B, "Lufkin Industries" },

20586 { 0x58CF79, "Espressif Inc." },

20587 { 0x58D061, "HUAWEI TECHNOLOGIES CO.,LTD" },

20588 { 0x58D071, "BW Broadcast" },

20589 { 0x58D08F, "IEEE 1904.1 Working Group" },

20590 { 0x58D237, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

20591 { 0x58D312, "zte corporation" },

20592 { 0x58D349, "Apple, Inc." },

20593 { 0x58D391, "Quectel Wireless Solutions Co.,Ltd." },

20594 { 0x58D50A, "Murata Manufacturing Co., Ltd." },

20595 { 0x58D56E, "D-Link International" },

20596 { 0x58D67A, "TCPlink" },

20597 { 0x58D697, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

20598 { 0x58D6D3, "Dairy Cheq Inc" },

20599 { 0x58D759, "HUAWEI TECHNOLOGIES CO.,LTD" },

20600 { 0x58D8A7, "Bird Home Automation GmbH" },

20601 { 0x58D9C3, "Motorola Mobility LLC, a Lenovo Company" },

20602 { 0x58D9D5, "Tenda Technology Co.,Ltd.Dongguan branch" },

20603 { 0x58DB15, "TECNO MOBILE LIMITED" },

20604 { 0x58DB8D, "Fast Co., Ltd." },

20605 { 0x58DC6D, "Exceptional Innovation, Inc." },

20606 { 0x58E02C, "Micro Technic A/S" },

20607 { 0x58E16C, "Ying Hua Information Technology (Shanghai)Co., LTD" },

20608 { 0x58E28F, "Apple, Inc." },

20609 { 0x58E326, "Compass Technologies Inc." },

20610 { 0x58E359, "Interroll Software & Electronics GmbH" },

20611 { 0x58E403, "Wistron Neweb Corporation" },

20612 { 0x58E434, "Juniper Networks" },

20613 { 0x58E476, "CENTRON COMMUNICATIONS TECHNOLOGIES FUJIAN CO.,LTD" },

20614 { 0x58E488, "Amazon Technologies Inc." },

20615 { 0x58E636, "EVRsafe Technologies" },

20616 { 0x58E6BA, "Apple, Inc." },

20617 { 0x58E747, "Deltanet AG" },

20618 { 0x58E808, "AUTONICS CORPORATION" },

20619 { 0x58E873, "HANGZHOU DANGBEI NETWORK TECH.Co.,Ltd" },

20620 { 0x58E876, "IEEE Registration Authority" },

20621 { 0x58EAFC, "ELL-IoT Inc" },

20622 { 0x58EB14, "Proteus Digital Health" },

20623 { 0x58ECE1, "Newport Corporation" },

20624 { 0x58ECED, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

20625 { 0x58EECE, "Icon Time Systems" },

20626 { 0x58EF68, "Belkin International Inc." },

20627 { 0x58F102, "BLU Products Inc." },

20628 { 0x58F2FC, "Huawei Device Co., Ltd." },

20629 { 0x58F387, "Airios" },

20630 { 0x58F39C, "Cisco Systems, Inc" },

20631 { 0x58F496, "Source Chain" },

20632 { 0x58F67B, "Xia Men UnionCore Technology LTD." },

20633 { 0x58F6BF, "Kyoto University" },

20634 { 0x58F85C, "LLC Proizvodstvennaya Kompania TransService" },

20635 { 0x58F8D7, "HUAWEI TECHNOLOGIES CO.,LTD" },

20636 { 0x58F987, "HUAWEI TECHNOLOGIES CO.,LTD" },

20637 { 0x58F98E, "SECUDOS GmbH" },

20638 { 0x58FB84, "Intel Corporate" },

20639 { 0x58FB96, "Ruckus Wireless" },

20640 { 0x58FC20, "Altice Labs S.A." },

20641 { 0x58FC73, "Arria Live Media, Inc." },

20642 { 0x58FCC6, "TOZO INC" },

20643 { 0x58FCC8, "LenelS2 Carrier" },

20644 { 0x58FCDB, "IEEE Registration Authority" },

20645 { 0x58FD20, "Systemhouse Solutions AB" },

20646 { 0x58FD5D, "Hangzhou Xinyun technology Co., Ltd." },

20647 { 0x58FDB1, "LG Electronics" },

20648 { 0x58FDBE, "Shenzhen Taikaida Technology Co., Ltd" },

20649 { 0x58FFA1, "zte corporation" },

20650 { 0x5C0038, "Viasat Group S.p.A." },

20651 { 0x5C0214, "Beijing Xiaomi Mobile Software Co., Ltd" },

20652 { 0x5C026A, "Applied Vision Corporation" },

20653 { 0x5C0272, "Silicon Laboratories" },

20654 { 0x5C0339, "HUAWEI TECHNOLOGIES CO.,LTD" },

20655 { 0x5C045A, "Company NA Stage & Light" },

20656 { 0x5C0758, "Ufispace Co., LTD." },

20657 { 0x5C076F, "Thought Creator" },

20658 { 0x5C07A4, "Ciena Corporation" },

20659 { 0x5C07A6, "HUAWEI TECHNOLOGIES CO.,LTD" },

20660 { 0x5C0947, "Apple, Inc." },

20661 { 0x5C0979, "HUAWEI TECHNOLOGIES CO.,LTD" },

20662 { 0x5C0A5B, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

20663 { 0x5C0BCA, "Tunstall Nordic AB" },

20664 { 0x5C0C0E, "Guizhou Huaxintong Semiconductor Technology Co Ltd" },

20665 { 0x5C0CBB, "CELIZION Inc." },

20666 { 0x5C0CE6, "Nintendo Co.,Ltd" },

20667 { 0x5C0E8B, "Extreme Networks Headquarters" },

20668 { 0x5C0FFB, "Amino Communications Ltd" },

20669 { 0x5C101E, "zte corporation" },

20670 { 0x5C10C5, "Samsung Electronics Co.,Ltd" },

20671 { 0x5C1193, "Seal One AG" },

20672 { 0x5C1437, "Thyssenkrupp Aufzugswerke GmbH" },

20673 { 0x5C1515, "ADVAN" },

20674 { 0x5C15E1, "AIDC TECHNOLOGY (S) PTE LTD" },

20675 { 0x5C1648, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

20676 { 0x5C167D, "HUAWEI TECHNOLOGIES CO.,LTD" },

20677 { 0x5C16C7, "Arista Networks" },

20678 { 0x5C1720, "Huawei Device Co., Ltd." },

20679 { 0x5C1737, "I-View Now, LLC." },

20680 { 0x5C17CF, "OnePlus Technology (Shenzhen) Co., Ltd" },

20681 { 0x5C17D3, "LGE" },

20682 { 0x5C18B5, "Talon Communications" },

20683 { 0x5C1A6F, "Cambridge Industries(Group) Co.,Ltd." },

20684 { 0x5C1BF4, "Apple, Inc." },

20685 { 0x5C1CB9, "vivo Mobile Communication Co., Ltd." },

20686 { 0x5C1DD9, "Apple, Inc." },

20687 { 0x5C20D0, "Asoni Communication Co., Ltd." },

20688 { 0x5C2167, "Rockwell Automation" },

20689 { 0x5C22C4, "DAE EUN ELETRONICS CO., LTD" },

20690 { 0x5C22DA, "Vantiva USA LLC" },

20691 { 0x5C2316, "Squirrels Research Labs LLC" },

20692 { 0x5C2443, "O-Sung Telecom Co., Ltd." },

20693 { 0x5C2479, "Baltech AG" },

20694 { 0x5C24E2, "Suzhou Denbom Electronic S&T Co., Ltd" },

20695 { 0x5C254C, "Avire Global Pte Ltd" },

20696 { 0x5C2573, "Mellanox Technologies, Inc." },

20697 { 0x5C260A, "Dell Inc." },

20698 { 0x5C2623, "WaveLynx Technologies Corporation" },

20699 { 0x5C2763, "Itibia Technologies" },

20700 { 0x5C27D4, "Shenzhen Qihu Intelligent Technology Company Limited" },

20701 { 0x5C2886, "Inventec(Chongqing) Corporation" },

20702 { 0x5C2AEF, "r2p Asia-Pacific Pty Ltd" },

20703 { 0x5C2BF5, "Vivint Wireless Inc." },

20704 { 0x5C2E59, "Samsung Electronics Co.,Ltd" },

20705 { 0x5C2ED2, "ABC(XiSheng) Electronics Co.,Ltd" },

20706 { 0x5C2FAF, "HomeWizard B.V." },

20707 { 0x5C313E, "Texas Instruments" },

20708 { 0x5C3192, "Cisco Systems, Inc" },

20709 { 0x5C32C5, "Teracom Ltd." },

20710 { 0x5C3327, "Spazio Italia srl" },

20711 { 0x5C335C, "Swissphone Telecom AG" },

20712 { 0x5C337B, "Google, Inc." },

20713 { 0x5C338E, "Alpha Networks Inc." },

20714 { 0x5C3400, "Hisense Electric Co.,Ltd" },

20715 { 0x5C345B, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

20716 { 0x5C353B, "Compal Broadband Networks, Inc." },

20717 { 0x5C35DA, "There Corporation Oy" },

20718 { 0x5C36B8, "TCL King Electrical Appliances (Huizhou) Co., Ltd" },

20719 { 0x5C38E0, "Shanghai Super Electronics Technology Co.,LTD" },

20720 { 0x5C3A3D, "zte corporation" },

20721 { 0x5C3A45, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

20722 { 0x5C3B35, "Gehirn Inc." },

20723 { 0x5C3C27, "Samsung Electronics Co.,Ltd" },

20724 { 0x5C3E06, "Cisco Systems, Inc" },

20725 { 0x5C3E1B, "Apple, Inc." },

20726 { 0x5C4058, "Jefferson Audio Video Systems, Inc." },

20727 { 0x5C415A, "Amazon.com, LLC" },

20728 { 0x5C41E7, "Wiatec International Ltd." },

20729 { 0x5C43D2, "HAZEMEYER" },

20730 { 0x5C443E, "Skullcandy" },

20731 { 0x5C4527, "Juniper Networks" },

20732 { 0x5C46B0, "SIMCom Wireless Solutions Limited" },

20733 { 0x5C475E, "Ring LLC" },

20734 { 0x5C4979, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

20735 { 0x5C497D, "Samsung Electronics Co.,Ltd" },

20736 { 0x5C49FA, "Shenzhen Guowei Shidai Communication Equipement Co., Ltd" },

20737 { 0x5C4A1F, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

20738 { 0x5C4A26, "Enguity Technology Corp" },

20739 { 0x5C4CA9, "HUAWEI TECHNOLOGIES CO.,LTD" },

20740 { 0x5C4DBF, "zte corporation" },

20741 { 0x5C5015, "Cisco Systems, Inc" },

20742 { 0x5C50D9, "Apple, Inc." },

20743 { 0x5C514F, "Intel Corporate" },

20744 { 0x5C5181, "Samsung Electronics Co.,Ltd" },

20745 { 0x5C5188, "Motorola Mobility LLC, a Lenovo Company" },

20746 { 0x5C521E, "Nintendo Co.,Ltd" },

20747 { 0x5C5230, "Apple, Inc." },

20748 { 0x5C5284, "Apple, Inc." },

20749 { 0x5C5310, "Nanjing Qinheng Microelectronics Co., Ltd." },

20750 { 0x5C53B4, "EM Microelectronic" },

20751 { 0x5C53C3, "Ubee Interactive Co., Limited" },

20752 { 0x5C546D, "HUAWEI TECHNOLOGIES CO.,LTD" },

20753 { 0x5C5578, "iryx corp" },

20754 { 0x5C56A4, "Wanan Hongsheng Electronic Co.Ltd" },

20755 { 0x5C56ED, "3pleplay Electronics Private Limited" },

20756 { 0x5C571A, "ARRIS Group, Inc." },

20757 { 0x5C579E, "Chiun Mai Communication System, Inc" },

20758 { 0x5C57C8, "Nokia Corporation" },

20759 { 0x5C5819, "Jingsheng Technology Co., Ltd." },

20760 { 0x5C58E6, "Palo Alto Networks" },

20761 { 0x5C5948, "Apple, Inc." },

20762 { 0x5C5AC7, "Cisco Systems, Inc" },

20763 { 0x5C5AEA, "FORD" },

20764 { 0x5C5B35, "Mist Systems, Inc." },

20765 { 0x5C5BC2, "YIK Corporation" },

20766 { 0x5C5EAB, "Juniper Networks" },

20767 { 0x5C5F67, "Intel Corporate" },

20768 { 0x5C60BA, "HP Inc." },

20769 { 0x5C6199, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

20770 { 0x5C625A, "CANON INC." },

20771 { 0x5C628B, "TP-Link Corporation Limited" },

20772 { 0x5C63BF, "TP-LINK TECHNOLOGIES CO.,LTD." },

20773 { 0x5C63C9, "Intellithings Ltd." },

20774 { 0x5C640F, "Sage Technologies Inc." },

20775 { 0x5C647A, "HUAWEI TECHNOLOGIES CO.,LTD" },

20776 { 0x5C648E, "Zyxel Communications Corporation" },

20777 { 0x5C64F1, "Cisco Systems, Inc" },

20778 { 0x5C64F3, "sywinkey HongKong Co,. Limited?" },

20779 { 0x5C666C, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

20780 { 0x5C6776, "IDS Imaging Development Systems GmbH" },

20781 { 0x5C68D0, "Aurora Innovation Inc." },

20782 { 0x5C6984, "NUVICO" },

20783 { 0x5C6A7D, "KENTKART EGE ELEKTRONIK SAN. VE TIC. LTD. STI." },

20784 { 0x5C6A80, "Zyxel Communications Corporation" },

20785 { 0x5C6AEC, "IEEE Registration Authority" },

20786 { 0x5C6B32, "Texas Instruments" },

20787 { 0x5C6B4F, "Hello Inc." },

20788 { 0x5C6BD7, "Foshan VIOMI Electric Appliance Technology Co. Ltd." },

20789 { 0x5C6D20, "Hon Hai Precision Ind. Co.,Ltd." },

20790 { 0x5C6F4F, "S.A. SISTEL" },

20791 { 0x5C6F69, "Broadcom Limited" },

20792 { 0x5C7017, "Apple, Inc." },

20793 { 0x5C7075, "HUAWEI TECHNOLOGIES CO.,LTD" },

20794 { 0x5C70A3, "LG Electronics (Mobile Communications)" },

20795 { 0x5C710D, "Cisco Systems, Inc" },

20796 { 0x5C7545, "Wayties, Inc." },

20797 { 0x5C75AF, "Fitbit, Inc." },

20798 { 0x5C75C6, "China Mobile Group Device Co.,Ltd." },

20799 { 0x5C7695, "Vantiva USA LLC" },

20800 { 0x5C76D5, "Nokia" },

20801 { 0x5C7757, "Haivision Network Video" },

20802 { 0x5C7776, "TCT mobile ltd" },

20803 { 0x5C78F8, "Huawei Device Co., Ltd." },

20804 { 0x5C7B5C, "Shenzhen SDMC Technology CO.,Ltd." },

20805 { 0x5C7D5E, "HUAWEI TECHNOLOGIES CO.,LTD" },

20806 { 0x5C7D7D, "Vantiva USA LLC" },

20807 { 0x5C7DF3, "Fiberhome Telecommunication Technologies Co.,LTD" },

20808 { 0x5C80B6, "Intel Corporate" },

20809 { 0x5C81A7, "Network Devices Pty Ltd" },

20810 { 0x5C836C, "Ruckus Wireless" },

20811 { 0x5C8382, "Nokia" },

20812 { 0x5C838F, "Cisco Systems, Inc" },

20813 { 0x5C83CD, "New platforms" },

20814 { 0x5C843C, "Sony Interactive Entertainment Inc." },

20815 { 0x5C8486, "Brightsource Industries Israel LTD" },

20816 { 0x5C857E, "IEEE Registration Authority" },

20817 { 0x5C85F8, "SHENZHEN KAIFA TECHNOLOGY CO.,LTD." },

20818 { 0x5C8613, "Beijing Zhoenet Technology Co., Ltd" },

20819 { 0x5C864A, "Secret Labs LLC" },

20820 { 0x5C865C, "Samsung Electronics Co.,Ltd" },

20821 { 0x5C86C1, "DONGGUAN SOLUM ELECTRONICS CO.,LTD" },

20822 { 0x5C8730, "Apple, Inc." },

20823 { 0x5C8778, "Cybertelbridge co.,ltd" },

20824 { 0x5C879C, "Intel Corporate" },

20825 { 0x5C8816, "Rockwell Automation" },

20826 { 0x5C899A, "TP-LINK TECHNOLOGIES CO.,LTD." },

20827 { 0x5C89D4, "Beijing Banner Electric Co.,Ltd" },

20828 { 0x5C8A38, "Hewlett Packard" },

20829 { 0x5C8B6B, "Amazon Technologies Inc." },

20830 { 0x5C8C30, "Taicang T&W Electronics" },

20831 { 0x5C8D2D, "Shanghai Wellpay Information Technology Co., Ltd" },

20832 { 0x5C8D4E, "Apple, Inc." },

20833 { 0x5C8E8B, "Shenzhen Linghai Electronics Co.,Ltd" },

20834 { 0x5C8F40, "TECNO MOBILE LIMITED" },

20835 { 0x5C8FE0, "ARRIS Group, Inc." },

20836 { 0x5C9012, "Owl Cyber Defense Solutions, LLC" },

20837 { 0x5C9157, "HUAWEI TECHNOLOGIES CO.,LTD" },

20838 { 0x5C91FD, "Jaewoncnc" },

20839 { 0x5C925E, "Zioncom Electronics (Shenzhen) Ltd." },

20840 { 0x5C93A2, "Liteon Technology Corporation" },

20841 { 0x5C9462, "Shenzhen Jiuzhou Electric Co.,LTD" },

20842 { 0x5C95AE, "Apple, Inc." },

20843 { 0x5C9656, "AzureWave Technology Inc." },

20844 { 0x5C9666, "Sony Interactive Entertainment Inc." },

20845 { 0x5C966A, "RTNET" },

20846 { 0x5C969D, "Apple, Inc." },

20847 { 0x5C97F3, "Apple, Inc." },

20848 { 0x5C9960, "Samsung Electronics Co.,Ltd" },

20849 { 0x5C9AA1, "Huawei Device Co., Ltd." },

20850 { 0x5C9AD8, "FUJITSU LIMITED" },

20851 { 0x5CA06C, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

20852 { 0x5CA176, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

20853 { 0x5CA178, "TableTop Media (dba Ziosk)" },

20854 { 0x5CA1E0, "EmbedWay Technologies" },

20855 { 0x5CA39D, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

20856 { 0x5CA3EB, "Lokel s.r.o." },

20857 { 0x5CA47D, "Aruba, a Hewlett Packard Enterprise Company" },

20858 { 0x5CA48A, "Cisco Systems, Inc" },

20859 { 0x5CA4A4, "Fiberhome Telecommunication Technologies Co.,LTD" },

20860 { 0x5CA4F4, "zte corporation" },

20861 { 0x5CA5BC, "eero inc." },

20862 { 0x5CA62D, "Cisco Systems, Inc" },

20863 { 0x5CA6E6, "TP-Link Corporation Limited" },

20864 { 0x5CA721, "New H3C Technologies Co., Ltd" },

20865 { 0x5CA86A, "HUAWEI TECHNOLOGIES CO.,LTD" },

20866 { 0x5CA933, "Luma Home" },

20867 { 0x5CAAFD, "Sonos, Inc." },

20868 { 0x5CAC3D, "Samsung Electronics Co.,Ltd" },

20869 { 0x5CAC4C, "Hon Hai Precision Ind. Co.,Ltd." },

20870 { 0x5CAD76, "Shenzhen TCL New Technology Co., Ltd" },

20871 { 0x5CADCF, "Apple, Inc." },

20872 { 0x5CAF06, "LG Electronics (Mobile Communications)" },

20873 { 0x5CB00A, "HUAWEI TECHNOLOGIES CO.,LTD" },

20874 { 0x5CB066, "ARRIS Group, Inc." },

20875 { 0x5CB12E, "Cisco Systems, Inc" },

20876 { 0x5CB13E, "Sagemcom Broadband SAS" },

20877 { 0x5CB15F, "Oceanblue Cloud Technology Limited" },

20878 { 0x5CB260, "EM Microelectronic" },

20879 { 0x5CB26D, "Intel Corporate" },

20880 { 0x5CB29E, "ASCO Power Technologies" },

20881 { 0x5CB395, "HUAWEI TECHNOLOGIES CO.,LTD" },

20882 { 0x5CB3F6, "Human, Incorporated" },

20883 { 0x5CB43E, "HUAWEI TECHNOLOGIES CO.,LTD" },

20884 { 0x5CB4E2, "Inspur Software Group Ltd." },

20885 { 0x5CB524, "Sony Corporation" },

20886 { 0x5CB559, "CNEX Labs" },

20887 { 0x5CB6CC, "NovaComm Technologies Inc." },

20888 { 0x5CB8CB, "Allis Communications" },

20889 { 0x5CB901, "Hewlett Packard" },

20890 { 0x5CBA2C, "Hewlett Packard Enterprise" },

20891 { 0x5CBA37, "Microsoft Corporation" },

20892 { 0x5CBAEF, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

20893 { 0x5CBBEE, "zte corporation" },

20894 { 0x5CBD9A, "Huawei Device Co., Ltd." },

20895 { 0x5CBD9E, "HONGKONG MIRACLE EAGLE TECHNOLOGY(GROUP) LIMITED" },

20896 { 0x5CC0A0, "HUAWEI TECHNOLOGIES CO.,LTD" },

20897 { 0x5CC1D7, "Samsung Electronics Co.,Ltd" },

20898 { 0x5CC213, "Fr. Sauter AG" },

20899 { 0x5CC307, "HUAWEI TECHNOLOGIES CO.,LTD" },

20900 { 0x5CC336, "ittim" },

20901 { 0x5CC563, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

20902 { 0x5CC5D4, "Intel Corporate" },

20903 { 0x5CC6D0, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

20904 { 0x5CC6E9, "Edifier International" },

20905 { 0x5CC787, "Huawei Device Co., Ltd." },

20906 { 0x5CC7C1, "Silicon Laboratories" },

20907 { 0x5CC7D7, "AZROAD TECHNOLOGY COMPANY LIMITED" },

20908 { 0x5CC8E3, "Shintec Hozumi co.ltd." },

20909 { 0x5CC999, "New H3C Technologies Co., Ltd" },

20910 { 0x5CC9C0, "Renesas Electronics (Penang) Sdn. Bhd." },

20911 { 0x5CC9D3, "PALLADIUM ENERGY ELETRONICA DA AMAZONIA LTDA" },

20912 { 0x5CCA1A, "Microsoft Mobile Oy" },

20913 { 0x5CCA32, "Theben AG" },

20914 { 0x5CCAD3, "CHIPSEA TECHNOLOGIES (SHENZHEN) CORP." },

20915 { 0x5CCB99, "Samsung Electronics Co.,Ltd" },

20916 { 0x5CCBCA, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

20917 { 0x5CCCA0, "Gridwiz Inc." },

20918 { 0x5CCCFF, "Techroutes Network Pvt Ltd" },

20919 { 0x5CCD5B, "Intel Corporate" },

20920 { 0x5CCD7C, "MEIZU Technology Co.,Ltd." },

20921 { 0x5CCEAD, "CDYNE Corporation" },

20922 { 0x5CCF7F, "Espressif Inc." },

20923 { 0x5CD06E, "Xiaomi Communications Co Ltd" },

20924 { 0x5CD135, "Xtreme Power Systems" },

20925 { 0x5CD20B, "Yytek Co., Ltd." },

20926 { 0x5CD2E4, "Intel Corporate" },

20927 { 0x5CD41B, "UCZOON Technology Co., LTD" },

20928 { 0x5CD4AB, "Zektor" },

20929 { 0x5CD5B5, "Shenzhen WiSiYiLink Technology Co.,Ltd" },

20930 { 0x5CD61F, "Qardio, Inc" },

20931 { 0x5CD89E, "Huawei Device Co., Ltd." },

20932 { 0x5CD998, "D-Link Corporation" },

20933 { 0x5CDAD4, "Murata Manufacturing Co., Ltd." },

20934 { 0x5CDC96, "Arcadyan Technology Corporation" },

20935 { 0x5CDD70, "Hangzhou H3C Technologies Co., Limited" },

20936 { 0x5CDE34, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

20937 { 0x5CDF89, "Ruckus Wireless" },

20938 { 0x5CDFB8, "Shenzhen Unionmemory Information System Limited" },

20939 { 0x5CE0C5, "Intel Corporate" },

20940 { 0x5CE0CA, "FeiTian United (Beijing) System Technology Co., Ltd." },

20941 { 0x5CE0F6, "NIC.br- Nucleo de Informacao e Coordenacao do Ponto BR" },

20942 { 0x5CE176, "Cisco Systems, Inc" },

20943 { 0x5CE223, "Delphin Technology AG" },

20944 { 0x5CE286, "Nortel Networks" },

20945 { 0x5CE28C, "Zyxel Communications Corporation" },

20946 { 0x5CE2F4, "AcSiP Technology Corp." },

20947 { 0x5CE30E, "ARRIS Group, Inc." },

20948 { 0x5CE3B6, "Fiberhome Telecommunication Technologies Co.,LTD" },

20949 { 0x5CE42A, "Intel Corporate" },

20950 { 0x5CE50C, "Beijing Xiaomi Mobile Software Co., Ltd" },

20951 { 0x5CE688, "VECOS Europe B.V." },

20952 { 0x5CE747, "HUAWEI TECHNOLOGIES CO.,LTD" },

20953 { 0x5CE7A0, "Nokia" },

20954 { 0x5CE7BF, "New Singularity International Technical Development Co.,Ltd" },

20955 { 0x5CE883, "HUAWEI TECHNOLOGIES CO.,LTD" },

20956 { 0x5CE8B7, "Oraimo Technology Limited" },

20957 { 0x5CE8D3, "Signalinks Communication Technology Co., Ltd" },

20958 { 0x5CE8EB, "Samsung Electronics Co.,Ltd" },

20959 { 0x5CE91E, "Apple, Inc." },

20960 { 0x5CE931, "TP-Link Corporation Limited" },

20961 { 0x5CEA1D, "Hon Hai Precision Ind. Co.,Ltd." },

20962 { 0x5CEB4E, "R. STAHL HMI Systems GmbH" },

20963 { 0x5CEB68, "Cheerstar Technology Co., Ltd" },

20964 { 0x5CED8C, "Hewlett Packard Enterprise" },

20965 { 0x5CEDF4, "Samsung Electronics Co.,Ltd" },

20966 { 0x5CEE79, "Global Digitech Co LTD" },

20967 { 0x5CF207, "Speco Technologies" },

20968 { 0x5CF286, "IEEE Registration Authority" },

20969 { 0x5CF370, "CC&C Technologies, Inc" },

20970 { 0x5CF3FC, "IBM Corp" },

20971 { 0x5CF4AB, "Zyxel Communications Corporation" },

20972 { 0x5CF50D, "Institute of microelectronic applications" },

20973 { 0x5CF51A, "Zhejiang Dahua Technology Co., Ltd." },

20974 { 0x5CF5DA, "Apple, Inc." },

20975 { 0x5CF6DC, "Samsung Electronics Co.,Ltd" },

20976 { 0x5CF7C3, "SYNTECH (HK) TECHNOLOGY LIMITED" },

20977 { 0x5CF7E6, "Apple, Inc." },

20978 { 0x5CF821, "Texas Instruments" },

20979 { 0x5CF838, "IEEE Registration Authority" },

20980 { 0x5CF8A1, "Murata Manufacturing Co., Ltd." },

20981 { 0x5CF938, "Apple, Inc." },

20982 { 0x5CF96A, "HUAWEI TECHNOLOGIES CO.,LTD" },

20983 { 0x5CF9DD, "Dell Inc." },

20984 { 0x5CF9F0, "Atomos Engineering P/L" },

20985 { 0x5CF9FD, "Taicang T&W Electronics" },

20986 { 0x5CFA25, "Sagemcom Broadband SAS" },

20987 { 0x5CFAFB, "Acubit" },

20988 { 0x5CFB3A, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

20989 { 0x5CFB7C, "Shenzhen Jingxun Software Telecommunication Technology Co.,Ltd" },

20990 { 0x5CFC66, "Cisco Systems, Inc" },

20991 { 0x5CFC6E, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

20992 { 0x5CFCE1, "Resideo" },

20993 { 0x5CFE9E, "Wiwynn Corporation Tainan Branch" },

20994 { 0x5CFF35, "Wistron Corporation" },

20995 { 0x5CFFFF, "Shenzhen Kezhonglong Optoelectronic Technology Co., Ltd" },

20996 { 0x600194, "Espressif Inc." },

20997 { 0x6001B1, "HUAWEI TECHNOLOGIES CO.,LTD" },

20998 { 0x600292, "PEGATRON CORPORATION" },

20999 { 0x6002B4, "Wistron Neweb Corporation" },

21000 { 0x600308, "Apple, Inc." },

21001 { 0x60030C, "Shenzhen YOUHUA Technology Co., Ltd" },

21002 { 0x600347, "Billion Electric Co. Ltd." },

21003 { 0x6003A6, "Inteno Broadband Technology AB" },

21004 { 0x600417, "POSBANK CO.,LTD" },

21005 { 0x60045C, "NXP Semiconductor (Tianjin) LTD." },

21006 { 0x60058A, "Hitachi Metals, Ltd." },

21007 { 0x6006E3, "Apple, Inc." },

21008 { 0x60077C, "Jala Group" },

21009 { 0x6007C4, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

21010 { 0x600810, "HUAWEI TECHNOLOGIES CO.,LTD" },

21011 { 0x600837, "ivvi Scientific(Nanchang)Co.Ltd" },

21012 { 0x6009C3, "u-blox AG" },

21013 { 0x600B03, "Hangzhou H3C Technologies Co., Limited" },

21014 { 0x600F6B, "Apple, Inc." },

21015 { 0x600F77, "SilverPlus, Inc" },

21016 { 0x60109E, "HUAWEI TECHNOLOGIES CO.,LTD" },

21017 { 0x6010A2, "Crompton Instruments" },

21018 { 0x601199, "Siama Systems Inc" },

21019 { 0x60123C, "HUAWEI TECHNOLOGIES CO.,LTD" },

21020 { 0x601283, "TSB REAL TIME LOCATION SYSTEMS S.L." },

21021 { 0x60128B, "CANON INC." },

21022 { 0x601466, "zte corporation" },

21023 { 0x6014B3, "CyberTAN Technology Inc." },

21024 { 0x601521, "Redarc Electronics" },

21025 { 0x60152B, "Palo Alto Networks" },

21026 { 0x601592, "IEEE Registration Authority" },

21027 { 0x6015C7, "IdaTech" },

21028 { 0x601803, "Daikin Air-conditioning (Shanghai) Co., Ltd." },

21029 { 0x60182E, "ShenZhen Protruly Electronic Ltd co." },

21030 { 0x60183A, "Huawei Device Co., Ltd." },

21031 { 0x601888, "zte corporation" },

21032 { 0x601895, "Dell Inc." },

21033 { 0x60190C, "RRAMAC" },

21034 { 0x601929, "VOLTRONIC POWER TECHNOLOGY(SHENZHEN) CORP." },

21035 { 0x601970, "HUIZHOU QIAOXING ELECTRONICS TECHNOLOGY CO., LTD." },

21036 { 0x601971, "ARRIS Group, Inc." },

21037 { 0x601AC7, "Nintendo Co.,Ltd" },

21038 { 0x601B52, "Vodafone Italia S.p.A." },

21039 { 0x601D0F, "Midnite Solar" },

21040 { 0x601D56, "Extreme Networks Headquarters" },

21041 { 0x601D91, "Motorola Mobility LLC, a Lenovo Company" },

21042 { 0x601D9D, "Sichuan AI-Link Technology Co., Ltd." },

21043 { 0x601E02, "EltexAlatau" },

21044 { 0x601E98, "Axevast Technology" },

21045 { 0x602101, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

21046 { 0x602103, "I4VINE, INC" },

21047 { 0x6021C0, "Murata Manufacturing Co., Ltd." },

21048 { 0x602232, "Ubiquiti Inc" },

21049 { 0x6023A4, "Sichuan AI-Link Technology Co., Ltd." },

21050 { 0x6024C1, "Jiangsu Zhongxun Electronic Technology Co., Ltd" },

21051 { 0x602602, "Texas Instruments" },

21052 { 0x6026AA, "Cisco Systems, Inc" },

21053 { 0x6026EF, "Aruba, a Hewlett Packard Enterprise Company" },

21054 { 0x60271C, "VIDEOR E. Hartig GmbH" },

21055 { 0x60292B, "TP-LINK TECHNOLOGIES CO.,LTD." },

21056 { 0x6029D5, "DAVOLINK Inc." },

21057 { 0x602A1B, "JANCUS" },

21058 { 0x602A54, "CardioTek B.V." },

21059 { 0x602AD0, "Cisco SPVTG" },

21060 { 0x602B58, "EM Microelectronic" },

21061 { 0x602E20, "HUAWEI TECHNOLOGIES CO.,LTD" },

21062 { 0x6030D4, "Apple, Inc." },

21063 { 0x60313B, "Sunnovo International Limited" },

21064 { 0x603197, "Zyxel Communications Corporation" },

21065 { 0x6032B1, "TP-LINK TECHNOLOGIES CO.,LTD." },

21066 { 0x6032F0, "Mplus technology" },

21067 { 0x60334B, "Apple, Inc." },

21068 { 0x603553, "Buwon Technology" },

21069 { 0x603573, "Earda Technologies co Ltd" },

21070 { 0x6035C0, "SFR" },

21071 { 0x603696, "The Sapling Company" },

21072 { 0x6036DD, "Intel Corporate" },

21073 { 0x60380E, "ALPSALPINE CO,.LTD" },

21074 { 0x6038E0, "Belkin International Inc." },

21075 { 0x60391F, "ABB Ltd" },

21076 { 0x603A7C, "TP-LINK TECHNOLOGIES CO.,LTD." },

21077 { 0x603AAF, "Samsung Electronics Co.,Ltd" },

21078 { 0x603CEE, "LG Electronics (Mobile Communications)" },

21079 { 0x603D26, "Vantiva USA LLC" },

21080 { 0x603D29, "HUAWEI TECHNOLOGIES CO.,LTD" },

21081 { 0x603E5F, "Apple, Inc." },

21082 { 0x603E7B, "Gafachi, Inc." },

21083 { 0x603ECA, "Cambridge Medical Robotics Ltd" },

21084 { 0x603FC5, "COX CO., LTD" },

21085 { 0x60427F, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

21086 { 0x60447A, "Water-i.d. GmbH" },

21087 { 0x6044F5, "Easy Digital Ltd." },

21088 { 0x60452E, "Intel Corporate" },

21089 { 0x60455E, "Liptel s.r.o." },

21090 { 0x6045BD, "Microsoft" },

21091 { 0x6045CB, "ASUSTek COMPUTER INC." },

21092 { 0x604616, "XIAMEN VANN INTELLIGENT CO., LTD" },

21093 { 0x604762, "Beijing Sensoro Technology Co.,Ltd." },

21094 { 0x6047D4, "FORICS Electronic Technology Co., Ltd." },

21095 { 0x604826, "Newbridge Technologies Int. Ltd." },

21096 { 0x60489C, "YIPPEE ELECTRONICS CO.,LIMITED" },

21097 { 0x604966, "Shenzhen Dingsheng Technology Co., Ltd." },

21098 { 0x6049C1, "Avaya Inc" },

21099 { 0x604A1C, "SUYIN Corporation" },

21100 { 0x604BAA, "Magic Leap, Inc." },

21101 { 0x604DE1, "HUAWEI TECHNOLOGIES CO.,LTD" },

21102 { 0x604F5B, "Huawei Device Co., Ltd." },

21103 { 0x6050C1, "Kinetek Sports" },

21104 { 0x60512C, "TCT mobile ltd" },

21105 { 0x6052D0, "FACTS Engineering" },

21106 { 0x605317, "Sandstone Technologies" },

21107 { 0x605375, "HUAWEI TECHNOLOGIES CO.,LTD" },

21108 { 0x605464, "Eyedro Green Solutions Inc." },

21109 { 0x6055F9, "Espressif Inc." },

21110 { 0x605661, "IXECLOUD Tech" },

21111 { 0x60567D, "AM Telecom co., Ltd." },

21112 { 0x605699, "MAGNETI MARELLI S.E. S.p.A." },

21113 { 0x605718, "Intel Corporate" },

21114 { 0x605747, "CIG SHANGHAI CO LTD" },

21115 { 0x60577D, "eero inc." },

21116 { 0x6057C8, "Apple, Inc." },

21117 { 0x605801, "Shandong ZTop Microelectronics Co., Ltd." },

21118 { 0x605B30, "Dell Inc." },

21119 { 0x605BB4, "AzureWave Technology Inc." },

21120 { 0x605E4F, "Huawei Device Co., Ltd." },

21121 { 0x605F8D, "eero inc." },

21122 { 0x60601F, "SZ DJI TECHNOLOGY CO.,LTD" },

21123 { 0x606134, "Arcade Communications Ltd." },

21124 { 0x6061DF, "Z-meta Research LLC" },

21125 { 0x60634C, "D-Link International" },

21126 { 0x6063F9, "Ciholas, Inc." },

21127 { 0x6063FD, "Transcend Communication Beijing Co.,Ltd." },

21128 { 0x606405, "Texas Instruments" },

21129 { 0x606453, "AOD Co.,Ltd." },

21130 { 0x6064A1, "RADiflow Ltd." },

21131 { 0x606525, "Apple, Inc." },

21132 { 0x606682, "SHENZHEN ATEKO PHOTOELECTRICITY CO.,LTD" },

21133 { 0x606720, "Intel Corporate" },

21134 { 0x60684E, "Samsung Electronics Co.,Ltd" },

21135 { 0x606944, "Apple, Inc." },

21136 { 0x60699B, "isepos GmbH" },

21137 { 0x606B5B, "Arista Network, Inc." },

21138 { 0x606BB3, "zte corporation" },

21139 { 0x606BBD, "Samsung Electronics Co.,Ltd" },

21140 { 0x606BFF, "Nintendo Co.,Ltd" },

21141 { 0x606C63, "Hitron Technologies. Inc" },

21142 { 0x606C66, "Intel Corporate" },

21143 { 0x606D3C, "Luxshare Precision Industry Company Limited" },

21144 { 0x606D9D, "Otto Bock Healthcare Products GmbH" },

21145 { 0x606DC7, "Hon Hai Precision Ind. Co.,Ltd." },

21146 { 0x606E41, "Barrot Technology Co.,LTD" },

21147 { 0x606ED0, "SEAL AG" },

21148 { 0x606EE8, "Xiaomi Communications Co Ltd" },

21149 { 0x60706C, "Google, Inc." },

21150 { 0x607072, "SHENZHEN HONGDE SMART LINK TECHNOLOGY CO., LTD" },

21151 { 0x6070C0, "Apple, Inc." },

21152 { 0x60720B, "BLU Products Inc" },

21153 { 0x60735C, "Cisco Systems, Inc" },

21154 { 0x6073BC, "zte corporation" },

21155 { 0x60748D, "Atmaca Elektronik" },

21156 { 0x6074F4, "Private" },

21157 { 0x607623, "Shenzhen E-Superlink Technology Co., Ltd" },

21158 { 0x607688, "Velodyne" },

21159 { 0x607771, "Texas Instruments" },

21160 { 0x6077E2, "Samsung Electronics Co.,Ltd" },

21161 { 0x607D09, "Luxshare Precision Industry Co., Ltd" },

21162 { 0x607DDD, "Shenzhen Shichuangyi Electronics Co.,Ltd" },

21163 { 0x607EA4, "Shanghai Imilab Technology Co.Ltd" },

21164 { 0x607EC9, "Apple, Inc." },

21165 { 0x607ECD, "HUAWEI TECHNOLOGIES CO.,LTD" },

21166 { 0x607EDD, "Microsoft Mobile Oy" },

21167 { 0x60812B, "Astronics Custom Control Concepts" },

21168 { 0x6081F9, "Helium Systems, Inc" },

21169 { 0x608246, "Apple, Inc." },

21170 { 0x608334, "HUAWEI TECHNOLOGIES CO.,LTD" },

21171 { 0x608373, "Apple, Inc." },

21172 { 0x6083B2, "GkWare e.K." },

21173 { 0x60843B, "Soladigm, Inc." },

21174 { 0x6084BD, "BUFFALO.INC" },

21175 { 0x608645, "Avery Weigh-Tronix, LLC" },

21176 { 0x60893C, "Thermo Fisher Scientific P.O.A." },

21177 { 0x6089B1, "Key Digital Systems" },

21178 { 0x6089B7, "KAEL MÜHENDİSLİK ELEKTRONİK TİCARET SANAYİ LİMİTED ŞİRKETİ" },

21179 { 0x608A10, "Microchip Technology Inc." },

21180 { 0x608B0E, "Apple, Inc." },

21181 { 0x608C2B, "Hanson Technology" },

21182 { 0x608C4A, "Apple, Inc." },

21183 { 0x608CDF, "Beamtrail-Sole Proprietorship" },

21184 { 0x608CE6, "ARRIS Group, Inc." },

21185 { 0x608D17, "Sentrus Government Systems Division, Inc" },

21186 { 0x608D26, "Arcadyan Corporation" },

21187 { 0x608E08, "Samsung Electronics Co.,Ltd" },

21188 { 0x608F5C, "Samsung Electronics Co.,Ltd" },

21189 { 0x608FA4, "Nokia Solutions and Networks GmbH & Co. KG" },

21190 { 0x609084, "DSSD Inc" },

21191 { 0x6091F3, "vivo Mobile Communication Co., Ltd." },

21192 { 0x609217, "Apple, Inc." },

21193 { 0x6092F5, "ARRIS Group, Inc." },

21194 { 0x609316, "Apple, Inc." },

21195 { 0x609532, "Zebra Technologies Inc." },

21196 { 0x6095BD, "Apple, Inc." },

21197 { 0x6095CE, "IEEE Registration Authority" },

21198 { 0x609620, "Private" },

21199 { 0x6096A4, "HUAWEI TECHNOLOGIES CO.,LTD" },

21200 { 0x6097DD, "MicroSys Electronics GmbH" },

21201 { 0x609813, "Shanghai Visking Digital Technology Co. LTD" },

21202 { 0x609866, "Texas Instruments" },

21203 { 0x6099D1, "Vuzix / Lenovo" },

21204 { 0x609AA4, "GVI SECURITY INC." },

21205 { 0x609AC1, "Apple, Inc." },

21206 { 0x609B2D, "JMACS Japan Co., Ltd." },

21207 { 0x609BB4, "HUAWEI TECHNOLOGIES CO.,LTD" },

21208 { 0x609BC8, "Hipad Intelligent Technology Co., Ltd." },

21209 { 0x609C9F, "Brocade Communications Systems LLC" },

21210 { 0x609E64, "Vivonic GmbH" },

21211 { 0x609F9D, "CloudSwitch" },

21212 { 0x60A10A, "Samsung Electronics Co.,Ltd" },

21213 { 0x60A11E, "Wuhan Maxsine Electric Co.,Ltd." },

21214 { 0x60A2C6, "HUAWEI TECHNOLOGIES CO.,LTD" },

21215 { 0x60A37D, "Apple, Inc." },

21216 { 0x60A423, "Silicon Laboratories" },

21217 { 0x60A44C, "ASUSTek COMPUTER INC." },

21218 { 0x60A4B7, "TP-Link Corporation Limited" },

21219 { 0x60A4D0, "Samsung Electronics Co.,Ltd" },

21220 { 0x60A5E2, "Intel Corporate" },

21221 { 0x60A6C5, "HUAWEI TECHNOLOGIES CO.,LTD" },

21222 { 0x60A730, "Shenzhen Yipinfang Internet Technology Co.,Ltd" },

21223 { 0x60A751, "Huawei Device Co., Ltd." },

21224 { 0x60A8FE, "Nokia Solutions and Networks GmbH & Co. KG" },

21225 { 0x60A9B0, "Merchandising Technologies, Inc" },

21226 { 0x60AAEF, "Huawei Device Co., Ltd." },

21227 { 0x60AB14, "LG Innotek" },

21228 { 0x60AB67, "Xiaomi Communications Co Ltd" },

21229 { 0x60ABD2, "Bose Corporation" },

21230 { 0x60ACC8, "KunTeng Inc." },

21231 { 0x60AF6D, "Samsung Electronics Co.,Ltd" },

21232 { 0x60B185, "ATH system" },

21233 { 0x60B387, "Synergics Technologies GmbH" },

21234 { 0x60B3C4, "Elber Srl" },

21235 { 0x60B4F7, "Plume Design Inc" },

21236 { 0x60B606, "Phorus" },

21237 { 0x60B617, "Fiberhome Telecommunication Technologies Co.,LTD" },

21238 { 0x60B647, "Silicon Laboratories" },

21239 { 0x60B6E1, "Texas Instruments" },

21240 { 0x60B76E, "Google, Inc." },

21241 { 0x60B933, "Deutron Electronics Corp." },

21242 { 0x60B982, "RO.VE.R. Laboratories S.p.A." },

21243 { 0x60B9C0, "Cisco Systems, Inc" },

21244 { 0x60BA18, "nextLAP GmbH" },

21245 { 0x60BB0C, "Beijing HuaqinWorld Technology Co,Ltd" },

21246 { 0x60BC4C, "EWM Hightec Welding GmbH" },

21247 { 0x60BD2C, "Taicang T&W Electronics" },

21248 { 0x60BD91, "Move Innovation" },

21249 { 0x60BEB4, "S-Bluetech co., limited" },

21250 { 0x60BEB5, "Motorola Mobility LLC, a Lenovo Company" },

21251 { 0x60BEC4, "Apple, Inc." },

21252 { 0x60C01E, "V&G Information System Co.,Ltd" },

21253 { 0x60C0BF, "ON Semiconductor" },

21254 { 0x60C1CB, "Fujian Great Power PLC Equipment Co.,Ltd" },

21255 { 0x60C397, "2Wire Inc" },

21256 { 0x60C547, "Apple, Inc." },

21257 { 0x60C5A8, "Beijing LT Honway Technology Co.,Ltd" },

21258 { 0x60C5AD, "Samsung Electronics Co.,Ltd" },

21259 { 0x60C5E6, "Skullcandy" },

21260 { 0x60C658, "PHYTRONIX Co.,Ltd." },

21261 { 0x60C727, "Digiboard Eletronica da Amazonia Ltda" },

21262 { 0x60C78D, "Juniper Networks" },

21263 { 0x60C798, "Verifone" },

21264 { 0x60C7BE, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

21265 { 0x60C980, "Trymus" },

21266 { 0x60C9AA, "Nokia" },

21267 { 0x60CBFB, "AirScape Inc." },

21268 { 0x60CDA9, "Abloomy" },

21269 { 0x60CDC5, "Taiwan Carol Electronics., Ltd" },

21270 { 0x60CE41, "HUAWEI TECHNOLOGIES CO.,LTD" },

21271 { 0x60CE86, "Sercomm Corporation." },

21272 { 0x60CE92, "The Refined Industry Company Limited" },

21273 { 0x60CF69, "meerecompany" },

21274 { 0x60D02C, "Ruckus Wireless" },

21275 { 0x60D039, "Apple, Inc." },

21276 { 0x60D0A9, "Samsung Electronics Co.,Ltd" },

21277 { 0x60D1AA, "Vishal Telecommunications Pvt Ltd" },

21278 { 0x60D21C, "Sunnovo International Limited" },

21279 { 0x60D248, "ARRIS Group, Inc." },

21280 { 0x60D262, "Tzukuri Pty Ltd" },

21281 { 0x60D2B9, "REALAND BIO CO., LTD." },

21282 { 0x60D2DD, "Shenzhen Baitong Putian Technology Co.,Ltd." },

21283 { 0x60D30A, "Quatius Limited" },

21284 { 0x60D4E9, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

21285 { 0x60D755, "HUAWEI TECHNOLOGIES CO.,LTD" },

21286 { 0x60D7E3, "IEEE Registration Authority" },

21287 { 0x60D819, "Hon Hai Precision Ind. Co.,Ltd." },

21288 { 0x60D89C, "HMD Global Oy" },

21289 { 0x60D9A0, "Lenovo Mobile Communication Technology Ltd." },

21290 { 0x60D9C7, "Apple, Inc." },

21291 { 0x60DA23, "Estech Co.,Ltd" },

21292 { 0x60DA83, "Hangzhou H3C Technologies Co., Limited" },

21293 { 0x60DB15, "New H3C Technologies Co., Ltd" },

21294 { 0x60DB2A, "HNS" },

21295 { 0x60DB98, "Calix Inc." },

21296 { 0x60DBEF, "Unify Software and Solutions GmbH & Co. KG" },

21297 { 0x60DC81, "AltoBeam Inc." },

21298 { 0x60DD70, "Apple, Inc." },

21299 { 0x60DD8E, "Intel Corporate" },

21300 { 0x60DE35, "GITSN, Inc." },

21301 { 0x60DE44, "HUAWEI TECHNOLOGIES CO.,LTD" },

21302 { 0x60DEF3, "HUAWEI TECHNOLOGIES CO.,LTD" },

21303 { 0x60DEF4, "Shenzhen iComm Semiconductor CO.,LTD" },

21304 { 0x60E00E, "SHINSEI ELECTRONICS CO LTD" },

21305 { 0x60E327, "TP-LINK TECHNOLOGIES CO.,LTD." },

21306 { 0x60E32B, "Intel Corporate" },

21307 { 0x60E3AC, "LG Electronics (Mobile Communications)" },

21308 { 0x60E6BC, "Sino-Telecom Technology Co.,Ltd." },

21309 { 0x60E6F0, "Wistron Neweb Corporation" },

21310 { 0x60E701, "HUAWEI TECHNOLOGIES CO.,LTD" },

21311 { 0x60E78A, "UNISEM" },

21312 { 0x60E85B, "Texas Instruments" },

21313 { 0x60E956, "Ayla Networks, Inc" },

21314 { 0x60E9AA, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

21315 { 0x60EB5A, "Asterfusion Data Technologies Co.,Ltd" },

21316 { 0x60EB69, "Quanta Computer Inc." },

21317 { 0x60EE5C, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

21318 { 0x60EFAB, "Silicon Laboratories" },

21319 { 0x60EFC6, "Shenzhen Chima Technologies Co Limited" },

21320 { 0x60F04D, "Honor Device Co., Ltd." },

21321 { 0x60F13D, "JABLOCOM s.r.o." },

21322 { 0x60F189, "Murata Manufacturing Co., Ltd." },

21323 { 0x60F18A, "HUAWEI TECHNOLOGIES CO.,LTD" },

21324 { 0x60F262, "Intel Corporate" },

21325 { 0x60F281, "TRANWO TECHNOLOGY CO., LTD." },

21326 { 0x60F2EF, "VisionVera International Co., Ltd." },

21327 { 0x60F3DA, "Logic Way GmbH" },

21328 { 0x60F43A, "Edifier International" },

21329 { 0x60F445, "Apple, Inc." },

21330 { 0x60F494, "Hon Hai Precision Ind. Co.,Ltd." },

21331 { 0x60F59C, "CRU-Dataport" },

21332 { 0x60F673, "TERUMO CORPORATION" },

21333 { 0x60F677, "Intel Corporate" },

21334 { 0x60F81D, "Apple, Inc." },

21335 { 0x60F8F2, "Synaptec" },

21336 { 0x60FA9D, "HUAWEI TECHNOLOGIES CO.,LTD" },

21337 { 0x60FAB1, "Kempower Oyj" },

21338 { 0x60FACD, "Apple, Inc." },

21339 { 0x60FB00, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

21340 { 0x60FB42, "Apple, Inc." },

21341 { 0x60FCF1, "Private" },

21342 { 0x60FD56, "WOORISYSTEMS CO., Ltd" },

21343 { 0x60FDA6, "Apple, Inc." },

21344 { 0x60FE1E, "China Palms Telecom.Ltd" },

21345 { 0x60FE20, "2Wire Inc" },

21346 { 0x60FEC5, "Apple, Inc." },

21347 { 0x60FEF9, "Thomas & Betts" },

21348 { 0x60FF12, "Samsung Electronics Co.,Ltd" },

21349 { 0x60FFDD, "C.E. ELECTRONICS, INC" },

21350 { 0x64002D, "Powerlinq Co., LTD" },

21351 { 0x64006A, "Dell Inc." },

21352 { 0x64009C, "Insulet Corporation" },

21353 { 0x6400F1, "Cisco Systems, Inc" },

21354 { 0x6401FB, "Landis+Gyr GmbH" },

21355 { 0x6402CB, "ARRIS Group, Inc." },

21356 { 0x64037F, "Samsung Electronics Co.,Ltd" },

21357 { 0x6405BE, "NEW LIGHT LED" },

21358 { 0x6405E4, "ALPSALPINE CO,.LTD" },

21359 { 0x6405E9, "Shenzhen WayOS Technology Crop., Ltd." },

21360 { 0x6407F6, "Samsung Electronics Co.,Ltd" },

21361 { 0x64094C, "Beijing Superbee Wireless Technology Co.,Ltd" },

21362 { 0x640980, "Xiaomi Communications Co Ltd" },

21363 { 0x6409AC, "TCT mobile ltd" },

21364 { 0x640B4A, "Digital Telecom Technology Limited" },

21365 { 0x640BD7, "Apple, Inc." },

21366 { 0x640D22, "LG Electronics (Mobile Communications)" },

21367 { 0x640DCE, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

21368 { 0x640DE6, "Petra Systems" },

21369 { 0x640E36, "TAZTAG" },

21370 { 0x640E6A, "SECO-LARM USA Inc" },

21371 { 0x640E94, "Pluribus Networks, Inc." },

21372 { 0x640E9B, "ISHIDA MEDICAL CO., LTD." },

21373 { 0x640F28, "2Wire Inc" },

21374 { 0x641084, "HEXIUM Technical Development Co., Ltd." },

21375 { 0x6411A4, "Motorola Mobility LLC, a Lenovo Company" },

21376 { 0x641225, "Cisco Systems, Inc" },

21377 { 0x641236, "Vantiva USA LLC" },

21378 { 0x641269, "ARRIS Group, Inc." },

21379 { 0x641331, "Bosch Car Multimedia (Wuhu) Co. Ltd." },

21380 { 0x64135A, "Itectra A/S" },

21381 { 0x64136C, "zte corporation" },

21382 { 0x6413AB, "HUAWEI TECHNOLOGIES CO.,LTD" },

21383 { 0x641666, "Nest Labs Inc." },

21384 { 0x64167F, "Polycom" },

21385 { 0x64168D, "Cisco Systems, Inc" },

21386 { 0x6416F0, "HUAWEI TECHNOLOGIES CO.,LTD" },

21387 { 0x641759, "Intellivision Holdings, LLC" },

21388 { 0x6417CD, "Samsung Electronics Co.,Ltd" },

21389 { 0x641A22, "Heliospectra AB" },

21390 { 0x641ABA, "Dryad Networks GmbH" },

21391 { 0x641B2F, "Samsung Electronics Co.,Ltd" },

21392 { 0x641C10, "Texas Instruments" },

21393 { 0x641C67, "DIGIBRAS INDUSTRIA DO BRASILS/A" },

21394 { 0x641CAE, "Samsung Electronics Co.,Ltd" },

21395 { 0x641CB0, "Samsung Electronics Co.,Ltd" },

21396 { 0x641E81, "Dowslake Microsystems" },

21397 { 0x64200C, "Apple, Inc." },

21398 { 0x64209F, "Tilgin AB" },

21399 { 0x6420E0, "T3 Technology Co., Ltd." },

21400 { 0x642184, "Nippon Denki Kagaku Co.,LTD" },

21401 { 0x642216, "Shandong Taixin Electronic co.,Ltd" },

21402 { 0x642315, "Huawei Device Co., Ltd." },

21403 { 0x642400, "Xorcom Ltd." },

21404 { 0x64255E, "Observint Technologies, Inc." },

21405 { 0x6425EC, "guangdong kesheng zhixun technology" },

21406 { 0x642656, "Shenzhen Fanweitai Technology Service Co.,Ltd" },

21407 { 0x642677, "BKM-Micronic Richtfunkanlagen GmbH" },

21408 { 0x642737, "Hon Hai Precision Ind. Co.,Ltd." },

21409 { 0x642753, "Huawei Device Co., Ltd." },

21410 { 0x642943, "D-Link Corporation" },

21411 { 0x6429ED, "AO PKK Milandr" },

21412 { 0x642B8A, "ALL BEST Industrial Co., Ltd." },

21413 { 0x642C0F, "vivo Mobile Communication Co., Ltd." },

21414 { 0x642CAC, "HUAWEI TECHNOLOGIES CO.,LTD" },

21415 { 0x642DB7, "SEUNGIL ELECTRONICS" },

21416 { 0x642FC7, "New H3C Technologies Co., Ltd" },

21417 { 0x643139, "IEEE Registration Authority" },

21418 { 0x643150, "Hewlett Packard" },

21419 { 0x643172, "ZHEJIANG HISING TECHNOLOGY CO.,LTD" },

21420 { 0x64317E, "Dexin Corporation" },

21421 { 0x643216, "Weidu Technology (Beijing) Co., Ltd." },

21422 { 0x6432A8, "Intel Corporate" },

21423 { 0x6433B5, "IEEE Registration Authority" },

21424 { 0x6433DB, "Texas Instruments" },

21425 { 0x643409, "BITwave Pte Ltd" },

21426 { 0x64351C, "e-CON SYSTEMS INDIA PVT LTD" },

21427 { 0x6437A4, "TOKYOSHUHA CO.,LTD." },

21428 { 0x643AB1, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

21429 { 0x643AEA, "Cisco Systems, Inc" },

21430 { 0x643E0A, "HUAWEI TECHNOLOGIES CO.,LTD" },

21431 { 0x643E8C, "HUAWEI TECHNOLOGIES CO.,LTD" },

21432 { 0x643F5F, "Exablaze" },

21433 { 0x6441E6, "Apple, Inc." },

21434 { 0x644212, "Shenzhen Water World Information Co.,Ltd." },

21435 { 0x644214, "Swisscom Energy Solutions AG" },

21436 { 0x644346, "GuangDong Quick Network Computer CO.,LTD" },

21437 { 0x6444D5, "TD Tech" },

21438 { 0x6447E0, "Feitian Technologies Co., Ltd" },

21439 { 0x64497D, "Intel Corporate" },

21440 { 0x644BC3, "Shanghai WOASiS Telecommunications Ltd., Co." },

21441 { 0x644BF0, "CalDigit, Inc" },

21442 { 0x644C36, "Intel Corporate" },

21443 { 0x644C69, "CONPROVE" },

21444 { 0x644D70, "dSPACE GmbH" },

21445 { 0x644ED7, "HP Inc." },

21446 { 0x644EEB, "Daikin Holdings Singapore Pte Ltd" },

21447 { 0x644F42, "JETTER CO., Ltd." },

21448 { 0x644F74, "LENUS Co., Ltd." },

21449 { 0x644FB0, "Hyunjin.com" },

21450 { 0x6450D6, "Liquidtool Systems" },

21451 { 0x645106, "Hewlett Packard" },

21452 { 0x64517E, "LONG BEN (DONGGUAN) ELECTRONIC TECHNOLOGY CO.,LTD." },

21453 { 0x6451F4, "Huawei Device Co., Ltd." },

21454 { 0x645234, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

21455 { 0x645299, "The Chamberlain Group, Inc" },

21456 { 0x64535D, "Frauscher Sensortechnik" },

21457 { 0x6453E0, "HUAWEI TECHNOLOGIES CO.,LTD" },

21458 { 0x645422, "Equinox Payments" },

21459 { 0x645563, "Intelight Inc." },

21460 { 0x64557F, "NSFOCUS Information Technology Co., Ltd." },

21461 { 0x6455B1, "ARRIS Group, Inc." },

21462 { 0x645601, "TP-LINK TECHNOLOGIES CO.,LTD." },

21463 { 0x645725, "Hui Zhou Gaoshengda Technology Co.,LTD" },

21464 { 0x6457E5, "Beijing Royaltech Co.,Ltd" },

21465 { 0x6458AD, "China Mobile IOT Company Limited" },

21466 { 0x6459F8, "Vodafone Omnitel B.V." },

21467 { 0x645A04, "Chicony Electronics Co., Ltd." },

21468 { 0x645A36, "Apple, Inc." },

21469 { 0x645AED, "Apple, Inc." },

21470 { 0x645CF3, "ParanTek Inc." },

21471 { 0x645D86, "Intel Corporate" },

21472 { 0x645D92, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

21473 { 0x645DD7, "Shenzhen Lifesense Medical Electronics Co., Ltd." },

21474 { 0x645DF4, "Samsung Electronics Co.,Ltd" },

21475 { 0x645E10, "HUAWEI TECHNOLOGIES CO.,LTD" },

21476 { 0x645E2C, "IRay Technology Co., Ltd." },

21477 { 0x645EBE, "Yahoo! JAPAN" },

21478 { 0x645FFF, "Nicolet Neuro" },

21479 { 0x646038, "Hirschmann Automation and Control GmbH" },

21480 { 0x646140, "Huawei Device Co., Ltd." },

21481 { 0x646184, "VELUX" },

21482 { 0x646223, "Cellient Co., Ltd." },

21483 { 0x646266, "IEEE Registration Authority" },

21484 { 0x64628A, "evon GmbH" },

21485 { 0x64644A, "Beijing Xiaomi Mobile Software Co., Ltd" },

21486 { 0x64649B, "Juniper Networks" },

21487 { 0x6465C0, "Nuvon, Inc" },

21488 { 0x646624, "Sagemcom Broadband SAS" },

21489 { 0x6466B3, "TP-LINK TECHNOLOGIES CO.,LTD." },

21490 { 0x6466D8, "Samsung Electronics Co.,Ltd" },

21491 { 0x646707, "Beijing Omnific Technology, Ltd." },

21492 { 0x646772, "SERCOMM PHILIPPINES INC" },

21493 { 0x6467CD, "HUAWEI TECHNOLOGIES CO.,LTD" },

21494 { 0x64680C, "Comtrend Corporation" },

21495 { 0x646876, "Edifier International" },

21496 { 0x64694E, "Texas Instruments" },

21497 { 0x6469BC, "Hytera Communications Co .,ltd" },

21498 { 0x646A52, "Avaya Inc" },

21499 { 0x646A74, "AUTH-SERVERS, LLC" },

21500 { 0x646C80, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

21501 { 0x646CB2, "Samsung Electronics Co.,Ltd" },

21502 { 0x646D2F, "Apple, Inc." },

21503 { 0x646D4E, "HUAWEI TECHNOLOGIES CO.,LTD" },

21504 { 0x646D6C, "HUAWEI TECHNOLOGIES CO.,LTD" },

21505 { 0x646E60, "zte corporation" },

21506 { 0x646E69, "Liteon Technology Corporation" },

21507 { 0x646E6C, "Radio Datacom LLC" },

21508 { 0x646E97, "TP-LINK TECHNOLOGIES CO.,LTD." },

21509 { 0x646EE0, "Intel Corporate" },

21510 { 0x646EEA, "Iskratel d.o.o." },

21511 { 0x647002, "TP-LINK TECHNOLOGIES CO.,LTD." },

21512 { 0x647033, "Apple, Inc." },

21513 { 0x6472D8, "GooWi Technology Co.,Limited" },

21514 { 0x647366, "Shenzhen Siera Technology Ltd" },

21515 { 0x6473E2, "Arbiter Systems, Inc." },

21516 { 0x6474F6, "Shooter Detection Systems" },

21517 { 0x647657, "Innovative Security Designs" },

21518 { 0x6476BA, "Apple, Inc." },

21519 { 0x64777D, "Hitron Technologies. Inc" },

21520 { 0x647791, "Samsung Electronics Co.,Ltd" },

21521 { 0x647924, "Huawei Device Co., Ltd." },

21522 { 0x6479A7, "Phison Electronics Corp." },

21523 { 0x6479F0, "Intel Corporate" },

21524 { 0x647BCE, "Samsung Electronics Co.,Ltd" },

21525 { 0x647BD4, "Texas Instruments" },

21526 { 0x647C34, "Ubee Interactive Co., Limited" },

21527 { 0x647CE8, "Palo Alto Networks" },

21528 { 0x647D81, "YOKOTA INDUSTRIAL CO,.LTD" },

21529 { 0x647FDA, "TEKTELIC Communications Inc." },

21530 { 0x64808B, "VG Controls, Inc." },

21531 { 0x648099, "Intel Corporate" },

21532 { 0x648125, "Alphatron Marine BV" },

21533 { 0x648214, "FN-LINK TECHNOLOGY Ltd." },

21534 { 0x648505, "zte corporation" },

21535 { 0x648788, "Juniper Networks" },

21536 { 0x6487D7, "ADB Broadband Italia" },

21537 { 0x6488FF, "Sichuan Changhong Electric Ltd." },

21538 { 0x64899A, "LG Electronics (Mobile Communications)" },

21539 { 0x6489F1, "Samsung Electronics Co.,Ltd" },

21540 { 0x648CBB, "Texas Instruments" },

21541 { 0x648D9E, "IVT Electronic Co.,Ltd" },

21542 { 0x648F3E, "Cisco Systems, Inc" },

21543 { 0x6490C1, "Beijing Xiaomi Mobile Software Co., Ltd" },

21544 { 0x64956C, "LG Electronics" },

21545 { 0x649714, "eero inc." },

21546 { 0x649829, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

21547 { 0x64989E, "TRINNOV AUDIO" },

21548 { 0x64995D, "LGE" },

21549 { 0x649968, "Elentec" },

21550 { 0x6499A0, "AG Elektronik AB" },

21551 { 0x649A08, "Shenzhen SuperElectron Technology Co.,Ltd." },

21552 { 0x649A12, "P2 Mobile Technologies Limited" },

21553 { 0x649A63, "Ring LLC" },

21554 { 0x649ABE, "Apple, Inc." },

21555 { 0x649B24, "V Technology Co., Ltd." },

21556 { 0x649C81, "Qualcomm Inc." },

21557 { 0x649C8E, "Texas Instruments" },

21558 { 0x649D99, "FS COM INC" },

21559 { 0x649E31, "Beijing Xiaomi Mobile Software Co., Ltd" },

21560 { 0x649EF3, "Cisco Systems, Inc" },

21561 { 0x649FF7, "Kone OYj" },

21562 { 0x64A0E7, "Cisco Systems, Inc" },

21563 { 0x64A198, "Huawei Device Co., Ltd." },

21564 { 0x64A200, "Xiaomi Communications Co Ltd" },

21565 { 0x64A232, "OOO Samlight" },

21566 { 0x64A28A, "Huawei Device Co., Ltd." },

21567 { 0x64A2F9, "OnePlus Technology (Shenzhen) Co., Ltd" },

21568 { 0x64A341, "Wonderlan (Beijing) Technology Co., Ltd." },

21569 { 0x64A3CB, "Apple, Inc." },

21570 { 0x64A444, "Loongson Technology Corporation Limited" },

21571 { 0x64A5C3, "Apple, Inc." },

21572 { 0x64A651, "HUAWEI TECHNOLOGIES CO.,LTD" },

21573 { 0x64A68F, "Zhongshan Readboy Electronics Co.,Ltd" },

21574 { 0x64A769, "HTC Corporation" },

21575 { 0x64A7DD, "Avaya Inc" },

21576 { 0x64A837, "Juni Korea Co., Ltd" },

21577 { 0x64A965, "Linkflow Co., Ltd." },

21578 { 0x64AE0C, "Cisco Systems, Inc" },

21579 { 0x64AE88, "Polytec GmbH" },

21580 { 0x64AEF1, "Qingdao Hisense Electronics Co.,Ltd." },

21581 { 0x64B0A6, "Apple, Inc." },

21582 { 0x64B0E8, "Huawei Device Co., Ltd." },

21583 { 0x64B21D, "Chengdu Phycom Tech Co., Ltd." },

21584 { 0x64B2B4, "Fiberhome Telecommunication Technologies Co.,LTD" },

21585 { 0x64B310, "Samsung Electronics Co.,Ltd" },

21586 { 0x64B370, "PowerComm Solutions LLC" },

21587 { 0x64B379, "Jiangsu Viscore Technologies Co.,Ltd" },

21588 { 0x64B473, "Xiaomi Communications Co Ltd" },

21589 { 0x64B5C6, "Nintendo Co.,Ltd" },

21590 { 0x64B5F2, "Samsung Electronics Co.,Ltd" },

21591 { 0x64B623, "Schrack Seconet Care Communication GmbH" },

21592 { 0x64B64A, "ViVOtech, Inc." },

21593 { 0x64B708, "Espressif Inc." },

21594 { 0x64B853, "Samsung Electronics Co.,Ltd" },

21595 { 0x64B94E, "Dell Technologies" },

21596 { 0x64B9E8, "Apple, Inc." },

21597 { 0x64BABD, "SDJ Technologies, Inc." },

21598 { 0x64BB1E, "Earda Technologies co Ltd" },

21599 { 0x64BC0C, "LG Electronics (Mobile Communications)" },

21600 { 0x64BC11, "CombiQ AB" },

21601 { 0x64BC58, "Intel Corporate" },

21602 { 0x64BE63, "STORDIS GmbH" },

21603 { 0x64BF6B, "HUAWEI TECHNOLOGIES CO.,LTD" },

21604 { 0x64C17E, "cheilelectric" },

21605 { 0x64C269, "eero inc." },

21606 { 0x64C2DE, "LG Electronics (Mobile Communications)" },

21607 { 0x64C354, "Avaya Inc" },

21608 { 0x64C394, "HUAWEI TECHNOLOGIES CO.,LTD" },

21609 { 0x64C3D6, "Juniper Networks" },

21610 { 0x64C403, "Quectel Wireless Solutions Co.,Ltd." },

21611 { 0x64C582, "China Mobile Group Device Co.,Ltd." },

21612 { 0x64C5AA, "South African Broadcasting Corporation" },

21613 { 0x64C667, "Barnes&Noble" },

21614 { 0x64C6AF, "AXERRA Networks Ltd" },

21615 { 0x64C6D2, "Seiko Epson Corporation" },

21616 { 0x64C753, "Apple, Inc." },

21617 { 0x64C901, "INVENTEC Corporation" },

21618 { 0x64C944, "LARK Technologies, Inc" },

21619 { 0x64CB5D, "SIA TeleSet" },

21620 { 0x64CB9F, "TECNO MOBILE LIMITED" },

21621 { 0x64CBA3, "Pointmobile" },

21622 { 0x64CBE9, "LG Innotek" },

21623 { 0x64CC22, "Arcadyan Corporation" },

21624 { 0x64CC2E, "Xiaomi Communications Co Ltd" },

21625 { 0x64CE6E, "Sierra Wireless, ULC" },

21626 { 0x64CF13, "Weigao Nikkiso(Weihai)Dialysis Equipment Co.,Ltd" },

21627 { 0x64CFD9, "Texas Instruments" },

21628 { 0x64D02D, "NEXT GENERATION INTEGRATION LIMITED (NGI)" },

21629 { 0x64D0D6, "Samsung Electronics Co.,Ltd" },

21630 { 0x64D154, "Routerboard.com" },

21631 { 0x64D1A3, "Sitecom Europe BV" },

21632 { 0x64D241, "Keith & Koep GmbH" },

21633 { 0x64D2C4, "Apple, Inc." },

21634 { 0x64D315, "HMD Global Oy" },

21635 { 0x64D4BD, "ALPSALPINE CO,.LTD" },

21636 { 0x64D4DA, "Intel Corporate" },

21637 { 0x64D69A, "Intel Corporate" },

21638 { 0x64D7C0, "Huawei Device Co., Ltd." },

21639 { 0x64D814, "Cisco Systems, Inc" },

21640 { 0x64D81B, "Vestel Elektronik San ve Tic. A.S." },

21641 { 0x64D912, "Solidica, Inc." },

21642 { 0x64D954, "Taicang T&W Electronics" },

21643 { 0x64D989, "Cisco Systems, Inc" },

21644 { 0x64DAA0, "Robert Bosch Smart Home GmbH" },

21645 { 0x64DAED, "eero inc." },

21646 { 0x64DB18, "OpenPattern" },

21647 { 0x64DB38, "zte corporation" },

21648 { 0x64DB43, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

21649 { 0x64DB81, "Syszone Co., Ltd." },

21650 { 0x64DB8B, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

21651 { 0x64DBA0, "Select Comfort" },

21652 { 0x64DBF7, "Nokia Shanghai Bell Co., Ltd." },

21653 { 0x64DC01, "Static Systems Group PLC" },

21654 { 0x64DCDE, "ZheJiang FuChunJiang Information Technology Co.,Ltd" },

21655 { 0x64DDE9, "Xiaomi Communications Co Ltd" },

21656 { 0x64DE1C, "Kingnetic Pte Ltd" },

21657 { 0x64DF10, "JingLue Semiconductor(SH) Ltd." },

21658 { 0x64DFE9, "ATEME" },

21659 { 0x64E003, "Hui Zhou Gaoshengda Technology Co.,LTD" },

21660 { 0x64E0AB, "UNION MAN TECHNOLOGY CO.,LTD" },

21661 { 0x64E161, "DEP Corp." },

21662 { 0x64E172, "Shenzhen Qihoo Intelligent Technology Co.,Ltd" },

21663 { 0x64E204, "NTN Technical Service Corporation" },

21664 { 0x64E220, "Qisda Corporation" },

21665 { 0x64E4A5, "LG Electronics" },

21666 { 0x64E599, "EFM Networks" },

21667 { 0x64E625, "Woxu Wireless Co., Ltd" },

21668 { 0x64E682, "Apple, Inc." },

21669 { 0x64E738, "Zhejiang SUPCON Technology Co., Ltd." },

21670 { 0x64E7D8, "Samsung Electronics Co.,Ltd" },

21671 { 0x64E833, "Espressif Inc." },

21672 { 0x64E84F, "Serialway Communication Technology Co. Ltd" },

21673 { 0x64E881, "Aruba, a Hewlett Packard Enterprise Company" },

21674 { 0x64E892, "Morio Denki Co., Ltd." },

21675 { 0x64E8E6, "global moisture management system" },

21676 { 0x64E950, "Cisco Systems, Inc" },

21677 { 0x64EAC5, "SiboTech Automation Co., Ltd." },

21678 { 0x64EB8C, "Seiko Epson Corporation" },

21679 { 0x64EC65, "vivo Mobile Communication Co., Ltd." },

21680 { 0x64ED57, "ARRIS Group, Inc." },

21681 { 0x64ED62, "WOORI SYSTEMS Co., Ltd" },

21682 { 0x64EEB7, "Netis Technology Co., Ltd." },

21683 { 0x64F0AD, "Zhejiang Tmall Technology Co., Ltd." },

21684 { 0x64F242, "Gerdes Aktiengesellschaft" },

21685 { 0x64F2FB, "Hangzhou Ezviz Software Co.,Ltd." },

21686 { 0x64F50E, "Kinion Technology Company Limited" },

21687 { 0x64F54E, "EM Microelectronic" },

21688 { 0x64F69D, "Cisco Systems, Inc" },

21689 { 0x64F6BB, "Fibocom Wireless Inc." },

21690 { 0x64F6F7, "Anhui Dynamic Power Co., Ltd." },

21691 { 0x64F705, "Huawei Device Co., Ltd." },

21692 { 0x64F81C, "Huawei Technologies Co., Ltd." },

21693 { 0x64F88A, "China Mobile IOT Company Limited" },

21694 { 0x64F947, "Senscomm Semiconductor Co., Ltd." },

21695 { 0x64F970, "Kenade Electronics Technology Co.,LTD." },

21696 { 0x64F987, "Avvasi Inc." },

21697 { 0x64F9C0, "ANALOG DEVICES" },

21698 { 0x64FB01, "Zhongshan Camry Electronic Company Limited" },

21699 { 0x64FB50, "RoomReady/Zdi, Inc." },

21700 { 0x64FB81, "IEEE Registration Authority" },

21701 { 0x64FB92, "PPC Broadband Inc." },

21702 { 0x64FC8C, "Zonar Systems" },

21703 { 0x64FD29, "Zhejiang Dahua Technology Co., Ltd." },

21704 { 0x64FD96, "Sagemcom Broadband SAS" },

21705 { 0x64FF0A, "Wistron Neweb Corporation" },

21706 { 0x680235, "Konten Networks Inc." },

21707 { 0x6802B8, "Compal Broadband Networks, Inc." },

21708 { 0x680571, "Samsung Electronics Co.,Ltd" },

21709 { 0x6805CA, "Intel Corporate" },

21710 { 0x68070A, "TPVision Europe B.V" },

21711 { 0x680715, "Intel Corporate" },

21712 { 0x680927, "Apple, Inc." },

21713 { 0x680AD7, "Yancheng Kecheng Optoelectronic Technology Co., Ltd" },

21714 { 0x680AE2, "Silicon Laboratories" },

21715 { 0x68122D, "Special Instrument Development Co., Ltd." },

21716 { 0x681295, "Lupine Lighting Systems GmbH" },

21717 { 0x681324, "Huawei Device Co., Ltd." },

21718 { 0x6813E2, "Eltex Enterprise LTD" },

21719 { 0x6813F3, "Amazon Technologies Inc." },

21720 { 0x681401, "Hon Hai Precision Ind. Co.,Ltd." },

21721 { 0x681590, "Sagemcom Broadband SAS" },

21722 { 0x6815D3, "Zaklady Elektroniki i Mechaniki Precyzyjnej R&G S.A." },

21723 { 0x681605, "Systems And Electronic Development FZCO" },

21724 { 0x681729, "Intel Corporate" },

21725 { 0x6818D9, "Hill AFB - CAPRE Group" },

21726 { 0x68193F, "Digital Airways" },

21727 { 0x6819AC, "Guangzhou Xianyou Intelligent Technogoly CO., LTD" },

21728 { 0x681A7C, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

21729 { 0x681AA4, "Shenzhen Skyworth Digital Technology CO., Ltd" },

21730 { 0x681AB2, "zte corporation" },

21731 { 0x681BEF, "HUAWEI TECHNOLOGIES CO.,LTD" },

21732 { 0x681CA2, "Rosewill Inc." },

21733 { 0x681D4C, "eSystems MTG GmbH" },

21734 { 0x681D64, "Sunwave Communications Co., Ltd" },

21735 { 0x681DEF, "Shenzhen CYX Technology Co., Ltd." },

21736 { 0x681E8B, "InfoSight Corporation" },

21737 { 0x681F40, "Blu Wireless Technology Ltd" },

21738 { 0x681FD8, "Siemens Industry, Inc." },

21739 { 0x68215F, "Edgecore Networks Corporation" },

21740 { 0x68228E, "Juniper Networks" },

21741 { 0x68234B, "Nihon Dengyo Kousaku" },

21742 { 0x6823B0, "Texas Instruments" },

21743 { 0x6823F4, "Shenzhen Jinlangxin Technology Co., Ltd" },

21744 { 0x682624, "Ergatta" },

21745 { 0x68262A, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

21746 { 0x682719, "Microchip Technology Inc." },

21747 { 0x682737, "Samsung Electronics Co.,Ltd" },

21748 { 0x68275F, "zte corporation" },

21749 { 0x6828BA, "Dejai" },

21750 { 0x6828CF, "Aruba, a Hewlett Packard Enterprise Company" },

21751 { 0x6828F6, "Vubiq Networks, Inc." },

21752 { 0x6829DC, "Ficosa Electronics S.L.U." },

21753 { 0x682C4F, "leerang corporation" },

21754 { 0x682C7B, "Cisco Systems, Inc" },

21755 { 0x682D83, "SHENZHEN DINGHE COMMUNICATION COMPANY" },

21756 { 0x682DDC, "Wuhan Changjiang Electro-Communication Equipment CO.,LTD" },

21757 { 0x682F67, "Apple, Inc." },

21758 { 0x6831FE, "Teladin Co.,Ltd." },

21759 { 0x68332C, "KENSTEL NETWORKS LIMITED" },

21760 { 0x6833EE, "ARRIS Group, Inc." },

21761 { 0x683489, "LEA Professional" },

21762 { 0x683563, "SHENZHEN LIOWN ELECTRONICS CO.,LTD." },

21763 { 0x6836B5, "DriveScale, Inc." },

21764 { 0x6837E9, "Amazon Technologies Inc." },

21765 { 0x683943, "ittim" },

21766 { 0x683A1E, "Cisco Meraki" },

21767 { 0x683A48, "SAMJIN Co., Ltd." },

21768 { 0x683B1E, "Countwise LTD" },

21769 { 0x683B78, "Cisco Systems, Inc" },

21770 { 0x683C7D, "Magic Intelligence Technology Limited" },

21771 { 0x683E02, "SIEMENS AG, Digital Factory, Motion Control System" },

21772 { 0x683E26, "Intel Corporate" },

21773 { 0x683E34, "MEIZU Technology Co., Ltd." },

21774 { 0x683EC0, "Apple, Inc." },

21775 { 0x683EEC, "ERECA" },

21776 { 0x683F1E, "EFFECT Photonics B.V." },

21777 { 0x683F7D, "INGRAM MICRO SERVICES" },

21778 { 0x68403C, "Fiberhome Telecommunication Technologies Co.,LTD" },

21779 { 0x68418F, "Telechips, Inc." },

21780 { 0x684352, "Bhuu Limited" },

21781 { 0x6843D7, "Agilecom Photonics Solutions Guangdong Limited" },

21782 { 0x684571, "Huawei Device Co., Ltd." },

21783 { 0x6845CC, "Apple, Inc." },

21784 { 0x6845F1, "TOSHIBA CLIENT SOLUTIONS CO., LTD." },

21785 { 0x684724, "EM Microelectronic" },

21786 { 0x684749, "Texas Instruments" },

21787 { 0x684898, "Samsung Electronics Co.,Ltd" },

21788 { 0x684983, "HUAWEI TECHNOLOGIES CO.,LTD" },

21789 { 0x684992, "Cisco Meraki" },

21790 { 0x6849B2, "CARLO GAVAZZI LTD" },

21791 { 0x684A76, "eero inc." },

21792 { 0x684AAE, "HUAWEI TECHNOLOGIES CO.,LTD" },

21793 { 0x684AE9, "Samsung Electronics Co.,Ltd" },

21794 { 0x684B88, "Galtronics Telemetry Inc." },

21795 { 0x684CA8, "Shenzhen Herotel Tech. Co., Ltd." },

21796 { 0x684E05, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

21797 { 0x684F64, "Dell Inc." },

21798 { 0x68505D, "Halo Technologies" },

21799 { 0x6851B7, "PowerCloud Systems, Inc." },

21800 { 0x685210, "MCS Logic" },

21801 { 0x6852D6, "UGame Technology Co.,Ltd" },

21802 { 0x68536C, "SPnS Co.,Ltd" },

21803 { 0x685388, "P&S Technology" },

21804 { 0x68539D, "EM Microelectronic" },

21805 { 0x68545A, "Intel Corporate" },

21806 { 0x6854C1, "ColorTokens, Inc." },

21807 { 0x6854ED, "Alcatel-Lucent" },

21808 { 0x6854F5, "enLighted Inc" },

21809 { 0x6854FD, "Amazon Technologies Inc." },

21810 { 0x6855D4, "Seiko Epson Corporation" },

21811 { 0x68572D, "Tuya Smart Inc." },

21812 { 0x685811, "Fiberhome Telecommunication Technologies Co.,LTD" },

21813 { 0x6858C5, "ZF TRW Automotive" },

21814 { 0x685932, "Sunitec Enterprise Co.,Ltd" },

21815 { 0x68597F, "Alcatel Lucent" },

21816 { 0x685ACF, "Samsung Electronics Co.,Ltd" },

21817 { 0x685B35, "Apple, Inc." },

21818 { 0x685B36, "POWERTECH INDUSTRIAL CO., LTD." },

21819 { 0x685D43, "Intel Corporate" },

21820 { 0x685E1C, "Texas Instruments" },

21821 { 0x685E6B, "PowerRay Co., Ltd." },

21822 { 0x686350, "Hella India Automotive Pvt Ltd" },

21823 { 0x686359, "Advanced Digital Broadcast SA" },

21824 { 0x686372, "Huawei Device Co., Ltd." },

21825 { 0x68644B, "Apple, Inc." },

21826 { 0x6865B7, "Zhishang Chuanglian Technology Co., Ltd" },

21827 { 0x686725, "Espressif Inc." },

21828 { 0x68692E, "Zycoo Co.,Ltd" },

21829 { 0x686975, "Angler Labs Inc" },

21830 { 0x6869CA, "Hitachi, Ltd." },

21831 { 0x6869F2, "ComAp s.r.o." },

21832 { 0x686CE6, "Microsoft Corporation" },

21833 { 0x686DBC, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

21834 { 0x686E23, "Wi3 Inc." },

21835 { 0x686E48, "Prophet Electronic Technology Corp.,Ltd" },

21836 { 0x687161, "Cisco Systems, Inc" },

21837 { 0x687251, "Ubiquiti Inc" },

21838 { 0x6872C3, "Samsung Electronics Co.,Ltd" },

21839 { 0x6872DC, "CETORY.TV Company Limited" },

21840 { 0x687627, "Zhuhai Dingzhi Electronic Technology Co., Ltd" },

21841 { 0x68764F, "Sony Corporation" },

21842 { 0x687724, "TP-LINK TECHNOLOGIES CO.,LTD." },

21843 { 0x6877DA, "zte corporation" },

21844 { 0x687848, "WESTUNITIS CO., LTD." },

21845 { 0x68784C, "Nortel Networks" },

21846 { 0x687909, "Cisco Systems, Inc" },

21847 { 0x687912, "IEEE Registration Authority" },

21848 { 0x687924, "ELS-GmbH & Co. KG" },

21849 { 0x6879DD, "Omnipless Manufacturing (PTY) Ltd" },

21850 { 0x6879ED, "SHARP Corporation" },

21851 { 0x687A64, "Intel Corporate" },

21852 { 0x687CC8, "Measurement Systems S. de R.L." },

21853 { 0x687CD5, "Y Soft Corporation, a.s." },

21854 { 0x687D6B, "Samsung Electronics Co.,Ltd" },

21855 { 0x687DB4, "Cisco Systems, Inc" },

21856 { 0x687F74, "Cisco-Linksys, LLC" },

21857 { 0x687FF0, "TP-Link Corporation Limited" },

21858 { 0x6881E0, "HUAWEI TECHNOLOGIES CO.,LTD" },

21859 { 0x6882F2, "grandcentrix GmbH" },

21860 { 0x68831A, "Pandora Mobility Corporation" },

21861 { 0x6883CB, "Apple, Inc." },

21862 { 0x688470, "eSSys Co.,Ltd" },

21863 { 0x68847E, "FUJITSU LIMITED" },

21864 { 0x688540, "IGI Mobile, Inc." },

21865 { 0x68856A, "OuterLink Corporation" },

21866 { 0x6885A4, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

21867 { 0x6886A7, "Cisco Systems, Inc" },

21868 { 0x6886E7, "Orbotix, Inc." },

21869 { 0x68871C, "Motorola Mobility LLC, a Lenovo Company" },

21870 { 0x68876B, "INQ Mobile Limited" },

21871 { 0x6887C6, "Cisco Systems, Inc" },

21872 { 0x6888A1, "Universal Electronics, Inc." },

21873 { 0x688975, "nuoxc" },

21874 { 0x6889C1, "HUAWEI TECHNOLOGIES CO.,LTD" },

21875 { 0x688AB5, "EDP Servicos" },

21876 { 0x688AF0, "zte corporation" },

21877 { 0x688B0F, "China Mobile IOT Company Limited" },

21878 { 0x688BF4, "Arista Network, Inc." },

21879 { 0x688DB6, "AETEK INC." },

21880 { 0x688F2E, "Hitron Technologies. Inc" },

21881 { 0x688F84, "HUAWEI TECHNOLOGIES CO.,LTD" },

21882 { 0x688FC9, "Zhuolian (Shenzhen) Communication Co., Ltd" },

21883 { 0x6891D0, "IEEE Registration Authority" },

21884 { 0x689234, "Ruckus Wireless" },

21885 { 0x689320, "New H3C Technologies Co., Ltd" },

21886 { 0x68932E, "Habana Labs LTD." },

21887 { 0x689361, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

21888 { 0x689423, "Hon Hai Precision Ind. Co.,Ltd." },

21889 { 0x68944A, "zte corporation" },

21890 { 0x68962E, "HUAWEI TECHNOLOGIES CO.,LTD" },

21891 { 0x68966A, "OHSUNG" },

21892 { 0x68967B, "Apple, Inc." },

21893 { 0x68974B, "Shenzhen Costar Electronics Co. Ltd." },

21894 { 0x6897E8, "Society of Motion Picture &amp; Television Engineers" },

21895 { 0x689861, "Beacon Inc" },

21896 { 0x6899CD, "Cisco Systems, Inc" },

21897 { 0x689A21, "Fiberhome Telecommunication Technologies Co.,LTD" },

21898 { 0x689A87, "Amazon Technologies Inc." },

21899 { 0x689AB7, "Atelier Vision Corporation" },

21900 { 0x689C5E, "AcSiP Technology Corp." },

21901 { 0x689C70, "Apple, Inc." },

21902 { 0x689CE2, "Cisco Systems, Inc" },

21903 { 0x689E0B, "Cisco Systems, Inc" },

21904 { 0x689E19, "Texas Instruments" },

21905 { 0x689E29, "zte corporation" },

21906 { 0x689E6A, "Huawei Device Co., Ltd." },

21907 { 0x689FF0, "zte corporation" },

21908 { 0x68A03E, "HUAWEI TECHNOLOGIES CO.,LTD" },

21909 { 0x68A0F6, "HUAWEI TECHNOLOGIES CO.,LTD" },

21910 { 0x68A1B7, "Honghao Mingchuan Technology (Beijing) CO.,Ltd." },

21911 { 0x68A378, "FREEBOX SAS" },

21912 { 0x68A3C4, "Liteon Technology Corporation" },

21913 { 0x68A40E, "BSH Hausgeräte GmbH" },

21914 { 0x68A46A, "HUAWEI TECHNOLOGIES CO.,LTD" },

21915 { 0x68A47D, "Sun Cupid Technology (HK) LTD" },

21916 { 0x68A682, "Shenzhen YOUHUA Technology Co., Ltd" },

21917 { 0x68A7B4, "Honor Device Co., Ltd." },

21918 { 0x68A828, "HUAWEI TECHNOLOGIES CO.,LTD" },

21919 { 0x68A86D, "Apple, Inc." },

21920 { 0x68A878, "GeoWAN Pty Ltd" },

21921 { 0x68A8E1, "Wacom Co.,Ltd." },

21922 { 0x68AAC4, "Altice Labs S.A." },

21923 { 0x68AAD2, "DATECS LTD.," },

21924 { 0x68AB09, "Nokia" },

21925 { 0x68AB1E, "Apple, Inc." },

21926 { 0x68AB8A, "RF IDeas" },

21927 { 0x68ABBC, "Beijing Xiaomi Mobile Software Co., Ltd" },

21928 { 0x68AE04, "Shenzhen SuperElectron Technology Co.,Ltd." },

21929 { 0x68AE20, "Apple, Inc." },

21930 { 0x68AF13, "Futura Mobility" },

21931 { 0x68AFFF, "Shanghai Cambricon Information Technology Co., Ltd." },

21932 { 0x68B094, "INESA ELECTRON CO.,LTD" },

21933 { 0x68B35E, "Shenzhen Neostra Technology Co.Ltd" },

21934 { 0x68B43A, "WaterFurnace International, Inc." },

21935 { 0x68B599, "Hewlett Packard" },

21936 { 0x68B691, "Amazon Technologies Inc." },

21937 { 0x68B6B3, "Espressif Inc." },

21938 { 0x68B6FC, "Hitron Technologies. Inc" },

21939 { 0x68B8BB, "Beijing Xiaomi Electronics Co.,Ltd" },

21940 { 0x68B8D9, "Act KDE, Inc." },

21941 { 0x68B983, "b-plus GmbH" },

21942 { 0x68B9C2, "Earda Technologies co Ltd" },

21943 { 0x68B9D3, "Shenzhen Trolink Technology CO, LTD" },

21944 { 0x68BC0C, "Cisco Systems, Inc" },

21945 { 0x68BDAB, "Cisco Systems, Inc" },

21946 { 0x68BE49, "Nebula Matrix" },

21947 { 0x68BFC4, "Samsung Electronics Co.,Ltd" },

21948 { 0x68C44C, "Xiaomi Communications Co Ltd" },

21949 { 0x68C44D, "Motorola Mobility LLC, a Lenovo Company" },

21950 { 0x68C63A, "Espressif Inc." },

21951 { 0x68C8EB, "Rockwell Automation" },

21952 { 0x68C90B, "Texas Instruments" },

21953 { 0x68CA00, "Octopus Systems Limited" },

21954 { 0x68CAC4, "Apple, Inc." },

21955 { 0x68CAE4, "Cisco Systems, Inc" },

21956 { 0x68CC6E, "HUAWEI TECHNOLOGIES CO.,LTD" },

21957 { 0x68CC9C, "Mine Site Technologies" },

21958 { 0x68CD0F, "U Tek Company Limited" },

21959 { 0x68CE4E, "L-3 Communications Infrared Products" },

21960 { 0x68D1BA, "Shenzhen YOUHUA Technology Co., Ltd" },

21961 { 0x68D1FD, "Shenzhen Trimax Technology Co.,Ltd" },

21962 { 0x68D247, "Portalis LC" },

21963 { 0x68D40C, "TELLESCOM INDUSTRIA E COMERCIO EM TELECOMUNICACAO" },

21964 { 0x68D482, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

21965 { 0x68D48B, "Hailo Technologies Ltd." },

21966 { 0x68D6ED, "GooWi Wireless Technology Co., Limited" },

21967 { 0x68D79A, "Ubiquiti Inc" },

21968 { 0x68D925, "ProSys Development Services" },

21969 { 0x68D927, "HUAWEI TECHNOLOGIES CO.,LTD" },

21970 { 0x68D93C, "Apple, Inc." },

21971 { 0x68DA73, "IEEE Registration Authority" },

21972 { 0x68DB54, "Phicomm (Shanghai) Co., Ltd." },

21973 { 0x68DB67, "Nantong Coship Electronics Co., Ltd." },

21974 { 0x68DB96, "OPWILL Technologies CO .,LTD" },

21975 { 0x68DBCA, "Apple, Inc." },

21976 { 0x68DBF5, "Amazon Technologies Inc." },

21977 { 0x68DCE8, "PacketStorm Communications" },

21978 { 0x68DD26, "Shanghai Focus Vision Security Technology Co.,Ltd" },

21979 { 0x68DDB7, "TP-LINK TECHNOLOGIES CO.,LTD." },

21980 { 0x68DDD9, "HMD Global Oy" },

21981 { 0x68DECE, "Fiberhome Telecommunication Technologies Co.,LTD" },

21982 { 0x68DFDD, "Xiaomi Communications Co Ltd" },

21983 { 0x68E154, "SiMa.ai" },

21984 { 0x68E166, "Private" },

21985 { 0x68E1DC, "BUFFALO.INC" },

21986 { 0x68E209, "HUAWEI TECHNOLOGIES CO.,LTD" },

21987 { 0x68E41F, "Unglaube Identech GmbH" },

21988 { 0x68E478, "Qingdao Haier Technology Co.,Ltd" },

21989 { 0x68E59E, "Cisco Systems, Inc" },

21990 { 0x68E74A, "Texas Instruments" },

21991 { 0x68E7C2, "Samsung Electronics Co.,Ltd" },

21992 { 0x68E8EB, "Linktel Technologies Co.,Ltd" },

21993 { 0x68EBAE, "Samsung Electronics Co.,Ltd" },

21994 { 0x68EBC5, "Angstrem Telecom" },

21995 { 0x68EC62, "YODO Technology Corp. Ltd." },

21996 { 0x68EC8A, "IKEA of Sweden AB" },

21997 { 0x68ECC5, "Intel Corporate" },

21998 { 0x68ED43, "BlackBerry RTS" },

21999 { 0x68EDA4, "Shenzhen Seavo Technology Co.,Ltd" },

22000 { 0x68EE4B, "Sharetronic Data Technology Co.,Ltd" },

22001 { 0x68EE88, "Shenzhen TINNO Mobile Technology Corp." },

22002 { 0x68EE96, "Cisco SPVTG" },

22003 { 0x68EF43, "Apple, Inc." },

22004 { 0x68EFBD, "Cisco Systems, Inc" },

22005 { 0x68F06D, "ALONG INDUSTRIAL CO., LIMITED" },

22006 { 0x68F0B5, "Honor Device Co., Ltd." },

22007 { 0x68F0BC, "Shenzhen LiWiFi Technology Co., Ltd" },

22008 { 0x68F0D0, "SkyBell Technologies Inc." },

22009 { 0x68F125, "Data Controls Inc." },

22010 { 0x68F38E, "Juniper Networks" },

22011 { 0x68F543, "HUAWEI TECHNOLOGIES CO.,LTD" },

22012 { 0x68F63B, "Amazon Technologies Inc." },

22013 { 0x68F728, "LCFC(HeFei) Electronics Technology co., ltd" },

22014 { 0x68F895, "Redflow Limited" },

22015 { 0x68F956, "Objetivos y Servicio de Valor Añadido" },

22016 { 0x68FB7E, "Apple, Inc." },

22017 { 0x68FB95, "Generalplus Technology Inc." },

22018 { 0x68FCB3, "Next Level Security Systems, Inc." },

22019 { 0x68FCB6, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

22020 { 0x68FCCA, "Samsung Electronics Co.,Ltd" },

22021 { 0x68FEDA, "Fiberhome Telecommunication Technologies Co.,LTD" },

22022 { 0x68FEF7, "Apple, Inc." },

22023 { 0x68FF7B, "TP-LINK TECHNOLOGIES CO.,LTD." },

22024 { 0x6C006B, "Samsung Electronics Co.,Ltd" },

22025 { 0x6C0273, "Shenzhen Jin Yun Video Equipment Co., Ltd." },

22026 { 0x6C02E0, "HP Inc." },

22027 { 0x6C0309, "Cisco Systems, Inc" },

22028 { 0x6C0370, "Extreme Networks Headquarters" },

22029 { 0x6C03B5, "Cisco Systems, Inc" },

22030 { 0x6C0460, "RBH Access Technologies Inc." },

22031 { 0x6C047A, "HUAWEI TECHNOLOGIES CO.,LTD" },

22032 { 0x6C05D5, "Ethertronics Inc" },

22033 { 0x6C06D6, "Huawei Device Co., Ltd." },

22034 { 0x6C0831, "ANALOG SYSTEMS" },

22035 { 0x6C090A, "GEMATICA SRL" },

22036 { 0x6C09BF, "Fiberhome Telecommunication Technologies Co.,LTD" },

22037 { 0x6C09D6, "Digiquest Electronics LTD" },

22038 { 0x6C0B84, "Universal Global Scientific Industrial Co., Ltd." },

22039 { 0x6C0C9A, "Amazon Technologies Inc." },

22040 { 0x6C0D34, "Nokia" },

22041 { 0x6C0DC4, "Beijing Xiaomi Electronics Co., Ltd." },

22042 { 0x6C0DE1, "Dongguan Cannice Precision Manufacturing Co., Ltd." },

22043 { 0x6C0E0D, "Sony Corporation" },

22044 { 0x6C0EE6, "Chengdu Xiyida Electronic Technology Co,.Ltd" },

22045 { 0x6C0F0B, "China Mobile Group Device Co.,Ltd." },

22046 { 0x6C0F61, "Hypervolt Ltd" },

22047 { 0x6C0F6A, "JDC Tech Co., Ltd." },

22048 { 0x6C108B, "WeLink Communications" },

22049 { 0x6C11B3, "Wu Qi Technologies,Inc." },

22050 { 0x6C13D5, "Cisco Systems, Inc" },

22051 { 0x6C1414, "BUJEON ELECTRONICS Co,.Ltd" },

22052 { 0x6C146E, "HUAWEI TECHNOLOGIES CO.,LTD" },

22053 { 0x6C14F7, "Erhardt+Leimer GmbH" },

22054 { 0x6C1524, "IEEE Registration Authority" },

22055 { 0x6C1544, "Microsoft Corporation" },

22056 { 0x6C15F9, "Nautronix Limited" },

22057 { 0x6C160E, "ShotTracker" },

22058 { 0x6C1629, "Edifier International" },

22059 { 0x6C1632, "HUAWEI TECHNOLOGIES CO.,LTD" },

22060 { 0x6C1811, "Decatur Electronics" },

22061 { 0x6C198F, "D-Link International" },

22062 { 0x6C19C0, "Apple, Inc." },

22063 { 0x6C1A75, "Huawei Device Co., Ltd." },

22064 { 0x6C1B3F, "MiraeSignal Co., Ltd" },

22065 { 0x6C1C71, "Zhejiang Dahua Technology Co., Ltd." },

22066 { 0x6C1DEB, "u-blox AG" },

22067 { 0x6C1E70, "Guangzhou YBDS IT Co.,Ltd" },

22068 { 0x6C1E90, "Hansol Technics Co., Ltd." },

22069 { 0x6C1ED7, "vivo Mobile Communication Co., Ltd." },

22070 { 0x6C1FF7, "Ugreen Group Limited" },

22071 { 0x6C2056, "Cisco Systems, Inc" },

22072 { 0x6C21A2, "AMPAK Technology, Inc." },

22073 { 0x6C221A, "AltoBeam Inc." },

22074 { 0x6C22AB, "Ainsworth Game Technology" },

22075 { 0x6C2316, "TATUNG Technology Inc.," },

22076 { 0x6C23B9, "Sony Corporation" },

22077 { 0x6C23CB, "Wattty Corporation" },

22078 { 0x6C2408, "LCFC(HeFei) Electronics Technology co., ltd" },

22079 { 0x6C2483, "Microsoft Mobile Oy" },

22080 { 0x6C24A6, "vivo Mobile Communication Co., Ltd." },

22081 { 0x6C25B9, "BBK EDUCATIONAL ELECTRONICS CORP.,LTD." },

22082 { 0x6C2636, "HUAWEI TECHNOLOGIES CO.,LTD" },

22083 { 0x6C2779, "Microsoft Mobile Oy" },

22084 { 0x6C2990, "WiZ Connected Lighting Company Limited" },

22085 { 0x6C2995, "Intel Corporate" },

22086 { 0x6C29D2, "Cisco Systems, Inc" },

22087 { 0x6C2ACB, "Paxton Access Ltd" },

22088 { 0x6C2ADF, "IEEE Registration Authority" },

22089 { 0x6C2B59, "Dell Inc." },

22090 { 0x6C2C06, "OOO NPP Systemotechnika-NN" },

22091 { 0x6C2CDC, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

22092 { 0x6C2D24, "Zhen Shi Information Technology (Shanghai) Co., Ltd." },

22093 { 0x6C2E33, "Accelink Technologies Co.,Ltd." },

22094 { 0x6C2E72, "B&B EXPORTING LIMITED" },

22095 { 0x6C2E85, "Sagemcom Broadband SAS" },

22096 { 0x6C2F2C, "Samsung Electronics Co.,Ltd" },

22097 { 0x6C2F80, "Intel Corporate" },

22098 { 0x6C2F8A, "Samsung Electronics Co.,Ltd" },

22099 { 0x6C302A, "Texas Instruments" },

22100 { 0x6C310E, "Cisco Systems, Inc" },

22101 { 0x6C32DE, "Indieon Technologies Pvt. Ltd." },

22102 { 0x6C33A9, "Magicjack LP" },

22103 { 0x6C3491, "HUAWEI TECHNOLOGIES CO.,LTD" },

22104 { 0x6C3838, "Marking System Technology Co., Ltd." },

22105 { 0x6C3845, "Fiberhome Telecommunication Technologies Co.,LTD" },

22106 { 0x6C38A1, "Ubee Interactive Co., Limited" },

22107 { 0x6C391D, "Beijing ZhongHuaHun Network Information center" },

22108 { 0x6C3A36, "Glowforge Inc" },

22109 { 0x6C3A84, "Shenzhen Aero-Startech. Co.Ltd" },

22110 { 0x6C3B6B, "Routerboard.com" },

22111 { 0x6C3BE5, "Hewlett Packard" },

22112 { 0x6C3C53, "SoundHawk Corp" },

22113 { 0x6C3C7C, "CANON INC." },

22114 { 0x6C3C8C, "Dell Inc." },

22115 { 0x6C3E6D, "Apple, Inc." },

22116 { 0x6C3E9C, "KE Knestel Elektronik GmbH" },

22117 { 0x6C4008, "Apple, Inc." },

22118 { 0x6C40C6, "Nimbus Data, Inc." },

22119 { 0x6C410E, "Cisco Systems, Inc" },

22120 { 0x6C416A, "Cisco Systems, Inc" },

22121 { 0x6C42AB, "Subscriber Networks, Inc." },

22122 { 0x6C433C, "TECNO MOBILE LIMITED" },

22123 { 0x6C4418, "Zappware" },

22124 { 0x6C442A, "HUAWEI TECHNOLOGIES CO.,LTD" },

22125 { 0x6C4598, "Antex Electronic Corp." },

22126 { 0x6C45C4, "Cloudflare, Inc." },

22127 { 0x6C4760, "Sunitec Enterprise Co.,Ltd" },

22128 { 0x6C48A6, "Fiberhome Telecommunication Technologies Co.,LTD" },

22129 { 0x6C49C1, "o2ones Co., Ltd." },

22130 { 0x6C4A39, "BITA" },

22131 { 0x6C4A74, "AERODISK LLC" },

22132 { 0x6C4A85, "Apple, Inc." },

22133 { 0x6C4B7F, "Vossloh-Schwabe Deutschland GmbH" },

22134 { 0x6C4B90, "LiteON" },

22135 { 0x6C4BB4, "HUMAX Co., Ltd." },

22136 { 0x6C4CE2, "Intel Corporate" },

22137 { 0x6C4D51, "Shenzhen Ceres Technology Co., Ltd." },

22138 { 0x6C4D73, "Apple, Inc." },

22139 { 0x6C4E86, "Third Millennium Systems Ltd." },

22140 { 0x6C4EF6, "Cisco Systems, Inc" },

22141 { 0x6C504D, "Cisco Systems, Inc" },

22142 { 0x6C51BF, "Huawei Device Co., Ltd." },

22143 { 0x6C51E4, "Huawei Device Co., Ltd." },

22144 { 0x6C54CD, "LAMPEX ELECTRONICS LIMITED" },

22145 { 0x6C5563, "Samsung Electronics Co.,Ltd" },

22146 { 0x6C558D, "HUAWEI TECHNOLOGIES CO.,LTD" },

22147 { 0x6C55E8, "Vantiva USA LLC" },

22148 { 0x6C5640, "BLU Products Inc" },

22149 { 0x6C5697, "Amazon Technologies Inc." },

22150 { 0x6C5779, "Aclima, Inc." },

22151 { 0x6C5940, "MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

22152 { 0x6C5976, "Shanghai Tricheer Technology Co.,Ltd." },

22153 { 0x6C5A34, "Shenzhen Haitianxiong Electronic Co., Ltd." },

22154 { 0x6C5AB0, "TP-Link Corporation Limited" },

22155 { 0x6C5AB5, "TCL Technoly Electronics (Huizhou) Co., Ltd." },

22156 { 0x6C5C14, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

22157 { 0x6C5C3D, "IEEE Registration Authority" },

22158 { 0x6C5CB1, "Silicon Laboratories" },

22159 { 0x6C5CDE, "SunReports, Inc." },

22160 { 0x6C5D3A, "Microsoft Corporation" },

22161 { 0x6C5D63, "ShenZhen Rapoo Technology Co., Ltd." },

22162 { 0x6C5E3B, "Cisco Systems, Inc" },

22163 { 0x6C5E7A, "Ubiquitous Internet Telecom Co., Ltd" },

22164 { 0x6C5F1C, "Lenovo Mobile Communication Technology Ltd." },

22165 { 0x6C60D0, "Huawei Device Co., Ltd." },

22166 { 0x6C60EB, "ZHI YUAN ELECTRONICS CO., LIMITED" },

22167 { 0x6C6126, "Rinicom Holdings" },

22168 { 0x6C61F4, "SFR" },

22169 { 0x6C626D, "Micro-Star INT'L CO., LTD" },

22170 { 0x6C6286, "Nokia" },

22171 { 0x6C62FE, "Juniper Networks" },

22172 { 0x6C639C, "ARRIS Group, Inc." },

22173 { 0x6C641A, "Penguin Computing" },

22174 { 0x6C6567, "BELIMO Automation AG" },

22175 { 0x6C67EF, "HUAWEI TECHNOLOGIES CO.,LTD" },

22176 { 0x6C68A4, "Guangzhou V-Solution Telecommunication Technology Co.,Ltd." },

22177 { 0x6C6A77, "Intel Corporate" },

22178 { 0x6C6C0F, "HUAWEI TECHNOLOGIES CO.,LTD" },

22179 { 0x6C6CD3, "Cisco Systems, Inc" },

22180 { 0x6C6D09, "Kyowa Electronics Co.,Ltd." },

22181 { 0x6C6E07, "CE LINK LIMITED" },

22182 { 0x6C6EFE, "Core Logic Inc." },

22183 { 0x6C6F18, "Stereotaxis, Inc." },

22184 { 0x6C7039, "Novar GmbH" },

22185 { 0x6C709F, "Apple, Inc." },

22186 { 0x6C70CB, "Samsung Electronics Co.,Ltd" },

22187 { 0x6C710D, "Cisco Systems, Inc" },

22188 { 0x6C71BD, "EZELINK TELECOM" },

22189 { 0x6C71D2, "HUAWEI TECHNOLOGIES CO.,LTD" },

22190 { 0x6C71D9, "AzureWave Technology Inc." },

22191 { 0x6C7220, "D-Link International" },

22192 { 0x6C724A, "Onkyo Technology K.K." },

22193 { 0x6C72E2, "amitek" },

22194 { 0x6C72E7, "Apple, Inc." },

22195 { 0x6C750D, "WiFiSONG" },

22196 { 0x6C7637, "Huawei Device Co., Ltd." },

22197 { 0x6C7660, "KYOCERA CORPORATION" },

22198 { 0x6C79B8, "Texas Instruments" },

22199 { 0x6C7E67, "Apple, Inc." },

22200 { 0x6C7F0C, "Cisco Meraki" },

22201 { 0x6C81FE, "Mitsuba Corporation" },

22202 { 0x6C8336, "Samsung Electronics Co.,Ltd" },

22203 { 0x6C8338, "Ubihere" },

22204 { 0x6C8366, "Nanjing SAC Power Grid Automation Co., Ltd." },

22205 { 0x6C8686, "Technonia" },

22206 { 0x6C8720, "New H3C Technologies Co., Ltd" },

22207 { 0x6C8814, "Intel Corporate" },

22208 { 0x6C8AEC, "Nantong Coship Electronics Co., Ltd." },

22209 { 0x6C8B2F, "zte corporation" },

22210 { 0x6C8BD3, "Cisco Systems, Inc" },

22211 { 0x6C8CDB, "Otus Technologies Ltd" },

22212 { 0x6C8D65, "Wireless Glue Networks, Inc." },

22213 { 0x6C8D77, "Cisco Systems, Inc" },

22214 { 0x6C8DC1, "Apple, Inc." },

22215 { 0x6C8F4E, "Chongqing Yipingfang Technology Co., Ltd." },

22216 { 0x6C8FB5, "Microsoft Mobile Oy" },

22217 { 0x6C90B1, "SanLogic Inc" },

22218 { 0x6C9106, "Katena Computing Technologies" },

22219 { 0x6C92BF, "Inspur Electronic Information Industry Co.,Ltd." },

22220 { 0x6C9308, "IEEE Registration Authority" },

22221 { 0x6C9354, "Yaojin Technology (Shenzhen) Co., LTD." },

22222 { 0x6C9392, "BEKO Technologies GmbH" },

22223 { 0x6C9466, "Intel Corporate" },

22224 { 0x6C94F8, "Apple, Inc." },

22225 { 0x6C9522, "Scalys" },

22226 { 0x6C96CF, "Apple, Inc." },

22227 { 0x6C976D, "Motorola Mobility LLC, a Lenovo Company" },

22228 { 0x6C97AA, "AI TECHNOLOGY CO.,LTD." },

22229 { 0x6C98EB, "Riverbed Technology, Inc." },

22230 { 0x6C9961, "Sagemcom Broadband SAS" },

22231 { 0x6C9989, "Cisco Systems, Inc" },

22232 { 0x6C999D, "Amazon Technologies Inc." },

22233 { 0x6C9AC9, "Valentine Research, Inc." },

22234 { 0x6C9B02, "Nokia Corporation" },

22235 { 0x6C9BC0, "Chemoptics Inc." },

22236 { 0x6C9CE9, "Nimble Storage" },

22237 { 0x6C9CED, "Cisco Systems, Inc" },

22238 { 0x6C9E7C, "Fiberhome Telecommunication Technologies Co.,LTD" },

22239 { 0x6CA0B4, "SKY UK LIMITED" },

22240 { 0x6CA100, "Intel Corporate" },

22241 { 0x6CA367, "Avlinkpro" },

22242 { 0x6CA401, "essensys plc" },

22243 { 0x6CA4D1, "Fiberhome Telecommunication Technologies Co.,LTD" },

22244 { 0x6CA604, "ARRIS Group, Inc." },

22245 { 0x6CA682, "EDAM information & communications" },

22246 { 0x6CA75F, "zte corporation" },

22247 { 0x6CA780, "Nokia Corporation" },

22248 { 0x6CA7FA, "YOUNGBO ENGINEERING INC." },

22249 { 0x6CA849, "Avaya Inc" },

22250 { 0x6CA858, "Fiberhome Telecommunication Technologies Co.,LTD" },

22251 { 0x6CA906, "Telefield Ltd" },

22252 { 0x6CA928, "HMD Global Oy" },

22253 { 0x6CA936, "DisplayLink (UK) Ltd" },

22254 { 0x6CA96F, "TransPacket AS" },

22255 { 0x6CAAB3, "Ruckus Wireless" },

22256 { 0x6CAB05, "Cisco Systems, Inc" },

22257 { 0x6CAB31, "Apple, Inc." },

22258 { 0x6CAB4D, "Digital Payment Technologies" },

22259 { 0x6CAC60, "Venetex Corp" },

22260 { 0x6CACC2, "Samsung Electronics Co.,Ltd" },

22261 { 0x6CAD3F, "Hubbell Building Automation, Inc." },

22262 { 0x6CADAD, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

22263 { 0x6CADEF, "KZ Broadband Technologies, Ltd." },

22264 { 0x6CADF8, "AzureWave Technology Inc." },

22265 { 0x6CAE8B, "IBM Corporation" },

22266 { 0x6CAEE3, "Nokia" },

22267 { 0x6CAEF6, "eero inc." },

22268 { 0x6CAF15, "Webasto SE" },

22269 { 0x6CB0CE, "NETGEAR" },

22270 { 0x6CB0FD, "Shenzhen Xinghai Iot Technology Co.,Ltd" },

22271 { 0x6CB133, "Apple, Inc." },

22272 { 0x6CB158, "TP-LINK TECHNOLOGIES CO.,LTD." },

22273 { 0x6CB227, "Sony Video & Sound Products Inc." },

22274 { 0x6CB2AE, "Cisco Systems, Inc" },

22275 { 0x6CB2FD, "Texas Instruments" },

22276 { 0x6CB311, "Shenzhen Lianrui Electronics Co.,Ltd" },

22277 { 0x6CB350, "Anhui comhigher tech co.,ltd" },

22278 { 0x6CB456, "Espressif Inc." },

22279 { 0x6CB4A7, "Landauer, Inc." },

22280 { 0x6CB4FD, "Huawei Device Co., Ltd." },

22281 { 0x6CB56B, "HUMAX Co., Ltd." },

22282 { 0x6CB6CA, "DIVUS GmbH" },

22283 { 0x6CB749, "HUAWEI TECHNOLOGIES CO.,LTD" },

22284 { 0x6CB7E2, "HUAWEI TECHNOLOGIES CO.,LTD" },

22285 { 0x6CB7F4, "Samsung Electronics Co.,Ltd" },

22286 { 0x6CB881, "zte corporation" },

22287 { 0x6CB9C5, "Delta Networks, Inc." },

22288 { 0x6CBAB8, "Sagemcom Broadband SAS" },

22289 { 0x6CBEE9, "Alcatel-Lucent IPD" },

22290 { 0x6CBFB5, "Noon Technology Co., Ltd" },

22291 { 0x6CC147, "Xiamen Hanin Electronic Technology Co., Ltd" },

22292 { 0x6CC1D2, "ARRIS Group, Inc." },

22293 { 0x6CC217, "Hewlett Packard" },

22294 { 0x6CC242, "Shenzhen Skyworth Digital Technology CO., Ltd" },

22295 { 0x6CC26B, "Apple, Inc." },

22296 { 0x6CC374, "Texas Instruments" },

22297 { 0x6CC49F, "Aruba, a Hewlett Packard Enterprise Company" },

22298 { 0x6CC4D5, "HMD Global Oy" },

22299 { 0x6CC63B, "Taicang T&W Electronics" },

22300 { 0x6CC7EC, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

22301 { 0x6CCA08, "ARRIS Group, Inc." },

22302 { 0x6CCDD6, "NETGEAR" },

22303 { 0x6CCE44, "1MORE" },

22304 { 0x6CCF39, "Guangdong Starfive Technology Co., Ltd." },

22305 { 0x6CD032, "LG Electronics" },

22306 { 0x6CD146, "FRAMOS GmbH" },

22307 { 0x6CD199, "vivo Mobile Communication Co., Ltd." },

22308 { 0x6CD1B0, "WING SING ELECTRONICS HONG KONG LIMITED" },

22309 { 0x6CD1E5, "HUAWEI TECHNOLOGIES CO.,LTD" },

22310 { 0x6CD2BA, "zte corporation" },

22311 { 0x6CD3EE, "ZIMI CORPORATION" },

22312 { 0x6CD630, "Rootous System Co.,Ltd" },

22313 { 0x6CD63F, "HUAWEI TECHNOLOGIES CO.,LTD" },

22314 { 0x6CD68A, "LG Electronics (Mobile Communications)" },

22315 { 0x6CD6E3, "Cisco Systems, Inc" },

22316 { 0x6CD704, "HUAWEI TECHNOLOGIES CO.,LTD" },

22317 { 0x6CD719, "Fiberhome Telecommunication Technologies Co.,LTD" },

22318 { 0x6CD71F, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

22319 { 0x6CD869, "Guangzhou Sat Infrared Co.,LTD" },

22320 { 0x6CD94C, "vivo Mobile Communication Co., Ltd." },

22321 { 0x6CDC6A, "Promethean Limited" },

22322 { 0x6CDD30, "Cisco Systems, Inc" },

22323 { 0x6CDDBC, "Samsung Electronics Co.,Ltd" },

22324 { 0x6CDDEF, "EPCOMM Inc." },

22325 { 0x6CDEA9, "Cisco Meraki" },

22326 { 0x6CDFFB, "IEEE Registration Authority" },

22327 { 0x6CE01E, "Modcam AB" },

22328 { 0x6CE0B0, "SOUND4" },

22329 { 0x6CE2D3, "New H3C Technologies Co., Ltd" },

22330 { 0x6CE3B6, "Nera Telecommunications Ltd." },

22331 { 0x6CE4CE, "Villiger Security Solutions AG" },

22332 { 0x6CE4DA, "NEC Platforms, Ltd." },

22333 { 0x6CE5C9, "Apple, Inc." },

22334 { 0x6CE5F7, "New H3C Technologies Co., Ltd" },

22335 { 0x6CE85C, "Apple, Inc." },

22336 { 0x6CE873, "TP-LINK TECHNOLOGIES CO.,LTD." },

22337 { 0x6CE874, "HUAWEI TECHNOLOGIES CO.,LTD" },

22338 { 0x6CE8C6, "Earda Technologies co Ltd" },

22339 { 0x6CE907, "Nokia Corporation" },

22340 { 0x6CE983, "Gastron Co., LTD." },

22341 { 0x6CEBB2, "Dongguan Sen DongLv Electronics Co.,Ltd" },

22342 { 0x6CEBB6, "HUAWEI TECHNOLOGIES CO.,LTD" },

22343 { 0x6CEC5A, "Hon Hai Precision Ind. CO.,Ltd." },

22344 { 0x6CECA1, "SHENZHEN CLOU ELECTRONICS CO. LTD." },

22345 { 0x6CECEB, "Texas Instruments" },

22346 { 0x6CED51, "NEXCONTROL Co.,Ltd" },

22347 { 0x6CEEF7, "shenzhen scodeno technology co., Ltd." },

22348 { 0x6CEFC6, "SHENZHEN TWOWING TECHNOLOGIES CO.,LTD." },

22349 { 0x6CF049, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

22350 { 0x6CF17E, "Zhejiang Uniview Technologies Co.,Ltd." },

22351 { 0x6CF373, "Samsung Electronics Co.,Ltd" },

22352 { 0x6CF37F, "Aruba, a Hewlett Packard Enterprise Company" },

22353 { 0x6CF5E8, "Mooredoll Inc." },

22354 { 0x6CF6DA, "Intel Corporate" },

22355 { 0x6CF712, "Nokia Solutions and Networks GmbH & Co. KG" },

22356 { 0x6CF784, "Xiaomi Communications Co Ltd" },

22357 { 0x6CF97C, "Nanoptix Inc." },

22358 { 0x6CF9D2, "CHENGDU POVODO ELECTRONIC TECHNOLOGY CO., LTD" },

22359 { 0x6CFA58, "Avaya Inc" },

22360 { 0x6CFA89, "Cisco Systems, Inc" },

22361 { 0x6CFAA7, "AMPAK Technology, Inc." },

22362 { 0x6CFBED, "GN Audio A/S" },

22363 { 0x6CFDB9, "Proware Technologies Co Ltd." },

22364 { 0x6CFE54, "Intel Corporate" },

22365 { 0x6CFFBE, "MPB Communications Inc." },

22366 { 0x6CFFCE, "Sagemcom Broadband SAS" },

22367 { 0x700136, "FATEK Automation Corporation" },

22368 { 0x7001B5, "Cisco Systems, Inc" },

22369 { 0x700258, "01DB-METRAVIB" },

22370 { 0x70033F, "Pimax Technology(ShangHai)Co.,Ltd" },

22371 { 0x70037E, "Vantiva USA LLC" },

22372 { 0x70039F, "Espressif Inc." },

22373 { 0x70041D, "Espressif Inc." },

22374 { 0x700433, "California Things Inc." },

22375 { 0x700514, "LG Electronics (Mobile Communications)" },

22376 { 0x700692, "IEEE Registration Authority" },

22377 { 0x7006AC, "Eastcompeace Technology Co., Ltd" },

22378 { 0x700777, "OnTarget Technologies, Inc" },

22379 { 0x700971, "Samsung Electronics Co.,Ltd" },

22380 { 0x700B01, "Sagemcom Broadband SAS" },

22381 { 0x700B4F, "Cisco Systems, Inc" },

22382 { 0x700BC0, "Dewav Technology Company" },

22383 { 0x700F6A, "Cisco Systems, Inc" },

22384 { 0x700FC7, "SHENZHEN IKINLOOP TECHNOLOGY CO.,LTD." },

22385 { 0x700FEC, "Poindus Systems Corp." },

22386 { 0x70105C, "Cisco Systems, Inc" },

22387 { 0x70106F, "Hewlett Packard Enterprise" },

22388 { 0x70110E, "zte corporation" },

22389 { 0x701124, "Apple, Inc." },

22390 { 0x701135, "Livesecu co., Ltd" },

22391 { 0x7011AE, "Music Life LTD" },

22392 { 0x701404, "Limited Liability Company" },

22393 { 0x7014A6, "Apple, Inc." },

22394 { 0x70169F, "EtherCAT Technology Group" },

22395 { 0x7017D7, "Shanghai Enflame Technology Co., Ltd." },

22396 { 0x70188B, "Hon Hai Precision Ind. Co.,Ltd." },

22397 { 0x7018A7, "Cisco Systems, Inc" },

22398 { 0x70192F, "HUAWEI TECHNOLOGIES CO.,LTD" },

22399 { 0x701A04, "Liteon Technology Corporation" },

22400 { 0x701AB8, "Intel Corporate" },

22401 { 0x701AD5, "Openpath Security, Inc." },

22402 { 0x701AED, "ADVAS CO., LTD." },

22403 { 0x701BFB, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

22404 { 0x701CE7, "Intel Corporate" },

22405 { 0x701D08, "99IOT Shenzhen co.,ltd" },

22406 { 0x701D7F, "Comtech Technology Co., Ltd." },

22407 { 0x701DC4, "NorthStar Battery Company, LLC" },

22408 { 0x701E68, "Hanna Instruments, Inc." },

22409 { 0x701F0B, "WILOGY SRL" },

22410 { 0x701F3C, "Samsung Electronics Co.,Ltd" },

22411 { 0x701F53, "Cisco Systems, Inc" },

22412 { 0x702084, "Hon Hai Precision Industry Co., Ltd." },

22413 { 0x7022FE, "Apple, Inc." },

22414 { 0x702393, "fos4X GmbH" },

22415 { 0x702526, "Nokia" },

22416 { 0x702559, "CyberTAN Technology Inc." },

22417 { 0x702605, "SONY Visual Products Inc." },

22418 { 0x702804, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

22419 { 0x70288B, "Samsung Electronics Co.,Ltd" },

22420 { 0x702900, "Shenzhen ChipTrip Technology Co,Ltd" },

22421 { 0x702A7D, "EpSpot AB" },

22422 { 0x702AD5, "Samsung Electronics Co.,Ltd" },

22423 { 0x702B1D, "E-Domus International Limited" },

22424 { 0x702C09, "Nintendo Co.,Ltd" },

22425 { 0x702C1F, "Wisol" },

22426 { 0x702D84, "i4C Innovations" },

22427 { 0x702DD1, "Newings Communication CO., LTD." },

22428 { 0x702E22, "zte corporation" },

22429 { 0x702E80, "DIEHL Connectivity Solutions" },

22430 { 0x702ED9, "Guangzhou Shiyuan Electronics Co., Ltd." },

22431 { 0x702F35, "HUAWEI TECHNOLOGIES CO.,LTD" },

22432 { 0x702F4B, "Steelcase Inc." },

22433 { 0x702F86, "Marquardt GmbH" },

22434 { 0x702F97, "Aava Mobile Oy" },

22435 { 0x703018, "Avaya Inc" },

22436 { 0x70305D, "Ubiquoss Inc" },

22437 { 0x70305E, "Nanjing Zhongke Menglian Information Technology Co.,LTD" },

22438 { 0x70317F, "Apple, Inc." },

22439 { 0x703187, "ACX GmbH" },

22440 { 0x703217, "Intel Corporate" },

22441 { 0x7032D5, "Athena Wireless Communications Inc" },

22442 { 0x703509, "Cisco Systems, Inc" },

22443 { 0x7036B2, "Focusai Corp" },

22444 { 0x703811, "Siemens Mobility Limited" },

22445 { 0x7038B4, "Low Tech Solutions" },

22446 { 0x7038EE, "Avaya Inc" },

22447 { 0x703A0E, "Aruba, a Hewlett Packard Enterprise Company" },

22448 { 0x703A2D, "Shenzhen V-Link Technology CO., LTD." },

22449 { 0x703A51, "Xiaomi Communications Co Ltd" },

22450 { 0x703A73, "Shenzhen Sundray Technologies Company Limited" },

22451 { 0x703AA6, "New H3C Technologies Co., Ltd" },

22452 { 0x703ACB, "Google, Inc." },

22453 { 0x703AD8, "Shenzhen Afoundry Electronic Co., Ltd" },

22454 { 0x703C03, "RadiAnt Co.,Ltd" },

22455 { 0x703C39, "SEAWING Kft" },

22456 { 0x703C69, "Apple, Inc." },

22457 { 0x703D15, "Hangzhou H3C Technologies Co., Limited" },

22458 { 0x703E97, "Iton Technology Corp." },

22459 { 0x703EAC, "Apple, Inc." },

22460 { 0x7040FF, "Huawei Device Co., Ltd." },

22461 { 0x7041B7, "Edwards Lifesciences LLC" },

22462 { 0x7042D3, "Ruijie Networks Co.,LTD" },

22463 { 0x70441C, "SHENZHEN KAIFA TECHNOLOGY CO.,LTD." },

22464 { 0x704642, "CHYNG HONG ELECTRONIC CO., LTD." },

22465 { 0x704698, "HUAWEI TECHNOLOGIES CO.,LTD" },

22466 { 0x704777, "Ruckus Wireless" },

22467 { 0x7047E9, "vivo Mobile Communication Co., Ltd." },

22468 { 0x70480F, "Apple, Inc." },

22469 { 0x7048B5, "CTS System Co., LTD." },

22470 { 0x7048F7, "Nintendo Co.,Ltd" },

22471 { 0x704A0E, "AMPAK Technology,Inc." },

22472 { 0x704AAE, "Xstream Flow (Pty) Ltd" },

22473 { 0x704AE4, "Rinstrum Pty Ltd" },

22474 { 0x704CA5, "Fortinet, Inc." },

22475 { 0x704CB6, "Shenzhen SuperElectron Technology Co.,Ltd." },

22476 { 0x704CED, "TMRG, Inc." },

22477 { 0x704D7B, "ASUSTek COMPUTER INC." },

22478 { 0x704DE7, "TECNO MOBILE LIMITED" },

22479 { 0x704E01, "KWANGWON TECH CO., LTD." },

22480 { 0x704E66, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

22481 { 0x704E6B, "HUAWEI TECHNOLOGIES CO.,LTD" },

22482 { 0x704F08, "Shenzhen Huisheng Information Technology Co., Ltd." },

22483 { 0x704F57, "TP-LINK TECHNOLOGIES CO.,LTD." },

22484 { 0x704FB8, "ARRIS Group, Inc." },

22485 { 0x7050AF, "SKY UK LIMITED" },

22486 { 0x7050E7, "IEEE Registration Authority" },

22487 { 0x7052C5, "Avaya Inc" },

22488 { 0x7052D8, "ITEL MOBILE LIMITED" },

22489 { 0x70533F, "Alfa Instrumentos Eletronicos Ltda." },

22490 { 0x705425, "ARRIS Group, Inc." },

22491 { 0x705464, "Silicon Laboratories" },

22492 { 0x7054B4, "Vestel Elektronik San ve Tic. A.S." },

22493 { 0x7054D2, "PEGATRON CORPORATION" },

22494 { 0x7054F5, "HUAWEI TECHNOLOGIES CO.,LTD" },

22495 { 0x7055F8, "Cerebras Systems Inc" },

22496 { 0x705681, "Apple, Inc." },

22497 { 0x7057BF, "New H3C Technologies Co., Ltd" },

22498 { 0x705812, "Panasonic Corporation AVC Networks Company" },

22499 { 0x705846, "Trig Avionics Limited" },

22500 { 0x705896, "InShow Technology" },

22501 { 0x7058A4, "Actiontec Electronics Inc." },

22502 { 0x705957, "Medallion Instrumentation Systems" },

22503 { 0x705986, "OOO TTV" },

22504 { 0x705A0F, "Hewlett Packard" },

22505 { 0x705A6F, "IEEE Registration Authority" },

22506 { 0x705A9E, "Vantiva USA LLC" },

22507 { 0x705AAC, "Samsung Electronics Co.,Ltd" },

22508 { 0x705AB6, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

22509 { 0x705B2E, "M2Communication Inc." },

22510 { 0x705CAD, "Konami Gaming Inc" },

22511 { 0x705DCC, "EFM Networks" },

22512 { 0x705E55, "Realme Chongqing MobileTelecommunications Corp Ltd" },

22513 { 0x705EAA, "Action Target, Inc." },

22514 { 0x705FA3, "Xiaomi Communications Co Ltd" },

22515 { 0x7060DE, "LaVision GmbH" },

22516 { 0x706173, "Calantec GmbH" },

22517 { 0x70617B, "Cisco Systems, Inc" },

22518 { 0x7061BE, "Wistron Neweb Corporation" },

22519 { 0x7061EE, "Sunwoda Electronic Co.,Ltd" },

22520 { 0x7062B8, "D-Link International" },

22521 { 0x706417, "ORBIS TECNOLOGIA ELECTRICA S.A." },

22522 { 0x706582, "Suzhou Hanming Technologies Co., Ltd." },

22523 { 0x7065A3, "Kandao lightforge Co., Ltd." },

22524 { 0x70661B, "Sonova AG" },

22525 { 0x70662A, "Sony Interactive Entertainment Inc." },

22526 { 0x706655, "AzureWave Technology Inc." },

22527 { 0x7066B9, "Huawei Device Co., Ltd." },

22528 { 0x7066E1, "dnt Innovation GmbH" },

22529 { 0x706879, "Saijo Denki International Co., Ltd." },

22530 { 0x70695A, "Cisco Systems, Inc" },

22531 { 0x706979, "IEEE Registration Authority" },

22532 { 0x706BB9, "Cisco Systems, Inc" },

22533 { 0x706D15, "Cisco Systems, Inc" },

22534 { 0x706DEC, "Wifi-soft LLC" },

22535 { 0x706E6D, "Cisco Systems, Inc" },

22536 { 0x706F81, "Private" },

22537 { 0x70700D, "Apple, Inc." },

22538 { 0x70704C, "Purple Communications, Inc" },

22539 { 0x70708B, "Cisco Systems, Inc" },

22540 { 0x7070AA, "Amazon Technologies Inc." },

22541 { 0x7070FC, "GOLD&WATER INDUSTRIAL LIMITED" },

22542 { 0x7071B3, "Brain Corporation" },

22543 { 0x7071BC, "PEGATRON CORPORATION" },

22544 { 0x70720D, "Lenovo Mobile Communication Technology Ltd." },

22545 { 0x70723C, "HUAWEI TECHNOLOGIES CO.,LTD" },

22546 { 0x7072CF, "EdgeCore Networks" },

22547 { 0x7072FE, "Apple, Inc." },

22548 { 0x707362, "HUAWEI TECHNOLOGIES CO.,LTD" },

22549 { 0x7073CB, "Apple, Inc." },

22550 { 0x707414, "Murata Manufacturing Co., Ltd." },

22551 { 0x707630, "ARRIS Group, Inc." },

22552 { 0x7076DD, "OxyGuard Internation A/S" },

22553 { 0x7076F0, "LevelOne Communications (India) Private Limited" },

22554 { 0x7076FF, "KERLINK" },

22555 { 0x707781, "Hon Hai Precision Ind. Co.,Ltd." },

22556 { 0x70788B, "vivo Mobile Communication Co., Ltd." },

22557 { 0x707938, "Wuxi Zhanrui Electronic Technology Co.,LTD" },

22558 { 0x707990, "HUAWEI TECHNOLOGIES CO.,LTD" },

22559 { 0x7079B3, "Cisco Systems, Inc" },

22560 { 0x707BE8, "HUAWEI TECHNOLOGIES CO.,LTD" },

22561 { 0x707C18, "ADATA Technology Co., Ltd" },

22562 { 0x707C69, "Avaya Inc" },

22563 { 0x707CE3, "HUAWEI TECHNOLOGIES CO.,LTD" },

22564 { 0x707D95, "Shenzhen City LinwlanTechnology Co. Ltd." },

22565 { 0x707DB9, "Cisco Systems, Inc" },

22566 { 0x707E43, "ARRIS Group, Inc." },

22567 { 0x707EDE, "NASTEC LTD." },

22568 { 0x708105, "Cisco Systems, Inc" },

22569 { 0x708185, "New H3C Technologies Co., Ltd" },

22570 { 0x7081EB, "Apple, Inc." },

22571 { 0x70820E, "as electronics GmbH" },

22572 { 0x70828E, "OleumTech Corporation" },

22573 { 0x708540, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

22574 { 0x7085C2, "ASRock Incorporation" },

22575 { 0x7085C4, "Ruijie Networks Co.,LTD" },

22576 { 0x7085C6, "ARRIS Group, Inc." },

22577 { 0x7086C1, "Texas Instruments" },

22578 { 0x7086CE, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

22579 { 0x70879E, "Beken Corporation" },

22580 { 0x7087A7, "Murata Manufacturing Co., Ltd." },

22581 { 0x70884D, "JAPAN RADIO CO., LTD." },

22582 { 0x708976, "Tuya Smart Inc." },

22583 { 0x7089CC, "China Mobile Group Device Co.,Ltd." },

22584 { 0x7089F5, "Dongguan Lingjie IOT Co., LTD" },

22585 { 0x708A09, "HUAWEI TECHNOLOGIES CO.,LTD" },

22586 { 0x708B78, "citygrow technology co., ltd" },

22587 { 0x708BCD, "ASUSTek COMPUTER INC." },

22588 { 0x708CB6, "HUAWEI TECHNOLOGIES CO.,LTD" },

22589 { 0x708CBB, "MIMODISPLAYKOREA" },

22590 { 0x708D09, "Nokia Corporation" },

22591 { 0x708F47, "vivo Mobile Communication Co., Ltd." },

22592 { 0x709041, "Mist Systems, Inc." },

22593 { 0x7090B7, "Huawei Device Co., Ltd." },

22594 { 0x70918F, "Weber-Stephen Products LLC" },

22595 { 0x7091F3, "Universal Electronics, Inc." },

22596 { 0x709383, "Intelligent Optical Network High Tech CO.,LTD." },

22597 { 0x7093C1, "eero inc." },

22598 { 0x7093F8, "Space Monkey, Inc." },

22599 { 0x709741, "Arcadyan Corporation" },

22600 { 0x709756, "Happyelectronics Co.,Ltd" },

22601 { 0x709883, "SHENZHEN KAYAN ELECTRONICS., LTD." },

22602 { 0x70991C, "Shenzhen Honesty Electronics Co.,Ltd" },

22603 { 0x709A0B, "Italian Institute of Technology" },

22604 { 0x709BA5, "Shenzhen Y&D Electronics Co.,LTD." },

22605 { 0x709BFC, "Bryton Inc." },

22606 { 0x709C45, "HUAWEI TECHNOLOGIES CO.,LTD" },

22607 { 0x709C8F, "Nero AG" },

22608 { 0x709CD1, "Intel Corporate" },

22609 { 0x709E29, "Sony Interactive Entertainment Inc." },

22610 { 0x709E86, "X6D Limited" },

22611 { 0x709F2D, "zte corporation" },

22612 { 0x709FA9, "TECNO MOBILE LIMITED" },

22613 { 0x70A191, "Trendsetter Medical, LLC" },

22614 { 0x70A2B3, "Apple, Inc." },

22615 { 0x70A41C, "Advanced Wireless Dynamics S.L." },

22616 { 0x70A56A, "Shenzhen C-Data Technology Co., Ltd." },

22617 { 0x70A66A, "Prox Dynamics AS" },

22618 { 0x70A6BD, "Honor Device Co., Ltd." },

22619 { 0x70A6CC, "Intel Corporate" },

22620 { 0x70A741, "Ubiquiti Inc" },

22621 { 0x70A84C, "MONAD., Inc." },

22622 { 0x70A8D3, "Intel Corporate" },

22623 { 0x70A8E3, "HUAWEI TECHNOLOGIES CO.,LTD" },

22624 { 0x70A983, "Cisco Systems, Inc" },

22625 { 0x70AAB2, "BlackBerry RTS" },

22626 { 0x70AC08, "Silicon Laboratories" },

22627 { 0x70ACD7, "Shenzhen YOUHUA Technology Co., Ltd" },

22628 { 0x70AD54, "Malvern Instruments Ltd" },

22629 { 0x70AED5, "Apple, Inc." },

22630 { 0x70AF24, "TP Vision Belgium NV" },

22631 { 0x70AF25, "Nishiyama Industry Co.,LTD." },

22632 { 0x70AF6A, "SHENZHEN FENGLIAN TECHNOLOGY CO., LTD." },

22633 { 0x70B035, "Shenzhen Zowee Technology Co., Ltd" },

22634 { 0x70B08C, "Shenou Communication Equipment Co.,Ltd" },

22635 { 0x70B13D, "Samsung Electronics Co.,Ltd" },

22636 { 0x70B14E, "ARRIS Group, Inc." },

22637 { 0x70B265, "Hiltron s.r.l." },

22638 { 0x70B306, "Apple, Inc." },

22639 { 0x70B317, "Cisco Systems, Inc" },

22640 { 0x70B3D5, "IEEE Registration Authority" },

22641 { 0x70B599, "Embedded Technologies s.r.o." },

22642 { 0x70B5E8, "Dell Inc." },

22643 { 0x70B64F, "Guangzhou V-SOLUTION Electronic Technology Co., Ltd." },

22644 { 0x70B651, "Eight Sleep" },

22645 { 0x70B7AA, "vivo Mobile Communication Co., Ltd." },

22646 { 0x70B7E2, "Jiangsu Miter Technology Co.,Ltd." },

22647 { 0x70B7E4, "Broadcom Limited" },

22648 { 0x70B8F6, "Espressif Inc." },

22649 { 0x70B921, "Fiberhome Telecommunication Technologies Co.,LTD" },

22650 { 0x70B950, "Texas Instruments" },

22651 { 0x70B9BB, "Shenzhen Hankvision Technology CO.,LTD" },

22652 { 0x70BAEF, "Hangzhou H3C Technologies Co., Limited" },

22653 { 0x70BB5B, "Apple, Inc." },

22654 { 0x70BBE9, "Xiaomi Communications Co Ltd" },

22655 { 0x70BC10, "Microsoft Corporation" },

22656 { 0x70BC48, "Cisco Systems, Inc" },

22657 { 0x70BDD2, "Adva Network Security GmbH" },

22658 { 0x70BF3E, "Charles River Laboratories" },

22659 { 0x70BF92, "GN Audio A/S" },

22660 { 0x70C6AC, "Bosch Automotive Aftermarket" },

22661 { 0x70C6DD, "New H3C Technologies Co., Ltd" },

22662 { 0x70C76F, "INNO S" },

22663 { 0x70C7F2, "HUAWEI TECHNOLOGIES CO.,LTD" },

22664 { 0x70C833, "Wirepas Oy" },

22665 { 0x70C912, "Sichuan AI-Link Technology Co., Ltd." },

22666 { 0x70C932, "Dreame Technology (Suzhou) Limited" },

22667 { 0x70C94E, "Liteon Technology Corporation" },

22668 { 0x70C9C6, "Cisco Systems, Inc" },

22669 { 0x70CA4D, "Shenzhen lnovance Technology Co.,Ltd." },

22670 { 0x70CA97, "Ruckus Wireless" },

22671 { 0x70CA9B, "Cisco Systems, Inc" },

22672 { 0x70CD0D, "Intel Corporate" },

22673 { 0x70CD60, "Apple, Inc." },

22674 { 0x70CD91, "TERACOM TELEMATICA S.A" },

22675 { 0x70CE8C, "Samsung Electronics Co.,Ltd" },

22676 { 0x70CF49, "Intel Corporate" },

22677 { 0x70D081, "Beijing Netpower Technologies Inc." },

22678 { 0x70D313, "HUAWEI TECHNOLOGIES CO.,LTD" },

22679 { 0x70D379, "Cisco Systems, Inc" },

22680 { 0x70D4F2, "RIM" },

22681 { 0x70D51E, "Fiberhome Telecommunication Technologies Co.,LTD" },

22682 { 0x70D57E, "Scalar Corporation" },

22683 { 0x70D5E7, "Wellcore Corporation" },

22684 { 0x70D6B6, "Metrum Technologies" },

22685 { 0x70D823, "Intel Corporate" },

22686 { 0x70D880, "Upos System sp. z o.o." },

22687 { 0x70D8C2, "Intel Corporate" },

22688 { 0x70D923, "vivo Mobile Communication Co., Ltd." },

22689 { 0x70D931, "Cambridge Industries(Group) Co.,Ltd." },

22690 { 0x70DA17, "Austrian Audio GmbH" },

22691 { 0x70DA48, "Cisco Systems, Inc" },

22692 { 0x70DA9C, "TECSEN" },

22693 { 0x70DB98, "Cisco Systems, Inc" },

22694 { 0x70DDA1, "Tellabs" },

22695 { 0x70DDA8, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

22696 { 0x70DDEF, "Huawei Device Co., Ltd." },

22697 { 0x70DEE2, "Apple, Inc." },

22698 { 0x70DEF9, "FAI WAH INTERNATIONAL (HONG KONG) LIMITED" },

22699 { 0x70DF2F, "Cisco Systems, Inc" },

22700 { 0x70DFF7, "ARRIS Group, Inc." },

22701 { 0x70E027, "HONGYU COMMUNICATION TECHNOLOGY LIMITED" },

22702 { 0x70E139, "3view Ltd" },

22703 { 0x70E1FD, "FLEXTRONICS" },

22704 { 0x70E24C, "SAE IT-systems GmbH & Co. KG" },

22705 { 0x70E284, "Wistron Infocomm (Zhongshan) Corporation" },

22706 { 0x70E422, "Cisco Systems, Inc" },

22707 { 0x70E46E, "Lytx" },

22708 { 0x70E56E, "Texas Instruments" },

22709 { 0x70E72C, "Apple, Inc." },

22710 { 0x70E843, "Beijing C&W Optical Communication Technology Co.,Ltd." },

22711 { 0x70EA1A, "Cisco Systems, Inc" },

22712 { 0x70EA5A, "Apple, Inc." },

22713 { 0x70ECE4, "Apple, Inc." },

22714 { 0x70EE50, "Netatmo" },

22715 { 0x70EEA3, "Eoptolink Technology Inc. Ltd," },

22716 { 0x70EF00, "Apple, Inc." },

22717 { 0x70F087, "Apple, Inc." },

22718 { 0x70F088, "Nintendo Co.,Ltd" },

22719 { 0x70F096, "Cisco Systems, Inc" },

22720 { 0x70F11C, "Shenzhen Ogemray Technology Co.,Ltd" },

22721 { 0x70F176, "Data Modul AG" },

22722 { 0x70F196, "Actiontec Electronics, Inc" },

22723 { 0x70F1A1, "Liteon Technology Corporation" },

22724 { 0x70F1E5, "Xetawave LLC" },

22725 { 0x70F220, "Actiontec Electronics, Inc" },

22726 { 0x70F35A, "Cisco Systems, Inc" },

22727 { 0x70F395, "Universal Global Scientific Industrial Co., Ltd." },

22728 { 0x70F6CF, "Relay, Inc." },

22729 { 0x70F754, "AMPAK Technology,Inc." },

22730 { 0x70F82B, "DWnet Technologies(Suzhou) Corporation" },

22731 { 0x70F8AE, "Microsoft Corporation" },

22732 { 0x70F8E7, "IEEE Registration Authority" },

22733 { 0x70F927, "Samsung Electronics Co.,Ltd" },

22734 { 0x70F96D, "Hangzhou H3C Technologies Co., Limited" },

22735 { 0x70FC8C, "OneAccess SA" },

22736 { 0x70FC8F, "FREEBOX SAS" },

22737 { 0x70FD45, "HUAWEI TECHNOLOGIES CO.,LTD" },

22738 { 0x70FD46, "Samsung Electronics Co.,Ltd" },

22739 { 0x70FD88, "Nanjing Jiahao Technology Co., Ltd." },

22740 { 0x70FF5C, "Cheerzing Communication(Xiamen)Technology Co.,Ltd" },

22741 { 0x70FF76, "Texas Instruments" },

22742 { 0x7403BD, "BUFFALO.INC" },

22743 { 0x74042B, "Lenovo Mobile Communication (Wuhan) Company Limited" },

22744 { 0x7404F0, "Mobiwire Mobiles (NingBo) Co., LTD" },

22745 { 0x7404F1, "Intel Corporate" },

22746 { 0x74057C, "Qorvo International Pte. Ltd." },

22747 { 0x7405A5, "TP-LINK TECHNOLOGIES CO.,LTD." },

22748 { 0x740635, "SERNET (SUZHOU) TECHNOLOGIES CORPORATION" },

22749 { 0x74077E, "Quectel Wireless Solutions Co.,Ltd." },

22750 { 0x7408DE, "Fujian Landi Commercial Technology Co., Ltd." },

22751 { 0x7409AC, "Quext, LLC" },

22752 { 0x740ABC, "LightwaveRF Technology Ltd" },

22753 { 0x740AE1, "Huawei Device Co., Ltd." },

22754 { 0x740BB0, "Hirschmann Automation and Control GmbH" },

22755 { 0x740CEE, "Huawei Device Co., Ltd." },

22756 { 0x740EA4, "Apple, Inc." },

22757 { 0x740EDB, "Optowiz Co., Ltd" },

22758 { 0x7411B2, "Cisco Systems, Inc" },

22759 { 0x7412B3, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

22760 { 0x7412BB, "Fiberhome Telecommunication Technologies Co.,LTD" },

22761 { 0x7413EA, "Intel Corporate" },

22762 { 0x741489, "SRT Wireless" },

22763 { 0x741575, "Xiaomi Communications Co Ltd" },

22764 { 0x7415E2, "Tri-Sen Systems Corporation" },

22765 { 0x7415F5, "Apple, Inc." },

22766 { 0x741865, "Shanghai DareGlobal Technologies Co.,Ltd" },

22767 { 0x74190A, "Samsung Electronics Co.,Ltd" },

22768 { 0x7419F8, "IEEE Registration Authority" },

22769 { 0x741AE0, "IEEE Registration Authority" },

22770 { 0x741BB2, "Apple, Inc." },

22771 { 0x741C27, "ITEL MOBILE LIMITED" },

22772 { 0x741E93, "Fiberhome Telecommunication Technologies Co.,LTD" },

22773 { 0x741F4A, "Hangzhou H3C Technologies Co., Limited" },

22774 { 0x741F79, "YOUNGKOOK ELECTRONICS CO.,LTD" },

22775 { 0x74205F, "Shenzhen Zhongruixin Intelligent Technology Co., Ltd." },

22776 { 0x7422BB, "Huawei Device Co., Ltd." },

22777 { 0x742344, "Xiaomi Communications Co Ltd" },

22778 { 0x74249F, "TIBRO Corp." },

22779 { 0x74258A, "Hangzhou H3C Technologies Co., Limited" },

22780 { 0x7426AC, "Cisco Systems, Inc" },

22781 { 0x7426FF, "zte corporation" },

22782 { 0x74272C, "Advanced Micro Devices, Inc." },

22783 { 0x74273C, "ChangYang Technology (Nanjing) Co., LTD" },

22784 { 0x7427EA, "Elitegroup Computer Systems Co.,Ltd." },

22785 { 0x742857, "Mayfield Robotics" },

22786 { 0x7429AF, "Hon Hai Precision Ind. Co.,Ltd." },

22787 { 0x742A8A, "shenzhen worldelite electronics co., LTD" },

22788 { 0x742B0F, "Infinidat Ltd." },

22789 { 0x742B62, "FUJITSU LIMITED" },

22790 { 0x742D0A, "Norfolk Elektronik AG" },

22791 { 0x742E4F, "Stienen Group" },

22792 { 0x742EDB, "Perinet GmbH" },

22793 { 0x742EFC, "DirectPacket Research, Inc," },

22794 { 0x742F68, "AzureWave Technology Inc." },

22795 { 0x74309D, "Infinix mobility limited" },

22796 { 0x7430AF, "Fiberhome Telecommunication Technologies Co.,LTD" },

22797 { 0x743170, "Arcadyan Technology Corporation" },

22798 { 0x743174, "Apple, Inc." },

22799 { 0x743256, "NT-ware Systemprg GmbH" },

22800 { 0x7432C2, "KYOLIS" },

22801 { 0x743357, "vivo Mobile Communication Co., Ltd." },

22802 { 0x7433A6, "Shenzhen SuperElectron Technology Co.,Ltd." },

22803 { 0x7433E9, "zte corporation" },

22804 { 0x743400, "MTG Co., Ltd." },

22805 { 0x74342B, "HUAWEI TECHNOLOGIES CO.,LTD" },

22806 { 0x7434AE, "this is engineering Inc." },

22807 { 0x74366D, "Vodafone Italia S.p.A." },

22808 { 0x74372F, "Tongfang Shenzhen Cloudcomputing Technology Co.,Ltd" },

22809 { 0x74373B, "UNINET Co.,Ltd." },

22810 { 0x74375F, "SERCOMM PHILIPPINES INC" },

22811 { 0x743822, "Xiaomi Communications Co Ltd" },

22812 { 0x743889, "ANNAX Anzeigesysteme GmbH" },

22813 { 0x7438B7, "CANON INC." },

22814 { 0x743A20, "New H3C Technologies Co., Ltd" },

22815 { 0x743A65, "NEC Corporation" },

22816 { 0x743AEF, "Kaon Group Co., Ltd." },

22817 { 0x743AF4, "Intel Corporate" },

22818 { 0x743C18, "Taicang T&W Electronics" },

22819 { 0x743E2B, "Ruckus Wireless" },

22820 { 0x743E39, "YUSUR Technology Co., Ltd." },

22821 { 0x743ECB, "Gentrice tech" },

22822 { 0x743FC2, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

22823 { 0x7440BB, "Hon Hai Precision Ind. Co.,Ltd." },

22824 { 0x7440BE, "LG Innotek" },

22825 { 0x74427F, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

22826 { 0x74428B, "Apple, Inc." },

22827 { 0x744401, "NETGEAR" },

22828 { 0x74452D, "Huawei Device Co., Ltd." },

22829 { 0x74458A, "Samsung Electronics Co.,Ltd" },

22830 { 0x7445CE, "CRESYN" },

22831 { 0x744687, "Kingsignal Technology Co., Ltd." },

22832 { 0x7446A0, "Hewlett Packard" },

22833 { 0x7446B3, "Texas Instruments" },

22834 { 0x7449D2, "New H3C Technologies Co., Ltd" },

22835 { 0x744AA4, "zte corporation" },

22836 { 0x744BE9, "EXPLORER HYPERTECH CO.,LTD" },

22837 { 0x744CA1, "Liteon Technology Corporation" },

22838 { 0x744D28, "Routerboard.com" },

22839 { 0x744D6D, "HUAWEI TECHNOLOGIES CO.,LTD" },

22840 { 0x744D79, "Arrive Systems Inc." },

22841 { 0x744DBD, "Espressif Inc." },

22842 { 0x744DDC, "Sonim Technologies, Inc" },

22843 { 0x74504E, "New H3C Technologies Co., Ltd" },

22844 { 0x7451BA, "Xiaomi Communications Co Ltd" },

22845 { 0x745327, "COMMSEN CO., LIMITED" },

22846 { 0x7453A8, "ACL Airshop BV" },

22847 { 0x745427, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

22848 { 0x74546B, "hangzhou zhiyi communication co., ltd" },

22849 { 0x74547D, "Cisco SPVTG" },

22850 { 0x745612, "ARRIS Group, Inc." },

22851 { 0x74563C, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

22852 { 0x745798, "TRUMPF Laser GmbH + Co. KG" },

22853 { 0x745889, "Multilaser Industrial S.A." },

22854 { 0x7458F3, "Amazon Technologies Inc." },

22855 { 0x745909, "HUAWEI TECHNOLOGIES CO.,LTD" },

22856 { 0x745933, "Danal Entertainment" },

22857 { 0x745AAA, "HUAWEI TECHNOLOGIES CO.,LTD" },

22858 { 0x745BC5, "IEEE Registration Authority" },

22859 { 0x745C4B, "GN Audio A/S" },

22860 { 0x745C9F, "TCT mobile ltd" },

22861 { 0x745CFA, "Shenzhen Shunrui Gaojie Technology Co., Ltd." },

22862 { 0x745D22, "LCFC(HeFei) Electronics Technology co., ltd" },

22863 { 0x745D43, "BSH Hausgeraete GmbH" },

22864 { 0x745D68, "Fiberhome Telecommunication Technologies Co.,LTD" },

22865 { 0x745E1C, "PIONEER CORPORATION" },

22866 { 0x745F00, "Samsung Semiconductor Inc." },

22867 { 0x745F90, "LAM Technologies" },

22868 { 0x745FAE, "TSL PPL" },

22869 { 0x74604C, "RODE" },

22870 { 0x7460FA, "HUAWEI TECHNOLOGIES CO.,LTD" },

22871 { 0x74614B, "Chongqing Huijiatong Information Technology Co., Ltd." },

22872 { 0x7463C2, "Huawei Device Co., Ltd." },

22873 { 0x7463DF, "VTS GmbH" },

22874 { 0x74650C, "Apple, Inc." },

22875 { 0x7465D1, "Atlinks" },

22876 { 0x746630, "T:mi Ytti" },

22877 { 0x7467F7, "Extreme Networks Headquarters" },

22878 { 0x74694A, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

22879 { 0x746A3A, "Aperi Corporation" },

22880 { 0x746A89, "Rezolt Corporation" },

22881 { 0x746A8F, "VS Vision Systems GmbH" },

22882 { 0x746B82, "MOVEK" },

22883 { 0x746BAB, "GUANGDONG ENOK COMMUNICATION CO., LTD" },

22884 { 0x746EE4, "Asia Vital Components Co.,Ltd." },

22885 { 0x746F19, "ICARVISIONS (SHENZHEN) TECHNOLOGY CO., LTD." },

22886 { 0x746F3D, "Contec GmbH" },

22887 { 0x746F88, "zte corporation" },

22888 { 0x746FF7, "Wistron Neweb Corporation" },

22889 { 0x747069, "Huawei Device Co., Ltd." },

22890 { 0x7470FD, "Intel Corporate" },

22891 { 0x74718B, "Apple, Inc." },

22892 { 0x74721E, "Edison Labs Inc." },

22893 { 0x7472B0, "Guangzhou Shiyuan Electronics Co., Ltd." },

22894 { 0x7472F2, "Chipsip Technology Co., Ltd." },

22895 { 0x74731D, "ifm electronic gmbh" },

22896 { 0x747336, "MICRODIGTAL Inc" },

22897 { 0x7473B4, "Apple, Inc." },

22898 { 0x7473E2, "Hillstone Networks Corp." },

22899 { 0x747446, "Google, Inc." },

22900 { 0x747548, "Amazon Technologies Inc." },

22901 { 0x74765B, "Quectel Wireless Solutions Co.,Ltd." },

22902 { 0x74767D, "shenzhen kexint technology co.,ltd" },

22903 { 0x747818, "Jurumani Solutions" },

22904 { 0x747827, "Dell Inc." },

22905 { 0x7478A6, "Fortinet, Inc." },

22906 { 0x747A90, "Murata Manufacturing Co., Ltd." },

22907 { 0x747B7A, "ETH Inc." },

22908 { 0x747D24, "Phicomm (Shanghai) Co., Ltd." },

22909 { 0x747DB6, "Aliwei Communications, Inc" },

22910 { 0x747E1A, "Red Embedded Design Limited" },

22911 { 0x747E2D, "Beijing Thomson CITIC Digital Technology Co. LTD." },

22912 { 0x74803F, "Renesas Electronics (Penang) Sdn. Bhd." },

22913 { 0x748114, "Apple, Inc." },

22914 { 0x74819A, "PT. Hartono Istana Teknologi" },

22915 { 0x7483C2, "Ubiquiti Inc" },

22916 { 0x7483EF, "Arista Networks" },

22917 { 0x748469, "Nintendo Co.,Ltd" },

22918 { 0x7484E1, "Dongguan Haoyuan Electronics Co.,Ltd" },

22919 { 0x74852A, "PEGATRON CORPORATION" },

22920 { 0x7485C4, "New H3C Technologies Co., Ltd" },

22921 { 0x74860B, "Cisco Systems, Inc" },

22922 { 0x748669, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

22923 { 0x74867A, "Dell Inc." },

22924 { 0x7486E2, "Dell Inc." },

22925 { 0x74872E, "HUAWEI TECHNOLOGIES CO.,LTD" },

22926 { 0x7487A9, "OCT Technology Co., Ltd." },

22927 { 0x7487BB, "Ciena Corporation" },

22928 { 0x74882A, "HUAWEI TECHNOLOGIES CO.,LTD" },

22929 { 0x74888B, "ADB Broadband Italia" },

22930 { 0x7488BB, "Cisco Systems, Inc" },

22931 { 0x748A0D, "ARRIS Group, Inc." },

22932 { 0x748A28, "HMD Global Oy" },

22933 { 0x748A69, "Korea Image Technology Co., Ltd" },

22934 { 0x748B29, "Micobiomed" },

22935 { 0x748B34, "Shanghai Smart System Technology Co., Ltd" },

22936 { 0x748D08, "Apple, Inc." },

22937 { 0x748E08, "Bestek Corp." },

22938 { 0x748EF8, "Brocade Communications Systems LLC" },

22939 { 0x748F1B, "MasterImage 3D" },

22940 { 0x748F3C, "Apple, Inc." },

22941 { 0x748F4D, "duagon Germany GmbH" },

22942 { 0x748FC2, "Cisco Systems, Inc" },

22943 { 0x74901F, "Ragile Networks Inc." },

22944 { 0x749050, "Renesas Electronics Corporation" },

22945 { 0x7490BC, "Arcadyan Corporation" },

22946 { 0x74911A, "Ruckus Wireless" },

22947 { 0x7491BD, "Four systems Co.,Ltd." },

22948 { 0x7492BA, "Movesense Ltd" },

22949 { 0x7493A4, "Zebra Technologies Corp." },

22950 { 0x7493DA, "ASKEY COMPUTER CORP" },

22951 { 0x74943D, "AgJunction" },

22952 { 0x749552, "Xuzhou WIKA Electronics Control Technology Co., Ltd." },

22953 { 0x7495A7, "Keyence Corporation" },

22954 { 0x7495EC, "ALPSALPINE CO,.LTD" },

22955 { 0x749637, "Todaair Electronic Co., Ltd" },

22956 { 0x749779, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

22957 { 0x749781, "zte corporation" },

22958 { 0x74978E, "Nova Labs" },

22959 { 0x749975, "IBM Corporation" },

22960 { 0x749AC0, "Cachengo, Inc." },

22961 { 0x749B89, "HUAWEI TECHNOLOGIES CO.,LTD" },

22962 { 0x749BE8, "Hitron Technologies. Inc" },

22963 { 0x749C52, "Huizhou Desay SV Automotive Co., Ltd." },

22964 { 0x749CE3, "KodaCloud Canada, Inc" },

22965 { 0x749D79, "Sercomm Corporation." },

22966 { 0x749D8F, "HUAWEI TECHNOLOGIES CO.,LTD" },

22967 { 0x749DDC, "2Wire Inc" },

22968 { 0x749E75, "Aruba, a Hewlett Packard Enterprise Company" },

22969 { 0x749EA5, "OHSUNG" },

22970 { 0x749EAF, "Apple, Inc." },

22971 { 0x749EF5, "Samsung Electronics Co.,Ltd" },

22972 { 0x74A02F, "Cisco Systems, Inc" },

22973 { 0x74A063, "HUAWEI TECHNOLOGIES CO.,LTD" },

22974 { 0x74A2E6, "Cisco Systems, Inc" },

22975 { 0x74A34A, "ZIMI CORPORATION" },

22976 { 0x74A4A7, "QRS Music Technologies, Inc." },

22977 { 0x74A4B5, "Powerleader Science and Technology Co. Ltd." },

22978 { 0x74A528, "HUAWEI TECHNOLOGIES CO.,LTD" },

22979 { 0x74A58C, "Texas Instruments" },

22980 { 0x74A6CD, "Apple, Inc." },

22981 { 0x74A722, "LG Electronics (Mobile Communications)" },

22982 { 0x74A78E, "zte corporation" },

22983 { 0x74A7EA, "Amazon Technologies Inc." },

22984 { 0x74AB93, "Blink by Amazon" },

22985 { 0x74AC5F, "Qiku Internet Network Scientific (Shenzhen) Co., Ltd." },

22986 { 0x74ACB9, "Ubiquiti Inc" },

22987 { 0x74AD98, "Cisco Systems, Inc" },

22988 { 0x74ADB7, "China Mobile Group Device Co.,Ltd." },

22989 { 0x74AE76, "iNovo Broadband, Inc." },

22990 { 0x74B00C, "Network Video Technologies, Inc" },

22991 { 0x74B059, "Motorola Mobility LLC, a Lenovo Company" },

22992 { 0x74B472, "CIESSE" },

22993 { 0x74B57E, "zte corporation" },

22994 { 0x74B587, "Apple, Inc." },

22995 { 0x74B6B6, "eero inc." },

22996 { 0x74B725, "Huawei Device Co., Ltd." },

22997 { 0x74B7B3, "Shenzhen YOUHUA Technology Co., Ltd" },

22998 { 0x74B7E6, "Zegna-Daidong Limited" },

22999 { 0x74B80F, "Zipline International Inc." },

23000 { 0x74B839, "Texas Instruments" },

23001 { 0x74B91E, "Nanjing Bestway Automation System Co., Ltd" },

23002 { 0x74B9EB, "JinQianMao Technology Co.,Ltd." },

23003 { 0x74BADB, "Longconn Electornics(shenzhen)Co.,Ltd" },

23004 { 0x74BBD3, "Shenzhen xeme Communication Co., Ltd." },

23005 { 0x74BE08, "ATEK Products, LLC" },

23006 { 0x74BFA1, "HYUNTECK" },

23007 { 0x74BFB7, "Nusoft Corporation" },

23008 { 0x74BFC0, "CANON INC." },

23009 { 0x74C14F, "HUAWEI TECHNOLOGIES CO.,LTD" },

23010 { 0x74C17D, "Infinix mobility limited" },

23011 { 0x74C246, "Amazon Technologies Inc." },

23012 { 0x74C330, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

23013 { 0x74C530, "vivo Mobile Communication Co., Ltd." },

23014 { 0x74C621, "Zhejiang Hite Renewable Energy Co.,LTD" },

23015 { 0x74C63B, "AzureWave Technology Inc." },

23016 { 0x74C64A, "AGOS Co.,Ltd" },

23017 { 0x74C76E, "RTK-TECHNOLOGIES, LLC" },

23018 { 0x74C929, "Zhejiang Dahua Technology Co., Ltd." },

23019 { 0x74C99A, "Ericsson AB" },

23020 { 0x74C9A3, "Fiberhome Telecommunication Technologies Co.,LTD" },

23021 { 0x74CA25, "Calxeda, Inc." },

23022 { 0x74CA60, "Sonos, Inc." },

23023 { 0x74CBF3, "Lava international limited" },

23024 { 0x74CC39, "Fiberhome Telecommunication Technologies Co.,LTD" },

23025 { 0x74CD0C, "Smith Myers Communications Ltd." },

23026 { 0x74CE56, "Packet Force Technology Limited Company" },

23027 { 0x74CF00, "Shenzhen SuperElectron Technology Co.,Ltd." },

23028 { 0x74D02B, "ASUSTek COMPUTER INC." },

23029 { 0x74D0DC, "Ericsson AB" },

23030 { 0x74D21D, "HUAWEI TECHNOLOGIES CO.,LTD" },

23031 { 0x74D285, "Texas Instruments" },

23032 { 0x74D423, "Amazon Technologies Inc." },

23033 { 0x74D435, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

23034 { 0x74D4DD, "Quanta Computer Inc." },

23035 { 0x74D558, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

23036 { 0x74D5C6, "Microchip Technologies Inc" },

23037 { 0x74D637, "Amazon Technologies Inc." },

23038 { 0x74D654, "GINT" },

23039 { 0x74D675, "WYMA Tecnologia" },

23040 { 0x74D6CB, "New H3C Technologies Co., Ltd" },

23041 { 0x74D6E5, "Huawei Device Co., Ltd." },

23042 { 0x74D6EA, "Texas Instruments" },

23043 { 0x74D713, "Huaqin Technology Co. LTD" },

23044 { 0x74D7CA, "Panasonic Automotive Systems Co.,Ltd" },

23045 { 0x74D83E, "Intel Corporate" },

23046 { 0x74D850, "Evrisko Systems" },

23047 { 0x74D873, "GUANGDONG GENIUS TECHNOLOGY CO., LTD." },

23048 { 0x74D9EB, "Petabit Scale, Inc." },

23049 { 0x74DA38, "Edimax Technology Co. Ltd." },

23050 { 0x74DA88, "TP-LINK TECHNOLOGIES CO.,LTD." },

23051 { 0x74DADA, "D-Link International" },

23052 { 0x74DAEA, "Texas Instruments" },

23053 { 0x74DBD1, "Ebay Inc" },

23054 { 0x74DDCB, "China Leadshine Technology Co.,Ltd" },

23055 { 0x74DE2B, "Liteon Technology Corporation" },

23056 { 0x74DFBF, "Liteon Technology Corporation" },

23057 { 0x74E06E, "Ergophone GmbH" },

23058 { 0x74E14A, "IEEE Registration Authority" },

23059 { 0x74E182, "Texas Instruments" },

23060 { 0x74E19A, "Fiberhome Telecommunication Technologies Co.,LTD" },

23061 { 0x74E1B6, "Apple, Inc." },

23062 { 0x74E20C, "Amazon Technologies Inc." },

23063 { 0x74E277, "Vizmonet Pte Ltd" },

23064 { 0x74E28C, "Microsoft Corporation" },

23065 { 0x74E2F5, "Apple, Inc." },

23066 { 0x74E336, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

23067 { 0x74E424, "APISTE CORPORATION" },

23068 { 0x74E50B, "Intel Corporate" },

23069 { 0x74E537, "RADSPIN" },

23070 { 0x74E543, "Liteon Technology Corporation" },

23071 { 0x74E5F9, "Intel Corporate" },

23072 { 0x74E60F, "TECNO MOBILE LIMITED" },

23073 { 0x74E6B8, "LG Electronics" },

23074 { 0x74E6E2, "Dell Inc." },

23075 { 0x74E798, "Juniper Networks" },

23076 { 0x74E7C6, "ARRIS Group, Inc." },

23077 { 0x74E9BF, "HUAWEI TECHNOLOGIES CO.,LTD" },

23078 { 0x74EA3A, "TP-LINK TECHNOLOGIES CO.,LTD." },

23079 { 0x74EAC8, "New H3C Technologies Co., Ltd" },

23080 { 0x74EACB, "New H3C Technologies Co., Ltd" },

23081 { 0x74EAE8, "ARRIS Group, Inc." },

23082 { 0x74EB80, "Samsung Electronics Co.,Ltd" },

23083 { 0x74EC42, "Fiberhome Telecommunication Technologies Co.,LTD" },

23084 { 0x74ECB2, "Amazon Technologies Inc." },

23085 { 0x74ECF1, "Acumen" },

23086 { 0x74EE2A, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

23087 { 0x74EE8D, "Apollo Intelligent Connectivity (Beijing) Technology Co., Ltd." },

23088 { 0x74EF4B, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

23089 { 0x74F06D, "AzureWave Technology Inc." },

23090 { 0x74F07D, "BnCOM Co.,Ltd" },

23091 { 0x74F102, "Beijing HCHCOM Technology Co., Ltd" },

23092 { 0x74F2FA, "Xiaomi Communications Co Ltd" },

23093 { 0x74F413, "Maxwell Forest" },

23094 { 0x74F612, "ARRIS Group, Inc." },

23095 { 0x74F61C, "HTC Corporation" },

23096 { 0x74F661, "Schneider Electric Fire & Security Oy" },

23097 { 0x74F726, "Neuron Robotics" },

23098 { 0x74F737, "KCE" },

23099 { 0x74F7F6, "Shanghai Sunmi Technology Co.,Ltd." },

23100 { 0x74F85D, "Berkeley Nucleonics Corp" },

23101 { 0x74F8DB, "IEEE Registration Authority" },

23102 { 0x74F91A, "Onface" },

23103 { 0x74F9CA, "Nintendo Co.,Ltd" },

23104 { 0x74FDA0, "Compupal (Group) Corporation" },

23105 { 0x74FE48, "ADVANTECH CO., LTD." },

23106 { 0x74FECE, "TP-LINK CORPORATION PTE. LTD." },

23107 { 0x74FF4C, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

23108 { 0x74FF7D, "Wren Sound Systems, LLC" },

23109 { 0x78009E, "Samsung Electronics Co.,Ltd" },

23110 { 0x78028B, "Apple, Inc." },

23111 { 0x78028F, "Adaptive Spectrum and Signal Alignment (ASSIA), Inc." },

23112 { 0x7802B1, "Cisco Systems, Inc" },

23113 { 0x7802B7, "ShenZhen Ultra Easy Technology CO.,LTD" },

23114 { 0x7802F8, "Xiaomi Communications Co Ltd" },

23115 { 0x78034F, "Nokia" },

23116 { 0x780473, "Texas Instruments" },

23117 { 0x78047A, "Edge Networks LLC" },

23118 { 0x7804E3, "Huawei Device Co., Ltd." },

23119 { 0x780541, "Queclink Wireless Solutions Co., Ltd" },

23120 { 0x78055F, "Shenzhen WYC Technology Co., Ltd." },

23121 { 0x78058C, "mMax Communications, Inc." },

23122 { 0x7806C9, "Huawei Device Co., Ltd." },

23123 { 0x78071C, "Green Energy Options Ltd" },

23124 { 0x780738, "Z.U.K. Elzab S.A." },

23125 { 0x78084D, "HUAWEI TECHNOLOGIES CO.,LTD" },

23126 { 0x780AC7, "Baofeng TV Co., Ltd." },

23127 { 0x780B8C, "Private" },

23128 { 0x780CB8, "Intel Corporate" },

23129 { 0x780CF0, "Cisco Systems, Inc" },

23130 { 0x780ED1, "TRUMPF Werkzeugmaschinen GmbH+Co.KG" },

23131 { 0x780F77, "HangZhou Gubei Electronics Technology Co.,Ltd" },

23132 { 0x781053, "China Mobile Group Device Co.,Ltd." },

23133 { 0x781100, "Quantumsolution" },

23134 { 0x781185, "NBS Payment Solutions Inc." },

23135 { 0x7811DC, "XIAOMI Electronics,CO.,LTD" },

23136 { 0x7812B8, "ORANTEK LIMITED" },

23137 { 0x781305, "IEEE Registration Authority" },

23138 { 0x7813E0, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

23139 { 0x78152D, "UNION CHIP TECHNOLOGY LIMITED" },

23140 { 0x781699, "HUAWEI TECHNOLOGIES CO.,LTD" },

23141 { 0x781735, "Nokia Shanghai Bell Co., Ltd." },

23142 { 0x7817BE, "HUAWEI TECHNOLOGIES CO.,LTD" },

23143 { 0x781881, "AzureWave Technology Inc." },

23144 { 0x7818A8, "Huawei Device Co., Ltd." },

23145 { 0x7818EC, "Fortinet, Inc." },

23146 { 0x78192E, "NASCENT Technology" },

23147 { 0x7819F7, "Juniper Networks" },

23148 { 0x781C5A, "SHARP Corporation" },

23149 { 0x781D4A, "zte corporation" },

23150 { 0x781DBA, "HUAWEI TECHNOLOGIES CO.,LTD" },

23151 { 0x781DFD, "Jabil Inc" },

23152 { 0x781F11, "RAB Lighting" },

23153 { 0x781FDB, "Samsung Electronics Co.,Ltd" },

23154 { 0x782079, "ID Tech" },

23155 { 0x7820A5, "Nintendo Co.,Ltd" },

23156 { 0x7820BD, "Polysense (Beijing) Technologies Co. Ltd" },

23157 { 0x782184, "Espressif Inc." },

23158 { 0x78223D, "Affirmed Networks" },

23159 { 0x782327, "Samsung Electronics Co.,Ltd" },

23160 { 0x7823AE, "ARRIS Group, Inc." },

23161 { 0x782459, "Alcatel-Lucent Enterprise" },

23162 { 0x7824AF, "ASUSTek COMPUTER INC." },

23163 { 0x782544, "Omnima Limited" },

23164 { 0x78257A, "LEO Innovation Lab" },

23165 { 0x7825AD, "Samsung Electronics Co.,Ltd" },

23166 { 0x7828CA, "Sonos, Inc." },

23167 { 0x7829ED, "ASKEY COMPUTER CORP" },

23168 { 0x782A79, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

23169 { 0x782AF8, "IETHCOM INFORMATION TECHNOLOGY CO., LTD." },

23170 { 0x782B46, "Intel Corporate" },

23171 { 0x782B64, "Bose Corporation" },

23172 { 0x782BCB, "Dell Inc." },

23173 { 0x782C29, "New H3C Technologies Co., Ltd" },

23174 { 0x782D7E, "TRENDnet, Inc." },

23175 { 0x782DAD, "HUAWEI TECHNOLOGIES CO.,LTD" },

23176 { 0x782E56, "China Mobile Group Device Co.,Ltd." },

23177 { 0x782EEF, "Nokia Corporation" },

23178 { 0x782F17, "Xlab Co.,Ltd" },

23179 { 0x78303B, "Stephen Technologies Co.,Limited" },

23180 { 0x78305D, "zte corporation" },

23181 { 0x7830E1, "UltraClenz, LLC" },

23182 { 0x7830F5, "TBT Inc." },

23183 { 0x78312B, "zte corporation" },

23184 { 0x7831C1, "Apple, Inc." },

23185 { 0x78321B, "D-Link International" },

23186 { 0x78324F, "Millennium Group, Inc." },

23187 { 0x783486, "Nokia" },

23188 { 0x7834FD, "vivo Mobile Communication Co., Ltd." },

23189 { 0x7835A0, "Zurn Industries LLC" },

23190 { 0x783607, "Cermate Technologies Inc." },

23191 { 0x783690, "Yulong Computer Telecommunication Scientific (Shenzhen) Co.,Ltd" },

23192 { 0x7836CC, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

23193 { 0x783716, "Samsung Electronics Co.,Ltd" },

23194 { 0x78392D, "IEEE Registration Authority" },

23195 { 0x783A6C, "TECNO MOBILE LIMITED" },

23196 { 0x783A84, "Apple, Inc." },

23197 { 0x783CE3, "Kai-EE" },

23198 { 0x783D5B, "TELNET Redes Inteligentes S.A." },

23199 { 0x783E53, "SKY UK LIMITED" },

23200 { 0x783EA1, "Nokia Shanghai Bell Co., Ltd." },

23201 { 0x783F15, "EasySYNC Ltd." },

23202 { 0x7840E4, "Samsung Electronics Co.,Ltd" },

23203 { 0x784405, "FUJITU(HONG KONG) ELECTRONIC Co.,LTD." },

23204 { 0x78444A, "Shenzhen Aiwinn information Technology Co., Ltd." },

23205 { 0x784476, "Zioncom Electronics (Shenzhen) Ltd." },

23206 { 0x7844FD, "TP-LINK TECHNOLOGIES CO.,LTD." },

23207 { 0x784501, "Biamp Systems" },

23208 { 0x784558, "Ubiquiti Inc" },

23209 { 0x784561, "CyberTAN Technology Inc." },

23210 { 0x7845B3, "Huawei Device Co., Ltd." },

23211 { 0x7845C4, "Dell Inc." },

23212 { 0x78465C, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

23213 { 0x78465F, "Fiberhome Telecommunication Technologies Co.,LTD" },

23214 { 0x78467D, "SKAIChips" },

23215 { 0x7846C4, "DAEHAP HYPER-TECH" },

23216 { 0x7846D4, "Samsung Electronics Co.,Ltd" },

23217 { 0x78471D, "Samsung Electronics Co.,Ltd" },

23218 { 0x7847E3, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

23219 { 0x78482C, "START USA, INC." },

23220 { 0x784859, "Hewlett Packard" },

23221 { 0x78491D, "The Will-Burt Company" },

23222 { 0x784946, "Cambridge Mobile Telematics, Inc." },

23223 { 0x784B08, "f.robotics acquisitions ltd" },

23224 { 0x784B87, "Murata Manufacturing Co., Ltd." },

23225 { 0x784F24, "Taicang T&W Electronics" },

23226 { 0x784F43, "Apple, Inc." },

23227 { 0x784F9B, "Juniper Networks" },

23228 { 0x785005, "MOKO TECHNOLOGY Ltd" },

23229 { 0x78507C, "Juniper Networks" },

23230 { 0x78510C, "LiveU Ltd." },

23231 { 0x78521A, "Samsung Electronics Co.,Ltd" },

23232 { 0x78524A, "Optonic GmbH" },

23233 { 0x785262, "Shenzhen Hojy Software Co., Ltd." },

23234 { 0x78530D, "Shenzhen Skyworth Digital Technology CO., Ltd" },

23235 { 0x785333, "Beijing Xiaomi Electronics Co.,Ltd" },

23236 { 0x785364, "SHIFT GmbH" },

23237 { 0x7853F2, "Roxton Systems Ltd." },

23238 { 0x78542E, "D-Link International" },

23239 { 0x785517, "SankyuElectronics" },

23240 { 0x785712, "Mobile Integration Workgroup" },

23241 { 0x785773, "HUAWEI TECHNOLOGIES CO.,LTD" },

23242 { 0x7857B0, "GERTEC BRASIL LTDA" },

23243 { 0x785860, "HUAWEI TECHNOLOGIES CO.,LTD" },

23244 { 0x7858F3, "Vachen Co.,Ltd" },

23245 { 0x78593E, "RAFI GmbH & Co.KG" },

23246 { 0x78595E, "Samsung Electronics Co.,Ltd" },

23247 { 0x785968, "Hon Hai Precision Ind. Co.,Ltd." },

23248 { 0x785994, "Alif Semiconductor, Inc." },

23249 { 0x785B64, "Huawei Device Co., Ltd." },

23250 { 0x785C28, "Prime Motion Inc." },

23251 { 0x785C5E, "HUAWEI TECHNOLOGIES CO.,LTD" },

23252 { 0x785C72, "Hioso Technology Co., Ltd." },

23253 { 0x785DC8, "LG Electronics" },

23254 { 0x785EA2, "Sunitec Enterprise Co.,Ltd" },

23255 { 0x785EE8, "IEEE Registration Authority" },

23256 { 0x785F28, "EM Microelectronic" },

23257 { 0x785F36, "Shenzhen Skyworth Digital Technology CO., Ltd" },

23258 { 0x785F4C, "Argox Information Co., Ltd." },

23259 { 0x78605B, "TP-LINK TECHNOLOGIES CO.,LTD." },

23260 { 0x78617C, "MITSUMI ELECTRIC CO.,LTD." },

23261 { 0x786256, "HUAWEI TECHNOLOGIES CO.,LTD" },

23262 { 0x786299, "BITSTREAM sp. z o.o." },

23263 { 0x7864C0, "Apple, Inc." },

23264 { 0x7864E6, "Green Motive Technology Limited" },

23265 { 0x78653B, "Shaoxing Ourten Electronics Co., Ltd." },

23266 { 0x786559, "Sagemcom Broadband SAS" },

23267 { 0x78669D, "Hui Zhou Gaoshengda Technology Co.,LTD" },

23268 { 0x7866AE, "ZTEC Instruments, Inc." },

23269 { 0x78670E, "Wistron Neweb Corporation" },

23270 { 0x7867D7, "Apple, Inc." },

23271 { 0x786829, "eero inc." },

23272 { 0x7868F7, "YSTen Technology Co.,Ltd" },

23273 { 0x7869D4, "Shenyang Vibrotech Instruments Inc." },

23274 { 0x786A1F, "ARRIS Group, Inc." },

23275 { 0x786A89, "HUAWEI TECHNOLOGIES CO.,LTD" },

23276 { 0x786C1C, "Apple, Inc." },

23277 { 0x786C84, "Amazon Technologies Inc." },

23278 { 0x786D94, "Palo Alto Networks" },

23279 { 0x786DEB, "GE Lighting" },

23280 { 0x787052, "Welotec GmbH" },

23281 { 0x787104, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

23282 { 0x78719C, "ARRIS Group, Inc." },

23283 { 0x78725D, "Cisco Systems, Inc" },

23284 { 0x787264, "IEEE Registration Authority" },

23285 { 0x787689, "eero inc." },

23286 { 0x7876D9, "EXARA Group" },

23287 { 0x787A6F, "Juice Technology AG" },

23288 { 0x787B8A, "Apple, Inc." },

23289 { 0x787D48, "ITEL MOBILE LIMITED" },

23290 { 0x787D53, "Extreme Networks Headquarters" },

23291 { 0x787DF3, "Sterlite Technologies Limited" },

23292 { 0x787E61, "Apple, Inc." },

23293 { 0x787F62, "GiK mbH" },

23294 { 0x788038, "FUNAI ELECTRIC CO., LTD." },

23295 { 0x788102, "Sercomm Corporation." },

23296 { 0x78818F, "Server Racks Australia Pty Ltd" },

23297 { 0x7881CE, "China Mobile Iot Limited company" },

23298 { 0x78843C, "Sony Corporation" },

23299 { 0x7884EE, "INDRA ESPACIO S.A." },

23300 { 0x7885F4, "Huawei Device Co., Ltd." },

23301 { 0x7886B6, "Shenzhen YOUHUA Technology Co., Ltd" },

23302 { 0x78870D, "Unifiedgateways India Private Limited" },

23303 { 0x78886D, "Apple, Inc." },

23304 { 0x78888A, "CDR Sp. z o.o. Sp. k." },

23305 { 0x788973, "CMC" },

23306 { 0x788A20, "Ubiquiti Inc" },

23307 { 0x788A86, "China Dragon Technology Limited" },

23308 { 0x788B2A, "Zhen Shi Information Technology (Shanghai) Co., Ltd." },

23309 { 0x788B77, "Standar Telecom" },

23310 { 0x788C4D, "Indyme Solutions, LLC" },

23311 { 0x788C54, "Ping Communication" },

23312 { 0x788C77, "LEXMARK INTERNATIONAL, INC." },

23313 { 0x788CB5, "TP-Link Corporation Limited" },

23314 { 0x788DAF, "Sagemcom Broadband SAS" },

23315 { 0x788DF7, "Hitron Technologies. Inc" },

23316 { 0x788E33, "Jiangsu SEUIC Technology Co.,Ltd" },

23317 { 0x7890A2, "zte corporation" },

23318 { 0x7891DE, "Guangdong ACIGA Science&Technology Co.,Ltd" },

23319 { 0x7891E9, "Raisecom Technology CO., LTD" },

23320 { 0x78923E, "Nokia Corporation" },

23321 { 0x78929C, "Intel Corporate" },

23322 { 0x7894B4, "Sercomm Corporation." },

23323 { 0x7894E8, "Radio Bridge" },

23324 { 0x7895EB, "ITEL MOBILE LIMITED" },

23325 { 0x789682, "zte corporation" },

23326 { 0x789684, "ARRIS Group, Inc." },

23327 { 0x7896A3, "Extreme Networks Headquarters" },

23328 { 0x7897C3, "DINGXIN INFORMATION TECHNOLOGY CO.,LTD" },

23329 { 0x7898E8, "D-Link International" },

23330 { 0x7898FD, "Q9 Networks Inc." },

23331 { 0x78995C, "Nationz Technologies Inc" },

23332 { 0x789966, "Musilab Electronics (DongGuan)Co.,Ltd." },

23333 { 0x78998F, "MEDILINE ITALIA SRL" },

23334 { 0x789A18, "Routerboard.com" },

23335 { 0x789C85, "August Home, Inc." },

23336 { 0x789CE7, "Shenzhen Aikede Technology Co., Ltd" },

23337 { 0x789ED0, "Samsung Electronics Co.,Ltd" },

23338 { 0x789F38, "Shenzhen Feasycom Co., Ltd" },

23339 { 0x789F4C, "HOERBIGER Elektronik GmbH" },

23340 { 0x789F70, "Apple, Inc." },

23341 { 0x789F87, "Siemens AG I IA PP PRM" },

23342 { 0x789FAA, "Huawei Device Co., Ltd." },

23343 { 0x78A03F, "Amazon Technologies Inc." },

23344 { 0x78A051, "iiNet Labs Pty Ltd" },

23345 { 0x78A106, "TP-LINK TECHNOLOGIES CO.,LTD." },

23346 { 0x78A183, "Advidia" },

23347 { 0x78A2A0, "Nintendo Co., Ltd." },

23348 { 0x78A351, "SHENZHEN ZHIBOTONG ELECTRONICS CO.,LTD" },

23349 { 0x78A3E4, "Apple, Inc." },

23350 { 0x78A504, "Texas Instruments" },

23351 { 0x78A5DD, "Shenzhen Smarteye Digital Electronics Co., Ltd" },

23352 { 0x78A683, "Precidata" },

23353 { 0x78A6A0, "Hangzhou Ezviz Software Co.,Ltd." },

23354 { 0x78A6BD, "DAEYEON Control&Instrument Co,.Ltd" },

23355 { 0x78A6E1, "Brocade Communications Systems LLC" },

23356 { 0x78A714, "Amphenol" },

23357 { 0x78A7C7, "Apple, Inc." },

23358 { 0x78A7EB, "1MORE" },

23359 { 0x78A873, "Samsung Electronics Co.,Ltd" },

23360 { 0x78AA82, "New H3C Technologies Co., Ltd" },

23361 { 0x78AB60, "ABB Australia" },

23362 { 0x78ABBB, "Samsung Electronics Co.,Ltd" },

23363 { 0x78AC44, "Dell Inc." },

23364 { 0x78ACBF, "Igneous Systems" },

23365 { 0x78ACC0, "Hewlett Packard" },

23366 { 0x78AE0C, "Far South Networks" },

23367 { 0x78AF08, "Intel Corporate" },

23368 { 0x78AF58, "GIMASI SA" },

23369 { 0x78AFE4, "Comau S.p.A" },

23370 { 0x78B213, "DWnet Technologies(Suzhou) Corporation" },

23371 { 0x78B28D, "Beijing Tengling Technology CO.Ltd" },

23372 { 0x78B3B9, "ShangHai sunup lighting CO.,LTD" },

23373 { 0x78B3CE, "Elo touch solutions" },

23374 { 0x78B46A, "HUAWEI TECHNOLOGIES CO.,LTD" },

23375 { 0x78B554, "Huawei Device Co., Ltd." },

23376 { 0x78B5D2, "Ever Treasure Industrial Limited" },

23377 { 0x78B6C1, "AOBO Telecom Co.,Ltd" },

23378 { 0x78B6EC, "Scuf Gaming International LLC" },

23379 { 0x78B81A, "INTER SALES A/S" },

23380 { 0x78B84B, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

23381 { 0x78B8D6, "Zebra Technologies Inc." },

23382 { 0x78BAD0, "Shinybow Technology Co. Ltd." },

23383 { 0x78BAF9, "Cisco Systems, Inc" },

23384 { 0x78BB88, "Maxio Technology (Hangzhou) Ltd." },

23385 { 0x78BBC1, "SERVERCOM (INDIA) PRIVATE LIMITED" },

23386 { 0x78BC1A, "Cisco Systems, Inc" },

23387 { 0x78BDBC, "Samsung Electronics Co.,Ltd" },

23388 { 0x78BEB6, "Enhanced Vision" },

23389 { 0x78BEBD, "STULZ GmbH" },

23390 { 0x78C1A7, "zte corporation" },

23391 { 0x78C1AE, "Hangzhou Ezviz Software Co.,Ltd." },

23392 { 0x78C213, "Sagemcom Broadband SAS" },

23393 { 0x78C2C0, "IEEE Registration Authority" },

23394 { 0x78C313, "China Mobile Group Device Co.,Ltd." },

23395 { 0x78C3E9, "Samsung Electronics Co.,Ltd" },

23396 { 0x78C40E, "H&D Wireless" },

23397 { 0x78C4AB, "Shenzhen Runsil Technology Co.,Ltd" },

23398 { 0x78C57D, "Zyxel Communications Corporation" },

23399 { 0x78C5E5, "Texas Instruments" },

23400 { 0x78C5F8, "Huawei Device Co., Ltd." },

23401 { 0x78C62B, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

23402 { 0x78C6BB, "Analog Devices, Inc." },

23403 { 0x78C881, "Sony Interactive Entertainment Inc." },

23404 { 0x78C95E, "Midmark RTLS" },

23405 { 0x78CA04, "Nokia Corporation" },

23406 { 0x78CA39, "Apple, Inc." },

23407 { 0x78CA5E, "ELNO" },

23408 { 0x78CA83, "IEEE Registration Authority" },

23409 { 0x78CB2C, "Join Digital, Inc." },

23410 { 0x78CB33, "DHC Software Co.,Ltd" },

23411 { 0x78CB68, "DAEHAP HYPER-TECH" },

23412 { 0x78CC2B, "SINEWY TECHNOLOGY CO., LTD" },

23413 { 0x78CD55, "Texas Instruments" },

23414 { 0x78CD8E, "SMC Networks Inc" },

23415 { 0x78CF2F, "HUAWEI TECHNOLOGIES CO.,LTD" },

23416 { 0x78CFF9, "Huawei Device Co., Ltd." },

23417 { 0x78D004, "Neousys Technology Inc." },

23418 { 0x78D129, "Vicos" },

23419 { 0x78D162, "Apple, Inc." },

23420 { 0x78D294, "NETGEAR" },

23421 { 0x78D347, "Ericsson AB" },

23422 { 0x78D34F, "Pace-O-Matic, Inc." },

23423 { 0x78D38D, "HONGKONG YUNLINK TECHNOLOGY LIMITED" },

23424 { 0x78D3ED, "NORMA" },

23425 { 0x78D4F1, "IEEE Registration Authority" },

23426 { 0x78D5B5, "NAVIELEKTRO KY" },

23427 { 0x78D66F, "Aristocrat Technologies Australia Pty. Ltd." },

23428 { 0x78D6B2, "Toshiba" },

23429 { 0x78D6D6, "eero inc." },

23430 { 0x78D6DC, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

23431 { 0x78D6F0, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

23432 { 0x78D71A, "Ciena Corporation" },

23433 { 0x78D752, "HUAWEI TECHNOLOGIES CO.,LTD" },

23434 { 0x78D75F, "Apple, Inc." },

23435 { 0x78D800, "IEEE Registration Authority" },

23436 { 0x78D840, "Xiaomi Communications Co Ltd" },

23437 { 0x78D99F, "NuCom HK Ltd." },

23438 { 0x78D9E9, "MOMENTUM IOT" },

23439 { 0x78DA07, "Zhejiang Tmall Technology Co., Ltd." },

23440 { 0x78DA6E, "Cisco Systems, Inc" },

23441 { 0x78DAA2, "Cynosure Technologies Co.,Ltd" },

23442 { 0x78DAB3, "GBO Technology" },

23443 { 0x78DB2F, "Texas Instruments" },

23444 { 0x78DD08, "Hon Hai Precision Ind. Co.,Ltd." },

23445 { 0x78DD12, "Arcadyan Corporation" },

23446 { 0x78DD33, "HUAWEI TECHNOLOGIES CO.,LTD" },

23447 { 0x78DDD6, "c-scape" },

23448 { 0x78DDD9, "Guangzhou Shiyuan Electronics Co., Ltd." },

23449 { 0x78DEE4, "Texas Instruments" },

23450 { 0x78DF72, "Shanghai Imilab Technology Co.Ltd" },

23451 { 0x78E103, "Amazon Technologies Inc." },

23452 { 0x78E22C, "Huawei Device Co., Ltd." },

23453 { 0x78E2BD, "Vodafone Automotive S.p.A." },

23454 { 0x78E36D, "Espressif Inc." },

23455 { 0x78E3B5, "Hewlett Packard" },

23456 { 0x78E3DE, "Apple, Inc." },

23457 { 0x78E400, "Hon Hai Precision Ind. Co.,Ltd." },

23458 { 0x78E7D1, "Hewlett Packard" },

23459 { 0x78E8B6, "zte corporation" },

23460 { 0x78E980, "RainUs Co.,Ltd" },

23461 { 0x78E9CF, "TELLESCOM INDUSTRIA E COMERCIO EM TELECOMUNICACAO" },

23462 { 0x78EB14, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

23463 { 0x78EB39, "Instituto Nacional de Tecnología Industrial" },

23464 { 0x78EB46, "HUAWEI TECHNOLOGIES CO.,LTD" },

23465 { 0x78EC22, "Shanghai Qihui Telecom Technology Co., LTD" },

23466 { 0x78EC74, "Kyland-USA" },

23467 { 0x78EDBC, "OnePlus Technology (Shenzhen) Co., Ltd" },

23468 { 0x78EF4C, "Unetconvergence Co., Ltd." },

23469 { 0x78F09B, "Huawei Device Co., Ltd." },

23470 { 0x78F1C6, "Cisco Systems, Inc" },

23471 { 0x78F235, "Sichuan AI-Link Technology Co., Ltd." },

23472 { 0x78F238, "Samsung Electronics Co.,Ltd" },

23473 { 0x78F276, "Cyklop Fastjet Technologies (Shanghai) Inc." },

23474 { 0x78F29E, "PEGATRON CORPORATION" },

23475 { 0x78F557, "HUAWEI TECHNOLOGIES CO.,LTD" },

23476 { 0x78F5E5, "BEGA Gantenbrink-Leuchten KG" },

23477 { 0x78F5FD, "HUAWEI TECHNOLOGIES CO.,LTD" },

23478 { 0x78F7BE, "Samsung Electronics Co.,Ltd" },

23479 { 0x78F7D0, "Silverbrook Research" },

23480 { 0x78F882, "LG Electronics (Mobile Communications)" },

23481 { 0x78F8B8, "Rako Controls Ltd" },

23482 { 0x78F944, "Private" },

23483 { 0x78F9B4, "Nokia Solutions and Networks GmbH & Co. KG" },

23484 { 0x78FBD8, "Apple, Inc." },

23485 { 0x78FC14, "Family Zone Cyber Safety Ltd" },

23486 { 0x78FD94, "Apple, Inc." },

23487 { 0x78FE3D, "Juniper Networks" },

23488 { 0x78FE41, "Socus networks" },

23489 { 0x78FEE2, "Shanghai Diveo Technology Co., Ltd" },

23490 { 0x78FF57, "Intel Corporate" },

23491 { 0x78FFCA, "TECNO MOBILE LIMITED" },

23492 { 0x7C004D, "HUAWEI TECHNOLOGIES CO.,LTD" },

23493 { 0x7C010A, "Texas Instruments" },

23494 { 0x7C0187, "Curtis Instruments, Inc." },

23495 { 0x7C0191, "Apple, Inc." },

23496 { 0x7C02BC, "Hansung Electronics Co. LTD" },

23497 { 0x7C034C, "Sagemcom Broadband SAS" },

23498 { 0x7C035E, "Xiaomi Communications Co Ltd" },

23499 { 0x7C03AB, "Xiaomi Communications Co Ltd" },

23500 { 0x7C03C9, "Shenzhen YOUHUA Technology Co., Ltd" },

23501 { 0x7C03D8, "Sagemcom Broadband SAS" },

23502 { 0x7C04D0, "Apple, Inc." },

23503 { 0x7C0507, "PEGATRON CORPORATION" },

23504 { 0x7C051E, "RAFAEL LTD." },

23505 { 0x7C0623, "Ultra Electronics Sonar System Division" },

23506 { 0x7C08D9, "Shanghai B-Star Technology Co" },

23507 { 0x7C092B, "Bekey A/S" },

23508 { 0x7C0A3F, "Samsung Electronics Co.,Ltd" },

23509 { 0x7C0A50, "J-MEX Inc." },

23510 { 0x7C0BC6, "Samsung Electronics Co.,Ltd" },

23511 { 0x7C0C92, "Suzhou Mobydata Smart System Co.,Ltd." },

23512 { 0x7C0CF6, "Guangdong Huiwei High-tech Co., Ltd." },

23513 { 0x7C0ECE, "Cisco Systems, Inc" },

23514 { 0x7C1015, "Brilliant Home Technology, Inc." },

23515 { 0x7C10C9, "ASUSTek COMPUTER INC." },

23516 { 0x7C11BE, "Apple, Inc." },

23517 { 0x7C11CB, "HUAWEI TECHNOLOGIES CO.,LTD" },

23518 { 0x7C11CD, "QianTang Technology" },

23519 { 0x7C131D, "SERNET (SUZHOU) TECHNOLOGIES CORPORATION" },

23520 { 0x7C1476, "Damall Technologies SAS" },

23521 { 0x7C160D, "Saia-Burgess Controls AG" },

23522 { 0x7C1689, "Sagemcom Broadband SAS" },

23523 { 0x7C1779, "EM Microelectronic" },

23524 { 0x7C18CD, "E-TRON Co.,Ltd." },

23525 { 0x7C1A03, "8Locations Co., Ltd." },

23526 { 0x7C1AC0, "HUAWEI TECHNOLOGIES CO.,LTD" },

23527 { 0x7C1AFC, "Dalian Co-Edifice Video Technology Co., Ltd" },

23528 { 0x7C1B93, "Huawei Device Co., Ltd." },

23529 { 0x7C1C4E, "LG Innotek" },

23530 { 0x7C1C68, "Samsung Electronics Co.,Ltd" },

23531 { 0x7C1CF1, "HUAWEI TECHNOLOGIES CO.,LTD" },

23532 { 0x7C1DD9, "Xiaomi Communications Co Ltd" },

23533 { 0x7C1E06, "New H3C Technologies Co., Ltd" },

23534 { 0x7C1E52, "Microsoft" },

23535 { 0x7C1EB3, "2N TELEKOMUNIKACE a.s." },

23536 { 0x7C2048, "KoamTac" },

23537 { 0x7C2064, "Alcatel-Lucent IPD" },

23538 { 0x7C210D, "Cisco Systems, Inc" },

23539 { 0x7C210E, "Cisco Systems, Inc" },

23540 { 0x7C214A, "Intel Corporate" },

23541 { 0x7C21D8, "Shenzhen Think Will Communication Technology co., LTD." },

23542 { 0x7C2302, "Samsung Electronics Co.,Ltd" },

23543 { 0x7C240C, "Telechips, Inc." },

23544 { 0x7C2499, "Apple, Inc." },

23545 { 0x7C2586, "Juniper Networks" },

23546 { 0x7C2587, "chaowifi.com" },

23547 { 0x7C25DA, "FN-LINK TECHNOLOGY LIMITED" },

23548 { 0x7C2634, "ARRIS Group, Inc." },

23549 { 0x7C2664, "Sagemcom Broadband SAS" },

23550 { 0x7C273C, "Shenzhen Yunlink Technology Co., Ltd" },

23551 { 0x7C27BC, "Hui Zhou Gaoshengda Technology Co.,LTD" },

23552 { 0x7C296F, "Apple, Inc." },

23553 { 0x7C2A31, "Intel Corporate" },

23554 { 0x7C2ACA, "Apple, Inc." },

23555 { 0x7C2ADB, "Xiaomi Communications Co Ltd" },

23556 { 0x7C2BE1, "Shenzhen Ferex Electrical Co.,Ltd" },

23557 { 0x7C2CF3, "Secure Electrans Ltd" },

23558 { 0x7C2E0D, "Blackmagic Design" },

23559 { 0x7C2EBD, "Google, Inc." },

23560 { 0x7C2EDD, "Samsung Electronics Co.,Ltd" },

23561 { 0x7C2F80, "Gigaset Communications GmbH" },

23562 { 0x7C310E, "Cisco Systems, Inc" },

23563 { 0x7C3180, "SMK corporation" },

23564 { 0x7C336E, "MEG Electronics Inc." },

23565 { 0x7C33F9, "HUAWEI TECHNOLOGIES CO.,LTD" },

23566 { 0x7C3548, "Transcend Information" },

23567 { 0x7C35F8, "Zhejiang Tmall Technology Co., Ltd." },

23568 { 0x7C3866, "Texas Instruments" },

23569 { 0x7C386C, "Real Time Logic" },

23570 { 0x7C38AD, "Samsung Electronics Co.,Ltd" },

23571 { 0x7C3920, "SSOMA SECURITY" },

23572 { 0x7C3953, "zte corporation" },

23573 { 0x7C3985, "HUAWEI TECHNOLOGIES CO.,LTD" },

23574 { 0x7C3BD5, "Imago Group" },

23575 { 0x7C3CB6, "Shenzhen Homecare Technology Co.,Ltd." },

23576 { 0x7C3D2B, "Huawei Device Co., Ltd." },

23577 { 0x7C3E74, "Huawei Device Co., Ltd." },

23578 { 0x7C3E9D, "PATECH" },

23579 { 0x7C41A2, "Nokia" },

23580 { 0x7C438F, "E-Band Communications Corp." },

23581 { 0x7C444C, "Entertainment Solutions, S.L." },

23582 { 0x7C45D0, "Shenzhen Wewins Wireless Co., ltd" },

23583 { 0x7C45F9, "IEEE Registration Authority" },

23584 { 0x7C4685, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

23585 { 0x7C477C, "IEEE Registration Authority" },

23586 { 0x7C48B2, "Vida Resources Lte Ltd" },

23587 { 0x7C49B9, "Plexus Manufacturing Sdn Bhd" },

23588 { 0x7C49CF, "eero inc." },

23589 { 0x7C49EB, "XIAOMI Electronics,CO.,LTD" },

23590 { 0x7C4A82, "Portsmith LLC" },

23591 { 0x7C4AA8, "MindTree Wireless PVT Ltd" },

23592 { 0x7C4B26, "Apple, Inc." },

23593 { 0x7C4B78, "Red Sun Synthesis Pte Ltd" },

23594 { 0x7C4C58, "Scale Computing, Inc." },

23595 { 0x7C4CA5, "SKY UK LIMITED" },

23596 { 0x7C4D8F, "HP Inc." },

23597 { 0x7C4E09, "Shenzhen Skyworth Wireless Technology Co.,Ltd" },

23598 { 0x7C4F7D, "Sawwave" },

23599 { 0x7C4FB5, "Arcadyan Technology Corporation" },

23600 { 0x7C5049, "Apple, Inc." },

23601 { 0x7C5079, "Intel Corporate" },

23602 { 0x7C50DA, "E.J Ward" },

23603 { 0x7C5189, "SG Wireless Limited" },

23604 { 0x7C5259, "Sichuan Jiuzhou Electronic Technology Co., Ltd." },

23605 { 0x7C534A, "Metamako" },

23606 { 0x7C55A7, "Kastle Systems" },

23607 { 0x7C55E7, "YSI, Inc." },

23608 { 0x7C573C, "Aruba, a Hewlett Packard Enterprise Company" },

23609 { 0x7C574E, "COBI GmbH" },

23610 { 0x7C5758, "HP Inc." },

23611 { 0x7C5A1C, "Sophos Ltd" },

23612 { 0x7C5A67, "JNC Systems, Inc." },

23613 { 0x7C5CF8, "Intel Corporate" },

23614 { 0x7C604A, "Avelon" },

23615 { 0x7C6097, "HUAWEI TECHNOLOGIES CO.,LTD" },

23616 { 0x7C6130, "Apple, Inc." },

23617 { 0x7C6166, "Amazon Technologies Inc." },

23618 { 0x7C6193, "HTC Corporation" },

23619 { 0x7C6305, "Amazon Technologies Inc." },

23620 { 0x7C6456, "Samsung Electronics Co.,Ltd" },

23621 { 0x7C646C, "LG Electronics" },

23622 { 0x7C669A, "HUAWEI TECHNOLOGIES CO.,LTD" },

23623 { 0x7C669D, "Texas Instruments" },

23624 { 0x7C66EF, "Hon Hai Precision IND.CO.,LTD" },

23625 { 0x7C67A2, "Intel Corporate" },

23626 { 0x7C67AB, "Roku, Inc" },

23627 { 0x7C696B, "Atmosic Technologies" },

23628 { 0x7C69F6, "Cisco Systems, Inc" },

23629 { 0x7C6A60, "China Mobile Group Device Co.,Ltd." },

23630 { 0x7C6A8A, "SINOBONDER Technology Co., Ltd." },

23631 { 0x7C6AB3, "IBC TECHNOLOGIES INC." },

23632 { 0x7C6AC3, "GatesAir, Inc" },

23633 { 0x7C6ADB, "SafeTone Technology Co.,Ltd" },

23634 { 0x7C6AF3, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

23635 { 0x7C6B33, "Tenyu Tech Co. Ltd." },

23636 { 0x7C6B52, "Tigaro Wireless" },

23637 { 0x7C6B9C, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

23638 { 0x7C6BF7, "NTI co., ltd." },

23639 { 0x7C6C39, "PIXSYS SRL" },

23640 { 0x7C6C8F, "AMS NEVE LTD" },

23641 { 0x7C6CF0, "Shenzhen TINNO Mobile Technology Corp." },

23642 { 0x7C6D62, "Apple, Inc." },

23643 { 0x7C6DA6, "Superwave Group LLC" },

23644 { 0x7C6DF8, "Apple, Inc." },

23645 { 0x7C6F06, "Caterpillar Trimble Control Technologies" },

23646 { 0x7C6FF8, "ShenZhen ACTO Digital Video Technology Co.,Ltd." },

23647 { 0x7C70BC, "IEEE Registration Authority" },

23648 { 0x7C70DB, "Intel Corporate" },

23649 { 0x7C7176, "Wuxi iData Technology Company Ltd." },

23650 { 0x7C726E, "Ericsson AB" },

23651 { 0x7C72E4, "Unikey Technologies" },

23652 { 0x7C738B, "Cocoon Alarm Ltd" },

23653 { 0x7C7398, "Espressif Inc." },

23654 { 0x7C73EB, "Huawei Device Co., Ltd." },

23655 { 0x7C752D, "Samsung Electronics Co.,Ltd" },

23656 { 0x7C7630, "Shenzhen YOUHUA Technology Co., Ltd" },

23657 { 0x7C7635, "Intel Corporate" },

23658 { 0x7C7668, "HUAWEI TECHNOLOGIES CO.,LTD" },

23659 { 0x7C7673, "ENMAS GmbH" },

23660 { 0x7C7716, "Zyxel Communications Corporation" },

23661 { 0x7C787E, "Samsung Electronics Co.,Ltd" },

23662 { 0x7C78B2, "Wyze Labs Inc" },

23663 { 0x7C79E8, "PayRange Inc." },

23664 { 0x7C7A3C, "New H3C Technologies Co., Ltd" },

23665 { 0x7C7A53, "Phytrex Technology Corp." },

23666 { 0x7C7A91, "Intel Corporate" },

23667 { 0x7C7B1C, "Motorola Mobility LLC, a Lenovo Company" },

23668 { 0x7C7B8B, "Control Concepts, Inc." },

23669 { 0x7C7BE4, "Z'SEDAI KENKYUSHO CORPORATION" },

23670 { 0x7C7D3D, "HUAWEI TECHNOLOGIES CO.,LTD" },

23671 { 0x7C7D41, "Jinmuyu Electronics Co., Ltd." },

23672 { 0x7C822D, "Nortec" },

23673 { 0x7C8274, "Shenzhen Hikeen Technology CO.,LTD" },

23674 { 0x7C8306, "Glen Dimplex Nordic as" },

23675 { 0x7C8334, "IEEE Registration Authority" },

23676 { 0x7C8437, "China Post Communications Equipment Co., Ltd." },

23677 { 0x7C8530, "Nokia" },

23678 { 0x7C87CE, "Espressif Inc." },

23679 { 0x7C8899, "FN-LINK TECHNOLOGY Ltd." },

23680 { 0x7C8931, "Huawei Device Co., Ltd." },

23681 { 0x7C8956, "Samsung Electronics Co.,Ltd" },

23682 { 0x7C89C1, "Palo Alto Networks" },

23683 { 0x7C8AC0, "EVBox BV" },

23684 { 0x7C8AE1, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

23685 { 0x7C8BB5, "Samsung Electronics Co.,Ltd" },

23686 { 0x7C8BCA, "TP-LINK TECHNOLOGIES CO.,LTD." },

23687 { 0x7C8D91, "Shanghai Hongzhuo Information Technology co.,LTD" },

23688 { 0x7C8EE4, "Texas Instruments" },

23689 { 0x7C8FDE, "DWnet Technologies(Suzhou) Corporation" },

23690 { 0x7C9122, "Samsung Electronics Co.,Ltd" },

23691 { 0x7C942A, "HUAWEI TECHNOLOGIES CO.,LTD" },

23692 { 0x7C949F, "Shenzhen iComm Semiconductor CO.,LTD" },

23693 { 0x7C94B2, "Philips Healthcare PCCI" },

23694 { 0x7C95B1, "Extreme Networks Headquarters" },

23695 { 0x7C95F3, "Cisco Systems, Inc" },

23696 { 0x7C96D2, "Fihonest communication co.,Ltd" },

23697 { 0x7C9763, "Openmatics s.r.o." },

23698 { 0x7C97E1, "Huawei Device Co., Ltd." },

23699 { 0x7C9A1D, "Apple, Inc." },

23700 { 0x7C9A54, "Vantiva USA LLC" },

23701 { 0x7C9A9B, "VSE valencia smart energy" },

23702 { 0x7C9EBD, "Espressif Inc." },

23703 { 0x7C9F07, "CIG SHANGHAI CO LTD" },

23704 { 0x7CA15D, "GN ReSound A/S" },

23705 { 0x7CA177, "HUAWEI TECHNOLOGIES CO.,LTD" },

23706 { 0x7CA1AE, "Apple, Inc." },

23707 { 0x7CA237, "King Slide Technology CO., LTD." },

23708 { 0x7CA23E, "HUAWEI TECHNOLOGIES CO.,LTD" },

23709 { 0x7CA29B, "D.SignT GmbH & Co. KG" },

23710 { 0x7CA449, "Xiaomi Communications Co Ltd" },

23711 { 0x7CA61D, "MHL, LLC" },

23712 { 0x7CA62A, "Hewlett Packard Enterprise" },

23713 { 0x7CA7B0, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

23714 { 0x7CA96B, "Syrotech Networks. Ltd." },

23715 { 0x7CA97D, "Objenious" },

23716 { 0x7CAB25, "MESMO TECHNOLOGY INC." },

23717 { 0x7CAB60, "Apple, Inc." },

23718 { 0x7CACB2, "Bosch Software Innovations GmbH" },

23719 { 0x7CAD4F, "Cisco Systems, Inc" },

23720 { 0x7CAD74, "Cisco Systems, Inc" },

23721 { 0x7CB03E, "OSRAM GmbH" },

23722 { 0x7CB073, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

23723 { 0x7CB0C2, "Intel Corporate" },

23724 { 0x7CB15D, "HUAWEI TECHNOLOGIES CO.,LTD" },

23725 { 0x7CB177, "Satelco AG" },

23726 { 0x7CB21B, "Cisco SPVTG" },

23727 { 0x7CB232, "Hui Zhou Gaoshengda Technology Co.,LTD" },

23728 { 0x7CB25C, "Acacia Communications" },

23729 { 0x7CB27D, "Intel Corporate" },

23730 { 0x7CB30A, "zte corporation" },

23731 { 0x7CB37B, "Qingdao Intelligent&Precise Electronics Co.,Ltd." },

23732 { 0x7CB542, "ACES Technology" },

23733 { 0x7CB566, "Intel Corporate" },

23734 { 0x7CB59B, "TP-LINK TECHNOLOGIES CO.,LTD." },

23735 { 0x7CB733, "ASKEY COMPUTER CORP" },

23736 { 0x7CB77B, "Paradigm Electronics Inc" },

23737 { 0x7CB94C, "Bouffalo Lab (Nanjing) Co., Ltd." },

23738 { 0x7CB960, "Shanghai X-Cheng telecom LTD" },

23739 { 0x7CBACC, "IEEE Registration Authority" },

23740 { 0x7CBB6F, "Cosco Electronics Co., Ltd." },

23741 { 0x7CBB8A, "Nintendo Co., Ltd." },

23742 { 0x7CBC84, "IEEE Registration Authority" },

23743 { 0x7CBD06, "AE REFUsol" },

23744 { 0x7CBF77, "SPEEDTECH CORP." },

23745 { 0x7CBF88, "Mobilicom LTD" },

23746 { 0x7CBFAE, "Renesas Electronics (Penang) Sdn. Bhd." },

23747 { 0x7CBFB1, "ARRIS Group, Inc." },

23748 { 0x7CC06F, "Apple, Inc." },

23749 { 0x7CC0AA, "Microsoft Corporation" },

23750 { 0x7CC177, "INGRAM MICRO SERVICES" },

23751 { 0x7CC180, "Apple, Inc." },

23752 { 0x7CC225, "Samsung Electronics Co.,Ltd" },

23753 { 0x7CC255, "Super Micro Computer, Inc." },

23754 { 0x7CC294, "Beijing Xiaomi Mobile Software Co., Ltd" },

23755 { 0x7CC2C6, "TP-Link Corporation Limited" },

23756 { 0x7CC385, "HUAWEI TECHNOLOGIES CO.,LTD" },

23757 { 0x7CC3A1, "Apple, Inc." },

23758 { 0x7CC4EF, "Devialet" },

23759 { 0x7CC537, "Apple, Inc." },

23760 { 0x7CC6B6, "Silicon Laboratories" },

23761 { 0x7CC6C4, "Kolff Computer Supplies b.v." },

23762 { 0x7CC709, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

23763 { 0x7CC74A, "Fiberhome Telecommunication Technologies Co.,LTD" },

23764 { 0x7CC77E, "Fiberhome Telecommunication Technologies Co.,LTD" },

23765 { 0x7CC8AB, "Acro Associates, Inc." },

23766 { 0x7CC8D0, "TIANJIN YAAN TECHNOLOGY CO., LTD." },

23767 { 0x7CC8D7, "Damalisk" },

23768 { 0x7CC926, "Wuhan GreeNet Information Service Co.,Ltd." },

23769 { 0x7CC95A, "Dell EMC" },

23770 { 0x7CC95E, "Dongguan Liesheng Electronic Co., Ltd." },

23771 { 0x7CCB0D, "Antaira Technologies, LLC" },

23772 { 0x7CCBE2, "IEEE Registration Authority" },

23773 { 0x7CCC1F, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

23774 { 0x7CCCB8, "Intel Corporate" },

23775 { 0x7CCCFC, "Quectel Wireless Solutions Co.,Ltd." },

23776 { 0x7CCD11, "MS-Magnet" },

23777 { 0x7CCD3C, "Guangzhou Juzing Technology Co., Ltd" },

23778 { 0x7CCFCF, "Shanghai SEARI Intelligent System Co., Ltd" },

23779 { 0x7CD1C3, "Apple, Inc." },

23780 { 0x7CD30A, "INVENTEC CORPORATION" },

23781 { 0x7CD3E5, "HUAWEI TECHNOLOGIES CO.,LTD" },

23782 { 0x7CD566, "Amazon Technologies Inc." },

23783 { 0x7CD661, "Xiaomi Communications Co Ltd" },

23784 { 0x7CD762, "Freestyle Technology Pty Ltd" },

23785 { 0x7CD844, "Enmotus Inc" },

23786 { 0x7CD95C, "Google, Inc." },

23787 { 0x7CD9A0, "HUAWEI TECHNOLOGIES CO.,LTD" },

23788 { 0x7CD9F4, "UAB Teltonika Telematics" },

23789 { 0x7CD9FE, "New Cosmos Electric Co., Ltd." },

23790 { 0x7CDA84, "Dongnian Networks Inc." },

23791 { 0x7CDAC3, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

23792 { 0x7CDB98, "ASKEY COMPUTER CORP" },

23793 { 0x7CDCCC, "BEIJING STARBLAZE TECHNOLOGY CO.,LTD" },

23794 { 0x7CDD11, "Chongqing MAS SCI&TECH.Co.,Ltd" },

23795 { 0x7CDD20, "IOXOS Technologies S.A." },

23796 { 0x7CDD76, "Suzhou Hanming Technologies Co., Ltd." },

23797 { 0x7CDD90, "Shenzhen Ogemray Technology Co., Ltd." },

23798 { 0x7CDDE9, "ATOM tech Inc." },

23799 { 0x7CDE78, "New H3C Technologies Co., Ltd" },

23800 { 0x7CDFA1, "Espressif Inc." },

23801 { 0x7CE044, "NEON Inc" },

23802 { 0x7CE152, "THE GOODYEAR TIRE & RUBBER COMPANY" },

23803 { 0x7CE1FF, "Computer Performance, Inc. DBA Digital Loggers, Inc." },

23804 { 0x7CE269, "Texas Instruments" },

23805 { 0x7CE2CA, "Juniper Networks" },

23806 { 0x7CE4AA, "Private" },

23807 { 0x7CE524, "Quirky, Inc." },

23808 { 0x7CE56B, "ESEN Optoelectronics Technology Co.,Ltd." },

23809 { 0x7CE87F, "Sagemcom Broadband SAS" },

23810 { 0x7CE97C, "ITEL MOBILE LIMITED" },

23811 { 0x7CE9D3, "Hon Hai Precision Ind. Co.,Ltd." },

23812 { 0x7CEB7F, "Dmet Products Corp." },

23813 { 0x7CEBAE, "Ridgeline Instruments" },

23814 { 0x7CEBEA, "ASCT" },

23815 { 0x7CEC79, "Texas Instruments" },

23816 { 0x7CEC9B, "Fuzhou Teraway Information Technology Co.,Ltd" },

23817 { 0x7CECB1, "Apple, Inc." },

23818 { 0x7CED8D, "Microsoft" },

23819 { 0x7CEDC6, "Amazon Technologies Inc." },

23820 { 0x7CEF18, "Creative Product Design Pty. Ltd." },

23821 { 0x7CEF40, "Nextorage Corporation" },

23822 { 0x7CEF61, "STR Elektronik Josef Schlechtinger GmbH" },

23823 { 0x7CEF8A, "Inhon International Ltd." },

23824 { 0x7CF05F, "Apple, Inc." },

23825 { 0x7CF098, "Bee Beans Technologies, Inc." },

23826 { 0x7CF0BA, "Linkwell Telesystems Pvt Ltd" },

23827 { 0x7CF0E5, "OnePlus Technology (Shenzhen) Co., Ltd" },

23828 { 0x7CF2DD, "Vence Corp" },

23829 { 0x7CF31B, "LG Electronics (Mobile Communications)" },

23830 { 0x7CF34D, "Apple, Inc." },

23831 { 0x7CF429, "NUUO Inc." },

23832 { 0x7CF462, "BEIJING HUAWOO TECHNOLOGIES CO.LTD" },

23833 { 0x7CF666, "Tuya Smart Inc." },

23834 { 0x7CF854, "Samsung Electronics Co.,Ltd" },

23835 { 0x7CF880, "Cisco Systems, Inc" },

23836 { 0x7CF90E, "Samsung Electronics Co.,Ltd" },

23837 { 0x7CF95C, "U.I. Lapp GmbH" },

23838 { 0x7CF9A0, "Fiberhome Telecommunication Technologies Co.,LTD" },

23839 { 0x7CFADF, "Apple, Inc." },

23840 { 0x7CFC16, "Apple, Inc." },

23841 { 0x7CFC3C, "Visteon Corporation" },

23842 { 0x7CFCFD, "Fiberhome Telecommunication Technologies Co.,LTD" },

23843 { 0x7CFD6B, "Xiaomi Communications Co Ltd" },

23844 { 0x7CFD82, "GUANGDONG GENIUS TECHNOLOGY CO., LTD." },

23845 { 0x7CFE28, "Salutron Inc." },

23846 { 0x7CFE4E, "Shenzhen Safe vision Technology Co.,LTD" },

23847 { 0x7CFE90, "Mellanox Technologies, Inc." },

23848 { 0x7CFF4D, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

23849 { 0x7CFF62, "Huizhou Super Electron Technology Co.,Ltd." },

23850 { 0x80000B, "Intel Corporate" },

23851 { 0x800010, "AT&T" },

23852 { 0x80006E, "Apple, Inc." },

23853 { 0x80015C, "Synaptics, Inc" },

23854 { 0x800184, "HTC Corporation" },

23855 { 0x80029C, "Gemtek Technology Co., Ltd." },

23856 { 0x8002DF, "ORA Inc." },

23857 { 0x8002F4, "IEEE Registration Authority" },

23858 { 0x800384, "Ruckus Wireless" },

23859 { 0x80045F, "Apple, Inc." },

23860 { 0x80053A, "CHeKT Inc." },

23861 { 0x800588, "Ruijie Networks Co.,LTD" },

23862 { 0x8005DF, "Montage Technology Group Limited" },

23863 { 0x80071B, "VSOLUTION TELECOMMUNICATION TECHNOLOGY CO.,LTD." },

23864 { 0x800794, "Samsung Electronics Co.,Ltd" },

23865 { 0x8007A2, "Esson Technology Inc." },

23866 { 0x800902, "Keysight Technologies, Inc." },

23867 { 0x800A06, "COMTEC co.,ltd" },

23868 { 0x800A80, "IEEE Registration Authority" },

23869 { 0x800B51, "Chengdu XGimi Technology Co.,Ltd" },

23870 { 0x800C67, "Apple, Inc." },

23871 { 0x800CF9, "Amazon Technologies Inc." },

23872 { 0x800DD7, "Latticework, Inc" },

23873 { 0x800E24, "ForgetBox" },

23874 { 0x8012DF, "Shenzhen SuperElectron Technology Co.,Ltd." },

23875 { 0x801382, "HUAWEI TECHNOLOGIES CO.,LTD" },

23876 { 0x801440, "Sunlit System Technology Corp" },

23877 { 0x8014A8, "Guangzhou V-SOLUTION Electronic Technology Co., Ltd." },

23878 { 0x801605, "Vodafone Italia S.p.A." },

23879 { 0x801609, "Sleep Number" },

23880 { 0x8016B7, "Brunel University" },

23881 { 0x80177D, "Nortel Networks" },

23882 { 0x801844, "Dell Inc." },

23883 { 0x8018A7, "Samsung Electronics Co.,Ltd" },

23884 { 0x801934, "Intel Corporate" },

23885 { 0x801967, "Shanghai Reallytek Information Technology Co.,Ltd" },

23886 { 0x801970, "Samsung Electronics Co.,Ltd" },

23887 { 0x8019FE, "JianLing Technology CO., LTD" },

23888 { 0x801DAA, "Avaya Inc" },

23889 { 0x801F02, "Edimax Technology Co. Ltd." },

23890 { 0x801F12, "Microchip Technology Inc." },

23891 { 0x8020AF, "Trade FIDES, a.s." },

23892 { 0x8020DA, "Sagemcom Broadband SAS" },

23893 { 0x8020E1, "BVBA DPTechnics" },

23894 { 0x8020FD, "Samsung Electronics Co.,Ltd" },

23895 { 0x802275, "Beijing Beny Wave Technology Co Ltd" },

23896 { 0x802278, "China Mobile IOT Company Limited" },

23897 { 0x8022A7, "NEC Platforms, Ltd." },

23898 { 0x80248F, "Cisco Systems, Inc" },

23899 { 0x802511, "ITEL MOBILE LIMITED" },

23900 { 0x802689, "D-Link International" },

23901 { 0x80276C, "Cisco Systems, Inc" },

23902 { 0x802994, "Vantiva USA LLC" },

23903 { 0x802AA8, "Ubiquiti Inc" },

23904 { 0x802AFA, "Germaneers GmbH" },

23905 { 0x802BF9, "Hon Hai Precision Ind. Co.,Ltd." },

23906 { 0x802D1A, "zte corporation" },

23907 { 0x802DBF, "Cisco Systems, Inc" },

23908 { 0x802DE1, "Solarbridge Technologies" },

23909 { 0x802E14, "azeti Networks AG" },

23910 { 0x802EC3, "HUAWEI TECHNOLOGIES CO.,LTD" },

23911 { 0x802FDE, "Zurich Instruments AG" },

23912 { 0x803049, "Liteon Technology Corporation" },

23913 { 0x8030DC, "Texas Instruments" },

23914 { 0x8030E0, "Hewlett Packard Enterprise" },

23915 { 0x8031F0, "Samsung Electronics Co.,Ltd" },

23916 { 0x803253, "Intel Corporate" },

23917 { 0x803428, "Microchip Technology Inc." },

23918 { 0x803457, "OT Systems Limited" },

23919 { 0x8035C1, "Xiaomi Communications Co Ltd" },

23920 { 0x803773, "NETGEAR" },

23921 { 0x803896, "SHARP Corporation" },

23922 { 0x8038BC, "HUAWEI TECHNOLOGIES CO.,LTD" },

23923 { 0x8038D4, "Fibercentury Network Technology Co.,Ltd." },

23924 { 0x8038FB, "Intel Corporate" },

23925 { 0x8038FD, "LeapFrog Enterprises, Inc." },

23926 { 0x80398C, "Samsung Electronics Co.,Ltd" },

23927 { 0x8039E5, "PATLITE CORPORATION" },

23928 { 0x803A0A, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

23929 { 0x803A59, "AT&T" },

23930 { 0x803AF4, "Fiberhome Telecommunication Technologies Co.,LTD" },

23931 { 0x803B2A, "ABB Xiamen Low Voltage Equipment Co.,Ltd." },

23932 { 0x803B9A, "ghe-ces electronic ag" },

23933 { 0x803BF6, "LOOK EASY INTERNATIONAL LIMITED" },

23934 { 0x803C20, "HUAWEI TECHNOLOGIES CO.,LTD" },

23935 { 0x803E48, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

23936 { 0x803F5D, "Winstars Technology Ltd" },

23937 { 0x803FD6, "bytes at work AG" },

23938 { 0x804126, "HUAWEI TECHNOLOGIES CO.,LTD" },

23939 { 0x80414E, "BBK EDUCATIONAL ELECTRONICS CORP.,LTD." },

23940 { 0x80427C, "Adolf Tedsen GmbH & Co. KG" },

23941 { 0x80433F, "Juniper Networks" },

23942 { 0x8044FD, "China Mobile (Hangzhou) Information Technology Co., Ltd." },

23943 { 0x8045DD, "Intel Corporate" },

23944 { 0x804731, "Packet Design, Inc." },

23945 { 0x804786, "Samsung Electronics Co.,Ltd" },

23946 { 0x80482C, "Wyze Labs Inc" },

23947 { 0x8048A5, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

23948 { 0x804971, "Apple, Inc." },

23949 { 0x804A14, "Apple, Inc." },

23950 { 0x804AF2, "Sonos, Inc." },

23951 { 0x804B20, "Ventilation Control" },

23952 { 0x804B50, "Silicon Laboratories" },

23953 { 0x804E70, "Samsung Electronics Co.,Ltd" },

23954 { 0x804E81, "Samsung Electronics Co.,Ltd" },

23955 { 0x804F58, "ThinkEco, Inc." },

23956 { 0x80501B, "Nokia Corporation" },

23957 { 0x805067, "W & D TECHNOLOGY CORPORATION" },

23958 { 0x8050F6, "ITEL MOBILE LIMITED" },

23959 { 0x80546A, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

23960 { 0x80549C, "Samsung Electronics Co.,Ltd" },

23961 { 0x8054D9, "HUAWEI TECHNOLOGIES CO.,LTD" },

23962 { 0x8054E3, "Apple, Inc." },

23963 { 0x80563C, "ZF" },

23964 { 0x8056F2, "Hon Hai Precision Ind. Co.,Ltd." },

23965 { 0x805719, "Samsung Electronics Co.,Ltd" },

23966 { 0x8058C5, "NovaTec Kommunikationstechnik GmbH" },

23967 { 0x8058F8, "Motorola Mobility LLC, a Lenovo Company" },

23968 { 0x8059FD, "Noviga" },

23969 { 0x805A04, "LG Electronics (Mobile Communications)" },

23970 { 0x805B65, "LG Innotek" },

23971 { 0x805E0C, "YEALINK(XIAMEN) NETWORK TECHNOLOGY CO.,LTD." },

23972 { 0x805E4F, "FN-LINK TECHNOLOGY LIMITED" },

23973 { 0x805EC0, "YEALINK(XIAMEN) NETWORK TECHNOLOGY CO.,LTD." },

23974 { 0x805F8E, "Huizhou BYD Electronic Co., Ltd." },

23975 { 0x805FC5, "Apple, Inc." },

23976 { 0x806007, "RIM" },

23977 { 0x806036, "HUAWEI TECHNOLOGIES CO.,LTD" },

23978 { 0x8060B7, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

23979 { 0x80615F, "Beijing Sinead Technology Co., Ltd." },

23980 { 0x80616C, "New H3C Technologies Co., Ltd" },

23981 { 0x80618F, "Shenzhen sangfei consumer communications co.,ltd" },

23982 { 0x806459, "Nimbus Inc." },

23983 { 0x80646F, "Espressif Inc." },

23984 { 0x80647A, "Ola Sense Inc" },

23985 { 0x806559, "EM Microelectronic" },

23986 { 0x80656D, "Samsung Electronics Co.,Ltd" },

23987 { 0x80657C, "Apple, Inc." },

23988 { 0x806599, "Espressif Inc." },

23989 { 0x8065E9, "BenQ Corporation" },

23990 { 0x806629, "Prescope Technologies CO.,LTD." },

23991 { 0x80691A, "Belkin International Inc." },

23992 { 0x806933, "HUAWEI TECHNOLOGIES CO.,LTD" },

23993 { 0x806940, "LEXAR CO.,LIMITED" },

23994 { 0x806A00, "Cisco Systems, Inc" },

23995 { 0x806A10, "Whisker Labs - Ting" },

23996 { 0x806AB0, "Shenzhen TINNO Mobile Technology Corp." },

23997 { 0x806C1B, "Motorola Mobility LLC, a Lenovo Company" },

23998 { 0x806C8B, "KAESER KOMPRESSOREN AG" },

23999 { 0x806CBC, "NET New Electronic Technology GmbH" },

24000 { 0x806D71, "Amazon Technologies Inc." },

24001 { 0x806D97, "Private" },

24002 { 0x806F1C, "Huawei Device Co., Ltd." },

24003 { 0x806FB0, "Texas Instruments" },

24004 { 0x80711F, "Juniper Networks" },

24005 { 0x80717A, "HUAWEI TECHNOLOGIES CO.,LTD" },

24006 { 0x807215, "SKY UK LIMITED" },

24007 { 0x807264, "Huawei Device Co., Ltd." },

24008 { 0x80739F, "KYOCERA CORPORATION" },

24009 { 0x807459, "K's Co.,Ltd." },

24010 { 0x807484, "ALL Winner (Hong Kong) Limited" },

24011 { 0x80751F, "SKY UK LIMITED" },

24012 { 0x807677, "hangzhou puwell cloud tech co., ltd." },

24013 { 0x807693, "Newag SA" },

24014 { 0x8076C2, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

24015 { 0x8077A4, "TECNO MOBILE LIMITED" },

24016 { 0x807871, "ASKEY COMPUTER CORP" },

24017 { 0x80795D, "Infinix mobility limited" },

24018 { 0x8079AE, "ShanDong Tecsunrise Co.,Ltd" },

24019 { 0x807A7F, "ABB Genway Xiamen Electrical Equipment CO., LTD" },

24020 { 0x807ABF, "HTC Corporation" },

24021 { 0x807B1E, "Corsair Memory, Inc." },

24022 { 0x807B3E, "Samsung Electronics Co.,Ltd" },

24023 { 0x807B85, "IEEE Registration Authority" },

24024 { 0x807C0A, "zte corporation" },

24025 { 0x807C62, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

24026 { 0x807D14, "HUAWEI TECHNOLOGIES CO.,LTD" },

24027 { 0x807D1B, "Neosystem Co. Ltd." },

24028 { 0x807D3A, "Espressif Inc." },

24029 { 0x807DE3, "Chongqing Sichuan Instrument Microcircuit Co.LTD." },

24030 { 0x807EB4, "Shenzhen SuperElectron Technology Co.,Ltd." },

24031 { 0x807FF8, "Juniper Networks" },

24032 { 0x80802C, "Fortinet, Inc." },

24033 { 0x8081A5, "TONGQING COMMUNICATION EQUIPMENT (SHENZHEN) Co.,Ltd" },

24034 { 0x808223, "Apple, Inc." },

24035 { 0x808287, "ATCOM Technology Co.Ltd." },

24036 { 0x8082F5, "STMicrolectronics International NV" },

24037 { 0x8084A9, "oshkosh Corporation" },

24038 { 0x808544, "Intelbras" },

24039 { 0x808698, "Netronics Technologies Inc." },

24040 { 0x8086D9, "Samsung Electronics Co.,Ltd" },

24041 { 0x8086F2, "Intel Corporate" },

24042 { 0x808917, "TP-LINK TECHNOLOGIES CO.,LTD." },

24043 { 0x808A8B, "vivo Mobile Communication Co., Ltd." },

24044 { 0x808ABD, "Samsung Electronics Co.,Ltd" },

24045 { 0x808AF7, "Nanoleaf" },

24046 { 0x808B5C, "Shenzhen Runhuicheng Technology Co., Ltd" },

24047 { 0x808C97, "Kaon Group Co., Ltd." },

24048 { 0x808DB7, "Hewlett Packard Enterprise" },

24049 { 0x808F1D, "TP-LINK TECHNOLOGIES CO.,LTD." },

24050 { 0x808FE8, "Intelbras" },

24051 { 0x80912A, "Lih Rong electronic Enterprise Co., Ltd." },

24052 { 0x809133, "AzureWave Technology Inc." },

24053 { 0x8091C0, "AgileMesh, Inc." },

24054 { 0x80929F, "Apple, Inc." },

24055 { 0x809393, "Xapt GmbH" },

24056 { 0x80946C, "TOKYO RADAR CORPORATION" },

24057 { 0x80953A, "Apple, Inc." },

24058 { 0x809562, "Extreme Networks Headquarters" },

24059 { 0x809621, "Lenovo" },

24060 { 0x8096B1, "ARRIS Group, Inc." },

24061 { 0x8096CA, "Hon Hai Precision Ind. Co.,Ltd." },

24062 { 0x80971B, "Altenergy Power System,Inc." },

24063 { 0x809733, "Shenzhen Elebao Technology Co., Ltd" },

24064 { 0x8099E7, "Sony Corporation" },

24065 { 0x809B20, "Intel Corporate" },

24066 { 0x809F9B, "Sichuan AI-Link Technology Co., Ltd." },

24067 { 0x809FAB, "Fiberhome Telecommunication Technologies Co.,LTD" },

24068 { 0x809FF5, "Samsung Electronics Co.,Ltd" },

24069 { 0x80A036, "Shanghai MXCHIP Information Technology Co., Ltd." },

24070 { 0x80A1AB, "Intellisis" },

24071 { 0x80A1D7, "Shanghai DareGlobal Technologies Co.,Ltd" },

24072 { 0x80A235, "Edgecore Networks Corporation" },

24073 { 0x80A589, "AzureWave Technology Inc." },

24074 { 0x80A796, "Neuralink Corp." },

24075 { 0x80A85D, "Osterhout Design Group" },

24076 { 0x80A997, "Apple, Inc." },

24077 { 0x80AAA4, "USAG" },

24078 { 0x80AB4D, "Nokia Solutions and Networks GmbH & Co. KG" },

24079 { 0x80AC7C, "Sichuan AI-Link Technology Co., Ltd." },

24080 { 0x80ACAC, "Juniper Networks" },

24081 { 0x80ACC8, "Phyplus Microelectronics Limited" },

24082 { 0x80AD16, "Xiaomi Communications Co Ltd" },

24083 { 0x80AD67, "Kasda Networks Inc" },

24084 { 0x80AFCA, "Shenzhen Cudy Technology Co., Ltd." },

24085 { 0x80B03D, "Apple, Inc." },

24086 { 0x80B07B, "zte corporation" },

24087 { 0x80B219, "ELEKTRON TECHNOLOGY UK LIMITED" },

24088 { 0x80B234, "Vantiva USA LLC" },

24089 { 0x80B289, "Forworld Electronics Ltd." },

24090 { 0x80B32A, "UK Grid Solutions Ltd" },

24091 { 0x80B575, "HUAWEI TECHNOLOGIES CO.,LTD" },

24092 { 0x80B624, "IVS" },

24093 { 0x80B655, "Intel Corporate" },

24094 { 0x80B686, "HUAWEI TECHNOLOGIES CO.,LTD" },

24095 { 0x80B708, "Blue Danube Systems, Inc" },

24096 { 0x80B709, "Viptela, Inc" },

24097 { 0x80B745, "The Silk Technologies ILC LTD" },

24098 { 0x80B946, "Nokia" },

24099 { 0x80B95C, "ELFTECH Co., Ltd." },

24100 { 0x80B97A, "eero inc." },

24101 { 0x80B989, "Apple, Inc." },

24102 { 0x80BA16, "Micas Networks Inc." },

24103 { 0x80BAAC, "TeleAdapt Ltd" },

24104 { 0x80BAE6, "Neets" },

24105 { 0x80BBEB, "Satmap Systems Ltd" },

24106 { 0x80BC37, "Ruckus Wireless" },

24107 { 0x80BE05, "Apple, Inc." },

24108 { 0x80BEAF, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

24109 { 0x80C16E, "Hewlett Packard" },

24110 { 0x80C3BA, "Sonova Consumer Hearing GmbH" },

24111 { 0x80C41B, "Texas Instruments" },

24112 { 0x80C45D, "IPG Laser GmbH" },

24113 { 0x80C501, "OctoGate IT Security Systems GmbH" },

24114 { 0x80C548, "Shenzhen Zowee Technology Co.,Ltd" },

24115 { 0x80C5E6, "Microsoft Corporation" },

24116 { 0x80C5F2, "AzureWave Technology Inc." },

24117 { 0x80C63F, "Remec Broadband Wireless , LLC" },

24118 { 0x80C6AB, "Vantiva USA LLC" },

24119 { 0x80C6CA, "Endian s.r.l." },

24120 { 0x80C755, "Panasonic Appliances Company" },

24121 { 0x80C7C5, "Fiberhome Telecommunication Technologies Co.,LTD" },

24122 { 0x80C862, "Openpeak, Inc" },

24123 { 0x80C955, "Redpine Signals, Inc." },

24124 { 0x80CA4B, "SHENZHEN GONGJIN ELECTRONICS CO.,LTD" },

24125 { 0x80CBBC, "Qingdao Intelligent&Precise Electronics Co.,Ltd." },

24126 { 0x80CC12, "Huawei Device Co., Ltd." },

24127 { 0x80CC9C, "NETGEAR" },

24128 { 0x80CE62, "Hewlett Packard" },

24129 { 0x80CEB1, "Theissen Training Systems GmbH" },

24130 { 0x80CEB9, "Samsung Electronics Co.,Ltd" },

24131 { 0x80CF41, "Lenovo Mobile Communication Technology Ltd." },

24132 { 0x80CFA2, "Huawei Device Co., Ltd." },

24133 { 0x80D019, "Embed, Inc" },

24134 { 0x80D04A, "Vantiva USA LLC" },

24135 { 0x80D065, "CKS Corporation" },

24136 { 0x80D09B, "HUAWEI TECHNOLOGIES CO.,LTD" },

24137 { 0x80D160, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

24138 { 0x80D18B, "Hangzhou I'converge Technology Co.,Ltd" },

24139 { 0x80D21D, "AzureWave Technology Inc." },

24140 { 0x80D266, "ScaleFlux" },

24141 { 0x80D2E5, "Nintendo Co.,Ltd" },

24142 { 0x80D336, "CERN" },

24143 { 0x80D433, "LzLabs GmbH" },

24144 { 0x80D4A5, "HUAWEI TECHNOLOGIES CO.,LTD" },

24145 { 0x80D605, "Apple, Inc." },

24146 { 0x80D733, "QSR Automations, Inc." },

24147 { 0x80DA13, "eero inc." },

24148 { 0x80DABC, "Megafone Limited" },

24149 { 0x80DAC2, "Vantiva USA LLC" },

24150 { 0x80DB17, "Juniper Networks" },

24151 { 0x80DB31, "Power Quotient International Co., Ltd." },

24152 { 0x80DECC, "HYBE Co.,LTD" },

24153 { 0x80E01D, "Cisco Systems, Inc" },

24154 { 0x80E1BF, "HUAWEI TECHNOLOGIES CO.,LTD" },

24155 { 0x80E455, "New H3C Technologies Co., Ltd" },

24156 { 0x80E4DA, "IEEE Registration Authority" },

24157 { 0x80E540, "ARRIS Group, Inc." },

24158 { 0x80E650, "Apple, Inc." },

24159 { 0x80E82C, "Hewlett Packard" },

24160 { 0x80E86F, "Cisco Systems, Inc" },

24161 { 0x80EA07, "TP-LINK TECHNOLOGIES CO.,LTD." },

24162 { 0x80EA0B, "Zyxel Communications Corporation" },

24163 { 0x80EA23, "Wistron Neweb Corporation" },

24164 { 0x80EA96, "Apple, Inc." },

24165 { 0x80EACA, "Dialog Semiconductor Hellas SA" },

24166 { 0x80EB77, "Wistron Corporation" },

24167 { 0x80ED2C, "Apple, Inc." },

24168 { 0x80EE25, "Shenzhen Skyworth Digital Technology CO., Ltd" },

24169 { 0x80EE73, "Shuttle Inc." },

24170 { 0x80F0CF, "Ruckus Wireless" },

24171 { 0x80F1A4, "HUAWEI TECHNOLOGIES CO.,LTD" },

24172 { 0x80F1F1, "Tech4home, Lda" },

24173 { 0x80F25E, "Kyynel" },

24174 { 0x80F3EF, "Meta Platforms Technologies, LLC" },

24175 { 0x80F503, "ARRIS Group, Inc." },

24176 { 0x80F593, "IRCO Sistemas de Telecomunicación S.A." },

24177 { 0x80F5AE, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

24178 { 0x80F5B5, "Texas Instruments" },

24179 { 0x80F62E, "Hangzhou H3C Technologies Co., Limited" },

24180 { 0x80F7A6, "Shenzhen C-Data Technology Co., Ltd." },

24181 { 0x80F8EB, "RayTight" },

24182 { 0x80FA5B, "CLEVO CO." },

24183 { 0x80FB06, "HUAWEI TECHNOLOGIES CO.,LTD" },

24184 { 0x80FBF0, "Quectel Wireless Solutions Co.,Ltd." },

24185 { 0x80FBF1, "Freescale Semiconductor (China) Ltd." },

24186 { 0x80FD7A, "BLU Products Inc" },

24187 { 0x80FD7B, "BLU Products Inc" },

24188 { 0x80FFA8, "UNIDIS" },

24189 { 0x84002D, "PEGATRON CORPORATION" },

24190 { 0x8400D2, "Sony Corporation" },

24191 { 0x840112, "Kaon Group Co., Ltd." },

24192 { 0x8401A7, "Greyware Automation Products, Inc" },

24193 { 0x840283, "HUMAX Co., Ltd." },

24194 { 0x840328, "Juniper Networks" },

24195 { 0x8404D2, "Kirale Technologies SL" },

24196 { 0x8406FA, "Fiberhome Telecommunication Technologies Co.,LTD" },

24197 { 0x8407C4, "Carrier Corporation" },

24198 { 0x840A9E, "Nexapp Technologies Pvt Ltd" },

24199 { 0x840B2D, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

24200 { 0x840B7C, "Hitron Technologies. Inc" },

24201 { 0x840BBB, "MitraStar Technology Corp." },

24202 { 0x840D8E, "Espressif Inc." },

24203 { 0x840F2A, "Jiangxi Risound Electronics Co., LTD" },

24204 { 0x840F45, "Shanghai GMT Digital Technologies Co., Ltd" },

24205 { 0x84100D, "Motorola Mobility LLC, a Lenovo Company" },

24206 { 0x84119E, "Samsung Electronics Co.,Ltd" },

24207 { 0x8411C2, "IEEE Registration Authority" },

24208 { 0x84139F, "zte corporation" },

24209 { 0x84144D, "Intel Corporate" },

24210 { 0x8415D3, "HUAWEI TECHNOLOGIES CO.,LTD" },

24211 { 0x84160C, "Broadcom Limited" },

24212 { 0x8416F9, "TP-LINK TECHNOLOGIES CO.,LTD." },

24213 { 0x841715, "GP Electronics (HK) Ltd." },

24214 { 0x841766, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

24215 { 0x8417EF, "Vantiva USA LLC" },

24216 { 0x841826, "Osram GmbH" },

24217 { 0x84183A, "Ruckus Wireless" },

24218 { 0x841888, "Juniper Networks" },

24219 { 0x841B38, "Shenzhen Excelsecu Data Technology Co.,Ltd" },

24220 { 0x841B5E, "NETGEAR" },

24221 { 0x841B77, "Intel Corporate" },

24222 { 0x841C70, "zte corporation" },

24223 { 0x841E26, "KERNEL-I Co.,LTD" },

24224 { 0x841EA3, "Sagemcom Broadband SAS" },

24225 { 0x842096, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

24226 { 0x842141, "Shenzhen Ginwave Technologies Ltd." },

24227 { 0x8421F1, "HUAWEI TECHNOLOGIES CO.,LTD" },

24228 { 0x84225E, "SHENZHEN TECHNEWCHIP TECHNOLOGY CO.,LTD." },

24229 { 0x842289, "Samsung Electronics Co.,Ltd" },

24230 { 0x842388, "Ruckus Wireless" },

24231 { 0x84248D, "Zebra Technologies Inc" },

24232 { 0x842519, "Samsung Electronics" },

24233 { 0x84253F, "silex technology, Inc." },

24234 { 0x8425A4, "Tariox Limited" },

24235 { 0x8425DB, "Samsung Electronics Co.,Ltd" },

24236 { 0x842615, "ADB Broadband Italia" },

24237 { 0x84262B, "Nokia" },

24238 { 0x84267A, "GUANGDONG TAIDE ZHILIAN TECHNOLOGY CO.,LTD" },

24239 { 0x842690, "BEIJING THOUGHT SCIENCE CO.,LTD." },

24240 { 0x842712, "Silicon Laboratories" },

24241 { 0x8427B6, "China Mobile IOT Company Limited" },

24242 { 0x8427CE, "Corporation of the Presiding Bishop of The Church of Jesus Christ of Latter-day Saints" },

24243 { 0x842859, "Amazon Technologies Inc." },

24244 { 0x84285A, "Saffron Solutions Inc" },

24245 { 0x842914, "EMPORIA TELECOM Produktions- und VertriebsgesmbH & Co KG" },

24246 { 0x842999, "Apple, Inc." },

24247 { 0x842AFD, "HP Inc." },

24248 { 0x842B2B, "Dell Inc." },

24249 { 0x842B50, "Huria Co.,Ltd." },

24250 { 0x842BBC, "Modelleisenbahn GmbH" },

24251 { 0x842C80, "Sichuan Changhong Electric Ltd." },

24252 { 0x842E14, "Silicon Laboratories" },

24253 { 0x842E27, "Samsung Electronics Co.,Ltd" },

24254 { 0x842F75, "Innokas Group" },

24255 { 0x843095, "Hon Hai Precision IND.CO.,LTD" },

24256 { 0x8430CE, "Shenzhen Jaguar Microsystems Co., Ltd" },

24257 { 0x8430E5, "SkyHawke Technologies, LLC" },

24258 { 0x8431A8, "Wuhan Funshion Online Technologies Co.,Ltd" },

24259 { 0x84326F, "GUANGZHOU AVA ELECTRONICS TECHNOLOGY CO.,LTD" },

24260 { 0x8432EA, "ANHUI WANZTEN P&T CO., LTD" },

24261 { 0x843497, "Hewlett Packard" },

24262 { 0x843611, "hyungseul publishing networks" },

24263 { 0x8437D5, "Samsung Electronics Co.,Ltd" },

24264 { 0x843835, "Apple, Inc." },

24265 { 0x843838, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

24266 { 0x84398F, "Fortinet, Inc." },

24267 { 0x843A4B, "Intel Corporate" },

24268 { 0x843A5B, "Inventec(Chongqing) Corporation" },

24269 { 0x843B10, "LVSWITCHES INC." },

24270 { 0x843C4C, "Robert Bosch SRL" },

24271 { 0x843C99, "zte corporation" },

24272 { 0x843DC6, "Cisco Systems, Inc" },

24273 { 0x843E03, "Sagemcom Broadband SAS" },

24274 { 0x843E1D, "Hui Zhou Gaoshengda Technology Co.,LTD" },

24275 { 0x843E79, "Shenzhen Belon Technology CO.,LTD" },

24276 { 0x843E92, "HUAWEI TECHNOLOGIES CO.,LTD" },

24277 { 0x843F4E, "Tri-Tech Manufacturing, Inc." },

24278 { 0x844076, "Drivenets" },

24279 { 0x844167, "Apple, Inc." },

24280 { 0x844464, "ServerU Inc" },

24281 { 0x8444AF, "Zhejiang Tmall Technology Co., Ltd." },

24282 { 0x844693, "Beijing Xiaomi Mobile Software Co., Ltd" },

24283 { 0x8446FE, "HUAWEI TECHNOLOGIES CO.,LTD" },

24284 { 0x844709, "Shenzhen IP3 Century Intelligent Technology CO.,Ltd" },

24285 { 0x844765, "HUAWEI TECHNOLOGIES CO.,LTD" },

24286 { 0x844823, "WOXTER TECHNOLOGY Co. Ltd" },

24287 { 0x844915, "vArmour Networks, Inc." },

24288 { 0x844BB7, "Beijing Sankuai Online Technology Co.,Ltd" },

24289 { 0x844BF5, "Hon Hai Precision Ind. Co.,Ltd." },

24290 { 0x844DBE, "Fiberhome Telecommunication Technologies Co.,LTD" },

24291 { 0x844F03, "Ablelink Electronics Ltd" },

24292 { 0x845075, "Huawei Device Co., Ltd." },

24293 { 0x84509A, "Easy Soft TV Co., Ltd" },

24294 { 0x845181, "Samsung Electronics Co.,Ltd" },

24295 { 0x8454DF, "Huawei Device Co., Ltd." },

24296 { 0x8455A5, "Samsung Electronics Co.,Ltd" },

24297 { 0x84569C, "Coho Data, Inc.," },

24298 { 0x845733, "Microsoft Corporation" },

24299 { 0x845787, "DVR C&C Co., Ltd." },

24300 { 0x845A3E, "Cisco Systems, Inc" },

24301 { 0x845A81, "ffly4u" },

24302 { 0x845B12, "HUAWEI TECHNOLOGIES CO.,LTD" },

24303 { 0x845C93, "Chabrier Services" },

24304 { 0x845CF3, "Intel Corporate" },

24305 { 0x845DD7, "Shenzhen Netcom Electronics Co.,Ltd" },

24306 { 0x845F04, "Samsung Electronics Co.,Ltd" },

24307 { 0x846082, "Hyperloop Technologies, Inc dba Virgin Hyperloop" },

24308 { 0x8461A0, "ARRIS Group, Inc." },

24309 { 0x846223, "Shenzhen Coship Electronics Co., Ltd." },

24310 { 0x8462A6, "EuroCB (Phils), Inc." },

24311 { 0x8463D6, "Microsoft Corporation" },

24312 { 0x8464DD, "HUAWEI TECHNOLOGIES CO.,LTD" },

24313 { 0x846569, "New H3C Technologies Co., Ltd" },

24314 { 0x84683E, "Intel Corporate" },

24315 { 0x846878, "Apple, Inc." },

24316 { 0x8468C8, "TOTOLINK TECHNOLOGY INT‘L LIMITED" },

24317 { 0x846991, "Nokia" },

24318 { 0x846993, "HP Inc." },

24319 { 0x846A66, "Sumitomo Kizai Co.,Ltd." },

24320 { 0x846AED, "Wireless Tsukamoto.,co.LTD" },

24321 { 0x846B48, "ShenZhen EepuLink Co., Ltd." },

24322 { 0x846EB1, "Park Assist LLC" },

24323 { 0x846FCE, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

24324 { 0x847051, "ALPSALPINE CO,.LTD" },

24325 { 0x8470D7, "eero inc." },

24326 { 0x847127, "Silicon Laboratories" },

24327 { 0x84716A, "Huawei Device Co., Ltd." },

24328 { 0x847207, "I&C Technology" },

24329 { 0x847293, "Texas Instruments" },

24330 { 0x847303, "Letv Mobile and Intelligent Information Technology (Beijing) Corporation Ltd." },

24331 { 0x84742A, "zte corporation" },

24332 { 0x847460, "zte corporation" },

24333 { 0x847616, "Addat s.r.o." },

24334 { 0x847637, "HUAWEI TECHNOLOGIES CO.,LTD" },

24335 { 0x847778, "Cochlear Limited" },

24336 { 0x84788B, "Apple, Inc." },

24337 { 0x8478AC, "Cisco Systems, Inc" },

24338 { 0x847933, "profichip GmbH" },

24339 { 0x847973, "Shanghai Baud Data Communication Co.,Ltd." },

24340 { 0x847A88, "HTC Corporation" },

24341 { 0x847AB6, "AltoBeam (China) Inc." },

24342 { 0x847ADF, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

24343 { 0x847B57, "Intel Corporate" },

24344 { 0x847BEB, "Dell Inc." },

24345 { 0x847C9B, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

24346 { 0x847D50, "Holley Metering Limited" },

24347 { 0x847E40, "Texas Instruments" },

24348 { 0x847F3D, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

24349 { 0x84802D, "Cisco Systems, Inc" },

24350 { 0x848094, "Meter, Inc." },

24351 { 0x848102, "Fiberhome Telecommunication Technologies Co.,LTD" },

24352 { 0x8482F4, "Beijing Huasun Unicreate Technology Co., Ltd" },

24353 { 0x848319, "Hangzhou Zero Zero Technology Co., Ltd." },

24354 { 0x848336, "Newrun" },

24355 { 0x848371, "Avaya Inc" },

24356 { 0x848433, "Paradox Engineering SA" },

24357 { 0x848506, "Apple, Inc." },

24358 { 0x84850A, "Hella Sonnen- und Wetterschutztechnik GmbH" },

24359 { 0x848553, "Biznes Systema Telecom, LLC" },

24360 { 0x8485E6, "Guangdong Asano Technology CO.,Ltd." },

24361 { 0x848687, "weiyuantechnology" },

24362 { 0x8486F3, "Greenvity Communications" },

24363 { 0x8487FF, "Shenzhen Skyworth Digital Technology CO., Ltd" },

24364 { 0x8488E1, "Apple, Inc." },

24365 { 0x8489AD, "Apple, Inc." },

24366 { 0x8489EC, "IEEE Registration Authority" },

24367 { 0x848A59, "Hisilicon Technologies Co., Ltd" },

24368 { 0x848A8D, "Cisco Systems, Inc" },

24369 { 0x848BCD, "IEEE Registration Authority" },

24370 { 0x848C8D, "Apple, Inc." },

24371 { 0x848D84, "Rajant Corporation" },

24372 { 0x848DC7, "Cisco SPVTG" },

24373 { 0x848DCE, "Ciena Corporation" },

24374 { 0x848E0C, "Apple, Inc." },

24375 { 0x848E96, "Embertec Pty Ltd" },

24376 { 0x848EDF, "Sony Corporation" },

24377 { 0x848F69, "Dell Inc." },

24378 { 0x849000, "Arnold&Richter Cine Technik GmbH & Co. Betriebs KG" },

24379 { 0x84900A, "Arcadyan Corporation" },

24380 { 0x84930C, "InCoax Networks Europe AB" },

24381 { 0x8493A0, "Huawei Device Co., Ltd." },

24382 { 0x8493B2, "zte corporation" },

24383 { 0x849437, "Apple, Inc." },

24384 { 0x84948C, "Hitron Technologies. Inc" },

24385 { 0x849681, "Cathay Communication Co.,Ltd" },

24386 { 0x8496D8, "ARRIS Group, Inc." },

24387 { 0x8497B8, "Memjet Inc." },

24388 { 0x849866, "Samsung Electronics Co.,Ltd" },

24389 { 0x849A40, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

24390 { 0x849C02, "Druid Software" },

24391 { 0x849CA6, "Arcadyan Technology Corporation" },

24392 { 0x849D64, "SMC Corporation" },

24393 { 0x849DC2, "Shanghai MXCHIP Information Technology Co., Ltd." },

24394 { 0x849DC5, "Centera Photonics Inc." },

24395 { 0x849FB5, "HUAWEI TECHNOLOGIES CO.,LTD" },

24396 { 0x84A06E, "Sagemcom Broadband SAS" },

24397 { 0x84A134, "Apple, Inc." },

24398 { 0x84A1D1, "Sagemcom Broadband SAS" },

24399 { 0x84A24D, "Birds Eye Systems Private Limited" },

24400 { 0x84A3B5, "Propulsion systems" },

24401 { 0x84A423, "Sagemcom Broadband SAS" },

24402 { 0x84A466, "Samsung Electronics Co.,Ltd" },

24403 { 0x84A6C8, "Intel Corporate" },

24404 { 0x84A783, "Alcatel Lucent" },

24405 { 0x84A788, "Perples" },

24406 { 0x84A8E4, "HUAWEI TECHNOLOGIES CO.,LTD" },

24407 { 0x84A938, "LCFC(HeFei) Electronics Technology co., ltd" },

24408 { 0x84A93E, "Hewlett Packard" },

24409 { 0x84A991, "Cyber Trans Japan Co.,Ltd." },

24410 { 0x84A9C4, "HUAWEI TECHNOLOGIES CO.,LTD" },

24411 { 0x84A9EA, "Career Technologies USA" },

24412 { 0x84AA9C, "MitraStar Technology Corp." },

24413 { 0x84AAA4, "SONoC Corp." },

24414 { 0x84AB1A, "Apple, Inc." },

24415 { 0x84AB26, "Tiinlab Corporation" },

24416 { 0x84AC16, "Apple, Inc." },

24417 { 0x84AC60, "Guangxi Hesheng Electronics Co., Ltd." },

24418 { 0x84ACA4, "Beijing Novel Super Digital TV Technology Co., Ltd" },

24419 { 0x84ACFB, "Crouzet Automatismes" },

24420 { 0x84AD58, "HUAWEI TECHNOLOGIES CO.,LTD" },

24421 { 0x84AD8D, "Apple, Inc." },

24422 { 0x84AF1F, "Beat System Service Co,. Ltd." },

24423 { 0x84AFEC, "BUFFALO.INC" },

24424 { 0x84B153, "Apple, Inc." },

24425 { 0x84B1E2, "Microsoft Corporation" },

24426 { 0x84B1E4, "Apple, Inc." },

24427 { 0x84B261, "Cisco Systems, Inc" },

24428 { 0x84B31B, "Kinexon GmbH" },

24429 { 0x84B386, "IEEE Registration Authority" },

24430 { 0x84B4D2, "Shenzhen iComm Semiconductor CO.,LTD" },

24431 { 0x84B4DB, "Silicon Laboratories" },

24432 { 0x84B517, "Cisco Systems, Inc" },

24433 { 0x84B541, "Samsung Electronics Co.,Ltd" },

24434 { 0x84B59C, "Juniper Networks" },

24435 { 0x84B630, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

24436 { 0x84B802, "Cisco Systems, Inc" },

24437 { 0x84B866, "Beijing XiaoLu technology co. LTD" },

24438 { 0x84B8B8, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

24439 { 0x84BA20, "Silicon Laboratories" },

24440 { 0x84BA3B, "CANON INC." },

24441 { 0x84BA59, "Wistron InfoComm(Chongqing)Co.,Ltd." },

24442 { 0x84BB26, "Texas Instruments" },

24443 { 0x84BB69, "ARRIS Group, Inc." },

24444 { 0x84BE52, "HUAWEI TECHNOLOGIES CO.,LTD" },

24445 { 0x84C0EF, "Samsung Electronics Co.,Ltd" },

24446 { 0x84C1C1, "Juniper Networks" },

24447 { 0x84C2E4, "Jiangsu Qinheng Co., Ltd." },

24448 { 0x84C3E8, "Vaillant GmbH" },

24449 { 0x84C5A6, "Intel Corporate" },

24450 { 0x84C692, "Texas Instruments" },

24451 { 0x84C727, "Gnodal Ltd" },

24452 { 0x84C78F, "APS Networks GmbH" },

24453 { 0x84C7A9, "C3PO S.A." },

24454 { 0x84C7EA, "Sony Corporation" },

24455 { 0x84C807, "ADVA Optical Networking Ltd." },

24456 { 0x84C8A0, "Hui Zhou Gaoshengda Technology Co.,LTD" },

24457 { 0x84C8B1, "Incognito Software Systems Inc." },

24458 { 0x84C9B2, "D-Link International" },

24459 { 0x84C9C6, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

24460 { 0x84CC63, "Huawei Device Co., Ltd." },

24461 { 0x84CCA8, "Espressif Inc." },

24462 { 0x84CD62, "ShenZhen IDWELL Technology CO.,Ltd" },

24463 { 0x84CFBF, "Fairphone" },

24464 { 0x84D15A, "TCT mobile ltd" },

24465 { 0x84D328, "Apple, Inc." },

24466 { 0x84D32A, "IEEE 1905.1" },

24467 { 0x84D343, "Calix Inc." },

24468 { 0x84D352, "Tonly Technology Co. Ltd" },

24469 { 0x84D3D5, "Huawei Device Co., Ltd." },

24470 { 0x84D412, "Palo Alto Networks" },

24471 { 0x84D47E, "Aruba, a Hewlett Packard Enterprise Company" },

24472 { 0x84D4C8, "Widex A/S" },

24473 { 0x84D5A0, "MCOT INC." },

24474 { 0x84D608, "Wingtech Mobile Communications Co., Ltd." },

24475 { 0x84D6C5, "SolarEdge Technologies" },

24476 { 0x84D6D0, "Amazon Technologies Inc." },

24477 { 0x84D81B, "TP-LINK TECHNOLOGIES CO.,LTD." },

24478 { 0x84D931, "Hangzhou H3C Technologies Co., Limited" },

24479 { 0x84D9C8, "Unipattern Co.," },

24480 { 0x84DB2F, "Sierra Wireless, ULC" },

24481 { 0x84DB9E, "Pink Nectarine Health AB" },

24482 { 0x84DBA4, "Huawei Device Co., Ltd." },

24483 { 0x84DBAC, "HUAWEI TECHNOLOGIES CO.,LTD" },

24484 { 0x84DBFC, "Nokia" },

24485 { 0x84DD20, "Texas Instruments" },

24486 { 0x84DDB7, "Cilag GmbH International" },

24487 { 0x84DE3D, "Crystal Vision Ltd" },

24488 { 0x84DF0C, "NET2GRID BV" },

24489 { 0x84DF19, "Chuango Security Technology Corporation" },

24490 { 0x84E058, "ARRIS Group, Inc." },

24491 { 0x84E0F4, "IEEE Registration Authority" },

24492 { 0x84E323, "Green Wave Telecommunication SDN BHD" },

24493 { 0x84E327, "TAILYN TECHNOLOGIES INC" },

24494 { 0x84E342, "Tuya Smart Inc." },

24495 { 0x84E4D9, "Shenzhen NEED technology Ltd." },

24496 { 0x84E5D8, "Guangdong UNIPOE IoT Technology Co.,Ltd." },

24497 { 0x84E629, "Bluwan SA" },

24498 { 0x84E657, "Sony Interactive Entertainment Inc." },

24499 { 0x84E714, "Liang Herng Enterprise,Co.Ltd." },

24500 { 0x84E892, "Actiontec Electronics, Inc" },

24501 { 0x84E8CB, "BUFFALO.INC" },

24502 { 0x84E986, "Huawei Device Co., Ltd." },

24503 { 0x84E9C1, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

24504 { 0x84EA97, "Shenzhen iComm Semiconductor CO.,LTD" },

24505 { 0x84EA99, "Vieworks" },

24506 { 0x84EAED, "Roku, Inc" },

24507 { 0x84EB18, "Texas Instruments" },

24508 { 0x84EB3E, "Vivint Smart Home" },

24509 { 0x84EBEF, "Cisco Systems, Inc" },

24510 { 0x84ED33, "BBMC Co.,Ltd" },

24511 { 0x84EEE4, "Samsung Electronics Co.,Ltd" },

24512 { 0x84EF18, "Intel Corporate" },

24513 { 0x84F117, "Newseason" },

24514 { 0x84F129, "Metrascale Inc." },

24515 { 0x84F147, "Cisco Systems, Inc" },

24516 { 0x84F175, "Jiangxi Xunte Intelligent Terminal Co., Ltd" },

24517 { 0x84F1D0, "EHOOME IOT PRIVATE LIMITED" },

24518 { 0x84F3EB, "Espressif Inc." },

24519 { 0x84F44C, "International Integrated Systems., Inc." },

24520 { 0x84F493, "OMS spol. s.r.o." },

24521 { 0x84F5EB, "zte corporation" },

24522 { 0x84F64C, "Cross Point BV" },

24523 { 0x84F6FA, "Miovision Technologies Incorporated" },

24524 { 0x84F703, "Espressif Inc." },

24525 { 0x84F883, "Luminar Technologies" },

24526 { 0x84FB43, "Central Denshi Seigyo" },

24527 { 0x84FCAC, "Apple, Inc." },

24528 { 0x84FCE6, "Espressif Inc." },

24529 { 0x84FCFE, "Apple, Inc." },

24530 { 0x84FD27, "Silicon Laboratories" },

24531 { 0x84FDD1, "Intel Corporate" },

24532 { 0x84FE9E, "RTC Industries, Inc." },

24533 { 0x84FEDC, "Borqs Beijing Ltd." },

24534 { 0x88010C, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

24535 { 0x880118, "BLT Co" },

24536 { 0x8801F2, "Vitec System Engineering Inc." },

24537 { 0x8801F9, "Texas Instruments" },

24538 { 0x88034C, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

24539 { 0x880355, "Arcadyan Technology Corporation" },

24540 { 0x8803E9, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

24541 { 0x88074B, "LG Electronics (Mobile Communications)" },

24542 { 0x880894, "Skullcandy" },

24543 { 0x880905, "MTMCommunications" },

24544 { 0x880907, "MKT Systemtechnik GmbH & Co. KG" },

24545 { 0x8809AF, "Masimo Corporation" },

24546 { 0x880AA3, "Juniper Networks" },

24547 { 0x880CE0, "Texas Instruments" },

24548 { 0x880F10, "Huami Information Technology Co.,Ltd." },

24549 { 0x880FA2, "Sagemcom Broadband SAS" },

24550 { 0x880FB6, "Jabil Circuits India Pvt Ltd,-EHTP unit" },

24551 { 0x881036, "Panodic(ShenZhen) Electronics Limted" },

24552 { 0x88108F, "HUAWEI TECHNOLOGIES CO.,LTD" },

24553 { 0x881196, "HUAWEI TECHNOLOGIES CO.,LTD" },

24554 { 0x88123D, "Suzhou Aquila Solutions Inc." },

24555 { 0x88124E, "Qualcomm Inc." },

24556 { 0x8812AC, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

24557 { 0x88142B, "Protonic Holland" },

24558 { 0x881544, "Cisco Meraki" },

24559 { 0x8815C5, "Huawei Device Co., Ltd." },

24560 { 0x8817A3, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

24561 { 0x8818AE, "Tamron Co., Ltd" },

24562 { 0x881908, "Apple, Inc." },

24563 { 0x881A14, "Silicon Laboratories" },

24564 { 0x881B99, "SHENZHEN XIN FEI JIA ELECTRONIC CO. LTD." },

24565 { 0x881C95, "ITEL MOBILE LIMITED" },

24566 { 0x881DFC, "Cisco Systems, Inc" },

24567 { 0x881E59, "Onion Corporation" },

24568 { 0x881E5A, "Apple, Inc." },

24569 { 0x881FA1, "Apple, Inc." },

24570 { 0x88200D, "Apple, Inc." },

24571 { 0x882012, "LMI Technologies" },

24572 { 0x8821E3, "Nebusens, S.L." },

24573 { 0x8822B2, "Chipsea Technologies (Shenzhen) Corp." },

24574 { 0x88231F, "Fibocom Wireless Inc." },

24575 { 0x882364, "Watchnet DVR Inc" },

24576 { 0x88238C, "Fiberhome Telecommunication Technologies Co.,LTD" },

24577 { 0x8823FE, "TTTech Computertechnik AG" },

24578 { 0x882508, "Meta Platforms Technologies, LLC" },

24579 { 0x882510, "Aruba, a Hewlett Packard Enterprise Company" },

24580 { 0x88252C, "Arcadyan Technology Corporation" },

24581 { 0x882593, "TP-LINK TECHNOLOGIES CO.,LTD." },

24582 { 0x88287D, "AltoBeam (China) Inc." },

24583 { 0x8828B3, "HUAWEI TECHNOLOGIES CO.,LTD" },

24584 { 0x8828FB, "Juniper Networks" },

24585 { 0x882949, "Renesas Electronics (Penang) Sdn. Bhd." },

24586 { 0x882950, "Netmoon Technology Co., Ltd" },

24587 { 0x88299C, "Samsung Electronics Co.,Ltd" },

24588 { 0x882A5E, "New H3C Technologies Co., Ltd" },

24589 { 0x882B94, "MADOKA SYSTEM Co.,Ltd." },

24590 { 0x882BD7, "ADDÉNERGIE TECHNOLOGIES" },

24591 { 0x882D53, "Baidu Online Network Technology (Beijing) Co., Ltd." },

24592 { 0x882E5A, "storONE" },

24593 { 0x882F64, "BCOM Networks Limited" },

24594 { 0x883037, "Juniper Networks" },

24595 { 0x88308A, "Murata Manufacturing Co., Ltd." },

24596 { 0x88329B, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

24597 { 0x883314, "Texas Instruments" },

24598 { 0x8833BE, "Ivenix, Inc." },

24599 { 0x8834FE, "Bosch Automotive Products (Suzhou) Co. Ltd" },

24600 { 0x88354C, "Transics" },

24601 { 0x8835C1, "OI ELECTRIC CO.,LTD" },

24602 { 0x883612, "SRC Computers, LLC" },

24603 { 0x88365F, "LG Electronics (Mobile Communications)" },

24604 { 0x88366C, "EFM Networks" },

24605 { 0x8836CF, "Huawei Device Co., Ltd." },

24606 { 0x883A30, "Aruba, a Hewlett Packard Enterprise Company" },

24607 { 0x883B8B, "Cheering Connection Co. Ltd." },

24608 { 0x883C1C, "MERCURY CORPORATION" },

24609 { 0x883C93, "Alcatel-Lucent Enterprise" },

24610 { 0x883CC5, "IEEE Registration Authority" },

24611 { 0x883D24, "Google, Inc." },

24612 { 0x883F0C, "system a.v. co., ltd." },

24613 { 0x883F27, "Huawei Device Co., Ltd." },

24614 { 0x883F37, "UHTEK CO., LTD." },

24615 { 0x883F4A, "Texas Instruments" },

24616 { 0x883F99, "Siemens AG" },

24617 { 0x883FD3, "HUAWEI TECHNOLOGIES CO.,LTD" },

24618 { 0x884033, "HUAWEI TECHNOLOGIES CO.,LTD" },

24619 { 0x88403B, "HUAWEI TECHNOLOGIES CO.,LTD" },

24620 { 0x884067, "infomark" },

24621 { 0x884157, "Shenzhen Atsmart Technology Co.,Ltd." },

24622 { 0x8841C1, "ORBISAT DA AMAZONIA IND E AEROL SA" },

24623 { 0x8841FC, "AirTies Wireless Networks" },

24624 { 0x8843E1, "Cisco Systems, Inc" },

24625 { 0x884477, "HUAWEI TECHNOLOGIES CO.,LTD" },

24626 { 0x8844F6, "Nokia Corporation" },

24627 { 0x884604, "Xiaomi Communications Co Ltd" },

24628 { 0x88462A, "Telechips Inc." },

24629 { 0x884A18, "Opulinks" },

24630 { 0x884A70, "Wacom Co.,Ltd." },

24631 { 0x884AEA, "Texas Instruments" },

24632 { 0x884B39, "Siemens AG, Healthcare Sector" },

24633 { 0x884CCF, "Pulzze Systems, Inc" },

24634 { 0x884D7C, "Apple, Inc." },

24635 { 0x885046, "LEAR" },

24636 { 0x8850DD, "Infiniband Trade Association" },

24637 { 0x8850F6, "Shenzhen Jingxun Software Telecommunication Technology Co.,Ltd" },

24638 { 0x88517A, "HMD Global Oy" },

24639 { 0x8851FB, "Hewlett Packard" },

24640 { 0x8852EB, "Xiaomi Communications Co Ltd" },

24641 { 0x88532E, "Intel Corporate" },

24642 { 0x885395, "Apple, Inc." },

24643 { 0x8853D4, "HUAWEI TECHNOLOGIES CO.,LTD" },

24644 { 0x88541F, "Google, Inc." },

24645 { 0x88548E, "vivo Mobile Communication Co., Ltd." },

24646 { 0x88571D, "Seongji Industry Company" },

24647 { 0x88576D, "XTA Electronics Ltd" },

24648 { 0x8857EE, "BUFFALO.INC" },

24649 { 0x8858BE, "kuosheng.com" },

24650 { 0x885A06, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

24651 { 0x885A85, "Wistron Neweb Corporation" },

24652 { 0x885A92, "Cisco Systems, Inc" },

24653 { 0x885BDD, "Extreme Networks Headquarters" },

24654 { 0x885C47, "Alcatel Lucent" },

24655 { 0x885D90, "IEEE Registration Authority" },

24656 { 0x885DFB, "zte corporation" },

24657 { 0x885EBD, "NCKOREA Co.,Ltd." },

24658 { 0x885FE8, "IEEE Registration Authority" },

24659 { 0x886076, "Sparnex n.v." },

24660 { 0x88615A, "Siano Mobile Silicon Ltd." },

24661 { 0x88625D, "BITNETWORKS CO.,LTD" },

24662 { 0x8863DF, "Apple, Inc." },

24663 { 0x886440, "Apple, Inc." },

24664 { 0x886639, "HUAWEI TECHNOLOGIES CO.,LTD" },

24665 { 0x88665A, "Apple, Inc." },

24666 { 0x8866A5, "Apple, Inc." },

24667 { 0x8867DC, "HUAWEI TECHNOLOGIES CO.,LTD" },

24668 { 0x88684B, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

24669 { 0x88685C, "Shenzhen ChuangDao & Perpetual Eternal Technology Co.,Ltd" },

24670 { 0x88693D, "HUAWEI TECHNOLOGIES CO.,LTD" },

24671 { 0x886AB1, "vivo Mobile Communication Co., Ltd." },

24672 { 0x886AE3, "Alpha Networks Inc." },

24673 { 0x886B0F, "Bluegiga Technologies OY" },

24674 { 0x886B44, "Sunnovo International Limited" },

24675 { 0x886B6E, "Apple, Inc." },

24676 { 0x886B76, "CHINA HOPEFUL GROUP HOPEFUL ELECTRIC CO.,LTD" },

24677 { 0x886C60, "Xiaomi Communications Co Ltd" },

24678 { 0x886D2D, "Huawei Device Co., Ltd." },

24679 { 0x886EDD, "Micronet union Technology(Chengdu)Co., Ltd." },

24680 { 0x886EE1, "Erbe Elektromedizin GmbH" },

24681 { 0x886EEB, "HUAWEI TECHNOLOGIES CO.,LTD" },

24682 { 0x886F29, "Pocketbook International SA" },

24683 { 0x886FD4, "Dell Inc." },

24684 { 0x887033, "Hangzhou Silan Microelectronic Inc" },

24685 { 0x88708C, "Lenovo Mobile Communication Technology Ltd." },

24686 { 0x8870EF, "SC Professional Trading Co., Ltd." },

24687 { 0x8871B1, "ARRIS Group, Inc." },

24688 { 0x8871E5, "Amazon Technologies Inc." },

24689 { 0x887384, "Toshiba" },

24690 { 0x887398, "K2E Tekpoint" },

24691 { 0x887477, "HUAWEI TECHNOLOGIES CO.,LTD" },

24692 { 0x887556, "Cisco Systems, Inc" },

24693 { 0x887598, "Samsung Electronics Co.,Ltd" },

24694 { 0x887873, "Intel Corporate" },

24695 { 0x88789C, "Game Technologies SA" },

24696 { 0x88795B, "Konka Group Co., Ltd." },

24697 { 0x88797E, "Motorola Mobility LLC, a Lenovo Company" },

24698 { 0x887A31, "Velankani Electronics Pvt. Ltd." },

24699 { 0x887B2C, "zte corporation" },

24700 { 0x887E25, "Extreme Networks Headquarters" },

24701 { 0x887F03, "Comper Technology Investment Limited" },

24702 { 0x888187, "Umeox Innovations Co.,Ltd" },

24703 { 0x8881B9, "Huawei Device Co., Ltd." },

24704 { 0x888279, "Shenzhen RB-LINK Intelligent Technology Co.Ltd" },

24705 { 0x888322, "Samsung Electronics Co.,Ltd" },

24706 { 0x88835D, "FN-LINK TECHNOLOGY LIMITED" },

24707 { 0x888603, "HUAWEI TECHNOLOGIES CO.,LTD" },

24708 { 0x8886A0, "Simton Technologies, Ltd." },

24709 { 0x8886C2, "STABILO International GmbH" },

24710 { 0x888717, "CANON INC." },

24711 { 0x8887DD, "DarbeeVision Inc." },

24712 { 0x888914, "All Components Incorporated" },

24713 { 0x88892F, "HUAWEI TECHNOLOGIES CO.,LTD" },

24714 { 0x888964, "GSI Electronics Inc." },

24715 { 0x888B5D, "Storage Appliance Corporation" },

24716 { 0x888C19, "Brady Corp Asia Pacific Ltd" },

24717 { 0x888E68, "Huawei Device Co., Ltd." },

24718 { 0x888E7F, "ATOP CORPORATION" },

24719 { 0x888F10, "Shenzhen Max Infinite Technology Co.,Ltd." },

24720 { 0x888FA4, "Huawei Device Co., Ltd." },

24721 { 0x889009, "Juniper Networks" },

24722 { 0x88908D, "Cisco Systems, Inc" },

24723 { 0x889166, "Viewcooper Corp." },

24724 { 0x8891DD, "Racktivity" },

24725 { 0x889471, "Brocade Communications Systems LLC" },

24726 { 0x88947E, "Fiberhome Telecommunication Technologies Co.,LTD" },

24727 { 0x88948E, "Max Weishaupt GmbH" },

24728 { 0x88948F, "Xi'an Zhisensor Technologies Co.,Ltd" },

24729 { 0x8894F9, "Gemicom Technology, Inc." },

24730 { 0x8895B9, "Unified Packet Systems Crop" },

24731 { 0x88964E, "ARRIS Group, Inc." },

24732 { 0x889655, "Zitte corporation" },

24733 { 0x889676, "TTC MARCONI s.r.o." },

24734 { 0x8896B6, "Global Fire Equipment S.A." },

24735 { 0x8896F2, "Valeo Schalter und Sensoren GmbH" },

24736 { 0x889746, "Sichuan AI-Link Technology Co., Ltd." },

24737 { 0x889765, "exands" },

24738 { 0x8897DF, "Entrypass Corporation Sdn. Bhd." },

24739 { 0x889821, "TERAON" },

24740 { 0x889B39, "Samsung Electronics Co.,Ltd" },

24741 { 0x889CA6, "BTB Korea INC" },

24742 { 0x889CAD, "Cisco Systems, Inc" },

24743 { 0x889D98, "Allied-telesisK.K." },

24744 { 0x889E33, "TCT mobile ltd" },

24745 { 0x889E68, "Vantiva USA LLC" },

24746 { 0x889F6F, "Samsung Electronics Co.,Ltd" },

24747 { 0x889FAA, "Hella Gutmann Solutions GmbH" },

24748 { 0x889FFA, "Hon Hai Precision Ind. Co.,Ltd." },

24749 { 0x88A084, "Formation Data Systems" },

24750 { 0x88A0BE, "HUAWEI TECHNOLOGIES CO.,LTD" },

24751 { 0x88A25E, "Juniper Networks" },

24752 { 0x88A2D7, "HUAWEI TECHNOLOGIES CO.,LTD" },

24753 { 0x88A303, "Samsung Electronics Co.,Ltd" },

24754 { 0x88A3CC, "Amatis Controls" },

24755 { 0x88A479, "Apple, Inc." },

24756 { 0x88A4C2, "LCFC(HeFei) Electronics Technology co., ltd" },

24757 { 0x88A5BD, "QPCOM INC." },

24758 { 0x88A6C6, "Sagemcom Broadband SAS" },

24759 { 0x88A6EF, "IEEE Registration Authority" },

24760 { 0x88A73C, "Ragentek Technology Group" },

24761 { 0x88A9A7, "IEEE Registration Authority" },

24762 { 0x88A9B7, "Apple, Inc." },

24763 { 0x88AC9E, "Shenzhen YOUHUA Technology Co., Ltd" },

24764 { 0x88ACC0, "Zyxel Communications Corporation" },

24765 { 0x88ACC1, "Generiton Co., Ltd." },

24766 { 0x88AD43, "PEGATRON CORPORATION" },

24767 { 0x88ADD2, "Samsung Electronics Co.,Ltd" },

24768 { 0x88AE07, "Apple, Inc." },

24769 { 0x88AE1D, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

24770 { 0x88AEDD, "EliteGroup Computer Systems Co., LTD" },

24771 { 0x88AF7B, "Nanjing Powercore Tech Co.,Ltd" },

24772 { 0x88B111, "Intel Corporate" },

24773 { 0x88B168, "Delta Control GmbH" },

24774 { 0x88B1E1, "Mojo Networks, Inc." },

24775 { 0x88B291, "Apple, Inc." },

24776 { 0x88B362, "Nokia Shanghai Bell Co., Ltd." },

24777 { 0x88B436, "FUJIFILM Corporation" },

24778 { 0x88B4A6, "Motorola Mobility LLC, a Lenovo Company" },

24779 { 0x88B4BE, "HUAWEI TECHNOLOGIES CO.,LTD" },

24780 { 0x88B5FF, "Shenzhen iComm Semiconductor CO.,LTD" },

24781 { 0x88B627, "Gembird Europe BV" },

24782 { 0x88B66B, "easynetworks" },

24783 { 0x88B6BD, "Flaircomm Microelectronics, Inc." },

24784 { 0x88B6EE, "Dish Technologies Corp" },

24785 { 0x88B7EB, "Apple, Inc." },

24786 { 0x88B863, "HISENSE VISUAL TECHNOLOGY CO.,LTD" },

24787 { 0x88B86F, "Infinix mobility limited" },

24788 { 0x88B8D0, "Dongguan Koppo Electronic Co.,Ltd" },

24789 { 0x88B945, "Apple, Inc." },

24790 { 0x88BA7F, "Qfiednet Co., Ltd." },

24791 { 0x88BCC1, "HUAWEI TECHNOLOGIES CO.,LTD" },

24792 { 0x88BD45, "Samsung Electronics Co.,Ltd" },

24793 { 0x88BD78, "Flaircomm Microelectronics,Inc." },

24794 { 0x88BFD5, "Simple Audio Ltd" },

24795 { 0x88BFE4, "HUAWEI TECHNOLOGIES CO.,LTD" },

24796 { 0x88C08B, "Apple, Inc." },

24797 { 0x88C174, "zte corporation" },

24798 { 0x88C227, "HUAWEI TECHNOLOGIES CO.,LTD" },

24799 { 0x88C242, "Poynt Co." },

24800 { 0x88C255, "Texas Instruments" },

24801 { 0x88C36E, "Beijing Ereneben lnformation Technology Limited" },

24802 { 0x88C397, "Beijing Xiaomi Mobile Software Co., Ltd" },

24803 { 0x88C3B3, "SOVICO" },

24804 { 0x88C3E5, "Betop Techonologies" },

24805 { 0x88C626, "Logitech, Inc" },

24806 { 0x88C663, "Apple, Inc." },

24807 { 0x88C6E8, "HUAWEI TECHNOLOGIES CO.,LTD" },

24808 { 0x88C9B3, "IEEE Registration Authority" },

24809 { 0x88C9D0, "LG Electronics (Mobile Communications)" },

24810 { 0x88C9E8, "Sony Corporation" },

24811 { 0x88CB87, "Apple, Inc." },

24812 { 0x88CBA5, "Suzhou Torchstar Intelligent Technology Co.,Ltd" },

24813 { 0x88CC45, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

24814 { 0x88CE3F, "HUAWEI TECHNOLOGIES CO.,LTD" },

24815 { 0x88CEFA, "HUAWEI TECHNOLOGIES CO.,LTD" },

24816 { 0x88CF98, "HUAWEI TECHNOLOGIES CO.,LTD" },

24817 { 0x88D039, "Tonly Technology Co. Ltd" },

24818 { 0x88D171, "BEGHELLI S.P.A" },

24819 { 0x88D199, "Vencer Co., Ltd." },

24820 { 0x88D211, "Eko Devices, Inc." },

24821 { 0x88D274, "zte corporation" },

24822 { 0x88D2BF, "German Autolabs" },

24823 { 0x88D37B, "FirmTek, LLC" },

24824 { 0x88D50C, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

24825 { 0x88D5A8, "ITEL MOBILE LIMITED" },

24826 { 0x88D652, "AMERGINT Technologies" },

24827 { 0x88D7BC, "DEP Company" },

24828 { 0x88D7F6, "ASUSTek COMPUTER INC." },

24829 { 0x88D82E, "Intel Corporate" },

24830 { 0x88D962, "Canopus Systems US LLC" },

24831 { 0x88D98F, "Juniper Networks" },

24832 { 0x88DA1A, "Redpine Signals, Inc." },

24833 { 0x88DA33, "Beijing Xiaoyuer Network Technology Co., Ltd" },

24834 { 0x88DC96, "EnGenius Technologies, Inc." },

24835 { 0x88DD79, "Voltaire" },

24836 { 0x88DE7C, "ASKEY COMPUTER CORP" },

24837 { 0x88DEA9, "Roku, Inc." },

24838 { 0x88DF9E, "New H3C Technologies Co., Ltd" },

24839 { 0x88E034, "Shinwa industries(China) ltd." },

24840 { 0x88E056, "HUAWEI TECHNOLOGIES CO.,LTD" },

24841 { 0x88E0A0, "Shenzhen VisionSTOR Technologies Co., Ltd" },

24842 { 0x88E0F3, "Juniper Networks" },

24843 { 0x88E161, "Art Beijing Science and Technology Development Co., Ltd." },

24844 { 0x88E3AB, "HUAWEI TECHNOLOGIES CO.,LTD" },

24845 { 0x88E603, "Avotek corporation" },

24846 { 0x88E628, "Shenzhen Kezhonglong Optoelectronic Technology Co.,Ltd" },

24847 { 0x88E64B, "Juniper Networks" },

24848 { 0x88E712, "Whirlpool Corporation" },

24849 { 0x88E7A6, "iKnowledge Integration Corp." },

24850 { 0x88E87F, "Apple, Inc." },

24851 { 0x88E8F8, "YONG TAI ELECTRONIC (DONGGUAN) LTD." },

24852 { 0x88E90F, "innomdlelab" },

24853 { 0x88E917, "Tamaggo" },

24854 { 0x88E9A4, "Hewlett Packard Enterprise" },

24855 { 0x88E9FE, "Apple, Inc." },

24856 { 0x88ED1C, "Cudo Communication Co., Ltd." },

24857 { 0x88EF16, "ARRIS Group, Inc." },

24858 { 0x88F00F, "Miraeil" },

24859 { 0x88F031, "Cisco Systems, Inc" },

24860 { 0x88F077, "Cisco Systems, Inc" },

24861 { 0x88F2BD, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

24862 { 0x88F488, "cellon communications technology(shenzhen)Co.,Ltd." },

24863 { 0x88F490, "Jetmobile Pte Ltd" },

24864 { 0x88F56E, "HUAWEI TECHNOLOGIES CO.,LTD" },

24865 { 0x88F7BF, "vivo Mobile Communication Co., Ltd." },

24866 { 0x88F7C7, "Vantiva USA LLC" },

24867 { 0x88F872, "HUAWEI TECHNOLOGIES CO.,LTD" },

24868 { 0x88F916, "Qingdao Dayu Dance Digital Technology Co.,Ltd" },

24869 { 0x88FC5D, "Cisco Systems, Inc" },

24870 { 0x88FCA6, "devolo AG" },

24871 { 0x88FD15, "LINEEYE CO., LTD" },

24872 { 0x88FED6, "ShangHai WangYong Software Co., Ltd." },

24873 { 0x8C006D, "Apple, Inc." },

24874 { 0x8C02CD, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

24875 { 0x8C02FA, "COMMANDO Networks Limited" },

24876 { 0x8C04BA, "Dell Inc." },

24877 { 0x8C04FF, "Vantiva USA LLC" },

24878 { 0x8C0551, "Koubachi AG" },

24879 { 0x8C06CB, "Toradex AG" },

24880 { 0x8C0734, "Private" },

24881 { 0x8C078C, "FLOW DATA INC" },

24882 { 0x8C0879, "Texas Instruments" },

24883 { 0x8C088B, "Remote Solution" },

24884 { 0x8C09F4, "ARRIS Group, Inc." },

24885 { 0x8C0C87, "Nokia" },

24886 { 0x8C0C90, "Ruckus Wireless" },

24887 { 0x8C0CA3, "Amper" },

24888 { 0x8C0D76, "HUAWEI TECHNOLOGIES CO.,LTD" },

24889 { 0x8C0E60, "Nanjing Juplink Intelligent Technologies Co., Ltd." },

24890 { 0x8C0EE3, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

24891 { 0x8C0F6F, "PEGATRON CORPORATION" },

24892 { 0x8C0F83, "Angie Hospitality LLC" },

24893 { 0x8C0FA0, "di-soric GmbH & Co. KG" },

24894 { 0x8C0FC9, "Huawei Device Co., Ltd." },

24895 { 0x8C0FFA, "Hutec co.,ltd" },

24896 { 0x8C10D4, "Sagemcom Broadband SAS" },

24897 { 0x8C11CB, "ABUS Security-Center GmbH & Co. KG" },

24898 { 0x8C147D, "IEEE Registration Authority" },

24899 { 0x8C14B4, "zte corporation" },

24900 { 0x8C1553, "Beijing Memblaze Technology Co Ltd" },

24901 { 0x8C15C7, "HUAWEI TECHNOLOGIES CO.,LTD" },

24902 { 0x8C1645, "LCFC(HeFei) Electronics Technology co., ltd" },

24903 { 0x8C1759, "Intel Corporate" },

24904 { 0x8C17B6, "Huawei Device Co., Ltd." },

24905 { 0x8C1850, "China Mobile (Hangzhou) Information Technology Co., Ltd." },

24906 { 0x8C18D9, "Shenzhen RF Technology Co., Ltd" },

24907 { 0x8C192D, "IEEE Registration Authority" },

24908 { 0x8C19B5, "Arcadyan Corporation" },

24909 { 0x8C1A50, "China Mobile Group Device Co.,Ltd." },

24910 { 0x8C1ABF, "Samsung Electronics Co.,Ltd" },

24911 { 0x8C1AF3, "Shenzhen Gooxi Information Security CO.,Ltd." },

24912 { 0x8C1CDA, "IEEE Registration Authority" },

24913 { 0x8C1D96, "Intel Corporate" },

24914 { 0x8C1E80, "Cisco Systems, Inc" },

24915 { 0x8C1ED9, "Beijing Unigroup Tsingteng Microsystem Co., LTD." },

24916 { 0x8C1F64, "IEEE Registration Authority" },

24917 { 0x8C1F94, "RF Surgical System Inc." },

24918 { 0x8C210A, "TP-LINK TECHNOLOGIES CO.,LTD." },

24919 { 0x8C2505, "HUAWEI TECHNOLOGIES CO.,LTD" },

24920 { 0x8C255E, "VoltServer" },

24921 { 0x8C26AA, "Apple, Inc." },

24922 { 0x8C271D, "QuantHouse" },

24923 { 0x8C278A, "Vocollect Inc" },

24924 { 0x8C2937, "Apple, Inc." },

24925 { 0x8C2A8E, "DongGuan Ramaxel Memory Technology" },

24926 { 0x8C2DAA, "Apple, Inc." },

24927 { 0x8C2F39, "IBA Dosimetry GmbH" },

24928 { 0x8C2FA6, "Solid Optics B.V." },

24929 { 0x8C31E2, "DAYOUPLUS" },

24930 { 0x8C3223, "JWIPC Technology Co.,Ltd." },

24931 { 0x8C3330, "EmFirst Co., Ltd." },

24932 { 0x8C3357, "HiteVision Digital Media Technology Co.,Ltd." },

24933 { 0x8C3401, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

24934 { 0x8C3446, "Huawei Device Co., Ltd." },

24935 { 0x8C34FD, "HUAWEI TECHNOLOGIES CO.,LTD" },

24936 { 0x8C3579, "QDIQO Sp. z o.o." },

24937 { 0x8C3592, "Guangzhou Shiyuan Electronic Technology Company Limited" },

24938 { 0x8C367A, "Palo Alto Networks" },

24939 { 0x8C395C, "Bit4id Srl" },

24940 { 0x8C3A7E, "Universal Electronics, Inc." },

24941 { 0x8C3AE3, "LG Electronics (Mobile Communications)" },

24942 { 0x8C3B32, "Microfan B.V." },

24943 { 0x8C3B4A, "Universal Global Scientific Industrial Co., Ltd." },

24944 { 0x8C3BAD, "NETGEAR" },

24945 { 0x8C3C07, "Skiva Technologies, Inc." },

24946 { 0x8C3C4A, "NAKAYO Inc" },

24947 { 0x8C3DB1, "Beijing H-IoT Technology Co., Ltd." },

24948 { 0x8C41F2, "RDA Technologies Ltd." },

24949 { 0x8C41F4, "IPmotion GmbH" },

24950 { 0x8C426D, "HUAWEI TECHNOLOGIES CO.,LTD" },

24951 { 0x8C4361, "Hailo Digital Hub GmbH & Co. KG" },

24952 { 0x8C4435, "Shanghai BroadMobi Communication Technology Co., Ltd." },

24953 { 0x8C444F, "HUMAX Co., Ltd." },

24954 { 0x8C44A5, "Cisco Systems, Inc" },

24955 { 0x8C4500, "Murata Manufacturing Co., Ltd." },

24956 { 0x8C476E, "IEEE Registration Authority" },

24957 { 0x8C477F, "NambooSolution" },

24958 { 0x8C47BE, "Dell Inc." },

24959 { 0x8C4962, "Roku, Inc" },

24960 { 0x8C497A, "Extreme Networks Headquarters" },

24961 { 0x8C49B6, "vivo Mobile Communication Co., Ltd." },

24962 { 0x8C4AEE, "GIGA TMS INC" },

24963 { 0x8C4B14, "Espressif Inc." },

24964 { 0x8C4B59, "3D Imaging & Simulations Corp" },

24965 { 0x8C4CAD, "Evoluzn Inc." },

24966 { 0x8C4CDC, "PLANEX COMMUNICATIONS INC." },

24967 { 0x8C4DB9, "Unmonday Ltd" },

24968 { 0x8C4DEA, "Cerio Corporation" },

24969 { 0x8C5105, "Shenzhen ireadygo Information Technology CO.,LTD." },

24970 { 0x8C5109, "IEEE Registration Authority" },

24971 { 0x8C5219, "SHARP Corporation" },

24972 { 0x8C53C3, "Beijing Xiaomi Mobile Software Co., Ltd" },

24973 { 0x8C53D2, "China Mobile Group Device Co.,Ltd." },

24974 { 0x8C53E6, "Wistron Neweb Corporation" },

24975 { 0x8C53F7, "A&D ENGINEERING CO., LTD." },

24976 { 0x8C541D, "LGE" },

24977 { 0x8C554A, "Intel Corporate" },

24978 { 0x8C5570, "IEEE Registration Authority" },

24979 { 0x8C55BB, "Songwoo Information & Technology Co., Ltd" },

24980 { 0x8C5646, "LG Electronics" },

24981 { 0x8C569D, "Imaging Solutions Group" },

24982 { 0x8C56C5, "Nintendo Co., Ltd." },

24983 { 0x8C579B, "Wistron Neweb Corporation" },

24984 { 0x8C57FD, "LVX Western" },

24985 { 0x8C5877, "Apple, Inc." },

24986 { 0x8C593C, "IEEE Registration Authority" },

24987 { 0x8C5973, "Zyxel Communications Corporation" },

24988 { 0x8C598B, "C Technologies AB" },

24989 { 0x8C59C3, "ADB Italia" },

24990 { 0x8C59DC, "ASR Microelectronics (Shanghai) Co., Ltd." },

24991 { 0x8C5A25, "ARRIS Group, Inc." },

24992 { 0x8C5AC1, "Huawei Device Co., Ltd." },

24993 { 0x8C5AF0, "Exeltech Solar Products" },

24994 { 0x8C5AF8, "Beijing Xiaomi Electronics Co., Ltd." },

24995 { 0x8C5BF0, "ARRIS Group, Inc." },

24996 { 0x8C5C20, "ARRIS Group, Inc." },

24997 { 0x8C5CA1, "d-broad,INC" },

24998 { 0x8C5D60, "UCI Corporation Co.,Ltd." },

24999 { 0x8C5DB2, "IEEE Registration Authority" },

25000 { 0x8C5EBD, "Huawei Device Co., Ltd." },

25001 { 0x8C5F48, "Continental Intelligent Transportation Systems LLC" },

25002 { 0x8C5FAD, "Fiberhome Telecommunication Technologies Co.,LTD" },

25003 { 0x8C5FDF, "Beijing Railway Signal Factory" },

25004 { 0x8C604F, "Cisco Systems, Inc" },

25005 { 0x8C6078, "Swissbit AG" },

25006 { 0x8C60E7, "MPGIO CO.,LTD" },

25007 { 0x8C6102, "Beijing Baofengmojing Technologies Co., Ltd" },

25008 { 0x8C6120, "EM Microelectronic" },

25009 { 0x8C61A3, "ARRIS Group, Inc." },

25010 { 0x8C640B, "Beyond Devices d.o.o." },

25011 { 0x8C6422, "Sony Corporation" },

25012 { 0x8C64A2, "OnePlus Technology (Shenzhen) Co., Ltd" },

25013 { 0x8C64D4, "Hyeco Smart Tech Co.,Ltd" },

25014 { 0x8C65A3, "Silicon Laboratories" },

25015 { 0x8C6794, "vivo Mobile Communication Co., Ltd." },

25016 { 0x8C683A, "HUAWEI TECHNOLOGIES CO.,LTD" },

25017 { 0x8C6878, "Nortek-AS" },

25018 { 0x8C68C8, "zte corporation" },

25019 { 0x8C6A3B, "Samsung Electronics Co.,Ltd" },

25020 { 0x8C6A8D, "Vantiva USA LLC" },

25021 { 0x8C6AE4, "Viogem Limited" },

25022 { 0x8C6BDB, "Huawei Device Co., Ltd." },

25023 { 0x8C6D50, "SHENZHEN MTC CO LTD" },

25024 { 0x8C6D77, "HUAWEI TECHNOLOGIES CO.,LTD" },

25025 { 0x8C6DC4, "Megapixel VR" },

25026 { 0x8C6FB9, "Silicon Laboratories" },

25027 { 0x8C705A, "Intel Corporate" },

25028 { 0x8C7086, "Gesellschaft für Sonder-EDV-Anlagen mbH" },

25029 { 0x8C71F8, "Samsung Electronics Co.,Ltd" },

25030 { 0x8C736E, "FUJITSU LIMITED" },

25031 { 0x8C73A0, "Fiberhome Telecommunication Technologies Co.,LTD" },

25032 { 0x8C763F, "ARRIS Group, Inc." },

25033 { 0x8C76C1, "Goden Tech Limited" },

25034 { 0x8C7712, "Samsung Electronics Co.,Ltd" },

25035 { 0x8C7716, "LONGCHEER TELECOMMUNICATION LIMITED" },

25036 { 0x8C78D7, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

25037 { 0x8C7909, "Aruba, a Hewlett Packard Enterprise Company" },

25038 { 0x8C7967, "zte corporation" },

25039 { 0x8C79F5, "Samsung Electronics Co.,Ltd" },

25040 { 0x8C7A00, "Nokia" },

25041 { 0x8C7A15, "Ruckus Wireless" },

25042 { 0x8C7A3D, "Xiaomi Communications Co Ltd" },

25043 { 0x8C7AAA, "Apple, Inc." },

25044 { 0x8C7B9D, "Apple, Inc." },

25045 { 0x8C7BF0, "Xufeng Development Limited" },

25046 { 0x8C7C92, "Apple, Inc." },

25047 { 0x8C7CB5, "Hon Hai Precision Ind. Co.,Ltd." },

25048 { 0x8C7CFF, "Brocade Communications Systems LLC" },

25049 { 0x8C7EB3, "Lytro, Inc." },

25050 { 0x8C7F3B, "ARRIS Group, Inc." },

25051 { 0x8C8126, "ARCOM" },

25052 { 0x8C8172, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

25053 { 0x8C82A8, "Insigma Technology Co.,Ltd" },

25054 { 0x8C8394, "Arcadyan Corporation" },

25055 { 0x8C839D, "SHENZHEN XINYUPENG ELECTRONIC TECHNOLOGY CO., LTD" },

25056 { 0x8C83DF, "Nokia" },

25057 { 0x8C83E1, "Samsung Electronics Co.,Ltd" },

25058 { 0x8C83E8, "HUAWEI TECHNOLOGIES CO.,LTD" },

25059 { 0x8C83FC, "Axioma Metering UAB" },

25060 { 0x8C8401, "Private" },

25061 { 0x8C8442, "Cisco Systems, Inc" },

25062 { 0x8C8580, "Smart Innovation LLC" },

25063 { 0x8C8590, "Apple, Inc." },

25064 { 0x8C85C1, "Aruba, a Hewlett Packard Enterprise Company" },

25065 { 0x8C85E6, "Cleondris GmbH" },

25066 { 0x8C861E, "Apple, Inc." },

25067 { 0x8C862A, "HUAWEI TECHNOLOGIES CO.,LTD" },

25068 { 0x8C873B, "Leica Camera AG" },

25069 { 0x8C8881, "Cisco Meraki" },

25070 { 0x8C897A, "AUGTEK" },

25071 { 0x8C89A5, "Micro-Star INT'L CO., LTD" },

25072 { 0x8C89FA, "Zhejiang Hechuan Technology Co., Ltd." },

25073 { 0x8C8A6E, "ESTUN AUTOMATION TECHNOLOY CO., LTD" },

25074 { 0x8C8ABB, "Beijing Orient View Technology Co., Ltd." },

25075 { 0x8C8B83, "Texas Instruments" },

25076 { 0x8C8CAA, "LCFC(HeFei) Electronics Technology co., ltd" },

25077 { 0x8C8D28, "Intel Corporate" },

25078 { 0x8C8E0D, "zte corporation" },

25079 { 0x8C8E4E, "Baylan Olcu Aletleri San. ve Tic.A.S." },

25080 { 0x8C8E76, "taskit GmbH" },

25081 { 0x8C8EF2, "Apple, Inc." },

25082 { 0x8C8F8B, "China Mobile Chongqing branch" },

25083 { 0x8C8FE9, "Apple, Inc." },

25084 { 0x8C90D3, "Nokia" },

25085 { 0x8C9109, "Toyoshima Electric Technoeogy(Suzhou) Co.,Ltd." },

25086 { 0x8C9236, "Aus.Linx Technology Co., Ltd." },

25087 { 0x8C9246, "Oerlikon Textile Gmbh&Co.KG" },

25088 { 0x8C9351, "Jigowatts Inc." },

25089 { 0x8C941F, "Cisco Systems, Inc" },

25090 { 0x8C9461, "Cisco Systems, Inc" },

25091 { 0x8C946A, "New H3C Technologies Co., Ltd" },

25092 { 0x8C94CC, "SFR" },

25093 { 0x8C94CF, "Encell Technology, Inc." },

25094 { 0x8C965F, "Shandong Zhongan Technology Co., Ltd." },

25095 { 0x8C97EA, "FREEBOX SAS" },

25096 { 0x8C9806, "SHENZHEN SEI ROBOTICS CO.,LTD" },

25097 { 0x8C986B, "Apple, Inc." },

25098 { 0x8C99E6, "TCT mobile ltd" },

25099 { 0x8C9B2D, "PLANTRONICS, INC." },

25100 { 0x8C9F3B, "Qingdao Hisense Communications Co.,Ltd." },

25101 { 0x8CA048, "Beijing NeTopChip Technology Co.,LTD" },

25102 { 0x8CA2FD, "Starry, Inc." },

25103 { 0x8CA399, "SERVERCOM (INDIA) PRIVATE LIMITED" },

25104 { 0x8CA5A1, "Oregano Systems - Design & Consulting GmbH" },

25105 { 0x8CA682, "IEEE Registration Authority" },

25106 { 0x8CA6DF, "TP-LINK TECHNOLOGIES CO.,LTD." },

25107 { 0x8CA96F, "D&M Holdings Inc." },

25108 { 0x8CA982, "Intel Corporate" },

25109 { 0x8CAAB5, "Espressif Inc." },

25110 { 0x8CAACE, "Xiaomi Communications Co Ltd" },

25111 { 0x8CAB8E, "Shanghai Feixun Communication Co.,Ltd." },

25112 { 0x8CAE49, "IEEE Registration Authority" },

25113 { 0x8CAE4C, "Plugable Technologies" },

25114 { 0x8CAE89, "Y-cam Solutions Ltd" },

25115 { 0x8CAEDB, "NAGTECH LLC" },

25116 { 0x8CB094, "Airtech I&C Co., Ltd" },

25117 { 0x8CB0E9, "Samsung Electronics.,LTD" },

25118 { 0x8CB64F, "Cisco Systems, Inc" },

25119 { 0x8CB7F7, "Shenzhen UniStrong Science & Technology Co., Ltd" },

25120 { 0x8CB82C, "IPitomy Communications" },

25121 { 0x8CB84A, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

25122 { 0x8CB864, "AcSiP Technology Corp." },

25123 { 0x8CB87E, "Intel Corporate" },

25124 { 0x8CBA25, "UNION MAN TECHNOLOGY CO.,LTD" },

25125 { 0x8CBE24, "Tashang Semiconductor(Shanghai) Co., Ltd." },

25126 { 0x8CBEBE, "Xiaomi Communications Co Ltd" },

25127 { 0x8CBF9D, "Shanghai Xinyou Information Technology Ltd. Co." },

25128 { 0x8CBFA6, "Samsung Electronics Co.,Ltd" },

25129 { 0x8CC121, "Panasonic Corporation AVC Networks Company" },

25130 { 0x8CC58C, "ShenZhen Elsky Technology Co.,LTD" },

25131 { 0x8CC5B4, "Sagemcom Broadband SAS" },

25132 { 0x8CC5E1, "ShenZhen Konka Telecommunication Technology Co.,Ltd" },

25133 { 0x8CC661, "Current, powered by GE" },

25134 { 0x8CC681, "Intel Corporate" },

25135 { 0x8CC7AA, "Radinet Communications Inc." },

25136 { 0x8CC7C3, "NETLINK ICT" },

25137 { 0x8CC7D0, "zhejiang ebang communication co.,ltd" },

25138 { 0x8CC84B, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

25139 { 0x8CC8CD, "Samsung Electronics Co.,Ltd" },

25140 { 0x8CC8F4, "IEEE Registration Authority" },

25141 { 0x8CCB14, "TBS GmbH" },

25142 { 0x8CCBDF, "FOXCONN INTERCONNECT TECHNOLOGY" },

25143 { 0x8CCDA2, "ACTP, Inc." },

25144 { 0x8CCDE8, "Nintendo Co., Ltd." },

25145 { 0x8CCDFE, "AMPAK Technology,Inc." },

25146 { 0x8CCE4E, "Espressif Inc." },

25147 { 0x8CCEFD, "Shenzhen zhouhai technology co.,LTD" },

25148 { 0x8CCF09, "Dell EMC" },

25149 { 0x8CCF5C, "BEFEGA GmbH" },

25150 { 0x8CCF8F, "ITC Systems" },

25151 { 0x8CD08B, "WuXi Rigosys Technology Co.,LTD" },

25152 { 0x8CD0B2, "Beijing Xiaomi Mobile Software Co., Ltd" },

25153 { 0x8CD17B, "CG Mobile" },

25154 { 0x8CD2E9, "YOKOTE SEIKO CO., LTD." },

25155 { 0x8CD3A2, "VisSim AS" },

25156 { 0x8CD48E, "ITEL MOBILE LIMITED" },

25157 { 0x8CD54A, "TAIYO YUDEN CO.,LTD" },

25158 { 0x8CD628, "Ikor Metering" },

25159 { 0x8CD67F, "EM Microelectronic" },

25160 { 0x8CD9D6, "Xiaomi Communications Co Ltd" },

25161 { 0x8CDB25, "ESG Solutions" },

25162 { 0x8CDC02, "zte corporation" },

25163 { 0x8CDCD4, "Hewlett Packard" },

25164 { 0x8CDD8D, "Wifly-City System Inc." },

25165 { 0x8CDE52, "ISSC Technologies Corp." },

25166 { 0x8CDE99, "Comlab Inc." },

25167 { 0x8CDEE6, "Samsung Electronics Co.,Ltd" },

25168 { 0x8CDEF9, "Beijing Xiaomi Mobile Software Co., Ltd" },

25169 { 0x8CDF2C, "vivo Mobile Communication Co., Ltd." },

25170 { 0x8CDF9D, "NEC Corporation" },

25171 { 0x8CE042, "vivo Mobile Communication Co., Ltd." },

25172 { 0x8CE081, "zte corporation" },

25173 { 0x8CE117, "zte corporation" },

25174 { 0x8CE2DA, "Circle Media Inc" },

25175 { 0x8CE38E, "Kioxia Corporation" },

25176 { 0x8CE468, "Guangzhou Sageran Technology Co., Ltd." },

25177 { 0x8CE5C0, "Samsung Electronics Co.,Ltd" },

25178 { 0x8CE5EF, "HUAWEI TECHNOLOGIES CO.,LTD" },

25179 { 0x8CE748, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

25180 { 0x8CE78C, "DK Networks" },

25181 { 0x8CE7B3, "Sonardyne International Ltd" },

25182 { 0x8CE9B4, "Zhejiang Dahua Technology Co., Ltd." },

25183 { 0x8CE9EE, "Intel Corporate" },

25184 { 0x8CEA12, "Shenzhen MiaoMing Intelligent Technology Co.,Ltd" },

25185 { 0x8CEA1B, "Edgecore Networks Corporation" },

25186 { 0x8CEA48, "Samsung Electronics Co.,Ltd" },

25187 { 0x8CEBC6, "HUAWEI TECHNOLOGIES CO.,LTD" },

25188 { 0x8CEC4B, "Dell Inc." },

25189 { 0x8CEC7B, "Apple, Inc." },

25190 { 0x8CEEC6, "Precepscion Pty. Ltd." },

25191 { 0x8CEEFD, "zte corporation" },

25192 { 0x8CF112, "Motorola Mobility LLC, a Lenovo Company" },

25193 { 0x8CF228, "MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

25194 { 0x8CF319, "Siemens Industrial Automation Products Ltd., Chengdu" },

25195 { 0x8CF3E7, "solidotech" },

25196 { 0x8CF5A3, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

25197 { 0x8CF681, "Silicon Laboratories" },

25198 { 0x8CF710, "AMPAK Technology, Inc." },

25199 { 0x8CF773, "Nokia" },

25200 { 0x8CF813, "ORANGE POLSKA" },

25201 { 0x8CF8C5, "Intel Corporate" },

25202 { 0x8CF945, "Power Automation pte Ltd" },

25203 { 0x8CF957, "RuiXingHengFang Network (Shenzhen) Co.,Ltd" },

25204 { 0x8CF9C9, "MESADA Technology Co.,Ltd." },

25205 { 0x8CFABA, "Apple, Inc." },

25206 { 0x8CFADD, "HUAWEI TECHNOLOGIES CO.,LTD" },

25207 { 0x8CFCA0, "Shenzhen Smart Device Technology Co., LTD." },

25208 { 0x8CFD15, "Imagine Marketing Private Limited" },

25209 { 0x8CFD18, "HUAWEI TECHNOLOGIES CO.,LTD" },

25210 { 0x8CFDDE, "Sagemcom Broadband SAS" },

25211 { 0x8CFDF0, "Qualcomm Inc." },

25212 { 0x8CFE57, "Apple, Inc." },

25213 { 0x8CFE74, "Ruckus Wireless" },

25214 { 0x8CFEB4, "VSOONTECH ELECTRONICS CO., LIMITED" },

25215 { 0x90004E, "Hon Hai Precision Ind. Co.,Ltd." },

25216 { 0x9000DB, "Samsung Electronics Co.,Ltd" },

25217 { 0x900117, "HUAWEI TECHNOLOGIES CO.,LTD" },

25218 { 0x90013B, "Sagemcom Broadband SAS" },

25219 { 0x900218, "SKY UK LIMITED" },

25220 { 0x90027A, "Shenzhen Sworix Techonlogy Co., Ltd" },

25221 { 0x90028A, "Shenzhen Shidean Legrand Electronic Products Co.,Ltd" },

25222 { 0x9002A9, "Zhejiang Dahua Technology Co., Ltd." },

25223 { 0x900325, "HUAWEI TECHNOLOGIES CO.,LTD" },

25224 { 0x900372, "Longnan Junya Digital Technology Co. Ltd." },

25225 { 0x9003B7, "PARROT SA" },

25226 { 0x900628, "Samsung Electronics Co.,Ltd" },

25227 { 0x9006F2, "Texas Instruments" },

25228 { 0x900917, "Far-sighted mobile" },

25229 { 0x9009D0, "Synology Incorporated" },

25230 { 0x9009DF, "Intel Corporate" },

25231 { 0x900A1A, "Taicang T&W Electronics" },

25232 { 0x900A39, "Wiio, Inc." },

25233 { 0x900A3A, "PSG Plastic Service GmbH" },

25234 { 0x900A62, "Inventus Power Eletronica do Brasil LTDA" },

25235 { 0x900A84, "Mellanox Technologies, Inc." },

25236 { 0x900BC1, "Sprocomm Technologies CO.,Ltd" },

25237 { 0x900CB4, "Alinket Electronic Technology Co., Ltd" },

25238 { 0x900CC8, "Google, Inc." },

25239 { 0x900D66, "Digimore Electronics Co., Ltd" },

25240 { 0x900DCB, "ARRIS Group, Inc." },

25241 { 0x900E83, "Monico Monitoring, Inc." },

25242 { 0x900E9E, "Shenzhen SuperElectron Technology Co.,Ltd." },

25243 { 0x900EB3, "Shenzhen Amediatech Technology Co., Ltd." },

25244 { 0x900F0C, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

25245 { 0x901195, "Amazon Technologies Inc." },

25246 { 0x901234, "Shenzhen YOUHUA Technology Co., Ltd" },

25247 { 0x9012A1, "We Corporation Inc." },

25248 { 0x9013DA, "Athom B.V." },

25249 { 0x9016BA, "HUAWEI TECHNOLOGIES CO.,LTD" },

25250 { 0x901711, "Hagenuk Marinekommunikation GmbH" },

25251 { 0x90173F, "HUAWEI TECHNOLOGIES CO.,LTD" },

25252 { 0x90179B, "Nanomegas" },

25253 { 0x9017AC, "HUAWEI TECHNOLOGIES CO.,LTD" },

25254 { 0x9017C8, "HUAWEI TECHNOLOGIES CO.,LTD" },

25255 { 0x90185E, "Apex Tool Group GmbH & Co OHG" },

25256 { 0x90187C, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

25257 { 0x9018AE, "Shanghai Meridian Technologies, Co. Ltd." },

25258 { 0x901900, "SCS SA" },

25259 { 0x901A4F, "EM Microelectronic" },

25260 { 0x901ACA, "ARRIS Group, Inc." },

25261 { 0x901B0E, "Fujitsu Technology Solutions GmbH" },

25262 { 0x901D27, "zte corporation" },

25263 { 0x901EDD, "GREAT COMPUTER CORPORATION" },

25264 { 0x90203A, "BYD Precision Manufacture Co.,Ltd" },

25265 { 0x902083, "General Engine Management Systems Ltd." },

25266 { 0x9020C2, "Aruba, a Hewlett Packard Enterprise Company" },

25267 { 0x902106, "SKY UK LIMITED" },

25268 { 0x902155, "HTC Corporation" },

25269 { 0x902181, "Shanghai Huaqin Telecom Technology Co.,Ltd" },

25270 { 0x90235B, "Amazon Technologies Inc." },

25271 { 0x9023B4, "New H3C Technologies Co., Ltd" },

25272 { 0x9023EC, "Availink, Inc." },

25273 { 0x9025F2, "HUAWEI TECHNOLOGIES CO.,LTD" },

25274 { 0x90272B, "Algorab S.r.l." },

25275 { 0x902759, "Nanjing Jiahao Technology Co., Ltd." },

25276 { 0x902778, "Open Infrastructure" },

25277 { 0x9027E4, "Apple, Inc." },

25278 { 0x902AEE, "Xiaomi Communications Co Ltd" },

25279 { 0x902B34, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

25280 { 0x902BD2, "HUAWEI TECHNOLOGIES CO.,LTD" },

25281 { 0x902C09, "Apple, Inc." },

25282 { 0x902CC7, "C-MAX Asia Limited" },

25283 { 0x902CFB, "CanTops Co,.Ltd." },

25284 { 0x902D77, "Edgecore Americas Networking Corporation" },

25285 { 0x902E16, "LCFC(HeFei) Electronics Technology co., ltd" },

25286 { 0x902E1C, "Intel Corporate" },

25287 { 0x902E87, "LabJack" },

25288 { 0x90314B, "AltoBeam Inc." },

25289 { 0x9031CD, "Onyx Healthcare Inc." },

25290 { 0x90324B, "Hon Hai Precision Ind. Co.,Ltd." },

25291 { 0x90342B, "Gatekeeper Systems, Inc." },

25292 { 0x9034FC, "Hon Hai Precision Ind. Co.,Ltd." },

25293 { 0x90356E, "Vodafone Omnitel N.V." },

25294 { 0x9035EA, "Silicon Laboratories" },

25295 { 0x903809, "Ericsson AB" },

25296 { 0x90380C, "Espressif Inc." },

25297 { 0x9038DF, "Changzhou Tiannengbo System Co. Ltd." },

25298 { 0x90395E, "Silicon Laboratories" },

25299 { 0x90395F, "Amazon Technologies Inc." },

25300 { 0x903A72, "Ruckus Wireless" },

25301 { 0x903AA0, "Nokia" },

25302 { 0x903AE6, "PARROT SA" },

25303 { 0x903C1D, "HISENSE VISUAL TECHNOLOGY CO.,LTD" },

25304 { 0x903C92, "Apple, Inc." },

25305 { 0x903CAE, "Yunnan KSEC Digital Technology Co.,Ltd." },

25306 { 0x903CB3, "Edgecore Networks Corporation" },

25307 { 0x903D5A, "Shenzhen Wision Technology Holding Limited" },

25308 { 0x903D68, "G-Printec, Inc." },

25309 { 0x903D6B, "Zicon Technology Corp." },

25310 { 0x903DBD, "SECURE METERS LIMITED" },

25311 { 0x903E7F, "Fiberhome Telecommunication Technologies Co.,LTD" },

25312 { 0x903EAB, "ARRIS Group, Inc." },

25313 { 0x903FEA, "HUAWEI TECHNOLOGIES CO.,LTD" },

25314 { 0x9043E2, "Cornami, Inc" },

25315 { 0x904506, "Tokyo Boeki Medisys Inc." },

25316 { 0x904528, "Nintendo Co.,Ltd" },

25317 { 0x9046A2, "Tedipay UK Ltd" },

25318 { 0x9046B7, "Vadaro Pte Ltd" },

25319 { 0x904716, "RORZE CORPORATION" },

25320 { 0x90473C, "China Mobile Group Device Co.,Ltd." },

25321 { 0x904846, "Texas Instruments" },

25322 { 0x90486C, "Ring LLC" },

25323 { 0x90489A, "Hon Hai Precision Ind. Co.,Ltd." },

25324 { 0x904992, "YSTen Technology Co.,Ltd" },

25325 { 0x9049FA, "Intel Corporate" },

25326 { 0x904C81, "Hewlett Packard Enterprise" },

25327 { 0x904CE5, "Hon Hai Precision Ind. Co.,Ltd." },

25328 { 0x904D4A, "Sagemcom Broadband SAS" },

25329 { 0x904DC3, "Flonidan A/S" },

25330 { 0x904E2B, "HUAWEI TECHNOLOGIES CO.,LTD" },

25331 { 0x904E91, "IEEE Registration Authority" },

25332 { 0x90505A, "unGlue, Inc" },

25333 { 0x90507B, "Advanced PANMOBIL Systems GmbH & Co. KG" },

25334 { 0x9050CA, "Hitron Technologies. Inc" },

25335 { 0x90513F, "Elettronica Santerno SpA" },

25336 { 0x9052BF, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

25337 { 0x905446, "TES ELECTRONIC SOLUTIONS" },

25338 { 0x9055AE, "Ericsson, EAB/RWI/K" },

25339 { 0x9055DE, "Fiberhome Telecommunication Technologies Co.,LTD" },

25340 { 0x905607, "Sichuan AI-Link Technology Co., Ltd." },

25341 { 0x905682, "Lenbrook Industries Limited" },

25342 { 0x905692, "Autotalks Ltd." },

25343 { 0x9056FC, "TECNO MOBILE LIMITED" },

25344 { 0x905851, "Vantiva USA LLC" },

25345 { 0x90593C, "AZ-TECHNOLOGY SDN BHD" },

25346 { 0x9059AF, "Texas Instruments" },

25347 { 0x905A08, "Super Micro Computer, Inc." },

25348 { 0x905C34, "Sirius Electronic Systems Srl" },

25349 { 0x905C44, "Compal Broadband Networks, Inc." },

25350 { 0x905D7C, "New H3C Technologies Co., Ltd" },

25351 { 0x905E44, "HUAWEI TECHNOLOGIES CO.,LTD" },

25352 { 0x905F2E, "TCT mobile ltd" },

25353 { 0x905F8D, "modas GmbH" },

25354 { 0x9060F1, "Apple, Inc." },

25355 { 0x90610C, "Fida International (S) Pte Ltd" },

25356 { 0x9061AE, "Intel Corporate" },

25357 { 0x90623F, "Apple, Inc." },

25358 { 0x90633B, "Samsung Electronics Co.,Ltd" },

25359 { 0x9064AD, "HUAWEI TECHNOLOGIES CO.,LTD" },

25360 { 0x906560, "EM Microelectronic" },

25361 { 0x906584, "Intel Corporate" },

25362 { 0x906717, "Alphion India Private Limited" },

25363 { 0x90671C, "HUAWEI TECHNOLOGIES CO.,LTD" },

25364 { 0x9067B5, "Alcatel-Lucent" },

25365 { 0x9067F3, "Alcatel Lucent" },

25366 { 0x9068C3, "Motorola Mobility LLC, a Lenovo Company" },

25367 { 0x906976, "Withrobot Inc." },

25368 { 0x906A94, "hangzhou huacheng network technology co., ltd" },

25369 { 0x906AEB, "Microsoft Corporation" },

25370 { 0x906C4B, "Advance Security Electronics" },

25371 { 0x906CAC, "Fortinet, Inc." },

25372 { 0x906D05, "BXB ELECTRONICS CO., LTD" },

25373 { 0x906D62, "Cambium Networks Limited" },

25374 { 0x906DC8, "DLG Automação Industrial Ltda" },

25375 { 0x906EBB, "Hon Hai Precision Ind. Co.,Ltd." },

25376 { 0x906F18, "Private" },

25377 { 0x906FA9, "NANJING PUTIAN TELECOMMUNICATIONS TECHNOLOGY CO.,LTD." },

25378 { 0x907025, "Garea Microsys Co.,Ltd." },

25379 { 0x907065, "Texas Instruments" },

25380 { 0x9070D3, "Fiberhome Telecommunication Technologies Co.,LTD" },

25381 { 0x907240, "Apple, Inc." },

25382 { 0x907282, "Sagemcom Broadband SAS" },

25383 { 0x90735A, "Motorola Mobility LLC, a Lenovo Company" },

25384 { 0x90749D, "IRay Technology Co., Ltd." },

25385 { 0x9075BC, "Nokia Shanghai Bell Co., Ltd." },

25386 { 0x9075DE, "Zebra Technologies Inc." },

25387 { 0x90769F, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

25388 { 0x9077EE, "Cisco Systems, Inc" },

25389 { 0x907841, "Intel Corporate" },

25390 { 0x9078B2, "Xiaomi Communications Co Ltd" },

25391 { 0x907910, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

25392 { 0x907990, "Benchmark Electronics Romania SRL" },

25393 { 0x9079CF, "zte corporation" },

25394 { 0x907A0A, "Gebr. Bode GmbH & Co KG" },

25395 { 0x907A28, "Beijing Morncloud Information And Technology Co. Ltd." },

25396 { 0x907A58, "Zegna-Daidong Limited" },

25397 { 0x907AF1, "Wally" },

25398 { 0x907BC6, "Texas Instruments" },

25399 { 0x907E30, "LARS" },

25400 { 0x907E43, "zte corporation" },

25401 { 0x907EBA, "UTEK TECHNOLOGY (SHENZHEN) CO.,LTD" },

25402 { 0x907F61, "Chicony Electronics Co., Ltd." },

25403 { 0x908060, "Nilfisk A/S" },

25404 { 0x90808F, "Huawei Device Co., Ltd." },

25405 { 0x90812A, "Apple, Inc." },

25406 { 0x908158, "Apple, Inc." },

25407 { 0x908175, "Samsung Electronics Co.,Ltd" },

25408 { 0x908260, "IEEE 1904.1 Working Group" },

25409 { 0x90834B, "BEIJING YUNYI TIMES TECHNOLOGY CO,.LTD" },

25410 { 0x90837A, "General Electric Water & Process Technologies" },

25411 { 0x90837E, "Fiberhome Telecommunication Technologies Co.,LTD" },

25412 { 0x90840D, "Apple, Inc." },

25413 { 0x90842B, "LEGO System A/S" },

25414 { 0x90848B, "HDR10+ Technologies, LLC" },

25415 { 0x908674, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

25416 { 0x90869B, "zte corporation" },

25417 { 0x908855, "Cisco Systems, Inc" },

25418 { 0x9088A2, "IONICS TECHNOLOGY ME LTDA" },

25419 { 0x908938, "Hefei Linkin Technology Co., Ltd." },

25420 { 0x90895F, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

25421 { 0x908C09, "Total Phase" },

25422 { 0x908C43, "Apple, Inc." },

25423 { 0x908C44, "H.K ZONGMU TECHNOLOGY CO., LTD." },

25424 { 0x908C63, "GZ Weedong Networks Technology Co. , Ltd" },

25425 { 0x908D1D, "GH Technologies" },

25426 { 0x908D6C, "Apple, Inc." },

25427 { 0x908D6E, "Dell Inc." },

25428 { 0x908D78, "D-Link International" },

25429 { 0x908FCF, "UNO System Co., Ltd" },

25430 { 0x90903C, "TRISON TECHNOLOGY CORPORATION" },

25431 { 0x909060, "RSI VIDEO TECHNOLOGIES" },

25432 { 0x909164, "ChongQing Lavid Technology Co., Ltd." },

25433 { 0x9092B4, "Diehl BGT Defence GmbH & Co. KG" },

25434 { 0x90935A, "ARRIS Group, Inc." },

25435 { 0x90940A, "Analog Devices, Inc" },

25436 { 0x909497, "HUAWEI TECHNOLOGIES CO.,LTD" },

25437 { 0x9094E4, "D-Link International" },

25438 { 0x9096F3, "BUFFALO.INC" },

25439 { 0x9097D5, "Espressif Inc." },

25440 { 0x9097F3, "Samsung Electronics Co.,Ltd" },

25441 { 0x909838, "Huawei Device Co., Ltd." },

25442 { 0x909864, "Impex-Sat GmbH&amp;Co KG" },

25443 { 0x909877, "Vestel Elektronik San ve Tic. A.S." },

25444 { 0x909916, "ELVEES NeoTek OJSC" },

25445 { 0x909A4A, "TP-LINK TECHNOLOGIES CO.,LTD." },

25446 { 0x909A77, "Texas Instruments" },

25447 { 0x909B6F, "Apple, Inc." },

25448 { 0x909C4A, "Apple, Inc." },

25449 { 0x909D7D, "ARRIS Group, Inc." },

25450 { 0x909DE0, "Newland Design + Assoc. Inc." },

25451 { 0x909E24, "ekey biometric systems gmbh" },

25452 { 0x909F33, "EFM Networks" },

25453 { 0x909F43, "Accutron Instruments Inc." },

25454 { 0x90A0BE, "Cannice" },

25455 { 0x90A137, "Beijing Splendidtel Communication Technology Co,. Ltd" },

25456 { 0x90A1BA, "PNetworks Electronics Information" },

25457 { 0x90A210, "United Telecoms Ltd" },

25458 { 0x90A25B, "Apple, Inc." },

25459 { 0x90A2DA, "GHEO SA" },

25460 { 0x90A365, "HMD Global Oy" },

25461 { 0x90A46A, "SISNET CO., LTD" },

25462 { 0x90A4DE, "Wistron Neweb Corporation" },

25463 { 0x90A57D, "Huawei Device Co., Ltd." },

25464 { 0x90A5AF, "HUAWEI TECHNOLOGIES CO.,LTD" },

25465 { 0x90A62F, "NAVER" },

25466 { 0x90A6BF, "Quectel Wireless Solutions Co.,Ltd." },

25467 { 0x90A783, "JSW PACIFIC CORPORATION" },

25468 { 0x90A7BF, "EM Microelectronic" },

25469 { 0x90A7C1, "Pakedge Device and Software Inc." },

25470 { 0x90A822, "Amazon Technologies Inc." },

25471 { 0x90A935, "JWEntertainment" },

25472 { 0x90A9F7, "IEEE Registration Authority" },

25473 { 0x90AAC3, "Hitron Technologies. Inc" },

25474 { 0x90AB96, "Silicon Laboratories" },

25475 { 0x90AC3F, "BrightSign LLC" },

25476 { 0x90ADF7, "vivo Mobile Communication Co., Ltd." },

25477 { 0x90ADFC, "Telechips, Inc." },

25478 { 0x90AE1B, "TP-LINK TECHNOLOGIES CO.,LTD." },

25479 { 0x90AFD1, "netKTI Co., Ltd" },

25480 { 0x90B0ED, "Apple, Inc." },

25481 { 0x90B11C, "Dell Inc." },

25482 { 0x90B134, "ARRIS Group, Inc." },

25483 { 0x90B144, "Samsung Electronics Co.,Ltd" },

25484 { 0x90B1E0, "Beijing Nebula Link Technology Co., Ltd" },

25485 { 0x90B21F, "Apple, Inc." },

25486 { 0x90B4DD, "Private" },

25487 { 0x90B57F, "Shenzhen iComm Semiconductor CO.,LTD" },

25488 { 0x90B622, "Samsung Electronics Co.,Ltd" },

25489 { 0x90B67A, "Shenzhen Skyworth Digital Technology CO., Ltd" },

25490 { 0x90B685, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

25491 { 0x90B686, "Murata Manufacturing Co., Ltd." },

25492 { 0x90B832, "Extreme Networks Headquarters" },

25493 { 0x90B8D0, "Joyent, Inc." },

25494 { 0x90B8E0, "SHENZHEN YANRAY TECHNOLOGY CO.,LTD" },

25495 { 0x90B931, "Apple, Inc." },

25496 { 0x90B97D, "Johnson Outdoors Marine Electronics d/b/a Minnkota" },

25497 { 0x90BDE6, "Quectel Wireless Solutions Co.,Ltd." },

25498 { 0x90C115, "Sony Corporation" },

25499 { 0x90C119, "Nokia" },

25500 { 0x90C1C6, "Apple, Inc." },

25501 { 0x90C35F, "Nanjing Jiahao Technology Co., Ltd." },

25502 { 0x90C54A, "vivo Mobile Communication Co., Ltd." },

25503 { 0x90C682, "IEEE Registration Authority" },

25504 { 0x90C710, "zte corporation" },

25505 { 0x90C792, "ARRIS Group, Inc." },

25506 { 0x90C7D8, "zte corporation" },

25507 { 0x90C99B, "Tesorion Nederland B.V." },

25508 { 0x90CAFA, "Google, Inc." },

25509 { 0x90CC24, "Synaptics, Inc" },

25510 { 0x90CC7A, "Huawei Device Co., Ltd." },

25511 { 0x90CCDF, "Intel Corporate" },

25512 { 0x90CD1F, "Quectel Wireless Solutions Co.,Ltd." },

25513 { 0x90CDB6, "Hon Hai Precision Ind. Co.,Ltd." },

25514 { 0x90CEB8, "Texas Instruments" },

25515 { 0x90CF15, "Nokia Corporation" },

25516 { 0x90CF6F, "Dlogixs Co Ltd" },

25517 { 0x90CF7D, "Qingdao Hisense Communications Co.,Ltd." },

25518 { 0x90D092, "HUMAX Co., Ltd." },

25519 { 0x90D11B, "Palomar Medical Technologies" },

25520 { 0x90D432, "zte corporation" },

25521 { 0x90D473, "vivo Mobile Communication Co., Ltd." },

25522 { 0x90D689, "Huahao Fangzhou Technology Co.,Ltd" },

25523 { 0x90D74F, "Bookeen" },

25524 { 0x90D7BE, "Wavelab Global Inc." },

25525 { 0x90D7EB, "Texas Instruments" },

25526 { 0x90D852, "Comtec Co., Ltd." },

25527 { 0x90D8F3, "zte corporation" },

25528 { 0x90D92C, "HUG-WITSCHI AG" },

25529 { 0x90DA4E, "AVANU" },

25530 { 0x90DA6A, "FOCUS H&S Co., Ltd." },

25531 { 0x90DAF9, "Siemens Rail Automation SAU" },

25532 { 0x90DB46, "E-LEAD ELECTRONIC CO., LTD" },

25533 { 0x90DD5D, "Apple, Inc." },

25534 { 0x90DE80, "Shenzhen Century Xinyang Technology Co., Ltd" },

25535 { 0x90DF7D, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

25536 { 0x90DFB7, "s.m.s smart microwave sensors GmbH" },

25537 { 0x90DFFB, "HOMERIDER SYSTEMS" },

25538 { 0x90E0F0, "IEEE 1722a Working Group" },

25539 { 0x90E17B, "Apple, Inc." },

25540 { 0x90E202, "Texas Instruments" },

25541 { 0x90E2BA, "Intel Corporate" },

25542 { 0x90E2FC, "IEEE Registration Authority" },

25543 { 0x90E468, "Guangzhou Shiyuan Electronic Technology Company Limited" },

25544 { 0x90E6BA, "ASUSTek COMPUTER INC." },

25545 { 0x90E710, "New H3C Technologies Co., Ltd" },

25546 { 0x90E7C4, "HTC Corporation" },

25547 { 0x90E868, "AzureWave Technology Inc." },

25548 { 0x90E95E, "Cisco Systems, Inc" },

25549 { 0x90EA60, "SPI Lasers Ltd" },

25550 { 0x90EB48, "Shanghai XinMiaoLink Technology Co., Ltd" },

25551 { 0x90EB50, "Cisco Systems, Inc" },

25552 { 0x90EC50, "C.O.B.O. SPA" },

25553 { 0x90EC77, "silicom" },

25554 { 0x90ECE3, "Nokia" },

25555 { 0x90ECEA, "Apple, Inc." },

25556 { 0x90EEC7, "Samsung Electronics Co.,Ltd" },

25557 { 0x90EED9, "UNIVERSAL DE DESARROLLOS ELECTRÓNICOS, SA" },

25558 { 0x90EF68, "Zyxel Communications Corporation" },

25559 { 0x90F052, "MEIZU Technology Co., Ltd." },

25560 { 0x90F157, "Garmin International" },

25561 { 0x90F1AA, "Samsung Electronics Co.,Ltd" },

25562 { 0x90F1B0, "Hangzhou Anheng Info&Tech CO.,LTD" },

25563 { 0x90F260, "Shenzhen Honesty Electronics Co.,Ltd." },

25564 { 0x90F278, "Radius Gateway" },

25565 { 0x90F305, "HUMAX Co., Ltd." },

25566 { 0x90F3B7, "Kirisun Communications Co., Ltd." },

25567 { 0x90F3B8, "China Mobile Group Device Co.,Ltd." },

25568 { 0x90F421, "IEEE Registration Authority" },

25569 { 0x90F4C1, "Rand McNally" },

25570 { 0x90F644, "Huawei Device Co., Ltd." },

25571 { 0x90F652, "TP-LINK TECHNOLOGIES CO.,LTD." },

25572 { 0x90F72F, "Phillips Machine & Welding Co., Inc." },

25573 { 0x90F7B2, "New H3C Technologies Co., Ltd" },

25574 { 0x90F82E, "Amazon Technologies Inc." },

25575 { 0x90F891, "Kaon Group Co., Ltd." },

25576 { 0x90F970, "HUAWEI TECHNOLOGIES CO.,LTD" },

25577 { 0x90F9B7, "HUAWEI TECHNOLOGIES CO.,LTD" },

25578 { 0x90FB5B, "Avaya Inc" },

25579 { 0x90FBA6, "Hon Hai Precision Ind. Co.,Ltd." },

25580 { 0x90FD61, "Apple, Inc." },

25581 { 0x90FD73, "zte corporation" },

25582 { 0x90FD9F, "Silicon Laboratories" },

25583 { 0x90FF79, "Metro Ethernet Forum" },

25584 { 0x90FFD6, "Honor Device Co., Ltd." },

25585 { 0x940006, "jinyoung" },

25586 { 0x940070, "Nokia Corporation" },

25587 { 0x9400B0, "HUAWEI TECHNOLOGIES CO.,LTD" },

25588 { 0x940149, "AutoHotBox" },

25589 { 0x9401AC, "Wuhan Qianyang Iotian Technology Co., Ltd" },

25590 { 0x9401C2, "Samsung Electronics Co.,Ltd" },

25591 { 0x940230, "Logitech" },

25592 { 0x94026B, "Optictimes Co.,Ltd" },

25593 { 0x94049C, "HUAWEI TECHNOLOGIES CO.,LTD" },

25594 { 0x9404E3, "Vantiva USA LLC" },

25595 { 0x9405B6, "Liling FullRiver Electronics & Technology Ltd" },

25596 { 0x9405BB, "IEEE Registration Authority" },

25597 { 0x940853, "Liteon Technology Corporation" },

25598 { 0x9408C7, "Huawei Device Co., Ltd." },

25599 { 0x940937, "HUMAX Co., Ltd." },

25600 { 0x9409C9, "ALPSALPINE CO,.LTD" },

25601 { 0x9409D3, "shenzhen maxtopic technology co.,ltd" },

25602 { 0x940B19, "HUAWEI TECHNOLOGIES CO.,LTD" },

25603 { 0x940B2D, "NetView Technologies(Shenzhen) Co., Ltd" },

25604 { 0x940B83, "zte corporation" },

25605 { 0x940BD5, "Himax Technologies, Inc" },

25606 { 0x940C6D, "TP-LINK TECHNOLOGIES CO.,LTD." },

25607 { 0x940C98, "Apple, Inc." },

25608 { 0x940D2D, "Universal Electronics, Inc." },

25609 { 0x940E6B, "HUAWEI TECHNOLOGIES CO.,LTD" },

25610 { 0x940EE7, "HUAWEI TECHNOLOGIES CO.,LTD" },

25611 { 0x94103E, "Belkin International Inc." },

25612 { 0x9411DA, "ITF Fröschl GmbH" },

25613 { 0x941457, "Shenzhen Sundray Technologies Company Limited" },

25614 { 0x94147A, "vivo Mobile Communication Co., Ltd." },

25615 { 0x9415B2, "Huawei Device Co., Ltd." },

25616 { 0x941625, "Apple, Inc." },

25617 { 0x941673, "Point Core SARL" },

25618 { 0x941700, "Xiaomi Communications Co Ltd" },

25619 { 0x941865, "NETGEAR" },

25620 { 0x941882, "Hewlett Packard Enterprise" },

25621 { 0x94193A, "Elvaco AB" },

25622 { 0x941C56, "Actiontec Electronics, Inc" },

25623 { 0x941D1C, "TLab West Systems AB" },

25624 { 0x941F3A, "Ambiq" },

25625 { 0x941FA2, "Wuhan YuXin Semiconductor Co., Ltd." },

25626 { 0x942053, "Nokia Corporation" },

25627 { 0x942197, "Stalmart Technology Limited" },

25628 { 0x94236E, "Shenzhen Junlan Electronic Ltd" },

25629 { 0x9424B8, "GREE ELECTRIC APPLIANCES, INC. OF ZHUHAI" },

25630 { 0x9424E1, "Alcatel-Lucent Enterprise" },

25631 { 0x942533, "HUAWEI TECHNOLOGIES CO.,LTD" },

25632 { 0x942790, "TCT mobile ltd" },

25633 { 0x94282E, "New H3C Technologies Co., Ltd" },

25634 { 0x94286F, "zte corporation" },

25635 { 0x94290C, "Shenyang wisdom Foundation Technology Development Co., Ltd." },

25636 { 0x94292F, "New H3C Technologies Co., Ltd" },

25637 { 0x942957, "Airpo Networks Technology Co.,Ltd." },

25638 { 0x94298D, "Shanghai AdaptComm Technology Co., Ltd." },

25639 { 0x942A3F, "Diversey Inc" },

25640 { 0x942A6F, "Ubiquiti Inc" },

25641 { 0x942CB3, "HUMAX Co., Ltd." },

25642 { 0x942DDC, "Samsung Electronics Co.,Ltd" },

25643 { 0x942E17, "Schneider Electric Canada Inc" },

25644 { 0x942E63, "Finsécur" },

25645 { 0x94319B, "Alphatronics BV" },

25646 { 0x9431CB, "vivo Mobile Communication Co., Ltd." },

25647 { 0x943251, "ASKEY COMPUTER CORP" },

25648 { 0x9432C1, "Honor Device Co., Ltd." },

25649 { 0x9433D8, "Cisco Systems, Inc" },

25650 { 0x9433DD, "Taco Inc" },

25651 { 0x943469, "Silicon Laboratories" },

25652 { 0x94350A, "Samsung Electronics Co.,Ltd" },

25653 { 0x9436E0, "Sichuan Bihong Broadcast &amp; Television New Technologies Co.,Ltd" },

25654 { 0x9437F7, "Huawei Device Co., Ltd." },

25655 { 0x9439E5, "Hon Hai Precision Ind. Co.,Ltd." },

25656 { 0x943A91, "Amazon Technologies Inc." },

25657 { 0x943AF0, "Nokia Corporation" },

25658 { 0x943BB0, "New H3C Technologies Co., Ltd" },

25659 { 0x943BB1, "Kaon Group Co., Ltd." },

25660 { 0x943C96, "Sagemcom Broadband SAS" },

25661 { 0x943CC6, "Espressif Inc." },

25662 { 0x943DC9, "Asahi Net, Inc." },

25663 { 0x943EE4, "WiSA Technologies Inc" },

25664 { 0x943F0C, "Genexis B.V." },

25665 { 0x943FBB, "JSC RPC Istok named after Shokin" },

25666 { 0x943FC2, "Hewlett Packard Enterprise" },

25667 { 0x943FD6, "Apple, Inc." },

25668 { 0x9440A2, "Anywave Communication Technologies, Inc." },

25669 { 0x9440C9, "Hewlett Packard Enterprise" },

25670 { 0x9440F3, "HUAWEI TECHNOLOGIES CO.,LTD" },

25671 { 0x9441C1, "Mini-Cam Limited" },

25672 { 0x94434D, "Ciena Corporation" },

25673 { 0x944444, "LG Innotek" },

25674 { 0x944452, "Belkin International Inc." },

25675 { 0x944560, "Google, Inc." },

25676 { 0x944696, "BaudTec Corporation" },

25677 { 0x944788, "HUAWEI TECHNOLOGIES CO.,LTD" },

25678 { 0x9447B0, "BEIJING ESWIN COMPUTING TECHNOLOGY CO., LTD" },

25679 { 0x944996, "WiSilica Inc" },

25680 { 0x944A09, "BitWise Controls" },

25681 { 0x944A0C, "Sercomm Corporation." },

25682 { 0x944E5B, "Ubee Interactive Co., Limited" },

25683 { 0x944F4C, "Sound United LLC" },

25684 { 0x945047, "Rechnerbetriebsgruppe" },

25685 { 0x945089, "SimonsVoss Technologies GmbH" },

25686 { 0x945103, "Samsung Electronics Co.,Ltd" },

25687 { 0x94513D, "iSmart Alarm, Inc." },

25688 { 0x9451BF, "Hyundai ESG" },

25689 { 0x945244, "Samsung Electronics Co.,Ltd" },

25690 { 0x945330, "Hon Hai Precision Ind. Co.,Ltd." },

25691 { 0x945493, "Rigado, LLC" },

25692 { 0x9454CE, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

25693 { 0x9454DF, "YST CORP." },

25694 { 0x945641, "Palo Alto Networks" },

25695 { 0x9457A5, "Hewlett Packard" },

25696 { 0x9458CB, "Nintendo Co.,Ltd" },

25697 { 0x945907, "Shanghai HITE-BELDEN Network Technology Co., Ltd." },

25698 { 0x94592D, "EKE Building Technology Systems Ltd" },

25699 { 0x945AFC, "Amazon Technologies Inc." },

25700 { 0x945B7E, "TRILOBIT LTDA." },

25701 { 0x945C9A, "Apple, Inc." },

25702 { 0x945F34, "Renesas Electronics (Penang) Sdn. Bhd." },

25703 { 0x946010, "Huawei Device Co., Ltd." },

25704 { 0x9460D5, "Aruba, a Hewlett Packard Enterprise Company" },

25705 { 0x94611E, "Wata Electronics Co.,Ltd." },

25706 { 0x946124, "Pason Systems" },

25707 { 0x946269, "ARRIS Group, Inc." },

25708 { 0x946372, "vivo Mobile Communication Co., Ltd." },

25709 { 0x9463D1, "Samsung Electronics Co.,Ltd" },

25710 { 0x946424, "Aruba, a Hewlett Packard Enterprise Company" },

25711 { 0x94652D, "OnePlus Technology (Shenzhen) Co., Ltd" },

25712 { 0x94659C, "Intel Corporate" },

25713 { 0x9466E7, "WOM Engineering" },

25714 { 0x94677E, "Belden India Private Limited" },

25715 { 0x946A77, "Vantiva USA LLC" },

25716 { 0x946AB0, "Arcadyan Corporation" },

25717 { 0x946DAE, "Mellanox Technologies, Inc." },

25718 { 0x94706C, "Quectel Wireless Solutions Co.,Ltd." },

25719 { 0x9470D2, "WINFIRM TECHNOLOGY" },

25720 { 0x9471AC, "TCT mobile ltd" },

25721 { 0x94720F, "Guangdong Nanguang Photo&Video Systems Co., Ltd." },

25722 { 0x94756E, "QinetiQ North America" },

25723 { 0x9476B7, "Samsung Electronics Co.,Ltd" },

25724 { 0x94772B, "HUAWEI TECHNOLOGIES CO.,LTD" },

25725 { 0x947806, "NINGBO SUNVOT TECHNOLOGY CO.,LTD" },

25726 { 0x947918, "ITEL MOBILE LIMITED" },

25727 { 0x947BAE, "Xiaomi Communications Co Ltd" },

25728 { 0x947BBE, "Ubicquia LLC" },

25729 { 0x947BE7, "Samsung Electronics Co.,Ltd" },

25730 { 0x947C3E, "Polewall Norge AS" },

25731 { 0x947D77, "HUAWEI TECHNOLOGIES CO.,LTD" },

25732 { 0x947EB9, "National Narrowband Network Communications Pty Ltd" },

25733 { 0x947F1D, "Shenzhen Fastrain Technology Co., Ltd." },

25734 { 0x947FD8, "Shenzhen Skyworth Digital Technology CO., Ltd" },

25735 { 0x9481A4, "Azuray Technologies" },

25736 { 0x9483C4, "GL Technologies (Hong Kong) Limited" },

25737 { 0x94857A, "Evantage Industries Corp" },

25738 { 0x9486CD, "SEOUL ELECTRONICS&TELECOM" },

25739 { 0x9486D4, "Surveillance Pro Corporation" },

25740 { 0x94877C, "ARRIS Group, Inc." },

25741 { 0x9487E0, "Xiaomi Communications Co Ltd" },

25742 { 0x948815, "Infinique Worldwide Inc" },

25743 { 0x948854, "Texas Instruments" },

25744 { 0x94885E, "Surfilter Network Technology Co., Ltd." },

25745 { 0x948AC6, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

25746 { 0x948B03, "EAGET Innovation and Technology Co., Ltd." },

25747 { 0x948BC1, "Samsung Electronics Co.,Ltd" },

25748 { 0x948D50, "Beamex Oy Ab" },

25749 { 0x948DEF, "Oetiker Schweiz AG" },

25750 { 0x948E89, "INDUSTRIAS UNIDAS SA DE CV" },

25751 { 0x948ED3, "Arista Networks" },

25752 { 0x948FCF, "ARRIS Group, Inc." },

25753 { 0x948FEE, "Verizon Telematics" },

25754 { 0x949010, "HUAWEI TECHNOLOGIES CO.,LTD" },

25755 { 0x949034, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

25756 { 0x94917F, "ASKEY COMPUTER CORP" },

25757 { 0x9492BC, "SYNTECH(HK) TECHNOLOGY LIMITED" },

25758 { 0x9492D2, "KCF Technologies, Inc." },

25759 { 0x949426, "Apple, Inc." },

25760 { 0x94944A, "Particle Industries Inc." },

25761 { 0x9495A0, "Google, Inc." },

25762 { 0x9497AE, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

25763 { 0x949869, "zte corporation" },

25764 { 0x94988F, "Sagemcom Broadband SAS" },

25765 { 0x9498A2, "Shanghai LISTEN TECH.LTD" },

25766 { 0x949901, "Shenzhen YITOA Digital Appliance CO.,LTD" },

25767 { 0x949990, "VTC Telecommunications" },

25768 { 0x949AA9, "Microsoft Corporation" },

25769 { 0x949B2C, "Extreme Networks Headquarters" },

25770 { 0x949BFD, "Trans New Technology, Inc." },

25771 { 0x949C55, "Alta Data Technologies" },

25772 { 0x949D57, "Panasonic do Brasil Limitada" },

25773 { 0x949F3E, "Sonos, Inc." },

25774 { 0x949F3F, "Optek Digital Technology company limited" },

25775 { 0x949FB4, "ChengDu JiaFaAnTai Technology Co.,Ltd" },

25776 { 0x94A04E, "Bostex Technology Co., LTD" },

25777 { 0x94A07D, "Huawei Device Co., Ltd." },

25778 { 0x94A1A2, "AMPAK Technology, Inc." },

25779 { 0x94A3CA, "KonnectONE, LLC" },

25780 { 0x94A408, "Shenzhen Trolink Technology CO, LTD" },

25781 { 0x94A40C, "Diehl Metering GmbH" },

25782 { 0x94A4B5, "Mitsubishi Electric Corporation" },

25783 { 0x94A4F9, "HUAWEI TECHNOLOGIES CO.,LTD" },

25784 { 0x94A67E, "NETGEAR" },

25785 { 0x94A7B7, "zte corporation" },

25786 { 0x94A7BC, "BodyMedia, Inc." },

25787 { 0x94A9A8, "Texas Instruments" },

25788 { 0x94AA0A, "Fiberhome Telecommunication Technologies Co.,LTD" },

25789 { 0x94AAB8, "Joview(Beijing) Technology Co. Ltd." },

25790 { 0x94AB18, "cellXica ltd" },

25791 { 0x94ABDE, "OMX Technology - FZE" },

25792 { 0x94ABFE, "Nokia" },

25793 { 0x94ACCA, "trivum technologies GmbH" },

25794 { 0x94AD23, "Apple, Inc." },

25795 { 0x94AE61, "Alcatel Lucent" },

25796 { 0x94AEE3, "Belden Hirschmann Industries (Suzhou) Ltd." },

25797 { 0x94AEF0, "Cisco Systems, Inc" },

25798 { 0x94B01F, "Apple, Inc." },

25799 { 0x94B10A, "Samsung Electronics Co.,Ltd" },

25800 { 0x94B216, "Silicon Laboratories" },

25801 { 0x94B271, "HUAWEI TECHNOLOGIES CO.,LTD" },

25802 { 0x94B2CC, "PIONEER CORPORATION" },

25803 { 0x94B34F, "Ruckus Wireless" },

25804 { 0x94B40F, "Aruba, a Hewlett Packard Enterprise Company" },

25805 { 0x94B555, "Espressif Inc." },

25806 { 0x94B819, "Nokia" },

25807 { 0x94B86D, "Intel Corporate" },

25808 { 0x94B8C5, "RuggedCom Inc." },

25809 { 0x94B97E, "Espressif Inc." },

25810 { 0x94B9B4, "Aptos Technology" },

25811 { 0x94BA31, "Visiontec da Amazônia Ltda." },

25812 { 0x94BA56, "Shenzhen Coship Electronics Co., Ltd." },

25813 { 0x94BBAE, "Husqvarna AB" },

25814 { 0x94BE09, "China Mobile Group Device Co.,Ltd." },

25815 { 0x94BE46, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

25816 { 0x94BF1E, "eflow Inc. / Smart Device Planning and Development Division" },

25817 { 0x94BF2D, "Apple, Inc." },

25818 { 0x94BF80, "zte corporation" },

25819 { 0x94BF94, "Juniper Networks" },

25820 { 0x94BF95, "Shenzhen Coship Electronics Co., Ltd" },

25821 { 0x94BFC4, "Ruckus Wireless" },

25822 { 0x94C014, "Sorter Sp. j. Konrad Grzeszczyk MichaA, Ziomek" },

25823 { 0x94C038, "Tallac Networks" },

25824 { 0x94C150, "2Wire Inc" },

25825 { 0x94C2BD, "TECNOBIT" },

25826 { 0x94C3E4, "Atlas Copco IAS GmbH" },

25827 { 0x94C4E9, "PowerLayer Microsystems HongKong Limited" },

25828 { 0x94C5A6, "ITEL MOBILE LIMITED" },

25829 { 0x94C691, "EliteGroup Computer Systems Co., LTD" },

25830 { 0x94C6EB, "NOVA electronics, Inc." },

25831 { 0x94C7AF, "Raylios Technology" },

25832 { 0x94C960, "Zhongshan B&T technology.co.,ltd" },

25833 { 0x94C962, "Teseq AG" },

25834 { 0x94C9B7, "IEEE Registration Authority" },

25835 { 0x94CA0F, "Honeywell Analytics" },

25836 { 0x94CBCD, "zte corporation" },

25837 { 0x94CC04, "IEEE Registration Authority" },

25838 { 0x94CCB9, "ARRIS Group, Inc." },

25839 { 0x94CDAC, "Creowave Oy" },

25840 { 0x94CE0F, "Huawei Device Co., Ltd." },

25841 { 0x94CE2C, "Sony Corporation" },

25842 { 0x94CE31, "CTS Limited" },

25843 { 0x94D00D, "HUAWEI TECHNOLOGIES CO.,LTD" },

25844 { 0x94D019, "Cydle Corp." },

25845 { 0x94D029, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

25846 { 0x94D075, "CIS Crypto" },

25847 { 0x94D299, "Techmation Co.,Ltd." },

25848 { 0x94D2BC, "HUAWEI TECHNOLOGIES CO.,LTD" },

25849 { 0x94D331, "Xiaomi Communications Co Ltd" },

25850 { 0x94D417, "GPI KOREA INC." },

25851 { 0x94D469, "Cisco Systems, Inc" },

25852 { 0x94D505, "Fiberhome Telecommunication Technologies Co.,LTD" },

25853 { 0x94D54D, "HUAWEI TECHNOLOGIES CO.,LTD" },

25854 { 0x94D60E, "shenzhen yunmao information technologies co., ltd" },

25855 { 0x94D6DB, "NexFi" },

25856 { 0x94D723, "Shanghai DareGlobal Technologies Co.,Ltd" },

25857 { 0x94D771, "Samsung Electronics Co.,Ltd" },

25858 { 0x94D859, "TCT mobile ltd" },

25859 { 0x94D86B, "nass magnet Hungária Kft." },

25860 { 0x94D93C, "ENELPS" },

25861 { 0x94D9B3, "TP-LINK TECHNOLOGIES CO.,LTD." },

25862 { 0x94DB49, "SITCORP" },

25863 { 0x94DB56, "Sony Home Entertainment&Sound Products Inc" },

25864 { 0x94DBC9, "AzureWave Technology Inc." },

25865 { 0x94DBDA, "HUAWEI TECHNOLOGIES CO.,LTD" },

25866 { 0x94DC4E, "AEV, spol. s r. o." },

25867 { 0x94DD3F, "A+V Link Technologies, Corp." },

25868 { 0x94DDF8, "Brother Industries, LTD." },

25869 { 0x94DE0E, "SmartOptics AS" },

25870 { 0x94DE80, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

25871 { 0x94DEB8, "Silicon Laboratories" },

25872 { 0x94DF34, "HUAWEI TECHNOLOGIES CO.,LTD" },

25873 { 0x94DF4E, "Wistron InfoComm(Kunshan)Co.,Ltd." },

25874 { 0x94DF58, "IJ Electron CO.,Ltd." },

25875 { 0x94E0D0, "HealthStream Taiwan Inc." },

25876 { 0x94E0D6, "China Dragon Technology Limited" },

25877 { 0x94E129, "Samsung Electronics Co.,Ltd" },

25878 { 0x94E1AC, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

25879 { 0x94E226, "D. ORtiz Consulting, LLC" },

25880 { 0x94E23C, "Intel Corporate" },

25881 { 0x94E2FD, "Boge Kompressoren OTTO Boge GmbH & Co. KG" },

25882 { 0x94E300, "HUAWEI TECHNOLOGIES CO.,LTD" },

25883 { 0x94E36D, "Texas Instruments" },

25884 { 0x94E3EE, "zte corporation" },

25885 { 0x94E4BA, "Huawei Device Co., Ltd." },

25886 { 0x94E686, "Espressif Inc." },

25887 { 0x94E6F7, "Intel Corporate" },

25888 { 0x94E70B, "Intel Corporate" },

25889 { 0x94E711, "Xirka Dama Persada PT" },

25890 { 0x94E7EA, "HUAWEI TECHNOLOGIES CO.,LTD" },

25891 { 0x94E848, "FYLDE MICRO LTD" },

25892 { 0x94E8C5, "ARRIS Group, Inc." },

25893 { 0x94E96A, "Apple, Inc." },

25894 { 0x94E979, "Liteon Technology Corporation" },

25895 { 0x94E98C, "Nokia" },

25896 { 0x94E9EE, "Huawei Device Co., Ltd." },

25897 { 0x94EA32, "Apple, Inc." },

25898 { 0x94EAEA, "TELLESCOM INDUSTRIA E COMERCIO EM TELECOMUNICACAO" },

25899 { 0x94EB2C, "Google, Inc." },

25900 { 0x94EBCD, "BlackBerry RTS" },

25901 { 0x94EE9F, "HMD Global Oy" },

25902 { 0x94EF49, "BDR Thermea Group B.V" },

25903 { 0x94F128, "Hewlett Packard Enterprise" },

25904 { 0x94F19E, "HUIZHOU MAORONG INTELLIGENT TECHNOLOGY CO.,LTD" },

25905 { 0x94F278, "Elma Electronic" },

25906 { 0x94F2BB, "Valeo Vision Systems" },

25907 { 0x94F392, "Fortinet, Inc." },

25908 { 0x94F524, "Chengdu BeiZhongWangXin Technology Co.Ltd" },

25909 { 0x94F551, "Cadi Scientific Pte Ltd" },

25910 { 0x94F665, "Ruckus Wireless" },

25911 { 0x94F692, "Geminico co.,Ltd." },

25912 { 0x94F6A3, "Apple, Inc." },

25913 { 0x94F6D6, "Apple, Inc." },

25914 { 0x94F720, "Tianjin Deviser Electronics Instrument Co., Ltd" },

25915 { 0x94F7AD, "Juniper Networks" },

25916 { 0x94F827, "Shanghai Imilab Technology Co.Ltd" },

25917 { 0x94F929, "Meta Platforms Technologies, LLC" },

25918 { 0x94FAE8, "Shenzhen Eycom Technology Co., Ltd" },

25919 { 0x94FB29, "Zebra Technologies Inc." },

25920 { 0x94FBA7, "IEEE Registration Authority" },

25921 { 0x94FBB2, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

25922 { 0x94FD1D, "WhereWhen Corp" },

25923 { 0x94FD2E, "Shanghai Uniscope Technologies Co.,Ltd" },

25924 { 0x94FE22, "HUAWEI TECHNOLOGIES CO.,LTD" },

25925 { 0x94FE9D, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

25926 { 0x94FEF4, "Sagemcom Broadband SAS" },

25927 { 0x94FF3C, "Fortinet, Inc." },

25928 { 0x94FF61, "China Mobile Group Device Co.,Ltd." },

25929 { 0x98006A, "zte corporation" },

25930 { 0x980074, "Raisecom Technology CO., LTD" },

25931 { 0x9800C1, "GuangZhou CREATOR Technology Co.,Ltd.(CHINA)" },

25932 { 0x9800C6, "Apple, Inc." },

25933 { 0x9801A7, "Apple, Inc." },

25934 { 0x980284, "Theobroma Systems GmbH" },

25935 { 0x9802D8, "IEEE Registration Authority" },

25936 { 0x98038A, "Texas Instruments" },

25937 { 0x98039B, "Mellanox Technologies, Inc." },

25938 { 0x9803A0, "ABB n.v. Power Quality Products" },

25939 { 0x9803CF, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

25940 { 0x9803D8, "Apple, Inc." },

25941 { 0x980637, "IEEE Registration Authority" },

25942 { 0x98063A, "Home Control Singapore Pte Ltd" },

25943 { 0x98063C, "Samsung Electronics Co.,Ltd" },

25944 { 0x98072D, "Texas Instruments" },

25945 { 0x9809CF, "OnePlus Technology (Shenzhen) Co., Ltd" },

25946 { 0x980C33, "Silicon Laboratories" },

25947 { 0x980C82, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

25948 { 0x980CA5, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

25949 { 0x980D2E, "HTC Corporation" },

25950 { 0x980D51, "Huawei Device Co., Ltd." },

25951 { 0x980D67, "Zyxel Communications Corporation" },

25952 { 0x980D6F, "Samsung Electronics Co.,Ltd" },

25953 { 0x980DAF, "Apple, Inc." },

25954 { 0x980E24, "Phytium Technology Co.,Ltd." },

25955 { 0x980EE4, "Private" },

25956 { 0x981082, "Nsolution Co., Ltd." },

25957 { 0x981094, "Shenzhen Vsun communication technology Co.,ltd" },

25958 { 0x9810E8, "Apple, Inc." },

25959 { 0x981223, "Tarmoc Network LTD" },

25960 { 0x981333, "zte corporation" },

25961 { 0x9814D2, "Avonic" },

25962 { 0x9816EC, "IC Intracom" },

25963 { 0x9817F1, "zte corporation" },

25964 { 0x981888, "Cisco Meraki" },

25965 { 0x98192C, "Edgecore Networks Corporation" },

25966 { 0x981A35, "HUAWEI TECHNOLOGIES CO.,LTD" },

25967 { 0x981BB5, "ASSA ABLOY Korea Co., Ltd iRevo" },

25968 { 0x981C42, "LAIIER" },

25969 { 0x981DFA, "Samsung Electronics Co.,Ltd" },

25970 { 0x981E0F, "Jeelan (Shanghai Jeelan Technology Information Inc" },

25971 { 0x981E19, "Sagemcom Broadband SAS" },

25972 { 0x981FB1, "Shenzhen Lemon Network Technology Co.,Ltd" },

25973 { 0x982044, "New H3C Technologies Co., Ltd" },

25974 { 0x98208E, "Definium Technologies" },

25975 { 0x98226E, "Amazon Technologies Inc." },

25976 { 0x9822EF, "Liteon Technology Corporation" },

25977 { 0x98234E, "Micromedia AG" },

25978 { 0x98254A, "TP-LINK CORPORATION PTE. LTD." },

25979 { 0x98262A, "Applied Research Associates, Inc" },

25980 { 0x9826AD, "Quectel Wireless Solutions Co.,Ltd." },

25981 { 0x982782, "IEEE Registration Authority" },

25982 { 0x98288B, "zhejiang Dusun Electron Co.,Ltd" },

25983 { 0x9828A6, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

25984 { 0x98291D, "Jaguar de Mexico, SA de CV" },

25985 { 0x98293F, "Fujian Start Computer Equipment Co.,Ltd" },

25986 { 0x9829A6, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

25987 { 0x982CBC, "Intel Corporate" },

25988 { 0x982CBE, "2Wire Inc" },

25989 { 0x982D56, "Resolution Audio" },

25990 { 0x982D68, "Samsung Electronics Co., Ltd" },

25991 { 0x982DBA, "Fibergate Inc." },

25992 { 0x982F3C, "Sichuan Changhong Electric Ltd." },

25993 { 0x982F86, "vivo Mobile Communication Co., Ltd." },

25994 { 0x982FF8, "Huawei Device Co., Ltd." },

25995 { 0x983000, "Beijing KEMACOM Technologies Co., Ltd." },

25996 { 0x983071, "DAIKYUNG VASCOM" },

25997 { 0x98348C, "Teleepoch Ltd" },

25998 { 0x98349D, "Krauss Maffei Technologies GmbH" },

25999 { 0x983571, "Sub10 Systems Ltd" },

26000 { 0x9835B8, "Assembled Products Corporation" },

26001 { 0x9835ED, "HUAWEI TECHNOLOGIES CO.,LTD" },

26002 { 0x983713, "PT.Navicom Indonesia" },

26003 { 0x98387D, "ITRONIC TECHNOLOGY CO . , LTD ." },

26004 { 0x98398E, "Samsung Electronics Co.,Ltd" },

26005 { 0x9839C0, "FLEXTRONICS" },

26006 { 0x983B16, "AMPAK Technology, Inc." },

26007 { 0x983B67, "DWnet Technologies(Suzhou) Corporation" },

26008 { 0x983B8F, "Intel Corporate" },

26009 { 0x983F60, "HUAWEI TECHNOLOGIES CO.,LTD" },

26010 { 0x983F66, "Wuhan Funshion Online Technologies Co.,Ltd" },

26011 { 0x983F9F, "China SSJ (Suzhou) Network Technology Inc." },

26012 { 0x9840BB, "Dell Inc." },

26013 { 0x98415C, "Nintendo Co.,Ltd" },

26014 { 0x984246, "SOL INDUSTRY PTE., LTD" },

26015 { 0x984265, "Sagemcom Broadband SAS" },

26016 { 0x9843DA, "INTERTECH" },

26017 { 0x9843FA, "Intel Corporate" },

26018 { 0x9844B6, "INFRANOR SAS" },

26019 { 0x9844CE, "HUAWEI TECHNOLOGIES CO.,LTD" },

26020 { 0x984562, "Shanghai Baud Data Communication Co.,Ltd." },

26021 { 0x98460A, "Apple, Inc." },

26022 { 0x98473C, "SHANGHAI SUNMON COMMUNICATION TECHNOGY CO.,LTD" },

26023 { 0x984744, "Shenzhen Boomtech Industrial Corporation" },

26024 { 0x984827, "TP-LINK TECHNOLOGIES CO.,LTD." },

26025 { 0x984874, "HUAWEI TECHNOLOGIES CO.,LTD" },

26026 { 0x984914, "Wistron Neweb Corporation" },

26027 { 0x984925, "Juniper Networks" },

26028 { 0x98499F, "Domo Tactical Communications" },

26029 { 0x9849E1, "Boeing Defence Australia" },

26030 { 0x984A47, "CHG Hospital Beds" },

26031 { 0x984B06, "HUAWEI TECHNOLOGIES CO.,LTD" },

26032 { 0x984B4A, "ARRIS Group, Inc." },

26033 { 0x984BE1, "Hewlett Packard" },

26034 { 0x984C04, "Zhangzhou Keneng Electrical Equipment Co Ltd" },

26035 { 0x984CD3, "Mantis Deposition" },

26036 { 0x984E97, "Starlight Marketing (H. K.) Ltd." },

26037 { 0x984FEE, "Intel Corporate" },

26038 { 0x98502E, "Apple, Inc." },

26039 { 0x9850A3, "SIGNALTEK JSC" },

26040 { 0x98523D, "Sunitec Enterprise Co.,Ltd" },

26041 { 0x98524A, "Vantiva USA LLC" },

26042 { 0x9852B1, "Samsung Electronics Co.,Ltd" },

26043 { 0x98541B, "Intel Corporate" },

26044 { 0x9857D3, "HON HAI-CCPBG PRECISION IND.CO.,LTD." },

26045 { 0x98588A, "SYSGRATION Ltd." },

26046 { 0x985945, "Texas Instruments" },

26047 { 0x985949, "LUXOTTICA GROUP S.P.A." },

26048 { 0x98597A, "Intel Corporate" },

26049 { 0x985AEB, "Apple, Inc." },

26050 { 0x985BB0, "KMDATA INC." },

26051 { 0x985C93, "SBG Systems SAS" },

26052 { 0x985D46, "PeopleNet Communication" },

26053 { 0x985D82, "Arista Networks" },

26054 { 0x985DAD, "Texas Instruments" },

26055 { 0x985E1B, "ConversDigital Co., Ltd." },

26056 { 0x985F4F, "Tongfang Computer Co.,Ltd." },

26057 { 0x985FD3, "Microsoft Corporation" },

26058 { 0x986022, "EMW Co., Ltd." },

26059 { 0x9860CA, "Apple, Inc." },

26060 { 0x986610, "zte corporation" },

26061 { 0x9866EA, "Industrial Control Communications, Inc." },

26062 { 0x98672E, "Skullcandy" },

26063 { 0x98698A, "Apple, Inc." },

26064 { 0x986B3D, "ARRIS Group, Inc." },

26065 { 0x986C5C, "Jiangxi Gosun Guard Security Co.,Ltd" },

26066 { 0x986CF5, "zte corporation" },

26067 { 0x986D35, "IEEE Registration Authority" },

26068 { 0x986DC8, "TOSHIBA MITSUBISHI-ELECTRIC INDUSTRIAL SYSTEMS CORPORATION" },

26069 { 0x986EE8, "IEEE Registration Authority" },

26070 { 0x986F60, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

26071 { 0x9870E8, "INNATECH SDN BHD" },

26072 { 0x9873C4, "Sage Electronic Engineering LLC" },

26073 { 0x98743D, "Shenzhen Jun Kai Hengye Technology Co. Ltd" },

26074 { 0x9874DA, "Infinix mobility limited" },

26075 { 0x98751A, "Huawei Device Co., Ltd." },

26076 { 0x9876B6, "Adafruit" },

26077 { 0x987770, "Pep Digital Technology (Guangzhou) Co., Ltd" },

26078 { 0x9877CB, "Vorteks ED" },

26079 { 0x9877E7, "Kaon Group Co., Ltd." },

26080 { 0x987A10, "Ericsson AB" },

26081 { 0x987A14, "Microsoft Corporation" },

26082 { 0x987A9B, "TCL MOKA International Limited" },

26083 { 0x987BF3, "Texas Instruments" },

26084 { 0x987DDD, "China Mobile Group Device Co.,Ltd." },

26085 { 0x987E46, "Emizon Networks Limited" },

26086 { 0x987ECA, "Inventus Power Eletronica do Brasil LTDA" },

26087 { 0x987EE3, "vivo Mobile Communication Co., Ltd." },

26088 { 0x9880BB, "IEEE Registration Authority" },

26089 { 0x9880EE, "Samsung Electronics Co.,Ltd" },

26090 { 0x98818A, "Huawei Device Co., Ltd." },

26091 { 0x988217, "Disruptive Ltd" },

26092 { 0x988389, "Samsung Electronics Co.,Ltd" },

26093 { 0x9884E3, "Texas Instruments" },

26094 { 0x98865D, "Nokia Shanghai Bell Co., Ltd." },

26095 { 0x98868B, "Juniper Networks" },

26096 { 0x9886B1, "Flyaudio corporation (China)" },

26097 { 0x988744, "Wuxi Hongda Science and Technology Co.,LTD" },

26098 { 0x98876C, "Huawei Device Co., Ltd." },

26099 { 0x988924, "Texas Instruments" },

26100 { 0x9889ED, "Anadem Information Inc." },

26101 { 0x988B0A, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

26102 { 0x988B5D, "Sagemcom Broadband SAS" },

26103 { 0x988B69, "Shenzhen hylitech Co.,LTD" },

26104 { 0x988BAD, "Corintech Ltd." },

26105 { 0x988CB3, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

26106 { 0x988D46, "Intel Corporate" },

26107 { 0x988E34, "ZHEJIANG BOXSAM ELECTRONIC CO.,LTD" },

26108 { 0x988E4A, "NOXUS(BEIJING) TECHNOLOGY CO.,LTD" },

26109 { 0x988E79, "Qudelix, Inc." },

26110 { 0x988ED4, "ITEL MOBILE LIMITED" },

26111 { 0x988EDD, "TE Connectivity Limerick" },

26112 { 0x988F00, "Aruba, a Hewlett Packard Enterprise Company" },

26113 { 0x988FE0, "IEEE Registration Authority" },

26114 { 0x989080, "Linkpower Network System Inc Ltd." },

26115 { 0x989096, "Dell Inc." },

26116 { 0x9893CC, "LG ELECTRONICS INC" },

26117 { 0x989449, "Skyworth Wireless Technology Ltd." },

26118 { 0x9897CC, "TP-LINK TECHNOLOGIES CO.,LTD." },

26119 { 0x9897D1, "MitraStar Technology Corp." },

26120 { 0x989AB9, "zte corporation" },

26121 { 0x989BCB, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

26122 { 0x989C57, "HUAWEI TECHNOLOGIES CO.,LTD" },

26123 { 0x989D5D, "Vantiva USA LLC" },

26124 { 0x989DE5, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

26125 { 0x989E63, "Apple, Inc." },

26126 { 0x989F1E, "HUAWEI TECHNOLOGIES CO.,LTD" },

26127 { 0x98A2C0, "Cisco Systems, Inc" },

26128 { 0x98A404, "Ericsson AB" },

26129 { 0x98A40E, "Snap, Inc." },

26130 { 0x98A5F9, "Apple, Inc." },

26131 { 0x98A7B0, "MCST ZAO" },

26132 { 0x98A829, "AltoBeam Inc." },

26133 { 0x98A92D, "New H3C Technologies Co., Ltd" },

26134 { 0x98A942, "Guangzhou Tozed Kangwei Intelligent Technology Co., LTD" },

26135 { 0x98AA3C, "Will i-tech Co., Ltd." },

26136 { 0x98AAD7, "BLUE WAVE NETWORKING CO LTD" },

26137 { 0x98AAFC, "IEEE Registration Authority" },

26138 { 0x98AB15, "Fujian Youyike Technology Co.,Ltd" },

26139 { 0x98ACEF, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

26140 { 0x98AD1D, "Huawei Device Co., Ltd." },

26141 { 0x98AE71, "VVDN Technologies Pvt Ltd" },

26142 { 0x98AF65, "Intel Corporate" },

26143 { 0x98B039, "Nokia" },

26144 { 0x98B08B, "Samsung Electronics Co.,Ltd" },

26145 { 0x98B177, "LANDIS + GYR" },

26146 { 0x98B379, "Apple, Inc." },

26147 { 0x98B3EF, "Huawei Device Co., Ltd." },

26148 { 0x98B6E9, "Nintendo Co.,Ltd" },

26149 { 0x98B785, "Shenzhen 10Gtek Transceivers Co., Limited" },

26150 { 0x98B8BA, "LG Electronics (Mobile Communications)" },

26151 { 0x98B8BC, "Samsung Electronics Co.,Ltd" },

26152 { 0x98B8E3, "Apple, Inc." },

26153 { 0x98BA39, "Doro AB" },

26154 { 0x98BB1E, "BYD Precision Manufacture Company Ltd." },

26155 { 0x98BB99, "Phicomm (Sichuan) Co.,Ltd." },

26156 { 0x98BC57, "SVA TECHNOLOGIES CO.LTD" },

26157 { 0x98BC99, "Edeltech Co.,Ltd." },

26158 { 0x98BD80, "Intel Corporate" },

26159 { 0x98BE94, "IBM" },

26160 { 0x98BEDC, "Honor Device Co., Ltd." },

26161 { 0x98BFF4, "MARKIN co., Ltd." },

26162 { 0x98C0EB, "Global Regency Ltd" },

26163 { 0x98C3D2, "Ningbo Sanxing Medical Electric Co.,Ltd" },

26164 { 0x98C5DB, "Ericsson AB" },

26165 { 0x98C7A4, "Shenzhen HS Fiber Communication Equipment CO., LTD" },

26166 { 0x98C81C, "BAYTEC LIMITED" },

26167 { 0x98C845, "PacketAccess" },

26168 { 0x98C854, "Chiun Mai Communication System, Inc" },

26169 { 0x98C8B8, "vivo Mobile Communication Co., Ltd." },

26170 { 0x98C97C, "Shenzhen iComm Semiconductor CO.,LTD" },

26171 { 0x98CA20, "Shanghai SIMCOM Ltd." },

26172 { 0x98CA33, "Apple, Inc." },

26173 { 0x98CB27, "Galore Networks Pvt. Ltd." },

26174 { 0x98CBA4, "Benchmark Electronics" },

26175 { 0x98CC4D, "Shenzhen mantunsci co., LTD" },

26176 { 0x98CCD9, "Shenzhen SuperElectron Technology Co.,Ltd." },

26177 { 0x98CCE4, "Shenzhen Mindray Animal Medical Technology Co.,LTD" },

26178 { 0x98CCF3, "Amazon Technologies Inc." },

26179 { 0x98CDAC, "Espressif Inc." },

26180 { 0x98CDB4, "Virident Systems, Inc." },

26181 { 0x98CF53, "BBK EDUCATIONAL ELECTRONICS CORP.,LTD." },

26182 { 0x98D293, "Google, Inc." },

26183 { 0x98D331, "Shenzhen Bolutek Technology Co.,Ltd." },

26184 { 0x98D3D2, "MEKRA Lang GmbH & Co. KG" },

26185 { 0x98D3D7, "HUAWEI TECHNOLOGIES CO.,LTD" },

26186 { 0x98D3E7, "Netafim L" },

26187 { 0x98D686, "Chyi Lee industry Co., ltd." },

26188 { 0x98D6BB, "Apple, Inc." },

26189 { 0x98D6F7, "LG Electronics (Mobile Communications)" },

26190 { 0x98D742, "Samsung Electronics Co.,Ltd" },

26191 { 0x98D7E1, "Cisco Systems, Inc" },

26192 { 0x98D863, "Shanghai High-Flying Electronics Technology Co., Ltd" },

26193 { 0x98D88C, "Nortel Networks" },

26194 { 0x98D93D, "Demant Enterprise A/S" },

26195 { 0x98DA92, "Vuzix Corporation" },

26196 { 0x98DAC4, "TP-LINK TECHNOLOGIES CO.,LTD." },

26197 { 0x98DCD9, "UNITEC Co., Ltd." },

26198 { 0x98DD5B, "TAKUMI JAPAN LTD" },

26199 { 0x98DD60, "Apple, Inc." },

26200 { 0x98DDEA, "Infinix mobility limited" },

26201 { 0x98DED0, "TP-LINK TECHNOLOGIES CO.,LTD." },

26202 { 0x98DF82, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

26203 { 0x98E0D9, "Apple, Inc." },

26204 { 0x98E165, "Accutome" },

26205 { 0x98E476, "Zentan" },

26206 { 0x98E743, "Dell Inc." },

26207 { 0x98E79A, "Foxconn(NanJing) Communication Co.,Ltd." },

26208 { 0x98E7F4, "Hewlett Packard" },

26209 { 0x98E7F5, "HUAWEI TECHNOLOGIES CO.,LTD" },

26210 { 0x98E848, "Axiim" },

26211 { 0x98E8FA, "Nintendo Co.,Ltd" },

26212 { 0x98EC65, "Cosesy ApS" },

26213 { 0x98ED5C, "Tesla,Inc." },

26214 { 0x98ED7E, "eero inc." },

26215 { 0x98EDCA, "Fiberhome Telecommunication Technologies Co.,LTD" },

26216 { 0x98EE8C, "zte corporation" },

26217 { 0x98EECB, "Wistron Infocomm (Zhongshan) Corporation" },

26218 { 0x98EF9B, "OHSUNG" },

26219 { 0x98F058, "Lynxspring, Incl." },

26220 { 0x98F07B, "Texas Instruments" },

26221 { 0x98F083, "HUAWEI TECHNOLOGIES CO.,LTD" },

26222 { 0x98F0AB, "Apple, Inc." },

26223 { 0x98F112, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

26224 { 0x98F170, "Murata Manufacturing Co., Ltd." },

26225 { 0x98F181, "New H3C Technologies Co., Ltd" },

26226 { 0x98F199, "NEC Platforms, Ltd." },

26227 { 0x98F217, "Castlenet Technology Inc." },

26228 { 0x98F2B3, "Hewlett Packard Enterprise" },

26229 { 0x98F428, "zte corporation" },

26230 { 0x98F4AB, "Espressif Inc." },

26231 { 0x98F537, "zte corporation" },

26232 { 0x98F5A9, "OHSUNG" },

26233 { 0x98F621, "Xiaomi Communications Co Ltd" },

26234 { 0x98F781, "ARRIS Group, Inc." },

26235 { 0x98F7D7, "ARRIS Group, Inc." },

26236 { 0x98F8C1, "IDT Technology Limited" },

26237 { 0x98F8DB, "Marini Impianti Industriali s.r.l." },

26238 { 0x98F9C7, "IEEE Registration Authority" },

26239 { 0x98F9CC, "Zhejiang Dahua Technology Co., Ltd." },

26240 { 0x98FA9B, "LCFC(HeFei) Electronics Technology co., ltd" },

26241 { 0x98FAA7, "INNONET" },

26242 { 0x98FAE3, "Xiaomi Communications Co Ltd" },

26243 { 0x98FB12, "Grand Electronics (HK) Ltd" },

26244 { 0x98FB27, "Samsung Electronics Co.,Ltd" },

26245 { 0x98FBF5, "ATRALTECH" },

26246 { 0x98FC11, "Cisco-Linksys, LLC" },

26247 { 0x98FC84, "IEEE Registration Authority" },

26248 { 0x98FD74, "ACT.CO.LTD" },

26249 { 0x98FDB4, "Primax Electronics Ltd." },

26250 { 0x98FE03, "Ericsson - North America" },

26251 { 0x98FE94, "Apple, Inc." },

26252 { 0x98FEE1, "Apple, Inc." },

26253 { 0x98FF6A, "OTEC(Shanghai)Technology Co.,Ltd." },

26254 { 0x98FFD0, "Lenovo Mobile Communication Technology Ltd." },

26255 { 0x9C00D3, "SHENZHEN IK WORLD Technology Co., Ltd" },

26256 { 0x9C0111, "Shenzhen Newabel Electronic Co., Ltd." },

26257 { 0x9C0298, "Samsung Electronics Co.,Ltd" },

26258 { 0x9C039E, "Beijing Winchannel Software Technology Co., Ltd" },

26259 { 0x9C0473, "Tecmobile (International) Ltd." },

26260 { 0x9C04EB, "Apple, Inc." },

26261 { 0x9C0567, "Honor Device Co., Ltd." },

26262 { 0x9C0591, "Mellanox Technologies, Inc." },

26263 { 0x9C05D6, "Ubiquiti Inc" },

26264 { 0x9C061B, "Hangzhou H3C Technologies Co., Limited" },

26265 { 0x9C066E, "Hytera Communications Corporation Limited" },

26266 { 0x9C0971, "New H3C Technologies Co., Ltd" },

26267 { 0x9C0B05, "eero inc." },

26268 { 0x9C0C35, "Shenzhenshi Xinzhongxin Technology Co.Ltd" },

26269 { 0x9C0CDF, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

26270 { 0x9C0DAC, "Tymphany HK Limited" },

26271 { 0x9C0E4A, "Shenzhen Vastking Electronic Co.,Ltd." },

26272 { 0x9C13AB, "Chanson Water Co., Ltd." },

26273 { 0x9C1463, "Zhejiang Dahua Technology Co., Ltd." },

26274 { 0x9C1465, "Edata Elektronik San. ve Tic. A.Ş." },

26275 { 0x9C1874, "Nokia Danmark A/S" },

26276 { 0x9C19C2, "Dongguan Liesheng Electronic Co., Ltd." },

26277 { 0x9C1C12, "Aruba, a Hewlett Packard Enterprise Company" },

26278 { 0x9C1C37, "AltoBeam (China) Inc." },

26279 { 0x9C1C6D, "HEFEI DATANG STORAGE TECHNOLOGY CO.,LTD" },

26280 { 0x9C1D36, "HUAWEI TECHNOLOGIES CO.,LTD" },

26281 { 0x9C1D58, "Texas Instruments" },

26282 { 0x9C1E95, "Actiontec Electronics, Inc" },

26283 { 0x9C1EA4, "Renesas Electronics (Penang) Sdn. Bhd." },

26284 { 0x9C1ECE, "ALT Co., Ltd." },

26285 { 0x9C1ECF, "Valeo Telematik und Akustik GmbH" },

26286 { 0x9C1FCA, "Hangzhou AlmightyDigit Technology Co., Ltd" },

26287 { 0x9C1FDD, "Accupix Inc." },

26288 { 0x9C207B, "Apple, Inc." },

26289 { 0x9C216A, "TP-LINK TECHNOLOGIES CO.,LTD." },

26290 { 0x9C2183, "Broadcom Limited" },

26291 { 0x9C220E, "TASCAN Systems GmbH" },

26292 { 0x9C2472, "Sagemcom Broadband SAS" },

26293 { 0x9C2595, "Samsung Electronics Co.,Ltd" },

26294 { 0x9C25BE, "Wildlife Acoustics, Inc." },

26295 { 0x9C2840, "Discovery Technology,LTD.." },

26296 { 0x9C28B3, "Apple, Inc." },

26297 { 0x9C28BF, "Continental Automotive Czech Republic s.r.o." },

26298 { 0x9C28EF, "HUAWEI TECHNOLOGIES CO.,LTD" },

26299 { 0x9C28F7, "Xiaomi Communications Co Ltd" },

26300 { 0x9C293F, "Apple, Inc." },

26301 { 0x9C2976, "Intel Corporate" },

26302 { 0x9C2A70, "Hon Hai Precision Ind. Co.,Ltd." },

26303 { 0x9C2A83, "Samsung Electronics Co.,Ltd" },

26304 { 0x9C2BA6, "Ruijie Networks Co.,LTD" },

26305 { 0x9C2DCD, "LCFC(HeFei) Electronics Technology co., ltd" },

26306 { 0x9C2DCF, "Shishi Tongyun Technology(Chengdu)Co.,Ltd." },

26307 { 0x9C2E7A, "Samsung Electronics Co.,Ltd" },

26308 { 0x9C2EA1, "Xiaomi Communications Co Ltd" },

26309 { 0x9C2F4E, "zte corporation" },

26310 { 0x9C2F73, "Universal Tiancheng Technology (Beijing) Co., Ltd." },

26311 { 0x9C2F9D, "Liteon Technology Corporation" },

26312 { 0x9C305B, "Hon Hai Precision Ind. Co.,Ltd." },

26313 { 0x9C3066, "RWE Effizienz GmbH" },

26314 { 0x9C3178, "Foshan Huadian Intelligent Communications Teachnologies Co.,Ltd" },

26315 { 0x9C31B6, "Kulite Semiconductor Products Inc" },

26316 { 0x9C31C3, "SKY UK LIMITED" },

26317 { 0x9C32A9, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

26318 { 0x9C32CE, "CANON INC." },

26319 { 0x9C3426, "ARRIS Group, Inc." },

26320 { 0x9C3583, "Nipro Diagnostics, Inc" },

26321 { 0x9C35EB, "Apple, Inc." },

26322 { 0x9C36F8, "Hyundai Kefico" },

26323 { 0x9C3708, "Aruba, a Hewlett Packard Enterprise Company" },

26324 { 0x9C37CB, "Sony Interactive Entertainment Inc." },

26325 { 0x9C37F4, "HUAWEI TECHNOLOGIES CO.,LTD" },

26326 { 0x9C3818, "Cisco Systems, Inc" },

26327 { 0x9C3928, "Samsung Electronics Co.,Ltd" },

26328 { 0x9C3A9A, "Shenzhen Sundray Technologies Company Limited" },

26329 { 0x9C3AAF, "Samsung Electronics Co.,Ltd" },

26330 { 0x9C3DCF, "NETGEAR" },

26331 { 0x9C3E53, "Apple, Inc." },

26332 { 0x9C3EAA, "EnvyLogic Co.,Ltd." },

26333 { 0x9C40CD, "Synclayer Inc." },

26334 { 0x9C417C, "Hame Technology Co., Limited" },

26335 { 0x9C431E, "IEEE Registration Authority" },

26336 { 0x9C443D, "CHENGDU XUGUANG TECHNOLOGY CO, LTD" },

26337 { 0x9C44A6, "SwiftTest, Inc." },

26338 { 0x9C4563, "DIMEP Sistemas" },

26339 { 0x9C47F9, "LJU Automatisierungstechnik GmbH" },

26340 { 0x9C4952, "Dongguan Liesheng Electronic Co., Ltd." },

26341 { 0x9C497F, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

26342 { 0x9C4A7B, "Nokia Corporation" },

26343 { 0x9C4CAE, "Mesa Labs" },

26344 { 0x9C4E20, "Cisco Systems, Inc" },

26345 { 0x9C4E36, "Intel Corporate" },

26346 { 0x9C4E8E, "ALT Systems Ltd" },

26347 { 0x9C4EBF, "BoxCast" },

26348 { 0x9C4F5F, "Google, Inc." },

26349 { 0x9C4FCF, "TCT mobile ltd" },

26350 { 0x9C4FDA, "Apple, Inc." },

26351 { 0x9C50D1, "Murata Manufacturing Co., Ltd." },

26352 { 0x9C50EE, "Cambridge Industries(Group) Co.,Ltd." },

26353 { 0x9C52F8, "HUAWEI TECHNOLOGIES CO.,LTD" },

26354 { 0x9C5322, "TP-Link Corporation Limited" },

26355 { 0x9C53CD, "ENGICAM s.r.l." },

26356 { 0x9C5416, "Cisco Systems, Inc" },

26357 { 0x9C541C, "Shenzhen My-power Technology Co.,Ltd" },

26358 { 0x9C5440, "ChengDu TD Tech" },

26359 { 0x9C5467, "Nokia" },

26360 { 0x9C54C2, "New H3C Technologies Co., Ltd" },

26361 { 0x9C54CA, "Zhengzhou VCOM Science and Technology Co.,Ltd" },

26362 { 0x9C54DA, "SkyBell Technologies Inc." },

26363 { 0x9C558F, "Lockin Technology(Beijing) Co.,Ltd." },

26364 { 0x9C55B4, "I.S.E. S.r.l." },

26365 { 0x9C5636, "Huawei Device Co., Ltd." },

26366 { 0x9C5711, "Feitian Xunda(Beijing) Aeronautical Information Technology Co., Ltd." },

26367 { 0x9C57AD, "Cisco Systems, Inc" },

26368 { 0x9C57BC, "eero inc." },

26369 { 0x9C583C, "Apple, Inc." },

26370 { 0x9C5A44, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

26371 { 0x9C5A81, "Xiaomi Communications Co Ltd" },

26372 { 0x9C5B96, "NMR Corporation" },

26373 { 0x9C5C8D, "FIREMAX INDÚSTRIA E COMÉRCIO DE PRODUTOS ELETRÔNICOS LTDA" },

26374 { 0x9C5C8E, "ASUSTek COMPUTER INC." },

26375 { 0x9C5CF9, "Sony Corporation" },

26376 { 0x9C5D12, "Extreme Networks Headquarters" },

26377 { 0x9C5D95, "VTC Electronics Corp." },

26378 { 0x9C5E73, "Calibre UK LTD" },

26379 { 0x9C5F5A, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

26380 { 0x9C5FB0, "Samsung Electronics Co.,Ltd" },

26381 { 0x9C611D, "Panasonic Corporation of North America" },

26382 { 0x9C6121, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

26383 { 0x9C62AB, "Sumavision Technologies Co.,Ltd" },

26384 { 0x9C635B, "zte corporation" },

26385 { 0x9C63C0, "Mellanox Technologies, Inc." },

26386 { 0x9C63ED, "zte corporation" },

26387 { 0x9C645E, "Harman Consumer Group" },

26388 { 0x9C648B, "Apple, Inc." },

26389 { 0x9C65B0, "Samsung Electronics Co.,Ltd" },

26390 { 0x9C65EE, "DZS Inc." },

26391 { 0x9C65F9, "AcSiP Technology Corp." },

26392 { 0x9C65FA, "AcSiP" },

26393 { 0x9C6650, "Glodio Technolies Co.,Ltd Tianjin Branch" },

26394 { 0x9C685B, "Octonion SA" },

26395 { 0x9C6865, "Fiberhome Telecommunication Technologies Co.,LTD" },

26396 { 0x9C6937, "Qorvo International Pte. Ltd." },

26397 { 0x9C69B4, "IEEE Registration Authority" },

26398 { 0x9C69D1, "HUAWEI TECHNOLOGIES CO.,LTD" },

26399 { 0x9C6ABE, "QEES ApS." },

26400 { 0x9C6B00, "ASRock Incorporation" },

26401 { 0x9C6B37, "Renesas Electronics (Penang) Sdn. Bhd." },

26402 { 0x9C6B72, "Realme Chongqing MobileTelecommunications Corp Ltd" },

26403 { 0x9C6BF0, "Shenzhen Yipingfang Network Technology Co., Ltd." },

26404 { 0x9C6C15, "Microsoft Corporation" },

26405 { 0x9C6F52, "zte corporation" },

26406 { 0x9C713A, "HUAWEI TECHNOLOGIES CO.,LTD" },

26407 { 0x9C7370, "HUAWEI TECHNOLOGIES CO.,LTD" },

26408 { 0x9C73B1, "Samsung Electronics Co.,Ltd" },

26409 { 0x9C7403, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

26410 { 0x9C741A, "HUAWEI TECHNOLOGIES CO.,LTD" },

26411 { 0x9C746F, "HUAWEI TECHNOLOGIES CO.,LTD" },

26412 { 0x9C7514, "Wildix srl" },

26413 { 0x9C756E, "Ajax Systems DMCC" },

26414 { 0x9C760E, "Apple, Inc." },

26415 { 0x9C7613, "Ring LLC" },

26416 { 0x9C77AA, "NADASNV" },

26417 { 0x9C79AC, "Suntec Software(Shanghai) Co., Ltd." },

26418 { 0x9C7A03, "Ciena Corporation" },

26419 { 0x9C7BD2, "NEOLAB Convergence" },

26420 { 0x9C7BEF, "Hewlett Packard" },

26421 { 0x9C7DA3, "HUAWEI TECHNOLOGIES CO.,LTD" },

26422 { 0x9C7F57, "UNIC Memory Technology Co Ltd" },

26423 { 0x9C7F81, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

26424 { 0x9C807D, "SYSCABLE Korea Inc." },

26425 { 0x9C80DF, "Arcadyan Technology Corporation" },

26426 { 0x9C823F, "Huawei Device Co., Ltd." },

26427 { 0x9C8275, "Yichip Microelectronics (Hangzhou) Co.,Ltd" },

26428 { 0x9C8281, "vivo Mobile Communication Co., Ltd." },

26429 { 0x9C83BF, "PRO-VISION, Inc." },

26430 { 0x9C84B6, "Shenzhen iComm Semiconductor CO.,LTD" },

26431 { 0x9C84BF, "Apple, Inc." },

26432 { 0x9C8566, "Wingtech Mobile Communications Co.,Ltd." },

26433 { 0x9C86DA, "Phoenix Geophysics Ltd." },

26434 { 0x9C8824, "PetroCloud LLC" },

26435 { 0x9C8888, "Simac Techniek NV" },

26436 { 0x9C88AD, "Fiberhome Telecommunication Technologies Co.,LTD" },

26437 { 0x9C891E, "FireBrick Ltd" },

26438 { 0x9C8ACB, "Juniper Networks" },

26439 { 0x9C8BA0, "Apple, Inc." },

26440 { 0x9C8BF1, "The Warehouse Limited" },

26441 { 0x9C8C6E, "Samsung Electronics Co.,Ltd" },

26442 { 0x9C8CD8, "Hewlett Packard Enterprise" },

26443 { 0x9C8D1A, "INTEG process group inc" },

26444 { 0x9C8D7C, "ALPSALPINE CO,.LTD" },

26445 { 0x9C8DD3, "Leonton Technologies" },

26446 { 0x9C8E99, "Hewlett Packard" },

26447 { 0x9C8E9C, "Huawei Device Co., Ltd." },

26448 { 0x9C8ECD, "Amcrest Technologies" },

26449 { 0x9C8EDC, "Teracom Limited" },

26450 { 0x9C9019, "Beyless" },

26451 { 0x9C924F, "Apple, Inc." },

26452 { 0x9C934E, "Xerox Corporation" },

26453 { 0x9C93B0, "Megatronix (Beijing) Technology Co., Ltd." },

26454 { 0x9C93E4, "Private" },

26455 { 0x9C9561, "Hui Zhou Gaoshengda Technology Co.,LTD" },

26456 { 0x9C9567, "Huawei Device Co., Ltd." },

26457 { 0x9C956E, "Microchip Technology Inc." },

26458 { 0x9C95F8, "SmartDoor Systems, LLC" },

26459 { 0x9C9613, "Lenovo Future Communication Technology (Chongqing) Company Limited" },

26460 { 0x9C9726, "Technicolor Delivery Technologies Belgium NV" },

26461 { 0x9C9789, "1MORE" },

26462 { 0x9C9811, "Guangzhou Sunrise Electronics Development Co., Ltd" },

26463 { 0x9C99A0, "Xiaomi Communications Co Ltd" },

26464 { 0x9C99CD, "Voippartners" },

26465 { 0x9C9AC0, "LEGO System A/S" },

26466 { 0x9C9C1D, "Starkey Labs Inc." },

26467 { 0x9C9C1F, "Espressif Inc." },

26468 { 0x9C9C40, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

26469 { 0x9C9D5D, "Raden Inc" },

26470 { 0x9C9D7E, "Beijing Xiaomi Mobile Software Co., Ltd" },

26471 { 0x9C9E03, "awayfrom" },

26472 { 0x9C9E71, "Huawei Device Co., Ltd." },

26473 { 0x9C9ED5, "Xiaomi Communications Co Ltd" },

26474 { 0x9CA10A, "SCLE SFE" },

26475 { 0x9CA134, "Nike, Inc." },

26476 { 0x9CA2F4, "TP-Link Corporation Limited" },

26477 { 0x9CA389, "Nokia" },

26478 { 0x9CA3A9, "Guangzhou Juan Optical and Electronical Tech Joint Stock Co., Ltd" },

26479 { 0x9CA3BA, "SAKURA Internet Inc." },

26480 { 0x9CA513, "Samsung Electronics Co.,Ltd" },

26481 { 0x9CA525, "Shandong USR IOT Technology Limited" },

26482 { 0x9CA570, "eero inc." },

26483 { 0x9CA577, "Osorno Enterprises Inc." },

26484 { 0x9CA5C0, "vivo Mobile Communication Co., Ltd." },

26485 { 0x9CA615, "TP-LINK TECHNOLOGIES CO.,LTD." },

26486 { 0x9CA69D, "Whaley Technology Co.Ltd" },

26487 { 0x9CA9E4, "zte corporation" },

26488 { 0x9CAA1B, "Microsoft Corporation" },

26489 { 0x9CAC6D, "Universal Electronics, Inc." },

26490 { 0x9CAD97, "Hon Hai Precision Ind. Co.,Ltd." },

26491 { 0x9CADEF, "Obihai Technology, Inc." },

26492 { 0x9CAED3, "Seiko Epson Corporation" },

26493 { 0x9CAF6F, "ITEL MOBILE LIMITED" },

26494 { 0x9CAFCA, "Cisco Systems, Inc" },

26495 { 0x9CB008, "Ubiquitous Computing Technology Corporation" },

26496 { 0x9CB1DC, "Earda Technologies co Ltd" },

26497 { 0x9CB206, "HMS Industrial Networks" },

26498 { 0x9CB2B2, "HUAWEI TECHNOLOGIES CO.,LTD" },

26499 { 0x9CB2E8, "HUAWEI TECHNOLOGIES CO.,LTD" },

26500 { 0x9CB400, "zte corporation" },

26501 { 0x9CB654, "Hewlett Packard" },

26502 { 0x9CB6D0, "Rivet Networks" },

26503 { 0x9CB70D, "Liteon Technology Corporation" },

26504 { 0x9CB793, "Creatcomm Technology Inc." },

26505 { 0x9CB8B4, "AMPAK Technology,Inc." },

26506 { 0x9CBB98, "Shen Zhen RND Electronic Co.,LTD" },

26507 { 0x9CBCF0, "Xiaomi Communications Co Ltd" },

26508 { 0x9CBD6E, "DERA Co., Ltd" },

26509 { 0x9CBD9D, "SkyDisk, Inc." },

26510 { 0x9CBEE0, "Biosoundlab Co., Ltd." },

26511 { 0x9CBF0D, "Framework Computer LLC" },

26512 { 0x9CBFCD, "HUAWEI TECHNOLOGIES CO.,LTD" },

26513 { 0x9CC077, "PrintCounts, LLC" },

26514 { 0x9CC0D2, "Conductix-Wampfler GmbH" },

26515 { 0x9CC12D, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

26516 { 0x9CC172, "HUAWEI TECHNOLOGIES CO.,LTD" },

26517 { 0x9CC2C4, "Inspur Electronic Information Industry Co.,Ltd." },

26518 { 0x9CC7A6, "AVM GmbH" },

26519 { 0x9CC7D1, "SHARP Corporation" },

26520 { 0x9CC893, "Juniper Networks" },

26521 { 0x9CC8AE, "Becton, Dickinson and Company" },

26522 { 0x9CC8E9, "Amazon Technologies Inc." },

26523 { 0x9CC8FC, "ARRIS Group, Inc." },

26524 { 0x9CC950, "Baumer Holding" },

26525 { 0x9CC9EB, "NETGEAR" },

26526 { 0x9CCAD9, "Nokia Corporation" },

26527 { 0x9CCBF7, "CLOUD STAR TECHNOLOGY CO., LTD." },

26528 { 0x9CCC83, "Juniper Networks" },

26529 { 0x9CCD82, "CHENG UEI PRECISION INDUSTRY CO.,LTD" },

26530 { 0x9CD1D0, "Guangzhou Ronsuo Electronic Technology Co.,Ltd" },

26531 { 0x9CD21E, "Hon Hai Precision Ind. Co.,Ltd." },

26532 { 0x9CD24B, "zte corporation" },

26533 { 0x9CD332, "PLC Technology Ltd" },

26534 { 0x9CD35B, "Samsung Electronics Co.,Ltd" },

26535 { 0x9CD36D, "NETGEAR" },

26536 { 0x9CD48B, "Innolux Technology Europe BV" },

26537 { 0x9CD57D, "Cisco Systems, Inc" },

26538 { 0x9CD643, "D-Link International" },

26539 { 0x9CD8E3, "Wuhan Huazhong Numerical Control Co., Ltd" },

26540 { 0x9CD917, "Motorola Mobility LLC, a Lenovo Company" },

26541 { 0x9CD9CB, "Lesira Manufacturing Pty Ltd" },

26542 { 0x9CDA3E, "Intel Corporate" },

26543 { 0x9CDB07, "Yellowtec GmbH" },

26544 { 0x9CDBAF, "HUAWEI TECHNOLOGIES CO.,LTD" },

26545 { 0x9CDBCB, "Wuhan Funshion Online Technologies Co.,Ltd" },

26546 { 0x9CDC71, "Hewlett Packard Enterprise" },

26547 { 0x9CDD1F, "Intelligent Steward Co.,Ltd" },

26548 { 0x9CDE4D, "ML vision Co.,LTD" },

26549 { 0x9CDF03, "Harman/Becker Automotive Systems GmbH" },

26550 { 0x9CDFB1, "Shenzhen Crave Communication Co., LTD" },

26551 { 0x9CE041, "Nokia" },

26552 { 0x9CE063, "Samsung Electronics Co.,Ltd" },

26553 { 0x9CE10E, "NCTech Ltd" },

26554 { 0x9CE176, "Cisco Systems, Inc" },

26555 { 0x9CE1D6, "Junger Audio-Studiotechnik GmbH" },

26556 { 0x9CE230, "JULONG CO,.LTD." },

26557 { 0x9CE330, "Cisco Meraki" },

26558 { 0x9CE33F, "Apple, Inc." },

26559 { 0x9CE374, "HUAWEI TECHNOLOGIES CO.,LTD" },

26560 { 0x9CE635, "Nintendo Co., Ltd." },

26561 { 0x9CE65E, "Apple, Inc." },

26562 { 0x9CE6E7, "Samsung Electronics Co.,Ltd" },

26563 { 0x9CE7BD, "Winduskorea co., Ltd" },

26564 { 0x9CE82B, "vivo Mobile Communication Co., Ltd." },

26565 { 0x9CE895, "New H3C Technologies Co., Ltd" },

26566 { 0x9CE91C, "zte corporation" },

26567 { 0x9CE951, "Shenzhen Sang Fei Consumer Communications Ltd., Co." },

26568 { 0x9CEA97, "Honor Device Co., Ltd." },

26569 { 0x9CEBE8, "BizLink (Kunshan) Co.,Ltd" },

26570 { 0x9CEC61, "Huawei Device Co., Ltd." },

26571 { 0x9CEDFA, "EVUlution AG" },

26572 { 0x9CEFD5, "Panda Wireless, Inc." },

26573 { 0x9CF029, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

26574 { 0x9CF155, "Nokia" },

26575 { 0x9CF1D4, "Roku, Inc" },

26576 { 0x9CF387, "Apple, Inc." },

26577 { 0x9CF48E, "Apple, Inc." },

26578 { 0x9CF531, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

26579 { 0x9CF55F, "Harman/Becker Automotive Systems GmbH" },

26580 { 0x9CF61A, "Carrier Fire & Security" },

26581 { 0x9CF67D, "Ricardo Prague, s.r.o." },

26582 { 0x9CF6DD, "IEEE Registration Authority" },

26583 { 0x9CF86B, "AgiTech Distribution Limited - Linki" },

26584 { 0x9CF8B8, "Shenzhen Skyworth Digital Technology CO., Ltd" },

26585 { 0x9CF8DB, "shenzhen eyunmei technology co,.ltd" },

26586 { 0x9CF938, "AREVA NP GmbH" },

26587 { 0x9CFA3C, "Daeyoung Electronics" },

26588 { 0x9CFB77, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

26589 { 0x9CFBD5, "vivo Mobile Communication Co., Ltd." },

26590 { 0x9CFBF1, "MESOMATIC GmbH & Co.KG" },

26591 { 0x9CFC01, "Apple, Inc." },

26592 { 0x9CFC28, "Apple, Inc." },

26593 { 0x9CFCD1, "Aetheris Technology (Shanghai) Co., Ltd." },

26594 { 0x9CFCE8, "Intel Corporate" },

26595 { 0x9CFEA1, "Fiberhome Telecommunication Technologies Co.,LTD" },

26596 { 0x9CFFBE, "OTSL Inc." },

26597 { 0x9CFFC2, "AVI Systems GmbH" },

26598 { 0xA0004C, "HISENSE VISUAL TECHNOLOGY CO.,LTD" },

26599 { 0xA0024A, "IEEE Registration Authority" },

26600 { 0xA002A5, "Intel Corporate" },

26601 { 0xA002DC, "Amazon Technologies Inc." },

26602 { 0xA00363, "Robert Bosch Healthcare GmbH" },

26603 { 0xA0043E, "Parker Hannifin Manufacturing Germany GmbH & Co. KG" },

26604 { 0xA00460, "NETGEAR" },

26605 { 0xA00627, "NEXPA System" },

26606 { 0xA00798, "Samsung Electronics Co.,Ltd" },

26607 { 0xA007B6, "Advanced Technical Support, Inc." },

26608 { 0xA0086F, "HUAWEI TECHNOLOGIES CO.,LTD" },

26609 { 0xA0092E, "zte corporation" },

26610 { 0xA0094C, "CenturyLink" },

26611 { 0xA009ED, "Avaya Inc" },

26612 { 0xA00ABF, "Wieson Technologies Co., Ltd." },

26613 { 0xA00BBA, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

26614 { 0xA00CA1, "SKTB SKiT" },

26615 { 0xA00F37, "Cisco Systems, Inc" },

26616 { 0xA01077, "zte corporation" },

26617 { 0xA01081, "Samsung Electronics Co.,Ltd" },

26618 { 0xA01290, "Avaya Inc" },

26619 { 0xA012DB, "TABUCHI ELECTRIC CO.,LTD" },

26620 { 0xA0133B, "HiTi Digital, Inc." },

26621 { 0xA013CB, "Fiberhome Telecommunication Technologies Co.,LTD" },

26622 { 0xA0143D, "PARROT SA" },

26623 { 0xA0165C, "Triteka LTD" },

26624 { 0xA017F1, "Allwinner Technology Co., Ltd" },

26625 { 0xA01828, "Apple, Inc." },

26626 { 0xA01842, "Comtrend Corporation" },

26627 { 0xA01859, "Shenzhen Yidashi Electronics Co Ltd" },

26628 { 0xA01917, "Bertel S.p.a." },

26629 { 0xA019B2, "IEEE Registration Authority" },

26630 { 0xA01B29, "Sagemcom Broadband SAS" },

26631 { 0xA01C05, "NIMAX TELECOM CO.,LTD." },

26632 { 0xA01C87, "UNION MAN TECHNOLOGY CO.,LTD" },

26633 { 0xA01C8D, "HUAWEI TECHNOLOGIES CO.,LTD" },

26634 { 0xA01D48, "Hewlett Packard" },

26635 { 0xA01E0B, "MINIX Technology Limited" },

26636 { 0xA020A6, "Espressif Inc." },

26637 { 0xA0218B, "ACE Antenna Co., ltd" },

26638 { 0xA02195, "Samsung Electronics Co.,Ltd" },

26639 { 0xA021B7, "NETGEAR" },

26640 { 0xA0224E, "IEEE Registration Authority" },

26641 { 0xA02252, "Astra Wireless Technology FZ-LLC" },

26642 { 0xA022DE, "vivo Mobile Communication Co., Ltd." },

26643 { 0xA0231B, "TeleComp R&D Corp." },

26644 { 0xA0239F, "Cisco Systems, Inc" },

26645 { 0xA024F9, "Chengdu InnovaTest Technology Co., Ltd" },

26646 { 0xA025D7, "Aruba, a Hewlett Packard Enterprise Company" },

26647 { 0xA027B6, "Samsung Electronics Co.,Ltd" },

26648 { 0xA02833, "IEEE Registration Authority" },

26649 { 0xA028ED, "HMD Global Oy" },

26650 { 0xA02919, "Dell Inc." },

26651 { 0xA02942, "Intel Corporate" },

26652 { 0xA029BD, "Team Group Inc" },

26653 { 0xA02BB8, "Hewlett Packard" },

26654 { 0xA02C36, "FN-LINK TECHNOLOGY LIMITED" },

26655 { 0xA02D13, "AirTies Wireless Networks" },

26656 { 0xA02DDB, "Sagemcom Broadband SAS" },

26657 { 0xA02EF3, "United Integrated Services Co., Led." },

26658 { 0xA03131, "Procenne Digital Security" },

26659 { 0xA031DB, "HUAWEI TECHNOLOGIES CO.,LTD" },

26660 { 0xA031EB, "Semikron Elektronik GmbH & Co. KG" },

26661 { 0xA03299, "Lenovo (Beijing) Co., Ltd." },

26662 { 0xA0341B, "Adero Inc" },

26663 { 0xA03679, "HUAWEI TECHNOLOGIES CO.,LTD" },

26664 { 0xA0369F, "Intel Corporate" },

26665 { 0xA036BC, "ASUSTek COMPUTER INC." },

26666 { 0xA036F0, "Comprehensive Power" },

26667 { 0xA036FA, "Ettus Research LLC" },

26668 { 0xA03768, "Shenzhen E-Life Intelligence Technology Co.,Ltd." },

26669 { 0xA038F8, "OURA Health Oy" },

26670 { 0xA03975, "Leo Bodnar Electronics Ltd" },

26671 { 0xA039EE, "Sagemcom Broadband SAS" },

26672 { 0xA039F7, "LG Electronics (Mobile Communications)" },

26673 { 0xA03A75, "PSS Belgium N.V." },

26674 { 0xA03B01, "Kyung In Electronics" },

26675 { 0xA03B1B, "Inspire Tech" },

26676 { 0xA03BE3, "Apple, Inc." },

26677 { 0xA03C31, "Shenzhen Belon Technology CO.,LTD" },

26678 { 0xA03D6E, "Cisco Systems, Inc" },

26679 { 0xA03D6F, "Cisco Systems, Inc" },

26680 { 0xA03E6B, "IEEE Registration Authority" },

26681 { 0xA04025, "Actioncable, Inc." },

26682 { 0xA04041, "SAMWONFA Co.,Ltd." },

26683 { 0xA0406F, "HUAWEI TECHNOLOGIES CO.,LTD" },

26684 { 0xA040A0, "NETGEAR" },

26685 { 0xA0412D, "Lansen Systems AB" },

26686 { 0xA04147, "Huawei Device Co., Ltd." },

26687 { 0xA0415E, "Opsens Solution Inc." },

26688 { 0xA041A7, "NL Ministry of Defense" },

26689 { 0xA0423F, "Tyan Computer Corp" },

26690 { 0xA04246, "IT Telecom Co., Ltd." },

26691 { 0xA042D1, "Huawei Device Co., Ltd." },

26692 { 0xA043B0, "Hangzhou BroadLink Technology Co.,Ltd" },

26693 { 0xA043DB, "Sitael S.p.A." },

26694 { 0xA0445C, "HUAWEI TECHNOLOGIES CO.,LTD" },

26695 { 0xA04466, "Intellics" },

26696 { 0xA044F3, "RafaelMicro" },

26697 { 0xA0465A, "Motorola Mobility LLC, a Lenovo Company" },

26698 { 0xA047D7, "Best IT World (India) Pvt Ltd" },

26699 { 0xA0481C, "Hewlett Packard" },

26700 { 0xA04A5E, "Microsoft Corporation" },

26701 { 0xA04C0C, "Shenzhen Skyworth Digital Technology CO., Ltd" },

26702 { 0xA04C5B, "Shenzhen TINNO Mobile Technology Corp." },

26703 { 0xA04CC1, "Helixtech Corp." },

26704 { 0xA04E01, "CENTRAL ENGINEERING co.,ltd." },

26705 { 0xA04E04, "Nokia Corporation" },

26706 { 0xA04EA7, "Apple, Inc." },

26707 { 0xA04ECF, "Apple, Inc." },

26708 { 0xA04F85, "LG Electronics (Mobile Communications)" },

26709 { 0xA04FD4, "ADB Broadband Italia" },

26710 { 0xA0510B, "Intel Corporate" },

26711 { 0xA051C6, "Avaya Inc" },

26712 { 0xA05272, "Apple, Inc." },

26713 { 0xA052AB, "AVM ELECTRONICS PTE LTD" },

26714 { 0xA05394, "Shenzhen zediel co., Ltd." },

26715 { 0xA0551F, "Sagemcom Broadband SAS" },

26716 { 0xA0554F, "Cisco Systems, Inc" },

26717 { 0xA055DE, "ARRIS Group, Inc." },

26718 { 0xA056B2, "Harman/Becker Automotive Systems GmbH" },

26719 { 0xA056F3, "Apple, Inc." },

26720 { 0xA057E3, "HUAWEI TECHNOLOGIES CO.,LTD" },

26721 { 0xA0593A, "V.D.S. Video Display Systems srl" },

26722 { 0xA05950, "Intel Corporate" },

26723 { 0xA05AA4, "Grand Products Nevada, Inc." },

26724 { 0xA05B21, "ENVINET GmbH" },

26725 { 0xA05DC1, "TMCT Co., LTD." },

26726 { 0xA05DE7, "DIRECTV, Inc." },

26727 { 0xA05E6B, "MELPER Co., Ltd." },

26728 { 0xA06032, "Amcrest Technologies" },

26729 { 0xA06090, "Samsung Electronics Co.,Ltd" },

26730 { 0xA06260, "Private" },

26731 { 0xA062FB, "HISENSE VISUAL TECHNOLOGY CO.,LTD" },

26732 { 0xA06391, "NETGEAR" },

26733 { 0xA0648F, "ASKEY COMPUTER CORP" },

26734 { 0xA06518, "VNPT TECHNOLOGY" },

26735 { 0xA06610, "FUJITSU LIMITED" },

26736 { 0xA06636, "Intracom SA Telecom Solutions" },

26737 { 0xA06720, "China Dragon Technology Limited" },

26738 { 0xA067BE, "Sicon srl" },

26739 { 0xA0681C, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

26740 { 0xA0687E, "ARRIS Group, Inc." },

26741 { 0xA06974, "Honor Device Co., Ltd." },

26742 { 0xA06986, "Wellav Technologies Ltd" },

26743 { 0xA069D9, "New H3C Technologies Co., Ltd" },

26744 { 0xA06A00, "Verilink Corporation" },

26745 { 0xA06A44, "Vizio, Inc" },

26746 { 0xA06C65, "Texas Instruments" },

26747 { 0xA06CEC, "RIM" },

26748 { 0xA06D09, "Intelcan Technosystems Inc." },

26749 { 0xA06E50, "Nanotek Elektronik Sistemler Ltd. Sti." },

26750 { 0xA06FAA, "LG Innotek" },

26751 { 0xA07099, "Beijing Huacan Electronics Co., Ltd" },

26752 { 0xA070B7, "HUAWEI TECHNOLOGIES CO.,LTD" },

26753 { 0xA071A9, "Nokia Corporation" },

26754 { 0xA0722C, "HUMAX Co., Ltd." },

26755 { 0xA072E4, "NJ SYSTEM CO.,LTD" },

26756 { 0xA07332, "Cashmaster International Limited" },

26757 { 0xA073FC, "Rancore Technologies Private Limited" },

26758 { 0xA07591, "Samsung Electronics Co.,Ltd" },

26759 { 0xA075EA, "BoxLock, Inc." },

26760 { 0xA0764E, "Espressif Inc." },

26761 { 0xA07751, "ASMedia Technology Inc." },

26762 { 0xA07771, "Vialis BV" },

26763 { 0xA0779E, "Chipsea Technologies (Shenzhen) Corp." },

26764 { 0xA07817, "Apple, Inc." },

26765 { 0xA078BA, "Pantech Co., Ltd." },

26766 { 0xA07F8A, "Sagemcom Broadband SAS" },

26767 { 0xA08069, "Intel Corporate" },

26768 { 0xA0821F, "Samsung Electronics Co.,Ltd" },

26769 { 0xA08222, "Qingdao Haier Technology Co.,Ltd" },

26770 { 0xA082AC, "Linear DMS Solutions Sdn. Bhd." },

26771 { 0xA082C7, "P.T.I Co.,LTD" },

26772 { 0xA083B4, "HeNet B.V." },

26773 { 0xA084CB, "SonicSensory,Inc." },

26774 { 0xA085FC, "Microsoft Corporation" },

26775 { 0xA0861D, "Chengdu Fuhuaxin Technology co.,Ltd" },

26776 { 0xA086C6, "Xiaomi Communications Co Ltd" },

26777 { 0xA086EC, "SAEHAN HITEC Co., Ltd" },

26778 { 0xA08869, "Intel Corporate" },

26779 { 0xA0889D, "Huawei Device Co., Ltd." },

26780 { 0xA088B4, "Intel Corporate" },

26781 { 0xA088C2, "Mellanox Technologies, Inc." },

26782 { 0xA089E4, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

26783 { 0xA08A87, "HuiZhou KaiYue Electronic Co.,Ltd" },

26784 { 0xA08C15, "Gerhard D. Wempe KG" },

26785 { 0xA08C9B, "Xtreme Technologies Corp" },

26786 { 0xA08CF2, "YINUOLINK CO.,LTD" },

26787 { 0xA08CF8, "HUAWEI TECHNOLOGIES CO.,LTD" },

26788 { 0xA08CFD, "Hewlett Packard" },

26789 { 0xA08D16, "HUAWEI TECHNOLOGIES CO.,LTD" },

26790 { 0xA08E24, "eero inc." },

26791 { 0xA08E78, "Sagemcom Broadband SAS" },

26792 { 0xA090DE, "VEEDIMS,LLC" },

26793 { 0xA09169, "LG Electronics (Mobile Communications)" },

26794 { 0xA091A2, "OnePlus Electronics (Shenzhen) Co., Ltd." },

26795 { 0xA091C8, "zte corporation" },

26796 { 0xA09208, "Tuya Smart Inc." },

26797 { 0xA09347, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

26798 { 0xA09351, "Cisco Systems, Inc" },

26799 { 0xA0941A, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

26800 { 0xA0946A, "Shenzhen XGTEC Technology Co,.Ltd." },

26801 { 0xA0950C, "China Mobile IOT Company Limited" },

26802 { 0xA0957F, "SERNET (SUZHOU) TECHNOLOGIES CORPORATION" },

26803 { 0xA09805, "OpenVox Communication Co Ltd" },

26804 { 0xA098ED, "Shandong Intelligent Optical Communication Development Co., Ltd." },

26805 { 0xA0999B, "Apple, Inc." },

26806 { 0xA09A5A, "Time Domain" },

26807 { 0xA09B12, "China Mobile IOT Company Limited" },

26808 { 0xA09B17, "Taicang T&W Electronics" },

26809 { 0xA09BBD, "Total Aviation Solutions Pty Ltd" },

26810 { 0xA09D86, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

26811 { 0xA09D91, "SoundBridge" },

26812 { 0xA09DC1, "China Dragon Technology Limited" },

26813 { 0xA09E1A, "Polar Electro Oy" },

26814 { 0xA09F10, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

26815 { 0xA09F7A, "D-Link Middle East FZCO" },

26816 { 0xA0A001, "Aruba, a Hewlett Packard Enterprise Company" },

26817 { 0xA0A0DC, "Huawei Device Co., Ltd." },

26818 { 0xA0A130, "DLI Taiwan Branch office" },

26819 { 0xA0A23C, "GPMS" },

26820 { 0xA0A309, "Apple, Inc." },

26821 { 0xA0A33B, "HUAWEI TECHNOLOGIES CO.,LTD" },

26822 { 0xA0A3B3, "Espressif Inc." },

26823 { 0xA0A3B8, "WISCLOUD" },

26824 { 0xA0A3E2, "Actiontec Electronics, Inc" },

26825 { 0xA0A3F0, "D-Link International" },

26826 { 0xA0A4C5, "Intel Corporate" },

26827 { 0xA0A65C, "Supercomputing Systems AG" },

26828 { 0xA0A763, "Polytron Vertrieb GmbH" },

26829 { 0xA0A8CD, "Intel Corporate" },

26830 { 0xA0AAFD, "EraThink Technologies Corp." },

26831 { 0xA0AB1B, "D-Link International" },

26832 { 0xA0AB51, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

26833 { 0xA0AC69, "Samsung Electronics Co.,Ltd" },

26834 { 0xA0ADA1, "JMR Electronics, Inc" },

26835 { 0xA0AF12, "HUAWEI TECHNOLOGIES CO.,LTD" },

26836 { 0xA0AFBD, "Intel Corporate" },

26837 { 0xA0B045, "Halong Mining" },

26838 { 0xA0B086, "Hirschmann Automation and Control GmbH" },

26839 { 0xA0B100, "ShenZhen Cando Electronics Co.,Ltd" },

26840 { 0xA0B339, "Intel Corporate" },

26841 { 0xA0B3CC, "Hewlett Packard" },

26842 { 0xA0B40F, "Apple, Inc." },

26843 { 0xA0B437, "GD Mission Systems" },

26844 { 0xA0B439, "Cisco Systems, Inc" },

26845 { 0xA0B4A5, "Samsung Electronics Co.,Ltd" },

26846 { 0xA0B4BF, "InfiNet LLC" },

26847 { 0xA0B53C, "Technicolor Delivery Technologies Belgium NV" },

26848 { 0xA0B549, "Arcadyan Corporation" },

26849 { 0xA0B5DA, "HongKong THTF Co., Ltd" },

26850 { 0xA0B662, "Acutvista Innovation Co., Ltd." },

26851 { 0xA0B765, "Espressif Inc." },

26852 { 0xA0B8F8, "Amgen U.S.A. Inc." },

26853 { 0xA0B9ED, "Skytap" },

26854 { 0xA0BAB8, "Pixon Imaging" },

26855 { 0xA0BB3E, "IEEE Registration Authority" },

26856 { 0xA0BC6F, "Cisco Systems, Inc" },

26857 { 0xA0BD1D, "Zhejiang Dahua Technology Co., Ltd." },

26858 { 0xA0BDCD, "SKY UK LIMITED" },

26859 { 0xA0BF50, "S.C. ADD-PRODUCTION S.R.L." },

26860 { 0xA0BFA5, "CORESYS" },

26861 { 0xA0C20D, "Huawei Device Co., Ltd." },

26862 { 0xA0C2DE, "Costar Video Systems" },

26863 { 0xA0C3DE, "Triton Electronic Systems Ltd." },

26864 { 0xA0C4A5, "SYGN HOUSE INC." },

26865 { 0xA0C562, "ARRIS Group, Inc." },

26866 { 0xA0C589, "Intel Corporate" },

26867 { 0xA0C5F2, "IEEE Registration Authority" },

26868 { 0xA0C6EC, "ShenZhen ANYK Technology Co.,LTD" },

26869 { 0xA0C98B, "Nokia Solutions and Networks GmbH & Co. KG" },

26870 { 0xA0C9A0, "Murata Manufacturing Co., Ltd." },

26871 { 0xA0CAA5, "INTELLIGENCE TECHNOLOGY OF CEC CO., LTD" },

26872 { 0xA0CBFD, "Samsung Electronics Co.,Ltd" },

26873 { 0xA0CC2B, "Murata Manufacturing Co., Ltd." },

26874 { 0xA0CDF3, "Murata Manufacturing Co., Ltd." },

26875 { 0xA0CEC8, "CE LINK LIMITED" },

26876 { 0xA0CF5B, "Cisco Systems, Inc" },

26877 { 0xA0CFF5, "zte corporation" },

26878 { 0xA0D05B, "Samsung Electronics Co.,Ltd" },

26879 { 0xA0D0DC, "Amazon Technologies Inc." },

26880 { 0xA0D12A, "AXPRO Technology Inc." },

26881 { 0xA0D1B3, "Apple, Inc." },

26882 { 0xA0D2B1, "Amazon Technologies Inc." },

26883 { 0xA0D365, "Intel Corporate" },

26884 { 0xA0D37A, "Intel Corporate" },

26885 { 0xA0D385, "AUMA Riester GmbH & Co. KG" },

26886 { 0xA0D3C1, "Hewlett Packard" },

26887 { 0xA0D635, "WBS Technology" },

26888 { 0xA0D722, "Samsung Electronics Co.,Ltd" },

26889 { 0xA0D795, "Apple, Inc." },

26890 { 0xA0D7A0, "Huawei Device Co., Ltd." },

26891 { 0xA0D7F3, "Samsung Electronics Co.,Ltd" },

26892 { 0xA0D807, "Huawei Device Co., Ltd." },

26893 { 0xA0D83D, "Fiberhome Telecommunication Technologies Co.,LTD" },

26894 { 0xA0D86F, "ARGO AI, LLC" },

26895 { 0xA0DA92, "Nanjing Glarun Atten Technology Co. Ltd." },

26896 { 0xA0DC04, "Becker-Antriebe GmbH" },

26897 { 0xA0DD6C, "Espressif Inc." },

26898 { 0xA0DD97, "PolarLink Technologies, Ltd" },

26899 { 0xA0DDE5, "SHARP Corporation" },

26900 { 0xA0DE05, "JSC Irbis-T" },

26901 { 0xA0DE0F, "Huawei Device Co., Ltd." },

26902 { 0xA0DF15, "HUAWEI TECHNOLOGIES CO.,LTD" },

26903 { 0xA0E025, "Provision-ISR" },

26904 { 0xA0E0AF, "Cisco Systems, Inc" },

26905 { 0xA0E201, "AVTrace Ltd.(China)" },

26906 { 0xA0E25A, "Amicus SK, s.r.o." },

26907 { 0xA0E295, "DAT System Co.,Ltd" },

26908 { 0xA0E453, "Sony Corporation" },

26909 { 0xA0E4CB, "Zyxel Communications Corporation" },

26910 { 0xA0E534, "Stratec Biomedical AG" },

26911 { 0xA0E5E9, "enimai Inc" },

26912 { 0xA0E617, "MATIS" },

26913 { 0xA0E6F8, "Texas Instruments" },

26914 { 0xA0E70B, "Intel Corporate" },

26915 { 0xA0E7AE, "ARRIS Group, Inc." },

26916 { 0xA0E9DB, "Ningbo FreeWings Technologies Co.,Ltd" },

26917 { 0xA0EB76, "AirCUVE Inc." },

26918 { 0xA0EC80, "zte corporation" },

26919 { 0xA0ECF9, "Cisco Systems, Inc" },

26920 { 0xA0ED6D, "Ubee Interactive Co., Limited" },

26921 { 0xA0EDCD, "Apple, Inc." },

26922 { 0xA0EDFB, "Quectel Wireless Solutions Co.,Ltd." },

26923 { 0xA0EF84, "Seine Image Int'l Co., Ltd" },

26924 { 0xA0F217, "GE Medical System(China) Co., Ltd." },

26925 { 0xA0F3C1, "TP-LINK TECHNOLOGIES CO.,LTD." },

26926 { 0xA0F3E4, "Alcatel-Lucent IPD" },

26927 { 0xA0F419, "Nokia Corporation" },

26928 { 0xA0F450, "HTC Corporation" },

26929 { 0xA0F459, "FN-LINK TECHNOLOGY LIMITED" },

26930 { 0xA0F479, "HUAWEI TECHNOLOGIES CO.,LTD" },

26931 { 0xA0F509, "IEI Integration Corp." },

26932 { 0xA0F6FD, "Texas Instruments" },

26933 { 0xA0F849, "Cisco Systems, Inc" },

26934 { 0xA0F895, "Shenzhen TINNO Mobile Technology Corp." },

26935 { 0xA0F9B7, "Ademco Smart Homes Technology(Tianjin)Co.,Ltd." },

26936 { 0xA0F9E0, "VIVATEL COMPANY LIMITED" },

26937 { 0xA0FB83, "Honor Device Co., Ltd." },

26938 { 0xA0FBC5, "Apple, Inc." },

26939 { 0xA0FC6E, "Telegrafia a.s." },

26940 { 0xA0FE61, "Vivint Wireless Inc." },

26941 { 0xA0FE91, "AVAT Automation GmbH" },

26942 { 0xA0FF0C, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

26943 { 0xA0FF22, "SHENZHEN APICAL TECHNOLOGY CO., LTD" },

26944 { 0xA0FF70, "Vantiva USA LLC" },

26945 { 0xA4004E, "Cisco Systems, Inc" },

26946 { 0xA400E2, "HUAWEI TECHNOLOGIES CO.,LTD" },

26947 { 0xA40130, "ABIsystems Co., LTD" },

26948 { 0xA402B9, "Intel Corporate" },

26949 { 0xA40450, "nFore Technology Inc." },

26950 { 0xA4056E, "Tiinlab Corporation" },

26951 { 0xA4059E, "STA Infinity LLP" },

26952 { 0xA405D6, "ARRIS Group, Inc." },

26953 { 0xA406E9, "Texas Instruments" },

26954 { 0xA407B6, "Samsung Electronics Co.,Ltd" },

26955 { 0xA40801, "Amazon Technologies Inc." },

26956 { 0xA408EA, "Murata Manufacturing Co., Ltd." },

26957 { 0xA408F5, "Sagemcom Broadband SAS" },

26958 { 0xA409CB, "Alfred Kaercher GmbH &amp; Co KG" },

26959 { 0xA40BED, "Carry Technology Co.,Ltd" },

26960 { 0xA40C66, "Shenzhen Colorful Yugong Technology and Development Co., Ltd." },

26961 { 0xA40CC3, "Cisco Systems, Inc" },

26962 { 0xA40DBC, "Xiamen Intretech Inc." },

26963 { 0xA40E2B, "Facebook Inc" },

26964 { 0xA40E75, "Aruba, a Hewlett Packard Enterprise Company" },

26965 { 0xA40F98, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

26966 { 0xA410B6, "Cisco Systems, Inc" },

26967 { 0xA41115, "Robert Bosch Engineering and Business Solutions pvt. Ltd." },

26968 { 0xA41162, "Arlo Technology" },

26969 { 0xA41163, "IEEE Registration Authority" },

26970 { 0xA41194, "Lenovo" },

26971 { 0xA411BB, "Cisco Systems, Inc" },

26972 { 0xA41232, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

26973 { 0xA41242, "NEC Platforms, Ltd." },

26974 { 0xA4134E, "Luxul" },

26975 { 0xA41437, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

26976 { 0xA41566, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

26977 { 0xA41588, "ARRIS Group, Inc." },

26978 { 0xA416C0, "Apple, Inc." },

26979 { 0xA416E7, "HUAWEI TECHNOLOGIES CO.,LTD" },

26980 { 0xA41731, "Hon Hai Precision Ind. Co.,Ltd." },

26981 { 0xA41752, "Hifocus Electronics India Private Limited" },

26982 { 0xA4178B, "HUAWEI TECHNOLOGIES CO.,LTD" },

26983 { 0xA41791, "Shenzhen Decnta Technology Co.,LTD." },

26984 { 0xA41875, "Cisco Systems, Inc" },

26985 { 0xA41894, "Bosch Security Systems B.V." },

26986 { 0xA41908, "Fiberhome Telecommunication Technologies Co.,LTD" },

26987 { 0xA41A3A, "TP-LINK TECHNOLOGIES CO.,LTD." },

26988 { 0xA41B34, "China Mobile Group Device Co.,Ltd." },

26989 { 0xA41BC0, "Fastec Imaging Corporation" },

26990 { 0xA41CB4, "DFI Inc" },

26991 { 0xA41EE1, "Taicang T&W Electronics" },

26992 { 0xA41F72, "Dell Inc." },

26993 { 0xA4218A, "Nortel Networks" },

26994 { 0xA42249, "Sagemcom Broadband SAS" },

26995 { 0xA42305, "Open Networking Laboratory" },

26996 { 0xA424B3, "FlatFrog Laboratories AB" },

26997 { 0xA424DD, "Cambrionix Ltd" },

26998 { 0xA4251B, "Avaya Inc" },

26999 { 0xA42618, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

27000 { 0xA42655, "LTI Motion (Shanghai) Co., Ltd." },

27001 { 0xA428B7, "Yangtze Memory Technologies Co., Ltd." },

27002 { 0xA42940, "Shenzhen YOUHUA Technology Co., Ltd" },

27003 { 0xA42983, "Boeing Defence Australia" },

27004 { 0xA42985, "Sichuan AI-Link Technology Co., Ltd." },

27005 { 0xA429B7, "bluesky" },

27006 { 0xA42A71, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

27007 { 0xA42A95, "D-Link International" },

27008 { 0xA42B8C, "NETGEAR" },

27009 { 0xA42BB0, "TP-LINK TECHNOLOGIES CO.,LTD." },

27010 { 0xA42C08, "Masterwork Automodules" },

27011 { 0xA4307A, "Samsung Electronics Co.,Ltd" },

27012 { 0xA43111, "ZIV" },

27013 { 0xA43135, "Apple, Inc." },

27014 { 0xA433D1, "Fibrlink Communications Co.,Ltd." },

27015 { 0xA433D7, "MitraStar Technology Corp." },

27016 { 0xA43412, "Thales Alenia Space" },

27017 { 0xA434D9, "Intel Corporate" },

27018 { 0xA434F1, "Texas Instruments" },

27019 { 0xA43523, "Guangdong Donyan Network Technologies Co.,Ltd." },

27020 { 0xA4352D, "TRIZ Networks corp." },

27021 { 0xA436C7, "LG Innotek" },

27022 { 0xA4373E, "Huawei Device Co., Ltd." },

27023 { 0xA43831, "RF elements s.r.o." },

27024 { 0xA438CC, "Nintendo Co.,Ltd" },

27025 { 0xA438FC, "Plastic Logic" },

27026 { 0xA439B3, "Beijing Xiaomi Mobile Software Co., Ltd" },

27027 { 0xA439B6, "SHENZHEN PEIZHE MICROELECTRONICS CO .LTD" },

27028 { 0xA43A69, "Vers Inc" },

27029 { 0xA43B0E, "Huawei Device Co., Ltd." },

27030 { 0xA43BFA, "IEEE Registration Authority" },

27031 { 0xA43CD7, "NTX Electronics YangZhou co.,LTD" },

27032 { 0xA43D78, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

27033 { 0xA43E51, "ANOV FRANCE" },

27034 { 0xA43EA0, "iComm HK LIMITED" },

27035 { 0xA43F51, "Shenzhen Benew Technology Co.,Ltd." },

27036 { 0xA43F68, "Arista Network, Inc." },

27037 { 0xA44027, "zte corporation" },

27038 { 0xA4423B, "Intel Corporate" },

27039 { 0xA4438C, "ARRIS Group, Inc." },

27040 { 0xA444D1, "Wingtech Group (HongKong）Limited" },

27041 { 0xA44519, "Xiaomi Communications Co Ltd" },

27042 { 0xA445CD, "IoT Diagnostics" },

27043 { 0xA4466B, "EOC Technology" },

27044 { 0xA446B4, "Huawei Device Co., Ltd." },

27045 { 0xA446FA, "AmTRAN Video Corporation" },

27046 { 0xA44AD3, "ST Electronics(Shanghai) Co.,Ltd" },

27047 { 0xA44B15, "Sun Cupid Technology (HK) LTD" },

27048 { 0xA44BD5, "Xiaomi Communications Co Ltd" },

27049 { 0xA44C11, "Cisco Systems, Inc" },

27050 { 0xA44C62, "Hangzhou Microimage Software Co., Ltd" },

27051 { 0xA44CC8, "Dell Inc." },

27052 { 0xA44E2D, "Adaptive Wireless Solutions, LLC" },

27053 { 0xA44E31, "Intel Corporate" },

27054 { 0xA44F29, "IEEE Registration Authority" },

27055 { 0xA45006, "SHENZHEN HUACHUANG SHIDAI TECHNOLOGYCO.,LTD" },

27056 { 0xA45046, "Xiaomi Communications Co Ltd" },

27057 { 0xA45055, "BUSWARE.DE" },

27058 { 0xA45129, "XAG" },

27059 { 0xA4515E, "Juniper Networks" },

27060 { 0xA4516F, "Microsoft Mobile Oy" },

27061 { 0xA4526F, "ADB Broadband Italia" },

27062 { 0xA4530E, "Cisco Systems, Inc" },

27063 { 0xA45385, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

27064 { 0xA453EE, "IEEE Registration Authority" },

27065 { 0xA45590, "Xiaomi Communications Co Ltd" },

27066 { 0xA45602, "fenglian Technology Co.,Ltd." },

27067 { 0xA4561B, "MCOT Corporation" },

27068 { 0xA45630, "Cisco Systems, Inc" },

27069 { 0xA456CC, "Vantiva USA LLC" },

27070 { 0xA45802, "SHIN-IL TECH" },

27071 { 0xA4580F, "IEEE Registration Authority" },

27072 { 0xA45A1C, "smart-electronic GmbH" },

27073 { 0xA45C27, "Nintendo Co., Ltd." },

27074 { 0xA45D36, "Hewlett Packard" },

27075 { 0xA45D5E, "Wilk Elektronik S.A." },

27076 { 0xA45DA1, "ADB Broadband Italia" },

27077 { 0xA45E5A, "ACTIVIO Inc." },

27078 { 0xA45E60, "Apple, Inc." },

27079 { 0xA45F9B, "Nexell" },

27080 { 0xA45FB9, "DreamBig Semiconductor, Inc." },

27081 { 0xA46011, "Verifone" },

27082 { 0xA46032, "MRV Communications (Networks) LTD" },

27083 { 0xA46191, "NamJunSa" },

27084 { 0xA462DF, "DS Global. Co., LTD" },

27085 { 0xA463A1, "Inventus Power Eletronica do Brasil LTDA" },

27086 { 0xA46706, "Apple, Inc." },

27087 { 0xA468BC, "Oakley Inc." },

27088 { 0xA46BB6, "Intel Corporate" },

27089 { 0xA46C24, "HUAWEI TECHNOLOGIES CO.,LTD" },

27090 { 0xA46C2A, "Cisco Systems, Inc" },

27091 { 0xA46CC1, "LTi REEnergy GmbH" },

27092 { 0xA46CF1, "Samsung Electronics Co.,Ltd" },

27093 { 0xA46DA4, "HUAWEI TECHNOLOGIES CO.,LTD" },

27094 { 0xA46DD4, "Silicon Laboratories" },

27095 { 0xA46E79, "DFT System Co.Ltd" },

27096 { 0xA470D6, "Motorola Mobility LLC, a Lenovo Company" },

27097 { 0xA47174, "HUAWEI TECHNOLOGIES CO.,LTD" },

27098 { 0xA473AB, "Extreme Networks Headquarters" },

27099 { 0xA475B9, "Samsung Electronics Co.,Ltd" },

27100 { 0xA47733, "Google, Inc." },

27101 { 0xA47758, "Ningbo Freewings Technologies Co.,Ltd" },

27102 { 0xA47760, "Nokia Corporation" },

27103 { 0xA477F3, "Apple, Inc." },

27104 { 0xA47806, "Cisco Systems, Inc" },

27105 { 0xA47886, "Avaya Inc" },

27106 { 0xA47952, "Huawei Device Co., Ltd." },

27107 { 0xA479E4, "KLINFO Corp" },

27108 { 0xA47AA4, "ARRIS Group, Inc." },

27109 { 0xA47ACF, "VIBICOM COMMUNICATIONS INC." },

27110 { 0xA47B1A, "Huawei Device Co., Ltd." },

27111 { 0xA47B2C, "Nokia" },

27112 { 0xA47B85, "ULTIMEDIA Co Ltd," },

27113 { 0xA47B9D, "Espressif Inc." },

27114 { 0xA47C14, "ChargeStorm AB" },

27115 { 0xA47C1F, "Cobham plc" },

27116 { 0xA47CC9, "HUAWEI TECHNOLOGIES CO.,LTD" },

27117 { 0xA47D9F, "Shenzhen iComm Semiconductor CO.,LTD" },

27118 { 0xA47E36, "EM Microelectronic" },

27119 { 0xA47E39, "zte corporation" },

27120 { 0xA47EFA, "Withings" },

27121 { 0xA4817A, "CIG SHANGHAI CO LTD" },

27122 { 0xA481EE, "Nokia Corporation" },

27123 { 0xA48269, "Datrium, Inc." },

27124 { 0xA483E7, "Apple, Inc." },

27125 { 0xA48431, "Samsung Electronics Co.,Ltd" },

27126 { 0xA4856B, "Q Electronics Ltd" },

27127 { 0xA486AE, "Quectel Wireless Solutions Co.,Ltd." },

27128 { 0xA486DB, "Guangdong Juan Intelligent Technology Joint Stock Co., Ltd." },

27129 { 0xA48873, "Cisco Systems, Inc" },

27130 { 0xA4895B, "ARK INFOSOLUTIONS PVT LTD" },

27131 { 0xA4897E, "Guangzhou Yuhong Technology Co.,Ltd." },

27132 { 0xA48CC0, "JLG Industries, Inc." },

27133 { 0xA48CDB, "Lenovo" },

27134 { 0xA48D3B, "Vizio, Inc" },

27135 { 0xA48E0A, "DeLaval International AB" },

27136 { 0xA49005, "CHINA GREATWALL COMPUTER SHENZHEN CO.,LTD" },

27137 { 0xA490CE, "vivo Mobile Communication Co., Ltd." },

27138 { 0xA491B1, "Technicolor Delivery Technologies Belgium NV" },

27139 { 0xA492CB, "Nokia" },

27140 { 0xA4933F, "HUAWEI TECHNOLOGIES CO.,LTD" },

27141 { 0xA49340, "Beijing Supvan Information Technology Co.,Ltd." },

27142 { 0xA4934C, "Cisco Systems, Inc" },

27143 { 0xA49426, "Elgama-Elektronika Ltd." },

27144 { 0xA494DC, "Infinite Clouds" },

27145 { 0xA49733, "ASKEY COMPUTER CORP" },

27146 { 0xA4975C, "VTech Telecommunications Ltd." },

27147 { 0xA4978A, "LEAR" },

27148 { 0xA497B1, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

27149 { 0xA497BB, "Hitachi Industrial Equipment Systems Co.,Ltd" },

27150 { 0xA49813, "ARRIS Group, Inc." },

27151 { 0xA49947, "HUAWEI TECHNOLOGIES CO.,LTD" },

27152 { 0xA49981, "FuJian Elite Power Tech CO.,LTD." },

27153 { 0xA49A58, "Samsung Electronics Co.,Ltd" },

27154 { 0xA49B13, "Digital Check" },

27155 { 0xA49B4F, "HUAWEI TECHNOLOGIES CO.,LTD" },

27156 { 0xA49BCD, "Cisco Systems, Inc" },

27157 { 0xA49BF5, "Hybridserver Tec GmbH" },

27158 { 0xA49D49, "Ketra, Inc." },

27159 { 0xA49DDD, "Samsung Electronics Co.,Ltd" },

27160 { 0xA49E69, "Silicon Laboratories" },

27161 { 0xA49EDB, "AutoCrib, Inc." },

27162 { 0xA49F85, "Lyve Minds, Inc" },

27163 { 0xA49F89, "Shanghai Rui Rui Communication Technology Co.Ltd." },

27164 { 0xA4A179, "Nanjing dianyan electric power automation co. LTD" },

27165 { 0xA4A1C2, "Ericsson AB" },

27166 { 0xA4A1E4, "Innotube, Inc." },

27167 { 0xA4A24A, "Cisco SPVTG" },

27168 { 0xA4A46B, "HUAWEI TECHNOLOGIES CO.,LTD" },

27169 { 0xA4A490, "Samsung Electronics Co.,Ltd" },

27170 { 0xA4A4D3, "Bluebank Communication Technology Co.Ltd" },

27171 { 0xA4A528, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

27172 { 0xA4A6A9, "Private" },

27173 { 0xA4A80F, "Shenzhen Coship Electronics Co., Ltd." },

27174 { 0xA4A930, "Beijing Xiaomi Mobile Software Co., Ltd" },

27175 { 0xA4AAFE, "Huawei Device Co., Ltd." },

27176 { 0xA4AC0F, "Huawei Device Co., Ltd." },

27177 { 0xA4AD00, "Ragsdale Technology" },

27178 { 0xA4ADB8, "Vitec Group, Camera Dynamics Ltd" },

27179 { 0xA4AE11, "Hon Hai Precision Industry Co., Ltd." },

27180 { 0xA4AE12, "Hon Hai Precision Industry Co., Ltd." },

27181 { 0xA4AE9A, "Maestro Wireless Solutions ltd." },

27182 { 0xA4B121, "Arantia 2010 S.L." },

27183 { 0xA4B197, "Apple, Inc." },

27184 { 0xA4B1C1, "Intel Corporate" },

27185 { 0xA4B1E9, "Technicolor Delivery Technologies Belgium NV" },

27186 { 0xA4B1EE, "H. ZANDER GmbH & Co. KG" },

27187 { 0xA4B239, "Cisco Systems, Inc" },

27188 { 0xA4B2A7, "Adaxys Solutions AG" },

27189 { 0xA4B36A, "JSC SDO Chromatec" },

27190 { 0xA4B439, "Cisco Systems, Inc" },

27191 { 0xA4B52E, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

27192 { 0xA4B61E, "Huawei Device Co., Ltd." },

27193 { 0xA4B805, "Apple, Inc." },

27194 { 0xA4B818, "PENTA Gesellschaft für elektronische Industriedatenverarbeitung mbH" },

27195 { 0xA4B980, "Parking BOXX Inc." },

27196 { 0xA4BA76, "HUAWEI TECHNOLOGIES CO.,LTD" },

27197 { 0xA4BADB, "Dell Inc." },

27198 { 0xA4BB6D, "Dell Inc." },

27199 { 0xA4BBAF, "Lime Instruments" },

27200 { 0xA4BD7E, "HMD Global Oy" },

27201 { 0xA4BDC4, "HUAWEI TECHNOLOGIES CO.,LTD" },

27202 { 0xA4BE2B, "HUAWEI TECHNOLOGIES CO.,LTD" },

27203 { 0xA4BE61, "EutroVision System, Inc." },

27204 { 0xA4BF01, "Intel Corporate" },

27205 { 0xA4C0C7, "ShenZhen Hitom Communication Technology Co..LTD" },

27206 { 0xA4C0E1, "Nintendo Co., Ltd." },

27207 { 0xA4C138, "Telink Semiconductor (Taipei) Co. Ltd." },

27208 { 0xA4C23E, "Huizhou Speed Wireless Technology Co.,Ltd" },

27209 { 0xA4C2AB, "Hangzhou LEAD-IT Information & Technology Co.,Ltd" },

27210 { 0xA4C337, "Apple, Inc." },

27211 { 0xA4C361, "Apple, Inc." },

27212 { 0xA4C3F0, "Intel Corporate" },

27213 { 0xA4C40D, "WAC Lighting" },

27214 { 0xA4C494, "Intel Corporate" },

27215 { 0xA4C54E, "Huawei Device Co., Ltd." },

27216 { 0xA4C64F, "HUAWEI TECHNOLOGIES CO.,LTD" },

27217 { 0xA4C69A, "Samsung Electronics Co.,Ltd" },

27218 { 0xA4C6F0, "Apple, Inc." },

27219 { 0xA4C74B, "Huawei Device Co., Ltd." },

27220 { 0xA4C7DE, "Cambridge Industries(Group) Co.,Ltd." },

27221 { 0xA4C7F6, "Extreme Networks Headquarters" },

27222 { 0xA4C939, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

27223 { 0xA4CAA0, "HUAWEI TECHNOLOGIES CO.,LTD" },

27224 { 0xA4CC32, "Inficomm Co., Ltd" },

27225 { 0xA4CCB3, "Xiaomi Communications Co Ltd" },

27226 { 0xA4CCB9, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

27227 { 0xA4CD23, "Shenzhenshi Xinzhongxin Co., Ltd" },

27228 { 0xA4CEDA, "Arcadyan Corporation" },

27229 { 0xA4CF12, "Espressif Inc." },

27230 { 0xA4CF99, "Apple, Inc." },

27231 { 0xA4CFD2, "Ubee Interactive Co., Limited" },

27232 { 0xA4D094, "VIVAVIS AG" },

27233 { 0xA4D18C, "Apple, Inc." },

27234 { 0xA4D18F, "Shenzhen Skyee Optical Fiber Communication Technology Ltd." },

27235 { 0xA4D1D1, "ECOtality North America" },

27236 { 0xA4D1D2, "Apple, Inc." },

27237 { 0xA4D23E, "Apple, Inc." },

27238 { 0xA4D3B5, "GLITEL Stropkov, s.r.o." },

27239 { 0xA4D4B2, "Shenzhen MeiG Smart Technology Co.,Ltd" },

27240 { 0xA4D578, "Texas Instruments" },

27241 { 0xA4D5C2, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

27242 { 0xA4D73C, "Seiko Epson Corporation" },

27243 { 0xA4D795, "Wingtech Mobile Communications Co.,Ltd" },

27244 { 0xA4D856, "Gimbal, Inc" },

27245 { 0xA4D8CA, "HONG KONG WATER WORLD TECHNOLOGY CO. LIMITED" },

27246 { 0xA4D931, "Apple, Inc." },

27247 { 0xA4D990, "Samsung Electronics Co.,Ltd" },

27248 { 0xA4D9A4, "neXus ID Solutions AB" },

27249 { 0xA4DA22, "IEEE Registration Authority" },

27250 { 0xA4DA32, "Texas Instruments" },

27251 { 0xA4DA3F, "Bionics Corp." },

27252 { 0xA4DAD4, "Yamato Denki Co.,Ltd." },

27253 { 0xA4DB2E, "Kingspan Environmental Ltd" },

27254 { 0xA4DB30, "Liteon Technology Corporation" },

27255 { 0xA4DCBE, "HUAWEI TECHNOLOGIES CO.,LTD" },

27256 { 0xA4DD58, "HUAWEI TECHNOLOGIES CO.,LTD" },

27257 { 0xA4DE26, "Sumitomo Electric Industries, Ltd" },

27258 { 0xA4DE50, "Total Walther GmbH" },

27259 { 0xA4DEC9, "QLove Mobile Intelligence Information Technology (W.H.) Co. Ltd." },

27260 { 0xA4E0E6, "FILIZOLA S.A. PESAGEM E AUTOMACAO" },

27261 { 0xA4E11A, "Juniper Networks" },

27262 { 0xA4E287, "Xiaomi Communications Co Ltd" },

27263 { 0xA4E31B, "Nokia" },

27264 { 0xA4E32E, "Silicon & Software Systems Ltd." },

27265 { 0xA4E391, "DENY FONTAINE" },

27266 { 0xA4E4B8, "BlackBerry RTS" },

27267 { 0xA4E57C, "Espressif Inc." },

27268 { 0xA4E597, "Gessler GmbH" },

27269 { 0xA4E615, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

27270 { 0xA4E6B1, "Shanghai Joindata Technology Co.,Ltd." },

27271 { 0xA4E731, "Nokia Corporation" },

27272 { 0xA4E7E4, "Connex GmbH" },

27273 { 0xA4E8A3, "Fujian Newland Auto-ID Tech Co.,Ltd." },

27274 { 0xA4E975, "Apple, Inc." },

27275 { 0xA4E991, "SISTEMAS AUDIOVISUALES ITELSIS S.L." },

27276 { 0xA4E9A3, "Honest Technology Co., Ltd" },

27277 { 0xA4EA8E, "Extreme Networks Headquarters" },

27278 { 0xA4EBD3, "Samsung Electronics Co.,Ltd" },

27279 { 0xA4ED43, "IEEE Registration Authority" },

27280 { 0xA4ED4E, "ARRIS Group, Inc." },

27281 { 0xA4EE57, "Seiko Epson Corporation" },

27282 { 0xA4EF15, "AltoBeam (China) Inc." },

27283 { 0xA4EF52, "Telewave Co., Ltd." },

27284 { 0xA4F05E, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

27285 { 0xA4F1E8, "Apple, Inc." },

27286 { 0xA4F33B, "zte corporation" },

27287 { 0xA4F3C1, "Open Source Robotics Foundation, Inc." },

27288 { 0xA4F3E7, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

27289 { 0xA4F465, "ITEL MOBILE LIMITED" },

27290 { 0xA4F4C2, "VNPT TECHNOLOGY" },

27291 { 0xA4F522, "CHOFU SEISAKUSHO CO.,LTD" },

27292 { 0xA4F6E8, "Apple, Inc." },

27293 { 0xA4F7D0, "LAN Accessories Co., Ltd." },

27294 { 0xA4F841, "Apple, Inc." },

27295 { 0xA4F933, "Intel Corporate" },

27296 { 0xA4F9E4, "AirVine Scientific, Inc." },

27297 { 0xA4FA76, "New H3C Technologies Co., Ltd" },

27298 { 0xA4FB8D, "Hangzhou Dunchong Technology Co.Ltd" },

27299 { 0xA4FC14, "Apple, Inc." },

27300 { 0xA4FC77, "Mega Well Limited" },

27301 { 0xA4FCCE, "Security Expert Ltd." },

27302 { 0xA4FF95, "Nokia" },

27303 { 0xA800E3, "Starkey Labs Inc." },

27304 { 0xA8016D, "Aiwa Corporation" },

27305 { 0xA80180, "IMAGO Technologies GmbH" },

27306 { 0xA802DB, "zte corporation" },

27307 { 0xA8032A, "Espressif Inc." },

27308 { 0xA80556, "vivo Mobile Communication Co., Ltd." },

27309 { 0xA80577, "Netlist, Inc." },

27310 { 0xA80600, "Samsung Electronics Co.,Ltd" },

27311 { 0xA80BFB, "Ruckus Wireless" },

27312 { 0xA80C03, "Florawise" },

27313 { 0xA80C0D, "Cisco Systems, Inc" },

27314 { 0xA80C63, "HUAWEI TECHNOLOGIES CO.,LTD" },

27315 { 0xA80CCA, "Shenzhen Sundray Technologies Company Limited" },

27316 { 0xA81087, "Texas Instruments" },

27317 { 0xA811FC, "ARRIS Group, Inc." },

27318 { 0xA81306, "vivo Mobile Communication Co., Ltd." },

27319 { 0xA81374, "Panasonic Corporation AVC Networks Company" },

27320 { 0xA8154D, "TP-LINK TECHNOLOGIES CO.,LTD." },

27321 { 0xA81559, "Breathometer, Inc." },

27322 { 0xA815D6, "Shenzhen Meione Technology CO., LTD" },

27323 { 0xA8169D, "Hui Zhou Gaoshengda Technology Co.,LTD" },

27324 { 0xA816B2, "LG Electronics (Mobile Communications)" },

27325 { 0xA816D0, "Samsung Electronics Co.,Ltd" },

27326 { 0xA81710, "Bouffalo Lab (Nanjing) Co., Ltd." },

27327 { 0xA81758, "Elektronik System i Umeå AB" },

27328 { 0xA81AF1, "Apple, Inc." },

27329 { 0xA81B18, "XTS CORP" },

27330 { 0xA81B5A, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

27331 { 0xA81B5D, "Foxtel Management Pty Ltd" },

27332 { 0xA81B6A, "Texas Instruments" },

27333 { 0xA81D16, "AzureWave Technology Inc." },

27334 { 0xA81E84, "Quanta Computer Inc." },

27335 { 0xA81FAF, "KRYPTON POLSKA" },

27336 { 0xA82066, "Apple, Inc." },

27337 { 0xA82316, "Nokia" },

27338 { 0xA823FE, "LG Electronics" },

27339 { 0xA824B8, "Nokia" },

27340 { 0xA824EB, "ZAO NPO Introtest" },

27341 { 0xA825EB, "Cambridge Industries(Group) Co.,Ltd." },

27342 { 0xA826D9, "HTC Corporation" },

27343 { 0xA8294C, "Precision Optical Transceivers, Inc." },

27344 { 0xA82AD6, "Arthrex Inc." },

27345 { 0xA82BB5, "Edgecore Networks Corporation" },

27346 { 0xA82BB9, "Samsung Electronics Co.,Ltd" },

27347 { 0xA82BCD, "HUAWEI TECHNOLOGIES CO.,LTD" },

27348 { 0xA82BD6, "Shina System Co., Ltd" },

27349 { 0xA82C3E, "Shenzhen Cultraview Digital Technology Co., Ltd" },

27350 { 0xA8301C, "Qingdao Intelligent&Precise Electronics Co.,Ltd." },

27351 { 0xA830AD, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

27352 { 0xA830BC, "Samsung Electronics Co.,Ltd" },

27353 { 0xA8329A, "Digicom Futuristic Technologies Ltd." },

27354 { 0xA8346A, "Samsung Electronics Co.,Ltd" },

27355 { 0xA83512, "Huawei Device Co., Ltd." },

27356 { 0xA8367A, "frogblue TECHNOLOGY GmbH" },

27357 { 0xA83759, "Huawei Device Co., Ltd." },

27358 { 0xA83944, "Actiontec Electronics, Inc" },

27359 { 0xA83A48, "Ubiqcom India Pvt Ltd" },

27360 { 0xA83A79, "Mist Systems, Inc." },

27361 { 0xA83B5C, "HUAWEI TECHNOLOGIES CO.,LTD" },

27362 { 0xA83B76, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

27363 { 0xA83CA5, "Dell Inc." },

27364 { 0xA83CCB, "ROSSMA" },

27365 { 0xA83E0E, "HMD Global Oy" },

27366 { 0xA83ED3, "HUAWEI TECHNOLOGIES CO.,LTD" },

27367 { 0xA83FA1, "IEEE Registration Authority" },

27368 { 0xA8400B, "Visteon Corporation" },

27369 { 0xA84025, "Oxide Computer Company" },

27370 { 0xA84041, "Dragino Technology Co., Limited" },

27371 { 0xA8407D, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

27372 { 0xA84122, "China Mobile (Hangzhou) Information Technology Co.,Ltd." },

27373 { 0xA841F4, "AzureWave Technology Inc." },

27374 { 0xA842A1, "TP-Link Corporation Limited" },

27375 { 0xA842A7, "Jiangsu Huitong Group Co.,Ltd." },

27376 { 0xA842E3, "Espressif Inc." },

27377 { 0xA84397, "Innogrit Corporation" },

27378 { 0xA843A4, "China Dragon Technology Limited" },

27379 { 0xA84481, "Nokia Corporation" },

27380 { 0xA845CD, "Siselectron Technology LTD." },

27381 { 0xA845E9, "Firich Enterprises CO., LTD." },

27382 { 0xA8469D, "Cisco Meraki" },

27383 { 0xA8474A, "Hon Hai Precision Ind. Co.,Ltd." },

27384 { 0xA848FA, "Espressif Inc." },

27385 { 0xA8494D, "HUAWEI TECHNOLOGIES CO.,LTD" },

27386 { 0xA849A5, "Lisantech Co., Ltd." },

27387 { 0xA84A28, "Apple, Inc." },

27388 { 0xA84A63, "TPV Display Technology(Xiamen) Co.,Ltd." },

27389 { 0xA84B4D, "Samsung Electronics Co.,Ltd" },

27390 { 0xA84D4A, "Audiowise Technology Inc." },

27391 { 0xA84E3F, "Hitron Technologies. Inc" },

27392 { 0xA84FB1, "Cisco Systems, Inc" },

27393 { 0xA85081, "HUAWEI TECHNOLOGIES CO.,LTD" },

27394 { 0xA8515B, "Samsung Electronics Co.,Ltd" },

27395 { 0xA851AB, "Apple, Inc." },

27396 { 0xA852D4, "Aruba, a Hewlett Packard Enterprise Company" },

27397 { 0xA8537D, "Mist Systems, Inc." },

27398 { 0xA854A2, "Heimgard Technologies AS" },

27399 { 0xA854B2, "Wistron Neweb Corporation" },

27400 { 0xA8556A, "3S System Technology Inc." },

27401 { 0xA8574E, "TP-LINK TECHNOLOGIES CO.,LTD." },

27402 { 0xA85840, "Cambridge Industries(Group) Co.,Ltd." },

27403 { 0xA8584E, "PK VEGA" },

27404 { 0xA8587C, "Shoogee GmbH & Co. KG" },

27405 { 0xA85AE0, "Huawei Device Co., Ltd." },

27406 { 0xA85AF3, "Shanghai Siflower Communication Technology Co., Ltd" },

27407 { 0xA85B36, "IEEE Registration Authority" },

27408 { 0xA85B6C, "Robert Bosch Gmbh, CM-CI2" },

27409 { 0xA85B78, "Apple, Inc." },

27410 { 0xA85BB0, "Shenzhen Dehoo Technology Co.,Ltd" },

27411 { 0xA85BB7, "Apple, Inc." },

27412 { 0xA85BF3, "Audivo GmbH" },

27413 { 0xA85BF7, "Aruba, a Hewlett Packard Enterprise Company" },

27414 { 0xA85C03, "Jiang Su Fulian Communication Technology Co., Ltd" },

27415 { 0xA85C2C, "Apple, Inc." },

27416 { 0xA85E45, "ASUSTek COMPUTER INC." },

27417 { 0xA85EE4, "12Sided Technology, LLC" },

27418 { 0xA85EF2, "TECNO MOBILE LIMITED" },

27419 { 0xA860B6, "Apple, Inc." },

27420 { 0xA8610A, "ARDUINO AG" },

27421 { 0xA861AA, "Cloudview Limited" },

27422 { 0xA861DF, "China Mobile Group Device Co.,Ltd." },

27423 { 0xA862A2, "JIWUMEDIA CO., LTD." },

27424 { 0xA8637D, "D-Link International" },

27425 { 0xA863DF, "DISPLAIRE CORPORATION" },

27426 { 0xA863F2, "Texas Instruments" },

27427 { 0xA86405, "nimbus 9, Inc" },

27428 { 0xA864F1, "Intel Corporate" },

27429 { 0xA865B2, "DONGGUAN YISHANG ELECTRONIC TECHNOLOGY CO., LIMITED" },

27430 { 0xA8667F, "Apple, Inc." },

27431 { 0xA8671E, "RATP" },

27432 { 0xA8698C, "Oracle Corporation" },

27433 { 0xA86A6F, "RIM" },

27434 { 0xA86A86, "Xiaomi Communications Co Ltd" },

27435 { 0xA86ABB, "Sagemcom Broadband SAS" },

27436 { 0xA86AC1, "HanbitEDS Co., Ltd." },

27437 { 0xA86B7C, "SHENZHEN FENGLIAN TECHNOLOGY CO., LTD." },

27438 { 0xA86BAD, "Hon Hai Precision Ind. Co.,Ltd." },

27439 { 0xA86D5F, "Raisecom Technology CO., LTD" },

27440 { 0xA86DAA, "Intel Corporate" },

27441 { 0xA86E4E, "Huawei Device Co., Ltd." },

27442 { 0xA8705D, "ARRIS Group, Inc." },

27443 { 0xA870A5, "UniComm Inc." },

27444 { 0xA87116, "Earda Technologies co Ltd" },

27445 { 0xA8727E, "WISDRI (wuhan) Automation Company Limited" },

27446 { 0xA87285, "IDT, INC." },

27447 { 0xA8741D, "PHOENIX CONTACT Electronics GmbH" },

27448 { 0xA87484, "zte corporation" },

27449 { 0xA875D6, "FreeTek International Co., Ltd." },

27450 { 0xA875E2, "Aventura Technologies, Inc." },

27451 { 0xA87650, "Samsung Electronics Co.,Ltd" },

27452 { 0xA8776F, "Zonoff" },

27453 { 0xA877E5, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

27454 { 0xA8798D, "Samsung Electronics Co.,Ltd" },

27455 { 0xA87B39, "Nokia Corporation" },

27456 { 0xA87C01, "Samsung Electronics Co.,Ltd" },

27457 { 0xA87C45, "HUAWEI TECHNOLOGIES CO.,LTD" },

27458 { 0xA87CF8, "Apple, Inc." },

27459 { 0xA87D12, "HUAWEI TECHNOLOGIES CO.,LTD" },

27460 { 0xA87E33, "Nokia Danmark A/S" },

27461 { 0xA87EEA, "Intel Corporate" },

27462 { 0xA88038, "ShenZhen MovingComm Technology Co., Limited" },

27463 { 0xA88055, "Tuya Smart Inc." },

27464 { 0xA8817E, "Apple, Inc." },

27465 { 0xA88195, "Samsung Electronics Co.,Ltd" },

27466 { 0xA881F1, "BMEYE B.V." },

27467 { 0xA881FE, "Luxul Tech Co., Ltd" },

27468 { 0xA88200, "Hisense Electric Co.,Ltd" },

27469 { 0xA8827F, "CIBN Oriental Network(Beijing) CO.,Ltd" },

27470 { 0xA885D7, "Sangfor Technologies Inc." },

27471 { 0xA886DD, "Apple, Inc." },

27472 { 0xA88792, "Broadband Antenna Tracking Systems" },

27473 { 0xA887B3, "Samsung Electronics Co.,Ltd" },

27474 { 0xA887ED, "ARC Wireless LLC" },

27475 { 0xA88808, "Apple, Inc." },

27476 { 0xA8881F, "SERVERCOM (INDIA) PRIVATE LIMITED" },

27477 { 0xA88940, "Huawei Device Co., Ltd." },

27478 { 0xA88B28, "SHENZHEN DIYANG SMART TECHNOLOGY CO.,LTD." },

27479 { 0xA88C3E, "Microsoft Corporation" },

27480 { 0xA88CEE, "MicroMade Galka i Drozdz sp.j." },

27481 { 0xA88D7B, "SunDroid Global limited." },

27482 { 0xA88E24, "Apple, Inc." },

27483 { 0xA88FD9, "Apple, Inc." },

27484 { 0xA89008, "Beijing Yuecheng Technology Co. Ltd." },

27485 { 0xA89042, "Beijing Wanwei Intelligent Technology Co., Ltd." },

27486 { 0xA8913D, "Apple, Inc." },

27487 { 0xA89162, "Sophos Ltd" },

27488 { 0xA8922C, "LG Electronics (Mobile Communications)" },

27489 { 0xA8934A, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

27490 { 0xA89352, "SHANGHAI ZHONGMI COMMUNICATION TECHNOLOGY CO.,LTD" },

27491 { 0xA893E6, "JIANGXI JINGGANGSHAN CKING COMMUNICATION TECHNOLOGY CO.,LTD" },

27492 { 0xA895B0, "Aker Subsea Ltd" },

27493 { 0xA89675, "Motorola Mobility LLC, a Lenovo Company" },

27494 { 0xA8968A, "Apple, Inc." },

27495 { 0xA897CD, "ARRIS Group, Inc." },

27496 { 0xA897DC, "IBM" },

27497 { 0xA89892, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

27498 { 0xA898C6, "Shinbo Co., Ltd." },

27499 { 0xA8995C, "aizo ag" },

27500 { 0xA89969, "Dell Inc." },

27501 { 0xA899AD, "Chaoyue Technology Co., Ltd." },

27502 { 0xA899DC, "i-TOP DESING TECHNOLOGY CO.,LTD" },

27503 { 0xA89A93, "Sagemcom Broadband SAS" },

27504 { 0xA89AD7, "Nokia" },

27505 { 0xA89B10, "inMotion Ltd." },

27506 { 0xA89C78, "Apple, Inc." },

27507 { 0xA89CA4, "Furrion Limited" },

27508 { 0xA89CED, "Xiaomi Communications Co Ltd" },

27509 { 0xA89D21, "Cisco Systems, Inc" },

27510 { 0xA89DD2, "Shanghai DareGlobal Technologies Co.,Ltd" },

27511 { 0xA89FBA, "Samsung Electronics Co.,Ltd" },

27512 { 0xA89FEC, "ARRIS Group, Inc." },

27513 { 0xA8A089, "Tactical Communications" },

27514 { 0xA8A097, "ScioTeq bvba" },

27515 { 0xA8A159, "ASRock Incorporation" },

27516 { 0xA8A198, "TCT mobile ltd" },

27517 { 0xA8A237, "Arcadyan Corporation" },

27518 { 0xA8A5E2, "MSF-Vathauer Antriebstechnik GmbH & Co KG" },

27519 { 0xA8A648, "Qingdao Hisense Communications Co.,Ltd." },

27520 { 0xA8A668, "zte corporation" },

27521 { 0xA8A795, "Hon Hai Precision Ind. Co.,Ltd." },

27522 { 0xA8AA7C, "Huawei Device Co., Ltd." },

27523 { 0xA8ABB5, "Apple, Inc." },

27524 { 0xA8AD3D, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

27525 { 0xA8B028, "CubePilot Pty Ltd" },

27526 { 0xA8B088, "eero inc." },

27527 { 0xA8B0AE, "BizLink Special Cables Germany GmbH" },

27528 { 0xA8B13B, "HP Inc." },

27529 { 0xA8B1D4, "Cisco Systems, Inc" },

27530 { 0xA8B271, "HUAWEI TECHNOLOGIES CO.,LTD" },

27531 { 0xA8B2DA, "FUJITSU LIMITED" },

27532 { 0xA8B456, "Cisco Systems, Inc" },

27533 { 0xA8B483, "Shenzhen SuperElectron Technology Co.,Ltd." },

27534 { 0xA8B57C, "Roku, Inc" },

27535 { 0xA8B86E, "LG Electronics (Mobile Communications)" },

27536 { 0xA8B8E0, "Changwang Technology inc." },

27537 { 0xA8B9B3, "ESSYS" },

27538 { 0xA8BA69, "Samsung Electronics Co.,Ltd" },

27539 { 0xA8BB50, "WiZ IoT Company Limited" },

27540 { 0xA8BB56, "Apple, Inc." },

27541 { 0xA8BBCF, "Apple, Inc." },

27542 { 0xA8BC9C, "Cloud Light Technology Limited" },

27543 { 0xA8BD1A, "Honey Bee (Hong Kong) Limited" },

27544 { 0xA8BD27, "Hewlett Packard Enterprise" },

27545 { 0xA8BD3A, "UNION MAN TECHNOLOGY CO.,LTD" },

27546 { 0xA8BE27, "Apple, Inc." },

27547 { 0xA8BF3C, "HDV Phoelectron Technology Limited" },

27548 { 0xA8C092, "Huawei Device Co., Ltd." },

27549 { 0xA8C0EA, "Pepwave Limited" },

27550 { 0xA8C222, "TM-Research Inc." },

27551 { 0xA8C252, "Huawei Device Co., Ltd." },

27552 { 0xA8C266, "HUMAX Co., Ltd." },

27553 { 0xA8C56F, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

27554 { 0xA8C647, "Extreme Networks Headquarters" },

27555 { 0xA8C83A, "HUAWEI TECHNOLOGIES CO.,LTD" },

27556 { 0xA8C87F, "Roqos, Inc." },

27557 { 0xA8C98A, "New H3C Technologies Co., Ltd" },

27558 { 0xA8CA77, "Amazon Technologies Inc." },

27559 { 0xA8CA7B, "HUAWEI TECHNOLOGIES CO.,LTD" },

27560 { 0xA8CAB9, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

27561 { 0xA8CB95, "EAST BEST CO., LTD." },

27562 { 0xA8CC6F, "HMD Global Oy" },

27563 { 0xA8CCC5, "Saab AB (publ)" },

27564 { 0xA8CE90, "CVC" },

27565 { 0xA8CFE0, "GDN Enterprises Private Limited" },

27566 { 0xA8D081, "Huawei Device Co., Ltd." },

27567 { 0xA8D0E3, "Systech Electronics Ltd" },

27568 { 0xA8D0E5, "Juniper Networks" },

27569 { 0xA8D236, "Lightware Visual Engineering" },

27570 { 0xA8D3C8, "Topcon Electronics GmbH & Co. KG" },

27571 { 0xA8D3F7, "Arcadyan Technology Corporation" },

27572 { 0xA8D409, "USA 111 Inc" },

27573 { 0xA8D498, "Avira Operations GmbH & Co. KG" },

27574 { 0xA8D4E0, "HUAWEI TECHNOLOGIES CO.,LTD" },

27575 { 0xA8D579, "Beijing Chushang Science and Technology Co.,Ltd" },

27576 { 0xA8D828, "Ascensia Diabetes Care" },

27577 { 0xA8D88A, "Wyconn" },

27578 { 0xA8DA01, "Shenzhen NUOLIJIA Digital Technology Co.,Ltd" },

27579 { 0xA8DA0C, "SERVERCOM (INDIA) PRIVATE LIMITED" },

27580 { 0xA8DB03, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

27581 { 0xA8DC5A, "Digital Watchdog" },

27582 { 0xA8DE68, "Beijing Wide Technology Co.,Ltd" },

27583 { 0xA8E018, "Nokia Corporation" },

27584 { 0xA8E207, "GOIP Global Services Pvt. Ltd." },

27585 { 0xA8E2C1, "Texas Instruments" },

27586 { 0xA8E2C3, "Shenzhen YOUHUA Technology Co., Ltd" },

27587 { 0xA8E3EE, "Sony Interactive Entertainment Inc." },

27588 { 0xA8E539, "Nurivoice Co., Ltd" },

27589 { 0xA8E544, "HUAWEI TECHNOLOGIES CO.,LTD" },

27590 { 0xA8E552, "JUWEL Aquarium AG & Co. KG" },

27591 { 0xA8E621, "Amazon Technologies Inc." },

27592 { 0xA8E705, "Fiberhome Telecommunication Technologies Co.,LTD" },

27593 { 0xA8E77D, "Texas Instruments" },

27594 { 0xA8E81E, "ATW TECHNOLOGY, INC." },

27595 { 0xA8E824, "INIM ELECTRONICS S.R.L." },

27596 { 0xA8E978, "Huawei Device Co., Ltd." },

27597 { 0xA8EA71, "Fiberhome Telecommunication Technologies Co.,LTD" },

27598 { 0xA8EE6D, "Fine Point-High Export" },

27599 { 0xA8EEC6, "Muuselabs NV/SA" },

27600 { 0xA8EF26, "Tritonwave" },

27601 { 0xA8EF5F, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

27602 { 0xA8F038, "SHEN ZHEN SHI JIN HUA TAI ELECTRONICS CO.,LTD" },

27603 { 0xA8F1B2, "Allwinner Technology Co., Ltd" },

27604 { 0xA8F266, "Huawei Device Co., Ltd." },

27605 { 0xA8F274, "Samsung Electronics Co.,Ltd" },

27606 { 0xA8F470, "Fujian Newland Communication Science Technologies Co.,Ltd." },

27607 { 0xA8F5AC, "HUAWEI TECHNOLOGIES CO.,LTD" },

27608 { 0xA8F5DD, "ARRIS Group, Inc." },

27609 { 0xA8F5E1, "Shenzhen Shokz Co., Ltd." },

27610 { 0xA8F766, "ITE Tech Inc" },

27611 { 0xA8F7D9, "Mist Systems, Inc." },

27612 { 0xA8F7E0, "PLANET Technology Corporation" },

27613 { 0xA8F8C9, "NXP Semiconductor (Tianjin) LTD." },

27614 { 0xA8F94B, "Eltex Enterprise Ltd." },

27615 { 0xA8FAD8, "Apple, Inc." },

27616 { 0xA8FB40, "Nokia Solutions and Networks GmbH & Co. KG" },

27617 { 0xA8FB70, "WiseSec L.t.d" },

27618 { 0xA8FCB7, "Consolidated Resource Imaging" },

27619 { 0xA8FE9D, "Apple, Inc." },

27620 { 0xA8FFBA, "HUAWEI TECHNOLOGIES CO.,LTD" },

27621 { 0xAA0000, "DIGITAL EQUIPMENT CORPORATION" },

27622 { 0xAA0001, "DIGITAL EQUIPMENT CORPORATION" },

27623 { 0xAA0002, "DIGITAL EQUIPMENT CORPORATION" },

27624 { 0xAA0003, "DIGITAL EQUIPMENT CORPORATION" },

27625 { 0xAA0004, "DIGITAL EQUIPMENT CORPORATION" },

27626 { 0xAC007A, "Apple, Inc." },

27627 { 0xAC00D0, "zte corporation" },

27628 { 0xAC00F9, "BizLink Technology (S.E.A) Sdn. Bhd." },

27629 { 0xAC0142, "Uriel Technologies SIA" },

27630 { 0xAC02CA, "HI Solutions, Inc." },

27631 { 0xAC02CF, "RW Tecnologia Industria e Comercio Ltda" },

27632 { 0xAC02EF, "Comsis" },

27633 { 0xAC040B, "Peloton Interactive, Inc" },

27634 { 0xAC0425, "ball-b GmbH Co KG" },

27635 { 0xAC0481, "Jiangsu Huaxing Electronics Co., Ltd." },

27636 { 0xAC0613, "Senselogix Ltd" },

27637 { 0xAC06C7, "ServerNet S.r.l." },

27638 { 0xAC075F, "HUAWEI TECHNOLOGIES CO.,LTD" },

27639 { 0xAC0A61, "Labor S.r.L." },

27640 { 0xAC0BFB, "Espressif Inc." },

27641 { 0xAC0D1B, "LG Electronics (Mobile Communications)" },

27642 { 0xAC0DFE, "Ekon GmbH - myGEKKO" },

27643 { 0xAC11D3, "Suzhou HOTEK Video Technology Co. Ltd" },

27644 { 0xAC1203, "Intel Corporate" },

27645 { 0xAC122F, "Fantasia Trading LLC" },

27646 { 0xAC128E, "Shanghai Baud Data Communication Co.,Ltd." },

27647 { 0xAC139C, "Adtran Inc" },

27648 { 0xAC1461, "ATAW Co., Ltd." },

27649 { 0xAC14D2, "wi-daq, inc." },

27650 { 0xAC1585, "silergy corp" },

27651 { 0xAC15A2, "TP-Link Corporation Limited" },

27652 { 0xAC15F4, "Apple, Inc." },

27653 { 0xAC1615, "Apple, Inc." },

27654 { 0xAC162D, "Hewlett Packard" },

27655 { 0xAC1702, "Fibar Group sp. z o.o." },

27656 { 0xAC1754, "tiko Energy Solutions AG" },

27657 { 0xAC17C8, "Cisco Meraki" },

27658 { 0xAC1826, "Seiko Epson Corporation" },

27659 { 0xAC198E, "Intel Corporate" },

27660 { 0xAC199F, "SUNGROW POWER SUPPLY CO.,LTD." },

27661 { 0xAC1A3D, "Dell Inc." },

27662 { 0xAC1D06, "Apple, Inc." },

27663 { 0xAC1DDF, "IEEE Registration Authority" },

27664 { 0xAC1E92, "Samsung Electronics Co.,Ltd" },

27665 { 0xAC1E9E, "Xiaomi Communications Co Ltd" },

27666 { 0xAC1ED0, "Temic Automotive Philippines Inc." },

27667 { 0xAC1F09, "shenzhen RAKwireless technology Co.,Ltd" },

27668 { 0xAC1F0F, "Texas Instruments" },

27669 { 0xAC1F6B, "Super Micro Computer, Inc." },

27670 { 0xAC1F74, "Apple, Inc." },

27671 { 0xAC1FD7, "Real Vision Technology Co.,Ltd." },

27672 { 0xAC202E, "Hitron Technologies. Inc" },

27673 { 0xAC203E, "Wuhan Tianyu Information Industry Co., Ltd." },

27674 { 0xAC20AA, "DMATEK Co., Ltd." },

27675 { 0xAC2205, "Compal Broadband Networks, Inc." },

27676 { 0xAC220B, "ASUSTek COMPUTER INC." },

27677 { 0xAC2316, "Mist Systems, Inc." },

27678 { 0xAC2334, "Infinix mobility limited" },

27679 { 0xAC233F, "Shenzhen Minew Technologies Co., Ltd." },

27680 { 0xAC2929, "Infinix mobility limited" },

27681 { 0xAC293A, "Apple, Inc." },

27682 { 0xAC2A0C, "CSR ZHUZHOU INSTITUTE CO.,LTD." },

27683 { 0xAC2AA1, "Cisco Systems, Inc" },

27684 { 0xAC2B6E, "Intel Corporate" },

27685 { 0xAC2DA3, "TXTR GmbH" },

27686 { 0xAC2DA9, "TECNO MOBILE LIMITED" },

27687 { 0xAC2FA8, "Humannix Co.,Ltd." },

27688 { 0xAC3184, "Huawei Device Co., Ltd." },

27689 { 0xAC319D, "Shenzhen TG-NET Botone Technology Co.,Ltd." },

27690 { 0xAC330B, "Japan Computer Vision Corp." },

27691 { 0xAC3328, "Huawei Device Co., Ltd." },

27692 { 0xAC34CB, "Shanhai GBCOM Communication Technology Co. Ltd" },

27693 { 0xAC35EE, "FN-LINK TECHNOLOGY LIMITED" },

27694 { 0xAC3613, "Samsung Electronics Co.,Ltd" },

27695 { 0xAC361B, "Hon Hai Precision Industry Co.,LTD" },

27696 { 0xAC3651, "Jiangsu Hengtong Terahertz Technology Co., Ltd." },

27697 { 0xAC3728, "Taicang T&W Electronics" },

27698 { 0xAC3743, "HTC Corporation" },

27699 { 0xAC37C9, "RAID Incorporated" },

27700 { 0xAC3870, "Lenovo Mobile Communication Technology Ltd." },

27701 { 0xAC3A67, "Cisco Systems, Inc" },

27702 { 0xAC3A7A, "Roku, Inc." },

27703 { 0xAC3B77, "Sagemcom Broadband SAS" },

27704 { 0xAC3B96, "NXP Semiconductor (Tianjin) LTD." },

27705 { 0xAC3C0B, "Apple, Inc." },

27706 { 0xAC3C8E, "Flextronics Computing(Suzhou)Co.,Ltd." },

27707 { 0xAC3CB4, "Nilan A/S" },

27708 { 0xAC3D05, "Instorescreen Aisa" },

27709 { 0xAC3D75, "HANGZHOU ZHIWAY TECHNOLOGIES CO.,LTD." },

27710 { 0xAC3D94, "Arista Networks" },

27711 { 0xAC3EB1, "Google, Inc." },

27712 { 0xAC3FA4, "TAIYO YUDEN CO.,LTD" },

27713 { 0xAC40EA, "C&T Solution Inc." },

27714 { 0xAC4122, "Eclipse Electronic Systems Inc." },

27715 { 0xAC416A, "Amazon Technologies Inc." },

27716 { 0xAC4228, "Parta Networks" },

27717 { 0xAC4330, "Versa Networks" },

27718 { 0xAC44F2, "YAMAHA CORPORATION" },

27719 { 0xAC4500, "Apple, Inc." },

27720 { 0xAC471B, "Huawei Device Co., Ltd." },

27721 { 0xAC4723, "Genelec" },

27722 { 0xAC482D, "Ralinwi Nanjing Electronic Technology Co., Ltd." },

27723 { 0xAC49DB, "Apple, Inc." },

27724 { 0xAC4A56, "Cisco Systems, Inc" },

27725 { 0xAC4A67, "Cisco Systems, Inc" },

27726 { 0xAC4AFE, "Hisense Broadband Multimedia Technology Co.,Ltd." },

27727 { 0xAC4B1E, "Integri-Sys.Com LLC" },

27728 { 0xAC4BC8, "Juniper Networks" },

27729 { 0xAC4CA5, "Vantiva USA LLC" },

27730 { 0xAC4D16, "Texas Instruments" },

27731 { 0xAC4DD9, "Extreme Networks Headquarters" },

27732 { 0xAC4E2E, "Shenzhen JingHanDa Electronics Co.Ltd" },

27733 { 0xAC4E65, "Fiberhome Telecommunication Technologies Co.,LTD" },

27734 { 0xAC4E91, "HUAWEI TECHNOLOGIES CO.,LTD" },

27735 { 0xAC4FFC, "SVS-VISTEK GmbH" },

27736 { 0xAC5036, "Pi-Coral Inc" },

27737 { 0xAC5093, "Magna Electronics Europe GmbH & Co. OHG" },

27738 { 0xAC50DE, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

27739 { 0xAC512C, "Infinix mobility limited" },

27740 { 0xAC5135, "MPI TECH" },

27741 { 0xAC51AB, "HUAWEI TECHNOLOGIES CO.,LTD" },

27742 { 0xAC51EE, "Adtran Inc" },

27743 { 0xAC5474, "China Mobile IOT Company Limited" },

27744 { 0xAC54EC, "IEEE P1823 Standards Working Group" },

27745 { 0xAC562C, "LAVA INTERNATIONAL(H.K) LIMITED" },

27746 { 0xAC567B, "Sunnovo International Limited" },

27747 { 0xAC5775, "HMD Global Oy" },

27748 { 0xAC583B, "Human Assembler, Inc." },

27749 { 0xAC587B, "JCT Healthcare" },

27750 { 0xAC5A14, "Samsung Electronics Co.,Ltd" },

27751 { 0xAC5AEE, "China Mobile Group Device Co.,Ltd." },

27752 { 0xAC5AF0, "LG Electronics" },

27753 { 0xAC5AFC, "Intel Corporate" },

27754 { 0xAC5D10, "Pace Americas" },

27755 { 0xAC5D5C, "FN-LINK TECHNOLOGY LIMITED" },

27756 { 0xAC5E14, "HUAWEI TECHNOLOGIES CO.,LTD" },

27757 { 0xAC5E8C, "Utillink" },

27758 { 0xAC5F3E, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

27759 { 0xAC5FEA, "OnePlus Technology (Shenzhen) Co., Ltd" },

27760 { 0xAC606F, "Nokia Shanghai Bell Co., Ltd." },

27761 { 0xAC6089, "HUAWEI TECHNOLOGIES CO.,LTD" },

27762 { 0xAC60B6, "Ericsson AB" },

27763 { 0xAC6123, "Drivven, Inc." },

27764 { 0xAC6175, "HUAWEI TECHNOLOGIES CO.,LTD" },

27765 { 0xAC61B9, "WAMA Technology Limited" },

27766 { 0xAC61EA, "Apple, Inc." },

27767 { 0xAC620D, "Jabil Circuit(Wuxi) Co.,Ltd" },

27768 { 0xAC63BE, "Amazon Technologies Inc." },

27769 { 0xAC6417, "Siemens AG" },

27770 { 0xAC6462, "zte corporation" },

27771 { 0xAC6490, "HUAWEI TECHNOLOGIES CO.,LTD" },

27772 { 0xAC64CF, "FN-LINK TECHNOLOGY LIMITED" },

27773 { 0xAC64DD, "IEEE Registration Authority" },

27774 { 0xAC6706, "Ruckus Wireless" },

27775 { 0xAC675D, "Intel Corporate" },

27776 { 0xAC676F, "Electrocompaniet A.S." },

27777 { 0xAC6784, "Google, Inc." },

27778 { 0xAC67B2, "Espressif Inc." },

27779 { 0xAC6AA3, "Shenzhen Kertong Technology Co.,Ltd" },

27780 { 0xAC6B0F, "CADENCE DESIGN SYSTEMS INC" },

27781 { 0xAC6BAC, "Jenny Science AG" },

27782 { 0xAC6C90, "Samsung Electronics Co.,Ltd" },

27783 { 0xAC6E1A, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

27784 { 0xAC6F4F, "Enspert Inc" },

27785 { 0xAC6FBB, "TATUNG Technology Inc." },

27786 { 0xAC6FD9, "Valueplus Inc." },

27787 { 0xAC710C, "China Mobile Group Device Co.,Ltd." },

27788 { 0xAC712E, "Fortinet, Inc." },

27789 { 0xAC7236, "Lexking Technology Co., Ltd." },

27790 { 0xAC7289, "Intel Corporate" },

27791 { 0xAC72DD, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

27792 { 0xAC7352, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

27793 { 0xAC7409, "Hangzhou H3C Technologies Co., Limited" },

27794 { 0xAC74B1, "Intel Corporate" },

27795 { 0xAC74C4, "Maytronics Ltd." },

27796 { 0xAC751D, "HUAWEI TECHNOLOGIES CO.,LTD" },

27797 { 0xAC764C, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

27798 { 0xAC7713, "Honeywell Safety Products (Shanghai) Co.,Ltd" },

27799 { 0xAC77B9, "Nanjing Yufei Intelligent Control Technology Co.,LTD" },

27800 { 0xAC78D1, "Juniper Networks" },

27801 { 0xAC7A42, "iConnectivity" },

27802 { 0xAC7A4D, "ALPSALPINE CO,.LTD" },

27803 { 0xAC7A56, "Cisco Systems, Inc" },

27804 { 0xAC7A94, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

27805 { 0xAC7BA1, "Intel Corporate" },

27806 { 0xAC7E01, "Huawei Device Co., Ltd." },

27807 { 0xAC7E8A, "Cisco Systems, Inc" },

27808 { 0xAC7F3E, "Apple, Inc." },

27809 { 0xAC7F8D, "Extreme Networks Headquarters" },

27810 { 0xAC800A, "Sony Corporation" },

27811 { 0xAC80AE, "Fiberhome Telecommunication Technologies Co.,LTD" },

27812 { 0xAC80D6, "Hexatronic AB" },

27813 { 0xAC80FB, "Samsung Electronics Co.,Ltd" },

27814 { 0xAC8112, "Gemtek Technology Co., Ltd." },

27815 { 0xAC81B5, "Accton Technology Corporation" },

27816 { 0xAC81F3, "Nokia Corporation" },

27817 { 0xAC8226, "Qingdao Haier Technology Co.,Ltd" },

27818 { 0xAC8247, "Intel Corporate" },

27819 { 0xAC8317, "Shenzhen Furtunetel Communication Co., Ltd" },

27820 { 0xAC83E9, "Beijing Zile Technology Co., Ltd" },

27821 { 0xAC83F0, "Cobalt Digital Inc." },

27822 { 0xAC83F3, "AMPAK Technology, Inc." },

27823 { 0xAC84C6, "TP-LINK TECHNOLOGIES CO.,LTD." },

27824 { 0xAC84C9, "Sagemcom Broadband SAS" },

27825 { 0xAC853D, "HUAWEI TECHNOLOGIES CO.,LTD" },

27826 { 0xAC8674, "Open Mesh, Inc." },

27827 { 0xAC867E, "Create New Technology (HK) Limited Company" },

27828 { 0xAC86A3, "Apple, Inc." },

27829 { 0xAC87A3, "Apple, Inc." },

27830 { 0xAC88FD, "Apple, Inc." },

27831 { 0xAC8995, "AzureWave Technology Inc." },

27832 { 0xAC89D2, "Ciena Corporation" },

27833 { 0xAC8ACD, "ROGER D.Wensker, G.Wensker sp.j." },

27834 { 0xAC8B6A, "China Mobile IOT Company Limited" },

27835 { 0xAC8B9C, "Primera Technology, Inc." },

27836 { 0xAC8BA9, "Ubiquiti Inc" },

27837 { 0xAC8C46, "Beijing Xiaomi Mobile Software Co., Ltd" },

27838 { 0xAC8D14, "Smartrove Inc" },

27839 { 0xAC8D34, "HUAWEI TECHNOLOGIES CO.,LTD" },

27840 { 0xAC8FA9, "Nokia Solutions and Networks GmbH & Co. KG" },

27841 { 0xAC8FF8, "Nokia" },

27842 { 0xAC9073, "HUAWEI TECHNOLOGIES CO.,LTD" },

27843 { 0xAC9085, "Apple, Inc." },

27844 { 0xAC919B, "Wistron Neweb Corporation" },

27845 { 0xAC91A1, "Dell Inc." },

27846 { 0xAC9232, "HUAWEI TECHNOLOGIES CO.,LTD" },

27847 { 0xAC932F, "Nokia Corporation" },

27848 { 0xAC936A, "Huawei Device Co., Ltd." },

27849 { 0xAC93C4, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

27850 { 0xAC9403, "Envision Peripherals Inc" },

27851 { 0xAC9572, "Jovision Technology Co., Ltd." },

27852 { 0xAC965B, "Lucid Motors" },

27853 { 0xAC9738, "Apple, Inc." },

27854 { 0xAC976C, "Greenliant" },

27855 { 0xAC9929, "HUAWEI TECHNOLOGIES CO.,LTD" },

27856 { 0xAC9A22, "NXP Semiconductors" },

27857 { 0xAC9A96, "Maxlinear, Inc" },

27858 { 0xAC9B0A, "Sony Corporation" },

27859 { 0xAC9B84, "Smak Tecnologia e Automacao" },

27860 { 0xAC9CE4, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

27861 { 0xAC9E17, "ASUSTek COMPUTER INC." },

27862 { 0xACA016, "Cisco Systems, Inc" },

27863 { 0xACA09D, "Juniper Networks" },

27864 { 0xACA213, "Shenzhen Bilian electronic CO.,LTD" },

27865 { 0xACA22C, "Baycity Technologies Ltd" },

27866 { 0xACA31E, "Aruba, a Hewlett Packard Enterprise Company" },

27867 { 0xACA32F, "Solidigm Technology" },

27868 { 0xACA430, "Peerless AV" },

27869 { 0xACA46E, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

27870 { 0xACA667, "Electronic Systems Protection, Inc." },

27871 { 0xACA88E, "SHARP Corporation" },

27872 { 0xACA919, "TrekStor GmbH" },

27873 { 0xACA9A0, "Audioengine, Ltd." },

27874 { 0xACAB2E, "Beijing LasNubes Technology Co., Ltd." },

27875 { 0xACAB8D, "Lyngso Marine A/S" },

27876 { 0xACABBF, "AthenTek Inc." },

27877 { 0xACACE2, "CHANGHONG (HONGKONG) TRADING LIMITED" },

27878 { 0xACAD4B, "zte corporation" },

27879 { 0xACAE19, "Roku, Inc" },

27880 { 0xACAFB9, "Samsung Electronics Co.,Ltd" },

27881 { 0xACB181, "Belden Mooresville" },

27882 { 0xACB1EE, "SHENZHEN FENDA TECHNOLOGY CO., LTD" },

27883 { 0xACB313, "ARRIS Group, Inc." },

27884 { 0xACB3B5, "HUAWEI TECHNOLOGIES CO.,LTD" },

27885 { 0xACB566, "Renesas Electronics (Penang) Sdn. Bhd." },

27886 { 0xACB57D, "Liteon Technology Corporation" },

27887 { 0xACB687, "Arcadyan Corporation" },

27888 { 0xACB74F, "METEL s.r.o." },

27889 { 0xACB859, "Uniband Electronic Corp," },

27890 { 0xACB92F, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

27891 { 0xACBAC0, "Intertech Services AG" },

27892 { 0xACBB61, "YSTen Technology Co.,Ltd" },

27893 { 0xACBC32, "Apple, Inc." },

27894 { 0xACBCB5, "Apple, Inc." },

27895 { 0xACBCD9, "Cisco Systems, Inc" },

27896 { 0xACBD0B, "Leimac Ltd." },

27897 { 0xACBD70, "Huawei Device Co., Ltd." },

27898 { 0xACBE75, "Ufine Technologies Co.,Ltd." },

27899 { 0xACBEB6, "Visualedge Technology Co., Ltd." },

27900 { 0xACBF71, "Bose Corporation" },

27901 { 0xACC048, "OnePlus Technology (Shenzhen) Co., Ltd" },

27902 { 0xACC1EE, "Xiaomi Communications Co Ltd" },

27903 { 0xACC25D, "Fiberhome Telecommunication Technologies Co.,LTD" },

27904 { 0xACC2EC, "CLT INT'L IND. CORP." },

27905 { 0xACC33A, "Samsung Electronics Co.,Ltd" },

27906 { 0xACC358, "Continental Automotive Czech Republic s.r.o." },

27907 { 0xACC4A9, "Fiberhome Telecommunication Technologies Co.,LTD" },

27908 { 0xACC4BD, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

27909 { 0xACC51B, "Zhuhai Pantum Electronics Co., Ltd." },

27910 { 0xACC595, "Graphite Systems" },

27911 { 0xACC662, "MitraStar Technology Corp." },

27912 { 0xACC698, "Kohzu Precision Co., Ltd." },

27913 { 0xACC73F, "VITSMO CO., LTD." },

27914 { 0xACC906, "Apple, Inc." },

27915 { 0xACC935, "Ness Corporation" },

27916 { 0xACCA54, "Telldus Technologies AB" },

27917 { 0xACCA8E, "ODA Technologies" },

27918 { 0xACCAAB, "Virtual Electric Inc" },

27919 { 0xACCABA, "Midokura Co., Ltd." },

27920 { 0xACCB09, "Hefcom Metering (Pty) Ltd" },

27921 { 0xACCB36, "Fiberhome Telecommunication Technologies Co.,LTD" },

27922 { 0xACCB51, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

27923 { 0xACCC8E, "Axis Communications AB" },

27924 { 0xACCCFC, "Amazon Technologies Inc." },

27925 { 0xACCE8F, "HWA YAO TECHNOLOGIES CO., LTD" },

27926 { 0xACCE92, "New H3C Technologies Co., Ltd" },

27927 { 0xACCF23, "Hi-flying electronics technology Co.,Ltd" },

27928 { 0xACCF5C, "Apple, Inc." },

27929 { 0xACCF7B, "INGRAM MICRO SERVICES" },

27930 { 0xACCF85, "HUAWEI TECHNOLOGIES CO.,LTD" },

27931 { 0xACD074, "Espressif Inc." },

27932 { 0xACD180, "Crexendo Business Solutions, Inc." },

27933 { 0xACD1B8, "Hon Hai Precision Ind. Co.,Ltd." },

27934 { 0xACD31D, "Cisco Meraki" },

27935 { 0xACD364, "ABB SPA, ABB SACE DIV." },

27936 { 0xACD564, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

27937 { 0xACD618, "OnePlus Technology (Shenzhen) Co., Ltd" },

27938 { 0xACD657, "Shaanxi GuoLian Digital TV Technology Co.,Ltd." },

27939 { 0xACD75B, "Sagemcom Broadband SAS" },

27940 { 0xACD829, "Bouffalo Lab (Nanjing) Co., Ltd." },

27941 { 0xACD8A7, "BELLDESIGN Inc." },

27942 { 0xACD9D6, "tci GmbH" },

27943 { 0xACDB22, "Marquardt Schaltsysteme SCS" },

27944 { 0xACDB48, "ARRIS Group, Inc." },

27945 { 0xACDBDA, "Shenzhen Geniatech Inc, Ltd" },

27946 { 0xACDCCA, "HUAWEI TECHNOLOGIES CO.,LTD" },

27947 { 0xACDCE5, "Procter & Gamble Company" },

27948 { 0xACDE48, "Private" },

27949 { 0xACDF9F, "Arcadyan Corporation" },

27950 { 0xACDFA1, "Apple, Inc." },

27951 { 0xACE010, "Liteon Technology Corporation" },

27952 { 0xACE069, "ISAAC Instruments" },

27953 { 0xACE0D6, "koreabts" },

27954 { 0xACE14F, "Autonomic Controls, Inc." },

27955 { 0xACE215, "HUAWEI TECHNOLOGIES CO.,LTD" },

27956 { 0xACE2D3, "Hewlett Packard" },

27957 { 0xACE342, "HUAWEI TECHNOLOGIES CO.,LTD" },

27958 { 0xACE348, "MadgeTech, Inc" },

27959 { 0xACE403, "Shenzhen Visteng Technology CO.,LTD" },

27960 { 0xACE42E, "SK hynix" },

27961 { 0xACE4B5, "Apple, Inc." },

27962 { 0xACE5F0, "Doppler Labs" },

27963 { 0xACE64B, "Shenzhen Baojia Battery Technology Co., Ltd." },

27964 { 0xACE77B, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

27965 { 0xACE87B, "HUAWEI TECHNOLOGIES CO.,LTD" },

27966 { 0xACE87E, "Bytemark Computer Consulting Ltd" },

27967 { 0xACE97F, "IoT Tech Limited" },

27968 { 0xACE9AA, "Hay Systems Ltd" },

27969 { 0xACEA6A, "GENIX INFOCOMM CO., LTD." },

27970 { 0xACEB51, "Universal Electronics, Inc." },

27971 { 0xACEC80, "ARRIS Group, Inc." },

27972 { 0xACEC85, "eero inc." },

27973 { 0xACED32, "Extreme Networks Headquarters" },

27974 { 0xACED5C, "Intel Corporate" },

27975 { 0xACEE3B, "6harmonics Inc" },

27976 { 0xACEE64, "Shenzhen SuperElectron Technology Co.,Ltd." },

27977 { 0xACEE70, "Fontem Ventures BV" },

27978 { 0xACEE9E, "Samsung Electronics Co.,Ltd" },

27979 { 0xACF0B2, "Becker Electronics Taiwan Ltd." },

27980 { 0xACF108, "LG Innotek" },

27981 { 0xACF1DF, "D-Link International" },

27982 { 0xACF2C5, "Cisco Systems, Inc" },

27983 { 0xACF5E6, "Cisco Systems, Inc" },

27984 { 0xACF6F7, "LG Electronics (Mobile Communications)" },

27985 { 0xACF7F3, "Xiaomi Communications Co Ltd" },

27986 { 0xACF85C, "Chengdu Higon Integrated Circuit Design Co,. Ltd." },

27987 { 0xACF8CC, "ARRIS Group, Inc." },

27988 { 0xACF970, "HUAWEI TECHNOLOGIES CO.,LTD" },

27989 { 0xACF97E, "ELESYS INC." },

27990 { 0xACFAA5, "digitron" },

27991 { 0xACFC82, "Shenzhen Sundray Technologies Company Limited" },

27992 { 0xACFCE3, "EM Microelectronic" },

27993 { 0xACFD93, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

27994 { 0xACFDCE, "Intel Corporate" },

27995 { 0xACFDEC, "Apple, Inc." },

27996 { 0xACFE05, "ITEL MOBILE LIMITED" },

27997 { 0xACFF6B, "HUAWEI TECHNOLOGIES CO.,LTD" },

27998 { 0xB00073, "Wistron Neweb Corporation" },

27999 { 0xB000B4, "Cisco Systems, Inc" },

28000 { 0xB00247, "AMPAK Technology, Inc." },

28001 { 0xB0027E, "MULLER SERVICES" },

28002 { 0xB00594, "Liteon Technology Corporation" },

28003 { 0xB00875, "HUAWEI TECHNOLOGIES CO.,LTD" },

28004 { 0xB008BF, "Vital Connect, Inc." },

28005 { 0xB009D3, "Avizia" },

28006 { 0xB009DA, "Ring Solutions" },

28007 { 0xB00AD5, "zte corporation" },

28008 { 0xB00C9D, "Quectel Wireless Solutions Co.,Ltd." },

28009 { 0xB00CD1, "Hewlett Packard" },

28010 { 0xB01041, "Hon Hai Precision Ind. Co.,Ltd." },

28011 { 0xB0104B, "Fiberhome Telecommunication Technologies Co.,LTD" },

28012 { 0xB010A0, "Texas Instruments" },

28013 { 0xB01203, "Dynamics Hong Kong Limited" },

28014 { 0xB01266, "Futaba-Kikaku" },

28015 { 0xB01408, "LIGHTSPEED INTERNATIONAL CO." },

28016 { 0xB01656, "HUAWEI TECHNOLOGIES CO.,LTD" },

28017 { 0xB01743, "EDISON GLOBAL CIRCUITS LLC" },

28018 { 0xB01886, "SmarDTV Corporation" },

28019 { 0xB019C6, "Apple, Inc." },

28020 { 0xB01B4B, "Invisible Fun Studio Limited" },

28021 { 0xB01B7C, "Ontrol A.S." },

28022 { 0xB01BD2, "Le Shi Zhi Xin Electronic Technology (Tianjin) Limited" },

28023 { 0xB01C0C, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

28024 { 0xB01C91, "Elim Co" },

28025 { 0xB01F29, "Helvetia INC." },

28026 { 0xB01F47, "Heights Telecom T ltd" },

28027 { 0xB01F81, "IEEE Registration Authority" },

28028 { 0xB01F8C, "Aruba, a Hewlett Packard Enterprise Company" },

28029 { 0xB0216F, "HUAWEI TECHNOLOGIES CO.,LTD" },

28030 { 0xB0227A, "HP Inc." },

28031 { 0xB02347, "Shenzhen Giant Microelectronics Company Limited" },

28032 { 0xB02491, "Huawei Device Co., Ltd." },

28033 { 0xB024F3, "Progeny Systems" },

28034 { 0xB025AA, "Private" },

28035 { 0xB02628, "Broadcom Limited" },

28036 { 0xB02680, "Cisco Systems, Inc" },

28037 { 0xB027CF, "Extreme Networks Headquarters" },

28038 { 0xB0285B, "JUHUA Technology Inc." },

28039 { 0xB02A1F, "Wingtech Group (HongKong）Limited" },

28040 { 0xB02A43, "Google, Inc." },

28041 { 0xB02EE0, "Huawei Device Co., Ltd." },

28042 { 0xB03055, "China Mobile IOT Company Limited" },

28043 { 0xB030C8, "Teal Drones, Inc." },

28044 { 0xB03366, "vivo Mobile Communication Co., Ltd." },

28045 { 0xB033A6, "Juniper Networks" },

28046 { 0xB03495, "Apple, Inc." },

28047 { 0xB0350B, "MOBIWIRE MOBILES (NINGBO) CO.,LTD" },

28048 { 0xB0358D, "Nokia Corporation" },

28049 { 0xB0359F, "Intel Corporate" },

28050 { 0xB035B5, "Apple, Inc." },

28051 { 0xB03795, "LG Electronics" },

28052 { 0xB03829, "Siliconware Precision Industries Co., Ltd." },

28053 { 0xB03850, "Nanjing CAS-ZDC IOT SYSTEM CO.,LTD" },

28054 { 0xB03893, "Onda TLC Italia S.r.l." },

28055 { 0xB038E2, "Wanan Hongsheng Electronic Co.Ltd" },

28056 { 0xB03956, "NETGEAR" },

28057 { 0xB03ACE, "Huawei Device Co., Ltd." },

28058 { 0xB03CDC, "Intel Corporate" },

28059 { 0xB03D96, "Vision Valley FZ LLC" },

28060 { 0xB03DC2, "Wasp artificial intelligence(Shenzhen) Co.,ltd" },

28061 { 0xB03E51, "SKY UK LIMITED" },

28062 { 0xB03EB0, "MICRODIA Ltd." },

28063 { 0xB03F64, "Apple, Inc." },

28064 { 0xB04089, "Senient Systems LTD" },

28065 { 0xB0411D, "ITTIM Technologies" },

28066 { 0xB0416F, "Shenzhen Maxtang Computer Co.,Ltd" },

28067 { 0xB0435D, "NuLEDs, Inc." },

28068 { 0xB04414, "New H3C Technologies Co., Ltd" },

28069 { 0xB0449C, "Assa Abloy AB - Yale" },

28070 { 0xB04502, "Huawei Device Co., Ltd." },

28071 { 0xB04515, "mira fitness,LLC." },

28072 { 0xB04519, "TCT mobile ltd" },

28073 { 0xB04530, "SKY UK LIMITED" },

28074 { 0xB04545, "YACOUB Automation GmbH" },

28075 { 0xB04692, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

28076 { 0xB046FC, "MitraStar Technology Corp." },

28077 { 0xB047BF, "Samsung Electronics Co.,Ltd" },

28078 { 0xB047E9, "Intel Corporate" },

28079 { 0xB0481A, "Apple, Inc." },

28080 { 0xB0487A, "TP-LINK TECHNOLOGIES CO.,LTD." },

28081 { 0xB0495F, "OMRON HEALTHCARE Co., Ltd." },

28082 { 0xB04A39, "Beijing Roborock Technology Co., Ltd." },

28083 { 0xB04A6A, "Samsung Electronics Co.,Ltd" },

28084 { 0xB04AB4, "Motorola Mobility LLC, a Lenovo Company" },

28085 { 0xB04B68, "NAKAYO Inc" },

28086 { 0xB04BBF, "PT HAN SUNG ELECTORONICS INDONESIA" },

28087 { 0xB04C05, "Fresenius Medical Care Deutschland GmbH" },

28088 { 0xB04E26, "TP-LINK TECHNOLOGIES CO.,LTD." },

28089 { 0xB04F13, "Dell Inc." },

28090 { 0xB04FA6, "DongGuan Ramaxel Memory Technology" },

28091 { 0xB04FC3, "Shenzhen NVC Cloud Technology Co., Ltd." },

28092 { 0xB050BC, "SHENZHEN BASICOM ELECTRONIC CO.,LTD." },

28093 { 0xB0518E, "Holl technology CO.Ltd." },

28094 { 0xB05216, "Hon Hai Precision Ind. Co.,Ltd." },

28095 { 0xB05246, "NXP Semiconductor (Tianjin) LTD." },

28096 { 0xB05365, "China Mobile IOT Company Limited" },

28097 { 0xB05476, "Samsung Electronics Co.,Ltd" },

28098 { 0xB05508, "HUAWEI TECHNOLOGIES CO.,LTD" },

28099 { 0xB05706, "Vallox Oy" },

28100 { 0xB058C4, "Broadcast Microwave Services, Inc" },

28101 { 0xB05947, "Shenzhen Qihu Intelligent Technology Company Limited" },

28102 { 0xB05ADA, "Hewlett Packard" },

28103 { 0xB05B1F, "THERMO FISHER SCIENTIFIC S.P.A." },

28104 { 0xB05B67, "HUAWEI TECHNOLOGIES CO.,LTD" },

28105 { 0xB05B99, "Sagemcom Broadband SAS" },

28106 { 0xB05C16, "Fiberhome Telecommunication Technologies Co.,LTD" },

28107 { 0xB05CDA, "HP Inc." },

28108 { 0xB05CE5, "Nokia Corporation" },

28109 { 0xB05DD4, "ARRIS Group, Inc." },

28110 { 0xB06088, "Intel Corporate" },

28111 { 0xB061C7, "Ericsson-LG Enterprise" },

28112 { 0xB06563, "Shanghai Railway Communication Factory" },

28113 { 0xB065BD, "Apple, Inc." },

28114 { 0xB065F1, "WIO Manufacturing HK Limited" },

28115 { 0xB0672F, "Bowers & Wilkins" },

28116 { 0xB067B5, "Apple, Inc." },

28117 { 0xB068B6, "Hangzhou OYE Technology Co. Ltd" },

28118 { 0xB068E6, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

28119 { 0xB06971, "DEI Sales, Inc." },

28120 { 0xB06A41, "Google, Inc." },

28121 { 0xB06BB3, "GRT" },

28122 { 0xB06CBF, "3ality Digital Systems GmbH" },

28123 { 0xB06E72, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

28124 { 0xB06EBF, "ASUSTek COMPUTER INC." },

28125 { 0xB06FE0, "Samsung Electronics Co.,Ltd" },

28126 { 0xB0700D, "Nokia" },

28127 { 0xB0702D, "Apple, Inc." },

28128 { 0xB072BF, "Murata Manufacturing Co., Ltd." },

28129 { 0xB0735D, "Huawei Device Co., Ltd." },

28130 { 0xB0739C, "Amazon Technologies Inc." },

28131 { 0xB0750C, "QA Cafe" },

28132 { 0xB0754D, "Nokia" },

28133 { 0xB075D5, "zte corporation" },

28134 { 0xB0761B, "HUAWEI TECHNOLOGIES CO.,LTD" },

28135 { 0xB077AC, "ARRIS Group, Inc." },

28136 { 0xB07839, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

28137 { 0xB07870, "Wi-NEXT, Inc." },

28138 { 0xB078F0, "Beijing HuaqinWorld Technology Co.,Ltd." },

28139 { 0xB07908, "Cummings Engineering" },

28140 { 0xB0793C, "Revolv Inc" },

28141 { 0xB07994, "Motorola Mobility LLC, a Lenovo Company" },

28142 { 0xB07B25, "Dell Inc." },

28143 { 0xB07D47, "Cisco Systems, Inc" },

28144 { 0xB07D62, "Dipl.-Ing. H. Horstmann GmbH" },

28145 { 0xB07D64, "Intel Corporate" },

28146 { 0xB07E11, "Texas Instruments" },

28147 { 0xB07E70, "Zadara Storage Ltd." },

28148 { 0xB07FB9, "NETGEAR" },

28149 { 0xB0808C, "Laser Light Engines" },

28150 { 0xB08101, "Honor Device Co., Ltd." },

28151 { 0xB081D8, "I-sys Corp" },

28152 { 0xB083D6, "ARRIS Group, Inc." },

28153 { 0xB083FE, "Dell Inc." },

28154 { 0xB0869E, "Chloride S.r.L" },

28155 { 0xB08807, "Strata Worldwide" },

28156 { 0xB08900, "HUAWEI TECHNOLOGIES CO.,LTD" },

28157 { 0xB08991, "LGE" },

28158 { 0xB089C2, "Zyptonite" },

28159 { 0xB08B92, "zte corporation" },

28160 { 0xB08B9E, "Telechips, Inc." },

28161 { 0xB08BBE, "ABL GmbH" },

28162 { 0xB08BCF, "Cisco Systems, Inc" },

28163 { 0xB08BD0, "Cisco Systems, Inc" },

28164 { 0xB08C75, "Apple, Inc." },

28165 { 0xB08D57, "Cisco Systems, Inc" },

28166 { 0xB08E1A, "URadio Systems Co., Ltd" },

28167 { 0xB09074, "Fulan Electronics Limited" },

28168 { 0xB0907E, "Cisco Systems, Inc" },

28169 { 0xB090D4, "Shenzhen Hoin Internet Technology Co., Ltd" },

28170 { 0xB09122, "Texas Instruments" },

28171 { 0xB09134, "Taleo" },

28172 { 0xB09137, "ISis ImageStream Internet Solutions, Inc" },

28173 { 0xB0935B, "ARRIS Group, Inc." },

28174 { 0xB09575, "TP-LINK TECHNOLOGIES CO.,LTD." },

28175 { 0xB0958E, "TP-LINK TECHNOLOGIES CO.,LTD." },

28176 { 0xB0966C, "Lanbowan Technology Ltd." },

28177 { 0xB096EA, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

28178 { 0xB09738, "Shenzhen Skyworth Digital Technology CO., Ltd" },

28179 { 0xB0973A, "E-Fuel Corporation" },

28180 { 0xB0982B, "Sagemcom Broadband SAS" },

28181 { 0xB0989F, "LG CNS" },

28182 { 0xB098BC, "Huawei Device Co., Ltd." },

28183 { 0xB09928, "FUJITSU LIMITED" },

28184 { 0xB0995A, "HUAWEI TECHNOLOGIES CO.,LTD" },

28185 { 0xB099D7, "Samsung Electronics Co.,Ltd" },

28186 { 0xB09AE2, "STEMMER IMAGING GmbH" },

28187 { 0xB09BD4, "GNH Software India Private Limited" },

28188 { 0xB09C63, "Xiaomi Communications Co Ltd" },

28189 { 0xB09E1B, "Butlr Technologies, Inc." },

28190 { 0xB09FBA, "Apple, Inc." },

28191 { 0xB0A10A, "Pivotal Systems Corporation" },

28192 { 0xB0A2E7, "Shenzhen TINNO Mobile Technology Corp." },

28193 { 0xB0A37E, "QING DAO HAIER TELECOM CO.,LTD." },

28194 { 0xB0A3F2, "Huaqin Technology Co. LTD" },

28195 { 0xB0A454, "Tripwire Inc." },

28196 { 0xB0A460, "Intel Corporate" },

28197 { 0xB0A4F0, "HUAWEI TECHNOLOGIES CO.,LTD" },

28198 { 0xB0A651, "Cisco Systems, Inc" },

28199 { 0xB0A6F5, "Xaptum, Inc." },

28200 { 0xB0A72A, "Ensemble Designs, Inc." },

28201 { 0xB0A732, "Espressif Inc." },

28202 { 0xB0A737, "Roku, Inc." },

28203 { 0xB0A7B9, "TP-Link Corporation Limited" },

28204 { 0xB0A86E, "Juniper Networks" },

28205 { 0xB0AA36, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

28206 { 0xB0AA77, "Cisco Systems, Inc" },

28207 { 0xB0AAD2, "Sichuan tianyi kanghe communications co., LTD" },

28208 { 0xB0ACD2, "zte corporation" },

28209 { 0xB0ACFA, "FUJITSU LIMITED" },

28210 { 0xB0ADAA, "Avaya Inc" },

28211 { 0xB0AE25, "Varikorea" },

28212 { 0xB0AFF7, "Shenzhen Yipingfang Network Technology Co., Ltd." },

28213 { 0xB0B113, "Texas Instruments" },

28214 { 0xB0B194, "zte corporation" },

28215 { 0xB0B21C, "Espressif Inc." },

28216 { 0xB0B28F, "Sagemcom Broadband SAS" },

28217 { 0xB0B2DC, "Zyxel Communications Corporation" },

28218 { 0xB0B32B, "Slican Sp. z o.o." },

28219 { 0xB0B353, "IEEE Registration Authority" },

28220 { 0xB0B369, "Shenzhen SDMC Technology CO.,Ltd." },

28221 { 0xB0B3AD, "HUMAX Co., Ltd." },

28222 { 0xB0B448, "Texas Instruments" },

28223 { 0xB0B5C3, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

28224 { 0xB0B5E8, "Ruroc LTD" },

28225 { 0xB0B867, "Hewlett Packard Enterprise" },

28226 { 0xB0B8D5, "Nanjing Nengrui Auto Equipment CO.,Ltd" },

28227 { 0xB0B98A, "NETGEAR" },

28228 { 0xB0BB8B, "WAVETEL TECHNOLOGY LIMITED" },

28229 { 0xB0BBE5, "Sagemcom Broadband SAS" },

28230 { 0xB0BC7A, "Harman/Becker Automotive Systems GmbH" },

28231 { 0xB0BD1B, "Dongguan Liesheng Electronic Co., Ltd." },

28232 { 0xB0BD6D, "Echostreams Innovative Solutions" },

28233 { 0xB0BDA1, "ZAKLAD ELEKTRONICZNY SIMS" },

28234 { 0xB0BE76, "TP-LINK TECHNOLOGIES CO.,LTD." },

28235 { 0xB0BE83, "Apple, Inc." },

28236 { 0xB0BF99, "WIZITDONGDO" },

28237 { 0xB0C090, "Chicony Electronics Co., Ltd." },

28238 { 0xB0C128, "Adler ELREHA GmbH" },

28239 { 0xB0C19E, "zte corporation" },

28240 { 0xB0C205, "BIONIME" },

28241 { 0xB0C287, "Vantiva USA LLC" },

28242 { 0xB0C387, "GOEFER, Inc." },

28243 { 0xB0C38E, "Huawei Device Co., Ltd." },

28244 { 0xB0C46C, "Senseit" },

28245 { 0xB0C4E7, "Samsung Electronics Co.,Ltd" },

28246 { 0xB0C53C, "Cisco Systems, Inc" },

28247 { 0xB0C554, "D-Link International" },

28248 { 0xB0C559, "Samsung Electronics Co.,Ltd" },

28249 { 0xB0C5CA, "IEEE Registration Authority" },

28250 { 0xB0C69A, "Juniper Networks" },

28251 { 0xB0C745, "BUFFALO.INC" },

28252 { 0xB0C787, "HUAWEI TECHNOLOGIES CO.,LTD" },

28253 { 0xB0C7DE, "Silicon Laboratories" },

28254 { 0xB0C83F, "Jiangsu Cynray IOT Co., Ltd." },

28255 { 0xB0C8AD, "People Power Company" },

28256 { 0xB0C952, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

28257 { 0xB0C95B, "Beijing Symtech CO.,LTD" },

28258 { 0xB0CA68, "Apple, Inc." },

28259 { 0xB0CAE7, "Huawei Device Co., Ltd." },

28260 { 0xB0CCFE, "Huawei Device Co., Ltd." },

28261 { 0xB0CE18, "Zhejiang shenghui lighting co.,Ltd" },

28262 { 0xB0CF0E, "Mellanox Technologies, Inc." },

28263 { 0xB0CF4D, "MI-Zone Technology Ireland" },

28264 { 0xB0CFCB, "Amazon Technologies Inc." },

28265 { 0xB0D09C, "Samsung Electronics Co.,Ltd" },

28266 { 0xB0D278, "Texas Instruments" },

28267 { 0xB0D2F5, "Vello Systems, Inc." },

28268 { 0xB0D568, "Shenzhen Cultraview Digital Technology Co., Ltd" },

28269 { 0xB0D59D, "Shenzhen Zowee Technology Co., Ltd" },

28270 { 0xB0D5CC, "Texas Instruments" },

28271 { 0xB0D7C5, "Logipix Ltd" },

28272 { 0xB0D7CC, "Tridonic GmbH & Co KG" },

28273 { 0xB0D888, "Panasonic Automotive Systems Co.,Ltd" },

28274 { 0xB0DA00, "CERA ELECTRONIQUE" },

28275 { 0xB0DAF9, "ARRIS Group, Inc." },

28276 { 0xB0DCEF, "Intel Corporate" },

28277 { 0xB0DD74, "Heimgard Technologies AS" },

28278 { 0xB0DE28, "Apple, Inc." },

28279 { 0xB0DF3A, "Samsung Electronics Co.,Ltd" },

28280 { 0xB0DFC1, "Tenda Technology Co.,Ltd.Dongguan branch" },

28281 { 0xB0E03C, "TCT mobile ltd" },

28282 { 0xB0E17E, "HUAWEI TECHNOLOGIES CO.,LTD" },

28283 { 0xB0E235, "Xiaomi Communications Co Ltd" },

28284 { 0xB0E2E5, "Fiberhome Telecommunication Technologies Co.,LTD" },

28285 { 0xB0E39D, "CAT SYSTEM CO.,LTD." },

28286 { 0xB0E45C, "Samsung Electronics Co.,Ltd" },

28287 { 0xB0E4D5, "Google, Inc." },

28288 { 0xB0E50E, "NRG SYSTEMS INC" },

28289 { 0xB0E5ED, "HUAWEI TECHNOLOGIES CO.,LTD" },

28290 { 0xB0E5EF, "Apple, Inc." },

28291 { 0xB0E5F9, "Apple, Inc." },

28292 { 0xB0E71D, "Shanghai Maigantech Co.,Ltd" },

28293 { 0xB0E754, "2Wire Inc" },

28294 { 0xB0E7DE, "Homa Technologies JSC" },

28295 { 0xB0E892, "Seiko Epson Corporation" },

28296 { 0xB0E97E, "Advanced Micro Peripherals" },

28297 { 0xB0E9FE, "Woan Technology (Shenzhen) Co., Ltd." },

28298 { 0xB0EABC, "ASKEY COMPUTER CORP" },

28299 { 0xB0EB57, "HUAWEI TECHNOLOGIES CO.,LTD" },

28300 { 0xB0EB7F, "Juniper Networks" },

28301 { 0xB0EC71, "Samsung Electronics Co.,Ltd" },

28302 { 0xB0EC8F, "GMX SAS" },

28303 { 0xB0ECDD, "HUAWEI TECHNOLOGIES CO.,LTD" },

28304 { 0xB0ECE1, "Private" },

28305 { 0xB0EE45, "AzureWave Technology Inc." },

28306 { 0xB0EE7B, "Roku, Inc" },

28307 { 0xB0F00C, "Dongguan Wecxw CO.,Ltd." },

28308 { 0xB0F1A3, "Fengfan (BeiJing) Technology Co., Ltd." },

28309 { 0xB0F1BC, "Dhemax Ingenieros Ltda" },

28310 { 0xB0F1D8, "Apple, Inc." },

28311 { 0xB0F1EC, "AMPAK Technology, Inc." },

28312 { 0xB0F208, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

28313 { 0xB0F530, "Hitron Technologies. Inc" },

28314 { 0xB0F7C4, "Amazon Technologies Inc." },

28315 { 0xB0F893, "Shanghai MXCHIP Information Technology Co., Ltd." },

28316 { 0xB0F963, "Hangzhou H3C Technologies Co., Limited" },

28317 { 0xB0FA8B, "Huawei Device Co., Ltd." },

28318 { 0xB0FA91, "EM Microelectronic" },

28319 { 0xB0FAEB, "Cisco Systems, Inc" },

28320 { 0xB0FB15, "Laird Connectivity" },

28321 { 0xB0FBDD, "Shenzhen SuperElectron Technology Co.,Ltd." },

28322 { 0xB0FC0D, "Amazon Technologies Inc." },

28323 { 0xB0FC36, "CyberTAN Technology Inc." },

28324 { 0xB0FC88, "Sagemcom Broadband SAS" },

28325 { 0xB0FD0B, "IEEE Registration Authority" },

28326 { 0xB0FEBD, "Private" },

28327 { 0xB0FEE5, "Huawei Device Co., Ltd." },

28328 { 0xB0FF72, "IEEE Registration Authority" },

28329 { 0xB40016, "INGENICO TERMINALS SAS" },

28330 { 0xB4009C, "CableWorld Ltd." },

28331 { 0xB40142, "GCI Science & Technology Co.,LTD" },

28332 { 0xB40216, "Cisco Systems, Inc" },

28333 { 0xB402F2, "Synaptics, Inc" },

28334 { 0xB40418, "Smartchip Integrated Inc." },

28335 { 0xB40421, "zte corporation" },

28336 { 0xB4055D, "Inspur Electronic Information Industry Co.,Ltd." },

28337 { 0xB40566, "SP Best Corporation Co., LTD." },

28338 { 0xB405A1, "Xiaomi Communications Co Ltd" },

28339 { 0xB407F9, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

28340 { 0xB40832, "TC Communications" },

28341 { 0xB40931, "HUAWEI TECHNOLOGIES CO.,LTD" },

28342 { 0xB40AC6, "DEXON Systems Ltd." },

28343 { 0xB40AD8, "Sony Interactive Entertainment Inc." },

28344 { 0xB40B1D, "Samsung Electronics Co.,Ltd" },

28345 { 0xB40B44, "Smartisan Technology Co., Ltd." },

28346 { 0xB40B78, "Brusa Elektronik AG" },

28347 { 0xB40B7A, "Brusa Elektronik AG" },

28348 { 0xB40C25, "Palo Alto Networks" },

28349 { 0xB40E96, "HERAN" },

28350 { 0xB40ECF, "Bouffalo Lab (Nanjing) Co., Ltd." },

28351 { 0xB40EDC, "LG-Ericsson Co.,Ltd." },

28352 { 0xB40EDE, "Intel Corporate" },

28353 { 0xB40F3B, "Tenda Technology Co.,Ltd.Dongguan branch" },

28354 { 0xB40FB3, "vivo Mobile Communication Co., Ltd." },

28355 { 0xB4107B, "Texas Instruments" },

28356 { 0xB41489, "Cisco Systems, Inc" },

28357 { 0xB414E6, "HUAWEI TECHNOLOGIES CO.,LTD" },

28358 { 0xB41513, "HUAWEI TECHNOLOGIES CO.,LTD" },

28359 { 0xB4157E, "Celona Inc." },

28360 { 0xB41780, "DTI Group Ltd" },

28361 { 0xB417A8, "Meta Platforms Technologies, LLC" },

28362 { 0xB418D1, "Apple, Inc." },

28363 { 0xB41974, "Apple, Inc." },

28364 { 0xB41A1D, "Samsung Electronics Co.,Ltd" },

28365 { 0xB41BB0, "Apple, Inc." },

28366 { 0xB41C30, "zte corporation" },

28367 { 0xB41CAB, "ICR, inc." },

28368 { 0xB41D2B, "Shenzhen YOUHUA Technology Co., Ltd" },

28369 { 0xB41DEF, "Internet Laboratories, Inc." },

28370 { 0xB42046, "eero inc." },

28371 { 0xB4205B, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

28372 { 0xB4211D, "Beijing GuangXin Technology Co., Ltd" },

28373 { 0xB4218A, "Dog Hunter LLC" },

28374 { 0xB42200, "Brother Industries, LTD." },

28375 { 0xB42330, "Itron Inc" },

28376 { 0xB424E7, "Codetek Technology Co.,Ltd" },

28377 { 0xB4265D, "Taicang T&W Electronics" },

28378 { 0xB42875, "Futecho Solutions Private Limited" },

28379 { 0xB428F1, "E-Prime Co., Ltd." },

28380 { 0xB4293D, "Shenzhen Urovo Technology Co.,Ltd." },

28381 { 0xB42A0E, "Vantiva USA LLC" },

28382 { 0xB42A39, "ORBIT MERRET, spol. s r. o." },

28383 { 0xB42BB9, "HUAWEI TECHNOLOGIES CO.,LTD" },

28384 { 0xB42C92, "Zhejiang Weirong Electronic Co., Ltd" },

28385 { 0xB42CBE, "Direct Payment Solutions Limited" },

28386 { 0xB42D56, "Extreme Networks Headquarters" },

28387 { 0xB42E99, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

28388 { 0xB42EF8, "Eline Technology co.Ltd" },

28389 { 0xB43052, "HUAWEI TECHNOLOGIES CO.,LTD" },

28390 { 0xB430C0, "York Instruments Ltd" },

28391 { 0xB43161, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

28392 { 0xB431B8, "Aviwest" },

28393 { 0xB4346C, "MATSUNICHI DIGITAL TECHNOLOGY (HONG KONG) LIMITED" },

28394 { 0xB43522, "Silicon Laboratories" },

28395 { 0xB43564, "Fujian Tian Cheng Electron Science & Technical Development Co.,Ltd." },

28396 { 0xB435F7, "Zhejiang Pearmain Electronics Co.ltd." },

28397 { 0xB436A9, "Fibocom Wireless Inc." },

28398 { 0xB436D1, "Renesas Electronics (Penang) Sdn. Bhd." },

28399 { 0xB436E3, "KBVISION GROUP" },

28400 { 0xB43741, "Consert, Inc." },

28401 { 0xB437D1, "IEEE Registration Authority" },

28402 { 0xB437D8, "D-Link (Shanghai) Limited Corp." },

28403 { 0xB43934, "Pen Generations, Inc." },

28404 { 0xB43939, "Shenzhen TINNO Mobile Technology Corp." },

28405 { 0xB439D6, "ProCurve Networking by HP" },

28406 { 0xB43A28, "Samsung Electronics Co.,Ltd" },

28407 { 0xB43A31, "Silicon Laboratories" },

28408 { 0xB43AE2, "HUAWEI TECHNOLOGIES CO.,LTD" },

28409 { 0xB43D08, "GX International BV" },

28410 { 0xB43DB2, "Degreane Horizon" },

28411 { 0xB43E3B, "Viableware, Inc" },

28412 { 0xB440A4, "Apple, Inc." },

28413 { 0xB440DC, "Samsung Electronics Co.,Ltd" },

28414 { 0xB4417A, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

28415 { 0xB4430D, "Broadlink Pty Ltd" },

28416 { 0xB44326, "HUAWEI TECHNOLOGIES CO.,LTD" },

28417 { 0xB44506, "Dell Inc." },

28418 { 0xB4466B, "REALTIMEID AS" },

28419 { 0xB4475E, "Avaya Inc" },

28420 { 0xB447F5, "Earda Technologies co Ltd" },

28421 { 0xB44BD2, "Apple, Inc." },

28422 { 0xB44BD6, "IEEE Registration Authority" },

28423 { 0xB44C3B, "Zhejiang Dahua Technology Co., Ltd." },

28424 { 0xB44C90, "Cisco Systems, Inc" },

28425 { 0xB44CC2, "NR ELECTRIC CO., LTD" },

28426 { 0xB44D43, "IEEE Registration Authority" },

28427 { 0xB44F96, "Zhejiang Xinzailing Technology co., ltd" },

28428 { 0xB45062, "EmBestor Technology Inc." },

28429 { 0xB451F9, "NB Software" },

28430 { 0xB45253, "Seagate Technology" },

28431 { 0xB4527D, "Sony Corporation" },

28432 { 0xB4527E, "Sony Corporation" },

28433 { 0xB452A9, "Texas Instruments" },

28434 { 0xB45459, "China Mobile (Hangzhou) Information Technology Co., Ltd." },

28435 { 0xB45570, "Borea" },

28436 { 0xB4565D, "Chipsea Technologies (Shenzhen) Corp." },

28437 { 0xB456B9, "Teraspek Technologies Co.,Ltd" },

28438 { 0xB456E3, "Apple, Inc." },

28439 { 0xB456FA, "IOPSYS Software Solutions" },

28440 { 0xB457E6, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

28441 { 0xB45861, "CRemote, LLC" },

28442 { 0xB45CA4, "Thing-talk Wireless Communication Technologies Corporation Limited" },

28443 { 0xB45D50, "Aruba, a Hewlett Packard Enterprise Company" },

28444 { 0xB45F84, "zte corporation" },

28445 { 0xB46077, "Sichuan Changhong Electric Ltd." },

28446 { 0xB4608C, "Fiberhome Telecommunication Technologies Co.,LTD" },

28447 { 0xB460ED, "Beijing Xiaomi Mobile Software Co., Ltd" },

28448 { 0xB46142, "HUAWEI TECHNOLOGIES CO.,LTD" },

28449 { 0xB461E9, "Sichuan AI-Link Technology Co., Ltd." },

28450 { 0xB461FF, "Lumigon A/S" },

28451 { 0xB4622E, "Zhong Ge Smart Technology Co., Ltd." },

28452 { 0xB46238, "Exablox" },

28453 { 0xB46293, "Samsung Electronics Co.,Ltd" },

28454 { 0xB462AD, "Elysia Germany GmbH" },

28455 { 0xB4636F, "Nokia Solutions and Networks GmbH & Co. KG" },

28456 { 0xB46698, "Zealabs srl" },

28457 { 0xB467E9, "Qingdao GoerTek Technology Co., Ltd." },

28458 { 0xB46921, "Intel Corporate" },

28459 { 0xB4695F, "TCT mobile ltd" },

28460 { 0xB46AD4, "Edgecore Americas Networking Corporation" },

28461 { 0xB46BFC, "Intel Corporate" },

28462 { 0xB46C47, "Panasonic Appliances Company" },

28463 { 0xB46D35, "Dalian Seasky Automation Co;Ltd" },

28464 { 0xB46D83, "Intel Corporate" },

28465 { 0xB46DC2, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

28466 { 0xB46E08, "HUAWEI TECHNOLOGIES CO.,LTD" },

28467 { 0xB46F2D, "Wahoo Fitness" },

28468 { 0xB47064, "Samsung Electronics Co.,Ltd" },

28469 { 0xB47356, "Hangzhou Treebear Networking Co., Ltd." },

28470 { 0xB47443, "Samsung Electronics Co.,Ltd" },

28471 { 0xB47447, "CoreOS" },

28472 { 0xB4749F, "ASKEY COMPUTER CORP" },

28473 { 0xB4750E, "Belkin International Inc." },

28474 { 0xB47748, "Shenzhen Neoway Technology Co.,Ltd." },

28475 { 0xB47947, "Nutanix" },

28476 { 0xB479A7, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

28477 { 0xB479C8, "Ruckus Wireless" },

28478 { 0xB47AF1, "Hewlett Packard Enterprise" },

28479 { 0xB47C29, "Shenzhen Guzidi Technology Co.,Ltd" },

28480 { 0xB47C59, "Jiangsu Hengxin Technology Co.,Ltd." },

28481 { 0xB47C9C, "Amazon Technologies Inc." },

28482 { 0xB47D76, "KNS Group LLC" },

28483 { 0xB47F5E, "Foresight Manufacture (S) Pte Ltd" },

28484 { 0xB48107, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

28485 { 0xB481BF, "Meta-Networks, LLC" },

28486 { 0xB48255, "Research Products Corporation" },

28487 { 0xB4827B, "AKG Acoustics GmbH" },

28488 { 0xB482C5, "Relay2, Inc." },

28489 { 0xB482FE, "ASKEY COMPUTER CORP" },

28490 { 0xB48351, "Intel Corporate" },

28491 { 0xB484D5, "GooWi Wireless Technology Co., Limited" },

28492 { 0xB48547, "Amptown System Company GmbH" },

28493 { 0xB485E1, "Apple, Inc." },

28494 { 0xB48655, "HUAWEI TECHNOLOGIES CO.,LTD" },

28495 { 0xB48901, "HUAWEI TECHNOLOGIES CO.,LTD" },

28496 { 0xB48910, "Coster T.E. S.P.A." },

28497 { 0xB48A0A, "Espressif Inc." },

28498 { 0xB48A5F, "Juniper Networks" },

28499 { 0xB48B19, "Apple, Inc." },

28500 { 0xB48C9D, "AzureWave Technology Inc." },

28501 { 0xB4944E, "WeTelecom Co., Ltd." },

28502 { 0xB49691, "Intel Corporate" },

28503 { 0xB49842, "zte corporation" },

28504 { 0xB49882, "Brusa HyPower AG" },

28505 { 0xB4994C, "Texas Instruments" },

28506 { 0xB499BA, "Hewlett Packard" },

28507 { 0xB49A95, "Shenzhen Boomtech Industrial Corporation" },

28508 { 0xB49CDF, "Apple, Inc." },

28509 { 0xB49D02, "Samsung Electronics Co.,Ltd" },

28510 { 0xB49D0B, "BQ" },

28511 { 0xB49DB4, "Axion Technologies Inc." },

28512 { 0xB49DFD, "Shenzhen SDMC Technology CO.,Ltd." },

28513 { 0xB49E80, "Sichuan Changhong Electric Ltd." },

28514 { 0xB49EAC, "Imagik Int'l Corp" },

28515 { 0xB49EE6, "SHENZHEN TECHNOLOGY CO LTD" },

28516 { 0xB49F4D, "Fiberhome Telecommunication Technologies Co.,LTD" },

28517 { 0xB4A25C, "Cambium Networks Limited" },

28518 { 0xB4A2EB, "IEEE Registration Authority" },

28519 { 0xB4A305, "XIAMEN YAXON NETWORK CO., LTD." },

28520 { 0xB4A382, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

28521 { 0xB4A3BD, "Extreme Networks Headquarters" },

28522 { 0xB4A4B5, "Zen Eye Co.,Ltd" },

28523 { 0xB4A4E3, "Cisco Systems, Inc" },

28524 { 0xB4A5A9, "MODI GmbH" },

28525 { 0xB4A5AC, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

28526 { 0xB4A5EF, "Sercomm Corporation." },

28527 { 0xB4A678, "Zhejiang Tmall Technology Co., Ltd." },

28528 { 0xB4A7C6, "SERVERCOM (INDIA) PRIVATE LIMITED" },

28529 { 0xB4A828, "Shenzhen Concox Information Technology Co., Ltd" },

28530 { 0xB4A82B, "Histar Digital Electronics Co., Ltd." },

28531 { 0xB4A898, "Huawei Device Co., Ltd." },

28532 { 0xB4A8B9, "Cisco Systems, Inc" },

28533 { 0xB4A94F, "MERCURY CORPORATION" },

28534 { 0xB4A95A, "Avaya Inc" },

28535 { 0xB4A984, "Symantec Corporation" },

28536 { 0xB4A9FC, "Quanta Computer Inc." },

28537 { 0xB4A9FE, "GHIA Technology (Shenzhen) LTD" },

28538 { 0xB4AA4D, "Ensequence, Inc." },

28539 { 0xB4AB2C, "MtM Technology Corporation" },

28540 { 0xB4AC8C, "Bern University of Applied Sciences" },

28541 { 0xB4AC9D, "Texas Instruments" },

28542 { 0xB4ADA3, "Guangzhou Shiyuan Electronic Technology Company Limited" },

28543 { 0xB4AE2B, "Microsoft" },

28544 { 0xB4AE6F, "Circle Reliance, Inc DBA Cranberry Networks" },

28545 { 0xB4AEC1, "Apple, Inc." },

28546 { 0xB4B017, "Avaya Inc" },

28547 { 0xB4B024, "TP-Link Corporation Limited" },

28548 { 0xB4B055, "HUAWEI TECHNOLOGIES CO.,LTD" },

28549 { 0xB4B15A, "Siemens AG Energy Management Division" },

28550 { 0xB4B265, "DAEHO I&T" },

28551 { 0xB4B291, "LG Electronics" },

28552 { 0xB4B362, "zte corporation" },

28553 { 0xB4B384, "ShenZhen Figigantic Electronic Co.,Ltd" },

28554 { 0xB4B52F, "Hewlett Packard" },

28555 { 0xB4B542, "Hubbell Power Systems, Inc." },

28556 { 0xB4B5AF, "Minsung Electronics" },

28557 { 0xB4B5B6, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

28558 { 0xB4B676, "Intel Corporate" },

28559 { 0xB4B686, "Hewlett Packard" },

28560 { 0xB4B742, "Amazon Technologies Inc." },

28561 { 0xB4B859, "Texa Spa" },

28562 { 0xB4B88D, "Thuh Company" },

28563 { 0xB4B9E6, "eero inc." },

28564 { 0xB4BA02, "Agatel Ltd" },

28565 { 0xB4BA12, "China Mobile (Hangzhou) Information Technology Co.,Ltd." },

28566 { 0xB4BA9D, "SKY UK LIMITED" },

28567 { 0xB4BC7C, "Texas Instruments" },

28568 { 0xB4BFF6, "Samsung Electronics Co.,Ltd" },

28569 { 0xB4C0F5, "Shenzhen TINNO Mobile Technology Corp." },

28570 { 0xB4C170, "Yi chip Microelectronics (Hangzhou) Co., Ltd" },

28571 { 0xB4C26A, "Garmin International" },

28572 { 0xB4C2E0, "Bouffalo Lab (Nanjing) Co., Ltd." },

28573 { 0xB4C2F7, "Huawei Device Co., Ltd." },

28574 { 0xB4C44E, "VXL eTech Pvt Ltd" },

28575 { 0xB4C476, "Wuhan Maritime Communication Research Institute" },

28576 { 0xB4C4FC, "Xiaomi Communications Co Ltd" },

28577 { 0xB4C62E, "Molex CMS" },

28578 { 0xB4C6F8, "Axilspot Communication" },

28579 { 0xB4C799, "Extreme Networks Headquarters" },

28580 { 0xB4C810, "Umpi srl" },

28581 { 0xB4C9B9, "Sichuan AI-Link Technology Co., Ltd." },

28582 { 0xB4CB57, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

28583 { 0xB4CBB8, "Universal Electronics, Inc." },

28584 { 0xB4CC04, "Piranti" },

28585 { 0xB4CCE9, "PROSYST" },

28586 { 0xB4CD27, "HUAWEI TECHNOLOGIES CO.,LTD" },

28587 { 0xB4CDF5, "CUB ELECPARTS INC." },

28588 { 0xB4CE40, "Samsung Electronics Co.,Ltd" },

28589 { 0xB4CEF6, "HTC Corporation" },

28590 { 0xB4CEFE, "James Czekaj" },

28591 { 0xB4CFDB, "Shenzhen Jiuzhou Electric Co.,LTD" },

28592 { 0xB4CFE0, "Sichuan tianyi kanghe communications co., LTD" },

28593 { 0xB4D0A9, "China Mobile Group Device Co.,Ltd." },

28594 { 0xB4D135, "Cloudistics" },

28595 { 0xB4D286, "Telechips, Inc." },

28596 { 0xB4D5BD, "Intel Corporate" },

28597 { 0xB4D64E, "Caldero Limited" },

28598 { 0xB4D7DB, "New H3C Technologies Co., Ltd" },

28599 { 0xB4D8A9, "BetterBots" },

28600 { 0xB4D8DE, "iota Computing, Inc." },

28601 { 0xB4DB91, "CELESTICA INC." },

28602 { 0xB4DC09, "Guangzhou Dawei Communication Co.,Ltd" },

28603 { 0xB4DD15, "ControlThings Oy Ab" },

28604 { 0xB4DDD0, "Continental Automotive Hungary Kft" },

28605 { 0xB4DDE0, "Shanghai Amphenol Airwave Communication Electronics Co.,Ltd." },

28606 { 0xB4DE31, "Cisco Systems, Inc" },

28607 { 0xB4DEDF, "zte corporation" },

28608 { 0xB4DF3B, "Chromlech" },

28609 { 0xB4DF91, "Cisco Meraki" },

28610 { 0xB4DFFA, "Litemax Electronics Inc." },

28611 { 0xB4E01D, "CONCEPTION ELECTRONIQUE" },

28612 { 0xB4E0CD, "Fusion-io, Inc" },

28613 { 0xB4E10F, "Dell Inc." },

28614 { 0xB4E1C4, "Microsoft Mobile Oy" },

28615 { 0xB4E1EB, "Private" },

28616 { 0xB4E265, "Shenzhen SDMC Technology CO.,Ltd." },

28617 { 0xB4E3F9, "Silicon Laboratories" },

28618 { 0xB4E454, "Amazon Technologies Inc." },

28619 { 0xB4E46B, "China Mobile IOT Company Limited" },

28620 { 0xB4E54C, "LLC Elektra" },

28621 { 0xB4E62A, "LG Innotek" },

28622 { 0xB4E62D, "Espressif Inc." },

28623 { 0xB4E782, "Vivalnk" },

28624 { 0xB4E842, "Hong Kong Bouffalo Lab Limited" },

28625 { 0xB4E8C9, "XADA Technologies" },

28626 { 0xB4E9A3, "port industrial automation GmbH" },

28627 { 0xB4E9B0, "Cisco Systems, Inc" },

28628 { 0xB4EC02, "ALPSALPINE CO,.LTD" },

28629 { 0xB4ECF2, "Shanghai Listent Medical Tech Co., Ltd." },

28630 { 0xB4ECFF, "Wuhan IPG Technologies Co., Ltd." },

28631 { 0xB4ED19, "Pie Digital, Inc." },

28632 { 0xB4ED54, "Wohler Technologies" },

28633 { 0xB4EDD5, "Quectel Wireless Solutions Co.,Ltd." },

28634 { 0xB4EE25, "Shenzhen Belon Technology CO.,LTD" },

28635 { 0xB4EEB4, "ASKEY COMPUTER CORP" },

28636 { 0xB4EED4, "Texas Instruments" },

28637 { 0xB4EF04, "DAIHAN Scientific Co., Ltd." },

28638 { 0xB4EF1C, "360 AI Technology Co.Ltd" },

28639 { 0xB4EF39, "Samsung Electronics Co.,Ltd" },

28640 { 0xB4EFFA, "Lemobile Information Technology (Beijing) Co., Ltd." },

28641 { 0xB4F0AB, "Apple, Inc." },

28642 { 0xB4F18C, "Huawei Device Co., Ltd." },

28643 { 0xB4F1DA, "LG Electronics (Mobile Communications)" },

28644 { 0xB4F267, "Compal Broadband Networks, Inc." },

28645 { 0xB4F2E8, "ARRIS Group, Inc." },

28646 { 0xB4F323, "PETATEL INC." },

28647 { 0xB4F58E, "HUAWEI TECHNOLOGIES CO.,LTD" },

28648 { 0xB4F61C, "Apple, Inc." },

28649 { 0xB4F7A1, "LG Electronics (Mobile Communications)" },

28650 { 0xB4F81E, "Kinova" },

28651 { 0xB4F949, "optilink networks pvt ltd" },

28652 { 0xB4F95D, "Juniper Networks" },

28653 { 0xB4FA48, "Apple, Inc." },

28654 { 0xB4FBE3, "AltoBeam (China) Inc." },

28655 { 0xB4FBE4, "Ubiquiti Inc" },

28656 { 0xB4FBF9, "HUAWEI TECHNOLOGIES CO.,LTD" },

28657 { 0xB4FC75, "SEMA Electronics(HK) CO.,LTD" },

28658 { 0xB4FE8C, "Centro Sicurezza Italia SpA" },

28659 { 0xB4FF98, "HUAWEI TECHNOLOGIES CO.,LTD" },

28660 { 0xB80018, "Htel" },

28661 { 0xB802A4, "Aeonsemi, Inc." },

28662 { 0xB80305, "Intel Corporate" },

28663 { 0xB80415, "Bayan Audio" },

28664 { 0xB805AB, "zte corporation" },

28665 { 0xB8060D, "Tuya Smart Inc." },

28666 { 0xB80716, "vivo Mobile Communication Co., Ltd." },

28667 { 0xB80756, "Cisco Meraki" },

28668 { 0xB808CF, "Intel Corporate" },

28669 { 0xB808D7, "HUAWEI TECHNOLOGIES CO.,LTD" },

28670 { 0xB8098A, "Apple, Inc." },

28671 { 0xB80B9D, "ROPEX Industrie-Elektronik GmbH" },

28672 { 0xB80BDA, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

28673 { 0xB810D4, "Masimo Corporation" },

28674 { 0xB8114B, "Cisco Systems, Inc" },

28675 { 0xB812DA, "LVSWITCHES INC." },

28676 { 0xB81332, "AMPAK Technology,Inc." },

28677 { 0xB813E9, "Trace Live Network" },

28678 { 0xB81413, "Keen High Holding(HK) Ltd." },

28679 { 0xB8144D, "Apple, Inc." },

28680 { 0xB8145C, "Huawei Device Co., Ltd." },

28681 { 0xB814DB, "OHSUNG" },

28682 { 0xB81619, "ARRIS Group, Inc." },

28683 { 0xB8165F, "LG Innotek" },

28684 { 0xB816DB, "CHANT SINCERE CO.,LTD" },

28685 { 0xB817C2, "Apple, Inc." },

28686 { 0xB8186F, "ORIENTAL MOTOR CO., LTD." },

28687 { 0xB81904, "Nokia Shanghai Bell Co., Ltd." },

28688 { 0xB81999, "Nesys" },

28689 { 0xB81DAA, "LG Electronics (Mobile Communications)" },

28690 { 0xB81EA4, "Liteon Technology Corporation" },

28691 { 0xB81F5E, "Apption Labs Limited" },

28692 { 0xB8208E, "Panasonic Connect Co., Ltd." },

28693 { 0xB820E7, "Guangzhou Horizontal Information & Network Integration Co. Ltd" },

28694 { 0xB8211C, "Apple, Inc." },

28695 { 0xB8224F, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

28696 { 0xB82410, "Magneti Marelli Slovakia s.r.o." },

28697 { 0xB8241A, "SWEDA INFORMATICA LTDA" },

28698 { 0xB824F0, "SOYO Technology Development Co., Ltd." },

28699 { 0xB8259A, "Thalmic Labs" },

28700 { 0xB825B5, "Trakm8 Ltd" },

28701 { 0xB8266C, "ANOV France" },

28702 { 0xB826D4, "Furukawa Industrial S.A. Produtos Elétricos" },

28703 { 0xB827C5, "Huawei Device Co., Ltd." },

28704 { 0xB827EB, "Raspberry Pi Foundation" },

28705 { 0xB8288B, "Parker Hannifin Manufacturing (UK) Ltd" },

28706 { 0xB829F7, "Blaster Tech" },

28707 { 0xB82A72, "Dell Inc." },

28708 { 0xB82AA9, "Apple, Inc." },

28709 { 0xB82ADC, "EFR Europäische Funk-Rundsteuerung GmbH" },

28710 { 0xB82B68, "Huawei Device Co., Ltd." },

28711 { 0xB82CA0, "Resideo" },

28712 { 0xB82D28, "AMPAK Technology,Inc." },

28713 { 0xB82FCB, "CMS Electracom" },

28714 { 0xB830A8, "Road-Track Telematics Development" },

28715 { 0xB831B5, "Microsoft Corporation" },

28716 { 0xB83241, "Wuhan Tianyu Information Industry Co., Ltd." },

28717 { 0xB836D8, "Videoswitch" },

28718 { 0xB8374A, "Apple, Inc." },

28719 { 0xB83765, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

28720 { 0xB837B2, "Aruba, a Hewlett Packard Enterprise Company" },

28721 { 0xB83861, "Cisco Systems, Inc" },

28722 { 0xB838CA, "Kyokko Tsushin System CO.,LTD" },

28723 { 0xB838EF, "ADVA Optical Networking Ltd." },

28724 { 0xB83A08, "Tenda Technology Co.,Ltd.Dongguan branch" },

28725 { 0xB83A5A, "Aruba, a Hewlett Packard Enterprise Company" },

28726 { 0xB83A7B, "Worldplay (Canada) Inc." },

28727 { 0xB83A9D, "Alarm.com" },

28728 { 0xB83BAB, "Arcadyan Corporation" },

28729 { 0xB83BCC, "Xiaomi Communications Co Ltd" },

28730 { 0xB83C28, "Apple, Inc." },

28731 { 0xB83D4E, "Shenzhen Cultraview Digital Technology Co.,Ltd Shanghai Branch" },

28732 { 0xB83DF6, "Texas Instruments" },

28733 { 0xB83DFB, "Bouffalo Lab (Nanjing) Co., Ltd." },

28734 { 0xB83E59, "Roku, Inc." },

28735 { 0xB83FD2, "Mellanox Technologies, Inc." },

28736 { 0xB8415F, "ASP AG" },

28737 { 0xB841A4, "Apple, Inc." },

28738 { 0xB843E4, "Vlatacom" },

28739 { 0xB844AE, "TCT mobile ltd" },

28740 { 0xB844D9, "Apple, Inc." },

28741 { 0xB845F4, "New H3C Technologies Co., Ltd" },

28742 { 0xB8477A, "Dasan Electron Co., Ltd." },

28743 { 0xB847C6, "SanJet Technology Corp." },

28744 { 0xB848AA, "EM Microelectronic" },

28745 { 0xB8496D, "Apple, Inc." },

28746 { 0xB84C87, "IEEE Registration Authority" },

28747 { 0xB84D43, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

28748 { 0xB84DEE, "Hisense broadband multimedia technology Co.,Ltd" },

28749 { 0xB84FD5, "Microsoft Corporation" },

28750 { 0xB85001, "Extreme Networks Headquarters" },

28751 { 0xB850D8, "Beijing Xiaomi Mobile Software Co., Ltd" },

28752 { 0xB851A9, "Nokia" },

28753 { 0xB853AC, "Apple, Inc." },

28754 { 0xB85510, "Zioncom Electronics (Shenzhen) Ltd." },

28755 { 0xB85600, "HUAWEI TECHNOLOGIES CO.,LTD" },

28756 { 0xB856BD, "ITT LLC" },

28757 { 0xB85776, "lignex1" },

28758 { 0xB857D8, "Samsung Electronics Co.,Ltd" },

28759 { 0xB85810, "NUMERA, INC." },

28760 { 0xB8599F, "Mellanox Technologies, Inc." },

28761 { 0xB859C8, "70mai Co.,Ltd." },

28762 { 0xB859CE, "Earda Technologies co Ltd" },

28763 { 0xB85A73, "Samsung Electronics Co.,Ltd" },

28764 { 0xB85AF7, "Ouya, Inc" },

28765 { 0xB85AFE, "Handaer Communication Technology (Beijing) Co., Ltd" },

28766 { 0xB85CEE, "Baidu Online Network Technology (Beijing) Co., Ltd" },

28767 { 0xB85D0A, "Apple, Inc." },

28768 { 0xB85DC3, "HUAWEI TECHNOLOGIES CO.,LTD" },

28769 { 0xB85E71, "Vantiva USA LLC" },

28770 { 0xB85E7B, "Samsung Electronics Co.,Ltd" },

28771 { 0xB85F98, "Amazon Technologies Inc." },

28772 { 0xB85FB0, "HUAWEI TECHNOLOGIES CO.,LTD" },

28773 { 0xB86061, "China Mobile Group Device Co.,Ltd." },

28774 { 0xB86091, "Onnet Technologies and Innovations LLC" },

28775 { 0xB86142, "Beijing Tricolor Technology Co., Ltd" },

28776 { 0xB8616F, "Accton Technology Corp" },

28777 { 0xB8621F, "Cisco Systems, Inc" },

28778 { 0xB8634D, "Apple, Inc." },

28779 { 0xB86392, "GUANGDONG GENIUS TECHNOLOGY CO., LTD." },

28780 { 0xB863BC, "ROBOTIS, Co, Ltd" },

28781 { 0xB86491, "CK Telecom Ltd" },

28782 { 0xB8653B, "Bolymin, Inc." },

28783 { 0xB86685, "Sagemcom Broadband SAS" },

28784 { 0xB869C2, "Sunitec Enterprise Co., Ltd." },

28785 { 0xB869F4, "Routerboard.com" },

28786 { 0xB86A97, "Edgecore Networks Corporation" },

28787 { 0xB86AF1, "Sagemcom Broadband SAS" },

28788 { 0xB86B23, "Toshiba" },

28789 { 0xB86CE0, "Hewlett Packard Enterprise" },

28790 { 0xB86CE8, "Samsung Electronics Co.,Ltd" },

28791 { 0xB870F4, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

28792 { 0xB87424, "Viessmann Elektronik GmbH" },

28793 { 0xB87447, "Convergence Technologies" },

28794 { 0xB875C0, "PayPal, Inc." },

28795 { 0xB8763F, "Hon Hai Precision Ind. Co.,Ltd." },

28796 { 0xB877C3, "METER Group" },

28797 { 0xB87826, "Nintendo Co.,Ltd" },

28798 { 0xB8782E, "Apple, Inc." },

28799 { 0xB87879, "Roche Diagnostics GmbH" },

28800 { 0xB8797E, "Secure Meters (UK) Limited" },

28801 { 0xB87AC9, "Siemens Ltd." },

28802 { 0xB87BC5, "Apple, Inc." },

28803 { 0xB87BD4, "Google, Inc." },

28804 { 0xB87C6F, "NXP (China) Management Ltd." },

28805 { 0xB87CD0, "Huawei Device Co., Ltd." },

28806 { 0xB87CF2, "Extreme Networks Headquarters" },

28807 { 0xB87E39, "Motorola Mobility LLC, a Lenovo Company" },

28808 { 0xB87E40, "Huawei Device Co., Ltd." },

28809 { 0xB87EE5, "Intelbras" },

28810 { 0xB88035, "Shenzhen Qihu Intelligent Technology Company Limited" },

28811 { 0xB8804F, "Texas Instruments" },

28812 { 0xB88198, "Intel Corporate" },

28813 { 0xB881FA, "Apple, Inc." },

28814 { 0xB88303, "Hewlett Packard Enterprise" },

28815 { 0xB8857B, "HUAWEI TECHNOLOGIES CO.,LTD" },

28816 { 0xB88584, "Dell Inc." },

28817 { 0xB88687, "Liteon Technology Corporation" },

28818 { 0xB8871E, "Good Mind Industries Co., Ltd." },

28819 { 0xB8876E, "Intertech Services AG" },

28820 { 0xB887A8, "Step Ahead Innovations Inc." },

28821 { 0xB887C6, "Prudential Technology co.,LTD" },

28822 { 0xB888E3, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

28823 { 0xB88981, "Chengdu InnoThings Technology Co., Ltd." },

28824 { 0xB889CA, "ILJIN ELECTRIC Co., Ltd." },

28825 { 0xB88A60, "Intel Corporate" },

28826 { 0xB88A72, "Renesas Electronics (Penang) Sdn. Bhd." },

28827 { 0xB88AEC, "Nintendo Co.,Ltd" },

28828 { 0xB88C29, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

28829 { 0xB88D12, "Apple, Inc." },

28830 { 0xB88DF1, "Nanjing BigFish Semiconductor Co., Ltd." },

28831 { 0xB88E3A, "Infinite Technologies JLT" },

28832 { 0xB88E82, "Huawei Device Co., Ltd." },

28833 { 0xB88EC6, "Stateless Networks" },

28834 { 0xB88EDF, "Zencheer Communication Technology Co., Ltd." },

28835 { 0xB88F14, "Analytica GmbH" },

28836 { 0xB88F27, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

28837 { 0xB88FB4, "JABIL CIRCUIT ITALIA S.R.L" },

28838 { 0xB89047, "Apple, Inc." },

28839 { 0xB891C9, "Handreamnet" },

28840 { 0xB8921D, "BG T&A" },

28841 { 0xB89436, "HUAWEI TECHNOLOGIES CO.,LTD" },

28842 { 0xB89470, "Calix Inc." },

28843 { 0xB894D2, "Retail Innovation HTT AB" },

28844 { 0xB894D9, "Texas Instruments" },

28845 { 0xB894E7, "Xiaomi Communications Co Ltd" },

28846 { 0xB89674, "AllDSP GmbH & Co. KG" },

28847 { 0xB8975A, "BIOSTAR Microtech Int'l Corp." },

28848 { 0xB898AD, "Motorola Mobility LLC, a Lenovo Company" },

28849 { 0xB898B0, "Atlona Inc." },

28850 { 0xB898F7, "Gionee Communication Equipment Co,Ltd.ShenZhen" },

28851 { 0xB89919, "7signal Solutions, Inc" },

28852 { 0xB899AE, "Shenzhen MiaoMing Intelligent Technology Co.,Ltd" },

28853 { 0xB899B0, "Cohere Technologies" },

28854 { 0xB89A2A, "Intel Corporate" },

28855 { 0xB89A9A, "Xin Shi Jia Technology (Beijing) Co.,Ltd" },

28856 { 0xB89ACD, "ELITE OPTOELECTRONIC(ASIA)CO.,LTD" },

28857 { 0xB89AED, "OceanServer Technology, Inc" },

28858 { 0xB89BC9, "SMC Networks Inc" },

28859 { 0xB89BE4, "ABB Power Systems Power Generation" },

28860 { 0xB89EA6, "SPBEC-MINING CO.LTD" },

28861 { 0xB89F09, "Wistron Neweb Corporation" },

28862 { 0xB89FCC, "HUAWEI TECHNOLOGIES CO.,LTD" },

28863 { 0xB8A14A, "Raisecom Technology CO., LTD" },

28864 { 0xB8A175, "Roku, Inc." },

28865 { 0xB8A377, "Cisco Systems, Inc" },

28866 { 0xB8A386, "D-Link International" },

28867 { 0xB8A3E0, "BenRui Technology Co.,Ltd" },

28868 { 0xB8A44F, "Axis Communications AB" },

28869 { 0xB8A535, "Vantiva USA LLC" },

28870 { 0xB8A58D, "Axe Group Holdings Limited" },

28871 { 0xB8A75E, "Wuxi Xinjie Electric Co.,Ltd" },

28872 { 0xB8A825, "Samsung Electronics Co.,Ltd" },

28873 { 0xB8A8AF, "Logic S.p.A." },

28874 { 0xB8AB61, "Cisco Meraki" },

28875 { 0xB8AB62, "Hui Zhou Gaoshengda Technology Co.,LTD" },

28876 { 0xB8AC6F, "Dell Inc." },

28877 { 0xB8AD3E, "BLUECOM" },

28878 { 0xB8AE1C, "Smart Cube., Ltd" },

28879 { 0xB8AE1D, "Guangzhou Xingyi Electronic Technology Co.,Ltd" },

28880 { 0xB8AE6E, "Nintendo Co., Ltd." },

28881 { 0xB8AEED, "Elitegroup Computer Systems Co.,Ltd." },

28882 { 0xB8AF67, "Hewlett Packard" },

28883 { 0xB8B1C7, "BT&COM CO.,LTD" },

28884 { 0xB8B1EA, "Honor Device Co., Ltd." },

28885 { 0xB8B2EB, "Googol Technology (HK) Limited" },

28886 { 0xB8B2F7, "DRIMAES INC." },

28887 { 0xB8B2F8, "Apple, Inc." },

28888 { 0xB8B3DC, "DEREK (SHAOGUAN) LIMITED" },

28889 { 0xB8B409, "Samsung Electronics Co.,Ltd" },

28890 { 0xB8B42E, "Gionee Communication Equipment Co,Ltd.ShenZhen" },

28891 { 0xB8B77D, "Guangdong Transtek Medical Electronics CO.,Ltd" },

28892 { 0xB8B7D7, "2GIG Technologies" },

28893 { 0xB8B7DB, "GOIP Global Services Pvt. Ltd." },

28894 { 0xB8B7F1, "Wistron Neweb Corporation" },

28895 { 0xB8B81E, "Intel Corporate" },

28896 { 0xB8B94E, "Shenzhen iBaby Labs, Inc." },

28897 { 0xB8BA68, "Xi'an Jizhong Digital Communication Co.,Ltd" },

28898 { 0xB8BA72, "Cynove" },

28899 { 0xB8BB23, "Guangdong Nufront CSC Co., Ltd" },

28900 { 0xB8BB6D, "ENERES Co.,Ltd." },

28901 { 0xB8BBAF, "Samsung Electronics Co.,Ltd" },

28902 { 0xB8BC1B, "HUAWEI TECHNOLOGIES CO.,LTD" },

28903 { 0xB8BC5B, "Samsung Electronics Co.,Ltd" },

28904 { 0xB8BD79, "TrendPoint Systems" },

28905 { 0xB8BEBF, "Cisco Systems, Inc" },

28906 { 0xB8BEF4, "devolo AG" },

28907 { 0xB8BF83, "Intel Corporate" },

28908 { 0xB8C065, "Universal Electronics, Inc." },

28909 { 0xB8C111, "Apple, Inc." },

28910 { 0xB8C1A2, "Dragon Path Technologies Co., Limited" },

28911 { 0xB8C227, "PSTec" },

28912 { 0xB8C253, "Juniper Networks" },

28913 { 0xB8C385, "HUAWEI TECHNOLOGIES CO.,LTD" },

28914 { 0xB8C3BF, "Henan Chengshi NetWork Technology Co.，Ltd" },

28915 { 0xB8C46F, "PRIMMCON INDUSTRIES INC" },

28916 { 0xB8C68E, "Samsung Electronics Co.,Ltd" },

28917 { 0xB8C6AA, "Earda Technologies co Ltd" },

28918 { 0xB8C716, "Fiberhome Telecommunication Technologies Co.,LTD" },

28919 { 0xB8C74A, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

28920 { 0xB8C75D, "Apple, Inc." },

28921 { 0xB8C855, "Shanghai GBCOM Communication Technology Co.,Ltd." },

28922 { 0xB8C8EB, "ITEL MOBILE LIMITED" },

28923 { 0xB8C9B5, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

28924 { 0xB8CA04, "Holtek Semiconductor Inc." },

28925 { 0xB8CA3A, "Dell Inc." },

28926 { 0xB8CB29, "Dell Inc." },

28927 { 0xB8CD93, "Penetek, Inc" },

28928 { 0xB8CDA7, "Maxeler Technologies Ltd." },

28929 { 0xB8CEF6, "Mellanox Technologies, Inc." },

28930 { 0xB8D06F, "GUANGZHOU HKUST FOK YING TUNG RESEARCH INSTITUTE" },

28931 { 0xB8D0F0, "FCNT LMITED" },

28932 { 0xB8D309, "Cox Communications, Inc" },

28933 { 0xB8D43E, "vivo Mobile Communication Co., Ltd." },

28934 { 0xB8D49D, "M Seven System Ltd." },

28935 { 0xB8D4BC, "zte corporation" },

28936 { 0xB8D4E7, "Aruba, a Hewlett Packard Enterprise Company" },

28937 { 0xB8D50B, "Sunitec Enterprise Co.,Ltd" },

28938 { 0xB8D526, "Zyxel Communications Corporation" },

28939 { 0xB8D56B, "Mirka Ltd." },

28940 { 0xB8D61A, "Espressif Inc." },

28941 { 0xB8D6F6, "HUAWEI TECHNOLOGIES CO.,LTD" },

28942 { 0xB8D7AF, "Murata Manufacturing Co., Ltd." },

28943 { 0xB8D812, "IEEE Registration Authority" },

28944 { 0xB8D94D, "Sagemcom Broadband SAS" },

28945 { 0xB8D9CE, "Samsung Electronics Co.,Ltd" },

28946 { 0xB8DAE8, "Huawei Device Co., Ltd." },

28947 { 0xB8DAF1, "Strahlenschutz- Entwicklungs- und Ausruestungsgesellschaft mbH" },

28948 { 0xB8DAF7, "Advanced Photonics, Inc." },

28949 { 0xB8DB1C, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

28950 { 0xB8DB38, "Google, Inc." },

28951 { 0xB8DC87, "IAI Corporation" },

28952 { 0xB8DD71, "zte corporation" },

28953 { 0xB8DE5E, "LONGCHEER TELECOMMUNICATION LIMITED" },

28954 { 0xB8DF6B, "SpotCam Co., Ltd." },

28955 { 0xB8E3B1, "HUAWEI TECHNOLOGIES CO.,LTD" },

28956 { 0xB8E3EE, "Universal Electronics, Inc." },

28957 { 0xB8E589, "Payter BV" },

28958 { 0xB8E60C, "Apple, Inc." },

28959 { 0xB8E625, "2Wire Inc" },

28960 { 0xB8E779, "9Solutions Oy" },

28961 { 0xB8E856, "Apple, Inc." },

28962 { 0xB8E937, "Sonos, Inc." },

28963 { 0xB8EA98, "Xiaomi Communications Co Ltd" },

28964 { 0xB8EAAA, "ICG NETWORKS CO.,ltd" },

28965 { 0xB8ECA3, "Zyxel Communications Corporation" },

28966 { 0xB8EE0E, "Sagemcom Broadband SAS" },

28967 { 0xB8EE65, "Liteon Technology Corporation" },

28968 { 0xB8EE79, "YWire Technologies, Inc." },

28969 { 0xB8EF8B, "SHENZHEN CANNICE TECHNOLOGY CO.,LTD" },

28970 { 0xB8F009, "Espressif Inc." },

28971 { 0xB8F015, "Juniper Networks" },

28972 { 0xB8F080, "SPS, INC." },

28973 { 0xB8F0B9, "zte corporation" },

28974 { 0xB8F12A, "Apple, Inc." },

28975 { 0xB8F255, "Universal Electronics, Inc." },

28976 { 0xB8F317, "iSun Smasher Communications Private Limited" },

28977 { 0xB8F44F, "u-blox AG" },

28978 { 0xB8F4D0, "Herrmann Ultraschalltechnik GmbH & Co. Kg" },

28979 { 0xB8F5E7, "WayTools, LLC" },

28980 { 0xB8F653, "Shenzhen Jingxun Software Telecommunication Technology Co.,Ltd" },

28981 { 0xB8F6B1, "Apple, Inc." },

28982 { 0xB8F732, "Aryaka Networks Inc" },

28983 { 0xB8F74A, "RCNTEC" },

28984 { 0xB8F828, "Changshu Gaoshida Optoelectronic Technology Co. Ltd." },

28985 { 0xB8F853, "Arcadyan Corporation" },

28986 { 0xB8F883, "TP-LINK TECHNOLOGIES CO.,LTD." },

28987 { 0xB8F8BE, "BLUECOM" },

28988 { 0xB8F934, "Sony Corporation" },

28989 { 0xB8FBAF, "Xiamen IPRT Technology CO.,LTD" },

28990 { 0xB8FC28, "Valeo Vision Systems" },

28991 { 0xB8FC9A, "Le Shi Zhi Xin Electronic Technology (Tianjin) Limited" },

28992 { 0xB8FD32, "Zhejiang ROICX Microelectronics" },

28993 { 0xB8FF61, "Apple, Inc." },

28994 { 0xB8FF6F, "Shanghai Typrotech Technology Co.Ltd" },

28995 { 0xB8FFB3, "MitraStar Technology Corp." },

28996 { 0xB8FFFE, "Texas Instruments" },

28997 { 0xBC0004, "Fiberhome Telecommunication Technologies Co.,LTD" },

28998 { 0xBC0200, "Stewart Audio" },

28999 { 0xBC024A, "HMD Global Oy" },

29000 { 0xBC026E, "Silicon Laboratories" },

29001 { 0xBC0358, "Intel Corporate" },

29002 { 0xBC03A7, "MFP MICHELIN" },

29003 { 0xBC0543, "AVM GmbH" },

29004 { 0xBC062D, "Wacom Co.,Ltd." },

29005 { 0xBC091B, "Intel Corporate" },

29006 { 0xBC0963, "Apple, Inc." },

29007 { 0xBC09EB, "TECNO MOBILE LIMITED" },

29008 { 0xBC0DA5, "Texas Instruments" },

29009 { 0xBC0EAB, "Samsung Electronics Co.,Ltd" },

29010 { 0xBC0F2B, "FORTUNE TECHGROUP CO.,LTD" },

29011 { 0xBC0F64, "Intel Corporate" },

29012 { 0xBC0F9A, "D-Link International" },

29013 { 0xBC0FA7, "Ouster" },

29014 { 0xBC0FB7, "sywinkey HongKong Co,. Limited?" },

29015 { 0xBC0FF3, "HP Inc." },

29016 { 0xBC0FFE, "Juniper Networks" },

29017 { 0xBC102F, "SJI Industry Company" },

29018 { 0xBC107B, "Samsung Electronics Co.,Ltd" },

29019 { 0xBC125E, "Beijing WisVideo INC." },

29020 { 0xBC13A8, "Shenzhen YOUHUA Technology Co., Ltd" },

29021 { 0xBC1401, "Hitron Technologies. Inc" },

29022 { 0xBC1485, "Samsung Electronics Co.,Ltd" },

29023 { 0xBC14EF, "ITON Technology Limited" },

29024 { 0xBC1541, "Nokia" },

29025 { 0xBC15A6, "Taiwan Jantek Electronics,Ltd." },

29026 { 0xBC15AC, "Vodafone Italia S.p.A." },

29027 { 0xBC1665, "Cisco Systems, Inc" },

29028 { 0xBC1695, "zte corporation" },

29029 { 0xBC16F5, "Cisco Systems, Inc" },

29030 { 0xBC17B8, "Intel Corporate" },

29031 { 0xBC1896, "HUAWEI TECHNOLOGIES CO.,LTD" },

29032 { 0xBC1A67, "YF Technology Co., Ltd" },

29033 { 0xBC1AE4, "Huawei Device Co., Ltd." },

29034 { 0xBC1C81, "Sichuan iLink Technology Co., Ltd." },

29035 { 0xBC1D89, "Motorola Mobility LLC, a Lenovo Company" },

29036 { 0xBC1E85, "HUAWEI TECHNOLOGIES CO.,LTD" },

29037 { 0xBC1FE1, "Ascendent Technology Group" },

29038 { 0xBC20A4, "Samsung Electronics Co.,Ltd" },

29039 { 0xBC20BA, "Inspur (Shandong) Electronic Information Co., Ltd" },

29040 { 0xBC2228, "D-Link International" },

29041 { 0xBC2247, "New H3C Technologies Co., Ltd" },

29042 { 0xBC22FB, "RF Industries" },

29043 { 0xBC2392, "BYD Precision Manufacture Company Ltd." },

29044 { 0xBC2411, "Proxmox Server Solutions GmbH" },

29045 { 0xBC25E0, "HUAWEI TECHNOLOGIES CO.,LTD" },

29046 { 0xBC25F0, "3D Display Technologies Co., Ltd." },

29047 { 0xBC261D, "HONG KONG TECON TECHNOLOGY" },

29048 { 0xBC2643, "Elprotronic Inc." },

29049 { 0xBC26A1, "FACTORY FIVE Corporation" },

29050 { 0xBC26C7, "Cisco Systems, Inc" },

29051 { 0xBC282C, "e-Smart Systems Pvt. Ltd" },

29052 { 0xBC2846, "NextBIT Computing Pvt. Ltd." },

29053 { 0xBC28D6, "Rowley Associates Limited" },

29054 { 0xBC2B6B, "Beijing Haier IC Design Co.,Ltd" },

29055 { 0xBC2BD7, "Revogi Innovation Co., Ltd." },

29056 { 0xBC2C55, "Bear Flag Design, Inc." },

29057 { 0xBC2CE6, "Cisco Systems, Inc" },

29058 { 0xBC2D98, "ThinGlobal LLC" },

29059 { 0xBC2DEF, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

29060 { 0xBC2E48, "ARRIS Group, Inc." },

29061 { 0xBC2EF6, "Huawei Device Co., Ltd." },

29062 { 0xBC2F3D, "vivo Mobile Communication Co., Ltd." },

29063 { 0xBC305B, "Dell Inc." },

29064 { 0xBC307D, "Wistron Neweb Corporation" },

29065 { 0xBC307E, "Wistron Neweb Corporation" },

29066 { 0xBC30D9, "Arcadyan Corporation" },

29067 { 0xBC3198, "IEEE Registration Authority" },

29068 { 0xBC325F, "Zhejiang Dahua Technology Co., Ltd." },

29069 { 0xBC32B2, "Samsung Electronics Co.,Ltd" },

29070 { 0xBC3329, "Sony Interactive Entertainment Inc." },

29071 { 0xBC3340, "Cisco Meraki" },

29072 { 0xBC33AC, "Silicon Laboratories" },

29073 { 0xBC3400, "IEEE Registration Authority" },

29074 { 0xBC35E5, "Hydro Systems Company" },

29075 { 0xBC37D3, "Apple, Inc." },

29076 { 0xBC3865, "JWCNETWORKS" },

29077 { 0xBC38D2, "Pandachip Limited" },

29078 { 0xBC39A6, "CSUN System Technology Co.,LTD" },

29079 { 0xBC39D9, "Z-TEC" },

29080 { 0xBC3AEA, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

29081 { 0xBC3BAF, "Apple, Inc." },

29082 { 0xBC3D85, "HUAWEI TECHNOLOGIES CO.,LTD" },

29083 { 0xBC3E07, "Hitron Technologies. Inc" },

29084 { 0xBC3E13, "Accordance Systems Inc." },

29085 { 0xBC3ECB, "vivo Mobile Communication Co., Ltd." },

29086 { 0xBC3F4E, "Teleepoch Ltd" },

29087 { 0xBC3F8F, "HUAWEI TECHNOLOGIES CO.,LTD" },

29088 { 0xBC4100, "CODACO ELECTRONIC s.r.o." },

29089 { 0xBC4101, "Shenzhen TINNO Mobile Technology Corp." },

29090 { 0xBC428C, "ALPSALPINE CO,.LTD" },

29091 { 0xBC4377, "Hang Zhou Huite Technology Co.,ltd." },

29092 { 0xBC4434, "Shenzhen TINNO Mobile Technology Corp." },

29093 { 0xBC4486, "Samsung Electronics Co.,Ltd" },

29094 { 0xBC44B0, "Elastifile" },

29095 { 0xBC452E, "Knowledge Development for POF S.L." },

29096 { 0xBC455B, "Samsung Electronics Co.,Ltd" },

29097 { 0xBC458C, "Shenzhen Topwise Communication Co.,Ltd" },

29098 { 0xBC4699, "TP-LINK TECHNOLOGIES CO.,LTD." },

29099 { 0xBC4760, "Samsung Electronics Co.,Ltd" },

29100 { 0xBC49B2, "SHENZHEN ALONG COMMUNICATION TECH CO., LTD" },

29101 { 0xBC4A56, "Cisco Systems, Inc" },

29102 { 0xBC4B79, "SensingTek" },

29103 { 0xBC4C78, "HUAWEI TECHNOLOGIES CO.,LTD" },

29104 { 0xBC4CA0, "HUAWEI TECHNOLOGIES CO.,LTD" },

29105 { 0xBC4CC4, "Apple, Inc." },

29106 { 0xBC4DFB, "Hitron Technologies. Inc" },

29107 { 0xBC4E3C, "CORE STAFF CO., LTD." },

29108 { 0xBC4E5D, "ZhongMiao Technology Co., Ltd." },

29109 { 0xBC51FE, "Swann communications Pty Ltd" },

29110 { 0xBC5274, "Samsung Electronics Co.,Ltd" },

29111 { 0xBC52B4, "Nokia" },

29112 { 0xBC52B7, "Apple, Inc." },

29113 { 0xBC542F, "Intel Corporate" },

29114 { 0xBC5436, "Apple, Inc." },

29115 { 0xBC5451, "Samsung Electronics Co.,Ltd" },

29116 { 0xBC54F9, "Drogoo Technology Co., Ltd." },

29117 { 0xBC54FC, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

29118 { 0xBC5729, "Shenzhen KKM Co., Ltd" },

29119 { 0xBC5A56, "Cisco Systems, Inc" },

29120 { 0xBC5BD5, "ARRIS Group, Inc." },

29121 { 0xBC5C17, "Qingdao Intelligent&Precise Electronics Co.,Ltd." },

29122 { 0xBC5C4C, "ELECOM CO.,LTD." },

29123 { 0xBC5DA3, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

29124 { 0xBC5E33, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

29125 { 0xBC5EA1, "PsiKick, Inc." },

29126 { 0xBC5FF4, "ASRock Incorporation" },

29127 { 0xBC5FF6, "MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

29128 { 0xBC6010, "Qingdao Hisense Communications Co.,Ltd." },

29129 { 0xBC606B, "Shanghai Baud Data Communication Co.,Ltd." },

29130 { 0xBC60A7, "Sony Interactive Entertainment Inc." },

29131 { 0xBC6193, "Xiaomi Communications Co Ltd" },

29132 { 0xBC620E, "HUAWEI TECHNOLOGIES CO.,LTD" },

29133 { 0xBC629C, "zte corporation" },

29134 { 0xBC629F, "Telenet Systems P. Ltd." },

29135 { 0xBC62CE, "Netis Technology Co., Ltd." },

29136 { 0xBC62D2, "Genexis International B.V." },

29137 { 0xBC644B, "ARRIS Group, Inc." },

29138 { 0xBC64D9, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

29139 { 0xBC6641, "IEEE Registration Authority" },

29140 { 0xBC66DE, "Shadow Creator Information Technology Co.,Ltd." },

29141 { 0xBC671C, "Cisco Systems, Inc" },

29142 { 0xBC6778, "Apple, Inc." },

29143 { 0xBC6784, "Environics Oy" },

29144 { 0xBC69CB, "Panasonic Electric Works Networks Co., Ltd." },

29145 { 0xBC6A16, "tdvine" },

29146 { 0xBC6A29, "Texas Instruments" },

29147 { 0xBC6A2F, "Henge Docks LLC" },

29148 { 0xBC6A44, "Commend International GmbH" },

29149 { 0xBC6AD1, "Xiaomi Communications Co Ltd" },

29150 { 0xBC6B4D, "Nokia" },

29151 { 0xBC6BFF, "Guangzhou Shiyuan Electronic Technology Company Limited" },

29152 { 0xBC6C21, "Apple, Inc." },

29153 { 0xBC6D05, "Dusun Electron Co.,Ltd." },

29154 { 0xBC6E64, "Sony Corporation" },

29155 { 0xBC6E6D, "EM Microelectronic" },

29156 { 0xBC6E76, "Green Energy Options Ltd" },

29157 { 0xBC6EE2, "Intel Corporate" },

29158 { 0xBC71C1, "XTrillion, Inc." },

29159 { 0xBC72B1, "Samsung Electronics Co.,Ltd" },

29160 { 0xBC73A4, "ANDA TELECOM PVT LTD" },

29161 { 0xBC744B, "Nintendo Co.,Ltd" },

29162 { 0xBC74D7, "HangZhou JuRu Technology CO.,LTD" },

29163 { 0xBC7536, "ALPSALPINE CO,.LTD" },

29164 { 0xBC7574, "HUAWEI TECHNOLOGIES CO.,LTD" },

29165 { 0xBC7596, "Beijing Broadwit Technology Co., Ltd." },

29166 { 0xBC764E, "Rackspace US, Inc." },

29167 { 0xBC765E, "Samsung Electronics Co.,Ltd" },

29168 { 0xBC7670, "HUAWEI TECHNOLOGIES CO.,LTD" },

29169 { 0xBC76C5, "HUAWEI TECHNOLOGIES CO.,LTD" },

29170 { 0xBC7737, "Intel Corporate" },

29171 { 0xBC779F, "SBM Co., Ltd." },

29172 { 0xBC79AD, "Samsung Electronics Co.,Ltd" },

29173 { 0xBC7ABF, "Samsung Electronics Co.,Ltd" },

29174 { 0xBC7B72, "Huawei Device Co., Ltd." },

29175 { 0xBC7DD1, "Radio Data Comms" },

29176 { 0xBC7E8B, "Samsung Electronics Co.,Ltd" },

29177 { 0xBC7F7B, "Huawei Device Co., Ltd." },

29178 { 0xBC7FA4, "Xiaomi Communications Co Ltd" },

29179 { 0xBC811F, "Ingate Systems" },

29180 { 0xBC8199, "BASIC Co.,Ltd." },

29181 { 0xBC825D, "MITSUMI ELECTRIC CO.,LTD." },

29182 { 0xBC8385, "Microsoft Corporation" },

29183 { 0xBC83A7, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

29184 { 0xBC851F, "Samsung Electronics Co.,Ltd" },

29185 { 0xBC8529, "Jiangxi Remote lntelligence Technology Co.,Ltd" },

29186 { 0xBC8556, "Hon Hai Precision Ind. Co.,Ltd." },

29187 { 0xBC87FA, "Bose Corporation" },

29188 { 0xBC8893, "VILLBAU Ltd." },

29189 { 0xBC88C3, "Ningbo Dooya Mechanic & Electronic Technology Co., Ltd" },

29190 { 0xBC89A7, "Apple, Inc." },

29191 { 0xBC8AA3, "NHN Entertainment" },

29192 { 0xBC8AE8, "QING DAO HAIER TELECOM CO.,LTD." },

29193 { 0xBC8B55, "NPP ELIKS America Inc. DBA T&M Atlantic" },

29194 { 0xBC8CCD, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

29195 { 0xBC8D0E, "Nokia" },

29196 { 0xBC8D1F, "Cisco Systems, Inc" },

29197 { 0xBC903A, "Robert Bosch GmbH" },

29198 { 0xBC91B5, "Infinix mobility limited" },

29199 { 0xBC926B, "Apple, Inc." },

29200 { 0xBC9307, "Samsung Electronics Co.,Ltd" },

29201 { 0xBC9325, "Ningbo Joyson Preh Car Connect Co.,Ltd." },

29202 { 0xBC9680, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

29203 { 0xBC96E5, "SERCOMM PHILIPPINES INC" },

29204 { 0xBC9740, "IEEE Registration Authority" },

29205 { 0xBC9789, "Huawei Device Co., Ltd." },

29206 { 0xBC97E1, "Broadcom Limited" },

29207 { 0xBC9889, "Fiberhome Telecommunication Technologies Co.,LTD" },

29208 { 0xBC98DF, "Motorola Mobility LLC, a Lenovo Company" },

29209 { 0xBC9911, "Zyxel Communications Corporation" },

29210 { 0xBC9930, "HUAWEI TECHNOLOGIES CO.,LTD" },

29211 { 0xBC99BC, "FonSee Technology Inc." },

29212 { 0xBC9A53, "Huawei Device Co., Ltd." },

29213 { 0xBC9A8E, "HUMAX NETWORKS" },

29214 { 0xBC9B5E, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

29215 { 0xBC9B68, "Vantiva USA LLC" },

29216 { 0xBC9C31, "HUAWEI TECHNOLOGIES CO.,LTD" },

29217 { 0xBC9CC5, "Beijing Huafei Technology Co., Ltd." },

29218 { 0xBC9D42, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

29219 { 0xBC9D4E, "Shenzhen Skyworth Digital Technology CO., Ltd" },

29220 { 0xBC9DA5, "DASCOM Europe GmbH" },

29221 { 0xBC9E2C, "China Mobile Group Device Co.,Ltd." },

29222 { 0xBC9EBB, "Nintendo Co.,Ltd" },

29223 { 0xBC9FE4, "Aruba, a Hewlett Packard Enterprise Company" },

29224 { 0xBC9FEF, "Apple, Inc." },

29225 { 0xBCA042, "SHANGHAI FLYCO ELECTRICAL APPLIANCE CO.,LTD" },

29226 { 0xBCA13A, "SES-imagotag" },

29227 { 0xBCA37F, "Rail-Mil Sp. z o.o. Sp. K." },

29228 { 0xBCA4E1, "Nabto" },

29229 { 0xBCA511, "NETGEAR" },

29230 { 0xBCA58B, "Samsung Electronics Co.,Ltd" },

29231 { 0xBCA5A9, "Apple, Inc." },

29232 { 0xBCA8A6, "Intel Corporate" },

29233 { 0xBCA920, "Apple, Inc." },

29234 { 0xBCA993, "Cambium Networks Limited" },

29235 { 0xBCA9D6, "Cyber-Rain, Inc." },

29236 { 0xBCAB7C, "TRnP KOREA Co Ltd" },

29237 { 0xBCAD28, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

29238 { 0xBCAD90, "Kymeta Purchasing" },

29239 { 0xBCADAB, "Avaya Inc" },

29240 { 0xBCAEC5, "ASUSTek COMPUTER INC." },

29241 { 0xBCAF87, "smartAC.com, Inc." },

29242 { 0xBCAF91, "TE Connectivity Sensor Solutions" },

29243 { 0xBCB0E7, "HUAWEI TECHNOLOGIES CO.,LTD" },

29244 { 0xBCB181, "SHARP CORPORATION" },

29245 { 0xBCB1D3, "Cisco Meraki" },

29246 { 0xBCB1F3, "Samsung Electronics Co.,Ltd" },

29247 { 0xBCB22B, "EM-Tech" },

29248 { 0xBCB2CC, "Samsung Electronics Co.,Ltd" },

29249 { 0xBCB308, "HONGKONG RAGENTEK COMMUNICATION TECHNOLOGY CO.,LIMITED" },

29250 { 0xBCB6FB, "P4Q ELECTRONICS, S.L." },

29251 { 0xBCB852, "Cybera, Inc." },

29252 { 0xBCB863, "Apple, Inc." },

29253 { 0xBCB923, "Alta Networks" },

29254 { 0xBCBAC2, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

29255 { 0xBCBAE1, "AREC Inc." },

29256 { 0xBCBBC9, "Kellendonk Elektronik GmbH" },

29257 { 0xBCBC46, "SKS Welding Systems GmbH" },

29258 { 0xBCBD84, "zte corporation" },

29259 { 0xBCBD9E, "ITEL MOBILE LIMITED" },

29260 { 0xBCC00F, "Fiberhome Telecommunication Technologies Co.,LTD" },

29261 { 0xBCC168, "DinBox Sverige AB" },

29262 { 0xBCC23A, "Thomson Video Networks" },

29263 { 0xBCC31B, "Kygo Life A" },

29264 { 0xBCC342, "Panasonic Communications Co., Ltd." },

29265 { 0xBCC427, "HUAWEI TECHNOLOGIES CO.,LTD" },

29266 { 0xBCC493, "Cisco Systems, Inc" },

29267 { 0xBCC61A, "SPECTRA EMBEDDED SYSTEMS" },

29268 { 0xBCC6DB, "Nokia Corporation" },

29269 { 0xBCC746, "Hon Hai Precision IND.CO.,LTD" },

29270 { 0xBCC7DA, "Earda Technologies co Ltd" },

29271 { 0xBCC810, "Cisco SPVTG" },

29272 { 0xBCCAB5, "ARRIS Group, Inc." },

29273 { 0xBCCD45, "VOISMART" },

29274 { 0xBCCE25, "Nintendo Co.,Ltd" },

29275 { 0xBCCF4F, "Zyxel Communications Corporation" },

29276 { 0xBCCFCC, "HTC Corporation" },

29277 { 0xBCD074, "Apple, Inc." },

29278 { 0xBCD0EB, "New H3C Technologies Co., Ltd" },

29279 { 0xBCD11F, "Samsung Electronics Co.,Ltd" },

29280 { 0xBCD165, "Cisco SPVTG" },

29281 { 0xBCD177, "TP-LINK TECHNOLOGIES CO.,LTD." },

29282 { 0xBCD1D3, "Shenzhen TINNO Mobile Technology Corp." },

29283 { 0xBCD206, "HUAWEI TECHNOLOGIES CO.,LTD" },

29284 { 0xBCD295, "Cisco Systems, Inc" },

29285 { 0xBCD5B6, "d2d technologies" },

29286 { 0xBCD713, "Owl Labs" },

29287 { 0xBCD767, "BAE Systems Apllied Intelligence" },

29288 { 0xBCD7A5, "Aruba, a Hewlett Packard Enterprise Company" },

29289 { 0xBCD7CE, "China Mobile (Hangzhou) Information Technology Co., Ltd." },

29290 { 0xBCD7D4, "Roku, Inc" },

29291 { 0xBCD940, "ASR Co,.Ltd." },

29292 { 0xBCDB09, "Cisco Meraki" },

29293 { 0xBCDDC2, "Espressif Inc." },

29294 { 0xBCDF58, "Google, Inc." },

29295 { 0xBCE001, "Netis Technology Co., Ltd." },

29296 { 0xBCE09D, "Eoslink" },

29297 { 0xBCE143, "Apple, Inc." },

29298 { 0xBCE265, "HUAWEI TECHNOLOGIES CO.,LTD" },

29299 { 0xBCE59F, "WATERWORLD Technology Co.,LTD" },

29300 { 0xBCE63F, "Samsung Electronics Co.,Ltd" },

29301 { 0xBCE67C, "Cambium Networks Limited" },

29302 { 0xBCE712, "Cisco Systems, Inc" },

29303 { 0xBCE767, "Quanzhou TDX Electronics Co., Ltd" },

29304 { 0xBCE796, "Wireless CCTV Ltd" },

29305 { 0xBCE8FA, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

29306 { 0xBCE92F, "HP Inc." },

29307 { 0xBCE9E2, "Brocade Communications Systems LLC" },

29308 { 0xBCEA2B, "CityCom GmbH" },

29309 { 0xBCEA9C, "ITEL MOBILE LIMITED" },

29310 { 0xBCEAFA, "Hewlett Packard" },

29311 { 0xBCEB5F, "Fujian Beifeng Telecom Technology Co., Ltd." },

29312 { 0xBCEC23, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

29313 { 0xBCEC5D, "Apple, Inc." },

29314 { 0xBCECA0, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

29315 { 0xBCEE7B, "ASUSTek COMPUTER INC." },

29316 { 0xBCF171, "Intel Corporate" },

29317 { 0xBCF1F2, "Cisco Systems, Inc" },

29318 { 0xBCF292, "PLANTRONICS, INC." },

29319 { 0xBCF2AF, "devolo AG" },

29320 { 0xBCF310, "Extreme Networks Headquarters" },

29321 { 0xBCF45F, "zte corporation" },

29322 { 0xBCF499, "Rockwell Automation" },

29323 { 0xBCF4D4, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

29324 { 0xBCF5AC, "LG Electronics (Mobile Communications)" },

29325 { 0xBCF61C, "Geomodeling Wuxi Technology Co. Ltd." },

29326 { 0xBCF685, "D-Link International" },

29327 { 0xBCF730, "Samsung Electronics Co.,Ltd" },

29328 { 0xBCF811, "Xiamen DNAKE Technology Co.,Ltd" },

29329 { 0xBCF87E, "Arcadyan Corporation" },

29330 { 0xBCF88B, "zte corporation" },

29331 { 0xBCF9F2, "TEKO" },

29332 { 0xBCFAB8, "Guangzhou Shiyuan Electronic Technology Company Limited" },

29333 { 0xBCFAEB, "Cisco Systems, Inc" },

29334 { 0xBCFD0C, "Shenzhen Phaten Tech. LTD" },

29335 { 0xBCFE8C, "Altronic, LLC" },

29336 { 0xBCFED9, "Apple, Inc." },

29337 { 0xBCFF21, "Smart Code(shenzhen)Technology Co.,Ltd" },

29338 { 0xBCFF4D, "Espressif Inc." },

29339 { 0xBCFFAC, "TOPCON CORPORATION" },

29340 { 0xBCFFEB, "Motorola Mobility LLC, a Lenovo Company" },

29341 { 0xC0028D, "WINSTAR Display CO.,Ltd" },

29342 { 0xC00380, "Juniper Networks" },

29343 { 0xC005C2, "ARRIS Group, Inc." },

29344 { 0xC0060C, "HUAWEI TECHNOLOGIES CO.,LTD" },

29345 { 0xC006C3, "TP-Link Corporation Limited" },

29346 { 0xC0074A, "Brita GmbH" },

29347 { 0xC00D7E, "Additech, Inc." },

29348 { 0xC010B1, "HMD Global Oy" },

29349 { 0xC01173, "Samsung Electronics Co.,Ltd" },

29350 { 0xC011A6, "Fort-Telecom ltd." },

29351 { 0xC01242, "Alpha Security Products" },

29352 { 0xC0132B, "Sichuan Changhong Electric Ltd." },

29353 { 0xC0143D, "Hon Hai Precision Ind. Co.,Ltd." },

29354 { 0xC014B8, "Nokia" },

29355 { 0xC014FE, "Cisco Systems, Inc" },

29356 { 0xC01692, "China Mobile Group Device Co.,Ltd." },

29357 { 0xC01693, "Xiaomi Communications Co Ltd" },

29358 { 0xC0174D, "Samsung Electronics Co.,Ltd" },

29359 { 0xC01754, "Apple, Inc." },

29360 { 0xC01803, "HP Inc." },

29361 { 0xC01850, "Quanta Computer Inc." },

29362 { 0xC01885, "Hon Hai Precision Ind. Co.,Ltd." },

29363 { 0xC01ADA, "Apple, Inc." },

29364 { 0xC01B23, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

29365 { 0xC01C30, "Shenzhen WIFI-3L Technology Co.,Ltd" },

29366 { 0xC01E9B, "Pixavi AS" },

29367 { 0xC0210D, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

29368 { 0xC02250, "Koss Corporation" },

29369 { 0xC022F1, "IEEE Registration Authority" },

29370 { 0xC0238D, "Samsung Electronics Co.,Ltd" },

29371 { 0xC02506, "AVM GmbH" },

29372 { 0xC0252F, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

29373 { 0xC0255C, "Cisco Systems, Inc" },

29374 { 0xC02567, "Nexxt Solutions" },

29375 { 0xC025A2, "NEC Platforms, Ltd." },

29376 { 0xC025A5, "Dell Inc." },

29377 { 0xC025E9, "TP-LINK TECHNOLOGIES CO.,LTD." },

29378 { 0xC027B9, "Beijing National Railway Research & Design Institute of Signal & Communication Co., Ltd." },

29379 { 0xC0280B, "Honor Device Co., Ltd." },

29380 { 0xC0288D, "Logitech, Inc" },

29381 { 0xC02973, "Audyssey Laboratories Inc." },

29382 { 0xC029F3, "XySystem" },

29383 { 0xC02B31, "Phytium Technology Co.,Ltd." },

29384 { 0xC02B56, "CANDID OPTRONIX PRIVATE LIMITED" },

29385 { 0xC02BFC, "iNES. applied informatics GmbH" },

29386 { 0xC02C17, "Cisco Systems, Inc" },

29387 { 0xC02C5C, "Apple, Inc." },

29388 { 0xC02C7A, "Shenzhen Horn Audio Co.,Ltd." },

29389 { 0xC02DEE, "Cuff" },

29390 { 0xC02E25, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

29391 { 0xC02E26, "iRhythm Technologies, Inc." },

29392 { 0xC02FF1, "Volta Networks" },

29393 { 0xC0335E, "Microsoft" },

29394 { 0xC03379, "HUAWEI TECHNOLOGIES CO.,LTD" },

29395 { 0xC033DA, "Shenzhen JRUN Technologies CO., LTD" },

29396 { 0xC034B4, "Gigastone Corporation" },

29397 { 0xC03532, "Liteon Technology Corporation" },

29398 { 0xC03580, "A&R TECH" },

29399 { 0xC035BD, "Velocytech Aps" },

29400 { 0xC035C5, "Prosoft Systems LTD" },

29401 { 0xC03653, "eero inc." },

29402 { 0xC03656, "Fiberhome Telecommunication Technologies Co.,LTD" },

29403 { 0xC03896, "Hon Hai Precision Ind. Co.,Ltd." },

29404 { 0xC038F9, "Nokia Danmark A/S" },

29405 { 0xC03937, "GREE ELECTRIC APPLIANCES, INC. OF ZHUHAI" },

29406 { 0xC0395A, "Zhejiang Dahua Technology Co., Ltd." },

29407 { 0xC03B8F, "Minicom Digital Signage" },

29408 { 0xC03C04, "Sagemcom Broadband SAS" },

29409 { 0xC03C59, "Intel Corporate" },

29410 { 0xC03D03, "Samsung Electronics Co.,Ltd" },

29411 { 0xC03D46, "Shanghai Sango Network Technology Co.,Ltd" },

29412 { 0xC03DD9, "MitraStar Technology Corp." },

29413 { 0xC03E0F, "SKY UK LIMITED" },

29414 { 0xC03E50, "HUAWEI TECHNOLOGIES CO.,LTD" },

29415 { 0xC03EBA, "Dell Inc." },

29416 { 0xC03F0E, "NETGEAR" },

29417 { 0xC03F2A, "Biscotti, Inc." },

29418 { 0xC03FBB, "Zhongshan Zhiniu Electronics Co.,Ltd." },

29419 { 0xC03FD5, "Elitegroup Computer Systems Co.,Ltd." },

29420 { 0xC03FDD, "HUAWEI TECHNOLOGIES CO.,LTD" },

29421 { 0xC04004, "Medicaroid Corporation" },

29422 { 0xC04121, "Nokia Solutions and Networks GmbH & Co. KG" },

29423 { 0xC041F6, "LG ELECTRONICS INC" },

29424 { 0xC042D0, "Juniper Networks" },

29425 { 0xC04301, "Epec Oy" },

29426 { 0xC04442, "Apple, Inc." },

29427 { 0xC044E3, "Shenzhen Sinkna Electronics Co., LTD" },

29428 { 0xC04754, "vivo Mobile Communication Co., Ltd." },

29429 { 0xC04884, "Sigma Bilisim Sist. Tekn. Elk. Enj. ve San. D??. Tic. Ltd. ?ti." },

29430 { 0xC048E6, "Samsung Electronics Co.,Ltd" },

29431 { 0xC048FB, "Shenzhen JingHanDa Electronics Co.Ltd" },

29432 { 0xC0493D, "MAITRISE TECHNOLOGIQUE" },

29433 { 0xC04943, "zte corporation" },

29434 { 0xC049EF, "Espressif Inc." },

29435 { 0xC04A00, "TP-LINK TECHNOLOGIES CO.,LTD." },

29436 { 0xC04A09, "Zhejiang Everbright Communication Equip. Co,. Ltd" },

29437 { 0xC04B13, "WonderSound Technology Co., Ltd" },

29438 { 0xC04DF7, "SERELEC" },

29439 { 0xC04E30, "Espressif Inc." },

29440 { 0xC04E8A, "HUAWEI TECHNOLOGIES CO.,LTD" },

29441 { 0xC05064, "SHENNAN CIRCUITS CO.,LTD" },

29442 { 0xC0515C, "zte corporation" },

29443 { 0xC0517E, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

29444 { 0xC05336, "Beijing National Railway Research & Design Institute of Signal & Communication Group Co..Ltd." },

29445 { 0xC05627, "Belkin International Inc." },

29446 { 0xC056E3, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

29447 { 0xC057BC, "Avaya Inc" },

29448 { 0xC058A7, "Pico Systems Co., Ltd." },

29449 { 0xC05B44, "Beijing Xiaomi Mobile Software Co., Ltd" },

29450 { 0xC05D39, "Jiangsu Huitong Group Co.,Ltd." },

29451 { 0xC05E6F, "V. Stonkaus firma Kodinis Raktas" },

29452 { 0xC05E79, "SHENZHEN HUAXUN ARK TECHNOLOGIES CO.,LTD" },

29453 { 0xC05F87, "Legrand INTELLIGENT ELECTRICAL(HUIZHOU)CO.,LTD." },

29454 { 0xC06118, "TP-LINK TECHNOLOGIES CO.,LTD." },

29455 { 0xC0613D, "BioIntelliSense, Inc." },

29456 { 0xC0619A, "IEEE Registration Authority" },

29457 { 0xC0626B, "Cisco Systems, Inc" },

29458 { 0xC06369, "BINXIN TECHNOLOGY(ZHEJIANG) LTD." },

29459 { 0xC06380, "Texas Instruments" },

29460 { 0xC06394, "Apple, Inc." },

29461 { 0xC064C6, "Nokia Corporation" },

29462 { 0xC064E4, "Cisco Systems, Inc" },

29463 { 0xC06599, "Samsung Electronics Co.,Ltd" },

29464 { 0xC067AF, "Cisco Systems, Inc" },

29465 { 0xC068CC, "Shenzhen Skyworth Digital Technology CO., Ltd" },

29466 { 0xC06911, "Arista Networks" },

29467 { 0xC06B55, "Motorola Mobility LLC, a Lenovo Company" },

29468 { 0xC06C0F, "Dobbs Stanford" },

29469 { 0xC06C6D, "MagneMotion, Inc." },

29470 { 0xC06D1A, "Tianjin Henxinhuifeng Technology Co.,Ltd." },

29471 { 0xC06DED, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

29472 { 0xC07009, "HUAWEI TECHNOLOGIES CO.,LTD" },

29473 { 0xC071AA, "ShenZhen OnMicro Electronics Co.,Ltd." },

29474 { 0xC0742B, "SHENZHEN XUNLONG SOFTWARE CO.,LIMITED" },

29475 { 0xC074AD, "Grandstream Networks, Inc." },

29476 { 0xC07831, "Huawei Device Co., Ltd." },

29477 { 0xC07878, "FLEXTRONICS MANUFACTURING(ZHUHAI)CO.,LTD." },

29478 { 0xC07982, "TCL King Electrical Appliances(Huizhou)Co.,Ltd" },

29479 { 0xC07BBC, "Cisco Systems, Inc" },

29480 { 0xC07C90, "Shenzhen YOUHUA Technology Co., Ltd" },

29481 { 0xC07CD1, "PEGATRON CORPORATION" },

29482 { 0xC07E40, "SHENZHEN XDK COMMUNICATION EQUIPMENT CO.,LTD" },

29483 { 0xC08135, "Ningbo Forfan technology Co., LTD" },

29484 { 0xC08170, "Effigis GeoSolutions" },

29485 { 0xC0830A, "2Wire Inc" },

29486 { 0xC08359, "IEEE Registration Authority" },

29487 { 0xC083C9, "Huawei Device Co., Ltd." },

29488 { 0xC0847A, "Apple, Inc." },

29489 { 0xC0847D, "AMPAK Technology, Inc." },

29490 { 0xC08488, "Finis Inc" },

29491 { 0xC084E0, "HUAWEI TECHNOLOGIES CO.,LTD" },

29492 { 0xC0854C, "Ragentek Technology Group" },

29493 { 0xC086B3, "Shenzhen Voxtech Co., Ltd." },

29494 { 0xC087EB, "Samsung Electronics Co.,Ltd" },

29495 { 0xC0885B, "SnD Tech Co., Ltd." },

29496 { 0xC0886D, "Securosys SA" },

29497 { 0xC08997, "Samsung Electronics Co.,Ltd" },

29498 { 0xC089AB, "ARRIS Group, Inc." },

29499 { 0xC08ACD, "Guangzhou Shiyuan Electronic Technology Company Limited" },

29500 { 0xC08ADE, "Ruckus Wireless" },

29501 { 0xC08B05, "HUAWEI TECHNOLOGIES CO.,LTD" },

29502 { 0xC08B2A, "Cisco Systems, Inc" },

29503 { 0xC08B6F, "S I Sistemas Inteligentes Eletrônicos Ltda" },

29504 { 0xC08C60, "Cisco Systems, Inc" },

29505 { 0xC08C71, "Motorola Mobility LLC, a Lenovo Company" },

29506 { 0xC08D51, "Amazon Technologies Inc." },

29507 { 0xC08F20, "Shenzhen Skyworth Digital Technology CO., Ltd" },

29508 { 0xC09120, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

29509 { 0xC09132, "Patriot Memory" },

29510 { 0xC09134, "ProCurve Networking by HP" },

29511 { 0xC091B9, "Amazon Technologies Inc." },

29512 { 0xC09296, "zte corporation" },

29513 { 0xC09435, "ARRIS Group, Inc." },

29514 { 0xC094AD, "zte corporation" },

29515 { 0xC0956D, "Apple, Inc." },

29516 { 0xC09573, "AIxLink" },

29517 { 0xC095DA, "NXP India Private Limited" },

29518 { 0xC09727, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

29519 { 0xC09879, "Acer Inc." },

29520 { 0xC098DA, "China Mobile IOT Company Limited" },

29521 { 0xC098E5, "University of Michigan" },

29522 { 0xC09A71, "XIAMEN MEITU MOBILE TECHNOLOGY CO.LTD" },

29523 { 0xC09AD0, "Apple, Inc." },

29524 { 0xC09BF4, "IEEE Registration Authority" },

29525 { 0xC09C04, "Shaanxi GuoLian Digital TV Technology Co.,Ltd." },

29526 { 0xC09C92, "COBY" },

29527 { 0xC09D26, "Topicon HK Lmd." },

29528 { 0xC09F05, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

29529 { 0xC09F42, "Apple, Inc." },

29530 { 0xC09F51, "SERNET (SUZHOU) TECHNOLOGIES CORPORATION" },

29531 { 0xC09FE1, "zte corporation" },

29532 { 0xC0A00D, "ARRIS Group, Inc." },

29533 { 0xC0A0BB, "D-Link International" },

29534 { 0xC0A0C7, "FAIRFIELD INDUSTRIES" },

29535 { 0xC0A0DE, "Multi Touch Oy" },

29536 { 0xC0A0E2, "Eden Innovations" },

29537 { 0xC0A1A2, "MarqMetrix" },

29538 { 0xC0A26D, "Abbott Point of Care" },

29539 { 0xC0A364, "3D Systems Massachusetts" },

29540 { 0xC0A36E, "SKY UK LIMITED" },

29541 { 0xC0A39E, "EarthCam, Inc." },

29542 { 0xC0A476, "Ruijie Networks Co.,LTD" },

29543 { 0xC0A53E, "Apple, Inc." },

29544 { 0xC0A5DD, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

29545 { 0xC0A5E8, "Intel Corporate" },

29546 { 0xC0A600, "Apple, Inc." },

29547 { 0xC0A66D, "Inspur Group Co., Ltd." },

29548 { 0xC0A8F0, "Adamson Systems Engineering" },

29549 { 0xC0A938, "HUAWEI TECHNOLOGIES CO.,LTD" },

29550 { 0xC0AA68, "OSASI Technos Inc." },

29551 { 0xC0AC54, "Sagemcom Broadband SAS" },

29552 { 0xC0AD97, "TECNO MOBILE LIMITED" },

29553 { 0xC0AEFD, "Shenzhen HC-WLAN Technology Co.,Ltd" },

29554 { 0xC0B101, "zte corporation" },

29555 { 0xC0B339, "Comigo Ltd." },

29556 { 0xC0B357, "Yoshiki Electronics Industry Ltd." },

29557 { 0xC0B3C8, "LLC NTC Rotek" },

29558 { 0xC0B47D, "Huawei Device Co., Ltd." },

29559 { 0xC0B5CD, "Huawei Device Co., Ltd." },

29560 { 0xC0B5D7, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

29561 { 0xC0B658, "Apple, Inc." },

29562 { 0xC0B6F9, "Intel Corporate" },

29563 { 0xC0B713, "Beijing Xiaoyuer Technology Co. Ltd." },

29564 { 0xC0B883, "Intel Corporate" },

29565 { 0xC0B8B1, "BitBox Ltd" },

29566 { 0xC0B8E6, "Ruijie Networks Co.,LTD" },

29567 { 0xC0BAE6, "Application Solutions (Safety and Security) Ltd" },

29568 { 0xC0BC9A, "HUAWEI TECHNOLOGIES CO.,LTD" },

29569 { 0xC0BD42, "ZPA Smart Energy a.s." },

29570 { 0xC0BDC8, "Samsung Electronics Co.,Ltd" },

29571 { 0xC0BDD1, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

29572 { 0xC0BFA7, "Juniper Networks" },

29573 { 0xC0BFAC, "Huawei Device Co., Ltd." },

29574 { 0xC0BFC0, "HUAWEI TECHNOLOGIES CO.,LTD" },

29575 { 0xC0C170, "Shenzhen SuperElectron Technology Co.,Ltd." },

29576 { 0xC0C1C0, "Cisco-Linksys, LLC" },

29577 { 0xC0C3B6, "Automatic Systems" },

29578 { 0xC0C4F9, "Qisda Corporation" },

29579 { 0xC0C520, "Ruckus Wireless" },

29580 { 0xC0C522, "ARRIS Group, Inc." },

29581 { 0xC0C569, "SHANGHAI LYNUC CNC TECHNOLOGY CO.,LTD" },

29582 { 0xC0C687, "Cisco SPVTG" },

29583 { 0xC0C70A, "Ruckus Wireless" },

29584 { 0xC0C946, "MITSUYA LABORATORIES INC." },

29585 { 0xC0C976, "Shenzhen TINNO Mobile Technology Corp." },

29586 { 0xC0C9E3, "TP-LINK TECHNOLOGIES CO.,LTD." },

29587 { 0xC0CB38, "Hon Hai Precision Ind. Co.,Ltd." },

29588 { 0xC0CBF1, "Mobiwire Mobiles (NingBo) Co., LTD" },

29589 { 0xC0CC42, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

29590 { 0xC0CCF8, "Apple, Inc." },

29591 { 0xC0CECD, "Apple, Inc." },

29592 { 0xC0CFA3, "Creative Electronics & Software, Inc." },

29593 { 0xC0D012, "Apple, Inc." },

29594 { 0xC0D026, "Huawei Device Co., Ltd." },

29595 { 0xC0D044, "Sagemcom Broadband SAS" },

29596 { 0xC0D063, "EM Microelectronic" },

29597 { 0xC0D0FF, "China Mobile IOT Company Limited" },

29598 { 0xC0D193, "Huawei Device Co., Ltd." },

29599 { 0xC0D2DD, "Samsung Electronics Co.,Ltd" },

29600 { 0xC0D2F3, "Hui Zhou Gaoshengda Technology Co.,LTD" },

29601 { 0xC0D391, "IEEE Registration Authority" },

29602 { 0xC0D3C0, "Samsung Electronics Co.,Ltd" },

29603 { 0xC0D46B, "Huawei Device Co., Ltd." },

29604 { 0xC0D60A, "Texas Instruments" },

29605 { 0xC0D682, "Arista Networks" },

29606 { 0xC0D7AA, "Arcadyan Corporation" },

29607 { 0xC0D834, "xvtec ltd" },

29608 { 0xC0D962, "ASKEY COMPUTER CORP" },

29609 { 0xC0D9F7, "ShanDong Domor Intelligent S&T CO.,Ltd" },

29610 { 0xC0DA74, "Hangzhou Sunyard Technology Co., Ltd." },

29611 { 0xC0DC6A, "Qingdao Eastsoft Communication Technology Co.,LTD" },

29612 { 0xC0DCD7, "Huawei Device Co., Ltd." },

29613 { 0xC0DCDA, "Samsung Electronics Co.,Ltd" },

29614 { 0xC0DD8A, "Meta Platforms Technologies, LLC" },

29615 { 0xC0DF77, "Conrad Electronic SE" },

29616 { 0xC0E018, "HUAWEI TECHNOLOGIES CO.,LTD" },

29617 { 0xC0E01C, "IoT Security Group, SL" },

29618 { 0xC0E1BE, "HUAWEI TECHNOLOGIES CO.,LTD" },

29619 { 0xC0E3A0, "Renesas Electronics (Penang) Sdn. Bhd." },

29620 { 0xC0E3FB, "HUAWEI TECHNOLOGIES CO.,LTD" },

29621 { 0xC0E422, "Texas Instruments" },

29622 { 0xC0E42D, "TP-LINK TECHNOLOGIES CO.,LTD." },

29623 { 0xC0E434, "AzureWave Technology Inc." },

29624 { 0xC0E54E, "ARIES Embedded GmbH" },

29625 { 0xC0E7BF, "Sichuan AI-Link Technology Co., Ltd." },

29626 { 0xC0E862, "Apple, Inc." },

29627 { 0xC0E911, "RealNetworks" },

29628 { 0xC0EAC3, "IEEE Registration Authority" },

29629 { 0xC0EAE4, "Sonicwall" },

29630 { 0xC0EDE5, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

29631 { 0xC0EE40, "Laird Connectivity" },

29632 { 0xC0EEB5, "Enice Network." },

29633 { 0xC0EEFB, "OnePlus Tech (Shenzhen) Ltd" },

29634 { 0xC0F1C4, "Pacidal Corporation Ltd." },

29635 { 0xC0F2FB, "Apple, Inc." },

29636 { 0xC0F4E6, "HUAWEI TECHNOLOGIES CO.,LTD" },

29637 { 0xC0F535, "AMPAK Technology,Inc." },

29638 { 0xC0F636, "Hangzhou Kuaiyue Technologies, Ltd." },

29639 { 0xC0F6C2, "HUAWEI TECHNOLOGIES CO.,LTD" },

29640 { 0xC0F6EC, "HUAWEI TECHNOLOGIES CO.,LTD" },

29641 { 0xC0F79D, "Powercode" },

29642 { 0xC0F827, "Rapidmax Technology Corporation" },

29643 { 0xC0F87F, "Cisco Systems, Inc" },

29644 { 0xC0F8DA, "Hon Hai Precision Ind. Co.,Ltd." },

29645 { 0xC0F945, "Toshiba Toko Meter Systems Co., LTD." },

29646 { 0xC0F991, "GME Standard Communications P/L" },

29647 { 0xC0F9B0, "HUAWEI TECHNOLOGIES CO.,LTD" },

29648 { 0xC0F9D2, "arkona technologies GmbH" },

29649 { 0xC0FBC1, "ITEL MOBILE LIMITED" },

29650 { 0xC0FBF9, "IEEE Registration Authority" },

29651 { 0xC0FD84, "zte corporation" },

29652 { 0xC0FFA8, "HUAWEI TECHNOLOGIES CO.,LTD" },

29653 { 0xC0FFD4, "NETGEAR" },

29654 { 0xC40006, "Lipi Data Systems Ltd." },

29655 { 0xC40049, "Kamama" },

29656 { 0xC400AD, "Advantech Technology (CHINA) Co., Ltd." },

29657 { 0xC40142, "MaxMedia Technology Limited" },

29658 { 0xC4017C, "Ruckus Wireless" },

29659 { 0xC401B1, "SeekTech INC" },

29660 { 0xC401CE, "PRESITION (2000) CO., LTD." },

29661 { 0xC402E1, "Khwahish Technologies Private Limited" },

29662 { 0xC403A8, "Intel Corporate" },

29663 { 0xC40415, "NETGEAR" },

29664 { 0xC4047B, "Shenzhen YOUHUA Technology Co., Ltd" },

29665 { 0xC404D8, "Aviva Links Inc." },

29666 { 0xC40528, "HUAWEI TECHNOLOGIES CO.,LTD" },

29667 { 0xC40683, "HUAWEI TECHNOLOGIES CO.,LTD" },

29668 { 0xC4072F, "HUAWEI TECHNOLOGIES CO.,LTD" },

29669 { 0xC40778, "New H3C Technologies Co., Ltd" },

29670 { 0xC4084A, "Nokia" },

29671 { 0xC40880, "Shenzhen UTEPO Tech Co., Ltd." },

29672 { 0xC40938, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

29673 { 0xC409B7, "Juniper Networks" },

29674 { 0xC40ACB, "Cisco Systems, Inc" },

29675 { 0xC40B31, "Apple, Inc." },

29676 { 0xC40BCB, "Xiaomi Communications Co Ltd" },

29677 { 0xC40D96, "HUAWEI TECHNOLOGIES CO.,LTD" },

29678 { 0xC40E45, "ACK Networks,Inc." },

29679 { 0xC40F09, "Hermes electronic GmbH" },

29680 { 0xC4108A, "Ruckus Wireless" },

29681 { 0xC411E0, "Bull Group Co., Ltd" },

29682 { 0xC41234, "Apple, Inc." },

29683 { 0xC412EC, "HUAWEI TECHNOLOGIES CO.,LTD" },

29684 { 0xC412F5, "D-Link International" },

29685 { 0xC413E2, "Extreme Networks Headquarters" },

29686 { 0xC41411, "Apple, Inc." },

29687 { 0xC4143C, "Cisco Systems, Inc" },

29688 { 0xC414A2, "Cisco Meraki" },

29689 { 0xC41688, "Huawei Device Co., Ltd." },

29690 { 0xC416C8, "HUAWEI TECHNOLOGIES CO.,LTD" },

29691 { 0xC416FA, "Prysm Inc" },

29692 { 0xC4170E, "Huawei Device Co., Ltd." },

29693 { 0xC417FE, "Hon Hai Precision Ind. Co.,Ltd." },

29694 { 0xC418E9, "Samsung Electronics Co.,Ltd" },

29695 { 0xC4198B, "Dominion Voting Systems Corporation" },

29696 { 0xC419D1, "Telink Semiconductor (Shanghai) Co., Ltd." },

29697 { 0xC419EC, "Qualisys AB" },

29698 { 0xC41C07, "Samsung Electronics Co.,Ltd" },

29699 { 0xC41C9C, "JiQiDao" },

29700 { 0xC41CFF, "Vizio, Inc" },

29701 { 0xC41ECE, "HMI Sources Ltd." },

29702 { 0xC421B9, "zte corporation" },

29703 { 0xC421C8, "KYOCERA CORPORATION" },

29704 { 0xC42360, "Intel Corporate" },

29705 { 0xC4237A, "WhizNets Inc." },

29706 { 0xC423A2, "PT. Emsonic Indonesia" },

29707 { 0xC4242E, "Galvanic Applied Sciences Inc" },

29708 { 0xC42456, "Palo Alto Networks" },

29709 { 0xC42628, "Airo Wireless" },

29710 { 0xC42728, "zte corporation" },

29711 { 0xC4278C, "Huawei Device Co., Ltd." },

29712 { 0xC42795, "Vantiva USA LLC" },

29713 { 0xC4282D, "Embedded Intellect Pty Ltd" },

29714 { 0xC4291D, "KLEMSAN ELEKTRIK ELEKTRONIK SAN.VE TIC.AS." },

29715 { 0xC42996, "Signify B.V." },

29716 { 0xC42AD0, "Apple, Inc." },

29717 { 0xC42B44, "Huawei Device Co., Ltd." },

29718 { 0xC42C03, "Apple, Inc." },

29719 { 0xC42C4F, "Qingdao Hisense Mobile Communication Technology Co,Ltd" },

29720 { 0xC42F90, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

29721 { 0xC43018, "MCS Logic Inc." },

29722 { 0xC430CA, "SD Biosensor" },

29723 { 0xC432D1, "Farlink Technology Limited" },

29724 { 0xC43306, "China Mobile Group Device Co.,Ltd." },

29725 { 0xC4345B, "HUAWEI TECHNOLOGIES CO.,LTD" },

29726 { 0xC4346B, "Hewlett Packard" },

29727 { 0xC435D9, "Apple, Inc." },

29728 { 0xC43655, "Shenzhen Fenglian Technology Co., Ltd." },

29729 { 0xC4366C, "LG Innotek" },

29730 { 0xC436C0, "BUFFALO.INC" },

29731 { 0xC436DA, "Rusteletech Ltd." },

29732 { 0xC43772, "Virtuozzo International GmbH" },

29733 { 0xC43875, "Sonos, Inc." },

29734 { 0xC438D3, "TAGATEC CO.,LTD" },

29735 { 0xC4393A, "SMC Networks Inc" },

29736 { 0xC43960, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

29737 { 0xC43A35, "FN-LINK TECHNOLOGY LIMITED" },

29738 { 0xC43A9F, "Siconix Inc." },

29739 { 0xC43ABE, "Sony Corporation" },

29740 { 0xC43C3C, "CYBELEC SA" },

29741 { 0xC43CB0, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

29742 { 0xC43CEA, "BUFFALO.INC" },

29743 { 0xC43D1A, "Intel Corporate" },

29744 { 0xC43DC7, "NETGEAR" },

29745 { 0xC43EAB, "Huawei Device Co., Ltd." },

29746 { 0xC44044, "RackTop Systems Inc." },

29747 { 0xC440F6, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

29748 { 0xC4411E, "Belkin International Inc." },

29749 { 0xC44137, "Quectel Wireless Solutions Co.,Ltd." },

29750 { 0xC44202, "Samsung Electronics Co.,Ltd" },

29751 { 0xC44268, "CRESTRON ELECTRONICS, INC." },

29752 { 0xC4438F, "LG Electronics (Mobile Communications)" },

29753 { 0xC4447D, "HUAWEI TECHNOLOGIES CO.,LTD" },

29754 { 0xC444A0, "Cisco Systems, Inc" },

29755 { 0xC44567, "SAMBON PRECISON and ELECTRONICS" },

29756 { 0xC445EC, "Shanghai Yali Electron Co.,LTD" },

29757 { 0xC44619, "Hon Hai Precision Ind. Co.,Ltd." },

29758 { 0xC4473F, "HUAWEI TECHNOLOGIES CO.,LTD" },

29759 { 0xC44838, "Satcom Direct, Inc." },

29760 { 0xC448FA, "Taicang T&W Electronics" },

29761 { 0xC449BB, "MITSUMI ELECTRIC CO.,LTD." },

29762 { 0xC44AD0, "FIREFLIES SYSTEMS" },

29763 { 0xC44B44, "Omniprint Inc." },

29764 { 0xC44BD1, "Wallys Communications Teachnologies Co.,Ltd." },

29765 { 0xC44D84, "Cisco Systems, Inc" },

29766 { 0xC44E1F, "BlueN" },

29767 { 0xC44EAC, "Shenzhen Shiningworth Technology Co., Ltd." },

29768 { 0xC44F33, "Espressif Inc." },

29769 { 0xC44F5F, "Huawei Device Co., Ltd." },

29770 { 0xC44F96, "Alps Alpine" },

29771 { 0xC45006, "Samsung Electronics Co.,Ltd" },

29772 { 0xC4509C, "Vantiva - Connected Home" },

29773 { 0xC4518D, "Shenzhen YOUHUA Technology Co., Ltd" },

29774 { 0xC4524F, "Apple, Inc." },

29775 { 0xC45379, "Micronview Limited Liability Company" },

29776 { 0xC45444, "Quanta Computer Inc." },

29777 { 0xC455A6, "Cadac Holdings Ltd" },

29778 { 0xC455C2, "Bach-Simpson" },

29779 { 0xC45600, "Galleon Embedded Computing" },

29780 { 0xC456FE, "Lava International Ltd." },

29781 { 0xC4571F, "June Life Inc" },

29782 { 0xC4576E, "Samsung Electronics Co.,Ltd" },

29783 { 0xC45781, "Wingtech Group (HongKong) Limited" },

29784 { 0xC458C2, "Shenzhen TATFOOK Technology Co., Ltd." },

29785 { 0xC45976, "Fugoo Coorporation" },

29786 { 0xC45A86, "Huawei Device Co., Ltd." },

29787 { 0xC45AB1, "Dell Inc." },

29788 { 0xC45BBE, "Espressif Inc." },

29789 { 0xC45BF7, "ants" },

29790 { 0xC45D83, "Samsung Electronics Co.,Ltd" },

29791 { 0xC45DD8, "HDMI Forum" },

29792 { 0xC45E5C, "HUAWEI TECHNOLOGIES CO.,LTD" },

29793 { 0xC46026, "SKY UK LIMITED" },

29794 { 0xC46044, "Everex Electronics Limited" },

29795 { 0xC4618B, "Apple, Inc." },

29796 { 0xC461C7, "Microsoft Corporation" },

29797 { 0xC46237, "sunweit industrial limited" },

29798 { 0xC4626B, "ZPT Vigantice" },

29799 { 0xC462EA, "Samsung Electronics Co.,Ltd" },

29800 { 0xC46354, "U-Raku, Inc." },

29801 { 0xC463FB, "Neatframe AS" },

29802 { 0xC46413, "Cisco Systems, Inc" },

29803 { 0xC464B7, "Fiberhome Telecommunication Technologies Co.,LTD" },

29804 { 0xC464E3, "Texas Instruments" },

29805 { 0xC464F2, "Infinix mobility limited" },

29806 { 0xC46516, "Hewlett Packard" },

29807 { 0xC46699, "vivo Mobile Communication Co., Ltd." },

29808 { 0xC4678B, "Alphabet Capital Sdn Bhd" },

29809 { 0xC467B5, "Libratone A/S" },

29810 { 0xC467D1, "HUAWEI TECHNOLOGIES CO.,LTD" },

29811 { 0xC468D0, "VTech Telecommunications Ltd." },

29812 { 0xC4693E, "Turbulence Design Inc." },

29813 { 0xC469F0, "HUAWEI TECHNOLOGIES CO.,LTD" },

29814 { 0xC46AB7, "Xiaomi Communications Co Ltd" },

29815 { 0xC46BB4, "myIDkey" },

29816 { 0xC46DF1, "DataGravity" },

29817 { 0xC46E1F, "TP-LINK TECHNOLOGIES CO.,LTD." },

29818 { 0xC46E33, "Zhong Ge Smart Technology Co., Ltd." },

29819 { 0xC46E7B, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

29820 { 0xC4700B, "GUANGZHOU CHIP TECHNOLOGIES CO.,LTD" },

29821 { 0xC470AB, "Ruijie Networks Co.,LTD" },

29822 { 0xC47130, "Fon Technology S.L." },

29823 { 0xC47154, "TP-LINK TECHNOLOGIES CO.,LTD." },

29824 { 0xC471FE, "Cisco Systems, Inc" },

29825 { 0xC47295, "Cisco Systems, Inc" },

29826 { 0xC4731E, "Samsung Electronics Co.,Ltd" },

29827 { 0xC4741E, "zte corporation" },

29828 { 0xC47469, "BT9" },

29829 { 0xC474F8, "Hot Pepper, Inc." },

29830 { 0xC475AB, "Intel Corporate" },

29831 { 0xC475EA, "HUAWEI TECHNOLOGIES CO.,LTD" },

29832 { 0xC477AB, "Beijing ASU Tech Co.,Ltd" },

29833 { 0xC477AF, "Advanced Digital Broadcast SA" },

29834 { 0xC478A2, "Huawei Device Co., Ltd." },

29835 { 0xC47905, "Zhejiang Uniview Technologies Co.,Ltd." },

29836 { 0xC4799F, "Haiguang Smart Device Co.,Ltd." },

29837 { 0xC47B2F, "Beijing JoinHope Image Technology Ltd." },

29838 { 0xC47B80, "Protempis, LLC" },

29839 { 0xC47BA3, "NAVIS Inc." },

29840 { 0xC47C8D, "IEEE Registration Authority" },

29841 { 0xC47D46, "FUJITSU LIMITED" },

29842 { 0xC47D4F, "Cisco Systems, Inc" },

29843 { 0xC47D9F, "Samsung Electronics Co.,Ltd" },

29844 { 0xC47DCC, "Zebra Technologies Inc" },

29845 { 0xC47DFE, "A.N. Solutions GmbH" },

29846 { 0xC47EE0, "Cisco Systems, Inc" },

29847 { 0xC47F51, "Inventek Systems" },

29848 { 0xC48025, "Huawei Device Co., Ltd." },

29849 { 0xC4808A, "Cloud Diagnostics Canada ULC" },

29850 { 0xC4823F, "Fujian Newland Auto-ID Tech. Co,.Ltd." },

29851 { 0xC4824E, "Changzhou Uchip Electronics Co., LTD." },

29852 { 0xC482E1, "Tuya Smart Inc." },

29853 { 0xC4836F, "Ciena Corporation" },

29854 { 0xC48372, "IEEE Registration Authority" },

29855 { 0xC48466, "Apple, Inc." },

29856 { 0xC48508, "Intel Corporate" },

29857 { 0xC486E9, "HUAWEI TECHNOLOGIES CO.,LTD" },

29858 { 0xC488E5, "Samsung Electronics Co.,Ltd" },

29859 { 0xC489ED, "Solid Optics EU N.V." },

29860 { 0xC48A5A, "JFCONTROL" },

29861 { 0xC48BA3, "Cisco Meraki" },

29862 { 0xC48E8F, "Hon Hai Precision Ind. Co.,Ltd." },

29863 { 0xC48F07, "Shenzhen Yihao Hulian Science and Technology Co., Ltd." },

29864 { 0xC48FC1, "DEEPTRACK S.L.U." },

29865 { 0xC4910C, "Apple, Inc." },

29866 { 0xC4913A, "Shenzhen Sanland Electronic Co., ltd." },

29867 { 0xC491CF, "Luxul" },

29868 { 0xC4924C, "KEISOKUKI CENTER CO.,LTD." },

29869 { 0xC49300, "8Devices" },

29870 { 0xC49313, "100fio networks technology llc" },

29871 { 0xC49380, "Speedytel technology" },

29872 { 0xC493BB, "Beijing Xiaomi Mobile Software Co., Ltd" },

29873 { 0xC493D9, "Samsung Electronics Co.,Ltd" },

29874 { 0xC49500, "Amazon Technologies Inc." },

29875 { 0xC4954D, "IEEE Registration Authority" },

29876 { 0xC4955F, "Anhui Saida Technology Limited Liability Company" },

29877 { 0xC495A2, "SHENZHEN WEIJIU INDUSTRY AND TRADE DEVELOPMENT CO., LTD" },

29878 { 0xC49805, "Minieum Networks, Inc" },

29879 { 0xC4985C, "Hui Zhou Gaoshengda Technology Co.,LTD" },

29880 { 0xC49878, "SHANGHAI MOAAN INTELLIGENT TECHNOLOGY CO.,LTD" },

29881 { 0xC49880, "Apple, Inc." },

29882 { 0xC49886, "Qorvo International Pte. Ltd." },

29883 { 0xC49894, "IEEE Registration Authority" },

29884 { 0xC49A02, "LG Electronics (Mobile Communications)" },

29885 { 0xC49D08, "Huawei Device Co., Ltd." },

29886 { 0xC49DED, "Microsoft Corporation" },

29887 { 0xC49E41, "G24 Power Limited" },

29888 { 0xC49F4C, "HUAWEI TECHNOLOGIES CO.,LTD" },

29889 { 0xC49FF3, "Mciao Technologies, Inc." },

29890 { 0xC4A052, "Motorola Mobility LLC, a Lenovo Company" },

29891 { 0xC4A10E, "IEEE Registration Authority" },

29892 { 0xC4A151, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

29893 { 0xC4A1AE, "Huawei Device Co., Ltd." },

29894 { 0xC4A366, "zte corporation" },

29895 { 0xC4A402, "HUAWEI TECHNOLOGIES CO.,LTD" },

29896 { 0xC4A451, "TECNO MOBILE LIMITED" },

29897 { 0xC4A559, "IEEE Registration Authority" },

29898 { 0xC4A64E, "Quectel Wireless Solutions Co.,Ltd." },

29899 { 0xC4A72B, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

29900 { 0xC4A816, "eero inc." },

29901 { 0xC4A81D, "D-Link International" },

29902 { 0xC4AA99, "HUAWEI TECHNOLOGIES CO.,LTD" },

29903 { 0xC4AAA1, "SUMMIT DEVELOPMENT, spol.s r.o." },

29904 { 0xC4AAC4, "Zhejiang Dahua Technology Co., Ltd." },

29905 { 0xC4ABB2, "vivo Mobile Communication Co., Ltd." },

29906 { 0xC4AC59, "Murata Manufacturing Co., Ltd." },

29907 { 0xC4ACAA, "Apple, Inc." },

29908 { 0xC4AD21, "MEDIAEDGE Corporation" },

29909 { 0xC4AD34, "Routerboard.com" },

29910 { 0xC4ADF1, "GOPEACE Inc." },

29911 { 0xC4AE12, "Samsung Electronics Co.,Ltd" },

29912 { 0xC4B239, "Cisco Systems, Inc" },

29913 { 0xC4B25B, "Ruijie Networks Co.,LTD" },

29914 { 0xC4B301, "Apple, Inc." },

29915 { 0xC4B36A, "Cisco Systems, Inc" },

29916 { 0xC4B512, "General Electric Digital Energy" },

29917 { 0xC4B8B4, "HUAWEI TECHNOLOGIES CO.,LTD" },

29918 { 0xC4B9CD, "Cisco Systems, Inc" },

29919 { 0xC4BA99, "I+ME Actia Informatik und Mikro-Elektronik GmbH" },

29920 { 0xC4BAA3, "Beijing Winicssec Technologies Co., Ltd." },

29921 { 0xC4BB4C, "Zebra Information Tech Co. Ltd" },

29922 { 0xC4BBEA, "Pakedge Device and Software Inc" },

29923 { 0xC4BCD7, "New Ryatek" },

29924 { 0xC4BD6A, "SKF GmbH" },

29925 { 0xC4BDE5, "Intel Corporate" },

29926 { 0xC4BE84, "Texas Instruments" },

29927 { 0xC4BED4, "Avaya Inc" },

29928 { 0xC4BF60, "TECNO MOBILE LIMITED" },

29929 { 0xC4C063, "New H3C Technologies Co., Ltd" },

29930 { 0xC4C0AE, "MIDORI ELECTRONIC CO., LTD." },

29931 { 0xC4C138, "OWLink Technology Inc" },

29932 { 0xC4C17D, "Apple, Inc." },

29933 { 0xC4C19F, "National Oilwell Varco Instrumentation, Monitoring, and Optimization (NOV IMO)" },

29934 { 0xC4C36B, "Apple, Inc." },

29935 { 0xC4C563, "TECNO MOBILE LIMITED" },

29936 { 0xC4C603, "Cisco Systems, Inc" },

29937 { 0xC4C755, "Beijing HuaqinWorld Technology Co.,Ltd" },

29938 { 0xC4C919, "Energy Imports Ltd" },

29939 { 0xC4C9EC, "Gugaoo HK Limited" },

29940 { 0xC4CA2B, "Arista Networks" },

29941 { 0xC4CAD9, "Hangzhou H3C Technologies Co., Limited" },

29942 { 0xC4CB54, "Fibocom Auto Inc." },

29943 { 0xC4CB6B, "Airista Flow, Inc." },

29944 { 0xC4CB76, "Microsoft Corporation" },

29945 { 0xC4CBE1, "Dell Inc." },

29946 { 0xC4CD45, "Beijing Boomsense Technology CO.,LTD." },

29947 { 0xC4CD82, "Hangzhou Lowan Information Technology Co., Ltd." },

29948 { 0xC4D0E3, "Intel Corporate" },

29949 { 0xC4D197, "Ventia Utility Services" },

29950 { 0xC4D36A, "Texas Instruments" },

29951 { 0xC4D438, "HUAWEI TECHNOLOGIES CO.,LTD" },

29952 { 0xC4D489, "JiangSu Joyque Information Industry Co.,Ltd" },

29953 { 0xC4D496, "Shenzhen Excelsecu Data Technology Co.,Ltd" },

29954 { 0xC4D655, "Tercel technology co.,ltd" },

29955 { 0xC4D666, "Cisco Meraki" },

29956 { 0xC4D738, "Huawei Device Co., Ltd." },

29957 { 0xC4D7FD, "Bouffalo Lab (Nanjing) Co., Ltd." },

29958 { 0xC4D8D5, "Espressif Inc." },

29959 { 0xC4D8F3, "iZotope" },

29960 { 0xC4D987, "Intel Corporate" },

29961 { 0xC4DA26, "NOBLEX SA" },

29962 { 0xC4DA7D, "Ivium Technologies B.V." },

29963 { 0xC4DB04, "HUAWEI TECHNOLOGIES CO.,LTD" },

29964 { 0xC4DD57, "Espressif Inc." },

29965 { 0xC4DE7B, "Huawei Device Co., Ltd." },

29966 { 0xC4DEE2, "Espressif Inc." },

29967 { 0xC4DF39, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

29968 { 0xC4E032, "IEEE 1904.1 Working Group" },

29969 { 0xC4E0DE, "Zhengzhou XindaJiean Information Technology Co.,Ltd." },

29970 { 0xC4E17C, "U2S co." },

29971 { 0xC4E1A1, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

29972 { 0xC4E287, "HUAWEI TECHNOLOGIES CO.,LTD" },

29973 { 0xC4E39F, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

29974 { 0xC4E506, "Piper Networks, Inc." },

29975 { 0xC4E510, "Mechatro, Inc." },

29976 { 0xC4E532, "Arcadyan Corporation" },

29977 { 0xC4E5B1, "Suzhou PanKore Integrated Circuit Technology Co. Ltd." },

29978 { 0xC4E733, "Clear Align LLC" },

29979 { 0xC4E7BE, "SCSpro Co.,Ltd" },

29980 { 0xC4E90A, "D-Link International" },

29981 { 0xC4E92F, "AB Sciex" },

29982 { 0xC4E984, "TP-LINK TECHNOLOGIES CO.,LTD." },

29983 { 0xC4EA1D, "Technicolor Delivery Technologies Belgium NV" },

29984 { 0xC4EB39, "Sagemcom Broadband SAS" },

29985 { 0xC4EB41, "Sagemcom Broadband SAS" },

29986 { 0xC4EB42, "Sagemcom Broadband SAS" },

29987 { 0xC4EB43, "Sagemcom Broadband SAS" },

29988 { 0xC4EBE3, "RRCN SAS" },

29989 { 0xC4EBFF, "zte corporation" },

29990 { 0xC4EDBA, "Texas Instruments" },

29991 { 0xC4EEAE, "VSS Monitoring" },

29992 { 0xC4EEF5, "II-VI Incorporated" },

29993 { 0xC4EF70, "Home Skinovations" },

29994 { 0xC4EFDA, "Honeywell" },

29995 { 0xC4F081, "HUAWEI TECHNOLOGIES CO.,LTD" },

29996 { 0xC4F0EC, "Fiberhome Telecommunication Technologies Co.,LTD" },

29997 { 0xC4F122, "Nexar Ltd." },

29998 { 0xC4F174, "eero inc." },

29999 { 0xC4F1D1, "BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO., LTD." },

30000 { 0xC4F312, "Texas Instruments" },

30001 { 0xC4F464, "Spica international" },

30002 { 0xC4F57C, "Brocade Communications Systems LLC" },

30003 { 0xC4F5A5, "Kumalift Co., Ltd." },

30004 { 0xC4F7D5, "Cisco Systems, Inc" },

30005 { 0xC4F839, "Actia Automotive" },

30006 { 0xC4FBAA, "HUAWEI TECHNOLOGIES CO.,LTD" },

30007 { 0xC4FBC8, "Shenzhen Candour Co., Ltd." },

30008 { 0xC4FC22, "YEALINK(XIAMEN) NETWORK TECHNOLOGY CO.,LTD." },

30009 { 0xC4FCE4, "DishTV NZ Ltd" },

30010 { 0xC4FCEF, "SambaNova Systems, Inc." },

30011 { 0xC4FDE6, "DRTECH" },

30012 { 0xC4FE5B, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

30013 { 0xC4FEE2, "AMICCOM Electronics Corporation" },

30014 { 0xC4FF1F, "HUAWEI TECHNOLOGIES CO.,LTD" },

30015 { 0xC4FF22, "Huawei Device Co., Ltd." },

30016 { 0xC4FFBC, "IEEE Registration Authority" },

30017 { 0xC80084, "Cisco Systems, Inc" },

30018 { 0xC80210, "LG Innotek" },

30019 { 0xC80258, "ITW GSE ApS" },

30020 { 0xC8028F, "Nova Electronics (Shanghai) Co., Ltd." },

30021 { 0xC802A6, "Beijing Newmine Technology" },

30022 { 0xC803F5, "Ruckus Wireless" },

30023 { 0xC8059E, "Hefei Symboltek Co.,Ltd" },

30024 { 0xC80718, "TDSi" },

30025 { 0xC80739, "NAKAYO Inc" },

30026 { 0xC80873, "Ruckus Wireless" },

30027 { 0xC808E9, "LG Electronics" },

30028 { 0xC809A8, "Intel Corporate" },

30029 { 0xC80A35, "Qingdao Hisense Smart Life Technology Co., Ltd" },

30030 { 0xC80AA9, "Quanta Computer Inc." },

30031 { 0xC80C53, "China Mobile Group Device Co.,Ltd." },

30032 { 0xC80CC8, "HUAWEI TECHNOLOGIES CO.,LTD" },

30033 { 0xC80D32, "Holoplot GmbH" },

30034 { 0xC80E14, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

30035 { 0xC80E77, "Le Shi Zhi Xin Electronic Technology (Tianjin) Limited" },

30036 { 0xC80E95, "OmniLync Inc." },

30037 { 0xC81072, "BBPOS Limited" },

30038 { 0xC81073, "CENTURY OPTICOMM CO.,LTD" },

30039 { 0xC8120B, "Samsung Electronics Co.,Ltd" },

30040 { 0xC81337, "Juniper Networks" },

30041 { 0xC8138B, "Shenzhen Skyworth Digital Technology CO., Ltd" },

30042 { 0xC81451, "HUAWEI TECHNOLOGIES CO.,LTD" },

30043 { 0xC81479, "Samsung Electronics Co.,Ltd" },

30044 { 0xC814B4, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

30045 { 0xC8154E, "Intel Corporate" },

30046 { 0xC816A5, "Masimo Corporation" },

30047 { 0xC816BD, "Qingdao Hisense Communications Co.,Ltd." },

30048 { 0xC816DA, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

30049 { 0xC81739, "ITEL MOBILE LIMITED" },

30050 { 0xC819F7, "Samsung Electronics Co.,Ltd" },

30051 { 0xC81AFE, "DLOGIC GmbH" },

30052 { 0xC81B5C, "BCTech" },

30053 { 0xC81B6B, "Innova Security" },

30054 { 0xC81CFE, "Zebra Technologies Inc." },

30055 { 0xC81E8E, "ADV Security (S) Pte Ltd" },

30056 { 0xC81EC2, "ITEL MOBILE LIMITED" },

30057 { 0xC81EE7, "Apple, Inc." },

30058 { 0xC81F66, "Dell Inc." },

30059 { 0xC81FBE, "HUAWEI TECHNOLOGIES CO.,LTD" },

30060 { 0xC81FEA, "Avaya Inc" },

30061 { 0xC8208E, "Storagedata" },

30062 { 0xC82158, "Intel Corporate" },

30063 { 0xC821DA, "Shenzhen YOUHUA Technology Co., Ltd" },

30064 { 0xC82496, "Jiangsu Yinhe Electronics Co.,Ltd." },

30065 { 0xC825E1, "Lemobile Information Technology (Beijing) Co., Ltd" },

30066 { 0xC82832, "Beijing Xiaomi Electronics Co., Ltd." },

30067 { 0xC828E5, "Cisco Systems, Inc" },

30068 { 0xC8292A, "Barun Electronics" },

30069 { 0xC829C8, "Palo Alto Networks" },

30070 { 0xC82A14, "Apple, Inc." },

30071 { 0xC82ADD, "Google, Inc." },

30072 { 0xC82AF1, "TCT mobile ltd" },

30073 { 0xC82B6B, "shenzhen worldelite electronics co., LTD" },

30074 { 0xC82B96, "Espressif Inc." },

30075 { 0xC82C2B, "IEEE Registration Authority" },

30076 { 0xC82E18, "Espressif Inc." },

30077 { 0xC82E47, "Suzhou SmartChip Semiconductor Co., LTD" },

30078 { 0xC82E94, "Halfa Enterprise Co., Ltd." },

30079 { 0xC83168, "eZEX corporation" },

30080 { 0xC83232, "Hunting Innova" },

30081 { 0xC8334B, "Apple, Inc." },

30082 { 0xC833E5, "HUAWEI TECHNOLOGIES CO.,LTD" },

30083 { 0xC8348E, "Intel Corporate" },

30084 { 0xC835B8, "Ericsson, EAB/RWI/K" },

30085 { 0xC836A3, "GERTEC BRASIL LTDA" },

30086 { 0xC83870, "Samsung Electronics Co.,Ltd" },

30087 { 0xC839AC, "Huawei Device Co., Ltd." },

30088 { 0xC83A1B, "Toshiba TEC Corporation Inc" },

30089 { 0xC83A35, "Tenda Technology Co., Ltd." },

30090 { 0xC83A6B, "Roku, Inc" },

30091 { 0xC83B45, "JRI" },

30092 { 0xC83C85, "Apple, Inc." },

30093 { 0xC83D97, "Nokia Corporation" },

30094 { 0xC83DD4, "CyberTAN Technology Inc." },

30095 { 0xC83DDC, "Xiaomi Communications Co Ltd" },

30096 { 0xC83DFC, "AlphaTheta Corporation" },

30097 { 0xC83E99, "Texas Instruments" },

30098 { 0xC83E9E, "Huawei Device Co., Ltd." },

30099 { 0xC83EA7, "KUNBUS GmbH" },

30100 { 0xC83F26, "Microsoft Corporation" },

30101 { 0xC83FB4, "ARRIS Group, Inc." },

30102 { 0xC84029, "Fiberhome Telecommunication Technologies Co.,LTD" },

30103 { 0xC84052, "PAX Computer Technology(Shenzhen) Ltd." },

30104 { 0xC8418A, "Samsung Electronics.,LTD" },

30105 { 0xC84529, "IMK Networks Co.,Ltd" },

30106 { 0xC84544, "Asia Pacific CIS (Wuxi) Co, Ltd" },

30107 { 0xC8458F, "Wyler AG" },

30108 { 0xC84709, "Cisco Systems, Inc" },

30109 { 0xC84782, "Areson Technology Corp." },

30110 { 0xC8478C, "Beken Corporation" },

30111 { 0xC848F5, "MEDISON Xray Co., Ltd" },

30112 { 0xC84AA0, "Sony Interactive Entertainment Inc." },

30113 { 0xC84BD6, "Dell Inc." },

30114 { 0xC84C75, "Cisco Systems, Inc" },

30115 { 0xC84C78, "zte corporation" },

30116 { 0xC84D34, "LIONS Taiwan Technology Inc." },

30117 { 0xC84D44, "Shenzhen Jiapeng Huaxiang Technology Co.,Ltd" },

30118 { 0xC84F0E, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

30119 { 0xC84F86, "Sophos Ltd" },

30120 { 0xC850CE, "HUAWEI TECHNOLOGIES CO.,LTD" },

30121 { 0xC850E9, "Raisecom Technology CO., LTD" },

30122 { 0xC85142, "Samsung Electronics Co.,Ltd" },

30123 { 0xC85195, "HUAWEI TECHNOLOGIES CO.,LTD" },

30124 { 0xC851FB, "Extreme Networks Headquarters" },

30125 { 0xC85261, "ARRIS Group, Inc." },

30126 { 0xC853E1, "Beijing Bytedance Network Technology Co., Ltd" },

30127 { 0xC8544B, "Zyxel Communications Corporation" },

30128 { 0xC854A4, "Infinix mobility limited" },

30129 { 0xC85645, "Intermas France" },

30130 { 0xC85663, "Sunflex Europe GmbH" },

30131 { 0xC85895, "Motorola Mobility LLC, a Lenovo Company" },

30132 { 0xC858C0, "Intel Corporate" },

30133 { 0xC85A9F, "zte corporation" },

30134 { 0xC85ACF, "HP Inc." },

30135 { 0xC85B76, "LCFC(HeFei) Electronics Technology co., ltd" },

30136 { 0xC85BA0, "Shenzhen Qihu Intelligent Technology Company Limited" },

30137 { 0xC85CCC, "Beijing Xiaomi Mobile Software Co., Ltd" },

30138 { 0xC85CE2, "IEEE Registration Authority" },

30139 { 0xC85D38, "HUMAX Co., Ltd." },

30140 { 0xC85EA9, "Intel Corporate" },

30141 { 0xC86000, "ASUSTek COMPUTER INC." },

30142 { 0xC86314, "IEEE Registration Authority" },

30143 { 0xC863F1, "Sony Interactive Entertainment Inc." },

30144 { 0xC863FC, "ARRIS Group, Inc." },

30145 { 0xC864C7, "zte corporation" },

30146 { 0xC8662C, "Beijing Haitai Fangyuan High Technology Co,.Ltd." },

30147 { 0xC8665D, "Extreme Networks Headquarters" },

30148 { 0xC8675E, "Extreme Networks Headquarters" },

30149 { 0xC868DE, "Huawei Device Co., Ltd." },

30150 { 0xC869CD, "Apple, Inc." },

30151 { 0xC86BBC, "IEEE Registration Authority" },

30152 { 0xC86C1E, "Display Systems Ltd" },

30153 { 0xC86C20, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

30154 { 0xC86C3D, "Amazon Technologies Inc." },

30155 { 0xC86C87, "Zyxel Communications Corporation" },

30156 { 0xC86CB6, "Optcom Co., Ltd." },

30157 { 0xC86F1D, "Apple, Inc." },

30158 { 0xC87023, "Altice Labs S.A." },

30159 { 0xC870D4, "IBO Technology Co,Ltd" },

30160 { 0xC87125, "Johnson Outdoors Marine Electronics d/b/a Minnkota" },

30161 { 0xC87248, "Aplicom Oy" },

30162 { 0xC8727E, "Nokia" },

30163 { 0xC87324, "Sow Cheng Technology Co. Ltd." },

30164 { 0xC8755B, "Quantify Technology Pty. Ltd." },

30165 { 0xC875F4, "China Mobile Group Device Co.,Ltd." },

30166 { 0xC87765, "Tiesse SpA" },

30167 { 0xC8778B, "Mercury Systems – Trusted Mission Solutions, Inc." },

30168 { 0xC87867, "Mist Systems, Inc." },

30169 { 0xC8787D, "D-Link Corporation" },

30170 { 0xC87B23, "Bose Corporation" },

30171 { 0xC87B5B, "zte corporation" },

30172 { 0xC87CBC, "Valink Co., Ltd." },

30173 { 0xC87D77, "Shenzhen Kingtech Communication Equipment Co.,Ltd" },

30174 { 0xC87E75, "Samsung Electronics Co.,Ltd" },

30175 { 0xC87EA1, "TCL MOKA International Limited" },

30176 { 0xC87F54, "ASUSTek COMPUTER INC." },

30177 { 0xC88314, "Tempo Communications" },

30178 { 0xC88439, "Sunrise Technologies" },

30179 { 0xC88447, "Beautiful Enterprise Co., Ltd" },

30180 { 0xC8848C, "Ruckus Wireless" },

30181 { 0xC884A1, "Cisco Systems, Inc" },

30182 { 0xC884CF, "HUAWEI TECHNOLOGIES CO.,LTD" },

30183 { 0xC88550, "Apple, Inc." },

30184 { 0xC88629, "Shenzhen Duubee Intelligent Technologies Co.,LTD." },

30185 { 0xC88722, "Lumenpulse" },

30186 { 0xC8873B, "Net Optics" },

30187 { 0xC889F3, "Apple, Inc." },

30188 { 0xC88A83, "Dongguan HuaHong Electronics Co.,Ltd" },

30189 { 0xC88A9A, "Intel Corporate" },

30190 { 0xC88AD8, "CHINA DRAGON TECHNOLOGY LIMITED" },

30191 { 0xC88B47, "Nolangroup S.P.A con Socio Unico" },

30192 { 0xC88BE8, "Masimo Corporation" },

30193 { 0xC88D83, "HUAWEI TECHNOLOGIES CO.,LTD" },

30194 { 0xC88ED1, "IEEE Registration Authority" },

30195 { 0xC88F26, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

30196 { 0xC8903E, "Pakton Technologies" },

30197 { 0xC8908A, "Samsung Electronics Co.,Ltd" },

30198 { 0xC891F9, "Sagemcom Broadband SAS" },

30199 { 0xC89346, "MXCHIP Company Limited" },

30200 { 0xC89383, "Embedded Automation, Inc." },

30201 { 0xC89402, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

30202 { 0xC894BB, "HUAWEI TECHNOLOGIES CO.,LTD" },

30203 { 0xC894D2, "Jiangsu Datang Electronic Products Co., Ltd" },

30204 { 0xC8965A, "SKY UK LIMITED" },

30205 { 0xC89665, "Microsoft Corporation" },

30206 { 0xC8979F, "Nokia Corporation" },

30207 { 0xC89828, "zte corporation" },

30208 { 0xC899B2, "Arcadyan Corporation" },

30209 { 0xC89BAD, "Honor Device Co., Ltd." },

30210 { 0xC89BD7, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

30211 { 0xC89C13, "Inspiremobile" },

30212 { 0xC89C1D, "Cisco Systems, Inc" },

30213 { 0xC89CBB, "Taicang T&W Electronics" },

30214 { 0xC89CDC, "Elitegroup Computer Systems Co.,Ltd." },

30215 { 0xC89D18, "Huawei Device Co., Ltd." },

30216 { 0xC89D6D, "ITEL MOBILE LIMITED" },

30217 { 0xC89E43, "NETGEAR" },

30218 { 0xC89E61, "Lyngsoe Systems LTd" },

30219 { 0xC89F0C, "Motorola Mobility LLC, a Lenovo Company" },

30220 { 0xC89F1A, "HUAWEI TECHNOLOGIES CO.,LTD" },

30221 { 0xC89F1D, "SHENZHEN COMMUNICATION TECHNOLOGIES CO.,LTD" },

30222 { 0xC89F42, "VDII Innovation AB" },

30223 { 0xC8A030, "Texas Instruments" },

30224 { 0xC8A1B6, "Shenzhen Longway Technologies Co., Ltd" },

30225 { 0xC8A1BA, "Neul Ltd" },

30226 { 0xC8A23B, "Shenzhen Sundray Technologies Company Limited" },

30227 { 0xC8A2CE, "Oasis Media Systems LLC" },

30228 { 0xC8A362, "ASIX Electronics Corporation" },

30229 { 0xC8A3E8, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

30230 { 0xC8A40D, "Cooler Master Technology Inc" },

30231 { 0xC8A608, "Ruckus Wireless" },

30232 { 0xC8A620, "Nebula, Inc" },

30233 { 0xC8A6EF, "Samsung Electronics Co.,Ltd" },

30234 { 0xC8A70A, "Verizon Business" },

30235 { 0xC8A729, "SYStronics Co., Ltd." },

30236 { 0xC8A776, "HUAWEI TECHNOLOGIES CO.,LTD" },

30237 { 0xC8A823, "Samsung Electronics Co.,Ltd" },

30238 { 0xC8A9FC, "Goyoo Networks Inc." },

30239 { 0xC8AA21, "ARRIS Group, Inc." },

30240 { 0xC8AA55, "Hunan Comtom Electronic Incorporated Co.,Ltd" },

30241 { 0xC8AACC, "Private" },

30242 { 0xC8AE9C, "Shanghai TYD Elecronic Technology Co. Ltd" },

30243 { 0xC8AF40, "marco Systemanalyse und Entwicklung GmbH" },

30244 { 0xC8AFE3, "Hefei Radio Communication Technology Co., Ltd" },

30245 { 0xC8B1CD, "Apple, Inc." },

30246 { 0xC8B1EE, "Qorvo" },

30247 { 0xC8B21E, "CHIPSEA TECHNOLOGIES (SHENZHEN) CORP." },

30248 { 0xC8B29B, "Intel Corporate" },

30249 { 0xC8B373, "Cisco-Linksys, LLC" },

30250 { 0xC8B422, "ASKEY COMPUTER CORP" },

30251 { 0xC8B5AD, "Hewlett Packard Enterprise" },

30252 { 0xC8B5B7, "Apple, Inc." },

30253 { 0xC8B6D3, "HUAWEI TECHNOLOGIES CO.,LTD" },

30254 { 0xC8B6FE, "Fitbit, Inc." },

30255 { 0xC8B82F, "eero inc." },

30256 { 0xC8BA94, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

30257 { 0xC8BAE9, "QDIS" },

30258 { 0xC8BB81, "Huawei Device Co., Ltd." },

30259 { 0xC8BBD3, "Embrane" },

30260 { 0xC8BC9C, "Huawei Device Co., Ltd." },

30261 { 0xC8BCC8, "Apple, Inc." },

30262 { 0xC8BCE5, "Sense Things Japan INC." },

30263 { 0xC8BD4D, "Samsung Electronics Co.,Ltd" },

30264 { 0xC8BD69, "Samsung Electronics Co.,Ltd" },

30265 { 0xC8BE19, "D-Link International" },

30266 { 0xC8BE35, "Extreme Networks Headquarters" },

30267 { 0xC8BF4C, "Beijing Xiaomi Mobile Software Co., Ltd" },

30268 { 0xC8BFFE, "Huawei Device Co., Ltd." },

30269 { 0xC8C126, "ZPM Industria e Comercio Ltda" },

30270 { 0xC8C13C, "RuggedTek Hangzhou Co., Ltd" },

30271 { 0xC8C2C6, "Shanghai Airm2m Communication Technology Co., Ltd" },

30272 { 0xC8C2F5, "FLEXTRONICS MANUFACTURING(ZHUHAI)CO.,LTD." },

30273 { 0xC8C2FA, "HUAWEI TECHNOLOGIES CO.,LTD" },

30274 { 0xC8C465, "HUAWEI TECHNOLOGIES CO.,LTD" },

30275 { 0xC8C50E, "Shenzhen Primestone Network Technologies.Co., Ltd." },

30276 { 0xC8C64A, "Flextronics Tech.(Ind) Pvt Ltd" },

30277 { 0xC8C6FE, "eero inc." },

30278 { 0xC8C750, "Motorola Mobility LLC, a Lenovo Company" },

30279 { 0xC8C791, "Zero1.tv GmbH" },

30280 { 0xC8C9A3, "Espressif Inc." },

30281 { 0xC8CA63, "Huawei Device Co., Ltd." },

30282 { 0xC8CA79, "Ciena Corporation" },

30283 { 0xC8CB9E, "Intel Corporate" },

30284 { 0xC8CBB8, "Hewlett Packard" },

30285 { 0xC8CCB5, "Hunter Douglas" },

30286 { 0xC8CD55, "Ruijie Networks Co.,LTD" },

30287 { 0xC8CD72, "Sagemcom Broadband SAS" },

30288 { 0xC8D019, "Shanghai Tigercel Communication Technology Co.,Ltd" },

30289 { 0xC8D083, "Apple, Inc." },

30290 { 0xC8D10B, "Nokia Corporation" },

30291 { 0xC8D12A, "Comtrend Corporation" },

30292 { 0xC8D15E, "HUAWEI TECHNOLOGIES CO.,LTD" },

30293 { 0xC8D1D1, "AGAiT Technology Corporation" },

30294 { 0xC8D2C1, "Jetlun (Shenzhen) Corporation" },

30295 { 0xC8D3A3, "D-Link International" },

30296 { 0xC8D3FF, "Hewlett Packard" },

30297 { 0xC8D429, "Muehlbauer AG" },

30298 { 0xC8D590, "FLIGHT DATA SYSTEMS" },

30299 { 0xC8D5FE, "Shenzhen Zowee Technology Co., Ltd" },

30300 { 0xC8D69D, "Arab International Optronics" },

30301 { 0xC8D6B7, "Solidigm Technology" },

30302 { 0xC8D719, "Cisco-Linksys, LLC" },

30303 { 0xC8D778, "BSH Hausgeraete GmbH" },

30304 { 0xC8D779, "QING DAO HAIER TELECOM CO.,LTD." },

30305 { 0xC8D7B0, "Samsung Electronics Co.,Ltd" },

30306 { 0xC8D884, "Universal Electronics, Inc." },

30307 { 0xC8D9D2, "Hewlett Packard" },

30308 { 0xC8DB26, "Logitech" },

30309 { 0xC8DDC9, "Lenovo Mobile Communication Technology Ltd." },

30310 { 0xC8DE41, "SKY UK LIMITED" },

30311 { 0xC8DE51, "IntegraOptics" },

30312 { 0xC8DEC9, "Coriant" },

30313 { 0xC8DF7C, "Nokia Corporation" },

30314 { 0xC8DF84, "Texas Instruments" },

30315 { 0xC8E0EB, "Apple, Inc." },

30316 { 0xC8E130, "Milkyway Group Ltd" },

30317 { 0xC8E193, "ITEL MOBILE LIMITED" },

30318 { 0xC8E1A7, "Vertu Corporation Limited" },

30319 { 0xC8E265, "Intel Corporate" },

30320 { 0xC8E306, "eero inc." },

30321 { 0xC8E42F, "Technical Research Design and Development" },

30322 { 0xC8E600, "HUAWEI TECHNOLOGIES CO.,LTD" },

30323 { 0xC8E776, "PTCOM Technology" },

30324 { 0xC8E7D8, "MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

30325 { 0xC8E7F0, "Juniper Networks" },

30326 { 0xC8EAF8, "zte corporation" },

30327 { 0xC8EBEC, "Shenzhen YOUHUA Technology Co., Ltd" },

30328 { 0xC8EDFC, "Shenzhen Ideaform Industrial Product Design Co., Ltd" },

30329 { 0xC8EE08, "TANGTOP TECHNOLOGY CO.,LTD" },

30330 { 0xC8EE75, "Pishion International Co. Ltd" },

30331 { 0xC8EEA6, "Shenzhen SHX Technology Co., Ltd" },

30332 { 0xC8EF2E, "Beijing Gefei Tech. Co., Ltd" },

30333 { 0xC8EFBC, "Inspur Communication Technology Co.,Ltd." },

30334 { 0xC8F09E, "Espressif Inc." },

30335 { 0xC8F225, "EM Microelectronic" },

30336 { 0xC8F230, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

30337 { 0xC8F2B4, "Guizhou Huaxin Information Technology Co., Ltd." },

30338 { 0xC8F319, "LG Electronics (Mobile Communications)" },

30339 { 0xC8F36B, "Yamato Scale Co.,Ltd." },

30340 { 0xC8F386, "Shenzhen Xiaoniao Technology Co.,Ltd" },

30341 { 0xC8F406, "Avaya Inc" },

30342 { 0xC8F5D6, "IEEE Registration Authority" },

30343 { 0xC8F650, "Apple, Inc." },

30344 { 0xC8F68D, "S.E.TECHNOLOGIES LIMITED" },

30345 { 0xC8F6C8, "Fiberhome Telecommunication Technologies Co.,LTD" },

30346 { 0xC8F704, "Building Block Video" },

30347 { 0xC8F733, "Intel Corporate" },

30348 { 0xC8F742, "HangZhou Gubei Electronics Technology Co.,Ltd" },

30349 { 0xC8F750, "Dell Inc." },

30350 { 0xC8F86D, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

30351 { 0xC8F946, "LOCOSYS Technology Inc." },

30352 { 0xC8F981, "Seneca s.r.l." },

30353 { 0xC8F9C8, "NewSharp Technology(SuZhou)Co,Ltd" },

30354 { 0xC8F9F9, "Cisco Systems, Inc" },

30355 { 0xC8FA84, "Trusonus corp." },

30356 { 0xC8FAE1, "ARQ Digital LLC" },

30357 { 0xC8FB26, "Cisco SPVTG" },

30358 { 0xC8FD19, "Texas Instruments" },

30359 { 0xC8FE0F, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

30360 { 0xC8FE30, "Bejing DAYO Mobile Communication Technology Ltd." },

30361 { 0xC8FE6A, "Juniper Networks" },

30362 { 0xC8FF28, "Liteon Technology Corporation" },

30363 { 0xC8FF77, "Dyson Limited" },

30364 { 0xCC0080, "BETTINI SRL" },

30365 { 0xCC00F1, "Sagemcom Broadband SAS" },

30366 { 0xCC037B, "Texas Instruments" },

30367 { 0xCC03D9, "Cisco Meraki" },

30368 { 0xCC03FA, "Vantiva USA LLC" },

30369 { 0xCC047C, "G-WAY Microwave" },

30370 { 0xCC04B4, "Select Comfort" },

30371 { 0xCC051B, "Samsung Electronics Co.,Ltd" },

30372 { 0xCC0577, "HUAWEI TECHNOLOGIES CO.,LTD" },

30373 { 0xCC0677, "Fiberhome Telecommunication Technologies Co.,LTD" },

30374 { 0xCC07AB, "Samsung Electronics Co.,Ltd" },

30375 { 0xCC07E4, "Lenovo Mobile Communication Technology Ltd." },

30376 { 0xCC087B, "HUAWEI TECHNOLOGIES CO.,LTD" },

30377 { 0xCC088D, "Apple, Inc." },

30378 { 0xCC08E0, "Apple, Inc." },

30379 { 0xCC08FA, "Apple, Inc." },

30380 { 0xCC08FB, "TP-LINK TECHNOLOGIES CO.,LTD." },

30381 { 0xCC09C8, "IMAQLIQ LTD" },

30382 { 0xCC0CDA, "Miljovakt AS" },

30383 { 0xCC0DE7, "B METERS S.R.L." },

30384 { 0xCC0DEC, "Cisco SPVTG" },

30385 { 0xCC0DF2, "Motorola Mobility LLC, a Lenovo Company" },

30386 { 0xCC10A3, "Beijing Nan Bao Technology Co., Ltd." },

30387 { 0xCC115A, "Apple, Inc." },

30388 { 0xCC14A6, "Yichun MyEnergy Domain, Inc" },

30389 { 0xCC14BC, "Edifier International" },

30390 { 0xCC1531, "Intel Corporate" },

30391 { 0xCC167E, "Cisco Systems, Inc" },

30392 { 0xCC187B, "Manzanita Systems, Inc." },

30393 { 0xCC19A8, "PT Inovação e Sistemas SA" },

30394 { 0xCC1AA3, "Arista Networks" },

30395 { 0xCC1AFA, "zte corporation" },

30396 { 0xCC1B5A, "Ruckus Wireless" },

30397 { 0xCC1BE0, "IEEE Registration Authority" },

30398 { 0xCC1E56, "HUAWEI TECHNOLOGIES CO.,LTD" },

30399 { 0xCC1E97, "HUAWEI TECHNOLOGIES CO.,LTD" },

30400 { 0xCC1EFF, "Metrological Group BV" },

30401 { 0xCC1FC4, "InVue" },

30402 { 0xCC208C, "HUAWEI TECHNOLOGIES CO.,LTD" },

30403 { 0xCC20E8, "Apple, Inc." },

30404 { 0xCC2119, "Samsung Electronics Co.,Ltd" },

30405 { 0xCC2218, "InnoDigital Co., Ltd." },

30406 { 0xCC2237, "IEEE Registration Authority" },

30407 { 0xCC242E, "Shenzhen SuperElectron Technology Co.,Ltd." },

30408 { 0xCC25EF, "Apple, Inc." },

30409 { 0xCC262D, "Verifi, LLC" },

30410 { 0xCC29BD, "zte corporation" },

30411 { 0xCC29F5, "Apple, Inc." },

30412 { 0xCC2A80, "Micro-Biz intelligence solutions Co.,Ltd" },

30413 { 0xCC2AAC, "Yunjing lntelligent Technology(Dongguan).,Ltd" },

30414 { 0xCC2C83, "DarkMatter L.L.C" },

30415 { 0xCC2D1B, "SFR" },

30416 { 0xCC2D21, "Tenda Technology Co.,Ltd.Dongguan branch" },

30417 { 0xCC2D83, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

30418 { 0xCC2D8C, "LG ELECTRONICS INC" },

30419 { 0xCC2DB7, "Apple, Inc." },

30420 { 0xCC2DE0, "Routerboard.com" },

30421 { 0xCC2F71, "Intel Corporate" },

30422 { 0xCC3080, "VAIO Corporation" },

30423 { 0xCC312A, "HUIZHOU TCL COMMUNICATION ELECTRON CO.,LTD" },

30424 { 0xCC3296, "Huawei Device Co., Ltd." },

30425 { 0xCC32E5, "TP-LINK TECHNOLOGIES CO.,LTD." },

30426 { 0xCC3331, "Texas Instruments" },

30427 { 0xCC33BB, "Sagemcom Broadband SAS" },

30428 { 0xCC3429, "TP-LINK TECHNOLOGIES CO.,LTD." },

30429 { 0xCC34D7, "GEWISS S.P.A." },

30430 { 0xCC3540, "Vantiva USA LLC" },

30431 { 0xCC355A, "SecuGen Corporation" },

30432 { 0xCC36CF, "Cisco Systems, Inc" },

30433 { 0xCC37AB, "Edgecore Networks Corporation" },

30434 { 0xCC398C, "Shiningtek" },

30435 { 0xCC3A61, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

30436 { 0xCC3ADF, "Neptune Technology Group Inc." },

30437 { 0xCC3B27, "TECNO MOBILE LIMITED" },

30438 { 0xCC3B3E, "Lester Electrical" },

30439 { 0xCC3B58, "Curiouser Products Inc" },

30440 { 0xCC3C3F, "SA.S.S. Datentechnik AG" },

30441 { 0xCC3D82, "Intel Corporate" },

30442 { 0xCC3DD1, "HUAWEI TECHNOLOGIES CO.,LTD" },

30443 { 0xCC3E5F, "Hewlett Packard" },

30444 { 0xCC3E79, "ARRIS Group, Inc." },

30445 { 0xCC3F1D, "HMS Industrial Networks SLU" },

30446 { 0xCC3F8A, "KOMATSU LTD." },

30447 { 0xCC3FEA, "BAE Systems, Inc" },

30448 { 0xCC4085, "WiZ" },

30449 { 0xCC40B2, "ECI Telecom Ltd." },

30450 { 0xCC40D0, "NETGEAR" },

30451 { 0xCC418E, "MSA Innovation" },

30452 { 0xCC4210, "Xiaomi Communications Co Ltd" },

30453 { 0xCC43E3, "Trump s.a." },

30454 { 0xCC4460, "Huawei Device Co., Ltd." },

30455 { 0xCC4463, "Apple, Inc." },

30456 { 0xCC45A5, "Texas Instruments" },

30457 { 0xCC4639, "WAAV, Inc." },

30458 { 0xCC464E, "Samsung Electronics Co.,Ltd" },

30459 { 0xCC46D6, "Cisco Systems, Inc" },

30460 { 0xCC4703, "Intercon Systems Co., Ltd." },

30461 { 0xCC4740, "AzureWave Technology Inc." },

30462 { 0xCC4792, "ASIX Electronics Corporation" },

30463 { 0xCC47BD, "Rhombus Systems" },

30464 { 0xCC483A, "Dell Inc." },

30465 { 0xCC4AE1, "fourtec -Fourier Technologies" },

30466 { 0xCC4B73, "AMPAK Technology, Inc." },

30467 { 0xCC4BFB, "Hellberg Safety AB" },

30468 { 0xCC4D38, "Carnegie Technologies" },

30469 { 0xCC4D74, "Fujian Newland Payment Technology Co., Ltd." },

30470 { 0xCC4D75, "Beijing Xiaomi Mobile Software Co., Ltd" },

30471 { 0xCC4E24, "Brocade Communications Systems LLC" },

30472 { 0xCC4EEC, "HUMAX Co., Ltd." },

30473 { 0xCC4F5C, "IEEE Registration Authority" },

30474 { 0xCC500A, "Fiberhome Telecommunication Technologies Co.,LTD" },

30475 { 0xCC501C, "KVH Industries, Inc." },

30476 { 0xCC5076, "Ocom Communications, Inc." },

30477 { 0xCC50E3, "Espressif Inc." },

30478 { 0xCC51B4, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

30479 { 0xCC5289, "SHENZHEN OPTFOCUS TECHNOLOGY.,LTD" },

30480 { 0xCC52AF, "Universal Global Scientific Industrial Co., Ltd." },

30481 { 0xCC53B5, "HUAWEI TECHNOLOGIES CO.,LTD" },

30482 { 0xCC5459, "OnTime Networks AS" },

30483 { 0xCC55AD, "RIM" },

30484 { 0xCC5763, "Panasonic Automotive Systems Co.,Ltd" },

30485 { 0xCC5830, "Sagemcom Broadband SAS" },

30486 { 0xCC593E, "Sensium Healthcare Limited" },

30487 { 0xCC5A53, "Cisco Systems, Inc" },

30488 { 0xCC5B31, "Nintendo Co.,Ltd" },

30489 { 0xCC5C61, "Huawei Device Co., Ltd." },

30490 { 0xCC5C75, "Weightech Com. Imp. Exp. Equip. Pesagem Ltda" },

30491 { 0xCC5CDE, "China Mobile Group Device Co.,Ltd." },

30492 { 0xCC5D4E, "Zyxel Communications Corporation" },

30493 { 0xCC5D57, "Information System Research Institute,Inc." },

30494 { 0xCC5D78, "JTD Consulting" },

30495 { 0xCC5EF8, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

30496 { 0xCC5FBF, "Topwise 3G Communication Co., Ltd." },

30497 { 0xCC6023, "Apple, Inc." },

30498 { 0xCC60BB, "Empower RF Systems" },

30499 { 0xCC60C8, "Microsoft Corporation" },

30500 { 0xCC61E5, "Motorola Mobility LLC, a Lenovo Company" },

30501 { 0xCC62FE, "UNION MAN TECHNOLOGY CO.,LTD" },

30502 { 0xCC64A6, "HUAWEI TECHNOLOGIES CO.,LTD" },

30503 { 0xCC65AD, "ARRIS Group, Inc." },

30504 { 0xCC660A, "Apple, Inc." },

30505 { 0xCC6618, "Adtran Inc" },

30506 { 0xCC66B2, "Nokia" },

30507 { 0xCC68B6, "TP-Link Corporation Limited" },

30508 { 0xCC68E0, "Apple, Inc." },

30509 { 0xCC69B0, "Global Traffic Technologies, LLC" },

30510 { 0xCC69FA, "Apple, Inc." },

30511 { 0xCC6A10, "The Chamberlain Group, Inc" },

30512 { 0xCC6B1E, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

30513 { 0xCC6B98, "Minetec Wireless Technologies" },

30514 { 0xCC6BF1, "Sound Masking Inc." },

30515 { 0xCC6DA0, "Roku, Inc." },

30516 { 0xCC6DEF, "TJK Tietolaite Oy" },

30517 { 0xCC6EA4, "Samsung Electronics Co.,Ltd" },

30518 { 0xCC70ED, "Cisco Systems, Inc" },

30519 { 0xCC7190, "VIETNAM POST AND TELECOMMUNICATION INDUSTRY TECHNOLOGY JOINT STOCK COMPANY" },

30520 { 0xCC720F, "Viscount Systems Inc." },

30521 { 0xCC7286, "Xi'an Fengyu Information Technology Co., Ltd." },

30522 { 0xCC7314, "HONG KONG WHEATEK TECHNOLOGY LIMITED" },

30523 { 0xCC7498, "Filmetrics Inc." },

30524 { 0xCC75E2, "ARRIS Group, Inc." },

30525 { 0xCC7669, "SEETECH" },

30526 { 0xCC77C9, "Fiberhome Telecommunication Technologies Co.,LTD" },

30527 { 0xCC785F, "Apple, Inc." },

30528 { 0xCC78AB, "Texas Instruments" },

30529 { 0xCC794A, "BLU Products Inc." },

30530 { 0xCC79CF, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

30531 { 0xCC79D7, "Cisco Systems, Inc" },

30532 { 0xCC7A30, "CMAX Wireless Co., Ltd." },

30533 { 0xCC7B35, "zte corporation" },

30534 { 0xCC7B5C, "Espressif Inc." },

30535 { 0xCC7B61, "NIKKISO CO., LTD." },

30536 { 0xCC7D37, "ARRIS Group, Inc." },

30537 { 0xCC7D5B, "Telink Semiconductor (Shanghai) Co., Ltd." },

30538 { 0xCC7EE7, "Panasonic Corporation AVC Networks Company" },

30539 { 0xCC7F75, "Cisco Systems, Inc" },

30540 { 0xCC7F76, "Cisco Systems, Inc" },

30541 { 0xCC812A, "vivo Mobile Communication Co., Ltd." },

30542 { 0xCC81DA, "Phicomm (Shanghai) Co., Ltd." },

30543 { 0xCC827F, "Advantech Technology (CHINA) Co., Ltd." },

30544 { 0xCC82EB, "KYOCERA CORPORATION" },

30545 { 0xCC856C, "SHENZHEN MDK DIGITAL TECHNOLOGY CO.,LTD" },

30546 { 0xCC86EC, "Silicon Laboratories" },

30547 { 0xCC874A, "Nokia" },

30548 { 0xCC8826, "LG Innotek" },

30549 { 0xCC88C7, "Aruba, a Hewlett Packard Enterprise Company" },

30550 { 0xCC895E, "HUAWEI TECHNOLOGIES CO.,LTD" },

30551 { 0xCC896C, "GN Hearing A/S" },

30552 { 0xCC89FD, "Nokia Corporation" },

30553 { 0xCC8CBF, "Tuya Smart Inc." },

30554 { 0xCC8CDA, "Shenzhen Wei Da Intelligent Technology Go.,Ltd" },

30555 { 0xCC8CE3, "Texas Instruments" },

30556 { 0xCC8DA2, "Espressif Inc." },

30557 { 0xCC8DB5, "Shenzhen SuperElectron Technology Co.,Ltd." },

30558 { 0xCC8E71, "Cisco Systems, Inc" },

30559 { 0xCC9070, "Cisco Systems, Inc" },

30560 { 0xCC9093, "Hansong Tehnologies" },

30561 { 0xCC90E8, "Shenzhen YOUHUA Technology Co., Ltd" },

30562 { 0xCC912B, "TE Connectivity Touch Solutions" },

30563 { 0xCC934A, "Sierra Wireless, ULC" },

30564 { 0xCC944A, "Pfeiffer Vacuum GmbH" },

30565 { 0xCC9470, "Kinestral Technologies, Inc." },

30566 { 0xCC95D7, "Vizio, Inc" },

30567 { 0xCC9635, "LVS Co.,Ltd." },

30568 { 0xCC96A0, "HUAWEI TECHNOLOGIES CO.,LTD" },

30569 { 0xCC96E5, "Dell Inc." },

30570 { 0xCC988B, "SONY Visual Products Inc." },

30571 { 0xCC9891, "Cisco Systems, Inc" },

30572 { 0xCC9916, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

30573 { 0xCC9C3E, "Cisco Meraki" },

30574 { 0xCC9DA2, "Eltex Enterprise Ltd." },

30575 { 0xCC9E00, "Nintendo Co., Ltd." },

30576 { 0xCC9EA2, "Amazon Technologies Inc." },

30577 { 0xCC9ECA, "HMD Global Oy" },

30578 { 0xCC9F35, "Transbit Sp. z o.o." },

30579 { 0xCC9F7A, "Chiun Mai Communication System, Inc" },

30580 { 0xCCA08F, "zte corporation" },

30581 { 0xCCA0E5, "DZG Metering GmbH" },

30582 { 0xCCA12B, "TCL King Electrical Appliances (Huizhou) Co., Ltd" },

30583 { 0xCCA174, "Meta Platforms Technologies, LLC" },

30584 { 0xCCA219, "SHENZHEN ALONG INVESTMENT CO.,LTD" },

30585 { 0xCCA223, "HUAWEI TECHNOLOGIES CO.,LTD" },

30586 { 0xCCA260, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

30587 { 0xCCA374, "Guangdong Guanglian Electronic Technology Co.Ltd" },

30588 { 0xCCA3BD, "ITEL MOBILE LIMITED" },

30589 { 0xCCA462, "ARRIS Group, Inc." },

30590 { 0xCCA4AF, "Shenzhen Sowell Technology Co., LTD" },

30591 { 0xCCA614, "AIFA TECHNOLOGY CORP." },

30592 { 0xCCA7C1, "Google, Inc." },

30593 { 0xCCAB2C, "HUMAX Co., Ltd." },

30594 { 0xCCACFE, "Telink Semiconductor (Shanghai) Co., Ltd." },

30595 { 0xCCAF78, "Hon Hai Precision Ind. Co.,Ltd." },

30596 { 0xCCB071, "Fiberhome Telecommunication Technologies Co.,LTD" },

30597 { 0xCCB0A8, "Huawei Device Co., Ltd." },

30598 { 0xCCB0DA, "Liteon Technology Corporation" },

30599 { 0xCCB11A, "Samsung Electronics Co.,Ltd" },

30600 { 0xCCB182, "HUAWEI TECHNOLOGIES CO.,LTD" },

30601 { 0xCCB255, "D-Link International" },

30602 { 0xCCB3AB, "shenzhen Biocare Bio-Medical Equipment Co.,Ltd." },

30603 { 0xCCB3F8, "FUJITSU ISOTEC LIMITED" },

30604 { 0xCCB54C, "Texas Instruments" },

30605 { 0xCCB55A, "Fraunhofer ITWM" },

30606 { 0xCCB5D1, "Beijing Xiaomi Mobile Software Co., Ltd" },

30607 { 0xCCB691, "NECMagnusCommunications" },

30608 { 0xCCB6C8, "Cisco Systems, Inc" },

30609 { 0xCCB7C4, "HUAWEI TECHNOLOGIES CO.,LTD" },

30610 { 0xCCB888, "AnB Securite s.a." },

30611 { 0xCCB8A8, "AMPAK Technology, Inc." },

30612 { 0xCCB8F1, "EAGLE KINGDOM TECHNOLOGIES LIMITED" },

30613 { 0xCCBA6F, "HUAWEI TECHNOLOGIES CO.,LTD" },

30614 { 0xCCBBFE, "HUAWEI TECHNOLOGIES CO.,LTD" },

30615 { 0xCCBC2B, "Huawei Device Co., Ltd." },

30616 { 0xCCBCE3, "HUAWEI TECHNOLOGIES CO.,LTD" },

30617 { 0xCCBD35, "Steinel GmbH" },

30618 { 0xCCBDD3, "Ultimaker B.V." },

30619 { 0xCCBE59, "Calix Inc." },

30620 { 0xCCBE71, "OptiLogix BV" },

30621 { 0xCCC079, "Murata Manufacturing Co., Ltd." },

30622 { 0xCCC104, "Applied Technical Systems" },

30623 { 0xCCC261, "IEEE Registration Authority" },

30624 { 0xCCC2E0, "Raisecom Technology CO., LTD" },

30625 { 0xCCC3EA, "Motorola Mobility LLC, a Lenovo Company" },

30626 { 0xCCC50A, "SHENZHEN DAJIAHAO TECHNOLOGY CO.,LTD" },

30627 { 0xCCC5E5, "Dell Inc." },

30628 { 0xCCC5EF, "Co-Comm Servicios Telecomunicaciones S.L." },

30629 { 0xCCC62B, "Tri-Systems Corporation" },

30630 { 0xCCC760, "Apple, Inc." },

30631 { 0xCCC8D7, "CIAS Elettronica srl" },

30632 { 0xCCC92C, "Schindler - PORT Technology" },

30633 { 0xCCC95D, "Apple, Inc." },

30634 { 0xCCCC4E, "Sun Fountainhead USA. Corp" },

30635 { 0xCCCC77, "Zaram Technology. Inc." },

30636 { 0xCCCC81, "HUAWEI TECHNOLOGIES CO.,LTD" },

30637 { 0xCCCCCC, "Silicon Laboratories" },

30638 { 0xCCCCEA, "PHOENIX CONTACT Electronics GmbH" },

30639 { 0xCCCD64, "SM-Electronic GmbH" },

30640 { 0xCCCE1E, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

30641 { 0xCCCE40, "Janteq Corp" },

30642 { 0xCCCF83, "CIG SHANGHAI CO LTD" },

30643 { 0xCCD083, "Aruba, a Hewlett Packard Enterprise Company" },

30644 { 0xCCD281, "Apple, Inc." },

30645 { 0xCCD29B, "Shenzhen Bopengfa Elec&Technology CO.,Ltd" },

30646 { 0xCCD31E, "IEEE Registration Authority" },

30647 { 0xCCD342, "Cisco Systems, Inc" },

30648 { 0xCCD39D, "IEEE Registration Authority" },

30649 { 0xCCD3C1, "Vestel Elektronik San ve Tic. A.S." },

30650 { 0xCCD3E2, "Jiangsu Yinhe Electronics Co.,Ltd." },

30651 { 0xCCD42E, "Arcadyan Corporation" },

30652 { 0xCCD4A1, "MitraStar Technology Corp." },

30653 { 0xCCD539, "Cisco Systems, Inc" },

30654 { 0xCCD73C, "HUAWEI TECHNOLOGIES CO.,LTD" },

30655 { 0xCCD811, "Aiconn Technology Corporation" },

30656 { 0xCCD81F, "Maipu Communication Technology Co.,Ltd." },

30657 { 0xCCD843, "Beijing Xiaomi Mobile Software Co., Ltd" },

30658 { 0xCCD8C1, "Cisco Systems, Inc" },

30659 { 0xCCD9AC, "Intel Corporate" },

30660 { 0xCCD9E9, "SCR Engineers Ltd." },

30661 { 0xCCDB04, "DataRemote Inc." },

30662 { 0xCCDB93, "Cisco Systems, Inc" },

30663 { 0xCCDBA7, "Espressif Inc." },

30664 { 0xCCDC55, "Dragonchip Limited" },

30665 { 0xCCDD58, "Robert Bosch GmbH" },

30666 { 0xCCDEDE, "Nokia" },

30667 { 0xCCE0C3, "EXTEN Technologies, Inc." },

30668 { 0xCCE0DA, "Baidu Online Network Technology (Beijing) Co., Ltd" },

30669 { 0xCCE17F, "Juniper Networks" },

30670 { 0xCCE194, "Juniper Networks" },

30671 { 0xCCE1D5, "BUFFALO.INC" },

30672 { 0xCCE236, "Hangzhou Yaguan Technology Co. LTD" },

30673 { 0xCCE536, "ittim" },

30674 { 0xCCE686, "Samsung Electronics Co.,Ltd" },

30675 { 0xCCE798, "My Social Stuff" },

30676 { 0xCCE7DF, "American Magnetics, Inc." },

30677 { 0xCCE8AC, "SOYEA Technology Co.,Ltd." },

30678 { 0xCCE9FA, "Samsung Electronics Co.,Ltd" },

30679 { 0xCCEA1C, "DCONWORKS Co., Ltd" },

30680 { 0xCCEB18, "OOO TSS" },

30681 { 0xCCEB5E, "Xiaomi Communications Co Ltd" },

30682 { 0xCCECB7, "ShenZhen Linked-Z Intelligent Display Co., Ltd" },

30683 { 0xCCED21, "Nokia Shanghai Bell Co., Ltd." },

30684 { 0xCCED4D, "Cisco Systems, Inc" },

30685 { 0xCCEDDC, "MitraStar Technology Corp." },

30686 { 0xCCEED9, "VAHLE Automation GmbH" },

30687 { 0xCCEF03, "Hunan Keyshare Communication Technology Co., Ltd." },

30688 { 0xCCEF48, "Cisco Systems, Inc" },

30689 { 0xCCF0FD, "China Mobile (Hangzhou) Information Technology Co., Ltd." },

30690 { 0xCCF305, "SHENZHEN TIAN XING CHUANG ZHAN ELECTRONIC CO.,LTD" },

30691 { 0xCCF3A5, "Chi Mei Communication Systems, Inc" },

30692 { 0xCCF3C8, "Vantiva USA LLC" },

30693 { 0xCCF407, "EUKREA ELECTROMATIQUE SARL" },

30694 { 0xCCF411, "Google, Inc." },

30695 { 0xCCF538, "3isysnetworks" },

30696 { 0xCCF55F, "E FOCUS INSTRUMENTS INDIA PRIVATE LIMITED" },

30697 { 0xCCF67A, "Ayecka Communication Systems LTD" },

30698 { 0xCCF735, "Amazon Technologies Inc." },

30699 { 0xCCF826, "Samsung Electronics Co.,Ltd" },

30700 { 0xCCF841, "Lumewave" },

30701 { 0xCCF8F0, "Xi'an HISU Multimedia Technology Co.,Ltd." },

30702 { 0xCCF954, "Avaya Inc" },

30703 { 0xCCF957, "u-blox AG" },

30704 { 0xCCF9E4, "Intel Corporate" },

30705 { 0xCCF9E8, "Samsung Electronics Co.,Ltd" },

30706 { 0xCCF9F0, "Samsung Electronics Co.,Ltd" },

30707 { 0xCCFA00, "LG Electronics (Mobile Communications)" },

30708 { 0xCCFA66, "Huawei Device Co., Ltd." },

30709 { 0xCCFB65, "Nintendo Co., Ltd." },

30710 { 0xCCFC6D, "RIZ TRANSMITTERS" },

30711 { 0xCCFCB1, "Wireless Technology, Inc." },

30712 { 0xCCFD17, "TCT mobile ltd" },

30713 { 0xCCFE3C, "Samsung Electronics Co.,Ltd" },

30714 { 0xCCFF90, "Huawei Device Co., Ltd." },

30715 { 0xD0034B, "Apple, Inc." },

30716 { 0xD003DF, "Samsung Electronics Co.,Ltd" },

30717 { 0xD003EB, "Texas Instruments" },

30718 { 0xD00401, "Motorola Mobility LLC, a Lenovo Company" },

30719 { 0xD00492, "Fiberhome Telecommunication Technologies Co.,LTD" },

30720 { 0xD004B0, "Samsung Electronics Co.,Ltd" },

30721 { 0xD0052A, "Arcadyan Corporation" },

30722 { 0xD005E4, "Huawei Device Co., Ltd." },

30723 { 0xD0066A, "Cornelis Networks, Inc." },

30724 { 0xD00790, "Texas Instruments" },

30725 { 0xD007CA, "Juniper Networks" },

30726 { 0xD009C8, "Cisco Systems, Inc" },

30727 { 0xD00AAB, "Yokogawa Digital Computer Corporation" },

30728 { 0xD00B27, "Murata Manufacturing Co., Ltd." },

30729 { 0xD00DF7, "Huawei Device Co., Ltd." },

30730 { 0xD00EA4, "Porsche Cars North America" },

30731 { 0xD00ED9, "Taicang T&W Electronics" },

30732 { 0xD00F6D, "T&W Electronics Company" },

30733 { 0xD01242, "BIOS Corporation" },

30734 { 0xD01255, "Hui Zhou Gaoshengda Technology Co.,LTD" },

30735 { 0xD012CB, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

30736 { 0xD0131E, "Sunrex Technology Corp" },

30737 { 0xD013FD, "LG Electronics (Mobile Communications)" },

30738 { 0xD01411, "IEEE Registration Authority" },

30739 { 0xD0154A, "zte corporation" },

30740 { 0xD015A6, "Aruba, a Hewlett Packard Enterprise Company" },

30741 { 0xD015BB, "IEEE Registration Authority" },

30742 { 0xD0167C, "eero inc." },

30743 { 0xD016B4, "HUAWEI TECHNOLOGIES CO.,LTD" },

30744 { 0xD016F0, "IEEE Registration Authority" },

30745 { 0xD01769, "Murata Manufacturing Co., Ltd." },

30746 { 0xD0176A, "Samsung Electronics Co.,Ltd" },

30747 { 0xD017C2, "ASUSTek COMPUTER INC." },

30748 { 0xD0196A, "Ciena Corporation" },

30749 { 0xD019D3, "ITEL MOBILE LIMITED" },

30750 { 0xD01AA7, "UniPrint" },

30751 { 0xD01B1F, "OHSUNG" },

30752 { 0xD01B49, "Samsung Electronics Co.,Ltd" },

30753 { 0xD01BF4, "Sagemcom Broadband SAS" },

30754 { 0xD01C3C, "TECNO MOBILE LIMITED" },

30755 { 0xD01CBB, "Beijing Ctimes Digital Technology Co., Ltd." },

30756 { 0xD01E1D, "SaiNXT Technologies LLP" },

30757 { 0xD021AC, "Yohana" },

30758 { 0xD021F9, "Ubiquiti Inc" },

30759 { 0xD02212, "IEEE Registration Authority" },

30760 { 0xD022BE, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

30761 { 0xD023DB, "Apple, Inc." },

30762 { 0xD02516, "MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

30763 { 0xD02544, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

30764 { 0xD02598, "Apple, Inc." },

30765 { 0xD02788, "Hon Hai Precision Ind. Co.,Ltd." },

30766 { 0xD028BA, "Realme Chongqing MobileTelecommunications Corp Ltd" },

30767 { 0xD02B20, "Apple, Inc." },

30768 { 0xD02C45, "littleBits Electronics, Inc." },

30769 { 0xD02DB3, "HUAWEI TECHNOLOGIES CO.,LTD" },

30770 { 0xD02EAB, "Texas Instruments" },

30771 { 0xD03110, "Ingenic Semiconductor Co.,Ltd" },

30772 { 0xD03169, "Samsung Electronics Co.,Ltd" },

30773 { 0xD03311, "Apple, Inc." },

30774 { 0xD035E5, "EM Microelectronic" },

30775 { 0xD03742, "Yulong Computer Telecommunication Scientific (Shenzhen) Co.,Ltd" },

30776 { 0xD03745, "TP-LINK TECHNOLOGIES CO.,LTD." },

30777 { 0xD03761, "Texas Instruments" },

30778 { 0xD03957, "Liteon Technology Corporation" },

30779 { 0xD03972, "Texas Instruments" },

30780 { 0xD039B3, "ARRIS Group, Inc." },

30781 { 0xD039EA, "NetApp" },

30782 { 0xD039FA, "Samsung Electronics Co.,Ltd" },

30783 { 0xD03C1F, "Intel Corporate" },

30784 { 0xD03D52, "Ava Security Limited" },

30785 { 0xD03DC3, "AQ Corporation" },

30786 { 0xD03E07, "Apple, Inc." },

30787 { 0xD03E5C, "HUAWEI TECHNOLOGIES CO.,LTD" },

30788 { 0xD03E7D, "CHIPSEA TECHNOLOGIES (SHENZHEN) CORP." },

30789 { 0xD03F27, "Wyze Labs Inc" },

30790 { 0xD03FAA, "Apple, Inc." },

30791 { 0xD040BE, "NPO RPS LLC" },

30792 { 0xD040EF, "Murata Manufacturing Co., Ltd." },

30793 { 0xD041C9, "Fiberhome Telecommunication Technologies Co.,LTD" },

30794 { 0xD0431E, "Dell Inc." },

30795 { 0xD04433, "Clourney Semiconductor" },

30796 { 0xD0460C, "Dell Inc." },

30797 { 0xD046DC, "Southwest Research Institute" },

30798 { 0xD047C1, "Elma Electronic AG" },

30799 { 0xD0484F, "Nokia Solutions and Networks GmbH & Co. KG" },

30800 { 0xD048F3, "DATTUS Inc" },

30801 { 0xD0497C, "OnePlus Technology (Shenzhen) Co., Ltd" },

30802 { 0xD0498B, "ZOOM SERVER" },

30803 { 0xD04CC1, "SINTRONES Technology Corp." },

30804 { 0xD04D2C, "Roku, Inc." },

30805 { 0xD04DC6, "Aruba, a Hewlett Packard Enterprise Company" },

30806 { 0xD04E50, "Mobiwire Mobiles (NingBo) Co., LTD" },

30807 { 0xD04E99, "HUAWEI TECHNOLOGIES CO.,LTD" },

30808 { 0xD04F58, "Ruckus Wireless" },

30809 { 0xD04F7E, "Apple, Inc." },

30810 { 0xD05099, "ASRock Incorporation" },

30811 { 0xD05157, "LEAX Arkivator Telecom" },

30812 { 0xD05162, "Sony Corporation" },

30813 { 0xD052A8, "Physical Graph Corporation" },

30814 { 0xD05349, "Liteon Technology Corporation" },

30815 { 0xD0542D, "Cambridge Industries(Group) Co.,Ltd." },

30816 { 0xD05475, "SAVI Controls" },

30817 { 0xD05509, "Nintendo Co.,Ltd" },

30818 { 0xD055B2, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

30819 { 0xD056BF, "AMOSENSE" },

30820 { 0xD0574C, "Cisco Systems, Inc" },

30821 { 0xD0577B, "Intel Corporate" },

30822 { 0xD05785, "Pantech Co., Ltd." },

30823 { 0xD05794, "Sagemcom Broadband SAS" },

30824 { 0xD057A1, "Werma Signaltechnik GmbH & Co. KG" },

30825 { 0xD05875, "Active Control Technology Inc." },

30826 { 0xD058A5, "Apple, Inc." },

30827 { 0xD058A8, "zte corporation" },

30828 { 0xD058AB, "Mara Tech LLC" },

30829 { 0xD058C0, "Qingdao Haier Multimedia Limited." },

30830 { 0xD058FC, "SKY UK LIMITED" },

30831 { 0xD05919, "zte corporation" },

30832 { 0xD05995, "Fiberhome Telecommunication Technologies Co.,LTD" },

30833 { 0xD059C3, "CeraMicro Technology Corporation" },

30834 { 0xD059E4, "Samsung Electronics Co.,Ltd" },

30835 { 0xD05A00, "Vantiva USA LLC" },

30836 { 0xD05A0F, "I-BT DIGITAL CO.,LTD" },

30837 { 0xD05AF1, "Shenzhen Pulier Tech CO.,Ltd" },

30838 { 0xD05AFD, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

30839 { 0xD05BA8, "zte corporation" },

30840 { 0xD05BCB, "Tianyi Telecom Terminals Company Limited" },

30841 { 0xD05C7A, "Sartura d.o.o." },

30842 { 0xD05F64, "IEEE Registration Authority" },

30843 { 0xD05FB8, "Texas Instruments" },

30844 { 0xD05FCE, "Hitachi Data Systems" },

30845 { 0xD0608C, "zte corporation" },

30846 { 0xD06158, "HUAWEI TECHNOLOGIES CO.,LTD" },

30847 { 0xD0622C, "Xi'an Yipu Telecom Technology Co.,Ltd." },

30848 { 0xD062A0, "China Essence Technology (Zhumadian) Co., Ltd." },

30849 { 0xD0634D, "Meiko Maschinenbau GmbH &amp; Co. KG" },

30850 { 0xD063B4, "SolidRun Ltd." },

30851 { 0xD06544, "Apple, Inc." },

30852 { 0xD06578, "Intel Corporate" },

30853 { 0xD065CA, "HUAWEI TECHNOLOGIES CO.,LTD" },

30854 { 0xD0666D, "Shenzhen Bus-Lan Technology Co., Ltd." },

30855 { 0xD0667B, "Samsung Electronics Co.,Ltd" },

30856 { 0xD06726, "Hewlett Packard Enterprise" },

30857 { 0xD067E5, "Dell Inc." },

30858 { 0xD0699E, "LUMINEX Lighting Control Equipment" },

30859 { 0xD069D0, "Verto Medical Solutions, LLC" },

30860 { 0xD06A1F, "BSE CO.,LTD." },

30861 { 0xD06B78, "Apple, Inc." },

30862 { 0xD06DC9, "Sagemcom Broadband SAS" },

30863 { 0xD06EDE, "Sagemcom Broadband SAS" },

30864 { 0xD06F4A, "TOPWELL INTERNATIONAL HOLDINGS LIMITED" },

30865 { 0xD06F82, "HUAWEI TECHNOLOGIES CO.,LTD" },

30866 { 0xD071C4, "zte corporation" },

30867 { 0xD072DC, "Cisco Systems, Inc" },

30868 { 0xD0737F, "Mini-Circuits" },

30869 { 0xD07380, "Huawei Device Co., Ltd." },

30870 { 0xD0738E, "DONG OH PRECISION CO., LTD." },

30871 { 0xD073D5, "LIFI LABS MANAGEMENT PTY LTD" },

30872 { 0xD075BE, "Reno A&E" },

30873 { 0xD07650, "IEEE Registration Authority" },

30874 { 0xD0768F, "Calix Inc." },

30875 { 0xD076E7, "TP-LINK TECHNOLOGIES CO.,LTD." },

30876 { 0xD07714, "Motorola Mobility LLC, a Lenovo Company" },

30877 { 0xD077CE, "Edgecore Networks Corporation" },

30878 { 0xD07880, "Fiberhome Telecommunication Technologies Co.,LTD" },

30879 { 0xD07AB5, "HUAWEI TECHNOLOGIES CO.,LTD" },

30880 { 0xD07B6F, "Zhuhai Yunmai Technology Co.,Ltd" },

30881 { 0xD07C2D, "Leie IOT technology Co., Ltd" },

30882 { 0xD07CB2, "Sigmastar Technology Ltd." },

30883 { 0xD07D33, "Huawei Device Co., Ltd." },

30884 { 0xD07DE5, "Forward Pay Systems, Inc." },

30885 { 0xD07E01, "Huawei Device Co., Ltd." },

30886 { 0xD07E28, "Hewlett Packard" },

30887 { 0xD07E35, "Intel Corporate" },

30888 { 0xD07FA0, "Samsung Electronics Co.,Ltd" },

30889 { 0xD07FC4, "Ou Wei Technology Co.，Ltd. of Shenzhen City" },

30890 { 0xD0817A, "Apple, Inc." },

30891 { 0xD081C5, "Juniper Networks" },

30892 { 0xD083D4, "Xtel Wireless ApS" },

30893 { 0xD084B0, "Sagemcom Broadband SAS" },

30894 { 0xD087E2, "Samsung Electronics Co.,Ltd" },

30895 { 0xD0880C, "Apple, Inc." },

30896 { 0xD08999, "APCON, Inc." },

30897 { 0xD08A55, "Skullcandy" },

30898 { 0xD08A91, "Vantiva USA LLC" },

30899 { 0xD08B7E, "Passif Semiconductor" },

30900 { 0xD08CB5, "Texas Instruments" },

30901 { 0xD08CFF, "UPWIS AB" },

30902 { 0xD08E79, "Dell Inc." },

30903 { 0xD09168, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

30904 { 0xD09200, "FiRa Consortium" },

30905 { 0xD0929E, "Microsoft Corporation" },

30906 { 0xD092FA, "Fiberhome Telecommunication Technologies Co.,LTD" },

30907 { 0xD09380, "Ducere Technologies Pvt. Ltd." },

30908 { 0xD09395, "IEEE Registration Authority" },

30909 { 0xD093F8, "Stonestreet One LLC" },

30910 { 0xD09466, "Dell Inc." },

30911 { 0xD094CF, "HUAWEI TECHNOLOGIES CO.,LTD" },

30912 { 0xD095C7, "Pantech Co., Ltd." },

30913 { 0xD09686, "IEEE Registration Authority" },

30914 { 0xD096FB, "DZS Inc." },

30915 { 0xD097FE, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

30916 { 0xD0989C, "ConMet" },

30917 { 0xD099D5, "Alcatel-Lucent" },

30918 { 0xD09B05, "Emtronix" },

30919 { 0xD09C30, "Foster Electric Company, Limited" },

30920 { 0xD09C7A, "Xiaomi Communications Co Ltd" },

30921 { 0xD09CAE, "vivo Mobile Communication Co., Ltd." },

30922 { 0xD09D0A, "LINKCOM" },

30923 { 0xD09DAB, "TCT mobile ltd" },

30924 { 0xD09FD9, "IEEE Registration Authority" },

30925 { 0xD0A011, "IEEE Registration Authority" },

30926 { 0xD0A0BB, "Shenzhen iComm Semiconductor CO.,LTD" },

30927 { 0xD0A0D6, "ChengDu TD Tech" },

30928 { 0xD0A311, "Neuberger Gebäudeautomation GmbH" },

30929 { 0xD0A46F, "China Dragon Technology Limited" },

30930 { 0xD0A4B1, "Sonifex Ltd." },

30931 { 0xD0A5A6, "Cisco Systems, Inc" },

30932 { 0xD0A637, "Apple, Inc." },

30933 { 0xD0A9D3, "EM Microelectronic" },

30934 { 0xD0ABD5, "Intel Corporate" },

30935 { 0xD0AD08, "HP Inc." },

30936 { 0xD0AEEC, "Alpha Networks Inc." },

30937 { 0xD0AFB6, "Linktop Technology Co., LTD" },

30938 { 0xD0B0CD, "Moen" },

30939 { 0xD0B128, "Samsung Electronics Co.,Ltd" },

30940 { 0xD0B214, "PoeWit Inc" },

30941 { 0xD0B2C4, "Vantiva USA LLC" },

30942 { 0xD0B33F, "Shenzhen TINNO Mobile Technology Corp." },

30943 { 0xD0B3C2, "Meta Platforms Technologies, LLC" },

30944 { 0xD0B45D, "Huawei Device Co., Ltd." },

30945 { 0xD0B498, "Robert Bosch LLC Automotive Electronics" },

30946 { 0xD0B523, "Bestcare Cloucal Corp." },

30947 { 0xD0B53D, "SEPRO ROBOTIQUE" },

30948 { 0xD0B5C2, "Texas Instruments" },

30949 { 0xD0B60A, "Xingluo Technology Company Limited" },

30950 { 0xD0B66F, "SERNET (SUZHOU) TECHNOLOGIES CORPORATION" },

30951 { 0xD0BAE4, "Shanghai MXCHIP Information Technology Co., Ltd." },

30952 { 0xD0BB61, "zte corporation" },

30953 { 0xD0BB80, "SHL Telemedicine International Ltd." },

30954 { 0xD0BCC1, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

30955 { 0xD0BD01, "DS International" },

30956 { 0xD0BE2C, "CNSLink Co., Ltd." },

30957 { 0xD0BF9C, "Hewlett Packard" },

30958 { 0xD0C050, "Apple, Inc." },

30959 { 0xD0C0BF, "Actions Microelectronics Co., Ltd" },

30960 { 0xD0C193, "SKYBELL, INC" },

30961 { 0xD0C1B1, "Samsung Electronics Co.,Ltd" },

30962 { 0xD0C24E, "Samsung Electronics Co.,Ltd" },

30963 { 0xD0C282, "Cisco Systems, Inc" },

30964 { 0xD0C31E, "JUNGJIN Electronics Co.,Ltd" },

30965 { 0xD0C35A, "Jabil Circuit de Chihuahua" },

30966 { 0xD0C42F, "Tamagawa Seiki Co.,Ltd." },

30967 { 0xD0C5D3, "AzureWave Technology Inc." },

30968 { 0xD0C5D8, "LATECOERE" },

30969 { 0xD0C5F3, "Apple, Inc." },

30970 { 0xD0C637, "Intel Corporate" },

30971 { 0xD0C65B, "HUAWEI TECHNOLOGIES CO.,LTD" },

30972 { 0xD0C730, "zte corporation" },

30973 { 0xD0C789, "Cisco Systems, Inc" },

30974 { 0xD0C7C0, "TP-LINK TECHNOLOGIES CO.,LTD." },

30975 { 0xD0C857, "IEEE Registration Authority" },

30976 { 0xD0C901, "GLA ELECTRONICS PVT LTD" },

30977 { 0xD0C907, "Private" },

30978 { 0xD0CDE1, "Scientech Electronics" },

30979 { 0xD0CEC9, "HAN CHANG" },

30980 { 0xD0CF0E, "Sagemcom Broadband SAS" },

30981 { 0xD0CF5E, "Energy Micro AS" },

30982 { 0xD0CFD8, "Huizhou Boshijie Technology Co.,Ltd" },

30983 { 0xD0D003, "Samsung Electronics Co.,Ltd" },

30984 { 0xD0D04B, "HUAWEI TECHNOLOGIES CO.,LTD" },

30985 { 0xD0D0FD, "Cisco Systems, Inc" },

30986 { 0xD0D212, "K2NET Co.,Ltd." },

30987 { 0xD0D23C, "Apple, Inc." },

30988 { 0xD0D286, "Beckman Coulter K.K." },

30989 { 0xD0D2B0, "Apple, Inc." },

30990 { 0xD0D3E0, "Aruba, a Hewlett Packard Enterprise Company" },

30991 { 0xD0D3FC, "Mios, Ltd." },

30992 { 0xD0D412, "ADB Broadband Italia" },

30993 { 0xD0D471, "MVTECH co., Ltd" },

30994 { 0xD0D6CC, "Wintop" },

30995 { 0xD0D783, "HUAWEI TECHNOLOGIES CO.,LTD" },

30996 { 0xD0D7BE, "HUAWEI TECHNOLOGIES CO.,LTD" },

30997 { 0xD0D94F, "IEEE Registration Authority" },

30998 { 0xD0DAD7, "Apple, Inc." },

30999 { 0xD0DB32, "Nokia Corporation" },

31000 { 0xD0DBB7, "Casa Systems" },

31001 { 0xD0DC2C, "Cisco Systems, Inc" },

31002 { 0xD0DD49, "Juniper Networks" },

31003 { 0xD0DD7C, "zte corporation" },

31004 { 0xD0DF9A, "Liteon Technology Corporation" },

31005 { 0xD0DFB2, "Genie Networks Limited" },

31006 { 0xD0DFC7, "Samsung Electronics Co.,Ltd" },

31007 { 0xD0E042, "Cisco Systems, Inc" },

31008 { 0xD0E140, "Apple, Inc." },

31009 { 0xD0E347, "Yoga" },

31010 { 0xD0E40B, "Wearable Inc." },

31011 { 0xD0E44A, "Murata Manufacturing Co., Ltd." },

31012 { 0xD0E54D, "ARRIS Group, Inc." },

31013 { 0xD0E782, "AzureWave Technology Inc." },

31014 { 0xD0E828, "Radiant Industries Incorporated" },

31015 { 0xD0EB03, "Zhehua technology limited" },

31016 { 0xD0EB9E, "Seowoo Inc." },

31017 { 0xD0EC35, "Cisco Systems, Inc" },

31018 { 0xD0EDFF, "ZF CVCS" },

31019 { 0xD0EF76, "Espressif Inc." },

31020 { 0xD0EFC1, "HUAWEI TECHNOLOGIES CO.,LTD" },

31021 { 0xD0F0DB, "Ericsson" },

31022 { 0xD0F121, "Xi'an LINKSCI Technology Co., Ltd" },

31023 { 0xD0F27F, "BrewLogix, LLC" },

31024 { 0xD0F3F5, "Huawei Device Co., Ltd." },

31025 { 0xD0F405, "Hon Hai Precision Industry Co., Ltd." },

31026 { 0xD0F4F7, "Huawei Device Co., Ltd." },

31027 { 0xD0F520, "KYOCERA Corporation" },

31028 { 0xD0F73B, "Helmut Mauell GmbH Werk Weida" },

31029 { 0xD0F865, "ITEL MOBILE LIMITED" },

31030 { 0xD0F88C, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

31031 { 0xD0F928, "zte corporation" },

31032 { 0xD0F99B, "zte corporation" },

31033 { 0xD0FA1D, "Qihoo 360 Technology Co.,Ltd" },

31034 { 0xD0FCCC, "Samsung Electronics Co.,Ltd" },

31035 { 0xD0FCD0, "HUMAX Co., Ltd." },

31036 { 0xD0FF50, "Texas Instruments" },

31037 { 0xD0FF98, "HUAWEI TECHNOLOGIES CO.,LTD" },

31038 { 0xD4000D, "Phoenix Broadband Technologies, LLC." },

31039 { 0xD40057, "MC Technologies GmbH" },

31040 { 0xD40068, "Fiberhome Telecommunication Technologies Co.,LTD" },

31041 { 0xD40129, "Broadcom" },

31042 { 0xD40145, "ATW TECHNOLOGY, INC." },

31043 { 0xD4016D, "TP-LINK TECHNOLOGIES CO.,LTD." },

31044 { 0xD401C3, "Routerboard.com" },

31045 { 0xD4024A, "Delphian Systems LLC" },

31046 { 0xD404CD, "ARRIS Group, Inc." },

31047 { 0xD404E6, "Broadcom Limited" },

31048 { 0xD404FF, "Juniper Networks" },

31049 { 0xD40598, "ARRIS Group, Inc." },

31050 { 0xD405DE, "eero inc." },

31051 { 0xD40868, "Beijing Lanxum Computer Technology CO.,LTD." },

31052 { 0xD40AA9, "ARRIS Group, Inc." },

31053 { 0xD40B1A, "HTC Corporation" },

31054 { 0xD40BB9, "Solid Semecs bv." },

31055 { 0xD40F9E, "Apple, Inc." },

31056 { 0xD40FB2, "Applied Micro Electronics AME bv" },

31057 { 0xD41090, "iNFORM Systems AG" },

31058 { 0xD410CF, "Huanshun Network Science and Technology Co., Ltd." },

31059 { 0xD411A3, "Samsung Electronics Co.,Ltd" },

31060 { 0xD411D6, "ShotSpotter, Inc." },

31061 { 0xD41243, "AMPAK Technology, Inc." },

31062 { 0xD41296, "Anobit Technologies Ltd." },

31063 { 0xD412BB, "Quadrant Components Inc. Ltd" },

31064 { 0xD4136F, "Asia Pacific Brands" },

31065 { 0xD413F8, "Peplink International Ltd." },

31066 { 0xD41761, "Xiaomi Communications Co Ltd" },

31067 { 0xD419F6, "NXP Semiconductor (Tianjin) LTD." },

31068 { 0xD41A3F, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

31069 { 0xD41AC8, "Nippon Printer Engineering" },

31070 { 0xD41AD1, "Zyxel Communications Corporation" },

31071 { 0xD41B81, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

31072 { 0xD41C1C, "RCF S.P.A." },

31073 { 0xD41D71, "Palo Alto Networks" },

31074 { 0xD41E35, "TOHO Electronics INC." },

31075 { 0xD41F0C, "JAI Manufacturing" },

31076 { 0xD42000, "IEEE Registration Authority" },

31077 { 0xD4206D, "HTC Corporation" },

31078 { 0xD420B0, "Mist Systems, Inc." },

31079 { 0xD42122, "Sercomm Corporation." },

31080 { 0xD4223F, "Lenovo Mobile Communication Technology Ltd." },

31081 { 0xD4224E, "Alcatel Lucent" },

31082 { 0xD422CD, "Movella Technologies B.V." },

31083 { 0xD42493, "GW Technologies Co.,Ltd" },

31084 { 0xD424DD, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

31085 { 0xD4258B, "Intel Corporate" },

31086 { 0xD425CC, "IEEE Registration Authority" },

31087 { 0xD42751, "Infopia Co., Ltd" },

31088 { 0xD42787, "Shanghai High-Flying Electronics Technology Co., Ltd" },

31089 { 0xD428B2, "ioBridge, Inc." },

31090 { 0xD428D5, "TCT mobile ltd" },

31091 { 0xD429EA, "Zimory GmbH" },

31092 { 0xD42C0F, "ARRIS Group, Inc." },

31093 { 0xD42C3D, "Sky Light Digital Limited" },

31094 { 0xD42C44, "Cisco Systems, Inc" },

31095 { 0xD42C46, "BUFFALO.INC" },

31096 { 0xD42DC5, "i-PRO Co., Ltd." },

31097 { 0xD42F23, "Akenori PTE Ltd" },

31098 { 0xD42FCA, "Apple, Inc." },

31099 { 0xD43127, "Ruijie Networks Co.,LTD" },

31100 { 0xD4319D, "Sinwatec" },

31101 { 0xD43260, "GoPro" },

31102 { 0xD43266, "Fike Corporation" },

31103 { 0xD4351D, "Technicolor Delivery Technologies Belgium NV" },

31104 { 0xD43538, "Beijing Xiaomi Mobile Software Co., Ltd" },

31105 { 0xD4354A, "ALAXALA Networks Corporation" },

31106 { 0xD43639, "Texas Instruments" },

31107 { 0xD436DB, "Jiangsu Toppower Automotive Electronics Co., Ltd" },

31108 { 0xD437D7, "zte corporation" },

31109 { 0xD43844, "UNION MAN TECHNOLOGY CO.,LTD" },

31110 { 0xD4389C, "Sony Corporation" },

31111 { 0xD439B8, "Ciena Corporation" },

31112 { 0xD43A2C, "Google, Inc." },

31113 { 0xD43A2E, "SHENZHEN MTC CO LTD" },

31114 { 0xD43A2F, "SHENZHEN MTC CO LTD" },

31115 { 0xD43A65, "IGRS Engineering Lab Ltd." },

31116 { 0xD43AE9, "DONGGUAN ipt INDUSTRIAL CO., LTD" },

31117 { 0xD43B04, "Intel Corporate" },

31118 { 0xD43D39, "Dialog Semiconductor" },

31119 { 0xD43D67, "Carma Industries Inc." },

31120 { 0xD43D7E, "Micro-Star Int'l Co, Ltd" },

31121 { 0xD43DF3, "Zyxel Communications Corporation" },

31122 { 0xD43F32, "eero inc." },

31123 { 0xD43FCB, "ARRIS Group, Inc." },

31124 { 0xD440D0, "OCOSMOS Co., LTD" },

31125 { 0xD440F0, "HUAWEI TECHNOLOGIES CO.,LTD" },

31126 { 0xD4413F, "Gen IV Technology LLC" },

31127 { 0xD44165, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

31128 { 0xD4430E, "Zhejiang Dahua Technology Co., Ltd." },

31129 { 0xD443A8, "Changzhou Haojie Electric Co., Ltd." },

31130 { 0xD445E8, "Jiangxi Hongpai Technology Co., Ltd." },

31131 { 0xD44649, "HUAWEI TECHNOLOGIES CO.,LTD" },

31132 { 0xD446E1, "Apple, Inc." },

31133 { 0xD4475A, "ScreenBeam, Inc." },

31134 { 0xD4482D, "Shenzhen Deejoy Lighting Technology Co.,Ltd." },

31135 { 0xD44B5E, "TAIYO YUDEN CO., LTD." },

31136 { 0xD44BB6, "Zhejiang Tmall Technology Co., Ltd." },

31137 { 0xD44C24, "Vuppalamritha Magnetic Components LTD" },

31138 { 0xD44C9C, "Shenzhen YOOBAO Technology Co.Ltd" },

31139 { 0xD44CA7, "Informtekhnika & Communication, LLC" },

31140 { 0xD44D77, "Nokia" },

31141 { 0xD44DA4, "Murata Manufacturing Co., Ltd." },

31142 { 0xD44F67, "HUAWEI TECHNOLOGIES CO.,LTD" },

31143 { 0xD44F68, "Eidetic Communications Inc" },

31144 { 0xD44F80, "Kemper Digital GmbH" },

31145 { 0xD4503F, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

31146 { 0xD4507A, "CEIVA Logic, Inc" },

31147 { 0xD4522A, "TangoWiFi.com" },

31148 { 0xD45251, "IBT Ingenieurbureau Broennimann Thun" },

31149 { 0xD45297, "nSTREAMS Technologies, Inc." },

31150 { 0xD452C7, "Beijing L&S Lancom Platform Tech. Co., Ltd." },

31151 { 0xD452EE, "SKY UK LIMITED" },

31152 { 0xD45347, "Merytronic 2012, S.L." },

31153 { 0xD45383, "Murata Manufacturing Co., Ltd." },

31154 { 0xD453AF, "VIGO System S.A." },

31155 { 0xD4548B, "Intel Corporate" },

31156 { 0xD45556, "Fiber Mountain Inc." },

31157 { 0xD455BE, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

31158 { 0xD45763, "Apple, Inc." },

31159 { 0xD45800, "Fiberhome Telecommunication Technologies Co.,LTD" },

31160 { 0xD45A3F, "Juniper Networks" },

31161 { 0xD45AB2, "Galleon Systems" },

31162 { 0xD45C70, "Wi-Fi Alliance" },

31163 { 0xD45D42, "Nokia Corporation" },

31164 { 0xD45D64, "ASUSTek COMPUTER INC." },

31165 { 0xD45DDF, "PEGATRON CORPORATION" },

31166 { 0xD45EEC, "Beijing Xiaomi Electronics Co., Ltd." },

31167 { 0xD45F25, "Shenzhen YOUHUA Technology Co., Ltd" },

31168 { 0xD45F7A, "HUAWEI TECHNOLOGIES CO.,LTD" },

31169 { 0xD46075, "Baidu Online Network Technology (Beijing) Co., Ltd" },

31170 { 0xD460E3, "Sercomm Corporation." },

31171 { 0xD4612E, "HUAWEI TECHNOLOGIES CO.,LTD" },

31172 { 0xD46132, "Pro Concept Manufacturer Co.,Ltd." },

31173 { 0xD46137, "IEEE Registration Authority" },

31174 { 0xD4619D, "Apple, Inc." },

31175 { 0xD461DA, "Apple, Inc." },

31176 { 0xD461FE, "Hangzhou H3C Technologies Co., Limited" },

31177 { 0xD462EA, "HUAWEI TECHNOLOGIES CO.,LTD" },

31178 { 0xD46352, "Vutility Inc." },

31179 { 0xD463C6, "Motorola Mobility LLC, a Lenovo Company" },

31180 { 0xD463DE, "vivo Mobile Communication Co., Ltd." },

31181 { 0xD463FE, "Arcadyan Corporation" },

31182 { 0xD464F7, "CHENGDU USEE DIGITAL TECHNOLOGY CO., LTD" },

31183 { 0xD46624, "Cisco Systems, Inc" },

31184 { 0xD466A8, "Riedo Networks Ltd" },

31185 { 0xD46761, "XonTel Technology Co." },

31186 { 0xD467D3, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

31187 { 0xD467E7, "Fiberhome Telecommunication Technologies Co.,LTD" },

31188 { 0xD4684D, "Ruckus Wireless" },

31189 { 0xD46867, "Neoventus Design Group" },

31190 { 0xD468AA, "Apple, Inc." },

31191 { 0xD468BA, "Shenzhen Sundray Technologies Company Limited" },

31192 { 0xD469A5, "Miura Systems Ltd." },

31193 { 0xD46A35, "Cisco Systems, Inc" },

31194 { 0xD46A6A, "Hon Hai Precision Ind. Co.,Ltd." },

31195 { 0xD46A91, "SnapAV" },

31196 { 0xD46AA8, "HUAWEI TECHNOLOGIES CO.,LTD" },

31197 { 0xD46BA6, "HUAWEI TECHNOLOGIES CO.,LTD" },

31198 { 0xD46C6D, "ARRIS Group, Inc." },

31199 { 0xD46CBF, "Goodrich ISR" },

31200 { 0xD46CDA, "CSM GmbH" },

31201 { 0xD46D50, "Cisco Systems, Inc" },

31202 { 0xD46D6D, "Intel Corporate" },

31203 { 0xD46E0E, "TP-LINK TECHNOLOGIES CO.,LTD." },

31204 { 0xD46E5C, "HUAWEI TECHNOLOGIES CO.,LTD" },

31205 { 0xD46F42, "WAXESS USA Inc" },

31206 { 0xD47208, "Bragi GmbH" },

31207 { 0xD47226, "zte corporation" },

31208 { 0xD47350, "DBG Commnunications Technology Co., Ltd." },

31209 { 0xD47415, "Huawei Device Co., Ltd." },

31210 { 0xD4741B, "Beijing HuaDa ZhiBao Electronic System Co.,Ltd." },

31211 { 0xD476A0, "Fortinet, Inc." },

31212 { 0xD476EA, "zte corporation" },

31213 { 0xD4772B, "Nanjing Ztlink Network Technology Co.,Ltd" },

31214 { 0xD47798, "Cisco Systems, Inc" },

31215 { 0xD477B2, "Netix Global B.V." },

31216 { 0xD47856, "Avaya Inc" },

31217 { 0xD4789B, "Cisco Systems, Inc" },

31218 { 0xD47954, "Huawei Device Co., Ltd." },

31219 { 0xD479C3, "Cameronet GmbH & Co. KG" },

31220 { 0xD47AE2, "Samsung Electronics Co.,Ltd" },

31221 { 0xD47B35, "NEO Monitors AS" },

31222 { 0xD47B75, "HARTING Electronics GmbH" },

31223 { 0xD47BB0, "ASKEY COMPUTER CORP" },

31224 { 0xD47C44, "IEEE Registration Authority" },

31225 { 0xD47DFC, "TECNO MOBILE LIMITED" },

31226 { 0xD47EE4, "China Mobile IOT Company Limited" },

31227 { 0xD47F78, "Dopple B.V." },

31228 { 0xD481CA, "iDevices, LLC" },

31229 { 0xD481D7, "Dell Inc." },

31230 { 0xD4823E, "Argosy Technologies, Ltd." },

31231 { 0xD48304, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

31232 { 0xD48409, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

31233 { 0xD48457, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

31234 { 0xD48564, "Hewlett Packard" },

31235 { 0xD48660, "Arcadyan Corporation" },

31236 { 0xD487CC, "Sivantos GmbH" },

31237 { 0xD487D8, "Samsung Electronics Co.,Ltd" },

31238 { 0xD4883F, "HDPRO CO., LTD." },

31239 { 0xD48866, "HUAWEI TECHNOLOGIES CO.,LTD" },

31240 { 0xD48890, "Samsung Electronics Co.,Ltd" },

31241 { 0xD48A39, "Samsung Electronics Co.,Ltd" },

31242 { 0xD48A3B, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

31243 { 0xD48AFC, "Espressif Inc." },

31244 { 0xD48CB5, "Cisco Systems, Inc" },

31245 { 0xD48D26, "LG Innotek" },

31246 { 0xD48DD9, "Meld Technology, Inc" },

31247 { 0xD48F33, "Microsoft Corporation" },

31248 { 0xD48FA2, "Huawei Device Co., Ltd." },

31249 { 0xD48FAA, "Sogecam Industrial, S.A." },

31250 { 0xD4909C, "Apple, Inc." },

31251 { 0xD490E0, "Topcon Electronics GmbH & Co. KG" },

31252 { 0xD4910F, "Amazon Technologies Inc." },

31253 { 0xD491AF, "Electroacustica General Iberica, S.A." },

31254 { 0xD49234, "NEC Corporation" },

31255 { 0xD4925E, "Technicolor Delivery Technologies Belgium NV" },

31256 { 0xD492B9, "ORION NOVA, S.L." },

31257 { 0xD49390, "CLEVO CO." },

31258 { 0xD49398, "Nokia Corporation" },

31259 { 0xD493A0, "Fidelix Oy" },

31260 { 0xD49400, "HUAWEI TECHNOLOGIES CO.,LTD" },

31261 { 0xD4945A, "COSMO CO., LTD" },

31262 { 0xD494A1, "Texas Instruments" },

31263 { 0xD494E8, "HUAWEI TECHNOLOGIES CO.,LTD" },

31264 { 0xD494FB, "Continental Automotive Systems Inc." },

31265 { 0xD49524, "Clover Network, Inc." },

31266 { 0xD496DF, "SUNGJIN C&T CO.,LTD" },

31267 { 0xD4970B, "Xiaomi Communications Co Ltd" },

31268 { 0xD4996C, "Juniper Networks" },

31269 { 0xD49A20, "Apple, Inc." },

31270 { 0xD49AA0, "VNPT TECHNOLOGY" },

31271 { 0xD49AF6, "AzureWave Technology Inc." },

31272 { 0xD49B5C, "Chongqing Miedu Technology Co., Ltd." },

31273 { 0xD49B74, "Kinetic Technologies" },

31274 { 0xD49C28, "JayBird LLC" },

31275 { 0xD49C8E, "University of FUKUI" },

31276 { 0xD49CDD, "AMPAK Technology,Inc." },

31277 { 0xD49CF4, "Palo Alto Networks" },

31278 { 0xD49DC0, "Samsung Electronics Co.,Ltd" },

31279 { 0xD49E05, "zte corporation" },

31280 { 0xD49E3B, "Guangzhou Shiyuan Electronic Technology Company Limited" },

31281 { 0xD49E6D, "Wuhan Zhongyuan Huadian Science & Technology Co.," },

31282 { 0xD49FDD, "Huawei Device Co., Ltd." },

31283 { 0xD4A02A, "Cisco Systems, Inc" },

31284 { 0xD4A148, "HUAWEI TECHNOLOGIES CO.,LTD" },

31285 { 0xD4A23D, "New H3C Technologies Co., Ltd" },

31286 { 0xD4A33D, "Apple, Inc." },

31287 { 0xD4A38B, "ELE(GROUP)CO.,LTD" },

31288 { 0xD4A3EB, "Shenzhen iComm Semiconductor CO.,LTD" },

31289 { 0xD4A425, "SMAX Technology Co., Ltd." },

31290 { 0xD4A499, "InView Technology Corporation" },

31291 { 0xD4A651, "Tuya Smart Inc." },

31292 { 0xD4A923, "HUAWEI TECHNOLOGIES CO.,LTD" },

31293 { 0xD4A928, "GreenWave Reality Inc" },

31294 { 0xD4AAFF, "MICRO WORLD" },

31295 { 0xD4AB82, "ARRIS Group, Inc." },

31296 { 0xD4ABCD, "Hui Zhou Gaoshengda Technology Co.,LTD" },

31297 { 0xD4AC4E, "BODi rS, LLC" },

31298 { 0xD4AD20, "Jinan USR IOT Technology Limited" },

31299 { 0xD4AD2D, "Fiberhome Telecommunication Technologies Co.,LTD" },

31300 { 0xD4AD71, "Cisco Systems, Inc" },

31301 { 0xD4ADBD, "Cisco Systems, Inc" },

31302 { 0xD4ADFC, "Shenzhen Intellirocks Tech. Co. Ltd." },

31303 { 0xD4AE05, "Samsung Electronics Co.,Ltd" },

31304 { 0xD4AE52, "Dell Inc." },

31305 { 0xD4AFF7, "Arista Networks" },

31306 { 0xD4B110, "HUAWEI TECHNOLOGIES CO.,LTD" },

31307 { 0xD4B169, "Le Shi Zhi Xin Electronic Technology (Tianjin) Limited" },

31308 { 0xD4B27A, "ARRIS Group, Inc." },

31309 { 0xD4B43E, "Messcomp Datentechnik GmbH" },

31310 { 0xD4B5CD, "Sagemcom Broadband SAS" },

31311 { 0xD4B680, "Shanghai Linkyum Microeletronics Co.,Ltd" },

31312 { 0xD4B709, "zte corporation" },

31313 { 0xD4B761, "Sichuan AI-Link Technology Co., Ltd." },

31314 { 0xD4B7D0, "Ciena Corporation" },

31315 { 0xD4B8FF, "Home Control Singapore Pte Ltd" },

31316 { 0xD4B92F, "Vantiva USA LLC" },

31317 { 0xD4BABA, "IEEE Registration Authority" },

31318 { 0xD4BAFA, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

31319 { 0xD4BBC8, "vivo Mobile Communication Co., Ltd." },

31320 { 0xD4BBE6, "Huawei Device Co., Ltd." },

31321 { 0xD4BD1E, "5VT Technologies,Taiwan LTd." },

31322 { 0xD4BD4F, "Ruckus Wireless" },

31323 { 0xD4BED9, "Dell Inc." },

31324 { 0xD4BF2D, "SE Controls Asia Pacific Ltd" },

31325 { 0xD4BF7F, "UPVEL" },

31326 { 0xD4C19E, "Ruckus Wireless" },

31327 { 0xD4C1C8, "zte corporation" },

31328 { 0xD4C1FC, "Nokia Corporation" },

31329 { 0xD4C3B0, "Gearlinx Pty Ltd" },

31330 { 0xD4C766, "Acentic GmbH" },

31331 { 0xD4C8B0, "Prime Electronics & Satellitics Inc." },

31332 { 0xD4C93C, "Cisco Systems, Inc" },

31333 { 0xD4C94B, "Motorola Mobility LLC, a Lenovo Company" },

31334 { 0xD4C9B2, "Quanergy Systems Inc" },

31335 { 0xD4C9EF, "Hewlett Packard" },

31336 { 0xD4CA6D, "Routerboard.com" },

31337 { 0xD4CA6E, "u-blox AG" },

31338 { 0xD4CBAF, "Nokia Corporation" },

31339 { 0xD4CBCC, "vivo Mobile Communication Co., Ltd." },

31340 { 0xD4CEB8, "Enatel LTD" },

31341 { 0xD4CF37, "Symbolic IO" },

31342 { 0xD4CFF9, "Shenzhen SEI Robotics Co.,Ltd" },

31343 { 0xD4D184, "ADB Broadband Italia" },

31344 { 0xD4D249, "Power Ethernet" },

31345 { 0xD4D252, "Intel Corporate" },

31346 { 0xD4D2D6, "FN-LINK TECHNOLOGY LIMITED" },

31347 { 0xD4D2E5, "BKAV Corporation" },

31348 { 0xD4D4DA, "Espressif Inc." },

31349 { 0xD4D50D, "Southwest Microwave, Inc" },

31350 { 0xD4D51B, "HUAWEI TECHNOLOGIES CO.,LTD" },

31351 { 0xD4D659, "Meta Platforms Technologies, LLC" },

31352 { 0xD4D748, "Cisco Systems, Inc" },

31353 { 0xD4D7A9, "Shanghai Kaixiang Info Tech LTD" },

31354 { 0xD4D7CF, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

31355 { 0xD4D853, "Intel Corporate" },

31356 { 0xD4D892, "HUAWEI TECHNOLOGIES CO.,LTD" },

31357 { 0xD4D898, "Korea CNO Tech Co., Ltd" },

31358 { 0xD4D919, "GoPro" },

31359 { 0xD4DA21, "Beijing Xiaomi Mobile Software Co., Ltd" },

31360 { 0xD4DACD, "SKY UK LIMITED" },

31361 { 0xD4DC09, "Mist Systems, Inc." },

31362 { 0xD4DCCD, "Apple, Inc." },

31363 { 0xD4DF57, "Alpinion Medical Systems" },

31364 { 0xD4E053, "Aruba, a Hewlett Packard Enterprise Company" },

31365 { 0xD4E08E, "ValueHD Corporation" },

31366 { 0xD4E22F, "Roku, Inc" },

31367 { 0xD4E2CB, "Vantiva USA LLC" },

31368 { 0xD4E32C, "S. Siedle & Sohne" },

31369 { 0xD4E33F, "Nokia" },

31370 { 0xD4E6B7, "Samsung Electronics Co.,Ltd" },

31371 { 0xD4E853, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

31372 { 0xD4E880, "Cisco Systems, Inc" },

31373 { 0xD4E8B2, "Samsung Electronics Co.,Ltd" },

31374 { 0xD4E90B, "CVT CO.,LTD" },

31375 { 0xD4E95E, "Texas Instruments" },

31376 { 0xD4E98A, "Intel Corporate" },

31377 { 0xD4EA0E, "Avaya Inc" },

31378 { 0xD4EB68, "Cisco Systems, Inc" },

31379 { 0xD4EC0C, "Harley-Davidson Motor Company" },

31380 { 0xD4EC86, "LinkedHope Intelligent Technologies Co., Ltd" },

31381 { 0xD4ECAB, "vivo Mobile Communication Co., Ltd." },

31382 { 0xD4EE07, "HIWIFI Co., Ltd." },

31383 { 0xD4EEDE, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

31384 { 0xD4F027, "Trust Power Ltd." },

31385 { 0xD4F04A, "SKY UK LIMITED" },

31386 { 0xD4F057, "Nintendo Co.,Ltd" },

31387 { 0xD4F0B4, "Napco Security Technologies" },

31388 { 0xD4F0C9, "KYOCERA Document Solutions Inc." },

31389 { 0xD4F0EA, "Beijing Xiaomi Mobile Software Co., Ltd" },

31390 { 0xD4F143, "IPROAD.,Inc" },

31391 { 0xD4F207, "DIAODIAO(Beijing)Technology CO.,Ltd" },

31392 { 0xD4F242, "Huawei Device Co., Ltd." },

31393 { 0xD4F32D, "Intel Corporate" },

31394 { 0xD4F337, "Xunison Ltd." },

31395 { 0xD4F46F, "Apple, Inc." },

31396 { 0xD4F4BE, "Palo Alto Networks" },

31397 { 0xD4F513, "Texas Instruments" },

31398 { 0xD4F527, "SIEMENS AG" },

31399 { 0xD4F547, "Google, Inc." },

31400 { 0xD4F5EF, "Hewlett Packard Enterprise" },

31401 { 0xD4F63F, "IEA S.R.L." },

31402 { 0xD4F756, "zte corporation" },

31403 { 0xD4F786, "Fiberhome Telecommunication Technologies Co.,LTD" },

31404 { 0xD4F7D5, "Sony Interactive Entertainment Inc." },

31405 { 0xD4F829, "Sagemcom Broadband SAS" },

31406 { 0xD4F921, "Qingdao Intelligent&Precise Electronics Co.,Ltd." },

31407 { 0xD4F98D, "Espressif Inc." },

31408 { 0xD4F9A1, "HUAWEI TECHNOLOGIES CO.,LTD" },

31409 { 0xD4FB8E, "Apple, Inc." },

31410 { 0xD4FC13, "Fiberhome Telecommunication Technologies Co.,LTD" },

31411 { 0xD8004D, "Apple, Inc." },

31412 { 0xD80093, "Aurender Inc." },

31413 { 0xD8028A, "Shenzhen YOUHUA Technology Co., Ltd" },

31414 { 0xD802C0, "Extreme Networks Headquarters" },

31415 { 0xD8031A, "Laird Connectivity" },

31416 { 0xD8032A, "COMMTACT LTD" },

31417 { 0xD8052E, "Skyviia Corporation" },

31418 { 0xD806D1, "Honeywell Fire System (Shanghai) Co,. Ltd." },

31419 { 0xD807B6, "TP-LINK TECHNOLOGIES CO.,LTD." },

31420 { 0xD80831, "Samsung Electronics Co.,Ltd" },

31421 { 0xD808F5, "Arcadia Networks Co. Ltd." },

31422 { 0xD8094E, "Active Brains" },

31423 { 0xD8097F, "zte corporation" },

31424 { 0xD809C3, "Cercacor Labs" },

31425 { 0xD809D6, "ZEXELON CO., LTD." },

31426 { 0xD80A60, "HUAWEI TECHNOLOGIES CO.,LTD" },

31427 { 0xD80AE6, "zte corporation" },

31428 { 0xD80B9A, "Samsung Electronics Co.,Ltd" },

31429 { 0xD80BCB, "Telink Semiconductor (Shanghai) Co., Ltd." },

31430 { 0xD80CCF, "C.G.V. S.A.S." },

31431 { 0xD80D17, "TP-LINK TECHNOLOGIES CO.,LTD." },

31432 { 0xD80DE3, "FXI TECHNOLOGIES AS" },

31433 { 0xD80E29, "vivo Mobile Communication Co., Ltd." },

31434 { 0xD80F99, "Hon Hai Precision Ind. Co.,Ltd." },

31435 { 0xD81068, "Murata Manufacturing Co., Ltd." },

31436 { 0xD8109F, "HUAWEI TECHNOLOGIES CO.,LTD" },

31437 { 0xD810CB, "Andrea Informatique" },

31438 { 0xD81265, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

31439 { 0xD8132A, "Espressif Inc." },

31440 { 0xD81399, "Hui Zhou Gaoshengda Technology Co.,LTD" },

31441 { 0xD814D6, "SURE SYSTEM Co Ltd" },

31442 { 0xD814DF, "TCL King Electrical Appliances (Huizhou) Co., Ltd" },

31443 { 0xD8150D, "TP-LINK TECHNOLOGIES CO.,LTD." },

31444 { 0xD8160A, "Nippon Electro-Sensory Devices" },

31445 { 0xD816C1, "DEWAV (HK) ELECTRONICS LIMITED" },

31446 { 0xD8182B, "Conti Temic Microelectronic GmbH" },

31447 { 0xD818D3, "Juniper Networks" },

31448 { 0xD8197A, "Nuheara Ltd" },

31449 { 0xD819CE, "Telesquare" },

31450 { 0xD81BB5, "HUAWEI TECHNOLOGIES CO.,LTD" },

31451 { 0xD81BFE, "TWINLINX CORPORATION" },

31452 { 0xD81C14, "Compacta International, Ltd." },

31453 { 0xD81C79, "Apple, Inc." },

31454 { 0xD81D72, "Apple, Inc." },

31455 { 0xD81EDD, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

31456 { 0xD81EDE, "B&W Group Ltd" },

31457 { 0xD81F12, "Tuya Smart Inc." },

31458 { 0xD81FCC, "Brocade Communications Systems LLC" },

31459 { 0xD8209F, "Cubro Acronet GesmbH" },

31460 { 0xD821DA, "SERNET (SUZHOU) TECHNOLOGIES CORPORATION" },

31461 { 0xD822F4, "Avnet Silica" },

31462 { 0xD82477, "Universal Electric Corporation" },

31463 { 0xD824BD, "Cisco Systems, Inc" },

31464 { 0xD824EC, "Plenom A/S" },

31465 { 0xD82522, "ARRIS Group, Inc." },

31466 { 0xD825B0, "Rockeetech Systems Co.,Ltd." },

31467 { 0xD825DF, "CAME UK" },

31468 { 0xD826B9, "Guangdong Coagent Electronics S&amp;T Co.,Ltd." },

31469 { 0xD8270C, "MaxTronic International Co., Ltd." },

31470 { 0xD828C9, "General Electric Consumer and Industrial" },

31471 { 0xD82916, "Ascent Communication Technology" },

31472 { 0xD82918, "HUAWEI TECHNOLOGIES CO.,LTD" },

31473 { 0xD82986, "Best Wish Technology LTD" },

31474 { 0xD829F8, "HUAWEI TECHNOLOGIES CO.,LTD" },

31475 { 0xD82A15, "Leitner SpA" },

31476 { 0xD82A7E, "Nokia Corporation" },

31477 { 0xD82D40, "Janz - Contagem e Gestão de Fluídos S.A." },

31478 { 0xD82D9B, "Shenzhen G.Credit Communication Technology Co., Ltd" },

31479 { 0xD82DE1, "Tricascade Inc." },

31480 { 0xD82FE6, "Zhejiang Tmall Technology Co., Ltd." },

31481 { 0xD83062, "Apple, Inc." },

31482 { 0xD8312C, "zte corporation" },

31483 { 0xD83134, "Roku, Inc" },

31484 { 0xD831CF, "Samsung Electronics Co.,Ltd" },

31485 { 0xD83214, "Tenda Technology Co.,Ltd.Dongguan branch" },

31486 { 0xD8325A, "Shenzhen YOUHUA Technology Co., Ltd" },

31487 { 0xD832E3, "Xiaomi Communications Co Ltd" },

31488 { 0xD8337F, "Office FA.com Co.,Ltd." },

31489 { 0xD833B7, "Sagemcom Broadband SAS" },

31490 { 0xD8341C, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

31491 { 0xD834D1, "Shenzhen Orange Digital Technology Co.,Ltd" },

31492 { 0xD834EE, "SHURE INCORPORATED" },

31493 { 0xD8365F, "Intelbras" },

31494 { 0xD8373B, "Shenzhen Jingxun Software Telecommunication Technology Co.,Ltd" },

31495 { 0xD837BE, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

31496 { 0xD8380D, "SHENZHEN IP-COM Network Co.,Ltd" },

31497 { 0xD838FC, "Ruckus Wireless" },

31498 { 0xD83ADD, "Raspberry Pi Trading Ltd" },

31499 { 0xD83AF5, "Wideband Labs LLC" },

31500 { 0xD83BBF, "Intel Corporate" },

31501 { 0xD83C69, "Shenzhen TINNO Mobile Technology Corp." },

31502 { 0xD83D3F, "JOYNED GmbH" },

31503 { 0xD83DCC, "shenzhen UDD Technologies,co.,Ltd" },

31504 { 0xD84008, "HUAWEI TECHNOLOGIES CO.,LTD" },

31505 { 0xD842AC, "Shanghai Feixun Communication Co.,Ltd." },

31506 { 0xD842E2, "Canary Connect, Inc." },

31507 { 0xD843AE, "Micro-Star INTL CO., LTD." },

31508 { 0xD843EA, "SY Electronics Ltd" },

31509 { 0xD843ED, "Suzuken" },

31510 { 0xD8445C, "DEV Tecnologia Ind Com Man Eq LTDA" },

31511 { 0xD8452B, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

31512 { 0xD84606, "Silicon Valley Global Marketing" },

31513 { 0xD84710, "Sichuan Changhong Electric Ltd." },

31514 { 0xD84732, "TP-LINK TECHNOLOGIES CO.,LTD." },

31515 { 0xD8478F, "Microchip Technology Inc." },

31516 { 0xD847BB, "Huawei Device Co., Ltd." },

31517 { 0xD848EE, "Hangzhou Xueji Technology Co., Ltd." },

31518 { 0xD8490B, "HUAWEI TECHNOLOGIES CO.,LTD" },

31519 { 0xD8492F, "CANON INC." },

31520 { 0xD84A2B, "zte corporation" },

31521 { 0xD84A87, "OI ELECTRIC CO.,LTD" },

31522 { 0xD84B2A, "Cognitas Technologies, Inc." },

31523 { 0xD84C90, "Apple, Inc." },

31524 { 0xD84DB9, "Wu Qi Technologies,Inc." },

31525 { 0xD84F37, "Proxis, spol. s r.o." },

31526 { 0xD84FB8, "LG ELECTRONICS" },

31527 { 0xD850A1, "Hunan Danuo Technology Co.,LTD" },

31528 { 0xD850E6, "ASUSTek COMPUTER INC." },

31529 { 0xD8539A, "Juniper Networks" },

31530 { 0xD853BC, "Lenovo Information Products (Shenzhen)Co.,Ltd" },

31531 { 0xD8543A, "Texas Instruments" },

31532 { 0xD85482, "Oxit, LLC" },

31533 { 0xD854A2, "Extreme Networks Headquarters" },

31534 { 0xD85575, "Samsung Electronics Co.,Ltd" },

31535 { 0xD855A3, "zte corporation" },

31536 { 0xD857EF, "Samsung Electronics Co.,Ltd" },

31537 { 0xD858C6, "Katch Asset Tracking Pty Limited" },

31538 { 0xD858D7, "CZ.NIC, z.s.p.o." },

31539 { 0xD85982, "HUAWEI TECHNOLOGIES CO.,LTD" },

31540 { 0xD85B22, "Shenzhen Hohunet Technology Co., Ltd" },

31541 { 0xD85B2A, "Samsung Electronics Co.,Ltd" },

31542 { 0xD85D4C, "TP-LINK TECHNOLOGIES CO.,LTD." },

31543 { 0xD85D84, "CAx soft GmbH" },

31544 { 0xD85DE2, "Hon Hai Precision Ind. Co.,Ltd." },

31545 { 0xD85DEF, "Busch-Jaeger Elektro GmbH" },

31546 { 0xD85DFB, "Private" },

31547 { 0xD85ED3, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

31548 { 0xD85F77, "Telink Semiconductor (Shanghai) Co., Ltd." },

31549 { 0xD860B0, "bioMérieux Italia S.p.A." },

31550 { 0xD860B3, "Guangdong Global Electronic Technology CO.，LTD" },

31551 { 0xD86162, "Wistron Neweb Corporation" },

31552 { 0xD86194, "Objetivos y Sevicios de Valor Añadido" },

31553 { 0xD862DB, "Eno Inc." },

31554 { 0xD8630D, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

31555 { 0xD86375, "Xiaomi Communications Co Ltd" },

31556 { 0xD8638C, "Shenzhen Dttek Technology Co., Ltd." },

31557 { 0xD86595, "Toy's Myth Inc." },

31558 { 0xD866C6, "Shenzhen Daystar Technology Co.,ltd" },

31559 { 0xD866EE, "BOXIN COMMUNICATION CO.,LTD." },

31560 { 0xD867D3, "Huawei Device Co., Ltd." },

31561 { 0xD867D9, "Cisco Systems, Inc" },

31562 { 0xD86852, "HUAWEI TECHNOLOGIES CO.,LTD" },

31563 { 0xD868A0, "Samsung Electronics Co.,Ltd" },

31564 { 0xD868C3, "Samsung Electronics Co.,Ltd" },

31565 { 0xD86960, "Steinsvik" },

31566 { 0xD86BF7, "Nintendo Co., Ltd." },

31567 { 0xD86C02, "Huaqin Telecom Technology Co.,Ltd" },

31568 { 0xD86C5A, "HUMAX Co., Ltd." },

31569 { 0xD86C63, "Google, Inc." },

31570 { 0xD86CE9, "Sagemcom Broadband SAS" },

31571 { 0xD86D17, "HUAWEI TECHNOLOGIES CO.,LTD" },

31572 { 0xD8714D, "Texas Instruments" },

31573 { 0xD87157, "Lenovo Mobile Communication Technology Ltd." },

31574 { 0xD87495, "zte corporation" },

31575 { 0xD87533, "Nokia Corporation" },

31576 { 0xD8760A, "Escort, Inc." },

31577 { 0xD876AE, "HUAWEI TECHNOLOGIES CO.,LTD" },

31578 { 0xD87766, "Nurivoice Co., Ltd" },

31579 { 0xD8778B, "Intelbras" },

31580 { 0xD8787F, "Ubee Interactive Co., Limited" },

31581 { 0xD878C9, "SERVERCOM (INDIA) PRIVATE LIMITED" },

31582 { 0xD878E5, "KUHN SA" },

31583 { 0xD87988, "Hon Hai Precision Ind. Co.,Ltd." },

31584 { 0xD87A3B, "Silicon Laboratories" },

31585 { 0xD87CDD, "SANIX INCORPORATED" },

31586 { 0xD87D7F, "Sagemcom Broadband SAS" },

31587 { 0xD87E6F, "CASCINATION AG" },

31588 { 0xD87E76, "ITEL MOBILE LIMITED" },

31589 { 0xD87EB1, "x.o.ware, inc." },

31590 { 0xD88039, "Microchip Technology Inc." },

31591 { 0xD8803C, "Anhui Huami Information Technology Company Limited" },

31592 { 0xD88083, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

31593 { 0xD880DC, "Huawei Device Co., Ltd." },

31594 { 0xD881CE, "AHN INC." },

31595 { 0xD88332, "TaiXin Semiconductor Co., Ltd" },

31596 { 0xD88466, "Extreme Networks Headquarters" },

31597 { 0xD8860B, "IEEE Registration Authority" },

31598 { 0xD887D5, "Leadcore Technology CO.,LTD" },

31599 { 0xD88863, "HUAWEI TECHNOLOGIES CO.,LTD" },

31600 { 0xD888CE, "RF Technology Pty Ltd" },

31601 { 0xD88A3B, "UNIT-EM" },

31602 { 0xD88ADC, "Huawei Device Co., Ltd." },

31603 { 0xD88B4C, "KingTing Tech." },

31604 { 0xD88C73, "zte corporation" },

31605 { 0xD88C79, "Google, Inc." },

31606 { 0xD88D5C, "Elentec" },

31607 { 0xD88DC8, "Atil Technology Co., LTD" },

31608 { 0xD88ED4, "eero inc." },

31609 { 0xD88F76, "Apple, Inc." },

31610 { 0xD890E8, "Samsung Electronics Co.,Ltd" },

31611 { 0xD8912A, "Zyxel Communications Corporation" },

31612 { 0xD89136, "Dover Fueling Solutions" },

31613 { 0xD89341, "General Electric Global Research" },

31614 { 0xD89403, "Hewlett Packard Enterprise" },

31615 { 0xD8952F, "Texas Instruments" },

31616 { 0xD89685, "GoPro" },

31617 { 0xD89695, "Apple, Inc." },

31618 { 0xD896E0, "Alibaba Cloud Computing Ltd." },

31619 { 0xD8973B, "Artesyn Embedded Technologies" },

31620 { 0xD89760, "C2 Development, Inc." },

31621 { 0xD8977C, "Grey Innovation" },

31622 { 0xD89790, "Commonwealth Scientific and Industrial Research Organisation" },

31623 { 0xD897BA, "PEGATRON CORPORATION" },

31624 { 0xD89A34, "Beijing SHENQI Technology Co., Ltd." },

31625 { 0xD89AC1, "Nokia" },

31626 { 0xD89B3B, "HUAWEI TECHNOLOGIES CO.,LTD" },

31627 { 0xD89C67, "Hon Hai Precision Ind. Co.,Ltd." },

31628 { 0xD89C8E, "Comcast Cable Corporation" },

31629 { 0xD89D67, "Hewlett Packard" },

31630 { 0xD89DB9, "eMegatech International Corp." },

31631 { 0xD89E3F, "Apple, Inc." },

31632 { 0xD89E61, "Huawei Device Co., Ltd." },

31633 { 0xD89ED4, "Fiberhome Telecommunication Technologies Co.,LTD" },

31634 { 0xD89EF3, "Dell Inc." },

31635 { 0xD8A011, "WiZ" },

31636 { 0xD8A01D, "Espressif Inc." },

31637 { 0xD8A0E8, "zte corporation" },

31638 { 0xD8A105, "Syslane, Co., Ltd." },

31639 { 0xD8A25E, "Apple, Inc." },

31640 { 0xD8A315, "vivo Mobile Communication Co., Ltd." },

31641 { 0xD8A35C, "Samsung Electronics Co.,Ltd" },

31642 { 0xD8A491, "Huawei Device Co., Ltd." },

31643 { 0xD8A534, "Spectronix Corporation" },

31644 { 0xD8A6F0, "Wu Qi Technologies,Inc." },

31645 { 0xD8A6FD, "Ghost Locomotion" },

31646 { 0xD8A756, "Sagemcom Broadband SAS" },

31647 { 0xD8A8C8, "zte corporation" },

31648 { 0xD8A98B, "Texas Instruments" },

31649 { 0xD8AA59, "Tonly Technology Co. Ltd" },

31650 { 0xD8AD49, "Honor Device Co., Ltd." },

31651 { 0xD8ADDD, "Sonavation, Inc." },

31652 { 0xD8AE90, "Itibia Technologies" },

31653 { 0xD8AED0, "Shanghai Engineering Science & Technology Co.,LTD CGNPC" },

31654 { 0xD8AF3B, "Hangzhou Bigbright Integrated communications system Co.,Ltd" },

31655 { 0xD8AF81, "AO" },

31656 { 0xD8AFF1, "Panasonic Appliances Company" },

31657 { 0xD8B020, "Taicang T&W Electronics" },

31658 { 0xD8B02E, "Guangzhou Zonerich Business Machine Co., LTD." },

31659 { 0xD8B04C, "Jinan USR IOT Technology Co., Ltd." },

31660 { 0xD8B053, "Xiaomi Communications Co Ltd" },

31661 { 0xD8B122, "Juniper Networks" },

31662 { 0xD8B12A, "Panasonic Mobile Communications Co.,Ltd." },

31663 { 0xD8B190, "Cisco Systems, Inc" },

31664 { 0xD8B249, "Huawei Device Co., Ltd." },

31665 { 0xD8B32F, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

31666 { 0xD8B370, "Ubiquiti Inc" },

31667 { 0xD8B377, "HTC Corporation" },

31668 { 0xD8B673, "Texas Instruments" },

31669 { 0xD8B6B7, "Comtrend Corporation" },

31670 { 0xD8B6C1, "NetworkAccountant, Inc." },

31671 { 0xD8B6D6, "Blu Tether Limited" },

31672 { 0xD8B8F6, "Nantworks" },

31673 { 0xD8B90E, "Triple Domain Vision Co.,Ltd." },

31674 { 0xD8BB2C, "Apple, Inc." },

31675 { 0xD8BBC1, "Micro-Star INTL CO., LTD." },

31676 { 0xD8BC38, "Espressif Inc." },

31677 { 0xD8BC59, "Shenzhen DAPU Microelectronics Co., Ltd" },

31678 { 0xD8BE1F, "Apple, Inc." },

31679 { 0xD8BE65, "Amazon Technologies Inc." },

31680 { 0xD8BF4C, "Victory Concept Electronics Limited" },

31681 { 0xD8BFC0, "Espressif Inc." },

31682 { 0xD8C068, "Netgenetech.co.,ltd." },

31683 { 0xD8C06A, "Hunantv.com Interactive Entertainment Media Co.,Ltd." },

31684 { 0xD8C0A6, "AzureWave Technology Inc." },

31685 { 0xD8C3FB, "DETRACOM" },

31686 { 0xD8C46A, "Murata Manufacturing Co., Ltd." },

31687 { 0xD8C497, "Quanta Computer Inc." },

31688 { 0xD8C4E9, "Samsung Electronics Co.,Ltd" },

31689 { 0xD8C561, "CommFront Communications Pte Ltd" },

31690 { 0xD8C678, "MitraStar Technology Corp." },

31691 { 0xD8C691, "Hichan Technology Corp." },

31692 { 0xD8C771, "HUAWEI TECHNOLOGIES CO.,LTD" },

31693 { 0xD8C7C8, "Aruba, a Hewlett Packard Enterprise Company" },

31694 { 0xD8C8E9, "Phicomm (Shanghai) Co., Ltd." },

31695 { 0xD8C99D, "EA DISPLAY LIMITED" },

31696 { 0xD8CA06, "Titan DataCenters France" },

31697 { 0xD8CB8A, "Micro-Star INTL CO., LTD." },

31698 { 0xD8CC98, "Huawei Device Co., Ltd." },

31699 { 0xD8CD2C, "WUXI NEIHUA NETWORK TECHNOLOGY CO., LTD" },

31700 { 0xD8CE3A, "Xiaomi Communications Co Ltd" },

31701 { 0xD8CF89, "Beijing DoSee Science and Technology Co., Ltd." },

31702 { 0xD8CF9C, "Apple, Inc." },

31703 { 0xD8CFBF, "Motorola Mobility LLC, a Lenovo Company" },

31704 { 0xD8D090, "Dell Inc." },

31705 { 0xD8D1CB, "Apple, Inc." },

31706 { 0xD8D27C, "JEMA ENERGY, SA" },

31707 { 0xD8D385, "Hewlett Packard" },

31708 { 0xD8D43C, "Sony Corporation" },

31709 { 0xD8D45D, "Orbic North America" },

31710 { 0xD8D4E6, "Hytec Inter Co., Ltd." },

31711 { 0xD8D5B9, "Rainforest Automation, Inc." },

31712 { 0xD8D668, "Tuya Smart Inc." },

31713 { 0xD8D67E, "GSK CNC EQUIPMENT CO.,LTD" },

31714 { 0xD8D6F3, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

31715 { 0xD8D723, "IDS, Inc" },

31716 { 0xD8D775, "Sagemcom Broadband SAS" },

31717 { 0xD8D866, "SHENZHEN TOZED TECHNOLOGIES CO.,LTD." },

31718 { 0xD8DA52, "APATOR S.A." },

31719 { 0xD8DAF1, "HUAWEI TECHNOLOGIES CO.,LTD" },

31720 { 0xD8DC40, "Apple, Inc." },

31721 { 0xD8DCE9, "Kunshan Erlab ductless filtration system Co.,Ltd" },

31722 { 0xD8DD5F, "BALMUDA Inc." },

31723 { 0xD8DDFD, "Texas Instruments" },

31724 { 0xD8DE3A, "Apple, Inc." },

31725 { 0xD8DECE, "ISUNG CO.,LTD" },

31726 { 0xD8DF0D, "beroNet GmbH" },

31727 { 0xD8DF7A, "Quest Software, Inc." },

31728 { 0xD8E004, "Vodia Networks Inc" },

31729 { 0xD8E0B8, "BULAT LLC" },

31730 { 0xD8E0E1, "Samsung Electronics Co.,Ltd" },

31731 { 0xD8E23F, "Qingdao Haier Technology Co.,Ltd" },

31732 { 0xD8E2DF, "Microsoft Corporation" },

31733 { 0xD8E35E, "LG Innotek" },

31734 { 0xD8E3AE, "CIRTEC MEDICAL SYSTEMS" },

31735 { 0xD8E56D, "TCT mobile ltd" },

31736 { 0xD8E593, "Apple, Inc." },

31737 { 0xD8E72B, "NETSCOUT SYSTEMS INC" },

31738 { 0xD8E72F, "Chipsea Technologies (Shenzhen) Corp." },

31739 { 0xD8E743, "Wush, Inc" },

31740 { 0xD8E844, "zte corporation" },

31741 { 0xD8E952, "KEOPSYS" },

31742 { 0xD8EB46, "Google, Inc." },

31743 { 0xD8EB97, "TRENDnet, Inc." },

31744 { 0xD8EC5E, "Belkin International Inc." },

31745 { 0xD8ECE5, "Zyxel Communications Corporation" },

31746 { 0xD8ED1C, "Magna Technology SL" },

31747 { 0xD8EE42, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

31748 { 0xD8EE78, "Moog Protokraft" },

31749 { 0xD8EF42, "Huawei Device Co., Ltd." },

31750 { 0xD8EFCD, "Nokia Solutions and Networks GmbH & Co. KG" },

31751 { 0xD8F0F2, "Zeebo Inc" },

31752 { 0xD8F15B, "Espressif Inc." },

31753 { 0xD8F1F0, "Pepxim International Limited" },

31754 { 0xD8F2CA, "Intel Corporate" },

31755 { 0xD8F3BC, "Liteon Technology Corporation" },

31756 { 0xD8F3DB, "Post CH AG" },

31757 { 0xD8F507, "Fiberhome Telecommunication Technologies Co.,LTD" },

31758 { 0xD8F710, "Libre Wireless Technologies Inc." },

31759 { 0xD8F760, "EM Microelectronic" },

31760 { 0xD8F883, "Intel Corporate" },

31761 { 0xD8F8AF, "DAONTEC" },

31762 { 0xD8FB11, "AXACORE" },

31763 { 0xD8FB5E, "ASKEY COMPUTER CORP" },

31764 { 0xD8FB68, "Cloud Corner Ltd." },

31765 { 0xD8FBD6, "Amazon Technologies Inc." },

31766 { 0xD8FC38, "Giantec Semiconductor Inc" },

31767 { 0xD8FC93, "Intel Corporate" },

31768 { 0xD8FE8F, "IDFone Co., Ltd." },

31769 { 0xD8FEE3, "D-Link International" },

31770 { 0xD8FFC3, "Shenzhen 3SNIC information technology company Limited" },

31771 { 0xDC0077, "TP-LINK TECHNOLOGIES CO.,LTD." },

31772 { 0xDC00B0, "FREEBOX SAS" },

31773 { 0xDC0265, "Meditech Kft" },

31774 { 0xDC028E, "zte corporation" },

31775 { 0xDC0398, "LG Innotek" },

31776 { 0xDC052F, "National Products Inc." },

31777 { 0xDC0539, "Cisco Systems, Inc" },

31778 { 0xDC0575, "SIEMENS ENERGY AUTOMATION" },

31779 { 0xDC05ED, "Nabtesco Corporation" },

31780 { 0xDC0682, "Accessia Technology Ltd." },

31781 { 0xDC07C1, "HangZhou QiYang Technology Co.,Ltd." },

31782 { 0xDC07F8, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

31783 { 0xDC080F, "Apple, Inc." },

31784 { 0xDC0856, "Alcatel-Lucent Enterprise" },

31785 { 0xDC0914, "Talk-A-Phone Co." },

31786 { 0xDC094C, "HUAWEI TECHNOLOGIES CO.,LTD" },

31787 { 0xDC0B09, "Cisco Systems, Inc" },

31788 { 0xDC0B1A, "ADB Broadband Italia" },

31789 { 0xDC0B34, "LG Electronics (Mobile Communications)" },

31790 { 0xDC0C2D, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

31791 { 0xDC0C5C, "Apple, Inc." },

31792 { 0xDC0D30, "Shenzhen Feasycom Technology Co., Ltd." },

31793 { 0xDC0E96, "Palo Alto Networks" },

31794 { 0xDC0EA1, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

31795 { 0xDC1057, "Apple, Inc." },

31796 { 0xDC152D, "China Mobile Group Device Co.,Ltd." },

31797 { 0xDC15C8, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

31798 { 0xDC15DB, "Ge Ruili Intelligent Technology ( Beijing ) Co., Ltd." },

31799 { 0xDC16A2, "Medtronic Diabetes" },

31800 { 0xDC16B2, "HUAWEI TECHNOLOGIES CO.,LTD" },

31801 { 0xDC175A, "Hitachi High-Technologies Corporation" },

31802 { 0xDC1792, "Captivate Network" },

31803 { 0xDC1A01, "Ecoliv Technology ( Shenzhen ) Ltd." },

31804 { 0xDC1AC5, "vivo Mobile Communication Co., Ltd." },

31805 { 0xDC1BA1, "Intel Corporate" },

31806 { 0xDC1D9F, "U & B tech" },

31807 { 0xDC1DD4, "Microstep-MIS spol. s r.o." },

31808 { 0xDC1EA3, "Accensus LLC" },

31809 { 0xDC2008, "ASD Electronics Ltd" },

31810 { 0xDC2148, "Intel Corporate" },

31811 { 0xDC215C, "Intel Corporate" },

31812 { 0xDC21B9, "Sentec Co.Ltd" },

31813 { 0xDC21E2, "HUAWEI TECHNOLOGIES CO.,LTD" },

31814 { 0xDC233B, "Extreme Networks Headquarters" },

31815 { 0xDC2727, "Huawei Device Co., Ltd." },

31816 { 0xDC2834, "HAKKO Corporation" },

31817 { 0xDC2919, "AltoBeam (Xiamen) Technology Ltd, Co." },

31818 { 0xDC293A, "Shenzhen Nuoshi Technology Co., LTD." },

31819 { 0xDC2A14, "Shanghai Longjing Technology Co." },

31820 { 0xDC2AA1, "MedHab LLC" },

31821 { 0xDC2B2A, "Apple, Inc." },

31822 { 0xDC2B61, "Apple, Inc." },

31823 { 0xDC2B66, "InfoBLOCK S.A. de C.V." },

31824 { 0xDC2BCA, "Zera GmbH" },

31825 { 0xDC2C26, "Iton Technology Limited" },

31826 { 0xDC2C6E, "Routerboard.com" },

31827 { 0xDC2D04, "vivo Mobile Communication Co., Ltd." },

31828 { 0xDC2D3C, "Huawei Device Co., Ltd." },

31829 { 0xDC2DCB, "Beijing Unis HengYue Technology Co., Ltd." },

31830 { 0xDC2DDE, "Ledworks SRL" },

31831 { 0xDC2E6A, "HCT. Co., Ltd." },

31832 { 0xDC2F03, "Step forward Group Co., Ltd." },

31833 { 0xDC309C, "Heyrex Limited" },

31834 { 0xDC31D1, "vivo Mobile Communication Co., Ltd." },

31835 { 0xDC330D, "QING DAO HAIER TELECOM CO.,LTD." },

31836 { 0xDC333D, "Huawei Device Co., Ltd." },

31837 { 0xDC3350, "TechSAT GmbH" },

31838 { 0xDC35F1, "Positivo Tecnologia S.A." },

31839 { 0xDC360C, "Hitron Technologies. Inc" },

31840 { 0xDC3642, "zte corporation" },

31841 { 0xDC3643, "IEEE Registration Authority" },

31842 { 0xDC3714, "Apple, Inc." },

31843 { 0xDC3752, "GE" },

31844 { 0xDC3757, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

31845 { 0xDC37D2, "Hunan HKT Electronic Technology Co., Ltd" },

31846 { 0xDC38E1, "Juniper Networks" },

31847 { 0xDC396F, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

31848 { 0xDC3979, "Cisco Systems, Inc" },

31849 { 0xDC3A5E, "Roku, Inc." },

31850 { 0xDC3C2E, "Manufacturing System Insights, Inc." },

31851 { 0xDC3C84, "Ticom Geomatics, Inc." },

31852 { 0xDC3CF6, "Atomic Rules LLC" },

31853 { 0xDC3E51, "Solberg & Andersen AS" },

31854 { 0xDC3EF8, "Nokia Corporation" },

31855 { 0xDC415F, "Apple, Inc." },

31856 { 0xDC41A9, "Intel Corporate" },

31857 { 0xDC41E5, "Shenzhen Zhixin Data Service Co., Ltd." },

31858 { 0xDC4427, "IEEE Registration Authority" },

31859 { 0xDC446D, "Allwinner Technology Co., Ltd" },

31860 { 0xDC44B6, "Samsung Electronics Co.,Ltd" },

31861 { 0xDC4517, "ARRIS Group, Inc." },

31862 { 0xDC4546, "Intel Corporate" },

31863 { 0xDC45B8, "Apple, Inc." },

31864 { 0xDC4628, "Intel Corporate" },

31865 { 0xDC48B2, "Baraja Pty. Ltd." },

31866 { 0xDC49C9, "CASCO SIGNAL LTD" },

31867 { 0xDC4A3E, "Hewlett Packard" },

31868 { 0xDC4A9E, "IEEE Registration Authority" },

31869 { 0xDC4BDD, "Shenzhen SuperElectron Technology Co.,Ltd." },

31870 { 0xDC4BFE, "Shenzhen Belon Technology CO.,LTD" },

31871 { 0xDC4D23, "MRV Comunications" },

31872 { 0xDC4EDE, "SHINYEI TECHNOLOGY CO., LTD." },

31873 { 0xDC4EF4, "Shenzhen MTN Electronics CO., Ltd" },

31874 { 0xDC4F22, "Espressif Inc." },

31875 { 0xDC503A, "Nanjing Ticom Tech Co., Ltd." },

31876 { 0xDC5193, "zte corporation" },

31877 { 0xDC5285, "Apple, Inc." },

31878 { 0xDC5360, "Intel Corporate" },

31879 { 0xDC537C, "Compal Broadband Networks, Inc." },

31880 { 0xDC5392, "Apple, Inc." },

31881 { 0xDC543D, "ITEL MOBILE LIMITED" },

31882 { 0xDC5475, "Espressif Inc." },

31883 { 0xDC54D7, "Amazon Technologies Inc." },

31884 { 0xDC5583, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

31885 { 0xDC56E6, "Shenzhen Bococom Technology Co.,LTD" },

31886 { 0xDC56E7, "Apple, Inc." },

31887 { 0xDC5726, "Power-One" },

31888 { 0xDC58BC, "Thomas-Krenn.AG" },

31889 { 0xDC5E36, "Paterson Technology" },

31890 { 0xDC60A1, "Teledyne DALSA Professional Imaging" },

31891 { 0xDC621F, "HUAWEI TECHNOLOGIES CO.,LTD" },

31892 { 0xDC6294, "Guangzhou Lango Electronics Technology Co.,Ltd." },

31893 { 0xDC6373, "OBARA KOREA" },

31894 { 0xDC647C, "C.R.S. iiMotion GmbH" },

31895 { 0xDC64B8, "Shenzhen JingHanDa Electronics Co.Ltd" },

31896 { 0xDC6555, "New H3C Intelligence Terminal Co., Ltd." },

31897 { 0xDC663A, "Apacer Technology Inc." },

31898 { 0xDC6672, "Samsung Electronics Co.,Ltd" },

31899 { 0xDC6723, "barox Kommunikation GmbH" },

31900 { 0xDC680C, "Hewlett Packard Enterprise" },

31901 { 0xDC6880, "zte corporation" },

31902 { 0xDC68EB, "Nintendo Co.,Ltd" },

31903 { 0xDC69E2, "Samsung Electronics Co.,Ltd" },

31904 { 0xDC6AE7, "Xiaomi Communications Co Ltd" },

31905 { 0xDC6AEA, "Infinix mobility limited" },

31906 { 0xDC6B12, "worldcns inc." },

31907 { 0xDC6B1B, "Huawei Device Co., Ltd." },

31908 { 0xDC6DBC, "Apple, Inc." },

31909 { 0xDC6DCD, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

31910 { 0xDC6F00, "Livescribe, Inc." },

31911 { 0xDC6F08, "Bay Storage Technology" },

31912 { 0xDC7014, "Private" },

31913 { 0xDC7137, "zte corporation" },

31914 { 0xDC7144, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

31915 { 0xDC7196, "Intel Corporate" },

31916 { 0xDC71DD, "AX Technologies" },

31917 { 0xDC7223, "Hui Zhou Gaoshengda Technology Co.,LTD" },

31918 { 0xDC729B, "HUAWEI TECHNOLOGIES CO.,LTD" },

31919 { 0xDC7385, "Huawei Device Co., Ltd." },

31920 { 0xDC74A8, "Samsung Electronics Co.,Ltd" },

31921 { 0xDC774C, "Cisco Systems, Inc" },

31922 { 0xDC7794, "Huawei Device Co., Ltd." },

31923 { 0xDC7834, "LOGICOM SA" },

31924 { 0xDC7B94, "Cisco Systems, Inc" },

31925 { 0xDC7CF7, "China Mobile Group Device Co.,Ltd." },

31926 { 0xDC7FA4, "2Wire Inc" },

31927 { 0xDC8084, "Apple, Inc." },

31928 { 0xDC825B, "JANUS, spol. s r.o." },

31929 { 0xDC82F6, "iPort" },

31930 { 0xDC84E9, "Shenzhen Qihoo Intelligent Technology Co.,Ltd" },

31931 { 0xDC85DE, "AzureWave Technology Inc." },

31932 { 0xDC86D8, "Apple, Inc." },

31933 { 0xDC87CB, "Beijing Perfectek Technologies Co., Ltd." },

31934 { 0xDC8983, "Samsung Electronics Co.,Ltd" },

31935 { 0xDC8B28, "Intel Corporate" },

31936 { 0xDC8C1B, "vivo Mobile Communication Co., Ltd." },

31937 { 0xDC8C37, "Cisco Systems, Inc" },

31938 { 0xDC8D8A, "Nokia Solutions and Networks GmbH & Co. KG" },

31939 { 0xDC8D91, "Infinix mobility limited" },

31940 { 0xDC8DB7, "ATW TECHNOLOGY, INC." },

31941 { 0xDC8E8D, "Netis Technology Co., Ltd." },

31942 { 0xDC8E95, "Silicon Laboratories" },

31943 { 0xDC9020, "RURU TEK PRIVATE LIMITED" },

31944 { 0xDC9088, "HUAWEI TECHNOLOGIES CO.,LTD" },

31945 { 0xDC9166, "Huawei Device Co., Ltd." },

31946 { 0xDC91BF, "Amazon Technologies Inc." },

31947 { 0xDC962C, "NST Audio Ltd" },

31948 { 0xDC973A, "Verana Networks" },

31949 { 0xDC9758, "Sichuan AI-Link Technology Co., Ltd." },

31950 { 0xDC97BA, "Intel Corporate" },

31951 { 0xDC97E6, "Sagemcom Broadband SAS" },

31952 { 0xDC9840, "Microsoft Corporation" },

31953 { 0xDC9914, "HUAWEI TECHNOLOGIES CO.,LTD" },

31954 { 0xDC99FE, "Armatura LLC" },

31955 { 0xDC9A7D, "HISENSE VISUAL TECHNOLOGY CO.,LTD" },

31956 { 0xDC9A8E, "Nanjing Cocomm electronics co., LTD" },

31957 { 0xDC9B1E, "Intercom, Inc." },

31958 { 0xDC9B9C, "Apple, Inc." },

31959 { 0xDC9BD6, "TCT mobile ltd" },

31960 { 0xDC9C52, "Sapphire Technology Limited." },

31961 { 0xDC9C9F, "Shenzhen YOUHUA Technology Co., Ltd" },

31962 { 0xDC9EAB, "Chongqing Yipingfang Technology Co., Ltd." },

31963 { 0xDC9FA4, "Nokia Corporation" },

31964 { 0xDC9FDB, "Ubiquiti Inc" },

31965 { 0xDCA0D0, "Amazon Technologies Inc." },

31966 { 0xDCA120, "Nokia" },

31967 { 0xDCA266, "Hon Hai Precision Ind. Co.,Ltd." },

31968 { 0xDCA313, "Shenzhen Changjin Communication Technology Co.,Ltd" },

31969 { 0xDCA333, "Shenzhen YOUHUA Technology Co., Ltd" },

31970 { 0xDCA3A2, "Feng mi(Beijing)technology co., LTD" },

31971 { 0xDCA3AC, "RBcloudtech" },

31972 { 0xDCA4CA, "Apple, Inc." },

31973 { 0xDCA5F4, "Cisco Systems, Inc" },

31974 { 0xDCA632, "Raspberry Pi Trading Ltd" },

31975 { 0xDCA633, "ARRIS Group, Inc." },

31976 { 0xDCA6BD, "Beijing Lanbo Technology Co., Ltd." },

31977 { 0xDCA782, "HUAWEI TECHNOLOGIES CO.,LTD" },

31978 { 0xDCA7D9, "Compressor Controls Corp" },

31979 { 0xDCA8CF, "New Spin Golf, LLC." },

31980 { 0xDCA904, "Apple, Inc." },

31981 { 0xDCA956, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

31982 { 0xDCA971, "Intel Corporate" },

31983 { 0xDCA989, "MACANDC" },

31984 { 0xDCAA43, "Shenzhen Terca Information Technology Co., Ltd." },

31985 { 0xDCAC6F, "Everytale Inc" },

31986 { 0xDCAD9E, "GreenPriz" },

31987 { 0xDCAE04, "CELOXICA Ltd" },

31988 { 0xDCAEEB, "Ruckus Wireless" },

31989 { 0xDCAF68, "WEIFANG GOERTEK ELECTRONICS CO.,LTD" },

31990 { 0xDCB058, "Bürkert Werke GmbH" },

31991 { 0xDCB082, "Nokia" },

31992 { 0xDCB131, "SHENZHEN HUARUIAN TECHNOLOGY CO.,LTD" },

31993 { 0xDCB347, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

31994 { 0xDCB3B4, "Honeywell Environmental & Combustion Controls (Tianjin) Co., Ltd." },

31995 { 0xDCB4AC, "FLEXTRONICS MANUFACTURING(ZHUHAI)CO.,LTD." },

31996 { 0xDCB4C4, "Microsoft XCG" },

31997 { 0xDCB4CA, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

31998 { 0xDCB54F, "Apple, Inc." },

31999 { 0xDCB72E, "Xiaomi Communications Co Ltd" },

32000 { 0xDCB7AC, "Aruba, a Hewlett Packard Enterprise Company" },

32001 { 0xDCB7FC, "Alps Electric (Ireland) Ltd" },

32002 { 0xDCB808, "Extreme Networks Headquarters" },

32003 { 0xDCBB96, "Full Solution Telecom" },

32004 { 0xDCBD7A, "Guangzhou Shiyuan Electronic Technology Company Limited" },

32005 { 0xDCBDCC, "Quectel Wireless Solutions Co.,Ltd." },

32006 { 0xDCBE49, "ITEL MOBILE LIMITED" },

32007 { 0xDCBE7A, "Zhejiang Nurotron Biotechnology Co." },

32008 { 0xDCBF90, "HUIZHOU QIAOXING TELECOMMUNICATION INDUSTRY CO.,LTD." },

32009 { 0xDCBFE9, "Motorola Mobility LLC, a Lenovo Company" },

32010 { 0xDCC0DB, "Shenzhen Kaiboer Technology Co., Ltd." },

32011 { 0xDCC0EB, "ASSA ABLOY CÔTE PICARDE" },

32012 { 0xDCC101, "SOLiD Technologies, Inc." },

32013 { 0xDCC2C9, "CANON INC." },

32014 { 0xDCC422, "Systembase Limited" },

32015 { 0xDCC49C, "Samsung Electronics Co.,Ltd" },

32016 { 0xDCC622, "BUHEUNG SYSTEM" },

32017 { 0xDCC64B, "HUAWEI TECHNOLOGIES CO.,LTD" },

32018 { 0xDCC793, "Nokia Corporation" },

32019 { 0xDCC8F5, "Shanghai UMEinfo CO.,LTD." },

32020 { 0xDCCBA8, "Explora Technologies Inc" },

32021 { 0xDCCC8D, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

32022 { 0xDCCCE6, "Samsung Electronics Co.,Ltd" },

32023 { 0xDCCD18, "Nintendo Co.,Ltd" },

32024 { 0xDCCD2F, "Seiko Epson Corporation" },

32025 { 0xDCCD66, "NXP Semiconductor (Tianjin) LTD." },

32026 { 0xDCCD74, "Japan E.M.Solutions Co., Ltd." },

32027 { 0xDCCE41, "FE GLOBAL HONG KONG LIMITED" },

32028 { 0xDCCEBC, "Shenzhen JSR Technology Co.,Ltd." },

32029 { 0xDCCEC1, "Cisco Systems, Inc" },

32030 { 0xDCCF94, "Beijing Rongcheng Hutong Technology Co., Ltd." },

32031 { 0xDCCF96, "Samsung Electronics Co.,Ltd" },

32032 { 0xDCD0F7, "Bentek Systems Ltd." },

32033 { 0xDCD160, "Tianjin Changdatong Technology Co.,LTD" },

32034 { 0xDCD255, "Kinpo Electronics, Inc." },

32035 { 0xDCD26A, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

32036 { 0xDCD2FC, "HUAWEI TECHNOLOGIES CO.,LTD" },

32037 { 0xDCD2FD, "HUAWEI TECHNOLOGIES CO.,LTD" },

32038 { 0xDCD321, "HUMAX Co., Ltd." },

32039 { 0xDCD3A2, "Apple, Inc." },

32040 { 0xDCD444, "Huawei Device Co., Ltd." },

32041 { 0xDCD52A, "Sunny Heart Limited" },

32042 { 0xDCD7A0, "Huawei Device Co., Ltd." },

32043 { 0xDCD87C, "Beijing Jingdong Century Trading Co., LTD." },

32044 { 0xDCD87F, "Shenzhen JoinCyber Telecom Equipment Ltd" },

32045 { 0xDCD916, "HUAWEI TECHNOLOGIES CO.,LTD" },

32046 { 0xDCD9AE, "Nokia Shanghai Bell Co., Ltd." },

32047 { 0xDCDA0C, "Espressif Inc." },

32048 { 0xDCDA4D, "CELESTICA INC." },

32049 { 0xDCDA4F, "GETCK TECHNOLOGY, INC" },

32050 { 0xDCDA80, "New H3C Technologies Co., Ltd" },

32051 { 0xDCDB27, "Huawei Device Co., Ltd." },

32052 { 0xDCDB70, "Tonfunk Systementwicklung und Service GmbH" },

32053 { 0xDCDC07, "TRP Systems BV" },

32054 { 0xDCDCC3, "Extreme Networks Headquarters" },

32055 { 0xDCDCE2, "Samsung Electronics Co.,Ltd" },

32056 { 0xDCDD24, "Energica Motor Company SpA" },

32057 { 0xDCDE4F, "Gionee Communication Equipment Co Ltd" },

32058 { 0xDCDECA, "Akyllor" },

32059 { 0xDCDFD6, "zte corporation" },

32060 { 0xDCE026, "Patrol Tag, Inc" },

32061 { 0xDCE0EB, "Nanjing Aozheng Information Technology Co.Ltd" },

32062 { 0xDCE1AD, "Shenzhen Wintop Photoelectric Technology Co., Ltd" },

32063 { 0xDCE2AC, "Lumens Digital Optics Inc." },

32064 { 0xDCE305, "AO" },

32065 { 0xDCE533, "IEEE Registration Authority" },

32066 { 0xDCE55B, "Google, Inc." },

32067 { 0xDCE578, "Experimental Factory of Scientific Engineering and Special Design Department" },

32068 { 0xDCE5D8, "zte corporation" },

32069 { 0xDCE650, "Extreme Networks Headquarters" },

32070 { 0xDCE71C, "AUG Elektronik GmbH" },

32071 { 0xDCE838, "CK Telecom (Shenzhen) Limited" },

32072 { 0xDCE994, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

32073 { 0xDCEAE7, "D-Link Corporation" },

32074 { 0xDCEB53, "Wuhan QianXiao Elecronic Technology CO.,LTD" },

32075 { 0xDCEB69, "Vantiva USA LLC" },

32076 { 0xDCEB94, "Cisco Systems, Inc" },

32077 { 0xDCEC06, "Heimi Network Technology Co., Ltd." },

32078 { 0xDCECE3, "LYOTECH LABS LLC" },

32079 { 0xDCED83, "Beijing Xiaomi Mobile Software Co., Ltd" },

32080 { 0xDCED84, "Haverford Systems Inc" },

32081 { 0xDCEE06, "HUAWEI TECHNOLOGIES CO.,LTD" },

32082 { 0xDCEE14, "ADT Technology" },

32083 { 0xDCEF09, "NETGEAR" },

32084 { 0xDCEF80, "HUAWEI TECHNOLOGIES CO.,LTD" },

32085 { 0xDCEFCA, "Murata Manufacturing Co., Ltd." },

32086 { 0xDCF05D, "Letta Teknoloji" },

32087 { 0xDCF090, "Nubia Technology Co.,Ltd." },

32088 { 0xDCF110, "Nokia Corporation" },

32089 { 0xDCF31C, "Texas Instruments" },

32090 { 0xDCF401, "Dell Inc." },

32091 { 0xDCF4CA, "Apple, Inc." },

32092 { 0xDCF505, "AzureWave Technology Inc." },

32093 { 0xDCF51B, "Arcadyan Corporation" },

32094 { 0xDCF56E, "Wellysis Corp." },

32095 { 0xDCF719, "Cisco Systems, Inc" },

32096 { 0xDCF755, "SITRONIK" },

32097 { 0xDCF756, "Samsung Electronics Co.,Ltd" },

32098 { 0xDCF858, "Lorent Networks, Inc." },

32099 { 0xDCF8B9, "zte corporation" },

32100 { 0xDCFAD5, "STRONG Ges.m.b.H." },

32101 { 0xDCFB02, "BUFFALO.INC" },

32102 { 0xDCFB48, "Intel Corporate" },

32103 { 0xDCFBB8, "Meizhou Guo Wei Electronics Co., Ltd" },

32104 { 0xDCFE07, "PEGATRON CORPORATION" },

32105 { 0xDCFE18, "TP-LINK TECHNOLOGIES CO.,LTD." },

32106 { 0xDCFE23, "Murata Manufacturing Co., Ltd." },

32107 { 0xE00084, "HUAWEI TECHNOLOGIES CO.,LTD" },

32108 { 0xE001A6, "Edgecore Networks Corporation" },

32109 { 0xE001C7, "Hui Zhou Gaoshengda Technology Co.,LTD" },

32110 { 0xE002A5, "ABB Robotics" },

32111 { 0xE0036B, "Samsung Electronics Co.,Ltd" },

32112 { 0xE00370, "ShenZhen Continental Wireless Technology Co., Ltd." },

32113 { 0xE005C5, "TP-LINK TECHNOLOGIES CO.,LTD." },

32114 { 0xE00630, "HUAWEI TECHNOLOGIES CO.,LTD" },

32115 { 0xE006E6, "Hon Hai Precision Ind. Co.,Ltd." },

32116 { 0xE0071B, "Hewlett Packard Enterprise" },

32117 { 0xE007C2, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

32118 { 0xE00871, "Dongguan Liesheng Electronic Co., Ltd." },

32119 { 0xE009BF, "SHENZHEN TONG BO WEI TECHNOLOGY Co.,LTD" },

32120 { 0xE00AF6, "Liteon Technology Corporation" },

32121 { 0xE00B28, "Inovonics" },

32122 { 0xE00C7F, "Nintendo Co., Ltd." },

32123 { 0xE00CE5, "HUAWEI TECHNOLOGIES CO.,LTD" },

32124 { 0xE00DB9, "Cree, Inc." },

32125 { 0xE00EDA, "Cisco Systems, Inc" },

32126 { 0xE00EE1, "We Corporation Inc." },

32127 { 0xE00EE4, "DWnet Technologies(Suzhou) Corporation" },

32128 { 0xE0107F, "Ruckus Wireless" },

32129 { 0xE01283, "Shenzhen Fanzhuo Communication Technology Co., Lt" },

32130 { 0xE013B5, "vivo Mobile Communication Co., Ltd." },

32131 { 0xE0143E, "Modoosis Inc." },

32132 { 0xE016B1, "Advanced Design Technology co.,ltd." },

32133 { 0xE01877, "FUJITSU LIMITED" },

32134 { 0xE0189F, "EM Microelectronic" },

32135 { 0xE0191D, "HUAWEI TECHNOLOGIES CO.,LTD" },

32136 { 0xE01954, "zte corporation" },

32137 { 0xE01995, "Nutanix" },

32138 { 0xE019D8, "BH TECHNOLOGIES" },

32139 { 0xE01AEA, "Allied Telesis, Inc." },

32140 { 0xE01C41, "Extreme Networks Headquarters" },

32141 { 0xE01CEE, "Bravo Tech, Inc." },

32142 { 0xE01CFC, "D-Link International" },

32143 { 0xE01D38, "Beijing HuaqinWorld Technology Co.,Ltd" },

32144 { 0xE01D3B, "Cambridge Industries(Group) Co.,Ltd." },

32145 { 0xE01E07, "Anite Telecoms US. Inc" },

32146 { 0xE01F0A, "Xslent Energy Technologies. LLC" },

32147 { 0xE01F2B, "Nokia Solutions and Networks GmbH & Co. KG" },

32148 { 0xE01F6A, "Huawei Device Co., Ltd." },

32149 { 0xE01F88, "Xiaomi Communications Co Ltd" },

32150 { 0xE01FED, "Nokia Shanghai Bell Co., Ltd." },

32151 { 0xE01FFC, "Motorola (Wuhan) Mobility Technologies Communication Co., Ltd." },

32152 { 0xE021FE, "Richer Link Technologies CO.,LTD" },

32153 { 0xE02202, "ARRIS Group, Inc." },

32154 { 0xE023D7, "Sleep Number" },

32155 { 0xE023FF, "Fortinet, Inc." },

32156 { 0xE0247F, "HUAWEI TECHNOLOGIES CO.,LTD" },

32157 { 0xE02481, "HUAWEI TECHNOLOGIES CO.,LTD" },

32158 { 0xE02538, "Titan Pet Products" },

32159 { 0xE02630, "Intrigue Technologies, Inc." },

32160 { 0xE02636, "Nortel Networks" },

32161 { 0xE0271A, "TTC Next-generation Home Network System WG" },

32162 { 0xE0276C, "Guangzhou Shiyuan Electronic Technology Company Limited" },

32163 { 0xE02861, "HUAWEI TECHNOLOGIES CO.,LTD" },

32164 { 0xE0286D, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

32165 { 0xE028B1, "Shenzhen Skyworth Digital Technology CO., Ltd" },

32166 { 0xE02967, "HMD Global Oy" },

32167 { 0xE02A82, "Universal Global Scientific Industrial Co., Ltd." },

32168 { 0xE02AE6, "Fiberhome Telecommunication Technologies Co.,LTD" },

32169 { 0xE02B96, "Apple, Inc." },

32170 { 0xE02BE9, "Intel Corporate" },

32171 { 0xE02CB2, "Lenovo Mobile Communication (Wuhan) Company Limited" },

32172 { 0xE02CF3, "MRS Electronic GmbH" },

32173 { 0xE02DF0, "ALPSALPINE CO,.LTD" },

32174 { 0xE02E0B, "Intel Corporate" },

32175 { 0xE02E3F, "Huawei Device Co., Ltd." },

32176 { 0xE02EFE, "Zhejiang Dahua Technology Co., Ltd." },

32177 { 0xE02F6D, "Cisco Systems, Inc" },

32178 { 0xE03005, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

32179 { 0xE030F9, "Juniper Networks" },

32180 { 0xE0319E, "Valve Corporation" },

32181 { 0xE031D0, "SZ Telstar CO., LTD" },

32182 { 0xE0338E, "Apple, Inc." },

32183 { 0xE034E4, "Feit Electric Company, Inc." },

32184 { 0xE03560, "Challenger Supply Holdings, LLC" },

32185 { 0xE03676, "HUAWEI TECHNOLOGIES CO.,LTD" },

32186 { 0xE036E3, "Stage One International Co., Ltd." },

32187 { 0xE03717, "Vantiva USA LLC" },

32188 { 0xE037BF, "Wistron Neweb Corporation" },

32189 { 0xE0382D, "IEEE Registration Authority" },

32190 { 0xE0383F, "zte corporation" },

32191 { 0xE039D7, "Plexxi, Inc." },

32192 { 0xE03C1C, "IEEE Registration Authority" },

32193 { 0xE03C5B, "SHENZHEN JIAXINJIE ELECTRON CO.,LTD" },

32194 { 0xE03E44, "Broadcom" },

32195 { 0xE03E4A, "Cavanagh Group International" },

32196 { 0xE03E7D, "data-complex GmbH" },

32197 { 0xE03F49, "ASUSTek COMPUTER INC." },

32198 { 0xE04007, "Huawei Device Co., Ltd." },

32199 { 0xE04102, "zte corporation" },

32200 { 0xE04136, "MitraStar Technology Corp." },

32201 { 0xE043DB, "Shenzhen ViewAt Technology Co.,Ltd." },

32202 { 0xE0456D, "China Mobile Group Device Co.,Ltd." },

32203 { 0xE0469A, "NETGEAR" },

32204 { 0xE046E5, "Gosuncn Technology Group Co., Ltd." },

32205 { 0xE046EE, "NETGEAR" },

32206 { 0xE04735, "Ericsson AB" },

32207 { 0xE048AF, "Premietech Limited" },

32208 { 0xE048D3, "MOBIWIRE MOBILES (NINGBO) CO.,LTD" },

32209 { 0xE048D8, "Guangzhi Wulian Technology(Guangzhou) Co., Ltd" },

32210 { 0xE049ED, "Audeze LLC" },

32211 { 0xE04B41, "Hangzhou Beilian Low Carbon Technology Co., Ltd." },

32212 { 0xE04B45, "Hi-P Electronics Pte Ltd" },

32213 { 0xE04BA6, "HUAWEI TECHNOLOGIES CO.,LTD" },

32214 { 0xE04C05, "EverCharge" },

32215 { 0xE04C12, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

32216 { 0xE04F43, "Universal Global Scientific Industrial Co., Ltd." },

32217 { 0xE04FBD, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

32218 { 0xE0508B, "Zhejiang Dahua Technology Co., Ltd." },

32219 { 0xE05124, "NXP Semiconductors" },

32220 { 0xE05163, "Arcadyan Corporation" },

32221 { 0xE051D8, "China Dragon Technology Limited" },

32222 { 0xE0553D, "Cisco Meraki" },

32223 { 0xE05597, "Emergent Vision Technologies Inc." },

32224 { 0xE05689, "Lootom Telcovideo Network (Wuxi) Co Ltd" },

32225 { 0xE05694, "Yunhight Microelectronics" },

32226 { 0xE056F4, "AxesNetwork Solutions inc." },

32227 { 0xE0589E, "Laerdal Medical" },

32228 { 0xE05A1B, "Espressif Inc." },

32229 { 0xE05A9F, "IEEE Registration Authority" },

32230 { 0xE05B70, "Innovid, Co., Ltd." },

32231 { 0xE05D54, "Ruijie Networks Co.,LTD" },

32232 { 0xE05D5C, "Oy Everon Ab" },

32233 { 0xE05DA6, "Detlef Fink Elektronik & Softwareentwicklung" },

32234 { 0xE05F45, "Apple, Inc." },

32235 { 0xE05FB9, "Cisco Systems, Inc" },

32236 { 0xE06066, "Sercomm Corporation." },

32237 { 0xE06089, "Cloudleaf, Inc." },

32238 { 0xE061B2, "HANGZHOU ZENOINTEL TECHNOLOGY CO., LTD" },

32239 { 0xE06234, "Texas Instruments" },

32240 { 0xE06267, "Xiaomi Communications Co Ltd" },

32241 { 0xE06290, "Jinan Jovision Science & Technology Co., Ltd." },

32242 { 0xE063DA, "Ubiquiti Inc" },

32243 { 0xE063E5, "Sony Corporation" },

32244 { 0xE064BB, "DigiView S.r.l." },

32245 { 0xE06678, "Apple, Inc." },

32246 { 0xE06781, "Dongguan Liesheng Electronic Co., Ltd." },

32247 { 0xE067B3, "Shenzhen C-Data Technology Co., Ltd." },

32248 { 0xE0686D, "Raybased AB" },

32249 { 0xE068EE, "Phyplus Microelectronics Limited" },

32250 { 0xE0693A, "Innophase Inc." },

32251 { 0xE06995, "PEGATRON CORPORATION" },

32252 { 0xE069BA, "Cisco Systems, Inc" },

32253 { 0xE06A05, "Shenzhen YOUHUA Technology Co., Ltd" },

32254 { 0xE06C4E, "Shenzhen TINNO Mobile Technology Corp." },

32255 { 0xE06CA6, "Creotech Instruments S.A." },

32256 { 0xE06CC5, "Huawei Device Co., Ltd." },

32257 { 0xE06CF6, "ESSENCORE limited" },

32258 { 0xE06D17, "Apple, Inc." },

32259 { 0xE06D18, "PIONEERCORPORATION" },

32260 { 0xE070EA, "HP Inc." },

32261 { 0xE0720A, "Shenzhen SuperElectron Technology Co.,Ltd." },

32262 { 0xE0735F, "NUCOM" },

32263 { 0xE073E7, "HP Inc." },

32264 { 0xE0750A, "ALPSALPINE CO,.LTD" },

32265 { 0xE07526, "China Dragon Technology Limited" },

32266 { 0xE0757D, "Motorola Mobility LLC, a Lenovo Company" },

32267 { 0xE075AA, "Beijing Jingling Information System Technology Co., Ltd." },

32268 { 0xE076D0, "AMPAK Technology, Inc." },

32269 { 0xE07726, "Huawei Device Co., Ltd." },

32270 { 0xE078A3, "Shanghai Winner Information Technology Co.,Inc" },

32271 { 0xE0795E, "Wuxi Xiaohu Technology Co.,Ltd." },

32272 { 0xE0798D, "Silicon Laboratories" },

32273 { 0xE079C4, "iRay Technology Company Limited" },

32274 { 0xE07C13, "zte corporation" },

32275 { 0xE07C62, "Whistle Labs, Inc." },

32276 { 0xE07DEA, "Texas Instruments" },

32277 { 0xE07E5F, "Renesas Electronics (Penang) Sdn. Bhd." },

32278 { 0xE07F53, "TECHBOARD SRL" },

32279 { 0xE07F88, "EVIDENCE Network SIA" },

32280 { 0xE0806B, "Xiaomi Communications Co Ltd" },

32281 { 0xE08177, "GreenBytes, Inc." },

32282 { 0xE084F3, "High Grade Controls Corporation" },

32283 { 0xE0859A, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

32284 { 0xE08614, "Novatel Wireless Solutions, Inc." },

32285 { 0xE087B1, "Nata-Info Ltd." },

32286 { 0xE0885D, "Vantiva USA LLC" },

32287 { 0xE0897E, "Apple, Inc." },

32288 { 0xE0899D, "Cisco Systems, Inc" },

32289 { 0xE08A7E, "Exponent" },

32290 { 0xE08E3C, "Aztech Electronics Pte Ltd" },

32291 { 0xE08FEC, "REPOTEC CO., LTD." },

32292 { 0xE0913C, "Kyeungin CNS Co., Ltd." },

32293 { 0xE09153, "XAVi Technologies Corp." },

32294 { 0xE091F5, "NETGEAR" },

32295 { 0xE0925C, "Apple, Inc." },

32296 { 0xE0928F, "Texas Instruments" },

32297 { 0xE092A7, "Feitian Technologies Co., Ltd" },

32298 { 0xE09467, "Intel Corporate" },

32299 { 0xE09579, "ORTHOsoft inc, d/b/a Zimmer CAS" },

32300 { 0xE09796, "HUAWEI TECHNOLOGIES CO.,LTD" },

32301 { 0xE097F2, "Atomax Inc." },

32302 { 0xE09806, "Espressif Inc." },

32303 { 0xE09861, "Motorola Mobility LLC, a Lenovo Company" },

32304 { 0xE09971, "Samsung Electronics Co.,Ltd" },

32305 { 0xE09B27, "Ciena Corporation" },

32306 { 0xE09C8D, "Seakeeper, Inc." },

32307 { 0xE09CE5, "Shanghai Tricheer Technology Co.,Ltd." },

32308 { 0xE09D13, "Samsung Electronics Co.,Ltd" },

32309 { 0xE09D31, "Intel Corporate" },

32310 { 0xE09DB8, "PLANEX COMMUNICATIONS INC." },

32311 { 0xE09DFA, "Wanan Hongsheng Electronic Co.Ltd" },

32312 { 0xE09F2A, "Iton Technology Corp." },

32313 { 0xE0A129, "Extreme Networks Headquarters" },

32314 { 0xE0A198, "NOJA Power Switchgear Pty Ltd" },

32315 { 0xE0A1CE, "zte corporation" },

32316 { 0xE0A1D7, "SFR" },

32317 { 0xE0A258, "Wanbang Digital Energy Co.,Ltd" },

32318 { 0xE0A25A, "Shanghai Mo xiang Network Technology CO.,ltd" },

32319 { 0xE0A30F, "Pevco" },

32320 { 0xE0A3AC, "HUAWEI TECHNOLOGIES CO.,LTD" },

32321 { 0xE0A509, "Bitmain Technologies Inc" },

32322 { 0xE0A670, "Nokia Corporation" },

32323 { 0xE0A700, "Verkada Inc" },

32324 { 0xE0A8B8, "Le Shi Zhi Xin Electronic Technology (Tianjin) Limited" },

32325 { 0xE0AA96, "Samsung Electronics Co.,Ltd" },

32326 { 0xE0AAB0, "SUNTAILI ENTERPRISE CO. LTD," },

32327 { 0xE0AADB, "Nanjing PANENG Technology Development Co.,Ltd" },

32328 { 0xE0ABFE, "Orb Networks, Inc." },

32329 { 0xE0ACCB, "Apple, Inc." },

32330 { 0xE0ACF1, "Cisco Systems, Inc" },

32331 { 0xE0AE5E, "ALPSALPINE CO,.LTD" },

32332 { 0xE0AEA2, "HUAWEI TECHNOLOGIES CO.,LTD" },

32333 { 0xE0AEB2, "Bender GmbH &amp; Co.KG" },

32334 { 0xE0AEED, "LOENK" },

32335 { 0xE0AF4B, "Pluribus Networks, Inc." },

32336 { 0xE0AF4F, "Deutsche Telekom AG" },

32337 { 0xE0B260, "TENO NETWORK TECHNOLOGIES COMPANY LIMITED" },

32338 { 0xE0B2F1, "FN-LINK TECHNOLOGY LIMITED" },

32339 { 0xE0B52D, "Apple, Inc." },

32340 { 0xE0B55F, "Apple, Inc." },

32341 { 0xE0B655, "Beijing Xiaomi Electronics Co., Ltd." },

32342 { 0xE0B668, "zte corporation" },

32343 { 0xE0B6F5, "IEEE Registration Authority" },

32344 { 0xE0B70A, "ARRIS Group, Inc." },

32345 { 0xE0B72E, "ShenZhen Qualmesh Technology Co.,Ltd." },

32346 { 0xE0B7B1, "ARRIS Group, Inc." },

32347 { 0xE0B94D, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

32348 { 0xE0B98A, "Shenzhen Taike industrial automation company,Ltd" },

32349 { 0xE0B9A5, "AzureWave Technology Inc." },

32350 { 0xE0B9BA, "Apple, Inc." },

32351 { 0xE0B9E5, "Technicolor Delivery Technologies Belgium NV" },

32352 { 0xE0BAAD, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

32353 { 0xE0BAB4, "Arrcus, Inc" },

32354 { 0xE0BB0C, "Synertau LLC" },

32355 { 0xE0BB9E, "Seiko Epson Corporation" },

32356 { 0xE0BC43, "C2 Microsystems, Inc." },

32357 { 0xE0BDA0, "Apple, Inc." },

32358 { 0xE0BE03, "Lite-On Network Communication (Dongguan) Limited" },

32359 { 0xE0C0D1, "CK Telecom (Shenzhen) Limited" },

32360 { 0xE0C264, "Intel Corporate" },

32361 { 0xE0C286, "Aisai Communication Technology Co., Ltd." },

32362 { 0xE0C2B7, "Masimo Corporation" },

32363 { 0xE0C377, "Samsung Electronics Co.,Ltd" },

32364 { 0xE0C3F3, "zte corporation" },

32365 { 0xE0C58F, "China Mobile IOT Company Limited" },

32366 { 0xE0C63C, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

32367 { 0xE0C6B3, "MilDef AB" },

32368 { 0xE0C767, "Apple, Inc." },

32369 { 0xE0C79D, "Texas Instruments" },

32370 { 0xE0C86A, "SHENZHEN TW-SCIE Co., Ltd" },

32371 { 0xE0C922, "Jireh Energy Tech., Ltd." },

32372 { 0xE0C97A, "Apple, Inc." },

32373 { 0xE0CA3C, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

32374 { 0xE0CA4D, "Shenzhen Unistar Communication Co.,LTD" },

32375 { 0xE0CA94, "ASKEY COMPUTER CORP" },

32376 { 0xE0CB19, "Nokia" },

32377 { 0xE0CB1D, "Amazon Technologies Inc." },

32378 { 0xE0CB4E, "ASUSTek COMPUTER INC." },

32379 { 0xE0CB56, "Shenzhen iComm Semiconductor CO.,LTD" },

32380 { 0xE0CBBC, "Cisco Meraki" },

32381 { 0xE0CBEE, "Samsung Electronics Co.,Ltd" },

32382 { 0xE0CC7A, "HUAWEI TECHNOLOGIES CO.,LTD" },

32383 { 0xE0CCF8, "Xiaomi Communications Co Ltd" },

32384 { 0xE0CDFD, "Beijing E3Control Technology Co, LTD" },

32385 { 0xE0CEC3, "ASKEY COMPUTER CORP" },

32386 { 0xE0CF2D, "Gemintek Corporation" },

32387 { 0xE0D045, "Intel Corporate" },

32388 { 0xE0D083, "Samsung Electronics Co.,Ltd" },

32389 { 0xE0D10A, "Katoudenkikougyousyo co ltd" },

32390 { 0xE0D173, "Cisco Systems, Inc" },

32391 { 0xE0D1E6, "Aliph dba Jawbone" },

32392 { 0xE0D31A, "EQUES Technology Co., Limited" },

32393 { 0xE0D3B4, "Cisco Meraki" },

32394 { 0xE0D462, "Huawei Device Co., Ltd." },

32395 { 0xE0D464, "Intel Corporate" },

32396 { 0xE0D4E8, "Intel Corporate" },

32397 { 0xE0D55E, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

32398 { 0xE0D738, "WireStar Networks" },

32399 { 0xE0D7BA, "Texas Instruments" },

32400 { 0xE0D848, "Dell Inc." },

32401 { 0xE0D8C4, "Qingdao Intelligent&Precise Electronics Co.,Ltd." },

32402 { 0xE0D9A2, "Hippih aps" },

32403 { 0xE0D9E3, "Eltex Enterprise Ltd." },

32404 { 0xE0DA90, "HUAWEI TECHNOLOGIES CO.,LTD" },

32405 { 0xE0DADC, "JVC KENWOOD Corporation" },

32406 { 0xE0DB10, "Samsung Electronics Co.,Ltd" },

32407 { 0xE0DB55, "Dell Inc." },

32408 { 0xE0DB88, "Open Standard Digital-IF Interface for SATCOM Systems" },

32409 { 0xE0DBD1, "Vantiva USA LLC" },

32410 { 0xE0DCA0, "Siemens Industrial Automation Products Ltd., Chengdu" },

32411 { 0xE0DCFF, "Xiaomi Communications Co Ltd" },

32412 { 0xE0DDC0, "vivo Mobile Communication Co., Ltd." },

32413 { 0xE0DF13, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

32414 { 0xE0E0C2, "China Mobile Group Device Co.,Ltd." },

32415 { 0xE0E0FC, "Huawei Device Co., Ltd." },

32416 { 0xE0E1A9, "Shenzhen Four Seas Global Link Network Technology Co., Ltd." },

32417 { 0xE0E2E6, "Espressif Inc." },

32418 { 0xE0E37C, "Huawei Device Co., Ltd." },

32419 { 0xE0E5CF, "Texas Instruments" },

32420 { 0xE0E62E, "TCT mobile ltd" },

32421 { 0xE0E631, "SNB TECHNOLOGIES LIMITED" },

32422 { 0xE0E656, "Nethesis srl" },

32423 { 0xE0E751, "Nintendo Co., Ltd." },

32424 { 0xE0E7BB, "Nureva, Inc." },

32425 { 0xE0E8BB, "Unicom Vsens Telecommunications Co., Ltd." },

32426 { 0xE0E8E6, "Shenzhen C-Data Technology Co., Ltd." },

32427 { 0xE0E8E8, "Olive Telecommunication Pvt. Ltd" },

32428 { 0xE0EB40, "Apple, Inc." },

32429 { 0xE0EB62, "Shanghai Hulu Devices Co., Ltd" },

32430 { 0xE0ED1A, "vastriver Technology Co., Ltd" },

32431 { 0xE0EDC7, "Shenzhen Friendcom Technology Development Co., Ltd" },

32432 { 0xE0EE1B, "Panasonic Automotive Systems Company of America" },

32433 { 0xE0EF02, "Chengdu Quanjing Intelligent Technology Co.,Ltd" },

32434 { 0xE0EF25, "Lintes Technology Co., Ltd." },

32435 { 0xE0F211, "Digitalwatt" },

32436 { 0xE0F318, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

32437 { 0xE0F379, "Vaddio" },

32438 { 0xE0F442, "Huawei Device Co., Ltd." },

32439 { 0xE0F5C6, "Apple, Inc." },

32440 { 0xE0F5CA, "CHENG UEI PRECISION INDUSTRY CO.,LTD." },

32441 { 0xE0F62D, "Juniper Networks" },

32442 { 0xE0F678, "Fiberhome Telecommunication Technologies Co.,LTD" },

32443 { 0xE0F6B5, "Nintendo Co.,Ltd" },

32444 { 0xE0F728, "Amazon Technologies Inc." },

32445 { 0xE0F847, "Apple, Inc." },

32446 { 0xE0F9BE, "Cloudena Corp." },

32447 { 0xE0FAEC, "Platan sp. z o.o. sp. k." },

32448 { 0xE0FFF1, "Texas Instruments" },

32449 { 0xE0FFF7, "Softiron Inc." },

32450 { 0xE4029B, "Intel Corporate" },

32451 { 0xE40439, "TomTom Software Ltd" },

32452 { 0xE405F8, "Bytedance" },

32453 { 0xE4072B, "Huawei Device Co., Ltd." },

32454 { 0xE408E7, "Quectel Wireless Solutions Co.,Ltd." },

32455 { 0xE40A16, "HUAWEI TECHNOLOGIES CO.,LTD" },

32456 { 0xE40CFD, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

32457 { 0xE40D36, "Intel Corporate" },

32458 { 0xE40D3B, "Ericsson AB" },

32459 { 0xE40EEE, "HUAWEI TECHNOLOGIES CO.,LTD" },

32460 { 0xE41088, "Samsung Electronics Co.,Ltd" },

32461 { 0xE4115B, "Hewlett Packard" },

32462 { 0xE41218, "ShenZhen Rapoo Technology Co., Ltd." },

32463 { 0xE4121D, "Samsung Electronics Co.,Ltd" },

32464 { 0xE41226, "Continental Automotive Romania SLR" },

32465 { 0xE41289, "topsystem GmbH" },

32466 { 0xE415F6, "Texas Instruments" },

32467 { 0xE417D8, "8BITDO TECHNOLOGY HK LIMITED" },

32468 { 0xE4186B, "Zyxel Communications Corporation" },

32469 { 0xE419C1, "HUAWEI TECHNOLOGIES CO.,LTD" },

32470 { 0xE41A1D, "NOVEA ENERGIES" },

32471 { 0xE41A2C, "ZPE Systems, Inc." },

32472 { 0xE41C4B, "V2 TECHNOLOGY, INC." },

32473 { 0xE41D2D, "Mellanox Technologies, Inc." },

32474 { 0xE41E0A, "IEEE Registration Authority" },

32475 { 0xE41F13, "IBM Corp" },

32476 { 0xE41F7B, "Cisco Systems, Inc" },

32477 { 0xE41FE9, "Dunkermotoren GmbH" },

32478 { 0xE42150, "Shanghai Chint low voltage electrical technology Co.,Ltd." },

32479 { 0xE422A5, "PLANTRONICS, INC." },

32480 { 0xE4233C, "Juniper Networks" },

32481 { 0xE42354, "SHENZHEN FUZHI SOFTWARE TECHNOLOGY CO.,LTD" },

32482 { 0xE4246C, "Zhejiang Dahua Technology Co., Ltd." },

32483 { 0xE425E7, "Apple, Inc." },

32484 { 0xE425E9, "Color-Chip" },

32485 { 0xE42686, "DWnet Technologies(Suzhou) Corporation" },

32486 { 0xE4268B, "Huawei Device Co., Ltd." },

32487 { 0xE426D5, "Motorola Mobility LLC, a Lenovo Company" },

32488 { 0xE42761, "Honor Device Co., Ltd." },

32489 { 0xE42771, "Smartlabs" },

32490 { 0xE42805, "Pivotal Optics" },

32491 { 0xE428A4, "Prama India Private Limited" },

32492 { 0xE4293D, "Shenzhen Sy-Fiber Optical Communication Technology.Co.,Ltd" },

32493 { 0xE42AAC, "Microsoft Corporation" },

32494 { 0xE42AD3, "Magneti Marelli S.p.A. Powertrain" },

32495 { 0xE42B34, "Apple, Inc." },

32496 { 0xE42B79, "Nokia" },

32497 { 0xE42C56, "Lilee Systems, Ltd." },

32498 { 0xE42D02, "TCT mobile ltd" },

32499 { 0xE42D7B, "China Mobile IOT Company Limited" },

32500 { 0xE42F26, "Fiberhome Telecommunication Technologies Co.,LTD" },

32501 { 0xE42F56, "OptoMET GmbH" },

32502 { 0xE42FF6, "Unicore communication Inc." },

32503 { 0xE43022, "Hanwha Techwin Security Vietnam" },

32504 { 0xE432CB, "Samsung Electronics Co.,Ltd" },

32505 { 0xE433AE, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

32506 { 0xE43493, "HUAWEI TECHNOLOGIES CO.,LTD" },

32507 { 0xE43593, "Hangzhou GoTo technology Co.Ltd" },

32508 { 0xE435C8, "HUAWEI TECHNOLOGIES CO.,LTD" },

32509 { 0xE435FB, "Sabre Technology (Hull) Ltd" },

32510 { 0xE4379F, "Cisco Systems, Inc" },

32511 { 0xE437D7, "HENRI DEPAEPE S.A.S." },

32512 { 0xE43819, "Shenzhen Hi-Link Electronic CO.,Ltd." },

32513 { 0xE4387E, "Cisco Systems, Inc" },

32514 { 0xE43883, "Ubiquiti Inc" },

32515 { 0xE4388C, "Digital Products Limited" },

32516 { 0xE438F2, "Advantage Controls" },

32517 { 0xE43A65, "MofiNetwork Inc" },

32518 { 0xE43A6E, "Shenzhen Zeroone Technology CO.,LTD" },

32519 { 0xE43BC9, "HISENSE VISUAL TECHNOLOGY CO.,LTD" },

32520 { 0xE43C80, "University of Oklahoma" },

32521 { 0xE43D1A, "Broadcom Limited" },

32522 { 0xE43EC6, "HUAWEI TECHNOLOGIES CO.,LTD" },

32523 { 0xE43ED7, "Arcadyan Corporation" },

32524 { 0xE43FA2, "Wuxi DSP Technologies Inc." },

32525 { 0xE44097, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

32526 { 0xE440E2, "Samsung Electronics Co.,Ltd" },

32527 { 0xE44122, "OnePlus Technology (Shenzhen) Co., Ltd" },

32528 { 0xE44164, "Nokia" },

32529 { 0xE441E6, "Ottec Technology GmbH" },

32530 { 0xE442A6, "Intel Corporate" },

32531 { 0xE4434B, "Dell Inc." },

32532 { 0xE444E5, "Extreme Networks Headquarters" },

32533 { 0xE44519, "Beijing Xiaomi Electronics Co.,Ltd" },

32534 { 0xE446B0, "Fujitsu Client Computing Limited" },

32535 { 0xE446BD, "C&C TECHNIC TAIWAN CO., LTD." },

32536 { 0xE446DA, "Xiaomi Communications Co Ltd" },

32537 { 0xE44790, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

32538 { 0xE44791, "Iris ID Systems, Inc." },

32539 { 0xE447B3, "zte corporation" },

32540 { 0xE448C7, "Cisco SPVTG" },

32541 { 0xE44C6C, "Shenzhen Guo Wei Electronic Co,. Ltd." },

32542 { 0xE44CC7, "IEEE Registration Authority" },

32543 { 0xE44E18, "Gardasoft VisionLimited" },

32544 { 0xE44E2D, "Cisco Systems, Inc" },

32545 { 0xE44E76, "CHAMPIONTECH ENTERPRISE (SHENZHEN) INC" },

32546 { 0xE44F29, "MA Lighting Technology GmbH" },

32547 { 0xE44F5F, "EDS Elektronik Destek San.Tic.Ltd.Sti" },

32548 { 0xE4509A, "HW Communications Ltd" },

32549 { 0xE450EB, "Apple, Inc." },

32550 { 0xE4521E, "Texas Instruments" },

32551 { 0xE454E8, "Dell Inc." },

32552 { 0xE455A8, "Cisco Meraki" },

32553 { 0xE455EA, "Dedicated Computing" },

32554 { 0xE45614, "Suttle Apparatus" },

32555 { 0xE45740, "ARRIS Group, Inc." },

32556 { 0xE457A8, "Stuart Manufacturing, Inc." },

32557 { 0xE458B8, "Samsung Electronics Co.,Ltd" },

32558 { 0xE458E7, "Samsung Electronics Co.,Ltd" },

32559 { 0xE45AA2, "vivo Mobile Communication Co., Ltd." },

32560 { 0xE45AD4, "Eltex Enterprise Ltd." },

32561 { 0xE45D37, "Juniper Networks" },

32562 { 0xE45D51, "SFR" },

32563 { 0xE45D52, "Avaya Inc" },

32564 { 0xE45D75, "Samsung Electronics Co.,Ltd" },

32565 { 0xE45E1B, "Google, Inc." },

32566 { 0xE45E37, "Intel Corporate" },

32567 { 0xE45F01, "Raspberry Pi Trading Ltd" },

32568 { 0xE46017, "Intel Corporate" },

32569 { 0xE4604D, "zte corporation" },

32570 { 0xE46059, "Pingtek Co., Ltd." },

32571 { 0xE461F4, "shenzhen worldelite electronics co., LTD" },

32572 { 0xE46251, "HAO CHENG GROUP LIMITED" },

32573 { 0xE462C4, "Cisco Systems, Inc" },

32574 { 0xE46449, "ARRIS Group, Inc." },

32575 { 0xE46564, "SHENZHEN KTC TECHNOLOGY CO.,LTD" },

32576 { 0xE465B8, "Espressif Inc." },

32577 { 0xE466AB, "zte corporation" },

32578 { 0xE4671E, "SHEN ZHEN NUO XIN CHENG TECHNOLOGY co., Ltd." },

32579 { 0xE467BA, "Danish Interpretation Systems A/S" },

32580 { 0xE468A3, "HUAWEI TECHNOLOGIES CO.,LTD" },

32581 { 0xE4695A, "Dictum Health, Inc." },

32582 { 0xE46A35, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

32583 { 0xE46C21, "messMa GmbH" },

32584 { 0xE46CD1, "Calix Inc." },

32585 { 0xE46D7F, "Ciena Corporation" },

32586 { 0xE46F13, "D-Link International" },

32587 { 0xE470B8, "Intel Corporate" },

32588 { 0xE47185, "Securifi Ltd" },

32589 { 0xE472E2, "HUAWEI TECHNOLOGIES CO.,LTD" },

32590 { 0xE47305, "Shenzhen INVT Electric CO.,Ltd" },

32591 { 0xE47450, "Shenzhen Grandsun Electronic Co.,Ltd." },

32592 { 0xE4751E, "Getinge Sterilization AB" },

32593 { 0xE475DC, "Arcadyan Corporation" },

32594 { 0xE47684, "Apple, Inc." },

32595 { 0xE47723, "zte corporation" },

32596 { 0xE47727, "HUAWEI TECHNOLOGIES CO.,LTD" },

32597 { 0xE4776B, "AARTESYS AG" },

32598 { 0xE477D4, "Minrray Industry Co.,Ltd" },

32599 { 0xE47876, "Arista Networks" },

32600 { 0xE47A2C, "SZ DJI TECHNOLOGY CO.,LTD" },

32601 { 0xE47B3F, "BEIJING CO-CLOUD TECHNOLOGY LTD." },

32602 { 0xE47C65, "Sunstar Communication Technology Co., Ltd" },

32603 { 0xE47CF9, "Samsung Electronics Co.,Ltd" },

32604 { 0xE47D5A, "Beijing Hanbang Technology Corp." },

32605 { 0xE47DBD, "Samsung Electronics Co.,Ltd" },

32606 { 0xE47DEB, "Shanghai Notion Information Technology CO.,LTD." },

32607 { 0xE47E66, "HUAWEI TECHNOLOGIES CO.,LTD" },

32608 { 0xE47E9A, "zte corporation" },

32609 { 0xE47FB2, "FUJITSU LIMITED" },

32610 { 0xE48184, "Nokia" },

32611 { 0xE481B3, "Shenzhen ACT Industrial Co.,Ltd." },

32612 { 0xE48210, "HUAWEI TECHNOLOGIES CO.,LTD" },

32613 { 0xE482CC, "Jumptronic GmbH" },

32614 { 0xE48326, "HUAWEI TECHNOLOGIES CO.,LTD" },

32615 { 0xE48399, "ARRIS Group, Inc." },

32616 { 0xE48429, "New H3C Technologies Co., Ltd" },

32617 { 0xE4842B, "HANGZHOU SOFTEL OPTIC CO., LTD" },

32618 { 0xE484D3, "Xiaomi Communications Co Ltd" },

32619 { 0xE48501, "Geberit International AG" },

32620 { 0xE48AD5, "RF WINDOW CO., LTD." },

32621 { 0xE48B7F, "Apple, Inc." },

32622 { 0xE48C0F, "Discovery Insure" },

32623 { 0xE48C73, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

32624 { 0xE48D8C, "Routerboard.com" },

32625 { 0xE48E10, "CIG SHANGHAI CO LTD" },

32626 { 0xE48EBB, "Rockwell Automation" },

32627 { 0xE48F1D, "Huawei Device Co., Ltd." },

32628 { 0xE48F34, "Vodafone Italia S.p.A." },

32629 { 0xE48F65, "Yelatma Instrument Making Enterprise, JSC" },

32630 { 0xE4902A, "HUAWEI TECHNOLOGIES CO.,LTD" },

32631 { 0xE49069, "Rockwell Automation" },

32632 { 0xE4907E, "Motorola Mobility LLC, a Lenovo Company" },

32633 { 0xE490FD, "Apple, Inc." },

32634 { 0xE4922A, "DBG HOLDINGS LIMITED" },

32635 { 0xE492E7, "Gridlink Tech. Co.,Ltd." },

32636 { 0xE492FB, "Samsung Electronics Co.,Ltd" },

32637 { 0xE4936A, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

32638 { 0xE4956E, "IEEE Registration Authority" },

32639 { 0xE496AE, "ALTOGRAPHICS Inc." },

32640 { 0xE497F0, "Shanghai VLC Technologies Ltd. Co." },

32641 { 0xE498BB, "Phyplus Microelectronics Limited" },

32642 { 0xE498D1, "Microsoft Mobile Oy" },

32643 { 0xE498D6, "Apple, Inc." },

32644 { 0xE49A79, "Apple, Inc." },

32645 { 0xE49ADC, "Apple, Inc." },

32646 { 0xE49C67, "Apple, Inc." },

32647 { 0xE49D73, "Edgecore Networks Corporation" },

32648 { 0xE49E12, "FREEBOX SAS" },

32649 { 0xE49F1E, "ARRIS Group, Inc." },

32650 { 0xE4A1E6, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

32651 { 0xE4A32F, "Shanghai Artimen Technology Co., Ltd." },

32652 { 0xE4A387, "Control Solutions LLC" },

32653 { 0xE4A41C, "Cisco Systems, Inc" },

32654 { 0xE4A471, "Intel Corporate" },

32655 { 0xE4A5EF, "TRON LINK ELECTRONICS CO., LTD." },

32656 { 0xE4A634, "Universal Electronics, Inc." },

32657 { 0xE4A749, "Palo Alto Networks" },

32658 { 0xE4A7A0, "Intel Corporate" },

32659 { 0xE4A7C5, "HUAWEI TECHNOLOGIES CO.,LTD" },

32660 { 0xE4A7D0, "HUAWEI TECHNOLOGIES CO.,LTD" },

32661 { 0xE4A7FD, "Cellco Partnership" },

32662 { 0xE4A8B6, "HUAWEI TECHNOLOGIES CO.,LTD" },

32663 { 0xE4A8DF, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

32664 { 0xE4AA5D, "Cisco Systems, Inc" },

32665 { 0xE4AAE4, "Xiaomi Communications Co Ltd" },

32666 { 0xE4AAEA, "Liteon Technology Corporation" },

32667 { 0xE4AAEC, "Tianjin Hualai Technology Co., Ltd" },

32668 { 0xE4AB46, "UAB Selteka" },

32669 { 0xE4AB89, "MitraStar Technology Corp." },

32670 { 0xE4AD7D, "SCL Elements" },

32671 { 0xE4AFA1, "HES-SO" },

32672 { 0xE4B005, "Beijing IQIYI Science & Technology Co., Ltd." },

32673 { 0xE4B021, "Samsung Electronics Co.,Ltd" },

32674 { 0xE4B224, "HUAWEI TECHNOLOGIES CO.,LTD" },

32675 { 0xE4B2FB, "Apple, Inc." },

32676 { 0xE4B318, "Intel Corporate" },

32677 { 0xE4B503, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

32678 { 0xE4B555, "Huawei Device Co., Ltd." },

32679 { 0xE4B633, "Wuxi Stars Microsystem Technology Co., Ltd" },

32680 { 0xE4B97A, "Dell Inc." },

32681 { 0xE4BAD9, "360 Fly Inc." },

32682 { 0xE4BC96, "Versuni" },

32683 { 0xE4BCAA, "Xiaomi Communications Co Ltd" },

32684 { 0xE4BD4B, "zte corporation" },

32685 { 0xE4BEED, "Netis Technology Co., Ltd." },

32686 { 0xE4BEFB, "HUAWEI TECHNOLOGIES CO.,LTD" },

32687 { 0xE4BFFA, "Vantiva USA LLC" },

32688 { 0xE4C0CC, "China Mobile Group Device Co.,Ltd." },

32689 { 0xE4C0E2, "Sagemcom Broadband SAS" },

32690 { 0xE4C146, "Objetivos y Servicios de Valor A" },

32691 { 0xE4C1F1, "SHENZHEN SPOTMAU INFORMATION TECHNOLIGY CO., Ltd" },

32692 { 0xE4C2D1, "HUAWEI TECHNOLOGIES CO.,LTD" },

32693 { 0xE4C32A, "TP-LINK TECHNOLOGIES CO.,LTD." },

32694 { 0xE4C483, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

32695 { 0xE4C62B, "Airware" },

32696 { 0xE4C63D, "Apple, Inc." },

32697 { 0xE4C6E6, "Mophie, LLC" },

32698 { 0xE4C722, "Cisco Systems, Inc" },

32699 { 0xE4C767, "Intel Corporate" },

32700 { 0xE4C770, "Raisecom Technology CO., LTD" },

32701 { 0xE4C801, "BLU Products Inc" },

32702 { 0xE4C806, "Ceiec Electric Technology Inc." },

32703 { 0xE4C90B, "Radwin" },

32704 { 0xE4CA12, "zte corporation" },

32705 { 0xE4CB59, "Beijing Loveair Science and Technology Co. Ltd." },

32706 { 0xE4CC9D, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

32707 { 0xE4CE02, "WyreStorm Technologies Ltd" },

32708 { 0xE4CE70, "Health & Life co., Ltd." },

32709 { 0xE4CE8F, "Apple, Inc." },

32710 { 0xE4D124, "Mojo Networks, Inc." },

32711 { 0xE4D332, "TP-LINK TECHNOLOGIES CO.,LTD." },

32712 { 0xE4D373, "HUAWEI TECHNOLOGIES CO.,LTD" },

32713 { 0xE4D3AA, "FCNT LMITED" },

32714 { 0xE4D3F1, "Cisco Systems, Inc" },

32715 { 0xE4D53D, "Hon Hai Precision Ind. Co.,Ltd." },

32716 { 0xE4D71D, "Oraya Therapeutics" },

32717 { 0xE4DADF, "Taicang T&W Electronics" },

32718 { 0xE4DB6D, "Beijing Xiaomi Electronics Co., Ltd." },

32719 { 0xE4DBAE, "Extreme Networks Headquarters" },

32720 { 0xE4DC43, "Huawei Device Co., Ltd." },

32721 { 0xE4DC5F, "Cofractal, Inc." },

32722 { 0xE4DCCC, "HUAWEI TECHNOLOGIES CO.,LTD" },

32723 { 0xE4DD79, "En-Vision America, Inc." },

32724 { 0xE4DE40, "Aruba, a Hewlett Packard Enterprise Company" },

32725 { 0xE4E0A6, "Apple, Inc." },

32726 { 0xE4E0C5, "Samsung Electronics Co.,Ltd" },

32727 { 0xE4E112, "Texas Instruments" },

32728 { 0xE4E130, "TCT mobile ltd" },

32729 { 0xE4E26C, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

32730 { 0xE4E409, "LEIFHEIT AG" },

32731 { 0xE4E4AB, "Apple, Inc." },

32732 { 0xE4E66C, "Tiandy Technologies Co.,LTD" },

32733 { 0xE4E749, "Hewlett Packard" },

32734 { 0xE4EA83, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

32735 { 0xE4EC10, "Nokia Corporation" },

32736 { 0xE4ECE8, "Samsung Electronics Co.,Ltd" },

32737 { 0xE4EEFD, "MR&D Manufacturing" },

32738 { 0xE4F004, "Dell Inc." },

32739 { 0xE4F042, "Google, Inc." },

32740 { 0xE4F14C, "Private" },

32741 { 0xE4F1D4, "vivo Mobile Communication Co., Ltd." },

32742 { 0xE4F27C, "Juniper Networks" },

32743 { 0xE4F327, "ATOL LLC" },

32744 { 0xE4F365, "Time-O-Matic, Inc." },

32745 { 0xE4F3C4, "Samsung Electronics Co.,Ltd" },

32746 { 0xE4F3E3, "Shanghai iComhome Co.,Ltd." },

32747 { 0xE4F3E8, "Shenzhen SuperElectron Technology Co.,Ltd." },

32748 { 0xE4F3F5, "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

32749 { 0xE4F4C6, "NETGEAR" },

32750 { 0xE4F75B, "ARRIS Group, Inc." },

32751 { 0xE4F7A1, "Datafox GmbH" },

32752 { 0xE4F89C, "Intel Corporate" },

32753 { 0xE4F8BE, "TECNO MOBILE LIMITED" },

32754 { 0xE4F8EF, "Samsung Electronics Co.,Ltd" },

32755 { 0xE4F939, "Minxon Hotel Technology INC." },

32756 { 0xE4FA1D, "PAD Peripheral Advanced Design Inc." },

32757 { 0xE4FA5B, "Texas Instruments" },

32758 { 0xE4FAC4, "TP-LINK CORPORATION PTE. LTD." },

32759 { 0xE4FAED, "Samsung Electronics Co.,Ltd" },

32760 { 0xE4FAFD, "Intel Corporate" },

32761 { 0xE4FB5D, "HUAWEI TECHNOLOGIES CO.,LTD" },

32762 { 0xE4FB8F, "MOBIWIRE MOBILES (NINGBO) CO.,LTD" },

32763 { 0xE4FC82, "Juniper Networks" },

32764 { 0xE4FD45, "Intel Corporate" },

32765 { 0xE4FDA1, "HUAWEI TECHNOLOGIES CO.,LTD" },

32766 { 0xE4FED9, "EDMI Europe Ltd" },

32767 { 0xE4FFDD, "ELECTRON INDIA" },

32768 { 0xE80036, "Befs co,. ltd" },

32769 { 0xE80115, "COOCAA Network Technology CO.,TD." },

32770 { 0xE8018D, "Fiberhome Telecommunication Technologies Co.,LTD" },

32771 { 0xE8039A, "Samsung Electronics Co.,Ltd" },

32772 { 0xE8040B, "Apple, Inc." },

32773 { 0xE80410, "Private" },

32774 { 0xE80462, "Cisco Systems, Inc" },

32775 { 0xE804F3, "Throughtek Co., Ltd." },

32776 { 0xE8056D, "Nortel Networks" },

32777 { 0xE805DC, "Verifone Inc." },

32778 { 0xE80688, "Apple, Inc." },

32779 { 0xE80734, "Champion Optical Network Engineering, LLC" },

32780 { 0xE807BF, "SHENZHEN BOOMTECH INDUSTRY CO.,LTD" },

32781 { 0xE8088B, "HUAWEI TECHNOLOGIES CO.,LTD" },

32782 { 0xE80945, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

32783 { 0xE80959, "Guoguang Electric Co.,Ltd" },

32784 { 0xE80AB9, "Cisco Systems, Inc" },

32785 { 0xE80AEC, "Jiangsu Hengtong Optic-Electric Co., LTD" },

32786 { 0xE80B13, "Akib Systems Taiwan, INC" },

32787 { 0xE80C38, "DAEYOUNG INFORMATION SYSTEM CO., LTD" },

32788 { 0xE80C75, "Syncbak, Inc." },

32789 { 0xE80FC8, "Universal Electronics, Inc." },

32790 { 0xE8102E, "Really Simple Software, Inc" },

32791 { 0xE81098, "Aruba, a Hewlett Packard Enterprise Company" },

32792 { 0xE81132, "Samsung Electronics Co.,Ltd" },

32793 { 0xE811CA, "SHANDONG KAER ELECTRIC.CO.,LTD" },

32794 { 0xE81324, "GuangZhou Bonsoninfo System CO.,LTD" },

32795 { 0xE81363, "Comstock RD, Inc." },

32796 { 0xE81367, "AIRSOUND Inc." },

32797 { 0xE8136E, "HUAWEI TECHNOLOGIES CO.,LTD" },

32798 { 0xE8150E, "Nokia Corporation" },

32799 { 0xE8162B, "IDEO Security Co., Ltd." },

32800 { 0xE81656, "Hangzhou BroadLink Technology Co.,Ltd" },

32801 { 0xE81711, "Shenzhen Vipstech Co., Ltd" },

32802 { 0xE817FC, "Fujitsu Cloud Technologies Limited" },

32803 { 0xE81863, "IEEE Registration Authority" },

32804 { 0xE81A58, "TECHNOLOGIC SYSTEMS" },

32805 { 0xE81AAC, "ORFEO SOUNDWORKS Inc." },

32806 { 0xE81B4B, "amnimo Inc." },

32807 { 0xE81B69, "Sercomm Corporation." },

32808 { 0xE81CBA, "Fortinet, Inc." },

32809 { 0xE81CD8, "Apple, Inc." },

32810 { 0xE81DA8, "Ruckus Wireless" },

32811 { 0xE81E92, "Huawei Device Co., Ltd." },

32812 { 0xE820E2, "HUMAX Co., Ltd." },

32813 { 0xE822B8, "Shenzhen Skyworth Digital Technology CO., Ltd" },

32814 { 0xE82404, "Quectel Wireless Solutions Co.,Ltd." },

32815 { 0xE824A6, "Juniper Networks" },

32816 { 0xE82587, "Shenzhen Chilink IoT Technology Co., Ltd." },

32817 { 0xE82689, "Aruba, a Hewlett Packard Enterprise Company" },

32818 { 0xE8268D, "Shenzhen SuperElectron Technology Co.,Ltd." },

32819 { 0xE826B6, "Companies House to GlucoRx Technologies Ltd." },

32820 { 0xE82725, "Axis Communications AB" },

32821 { 0xE82877, "TMY Co., Ltd." },

32822 { 0xE8288D, "Huawei Device Co., Ltd." },

32823 { 0xE828C1, "Eltex Enterprise Ltd." },

32824 { 0xE828D5, "Cots Technology" },

32825 { 0xE82A44, "Liteon Technology Corporation" },

32826 { 0xE82AEA, "Intel Corporate" },

32827 { 0xE82BC5, "Huawei Device Co., Ltd." },

32828 { 0xE82C6D, "SmartRG, Inc." },

32829 { 0xE82E0C, "NETINT Technologies Inc." },

32830 { 0xE82E24, "Out of the Fog Research LLC" },

32831 { 0xE831CD, "Espressif Inc." },

32832 { 0xE8330D, "Xaptec GmbH" },

32833 { 0xE83381, "ARRIS Group, Inc." },

32834 { 0xE8343E, "Beijing Infosec Technologies Co., LTD." },

32835 { 0xE83617, "Apple, Inc." },

32836 { 0xE8361D, "Sense Labs, Inc." },

32837 { 0xE8377A, "Zyxel Communications Corporation" },

32838 { 0xE838A0, "Vizio, Inc" },

32839 { 0xE83935, "Hewlett Packard" },

32840 { 0xE839DF, "ASKEY COMPUTER CORP" },

32841 { 0xE83A12, "Samsung Electronics Co.,Ltd" },

32842 { 0xE83A4B, "China Mobile Group Device Co.,Ltd." },

32843 { 0xE83A97, "Toshiba Corporation" },

32844 { 0xE83EB6, "RIM" },

32845 { 0xE83EFB, "GEODESIC LTD." },

32846 { 0xE83EFC, "ARRIS Group, Inc." },

32847 { 0xE83F67, "Huawei Device Co., Ltd." },

32848 { 0xE84040, "Cisco Systems, Inc" },

32849 { 0xE840F2, "PEGATRON CORPORATION" },

32850 { 0xE84368, "zte corporation" },

32851 { 0xE843B6, "QNAP Systems, Inc." },

32852 { 0xE8447E, "Bitdefender SRL" },

32853 { 0xE8458B, "MitraStar Technology Corp." },

32854 { 0xE84727, "Quectel Wireless Solutions Co.,Ltd." },

32855 { 0xE8473A, "Hon Hai Precision Industry Co.,LTD" },

32856 { 0xE8481F, "Advanced Automotive Antennas" },

32857 { 0xE848B8, "TP-Link Corporation Limited" },

32858 { 0xE84943, "YUGE Information technology Co. Ltd" },

32859 { 0xE84A54, "Beijing Xiaomi Mobile Software Co., Ltd" },

32860 { 0xE84C4A, "Amazon Technologies Inc." },

32861 { 0xE84C56, "INTERCEPT SERVICES LIMITED" },

32862 { 0xE84D74, "HUAWEI TECHNOLOGIES CO.,LTD" },

32863 { 0xE84DD0, "HUAWEI TECHNOLOGIES CO.,LTD" },

32864 { 0xE84DEC, "Xerox Corporation" },

32865 { 0xE84E06, "EDUP INTERNATIONAL (HK) CO., LTD" },

32866 { 0xE84E84, "Samsung Electronics Co.,Ltd" },

32867 { 0xE84ECE, "Nintendo Co., Ltd." },

32868 { 0xE84F25, "Murata Manufacturing Co., Ltd." },

32869 { 0xE84F4B, "Shenzhen Delos Electronic Co., Ltd" },

32870 { 0xE84FA7, "Huawei Device Co., Ltd." },

32871 { 0xE8508B, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

32872 { 0xE8516E, "TSMART Inc." },

32873 { 0xE85177, "Qingdao Intelligent&Precise Electronics Co.,Ltd." },

32874 { 0xE8519D, "Yeonhab Precision Co.,LTD" },

32875 { 0xE8519E, "Guangzhou Shiyuan Electronic Technology Company Limited" },

32876 { 0xE85484, "NEO Information Systems Co., Ltd." },

32877 { 0xE85540, "WUXI FUNIDE DIGITAL CO.,LTD" },

32878 { 0xE855B4, "SAI Technology Inc." },

32879 { 0xE85659, "Advanced-Connectek Inc." },

32880 { 0xE856D6, "NCTech Ltd" },

32881 { 0xE85A8B, "Xiaomi Communications Co Ltd" },

32882 { 0xE85AA7, "LLC Emzior" },

32883 { 0xE85AD1, "Fiberhome Telecommunication Technologies Co.,LTD" },

32884 { 0xE85B5B, "LG ELECTRONICS INC" },

32885 { 0xE85BB7, "Ample Systems Inc." },

32886 { 0xE85BF0, "Imaging Diagnostics" },

32887 { 0xE85C0A, "Cisco Systems, Inc" },

32888 { 0xE85D6B, "Luminate Wireless" },

32889 { 0xE85D86, "CHANG YOW TECHNOLOGIES INTERNATIONAL CO.,LTD." },

32890 { 0xE85E53, "Infratec Datentechnik GmbH" },

32891 { 0xE85F02, "Apple, Inc." },

32892 { 0xE8611F, "Dawning Information Industry Co.,Ltd" },

32893 { 0xE8617E, "Liteon Technology Corporation" },

32894 { 0xE86183, "Black Diamond Advanced Technology, LLC" },

32895 { 0xE861BE, "Melec Inc." },

32896 { 0xE86538, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

32897 { 0xE86549, "Cisco Systems, Inc" },

32898 { 0xE8655F, "Dell Inc." },

32899 { 0xE865D4, "Tenda Technology Co.,Ltd.Dongguan branch" },

32900 { 0xE866C4, "Diamanti" },

32901 { 0xE86819, "HUAWEI TECHNOLOGIES CO.,LTD" },

32902 { 0xE868E7, "Espressif Inc." },

32903 { 0xE86A64, "LCFC(HeFei) Electronics Technology co., ltd" },

32904 { 0xE86BEA, "Espressif Inc." },

32905 { 0xE86CC7, "IEEE Registration Authority" },

32906 { 0xE86CDA, "Supercomputers and Neurocomputers Research Center" },

32907 { 0xE86D52, "ARRIS Group, Inc." },

32908 { 0xE86D54, "Digit Mobile Inc" },

32909 { 0xE86D65, "AUDIO MOBIL Elektronik GmbH" },

32910 { 0xE86D6E, "voestalpine Signaling UK Ltd." },

32911 { 0xE86DCB, "Samsung Electronics Co.,Ltd" },

32912 { 0xE86DE9, "HUAWEI TECHNOLOGIES CO.,LTD" },

32913 { 0xE86E3A, "Sony Interactive Entertainment Inc." },

32914 { 0xE86E44, "zte corporation" },

32915 { 0xE86F38, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

32916 { 0xE86FF2, "Actiontec Electronics, Inc" },

32917 { 0xE87072, "Hangzhou BroadLink Technology Co.,Ltd" },

32918 { 0xE8718D, "Elsys Equipamentos Eletronicos Ltda" },

32919 { 0xE874C7, "Sentinhealth" },

32920 { 0xE874E6, "ADB Broadband Italia" },

32921 { 0xE8757F, "FIRS Technologies(Shenzhen) Co., Ltd" },

32922 { 0xE87640, "SKY UK LIMITED" },

32923 { 0xE87829, "IEEE Registration Authority" },

32924 { 0xE87865, "Apple, Inc." },

32925 { 0xE878A1, "BEOVIEW INTERCOM DOO" },

32926 { 0xE878EE, "New H3C Technologies Co., Ltd" },

32927 { 0xE87AF3, "S5 Tech S.r.l." },

32928 { 0xE87F6B, "Samsung Electronics Co.,Ltd" },

32929 { 0xE87F95, "Apple, Inc." },

32930 { 0xE8802E, "Apple, Inc." },

32931 { 0xE88088, "LCFC(HeFei) Electronics Technology co., ltd" },

32932 { 0xE880D8, "GNTEK Electronics Co.,Ltd." },

32933 { 0xE88152, "Apple, Inc." },

32934 { 0xE88175, "zte corporation" },

32935 { 0xE881AB, "Beijing Sankuai Online Technology Co.,Ltd" },

32936 { 0xE8825B, "ARRIS Group, Inc." },

32937 { 0xE884A5, "Intel Corporate" },

32938 { 0xE884C6, "HUAWEI TECHNOLOGIES CO.,LTD" },

32939 { 0xE8854B, "Apple, Inc." },

32940 { 0xE886CF, "Nokia" },

32941 { 0xE887A3, "Loxley Public Company Limited" },

32942 { 0xE88843, "Xiaomi Communications Co Ltd" },

32943 { 0xE8886C, "Shenzhen SC Technologies Co.,LTD" },

32944 { 0xE8892C, "ARRIS Group, Inc." },

32945 { 0xE88D28, "Apple, Inc." },

32946 { 0xE88DA6, "Quectel Wireless Solutions Co.,Ltd." },

32947 { 0xE88DF5, "ZNYX Networks, Inc." },

32948 { 0xE88E60, "NSD Corporation" },

32949 { 0xE88F6F, "TCT mobile ltd" },

32950 { 0xE88FC4, "MOBIWIRE MOBILES(NINGBO) CO.,LTD" },

32951 { 0xE8910F, "Fiberhome Telecommunication Technologies Co.,LTD" },

32952 { 0xE89120, "Motorola Mobility LLC, a Lenovo Company" },

32953 { 0xE89218, "Arcontia International AB" },

32954 { 0xE892A4, "LG Electronics (Mobile Communications)" },

32955 { 0xE89309, "Samsung Electronics Co.,Ltd" },

32956 { 0xE89363, "Nokia" },

32957 { 0xE893F3, "Graphiant Inc" },

32958 { 0xE8944C, "Cogent Healthcare Systems Ltd" },

32959 { 0xE894F6, "TP-LINK TECHNOLOGIES CO.,LTD." },

32960 { 0xE89526, "Luxshare Precision Industry CO., LTD." },

32961 { 0xE89606, "testo Instruments (Shenzhen) Co., Ltd." },

32962 { 0xE8979A, "Quectel Wireless Solutions Co.,Ltd." },

32963 { 0xE897B8, "Chiun Mai Communication System, Inc" },

32964 { 0xE89847, "Xiaomi Communications Co Ltd" },

32965 { 0xE8986D, "Palo Alto Networks" },

32966 { 0xE898C2, "ZETLAB Company" },

32967 { 0xE8995A, "PiiGAB, Processinformation i Goteborg AB" },

32968 { 0xE899C4, "HTC Corporation" },

32969 { 0xE89A8F, "Quanta Computer Inc." },

32970 { 0xE89AFF, "Fujian LANDI Commercial Equipment Co.,Ltd" },

32971 { 0xE89C25, "ASUSTek COMPUTER INC." },

32972 { 0xE89D87, "Toshiba" },

32973 { 0xE89E0C, "MAX8USA DISTRIBUTORS INC." },

32974 { 0xE89E13, "CRESYN" },

32975 { 0xE89EB4, "Hon Hai Precision Ind. Co.,Ltd." },

32976 { 0xE89F39, "Nokia" },

32977 { 0xE89F6D, "Espressif Inc." },

32978 { 0xE89F80, "Belkin International Inc." },

32979 { 0xE89FEC, "CHENGDU KT ELECTRONIC HI-TECH CO.,LTD" },

32980 { 0xE8A0CD, "Nintendo Co.,Ltd" },

32981 { 0xE8A0ED, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

32982 { 0xE8A1F8, "zte corporation" },

32983 { 0xE8A245, "Juniper Networks" },

32984 { 0xE8A34E, "HUAWEI TECHNOLOGIES CO.,LTD" },

32985 { 0xE8A364, "Signal Path International / Peachtree Audio" },

32986 { 0xE8A4C1, "Deep Sea Electronics Ltd" },

32987 { 0xE8A660, "HUAWEI TECHNOLOGIES CO.,LTD" },

32988 { 0xE8A6CA, "Huawei Device Co., Ltd." },

32989 { 0xE8A72F, "Microsoft Corporation" },

32990 { 0xE8A730, "Apple, Inc." },

32991 { 0xE8A788, "XIAMEN LEELEN TECHNOLOGY CO., LTD" },

32992 { 0xE8A7F2, "sTraffic" },

32993 { 0xE8AACB, "Samsung Electronics Co.,Ltd" },

32994 { 0xE8ABF3, "HUAWEI TECHNOLOGIES CO.,LTD" },

32995 { 0xE8ABFA, "Shenzhen Reecam Tech.Ltd." },

32996 { 0xE8AC23, "HUAWEI TECHNOLOGIES CO.,LTD" },

32997 { 0xE8ACAD, "zte corporation" },

32998 { 0xE8ADA6, "Sagemcom Broadband SAS" },

32999 { 0xE8AEC5, "Arista Networks" },

33000 { 0xE8B0C5, "Intel Corporate" },

33001 { 0xE8B1FC, "Intel Corporate" },

33002 { 0xE8B265, "Dell Inc." },

33003 { 0xE8B2AC, "Apple, Inc." },

33004 { 0xE8B2FE, "HUMAX Co., Ltd." },

33005 { 0xE8B3EF, "Fiberhome Telecommunication Technologies Co.,LTD" },

33006 { 0xE8B470, "IEEE Registration Authority" },

33007 { 0xE8B4AE, "Shenzhen C&D Electronics Co.,Ltd" },

33008 { 0xE8B4C8, "Samsung Electronics Co.,Ltd" },

33009 { 0xE8B541, "zte corporation" },

33010 { 0xE8B5D0, "Dell Inc." },

33011 { 0xE8B6C2, "Juniper Networks" },

33012 { 0xE8B722, "GreenTrol Automation" },

33013 { 0xE8B748, "Cisco Systems, Inc" },

33014 { 0xE8BA70, "Cisco Systems, Inc" },

33015 { 0xE8BAE2, "Xplora Technologies AS" },

33016 { 0xE8BB3D, "Sino Prime-Tech Limited" },

33017 { 0xE8BBA8, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

33018 { 0xE8BDD1, "HUAWEI TECHNOLOGIES CO.,LTD" },

33019 { 0xE8BE81, "Sagemcom Broadband SAS" },

33020 { 0xE8BFDB, "Inodesign Group" },

33021 { 0xE8C1B8, "Nanjing Bangzhong Electronic Commerce Limited" },

33022 { 0xE8C1D7, "Philips" },

33023 { 0xE8C1E8, "Shenzhen Xiao Bi En Culture Education Technology Co.,Ltd." },

33024 { 0xE8C229, "H-Displays (MSC) Bhd" },

33025 { 0xE8C2DD, "Infinix mobility limited" },

33026 { 0xE8C320, "Austco Marketing & Service (USA) ltd." },

33027 { 0xE8C417, "Fiberhome Telecommunication Technologies Co.,LTD" },

33028 { 0xE8C57A, "Ufispace Co., LTD." },

33029 { 0xE8C74F, "Liteon Technology Corporation" },

33030 { 0xE8C7CF, "Wistron Neweb Corporation" },

33031 { 0xE8C829, "Intel Corporate" },

33032 { 0xE8CAC8, "Hui Zhou Gaoshengda Technology Co.,LTD" },

33033 { 0xE8CBA1, "Nokia Corporation" },

33034 { 0xE8CBED, "Chipsea Technologies(Shenzhen) Corp." },

33035 { 0xE8CBF5, "Laird Connectivity" },

33036 { 0xE8CC18, "D-Link International" },

33037 { 0xE8CC32, "Micronet LTD" },

33038 { 0xE8CC8C, "Chengdu Jiarui Hualian Communication Technology Co" },

33039 { 0xE8CD2D, "HUAWEI TECHNOLOGIES CO.,LTD" },

33040 { 0xE8CE06, "SkyHawke Technologies, LLC." },

33041 { 0xE8D03C, "Shenzhen Jingxun Software Telecommunication Technology Co.,Ltd" },

33042 { 0xE8D099, "Fiberhome Telecommunication Technologies Co.,LTD" },

33043 { 0xE8D0B9, "Taicang T&W Electronics" },

33044 { 0xE8D0FA, "MKS Instruments Deutschland GmbH" },

33045 { 0xE8D0FC, "Liteon Technology Corporation" },

33046 { 0xE8D11B, "ASKEY COMPUTER CORP" },

33047 { 0xE8D2FF, "Sagemcom Broadband SAS" },

33048 { 0xE8D322, "Cisco Systems, Inc" },

33049 { 0xE8D3EB, "eero inc." },

33050 { 0xE8D483, "ULTIMATE Europe Transportation Equipment GmbH" },

33051 { 0xE8D4E0, "Beijing BenyWave Technology Co., Ltd." },

33052 { 0xE8D52B, "Google, Inc." },

33053 { 0xE8D765, "HUAWEI TECHNOLOGIES CO.,LTD" },

33054 { 0xE8D775, "HUAWEI TECHNOLOGIES CO.,LTD" },

33055 { 0xE8D819, "AzureWave Technology Inc." },

33056 { 0xE8D87E, "Amazon Technologies Inc." },

33057 { 0xE8D8D1, "HP Inc." },

33058 { 0xE8DA00, "Kivo Technology, Inc." },

33059 { 0xE8DA20, "Nintendo Co.,Ltd" },

33060 { 0xE8DA3E, "Huawei Device Co., Ltd." },

33061 { 0xE8DA96, "Zhuhai Tianrui Electrical Power Tech. Co., Ltd." },

33062 { 0xE8DAAA, "VideoHome Technology Corp." },

33063 { 0xE8DB84, "Espressif Inc." },

33064 { 0xE8DC6C, "Cisco Systems, Inc" },

33065 { 0xE8DE00, "ChongQing GuanFang Technology Co.,LTD" },

33066 { 0xE8DE27, "TP-LINK TECHNOLOGIES CO.,LTD." },

33067 { 0xE8DE8E, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

33068 { 0xE8DED6, "Intrising Networks, Inc." },

33069 { 0xE8DEFB, "MESOTIC SAS" },

33070 { 0xE8DF70, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

33071 { 0xE8DFF2, "PRF Co., Ltd." },

33072 { 0xE8E07E, "Silicon Laboratories" },

33073 { 0xE8E08F, "GRAVOTECH MARKING SAS" },

33074 { 0xE8E0B7, "Toshiba" },

33075 { 0xE8E1E1, "Gemtek Technology Co., Ltd." },

33076 { 0xE8E1E2, "Energotest" },

33077 { 0xE8E5D6, "Samsung Electronics Co.,Ltd" },

33078 { 0xE8E732, "Alcatel-Lucent Enterprise" },

33079 { 0xE8E770, "Warp9 Tech Design, Inc." },

33080 { 0xE8E776, "Shenzhen Kootion Technology Co., Ltd" },

33081 { 0xE8E875, "iS5 Communications Inc." },

33082 { 0xE8E8B7, "Murata Manufacturing Co., Ltd." },

33083 { 0xE8E98E, "SOLAR controls s.r.o." },

33084 { 0xE8EA4D, "HUAWEI TECHNOLOGIES CO.,LTD" },

33085 { 0xE8EA6A, "StarTech.com" },

33086 { 0xE8EADA, "Denkovi Assembly Electronics LTD" },

33087 { 0xE8EB11, "Texas Instruments" },

33088 { 0xE8EB1B, "Microchip Technology Inc." },

33089 { 0xE8EB34, "Cisco Systems, Inc" },

33090 { 0xE8EBD3, "Mellanox Technologies, Inc." },

33091 { 0xE8EBDD, "Guangzhou Qingying Acoustics Technology Co., Ltd" },

33092 { 0xE8ECA3, "Dongguan Liesheng Electronic Co.Ltd" },

33093 { 0xE8ED05, "ARRIS Group, Inc." },

33094 { 0xE8EDD6, "Fortinet, Inc." },

33095 { 0xE8EDF3, "Cisco Systems, Inc" },

33096 { 0xE8EECC, "Fantasia Trading LLC" },

33097 { 0xE8EF05, "MIND TECH INTERNATIONAL LIMITED" },

33098 { 0xE8EF22, "Siemens Numerical Control Ltd., Nanjing" },

33099 { 0xE8EF89, "OPMEX Tech." },

33100 { 0xE8F085, "HUAWEI TECHNOLOGIES CO.,LTD" },

33101 { 0xE8F1B0, "Sagemcom Broadband SAS" },

33102 { 0xE8F226, "MILLSON CUSTOM SOLUTIONS INC." },

33103 { 0xE8F2E2, "LG Innotek" },

33104 { 0xE8F2E3, "Starcor Beijing Co.,Limited" },

33105 { 0xE8F375, "Nokia" },

33106 { 0xE8F408, "Intel Corporate" },

33107 { 0xE8F654, "HUAWEI TECHNOLOGIES CO.,LTD" },

33108 { 0xE8F724, "Hewlett Packard Enterprise" },

33109 { 0xE8F72F, "HUAWEI TECHNOLOGIES CO.,LTD" },

33110 { 0xE8F791, "Xiaomi Communications Co Ltd" },

33111 { 0xE8F8D0, "Nokia Shanghai Bell Co., Ltd." },

33112 { 0xE8F928, "RFTECH SRL" },

33113 { 0xE8F9D4, "HUAWEI TECHNOLOGIES CO.,LTD" },

33114 { 0xE8FA23, "Huawei Device Co., Ltd." },

33115 { 0xE8FAF7, "Guangdong Uniteddata Holding Group Co., Ltd." },

33116 { 0xE8FB1C, "AzureWave Technology Inc." },

33117 { 0xE8FBE9, "Apple, Inc." },

33118 { 0xE8FC60, "ELCOM Innovations Private Limited" },

33119 { 0xE8FCAF, "NETGEAR" },

33120 { 0xE8FD35, "Huawei Device Co., Ltd." },

33121 { 0xE8FD72, "SHANGHAI LINGUO TECHNOLOGY CO., LTD." },

33122 { 0xE8FD90, "Turbostor" },

33123 { 0xE8FDE8, "CeLa Link Corporation" },

33124 { 0xE8FDF8, "Shanghai High-Flying Electronics Technology Co., Ltd" },

33125 { 0xE8FF1E, "IEEE Registration Authority" },

33126 { 0xE8FF98, "Huawei Device Co., Ltd." },

33127 { 0xEC0133, "TRINUS SYSTEMS INC." },

33128 { 0xEC01D5, "Cisco Systems, Inc" },

33129 { 0xEC01E2, "FOXCONN INTERCONNECT TECHNOLOGY" },

33130 { 0xEC01EE, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

33131 { 0xEC0273, "Aruba, a Hewlett Packard Enterprise Company" },

33132 { 0xEC0441, "ShenZhen TIGO Semiconductor Co., Ltd." },

33133 { 0xEC0482, "STL Systems AG" },

33134 { 0xEC086B, "TP-LINK TECHNOLOGIES CO.,LTD." },

33135 { 0xEC08E5, "Motorola Mobility LLC, a Lenovo Company" },

33136 { 0xEC0BAE, "Hangzhou BroadLink Technology Co.,Ltd" },

33137 { 0xEC0C96, "Nokia" },

33138 { 0xEC0D51, "Apple, Inc." },

33139 { 0xEC0D9A, "Mellanox Technologies, Inc." },

33140 { 0xEC0DE4, "Amazon Technologies Inc." },

33141 { 0xEC0EC4, "Hon Hai Precision Ind. Co.,Ltd." },

33142 { 0xEC0ED6, "ITECH INSTRUMENTS SAS" },

33143 { 0xEC107B, "Samsung Electronics Co.,Ltd" },

33144 { 0xEC1120, "FloDesign Wind Turbine Corporation" },

33145 { 0xEC1127, "Texas Instruments" },

33146 { 0xEC13B2, "Netonix" },

33147 { 0xEC13DB, "Juniper Networks" },

33148 { 0xEC14F6, "BioControl AS" },

33149 { 0xEC153D, "Beijing Yaxunhongda Technology Co., Ltd." },

33150 { 0xEC172F, "TP-LINK TECHNOLOGIES CO.,LTD." },

33151 { 0xEC1766, "Research Centre Module" },

33152 { 0xEC192E, "Cisco Systems, Inc" },

33153 { 0xEC1A02, "HUAWEI TECHNOLOGIES CO.,LTD" },

33154 { 0xEC1A59, "Belkin International Inc." },

33155 { 0xEC1BBD, "Silicon Laboratories" },

33156 { 0xEC1C5D, "Siemens AG" },

33157 { 0xEC1D7F, "zte corporation" },

33158 { 0xEC1D8B, "Cisco Systems, Inc" },

33159 { 0xEC1D9E, "Quectel Wireless Solutions Co.,Ltd." },

33160 { 0xEC1F72, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

33161 { 0xEC2125, "Toshiba Corp." },

33162 { 0xEC2150, "vivo Mobile Communication Co., Ltd." },

33163 { 0xEC219F, "VidaBox LLC" },

33164 { 0xEC21E5, "Toshiba" },

33165 { 0xEC2257, "JiangSu NanJing University Electronic Information Technology Co.,Ltd" },

33166 { 0xEC2280, "D-Link International" },

33167 { 0xEC233D, "HUAWEI TECHNOLOGIES CO.,LTD" },

33168 { 0xEC2368, "IntelliVoice Co.,Ltd." },

33169 { 0xEC237B, "zte corporation" },

33170 { 0xEC24B8, "Texas Instruments" },

33171 { 0xEC2651, "Apple, Inc." },

33172 { 0xEC26CA, "TP-LINK TECHNOLOGIES CO.,LTD." },

33173 { 0xEC26FB, "TECC CO.,LTD." },

33174 { 0xEC28D3, "Apple, Inc." },

33175 { 0xEC2A72, "Dell Inc." },

33176 { 0xEC2AF0, "Ypsomed AG" },

33177 { 0xEC2BEB, "Amazon Technologies Inc." },

33178 { 0xEC2C11, "CWD INNOVATION LIMITED" },

33179 { 0xEC2C49, "NakaoLab, The University of Tokyo" },

33180 { 0xEC2C73, "Apple, Inc." },

33181 { 0xEC2CE2, "Apple, Inc." },

33182 { 0xEC2E4E, "HITACHI-LG DATA STORAGE INC" },

33183 { 0xEC2E98, "AzureWave Technology Inc." },

33184 { 0xEC3091, "Cisco Systems, Inc" },

33185 { 0xEC30B3, "Xiaomi Communications Co Ltd" },

33186 { 0xEC314A, "Chengdu Quanjing Intelligent Technology Co.,Ltd" },

33187 { 0xEC316D, "Hansgrohe" },

33188 { 0xEC354D, "Wingtech Mobile Communications Co.,Ltd" },

33189 { 0xEC3586, "Apple, Inc." },

33190 { 0xEC363F, "Markov Corporation" },

33191 { 0xEC3873, "Juniper Networks" },

33192 { 0xEC388F, "HUAWEI TECHNOLOGIES CO.,LTD" },

33193 { 0xEC3A52, "Huawei Device Co., Ltd." },

33194 { 0xEC3BF0, "NovelSat" },

33195 { 0xEC3C5A, "SHEN ZHEN HENG SHENG HUI DIGITAL TECHNOLOGY CO.,LTD" },

33196 { 0xEC3C88, "MCNEX Co.,Ltd." },

33197 { 0xEC3CBB, "Huawei Device Co., Ltd." },

33198 { 0xEC3DFD, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

33199 { 0xEC3E09, "PERFORMANCE DESIGNED PRODUCTS, LLC" },

33200 { 0xEC3EB3, "Zyxel Communications Corporation" },

33201 { 0xEC3EF7, "Juniper Networks" },

33202 { 0xEC3F05, "Institute 706, The Second Academy China Aerospace Science & Industry Corp" },

33203 { 0xEC4118, "XIAOMI Electronics,CO.,LTD" },

33204 { 0xEC41CA, "Shenzhen TecAnswer Technology co.,ltd" },

33205 { 0xEC41F9, "Shenzhen iComm Semiconductor CO.,LTD" },

33206 { 0xEC4269, "HMD Global Oy" },

33207 { 0xEC42B4, "ADC Corporation" },

33208 { 0xEC42CC, "Apple, Inc." },

33209 { 0xEC42F0, "ADL Embedded Solutions, Inc." },

33210 { 0xEC438B, "YAPTV" },

33211 { 0xEC43E6, "AWCER Ltd." },

33212 { 0xEC43F6, "Zyxel Communications Corporation" },

33213 { 0xEC4476, "Cisco Systems, Inc" },

33214 { 0xEC462C, "Infinix mobility limited" },

33215 { 0xEC4644, "TTK SAS" },

33216 { 0xEC4670, "Meinberg Funkuhren GmbH & Co. KG" },

33217 { 0xEC473C, "Redwire, LLC" },

33218 { 0xEC4993, "Qihan Technology Co., Ltd" },

33219 { 0xEC4C4D, "ZAO NPK RoTeK" },

33220 { 0xEC4D3E, "Beijing Xiaomi Mobile Software Co., Ltd" },

33221 { 0xEC4D47, "HUAWEI TECHNOLOGIES CO.,LTD" },

33222 { 0xEC4F82, "Calix Inc." },

33223 { 0xEC50AA, "Aruba, a Hewlett Packard Enterprise Company" },

33224 { 0xEC51BC, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

33225 { 0xEC52DC, "WORLD MEDIA AND TECHNOLOGY Corp." },

33226 { 0xEC5382, "Honor Device Co., Ltd." },

33227 { 0xEC542E, "Shanghai XiMei Electronic Technology Co. Ltd" },

33228 { 0xEC551C, "HUAWEI TECHNOLOGIES CO.,LTD" },

33229 { 0xEC55F9, "Hon Hai Precision Ind. Co.,Ltd." },

33230 { 0xEC5623, "HUAWEI TECHNOLOGIES CO.,LTD" },

33231 { 0xEC570D, "AFE Inc." },

33232 { 0xEC58EA, "Ruckus Wireless" },

33233 { 0xEC59E7, "Microsoft Corporation" },

33234 { 0xEC5A86, "Yulong Computer Telecommunication Scientific (Shenzhen) Co.,Ltd" },

33235 { 0xEC5AA3, "Huawei Device Co., Ltd." },

33236 { 0xEC5B73, "Advanced & Wise Technology Corp." },

33237 { 0xEC5C68, "CHONGQING FUGUI ELECTRONICS CO.,LTD." },

33238 { 0xEC5C69, "MITSUBISHI HEAVY INDUSTRIES MECHATRONICS SYSTEMS,LTD." },

33239 { 0xEC5C84, "Murata Manufacturing Co., Ltd." },

33240 { 0xEC5F23, "Qinghai Kimascend Electronics Technology Co. Ltd." },

33241 { 0xEC6073, "TP-LINK TECHNOLOGIES CO.,LTD." },

33242 { 0xEC60E0, "AVI-ON LABS" },

33243 { 0xEC6260, "Espressif Inc." },

33244 { 0xEC6264, "Global411 Internet Services, LLC" },

33245 { 0xEC63D7, "Intel Corporate" },

33246 { 0xEC63E5, "ePBoard Design LLC" },

33247 { 0xEC63ED, "Hyundai Autoever Corp." },

33248 { 0xEC6488, "Honor Device Co., Ltd." },

33249 { 0xEC64C9, "Espressif Inc." },

33250 { 0xEC64E7, "MOCACARE Corporation" },

33251 { 0xEC656E, "The Things Industries B.V." },

33252 { 0xEC65CC, "Panasonic Automotive Systems Company of America" },

33253 { 0xEC66D1, "B&W Group LTD" },

33254 { 0xEC6794, "Aruba, a Hewlett Packard Enterprise Company" },

33255 { 0xEC6881, "Palo Alto Networks" },

33256 { 0xEC6C9A, "Arcadyan Corporation" },

33257 { 0xEC6C9F, "Chengdu Volans Technology CO.,LTD" },

33258 { 0xEC6CB5, "zte corporation" },

33259 { 0xEC6E79, "InHand Networks, INC." },

33260 { 0xEC6F0B, "FADU, Inc." },

33261 { 0xEC7097, "ARRIS Group, Inc." },

33262 { 0xEC71DB, "Reolink Innovation Limited" },

33263 { 0xEC7379, "Apple, Inc." },

33264 { 0xEC7427, "eero inc." },

33265 { 0xEC748C, "Sony Interactive Entertainment Inc." },

33266 { 0xEC74BA, "Hirschmann Automation and Control GmbH" },

33267 { 0xEC74D7, "Grandstream Networks Inc" },

33268 { 0xEC753E, "HUAWEI TECHNOLOGIES CO.,LTD" },

33269 { 0xEC75ED, "Citrix Systems, Inc." },

33270 { 0xEC7949, "FUJITSU LIMITED" },

33271 { 0xEC79F2, "Startel" },

33272 { 0xEC7C2C, "HUAWEI TECHNOLOGIES CO.,LTD" },

33273 { 0xEC7C5C, "Juniper Networks" },

33274 { 0xEC7C74, "Justone Technologies Co., Ltd." },

33275 { 0xEC7CB6, "Samsung Electronics Co.,Ltd" },

33276 { 0xEC7D11, "vivo Mobile Communication Co., Ltd." },

33277 { 0xEC7D9D, "CPI" },

33278 { 0xEC7E91, "ITEL MOBILE LIMITED" },

33279 { 0xEC7FC6, "ECCEL CORPORATION SAS" },

33280 { 0xEC8009, "NovaSparks" },

33281 { 0xEC8150, "Apple, Inc." },

33282 { 0xEC8193, "Logitech, Inc" },

33283 { 0xEC819C, "HUAWEI TECHNOLOGIES CO.,LTD" },

33284 { 0xEC8263, "zte corporation" },

33285 { 0xEC8350, "Microsoft Corporation" },

33286 { 0xEC836C, "RM Tech Co., Ltd." },

33287 { 0xEC83B7, "PUWELL CLOUD TECH LIMITED" },

33288 { 0xEC83D5, "GIRD Systems Inc" },

33289 { 0xEC84B4, "CIG SHANGHAI CO LTD" },

33290 { 0xEC852F, "Apple, Inc." },

33291 { 0xEC888F, "TP-LINK TECHNOLOGIES CO.,LTD." },

33292 { 0xEC8892, "Motorola Mobility LLC, a Lenovo Company" },

33293 { 0xEC8914, "HUAWEI TECHNOLOGIES CO.,LTD" },

33294 { 0xEC89F5, "Lenovo Mobile Communication Technology Ltd." },

33295 { 0xEC8A48, "Arista Networks" },

33296 { 0xEC8A4C, "zte corporation" },

33297 { 0xEC8AC4, "Amazon Technologies Inc." },

33298 { 0xEC8AC7, "Fiberhome Telecommunication Technologies Co.,LTD" },

33299 { 0xEC8C9A, "HUAWEI TECHNOLOGIES CO.,LTD" },

33300 { 0xEC8CA2, "Ruckus Wireless" },

33301 { 0xEC8EAD, "DLX" },

33302 { 0xEC8EAE, "Nagravision SA" },

33303 { 0xEC8EB5, "Hewlett Packard" },

33304 { 0xEC90C1, "Samsung Electronics Co.,Ltd" },

33305 { 0xEC9161, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

33306 { 0xEC9233, "Eddyfi NDT Inc" },

33307 { 0xEC9327, "MEMMERT GmbH + Co. KG" },

33308 { 0xEC9365, "Mapper.ai, Inc." },

33309 { 0xEC937D, "Vantiva USA LLC" },

33310 { 0xEC93ED, "DDoS-Guard LTD" },

33311 { 0xEC9468, "META SYSTEM SPA" },

33312 { 0xEC94CB, "Espressif Inc." },

33313 { 0xEC94D5, "Juniper Networks" },

33314 { 0xEC9681, "2276427 Ontario Inc" },

33315 { 0xEC96BF, "eSystems MTG GmbH" },

33316 { 0xEC97B2, "SUMEC Machinery & Electric Co.,Ltd." },

33317 { 0xEC97E0, "Hangzhou Ezviz Software Co.,Ltd." },

33318 { 0xEC986C, "Lufft Mess- und Regeltechnik GmbH" },

33319 { 0xEC98C1, "Beijing Risbo Network Technology Co.,Ltd" },

33320 { 0xEC9A0C, "IEEE Registration Authority" },

33321 { 0xEC9A34, "Texas Instruments" },

33322 { 0xEC9A74, "Hewlett Packard" },

33323 { 0xEC9B2D, "China Mobile Group Device Co.,Ltd." },

33324 { 0xEC9B5B, "Nokia Corporation" },

33325 { 0xEC9B8B, "Hewlett Packard Enterprise" },

33326 { 0xEC9BF3, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

33327 { 0xEC9C32, "Sichuan AI-Link Technology Co., Ltd." },

33328 { 0xEC9ECD, "Artesyn Embedded Technologies" },

33329 { 0xEC9F0D, "IEEE Registration Authority" },

33330 { 0xECA138, "Amazon Technologies Inc." },

33331 { 0xECA1D1, "HUAWEI TECHNOLOGIES CO.,LTD" },

33332 { 0xECA29B, "Kemppi Oy" },

33333 { 0xECA2A0, "Taicang T&W Electronics" },

33334 { 0xECA5DE, "ONYX WIFI Inc" },

33335 { 0xECA62F, "HUAWEI TECHNOLOGIES CO.,LTD" },

33336 { 0xECA7AD, "Barrot Technology Co.,Ltd." },

33337 { 0xECA81F, "Vantiva USA LLC" },

33338 { 0xECA86B, "Elitegroup Computer Systems Co.,Ltd." },

33339 { 0xECA907, "Apple, Inc." },

33340 { 0xECA940, "ARRIS Group, Inc." },

33341 { 0xECA9FA, "GUANGDONG GENIUS TECHNOLOGY CO., LTD." },

33342 { 0xECAA25, "Samsung Electronics Co.,Ltd" },

33343 { 0xECAA8F, "HUAWEI TECHNOLOGIES CO.,LTD" },

33344 { 0xECAAA0, "PEGATRON CORPORATION" },

33345 { 0xECAB3E, "ESSYS" },

33346 { 0xECADB8, "Apple, Inc." },

33347 { 0xECADE0, "D-Link International" },

33348 { 0xECAF97, "GIT" },

33349 { 0xECAFF9, "Hailo Technologies Ltd." },

33350 { 0xECB0D2, "EM Microelectronic" },

33351 { 0xECB0E1, "Ciena Corporation" },

33352 { 0xECB106, "Acuro Networks, Inc" },

33353 { 0xECB1D7, "Hewlett Packard" },

33354 { 0xECB1E0, "Eltex Enterprise LTD" },

33355 { 0xECB313, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

33356 { 0xECB4E8, "Wistron Mexico SA de CV" },

33357 { 0xECB541, "SHINANO E and E Co.Ltd." },

33358 { 0xECB5FA, "Philips Lighting BV" },

33359 { 0xECB870, "Beijing Heweinet Technology Co.,Ltd." },

33360 { 0xECB878, "Huawei Device Co., Ltd." },

33361 { 0xECB907, "CloudGenix Inc" },

33362 { 0xECB970, "Ruijie Networks Co.,LTD" },

33363 { 0xECBAFE, "GIROPTIC" },

33364 { 0xECBBAE, "Digivoice Tecnologia em Eletronica Ltda" },

33365 { 0xECBD09, "FUSION Electronics Ltd" },

33366 { 0xECBD1D, "Cisco Systems, Inc" },

33367 { 0xECBE5F, "Vestel Elektronik San ve Tic. A.S." },

33368 { 0xECBEDD, "Sagemcom Broadband SAS" },

33369 { 0xECBFD0, "Texas Instruments" },

33370 { 0xECC018, "Cisco Systems, Inc" },

33371 { 0xECC01B, "HUAWEI TECHNOLOGIES CO.,LTD" },

33372 { 0xECC06A, "PowerChord Group Limited" },

33373 { 0xECC07A, "Laird Connectivity" },

33374 { 0xECC1AB, "Guangzhou Shiyuan Electronic Technology Company Limited" },

33375 { 0xECC302, "HUMAX Co., Ltd." },

33376 { 0xECC38A, "Accuenergy (CANADA) Inc" },

33377 { 0xECC3B0, "zte corporation" },

33378 { 0xECC40D, "Nintendo Co.,Ltd" },

33379 { 0xECC57F, "Suzhou Pairlink Network Technology" },

33380 { 0xECC5D2, "Huawei Device Co., Ltd." },

33381 { 0xECC882, "Cisco Systems, Inc" },

33382 { 0xECC89C, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

33383 { 0xECCB30, "HUAWEI TECHNOLOGIES CO.,LTD" },

33384 { 0xECCD6D, "Allied Telesis, Inc." },

33385 { 0xECCE13, "Cisco Systems, Inc" },

33386 { 0xECCED7, "Apple, Inc." },

33387 { 0xECCF70, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

33388 { 0xECD00E, "MiraeRecognition Co., Ltd." },

33389 { 0xECD040, "GEA Farm Technologies GmbH" },

33390 { 0xECD09F, "Xiaomi Communications Co Ltd" },

33391 { 0xECD19A, "Zhuhai Liming Industries Co., Ltd" },

33392 { 0xECD68A, "Shenzhen JMicron Intelligent Technology Developmen" },

33393 { 0xECD925, "RAMI" },

33394 { 0xECD950, "IRT SA" },

33395 { 0xECD9D1, "Shenzhen TG-NET Botone Technology Co.,Ltd." },

33396 { 0xECDA3B, "Espressif Inc." },

33397 { 0xECDA59, "New H3C Technologies Co., Ltd" },

33398 { 0xECDB86, "API-K" },

33399 { 0xECDE3D, "Lamprey Networks, Inc." },

33400 { 0xECDF3A, "vivo Mobile Communication Co., Ltd." },

33401 { 0xECDFC9, "Hangzhou Microimage Software Co., Ltd" },

33402 { 0xECE09B, "Samsung Electronics Co.,Ltd" },

33403 { 0xECE154, "Beijing Unisound Information Technology Co.,Ltd." },

33404 { 0xECE1A9, "Cisco Systems, Inc" },

33405 { 0xECE2FD, "SKG Electric Group(Thailand) Co., Ltd." },

33406 { 0xECE512, "tado GmbH" },

33407 { 0xECE555, "Hirschmann Automation" },

33408 { 0xECE61D, "Huawei Device Co., Ltd." },

33409 { 0xECE660, "Qingdao Hisense Communications Co.,Ltd." },

33410 { 0xECE6A2, "Fiberhome Telecommunication Technologies Co.,LTD" },

33411 { 0xECE744, "Omntec mfg. inc" },

33412 { 0xECE7A7, "Intel Corporate" },

33413 { 0xECE7C2, "China Mobile Group Device Co.,Ltd." },

33414 { 0xECE90B, "SISTEMA SOLUCOES ELETRONICAS LTDA - EASYTECH" },

33415 { 0xECE915, "STI Ltd" },

33416 { 0xECE9F8, "Guang Zhou TRI-SUN Electronics Technology Co., Ltd" },

33417 { 0xECEA03, "DARFON LIGHTING CORP" },

33418 { 0xECEBB8, "Hewlett Packard Enterprise" },

33419 { 0xECED73, "Motorola Mobility LLC, a Lenovo Company" },

33420 { 0xECEED8, "ZTLX Network Technology Co.,Ltd" },

33421 { 0xECEF17, "Sunplus Technology Co., Ltd." },

33422 { 0xECF00E, "AboCom" },

33423 { 0xECF0FE, "zte corporation" },

33424 { 0xECF22B, "TECNO MOBILE LIMITED" },

33425 { 0xECF236, "NEOMONTANA ELECTRONICS" },

33426 { 0xECF342, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

33427 { 0xECF35B, "Nokia Corporation" },

33428 { 0xECF40C, "Cisco Systems, Inc" },

33429 { 0xECF451, "Arcadyan Corporation" },

33430 { 0xECF4BB, "Dell Inc." },

33431 { 0xECF64C, "Silicon Laboratories" },

33432 { 0xECF6BD, "SNCF MOBILITÉS" },

33433 { 0xECF72B, "HD DIGITAL TECH CO., LTD." },

33434 { 0xECF8D0, "HUAWEI TECHNOLOGIES CO.,LTD" },

33435 { 0xECF8EB, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

33436 { 0xECFA03, "FCA" },

33437 { 0xECFA5C, "Beijing Xiaomi Electronics Co., Ltd." },

33438 { 0xECFAAA, "The IMS Company" },

33439 { 0xECFABC, "Espressif Inc." },

33440 { 0xECFAF4, "SenRa Tech Pvt. Ltd" },

33441 { 0xECFC55, "A. Eberle GmbH & Co. KG" },

33442 { 0xECFE7E, "BlueRadios, Inc." },

33443 { 0xF0007F, "Janz - Contadores de Energia, SA" },

33444 { 0xF0016E, "Tianyi Telecom Terminals Company Limited" },

33445 { 0xF0022B, "Chrontel" },

33446 { 0xF00248, "SmarteBuilding" },

33447 { 0xF0038C, "AzureWave Technology Inc." },

33448 { 0xF00727, "INTEREL BUILDING AUTOMATION" },

33449 { 0xF00786, "Shandong Bittel Electronics Co., Ltd" },

33450 { 0xF008D1, "Espressif Inc." },

33451 { 0xF008F1, "Samsung Electronics Co.,Ltd" },

33452 { 0xF00D5C, "JinQianMao Technology Co.,Ltd." },

33453 { 0xF00DF5, "ACOMA Medical Industry Co,. Ltd." },

33454 { 0xF00E1D, "Megafone Limited" },

33455 { 0xF00EBF, "ZettaHash Inc." },

33456 { 0xF00FEC, "HUAWEI TECHNOLOGIES CO.,LTD" },

33457 { 0xF01090, "New H3C Technologies Co., Ltd" },

33458 { 0xF010A5, "Texas Instruments" },

33459 { 0xF010AB, "China Mobile (Hangzhou) Information Technology Co., Ltd." },

33460 { 0xF013C1, "Hannto Technology Co., Ltd" },

33461 { 0xF013C3, "SHENZHEN FENDA TECHNOLOGY CO., LTD" },

33462 { 0xF015A0, "KyungDong One Co., Ltd." },

33463 { 0xF015B9, "PlayFusion Limited" },

33464 { 0xF01628, "Technicolor (China) Technology Co., Ltd." },

33465 { 0xF0182B, "LG Chem" },

33466 { 0xF01898, "Apple, Inc." },

33467 { 0xF01AA0, "Aruba, a Hewlett Packard Enterprise Company" },

33468 { 0xF01B24, "zte corporation" },

33469 { 0xF01B6C, "vivo Mobile Communication Co., Ltd." },

33470 { 0xF01C13, "LG Electronics (Mobile Communications)" },

33471 { 0xF01C2D, "Juniper Networks" },

33472 { 0xF01D2D, "Cisco Systems, Inc" },

33473 { 0xF01DBC, "Microsoft Corporation" },

33474 { 0xF01E34, "ORICO Technologies Co., Ltd" },

33475 { 0xF01FAF, "Dell Inc." },

33476 { 0xF01FC7, "Apple, Inc." },

33477 { 0xF020FF, "Intel Corporate" },

33478 { 0xF02178, "UNIONMAN TECHNOLOGY CO.,LTD" },

33479 { 0xF0219D, "Cal-Comp Electronics & Communications Company Ltd." },

33480 { 0xF021E0, "eero inc." },

33481 { 0xF0221D, "IEEE Registration Authority" },

33482 { 0xF0224E, "Esan electronic co." },

33483 { 0xF02329, "SHOWA DENKI CO.,LTD." },

33484 { 0xF023AE, "AMPAK Technology,Inc." },

33485 { 0xF023B9, "IEEE Registration Authority" },

33486 { 0xF02405, "OPUS High Technology Corporation" },

33487 { 0xF02408, "Talaris (Sweden) AB" },

33488 { 0xF02475, "Apple, Inc." },

33489 { 0xF02572, "Cisco Systems, Inc" },

33490 { 0xF0258E, "HUAWEI TECHNOLOGIES CO.,LTD" },

33491 { 0xF025B7, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

33492 { 0xF02624, "WAFA TECHNOLOGIES CO., LTD." },

33493 { 0xF0264C, "Sigrist-Photometer AG" },

33494 { 0xF026F8, "Worldcns Co.,Ltd." },

33495 { 0xF0272D, "Amazon Technologies Inc." },

33496 { 0xF02745, "F-Secure Corporation" },

33497 { 0xF02765, "Murata Manufacturing Co., Ltd." },

33498 { 0xF02929, "Cisco Systems, Inc" },

33499 { 0xF02A23, "Creative Next Design" },

33500 { 0xF02A2B, "IEEE Registration Authority" },

33501 { 0xF02A61, "Waldo Networks, Inc." },

33502 { 0xF02B7C, "Extreme Networks Headquarters" },

33503 { 0xF02E51, "Casa Systems" },

33504 { 0xF02F4B, "Apple, Inc." },

33505 { 0xF02F74, "ASUSTek COMPUTER INC." },

33506 { 0xF02F9E, "Amazon Technologies Inc." },

33507 { 0xF02FA7, "HUAWEI TECHNOLOGIES CO.,LTD" },

33508 { 0xF02FD8, "Bi2-Vision" },

33509 { 0xF0321A, "Mita-Teknik A/S" },

33510 { 0xF033E5, "HUAWEI TECHNOLOGIES CO.,LTD" },

33511 { 0xF03404, "TCT mobile ltd" },

33512 { 0xF03575, "Hui Zhou Gaoshengda Technology Co.,LTD" },

33513 { 0xF037A1, "Huike Electronics (SHENZHEN) CO., LTD." },

33514 { 0xF037CF, "Huawei Device Co., Ltd." },

33515 { 0xF03965, "Samsung Electronics Co.,Ltd" },

33516 { 0xF03A4B, "Bloombase, Inc." },

33517 { 0xF03A55, "Omega Elektronik AS" },

33518 { 0xF03D03, "TECNO MOBILE LIMITED" },

33519 { 0xF03D29, "Actility" },

33520 { 0xF03E90, "Ruckus Wireless" },

33521 { 0xF03EBF, "GOGORO TAIWAN LIMITED" },

33522 { 0xF03F03, "Private" },

33523 { 0xF03F95, "HUAWEI TECHNOLOGIES CO.,LTD" },

33524 { 0xF03FF8, "R L Drake" },

33525 { 0xF0407B, "Fiberhome Telecommunication Technologies Co.,LTD" },

33526 { 0xF041C6, "Heat Tech Company, Ltd." },

33527 { 0xF041C8, "IEEE Registration Authority" },

33528 { 0xF0421C, "Intel Corporate" },

33529 { 0xF042F5, "Huawei Device Co., Ltd." },

33530 { 0xF04335, "DVN(Shanghai)Ltd." },

33531 { 0xF04347, "HUAWEI TECHNOLOGIES CO.,LTD" },

33532 { 0xF045DA, "Texas Instruments" },

33533 { 0xF0463B, "Comcast Cable Corporation" },

33534 { 0xF04A02, "Cisco Systems, Inc" },

33535 { 0xF04A2B, "PYRAMID Computer GmbH" },

33536 { 0xF04A3D, "Bosch Thermotechnik GmbH" },

33537 { 0xF04B3A, "Juniper Networks" },

33538 { 0xF04B6A, "Scientific Production Association Siberian Arsenal, Ltd." },

33539 { 0xF04B8A, "ARRIS Group, Inc." },

33540 { 0xF04BF2, "JTECH Communications, Inc." },

33541 { 0xF04CD5, "Maxlinear, Inc" },

33542 { 0xF04DA2, "Dell Inc." },

33543 { 0xF04DD4, "Sagemcom Broadband SAS" },

33544 { 0xF04F7C, "Amazon Technologies Inc." },

33545 { 0xF05136, "TCT mobile ltd" },

33546 { 0xF051EA, "Fitbit, Inc." },

33547 { 0xF05494, "Honeywell Connected Building" },

33548 { 0xF05501, "Huawei Device Co., Ltd." },

33549 { 0xF057A6, "Intel Corporate" },

33550 { 0xF05849, "CareView Communications" },

33551 { 0xF05A09, "Samsung Electronics Co.,Ltd" },

33552 { 0xF05B7B, "Samsung Electronics Co.,Ltd" },

33553 { 0xF05C19, "Aruba, a Hewlett Packard Enterprise Company" },

33554 { 0xF05C77, "Google, Inc." },

33555 { 0xF05CD5, "Apple, Inc." },

33556 { 0xF05D89, "Dycon Limited" },

33557 { 0xF05DC8, "Duracell Powermat" },

33558 { 0xF05ECD, "Texas Instruments" },

33559 { 0xF05F5A, "Getriebebau NORD GmbH and Co. KG" },

33560 { 0xF06130, "Advantage Pharmacy Services, LLC" },

33561 { 0xF061C0, "Aruba, a Hewlett Packard Enterprise Company" },

33562 { 0xF061F3, "Comcast Cable Corporation" },

33563 { 0xF0620D, "Shenzhen Egreat Tech Corp.,Ltd" },

33564 { 0xF0625A, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

33565 { 0xF06281, "ProCurve Networking by HP" },

33566 { 0xF063F9, "HUAWEI TECHNOLOGIES CO.,LTD" },

33567 { 0xF06426, "Extreme Networks Headquarters" },

33568 { 0xF065AE, "Samsung Electronics Co.,Ltd" },

33569 { 0xF065C2, "Yanfeng Visteon Electronics Technology (Shanghai) Co.,Ltd." },

33570 { 0xF065DD, "Primax Electronics Ltd." },

33571 { 0xF06728, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

33572 { 0xF06853, "Integrated Corporation" },

33573 { 0xF06865, "Taicang T&W Electronics" },

33574 { 0xF06BCA, "Samsung Electronics Co.,Ltd" },

33575 { 0xF06C5D, "Xiaomi Communications Co Ltd" },

33576 { 0xF06C73, "Nokia" },

33577 { 0xF06D78, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

33578 { 0xF06E0B, "Microsoft Corporation" },

33579 { 0xF06E32, "MICROTEL INNOVATION S.R.L." },

33580 { 0xF06F46, "Ubiik" },

33581 { 0xF0704F, "Samsung Electronics Co.,Ltd" },

33582 { 0xF0728C, "Samsung Electronics Co.,Ltd" },

33583 { 0xF072EA, "Google, Inc." },

33584 { 0xF073AE, "PEAK-System Technik" },

33585 { 0xF07485, "NGD Systems, Inc." },

33586 { 0xF0748D, "Ruijie Networks Co.,LTD" },

33587 { 0xF074E4, "Thundercomm Technology Co., Ltd" },

33588 { 0xF0761C, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

33589 { 0xF0766F, "Apple, Inc." },

33590 { 0xF07765, "Sourcefire, Inc" },

33591 { 0xF077C3, "Intel Corporate" },

33592 { 0xF077D0, "Xcellen" },

33593 { 0xF07807, "Apple, Inc." },

33594 { 0xF07816, "Cisco Systems, Inc" },

33595 { 0xF07959, "ASUSTek COMPUTER INC." },

33596 { 0xF07960, "Apple, Inc." },

33597 { 0xF079E8, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

33598 { 0xF07B65, "Sagemcom Broadband SAS" },

33599 { 0xF07BCB, "Hon Hai Precision Ind. Co.,Ltd." },

33600 { 0xF07CC7, "Juniper Networks" },

33601 { 0xF07D68, "D-Link Corporation" },

33602 { 0xF07F06, "Cisco Systems, Inc" },

33603 { 0xF07F0C, "Leopold Kostal GmbH &Co. KG" },

33604 { 0xF08173, "Amazon Technologies Inc." },

33605 { 0xF08175, "Sagemcom Broadband SAS" },

33606 { 0xF081AF, "IRZ AUTOMATION TECHNOLOGIES LTD" },

33607 { 0xF08261, "Sagemcom Broadband SAS" },

33608 { 0xF082C0, "Silicon Laboratories" },

33609 { 0xF0842F, "ADB Broadband Italia" },

33610 { 0xF084C9, "zte corporation" },

33611 { 0xF085C1, "SHENZHEN RF-LINK TECHNOLOGY CO.,LTD." },

33612 { 0xF08620, "Arcadyan Corporation" },

33613 { 0xF0866F, "EM Microelectronic" },

33614 { 0xF08756, "Zyxel Communications Corporation" },

33615 { 0xF0877F, "Magnetar Technology Shenzhen Co., LTD." },

33616 { 0xF08A28, "JIANGSU HENGSION ELECTRONIC S and T CO.,LTD" },

33617 { 0xF08A76, "Samsung Electronics Co.,Ltd" },

33618 { 0xF08BFE, "COSTEL.,CO.LTD" },

33619 { 0xF08CFB, "Fiberhome Telecommunication Technologies Co.,LTD" },

33620 { 0xF08EDB, "VeloCloud Networks" },

33621 { 0xF09008, "Shenzhen Skyworth Digital Technology CO., Ltd" },

33622 { 0xF0921C, "Hewlett Packard" },

33623 { 0xF092B4, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

33624 { 0xF0933A, "NxtConect" },

33625 { 0xF093C5, "Garland Technology" },

33626 { 0xF095F1, "Carl Zeiss AG" },

33627 { 0xF097E5, "TAMIO, INC" },

33628 { 0xF09838, "HUAWEI TECHNOLOGIES CO.,LTD" },

33629 { 0xF0989D, "Apple, Inc." },

33630 { 0xF09919, "Garmin International" },

33631 { 0xF099B6, "Apple, Inc." },

33632 { 0xF099BF, "Apple, Inc." },

33633 { 0xF09A51, "Shanghai Viroyal Electronic Technology Company Limited" },

33634 { 0xF09BB8, "HUAWEI TECHNOLOGIES CO.,LTD" },

33635 { 0xF09CBB, "RaonThink Inc." },

33636 { 0xF09CD7, "Guangzhou Blue Cheetah Intelligent Technology Co., Ltd." },

33637 { 0xF09CE9, "Extreme Networks Headquarters" },

33638 { 0xF09E4A, "Intel Corporate" },

33639 { 0xF09E63, "Cisco Systems, Inc" },

33640 { 0xF09FC2, "Ubiquiti Inc" },

33641 { 0xF09FFC, "SHARP Corporation" },

33642 { 0xF0A0B1, "HUAWEI TECHNOLOGIES CO.,LTD" },

33643 { 0xF0A225, "Amazon Technologies Inc." },

33644 { 0xF0A35A, "Apple, Inc." },

33645 { 0xF0A3B2, "Hui Zhou Gaoshengda Technology Co.,LTD" },

33646 { 0xF0A654, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

33647 { 0xF0A731, "TP-Link Corporation Limited" },

33648 { 0xF0A764, "GST Co., Ltd." },

33649 { 0xF0A7B2, "FUTABA CORPORATION" },

33650 { 0xF0A882, "shenzhen trolink Technology Co.,Ltd" },

33651 { 0xF0A951, "HUAWEI TECHNOLOGIES CO.,LTD" },

33652 { 0xF0A968, "Antailiye Technology Co.,Ltd" },

33653 { 0xF0AA0B, "Arra Networks/ Spectramesh" },

33654 { 0xF0AB1F, "zte corporation" },

33655 { 0xF0AB54, "MITSUMI ELECTRIC CO.,LTD." },

33656 { 0xF0ACA4, "HBC-radiomatic" },

33657 { 0xF0ACD7, "IEEE Registration Authority" },

33658 { 0xF0AD4E, "Globalscale Technologies, Inc." },

33659 { 0xF0AE51, "Xi3 Corp" },

33660 { 0xF0AE66, "Cosonic Intelligent Technologies Co., Ltd." },

33661 { 0xF0AF50, "Phantom Intelligence" },

33662 { 0xF0AF85, "ARRIS Group, Inc." },

33663 { 0xF0B014, "AVM Audiovisuelles Marketing und Computersysteme GmbH" },

33664 { 0xF0B022, "TOHO Electronics INC." },

33665 { 0xF0B040, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

33666 { 0xF0B052, "Ruckus Wireless" },

33667 { 0xF0B0E7, "Apple, Inc." },

33668 { 0xF0B107, "Ericsson AB" },

33669 { 0xF0B11D, "Nokia" },

33670 { 0xF0B13F, "Huawei Device Co., Ltd." },

33671 { 0xF0B2B9, "Intel Corporate" },

33672 { 0xF0B2E5, "Cisco Systems, Inc" },

33673 { 0xF0B31E, "Universal Electronics, Inc." },

33674 { 0xF0B3EC, "Apple, Inc." },

33675 { 0xF0B429, "Xiaomi Communications Co Ltd" },

33676 { 0xF0B479, "Apple, Inc." },

33677 { 0xF0B4D2, "D-Link International" },

33678 { 0xF0B5B7, "Disruptive Technologies Research AS" },

33679 { 0xF0B5D1, "Texas Instruments" },

33680 { 0xF0B61E, "Intel Corporate" },

33681 { 0xF0B661, "eero inc." },

33682 { 0xF0B6EB, "Poslab Technology Co., Ltd." },

33683 { 0xF0B968, "ITEL MOBILE LIMITED" },

33684 { 0xF0BCC8, "MaxID (Pty) Ltd" },

33685 { 0xF0BCC9, "PFU LIMITED" },

33686 { 0xF0BD2E, "H+S Polatis Ltd" },

33687 { 0xF0BDF1, "Sipod Inc." },

33688 { 0xF0BE25, "Dongguan Cannice Precision Manufacturing Co., Ltd." },

33689 { 0xF0BF97, "Sony Corporation" },

33690 { 0xF0C1CE, "GoodWe Technologies CO., Ltd" },

33691 { 0xF0C1F1, "Apple, Inc." },

33692 { 0xF0C24C, "Zhejiang FeiYue Digital Technology Co., Ltd" },

33693 { 0xF0C27C, "Mianyang Netop Telecom Equipment Co.,Ltd." },

33694 { 0xF0C371, "Apple, Inc." },

33695 { 0xF0C42F, "Huawei Device Co., Ltd." },

33696 { 0xF0C478, "HUAWEI TECHNOLOGIES CO.,LTD" },

33697 { 0xF0C558, "U.D.Electronic Corp." },

33698 { 0xF0C725, "Apple, Inc." },

33699 { 0xF0C745, "TECNO MOBILE LIMITED" },

33700 { 0xF0C77F, "Texas Instruments" },

33701 { 0xF0C814, "SHENZHEN BILIAN ELECTRONIC CO.，LTD" },

33702 { 0xF0C850, "HUAWEI TECHNOLOGIES CO.,LTD" },

33703 { 0xF0C88C, "LeddarTech Inc." },

33704 { 0xF0C8B5, "HUAWEI TECHNOLOGIES CO.,LTD" },

33705 { 0xF0C9D1, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

33706 { 0xF0CBA1, "Apple, Inc." },

33707 { 0xF0CCE0, "Shenzhen All-Smartlink Technology Co.,Ltd." },

33708 { 0xF0CD31, "Samsung Electronics Co.,Ltd" },

33709 { 0xF0D08C, "TCT mobile ltd" },

33710 { 0xF0D14F, "LINEAR LLC" },

33711 { 0xF0D1A9, "Apple, Inc." },

33712 { 0xF0D1B8, "LEDVANCE" },

33713 { 0xF0D2F1, "Amazon Technologies Inc." },

33714 { 0xF0D31F, "Apple, Inc." },

33715 { 0xF0D3A7, "CobaltRay Co., Ltd" },

33716 { 0xF0D3E7, "Sensometrix SA" },

33717 { 0xF0D415, "Intel Corporate" },

33718 { 0xF0D4E2, "Dell Inc." },

33719 { 0xF0D4F6, "Lars Thrane A/S" },

33720 { 0xF0D4F7, "varram system" },

33721 { 0xF0D5BF, "Intel Corporate" },

33722 { 0xF0D657, "ECHOSENS" },

33723 { 0xF0D767, "Axema Passagekontroll AB" },

33724 { 0xF0D793, "Apple, Inc." },

33725 { 0xF0D7AA, "Motorola Mobility LLC, a Lenovo Company" },

33726 { 0xF0D7AF, "IEEE Registration Authority" },

33727 { 0xF0D7DC, "Wesine (Wuhan) Technology Co., Ltd." },

33728 { 0xF0D9B2, "EXO S.A." },

33729 { 0xF0DA7C, "RLH INDUSTRIES,INC." },

33730 { 0xF0DB30, "Yottabyte" },

33731 { 0xF0DBE2, "Apple, Inc." },

33732 { 0xF0DBF8, "Apple, Inc." },

33733 { 0xF0DCE2, "Apple, Inc." },

33734 { 0xF0DE71, "Shanghai EDO Technologies Co.,Ltd." },

33735 { 0xF0DEB9, "ShangHai Y&Y Electronics Co., Ltd" },

33736 { 0xF0DEF1, "Wistron Infocomm (Zhongshan) Corporation" },

33737 { 0xF0E3DC, "Tecon MT, LLC" },

33738 { 0xF0E4A2, "HUAWEI TECHNOLOGIES CO.,LTD" },

33739 { 0xF0E5C3, "Drägerwerk AG & Co. KG aA" },

33740 { 0xF0E77E, "Samsung Electronics Co.,Ltd" },

33741 { 0xF0EBD0, "Shanghai Feixun Communication Co.,Ltd." },

33742 { 0xF0EC39, "Essec" },

33743 { 0xF0ED1E, "Bilkon Bilgisayar Kontrollu Cih. Im.Ltd." },

33744 { 0xF0EDB8, "SERVERCOM (INDIA) PRIVATE LIMITED" },

33745 { 0xF0EE10, "Samsung Electronics Co.,Ltd" },

33746 { 0xF0EE58, "PACE Telematics GmbH" },

33747 { 0xF0EE7A, "Apple, Inc." },

33748 { 0xF0EEBB, "VIPAR GmbH" },

33749 { 0xF0EF86, "Google, Inc." },

33750 { 0xF0EFD2, "TF PAYMENT SERVICE CO., LTD" },

33751 { 0xF0F002, "Hon Hai Precision Ind. Co.,Ltd." },

33752 { 0xF0F08F, "Nextek Solutions Pte Ltd" },

33753 { 0xF0F0A4, "Amazon Technologies Inc." },

33754 { 0xF0F249, "Hitron Technologies. Inc" },

33755 { 0xF0F260, "Mobitec AB" },

33756 { 0xF0F336, "TP-LINK TECHNOLOGIES CO.,LTD." },

33757 { 0xF0F564, "Samsung Electronics Co.,Ltd" },

33758 { 0xF0F5AE, "Adaptrum Inc." },

33759 { 0xF0F5BD, "Espressif Inc." },

33760 { 0xF0F61C, "Apple, Inc." },

33761 { 0xF0F644, "Whitesky Science & Technology Co.,Ltd." },

33762 { 0xF0F669, "Motion Analysis Corporation" },

33763 { 0xF0F69C, "NIO Co., Ltd." },

33764 { 0xF0F6C1, "Sonos, Inc." },

33765 { 0xF0F755, "Cisco Systems, Inc" },

33766 { 0xF0F7B3, "Phorm" },

33767 { 0xF0F7E7, "HUAWEI TECHNOLOGIES CO.,LTD" },

33768 { 0xF0F7FC, "HUAWEI TECHNOLOGIES CO.,LTD" },

33769 { 0xF0F842, "KEEBOX, Inc." },

33770 { 0xF0F84A, "BUFFALO.INC" },

33771 { 0xF0F8F2, "Texas Instruments" },

33772 { 0xF0F9F7, "IES GmbH & Co. KG" },

33773 { 0xF0FAC7, "Huawei Device Co., Ltd." },

33774 { 0xF0FCC8, "ARRIS Group, Inc." },

33775 { 0xF0FDA0, "Acurix Networks Pty Ltd" },

33776 { 0xF0FDDD, "Foxtron Vehicle Technologies Co., Ltd." },

33777 { 0xF0FE6B, "Shanghai High-Flying Electronics Technology Co., Ltd" },

33778 { 0xF0FEE7, "Huawei Device Co., Ltd." },

33779 { 0xF40046, "ON Semiconductor" },

33780 { 0xF40223, "PAX Computer Technology(Shenzhen) Ltd." },

33781 { 0xF40228, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

33782 { 0xF40270, "Dell Inc." },

33783 { 0xF40304, "Google, Inc." },

33784 { 0xF40321, "BeNeXt B.V." },

33785 { 0xF4032A, "Amazon Technologies Inc." },

33786 { 0xF4032F, "Reduxio Systems" },

33787 { 0xF40343, "Hewlett Packard Enterprise" },

33788 { 0xF4044C, "ValenceTech Limited" },

33789 { 0xF40595, "Sagemcom Broadband SAS" },

33790 { 0xF40616, "Apple, Inc." },

33791 { 0xF40669, "Intel Corporate" },

33792 { 0xF4068D, "devolo AG" },

33793 { 0xF406A5, "Hangzhou Bianfeng Networking Technology Co., Ltd." },

33794 { 0xF409D8, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

33795 { 0xF40A4A, "INDUSNET Communication Technology Co.,LTD" },

33796 { 0xF40B93, "BlackBerry RTS" },

33797 { 0xF40B9F, "CIG SHANGHAI CO LTD" },

33798 { 0xF40E01, "Apple, Inc." },

33799 { 0xF40E11, "IEEE Registration Authority" },

33800 { 0xF40E22, "Samsung Electronics Co.,Ltd" },

33801 { 0xF40E83, "ARRIS Group, Inc." },

33802 { 0xF40F1B, "Cisco Systems, Inc" },

33803 { 0xF40F24, "Apple, Inc." },

33804 { 0xF40F9B, "WAVELINK" },

33805 { 0xF412DA, "zte corporation" },

33806 { 0xF412FA, "Espressif Inc." },

33807 { 0xF41399, "Aerospace new generation communications Co.,Ltd" },

33808 { 0xF41532, "PETAiO (NanJing), Inc." },

33809 { 0xF41535, "SPON Communication Technology Co.,Ltd" },

33810 { 0xF41563, "F5 Networks, Inc." },

33811 { 0xF415FD, "Shanghai Pateo Electronic Equipment Manufacturing Co., Ltd." },

33812 { 0xF417B8, "AirTies Wireless Networks" },

33813 { 0xF419E2, "Volterra" },

33814 { 0xF41A79, "IEEE Registration Authority" },

33815 { 0xF41A9C, "Xiaomi Communications Co Ltd" },

33816 { 0xF41AB0, "Shenzhen Xingguodu Technology Co., Ltd." },

33817 { 0xF41BA1, "Apple, Inc." },

33818 { 0xF41C71, "SHENZHEN SANMU COMMUNICATION TECHNOLOGY CO., LTD" },

33819 { 0xF41C95, "BEIJING YUNYI TIMES TECHNOLOGY CO,.LTD" },

33820 { 0xF41D6B, "HUAWEI TECHNOLOGIES CO.,LTD" },

33821 { 0xF41E26, "Simon-Kaloi Engineering" },

33822 { 0xF41E5E, "RtBrick Inc." },

33823 { 0xF41F0B, "YAMABISHI Corporation" },

33824 { 0xF41F88, "zte corporation" },

33825 { 0xF41FC2, "Cisco Systems, Inc" },

33826 { 0xF42012, "Cuciniale GmbH" },

33827 { 0xF421AE, "Shanghai Xiaodu Technology Limited" },

33828 { 0xF421CA, "Apple, Inc." },

33829 { 0xF4227A, "Guangdong Seneasy Intelligent Technology Co., Ltd." },

33830 { 0xF4239C, "SERNET (SUZHOU) TECHNOLOGIES CORPORATION" },

33831 { 0xF42462, "Selcom Electronics (Shanghai) Co., Ltd" },

33832 { 0xF42679, "Intel Corporate" },

33833 { 0xF42756, "DASAN Newtork Solutions" },

33834 { 0xF42833, "MMPC Inc." },

33835 { 0xF42853, "Zioncom Electronics (Shenzhen) Ltd." },

33836 { 0xF42896, "SPECTO PAINEIS ELETRONICOS LTDA" },

33837 { 0xF42981, "vivo Mobile Communication Co., Ltd." },

33838 { 0xF42A7D, "TP-LINK TECHNOLOGIES CO.,LTD." },

33839 { 0xF42B48, "Ubiqam" },

33840 { 0xF42B7D, "Chipsguide technology CO.,LTD." },

33841 { 0xF42B8C, "Samsung Electronics Co.,Ltd" },

33842 { 0xF42C56, "SENOR TECH CO LTD" },

33843 { 0xF42D06, "zte corporation" },

33844 { 0xF42E48, "zte corporation" },

33845 { 0xF42E7F, "Aruba, a Hewlett Packard Enterprise Company" },

33846 { 0xF4308B, "Xiaomi Communications Co Ltd" },

33847 { 0xF430B9, "Hewlett Packard" },

33848 { 0xF431C3, "Apple, Inc." },

33849 { 0xF4323D, "Sichuan tianyi kanghe communications co., LTD" },

33850 { 0xF4331C, "Toast, Inc." },

33851 { 0xF43328, "CIMCON Lighting Inc." },

33852 { 0xF434F0, "Apple, Inc." },

33853 { 0xF436E1, "Abilis Systems SARL" },

33854 { 0xF437B7, "Apple, Inc." },

33855 { 0xF43814, "Shanghai Howell Electronic Co.,Ltd" },

33856 { 0xF438C1, "Huawei Device Co., Ltd." },

33857 { 0xF43909, "Hewlett Packard" },

33858 { 0xF439A6, "Apple, Inc." },

33859 { 0xF43A7B, "zte corporation" },

33860 { 0xF43BD8, "Intel Corporate" },

33861 { 0xF43C3B, "HUNAN FN-LINK TECHNOLOGY LIMITED" },

33862 { 0xF43C96, "Ericsson AB" },

33863 { 0xF43D80, "FAG Industrial Services GmbH" },

33864 { 0xF43E61, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

33865 { 0xF43E66, "Bee Computing (HK) Limited" },

33866 { 0xF43E9D, "Benu Networks, Inc." },

33867 { 0xF44156, "Arrikto Inc." },

33868 { 0xF4419E, "Huawei Device Co., Ltd." },

33869 { 0xF44227, "S & S Research Inc." },

33870 { 0xF44250, "Bouffalo Lab (Nanjing) Co., Ltd." },

33871 { 0xF4428F, "Samsung Electronics Co.,Ltd" },

33872 { 0xF4442C, "Shenzhen SuperElectron Technology Co.,Ltd." },

33873 { 0xF44450, "BND Co., Ltd." },

33874 { 0xF44588, "HUAWEI TECHNOLOGIES CO.,LTD" },

33875 { 0xF445ED, "Portable Innovation Technology Ltd." },

33876 { 0xF44637, "Intel Corporate" },

33877 { 0xF44713, "Leading Public Performance Co., Ltd." },

33878 { 0xF4472A, "Nanjing Rousing Sci. and Tech. Industrial Co., Ltd" },

33879 { 0xF44848, "Amscreen Group Ltd" },

33880 { 0xF44955, "MIMO TECH Co., Ltd." },

33881 { 0xF449EF, "EMSTONE" },

33882 { 0xF44B2A, "Cisco SPVTG" },

33883 { 0xF44C70, "Skyworth Digital Technology(Shenzhen) Co.,Ltd" },

33884 { 0xF44C7F, "HUAWEI TECHNOLOGIES CO.,LTD" },

33885 { 0xF44D17, "GOLDCARD HIGH-TECH CO.,LTD." },

33886 { 0xF44D30, "Elitegroup Computer Systems Co.,Ltd." },

33887 { 0xF44D5C, "Zyxel Communications Corporation" },

33888 { 0xF44DAD, "Cable Matters Inc." },

33889 { 0xF44E05, "Cisco Systems, Inc" },

33890 { 0xF44E38, "Olibra LLC" },

33891 { 0xF44EE3, "Intel Corporate" },

33892 { 0xF44EFD, "Actions Semiconductor Co.,Ltd.(Cayman Islands)" },

33893 { 0xF44FD3, "shenzhen hemuwei technology co.,ltd" },

33894 { 0xF450EB, "Telechips Inc" },

33895 { 0xF45214, "Mellanox Technologies, Inc." },

33896 { 0xF45246, "ASKEY COMPUTER CORP" },

33897 { 0xF45420, "TELLESCOM INDUSTRIA E COMERCIO EM TELECOMUNICACAO" },

33898 { 0xF45424, "Extreme Networks Headquarters" },

33899 { 0xF45433, "Rockwell Automation" },

33900 { 0xF45595, "HENGBAO Corporation LTD." },

33901 { 0xF4559C, "HUAWEI TECHNOLOGIES CO.,LTD" },

33902 { 0xF455E0, "Niceway CNC Technology Co.,Ltd.Hunan Province" },

33903 { 0xF4573E, "Fiberhome Telecommunication Technologies Co.,LTD" },

33904 { 0xF45842, "Boxx TV Ltd" },

33905 { 0xF45B73, "Wanjiaan Interconnected Technology Co., Ltd" },

33906 { 0xF45C89, "Apple, Inc." },

33907 { 0xF45EAB, "Texas Instruments" },

33908 { 0xF45F69, "Matsufu Electronics distribution Company" },

33909 { 0xF45FD4, "Cisco SPVTG" },

33910 { 0xF45FF7, "DQ Technology Inc." },

33911 { 0xF4600D, "Panoptic Technology, Inc" },

33912 { 0xF46077, "Texas Instruments" },

33913 { 0xF460E2, "Xiaomi Communications Co Ltd" },

33914 { 0xF462D0, "Not for Radio, LLC" },

33915 { 0xF462DC, "Huawei Device Co., Ltd." },

33916 { 0xF4631F, "HUAWEI TECHNOLOGIES CO.,LTD" },

33917 { 0xF46349, "Diffon Corporation" },

33918 { 0xF463E7, "Nanjing Maxon O.E. Tech. Co., LTD" },

33919 { 0xF463FC, "vivo Mobile Communication Co., Ltd." },

33920 { 0xF46412, "Sony Interactive Entertainment Inc." },

33921 { 0xF4645D, "Toshiba" },

33922 { 0xF465A6, "Apple, Inc." },

33923 { 0xF4672D, "ShenZhen Topstar Technology Company" },

33924 { 0xF46942, "ASKEY COMPUTER CORP" },

33925 { 0xF469D5, "IEEE Registration Authority" },

33926 { 0xF46A92, "SHENZHEN FAST TECHNOLOGIES CO.,LTD" },

33927 { 0xF46ABC, "Adonit Corp. Ltd." },

33928 { 0xF46AD7, "Microsoft Corporation" },

33929 { 0xF46ADD, "Liteon Technology Corporation" },

33930 { 0xF46B8C, "Hon Hai Precision Industry Co., Ltd." },

33931 { 0xF46BEF, "Sagemcom Broadband SAS" },

33932 { 0xF46C68, "Wistron Neweb Corporation" },

33933 { 0xF46D04, "ASUSTek COMPUTER INC." },

33934 { 0xF46D2F, "TP-LINK TECHNOLOGIES CO.,LTD." },

33935 { 0xF46D3F, "Intel Corporate" },

33936 { 0xF46DE2, "zte corporation" },

33937 { 0xF46E24, "NEC Personal Computers, Ltd." },

33938 { 0xF46E95, "Extreme Networks Headquarters" },

33939 { 0xF46F4E, "Echowell" },

33940 { 0xF46FA4, "Physik Instrumente GmbH & Co. KG" },

33941 { 0xF46FED, "Fiberhome Telecommunication Technologies Co.,LTD" },

33942 { 0xF4700C, "IEEE Registration Authority" },

33943 { 0xF470AB, "vivo Mobile Communication Co., Ltd." },

33944 { 0xF47190, "Samsung Electronics Co.,Ltd" },

33945 { 0xF47335, "Logitech Far East" },

33946 { 0xF473CA, "Conversion Sound Inc." },

33947 { 0xF47488, "New H3C Technologies Co., Ltd" },

33948 { 0xF47626, "Viltechmeda UAB" },

33949 { 0xF47946, "HUAWEI TECHNOLOGIES CO.,LTD" },

33950 { 0xF47960, "HUAWEI TECHNOLOGIES CO.,LTD" },

33951 { 0xF47A4E, "Woojeon&Handan" },

33952 { 0xF47ACC, "SolidFire, Inc." },

33953 { 0xF47B09, "Intel Corporate" },

33954 { 0xF47B5E, "Samsung Electronics Co.,Ltd" },

33955 { 0xF47DEF, "Samsung Electronics Co.,Ltd" },

33956 { 0xF47F35, "Cisco Systems, Inc" },

33957 { 0xF48139, "CANON INC." },

33958 { 0xF4832C, "OHSUNG" },

33959 { 0xF483CD, "TP-LINK TECHNOLOGIES CO.,LTD." },

33960 { 0xF483E1, "Shanghai Clouder Semiconductor Co.,Ltd" },

33961 { 0xF4844C, "Texas Instruments" },

33962 { 0xF4848D, "TP-LINK TECHNOLOGIES CO.,LTD." },

33963 { 0xF485C6, "FDT Technologies" },

33964 { 0xF48771, "Infoblox" },

33965 { 0xF487C5, "Huawei Device Co., Ltd." },

33966 { 0xF48B32, "Xiaomi Communications Co Ltd" },

33967 { 0xF48C50, "Intel Corporate" },

33968 { 0xF48CEB, "D-Link International" },

33969 { 0xF48E09, "Nokia Corporation" },

33970 { 0xF48E38, "Dell Inc." },

33971 { 0xF48E92, "HUAWEI TECHNOLOGIES CO.,LTD" },

33972 { 0xF490CA, "Tensorcom" },

33973 { 0xF490CB, "IEEE Registration Authority" },

33974 { 0xF490EA, "Deciso B.V." },

33975 { 0xF4911E, "ZHUHAI EWPE INFORMATION TECHNOLOGY INC" },

33976 { 0xF492BF, "Ubiquiti Inc" },

33977 { 0xF4931C, "Universal Electronics, Inc." },

33978 { 0xF4939F, "Hon Hai Precision Industry Co., Ltd." },

33979 { 0xF49461, "NexGen Storage" },

33980 { 0xF49466, "CountMax, ltd" },

33981 { 0xF4951B, "Hefei Radio Communication Technology Co., Ltd" },

33982 { 0xF49634, "Intel Corporate" },

33983 { 0xF49651, "NAKAYO Inc" },

33984 { 0xF497C2, "Nebulon Inc" },

33985 { 0xF499AC, "WEBER Schraubautomaten GmbH" },

33986 { 0xF49C12, "Structab AB" },

33987 { 0xF49DA7, "Private" },

33988 { 0xF49EEF, "Taicang T&W Electronics" },

33989 { 0xF49F54, "Samsung Electronics Co.,Ltd" },

33990 { 0xF49FF3, "HUAWEI TECHNOLOGIES CO.,LTD" },

33991 { 0xF4A17F, "Marquardt Electronics Technology (Shanghai) Co.Ltd" },

33992 { 0xF4A294, "EAGLE WORLD DEVELOPMENT CO., LIMITED" },

33993 { 0xF4A454, "IEEE Registration Authority" },

33994 { 0xF4A475, "Intel Corporate" },

33995 { 0xF4A4D6, "HUAWEI TECHNOLOGIES CO.,LTD" },

33996 { 0xF4A52A, "Hawa Technologies Inc" },

33997 { 0xF4A59D, "Huawei Device Co., Ltd." },

33998 { 0xF4A739, "Juniper Networks" },

33999 { 0xF4A80D, "Wistron InfoComm(Kunshan)Co.,Ltd." },

34000 { 0xF4A997, "CANON INC." },

34001 { 0xF4AAD0, "OHSUNG" },

34002 { 0xF4ACC1, "Cisco Systems, Inc" },

34003 { 0xF4AFE7, "Apple, Inc." },

34004 { 0xF4B164, "Lightning Telecommunications Technology Co. Ltd" },

34005 { 0xF4B19C, "AltoBeam (China) Inc." },

34006 { 0xF4B1C2, "Zhejiang Dahua Technology Co., Ltd." },

34007 { 0xF4B301, "Intel Corporate" },

34008 { 0xF4B381, "WindowMaster A/S" },

34009 { 0xF4B3B1, "Silicon Laboratories" },

34010 { 0xF4B520, "Biostar Microtech international corp." },

34011 { 0xF4B52F, "Juniper Networks" },

34012 { 0xF4B549, "Xiamen Yeastar Information Technology Co., Ltd." },

34013 { 0xF4B5AA, "zte corporation" },

34014 { 0xF4B5BB, "CERAGON NETWORKS" },

34015 { 0xF4B62D, "Dongguan Huayin Electronic Technology Co., Ltd." },

34016 { 0xF4B688, "PLANTRONICS, INC." },

34017 { 0xF4B6C6, "Indra Heera Technology LLP" },

34018 { 0xF4B6E5, "TerraSem Co.,Ltd" },

34019 { 0xF4B72A, "TIME INTERCONNECT LTD" },

34020 { 0xF4B78D, "HUAWEI TECHNOLOGIES CO.,LTD" },

34021 { 0xF4B7B3, "vivo Mobile Communication Co., Ltd." },

34022 { 0xF4B7E2, "Hon Hai Precision Ind. Co.,Ltd." },

34023 { 0xF4B85E, "Texas Instruments" },

34024 { 0xF4B898, "Texas Instruments" },

34025 { 0xF4B8A7, "zte corporation" },

34026 { 0xF4BBC7, "vivo Mobile Communication Co., Ltd." },

34027 { 0xF4BC97, "Shenzhen Crave Communication Co., LTD" },

34028 { 0xF4BCDA, "Shenzhen Jingxun Software Telecommunication Technology Co.,Ltd" },

34029 { 0xF4BD7C, "Chengdu jinshi communication Co., LTD" },

34030 { 0xF4BD9E, "Cisco Systems, Inc" },

34031 { 0xF4BEEC, "Apple, Inc." },

34032 { 0xF4BF80, "HUAWEI TECHNOLOGIES CO.,LTD" },

34033 { 0xF4BFA8, "Juniper Networks" },

34034 { 0xF4BFBB, "China Mobile Group Device Co.,Ltd." },

34035 { 0xF4C02F, "BlueBite" },

34036 { 0xF4C114, "Vantiva USA LLC" },

34037 { 0xF4C248, "Samsung Electronics Co.,Ltd" },

34038 { 0xF4C447, "Coagent International Enterprise Limited" },

34039 { 0xF4C4D6, "Shenzhen Xinfa Electronic Co.,ltd" },

34040 { 0xF4C613, "Alcatel-Lucent Shanghai Bell Co., Ltd" },

34041 { 0xF4C6D7, "blackned GmbH" },

34042 { 0xF4C714, "HUAWEI TECHNOLOGIES CO.,LTD" },

34043 { 0xF4C795, "WEY Technology AG" },

34044 { 0xF4C7AA, "Marvell Semiconductors" },

34045 { 0xF4C7C8, "Kelvin Inc." },

34046 { 0xF4C88A, "Intel Corporate" },

34047 { 0xF4CA24, "FreeBit Co., Ltd." },

34048 { 0xF4CAE5, "FREEBOX SAS" },

34049 { 0xF4CAE7, "Arcadyan Corporation" },

34050 { 0xF4CB52, "HUAWEI TECHNOLOGIES CO.,LTD" },

34051 { 0xF4CC55, "Juniper Networks" },

34052 { 0xF4CD90, "Vispiron Rotec GmbH" },

34053 { 0xF4CE23, "Intel Corporate" },

34054 { 0xF4CE36, "Nordic Semiconductor ASA" },

34055 { 0xF4CE46, "Hewlett Packard" },

34056 { 0xF4CE48, "Extreme Networks Headquarters" },

34057 { 0xF4CFA2, "Espressif Inc." },

34058 { 0xF4CFE2, "Cisco Systems, Inc" },

34059 { 0xF4D032, "Yunnan Ideal Information&Technology.,Ltd" },

34060 { 0xF4D108, "Intel Corporate" },

34061 { 0xF4D261, "SEMOCON Co., Ltd" },

34062 { 0xF4D488, "Apple, Inc." },

34063 { 0xF4D580, "YAMAHA CORPORATION" },

34064 { 0xF4D58A, "Palo Alto Networks" },

34065 { 0xF4D620, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

34066 { 0xF4D7B2, "LGS Innovations, LLC" },

34067 { 0xF4D9C6, "UNION MAN TECHNOLOGY CO.,LTD" },

34068 { 0xF4D9FB, "Samsung Electronics Co.,Ltd" },

34069 { 0xF4DBE3, "Apple, Inc." },

34070 { 0xF4DBE6, "Cisco Systems, Inc" },

34071 { 0xF4DC41, "YOUNGZONE CULTURE (SHANGHAI) CORP" },

34072 { 0xF4DC4D, "Beijing CCD Digital Technology Co., Ltd" },

34073 { 0xF4DCA5, "DAWON DNS" },

34074 { 0xF4DCDA, "Zhuhai Jiahe Communication Technology Co., limited" },

34075 { 0xF4DCF9, "HUAWEI TECHNOLOGIES CO.,LTD" },

34076 { 0xF4DD06, "Samsung Electronics Co.,Ltd" },

34077 { 0xF4DD9E, "GoPro" },

34078 { 0xF4DE0C, "ESPOD Ltd." },

34079 { 0xF4DEAF, "HUAWEI TECHNOLOGIES CO.,LTD" },

34080 { 0xF4E11E, "Texas Instruments" },

34081 { 0xF4E142, "Delta Elektronika BV" },

34082 { 0xF4E204, "COYOTE SYSTEM" },

34083 { 0xF4E2C6, "Ubiquiti Inc" },

34084 { 0xF4E3FB, "HUAWEI TECHNOLOGIES CO.,LTD" },

34085 { 0xF4E451, "HUAWEI TECHNOLOGIES CO.,LTD" },

34086 { 0xF4E4AD, "zte corporation" },

34087 { 0xF4E4D7, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

34088 { 0xF4E578, "LLC Proizvodstvennaya Kompania TransService" },

34089 { 0xF4E5F2, "HUAWEI TECHNOLOGIES CO.,LTD" },

34090 { 0xF4E6D7, "Solar Power Technologies, Inc." },

34091 { 0xF4E84F, "zte corporation" },

34092 { 0xF4E8C7, "Apple, Inc." },

34093 { 0xF4E926, "Tianjin Zanpu Technology Inc." },

34094 { 0xF4E975, "New H3C Technologies Co., Ltd" },

34095 { 0xF4E9D4, "QLogic Corporation" },

34096 { 0xF4EA67, "Cisco Systems, Inc" },

34097 { 0xF4EAB5, "Extreme Networks Headquarters" },

34098 { 0xF4EB38, "Sagemcom Broadband SAS" },

34099 { 0xF4EB9F, "Ellu Company 2019 SL" },

34100 { 0xF4EC38, "TP-LINK TECHNOLOGIES CO.,LTD." },

34101 { 0xF4ED37, "Qingdao Yuze lntelligent Technology Co.,Ltd" },

34102 { 0xF4ED5F, "SHENZHEN KTC TECHNOLOGY GROUP" },

34103 { 0xF4EE08, "Dell Inc." },

34104 { 0xF4EE14, "MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD." },

34105 { 0xF4EE31, "Cisco Systems, Inc" },

34106 { 0xF4EF9E, "SGSG SCIENCE & TECHNOLOGY CO. LTD" },

34107 { 0xF4F15A, "Apple, Inc." },

34108 { 0xF4F197, "EMTAKE Inc" },

34109 { 0xF4F19E, "Wistron InforComm (Zhongshan) Corporation" },

34110 { 0xF4F1E1, "Motorola Mobility LLC, a Lenovo Company" },

34111 { 0xF4F26D, "TP-LINK TECHNOLOGIES CO.,LTD." },

34112 { 0xF4F28A, "HUAWEI TECHNOLOGIES CO.,LTD" },

34113 { 0xF4F309, "Samsung Electronics Co.,Ltd" },

34114 { 0xF4F3AA, "JBL GmbH & Co. KG" },

34115 { 0xF4F524, "Motorola Mobility LLC, a Lenovo Company" },

34116 { 0xF4F5A5, "Nokia Corporation" },

34117 { 0xF4F5D8, "Google, Inc." },

34118 { 0xF4F5DB, "Xiaomi Communications Co Ltd" },

34119 { 0xF4F5E8, "Google, Inc." },

34120 { 0xF4F646, "Dediprog Technology Co. Ltd." },

34121 { 0xF4F647, "zte corporation" },

34122 { 0xF4F70C, "Avang - neterbit" },

34123 { 0xF4F951, "Apple, Inc." },

34124 { 0xF4FBB8, "HUAWEI TECHNOLOGIES CO.,LTD" },

34125 { 0xF4FC32, "Texas Instruments" },

34126 { 0xF4FCB1, "JJ Corp" },

34127 { 0xF4FD2B, "ZOYI Company" },

34128 { 0xF4FE3E, "Apple, Inc." },

34129 { 0xF4FEFB, "Samsung Electronics Co.,Ltd" },

34130 { 0xF8009D, "INTRACOM DEFENSE S.A." },

34131 { 0xF800A1, "HUAWEI TECHNOLOGIES CO.,LTD" },

34132 { 0xF80113, "HUAWEI TECHNOLOGIES CO.,LTD" },

34133 { 0xF801B4, "LG Electronics" },

34134 { 0xF80278, "IEEE Registration Authority" },

34135 { 0xF80332, "Khomp" },

34136 { 0xF80377, "Apple, Inc." },

34137 { 0xF8042E, "SAMSUNG ELECTRO-MECHANICS(THAILAND)" },

34138 { 0xF8051C, "DRS Imaging and Targeting Solutions" },

34139 { 0xF8075D, "Huawei Device Co., Ltd." },

34140 { 0xF8084F, "Sagemcom Broadband SAS" },

34141 { 0xF809A4, "Henan Thinker Rail Transportation Research Inc." },

34142 { 0xF80BBE, "ARRIS Group, Inc." },

34143 { 0xF80BCB, "Cisco Systems, Inc" },

34144 { 0xF80BD0, "Datang Telecom communication terminal (Tianjin) Co., Ltd." },

34145 { 0xF80C58, "Taicang T&W Electronics" },

34146 { 0xF80CF3, "LG Electronics (Mobile Communications)" },

34147 { 0xF80D43, "Hon Hai Precision Ind. Co.,Ltd." },

34148 { 0xF80D60, "CANON INC." },

34149 { 0xF80DA9, "Zyxel Communications Corporation" },

34150 { 0xF80DAC, "HP Inc." },

34151 { 0xF80DEA, "ZyCast Technology Inc." },

34152 { 0xF80DF0, "zte corporation" },

34153 { 0xF80DF1, "Sontex SA" },

34154 { 0xF80F41, "Wistron Infocomm (Zhongshan) Corporation" },

34155 { 0xF80F6F, "Cisco Systems, Inc" },

34156 { 0xF80F84, "Natural Security SAS" },

34157 { 0xF80FF9, "Google, Inc." },

34158 { 0xF81037, "Atopia Systems, LP" },

34159 { 0xF81093, "Apple, Inc." },

34160 { 0xF81308, "Nokia" },

34161 { 0xF814FE, "UNION MAN TECHNOLOGY CO.,LTD" },

34162 { 0xF81547, "Avaya Inc" },

34163 { 0xF81654, "Intel Corporate" },

34164 { 0xF81897, "2Wire Inc" },

34165 { 0xF81A2B, "Google, Inc." },

34166 { 0xF81A67, "TP-LINK TECHNOLOGIES CO.,LTD." },

34167 { 0xF81B04, "Zhong Shan City Richsound Electronic Industrial Ltd" },

34168 { 0xF81CE5, "Telefonbau Behnke GmbH" },

34169 { 0xF81D0F, "Hitron Technologies. Inc" },

34170 { 0xF81D78, "IEEE Registration Authority" },

34171 { 0xF81D90, "Solidwintech" },

34172 { 0xF81D93, "Longdhua(Beijing) Controls Technology Co.,Ltd" },

34173 { 0xF81E6F, "EBG compleo GmbH" },

34174 { 0xF81EDF, "Apple, Inc." },

34175 { 0xF81F32, "Motorola Mobility LLC, a Lenovo Company" },

34176 { 0xF82055, "Green Information System" },

34177 { 0xF820A9, "Huawei Device Co., Ltd." },

34178 { 0xF820D2, "ARRIS Group, Inc." },

34179 { 0xF82111, "HMD Global Oy" },

34180 { 0xF82229, "Nokia Shanghai Bell Co., Ltd." },

34181 { 0xF82285, "Cypress Technology CO., LTD." },

34182 { 0xF82387, "Shenzhen Horn Audio Co.,Ltd." },

34183 { 0xF823B2, "HUAWEI TECHNOLOGIES CO.,LTD" },

34184 { 0xF82441, "Yeelink" },

34185 { 0xF824DB, "EntryPoint Networks, Inc" },

34186 { 0xF824E4, "Beyonics Technology Electronic (Changshu) Co., Ltd" },

34187 { 0xF82551, "Seiko Epson Corporation" },

34188 { 0xF8272E, "Mercku" },

34189 { 0xF82793, "Apple, Inc." },

34190 { 0xF82819, "Liteon Technology Corporation" },

34191 { 0xF828C9, "HUAWEI TECHNOLOGIES CO.,LTD" },

34192 { 0xF829C0, "Availink, Inc." },

34193 { 0xF82B7F, "Huawei Device Co., Ltd." },

34194 { 0xF82BC8, "Jiangsu Switter Co., Ltd" },

34195 { 0xF82C18, "2Wire Inc" },

34196 { 0xF82D7C, "Apple, Inc." },

34197 { 0xF82DC0, "ARRIS Group, Inc." },

34198 { 0xF82E0C, "Texas Instruments" },

34199 { 0xF82E3F, "HUAWEI TECHNOLOGIES CO.,LTD" },

34200 { 0xF82E8E, "Nanjing Kechen Electric Co., Ltd." },

34201 { 0xF82EDB, "RTW GmbH & Co. KG" },

34202 { 0xF82F08, "Molex CMS" },

34203 { 0xF82F5B, "eGauge Systems LLC" },

34204 { 0xF82F65, "Huawei Device Co., Ltd." },

34205 { 0xF82F6A, "ITEL MOBILE LIMITED" },

34206 { 0xF82FA8, "Hon Hai Precision Ind. Co.,Ltd." },

34207 { 0xF83002, "Texas Instruments" },

34208 { 0xF83094, "Alcatel-Lucent Telecom Limited" },

34209 { 0xF8313E, "endeavour GmbH" },

34210 { 0xF832E4, "ASUSTek COMPUTER INC." },

34211 { 0xF83331, "Texas Instruments" },

34212 { 0xF83376, "Good Mind Innovation Co., Ltd." },

34213 { 0xF83441, "Intel Corporate" },

34214 { 0xF83451, "Comcast-SRL" },

34215 { 0xF8345A, "Hitron Technologies. Inc" },

34216 { 0xF83553, "Magenta Research Ltd." },

34217 { 0xF835DD, "Gemtek Technology Co., Ltd." },

34218 { 0xF8369B, "Texas Instruments" },

34219 { 0xF83869, "LG Electronics" },

34220 { 0xF83880, "Apple, Inc." },

34221 { 0xF83918, "Cisco Systems, Inc" },

34222 { 0xF83B1D, "Vantiva USA LLC" },

34223 { 0xF83B7E, "Huawei Device Co., Ltd." },

34224 { 0xF83C44, "SHENZHEN TRANSCHAN TECHNOLOGY LIMITED" },

34225 { 0xF83C80, "MITSUMI ELECTRIC CO.,LTD." },

34226 { 0xF83CBF, "BOTATO ELECTRONICS SDN BHD" },

34227 { 0xF83D4E, "Softlink Automation System Co., Ltd" },

34228 { 0xF83DFF, "HUAWEI TECHNOLOGIES CO.,LTD" },

34229 { 0xF83E95, "HUAWEI TECHNOLOGIES CO.,LTD" },

34230 { 0xF83F51, "Samsung Electronics Co.,Ltd" },

34231 { 0xF84288, "Apple, Inc." },

34232 { 0xF842FB, "Yasuda Joho Co.,ltd." },

34233 { 0xF844E3, "Taicang T&W Electronics" },

34234 { 0xF845AD, "Konka Group Co., Ltd." },

34235 { 0xF845C4, "Shenzhen Netforward Micro-Electronic Co., Ltd." },

34236 { 0xF8461C, "Sony Interactive Entertainment Inc." },

34237 { 0xF8462D, "SYNTEC Incorporation" },

34238 { 0xF8472D, "X2gen Digital Corp. Ltd" },

34239 { 0xF84897, "Hitachi, Ltd." },

34240 { 0xF848FD, "China Mobile Group Device Co.,Ltd." },

34241 { 0xF84A73, "EUMTECH CO., LTD" },

34242 { 0xF84A7F, "Innometriks Inc" },

34243 { 0xF84ABF, "HUAWEI TECHNOLOGIES CO.,LTD" },

34244 { 0xF84CDA, "HUAWEI TECHNOLOGIES CO.,LTD" },

34245 { 0xF84D33, "Fiberhome Telecommunication Technologies Co.,LTD" },

34246 { 0xF84D89, "Apple, Inc." },

34247 { 0xF84DFC, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

34248 { 0xF84E17, "Sony Corporation" },

34249 { 0xF84E58, "Samsung Electronics Co.,Ltd" },

34250 { 0xF84E73, "Apple, Inc." },

34251 { 0xF84F57, "Cisco Systems, Inc" },

34252 { 0xF84FAD, "Hui Zhou Gaoshengda Technology Co.,LTD" },

34253 { 0xF8501C, "Tianjin Geneuo Technology Co.,Ltd" },

34254 { 0xF85063, "Verathon" },

34255 { 0xF85128, "SimpliSafe" },

34256 { 0xF8516D, "Denwa Technology Corp." },

34257 { 0xF852DF, "VNL Europe AB" },

34258 { 0xF85329, "HUAWEI TECHNOLOGIES CO.,LTD" },

34259 { 0xF854AF, "ECI Telecom Ltd." },

34260 { 0xF854B8, "Amazon Technologies Inc." },

34261 { 0xF854F6, "AzureWave Technology Inc." },

34262 { 0xF85548, "Texas Instruments" },

34263 { 0xF855CD, "Visteon Corporation" },

34264 { 0xF856C3, "zte corporation" },

34265 { 0xF8572E, "Core Brands, LLC" },

34266 { 0xF85971, "Intel Corporate" },

34267 { 0xF85A00, "Sanford LP" },

34268 { 0xF85B3B, "ASKEY COMPUTER CORP" },

34269 { 0xF85B6E, "Samsung Electronics Co.,Ltd" },

34270 { 0xF85B9B, "iMercury" },

34271 { 0xF85B9C, "SB SYSTEMS Co.,Ltd" },

34272 { 0xF85BC9, "M-Cube Spa" },

34273 { 0xF85C45, "IC Nexus Co. Ltd." },

34274 { 0xF85C4D, "Nokia" },

34275 { 0xF85C7D, "Shenzhen Honesty Electronics Co.,Ltd." },

34276 { 0xF85C7E, "Shenzhen Honesty Electronics Co.,Ltd." },

34277 { 0xF85E0B, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

34278 { 0xF85E3C, "SHENZHEN ZHIBOTONG ELECTRONICS CO.,LTD" },

34279 { 0xF85E42, "Vantiva USA LLC" },

34280 { 0xF85EA0, "Intel Corporate" },

34281 { 0xF85F2A, "Nokia Corporation" },

34282 { 0xF860F0, "Aruba, a Hewlett Packard Enterprise Company" },

34283 { 0xF86214, "Apple, Inc." },

34284 { 0xF862AA, "xn systems" },

34285 { 0xF8633F, "Intel Corporate" },

34286 { 0xF863D9, "ARRIS Group, Inc." },

34287 { 0xF86465, "Anova Applied Electronics, Inc." },

34288 { 0xF864B8, "zte corporation" },

34289 { 0xF86601, "Suzhou Chi-tek information technology Co., Ltd" },

34290 { 0xF8665A, "Apple, Inc." },

34291 { 0xF86691, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

34292 { 0xF866D1, "Hon Hai Precision Ind. Co.,Ltd." },

34293 { 0xF866F2, "Cisco Systems, Inc" },

34294 { 0xF86971, "Seibu Electric Co.," },

34295 { 0xF86B14, "Barrot Technology Co.,LTD" },

34296 { 0xF86BD9, "Cisco Systems, Inc" },

34297 { 0xF86C03, "Shenzhen Teleone Technology Co., Ltd" },

34298 { 0xF86CE1, "Taicang T&W Electronics" },

34299 { 0xF86D73, "Zengge Co., Limited" },

34300 { 0xF86DCC, "Wistron Neweb Corporation" },

34301 { 0xF86ECF, "Arcx Inc" },

34302 { 0xF86EEE, "HUAWEI TECHNOLOGIES CO.,LTD" },

34303 { 0xF86FB0, "TP-LINK TECHNOLOGIES CO.,LTD." },

34304 { 0xF86FC1, "Apple, Inc." },

34305 { 0xF86FDE, "Shenzhen Goodix Technology Co.,Ltd." },

34306 { 0xF8710C, "Xiaomi Communications Co Ltd" },

34307 { 0xF871A6, "Apple, Inc." },

34308 { 0xF871FE, "The Goldman Sachs Group, Inc." },

34309 { 0xF872EA, "Cisco Systems, Inc" },

34310 { 0xF87394, "NETGEAR" },

34311 { 0xF873A2, "Avaya Inc" },

34312 { 0xF87588, "HUAWEI TECHNOLOGIES CO.,LTD" },

34313 { 0xF875A4, "LCFC(HeFei) Electronics Technology co., ltd" },

34314 { 0xF8769B, "Neopis Co., Ltd." },

34315 { 0xF877B8, "Samsung Electronics Co.,Ltd" },

34316 { 0xF87907, "Huawei Device Co., Ltd." },

34317 { 0xF8790A, "ARRIS Group, Inc." },

34318 { 0xF87928, "zte corporation" },

34319 { 0xF87999, "Guangdong Jiuzhi Technology Co.,Ltd" },

34320 { 0xF87A41, "Cisco Systems, Inc" },

34321 { 0xF87AEF, "Rosonix Technology, Inc." },

34322 { 0xF87B20, "Cisco Systems, Inc" },

34323 { 0xF87B62, "FASTWEL INTERNATIONAL CO., LTD. Taiwan Branch" },

34324 { 0xF87B7A, "ARRIS Group, Inc." },

34325 { 0xF87B8C, "Amped Wireless" },

34326 { 0xF87D3F, "Huawei Device Co., Ltd." },

34327 { 0xF87D76, "Apple, Inc." },

34328 { 0xF87FA5, "GREATEK" },

34329 { 0xF88096, "Elsys Equipamentos Eletrônicos Ltda" },

34330 { 0xF8811A, "OVERKIZ" },

34331 { 0xF88200, "CaptionCall" },

34332 { 0xF88479, "Yaojin Technology(Shenzhen)Co.,Ltd" },

34333 { 0xF884F2, "Samsung Electronics Co.,Ltd" },

34334 { 0xF885F9, "Calix Inc." },

34335 { 0xF887F1, "Apple, Inc." },

34336 { 0xF8893C, "Inventec Appliances Corp." },

34337 { 0xF889D2, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

34338 { 0xF88A3C, "IEEE Registration Authority" },

34339 { 0xF88A5E, "Texas Instruments" },

34340 { 0xF88B37, "ARRIS Group, Inc." },

34341 { 0xF88C1C, "KAISHUN ELECTRONIC TECHNOLOGY CO., LTD. BEIJING" },

34342 { 0xF88C21, "TP-LINK TECHNOLOGIES CO.,LTD." },

34343 { 0xF88DEF, "Tenebraex" },

34344 { 0xF88E85, "Comtrend Corporation" },

34345 { 0xF88EA1, "Edgecore Networks Corporation" },

34346 { 0xF88F07, "Samsung Electronics Co.,Ltd" },

34347 { 0xF88FCA, "Google, Inc." },

34348 { 0xF89066, "Nain Inc." },

34349 { 0xF8912A, "GLP German Light Products GmbH" },

34350 { 0xF89173, "AEDLE SAS" },

34351 { 0xF893F3, "VOLANS" },

34352 { 0xF894C2, "Intel Corporate" },

34353 { 0xF89522, "HUAWEI TECHNOLOGIES CO.,LTD" },

34354 { 0xF89550, "Proton Products Chengdu Ltd" },

34355 { 0xF895C7, "LG Electronics (Mobile Communications)" },

34356 { 0xF895EA, "Apple, Inc." },

34357 { 0xF896FE, "LG Innotek" },

34358 { 0xF89725, "OPPLE LIGHTING CO., LTD" },

34359 { 0xF89753, "Huawei Device Co., Ltd." },

34360 { 0xF897A9, "Ericsson AB" },

34361 { 0xF897CF, "DAESHIN-INFORMATION TECHNOLOGY CO., LTD." },

34362 { 0xF8983A, "Leeman International (HongKong) Limited" },

34363 { 0xF898B9, "HUAWEI TECHNOLOGIES CO.,LTD" },

34364 { 0xF898EF, "HUAWEI TECHNOLOGIES CO.,LTD" },

34365 { 0xF89910, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

34366 { 0xF89955, "Fortress Technology Inc" },

34367 { 0xF89A25, "HUAWEI TECHNOLOGIES CO.,LTD" },

34368 { 0xF89A78, "HUAWEI TECHNOLOGIES CO.,LTD" },

34369 { 0xF89B6E, "Nokia Solutions and Networks GmbH & Co. KG" },

34370 { 0xF89D0D, "Control Technology Inc." },

34371 { 0xF89D9D, "Shenzhen MinewSemi Co.,LTD." },

34372 { 0xF89DBB, "Tintri" },

34373 { 0xF89E28, "Cisco Meraki" },

34374 { 0xF89E94, "Intel Corporate" },

34375 { 0xF89FB8, "YAZAKI Energy System Corporation" },

34376 { 0xF8A03D, "Dinstar Technologies Co., Ltd." },

34377 { 0xF8A097, "ARRIS Group, Inc." },

34378 { 0xF8A188, "LED Roadway Lighting" },

34379 { 0xF8A26D, "CANON INC." },

34380 { 0xF8A2B4, "RHEWA-WAAGENFABRIK August Freudewald GmbH &amp;Co. KG" },

34381 { 0xF8A2D6, "Liteon Technology Corporation" },

34382 { 0xF8A34F, "zte corporation" },

34383 { 0xF8A45F, "Xiaomi Communications Co Ltd" },

34384 { 0xF8A475, "PT Indoreka Jaya Wutama" },

34385 { 0xF8A4FB, "Nanjing Decowell Automation Co.,LTD" },

34386 { 0xF8A5C5, "Cisco Systems, Inc" },

34387 { 0xF8A73A, "Cisco Systems, Inc" },

34388 { 0xF8A763, "Zhejiang Tmall Technology Co., Ltd." },

34389 { 0xF8A91F, "ZVISION Technologies Co., Ltd" },

34390 { 0xF8A963, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

34391 { 0xF8A9D0, "LG Electronics (Mobile Communications)" },

34392 { 0xF8A9DE, "PUISSANCE PLUS" },

34393 { 0xF8AA3F, "DWnet Technologies(Suzhou) Corporation" },

34394 { 0xF8AA8A, "Axview Technology (Shenzhen) Co.,Ltd" },

34395 { 0xF8AAB3, "DESSMANN (China) Machinery & Electronic Co., Ltd" },

34396 { 0xF8AB05, "Sagemcom Broadband SAS" },

34397 { 0xF8AB82, "Xiaomi Communications Co Ltd" },

34398 { 0xF8ABE5, "shenzhen worldelite electronics co., LTD" },

34399 { 0xF8AC65, "Intel Corporate" },

34400 { 0xF8AC6D, "Deltenna Ltd" },

34401 { 0xF8ACC1, "InnoXings Co., LTD." },

34402 { 0xF8AD24, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

34403 { 0xF8ADCB, "HMD Global Oy" },

34404 { 0xF8AE27, "John Deere Electronic Solutions" },

34405 { 0xF8AF05, "Huawei Device Co., Ltd." },

34406 { 0xF8AFDB, "Fiberhome Telecommunication Technologies Co.,LTD" },

34407 { 0xF8B132, "HUAWEI TECHNOLOGIES CO.,LTD" },

34408 { 0xF8B156, "Dell Inc." },

34409 { 0xF8B1DD, "Apple, Inc." },

34410 { 0xF8B2F3, "GUANGZHOU BOSMA TECHNOLOGY CO.,LTD" },

34411 { 0xF8B46A, "Hewlett Packard" },

34412 { 0xF8B54D, "Intel Corporate" },

34413 { 0xF8B568, "IEEE Registration Authority" },

34414 { 0xF8B599, "Guangzhou CHNAVS Digital Technology Co.,Ltd" },

34415 { 0xF8B797, "NEC Platforms, Ltd." },

34416 { 0xF8B7E2, "Cisco Systems, Inc" },

34417 { 0xF8B8B4, "Shenzhen Skyworth Digital Technology CO., Ltd" },

34418 { 0xF8B95A, "LG Innotek" },

34419 { 0xF8BAE6, "Nokia" },

34420 { 0xF8BBBF, "eero inc." },

34421 { 0xF8BC0E, "eero inc." },

34422 { 0xF8BC12, "Dell Inc." },

34423 { 0xF8BC41, "Rosslare Enterprises Limited" },

34424 { 0xF8BE0D, "A2UICT Co.,Ltd." },

34425 { 0xF8BF09, "HUAWEI TECHNOLOGIES CO.,LTD" },

34426 { 0xF8C001, "Juniper Networks" },

34427 { 0xF8C091, "Highgates Technology" },

34428 { 0xF8C116, "Juniper Networks" },

34429 { 0xF8C120, "Xi'an Link-Science Technology Co.,Ltd" },

34430 { 0xF8C249, "AMPERE COMPUTING LLC" },

34431 { 0xF8C288, "Cisco Systems, Inc" },

34432 { 0xF8C372, "TSUZUKI DENKI" },

34433 { 0xF8C397, "NZXT Corp. Ltd." },

34434 { 0xF8C39E, "HUAWEI TECHNOLOGIES CO.,LTD" },

34435 { 0xF8C3CC, "Apple, Inc." },

34436 { 0xF8C4AE, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

34437 { 0xF8C4F3, "Shanghai Infinity Wireless Technologies Co.,Ltd." },

34438 { 0xF8C4FA, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

34439 { 0xF8C650, "Cisco Systems, Inc" },

34440 { 0xF8C678, "Carefusion" },

34441 { 0xF8C96C, "Fiberhome Telecommunication Technologies Co.,LTD" },

34442 { 0xF8CA59, "NetComm Wireless" },

34443 { 0xF8CA85, "NEC Corporation" },

34444 { 0xF8CAB8, "Dell Inc." },

34445 { 0xF8CC6E, "DEPO Electronics Ltd" },

34446 { 0xF8CDC8, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

34447 { 0xF8CE72, "Wistron Corporation" },

34448 { 0xF8CFC5, "Motorola Mobility LLC, a Lenovo Company" },

34449 { 0xF8D027, "Seiko Epson Corporation" },

34450 { 0xF8D0AC, "Sony Interactive Entertainment Inc." },

34451 { 0xF8D0BD, "Samsung Electronics Co.,Ltd" },

34452 { 0xF8D111, "TP-LINK TECHNOLOGIES CO.,LTD." },

34453 { 0xF8D2AC, "Vantiva USA LLC" },

34454 { 0xF8D3A9, "AXAN Networks" },

34455 { 0xF8D462, "Pumatronix Equipamentos Eletronicos Ltda." },

34456 { 0xF8D478, "Flextronics Tech.(Ind) Pvt Ltd" },

34457 { 0xF8D756, "Simm Tronic Limited" },

34458 { 0xF8D758, "Veratron AG" },

34459 { 0xF8D7BF, "REV Ritter GmbH" },

34460 { 0xF8D9B8, "Open Mesh, Inc." },

34461 { 0xF8DA0C, "Hon Hai Precision Ind. Co.,Ltd." },

34462 { 0xF8DADF, "EcoTech, Inc." },

34463 { 0xF8DAE2, "NDC Technologies" },

34464 { 0xF8DAF4, "Taishan Online Technology Co., Ltd." },

34465 { 0xF8DB4C, "PNY Technologies, INC." },

34466 { 0xF8DB7F, "HTC Corporation" },

34467 { 0xF8DB88, "Dell Inc." },

34468 { 0xF8DC7A, "Variscite LTD" },

34469 { 0xF8DE73, "HUAWEI TECHNOLOGIES CO.,LTD" },

34470 { 0xF8DF15, "Sunitec Enterprise Co.,Ltd" },

34471 { 0xF8DFA8, "zte corporation" },

34472 { 0xF8DFE1, "MyLight Systems" },

34473 { 0xF8E079, "Motorola Mobility LLC, a Lenovo Company" },

34474 { 0xF8E43B, "ASIX Electronics Corporation" },

34475 { 0xF8E44E, "MCOT INC." },

34476 { 0xF8E4A4, "Fiberhome Telecommunication Technologies Co.,LTD" },

34477 { 0xF8E4E3, "Intel Corporate" },

34478 { 0xF8E4FB, "Actiontec Electronics, Inc" },

34479 { 0xF8E57E, "Cisco Systems, Inc" },

34480 { 0xF8E5CE, "Apple, Inc." },

34481 { 0xF8E5CF, "CGI IT UK LIMITED" },

34482 { 0xF8E61A, "Samsung Electronics Co.,Ltd" },

34483 { 0xF8E71E, "Ruckus Wireless" },

34484 { 0xF8E7A0, "vivo Mobile Communication Co., Ltd." },

34485 { 0xF8E7B5, "µTech Tecnologia LTDA" },

34486 { 0xF8E811, "HUAWEI TECHNOLOGIES CO.,LTD" },

34487 { 0xF8E877, "Harman/Becker Automotive Systems GmbH" },

34488 { 0xF8E903, "D-Link International" },

34489 { 0xF8E94E, "Apple, Inc." },

34490 { 0xF8E94F, "Cisco Systems, Inc" },

34491 { 0xF8E968, "Egker Kft." },

34492 { 0xF8EA0A, "Dipl.-Math. Michael Rauch" },

34493 { 0xF8EDA5, "ARRIS Group, Inc." },

34494 { 0xF8EDAE, "MOBIWIRE MOBILES(NINGBO) CO.,LTD" },

34495 { 0xF8F005, "Newport Media Inc." },

34496 { 0xF8F014, "RackWare Inc." },

34497 { 0xF8F082, "NAGTECH LLC" },

34498 { 0xF8F09D, "Hangzhou Prevail Communication Technology Co., Ltd" },

34499 { 0xF8F0C5, "Suzhou Kuhan Information Technologies Co.,Ltd." },

34500 { 0xF8F1B6, "Motorola Mobility LLC, a Lenovo Company" },

34501 { 0xF8F1E6, "Samsung Electronics Co.,Ltd" },

34502 { 0xF8F21E, "Intel Corporate" },

34503 { 0xF8F25A, "G-Lab GmbH" },

34504 { 0xF8F464, "Rawe Electonic GmbH" },

34505 { 0xF8F519, "Rulogic Inc." },

34506 { 0xF8F532, "ARRIS Group, Inc." },

34507 { 0xF8F7B9, "HUAWEI TECHNOLOGIES CO.,LTD" },

34508 { 0xF8F7D3, "International Communications Corporation" },

34509 { 0xF8F7FF, "SYN-TECH SYSTEMS INC" },

34510 { 0xF8FB2F, "Santur Corporation" },

34511 { 0xF8FB90, "Texas Instruments" },

34512 { 0xF8FCE1, "Amazon Technologies Inc." },

34513 { 0xF8FE5C, "Reciprocal Labs Corp" },

34514 { 0xF8FE5E, "Intel Corporate" },

34515 { 0xF8FEA8, "Technico Japan Corporation" },

34516 { 0xF8FF0B, "Electronic Technology Inc." },

34517 { 0xF8FF5F, "Shenzhen Communication Technology Co.,Ltd" },

34518 { 0xF8FFC2, "Apple, Inc." },

34519 { 0xFC0012, "Toshiba Samsung Storage Technolgoy Korea Corporation" },

34520 { 0xFC017C, "Hon Hai Precision Ind. Co.,Ltd." },

34521 { 0xFC019E, "VIEVU" },

34522 { 0xFC01CD, "FUNDACION TEKNIKER" },

34523 { 0xFC0296, "Xiaomi Communications Co Ltd" },

34524 { 0xFC039F, "Samsung Electronics Co.,Ltd" },

34525 { 0xFC041C, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

34526 { 0xFC0647, "Cortland Research, LLC" },

34527 { 0xFC06ED, "M2Motive Technology Inc." },

34528 { 0xFC0736, "Huawei Device Co., Ltd." },

34529 { 0xFC07A0, "LRE Medical GmbH" },

34530 { 0xFC084A, "FUJITSU LIMITED" },

34531 { 0xFC0877, "Prentke Romich Company" },

34532 { 0xFC09D8, "ACTEON Group" },

34533 { 0xFC09F6, "GUANGDONG TONZE ELECTRIC CO.,LTD" },

34534 { 0xFC0A81, "Extreme Networks Headquarters" },

34535 { 0xFC0C45, "Shenzhen SuperElectron Technology Co.,Ltd." },

34536 { 0xFC0F4B, "Texas Instruments" },

34537 { 0xFC0FE6, "Sony Interactive Entertainment Inc." },

34538 { 0xFC0FE7, "Microchip Technology Inc." },

34539 { 0xFC101A, "Palo Alto Networks" },

34540 { 0xFC10BD, "Control Sistematizado S.A." },

34541 { 0xFC10C6, "Taicang T&W Electronics" },

34542 { 0xFC1165, "Cambium Networks Limited" },

34543 { 0xFC1186, "Logic3 plc" },

34544 { 0xFC1193, "HUAWEI TECHNOLOGIES CO.,LTD" },

34545 { 0xFC122C, "HUAWEI TECHNOLOGIES CO.,LTD" },

34546 { 0xFC1263, "ASKEY COMPUTER CORP" },

34547 { 0xFC1349, "Global Apps Corp." },

34548 { 0xFC13F0, "Bouffalo Lab (Nanjing) Co., Ltd." },

34549 { 0xFC1499, "Aimore Acoustics Incorporation" },

34550 { 0xFC15B4, "Hewlett Packard" },

34551 { 0xFC1607, "Taian Technology(Wuxi) Co.,Ltd." },

34552 { 0xFC1794, "InterCreative Co., Ltd" },

34553 { 0xFC1803, "HUAWEI TECHNOLOGIES CO.,LTD" },

34554 { 0xFC183C, "Apple, Inc." },

34555 { 0xFC1910, "Samsung Electronics Co.,Ltd" },

34556 { 0xFC1928, "Actions Microelectronics Co., Ltd" },

34557 { 0xFC1999, "Xiaomi Communications Co Ltd" },

34558 { 0xFC19D0, "Cloud Vision Networks Technology Co.,Ltd." },

34559 { 0xFC1A11, "vivo Mobile Communication Co., Ltd." },

34560 { 0xFC1BD1, "HUAWEI TECHNOLOGIES CO.,LTD" },

34561 { 0xFC1BFF, "V-ZUG AG" },

34562 { 0xFC1CA1, "Nokia" },

34563 { 0xFC1D2A, "vivo Mobile Communication Co., Ltd." },

34564 { 0xFC1D3A, "HUAWEI TECHNOLOGIES CO.,LTD" },

34565 { 0xFC1D43, "Apple, Inc." },

34566 { 0xFC1D59, "I Smart Cities HK Ltd" },

34567 { 0xFC1D84, "Autobase" },

34568 { 0xFC1E16, "IPEVO corp" },

34569 { 0xFC1F19, "SAMSUNG ELECTRO MECHANICS CO., LTD." },

34570 { 0xFC1FC0, "EURECAM" },

34571 { 0xFC229C, "Han Kyung I Net Co.,Ltd." },

34572 { 0xFC22D3, "FDSYS" },

34573 { 0xFC22F4, "Zyxel Communications Corporation" },

34574 { 0xFC2325, "EosTek (Shenzhen) Co., Ltd." },

34575 { 0xFC253F, "Apple, Inc." },

34576 { 0xFC27A2, "TRANS ELECTRIC CO., LTD." },

34577 { 0xFC29E3, "Infinix mobility limited" },

34578 { 0xFC29F3, "McPay Co.,LTD." },

34579 { 0xFC2A46, "Realme Chongqing Mobile Telecommunications Corp.,Ltd." },

34580 { 0xFC2A54, "Connected Data, Inc." },

34581 { 0xFC2A9C, "Apple, Inc." },

34582 { 0xFC2BB2, "Actiontec Electronics, Inc" },

34583 { 0xFC2CFD, "dormakaba Canada Inc. - Keyscan" },

34584 { 0xFC2D5E, "zte corporation" },

34585 { 0xFC2E19, "China Mobile Group Device Co.,Ltd." },

34586 { 0xFC2E2D, "Lorom Industrial Co.LTD." },

34587 { 0xFC2F40, "Calxeda, Inc." },

34588 { 0xFC2F6B, "Everspin Technologies, Inc." },

34589 { 0xFC2FAA, "Nokia" },

34590 { 0xFC2FEF, "UTT Technologies Co., Ltd." },

34591 { 0xFC315D, "Apple, Inc." },

34592 { 0xFC3288, "CELOT Wireless Co., Ltd" },

34593 { 0xFC3342, "Juniper Networks" },

34594 { 0xFC3357, "KAGA FEI Co., Ltd." },

34595 { 0xFC335F, "Polyera" },

34596 { 0xFC3497, "ASUSTek COMPUTER INC." },

34597 { 0xFC34E2, "Shenzhen YOUHUA Technology Co., Ltd" },

34598 { 0xFC3598, "Favite Inc." },

34599 { 0xFC35E6, "Visteon Corporation" },

34600 { 0xFC372B, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

34601 { 0xFC386A, "Shenzhen Skyworth Digital Technology CO., Ltd" },

34602 { 0xFC38C4, "China Grand Communications Co.,Ltd." },

34603 { 0xFC3964, "ITEL MOBILE LIMITED" },

34604 { 0xFC3CD7, "Tuya Smart Inc." },

34605 { 0xFC3CE9, "Tsingtong Technologies Co, Ltd." },

34606 { 0xFC3D93, "LONGCHEER TELECOMMUNICATION LIMITED" },

34607 { 0xFC3DA5, "Arcadyan Corporation" },

34608 { 0xFC3F7C, "HUAWEI TECHNOLOGIES CO.,LTD" },

34609 { 0xFC3FA6, "eero inc." },

34610 { 0xFC3FAB, "Henan Lanxin Technology Co., Ltd" },

34611 { 0xFC3FDB, "Hewlett Packard" },

34612 { 0xFC4009, "zte corporation" },

34613 { 0xFC4203, "Samsung Electronics Co.,Ltd" },

34614 { 0xFC4265, "Zhejiang Tmall Technology Co., Ltd." },

34615 { 0xFC4463, "Universal Audio, Inc" },

34616 { 0xFC4482, "Intel Corporate" },

34617 { 0xFC4499, "Swarco LEA d.o.o." },

34618 { 0xFC449F, "zte corporation" },

34619 { 0xFC455F, "JIANGXI SHANSHUI OPTOELECTRONIC TECHNOLOGY CO.,LTD" },

34620 { 0xFC4596, "COMPAL INFORMATION (KUNSHAN) CO., LTD." },

34621 { 0xFC45C3, "Texas Instruments" },

34622 { 0xFC478D, "SHENZHEN TOPWELL TECHNOLOGY CO., LTD." },

34623 { 0xFC47D8, "Apple, Inc." },

34624 { 0xFC48C9, "Yobiiq Intelligence B.V." },

34625 { 0xFC48EF, "HUAWEI TECHNOLOGIES CO.,LTD" },

34626 { 0xFC492D, "Amazon Technologies Inc." },

34627 { 0xFC4AE9, "Castlenet Technology Inc." },

34628 { 0xFC4B1C, "INTERSENSOR S.R.L." },

34629 { 0xFC4B57, "Peerless Instrument Division of Curtiss-Wright" },

34630 { 0xFC4BBC, "Sunplus Technology Co., Ltd." },

34631 { 0xFC4D8C, "SHENZHEN PANTE ELECTRONICS TECHNOLOGY CO., LTD" },

34632 { 0xFC4DA6, "HUAWEI TECHNOLOGIES CO.,LTD" },

34633 { 0xFC4DD4, "Universal Global Scientific Industrial Co., Ltd." },

34634 { 0xFC4EA4, "Apple, Inc." },

34635 { 0xFC500C, "Sitehop Ltd" },

34636 { 0xFC5090, "SIMEX Sp. z o.o." },

34637 { 0xFC51A4, "ARRIS Group, Inc." },

34638 { 0xFC51B5, "HUAWEI TECHNOLOGIES CO.,LTD" },

34639 { 0xFC528D, "Vantiva USA LLC" },

34640 { 0xFC52CE, "Control iD" },

34641 { 0xFC539E, "Shanghai Wind Technologies Co.,Ltd" },

34642 { 0xFC5557, "Apple, Inc." },

34643 { 0xFC55DC, "Baltic Latvian Universal Electronics LLC" },

34644 { 0xFC5703, "Hisense broadband multimedia technology Co.,Ltd" },

34645 { 0xFC584A, "xiamenshi c-chip technology co., ltd" },

34646 { 0xFC589A, "Cisco Systems, Inc" },

34647 { 0xFC58DF, "Interphone Service" },

34648 { 0xFC58FA, "Shen Zhen Shi Xin Zhong Xin Technology Co.,Ltd." },

34649 { 0xFC599F, "Ruijie Networks Co.,LTD" },

34650 { 0xFC59C0, "Arista Networks" },

34651 { 0xFC5A1D, "Hitron Technologies. Inc" },

34652 { 0xFC5B24, "Weibel Scientific A/S" },

34653 { 0xFC5B26, "MikroBits" },

34654 { 0xFC5B39, "Cisco Systems, Inc" },

34655 { 0xFC5B8C, "Xiaomi Communications Co Ltd" },

34656 { 0xFC5C45, "Ruckus Wireless" },

34657 { 0xFC5CEE, "LCFC(Hefei) Electronics Technology co., ltd" },

34658 { 0xFC5F49, "Zhejiang Dahua Technology Co., Ltd." },

34659 { 0xFC6018, "Zhejiang Kangtai Electric Co., Ltd." },

34660 { 0xFC609B, "New H3C Technologies Co., Ltd" },

34661 { 0xFC6179, "IEEE Registration Authority" },

34662 { 0xFC6198, "NEC Personal Products, Ltd" },

34663 { 0xFC61E9, "Fiberhome Telecommunication Technologies Co.,LTD" },

34664 { 0xFC626E, "Beijing MDC Telecom" },

34665 { 0xFC62B9, "ALPSALPINE CO,.LTD" },

34666 { 0xFC643A, "Samsung Electronics Co.,Ltd" },

34667 { 0xFC64BA, "Xiaomi Communications Co Ltd" },

34668 { 0xFC65B3, "Huawei Device Co., Ltd." },

34669 { 0xFC65DE, "Amazon Technologies Inc." },

34670 { 0xFC66CF, "Apple, Inc." },

34671 { 0xFC671F, "Tuya Smart Inc." },

34672 { 0xFC683E, "Directed Perception, Inc" },

34673 { 0xFC6947, "Texas Instruments" },

34674 { 0xFC698C, "ANDREAS STIHL AG & Co. KG" },

34675 { 0xFC6A1C, "Mellanox Technologies, Inc." },

34676 { 0xFC6BF0, "TOPWELL INTERNATIONAL HOLDINDS LIMITED" },

34677 { 0xFC6C31, "LXinstruments GmbH" },

34678 { 0xFC6DC0, "BME CORPORATION" },

34679 { 0xFC6DD1, "APRESIA Systems, Ltd." },

34680 { 0xFC6FB7, "ARRIS Group, Inc." },

34681 { 0xFC702E, "Sichuan AI-Link Technology Co., Ltd." },

34682 { 0xFC71FA, "Trane Technologies" },

34683 { 0xFC73FB, "HUAWEI TECHNOLOGIES CO.,LTD" },

34684 { 0xFC7516, "D-Link International" },

34685 { 0xFC75E6, "Handreamnet" },

34686 { 0xFC7692, "Semptian Co.,Ltd." },

34687 { 0xFC7774, "Intel Corporate" },

34688 { 0xFC777B, "Hitron Technologies. Inc" },

34689 { 0xFC790B, "Hitachi High Technologies America, Inc." },

34690 { 0xFC7A58, "Shenzhen Skyworth Digital Technology CO., Ltd" },

34691 { 0xFC7C02, "Phicomm (Shanghai) Co., Ltd." },

34692 { 0xFC7CE7, "FCI USA LLC" },

34693 { 0xFC7D6C, "HYESUNG TECHWIN Co., Ltd" },

34694 { 0xFC7F56, "CoSyst Control Systems GmbH" },

34695 { 0xFC7FF1, "Aruba, a Hewlett Packard Enterprise Company" },

34696 { 0xFC8329, "Trei technics" },

34697 { 0xFC8399, "Avaya Inc" },

34698 { 0xFC83C6, "N-Radio Technologies Co., Ltd." },

34699 { 0xFC8417, "Honor Device Co., Ltd." },

34700 { 0xFC84A7, "Murata Manufacturing Co., Ltd." },

34701 { 0xFC8596, "Axonne Inc." },

34702 { 0xFC862A, "Huawei Device Co., Ltd." },

34703 { 0xFC8743, "HUAWEI TECHNOLOGIES CO.,LTD" },

34704 { 0xFC8A3D, "zte corporation" },

34705 { 0xFC8AF7, "zte corporation" },

34706 { 0xFC8B97, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

34707 { 0xFC8C11, "Microsoft Corporation" },

34708 { 0xFC8D13, "FUJIAN STAR-NET COMMUNICATION CO.,LTD" },

34709 { 0xFC8D3D, "Leapfive Tech. Ltd." },

34710 { 0xFC8E5B, "China Mobile Iot Limited company" },

34711 { 0xFC8E6E, "StreamCCTV, LLC" },

34712 { 0xFC8E7E, "ARRIS Group, Inc." },

34713 { 0xFC8F7D, "SHENZHEN GONGJIN ELECTRONICS CO.,LT" },

34714 { 0xFC8F90, "Samsung Electronics Co.,Ltd" },

34715 { 0xFC8FC4, "Intelligent Technology Inc." },

34716 { 0xFC90FA, "Independent Technologies" },

34717 { 0xFC9114, "Vantiva USA LLC" },

34718 { 0xFC9189, "Sichuan Tianyi Comheart Telecom Co.,LTD" },

34719 { 0xFC923B, "Nokia Corporation" },

34720 { 0xFC9257, "Renesas Electronics (Penang) Sdn. Bhd." },

34721 { 0xFC936B, "Samsung Electronics Co.,Ltd" },

34722 { 0xFC9435, "HUAWEI TECHNOLOGIES CO.,LTD" },

34723 { 0xFC946C, "UBIVELOX" },

34724 { 0xFC94CE, "zte corporation" },

34725 { 0xFC94E3, "Vantiva USA LLC" },

34726 { 0xFC956A, "OCTAGON SYSTEMS CORP." },

34727 { 0xFC9643, "Juniper Networks" },

34728 { 0xFC97A8, "Cricut Inc." },

34729 { 0xFC9947, "Cisco Systems, Inc" },

34730 { 0xFC9AFA, "Motus Global Inc." },

34731 { 0xFC9BC6, "Sumavision Technologies Co.,Ltd" },

34732 { 0xFC9BD4, "EdgeQ" },

34733 { 0xFC9C98, "Arlo Technology" },

34734 { 0xFC9CA7, "Apple, Inc." },

34735 { 0xFC9DD8, "Beijing TongTongYiLian Science and Technology Ltd." },

34736 { 0xFC9FAE, "Fidus Systems Inc" },

34737 { 0xFC9FE1, "CONWIN.Tech. Ltd" },

34738 { 0xFC9FFD, "Hangzhou Hikvision Digital Technology Co.,Ltd." },

34739 { 0xFCA05A, "Oray.com co., LTD." },

34740 { 0xFCA0F3, "HUAWEI TECHNOLOGIES CO.,LTD" },

34741 { 0xFCA13E, "Samsung Electronics Co.,Ltd" },

34742 { 0xFCA183, "Amazon Technologies Inc." },

34743 { 0xFCA22A, "PT. Callysta Multi Engineering" },

34744 { 0xFCA386, "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD" },

34745 { 0xFCA47A, "IEEE Registration Authority" },

34746 { 0xFCA5D0, "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD" },

34747 { 0xFCA621, "Samsung Electronics Co.,Ltd" },

34748 { 0xFCA64C, "Alibaba cloud computing Co., Ltd" },

34749 { 0xFCA667, "Amazon Technologies Inc." },

34750 { 0xFCA6CD, "Fiberhome Telecommunication Technologies Co.,LTD" },

34751 { 0xFCA841, "Avaya Inc" },

34752 { 0xFCA84A, "Sentinum GmbH" },

34753 { 0xFCA89A, "Sunitec Enterprise Co.,Ltd" },

34754 { 0xFCA89B, "Texas Instruments" },

34755 { 0xFCA8E0, "THE FURUKAWA ELECTRIC CO., LTD" },

34756 { 0xFCA9B0, "MIARTECH (SHANGHAI),INC." },

34757 { 0xFCA9DC, "Renesas Electronics (Penang) Sdn. Bhd." },

34758 { 0xFCA9F5, "Xiaomi Communications Co Ltd" },

34759 { 0xFCAA14, "GIGA-BYTE TECHNOLOGY CO.,LTD." },

34760 { 0xFCAA81, "Apple, Inc." },

34761 { 0xFCAAB6, "Samsung Electronics Co.,Ltd" },

34762 { 0xFCAB90, "HUAWEI TECHNOLOGIES CO.,LTD" },

34763 { 0xFCAD0F, "QTS NETWORKS" },

34764 { 0xFCAE34, "ARRIS Group, Inc." },

34765 { 0xFCAF6A, "Qulsar Inc" },

34766 { 0xFCAFAC, "Socionext Inc." },

34767 { 0xFCAFBE, "TireCheck GmbH" },

34768 { 0xFCB0C4, "Shanghai DareGlobal Technologies Co.,Ltd" },

34769 { 0xFCB0DE, "CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD." },

34770 { 0xFCB10D, "Shenzhen Tian Kun Technology Co.,LTD." },

34771 { 0xFCB2D6, "CIG SHANGHAI CO LTD" },

34772 { 0xFCB3BC, "Intel Corporate" },

34773 { 0xFCB467, "Espressif Inc." },

34774 { 0xFCB4E6, "ASKEY COMPUTER CORP" },

34775 { 0xFCB585, "Shenzhen Water World Information Co.,Ltd." },

34776 { 0xFCB58A, "Wapice Ltd." },

34777 { 0xFCB662, "IC Holdings LLC" },

34778 { 0xFCB698, "Cambridge Industries(Group) Co.,Ltd." },

34779 { 0xFCB69D, "Zhejiang Dahua Technology Co., Ltd." },

34780 { 0xFCB6D8, "Apple, Inc." },

34781 { 0xFCB7F0, "Idaho National Laboratory" },

34782 { 0xFCB97E, "GE Appliances" },

34783 { 0xFCB9DF, "Motorola Mobility LLC, a Lenovo Company" },

34784 { 0xFCBBA1, "Shenzhen Minicreate Technology Co.,Ltd" },

34785 { 0xFCBC0E, "Zhejiang Cainiao Supply Chain Management Co., Ltd" },

34786 { 0xFCBC9C, "Vimar Spa" },

34787 { 0xFCBCD1, "HUAWEI TECHNOLOGIES CO.,LTD" },

34788 { 0xFCBD67, "Arista Networks" },

34789 { 0xFCBE7B, "vivo Mobile Communication Co., Ltd." },

34790 { 0xFCC0CC, "Yunke China Information Technology Limited" },

34791 { 0xFCC233, "ASUSTek COMPUTER INC." },

34792 { 0xFCC23D, "Atmel Corporation" },

34793 { 0xFCC2DE, "Murata Manufacturing Co., Ltd." },

34794 { 0xFCC734, "Samsung Electronics Co.,Ltd" },

34795 { 0xFCC737, "Shaanxi Gangsion Electronic Technology Co., Ltd" },

34796 { 0xFCC897, "zte corporation" },

34797 { 0xFCCAC4, "LifeHealth, LLC" },

34798 { 0xFCCCE4, "Ascon Ltd." },

34799 { 0xFCCD2F, "IEEE Registration Authority" },

34800 { 0xFCCF43, "HUIZHOU CITY HUIYANG DISTRICT MEISIQI INDUSTRY DEVELOPMENT CO,.LTD" },

34801 { 0xFCCF62, "IBM Corp" },

34802 { 0xFCD290, "SKY UK LIMITED" },

34803 { 0xFCD2B6, "IEEE Registration Authority" },

34804 { 0xFCD436, "Motorola Mobility LLC, a Lenovo Company" },

34805 { 0xFCD4F2, "The Coca Cola Company" },

34806 { 0xFCD4F6, "Messana Air.Ray Conditioning s.r.l." },

34807 { 0xFCD586, "Shenzhen SuperElectron Technology Co.,Ltd." },

34808 { 0xFCD5D9, "Shenzhen SDMC Technology CO.,Ltd." },

34809 { 0xFCD6BD, "Robert Bosch GmbH" },

34810 { 0xFCD733, "TP-LINK TECHNOLOGIES CO.,LTD." },

34811 { 0xFCD749, "Amazon Technologies Inc." },

34812 { 0xFCD817, "Beijing Hesun Technologies Co.Ltd." },

34813 { 0xFCD848, "Apple, Inc." },

34814 { 0xFCD908, "Xiaomi Communications Co Ltd" },

34815 { 0xFCDB21, "SAMSARA NETWORKS INC" },

34816 { 0xFCDB96, "ENERVALLEY CO., LTD" },

34817 { 0xFCDBB3, "Murata Manufacturing Co., Ltd." },

34818 { 0xFCDC4A, "G-Wearables Corp." },

34819 { 0xFCDD55, "Shenzhen WeWins wireless Co.,Ltd" },

34820 { 0xFCDE90, "Samsung Electronics Co.,Ltd" },

34821 { 0xFCDF00, "GD Midea Air-Conditioning Equipment Co.,Ltd." },

34822 { 0xFCE14F, "BRK Brands, Inc." },

34823 { 0xFCE186, "A3M Co., LTD" },

34824 { 0xFCE192, "Sichuan Jinwangtong Electronic Science&Technology Co,.Ltd" },

34825 { 0xFCE1D9, "Stable Imaging Solutions LLC" },

34826 { 0xFCE1FB, "Array Networks" },

34827 { 0xFCE23F, "CLAY PAKY SPA" },

34828 { 0xFCE26C, "Apple, Inc." },

34829 { 0xFCE33C, "HUAWEI TECHNOLOGIES CO.,LTD" },

34830 { 0xFCE557, "Nokia Corporation" },

34831 { 0xFCE66A, "Industrial Software Co" },

34832 { 0xFCE806, "Edifier International" },

34833 { 0xFCE892, "Hangzhou Lancable Technology Co.,Ltd" },

34834 { 0xFCE8C0, "Espressif Inc." },

34835 { 0xFCE998, "Apple, Inc." },

34836 { 0xFCE9D8, "Amazon Technologies Inc." },

34837 { 0xFCEA50, "Integrated Device Technology (Malaysia) Sdn. Bhd." },

34838 { 0xFCECDA, "Ubiquiti Inc" },

34839 { 0xFCEDB9, "Arrayent" },

34840 { 0xFCEEE6, "FORMIKE ELECTRONIC CO., LTD" },

34841 { 0xFCF136, "Samsung Electronics Co.,Ltd" },

34842 { 0xFCF152, "Sony Corporation" },

34843 { 0xFCF1CD, "OPTEX-FA CO.,LTD." },

34844 { 0xFCF29F, "China Mobile Iot Limited company" },

34845 { 0xFCF528, "Zyxel Communications Corporation" },

34846 { 0xFCF5C4, "Espressif Inc." },

34847 { 0xFCF647, "Fiberhome Telecommunication Technologies Co.,LTD" },

34848 { 0xFCF738, "HUAWEI TECHNOLOGIES CO.,LTD" },

34849 { 0xFCF763, "KunGao Micro (JiangSu) Co., LTd" },

34850 { 0xFCF77B, "Huawei Device Co., Ltd." },

34851 { 0xFCF8AE, "Intel Corporate" },

34852 { 0xFCF8B7, "TRONTEQ Electronic" },

34853 { 0xFCFA21, "zte corporation" },

34854 { 0xFCFAF7, "Shanghai Baud Data Communication Co.,Ltd." },

34855 { 0xFCFBFB, "Cisco Systems, Inc" },

34856 { 0xFCFC48, "Apple, Inc." },

34857 { 0xFCFE77, "Hitachi Reftechno, Inc." },

34858 { 0xFCFEC2, "Invensys Controls UK Limited" },

34859 { 0xFCFFAA, "IEEE Registration Authority" },

34860 { 0xFFFFFF, NULL } /* Since XEROX CORPORATION has value 0, use this */

34861};

34862

34863static size_t num_oui_values = 34841;

34864

34865/*

34866 * Comparision routine needed by bsearch() routines.

34867 *

34868 * This function MUST be 'cdecl' except for OpenWatcom.

34869 */

34870#ifdef __WATCOMC__

34871 #define CALL_CONV

34872#else

34873 #define CALL_CONV cdecl

34874#endif

34875

34876static int CALL_CONV compare (const void *_a, const void *_b)

34877{

34878 const struct tok *a = _a;

34879 const struct tok *b = _b;

34880

34881 if (a->v > b->v)

34882 return (1);

34883 if (a->v < b->v)

34884 return (-1);

34885 return (0);

34886}

34887

34888const char *oui_val_to_name (unsigned oui)

34889{

34890 const struct tok *t = bsearch (&oui, oui_values, num_oui_values, sizeof(*t), compare);

34891 return (t ? t->s : "Unknown OUI");

34892}

tok

Definition: oui-generated.c:13

Generated by 1.9.6


Watt-32 tcp/ip: E:/WATT/src/packet32.c Source File

  • src
packet32.c
1/*
2 * Copyright (c) 1999 - 2003
3 * Politecnico di Torino. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the Politecnico
13 * di Torino, and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 */
21
22 /*
23 * Changes for Watt-32:
24 * - Merged Packet32.c and AdInfo.c into one.
25 * - Rewritten for ASCII function (no Unicode).
26 * - Lots of simplifications.
27 */
28#include "wattcp.h"
29
30#if defined(WIN32) /* Rest of file */
31
32#include <windows.h>
33#include <windowsx.h> /* GlobalAllocPtr() */
34#include <sys/socket.h> /* AF_INET etc. */
35#include <process.h>
36
37#include "misc.h"
38#include "misc_str.h"
39#include "timer.h"
40#include "profile.h"
41#include "pcconfig.h"
42#include "pcdbug.h"
43#include "pcpkt.h"
44#include "netaddr.h"
45#include "w32_ndis.h"
46#include "cpumodel.h"
47#include "packet32.h"
48#include "winpkt.h"
49#include "win_dll.h"
50
51#if !defined(__ORANGEC__)
52 #include <winsvc.h> /* SERVICE_ALL_ACCESS... */
53#else
54 #define HandleToULong(h) ((ULONG)(ULONG_PTR)(h))
55#endif
56
57#if 0
58 #define GlobalAllocPtr_FLAGS (GMEM_MOVEABLE | GMEM_ZEROINIT)
59#else
60 #define GlobalAllocPtr_FLAGS GPTR /* == 'GMEM_FIXED | GMEM_ZEROINIT'. */
61#endif
62
66static char npf_drv_ver[64] = "Unknown npf.sys version";
67static char npcap_drv_ver[64] = "Unknown npcap.sys version";
68
72static const char NPF_service_name[] = "NPF";
73static const char NPF_service_descr[] = "Netgroup Packet Filter";
74static const char NPF_registry_location[] = "SYSTEM\\CurrentControlSet\\Services\\NPF";
75static const char NPF_prefix[] = "\\Device\\NPF_";
76static const char NPF_driver_path[] = "system32\\drivers\\npf.sys";
77static const char NPF_virtual_path[] = "sysnative\\drivers\\npf.sys";
78
82static const char NPCAP_service_name[] = "NPCap";
83static const char NPCAP_service_descr[] = "Npcap Packet Driver";
84static const char NPCAP_registry_location[] = "SYSTEM\\CurrentControlSet\\Services\\npcap";
85static const char NPCAP_registry_params[] = "SYSTEM\\CurrentControlSet\\Services\\npcap\\Parameters";
86static const char NPCAP_prefix[] = "\\Device\\NPCAP_"; // or "\\\\.\\Global\\NPCAP_" ?
87static const char NPCAP_driver_path[] = "system32\\drivers\\npcap.sys";
88static const char NPCAP_virtual_path[] = "sysnative\\drivers\\npcap.sys";
89
93static const char Win10Pcap_service_name[] = "Win10Pcap";
94static const char Win10Pcap_service_descr[] = "Win10Pcap Packet Capture Driver";
95static const char Win10Pcap_registry_location[] = "SYSTEM\\ControlSet\\Services\\Win10Pcap";
96static const char Win10Pcap_prefix[] = "\\Device\\WTCAP_A_";
97static const char Win10Pcap_driver_path[] = "system32\\drivers\\win10pcap.sys";
98static const char Win10Pcap_virtual_path[] = "sysnative\\drivers\\win10pcap.sys";
99
103static const char *service_name = NPF_service_name;
104static const char *service_descr = NPF_service_descr;
105static const char *registry_location = NPF_registry_location;
106static const char *driver_prefix = NPF_prefix;
107static const char *driver_path = NPF_driver_path;
108static const char *virtual_path = NPF_virtual_path;
109
110
111#define ADD_VALUE(v) { v, #v }
112
113static const struct search_list serv_stat[] = {
114 ADD_VALUE (SERVICE_CONTINUE_PENDING),
115 ADD_VALUE (SERVICE_PAUSE_PENDING),
116 ADD_VALUE (SERVICE_PAUSED),
117 ADD_VALUE (SERVICE_RUNNING),
118 ADD_VALUE (SERVICE_START_PENDING),
119 ADD_VALUE (SERVICE_STOP_PENDING),
120 ADD_VALUE (SERVICE_STOPPED)
121 };
122
123#define DEVICE_PREFIX "\\Device\\"
124
125/*
126 * The {4D36E972-E325-11CE-BFC1-08002BE10318} subkey represents the class
127 * of network adapter devices that the system supports.
128 */
129#define ADAPTER_KEY_CLASS \
130 "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
131
132
137static ADAPTER_INFO *adapters_list = NULL;
138
144static HANDLE adapters_mutex = INVALID_HANDLE_VALUE;
145
150static BOOL use_wanpacket = FALSE;
151
155static BOOL have_npcap = FALSE;
156
160static BOOL have_win10pcap = FALSE;
161
162static BOOL PopulateAdaptersInfoList (void);
163static BOOL FreeAdaptersInfoList (void);
164
165static void set_char_pointers (const char *adapter)
166{
167 size_t len = strlen (Win10Pcap_prefix);
168
169 if (!strnicmp(adapter, Win10Pcap_prefix, len))
170 have_win10pcap = TRUE;
171
172 if (have_win10pcap)
173 {
174 service_name = Win10Pcap_service_name;
175 service_descr = Win10Pcap_service_descr;
176 registry_location = Win10Pcap_registry_location;
177 driver_prefix = Win10Pcap_prefix;
178 driver_path = Win10Pcap_driver_path;
179 virtual_path = Win10Pcap_virtual_path;
180 }
181 else if (have_npcap)
182 {
183 service_name = NPCAP_service_name;
184 service_descr = NPCAP_service_descr;
185 registry_location = NPCAP_registry_location;
186 driver_prefix = NPCAP_prefix;
187 driver_path = NPCAP_driver_path;
188 virtual_path = NPCAP_virtual_path;
189 }
190 else
191 {
192 service_name = NPF_service_name;
193 service_descr = NPF_service_descr;
194 registry_location = NPF_registry_location;
195 driver_prefix = NPF_prefix;
196 driver_path = NPF_driver_path;
197 virtual_path = NPF_virtual_path;
198 }
199}
200
201#if defined(USE_DEBUG)
213 static void PacketDumpRegistryKey (const char *key_name, const char *file_name)
214 {
215 char command[256];
216
217 /* Let regedit do the dirty work for us
218 */
219 SNPRINTF (command, sizeof(command), "regedit /e %s %s", file_name, key_name);
220 system (command);
221 }
222#endif
223
224/*
225 * Allow 64-bit applications to access redirected keys in the 32-bit registry view.
226 * Ref: https://learn.microsoft.com/en-us/windows/win32/winprog64/accessing-an-alternate-registry-view
227 */
228static REGSAM reg_read_access (void)
229{
230 REGSAM access = KEY_READ;
231
232#ifdef _WIN64
233 access |= KEY_WOW64_32KEY;
234#endif
235 return (access);
236}
237
238/*
239 * The get_file_version() fails under Win-Vista+ since files under
240 * '"%SystemRoot%\system32\drivers' are hidden from non-admin users.
241 * So this function is used instead. I assume the true file-version of
242 * NPF.sys is the same as "DisplayVersion" in Registry.
243 */
244static BOOL get_npf_ver_from_registry (char *ret_ver, size_t ver_size)
245{
246 char str[100];
247 BOOL rc = FALSE;
248 DWORD size = sizeof(str);
249 HKEY key = NULL;
250 LONG status;
251
252 status = RegOpenKeyEx (HKEY_LOCAL_MACHINE,
253 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\WinPcapInst",
254 0, reg_read_access(), &key);
255
256 /* Note: WinPcap may be installed and working even though this key doesn't exist.
257 */
258 if (status != ERROR_SUCCESS)
259 {
260 WINPKT_TRACE ("status: %ld; %s\n", (long)status, win_strerror(GetLastError()));
261 goto fail;
262 }
263
264 status = RegQueryValueEx (key, "DisplayVersion", NULL, NULL, (BYTE*)&str, &size);
265 if (status != ERROR_SUCCESS)
266 {
267 WINPKT_TRACE ("status: %ld; %s\n", (long)status, win_strerror(GetLastError()));
268 goto fail;
269 }
270
271 _strlcpy (ret_ver, str, ver_size);
272 rc = TRUE;
273
274fail:
275 if (key)
276 RegCloseKey (key);
277 return (rc);
278}
279
280/*
281 * Similar to `get_npf_ver_from_registry()`. But for a NPcap installation.
282 */
283static BOOL get_npcap_ver_from_registry (char *ret_ver, size_t ver_size)
284{
285 char str[100];
286 BOOL rc = FALSE;
287 DWORD size = sizeof(str);
288 HKEY key = NULL;
289 LONG status;
290
291 status = RegOpenKeyEx (HKEY_LOCAL_MACHINE,
292 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NpcapInst",
293 0, reg_read_access(), &key);
294
295 if (status != ERROR_SUCCESS)
296 {
297 WINPKT_TRACE ("status: %ld; %s\n", (long)status, win_strerror(GetLastError()));
298 goto fail;
299 }
300
301 status = RegQueryValueEx (key, "DisplayVersion", NULL, NULL, (BYTE*)&str, &size);
302 if (status != ERROR_SUCCESS)
303 {
304 WINPKT_TRACE ("status: %ld; %s\n", (long)status, win_strerror(GetLastError()));
305 goto fail;
306 }
307
308 _strlcpy (ret_ver, str, ver_size);
309 rc = TRUE;
310
311fail:
312 if (key)
313 RegCloseKey (key);
314 return (rc);
315}
316
317#if 0
328static BOOL npf_sc_showsid (char *sid_buf, size_t sid_size)
329{
330}
331
332/*
333 * And as 'sc getdisplayname npf' does:
334 * [SC] GetServiceDisplayName SUCCESS
335 * Name = WinPcap Packet Driver (NPF)
336 */
337static BOOL npf_sc_getdisplayname (char *name_buf, size_t name_size)
338{
339}
340#endif
341
345BOOL PacketInitModule (void)
346{
347 const struct ADAPTER_INFO *ai;
348 BOOL rc = FALSE;
349
350 winpkt_trace_func = "PacketInitModule";
351 WINPKT_TRACE ("\n");
352
353#if defined(USE_DEBUG)
354 if (winpkt_trace_level >= 3 && !_watt_is_win9x)
355 {
356 /* dump a bunch of registry keys
357 */
358 PacketDumpRegistryKey ("HKEY_LOCAL_MACHINE" ADAPTER_KEY_CLASS, "adapters.reg");
359 PacketDumpRegistryKey ("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet"
360 "\\Services\\Tcpip", "tcpip.reg");
361 PacketDumpRegistryKey ("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet"
362 "\\Services\\NPF", "npf.reg");
363 PacketDumpRegistryKey ("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet"
364 "\\Services", "services.reg");
365 }
366#endif
367
368 /* Create the mutex that will protect the adapter information list
369 */
370 adapters_mutex = CreateMutex (NULL, FALSE, NULL);
371
372 /*
373 * Retrieve NPF.sys version information from the file.
374 *
375 * \todo: Should maybe use an absolute path: "%SystemRoot%\system32\drivers\npf.sys" ?
376 * Or we can assume %SystemRoot% is always in %PATH?
377 *
378 * The get_file_version() fails under Win-Vista+ since files under
379 * '"%SystemRoot%\system32\drivers' are hidden from non-admin users.
380 * Hence try the "%SystemRoot%\sysnative\drivers" directory first
381 * (a virtual directory). If that fails (or on < Vista), try
382 * "%SystemRoot%\system32\drivers".
383 *
384 * Instead of checking "%SystemRoot%\sysnative\drivers" directly, MSDN
385 * would recommend we use:
386 * Wow64DisableWow64FsRedirection (...)
387 * get_file_version (driver_path,...)
388 * Wow64EnableWow64FsRedirection (....)
389 *
390 * But this can led to strange bugs.
391 *
392 * Refs: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365743(v=vs.85).aspx
393 * https://blogs.msdn.microsoft.com/oldnewthing/20130321-00/?p=4883/
394 *
395 * If both attempts fails, simply try to get the version from Registry.
396 *
397 * Ref. Section "Registry and file system" at:
398 * http://en.wikipedia.org/wiki/WoW64
399 */
400 if (_watt_os_ver >= 0x0600)
401 rc = get_file_version (virtual_path, npf_drv_ver, sizeof(npf_drv_ver));
402
403 if (!rc)
404 rc = get_file_version (driver_path, npf_drv_ver, sizeof(npf_drv_ver));
405
406 WINPKT_TRACE ("get_file_version(): rc=%d, npf_drv_ver=\"%s\"\n", rc, npf_drv_ver);
407
408 if (!rc)
409 {
410 rc = get_npf_ver_from_registry (npf_drv_ver, sizeof(npf_drv_ver));
411 WINPKT_TRACE ("get_npf_ver_from_registry(): rc=%d, npf_drv_ver=\"%s\"\n",
412 rc, npf_drv_ver);
413 }
414
415 /* Check for a NPcap.sys installation
416 */
417 if (!rc)
418 {
419 rc = get_npcap_ver_from_registry (npcap_drv_ver, sizeof(npcap_drv_ver));
420 WINPKT_TRACE ("get_npcap_ver_from_registry(): rc=%d, npcap_drv_ver=\"%s\"\n",
421 rc, npcap_drv_ver);
422 if (rc)
423 have_npcap = TRUE;
424 }
425
426 /* Populate the 'adapters_list' list.
427 */
428 rc = PopulateAdaptersInfoList();
429
430 winpkt_trace_func = "PacketInitModule";
431 WINPKT_TRACE ("Known adapters:\n");
432
433 for (ai = PacketGetAdInfo(); ai; ai = ai->Next)
434 {
435 winpkt_trace_func = "PacketInitModule";
436#if 0
437 WINPKT_TRACE ("%s, `%s'\n", ai->Name, ai->Description);
438#else
439 WINPKT_TRACE ("%s\n", ai->Name);
440#endif
441 }
442 WINPKT_TRACE ("rc %d\n", rc);
443
444 /* Check if we loaded WanPacket.dll okay. We don't care if it fails (since
445 * it's not critical for Watt-32/Win. These 'p_' func-ptr are in win_dll.c
446 */
447 use_wanpacket = (p_WanPacketSetBpfFilter && p_WanPacketOpenAdapter &&
448 p_WanPacketCloseAdapter && p_WanPacketSetBufferSize &&
449 p_WanPacketReceivePacket && p_WanPacketSetMinToCopy &&
450 p_WanPacketGetStats && p_WanPacketSetReadTimeout &&
451 p_WanPacketSetMode && p_WanPacketGetReadEvent &&
452 p_WanPacketTestAdapter);
453 return (rc);
454}
455
467static BOOL PacketSetMaxLookaheadsize (const ADAPTER *AdapterObject)
468{
469 struct {
470 PACKET_OID_DATA oidData;
471 DWORD filler;
472 } oid;
473 BOOL rc;
474
475 winpkt_trace_func = "PacketSetMaxLookaheadsize";
476
477 /* Set the size of the lookahead buffer to the maximum available
478 * by the the NIC driver.
479 */
480 memset (&oid, 0, sizeof(oid));
481 oid.oidData.Oid = OID_GEN_MAXIMUM_LOOKAHEAD;
482 oid.oidData.Length = sizeof(oid.filler);
483 rc = PacketRequest (AdapterObject, FALSE, &oid.oidData);
484
485 winpkt_trace_func = "PacketSetMaxLookaheadsize";
486 WINPKT_TRACE ("lookahead %lu, rc %d; %s\n",
487 *(u_long*)&oid.oidData, rc,
488 !rc ? win_strerror(GetLastError()) : "okay");
489
490 memset (&oid, 0, sizeof(oid));
491 oid.oidData.Oid = OID_GEN_CURRENT_LOOKAHEAD;
492 oid.oidData.Length = sizeof(oid.filler);
493 rc = PacketRequest (AdapterObject, TRUE, &oid.oidData);
494
495 winpkt_trace_func = "PacketSetMaxLookaheadsize";
496 WINPKT_TRACE ("rc %d; %s\n",
497 rc, !rc ? win_strerror(GetLastError()) : "okay");
498 return (rc);
499}
500
515static BOOL PacketSetReadEvt3xx (ADAPTER *AdapterObject)
516{
517 DWORD BytesReturned;
518 char EventName[40];
519 WCHAR EventNameU[20];
520
521 winpkt_trace_func = "PacketSetReadEvt3xx";
522
523 /* retrieve the Unicode name of the shared event from the driver
524 */
525 memset (&EventNameU, 0, sizeof(EventNameU));
526 if (!DeviceIoControl(AdapterObject->hFile, pBIOCEVNAME, NULL, 0,
527 EventNameU, sizeof(EventNameU), &BytesReturned, NULL))
528 {
529 WINPKT_TRACE ("error retrieving the event-name from the kernel\n");
530 return (FALSE);
531 }
532
533 /* this tells the terminal service to retrieve the event from the global
534 * namespace
535 */
536 SNPRINTF (EventName, sizeof(EventName), "Global\\%.13S", EventNameU);
537 WINPKT_TRACE (" event-name %s\n", EventName);
538
539 /* open the shared event
540 */
541 AdapterObject->ReadEvent = CreateEventA (NULL, TRUE, FALSE, EventName);
542
543 /* On Win-NT4 "Global\" is not automatically ignored: try to use
544 * simply the event name.
545 */
546 if (GetLastError() != ERROR_ALREADY_EXISTS)
547 {
548 if (AdapterObject->ReadEvent != INVALID_HANDLE_VALUE)
549 CloseHandle (AdapterObject->ReadEvent);
550
551 /* open the shared event */
552 AdapterObject->ReadEvent = CreateEventA (NULL, TRUE, FALSE, EventName+7); /* skip "Global\" */
553 }
554
555 if (AdapterObject->ReadEvent == INVALID_HANDLE_VALUE ||
556 GetLastError() != ERROR_ALREADY_EXISTS)
557 {
558 WINPKT_TRACE ("error retrieving the event from the kernel\n");
559 return (FALSE);
560 }
561
562 AdapterObject->ReadTimeOut = 0; /* block until something received */
563 WINPKT_TRACE ("okay\n");
564 return (TRUE);
565}
566
567static BOOL PacketSetReadEvt4xx (ADAPTER *AdapterObject)
568{
569 DWORD BytesReturned;
570 HANDLE hEvent;
571
572 winpkt_trace_func = "PacketSetReadEvt4xx";
573
574 if (AdapterObject->ReadEvent)
575 {
576 WINPKT_TRACE ("error\n");
577 SetLastError (ERROR_INVALID_FUNCTION);
578 return FALSE;
579 }
580
581 hEvent = CreateEvent (NULL, TRUE, FALSE, NULL);
582 if (!hEvent)
583 {
584 WINPKT_TRACE ("error creating event\n");
585 return FALSE;
586 }
587
588 if (!DeviceIoControl(AdapterObject->hFile, pBIOCSETEVENTHANDLE, &hEvent,
589 sizeof(hEvent), NULL, 0, &BytesReturned, NULL))
590 {
591 WINPKT_TRACE ("error getting event-handle\n");
592 return (FALSE);
593 }
594
595 WINPKT_TRACE ("event-handle %lu\n", (u_long)HandleToULong(hEvent));
596
597 AdapterObject->ReadEvent = hEvent;
598 AdapterObject->ReadTimeOut = 0;
599 WINPKT_TRACE ("okay\n");
600 return (TRUE);
601}
602
603static BOOL PacketSetReadEvt (ADAPTER *AdapterObject)
604{
605 if (npf_drv_ver[0] == '3')
606 return PacketSetReadEvt3xx (AdapterObject);
607 return PacketSetReadEvt4xx (AdapterObject);
608}
609
621static BOOL PacketInstallDriver (SC_HANDLE ascmHandle, SC_HANDLE *srvHandle)
622{
623 BOOL result = FALSE;
624 DWORD error = 0UL;
625
626 winpkt_trace_func = "PacketInstallDriver";
627 WINPKT_TRACE ("\n");
628
629 *srvHandle = CreateServiceA (ascmHandle,
630 service_name,
631 service_descr,
632 SERVICE_ALL_ACCESS,
633 SERVICE_KERNEL_DRIVER,
634 SERVICE_DEMAND_START,
635 SERVICE_ERROR_NORMAL,
636 driver_path, NULL, NULL,
637 NULL, NULL, NULL);
638 if (!*srvHandle)
639 {
640 if (GetLastError() == ERROR_SERVICE_EXISTS)
641 {
642 /* npf.sys already exists */
643 result = TRUE;
644 }
645 }
646 else
647 {
648 /* Created service for npf.sys */
649 result = TRUE;
650 }
651
652 if (result && *srvHandle)
653 CloseServiceHandle (*srvHandle);
654
655 if (!result)
656 {
657 error = GetLastError();
658 if (error != ERROR_FILE_NOT_FOUND)
659 WINPKT_TRACE ("failed; %s\n", win_strerror(error));
660 }
661 else
662 WINPKT_TRACE ("okay\n");
663
664 SetLastError (error);
665 return (result);
666}
667
682static ADAPTER *PacketOpenAdapterNPF (const char *AdapterName)
683{
684 ADAPTER *lpAdapter;
685 BOOL QuerySStat, Result;
686 DWORD error, KeyRes;
687 SC_HANDLE svcHandle = NULL;
688 HKEY PathKey;
689 char SymbolicLink[128];
690 const char *sym_link;
691 SERVICE_STATUS SStat;
692 SC_HANDLE scmHandle, srvHandle;
693 size_t prefix_len;
694
695 winpkt_trace_func = "PacketOpenAdapterNPF";
696 WINPKT_TRACE ("\n");
697
698 set_char_pointers (AdapterName);
699
700 scmHandle = OpenSCManager (NULL, NULL, GENERIC_READ);
701 if (!scmHandle)
702 {
703 error = GetLastError();
704 WINPKT_TRACE ("OpenSCManager failed; %s\n", win_strerror(error));
705 }
706 else
707 {
708 /* Check if the service registry key is already present.
709 * This means that the driver is already installed and that
710 * we don't need to call PacketInstallDriver().
711 */
712 KeyRes = RegOpenKeyExA (HKEY_LOCAL_MACHINE, registry_location, 0, KEY_READ, &PathKey);
713 RegCloseKey (PathKey);
714
715 WINPKT_TRACE ("RegOpenKeyExA (\"HKLM\\%s\") -> KeyRes: %lu\n", registry_location, (u_long)KeyRes);
716
717 if (KeyRes != ERROR_SUCCESS)
718 {
719 Result = PacketInstallDriver (scmHandle, &svcHandle);
720 }
721 else
722 {
723 if (have_npcap)
724 {
725 DWORD AdminOnly = (DWORD)-1;
726 DWORD LoopbackSupport = (DWORD)-1;
727 DWORD WinPcapCompatible = (DWORD)-1;
728 DWORD regType = (DWORD)-1;;
729 DWORD bufLen;
730 DWORD status;
731 HKEY params;
732
733 status = RegOpenKeyExA (HKEY_LOCAL_MACHINE, NPCAP_registry_params, 0, KEY_READ, &params);
734
735 WINPKT_TRACE ("RegOpenKeyExA (\"HKLM\\%s\") -> status: %lu\n", NPCAP_registry_params, (u_long)status);
736 if (status == ERROR_SUCCESS)
737 {
738 bufLen = sizeof(AdminOnly);
739 status = RegQueryValueExA (PathKey, "AdminOnly", NULL,
740 &regType, (BYTE*)&AdminOnly, &bufLen);
741
742 bufLen = sizeof(WinPcapCompatible);
743 status = RegQueryValueExA (PathKey, "WinPcapCompatible", NULL,
744 &regType, (BYTE*)&WinPcapCompatible, &bufLen);
745
746 bufLen = sizeof(LoopbackSupport);
747 status = RegQueryValueExA (PathKey, "LoopbackSupport", NULL,
748 &regType, (BYTE*)&LoopbackSupport, &bufLen);
749 RegCloseKey (params);
750 WINPKT_TRACE ("AdminOnly: %lu, LoopbackSupport: %lu, WinPcapCompatible: %lu\n",
751 (u_long)AdminOnly, (u_long)LoopbackSupport, (u_long)WinPcapCompatible);
752 }
753 }
754 Result = TRUE;
755 }
756
757 winpkt_trace_func = "PacketOpenAdapterNPF";
758 WINPKT_TRACE ("Service %s: \n", service_name);
759
760 if (Result)
761 {
762 srvHandle = OpenServiceA (scmHandle, service_name,
763 SERVICE_START | SERVICE_QUERY_STATUS);
764 if (srvHandle)
765 {
766 QuerySStat = QueryServiceStatus (srvHandle, &SStat);
767
768 WINPKT_TRACE ("state %s\n", list_lookup(SStat.dwCurrentState, serv_stat, DIM(serv_stat)));
769
770 if (!QuerySStat || SStat.dwCurrentState != SERVICE_RUNNING)
771 {
772 WINPKT_TRACE ("Calling startservice\n");
773 if (!StartService(srvHandle, 0, NULL))
774 {
775 error = GetLastError();
776 if (error != ERROR_SERVICE_ALREADY_RUNNING &&
777 error != ERROR_ALREADY_EXISTS)
778 {
779 error = GetLastError();
780 CloseServiceHandle (scmHandle);
781 WINPKT_TRACE ("StartService failed; %s\n",
782 win_strerror(error));
783 SetLastError (error);
784 return (NULL);
785 }
786 }
787 }
788 CloseServiceHandle (srvHandle);
789 srvHandle = NULL;
790 }
791 else
792 {
793 error = GetLastError();
794 WINPKT_TRACE ("OpenService failed; %s\n", win_strerror(error));
795 SetLastError (error);
796 }
797 }
798 else /* Registry key not found or PacketInstallDriver() failed */
799 {
800 if (KeyRes != ERROR_SUCCESS)
801 Result = PacketInstallDriver (scmHandle, &svcHandle);
802 else Result = TRUE;
803
804 winpkt_trace_func = "PacketOpenAdapterNPF";
805
806 if (Result)
807 {
808 srvHandle = OpenServiceA (scmHandle, service_name, SERVICE_START);
809 if (srvHandle)
810 {
811 QuerySStat = QueryServiceStatus (srvHandle, &SStat);
812
813 WINPKT_TRACE ("state: %s\n", list_lookup(SStat.dwCurrentState, serv_stat, DIM(serv_stat)));
814
815 if (!QuerySStat || SStat.dwCurrentState != SERVICE_RUNNING)
816 {
817 WINPKT_TRACE ("Calling startservice\n");
818
819 if (StartService (srvHandle, 0, NULL) == 0)
820 {
821 error = GetLastError();
822 if (error != ERROR_SERVICE_ALREADY_RUNNING &&
823 error != ERROR_ALREADY_EXISTS)
824 {
825 if (scmHandle)
826 CloseServiceHandle (scmHandle);
827 WINPKT_TRACE ("StartService failed; %s\n",
828 win_strerror(error));
829 SetLastError (error);
830 return (NULL);
831 }
832 }
833 }
834 CloseServiceHandle (srvHandle);
835 }
836 else
837 {
838 error = GetLastError();
839 WINPKT_TRACE ("OpenService failed; %s", win_strerror(error));
840 SetLastError (error);
841 }
842 }
843 }
844 } /* OpenSCManager() */
845
846 if (scmHandle)
847 CloseServiceHandle (scmHandle);
848
849 /* skip "\Device" to create a symlink name
850 */
851 prefix_len = strlen (DEVICE_PREFIX);
852 if (strnicmp(AdapterName, driver_prefix, prefix_len))
853 {
854 WINPKT_TRACE ("Unexpected prefix for adapter \"%s\". Expected prefix: \"%s\"\n",
855 AdapterName, driver_prefix);
856 return (NULL);
857 }
858
859 lpAdapter = GlobalAllocPtr (GlobalAllocPtr_FLAGS, sizeof(*lpAdapter));
860 if (!lpAdapter)
861 {
862 WINPKT_TRACE ("Failed to allocate the adapter structure\n");
863 return (NULL);
864 }
865
866 sym_link = AdapterName + prefix_len;
867 SNPRINTF (SymbolicLink, sizeof(SymbolicLink), "\\\\.\\%s", sym_link);
868
869 WINPKT_TRACE ("Creating SymbolicLink: \"%s\".\n", SymbolicLink);
870
871 /* try if it is possible to open the adapter immediately
872 */
873 lpAdapter->hFile = CreateFileA (SymbolicLink, GENERIC_WRITE | GENERIC_READ,
874 0, NULL, OPEN_EXISTING, 0, 0);
875
876 if (lpAdapter->hFile != INVALID_HANDLE_VALUE)
877 {
878 if (!PacketSetReadEvt(lpAdapter))
879 {
880 error = GetLastError();
881 GlobalFreePtr (lpAdapter);
882 WINPKT_TRACE ("failed; %s\n", win_strerror(error));
883 SetLastError (error);
884 return (NULL);
885 }
886
887 /* Success!
888 */
889 PacketSetMaxLookaheadsize (lpAdapter);
890 winpkt_trace_func = "PacketOpenAdapterNPF";
891 return (lpAdapter);
892 }
893
894 error = GetLastError();
895 GlobalFreePtr (lpAdapter);
896 WINPKT_TRACE ("CreateFileA (%s) failed; \n%-49s%s\n",
897 SymbolicLink, "", win_strerror(error));
898 SetLastError (error);
899 return (NULL);
900}
901
905const char *PacketGetDriverVersion (void)
906{
907 return (npf_drv_ver);
908}
909
910#ifdef NOT_NEEDED
922BOOL PacketStopDriver (void)
923{
924 SC_HANDLE scmHandle, schService;
925 BOOL rc = FALSE;
926
927 winpkt_trace_func = "PacketStopDriver";
928
929 scmHandle = OpenSCManager (NULL, NULL, SC_MANAGER_ALL_ACCESS);
930 if (scmHandle)
931 {
932 schService = OpenService (scmHandle, service_name, SERVICE_ALL_ACCESS);
933 if (schService)
934 {
935 SERVICE_STATUS status;
936
937 rc = ControlService (schService, SERVICE_CONTROL_STOP, &status);
938 CloseServiceHandle (schService);
939 CloseServiceHandle (scmHandle);
940 }
941 }
942
943 WINPKT_TRACE ("rc %d\n", rc);
944 return (rc);
945}
946#endif /* NOT_NEEDED */
947
956const ADAPTER *PacketOpenAdapter (const char *AdapterName)
957{
958 ADAPTER *ad;
959
960 set_char_pointers (AdapterName);
961
962 winpkt_trace_func = "PacketOpenAdapter";
963 WINPKT_TRACE ("trying to open the adapter %s using service %s.\n", AdapterName, service_name);
964
965 ad = PacketOpenAdapterNPF (AdapterName);
966 if (ad)
967 ad->flags = INFO_FLAG_NDIS_ADAPTER;
968
969 return (ad);
970}
971
981BOOL PacketCloseAdapter (ADAPTER *adapter)
982{
983 BOOL rc = FALSE;
984 int err = 0;
985
986 winpkt_trace_func = "PacketCloseAdapter";
987
988 if (!adapter || adapter->hFile == INVALID_HANDLE_VALUE)
989 {
990 WINPKT_TRACE ("adapter already closed\n");
991 return (rc);
992 }
993
994 WINPKT_TRACE ("adapter file 0x%" ADDR_FMT "\n", ADDR_CAST(adapter->hFile));
995
996 rc = CloseHandle (adapter->hFile);
997 adapter->hFile = INVALID_HANDLE_VALUE;
998 if (!rc)
999 err = GetLastError();
1000
1001 SetEvent (adapter->ReadEvent); /* might already be set */
1002 CloseHandle (adapter->ReadEvent);
1003 GlobalFreePtr (adapter);
1004
1005 WINPKT_TRACE ("CloseHandle() rc %d: %s\n",
1006 rc, !rc ? win_strerror(err) : "okay");
1007 return (rc);
1008
1009}
1010
1014BOOL PacketExitModule (void)
1015{
1016 BOOL rc;
1017
1018 winpkt_trace_func = "PacketExitModule";
1019 WINPKT_TRACE ("\n");
1020
1021 FreeAdaptersInfoList();
1022 ReleaseMutex (adapters_mutex);
1023 rc = CloseHandle (adapters_mutex);
1024 adapters_mutex = INVALID_HANDLE_VALUE;
1025 return (rc);
1026}
1027
1044UINT MS_CDECL PacketReceivePacket (const ADAPTER *adapter, void *buf, UINT buf_len)
1045{
1046 HANDLE handle;
1047 UINT rc = 0;
1048 DWORD recv = 0;
1049
1050 if ((int)adapter->ReadTimeOut != -1)
1051 WaitForSingleObject (adapter->ReadEvent,
1052 adapter->ReadTimeOut == 0 ?
1053 INFINITE : adapter->ReadTimeOut);
1054
1055 handle = adapter->hFile;
1056 if (handle == INVALID_HANDLE_VALUE)
1057 SetLastError (ERROR_INVALID_HANDLE);
1058 else rc = ReadFile (handle, buf, buf_len, &recv, NULL);
1059
1060 winpkt_trace_func = "PacketReceivePacket";
1061 WINPKT_TRACE ("recv %lu; rc: %d, %s\n",
1062 (u_long)recv, rc, rc == 0 ? win_strerror(GetLastError()) : "okay");
1063 return (UINT) recv;
1064}
1065
1069UINT PacketSendPacket (const ADAPTER *adapter, const void *buf, UINT len)
1070{
1071 DWORD sent = 0UL;
1072 int rc;
1073
1074 rc = WriteFile (adapter->hFile, buf, len, &sent, NULL);
1075
1076 winpkt_trace_func = "PacketSendPacket";
1077 WINPKT_TRACE ("rc %d; %s\n",
1078 rc, rc == 0 ? win_strerror(GetLastError()) : "okay");
1079 return (sent);
1080}
1081
1082BOOL PacketGetMacAddress (const ADAPTER *adapter, void *mac)
1083{
1084 struct {
1085 PACKET_OID_DATA oidData;
1086 mac_address mac;
1087 } oid;
1088
1089 memset (&oid, 0, sizeof(oid));
1090
1091 switch (_pktdevclass)
1092 {
1093 case PDCLASS_ETHER:
1094 oid.oidData.Oid = OID_802_3_PERMANENT_ADDRESS;
1095 break;
1096 case PDCLASS_TOKEN:
1097 oid.oidData.Oid = OID_802_5_PERMANENT_ADDRESS;
1098 break;
1099 case PDCLASS_FDDI:
1100 oid.oidData.Oid = OID_FDDI_LONG_PERMANENT_ADDR;
1101 break;
1102 case PDCLASS_ARCNET:
1103 oid.oidData.Oid = OID_ARCNET_PERMANENT_ADDRESS;
1104 break;
1105#if 0
1106 case NdisMediumWan:
1107 oid.oidData.Oid = OID_WAN_PERMANENT_ADDRESS;
1108 break;
1109 case NdisMediumWirelessWan:
1110 oid.oidData.Oid = OID_WW_GEN_PERMANENT_ADDRESS;
1111 break;
1112#endif
1113 default:
1114 return (FALSE);
1115 }
1116 oid.oidData.Length = sizeof(oid.mac);
1117
1118 if (!PacketRequest(adapter, FALSE, &oid.oidData))
1119 return (FALSE);
1120 memcpy (mac, &oid.oidData.Data, sizeof(mac_address));
1121 return (TRUE);
1122}
1123
1145BOOL PacketSetMinToCopy (const ADAPTER *AdapterObject, int nbytes)
1146{
1147 DWORD BytesReturned;
1148 BOOL rc;
1149
1150 rc = DeviceIoControl (AdapterObject->hFile, pBIOCSMINTOCOPY, &nbytes,
1151 4, NULL, 0, &BytesReturned, NULL);
1152
1153 winpkt_trace_func = "PacketSetMinToCopy";
1154 WINPKT_TRACE ("nbytes %d, rc %d; %s\n",
1155 nbytes, rc, !rc ? win_strerror(GetLastError()) :
1156 "okay");
1157 return (rc);
1158}
1159
1205BOOL PacketSetMode (const ADAPTER *AdapterObject, DWORD mode)
1206{
1207 DWORD BytesReturned;
1208 BOOL rc;
1209
1210 rc = DeviceIoControl (AdapterObject->hFile, pBIOCSMODE, &mode,
1211 sizeof(mode), NULL, 0, &BytesReturned, NULL);
1212
1213 winpkt_trace_func = "PacketSetMode";
1214 WINPKT_TRACE ("mode %lu, rc %d; %s\n",
1215 (u_long)mode, rc, !rc ? win_strerror(GetLastError()) : "okay");
1216 return (rc);
1217}
1218
1228BOOL PacketSetLoopbackBehavior (const ADAPTER *AdapterObject, UINT behavior)
1229{
1230 DWORD BytesReturned;
1231 BOOL rc;
1232
1233 rc = DeviceIoControl (AdapterObject->hFile, pBIOCISETLOBBEH,
1234 &behavior, sizeof(UINT), NULL,
1235 0, &BytesReturned, NULL);
1236
1237 winpkt_trace_func = "PacketSetLoopbackBehavior";
1238 WINPKT_TRACE ("behaviour %u, rc %d; %s\n",
1239 behavior, rc, !rc ? win_strerror(GetLastError()) : "okay");
1240 return (rc);
1241}
1242
1270HANDLE PacketGetReadEvent (const ADAPTER *AdapterObject)
1271{
1272 return (AdapterObject->ReadEvent);
1273}
1274
1292BOOL PacketSetReadTimeout (ADAPTER *AdapterObject, int timeout)
1293{
1294 DWORD BytesReturned;
1295 int driverTimeout = -1; /* NPF return immediately if a pkt is ready */
1296 BOOL rc;
1297
1298 AdapterObject->ReadTimeOut = timeout;
1299
1300 rc = DeviceIoControl (AdapterObject->hFile, pBIOCSRTIMEOUT, &driverTimeout,
1301 sizeof(driverTimeout), NULL, 0, &BytesReturned, NULL);
1302
1303 winpkt_trace_func = "PacketSetReadTimeout";
1304 WINPKT_TRACE ("timeout %d, rc %d; %s\n",
1305 timeout, rc, !rc ? win_strerror(GetLastError()) : "okay");
1306 return (rc);
1307}
1308
1328BOOL PacketSetBuff (const ADAPTER *AdapterObject, DWORD dim)
1329{
1330 DWORD BytesReturned;
1331 BOOL rc;
1332
1333 rc = DeviceIoControl (AdapterObject->hFile, pBIOCSETBUFFERSIZE,
1334 &dim, sizeof(dim), NULL, 0, &BytesReturned, NULL);
1335
1336 winpkt_trace_func = "PacketSetBuff";
1337 WINPKT_TRACE ("size %lu, rc %d; %s\n",
1338 (u_long)dim, rc, !rc ? win_strerror(GetLastError()) : "okay");
1339 return (rc);
1340}
1341
1350BOOL PacketGetStatsEx (const ADAPTER *AdapterObject, struct bpf_stat *stat)
1351{
1352 struct bpf_stat tmp_stat;
1353 DWORD read;
1354 BOOL rc;
1355
1356 memset (&tmp_stat, 0, sizeof(tmp_stat));
1357 rc = DeviceIoControl (AdapterObject->hFile,
1358 pBIOCGSTATS, NULL, 0, &tmp_stat, sizeof(tmp_stat),
1359 &read, NULL);
1360
1361 winpkt_trace_func = "PacketGetStatsEx";
1362 WINPKT_TRACE ("read: %lu, rc %d; %s\n",
1363 (u_long)read, rc, !rc ? win_strerror(GetLastError()) : "okay");
1364
1365 stat->bs_recv = tmp_stat.bs_recv;
1366 stat->bs_drop = tmp_stat.bs_drop;
1367 stat->ps_ifdrop = tmp_stat.ps_ifdrop;
1368 stat->bs_capt = tmp_stat.bs_capt;
1369 return (rc);
1370}
1371
1372#if defined(USE_DEBUG)
1373static const struct search_list oid_list[] = {
1374 ADD_VALUE (OID_802_11_ADD_KEY),
1375 ADD_VALUE (OID_802_11_ADD_WEP),
1376 ADD_VALUE (OID_802_11_ASSOCIATION_INFORMATION),
1377 ADD_VALUE (OID_802_11_AUTHENTICATION_MODE),
1378 ADD_VALUE (OID_802_11_BSSID),
1379 ADD_VALUE (OID_802_11_BSSID_LIST),
1380 ADD_VALUE (OID_802_11_BSSID_LIST_SCAN),
1381 ADD_VALUE (OID_802_11_CAPABILITY),
1382 ADD_VALUE (OID_802_11_CONFIGURATION),
1383 ADD_VALUE (OID_802_11_DESIRED_RATES),
1384 ADD_VALUE (OID_802_11_DISASSOCIATE),
1385 ADD_VALUE (OID_802_11_ENCRYPTION_STATUS),
1386 ADD_VALUE (OID_802_11_FRAGMENTATION_THRESHOLD),
1387 ADD_VALUE (OID_802_11_INFRASTRUCTURE_MODE),
1388 ADD_VALUE (OID_802_11_NETWORK_TYPES_SUPPORTED),
1389 ADD_VALUE (OID_802_11_NETWORK_TYPE_IN_USE),
1390 ADD_VALUE (OID_802_11_NUMBER_OF_ANTENNAS),
1391 ADD_VALUE (OID_802_11_PMKID),
1392 ADD_VALUE (OID_802_11_POWER_MODE),
1393 ADD_VALUE (OID_802_11_PRIVACY_FILTER),
1394 ADD_VALUE (OID_802_11_RELOAD_DEFAULTS),
1395 ADD_VALUE (OID_802_11_REMOVE_KEY),
1396 ADD_VALUE (OID_802_11_REMOVE_WEP),
1397 ADD_VALUE (OID_802_11_RSSI),
1398 ADD_VALUE (OID_802_11_RSSI_TRIGGER),
1399 ADD_VALUE (OID_802_11_RTS_THRESHOLD),
1400 ADD_VALUE (OID_802_11_RX_ANTENNA_SELECTED),
1401 ADD_VALUE (OID_802_11_SSID),
1402 ADD_VALUE (OID_802_11_STATISTICS),
1403 ADD_VALUE (OID_802_11_SUPPORTED_RATES),
1404 ADD_VALUE (OID_802_11_TEST),
1405 ADD_VALUE (OID_802_11_TX_ANTENNA_SELECTED),
1406 ADD_VALUE (OID_802_11_TX_POWER_LEVEL),
1407 ADD_VALUE (OID_802_11_WEP_STATUS),
1408 ADD_VALUE (OID_802_3_CURRENT_ADDRESS),
1409 ADD_VALUE (OID_802_3_MAC_OPTIONS),
1410 ADD_VALUE (OID_802_3_MAXIMUM_LIST_SIZE),
1411 ADD_VALUE (OID_802_3_MULTICAST_LIST),
1412 ADD_VALUE (OID_802_3_PERMANENT_ADDRESS),
1413 ADD_VALUE (OID_802_3_RCV_ERROR_ALIGNMENT),
1414 ADD_VALUE (OID_802_3_RCV_OVERRUN),
1415 ADD_VALUE (OID_802_3_XMIT_DEFERRED),
1416 ADD_VALUE (OID_802_3_XMIT_HEARTBEAT_FAILURE),
1417 ADD_VALUE (OID_802_3_XMIT_LATE_COLLISIONS),
1418 ADD_VALUE (OID_802_3_XMIT_MAX_COLLISIONS),
1419 ADD_VALUE (OID_802_3_XMIT_MORE_COLLISIONS),
1420 ADD_VALUE (OID_802_3_XMIT_ONE_COLLISION),
1421 ADD_VALUE (OID_802_3_XMIT_TIMES_CRS_LOST),
1422 ADD_VALUE (OID_802_3_XMIT_UNDERRUN),
1423 ADD_VALUE (OID_802_5_ABORT_DELIMETERS),
1424 ADD_VALUE (OID_802_5_AC_ERRORS),
1425 ADD_VALUE (OID_802_5_BURST_ERRORS),
1426 ADD_VALUE (OID_802_5_CURRENT_ADDRESS),
1427 ADD_VALUE (OID_802_5_CURRENT_FUNCTIONAL),
1428 ADD_VALUE (OID_802_5_CURRENT_GROUP),
1429 ADD_VALUE (OID_802_5_CURRENT_RING_STATE),
1430 ADD_VALUE (OID_802_5_CURRENT_RING_STATUS),
1431 ADD_VALUE (OID_802_5_FRAME_COPIED_ERRORS),
1432 ADD_VALUE (OID_802_5_FREQUENCY_ERRORS),
1433 ADD_VALUE (OID_802_5_INTERNAL_ERRORS),
1434 ADD_VALUE (OID_802_5_LAST_OPEN_STATUS),
1435 ADD_VALUE (OID_802_5_LINE_ERRORS),
1436 ADD_VALUE (OID_802_5_LOST_FRAMES),
1437 ADD_VALUE (OID_802_5_PERMANENT_ADDRESS),
1438 ADD_VALUE (OID_802_5_TOKEN_ERRORS),
1439 ADD_VALUE (OID_ARCNET_CURRENT_ADDRESS),
1440 ADD_VALUE (OID_ARCNET_PERMANENT_ADDRESS),
1441 ADD_VALUE (OID_ARCNET_RECONFIGURATIONS),
1442 ADD_VALUE (OID_ATM_ACQUIRE_ACCESS_NET_RESOURCES),
1443 ADD_VALUE (OID_ATM_ALIGNMENT_REQUIRED),
1444 ADD_VALUE (OID_ATM_ASSIGNED_VPI),
1445 ADD_VALUE (OID_ATM_CELLS_HEC_ERROR),
1446 ADD_VALUE (OID_ATM_DIGITAL_BROADCAST_VPIVCI),
1447 ADD_VALUE (OID_ATM_GET_NEAREST_FLOW),
1448 ADD_VALUE (OID_ATM_HW_CURRENT_ADDRESS),
1449 ADD_VALUE (OID_ATM_ILMI_VPIVCI),
1450 ADD_VALUE (OID_ATM_MAX_AAL0_PACKET_SIZE),
1451 ADD_VALUE (OID_ATM_MAX_AAL1_PACKET_SIZE),
1452 ADD_VALUE (OID_ATM_MAX_AAL34_PACKET_SIZE),
1453 ADD_VALUE (OID_ATM_MAX_AAL5_PACKET_SIZE),
1454 ADD_VALUE (OID_ATM_MAX_ACTIVE_VCI_BITS),
1455 ADD_VALUE (OID_ATM_MAX_ACTIVE_VCS),
1456 ADD_VALUE (OID_ATM_MAX_ACTIVE_VPI_BITS),
1457 ADD_VALUE (OID_ATM_RCV_CELLS_DROPPED),
1458 ADD_VALUE (OID_ATM_RCV_CELLS_OK),
1459 ADD_VALUE (OID_ATM_RCV_INVALID_VPI_VCI),
1460 ADD_VALUE (OID_ATM_RCV_REASSEMBLY_ERROR),
1461 ADD_VALUE (OID_ATM_RELEASE_ACCESS_NET_RESOURCES),
1462 ADD_VALUE (OID_ATM_SIGNALING_VPIVCI),
1463 ADD_VALUE (OID_ATM_SUPPORTED_AAL_TYPES),
1464 ADD_VALUE (OID_ATM_SUPPORTED_SERVICE_CATEGORY),
1465 ADD_VALUE (OID_ATM_SUPPORTED_VC_RATES),
1466 ADD_VALUE (OID_ATM_XMIT_CELLS_OK),
1467 ADD_VALUE (OID_CO_ADDRESS_CHANGE),
1468 ADD_VALUE (OID_CO_ADD_ADDRESS),
1469 ADD_VALUE (OID_CO_ADD_PVC),
1470 ADD_VALUE (OID_CO_DELETE_ADDRESS),
1471 ADD_VALUE (OID_CO_DELETE_PVC),
1472 ADD_VALUE (OID_CO_GET_ADDRESSES),
1473 ADD_VALUE (OID_CO_GET_CALL_INFORMATION),
1474 ADD_VALUE (OID_CO_SIGNALING_DISABLED),
1475 ADD_VALUE (OID_CO_SIGNALING_ENABLED),
1476 ADD_VALUE (OID_FDDI_ATTACHMENT_TYPE),
1477 ADD_VALUE (OID_FDDI_DOWNSTREAM_NODE_LONG),
1478 ADD_VALUE (OID_FDDI_FRAMES_LOST),
1479 ADD_VALUE (OID_FDDI_FRAME_ERRORS),
1480 ADD_VALUE (OID_FDDI_IF_ADMIN_STATUS),
1481 ADD_VALUE (OID_FDDI_IF_DESCR),
1482 ADD_VALUE (OID_FDDI_IF_IN_DISCARDS),
1483 ADD_VALUE (OID_FDDI_IF_IN_ERRORS),
1484 ADD_VALUE (OID_FDDI_IF_IN_NUCAST_PKTS),
1485 ADD_VALUE (OID_FDDI_IF_IN_OCTETS),
1486 ADD_VALUE (OID_FDDI_IF_IN_UCAST_PKTS),
1487 ADD_VALUE (OID_FDDI_IF_IN_UNKNOWN_PROTOS),
1488 ADD_VALUE (OID_FDDI_IF_LAST_CHANGE),
1489 ADD_VALUE (OID_FDDI_IF_MTU),
1490 ADD_VALUE (OID_FDDI_IF_OPER_STATUS),
1491 ADD_VALUE (OID_FDDI_IF_OUT_DISCARDS),
1492 ADD_VALUE (OID_FDDI_IF_OUT_ERRORS),
1493 ADD_VALUE (OID_FDDI_IF_OUT_NUCAST_PKTS),
1494 ADD_VALUE (OID_FDDI_IF_OUT_OCTETS),
1495 ADD_VALUE (OID_FDDI_IF_OUT_QLEN),
1496 ADD_VALUE (OID_FDDI_IF_OUT_UCAST_PKTS),
1497 ADD_VALUE (OID_FDDI_IF_PHYS_ADDRESS),
1498 ADD_VALUE (OID_FDDI_IF_SPECIFIC),
1499 ADD_VALUE (OID_FDDI_IF_SPEED),
1500 ADD_VALUE (OID_FDDI_IF_TYPE),
1501 ADD_VALUE (OID_FDDI_LCONNECTION_STATE),
1502 ADD_VALUE (OID_FDDI_LCT_FAILURES),
1503 ADD_VALUE (OID_FDDI_LEM_REJECTS),
1504 ADD_VALUE (OID_FDDI_LONG_CURRENT_ADDR),
1505 ADD_VALUE (OID_FDDI_LONG_MAX_LIST_SIZE),
1506 ADD_VALUE (OID_FDDI_LONG_MULTICAST_LIST),
1507 ADD_VALUE (OID_FDDI_LONG_PERMANENT_ADDR),
1508 ADD_VALUE (OID_FDDI_MAC_AVAILABLE_PATHS),
1509 ADD_VALUE (OID_FDDI_MAC_BRIDGE_FUNCTIONS),
1510 ADD_VALUE (OID_FDDI_MAC_COPIED_CT),
1511 ADD_VALUE (OID_FDDI_MAC_CURRENT_PATH),
1512 ADD_VALUE (OID_FDDI_MAC_DA_FLAG),
1513 ADD_VALUE (OID_FDDI_MAC_DOWNSTREAM_NBR),
1514 ADD_VALUE (OID_FDDI_MAC_DOWNSTREAM_PORT_TYPE),
1515 ADD_VALUE (OID_FDDI_MAC_DUP_ADDRESS_TEST),
1516 ADD_VALUE (OID_FDDI_MAC_ERROR_CT),
1517 ADD_VALUE (OID_FDDI_MAC_FRAME_CT),
1518 ADD_VALUE (OID_FDDI_MAC_FRAME_ERROR_FLAG),
1519 ADD_VALUE (OID_FDDI_MAC_FRAME_ERROR_RATIO),
1520 ADD_VALUE (OID_FDDI_MAC_FRAME_ERROR_THRESHOLD),
1521 ADD_VALUE (OID_FDDI_MAC_FRAME_STATUS_FUNCTIONS),
1522 ADD_VALUE (OID_FDDI_MAC_HARDWARE_PRESENT),
1523 ADD_VALUE (OID_FDDI_MAC_INDEX),
1524 ADD_VALUE (OID_FDDI_MAC_LATE_CT),
1525 ADD_VALUE (OID_FDDI_MAC_LONG_GRP_ADDRESS),
1526 ADD_VALUE (OID_FDDI_MAC_LOST_CT),
1527 ADD_VALUE (OID_FDDI_MAC_MA_UNITDATA_AVAILABLE),
1528 ADD_VALUE (OID_FDDI_MAC_MA_UNITDATA_ENABLE),
1529 ADD_VALUE (OID_FDDI_MAC_NOT_COPIED_CT),
1530 ADD_VALUE (OID_FDDI_MAC_NOT_COPIED_FLAG),
1531 ADD_VALUE (OID_FDDI_MAC_NOT_COPIED_RATIO),
1532 ADD_VALUE (OID_FDDI_MAC_NOT_COPIED_THRESHOLD),
1533 ADD_VALUE (OID_FDDI_MAC_OLD_DOWNSTREAM_NBR),
1534 ADD_VALUE (OID_FDDI_MAC_OLD_UPSTREAM_NBR),
1535 ADD_VALUE (OID_FDDI_MAC_REQUESTED_PATHS),
1536 ADD_VALUE (OID_FDDI_MAC_RING_OP_CT),
1537 ADD_VALUE (OID_FDDI_MAC_RMT_STATE),
1538 ADD_VALUE (OID_FDDI_MAC_SHORT_GRP_ADDRESS),
1539 ADD_VALUE (OID_FDDI_MAC_SMT_ADDRESS),
1540 ADD_VALUE (OID_FDDI_MAC_TOKEN_CT),
1541 ADD_VALUE (OID_FDDI_MAC_TRANSMIT_CT),
1542 ADD_VALUE (OID_FDDI_MAC_TVX_CAPABILITY),
1543 ADD_VALUE (OID_FDDI_MAC_TVX_EXPIRED_CT),
1544 ADD_VALUE (OID_FDDI_MAC_TVX_VALUE),
1545 ADD_VALUE (OID_FDDI_MAC_T_MAX),
1546 ADD_VALUE (OID_FDDI_MAC_T_MAX_CAPABILITY),
1547 ADD_VALUE (OID_FDDI_MAC_T_NEG),
1548 ADD_VALUE (OID_FDDI_MAC_T_PRI0),
1549 ADD_VALUE (OID_FDDI_MAC_T_PRI1),
1550 ADD_VALUE (OID_FDDI_MAC_T_PRI2),
1551 ADD_VALUE (OID_FDDI_MAC_T_PRI3),
1552 ADD_VALUE (OID_FDDI_MAC_T_PRI4),
1553 ADD_VALUE (OID_FDDI_MAC_T_PRI5),
1554 ADD_VALUE (OID_FDDI_MAC_T_PRI6),
1555 ADD_VALUE (OID_FDDI_MAC_T_REQ),
1556 ADD_VALUE (OID_FDDI_MAC_UNDA_FLAG),
1557 ADD_VALUE (OID_FDDI_MAC_UPSTREAM_NBR),
1558 ADD_VALUE (OID_FDDI_PATH_CONFIGURATION),
1559 ADD_VALUE (OID_FDDI_PATH_INDEX),
1560 ADD_VALUE (OID_FDDI_PATH_MAX_T_REQ),
1561 ADD_VALUE (OID_FDDI_PATH_RING_LATENCY),
1562 ADD_VALUE (OID_FDDI_PATH_SBA_AVAILABLE),
1563 ADD_VALUE (OID_FDDI_PATH_SBA_OVERHEAD),
1564 ADD_VALUE (OID_FDDI_PATH_SBA_PAYLOAD),
1565 ADD_VALUE (OID_FDDI_PATH_TRACE_STATUS),
1566 ADD_VALUE (OID_FDDI_PATH_TVX_LOWER_BOUND),
1567 ADD_VALUE (OID_FDDI_PATH_T_MAX_LOWER_BOUND),
1568 ADD_VALUE (OID_FDDI_PATH_T_R_MODE),
1569 ADD_VALUE (OID_FDDI_PORT_ACTION),
1570 ADD_VALUE (OID_FDDI_PORT_AVAILABLE_PATHS),
1571 ADD_VALUE (OID_FDDI_PORT_BS_FLAG),
1572 ADD_VALUE (OID_FDDI_PORT_CONNECTION_CAPABILITIES),
1573 ADD_VALUE (OID_FDDI_PORT_CONNECTION_POLICIES),
1574 ADD_VALUE (OID_FDDI_PORT_CONNNECT_STATE),
1575 ADD_VALUE (OID_FDDI_PORT_CURRENT_PATH),
1576 ADD_VALUE (OID_FDDI_PORT_EB_ERROR_CT),
1577 ADD_VALUE (OID_FDDI_PORT_HARDWARE_PRESENT),
1578 ADD_VALUE (OID_FDDI_PORT_INDEX),
1579 ADD_VALUE (OID_FDDI_PORT_LCT_FAIL_CT),
1580 ADD_VALUE (OID_FDDI_PORT_LEM_CT),
1581 ADD_VALUE (OID_FDDI_PORT_LEM_REJECT_CT),
1582 ADD_VALUE (OID_FDDI_PORT_LER_ALARM),
1583 ADD_VALUE (OID_FDDI_PORT_LER_CUTOFF),
1584 ADD_VALUE (OID_FDDI_PORT_LER_ESTIMATE),
1585 ADD_VALUE (OID_FDDI_PORT_LER_FLAG),
1586 ADD_VALUE (OID_FDDI_PORT_MAC_INDICATED),
1587 ADD_VALUE (OID_FDDI_PORT_MAC_LOOP_TIME),
1588 ADD_VALUE (OID_FDDI_PORT_MAC_PLACEMENT),
1589 ADD_VALUE (OID_FDDI_PORT_MAINT_LS),
1590 ADD_VALUE (OID_FDDI_PORT_MY_TYPE),
1591 ADD_VALUE (OID_FDDI_PORT_NEIGHBOR_TYPE),
1592 ADD_VALUE (OID_FDDI_PORT_PCM_STATE),
1593 ADD_VALUE (OID_FDDI_PORT_PC_LS),
1594 ADD_VALUE (OID_FDDI_PORT_PC_WITHHOLD),
1595 ADD_VALUE (OID_FDDI_PORT_PMD_CLASS),
1596 ADD_VALUE (OID_FDDI_PORT_REQUESTED_PATHS),
1597 ADD_VALUE (OID_FDDI_RING_MGT_STATE),
1598 ADD_VALUE (OID_FDDI_SHORT_CURRENT_ADDR),
1599 ADD_VALUE (OID_FDDI_SHORT_MAX_LIST_SIZE),
1600 ADD_VALUE (OID_FDDI_SHORT_MULTICAST_LIST),
1601 ADD_VALUE (OID_FDDI_SHORT_PERMANENT_ADDR),
1602 ADD_VALUE (OID_FDDI_SMT_AVAILABLE_PATHS),
1603 ADD_VALUE (OID_FDDI_SMT_BYPASS_PRESENT),
1604 ADD_VALUE (OID_FDDI_SMT_CF_STATE),
1605 ADD_VALUE (OID_FDDI_SMT_CONFIG_CAPABILITIES),
1606 ADD_VALUE (OID_FDDI_SMT_CONFIG_POLICY),
1607 ADD_VALUE (OID_FDDI_SMT_CONNECTION_POLICY),
1608 ADD_VALUE (OID_FDDI_SMT_ECM_STATE),
1609 ADD_VALUE (OID_FDDI_SMT_HI_VERSION_ID),
1610 ADD_VALUE (OID_FDDI_SMT_HOLD_STATE),
1611 ADD_VALUE (OID_FDDI_SMT_LAST_SET_STATION_ID),
1612 ADD_VALUE (OID_FDDI_SMT_LO_VERSION_ID),
1613 ADD_VALUE (OID_FDDI_SMT_MAC_CT),
1614 ADD_VALUE (OID_FDDI_SMT_MAC_INDEXES),
1615 ADD_VALUE (OID_FDDI_SMT_MANUFACTURER_DATA),
1616 ADD_VALUE (OID_FDDI_SMT_MASTER_CT),
1617 ADD_VALUE (OID_FDDI_SMT_MIB_VERSION_ID),
1618 ADD_VALUE (OID_FDDI_SMT_MSG_TIME_STAMP),
1619 ADD_VALUE (OID_FDDI_SMT_NON_MASTER_CT),
1620 ADD_VALUE (OID_FDDI_SMT_OP_VERSION_ID),
1621 ADD_VALUE (OID_FDDI_SMT_PEER_WRAP_FLAG),
1622 ADD_VALUE (OID_FDDI_SMT_PORT_INDEXES),
1623 ADD_VALUE (OID_FDDI_SMT_REMOTE_DISCONNECT_FLAG),
1624 ADD_VALUE (OID_FDDI_SMT_SET_COUNT),
1625 ADD_VALUE (OID_FDDI_SMT_STATION_ACTION),
1626 ADD_VALUE (OID_FDDI_SMT_STATION_ID),
1627 ADD_VALUE (OID_FDDI_SMT_STATION_STATUS),
1628 ADD_VALUE (OID_FDDI_SMT_STAT_RPT_POLICY),
1629 ADD_VALUE (OID_FDDI_SMT_TRACE_MAX_EXPIRATION),
1630 ADD_VALUE (OID_FDDI_SMT_TRANSITION_TIME_STAMP),
1631 ADD_VALUE (OID_FDDI_SMT_T_NOTIFY),
1632 ADD_VALUE (OID_FDDI_SMT_USER_DATA),
1633 ADD_VALUE (OID_FDDI_UPSTREAM_NODE_LONG),
1634 ADD_VALUE (OID_GEN_BROADCAST_BYTES_RCV),
1635 ADD_VALUE (OID_GEN_BROADCAST_BYTES_XMIT),
1636 ADD_VALUE (OID_GEN_BROADCAST_FRAMES_RCV),
1637 ADD_VALUE (OID_GEN_BROADCAST_FRAMES_XMIT),
1638 ADD_VALUE (OID_GEN_CO_BYTES_RCV),
1639 ADD_VALUE (OID_GEN_CO_BYTES_XMIT),
1640 ADD_VALUE (OID_GEN_CO_BYTES_XMIT_OUTSTANDING),
1641 ADD_VALUE (OID_GEN_CO_DRIVER_VERSION),
1642 ADD_VALUE (OID_GEN_CO_GET_NETCARD_TIME),
1643 ADD_VALUE (OID_GEN_CO_GET_TIME_CAPS),
1644 ADD_VALUE (OID_GEN_CO_HARDWARE_STATUS),
1645 ADD_VALUE (OID_GEN_CO_LINK_SPEED),
1646 ADD_VALUE (OID_GEN_CO_MAC_OPTIONS),
1647 ADD_VALUE (OID_GEN_CO_MEDIA_CONNECT_STATUS),
1648 ADD_VALUE (OID_GEN_CO_MEDIA_IN_USE),
1649 ADD_VALUE (OID_GEN_CO_MEDIA_SUPPORTED),
1650 ADD_VALUE (OID_GEN_CO_MINIMUM_LINK_SPEED),
1651 ADD_VALUE (OID_GEN_CO_NETCARD_LOAD),
1652 ADD_VALUE (OID_GEN_CO_PROTOCOL_OPTIONS),
1653 ADD_VALUE (OID_GEN_CO_RCV_CRC_ERROR),
1654 ADD_VALUE (OID_GEN_CO_RCV_PDUS_ERROR),
1655 ADD_VALUE (OID_GEN_CO_RCV_PDUS_NO_BUFFER),
1656 ADD_VALUE (OID_GEN_CO_RCV_PDUS_OK),
1657 ADD_VALUE (OID_GEN_CO_SUPPORTED_LIST),
1658 ADD_VALUE (OID_GEN_CO_TRANSMIT_QUEUE_LENGTH),
1659 ADD_VALUE (OID_GEN_CO_VENDOR_DESCRIPTION),
1660 ADD_VALUE (OID_GEN_CO_VENDOR_DRIVER_VERSION),
1661 ADD_VALUE (OID_GEN_CO_VENDOR_ID),
1662 ADD_VALUE (OID_GEN_CO_XMIT_PDUS_ERROR),
1663 ADD_VALUE (OID_GEN_CO_XMIT_PDUS_OK),
1664 ADD_VALUE (OID_GEN_CURRENT_LOOKAHEAD),
1665 ADD_VALUE (OID_GEN_CURRENT_PACKET_FILTER),
1666 ADD_VALUE (OID_GEN_DIRECTED_BYTES_RCV),
1667 ADD_VALUE (OID_GEN_DIRECTED_BYTES_XMIT),
1668 ADD_VALUE (OID_GEN_DIRECTED_FRAMES_RCV),
1669 ADD_VALUE (OID_GEN_DIRECTED_FRAMES_XMIT),
1670 ADD_VALUE (OID_GEN_DRIVER_VERSION),
1671 ADD_VALUE (OID_GEN_GET_NETCARD_TIME),
1672 ADD_VALUE (OID_GEN_GET_TIME_CAPS),
1673 ADD_VALUE (OID_GEN_HARDWARE_STATUS),
1674 ADD_VALUE (OID_GEN_LINK_SPEED),
1675 ADD_VALUE (OID_GEN_MAC_OPTIONS),
1676 ADD_VALUE (OID_GEN_MAXIMUM_FRAME_SIZE),
1677 ADD_VALUE (OID_GEN_MAXIMUM_LOOKAHEAD),
1678 ADD_VALUE (OID_GEN_MAXIMUM_SEND_PACKETS),
1679 ADD_VALUE (OID_GEN_MAXIMUM_TOTAL_SIZE),
1680 ADD_VALUE (OID_GEN_MEDIA_CAPABILITIES),
1681 ADD_VALUE (OID_GEN_MEDIA_CONNECT_STATUS),
1682 ADD_VALUE (OID_GEN_MEDIA_IN_USE),
1683 ADD_VALUE (OID_GEN_MEDIA_SUPPORTED),
1684 ADD_VALUE (OID_GEN_MULTICAST_BYTES_RCV),
1685 ADD_VALUE (OID_GEN_MULTICAST_BYTES_XMIT),
1686 ADD_VALUE (OID_GEN_MULTICAST_FRAMES_RCV),
1687 ADD_VALUE (OID_GEN_MULTICAST_FRAMES_XMIT),
1688 ADD_VALUE (OID_GEN_NETWORK_LAYER_ADDRESSES),
1689 ADD_VALUE (OID_GEN_PHYSICAL_MEDIUM),
1690 ADD_VALUE (OID_GEN_PHYSICAL_MEDIUM_EX),
1691 ADD_VALUE (OID_GEN_PROTOCOL_OPTIONS),
1692 ADD_VALUE (OID_GEN_RCV_CRC_ERROR),
1693 ADD_VALUE (OID_GEN_RCV_ERROR),
1694 ADD_VALUE (OID_GEN_RCV_NO_BUFFER),
1695 ADD_VALUE (OID_GEN_RCV_OK),
1696 ADD_VALUE (OID_GEN_RECEIVE_BLOCK_SIZE),
1697 ADD_VALUE (OID_GEN_RECEIVE_BUFFER_SPACE),
1698 ADD_VALUE (OID_GEN_SUPPORTED_LIST),
1699 ADD_VALUE (OID_GEN_TRANSMIT_BLOCK_SIZE),
1700 ADD_VALUE (OID_GEN_TRANSMIT_BUFFER_SPACE),
1701 ADD_VALUE (OID_GEN_TRANSMIT_QUEUE_LENGTH),
1702 ADD_VALUE (OID_GEN_TRANSPORT_HEADER_OFFSET),
1703 ADD_VALUE (OID_GEN_VENDOR_DESCRIPTION),
1704 ADD_VALUE (OID_GEN_VENDOR_DRIVER_VERSION),
1705 ADD_VALUE (OID_GEN_VENDOR_ID),
1706 ADD_VALUE (OID_GEN_VLAN_ID),
1707 ADD_VALUE (OID_GEN_XMIT_ERROR),
1708 ADD_VALUE (OID_GEN_XMIT_OK),
1709 ADD_VALUE (OID_IP4_OFFLOAD_STATS),
1710 ADD_VALUE (OID_IP6_OFFLOAD_STATS),
1711 ADD_VALUE (OID_IRDA_EXTRA_RCV_BOFS),
1712 ADD_VALUE (OID_IRDA_LINK_SPEED),
1713 ADD_VALUE (OID_IRDA_MAX_RECEIVE_WINDOW_SIZE),
1714 ADD_VALUE (OID_IRDA_MAX_SEND_WINDOW_SIZE),
1715 ADD_VALUE (OID_IRDA_MAX_UNICAST_LIST_SIZE),
1716 ADD_VALUE (OID_IRDA_MEDIA_BUSY),
1717 ADD_VALUE (OID_IRDA_RATE_SNIFF),
1718 ADD_VALUE (OID_IRDA_RECEIVING),
1719 ADD_VALUE (OID_IRDA_SUPPORTED_SPEEDS),
1720 ADD_VALUE (OID_IRDA_TURNAROUND_TIME),
1721 ADD_VALUE (OID_IRDA_UNICAST_LIST),
1722 ADD_VALUE (OID_LTALK_COLLISIONS),
1723 ADD_VALUE (OID_LTALK_CURRENT_NODE_ID),
1724 ADD_VALUE (OID_LTALK_DEFERS),
1725 ADD_VALUE (OID_LTALK_FCS_ERRORS),
1726 ADD_VALUE (OID_LTALK_IN_BROADCASTS),
1727 ADD_VALUE (OID_LTALK_IN_LENGTH_ERRORS),
1728 ADD_VALUE (OID_LTALK_NO_DATA_ERRORS),
1729 ADD_VALUE (OID_LTALK_OUT_NO_HANDLERS),
1730 ADD_VALUE (OID_LTALK_RANDOM_CTS_ERRORS),
1731 ADD_VALUE (OID_PNP_ADD_WAKE_UP_PATTERN),
1732 ADD_VALUE (OID_PNP_CAPABILITIES),
1733 ADD_VALUE (OID_PNP_ENABLE_WAKE_UP),
1734 ADD_VALUE (OID_PNP_QUERY_POWER),
1735 ADD_VALUE (OID_PNP_REMOVE_WAKE_UP_PATTERN),
1736 ADD_VALUE (OID_PNP_SET_POWER),
1737 ADD_VALUE (OID_PNP_WAKE_UP_PATTERN_LIST),
1738 ADD_VALUE (OID_TAPI_ACCEPT),
1739 ADD_VALUE (OID_TAPI_ANSWER),
1740 ADD_VALUE (OID_TAPI_CLOSE),
1741 ADD_VALUE (OID_TAPI_CLOSE_CALL),
1742 ADD_VALUE (OID_TAPI_CONDITIONAL_MEDIA_DETECTION),
1743 ADD_VALUE (OID_TAPI_CONFIG_DIALOG),
1744 ADD_VALUE (OID_TAPI_DEV_SPECIFIC),
1745 ADD_VALUE (OID_TAPI_DIAL),
1746 ADD_VALUE (OID_TAPI_DROP),
1747 ADD_VALUE (OID_TAPI_GATHER_DIGITS),
1748 ADD_VALUE (OID_TAPI_GET_ADDRESS_CAPS),
1749 ADD_VALUE (OID_TAPI_GET_ADDRESS_ID),
1750 ADD_VALUE (OID_TAPI_GET_ADDRESS_STATUS),
1751 ADD_VALUE (OID_TAPI_GET_CALL_ADDRESS_ID),
1752 ADD_VALUE (OID_TAPI_GET_CALL_INFO),
1753 ADD_VALUE (OID_TAPI_GET_CALL_STATUS),
1754 ADD_VALUE (OID_TAPI_GET_DEV_CAPS),
1755 ADD_VALUE (OID_TAPI_GET_DEV_CONFIG),
1756 ADD_VALUE (OID_TAPI_GET_EXTENSION_ID),
1757 ADD_VALUE (OID_TAPI_GET_ID),
1758 ADD_VALUE (OID_TAPI_GET_LINE_DEV_STATUS),
1759 ADD_VALUE (OID_TAPI_MAKE_CALL),
1760 ADD_VALUE (OID_TAPI_MONITOR_DIGITS),
1761 ADD_VALUE (OID_TAPI_NEGOTIATE_EXT_VERSION),
1762 ADD_VALUE (OID_TAPI_OPEN),
1763 ADD_VALUE (OID_TAPI_PROVIDER_INITIALIZE),
1764 ADD_VALUE (OID_TAPI_PROVIDER_SHUTDOWN),
1765 ADD_VALUE (OID_TAPI_SECURE_CALL),
1766 ADD_VALUE (OID_TAPI_SELECT_EXT_VERSION),
1767 ADD_VALUE (OID_TAPI_SEND_USER_USER_INFO),
1768 ADD_VALUE (OID_TAPI_SET_APP_SPECIFIC),
1769 ADD_VALUE (OID_TAPI_SET_CALL_PARAMS),
1770 ADD_VALUE (OID_TAPI_SET_DEFAULT_MEDIA_DETECTION),
1771 ADD_VALUE (OID_TAPI_SET_DEV_CONFIG),
1772 ADD_VALUE (OID_TAPI_SET_MEDIA_MODE),
1773 ADD_VALUE (OID_TAPI_SET_STATUS_MESSAGES),
1774 ADD_VALUE (OID_TCP4_OFFLOAD_STATS),
1775 ADD_VALUE (OID_TCP6_OFFLOAD_STATS),
1776 ADD_VALUE (OID_TCP_SAN_SUPPORT),
1777 ADD_VALUE (OID_TCP_TASK_IPSEC_ADD_SA),
1778 ADD_VALUE (OID_TCP_TASK_IPSEC_ADD_UDPESP_SA),
1779 ADD_VALUE (OID_TCP_TASK_IPSEC_DELETE_SA),
1780 ADD_VALUE (OID_TCP_TASK_IPSEC_DELETE_UDPESP_SA),
1781 ADD_VALUE (OID_TCP_TASK_OFFLOAD),
1782 ADD_VALUE (OID_WAN_CURRENT_ADDRESS),
1783 ADD_VALUE (OID_WAN_GET_BRIDGE_INFO),
1784 ADD_VALUE (OID_WAN_GET_COMP_INFO),
1785 ADD_VALUE (OID_WAN_GET_INFO),
1786 ADD_VALUE (OID_WAN_GET_LINK_INFO),
1787 ADD_VALUE (OID_WAN_GET_STATS_INFO),
1788 ADD_VALUE (OID_WAN_HEADER_FORMAT),
1789 ADD_VALUE (OID_WAN_LINE_COUNT),
1790 ADD_VALUE (OID_WAN_MEDIUM_SUBTYPE),
1791 ADD_VALUE (OID_WAN_PERMANENT_ADDRESS),
1792 ADD_VALUE (OID_WAN_PROTOCOL_TYPE),
1793 ADD_VALUE (OID_WAN_QUALITY_OF_SERVICE),
1794 ADD_VALUE (OID_WAN_SET_BRIDGE_INFO),
1795 ADD_VALUE (OID_WAN_SET_COMP_INFO),
1796 ADD_VALUE (OID_WAN_SET_LINK_INFO),
1797 ADD_VALUE (OID_WW_ARD_DATAGRAM),
1798 ADD_VALUE (OID_WW_ARD_SNDCP),
1799 ADD_VALUE (OID_WW_ARD_TMLY_MSG),
1800 ADD_VALUE (OID_WW_CDPD_AREA_COLOR),
1801 ADD_VALUE (OID_WW_CDPD_CHANNEL_SELECT),
1802 ADD_VALUE (OID_WW_CDPD_CHANNEL_STATE),
1803 ADD_VALUE (OID_WW_CDPD_CIRCUIT_SWITCHED),
1804 ADD_VALUE (OID_WW_CDPD_DATA_COMPRESSION),
1805 ADD_VALUE (OID_WW_CDPD_EID),
1806 ADD_VALUE (OID_WW_CDPD_HEADER_COMPRESSION),
1807 ADD_VALUE (OID_WW_CDPD_NEI),
1808 ADD_VALUE (OID_WW_CDPD_NEI_STATE),
1809 ADD_VALUE (OID_WW_CDPD_RSSI),
1810 ADD_VALUE (OID_WW_CDPD_SERVICE_PROVIDER_IDENTIFIER),
1811 ADD_VALUE (OID_WW_CDPD_SLEEP_MODE),
1812 ADD_VALUE (OID_WW_CDPD_SPNI),
1813 ADD_VALUE (OID_WW_CDPD_TEI),
1814 ADD_VALUE (OID_WW_CDPD_TX_POWER_LEVEL),
1815 ADD_VALUE (OID_WW_CDPD_WASI),
1816 ADD_VALUE (OID_WW_GEN_BASESTATION_ID),
1817 ADD_VALUE (OID_WW_GEN_BATTERY_LEVEL),
1818 ADD_VALUE (OID_WW_GEN_CHANNEL_ID),
1819 ADD_VALUE (OID_WW_GEN_CHANNEL_QUALITY),
1820 ADD_VALUE (OID_WW_GEN_CURRENT_ADDRESS),
1821 ADD_VALUE (OID_WW_GEN_DEVICE_INFO),
1822 ADD_VALUE (OID_WW_GEN_DISABLE_TRANSMITTER),
1823 ADD_VALUE (OID_WW_GEN_ENCRYPTION_IN_USE),
1824 ADD_VALUE (OID_WW_GEN_ENCRYPTION_STATE),
1825 ADD_VALUE (OID_WW_GEN_ENCRYPTION_SUPPORTED),
1826 ADD_VALUE (OID_WW_GEN_EXTERNAL_POWER),
1827 ADD_VALUE (OID_WW_GEN_HEADER_FORMATS_SUPPORTED),
1828 ADD_VALUE (OID_WW_GEN_HEADER_FORMAT_IN_USE),
1829 ADD_VALUE (OID_WW_GEN_INDICATION_REQUEST),
1830 ADD_VALUE (OID_WW_GEN_LATENCY),
1831 ADD_VALUE (OID_WW_GEN_LOCK_STATUS),
1832 ADD_VALUE (OID_WW_GEN_NETWORK_ID),
1833 ADD_VALUE (OID_WW_GEN_NETWORK_TYPES_SUPPORTED),
1834 ADD_VALUE (OID_WW_GEN_NETWORK_TYPE_IN_USE),
1835 ADD_VALUE (OID_WW_GEN_OPERATION_MODE),
1836 ADD_VALUE (OID_WW_GEN_PERMANENT_ADDRESS),
1837 ADD_VALUE (OID_WW_GEN_RADIO_LINK_SPEED),
1838 ADD_VALUE (OID_WW_GEN_REGISTRATION_STATUS),
1839 ADD_VALUE (OID_WW_GEN_SUSPEND_DRIVER),
1840 ADD_VALUE (OID_WW_MBX_FLEXLIST),
1841 ADD_VALUE (OID_WW_MBX_GROUPLIST),
1842 ADD_VALUE (OID_WW_MBX_LIVE_DIE),
1843 ADD_VALUE (OID_WW_MBX_SUBADDR),
1844 ADD_VALUE (OID_WW_MBX_TEMP_DEFAULTLIST),
1845 ADD_VALUE (OID_WW_MBX_TRAFFIC_AREA),
1846 ADD_VALUE (OID_WW_MET_FUNCTION),
1847 ADD_VALUE (OID_WW_PIN_LAST_LOCATION),
1848 ADD_VALUE (OID_WW_PIN_LOC_AUTHORIZE),
1849 ADD_VALUE (OID_WW_PIN_LOC_FIX),
1850 ADD_VALUE (OID_WW_TAC_COMPRESSION),
1851 ADD_VALUE (OID_WW_TAC_GET_STATUS),
1852 ADD_VALUE (OID_WW_TAC_SET_CONFIG),
1853 ADD_VALUE (OID_WW_TAC_USER_HEADER),
1854 ADD_VALUE (OID_GEN_BYTES_RCV),
1855 ADD_VALUE (OID_GEN_BYTES_XMIT),
1856 ADD_VALUE (OID_GEN_RCV_DISCARDS)
1857};
1858#endif /* USE_DEBUG */
1859
1879BOOL PacketRequest2 (const ADAPTER *AdapterObject, BOOL set,
1880 PACKET_OID_DATA *oidData,
1881 const char *file, unsigned line)
1882{
1883 DWORD transfered, in_size, out_size;
1884 DWORD in_len, out_len;
1885 BOOL rc;
1886 int error = 0;
1887 char prof_buf[100] = "";
1888
1889#if defined(USE_PROFILER) && defined(USE_DEBUG)
1890 uint64 start = U64_SUFFIX (0);
1891
1892 if (profile_enable)
1893 start = win_get_perf_count();
1894#endif
1895
1896 transfered = 0;
1897 in_len = oidData->Length;
1898 in_size = sizeof(*oidData) - 1 + oidData->Length;
1899 out_size = in_size;
1900
1901 rc = DeviceIoControl (AdapterObject->hFile,
1902 set ? pBIOCSETOID : pBIOCQUERYOID,
1903 oidData, in_size, oidData, out_size, &transfered, NULL);
1904
1905 out_len = rc ? oidData->Length : 0;
1906
1907 if (!rc)
1908 error = GetLastError();
1909
1910#if defined(USE_DEBUG)
1911 #if defined(USE_PROFILER)
1912 if (profile_enable)
1913 {
1914 int64 clocks = (int64) (win_get_perf_count() - start);
1915 double msec = (double)clocks / ((double)clocks_per_usec * 1000.0);
1916 SNPRINTF (prof_buf, sizeof(prof_buf), " (%.3f ms)", msec);
1917 }
1918 #endif
1919
1920 winpkt_trace_func = "PacketRequest";
1921 winpkt_trace_file = file;
1922 winpkt_trace_line = line;
1923 winpkt_trace ("%-30.30s len %lu/%lu, xfered %lu, set %d, rc %d; %s %s\n",
1924 list_lookup(oidData->Oid,oid_list,DIM(oid_list)),
1925 (u_long)in_len, (u_long)out_len, (u_long)transfered, set, rc,
1926 !rc ? win_strerror(error) : "okay", prof_buf);
1927#endif
1928
1929 if (!rc)
1930 SetLastError (error);
1931 return (rc);
1932}
1933
1934/*
1935 * Formerly in AdInfo.c:
1936 *
1937 * This file contains the support functions used by packet.dll to retrieve
1938 * information about installed adapters, like
1939 *
1940 * - the adapter list
1941 * - the device associated to any adapter and the description of the adapter
1942 */
1943
1960static BOOL GetAddressesFromRegistry (const char *AdapterName,
1961 npf_if_addr *buffer,
1962 int *NEntries)
1963{
1964 struct sockaddr_in *TmpAddr, *TmpBroad;
1965 const char *guid;
1966 HKEY TcpIpKey = NULL, UnderTcpKey = NULL;
1967 char String [1024+1];
1968 DWORD RegType, BufLen, StringPos, DHCPEnabled, ZeroBroadcast;
1969 LONG status;
1970 DWORD line = 0;
1971 int naddrs, nmasks;
1972
1973 *NEntries = 0;
1974
1975 winpkt_trace_func = "GetAddressesFromRegistry";
1976
1977 guid = strchr (AdapterName, '{');
1978
1979 WINPKT_TRACE ("guid %s\n", guid);
1980
1981 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
1982 "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces",
1983 0, KEY_READ, &UnderTcpKey) == ERROR_SUCCESS)
1984 {
1985 status = RegOpenKeyExA (UnderTcpKey, guid, 0, KEY_READ, &TcpIpKey);
1986 line = __LINE__ - 1;
1987 if (status != ERROR_SUCCESS)
1988 goto fail;
1989 }
1990 else
1991 {
1992 HKEY SystemKey, ParametersKey, InterfaceKey;
1993
1994 /* Query the registry key with the interface's addresses
1995 */
1996 status = RegOpenKeyExA (HKEY_LOCAL_MACHINE,
1997 "SYSTEM\\CurrentControlSet\\Services",
1998 0, KEY_READ, &SystemKey);
1999 if (status != ERROR_SUCCESS)
2000 goto fail;
2001
2002 status = RegOpenKeyExA (SystemKey, guid, 0, KEY_READ, &InterfaceKey);
2003 line = __LINE__ - 1;
2004 RegCloseKey (SystemKey);
2005 if (status != ERROR_SUCCESS)
2006 goto fail;
2007
2008 status = RegOpenKeyExA (InterfaceKey, "Parameters", 0, KEY_READ,
2009 &ParametersKey);
2010 line = __LINE__ - 1;
2011 RegCloseKey (InterfaceKey);
2012 if (status != ERROR_SUCCESS)
2013 goto fail;
2014
2015 status = RegOpenKeyExA (ParametersKey, "TcpIp", 0, KEY_READ, &TcpIpKey);
2016 line = __LINE__ - 1;
2017 RegCloseKey (ParametersKey);
2018 if (status != ERROR_SUCCESS)
2019 goto fail;
2020
2021 BufLen = sizeof(String);
2022 }
2023
2024 BufLen = 4;
2025
2026 /* Try to detect if the interface has a zero broadcast addr
2027 */
2028 status = RegQueryValueExA (TcpIpKey, "UseZeroBroadcast", NULL,
2029 &RegType, (BYTE*)&ZeroBroadcast, &BufLen);
2030 if (status != ERROR_SUCCESS)
2031 ZeroBroadcast = 0;
2032
2033 BufLen = 4;
2034
2035 /* See if DHCP is used by this system
2036 */
2037 status = RegQueryValueExA (TcpIpKey, "EnableDHCP", NULL,
2038 &RegType, (BYTE*)&DHCPEnabled, &BufLen);
2039 if (status != ERROR_SUCCESS)
2040 DHCPEnabled = 0;
2041
2042 /* Retrieve the addresses
2043 */
2044 if (DHCPEnabled)
2045 {
2046 WINPKT_TRACE (" DHCP enabled\n");
2047
2048 BufLen = sizeof(String);
2049 status = RegQueryValueExA (TcpIpKey, "DhcpIPAddress", NULL,
2050 &RegType, (BYTE*)String, &BufLen);
2051 line = __LINE__ - 1;
2052 if (status != ERROR_SUCCESS)
2053 goto fail;
2054
2055 /* scan the key to obtain the addresses
2056 */
2057 StringPos = 0;
2058 for (naddrs = 0; naddrs < MAX_NETWORK_ADDRESSES; naddrs++)
2059 {
2060 TmpAddr = (struct sockaddr_in*) &buffer[naddrs].IPAddress;
2061 WINPKT_TRACE (" addr %s\n", String+StringPos);
2062
2063 TmpAddr->sin_addr.s_addr = htonl (aton(String+StringPos));
2064 if (TmpAddr->sin_addr.s_addr)
2065 {
2066 TmpAddr->sin_family = AF_INET;
2067 TmpBroad = (struct sockaddr_in*) &buffer[naddrs].Broadcast;
2068 TmpBroad->sin_family = AF_INET;
2069 if (!ZeroBroadcast)
2070 TmpBroad->sin_addr.s_addr = INADDR_BROADCAST;
2071 else TmpBroad->sin_addr.s_addr = INADDR_ANY;
2072
2073 while (*(String+StringPos))
2074 StringPos++;
2075 StringPos++;
2076
2077 if (*(String + StringPos) == '\0' || StringPos >= BufLen)
2078 break;
2079 }
2080 else
2081 break;
2082 }
2083
2084 BufLen = sizeof(String);
2085
2086 /* Open the key with the netmasks
2087 */
2088 status = RegQueryValueExA (TcpIpKey, "DhcpSubnetMask", NULL,
2089 &RegType, (BYTE*)String, &BufLen);
2090 line = __LINE__ - 1;
2091 if (status != ERROR_SUCCESS)
2092 goto fail;
2093
2094 /* scan the key to obtain the masks
2095 */
2096 StringPos = 0;
2097 for (nmasks = 0; nmasks < MAX_NETWORK_ADDRESSES; nmasks++)
2098 {
2099 TmpAddr = (struct sockaddr_in*) &buffer[nmasks].SubnetMask;
2100 WINPKT_TRACE (" addr %s\n", String+StringPos);
2101
2102 TmpAddr->sin_addr.s_addr = htonl (aton(String+StringPos));
2103 if (TmpAddr->sin_addr.s_addr)
2104 {
2105 TmpAddr->sin_family = AF_INET;
2106
2107 while (*(String + StringPos))
2108 StringPos++;
2109 StringPos++;
2110 if (*(String + StringPos) == '\0' || StringPos >= BufLen)
2111 break;
2112 }
2113 else
2114 break;
2115 }
2116
2117 /* The number of masks MUST be equal to the number of addresses
2118 */
2119 if (nmasks != naddrs)
2120 goto fail;
2121 }
2122 else /* Not DHCP enabled */
2123 {
2124 WINPKT_TRACE (" Not DHCP enabled\n");
2125
2126 BufLen = sizeof(String);
2127
2128 /* Open the key with the addresses
2129 */
2130 status = RegQueryValueExA (TcpIpKey, "IPAddress", NULL,
2131 &RegType, (BYTE*)String, &BufLen);
2132 line = __LINE__ - 1;
2133 if (status != ERROR_SUCCESS)
2134 goto fail;
2135
2136 /* scan the key to obtain the addresses
2137 */
2138 StringPos = 0;
2139 for (naddrs = 0; naddrs < MAX_NETWORK_ADDRESSES; naddrs++)
2140 {
2141 TmpAddr = (struct sockaddr_in*) &buffer[naddrs].IPAddress;
2142 WINPKT_TRACE (" addr %s\n", String+StringPos);
2143
2144 TmpAddr->sin_addr.s_addr = htonl (aton(String+StringPos));
2145 if (TmpAddr->sin_addr.s_addr)
2146 {
2147 TmpAddr->sin_family = AF_INET;
2148
2149 TmpBroad = (struct sockaddr_in*) &buffer[naddrs].Broadcast;
2150 TmpBroad->sin_family = AF_INET;
2151 if (!ZeroBroadcast)
2152 TmpBroad->sin_addr.s_addr = INADDR_BROADCAST;
2153 else TmpBroad->sin_addr.s_addr = INADDR_ANY;
2154
2155 while (*(String + StringPos))
2156 StringPos++;
2157 StringPos++;
2158
2159 if (*(String + StringPos) == '\0' || StringPos >= BufLen)
2160 break;
2161 }
2162 else
2163 break;
2164 }
2165
2166 /* Open the key with the netmasks
2167 */
2168 BufLen = sizeof(String);
2169 status = RegQueryValueExA (TcpIpKey, "SubnetMask", NULL,
2170 &RegType, (BYTE*)String, &BufLen);
2171 line = __LINE__ - 1;
2172 if (status != ERROR_SUCCESS)
2173 goto fail;
2174
2175 /* scan the key to obtain the masks
2176 */
2177 StringPos = 0;
2178 for (nmasks = 0; nmasks < MAX_NETWORK_ADDRESSES; nmasks++)
2179 {
2180 TmpAddr = (struct sockaddr_in*) &buffer[nmasks].SubnetMask;
2181 WINPKT_TRACE (" mask %s\n", String+StringPos);
2182
2183 TmpAddr->sin_addr.s_addr = htonl (aton(String+StringPos));
2184 if (TmpAddr->sin_addr.s_addr)
2185 {
2186 TmpAddr->sin_family = AF_INET;
2187
2188 while (*(String + StringPos) != 0)
2189 StringPos++;
2190 StringPos++;
2191
2192 if (*(String + StringPos) == 0 || StringPos >= BufLen)
2193 break;
2194 }
2195 else
2196 break;
2197 }
2198
2199 /* The number of masks MUST be equal to the number of addresses
2200 */
2201 if (nmasks != naddrs)
2202 goto fail;
2203 }
2204
2205 *NEntries = naddrs + 1;
2206
2207 RegCloseKey (TcpIpKey);
2208 RegCloseKey (UnderTcpKey);
2209
2210 return (status != ERROR_SUCCESS);
2211
2212fail:
2213 WINPKT_TRACE ("failed line %lu; %s\n", (u_long)line, win_strerror(GetLastError()));
2214
2215 if (TcpIpKey)
2216 RegCloseKey (TcpIpKey);
2217 if (UnderTcpKey)
2218 RegCloseKey (UnderTcpKey);
2219 *NEntries = 0;
2220 ARGSUSED (line);
2221 return (FALSE);
2222}
2223
2233static BOOL AddAdapter (const char *AdName)
2234{
2235 ADAPTER_INFO *TmpAdInfo = NULL;
2236 ADAPTER *adapter = NULL;
2237 BOOL rc = FALSE;
2238
2239 winpkt_trace_func = "AddAdapter";
2240 WINPKT_TRACE ("adapter %s\n", AdName);
2241
2242 WaitForSingleObject (adapters_mutex, INFINITE);
2243
2244 for (TmpAdInfo = adapters_list; TmpAdInfo; TmpAdInfo = TmpAdInfo->Next)
2245 {
2246 if (!strcmp(AdName, TmpAdInfo->Name))
2247 {
2248 WINPKT_TRACE ("adapter already present in the list\n");
2249 ReleaseMutex (adapters_mutex);
2250 return (TRUE);
2251 }
2252 }
2253
2254 TmpAdInfo = NULL;
2255
2256 /* Here we could have released the mutex, but what happens if two
2257 * threads try to add the same adapter? The adapter would be duplicated
2258 * on the linked list.
2259 */
2260
2261 /* Try to Open the adapter
2262 */
2263 adapter = PacketOpenAdapterNPF (AdName);
2264 winpkt_trace_func = "AddAdapter";
2265
2266 if (!adapter)
2267 goto quit;
2268
2269 /* PacketOpenAdapter() was succesful. Consider this a valid adapter
2270 * and allocate an entry for it In the adapter list.
2271 */
2272 TmpAdInfo = GlobalAllocPtr (GlobalAllocPtr_FLAGS, sizeof(*TmpAdInfo));
2273 if (!TmpAdInfo)
2274 {
2275 WINPKT_TRACE ("GlobalAllocPtr Failed\n");
2276 goto quit;
2277 }
2278
2279 adapter->info = TmpAdInfo;
2280
2281 /* Copy the device name
2282 */
2283 strcpy (TmpAdInfo->Name, AdName);
2284
2285 GetAddressesFromRegistry (TmpAdInfo->Name,
2286 TmpAdInfo->NetworkAddresses,
2287 &TmpAdInfo->NNetworkAddresses);
2288
2289 /* Update the AdaptersInfo list
2290 */
2291 TmpAdInfo->Next = adapters_list;
2292 adapters_list = TmpAdInfo;
2293
2294 rc = TRUE;
2295
2296quit:
2297 /* Close it; we don't need it until user open it again.
2298 */
2299 if (adapter)
2300 PacketCloseAdapter (adapter);
2301 if (!rc && TmpAdInfo)
2302 GlobalFreePtr (TmpAdInfo);
2303 ReleaseMutex (adapters_mutex);
2304 return (rc);
2305}
2306
2315static BOOL PacketGetAdapters (void)
2316{
2317 HKEY LinkageKey, AdapKey, OneAdapKey;
2318 DWORD RegKeySize = 0;
2319 DWORD dim, RegType;
2320 char TName[256];
2321 char TAName[256];
2322 char AdapName[256];
2323 const char *guid, *err, *prefix = (have_npcap ? NPCAP_prefix : NPF_prefix);
2324 LONG Status;
2325 int i = 0;
2326
2327 winpkt_trace_func = "PacketGetAdapters";
2328 WINPKT_TRACE ("\n");
2329
2330 Status = RegOpenKeyExA (HKEY_LOCAL_MACHINE, ADAPTER_KEY_CLASS,
2331 0, KEY_READ, &AdapKey);
2332 i = 0;
2333
2334 if (Status != ERROR_SUCCESS)
2335 {
2336 WINPKT_TRACE ("RegOpenKeyEx ( Class\\{networkclassguid} ) Failed\n");
2337 goto nt4;
2338 }
2339
2340 WINPKT_TRACE ("cycling through the adapters: (have_npcap: %d)\n", have_npcap);
2341
2342 /* Cycle through the entries inside the ADAPTER_KEY_CLASS key
2343 * to get the names of the adapters
2344 */
2345 while (RegEnumKeyA (AdapKey, i, AdapName, sizeof(AdapName)) == ERROR_SUCCESS)
2346 {
2347 WINPKT_TRACE (" loop %d: sub-key %s\n", i, AdapName);
2348 i++;
2349
2350 /* Get the adapter name from the registry key
2351 */
2352 Status = RegOpenKeyExA (AdapKey, AdapName, 0, KEY_READ, &OneAdapKey);
2353 if (Status != ERROR_SUCCESS)
2354 {
2355 WINPKT_TRACE (" RegOpenKeyEx (OneAdapKey) Failed; %s\n",
2356 win_strerror(GetLastError()));
2357 continue;
2358 }
2359
2360 Status = RegOpenKeyExA (OneAdapKey, "Linkage", 0, KEY_READ, &LinkageKey);
2361 if (Status != ERROR_SUCCESS)
2362 {
2363 WINPKT_TRACE (" RegOpenKeyEx (LinkageKey) Failed; %s\n",
2364 win_strerror(GetLastError()));
2365 RegCloseKey (OneAdapKey);
2366 continue;
2367 }
2368
2369 dim = sizeof(TName);
2370 Status = RegQueryValueExA (LinkageKey, "Export", NULL, NULL,
2371 (BYTE*)TName, &dim);
2372 err = win_strerror (GetLastError());
2373 RegCloseKey (OneAdapKey);
2374 RegCloseKey (LinkageKey);
2375 if (Status != ERROR_SUCCESS)
2376 {
2377 WINPKT_TRACE (" Name = SKIPPED (error reading the key); %s\n", err);
2378 continue;
2379 }
2380 if (!TName[0])
2381 {
2382 WINPKT_TRACE (" Name = SKIPPED (empty name)\n");
2383 continue;
2384 }
2385 guid = strchr (TName, '{');
2386 if (!guid)
2387 {
2388 WINPKT_TRACE (" Name = SKIPPED (missing GUID)\n");
2389 continue;
2390 }
2391
2392 WINPKT_TRACE (" key %d: %s\n", i, TName);
2393
2394 /* Put the \Device\NPF_ string at the beginning of the name
2395 */
2396 SNPRINTF (TAName, sizeof(TAName), "%s%s", prefix, guid);
2397
2398 /* If the adapter is valid, add it to the list.
2399 */
2400 AddAdapter (TAName);
2401 winpkt_trace_func = "PacketGetAdapters";
2402 }
2403
2404 RegCloseKey (AdapKey);
2405
2406nt4:
2407
2408 /*
2409 * No adapters were found under 'ADAPTER_KEY_CLASS'.
2410 * This means with great probability that we are under Win-NT 4, so we
2411 * try to look under the tcpip bindings.
2412 */
2413
2414 if (i == 0)
2415 WINPKT_TRACE ("Adapters not found under %s. Using the TCP/IP bindings.\n",
2416 ADAPTER_KEY_CLASS);
2417 else WINPKT_TRACE ("Trying NT4 bindings anyway\n");
2418
2419 Status = RegOpenKeyExA (HKEY_LOCAL_MACHINE,
2420 "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Linkage",
2421 0, KEY_READ, &LinkageKey);
2422 if (Status == ERROR_SUCCESS)
2423 {
2424 BYTE *bpStr;
2425
2426 /* Retrieve the length of the binding key
2427 */
2428 RegQueryValueExA (LinkageKey, "bind", NULL, &RegType,
2429 NULL, &RegKeySize);
2430
2431 bpStr = calloc (RegKeySize+1, 1);
2432 if (!bpStr)
2433 return (FALSE);
2434
2435 /* Query the key again to get its content
2436 */
2437 RegQueryValueExA (LinkageKey, "bind", NULL, &RegType,
2438 bpStr, &RegKeySize);
2439 RegCloseKey (LinkageKey);
2440
2441 /* Loop over the space separated "\Device\{.." strings.
2442 */
2443 for (guid = strchr((const char*)bpStr,'{');
2444 guid;
2445 guid = strchr(guid+1,'{'))
2446 {
2447 SNPRINTF (TAName, sizeof(TAName), "%s%s", prefix, guid);
2448 AddAdapter (TAName);
2449 winpkt_trace_func = "PacketGetAdapters";
2450 }
2451 free (bpStr);
2452 }
2453 else
2454 {
2455 WINPKT_TRACE ("Cannot find the TCP/IP bindings");
2456 return (FALSE);
2457 }
2458 return (TRUE);
2459}
2460
2467const ADAPTER_INFO *PacketFindAdInfo (const char *AdapterName)
2468{
2469 const ADAPTER_INFO *ad_info;
2470
2471 winpkt_trace_func = "PacketFindAdInfo";
2472 WINPKT_TRACE ("\n");
2473
2474 for (ad_info = adapters_list; ad_info; ad_info = ad_info->Next)
2475 if (!strcmp(ad_info->Name, AdapterName))
2476 break;
2477 return (ad_info);
2478}
2479
2483const ADAPTER_INFO *PacketGetAdInfo (void)
2484{
2485 winpkt_trace_func = "PacketGetAdInfo";
2486 WINPKT_TRACE ("adapters_list: 0x%p\n", adapters_list);
2487
2488 return (adapters_list);
2489}
2490
2497static BOOL PopulateAdaptersInfoList (void)
2498{
2499 BOOL rc = TRUE;
2500
2501 winpkt_trace_func = "PopulateAdaptersInfoList";
2502 WINPKT_TRACE ("\n");
2503
2504 WaitForSingleObject (adapters_mutex, INFINITE);
2505
2506 adapters_list = NULL;
2507
2508 /* Fill the list
2509 */
2510 if (!PacketGetAdapters())
2511 {
2512 WINPKT_TRACE ("registry scan for adapters failed!\n");
2513 rc = FALSE;
2514 }
2515 ReleaseMutex (adapters_mutex);
2516 return (rc);
2517}
2518
2522static BOOL FreeAdaptersInfoList (void)
2523{
2524 ADAPTER_INFO *next, *ai;
2525
2526 WaitForSingleObject (adapters_mutex, INFINITE);
2527
2528 winpkt_trace_func = __FUNCTION__;
2529 WINPKT_TRACE ("\n");
2530
2531 for (ai = adapters_list; ai; ai = next)
2532 {
2533 next = ai->Next;
2534 WINPKT_TRACE ("name: '%s', next: 0x%p\n", ai->Name, next);
2535 GlobalFreePtr (ai);
2536 }
2537 adapters_list = NULL;
2538 return (TRUE);
2539}
2540
2541BOOL WanPacketSetBpfFilter (WAN_ADAPTER *wan_adapter, PUCHAR FilterCode, DWORD Length)
2542{
2543 return (use_wanpacket ? (*p_WanPacketSetBpfFilter)(wan_adapter, FilterCode, Length) : FALSE);
2544}
2545
2546WAN_ADAPTER *WanPacketOpenAdapter (void)
2547{
2548 return (use_wanpacket ? (*p_WanPacketOpenAdapter)() : NULL);
2549}
2550
2551BOOL WanPacketCloseAdapter (WAN_ADAPTER *wan_adapter)
2552{
2553 return (use_wanpacket ? (*p_WanPacketCloseAdapter)(wan_adapter) : FALSE);
2554}
2555
2556BOOL WanPacketSetBufferSize (WAN_ADAPTER *wan_adapter, DWORD BufferSize)
2557{
2558 return (use_wanpacket ? (*p_WanPacketSetBufferSize)(wan_adapter, BufferSize) : FALSE);
2559}
2560
2561DWORD WanPacketReceivePacket (WAN_ADAPTER *wan_adapter, PUCHAR Buffer, DWORD BufferSize)
2562{
2563 return (use_wanpacket ? (*p_WanPacketReceivePacket)(wan_adapter, Buffer, BufferSize) : 0UL);
2564}
2565
2566BOOL WanPacketSetMinToCopy (WAN_ADAPTER *wan_adapter, DWORD MinToCopy)
2567{
2568 return (use_wanpacket ? (*p_WanPacketSetMinToCopy)(wan_adapter, MinToCopy) : FALSE);
2569}
2570
2571BOOL WanPacketGetStats (WAN_ADAPTER *wan_adapter, struct bpf_stat *s)
2572{
2573 return (use_wanpacket ? (*p_WanPacketGetStats)(wan_adapter, s) : FALSE);
2574}
2575
2576BOOL WanPacketSetReadTimeout (WAN_ADAPTER *wan_adapter, DWORD ReadTimeout)
2577{
2578 return (use_wanpacket ? (*p_WanPacketSetReadTimeout)(wan_adapter, ReadTimeout) : FALSE);
2579}
2580
2581BOOL WanPacketSetMode (WAN_ADAPTER *wan_adapter, DWORD Mode)
2582{
2583 return (use_wanpacket ? (*p_WanPacketSetMode)(wan_adapter, Mode) : FALSE);
2584}
2585
2586HANDLE WanPacketGetReadEvent (WAN_ADAPTER *wan_adapter)
2587{
2588 return (use_wanpacket ? (*p_WanPacketGetReadEvent)(wan_adapter) : NULL);
2589}
2590
2591BOOL WanPacketTestAdapter (void)
2592{
2593 return (use_wanpacket ? (*p_WanPacketTestAdapter)() : FALSE);
2594}
2595#endif /* WIN32 */
cpumodel.h
socket.h
_watt_os_ver
WORD _watt_os_ver
Definition: misc.c:74
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
misc.h
_watt_is_win9x
BOOL _watt_is_win9x
Definition: winmisc.c:49
get_file_version
BOOL get_file_version(const char *file, char *buf, size_t buf_len)
Returns the version of a PE image (.sys, .dll or .exe).
Definition: winmisc.c:227
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
aton
DWORD W32_CALL aton(const char *str)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
Definition: netaddr.c:86
netaddr.h
pcconfig.h
pcdbug.h
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
pcpkt.h
profile.h
ADAPTER_INFO
Contains some information about a network adapter.
Definition: packet32.h:184
ADAPTER
Describes an opened network adapter.
Definition: packet32.h:194
PACKET_OID_DATA
Structure containing an OID request.
Definition: packet32.h:218
bpf_stat
Definition: packet32.h:251
npf_if_addr
Addresses of a network adapter.
Definition: packet32.h:168
search_list
Definition: misc.h:131
sockaddr_in
Definition: in.h:224
clocks_per_usec
DWORD clocks_per_usec
Measured CPU speed (MHz)
Definition: timer.c:64
timer.h
w32_ndis.h
wattcp.h
Core definitions.
int64
long long int64
our signed "long long" type
Definition: wattcp.h:66
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65
win_dll.h
win_strerror
char *W32_CALL win_strerror(DWORD err)
Return err-number and string for 'err'.
Definition: winmisc.c:208
winpkt.h


Watt-32 tcp/ip: E:/WATT/src/packet32.h Source File

  • src
packet32.h
1/*
2 * Copyright (c) 1999 - 2003
3 * NetGroup, Politecnico di Torino (Italy)
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the Politecnico di Torino nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#ifndef _w32_PACKET32_H
33#define _w32_PACKET32_H
34
35/* Never include old-style BPF stuff here; use the WinPcap
36 * definition copied in below
37 */
38#define __NET_BPF_H
39
40#ifdef __DMC__
41#include <win32/wtypes.h> /* DMC has <wtypes.h> in include path */
42#endif
43
44#include <winioctl.h>
45#include <netinet/in.h> /* struct sockaddr_storage */
46
47/* Working modes
48 */
49#define PACKET_MODE_CAPT 0x0 /* Capture mode */
50#define PACKET_MODE_STAT 0x1 /* Statistical mode */
51#define PACKET_MODE_MON 0x2 /* Monitoring mode */
52#define PACKET_MODE_DUMP 0x10 /* Dump mode */
53#define PACKET_MODE_STAT_DUMP (MODE_STAT|MODE_DUMP) /* Statistical dump Mode */
54
55/* Loopback behaviour definitions
56 */
57#define NPF_DISABLE_LOOPBACK 1 /* Drop the packets sent by the NPF driver */
58#define NPF_ENABLE_LOOPBACK 2 /* Capture the packets sent by the NPF driver (default) */
59
60/*
61 * Macro definition for defining IOCTL and FSCTL function control codes. Note
62 * that function codes 0-2047 are reserved for Microsoft Corporation, and
63 * 2048-4095 are reserved for customers.
64 */
65#ifndef CTL_CODE
66#define CTL_CODE(DeviceType, Function, Method, Access) ( \
67 ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) )
68#endif
69
70/* Define the method codes for how buffers are passed for I/O and FS controls.
71 * These constants are normally defined in <winioctl.h> and/or <winddk.h>.
72 */
73#ifndef METHOD_BUFFERED
74#define METHOD_BUFFERED 0
75#endif
76
77#ifndef METHOD_IN_DIRECT
78#define METHOD_IN_DIRECT 1
79#endif
80
81#ifndef METHOD_OUT_DIRECT
82#define METHOD_OUT_DIRECT 2
83#endif
84
85#ifndef METHOD_NEITHER
86#define METHOD_NEITHER 3
87#endif
88
89#if 0
90 /*
91 * Duplicates from <WinIoCtl.h>:
92 * The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in
93 * ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these
94 * constants *MUST* always be in sync.
95 */
96 #ifndef FILE_ANY_ACCESS
97 #define FILE_ANY_ACCESS 0
98 #endif
99
100 #ifndef FILE_READ_ACCESS
101 #define FILE_READ_ACCESS 0x0001 /* file & pipe */
102 #endif
103
104 #ifndef FILE_READ_ACCESS
105 #define FILE_WRITE_ACCESS 0x0002 /* file & pipe */
106 #endif
107
108 /* ioctls
109 */
110 #ifndef FILE_DEVICE_PROTOCOL
111 #define FILE_DEVICE_PROTOCOL 0x8000
112 #endif
113
114 #ifndef FILE_DEVICE_PHYSICAL_NETCARD
115 #define FILE_DEVICE_PHYSICAL_NETCARD 0x0017
116 #endif
117
118 #define IOCTL_PROTOCOL_STATISTICS CTL_CODE (FILE_DEVICE_PROTOCOL, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
119 #define IOCTL_PROTOCOL_RESET CTL_CODE (FILE_DEVICE_PROTOCOL, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)
120 #define IOCTL_PROTOCOL_READ CTL_CODE (FILE_DEVICE_PROTOCOL, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
121 #define IOCTL_PROTOCOL_WRITE CTL_CODE (FILE_DEVICE_PROTOCOL, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
122 #define IOCTL_PROTOCOL_MACNAME CTL_CODE (FILE_DEVICE_PROTOCOL, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
123 #define IOCTL_OPEN CTL_CODE (FILE_DEVICE_PROTOCOL, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
124 #define IOCTL_CLOSE CTL_CODE (FILE_DEVICE_PROTOCOL, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
125#endif /* 0 */
126
127#define pBIOCSETBUFFERSIZE 9592 /* set kernel buffer size */
128#define pBIOCSETF 9030 /* set packet filtering program */
129#define pBIOCGSTATS 9031 /* get the capture stats */
130#define pATTACHPROCESS 7117 /* attach a process to the driver. Used in Win9x only */
131#define pDETACHPROCESS 7118 /* detach a process from the driver. Used in Win9x only */
132#define pBIOCISETLOBBEH 7410 /* set the loopback behavior of the driver with packets sent by itself: capture or drop */
133#define pBIOCSMODE 7412 /* set working mode */
134#define pBIOCSWRITEREP 7413 /* set number of physical repetions of every packet written by the app. */
135#define pBIOCSMINTOCOPY 7414 /* set minimum amount of data in the kernel buffer that unlocks a read call */
136#define pBIOCEVNAME 7415 /* get the name of the event that the driver signals when some data is present in the buffer */
137#define pBIOCSRTIMEOUT 7416 /* set the read timeout */
138#define pBIOCSETEVENTHANDLE 7920 /* Passes the read event HANDLE allocated by user to the kernel level driver. */
139#define pBIOCSETDUMPFILENAME 9029 /* set the name of a the file used by kernel dump mode */
140#define pBIOCSENDPACKETSNOSYNC 9032 /* send a buffer containing multiple packets to the network, ignoring the timestamps associated with the packets */
141#define pBIOCSENDPACKETSSYNC 9033 /* send a buffer containing multiple packets to the network, respecting the timestamps associated with the packets */
142#define pBIOCSETDUMPLIMITS 9034 /* set the dump file limits. See the PacketSetDumpLimits() function */
143#define pBIOCSETOID 2147483648U /* set an OID value */
144#define pBIOCQUERYOID 2147483652U /* get an OID value */
145
146/* Alignment macro. Defines the alignment size.
147 */
148#define Packet_ALIGNMENT sizeof(int)
149
150/* Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT.
151 */
152#define Packet_WORDALIGN(x) (((x) + (Packet_ALIGNMENT-1)) & ~(Packet_ALIGNMENT-1))
153
154#if 0
155 #define NdisMediumNull -1 /* Custom linktype: NDIS doesn't provide an equivalent */
156 #define NdisMediumCHDLC -2 /* Custom linktype: NDIS doesn't provide an equivalent */
157 #define NdisMediumPPPSerial -3 /* Custom linktype: NDIS doesn't provide an equivalent */
158 #define NdisMediumBare80211 -4 /* Custom linktype: NDIS doesn't provide an equivalent */
159 #define NdisMediumRadio80211 -5 /* Custom linktype: NDIS doesn't provide an equivalent */
160#endif
161
168typedef struct npf_if_addr {
169 struct sockaddr_storage IPAddress;
170 struct sockaddr_storage SubnetMask;
171 struct sockaddr_storage Broadcast;
172 } npf_if_addr;
173
174
175#define MAX_LINK_NAME_LENGTH 64 /* Maximum length of the devices symbolic links */
176#define ADAPTER_NAME_LENGTH (256+12) /* Max length for the name of an adapter */
177#define ADAPTER_DESC_LENGTH 128 /* Max length for the description of an adapter */
178#define MAX_MAC_ADDR_LENGTH 8 /* Max length for the link layer address */
179#define MAX_NETWORK_ADDRESSES 16 /* Max # of network layer addresses */
180
184typedef struct ADAPTER_INFO {
185 struct ADAPTER_INFO *Next;
186 char Name [ADAPTER_NAME_LENGTH+1];
187 int NNetworkAddresses;
188 struct npf_if_addr NetworkAddresses [MAX_NETWORK_ADDRESSES];
189 } ADAPTER_INFO;
190
194typedef struct ADAPTER {
195 HANDLE hFile;
196 HANDLE ReadEvent;
197 UINT ReadTimeOut;
198 DWORD flags;
199 struct ADAPTER_INFO *info;
200 } ADAPTER;
201
205#define INFO_FLAG_NDIS_ADAPTER 0
206#define INFO_FLAG_NDISWAN_ADAPTER 1
207#define INFO_FLAG_AIRPCAP_CARD 16
208#define INFO_FLAG_NPFIM_DEVICE 32
209
218typedef struct PACKET_OID_DATA {
219 DWORD Oid;
220 DWORD Length;
221 BYTE Data[1];
222 } PACKET_OID_DATA;
223
224W32_CLANG_PACK_WARN_OFF()
225
226#include <sys/pack_on.h>
227
228/* The 'struct timeval' layout of a 32-bit NPF.SYS driver.
229 * It can NOT be 'long' to work on a 64-bit application.
230 */
231struct npf_driver_timeval {
232 int32_t tv_sec;
233 int32_t tv_usec;
234 };
235
241struct bpf_hdr {
242 struct npf_driver_timeval bh_tstamp; /* The timestamp associated with the captured packet */
243 DWORD bh_caplen; /* Length of captured portion */
244 DWORD bh_datalen; /* Original length of packet */
245 WORD bh_hdrlen; /* Length of bpf header (this struct plus alignment padding) */
246 };
247
248
249/* The receive statistics structure from NPF.
250 */
251struct bpf_stat {
252 DWORD bs_recv; /* # of packets that the driver received from the network adapter */
253 DWORD bs_drop; /* # of packets that the driver lost from the beginning of a capture */
254 DWORD ps_ifdrop; /* drops by interface. XXX not yet supported */
255 DWORD bs_capt; /* # of packets that pass the filter */
256 };
257
258#include <sys/pack_off.h>
259
260W32_CLANG_PACK_WARN_DEF()
261
262/*
263 * Protect these symbols with a namespace. Thus allowing Watt-32 (static) to
264 * be used in libpcap/WinPcap programs.
265 */
266
267#define PacketInitModule W32_NAMESPACE (PacketInitModule)
268#define PacketExitModule W32_NAMESPACE (PacketExitModule)
269#define PacketOpenAdapter W32_NAMESPACE (PacketOpenAdapter)
270#define PacketFindAdInfo W32_NAMESPACE (PacketFindAdInfo)
271#define PacketGetAdInfo W32_NAMESPACE (PacketGetAdInfo)
272#define PacketCloseAdapter W32_NAMESPACE (PacketCloseAdapter)
273#define PacketRequest2 W32_NAMESPACE (PacketRequest2)
274#define PacketInstallDriver W32_NAMESPACE (PacketInstallDriver)
275#define PacketGetDriverVersion W32_NAMESPACE (PacketGetDriverVersion)
276#define PacketGetMacAddress W32_NAMESPACE (PacketGetMacAddress)
277#define PacketSetMode W32_NAMESPACE (PacketSetMode)
278#define PacketSetBuff W32_NAMESPACE (PacketSetBuff)
279#define PacketSetMinToCopy W32_NAMESPACE (PacketSetMinToCopy)
280#define PacketSetReadTimeout W32_NAMESPACE (PacketSetReadTimeout)
281#define PacketGetReadEvent W32_NAMESPACE (PacketGetReadEvent)
282#define PacketGetStatsEx W32_NAMESPACE (PacketGetStatsEx)
283#define PacketReceivePacket W32_NAMESPACE (PacketReceivePacket)
284#define PacketSendPacket W32_NAMESPACE (PacketSendPacket)
285#define PacketSetLoopbackBehavior W32_NAMESPACE (PacketSetLoopbackBehavior)
286
287BOOL PacketInitModule (void);
288BOOL PacketExitModule (void);
289
290const ADAPTER *PacketOpenAdapter (const char *adapter_name);
291const ADAPTER_INFO *PacketFindAdInfo (const char *adapter_name);
292const ADAPTER_INFO *PacketGetAdInfo (void);
293BOOL PacketCloseAdapter (ADAPTER *adapter);
294const char *PacketGetDriverVersion (void);
295
296BOOL PacketRequest2 (const ADAPTER *adapter, BOOL Set, PACKET_OID_DATA *OidData,
297 const char *file, unsigned line);
298
299#define PacketRequest(a,set,oid) PacketRequest2 (a, set, oid, __FILE__, __LINE__)
300
301BOOL PacketGetMacAddress (const ADAPTER *adapter, void *mac);
302BOOL PacketSetMode (const ADAPTER *adapter, DWORD mode);
303BOOL PacketSetBuff (const ADAPTER *adapter, DWORD dim);
304BOOL PacketSetMinToCopy (const ADAPTER *adapter, int nbytes);
305BOOL PacketSetReadTimeout (ADAPTER *adapter, int timeout);
306HANDLE PacketGetReadEvent (const ADAPTER *adapter);
307BOOL PacketGetStatsEx (const ADAPTER *adapter, struct bpf_stat *st);
308UINT PacketSendPacket (const ADAPTER *adapter, const void *buf, UINT len);
309BOOL PacketSetLoopbackBehavior (const ADAPTER *adapter, UINT LoopbackBehavior);
310
311UINT MS_CDECL PacketReceivePacket (const ADAPTER *adapter, void *buf, UINT buf_len);
312
313/* WanPacket stuff (move to a new WanPacket.h?)
314 */
315
316typedef void WAN_ADAPTER; /* The details of this struct is not important to us.
317 * Ref. WAN_ADAPTER_INT in WanPacket.cpp (from CACE Technologies)
318 */
319
320/*
321 * Protect these symbols in our own namespace in case we use the real
322 * WinPcap/libpcap with a static version of Watt-32.
323 */
324#define WanPacketSetBpfFilter W32_NAMESPACE (WanPacketSetBpfFilter)
325#define WanPacketOpenAdapter W32_NAMESPACE (WanPacketOpenAdapter)
326#define WanPacketCloseAdapter W32_NAMESPACE (WanPacketCloseAdapter)
327#define WanPacketSetBufferSize W32_NAMESPACE (WanPacketSetBufferSize)
328#define WanPacketReceivePacket W32_NAMESPACE (WanPacketReceivePacket)
329#define WanPacketSetMinToCopy W32_NAMESPACE (WanPacketSetMinToCopy)
330#define WanPacketGetStats W32_NAMESPACE (WanPacketGetStats)
331#define WanPacketSetReadTimeout W32_NAMESPACE (WanPacketSetReadTimeout)
332#define WanPacketSetMode W32_NAMESPACE (WanPacketSetMode)
333#define WanPacketGetReadEvent W32_NAMESPACE (WanPacketGetReadEvent)
334#define WanPacketTestAdapter W32_NAMESPACE (WanPacketTestAdapter)
335
336BOOL WanPacketSetBpfFilter (WAN_ADAPTER *wan_adapter, PUCHAR FilterCode, DWORD Length);
337WAN_ADAPTER *WanPacketOpenAdapter (void);
338BOOL WanPacketCloseAdapter (WAN_ADAPTER *wan_adapter);
339BOOL WanPacketSetBufferSize (WAN_ADAPTER *wan_adapter, DWORD BufferSize);
340DWORD WanPacketReceivePacket (WAN_ADAPTER *wan_adapter, PUCHAR Buffer, DWORD BufferSize);
341BOOL WanPacketSetMinToCopy (WAN_ADAPTER *wan_adapter, DWORD MinToCopy);
342BOOL WanPacketGetStats (WAN_ADAPTER *wan_adapter, struct bpf_stat *s);
343BOOL WanPacketSetReadTimeout (WAN_ADAPTER *wan_adapter, DWORD ReadTimeout);
344BOOL WanPacketSetMode (WAN_ADAPTER *wan_adapter, DWORD Mode);
345HANDLE WanPacketGetReadEvent (WAN_ADAPTER *wan_adapter);
346BOOL WanPacketTestAdapter (void);
347
348#endif /* _w32_PACKET32_H */
in.h
pack_off.h
ADAPTER_INFO
Contains some information about a network adapter.
Definition: packet32.h:184
ADAPTER
Describes an opened network adapter.
Definition: packet32.h:194
PACKET_OID_DATA
Structure containing an OID request.
Definition: packet32.h:218
bpf_hdr
Berkeley Packet Filter header.
Definition: packet32.h:241
bpf_stat
Definition: packet32.h:251
npf_if_addr
Addresses of a network adapter.
Definition: packet32.h:168
sockaddr_storage
Definition: in.h:245


Watt-32 tcp/ip: E:/WATT/src/pc_cbrk.c File Reference

  • src
Functions | Variables
pc_cbrk.c File Reference

Go to the source code of this file.

Functions

pragma | Alias (_mwstack_limit, "_mwstack_limit")
void MS_CDECL | sig_handler_watt (int sig)
SIGINT/SIGBREAK handler function.
int | set_cbreak (int want_brk)
Sets normal and extended BREAK mode.
static BOOL WINAPI | console_handler (DWORD event)
int W32_CALL | tcp_cbreak (int mode)
Sets our break mode.
BOOL | tcp_cbreak_off (void)
void | usage (const char *argv0)
int | main (int argc, char **argv)

Variables

UINT | _mwstack_limit [2]
WORD | _watt_handle_cbreak = 0
Turn off stack-checking here because stack may be out of bounds.
volatile int | _watt_cbroke = 0
static int | cbreak_mode
static jmp_buf | sig_jmp
int | old_brk = -1

Detailed Description

Ctrl-C, Ctrl-Break handling.

Definition in file pc_cbrk.c.

Function Documentation

◆ console_handler()

static BOOL WINAPI console_handler ( DWORD event )
static

Definition at line 190 of file pc_cbrk.c.

◆ main()

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 268 of file pc_cbrk.c.

◆ set_cbreak()

int set_cbreak ( int want_brk )

Sets normal and extended BREAK mode.

  • want_brk 0x0000: no ^BREAK checking.
  • want_brk 0x0001: normal ^BREAK checks.
  • want_brk 0x0101: extended ^BREAK checks.
Return values
normal BREAK state in LSB, extended BREAK state in MSB.

Definition at line 130 of file pc_cbrk.c.

◆ sig_handler_watt()

void MS_CDECL sig_handler_watt ( int sig )

SIGINT/SIGBREAK handler function.

The Windows runtime docs at http://msdn.microsoft.com/library/en-us/vclib/html/_crt_signal.asp specifically forbid a number of things being done from a signal handler, including IO, memory allocation and system calls, and only allow jmpbuf if you are handling SIGFPE.

Hence sig_handler_watt() on Win32 simply increments the '_watt_cbroke' variable.

Also note the behaviour of Windows with SIGINT, which says this: Note SIGINT is not supported for any Win32 application, including Windows 98/Me and Windows NT/2000/XP. When a CTRL+C interrupt occurs, Win32 operating systems generate a new thread to specifically handle that interrupt. This can cause a single-thread application such as UNIX, to become multithreaded, resulting in unexpected behavior.

So a longjmp() from handler-thread to main-thread is out of the question.

Definition at line 74 of file pc_cbrk.c.

References _watt_cbroke, _watt_handle_cbreak, set_cbreak(), and sig_handler_watt().

◆ tcp_cbreak()

int W32_CALL tcp_cbreak ( int mode )

Sets our break mode.

  • ‘mode’ is composed of the following flags
    • 0x01: disallow breakouts
    • 0x10: display a message upon ^C/^BREAK (default)

Definition at line 208 of file pc_cbrk.c.

References set_cbreak(), sig_handler_watt(), sock_sig_exit(), and win32_dos_box.

◆ tcp_cbreak_off()

BOOL tcp_cbreak_off ( void )

Definition at line 253 of file pc_cbrk.c.

◆ usage()

void usage ( const char * argv0 )

Definition at line 260 of file pc_cbrk.c.

Variable Documentation

◆ _watt_cbroke

volatile int _watt_cbroke = 0

increment on SIGINT catch

Definition at line 48 of file pc_cbrk.c.

◆ _watt_handle_cbreak

WORD _watt_handle_cbreak = 0

Turn off stack-checking here because stack may be out of bounds.

longjmp() hopefully fixes that. changes operation of the break stuff

Definition at line 47 of file pc_cbrk.c.

◆ cbreak_mode

int cbreak_mode
static

Definition at line 50 of file pc_cbrk.c.

◆ old_brk

int old_brk = -1

Definition at line 266 of file pc_cbrk.c.

◆ sig_jmp

jmp_buf sig_jmp
static

Definition at line 51 of file pc_cbrk.c.


Watt-32 tcp/ip: E:/WATT/src/pcarp.c File Reference

  • src
Functions | Variables
pcarp.c File Reference

Go to the source code of this file.

Functions

static const char * | get_ARP_flags (WORD flg)
static const char * | get_route_flags (WORD flg)
static BOOL | LAN_lookup (DWORD ip, eth_address *eth)
Lookup host in fixed/dynamic list.
static BOOL | is_on_LAN (DWORD ip)
This should probably go into route.c.
static BOOL | arp_check_common (DWORD ip, eth_address *eth)
Common stuff for _arp_resolve() and _arp_lookup()
static void W32_CALL | arp_daemon (void)
ARP background daemon.
int W32_CALL | _arp_gateways_get (const struct gate_entry **rc)
Return start of gate_list[].
static int | ping_gateway (DWORD host, void *eth)
static void | check_dead_gw (void)
static BOOL | legal_mask (DWORD mask, DWORD addr)
static int MS_CDECL | compare (const struct gate_entry *a, const struct gate_entry *b)
Compare two entries in gateway-list.
BOOL W32_CALL | _arp_add_gateway (const char *config_string, DWORD ip)
Add a gateway to the routing table.
void W32_CALL | _arp_kill_gateways (void)
Delete all gateways.
BOOL W32_CALL | _arp_have_default_gw (void)
Check if we have at least one default gateway.
static BOOL | arp_send (const arp_Header *arp, unsigned line)
Low-level ARP send function.
static BOOL | arp_send_request (DWORD ip)
Send broadcast ARP request.
BOOL W32_CALL | _arp_reply (const void *e_dst, DWORD src_ip, DWORD dst_ip)
Send unicast/broadcast ARP reply.
static void | arp_move_entry (int to_index, int from_index)
Move an ARP entry from from_index to to_index.
int W32_CALL | _arp_cache_get (const struct arp_entry **rc)
Return start of arp_list[].
static BOOL | LAN_start_lookup (DWORD ip)
Start a host lookup on the LAN.
static BOOL | LAN_lookup_pending (DWORD ip)
Lookup host in pending list.
static void | arp_check_timeouts (BOOL check_dynamic_entries)
Check ARP entries for timeout.
static void | route_move_entry (int to_index, int from_index)
static BOOL | route_make_new_slot (DWORD host_ip, DWORD gate_ip, DWORD mask)
BOOL W32_CALL | _arp_register (DWORD use_this_gateway_ip, DWORD for_this_host_ip)
Register a new host as gateway.
static BOOL | route_lookup (DWORD ip, eth_address *eth)
Gets MAC of gateway needed to reach the given host.
static BOOL | route_lookup_pending (DWORD ip)
Returns TRUE if the lookup of the gateway (assigned to the supplied ip) is still pending.
static BOOL | route_start_lookup (DWORD ip)
Start a route lookup.
static void | route_check_timeouts (BOOL check_dynamic_entries)
Periodic route checker.
BOOL W32_CALL | _arp_start_lookup (DWORD ip)
"PUBLIC" ARP/ROUTE FUNCTIONS.
BOOL W32_CALL | _arp_lookup (DWORD ip, eth_address *eth)
Lookup MAC-address of 'ip'.
BOOL W32_CALL | _arp_lookup_pending (DWORD ip)
An ARP-lookup timeout check.
BOOL W32_CALL | _arp_lookup_fixed (DWORD ip, eth_address *eth)
Lookup fixed MAC-address of 'ip'.
BOOL W32_CALL | _arp_resolve (DWORD ip, eth_address *eth)
The blocking lookup function visible to higher functions.
BOOL W32_CALL | _arp_cache_add (DWORD ip, const void *eth, BOOL expires)
Add given IP/Ether address to ARP-cache.
BOOL W32_CALL | _arp_cache_del (DWORD ip)
Delete given 'ip' address from ARP-cache (dynamic, fixed or pending).
static | void (W32_CALL *prev_cfg_hook)(const char *
Parser for "\c ARP.xx" keywords in "\c WATTCP.CFG".
static const char *static void W32_CALL | arp_parse (const char *name, const char *value)
void W32_CALL | _arp_init (void)
Setup config-table parse function and add background ARP deamon.
BOOL W32_CALL | _arp_handler (const arp_Header *ah, BOOL brdcast)
Receive ARP handler.
BOOL W32_CALL | _arp_check_own_ip (eth_address *other_guy)
Used by DHCP initialisation.
int W32_CALL | _arp_check_gateways (void)
Return number of default gateways.
void W32_CALL | _arp_cache_dump (void)
void W32_CALL | _arp_routes_dump (void)
void | __get_ifname (char *if_name)
void W32_CALL | _arp_gateways_dump (void)
void W32_CALL | _arp_debug_dump (void)
Debug-dump of configured gateways, route table and ARP cache.
static DWORD | _route_destin (DWORD ip)
W32_GCC_PRAGMA (GCC diagnostic ignored "-Wunused-variable")
while (0)
int | main (int argc, char **argv)

Variables

static int | arp_trace_level = 0
static int | arp_timeout = 2
static int | arp_alive = 300
static int | arp_rexmit_to = 250
static BOOL | dead_gw_detect = FALSE
static BOOL | arp_gratiotous = FALSE
static int | gate_top = 0
static struct gate_entry | gate_list [GATE_TOP_OF_CACHE]
static WORD | icmp_id = 0
Send a ping (with TTL=1) to a gateway.
static WORD | icmp_seq = 0
static int | arp_first_pending = ARP_TOP_PENDING
static int | arp_first_free = 0
static int | arp_first_dynamic = 0
static struct arp_entry | arp_list [ARP_TOP_OF_CACHE]
static int | route_first_pending = ROUTE_TOP_PENDING
static int | route_first_free = 0
static struct route_entry | route_list [ROUTE_TOP_OF_CACHE]

Detailed Description

Address Resolution Protocol.

2002-09 Gundolf von Bachhaus: 90% rewrite - Optional non-blocking ARP lookup & redirect handling Gateway / Route / ARP data stored & accessed separately Module encapsulated - no global variables.

Definition in file pcarp.c.

Function Documentation

◆ __get_ifname()

void __get_ifname ( char * if_name )

Definition at line 175 of file ioctl.c.

◆ _arp_add_gateway()

BOOL W32_CALL _arp_add_gateway | ( | const char * | config_string,
 |  | DWORD | ip
 | ) |  |

Add a gateway to the routing table.

The format of 'config_string' is: gateway [,subnet], mask]]

If 'config_string' is NULL, simply add 'ip' with zero mask and subnet.

eg. "gateway = 129.97.176.1" -> becomes the default route eg. "gateway = 129.97.176.2, 129.97.0.0, 255.255.0.0"

The first example shows how a default gateway is created. A default gateway is used if no other choices exist.

The second example shows how to specify a gateway for a particular subnet. In this example, whenever the 'top' 16 bits of the destination are 129.97.*.*, that gateway will be used.

Todo:
Move to route.c and rename to route_add().

Definition at line 247 of file pcarp.c.

References aton(), compare(), gate_entry::gate_ip, gate_entry::mask, and gate_entry::subnet.

◆ _arp_cache_add()

BOOL W32_CALL _arp_cache_add | ( | DWORD | ip,
 |  | const void * | eth,
 |  | BOOL | expires
 | ) |  |

Add given IP/Ether address to ARP-cache.

ARP cache functions.

Note
'ip' is on host order.

Definition at line 1351 of file pcarp.c.

References _arp_cache_del(), _inet_ntoa(), arp_move_entry(), arp_entry::expiry, arp_entry::flags, arp_entry::hardware, arp_entry::ip, is_on_LAN(), MAC_address(), my_ip_addr, and set_timeout().

◆ _arp_cache_del()

BOOL W32_CALL _arp_cache_del ( DWORD ip )

Delete given 'ip' address from ARP-cache (dynamic, fixed or pending).

Note
'ip' is on host order.

Definition at line 1420 of file pcarp.c.

References arp_move_entry(), arp_entry::flags, and arp_entry::ip.

◆ _arp_cache_dump()

W32_CALL void W32_CALL _arp_cache_dump ( void )

Definition at line 1774 of file pcarp.c.

◆ _arp_cache_get()

int W32_CALL _arp_cache_get ( const struct arp_entry ** rc )

Return start of arp_list[].

Note
Caller need to inspect the '*rc->flags' for validity.

Definition at line 527 of file pcarp.c.

◆ _arp_check_gateways()

int W32_CALL _arp_check_gateways ( void )

Return number of default gateways.

Definition at line 1751 of file pcarp.c.

References _arp_reply(), and my_ip_addr.

◆ _arp_check_own_ip()

BOOL W32_CALL _arp_check_own_ip ( eth_address * other_guy )

Used by DHCP initialisation.

Do an ARP resolve on our own IP address to check if someone else is replying. Return non-zero if someone replied.

Note
Blocks waiting for reply or timeout.

Definition at line 1728 of file pcarp.c.

References _arp_resolve(), and my_ip_addr.

◆ _arp_debug_dump()

W32_CALL void W32_CALL _arp_debug_dump ( void )

Debug-dump of configured gateways, route table and ARP cache.

Redone + moved here from pcdbug.c for encapsulation reasons GvB 2002-09

Definition at line 1918 of file pcarp.c.

References arp_entry::expiry, gate_entry::gate_ip, arp_entry::hardware, arp_entry::ip, MAC_address(), gate_entry::mask, set_timeout(), sin_mask, gate_entry::subnet, and time_str().

◆ _arp_gateways_dump()

W32_CALL void W32_CALL _arp_gateways_dump ( void )

Definition at line 1846 of file pcarp.c.

◆ _arp_gateways_get()

int W32_CALL _arp_gateways_get ( const struct gate_entry ** rc )

Return start of gate_list[].

Gateway functions.

Note
Only 'gate_top' gateways are valid in result.

Definition at line 94 of file pcarp.c.

◆ _arp_handler()

BOOL W32_CALL _arp_handler | ( | const arp_Header * | ah,
 |  | BOOL | brdcast
 | ) |  |

Receive ARP handler.

This processes incoming 'raw' ARP packets supplied by tcp_tick().

Definition at line 1565 of file pcarp.c.

References _arp_cache_add(), _arp_reply(), _eth_addr, _eth_brdcast, _eth_get_hwtype(), _eth_mac_len, arp_move_entry(), arp_entry::expiry, arp_entry::flags, arp_entry::hardware, arp_entry::ip, MAC_address(), my_ip_addr, and set_timeout().

◆ _arp_have_default_gw()

BOOL W32_CALL _arp_have_default_gw ( void )

Check if we have at least one default gateway.

Definition at line 382 of file pcarp.c.

References gate_entry::subnet.

◆ _arp_init()

void W32_CALL _arp_init ( void )

Setup config-table parse function and add background ARP deamon.

'Internal' interface to pctcp.c & others.

Definition at line 1546 of file pcarp.c.

References arp_daemon().

◆ _arp_kill_gateways()

void W32_CALL _arp_kill_gateways ( void )

Delete all gateways.

Definition at line 373 of file pcarp.c.

◆ _arp_lookup()

BOOL W32_CALL _arp_lookup | ( | DWORD | ip,
 |  | eth_address * | eth
 | ) |  |

Lookup MAC-address of 'ip'.

Return values
TRUE MAC for 'ip' is known.

Definition at line 1185 of file pcarp.c.

References arp_check_common(), is_on_LAN(), LAN_lookup(), and route_lookup().

◆ _arp_lookup_fixed()

BOOL W32_CALL _arp_lookup_fixed | ( | DWORD | ip,
 |  | eth_address * | eth
 | ) |  |

Lookup fixed MAC-address of 'ip'.

Return values
TRUE Supplied 'ip' has a fixed MAC entry.

Definition at line 1218 of file pcarp.c.

References arp_check_common(), and is_on_LAN().

◆ _arp_lookup_pending()

BOOL W32_CALL _arp_lookup_pending ( DWORD ip )

An ARP-lookup timeout check.

Return values
TRUE | The lookup is currently underway ("pending").
FALSE | The IP has either been resolved (_arp_lookup() == TRUE), or the lookup has timed out, i.e. the host is unreachable.

Definition at line 1205 of file pcarp.c.

References is_on_LAN(), LAN_lookup_pending(), and route_lookup_pending().

◆ _arp_register()

BOOL W32_CALL _arp_register | ( | DWORD | use_this_gateway_ip,
 |  | DWORD | for_this_host_ip
 | ) |  |

Register a new host as gateway.

ICMP redirection.

Called on ICMP-redirects.

Redirects are sent from a gateway/router, telling us that a different gateway is better suited to connect to the specified host than the one we were using.

Definition at line 842 of file pcarp.c.

References is_on_LAN(), LAN_lookup(), LAN_start_lookup(), and sin_mask.

◆ _arp_reply()

BOOL W32_CALL _arp_reply | ( | const void * | e_dst,
 |  | DWORD | src_ip,
 |  | DWORD | dst_ip
 | ) |  |

Send unicast/broadcast ARP reply.

'src_ip' and 'dst_ip' on host order.

Definition at line 489 of file pcarp.c.

References _eth_addr, _eth_brdcast, _eth_formatpacket(), _eth_get_hwtype(), arp_send(), and MAC_address().

◆ _arp_resolve()

BOOL W32_CALL _arp_resolve | ( | DWORD | ip,
 |  | eth_address * | eth
 | ) |  |

The blocking lookup function visible to higher functions.

Blocking ARP resolve functions.

Definition at line 1278 of file pcarp.c.

References _watt_cbroke, arp_check_common(), arp_daemon(), is_on_LAN(), LAN_lookup(), LAN_lookup_pending(), LAN_start_lookup(), route_lookup(), route_lookup_pending(), and route_start_lookup().

◆ _arp_routes_dump()

W32_CALL void W32_CALL _arp_routes_dump ( void )

Definition at line 1815 of file pcarp.c.

◆ _arp_start_lookup()

BOOL W32_CALL _arp_start_lookup ( DWORD ip )

"PUBLIC" ARP/ROUTE FUNCTIONS.

New non-blocking functions, GvB 2002-09.

These are the main functions visible from outside the module. Most of them simply check if the destination host IP is on the LAN or needs to be routed over a gateway, and then relay on to the apropriate LAN_...() or route_...() function. Initialise an ARP lookup. This is called by 'higher' routines to start an ARP request. This function is non-blocking, i.e. returns 'immediately'.

Definition at line 1168 of file pcarp.c.

References arp_check_common(), is_on_LAN(), LAN_start_lookup(), and route_start_lookup().

◆ _route_destin()

static DWORD _route_destin ( DWORD ip )
static

Definition at line 2147 of file pcarp.c.

◆ arp_check_common()

static BOOL arp_check_common | ( | DWORD | ip,
 |  | eth_address * | eth
 | ) |  |
static

Common stuff for _arp_resolve() and _arp_lookup()

Definition at line 1247 of file pcarp.c.

References _eth_addr, and _pktserial.

◆ arp_check_timeouts()

static void arp_check_timeouts ( BOOL check_dynamic_entries )
static

Check ARP entries for timeout.

This function runs through the 'pending' section of the ARP table and checks for entries that have either expired or require a re-send. The 'dynamic' entries are checked for expiry if requested.

Definition at line 664 of file pcarp.c.

References arp_move_entry(), arp_send_request(), chk_timeout(), arp_entry::expiry, arp_entry::flags, arp_entry::ip, arp_entry::retransmit_to, and set_timeout().

◆ arp_daemon()

static void W32_CALL arp_daemon ( void )
static

ARP background daemon.

Calls timeout-checks / retransmitters.

We don't check the dynamic entries for a timeout on every call, once a second is plenty enough.

Definition at line 1493 of file pcarp.c.

References _arp_check_gateways(), arp_check_timeouts(), chk_timeout(), route_check_timeouts(), and set_timeout().

◆ arp_move_entry()

static void arp_move_entry | ( | int | to_index,
 |  | int | from_index
 | ) |  |
static

Move an ARP entry from from_index to to_index.

Definition at line 517 of file pcarp.c.

◆ arp_parse()

static const char *static void W32_CALL arp_parse | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Definition at line 1528 of file pcarp.c.

◆ arp_send()

static BOOL arp_send | ( | const arp_Header * | arp,
 |  | unsigned | line
 | ) |  |
static

Low-level ARP send function.

Definition at line 455 of file pcarp.c.

References _eth_send().

◆ arp_send_request()

static BOOL arp_send_request ( DWORD ip )
static

Send broadcast ARP request.

Definition at line 466 of file pcarp.c.

References _eth_addr, _eth_brdcast, _eth_formatpacket(), _eth_get_hwtype(), arp_send(), arp_entry::ip, and my_ip_addr.

◆ check_dead_gw()

static void check_dead_gw ( void )
static

Definition at line 138 of file pcarp.c.

◆ compare()

static int MS_CDECL compare | ( | const struct gate_entry * | a,
 |  | const struct gate_entry * | b
 | ) |  |
static

Compare two entries in gateway-list.

Sort such that entries with the longest netmasks (32-mask_len()) are put first. Thus the default route (mask 0.0.0.0) is matched last in _route_destin().

From http://www.linuxfoundation.org/collaborate/workgroups/networking/networkoverview: LPM (Longest Prefix Match) is the lookup algorithm. The route with the longest netmask is the one chosen. Netmask 0, which is the shortest netmask, is for the default gateway.

Definition at line 217 of file pcarp.c.

References gate_entry::mask.

◆ get_ARP_flags()

static const char * get_ARP_flags ( WORD flg )
static

Definition at line 2089 of file pcarp.c.

◆ get_route_flags()

static const char * get_route_flags ( WORD flg )
static

Definition at line 2109 of file pcarp.c.

◆ is_on_LAN()

static BOOL is_on_LAN ( DWORD ip )
static

This should probably go into route.c.

Definition at line 825 of file pcarp.c.

References my_ip_addr, and sin_mask.

◆ LAN_lookup()

static BOOL LAN_lookup | ( | DWORD | ip,
 |  | eth_address * | eth
 | ) |  |
static

Lookup host in fixed/dynamic list.

Definition at line 613 of file pcarp.c.

References arp_entry::flags, arp_entry::hardware, and arp_entry::ip.

◆ LAN_lookup_pending()

static BOOL LAN_lookup_pending ( DWORD ip )
static

Lookup host in pending list.

Definition at line 637 of file pcarp.c.

References arp_entry::flags, and arp_entry::ip.

◆ LAN_start_lookup()

static BOOL LAN_start_lookup ( DWORD ip )
static

Start a host lookup on the LAN.

This is called by 'higher' routines to start an ARP request. This function is non-blocking, i.e. returns 'immediately'.

Definition at line 539 of file pcarp.c.

References arp_send_request(), arp_entry::expiry, arp_entry::flags, arp_entry::ip, arp_entry::retransmit_to, and set_timeout().

◆ legal_mask()

static BOOL legal_mask | ( | DWORD | mask,
 |  | DWORD | addr
 | ) |  |
static

Definition at line 190 of file pcarp.c.

◆ main()

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 2244 of file pcarp.c.

◆ ping_gateway()

static int ping_gateway | ( | DWORD | host,
 |  | void * | eth
 | ) |  |
static

Definition at line 108 of file pcarp.c.

◆ route_check_timeouts()

static void route_check_timeouts ( BOOL check_dynamic_entries )
static

Periodic route checker.

Run through all pending entries and check if an attempt to reach a gateway was successfull, or has timed-out. If the attempt timed-out, we try the next fitting gateway. If there are no more fitting gateways to try, the connection has failed.

Definition at line 1045 of file pcarp.c.

References gate_entry::gate_ip, is_on_LAN(), LAN_lookup(), LAN_lookup_pending(), LAN_start_lookup(), gate_entry::mask, and gate_entry::subnet.

◆ route_lookup()

static BOOL route_lookup | ( | DWORD | ip,
 |  | eth_address * | eth
 | ) |  |
static

Gets MAC of gateway needed to reach the given host.

Definition at line 902 of file pcarp.c.

References LAN_lookup().

◆ route_lookup_pending()

static BOOL route_lookup_pending ( DWORD ip )
static

Returns TRUE if the lookup of the gateway (assigned to the supplied ip) is still pending.

Definition at line 940 of file pcarp.c.

◆ route_make_new_slot()

static BOOL route_make_new_slot | ( | DWORD | host_ip,
 |  | DWORD | gate_ip,
 |  | DWORD | mask
 | ) |  |
static

Definition at line 783 of file pcarp.c.

◆ route_move_entry()

static void route_move_entry | ( | int | to_index,
 |  | int | from_index
 | ) |  |
static

Definition at line 777 of file pcarp.c.

◆ route_start_lookup()

static BOOL route_start_lookup ( DWORD ip )
static

Start a route lookup.

Definition at line 965 of file pcarp.c.

References gate_entry::gate_ip, is_on_LAN(), LAN_start_lookup(), gate_entry::mask, and gate_entry::subnet.

◆ W32_GCC_PRAGMA()

W32_GCC_PRAGMA ( GCC diagnostic ignored "-Wunused-variable" )

Definition at line 2182 of file pcarp.c.

◆ while()

while ( 0 )

Definition at line 2203 of file pcarp.c.

Variable Documentation

◆ arp_alive

int arp_alive = 300
static

Definition at line 68 of file pcarp.c.

◆ arp_first_dynamic

int arp_first_dynamic = 0
static

Definition at line 448 of file pcarp.c.

◆ arp_first_free

int arp_first_free = 0
static

Definition at line 447 of file pcarp.c.

◆ arp_first_pending

int arp_first_pending = ARP_TOP_PENDING
static

Definition at line 446 of file pcarp.c.

◆ arp_gratiotous

BOOL arp_gratiotous = FALSE
static

Definition at line 71 of file pcarp.c.

◆ arp_list

struct arp_entry arp_list[ARP_TOP_OF_CACHE]
static

Definition at line 450 of file pcarp.c.

◆ arp_rexmit_to

int arp_rexmit_to = 250
static

Definition at line 69 of file pcarp.c.

◆ arp_timeout

int arp_timeout = 2
static

Definition at line 67 of file pcarp.c.

◆ arp_trace_level

int arp_trace_level = 0
static

Definition at line 66 of file pcarp.c.

◆ dead_gw_detect

BOOL dead_gw_detect = FALSE
static

Definition at line 70 of file pcarp.c.

◆ gate_list

struct gate_entry gate_list[GATE_TOP_OF_CACHE]
static

Definition at line 87 of file pcarp.c.

◆ gate_top

int gate_top = 0
static

Definition at line 85 of file pcarp.c.

◆ icmp_id

WORD icmp_id = 0
static

Send a ping (with TTL=1) to a gateway.

Ref. RFC-1122.

Definition at line 105 of file pcarp.c.

◆ icmp_seq

WORD icmp_seq = 0
static

Definition at line 106 of file pcarp.c.

◆ route_first_free

int route_first_free = 0
static

Definition at line 773 of file pcarp.c.

◆ route_first_pending

int route_first_pending = ROUTE_TOP_PENDING
static

Definition at line 772 of file pcarp.c.

◆ route_list

struct route_entry route_list[ROUTE_TOP_OF_CACHE]
static

Definition at line 775 of file pcarp.c.


Watt-32 tcp/ip: E:/WATT/src/pcarp.h File Reference

  • src
Data Structures | Functions
pcarp.h File Reference

Go to the source code of this file.

Data Structures

struct | gate_entry
struct | arp_entry
struct | route_entry

Functions

W32_FUNC int W32_CALL | _arp_gateways_get (const struct gate_entry **)
Gateway functions.
W32_FUNC int W32_CALL | _arp_check_gateways (void)
Return number of default gateways.
W32_FUNC BOOL W32_CALL | _arp_add_gateway (const char *config_string, DWORD ip)
Add a gateway to the routing table.
W32_FUNC BOOL W32_CALL | _arp_have_default_gw (void)
Check if we have at least one default gateway.
W32_FUNC void W32_CALL | _arp_kill_gateways (void)
Delete all gateways.
W32_FUNC BOOL W32_CALL | _arp_resolve (DWORD ina, eth_address *eth)
Blocking ARP resolve functions.
W32_FUNC BOOL W32_CALL | _arp_check_own_ip (eth_address *eth)
Used by DHCP initialisation.
W32_FUNC BOOL W32_CALL | _arp_start_lookup (DWORD ip)
New non-blocking functions, GvB 2002-09.
W32_FUNC BOOL W32_CALL | _arp_lookup (DWORD ip, eth_address *eth)
Lookup MAC-address of 'ip'.
W32_FUNC BOOL W32_CALL | _arp_lookup_fixed (DWORD ip, eth_address *eth)
Lookup fixed MAC-address of 'ip'.
W32_FUNC BOOL W32_CALL | _arp_lookup_pending (DWORD ip)
An ARP-lookup timeout check.
W32_FUNC BOOL W32_CALL | _arp_cache_add (DWORD ip, const void *eth, BOOL expire)
ARP cache functions.
W32_FUNC BOOL W32_CALL | _arp_cache_del (DWORD ip)
Delete given 'ip' address from ARP-cache (dynamic, fixed or pending).
W32_FUNC int W32_CALL | _arp_cache_get (const struct arp_entry **)
Return start of arp_list[].
W32_FUNC void W32_CALL | _arp_cache_dump (void)
W32_FUNC void W32_CALL | _arp_gateways_dump (void)
W32_FUNC void W32_CALL | _arp_routes_dump (void)
W32_FUNC void W32_CALL | _arp_debug_dump (void)
Debug-dump of configured gateways, route table and ARP cache.
W32_FUNC void W32_CALL | _arp_init (void)
'Internal' interface to pctcp.c & others.
W32_FUNC BOOL W32_CALL | _arp_reply (const void *mac_dst, DWORD src_ip, DWORD dst_ip)
Send unicast/broadcast ARP reply.
W32_FUNC BOOL W32_CALL | _arp_handler (const arp_Header *arp, BOOL brdcast)
Receive ARP handler.
W32_FUNC BOOL W32_CALL | _arp_register (DWORD use_this_gateway_ip, DWORD for_this_host_ip)
ICMP redirection.

Detailed Description

ARP handler module.

Definition in file pcarp.h.

Function Documentation

◆ _arp_add_gateway()

W32_FUNC BOOL W32_CALL _arp_add_gateway | ( | const char * | config_string,
 |  | DWORD | ip
 | ) |  |

Add a gateway to the routing table.

The format of 'config_string' is: gateway [,subnet], mask]]

If 'config_string' is NULL, simply add 'ip' with zero mask and subnet.

eg. "gateway = 129.97.176.1" -> becomes the default route eg. "gateway = 129.97.176.2, 129.97.0.0, 255.255.0.0"

The first example shows how a default gateway is created. A default gateway is used if no other choices exist.

The second example shows how to specify a gateway for a particular subnet. In this example, whenever the 'top' 16 bits of the destination are 129.97.*.*, that gateway will be used.

Todo:
Move to route.c and rename to route_add().

Definition at line 247 of file pcarp.c.

References aton(), compare(), gate_entry::gate_ip, gate_entry::mask, and gate_entry::subnet.

◆ _arp_cache_add()

W32_FUNC BOOL W32_CALL _arp_cache_add | ( | DWORD | ip,
 |  | const void * | eth,
 |  | BOOL | expires
 | ) |  |

ARP cache functions.

ARP cache functions.

Note
'ip' is on host order.

Definition at line 1351 of file pcarp.c.

References _arp_cache_del(), _inet_ntoa(), arp_move_entry(), arp_entry::expiry, arp_entry::flags, arp_entry::hardware, arp_entry::ip, is_on_LAN(), MAC_address(), my_ip_addr, and set_timeout().

◆ _arp_cache_del()

W32_FUNC BOOL W32_CALL _arp_cache_del ( DWORD ip )

Delete given 'ip' address from ARP-cache (dynamic, fixed or pending).

Note
'ip' is on host order.

Definition at line 1420 of file pcarp.c.

References arp_move_entry(), arp_entry::flags, and arp_entry::ip.

◆ _arp_cache_dump()

W32_FUNC void W32_CALL _arp_cache_dump ( void )

Definition at line 1774 of file pcarp.c.

◆ _arp_cache_get()

W32_FUNC int W32_CALL _arp_cache_get ( const struct arp_entry ** rc )

Return start of arp_list[].

Note
Caller need to inspect the '*rc->flags' for validity.

Definition at line 527 of file pcarp.c.

◆ _arp_check_gateways()

W32_FUNC int W32_CALL _arp_check_gateways ( void )

Return number of default gateways.

Definition at line 1751 of file pcarp.c.

References _arp_reply(), and my_ip_addr.

◆ _arp_check_own_ip()

W32_FUNC BOOL W32_CALL _arp_check_own_ip ( eth_address * other_guy )

Used by DHCP initialisation.

Do an ARP resolve on our own IP address to check if someone else is replying. Return non-zero if someone replied.

Note
Blocks waiting for reply or timeout.

Definition at line 1728 of file pcarp.c.

References _arp_resolve(), and my_ip_addr.

◆ _arp_debug_dump()

W32_FUNC void W32_CALL _arp_debug_dump ( void )

Debug-dump of configured gateways, route table and ARP cache.

Redone + moved here from pcdbug.c for encapsulation reasons GvB 2002-09

Definition at line 1918 of file pcarp.c.

References arp_entry::expiry, gate_entry::gate_ip, arp_entry::hardware, arp_entry::ip, MAC_address(), gate_entry::mask, set_timeout(), sin_mask, gate_entry::subnet, and time_str().

◆ _arp_gateways_dump()

W32_FUNC void W32_CALL _arp_gateways_dump ( void )

Definition at line 1846 of file pcarp.c.

◆ _arp_gateways_get()

W32_FUNC int W32_CALL _arp_gateways_get ( const struct gate_entry ** rc )

Gateway functions.

Todo:
: Move to route.c and prefix with '_route'.
Note
: Exported only because ./bin/tcpinfo.c uses some of those. Therefore all functions use 'W32_CALL' convention too.

Gateway functions.

Note
Only 'gate_top' gateways are valid in result.

Definition at line 94 of file pcarp.c.

◆ _arp_handler()

W32_FUNC BOOL W32_CALL _arp_handler | ( | const arp_Header * | ah,
 |  | BOOL | brdcast
 | ) |  |

Receive ARP handler.

This processes incoming 'raw' ARP packets supplied by tcp_tick().

Definition at line 1565 of file pcarp.c.

References _arp_cache_add(), _arp_reply(), _eth_addr, _eth_brdcast, _eth_get_hwtype(), _eth_mac_len, arp_move_entry(), arp_entry::expiry, arp_entry::flags, arp_entry::hardware, arp_entry::ip, MAC_address(), my_ip_addr, and set_timeout().

◆ _arp_have_default_gw()

W32_FUNC BOOL W32_CALL _arp_have_default_gw ( void )

Check if we have at least one default gateway.

Definition at line 382 of file pcarp.c.

References gate_entry::subnet.

◆ _arp_init()

W32_FUNC void W32_CALL _arp_init ( void )

'Internal' interface to pctcp.c & others.

'Internal' interface to pctcp.c & others.

Definition at line 1546 of file pcarp.c.

References arp_daemon().

◆ _arp_kill_gateways()

W32_FUNC void W32_CALL _arp_kill_gateways ( void )

Delete all gateways.

Definition at line 373 of file pcarp.c.

◆ _arp_lookup()

W32_FUNC BOOL W32_CALL _arp_lookup | ( | DWORD | ip,
 |  | eth_address * | eth
 | ) |  |

Lookup MAC-address of 'ip'.

Return values
TRUE MAC for 'ip' is known.

Definition at line 1185 of file pcarp.c.

References arp_check_common(), is_on_LAN(), LAN_lookup(), and route_lookup().

◆ _arp_lookup_fixed()

W32_FUNC BOOL W32_CALL _arp_lookup_fixed | ( | DWORD | ip,
 |  | eth_address * | eth
 | ) |  |

Lookup fixed MAC-address of 'ip'.

Return values
TRUE Supplied 'ip' has a fixed MAC entry.

Definition at line 1218 of file pcarp.c.

References arp_check_common(), and is_on_LAN().

◆ _arp_lookup_pending()

W32_FUNC BOOL W32_CALL _arp_lookup_pending ( DWORD ip )

An ARP-lookup timeout check.

Return values
TRUE | The lookup is currently underway ("pending").
FALSE | The IP has either been resolved (_arp_lookup() == TRUE), or the lookup has timed out, i.e. the host is unreachable.

Definition at line 1205 of file pcarp.c.

References is_on_LAN(), LAN_lookup_pending(), and route_lookup_pending().

◆ _arp_register()

W32_FUNC BOOL W32_CALL _arp_register | ( | DWORD | use_this_gateway_ip,
 |  | DWORD | for_this_host_ip
 | ) |  |

ICMP redirection.

ICMP redirection.

Called on ICMP-redirects.

Redirects are sent from a gateway/router, telling us that a different gateway is better suited to connect to the specified host than the one we were using.

Definition at line 842 of file pcarp.c.

References is_on_LAN(), LAN_lookup(), LAN_start_lookup(), and sin_mask.

◆ _arp_reply()

W32_FUNC BOOL W32_CALL _arp_reply | ( | const void * | e_dst,
 |  | DWORD | src_ip,
 |  | DWORD | dst_ip
 | ) |  |

Send unicast/broadcast ARP reply.

'src_ip' and 'dst_ip' on host order.

Definition at line 489 of file pcarp.c.

References _eth_addr, _eth_brdcast, _eth_formatpacket(), _eth_get_hwtype(), arp_send(), and MAC_address().

◆ _arp_resolve()

W32_FUNC BOOL W32_CALL _arp_resolve | ( | DWORD | ip,
 |  | eth_address * | eth
 | ) |  |

Blocking ARP resolve functions.

Doesn't return until success or time-out.

Blocking ARP resolve functions.

Definition at line 1278 of file pcarp.c.

◆ _arp_routes_dump()

W32_FUNC void W32_CALL _arp_routes_dump ( void )

Definition at line 1815 of file pcarp.c.

◆ _arp_start_lookup()

W32_FUNC BOOL W32_CALL _arp_start_lookup ( DWORD ip )

New non-blocking functions, GvB 2002-09.

New non-blocking functions, GvB 2002-09.

These are the main functions visible from outside the module. Most of them simply check if the destination host IP is on the LAN or needs to be routed over a gateway, and then relay on to the apropriate LAN_...() or route_...() function. Initialise an ARP lookup. This is called by 'higher' routines to start an ARP request. This function is non-blocking, i.e. returns 'immediately'.

Definition at line 1168 of file pcarp.c.

References arp_check_common(), is_on_LAN(), LAN_start_lookup(), and route_start_lookup().


Watt-32 tcp/ip: E:/WATT/src/pcbootp.c File Reference

  • src
Functions | Variables
pcbootp.c File Reference

Go to the source code of this file.

Functions

static int | bootp_xmit (struct bootp *bootp_out)
static BOOL | bootp_recv (struct bootp *bootp_out, struct bootp *bootp_in)
static void | bootp_parse (const struct bootp *bootp_in, int len)
int | BOOTP_do_boot (void)
Main BOOTP initialisation.

Variables

DWORD | _bootp_host = IP_BCAST_ADDR
int | _bootp_timeout = 15
static sock_type * | boot_sock

Detailed Description

BOOTP - Boot Protocol (RFC 854/951/1048).

These extensions get called if _bootp_on is set.

Version
0.3: Feb 1, 1992 : J. Dent - patched up various things.
0.2: May 22, 1991 : E.J. Sutcliffe - added RFC_1048 vendor fields.
0.1: May 9, 1991 : E. Engelke - made part of the library.
0.0: May 3, 1991 : E. Engelke - original program as an application.

Definition in file pcbootp.c.

Function Documentation

◆ BOOTP_do_boot()

int BOOTP_do_boot ( void )

Main BOOTP initialisation.

Checks global variables _bootp_timeout, _bootp_host. If no host specified, use the broadcast address.

Return values
1 | success, local IP address set.
0 | something failed.
Note
Doesn't retry the bootp_xmit() on timeout.

Definition at line 60 of file pcbootp.c.

References my_ip_addr, and udp_open().

◆ bootp_parse()

static void bootp_parse | ( | const struct bootp * | bootp_in,
 |  | int | len
 | ) |  |
static

Definition at line 154 of file pcbootp.c.

◆ bootp_recv()

static BOOL bootp_recv | ( | struct bootp * | bootp_out,
 |  | struct bootp * | bootp_in
 | ) |  |
static

Definition at line 110 of file pcbootp.c.

◆ bootp_xmit()

static int bootp_xmit ( struct bootp * bootp_out )
static

Definition at line 95 of file pcbootp.c.

Variable Documentation

◆ _bootp_host

DWORD _bootp_host = IP_BCAST_ADDR

Definition at line 35 of file pcbootp.c.

◆ _bootp_timeout

int _bootp_timeout = 15

Definition at line 38 of file pcbootp.c.

◆ boot_sock

sock_type* boot_sock
static

Definition at line 45 of file pcbootp.c.


Watt-32 tcp/ip: E:/WATT/src/pcbootp.h File Reference

  • src
Data Structures | Enumerations | Functions | Variables
pcbootp.h File Reference

Go to the source code of this file.

Data Structures

struct bootp_vend

Enumerations

enum BOOTP_Options {
BOOTP_OPT_PAD = 0 ,
BOOTP_OPT_SUBNET_MASK = 1 ,
BOOTP_OPT_TIME_OFFSET = 2 ,
BOOTP_OPT_ROUTERS_ON_SNET = 3 ,
BOOTP_OPT_TIME_SRV = 4 ,
BOOTP_OPT_NAME_SRV = 5 ,
BOOTP_OPT_DNS_SRV = 6 ,
BOOTP_OPT_LOG_SRV = 7 ,
BOOTP_OPT_COOKIE_SRV = 8 ,
BOOTP_OPT_LPR_SRV = 9 ,
BOOTP_OPT_IMPRESS_SRV = 10 ,
BOOTP_OPT_RES_LOCATION_SRV = 11 ,
BOOTP_OPT_HOST_NAME = 12 ,
BOOTP_OPT_BOOT_FSIZE = 13 ,
BOOTP_OPT_DOMAIN_NAME = 15 ,
BOOTP_OPT_NON_LOCAL_SRC_ROUTE = 20 ,
BOOTP_OPT_POLICY_FILTER = 21 ,
BOOTP_OPT_MAX_DGRAM_REASM_SIZE = 22 ,
BOOTP_OPT_IP_DEFAULT_TTL = 23 ,
BOOTP_OPT_PATH_MTU_AGING_TIMEOUT = 24 ,
BOOTP_OPT_PATH_MTU_PLATEAU_TABLE = 25 ,
BOOTP_OPT_IF_MTU = 26 ,
BOOTP_OPT_ALL_SUBNETS_LOCAL = 27 ,
BOOTP_OPT_BROADCAST_ADDR = 28 ,
BOOTP_OPT_PERFORM_MASK_DISCOVERY = 29 ,
BOOTP_OPT_MASK_SUPPLIER = 30 ,
BOOTP_OPT_PERFORM_ROUTER_DISCOVERY = 31 ,
BOOTP_OPT_ROUTER_SOLICITATION_ADDR = 32 ,
BOOTP_OPT_STATIC_ROUTE = 33 ,
BOOTP_OPT_TRAILER_ENCAPSULATION = 34 ,
BOOTP_OPT_ARP_CACHE_TIMEOUT = 35 ,
BOOTP_OPT_ETHERNET_ENCAPSULATION = 36 ,
BOOTP_OPT_END = 255
}

Functions

int BOOTP_do_boot (void)
Main BOOTP initialisation.

Variables

DWORD | _bootp_host
int | _bootp_timeout

Detailed Description

Bootstrap Protocol (BOOTP). Based on RFC 951.

Definition in file pcbootp.h.

Enumeration Type Documentation

◆ BOOTP_Options

enum BOOTP_Options

Definition at line 21 of file pcbootp.h.

Function Documentation

◆ BOOTP_do_boot()

int BOOTP_do_boot ( void )

Main BOOTP initialisation.

Checks global variables _bootp_timeout, _bootp_host. If no host specified, use the broadcast address.

Return values
1 | success, local IP address set.
0 | something failed.
Note
Doesn't retry the bootp_xmit() on timeout.

Definition at line 60 of file pcbootp.c.

References my_ip_addr, and udp_open().

Variable Documentation

◆ _bootp_host

DWORD _bootp_host
extern

Definition at line 35 of file pcbootp.c.

◆ _bootp_timeout

int _bootp_timeout
extern

Definition at line 38 of file pcbootp.c.


Watt-32 tcp/ip: E:/WATT/src/pcbuf.c File Reference

  • src
Functions
pcbuf.c File Reference

Go to the source code of this file.

Functions

static int | num_free_raw (const _raw_Socket *raw)
static int | num_free_raw6 (const _raw6_Socket *raw)
size_t W32_CALL | sock_rbsize (const sock_type *s)
size_t W32_CALL | sock_rbused (const sock_type *s)
size_t W32_CALL | sock_rbleft (const sock_type *s)
size_t W32_CALL | sock_tbsize (const sock_type *s)
size_t W32_CALL | sock_tbleft (const sock_type *s)
size_t W32_CALL | sock_tbused (const sock_type *s)
size_t W32_CALL | sock_setbuf (sock_type *s, BYTE *rx_buf, size_t rx_len)
void | _sock_check_tcp_buffers (const _tcp_Socket *tcp)
void | _sock_check_udp_buffers (const _udp_Socket *udp)
int W32_CALL | sock_preread (const sock_type *s, BYTE *buf, int len)
int W32_CALL | _chk_socket (const sock_type *s)
const char *W32_CALL | sockerr (const sock_type *s)
void W32_CALL | sockerr_clear (sock_type *s)
const char *W32_CALL | sockstate (const sock_type *s)
const _raw_Socket * | find_oldest_raw (const _raw_Socket *raw)
const _raw6_Socket * | find_oldest_raw6 (const _raw6_Socket *raw)

Detailed Description

Status of Rx/tx buffers.

Definition in file pcbuf.c.

Function Documentation

◆ _chk_socket()

int W32_CALL _chk_socket ( const sock_type * s )

Definition at line 254 of file pcbuf.c.

◆ _sock_check_tcp_buffers()

void _sock_check_tcp_buffers ( const _tcp_Socket * tcp )

Definition at line 193 of file pcbuf.c.

◆ _sock_check_udp_buffers()

void _sock_check_udp_buffers ( const _udp_Socket * udp )

Definition at line 223 of file pcbuf.c.

◆ find_oldest_raw()

const _raw_Socket * find_oldest_raw ( const _raw_Socket * raw )

Definition at line 312 of file pcbuf.c.

◆ find_oldest_raw6()

const _raw6_Socket * find_oldest_raw6 ( const _raw6_Socket * raw )

Definition at line 325 of file pcbuf.c.

◆ num_free_raw()

static int num_free_raw ( const _raw_Socket * raw )
static

Definition at line 20 of file pcbuf.c.

◆ num_free_raw6()

static int num_free_raw6 ( const _raw6_Socket * raw )
static

Definition at line 32 of file pcbuf.c.

◆ sock_preread()

int W32_CALL sock_preread | ( | const sock_type * | s,
 |  | BYTE * | buf,
 |  | int | len
 | ) |  |

Definition at line 230 of file pcbuf.c.

◆ sock_rbleft()

size_t W32_CALL sock_rbleft ( const sock_type * s )

Definition at line 88 of file pcbuf.c.

◆ sock_rbsize()

size_t W32_CALL sock_rbsize ( const sock_type * s )

Definition at line 44 of file pcbuf.c.

◆ sock_rbused()

size_t W32_CALL sock_rbused ( const sock_type * s )

Definition at line 62 of file pcbuf.c.

◆ sock_setbuf()

size_t W32_CALL sock_setbuf | ( | sock_type * | s,
 |  | BYTE * | rx_buf,
 |  | size_t | rx_len
 | ) |  |

Definition at line 152 of file pcbuf.c.

◆ sock_tbleft()

size_t W32_CALL sock_tbleft ( const sock_type * s )

Definition at line 125 of file pcbuf.c.

◆ sock_tbsize()

size_t W32_CALL sock_tbsize ( const sock_type * s )

Definition at line 110 of file pcbuf.c.

◆ sock_tbused()

size_t W32_CALL sock_tbused ( const sock_type * s )

Definition at line 140 of file pcbuf.c.

◆ sockerr()

const char *W32_CALL sockerr ( const sock_type * s )

Definition at line 274 of file pcbuf.c.

◆ sockerr_clear()

void W32_CALL sockerr_clear ( sock_type * s )

Definition at line 281 of file pcbuf.c.

◆ sockstate()

const char *W32_CALL sockstate ( const sock_type * s )

Definition at line 290 of file pcbuf.c.


Watt-32 tcp/ip: E:/WATT/src/pcbuf.h File Reference

  • src
Functions
pcbuf.h File Reference

Go to the source code of this file.

Functions

void | _sock_check_tcp_buffers (const _tcp_Socket *tcp)
void | _sock_check_udp_buffers (const _udp_Socket *udp)
const _raw_Socket * | find_oldest_raw (const _raw_Socket *raw)
const _raw6_Socket * | find_oldest_raw6 (const _raw6_Socket *raw)

Function Documentation

◆ _sock_check_tcp_buffers()

void _sock_check_tcp_buffers ( const _tcp_Socket * tcp )

Definition at line 193 of file pcbuf.c.

◆ _sock_check_udp_buffers()

void _sock_check_udp_buffers ( const _udp_Socket * udp )

Definition at line 223 of file pcbuf.c.

◆ find_oldest_raw()

const _raw_Socket * find_oldest_raw ( const _raw_Socket * raw )

Definition at line 312 of file pcbuf.c.

◆ find_oldest_raw6()

const _raw6_Socket * find_oldest_raw6 ( const _raw6_Socket * raw )

Definition at line 325 of file pcbuf.c.


Watt-32 tcp/ip: E:/WATT/src/pcconfig.c File Reference

  • src
Enumerations | Functions | Variables
pcconfig.c File Reference

Go to the source code of this file.

Enumerations

enum ParseMode {
ModeKeyword = 0 ,
ModeValue ,
ModeComment
}

Functions

static void | deprecated_key (const char *old_key, const char *new_key)
static void W32_CALL | keyword_not_found (const char *key, const char *value)
This function eventually gets called if no keyword was matched.
void (W32_CALL *usr_post_init)(void) = NULL
Hook to a function called after we're initialised.
static const char * | type_name (int type)
FUNC_TO_W32CALL (ReadHostsFile)
static void | set_ethip (const char *value)
Add an "ether, IPv4-address" pair to the static ARP-cache.
void | _add_server (WORD *counter, DWORD *array, int array_dim, DWORD value)
const char * | expand_var_str (const char *str)
Return a string with a environment variable expanded (only one).
const char * | _w32_ExpandVarStr (const char *str)
static BOOL | set_value (BOOL is_hex, const char *value, void *arg, int size)
Parse and store ARG_ATOX_B, ARG_ATOX_W or ARG_ATOI value.
int W32_CALL | parse_config_table (const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
static void | set_my_ip (const char *value)
static void | set_hostname (const char *value)
static void | set_gateway (const char *value)
static void | set_nameserv (const char *value)
static void | set_cookie (const char *value)
static void | set_eaddr (const char *value)
Set new ether-address from "ether" value.
static void | set_domain (const char *value)
static void | depr_set_domain1 (const char *value)
static void | depr_set_domain2 (const char *value)
static void | do_print (const char *str)
static void | depr_dns_timeout1 (const char *value)
static void | depr_dns_timeout2 (const char *value)
static void | depr_dns_recurse (const char *value)
static long | do_include_file (const char *value, int len)
Open and parse an include file.
const char * | get_argv0 (void)
Return argv[0] as passed to main().
static void | set_recv_win (const char *value)
void W32_CALL | tcp_set_debug_state (WORD val)
Old comptibility function.
static void | tcp_inject_config_direct (const struct config_table *cfg, const char *key, const char *value)
Called from config-file parser after "key = value" is found.
void W32_CALL | tcp_inject_config (const struct config_table *cfg, const char *key, const char *value)
Callable from a user application to inject config values before the normal WATTCP.CFG is loaded and parsed.
struct FCFILE * | fc_open (const char *fname, int mode)
void | fc_close (struct FCFILE *f)
int | fc_readbyte (struct FCFILE *f, char *c)
Read next byte from file f and write it to c.
long | tcp_parse_file (WFILE f, const struct config_table *cfg)
int W32_CALL | tcp_config_name (char *name, int max)
long W32_CALL | tcp_config (const char *path)
int | netdb_init (void)
Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise things.
void | netdb_warn (const char *fname)
static void W32_CALL | not_found2 (const char *key, const char *value)
static long W32_CALL | my_injector (int pass, const struct config_table *cfg)
void | Usage (void)
int | main (int argc, char **argv)

Variables

int | debug_on = 0
int | ctrace_on = 0
int | sock_delay = 30
int | sock_inactive = 0
int | sock_data_timeout = 0
WORD | multihomes = 0
BOOL | dynamic_host = 0
int | stkwalk_details = 1
DWORD | Cookies [MAX_COOKIES]
WORD | last_cookie = 0
static char * | config_name = (char*) "WATTCP.CFG"
static char * | current_file = NULL
static UINT | current_line = 0
static BOOL | got_eol = FALSE
static const char * | environ_names []
static const struct config_table | normal_cfg []
const struct config_table * | watt_init_cfg = normal_cfg
const char * | cfg_file

Detailed Description

Watt-32 config file handling.

Definition in file pcconfig.c.

Enumeration Type Documentation

◆ ParseMode

enum ParseMode

Definition at line 95 of file pcconfig.c.

Function Documentation

◆ _add_server()

void _add_server | ( | WORD * | counter,
 |  | DWORD * | array,
 |  | int | array_dim,
 |  | DWORD | value
 | ) |  |

Definition at line 204 of file pcconfig.c.

◆ _w32_ExpandVarStr()

const char * _w32_ExpandVarStr ( const char * str )

Definition at line 267 of file pcconfig.c.

◆ depr_dns_recurse()

static void depr_dns_recurse ( const char * value )
static

Definition at line 605 of file pcconfig.c.

◆ depr_dns_timeout1()

static void depr_dns_timeout1 ( const char * value )
static

Definition at line 593 of file pcconfig.c.

◆ depr_dns_timeout2()

static void depr_dns_timeout2 ( const char * value )
static

Definition at line 599 of file pcconfig.c.

◆ depr_set_domain1()

static void depr_set_domain1 ( const char * value )
static

Definition at line 574 of file pcconfig.c.

◆ depr_set_domain2()

static void depr_set_domain2 ( const char * value )
static

Definition at line 580 of file pcconfig.c.

◆ deprecated_key()

static void deprecated_key | ( | const char * | old_key,
 |  | const char * | new_key
 | ) |  |
static

Definition at line 655 of file pcconfig.c.

◆ do_include_file()

static long do_include_file | ( | const char * | value,
 |  | int | len
 | ) |  |
static

Open and parse an include file.

Syntax: "include = [?]<file>". If '?' prefix is used, the parser will not warn if the file isn't found.

Definition at line 616 of file pcconfig.c.

◆ do_print()

static void do_print ( const char * str )
static

Definition at line 586 of file pcconfig.c.

◆ expand_var_str()

const char * expand_var_str ( const char * str )

Return a string with a environment variable expanded (only one).

Never returns NULL.

E.g. if environment variable ETC is "c:\network\watt\bin", "$(ETC)\hosts" becomes "c:\network\watt\bin\hosts" If ETC isn't defined, "$(ETC)\hosts" becomes "\hosts".

Todo:
support several in one line and malloc the result.

Definition at line 234 of file pcconfig.c.

◆ fc_close()

void fc_close ( struct FCFILE * f )

Definition at line 962 of file pcconfig.c.

◆ fc_open()

struct FCFILE * fc_open | ( | const char * | fname,
 |  | int | mode
 | ) |  |

Definition at line 941 of file pcconfig.c.

◆ fc_readbyte()

int fc_readbyte | ( | struct FCFILE * | f,
 |  | char * | c
 | ) |  |

Read next byte from file f and write it to c.

This will fail miserably if the file is ever rewinded. Returns 1 on success, non-zero otherwise

Definition at line 976 of file pcconfig.c.

◆ FUNC_TO_W32CALL()

FUNC_TO_W32CALL ( ReadHostsFile )

Definition at line 150 of file pcconfig.c.

◆ get_argv0()

const char * get_argv0 ( void )

Return argv[0] as passed to main().

Definition at line 671 of file pcconfig.c.

References _strlcpy().

◆ keyword_not_found()

static void W32_CALL keyword_not_found | ( | const char * | key,
 |  | const char * | value
 | ) |  |
static

This function eventually gets called if no keyword was matched.

Prints a warning (file+line) in debug-mode >= 2.

Definition at line 276 of file pcconfig.c.

◆ main()

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 1352 of file pcconfig.c.

◆ my_injector()

static long W32_CALL my_injector | ( | int | pass,
 |  | const struct config_table * | cfg
 | ) |  |
static

Definition at line 1326 of file pcconfig.c.

◆ netdb_init()

int netdb_init ( void )

Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise things.

Definition at line 1284 of file pcconfig.c.

References _watt_do_exit, and watt_sock_init().

◆ netdb_warn()

void netdb_warn ( const char * fname )

Definition at line 1294 of file pcconfig.c.

◆ not_found2()

static void W32_CALL not_found2 | ( | const char * | key,
 |  | const char * | value
 | ) |  |
static

Definition at line 1307 of file pcconfig.c.

◆ parse_config_table()

int W32_CALL parse_config_table | ( | const struct config_table * | tab,
 |  | const char * | section,
 |  | const char * | name,
 |  | const char * | value
 | ) |  |

Parse the config-table and if a match is found for ('section'+'.

'+)'name' either store variable to 'value' or call function with 'value'.

Definition at line 382 of file pcconfig.c.

References _strlcpy(), ARG_ATOB, ARG_ATOI, ARG_ATOIP, ARG_ATOW, ARG_ATOX_B, ARG_ATOX_D, ARG_ATOX_W, ARG_FUNC, ARG_RESOLVE, ARG_STRCPY, ARG_STRDUP, aton(), isaddr(), resolve(), and set_value().

◆ set_cookie()

static void set_cookie ( const char * value )
static

Definition at line 523 of file pcconfig.c.

◆ set_domain()

static void set_domain ( const char * value )
static

Definition at line 569 of file pcconfig.c.

◆ set_eaddr()

static void set_eaddr ( const char * value )
static

Set new ether-address from "ether" value.

Definition at line 533 of file pcconfig.c.

References _eth_real_addr, _eth_set_addr(), _inet_atoeth(), and my_ip_addr.

◆ set_ethip()

static void set_ethip ( const char * value )
static

Add an "ether, IPv4-address" pair to the static ARP-cache.

Add an "ether, IPv6-address" pair to the static ND-cache.

Definition at line 173 of file pcconfig.c.

References _arp_cache_add(), _eth_real_addr, _inet6_addr(), _inet_addr(), and _inet_atoeth().

◆ set_gateway()

static void set_gateway ( const char * value )
static

Definition at line 510 of file pcconfig.c.

◆ set_hostname()

static void set_hostname ( const char * value )
static

Definition at line 505 of file pcconfig.c.

◆ set_my_ip()

static void set_my_ip ( const char * value )
static

Definition at line 494 of file pcconfig.c.

◆ set_nameserv()

static void set_nameserv ( const char * value )
static

Definition at line 515 of file pcconfig.c.

◆ set_recv_win()

static void set_recv_win ( const char * value )
static

Definition at line 739 of file pcconfig.c.

◆ set_value()

static BOOL set_value | ( | BOOL | is_hex,
 |  | const char * | value,
 |  | void * | arg,
 |  | int | size
 | ) |  |
static

Parse and store ARG_ATOX_B, ARG_ATOX_W or ARG_ATOI value.

Accept "0x" or "x" prefix for ATOX types only. Accept ATOX values without a prefix too.

Definition at line 288 of file pcconfig.c.

References atox().

◆ tcp_config()

long W32_CALL tcp_config ( const char * path )

Definition at line 1223 of file pcconfig.c.

◆ tcp_config_name()

int W32_CALL tcp_config_name | ( | char * | name,
 |  | int | max
 | ) |  |

Definition at line 1158 of file pcconfig.c.

◆ tcp_inject_config()

void W32_CALL tcp_inject_config | ( | const struct config_table * | cfg,
 |  | const char * | key,
 |  | const char * | value
 | ) |  |

Callable from a user application to inject config values before the normal WATTCP.CFG is loaded and parsed.

See '_watt_user_config' in sock_ini.c.

Definition at line 897 of file pcconfig.c.

References strntrimcpy(), and tcp_inject_config_direct().

◆ tcp_inject_config_direct()

static void tcp_inject_config_direct | ( | const struct config_table * | cfg,
 |  | const char * | key,
 |  | const char * | value
 | ) |  |
static

Called from config-file parser after "key = value" is found.

Take 'value' and possibly expand any in it. Pass key/value to config_table parser.

Definition at line 868 of file pcconfig.c.

References expand_var_str(), and parse_config_table().

◆ tcp_parse_file()

long tcp_parse_file | ( | WFILE | f,
 |  | const struct config_table * | cfg
 | ) |  |

Definition at line 1014 of file pcconfig.c.

◆ tcp_set_debug_state()

void W32_CALL tcp_set_debug_state ( WORD val )

Old comptibility function.

Callable from apps using Watt-32 only. Only allow apps to set a higher level than specified in cfg-file. Default: 'debug_on == 0'.

Definition at line 856 of file pcconfig.c.

◆ type_name()

static const char * type_name ( int type )
static

Definition at line 114 of file pcconfig.c.

◆ Usage()

void Usage ( void )

Definition at line 1338 of file pcconfig.c.

Variable Documentation

◆ cfg_file

const char* cfg_file

Definition at line 1305 of file pcconfig.c.

◆ config_name

char* config_name = (char*) "WATTCP.CFG"
static

Definition at line 85 of file pcconfig.c.

◆ Cookies

DWORD Cookies[MAX_COOKIES]

Definition at line 72 of file pcconfig.c.

◆ ctrace_on

int ctrace_on = 0

Definition at line 63 of file pcconfig.c.

◆ current_file

char* current_file = NULL
static

Definition at line 86 of file pcconfig.c.

◆ current_line

UINT current_line = 0
static

Definition at line 87 of file pcconfig.c.

◆ debug_on

int debug_on = 0

Definition at line 62 of file pcconfig.c.

◆ dynamic_host

BOOL dynamic_host = 0

Definition at line 68 of file pcconfig.c.

◆ environ_names

const char* environ_names[]
static
Initial value:
= {
"WATTCP.CFG",
"WATTCP_CFG"
}

Definition at line 90 of file pcconfig.c.

◆ got_eol

BOOL got_eol = FALSE
static

Definition at line 88 of file pcconfig.c.

◆ last_cookie

WORD last_cookie = 0

Definition at line 73 of file pcconfig.c.

◆ multihomes

WORD multihomes = 0

Definition at line 67 of file pcconfig.c.

◆ normal_cfg

const struct config_table normal_cfg[]
static

Definition at line 760 of file pcconfig.c.

◆ sock_data_timeout

int sock_data_timeout = 0

Definition at line 66 of file pcconfig.c.

◆ sock_delay

int sock_delay = 30

Definition at line 64 of file pcconfig.c.

◆ sock_inactive

int sock_inactive = 0

Definition at line 65 of file pcconfig.c.

◆ stkwalk_details

int stkwalk_details = 1

Definition at line 69 of file pcconfig.c.

◆ watt_init_cfg

const struct config_table* watt_init_cfg = normal_cfg

Definition at line 1221 of file pcconfig.c.


Watt-32 tcp/ip: E:/WATT/src/pcconfig.h File Reference

  • src
Data Structures | Typedefs | Functions | Variables
pcconfig.h File Reference

Go to the source code of this file.

Data Structures

struct FCFILE

Typedefs

typedef FILE * WFILE

Functions

void (W32_CALL *print_hook)(const char *)
Hook to a function called after we're initialised.
const char * | get_argv0 (void)
Return argv[0] as passed to main().
void | _add_server (WORD *counter, DWORD *array, int array_dim, DWORD value)
int | netdb_init (void)
Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise things.
void | netdb_warn (const char *fname)
const char * | expand_var_str (const char *str)
Return a string with a environment variable expanded (only one).
struct FCFILE * | fc_open (const char *fname, int mode)
void | fc_close (struct FCFILE *f)
int | fc_readbyte (struct FCFILE *f, char *c)
Read next byte from file f and write it to c.
long | tcp_parse_file (WFILE fil, const struct config_table *cfg)

Variables

int | sock_inactive
int | sock_data_timeout
int | sock_delay
WORD | multihomes
DWORD | Cookies [MAX_COOKIES]
WORD | last_cookie
int | ctrace_on
BOOL | dynamic_host
int | stkwalk_details
const struct config_table * | watt_init_cfg

Typedef Documentation

◆ WFILE

typedef struct FCFILE * WFILE

Definition at line 54 of file pcconfig.h.

Function Documentation

◆ _add_server()

void _add_server | ( | WORD * | counter,
 |  | DWORD * | array,
 |  | int | array_dim,
 |  | DWORD | value
 | ) |  |

Definition at line 204 of file pcconfig.c.

◆ expand_var_str()

const char * expand_var_str ( const char * str )

Return a string with a environment variable expanded (only one).

Never returns NULL.

E.g. if environment variable ETC is "c:\network\watt\bin", "$(ETC)\hosts" becomes "c:\network\watt\bin\hosts" If ETC isn't defined, "$(ETC)\hosts" becomes "\hosts".

Todo:
support several in one line and malloc the result.

Definition at line 234 of file pcconfig.c.

◆ fc_close()

void fc_close ( struct FCFILE * f )

Definition at line 962 of file pcconfig.c.

◆ fc_open()

struct FCFILE * fc_open | ( | const char * | fname,
 |  | int | mode
 | ) |  |

Definition at line 941 of file pcconfig.c.

◆ fc_readbyte()

int fc_readbyte | ( | struct FCFILE * | f,
 |  | char * | c
 | ) |  |

Read next byte from file f and write it to c.

This will fail miserably if the file is ever rewinded. Returns 1 on success, non-zero otherwise

Definition at line 976 of file pcconfig.c.

◆ get_argv0()

const char * get_argv0 ( void )

Return argv[0] as passed to main().

Definition at line 671 of file pcconfig.c.

References _strlcpy().

◆ netdb_init()

int netdb_init ( void )

Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise things.

Definition at line 1284 of file pcconfig.c.

References _watt_do_exit, and watt_sock_init().

◆ netdb_warn()

void netdb_warn ( const char * fname )

Definition at line 1294 of file pcconfig.c.

◆ tcp_parse_file()

long tcp_parse_file | ( | WFILE | fil,
 |  | const struct config_table * | cfg
 | ) |  |

Definition at line 1014 of file pcconfig.c.

Variable Documentation

◆ Cookies

DWORD Cookies[MAX_COOKIES]
extern

Definition at line 72 of file pcconfig.c.

◆ ctrace_on

int ctrace_on
extern

Definition at line 63 of file pcconfig.c.

◆ dynamic_host

BOOL dynamic_host
extern

Definition at line 68 of file pcconfig.c.

◆ last_cookie

WORD last_cookie
extern

Definition at line 73 of file pcconfig.c.

◆ multihomes

WORD multihomes
extern

Definition at line 67 of file pcconfig.c.

◆ sock_data_timeout

int sock_data_timeout
extern

Definition at line 66 of file pcconfig.c.

◆ sock_delay

int sock_delay
extern

Definition at line 64 of file pcconfig.c.

◆ sock_inactive

int sock_inactive
extern

Definition at line 65 of file pcconfig.c.

◆ stkwalk_details

int stkwalk_details
extern

Definition at line 69 of file pcconfig.c.

◆ watt_init_cfg

const struct config_table* watt_init_cfg
extern

Definition at line 1221 of file pcconfig.c.


Watt-32 tcp/ip: E:/WATT/src/pcdbug.c File Reference

  • src
Data Structures | Functions | Variables
pcdbug.c File Reference

Go to the source code of this file.

Data Structures

struct token

Functions

const char * | tcpStateName (UINT state)
void | dbug_init (void)
static void W32_CALL | dbug_exit (void)
Print ARP-cache and statistics counters to one of the debug-files.
static void | dbug_close (void)
static void | dump_ip_opt (const void *opt, int len)
static void | dump_tcp_opt (const void *opt, int len, DWORD ack)
static DWORD | dump_data (const void *data, UINT datalen)
static int | udp_dump (const _udp_Socket *sock, const in_Header *ip)
static int | tcp_dump (const _tcp_Socket *sock, const in_Header *ip)
static unsigned | dns_dump (const BYTE *, unsigned, unsigned)
static const BYTE * | dns_resource (const BYTE *, const BYTE *, const BYTE *)
static const BYTE * | dns_labels (const BYTE *, const BYTE *, const BYTE *)
static int | write_pcap_header (void)
static int | write_pcap_packet (const void *pkt, BOOL out)
static unsigned | ccp_dump (const BYTE *bp)
static unsigned | lcp_dump (const BYTE *bp)
static unsigned | ipcp_dump (const BYTE *bp)
static void | print_cpu_info (void)
static | void (W32_CALL *prev_hook)(const char *
static int | udp6_dump (const _udp_Socket *sock, const in6_Header *ip)
BOOL | dbug_file (void)
void | dbug_open (void)
static __inline BOOL | MAC_is_mcast (const void *addr)
static __inline BOOL | MAC_is_bcast (const void *addr)
static __inline BOOL | is_looped (const in_Header *ip)
static __inline BOOL | match_link_destination (const void *addr)
static __inline BOOL | match_arp_rarp (const arp_Header *arp)
static __inline BOOL | match_ip4_dest (const in_Header *ip)
static __inline BOOL | match_ip6_dest (const in6_Header *ip)
static __inline const char * | do_check_sum (WORD value, const void *p, int len)
static __inline const char * | link_protocol (WORD type)
static __inline const char * | ip4_protocol (BYTE prot)
static const char * | type_of_service (BYTE tos)
static __inline const char * | RTT_str (DWORD rtt, DWORD now)
static __inline const char * | arp_opcode (WORD code)
static void | dump_addr_port (const char *proto, const void *sock, const in_Header *ip)
static __inline void | ip6_addr_type (char *ret, const void *addr)
static void | dump_addr6_port (const char *proto, const void *sock, const in6_Header *ip)
static void | link_head_dump (const union link_Packet *pkt)
static int | arp_dump (const arp_Header *arp)
static int | rarp_dump (const rarp_Header *rarp)
static void | ip4_dump (const in_Header *ip)
static int | ip4_orig_dump (const in_Header *this_ip, const in_Header *orig_ip, int icmp_len)
static int | icmp4_dump (const in_Header *ip)
static int | igmp0_dump (const IGMPv0_packet *igmp, WORD len)
static int | igmp1_dump (const IGMPv1_packet *igmp, WORD len)
static int | igmp2_dump (const IGMPv2_packet *igmp, WORD len)
static int | igmp3_dump (const IGMPv3_packet *igmp, WORD len)
static int | igmp_dump (const in_Header *ip)
static void | sctp_dump_params (const BYTE *p, int len)
static void | sctp_dump_init (const struct sctp_Initiation *init, const BYTE *chunk_end)
static int | sctp_dump (const in_Header *ip4, const in6_Header *ip6)
static unsigned | ip4_payload_dump (const void *sock, const in_Header *ip)
static const char * | ip6_next_hdr (BYTE nxt)
static const char * | icmp6_options (const BYTE *opt, int tot_len)
static int | icmp6_dump (const in6_Header *ip)
static int | ip6_header_dump (const in6_Header *ip)
static unsigned | ip6_payload_dump (const void *sock, const in6_Header *ip)
static const char * | tok2str (const struct token *lp, const char *fmt, int v)
static const char * | pppoe_get_tag (const BYTE *tag)
const char * | pppoe_get_code (WORD code)
static __inline int | pppoe_head_dump (const struct pppoe_Header *head, const char *proto)
static int | pppoe_disc_dump (const struct pppoe_Packet *pppoe)
static int | pppoe_sess_dump (const void *sock, const struct pppoe_Packet *pppoe)
static const char * | udp_tcp_checksum (const in_Header *ip, const udp_Header *udp, const tcp_Header *tcp)
static const char * | udp_checksum (const in6_Header *ip, const udp_Header *udp)
static const char * | tcp_checksum (const in6_Header *ip, const tcp_Header *tcp)
static BOOL | is_dns_packet (WORD src_port, WORD dst_port)
static BOOL | dbug_filter (void)
static const char * | pcdbug_driver_ver (void)
static const char * | pcdbug_api_ver (void)
static void | print_driver_info (void)
static void | dbug_dump (const void *sock, const in_Header *ip, const char *fname, unsigned line, BOOL out)
static void | trace_xmit_pkt (const void *sock, const in_Header *ip, const char *fname, unsigned line)
static void | trace_recv_pkt (const void *sock, const in_Header *ip, const char *fname, unsigned line)
static void | set_debug_file (const char *value)
static void | set_debug_mode (const char *value)
static void | set_debug_filter (const char *value)
static void | set_debug_proto (const char *value)
static void W32_CALL | dbug_cfg_parse (const char *name, const char *value)
static int | flush_ods (void)
int MS_CDECL | dbug_printf (const char *format,...)
int | dbug_write (const char *buf)
int | dbug_putc (int c)
void | dbug_flush (void)

Variables

DebugProc | debug_xmit = NULL
DebugProc | debug_recv = NULL
static const char *static jmp_buf | dbg_jmp = NULL
static char | dbg_name [MAX_PATHLEN+1] = "WATTCP.DBG"
static BOOL | dbg_linebuf = FALSE
static BOOL | pcap_mode = FALSE
static DWORD | now
static BOOL | outbound
static BOOL | in_dbug_dump
static BOOL | use_gzip
static BOOL | use_ods = FALSE
static char | ip4_src [20]
static char | ip4_dst [20]
union {
FILE * stream
void * gz_stream
} dbg_file
static int | frag_status
static char | ip6_src [50]
static char | ip6_dst [50]
struct {
char MAC
char ARP
char RARP
char IP
char BCAST
char MCAST
char LOOP
char NONE
} filter = { 1,1,1,1,1,1,0,0 }
struct {
char MAC
char LLC
char ARP
char RARP
char IP
char UDP
char TCP
char ICMP
char IGMP
char SCTP
} debug = { 0,0,1,1,1,1,1,1,1,1 }
BOOL | dbg_mode_all = 1
These are public so they can be set by application if running without a config-file.
BOOL | dbg_print_stat = 1
BOOL | dbg_print_size = 0
BOOL | dbg_dns_details = 1
static DWORD | bytes_raw = 0UL
static const struct search_list | sctp_chunks []
static const struct search_list | sctp_params []
const struct token | ppp_type2str []
static char | ods_buf [4000]
static char * | ods_ptr = ods_buf

Detailed Description

Watt-32 protocol debugger. Writes to ‘debug.file’ specified in config-file. File may be stdout/stderr/nul.

Most functions are prefixed with ‘dbug_’. And variables with ‘dbg_’.

Definition in file pcdbug.c.

Function Documentation

◆ arp_dump()

static int arp_dump ( const arp_Header * arp )
static

Definition at line 734 of file pcdbug.c.

◆ arp_opcode()

static __inline const char * arp_opcode ( WORD code )
static

Definition at line 526 of file pcdbug.c.

◆ dbug_cfg_parse()

static void W32_CALL dbug_cfg_parse | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Definition at line 2721 of file pcdbug.c.

◆ dbug_close()

static void dbug_close ( void )
static

Definition at line 2842 of file pcdbug.c.

◆ dbug_dump()

static void dbug_dump | ( | const void * | sock,
 |  | const in_Header * | ip,
 |  | const char * | fname,
 |  | unsigned | line,
 |  | BOOL | out
 | ) |  |
static

Definition at line 2181 of file pcdbug.c.

◆ dbug_exit()

static void W32_CALL dbug_exit ( void )
static

Print ARP-cache and statistics counters to one of the debug-files.

Called from tcp_shutdown() after DHCP_release() and _tcp_abort() but before _eth_release() is called. pkt-drop counters are not reliable once _eth_release() has been called.

Definition at line 2910 of file pcdbug.c.

References _watt_assert_buf, _watt_cbroke, and _watt_fatal_error.

◆ dbug_file()

BOOL dbug_file ( void )

Definition at line 211 of file pcdbug.c.

◆ dbug_filter()

static BOOL dbug_filter ( void )
static

Definition at line 2003 of file pcdbug.c.

◆ dbug_flush()

void dbug_flush ( void )

Definition at line 2857 of file pcdbug.c.

◆ dbug_init()

void W32_CALL dbug_init ( void )

Definition at line 95 of file pcdbug.c.

◆ dbug_open()

void dbug_open ( void )

Definition at line 218 of file pcdbug.c.

◆ dbug_printf()

int MS_CDECL dbug_printf | ( | const char * | format,
 |  |  | ...
 | ) |  |

Definition at line 2764 of file pcdbug.c.

◆ dbug_putc()

int dbug_putc ( int c )

Definition at line 2820 of file pcdbug.c.

◆ dbug_write()

int dbug_write ( const char * buf )

Definition at line 2796 of file pcdbug.c.

◆ do_check_sum()

static __inline const char * do_check_sum | ( | WORD | value,
 |  | const void * | p,
 |  | int | len
 | ) |  |
static

Definition at line 412 of file pcdbug.c.

◆ dump_addr6_port()

static void dump_addr6_port | ( | const char * | proto,
 |  | const void * | sock,
 |  | const in6_Header * | ip
 | ) |  |
static

Definition at line 603 of file pcdbug.c.

◆ dump_addr_port()

static void dump_addr_port | ( | const char * | proto,
 |  | const void * | sock,
 |  | const in_Header * | ip
 | ) |  |
static

Definition at line 543 of file pcdbug.c.

◆ dump_data()

static DWORD dump_data | ( | const void * | data,
 |  | UINT | datalen
 | ) |  |
static

Definition at line 2606 of file pcdbug.c.

◆ dump_ip_opt()

static void dump_ip_opt | ( | const void * | opt,
 |  | int | len
 | ) |  |
static

Definition at line 2411 of file pcdbug.c.

◆ dump_tcp_opt()

static void dump_tcp_opt | ( | const void * | opt,
 |  | int | len,
 |  | DWORD | ack
 | ) |  |
static

Definition at line 2490 of file pcdbug.c.

◆ flush_ods()

static int flush_ods ( void )
static

Definition at line 2743 of file pcdbug.c.

◆ icmp4_dump()

static int icmp4_dump ( const in_Header * ip )
static
Todo:
Handle debugging of these

Definition at line 892 of file pcdbug.c.

References _inet_ntoa().

◆ icmp6_dump()

static int icmp6_dump ( const in6_Header * ip )
static

Definition at line 1314 of file pcdbug.c.

◆ icmp6_options()

static const char * icmp6_options | ( | const BYTE * | opt,
 |  | int | tot_len
 | ) |  |
static

Definition at line 1282 of file pcdbug.c.

◆ igmp0_dump()

static int igmp0_dump | ( | const IGMPv0_packet * | igmp,
 |  | WORD | len
 | ) |  |
static

Definition at line 986 of file pcdbug.c.

◆ igmp1_dump()

static int igmp1_dump | ( | const IGMPv1_packet * | igmp,
 |  | WORD | len
 | ) |  |
static

Definition at line 993 of file pcdbug.c.

◆ igmp2_dump()

static int igmp2_dump | ( | const IGMPv2_packet * | igmp,
 |  | WORD | len
 | ) |  |
static

Definition at line 1006 of file pcdbug.c.

◆ igmp3_dump()

static int igmp3_dump | ( | const IGMPv3_packet * | igmp,
 |  | WORD | len
 | ) |  |
static

Definition at line 1013 of file pcdbug.c.

◆ igmp_dump()

static int igmp_dump ( const in_Header * ip )
static

Definition at line 1020 of file pcdbug.c.

◆ ip4_dump()

static void ip4_dump ( const in_Header * ip )
static

Definition at line 764 of file pcdbug.c.

◆ ip4_orig_dump()

static int ip4_orig_dump | ( | const in_Header * | this_ip,
 |  | const in_Header * | orig_ip,
 |  | int | icmp_len
 | ) |  |
static

Definition at line 833 of file pcdbug.c.

◆ ip4_payload_dump()

static unsigned ip4_payload_dump | ( | const void * | sock,
 |  | const in_Header * | ip
 | ) |  |
static

Definition at line 1215 of file pcdbug.c.

◆ ip4_protocol()

static __inline const char * ip4_protocol ( BYTE prot )
static

Definition at line 450 of file pcdbug.c.

◆ ip6_addr_type()

static __inline void ip6_addr_type | ( | char * | ret,
 |  | const void * | addr
 | ) |  |
static

Definition at line 571 of file pcdbug.c.

◆ ip6_header_dump()

static int ip6_header_dump ( const in6_Header * ip )
static

Definition at line 1425 of file pcdbug.c.

◆ ip6_next_hdr()

static const char * ip6_next_hdr ( BYTE nxt )
static

Definition at line 1249 of file pcdbug.c.

◆ ip6_payload_dump()

static unsigned ip6_payload_dump | ( | const void * | sock,
 |  | const in6_Header * | ip
 | ) |  |
static

Definition at line 1443 of file pcdbug.c.

◆ is_dns_packet()

static BOOL is_dns_packet | ( | WORD | src_port,
 |  | WORD | dst_port
 | ) |  |
static

Definition at line 1760 of file pcdbug.c.

◆ is_looped()

static __inline BOOL is_looped ( const in_Header * ip )
static

Definition at line 333 of file pcdbug.c.

◆ link_head_dump()

static void link_head_dump ( const union link_Packet * pkt )
static

Definition at line 628 of file pcdbug.c.

◆ link_protocol()

static __inline const char * link_protocol ( WORD type )
static

Definition at line 424 of file pcdbug.c.

◆ MAC_is_bcast()

static __inline BOOL MAC_is_bcast ( const void * addr )
static

Definition at line 321 of file pcdbug.c.

◆ MAC_is_mcast()

static __inline BOOL MAC_is_mcast ( const void * addr )
static

Definition at line 313 of file pcdbug.c.

◆ match_arp_rarp()

static __inline BOOL match_arp_rarp ( const arp_Header * arp )
static

Definition at line 372 of file pcdbug.c.

◆ match_ip4_dest()

static __inline BOOL match_ip4_dest ( const in_Header * ip )
static

Definition at line 388 of file pcdbug.c.

◆ match_ip6_dest()

static __inline BOOL match_ip6_dest ( const in6_Header * ip )
static
Todo:
needs work

Definition at line 398 of file pcdbug.c.

◆ match_link_destination()

static __inline BOOL match_link_destination ( const void * addr )
static

Definition at line 357 of file pcdbug.c.

◆ pcdbug_api_ver()

static const char * pcdbug_api_ver ( void )
static

Definition at line 2130 of file pcdbug.c.

◆ pcdbug_driver_ver()

static const char * pcdbug_driver_ver ( void )
static

Definition at line 2113 of file pcdbug.c.

◆ pppoe_disc_dump()

static int pppoe_disc_dump ( const struct pppoe_Packet * pppoe )
static

Definition at line 1650 of file pcdbug.c.

◆ pppoe_get_code()

const char * pppoe_get_code ( WORD code )

Definition at line 1611 of file pcdbug.c.

◆ pppoe_get_tag()

static const char * pppoe_get_tag ( const BYTE * tag )
static

Definition at line 1515 of file pcdbug.c.

◆ pppoe_head_dump()

static __inline int pppoe_head_dump | ( | const struct pppoe_Header * | head,
 |  | const char * | proto
 | ) |  |
static

Definition at line 1634 of file pcdbug.c.

◆ pppoe_sess_dump()

static int pppoe_sess_dump | ( | const void * | sock,
 |  | const struct pppoe_Packet * | pppoe
 | ) |  |
static

Definition at line 1671 of file pcdbug.c.

◆ print_driver_info()

static void print_driver_info ( void )
static

Definition at line 2153 of file pcdbug.c.

◆ rarp_dump()

static int rarp_dump ( const rarp_Header * rarp )
static

Definition at line 749 of file pcdbug.c.

◆ RTT_str()

static __inline const char * RTT_str | ( | DWORD | rtt,
 |  | DWORD | now
 | ) |  |
static

Definition at line 511 of file pcdbug.c.

◆ sctp_dump()

static int sctp_dump | ( | const in_Header * | ip4,
 |  | const in6_Header * | ip6
 | ) |  |
static

Definition at line 1143 of file pcdbug.c.

◆ sctp_dump_init()

static void sctp_dump_init | ( | const struct sctp_Initiation * | init,
 |  | const BYTE * | chunk_end
 | ) |  |
static

Definition at line 1131 of file pcdbug.c.

◆ sctp_dump_params()

static void sctp_dump_params | ( | const BYTE * | p,
 |  | int | len
 | ) |  |
static

Definition at line 1112 of file pcdbug.c.

◆ set_debug_file()

static void set_debug_file ( const char * value )
static

Definition at line 2653 of file pcdbug.c.

◆ set_debug_filter()

static void set_debug_filter ( const char * value )
static

Definition at line 2666 of file pcdbug.c.

◆ set_debug_mode()

static void set_debug_mode ( const char * value )
static

Definition at line 2658 of file pcdbug.c.

◆ set_debug_proto()

static void set_debug_proto ( const char * value )
static

Definition at line 2696 of file pcdbug.c.

◆ tcp_checksum()

static const char * tcp_checksum | ( | const in6_Header * | ip,
 |  | const tcp_Header * | tcp
 | ) |  |
static

Definition at line 1750 of file pcdbug.c.

◆ tcp_dump()

static int tcp_dump | ( | const _tcp_Socket * | sock,
 |  | const in_Header * | ip
 | ) |  |
static

Definition at line 1835 of file pcdbug.c.

◆ tcpStateName()

const char * tcpStateName ( UINT state )

Definition at line 76 of file pcdbug.c.

◆ tok2str()

static const char * tok2str | ( | const struct token * | lp,
 |  | const char * | fmt,
 |  | int | v
 | ) |  |
static

Definition at line 1499 of file pcdbug.c.

◆ trace_recv_pkt()

static void trace_recv_pkt | ( | const void * | sock,
 |  | const in_Header * | ip,
 |  | const char * | fname,
 |  | unsigned | line
 | ) |  |
static

Definition at line 2396 of file pcdbug.c.

◆ trace_xmit_pkt()

static void trace_xmit_pkt | ( | const void * | sock,
 |  | const in_Header * | ip,
 |  | const char * | fname,
 |  | unsigned | line
 | ) |  |
static

Definition at line 2384 of file pcdbug.c.

◆ type_of_service()

static const char * type_of_service ( BYTE tos )
static

Definition at line 473 of file pcdbug.c.

◆ udp6_dump()

static int udp6_dump | ( | const _udp_Socket * | sock,
 |  | const in6_Header * | ip
 | ) |  |
static

Definition at line 1811 of file pcdbug.c.

◆ udp_checksum()

static const char * udp_checksum | ( | const in6_Header * | ip,
 |  | const udp_Header * | udp
 | ) |  |
static

Definition at line 1743 of file pcdbug.c.

◆ udp_dump()

static int udp_dump | ( | const _udp_Socket * | sock,
 |  | const in_Header * | ip
 | ) |  |
static

Definition at line 1782 of file pcdbug.c.

◆ udp_tcp_checksum()

static const char * udp_tcp_checksum | ( | const in_Header * | ip,
 |  | const udp_Header * | udp,
 |  | const tcp_Header * | tcp
 | ) |  |
static

Definition at line 1712 of file pcdbug.c.

Variable Documentation

◆ ARP

char ARP

Definition at line 173 of file pcdbug.c.

◆ BCAST

char BCAST

Definition at line 176 of file pcdbug.c.

◆ bytes_raw

DWORD bytes_raw = 0UL
static

Definition at line 205 of file pcdbug.c.

◆ dbg_dns_details

BOOL dbg_dns_details = 1

Definition at line 202 of file pcdbug.c.

◆ dbg_jmp

const char* static jmp_buf dbg_jmp = NULL
static

Definition at line 138 of file pcdbug.c.

◆ dbg_linebuf

BOOL dbg_linebuf = FALSE
static

Definition at line 140 of file pcdbug.c.

◆ dbg_mode_all

BOOL dbg_mode_all = 1

These are public so they can be set by application if running without a config-file.

Todo:
make them static.

Definition at line 199 of file pcdbug.c.

◆ dbg_name

char dbg_name[MAX_PATHLEN+1] = "WATTCP.DBG"
static

Definition at line 139 of file pcdbug.c.

◆ dbg_print_size

BOOL dbg_print_size = 0

Definition at line 201 of file pcdbug.c.

◆ dbg_print_stat

BOOL dbg_print_stat = 1

Definition at line 200 of file pcdbug.c.

◆ debug_recv

DebugProc debug_recv = NULL

Definition at line 91 of file pcdbug.c.

◆ debug_xmit

DebugProc debug_xmit = NULL

Definition at line 90 of file pcdbug.c.

◆ frag_status

int frag_status
static

Definition at line 162 of file pcdbug.c.

◆ gz_stream

void* gz_stream

Definition at line 152 of file pcdbug.c.

◆ ICMP

char ICMP

Definition at line 190 of file pcdbug.c.

◆ IGMP

char IGMP

Definition at line 191 of file pcdbug.c.

◆ in_dbug_dump

BOOL in_dbug_dump
static

Definition at line 144 of file pcdbug.c.

◆ IP

char IP

Definition at line 175 of file pcdbug.c.

◆ ip4_dst

char ip4_dst[20]
static

Definition at line 148 of file pcdbug.c.

◆ ip4_src

char ip4_src[20]
static

Definition at line 147 of file pcdbug.c.

◆ ip6_dst

char ip6_dst[50]
static

Definition at line 167 of file pcdbug.c.

◆ ip6_src

char ip6_src[50]
static

Definition at line 166 of file pcdbug.c.

◆ LLC

char LLC

Definition at line 184 of file pcdbug.c.

◆ LOOP

char LOOP

Definition at line 178 of file pcdbug.c.

◆ MAC

char MAC

Definition at line 172 of file pcdbug.c.

◆ MCAST

char MCAST

Definition at line 177 of file pcdbug.c.

◆ NONE

char NONE

Definition at line 179 of file pcdbug.c.

◆ now

DWORD now
static

Definition at line 142 of file pcdbug.c.

◆ ods_buf

char ods_buf[4000]
static

Definition at line 2740 of file pcdbug.c.

◆ ods_ptr

char* ods_ptr = ods_buf
static

Definition at line 2741 of file pcdbug.c.

◆ outbound

BOOL outbound
static

Definition at line 143 of file pcdbug.c.

◆ pcap_mode

BOOL pcap_mode = FALSE
static

Definition at line 141 of file pcdbug.c.

◆ ppp_type2str

const struct token ppp_type2str[]
Initial value:
= {
{ PPP_IP, "IP" },
{ PPP_IPV6, "IP6" },
{ PPP_IPX, "IPX" },
{ PPP_VJC, "VJC" },
{ PPP_VJNC, "VJNC" },
{ PPP_IPCP, "IPCP" },
{ PPP_IPXCP, "IPXCP" },
{ PPP_LCP, "LCP" },
{ PPP_LQR, "LQR" },
{ PPP_CCP, "CCP" },
{ PPP_PAP, "PAP" },
{ PPP_CHAP, "CHAP" },
{ PPP_CBCP, "CBCP" },
{ PPP_COMP, "COMP" },
{ 0, NULL }
}

Definition at line 1478 of file pcdbug.c.

◆ RARP

char RARP

Definition at line 174 of file pcdbug.c.

◆ SCTP

char SCTP

Definition at line 192 of file pcdbug.c.

◆ sctp_chunks

const struct search_list sctp_chunks[]
static
Initial value:
= {
{ SCTP_DATA, "DATA" },
{ SCTP_INITIATION, "INIT" },
{ SCTP_INITIATION_ACK, "INIT-ACK" },
{ SCTP_SELECTIVE_ACK, "SACK" },
{ SCTP_HEARTBEAT_REQUEST, "HB REQ" },
{ SCTP_HEARTBEAT_ACK, "HB ACK" },
{ SCTP_ABORT_ASSOCIATION, "ABORT" },
{ SCTP_SHUTDOWN, "SHUTDOWN" },
{ SCTP_SHUTDOWN_ACK, "SHUTDOWN ACK" },
{ SCTP_OPERATION_ERR, "OP ERR" },
{ SCTP_COOKIE_ECHO, "COOKIE ECHO" },
{ SCTP_COOKIE_ACK, "COOKIE ACK" },
{ SCTP_ECN_ECHO, "ECN ECHO" },
{ SCTP_ECN_CWR, "ECN CWR" },
{ SCTP_SHUTDOWN_COMPLETE, "SHUTDOWN COMPLETE" },
{ SCTP_FORWARD_CUM_TSN, "FOR CUM TSN" },
{ SCTP_RELIABLE_CNTL, "REL CTRL" },
{ SCTP_RELIABLE_CNTL_ACK, "REL CTRL ACK" },
{ SCTP_ASCONF_ACK_CHUNK_ID, "ASCONF ACK CHUNK ID" },
{ SCTP_PKTDROP_CHUNK_ID, "PKTDROP CHUNK ID" },
{ SCTP_STREAM_RESET_CHUNK_ID, "STREAM RESET_CHUNK ID" },
{ SCTP_IETF_EXT, "IETF EXT" }
}

Definition at line 1062 of file pcdbug.c.

◆ sctp_params

const struct search_list sctp_params[]
static
Initial value:
= {
{ SCTP_IPV4_PARAM_TYPE, "IPV4 PARAM TYPE" },
{ SCTP_IPV6_PARAM_TYPE, "IPV6 PARAM TYPE" },
{ SCTP_RESPONDER_COOKIE, "RESPONDER COOKIE" },
{ SCTP_UNRECOG_PARAM, "UNRECOG_PARAM" },
{ SCTP_COOKIE_PRESERVE, "COOKIE PRESERVE" },
{ SCTP_HOSTNAME_VIA_DNS, "HOSTNAME VIA_DNS" },
{ SCTP_RESTRICT_ADDR_TO, "RESTRICT ADDR_TO" },
{ SCTP_ECN_I_CAN_DO_ECN, "I CAN DO ECN" },
{ SCTP_OPERATION_SUCCEED, "OPERATION SUCCEED" },
{ SCTP_ERROR_NOT_EXECUTED, "ERROR NOT EXECUTED" },
{ SCTP_UNRELIABLE_STRM, "UNRELIABLE STRM" },
{ SCTP_ADD_IP_ADDRESS, "ADD IP ADDRESS" },
{ SCTP_DEL_IP_ADDRESS, "DEL IP ADDRESS" },
{ SCTP_STRM_FLOW_LIMIT, "STRM FLOW LIMIT" },
{ SCTP_PARTIAL_CSUM, "PARTIAL CSUM" },
{ SCTP_ERROR_CAUSE_TLV, "ERROR CAUSE TLV" },
{ SCTP_MIT_STACK_NAME, "MIT STACK NAME" },
{ SCTP_SETADDRESS_PRIMARY, "SETADDRESS PRIMARY" },
{ SCTP_RANDOM_PARAM, "RANDOM PARAM" },
{ SCTP_AUTH_CHUNK, "AUTH CHUNK" },
{ SCTP_REQ_HMAC_ALGO, "REQ HMAC ALGO" },
{ SCTP_SUPPORTED_EXT, "SUPPORTED EXT" }
}

Definition at line 1087 of file pcdbug.c.

◆ stream

FILE* stream

Definition at line 151 of file pcdbug.c.

◆ TCP

char TCP

Definition at line 189 of file pcdbug.c.

◆ UDP

char UDP

Definition at line 188 of file pcdbug.c.

◆ use_gzip

BOOL use_gzip
static

Definition at line 145 of file pcdbug.c.

◆ use_ods

BOOL use_ods = FALSE
static

Definition at line 146 of file pcdbug.c.


Watt-32 tcp/ip: E:/WATT/src/pcdbug.h File Reference

  • src
Typedefs | Functions | Variables
pcdbug.h File Reference

Go to the source code of this file.

Typedefs

typedef void(* DebugProc) (const void *sock, const in_Header *ip, const char *file, unsigned line)

Functions

const char * | tcpStateName (UINT state)
void | dbug_open (void)
BOOL | dbug_file (void)
int | dbug_write (const char *)
int | dbug_putc (int c)
void | dbug_flush (void)
_CRTCHK (printf, 1, 2) int dbug_printf(const char *fmt
int MS_CDECL | dbug_printf (_Printf_format_string_ const char *fmt,...) W32_ATTR_PRINTF(1
int MS_CDECL const char * | pppoe_get_code (WORD code)
void | TRACE_FILE (const char *fmt,...)
void | TRACE_CONSOLE (int level, const char *fmt,...)

Variables

W32_DATA DebugProc | debug_xmit
W32_DATA DebugProc | debug_recv
W32_DATA int | debug_on
BOOL | dbg_mode_all
These are public so they can be set by application if running without a config-file.
BOOL | dbg_print_stat
BOOL | dbg_dns_details

Typedef Documentation

◆ DebugProc

typedef void(* DebugProc) (const void *sock, const in_Header *ip, const char *file, unsigned line)

Definition at line 8 of file pcdbug.h.

Function Documentation

◆ dbug_file()

BOOL dbug_file ( void )

Definition at line 211 of file pcdbug.c.

◆ dbug_flush()

void dbug_flush ( void )

Definition at line 2857 of file pcdbug.c.

◆ dbug_open()

void dbug_open ( void )

Definition at line 218 of file pcdbug.c.

◆ dbug_putc()

int dbug_putc ( int c )

Definition at line 2820 of file pcdbug.c.

◆ dbug_write()

int dbug_write ( const char * buf )

Definition at line 2796 of file pcdbug.c.

◆ pppoe_get_code()

int MS_CDECL const char * pppoe_get_code ( WORD code )

Definition at line 1611 of file pcdbug.c.

◆ tcpStateName()

const char * tcpStateName ( UINT state )

Definition at line 76 of file pcdbug.c.

◆ TRACE_CONSOLE()

void TRACE_CONSOLE | ( | int | level,
 |  | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 157 of file highc.c.

◆ TRACE_FILE()

void TRACE_FILE | ( | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 152 of file highc.c.

Variable Documentation

◆ dbg_dns_details

BOOL dbg_dns_details

Definition at line 20 of file pcdbug.h.

◆ dbg_mode_all

BOOL dbg_mode_all
extern

These are public so they can be set by application if running without a config-file.

Todo:
make them static.

Definition at line 199 of file pcdbug.c.

◆ dbg_print_stat

BOOL dbg_print_stat

Definition at line 20 of file pcdbug.h.

◆ debug_on

W32_DATA int debug_on

Definition at line 16 of file pcdbug.h.

◆ debug_recv

W32_DATA DebugProc debug_recv

Definition at line 15 of file pcdbug.h.

◆ debug_xmit

W32_DATA DebugProc debug_xmit

Definition at line 15 of file pcdbug.h.


Watt-32 tcp/ip: E:/WATT/src/pcdhcp.c File Reference

  • src
Functions | Variables
pcdhcp.c File Reference

Go to the source code of this file.

Functions

static void | DHCP_state_INIT (int event)
DHCP state machine: state INIT.
static void | DHCP_state_BOUND (int event)
DHCP state machine: state BOUND.
static void | DHCP_state_RENEWING (int event)
DHCP state machine: state RENEWING.
static void | DHCP_state_REQUESTING (int event)
DHCP state machine: state REQUESTING.
static void | DHCP_state_SELECTING (int event)
DHCP state machine: state SELECTING.
static void | DHCP_state_REBINDING (int event)
DHCP state machine: state REBINDING.
static void | dhcp_options_add (const BYTE *opt, unsigned max)
Add options from a DHCP_OPT_OVERLOAD tag to 'extra_options' list.
static void | dhcp_set_timers (void)
Set all timers required by the DHCP state machine.
static void | change_ip_addr (void)
Change my_ip_addr of all tcp/udp sockets.
static BYTE * | put_request_list (BYTE *opt, int filled)
Append options from 'request_list' to 'opt'.
static int | write_config (void)
Write the transient DHCP configuration, either to file or via user-defined function.
static void | erase_config (void)
Erase the transient configuration.
static void W32_CALL | dhcp_fsm (void)
DHCP state machine: the event driver.
static const char * | state_name (void)
Return name of current DHCP state function.
static const char * | period (DWORD sec)
Return nicely formatted string for a time-period.
static BYTE * | make_boot_header (void)
Format a BOOTP header.
static BYTE * | put_hardware_opt (BYTE *opt)
Fill in the hardware type/len in Client ID option tag.
static int | DHCP_discover (void)
Send a DHCP discover message.
static int | DHCP_request (BOOL renew)
Send a DHCP request message.
static int | DHCP_release_decline (int msg_type, const char *msg)
Send a DHCP release or decline message.
static BOOL | DHCP_arp_check (DWORD my_ip)
Send an ARP reply to announce our new IP-address.
static int | DHCP_offer (const struct dhcp *in)
Parse DHCP offer reply.
static int | DHCP_is_ack (void)
Return TRUE if DHCP message is an ACK.
static int | DHCP_is_nack (void)
Return TRUE if DHCP message is a NACK.
static int W32_CALL | DHCP_icmp_callback (void *s, BYTE icmp_type, BYTE icmp_code)
void W32_CALL | DHCP_release (BOOL force)
Possibly send a DHCP release.
DWORD W32_CALL | DHCP_get_server (void)
Return current DHCP server address.
static sock_type * | dhcp_open (const char *msg, BOOL use_broadcast)
Allocate and open a UDP socket for DHCP message exchange.
static void | store_DHCP_server_MAC (void)
Add MAC address of DHCP sever to our ARP cache.
static void | DHCP_state_REBOOTING (int event)
DHCP state machine: Combined BOOT and BOOTING state.
int | DHCP_do_boot (void)
Our first time DHCP handler.
static int | set_request_list (char *options)
Parse a list of DHCP-request options from config-file.
static int | set_user_class (const char *value)
Parse user-class as specified in config-file.
static int | set_vend_class (const char *value)
Set vendor class option.
static | void (W32_CALL *prev_hook)(const char *
static void W32_CALL | DHCP_cfg_hook (const char *name, const char *value)
Parser for DHCP configuration.
static void W32_CALL | DHCP_exit (void)
Free allocated memory.
void | DHCP_init (void)
Initialises the DHCP config-parser.
static void | set_my_ip (const char *value)
Functions called by config-file parser while reading c:/W32DHCP.TMP.
static void | set_netmask (const char *value)
static void | set_gateway (const char *value)
static void | set_nameserv (const char *value)
static void | set_server (const char *value)
static void | set_domain (const char *value)
static void | set_lease (const char *value)
static void | set_renew (const char *value)
static void | set_rebind (const char *value)
static BOOL | eval_timers (void)
Check timers read from config-file and set state according to following rules:
static const char * | get_config_file (void)
static void | std_erase_config (void)
static int | std_read_config (void)
static int | std_write_config (void)
Write the transient DHCP configuration to file.
static void | usr_erase_config (void)
static int | usr_read_config (void)
static int | usr_write_config (void)
int W32_CALL | DHCP_read_config (void)
Called from watt_sock_init() after "\c WATTCP.CFG" has been parsed.
WattDHCPConfigFunc W32_CALL | DHCP_set_config_func (WattDHCPConfigFunc fn)
Sets up an application hook for doing DHCP operations (DHCP_config_op)

Variables

BOOL | DHCP_did_gratuitous_arp = FALSE
static WattDHCPConfigFunc | config_func = NULL
static DWORD | exchange_id
static DWORD | router
static DWORD | nameserver
static DWORD | dhcp_server = 0
static DWORD | dhcp_renewal = 0
static DWORD | dhcp_rebind = 0
static DWORD | dhcp_iplease = 0
static DWORD | suggest_lease = 0
static DWORD | old_ip_addr = 0
static BOOL | bcast_flag = TRUE
static BOOL | got_offer = FALSE
static BOOL | configured = FALSE
static BOOL | arp_check_ip = FALSE
static BOOL | cfg_read = FALSE
static BOOL | cfg_saved = FALSE
static int | dhcp_timeout = 10
static int | max_retries = 3
static int | discover_loops = 0
static struct dhcp dhcp_in | dhcp_out
static void(* | DHCP_state )(int) = NULL
static time_t | renewal_timeout
static time_t | rebind_timeout
static time_t | lease_timeout
static DWORD | send_timeout
static BOOL | trace_on = FALSE
static char | config_file [MAX_VALUELEN+1] = ""
static sock_type * | sock = NULL
static const BYTE | default_request_list []
static struct DHCP_list | request_list
static struct DHCP_list | extra_options = { NULL, 0 }
static struct DHCP_list | user_class = { NULL, 0 }
static struct DHCP_list | vend_class = { (BYTE*)"Watt-32", 7 }
static const char *static time_t | cfg_dhcp_iplease = NULL
static time_t | cfg_dhcp_renewal
static time_t | cfg_dhcp_rebind
static const struct config_table | transient_cfg []
Open and parse Wattcp transient configuration.

Detailed Description

Dynamic Host Configuration Protocol (RFC 1541/2131/2132). These extensions gets called if "MY_IP" is set to "DHCP" or if no WATTCP.CFG file is found.

Definition in file pcdhcp.c.

Function Documentation

◆ change_ip_addr()

static void change_ip_addr ( void )
static

Change my_ip_addr of all tcp/udp sockets.

Definition at line 1222 of file pcdhcp.c.

References _tcp_allsocs, _udp_allsocs, my_ip_addr, and tcp_Socket::next.

◆ DHCP_arp_check()

static BOOL DHCP_arp_check ( DWORD my_ip )
static

Send an ARP reply to announce our new IP-address.

This is in order to fill ARP cache of other hosts (gratuitous ARP).

Optionally (if arp_check_ip is TRUE), send an ARP request to check if our assigned IP-address is really vacant.

Definition at line 425 of file pcdhcp.c.

References _arp_check_own_ip(), _arp_reply(), _pktserial, MAC_address(), and sin_mask.

◆ DHCP_cfg_hook()

static void W32_CALL DHCP_cfg_hook | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Parser for DHCP configuration.

Matches all "\c DHCP.xx" values from WATTCP.CFG file and make appropriate actions.

Definition at line 1389 of file pcdhcp.c.

References ARG_ATOI, ARG_FUNC, ARG_RESOLVE, ARG_STRCPY, parse_config_table(), set_request_list(), set_user_class(), and set_vend_class().

◆ DHCP_discover()

static int DHCP_discover ( void )
static

Send a DHCP discover message.

Definition at line 291 of file pcdhcp.c.

References make_boot_header(), put_hardware_opt(), put_request_list(), and set_timeout().

◆ DHCP_do_boot()

int DHCP_do_boot ( void )

Our first time DHCP handler.

Called if:

  • we don't have a WATTCP.CFG file
  • or we specified "MY_IP = DHCP".
  • or reading a previous W32DHCP.TMP file with transient config failed.
  • or lease times call for a renew or rebind. It doesn't hurt that it is blocking.

Definition at line 1085 of file pcdhcp.c.

References dhcp_fsm(), dhcp_open(), DHCP_state_BOUND(), DHCP_state_INIT(), DHCP_state_REBINDING(), DHCP_state_RENEWING(), erase_config(), my_ip_addr, sin_mask, and write_config().

◆ DHCP_exit()

static void W32_CALL DHCP_exit ( void )
static

Free allocated memory.

Definition at line 1412 of file pcdhcp.c.

References _watt_fatal_error.

◆ dhcp_fsm()

static void W32_CALL dhcp_fsm ( void )
static

DHCP state machine: the event driver.

Definition at line 1024 of file pcdhcp.c.

References _eth_addr, chk_timeout(), DHCP_is_ack(), DHCP_is_nack(), sock_dataready(), and state_name().

◆ DHCP_get_server()

DWORD W32_CALL DHCP_get_server ( void )

Return current DHCP server address.

Definition at line 764 of file pcdhcp.c.

◆ DHCP_icmp_callback()

static int W32_CALL DHCP_icmp_callback | ( | void * | s,
 |  | BYTE | icmp_type,
 |  | BYTE | icmp_code
 | ) |  |
static

Definition at line 715 of file pcdhcp.c.

◆ DHCP_init()

void DHCP_init ( void )

Initialises the DHCP config-parser.

Definition at line 1431 of file pcdhcp.c.

References DHCP_cfg_hook(), and DHCP_exit().

◆ DHCP_is_ack()

static int DHCP_is_ack ( void )
static

Return TRUE if DHCP message is an ACK.

Definition at line 694 of file pcdhcp.c.

◆ DHCP_is_nack()

static int DHCP_is_nack ( void )
static

Return TRUE if DHCP message is a NACK.

Definition at line 704 of file pcdhcp.c.

◆ DHCP_offer()

static int DHCP_offer ( const struct dhcp * in )
static

Parse DHCP offer reply.

Note
May be called recursively.
Todo:
make a hook for SMB-lib

Definition at line 460 of file pcdhcp.c.

References _arp_add_gateway(), _arp_kill_gateways(), _default_ttl, _inet_ntoa(), _strlcpy(), defaultdomain, DHCP_offer(), dhcp_options_add(), hostname, period(), setdomainname(), sin_mask, tcp_keep_intvl, tftp_set_boot_fname(), and tftp_set_server().

◆ dhcp_open()

static sock_type * dhcp_open | ( | const char * | msg,
 |  | BOOL | use_broadcast
 | ) |  |
static

Allocate and open a UDP socket for DHCP message exchange.

Definition at line 772 of file pcdhcp.c.

References udp_open().

◆ dhcp_options_add()

static void dhcp_options_add | ( | const BYTE * | opt,
 |  | unsigned | max
 | ) |  |
static

Add options from a DHCP_OPT_OVERLOAD tag to 'extra_options' list.

Definition at line 1162 of file pcdhcp.c.

◆ DHCP_read_config()

int W32_CALL DHCP_read_config ( void )

Called from watt_sock_init() after "\c WATTCP.CFG" has been parsed.

Open and parse transient configuration from 'config_file' or call user-defined function to read transient configuration.

Definition at line 1826 of file pcdhcp.c.

References dhcp_open(), dhcp_set_timers(), and eval_timers().

◆ DHCP_release()

void W32_CALL DHCP_release ( BOOL force )

Possibly send a DHCP release.

  • force If TRUE, release unconditionally.
    Note
    Send release if we are configured and remaining lease is below minimum lease (DHCP_MIN_LEASE = 10 sec).

Definition at line 732 of file pcdhcp.c.

References dhcp_fsm(), and DHCP_release_decline().

◆ DHCP_release_decline()

static int DHCP_release_decline | ( | int | msg_type,
 |  | const char * | msg
 | ) |  |
static

Send a DHCP release or decline message.

  • msg_type DHCP_RELEASE or DHCP_DECLINE.
  • msg Optional message describing the cause.

Definition at line 387 of file pcdhcp.c.

References make_boot_header(), and set_timeout().

◆ DHCP_request()

static int DHCP_request ( BOOL renew )
static

Send a DHCP request message.

Definition at line 323 of file pcdhcp.c.

References make_boot_header(), my_ip_addr, and put_hardware_opt().

◆ DHCP_set_config_func()

WattDHCPConfigFunc W32_CALL DHCP_set_config_func ( WattDHCPConfigFunc fn )

Sets up an application hook for doing DHCP operations (DHCP_config_op)

Definition at line 1865 of file pcdhcp.c.

◆ dhcp_set_timers()

static void dhcp_set_timers ( void )
static

Set all timers required by the DHCP state machine.

Definition at line 1195 of file pcdhcp.c.

◆ DHCP_state_BOUND()

static void DHCP_state_BOUND ( int event )
static

DHCP state machine: state BOUND.

  • Awaits T1-TIMEOUT and enter RENEWING state.

Definition at line 826 of file pcdhcp.c.

References DHCP_request(), DHCP_state_RENEWING(), and my_ip_addr.

◆ DHCP_state_INIT()

static void DHCP_state_INIT ( int event )
static

DHCP state machine: state INIT.

  • Awaits SEND-TIMEOUT, send discover and enter SELECTING state.

Definition at line 988 of file pcdhcp.c.

References DHCP_discover(), DHCP_state_SELECTING(), and set_timeout().

◆ DHCP_state_REBINDING()

static void DHCP_state_REBINDING ( int event )
static

DHCP state machine: state REBINDING.

  • Awaits ACK and enter BOUND state.
  • Awaits NAK and enter INIT state.

Definition at line 896 of file pcdhcp.c.

References change_ip_addr(), DHCP_offer(), dhcp_set_timers(), DHCP_state_BOUND(), DHCP_state_INIT(), my_ip_addr, Random(), and set_timeout().

◆ DHCP_state_REBOOTING()

static void DHCP_state_REBOOTING ( int event )
static

DHCP state machine: Combined BOOT and BOOTING state.

Definition at line 1007 of file pcdhcp.c.

References DHCP_state_BOUND(), DHCP_state_INIT(), Random(), and set_timeout().

◆ DHCP_state_RENEWING()

static void DHCP_state_RENEWING ( int event )
static

DHCP state machine: state RENEWING.

  • Awaits SEND-TIMEOUT and send request.
  • Awaits T2-TIMEOUT and send request, enter REBINDING state.
  • Awaits ACK and enter BOUND state.
  • Awaits NAK and enter INIT state.

Definition at line 921 of file pcdhcp.c.

References change_ip_addr(), DHCP_offer(), DHCP_request(), dhcp_set_timers(), DHCP_state_BOUND(), DHCP_state_INIT(), DHCP_state_REBINDING(), my_ip_addr, Random(), and set_timeout().

◆ DHCP_state_REQUESTING()

static void DHCP_state_REQUESTING ( int event )
static

DHCP state machine: state REQUESTING.

  • Awaits SEND-TIMEOUT and send request.
  • Awaits ACK and do ARP check. Enter BOUND if successful.
  • Awaits NAK and enter INIT.

Definition at line 845 of file pcdhcp.c.

References DHCP_arp_check(), DHCP_offer(), DHCP_release_decline(), DHCP_request(), dhcp_set_timers(), DHCP_state_BOUND(), DHCP_state_INIT(), my_ip_addr, Random(), set_timeout(), and store_DHCP_server_MAC().

◆ DHCP_state_SELECTING()

static void DHCP_state_SELECTING ( int event )
static

DHCP state machine: state SELECTING.

  • Awaits OFFER, set SEND_TIMER and enter REQUESTING state.
  • Awaits SEND-TIMEOUT, enter INIT state and resend discover.

Definition at line 957 of file pcdhcp.c.

References DHCP_offer(), DHCP_state_INIT(), DHCP_state_REQUESTING(), my_ip_addr, Random(), and set_timeout().

◆ erase_config()

static void erase_config ( void )
static

Erase the transient configuration.

Definition at line 1816 of file pcdhcp.c.

◆ eval_timers()

static BOOL eval_timers ( void )
static

Check timers read from config-file and set state according to following rules:

  • now < renewal => BOUND
  • now > renewal && now < rebind => RENEWING
  • now >= rebind && now < lease-end => REBINDING
  • now >= lease-end => INIT-REBOOT
Return values
FALSE | if lease times expired.
TRUE | otherwise.

Definition at line 1511 of file pcdhcp.c.

References ctime_r(), DHCP_state_BOUND(), and DHCP_state_RENEWING().

◆ get_config_file()

static const char * get_config_file ( void )
static

Definition at line 1591 of file pcdhcp.c.

◆ make_boot_header()

static BYTE * make_boot_header ( void )
static

Format a BOOTP header.

Definition at line 247 of file pcdhcp.c.

References _eth_addr, _eth_get_hwtype(), _eth_mac_len, DHCP_state_BOUND(), DHCP_state_REBINDING(), DHCP_state_RENEWING(), and my_ip_addr.

◆ period()

static const char * period ( DWORD sec )
static

Return nicely formatted string for a time-period.

Definition at line 230 of file pcdhcp.c.

◆ put_hardware_opt()

static BYTE * put_hardware_opt ( BYTE * opt )
static

Fill in the hardware type/len in Client ID option tag.

Definition at line 275 of file pcdhcp.c.

References _eth_addr, and _eth_get_hwtype().

◆ put_request_list()

static BYTE * put_request_list | ( | BYTE * | opt,
 |  | int | filled
 | ) |  |
static

Append options from 'request_list' to 'opt'.

Definition at line 1291 of file pcdhcp.c.

◆ set_domain()

static void set_domain ( const char * value )
static

Definition at line 1479 of file pcdhcp.c.

◆ set_gateway()

static void set_gateway ( const char * value )
static

Definition at line 1453 of file pcdhcp.c.

◆ set_lease()

static void set_lease ( const char * value )
static

Definition at line 1485 of file pcdhcp.c.

◆ set_my_ip()

static void set_my_ip ( const char * value )
static

Functions called by config-file parser while reading c:/W32DHCP.TMP.

Definition at line 1441 of file pcdhcp.c.

References aton(), and my_ip_addr.

◆ set_nameserv()

static void set_nameserv ( const char * value )
static

Definition at line 1466 of file pcdhcp.c.

◆ set_netmask()

static void set_netmask ( const char * value )
static

Definition at line 1447 of file pcdhcp.c.

◆ set_rebind()

static void set_rebind ( const char * value )
static

Definition at line 1495 of file pcdhcp.c.

◆ set_renew()

static void set_renew ( const char * value )
static

Definition at line 1490 of file pcdhcp.c.

◆ set_request_list()

static int set_request_list ( char * options )
static

Parse a list of DHCP-request options from config-file.

e.g DHCP_REQ_LIST = 1,23,24,28,36

Definition at line 1244 of file pcdhcp.c.

◆ set_server()

static void set_server ( const char * value )
static

Definition at line 1473 of file pcdhcp.c.

◆ set_user_class()

static int set_user_class ( const char * value )
static

Parse user-class as specified in config-file.

Format is: "DHCP.USERCLASS = value1,value2,...". Build up user_class.data along the way.

Definition at line 1311 of file pcdhcp.c.

◆ set_vend_class()

static int set_vend_class ( const char * value )
static

Set vendor class option.

Todo:
Support setting vendor class

Definition at line 1366 of file pcdhcp.c.

◆ state_name()

static const char * state_name ( void )
static

Return name of current DHCP state function.

Definition at line 217 of file pcdhcp.c.

References DHCP_state_BOUND(), DHCP_state_INIT(), DHCP_state_REBINDING(), DHCP_state_RENEWING(), DHCP_state_REQUESTING(), and DHCP_state_SELECTING().

◆ std_erase_config()

static void std_erase_config ( void )
static

Definition at line 1601 of file pcdhcp.c.

◆ std_read_config()

static int std_read_config ( void )
static

Definition at line 1609 of file pcdhcp.c.

◆ std_write_config()

static int std_write_config ( void )
static

Write the transient DHCP configuration to file.

Append to file if found, else create the file.

Note
"ifdef USE_BUFFERED_IO" ignored here.

Definition at line 1635 of file pcdhcp.c.

References _default_ttl, _inet_ntoa(), ctime_r(), hostname, my_ip_addr, sin_mask, strerror(), tcp_keep_intvl, and wattcpVersion().

◆ store_DHCP_server_MAC()

static void store_DHCP_server_MAC ( void )
static

Add MAC address of DHCP sever to our ARP cache.

Definition at line 812 of file pcdhcp.c.

References _arp_cache_add(), _eth_brdcast, and _pktdevclass.

◆ usr_erase_config()

static void usr_erase_config ( void )
static

Definition at line 1725 of file pcdhcp.c.

◆ usr_read_config()

static int usr_read_config ( void )
static

Definition at line 1730 of file pcdhcp.c.

◆ usr_write_config()

static int usr_write_config ( void )
static

Definition at line 1783 of file pcdhcp.c.

◆ write_config()

static int write_config ( void )
static

Write the transient DHCP configuration, either to file or via user-defined function.

Definition at line 1857 of file pcdhcp.c.

References std_write_config().

Variable Documentation

◆ arp_check_ip

BOOL arp_check_ip = FALSE
static

Definition at line 130 of file pcdhcp.c.

◆ bcast_flag

BOOL bcast_flag = TRUE
static

Definition at line 127 of file pcdhcp.c.

◆ cfg_dhcp_iplease

const char* static time_t cfg_dhcp_iplease = NULL
static

Definition at line 1380 of file pcdhcp.c.

◆ cfg_dhcp_rebind

time_t cfg_dhcp_rebind
static

Definition at line 1382 of file pcdhcp.c.

◆ cfg_dhcp_renewal

time_t cfg_dhcp_renewal
static

Definition at line 1381 of file pcdhcp.c.

◆ cfg_read

BOOL cfg_read = FALSE
static

Definition at line 131 of file pcdhcp.c.

◆ cfg_saved

BOOL cfg_saved = FALSE
static

Definition at line 132 of file pcdhcp.c.

◆ config_file

char config_file[MAX_VALUELEN+1] = ""
static

Definition at line 147 of file pcdhcp.c.

◆ config_func

WattDHCPConfigFunc config_func = NULL
static

Definition at line 116 of file pcdhcp.c.

◆ configured

BOOL configured = FALSE
static

Definition at line 129 of file pcdhcp.c.

◆ default_request_list

const BYTE default_request_list[]
static
Initial value:
= {
DHCP_OPT_SUBNET_MASK,
DHCP_OPT_ROUTERS_ON_SNET,
DHCP_OPT_DNS_SRV,
DHCP_OPT_COOKIE_SRV,
DHCP_OPT_LPR_SRV,
DHCP_OPT_HOST_NAME,
DHCP_OPT_DOMAIN_NAME,
DHCP_OPT_IP_DEFAULT_TTL,
DHCP_OPT_IF_MTU,
DHCP_OPT_ARP_CACHE_TIMEOUT,
DHCP_OPT_ETHERNET_ENCAPSULATION,
DHCP_OPT_TCP_DEFAULT_TTL,
#if defined(USE_BSD_API)
DHCP_OPT_LOG_SRV,
DHCP_OPT_NBIOS_NAME_SRV,
DHCP_OPT_NBIOS_NODE_TYPE,
DHCP_OPT_NBIOS_SCOPE,
#endif
#if defined(USE_TFTP)
DHCP_OPT_TFTP_SERVER,
DHCP_OPT_BOOT_FILENAME
#endif
}

Definition at line 152 of file pcdhcp.c.

◆ DHCP_did_gratuitous_arp

BOOL DHCP_did_gratuitous_arp = FALSE

Definition at line 114 of file pcdhcp.c.

◆ dhcp_iplease

DWORD dhcp_iplease = 0
static

Definition at line 123 of file pcdhcp.c.

◆ dhcp_out

struct dhcp dhcp_in dhcp_out
static

Definition at line 138 of file pcdhcp.c.

◆ dhcp_rebind

DWORD dhcp_rebind = 0
static

Definition at line 122 of file pcdhcp.c.

◆ dhcp_renewal

DWORD dhcp_renewal = 0
static

Definition at line 121 of file pcdhcp.c.

◆ dhcp_server

DWORD dhcp_server = 0
static

Definition at line 120 of file pcdhcp.c.

◆ DHCP_state

void(* DHCP_state) (int) ( int ) = NULL
static

Definition at line 140 of file pcdhcp.c.

◆ dhcp_timeout

int dhcp_timeout = 10
static

Definition at line 134 of file pcdhcp.c.

◆ discover_loops

int discover_loops = 0
static

Definition at line 136 of file pcdhcp.c.

◆ exchange_id

DWORD exchange_id
static

Definition at line 118 of file pcdhcp.c.

◆ extra_options

struct DHCP_list extra_options = { NULL, 0 }
static

Definition at line 182 of file pcdhcp.c.

◆ got_offer

BOOL got_offer = FALSE
static

Definition at line 128 of file pcdhcp.c.

◆ lease_timeout

time_t lease_timeout
static

Definition at line 143 of file pcdhcp.c.

◆ max_retries

int max_retries = 3
static

Definition at line 135 of file pcdhcp.c.

◆ nameserver

DWORD nameserver
static

Definition at line 119 of file pcdhcp.c.

◆ old_ip_addr

DWORD old_ip_addr = 0
static

Definition at line 125 of file pcdhcp.c.

◆ rebind_timeout

time_t rebind_timeout
static

Definition at line 142 of file pcdhcp.c.

◆ renewal_timeout

time_t renewal_timeout
static

Definition at line 141 of file pcdhcp.c.

◆ request_list

struct DHCP_list request_list
static
Initial value:
= {
(BYTE*) &default_request_list,
sizeof (default_request_list)
}

Definition at line 177 of file pcdhcp.c.

◆ router

DWORD router
static

Definition at line 119 of file pcdhcp.c.

◆ send_timeout

DWORD send_timeout
static

Definition at line 144 of file pcdhcp.c.

◆ sock

sock_type* sock = NULL
static

Definition at line 148 of file pcdhcp.c.

◆ suggest_lease

DWORD suggest_lease = 0
static

Definition at line 124 of file pcdhcp.c.

◆ trace_on

BOOL trace_on = FALSE
static

Definition at line 145 of file pcdhcp.c.

◆ transient_cfg

const struct config_table transient_cfg[]
static
Initial value:
= {
{ "DHCP.LEASE", ARG_FUNC, (void*)set_lease },
{ "DHCP.RENEW", ARG_FUNC, (void*)set_renew },
{ "DHCP.REBIND", ARG_FUNC, (void*)set_rebind },
{ "DHCP.MY_IP", ARG_FUNC, (void*)set_my_ip },
{ "DHCP.NETMASK", ARG_FUNC, (void*)set_netmask },
{ "DHCP.GATEWAY", ARG_FUNC, (void*)set_gateway },
{ "DHCP.NAMESERV", ARG_FUNC, (void*)set_nameserv },
{ "DHCP.SERVER", ARG_FUNC, (void*)set_server },
{ "DHCP.DOMAIN", ARG_FUNC, (void*)set_domain },
{ "DHCP.HOSTNAME", ARG_STRCPY, (void*)hostname },
#if defined(USE_BSD_API)
{ "DHCP.LOGHOST", ARG_STRCPY, (void*)&syslog_host_name },
#endif
{ "DHCP.DEF_TTL", ARG_ATOI, (void*)&_default_ttl },
#if !defined(USE_UDP_ONLY)
{ "DHCP.TCP_KEEP", ARG_ATOI, (void*)&tcp_keep_intvl },
#endif
{ NULL, 0, NULL }
}
_default_ttl
int _default_ttl
Definition: ip4_out.c:54
set_my_ip
static void set_my_ip(const char *value)
Functions called by config-file parser while reading c:/W32DHCP.TMP.
Definition: pcdhcp.c:1441
tcp_keep_intvl
unsigned tcp_keep_intvl
time between keepalive probes
Definition: pctcp.c:136
hostname
char hostname[MAX_HOSTLEN+1]
Our configured hostname.
Definition: pctcp.c:58
ARG_STRCPY
@ ARG_STRCPY
copy string value
Definition: tcp.h:456
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448

Open and parse Wattcp transient configuration.

i.e. values that must be known between consecutive runs of an Watt application. We should write the configured values to this file, and read back on next run to avoid doing DHCP boot/release for every program.

Definition at line 1567 of file pcdhcp.c.

◆ user_class

struct DHCP_list user_class = { NULL, 0 }
static

Definition at line 183 of file pcdhcp.c.

◆ vend_class

struct DHCP_list vend_class = { (BYTE*)"Watt-32", 7 }
static

Definition at line 184 of file pcdhcp.c.


Watt-32 tcp/ip: E:/WATT/src/pcdhcp.h File Reference

  • src
Data Structures | Enumerations | Functions
pcdhcp.h File Reference

Go to the source code of this file.

Data Structures

struct DHCP_list

Enumerations

enum DHCP_MsgTypes {
DHCP_DISCOVER = 1 ,
DHCP_OFFER ,
DHCP_REQUEST ,
DHCP_DECLINE ,
DHCP_ACK ,
DHCP_NAK ,
DHCP_RELEASE ,
DHCP_INFORM
}
enum DHCP_Events {
EVENT_OFFER = 1 ,
EVENT_SEND_TIMEOUT ,
EVENT_T1_TIMEOUT ,
EVENT_T2_TIMEOUT ,
EVENT_ACK ,
EVENT_NAK
}
enum DHCP_Options {
DHCP_OPT_PAD = 0 ,
DHCP_OPT_SUBNET_MASK = 1 ,
DHCP_OPT_TIME_OFFSET = 2 ,
DHCP_OPT_ROUTERS_ON_SNET = 3 ,
DHCP_OPT_TIME_SRV = 4 ,
DHCP_OPT_NAME_SRV = 5 ,
DHCP_OPT_DNS_SRV = 6 ,
DHCP_OPT_LOG_SRV = 7 ,
DHCP_OPT_COOKIE_SRV = 8 ,
DHCP_OPT_LPR_SRV = 9 ,
DHCP_OPT_IMPRESS_SRV = 10 ,
DHCP_OPT_RES_LOCATION_SRV = 11 ,
DHCP_OPT_HOST_NAME = 12 ,
DHCP_OPT_BOOT_FSIZE = 13 ,
DHCP_OPT_MERIT_DUMPFILE = 14 ,
DHCP_OPT_DOMAIN_NAME = 15 ,
DHCP_OPT_SWAP_SRV = 16 ,
DHCP_OPT_ROOT_PATH = 17 ,
DHCP_OPT_EXTENTIONS_PATH = 18 ,
DHCP_OPT_IP_FORWARDING = 19 ,
DHCP_OPT_NON_LOCAL_SRC_ROUTE = 20 ,
DHCP_OPT_POLICY_FILTER = 21 ,
DHCP_OPT_MAX_DGRAM_REASM_SIZE = 22 ,
DHCP_OPT_IP_DEFAULT_TTL = 23 ,
DHCP_OPT_PATH_MTU_AGING_TIMEOUT = 24 ,
DHCP_OPT_PATH_MTU_PLATEAU_TABLE = 25 ,
DHCP_OPT_IF_MTU = 26 ,
DHCP_OPT_ALL_SUBNETS_LOCAL = 27 ,
DHCP_OPT_BROADCAST_ADDR = 28 ,
DHCP_OPT_PERFORM_MASK_DISCOVERY = 29 ,
DHCP_OPT_MASK_SUPPLIER = 30 ,
DHCP_OPT_PERFORM_ROUTER_DISCOVERY = 31 ,
DHCP_OPT_ROUTER_SOLICITATION_ADDR = 32 ,
DHCP_OPT_STATIC_ROUTE = 33 ,
DHCP_OPT_TRAILER_ENCAPSULATION = 34 ,
DHCP_OPT_ARP_CACHE_TIMEOUT = 35 ,
DHCP_OPT_ETHERNET_ENCAPSULATION = 36 ,
DHCP_OPT_TCP_DEFAULT_TTL = 37 ,
DHCP_OPT_TCP_KEEPALIVE_INTERVAL = 38 ,
DHCP_OPT_TCP_KEEPALIVE_GARBAGE = 39 ,
DHCP_OPT_NIS_DOMAIN_NAME = 40 ,
DHCP_OPT_NIS_SRVS = 41 ,
DHCP_OPT_NTP_SRVS = 42 ,
DHCP_OPT_VENDOR_SPECIFIC_INFO = 43 ,
DHCP_OPT_NBIOS_NAME_SRV = 44 ,
DHCP_OPT_NBIOS_DGRAM_DIST_SRV = 45 ,
DHCP_OPT_NBIOS_NODE_TYPE = 46 ,
DHCP_OPT_NBIOS_SCOPE = 47 ,
DHCP_OPT_XFONT_SRV = 48 ,
DHCP_OPT_XDISPLAY_MANAGER = 49 ,
DHCP_OPT_REQUESTED_IP_ADDR = 50 ,
DHCP_OPT_IP_ADDR_LEASE_TIME = 51 ,
DHCP_OPT_OVERLOAD = 52 ,
DHCP_OPT_MSG_TYPE = 53 ,
DHCP_OPT_SRV_IDENTIFIER = 54 ,
DHCP_OPT_PARAM_REQUEST = 55 ,
DHCP_OPT_MSG = 56 ,
DHCP_OPT_MAX_MSG_SIZE = 57 ,
DHCP_OPT_T1_VALUE = 58 ,
DHCP_OPT_T2_VALUE = 59 ,
DHCP_OPT_CLASS_ID = 60 ,
DHCP_OPT_CLIENT_ID = 61 ,
DHCP_OPT_NIS_DOMAIN = 64 ,
DHCP_OPT_NIS_SRV_OPT = 65 ,
DHCP_OPT_TFTP_SERVER = 66 ,
DHCP_OPT_BOOT_FILENAME = 67 ,
DHCP_OPT_MOBIP_HOME_AGENTS = 68 ,
DHCP_OPT_SMTP_SRVS = 69 ,
DHCP_OPT_POP3_SRVS = 70 ,
DHCP_OPT_NNTP_SRVS = 71 ,
DHCP_OPT_WWW_SRVS = 72 ,
DHCP_OPT_FINGER_SRVS = 73 ,
DHCP_OPT_IRC_SRVS = 74 ,
DHCP_OPT_STREET_TALK_SRVS = 75 ,
DHCP_OPT_STDA_SRVS = 76 ,
DHCP_OPT_USER_CLASS = 77 ,
DHCP_OPT_GRUB_MENU = 150 ,
DHCP_OPT_END = 255
}

Functions

W32_CLANG_PACK_WARN_DEF () extern int DHCP_do_boot(void)
This hook is to prevent the BSD-socket API being linked in by default.
void DHCP_init (void)
Initialises the DHCP config-parser.

Enumeration Type Documentation

◆ DHCP_Events

enum DHCP_Events

Definition at line 20 of file pcdhcp.h.

◆ DHCP_MsgTypes

enum DHCP_MsgTypes

Definition at line 9 of file pcdhcp.h.

◆ DHCP_Options

enum DHCP_Options

Definition at line 33 of file pcdhcp.h.

Function Documentation

◆ DHCP_init()

void DHCP_init ( void )

Initialises the DHCP config-parser.

Definition at line 1431 of file pcdhcp.c.

References DHCP_cfg_hook(), and DHCP_exit().

◆ W32_CLANG_PACK_WARN_DEF()

W32_CLANG_PACK_WARN_DEF ( )

This hook is to prevent the BSD-socket API being linked in by default.

It is only set from the BSD functions when needed.

Definition at line 261 of file pcsed.h.


Watt-32 tcp/ip: E:/WATT/src/pcdns.c File Reference

  • src
Functions | Variables
pcdns.c File Reference

Go to the source code of this file.

Functions

int (W32_CALL *_resolve_hook)(void)
static void | query_init (struct DNS_query *q, BOOL is_ip6)
Initialise the query header and clear the alternate addr-list.
static void | store_alt_address (const void *data, int idx, BOOL is_ip6)
Remember alternate address in dom_a?list[].
static int | pack_domain (BYTE *dst, const char *src)
Pack a regular text string into a packed domain name, suitable for the name server.
static int | send_query (sock_type *sock, struct DNS_query *q, const char *name, DWORD towho, WORD qtype)
Put together a domain lookup packet and send it.
static __inline int | count_paths (const char *path_str)
static __inline const char * | get_path (const char *path_str, int which_one)
static void | extract_cname (const struct DNS_query *q, const char *src, char *dest, size_t max)
Extract the CNAME from a resource record.
static int | unpack_domain (const struct DNS_query *q, const BYTE *src, size_t src_size, BYTE *dst, size_t dst_size)
Unpack a received compressed domain name.
static int | read_response (const struct DNS_query *q, int len, WORD qtype, void *addr)
Extract the IPv4/v6 address from a response message (A or AAAA record).
static __inline BOOL | legal_ident (WORD id, const WORD *cache, int num)
static int | lookup_domain (struct DNS_query *q, const char *mname, BOOL add_dom, DWORD nameserver, BOOL *timedout, BOOL is_aaaa, void *addr)
DOMAIN based name lookup.
static const char * | next_domain (const char *domain, int count)
Given domain and count = 0,1,2,..., return next larger domain or NULL when no more are available.
static const char * | server_error (enum DNS_serv_resp err)
Return text for server-side errors.
static const char * | client_error (enum DNS_client_code err)
Return text for client-side errors.
const char *W32_CALL | dom_strerror (int err)
Return text for error code (dom_errno).
char *W32_CALL | dom_remove_dot (char *name)
DWORD W32_CALL | resolve (const char *name)
Convert host name to an address.
int W32_CALL | resolve_ip6 (const char *name, void *addr)

Variables

BOOL | called_from_resolve = FALSE
Hacks to make gethostbyname() and resolve() cooperate.
BOOL | called_from_ghbn = FALSE
char | defaultdomain [MAX_HOSTLEN+1] = "your.domain.com"
The 2 next variables are loaded from WATTCP.CFG file.
char * | def_domain = defaultdomain
BOOL | _resolve_exit
BOOL | _resolve_timeout
BOOL | from_windns
DWORD | dom_ttl
int | dom_errno
char | dom_cname [MAX_HOSTLEN+1]
DWORD | def_nameservers [MAX_NAMESERVERS]
WORD | last_nameserver = 0
WORD | dns_timeout = 0
BOOL | dns_recurse = TRUE
BOOL | dns_do_ipv6 = TRUE
BOOL | dns_do_idna = FALSE
WORD | dns_windns = 0
static const char * | loc_domain
static DWORD | res_timeout
DWORD | dom_a4list [MAX_ADDRESSES+1]
ip6_address | dom_a6list [MAX_ADDRESSES+1]

Detailed Description

Domain Name Server protocol.

This portion of the code needs some major work. I ported it (read STOLE IT) from NCSA and lost about half the code somewhere in the process.

Version
0.6
Date
Mar 19, 2004 - Added ACE encoding/decoding of international domain names. Ref. RFC-3490.
Version
0.5
Date
Aug 20, 2003 - Added storing of CNAME record (used as alias in gethostbyname, gethostbyaddr)
Version
0.4
Date
Aug 04, 2002 - Rewritten for IPv6 support (DTYPE_AAAA)
Version
0.3
Date
Jun 16, 1997 - calling usr_yield (i.e. system_yield) while resolving
Version
0.2
Date
Apr 24, 1991 - use substring portions of domain
Version
0.1
Date
Mar 18, 1991 - improved the trailing domain list
Version
0.0
Date
Feb 19, 1991 - pirated by Erick Engelke
Version
-1.0 - NCSA code

Definition in file pcdns.c.

Function Documentation

◆ client_error()

static const char * client_error ( enum DNS_client_code err )
static

Return text for client-side errors.

Definition at line 707 of file pcdns.c.

◆ count_paths()

static __inline int count_paths ( const char * path_str )
static

Definition at line 237 of file pcdns.c.

◆ dom_remove_dot()

char *W32_CALL dom_remove_dot ( char * name )

Definition at line 757 of file pcdns.c.

◆ dom_strerror()

const char *W32_CALL dom_strerror ( int err )

Return text for error code (dom_errno).

Definition at line 742 of file pcdns.c.

References client_error(), and server_error().

◆ extract_cname()

static void extract_cname | ( | const struct DNS_query * | q,
 |  | const char * | src,
 |  | char * | dest,
 |  | size_t | max
 | ) |  |
static

Extract the CNAME from a resource record.

Definition at line 267 of file pcdns.c.

◆ get_path()

static __inline const char * get_path | ( | const char * | path_str,
 |  | int | which_one
 | ) |  |
static

Definition at line 248 of file pcdns.c.

◆ legal_ident()

static __inline BOOL legal_ident | ( | WORD | id,
 |  | const WORD * | cache,
 |  | int | num
 | ) |  |
static

Definition at line 468 of file pcdns.c.

◆ lookup_domain()

static int lookup_domain | ( | struct DNS_query * | q,
 |  | const char * | mname,
 |  | BOOL | add_dom,
 |  | DWORD | nameserver,
 |  | BOOL * | timedout,
 |  | BOOL | is_aaaa,
 |  | void * | addr
 | ) |  |
static

DOMAIN based name lookup.

Query a domain name server to get an IP number Returns the machine number of the machine record for future reference. Events generated will have this number tagged with them. Returns various negative numbers on error conditions.

if add_dom is nonzero, add default domain.

Definition at line 487 of file pcdns.c.

References _watt_cbroke, chk_timeout(), dom_strerror(), Random(), read_response(), send_query(), and sock_dataready().

◆ next_domain()

static const char * next_domain | ( | const char * | domain,
 |  | int | count
 | ) |  |
static

Given domain and count = 0,1,2,..., return next larger domain or NULL when no more are available.

Definition at line 664 of file pcdns.c.

◆ pack_domain()

static int pack_domain | ( | BYTE * | dst,
 |  | const char * | src
 | ) |  |
static

Pack a regular text string into a packed domain name, suitable for the name server.

Returns length or -1 if a labellength is > 63.

Definition at line 147 of file pcdns.c.

◆ query_init()

static void query_init | ( | struct DNS_query * | q,
 |  | BOOL | is_ip6
 | ) |  |
static

Initialise the query header and clear the alternate addr-list.

Definition at line 106 of file pcdns.c.

◆ read_response()

static int read_response | ( | const struct DNS_query * | q,
 |  | int | len,
 |  | WORD | qtype,
 |  | void * | addr
 | ) |  |
static

Extract the IPv4/v6 address from a response message (A or AAAA record).

Returns 0 on fail and sets appropriate status code in ‘dom_errno’. Returns 1 if okay and if the ip is available and copied to 'addr'. Read upto 'len' bytes from reply.

Note: Our query is echoed in the answer, but 'q' below is not same as we sent in send_query().

Definition at line 365 of file pcdns.c.

References extract_cname(), store_alt_address(), and unpack_domain().

◆ resolve()

DWORD W32_CALL resolve ( const char * name )

Convert host name to an address.

Returns 0 if name is unresolvable right now. Return value is host-order.

Definition at line 771 of file pcdns.c.

References aton(), called_from_resolve, dom_strerror(), isaddr(), lookup_domain(), my_ip_addr, next_domain(), query_init(), and set_timeout().

◆ resolve_ip6()

int W32_CALL resolve_ip6 | ( | const char * | name,
 |  | void * | addr
 | ) |  |

Definition at line 937 of file pcdns.c.

◆ send_query()

static int send_query | ( | sock_type * | sock,
 |  | struct DNS_query * | q,
 |  | const char * | name,
 |  | DWORD | towho,
 |  | WORD | qtype
 | ) |  |
static

Put together a domain lookup packet and send it.

Uses port DOM_DST_PORT (53).

Definition at line 196 of file pcdns.c.

References pack_domain(), and udp_open().

◆ server_error()

static const char * server_error ( enum DNS_serv_resp err )
static

Return text for server-side errors.

Definition at line 682 of file pcdns.c.

◆ store_alt_address()

static void store_alt_address | ( | const void * | data,
 |  | int | idx,
 |  | BOOL | is_ip6
 | ) |  |
static

Remember alternate address in dom_a?list[].

Definition at line 127 of file pcdns.c.

◆ unpack_domain()

static int unpack_domain | ( | const struct DNS_query * | q,
 |  | const BYTE * | src,
 |  | size_t | src_size,
 |  | BYTE * | dst,
 |  | size_t | dst_size
 | ) |  |
static

Unpack a received compressed domain name.

Handles pointers to continuation domain names.

  • address of query response ('q') is used as the base for the offset of any pointer which is present.
  • returns the number of bytes at 'src' which should be skipped over. Includes the 0-terminator in its length count.
  • returns -1 if the response is munged.

Definition at line 312 of file pcdns.c.

Variable Documentation

◆ _resolve_exit

BOOL _resolve_exit

Definition at line 76 of file pcdns.c.

◆ _resolve_timeout

BOOL _resolve_timeout

Definition at line 77 of file pcdns.c.

◆ called_from_ghbn

BOOL called_from_ghbn = FALSE

Definition at line 61 of file pcdns.c.

◆ called_from_resolve

BOOL called_from_resolve = FALSE

Hacks to make gethostbyname() and resolve() cooperate.

Definition at line 60 of file pcdns.c.

◆ def_domain

char* def_domain = defaultdomain

Definition at line 72 of file pcdns.c.

◆ def_nameservers

DWORD def_nameservers[MAX_NAMESERVERS]

Definition at line 83 of file pcdns.c.

◆ defaultdomain

char defaultdomain[MAX_HOSTLEN+1] = "your.domain.com"

The 2 next variables are loaded from WATTCP.CFG file.

Definition at line 71 of file pcdns.c.

◆ dns_do_idna

BOOL dns_do_idna = FALSE

Definition at line 88 of file pcdns.c.

◆ dns_do_ipv6

BOOL dns_do_ipv6 = TRUE

Definition at line 87 of file pcdns.c.

◆ dns_recurse

BOOL dns_recurse = TRUE

Definition at line 86 of file pcdns.c.

◆ dns_timeout

WORD dns_timeout = 0

Definition at line 85 of file pcdns.c.

◆ dns_windns

WORD dns_windns = 0

Definition at line 89 of file pcdns.c.

◆ dom_a4list

DWORD dom_a4list[MAX_ADDRESSES+1]

Definition at line 97 of file pcdns.c.

◆ dom_a6list

ip6_address dom_a6list[MAX_ADDRESSES+1]

Definition at line 100 of file pcdns.c.

◆ dom_cname

char dom_cname[MAX_HOSTLEN+1]

Definition at line 81 of file pcdns.c.

◆ dom_errno

int dom_errno

Definition at line 80 of file pcdns.c.

◆ dom_ttl

DWORD dom_ttl

Definition at line 79 of file pcdns.c.

◆ from_windns

BOOL from_windns

Definition at line 78 of file pcdns.c.

◆ last_nameserver

WORD last_nameserver = 0

Definition at line 84 of file pcdns.c.

◆ loc_domain

const char* loc_domain
static

Definition at line 91 of file pcdns.c.

◆ res_timeout

DWORD res_timeout
static

Definition at line 92 of file pcdns.c.


Watt-32 tcp/ip: E:/WATT/src/pcdns.h File Reference

  • src
Data Structures | Enumerations | Functions | Variables
pcdns.h File Reference

Go to the source code of this file.

Data Structures

struct | DNS_Header
Another definition of 'struct DNS_head'. More...
struct | DNS_query
struct | DNS_Query
struct | DNS_resource

Enumerations

enum DNS_serv_resp {
DNS_SRV_OK = 0 ,
DNS_SRV_FORM ,
DNS_SRV_FAIL ,
DNS_SRV_NAME ,
DNS_SRV_NOTIMPL ,
DNS_SRV_REFUSE ,
DNS_SRV_MAX = 15
}
enum DNS_client_code {
DNS_CLI_SYSTEM = DNS_SRV_MAX ,
DNS_CLI_REFUSE ,
DNS_CLI_USERQUIT ,
DNS_CLI_NOSERV ,
DNS_CLI_TIMEOUT ,
DNS_CLI_ILL_RESP ,
DNS_CLI_ILL_IDNA ,
DNS_CLI_TOOBIG ,
DNS_CLI_NOIP ,
DNS_CLI_NOIPV6 ,
DNS_CLI_OTHER ,
DNS_CLI_MAX
}

Functions

W32_CLANG_PACK_WARN_OFF () struct DNS_head
W32_CLANG_PACK_WARN_DEF () extern char dom_cname[MAX_HOSTLEN+1]
This hook is to prevent the BSD-socket API being linked in by default.
int | reverse_lookup_myip (void)
Do a reverse lookup on ‘my_ip_addr’.
int | reverse_resolve_ip4 (DWORD ipv4, char *result, size_t size)
int | reverse_resolve_ip6 (const void *ipv6, char *result, size_t size)

Variables

DWORD | dom_ttl
BOOL | dns_do_ipv6
BOOL | dns_do_idna
WORD | dns_windns
BOOL | called_from_resolve
Hacks to make gethostbyname() and resolve() cooperate.
BOOL | called_from_ghbn
BOOL | from_windns
DWORD | dom_a4list [MAX_ADDRESSES+1]
ip6_address | dom_a6list [MAX_ADDRESSES+1]

Enumeration Type Documentation

◆ DNS_client_code

enum DNS_client_code

Definition at line 152 of file pcdns.h.

◆ DNS_serv_resp

enum DNS_serv_resp

Definition at line 139 of file pcdns.h.

Function Documentation

◆ reverse_lookup_myip()

int reverse_lookup_myip ( void )

Do a reverse lookup on ‘my_ip_addr’.

If successfull, replace ‘hostname’ and ‘def_domain’ with returned result.

Definition at line 176 of file udp_rev.c.

References my_ip_addr, and sethostname().

◆ reverse_resolve_ip4()

int reverse_resolve_ip4 | ( | DWORD | ipv4,
 |  | char * | result,
 |  | size_t | size
 | ) |  |

Definition at line 222 of file udp_rev.c.

◆ reverse_resolve_ip6()

int reverse_resolve_ip6 | ( | const void * | ipv6,
 |  | char * | result,
 |  | size_t | size
 | ) |  |

Definition at line 299 of file udp_rev.c.

◆ W32_CLANG_PACK_WARN_DEF()

W32_CLANG_PACK_WARN_DEF ( )

This hook is to prevent the BSD-socket API being linked in by default.

It is only set from the BSD functions when needed.

Definition at line 261 of file pcsed.h.

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 12 of file pcdns.h.

Variable Documentation

◆ called_from_ghbn

BOOL called_from_ghbn
extern

Definition at line 61 of file pcdns.c.

◆ called_from_resolve

BOOL called_from_resolve
extern

Hacks to make gethostbyname() and resolve() cooperate.

Definition at line 60 of file pcdns.c.

◆ dns_do_idna

BOOL dns_do_idna
extern

Definition at line 88 of file pcdns.c.

◆ dns_do_ipv6

BOOL dns_do_ipv6
extern

Definition at line 87 of file pcdns.c.

◆ dns_windns

WORD dns_windns
extern

Definition at line 89 of file pcdns.c.

◆ dom_a4list

DWORD dom_a4list[MAX_ADDRESSES+1]
extern

Definition at line 97 of file pcdns.c.

◆ dom_a6list

ip6_address dom_a6list[MAX_ADDRESSES+1]
extern

Definition at line 100 of file pcdns.c.

◆ dom_ttl

DWORD dom_ttl
extern

Definition at line 79 of file pcdns.c.

◆ from_windns

BOOL from_windns
extern

Definition at line 78 of file pcdns.c.


Watt-32 tcp/ip: E:/WATT/src/pcicmp.c File Reference

  • src
Functions | Variables
pcicmp.c File Reference

Go to the source code of this file.

Functions

static void | icmp_print (int dbg_lvl, const char *msg, DWORD src)
static void | icmp_bogus (const in_Header *ip, int type, const char *msg)
Print info about bogus and possibly dangerous ICMP messages.
static BOOL | icmp_check (const in_Header *ip, int type)
Check if ip-source is a (directed) broadcast address.
static int | icmp_send (struct _pkt *pkt, DWORD src, DWORD dest, int length)
Format and send a ICMP packet.
int | icmp_send_unreach (const in_Header *ip, int code)
Send an ICMP destination/protocol unreachable back to 'ip->source'.
int | icmp_send_timexceed (const in_Header *ip, const void *mac_dest)
Send an "ICMP Time Exceeded" (reassebly timeout) back to 'ip->source'.
int | icmp_send_mask_req (void)
static int | icmp_echo_reply (const in_Header *ip, const union ICMP_PKT *req, unsigned len)
static void | icmp_redirect (const union ICMP_PKT *icmp, const in_Header *ip, const in_Header *orig_ip, int code)
Handle ICMP_REDIRECT messages.
void | icmp_handler (const in_Header *ip, BOOL broadcast)
Handler for incoming ICMP packets.
void | icmp_doredirect (const char *value)
Determine which protocols we shall act upon when ICMP redirect is received.

Variables

const char * | icmp_type_str [ICMP_MAXTYPE+1]
const char * | icmp_unreach_str [16]
const char * | icmp_redirect_str [4]
const char * | icmp_exceed_str [2]
do_redirect = { 1,1,1,1 }
static WORD | addr_mask_id = 0
Send an ICMP Address Mask Request as link-layer + IP broadcast.
static WORD | addr_mask_seq = 0

Detailed Description

ICMP for IPv4 (RFC 792).

Definition in file pcicmp.c.

Function Documentation

◆ icmp_bogus()

static void icmp_bogus | ( | const in_Header * | ip,
 |  | int | type,
 |  | const char * | msg
 | ) |  |
static

Print info about bogus and possibly dangerous ICMP messages.

e.g. "ICMP: (144.133.122.111) Bogus Redirect; GW = 111.110.109.108"

Definition at line 130 of file pcicmp.c.

◆ icmp_check()

static BOOL icmp_check | ( | const in_Header * | ip,
 |  | int | type
 | ) |  |
static

Check if ip-source is a (directed) broadcast address.

Some hacker may try to create a broadcast storm. Also check for null source address (0.0.0.0). Broadcast destination is already filtered out by icmp_handler().

Definition at line 147 of file pcicmp.c.

References icmp_bogus().

◆ icmp_doredirect()

void icmp_doredirect ( const char * value )

Determine which protocols we shall act upon when ICMP redirect is received.

Definition at line 601 of file pcicmp.c.

◆ icmp_echo_reply()

static int icmp_echo_reply | ( | const in_Header * | ip,
 |  | const union ICMP_PKT * | req,
 |  | unsigned | len
 | ) |  |
static

Definition at line 280 of file pcicmp.c.

◆ icmp_handler()

void icmp_handler | ( | const in_Header * | ip,
 |  | BOOL | broadcast
 | ) |  |

Handler for incoming ICMP packets.

Todo:
Handle cancelling raw sockets
Todo:
!!
Todo:
!!

<

Todo:
send reply?

<

Todo:
should store

<

Todo:
send reply

<

Todo:
send reply upwards

Definition at line 380 of file pcicmp.c.

References _do_mask_req, _tcp_cancel(), _udp_cancel(), add_ping(), addr_mask_id, block_icmp, icmp_bogus(), icmp_redirect(), set_timeout(), and sin_mask.

◆ icmp_print()

static void icmp_print | ( | int | dbg_lvl,
 |  | const char * | msg,
 |  | DWORD | src
 | ) |  |
static

Definition at line 111 of file pcicmp.c.

◆ icmp_redirect()

static void icmp_redirect | ( | const union ICMP_PKT * | icmp,
 |  | const in_Header * | ip,
 |  | const in_Header * | orig_ip,
 |  | int | code
 | ) |  |
static

Handle ICMP_REDIRECT messages.

Definition at line 319 of file pcicmp.c.

References _arp_register(), _inet_ntoa(), _tcp_cancel(), _udp_cancel(), icmp_bogus(), my_ip_addr, and sin_mask.

◆ icmp_send()

static int icmp_send | ( | struct _pkt * | pkt,
 |  | DWORD | src,
 |  | DWORD | dest,
 |  | int | length
 | ) |  |
static

Format and send a ICMP packet.

Note
: src and dest are on network order.

Definition at line 183 of file pcicmp.c.

◆ icmp_send_mask_req()

int icmp_send_mask_req ( void )

Definition at line 265 of file pcicmp.c.

◆ icmp_send_timexceed()

int icmp_send_timexceed | ( | const in_Header * | ip,
 |  | const void * | mac_dest
 | ) |  |

Send an "ICMP Time Exceeded" (reassebly timeout) back to 'ip->source'.

Definition at line 229 of file pcicmp.c.

References _default_ttl, _eth_formatpacket(), icmp_check(), and icmp_send().

◆ icmp_send_unreach()

int icmp_send_unreach | ( | const in_Header * | ip,
 |  | int | code
 | ) |  |

Send an ICMP destination/protocol unreachable back to 'ip->source'.

Limit the rate of these to 20 per second. Ref. RFC-1812.

Definition at line 198 of file pcicmp.c.

References _eth_formatpacket(), chk_timeout(), icmp_check(), icmp_send(), and set_timeout().

Variable Documentation

◆ addr_mask_id

WORD addr_mask_id = 0
static

Send an ICMP Address Mask Request as link-layer + IP broadcast.

Even if we know our address, we send with src = 0.0.0.0.

Definition at line 262 of file pcicmp.c.

◆ addr_mask_seq

WORD addr_mask_seq = 0
static

Definition at line 263 of file pcicmp.c.

◆ do_redirect

do_redirect = { 1,1,1,1 }

Definition at line 108 of file pcicmp.c.

◆ icmp_exceed_str

const char* icmp_exceed_str[2]
Initial value:
= {
__LANG("TTL exceeded in transit"),
__LANG("Fragment reassembly time exceeded")
}

Definition at line 80 of file pcicmp.c.

◆ icmp_redirect_str

const char* icmp_redirect_str[4]
Initial value:
= {
__LANG("Redirect for Network"),
__LANG("Redirect for Host"),
__LANG("Redirect for TOS and Network"),
__LANG("Redirect for TOS and Host")
}

Definition at line 71 of file pcicmp.c.

◆ icmp_type_str

const char* icmp_type_str[ICMP_MAXTYPE+1]
Initial value:
= {
__LANG("Echo Reply"), "1", "2",
__LANG("Destination Unreachable"),
__LANG("Source Quench"),
__LANG("Redirect"), "6", "7",
__LANG("Echo Request"),
__LANG("Router Advert"),
__LANG("Router Solic"),
__LANG("TTL exceeded"),
__LANG("Param Problem"),
__LANG("Timestamp Message"),
__LANG("Timestamp Reply"),
__LANG("Info Request"),
__LANG("Info Reply"),
__LANG("Mask Request"),
__LANG("Mask Reply")
}

Definition at line 30 of file pcicmp.c.

◆ icmp_unreach_str

const char* icmp_unreach_str[16]
Initial value:
= {
__LANG("Network Unreachable"),
__LANG("Host Unreachable"),
__LANG("Protocol Unreachable"),
__LANG("Port Unreachable"),
__LANG("Fragmentation needed and DF set"),
__LANG("Source Route Failed"),
__LANG("Network unknown"),
__LANG("Host unknown"),
__LANG("Source host isolated"),
__LANG("Net-access denied"),
__LANG("Host-access denied"),
__LANG("Bad TOS for net"),
__LANG("Bad TOS for host"),
__LANG("Admin prohibited"),
__LANG("Host precedence violation"),
__LANG("Precedence cutoff")
}

Definition at line 50 of file pcicmp.c.


Watt-32 tcp/ip: E:/WATT/src/pcicmp.h File Reference

  • src
Data Structures | Typedefs | Functions | Variables
pcicmp.h File Reference

Go to the source code of this file.

Data Structures

struct | ICMP_pointer
struct | ICMP_ip
struct | ICMP_echo
struct | ICMP_timestamp
struct | ICMP_info
struct | ICMP_addr_mask
struct | ICMP_traceroute
struct | ICMP_needfrag
union | ICMP_PKT
struct | ping_pkt

Typedefs

typedef union ICMP_PKT ICMP_PKT

Functions

W32_CLANG_PACK_WARN_DEF () extern const char *icmp_type_str[ICMP_MAXTYPE+1]
These are the ICMP messages.
void | icmp_handler (const in_Header *ip, BOOL broadcast)
Handler for incoming ICMP packets.
void | icmp_doredirect (const char *value)
Determine which protocols we shall act upon when ICMP redirect is received.
int | icmp_send_timexceed (const in_Header *ip, const void *mac_dest)
Send an "ICMP Time Exceeded" (reassebly timeout) back to 'ip->source'.
int | icmp_send_unreach (const in_Header *ip, int code)
Send an ICMP destination/protocol unreachable back to 'ip->source'.
int | icmp_send_mask_req (void)

Variables

const char * | icmp_unreach_str [16]
const char * | icmp_redirect_str [4]
const char * | icmp_exceed_str [2]

Function Documentation

◆ icmp_doredirect()

void icmp_doredirect ( const char * value )

Determine which protocols we shall act upon when ICMP redirect is received.

Definition at line 601 of file pcicmp.c.

◆ icmp_handler()

void icmp_handler | ( | const in_Header * | ip,
 |  | BOOL | broadcast
 | ) |  |

Handler for incoming ICMP packets.

Todo:
Handle cancelling raw sockets
Todo:
!!
Todo:
!!

<

Todo:
send reply?

<

Todo:
should store

<

Todo:
send reply

<

Todo:
send reply upwards

Definition at line 380 of file pcicmp.c.

References _do_mask_req, _tcp_cancel(), _udp_cancel(), add_ping(), addr_mask_id, block_icmp, icmp_bogus(), icmp_redirect(), set_timeout(), and sin_mask.

◆ icmp_send_mask_req()

int icmp_send_mask_req ( void )

Definition at line 265 of file pcicmp.c.

◆ icmp_send_timexceed()

int icmp_send_timexceed | ( | const in_Header * | ip,
 |  | const void * | mac_dest
 | ) |  |

Send an "ICMP Time Exceeded" (reassebly timeout) back to 'ip->source'.

Definition at line 229 of file pcicmp.c.

References _default_ttl, _eth_formatpacket(), icmp_check(), and icmp_send().

◆ icmp_send_unreach()

int icmp_send_unreach | ( | const in_Header * | ip,
 |  | int | code
 | ) |  |

Send an ICMP destination/protocol unreachable back to 'ip->source'.

Limit the rate of these to 20 per second. Ref. RFC-1812.

Definition at line 198 of file pcicmp.c.

References _eth_formatpacket(), chk_timeout(), icmp_check(), icmp_send(), and set_timeout().

◆ W32_CLANG_PACK_WARN_DEF()

W32_CLANG_PACK_WARN_DEF ( ) const

These are the ICMP messages.

Ref. <netinet/ip_icmp.h>.

Variable Documentation

◆ icmp_exceed_str

const char* icmp_exceed_str[2]
extern

Definition at line 80 of file pcicmp.c.

◆ icmp_redirect_str

const char* icmp_redirect_str[4]
extern

Definition at line 71 of file pcicmp.c.

◆ icmp_unreach_str

const char* icmp_unreach_str[16]
extern

Definition at line 50 of file pcicmp.c.


Watt-32 tcp/ip: E:/WATT/src/pcicmp6.c File Reference

  • src
Data Structures | Functions | Variables
pcicmp6.c File Reference

Go to the source code of this file.

Data Structures

struct prefix_table

Functions

W32_CLANG_PACK_WARN_OFF () struct _pkt
W32_CLANG_PACK_WARN_DEF () static const char *icmp6_options_str[]
static void | icmp6_print (int dbg_lvl, const char *msg, const void *src)
static int | icmp6_send (in6_Header *ip, ICMP6_PKT *icmp, UINT len)
static void | router_advert (const union ICMP6_PKT *icmp, unsigned len)
static int | neighbor_advert (const eth_address *eth)
static void | echo_reply (const in6_Header *ip, const union ICMP6_PKT *icmp)
static const void * | icmp6_mac_addr (const void *ip_addr)
int | icmp6_router_solicitation (void)
BOOL | icmp6_add_gateway4 (void)
int | icmp6_neigh_solic (const void *addr, eth_address *eth)
void | icmp6_handler (const in6_Header *ip)
void | icmp6_unreach (const in6_Header *ip, int code)
struct icmp6_cache * | icmp6_ncache_lookup (const void *ip)
struct icmp6_cache * | icmp6_ncache_insert (const void *ip, const void *eth)
struct icmp6_cache * | icmp6_ncache_insert_fix (const void *ip, const void *eth)
static void | parse_options (const BYTE *opt, unsigned max)

Variables

struct prefix_table | prefix_list [10]
struct icmp6_cache | neighbor_cache [ND_CACHE_SIZE]
struct icmp6_cache | destin_cache [ND_CACHE_SIZE]
int | icmp6_prefix_len
ip6_address | icmp6_prefix
DWORD | icmp6_6to4_gateway = 0
static WORD | route_lifetime

Detailed Description

ICMP routines for IPv6 (RFC-2461/2463).

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Version

0.5 : Aug 01, 2002 : G. Vanem - created

Lot of works remains to get routing working.

Definition in file pcicmp6.c.

Function Documentation

◆ echo_reply()

static void echo_reply | ( | const in6_Header * | ip,
 |  | const union ICMP6_PKT * | icmp
 | ) |  |
static

Definition at line 517 of file pcicmp6.c.

◆ icmp6_add_gateway4()

BOOL icmp6_add_gateway4 ( void )

Definition at line 152 of file pcicmp6.c.

◆ icmp6_handler()

void icmp6_handler ( const in6_Header * ip )

Definition at line 244 of file pcicmp6.c.

◆ icmp6_mac_addr()

static const void * icmp6_mac_addr ( const void * ip_addr )
static

Definition at line 117 of file pcicmp6.c.

◆ icmp6_ncache_insert()

struct icmp6_cache * icmp6_ncache_insert | ( | const void * | ip,
 |  | const void * | eth
 | ) |  |

Definition at line 384 of file pcicmp6.c.

◆ icmp6_ncache_insert_fix()

struct icmp6_cache * icmp6_ncache_insert_fix | ( | const void * | ip,
 |  | const void * | eth
 | ) |  |

Definition at line 413 of file pcicmp6.c.

◆ icmp6_ncache_lookup()

struct icmp6_cache * icmp6_ncache_lookup ( const void * ip )

Definition at line 346 of file pcicmp6.c.

◆ icmp6_neigh_solic()

int icmp6_neigh_solic | ( | const void * | addr,
 |  | eth_address * | eth
 | ) |  |
Todo:
wait for Neighbor Advertisement

Definition at line 177 of file pcicmp6.c.

References _eth_addr, and _eth_formatpacket().

◆ icmp6_print()

static void icmp6_print | ( | int | dbg_lvl,
 |  | const char * | msg,
 |  | const void * | src
 | ) |  |
static

Definition at line 425 of file pcicmp6.c.

◆ icmp6_router_solicitation()

int icmp6_router_solicitation ( void )

Definition at line 131 of file pcicmp6.c.

◆ icmp6_send()

static int icmp6_send | ( | in6_Header * | ip,
 |  | ICMP6_PKT * | icmp,
 |  | UINT | len
 | ) |  |
static

Definition at line 441 of file pcicmp6.c.

◆ icmp6_unreach()

void icmp6_unreach | ( | const in6_Header * | ip,
 |  | int | code
 | ) |  |

Definition at line 340 of file pcicmp6.c.

◆ neighbor_advert()

static int neighbor_advert ( const eth_address * eth )
static

Definition at line 493 of file pcicmp6.c.

◆ parse_options()

static void parse_options | ( | const BYTE * | opt,
 |  | unsigned | max
 | ) |  |
static

Definition at line 449 of file pcicmp6.c.

◆ router_advert()

static void router_advert | ( | const union ICMP6_PKT * | icmp,
 |  | unsigned | len
 | ) |  |
static

Definition at line 482 of file pcicmp6.c.

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 79 of file pcicmp6.c.

Variable Documentation

◆ destin_cache

struct icmp6_cache destin_cache[ND_CACHE_SIZE]

Definition at line 73 of file pcicmp6.c.

◆ icmp6_6to4_gateway

DWORD icmp6_6to4_gateway = 0

Definition at line 77 of file pcicmp6.c.

◆ icmp6_prefix

ip6_address icmp6_prefix

Definition at line 76 of file pcicmp6.c.

◆ icmp6_prefix_len

int icmp6_prefix_len

Definition at line 75 of file pcicmp6.c.

◆ neighbor_cache

struct icmp6_cache neighbor_cache[ND_CACHE_SIZE]

Definition at line 72 of file pcicmp6.c.

◆ prefix_list

struct prefix_table prefix_list[10]

Definition at line 71 of file pcicmp6.c.

◆ route_lifetime

WORD route_lifetime
static

Definition at line 105 of file pcicmp6.c.


Watt-32 tcp/ip: E:/WATT/src/pcicmp6.h File Reference

  • src
Data Structures | Typedefs | Functions | Variables
pcicmp6.h File Reference

Go to the source code of this file.

Data Structures

struct | ICMP6_route_sol
struct | ICMP6_route_adv
struct | ICMP6_pointer
struct | ICMP6_MTU
struct | ICMP6_echo
struct | ICMP6_nd_adv
struct | ICMP6_nd_ra
struct | ICMP6_nd_sol
union | ICMP6_PKT
struct | icmp6_cache

Typedefs

typedef union ICMP6_PKT ICMP6_PKT

Functions

W32_CLANG_PACK_WARN_OFF () enum ND_cacheState
void | icmp6_handler (const in6_Header *ip)
void | icmp6_unreach (const in6_Header *ip, int code)
int | icmp6_neigh_solic (const void *addr, eth_address *eth)
int | icmp6_neighbor_advert (const eth_address *eth)
int | icmp6_router_solicitation (void)
BOOL | icmp6_add_gateway4 (void)
struct icmp6_cache * | icmp6_ncache_lookup (const void *ip)
struct icmp6_cache * | icmp6_ncache_insert (const void *ip, const void *eth)
struct icmp6_cache * | icmp6_ncache_insert_fix (const void *ip, const void *eth)

Variables

DWORD icmp6_6to4_gateway

Function Documentation

◆ icmp6_add_gateway4()

BOOL icmp6_add_gateway4 ( void )

Definition at line 152 of file pcicmp6.c.

◆ icmp6_handler()

void icmp6_handler ( const in6_Header * ip )

Definition at line 244 of file pcicmp6.c.

◆ icmp6_ncache_insert()

struct icmp6_cache * icmp6_ncache_insert | ( | const void * | ip,
 |  | const void * | eth
 | ) |  |

Definition at line 384 of file pcicmp6.c.

◆ icmp6_ncache_insert_fix()

struct icmp6_cache * icmp6_ncache_insert_fix | ( | const void * | ip,
 |  | const void * | eth
 | ) |  |

Definition at line 413 of file pcicmp6.c.

◆ icmp6_ncache_lookup()

struct icmp6_cache * icmp6_ncache_lookup ( const void * ip )

Definition at line 346 of file pcicmp6.c.

◆ icmp6_neigh_solic()

int icmp6_neigh_solic | ( | const void * | addr,
 |  | eth_address * | eth
 | ) |  |
Todo:
wait for Neighbor Advertisement

Definition at line 177 of file pcicmp6.c.

References _eth_addr, and _eth_formatpacket().

◆ icmp6_router_solicitation()

int icmp6_router_solicitation ( void )

Definition at line 131 of file pcicmp6.c.

◆ icmp6_unreach()

void icmp6_unreach | ( | const in6_Header * | ip,
 |  | int | code
 | ) |  |

Definition at line 340 of file pcicmp6.c.

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 125 of file pcicmp6.h.

Variable Documentation

◆ icmp6_6to4_gateway

DWORD icmp6_6to4_gateway
extern

Definition at line 77 of file pcicmp6.c.


Watt-32 tcp/ip: E:/WATT/src/pcigmp.c File Reference

  • src
Functions | Variables
pcigmp.c File Reference

Go to the source code of this file.

Functions

W32_CLANG_PACK_WARN_OFF () struct IGMP_PKT
W32_CLANG_PACK_WARN_DEF () static struct MultiCast mcast_list[IPMULTI_SIZE]
This hook is to prevent the BSD-socket API being linked in by default.
static void W32_CALL | check_mcast_reports (void)
static __inline BOOL | is_eth_multicast (const in_Header *ip)
int W32_CALL | multi_to_eth (DWORD ip, eth_address *mac)
int W32_CALL | join_mcast_group (DWORD ip)
int W32_CALL | leave_mcast_group (DWORD ip)
int W32_CALL | num_mcast_active (void)
void | igmp_handler (const in_Header *ip, BOOL broadcast)
static int | igmp_report (DWORD ip)

Variables

int | _multicast_on = 0
int | _multicast_intvl = 0
static BOOL | daemon_on = FALSE

Detailed Description

IP Multicasting extensions as per RFC 1112 (IGMP v1). Ref.: http://www.networksorcery.com/enp/protocol/igmp.htm

These extensions include routines to detect multicast addresses, transform Multicast IP addresses to Multicast Ethernet addresses, as well as a mechanism to join and leave multicast groups.

Jim Martin Rutgers University - RUCS-TD/NS jim@n.nosp@m.oc.r.nosp@m.utger.nosp@m.s.ed.nosp@m.u 6/6/93

Todo:
Support IGMP v3 (draft-ietf-idmr-igmp-v3-??.txt)

Definition in file pcigmp.c.

Function Documentation

◆ check_mcast_reports()

static void W32_CALL check_mcast_reports ( void )
static

Definition at line 371 of file pcigmp.c.

◆ igmp_handler()

void igmp_handler | ( | const in_Header * | ip,
 |  | BOOL | broadcast
 | ) |  |

Definition at line 256 of file pcigmp.c.

◆ igmp_report()

static int igmp_report ( DWORD ip )
static

Definition at line 338 of file pcigmp.c.

◆ is_eth_multicast()

static __inline BOOL is_eth_multicast ( const in_Header * ip )
static

Definition at line 74 of file pcigmp.c.

◆ join_mcast_group()

int W32_CALL join_mcast_group ( DWORD ip )

Definition at line 118 of file pcigmp.c.

◆ leave_mcast_group()

int W32_CALL leave_mcast_group ( DWORD ip )

Definition at line 181 of file pcigmp.c.

◆ multi_to_eth()

int W32_CALL multi_to_eth | ( | DWORD | ip,
 |  | eth_address * | mac
 | ) |  |

Definition at line 94 of file pcigmp.c.

◆ num_mcast_active()

int W32_CALL num_mcast_active ( void )

Definition at line 240 of file pcigmp.c.

◆ W32_CLANG_PACK_WARN_DEF()

W32_CLANG_PACK_WARN_DEF ( )

This hook is to prevent the BSD-socket API being linked in by default.

It is only set from the BSD functions when needed.

Definition at line 261 of file pcsed.h.

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 49 of file pcigmp.c.

Variable Documentation

◆ _multicast_intvl

int _multicast_intvl = 0

Definition at line 45 of file pcigmp.c.

◆ _multicast_on

int _multicast_on = 0

Definition at line 44 of file pcigmp.c.

◆ daemon_on

BOOL daemon_on = FALSE
static

Definition at line 67 of file pcigmp.c.


Watt-32 tcp/ip: E:/WATT/src/pcigmp.h File Reference

  • src
Data Structures | Typedefs | Functions
pcigmp.h File Reference

Go to the source code of this file.

Data Structures

struct | IGMPv0_packet
struct | IGMPv1_packet
struct | IGMPv2_packet
struct | IGMPv3_packet
struct | MultiCast
Multicast internal structure. More...

Typedefs

typedef struct IGMPv0_packet | IGMPv0_packet
typedef struct IGMPv1_packet | IGMPv1_packet
typedef struct IGMPv2_packet | IGMPv2_packet
typedef struct IGMPv3_packet | IGMPv3_packet

Functions

void igmp_handler (const in_Header *ip, BOOL brdcast)

Function Documentation

◆ igmp_handler()

void igmp_handler | ( | const in_Header * | ip,
 |  | BOOL | brdcast
 | ) |  |

Definition at line 256 of file pcigmp.c.


Watt-32 tcp/ip: E:/WATT/src/pcintr.c File Reference

  • src
Functions | Variables
pcintr.c File Reference

Go to the source code of this file.

Functions

void (W32_CALL *wintr_chain)(void)
static void | find_DOS_flags (void)
static BOOL | DOS_is_idle (void)
static void | stack_probe (void)
BOOL | wintr_enable (void)
void | wintr_disable (void)
static void | NewTimer (void)
void | wintr_shutdown (void)
void | wintr_init (void)
static void | NewTimer (int sig)
static | void (__interrupt __far *oldint)()
void | NewTimerPre (void)

Variables

static BOOL | on_isr8
static BOOL | inside_isr8 = FALSE
static WORD | indos_flag_seg
static WORD | indos_flag_ofs
static WORD | crit_err_seg
static WORD | crit_err_ofs
static void(* | old_sigalrm )(int)
static UINT | locstack [STK_SIZE]
static REALPTR | oldint
static REALPTR | timer_cb
static RMC_BLK | rmRegs
static WORD | our_ds

Detailed Description

Background network ISR poller.

Add interrupt based processing, improve performance during disk slowdowns

  • wintr_init() - call once
  • wintr_shutdown() - called automatically
  • wintr_enable() - enable interrupt based calls
  • wintr_disable() - disable interrupt based calls (default)
  • (*wintr_chain)() - a place to chain in your own calls, must live point to a function with at least a 1K stack

Definition in file pcintr.c.

Function Documentation

◆ DOS_is_idle()

static BOOL DOS_is_idle ( void )
static

Definition at line 366 of file pcintr.c.

◆ find_DOS_flags()

static void find_DOS_flags ( void )
static

Definition at line 349 of file pcintr.c.

◆ NewTimer() [1/2]

static void NewTimer ( int sig )
static

Definition at line 135 of file pcintr.c.

◆ NewTimer() [2/2]

static INTR_PROTOTYPE NewTimer ( void )
static

Definition at line 93 of file pcintr.c.

◆ stack_probe()

static void stack_probe ( void )
static

Definition at line 59 of file pcintr.c.

◆ wintr_disable()

void wintr_disable ( void )

Definition at line 84 of file pcintr.c.

◆ wintr_enable()

BOOL wintr_enable ( void )

Definition at line 77 of file pcintr.c.

◆ wintr_init()

void wintr_init ( void )

Definition at line 120 of file pcintr.c.

◆ wintr_shutdown()

void wintr_shutdown ( void )

Definition at line 110 of file pcintr.c.

Variable Documentation

◆ crit_err_ofs

WORD crit_err_ofs
static

Definition at line 47 of file pcintr.c.

◆ crit_err_seg

WORD crit_err_seg
static

Definition at line 47 of file pcintr.c.

◆ indos_flag_ofs

WORD indos_flag_ofs
static

Definition at line 46 of file pcintr.c.

◆ indos_flag_seg

WORD indos_flag_seg
static

Definition at line 46 of file pcintr.c.

◆ inside_isr8

BOOL inside_isr8 = FALSE
static

Definition at line 45 of file pcintr.c.

◆ locstack

UINT locstack[STK_SIZE]
static

Definition at line 57 of file pcintr.c.

◆ offset

DWORD offset

Definition at line 220 of file pcintr.c.

◆ old_sigalrm

void(* old_sigalrm) (int) ( int )
static

Definition at line 54 of file pcintr.c.

◆ oldint

static W32_IntrHandler oldint
static

Definition at line 90 of file pcintr.c.

◆ on_isr8

BOOL on_isr8
static

Definition at line 42 of file pcintr.c.

◆ our_ds

WORD our_ds
static

Definition at line 224 of file pcintr.c.

◆ rmRegs

RMC_BLK rmRegs
static

Definition at line 91 of file pcintr.c.

◆ selector

WORD selector

Definition at line 221 of file pcintr.c.

◆ timer_cb

REALPTR timer_cb
static

Definition at line 90 of file pcintr.c.


Watt-32 tcp/ip: E:/WATT/src/pcping.c File Reference

  • src
Data Structures | Functions | Variables
pcping.c File Reference

Go to the source code of this file.

Data Structures

struct ping_cache

Functions

int W32_CALL | _ping (DWORD host, DWORD countnum, const BYTE *pattern, size_t len)
Format and send an ICMP echo request (ping).
static int MS_CDECL | compare (const struct ping_cache *a, const struct ping_cache *b)
Compare two entries in ping-cache.
void W32_CALL | add_ping (DWORD host, DWORD time, DWORD number)
Add an ICMP echo reply to the ping-cache.
DWORD W32_CALL | _chk_ping (DWORD host, DWORD *number)
Check for ICMP echo reply in ping-cache.

Variables

static struct ping_cache pcache [10]

Detailed Description

Simple ping client.

Definition in file pcping.c.

Function Documentation

◆ _chk_ping()

DWORD W32_CALL _chk_ping | ( | DWORD | host,
 |  | DWORD * | number
 | ) |  |

Check for ICMP echo reply in ping-cache.

Return values
reply | time in system ticks.
(DWORD)-1 | on failure

Definition at line 169 of file pcping.c.

◆ _ping()

int W32_CALL _ping | ( | DWORD | host,
 |  | DWORD | countnum,
 |  | const BYTE * | pattern,
 |  | size_t | len
 | ) |  |

Format and send an ICMP echo request (ping).

  • countnum is the ICMP index value.
  • pattern optional data that will be sent.
  • len length of pattern data.
    Return values
    0 if ARP fails or error in lower layer.
    Note
    if pattern or len is 0, only an 12 byte ICMP echo header will be sent.
    Sends fragments if needed.

Definition at line 45 of file pcping.c.

References _arp_resolve(), _default_tos, _eth_formatpacket(), set_timeout(), and sin_mask.

◆ add_ping()

void W32_CALL add_ping | ( | DWORD | host,
 |  | DWORD | time,
 |  | DWORD | number
 | ) |  |

Add an ICMP echo reply to the ping-cache.

Definition at line 147 of file pcping.c.

References compare().

◆ compare()

static int MS_CDECL compare | ( | const struct ping_cache * | a,
 |  | const struct ping_cache * | b
 | ) |  |
static

Compare two entries in ping-cache.

Definition at line 138 of file pcping.c.


Watt-32 tcp/ip: E:/WATT/src/pcpkt.c File Reference

  • src
Functions | Variables
pcpkt.c File Reference

Go to the source code of this file.

Functions

static void | get_init_stats (void)
int | pkt_release_handle (WORD handle)
Release the allocated protocol handle.
int | pkt_reset_handle (WORD handle)
Reset the driver-state associated with handle.
void (__cdecl _far *pkt_enque_ptr)(BYTE _far *buf
static int | setup_rmode_callback (void)
static int | lock_code_and_data (void)
static int | unlock_code_and_data (void)
static int | find_vector (int first, int num)
static int | setup_pkt_inf (void)
static void | get_rmode_data (void *dest, unsigned size, WORD seg, WORD ofs)
Return PKTDRVR data at seg:ofs, Copy to 'dest'.
static BOOL | pkt_api_entry (IREGS *reg, unsigned line)
The API entry to the network link-driver.
const char *W32_CALL | pkt_strerror (int code)
Return textual error representing error-code.
BOOL W32_CALL | pkt_is_init (void)
static void | dump_asm4 (void)
void * | pkt_tx_buf (void)
Return address of DOS memory Tx-buffer.
static int | pkt_set_access (void)
Setup the receiver upcall handler.
static int | pkt_drvr_info (void)
Fetch the PKTDRVR information.
int | pkt_get_params (struct PktParameters *params)
Get PKTDRVR parameters (MTU, version etc.)
int | pkt_get_mtu (void)
Return PKTDRVR maximum-transmit-units (MTU).
int | pkt_get_mac_len (void)
Return length of MAC address.
int | pkt_get_api_ver (WORD *ver)
Return version of spec.
int | pkt_get_drvr_ver (WORD *major, WORD *minor, WORD *unused1, WORD *unused2)
Return version of PKTDRVR.
W32_FUNC int W32_CALL | pkt_get_vector (void)
Return PKTDRVR vector.
W32_FUNC WORD W32_CALL | pkt_get_drvr_class (void)
const char *W32_CALL | pkt_get_device_name (void)
static int | pkt16_drvr_init (mac_address *mac_addr)
Called from pkt_eth_init() to search for PKTDRVR.
static void | release_callback (void)
static void | release_real_mem (void)
Release allocated DOS memory.
int DTOR | pkt_release (void)
static void | pkt_enqueue (unsigned rxBuf, WORD rxLen) static void __cdecl _far pkt_enqueue(BYTE _far *rxBuf
Enqueue a received packet into '_pkt_inf->pkt_queue'.
if (index >=q->num_buf) index=0
if (index !=q->out_index)
static void cdecl | pkt_receiver_pm (SWI_REGS *r)
static void cdecl | pkt_receiver_pm (__dpmi_regs *r)
static void cdecl | pkt_receiver_pm (void)
void | _pkt_end (void)
int | pkt_send (const void *tx, int length)
Send a link-layer frame.
int | pkt_get_addr (mac_address *mac)
Return the MAC address.
int | pkt_set_addr (const void *addr)
Set a new MAC source address.
int | pkt_get_stats (struct PktStats *stats, struct PktStats *total)
Get PKTDRVR statistics.
int | pkt_get_vjstats (struct slcompress *vjstats)
int | pkt_get_cstate (struct cstate *cs, WORD cstate_ofs)
int | pkt_buf_wipe (void)
Clear the receive queue.
void | pkt_free_pkt (const void *pkt)
Release a packet from the receive queue.
int | pkt_waiting (void)
Return number of packets waiting in queue.
DWORD | pkt_dropped (void)
Return number of packets dropped.
static int | parse_config_pass_1 (void)
Search WATTCP.CFG file for "PKT.VECTOR = 0x??" etc.
int | pkt_eth_init (mac_address *addr)
Initialise Packet driver interface.
static BOOL | check_intr_num (WORD intr_num)
Check a single interrupt vector for signature string "PKT DRVR" at offset 3 into intr-handler.
static void | _unlock (const void *addr, DWORD size)
int | pkt_set_rcv_mode (int mode)
Sets the receive mode of the interface.
int | pkt_get_rcv_mode (void)
Gets the receive mode of the interface (can never be mode 0).
int | pkt_get_multicast_list (mac_address *listbuf, int *lenp)
Gets the current list of multicast addresses from the PKTDRVR.
int | pkt_set_multicast_list (const void *listbuf, int len)
Sets the list of multicast addresses for which the PKTDRVR is responsible.

Variables

WORD | _pktdevclass = PDCLASS_UNKNOWN
Ethernet, Token, FDDI etc.
WORD | _pkt_ip_ofs = 0
ofs from link-layer head to ip

WORD | _pkt_type_ofs = 0
ofs from link-layer head to type
BOOL | _pktserial = FALSE
using serial driver, SLIP/PPP

BYTE | _pktdevlevel = 1
basic unless otherwise specified
int | _pkt_rxmode = RXMODE_BROADCAST
active receive mode

int | _pkt_rxmode0 = -1
startup receive mode

int | _pkt_errno = 0
error code set in pcpkt.c API

const char * | pkt_error = NULL
Last pkt error string

int | _pkt_forced_rxmode = -1
char | _pktdrvrname [20] = "unknown"
struct pkt_info * | _pkt_inf = NULL
module data that will be locked
static char | pkt_sign [] = "PKT DRVR"
static WORD | pkt_interrupt = 0
static DWORD | pkt_drop_cnt = 0
static BYTE | pkt_txretries = 2
static int | pkt_txwait = 0
static BOOL | pkt_use_near = FALSE
static BOOL | pkt_do_reset = FALSE
static int | pkt_drvr_ver = 0
static int | pkt_num_rx_bufs = RX_BUFS
static struct PktStats | init_stats
static struct PktParameters | pkt_params
static BOOL | got_params = FALSE
REALPTR | rm_base
static _go32_dpmi_seginfo | rm_cb
static WORD | pkt_inf_sel
WORD | len
static void WORD | rxLen
int | index = q->in_index + 1
else q | num_drop
static WORD | cstate_dseg = 0
Get VJ-compression statistics from pkt-driver.

Detailed Description

Packet Driver interface for WatTCP/Watt-32.

Heavily modified and extended for DOSX by G.Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Definition in file pcpkt.c.

Function Documentation

◆ _pkt_end()

void _pkt_end ( void )

Definition at line 1068 of file pcpkt.c.

◆ _unlock()

static void _unlock | ( | const void * | addr,
 |  | DWORD | size
 | ) |  |
static

Definition at line 1681 of file pcpkt.c.

◆ check_intr_num()

static BOOL check_intr_num ( WORD intr_num )
static

Check a single interrupt vector for signature string "PKT DRVR" at offset 3 into intr-handler.

Definition at line 1506 of file pcpkt.c.

◆ dump_asm4()

static void dump_asm4 ( void )
static

Definition at line 266 of file pcpkt.c.

◆ find_vector()

static int find_vector | ( | int | first,
 |  | int | num
 | ) |  |
static

Definition at line 1583 of file pcpkt.c.

◆ get_init_stats()

static void get_init_stats ( void )
static

Definition at line 1275 of file pcpkt.c.

◆ get_rmode_data()

static void get_rmode_data | ( | void * | dest,
 |  | unsigned | size,
 |  | WORD | seg,
 |  | WORD | ofs
 | ) |  |
static

Return PKTDRVR data at seg:ofs, Copy to 'dest'.

Definition at line 1868 of file pcpkt.c.

◆ if()

if ( index ! = q->out_index )

Definition at line 928 of file pcpkt.c.

◆ lock_code_and_data()

static int lock_code_and_data ( void )
static

Definition at line 1612 of file pcpkt.c.

◆ parse_config_pass_1()

static int parse_config_pass_1 ( void )
static

Search WATTCP.CFG file for "PKT.VECTOR = 0x??" etc.

Accept "0x20 - 0xFF".

Definition at line 1407 of file pcpkt.c.

References ARG_ATOB, ARG_ATOI, and ARG_ATOX_B.

◆ pkt16_drvr_init()

static int pkt16_drvr_init ( mac_address * mac_addr )
static

Called from pkt_eth_init() to search for PKTDRVR.

  • Checks register struct size (for non-DOSX targets).
  • Searches for the PKTDRVR interrupt.
  • Allocates '_pkt_inf' structure.
  • Sets up a real-mode callback and lock code/data (DOSX targets).
  • Fetches PKTDRVR information.
  • Sets up driver to call our real-mode callback.
  • Fetches local MAC address.
  • Fetches parameters and initialise statistics.

Definition at line 577 of file pcpkt.c.

References _pkt_errno, _pkt_rxmode, _pkt_rxmode0, _pktdevlevel, _pktserial, pkt_drvr_info(), pkt_get_addr(), pkt_get_params(), pkt_get_rcv_mode(), pkt_release(), pkt_set_access(), pkt_set_rcv_mode(), pkt_strerror(), RXMODE_PROMISCOUS, and setup_pkt_inf().

◆ pkt_api_entry()

static BOOL pkt_api_entry | ( | IREGS * | reg,
 |  | unsigned | line
 | ) |  |
static

The API entry to the network link-driver.

Use either protected mode interface via a call to dynamically loaded module (not yet) or issue an interrupt for the real-mode PKTDRVR.

Returns TRUE if CARRY is clear, otherwise set '_pkt_errno' from DH register and return FALSE.

Todo:
Use 32-bit API; accessing card via pmode driver

Definition at line 1895 of file pcpkt.c.

References _pkt_errno.

◆ pkt_buf_wipe()

int pkt_buf_wipe ( void )

Clear the receive queue.

Definition at line 1331 of file pcpkt.c.

References _pkt_inf.

◆ pkt_dropped()

DWORD pkt_dropped ( void )

Return number of packets dropped.

Definition at line 1391 of file pcpkt.c.

References _pkt_inf, and pkt_ringbuf::num_drop.

◆ pkt_drvr_info()

static int pkt_drvr_info ( void )
static

Fetch the PKTDRVR information.

Device level, class and name.

Definition at line 381 of file pcpkt.c.

References _pkt_errno, _pkt_inf, _pkt_ip_ofs, _pkt_type_ofs, _pktdevclass, _pktdevlevel, _pktserial, and get_rmode_data().

◆ pkt_enqueue()

static void pkt_enqueue | ( | unsigned | rxBuf,
 |  | WORD | rxLen
 | ) |  |
static

Enqueue a received packet into '_pkt_inf->pkt_queue'.

This routine is called from pkt_receiver_rm/_pm(). The packet has been copied to rx_buffer (in DOS memory) by the packet-driver. We now must copy it to correct queue. Interrupts are disabled on entry.

Note 1: For real-mode targets SS and SP have been setup to a small work stack in asmpkt.asm (SS = CS). The stack can only take 64 pushes, hence use few local variables here.

Note 2: The C-compiler must be told NOT to use register calling for this routine (MUST use __cdecl) because it's called from asmpkt.asm via ‘pkt_enque_ptr’ function pointer.

Note 3: Watcom/DOS4GW targets doesn't use real->prot mode upcall (RMCB), but does the following in asmpkt4.asm instead.

Note 4: For DOSX targets, all code from pkt_enqueue() down to _pkt_end() must be locked in memory.

HACK: For real-mode targets this routine is called via the ‘pkt_enque_ptr’ function pointer. This was the only way I could avoid a fixup error for small-model programs.

References _pkt_inf, pkt_ringbuf::buf_size, pkt_ringbuf::buf_start, pkt_ringbuf::in_index, pkt_ringbuf::num_buf, pkt_ringbuf::num_drop, and pkt_ringbuf::out_index.

◆ pkt_eth_init()

int pkt_eth_init ( mac_address * addr )

Initialise Packet driver interface.

First determine vector to use; if WATTCP.CFG specifies a "PKT.VECTOR = 0xNN", use that vector, else search for PKTDRVR between PKT_FIRST_VEC and PKT_LAST_VEC (0x60 - 0x80). If the driver is outside this range, user must specify one with "PKT.VECTOR = 0x??".

If DOSX, probe and initialise protected-mode driver (not operational). Call pkt16_drvr_init() to initialise API.

Definition at line 1446 of file pcpkt.c.

References _pkt_inf, _watt_no_config, parse_config_pass_1(), pkt16_drvr_init(), and pkt_release().

◆ pkt_free_pkt()

void pkt_free_pkt ( const void * pkt )

Release a packet from the receive queue.

If USE_FAST_PKT, pkt has already been free'd. Just update drop count.

Definition at line 1346 of file pcpkt.c.

References _pkt_inf, _pkt_ip_ofs, and pkt_ringbuf::num_drop.

◆ pkt_get_addr()

int pkt_get_addr ( mac_address * mac )

Return the MAC address.

Definition at line 1156 of file pcpkt.c.

References _pkt_errno, _pkt_inf, and get_rmode_data().

◆ pkt_get_api_ver()

int pkt_get_api_ver ( WORD * ver )

Return version of spec.

this PKTDRVR conforms to.

Return values
-1 on error. Return major version in upper 8 bit, minor in lower.

Definition at line 518 of file pcpkt.c.

◆ pkt_get_cstate()

int pkt_get_cstate | ( | struct cstate * | cs,
 |  | WORD | cstate_ofs
 | ) |  |

Definition at line 1315 of file pcpkt.c.

◆ pkt_get_device_name()

const char *W32_CALL pkt_get_device_name ( void )

Definition at line 561 of file pcpkt.c.

◆ pkt_get_drvr_class()

W32_FUNC WORD W32_CALL pkt_get_drvr_class ( void )

Definition at line 553 of file pcpkt.c.

◆ pkt_get_drvr_ver()

int pkt_get_drvr_ver | ( | WORD * | major,
 |  | WORD * | minor,
 |  | WORD * | unused1,
 |  | WORD * | unused2
 | ) |  |

Return version of PKTDRVR.

Definition at line 531 of file pcpkt.c.

◆ pkt_get_mac_len()

int pkt_get_mac_len ( void )

Return length of MAC address.

Return values
6 For Ethernet.

Definition at line 503 of file pcpkt.c.

References _pktdevclass.

◆ pkt_get_mtu()

int pkt_get_mtu ( void )

Return PKTDRVR maximum-transmit-units (MTU).

Note
This includes length of MAC-header.

Definition at line 488 of file pcpkt.c.

References _pktdevclass.

◆ pkt_get_multicast_list()

int pkt_get_multicast_list | ( | mac_address * | listbuf,
 |  | int * | lenp
 | ) |  |

Gets the current list of multicast addresses from the PKTDRVR.

  • listbuf is the buffer into which the list is placed
  • len on input: length of listbuf on output: length of list returned
Return values
0 | upon error - _pkt_errno is set
1 | if retrieval was successful,

Definition at line 2035 of file pcpkt.c.

References _pkt_errno, _pktdevlevel, _pktserial, and get_rmode_data().

◆ pkt_get_params()

int pkt_get_params ( struct PktParameters * params )

Get PKTDRVR parameters (MTU, version etc.)

Definition at line 465 of file pcpkt.c.

References get_rmode_data().

◆ pkt_get_rcv_mode()

int pkt_get_rcv_mode ( void )

Gets the receive mode of the interface (can never be mode 0).

Return values
!0 | Okay - _pkt_errno is 0, _pkt_rxmode and retval is current mode.
0 | Error - _pkt_errno is set.

_pkt_rxmode is one of the following modes: (upon successful return)

  • 1 - turn off receiver
  • 2 - receive only packets sent to this interface
  • 3 - mode 2 plus broadcast packets (default)
  • 4 - mode 3 plus limited multicast packets
  • 5 - mode 3 plus all multicast packets
  • 6 - all packets (a.k.a promiscuous mode)

Definition at line 1997 of file pcpkt.c.

References _pkt_errno, _pkt_inf, _pkt_rxmode, _pktdevlevel, and _pktserial.

◆ pkt_get_stats()

int pkt_get_stats | ( | struct PktStats * | stats,
 |  | struct PktStats * | total
 | ) |  |

Get PKTDRVR statistics.

Return both 'stats' for current session and 'total' statistics since driver loaded.

Definition at line 1240 of file pcpkt.c.

References _pkt_inf, and get_rmode_data().

◆ pkt_get_vector()

W32_FUNC int W32_CALL pkt_get_vector ( void )

Return PKTDRVR vector.

Definition at line 545 of file pcpkt.c.

◆ pkt_get_vjstats()

int pkt_get_vjstats ( struct slcompress * vjstats )

Definition at line 1296 of file pcpkt.c.

◆ pkt_is_init()

BOOL W32_CALL pkt_is_init ( void )

Definition at line 257 of file pcpkt.c.

◆ pkt_receiver_pm() [1/3]

static void cdecl pkt_receiver_pm ( __dpmi_regs * r )
static

Definition at line 1006 of file pcpkt.c.

◆ pkt_receiver_pm() [2/3]

static void cdecl pkt_receiver_pm ( SWI_REGS * r )
static

Definition at line 981 of file pcpkt.c.

◆ pkt_receiver_pm() [3/3]

static void cdecl pkt_receiver_pm ( void )
static

Definition at line 1040 of file pcpkt.c.

◆ pkt_release()

int DTOR pkt_release ( void )
Todo:
We might be called between 1st and 2nd packet-driver upcall. Need to wait for 2nd upcall to finish or else freeing the RMCB too early could cause a crash or a stuck PKTDRVR.

Definition at line 837 of file pcpkt.c.

References _pkt_inf, _watt_fatal_error, pkt_release_handle(), pkt_reset_handle(), and release_real_mem().

◆ pkt_release_handle()

int pkt_release_handle ( WORD handle )

Release the allocated protocol handle.

Definition at line 710 of file pcpkt.c.

References _pkt_errno, and _watt_fatal_error.

◆ pkt_reset_handle()

int pkt_reset_handle ( WORD handle )

Reset the driver-state associated with handle.

Definition at line 726 of file pcpkt.c.

References _pkt_errno.

◆ pkt_send()

int pkt_send | ( | const void * | tx,
 |  | int | length
 | ) |  |

Send a link-layer frame.

For PPP/SLIP 'tx' contains no MAC-header. For EtherNet, Token-Ring, ARCNET and FDDI, 'tx' contains the complete frame.

Todo:
Change this so that we doesn't retry if the driver was stuck for "too long". I've seen drivers using approx. 100 msec on each iteration below. Retrying if the driver is stuck is not worth the time.

Definition at line 1087 of file pcpkt.c.

References _pkt_inf, pkt_tx_buf(), and Wait().

◆ pkt_set_access()

static int pkt_set_access ( void )
static

Setup the receiver upcall handler.

The handler is called for all packets matching current receive mode. In mode 3 all broadcast and directed packets.

Definition at line 331 of file pcpkt.c.

References _pkt_errno, _pkt_inf, and _pktdevclass.

◆ pkt_set_addr()

int pkt_set_addr ( const void * addr )

Set a new MAC source address.

Definition at line 1195 of file pcpkt.c.

◆ pkt_set_multicast_list()

int pkt_set_multicast_list | ( | const void * | listbuf,
 |  | int | len
 | ) |  |

Sets the list of multicast addresses for which the PKTDRVR is responsible.

  • listbuf is the buffer containing the list
  • len is the length of listbuf
Return values
0 | upon error - _pkt_errno is set
1 | if set was successful

Definition at line 2082 of file pcpkt.c.

References _pkt_errno, _pktdevlevel, and _pktserial.

◆ pkt_set_rcv_mode()

int pkt_set_rcv_mode ( int mode )

Sets the receive mode of the interface.

mode is one of the following modes:

  • 1 - turn off receiver
  • 2 - receive only packets sent to this interface
  • 3 - mode 2 plus broadcast packets (default)
  • 4 - mode 3 plus limited multicast packets
  • 5 - mode 3 plus all multicast packets
  • 6 - all packets (AKA promiscuous mode)
Return values
0 | - upon error - _pkt_errno is set
1 | - if the mode was set successfully

Definition at line 1953 of file pcpkt.c.

References _pkt_errno, _pkt_inf, _pkt_rxmode, _pktdevlevel, and _pktserial.

◆ pkt_strerror()

const char *W32_CALL pkt_strerror ( int code )

Return textual error representing error-code.

Definition at line 216 of file pcpkt.c.

References _strlcpy().

◆ pkt_tx_buf()

void * pkt_tx_buf ( void )

Return address of DOS memory Tx-buffer.

For DOS4GW/X32VM (and djgpp with near-ptrs) targets, return near address of transmit buffer located in DOS memory.

Definition at line 302 of file pcpkt.c.

◆ pkt_waiting()

int pkt_waiting ( void )

Return number of packets waiting in queue.

Definition at line 1375 of file pcpkt.c.

References _pkt_inf.

◆ release_callback()

static void release_callback ( void )
static

Definition at line 740 of file pcpkt.c.

◆ release_real_mem()

static void release_real_mem ( void )
static

Release allocated DOS memory.

Definition at line 765 of file pcpkt.c.

References _pkt_inf, and _watt_fatal_error.

◆ setup_pkt_inf()

static int setup_pkt_inf ( void )
static
Todo:
Make dynamic allocation based on 'pkt_num_rx_bufs'. Allocate multiple 64kB blocks if needed (would involve messy 16-bit coding in asmpkt.nas).

Definition at line 1801 of file pcpkt.c.

References _pkt_inf, and pkt_ringbuf::dos_ofs.

◆ setup_rmode_callback()

static int setup_rmode_callback ( void )
static

Definition at line 1603 of file pcpkt.c.

◆ unlock_code_and_data()

static int unlock_code_and_data ( void )
static

Definition at line 1627 of file pcpkt.c.

Variable Documentation

◆ _pkt_errno

int _pkt_errno = 0

error code set in pcpkt.c API

Definition at line 55 of file pcpkt.c.

◆ _pkt_forced_rxmode

int _pkt_forced_rxmode = -1

Definition at line 58 of file pcpkt.c.

◆ _pkt_inf

struct pkt_info* _pkt_inf = NULL

module data that will be locked

Definition at line 61 of file pcpkt.c.

◆ _pkt_ip_ofs

WORD _pkt_ip_ofs = 0

ofs from link-layer head to ip

Definition at line 49 of file pcpkt.c.

◆ _pkt_rxmode

int _pkt_rxmode = RXMODE_BROADCAST

active receive mode

Definition at line 53 of file pcpkt.c.

◆ _pkt_rxmode0

int _pkt_rxmode0 = -1

startup receive mode

Definition at line 54 of file pcpkt.c.

◆ _pkt_type_ofs

WORD _pkt_type_ofs = 0

ofs from link-layer head to type

Definition at line 50 of file pcpkt.c.

◆ _pktdevclass

WORD _pktdevclass = PDCLASS_UNKNOWN

Ethernet, Token, FDDI etc.

Definition at line 48 of file pcpkt.c.

◆ _pktdevlevel

BYTE _pktdevlevel = 1

basic unless otherwise specified

Definition at line 52 of file pcpkt.c.

◆ _pktdrvrname

char _pktdrvrname[20] = "unknown"

Definition at line 59 of file pcpkt.c.

◆ _pktserial

BOOL _pktserial = FALSE

using serial driver, SLIP/PPP

Definition at line 51 of file pcpkt.c.

◆ cstate_dseg

WORD cstate_dseg = 0
static

Get VJ-compression statistics from pkt-driver.

Only DOS-PPP ver 0.6+ supports the PD_GET_VJSTATS (0x81) call.

Definition at line 1294 of file pcpkt.c.

◆ got_params

BOOL got_params = FALSE
static

Definition at line 79 of file pcpkt.c.

◆ index

index = q->in_index + 1

Definition at line 919 of file pcpkt.c.

◆ init_stats

struct PktStats init_stats
static

Definition at line 74 of file pcpkt.c.

◆ len

int len

Definition at line 182 of file pcpkt.c.

◆ num_drop

else q num_drop

Definition at line 959 of file pcpkt.c.

◆ pkt_do_reset

BOOL pkt_do_reset = FALSE
static

Definition at line 69 of file pcpkt.c.

◆ pkt_drop_cnt

DWORD pkt_drop_cnt = 0
static

Definition at line 65 of file pcpkt.c.

◆ pkt_drvr_ver

int pkt_drvr_ver = 0
static

Definition at line 70 of file pcpkt.c.

◆ pkt_error

const char* pkt_error = NULL

Last pkt error string

Definition at line 56 of file pcpkt.c.

◆ pkt_inf_sel

WORD pkt_inf_sel
static

Definition at line 145 of file pcpkt.c.

◆ pkt_interrupt

WORD pkt_interrupt = 0
static

Definition at line 64 of file pcpkt.c.

◆ pkt_num_rx_bufs

int pkt_num_rx_bufs = RX_BUFS
static

Definition at line 71 of file pcpkt.c.

◆ pkt_params

struct PktParameters pkt_params
static

Definition at line 78 of file pcpkt.c.

◆ pkt_sign

char pkt_sign[] = "PKT DRVR"
static

Definition at line 63 of file pcpkt.c.

◆ pkt_txretries

BYTE pkt_txretries = 2
static

Definition at line 66 of file pcpkt.c.

◆ pkt_txwait

int pkt_txwait = 0
static

Definition at line 67 of file pcpkt.c.

◆ pkt_use_near

BOOL pkt_use_near = FALSE
static

Definition at line 68 of file pcpkt.c.

◆ rm_base

static REALPTR rm_base

Definition at line 97 of file pcpkt.c.

◆ rm_cb

static DPMI_callback rm_cb
static

Definition at line 124 of file pcpkt.c.

◆ rxLen

void WORD rxLen
Initial value:
{
struct pkt_ringbuf *q = &_pkt_inf->pkt_queue
_pkt_inf
struct pkt_info * _pkt_inf
module data that will be locked
Definition: pcpkt.c:61
pkt_ringbuf
FIFO style ring-buffer.
Definition: pcqueue.h:81

Definition at line 915 of file pcpkt.c.


Watt-32 tcp/ip: E:/WATT/src/pcpkt.h File Reference

  • src
Data Structures | Enumerations | Functions | Variables
pcpkt.h File Reference

Go to the source code of this file.

Data Structures

struct | cstate
struct | slcompress
struct | async_iocb
struct | pkt_info
Placeholder for vital data accessed by capture thread. More...

Enumerations

enum ReceiveModes {
RXMODE_OFF = 1 ,
RXMODE_DIRECT = 2 ,
RXMODE_BROADCAST = 3 ,
RXMODE_MULTICAST1 = 4 ,
RXMODE_MULTICAST2 = 5 ,
RXMODE_PROMISCOUS = 6 ,
RXMODE_OFF = 0x00 ,
RXMODE_DIRECT = 0x01 ,
RXMODE_MULTICAST1 = 0x02 ,
RXMODE_MULTICAST2 = 0x04 ,
RXMODE_BROADCAST = 0x08 ,
RXMODE_PROMISCOUS = 0x20 ,
RXMODE_ALL_LOCAL = 0x80
}

Functions

int | pkt_get_multicast_list (mac_address *listbuf, int *len)
Gets the current list of multicast addresses from the PKTDRVR.
int | pkt_set_multicast_list (const void *listbuf, int len)
Sets the list of multicast addresses for which the PKTDRVR is responsible.
int | pkt_get_vjstats (struct slcompress *vjstats)
int | pkt_get_cstate (struct cstate *cs, WORD cstate_ofs)
void * | pkt_tx_buf (void)
Return address of DOS memory Tx-buffer.
DWORD | pkt_rx_dropped (void)
int | pkt_test_reordering (void)
int | pkt_append_recv (const void *tx, unsigned len)
int | pkt_buffers_used (void)
int | pkt_test_upcall (void)
void | pkt_dump_real_mem (void)
struct pkt_rx_element * | pkt_poll_recv (void)
void | __dj_movedata (void)
void | __movedata (unsigned src_sel, unsigned src_ofs, unsigned dst_sel, unsigned dst_ofs, size_t bytes)

Variables

W32_DATA WORD | _pktdevclass
Driver class; <tcp.h> for values.
W32_DATA WORD | _pkt_ip_ofs
Offset from MAC-header to IP-header.
W32_DATA BOOL | _pktserial
Driver is a serial (SLIP/PPP) driver.
W32_DATA char | _pktdrvrname []
Name of PKDRVR.
W32_DATA int | _pkt_rxmode
Current PKTDRVR/WinPcap Rx-mode.
W32_DATA int | _pkt_rxmode0
Startup receive mode.
W32_DATA int | _pkt_forced_rxmode
Forced Rx-mode via WATTCP.CFG.
W32_DATA int | _pkt_errno
Last PKTDRVR error code.
W32_DATA BYTE | _pktdevlevel
Device level.
struct pkt_info * | _pkt_inf
module data that will be locked

Enumeration Type Documentation

◆ ReceiveModes

enum ReceiveModes
Enumerator
RXMODE_OFF | turn off receiver
RXMODE_DIRECT | receive only to this interface
RXMODE_BROADCAST | DIRECT + broadcast packets
RXMODE_MULTICAST1 | BROADCAST + limited multicast
RXMODE_MULTICAST2 | BROADCAST + all multicast
RXMODE_PROMISCOUS | receive all packets on network
RXMODE_OFF | possible to turn off?
RXMODE_DIRECT | NDIS_PACKET_TYPE_DIRECTED.
RXMODE_MULTICAST1 | NDIS_PACKET_TYPE_MULTICAST.
RXMODE_MULTICAST2 | NDIS_PACKET_TYPE_ALL_MULTICAST.
RXMODE_BROADCAST | NDIS_PACKET_TYPE_BROADCAST.
RXMODE_PROMISCOUS | NDIS_PACKET_TYPE_PROMISCUOUS.
RXMODE_ALL_LOCAL | NDIS_PACKET_TYPE_ALL_LOCAL (direct+bc+mc1)

Definition at line 108 of file pcpkt.h.

Function Documentation

◆ pkt_get_cstate()

int pkt_get_cstate | ( | struct cstate * | cs,
 |  | WORD | cstate_ofs
 | ) |  |

Definition at line 1315 of file pcpkt.c.

◆ pkt_get_multicast_list()

int pkt_get_multicast_list | ( | mac_address * | listbuf,
 |  | int * | lenp
 | ) |  |

Gets the current list of multicast addresses from the PKTDRVR.

  • listbuf is the buffer into which the list is placed
  • len on input: length of listbuf on output: length of list returned
Return values
0 | upon error - _pkt_errno is set
1 | if retrieval was successful,

Definition at line 2035 of file pcpkt.c.

◆ pkt_get_vjstats()

int pkt_get_vjstats ( struct slcompress * vjstats )

Definition at line 1296 of file pcpkt.c.

◆ pkt_poll_recv()

struct pkt_rx_element * pkt_poll_recv ( void )

Definition at line 924 of file winpkt.c.

◆ pkt_set_multicast_list()

int pkt_set_multicast_list | ( | const void * | listbuf,
 |  | int | len
 | ) |  |

Sets the list of multicast addresses for which the PKTDRVR is responsible.

  • listbuf is the buffer containing the list
  • len is the length of listbuf
Return values
0 | upon error - _pkt_errno is set
1 | if set was successful

Definition at line 2082 of file pcpkt.c.

◆ pkt_tx_buf()

void * pkt_tx_buf ( void )

Return address of DOS memory Tx-buffer.

For DOS4GW/X32VM (and djgpp with near-ptrs) targets, return near address of transmit buffer located in DOS memory.

Definition at line 302 of file pcpkt.c.

Variable Documentation

◆ _pkt_errno

W32_DATA int _pkt_errno

Last PKTDRVR error code.

Definition at line 47 of file pcpkt.h.

◆ _pkt_forced_rxmode

W32_DATA int _pkt_forced_rxmode

Forced Rx-mode via WATTCP.CFG.

Definition at line 46 of file pcpkt.h.

◆ _pkt_inf

struct pkt_info* _pkt_inf
extern

module data that will be locked

Definition at line 61 of file pcpkt.c.

◆ _pkt_ip_ofs

W32_DATA WORD _pkt_ip_ofs

Offset from MAC-header to IP-header.

Definition at line 41 of file pcpkt.h.

◆ _pkt_rxmode

W32_DATA int _pkt_rxmode

Current PKTDRVR/WinPcap Rx-mode.

Definition at line 44 of file pcpkt.h.

◆ _pkt_rxmode0

W32_DATA int _pkt_rxmode0

Startup receive mode.

Definition at line 45 of file pcpkt.h.

◆ _pktdevclass

W32_DATA WORD _pktdevclass

Driver class; <tcp.h> for values.

Definition at line 40 of file pcpkt.h.

◆ _pktdevlevel

W32_DATA BYTE _pktdevlevel

Device level.

Definition at line 117 of file pcpkt.h.

◆ _pktdrvrname

W32_DATA char _pktdrvrname[]

Name of PKDRVR.

Definition at line 43 of file pcpkt.h.

◆ _pktserial

W32_DATA BOOL _pktserial

Driver is a serial (SLIP/PPP) driver.

Definition at line 42 of file pcpkt.h.


Watt-32 tcp/ip: E:/WATT/src/winpkt.h File Reference

  • src
Data Structures | Typedefs | Enumerations | Functions | Variables
winpkt.h File Reference

Go to the source code of this file.

Data Structures

struct pkt_info
Placeholder for vital data accessed by capture thread. More...

Typedefs

typedef BOOL(* | func_init) (void)
typedef void *(* | func_open) (const char *name,...)
typedef BOOL(* | func_close) (void *a)
typedef UINT(* | func_send) (const void *a, const void *buf, UINT buf_len)
typedef BOOL(* | func_get_mac) (const void *a, const void *mac)
typedef BOOL(* | func_get_stats) (const void *a, struct PktStats *stats, struct PktStats *total)
typedef BOOL(* | func_get_if_stat) (const void *a, BOOL *up)
typedef BOOL(* | func_get_if_type) (const void *a, WORD *type)
typedef BOOL(* | func_get_if_mtu) (const void *a, DWORD *Mbit_s)
typedef BOOL(* | func_get_if_speed) (const void *a, DWORD *Mbit_s)
typedef BOOL(* | func_get_descr) (const void *a, char *descr, size_t max)
typedef const char *(* | func_get_drv_ver) (void)
typedef UINT(MS_CDECL * | func_recv) (const void *a, void *buf, UINT buf_len)

Enumerations

enum ReceiveModes {
RXMODE_OFF = 1 ,
RXMODE_DIRECT = 2 ,
RXMODE_BROADCAST = 3 ,
RXMODE_MULTICAST1 = 4 ,
RXMODE_MULTICAST2 = 5 ,
RXMODE_PROMISCOUS = 6 ,
RXMODE_OFF = 0x00 ,
RXMODE_DIRECT = 0x01 ,
RXMODE_MULTICAST1 = 0x02 ,
RXMODE_MULTICAST2 = 0x04 ,
RXMODE_BROADCAST = 0x08 ,
RXMODE_PROMISCOUS = 0x20 ,
RXMODE_ALL_LOCAL = 0x80
}

Functions

struct pkt_rx_element * | pkt_poll_recv (void)
int | pkt_get_multicast_list (mac_address *listbuf, int *len)
Gets the current list of multicast addresses from the PKTDRVR.
int | pkt_set_multicast_list (const void *listbuf, int len)
Sets the list of multicast addresses for which the PKTDRVR is responsible.
void | winpkt_trace (_Printf_format_string_ const char *fmt,...) W32_ATTR_PRINTF(1
void void | winpkt_trace_fclose (void)

Variables

char | _pktdrvr_descr []
struct pkt_info * | _pkt_inf
module data that will be locked
const char * | winpkt_trace_func
const char * | winpkt_trace_file
UINT | winpkt_trace_line
UINT | winpkt_trace_level

Detailed Description

Only included on Win32

Definition in file winpkt.h.

Typedef Documentation

◆ func_close

typedef BOOL(* func_close) (void *a)

Definition at line 47 of file winpkt.h.

◆ func_get_descr

typedef BOOL(* func_get_descr) (const void *a, char *descr, size_t max)

Definition at line 55 of file winpkt.h.

◆ func_get_drv_ver

typedef const char *(* func_get_drv_ver) (void)

Definition at line 56 of file winpkt.h.

◆ func_get_if_mtu

typedef BOOL(* func_get_if_mtu) (const void *a, DWORD *Mbit_s)

Definition at line 53 of file winpkt.h.

◆ func_get_if_speed

typedef BOOL(* func_get_if_speed) (const void *a, DWORD *Mbit_s)

Definition at line 54 of file winpkt.h.

◆ func_get_if_stat

typedef BOOL(* func_get_if_stat) (const void *a, BOOL *up)

Definition at line 51 of file winpkt.h.

◆ func_get_if_type

typedef BOOL(* func_get_if_type) (const void *a, WORD *type)

Definition at line 52 of file winpkt.h.

◆ func_get_mac

typedef BOOL(* func_get_mac) (const void *a, const void *mac)

Definition at line 49 of file winpkt.h.

◆ func_get_stats

typedef BOOL(* func_get_stats) (const void *a, struct PktStats *stats, struct PktStats *total)

Definition at line 50 of file winpkt.h.

◆ func_init

typedef BOOL(* func_init) (void)

Definition at line 45 of file winpkt.h.

◆ func_open

typedef void *(* func_open) (const char *name,...)

Definition at line 46 of file winpkt.h.

◆ func_recv

typedef UINT(MS_CDECL * func_recv) (const void *a, void *buf, UINT buf_len)

Definition at line 63 of file winpkt.h.

◆ func_send

typedef UINT(* func_send) (const void *a, const void *buf, UINT buf_len)

Definition at line 48 of file winpkt.h.

Enumeration Type Documentation

◆ ReceiveModes

enum ReceiveModes
Enumerator
RXMODE_OFF | turn off receiver
RXMODE_DIRECT | receive only to this interface
RXMODE_BROADCAST | DIRECT + broadcast packets
RXMODE_MULTICAST1 | BROADCAST + limited multicast
RXMODE_MULTICAST2 | BROADCAST + all multicast
RXMODE_PROMISCOUS | receive all packets on network
RXMODE_OFF | possible to turn off?
RXMODE_DIRECT | NDIS_PACKET_TYPE_DIRECTED.
RXMODE_MULTICAST1 | NDIS_PACKET_TYPE_MULTICAST.
RXMODE_MULTICAST2 | NDIS_PACKET_TYPE_ALL_MULTICAST.
RXMODE_BROADCAST | NDIS_PACKET_TYPE_BROADCAST.
RXMODE_PROMISCOUS | NDIS_PACKET_TYPE_PROMISCUOUS.
RXMODE_ALL_LOCAL | NDIS_PACKET_TYPE_ALL_LOCAL (direct+bc+mc1)

Definition at line 23 of file winpkt.h.

Function Documentation

◆ pkt_get_multicast_list()

int pkt_get_multicast_list | ( | mac_address * | listbuf,
 |  | int * | len
 | ) |  |

Gets the current list of multicast addresses from the PKTDRVR.

  • listbuf is the buffer into which the list is placed
  • len on input: length of listbuf on output: length of list returned
Return values
0 | upon error - _pkt_errno is set
1 | if retrieval was successful,

Definition at line 2035 of file pcpkt.c.

References _pkt_errno, _pktdevlevel, _pktserial, and get_rmode_data().

◆ pkt_poll_recv()

struct pkt_rx_element * pkt_poll_recv ( void )

Definition at line 924 of file winpkt.c.

◆ pkt_set_multicast_list()

int pkt_set_multicast_list | ( | const void * | listbuf,
 |  | int | len
 | ) |  |

Sets the list of multicast addresses for which the PKTDRVR is responsible.

  • listbuf is the buffer containing the list
  • len is the length of listbuf
Return values
0 | upon error - _pkt_errno is set
1 | if set was successful

Definition at line 2082 of file pcpkt.c.

References _pkt_errno, _pktdevlevel, and _pktserial.

◆ winpkt_trace_fclose()

void void winpkt_trace_fclose ( void )

Definition at line 227 of file winpkt.c.

Variable Documentation

◆ _pkt_inf

struct pkt_info* _pkt_inf
extern

module data that will be locked

Definition at line 61 of file pcpkt.c.

◆ _pktdrvr_descr

char _pktdrvr_descr[]
extern

Definition at line 93 of file winpkt.c.

◆ winpkt_trace_file

const char* winpkt_trace_file
extern

Definition at line 183 of file winpkt.c.

◆ winpkt_trace_func

const char* winpkt_trace_func
extern

Definition at line 182 of file winpkt.c.

◆ winpkt_trace_level

UINT winpkt_trace_level
extern

Definition at line 185 of file winpkt.c.

◆ winpkt_trace_line

UINT winpkt_trace_line
extern

Definition at line 184 of file winpkt.c.


Watt-32 tcp/ip: E:/WATT/src/pcpkt32.c File Reference

  • src
Functions | Variables
pcpkt32.c File Reference

Go to the source code of this file.

Functions

int | pkt32_drvr_probe (const PM_driver *drivers)
int | pkt32_drvr_init (int driver, mac_address *addr)
const char * | pkt32_drvr_name (int driver)

Variables

int(* | _pkt32_drvr )(IREGS *) = NULL
const struct PM_driver | pm_driver_list []

Detailed Description

32-bit PKTDRVR interface.

Skeleton (not finished) for probing for the presence of network cards. All drivers should be put in a dynamically loaded module (DLL/DXE).

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file pcpkt32.c.

Function Documentation

◆ pkt32_drvr_init()

int pkt32_drvr_init | ( | int | driver,
 |  | mac_address * | addr
 | ) |  |

Definition at line 72 of file pcpkt32.c.

◆ pkt32_drvr_name()

const char * pkt32_drvr_name ( int driver )

Definition at line 79 of file pcpkt32.c.

◆ pkt32_drvr_probe()

int pkt32_drvr_probe ( const PM_driver * drivers )

Definition at line 66 of file pcpkt32.c.

Variable Documentation

◆ _pkt32_drvr

int(* _pkt32_drvr) (IREGS *) ( IREGS * ) = NULL

Definition at line 51 of file pcpkt32.c.

◆ pm_driver_list

const struct PM_driver pm_driver_list[]
Initial value:
= {
{ PM_DRVR_3C501, "3c501" },
{ PM_DRVR_3C503, "3c503" },
{ PM_DRVR_3C505, "3c505" },
{ PM_DRVR_3C507, "3c507" },
{ PM_DRVR_3C5x9, "3c5x9" },
{ PM_DRVR_3C59x, "3c59x" },
{ PM_DRVR_NE2000, "NE2000" },
{ PM_DRVR_EEXPR, "EthExp" },
{ PM_DRVR_RTL8139, "RTL8139" },
{ 0, NULL }
}

Definition at line 53 of file pcpkt32.c.


Watt-32 tcp/ip: E:/WATT/src/pcpkt32.h File Reference

  • src
Data Structures | Typedefs | Functions | Variables
pcpkt32.h File Reference

Go to the source code of this file.

Data Structures

struct PM_driver

Typedefs

typedef struct PM_driver PM_driver

Functions

int | pkt32_drvr_probe (const PM_driver *drivers)
int | pkt32_drvr_init (int driver, mac_address *addr)
const char * | pkt32_drvr_name (int driver)

Variables

int(* | _pkt32_drvr )(IREGS *)
const struct PM_driver | pm_driver_list []

Function Documentation

◆ pkt32_drvr_init()

int pkt32_drvr_init | ( | int | driver,
 |  | mac_address * | addr
 | ) |  |

Definition at line 72 of file pcpkt32.c.

◆ pkt32_drvr_name()

const char * pkt32_drvr_name ( int driver )

Definition at line 79 of file pcpkt32.c.

◆ pkt32_drvr_probe()

int pkt32_drvr_probe ( const PM_driver * drivers )

Definition at line 66 of file pcpkt32.c.

Variable Documentation

◆ _pkt32_drvr

int(* _pkt32_drvr) (IREGS *) ( IREGS * )
extern

Definition at line 51 of file pcpkt32.c.

◆ pm_driver_list

const struct PM_driver pm_driver_list[]
extern

Definition at line 53 of file pcpkt32.c.


Watt-32 tcp/ip: E:/WATT/src/pcqueue.c File Reference

  • src
Functions | Variables
pcqueue.c File Reference

Go to the source code of this file.

Functions

int | pktq_check (struct pkt_ringbuf *q)
int | pktq_init (struct pkt_ringbuf *q, int size, int num, char *buf)
int | pktq_inc_in (struct pkt_ringbuf *q)
int | pktq_inc_out (struct pkt_ringbuf *q)
int | pktq_in_index (struct pkt_ringbuf *q)
char * | pktq_in_buf (struct pkt_ringbuf *q)
char * | pktq_out_buf (struct pkt_ringbuf *q)
void | pktq_clear (struct pkt_ringbuf *q)
int | pktq_queued (struct pkt_ringbuf *q)
int | pktq_far_check (struct pkt_ringbuf *q)
int | pktq_far_init (int size, int num, DWORD real_base)

Variables

DWORD asmpkt_rm_base

Detailed Description

Simple ring-buffer queue handler for reception of packets from network driver.

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Created Jan-1998

Definition in file pcqueue.c.

Function Documentation

◆ pktq_check()

int pktq_check ( struct pkt_ringbuf * q )

Definition at line 48 of file pcqueue.c.

◆ pktq_clear()

void pktq_clear ( struct pkt_ringbuf * q )

Definition at line 155 of file pcqueue.c.

◆ pktq_far_check()

int pktq_far_check ( struct pkt_ringbuf * q )

Definition at line 203 of file pcqueue.c.

◆ pktq_far_init()

int pktq_far_init | ( | int | size,
 |  | int | num,
 |  | DWORD | real_base
 | ) |  |

Definition at line 245 of file pcqueue.c.

◆ pktq_in_buf()

char * pktq_in_buf ( struct pkt_ringbuf * q )

Definition at line 138 of file pcqueue.c.

◆ pktq_in_index()

int pktq_in_index ( struct pkt_ringbuf * q )

Definition at line 125 of file pcqueue.c.

◆ pktq_inc_in()

int pktq_inc_in ( struct pkt_ringbuf * q )

Definition at line 100 of file pcqueue.c.

◆ pktq_inc_out()

int pktq_inc_out ( struct pkt_ringbuf * q )

Definition at line 112 of file pcqueue.c.

◆ pktq_init()

int pktq_init | ( | struct pkt_ringbuf * | q,
 |  | int | size,
 |  | int | num,
 |  | char * | buf
 | ) |  |

Definition at line 69 of file pcqueue.c.

◆ pktq_out_buf()

char * pktq_out_buf ( struct pkt_ringbuf * q )

Definition at line 146 of file pcqueue.c.

◆ pktq_queued()

int pktq_queued ( struct pkt_ringbuf * q )

Definition at line 176 of file pcqueue.c.

Variable Documentation

◆ asmpkt_rm_base

DWORD asmpkt_rm_base

Definition at line 200 of file pcqueue.c.


Watt-32 tcp/ip: E:/WATT/src/pcqueue.h File Reference

  • src
Data Structures | Functions | Variables
pcqueue.h File Reference

Go to the source code of this file.

Data Structures

struct | pkt_rx_element
struct | pkt_ringbuf
FIFO style ring-buffer. More...

Functions

int | pktq_inc_in (struct pkt_ringbuf *q)
int | pktq_inc_out (struct pkt_ringbuf *q)
int | pktq_check (struct pkt_ringbuf *q)
void | pktq_clear (struct pkt_ringbuf *q)
int | pktq_init (struct pkt_ringbuf *q, int size, int num, char *buf)
int | pktq_in_index (struct pkt_ringbuf *q)
char * | pktq_in_buf (struct pkt_ringbuf *q)
char * | pktq_out_buf (struct pkt_ringbuf *q)
int | pktq_queued (struct pkt_ringbuf *q)
int | pktq_far_init (int size, int num, DWORD asmpkt_real_base)
int | pktq_far_queued (void)
int | pktq_far_check (struct pkt_ringbuf *q)

Variables

DWORD asmpkt_rm_base

Function Documentation

◆ pktq_check()

int pktq_check ( struct pkt_ringbuf * q )

Definition at line 48 of file pcqueue.c.

◆ pktq_clear()

void pktq_clear ( struct pkt_ringbuf * q )

Definition at line 155 of file pcqueue.c.

◆ pktq_far_check()

int pktq_far_check ( struct pkt_ringbuf * q )

Definition at line 203 of file pcqueue.c.

◆ pktq_far_init()

int pktq_far_init | ( | int | size,
 |  | int | num,
 |  | DWORD | asmpkt_real_base
 | ) |  |

Definition at line 245 of file pcqueue.c.

◆ pktq_in_buf()

char * pktq_in_buf ( struct pkt_ringbuf * q )

Definition at line 138 of file pcqueue.c.

◆ pktq_in_index()

int pktq_in_index ( struct pkt_ringbuf * q )

Definition at line 125 of file pcqueue.c.

◆ pktq_inc_in()

int pktq_inc_in ( struct pkt_ringbuf * q )

Definition at line 100 of file pcqueue.c.

◆ pktq_inc_out()

int pktq_inc_out ( struct pkt_ringbuf * q )

Definition at line 112 of file pcqueue.c.

◆ pktq_init()

int pktq_init | ( | struct pkt_ringbuf * | q,
 |  | int | size,
 |  | int | num,
 |  | char * | buf
 | ) |  |

Definition at line 69 of file pcqueue.c.

◆ pktq_out_buf()

char * pktq_out_buf ( struct pkt_ringbuf * q )

Definition at line 146 of file pcqueue.c.

◆ pktq_queued()

int pktq_queued ( struct pkt_ringbuf * q )

Definition at line 176 of file pcqueue.c.

Variable Documentation

◆ asmpkt_rm_base

DWORD asmpkt_rm_base
extern

Definition at line 200 of file pcqueue.c.


Watt-32 tcp/ip: E:/WATT/src/pcrarp.c File Reference

  • src
Functions | Variables
pcrarp.c File Reference

Go to the source code of this file.

Functions

static int | _rarp_request (void)
BOOL | _rarp_handler (const rarp_Header *rh, BOOL brdcast)
Handle incoming RARP packets.
int | _dorarp (void)

Variables

WORD _rarptimeout = 5

Detailed Description

RARP - Boot Protocol (RFC 903).

These extensions get called if MY_IP is set to RARP in wattcp.cfg

Version

0.0 : Sept 6, 1996 : Copied from E. Engelke's pcbootp.c by Dan Kegel 0.1 : Febr 9, 1997 : Modified, removed debug printing, G. Vanem

Definition in file pcrarp.c.

Function Documentation

◆ _dorarp()

int _dorarp ( void )

Definition at line 68 of file pcrarp.c.

◆ _rarp_handler()

BOOL _rarp_handler | ( | const rarp_Header * | rh,
 |  | BOOL | brdcast
 | ) |  |

Handle incoming RARP packets.

Definition at line 51 of file pcrarp.c.

References _eth_addr, and my_ip_addr.

◆ _rarp_request()

static int _rarp_request ( void )
static

Definition at line 31 of file pcrarp.c.

Variable Documentation

◆ _rarptimeout

WORD _rarptimeout = 5

Definition at line 29 of file pcrarp.c.


Watt-32 tcp/ip: E:/WATT/src/pcrarp.h File Reference

  • src
Functions | Variables
pcrarp.h File Reference

Go to the source code of this file.

Functions

int | _dorarp (void)
BOOL | _rarp_handler (const rarp_Header *rh, BOOL brdcast)
Handle incoming RARP packets.

Variables

WORD _rarptimeout

Function Documentation

◆ _dorarp()

int _dorarp ( void )

Definition at line 68 of file pcrarp.c.

◆ _rarp_handler()

BOOL _rarp_handler | ( | const rarp_Header * | rh,
 |  | BOOL | brdcast
 | ) |  |

Handle incoming RARP packets.

Definition at line 51 of file pcrarp.c.

References _eth_addr, and my_ip_addr.

Variable Documentation

◆ _rarptimeout

WORD _rarptimeout
extern

Definition at line 29 of file pcrarp.c.


Watt-32 tcp/ip: E:/WATT/src/pcrecv.c File Reference

  • src
Functions | Variables
pcrecv.c File Reference

Go to the source code of this file.

Functions

static int W32_CALL | sock_recvdaemon (sock_type *s, const void *data, unsigned len, const tcp_PseudoHeader *ph, const udp_Header *udp)
int W32_CALL | sock_recv_used (const sock_type *s)
int W32_CALL | sock_recv_init (sock_type *s, void *space, unsigned len)
int W32_CALL | sock_recv_from (sock_type *s, DWORD *hisip, WORD *hisport, void *buffer, unsigned len, int peek)
int W32_CALL | sock_recv (sock_type *s, void *buffer, unsigned len)

Variables

static long seq_num = 0

Detailed Description

Alternative socket receive handlers (see Waterloo manual).

Definition in file pcrecv.c.

Function Documentation

◆ sock_recv()

int W32_CALL sock_recv | ( | sock_type * | s,
 |  | void * | buffer,
 |  | unsigned | len
 | ) |  |

Definition at line 283 of file pcrecv.c.

◆ sock_recv_from()

int W32_CALL sock_recv_from | ( | sock_type * | s,
 |  | DWORD * | hisip,
 |  | WORD * | hisport,
 |  | void * | buffer,
 |  | unsigned | len,
 |  | int | peek
 | ) |  |

Definition at line 176 of file pcrecv.c.

◆ sock_recv_init()

int W32_CALL sock_recv_init | ( | sock_type * | s,
 |  | void * | space,
 |  | unsigned | len
 | ) |  |

Definition at line 155 of file pcrecv.c.

◆ sock_recv_used()

int W32_CALL sock_recv_used ( const sock_type * s )

Definition at line 123 of file pcrecv.c.

◆ sock_recvdaemon()

static int W32_CALL sock_recvdaemon | ( | sock_type * | s,
 |  | const void * | data,
 |  | unsigned | len,
 |  | const tcp_PseudoHeader * | ph,
 |  | const udp_Header * | udp
 | ) |  |
static

Definition at line 33 of file pcrecv.c.

Variable Documentation

◆ seq_num

long seq_num = 0
static

Definition at line 26 of file pcrecv.c.


Watt-32 tcp/ip: E:/WATT/src/pcrecv.h File Reference

  • src
Data Structures | Typedefs
pcrecv.h File Reference

Go to the source code of this file.

Data Structures

struct | recv_data
struct | recv_buf

Typedefs

typedef struct recv_data | recv_data
typedef struct recv_buf | recv_buf


Watt-32 tcp/ip: E:/WATT/src/pcsarp.c File Reference

  • src
Data Structures | Functions | Variables
pcsarp.c File Reference

Go to the source code of this file.

Data Structures

struct host_list

Functions

static | void (W32_CALL *prev_cfg_hook)(const char *
static const char *static void W32_CALL | sarp_parse (const char *name, const char *value)
Parser for "SEC_ARP.xx" keywords in WATTCP.CFG (or SARP.CFG).
static int | sarp_receive (const struct sarp_Packet *sarp)
static int | sarp_transmit (struct sarp_Packet *sarp)
int | sarp_init (void)
Application must call this before sock_init() so we don't link in OpenSSL libs by default.
static int | read_ca_keyfile (const char *value)
static int | read_priv_keyfile (const char *value)
static BOOL | crypto_load_sarp_file (const char *pem_file, DSA **dsa)
static int | set_secure_host (const char *value)
static int | set_known_host (const char *value, int value_len)
static __inline BOOL | is_secure_host (DWORD ip)
Check if host should use secure ARP.
static __inline BOOL | is_known_host (DWORD ip)
Check if host is among the known hosts.
static int | make_auth_Header (struct sarp_Packet *sarp)
void | _sarp_debug_dump (void)
Secure-ARP debug dump.

Variables

static char * | ca_keyfile = NULL
static char * | priv_keyfile = NULL
static int | sarp_debug = 0
static struct host_list * | known_hosts = NULL
static struct host_list * | secure_hosts = NULL

Detailed Description

Secure ARP client.

March 2004-09: created. Partly based on Linux version by Albero Ornaghi alor@.nosp@m.blac.nosp@m.khats.nosp@m..it http://alor.antifork.org/projects/s-arp/ http://www.acsac.org/2003/papers/111.pdf

This is mostly an excersise in OpenSSL programming. Don't expect it to make sense since S-ARP is completely non-standard (no RFC). Only Linux has a kernel patch to use S-ARP.

Definition in file pcsarp.c.

Function Documentation

◆ _sarp_debug_dump()

void _sarp_debug_dump ( void )

Secure-ARP debug dump.

Definition at line 284 of file pcsarp.c.

◆ crypto_load_sarp_file()

static BOOL crypto_load_sarp_file | ( | const char * | pem_file,
 |  | DSA ** | dsa
 | ) |  |
static

Definition at line 120 of file pcsarp.c.

◆ is_known_host()

static __inline BOOL is_known_host ( DWORD ip )
static

Check if host is among the known hosts.

Definition at line 233 of file pcsarp.c.

◆ is_secure_host()

static __inline BOOL is_secure_host ( DWORD ip )
static

Check if host should use secure ARP.

Definition at line 220 of file pcsarp.c.

◆ make_auth_Header()

static int make_auth_Header ( struct sarp_Packet * sarp )
static

Definition at line 243 of file pcsarp.c.

◆ read_ca_keyfile()

static int read_ca_keyfile ( const char * value )
static

Definition at line 94 of file pcsarp.c.

◆ read_priv_keyfile()

static int read_priv_keyfile ( const char * value )
static

Definition at line 101 of file pcsarp.c.

◆ sarp_init()

int sarp_init ( void )

Application must call this before sock_init() so we don't link in OpenSSL libs by default.

Definition at line 79 of file pcsarp.c.

References sarp_parse(), and sarp_receive().

◆ sarp_parse()

static void W32_CALL sarp_parse | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Parser for "SEC_ARP.xx" keywords in WATTCP.CFG (or SARP.CFG).

Definition at line 202 of file pcsarp.c.

References ARG_FUNC, and parse_config_table().

◆ sarp_receive()

static int sarp_receive ( const struct sarp_Packet * sarp )
static
Todo:

Definition at line 253 of file pcsarp.c.

References is_known_host(), and is_secure_host().

◆ sarp_transmit()

static int sarp_transmit ( struct sarp_Packet * sarp )
static

Definition at line 268 of file pcsarp.c.

◆ set_known_host()

static int set_known_host | ( | const char * | value,
 |  | int | value_len
 | ) |  |
static

Definition at line 173 of file pcsarp.c.

◆ set_secure_host()

static int set_secure_host ( const char * value )
static

Definition at line 137 of file pcsarp.c.

Variable Documentation

◆ ca_keyfile

char* ca_keyfile = NULL
static

Definition at line 65 of file pcsarp.c.

◆ known_hosts

struct host_list* known_hosts = NULL
static

Definition at line 69 of file pcsarp.c.

◆ priv_keyfile

char* priv_keyfile = NULL
static

Definition at line 66 of file pcsarp.c.

◆ sarp_debug

int sarp_debug = 0
static

Definition at line 67 of file pcsarp.c.

◆ secure_hosts

struct host_list* secure_hosts = NULL
static

Definition at line 70 of file pcsarp.c.


Watt-32 tcp/ip: E:/WATT/src/pcsarp.h File Reference

  • src
Data Structures | Functions
pcsarp.h File Reference

Go to the source code of this file.

Data Structures

struct | sarp_Auth
struct | sarp_Packet

Functions

int sarp_init (void)
Application must call this before sock_init() so we don't link in OpenSSL libs by default.

Detailed Description

Secure ARP handler module.

Definition in file pcsarp.h.

Function Documentation

◆ sarp_init()

int sarp_init ( void )

Application must call this before sock_init() so we don't link in OpenSSL libs by default.

Definition at line 79 of file pcsarp.c.

References sarp_parse(), and sarp_receive().


Watt-32 tcp/ip: E:/WATT/src/pcsed.c File Reference

  • src
Functions | Variables
pcsed.c File Reference

Go to the source code of this file.

Functions

void *W32_CALL * | _eth_recv_hook (WORD *type)
Pointer to functions that when set changes the behaviour of polling and send functions _eth_arrived() and _eth_send().
int (W32_CALL *_eth_recv_peek)(void *mac_buf)
static void W32_CALL | __eth_release (void)
Turn off stack-checking because _eth_release() might be called from an exception handler.
void *W32_CALL | _eth_formatpacket (const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet.
static int | send_loopback (link_Packet pkt, BOOL is_ip6, unsigned *err_line)
Enqueue a link-layer frame (IPv4/v6 only) to the internal loopback device.
int W32_CALL | _eth_send (WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
static void * | eth_mac_format (void *mac_buf, const void *mac_dest, WORD type)
Format the MAC-header for Ethernet.
static void * | tok_mac_format (void *mac_buf, const void *mac_dest, WORD type)
Format the MAC-header for Token-Ring.
static void * | fddi_mac_format (void *mac_buf, const void *mac_dest, WORD type)
Format the MAC-header for FDDI.
static void * | arcnet_mac_format (void *mac_buf, const void *mac_dest, WORD type)
Format the MAC-header for ARCNET.
static void * | null_mac_format (void *mac_buf, const void *mac_dest, WORD type)
Format MAC-header for protocols without MAC-headers.
static int | eth_mac_xmit (const void *buf, WORD len)
Functions called via function pointer ‘mac_transmit’ to actually send the data.
static int | fddi_mac_xmit (const void *buf, WORD len)
static int | arcnet_mac_xmit (const void *buf, WORD len)
static int | tok_mac_xmit (const void *buf, WORD len)
static int | null_mac_xmit (const void *buf, WORD len)
int W32_CALL | _eth_init (void)
Initialize the network driver interface.
int W32_CALL | _eth_set_addr (const void *addr)
Sets a new MAC address for our interface.
BYTE W32_CALL | _eth_get_hwtype (BYTE *hwtype, BYTE *hwlen)
Fill in hardware address type/length for BOOTP/DHCP packets.
void W32_CALL | _eth_free (const void *pkt)
Free an input buffer once it is no longer needed.
static void | fix_tok_head (tok_Header **trp)
static BOOL | fix_arc_head (const arcnet_Header *head, WORD *type)
static union link_Packet * | poll_recv_queue (WORD *type)
Poll the packet queue.
static void | fix_llc_head (void **mac)
void *W32_CALL | _eth_arrived (WORD *type_ptr, BOOL *broadcast)
Poll for arrival of new packets (IP/ARP/RARP/PPPoE protocol).
void * | _eth_mac_hdr (const in_Header *ip)
Return pointer to MAC header start address of an IP packet.
void * | _eth_mac_dst (const in_Header *ip)
Return pointer to MAC destination address of an IP packet.
void * | _eth_mac_src (const in_Header *ip)
Return pointer to MAC source address of an IP packet.
WORD | _eth_mac_typ (const in_Header *ip)
Return value of protocol-type given an IP packet.
BOOL | _eth_join_mcast_group (const struct MultiCast *mc)
Joins a multicast group (at the physical layer).
BOOL | _eth_leave_mcast_group (const struct MultiCast *mc)
Leaves a multicast group (at the physical layer)
void W32_CALL | _eth_release (void)
Release the hardware driver.

Variables

mac_address | _eth_addr
Local link-layer source address.
mac_address | _eth_brdcast
Link-layer broadcast address.
mac_address | _eth_loop_addr
Link-layer loopback address.
mac_address | _eth_real_addr
Our real MAC address.
BYTE | _eth_mac_len
Size of a MAC address.
BOOL | _eth_is_init = FALSE
we are initialised
BOOL | _ip_recursion = FALSE
avoid recursion in arp_resolve()
BOOL | _eth_ndis3pkt = FALSE
for DOS-programs only
BOOL | _eth_SwsVpkt = FALSE
for DOS and Win32 programs
BOOL | _eth_wanpacket = FALSE
for Win32 using an WanPacket adapter
BOOL | _eth_win10pcap = FALSE
for Win32 using an Win10Pcap adapter
BOOL | _eth_winpcap = FALSE
for Win32 using an WinPcap or NPcap adapter (default)
const char * | _eth_not_init = "Packet driver not initialised"
struct _eth_last_info | _eth_last
Sizes and timestamps of last packet recv/sent.
unsigned | len = NULL
static void *(* | mac_tx_format )(void *mac_buf, const void *mac_dest, WORD type)
Pointer to functions that does the filling of correct MAC-header and sends the link-layer packet.
static int(* | mac_transmit )(const void *mac_buf, WORD len)
static WORD | proto
static void * | nw_pkt
static union link_Packet | outbuf

Detailed Description

Link-layer Driver Routines.

The TCP code uses Ethernet constants for protocol numbers and 48 bits for address. Also, 0xFF:FF:FF:FF:FF:FF is assumed to be a broadcast. Except for ARCNET where broadcast is 0x00.

If you need to write a new driver, implement it at this level and use the above mentioned constants as this program's constants, not device dependent constants.

The packet driver or WinPcap interface code lies below this module.

Definition in file pcsed.c.

Function Documentation

◆ __eth_release()

static void W32_CALL __eth_release ( void )
static

Turn off stack-checking because _eth_release() might be called from an exception handler.

Definition at line 1341 of file pcsed.c.

References _eth_release().

◆ _eth_arrived()

void *W32_CALL _eth_arrived | ( | WORD * | type_ptr,
 |  | BOOL * | broadcast
 | ) |  |

Poll for arrival of new packets (IP/ARP/RARP/PPPoE protocol).

Sets protocol-type of packet received in 'type'.

For Ethernet/TokenRing-type drivers:

Return values
Pointer past the MAC-header to the IP/ARP/RARP protocol header. Also check for link-layer broadcast.

For PPP/SLIP-type drivers (no MAC-headers):

Return values
Pointer to the IP-packet itself. IP-protocol is assumed. Can never be link-layer broadcast.

<

Todo:
push back packet, else it's lost

Definition at line 996 of file pcsed.c.

References _eth_brdcast, _eth_free(), _eth_is_init, _eth_recv_hook(), _ip_recursion, _pktdevclass, _pktserial, fix_llc_head(), poll_recv_queue(), and update_in_stat().

◆ _eth_formatpacket()

void *W32_CALL _eth_formatpacket | ( | const void * | mac_dest,
 |  | WORD | eth_type
 | ) |  |

_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet.

Returns
address of higher-level protocol (IP/RARP/RARP) header.

Definition at line 134 of file pcsed.c.

◆ _eth_free()

void W32_CALL _eth_free ( const void * pkt )

Free an input buffer once it is no longer needed.

Definition at line 769 of file pcsed.c.

References _eth_recv_hook(), pkt_buf_wipe(), and pkt_free_pkt().

◆ _eth_get_hwtype()

BYTE W32_CALL _eth_get_hwtype | ( | BYTE * | hwtype,
 |  | BYTE * | hwlen
 | ) |  |

Fill in hardware address type/length for BOOTP/DHCP packets.

Also used for ARP/RARP packets. Should never be called for PPP/SLIP.

Definition at line 730 of file pcsed.c.

References _pktdevclass.

◆ _eth_init()

int W32_CALL _eth_init ( void )

Initialize the network driver interface.

Returns
0 okay.
error-code otherwise.

Definition at line 634 of file pcsed.c.

References __eth_release(), _eth_addr, _eth_brdcast, _eth_get_hwtype(), _eth_is_init, _eth_loop_addr, _eth_mac_len, _eth_ndis3pkt, _eth_real_addr, _eth_SwsVpkt, _pktdevclass, arcnet_mac_format(), eth_mac_format(), eth_mac_xmit(), fddi_mac_format(), mac_tx_format, null_mac_format(), pkt_buf_wipe(), pkt_eth_init(), and tok_mac_format().

◆ _eth_join_mcast_group()

BOOL _eth_join_mcast_group ( const struct MultiCast * mc )

Joins a multicast group (at the physical layer).

Return values
1 | The group was joined successfully.
0 | Attempt failed.

Definition at line 1204 of file pcsed.c.

References _pkt_errno, _pkt_rxmode, MultiCast::ethaddr, pkt_get_multicast_list(), pkt_set_multicast_list(), pkt_set_rcv_mode(), RXMODE_MULTICAST1, RXMODE_MULTICAST2, and RXMODE_PROMISCOUS.

◆ _eth_leave_mcast_group()

BOOL _eth_leave_mcast_group ( const struct MultiCast * mc )

Leaves a multicast group (at the physical layer)

Return values
1 | The group was left successfully.
0 | Attempt failed.

Definition at line 1278 of file pcsed.c.

References _pkt_errno, _pkt_rxmode, MultiCast::ethaddr, pkt_get_multicast_list(), pkt_set_multicast_list(), pkt_set_rcv_mode(), and RXMODE_MULTICAST2.

◆ _eth_mac_dst()

void * _eth_mac_dst ( const in_Header * ip )

Return pointer to MAC destination address of an IP packet.

Definition at line 1113 of file pcsed.c.

References _pkt_ip_ofs, and _pktdevclass.

◆ _eth_mac_hdr()

void * _eth_mac_hdr ( const in_Header * ip )

Return pointer to MAC header start address of an IP packet.

Definition at line 1099 of file pcsed.c.

References _pkt_ip_ofs, _pktdevclass, and _pktserial.

◆ _eth_mac_src()

void * _eth_mac_src ( const in_Header * ip )

Return pointer to MAC source address of an IP packet.

Definition at line 1140 of file pcsed.c.

References _pkt_ip_ofs, and _pktdevclass.

◆ _eth_mac_typ()

WORD _eth_mac_typ ( const in_Header * ip )

Return value of protocol-type given an IP packet.

Definition at line 1167 of file pcsed.c.

References _pkt_ip_ofs, and _pktdevclass.

◆ _eth_recv_hook()

void *W32_CALL * _eth_recv_hook ( WORD * type )

Pointer to functions that when set changes the behaviour of polling and send functions _eth_arrived() and _eth_send().

_eth_recv_hook: If set, must point to a function that supplies frames ready to be received. Return NULL if no frame is ready. Otherwise points to a raw MAC frame. If not a serial-driver, must also set '*type'.

_eth_recv_peek: If set, must point to a function that gets a chance to peek at the raw received frame. It can modify it or even consume it by returning zero. To prevent recursion, this function cannot call tcp_tick(). It should return as fast as possible in order not to block reception of other frames waiting in the receive buffer.

_eth_xmit_hook: If set, must point to a function that should transmit all frames generated by Watt-32. Must return length of frame sent or <= 0 if it failed.

◆ _eth_release()

void W32_CALL _eth_release ( void )

Release the hardware driver.

Definition at line 1349 of file pcsed.c.

References _eth_addr, _eth_is_init, _eth_real_addr, _pkt_rxmode, _pkt_rxmode0, _pktserial, _watt_fatal_error, pkt_dropped(), pkt_release(), pkt_set_addr(), and pkt_set_rcv_mode().

◆ _eth_send()

int W32_CALL _eth_send | ( | WORD | len,
 |  | const void * | sock,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

_eth_send() does the actual transmission once we are complete with filling the buffer.

Do any last minute patches here, like fix the size. Send to "loopback" device if it's IP and destination matches loopback network (127.x.x.x.).

Return length of network-layer packet (not length of link-layer packet).

Definition at line 301 of file pcsed.c.

References _eth_is_init, _eth_last, _pkt_ip_ofs, _pktdevclass, has_rdtsc, send_loopback(), and update_out_stat().

◆ _eth_set_addr()

int W32_CALL _eth_set_addr ( const void * addr )

Sets a new MAC address for our interface.

Definition at line 712 of file pcsed.c.

References _eth_addr, _pktdevclass, _pktserial, and pkt_set_addr().

◆ arcnet_mac_format()

static void * arcnet_mac_format | ( | void * | mac_buf,
 |  | const void * | mac_dest,
 |  | WORD | type
 | ) |  |
static

Format the MAC-header for ARCNET.

Definition at line 534 of file pcsed.c.

References _eth_addr, and _eth_brdcast.

◆ arcnet_mac_xmit()

static int arcnet_mac_xmit | ( | const void * | buf,
 |  | WORD | len
 | ) |  |
static

Definition at line 606 of file pcsed.c.

◆ eth_mac_format()

static void * eth_mac_format | ( | void * | mac_buf,
 |  | const void * | mac_dest,
 |  | WORD | type
 | ) |  |
static

Format the MAC-header for Ethernet.

Definition at line 448 of file pcsed.c.

References _eth_addr, pppoe_is_up(), and pppoe_mac_format().

◆ eth_mac_xmit()

static int eth_mac_xmit | ( | const void * | buf,
 |  | WORD | len
 | ) |  |
static

Functions called via function pointer ‘mac_transmit’ to actually send the data.

Definition at line 586 of file pcsed.c.

References pkt_send().

◆ fddi_mac_format()

static void * fddi_mac_format | ( | void * | mac_buf,
 |  | const void * | mac_dest,
 |  | WORD | type
 | ) |  |
static

Format the MAC-header for FDDI.

Definition at line 510 of file pcsed.c.

References _eth_addr.

◆ fddi_mac_xmit()

static int fddi_mac_xmit | ( | const void * | buf,
 |  | WORD | len
 | ) |  |
static

Definition at line 596 of file pcsed.c.

◆ fix_arc_head()

static BOOL fix_arc_head | ( | const arcnet_Header * | head,
 |  | WORD * | type
 | ) |  |
static

Definition at line 829 of file pcsed.c.

◆ fix_llc_head()

static void fix_llc_head ( void ** mac )
static
Todo:
handle IEEE 802.3 encapsulation also.

Definition at line 971 of file pcsed.c.

References _eth_free().

◆ fix_tok_head()

static void fix_tok_head ( tok_Header ** trp )
static

Definition at line 793 of file pcsed.c.

◆ null_mac_format()

static void * null_mac_format | ( | void * | mac_buf,
 |  | const void * | mac_dest,
 |  | WORD | type
 | ) |  |
static

Format MAC-header for protocols without MAC-headers.

Nothing done here.

Definition at line 571 of file pcsed.c.

◆ null_mac_xmit()

static int null_mac_xmit | ( | const void * | buf,
 |  | WORD | len
 | ) |  |
static

Definition at line 623 of file pcsed.c.

◆ poll_recv_queue()

static union link_Packet * poll_recv_queue ( WORD * type )
static

Poll the packet queue.

Return first packet in queue. Optionally do receiver profiling.

Return values
pointer | to start of MAC-header.
NULL | no packets are queued.
Note
Not used when e.g. libpcap has set the ‘_eth_recv_hook’ to do it's own packet-polling.
'type' is always set.

Definition at line 868 of file pcsed.c.

References _eth_last, _pkt_inf, _pktdevclass, _pktserial, and pkt_free_pkt().

◆ send_loopback()

static int send_loopback | ( | link_Packet | pkt,
 |  | BOOL | is_ip6,
 |  | unsigned * | err_line
 | ) |  |
static

Enqueue a link-layer frame (IPv4/v6 only) to the internal loopback device.

Note
This function uses call-by-value. Thus ‘pkt’ buffer can be modified by loopback_device() and loopback handler may send using _eth_send().
Loopback device cannot send to itself (potential recursion).

Definition at line 151 of file pcsed.c.

References _eth_addr, _eth_loop_addr, _pkt_inf, _pkt_ip_ofs, _pktserial, pkt_ringbuf::in_index, pkt_ringbuf::num_buf, pkt_ringbuf::num_drop, and pkt_ringbuf::out_index.

◆ tok_mac_format()

static void * tok_mac_format | ( | void * | mac_buf,
 |  | const void * | mac_dest,
 |  | WORD | type
 | ) |  |
static

Format the MAC-header for Token-Ring.

Definition at line 477 of file pcsed.c.

References _eth_addr, and _pktdevclass.

◆ tok_mac_xmit()

static int tok_mac_xmit | ( | const void * | buf,
 |  | WORD | len
 | ) |  |
static

Definition at line 616 of file pcsed.c.

Variable Documentation

◆ _eth_addr

mac_address _eth_addr

Local link-layer source address.

Definition at line 49 of file pcsed.c.

◆ _eth_brdcast

mac_address _eth_brdcast

Link-layer broadcast address.

Definition at line 50 of file pcsed.c.

◆ _eth_is_init

BOOL _eth_is_init = FALSE

we are initialised

Definition at line 54 of file pcsed.c.

◆ _eth_last

struct _eth_last_info _eth_last

Sizes and timestamps of last packet recv/sent.

Definition at line 67 of file pcsed.c.

◆ _eth_loop_addr

mac_address _eth_loop_addr

Link-layer loopback address.

Definition at line 51 of file pcsed.c.

◆ _eth_mac_len

BYTE _eth_mac_len

Size of a MAC address.

Definition at line 53 of file pcsed.c.

◆ _eth_ndis3pkt

BOOL _eth_ndis3pkt = FALSE

for DOS-programs only

Definition at line 56 of file pcsed.c.

◆ _eth_not_init

const char* _eth_not_init = "Packet driver not initialised"

Definition at line 62 of file pcsed.c.

◆ _eth_real_addr

mac_address _eth_real_addr

Our real MAC address.

Definition at line 52 of file pcsed.c.

◆ _eth_SwsVpkt

BOOL _eth_SwsVpkt = FALSE

for DOS and Win32 programs

Definition at line 57 of file pcsed.c.

◆ _eth_wanpacket

BOOL _eth_wanpacket = FALSE

for Win32 using an WanPacket adapter

Definition at line 58 of file pcsed.c.

◆ _eth_win10pcap

BOOL _eth_win10pcap = FALSE

for Win32 using an Win10Pcap adapter

Definition at line 59 of file pcsed.c.

◆ _eth_winpcap

BOOL _eth_winpcap = FALSE

for Win32 using an WinPcap or NPcap adapter (default)

Definition at line 60 of file pcsed.c.

◆ _ip_recursion

BOOL _ip_recursion = FALSE

avoid recursion in arp_resolve()

Definition at line 55 of file pcsed.c.

◆ len

unsigned len = NULL

Definition at line 92 of file pcsed.c.

◆ mac_transmit

int(* mac_transmit) (const void *mac_buf, WORD len) | ( | const void * | mac_buf,
 |  | WORD | len
 | ) |  |
static

Definition at line 99 of file pcsed.c.

◆ mac_tx_format

void *(* mac_tx_format) (void *mac_buf, const void *mac_dest, WORD type) | ( | void * | mac_buf,
 |  | const void * | mac_dest,
 |  | WORD | type
 | ) |  |
static

Pointer to functions that does the filling of correct MAC-header and sends the link-layer packet.

We store 'proto' between calls.

Definition at line 98 of file pcsed.c.

◆ nw_pkt

void* nw_pkt
static

Definition at line 102 of file pcsed.c.

◆ outbuf

static union link_Packet outbuf
static

Definition at line 119 of file pcsed.c.

◆ proto

WORD proto
static

Definition at line 101 of file pcsed.c.


Watt-32 tcp/ip: E:/WATT/src/pcsed.h File Reference

  • src
Data Structures | Typedefs | Functions | Variables
pcsed.h File Reference

Go to the source code of this file.

Data Structures

struct | eth_Packet
struct | vlan_Header
struct | vlan_Packet
struct | tok_Header
struct | tok_Packet
struct | llc_Header
struct | llc_Packet
struct | fddi_Header
struct | fddi_Packet
struct | arcnet_Header
struct | arcnet_Packet
struct | ax25_Header
struct | ax25_Packet
struct | pppoe_Header
struct | pppoe_Packet
union | link_Packet

Typedefs

typedef struct eth_Packet | eth_Packet
typedef struct vlan_Header | vlan_Header
typedef struct vlan_Packet | vlan_Packet
typedef struct tok_Header | tok_Header
typedef struct tok_Packet | tok_Packet
typedef struct llc_Header | llc_Header
typedef struct llc_Packet | llc_Packet
typedef struct fddi_Header | fddi_Header
typedef struct fddi_Packet | fddi_Packet
typedef struct arcnet_Header | arcnet_Header
typedef struct arcnet_Packet | arcnet_Packet
typedef struct ax25_Header | ax25_Header
From Wireshark; epan/dissectors/packet-ax25.c.
typedef struct ax25_Packet | ax25_Packet
typedef struct pppoe_Header | pppoe_Header
The PPPOE header (RFC-2561) excluding Ether-header.
typedef struct pppoe_Packet | pppoe_Packet
typedef union link_Packet | link_Packet

Functions

W32_CLANG_PACK_WARN_DEF () struct _eth_last_info
BOOL | _eth_join_mcast_group (const struct MultiCast *mc)
Joins a multicast group (at the physical layer).
BOOL | _eth_leave_mcast_group (const struct MultiCast *mc)
Leaves a multicast group (at the physical layer)
void * | _eth_mac_hdr (const in_Header *ip) ATTR_NORETURN()
Return pointer to MAC header start address of an IP packet.
void * | _eth_mac_dst (const in_Header *ip) ATTR_NORETURN()
Return pointer to MAC destination address of an IP packet.
void * | _eth_mac_src (const in_Header *ip) ATTR_NORETURN()
Return pointer to MAC source address of an IP packet.
WORD | _eth_mac_typ (const in_Header *ip) ATTR_NORETURN()
Return value of protocol-type given an IP packet.

Variables

eth_Header
struct _eth_last_info | _eth_last
Sizes and timestamps of last packet recv/sent.
BOOL | _ip_recursion
avoid recursion in arp_resolve()
BOOL | _eth_is_init
BOOL | _eth_ndis3pkt
for DOS-programs only
BOOL | _eth_winpcap
BOOL | _eth_win10pcap
BOOL | _eth_SwsVpkt
BOOL | _eth_wanpacket
BYTE | _eth_mac_len
Size of a MAC address.
const char * | _eth_not_init
mac_address | _eth_addr
Local link-layer source address.
mac_address | _eth_real_addr
Our real MAC address.
mac_address | _eth_loop_addr
Link-layer loopback address.
mac_address | _eth_brdcast
Link-layer broadcast address.

Detailed Description

Link-layer (DIX Ethernet, Token-Ring, ARCnet, FDDI and PPP/SLIP) Interface.

Definition in file pcsed.h.

Typedef Documentation

◆ ax25_Header

ax25_Header

From Wireshark; epan/dissectors/packet-ax25.c.

Incomplete.

◆ link_Packet

link_Packet

The union of all above MAC-headers.

Function Documentation

◆ _eth_join_mcast_group()

BOOL _eth_join_mcast_group ( const struct MultiCast * mc )

Joins a multicast group (at the physical layer).

Return values
1 | The group was joined successfully.
0 | Attempt failed.

Definition at line 1204 of file pcsed.c.

References _pkt_errno, _pkt_rxmode, MultiCast::ethaddr, pkt_get_multicast_list(), pkt_set_multicast_list(), pkt_set_rcv_mode(), RXMODE_MULTICAST1, RXMODE_MULTICAST2, and RXMODE_PROMISCOUS.

◆ _eth_leave_mcast_group()

BOOL _eth_leave_mcast_group ( const struct MultiCast * mc )

Leaves a multicast group (at the physical layer)

Return values
1 | The group was left successfully.
0 | Attempt failed.

Definition at line 1278 of file pcsed.c.

References _pkt_errno, _pkt_rxmode, MultiCast::ethaddr, pkt_get_multicast_list(), pkt_set_multicast_list(), pkt_set_rcv_mode(), and RXMODE_MULTICAST2.

◆ _eth_mac_dst()

void * _eth_mac_dst ( const in_Header * ip )

Return pointer to MAC destination address of an IP packet.

Definition at line 1113 of file pcsed.c.

References _pkt_ip_ofs, and _pktdevclass.

◆ _eth_mac_hdr()

void * _eth_mac_hdr ( const in_Header * ip )

Return pointer to MAC header start address of an IP packet.

Definition at line 1099 of file pcsed.c.

References _pkt_ip_ofs, _pktdevclass, and _pktserial.

◆ _eth_mac_src()

void * _eth_mac_src ( const in_Header * ip )

Return pointer to MAC source address of an IP packet.

Definition at line 1140 of file pcsed.c.

References _pkt_ip_ofs, and _pktdevclass.

◆ _eth_mac_typ()

WORD _eth_mac_typ ( const in_Header * ip )

Return value of protocol-type given an IP packet.

Definition at line 1167 of file pcsed.c.

References _pkt_ip_ofs, and _pktdevclass.

◆ W32_CLANG_PACK_WARN_DEF()

W32_CLANG_PACK_WARN_DEF ( )

Definition at line 261 of file pcsed.h.

Variable Documentation

◆ _eth_addr

mac_address _eth_addr
extern

Local link-layer source address.

Definition at line 49 of file pcsed.c.

◆ _eth_brdcast

mac_address _eth_brdcast
extern

Link-layer broadcast address.

Definition at line 50 of file pcsed.c.

◆ _eth_is_init

BOOL _eth_is_init

Definition at line 276 of file pcsed.h.

◆ _eth_last

struct _eth_last_info _eth_last
extern

Sizes and timestamps of last packet recv/sent.

Definition at line 67 of file pcsed.c.

◆ _eth_loop_addr

mac_address _eth_loop_addr
extern

Link-layer loopback address.

Definition at line 51 of file pcsed.c.

◆ _eth_mac_len

BYTE _eth_mac_len
extern

Size of a MAC address.

Definition at line 53 of file pcsed.c.

◆ _eth_ndis3pkt

BOOL _eth_ndis3pkt
extern

for DOS-programs only

Definition at line 56 of file pcsed.c.

◆ _eth_not_init

const char* _eth_not_init
extern

Definition at line 62 of file pcsed.c.

◆ _eth_real_addr

mac_address _eth_real_addr
extern

Our real MAC address.

Definition at line 52 of file pcsed.c.

◆ _eth_SwsVpkt

BOOL _eth_SwsVpkt

Definition at line 277 of file pcsed.h.

◆ _eth_wanpacket

BOOL _eth_wanpacket

Definition at line 277 of file pcsed.h.

◆ _eth_win10pcap

BOOL _eth_win10pcap

Definition at line 277 of file pcsed.h.

◆ _eth_winpcap

BOOL _eth_winpcap

Definition at line 277 of file pcsed.h.

◆ _ip_recursion

BOOL _ip_recursion
extern

avoid recursion in arp_resolve()

Definition at line 55 of file pcsed.c.

◆ eth_Header

typedef struct eth_Header

Definition at line 32 of file pcsed.h.


Watt-32 tcp/ip: E:/WATT/src/pcslip.h File Reference

  • src
Functions
pcslip.h File Reference

Go to the source code of this file.

Functions

int slip_init (void)

Detailed Description

Deprecated:

Definition in file pcslip.h.


Watt-32 tcp/ip: E:/WATT/src/pcstat.c File Reference

  • src
Functions | Variables
pcstat.c File Reference

Go to the source code of this file.

Functions

int W32_CALL | sock_stats (sock_type *sock, DWORD *days, WORD *inactive, WORD *cwindow, DWORD *avg, DWORD *sd)
void | print_mac_stats (void)
void | print_vjc_stats (void)
void | print_pkt_stats (void)
void | print_ip4_stats (void)
void | print_ip6_stats (void)
void | print_icmp_stats (void)
void | print_icmp6_stats (void)
void | print_igmp_stats (void)
void | print_udp_stats (void)
void | print_tcp_stats (void)
void | print_cache_stats (void)
void | print_all_stats (void)
void | reset_stats (void)
static __inline void | show_stat (const char *name, DWORD num)
static __inline void | show_stat64 (const char *name, uint64 num)
void W32_CALL | print_arp_stats (void)
void W32_CALL | print_rarp_stats (void)
void W32_CALL | print_pppoe_stats (void)
void | update_in_stat (void)
void | update_out_stat (void)

Variables

struct macstat | macstats
struct ipstat | ip4stats
struct ip6stat | ip6stats
struct udpstat | udpstats
struct icmpstat | icmpstats
struct icmp6stat | icmp6stats
struct igmpstat | igmpstats
struct pppoestat | pppoestats
struct cache_stat | cache_stats
struct tcpstat | tcpstats

Detailed Description

Input/output statistics.

Definition in file pcstat.c.

Function Documentation

◆ print_all_stats()

void W32_CALL print_all_stats ( void )

Definition at line 92 of file pcstat.c.

◆ print_arp_stats()

void W32_CALL print_arp_stats ( void )

Definition at line 173 of file pcstat.c.

◆ print_cache_stats()

void W32_CALL print_cache_stats ( void )

Definition at line 91 of file pcstat.c.

◆ print_icmp6_stats()

void W32_CALL print_icmp6_stats ( void )

Definition at line 87 of file pcstat.c.

◆ print_icmp_stats()

void W32_CALL print_icmp_stats ( void )

Definition at line 86 of file pcstat.c.

◆ print_igmp_stats()

void W32_CALL print_igmp_stats ( void )

Definition at line 88 of file pcstat.c.

◆ print_ip4_stats()

void W32_CALL print_ip4_stats ( void )

Definition at line 84 of file pcstat.c.

◆ print_ip6_stats()

void W32_CALL print_ip6_stats ( void )

Definition at line 85 of file pcstat.c.

◆ print_mac_stats()

void W32_CALL print_mac_stats ( void )

Definition at line 81 of file pcstat.c.

◆ print_pkt_stats()

void W32_CALL print_pkt_stats ( void )

Definition at line 83 of file pcstat.c.

◆ print_pppoe_stats()

void W32_CALL print_pppoe_stats ( void )

Definition at line 312 of file pcstat.c.

◆ print_rarp_stats()

void W32_CALL print_rarp_stats ( void )

Definition at line 183 of file pcstat.c.

◆ print_tcp_stats()

void W32_CALL print_tcp_stats ( void )

Definition at line 90 of file pcstat.c.

◆ print_udp_stats()

void W32_CALL print_udp_stats ( void )

Definition at line 89 of file pcstat.c.

◆ print_vjc_stats()

void W32_CALL print_vjc_stats ( void )

Definition at line 82 of file pcstat.c.

◆ reset_stats()

void W32_CALL reset_stats ( void )

Definition at line 93 of file pcstat.c.

◆ show_stat()

static __inline void show_stat | ( | const char * | name,
 |  | DWORD | num
 | ) |  |
static

Definition at line 126 of file pcstat.c.

◆ show_stat64()

static __inline void show_stat64 | ( | const char * | name,
 |  | uint64 | num
 | ) |  |
static

Definition at line 133 of file pcstat.c.

◆ sock_stats()

int W32_CALL sock_stats | ( | sock_type * | sock,
 |  | DWORD * | days,
 |  | WORD * | inactive,
 |  | WORD * | cwindow,
 |  | DWORD * | avg,
 |  | DWORD * | sd
 | ) |  |

Definition at line 58 of file pcstat.c.

◆ update_in_stat()

void update_in_stat ( void )
Todo:
Count PPP protocols LCP and IPCP
Todo:
Count these IPv6 protocols

Definition at line 583 of file pcstat.c.

References _eth_addr.

◆ update_out_stat()

void update_out_stat ( void )
Todo:
Count the PPP protocols LCP and IPCP
Todo:
Count these IPv6 protocols

Definition at line 724 of file pcstat.c.

Variable Documentation

◆ cache_stats

struct cache_stat cache_stats

Definition at line 105 of file pcstat.c.

◆ icmp6stats

struct icmp6stat icmp6stats

Definition at line 102 of file pcstat.c.

◆ icmpstats

struct icmpstat icmpstats

Definition at line 101 of file pcstat.c.

◆ igmpstats

struct igmpstat igmpstats

Definition at line 103 of file pcstat.c.

◆ ip4stats

struct ipstat ip4stats

Definition at line 98 of file pcstat.c.

◆ ip6stats

struct ip6stat ip6stats

Definition at line 99 of file pcstat.c.

◆ macstats

struct macstat macstats

Definition at line 97 of file pcstat.c.

◆ pppoestats

struct pppoestat pppoestats

Definition at line 104 of file pcstat.c.

◆ tcpstats

struct tcpstat tcpstats

Definition at line 108 of file pcstat.c.

◆ udpstats

struct udpstat udpstats

Definition at line 100 of file pcstat.c.


Watt-32 tcp/ip: E:/WATT/src/pcstat.h File Reference

  • src
Data Structures | Functions | Variables
pcstat.h File Reference

Go to the source code of this file.

Data Structures

struct | macstat
struct | pppoestat
struct | cache_stat

Functions

void | update_in_stat (void)
void | update_out_stat (void)

Variables

struct macstat | macstats
struct ipstat | ip4stats
struct ip6stat | ip6stats
struct udpstat | udpstats
struct tcpstat | tcpstats
struct icmpstat | icmpstats
struct icmp6stat | icmp6stats
struct igmpstat | igmpstats
struct pppoestat | pppoestats
struct cache_stat | cache_stats

Function Documentation

◆ update_in_stat()

void update_in_stat ( void )
Todo:
Count PPP protocols LCP and IPCP
Todo:
Count these IPv6 protocols

Definition at line 583 of file pcstat.c.

References _eth_addr.

◆ update_out_stat()

void update_out_stat ( void )
Todo:
Count the PPP protocols LCP and IPCP
Todo:
Count these IPv6 protocols

Definition at line 724 of file pcstat.c.

Variable Documentation

◆ cache_stats

struct cache_stat cache_stats
extern

Definition at line 105 of file pcstat.c.

◆ icmp6stats

struct icmp6stat icmp6stats
extern

Definition at line 102 of file pcstat.c.

◆ icmpstats

struct icmpstat icmpstats
extern

Definition at line 101 of file pcstat.c.

◆ igmpstats

struct igmpstat igmpstats
extern

Definition at line 103 of file pcstat.c.

◆ ip4stats

struct ipstat ip4stats
extern

Definition at line 98 of file pcstat.c.

◆ ip6stats

struct ip6stat ip6stats
extern

Definition at line 99 of file pcstat.c.

◆ macstats

struct macstat macstats
extern

Definition at line 97 of file pcstat.c.

◆ pppoestats

struct pppoestat pppoestats
extern

Definition at line 104 of file pcstat.c.

◆ tcpstats

struct tcpstat tcpstats
extern

Definition at line 108 of file pcstat.c.

◆ udpstats

struct udpstat udpstats
extern

Definition at line 100 of file pcstat.c.


Watt-32 tcp/ip: E:/WATT/src/pctcp.c File Reference

  • src
Data Structures | Functions | Variables
pctcp.c File Reference

Go to the source code of this file.

Data Structures

struct | ip6_packet
struct | tcp_pkt
struct | tcp6_pkt

Functions

W32_CLANG_PACK_WARN_OFF () struct ip4_packet
W32_CLANG_PACK_WARN_DEF () void *(MS_CDECL *_bsd_socket_hook)(enum BSD_SOCKET_OPS op
This hook is to prevent the BSD-socket API being linked in by default.
static _tcp_Socket * | tcp_findseq (const in_Header *ip, const tcp_Header *tcp)
Find the TCP socket that matches the tripplet: DESTADDR=MYADDR, DESTPORT=MYPORT and ACKNUM=SEQNUM+1 Can only be one socket.
static void | tcp_sockreset (_tcp_Socket *s, BOOL proxy)
Resets a TCP connection.
static void | tcp_no_arp (_tcp_Socket *s)
Called for a TCP socket when ARP lookup fails.
static void | tcp_rtt_win (_tcp_Socket *s)
Update retransmission timer, VJ algorithm and TCP windows.
static void | tcp_upd_win (_tcp_Socket *s, unsigned line)
Check if receive window needs an update.
static BOOL | tcp_checksum (const in_Header *ip, const tcp_Header *tcp, int len)
Verify the TCP header checksum.
static void | udp_close (const _udp_Socket *udp)
Since UDP is stateless, simply reclaim the local-port and unthread the socket from the list.
static | void (W32_CALL *system_yield)(void)
int | _udp_listen (_udp_Socket *s, WORD lport, DWORD ip, WORD port)
Implementation for udp_listen() and udp_open().
int W32_CALL | udp_listen (_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP passive open.
int | _udp_open (_udp_Socket *s, WORD lport, DWORD ip, WORD port)
Implementation for udp_open(), also used by BSD connect().
int W32_CALL | udp_open (_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP active open.
int W32_CALL | udp_SetTTL (_udp_Socket *s, BYTE ttl)
Set the TTL on an outgoing UDP datagram.
int W32_CALL | tcp_open (_tcp_Socket *s, WORD lport, DWORD ip, WORD rport, ProtoHandler handler)
Actively open a TCP connection.
int W32_CALL | tcp_listen (_tcp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler, WORD timeout)
Passively opens TCP a connection.
void | _tcp_close (_tcp_Socket *s)
Close a TCP connection.
_tcp_Socket * | _tcp_abort (_tcp_Socket *s, const char *file, unsigned line)
Abort a TCP connection.
int | _tcp_sendsoon (_tcp_Socket *s, const char *file, unsigned line)
Schedule a transmission pretty soon.
_tcp_Socket * | _tcp_unthread (_tcp_Socket *ds, BOOL free_tx)
Unthread a socket from the tcp socket list, if it's there.
int W32_CALL | tcp_established (const _tcp_Socket *s)
Returns 1 if TCP connection is established.
_tcp_Socket * | _tcp_handler (const in_Header *ip, BOOL broadcast)
The main TCP input handler.
static BOOL | udp_checksum (const in_Header *ip, const udp_Header *udp, int len)
Verify checksum for an UDP packet.
static _udp_Socket * | udp_demux (const in_Header *ip, BOOL ip_bcast, DWORD destin, WORD srcPort, WORD dstPort, BOOL *udp_err)
Demultiplexer for incoming UDP packets.
_udp_Socket * | _udp_handler (const in_Header *ip, BOOL broadcast)
Handler for incoming UDP packets.
void | tcp_Retransmitter (BOOL force)
Called periodically to perform retransmissions.
WORD W32_CALL | tcp_tick (sock_type *s)
Must be called periodically by user application (or BSD socket API).
static int | udp_write (_udp_Socket *s, const BYTE *data, int len)
Write an UDP packet.
static int | udp_read (_udp_Socket *s, BYTE *buf, int maxlen)
Read from UDP socket.
static void | sock_reduce_mss (sock_type *s, WORD MTU)
Reduce socket MSS upon receiving ICMP_UNREACH_NEEDFRAG.
void | _udp_cancel (const in_Header *ip, int icmp_type, int icmp_code, const char *msg, const void *arg)
Cancel an UDP socket.
static BOOL | tcp_stress_test (_tcp_Socket *s, const char *msg)
void | _tcp_cancel (const in_Header *ip, int icmp_type, int icmp_code, const char *msg, const void *arg)
Cancel a TCP socket.
static int | tcp_read (_tcp_Socket *s, BYTE *buf, int maxlen)
Read from a TCP socket.
static int | tcp_write (_tcp_Socket *s, const BYTE *data, UINT len)
Write data to a TCP connection.
static __inline int | tcp_opt_maxsegment (const _tcp_Socket *s, BYTE *opt)
TCP option routines.
static __inline int | tcp_opt_timestamp (_tcp_Socket *s, BYTE *opt, DWORD ts_echo)
Insert TimeStamp option.

Variables

char | hostname [MAX_HOSTLEN+1] = "random-pc"
Our configured hostname.
unsigned | _mss = ETH_MAX_DATA - TCP_OVERHEAD
unsigned | _mtu = ETH_MAX_DATA
BOOL | mtu_discover = 0
BOOL | mtu_blackhole = 0
BOOL | block_tcp = 0
when application handles TCP itself
BOOL | block_udp = 0
when application handles UDP itself
BOOL | block_icmp = 0
when application handles ICMP itself
BOOL | block_ip = 0
when application handles IP itself
DWORD | my_ip_addr = 0L
our IP address
DWORD | sin_mask = 0xFFFFFF00L
our net-mask, 255.255.255.0
_udp_Socket * | _udp_allsocs = NULL
list of udp-sockets
unsigned | tcp_OPEN_TO = DEF_OPEN_TO
TCP timer values.
unsigned | tcp_CLOSE_TO = DEF_CLOSE_TO
Default close timeout.
unsigned | tcp_RTO_ADD = DEF_RTO_ADD
Time added in RTO calculation.
unsigned | tcp_RTO_BASE = DEF_RTO_BASE
Base time for RTO calculation.
unsigned | tcp_RTO_SCALE = DEF_RTO_SCALE
Scaling used in RTO calculation.
unsigned | tcp_RST_TIME = DEF_RST_TIME
Don't generate RST too often.
unsigned | tcp_RETRAN_TIME = DEF_RETRAN_TIME
Default retransmission time.
unsigned | tcp_MAX_VJSA = DEF_MAX_VJSA
Default max VJ std.
unsigned | tcp_MAX_VJSD = DEF_MAX_VJSD
Default max VJ std.
BOOL | tcp_opt_ts = FALSE
TCP option config flags (RFC 1323).
BOOL | tcp_opt_wscale = FALSE
BOOL | tcp_opt_sack = FALSE
BOOL | tcp_nagle = TRUE
Misc TCP values.
unsigned | tcp_keep_idle = 2*60
idle time before sending keepalive
unsigned | tcp_keep_intvl = 30
time between keepalive probes
unsigned | tcp_max_idle = 60
max idle time before kill
DWORD | tcp_recv_win = DEF_RECV_WIN
RWIN for BSD sockets only.
_tcp_Socket * | _tcp_allsocs = NULL
list of tcp-sockets
static BYTE * | sign_opt
Prepare to insert MD5 option.

Detailed Description

Main TCP handler.

PCTCP, the true worker of Waterloo TCP.

  • contains all opens, closes, major read/write routines and basic IP handler for incomming packets
  • Note: much of the TCP/UDP/IP layering is done at the data structure level, not in separate routines or tasks

Definition in file pctcp.c.

Function Documentation

◆ _tcp_abort()

_tcp_Socket * _tcp_abort | ( | _tcp_Socket * | s,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Abort a TCP connection.

Definition at line 522 of file pctcp.c.

References _tcp_unthread(), tcp_Socket::flags, tcp_Socket::rtt_time, tcp_Socket::state, tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ _tcp_cancel()

void _tcp_cancel | ( | const in_Header * | ip,
 |  | int | icmp_type,
 |  | int | icmp_code,
 |  | const char * | msg,
 |  | const void * | arg
 | ) |  |

Cancel a TCP socket.

Called upon receiving ICMP errors: host/port UNREACH, REDIRECT, SOURCEQUENCH, TIMXCEED or PARAMPROB. See icmp_redirect() or icmp_handler().

Note: 'ip' is a small copy of the IP-packet originating the ICMP message. We may not have received a copy of the original TCP-header. But we probably won't do any harm if got less TCP-header data than needed. I.e. src_port/dst_port will be zero.

Definition at line 1734 of file pctcp.c.

References _arp_resolve(), _ip_recursion, _tcp_allsocs, tcp_Socket::cwindow, tcp_Socket::next, tcp_Socket::rto, sock_reduce_mss(), tcp_Socket::state, tcp_Socket::vj_sa, tcp_Socket::vj_sd, and tcp_Socket::wwindow.

◆ _tcp_close()

void _tcp_close ( _tcp_Socket * s )

Close a TCP connection.

Send a FIN on a particular port – only works if it is open. Must still allow receives.

Definition at line 471 of file pctcp.c.

References _tcp_unthread(), tcp_Socket::flags, tcp_Socket::rtt_time, set_timeout(), tcp_Socket::state, tcp_Socket::timeout, tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ _tcp_handler()

_tcp_Socket * _tcp_handler | ( | const in_Header * | ip,
 |  | BOOL | broadcast
 | ) |  |

The main TCP input handler.

All TCP input processing is done from here.

Definition at line 649 of file pctcp.c.

References _ip6_tcp_checksum(), _tcp_allsocs, tcp_Socket::adv_win, block_tcp, tcp_Socket::his6addr, tcp_Socket::inactive_to, tcp_Socket::my6addr, tcp_Socket::next, tcp_Socket::recv_next, tcp_Socket::safetysig, tcp_Socket::safetytcp, set_timeout(), tcp_checksum(), tcp_findseq(), tcp_rtt_win(), tcp_sockreset(), and tcp_Socket::unhappy.

◆ _tcp_sendsoon()

int _tcp_sendsoon | ( | _tcp_Socket * | s,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Schedule a transmission pretty soon.

This one has an imperfection at midnight, but it is not significant to the connection performance.

Note
gv: Added - 5 May 2000: Relax retransmission period to tcp_CLOSE_TO when CLOSEWT state is entered.
Relax retransmission period to tcp_OPEN_TO in SYNSENT state.

Definition at line 563 of file pctcp.c.

References cmp_timers(), tcp_Socket::karn_count, tcp_Socket::recent, tcp_Socket::rto, tcp_Socket::rtt_time, set_timeout(), tcp_Socket::state, tcp_CLOSE_TO, tcp_OPEN_TO, tcp_RTO_BASE, tcp_RTO_SCALE, tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ _tcp_unthread()

_tcp_Socket * _tcp_unthread | ( | _tcp_Socket * | ds,
 |  | BOOL | free_tx
 | ) |  |

Unthread a socket from the tcp socket list, if it's there.

Free Tx-buffer if set in tcp_set_window().

Definition at line 602 of file pctcp.c.

References _tcp_allsocs, tcp_Socket::next, tcp_Socket::state, tcp_Socket::tx_buf, tcp_Socket::tx_data, and tcp_Socket::tx_datalen.

◆ _udp_cancel()

void _udp_cancel | ( | const in_Header * | ip,
 |  | int | icmp_type,
 |  | int | icmp_code,
 |  | const char * | msg,
 |  | const void * | arg
 | ) |  |

Cancel an UDP socket.

Called upon receiving ICMP errors: REDIRECT, TIMXCEED, PARAMPROB, or host/port UNREACH. See icmp_redirect() or icmp_handler().

Definition at line 1628 of file pctcp.c.

References _arp_resolve(), _ip_recursion, _udp_allsocs, sock_reduce_mss(), and udp_close().

◆ _udp_handler()

_udp_Socket * _udp_handler | ( | const in_Header * | ip,
 |  | BOOL | broadcast
 | ) |  |

Handler for incoming UDP packets.

Definition at line 1042 of file pctcp.c.

References _ip6_udp_checksum(), icmp_send_unreach(), my_ip_addr, udp_checksum(), and udp_demux().

◆ _udp_listen()

int _udp_listen | ( | _udp_Socket * | s,
 |  | WORD | lport,
 |  | DWORD | ip,
 |  | WORD | port
 | ) |  |

Implementation for udp_listen() and udp_open().

Definition at line 158 of file pctcp.c.

References _default_ttl, _eth_is_init, _udp_allsocs, and my_ip_addr.

◆ _udp_open()

int _udp_open | ( | _udp_Socket * | s,
 |  | WORD | lport,
 |  | DWORD | ip,
 |  | WORD | port
 | ) |  |

Implementation for udp_open(), also used by BSD connect().

Definition at line 214 of file pctcp.c.

References _arp_resolve(), _inet_ntoa(), _udp_listen(), sin_mask, and udp_close().

◆ sock_reduce_mss()

static void sock_reduce_mss | ( | sock_type * | s,
 |  | WORD | MTU
 | ) |  |
static

Reduce socket MSS upon receiving ICMP_UNREACH_NEEDFRAG.

'MTU' is next-hop suggested MTU or 0 if router doesn't support RFC-1191.

Definition at line 1599 of file pctcp.c.

References _inet_ntoa(), and tcp_Socket::max_seg.

◆ tcp_checksum()

static BOOL tcp_checksum | ( | const in_Header * | ip,
 |  | const tcp_Header * | tcp,
 |  | int | len
 | ) |  |
static

Verify the TCP header checksum.

Note
Not used for IPv6.

Definition at line 2034 of file pctcp.c.

◆ tcp_established()

int W32_CALL tcp_established ( const _tcp_Socket * s )

Returns 1 if TCP connection is established.

Definition at line 639 of file pctcp.c.

References tcp_Socket::state.

◆ tcp_findseq()

static _tcp_Socket * tcp_findseq | ( | const in_Header * | ip,
 |  | const tcp_Header * | tcp
 | ) |  |
static

Find the TCP socket that matches the tripplet: DESTADDR=MYADDR, DESTPORT=MYPORT and ACKNUM=SEQNUM+1 Can only be one socket.

Definition at line 1936 of file pctcp.c.

References _tcp_allsocs, tcp_Socket::next, and tcp_Socket::send_next.

◆ tcp_listen()

int W32_CALL tcp_listen | ( | _tcp_Socket * | s,
 |  | WORD | lport,
 |  | DWORD | ip,
 |  | WORD | port,
 |  | ProtoHandler | handler,
 |  | WORD | timeout
 | ) |  |

Passively opens TCP a connection.

Listen for a connection on a particular port

<

Todo:
use mss from setsockopt()

Definition at line 407 of file pctcp.c.

References _default_ttl, _eth_is_init, _inet_ntoa(), _tcp_allsocs, _tcp_unthread(), tcp_Socket::cwindow, tcp_Socket::max_seg, tcp_Socket::max_tx_data, tcp_Socket::next, tcp_Socket::rx_buf, tcp_Socket::safetysig, tcp_Socket::safetytcp, tcp_Socket::send_next, set_timeout(), tcp_Socket::state, tcp_nagle, tcp_Socket::timeout, tcp_Socket::tx_buf, tcp_Socket::tx_data, tcp_Socket::unhappy, tcp_Socket::vj_sa, and tcp_Socket::wwindow.

◆ tcp_no_arp()

static void tcp_no_arp ( _tcp_Socket * s )
static

Called for a TCP socket when ARP lookup fails.

If socket allocated by BSD API, do a read wakeup on it.

Definition at line 2011 of file pctcp.c.

◆ tcp_open()

int W32_CALL tcp_open | ( | _tcp_Socket * | s,
 |  | WORD | lport,
 |  | DWORD | ip,
 |  | WORD | rport,
 |  | ProtoHandler | handler
 | ) |  |

Actively open a TCP connection.

Make connection to a particular destination. Not used for IPv6 (see _TCP6_open()).

Return values
0 on error. 's->err_msg' filled.
Note
'lport' is local port to associate with the connection.
'rport' is remote port for same connection.

<

Todo:
use mss from setsockopt()
Todo:
use TCP_NODELAY set in setsockopt()

Definition at line 328 of file pctcp.c.

References _arp_start_lookup(), _default_ttl, _eth_is_init, _inet_ntoa(), _tcp_allsocs, _tcp_unthread(), tcp_Socket::cwindow, tcp_Socket::flags, tcp_Socket::max_seg, tcp_Socket::max_tx_data, my_ip_addr, tcp_Socket::next, tcp_Socket::rto, tcp_Socket::rx_buf, tcp_Socket::safetysig, tcp_Socket::safetytcp, tcp_Socket::send_next, tcp_Socket::state, tcp_nagle, tcp_OPEN_TO, tcp_Socket::tx_buf, tcp_Socket::tx_data, tcp_Socket::unhappy, tcp_Socket::vj_sa, and tcp_Socket::wwindow.

◆ tcp_opt_maxsegment()

static __inline int tcp_opt_maxsegment | ( | const _tcp_Socket * | s,
 |  | BYTE * | opt
 | ) |  |
static

TCP option routines.

Note
Each of these MUST add multiple of 4 bytes of options. Insert MSS option.

Definition at line 2170 of file pctcp.c.

References tcp_Socket::max_seg.

◆ tcp_opt_timestamp()

static __inline int tcp_opt_timestamp | ( | _tcp_Socket * | s,
 |  | BYTE * | opt,
 |  | DWORD | ts_echo
 | ) |  |
static

Insert TimeStamp option.

nmap uses TSval (ts_now) as indication of uptime, so send

of msec since started.

Definition at line 2183 of file pctcp.c.

References set_timeout(), start_time, and tcp_Socket::ts_sent.

◆ tcp_read()

static int tcp_read | ( | _tcp_Socket * | s,
 |  | BYTE * | buf,
 |  | int | maxlen
 | ) |  |
static

Read from a TCP socket.

  • buf where to put data.
    Note
    does large buffering.

Definition at line 1825 of file pctcp.c.

References _tcp_close(), tcp_Socket::missed_seq, tcp_Socket::recv_next, tcp_Socket::state, and tcp_upd_win().

◆ tcp_Retransmitter()

void tcp_Retransmitter ( BOOL force )

Called periodically to perform retransmissions.

  • if 'force == 1' do it now.

< dup ACK counter ?

<

Todo:
set "Slow-start" threshold

<

Todo:
Allow for 3 SYN before giving up

Definition at line 1218 of file pctcp.c.

References _arp_lookup(), _arp_lookup_pending(), _tcp_allsocs, _tcp_unthread(), chk_timeout(), get_timediff(), tcp_Socket::next, tcp_Socket::rtt_time, set_timeout(), tcp_Socket::state, tcp_no_arp(), tcp_OPEN_TO, tcp_RETRAN_TIME, and tcp_Socket::timeout.

◆ tcp_rtt_win()

static void tcp_rtt_win ( _tcp_Socket * s )
static

Update retransmission timer, VJ algorithm and TCP windows.

Only called after we received something on socket.

Todo:
Use the threshold to signify "end-of-Slow-Start" (equilibrium)

Definition at line 2058 of file pctcp.c.

References chk_timeout(), cmp_timers(), tcp_Socket::cwindow, tcp_Socket::datatimer, get_timediff(), tcp_Socket::karn_count, tcp_Socket::max_seg, tcp_Socket::rto, tcp_Socket::rtt_time, tcp_Socket::send_una, set_timeout(), tcp_MAX_VJSA, tcp_MAX_VJSD, tcp_RTO_ADD, tcp_RTO_BASE, tcp_Socket::ts_echo, tcp_Socket::ts_sent, tcp_Socket::vj_last, tcp_Socket::vj_sa, tcp_Socket::vj_sd, and tcp_Socket::wwindow.

◆ tcp_sockreset()

static void tcp_sockreset | ( | _tcp_Socket * | s,
 |  | BOOL | proxy
 | ) |  |
static

Resets a TCP connection.

Definition at line 1957 of file pctcp.c.

References _tcp_unthread(), tcp_Socket::cwindow, tcp_Socket::datatimer, tcp_Socket::inactive_to, tcp_Socket::karn_count, tcp_Socket::missed_seq, tcp_Socket::rtt_time, tcp_Socket::state, tcp_Socket::timeout, tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ tcp_stress_test()

static BOOL tcp_stress_test | ( | _tcp_Socket * | s,
 |  | const char * | msg
 | ) |  |
static

Definition at line 1709 of file pctcp.c.

◆ tcp_tick()

WORD W32_CALL tcp_tick ( sock_type * s )

Must be called periodically by user application (or BSD socket API).

  • if 's != NULL', check this socket for timeout.
  • if 's == NULL', check all sockets in list.
Return values
0 | if 's' is non-NULL and 's' closes.
!0 | if 's' is NULL or 's' is still open.

Don't enter this loop if reentered. That could return the same packet twice (before we call _eth_free() on the 1st packet).

Todo:
Limit the time spent here (clamp # of loops)

Definition at line 1395 of file pctcp.c.

References _arp_handler(), _eth_arrived(), _eth_free(), _ip4_handler(), _rarp_handler(), _tcp_unthread(), pppoe_handler(), tcp_Socket::state, and tcp_Retransmitter().

◆ tcp_upd_win()

static void tcp_upd_win | ( | _tcp_Socket * | s,
 |  | unsigned | line
 | ) |  |
static

Check if receive window needs an update.

Definition at line 2151 of file pctcp.c.

◆ tcp_write()

static int tcp_write | ( | _tcp_Socket * | s,
 |  | const BYTE * | data,
 |  | UINT | len
 | ) |  |
static

Write data to a TCP connection.

Return values
>0 | Number of bytes written.
0 | Connection is not established.
-1 | Error in lower layer.

Definition at line 1871 of file pctcp.c.

References tcp_Socket::datatimer, tcp_Socket::flags, tcp_Socket::max_seg, tcp_Socket::max_tx_data, tcp_Socket::send_una, set_timeout(), tcp_Socket::state, tcp_Socket::tx_data, tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ udp_checksum()

static BOOL udp_checksum | ( | const in_Header * | ip,
 |  | const udp_Header * | udp,
 |  | int | len
 | ) |  |
static

Verify checksum for an UDP packet.

Definition at line 850 of file pctcp.c.

◆ udp_close()

static void udp_close ( const _udp_Socket * s )
static

Since UDP is stateless, simply reclaim the local-port and unthread the socket from the list.

Definition at line 287 of file pctcp.c.

References _udp_allsocs.

◆ udp_demux()

static _udp_Socket * udp_demux | ( | const in_Header * | ip,
 |  | BOOL | ip_bcast,
 |  | DWORD | destin,
 |  | WORD | srcPort,
 |  | WORD | dstPort,
 |  | BOOL * | udp_err
 | ) |  |
static

Demultiplexer for incoming UDP packets.

Don't debug packet if no match was found (except if '*udp_err').

Demux to active sockets.

Todo:
use some kind of hashing to speed up the search.

Definition at line 875 of file pctcp.c.

References _udp_allsocs, and sin_mask.

◆ udp_listen()

int W32_CALL udp_listen | ( | _udp_Socket * | s,
 |  | WORD | lport,
 |  | DWORD | ip,
 |  | WORD | port,
 |  | ProtoHandler | handler
 | ) |  |

UDP passive open.

Listen for a connection on a particular port.

Definition at line 190 of file pctcp.c.

References _udp_listen(), and udp_close().

◆ udp_open()

int W32_CALL udp_open | ( | _udp_Socket * | s,
 |  | WORD | lport,
 |  | DWORD | ip,
 |  | WORD | port,
 |  | ProtoHandler | handler
 | ) |  |

UDP active open.

Open a connection on a particular port.

Definition at line 262 of file pctcp.c.

References _udp_open(), and udp_close().

◆ udp_read()

static int udp_read | ( | _udp_Socket * | s,
 |  | BYTE * | buf,
 |  | int | maxlen
 | ) |  |
static

Read from UDP socket.

  • buf where data is put.
  • maxlen read max this amount.
    Note
    does large buffering.

Definition at line 1574 of file pctcp.c.

◆ udp_SetTTL()

int W32_CALL udp_SetTTL | ( | _udp_Socket * | s,
 |  | BYTE | ttl
 | ) |  |

Set the TTL on an outgoing UDP datagram.

Definition at line 309 of file pctcp.c.

◆ udp_write()

static int udp_write | ( | _udp_Socket * | s,
 |  | const BYTE * | data,
 |  | int | len
 | ) |  |
static

Write an UDP packet.

Note
Assumes data fits in one datagram, else only the first fragment will be sent! Because MTU is used for splits, the guaranteed max data size is 'MTU - UDP_OVERHEAD = 548' for a non-fragmented datagram. Routers should handle at least 576 bytes datagrams.

Definition at line 1496 of file pctcp.c.

References _default_tos, _eth_formatpacket(), _ip6_checksum(), and _pktserial.

◆ W32_CLANG_PACK_WARN_DEF()

W32_CLANG_PACK_WARN_DEF ( )

This hook is to prevent the BSD-socket API being linked in by default.

It is only set from the BSD functions when needed.

Definition at line 260 of file pcsed.h.

◆ W32_CLANG_PACK_WARN_OFF()

W32_CLANG_PACK_WARN_OFF ( )

Definition at line 74 of file pctcp.c.

Variable Documentation

◆ _mss

unsigned _mss = ETH_MAX_DATA - TCP_OVERHEAD

Definition at line 60 of file pctcp.c.

◆ _mtu

unsigned _mtu = ETH_MAX_DATA

Definition at line 61 of file pctcp.c.

◆ _tcp_allsocs

_tcp_Socket* _tcp_allsocs = NULL

list of tcp-sockets

Definition at line 140 of file pctcp.c.

◆ _udp_allsocs

_udp_Socket* _udp_allsocs = NULL

list of udp-sockets

Definition at line 72 of file pctcp.c.

◆ block_icmp

BOOL block_icmp = 0

when application handles ICMP itself

Definition at line 66 of file pctcp.c.

◆ block_ip

BOOL block_ip = 0

when application handles IP itself

Definition at line 67 of file pctcp.c.

◆ block_tcp

BOOL block_tcp = 0

when application handles TCP itself

Definition at line 64 of file pctcp.c.

◆ block_udp

BOOL block_udp = 0

when application handles UDP itself

Definition at line 65 of file pctcp.c.

◆ hostname

char hostname[MAX_HOSTLEN+1] = "random-pc"

Our configured hostname.

Not the FQDN.

Definition at line 58 of file pctcp.c.

◆ mtu_blackhole

BOOL mtu_blackhole = 0
Todo:
Add PMTU blackhole detection

Definition at line 63 of file pctcp.c.

◆ mtu_discover

BOOL mtu_discover = 0
Todo:
Add PMTU discovery method

Definition at line 62 of file pctcp.c.

◆ my_ip_addr

DWORD my_ip_addr = 0L

our IP address

Definition at line 69 of file pctcp.c.

◆ sign_opt

BYTE* sign_opt
static

Prepare to insert MD5 option.

Definition at line 2204 of file pctcp.c.

◆ sin_mask

DWORD sin_mask = 0xFFFFFF00L

our net-mask, 255.255.255.0

Definition at line 70 of file pctcp.c.

◆ tcp_CLOSE_TO

unsigned tcp_CLOSE_TO = DEF_CLOSE_TO

Default close timeout.

Definition at line 117 of file pctcp.c.

◆ tcp_keep_idle

unsigned tcp_keep_idle = 2*60

idle time before sending keepalive

Definition at line 135 of file pctcp.c.

◆ tcp_keep_intvl

unsigned tcp_keep_intvl = 30

time between keepalive probes

Definition at line 136 of file pctcp.c.

◆ tcp_max_idle

unsigned tcp_max_idle = 60

max idle time before kill

Definition at line 137 of file pctcp.c.

◆ tcp_MAX_VJSA

unsigned tcp_MAX_VJSA = DEF_MAX_VJSA

Default max VJ std.

average

Definition at line 123 of file pctcp.c.

◆ tcp_MAX_VJSD

unsigned tcp_MAX_VJSD = DEF_MAX_VJSD

Default max VJ std.

deviation

Definition at line 124 of file pctcp.c.

◆ tcp_nagle

BOOL tcp_nagle = TRUE

Misc TCP values.

Nagle algo. is on globally

Definition at line 134 of file pctcp.c.

◆ tcp_OPEN_TO

unsigned tcp_OPEN_TO = DEF_OPEN_TO

TCP timer values.

Default open timeout

Definition at line 116 of file pctcp.c.

◆ tcp_opt_sack

BOOL tcp_opt_sack = FALSE

Definition at line 130 of file pctcp.c.

◆ tcp_opt_ts

BOOL tcp_opt_ts = FALSE

TCP option config flags (RFC 1323).

Definition at line 128 of file pctcp.c.

◆ tcp_opt_wscale

BOOL tcp_opt_wscale = FALSE

Definition at line 129 of file pctcp.c.

◆ tcp_recv_win

DWORD tcp_recv_win = DEF_RECV_WIN

RWIN for BSD sockets only.

Definition at line 138 of file pctcp.c.

◆ tcp_RETRAN_TIME

unsigned tcp_RETRAN_TIME = DEF_RETRAN_TIME

Default retransmission time.

Definition at line 122 of file pctcp.c.

◆ tcp_RST_TIME

unsigned tcp_RST_TIME = DEF_RST_TIME

Don't generate RST too often.

Definition at line 121 of file pctcp.c.

◆ tcp_RTO_ADD

unsigned tcp_RTO_ADD = DEF_RTO_ADD

Time added in RTO calculation.

Definition at line 118 of file pctcp.c.

◆ tcp_RTO_BASE

unsigned tcp_RTO_BASE = DEF_RTO_BASE

Base time for RTO calculation.

Definition at line 119 of file pctcp.c.

◆ tcp_RTO_SCALE

unsigned tcp_RTO_SCALE = DEF_RTO_SCALE

Scaling used in RTO calculation.

Definition at line 120 of file pctcp.c.


Watt-32 tcp/ip: E:/WATT/src/pctcp.h File Reference

  • src
Data Structures | Enumerations | Functions | Variables
pctcp.h File Reference

Go to the source code of this file.

Data Structures

struct tcp_rtt

Enumerations

enum BSD_SOCKET_OPS {
BSO_FIND_SOCK = 1 ,
BSO_SYN_CALLBACK ,
BSO_RST_CALLBACK ,
BSO_IP4_RAW ,
BSO_IP6_RAW ,
BSO_DEBUG
}

Functions

int | _udp_listen (_udp_Socket *s, WORD lport, DWORD ip, WORD port)
Implementation for udp_listen() and udp_open().
int | _udp_open (_udp_Socket *s, WORD lport, DWORD ip, WORD port)
Implementation for udp_open(), also used by BSD connect().
void | _udp_cancel (const in_Header *ip, int icmp_type, int icmp_code, const char *msg, const void *arg)
Cancel an UDP socket.
void | _tcp_cancel (const in_Header *ip, int icmp_type, int icmp_code, const char *msg, const void *arg)
Cancel a TCP socket.
void | _tcp_close (_tcp_Socket *s)
Close a TCP connection.
void | tcp_rtt_add (const _tcp_Socket *s, UINT rto, UINT MTU)
void | tcp_rtt_clr (const _tcp_Socket *s)
BOOL | tcp_rtt_get (const _tcp_Socket *s, UINT *rto, UINT *MTU)
int | _tcp_send (_tcp_Socket *s, const char *file, unsigned line)
int | _tcp_sendsoon (_tcp_Socket *s, const char *file, unsigned line)
Schedule a transmission pretty soon.
int | _tcp_keepalive (_tcp_Socket *s)
void | tcp_Retransmitter (BOOL force)
Called periodically to perform retransmissions.
_udp_Socket * | _udp_handler (const in_Header *ip, BOOL broadcast)
Handler for incoming UDP packets.
_tcp_Socket * | _tcp_handler (const in_Header *ip, BOOL broadcast)
The main TCP input handler.
_tcp_Socket * | _tcp_unthread (_tcp_Socket *s, BOOL free_tx)
Unthread a socket from the tcp socket list, if it's there.
_tcp_Socket * | _tcp_abort (_tcp_Socket *s, const char *file, unsigned line)
Abort a TCP connection.
int | _tcp_send_reset (_tcp_Socket *s, const in_Header *ip, const tcp_Header *tcp, const char *file, unsigned line)
void *MS_CDECL * | _bsd_socket_hook (enum BSD_SOCKET_OPS op,...)
WORD | init_localport (void)
Allocate the "lport_inuse" bit-array from heap.
WORD | find_free_port (WORD oldport, BOOL sleep_msl)
int | grab_localport (WORD port)
int | reuse_localport (WORD port)
int | maybe_reuse_localport (_tcp_Socket *s)

Variables

BOOL | mtu_discover
BOOL | mtu_blackhole
BOOL | use_rand_lport
BOOL | tcp_nagle
Misc TCP values.
BOOL | tcp_opt_ts
TCP option config flags (RFC 1323).
BOOL | tcp_opt_sack
BOOL | tcp_opt_wscale
char | hostname [MAX_HOSTLEN+1]
Our configured hostname.
_tcp_Socket * _tcp_allsocs
list of tcp-sockets
_udp_Socket * | _udp_allsocs
list of udp-sockets

Enumeration Type Documentation

◆ BSD_SOCKET_OPS

enum BSD_SOCKET_OPS

Definition at line 187 of file pctcp.h.

Function Documentation

◆ _tcp_abort()

_tcp_Socket * _tcp_abort | ( | _tcp_Socket * | s,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Abort a TCP connection.

Definition at line 522 of file pctcp.c.

References _tcp_unthread(), tcp_Socket::flags, tcp_Socket::rtt_time, tcp_Socket::state, tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ _tcp_cancel()

void _tcp_cancel | ( | const in_Header * | ip,
 |  | int | icmp_type,
 |  | int | icmp_code,
 |  | const char * | msg,
 |  | const void * | arg
 | ) |  |

Cancel a TCP socket.

Called upon receiving ICMP errors: host/port UNREACH, REDIRECT, SOURCEQUENCH, TIMXCEED or PARAMPROB. See icmp_redirect() or icmp_handler().

Note: 'ip' is a small copy of the IP-packet originating the ICMP message. We may not have received a copy of the original TCP-header. But we probably won't do any harm if got less TCP-header data than needed. I.e. src_port/dst_port will be zero.

Definition at line 1734 of file pctcp.c.

References _arp_resolve(), _ip_recursion, _tcp_allsocs, tcp_Socket::cwindow, tcp_Socket::next, tcp_Socket::rto, sock_reduce_mss(), tcp_Socket::state, tcp_Socket::vj_sa, tcp_Socket::vj_sd, and tcp_Socket::wwindow.

◆ _tcp_close()

void _tcp_close ( _tcp_Socket * s )

Close a TCP connection.

Send a FIN on a particular port – only works if it is open. Must still allow receives.

Definition at line 471 of file pctcp.c.

References _tcp_unthread(), tcp_Socket::flags, tcp_Socket::rtt_time, set_timeout(), tcp_Socket::state, tcp_Socket::timeout, tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ _tcp_handler()

_tcp_Socket * _tcp_handler | ( | const in_Header * | ip,
 |  | BOOL | broadcast
 | ) |  |

The main TCP input handler.

All TCP input processing is done from here.

Definition at line 649 of file pctcp.c.

References _ip6_tcp_checksum(), _tcp_allsocs, tcp_Socket::adv_win, block_tcp, tcp_Socket::his6addr, tcp_Socket::inactive_to, tcp_Socket::my6addr, tcp_Socket::next, tcp_Socket::recv_next, tcp_Socket::safetysig, tcp_Socket::safetytcp, set_timeout(), tcp_checksum(), tcp_findseq(), tcp_rtt_win(), tcp_sockreset(), and tcp_Socket::unhappy.

◆ _tcp_sendsoon()

int _tcp_sendsoon | ( | _tcp_Socket * | s,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Schedule a transmission pretty soon.

This one has an imperfection at midnight, but it is not significant to the connection performance.

Note
gv: Added - 5 May 2000: Relax retransmission period to tcp_CLOSE_TO when CLOSEWT state is entered.
Relax retransmission period to tcp_OPEN_TO in SYNSENT state.

Definition at line 563 of file pctcp.c.

References cmp_timers(), tcp_Socket::karn_count, tcp_Socket::recent, tcp_Socket::rto, tcp_Socket::rtt_time, set_timeout(), tcp_Socket::state, tcp_CLOSE_TO, tcp_OPEN_TO, tcp_RTO_BASE, tcp_RTO_SCALE, tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ _tcp_unthread()

_tcp_Socket * _tcp_unthread | ( | _tcp_Socket * | ds,
 |  | BOOL | free_tx
 | ) |  |

Unthread a socket from the tcp socket list, if it's there.

Free Tx-buffer if set in tcp_set_window().

Definition at line 602 of file pctcp.c.

References _tcp_allsocs, tcp_Socket::next, tcp_Socket::state, tcp_Socket::tx_buf, tcp_Socket::tx_data, and tcp_Socket::tx_datalen.

◆ _udp_cancel()

void _udp_cancel | ( | const in_Header * | ip,
 |  | int | icmp_type,
 |  | int | icmp_code,
 |  | const char * | msg,
 |  | const void * | arg
 | ) |  |

Cancel an UDP socket.

Called upon receiving ICMP errors: REDIRECT, TIMXCEED, PARAMPROB, or host/port UNREACH. See icmp_redirect() or icmp_handler().

Definition at line 1628 of file pctcp.c.

References _arp_resolve(), _ip_recursion, _udp_allsocs, sock_reduce_mss(), and udp_close().

◆ _udp_handler()

_udp_Socket * _udp_handler | ( | const in_Header * | ip,
 |  | BOOL | broadcast
 | ) |  |

Handler for incoming UDP packets.

Definition at line 1042 of file pctcp.c.

References _ip6_udp_checksum(), icmp_send_unreach(), my_ip_addr, udp_checksum(), and udp_demux().

◆ _udp_listen()

int _udp_listen | ( | _udp_Socket * | s,
 |  | WORD | lport,
 |  | DWORD | ip,
 |  | WORD | port
 | ) |  |

Implementation for udp_listen() and udp_open().

Definition at line 158 of file pctcp.c.

References _default_ttl, _eth_is_init, _udp_allsocs, and my_ip_addr.

◆ _udp_open()

int _udp_open | ( | _udp_Socket * | s,
 |  | WORD | lport,
 |  | DWORD | ip,
 |  | WORD | port
 | ) |  |

Implementation for udp_open(), also used by BSD connect().

Definition at line 214 of file pctcp.c.

References _arp_resolve(), _inet_ntoa(), _udp_listen(), sin_mask, and udp_close().

◆ find_free_port()

WORD find_free_port | ( | WORD | oldport,
 |  | BOOL | sleep_msl
 | ) |  |

Definition at line 72 of file ports.c.

◆ grab_localport()

int grab_localport ( WORD port )

Definition at line 148 of file ports.c.

◆ init_localport()

WORD init_localport ( void )

Allocate the "lport_inuse" bit-array from heap.

Return values
Highest usable port.
Todo:

Make empherical port range configurable.

Use some hashing technique to speed up find_free_port().

Definition at line 51 of file ports.c.

References exit_localport().

◆ maybe_reuse_localport()

int maybe_reuse_localport ( _tcp_Socket * s )

Definition at line 184 of file ports.c.

◆ reuse_localport()

int reuse_localport ( WORD port )

Definition at line 160 of file ports.c.

◆ tcp_Retransmitter()

void tcp_Retransmitter ( BOOL force )

Called periodically to perform retransmissions.

  • if 'force == 1' do it now.

< dup ACK counter ?

<

Todo:
set "Slow-start" threshold

<

Todo:
Allow for 3 SYN before giving up

Definition at line 1218 of file pctcp.c.

References _arp_lookup(), _arp_lookup_pending(), _tcp_allsocs, _tcp_unthread(), chk_timeout(), get_timediff(), tcp_Socket::next, tcp_Socket::rtt_time, set_timeout(), tcp_Socket::state, tcp_no_arp(), tcp_OPEN_TO, tcp_RETRAN_TIME, and tcp_Socket::timeout.

Variable Documentation

◆ _tcp_allsocs

_tcp_Socket* _tcp_allsocs
extern

list of tcp-sockets

Definition at line 140 of file pctcp.c.

◆ _udp_allsocs

_udp_Socket* _udp_allsocs
extern

list of udp-sockets

Definition at line 72 of file pctcp.c.

◆ hostname

char hostname[MAX_HOSTLEN+1]
extern

Our configured hostname.

Not the FQDN.

Definition at line 58 of file pctcp.c.

◆ mtu_blackhole

BOOL mtu_blackhole
extern
Todo:
Add PMTU blackhole detection

Definition at line 63 of file pctcp.c.

◆ mtu_discover

BOOL mtu_discover
extern
Todo:
Add PMTU discovery method

Definition at line 62 of file pctcp.c.

◆ tcp_nagle

BOOL tcp_nagle
extern

Misc TCP values.

Nagle algo. is on globally

Definition at line 134 of file pctcp.c.

◆ tcp_opt_sack

BOOL tcp_opt_sack
extern

Definition at line 130 of file pctcp.c.

◆ tcp_opt_ts

BOOL tcp_opt_ts
extern

TCP option config flags (RFC 1323).

Definition at line 128 of file pctcp.c.

◆ tcp_opt_wscale

BOOL tcp_opt_wscale
extern

Definition at line 129 of file pctcp.c.

◆ use_rand_lport

BOOL use_rand_lport
extern

Definition at line 33 of file ports.c.


Watt-32 tcp/ip: E:/WATT/src/ports.c File Reference

  • src
Functions | Variables
ports.c File Reference

Go to the source code of this file.

Functions

static void W32_CALL | exit_localport (void)
Free allocated memory.
WORD | init_localport (void)
Allocate the "lport_inuse" bit-array from heap.
WORD | find_free_port (WORD port, BOOL linger)
int | grab_localport (WORD port)
int | reuse_localport (WORD port)
int | maybe_reuse_localport (_tcp_Socket *s)

Variables

int | use_rand_lport = TRUE
static fd_set * | lport_inuse

Detailed Description

Handling of local ports used by UDP/TCP.

Moved from pctcp.c

Definition in file ports.c.

Function Documentation

◆ exit_localport()

static void W32_CALL exit_localport ( void )
static

Free allocated memory.

Definition at line 39 of file ports.c.

References _watt_fatal_error.

◆ find_free_port()

WORD find_free_port | ( | WORD | port,
 |  | BOOL | linger
 | ) |  |

Definition at line 72 of file ports.c.

◆ grab_localport()

int grab_localport ( WORD port )

Definition at line 130 of file ports.c.

◆ init_localport()

WORD init_localport ( void )

Allocate the "lport_inuse" bit-array from heap.

Return values
Highest usable port.
Todo:

Make empherical port range configurable.

Use some hashing technique to speed up find_free_port().

Definition at line 51 of file ports.c.

References exit_localport().

◆ maybe_reuse_localport()

int maybe_reuse_localport ( _tcp_Socket * s )

Definition at line 184 of file ports.c.

◆ reuse_localport()

int reuse_localport ( WORD port )

Definition at line 160 of file ports.c.

Variable Documentation

◆ lport_inuse

fd_set* lport_inuse
static

Definition at line 34 of file ports.c.

◆ use_rand_lport

int use_rand_lport = TRUE

Definition at line 33 of file ports.c.


Watt-32 tcp/ip: E:/WATT/src/powerpak.c File Reference

  • src
Functions | Variables
powerpak.c File Reference

Go to the source code of this file.

Functions

void *WINAPI | GetModuleHandleA (const char *module)
void *WINAPI | GetProcAddress (void *module, const char *func)
static | UINT (WINAPI *_AllocSelector)(UINT)
BOOL | powerpak_init (void)
WORD | dpmi_create_dos_selector (void)
int | dpmi_free_dos_selector (WORD sel)
void | ReadRealMem (void *dst, REALPTR rp, unsigned size)
void | WriteRealMem (REALPTR rp, const void *src, int size)
BYTE | _farpeekb (WORD sel, DWORD ofs)
WORD | _farpeekw (WORD sel, DWORD ofs)
DWORD | _farpeekl (WORD sel, DWORD ofs)
void | _farpokeb (WORD sel, DWORD ofs, BYTE val)
void | _farpokew (WORD sel, DWORD ofs, WORD val)
void | _farpokel (WORD sel, DWORD ofs, DWORD val)
int | dpmi_getvect (int intr, WORD *sel, DWORD *ofs)
int | dpmi_setvect (int intr, WORD sel, DWORD ofs)
static REALPTR | alloc_callback (void(*callback)(void), REAL_regs *regs)
REALPTR | dpmi_alloc_callback_retf (DPMI_callback *cb)
int | dpmi_free_callback_retf (DPMI_callback *cb)

Variables

int | _ostype
static BYTE | wrapper_code []

Detailed Description

A djgpp-like DOS memory interface for Borland's DOS extender (32rtm). Only Borland's BCC32 v4.5+ supported.

by G. Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o Nov 2002

Running PowerPak under plain DOS, the 32rtm extender tries to emulate a subset of the Win32 API. Running the same app. under Win32 uses the real Win32 API (from kernel32.dll etc.). Therefore we cannot use int386() etc., but must use native calls. This isn't finished yet (if at all possible).

Definition in file powerpak.c.

Function Documentation

◆ _farpeekb()

BYTE _farpeekb | ( | WORD | sel,
 |  | DWORD | ofs
 | ) |  |

Definition at line 152 of file powerpak.c.

◆ _farpeekl()

DWORD _farpeekl | ( | WORD | sel,
 |  | DWORD | ofs
 | ) |  |

Definition at line 178 of file powerpak.c.

◆ _farpeekw()

WORD _farpeekw | ( | WORD | sel,
 |  | DWORD | ofs
 | ) |  |

Definition at line 165 of file powerpak.c.

◆ _farpokeb()

void _farpokeb | ( | WORD | sel,
 |  | DWORD | ofs,
 |  | BYTE | val
 | ) |  |

Definition at line 191 of file powerpak.c.

◆ _farpokel()

void _farpokel | ( | WORD | sel,
 |  | DWORD | ofs,
 |  | DWORD | val
 | ) |  |

Definition at line 217 of file powerpak.c.

◆ _farpokew()

void _farpokew | ( | WORD | sel,
 |  | DWORD | ofs,
 |  | WORD | val
 | ) |  |

Definition at line 204 of file powerpak.c.

◆ alloc_callback()

static REALPTR alloc_callback | ( | void(*)(void) | callback,
 |  | REAL_regs * | regs
 | ) |  |
static

Definition at line 336 of file powerpak.c.

◆ dpmi_alloc_callback_retf()

REALPTR dpmi_alloc_callback_retf ( DPMI_callback * cb )

Definition at line 368 of file powerpak.c.

◆ dpmi_create_dos_selector()

WORD dpmi_create_dos_selector ( void )

Definition at line 57 of file powerpak.c.

◆ dpmi_free_callback_retf()

int dpmi_free_callback_retf ( DPMI_callback * cb )

Definition at line 408 of file powerpak.c.

◆ dpmi_free_dos_selector()

int dpmi_free_dos_selector ( WORD sel )

Definition at line 87 of file powerpak.c.

◆ dpmi_getvect()

int dpmi_getvect | ( | int | intr,
 |  | WORD * | sel,
 |  | DWORD * | ofs
 | ) |  |

Definition at line 230 of file powerpak.c.

◆ dpmi_setvect()

int dpmi_setvect | ( | int | intr,
 |  | WORD | sel,
 |  | DWORD | ofs
 | ) |  |

Definition at line 249 of file powerpak.c.

◆ powerpak_init()

BOOL powerpak_init ( void )

Definition at line 41 of file powerpak.c.

◆ ReadRealMem()

void ReadRealMem | ( | void * | dst,
 |  | REALPTR | rp,
 |  | unsigned | size
 | ) |  |

Definition at line 104 of file powerpak.c.

◆ WriteRealMem()

void WriteRealMem | ( | REALPTR | rp,
 |  | const void * | src,
 |  | int | size
 | ) |  |

Definition at line 128 of file powerpak.c.

Variable Documentation

◆ wrapper_code

BYTE wrapper_code[]
static

Definition at line 283 of file powerpak.c.


Watt-32 tcp/ip: E:/WATT/src/powerpak.h File Reference

  • src
Data Structures | Functions
powerpak.h File Reference

Go to the source code of this file.

Data Structures

struct | REAL_regs
struct | DPMI_callback

Functions

BOOL | powerpak_init (void)
WORD | dpmi_create_dos_selector (void)
int | dpmi_free_dos_selector (WORD sel)
int | dpmi_delete_memory_alias (void)
DWORD | dpmi_create_memory_alias (DWORD addr, DWORD len)
REALPTR | dpmi_alloc_callback_retf (DPMI_callback *cb)
int | dpmi_free_callback_retf (DPMI_callback *cb)
int | dpmi_getvect (int intr, WORD *sel, DWORD *ofs)
int | dpmi_setvect (int intr, WORD sel, DWORD ofs)
void | ReadRealMem (void *buf, REALPTR rp, unsigned len)
void | WriteRealMem (REALPTR rp, const void *src, int size)
BYTE | _farpeekb (WORD sel, DWORD ofs)
WORD | _farpeekw (WORD sel, DWORD ofs)
DWORD | _farpeekl (WORD sel, DWORD ofs)
void | _farpokeb (WORD sel, DWORD ofs, BYTE val)
void | _farpokew (WORD sel, DWORD ofs, WORD val)
void | _farpokel (WORD sel, DWORD ofs, DWORD val)

Function Documentation

◆ _farpeekb()

BYTE _farpeekb | ( | WORD | sel,
 |  | DWORD | ofs
 | ) |  |

Definition at line 152 of file powerpak.c.

◆ _farpeekl()

DWORD _farpeekl | ( | WORD | sel,
 |  | DWORD | ofs
 | ) |  |

Definition at line 178 of file powerpak.c.

◆ _farpeekw()

WORD _farpeekw | ( | WORD | sel,
 |  | DWORD | ofs
 | ) |  |

Definition at line 165 of file powerpak.c.

◆ _farpokeb()

void _farpokeb | ( | WORD | sel,
 |  | DWORD | ofs,
 |  | BYTE | val
 | ) |  |

Definition at line 191 of file powerpak.c.

◆ _farpokel()

void _farpokel | ( | WORD | sel,
 |  | DWORD | ofs,
 |  | DWORD | val
 | ) |  |

Definition at line 217 of file powerpak.c.

◆ _farpokew()

void _farpokew | ( | WORD | sel,
 |  | DWORD | ofs,
 |  | WORD | val
 | ) |  |

Definition at line 204 of file powerpak.c.

◆ dpmi_alloc_callback_retf()

REALPTR dpmi_alloc_callback_retf ( DPMI_callback * cb )

Definition at line 368 of file powerpak.c.

◆ dpmi_create_dos_selector()

WORD dpmi_create_dos_selector ( void )

Definition at line 57 of file powerpak.c.

◆ dpmi_free_callback_retf()

int dpmi_free_callback_retf ( DPMI_callback * cb )

Definition at line 408 of file powerpak.c.

◆ dpmi_free_dos_selector()

int dpmi_free_dos_selector ( WORD sel )

Definition at line 87 of file powerpak.c.

◆ dpmi_getvect()

int dpmi_getvect | ( | int | intr,
 |  | WORD * | sel,
 |  | DWORD * | ofs
 | ) |  |

Definition at line 230 of file powerpak.c.

◆ dpmi_setvect()

int dpmi_setvect | ( | int | intr,
 |  | WORD | sel,
 |  | DWORD | ofs
 | ) |  |

Definition at line 249 of file powerpak.c.

◆ powerpak_init()

BOOL powerpak_init ( void )

Definition at line 41 of file powerpak.c.

◆ ReadRealMem()

void ReadRealMem | ( | void * | buf,
 |  | REALPTR | rp,
 |  | unsigned | len
 | ) |  |

Definition at line 104 of file powerpak.c.

◆ WriteRealMem()

void WriteRealMem | ( | REALPTR | rp,
 |  | const void * | src,
 |  | int | size
 | ) |  |

Definition at line 128 of file powerpak.c.


Watt-32 tcp/ip: E:/WATT/src/ppp.c File Reference

  • src
Data Structures | Functions | Variables
ppp.c File Reference

Go to the source code of this file.

Data Structures

struct ppp_dispatch

Functions

static void | ipcp_addr_req (struct ppp_state *state, struct ppp_xcp *xcp, const struct xcp_type *tp, const BYTE *buf, int len)
static void | ipcp_addr_nak (struct ppp_state *state, struct ppp_xcp *xcp, const struct xcp_type *tp, const BYTE *buf, int len)
static void | ipcp_addr_show (struct ppp_state *state, struct ppp_xcp *xcp, const struct xcp_type *tp, const BYTE *buf, int len)
static void | send_event (struct ppp_state *state, struct ppp_xcp *xcp, enum ppp_event event)
static void | change_phase (struct ppp_state *state, enum ppp_phase phase)
static void | buffer_print (const char *verb, const BYTE *buf, int len)
static void | safe_string (const BYTE *bp, int len)
static void | option_show (const struct ppp_state *state, const struct ppp_xcp *xcp, const BYTE *bp, int rlen)
static void | show_packet (const char *inout, const struct ppp_state *state, const struct ppp_xcp *xcp, const BYTE *bp, int len)
static void | ppp_write (const struct ppp_state *state, const struct ppp_xcp *xcp, const BYTE *buf, int len)
static __inline BYTE * | setup_acpf (BYTE *buf, WORD proto)
static BYTE * | code_id (struct ppp_state *state, struct ppp_xcp *xcp, int code)
static BYTE * | code_reply (struct ppp_state *state, struct ppp_xcp *xcp, int code)
static struct option_state * | find_option (const struct ppp_xcp *xcp, int type)
static void | create_request (struct ppp_state *state, struct ppp_xcp *xcp)
static void | copy_peer_values (const struct ppp_state *state, struct ppp_xcp *xcp)
static void | dispatch_action (struct ppp_state *state, struct ppp_xcp *xcp, enum xcp_action act)
static void | check_timeouts (void)
void | ppp_input (const BYTE *inbuffer, WORD len)
The PPP input handler.
static void | set_reject (struct ppp_state *state, struct ppp_xcp *xcp, const BYTE *bp)
static void | set_nak (struct ppp_state *state, struct ppp_xcp *xcp, int type, int len, const BYTE *bp)
static int | validate_request (struct ppp_state *state, struct ppp_xcp *xcp)
static void | process_rcx (struct ppp_state *state, struct ppp_xcp *xcp, BYTE code)
static void | std_negotiation (struct ppp_state *state, struct ppp_xcp *xcp)
static void | init_xcp (const char *name, struct ppp_xcp *xcp, void(*deliver)(struct ppp_state *state, struct ppp_xcp *xcp), const struct xcp_type *types, int ntypes, WORD proto)
static void | set_option_value_lcl (struct ppp_xcp *xcp, int type, int value)
static void | set_option_value_rem (struct ppp_xcp *xcp, int type, int value)
void | ppp_start (int dbg_level)

Variables

static DWORD | remote_ip_base = 0x0A000000
static DWORD | remote_ip_mask = 0xFF000000
static int | debug = 0
static struct ppp_state | mystate
static const struct xcp_type | lcp_types []
static const struct xcp_type | ipcp_types []
static const struct ppp_dispatch | ppp_dispatch [10][16]
static const char * | ph_str []
static const char * | ev_str []
static const char * | st_str []
static const char * | ac_str []

Detailed Description

PPP tunneled over Ethernet (PPPOE_SESS_TYPE frames)

This implements just LCP and IPCP, and then only a subset of each of those. This is not supported and probably shouldn't be used for much more than simple experiments with PPP. If you need a real version of PPP, see Paul Mackerras' ppp-2.3. If you do try to use this, don't say I didn't warn you.

This code may be used for any purpose as long as the author's copyright is cited in any source code distributed. This code is also available electronically from the author's web site.

http://people.ne.mediaone.net/carlson/ppp

http://www.workingcode.com/ppp

Copyright 1997 by James Carlson and Working Code

Adapted for Watt-32's PPPoE extension by G. Vanem Aug-2000

Definition in file ppp.c.

Function Documentation

◆ buffer_print()

static void buffer_print | ( | const char * | verb,
 |  | const BYTE * | buf,
 |  | int | len
 | ) |  |
static

Definition at line 312 of file ppp.c.

◆ change_phase()

static void change_phase | ( | struct ppp_state * | state,
 |  | enum ppp_phase | phase
 | ) |  |
static

Definition at line 781 of file ppp.c.

◆ check_timeouts()

static void check_timeouts ( void )
static

Definition at line 812 of file ppp.c.

◆ code_id()

static BYTE * code_id | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp,
 |  | int | code
 | ) |  |
static

Definition at line 523 of file ppp.c.

◆ code_reply()

static BYTE * code_reply | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp,
 |  | int | code
 | ) |  |
static

Definition at line 538 of file ppp.c.

◆ copy_peer_values()

static void copy_peer_values | ( | const struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp
 | ) |  |
static

Definition at line 601 of file ppp.c.

◆ create_request()

static void create_request | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp
 | ) |  |
static

Definition at line 566 of file ppp.c.

◆ dispatch_action()

static void dispatch_action | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp,
 |  | enum xcp_action | act
 | ) |  |
static

Definition at line 636 of file ppp.c.

◆ find_option()

static struct option_state * find_option | ( | const struct ppp_xcp * | xcp,
 |  | int | type
 | ) |  |
static

Definition at line 552 of file ppp.c.

◆ init_xcp()

static void init_xcp | ( | const char * | name,
 |  | struct ppp_xcp * | xcp,
 |  | void(*)(struct ppp_state *state, struct ppp_xcp *xcp) | deliver,
 |  | const struct xcp_type * | types,
 |  | int | ntypes,
 |  | WORD | proto
 | ) |  |
static

Definition at line 1222 of file ppp.c.

◆ ipcp_addr_nak()

static void ipcp_addr_nak | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp,
 |  | const struct xcp_type * | tp,
 |  | const BYTE * | buf,
 |  | int | len
 | ) |  |
static

Definition at line 1284 of file ppp.c.

◆ ipcp_addr_req()

static void ipcp_addr_req | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp,
 |  | const struct xcp_type * | tp,
 |  | const BYTE * | buf,
 |  | int | len
 | ) |  |
static

Definition at line 1262 of file ppp.c.

◆ ipcp_addr_show()

static void ipcp_addr_show | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp,
 |  | const struct xcp_type * | tp,
 |  | const BYTE * | buf,
 |  | int | len
 | ) |  |
static

Definition at line 1297 of file ppp.c.

◆ option_show()

static void option_show | ( | const struct ppp_state * | state,
 |  | const struct ppp_xcp * | xcp,
 |  | const BYTE * | bp,
 |  | int | rlen
 | ) |  |
static

Definition at line 352 of file ppp.c.

◆ ppp_input()

void ppp_input | ( | const BYTE * | inbuffer,
 |  | WORD | len
 | ) |  |

The PPP input handler.

Definition at line 845 of file ppp.c.

References _ip4_handler().

◆ ppp_start()

void ppp_start ( int dbg_level )

Definition at line 1331 of file ppp.c.

◆ ppp_write()

static void ppp_write | ( | const struct ppp_state * | state,
 |  | const struct ppp_xcp * | xcp,
 |  | const BYTE * | buf,
 |  | int | len
 | ) |  |
static

Definition at line 486 of file ppp.c.

◆ process_rcx()

static void process_rcx | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp,
 |  | BYTE | code
 | ) |  |
static

Definition at line 1027 of file ppp.c.

◆ safe_string()

static void safe_string | ( | const BYTE * | bp,
 |  | int | len
 | ) |  |
static

Definition at line 330 of file ppp.c.

◆ send_event()

static void send_event | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp,
 |  | enum ppp_event | event
 | ) |  |
static

Definition at line 753 of file ppp.c.

◆ set_nak()

static void set_nak | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp,
 |  | int | type,
 |  | int | len,
 |  | const BYTE * | bp
 | ) |  |
static

Definition at line 954 of file ppp.c.

◆ set_option_value_lcl()

static void set_option_value_lcl | ( | struct ppp_xcp * | xcp,
 |  | int | type,
 |  | int | value
 | ) |  |
static

Definition at line 1312 of file ppp.c.

◆ set_option_value_rem()

static void set_option_value_rem | ( | struct ppp_xcp * | xcp,
 |  | int | type,
 |  | int | value
 | ) |  |
static

Definition at line 1323 of file ppp.c.

◆ set_reject()

static void set_reject | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp,
 |  | const BYTE * | bp
 | ) |  |
static

Definition at line 924 of file ppp.c.

◆ setup_acpf()

static __inline BYTE * setup_acpf | ( | BYTE * | buf,
 |  | WORD | proto
 | ) |  |
static

Definition at line 513 of file ppp.c.

◆ show_packet()

static void show_packet | ( | const char * | inout,
 |  | const struct ppp_state * | state,
 |  | const struct ppp_xcp * | xcp,
 |  | const BYTE * | bp,
 |  | int | len
 | ) |  |
static

Definition at line 405 of file ppp.c.

◆ std_negotiation()

static void std_negotiation | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp
 | ) |  |
static
Todo:
extract LCP_MRU option

Definition at line 1081 of file ppp.c.

◆ validate_request()

static int validate_request | ( | struct ppp_state * | state,
 |  | struct ppp_xcp * | xcp
 | ) |  |
static

Definition at line 979 of file ppp.c.

Variable Documentation

◆ ac_str

const char* ac_str[]
static
Initial value:
= {
"Null", "irc", "scr", "tls", "tlf", "str", "sta",
"sca", "scn", "scj", "tld", "tlu", "zrc", "ser"
}

Definition at line 304 of file ppp.c.

◆ debug

int debug = 0
static

Definition at line 61 of file ppp.c.

◆ ev_str

const char* ev_str[]
static
Initial value:
= {
"Up", "Down", "Open", "Close", "TO+", "TO-",
"RCR+", "RCR-", "RCA", "RCN", "RTR", "RTA",
"RUC", "RXJ+", "RXJ-", "RXR"
}

Definition at line 292 of file ppp.c.

◆ ipcp_types

const struct xcp_type ipcp_types[]
static
Initial value:
= {
{ "IP-Address", 3, 1, 6, 6, 0, ipcp_addr_req,
ipcp_addr_nak, ipcp_addr_show },
{ NULL, -1, 0, 0, 0, 0, NULL, NULL, NULL }
}

Definition at line 88 of file ppp.c.

◆ lcp_types

const struct xcp_type lcp_types[]
static
Initial value:
= {
{ NULL, -1, 0, 0, 0, 0, NULL, NULL, NULL }
}

Definition at line 84 of file ppp.c.

◆ mystate

struct ppp_state mystate
static

Definition at line 64 of file ppp.c.

◆ ph_str

const char* ph_str[]
static
Initial value:
= {
"Dead", "Establish", "Authenticate",
"Network", "Terminate"
}

Definition at line 287 of file ppp.c.

◆ remote_ip_base

DWORD remote_ip_base = 0x0A000000
static

Definition at line 59 of file ppp.c.

◆ remote_ip_mask

DWORD remote_ip_mask = 0xFF000000
static

Definition at line 60 of file ppp.c.

◆ st_str

const char* st_str[]
static
Initial value:
= {
"Initial", "Starting", "Closed", "Stopped",
"Closing", "Stopping", "Req-Sent", "Ack-Rcvd",
"Ack-Sent", "Opened", "No-Change"
}

Definition at line 298 of file ppp.c.


Watt-32 tcp/ip: E:/WATT/src/ppp.h File Reference

  • src
Data Structures | Typedefs | Enumerations | Functions
ppp.h File Reference

Go to the source code of this file.

Data Structures

struct | xcp_type
struct | option_state
struct | ppp_xcp
struct | ppp_state

Typedefs

typedef void(* | xcp_func) (struct ppp_state *state, struct ppp_xcp *xcp, const struct xcp_type *tp, const BYTE *buf, int len)
typedef void(* | ppp_func) (struct ppp_state *state, struct ppp_xcp *xcp)

Enumerations

enum ppp_phase {
phDead ,
phEstablish ,
phAuthenticate ,
phNetwork ,
phTerminate
}
enum ppp_event {
evUp ,
evDown ,
evOpen ,
evClose ,
evTOp ,
evTOm ,
evRCRp ,
evRCRm ,
evRCA ,
evRCN ,
evRTR ,
evRTA ,
evRUC ,
evRXJp ,
evRXJm ,
evRXR
}
enum xcp_state {
stInitial ,
stStarting ,
stClosed ,
stStopped ,
stClosing ,
stStopping ,
stReqSent ,
stAckRcvd ,
stAckSent ,
stOpened ,
stNoChange
}
enum xcp_action {
acNull ,
acIrc ,
acScr ,
acTls ,
acTlf ,
acStr ,
acSta ,
acSca ,
acScn ,
acScj ,
acTld ,
acTlu ,
acZrc ,
acSer
}
enum os_state {
osUsable ,
osUnusable
}
enum parse_state {
psOK ,
psNak ,
psRej ,
psBad
}

Functions

void | ppp_start (int debug)
void | ppp_input (const BYTE *inbuf, WORD len)
The PPP input handler.

Typedef Documentation

◆ ppp_func

typedef void(* ppp_func) (struct ppp_state *state, struct ppp_xcp *xcp)

Definition at line 68 of file ppp.h.

◆ xcp_func

typedef void(* xcp_func) (struct ppp_state *state, struct ppp_xcp *xcp, const struct xcp_type *tp, const BYTE *buf, int len)

Definition at line 63 of file ppp.h.

Enumeration Type Documentation

◆ os_state

enum os_state

Definition at line 85 of file ppp.h.

◆ parse_state

enum parse_state

Definition at line 109 of file ppp.h.

◆ ppp_event

enum ppp_event

Definition at line 23 of file ppp.h.

◆ ppp_phase

enum ppp_phase

Definition at line 16 of file ppp.h.

◆ xcp_action

enum xcp_action

Definition at line 39 of file ppp.h.

◆ xcp_state

enum xcp_state

Definition at line 31 of file ppp.h.

Function Documentation

◆ ppp_input()

void ppp_input | ( | const BYTE * | inbuf,
 |  | WORD | len
 | ) |  |

The PPP input handler.

Definition at line 845 of file ppp.c.

References _ip4_handler().

◆ ppp_start()

void ppp_start ( int debug )

Definition at line 1331 of file ppp.c.


Watt-32 tcp/ip: E:/WATT/src/pppoe.c File Reference

  • src
Enumerations | Functions | Variables
pppoe.c File Reference

Go to the source code of this file.

Enumerations

enum States {
STATE_NONE = 0 ,
STATE_DISCOVERY ,
STATE_SESSION
}

Functions

static | void (W32_CALL *prev_hook)(const char *
static int | pppoe_send_disc (int code)
Build and send a PADx (PPPoE Active Discovery) packet as link-layer broadcast or unicast.
static void W32_CALL | pppoe_config (const char *name, const char *value)
static BOOL | pppoe_wait (int wait_code)
Loop waiting for timeout or a PAD response.
static BOOL | pppoe_discovery (void)
The PPPoE Discovery handler.
void | pppoe_init (void)
Set config-parser hook and initial values.
int | pppoe_start (void)
Start PPPoE by doing a Discovery.
void | pppoe_exit (void)
Close down PPPoE by sending a PADT.
int | pppoe_handler (const pppoe_Packet *pkt)
Handle incoming PPPoE packets.
BOOL | pppoe_is_up (const void *dest)
Determine if we have a PPPoE session with the machine given by 'dest'.
static WORD | build_pad (struct pppoe_Packet *pkt, WORD code)
Build a PADx packet.
int | pppoe_send_sess (const void *sock, const BYTE *buf, WORD len)
Build and send a PPPoE Session packet (IPCP or LCP packet).
void * | pppoe_mac_format (union link_Packet *tx)
Build a PPPoE session packet header.

Variables

static const char *static BOOL | got_PADO = NULL
static BOOL | got_PADS
static BOOL | got_PADT
static BOOL | got_PADM
static WORD | session = 0
static enum States | state = STATE_NONE
static mac_address | ac_mac_addr
struct {
int enable
int trace
int timeout
int retries
int lcp_echo_intv
Not used. More...
char service_name [MAX_VALUELEN+1]
char user_name [MAX_VALUELEN+1]
char password [MAX_VALUELEN+1]
} cfg = { 0, 0, 1, 3, 60, "", "", "" }

Detailed Description

PPPoE (PPP-over-Ethernet) for Watt-32. Refer RFC-2516 for spec.

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Version

0.5 : Aug 07, 2001 : G. Vanem - created 0.6 : Aug 08, 2001 : Added extensions from draft-carrel-info-pppoe-ext-00.txt

Definition in file pppoe.c.

Enumeration Type Documentation

◆ States

enum States

Definition at line 60 of file pppoe.c.

Function Documentation

◆ build_pad()

static WORD build_pad | ( | struct pppoe_Packet * | pkt,
 |  | WORD | code
 | ) |  |
static

Build a PADx packet.

Definition at line 303 of file pppoe.c.

◆ pppoe_config()

static void W32_CALL pppoe_config | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Definition at line 89 of file pppoe.c.

◆ pppoe_discovery()

static BOOL pppoe_discovery ( void )
static

The PPPoE Discovery handler.

Send PAD Init, wait for PAD offer, send PAD Request and wait for PAD Session confirmation.

Definition at line 137 of file pppoe.c.

References pppoe_send_disc(), and pppoe_wait().

◆ pppoe_exit()

void pppoe_exit ( void )

Close down PPPoE by sending a PADT.

Definition at line 209 of file pppoe.c.

References _eth_brdcast, and pppoe_send_disc().

◆ pppoe_handler()

int pppoe_handler ( const pppoe_Packet * pkt )

Handle incoming PPPoE packets.

Definition at line 223 of file pppoe.c.

References _eth_addr, _eth_brdcast, _eth_mac_len, and ppp_input().

◆ pppoe_init()

void pppoe_init ( void )

Set config-parser hook and initial values.

Definition at line 166 of file pppoe.c.

References _eth_brdcast.

◆ pppoe_is_up()

BOOL pppoe_is_up ( const void * dest )

Determine if we have a PPPoE session with the machine given by 'dest'.

Can only have a session with the AC.

Definition at line 288 of file pppoe.c.

References _eth_mac_len.

◆ pppoe_mac_format()

void * pppoe_mac_format ( union link_Packet * tx )

Build a PPPoE session packet header.

Only called for IPv4 packets.

Definition at line 378 of file pppoe.c.

References _eth_addr, and _pkt_ip_ofs.

◆ pppoe_send_disc()

static int pppoe_send_disc ( int code )
static

Build and send a PADx (PPPoE Active Discovery) packet as link-layer broadcast or unicast.

Definition at line 333 of file pppoe.c.

References _eth_formatpacket(), _eth_send(), and build_pad().

◆ pppoe_send_sess()

int pppoe_send_sess | ( | const void * | sock,
 |  | const BYTE * | buf,
 |  | WORD | len
 | ) |  |

Build and send a PPPoE Session packet (IPCP or LCP packet).

Definition at line 358 of file pppoe.c.

References _eth_formatpacket(), and _eth_send().

◆ pppoe_start()

int pppoe_start ( void )

Start PPPoE by doing a Discovery.

Adjust MSS/MTU for PPPoE packets (8 byte less than normal DIX ethernet). Enter Session state and kick-start PPP (LCP/IPCP).

Todo:
Fix-me: The new MTU/MSS affects all connections (also those which doesn't use PPPoE framing).

Definition at line 184 of file pppoe.c.

References _pktdevclass, and pppoe_discovery().

◆ pppoe_wait()

static BOOL pppoe_wait ( int wait_code )
static

Loop waiting for timeout or a PAD response.

Blocks until some got_X flags are set in by pppoe_handler().

Definition at line 110 of file pppoe.c.

References chk_timeout(), and set_timeout().

Variable Documentation

◆ ac_mac_addr

mac_address ac_mac_addr
static

Definition at line 74 of file pppoe.c.

◆ enable

int enable

Definition at line 77 of file pppoe.c.

◆ got_PADM

BOOL got_PADM
static

Definition at line 71 of file pppoe.c.

◆ got_PADO

const char* static BOOL got_PADO = NULL
static

Definition at line 68 of file pppoe.c.

◆ got_PADS

BOOL got_PADS
static

Definition at line 69 of file pppoe.c.

◆ got_PADT

BOOL got_PADT
static

Definition at line 70 of file pppoe.c.

◆ lcp_echo_intv

int lcp_echo_intv

Not used.

Definition at line 81 of file pppoe.c.

◆ password

char password[MAX_VALUELEN+1]

Definition at line 84 of file pppoe.c.

◆ retries

int retries

Definition at line 80 of file pppoe.c.

◆ service_name

char service_name[MAX_VALUELEN+1]

Definition at line 82 of file pppoe.c.

◆ session

WORD session = 0
static

Definition at line 72 of file pppoe.c.

◆ state

enum States state = STATE_NONE
static

Definition at line 73 of file pppoe.c.

◆ timeout

int timeout

Definition at line 79 of file pppoe.c.

◆ trace

int trace

Definition at line 78 of file pppoe.c.

◆ user_name

char user_name[MAX_VALUELEN+1]
Todo:
PPP user/passwd not handled

Definition at line 83 of file pppoe.c.


Watt-32 tcp/ip: E:/WATT/src/pppoe.h File Reference

  • src
Functions
pppoe.h File Reference

Go to the source code of this file.

Functions

void | pppoe_init (void)
Set config-parser hook and initial values.
void | pppoe_exit (void)
Close down PPPoE by sending a PADT.
int | pppoe_start (void)
Start PPPoE by doing a Discovery.
int | pppoe_handler (const pppoe_Packet *pkt)
Handle incoming PPPoE packets.
BOOL | pppoe_is_up (const void *dest)
Determine if we have a PPPoE session with the machine given by 'dest'.
int | pppoe_send_sess (const void *sock, const BYTE *buf, WORD len)
Build and send a PPPoE Session packet (IPCP or LCP packet).
void * | pppoe_mac_format (union link_Packet *buf)
Build a PPPoE session packet header.

Function Documentation

◆ pppoe_exit()

void pppoe_exit ( void )

Close down PPPoE by sending a PADT.

Definition at line 209 of file pppoe.c.

References _eth_brdcast, and pppoe_send_disc().

◆ pppoe_handler()

int pppoe_handler ( const pppoe_Packet * pkt )

Handle incoming PPPoE packets.

Definition at line 223 of file pppoe.c.

References _eth_addr, _eth_brdcast, _eth_mac_len, and ppp_input().

◆ pppoe_init()

void pppoe_init ( void )

Set config-parser hook and initial values.

Definition at line 166 of file pppoe.c.

References _eth_brdcast.

◆ pppoe_is_up()

BOOL pppoe_is_up ( const void * dest )

Determine if we have a PPPoE session with the machine given by 'dest'.

Can only have a session with the AC.

Definition at line 288 of file pppoe.c.

References _eth_mac_len.

◆ pppoe_mac_format()

void * pppoe_mac_format ( union link_Packet * tx )

Build a PPPoE session packet header.

Only called for IPv4 packets.

Definition at line 378 of file pppoe.c.

References _eth_addr, and _pkt_ip_ofs.

◆ pppoe_send_sess()

int pppoe_send_sess | ( | const void * | sock,
 |  | const BYTE * | buf,
 |  | WORD | len
 | ) |  |

Build and send a PPPoE Session packet (IPCP or LCP packet).

Definition at line 358 of file pppoe.c.

References _eth_formatpacket(), and _eth_send().

◆ pppoe_start()

int pppoe_start ( void )

Start PPPoE by doing a Discovery.

Adjust MSS/MTU for PPPoE packets (8 byte less than normal DIX ethernet). Enter Session state and kick-start PPP (LCP/IPCP).

Todo:
Fix-me: The new MTU/MSS affects all connections (also those which doesn't use PPPoE framing).

Definition at line 184 of file pppoe.c.

References _pktdevclass, and pppoe_discovery().


Watt-32 tcp/ip: E:/WATT/src/presaddr.c File Reference

  • src
Functions
presaddr.c File Reference

Go to the source code of this file.

Functions

static const char * | inet_ntop4 (const u_char *src, char *dst, size_t size)
Format an IPv4 address, more or less like inet_ntoa().
static int | inet_pton4 (const char *src, u_char *dst)
Like inet_aton() but without all the hexadecimal and shorthand.
static const char * | inet_ntop6 (const u_char *src, char *dst, size_t size)
Convert IPv6 binary address into presentation (printable) format.
static int | inet_pton6 (const char *src, u_char *dst)
Convert presentation level address to network order binary form.
const char *W32_CALL | inet_ntop (int af, const void *src, char *dst, size_t size)
Convert a network format address to presentation format.
const char *W32_CALL | _w32_inet_ntop (int af, const void *src, char *dst, size_t size)
int W32_CALL | inet_pton (int af, const char *src, void *dst)
Convert from presentation format (which usually means ASCII printable) to network format (which is usually some kind of binary format).
int W32_CALL | _w32_inet_pton (int af, const char *src, void *dst)
int | main (void)
int | main (int argc, char **argv)

Detailed Description

Convert network addresses to printable format.

Definition in file presaddr.c.

Function Documentation

◆ _w32_inet_ntop()

const char *W32_CALL _w32_inet_ntop | ( | int | af,
 |  | const void * | src,
 |  | char * | dst,
 |  | size_t | size
 | ) |  |

Definition at line 59 of file presaddr.c.

◆ _w32_inet_pton()

int W32_CALL _w32_inet_pton | ( | int | af,
 |  | const char * | src,
 |  | void * | dst
 | ) |  |

Definition at line 89 of file presaddr.c.

◆ inet_ntop()

const char *W32_CALL inet_ntop | ( | int | af,
 |  | const void * | src,
 |  | char * | dst,
 |  | size_t | size
 | ) |  |

Convert a network format address to presentation format.

Return values
pointer | to presentation format address (‘dst’),
NULL | on error (see errno).
Author
Paul Vixie, 1996.

Definition at line 43 of file presaddr.c.

References inet_ntop4(), and inet_ntop6().

◆ inet_ntop4()

static const char * inet_ntop4 | ( | const u_char * | src,
 |  | char * | dst,
 |  | size_t | size
 | ) |  |
static

Format an IPv4 address, more or less like inet_ntoa().

Return values
`dst' (as a const)
Note
  • uses no statics
  • takes a u_char* not an in_addr as input
Author
Paul Vixie, 1996.

Definition at line 103 of file presaddr.c.

◆ inet_ntop6()

static const char * inet_ntop6 | ( | const u_char * | src,
 |  | char * | dst,
 |  | size_t | size
 | ) |  |
static

Convert IPv6 binary address into presentation (printable) format.

Author
Paul Vixie, 1996.

Definition at line 121 of file presaddr.c.

References inet_ntop4().

◆ inet_pton()

int W32_CALL inet_pton | ( | int | af,
 |  | const char * | src,
 |  | void * | dst
 | ) |  |

Convert from presentation format (which usually means ASCII printable) to network format (which is usually some kind of binary format).

Return values
1 | the address was valid for the specified address family.
0 | the address wasn't valid (‘dst’ is untouched in this case).
-1 | some other error occurred (‘dst’ is untouched in this case, too).
Author
Paul Vixie, 1996.

Definition at line 73 of file presaddr.c.

References inet_pton4(), and inet_pton6().

◆ inet_pton4()

static int inet_pton4 | ( | const char * | src,
 |  | u_char * | dst
 | ) |  |
static

Like inet_aton() but without all the hexadecimal and shorthand.

Return values
1 | if ‘src’ is a valid dotted quad
0 | if ‘src’ is not a valid dotted quad.
Note
does not touch ‘dst’ unless it's returning 1.
Author
Paul Vixie, 1996.

Definition at line 238 of file presaddr.c.

◆ inet_pton6()

static int inet_pton6 | ( | const char * | src,
 |  | u_char * | dst
 | ) |  |
static

Convert presentation level address to network order binary form.

Return values
1 | if ‘src’ is a valid [RFC1884 2.2] address.
0 | otherwise.
Note
  • does not touch ‘dst’ unless it's returning 1.
  • ‘::’ in a full address is silently ignored.
Author
Paul Vixie, 1996. Credit: inspired by Mark Andrews.

Definition at line 295 of file presaddr.c.

References inet_pton4().

◆ main() [1/2]

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 405 of file presaddr.c.

◆ main() [2/2]

int main ( void )

Definition at line 398 of file presaddr.c.


Watt-32 tcp/ip: E:/WATT/src/printk.c File Reference

  • src
Functions | Variables
printk.c File Reference

Go to the source code of this file.

Functions

static const char * | str_signal (int sig)
int MS_CDECL | _snprintk (char *buf, int buflen, const char *fmt,...)
int MS_CDECL | _printk (const char *fmt,...)
int | _fputsk (const char *buf, FILE *stream)
void | _printk_flush (void)
static void W32_CALL | printk_exit (void)
int | _printk_init (int size, const char *file)
int | _vsnprintk (char *buf, int buflen, const char *fmt, va_list args)

Variables

int | _printk_safe = 1
FILE * | _printk_file = NULL
static char * | printk_ptr = NULL
static char * | printk_buf = NULL
static char * | printk_end = NULL

Detailed Description

Formatted printf style routines for syslog() etc.

These are safe to use in interrupt handlers Inspired by Linux's printk().

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file printk.c.

Function Documentation

◆ _fputsk()

int _fputsk | ( | const char * | buf,
 |  | FILE * | stream
 | ) |  |

Definition at line 114 of file printk.c.

◆ _printk()

int MS_CDECL _printk | ( | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 93 of file printk.c.

◆ _printk_flush()

void _printk_flush ( void )

Definition at line 123 of file printk.c.

◆ _printk_init()

int _printk_init | ( | int | size,
 |  | const char * | file
 | ) |  |

Definition at line 148 of file printk.c.

◆ _snprintk()

int MS_CDECL _snprintk | ( | char * | buf,
 |  | int | buflen,
 |  | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 82 of file printk.c.

◆ _vsnprintk()

int _vsnprintk | ( | char * | buf,
 |  | int | buflen,
 |  | const char * | fmt,
 |  | va_list | args
 | ) |  |

Definition at line 180 of file printk.c.

◆ printk_exit()

static void W32_CALL printk_exit ( void )
static

Definition at line 134 of file printk.c.

◆ str_signal()

static const char * str_signal ( int sig )
static

Definition at line 490 of file printk.c.

Variable Documentation

◆ _printk_file

FILE * _printk_file = NULL

what file to print to (or stdout/stderr).

Definition at line 58 of file printk.c.

◆ _printk_safe

int _printk_safe = 1

safe to print; we're not in a RMCB/ISR.

Definition at line 55 of file printk.c.

◆ printk_buf

char* printk_buf = NULL
static

Definition at line 64 of file printk.c.

◆ printk_end

char* printk_end = NULL
static

Definition at line 65 of file printk.c.

◆ printk_ptr

char* printk_ptr = NULL
static

Definition at line 63 of file printk.c.


Watt-32 tcp/ip: E:/WATT/src/printk.h File Reference

  • src
Functions | Variables
printk.h File Reference

Go to the source code of this file.

Functions

int | _printk_init (int size, const char *file)
void | _printk_flush (void)
int | _fputsk (const char *buf, FILE *stream)
_CRTCHK (printf, 3, 3) int _vsnprintk(char *buf
_CRTCHK (printf, 1, 2) int _printk(const char *fmt
_CRTCHK (printf, 3, 4) int _snprintk(char *buf
int const char int | _vsnprintk (char *buf, int len, const char *fmt, va_list ap) W32_ATTR_PRINTF(3
int const char int int MS_CDECL | _printk (_Printf_format_string_ const char *fmt,...) W32_ATTR_PRINTF(1
int const char int int MS_CDECL int MS_CDECL | _snprintk (char *buf, int len, _Printf_format_string_ const char *fmt,...) W32_ATTR_PRINTF(3

Variables

int | _printk_safe
FILE * | _printk_file
int | len
int const char * | fmt
int const char va_list | ap

Function Documentation

◆ _fputsk()

int _fputsk | ( | const char * | buf,
 |  | FILE * | stream
 | ) |  |

Definition at line 114 of file printk.c.

◆ _printk_flush()

void _printk_flush ( void )

Definition at line 123 of file printk.c.

◆ _printk_init()

int _printk_init | ( | int | size,
 |  | const char * | file
 | ) |  |

Definition at line 148 of file printk.c.

Variable Documentation

◆ _printk_file

FILE* _printk_file
extern

what file to print to (or stdout/stderr).

Definition at line 58 of file printk.c.

◆ _printk_safe

int _printk_safe
extern

safe to print; we're not in a RMCB/ISR.

Definition at line 55 of file printk.c.

◆ ap

int const char va_list ap

Definition at line 43 of file printk.h.

◆ fmt

int const char * fmt

Definition at line 43 of file printk.h.

◆ len

int len

Definition at line 43 of file printk.h.


Watt-32 tcp/ip: E:/WATT/src/profile.c File Reference

  • src
Functions | Variables
profile.c File Reference

Go to the source code of this file.

Functions

void | profile_start (const char *str)
void | profile_stop (void)
static void W32_CALL | profile_exit (void)
void | profile_dump (const uint64 *data, size_t num)
void | profile_recv (uint64 put, uint64 get)
int | profile_init (void)
int | profile_on (void)

Variables

BOOL | profile_enable = FALSE
char | profile_file [MAX_PATHLEN+1] = ".\\WATTCP.PRO"
static FILE * | prof_fout
static uint64 | prof_start
static uint64 | num_profs

Detailed Description

Stuff for precision timing of functions.

Definition in file profile.c.

Function Documentation

◆ profile_dump()

void profile_dump | ( | const uint64 * | data,
 |  | size_t | num
 | ) |  |

Definition at line 112 of file profile.c.

◆ profile_exit()

static void W32_CALL profile_exit ( void )
static

Definition at line 98 of file profile.c.

◆ profile_init()

int profile_init ( void )

Definition at line 165 of file profile.c.

◆ profile_on()

int profile_on ( void )

Definition at line 218 of file profile.c.

◆ profile_recv()

void profile_recv | ( | uint64 | put,
 |  | uint64 | get
 | ) |  |

Definition at line 142 of file profile.c.

◆ profile_start()

void profile_start ( const char * str )

Definition at line 68 of file profile.c.

◆ profile_stop()

void profile_stop ( void )

Definition at line 84 of file profile.c.

Variable Documentation

◆ num_profs

uint64 num_profs
static

Definition at line 62 of file profile.c.

◆ prof_fout

FILE* prof_fout
static

Definition at line 60 of file profile.c.

◆ prof_start

uint64 prof_start
static

Definition at line 61 of file profile.c.

◆ profile_enable

BOOL profile_enable = FALSE

Definition at line 57 of file profile.c.

◆ profile_file

char profile_file[MAX_PATHLEN+1] = ".\\WATTCP.PRO"

Definition at line 58 of file profile.c.


Watt-32 tcp/ip: E:/WATT/src/profile.h File Reference

  • src
Functions | Variables
profile.h File Reference

Go to the source code of this file.

Functions

void | profile_start (const char *where)
void | profile_stop (void)
int | profile_init (void)
int | profile_on (void)
void | profile_dump (const uint64 *data, size_t num_elem)
void | profile_recv (uint64 put, uint64 get)

Variables

BOOL | profile_enable
char | profile_file [MAX_PATHLEN+1]

Function Documentation

◆ profile_dump()

void profile_dump | ( | const uint64 * | data,
 |  | size_t | num_elem
 | ) |  |

Definition at line 112 of file profile.c.

◆ profile_init()

int profile_init ( void )

Definition at line 165 of file profile.c.

◆ profile_on()

int profile_on ( void )

Definition at line 218 of file profile.c.

◆ profile_recv()

void profile_recv | ( | uint64 | put,
 |  | uint64 | get
 | ) |  |

Definition at line 142 of file profile.c.

◆ profile_start()

void profile_start ( const char * where )

Definition at line 68 of file profile.c.

◆ profile_stop()

void profile_stop ( void )

Definition at line 84 of file profile.c.

Variable Documentation

◆ profile_enable

BOOL profile_enable
extern

Definition at line 57 of file profile.c.

◆ profile_file

char profile_file[MAX_PATHLEN+1]
extern

Definition at line 58 of file profile.c.


Watt-32 tcp/ip: E:/WATT/src/punycode.c Source File

  • src
punycode.c
1/*
2 * punycode.c from RFC 3492
3 * http://www.nicemice.net/idn/
4 * Adam M. Costello
5 * http://www.nicemice.net/amc/
6 *
7 * This is ANSI C code (C89) implementing Punycode (RFC 3492).
8 */
9
10#include <stdio.h>
11#include <stdlib.h>
12#include <limits.h>
13#include <string.h>
14
15#include "wattcp.h"
16#include "misc.h"
17#include "misc_str.h"
18#include "punycode.h"
19
20#if defined(USE_IDNA)
21
22/*** Bootstring parameters for Punycode ***/
23
24enum {
25 base = 36, tmin = 1, tmax = 26,
26 skew = 38, damp = 700,
27 initial_bias = 72,
28 initial_n = 0x80,
29 delimiter = 0x2D
30};
31
32/* basic(cp) tests whether cp is a basic code point:
33 */
34#define basic(cp) ((DWORD)(cp) < 0x80)
35
36/* delim(cp) tests whether cp is a delimiter:
37 */
38#define delim(cp) ((cp) == delimiter)
39
40/*
41 * decode_digit(cp) returns the numeric value of a basic code
42 * point (for use in representing integers) in the range 0 to
43 * base-1, or base if cp is does not represent a value.
44 */
45static DWORD decode_digit (DWORD cp)
46{
47 return (cp - 48 < 10 ?
48 cp - 22 : cp - 65 < 26 ?
49 cp - 65 : cp - 97 < 26 ?
50 cp - 97 : base);
51}
52
53/*
54 * encode_digit(d,flag) returns the basic code point whose value
55 * (when used for representing integers) is d, which needs to be in
56 * the range 0 to base-1. The lowercase form is used unless flag is
57 * nonzero, in which case the uppercase form is used. The behavior
58 * is undefined if flag is nonzero and digit d has no uppercase form.
59 */
60static char encode_digit (DWORD d, int flag)
61{
62 return (char) (d + 22 + 75 * (d < 26) - ((flag != 0) << 5));
63 /* 0..25 map to ASCII a..z or A..Z */
64 /* 26..35 map to ASCII 0..9 */
65}
66
67/* flagged(bcp) tests whether a basic code point is flagged
68 * (uppercase). The behavior is undefined if bcp is not a
69 * basic code point.
70 */
71#define flagged(bcp) ((DWORD)(bcp) - 65 < 26)
72
73/*
74 * encode_basic(bcp,flag) forces a basic code point to lowercase
75 * if flag is zero, uppercase if flag is nonzero, and returns
76 * the resulting code point. The code point is unchanged if it
77 * is caseless. The behavior is undefined if bcp is not a basic
78 * code point.
79 */
80static char encode_basic (DWORD bcp, int flag)
81{
82 bcp -= (bcp - 97 < 26) << 5;
83 return (char) (bcp + ((!flag && (bcp - 65 < 26)) << 5));
84}
85
86/* maxint is the maximum value of a DWORD variable:
87 */
88static const DWORD maxint = (DWORD)-1;
89
90static DWORD adapt (DWORD delta, DWORD numpoints, int firsttime)
91{
92 DWORD k;
93
94 delta = firsttime ? delta / damp : delta >> 1;
95 /* delta >> 1 is a faster way of doing delta / 2
96 */
97 delta += delta / numpoints;
98
99 for (k = 0; delta > ((base - tmin) * tmax) / 2; k += base)
100 delta /= base - tmin;
101 return k + (base - tmin + 1) * delta / (delta + skew);
102}
103
104/*
105 *Main encode function
106 */
107enum punycode_status punycode_encode (size_t input_length,
108 const DWORD *input,
109 const BYTE *case_flags,
110 size_t *output_length,
111 char *output)
112{
113 DWORD n, delta, h, b, out, max_out, bias, j, m, q, k, t;
114
115 /* Initialize the state: */
116
117 n = initial_n;
118 delta = out = 0;
119 max_out = *output_length;
120 bias = initial_bias;
121
122 /* Handle the basic code points: */
123 for (j = 0; j < input_length; ++j)
124 {
125 if (basic (input[j]))
126 {
127 if (max_out - out < 2)
128 return (punycode_big_output);
129 output[out++] = case_flags ? encode_basic (input[j], case_flags[j]) :
130 (char)input[j];
131 }
132#if 0
133 else if (input[j] < n)
134 return (punycode_bad_input);
135 /* (not needed for Punycode with unsigned code points) */
136#endif
137 }
138
139 h = b = out;
140
141 /* h is the number of code points that have been handled, b is the
142 * number of basic code points, and out is the number of characters
143 * that have been output.
144 */
145 if (b > 0)
146 output[out++] = delimiter;
147
148 /* Main encoding loop:
149 */
150 while (h < input_length)
151 {
152 /* All non-basic code points < n have been
153 * handled already. Find the next larger one:
154 */
155 for (m = maxint, j = 0; j < input_length; ++j)
156 {
157#if 0
158 if (basic(input[j]))
159 continue;
160 /* (not needed for Punycode) */
161#endif
162 if (input[j] >= n && input[j] < m)
163 m = input[j];
164 }
165
166 /* Increase delta enough to advance the decoder's
167 * <n,i> state to <m,0>, but guard against overflow:
168 */
169 if (m - n > (maxint - delta) / (h + 1))
170 return (punycode_overflow);
171
172 delta += (m - n) * (h + 1);
173 n = m;
174
175 for (j = 0; j < input_length; ++j)
176 {
177 if (input[j] < n)
178 {
179 if (++delta == 0)
180 return (punycode_overflow);
181 }
182
183 if (input[j] == n)
184 {
185 /* Represent delta as a generalized variable-length integer:
186 */
187 for (q = delta, k = base;; k += base)
188 {
189 if (out >= max_out)
190 return (punycode_big_output);
191
192 t = k <= bias ? tmin :
193 k >= bias + tmax ? tmax :
194 k - bias;
195 if (q < t)
196 break;
197 output[out++] = encode_digit (t + (q - t) % (base - t), 0);
198 q = (q - t) / (base - t);
199 }
200 output[out++] = encode_digit (q, case_flags && case_flags[j]);
201 bias = adapt (delta, h + 1, h == b);
202 delta = 0;
203 ++h;
204 }
205 }
206 ++delta;
207 ++n;
208 }
209
210 *output_length = out;
211 return (punycode_success);
212}
213
214/*** Main decode function ***/
215
216enum punycode_status punycode_decode (DWORD input_length,
217 const char *input,
218 size_t *output_length,
219 DWORD *output,
220 BYTE *case_flags)
221{
222 DWORD n, out, i, max_out, bias, b, j, in, oldi, w, k, digit, t;
223
224 /* Initialize the state: */
225
226 n = initial_n;
227 out = i = 0;
228 max_out = *output_length;
229 bias = initial_bias;
230
231 /* Handle the basic code points: Let b be the number of input code
232 * points before the last delimiter, or 0 if there is none, then
233 * copy the first b code points to the output.
234 */
235 for (b = j = 0; j < input_length; ++j)
236 if (delim (input[j]))
237 b = j;
238 if (b > max_out)
239 return (punycode_big_output);
240
241 for (j = 0; j < b; ++j)
242 {
243 if (case_flags)
244 case_flags[out] = flagged (input[j]);
245 if (!basic (input[j]))
246 return (punycode_bad_input);
247 output[out++] = input[j];
248 }
249
250 /* Main decoding loop: Start just after the last delimiter if any
251 * basic code points were copied; start at the beginning otherwise.
252 */
253 for (in = (b > 0) ? (b + 1) : 0; in < input_length; ++out)
254 {
255 /* in is the index of the next character to be consumed, and
256 * out is the number of code points in the output array.
257 */
258
259 /* Decode a generalized variable-length integer into delta,
260 * which gets added to i. The overflow checking is easier
261 * if we increase i as we go, then subtract off its starting
262 * value at the end to obtain delta.
263 */
264 for (oldi = i, w = 1, k = base;; k += base)
265 {
266 if (in >= input_length)
267 return (punycode_bad_input);
268
269 digit = decode_digit (input[in++]);
270 if (digit >= base)
271 return (punycode_bad_input);
272
273 if (digit > ((maxint - i) / w))
274 return (punycode_overflow);
275
276 i += digit * w;
277 t = k <= bias ? tmin :
278 k >= bias + tmax ? tmax :
279 k - bias;
280 if (digit < t)
281 break;
282 if (w > maxint / (base - t))
283 return (punycode_overflow);
284
285 w *= (base - t);
286 }
287
288 bias = adapt (i - oldi, out + 1, oldi == 0);
289
290 /* i was supposed to wrap around from out+1 to 0,
291 * incrementing n each time, so we'll fix that now:
292 */
293 if (i / (out + 1) > maxint - n)
294 return (punycode_overflow);
295
296 n += i / (out + 1);
297 i %= (out + 1);
298
299 /* Insert n at position i of the output:
300 */
301#if 0
302 /* not needed for Punycode: */
303 if (decode_digit(n) <= base)
304 return (punycode_invalid_input);
305#endif
306 if (out >= max_out)
307 return (punycode_big_output);
308
309 if (case_flags)
310 {
311 memmove (case_flags + i + 1, case_flags + i, out - i);
312
313 /* Case of last character determines uppercase flag:
314 */
315 case_flags[i] = flagged (input[in - 1]);
316 }
317 memmove (output + i + 1, output + i, (out - i) * sizeof *output);
318 output[i++] = n;
319 }
320
321 *output_length = out;
322 return (punycode_success);
323}
324#endif /* USE_IDNA */
325
326#if defined(TEST_PROG)
327#if !defined(USE_IDNA)
328int main (void)
329{
330 puts ("This program needs '#define USE_IDNA'");
331 return (1);
332}
333#else /* rest of file */
334
335/* For testing, we'll just set some compile-time limits rather than
336 * use malloc(), and set a compile-time option rather than using a
337 * command-line option.
338 */
339#define UNICODE_MAX_LENGTH 256
340#define ACE_MAX_LENGTH 256
341
342static void usage (char **argv)
343{
344 fprintf (stderr,
345 "\n"
346 "%s -e reads code points and writes a Punycode string.\n"
347 "%s -d reads a Punycode string and writes code points.\n"
348 "\n"
349 "Input and output are plain text in the native character set.\n"
350 "Code points are in the form u+hex separated by whitespace.\n"
351 "Although the specification allows Punycode strings to contain\n"
352 "any characters from the ASCII repertoire, this test code\n"
353 "supports only the printable characters, and needs the Punycode\n"
354 "string to be followed by a newline.\n"
355 "The case of the u in u+hex is the force-to-uppercase flag.\n",
356 argv[0], argv[0]);
357 exit (EXIT_FAILURE);
358}
359
360#define fail(msg) __fail (__LINE__, msg)
361static void __fail (unsigned line, const char *msg)
362{
363 fprintf (stderr, "line %u: %s", line, msg);
364 exit (EXIT_FAILURE);
365}
366
367static const char too_big[] = "input or output is too large, recompile with larger limits\n";
368static const char invalid_input[] = "invalid input\n";
369static const char overflow[] = "arithmetic overflow\n";
370static const char io_error[] = "I/O error\n";
371
372/* The following string is used to convert printable
373 * characters between ASCII and the native charset:
374 */
375static const char print_ascii[] = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
376 "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
377 " !\"#$%&'()*+,-./" "0123456789:;<=>?"
378 "@ABCDEFGHIJKLMNO"
379 "PQRSTUVWXYZ[\\]^_"
380 "`abcdefghijklmno"
381 "pqrstuvwxyz{|}~\n";
382
383int main (int argc, char **argv)
384{
385 enum punycode_status status;
386 size_t input_length, output_length, j;
387 BYTE case_flags [UNICODE_MAX_LENGTH];
388 int r;
389
390 if (argc != 2 || argv[1][0] != '-' || argv[1][2] != 0)
391 usage (argv);
392
393 if (argv[1][1] == 'e')
394 {
395 DWORD input [UNICODE_MAX_LENGTH];
396 u_long codept;
397 char output [ACE_MAX_LENGTH+1], uplus[3];
398 int c;
399
400 /* Read the input code points:
401 */
402 input_length = 0;
403
404 for (;;)
405 {
406 r = scanf ("%2s%lx", uplus, &codept);
407 if (ferror (stdin))
408 fail (io_error);
409 if (r == EOF || r == 0)
410 break;
411
412 if (r != 2 || uplus[1] != '+' || codept > (DWORD)-1)
413 fail (invalid_input);
414
415 if (input_length == UNICODE_MAX_LENGTH)
416 fail (too_big);
417
418 if (uplus[0] == 'u')
419 case_flags[input_length] = 0;
420 else if (uplus[0] == 'U')
421 case_flags[input_length] = 1;
422 else fail (invalid_input);
423
424 input[input_length++] = (DWORD)codept;
425 }
426
427 /* Encode:
428 */
429 output_length = ACE_MAX_LENGTH;
430 status = punycode_encode (input_length, input, case_flags,
431 &output_length, output);
432 if (status == punycode_bad_input)
433 fail (invalid_input);
434 if (status == punycode_big_output)
435 fail (too_big);
436 if (status == punycode_overflow)
437 fail (overflow);
438 WATT_ASSERT (status == punycode_success);
439
440 /* Convert to native charset and output:
441 */
442 for (j = 0; j < output_length; ++j)
443 {
444 c = output[j];
445 WATT_ASSERT (c >= 0 && c <= 127);
446 if (print_ascii[c] == 0)
447 fail (invalid_input);
448 output[j] = print_ascii[c];
449 }
450
451 output[j] = '\0';
452 r = puts (output);
453 if (r == EOF)
454 fail (io_error);
455 return (EXIT_SUCCESS);
456 }
457
458 if (argv[1][1] == 'd')
459 {
460 char input [ACE_MAX_LENGTH+2], *p, *pp;
461 DWORD output [UNICODE_MAX_LENGTH];
462
463 /* Read the Punycode input string and convert to ASCII: */
464
465 fgets (input, ACE_MAX_LENGTH+2, stdin);
466 if (ferror (stdin))
467 fail (io_error);
468
469 if (feof (stdin))
470 fail (invalid_input);
471
472 input_length = strlen (input) - 1;
473 if (input[input_length] != '\n')
474 fail (too_big);
475
476 input[input_length] = '\0';
477
478 for (p = input; *p != 0; ++p)
479 {
480 pp = strchr (print_ascii, *p);
481 if (pp == 0)
482 fail (invalid_input);
483 *p = pp - print_ascii;
484 }
485
486 /* Decode:
487 */
488 output_length = UNICODE_MAX_LENGTH;
489 status = punycode_decode (input_length, input, &output_length,
490 output, case_flags);
491 if (status == punycode_bad_input)
492 fail (invalid_input);
493 if (status == punycode_big_output)
494 fail (too_big);
495 if (status == punycode_overflow)
496 fail (overflow);
497 WATT_ASSERT (status == punycode_success);
498
499 /* Output the result:
500 */
501 for (j = 0; j < output_length; ++j)
502 printf ("%s+%04lX\n", case_flags[j] ? "U" : "u", DWORD_CAST(output[j]));
503 return (EXIT_SUCCESS);
504 }
505 usage (argv);
506 return (EXIT_SUCCESS);
507}
508#endif /* USE_IDNA */
509#endif /* TEST_PROG */
misc.h
misc_str.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/punycode.h Source File

  • src
punycode.h
1/*
2 * punycode from RFC 3492
3 * http://www.nicemice.net/idn/
4 * Adam M. Costello
5 * http://www.nicemice.net/amc/
6 */
7
8#ifndef _w32_PUNYCODE_H
9#define _w32_PUNYCODE_H
10
11enum punycode_status {
12 punycode_success,
13 punycode_bad_input, /* Input is invalid. */
14 punycode_big_output, /* Output would exceed the space provided. */
15 punycode_overflow /* Input needs wider integers to process. */
16 };
17
18/*
19 * punycode_encode() converts Unicode to Punycode. The input
20 * is represented as an array of Unicode code points (not code
21 * units; surrogate pairs are not allowed), and the output
22 * will be represented as an array of ASCII code points. The
23 * output string is *not* null-terminated; it will contain
24 * zeros if and only if the input contains zeros. (Of course
25 * the caller can leave room for a terminator and add one if
26 * needed.) The input_length is the number of code points in
27 * the input. The output_length is an in/out argument: the
28 * caller passes in the maximum number of code points that it
29 * can receive, and on successful return it will contain the
30 * number of code points actually output. The case_flags array
31 * holds input_length boolean values, where nonzero suggests that
32 * the corresponding Unicode character be forced to uppercase
33 * after being decoded (if possible), and zero suggests that
34 * it be forced to lowercase (if possible). ASCII code points
35 * are encoded literally, except that ASCII letters are forced
36 * to uppercase or lowercase according to the corresponding
37 * uppercase flags. If case_flags is a null pointer then ASCII
38 * letters are left as they are, and other code points are
39 * treated as if their uppercase flags were zero. The return
40 * value can be any of the punycode_status values defined above
41 * except punycode_bad_input; if not punycode_success, then
42 * output_size and output might contain garbage.
43 */
44enum punycode_status punycode_encode (size_t input_length,
45 const DWORD *input,
46 const BYTE *case_flags,
47 size_t *output_length,
48 char *output);
49
50
51/*
52 * punycode_decode() converts Punycode to Unicode. The input is
53 * represented as an array of ASCII code points, and the output
54 * will be represented as an array of Unicode code points. The
55 * input_length is the number of code points in the input. The
56 * output_length is an in/out argument: the caller passes in
57 * the maximum number of code points that it can receive, and
58 * on successful return it will contain the actual number of
59 * code points output. The case_flags array needs room for at
60 * least output_length values, or it can be a null pointer if the
61 * case information is not needed. A nonzero flag suggests that
62 * the corresponding Unicode character be forced to uppercase
63 * by the caller (if possible), while zero suggests that it be
64 * forced to lowercase (if possible). ASCII code points are
65 * output already in the proper case, but their flags will be set
66 * appropriately so that applying the flags would be harmless.
67 * The return value can be any of the punycode_status values
68 * defined above; if not punycode_success, then output_length,
69 * output, and case_flags might contain garbage. On success, the
70 * decoder will never need to write an output_length greater than
71 * input_length, because of how the encoding is defined.
72 */
73enum punycode_status punycode_decode (DWORD input_length,
74 const char *input,
75 size_t *output_length,
76 DWORD *output,
77 BYTE *case_flags);
78#endif


Watt-32 tcp/ip: E:/WATT/src/qmsg.c File Reference

  • src
Functions | Variables
qmsg.c File Reference

Go to the source code of this file.

Functions

void | dputch (char x)
void | dmsg (const char *s)
void | dhex1int (int x)
void | dhex2int (int x)
void | dhex4int (int x)
void | dhex8int (DWORD x)

Variables

BYTE | dbg_colour = 14 + (16*1)
WORD | dbg_scrpos = SCR_START
WORD | dbg_scrstart = SCR_START
static int | curr_line = (SCR_START/(2*SCR_WIDTH))

Detailed Description

Functions for debug messages. Can safely be used inside interrupt handlers or callbacks.

Definition in file qmsg.c.

Function Documentation

◆ dhex1int()

void dhex1int ( int x )

Definition at line 61 of file qmsg.c.

◆ dhex2int()

void dhex2int ( int x )

Definition at line 70 of file qmsg.c.

◆ dhex4int()

void dhex4int ( int x )

Definition at line 77 of file qmsg.c.

◆ dhex8int()

void dhex8int ( DWORD x )

Definition at line 84 of file qmsg.c.

◆ dmsg()

void dmsg ( const char * s )

Definition at line 55 of file qmsg.c.

◆ dputch()

void dputch ( char x )

Definition at line 33 of file qmsg.c.

Variable Documentation

◆ curr_line

int curr_line = (SCR_START/(2*SCR_WIDTH))
static

Definition at line 31 of file qmsg.c.

◆ dbg_colour

BYTE dbg_colour = 14 + (16*1)

Definition at line 27 of file qmsg.c.

◆ dbg_scrpos

WORD dbg_scrpos = SCR_START

Definition at line 28 of file qmsg.c.

◆ dbg_scrstart

WORD dbg_scrstart = SCR_START

Definition at line 29 of file qmsg.c.


Watt-32 tcp/ip: E:/WATT/src/receive.c File Reference

  • src
Functions
receive.c File Reference

Go to the source code of this file.

Functions

static int | tcp_receive (Socket *sock, void *buf, int len, int flags, struct sockaddr *from, size_t *fromlen)
static int | udp_receive (Socket *sock, void *buf, int len, int flags, struct sockaddr *from, size_t *fromlen)
static int | raw_receive (Socket *sock, void *buf, unsigned len, int flags, struct sockaddr *from, size_t *fromlen)
static int | receive (const char *func, int s, void *buf, int len, int flags, struct sockaddr *from, size_t *fromlen)
int W32_CALL | recvfrom (int s, void *buf, int len, int flags, struct sockaddr *from, socklen_t *fromlen)
int W32_CALL | recv (int s, void *buf, int len, int flags)
int W32_CALL | read_s (int s, char *buf, int len)
int W32_CALL | recvmsg (int s, struct msghdr *msg, int flags)
int W32_CALL | readv_s (int s, const struct iovec *vector, size_t count)
static void | udp_raw_fill_from_ip4 (struct sockaddr *from, size_t *fromlen, const struct in_addr *peer, WORD port)
static void | udp_raw_fill_from_ip6 (struct sockaddr *from, size_t *fromlen, const void *peer, WORD port)

Detailed Description

BSD recv(), recvfrom().

Definition in file receive.c.

Function Documentation

◆ raw_receive()

static int raw_receive | ( | Socket * | sock,
 |  | void * | buf,
 |  | unsigned | len,
 |  | int | flags,
 |  | struct sockaddr * | from,
 |  | size_t * | fromlen
 | ) |  |
static

Definition at line 732 of file receive.c.

◆ read_s()

int W32_CALL read_s | ( | int | s,
 |  | char * | buf,
 |  | int | len
 | ) |  |

Definition at line 226 of file receive.c.

◆ readv_s()

int W32_CALL readv_s | ( | int | s,
 |  | const struct iovec * | vector,
 |  | size_t | count
 | ) |  |

Definition at line 306 of file receive.c.

◆ receive()

static int receive | ( | const char * | func,
 |  | int | s,
 |  | void * | buf,
 |  | int | len,
 |  | int | flags,
 |  | struct sockaddr * | from,
 |  | size_t * | fromlen
 | ) |  |
static

Definition at line 66 of file receive.c.

◆ recv()

int W32_CALL recv | ( | int | s,
 |  | void * | buf,
 |  | int | len,
 |  | int | flags
 | ) |  |

Definition at line 218 of file receive.c.

◆ recvfrom()

int W32_CALL recvfrom | ( | int | s,
 |  | void * | buf,
 |  | int | len,
 |  | int | flags,
 |  | struct sockaddr * | from,
 |  | socklen_t * | fromlen
 | ) |  |

Definition at line 207 of file receive.c.

◆ recvmsg()

int W32_CALL recvmsg | ( | int | s,
 |  | struct msghdr * | msg,
 |  | int | flags
 | ) |  |

Definition at line 236 of file receive.c.

◆ tcp_receive()

static int tcp_receive | ( | Socket * | sock,
 |  | void * | buf,
 |  | int | len,
 |  | int | flags,
 |  | struct sockaddr * | from,
 |  | size_t * | fromlen
 | ) |  |
static
Todo:
Handle receiving Out-of-Band data

Definition at line 402 of file receive.c.

References chk_timeout(), set_timeout(), and tcp_Retransmitter().

◆ udp_raw_fill_from_ip4()

static void udp_raw_fill_from_ip4 | ( | struct sockaddr * | from,
 |  | size_t * | fromlen,
 |  | const struct in_addr * | peer,
 |  | WORD | port
 | ) |  |
static

Definition at line 365 of file receive.c.

◆ udp_raw_fill_from_ip6()

static void udp_raw_fill_from_ip6 | ( | struct sockaddr * | from,
 |  | size_t * | fromlen,
 |  | const void * | peer,
 |  | WORD | port
 | ) |  |
static

Definition at line 382 of file receive.c.

◆ udp_receive()

static int udp_receive | ( | Socket * | sock,
 |  | void * | buf,
 |  | int | len,
 |  | int | flags,
 |  | struct sockaddr * | from,
 |  | size_t * | fromlen
 | ) |  |
static
Todo:
This needs a redesign

Definition at line 545 of file receive.c.

References _inet6_ntoa(), chk_timeout(), set_timeout(), and tcp_Retransmitter().


Watt-32 tcp/ip: E:/WATT/src/register.h File Reference

  • src
Data Structures
register.h File Reference

Go to the source code of this file.

Data Structures

struct | eflags_bits
union | eflags
struct | cr0_bits
union | cr0

Detailed Description

Definition and constants related to Intel CPU.

COPYRIGHT (c) 1998 valet.nosp@m.te@c.nosp@m.rf.ca.nosp@m.non..nosp@m.fr

The license and distribution terms for this file may be found in the file LICENSE in this distribution or at http://www.OARcorp.com/rtems/license.html.

Id
registers.h,v 1.1 1998/08/05 15:15:46 joel Exp

Definition in file register.h.


Watt-32 tcp/ip: E:/WATT/src/res_comp.c File Reference

  • src
Functions
res_comp.c File Reference

Go to the source code of this file.

Functions

static int | mklower (int)
static int | dn_find (u_char *, u_char *, u_char **, u_char **)
int W32_CALL | dn_expand (const u_char *msg, const u_char *eom_orig, const u_char *comp_dn, char *exp_dn, int length)
int W32_CALL | dn_comp (const char *exp_dn, u_char *comp_dn, int length, u_char **dnptrs, u_char **lastdnptr)
int W32_CALL | __dn_skipname (const u_char *comp_dn, const u_char *eom)

Detailed Description

Resolver library.

Definition in file res_comp.c.

Function Documentation

◆ __dn_skipname()

int W32_CALL __dn_skipname | ( | const u_char * | comp_dn,
 |  | const u_char * | eom
 | ) |  |

Definition at line 258 of file res_comp.c.

◆ dn_comp()

int W32_CALL dn_comp | ( | const char * | exp_dn,
 |  | u_char * | comp_dn,
 |  | int | length,
 |  | u_char ** | dnptrs,
 |  | u_char ** | lastdnptr
 | ) |  |

Definition at line 163 of file res_comp.c.

◆ dn_expand()

int W32_CALL dn_expand | ( | const u_char * | msg,
 |  | const u_char * | eom_orig,
 |  | const u_char * | comp_dn,
 |  | char * | exp_dn,
 |  | int | length
 | ) |  |

Definition at line 73 of file res_comp.c.

◆ dn_find()

static int dn_find | ( | u_char * | exp_dn,
 |  | u_char * | msg,
 |  | u_char ** | dnptrs,
 |  | u_char ** | lastdnptr
 | ) |  |
static

Definition at line 302 of file res_comp.c.

◆ mklower()

static int mklower ( int ch )
static

Definition at line 289 of file res_comp.c.


Watt-32 tcp/ip: E:/WATT/src/res_data.c File Reference

  • src
Functions | Variables
res_data.c File Reference

Go to the source code of this file.

Functions

void W32_CALL | herror (const char *prefix)
const char *W32_CALL | hstrerror (int err)

Variables

const char * | _res_opcodes []
const char * | _res_resultcodes []
const char * | h_errlist []
int | h_nerr = DIM (h_errlist)

Detailed Description

Resolver library.

Definition in file res_data.c.

Function Documentation

◆ herror()

void W32_CALL herror ( const char * prefix )

Definition at line 115 of file res_data.c.

◆ hstrerror()

const char *W32_CALL hstrerror ( int err )

Definition at line 127 of file res_data.c.

Variable Documentation

◆ _res_opcodes

const char* _res_opcodes[]
Initial value:
= {
"QUERY",
"IQUERY",
"CQUERYM",
"CQUERYU",
"NOTIFY",
"5",
"6",
"7",
"8",
"UPDATEA",
"UPDATED",
"UPDATEDA",
"UPDATEM",
"UPDATEMA",
"ZONEINIT",
"ZONEREF"
}

Definition at line 63 of file res_data.c.

◆ _res_resultcodes

const char* _res_resultcodes[]
Initial value:
= {
"NOERROR",
"FORMERR",
"SERVFAIL",
"NXDOMAIN",
"NOTIMP",
"REFUSED",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"NOCHANGE"
}

Definition at line 82 of file res_data.c.

◆ h_errlist

const char* h_errlist[]
Initial value:
= {
"Error 0",
"Unknown host",
"Host name lookup failure",
"Unknown server error",
"No address associated with name",
}

Definition at line 101 of file res_data.c.

◆ h_nerr

int h_nerr = DIM (h_errlist)

Definition at line 109 of file res_data.c.


Watt-32 tcp/ip: E:/WATT/src/res_debu.c File Reference

  • src
Functions
res_debu.c File Reference

Go to the source code of this file.

Functions

static const char * | dewks (int wks)
static const char * | deproto (int protonum)
static const u_char * | do_rrset (const u_char *msg, int len, const u_char *cp, int cnt, int pflag, FILE *file, const char *hs)
void W32_CALL | __p_query (const u_char *msg)
void W32_CALL | __fp_resstat (struct __res_state *statp, FILE *file)
void W32_CALL | __fp_nquery (const u_char *msg, int len, FILE *file)
void W32_CALL | __fp_query (const u_char *msg, FILE *file)
const u_char *W32_CALL | __p_cdnname (const u_char *cp, const u_char *msg, int len, FILE *file)
const u_char *W32_CALL | __p_cdname (const u_char *cp, const u_char *msg, FILE *file)
const u_char *W32_CALL | __p_fqname (const u_char *cp, const u_char *msg, FILE *file)
const u_char *W32_CALL | __p_rr (const u_char *cp, const u_char *msg, FILE *file)
const char *W32_CALL | __p_type (int type)
const char *W32_CALL | __p_class (int Class)
const char *W32_CALL | __p_option (u_long option)
char *W32_CALL | __p_time (u_long value)

Detailed Description

Resolver debugger.

Definition in file res_debu.c.

Function Documentation

◆ __fp_nquery()

void W32_CALL __fp_nquery | ( | const u_char * | msg,
 |  | int | len,
 |  | FILE * | file
 | ) |  |

Definition at line 206 of file res_debu.c.

◆ __fp_query()

void W32_CALL __fp_query | ( | const u_char * | msg,
 |  | FILE * | file
 | ) |  |

Definition at line 334 of file res_debu.c.

◆ __fp_resstat()

void W32_CALL __fp_resstat | ( | struct __res_state * | statp,
 |  | FILE * | file
 | ) |  |

Definition at line 189 of file res_debu.c.

◆ __p_cdname()

const u_char *W32_CALL __p_cdname | ( | const u_char * | cp,
 |  | const u_char * | msg,
 |  | FILE * | file
 | ) |  |

Definition at line 354 of file res_debu.c.

◆ __p_cdnname()

const u_char *W32_CALL __p_cdnname | ( | const u_char * | cp,
 |  | const u_char * | msg,
 |  | int | len,
 |  | FILE * | file
 | ) |  |

Definition at line 339 of file res_debu.c.

◆ __p_class()

const char *W32_CALL __p_class ( int Class )

Definition at line 715 of file res_debu.c.

◆ __p_fqname()

const u_char *W32_CALL __p_fqname | ( | const u_char * | cp,
 |  | const u_char * | msg,
 |  | FILE * | file
 | ) |  |

Definition at line 362 of file res_debu.c.

◆ __p_option()

const char *W32_CALL __p_option ( u_long option )

Definition at line 734 of file res_debu.c.

◆ __p_query()

void W32_CALL __p_query ( const u_char * msg )

Definition at line 179 of file res_debu.c.

◆ __p_rr()

const u_char *W32_CALL __p_rr | ( | const u_char * | cp,
 |  | const u_char * | msg,
 |  | FILE * | file
 | ) |  |

Definition at line 384 of file res_debu.c.

◆ __p_time()

char *W32_CALL __p_time ( u_long value )

Definition at line 760 of file res_debu.c.

◆ __p_type()

const char *W32_CALL __p_type ( int type )

Definition at line 662 of file res_debu.c.

◆ deproto()

static const char * deproto ( int protonum )
static

Definition at line 119 of file res_debu.c.

◆ dewks()

static const char * dewks ( int wks )
static

Definition at line 63 of file res_debu.c.

◆ do_rrset()

static const u_char * do_rrset | ( | const u_char * | msg,
 |  | int | len,
 |  | const u_char * | cp,
 |  | int | cnt,
 |  | int | pflag,
 |  | FILE * | file,
 |  | const char * | hs
 | ) |  |
static

Definition at line 141 of file res_debu.c.


Watt-32 tcp/ip: E:/WATT/src/res_init.c File Reference

  • src
Functions | Variables
res_init.c File Reference

Go to the source code of this file.

Functions

static void | res_setoptions (const char *options, const char *source)
u_int16_t W32_CALL | res_randomid (void)
int W32_CALL | res_init (void)
static | void (W32_CALL *prev_hook)(const char *
static void W32_CALL | resolver_init (const char *name, const char *value)
static void W32_CALL | res_exit (void)
void W32_CALL | res_init0 (void)

Variables

char * | res_cfg_options = NULL
char * | res_cfg_aliases = NULL
struct __res_state | _res
static const char *static const struct config_table | bind_cfg []

Detailed Description

Resolver initialisation.

Definition in file res_init.c.

Function Documentation

◆ res_exit()

static void W32_CALL res_exit ( void )
static

Definition at line 288 of file res_init.c.

◆ res_init()

int W32_CALL res_init ( void )

Definition at line 176 of file res_init.c.

◆ res_init0()

void W32_CALL res_init0 ( void )

Definition at line 294 of file res_init.c.

◆ res_randomid()

u_int16_t W32_CALL res_randomid ( void )

Definition at line 149 of file res_init.c.

◆ res_setoptions()

static void res_setoptions | ( | const char * | options,
 |  | const char * | source
 | ) |  |
static

Definition at line 102 of file res_init.c.

◆ resolver_init()

static void W32_CALL resolver_init | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Definition at line 282 of file res_init.c.

Variable Documentation

◆ _res

struct __res_state _res

Definition at line 100 of file res_init.c.

◆ bind_cfg

const char* static const struct config_table bind_cfg[]
static
Initial value:
= {
{ "RES_OPTIONS", ARG_STRDUP, (void*)&res_cfg_options },
{ "HOSTALIASES", ARG_STRDUP, (void*)&res_cfg_aliases },
{ NULL, 0, NULL }
}
ARG_STRDUP
@ ARG_STRDUP
duplicate string value
Definition: tcp.h:455

Definition at line 276 of file res_init.c.

◆ res_cfg_aliases

char* res_cfg_aliases = NULL

Definition at line 95 of file res_init.c.

◆ res_cfg_options

char* res_cfg_options = NULL

Definition at line 94 of file res_init.c.


Watt-32 tcp/ip: E:/WATT/src/res_loc.c File Reference

  • src
Functions | Variables
res_loc.c File Reference

Go to the source code of this file.

Functions

static const char * | precsize_ntoa (BYTE prec)
static BYTE | precsize_aton (char **strptr)
static DWORD | latlon2ul (char **latlonstrptr, int *which)
int W32_CALL | loc_aton (const char *ascii, u_char *binary)
char *W32_CALL | loc_ntoa (const u_char *binary, char *ascii)

Variables

static unsigned long power_of_ten [10]

Detailed Description

Resolver library.

Definition in file res_loc.c.

Function Documentation

◆ latlon2ul()

static DWORD latlon2ul | ( | char ** | latlonstrptr,
 |  | int * | which
 | ) |  |
static

Definition at line 139 of file res_loc.c.

◆ loc_aton()

int W32_CALL loc_aton | ( | const char * | ascii,
 |  | u_char * | binary
 | ) |  |

Definition at line 242 of file res_loc.c.

◆ loc_ntoa()

char *W32_CALL loc_ntoa | ( | const u_char * | binary,
 |  | char * | ascii
 | ) |  |

Definition at line 360 of file res_loc.c.

◆ precsize_aton()

static BYTE precsize_aton ( char ** strptr )
static

Definition at line 99 of file res_loc.c.

◆ precsize_ntoa()

static const char * precsize_ntoa ( BYTE prec )
static

Definition at line 79 of file res_loc.c.

Variable Documentation

◆ power_of_ten

unsigned long power_of_ten[10]
static
Initial value:
= {
1, 10, 100, 1000, 10000, 100000,
1000000,10000000,100000000,1000000000
}

Definition at line 71 of file res_loc.c.


Watt-32 tcp/ip: E:/WATT/src/res_mkqu.c File Reference

  • src
Functions
res_mkqu.c File Reference

Go to the source code of this file.

Functions

int W32_CALL res_mkquery (int op, const char *dname, int Class, int type, const u_char *data, int datalen, const u_char *newrr_in, u_char *buf, int buflen)

Detailed Description

Resolver.

Definition in file res_mkqu.c.

Function Documentation

◆ res_mkquery()

int W32_CALL res_mkquery | ( | int | op,
 |  | const char * | dname,
 |  | int | Class,
 |  | int | type,
 |  | const u_char * | data,
 |  | int | datalen,
 |  | const u_char * | newrr_in,
 |  | u_char * | buf,
 |  | int | buflen
 | ) |  |
Todo:
Handle STATUS case

Definition at line 67 of file res_mkqu.c.

References HEADER::ancount, HEADER::arcount, HEADER::id, HEADER::opcode, HEADER::qdcount, HEADER::rcode, and HEADER::rd.


Watt-32 tcp/ip: E:/WATT/src/res_quer.c File Reference

  • src
Functions
res_quer.c File Reference

Go to the source code of this file.

Functions

int W32_CALL | res_query (const char *name, int Class, int type, u_char *answer, int anslen)
int W32_CALL | res_search (const char *name, int Class, int type, u_char *answer, int anslen)
int W32_CALL | res_querydomain (const char *name, const char *domain, int Class, int type, u_char *answer, int anslen)
char *W32_CALL | __hostalias (const char *name)

Detailed Description

Resolver query function.

Definition in file res_quer.c.

Function Documentation

◆ __hostalias()

char *W32_CALL __hostalias ( const char * name )

Definition at line 367 of file res_quer.c.

◆ res_query()

int W32_CALL res_query | ( | const char * | name,
 |  | int | Class,
 |  | int | type,
 |  | u_char * | answer,
 |  | int | anslen
 | ) |  |

Definition at line 80 of file res_quer.c.

◆ res_querydomain()

int W32_CALL res_querydomain | ( | const char * | name,
 |  | const char * | domain,
 |  | int | Class,
 |  | int | type,
 |  | u_char * | answer,
 |  | int | anslen
 | ) |  |

Definition at line 322 of file res_quer.c.

◆ res_search()

int W32_CALL res_search | ( | const char * | name,
 |  | int | Class,
 |  | int | type,
 |  | u_char * | answer,
 |  | int | anslen
 | ) |  |

Definition at line 153 of file res_quer.c.


Watt-32 tcp/ip: E:/WATT/src/res_send.c File Reference

  • src
Functions | Variables
res_send.c File Reference

Go to the source code of this file.

Functions

static int | name_server_send (int ns, struct sockaddr_in *nsap)
static void | resolve_close (void)
static void | Aerror (const char *str, const char *error, struct sockaddr_in address)
static void | Perror (const char *str, const char *error)
void W32_CALL | res_send_setqhook (res_send_qhook hook)
void W32_CALL | res_send_setrhook (res_send_rhook hook)
int W32_CALL | res_isourserver (const struct sockaddr_in *inp)
int W32_CALL | res_nameinquery (const char *name, int type, int Class, const u_char *buf, const u_char *eom)
int W32_CALL | res_queriesmatch (const u_char *buf1, const u_char *eom1, const u_char *buf2, const u_char *eom2)
int W32_CALL | res_send (const u_char *buf, int buflen, u_char *ans, int anssiz)
static int | tcp_conn (_tcp_Socket *sock, ERROR_TYPE *error, DWORD timeout)
static int | tcp_read (_tcp_Socket *sock, u_char *buf, int len, ERROR_TYPE *error, DWORD timeout)
static int | udp_read (_udp_Socket *sock, u_char *buf, int len, ERROR_TYPE *error, DWORD timeout)

Variables

static sock_type * | sock = NULL
static int | vc = 0
static int | connected = 0
static res_send_qhook | Qhook = NULL
static res_send_rhook | Rhook = NULL
static HEADER * | hp
static HEADER * | anhp
static int | gotsomewhere
static int | connreset
static int | terrno
static int | Try
static int | v_circuit
static int | ns
static int | n
static int | ns_buflen
static int | ns_anssiz
static u_long | badns
static u_char * | ns_buf
static u_char * | ns_ans

Detailed Description

Resolver send module

Definition in file res_send.c.

Function Documentation

◆ Aerror()

static void Aerror | ( | const char * | str,
 |  | const char * | error,
 |  | struct sockaddr_in | address
 | ) |  |
static

Definition at line 94 of file res_send.c.

◆ name_server_send()

static int name_server_send | ( | int | ns,
 |  | struct sockaddr_in * | nsap
 | ) |  |
static

Definition at line 349 of file res_send.c.

◆ Perror()

static void Perror | ( | const char * | str,
 |  | const char * | error
 | ) |  |
static

Definition at line 103 of file res_send.c.

◆ res_isourserver()

int W32_CALL res_isourserver ( const struct sockaddr_in * inp )

Definition at line 131 of file res_send.c.

◆ res_nameinquery()

int W32_CALL res_nameinquery | ( | const char * | name,
 |  | int | type,
 |  | int | Class,
 |  | const u_char * | buf,
 |  | const u_char * | eom
 | ) |  |

Definition at line 159 of file res_send.c.

◆ res_queriesmatch()

int W32_CALL res_queriesmatch | ( | const u_char * | buf1,
 |  | const u_char * | eom1,
 |  | const u_char * | buf2,
 |  | const u_char * | eom2
 | ) |  |

Definition at line 196 of file res_send.c.

◆ res_send()

int W32_CALL res_send | ( | const u_char * | buf,
 |  | int | buflen,
 |  | u_char * | ans,
 |  | int | anssiz
 | ) |  |

Definition at line 233 of file res_send.c.

◆ res_send_setqhook()

void W32_CALL res_send_setqhook ( res_send_qhook hook )

Definition at line 112 of file res_send.c.

◆ res_send_setrhook()

void W32_CALL res_send_setrhook ( res_send_rhook hook )

Definition at line 117 of file res_send.c.

◆ resolve_close()

static void resolve_close ( void )
static

Definition at line 671 of file res_send.c.

◆ tcp_conn()

static int tcp_conn | ( | _tcp_Socket * | sock,
 |  | ERROR_TYPE * | error,
 |  | DWORD | timeout
 | ) |  |
static

Definition at line 296 of file res_send.c.

◆ tcp_read()

static int tcp_read | ( | _tcp_Socket * | sock,
 |  | u_char * | buf,
 |  | int | len,
 |  | ERROR_TYPE * | error,
 |  | DWORD | timeout
 | ) |  |
static

Definition at line 312 of file res_send.c.

◆ udp_read()

static int udp_read | ( | _udp_Socket * | sock,
 |  | u_char * | buf,
 |  | int | len,
 |  | ERROR_TYPE * | error,
 |  | DWORD | timeout
 | ) |  |
static

Definition at line 333 of file res_send.c.

Variable Documentation

◆ anhp

HEADER * anhp
static

Definition at line 226 of file res_send.c.

◆ badns

u_long badns
static

Definition at line 230 of file res_send.c.

◆ connected

int connected = 0
static

Definition at line 75 of file res_send.c.

◆ connreset

int connreset
static

Definition at line 227 of file res_send.c.

◆ gotsomewhere

int gotsomewhere
static

Definition at line 227 of file res_send.c.

◆ hp

HEADER* hp
static

Definition at line 226 of file res_send.c.

◆ n

int n
static

Definition at line 228 of file res_send.c.

◆ ns

int ns
static

Definition at line 228 of file res_send.c.

◆ ns_ans

u_char * ns_ans
static

Definition at line 231 of file res_send.c.

◆ ns_anssiz

int ns_anssiz
static

Definition at line 229 of file res_send.c.

◆ ns_buf

u_char* ns_buf
static

Definition at line 231 of file res_send.c.

◆ ns_buflen

int ns_buflen
static

Definition at line 229 of file res_send.c.

◆ Qhook

res_send_qhook Qhook = NULL
static

Definition at line 109 of file res_send.c.

◆ Rhook

res_send_rhook Rhook = NULL
static

Definition at line 110 of file res_send.c.

◆ sock

sock_type* sock = NULL
static

Definition at line 73 of file res_send.c.

◆ terrno

int terrno
static

Definition at line 227 of file res_send.c.

◆ Try

int Try
static

Definition at line 227 of file res_send.c.

◆ v_circuit

int v_circuit
static

Definition at line 228 of file res_send.c.

◆ vc

int vc = 0
static

Definition at line 74 of file res_send.c.


Watt-32 tcp/ip: E:/WATT/src/resolver.h File Reference

  • src
Functions | Variables
resolver.h File Reference

Go to the source code of this file.

Functions

W32_FUNC void W32_CALL res_init0 (void)

Variables

W32_DATA const char * | _res_opcodes []
W32_DATA const char * | _res_resultcodes []
W32_DATA char * | res_cfg_options
W32_DATA char * | res_cfg_aliases

Detailed Description

Common include for all res_*.c sources

Definition in file resolver.h.

Function Documentation

◆ res_init0()

W32_FUNC void W32_CALL res_init0 ( void )

Definition at line 294 of file res_init.c.

Variable Documentation

◆ _res_opcodes

W32_DATA const char* _res_opcodes[]

Definition at line 117 of file resolver.h.

◆ _res_resultcodes

W32_DATA const char* _res_resultcodes[]

Definition at line 118 of file resolver.h.

◆ res_cfg_aliases

W32_DATA char * res_cfg_aliases

Definition at line 120 of file resolver.h.

◆ res_cfg_options

W32_DATA char* res_cfg_options

Definition at line 120 of file resolver.h.


Watt-32 tcp/ip: E:/WATT/src/run.c Source File

  • src
run.c
1
2#include <stdio.h>
3#include <stdlib.h>
4
5#include "wattcp.h"
6#include "pcdbug.h"
7#include "misc.h"
8#include "timer.h"
9#include "run.h"
10
18struct run_list {
19 _VoidProc func;
20 const char *name;
21 int order;
22 const char *file;
23 unsigned line;
24 BOOL running; /* Prevent reentry. Uses in daemon_list[] only. */
25 };
26
27static struct run_list start_list [40];
28static struct run_list exit_list [40];
29static struct run_list daemon_list [20]; /* List of background processes */
30
31static int num_start_func_inserts = 0;
32static int num_exit_func_inserts = 0;
33
34static DWORD daemon_timer = 0UL; /* When to run "background" processes */
35
36static int MS_CDECL list_compare (const struct run_list *a, const struct run_list *b)
37{
38 return (a->order - b->order);
39}
40
44int startup_add (_VoidProc func, const char *name, int order,
45 const char *file, unsigned line)
46{
47 int i;
48
49 for (i = 0; i < num_start_func_inserts; i++)
50 {
51 if (!start_list[i].func)
52 continue;
53
54 if (start_list[i].func == func)
55 goto modify;
56
57 if (start_list[i].order == order)
58 {
59 TRACE_CONSOLE (0, "%s(%u): startup_add (\"%s\",%d): order already "
60 "in start_list[]\n", file, line, name, order);
61 return (-1);
62 }
63 }
64
65 WATT_ASSERT (num_start_func_inserts < DIM(start_list));
66 i = num_start_func_inserts++;
67
68modify:
69 start_list[i].func = func;
70 start_list[i].name = name;
71 start_list[i].order = order;
72 start_list[i].file = file;
73 start_list[i].line = line;
74
75#if 1
76 qsort (&start_list, DIM(start_list), sizeof(start_list[0]),
77 (CmpFunc)list_compare);
78#else
79 if (i > 0)
80 qsort (&start_list, i, sizeof(start_list[0]), (CmpFunc)list_compare);
81#endif
82
83 return (num_start_func_inserts);
84}
85
89int rundown_add (_VoidProc func, const char *name, int order,
90 const char *file, unsigned line)
91{
92 int i;
93
94 for (i = 0; i < num_exit_func_inserts; i++)
95 {
96 if (!exit_list[i].func)
97 continue;
98
99 if (exit_list[i].func == func)
100 goto modify;
101
102 if (exit_list[i].order == order)
103 {
104 TRACE_CONSOLE (0, "%s(%u): rundown_add (\"%s\",%d): order already "
105 "in exit_list[]\n", file, line, name, order);
106 return (-1);
107 }
108 }
109
110 WATT_ASSERT (num_exit_func_inserts < DIM(exit_list));
111 i = num_exit_func_inserts++;
112
113modify:
114 exit_list[i].func = func;
115 exit_list[i].name = name;
116 exit_list[i].order = order;
117 exit_list[i].file = file;
118 exit_list[i].line = line;
119
120#if 1
121 qsort (&exit_list, DIM(exit_list), sizeof(exit_list[0]),
122 (CmpFunc)list_compare);
123#else
124 if (i > 0)
125 qsort (&exit_list, i, sizeof(exit_list[0]), (CmpFunc)list_compare);
126#endif
127
128 return (num_exit_func_inserts);
129}
130
134void rundown_run (void)
135{
136 struct run_list *oe;
137 _VoidProc func;
138 int i;
139
140 for (i = 0, oe = exit_list; i < DIM(exit_list); i++, oe++)
141 {
142 if (!oe->func)
143 continue;
144
145 TRACE_CONSOLE (3, "Calling rundown-func `%s' at order %d\n",
146 oe->name, oe->order);
147 func = oe->func;
148 oe->func = NULL; /* don't call it again */
149 (*func)();
150 }
151}
152
156DWORD daemon_timeout (DWORD timeout)
157{
158 DWORD old = daemon_timer;
159
160 daemon_timer = set_timeout (timeout);
161 return (old);
162}
163
164#if defined(USE_DEBUG)
168void rundown_dump (void)
169{
170 const struct run_list *oe;
171 int i, num_active;
172
173 (*_printf) ("rundown_dump():\n");
174 for (i = num_active = 0, oe = exit_list; i < DIM(exit_list); i++, oe++)
175 {
176 if (!oe->func)
177 continue;
178 TRACE_CONSOLE (0, " order %3d: `%s' called from %s (%u)\n",
179 oe->order, oe->name, oe->file, oe->line);
180 num_active++;
181 }
182 TRACE_CONSOLE (0, " %s\n", num_active == i ? "possible overflow" : "okay");
183}
184#endif
185
186#ifdef NOT_USED
190void exit_misc (void)
191{
192 num_exit_func_inserts = 0;
193}
194#endif
195
196
205int daemon_add (_VoidProc func, const char *name,
206 const char *file, unsigned line)
207{
208 struct run_list *r;
209 int i;
210
211 /* see if the daemon is already in the list */
212 for (i = 0, r = daemon_list; i < DIM(daemon_list); i++, r++)
213 if (r->func && r->func == func)
214 {
215 TRACE_CONSOLE (3, "\ndaemon_add(): daemon exists\n");
216 return (1); /* operation can proceed normally */
217 }
218
219 for (i = 0, r = daemon_list; i < DIM(daemon_list); i++, r++)
220 if (!r->func)
221 {
222 r->func = func;
223 r->name = name;
224 r->running = FALSE;
225 return (1);
226 }
227 ARGSUSED (file);
228 ARGSUSED (line);
229 return (0); /* didn't find a free slot */
230}
231
236int daemon_del (_VoidProc func, const char *name,
237 const char *file, unsigned line)
238{
239 struct run_list *r;
240 int i;
241
242 for (i = 0, r = daemon_list; i < DIM(daemon_list); i++, r++)
243 if (!func || func == r->func)
244 {
245 r->func = NULL;
246 r->running = FALSE;
247 return (1);
248 }
249 ARGSUSED (name);
250 ARGSUSED (file);
251 ARGSUSED (line);
252 return (0); /* didn't find the daemon */
253}
254
255/* UPDATE: 26FEB2006 psuggs@pobox.com
256 * Shutdown daemons and clear the list
257 */
258void daemon_clear (void)
259{
260 daemon_del (NULL, NULL, NULL, 0);
261}
262
267int daemon_run (void)
268{
269 int rc = 0;
270
271 if (daemon_timer == 0UL || chk_timeout(daemon_timer))
272 {
273 struct run_list *r;
274 int i;
275
276 for (i = 0, r = daemon_list; i < DIM(daemon_list); i++, r++)
277 {
278 if (r->func && !r->running)
279 {
280 if (r->name)
281 TRACE_CONSOLE (3, "Running daemon %d (%s)\n", i, r->name);
282 else TRACE_CONSOLE (3, "Running daemon %d (%p)\n", i, r->func);
283 r->running = TRUE;
284 (*r->func)();
285 r->running = FALSE;
286 rc++;
287 }
288 }
289 daemon_timeout (DAEMON_PERIOD); /* (re)start 'daemon_timer' */
290 }
291 return (rc);
292}
293
294/*
295 * Old names for above. Keep these public.
296 */
297int W32_CALL addwattcpd (VoidProc func)
298{
299 return daemon_add ((_VoidProc)func, NULL, NULL, 0);
300}
301
302int W32_CALL delwattcpd (VoidProc func)
303{
304 return daemon_del ((_VoidProc)func, NULL, NULL, 0);
305}
306
misc.h
pcdbug.h
run_list
Register an on-startup/at-exit function.
Definition: run.c:18
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/run.h Source File

  • src
run.h
1#ifndef _w32_RUN_H
2#define _w32_RUN_H
3
4#define DAEMON_PERIOD 500 /* run daemons every 500msec */
5
6#define startup_add W32_NAMESPACE (startup_add)
7#define startup_run W32_NAMESPACE (startup_run)
8#define startup_dump W32_NAMESPACE (startup_dump)
9#define rundown_add W32_NAMESPACE (rundown_add)
10#define rundown_run W32_NAMESPACE (rundown_run)
11#define rundown_dump W32_NAMESPACE (rundown_dump)
12#define daemon_add W32_NAMESPACE (daemon_add)
13#define daemon_del W32_NAMESPACE (daemon_del)
14#define daemon_run W32_NAMESPACE (daemon_run)
15
16/* This points to an internal Watt-32 function. ('__cdecl' on
17 * 'Win32/Win64. Otherwise default calling-convention). Watch out for
18 * $(CC) warnings when calling RUNDOWN_ADD(). The function MUST match
19 * the expected calling-convention. Your $(CC) may ignore an illegal
20 * cast of '(_VoidProc)func'.
21 */
22typedef void (W32_CALL *_VoidProc) (void);
23
24extern int startup_add (_VoidProc func, const char *name,
25 int order, const char *file, unsigned line);
26
27extern int rundown_add (_VoidProc func, const char *name,
28 int order, const char *file, unsigned line);
29
30extern int daemon_add (_VoidProc func, const char *name,
31 const char *file, unsigned line);
32
33extern int daemon_del (_VoidProc func, const char *name,
34 const char *file, unsigned line);
35
36extern void startup_run (void);
37extern void startup_dump (void);
38
39extern void rundown_run (void);
40extern void rundown_dump (void);
41
42extern int daemon_run (void);
43extern void daemon_clear (void);
44
45extern DWORD daemon_timeout (DWORD timeout);
46
47#define STARTUP_ADD(func,order) \
48 startup_add (func, #func, order, __FILE__, __LINE__)
49
50#define RUNDOWN_ADD(func,order) \
51 rundown_add (func, #func, order, __FILE__, __LINE__)
52
53#define DAEMON_ADD(func) \
54 daemon_add (func, #func, __FILE__, __LINE__)
55
56#define DAEMON_DEL(func) \
57 daemon_del (func, #func, __FILE__, __LINE__)
58
59#endif


Watt-32 tcp/ip: E:/WATT/src/sctp.h Source File

  • src
sctp.h
1/*
2 * SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of Cisco nor of Motorola may be used
16 * to endorse or promote products derived from this software without
17 * specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * This file is part of the SCTP reference Implementation
32 *
33 *
34 * Please send any bug reports or fixes you make to one of the following email
35 * addresses:
36 *
37 * rstewar1@email.mot.com
38 * kmorneau@cisco.com
39 * qxie1@email.mot.com
40 *
41 * Any bugs reported given to us we will try to fix... any fixes shared will
42 * be incorperated into the next SCTP release.
43 */
44
45#ifndef _w32_SCTP_H__
46#define _w32_SCTP_H__
47
48
49 /* If you wish to use MD5 instead of SLA uncomment the line
50 * below. Why you would like to do this:
51 * a) There may be IPR on SHA-1, or so the FIP-180-1 page says,
52 * b) MD5 is 3 times faster (has coded here).
53 *
54 * The disadvantage is, it is thought that MD5 has been
55 * cracked... see RFC2104.
56 */
57/*#define USE_MD5 1*/
58
59/* the SCTP protocol signature
60 * this includes the version number
61 * encoded in the last 4 bits of the
62 * signature.
63 */
64#define PROTO_SIGNATURE_A 0x30000000
65
66#define SCTP_VERSION_NUMBER 0x3
67
68#define MAX_TSN 0xffffffff
69#define MAX_SEQ 0xffff
70
71/* option:
72 * If you comment out the following you will
73 * receive the old behavior of obeying cwnd for
74 * the fast retransmit algorithm. With this defined
75 * a FR happens right away with-out waiting for the
76 * flightsize to drop below the cwnd value (which
77 * is reduced by the FR to 1/2 the inflight packets).
78 */
79#define SCTP_IGNORE_CWND_ON_FR 1
80/* default max I can burst out after a fast retransmit */
81#define SCTP_DEF_MAX_BURST 4
82
83/* Packet transmit states in the sent
84 * field in the SCTP_transmitOnQueue struct
85 */
86#define SCTP_DATAGRAM_UNSENT 0
87#define SCTP_DATAGRAM_SENT 1
88#define SCTP_DATAGRAM_RESEND1 2 /* not used */
89#define SCTP_DATAGRAM_RESEND2 3 /* not used */
90#define SCTP_DATAGRAM_RESEND3 4 /* not used */
91#define SCTP_DATAGRAM_RESEND 5
92#define SCTP_DATAGRAM_ACKED 10010
93#define SCTP_DATAGRAM_INBOUND 10011
94#define SCTP_READY_TO_TRANSMIT 10012
95#define SCTP_DATAGRAM_MARKED 20010
96
97#define MAX_FSID 64 /* debug 5 ints used for cc dynamic tracking */
98
99/* The valid defines for all message
100 * types know to SCTP. 0 is reserved
101 */
102#define SCTP_MSGTYPE_MASK 0xff
103
104#define SCTP_DATA 0x00
105#define SCTP_INITIATION 0x01
106#define SCTP_INITIATION_ACK 0x02
107#define SCTP_SELECTIVE_ACK 0x03
108#define SCTP_HEARTBEAT_REQUEST 0x04
109#define SCTP_HEARTBEAT_ACK 0x05
110#define SCTP_ABORT_ASSOCIATION 0x06
111#define SCTP_SHUTDOWN 0x07
112#define SCTP_SHUTDOWN_ACK 0x08
113#define SCTP_OPERATION_ERR 0x09
114#define SCTP_COOKIE_ECHO 0x0a
115#define SCTP_COOKIE_ACK 0x0b
116#define SCTP_ECN_ECHO 0x0c
117#define SCTP_ECN_CWR 0x0d
118#define SCTP_SHUTDOWN_COMPLETE 0x0e
119#define SCTP_ASCONF_ACK_CHUNK_ID 0x80
120#define SCTP_PKTDROP_CHUNK_ID 0x81
121#define SCTP_STREAM_RESET_CHUNK_ID 0x82
122#define SCTP_FORWARD_CUM_TSN 0xc0
123#define SCTP_RELIABLE_CNTL 0xc1
124#define SCTP_RELIABLE_CNTL_ACK 0xc2
125#define SCTP_IETF_EXT 0xFF
126
127/* ABORT and SHUTDOWN COMPLETE FLAG */
128#define SCTP_HAD_NO_TCB 0x01
129
130/* Data Chuck Specific Flags */
131#define SCTP_DATA_FRAG_MASK 0x03
132#define SCTP_DATA_MIDDLE_FRAG 0x00
133#define SCTP_DATA_LAST_FRAG 0x01
134#define SCTP_DATA_FIRST_FRAG 0x02
135#define SCTP_DATA_NOT_FRAG 0x03
136#define SCTP_DATA_UNORDERED 0x04
137
138#define SCTP_CRC_ENABLE_BIT 0x01 /* lower bit of reserved */
139
140#define isSCTPControl(a) (a->chunkID != SCTP_DATA)
141#define isSCTPData(a) (a->chunkID == SCTP_DATA)
142
143/* sctp parameter types for init/init-ack */
144
145#define SCTP_IPV4_PARAM_TYPE 0x0005
146#define SCTP_IPV6_PARAM_TYPE 0x0006
147#define SCTP_RESPONDER_COOKIE 0x0007
148#define SCTP_UNRECOG_PARAM 0x0008
149#define SCTP_COOKIE_PRESERVE 0x0009
150#define SCTP_HOSTNAME_VIA_DNS 0x000b
151#define SCTP_RESTRICT_ADDR_TO 0x000c
152
153#define SCTP_ECN_I_CAN_DO_ECN 0x8000
154#define SCTP_RANDOM_PARAM 0x8002
155#define SCTP_AUTH_CHUNK 0x8003
156#define SCTP_REQ_HMAC_ALGO 0x8004
157#define SCTP_SUPPORTED_EXT 0x8008
158
159#define SCTP_OPERATION_SUCCEED 0x4001
160#define SCTP_ERROR_NOT_EXECUTED 0x4002
161
162#define SCTP_UNRELIABLE_STRM 0xc000
163#define SCTP_ADD_IP_ADDRESS 0xc001
164#define SCTP_DEL_IP_ADDRESS 0xc002
165#define SCTP_STRM_FLOW_LIMIT 0xc003
166#define SCTP_PARTIAL_CSUM 0xc004
167#define SCTP_ERROR_CAUSE_TLV 0xc005
168#define SCTP_MIT_STACK_NAME 0xc006
169#define SCTP_SETADDRESS_PRIMARY 0xc007
170
171/* bits for TOS field */
172#define SCTP_ECT_BIT 0x02
173#define SCTP_CE_BIT 0x01
174
175/* error codes */
176#define SCTP_OP_ERROR_NO_ERROR 0x0000
177#define SCTP_OP_ERROR_INV_STRM 0x0001
178#define SCTP_OP_ERROR_MISS_PARAM 0x0002
179#define SCTP_OP_ERROR_STALE_COOKIE 0x0003
180#define SCTP_OP_ERROR_NO_RESOURCE 0x0004
181#define SCTP_OP_ERROR_DNS_FAILED 0x0005
182#define SCTP_OP_ERROR_UNK_CHUNK 0x0006
183#define SCTP_OP_ERROR_INV_PARAM 0x0007
184#define SCTP_OP_ERROR_UNK_PARAM 0x0008
185#define SCTP_OP_ERROR_NO_USERD 0x0009
186#define SCTP_OP_ERROR_COOKIE_SHUT 0x000a
187#define SCTP_OP_ERROR_DELETE_LAST 0x000b
188#define SCTP_OP_ERROR_RESOURCE_SHORT 0x000c
189
190#define SCTP_MAX_ERROR_CAUSE 12
191
192/* empty error causes i.e. nothing but the cause
193 * are SCTP_OP_ERROR_NO_RESOURCE, SCTP_OP_ERROR_INV_PARAM,
194 * SCTP_OP_ERROR_COOKIE_SHUT.
195 */
196
197/* parameter for Heart Beat */
198#define HEART_BEAT_PARAM 0x0001
199
200
201
202/* send options for SCTP
203 */
204#define SCTP_ORDERED_DELIVERY 0x01
205#define SCTP_NON_ORDERED_DELIVERY 0x02
206#define SCTP_DO_CRC16 0x08
207#define SCTP_MY_ADDRESS_ONLY 0x10
208
209/* below turns off above */
210#define SCTP_FLEXIBLE_ADDRESS 0x20
211#define SCTP_NO_HEARTBEAT 0x40
212
213/* mask to get sticky */
214#define SCTP_STICKY_OPTIONS_MASK 0x0c
215
216/* MTU discovery flags */
217#define SCTP_DONT_FRAGMENT 0x0100
218#define SCTP_FRAGMENT_OK 0x0200
219
220/* SCTP state defines for internal state machine */
221#define SCTP_STATE_EMPTY 0x0000
222#define SCTP_STATE_INUSE 0x0001
223#define SCTP_STATE_COOKIE_WAIT 0x0002
224#define SCTP_STATE_COOKIE_SENT 0x0004
225#define SCTP_STATE_OPEN 0x0008
226#define SCTP_STATE_SHUTDOWN 0x0010
227#define SCTP_STATE_SHUTDOWN_RECV 0x0020
228#define SCTP_STATE_SHUTDOWN_ACK_SENT 0x0040
229#define SCTP_STATE_SHUTDOWN_PEND 0x0080
230#define SCTP_STATE_MASK 0x007f
231
232/* SCTP reachability state for each address */
233#define SCTP_ADDR_NOT_REACHABLE 1
234#define SCTP_ADDR_REACHABLE 2
235#define SCTP_ADDR_NOHB 4
236#define SCTP_ADDR_BEING_DELETED 8
237
238/* How long a cookie lives */
239#define SCTP_DEFAULT_COOKIE_LIFE 60 /* seconds */
240
241/* resource limit of streams */
242#define MAX_SCTP_STREAMS 2048
243
244
245/* guess at how big to make the TSN mapping array */
246#define SCTP_STARTING_MAPARRAY 10000
247
248/* Here we define the timer types used
249 * by the implementation has
250 * arguments in the set/get timer type calls.
251 */
252#define SCTP_TIMER_INIT 0
253#define SCTP_TIMER_RECV 1
254#define SCTP_TIMER_SEND 2
255#define SCTP_TIMER_SHUTDOWN 3
256#define SCTP_TIMER_HEARTBEAT 4
257#define SCTP_TIMER_PMTU 5
258
259/* number of timer types in the base SCTP
260 * structure used in the set/get and has
261 * the base default.
262 */
263#define SCTP_NUM_TMRS 6
264
265#define SCTP_IPV4_ADDRESS 2
266#define SCTP_IPV6_ADDRESS 4
267
268/* timer types
269 */
270#define SctpTimerTypeNone 0
271#define SctpTimerTypeSend 1
272#define SctpTimerTypeInit 2
273#define SctpTimerTypeRecv 3
274#define SctpTimerTypeShutdown 4
275#define SctpTimerTypeHeartbeat 5
276#define SctpTimerTypeCookie 6
277#define SctpTimerTypeNewCookie 7
278#define SctpTimerTypePathMtuRaise 8
279#define SctpTimerTypeShutdownAck 9
280#define SctpTimerTypeRelReq 10
281
282/* Here are the timer directives given to the
283 * user provided function
284 */
285#define SCTP_TIMER_START 1
286#define SCTP_TIMER_STOP 2
287
288/* running flag states in timer structure */
289#define SCTP_TIMER_IDLE 0x0
290#define SCTP_TIMER_EXPIRED 0x1
291#define SCTP_TIMER_RUNNING 0x2
292
293
294/* number of simultaneous timers running */
295#define SCTP_MAX_NET_TIMERS 6 /* base of where net timers start */
296#define SCTP_NUMBER_TIMERS 12 /* allows up to 6 destinations */
297
298
299/* Of course we really don't collect stale cookies, being
300 * folks of decerning taste. However we do count them, if
301 * we get to many before the association comes up.. we
302 * give up. Below is the constant that dictates when
303 * we give it up...this is a implemenation dependant
304 * treatment. In ours we do not ask for a extension of
305 * time, but just retry this many times...
306 */
307#define SCTP_MAX_STALE_COOKIES_I_COLLECT 10
308
309/* max number of TSN's dup'd that I will hold */
310#define SCTP_MAX_DUP_TSNS 20
311
312/* Here we define the types used when
313 * setting the retry ammounts.
314 */
315/* constants for type of set */
316#define SCTP_MAXATTEMPT_INIT 2
317#define SCTP_MAXATTEMPT_SEND 3
318
319/* Here we define the default timers and the
320 * default number of attemts we make for
321 * each respective side (send/init).
322 */
323
324/* init timer def = 3sec */
325#define SCTP_INIT_SEC 3
326#define SCTP_INIT_NSEC 0
327
328/* send timer def = 3 seconds */
329#define SCTP_SEND_SEC 1
330#define SCTP_SEND_NSEC 0
331
332/* recv timer def = 200ms (in nsec) */
333#define SCTP_RECV_SEC 0
334#define SCTP_RECV_NSEC 200000000
335
336/* 30 seconds + RTO */
337#define SCTP_HB_SEC 30
338#define SCTP_HB_NSEC 0
339
340/* 300 ms */
341#define SCTP_SHUTDOWN_SEC 0
342#define SCTP_SHUTDOWN_NSEC 300000000
343
344#define SCTP_RTO_UPPER_BOUND 60000000 /* 60 sec in micro-second's */
345#define SCTP_RTO_UPPER_BOUND_SEC 60 /* for the init timer */
346#define SCTP_RTO_LOWER_BOUND 1000000 /* 1 sec in micro-sec's */
347
348#define SCTP_DEF_MAX_INIT 8
349#define SCTP_DEF_MAX_SEND 10
350
351#define SCTP_DEF_PMTU_RAISE 600 /* 10 Minutes between raise attempts */
352#define SCTP_DEF_PMTU_MIN 600
353
354#define SCTP_MSEC_IN_A_SEC 1000
355#define SCTP_USEC_IN_A_SEC 1000000
356#define SCTP_NSEC_IN_A_SEC 1000000000
357
358
359/* Events that SCTP will look for, these
360 * are or'd together to declare what SCTP
361 * wants. Each select mask/poll list should be
362 * set for the fd, if the bit is on.
363 */
364#define SCTP_EVENT_READ 0x000001
365#define SCTP_EVENT_WRITE 0x000002
366#define SCTP_EVENT_EXCEPT 0x000004
367
368/* The following constant is a value for this
369 * particular implemenation. It is quite arbitrary and
370 * is used to limit how much data will be queued up to
371 * a sender, waiting for cwnd to be larger than flightSize.
372 * All implementations will need this protection is some
373 * way due to buffer size constraints.
374 */
375
376#define SCTP_MAX_OUTSTANDING_DG 10000
377
378
379
380/* This constant (SCTP_MAX_READBUFFER) define
381 * how big the read/write buffer is
382 * when we enter the fd event notification
383 * the buffer is put on the stack, so the bigger
384 * it is the more stack you chew up, however it
385 * has got to be big enough to handle the bigest
386 * message this O/S will send you. In solaris
387 * with sockets (not TLI) we end up at a value
388 * of 64k. In TLI we could do partial reads to
389 * get it all in with less hassel.. but we
390 * write to sockets for generality.
391 */
392#define SCTP_MAX_READBUFFER 65536
393#define SCTP_ADDRMAX 60
394
395/* amount peer is obligated to have in rwnd or
396 * I will abort
397 */
398#define SCTP_MIN_RWND 1500
399
400#define SCTP_WINDOW_MIN 1500 /* smallest rwnd can be */
401#define SCTP_WINDOW_MAX 1048576 /* biggest I can grow rwnd to
402 * My playing around suggests a value greater
403 * than 64k does notdo much, I guess via the
404 * kernel limitations on the stream/socket.
405 */
406
407#define SCTP_MAX_BUNDLE_UP 256 /* max number of chunks I can bundle */
408
409/* I can handle a 1meg re-assembly */
410#define SCTP_DEFAULT_MAXMSGREASM 1048576
411
412#define SCTP_DEFAULT_MAXWINDOW 32768 /* default rwnd size */
413#define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the default
414 * to which we set the smallestMTU
415 * size to. This governs what is the
416 * largest size we will use, of course
417 * PMTU will raise this up to
418 * the largest interface MTU or the
419 * ceiling below if there is no
420 * SIOCGIFMTU.
421 */
422#define DEFAULT_MTU_CEILING 2048 /* If no SIOCGIFMTU, highest value
423 * to raise the PMTU to, i.e.
424 * don't try to raise above this
425 * value. Tune this per your
426 * largest MTU interface if your
427 * system does not support the
428 * SIOCGIFMTU ioctl.
429 */
430
431#define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */
432#define SCTP_HOW_MANY_SECRETS 2 /* how many secrets I keep */
433
434/* This is how long a secret lives, NOT how long a cookie lives */
435#define SCTP_HOW_LONG_COOKIE_LIVE 3600 /* how many seconds the current secret will live */
436
437#define SCTP_NUMBER_OF_SECRETS 8 /* or 8 * 4 = 32 octets */
438#define SCTP_SECRET_SIZE 32 /* number of octets in a 256 bits */
439
440#ifdef USE_MD5
441 #define SCTP_SIGNATURE_SIZE 16 /* size of a MD5 signature */
442#else
443 #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */
444#endif
445
446/* Here are the notification constants
447 * that the code and upper layer will get
448 */
449
450/* association is up */
451#define SCTP_NOTIFY_ASSOC_UP 1
452
453/* association is down */
454#define SCTP_NOTIFY_ASSOC_DOWN 2
455
456/* interface on a association is down
457 * and out of consideration for selection.
458 */
459#define SCTP_NOTIFY_INTF_DOWN 3
460
461/* interface on a association is up
462 * and now back in consideration for selection.
463 */
464#define SCTP_NOTIFY_INTF_UP 4
465
466/* The given datagram cannot be delivered
467 * to the peer, this will probably be followed
468 * by a SCTP_NOTFIY_ASSOC_DOWN.
469 */
470#define SCTP_NOTIFY_DG_FAIL 5
471
472/* Sent dg on non-open stream extreme code error!
473 */
474#define SCTP_NOTIFY_STRDATA_ERR 6
475
476#define SCTP_NOTIFY_ASSOC_ABORTED 7
477
478/* The stream ones are not used yet, but could
479 * be when a association opens.
480 */
481#define SCTP_NOTIFY_PEER_OPENED_STR 8
482#define SCTP_NOTIFY_STREAM_OPENED_OK 9
483
484/* association sees a restart event */
485#define SCTP_NOTIFY_ASSOC_RESTART 10
486
487/* a user requested HB returned */
488#define SCTP_NOTIFY_HB_RESP 11
489
490/* a result from a REL-REQ */
491#define SCTP_NOTIFY_RELREQ_RESULT_OK 12
492#define SCTP_NOTIFY_RELREQ_RESULT_FAILED 13
493
494/* clock variance is 10ms or 10,000 us's */
495#define SCTP_CLOCK_GRAINULARITY 10000
496
497#define IP_HDR_SIZE 40 /* we use the size of a IP6 header here
498 * this detracts a small amount for ipv4
499 * but it simplifies the ipv6 addition
500 */
501
502#define SCTP_NUM_FDS 3
503
504/* raw IP filedescriptor */
505#define SCTP_FD_IP 0
506
507/* raw ICMP filedescriptor */
508#define SCTP_FD_ICMP 1
509
510/* processes contact me for requests here */
511#define SCTP_REQUEST 2
512
513#define SCTP_DEAMON_PORT 9899
514
515/* Deamon registration message types/responses */
516#define DEAMON_REGISTER 0x01
517#define DEAMON_REGISTER_ACK 0x02
518#define DEAMON_DEREGISTER 0x03
519#define DEAMON_DEREGISTER_ACK 0x04
520#define DEAMON_CHECKADDR_LIST 0x05
521
522#define DEAMON_MAGIC_VER_LEN 0xff
523
524/* max times I will attempt to send a message to deamon */
525#define SCTP_MAX_ATTEMPTS_AT_DEAMON 5
526#define SCTP_TIMEOUT_IN_POLL_FOR_DEAMON 1500 /* 1.5 seconds */
527
528/* modular comparison */
529/* True if a > b (mod = M) */
530#define compare_with_wrap(a,b,M) ((a > b) && ((a - b) < (M >> 1))) || \
531 ((b > a) && ((b - a) > (M >> 1)))
532
533#ifndef TIMEVAL_TO_TIMESPEC
534 #define TIMEVAL_TO_TIMESPEC(tv,ts) { \
535 (ts)->tv_sec = (tv)->tv_sec; \
536 (ts)->tv_nsec = (tv)->tv_usec * 1000; \
537 }
538#endif
539
540/* pegs */
541#define SCTP_NUMBER_OF_PEGS 21
542
543/* peg index's */
544#define SCTP_PEG_SACKS_SEEN 0
545#define SCTP_PEG_SACKS_SENT 1
546#define SCTP_PEG_TSNS_SENT 2
547#define SCTP_PEG_TSNS_RCVD 3
548#define SCTP_DATAGRAMS_SENT 4
549#define SCTP_DATAGRAMS_RCVD 5
550#define SCTP_RETRANTSN_SENT 6
551#define SCTP_DUPTSN_RECVD 7
552#define SCTP_HBR_RECV 8
553#define SCTP_HBA_RECV 9
554#define SCTP_HB_SENT 10
555#define SCTP_DATA_DG_SENT 11
556#define SCTP_DATA_DG_RECV 12
557#define SCTP_TMIT_TIMER 13
558#define SCTP_RECV_TIMER 14
559#define SCTP_HB_TIMER 15
560#define SCTP_FAST_RETRAN 16
561#define SCTP_PEG_TSNS_READ 17
562#define SCTP_NONE_LFT_TO 18
563#define SCTP_NONE_LFT_RWND 19
564#define SCTP_NONE_LFT_CWND 20
565
566#include <sys/pack_on.h>
567
568struct sctp_Header {
569 WORD source;
570 WORD destination;
571 DWORD verificationTag;
572 DWORD adler32;
573 };
574
575/* various descriptor parsers */
576
577struct sctp_ChunkDesc {
578 BYTE chunkID;
579 BYTE chunkFlg;
580 WORD chunkLength;
581 };
582
583struct sctp_ParamDesc {
584 WORD paramType;
585 WORD paramLength;
586 };
587
588
589struct sctp_RelChunkDesc {
590 struct sctp_ChunkDesc chk;
591 DWORD serialNumber;
592 };
593
594struct sctp_VendorSpecificParam {
595 struct sctp_ParamDesc p; /* type must be 0xfffe */
596 DWORD vendorId; /* vendor ID from RFC 1700 */
597 WORD vendorSpecificType;
598 WORD vendorSpecificLen;
599 };
600
601
602/* Structures for the control parts
603 */
604
605/* Sctp association init request/ack */
606
607/* this is used for init ack, too */
608struct sctp_Initiation {
609 DWORD initTag; /* tag of mine */
610 DWORD rcvWindowCredit; /* rwnd */
611 WORD NumPreopenStreams; /* OS */
612 WORD MaxInboundStreams; /* MIS */
613 DWORD initialTSN;
614 /* optional param's follow in sctp_ParamDesc form */
615 };
616
617struct sctp_V4IpAddress{
618 struct sctp_ParamDesc p; /* type is set to SCTP_IPV4_PARAM_TYPE, len=10 */
619 DWORD ipAddress;
620 };
621
622
623struct sctp_V6IpAddress{
624 struct sctp_ParamDesc p; /* type is set to SCTP_IPV6_PARAM_TYPE, len=22 */
625 BYTE ipAddress[16];
626 };
627
628struct sctp_DNSName {
629 struct sctp_ParamDesc param;
630 BYTE name[1];
631 };
632
633
634struct sctp_CookiePreserve {
635 struct sctp_ParamDesc p; /* type is set to SCTP_COOKIE_PRESERVE, len=8 */
636 DWORD extraTime;
637};
638
639
640struct sctp_TimeStamp {
641 DWORD ts_sec;
642 DWORD ts_usec;
643};
644
645/* wire structure of my cookie */
646struct cookieMessage {
647 DWORD TieTag_curTag; /* copied from assoc if present */
648 DWORD TieTag_hisTag; /* copied from assoc if present */
649 DWORD cookieLife; /* life I will award this cookie */
650 struct sctp_TimeStamp timeEnteringState; /* the time I built cookie */
651 struct sctp_Initiation initAckISent; /* the INIT-ACK that I sent to my peer */
652 DWORD addressWhereISent[4]; /* I make this 4 ints so I get 128bits for future */
653 DWORD addrtype; /* address type */
654 WORD locScope; /* V6 local scope flag */
655 WORD siteScope; /* V6 site scope flag */
656
657 /* at the end is tacked on the INIT chunk sent in
658 * its entirety and of course our
659 * signature.
660 */
661 };
662
663
664/* this guy is for use when
665 * I have a initiate message gloming the
666 * things together.
667
668 */
669struct sctp_UnifiedInit {
670 struct sctp_ChunkDesc uh;
671 struct sctp_Initiation initm;
672 };
673
674struct sctp_SendableInit {
675 struct sctp_Header mh;
676 struct sctp_UnifiedInit msg;
677 };
678
679
680/* Selective Acknowledgement
681 * has the following structure with
682 * a optional ammount of trailing int's
683 * on the last part (based on the numberOfDesc
684 * field).
685 */
686
687struct sctp_SelectiveAck {
688 DWORD highestConseqTSN;
689 DWORD updatedRwnd;
690 WORD numberOfdesc;
691 WORD numDupTsns;
692};
693
694struct sctp_SelectiveFrag {
695 WORD fragmentStart;
696 WORD fragmentEnd;
697};
698
699
700struct sctp_UnifiedSack {
701 struct sctp_ChunkDesc uh;
702 struct sctp_SelectiveAck sack;
703};
704
705/* for both RTT request/response the
706 * following is sent
707 */
708
709struct sctp_HBrequest {
710 DWORD time_value_1;
711 DWORD time_value_2;
712};
713
714/* here is what I read and respond with to. */
715struct sctp_HBunified {
716 struct sctp_ChunkDesc hdr;
717 struct sctp_ParamDesc hb;
718};
719
720
721/* here is what I send */
722struct sctp_HBsender {
723 struct sctp_ChunkDesc hdr;
724 struct sctp_ParamDesc hb;
725 struct sctp_HBrequest rtt;
726 BYTE addrFmt[SCTP_ADDRMAX];
727 WORD userreq;
728};
729
730
731
732/* for the abort and shutdown ACK
733 * we must carry the init tag in the common header. Just the
734 * common header is all that is needed with a chunk descriptor.
735 */
736struct sctp_UnifiedAbort {
737 struct sctp_ChunkDesc uh;
738};
739
740struct sctp_UnifiedAbortLight {
741 struct sctp_Header mh;
742 struct sctp_ChunkDesc uh;
743};
744
745struct sctp_UnifiedAbortHeavy {
746 struct sctp_Header mh;
747 struct sctp_ChunkDesc uh;
748 WORD causeCode;
749 WORD causeLen;
750};
751
752/* For the graceful shutdown we must carry
753 * the tag (in common header) and the highest consequitive acking value
754 */
755struct sctp_Shutdown {
756 DWORD TSN_Seen;
757};
758
759struct sctp_UnifiedShutdown {
760 struct sctp_ChunkDesc uh;
761 struct sctp_Shutdown shut;
762};
763
764/* in the unified message we add the trailing
765 * stream id since it is the only message
766 * that is defined as a operation error.
767 */
768struct sctp_OpErrorCause {
769 WORD cause;
770 WORD causeLen;
771};
772
773struct sctp_UnifiedOpError {
774 struct sctp_ChunkDesc uh;
775 struct sctp_OpErrorCause c;
776};
777
778struct sctp_UnifiedStreamError {
779 struct sctp_Header mh;
780 struct sctp_ChunkDesc uh;
781 struct sctp_OpErrorCause c;
782 WORD strmNum;
783 WORD reserved;
784};
785
786struct staleCookieMsg {
787 struct sctp_Header mh;
788 struct sctp_ChunkDesc uh;
789 struct sctp_OpErrorCause c;
790 DWORD moretime;
791};
792
793/* the following is used in all sends
794 * where nothing is needed except the
795 * chunk/type i.e. shutdownAck Abort */
796
797struct sctp_UnifiedSingleMsg {
798 struct sctp_Header mh;
799 struct sctp_ChunkDesc uh;
800};
801
802struct sctp_DataPart {
803 DWORD TSN;
804 WORD streamId;
805 WORD sequence;
806 DWORD payloadtype;
807};
808
809struct sctp_UnifiedDatagram {
810 struct sctp_ChunkDesc uh;
811 struct sctp_DataPart dp;
812};
813
814struct sctp_ECN_echo {
815 struct sctp_ChunkDesc uh;
816 DWORD Lowest_TSN;
817};
818
819
820struct sctp_CWR {
821 struct sctp_ChunkDesc uh;
822 DWORD TSN_reduced_at;
823};
824
825#include <sys/pack_off.h>
826
827#endif
828
829
pack_off.h
pack_on.h
cookieMessage
Definition: sctp.h:646
sctp_CWR
Definition: sctp.h:820
sctp_ChunkDesc
Definition: sctp.h:577
sctp_CookiePreserve
Definition: sctp.h:634
sctp_DNSName
Definition: sctp.h:628
sctp_DataPart
Definition: sctp.h:802
sctp_ECN_echo
Definition: sctp.h:814
sctp_HBrequest
Definition: sctp.h:709
sctp_HBsender
Definition: sctp.h:722
sctp_HBunified
Definition: sctp.h:715
sctp_Header
Definition: sctp.h:568
sctp_Initiation
Definition: sctp.h:608
sctp_OpErrorCause
Definition: sctp.h:768
sctp_ParamDesc
Definition: sctp.h:583
sctp_RelChunkDesc
Definition: sctp.h:589
sctp_SelectiveAck
Definition: sctp.h:687
sctp_SelectiveFrag
Definition: sctp.h:694
sctp_SendableInit
Definition: sctp.h:674
sctp_Shutdown
Definition: sctp.h:755
sctp_TimeStamp
Definition: sctp.h:640
sctp_UnifiedAbortHeavy
Definition: sctp.h:745
sctp_UnifiedAbort
Definition: sctp.h:736
sctp_UnifiedAbortLight
Definition: sctp.h:740
sctp_UnifiedDatagram
Definition: sctp.h:809
sctp_UnifiedInit
Definition: sctp.h:669
sctp_UnifiedOpError
Definition: sctp.h:773
sctp_UnifiedSack
Definition: sctp.h:700
sctp_UnifiedShutdown
Definition: sctp.h:759
sctp_UnifiedSingleMsg
Definition: sctp.h:797
sctp_UnifiedStreamError
Definition: sctp.h:778
sctp_V4IpAddress
Definition: sctp.h:617
sctp_V6IpAddress
Definition: sctp.h:623
sctp_VendorSpecificParam
Definition: sctp.h:594
staleCookieMsg
Definition: sctp.h:786


Watt-32 tcp/ip: E:/WATT/src/select.c File Reference

  • src
Functions
select.c File Reference

Go to the source code of this file.

Functions

static int | read_select (int s, Socket *socket)
static int | write_select (int s, Socket *socket)
static int | exc_select (int s, Socket *socket)
static int | select_one (int fd, Socket *socket, int events)
static int | poll_one (int fd, Socket *socket, int events)
static __inline Socket * | setup_select (int s, BOOL first_loop)
int W32_CALL | select_s (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
The select_s() function.
int W32_CALL | select (int nfds, fd_set *read_fds, fd_set *write_fds, fd_set *except_fds, struct timeval *timeout)
int W32_CALL | poll (struct pollfd *p, int num, int timeout_ms)
int | _fsext_ready (int fd)
int | pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timespec *timeout, const sigset_t *sigmask)
static __inline int | listen_queued (Socket *socket)
static __inline int | sock_signalled (Socket *socket, int mask)
static BOOL | handle_ready (int hnd)
static BOOL | still_connecting (Socket *socket)
void | usage (const char *argv0)
char * | fd_set_str (char *buf, size_t len, const fd_set *fd)
void | select_dump (int sock_err, int num_fd, const struct timeval *tv, const fd_set *fd_read, const fd_set *fd_write, const fd_set *fd_except)
int | main (int argc, char **argv)

Detailed Description

BSD select(), poll().

Definition in file select.c.

Function Documentation

◆ _fsext_ready()

int _fsext_ready ( int fd )

Definition at line 450 of file select.c.

◆ exc_select()

static int exc_select | ( | int | s,
 |  | Socket * | socket
 | ) |  |
static
Todo:
Only arrival of OOB-data should count here

Definition at line 685 of file select.c.

◆ fd_set_str()

char * fd_set_str | ( | char * | buf,
 |  | size_t | len,
 |  | const fd_set * | fd
 | ) |  |

Definition at line 820 of file select.c.

◆ handle_ready()

static BOOL handle_ready ( int hnd )
static

Definition at line 549 of file select.c.

◆ listen_queued()

static __inline int listen_queued ( Socket * socket )
static

Definition at line 504 of file select.c.

◆ main()

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 865 of file select.c.

◆ poll()

int W32_CALL poll | ( | struct pollfd * | p,
 |  | int | num,
 |  | int | timeout_ms
 | ) |  |

Definition at line 357 of file select.c.

◆ poll_one()

static int poll_one | ( | int | fd,
 |  | Socket * | socket,
 |  | int | events
 | ) |  |
static

Definition at line 751 of file select.c.

◆ pselect()

int pselect | ( | int | nfds,
 |  | fd_set * | readfds,
 |  | fd_set * | writefds,
 |  | fd_set * | exceptfds,
 |  | struct timespec * | timeout,
 |  | const sigset_t * | sigmask
 | ) |  |

Definition at line 475 of file select.c.

◆ read_select()

static int read_select | ( | int | s,
 |  | Socket * | socket
 | ) |  |
static

Definition at line 571 of file select.c.

◆ select()

int W32_CALL select | ( | int | nfds,
 |  | fd_set * | read_fds,
 |  | fd_set * | write_fds,
 |  | fd_set * | except_fds,
 |  | struct timeval * | timeout
 | ) |  |

Definition at line 347 of file select.c.

◆ select_dump()

void select_dump | ( | int | sock_err,
 |  | int | num_fd,
 |  | const struct timeval * | tv,
 |  | const fd_set * | fd_read,
 |  | const fd_set * | fd_write,
 |  | const fd_set * | fd_except
 | ) |  |

Definition at line 848 of file select.c.

◆ select_one()

static int select_one | ( | int | fd,
 |  | Socket * | socket,
 |  | int | events
 | ) |  |
static

Definition at line 716 of file select.c.

◆ select_s()

int W32_CALL select_s | ( | int | nfds,
 |  | fd_set * | readfds,
 |  | fd_set * | writefds,
 |  | fd_set * | exceptfds,
 |  | struct timeval * | timeout
 | ) |  |

The select_s() function.

Note
It supports more sockets than would fit in a fd_set. I.e. it handles an array of 'fd_set's on input/output. Thus it is the user's responsibilty to not use a too high 'nfds' value. I.e. If nfs > 512*8 and user fd_set's on input is smaller than 512*, select_s() could trash the fd_set's on output.

Clear our "working" fd_sets.

Note
Don't use FD_ZERO() since our working fd_sets contain more than FD_SETSIZE sockets.

Definition at line 107 of file select.c.

References _sock_crit_start(), _sock_crit_stop(), and timeval_diff().

◆ setup_select()

static __inline Socket * setup_select | ( | int | s,
 |  | BOOL | first_loop
 | ) |  |
static

Definition at line 77 of file select.c.

◆ sock_signalled()

static __inline int sock_signalled | ( | Socket * | socket,
 |  | int | mask
 | ) |  |
static

Definition at line 536 of file select.c.

◆ still_connecting()

static BOOL still_connecting ( Socket * socket )
static

Definition at line 705 of file select.c.

◆ usage()

void usage ( const char * argv0 )

Definition at line 808 of file select.c.

◆ write_select()

static int write_select | ( | int | s,
 |  | Socket * | socket
 | ) |  |
static

Definition at line 637 of file select.c.


Watt-32 tcp/ip: E:/WATT/src/settod.c File Reference

  • src
Functions
settod.c File Reference

Go to the source code of this file.

Functions

int MS_CDECL settimeofday (struct timeval *tv,...)

Detailed Description

settimeofday() for non-djgpp targets.

The exported prototype used is used is the one specified in the XOpen/POSIX 1.3 standards and the one used on modern (ie 4.4BSD spec) BSDs. ie 'int settimeofday(struct timeval *, ...)', ie the second arg, if specified, is ignored.

Cyrus Patel cyp@f.nosp@m.b14..nosp@m.uni-m.nosp@m.ainz.nosp@m..de

May 2001 - Created

Definition in file settod.c.

Function Documentation

◆ settimeofday()

int MS_CDECL settimeofday | ( | struct timeval * | tv,
 |  |  | ...
 | ) |  |

Definition at line 25 of file settod.c.


Watt-32 tcp/ip: E:/WATT/src/settod.h File Reference

  • src
Functions
settod.h File Reference

Go to the source code of this file.

Functions

int MS_CDECL settimeofday (struct timeval *tv,...)

Detailed Description

settimeofday() for non-djgpp targets.

The exported prototype used is the one specified in the XOpen/POSIX 1.3 standards and the one used on modern (ie 4.4BSD spec) BSDs. ie 'int settimeofday (struct timeval *, ...)', i.e. the second arg, if specified, is ignored.

Definition in file settod.h.

Function Documentation

◆ settimeofday()

int MS_CDECL settimeofday | ( | struct timeval * | tv,
 |  |  | ...
 | ) |  |

Definition at line 25 of file settod.c.


Watt-32 tcp/ip: E:/WATT/src/shutdown.c File Reference

  • src
Functions
shutdown.c File Reference

Go to the source code of this file.

Functions

int W32_CALL shutdown (int s, int how)

Detailed Description

BSD shutdown().

Definition in file shutdown.c.

Function Documentation

◆ shutdown()

int W32_CALL shutdown | ( | int | s,
 |  | int | how
 | ) |  |
Todo:
For tcp, should send RST if we get incoming data. Don't send ICMP error.
Todo:
For tcp, should send FIN when all Tx data has been ack'ed. close_s(s) should be same as shutdown(s,SHUT_WR)

Definition at line 42 of file shutdown.c.

References _socklist_find().


Watt-32 tcp/ip: E:/WATT/src/signal.c File Reference

  • src
Data Structures | Functions | Variables
signal.c File Reference

Go to the source code of this file.

Data Structures

struct signal_table

Functions

static void MS_CDECL | sig_catch (int sig)
int | _sock_sig_setup (void)
int | _sock_sig_pending (void)
int | _sock_sig_restore (void)
int | _sock_sig_epipe (const Socket *sock)

Variables

static struct signal_table | sig_tab []
static int | signal_depth = 0

Detailed Description

Signal handlers for BSD socket API.

Definition in file signal.c.

Function Documentation

◆ _sock_sig_epipe()

int _sock_sig_epipe ( const Socket * sock )

Definition at line 238 of file signal.c.

◆ _sock_sig_pending()

int _sock_sig_pending ( void )

Definition at line 153 of file signal.c.

◆ _sock_sig_restore()

int _sock_sig_restore ( void )

Definition at line 175 of file signal.c.

◆ _sock_sig_setup()

int _sock_sig_setup ( void )

Definition at line 113 of file signal.c.

◆ sig_catch()

static void MS_CDECL sig_catch ( int sig )
static

Definition at line 95 of file signal.c.

Variable Documentation

◆ sig_tab

struct signal_table sig_tab[]
static
Initial value:
= {
{ NULL, SIGINT, "SIGINT", FALSE, TRUE },
#if defined(SIGBREAK)
{ NULL, SIGBREAK, "SIGBREAK",FALSE, TRUE },
#endif
#if defined(SIGQUIT)
{ NULL, SIGQUIT, "SIGQUIT", FALSE, TRUE },
#endif
#if defined(SIGPIPE)
{ NULL, SIGPIPE, "SIGPIPE", FALSE, FALSE },
#endif
#if defined(SIGALRM) && 0
{ NULL, SIGALRM, "SIGALRM", FALSE, FALSE },
#endif
}

Definition at line 68 of file signal.c.

◆ signal_depth

int signal_depth = 0
static

Definition at line 84 of file signal.c.


Watt-32 tcp/ip: E:/WATT/src/sock_dbu.c File Reference

  • src
Functions
sock_dbu.c File Reference

Go to the source code of this file.

Functions

void W32_CALL sock_debugdump (const sock_type *s)

Detailed Description

sock_type debug dump.

Definition in file sock_dbu.c.

Function Documentation

◆ sock_debugdump()

void W32_CALL sock_debugdump ( const sock_type * s )

Definition at line 14 of file sock_dbu.c.


Watt-32 tcp/ip: E:/WATT/src/sock_in.c File Reference

  • src
Functions
sock_in.c File Reference

Go to the source code of this file.

Functions

void W32_CALL | ip_timer_init (sock_type *s, unsigned seconds)
int W32_CALL | ip_timer_expired (const sock_type *s)
int W32_CALL | _ip_delay0 (sock_type *s, int timeout_sec, UserHandler fn, int *statusptr)
int W32_CALL | _ip_delay1 (sock_type *s, int timeoutseconds, UserHandler fn, int *statusptr)
int W32_CALL | _ip_delay2 (sock_type *s, int timeoutseconds, UserHandler fn, int *statusptr)
int W32_CALL | sock_timeout (sock_type *s, int sec)
int W32_CALL | sock_established (sock_type *s)

Detailed Description

SOCK_IN: User input functions moved from pctcp.c.

Functions used in these macros: sock_wait_established() sock_wait_input() sock_wait_closed();

Definition in file sock_in.c.

Function Documentation

◆ _ip_delay0()

int W32_CALL _ip_delay0 | ( | sock_type * | s,
 |  | int | timeout_sec,
 |  | UserHandler | fn,
 |  | int * | statusptr
 | ) |  |

Definition at line 45 of file sock_in.c.

◆ _ip_delay1()

int W32_CALL _ip_delay1 | ( | sock_type * | s,
 |  | int | timeoutseconds,
 |  | UserHandler | fn,
 |  | int * | statusptr
 | ) |  |

Definition at line 99 of file sock_in.c.

◆ _ip_delay2()

int W32_CALL _ip_delay2 | ( | sock_type * | s,
 |  | int | timeoutseconds,
 |  | UserHandler | fn,
 |  | int * | statusptr
 | ) |  |

Definition at line 153 of file sock_in.c.

◆ ip_timer_expired()

int W32_CALL ip_timer_expired ( const sock_type * s )

Definition at line 34 of file sock_in.c.

◆ ip_timer_init()

void W32_CALL ip_timer_init | ( | sock_type * | s,
 |  | unsigned | seconds
 | ) |  |

Definition at line 27 of file sock_in.c.

◆ sock_established()

int W32_CALL sock_established ( sock_type * s )

Definition at line 221 of file sock_in.c.

◆ sock_timeout()

int W32_CALL sock_timeout | ( | sock_type * | s,
 |  | int | sec
 | ) |  |

Definition at line 205 of file sock_in.c.


Watt-32 tcp/ip: E:/WATT/src/sock_ini.c File Reference

  • src
Typedefs | Functions | Variables
sock_ini.c File Reference

Go to the source code of this file.

Typedefs

typedef void(MS_CDECL * | _signal_handler) (int)
typedef void(MS_CDECL * | _atexit_handler) (void)

Functions

WattUserConfigFunc W32_CALL | _watt_user_config (WattUserConfigFunc fn)
A user application may call the ‘_watt_user_config()’ function prior to calling sock_init() to inject its own configuration values into the tcp_config() parser.
static int | do_exit (int code)
Exit application if _watt_do_exit is TRUE (the default).
static void | pre_except_handler (const struct FAULT_STRUC *exc)
static void | do_traceback (void)
static void | except_handler (int sig)
static void | except_handler (excReg *regs)
static void | except_handler (int sig, int code)
static void | setup_sig_handlers (void)
Install signal-handlers for fatal errors; SIGSEGV, SIGILL, SIGTRAP, SIGFPE etc.
static void W32_CALL | restore_sig_handlers (void)
static void | tcp_shutdown (void)
Abort all TCP sockets, release DHCP lease and restore signal handlers.
static int | tcp_init (void)
Initialise the PKTDRVR or WinPcap driver (calls _eth_init()).
static void | tcp_post_init (void)
Initialise stuff based on configured values.
static int | tcp_do_bootp (BOOL try_bootp, BOOL try_dhcp, BOOL try_rarp)
Try to boot-up the stack using BOOTP, DHCP or RARP.
static void | check_sock_sizes (size_t tcp_Sock_size, size_t udp_Sock_size)
static void | check_time_t (size_t time_t_size)
static void | check_mingw (void)
const char *W32_CALL | sock_init_err (int rc)
static void W32_CALL | daemon_clear_cdecl (void)
int W32_CALL | watt_sock_init (size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
int W32_CALL | sock_init (void)
void MS_CDECL | sock_exit (void)
Our only atexit() handler.
void W32_CALL | sock_sig_exit (const char *msg, int sig)
Exit handler for unhandled signals.

Variables

BOOL | _bootp_on = FALSE
Try booting using BOOTP ?
BOOL | _dhcp_on = FALSE
Try booting using DHCP ?
BOOL | _dhcp6_on = FALSE
Try booting using DHCP6 ?
BOOL | _rarp_on = FALSE
Try booting using RARP ?
BOOL | _do_mask_req = FALSE
do an "ICMP Mask Request" when configured
BOOL | _watt_no_config = FALSE
run with no config file (embedded/diskless)
BOOL | _watt_do_exit = TRUE
exit program when all boot attempts failed
WattUserConfigFunc | _watt_user_config_fn = NULL
BOOL | survive_eth = 0
GvB 2002-09, allows us to survive without a (working) packet driver at all - in cases where life still has a meaning without TCP/IP.
BOOL | survive_bootp = TRUE
Survive a failed BOOTP attempt.
BOOL | survive_dhcp = TRUE
Survive a failed DHCP attempt.
BOOL | survive_rarp = FALSE
Don't survive a failed RARP attempt.
BOOL | _watt_is_init = FALSE
watt_sock_init() done (but with possible failed boot)
static BOOL | tcp_is_init = FALSE
tcp_init() called okay.
static int | old_break = -1
Original state of DOS's BREAK handler.
static BOOL | use_except = TRUE
Some target dependent functions.
static jmp_buf | exc_jmp
static struct FAULT_STRUC | exc_buf
static BOOL | sock_init_called = FALSE
The main initialisation routine.

Detailed Description

Watt-32 initialisation.

watt_sock_init() - easy way to guarentee:

  • card is ready
  • shutdown is handled
  • ^C/^BREAK are handled
  • WATTCP.CFG config file is read
  • BOOTP/PCDHCP/RARP is run
Version
0.1: May 2, 1991 Erick - reorganized operations.
0.2: 1998 Gisle V. - Major rewrite; added DHCP, additional startup checks for various targets. Exception handler releases PKTDRVR.

Definition in file sock_ini.c.

Typedef Documentation

◆ _atexit_handler

typedef void(MS_CDECL * _atexit_handler) (void)

Definition at line 127 of file sock_ini.c.

◆ _signal_handler

typedef void(MS_CDECL * _signal_handler) (int)

Definition at line 126 of file sock_ini.c.

Function Documentation

◆ _watt_user_config()

WattUserConfigFunc W32_CALL _watt_user_config ( WattUserConfigFunc fn )

A user application may call the ‘_watt_user_config()’ function prior to calling sock_init() to inject its own configuration values into the tcp_config() parser.

Useful when running diskless and setting ‘_watt_no_config = 0’.

Example:

  • 'pass' is 1 for first pass (PKTDRVR/WinPcap configuration), 2 for second pass.
  • 'cfg' is a pointer to the configuration table and must be passed to tcp_inject_config() as-is.

In most cases 'pass' can probably be ignored.

static long my_config_fn (int pass, const struct config_table *cfg) { // Keyword case is not significant (tcp_inject_config will convert // all keys to uppercase)

tcp_inject_config (cfg, "My_IP", "192.168.0.98"); tcp_inject_config (cfg, "NetMask", "255.255.255.0"); tcp_inject_config (cfg, "Gateway", "192.168.0.1"); (void)pass; return (1); // Returning 0 would make tcp_config() return 0 too, // as if the config file was not found }

int main (void) { _watt_no_config = 1; _watt_user_config (my_config_fn); if (sock_init()) return (-1); ... }

Never called inside Watt-32.

Definition at line 200 of file sock_ini.c.

◆ check_mingw()

static void check_mingw ( void )
static

Definition at line 705 of file sock_ini.c.

◆ check_sock_sizes()

static void check_sock_sizes | ( | size_t | tcp_Sock_size,
 |  | size_t | udp_Sock_size
 | ) |  |
static

Definition at line 657 of file sock_ini.c.

◆ check_time_t()

static void check_time_t ( size_t time_t_size )
static

Definition at line 676 of file sock_ini.c.

◆ daemon_clear_cdecl()

static void W32_CALL daemon_clear_cdecl ( void )
static

Definition at line 757 of file sock_ini.c.

◆ do_exit()

static int do_exit ( int code )
static

Exit application if _watt_do_exit is TRUE (the default).

Otherwise return 'code'. Only called during watt_sock_init().

Definition at line 212 of file sock_ini.c.

References _watt_do_exit.

◆ do_traceback()

static void do_traceback ( void )
static

Definition at line 236 of file sock_ini.c.

◆ except_handler() [1/3]

static void except_handler ( excReg * regs )
static

Definition at line 296 of file sock_ini.c.

◆ except_handler() [2/3]

static void except_handler ( int sig )
static
Todo:
Disassemble crash address. Don't confuse this yet-to-be function with the function ShowStack() in stkwalk.cpp. That one is for Win32 only.

Definition at line 265 of file sock_ini.c.

References _watt_fatal_error.

◆ except_handler() [3/3]

static void except_handler | ( | int | sig,
 |  | int | code
 | ) |  |
static

Definition at line 310 of file sock_ini.c.

◆ pre_except_handler()

static void pre_except_handler ( const struct FAULT_STRUC * exc )
static

Definition at line 229 of file sock_ini.c.

◆ restore_sig_handlers()

static void W32_CALL restore_sig_handlers ( void )
static

Definition at line 428 of file sock_ini.c.

◆ setup_sig_handlers()

static void setup_sig_handlers ( void )
static

Install signal-handlers for fatal errors; SIGSEGV, SIGILL, SIGTRAP, SIGFPE etc.

Definition at line 371 of file sock_ini.c.

References except_handler(), and use_except.

◆ sock_exit()

void MS_CDECL sock_exit ( void )

Our only atexit() handler.

Called only once during normal program shutdown. Exception handlers exit differently (see except_handler() above)

Definition at line 1058 of file sock_ini.c.

References _watt_fatal_error, _watt_is_init, sock_init_called, and tcp_shutdown().

◆ sock_init()

int W32_CALL sock_init ( void )

Definition at line 1047 of file sock_ini.c.

◆ sock_init_err()

const char *W32_CALL sock_init_err ( int rc )

Definition at line 714 of file sock_ini.c.

◆ sock_sig_exit()

void W32_CALL sock_sig_exit | ( | const char * | msg,
 |  | int | sig
 | ) |  |

Exit handler for unhandled signals.

Definition at line 1076 of file sock_ini.c.

References _watt_cbroke, and sock_exit().

◆ tcp_do_bootp()

static int tcp_do_bootp | ( | BOOL | try_bootp,
 |  | BOOL | try_dhcp,
 |  | BOOL | try_rarp
 | ) |  |
static

Try to boot-up the stack using BOOTP, DHCP or RARP.

Only called if at least one '_*on' flag is set.

Return values
0 on success.

Definition at line 591 of file sock_ini.c.

References BOOTP_do_boot(), DHCP_do_boot(), survive_bootp, survive_dhcp, and survive_rarp.

◆ tcp_init()

static int tcp_init ( void )
static

Initialise the PKTDRVR or WinPcap driver (calls _eth_init()).

  • Reset nameserver table.
  • Initialise local ports.
  • Get machine name (w/o domain) from LAN extension (if any).
  • Prepare parsing TCP configuration.
Note
May be called more than once without hurting.

Definition at line 496 of file sock_ini.c.

References _eth_init(), _get_machine_name(), hostname, init_localport(), and tcp_is_init.

◆ tcp_post_init()

static void tcp_post_init ( void )
static

Initialise stuff based on configured values.

Definition at line 526 of file sock_ini.c.

References _eth_ndis3pkt, pkt_get_mtu(), ReadEthersFile(), tcp_is_init, and tcp_recv_win.

◆ tcp_shutdown()

static void tcp_shutdown ( void )
static

Abort all TCP sockets, release DHCP lease and restore signal handlers.

Definition at line 459 of file sock_ini.c.

References _tcp_allsocs, _udp_allsocs, DHCP_release(), pppoe_exit(), and tcp_is_init.

◆ watt_sock_init()

int W32_CALL watt_sock_init | ( | size_t | tcp_Sock_size,
 |  | size_t | udp_Sock_size,
 |  | size_t | time_t_size
 | ) |  |
Todo:
Use auto-configuration and set 'my_ip_addr' to 169.254/16

Definition at line 769 of file sock_ini.c.

References _arp_check_gateways(), _arp_init(), _bootp_on, _dhcp_on, _do_mask_req, _inet_ntoa(), _pkt_inf, _rarp_on, _watt_is_init, _watt_no_config, DHCP_init(), DHCP_read_config(), do_exit(), echo_discard_init(), init_misc(), my_ip_addr, old_break, pppoe_init(), pppoe_start(), reverse_lookup_myip(), setup_sig_handlers(), sin_mask, sock_exit(), sock_init_called, survive_eth, tcp_cbreak(), tcp_do_bootp(), tcp_init(), tcp_post_init(), tftp_boot_load(), and tftp_init().

Variable Documentation

◆ _bootp_on

BOOL _bootp_on = FALSE

Try booting using BOOTP ?

Definition at line 129 of file sock_ini.c.

◆ _dhcp6_on

BOOL _dhcp6_on = FALSE

Try booting using DHCP6 ?

Definition at line 131 of file sock_ini.c.

◆ _dhcp_on

BOOL _dhcp_on = FALSE

Try booting using DHCP ?

Definition at line 130 of file sock_ini.c.

◆ _do_mask_req

BOOL _do_mask_req = FALSE

do an "ICMP Mask Request" when configured

Definition at line 133 of file sock_ini.c.

◆ _rarp_on

BOOL _rarp_on = FALSE

Try booting using RARP ?

Definition at line 132 of file sock_ini.c.

◆ _watt_do_exit

BOOL _watt_do_exit = TRUE

exit program when all boot attempts failed

Definition at line 136 of file sock_ini.c.

◆ _watt_is_init

BOOL _watt_is_init = FALSE

watt_sock_init() done (but with possible failed boot)

Definition at line 158 of file sock_ini.c.

◆ _watt_no_config

BOOL _watt_no_config = FALSE

run with no config file (embedded/diskless)

Definition at line 134 of file sock_ini.c.

◆ _watt_user_config_fn

WattUserConfigFunc _watt_user_config_fn = NULL

Definition at line 138 of file sock_ini.c.

◆ exc_buf

struct FAULT_STRUC exc_buf
static

Definition at line 227 of file sock_ini.c.

◆ exc_jmp

jmp_buf exc_jmp
static

Definition at line 226 of file sock_ini.c.

◆ old_break

int old_break = -1
static

Original state of DOS's BREAK handler.

Definition at line 161 of file sock_ini.c.

◆ sock_init_called

BOOL sock_init_called = FALSE
static

The main initialisation routine.

Called only once (during program startup). sock_init() is a macro in <tcp.h>.

Definition at line 767 of file sock_ini.c.

◆ survive_bootp

BOOL survive_bootp = TRUE

Survive a failed BOOTP attempt.

Don't survive a failed BOOTP attempt.

Definition at line 146 of file sock_ini.c.

◆ survive_dhcp

BOOL survive_dhcp = TRUE

Survive a failed DHCP attempt.

Don't survive a failed DHCP attempt.

Definition at line 152 of file sock_ini.c.

◆ survive_eth

BOOL survive_eth = 0

GvB 2002-09, allows us to survive without a (working) packet driver at all - in cases where life still has a meaning without TCP/IP.

Definition at line 140 of file sock_ini.c.

◆ survive_rarp

BOOL survive_rarp = FALSE

Don't survive a failed RARP attempt.

Definition at line 157 of file sock_ini.c.

◆ tcp_is_init

BOOL tcp_is_init = FALSE
static

tcp_init() called okay.

Definition at line 160 of file sock_ini.c.

◆ use_except

BOOL use_except = TRUE
static

Some target dependent functions.

Install signal handlers.

Definition at line 222 of file sock_ini.c.


Watt-32 tcp/ip: E:/WATT/src/sock_ini.h File Reference

  • src
Enumerations | Functions | Variables
sock_ini.h File Reference

Go to the source code of this file.

Enumerations

enum eth_init_result {
WERR_NO_ERROR ,
WERR_ILL_DOSX ,
WERR_NO_MEM ,
WERR_NO_DRIVER ,
WERR_PKT_ERROR ,
WERR_BOOTP_FAIL ,
WERR_DHCP_FAIL ,
WERR_RARP_FAIL ,
WERR_NO_IPADDR ,
WERR_PPPOE_DISC
}

Functions

static int sock_init (void)

Variables

int | _bootp_on
Try booting using BOOTP ?
int | _dhcp_on
Try booting using DHCP ?
int | _dhcp6_on
Try booting using DHCP6 ?
int | _rarp_on
Try booting using RARP ?
BOOL | _do_mask_req
do an "ICMP Mask Request" when configured
BOOL | _watt_is_init
watt_sock_init() done (but with possible failed boot)
W32_DATA BOOL | _watt_do_exit
BOOL | survive_eth
GvB 2002-09, allows us to survive without a (working) packet driver at all - in cases where life still has a meaning without TCP/IP.
BOOL | survive_bootp
BOOL | survive_dhcp
Survive a failed DHCP attempt.
BOOL | survive_rarp
WattUserConfigFunc | _watt_user_config_fn

Enumeration Type Documentation

◆ eth_init_result

enum eth_init_result

Definition at line 6 of file sock_ini.h.

Function Documentation

◆ sock_init()

static int sock_init ( void )
static

Definition at line 50 of file sock_ini.h.

Variable Documentation

◆ _bootp_on

int _bootp_on
extern

Try booting using BOOTP ?

Definition at line 129 of file sock_ini.c.

◆ _dhcp6_on

int _dhcp6_on
extern

Try booting using DHCP6 ?

Definition at line 131 of file sock_ini.c.

◆ _dhcp_on

int _dhcp_on
extern

Try booting using DHCP ?

Definition at line 130 of file sock_ini.c.

◆ _do_mask_req

BOOL _do_mask_req
extern

do an "ICMP Mask Request" when configured

Definition at line 133 of file sock_ini.c.

◆ _rarp_on

int _rarp_on
extern

Try booting using RARP ?

Definition at line 132 of file sock_ini.c.

◆ _watt_do_exit

W32_DATA BOOL _watt_do_exit

Definition at line 37 of file sock_ini.h.

◆ _watt_is_init

BOOL _watt_is_init
extern

watt_sock_init() done (but with possible failed boot)

Definition at line 158 of file sock_ini.c.

◆ _watt_user_config_fn

WattUserConfigFunc _watt_user_config_fn
extern

Definition at line 138 of file sock_ini.c.

◆ survive_bootp

BOOL survive_bootp

Definition at line 39 of file sock_ini.h.

◆ survive_dhcp

BOOL survive_dhcp
extern

Survive a failed DHCP attempt.

Don't survive a failed DHCP attempt.

Definition at line 152 of file sock_ini.c.

◆ survive_eth

BOOL survive_eth
extern

GvB 2002-09, allows us to survive without a (working) packet driver at all - in cases where life still has a meaning without TCP/IP.

Definition at line 140 of file sock_ini.c.

◆ survive_rarp

BOOL survive_rarp

Definition at line 40 of file sock_ini.h.


Watt-32 tcp/ip: E:/WATT/src/sock_io.c File Reference

  • src
Functions
sock_io.c File Reference

Go to the source code of this file.

Functions

BYTE W32_CALL | sock_putc (sock_type *s, BYTE c)
int W32_CALL | sock_puts (sock_type *s, const BYTE *data)
WORD W32_CALL | sock_gets (sock_type *s, BYTE *data, int bmax)
int W32_CALL | sock_getc (sock_type *s)
WORD W32_CALL | sock_dataready (sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
int W32_CALL | sock_putcw (sock_type *s, wchar_t ch)
int W32_CALL | sock_putsw (sock_type *s, const wchar_t *data)
int W32_CALL | sock_getsw (sock_type *s, wchar_t *data, int n)
wchar_t W32_CALL | sock_getcw (sock_type *s)

Detailed Description

some sock_xx() functions moved from pctcp.c due to memory contraints under Turbo-C

Definition in file sock_io.c.

Function Documentation

◆ sock_dataready()

WORD W32_CALL sock_dataready ( sock_type * s )

sock_dataready - returns number of bytes waiting to be read.

  • if in ASCII mode, return >0 if a terminated line is present or the buffer is full or state is LASTACK (tcp only).
  • if in binary mode (default), simply return number of bytes in receive buffer.
  • For UDP or TCP sockets only.

Definition at line 246 of file sock_io.c.

References _raw_Socket::ip_type, and tcp_Socket::state.

◆ sock_getc()

int W32_CALL sock_getc ( sock_type * s )

Definition at line 232 of file sock_io.c.

◆ sock_getcw()

wchar_t W32_CALL sock_getcw ( sock_type * s )
Todo:
Wide character version of sock_getc()

Definition at line 322 of file sock_io.c.

◆ sock_gets()

WORD W32_CALL sock_gets | ( | sock_type * | s,
 |  | BYTE * | data,
 |  | int | bmax
 | ) |  |

Definition at line 90 of file sock_io.c.

◆ sock_getsw()

int W32_CALL sock_getsw | ( | sock_type * | s,
 |  | wchar_t * | data,
 |  | int | n
 | ) |  |
Todo:
Wide character version of sock_gets()

Definition at line 315 of file sock_io.c.

◆ sock_putc()

BYTE W32_CALL sock_putc | ( | sock_type * | s,
 |  | BYTE | c
 | ) |  |

Definition at line 23 of file sock_io.c.

◆ sock_putcw()

int W32_CALL sock_putcw | ( | sock_type * | s,
 |  | wchar_t | ch
 | ) |  |
Todo:
Wide character versions of above functions.

Definition at line 301 of file sock_io.c.

◆ sock_puts()

int W32_CALL sock_puts | ( | sock_type * | s,
 |  | const BYTE * | data
 | ) |  |

<

Todo:
suppport UDP frags

Definition at line 39 of file sock_io.c.

References _raw_Socket::ip_type.

◆ sock_putsw()

int W32_CALL sock_putsw | ( | sock_type * | s,
 |  | const wchar_t * | data
 | ) |  |
Todo:
Wide character version of sock_puts()

Definition at line 308 of file sock_io.c.


Watt-32 tcp/ip: E:/WATT/src/sock_prn.c File Reference

  • src
Functions
sock_prn.c File Reference

Go to the source code of this file.

Functions

int MS_CDECL sock_printf (sock_type *s, const char *fmt,...)

Detailed Description

sock_type printing to network

Definition in file sock_prn.c.

Function Documentation

◆ sock_printf()

int MS_CDECL sock_printf | ( | sock_type * | s,
 |  | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 15 of file sock_prn.c.


Watt-32 tcp/ip: E:/WATT/src/sock_scn.c File Reference

  • src
Functions
sock_scn.c File Reference

Go to the source code of this file.

Functions

__declspec (naked)
static int | vsscanf (const char *buf, const char *fmt, va_list arglist)
int MS_CDECL | sock_scanf (sock_type *s, const char *fmt,...)

Detailed Description

scanf-like function for sock_type.

Definition in file sock_scn.c.

Function Documentation

◆ __declspec()

__declspec ( naked )

Definition at line 33 of file sock_scn.c.

◆ sock_scanf()

int MS_CDECL sock_scanf | ( | sock_type * | s,
 |  | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 128 of file sock_scn.c.

◆ vsscanf()

static int vsscanf | ( | const char * | buf,
 |  | const char * | fmt,
 |  | va_list | arglist
 | ) |  |
static

Definition at line 89 of file sock_scn.c.


Watt-32 tcp/ip: E:/WATT/src/sock_sel.c File Reference

  • src
Functions
sock_sel.c File Reference

Go to the source code of this file.

Functions

int W32_CALL | sock_sselect (const sock_type *s, int waitstate)
enum TCP_SIMPLE_STATE W32_CALL | tcp_simple_state (const _tcp_Socket *s)

Detailed Description

sock_select(), tcp_simple_state()

Definition in file sock_sel.c.

Function Documentation

◆ sock_sselect()

int W32_CALL sock_sselect | ( | const sock_type * | s,
 |  | int | waitstate
 | ) |  |

Definition at line 17 of file sock_sel.c.

◆ tcp_simple_state()

enum TCP_SIMPLE_STATE W32_CALL tcp_simple_state ( const _tcp_Socket * s )

Definition at line 42 of file sock_sel.c.


Watt-32 tcp/ip: E:/WATT/src/socket.c File Reference

  • src
Functions | Variables
socket.c File Reference

Go to the source code of this file.

Functions

static __inline Socket * | sock_hash_get (int fd)
static __inline void | sock_hash_add (int fd, Socket *sock)
void * | _sock_calloc (size_t size, const char *file, unsigned line)
Memory allocation; print some info if allocation fails.
static int | sock_alloc_fd (char **err)
BOOL | _sock_dos_fd (int s)
_sock_dos_fd - Return TRUE if ‘s’ is a valid DOS/Win32 handle.
int | _sock_set_rcv_buf (sock_type *s, size_t len)
Setup a bigger receive buffer, the default in Wattcp is only 2k.
void | _sock_free_rcv_buf (sock_type *s)
Free receive buffer associated with udp/tcp sockets.
static __inline Socket * | sk_list_del (int s)
Deletes the list element associated with a socket.
const sock_type * | __get_sock_from_s (int s, int proto)
Hack function if user application needs to use Wattcp core functions for BSD sockets.
static __inline BOOL | other_tcp_listeners (const Socket *_this)
Traverse socket-list to find other SOCK_STREAM sockets besides '_this' which are also listening.
void | _sock_set_syn_hook (int(*func)(_tcp_Socket **))
static __inline BOOL | other_raw_socks (const Socket *_this)
Traverse socket-list to find other SOCK_RAW sockets besides '_this'.
BOOL | _sock_set_normal_rx_mode (const Socket *_this)
BOOL | _sock_set_mcast_rx_mode (void)
BOOL | _sock_set_promisc_rx_mode (void)
static void | sock_raw_del (Socket *sock)
Free buffers and hooks used by a SOCK_RAW socket.
static BOOL | sock_packet_add (Socket *sock)
Allocate ringbuffer and rx-buffers for a SOCK_PACKET socket.
static void | sock_packet_del (Socket *sock)
static int W32_CALL | sock_packet_peek (const union link_Packet *pkt)
static char | get_pkt_type_eth (const eth_Header *eth)
Return correct PACKET_xx type.
static char | get_pkt_type_fddi (const fddi_Header *fddi)
static char | get_pkt_type_tok (const tok_Header *tok)
static char | get_pkt_type_arc (const arcnet_Header *arc)
static char | get_pkt_type (const union link_Packet *pkt)
unsigned | sock_packet_receive (Socket *sock, void *buf, unsigned len, struct sockaddr *from, size_t *fromlen)
Called from receive.c for AF_PACKET sockets.
unsigned | sock_packet_rbused (Socket *sock)
unsigned | sock_packet_transmit (Socket *socket, const void *buf, unsigned len, const struct sockaddr *to, int tolen)
static void | sock_close_fd (int fd)
Socket * | _sock_del_fd (int fd, const char *file, unsigned line)
Delete the socket from ‘inuse’ array and all memory associated with it.
static int | sock_find_fd (const Socket *socket)
Finds the 'fd' associated with pointer 'socket'.
static Socket * | sock_find_udp (const _udp_Socket *udp)
Finds the 'Socket' associated with udp-socket 'udp'.
static void * | sock_find_tcp (const _tcp_Socket *tcp)
Finds the 'Socket*' associated with tcp-socket '*tcp'.
int | _sock_chk_sockaddr (Socket *socket, const struct sockaddr *sa, socklen_t len)
Check ‘sockaddr*’ passed to bind/connect.
static struct _raw_Socket * | find_free_raw_sock (Socket *sock)
Search in sock->raw?_sock list for an unused raw-buffer.
static struct _raw6_Socket * | find_free_raw6_sock (Socket *sock)
static int | sock_raw4_recv (const in_Header *ip)
Called from _ip4_handler() via ‘_bsd_socket_hook’.
static int | sock_raw6_recv (const in6_Header *ip)
static void | do_keepalive (Socket *sock)
Handle keepalive on STREAM socket.
static void *MS_CDECL | socket_op_demux (enum BSD_SOCKET_OPS op,...)
The demultiplexer for callback operations called via '_bsd_socket_hook' from functions in the core Wattcp API.
static Socket * | tcp_sock_daemon (Socket *sock)
Called by sock_daemon() to handle SOCK_STREAM sockets.
static Socket * | udp_sock_daemon (Socket *sock)
Called by sock_daemon() for SOCK_DGRAM sockets.
static void W32_CALL | sock_daemon (void)
A daemon called from tcp_tick().
void | _sock_crit_start (void)
Start a critical region.
void | _sock_crit_stop (void)
Mark the end of a critical region.
static const char * | vendor_version (const char **vendor, const char **err_file)
Return version string of current compiler and the '../inc/sys/xx.err' file.
static void | check_errno_version (void)
Check that '.
static BOOL | init_sockets (void)
Main initialisation routine for the BSD socket API.
Socket * | _socklist_find (int s)
Returns a pointer to the Socket structure associated with socket 's'.
static BOOL | sock_raw_add (Socket *sock, int family)
Allocate raw?_Socket buffers for a SOCK_RAW socket.
static Socket * | socklist_add (int s, int type, int proto, int family)
Adds a new socket to the sk_list.
static int | set_proto (int type, BOOL is_ip6, int *proto)
Select (and check) a suitable protocol for socket-type.
static const char * | proto_name (int proto)
int W32_CALL | socket (int family, int type, int protocol)
socket().
static int | stream_cancel (const _tcp_Socket *tcp, BYTE icmp_type, int error)
Callback handlers for "ICMP Port/Host/Network Unreachable" or "ICMP Parameter Problem" issued by lower layer (udp_cancel() and tcp_cancel() in pctcp.c)
static int | dgram_cancel (const _udp_Socket *udp, BYTE icmp_type, int error)
static __inline const char * | ip_proto_str (WORD prot)
static int | icmp_callback (sock_type *s, BYTE icmp_type, BYTE icmp_code)
int | _UDP_open (Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
Open and listen routines for SOCK_DGRAM at the socket-level.
int | _UDP_listen (Socket *socket, struct in_addr host, WORD port)
int | _TCP_open (Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
Open and listen routines for SOCK_STREAM at the socket-level.
int | _TCP_listen (Socket *socket, struct in_addr host, WORD port)
int | _TCP6_open (Socket *socket, const void *dst, WORD loc_port, WORD rem_port)
int | _TCP6_listen (Socket *socket, const void *host, WORD loc_port)
int | _UDP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port)
int | _UDP6_listen (Socket *socket, const void *host, WORD port)
BOOL | _sock_pending_connect (Socket *socket)
Check progress on a non-blocking SOCK_STREAM socket that has SS_ISCONNECTING set.
int | _sock_half_open (const _tcp_Socket *s)
_sock_half_open - Return true if peer closed his side.
int W32_CALL | socketpair (int family, int type, int protocol, int usockvec[2])
socketpair() - Create a pair of connected sockets.

Variables

static int | sk_block = 0
static int | sk_last = SK_FIRST+1
static Socket * | sk_list = NULL
static DWORD | raw_seq = 0
static int(* | tcp_syn_hook )(_tcp_Socket **tcp) = NULL
static int(* | ip4_raw_hook )(const in_Header *ip) = NULL
static int(* | ip6_raw_hook )(const in6_Header *ip) = NULL
static Socket * | sk_hashes [SOCK_HASH_SIZE]
static fd_set | inuse [NUM_SOCK_FDSETS]
‘inuse[]’ has a non-zero bit for each socket-descriptor in use.
static BOOL | mcast_set = FALSE
Switch back to normal rx-mode (RXMODE_BROADCAST) if no multicasts active and no more IPv6/SOCK_PACKET sockets besides '_this'.
static BOOL | promis_set = FALSE

Detailed Description

BSD socket().

Definition in file socket.c.

Function Documentation

◆ __get_sock_from_s()

const sock_type * __get_sock_from_s | ( | int | s,
 |  | int | proto
 | ) |  |

Hack function if user application needs to use Wattcp core functions for BSD sockets.

Must not modify return value in any way.

Definition at line 288 of file socket.c.

References _socklist_find().

◆ _sock_calloc()

void * _sock_calloc | ( | size_t | size,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Memory allocation; print some info if allocation fails.

Definition at line 83 of file socket.c.

◆ _sock_chk_sockaddr()

int _sock_chk_sockaddr | ( | Socket * | socket,
 |  | const struct sockaddr * | sa,
 |  | socklen_t | len
 | ) |  |

Check ‘sockaddr*’ passed to bind/connect.

Definition at line 819 of file socket.c.

◆ _sock_crit_start()

void _sock_crit_start ( void )

Start a critical region.

Prevent ‘sk_list’ being destroyed (e.g. in sock_daemon) and thus confusing select_s(), connect() etc.

Definition at line 1266 of file socket.c.

◆ _sock_crit_stop()

void _sock_crit_stop ( void )

Mark the end of a critical region.

If blocking-level reached zero, we run our socket-daemon.

Definition at line 1276 of file socket.c.

References sock_daemon().

◆ _sock_del_fd()

Socket * _sock_del_fd | ( | int | fd,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Delete the socket from ‘inuse’ array and all memory associated with it.

Also unlink it from the socket list (sk_list). Clear _tcp_syn_hook is no more SOCK_STREAM listeners. Return pointer to next node in list or NULL if none/error.

Definition at line 681 of file socket.c.

References _pkt_rxmode, _sock_free_rcv_buf(), _socklist_find(), inuse, other_tcp_listeners(), RXMODE_BROADCAST, sk_list_del(), and sock_raw_del().

◆ _sock_dos_fd()

BOOL _sock_dos_fd ( int s )

_sock_dos_fd - Return TRUE if ‘s’ is a valid DOS/Win32 handle.

Used to differentiate EBADF from ENOTSOCK.

Note
for non-djgpp targets ‘s’ may have same value as a DOS-handle. This function should only be used when ‘s’ isn't found in ‘sk_list’.

Definition at line 202 of file socket.c.

◆ _sock_free_rcv_buf()

void _sock_free_rcv_buf ( sock_type * s )

Free receive buffer associated with udp/tcp sockets.

Definition at line 247 of file socket.c.

References tcp_Socket::rx_buf.

◆ _sock_half_open()

int _sock_half_open ( const _tcp_Socket * s )

_sock_half_open - Return true if peer closed his side.

There might still be data to read

Definition at line 2238 of file socket.c.

References tcp_Socket::state.

◆ _sock_pending_connect()

BOOL _sock_pending_connect ( Socket * socket )

Check progress on a non-blocking SOCK_STREAM socket that has SS_ISCONNECTING set.

Updates SO_STATE and SO_ERROR. Returns TRUE if the connection is still pending.

Definition at line 2186 of file socket.c.

References chk_timeout().

◆ _sock_set_mcast_rx_mode()

BOOL _sock_set_mcast_rx_mode ( void )

Definition at line 376 of file socket.c.

◆ _sock_set_normal_rx_mode()

BOOL _sock_set_normal_rx_mode ( const Socket * _this )

Definition at line 349 of file socket.c.

◆ _sock_set_promisc_rx_mode()

BOOL _sock_set_promisc_rx_mode ( void )

Definition at line 393 of file socket.c.

◆ _sock_set_rcv_buf()

int _sock_set_rcv_buf | ( | sock_type * | s,
 |  | size_t | len
 | ) |  |

Setup a bigger receive buffer, the default in Wattcp is only 2k.

Note
If calloc() fails, sock_setbuf() reverts to default 2kB socket buffer.
Todo:
allow user to define size using SO_RCVBUF/SO_SNDBUF before calling connect().

Definition at line 232 of file socket.c.

◆ _sock_set_syn_hook()

void _sock_set_syn_hook ( int(*)(_tcp_Socket **) func )

Definition at line 323 of file socket.c.

◆ _socklist_find()

Socket * _socklist_find ( int s )

Returns a pointer to the Socket structure associated with socket 's'.

If socket ‘s’ was not found, NULL is returned.

Definition at line 1473 of file socket.c.

References init_sockets().

◆ _TCP6_listen()

int _TCP6_listen | ( | Socket * | socket,
 |  | const void * | host,
 |  | WORD | loc_port
 | ) |  |
Todo:
Support TCP listen() for AF_INET6

Definition at line 2148 of file socket.c.

◆ _TCP6_open()

int _TCP6_open | ( | Socket * | socket,
 |  | const void * | dst,
 |  | WORD | loc_port,
 |  | WORD | rem_port
 | ) |  |
Todo:
use mss from setsockopt()

<

Todo:
Yield for IPv6 sockets
Todo:
use TCP_NODELAY set in setsockopt()

Definition at line 2058 of file socket.c.

References _default_ttl, _eth_is_init, _inet6_ntoa(), _sock_set_rcv_buf(), _tcp_allsocs, _tcp_unthread(), tcp_Socket::cwindow, tcp_Socket::flags, tcp_Socket::his6addr, icmp6_neigh_solic(), tcp_Socket::max_seg, tcp_Socket::my6addr, my_ip_addr, tcp_Socket::next, tcp_Socket::rto, tcp_Socket::rtt_time, tcp_Socket::safetysig, tcp_Socket::safetytcp, tcp_Socket::send_next, set_timeout(), tcp_Socket::state, tcp_nagle, tcp_OPEN_TO, tcp_recv_win, tcp_Socket::timeout, tcp_Socket::unhappy, tcp_Socket::vj_sa, and tcp_Socket::wwindow.

◆ _TCP_listen()

int _TCP_listen | ( | Socket * | socket,
 |  | struct in_addr | host,
 |  | WORD | port
 | ) |  |

Definition at line 2047 of file socket.c.

◆ _TCP_open()

int _TCP_open | ( | Socket * | socket,
 |  | struct in_addr | host,
 |  | WORD | loc_port,
 |  | WORD | rem_port
 | ) |  |

Open and listen routines for SOCK_STREAM at the socket-level.

The parameters to tcp_open() is a bit tricky, but the internal Wattcp socket 's' contains the following elements that must match in the first 'for-loop' of _tcp_handler().

s->hisport != 0 i.e. active (non-listening) port s->myaddr == ip->destination, our IP-address s->hisaddr == ip->source, above 'dest' address s->myport == tcp->dstPort, above 'loc_port' s->hisport == tcp->srcPort, above 'rem_port'

Definition at line 2015 of file socket.c.

References _sock_set_rcv_buf(), tcp_open(), and tcp_recv_win.

◆ _UDP6_listen()

int _UDP6_listen | ( | Socket * | socket,
 |  | const void * | host,
 |  | WORD | port
 | ) |  |
Todo:
Support UDP listen() for AF_INET6

Definition at line 2171 of file socket.c.

◆ _UDP6_open()

int _UDP6_open | ( | Socket * | socket,
 |  | const void * | host,
 |  | WORD | loc_port,
 |  | WORD | rem_port
 | ) |  |
Todo:
Support UDP connect() for AF_INET6

Definition at line 2157 of file socket.c.

References _sock_set_rcv_buf().

◆ _UDP_listen()

int _UDP_listen | ( | Socket * | socket,
 |  | struct in_addr | host,
 |  | WORD | port
 | ) |  |

Definition at line 1967 of file socket.c.

◆ _UDP_open()

int _UDP_open | ( | Socket * | socket,
 |  | struct in_addr | host,
 |  | WORD | loc_port,
 |  | WORD | rem_port
 | ) |  |

Open and listen routines for SOCK_DGRAM at the socket-level.

Definition at line 1942 of file socket.c.

References _sock_set_rcv_buf(), and _udp_open().

◆ check_errno_version()

static void check_errno_version ( void )
static

Check that '.

/util/xx_err.exe' or './util/win32/xx_err.exe' was built with same version we're using here. Print a warning if there's a mismatch.

Definition at line 1400 of file socket.c.

References vendor_version().

◆ dgram_cancel()

static int dgram_cancel | ( | const _udp_Socket * | udp,
 |  | BYTE | icmp_type,
 |  | int | error
 | ) |  |
static

Definition at line 1869 of file socket.c.

◆ do_keepalive()

static void do_keepalive ( Socket * sock )
static

Handle keepalive on STREAM socket.

Not complete; doesn't consider tcp_max_idle.

Definition at line 1043 of file socket.c.

References chk_timeout(), set_timeout(), and tcp_keep_idle.

◆ find_free_raw6_sock()

static struct _raw6_Socket * find_free_raw6_sock ( Socket * sock )
static

Definition at line 881 of file socket.c.

◆ find_free_raw_sock()

static struct _raw_Socket * find_free_raw_sock ( Socket * sock )
static

Search in sock->raw?_sock list for an unused raw-buffer.

Definition at line 866 of file socket.c.

References _raw_Socket::used.

◆ get_pkt_type()

static char get_pkt_type ( const union link_Packet * pkt )
static

Definition at line 561 of file socket.c.

◆ get_pkt_type_arc()

static char get_pkt_type_arc ( const arcnet_Header * arc )
static

Definition at line 555 of file socket.c.

◆ get_pkt_type_eth()

static char get_pkt_type_eth ( const eth_Header * eth )
static

Return correct PACKET_xx type.

Definition at line 516 of file socket.c.

References _eth_addr, _eth_brdcast, and _eth_mac_len.

◆ get_pkt_type_fddi()

static char get_pkt_type_fddi ( const fddi_Header * fddi )
static

Definition at line 529 of file socket.c.

◆ get_pkt_type_tok()

static char get_pkt_type_tok ( const tok_Header * tok )
static

Definition at line 542 of file socket.c.

◆ icmp_callback()

static int icmp_callback | ( | sock_type * | s,
 |  | BYTE | icmp_type,
 |  | BYTE | icmp_code
 | ) |  |
static

Definition at line 1909 of file socket.c.

◆ init_sockets()

static BOOL init_sockets ( void )
static

Main initialisation routine for the BSD socket API.

Called only once to do:

  • Calls watt_sock_init() w/o exiting if it fails.
  • Checks the generated errno list.
  • Set the limit on max number of sockets.
  • Add our sock_daemon().
  • Initialise Fortify malloc debugger.

Definition at line 1427 of file socket.c.

References _watt_do_exit, check_errno_version(), inuse, sock_daemon(), and watt_sock_init().

◆ ip_proto_str()

static __inline const char * ip_proto_str ( WORD prot )
static

Definition at line 1886 of file socket.c.

◆ other_raw_socks()

static __inline BOOL other_raw_socks ( const Socket * _this )
static

Traverse socket-list to find other SOCK_RAW sockets besides '_this'.

Unhook '_raw_ip?_hook' if none found.

Definition at line 332 of file socket.c.

◆ other_tcp_listeners()

static __inline BOOL other_tcp_listeners ( const Socket * _this )
static

Traverse socket-list to find other SOCK_STREAM sockets besides '_this' which are also listening.

Definition at line 311 of file socket.c.

◆ proto_name()

static const char * proto_name ( int proto )
static

Definition at line 1689 of file socket.c.

◆ set_proto()

static int set_proto | ( | int | type,
 |  | BOOL | is_ip6,
 |  | int * | proto
 | ) |  |
static

Select (and check) a suitable protocol for socket-type.

<

Todo:
IPPROTO_XTP

Definition at line 1624 of file socket.c.

References _pkt_errno, pkt_strerror(), and sock_raw4_recv().

◆ sk_list_del()

static __inline Socket * sk_list_del ( int s )
static

Deletes the list element associated with a socket.

Return pointer to next node. Return NULL if no next or socket not found.

Definition at line 264 of file socket.c.

◆ sock_alloc_fd()

static int sock_alloc_fd ( char ** err )
static

Definition at line 130 of file socket.c.

◆ sock_close_fd()

static void sock_close_fd ( int fd )
static

Definition at line 659 of file socket.c.

◆ sock_daemon()

static void W32_CALL sock_daemon ( void )
static

A daemon called from tcp_tick().

Called every DAEMON_PERIOD (500 msec) to perform cleanup of bound SOCK_STREAM and SOCK_DGRAM sockets still in use.

Definition at line 1226 of file socket.c.

References inuse, tcp_sock_daemon(), and udp_sock_daemon().

◆ sock_find_fd()

static int sock_find_fd ( const Socket * socket )
static

Finds the 'fd' associated with pointer 'socket'.

Return -1 if not found.

Definition at line 778 of file socket.c.

◆ sock_find_tcp()

static void * sock_find_tcp ( const _tcp_Socket * tcp )
static

Finds the 'Socket*' associated with tcp-socket '*tcp'.

Definition at line 806 of file socket.c.

◆ sock_find_udp()

static Socket * sock_find_udp ( const _udp_Socket * udp )
static

Finds the 'Socket' associated with udp-socket 'udp'.

Return NULL if not found.

Definition at line 792 of file socket.c.

◆ sock_hash_add()

static __inline void sock_hash_add | ( | int | fd,
 |  | Socket * | sock
 | ) |  |
static

Definition at line 71 of file socket.c.

◆ sock_hash_get()

static __inline Socket * sock_hash_get ( int fd )
static

Definition at line 67 of file socket.c.

◆ sock_packet_add()

static BOOL sock_packet_add ( Socket * sock )
static

Allocate ringbuffer and rx-buffers for a SOCK_PACKET socket.

Definition at line 445 of file socket.c.

◆ sock_packet_del()

static void sock_packet_del ( Socket * sock )
static

Definition at line 456 of file socket.c.

◆ sock_packet_peek()

static int W32_CALL sock_packet_peek ( const union link_Packet * pkt )
static

Definition at line 470 of file socket.c.

◆ sock_packet_rbused()

unsigned sock_packet_rbused ( Socket * sock )

Definition at line 621 of file socket.c.

◆ sock_packet_receive()

unsigned sock_packet_receive | ( | Socket * | sock,
 |  | void * | buf,
 |  | unsigned | len,
 |  | struct sockaddr * | from,
 |  | size_t * | fromlen
 | ) |  |

Called from receive.c for AF_PACKET sockets.

Todo:
This should loop until some packet is received.
Todo:
should check fromlen is large enough

Definition at line 582 of file socket.c.

References _eth_get_hwtype(), _pkt_ip_ofs, pkt_ringbuf::in_index, and pkt_ringbuf::out_index.

◆ sock_packet_transmit()

unsigned sock_packet_transmit | ( | Socket * | socket,
 |  | const void * | buf,
 |  | unsigned | len,
 |  | const struct sockaddr * | to,
 |  | int | tolen
 | ) |  |

Definition at line 628 of file socket.c.

◆ sock_raw4_recv()

static int sock_raw4_recv ( const in_Header * ip )
static

Called from _ip4_handler() via ‘_bsd_socket_hook’.

IP-header is already checked in ‘_ip4_handler()’. Finds all 'Socket' associated with raw IP-packet 'ip'. Enqueue to 'sock->raw_sock'. Return >=1 if 'ip' is consumed, 0 otherwise.

Todo:
Handle receiving bad IP-packets for SOCK_RAW sockets.

Definition at line 905 of file socket.c.

References find_free_raw_sock(), _raw_Socket::rx_data, _raw_Socket::seq_num, and _raw_Socket::used.

◆ sock_raw6_recv()

static int sock_raw6_recv ( const in6_Header * ip )
static

Definition at line 973 of file socket.c.

◆ sock_raw_add()

static BOOL sock_raw_add | ( | Socket * | sock,
 |  | int | family
 | ) |  |
static

Allocate raw?_Socket buffers for a SOCK_RAW socket.

Definition at line 1489 of file socket.c.

References _raw_Socket::ip_type.

◆ sock_raw_del()

static void sock_raw_del ( Socket * sock )
static

Free buffers and hooks used by a SOCK_RAW socket.

Definition at line 406 of file socket.c.

References _raw_Socket::ip_type, and other_raw_socks().

◆ socket()

int W32_CALL socket | ( | int | family,
 |  | int | type,
 |  | int | protocol
 | ) |  |

socket().

  • family The protocol family. Supports the AF_INET, AF_INET6, AF_PACKET families.
  • type SOCK_STREAM (tcp), SOCK_DGRAM (udp), SOCK_RAW (ip) or SOCK_PACKET (link).
  • protocol IPPROTO_TCP, IPPROTO_UDP or 0/IPPROTO_IP.
Return values
The socket ID number

Definition at line 1733 of file socket.c.

References init_sockets(), set_proto(), socket_op_demux(), and socklist_add().

◆ socket_op_demux()

static void *MS_CDECL socket_op_demux | ( | enum BSD_SOCKET_OPS | op,
 |  |  | ...
 | ) |  |
static

The demultiplexer for callback operations called via '_bsd_socket_hook' from functions in the core Wattcp API.

Definition at line 1066 of file socket.c.

References sock_find_tcp().

◆ socketpair()

int W32_CALL socketpair | ( | int | family,
 |  | int | type,
 |  | int | protocol,
 |  | int | usockvec[2]
 | ) |  |

socketpair() - Create a pair of connected sockets.

Modified version based on Linux's version.

Definition at line 2253 of file socket.c.

◆ socklist_add()

static Socket * socklist_add | ( | int | s,
 |  | int | type,
 |  | int | proto,
 |  | int | family
 | ) |  |
static

Adds a new socket to the sk_list.

Definition at line 1541 of file socket.c.

References sock_packet_add(), sock_raw_add(), and sock_raw_del().

◆ stream_cancel()

static int stream_cancel | ( | const _tcp_Socket * | tcp,
 |  | BYTE | icmp_type,
 |  | int | error
 | ) |  |
static

Callback handlers for "ICMP Port/Host/Network Unreachable" or "ICMP Parameter Problem" issued by lower layer (udp_cancel() and tcp_cancel() in pctcp.c)

Note
a single ICMP message may apply to several UDP sockets.

We should drop (i.e. set ECONNREFUSED in lack of a better errno) on receiving "ICMP-param problem" or "ICMP-unreachable" reached stress-level.

Definition at line 1851 of file socket.c.

◆ tcp_sock_daemon()

static Socket * tcp_sock_daemon ( Socket * sock )
static

Called by sock_daemon() to handle SOCK_STREAM sockets.

Unlink the socket from the linked list if application has read all data and tcp_state has become CLOSED and the linger period has expired.

Definition at line 1149 of file socket.c.

References _sock_free_rcv_buf(), do_keepalive(), and tcp_Socket::state.

◆ udp_sock_daemon()

static Socket * udp_sock_daemon ( Socket * sock )
static

Called by sock_daemon() for SOCK_DGRAM sockets.

Unlink the socket from the linked list if application has read all data and "state" is disconnecting.

Note
Setting 'SS_ISDISCONNECTING' is really a mis-nomer, but should indicate socket is closed/aborted with Rx-data remaining.

Definition at line 1206 of file socket.c.

◆ vendor_version()

static const char * vendor_version | ( | const char ** | vendor,
 |  | const char ** | err_file
 | ) |  |
static

Return version string of current compiler and the '../inc/sys/xx.err' file.

This is similar to the function 'VendorVersion()' in ../util/errnos.c

Definition at line 1307 of file socket.c.

Variable Documentation

◆ inuse

fd_set inuse[NUM_SOCK_FDSETS]
static

‘inuse[]’ has a non-zero bit for each socket-descriptor in use.

There can be max ‘MAX_SOCKETS’ allocated at any time. Dead stream sockets will be unlinked by ‘sock_daemon()’ in due time.

Non-djgpp targets: Allocate a new descriptor (handle) by searching through ‘inuse’ for the first zero bit. Update ‘sk_last’ as needed.

djgpp target: Allocate a descriptior from the "File System Extension" layer. ‘sk_last’ is not used (initialised to MAX_SOCKETS). Thus max # of sockets are limited by max # of DOS handles that can be created.

Definition at line 128 of file socket.c.

◆ ip4_raw_hook

int(* ip4_raw_hook) (const in_Header *ip) ( const in_Header * ip ) = NULL
static

Definition at line 52 of file socket.c.

◆ ip6_raw_hook

int(* ip6_raw_hook) (const in6_Header *ip) ( const in6_Header * ip ) = NULL
static

Definition at line 55 of file socket.c.

◆ mcast_set

BOOL mcast_set = FALSE
static

Switch back to normal rx-mode (RXMODE_BROADCAST) if no multicasts active and no more IPv6/SOCK_PACKET sockets besides '_this'.

Definition at line 346 of file socket.c.

◆ promis_set

BOOL promis_set = FALSE
static

Definition at line 347 of file socket.c.

◆ raw_seq

DWORD raw_seq = 0
static

Definition at line 49 of file socket.c.

◆ sk_block

int sk_block = 0
static

Definition at line 46 of file socket.c.

◆ sk_hashes

Socket* sk_hashes[SOCK_HASH_SIZE]
static

Definition at line 64 of file socket.c.

◆ sk_last

int sk_last = SK_FIRST+1
static

Definition at line 47 of file socket.c.

◆ sk_list

Socket* sk_list = NULL
static

Definition at line 48 of file socket.c.

◆ tcp_syn_hook

int(* tcp_syn_hook) (_tcp_Socket **tcp) ( _tcp_Socket ** tcp ) = NULL
static

Definition at line 51 of file socket.c.


Watt-32 tcp/ip: E:/WATT/src/socket.h File Reference

  • src
Data Structures | Typedefs | Functions
socket.h File Reference

Go to the source code of this file.

Data Structures

struct | sock_packet_buf
struct | sock_packet_pool
struct | Socket

Typedefs

typedef struct sock_packet_pool | sock_packet_pool
typedef struct Socket | Socket

Functions

int | _fsext_demux (__FSEXT_Fnumber func, int *rv, va_list _args)
int | _fsext_ready (int fd)
long | _get_osfhandle (int)
int | _sock_sig_setup (void)
int | _sock_sig_restore (void)
int | _sock_sig_pending (void)
int | _sock_sig_epipe (const Socket *s)
void | _sock_crit_start (void)
Start a critical region.
void | _sock_crit_stop (void)
Mark the end of a critical region.
void | _sock_start_timer (void)
void | _sock_stop_timer (void)
unsigned | sock_packet_transmit (Socket *sock, const void *buf, unsigned len, const struct sockaddr *to, int tolen)
unsigned | sock_packet_receive (Socket *sock, void *buf, unsigned len, struct sockaddr *from, size_t *fromlen)
Called from receive.c for AF_PACKET sockets.
unsigned | sock_packet_rbused (Socket *sock)
void * | _sock_calloc (size_t size, const char *file, unsigned line)
Memory allocation; print some info if allocation fails.
Socket * | _sock_del_fd (int sock, const char *file, unsigned line)
Delete the socket from ‘inuse’ array and all memory associated with it.
Socket * | _socklist_find (int s)
Returns a pointer to the Socket structure associated with socket 's'.
BOOL | _sock_dos_fd (int s)
_sock_dos_fd - Return TRUE if ‘s’ is a valid DOS/Win32 handle.
int | _sock_half_open (const _tcp_Socket *tcp)
_sock_half_open - Return true if peer closed his side.
int | _sock_append (_tcp_Socket **tcp)
Called from tcp_fsm.c / tcp_listen_state() (via _bsd_socket_hook) to append a new connection to the listen-queue of socket 'sock'.
int | _sock_set_rcv_buf (sock_type *s, size_t len)
Setup a bigger receive buffer, the default in Wattcp is only 2k.
void | _sock_free_rcv_buf (sock_type *s)
Free receive buffer associated with udp/tcp sockets.
void | _sock_set_syn_hook (int(*func)(_tcp_Socket **))
BOOL | _sock_set_promisc_rx_mode (void)
BOOL | _sock_set_mcast_rx_mode (void)
BOOL | _sock_set_normal_rx_mode (const Socket *_this)
const sock_type * | __get_sock_from_s (int s, int proto)
Hack function if user application needs to use Wattcp core functions for BSD sockets.
void | __get_ifname (char *if_name)
void | __set_ifname (const char *if_name)
int | __scope_ascii_to_id (const char *str)
int | __scope_id_to_ascii (int scope)
int | _sock_chk_sockaddr (Socket *socket, const struct sockaddr *sa, int len)
Check ‘sockaddr*’ passed to bind/connect.
int | _TCP_open (Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
Open and listen routines for SOCK_STREAM at the socket-level.
int | _UDP_open (Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
Open and listen routines for SOCK_DGRAM at the socket-level.
int | _TCP_listen (Socket *socket, struct in_addr host, WORD loc_port)
int | _UDP_listen (Socket *socket, struct in_addr host, WORD port)
int | _TCP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port)
int | _UDP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port)
int | _TCP6_listen (Socket *socket, const void *host, WORD loc_port)
int | _UDP6_listen (Socket *socket, const void *host, WORD port)
BOOL | _sock_pending_connect (Socket *socket)
Check progress on a non-blocking SOCK_STREAM socket that has SS_ISCONNECTING set.

Function Documentation

◆ __get_ifname()

void __get_ifname ( char * if_name )

Definition at line 175 of file ioctl.c.

◆ __get_sock_from_s()

const sock_type * __get_sock_from_s | ( | int | s,
 |  | int | proto
 | ) |  |

Hack function if user application needs to use Wattcp core functions for BSD sockets.

Must not modify return value in any way.

Definition at line 288 of file socket.c.

References _socklist_find().

◆ __scope_ascii_to_id()

int __scope_ascii_to_id ( const char * str )

Definition at line 217 of file get_ai.c.

◆ __scope_id_to_ascii()

int __scope_id_to_ascii ( int scope )

Definition at line 224 of file get_ai.c.

◆ __set_ifname()

void __set_ifname ( const char * if_name )

Definition at line 207 of file ioctl.c.

◆ _fsext_demux()

int _fsext_demux | ( | __FSEXT_Fnumber | func,
 |  | int * | rv,
 |  | va_list | _args
 | ) |  |

Definition at line 110 of file fsext.c.

◆ _fsext_ready()

int _fsext_ready ( int fd )

Definition at line 450 of file select.c.

◆ _sock_append()

int _sock_append ( _tcp_Socket ** tcp )

Called from tcp_fsm.c / tcp_listen_state() (via _bsd_socket_hook) to append a new connection to the listen-queue of socket 'sock'.

TCB on input ('orig') has received a SYN. Replace TCB on output with a cloned TCB that we append to the listen-queue and eventually is used by accept() to create a new socket.

TCB on input ('orig') must still be listening for further connections on the same port as specified in call to _TCP_listen().

Todo:
Implement SYN-cookies. Ref. http://cr.yp.to/syncookies.html
Todo:
Implement SYN-cookies and drop the segment if no match
Todo:
drop the oldest (or a random) slot in the listen-queue.

Definition at line 426 of file accept.c.

References _sock_set_rcv_buf(), _tcp_allsocs, tcp_Socket::last_acknum, tcp_Socket::last_seqnum, tcp_Socket::max_tx_data, tcp_Socket::my6addr, tcp_Socket::next, tcp_Socket::send_next, set_timeout(), tcp_recv_win, tcp_Socket::tx_buf, tcp_Socket::tx_data, tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ _sock_calloc()

void * _sock_calloc | ( | size_t | size,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Memory allocation; print some info if allocation fails.

Definition at line 83 of file socket.c.

◆ _sock_chk_sockaddr()

int _sock_chk_sockaddr | ( | Socket * | socket,
 |  | const struct sockaddr * | sa,
 |  | int | len
 | ) |  |

Check ‘sockaddr*’ passed to bind/connect.

Definition at line 819 of file socket.c.

◆ _sock_crit_start()

void _sock_crit_start ( void )

Start a critical region.

Prevent ‘sk_list’ being destroyed (e.g. in sock_daemon) and thus confusing select_s(), connect() etc.

Definition at line 1266 of file socket.c.

◆ _sock_crit_stop()

void _sock_crit_stop ( void )

Mark the end of a critical region.

If blocking-level reached zero, we run our socket-daemon.

Definition at line 1276 of file socket.c.

References sock_daemon().

◆ _sock_del_fd()

Socket * _sock_del_fd | ( | int | fd,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Delete the socket from ‘inuse’ array and all memory associated with it.

Also unlink it from the socket list (sk_list). Clear _tcp_syn_hook is no more SOCK_STREAM listeners. Return pointer to next node in list or NULL if none/error.

Definition at line 681 of file socket.c.

References _pkt_rxmode, _sock_free_rcv_buf(), _socklist_find(), inuse, other_tcp_listeners(), RXMODE_BROADCAST, sk_list_del(), and sock_raw_del().

◆ _sock_dos_fd()

BOOL _sock_dos_fd ( int s )

_sock_dos_fd - Return TRUE if ‘s’ is a valid DOS/Win32 handle.

Used to differentiate EBADF from ENOTSOCK.

Note
for non-djgpp targets ‘s’ may have same value as a DOS-handle. This function should only be used when ‘s’ isn't found in ‘sk_list’.

Definition at line 202 of file socket.c.

◆ _sock_free_rcv_buf()

void _sock_free_rcv_buf ( sock_type * s )

Free receive buffer associated with udp/tcp sockets.

Definition at line 247 of file socket.c.

References tcp_Socket::rx_buf.

◆ _sock_half_open()

int _sock_half_open ( const _tcp_Socket * s )

_sock_half_open - Return true if peer closed his side.

There might still be data to read

Definition at line 2238 of file socket.c.

References tcp_Socket::state.

◆ _sock_pending_connect()

BOOL _sock_pending_connect ( Socket * socket )

Check progress on a non-blocking SOCK_STREAM socket that has SS_ISCONNECTING set.

Updates SO_STATE and SO_ERROR. Returns TRUE if the connection is still pending.

Definition at line 2186 of file socket.c.

References chk_timeout().

◆ _sock_set_mcast_rx_mode()

BOOL _sock_set_mcast_rx_mode ( void )

Definition at line 376 of file socket.c.

◆ _sock_set_normal_rx_mode()

BOOL _sock_set_normal_rx_mode ( const Socket * _this )

Definition at line 349 of file socket.c.

◆ _sock_set_promisc_rx_mode()

BOOL _sock_set_promisc_rx_mode ( void )

Definition at line 393 of file socket.c.

◆ _sock_set_rcv_buf()

int _sock_set_rcv_buf | ( | sock_type * | s,
 |  | size_t | len
 | ) |  |

Setup a bigger receive buffer, the default in Wattcp is only 2k.

Note
If calloc() fails, sock_setbuf() reverts to default 2kB socket buffer.
Todo:
allow user to define size using SO_RCVBUF/SO_SNDBUF before calling connect().

Definition at line 232 of file socket.c.

◆ _sock_set_syn_hook()

void _sock_set_syn_hook ( int(*)(_tcp_Socket **) func )

Definition at line 323 of file socket.c.

◆ _sock_sig_epipe()

int _sock_sig_epipe ( const Socket * s )

Definition at line 238 of file signal.c.

◆ _sock_sig_pending()

int _sock_sig_pending ( void )

Definition at line 153 of file signal.c.

◆ _sock_sig_restore()

int _sock_sig_restore ( void )

Definition at line 175 of file signal.c.

◆ _sock_sig_setup()

int _sock_sig_setup ( void )

Definition at line 113 of file signal.c.

◆ _sock_start_timer()

void _sock_start_timer ( void )

Definition at line 51 of file nettime.c.

◆ _sock_stop_timer()

void _sock_stop_timer ( void )

Definition at line 56 of file nettime.c.

◆ _socklist_find()

Socket * _socklist_find ( int s )

Returns a pointer to the Socket structure associated with socket 's'.

If socket ‘s’ was not found, NULL is returned.

Definition at line 1473 of file socket.c.

References init_sockets().

◆ _TCP6_listen()

int _TCP6_listen | ( | Socket * | socket,
 |  | const void * | host,
 |  | WORD | loc_port
 | ) |  |
Todo:
Support TCP listen() for AF_INET6

Definition at line 2148 of file socket.c.

◆ _TCP6_open()

int _TCP6_open | ( | Socket * | socket,
 |  | const void * | host,
 |  | WORD | loc_port,
 |  | WORD | rem_port
 | ) |  |
Todo:
use mss from setsockopt()

<

Todo:
Yield for IPv6 sockets
Todo:
use TCP_NODELAY set in setsockopt()

Definition at line 2058 of file socket.c.

References _default_ttl, _eth_is_init, _inet6_ntoa(), _sock_set_rcv_buf(), _tcp_allsocs, _tcp_unthread(), tcp_Socket::cwindow, tcp_Socket::flags, tcp_Socket::his6addr, icmp6_neigh_solic(), tcp_Socket::max_seg, tcp_Socket::my6addr, my_ip_addr, tcp_Socket::next, tcp_Socket::rto, tcp_Socket::rtt_time, tcp_Socket::safetysig, tcp_Socket::safetytcp, tcp_Socket::send_next, set_timeout(), tcp_Socket::state, tcp_nagle, tcp_OPEN_TO, tcp_recv_win, tcp_Socket::timeout, tcp_Socket::unhappy, tcp_Socket::vj_sa, and tcp_Socket::wwindow.

◆ _TCP_listen()

int _TCP_listen | ( | Socket * | socket,
 |  | struct in_addr | host,
 |  | WORD | loc_port
 | ) |  |

Definition at line 2047 of file socket.c.

◆ _TCP_open()

int _TCP_open | ( | Socket * | socket,
 |  | struct in_addr | host,
 |  | WORD | loc_port,
 |  | WORD | rem_port
 | ) |  |

Open and listen routines for SOCK_STREAM at the socket-level.

The parameters to tcp_open() is a bit tricky, but the internal Wattcp socket 's' contains the following elements that must match in the first 'for-loop' of _tcp_handler().

s->hisport != 0 i.e. active (non-listening) port s->myaddr == ip->destination, our IP-address s->hisaddr == ip->source, above 'dest' address s->myport == tcp->dstPort, above 'loc_port' s->hisport == tcp->srcPort, above 'rem_port'

Definition at line 2015 of file socket.c.

References _sock_set_rcv_buf(), tcp_open(), and tcp_recv_win.

◆ _UDP6_listen()

int _UDP6_listen | ( | Socket * | socket,
 |  | const void * | host,
 |  | WORD | port
 | ) |  |
Todo:
Support UDP listen() for AF_INET6

Definition at line 2171 of file socket.c.

◆ _UDP6_open()

int _UDP6_open | ( | Socket * | socket,
 |  | const void * | host,
 |  | WORD | loc_port,
 |  | WORD | rem_port
 | ) |  |
Todo:
Support UDP connect() for AF_INET6

Definition at line 2157 of file socket.c.

References _sock_set_rcv_buf().

◆ _UDP_listen()

int _UDP_listen | ( | Socket * | socket,
 |  | struct in_addr | host,
 |  | WORD | port
 | ) |  |

Definition at line 1967 of file socket.c.

◆ _UDP_open()

int _UDP_open | ( | Socket * | socket,
 |  | struct in_addr | host,
 |  | WORD | loc_port,
 |  | WORD | rem_port
 | ) |  |

Open and listen routines for SOCK_DGRAM at the socket-level.

Definition at line 1942 of file socket.c.

References _sock_set_rcv_buf(), and _udp_open().

◆ sock_packet_rbused()

unsigned sock_packet_rbused ( Socket * sock )

Definition at line 621 of file socket.c.

◆ sock_packet_receive()

unsigned sock_packet_receive | ( | Socket * | sock,
 |  | void * | buf,
 |  | unsigned | len,
 |  | struct sockaddr * | from,
 |  | size_t * | fromlen
 | ) |  |

Called from receive.c for AF_PACKET sockets.

Todo:
This should loop until some packet is received.
Todo:
should check fromlen is large enough

Definition at line 582 of file socket.c.

References _eth_get_hwtype(), _pkt_ip_ofs, pkt_ringbuf::in_index, and pkt_ringbuf::out_index.

◆ sock_packet_transmit()

unsigned sock_packet_transmit | ( | Socket * | sock,
 |  | const void * | buf,
 |  | unsigned | len,
 |  | const struct sockaddr * | to,
 |  | int | tolen
 | ) |  |

Definition at line 628 of file socket.c.


Watt-32 tcp/ip: E:/WATT/src/sockopt.c File Reference

  • src
Functions | Variables
sockopt.c File Reference

Go to the source code of this file.

Functions

static int | set_sol_opt (Socket *s, int opt, const void *val, unsigned len)
static int | set_raw_opt (Socket *s, int opt, const void *val, int len)
static int | get_sol_opt (Socket *s, int opt, void *val, int *len)
static int | get_raw_opt (Socket *s, int opt, void *val, int *len)
static int | set_tcp_opt (_tcp_Socket *tcp, int opt, const void *val, int len)
static int | set_udp_opt (_udp_Socket *udp, int opt, const void *val, int len)
static int | get_tcp_opt (_tcp_Socket *tcp, int opt, void *val, int *len)
static int | get_udp_opt (_udp_Socket *udp, int opt, void *val, int *len)
static int | set_recv_buf (sock_type *s, DWORD size, BOOL is_tcp)
static int | set_xmit_buf (sock_type *s, DWORD size, BOOL is_tcp)
static int | raw_rx_buf (_raw_Socket *raw, DWORD size)
static int | raw_tx_buf (_raw_Socket *raw, DWORD size)
static int | raw6_rx_buf (_raw6_Socket *raw, DWORD size)
static int | raw6_tx_buf (_raw6_Socket *raw, DWORD size)
static int | set_tx_lowat (Socket *s, unsigned size)
static int | set_rx_lowat (Socket *s, unsigned size)
static int | get_tx_lowat (const Socket *s, unsigned *size)
static int | get_rx_lowat (const Socket *s, unsigned *size)
static const char * | sockopt_name (int level, int option)
int W32_CALL | setsockopt (int s, int level, int option, const void *optval, socklen_t optlen)
int W32_CALL | getsockopt (int s, int level, int option, void *optval, socklen_t *optlen)

Variables

static const struct search_list | sol_options []
static const struct search_list | tcp_options []
static const struct search_list | ip_options []

Detailed Description

BSD setsockopt(), getsockopt().

Definition in file sockopt.c.

Function Documentation

◆ get_raw_opt()

static int get_raw_opt | ( | Socket * | s,
 |  | int | opt,
 |  | void * | val,
 |  | int * | len
 | ) |  |
static

Definition at line 726 of file sockopt.c.

◆ get_rx_lowat()

static int get_rx_lowat | ( | const Socket * | s,
 |  | unsigned * | size
 | ) |  |
static

Definition at line 982 of file sockopt.c.

◆ get_sol_opt()

static int get_sol_opt | ( | Socket * | s,
 |  | int | opt,
 |  | void * | val,
 |  | int * | len
 | ) |  |
static
Todo:
Handle urgent (OOB) data
Todo:
Handle these SOL_OPTIONS:

Definition at line 350 of file sockopt.c.

References _raw_Socket::rx_data, and tcp_keep_idle.

◆ get_tcp_opt()

static int get_tcp_opt | ( | _tcp_Socket * | tcp,
 |  | int | opt,
 |  | void * | val,
 |  | int * | len
 | ) |  |
static

Definition at line 555 of file sockopt.c.

◆ get_tx_lowat()

static int get_tx_lowat | ( | const Socket * | s,
 |  | unsigned * | size
 | ) |  |
static

Definition at line 969 of file sockopt.c.

◆ get_udp_opt()

static int get_udp_opt | ( | _udp_Socket * | udp,
 |  | int | opt,
 |  | void * | val,
 |  | int * | len
 | ) |  |
static

Definition at line 602 of file sockopt.c.

◆ getsockopt()

int W32_CALL getsockopt | ( | int | s,
 |  | int | level,
 |  | int | option,
 |  | void * | optval,
 |  | socklen_t * | optlen
 | ) |  |

Definition at line 125 of file sockopt.c.

◆ raw6_rx_buf()

static int raw6_rx_buf | ( | _raw6_Socket * | raw,
 |  | DWORD | size
 | ) |  |
static
Todo:
Support setting Rx-buffer size of raw IPv6 sockets

Definition at line 900 of file sockopt.c.

◆ raw6_tx_buf()

static int raw6_tx_buf | ( | _raw6_Socket * | raw,
 |  | DWORD | size
 | ) |  |
static
Todo:
Support setting Tx-buffer size of raw IPv6 sockets

Definition at line 909 of file sockopt.c.

◆ raw_rx_buf()

static int raw_rx_buf | ( | _raw_Socket * | raw,
 |  | DWORD | size
 | ) |  |
static
Todo:
Support setting Rx-buffer size of raw IPv4 sockets

Definition at line 882 of file sockopt.c.

◆ raw_tx_buf()

static int raw_tx_buf | ( | _raw_Socket * | raw,
 |  | DWORD | size
 | ) |  |
static
Todo:
Support setting Tx-buffer size of raw IPv4 sockets

Definition at line 891 of file sockopt.c.

◆ set_raw_opt()

static int set_raw_opt | ( | Socket * | s,
 |  | int | opt,
 |  | const void * | val,
 |  | int | len
 | ) |  |
static

Definition at line 615 of file sockopt.c.

◆ set_recv_buf()

static int set_recv_buf | ( | sock_type * | s,
 |  | DWORD | size,
 |  | BOOL | is_tcp
 | ) |  |
static

Definition at line 800 of file sockopt.c.

◆ set_rx_lowat()

static int set_rx_lowat | ( | Socket * | s,
 |  | unsigned | size
 | ) |  |
static

Definition at line 944 of file sockopt.c.

◆ set_sol_opt()

static int set_sol_opt | ( | Socket * | s,
 |  | int | opt,
 |  | const void * | val,
 |  | unsigned | len
 | ) |  |
static

Definition at line 180 of file sockopt.c.

◆ set_tcp_opt()

static int set_tcp_opt | ( | _tcp_Socket * | tcp,
 |  | int | opt,
 |  | const void * | val,
 |  | int | len
 | ) |  |
static

Definition at line 515 of file sockopt.c.

◆ set_tx_lowat()

static int set_tx_lowat | ( | Socket * | s,
 |  | unsigned | size
 | ) |  |
static

Definition at line 921 of file sockopt.c.

◆ set_udp_opt()

static int set_udp_opt | ( | _udp_Socket * | udp,
 |  | int | opt,
 |  | const void * | val,
 |  | int | len
 | ) |  |
static

Definition at line 591 of file sockopt.c.

◆ set_xmit_buf()

static int set_xmit_buf | ( | sock_type * | s,
 |  | DWORD | size,
 |  | BOOL | is_tcp
 | ) |  |
static

Definition at line 843 of file sockopt.c.

◆ setsockopt()

int W32_CALL setsockopt | ( | int | s,
 |  | int | level,
 |  | int | option,
 |  | const void * | optval,
 |  | socklen_t | optlen
 | ) |  |

Definition at line 71 of file sockopt.c.

◆ sockopt_name()

static const char * sockopt_name | ( | int | level,
 |  | int | option
 | ) |  |
static

Definition at line 1056 of file sockopt.c.

Variable Documentation

◆ ip_options

const struct search_list ip_options[]
static
Initial value:
= {
{ IP_OPTIONS, "IP_OPTIONS" },
{ IP_HDRINCL, "IP_HDRINCL" },
{ IP_TOS, "IP_TOS" },
{ IP_TTL, "IP_TTL" },
{ IP_RECVOPTS, "IP_RECVOPTS" },
{ IP_RECVRETOPTS, "IP_RECVRETOPTS" },
{ IP_RECVDSTADDR, "IP_RECVDSTADDR" },
{ IP_RETOPTS, "IP_RETOPTS" },
{ IP_MULTICAST_IF, "IP_MULTICAST_IF" },
{ IP_MULTICAST_TTL, "IP_MULTICAST_TTL" },
{ IP_MULTICAST_LOOP, "IP_MULTICAST_LOOP" },
{ IP_ADD_MEMBERSHIP, "IP_ADD_MEMBERSHIP" },
{ IP_DROP_MEMBERSHIP,"IP_DROP_MEMBERSHIP" },
{ IP_MULTICAST_VIF, "IP_MULTICAST_VIF" },
{ IP_RSVP_ON, "IP_RSVP_ON" },
{ IP_RSVP_OFF, "IP_RSVP_OFF" },
{ IP_RSVP_VIF_ON, "IP_RSVP_VIF_ON" },
{ IP_RSVP_VIF_OFF, "IP_RSVP_VIF_OFF" },
{ IP_PORTRANGE, "IP_PORTRANGE" },
{ IP_RECVIF, "IP_RECVIF" },
{ IP_FW_ADD, "IP_FW_ADD" },
{ IP_FW_DEL, "IP_FW_DEL" },
{ IP_FW_FLUSH, "IP_FW_FLUSH" },
{ IP_FW_ZERO, "IP_FW_ZERO" },
{ IP_FW_GET, "IP_FW_GET" },
{ IP_NAT, "IP_NAT" }
}

Definition at line 1026 of file sockopt.c.

◆ sol_options

const struct search_list sol_options[]
static
Initial value:
= {
{ SO_DEBUG, "SO_DEBUG" },
{ SO_ACCEPTCONN, "SO_ACCEPTCONN" },
{ SO_REUSEADDR, "SO_REUSEADDR" },
{ SO_KEEPALIVE, "SO_KEEPALIVE" },
{ SO_DONTROUTE, "SO_DONTROUTE" },
{ SO_BROADCAST, "SO_BROADCAST" },
{ SO_USELOOPBACK, "SO_USELOOPBACK" },
{ SO_LINGER, "SO_LINGER" },
{ SO_OOBINLINE, "SO_OOBINLINE" },
{ SO_SNDBUF, "SO_SNDBUF" },
{ SO_RCVBUF, "SO_RCVBUF" },
{ SO_SNDLOWAT, "SO_SNDLOWAT" },
{ SO_RCVLOWAT, "SO_RCVLOWAT" },
{ SO_SNDTIMEO, "SO_SNDTIMEO" },
{ SO_RCVTIMEO, "SO_RCVTIMEO" },
{ SO_ERROR, "SO_ERROR" },
{ SO_TYPE, "SO_TYPE" }
}

Definition at line 999 of file sockopt.c.

◆ tcp_options

const struct search_list tcp_options[]
static
Initial value:
= {
{ TCP_NODELAY, "TCP_NODELAY" },
{ TCP_MAXSEG, "TCP_MAXSEG" },
{ TCP_NOPUSH, "TCP_NOPUSH" },
{ TCP_NOOPT, "TCP_NOOPT" }
}

Definition at line 1019 of file sockopt.c.


Watt-32 tcp/ip: E:/WATT/src/split.c File Reference

  • src
Functions | Variables
split.c File Reference

Go to the source code of this file.

Functions

static void | split_mac (struct pkt_split *, const void *)
static void | split_ip4 (struct pkt_split *, const in_Header *)
static void | split_ip6 (struct pkt_split *, const in6_Header *)
const struct pkt_split * | pkt_get_split_in (void)
const struct pkt_split * | pkt_get_split_out (void)
const struct pkt_split * | pkt_get_type_in (enum Components type)
const struct pkt_split * | pkt_get_type_out (enum Components type)
const struct pkt_split * | pkt_split_mac_in (const void *ptr)
const struct pkt_split * | pkt_split_mac_out (const void *ptr)
void | pkt_print_split_in (void)
void | pkt_print_split_out (void)

Variables

static struct pkt_split | split_list_in [MAX_SPLITS]
static struct pkt_split | split_list_out [MAX_SPLITS]
static const struct search_list | names []

Detailed Description

Splitting of link-layer packets into components.

Definition in file split.c.

Function Documentation

◆ pkt_get_split_in()

const struct pkt_split * pkt_get_split_in ( void )

Definition at line 61 of file split.c.

◆ pkt_get_split_out()

const struct pkt_split * pkt_get_split_out ( void )

Definition at line 67 of file split.c.

◆ pkt_get_type_in()

const struct pkt_split * pkt_get_type_in ( enum Components type )

Definition at line 73 of file split.c.

◆ pkt_get_type_out()

const struct pkt_split * pkt_get_type_out ( enum Components type )

Definition at line 83 of file split.c.

◆ pkt_print_split_in()

void pkt_print_split_in ( void )

Definition at line 500 of file split.c.

◆ pkt_print_split_out()

void pkt_print_split_out ( void )

Definition at line 510 of file split.c.

◆ pkt_split_mac_in()

const struct pkt_split * pkt_split_mac_in ( const void * ptr )

Definition at line 93 of file split.c.

◆ pkt_split_mac_out()

const struct pkt_split * pkt_split_mac_out ( const void * ptr )

Definition at line 100 of file split.c.

◆ split_ip4()

static void split_ip4 | ( | struct pkt_split * | ps,
 |  | const in_Header * | ip4
 | ) |  |
static

Definition at line 246 of file split.c.

◆ split_ip6()

static void split_ip6 | ( | struct pkt_split * | ps,
 |  | const in6_Header * | ip6
 | ) |  |
static
Todo:
Handle Fragment, ESP, AUTH, IPv6 encap

Definition at line 342 of file split.c.

◆ split_mac()

static void split_mac | ( | struct pkt_split * | ps,
 |  | const void * | ptr
 | ) |  |
static

Definition at line 107 of file split.c.

Variable Documentation

◆ names

const struct search_list names[]
static

Definition at line 465 of file split.c.

◆ split_list_in

struct pkt_split split_list_in[MAX_SPLITS]
static

Definition at line 54 of file split.c.

◆ split_list_out

struct pkt_split split_list_out[MAX_SPLITS]
static

Definition at line 55 of file split.c.


Watt-32 tcp/ip: E:/WATT/src/split.h File Reference

  • src
Data Structures | Enumerations | Functions
split.h File Reference

Go to the source code of this file.

Data Structures

struct pkt_split

Enumerations

enum Components {
TYPE_TOKEN_HEAD = 1 ,
TYPE_FDDI_HEAD ,
TYPE_ETHER_HEAD ,
TYPE_ARCNET_HEAD ,
TYPE_ARP ,
TYPE_RARP ,
TYPE_PPPOE_DISC ,
TYPE_PPPOE_SESS ,
TYPE_PPP_LCP ,
TYPE_PPP_IPCP ,
TYPE_LLC_HEAD ,
TYPE_IP4 ,
TYPE_IP4_OPTIONS ,
TYPE_IP4_FRAG ,
TYPE_ICMP ,
TYPE_IGMP ,
TYPE_UDP_HEAD ,
TYPE_UDP_DATA ,
TYPE_TCP_HEAD ,
TYPE_TCP_OPTIONS ,
TYPE_TCP_DATA ,
TYPE_IP6 ,
TYPE_IP6_HOP ,
TYPE_IP6_IPV6 ,
TYPE_IP6_ROUTING ,
TYPE_IP6_FRAGMENT ,
TYPE_IP6_ESP ,
TYPE_IP6_AUTH ,
TYPE_IP6_ICMP ,
TYPE_IP6_DEST ,
TYPE_IP6_NONE ,
TYPE_IP6_UNSUPP ,
TYPE_MAX
}

Functions

const struct pkt_split * | pkt_split_mac_in (const void *link_pkt)
const struct pkt_split * | pkt_split_mac_out (const void *link_pkt)
const struct pkt_split * | pkt_get_split_in (void)
const struct pkt_split * | pkt_get_split_out (void)
const struct pkt_split * | pkt_get_type_in (enum Components type)
const struct pkt_split * | pkt_get_type_out (enum Components type)
void | pkt_print_split_in (void)
void | pkt_print_split_out (void)

Enumeration Type Documentation

◆ Components

enum Components

Definition at line 10 of file split.h.

Function Documentation

◆ pkt_get_split_in()

const struct pkt_split * pkt_get_split_in ( void )

Definition at line 61 of file split.c.

◆ pkt_get_split_out()

const struct pkt_split * pkt_get_split_out ( void )

Definition at line 67 of file split.c.

◆ pkt_get_type_in()

const struct pkt_split * pkt_get_type_in ( enum Components type )

Definition at line 73 of file split.c.

◆ pkt_get_type_out()

const struct pkt_split * pkt_get_type_out ( enum Components type )

Definition at line 83 of file split.c.

◆ pkt_print_split_in()

void pkt_print_split_in ( void )

Definition at line 500 of file split.c.

◆ pkt_print_split_out()

void pkt_print_split_out ( void )

Definition at line 510 of file split.c.

◆ pkt_split_mac_in()

const struct pkt_split * pkt_split_mac_in ( const void * link_pkt )

Definition at line 93 of file split.c.

◆ pkt_split_mac_out()

const struct pkt_split * pkt_split_mac_out ( const void * link_pkt )

Definition at line 100 of file split.c.


Watt-32 tcp/ip: E:/WATT/src/stkwalk.h Source File

  • src
stkwalk.h
1/*
2 * File:
3 * stkwalk.h
4 *
5 * Remarks:
6 *
7 * Note:
8 *
9 * Author:
10 * Jochen Kalmbach
11 *
12 */
13
14#pragma once
15
16#ifndef __STACKWALKER_H__
17#define __STACKWALKER_H__
18
19#ifndef _X86_
20#error Only INTEL environments are supported!
21#endif
22
23enum eAllocCheckOutput {
24 ACOutput_Simple = 1,
25 ACOutput_Advanced
26 };
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32int InitAllocCheckWN (enum eAllocCheckOutput eOutput,
33 LPCTSTR pszFilename,
34 ULONG ulShowStackAtAlloc);
35
36int InitAllocCheck (enum eAllocCheckOutput eOutput,
37 BOOL bSetUnhandledExeptionFilter,
38 ULONG ulShowStackAtAlloc);
39
40ULONG DeInitAllocCheck (void);
41void OnlyInstallUnhandeldExceptionFilter (enum eAllocCheckOutput eOutput);
42void ShowStack (HANDLE hThread, const CONTEXT *c, const char *pszLogFile);
43const char *StackWalkLogFile (void);
44void SetCallStackOutputType (enum eAllocCheckOutput eOutput);
45
46#ifdef __cplusplus
47};
48#endif
49
50#endif // __STACKWALKER_H__


Watt-32 tcp/ip: E:/WATT/src/stream.c File Reference

  • src
Functions
stream.c File Reference

Go to the source code of this file.

Functions

int | sock_fgets (char *buf, int max, FILE *stream)
int | sock_fputs (const char *text, FILE *stream)

Detailed Description

sock_fgets(), sock_fputs().

BSD sockets functionality for Watt-32 TCP/IP

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Version

0.5 : Dec 18, 1997 : G. Vanem - created

Definition in file stream.c.

Function Documentation

◆ sock_fgets()

int sock_fgets | ( | char * | buf,
 |  | int | max,
 |  | FILE * | stream
 | ) |  |

Definition at line 46 of file stream.c.

◆ sock_fputs()

int sock_fputs | ( | const char * | text,
 |  | FILE * | stream
 | ) |  |

Definition at line 65 of file stream.c.


Watt-32 tcp/ip: E:/WATT/src/swsvpkt.c Source File

  • src
swsvpkt.c
1/****************************************************************************
2 *
3 * File name : vpkt_uio.c
4 * Function : SwsVpkt user mode I/O
5 * Project : SwsVpkt
6 * Authors : Lawrence Rust
7 * Systems : ANSI C Win32
8 *
9 ****************************************************************************
10 *
11 * Created by Lawrence Rust, Software Systems Consultants
12 * lvr@softsystem.co.uk. Tel/Fax +33 5 49 72 79 63
13 *
14 * 15-Jan-06, LVR, Created.
15 *
16 * Aug 2010, GV, changed for Watt-32.
17 *
18 * Comments:
19 * --------
20 * This is an example of how to perform user mode network I/O.
21 *
22 ****************************************************************************
23 */
24
25#include "wattcp.h"
26
27#if defined(WIN32)
28
29#include "misc.h"
30#include "pcpkt.h"
31#include "winpkt.h"
32#include "w32_ndis.h"
33#include "swsvpkt.h"
34
35static struct {
36 uint64 rx_pkts;
37 uint64 rx_bytes;
38 uint64 rx_errors;
39 uint64 tx_pkts;
40 uint64 tx_bytes;
41 uint64 tx_errors;
42 } sws_stat;
43
44static DWORD WINAPI WorkerThread (void *priv_data);
45static void WINAPI StartReceivingApc (ULONG_PTR context);
46static void WINAPI ReceiveComplete (DWORD error, DWORD bytes, OVERLAPPED *overlapped);
47static void WINAPI ResubmitRxBufferApc (ULONG_PTR context);
48static BOOL QueueBuffer (struct SwsVpktUsr *pkt, struct SRxBuffer *rx_buf);
49
50/*
51 * Open a handle to the packet driver
52 */
53struct SwsVpktUsr *SwsVpktOpen (const char *szName,
54 const struct SwsVpktOpenInfo *pInfo)
55{
56 struct SwsVpktUsr *pPacket;
57 unsigned uRxBufs;
58 size_t size;
59 DWORD err;
60
61 winpkt_trace_func = "SwsVpktOpen";
62 WINPKT_TRACE ("name = %s\n", szName);
63
64 if (!pInfo || !pInfo->pfnRx)
65 return (NULL);
66
67 uRxBufs = pInfo->uRxBufs > 0 ? pInfo->uRxBufs : 16;
68
69 /* Allocate instance data */
70 size = sizeof(*pPacket) + uRxBufs * sizeof(pPacket->rxBuffer[0]);
71 pPacket = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, size);
72 if (!pPacket)
73 {
74 err = GetLastError();
75 WINPKT_TRACE ("HeapAlloc() failed; %s\n", win_strerror(err));
76 SetLastError (err);
77 return (NULL);
78 }
79
80 pPacket->hDevice = INVALID_HANDLE_VALUE;
81 pPacket->uRxBufs = uRxBufs;
82 pPacket->pfnRx = pInfo->pfnRx;
83
84 /* Create overlapped Tx done event
85 */
86 pPacket->txOverlap.hEvent = CreateEvent (NULL, TRUE, FALSE, NULL);
87 if (!pPacket->txOverlap.hEvent)
88 {
89 err = GetLastError();
90 SwsVpktClose (pPacket);
91 SetLastError (err);
92 WINPKT_TRACE ("CreateEvent() failed; %s\n", win_strerror(err));
93 return (NULL);
94 }
95
96 /* Attach to packet driver
97 */
98 pPacket->hDevice = CreateFileA (szName, GENERIC_READ | GENERIC_WRITE,
99 FILE_SHARE_READ | FILE_SHARE_WRITE,
100 NULL, /* Security */
101 OPEN_EXISTING,
102 FILE_FLAG_OVERLAPPED | FILE_ATTRIBUTE_NORMAL,
103 NULL); /* Template file */
104 if (pPacket->hDevice == INVALID_HANDLE_VALUE)
105 {
106 err = GetLastError();
107 SwsVpktClose (pPacket);
108 SetLastError (err);
109 WINPKT_TRACE ("CreateFileA() failed; %s\n", win_strerror(err));
110 return (NULL);
111 }
112
113 /* Start the worker thread
114 */
115 pPacket->hWorker = CreateThread (NULL, 0, WorkerThread, pPacket,
116 CREATE_SUSPENDED, NULL);
117 if (!pPacket->hWorker)
118 {
119 err = GetLastError();
120 SwsVpktClose (pPacket);
121 SetLastError (err);
122 WINPKT_TRACE ("CreateThread() failed; %s\n", win_strerror(err));
123 return (NULL);
124 }
125
126 SetThreadPriority (pPacket->hWorker, THREAD_PRIORITY_ABOVE_NORMAL);
127 ResumeThread (pPacket->hWorker);
128 QueueUserAPC (StartReceivingApc, pPacket->hWorker, (ULONG_PTR)pPacket);
129 return (pPacket);
130}
131
132/*
133 * Release packet driver resources
134 */
135BOOL SwsVpktClose (struct SwsVpktUsr *pPacket)
136{
137 char res [100] = { '\0' };
138 BOOL rc = FALSE;
139
140 winpkt_trace_func = "SwsVpktClose";
141
142 /* Signal the worker thread to exit */
143 pPacket->iWorkerExit = 1;
144 if (pPacket->hWorker)
145 {
146 if (WaitForSingleObject(pPacket->hWorker, 300) == WAIT_TIMEOUT)
147 {
148 /* This will occur if the thread is waiting in a critical section
149 * Resolve the deadlock by killing the thread
150 */
151 TerminateThread (pPacket->hWorker, 1);
152 strcpy (res, "thread killed, ");
153 }
154 CloseHandle (pPacket->hWorker);
155 }
156
157 if (pPacket->hDevice != INVALID_HANDLE_VALUE)
158 {
159 CloseHandle (pPacket->hDevice);
160 pPacket->hDevice = INVALID_HANDLE_VALUE;
161 strcat (res, "device closed, ");
162 rc = TRUE;
163 }
164
165 if (pPacket->txOverlap.hEvent)
166 {
167 CloseHandle (pPacket->txOverlap.hEvent);
168 strcat (res, "overlap event closed");
169 }
170
171 WINPKT_TRACE ("rc: %d, res: %s\n", rc, res);
172
173 HeapFree (GetProcessHeap(), 0, pPacket);
174 return (rc);
175}
176
177/*
178 * Send a frame
179 */
180UINT SwsVpktSend (struct SwsVpktUsr *pPacket,
181 const void *pvBuf, UINT uLen)
182{
183 DWORD sent = 0;
184 BOOL bRet, overlapped = FALSE;
185
186 pPacket->txOverlap.Offset = 0;
187 pPacket->txOverlap.OffsetHigh = 0;
188
189 bRet = WriteFile (pPacket->hDevice, pvBuf, uLen,
190 &sent, &pPacket->txOverlap);
191
192 if (!bRet && GetLastError() == ERROR_IO_PENDING)
193 {
194 /* Wait for completion */
195 sent = 0;
196 GetOverlappedResult (pPacket->hDevice, &pPacket->txOverlap, &sent, TRUE);
197 overlapped = TRUE;
198 }
199 if (sent)
200 {
201 sws_stat.tx_pkts++;
202 sws_stat.tx_bytes += sent;
203 }
204 else
205 sws_stat.tx_errors++;
206
207 winpkt_trace_func = "SwsVpktSend";
208 WINPKT_TRACE ("overlapped: %d, bRet %d; %s\n",
209 overlapped, bRet, sent == 0 ? win_strerror(GetLastError()) : "okay");
210 return (UINT)sent;
211}
212
213
214BOOL SwsVpktGetStatistics (const struct SwsVpktUsr *usr, struct PktStats *stats)
215{
216 stats->in_packets = sws_stat.rx_pkts;
217 stats->in_bytes = sws_stat.rx_bytes;
218 stats->out_packets = sws_stat.tx_pkts;
219 stats->out_bytes = sws_stat.tx_bytes;
220 stats->in_errors = sws_stat.rx_errors;
221 stats->out_errors = sws_stat.tx_errors;
222 ARGSUSED (usr);
223 return (TRUE);
224}
225
226BOOL SwsVpktGetAdapterState (const struct SwsVpktUsr *usr,
227 struct SwsVpktAdapterState *state)
228{
229 IOCTL_INFO info;
230 BOOL rc;
231
232 memset (&info, '\0', sizeof(info));
233
234 /* Get adapter info */
235 rc = SwsVpktDeviceRequest (usr->hDevice, /* Device handle */
236 (DWORD)IOCTL_GETINFO, /* IOCTL code */
237 NULL, 0, /* -> input buffer & size */
238 &info, /* -> output buffer */
239 sizeof(info), /* input buffer size */
240 NULL); /* Bytes returned */
241 if (rc)
242 {
243 state->isPowerOn = info.bPowerOn;
244 state->isMediaConnected = !info.bMediaDisconnected;
245 state->isWan = info.bWan;
246 state->isWanDown = info.bWanDown;
247 }
248 winpkt_trace_func = "SwsVpktGetAdapterState";
249 WINPKT_TRACE ("rc %d, state: %d,%d,%d,%d\n",
250 rc, state->isPowerOn, state->isMediaConnected,
251 state->isWan, state->isWanDown);
252 return (rc);
253}
254
255/*
256 * Get the adapter's MAC address
257 */
258BOOL SwsVpktGetMacAddress (const struct SwsVpktUsr *pPacket, mac_address *pMac)
259{
260 /* Get the device type etc */
261 return SwsVpktDeviceRequest (pPacket->hDevice, /* Device handle */
262 (DWORD)IOCTL_GETMACADDR, /* IOCTL code */
263 NULL, 0, /* -> input buffer & size */
264 pMac, /* -> output buffer */
265 sizeof(*pMac), /* output buffer size */
266 NULL); /* Bytes returned */
267}
268
269/*
270 * Get the adapter's description.
271 * Note: This IOCTL was added in ver 1.0.0.5
272 */
273BOOL SwsVpktGetDescription (const struct SwsVpktUsr *pPacket, char *descr, size_t max)
274{
275 return SwsVpktDeviceRequest (pPacket->hDevice, /* Device handle */
276 (DWORD)IOCTL_GETDESC, /* IOCTL code */
277 NULL, 0, /* -> input buffer & size */
278 descr, /* -> output buffer */
279 max, /* output buffer size */
280 NULL); /* Bytes returned */
281
282}
283
284/*
285 * Get the NDIS version.
286 */
287BOOL SwsVpktGetNDISversion (const struct SwsVpktUsr *pPacket, DWORD *ver)
288{
289 return SwsVpktDeviceRequest (pPacket->hDevice, /* Device handle */
290 OID_GEN_DRIVER_VERSION, /* IOCTL code */
291 NULL, 0, /* -> input buffer & size */
292 ver, /* -> output buffer */
293 sizeof(*ver), /* output buffer size */
294 NULL); /* Bytes returned */
295}
296
297/*
298 * Return swsVpkt.sys file-version.
299 */
300static char swsVpkt_ver [64] = "?";
301
302const char *SwsVpktGetDriverVersion (void)
303{
304 if (swsVpkt_ver[0] == '?')
305 get_file_version ("drivers\\swsVpkt.sys", swsVpkt_ver, sizeof(swsVpkt_ver));
306 return (swsVpkt_ver);
307}
308
309/*
310 * Worker thread
311 */
312static DWORD WINAPI WorkerThread (void *pv)
313{
314 struct SwsVpktUsr *pPacket = (struct SwsVpktUsr*) pv;
315
316 /* Execute IO completion callbacks and APC's until exit */
317 while (!pPacket->iWorkerExit)
318 SleepEx (100, TRUE);
319
320 /* Cancel all pending reads */
321 CancelIo (pPacket->hDevice);
322 SleepEx (10, TRUE);
323 return (0);
324}
325
326/*
327 * APC to start receiving
328 */
329static void WINAPI StartReceivingApc (ULONG_PTR ulContext)
330{
331 struct SwsVpktUsr *pPacket = (struct SwsVpktUsr*) ulContext;
332 UINT i;
333
334 /* Submit all read buffers */
335 for (i = 0; i < pPacket->uRxBufs; i++)
336 QueueBuffer (pPacket, &pPacket->rxBuffer[i]);
337}
338
339/*
340 * Post a receive buffer
341 */
342static BOOL QueueBuffer (struct SwsVpktUsr *pPacket, struct SRxBuffer *pBuffer)
343{
344 if (pPacket->iWorkerExit)
345 return (FALSE);
346
347 memset (&pBuffer->overlap, 0, sizeof(pBuffer->overlap));
348 pBuffer->overlap.hEvent = (HANDLE)pPacket;
349
350 if (!ReadFileEx(pPacket->hDevice, pBuffer->buffer, sizeof(pBuffer->buffer),
351 &pBuffer->overlap, ReceiveComplete))
352 {
353 DWORD dwErr = GetLastError();
354
355 switch (dwErr)
356 {
357 case ERROR_OPERATION_ABORTED:
358 break;
359 default:
360 /* Retry later */
361 QueueUserAPC (ResubmitRxBufferApc, pPacket->hWorker, (ULONG_PTR)pBuffer);
362 break;
363 }
364 return (FALSE);
365 }
366 return (TRUE);
367}
368
369/*
370 * APC to resubmit an RxBuffer
371 */
372static void WINAPI ResubmitRxBufferApc (ULONG_PTR ulContext)
373{
374 struct SRxBuffer *pBuffer = (struct SRxBuffer*) ulContext;
375 struct SwsVpktUsr *pPacket = (struct SwsVpktUsr*) pBuffer->overlap.hEvent;
376
377 /* Resubmit the buffer */
378 QueueBuffer (pPacket, pBuffer);
379}
380
381/*
382 * ReadFileEx completion routine
383 */
384static void WINAPI ReceiveComplete (
385 DWORD dwErr, /* completion code */
386 DWORD dwBytes, /* number of bytes transferred */
387 OVERLAPPED *lpOverlapped) /* I/O information buffer */
388{
389 struct SRxBuffer *pBuffer = OVL2RXBUF (lpOverlapped);
390 struct SwsVpktUsr *pPacket = (struct SwsVpktUsr*) pBuffer->overlap.hEvent;
391
392 winpkt_trace_func = "ReceiveComplete";
393 WINPKT_TRACE ("dwErr %lu, got %lu bytes\n", (u_long)dwErr, (u_long)dwBytes);
394
395 switch (dwErr)
396 {
397 case 0:
398 (*pPacket->pfnRx) (pPacket, pBuffer->buffer, dwBytes);
399 sws_stat.rx_pkts++;
400 sws_stat.rx_bytes += dwBytes;
401 break;
402
403 case ERROR_OPERATION_ABORTED:
404 sws_stat.rx_errors++;
405 break;
406 }
407
408 /* Resubmit the buffer */
409 QueueBuffer (pPacket, pBuffer);
410}
411
412static const struct search_list ccode_list[] = {
413 { (DWORD) IOCTL_GETINFO, "IOCTL_GETINFO" },
414 { (DWORD) IOCTL_GETMACADDR, "IOCTL_GETMACADDR" },
415 { (DWORD) IOCTL_GETDESC, "IOCTL_GETDESC" },
416 { (DWORD) OID_GEN_DRIVER_VERSION, "OID_GEN_DRIVER_VERSION" }
417 };
418
419/*
420 * Make a synchronous DeviceIoControl call to a handle opened
421 * using FILE_FLAG_OVERLAPPED
422 */
423BOOL SwsVpktDeviceRequest2 (HANDLE hDevice,
424 DWORD dwIoControlCode,
425 const void *lpInBuffer,
426 DWORD nInBufferSize,
427 void *lpOutBuffer,
428 DWORD nOutBufferSize,
429 DWORD *lpBytesReturned,
430 const char *file,
431 unsigned line)
432{
433 BOOL bResult;
434 HANDLE hEvent;
435 OVERLAPPED overlap;
436 DWORD bytesReturned, err;
437
438#if defined(USE_DEBUG)
439 winpkt_trace_func = "SwsVpktDeviceRequest";
440 winpkt_trace_file = file;
441 winpkt_trace_line = line;
442#endif
443
444 /* Create a manual reset event for overlapped wait */
445 hEvent = CreateEvent (NULL, TRUE, FALSE, NULL);
446 if (!hEvent)
447 {
448 err = GetLastError();
449#if defined(USE_DEBUG)
450 winpkt_trace ("CreateEvent failed; %s\n", win_strerror(err));
451#endif
452 SetLastError (err);
453 return (FALSE);
454 }
455
456 memset (&overlap, '\0', sizeof(overlap));
457 overlap.hEvent = hEvent;
458
459 if (!lpBytesReturned)
460 lpBytesReturned = &bytesReturned;
461
462 bResult = DeviceIoControl (hDevice, dwIoControlCode,
463 (void*)lpInBuffer,
464 nInBufferSize, lpOutBuffer,
465 nOutBufferSize, lpBytesReturned,
466 &overlap);
467
468 if (!bResult && GetLastError() == ERROR_IO_PENDING)
469 {
470 /* Wait for completion */
471 bResult = GetOverlappedResult (hDevice, &overlap, lpBytesReturned, TRUE);
472 }
473
474 err = GetLastError();
475
476#if defined(USE_DEBUG)
477 winpkt_trace ("%s, len %lu/%lu, bResult %d\n",
478 list_lookup(dwIoControlCode,ccode_list,DIM(ccode_list)),
479 (u_long)nInBufferSize, (u_long)*lpBytesReturned, bResult);
480#endif
481
482 CloseHandle (hEvent);
483 SetLastError (err);
484 return (bResult);
485}
486#endif /* WIN32 */
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
misc.h
get_file_version
BOOL get_file_version(const char *file, char *buf, size_t buf_len)
Returns the version of a PE image (.sys, .dll or .exe).
Definition: winmisc.c:227
pcpkt.h
IOCTL_INFO
Definition: swsvpkt.h:42
PktStats
Definition: tcp.h:806
SRxBuffer
Definition: swsvpkt.h:65
SwsVpktAdapterState
Definition: swsvpkt.h:96
SwsVpktOpenInfo
Definition: swsvpkt.h:91
SwsVpktUsr
Definition: swsvpkt.h:81
search_list
Definition: misc.h:131
swsvpkt.h
w32_ndis.h
wattcp.h
Core definitions.
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65
win_strerror
char *W32_CALL win_strerror(DWORD err)
Return err-number and string for 'err'.
Definition: winmisc.c:208
winpkt.h


Watt-32 tcp/ip: E:/WATT/src/swsvpkt.h File Reference

  • src
Data Structures | Typedefs | Functions
swsvpkt.h File Reference

Go to the source code of this file.

Data Structures

struct | IOCTL_BUFFER
struct | IOCTL_INFO
struct | SRxBuffer
struct | SwsVpktUsr
struct | SwsVpktOpenInfo
struct | SwsVpktAdapterState

Typedefs

typedef struct IOCTL_BUFFER | IOCTL_BUFFER
typedef struct IOCTL_INFO | IOCTL_INFO
typedef void | SwsVpktRxFn(struct SwsVpktUsr *, const void *, unsigned)

Functions

struct SwsVpktUsr * | SwsVpktOpen (const char *, const struct SwsVpktOpenInfo *)
BOOL | SwsVpktClose (struct SwsVpktUsr *usr)
BOOL | SwsVpktGetAdapterState (const struct SwsVpktUsr *usr, struct SwsVpktAdapterState *state)
BOOL | SwsVpktGetStatistics (const struct SwsVpktUsr *usr, struct PktStats *stats)
UINT | SwsVpktSend (struct SwsVpktUsr *usr, const void *buf, UINT buf_len)
BOOL | SwsVpktGetMacAddress (const struct SwsVpktUsr *usr, mac_address *addr)
BOOL | SwsVpktGetDescription (const struct SwsVpktUsr *usr, char *descr, size_t descr_len)
BOOL | SwsVpktGetNDISversion (const struct SwsVpktUsr *usr, DWORD *ver)
const char * | SwsVpktGetDriverVersion (void)
BOOL | SwsVpktDeviceRequest2 (HANDLE hDevice, DWORD dwIoControlCode, const void *lpInBuffer, DWORD nInBufferSize, void *lpOutBuffer, DWORD nOutBufferSize, DWORD *lpBytesReturned, const char *file, unsigned line)

Detailed Description

Only included on Win32

Definition in file swsvpkt.h.

Typedef Documentation

◆ SwsVpktRxFn

typedef void SwsVpktRxFn(struct SwsVpktUsr *, const void *, unsigned)

Definition at line 74 of file swsvpkt.h.

Function Documentation

◆ SwsVpktClose()

BOOL SwsVpktClose ( struct SwsVpktUsr * usr )

Definition at line 135 of file swsvpkt.c.

◆ SwsVpktDeviceRequest2()

BOOL SwsVpktDeviceRequest2 | ( | HANDLE | hDevice,
 |  | DWORD | dwIoControlCode,
 |  | const void * | lpInBuffer,
 |  | DWORD | nInBufferSize,
 |  | void * | lpOutBuffer,
 |  | DWORD | nOutBufferSize,
 |  | DWORD * | lpBytesReturned,
 |  | const char * | file,
 |  | unsigned | line
 | ) |  |

Definition at line 423 of file swsvpkt.c.

◆ SwsVpktGetAdapterState()

BOOL SwsVpktGetAdapterState | ( | const struct SwsVpktUsr * | usr,
 |  | struct SwsVpktAdapterState * | state
 | ) |  |

Definition at line 226 of file swsvpkt.c.

◆ SwsVpktGetDescription()

BOOL SwsVpktGetDescription | ( | const struct SwsVpktUsr * | usr,
 |  | char * | descr,
 |  | size_t | descr_len
 | ) |  |

Definition at line 273 of file swsvpkt.c.

◆ SwsVpktGetDriverVersion()

const char * SwsVpktGetDriverVersion ( void )

Definition at line 302 of file swsvpkt.c.

◆ SwsVpktGetMacAddress()

BOOL SwsVpktGetMacAddress | ( | const struct SwsVpktUsr * | usr,
 |  | mac_address * | addr
 | ) |  |

Definition at line 258 of file swsvpkt.c.

◆ SwsVpktGetNDISversion()

BOOL SwsVpktGetNDISversion | ( | const struct SwsVpktUsr * | usr,
 |  | DWORD * | ver
 | ) |  |

Definition at line 287 of file swsvpkt.c.

◆ SwsVpktGetStatistics()

BOOL SwsVpktGetStatistics | ( | const struct SwsVpktUsr * | usr,
 |  | struct PktStats * | stats
 | ) |  |

Definition at line 214 of file swsvpkt.c.

◆ SwsVpktOpen()

struct SwsVpktUsr * SwsVpktOpen | ( | const char * | szName,
 |  | const struct SwsVpktOpenInfo * | pInfo
 | ) |  |

Definition at line 53 of file swsvpkt.c.

◆ SwsVpktSend()

UINT SwsVpktSend | ( | struct SwsVpktUsr * | usr,
 |  | const void * | buf,
 |  | UINT | buf_len
 | ) |  |

Definition at line 180 of file swsvpkt.c.


Watt-32 tcp/ip: E:/WATT/src/syslog.c File Reference

  • src
Functions | Variables
syslog.c File Reference

Go to the source code of this file.

Functions

void MS_CDECL | syslog (int pri, const char *fmt,...)
void W32_CALL | vsyslog (int pri, const char *fmt, va_list ap)
static const char * | getlogname (void)
static int | openloghost (char **errbuf)
static void W32_CALL | _closelog (void)
void W32_CALL | openlog (const char *ident, int logstat, int logfac)
int W32_CALL | setlogmask (int new_mask)
char *W32_CALL | setlogtag (char *new_tag)
void W32_CALL | closelog (void)
int | main (void)

Variables

static sock_type * | log_sock = NULL
static FILE * | log_file = NULL
static DWORD | log_host = 0UL
static BOOL | log_opened = FALSE
static int | log_stat = 0
static char * | log_tag = NULL
static int | log_mask = LOG_INFO
static DWORD | log_facil = LOG_USER
CODE prioritynames []
CODE facilitynames []

Detailed Description

Simple syslog handler for Watt-32.

Loosely based on BSD-version. by Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o Jun-99

This module really belongs to the application layer, but is included in Watt-32 for convenience.

Note
syslog_init() must be called in watt_sock_init() (or prior to that). openlog() and syslog() cannot be used before watt_sock_init() is called.
Todo:
configure variables in syslog2.c when calling openlog() thus making syslog() independent of watt_sock_init().

Definition in file syslog.c.

Function Documentation

◆ _closelog()

static void W32_CALL _closelog ( void )
static

Definition at line 313 of file syslog.c.

◆ closelog()

void W32_CALL closelog ( void )

Definition at line 409 of file syslog.c.

◆ getlogname()

static const char * getlogname ( void )
static

Definition at line 240 of file syslog.c.

◆ main()

int main ( void )

Definition at line 434 of file syslog.c.

◆ openlog()

void W32_CALL openlog | ( | const char * | ident,
 |  | int | logstat,
 |  | int | logfac
 | ) |  |

Definition at line 318 of file syslog.c.

◆ openloghost()

static int openloghost ( char ** errbuf )
static

Definition at line 259 of file syslog.c.

◆ setlogmask()

int W32_CALL setlogmask ( int new_mask )

Definition at line 391 of file syslog.c.

◆ setlogtag()

char *W32_CALL setlogtag ( char * new_tag )

Definition at line 400 of file syslog.c.

◆ syslog()

void MS_CDECL syslog | ( | int | pri,
 |  | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 107 of file syslog.c.

◆ vsyslog()

void W32_CALL vsyslog | ( | int | pri,
 |  | const char * | fmt,
 |  | va_list | ap
 | ) |  |

Definition at line 115 of file syslog.c.

Variable Documentation

◆ facilitynames

CODE facilitynames[]
Initial value:
= {
{ LOG_AUTH, "auth" },
{ LOG_AUTHPRIV, "authpriv" },
{ LOG_CRON, "cron" },
{ LOG_DAEMON, "daemon" },
{ LOG_FTP, "ftp" },
{ LOG_KERN, "kern" },
{ LOG_LPR, "lpr" },
{ LOG_MAIL, "mail" },
{ INTERNAL_MARK, "mark" },
{ LOG_NEWS, "news" },
{ LOG_NTP, "ntp" },
{ LOG_AUTH, "security" },
{ LOG_SYSLOG, "syslog" },
{ LOG_USER, "user" },
{ LOG_UUCP, "uucp" },
{ LOG_LOCAL0, "local0" },
{ LOG_LOCAL1, "local1" },
{ LOG_LOCAL2, "local2" },
{ LOG_LOCAL3, "local3" },
{ LOG_LOCAL4, "local4" },
{ LOG_LOCAL5, "local5" },
{ LOG_LOCAL6, "local6" },
{ LOG_LOCAL7, "local7" },
{ (u_long) -1, NULL }
}

Definition at line 76 of file syslog.c.

◆ log_facil

DWORD log_facil = LOG_USER
static

Definition at line 55 of file syslog.c.

◆ log_file

FILE* log_file = NULL
static

Definition at line 49 of file syslog.c.

◆ log_host

DWORD log_host = 0UL
static

Definition at line 50 of file syslog.c.

◆ log_mask

int log_mask = LOG_INFO
static

Definition at line 54 of file syslog.c.

◆ log_opened

BOOL log_opened = FALSE
static

Definition at line 51 of file syslog.c.

◆ log_sock

sock_type* log_sock = NULL
static

Definition at line 48 of file syslog.c.

◆ log_stat

int log_stat = 0
static

Definition at line 52 of file syslog.c.

◆ log_tag

char* log_tag = NULL
static

Definition at line 53 of file syslog.c.

◆ prioritynames

CODE prioritynames[]
Initial value:
= {
{ LOG_ALERT, "alert" },
{ LOG_CRIT, "crit" },
{ LOG_DEBUG, "debug" },
{ LOG_EMERG, "emerg" },
{ LOG_ERR, "err" },
{ LOG_ERR, "error" },
{ LOG_INFO, "info" },
{ INTERNAL_NOPRI, "none" },
{ LOG_NOTICE, "notice" },
{ LOG_EMERG, "panic" },
{ LOG_WARNING, "warn" },
{ LOG_WARNING, "warning" },
{ (u_long) -1, NULL }
}

Definition at line 60 of file syslog.c.


Watt-32 tcp/ip: E:/WATT/src/syslog2.c File Reference

  • src
Functions | Variables
syslog2.c File Reference

Go to the source code of this file.

Functions

static | void (W32_CALL *prev_hook)(const char *
static int | get_log_mask (const char *value)
static void | set_syslog_mask (const char *value)
static void W32_CALL | syslog2_init (const char *name, const char *value)
void | syslog_init (void)

Variables

static const char *char | syslog_file_name [MAX_NAMELEN] = ""
char | syslog_host_name [MAX_HOSTLEN] = ""
WORD | syslog_port = 514
int | syslog_mask = LOG_UPTO(-1)

Detailed Description

Config-parser for syslog().

Simple syslog handler for Watt-32 & DOS. This module contain data and config-parser only.

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file syslog2.c.

Function Documentation

◆ get_log_mask()

static int get_log_mask ( const char * value )
static

Definition at line 59 of file syslog2.c.

◆ set_syslog_mask()

static void set_syslog_mask ( const char * value )
static

Definition at line 77 of file syslog2.c.

◆ syslog2_init()

static void W32_CALL syslog2_init | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Definition at line 86 of file syslog2.c.

◆ syslog_init()

void syslog_init ( void )

Definition at line 99 of file syslog2.c.

Variable Documentation

◆ syslog_file_name

const char* char syslog_file_name[MAX_NAMELEN] = ""

Definition at line 54 of file syslog2.c.

◆ syslog_host_name

char syslog_host_name[MAX_HOSTLEN] = ""

Definition at line 55 of file syslog2.c.

◆ syslog_mask

int syslog_mask = LOG_UPTO(-1)

Definition at line 57 of file syslog2.c.

◆ syslog_port

WORD syslog_port = 514

Definition at line 56 of file syslog2.c.


Watt-32 tcp/ip: E:/WATT/src/syslog2.h File Reference

  • src
Functions | Variables
syslog2.h File Reference

Go to the source code of this file.

Functions

void syslog_init (void)

Variables

char | syslog_file_name [MAX_NAMELEN]
char | syslog_host_name [MAX_HOSTLEN]
WORD | syslog_port
int | syslog_mask

Function Documentation

◆ syslog_init()

void syslog_init ( void )

Definition at line 99 of file syslog2.c.

Variable Documentation

◆ syslog_file_name

char syslog_file_name[MAX_NAMELEN]
extern

Definition at line 54 of file syslog2.c.

◆ syslog_host_name

char syslog_host_name[MAX_HOSTLEN]
extern

Definition at line 55 of file syslog2.c.

◆ syslog_mask

int syslog_mask
extern

Definition at line 57 of file syslog2.c.

◆ syslog_port

WORD syslog_port
extern

Definition at line 56 of file syslog2.c.


Watt-32 tcp/ip: E:/WATT/src/target.h File Reference

  • src
Typedefs | Functions | Variables
target.h File Reference

Go to the source code of this file.

Typedefs

typedef BYTE _far * FARPTR

Functions

void | ENABLE (void)
void | DISABLE (void)

Variables

REALPTR | _watt_dosTbr
DWORD | _watt_dosTbSize
FARPTR | _watt_dosFp
WORD | _watt_dosTbSeg
WORD | _watt_dos_ds
CRITICAL_SECTION | _watt_crit_sect

Detailed Description

Definitions of targets and macros for Waterloo tcp/ip.

by G. Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o 1995 - 2015.

Definition in file target.h.

Typedef Documentation

◆ FARPTR

typedef BYTE _far* FARPTR

Definition at line 298 of file target.h.

Variable Documentation

◆ _watt_crit_sect

CRITICAL_SECTION _watt_crit_sect
extern

Definition at line 48 of file winmisc.c.

◆ _watt_dos_ds

WORD _watt_dos_ds

Definition at line 327 of file target.h.

◆ _watt_dosFp

FARPTR _watt_dosFp
extern

Definition at line 299 of file target.h.

◆ _watt_dosTbr

DWORD _watt_dosTbr
extern

Definition at line 302 of file target.h.

◆ _watt_dosTbSeg

WORD _watt_dosTbSeg
extern

Definition at line 327 of file target.h.

◆ _watt_dosTbSize

DWORD _watt_dosTbSize

Definition at line 281 of file target.h.


Watt-32 tcp/ip: E:/WATT/src/tcp_fsm.c File Reference

  • src
Data Structures | Typedefs | Functions | Variables
tcp_fsm.c File Reference

Go to the source code of this file.

Data Structures

struct tcp_reasm

Typedefs

typedef int(* tcp_StateProc) (_tcp_Socket **, const in_Header *, tcp_Header *, int)

Functions

static int | tcp_listen_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_resolve_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_synsent_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_synrec_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_estab_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_estcl_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_finwt1_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_finwt2_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_closewt_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_closing_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_lastack_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_timewt_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
static int | tcp_process_data (_tcp_Socket *s, const tcp_Header *tcp, int len, int *flags)
Process the data in an incoming segment.
static void | tcp_set_window (_tcp_Socket *s, const tcp_Header *tcp)
Allocate a Tx-buffer based on peer's advertised window.
static int | tcp_process_ACK (_tcp_Socket *s, long *unack)
static int | tcp_reassemble (_tcp_Socket *s, const tcp_Header *tcp, UINT len, int flags)
int | _tcp_fsm (_tcp_Socket **sp, const in_Header *ip)
static void | tcp_process_options (_tcp_Socket *s, const tcp_Header *tcp, const BYTE *tcp_data, int flags)
Process TCP options in segment.
static void | copy_in_order (_tcp_Socket *s, const BYTE *data, unsigned len)
static void | data_in_order (_tcp_Socket *s, const BYTE *data, unsigned len, unsigned diff)
static void | prepend_out_of_order (_tcp_Socket *s, const BYTE *data, unsigned len)
static void | append_out_of_order (_tcp_Socket *s, const BYTE *data, unsigned len)
static void | data_out_of_order (_tcp_Socket *s, const BYTE *data, unsigned len, unsigned diff)
static int | tcp_reassemble (_tcp_Socket *s, const tcp_Header *tcp, const BYTE *data, UINT len, int *flags)

Variables

static tcp_StateProc | tcp_state_tab []
static BOOL | is_ip4
static DWORD | acknum
static DWORD | seqnum

Detailed Description

State machine for TCP processing. Previously this was in pctcp.c and tcp_handler().

Definition in file tcp_fsm.c.

Typedef Documentation

◆ tcp_StateProc

typedef int(* tcp_StateProc) (_tcp_Socket **, const in_Header *, tcp_Header *, int)

Definition at line 37 of file tcp_fsm.c.

Function Documentation

◆ _tcp_fsm()

int _tcp_fsm | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip
 | ) |  |

Definition at line 99 of file tcp_fsm.c.

◆ append_out_of_order()

static void append_out_of_order | ( | _tcp_Socket * | s,
 |  | const BYTE * | data,
 |  | unsigned | len
 | ) |  |
static

Definition at line 947 of file tcp_fsm.c.

◆ copy_in_order()

static void copy_in_order | ( | _tcp_Socket * | s,
 |  | const BYTE * | data,
 |  | unsigned | len
 | ) |  |
static

Definition at line 862 of file tcp_fsm.c.

◆ data_in_order()

static void data_in_order | ( | _tcp_Socket * | s,
 |  | const BYTE * | data,
 |  | unsigned | len,
 |  | unsigned | diff
 | ) |  |
static

Definition at line 876 of file tcp_fsm.c.

◆ data_out_of_order()

static void data_out_of_order | ( | _tcp_Socket * | s,
 |  | const BYTE * | data,
 |  | unsigned | len,
 |  | unsigned | diff
 | ) |  |
static

Definition at line 961 of file tcp_fsm.c.

◆ prepend_out_of_order()

static void prepend_out_of_order | ( | _tcp_Socket * | s,
 |  | const BYTE * | data,
 |  | unsigned | len
 | ) |  |
static

Definition at line 933 of file tcp_fsm.c.

◆ tcp_closewt_state()

static int tcp_closewt_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static

Definition at line 478 of file tcp_fsm.c.

◆ tcp_closing_state()

static int tcp_closing_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static

Definition at line 631 of file tcp_fsm.c.

◆ tcp_estab_state()

static int tcp_estab_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static

Definition at line 326 of file tcp_fsm.c.

◆ tcp_estcl_state()

static int tcp_estcl_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static

Definition at line 467 of file tcp_fsm.c.

◆ tcp_finwt1_state()

static int tcp_finwt1_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static

Definition at line 487 of file tcp_fsm.c.

◆ tcp_finwt2_state()

static int tcp_finwt2_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static

Definition at line 585 of file tcp_fsm.c.

◆ tcp_lastack_state()

static int tcp_lastack_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static

Definition at line 658 of file tcp_fsm.c.

◆ tcp_listen_state()

static int tcp_listen_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static

Definition at line 147 of file tcp_fsm.c.

◆ tcp_process_ACK()

static int tcp_process_ACK | ( | _tcp_Socket * | s,
 |  | long * | unack
 | ) |  |
static

Definition at line 1144 of file tcp_fsm.c.

◆ tcp_process_data()

static int tcp_process_data | ( | _tcp_Socket * | s,
 |  | const tcp_Header * | tcp,
 |  | int | len,
 |  | int * | flags
 | ) |  |
static

Process the data in an incoming segment.

Called from all states where incoming data can be received: SYNSENT, ESTAB, ESTCL, CLOSWT, FIN-WAIT-1 and FIN-WAIT-2.

Todo:
Handle Out-of-Order urgent data. Raise SIGURG.

Definition at line 1009 of file tcp_fsm.c.

References tcp_Socket::adv_win, tcp_Socket::recv_next, tcp_process_options(), tcp_set_window(), tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ tcp_process_options()

static void tcp_process_options | ( | _tcp_Socket * | s,
 |  | const tcp_Header * | tcp,
 |  | const BYTE * | tcp_data,
 |  | int | flags
 | ) |  |
static

Process TCP options in segment.

Definition at line 714 of file tcp_fsm.c.

References tcp_Socket::max_seg, tcp_Socket::recv_next, tcp_Socket::ts_echo, and tcp_Socket::ts_recent.

◆ tcp_reassemble()

static int tcp_reassemble | ( | _tcp_Socket * | s,
 |  | const tcp_Header * | tcp,
 |  | const BYTE * | data,
 |  | UINT | len,
 |  | int * | flags
 | ) |  |
static
Todo:
Create a better TCP reassembler some day. Current logic only handles 1 missed segment. We should handle at least 2.

Definition at line 1242 of file tcp_fsm.c.

References tcp_Socket::adv_win, and tcp_Socket::recv_next.

◆ tcp_resolve_state()

static int tcp_resolve_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static

Definition at line 197 of file tcp_fsm.c.

◆ tcp_set_window()

static void tcp_set_window | ( | _tcp_Socket * | s,
 |  | const tcp_Header * | tcp
 | ) |  |
static

Allocate a Tx-buffer based on peer's advertised window.

Note: our advertised window (s->adv_win) is controlled by sock_setbuf().

Definition at line 1196 of file tcp_fsm.c.

References _eth_ndis3pkt, tcp_Socket::max_tx_data, tcp_Socket::tx_buf, tcp_Socket::tx_data, tcp_Socket::tx_datalen, and tcp_Socket::window.

◆ tcp_synrec_state()

static int tcp_synrec_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static

Definition at line 294 of file tcp_fsm.c.

◆ tcp_synsent_state()

static int tcp_synsent_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static
Todo:
recalculate RTT-timer

Definition at line 210 of file tcp_fsm.c.

References tcp_Socket::flags, tcp_Socket::last_seqnum, tcp_Socket::recv_next, tcp_Socket::send_next, set_timeout(), tcp_Socket::state, tcp_process_data(), tcp_Socket::timeout, tcp_Socket::tos, tcp_Socket::tx_datalen, and tcp_Socket::unhappy.

◆ tcp_timewt_state()

static int tcp_timewt_state | ( | _tcp_Socket ** | sp,
 |  | const in_Header * | ip,
 |  | tcp_Header * | tcp,
 |  | int | flags
 | ) |  |
static

Definition at line 691 of file tcp_fsm.c.

Variable Documentation

◆ acknum

DWORD acknum
static

Definition at line 75 of file tcp_fsm.c.

◆ is_ip4

BOOL is_ip4
static

Definition at line 74 of file tcp_fsm.c.

◆ seqnum

DWORD seqnum
static

Definition at line 75 of file tcp_fsm.c.

◆ tcp_state_tab

tcp_StateProc tcp_state_tab[]
static
Initial value:
= {
tcp_listen_state,
tcp_resolve_state,
tcp_synsent_state,
tcp_synrec_state,
tcp_estab_state,
tcp_estcl_state,
tcp_finwt1_state,
tcp_finwt2_state,
tcp_closewt_state,
tcp_closing_state,
tcp_lastack_state,
tcp_timewt_state,
}
tcp_synsent_state
static int tcp_synsent_state(_tcp_Socket **, const in_Header *, tcp_Header *, int)
Definition: tcp_fsm.c:210

Definition at line 59 of file tcp_fsm.c.


Watt-32 tcp/ip: E:/WATT/src/tcp_md5.c File Reference

  • src
Data Structures | Functions | Variables
tcp_md5.c File Reference

Go to the source code of this file.

Data Structures

struct MD5_CTX

Functions

static void | MD5_Init (MD5_CTX *context)
static void | MD5_Update (MD5_CTX *context, const void *buffer, size_t length)
static void | MD5_Final (BYTE result[16], MD5_CTX *context)
const char *W32_CALL | tcp_md5_secret (_tcp_Socket *sock, const char *secret)
void W32_CALL | make_md5_signature (const in_Header *ip, const tcp_Header *tcp, WORD datalen, const char *secret, BYTE *buf)
BOOL W32_CALL | check_md5_signature (const _tcp_Socket *s, const in_Header *ip)
static void | Transform (DWORD[4], const BYTE *)
static void | Encode (BYTE *, const DWORD *, size_t)
static void | Decode (DWORD *, const BYTE *, size_t)

Variables

static BYTE padding [64]

Detailed Description

Handling of TCP MD5 fingrprint option.

Copyright (c) 1997-2002 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Version

0.1 : Mar 24, 2004 : G. Vanem - created

Definition in file tcp_md5.c.

Function Documentation

◆ check_md5_signature()

BOOL W32_CALL check_md5_signature | ( | const _tcp_Socket * | s,
 |  | const in_Header * | ip
 | ) |  |

Definition at line 122 of file tcp_md5.c.

◆ Decode()

static void Decode | ( | DWORD * | output,
 |  | const BYTE * | input,
 |  | size_t | len
 | ) |  |
static

Definition at line 499 of file tcp_md5.c.

◆ Encode()

static void Encode | ( | BYTE * | output,
 |  | const DWORD * | input,
 |  | size_t | len
 | ) |  |
static

Definition at line 478 of file tcp_md5.c.

◆ make_md5_signature()

void W32_CALL make_md5_signature | ( | const in_Header * | ip,
 |  | const tcp_Header * | tcp,
 |  | WORD | datalen,
 |  | const char * | secret,
 |  | BYTE * | buf
 | ) |  |

Definition at line 77 of file tcp_md5.c.

◆ MD5_Final()

static void MD5_Final | ( | BYTE | result[16],
 |  | MD5_CTX * | context
 | ) |  |
static

Definition at line 356 of file tcp_md5.c.

◆ MD5_Init()

static void MD5_Init ( MD5_CTX * context )
static

Definition at line 302 of file tcp_md5.c.

◆ MD5_Update()

static void MD5_Update | ( | MD5_CTX * | context,
 |  | const void * | buffer,
 |  | size_t | length
 | ) |  |
static

Definition at line 318 of file tcp_md5.c.

◆ tcp_md5_secret()

const char *W32_CALL tcp_md5_secret | ( | _tcp_Socket * | sock,
 |  | const char * | secret
 | ) |  |

Definition at line 63 of file tcp_md5.c.

◆ Transform()

static void Transform | ( | DWORD | state[4],
 |  | const BYTE * | block
 | ) |  |
static

Definition at line 383 of file tcp_md5.c.

Variable Documentation

◆ padding

BYTE padding[64]
static
Initial value:
= {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0
}

Definition at line 254 of file tcp_md5.c.


Watt-32 tcp/ip: E:/WATT/src/teredo64.c Source File

  • src
teredo64.c
1/*
2 * IPv6 tunneling over UDP/IPv4
3 *
4 * Refs:
5 * http://www.ietf.org/internet-drafts/draft-huitema-v6ops-teredo-00.txt
6 * http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/winxppro/maintain/Teredo.asp
7 */
8
9#include "socket.h"
10#include "teredo64.h"
11
12/* 3FFE:831F::/32 */
13const struct in6_addr in6addr_teredo_pfx = {{ 0x3F, 0xFE, 0x83, 0x1F,
14 0,0,0,0, 0,0,0,0,
15 0,0,0,0 }};
16
17/*
18 * make_ipv6 teredo addr from
19 * dest_host, port, is_cone_nat:
20 *
21 * prefix + ip4_host + (0x8000 * is_cone_nat) + (port ^0xFFFF)
22 */
23
in6_addr
Definition: in.h:151
teredo64.h


Watt-32 tcp/ip: E:/WATT/src/teredo64.h File Reference

  • src
teredo64.h File Reference

Go to the source code of this file.


Watt-32 tcp/ip: E:/WATT/src/tftp.c File Reference

  • src
Functions | Variables
tftp.c File Reference

Go to the source code of this file.

Functions

int (W32_CALL *_tftp_write)(const void *
static void | send_req (char request, const char *fname)
Send a tftp request packet.
static void | send_ack (WORD block)
Send a tftp acknowledge packet.
static const char * | tftp_strerror (int code)
Return error string for 'th_code'.
static void | udp_callback (_udp_Socket *s, int icmp_type, int icmp_code)
Watch out for "ICMP port unreachable".
static int | recv_packet (DWORD block)
Receive a TFTP data packet.
static int | tftp_open (DWORD server, const char *fname)
Open a TFTP connection on a random local port (our transaction ID).
static void | tftp_close (void)
Close the TFTP connection.
char * | tftp_set_server (const char *name, int len)
Set the name of TFTP server.
char * | tftp_set_boot_fname (const char *name, int len)
Set the name of remote/local file to load from TFTP server.
static char * | tftp_set_xfer_mode (const char *name)
Set the mode used for transfer.
static int | tftp_get_block (const char **buf)
Read the next data packet from a TFTP connection.
int | tftp_boot_load (void)
Load the BOOT-file from TFTP server.
static | void (W32_CALL *prev_hook)(const char *
Config-file handler for TFTP-client.
static const char *static void W32_CALL | tftp_cfg_hook (const char *name, const char *value)
static void W32_CALL | tftp_exit (void)
Free allocated memory.
int | tftp_init (void)
Initialize config-hook for TFTP protocol.
int | main (void)
static int W32_CALL | close_func (void)
static int W32_CALL | write_func (const void *buf, size_t length)
void | usage (const char *argv0)
int | main (int argc, char **argv)

Variables

size_t = NULL
static struct tftphdr * | inbuf
static struct tftphdr * | outbuf
static sock_type * | sock
static DWORD | currblock
static int | blocksize
static int | ibuflen
static int | isopen
static int | tftp_errno = 0
static DWORD | tftp_server = 0
static int | tftp_timeout = TFTP_TIMEOUT
static int | tftp_retry = TFTP_RETRY
static int | tftp_lport = 0
static char | tftp_server_name [MAX_HOSTLEN] = ""
static char | tftp_xfer_mode [MAX_VALUELEN] = OCTET_STR
static char * | tftp_boot_remote_file = NULL
static char * | tftp_boot_local_file = NULL
static char * | tftp_openmode = NULL
static FILE * | file
static char * | fname
static DWORD | tot_size
static time_t | start

Detailed Description

TFTP client.

Boot-ROM-Code to load (any file or) an operating system across a TCP/IP network.

Module: tftp.c Purpose: Get a file with TFTP protocol Entries: tftp_boot_load, tftp_set_server, tftp_set_boot_fname

Copyright (C) 1995,1996,1997 Gero Kuhlmann gero@.nosp@m.gkmi.nosp@m.nix.h.nosp@m.an.d.nosp@m.e

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Major changes for Watt-32 by G. Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o 1999

This client adheres to RFC-1350 (TFTP v2), but supports only reading from a remote host.

Todo:
Support option negotiation and ETFTP (RFC-1986)

Definition in file tftp.c.

Function Documentation

◆ close_func()

static int W32_CALL close_func ( void )
static

Definition at line 611 of file tftp.c.

◆ main() [1/2]

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 686 of file tftp.c.

◆ main() [2/2]

int main ( void )

Definition at line 591 of file tftp.c.

◆ recv_packet()

static int recv_packet ( DWORD block )
static

Receive a TFTP data packet.

Definition at line 188 of file tftp.c.

References tftp_strerror(), udp_callback(), W32_GCC_FUNC_TYPE_WARN_DEF(), and W32_GCC_FUNC_TYPE_WARN_OFF().

◆ send_ack()

static void send_ack ( WORD block )
static

Send a tftp acknowledge packet.

Definition at line 136 of file tftp.c.

◆ send_req()

static void send_req | ( | char | request,
 |  | const char * | fname
 | ) |  |
static

Send a tftp request packet.

Definition at line 105 of file tftp.c.

◆ tftp_boot_load()

int tftp_boot_load ( void )

Load the BOOT-file from TFTP server.

Definition at line 474 of file tftp.c.

References resolve(), tftp_close(), tftp_get_block(), and tftp_open().

◆ tftp_cfg_hook()

static const char *static void W32_CALL tftp_cfg_hook | ( | const char * | name,
 |  | const char * | value
 | ) |  |
static

Definition at line 546 of file tftp.c.

◆ tftp_close()

static void tftp_close ( void )
static

Close the TFTP connection.

Definition at line 361 of file tftp.c.

◆ tftp_exit()

static void W32_CALL tftp_exit ( void )
static

Free allocated memory.

Definition at line 565 of file tftp.c.

References _watt_fatal_error.

◆ tftp_get_block()

static int tftp_get_block ( const char ** buf )
static

Read the next data packet from a TFTP connection.

Definition at line 424 of file tftp.c.

References recv_packet(), and send_ack().

◆ tftp_init()

int tftp_init ( void )

Initialize config-hook for TFTP protocol.

Definition at line 577 of file tftp.c.

References tftp_exit().

◆ tftp_open()

static int tftp_open | ( | DWORD | server,
 |  | const char * | fname
 | ) |  |
static

Open a TFTP connection on a random local port (our transaction ID).

Send the request, wait for first data block and send the first ACK.

Definition at line 292 of file tftp.c.

References Random(), recv_packet(), send_ack(), send_req(), and udp_open().

◆ tftp_set_boot_fname()

char * tftp_set_boot_fname | ( | const char * | name,
 |  | int | len
 | ) |  |

Set the name of remote/local file to load from TFTP server.

Format is "tftp.boot_file = remote [local]. Note: ‘remote’ name cannot contain spaces.

Definition at line 392 of file tftp.c.

References _strlcpy().

◆ tftp_set_server()

char * tftp_set_server | ( | const char * | name,
 |  | int | len
 | ) |  |

Set the name of TFTP server.

Definition at line 381 of file tftp.c.

References _strlcpy().

◆ tftp_set_xfer_mode()

static char * tftp_set_xfer_mode ( const char * name )
static

Set the mode used for transfer.

Definition at line 416 of file tftp.c.

References _strlcpy().

◆ tftp_strerror()

static const char * tftp_strerror ( int code )
static

Return error string for 'th_code'.

Definition at line 149 of file tftp.c.

◆ udp_callback()

static void udp_callback | ( | _udp_Socket * | s,
 |  | int | icmp_type,
 |  | int | icmp_code
 | ) |  |
static

Watch out for "ICMP port unreachable".

Definition at line 171 of file tftp.c.

◆ usage()

void usage ( const char * argv0 )

Definition at line 669 of file tftp.c.

◆ write_func()

static int W32_CALL write_func | ( | const void * | buf,
 |  | size_t | length
 | ) |  |
static

Definition at line 629 of file tftp.c.

Variable Documentation

◆ blocksize

int blocksize
static

Definition at line 86 of file tftp.c.

◆ currblock

DWORD currblock
static

Definition at line 85 of file tftp.c.

◆ file

FILE* file
static

Definition at line 606 of file tftp.c.

◆ fname

char* fname
static

Definition at line 607 of file tftp.c.

◆ ibuflen

int ibuflen
static

Definition at line 87 of file tftp.c.

◆ inbuf

struct tftphdr* inbuf
static

Definition at line 81 of file tftp.c.

◆ isopen

int isopen
static

Definition at line 88 of file tftp.c.

◆ outbuf

struct tftphdr* outbuf
static

Definition at line 82 of file tftp.c.

◆ size_t

size_t = NULL

Definition at line 75 of file tftp.c.

◆ sock

sock_type* sock
static

Definition at line 83 of file tftp.c.

◆ start

time_t start
static

Definition at line 609 of file tftp.c.

◆ tftp_boot_local_file

char* tftp_boot_local_file = NULL
static

Definition at line 99 of file tftp.c.

◆ tftp_boot_remote_file

char* tftp_boot_remote_file = NULL
static

Definition at line 98 of file tftp.c.

◆ tftp_errno

int tftp_errno = 0
static

Definition at line 90 of file tftp.c.

◆ tftp_lport

int tftp_lport = 0
static

Definition at line 94 of file tftp.c.

◆ tftp_openmode

char* tftp_openmode = NULL
static

Definition at line 100 of file tftp.c.

◆ tftp_retry

int tftp_retry = TFTP_RETRY
static

Definition at line 93 of file tftp.c.

◆ tftp_server

DWORD tftp_server = 0
static

Definition at line 91 of file tftp.c.

◆ tftp_server_name

char tftp_server_name[MAX_HOSTLEN] = ""
static

Definition at line 96 of file tftp.c.

◆ tftp_timeout

int tftp_timeout = TFTP_TIMEOUT
static

Definition at line 92 of file tftp.c.

◆ tftp_xfer_mode

char tftp_xfer_mode[MAX_VALUELEN] = OCTET_STR
static

Definition at line 97 of file tftp.c.

◆ tot_size

DWORD tot_size
static

Definition at line 608 of file tftp.c.


Watt-32 tcp/ip: E:/WATT/src/tftp.h File Reference

  • src
Functions
tftp.h File Reference

Go to the source code of this file.

Functions

int | tftp_init (void)
Initialize config-hook for TFTP protocol.
int | tftp_boot_load (void)
Load the BOOT-file from TFTP server.
char * | tftp_set_server (const char *name, int len)
Set the name of TFTP server.
char * | tftp_set_boot_fname (const char *name, int len)
Set the name of remote/local file to load from TFTP server.

Detailed Description

Boot-ROM-Code to load an operating system across a TCP/IP network.

Definitions for implementing the TFTP protocol

Copyright (C) 1995,1996,1997 Gero Kuhlmann gero@.nosp@m.gkmi.nosp@m.nix.h.nosp@m.an.d.nosp@m.e

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Definition in file tftp.h.

Function Documentation

◆ tftp_boot_load()

int tftp_boot_load ( void )

Load the BOOT-file from TFTP server.

Definition at line 474 of file tftp.c.

References resolve(), tftp_close(), tftp_get_block(), and tftp_open().

◆ tftp_init()

int tftp_init ( void )

Initialize config-hook for TFTP protocol.

Definition at line 577 of file tftp.c.

References tftp_exit().

◆ tftp_set_boot_fname()

char * tftp_set_boot_fname | ( | const char * | name,
 |  | int | len
 | ) |  |

Set the name of remote/local file to load from TFTP server.

Format is "tftp.boot_file = remote [local]. Note: ‘remote’ name cannot contain spaces.

Definition at line 392 of file tftp.c.

References _strlcpy().

◆ tftp_set_server()

char * tftp_set_server | ( | const char * | name,
 |  | int | len
 | ) |  |

Set the name of TFTP server.

Definition at line 381 of file tftp.c.

References _strlcpy().


Watt-32 tcp/ip: E:/WATT/src/timer.c File Reference

  • src
Functions | Variables
timer.c File Reference

Go to the source code of this file.

Functions

WINBASEAPI VOID WINAPI | GetNativeSystemInfo (LPSYSTEM_INFO)
void | init_timers (void)
Setup timer stuff and measure CPU speed.
void W32_CALL | init_userSuppliedTimerTick (void)
init_userSuppliedTimerTick() - setup timer handling for programs that are already running a periodic interrupt or whatever (i.e.
void W32_CALL | userTimerTick (DWORD elapsed_time_msec)
Provide timer-ticks from an application.
static void | new_int_8 (void)
User defined 10 (or 55) milli-sec counter ISR.
void | exit_timer_isr (void)
void | init_timer_isr (void)
int W32_CALL | cmp_timers (DWORD t1, DWORD t2)
Compare two timers with expirary at 't1' and 't2'.
int | hires_timer (int on)
Control use of high-resolution timer.
DWORD | clockbits (void)
The following 2 routines are modified versions from KA9Q NOS by Phil Karn.
DWORD | millisec_clock (void)
Return hardware time-of-day in milliseconds.
DWORD W32_CALL | set_timeout (DWORD msec)
Return time for when given timeout (msec) expires.
BOOL W32_CALL | chk_timeout (DWORD value)
Check if milli-sec value has expired:
int W32_CALL | set_timediff (long msec)
Must be called by user right before or after a time change occurs.
long W32_CALL | get_timediff (DWORD now, DWORD tim)
Return time difference between timers now and tim.
double W32_CALL | timeval_diff (const struct timeval *newer, const struct timeval *older)
Return difference (in micro-sec) between timevals *newer and *older.
struct timeval W32_CALL | timeval_diff2 (struct timeval *ta, struct timeval *tb)
const char * | time_str (DWORD val)
Return string x.xx for timeout value.
const char * | hms_str (DWORD sec)
Return string "HH:MM:SS" for a time in seconds.
const char * | elapsed_str (DWORD val)
Return string "xx:xx" for time elapsed since started.
DWORD | ms_clock (void)
void | delay (unsigned int msec)
static void | Wait_N_ticks (int num)
uint64 | get_cpu_speed (void)
Return estimated CPU speed in Hz.
uint64 | _w32_get_rdtsc (void)
Another hackery section for gcc -O0 -fgnu89-inline:
static BOOL | get_processor_freq (uint64 *Hz)
uint64 | win_get_perf_count (void)
uint64 | win_get_rdtsc (void)

Variables

DWORD | start_time = 0
Start-time of watt_sock_init() (in msec)
DWORD | start_day = 0
Start-day of watt_sock_init()
BOOL | has_rdtsc = TRUE
Never set in Watt-32.
BOOL | use_rdtsc = TRUE
Ditto.
BOOL | has_8254 = FALSE
Do we have a working 8254 timer chip?
BOOL | using_int8 = FALSE
init_timer_isr() called
DWORD | clocks_per_usec = 0L
Measured CPU speed (MHz)
time_t | user_tick_base = 0UL
DWORD | user_tick_msec = 0UL
BOOL | user_tick_active = FALSE
unsigned | num_cpus = 1
static DWORD | date = 0
static DWORD | date_ms = 0
static W32_IntrHandler | old_int_8 = NULL
static REALPTR | int8_cback
static RMC_BLK | rmBlock_int8
static DWORD | itimer_resolution = 0UL
static void(* | old_sigalrm )(int)
static struct itimerval | old_itimer
static DWORD | tick_timer_8254 = 0UL

Detailed Description

Module for handling timers.

Modifications by GvB 2002-09

Todo:
To get rid of the timer problem once and for all we need a timer ISR that increments a 32-bit value no regard to day roll-over etc. Maybe hook up IRQ 8 to call a real-mode stub that we opy to DOS-memory (similar to the pkt_receiver stub code. Then far-peek at that timer variable.

09-Jan-2003: Bernd Omenitch Omeni.nosp@m.tsch.nosp@m.@cash.nosp@m.poin.nosp@m.t.at contributed the Timer ISR code (init_timer_isr() etc). I rewrote it and added support for Borland/PowerPak/Pharlap).

Definition in file timer.c.

Function Documentation

◆ _w32_get_rdtsc()

uint64 _w32_get_rdtsc ( void )

Another hackery section for gcc -O0 -fgnu89-inline:

Definition at line 872 of file timer.c.

◆ chk_timeout()

BOOL W32_CALL chk_timeout ( DWORD value )

Check if milli-sec value has expired:

Return values

li TRUE timer expired

  • FALSE not expired (or value not set)

Definition at line 545 of file timer.c.

References has_8254, millisec_clock(), and set_timeout().

◆ clockbits()

DWORD clockbits ( void )

The following 2 routines are modified versions from KA9Q NOS by Phil Karn.

clockbits() - Read low order bits of timer 0 (the TOD clock) This works only for the 8254 chips used in ATs and 386+.

Old version: The timer 0 runs in mode 3 (square wave mode), counting down by 2s, twice for each cycle. So it is necessary to read back the OUTPUT pin to see which half of the cycle we're in. I.e., the OUTPUT pin forms the most significant bit of the count. Unfortunately, the 8253 in the PC/XT lacks a command to read the OUTPUT pin...

Now simply: The timer 0 runs in mode 2 (rate generator), counting down. We don't compare the OUTPUT pin to see what cycle we're in. A bit lower precision, but a bit faster.

WARNING!: This can cause serious trouble if anything else is also using timer interrupts. In that case use the above userSuppliedTimerTick(). The reading of I/O registers gives bad precision under Windows.

Definition at line 409 of file timer.c.

◆ cmp_timers()

int W32_CALL cmp_timers | ( | DWORD | t1,
 |  | DWORD | t2
 | ) |  |

Compare two timers with expirary at 't1' and 't2'.

Return values

li -1 if t1 expires before t2

  • 0 if t1 == t2
  • +1 if t1 expires after t2
Note
This logic fails when timers approaches ULONG_MAX after approx. 50 days.

Definition at line 358 of file timer.c.

◆ delay()

void delay ( unsigned int msec )

Definition at line 804 of file timer.c.

◆ elapsed_str()

const char * elapsed_str ( DWORD val )

Return string "xx:xx" for time elapsed since started.

Handles max 24 days. Or max 49 days with user_tick_active.

Definition at line 729 of file timer.c.

References has_8254, has_rdtsc, and start_time.

◆ exit_timer_isr()

void exit_timer_isr ( void )

Definition at line 242 of file timer.c.

◆ get_cpu_speed()

uint64 get_cpu_speed ( void )

Return estimated CPU speed in Hz.

With multiple CPU cores, the QueryPerformanceFrequency() doesn't give the real CPU frequency. Then simply extract from the Registry.

Definition at line 839 of file timer.c.

◆ get_processor_freq()

static BOOL get_processor_freq ( uint64 * Hz )
static

Definition at line 912 of file timer.c.

◆ get_timediff()

long W32_CALL get_timediff | ( | DWORD | now,
 |  | DWORD | tim
 | ) |  |

Return time difference between timers now and tim.

Check for day rollover. Max timer distance is 24 hours. This function should be called immediately after chk_timeout() is called.

Definition at line 620 of file timer.c.

References has_8254.

◆ hires_timer()

int hires_timer ( int on )

Control use of high-resolution timer.

When using Watt-32 together with programs that reprogram the PIT (8254 timer chip), the millisec_clock() function may return wrong values. In such cases it's best to use old-style 55ms timers. Using Watt-32 with Allegro graphics library is one such case where application program should call ‘hires_timer(0)’ after sock_init() has been called.

Definition at line 377 of file timer.c.

References chk_timeout(), and has_8254.

◆ hms_str()

const char * hms_str ( DWORD sec )

Return string "HH:MM:SS" for a time in seconds.

Definition at line 715 of file timer.c.

◆ init_timer_isr()

void init_timer_isr ( void )

Definition at line 286 of file timer.c.

◆ init_timers()

void init_timers ( void )

Setup timer stuff and measure CPU speed.

Called from init_misc().

<

Todo:
check if 8254 PIT is really working

Definition at line 114 of file timer.c.

References chk_timeout(), clocks_per_usec, get_cpu_speed(), get_day_num(), has_rdtsc, hires_timer(), set_timeout(), set_utc_offset(), start_day, start_time, and use_rdtsc.

◆ init_userSuppliedTimerTick()

void W32_CALL init_userSuppliedTimerTick ( void )

init_userSuppliedTimerTick() - setup timer handling for programs that are already running a periodic interrupt or whatever (i.e.

ALLEGRO & more). This is called to signify that the 'user task' will periodically call userTimerTick() to supply the elapsed time since the last call. Best called once before sock_init(). There is no way to revert to original timer handling once this is called. By GvB 2002-09

Definition at line 169 of file timer.c.

References has_8254.

◆ millisec_clock()

DWORD millisec_clock ( void )

Return hardware time-of-day in milliseconds.

Resolution is improved beyond 55 ms (the clock tick interval) by reading back the instantaneous 8254 counter value and combining it with the clock tick counter.

Reading the 8254 is a bit tricky since a tick could occur asynchronously between the two reads in clockbits(). The tick counter is examined before and after the hardware counter is read. If the tick counter changes, try again.

Note
The hardware counter (lo) counts down from 65536 at a rate of 1.193181 MHz (4.77/4). System tick count (hi) counts up.

Definition at line 474 of file timer.c.

References clockbits().

◆ ms_clock()

DWORD ms_clock ( void )

Definition at line 785 of file timer.c.

◆ new_int_8()

static void new_int_8 ( void )
static

User defined 10 (or 55) milli-sec counter ISR.

Definition at line 208 of file timer.c.

References userTimerTick().

◆ set_timediff()

int W32_CALL set_timediff ( long msec )

Must be called by user right before or after a time change occurs.

Not used in Watt-32.

Definition at line 606 of file timer.c.

◆ set_timeout()

DWORD W32_CALL set_timeout ( DWORD msec )

Return time for when given timeout (msec) expires.

Make sure it never returns 0 (it will confuse chk_timeout()).

Definition at line 501 of file timer.c.

References has_8254, and millisec_clock().

◆ time_str()

const char * time_str ( DWORD val )

Return string x.xx for timeout value.

val is always in milli-sec units if we're using the 8254 PIT, RDTSC timestamps, timer ISR or user-supplied timer.

val is always in milli-sec units on Win32.

Definition at line 680 of file timer.c.

References has_8254, and has_rdtsc.

◆ timeval_diff()

double W32_CALL timeval_diff | ( | const struct timeval * | newer,
 |  | const struct timeval * | older
 | ) |  |

Return difference (in micro-sec) between timevals *newer and *older.

Definition at line 638 of file timer.c.

◆ timeval_diff2()

struct timeval W32_CALL timeval_diff2 | ( | struct timeval * | ta,
 |  | struct timeval * | tb
 | ) |  |

Definition at line 652 of file timer.c.

◆ userTimerTick()

void W32_CALL userTimerTick ( DWORD elapsed_time_msec )

Provide timer-ticks from an application.

This should be periodically called from user code to increment the timer count once activated via init_userSuppliedTimerTick(). Best called from a periodic interrupt handler (int 8/1Ch/70h) which is the case now with init_timer_isr().

by GvB 2002-09

Definition at line 198 of file timer.c.

◆ Wait_N_ticks()

static void Wait_N_ticks ( int num )
static

Definition at line 819 of file timer.c.

◆ win_get_perf_count()

uint64 win_get_perf_count ( void )

Definition at line 960 of file timer.c.

◆ win_get_rdtsc()

uint64 win_get_rdtsc ( void )

Definition at line 982 of file timer.c.

Variable Documentation

◆ clocks_per_usec

DWORD clocks_per_usec = 0L

Measured CPU speed (MHz)

Definition at line 64 of file timer.c.

◆ date

DWORD date = 0
static

Definition at line 70 of file timer.c.

◆ date_ms

DWORD date_ms = 0
static

Definition at line 71 of file timer.c.

◆ has_8254

BOOL has_8254 = FALSE

Do we have a working 8254 timer chip?

Definition at line 58 of file timer.c.

◆ has_rdtsc

BOOL has_rdtsc = TRUE

Never set in Watt-32.

Do we have a CPU with RDTSC instruction?

Some users may need it.

Definition at line 54 of file timer.c.

◆ int8_cback

REALPTR int8_cback
static

Definition at line 89 of file timer.c.

◆ itimer_resolution

DWORD itimer_resolution = 0UL
static

Definition at line 96 of file timer.c.

◆ num_cpus

unsigned num_cpus = 1

Definition at line 68 of file timer.c.

◆ old_int_8

static REALPTR old_int_8 = NULL
static

Definition at line 84 of file timer.c.

◆ old_itimer

struct itimerval old_itimer
static

Definition at line 98 of file timer.c.

◆ old_sigalrm

void(* old_sigalrm) (int) ( int )
static

Definition at line 97 of file timer.c.

◆ rmBlock_int8

RMC_BLK rmBlock_int8
static

Definition at line 91 of file timer.c.

◆ start_day

DWORD start_day = 0

Start-day of watt_sock_init()

Definition at line 47 of file timer.c.

◆ start_time

DWORD start_time = 0

Start-time of watt_sock_init() (in msec)

Definition at line 46 of file timer.c.

◆ tick_timer_8254

DWORD tick_timer_8254 = 0UL
static

Definition at line 102 of file timer.c.

◆ use_rdtsc

BOOL use_rdtsc = TRUE

Ditto.

Do not use RDTSC by default.

Definition at line 55 of file timer.c.

◆ user_tick_active

BOOL user_tick_active = FALSE

Definition at line 67 of file timer.c.

◆ user_tick_base

time_t user_tick_base = 0UL

Definition at line 65 of file timer.c.

◆ user_tick_msec

DWORD user_tick_msec = 0UL

Definition at line 66 of file timer.c.

◆ using_int8

BOOL using_int8 = FALSE

init_timer_isr() called

Definition at line 61 of file timer.c.


Watt-32 tcp/ip: E:/WATT/src/timer.h File Reference

  • src
Functions | Variables
timer.h File Reference

Go to the source code of this file.

Functions

uint64 | win_get_perf_count (void)
DWORD | clockbits (void)
The following 2 routines are modified versions from KA9Q NOS by Phil Karn.
int | hires_timer (int on)
Control use of high-resolution timer.
DWORD | ms_clock (void)
void | init_timer_isr (void)
void | exit_timer_isr (void)
void | init_timers (void)
Setup timer stuff and measure CPU speed.
DWORD | millisec_clock (void)
Return hardware time-of-day in milliseconds.
const char * | time_str (DWORD val)
Return string x.xx for timeout value.
const char * | hms_str (DWORD sec)
Return string "HH:MM:SS" for a time in seconds.
const char * | elapsed_str (DWORD val)
Return string "xx:xx" for time elapsed since started.
void | delay (unsigned int msec)
uint64 | get_cpu_speed (void)
Return estimated CPU speed in Hz.

Variables

W32_DATA BOOL | has_rdtsc
W32_DATA BOOL | use_rdtsc
BOOL | has_8254
Do we have a working 8254 timer chip?
BOOL | using_int8
W32_DATA BOOL | user_tick_active
W32_DATA DWORD | clocks_per_usec
W32_DATA DWORD | user_tick_msec
W32_DATA time_t | user_tick_base
W32_DATA DWORD | start_time
W32_DATA DWORD | start_day
W32_DATA unsigned | num_cpus

Function Documentation

◆ clockbits()

DWORD clockbits ( void )

The following 2 routines are modified versions from KA9Q NOS by Phil Karn.

clockbits() - Read low order bits of timer 0 (the TOD clock) This works only for the 8254 chips used in ATs and 386+.

Old version: The timer 0 runs in mode 3 (square wave mode), counting down by 2s, twice for each cycle. So it is necessary to read back the OUTPUT pin to see which half of the cycle we're in. I.e., the OUTPUT pin forms the most significant bit of the count. Unfortunately, the 8253 in the PC/XT lacks a command to read the OUTPUT pin...

Now simply: The timer 0 runs in mode 2 (rate generator), counting down. We don't compare the OUTPUT pin to see what cycle we're in. A bit lower precision, but a bit faster.

WARNING!: This can cause serious trouble if anything else is also using timer interrupts. In that case use the above userSuppliedTimerTick(). The reading of I/O registers gives bad precision under Windows.

Definition at line 409 of file timer.c.

◆ delay()

void delay ( unsigned int msec )

Definition at line 804 of file timer.c.

◆ elapsed_str()

const char * elapsed_str ( DWORD val )

Return string "xx:xx" for time elapsed since started.

Handles max 24 days. Or max 49 days with user_tick_active.

Definition at line 729 of file timer.c.

References has_8254, has_rdtsc, and start_time.

◆ exit_timer_isr()

void exit_timer_isr ( void )

Definition at line 242 of file timer.c.

◆ get_cpu_speed()

uint64 get_cpu_speed ( void )

Return estimated CPU speed in Hz.

With multiple CPU cores, the QueryPerformanceFrequency() doesn't give the real CPU frequency. Then simply extract from the Registry.

Definition at line 839 of file timer.c.

◆ hires_timer()

int hires_timer ( int on )

Control use of high-resolution timer.

When using Watt-32 together with programs that reprogram the PIT (8254 timer chip), the millisec_clock() function may return wrong values. In such cases it's best to use old-style 55ms timers. Using Watt-32 with Allegro graphics library is one such case where application program should call ‘hires_timer(0)’ after sock_init() has been called.

Definition at line 377 of file timer.c.

◆ hms_str()

const char * hms_str ( DWORD sec )

Return string "HH:MM:SS" for a time in seconds.

Definition at line 715 of file timer.c.

◆ init_timer_isr()

void init_timer_isr ( void )

Definition at line 286 of file timer.c.

◆ init_timers()

void init_timers ( void )

Setup timer stuff and measure CPU speed.

Called from init_misc().

<

Todo:
check if 8254 PIT is really working

Definition at line 114 of file timer.c.

References chk_timeout(), clocks_per_usec, get_cpu_speed(), get_day_num(), has_rdtsc, hires_timer(), set_timeout(), set_utc_offset(), start_day, start_time, and use_rdtsc.

◆ millisec_clock()

DWORD millisec_clock ( void )

Return hardware time-of-day in milliseconds.

Resolution is improved beyond 55 ms (the clock tick interval) by reading back the instantaneous 8254 counter value and combining it with the clock tick counter.

Reading the 8254 is a bit tricky since a tick could occur asynchronously between the two reads in clockbits(). The tick counter is examined before and after the hardware counter is read. If the tick counter changes, try again.

Note
The hardware counter (lo) counts down from 65536 at a rate of 1.193181 MHz (4.77/4). System tick count (hi) counts up.

Definition at line 474 of file timer.c.

References clockbits().

◆ ms_clock()

DWORD ms_clock ( void )

Definition at line 785 of file timer.c.

◆ time_str()

const char * time_str ( DWORD val )

Return string x.xx for timeout value.

val is always in milli-sec units if we're using the 8254 PIT, RDTSC timestamps, timer ISR or user-supplied timer.

val is always in milli-sec units on Win32.

Definition at line 680 of file timer.c.

References has_8254, and has_rdtsc.

◆ win_get_perf_count()

uint64 win_get_perf_count ( void )

Definition at line 960 of file timer.c.

Variable Documentation

◆ clocks_per_usec

W32_DATA DWORD clocks_per_usec

Definition at line 60 of file timer.h.

◆ has_8254

BOOL has_8254
extern

Do we have a working 8254 timer chip?

Definition at line 58 of file timer.c.

◆ has_rdtsc

BOOL has_rdtsc

Definition at line 32 of file timer.h.

◆ num_cpus

W32_DATA unsigned num_cpus

Definition at line 63 of file timer.h.

◆ start_day

W32_DATA DWORD start_day

Definition at line 62 of file timer.h.

◆ start_time

W32_DATA DWORD start_time

Definition at line 62 of file timer.h.

◆ use_rdtsc

BOOL use_rdtsc

Definition at line 32 of file timer.h.

◆ user_tick_active

W32_DATA BOOL user_tick_active

Definition at line 59 of file timer.h.

◆ user_tick_base

W32_DATA time_t user_tick_base

Definition at line 61 of file timer.h.

◆ user_tick_msec

W32_DATA DWORD user_tick_msec

Definition at line 60 of file timer.h.

◆ using_int8

BOOL using_int8

Definition at line 49 of file timer.h.


Watt-32 tcp/ip: E:/WATT/src/transmit.c File Reference

  • src
Functions
transmit.c File Reference

Go to the source code of this file.

Functions

static int | raw_transmit (Socket *socket, const void *buf, unsigned len)
static int | udp_transmit (Socket *socket, const void *buf, unsigned len)
static int | tcp_transmit (Socket *socket, const void *buf, unsigned len, int flags)
static int | setup_udp_raw (Socket *socket, const struct sockaddr *to, int tolen)
static int | transmit (const char *func, int s, const void *buf, unsigned len, int flags, const struct sockaddr *to, int tolen, BOOL have_remote_addr)
int W32_CALL | sendto (int s, const void *buf, int len, int flags, const struct sockaddr *to, socklen_t tolen)
int W32_CALL | send (int s, const void *buf, int len, int flags)
int W32_CALL | write_s (int s, const char *buf, int nbyte)
int W32_CALL | writev_s (int s, const struct iovec *vector, size_t count)
int W32_CALL | sendmsg (int s, const struct msghdr *msg, int flags)
static __inline void | msg_eor_close (Socket *socket)
static __inline BOOL | check_non_block_tx (Socket *socket, unsigned *len)
static int | ip4_transmit (Socket *socket, const void *tx, unsigned len)
Raw IPv4 transmitter.
static int | ip6_transmit (Socket *socket, const void *tx, unsigned len)
Raw IPv6 transmitter.

Detailed Description

BSD send(), sendto(), write().

Definition in file transmit.c.

Function Documentation

◆ check_non_block_tx()

static __inline BOOL check_non_block_tx | ( | Socket * | socket,
 |  | unsigned * | len
 | ) |  |
static

Definition at line 430 of file transmit.c.

◆ ip4_transmit()

static int ip4_transmit | ( | Socket * | socket,
 |  | const void * | tx,
 |  | unsigned | len
 | ) |  |
static

Raw IPv4 transmitter.

Note
'tx' is always non-NULL and 'len' is always > 0. Except for SOCK_DGRAM probe packets (tx=NULL and len==0).
Todo:
Handle sending fragments with IP optons

Definition at line 729 of file transmit.c.

References _arp_resolve(), _eth_formatpacket(), _eth_send(), _get_ip4_id(), and gethostid().

◆ ip6_transmit()

static int ip6_transmit | ( | Socket * | socket,
 |  | const void * | tx,
 |  | unsigned | len
 | ) |  |
static

Raw IPv6 transmitter.

Note
'tx' is always non-NULL and 'len' is always > 0. Except for SOCK_DGRAM probe packets (tx=NULL and len==0).
Todo:
support fragmentation

Definition at line 886 of file transmit.c.

References _default_ttl, _eth_formatpacket(), _eth_send(), _gethostid6(), _inet6_ntoa(), and icmp6_neigh_solic().

◆ msg_eor_close()

static __inline void msg_eor_close ( Socket * socket )
static

Definition at line 199 of file transmit.c.

◆ raw_transmit()

static int raw_transmit | ( | Socket * | socket,
 |  | const void * | buf,
 |  | unsigned | len
 | ) |  |
static

Definition at line 992 of file transmit.c.

◆ send()

int W32_CALL send | ( | int | s,
 |  | const void * | buf,
 |  | int | len,
 |  | int | flags
 | ) |  |

Definition at line 58 of file transmit.c.

◆ sendmsg()

int W32_CALL sendmsg | ( | int | s,
 |  | const struct msghdr * | msg,
 |  | int | flags
 | ) |  |

Definition at line 129 of file transmit.c.

◆ sendto()

int W32_CALL sendto | ( | int | s,
 |  | const void * | buf,
 |  | int | len,
 |  | int | flags,
 |  | const struct sockaddr * | to,
 |  | socklen_t | tolen
 | ) |  |

Definition at line 52 of file transmit.c.

◆ setup_udp_raw()

static int setup_udp_raw | ( | Socket * | socket,
 |  | const struct sockaddr * | to,
 |  | int | tolen
 | ) |  |
static

Definition at line 402 of file transmit.c.

◆ tcp_transmit()

static int tcp_transmit | ( | Socket * | socket,
 |  | const void * | buf,
 |  | unsigned | len,
 |  | int | flags
 | ) |  |
static
Todo:
Allow non-blocking sockets to send in SYNSENT state

Definition at line 471 of file transmit.c.

References _inet6_ntoa(), tcp_Socket::datatimer, tcp_Socket::max_tx_data, tcp_Socket::state, and tcp_Retransmitter().

◆ transmit()

static int transmit | ( | const char * | func,
 |  | int | s,
 |  | const void * | buf,
 |  | unsigned | len,
 |  | int | flags,
 |  | const struct sockaddr * | to,
 |  | int | tolen,
 |  | BOOL | have_remote_addr
 | ) |  |
static

Definition at line 228 of file transmit.c.

◆ udp_transmit()

static int udp_transmit | ( | Socket * | socket,
 |  | const void * | buf,
 |  | unsigned | len
 | ) |  |
static

Definition at line 589 of file transmit.c.

◆ write_s()

int W32_CALL write_s | ( | int | s,
 |  | const char * | buf,
 |  | int | nbyte
 | ) |  |

Definition at line 63 of file transmit.c.

◆ writev_s()

int W32_CALL writev_s | ( | int | s,
 |  | const struct iovec * | vector,
 |  | size_t | count
 | ) |  |

Definition at line 68 of file transmit.c.


Watt-32 tcp/ip: E:/WATT/src/tst.c Source File

  • src
tst.c
1/*
2 * Use 'clang-cl -c -Wall tst.c'
3 */
4#include <stdio.h>
5
6void foo (void) {}
7
8int main (void)
9{
10 return (0);
11}


Watt-32 tcp/ip: E:/WATT/src/UBSAN-issue.c Source File

  • src
UBSAN-issue.c
1/*
2 * Build with:
3 * clang-cl -c -nologo -Zi -Zo -GS- -I. -MD -Ox -fms-compatibility
4 * -fsanitize=address -fsanitize-recover=address -fsanitize=undefined \
5 * -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_OBSOLETE_NO_WARNINGS \
6 * -D_WIN32_WINNT=0x0601 UBSAN-issue.c
7 */
8
9#include <stdio.h>
10#include <stdlib.h>
11// #include <limits.h>
12// #include <string.h>
13// #include <ctype.h>
14
15// #include "wattcp.h"
16// #include "misc.h"
17// #include "misc_str.h"
18// #include "pcdbug.h"
19// #include "punycode.h"
20// #include "idna.h"
21
22typedef long ucs4_t;
23
24typedef struct {
25 int istate;
26 } *conv_t;
27
28#define ARGSUSED(x) (void)x
29#define RET_ILUNI -1
30
31#define _FLUSHWC_H /* normal_flushwc() not needed */
32
33#include "iconv/cp437.h"
conv_t
Definition: idna.h:8


Watt-32 tcp/ip: E:/WATT/src/udp_rev.c File Reference

  • src
Functions
udp_rev.c File Reference

Go to the source code of this file.

Functions

static BOOL | read_response (sock_type *s, char *name, size_t size)
static BYTE * | dns_labels (BYTE *bp, BYTE *p, BYTE *ep, char *result)
static BYTE * | dns_resource (WORD req_qtype, BYTE *bp, BYTE *p, BYTE *ep, char *result)
static size_t | query_init_ip4 (struct DNS_query *q, DWORD ip)
Fill in the reverse lookup question packet.
static BOOL | reverse_lookup (const struct DNS_query *q, size_t qlen, char *name, size_t size, DWORD nameserver)
Translate an IPv4/IPv6 address into a host name.
int | reverse_lookup_myip (void)
Do a reverse lookup on ‘my_ip_addr’.
static int | do_reverse_resolve (const struct DNS_query *q, size_t qlen, char *result, size_t size)
int | reverse_resolve_ip4 (DWORD ip, char *result, size_t size)
static size_t | query_init_ip6 (struct DNS_query *q, const void *addr)
Fill in the reverse lookup question packet.
int | reverse_resolve_ip6 (const void *addr, char *result, size_t size)

Detailed Description

Reverse DNS lookup

Definition in file udp_rev.c.

Function Documentation

◆ dns_labels()

static BYTE * dns_labels | ( | BYTE * | bp,
 |  | BYTE * | p,
 |  | BYTE * | ep,
 |  | char * | result
 | ) |  |
static

Definition at line 389 of file udp_rev.c.

◆ dns_resource()

static BYTE * dns_resource | ( | WORD | req_qtype,
 |  | BYTE * | bp,
 |  | BYTE * | p,
 |  | BYTE * | ep,
 |  | char * | result
 | ) |  |
static

Definition at line 429 of file udp_rev.c.

◆ do_reverse_resolve()

static int do_reverse_resolve | ( | const struct DNS_query * | q,
 |  | size_t | qlen,
 |  | char * | result,
 |  | size_t | size
 | ) |  |
static

Definition at line 195 of file udp_rev.c.

◆ query_init_ip4()

static size_t query_init_ip4 | ( | struct DNS_query * | q,
 |  | DWORD | ip
 | ) |  |
static

Fill in the reverse lookup question packet.

Return total length of request.

Definition at line 63 of file udp_rev.c.

References set_timeout().

◆ query_init_ip6()

static size_t query_init_ip6 | ( | struct DNS_query * | q,
 |  | const void * | addr
 | ) |  |
static

Fill in the reverse lookup question packet.

Return total length of request.

Todo:
Use "ip6.arpa" bitstring format ?

Definition at line 245 of file udp_rev.c.

References set_timeout().

◆ read_response()

static BOOL read_response | ( | sock_type * | s,
 |  | char * | name,
 |  | size_t | size
 | ) |  |
static

Definition at line 315 of file udp_rev.c.

◆ reverse_lookup()

static BOOL reverse_lookup | ( | const struct DNS_query * | q,
 |  | size_t | qlen,
 |  | char * | name,
 |  | size_t | size,
 |  | DWORD | nameserver
 | ) |  |
static

Translate an IPv4/IPv6 address into a host name.

Returns 1 on success, 0 on error or timeout.

Definition at line 100 of file udp_rev.c.

References _watt_cbroke, chk_timeout(), dom_strerror(), set_timeout(), sock_dataready(), and udp_open().

◆ reverse_lookup_myip()

int reverse_lookup_myip ( void )

Do a reverse lookup on ‘my_ip_addr’.

If successfull, replace ‘hostname’ and ‘def_domain’ with returned result.

Definition at line 176 of file udp_rev.c.

References my_ip_addr, and sethostname().

◆ reverse_resolve_ip4()

int reverse_resolve_ip4 | ( | DWORD | ip,
 |  | char * | result,
 |  | size_t | size
 | ) |  |

Definition at line 222 of file udp_rev.c.

◆ reverse_resolve_ip6()

int reverse_resolve_ip6 | ( | const void * | addr,
 |  | char * | result,
 |  | size_t | size
 | ) |  |

Definition at line 299 of file udp_rev.c.


Watt-32 tcp/ip: E:/WATT/src/version.c File Reference

  • src
Functions | Variables
version.c File Reference

Go to the source code of this file.

Functions

const char * | gcc_get_cpu_tune (void)
static const char * | msvc_check_fastcall (void)
static const char * | msvc_get_patch_build (void)
const char *W32_CALL | wattcpVersion (void)
Return string for Watt-32 version.
const char *W32_CALL | wattcpBuildCCexe (void)
Return the the name if the compiler used.
const char *W32_CALL | wattcpBuildCC (void)
Return the target/compiler.
const char *W32_CALL | wattcpBuildCflags (void)
const char *W32_CALL | wattcpCapabilities (void)
Return compiled-in capabilities and features.
_declspec (naked)

Variables

const char * | wattcpCopyright = "See COPYRIGHT.H for details"
char | w32_cflags2 []
Return the used.
static const char * | capabilities []

Detailed Description

Return Watt-32 version/capabilities strings.

Definition in file version.c.

Function Documentation

◆ _declspec()

_declspec ( naked )

Definition at line 878 of file version.c.

◆ gcc_get_cpu_tune()

const char * gcc_get_cpu_tune ( void )

Definition at line 778 of file version.c.

◆ msvc_check_fastcall()

static const char * msvc_check_fastcall ( void )
static

Definition at line 885 of file version.c.

◆ msvc_get_patch_build()

static const char * msvc_get_patch_build ( void )
static

Definition at line 906 of file version.c.

◆ wattcpBuildCC()

const char *W32_CALL wattcpBuildCC ( void )

Return the target/compiler.

E.g. "_MSC_VER" for MSVC.

Definition at line 556 of file version.c.

◆ wattcpBuildCCexe()

const char *W32_CALL wattcpBuildCCexe ( void )

Return the the name if the compiler used.

E.g. "cl" for MSVC.

Definition at line 543 of file version.c.

◆ wattcpBuildCflags()

const char *W32_CALL wattcpBuildCflags ( void )

Definition at line 587 of file version.c.

◆ wattcpCapabilities()

const char *W32_CALL wattcpCapabilities ( void )

Return compiled-in capabilities and features.

These features are set in "config.h" or in the generated "*.mak" file.

Definition at line 743 of file version.c.

◆ wattcpVersion()

const char *W32_CALL wattcpVersion ( void )

Return string for Watt-32 version.

Include this:

  • Name and version of compiler used to build Watt-32.
  • Target environment (if any).
  • Build date.

E.g. Watt-32 (2.2.11 Win32), GNU-C 4.5.3, CygWin 1.7.16, Aug 31 2012

Definition at line 77 of file version.c.

Variable Documentation

◆ capabilities

const char* capabilities[]
static

Definition at line 639 of file version.c.

◆ w32_cflags2

char w32_cflags2[]
Initial value:
= {
#include CFLAGS_BUF
0
}

Return the used.

Since the makefiles contains "-I..\inc" for some targets (except gcc), replace "-I.." with "-I../inc". ("\i" is interpreted as an ESC-sequence).

Also removes excessive spaces between args in using 'strtrim()'.

Definition at line 582 of file version.c.

◆ wattcpCopyright

const char* wattcpCopyright = "See COPYRIGHT.H for details"

Definition at line 39 of file version.c.


Watt-32 tcp/ip: E:/WATT/src/w32_ndis.h File Reference

  • src
Data Structures | Typedefs | Enumerations
w32_ndis.h File Reference

Go to the source code of this file.

Data Structures

struct | _NDIS_STATISTICS_VALUE
struct | _NET_PNP_ID
struct | _NET_PNP_TRANSLATE_LIST
struct | _NDIS_VAR_DATA_DESC
struct | _GEN_GET_TIME_CAPS
struct | _GEN_GET_NETCARD_TIME
struct | _NDIS_CO_LINK_SPEED
struct | _NDIS_IRDA_PACKET_INFO

Typedefs

typedef ULONG | NDIS_OID
typedef ULONG * | PNDIS_OID
typedef struct _NDIS_STATISTICS_VALUE | NDIS_STATISTICS_VALUE
typedef struct _NDIS_STATISTICS_VALUE * | PNDIS_STATISTICS_VALUE
typedef struct _NET_PNP_ID | NET_PNP_ID
typedef struct _NET_PNP_ID * | PNET_PNP_ID
typedef struct _NET_PNP_TRANSLATE_LIST | NET_PNP_TRANSLATE_LIST
typedef struct _NET_PNP_TRANSLATE_LIST * | PNET_PNP_TRANSLATE_LIST
typedef struct _NDIS_VAR_DATA_DESC | NDIS_VAR_DATA_DESC
typedef struct _NDIS_VAR_DATA_DESC * | PNDIS_VAR_DATA_DESC
typedef enum _NDIS_MEDIUM | NDIS_MEDIUM
typedef enum _NDIS_MEDIUM * | PNDIS_MEDIUM
typedef enum _NDIS_HARDWARE_STATUS | NDIS_HARDWARE_STATUS
typedef enum _NDIS_HARDWARE_STATUS * | PNDIS_HARDWARE_STATUS
typedef struct _GEN_GET_TIME_CAPS | GEN_GET_TIME_CAPS
typedef struct _GEN_GET_TIME_CAPS * | PGEN_GET_TIME_CAPS
typedef struct _GEN_GET_NETCARD_TIME | GEN_GET_NETCARD_TIME
typedef struct _GEN_GET_NETCARD_TIME * | PGEN_GET_NETCARD_TIME
typedef enum _NDIS_FDDI_ATTACHMENT_TYPE | NDIS_FDDI_ATTACHMENT_TYPE
typedef enum _NDIS_FDDI_ATTACHMENT_TYPE * | PNDIS_FDDI_ATTACHMENT_TYPE
typedef enum _NDIS_FDDI_RING_MGT_STATE | NDIS_FDDI_RING_MGT_STATE
typedef enum _NDIS_FDDI_RING_MGT_STATE * | PNDIS_FDDI_RING_MGT_STATE
typedef enum _NDIS_FDDI_LCONNECTION_STATE | NDIS_FDDI_LCONNECTION_STATE
typedef enum _NDIS_FDDI_LCONNECTION_STATE * | PNDIS_FDDI_LCONNECTION_STATE
typedef enum _NDIS_WAN_MEDIUM_SUBTYPE | NDIS_WAN_MEDIUM_SUBTYPE
typedef enum _NDIS_WAN_MEDIUM_SUBTYPE * | PNDIS_WAN_MEDIUM_SUBTYPE
typedef enum _NDIS_WAN_HEADER_FORMAT | NDIS_WAN_HEADER_FORMAT
typedef enum _NDIS_WAN_HEADER_FORMAT * | PNDIS_WAN_HEADER_FORMAT
typedef enum _NDIS_WAN_QUALITY | NDIS_WAN_QUALITY
typedef enum _NDIS_WAN_QUALITY * | PNDIS_WAN_QUALITY
typedef enum _NDIS_802_5_RING_STATE | NDIS_802_5_RING_STATE
typedef enum _NDIS_802_5_RING_STATE * | PNDIS_802_5_RING_STATE
typedef enum _NDIS_MEDIA_STATE | NDIS_MEDIA_STATE
typedef enum _NDIS_MEDIA_STATE * | PNDIS_MEDIA_STATE
typedef ULONG | Priority_802_3
typedef struct _NDIS_CO_LINK_SPEED | NDIS_CO_LINK_SPEED
typedef struct _NDIS_CO_LINK_SPEED * | PNDIS_CO_LINK_SPEED
typedef struct _NDIS_IRDA_PACKET_INFO | NDIS_IRDA_PACKET_INFO
typedef struct _NDIS_IRDA_PACKET_INFO * | PNDIS_IRDA_PACKET_INFO

Enumerations

enum _NDIS_MEDIUM {
NdisMedium802_3 ,
NdisMedium802_5 ,
NdisMediumFddi ,
NdisMediumWan ,
NdisMediumLocalTalk ,
NdisMediumDix ,
NdisMediumArcnetRaw ,
NdisMediumArcnet878_2 ,
NdisMediumAtm ,
NdisMediumWirelessWan ,
NdisMediumIrda ,
NdisMediumBpc ,
NdisMediumCoWan ,
NdisMedium1394 ,
NdisMediumInfiniBand ,
NdisMediumTunnel ,
NdisMediumNative802_11 ,
NdisMediumLoopback ,
NdisMediumWiMAX ,
NdisMediumIP ,
NdisMediumCHDLC ,
NdisMediumPPPSerial ,
NdisMediumMax
}
enum _NDIS_HARDWARE_STATUS {
NdisHardwareStatusReady ,
NdisHardwareStatusInitializing ,
NdisHardwareStatusReset ,
NdisHardwareStatusClosing ,
NdisHardwareStatusNotReady
}
enum _NDIS_FDDI_ATTACHMENT_TYPE {
NdisFddiTypeIsolated = 1 ,
NdisFddiTypeLocalA ,
NdisFddiTypeLocalB ,
NdisFddiTypeLocalAB ,
NdisFddiTypeLocalS ,
NdisFddiTypeWrapA ,
NdisFddiTypeWrapB ,
NdisFddiTypeWrapAB ,
NdisFddiTypeWrapS ,
NdisFddiTypeCWrapA ,
NdisFddiTypeCWrapB ,
NdisFddiTypeCWrapS ,
NdisFddiTypeThrough
}
enum _NDIS_FDDI_RING_MGT_STATE {
NdisFddiRingIsolated = 1 ,
NdisFddiRingNonOperational ,
NdisFddiRingOperational ,
NdisFddiRingDetect ,
NdisFddiRingNonOperationalDup ,
NdisFddiRingOperationalDup ,
NdisFddiRingDirected ,
NdisFddiRingTrace
}
enum _NDIS_FDDI_LCONNECTION_STATE {
NdisFddiStateOff = 1 ,
NdisFddiStateBreak ,
NdisFddiStateTrace ,
NdisFddiStateConnect ,
NdisFddiStateNext ,
NdisFddiStateSignal ,
NdisFddiStateJoin ,
NdisFddiStateVerify ,
NdisFddiStateActive ,
NdisFddiStateMaintenance
}
enum _NDIS_WAN_MEDIUM_SUBTYPE {
NdisWanMediumHub ,
NdisWanMediumX_25 ,
NdisWanMediumIsdn ,
NdisWanMediumSerial ,
NdisWanMediumFrameRelay ,
NdisWanMediumAtm ,
NdisWanMediumSonet ,
NdisWanMediumSW56K
}
enum _NDIS_WAN_HEADER_FORMAT {
NdisWanHeaderNative ,
NdisWanHeaderEthernet
}
enum _NDIS_WAN_QUALITY {
NdisWanRaw ,
NdisWanErrorControl ,
NdisWanReliable
}
enum _NDIS_802_5_RING_STATE {
NdisRingStateOpened = 1 ,
NdisRingStateClosed ,
NdisRingStateOpening ,
NdisRingStateClosing ,
NdisRingStateOpenFailure ,
NdisRingStateRingFailure
}
enum _NDIS_MEDIA_STATE {
NdisMediaStateConnected ,
NdisMediaStateDisconnected
}

Detailed Description

Previously named ntddndis.h. But that caused problems when '-I.' is part of CFLAGS (caused this file to shaddow the system <ntddndis.h>).

++ BUILD Version: 0001 Copyright (c) 1990-1993 Microsoft Corporation Module Name: ntddndis.h Abstract: This is the include file that defines all constants and types for accessing the Network driver interface device. Author: Steve Wood (stevewo) 27-May-1990 Revision History: Adam Barr (adamba) 04-Nov-1992 added the correct values for NDIS 3.0. Jameel Hyder (jameelh) 01-Aug-95 added Pnp IoCTLs and structures

Kyle Brandon (kyleb) 09/24/96 added general co ndis oids.

Some OIDs also taken from WireShark.

Definition in file w32_ndis.h.

Typedef Documentation

◆ NDIS_OID

typedef ULONG NDIS_OID

Definition at line 61 of file w32_ndis.h.

◆ PNDIS_OID

typedef ULONG * PNDIS_OID

Definition at line 61 of file w32_ndis.h.

◆ Priority_802_3

typedef ULONG Priority_802_3

Definition at line 852 of file w32_ndis.h.

Enumeration Type Documentation

◆ _NDIS_802_5_RING_STATE

enum _NDIS_802_5_RING_STATE

Definition at line 832 of file w32_ndis.h.

◆ _NDIS_FDDI_ATTACHMENT_TYPE

enum _NDIS_FDDI_ATTACHMENT_TYPE

Definition at line 752 of file w32_ndis.h.

◆ _NDIS_FDDI_LCONNECTION_STATE

enum _NDIS_FDDI_LCONNECTION_STATE

Definition at line 785 of file w32_ndis.h.

◆ _NDIS_FDDI_RING_MGT_STATE

enum _NDIS_FDDI_RING_MGT_STATE

Definition at line 771 of file w32_ndis.h.

◆ _NDIS_HARDWARE_STATUS

enum _NDIS_HARDWARE_STATUS

Definition at line 719 of file w32_ndis.h.

◆ _NDIS_MEDIA_STATE

enum _NDIS_MEDIA_STATE

Definition at line 844 of file w32_ndis.h.

◆ _NDIS_MEDIUM

enum _NDIS_MEDIUM

Definition at line 690 of file w32_ndis.h.

◆ _NDIS_WAN_HEADER_FORMAT

enum _NDIS_WAN_HEADER_FORMAT

Definition at line 815 of file w32_ndis.h.

◆ _NDIS_WAN_MEDIUM_SUBTYPE

enum _NDIS_WAN_MEDIUM_SUBTYPE

Definition at line 801 of file w32_ndis.h.

◆ _NDIS_WAN_QUALITY

enum _NDIS_WAN_QUALITY

Definition at line 823 of file w32_ndis.h.


Watt-32 tcp/ip: E:/WATT/src/wattcp.c File Reference

  • src
Functions
wattcp.c File Reference

Go to the source code of this file.

Functions

DWORD DllEntryPoint (void *hDll, DWORD reason, void *reserved)

Detailed Description

DLL entry-point for HighC.

Definition in file wattcp.c.

Function Documentation

◆ DllEntryPoint()

DWORD DllEntryPoint | ( | void * | hDll,
 |  | DWORD | reason,
 |  | void * | reserved
 | ) |  |

Definition at line 27 of file wattcp.c.


Watt-32 tcp/ip: E:/WATT/src/wattcp.h File Reference

  • src
Data Structures | Typedefs | Functions | Variables
wattcp.h File Reference

Core definitions. More...

Go to the source code of this file.

Data Structures

struct | ulong_long
struct | in6_Header
struct | ip_Packet
struct | udp_Header
struct | tcp_Header
struct | tcp_PseudoHeader
struct | tcp_PseudoHeader6
struct | arp_Header
struct | tcp_Socket
struct | _raw_Socket
struct | _raw6_Socket
union | sock_type

Typedefs

typedef unsigned long long | uint64
our unsigned "long long" type
typedef long long | int64
our signed "long long" type
typedef struct in6_Header | in6_Header
typedef struct ip_Packet | ip_Packet
typedef struct udp_Header | udp_Header
typedef struct tcp_Header | tcp_Header
typedef struct tcp_PseudoHeader | tcp_PseudoHeader
typedef struct tcp_PseudoHeader6 | tcp_PseudoHeader6
typedef struct arp_Header | arp_Header
typedef struct tcp_Socket | _tcp_Socket
typedef struct _raw_Socket | _raw_Socket
typedef struct _raw6_Socket | _raw6_Socket
typedef union sock_type | sock_type

Functions

int | _tcp_fsm (_tcp_Socket **s, const in_Header *ip)
const char * | i486model (unsigned int nr)
const char * | i586model (unsigned int nr)
const char * | Cx86model (void)
const char * | i686model (unsigned int nr)
const char * | AMDmodel (void)

Variables

in_Header
_udp_Socket

Detailed Description

Core definitions.

Types and structures for protocols are defined here.

Problems: - MinGW-w64 defines both WIN32 and WIN64, but _WIN64 is defined only if actually targeting WIN64.

  • MSVC + PellesC defines only _WIN32 for targeting 32-bit Windows.
  • MSVC + PellesC defines _WIN32+_WIN64 for targeting 64-bit Windows.
  • CygWin's gcc defines none of the above. But it supports native Win64 if 'x86_64' is set. (needs 'CygWin64').

Definition in file wattcp.h.

Typedef Documentation

◆ int64

typedef __int64 int64

our signed "long long" type

Definition at line 66 of file wattcp.h.

◆ sock_type

sock_type

sock_type used for socket I/O.

◆ uint64

typedef unsigned __int64 uint64

our unsigned "long long" type

Definition at line 65 of file wattcp.h.

Function Documentation

◆ _tcp_fsm()

int _tcp_fsm | ( | _tcp_Socket ** | s,
 |  | const in_Header * | ip
 | ) |  |

Definition at line 99 of file tcp_fsm.c.

Variable Documentation

◆ _udp_Socket

_udp_Socket

Definition at line 576 of file wattcp.h.

◆ in_Header

in_Header

Definition at line 352 of file wattcp.h.


Watt-32 tcp/ip: E:/WATT/src/wdpmi.c File Reference

  • src
Functions | Variables
wdpmi.c File Reference

Go to the source code of this file.

Functions

void cdecl | cstart_ (void)
static void far __loadds | exception_main (void)
static BOOL | is_wdosx_or_pmodew (DWORD sign)
BOOL | dpmi_is_wdosx (void)
BOOL | dpmi_is_pmodew (void)
BOOL | dpmi_is_dos32a (void)
BOOL | dpmi_is_dos4gw (void)
BOOL | dpmi_is_causeway (void)
BOOL | dpmi_is_hxdos (void)
const char * | dos4gw_extender_name (void)
int | dpmi_except_handler (exceptionHook exc_func)
void * | dpmi_get_real_vector (int intr)
int | dpmi_get_base_address (WORD sel, DWORD *base)
WORD | dpmi_real_malloc (WORD size, WORD *selector)
int | dpmi_real_free (WORD selector)
int | dpmi_lock_region (void *address, unsigned length)
int | dpmi_unlock_region (void *address, unsigned length)
int | dpmi_real_interrupt (int intr, IREGS *reg)
int | dpmi_real_call_retf (IREGS *reg)
static int | real_interrupt (int intr, IREGS *reg)
int | int386 (int intno, union REGS *ireg, union REGS *oreg)
int | int386x (int intno, union REGS *ireg, union REGS *oreg, struct SREGS *sreg)
void | segread (struct SREGS *sreg)
void | SS_TO_DGROUP (void)
void | RESTORE_SS_AND_GO (void)
void | stack_rewind (DWORD start, DWORD base)
BOOL | dpmi_init (void)

Variables

char | _Extender
char | _ExtenderSubtype
WORD | __dpmi_errno = 0
WORD | causeway_ver = 0
BOOL | dos32a_nullptr_chk = 0
static struct FAULT_STRUC | exc_struct
static exceptionHook | user_exc_hook = NULL
int | _STACKTOP
static DWORD | exc_app_start = 4096UL

Detailed Description

DPMI interface for Watcom-type targets.

DOS-extender/DPMI interface for DOS4GW Pro, DOS4G, DOS32A, Pmode/W, CauseWay, EDOS, HXDOS, WDOSX and Borland's POWERPAK (32rtm). Possibly usable with gcc and WDOSX also.

From udplib 1.111 by John Snagel jslag.nosp@m.el@v.nosp@m.oliti.nosp@m.on-i.nosp@m.nc.co.nosp@m.m and Freek Brysse frbry.nosp@m.sse@.nosp@m.vub.a.nosp@m.c.be

11 november, 1997 Ref. http://igweb.vub.ac.be/knights/udplib.html

Heavily changed by G. Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o August 1998

Definition in file wdpmi.c.

Function Documentation

◆ dos4gw_extender_name()

const char * dos4gw_extender_name ( void )

Definition at line 252 of file wdpmi.c.

◆ dpmi_except_handler()

int dpmi_except_handler ( exceptionHook exc_func )

Definition at line 279 of file wdpmi.c.

◆ dpmi_get_base_address()

int dpmi_get_base_address | ( | WORD | sel,
 |  | DWORD * | base
 | ) |  |

Definition at line 333 of file wdpmi.c.

◆ dpmi_get_real_vector()

void * dpmi_get_real_vector ( int intr )

Definition at line 322 of file wdpmi.c.

◆ dpmi_init()

BOOL dpmi_init ( void )

Definition at line 700 of file wdpmi.c.

◆ dpmi_is_causeway()

BOOL dpmi_is_causeway ( void )

Definition at line 184 of file wdpmi.c.

◆ dpmi_is_dos32a()

BOOL dpmi_is_dos32a ( void )

Definition at line 148 of file wdpmi.c.

◆ dpmi_is_dos4gw()

BOOL dpmi_is_dos4gw ( void )

Definition at line 168 of file wdpmi.c.

◆ dpmi_is_hxdos()

BOOL dpmi_is_hxdos ( void )

Definition at line 232 of file wdpmi.c.

◆ dpmi_is_pmodew()

BOOL dpmi_is_pmodew ( void )

Definition at line 143 of file wdpmi.c.

◆ dpmi_is_wdosx()

BOOL dpmi_is_wdosx ( void )

Definition at line 138 of file wdpmi.c.

◆ dpmi_lock_region()

int dpmi_lock_region | ( | void * | address,
 |  | unsigned | length
 | ) |  |

Definition at line 383 of file wdpmi.c.

◆ dpmi_real_call_retf()

int dpmi_real_call_retf ( IREGS * reg )

Definition at line 461 of file wdpmi.c.

◆ dpmi_real_free()

int dpmi_real_free ( WORD selector )

Definition at line 367 of file wdpmi.c.

◆ dpmi_real_interrupt()

int dpmi_real_interrupt | ( | int | intr,
 |  | IREGS * | reg
 | ) |  |

Definition at line 434 of file wdpmi.c.

◆ dpmi_real_malloc()

WORD dpmi_real_malloc | ( | WORD | size,
 |  | WORD * | selector
 | ) |  |

Definition at line 350 of file wdpmi.c.

◆ dpmi_unlock_region()

int dpmi_unlock_region | ( | void * | address,
 |  | unsigned | length
 | ) |  |

Definition at line 408 of file wdpmi.c.

◆ exception_main()

static void far __loadds exception_main ( void )
static

Definition at line 617 of file wdpmi.c.

◆ int386()

int int386 | ( | int | intno,
 |  | union REGS * | ireg,
 |  | union REGS * | oreg
 | ) |  |

Definition at line 514 of file wdpmi.c.

◆ int386x()

int int386x | ( | int | intno,
 |  | union REGS * | ireg,
 |  | union REGS * | oreg,
 |  | struct SREGS * | sreg
 | ) |  |

Definition at line 522 of file wdpmi.c.

◆ is_wdosx_or_pmodew()

static BOOL is_wdosx_or_pmodew ( DWORD sign )
static

Definition at line 124 of file wdpmi.c.

◆ real_interrupt()

static int real_interrupt | ( | int | intr,
 |  | IREGS * | reg
 | ) |  |
static

Definition at line 492 of file wdpmi.c.

◆ segread()

void segread ( struct SREGS * sreg )

Definition at line 553 of file wdpmi.c.

◆ stack_rewind()

void stack_rewind | ( | DWORD | start,
 |  | DWORD | base
 | ) |  |

Definition at line 642 of file wdpmi.c.

Variable Documentation

◆ __dpmi_errno

WORD __dpmi_errno = 0

Definition at line 102 of file wdpmi.c.

◆ causeway_ver

WORD causeway_ver = 0

Definition at line 106 of file wdpmi.c.

◆ dos32a_nullptr_chk

BOOL dos32a_nullptr_chk = 0

Definition at line 107 of file wdpmi.c.

◆ exc_app_start

DWORD exc_app_start = 4096UL
static
Todo:
find the real application start

Definition at line 634 of file wdpmi.c.

◆ exc_struct

struct FAULT_STRUC exc_struct
static

Definition at line 114 of file wdpmi.c.

◆ user_exc_hook

exceptionHook user_exc_hook = NULL
static

Definition at line 115 of file wdpmi.c.


Watt-32 tcp/ip: E:/WATT/src/wdpmi.h File Reference

  • src
Data Structures | Typedefs | Functions | Variables
wdpmi.h File Reference

Go to the source code of this file.

Data Structures

struct FAULT_STRUC

Typedefs

typedef void(* exceptionHook) (const struct FAULT_STRUC *)

Functions

BOOL | dpmi_init (void)
WORD | dpmi_real_malloc (WORD size, WORD *sel)
int | dpmi_real_free (WORD selector)
int | dpmi_get_base_address (WORD sel, DWORD *base)
int | dpmi_lock_region (void *address, unsigned length)
int | dpmi_unlock_region (void *address, unsigned length)
void * | dpmi_get_real_vector (int intr)
int | dpmi_real_interrupt (int intr, IREGS *reg)
int | dpmi_real_call_retf (IREGS *reg)
BOOL | dpmi_is_wdosx (void)
BOOL | dpmi_is_pmodew (void)
BOOL | dpmi_is_dos32a (void)
BOOL | dpmi_is_dos4gw (void)
BOOL | dpmi_is_causeway (void)
BOOL | dpmi_is_hxdos (void)
int | dpmi_except_handler (exceptionHook exc_func)
const char * | dos4gw_extender_name (void)
void | stack_rewind (DWORD start, DWORD base)

Variables

WORD __dpmi_errno

Typedef Documentation

◆ exceptionHook

typedef void(* exceptionHook) (const struct FAULT_STRUC *)

Definition at line 59 of file wdpmi.h.

Function Documentation

◆ dos4gw_extender_name()

const char * dos4gw_extender_name ( void )

Definition at line 252 of file wdpmi.c.

◆ dpmi_except_handler()

int dpmi_except_handler ( exceptionHook exc_func )

Definition at line 279 of file wdpmi.c.

◆ dpmi_get_base_address()

int dpmi_get_base_address | ( | WORD | sel,
 |  | DWORD * | base
 | ) |  |

Definition at line 333 of file wdpmi.c.

◆ dpmi_get_real_vector()

void * dpmi_get_real_vector ( int intr )

Definition at line 322 of file wdpmi.c.

◆ dpmi_init()

BOOL dpmi_init ( void )

Definition at line 700 of file wdpmi.c.

◆ dpmi_is_causeway()

BOOL dpmi_is_causeway ( void )

Definition at line 184 of file wdpmi.c.

◆ dpmi_is_dos32a()

BOOL dpmi_is_dos32a ( void )

Definition at line 148 of file wdpmi.c.

◆ dpmi_is_dos4gw()

BOOL dpmi_is_dos4gw ( void )

Definition at line 168 of file wdpmi.c.

◆ dpmi_is_hxdos()

BOOL dpmi_is_hxdos ( void )

Definition at line 232 of file wdpmi.c.

◆ dpmi_is_pmodew()

BOOL dpmi_is_pmodew ( void )

Definition at line 143 of file wdpmi.c.

◆ dpmi_is_wdosx()

BOOL dpmi_is_wdosx ( void )

Definition at line 138 of file wdpmi.c.

◆ dpmi_lock_region()

int dpmi_lock_region | ( | void * | address,
 |  | unsigned | length
 | ) |  |

Definition at line 383 of file wdpmi.c.

◆ dpmi_real_call_retf()

int dpmi_real_call_retf ( IREGS * reg )

Definition at line 461 of file wdpmi.c.

◆ dpmi_real_free()

int dpmi_real_free ( WORD selector )

Definition at line 367 of file wdpmi.c.

◆ dpmi_real_interrupt()

int dpmi_real_interrupt | ( | int | intr,
 |  | IREGS * | reg
 | ) |  |

Definition at line 434 of file wdpmi.c.

◆ dpmi_real_malloc()

WORD dpmi_real_malloc | ( | WORD | size,
 |  | WORD * | sel
 | ) |  |

Definition at line 350 of file wdpmi.c.

◆ dpmi_unlock_region()

int dpmi_unlock_region | ( | void * | address,
 |  | unsigned | length
 | ) |  |

Definition at line 408 of file wdpmi.c.

◆ stack_rewind()

void stack_rewind | ( | DWORD | start,
 |  | DWORD | base
 | ) |  |

Definition at line 642 of file wdpmi.c.

Variable Documentation

◆ __dpmi_errno

WORD __dpmi_errno
extern

Definition at line 102 of file wdpmi.c.


Watt-32 tcp/ip: E:/WATT/src/win_dll.c File Reference

  • src
Functions | Variables
win_dll.c File Reference

Go to the source code of this file.

Functions

int | load_dynamic_table (struct LoadTable *tab, int tab_size)
int | unload_dynamic_table (struct LoadTable *tab, int tab_size)

Variables

func_GetComputerNameExA | p_GetComputerNameExA
func_GetFileVersionInfoSizeA | p_GetFileVersionInfoSizeA
func_GetFileVersionInfoA | p_GetFileVersionInfoA
func_GetFileVersionInfoExA | p_GetFileVersionInfoExA
func_VerQueryValueA | p_VerQueryValueA
func_QueryThreadCycleTime | p_QueryThreadCycleTime
func_RtlGetVersion | p_RtlGetVersion
func_NtQueryInformationThread | p_NtQueryInformationThread
func_NtQuerySystemInformation | p_NtQuerySystemInformation
func_IsWow64Process | p_IsWow64Process
func_GetThreadInformation | p_GetThreadInformation
func_GetSystemTimePreciseAsFileTime | p_GetSystemTimePreciseAsFileTime
func_WanPacketSetBpfFilter | p_WanPacketSetBpfFilter = NULL
func_WanPacketOpenAdapter | p_WanPacketOpenAdapter = NULL
func_WanPacketCloseAdapter | p_WanPacketCloseAdapter = NULL
func_WanPacketSetBufferSize | p_WanPacketSetBufferSize = NULL
func_WanPacketReceivePacket | p_WanPacketReceivePacket = NULL
func_WanPacketSetMinToCopy | p_WanPacketSetMinToCopy = NULL
func_WanPacketGetStats | p_WanPacketGetStats = NULL
func_WanPacketSetReadTimeout | p_WanPacketSetReadTimeout = NULL
func_WanPacketSetMode | p_WanPacketSetMode = NULL
func_WanPacketGetReadEvent | p_WanPacketGetReadEvent = NULL
func_WanPacketTestAdapter | p_WanPacketTestAdapter = NULL
func_DnsFree | p_DnsFree = NULL
func_DnsQuery_A | p_DnsQuery_A = NULL
func_DnsModifyRecordsInSet_A | p_DnsModifyRecordsInSet_A = NULL
func_BT_InstallSehFilter | p_BT_InstallSehFilter = NULL
func_BT_SetPreErrHandler | p_BT_SetPreErrHandler = NULL
func_BT_SetAppVersion | p_BT_SetAppVersion = NULL
func_BT_SetAppName | p_BT_SetAppName = NULL
func_BT_SetReportFormat | p_BT_SetReportFormat = NULL
func_BT_SetSupportEMail | p_BT_SetSupportEMail = NULL
func_BT_SetFlags | p_BT_SetFlags = NULL
func_BT_SetLogSizeInEntries | p_BT_SetLogSizeInEntries = NULL
func_BT_SetLogFlags | p_BT_SetLogFlags = NULL
func_BT_SetLogEchoMode | p_BT_SetLogEchoMode = NULL
func_BT_InsLogEntryF | p_BT_InsLogEntryF = NULL
func_BT_OpenLogFile | p_BT_OpenLogFile = NULL
func_BT_CloseLogFile | p_BT_CloseLogFile = NULL
func_BT_AddLogFile | p_BT_AddLogFile = NULL
struct LoadTable | dyn_funcs []
size_t | dyn_funcs_num = DIM (dyn_funcs)

Detailed Description

Dynamic loading of Windows functions at runtime.

Copyright (c) 2004 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file win_dll.c.

Function Documentation

◆ load_dynamic_table()

int load_dynamic_table | ( | struct LoadTable * | tab,
 |  | int | tab_size
 | ) |  |

Definition at line 152 of file win_dll.c.

◆ unload_dynamic_table()

int unload_dynamic_table | ( | struct LoadTable * | tab,
 |  | int | tab_size
 | ) |  |

Definition at line 185 of file win_dll.c.

Variable Documentation

◆ dyn_funcs

struct LoadTable dyn_funcs[]

Definition at line 100 of file win_dll.c.

◆ dyn_funcs_num

size_t dyn_funcs_num = DIM (dyn_funcs)

Definition at line 147 of file win_dll.c.

◆ p_BT_AddLogFile

func_BT_AddLogFile p_BT_AddLogFile = NULL

Definition at line 92 of file win_dll.c.

◆ p_BT_CloseLogFile

func_BT_CloseLogFile p_BT_CloseLogFile = NULL

Definition at line 91 of file win_dll.c.

◆ p_BT_InsLogEntryF

func_BT_InsLogEntryF p_BT_InsLogEntryF = NULL

Definition at line 89 of file win_dll.c.

◆ p_BT_InstallSehFilter

func_BT_InstallSehFilter p_BT_InstallSehFilter = NULL

Definition at line 79 of file win_dll.c.

◆ p_BT_OpenLogFile

func_BT_OpenLogFile p_BT_OpenLogFile = NULL

Definition at line 90 of file win_dll.c.

◆ p_BT_SetAppName

func_BT_SetAppName p_BT_SetAppName = NULL

Definition at line 82 of file win_dll.c.

◆ p_BT_SetAppVersion

func_BT_SetAppVersion p_BT_SetAppVersion = NULL

Definition at line 81 of file win_dll.c.

◆ p_BT_SetFlags

func_BT_SetFlags p_BT_SetFlags = NULL

Definition at line 85 of file win_dll.c.

◆ p_BT_SetLogEchoMode

func_BT_SetLogEchoMode p_BT_SetLogEchoMode = NULL

Definition at line 88 of file win_dll.c.

◆ p_BT_SetLogFlags

func_BT_SetLogFlags p_BT_SetLogFlags = NULL

Definition at line 87 of file win_dll.c.

◆ p_BT_SetLogSizeInEntries

func_BT_SetLogSizeInEntries p_BT_SetLogSizeInEntries = NULL

Definition at line 86 of file win_dll.c.

◆ p_BT_SetPreErrHandler

func_BT_SetPreErrHandler p_BT_SetPreErrHandler = NULL

Definition at line 80 of file win_dll.c.

◆ p_BT_SetReportFormat

func_BT_SetReportFormat p_BT_SetReportFormat = NULL

Definition at line 83 of file win_dll.c.

◆ p_BT_SetSupportEMail

func_BT_SetSupportEMail p_BT_SetSupportEMail = NULL

Definition at line 84 of file win_dll.c.

◆ p_DnsFree

func_DnsFree p_DnsFree = NULL

Definition at line 73 of file win_dll.c.

◆ p_DnsModifyRecordsInSet_A

func_DnsModifyRecordsInSet_A p_DnsModifyRecordsInSet_A = NULL

Definition at line 75 of file win_dll.c.

◆ p_DnsQuery_A

func_DnsQuery_A p_DnsQuery_A = NULL

Definition at line 74 of file win_dll.c.

◆ p_GetComputerNameExA

func_GetComputerNameExA p_GetComputerNameExA

Definition at line 44 of file win_dll.c.

◆ p_GetFileVersionInfoA

func_GetFileVersionInfoA p_GetFileVersionInfoA

Definition at line 46 of file win_dll.c.

◆ p_GetFileVersionInfoExA

func_GetFileVersionInfoExA p_GetFileVersionInfoExA

Definition at line 47 of file win_dll.c.

◆ p_GetFileVersionInfoSizeA

func_GetFileVersionInfoSizeA p_GetFileVersionInfoSizeA

Definition at line 45 of file win_dll.c.

◆ p_GetSystemTimePreciseAsFileTime

func_GetSystemTimePreciseAsFileTime p_GetSystemTimePreciseAsFileTime

Definition at line 55 of file win_dll.c.

◆ p_GetThreadInformation

func_GetThreadInformation p_GetThreadInformation

Definition at line 54 of file win_dll.c.

◆ p_IsWow64Process

func_IsWow64Process p_IsWow64Process

Definition at line 53 of file win_dll.c.

◆ p_NtQueryInformationThread

func_NtQueryInformationThread p_NtQueryInformationThread

Definition at line 51 of file win_dll.c.

◆ p_NtQuerySystemInformation

func_NtQuerySystemInformation p_NtQuerySystemInformation

Definition at line 52 of file win_dll.c.

◆ p_QueryThreadCycleTime

func_QueryThreadCycleTime p_QueryThreadCycleTime

Definition at line 49 of file win_dll.c.

◆ p_RtlGetVersion

func_RtlGetVersion p_RtlGetVersion

Definition at line 50 of file win_dll.c.

◆ p_VerQueryValueA

func_VerQueryValueA p_VerQueryValueA

Definition at line 48 of file win_dll.c.

◆ p_WanPacketCloseAdapter

func_WanPacketCloseAdapter p_WanPacketCloseAdapter = NULL

Definition at line 62 of file win_dll.c.

◆ p_WanPacketGetReadEvent

func_WanPacketGetReadEvent p_WanPacketGetReadEvent = NULL

Definition at line 69 of file win_dll.c.

◆ p_WanPacketGetStats

func_WanPacketGetStats p_WanPacketGetStats = NULL

Definition at line 66 of file win_dll.c.

◆ p_WanPacketOpenAdapter

func_WanPacketOpenAdapter p_WanPacketOpenAdapter = NULL

Definition at line 61 of file win_dll.c.

◆ p_WanPacketReceivePacket

func_WanPacketReceivePacket p_WanPacketReceivePacket = NULL

Definition at line 64 of file win_dll.c.

◆ p_WanPacketSetBpfFilter

func_WanPacketSetBpfFilter p_WanPacketSetBpfFilter = NULL

Definition at line 60 of file win_dll.c.

◆ p_WanPacketSetBufferSize

func_WanPacketSetBufferSize p_WanPacketSetBufferSize = NULL

Definition at line 63 of file win_dll.c.

◆ p_WanPacketSetMinToCopy

func_WanPacketSetMinToCopy p_WanPacketSetMinToCopy = NULL

Definition at line 65 of file win_dll.c.

◆ p_WanPacketSetMode

func_WanPacketSetMode p_WanPacketSetMode = NULL

Definition at line 68 of file win_dll.c.

◆ p_WanPacketSetReadTimeout

func_WanPacketSetReadTimeout p_WanPacketSetReadTimeout = NULL

Definition at line 67 of file win_dll.c.

◆ p_WanPacketTestAdapter

func_WanPacketTestAdapter p_WanPacketTestAdapter = NULL

Definition at line 70 of file win_dll.c.


Watt-32 tcp/ip: E:/WATT/src/win_dll.h File Reference

  • src
Data Structures | Typedefs | Enumerations | Functions | Variables
win_dll.h File Reference

Go to the source code of this file.

Data Structures

struct LoadTable

Typedefs

typedef LONG | NTSTATUS
typedef enum _THREADINFOCLASS | THREADINFOCLASS
typedef BOOL(WINAPI * | func_QueryThreadCycleTime) (IN HANDLE thread_handle, OUT ULONG64 *cycle_time)
typedef NTSTATUS(WINAPI * | func_NtQueryInformationThread) (IN HANDLE thread_handle, IN THREADINFOCLASS thread_information_class, IN OUT void *thread_information, IN ULONG thread_information_length, OUT ULONG *return_length OPTIONAL)
typedef NTSTATUS(WINAPI * | func_NtQuerySystemInformation) (IN ULONG system_information_class, OUT void *system_information, IN ULONG system_information_length, OUT ULONG *return_length)
typedef NTSTATUS(WINAPI * | func_RtlGetVersion) (OUT OSVERSIONINFOW *ver_info)
typedef BOOL(WINAPI * | func_GetThreadInformation) (IN HANDLE thread_handle, IN int thread_information_class, IN OUT void *thread_information, IN DWORD thread_information_length)
typedef DWORD(WINAPI * | func_GetFileVersionInfoSizeA) (char *, DWORD *)
typedef BOOL(WINAPI * | func_GetFileVersionInfoA) (char *, DWORD, DWORD, void *)
typedef BOOL(WINAPI * | func_GetFileVersionInfoExA) (DWORD, LPCTSTR, DWORD, DWORD, void *)
typedef BOOL(WINAPI * | func_VerQueryValueA) (const void **, char *, void **, UINT *)
typedef BOOL(WINAPI * | func_GetComputerNameExA) (int, char *, DWORD *)
typedef BOOL(WINAPI * | func_IsWow64Process) (HANDLE, BOOL *)
typedef void(WINAPI * | func_GetSystemTimePreciseAsFileTime) (FILETIME *)
typedef DNS_STATUS(WINAPI * | func_DnsQuery_A) (IN const char *name, IN WORD wType, IN DWORD options, IN IP4_ARRAY *aipServers, IN OUT DNS_RECORD **queryResults, IN OUT void **reserved)
typedef DNS_STATUS(WINAPI * | func_DnsModifyRecordsInSet_A) (IN DNS_RECORD *addRecords, IN DNS_RECORD *deleteRecords, IN DWORD options, IN HANDLE context, OPTIONAL IN IP4_ARRAY *serverList, OPTIONAL IN void *reserved)
typedef void(WINAPI * | func_DnsFree) (IN OUT void *data, IN DNS_FREE_TYPE freeType)
typedef void | WAN_ADAPTER
typedef BOOL(cdecl * | func_WanPacketSetBpfFilter) (WAN_ADAPTER *, PUCHAR, DWORD)
typedef WAN_ADAPTER *(cdecl * | func_WanPacketOpenAdapter) (void)
typedef BOOL(cdecl * | func_WanPacketCloseAdapter) (WAN_ADAPTER *)
typedef BOOL(cdecl * | func_WanPacketSetBufferSize) (WAN_ADAPTER *, DWORD)
typedef DWORD(cdecl * | func_WanPacketReceivePacket) (WAN_ADAPTER *, PUCHAR, DWORD)
typedef BOOL(cdecl * | func_WanPacketSetMinToCopy) (WAN_ADAPTER *, DWORD)
typedef BOOL(cdecl * | func_WanPacketGetStats) (WAN_ADAPTER *, struct bpf_stat *)
typedef BOOL(cdecl * | func_WanPacketSetReadTimeout) (WAN_ADAPTER *, DWORD)
typedef BOOL(cdecl * | func_WanPacketSetMode) (WAN_ADAPTER *, DWORD)
typedef HANDLE(cdecl * | func_WanPacketGetReadEvent) (WAN_ADAPTER *)
typedef BOOL(cdecl * | func_WanPacketTestAdapter) (void)
typedef EXC_FUN(APIENTRY * | func_BT_InstallSehFilter) (void)
typedef void(APIENTRY * | func_BT_SetPreErrHandler) (BT_ErrHandler, INT_PTR)
typedef void(APIENTRY * | func_BT_SetAppVersion) (const char *appVersion)
typedef void(APIENTRY * | func_BT_SetAppName) (const char *appName)
typedef void(APIENTRY * | func_BT_SetReportFormat) (BUGTRAP_REPORTFORMAT format)
typedef void(APIENTRY * | func_BT_SetSupportEMail) (const char *supportEmail)
typedef INT_PTR(APIENTRY * | func_BT_OpenLogFile) (const char *logFileName, BUGTRAP_LOGFORMAT logFormat)
typedef void(APIENTRY * | func_BT_SetFlags) (DWORD dwFlags)
typedef BOOL(APIENTRY * | func_BT_SetLogSizeInEntries) (INT_PTR handle, DWORD logSizeInEntries)
typedef BOOL(APIENTRY * | func_BT_SetLogFlags) (INT_PTR handle, DWORD flags)
typedef BOOL(APIENTRY * | func_BT_SetLogEchoMode) (INT_PTR handle, DWORD logEchoMode)
typedef BOOL(APIENTRY * | func_BT_InsLogEntryF) (INT_PTR handle, BUGTRAP_LOGLEVEL logLevel, LPCTSTR format,...)
typedef BOOL(APIENTRY * | func_BT_CloseLogFile) (INT_PTR handle)
typedef void(APIENTRY * | func_BT_AddLogFile) (const char *logFile)

Enumerations

enum _THREADINFOCLASS {
ThreadBasicInformation ,
ThreadTimes ,
ThreadPriority ,
ThreadBasePriority ,
ThreadAffinityMask ,
ThreadImpersonationToken ,
ThreadDescriptorTableEntry ,
ThreadEnableAlignmentFaultFixup ,
ThreadEventPair_Reusable ,
ThreadQuerySetWin32StartAddress ,
ThreadZeroTlsCell ,
ThreadPerformanceCount ,
ThreadAmILastThread ,
ThreadIdealProcessor ,
ThreadPriorityBoost ,
ThreadSetTlsArrayAddress ,
ThreadIsIoPending ,
MaxThreadInfoClass
}

Functions

int | load_dynamic_table (struct LoadTable *tab, int tab_size)
int | unload_dynamic_table (struct LoadTable *tab, int tab_size)

Variables

struct LoadTable | dyn_funcs []
size_t | dyn_funcs_num
func_GetFileVersionInfoSizeA | p_GetFileVersionInfoSizeA
func_GetFileVersionInfoA | p_GetFileVersionInfoA
func_GetFileVersionInfoExA | p_GetFileVersionInfoExA
func_VerQueryValueA | p_VerQueryValueA
func_QueryThreadCycleTime | p_QueryThreadCycleTime
func_NtQueryInformationThread | p_NtQueryInformationThread
func_NtQuerySystemInformation | p_NtQuerySystemInformation
func_RtlGetVersion | p_RtlGetVersion
func_GetComputerNameExA | p_GetComputerNameExA
func_IsWow64Process | p_IsWow64Process
func_GetSystemTimePreciseAsFileTime | p_GetSystemTimePreciseAsFileTime
func_DnsFree | p_DnsFree
func_DnsQuery_A | p_DnsQuery_A
func_DnsModifyRecordsInSet_A | p_DnsModifyRecordsInSet_A
func_WanPacketSetBpfFilter | p_WanPacketSetBpfFilter
func_WanPacketOpenAdapter | p_WanPacketOpenAdapter
func_WanPacketCloseAdapter | p_WanPacketCloseAdapter
func_WanPacketSetBufferSize | p_WanPacketSetBufferSize
func_WanPacketReceivePacket | p_WanPacketReceivePacket
func_WanPacketSetMinToCopy | p_WanPacketSetMinToCopy
func_WanPacketGetStats | p_WanPacketGetStats
func_WanPacketSetReadTimeout | p_WanPacketSetReadTimeout
func_WanPacketSetMode | p_WanPacketSetMode
func_WanPacketGetReadEvent | p_WanPacketGetReadEvent
func_WanPacketTestAdapter | p_WanPacketTestAdapter
func_BT_InstallSehFilter | p_BT_InstallSehFilter
func_BT_SetPreErrHandler | p_BT_SetPreErrHandler
func_BT_SetAppVersion | p_BT_SetAppVersion
func_BT_SetAppName | p_BT_SetAppName
func_BT_SetReportFormat | p_BT_SetReportFormat
func_BT_SetSupportEMail | p_BT_SetSupportEMail
func_BT_SetFlags | p_BT_SetFlags
func_BT_SetLogSizeInEntries | p_BT_SetLogSizeInEntries
func_BT_SetLogFlags | p_BT_SetLogFlags
func_BT_SetLogEchoMode | p_BT_SetLogEchoMode
func_BT_InsLogEntryF | p_BT_InsLogEntryF
func_BT_OpenLogFile | p_BT_OpenLogFile
func_BT_CloseLogFile | p_BT_CloseLogFile
func_BT_AddLogFile | p_BT_AddLogFile

Detailed Description

Loading Windows modules dynamically.

Definition in file win_dll.h.

Typedef Documentation

◆ func_BT_AddLogFile

typedef void(APIENTRY * func_BT_AddLogFile) (const char *logFile)

Definition at line 220 of file win_dll.h.

◆ func_BT_CloseLogFile

typedef BOOL(APIENTRY * func_BT_CloseLogFile) (INT_PTR handle)

Definition at line 219 of file win_dll.h.

◆ func_BT_InsLogEntryF

typedef BOOL(APIENTRY * func_BT_InsLogEntryF) (INT_PTR handle, BUGTRAP_LOGLEVEL logLevel, LPCTSTR format,...)

Definition at line 218 of file win_dll.h.

◆ func_BT_InstallSehFilter

typedef EXC_FUN(APIENTRY * func_BT_InstallSehFilter) (void)

Definition at line 207 of file win_dll.h.

◆ func_BT_OpenLogFile

typedef INT_PTR(APIENTRY * func_BT_OpenLogFile) (const char *logFileName, BUGTRAP_LOGFORMAT logFormat)

Definition at line 213 of file win_dll.h.

◆ func_BT_SetAppName

typedef void(APIENTRY * func_BT_SetAppName) (const char *appName)

Definition at line 210 of file win_dll.h.

◆ func_BT_SetAppVersion

typedef void(APIENTRY * func_BT_SetAppVersion) (const char *appVersion)

Definition at line 209 of file win_dll.h.

◆ func_BT_SetFlags

typedef void(APIENTRY * func_BT_SetFlags) (DWORD dwFlags)

Definition at line 214 of file win_dll.h.

◆ func_BT_SetLogEchoMode

typedef BOOL(APIENTRY * func_BT_SetLogEchoMode) (INT_PTR handle, DWORD logEchoMode)

Definition at line 217 of file win_dll.h.

◆ func_BT_SetLogFlags

typedef BOOL(APIENTRY * func_BT_SetLogFlags) (INT_PTR handle, DWORD flags)

Definition at line 216 of file win_dll.h.

◆ func_BT_SetLogSizeInEntries

typedef BOOL(APIENTRY * func_BT_SetLogSizeInEntries) (INT_PTR handle, DWORD logSizeInEntries)

Definition at line 215 of file win_dll.h.

◆ func_BT_SetPreErrHandler

typedef void(APIENTRY * func_BT_SetPreErrHandler) (BT_ErrHandler, INT_PTR)

Definition at line 208 of file win_dll.h.

◆ func_BT_SetReportFormat

typedef void(APIENTRY * func_BT_SetReportFormat) (BUGTRAP_REPORTFORMAT format)

Definition at line 211 of file win_dll.h.

◆ func_BT_SetSupportEMail

typedef void(APIENTRY * func_BT_SetSupportEMail) (const char *supportEmail)

Definition at line 212 of file win_dll.h.

◆ func_DnsFree

typedef void(WINAPI * func_DnsFree) (IN OUT void *data, IN DNS_FREE_TYPE freeType)

Definition at line 149 of file win_dll.h.

◆ func_DnsModifyRecordsInSet_A

typedef DNS_STATUS(WINAPI * func_DnsModifyRecordsInSet_A) (IN DNS_RECORD *addRecords, IN DNS_RECORD *deleteRecords, IN DWORD options, IN HANDLE context, OPTIONAL IN IP4_ARRAY *serverList, OPTIONAL IN void *reserved)

Definition at line 141 of file win_dll.h.

◆ func_DnsQuery_A

typedef DNS_STATUS(WINAPI * func_DnsQuery_A) (IN const char *name, IN WORD wType, IN DWORD options, IN IP4_ARRAY *aipServers, IN OUT DNS_RECORD **queryResults, IN OUT void **reserved)

Definition at line 133 of file win_dll.h.

◆ func_GetComputerNameExA

typedef BOOL(WINAPI * func_GetComputerNameExA) (int, char *, DWORD *)

Definition at line 110 of file win_dll.h.

◆ func_GetFileVersionInfoA

typedef BOOL(WINAPI * func_GetFileVersionInfoA) (char *, DWORD, DWORD, void *)

Definition at line 107 of file win_dll.h.

◆ func_GetFileVersionInfoExA

typedef BOOL(WINAPI * func_GetFileVersionInfoExA) (DWORD, LPCTSTR, DWORD, DWORD, void *)

Definition at line 108 of file win_dll.h.

◆ func_GetFileVersionInfoSizeA

typedef DWORD(WINAPI * func_GetFileVersionInfoSizeA) (char *, DWORD *)

Definition at line 106 of file win_dll.h.

◆ func_GetSystemTimePreciseAsFileTime

typedef void(WINAPI * func_GetSystemTimePreciseAsFileTime) (FILETIME *)

Definition at line 112 of file win_dll.h.

◆ func_GetThreadInformation

typedef BOOL(WINAPI * func_GetThreadInformation) (IN HANDLE thread_handle, IN int thread_information_class, IN OUT void *thread_information, IN DWORD thread_information_length)

Definition at line 100 of file win_dll.h.

◆ func_IsWow64Process

typedef BOOL(WINAPI * func_IsWow64Process) (HANDLE, BOOL *)

Definition at line 111 of file win_dll.h.

◆ func_NtQueryInformationThread

typedef NTSTATUS(WINAPI * func_NtQueryInformationThread) (IN HANDLE thread_handle, IN THREADINFOCLASS thread_information_class, IN OUT void *thread_information, IN ULONG thread_information_length, OUT ULONG *return_length OPTIONAL)

Definition at line 75 of file win_dll.h.

◆ func_NtQuerySystemInformation

typedef NTSTATUS(WINAPI * func_NtQuerySystemInformation) (IN ULONG system_information_class, OUT void *system_information, IN ULONG system_information_length, OUT ULONG *return_length)

Definition at line 82 of file win_dll.h.

◆ func_QueryThreadCycleTime

typedef BOOL(WINAPI * func_QueryThreadCycleTime) (IN HANDLE thread_handle, OUT ULONG64 *cycle_time)

Definition at line 71 of file win_dll.h.

◆ func_RtlGetVersion

typedef NTSTATUS(WINAPI * func_RtlGetVersion) (OUT OSVERSIONINFOW *ver_info)

Definition at line 88 of file win_dll.h.

◆ func_VerQueryValueA

typedef BOOL(WINAPI * func_VerQueryValueA) (const void **, char *, void **, UINT *)

Definition at line 109 of file win_dll.h.

◆ func_WanPacketCloseAdapter

typedef BOOL(cdecl * func_WanPacketCloseAdapter) (WAN_ADAPTER *)

Definition at line 172 of file win_dll.h.

◆ func_WanPacketGetReadEvent

typedef HANDLE(cdecl * func_WanPacketGetReadEvent) (WAN_ADAPTER *)

Definition at line 179 of file win_dll.h.

◆ func_WanPacketGetStats

typedef BOOL(cdecl * func_WanPacketGetStats) (WAN_ADAPTER *, struct bpf_stat *)

Definition at line 176 of file win_dll.h.

◆ func_WanPacketOpenAdapter

typedef WAN_ADAPTER *(cdecl * func_WanPacketOpenAdapter) (void)

Definition at line 171 of file win_dll.h.

◆ func_WanPacketReceivePacket

typedef DWORD(cdecl * func_WanPacketReceivePacket) (WAN_ADAPTER *, PUCHAR, DWORD)

Definition at line 174 of file win_dll.h.

◆ func_WanPacketSetBpfFilter

typedef BOOL(cdecl * func_WanPacketSetBpfFilter) (WAN_ADAPTER *, PUCHAR, DWORD)

Definition at line 170 of file win_dll.h.

◆ func_WanPacketSetBufferSize

typedef BOOL(cdecl * func_WanPacketSetBufferSize) (WAN_ADAPTER *, DWORD)

Definition at line 173 of file win_dll.h.

◆ func_WanPacketSetMinToCopy

typedef BOOL(cdecl * func_WanPacketSetMinToCopy) (WAN_ADAPTER *, DWORD)

Definition at line 175 of file win_dll.h.

◆ func_WanPacketSetMode

typedef BOOL(cdecl * func_WanPacketSetMode) (WAN_ADAPTER *, DWORD)

Definition at line 178 of file win_dll.h.

◆ func_WanPacketSetReadTimeout

typedef BOOL(cdecl * func_WanPacketSetReadTimeout) (WAN_ADAPTER *, DWORD)

Definition at line 177 of file win_dll.h.

◆ func_WanPacketTestAdapter

typedef BOOL(cdecl * func_WanPacketTestAdapter) (void)

Definition at line 180 of file win_dll.h.

◆ NTSTATUS

typedef LONG NTSTATUS

Definition at line 41 of file win_dll.h.

◆ WAN_ADAPTER

typedef void WAN_ADAPTER

Definition at line 161 of file win_dll.h.

Enumeration Type Documentation

◆ _THREADINFOCLASS

enum _THREADINFOCLASS

Definition at line 43 of file win_dll.h.

Function Documentation

◆ load_dynamic_table()

int load_dynamic_table | ( | struct LoadTable * | tab,
 |  | int | tab_size
 | ) |  |

Definition at line 152 of file win_dll.c.

◆ unload_dynamic_table()

int unload_dynamic_table | ( | struct LoadTable * | tab,
 |  | int | tab_size
 | ) |  |

Definition at line 185 of file win_dll.c.

Variable Documentation

◆ dyn_funcs

struct LoadTable dyn_funcs[]
extern

Definition at line 100 of file win_dll.c.

◆ dyn_funcs_num

size_t dyn_funcs_num
extern

Definition at line 147 of file win_dll.c.

◆ p_BT_AddLogFile

func_BT_AddLogFile p_BT_AddLogFile
extern

Definition at line 92 of file win_dll.c.

◆ p_BT_CloseLogFile

func_BT_CloseLogFile p_BT_CloseLogFile
extern

Definition at line 91 of file win_dll.c.

◆ p_BT_InsLogEntryF

func_BT_InsLogEntryF p_BT_InsLogEntryF
extern

Definition at line 89 of file win_dll.c.

◆ p_BT_InstallSehFilter

func_BT_InstallSehFilter p_BT_InstallSehFilter
extern

Definition at line 79 of file win_dll.c.

◆ p_BT_OpenLogFile

func_BT_OpenLogFile p_BT_OpenLogFile
extern

Definition at line 90 of file win_dll.c.

◆ p_BT_SetAppName

func_BT_SetAppName p_BT_SetAppName
extern

Definition at line 82 of file win_dll.c.

◆ p_BT_SetAppVersion

func_BT_SetAppVersion p_BT_SetAppVersion
extern

Definition at line 81 of file win_dll.c.

◆ p_BT_SetFlags

func_BT_SetFlags p_BT_SetFlags
extern

Definition at line 85 of file win_dll.c.

◆ p_BT_SetLogEchoMode

func_BT_SetLogEchoMode p_BT_SetLogEchoMode
extern

Definition at line 88 of file win_dll.c.

◆ p_BT_SetLogFlags

func_BT_SetLogFlags p_BT_SetLogFlags
extern

Definition at line 87 of file win_dll.c.

◆ p_BT_SetLogSizeInEntries

func_BT_SetLogSizeInEntries p_BT_SetLogSizeInEntries
extern

Definition at line 86 of file win_dll.c.

◆ p_BT_SetPreErrHandler

func_BT_SetPreErrHandler p_BT_SetPreErrHandler
extern

Definition at line 80 of file win_dll.c.

◆ p_BT_SetReportFormat

func_BT_SetReportFormat p_BT_SetReportFormat
extern

Definition at line 83 of file win_dll.c.

◆ p_BT_SetSupportEMail

func_BT_SetSupportEMail p_BT_SetSupportEMail
extern

Definition at line 84 of file win_dll.c.

◆ p_DnsFree

func_DnsFree p_DnsFree
extern

Definition at line 73 of file win_dll.c.

◆ p_DnsModifyRecordsInSet_A

func_DnsModifyRecordsInSet_A p_DnsModifyRecordsInSet_A
extern

Definition at line 75 of file win_dll.c.

◆ p_DnsQuery_A

func_DnsQuery_A p_DnsQuery_A
extern

Definition at line 74 of file win_dll.c.

◆ p_GetComputerNameExA

func_GetComputerNameExA p_GetComputerNameExA
extern

Definition at line 44 of file win_dll.c.

◆ p_GetFileVersionInfoA

func_GetFileVersionInfoA p_GetFileVersionInfoA
extern

Definition at line 46 of file win_dll.c.

◆ p_GetFileVersionInfoExA

func_GetFileVersionInfoExA p_GetFileVersionInfoExA
extern

Definition at line 47 of file win_dll.c.

◆ p_GetFileVersionInfoSizeA

func_GetFileVersionInfoSizeA p_GetFileVersionInfoSizeA
extern

Definition at line 45 of file win_dll.c.

◆ p_GetSystemTimePreciseAsFileTime

func_GetSystemTimePreciseAsFileTime p_GetSystemTimePreciseAsFileTime
extern

Definition at line 55 of file win_dll.c.

◆ p_IsWow64Process

func_IsWow64Process p_IsWow64Process
extern

Definition at line 53 of file win_dll.c.

◆ p_NtQueryInformationThread

func_NtQueryInformationThread p_NtQueryInformationThread
extern

Definition at line 51 of file win_dll.c.

◆ p_NtQuerySystemInformation

func_NtQuerySystemInformation p_NtQuerySystemInformation
extern

Definition at line 52 of file win_dll.c.

◆ p_QueryThreadCycleTime

func_QueryThreadCycleTime p_QueryThreadCycleTime
extern

Definition at line 49 of file win_dll.c.

◆ p_RtlGetVersion

func_RtlGetVersion p_RtlGetVersion
extern

Definition at line 50 of file win_dll.c.

◆ p_VerQueryValueA

func_VerQueryValueA p_VerQueryValueA
extern

Definition at line 48 of file win_dll.c.

◆ p_WanPacketCloseAdapter

func_WanPacketCloseAdapter p_WanPacketCloseAdapter
extern

Definition at line 62 of file win_dll.c.

◆ p_WanPacketGetReadEvent

func_WanPacketGetReadEvent p_WanPacketGetReadEvent
extern

Definition at line 69 of file win_dll.c.

◆ p_WanPacketGetStats

func_WanPacketGetStats p_WanPacketGetStats
extern

Definition at line 66 of file win_dll.c.

◆ p_WanPacketOpenAdapter

func_WanPacketOpenAdapter p_WanPacketOpenAdapter
extern

Definition at line 61 of file win_dll.c.

◆ p_WanPacketReceivePacket

func_WanPacketReceivePacket p_WanPacketReceivePacket
extern

Definition at line 64 of file win_dll.c.

◆ p_WanPacketSetBpfFilter

func_WanPacketSetBpfFilter p_WanPacketSetBpfFilter
extern

Definition at line 60 of file win_dll.c.

◆ p_WanPacketSetBufferSize

func_WanPacketSetBufferSize p_WanPacketSetBufferSize
extern

Definition at line 63 of file win_dll.c.

◆ p_WanPacketSetMinToCopy

func_WanPacketSetMinToCopy p_WanPacketSetMinToCopy
extern

Definition at line 65 of file win_dll.c.

◆ p_WanPacketSetMode

func_WanPacketSetMode p_WanPacketSetMode
extern

Definition at line 68 of file win_dll.c.

◆ p_WanPacketSetReadTimeout

func_WanPacketSetReadTimeout p_WanPacketSetReadTimeout
extern

Definition at line 67 of file win_dll.c.

◆ p_WanPacketTestAdapter

func_WanPacketTestAdapter p_WanPacketTestAdapter
extern

Definition at line 70 of file win_dll.c.


Watt-32 tcp/ip: E:/WATT/src/winadinf.c File Reference

  • src
Data Structures | Typedefs | Functions | Variables
winadinf.c File Reference

Go to the source code of this file.

Data Structures

struct | one_addr
struct | setup_info_st

Typedefs

typedef char address_buf[MAX_IP6_SZ+1]

Functions

DEF_FUNC (int, WSACleanup,(void))
DEF_FUNC (int, WSAGetLastError,(void))
DEF_FUNC (INT, WSAAddressToStringA,(__in SOCKADDR *lpsaAddress, __in DWORD dwAddressLength, __in_opt WSAPROTOCOL_INFO *lpProtocolInfo, __inout CHAR *lpszAddressString, __inout DWORD *lpdwAddressStringLength))
DEF_FUNC (INT, WSALookupServiceBeginA,(__in WSAQUERYSETA *lpqsRestrictions, __in DWORD dwControlFlags, __out HANDLE *lphLookup))
DEF_FUNC (INT, WSALookupServiceEnd,(__in HANDLE lphLookup))
DEF_FUNC (INT, WSALookupServiceNextA,(__in HANDLE hLookup, __in DWORD dwControlFlags, __inout DWORD *lpdwBufferLength, __out WSAQUERYSETA *lpqsResults))
DEF_FUNC (ULONG, GetAdaptersAddresses,(__in ULONG Family, __in ULONG Flags, __in void *Reserved, __out IP_ADAPTER_ADDRESSES *AdapterAddresses, __inout ULONG *outBufLen))
DEF_FUNC (IP_ADAPTER_ORDER_MAP *, GetAdapterOrderMap,(void))
DEF_FUNC (DWORD, GetIfTable,(__out MIB_IFTABLE *pIfTable, __inout ULONG *pdwSize, __in BOOL bOrder))
DEF_FUNC (DWORD, GetIfTable2,(__out MIB_IF_TABLE2 **table))
DEF_FUNC (DWORD, GetIpInterfaceEntry,(__inout MIB_IPINTERFACE_ROW *row))
DEF_FUNC (DWORD, GetIfTable2Ex,(__in MIB_IF_TABLE_LEVEL level, __out MIB_IF_TABLE2 **table))
DEF_FUNC (DWORD, GetIpNetTable,(__out MIB_IPNETTABLE *table, __inout ULONG *size, __in BOOL sort))
DEF_FUNC (DWORD, GetIpNetTable2,(__in u_short family, __out MIB_IPNET_TABLE2 **table))
DEF_FUNC (void, FreeMibTable,(__in void *mem))
DEF_FUNC (DWORD, GetIpAddrTable,(__out MIB_IPADDRTABLE *table, __inout ULONG *size, __in BOOL order))
DEF_FUNC (DWORD, GetBestRoute,(__in DWORD dest_addr, __in DWORD source_addr, __out MIB_IPFORWARDROW *best_route))
DEF_FUNC (DWORD, GetBestRoute2,(__in_opt NET_LUID *interface_Luid, __in NET_IFINDEX interface_index, __in const SOCKADDR_INET *source_address, __in const SOCKADDR_INET *destination_address, __in ULONG address_sort_options, __out MIB_IPFORWARD_ROW2 *best_route, __out SOCKADDR_INET *best_source_address))
DEF_FUNC (DWORD, GetIpForwardTable2,(__in WORD family, __out MIB_IPFORWARD_TABLE2 **table))
DEF_FUNC (BOOL, GetIpForwardEntry2,(__inout MIB_IPFORWARD_ROW2 *row))
DEF_FUNC (DWORD, ConvertInterfaceLuidToIndex,(__in const NET_LUID *luid, __out NET_IFINDEX *index))
DEF_FUNC (DWORD, ConvertInterfaceLuidToNameA,(__in const NET_LUID *luid, __out char *if_name, __in size_t length))
DEF_FUNC (DWORD, GetIfEntry,(__inout MIB_IFROW *if_row))
DEF_FUNC (BOOL, GetIpNetworkConnectionBandwidthEstimates,(__in NET_IFINDEX index, __in ADDRESS_FAMILY family, __out MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES *bw_estimates))
DEF_FUNC (DWORD, GetNetworkParams,(__inout FIXED_INFO *fixed_info, __inout DWORD *size))
DEF_FUNC (DWORD, RasEnumConnectionsA,(__inout RASCONN *lprasconn, __inout DWORD *lpcb, __out DWORD *lpcConnections))
DEF_FUNC (DWORD, RasGetConnectionStatistics,(__in HRASCONN hRasConn, __inout RAS_STATS *lpStatistics))
DEF_FUNC (DWORD, RasGetErrorStringA,(__in UINT err, __out CHAR *err_str, __in DWORD size))
DEF_FUNC (DWORD, RasGetProjectionInfoA,(__in HRASCONN hrasconn, __in RASPROJECTION rasprojection, __out void *lpprojection, __inout DWORD *lpcb))
DEF_FUNC (DWORD, WlanOpenHandle,(__in DWORD dwClientVersion, __reserved void *pReserved, __out DWORD *pdwNegotiatedVersion, __out HANDLE *phClientHandle))
DEF_FUNC (DWORD, WlanCloseHandle,(__in HANDLE dwClientHandle, __reserved void *pReserved))
DEF_FUNC (DWORD, WlanEnumInterfaces,(__in HANDLE hClientHandle, __reserved void *pReserved, __deref_out WLAN_INTERFACE_INFO_LIST **ppInterfaceList))
DEF_FUNC (DWORD, WlanQueryInterface,(__in HANDLE hClientHandle, __in const GUID *pInterfaceGuid, __in WLAN_INTF_OPCODE OpCode, __reserved void *pReserved, __out DWORD *pdwDataSize, __out void **ppData, __out_opt WLAN_OPCODE_VALUE_TYPE *pWlanOpcodeValueType))
DEF_FUNC (DWORD, WlanGetAvailableNetworkList,(__in HANDLE hClientHandle, __in const GUID *pInterfaceGuid, __in DWORD dwFlags, __reserved void *pReserved, __out WLAN_AVAILABLE_NETWORK_LIST **AvailableNetworks))
DEF_FUNC (DWORD, WlanGetNetworkBssList,(__in HANDLE hClientHandle, __in const GUID *pInterfaceGuid, __in_opt const DOT11_SSID *pDot11Ssid, __in DOT11_BSS_TYPE dot11BssType, __in BOOL bSecurityEnabled, __reserved void *pReserved, __out WLAN_BSS_LIST **WlanBssList))
DEF_FUNC (DWORD, WlanReasonCodeToString,(__in DWORD dwReasonCode, __in DWORD dwBufferSize, __in WCHAR *pStringBuffer, __reserved void *pReserved))
DEF_FUNC (DWORD, WlanGetInterfaceCapability,(__in HANDLE hClientHandle, __in const GUID *pInterfaceGuid, __reserved void *pReserved, __out WLAN_INTERFACE_CAPABILITY **ppCapability))
DEF_FUNC (DWORD, WlanGetSupportedDeviceServices,(__in HANDLE hClientHandle, __in const GUID *pInterfaceGuid, __out WLAN_DEVICE_SERVICE_GUID_LIST2 **svc_guid_list))
DEF_FUNC (void, WlanFreeMemory,(__in void *memory))
DEF_FUNC (int, StringFromGUID2,(__in REFGUID rguid, __out LPOLESTR lpsz, __in int cchMax))
W32_FUNC unsigned long W32_CDECL | _w32_intel (unsigned long x)
Convert 32-bit big-endian (network order) to intel (host order) format.
W32_FUNC unsigned short W32_CDECL | _w32_intel16 (unsigned short x)
Convert 16-bit big-endian (network order) to intel (host order) format.
W32_FUNC const char *W32_CALL | _w32_inet_ntop (int af, const void *src, char *dst, size_t size)
static void | setup_info_get (void)
static int | setup_info_populate (const char *key_name, struct setup_info_st *info)
static void | setup_info_dump (void)
static void | setup_info_adapter_print (const char *adapter_name)
Walk the 'setup_info' array looking for a 'inf->NetCfgInstanceId == adapter_name' (there can be only one).
static void | setup_info_free (void)
static const char * | convert_ch_to_freq (int ch)
static const char * | get_if_type (DWORD if_type)
static void | print_wlan_bss_list (const WLAN_BSS_LIST *bss_list)
static BOOL | load_dlls (void)
static void W32_CALL | pkt_win_exit (void)
static BOOL | pkt_win_init (void)
static const char * | _list_lookup (DWORD value, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
static const char * | get_wsock_err (void)
static const char * | get_guid_str (const GUID *guid)
static char * | strip_end (char *buf, char ch)
static BOOL | all_zeroes (const void *p, size_t len)
static const char * | format_line (const char *line, int indent)
static const char * | dword_string (DWORD val)
Return nicely formatted string "xx.xxx.xxx" with thousand separators (left adjusted).
static const char * | speed_string (DWORD val, char *buf)
Return a number with suffix for a link-speed 32-bit value.
static const char * | speed64_string (ULONG64 val, char *buf)
Return a number with a suitable suffix for a link-speed of a 64-bit value.
static const char * | duration_string (DWORD msec)
static const char * | reg_type_name (DWORD type)
static const char * | get_sockaddr_inet_str (const SOCKADDR_INET *sa)
static void | print_skipped (void)
static BOOL | skip_this_iface (const IP_ADAPTER_ADDRESSES *addr, const MIB_IFROW *if_row, const void *_if_row2)
static BOOL | skip_filter_iface (const BYTE *descr_a, const wchar_t *descr_w)
static const char * | get_phys_address (const void *a, ULONG len, BOOL show_manuf)
static const char * | get_address_flags (DWORD flags)
static const char * | get_addr_common (int num, const address_buf *abuf)
static const char * | socket_addr_str (const SOCKET_ADDRESS *addr)
static const char * | socket_addr_str2 (const SOCKET_ADDRESS *addr)
static const char * | get_netmask_prefix (const IP_ADAPTER_PREFIX *pf)
GET_ADDRESSES (get_unicast_addrs, IP_ADAPTER_UNICAST_ADDRESS, uca)
We need the row.Metric from print_ip_interface_details() to get the true Metric for the route.
static BOOL | iface_store_metric (const NET_LUID *luid, DWORD metric, int family)
static DWORD | iface_lookup_metric (const NET_LUID *luid, int family)
static void | dump_data (const void *data_p, UINT datalen, const char *indent)
static int | _pkt_win_print_GetIfTable (void)
static int | _pkt_win_print_GetIfTable2 (void)
static void | print_mib_if_row (DWORD index, const MIB_IFROW *row)
static void | print_ip_interface_details (const NET_LUID *luid, int family, int indent)
static void | print_mib_if_row2 (DWORD index, const MIB_IF_ROW2 *row)
static int | _pkt_win_print_GetIfTable2Ex (void)
static int | _pkt_win_print_GetIpNetTable (void)
static int | _pkt_win_print_GetIpNetTable2 (void)
static int | _pkt_win_print_GetIpAddrTable (void)
static int | _pkt_win_print_GetNetworkParams (void)
static int | _pkt_win_print_GetAdaptersAddresses (void)
static int | _pkt_win_print_GetAdapterOrderMap (void)
static const char * | get_route_origin (enum _NL_ROUTE_ORIGIN origin)
static const char * | get_route_protocol (DWORD protocol)
static void | print_mib_ipforward_row2 (DWORD index, const MIB_IPFORWARD_ROW2 *row, int family)
static ULONG | internal_print_GetIpForwardTable2 (int family)
static int | _pkt_win_print_GetIpForwardTable2 (void)
static const char * | ras_strerror (DWORD err)
static const char * | get_ccp_flags (DWORD flags)
static const char * | get_lcp_flags (DWORD flags)
static const char * | get_best_route2 (NET_LUID *luid, const SOCKADDR_INET *dest)
static int | _pkt_win_print_RasEnumConnections (void)
static BOOL | wlan_query (HANDLE client, const GUID *guid, WLAN_INTF_OPCODE opcode, size_t data_size, void *data)
static void | print_wlan_svc_guid_list (const WLAN_DEVICE_SERVICE_GUID_LIST2 *list)
static int | _pkt_win_print_WlanEnumInterfaces (void)
static const char * | get_phy_types (DWORD num, const DOT11_PHY_TYPE *phy)
static const char * | get_ssid (const DOT11_SSID *ssid)
static const char * | get_dot11_auth (enum _DOT11_AUTH_ALGORITHM auth)
static const char * | get_dot11_cipher (enum _DOT11_CIPHER_ALGORITHM cipher)
static void | print_wlan_networklist (const WLAN_AVAILABLE_NETWORK_LIST *wlist)
static void | print_wlan_current_connection (const WLAN_CONNECTION_ATTRIBUTES *attr, int indent)
static void | print_wlan_stats (const WLAN_STATISTICS *stats, int indent)
static double | filetime_sec (const FILETIME *filetime)
static const char * | convert_freq_to_ch (DWORD freq)
static struct search_list * | create_freq_to_ch_mapping (size_t *num_p)
static void | print_auth_pairs (const WLAN_AUTH_CIPHER_PAIR_LIST2 *auth_list, int indent)
static void | print_radio_state (const WLAN_RADIO_STATE *rs, int indent)
static void | print_mib_ipnetrow (DWORD index, const MIB_IPNETROW *row)
static void | print_mib_ipnet_row2 (DWORD index, const MIB_IPNET_ROW2 *row)
static void | FixList (char ***list, const char *base)
static void | UnpackHostEnt (struct hostent *hostent)
static void | print_blob (const BLOB *blob)
static int | _pkt_win_print_WSALookupServices (void)
static void | print_bw_estimate (const char *what, LONG64 Bps, int indent)
static void | print_net_luid (const NET_LUID *luid, int indent)
static int | compare_ipnetrow (const void *_a, const void *_b)
static int | compare_ipnetrow2 (const void *_a, const void *_b)
DEFINE_FUNC (pkt_win_print_GetIfTable)
int W32_CALL | pkt_win_get_verbose_level (void)

Variables

WSAStartup
__in WORD | version
__in WORD __inout WSADATA * | data
W32_DATA int | _w32_errno
static struct setup_info_st | setup_info [50]
static BOOL | ipv4_only_iface = TRUE
static char | work_buf [10000]
static int | verbose_level = 0
static struct LoadTable | dyn_funcs2 []
static const struct search_list | wsock_err_tab []
static int | num_ifaces_skipped = 0
static int | num_ifaces_not_up = 0
static int | num_ifaces_filtered = 0
static const struct search_list | if_types []
static const struct search_list | mib_oper_status []
static const struct search_list | oper_status []
static const struct search_list | arp_types []
static const struct search_list | neighbour_states []
static const struct search_list | conn_type []
static const struct search_list | tunnel_types []
static const struct search_list | media_types []
static const struct search_list | access_types []
luid_metrics
static struct luid_metrics | metrics_cache [40]
static const struct search_list | auth_proto []
static const struct search_list | auth_data []
static const struct search_list | compression []
static const struct search_list | wlan_intf_state []
static const struct search_list | wlan_conn_mode []
static const struct search_list | wlan_radio_states []
static const struct search_list | dot11_auth_algo []
static const struct search_list | dot11_cipher_algo []
static const struct search_list | bss_types []
static const struct search_list | dot11_phy_types []
static const struct search_list | ch_mapping24 []
static const struct search_list | ch_mapping50 []

Detailed Description

Functions for getting the details of network adapters under Windows. Using IPHlpApi Adapter Information (Win32/64).

Copyright (c) 2011 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Version

0.5 : July 07, 2011 : G. Vanem - created

Definition in file winadinf.c.

Typedef Documentation

◆ address_buf

typedef char address_buf[MAX_IP6_SZ+1]

Definition at line 344 of file winadinf.c.

Function Documentation

◆ _list_lookup()

static const char * _list_lookup | ( | DWORD | value,
 |  | const struct search_list * | list,
 |  | int | num
 | ) |  |
static

Search 'list' for 'type' and return it's name.

Duplicate it here in-case 'USE_DEBUG' isn't defined for misc.c.

Definition at line 497 of file winadinf.c.

◆ _pkt_win_print_GetAdapterOrderMap()

static int _pkt_win_print_GetAdapterOrderMap ( void )
static

Definition at line 2554 of file winadinf.c.

◆ _pkt_win_print_GetAdaptersAddresses()

static int _pkt_win_print_GetAdaptersAddresses ( void )
static

Definition at line 2311 of file winadinf.c.

◆ _pkt_win_print_GetIfTable()

static int _pkt_win_print_GetIfTable ( void )
static

Definition at line 1812 of file winadinf.c.

◆ _pkt_win_print_GetIfTable2()

static int _pkt_win_print_GetIfTable2 ( void )
static

Definition at line 1864 of file winadinf.c.

◆ _pkt_win_print_GetIfTable2Ex()

static int _pkt_win_print_GetIfTable2Ex ( void )
static

Definition at line 2108 of file winadinf.c.

◆ _pkt_win_print_GetIpAddrTable()

static int _pkt_win_print_GetIpAddrTable ( void )
static

Definition at line 2237 of file winadinf.c.

◆ _pkt_win_print_GetIpForwardTable2()

static int _pkt_win_print_GetIpForwardTable2 ( void )
static

Definition at line 2712 of file winadinf.c.

◆ _pkt_win_print_GetIpNetTable()

static int _pkt_win_print_GetIpNetTable ( void )
static

Definition at line 2169 of file winadinf.c.

◆ _pkt_win_print_GetIpNetTable2()

static int _pkt_win_print_GetIpNetTable2 ( void )
static

Definition at line 2208 of file winadinf.c.

◆ _pkt_win_print_GetNetworkParams()

static int _pkt_win_print_GetNetworkParams ( void )
static

Definition at line 2244 of file winadinf.c.

◆ _pkt_win_print_RasEnumConnections()

static int _pkt_win_print_RasEnumConnections ( void )
static

Definition at line 2899 of file winadinf.c.

◆ _pkt_win_print_WlanEnumInterfaces()

static int _pkt_win_print_WlanEnumInterfaces ( void )
static

Definition at line 3091 of file winadinf.c.

◆ _pkt_win_print_WSALookupServices()

static int _pkt_win_print_WSALookupServices ( void )
static

Definition at line 3885 of file winadinf.c.

◆ _w32_inet_ntop()

W32_FUNC const char *W32_CALL _w32_inet_ntop | ( | int | af,
 |  | const void * | src,
 |  | char * | dst,
 |  | size_t | size
 | ) |  |

Definition at line 59 of file presaddr.c.

◆ _w32_intel()

W32_FUNC unsigned long W32_CDECL _w32_intel ( unsigned long val )

Convert 32-bit big-endian (network order) to intel (host order) format.

Or vice-versa. These are cdecl incase we patch them.

Definition at line 171 of file misc.c.

◆ _w32_intel16()

W32_FUNC unsigned short W32_CDECL _w32_intel16 ( unsigned short val )

Convert 16-bit big-endian (network order) to intel (host order) format.

Or vice-versa

Definition at line 183 of file misc.c.

◆ all_zeroes()

static BOOL all_zeroes | ( | const void * | p,
 |  | size_t | len
 | ) |  |
static

Definition at line 586 of file winadinf.c.

◆ compare_ipnetrow()

static int compare_ipnetrow | ( | const void * | _a,
 |  | const void * | _b
 | ) |  |
static

Definition at line 4065 of file winadinf.c.

◆ compare_ipnetrow2()

static int compare_ipnetrow2 | ( | const void * | _a,
 |  | const void * | _b
 | ) |  |
static

Definition at line 4076 of file winadinf.c.

◆ convert_ch_to_freq()

static const char * convert_ch_to_freq ( int ch )
static

Definition at line 3656 of file winadinf.c.

◆ convert_freq_to_ch()

static const char * convert_freq_to_ch ( DWORD freq )
static

Definition at line 3602 of file winadinf.c.

◆ create_freq_to_ch_mapping()

static struct search_list * create_freq_to_ch_mapping ( size_t * num_p )
static

Definition at line 3617 of file winadinf.c.

◆ DEFINE_FUNC()

DEFINE_FUNC ( pkt_win_print_GetIfTable )

Definition at line 4116 of file winadinf.c.

◆ dump_data()

static void dump_data | ( | const void * | data_p,
 |  | UINT | datalen,
 |  | const char * | indent
 | ) |  |
static
Todo:
: print these too: 'ValidLifeTime', 'PreferredLifetime', 'LeaseLifetime', 'PrefixOrigin', 'SuffixOrigin' '(Address.lpSockaddr)->sa_family' for 'uca' and 'aca'

and: '(Address.lpSockaddr)->sa_family' for 'mca' and 'dns'

Definition at line 1769 of file winadinf.c.

◆ duration_string()

static const char * duration_string ( DWORD msec )
static

Definition at line 736 of file winadinf.c.

◆ dword_string()

static const char * dword_string ( DWORD val )
static

Return nicely formatted string "xx.xxx.xxx" with thousand separators (left adjusted).

Use 8 buffers in round-robin.

Definition at line 640 of file winadinf.c.

References strltrim().

◆ filetime_sec()

static double filetime_sec ( const FILETIME * filetime )
static

Definition at line 3502 of file winadinf.c.

◆ FixList()

static void FixList | ( | char *** | list,
 |  | const char * | base
 | ) |  |
static

Definition at line 3830 of file winadinf.c.

◆ format_line()

static const char * format_line | ( | const char * | line,
 |  | int | indent
 | ) |  |
static

Definition at line 606 of file winadinf.c.

◆ get_addr_common()

static const char * get_addr_common | ( | int | num,
 |  | const address_buf * | abuf
 | ) |  |
static

Definition at line 1542 of file winadinf.c.

◆ get_address_flags()

static const char * get_address_flags ( DWORD flags )
static

Definition at line 1499 of file winadinf.c.

◆ GET_ADDRESSES()

GET_ADDRESSES | ( | get_unicast_addrs | ,
 |  | IP_ADAPTER_UNICAST_ADDRESS | ,
 |  | uca |
 | ) |  |

We need the row.Metric from print_ip_interface_details() to get the true Metric for the route.

Hence store 'addr->Ipv4Metric' or 'addr->Ipv6Metric' in a local LUID-cache below.

Ref: https://docs.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipforward_row2

Quote: Note the actual route metric used to compute the route preference is the summation of interface metric specified in the Metric member of the MIB_IPINTERFACE_ROW structure and the route metric offset specified in this member.

Definition at line 1698 of file winadinf.c.

◆ get_best_route2()

static const char * get_best_route2 | ( | NET_LUID * | luid,
 |  | const SOCKADDR_INET * | dest
 | ) |  |
static

Definition at line 2863 of file winadinf.c.

◆ get_ccp_flags()

static const char * get_ccp_flags ( DWORD flags )
static

Definition at line 2791 of file winadinf.c.

◆ get_dot11_auth()

static const char * get_dot11_auth ( enum _DOT11_AUTH_ALGORITHM auth )
static

Definition at line 3333 of file winadinf.c.

◆ get_dot11_cipher()

static const char * get_dot11_cipher ( enum _DOT11_CIPHER_ALGORITHM cipher )
static

Definition at line 3344 of file winadinf.c.

◆ get_guid_str()

static const char * get_guid_str ( const GUID * guid )
static

Definition at line 533 of file winadinf.c.

◆ get_if_type()

static const char * get_if_type ( DWORD if_type )
static

Definition at line 2041 of file winadinf.c.

◆ get_lcp_flags()

static const char * get_lcp_flags ( DWORD flags )
static

Definition at line 2825 of file winadinf.c.

◆ get_netmask_prefix()

static const char * get_netmask_prefix ( const IP_ADAPTER_PREFIX * pf )
static

Definition at line 1615 of file winadinf.c.

◆ get_phy_types()

static const char * get_phy_types | ( | DWORD | num,
 |  | const DOT11_PHY_TYPE * | phy
 | ) |  |
static

Definition at line 3299 of file winadinf.c.

◆ get_phys_address()

static const char * get_phys_address | ( | const void * | a,
 |  | ULONG | len,
 |  | BOOL | show_manuf
 | ) |  |
static

Get the manufacturer name for this MAC-address.

Todo:
Get addresses such as 00:FF:DB:EF:7D:48 from a "Well Known Address" source. Ref. Wireshark's 'wka' file.

Handle "Locally Administered" addresses too. Like in the case: SSID: Chromecast6998.v Quality: -60 dBm MAC-address: FA:8F:CA:88:0C:A6 (Unknown OUI)

Turning bit 7 off in 'FA:8F:CA:88:0C:A6' (becoming 'F8:8F:CA:88:0C:A6') shows that 'F8:8F:CA' belongs to Google.

Ref. https://www.reddit.com/r/Chromecast/comments/2wjpo8/weird_google_fiber_hotspots_with_no_ssid_that/

Definition at line 1439 of file winadinf.c.

◆ get_route_origin()

static const char * get_route_origin ( enum _NL_ROUTE_ORIGIN origin )
static

Definition at line 2585 of file winadinf.c.

◆ get_route_protocol()

static const char * get_route_protocol ( DWORD protocol )
static

Definition at line 2599 of file winadinf.c.

◆ get_sockaddr_inet_str()

static const char * get_sockaddr_inet_str ( const SOCKADDR_INET * sa )
static

Definition at line 1029 of file winadinf.c.

◆ get_ssid()

static const char * get_ssid ( const DOT11_SSID * ssid )
static

Definition at line 3325 of file winadinf.c.

◆ get_wsock_err()

static const char * get_wsock_err ( void )
static

Definition at line 517 of file winadinf.c.

◆ iface_lookup_metric()

static DWORD iface_lookup_metric | ( | const NET_LUID * | luid,
 |  | int | family
 | ) |  |
static

Definition at line 1746 of file winadinf.c.

◆ iface_store_metric()

static BOOL iface_store_metric | ( | const NET_LUID * | luid,
 |  | DWORD | metric,
 |  | int | family
 | ) |  |
static

Definition at line 1728 of file winadinf.c.

◆ internal_print_GetIpForwardTable2()

static ULONG internal_print_GetIpForwardTable2 ( int family )
static

Definition at line 2695 of file winadinf.c.

◆ load_dlls()

static BOOL load_dlls ( void )
static

Definition at line 434 of file winadinf.c.

◆ pkt_win_exit()

static void W32_CALL pkt_win_exit ( void )
static

Definition at line 460 of file winadinf.c.

◆ pkt_win_get_verbose_level()

int W32_CALL pkt_win_get_verbose_level ( void )

Definition at line 4142 of file winadinf.c.

◆ pkt_win_init()

static BOOL pkt_win_init ( void )
static

Definition at line 476 of file winadinf.c.

◆ print_auth_pairs()

static void print_auth_pairs | ( | const WLAN_AUTH_CIPHER_PAIR_LIST2 * | auth_list,
 |  | int | indent
 | ) |  |
static

Definition at line 3738 of file winadinf.c.

◆ print_blob()

static void print_blob ( const BLOB * blob )
static

Definition at line 3855 of file winadinf.c.

◆ print_bw_estimate()

static void print_bw_estimate | ( | const char * | what,
 |  | LONG64 | Bps,
 |  | int | indent
 | ) |  |
static

Definition at line 3997 of file winadinf.c.

◆ print_ip_interface_details()

static void print_ip_interface_details | ( | const NET_LUID * | luid,
 |  | int | family,
 |  | int | indent
 | ) |  |
static

Definition at line 1956 of file winadinf.c.

◆ print_mib_if_row()

static void print_mib_if_row | ( | DWORD | index,
 |  | const MIB_IFROW * | row
 | ) |  |
static

Definition at line 1920 of file winadinf.c.

◆ print_mib_if_row2()

static void print_mib_if_row2 | ( | DWORD | index,
 |  | const MIB_IF_ROW2 * | row
 | ) |  |
static

Definition at line 2050 of file winadinf.c.

◆ print_mib_ipforward_row2()

static void print_mib_ipforward_row2 | ( | DWORD | index,
 |  | const MIB_IPFORWARD_ROW2 * | row,
 |  | int | family
 | ) |  |
static

Definition at line 2623 of file winadinf.c.

◆ print_mib_ipnet_row2()

static void print_mib_ipnet_row2 | ( | DWORD | index,
 |  | const MIB_IPNET_ROW2 * | row
 | ) |  |
static

Definition at line 3790 of file winadinf.c.

◆ print_mib_ipnetrow()

static void print_mib_ipnetrow | ( | DWORD | index,
 |  | const MIB_IPNETROW * | row
 | ) |  |
static

Definition at line 3775 of file winadinf.c.

◆ print_net_luid()

static void print_net_luid | ( | const NET_LUID * | luid,
 |  | int | indent
 | ) |  |
static

Definition at line 4017 of file winadinf.c.

◆ print_radio_state()

static void print_radio_state | ( | const WLAN_RADIO_STATE * | rs,
 |  | int | indent
 | ) |  |
static

Definition at line 3753 of file winadinf.c.

◆ print_skipped()

static void print_skipped ( void )
static

Definition at line 1059 of file winadinf.c.

◆ print_wlan_bss_list()

static void print_wlan_bss_list ( const WLAN_BSS_LIST * bss_list )
static

Definition at line 3681 of file winadinf.c.

◆ print_wlan_current_connection()

static void print_wlan_current_connection | ( | const WLAN_CONNECTION_ATTRIBUTES * | attr,
 |  | int | indent
 | ) |  |
static

Definition at line 3413 of file winadinf.c.

◆ print_wlan_networklist()

static void print_wlan_networklist ( const WLAN_AVAILABLE_NETWORK_LIST * wlist )
static

Definition at line 3355 of file winadinf.c.

◆ print_wlan_stats()

static void print_wlan_stats | ( | const WLAN_STATISTICS * | stats,
 |  | int | indent
 | ) |  |
static

Definition at line 3469 of file winadinf.c.

◆ print_wlan_svc_guid_list()

static void print_wlan_svc_guid_list ( const WLAN_DEVICE_SERVICE_GUID_LIST2 * list )
static

Definition at line 3085 of file winadinf.c.

◆ ras_strerror()

static const char * ras_strerror ( DWORD err )
static

Definition at line 2750 of file winadinf.c.

◆ reg_type_name()

static const char * reg_type_name ( DWORD type )
static

Definition at line 907 of file winadinf.c.

◆ setup_info_adapter_print()

static void setup_info_adapter_print ( const char * adapter_name )
static

Walk the 'setup_info' array looking for a 'inf->NetCfgInstanceId == adapter_name' (there can be only one).

Print some details for this physical adapter.

For a software adapter (like the "Loopback" or a "QoS Packet Scheduler") all these will be "<unknown>" or "SWD\xx".

For physical adapters, the DeviceInstanceID starts with "PCI\\"</tt> or <tt>"USB\"

Definition at line 851 of file winadinf.c.

◆ setup_info_dump()

static void setup_info_dump ( void )
static

Definition at line 816 of file winadinf.c.

◆ setup_info_free()

static void setup_info_free ( void )
static

Definition at line 885 of file winadinf.c.

◆ setup_info_get()

static void setup_info_get ( void )
static

Definition at line 769 of file winadinf.c.

◆ setup_info_populate()

static int setup_info_populate | ( | const char * | key_name,
 |  | struct setup_info_st * | info
 | ) |  |
static

Definition at line 921 of file winadinf.c.

◆ skip_filter_iface()

static BOOL skip_filter_iface | ( | const BYTE * | descr_a,
 |  | const wchar_t * | descr_w
 | ) |  |
static

Definition at line 1111 of file winadinf.c.

◆ skip_this_iface()

static BOOL skip_this_iface | ( | const IP_ADAPTER_ADDRESSES * | addr,
 |  | const MIB_IFROW * | if_row,
 |  | const void * | _if_row2
 | ) |  |
static

Definition at line 1072 of file winadinf.c.

◆ socket_addr_str()

static const char * socket_addr_str ( const SOCKET_ADDRESS * addr )
static

Definition at line 1567 of file winadinf.c.

◆ socket_addr_str2()

static const char * socket_addr_str2 ( const SOCKET_ADDRESS * addr )
static

Definition at line 1589 of file winadinf.c.

◆ speed64_string()

static const char * speed64_string | ( | ULONG64 | val,
 |  | char * | buf
 | ) |  |
static

Return a number with a suitable suffix for a link-speed of a 64-bit value.

Assume the given buf is at lest 30 bytes.

Definition at line 709 of file winadinf.c.

References speed_string().

◆ speed_string()

static const char * speed_string | ( | DWORD | val,
 |  | char * | buf
 | ) |  |
static

Return a number with suffix for a link-speed 32-bit value.

Assume the given buf is at lest 30 bytes.

Definition at line 674 of file winadinf.c.

◆ strip_end()

static char * strip_end | ( | char * | buf,
 |  | char | ch
 | ) |  |
static

Definition at line 574 of file winadinf.c.

◆ UnpackHostEnt()

static void UnpackHostEnt ( struct hostent * hostent )
static

Definition at line 3844 of file winadinf.c.

◆ wlan_query()

static BOOL wlan_query | ( | HANDLE | client,
 |  | const GUID * | guid,
 |  | WLAN_INTF_OPCODE | opcode,
 |  | size_t | data_size,
 |  | void * | data
 | ) |  |
static

Definition at line 3054 of file winadinf.c.

Variable Documentation

◆ _w32_errno

W32_DATA int _w32_errno

Definition at line 346 of file winadinf.c.

◆ access_types

const struct search_list access_types[]
static
Initial value:
= {
{ NET_IF_ACCESS_LOOPBACK, "Loopback" },
{ NET_IF_ACCESS_BROADCAST, "Broadcast" },
{ NET_IF_ACCESS_POINT_TO_POINT, "Point-to-point" },
{ NET_IF_ACCESS_POINT_TO_MULTI_POINT, "Point-to-Multipoint" }
}

Definition at line 1425 of file winadinf.c.

◆ arp_types

const struct search_list arp_types[]
static
Initial value:
= {
{ MIB_IPNET_TYPE_OTHER, "Other" },
{ MIB_IPNET_TYPE_INVALID, "Invalid" },
{ MIB_IPNET_TYPE_DYNAMIC, "Dynamic" },
{ MIB_IPNET_TYPE_STATIC, "Static" }
}

Definition at line 1357 of file winadinf.c.

◆ auth_data

const struct search_list auth_data[]
static
Initial value:
= {
{ 0, NONE_STR },
{ RASLCPAD_CHAP_MD5, "CHAP MD5" },
{ RASLCPAD_CHAP_MS, "Microsoft CHAP" },
{ RASLCPAD_CHAP_MSV2, "Microsoft CHAP v2" }
}

Definition at line 2775 of file winadinf.c.

◆ auth_proto

const struct search_list auth_proto[]
static
Initial value:
= {
{ 0, NONE_STR },
{ RASLCPAP_PAP, "PAP" },
{ RASLCPAP_SPAP, "Shiva" },
{ RASLCPAP_CHAP, "CHAP" },
{ RASLCPAP_EAP, "EAP" }
}

Definition at line 2767 of file winadinf.c.

◆ bss_types

const struct search_list bss_types[]
static
Initial value:
= {
{ dot11_BSS_type_infrastructure, "Infrastructure" },
{ dot11_BSS_type_independent, "Ad-hoc" }
}

Definition at line 3282 of file winadinf.c.

◆ ch_mapping24

const struct search_list ch_mapping24[]
static
Initial value:
= {
{ 2412, "1", },
{ 2417, "2", },
{ 2422, "3", },
{ 2427, "4", },
{ 2432, "5", },
{ 2437, "6", },
{ 2442, "7", },
{ 2447, "8", },
{ 2452, "9", },
{ 2457, "10", },
{ 2462, "11", },
{ 2467, "12", },
{ 2472, "13", },
{ 2484, "14" }
}

Definition at line 3518 of file winadinf.c.

◆ ch_mapping50

const struct search_list ch_mapping50[]
static

Definition at line 3534 of file winadinf.c.

◆ compression

const struct search_list compression[]
static
Initial value:
= {
{ 0, "<None>" },
{ RASCCPCA_MPPC, "MPPC" },
{ RASCCPCA_STAC, "STAC" }
}

Definition at line 2782 of file winadinf.c.

◆ conn_type

const struct search_list conn_type[]
static
Initial value:
= {
{ 0, "Unknown" },
{ NET_IF_CONNECTION_DEDICATED, "Dedicated" },
{ NET_IF_CONNECTION_PASSIVE, "Passive" },
{ NET_IF_CONNECTION_DEMAND, "Demand" }
}

Definition at line 1378 of file winadinf.c.

◆ data

__in WORD __inout WSADATA* data

Definition at line 144 of file winadinf.c.

◆ dot11_auth_algo

const struct search_list dot11_auth_algo[]
static
Initial value:
= {
{ DOT11_AUTH_ALGO_80211_OPEN, "802.11 Open" },
{ DOT11_AUTH_ALGO_80211_SHARED_KEY, "802.11 Shared" },
{ DOT11_AUTH_ALGO_WPA, "WPA" },
{ DOT11_AUTH_ALGO_WPA_PSK, "WPA-PSK" },
{ DOT11_AUTH_ALGO_WPA_NONE, "WPA-None" },
{ DOT11_AUTH_ALGO_RSNA, "RSNA" },
{ DOT11_AUTH_ALGO_RSNA_PSK, "RSNA with PSK (WEP2)" }
}

Definition at line 3261 of file winadinf.c.

◆ dot11_cipher_algo

const struct search_list dot11_cipher_algo[]
static
Initial value:
= {
{ DOT11_CIPHER_ALGO_NONE, "None" },
{ DOT11_CIPHER_ALGO_WEP40, "WEP-40" },
{ DOT11_CIPHER_ALGO_TKIP, "TKIP" },
{ DOT11_CIPHER_ALGO_CCMP, "CCMP" },
{ DOT11_CIPHER_ALGO_WEP104, "WEP-104" },
{ DOT11_CIPHER_ALGO_WPA_USE_GROUP, "WPA-Group" },
{ DOT11_CIPHER_ALGO_RSN_USE_GROUP, "RSN-Group" },
{ DOT11_CIPHER_ALGO_WEP, "WEP" }
}

Definition at line 3271 of file winadinf.c.

◆ dot11_phy_types

const struct search_list dot11_phy_types[]
static
Initial value:
= {
{ dot11_phy_type_any , "ANY" },
{ dot11_phy_type_fhss, "FHSS" },
{ dot11_phy_type_dsss, "DSSS" },
{ dot11_phy_type_irbaseband, "Infrared" },
{ dot11_phy_type_ofdm, "OFDM" },
{ dot11_phy_type_hrdsss, "HRDSSS" },
{ dot11_phy_type_erp, "802.11g" },
{ dot11_phy_type_ht, "802.11n" },
{ 8, "802.11ac" }
}

Definition at line 3287 of file winadinf.c.

◆ dyn_funcs2

struct LoadTable dyn_funcs2[]
static

Definition at line 387 of file winadinf.c.

◆ if_types

const struct search_list if_types[]
static

Definition at line 1134 of file winadinf.c.

◆ ipv4_only_iface

BOOL ipv4_only_iface = TRUE
static

Definition at line 379 of file winadinf.c.

◆ luid_metrics

luid_metrics

Definition at line 1724 of file winadinf.c.

◆ media_types

const struct search_list media_types[]
static
Initial value:
= {
{ NdisMedium802_3, "Ethernet 802.3" },
{ NdisMedium802_5, "TokenRing" },
{ NdisMediumFddi, "FDDI" },
{ NdisMediumWan, "WAN" },
{ NdisMediumLocalTalk, "LocalTalk" },
{ NdisMediumDix, "DIX" },
{ NdisMediumArcnetRaw, "ARCNET" },
{ NdisMediumArcnet878_2, "ARCNET (878.2)" },
{ NdisMediumAtm, "ATM" },
{ NdisMediumWirelessWan, "WWAN" },
{ NdisMediumIrda, "IrDA" },
{ NdisMediumBpc, "Broadcast PC" },
{ NdisMediumCoWan, "CoWan" },
{ NdisMedium1394, "IEEE 1394" },
{ NdisMediumInfiniBand, "InfiniBand" },
{ NdisMediumTunnel, "Tunnel" },
{ NdisMediumNative802_11, "IEEE 802.11" },
{ NdisMediumLoopback, "Loopback" },
{ NdisMediumWiMAX, "WiMax" },
{ NdisMediumIP, "IP" }
}

Definition at line 1402 of file winadinf.c.

◆ metrics_cache

struct luid_metrics metrics_cache[40]
static

Definition at line 1726 of file winadinf.c.

◆ mib_oper_status

const struct search_list mib_oper_status[]
static
Initial value:
= {
{ IF_OPER_STATUS_NON_OPERATIONAL, "disabled" },
{ IF_OPER_STATUS_UNREACHABLE, "WAN not connected" },
{ IF_OPER_STATUS_DISCONNECTED, "disconnected/no carrier" },
{ IF_OPER_STATUS_CONNECTING, "WAN connecting" },
{ IF_OPER_STATUS_CONNECTED, "WAN connected" },
{ IF_OPER_STATUS_OPERATIONAL, "LAN okay" }
}

Definition at line 1338 of file winadinf.c.

◆ neighbour_states

const struct search_list neighbour_states[]
static
Initial value:
= {
{ NlnsUnreachable, "Unreachable" },
{ NlnsIncomplete, "Incomplete" },
{ NlnsProbe, "Probe" },
{ NlnsDelay, "Delay" },
{ 4, "Stale" },
{ NlnsReachable, "Reachable" },
{ NlnsPermanent, "Permanent" }
}

Definition at line 1364 of file winadinf.c.

◆ num_ifaces_filtered

int num_ifaces_filtered = 0
static

Definition at line 1057 of file winadinf.c.

◆ num_ifaces_not_up

int num_ifaces_not_up = 0
static

Definition at line 1056 of file winadinf.c.

◆ num_ifaces_skipped

int num_ifaces_skipped = 0
static

Definition at line 1055 of file winadinf.c.

◆ oper_status

const struct search_list oper_status[]
static
Initial value:
= {
{ IfOperStatusUp, "Up" },
{ IfOperStatusDown, "Down" },
{ IfOperStatusTesting, "Testing" },
{ IfOperStatusUnknown, "Unknown" },
{ IfOperStatusDormant, "Dormant" },
{ IfOperStatusNotPresent, "Not present" },
{ IfOperStatusLowerLayerDown, "Lower layer down" }
}

Definition at line 1347 of file winadinf.c.

◆ setup_info

struct setup_info_st setup_info[50]
static

Definition at line 369 of file winadinf.c.

◆ tunnel_types

const struct search_list tunnel_types[]
static
Initial value:
= {
{ TUNNEL_TYPE_NONE, "None" },
{ TUNNEL_TYPE_OTHER, "Other" },
{ TUNNEL_TYPE_DIRECT, "Direct" },
{ TUNNEL_TYPE_6TO4, "6to4" },
{ TUNNEL_TYPE_ISATAP, "ISATAP" },
{ TUNNEL_TYPE_TEREDO, "Teredo" }
}

Definition at line 1393 of file winadinf.c.

◆ verbose_level

int verbose_level = 0
static

Definition at line 381 of file winadinf.c.

◆ version

__in WORD version

Definition at line 143 of file winadinf.c.

◆ wlan_conn_mode

const struct search_list wlan_conn_mode[]
static
Initial value:
= {
{ wlan_connection_mode_profile, "Profile" },
{ wlan_connection_mode_temporary_profile, "Temporary profile" },
{ wlan_connection_mode_discovery_secure, "Secure discovery" },
{ wlan_connection_mode_discovery_unsecure, "Unsecure discovery" },
{ wlan_connection_mode_auto, "Auto" },
{ wlan_connection_mode_invalid, "N/A" }
}

Definition at line 3032 of file winadinf.c.

◆ wlan_intf_state

const struct search_list wlan_intf_state[]
static
Initial value:
= {
{ wlan_interface_state_not_ready, "Not ready" },
{ wlan_interface_state_connected, "Connected" },
{ wlan_interface_state_ad_hoc_network_formed, "First node in a Ad Hoc network" },
{ wlan_interface_state_disconnecting, "Disconnecting" },
{ wlan_interface_state_disconnected, "Disconnected" },
{ wlan_interface_state_associating, "Attempting to associate with a network" },
{ wlan_interface_state_discovering, "Auto configuration is discovering settings for the network" },
{ wlan_interface_state_authenticating, "Authenticating in process" },
}

Definition at line 3021 of file winadinf.c.

◆ wlan_radio_states

const struct search_list wlan_radio_states[]
static
Initial value:
= {
{ dot11_radio_state_unknown, "Unknown" },
{ dot11_radio_state_on, "On" },
{ dot11_radio_state_off, "Off" }
}

Definition at line 3041 of file winadinf.c.

◆ work_buf

char work_buf[10000]
static

Definition at line 380 of file winadinf.c.

◆ WSAStartup

WSAStartup

Definition at line 143 of file winadinf.c.

◆ wsock_err_tab

const struct search_list wsock_err_tab[]
static
Initial value:
= {
{ 10004, "Call interrupted" },
}

Definition at line 513 of file winadinf.c.


Watt-32 tcp/ip: E:/WATT/src/winadinf.h File Reference

  • src
Data Structures | Typedefs | Enumerations | Functions
winadinf.h File Reference

Go to the source code of this file.

Data Structures

struct | MIB_IPNETROW
struct | MIB_IPNETTABLE
struct | _MIB_IF_ROW2
struct | _MIB_IF_TABLE2
struct | _DOT11_SSID
struct | _WLAN_INTERFACE_CAPABILITY
struct | _WLAN_INTERFACE_INFO
struct | _WLAN_INTERFACE_INFO_LIST
struct | _WLAN_MAC_FRAME_STATISTICS
struct | _WLAN_PHY_FRAME_STATISTICS
struct | _WLAN_STATISTICS
struct | _WLAN_ASSOCIATION_ATTRIBUTES
struct | _WLAN_SECURITY_ATTRIBUTES
struct | _WLAN_RATE_SET
struct | _DOT11_AUTH_CIPHER_PAIR
struct | _WLAN_AUTH_CIPHER_PAIR_LIST
struct | _WLAN_CONNECTION_ATTRIBUTES
struct | _WLAN_AVAILABLE_NETWORK
struct | _WLAN_AVAILABLE_NETWORK_LIST
struct | _WLAN_BSS_ENTRY
struct | _WLAN_BSS_LIST
struct | _WSAQuerySetA
struct | WLAN_AUTH_CIPHER_PAIR_LIST2
struct | _WLAN_DEVICE_SERVICE_GUID_LIST2
struct | _MIB_IPNET_ROW2
struct | _MIB_IPINTERFACE_ROW
struct | _MIB_IPFORWARD_ROW2
struct | _MIB_IPNET_TABLE2
struct | _MIB_IPFORWARD_TABLE2
struct | _NL_BANDWIDTH_INFORMATION
struct | _MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES
struct | _WLAN_PHY_RADIO_STATE
struct | _WLAN_RADIO_STATE

Typedefs

typedef enum MIB_IF_TABLE_LEVEL | MIB_IF_TABLE_LEVEL
typedef struct _MIB_IF_ROW2 | MIB_IF_ROW2
typedef struct _MIB_IF_TABLE2 | MIB_IF_TABLE2
typedef enum _NL_NEIGHBOR_STATE | NL_NEIGHBOR_STATE
typedef struct _DOT11_SSID | DOT11_SSID
typedef enum _DOT11_PHY_TYPE | DOT11_PHY_TYPE
typedef enum _DOT11_BSS_TYPE | DOT11_BSS_TYPE
typedef enum _DOT11_AUTH_ALGORITHM | DOT11_AUTH_ALGORITHM
typedef enum _DOT11_CIPHER_ALGORITHM | DOT11_CIPHER_ALGORITHM
typedef UCHAR | DOT11_MAC_ADDRESS[6]
typedef enum _WLAN_CONNECTION_MODE | WLAN_CONNECTION_MODE
typedef enum _WLAN_INTERFACE_TYPE | WLAN_INTERFACE_TYPE
typedef struct _WLAN_INTERFACE_CAPABILITY | WLAN_INTERFACE_CAPABILITY
typedef enum _WLAN_INTERFACE_STATE | WLAN_INTERFACE_STATE
typedef struct _WLAN_INTERFACE_INFO | WLAN_INTERFACE_INFO
typedef struct _WLAN_INTERFACE_INFO_LIST | WLAN_INTERFACE_INFO_LIST
typedef struct _WLAN_MAC_FRAME_STATISTICS | WLAN_MAC_FRAME_STATISTICS
typedef struct _WLAN_PHY_FRAME_STATISTICS | WLAN_PHY_FRAME_STATISTICS
typedef struct _WLAN_STATISTICS | WLAN_STATISTICS
typedef enum _WLAN_INTF_OPCODE | WLAN_INTF_OPCODE
typedef enum _WLAN_OPCODE_VALUE_TYPE | WLAN_OPCODE_VALUE_TYPE
typedef struct _WLAN_ASSOCIATION_ATTRIBUTES | WLAN_ASSOCIATION_ATTRIBUTES
typedef struct _WLAN_SECURITY_ATTRIBUTES | WLAN_SECURITY_ATTRIBUTES
typedef struct _WLAN_RATE_SET | WLAN_RATE_SET
typedef struct _DOT11_AUTH_CIPHER_PAIR | DOT11_AUTH_CIPHER_PAIR
typedef struct _WLAN_AUTH_CIPHER_PAIR_LIST | WLAN_AUTH_CIPHER_PAIR_LIST
typedef struct _WLAN_CONNECTION_ATTRIBUTES | WLAN_CONNECTION_ATTRIBUTES
typedef struct _WLAN_AVAILABLE_NETWORK | WLAN_AVAILABLE_NETWORK
typedef struct _WLAN_AVAILABLE_NETWORK_LIST | WLAN_AVAILABLE_NETWORK_LIST
typedef struct _WLAN_BSS_ENTRY | WLAN_BSS_ENTRY
typedef struct _WLAN_BSS_LIST | WLAN_BSS_LIST
typedef struct _WSAQuerySetA | WSAQUERYSETA
typedef struct _WLAN_DEVICE_SERVICE_GUID_LIST2 | WLAN_DEVICE_SERVICE_GUID_LIST2
typedef struct _MIB_IPNET_ROW2 | MIB_IPNET_ROW2
typedef struct _MIB_IPINTERFACE_ROW | MIB_IPINTERFACE_ROW
typedef struct _MIB_IPFORWARD_ROW2 | MIB_IPFORWARD_ROW2
typedef struct _MIB_IPNET_TABLE2 | MIB_IPNET_TABLE2
typedef struct _MIB_IPFORWARD_TABLE2 | MIB_IPFORWARD_TABLE2
typedef struct _NL_BANDWIDTH_INFORMATION | NL_BANDWIDTH_INFORMATION
typedef struct _MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES | MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES
typedef enum _DOT11_RADIO_STATE | DOT11_RADIO_STATE
typedef struct _WLAN_PHY_RADIO_STATE | WLAN_PHY_RADIO_STATE
typedef struct _WLAN_RADIO_STATE | WLAN_RADIO_STATE

Enumerations

enum MIB_IF_TABLE_LEVEL {
MibIfTableNormal ,
MibIfTableRaw
}
enum _NL_NEIGHBOR_STATE {
NlnsUnreachable ,
NlnsIncomplete ,
NlnsProbe ,
NlnsDelay ,
NlnsStale ,
NlnsReachable ,
NlnsPermanent ,
NlnsMaximum
}
enum _DOT11_PHY_TYPE {
dot11_phy_type_unknown = 0 ,
dot11_phy_type_any = dot11_phy_type_unknown ,
dot11_phy_type_fhss = 1 ,
dot11_phy_type_dsss = 2 ,
dot11_phy_type_irbaseband = 3 ,
dot11_phy_type_ofdm = 4 ,
dot11_phy_type_hrdsss = 5 ,
dot11_phy_type_erp = 6 ,
dot11_phy_type_ht = 7 ,
dot11_phy_type_vht = 8 ,
dot11_phy_type_IHV_start = 0x80000000 ,
dot11_phy_type_IHV_end = 0xFFFFFFFF
}
enum _DOT11_BSS_TYPE {
dot11_BSS_type_infrastructure = 1 ,
dot11_BSS_type_independent = 2 ,
dot11_BSS_type_any = 3
}
enum _DOT11_AUTH_ALGORITHM {
DOT11_AUTH_ALGO_80211_OPEN = 1 ,
DOT11_AUTH_ALGO_80211_SHARED_KEY = 2 ,
DOT11_AUTH_ALGO_WPA = 3 ,
DOT11_AUTH_ALGO_WPA_PSK = 4 ,
DOT11_AUTH_ALGO_WPA_NONE = 5 ,
DOT11_AUTH_ALGO_WPA_RSNA = 6 ,
DOT11_AUTH_ALGO_WPA_RSNA_PSK = 7 ,
DOT11_AUTH_ALGO_IHV_START = 0x80000000 ,
DOT11_AUTH_ALGO_IHV_END = 0xFFFFFFFF
}
enum _DOT11_CIPHER_ALGORITHM {
DOT11_CIPHER_ALGO_NONE = 0x00000000 ,
DOT11_CIPHER_ALGO_WEP40 = 0x00000001 ,
DOT11_CIPHER_ALGO_TKIP = 0x00000002 ,
DOT11_CIPHER_ALGO_CCMP = 0x00000004 ,
DOT11_CIPHER_ALGO_WEP104 = 0x00000005 ,
DOT11_CIPHER_ALGO_WPA_USE_GROUP = 0x00000100 ,
DOT11_CIPHER_ALGO_RSN_USE_GROUP = 0x00000100 ,
DOT11_CIPHER_ALGO_WEP = 0x00000101 ,
DOT11_CIPHER_ALGO_IHV_START = 0x80000000 ,
DOT11_CIPHER_ALGO_IHV_END = 0xFFFFFFFF
}
enum _WLAN_CONNECTION_MODE {
wlan_connection_mode_profile = 0 ,
wlan_connection_mode_temporary_profile ,
wlan_connection_mode_discovery_secure ,
wlan_connection_mode_discovery_unsecure ,
wlan_connection_mode_auto ,
wlan_connection_mode_invalid
}
enum _WLAN_INTERFACE_TYPE {
wlan_interface_type_emulated_802_11 = 0 ,
wlan_interface_type_native_802_11 ,
wlan_interface_type_invalid
}
enum _WLAN_INTERFACE_STATE {
wlan_interface_state_not_ready ,
wlan_interface_state_connected ,
wlan_interface_state_ad_hoc_network_formed ,
wlan_interface_state_disconnecting ,
wlan_interface_state_disconnected ,
wlan_interface_state_associating ,
wlan_interface_state_discovering ,
wlan_interface_state_authenticating
}
enum _WLAN_INTF_OPCODE {
wlan_intf_opcode_autoconf_start = 0x000000000 ,
wlan_intf_opcode_autoconf_enabled ,
wlan_intf_opcode_background_scan_enabled ,
wlan_intf_opcode_media_streaming_mode ,
wlan_intf_opcode_radio_state ,
wlan_intf_opcode_bss_type ,
wlan_intf_opcode_interface_state ,
wlan_intf_opcode_current_connection ,
wlan_intf_opcode_channel_number ,
wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs ,
wlan_intf_opcode_supported_adhoc_auth_cipher_pairs ,
wlan_intf_opcode_supported_country_or_region_string_list ,
wlan_intf_opcode_current_operation_mode ,
wlan_intf_opcode_supported_safe_mode ,
wlan_intf_opcode_certified_safe_mode ,
wlan_intf_opcode_hosted_network_capable ,
wlan_intf_opcode_autoconf_end = 0x0FFFFFFF ,
wlan_intf_opcode_msm_start = 0x10000100 ,
wlan_intf_opcode_statistics ,
wlan_intf_opcode_rssi ,
wlan_intf_opcode_msm_end = 0x1FFFFFFF ,
wlan_intf_opcode_security_start = 0x20010000 ,
wlan_intf_opcode_security_end = 0x2FFFFFFF ,
wlan_intf_opcode_ihv_start = 0x30000000 ,
wlan_intf_opcode_ihv_end = 0x3FFFFFFF
}
enum _WLAN_OPCODE_VALUE_TYPE {
wlan_opcode_value_type_query_only = 0 ,
wlan_opcode_value_type_set_by_group_policy ,
wlan_opcode_value_type_set_by_user ,
wlan_opcode_value_type_invalid
}
enum _DOT11_RADIO_STATE {
dot11_radio_state_unknown ,
dot11_radio_state_on ,
dot11_radio_state_off
}

Functions

int | __scope_id_to_ascii (int scope)
static void | print_wlan_networklist (const WLAN_AVAILABLE_NETWORK_LIST *wlist)
static void | print_wlan_current_connection (const WLAN_CONNECTION_ATTRIBUTES *conn_attr, int indent)
static void | print_wlan_stats (const WLAN_STATISTICS *stats, int indent)
static void | print_radio_state (const WLAN_RADIO_STATE *rs, int indent)
static void | print_auth_pairs (const WLAN_AUTH_CIPHER_PAIR_LIST2 *auth, int indent)
static void | print_mib_ipnetrow (DWORD index, const MIB_IPNETROW *row)
static void | print_mib_ipnet_row2 (DWORD index, const MIB_IPNET_ROW2 *row)
static void | print_mib_ipforward_row2 (DWORD index, const MIB_IPFORWARD_ROW2 *row, int family)
static int | compare_ipnetrow (const void *_a, const void *_b)
static int | compare_ipnetrow2 (const void *_a, const void *_b)
static void | print_mib_if_row (DWORD index, const MIB_IFROW *row)
static void | print_mib_if_row2 (DWORD index, const MIB_IF_ROW2 *row)
static void | print_net_luid (const NET_LUID *luid, int indent)
static const char * | get_best_route2 (IF_LUID *luid, const SOCKADDR_INET *dest)

Detailed Description

Getting IPHlpApi + WLanApi + RasApi Information (Win32/64).

Note
When compiling winadinf.c, this file must not include any conflicting Watt-32 headers. I.e. to get such advanced information about network adapters, only the Win-SDK must be used.
It should be possible to compile this stuff for e.g. Win-Vista even if you run Win-XP SP3. Provided you have an up-to-date Windows SDK. With MSVC, the SDK version can easily be forced using the env-var "CL". E.g. "set CL=-D_WIN32_WINNT=0x601" for Win-Vista. But the generated 'visual-*.mak' and 'clang-*.mak' files have now have a '-D_WIN32_WINNT=0x0601'.

BUT this requires extreme care. The code should check against e.g. '_watt_os_ver >= 0x0601' or 'WINVER' at runtime.

Definition in file winadinf.h.

Typedef Documentation

◆ DOT11_MAC_ADDRESS

typedef UCHAR DOT11_MAC_ADDRESS[6]

Definition at line 412 of file winadinf.h.

Enumeration Type Documentation

◆ _DOT11_AUTH_ALGORITHM

enum _DOT11_AUTH_ALGORITHM

Definition at line 387 of file winadinf.h.

◆ _DOT11_BSS_TYPE

enum _DOT11_BSS_TYPE

Definition at line 381 of file winadinf.h.

◆ _DOT11_CIPHER_ALGORITHM

enum _DOT11_CIPHER_ALGORITHM

Definition at line 399 of file winadinf.h.

◆ _DOT11_PHY_TYPE

enum _DOT11_PHY_TYPE

Definition at line 366 of file winadinf.h.

◆ _DOT11_RADIO_STATE

enum _DOT11_RADIO_STATE

Definition at line 1079 of file winadinf.h.

◆ _NL_NEIGHBOR_STATE

enum _NL_NEIGHBOR_STATE

Definition at line 342 of file winadinf.h.

◆ _WLAN_CONNECTION_MODE

enum _WLAN_CONNECTION_MODE

Definition at line 420 of file winadinf.h.

◆ _WLAN_INTERFACE_STATE

enum _WLAN_INTERFACE_STATE

Definition at line 444 of file winadinf.h.

◆ _WLAN_INTERFACE_TYPE

enum _WLAN_INTERFACE_TYPE

Definition at line 429 of file winadinf.h.

◆ _WLAN_INTF_OPCODE

enum _WLAN_INTF_OPCODE

Definition at line 513 of file winadinf.h.

◆ _WLAN_OPCODE_VALUE_TYPE

enum _WLAN_OPCODE_VALUE_TYPE

Definition at line 541 of file winadinf.h.

◆ MIB_IF_TABLE_LEVEL

enum MIB_IF_TABLE_LEVEL

Definition at line 277 of file winadinf.h.

Function Documentation

◆ __scope_id_to_ascii()

int __scope_id_to_ascii ( int scope )

Definition at line 224 of file get_ai.c.


Watt-32 tcp/ip: E:/WATT/src/winmisc.c File Reference

  • src
Data Structures | Functions | Variables
winmisc.c File Reference

Go to the source code of this file.

Data Structures

struct SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION

Functions

static | void (MS_CDECL *orig_abort_handler)(int)
__declspec (dllimport)
static BOOL | is_gui_app (void)
int MS_CDECL | gui_printf (const char *fmt,...)
static void W32_CALL | win32_exit (void)
char *W32_CALL | win_strerror (DWORD err)
Return err-number and string for 'err'.
BOOL | get_file_version (const char *file_name, char *version_buf, size_t version_buf_len)
Returns the version of a PE image (.sys, .dll or .exe).
static void MS_CDECL | new_abort_handler (int sig)
static void | init_win_abort (void)
static void CALLBACK | pre_err_handler (INT_PTR arg)
static int | init_win_bugtrap (void)
BOOL | init_win_misc (void)
static BOOL | WinDnsQueryCommon (WORD type, const void *what, void *result, size_t size)
BOOL | WinDnsQuery_A4 (const char *name, DWORD *ip)
BOOL | WinDnsQuery_A6 (const char *name, void *ip)
BOOL | WinDnsQuery_PTR4 (DWORD ip, TCHAR *name, size_t size)
BOOL | WinDnsQuery_PTR6 (const void *ip, TCHAR *name, size_t size)
BOOL | WinDnsCachePut_A4 (const char *name, DWORD ip4)
BOOL | WinDnsCachePut_A6 (const char *name, const void *ip6)
int __stdcall | WSAStartup (WORD version_required, WSADATA *wsa_data)
int __stdcall | WSACleanup (void)
int __stdcall | __WSAFDIsSet (int s, winsock_fd_set *fd)
W32_FUNC int __stdcall | _WSAStartup (WORD version_required, WSADATA *wsa_data)
W32_FUNC int __stdcall | _WSACleanup (void)
W32_FUNC int __stdcall | ___WSAFDIsSet (int s, winsock_fd_set *fd)
static BOOL CALLBACK | callback (LPSTR cp)
static void | enum_codepages (void)
__declspec (naked)
static int | is_real_key (const INPUT_RECORD *k)
int W32_NAMESPACE() | kbhit (void)
static int | do_getch (HANDLE h)
int W32_NAMESPACE() | getch (void)
char *W32_NAMESPACE() | itoa (int value, char *buf, int radix)
static double | filetime_sec (const FILETIME *filetime)
void | print_thread_times (HANDLE thread)
void | print_process_times (void)
void | print_perf_times (void)

Variables

CRITICAL_SECTION | _watt_crit_sect
BOOL | _watt_is_win9x = FALSE
BOOL | _watt_is_wow64 = FALSE
BOOL | _watt_use_bugtrap = TRUE
BOOL | _watt_is_gui_app = FALSE
HANDLE | stdin_hnd = INVALID_HANDLE_VALUE
HANDLE | stdout_hnd = INVALID_HANDLE_VALUE
CONSOLE_SCREEN_BUFFER_INFO | console_info

Detailed Description

Various stuff for Windows only.

Copyright (c) 2004 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file winmisc.c.

Function Documentation

◆ ___WSAFDIsSet()

int __stdcall ___WSAFDIsSet | ( | int | s,
 |  | winsock_fd_set * | fd
 | ) |  |

Definition at line 704 of file winmisc.c.

◆ __declspec() [1/2]

__declspec ( dllimport )

Definition at line 96 of file winmisc.c.

◆ __declspec() [2/2]

__declspec ( naked )

Definition at line 730 of file winmisc.c.

◆ __WSAFDIsSet()

int __stdcall __WSAFDIsSet | ( | int | s,
 |  | winsock_fd_set * | fd
 | ) |  |

Definition at line 679 of file winmisc.c.

◆ _WSACleanup()

int __stdcall _WSACleanup ( void )

Definition at line 699 of file winmisc.c.

◆ _WSAStartup()

int __stdcall _WSAStartup | ( | WORD | version_required,
 |  | WSADATA * | wsa_data
 | ) |  |

Definition at line 694 of file winmisc.c.

◆ callback()

static BOOL CALLBACK callback ( LPSTR cp )
static

Definition at line 710 of file winmisc.c.

◆ do_getch()

static int do_getch ( HANDLE h )
static

Definition at line 896 of file winmisc.c.

◆ enum_codepages()

static void enum_codepages ( void )
static

Definition at line 717 of file winmisc.c.

◆ filetime_sec()

static double filetime_sec ( const FILETIME * filetime )
static

Definition at line 975 of file winmisc.c.

◆ get_file_version()

BOOL get_file_version | ( | const char * | file_name,
 |  | char * | version_buf,
 |  | size_t | version_buf_len
 | ) |  |

Returns the version of a PE image (.sys, .dll or .exe).

Definition at line 227 of file winmisc.c.

References win_strerror().

◆ getch()

int W32_NAMESPACE() getch ( void )

Definition at line 916 of file winmisc.c.

◆ gui_printf()

int MS_CDECL gui_printf | ( | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 160 of file winmisc.c.

◆ init_win_abort()

static void init_win_abort ( void )
static

Definition at line 338 of file winmisc.c.

◆ init_win_bugtrap()

static int init_win_bugtrap ( void )
static

Definition at line 367 of file winmisc.c.

◆ init_win_misc()

BOOL init_win_misc ( void )

Definition at line 410 of file winmisc.c.

◆ is_gui_app()

static BOOL is_gui_app ( void )
static

Definition at line 135 of file winmisc.c.

◆ is_real_key()

static int is_real_key ( const INPUT_RECORD * k )
static

Definition at line 852 of file winmisc.c.

◆ itoa()

char *W32_NAMESPACE() itoa | ( | int | value,
 |  | char * | buf,
 |  | int | radix
 | ) |  |

Definition at line 937 of file winmisc.c.

◆ kbhit()

int W32_NAMESPACE() kbhit ( void )

Definition at line 876 of file winmisc.c.

◆ new_abort_handler()

static void MS_CDECL new_abort_handler ( int sig )
static
Todo:
: show a better MessageBox(). Show backtrace from where abort() was called; skip the 2 first CRT locations (raise, abort). Indent the printout 2 spaces.

Definition at line 317 of file winmisc.c.

◆ pre_err_handler()

static void CALLBACK pre_err_handler ( INT_PTR arg )
static

Definition at line 353 of file winmisc.c.

◆ print_perf_times()

void print_perf_times ( void )

Definition at line 1083 of file winmisc.c.

◆ print_process_times()

void print_process_times ( void )

Definition at line 1024 of file winmisc.c.

◆ print_thread_times()

void print_thread_times ( HANDLE thread )

Definition at line 987 of file winmisc.c.

◆ win32_exit()

static void W32_CALL win32_exit ( void )
static

Definition at line 189 of file winmisc.c.

◆ win_strerror()

char *W32_CALL win_strerror ( DWORD err )

Return err-number and string for 'err'.

Only use this with GetLastError(). (or WSAGetLastError() if Winsock is used somehow ... linked dynamically?). Does not handle libc errno's. Remove trailing [\r
.]

Definition at line 208 of file winmisc.c.

◆ WinDnsCachePut_A4()

BOOL WinDnsCachePut_A4 | ( | const char * | name,
 |  | DWORD | ip4
 | ) |  |

Definition at line 602 of file winmisc.c.

◆ WinDnsCachePut_A6()

BOOL WinDnsCachePut_A6 | ( | const char * | name,
 |  | const void * | ip6
 | ) |  |

Definition at line 642 of file winmisc.c.

◆ WinDnsQuery_A4()

BOOL WinDnsQuery_A4 | ( | const char * | name,
 |  | DWORD * | ip
 | ) |  |

Definition at line 543 of file winmisc.c.

◆ WinDnsQuery_A6()

BOOL WinDnsQuery_A6 | ( | const char * | name,
 |  | void * | ip
 | ) |  |

Definition at line 556 of file winmisc.c.

◆ WinDnsQuery_PTR4()

BOOL WinDnsQuery_PTR4 | ( | DWORD | ip,
 |  | TCHAR * | name,
 |  | size_t | size
 | ) |  |

Definition at line 569 of file winmisc.c.

◆ WinDnsQuery_PTR6()

BOOL WinDnsQuery_PTR6 | ( | const void * | ip,
 |  | TCHAR * | name,
 |  | size_t | size
 | ) |  |

Definition at line 583 of file winmisc.c.

◆ WinDnsQueryCommon()

static BOOL WinDnsQueryCommon | ( | WORD | type,
 |  | const void * | what,
 |  | void * | result,
 |  | size_t | size
 | ) |  |
static

Definition at line 469 of file winmisc.c.

◆ WSACleanup()

int __stdcall WSACleanup ( void )

Definition at line 673 of file winmisc.c.

◆ WSAStartup()

int __stdcall WSAStartup | ( | WORD | version_required,
 |  | WSADATA * | wsa_data
 | ) |  |

Definition at line 652 of file winmisc.c.

Variable Documentation

◆ _watt_crit_sect

CRITICAL_SECTION _watt_crit_sect

Definition at line 48 of file winmisc.c.

◆ _watt_is_gui_app

BOOL _watt_is_gui_app = FALSE

Definition at line 52 of file winmisc.c.

◆ _watt_is_win9x

BOOL _watt_is_win9x = FALSE

Process is running under Win9x/ME.

Definition at line 49 of file winmisc.c.

◆ _watt_is_wow64

BOOL _watt_is_wow64 = FALSE

Process is running under WOW64.

Definition at line 50 of file winmisc.c.

◆ _watt_use_bugtrap

BOOL _watt_use_bugtrap = TRUE

Definition at line 51 of file winmisc.c.

◆ console_info

CONSOLE_SCREEN_BUFFER_INFO console_info

Definition at line 57 of file winmisc.c.

◆ stdin_hnd

HANDLE stdin_hnd = INVALID_HANDLE_VALUE

Definition at line 54 of file winmisc.c.

◆ stdout_hnd

HANDLE stdout_hnd = INVALID_HANDLE_VALUE

Definition at line 55 of file winmisc.c.


Watt-32 tcp/ip: E:/WATT/src/winpkt.c File Reference

  • src
Functions | Variables
winpkt.c File Reference

Go to the source code of this file.

Functions

static enum eth_init_result | open_winpcap_adapter (const char *name)
Open the WinPcap or NPcap device by 'name'.
static enum eth_init_result | open_npcap_adapter (const char *name)
Open the NPcap device by 'name'.
static enum eth_init_result | open_win10pcap_adapter (const char *name)
Open the Win10Pcap device by 'name'.
static enum eth_init_result | open_wanpacket_adapter (const char *name)
Open the named WanPacket device.
static enum eth_init_result | open_swsvpkt_adapter (const char *name)
Open the named SwsVpkt device.
static BOOL | get_if_stat_swsvpkt (const void *u, BOOL *is_up)
static BOOL | get_perm_mac_address (void *mac)
static BOOL | get_interface_mtu (DWORD *mtu)
static void | show_link_details (void)
static void | set_txmode (const char *value)
Select async (overlapping) tx-mode.
static void | swsvpkt_callback (struct SwsVpktUsr *usr, const void *buf, unsigned len)
Our low-level SwsVpkt receive callback.
static DWORD __stdcall | winpcap_recv_thread (void *arg)
Our low-level WinPcap capture thread.
void | winpkt_trace (const char *fmt,...)
void | winpkt_trace_fclose (void)
static BOOL | parse_config_pass_1 (void)
WATTCP.CFG parser for "WINPKT." keywords in WATTCP.CFG.
static BOOL | find_winpcap_adapter (char *aname, size_t size)
Traverse 'adapters_list' and select 1st device with an IPv4 address.
static BOOL | find_swsvpkt_adapter (char *aname, size_t size)
static BOOL | find_adapter (char *aname, size_t size)
Search for the first proper WinPcap or SwsVpkt device.
static BOOL | legal_recv_mode (WORD bits)
Check receive-mode 'bits' for an illegal bit by turning all legal bits off.
int W32_CALL | pkt_eth_init (mac_address *mac_addr)
Initialise one of WinPcap, SwsVpkt, Win10Pcap, NPcap or WanPacket and return our MAC address.
int W32_CALL | pkt_release (void)
int W32_CALL | pkt_get_addr (mac_address *eth)
Return the MAC address.
int W32_CALL | pkt_set_addr (const void *eth)
Set a new MAC source address.
BOOL W32_CALL | pkt_is_init (void)
BOOL W32_CALL | pkt_check_address (DWORD my_ip)
int W32_CALL | pkt_buf_wipe (void)
Clear the receive queue.
int W32_CALL | pkt_waiting (void)
Return number of packets waiting in queue.
void W32_CALL | pkt_free_pkt (const void *pkt)
Release a packet from the receive queue.
struct pkt_rx_element * | pkt_poll_recv (void)
int W32_CALL | pkt_send (const void *tx, int length)
Send a link-layer frame.
int W32_CALL | pkt_set_rcv_mode (int mode)
Sets the receive mode of the interface.
int W32_CALL | pkt_get_rcv_mode (void)
Gets the receive mode of the interface (can never be mode 0).
static BOOL | get_stats_pcap (const void *a, struct PktStats *stats, struct PktStats *total)
static BOOL | get_stats_swsvpkt (const void *usr, struct PktStats *stats, struct PktStats *total)
int W32_CALL | pkt_get_stats (struct PktStats *stats, struct PktStats *total)
Get PKTDRVR statistics.
DWORD W32_CALL | pkt_dropped (void)
Return number of packets dropped.
int W32_CALL | pkt_get_mtu (void)
Return PKTDRVR maximum-transmit-units (MTU).
const char *W32_CALL | pkt_strerror (int code)
Return textual error representing error-code.
int | pkt_get_multicast_list (mac_address *listbuf, int *len)
Gets the current list of multicast addresses from the PKTDRVR.
int | pkt_set_multicast_list (const void *listbuf, int len)
Sets the list of multicast addresses for which the PKTDRVR is responsible.
static BOOL | get_if_mtu_pcap (const void *a, DWORD *mtu)
static BOOL | get_if_mtu_generic (const void *a, DWORD *mtu)
static BOOL | get_if_type_pcap (const void *a, WORD *type)
static BOOL | get_if_type_swsvpkt (const void *u, WORD *type)
static BOOL | get_descr_pcap (const void *a, char *buf, size_t max)
static BOOL | get_descr_swsvpkt (const void *u, char *buf, size_t max)
static BOOL | get_if_speed_pcap (const void *a, DWORD *Mbit_s)
static BOOL | get_interface_speed (DWORD *speed)
static BOOL | get_phys_media (int *media)
static BOOL | get_if_stat_pcap (const void *a, BOOL *is_up)
static BOOL | ndis_set_loopback (BOOL enable)
int W32_CALL | pkt_get_api_ver (WORD *ver_p)
Return version of spec.
int W32_CALL | pkt_get_drvr_ver (WORD *major, WORD *minor, WORD *unused, WORD *build)
Return version of PKTDRVR.
const char *W32_CALL | pkt_get_drvr_name (void)
const char *W32_CALL | pkt_get_device_name (void)
const char *W32_CALL | pkt_get_drvr_descr (void)
W32_FUNC WORD W32_CALL | pkt_get_drvr_class (void)

Variables

WORD | _pktdevclass = PDCLASS_UNKNOWN
WORD | _pkt_ip_ofs = 0
BOOL | _pktserial = FALSE
int | _pkt_errno = 0
int | _pkt_rxmode = RXMODE_DEFAULT
active receive mode
int | _pkt_rxmode0 = -1
startup receive mode
int | _pkt_forced_rxmode = -1
wattcp.cfg receive mode
char | _pktdrvrname [MAX_VALUELEN+1] = ""
char | _pktdrvr_descr [MAX_VALUELEN+1] = ""
struct pkt_info * | _pkt_inf = NULL
module data that will be locked
static int | pkt_num_rx_bufs = RX_BUFS
static DWORD | num_tx_pkt = 0UL
static DWORD | num_tx_bytes = 0UL
static DWORD | num_tx_errors = 0UL
static DWORD | num_rx_pkt = 0UL
static DWORD | num_rx_bytes = 0UL
static DWORD | pkt_drop_cnt = 0UL
static int | pkt_txretries = 2
static int | thr_realtime = 0
static BOOL | thr_stopped = FALSE
static BOOL | config_pass_1_done = FALSE
static char | dump_fname [MAX_PATHLEN] = "$(TEMP)\\winpkt_dump.txt"
static const struct search_list | logical_media []
static const struct search_list | phys_media []
const char * | winpkt_trace_func
const char * | winpkt_trace_file
UINT | winpkt_trace_line
UINT | winpkt_trace_level = 0
static FILE * | trace_file

Detailed Description

Packet-driver like interface to WinPcap and SwsVpkt.

Copyright (c) 2004-2006 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file winpkt.c.

Function Documentation

◆ find_adapter()

static BOOL find_adapter | ( | char * | aname,
 |  | size_t | size
 | ) |  |
static

Search for the first proper WinPcap or SwsVpkt device.

Only called if user didn't specify a device in WATTCP.CFG (with "winpkt.device").

Definition at line 327 of file winpkt.c.

References _eth_SwsVpkt, _eth_win10pcap, _eth_winpcap, and find_winpcap_adapter().

◆ find_swsvpkt_adapter()

static BOOL find_swsvpkt_adapter | ( | char * | aname,
 |  | size_t | size
 | ) |  |
static

Definition at line 294 of file winpkt.c.

◆ find_winpcap_adapter()

static BOOL find_winpcap_adapter | ( | char * | aname,
 |  | size_t | size
 | ) |  |
static

Traverse 'adapters_list' and select 1st device with an IPv4 address.

Assuming that device is a physical adapter we can use.

Definition at line 268 of file winpkt.c.

References _strlcpy().

◆ get_descr_pcap()

static BOOL get_descr_pcap | ( | const void * | a,
 |  | char * | buf,
 |  | size_t | max
 | ) |  |
static

Definition at line 1291 of file winpkt.c.

◆ get_descr_swsvpkt()

static BOOL get_descr_swsvpkt | ( | const void * | u,
 |  | char * | buf,
 |  | size_t | max
 | ) |  |
static

Definition at line 1309 of file winpkt.c.

◆ get_if_mtu_generic()

static BOOL get_if_mtu_generic | ( | const void * | a,
 |  | DWORD * | mtu
 | ) |  |
static

Definition at line 1246 of file winpkt.c.

◆ get_if_mtu_pcap()

static BOOL get_if_mtu_pcap | ( | const void * | a,
 |  | DWORD * | mtu
 | ) |  |
static

Definition at line 1228 of file winpkt.c.

◆ get_if_speed_pcap()

static BOOL get_if_speed_pcap | ( | const void * | a,
 |  | DWORD * | Mbit_s
 | ) |  |
static

Definition at line 1314 of file winpkt.c.

◆ get_if_stat_pcap()

static BOOL get_if_stat_pcap | ( | const void * | a,
 |  | BOOL * | is_up
 | ) |  |
static

Definition at line 1364 of file winpkt.c.

◆ get_if_stat_swsvpkt()

static BOOL get_if_stat_swsvpkt | ( | const void * | u,
 |  | BOOL * | is_up
 | ) |  |
static

Definition at line 1382 of file winpkt.c.

◆ get_if_type_pcap()

static BOOL get_if_type_pcap | ( | const void * | a,
 |  | WORD * | type
 | ) |  |
static

Definition at line 1261 of file winpkt.c.

◆ get_if_type_swsvpkt()

static BOOL get_if_type_swsvpkt | ( | const void * | u,
 |  | WORD * | type
 | ) |  |
static
Todo:
Fix me

Definition at line 1279 of file winpkt.c.

◆ get_interface_mtu()

static BOOL get_interface_mtu ( DWORD * mtu )
static

Definition at line 1254 of file winpkt.c.

◆ get_interface_speed()

static BOOL get_interface_speed ( DWORD * speed )
static

Definition at line 1334 of file winpkt.c.

◆ get_perm_mac_address()

static BOOL get_perm_mac_address ( void * mac )
static

Definition at line 1220 of file winpkt.c.

◆ get_phys_media()

static BOOL get_phys_media ( int * media )
static

Definition at line 1341 of file winpkt.c.

◆ get_stats_pcap()

static BOOL get_stats_pcap | ( | const void * | a,
 |  | struct PktStats * | stats,
 |  | struct PktStats * | total
 | ) |  |
static

Definition at line 1075 of file winpkt.c.

◆ get_stats_swsvpkt()

static BOOL get_stats_swsvpkt | ( | const void * | usr,
 |  | struct PktStats * | stats,
 |  | struct PktStats * | total
 | ) |  |
static

Definition at line 1140 of file winpkt.c.

◆ legal_recv_mode()

static BOOL legal_recv_mode ( WORD bits )
static

Check receive-mode 'bits' for an illegal bit by turning all legal bits off.

Definition at line 358 of file winpkt.c.

References RXMODE_ALL_LOCAL, RXMODE_BROADCAST, RXMODE_DIRECT, RXMODE_MULTICAST1, RXMODE_MULTICAST2, RXMODE_OFF, and RXMODE_PROMISCOUS.

◆ ndis_set_loopback()

static BOOL ndis_set_loopback ( BOOL enable )
static

Definition at line 1403 of file winpkt.c.

◆ open_npcap_adapter()

static enum eth_init_result open_npcap_adapter ( const char * name )
static

Open the NPcap device by 'name'.

Definition at line 1579 of file winpkt.c.

References _pkt_errno, _pkt_inf, and win_strerror().

◆ open_swsvpkt_adapter()

static enum eth_init_result open_swsvpkt_adapter ( const char * name )
static

Open the named SwsVpkt device.

Definition at line 1681 of file winpkt.c.

References _pkt_errno, _pkt_inf, get_if_type_swsvpkt(), swsvpkt_callback(), and win_strerror().

◆ open_wanpacket_adapter()

static enum eth_init_result open_wanpacket_adapter ( const char * name )
static

Open the named WanPacket device.

<

Todo:

Definition at line 1649 of file winpkt.c.

References _pkt_errno, and _pkt_inf.

◆ open_win10pcap_adapter()

static enum eth_init_result open_win10pcap_adapter ( const char * name )
static

Open the Win10Pcap device by 'name'.

Definition at line 1614 of file winpkt.c.

References _pkt_errno, _pkt_inf, and win_strerror().

◆ open_winpcap_adapter()

static enum eth_init_result open_winpcap_adapter ( const char * name )
static

Open the WinPcap or NPcap device by 'name'.

Definition at line 1544 of file winpkt.c.

References _pkt_errno, _pkt_inf, and win_strerror().

◆ parse_config_pass_1()

static BOOL parse_config_pass_1 ( void )
static

WATTCP.CFG parser for "WINPKT." keywords in WATTCP.CFG.

Definition at line 238 of file winpkt.c.

References _pkt_forced_rxmode, ARG_ATOB, ARG_ATOI, ARG_ATOX_W, ARG_FUNC, ARG_STRCPY, and set_txmode().

◆ pkt_buf_wipe()

int W32_CALL pkt_buf_wipe ( void )

Clear the receive queue.

Definition at line 715 of file winpkt.c.

References _pkt_inf.

◆ pkt_check_address()

BOOL W32_CALL pkt_check_address ( DWORD my_ip )

Definition at line 693 of file winpkt.c.

◆ pkt_dropped()

DWORD W32_CALL pkt_dropped ( void )

Return number of packets dropped.

Definition at line 1162 of file winpkt.c.

References _pkt_inf, and pkt_ringbuf::num_drop.

◆ pkt_eth_init()

int W32_CALL pkt_eth_init ( mac_address * mac_addr )

Initialise one of WinPcap, SwsVpkt, Win10Pcap, NPcap or WanPacket and return our MAC address.

Initialise Packet driver interface.

Definition at line 388 of file winpkt.c.

References _eth_SwsVpkt, _eth_wanpacket, _eth_win10pcap, _eth_winpcap, _pkt_errno, _pkt_forced_rxmode, _pkt_inf, _pkt_ip_ofs, _pkt_rxmode, _pkt_rxmode0, _pktdevclass, _strlcpy(), _watt_is_win9x, _watt_no_config, expand_var_str(), find_adapter(), fopen_excl(), legal_recv_mode(), open_swsvpkt_adapter(), open_wanpacket_adapter(), open_win10pcap_adapter(), open_winpcap_adapter(), parse_config_pass_1(), pkt_get_addr(), pkt_get_rcv_mode(), pkt_release(), pkt_set_rcv_mode(), strrtrim(), win_strerror(), and winpcap_recv_thread().

◆ pkt_free_pkt()

void W32_CALL pkt_free_pkt ( const void * pkt )

Release a packet from the receive queue.

If USE_FAST_PKT, pkt has already been free'd. Just update drop count.

Definition at line 729 of file winpkt.c.

References _pkt_inf, _pkt_ip_ofs, and pkt_ringbuf::num_drop.

◆ pkt_get_addr()

int W32_CALL pkt_get_addr ( mac_address * eth )

Return the MAC address.

Definition at line 663 of file winpkt.c.

References win_strerror().

◆ pkt_get_api_ver()

int W32_CALL pkt_get_api_ver ( WORD * ver_p )

Return version of spec.

this PKTDRVR conforms to.

Return values
-1 on error. Return major version in upper 8 bit, minor in lower.

Definition at line 1452 of file winpkt.c.

References _eth_SwsVpkt, _eth_win10pcap, _eth_winpcap, and _pkt_inf.

◆ pkt_get_device_name()

const char *W32_CALL pkt_get_device_name ( void )

Definition at line 1520 of file winpkt.c.

◆ pkt_get_drvr_class()

W32_FUNC WORD W32_CALL pkt_get_drvr_class ( void )

Definition at line 1536 of file winpkt.c.

◆ pkt_get_drvr_descr()

const char *W32_CALL pkt_get_drvr_descr ( void )

Definition at line 1528 of file winpkt.c.

◆ pkt_get_drvr_name()

const char *W32_CALL pkt_get_drvr_name ( void )

Definition at line 1510 of file winpkt.c.

◆ pkt_get_drvr_ver()

int W32_CALL pkt_get_drvr_ver | ( | WORD * | major,
 |  | WORD * | minor,
 |  | WORD * | unused,
 |  | WORD * | build
 | ) |  |

Return version of PKTDRVR.

Definition at line 1494 of file winpkt.c.

References _pkt_inf.

◆ pkt_get_mtu()

int W32_CALL pkt_get_mtu ( void )

Return PKTDRVR maximum-transmit-units (MTU).

Note
This includes length of MAC-header.

Definition at line 1169 of file winpkt.c.

◆ pkt_get_multicast_list()

int pkt_get_multicast_list | ( | mac_address * | listbuf,
 |  | int * | len
 | ) |  |

Gets the current list of multicast addresses from the PKTDRVR.

  • listbuf is the buffer into which the list is placed
  • len on input: length of listbuf on output: length of list returned
Return values
0 | upon error - _pkt_errno is set
1 | if retrieval was successful,

Definition at line 1198 of file winpkt.c.

References _pkt_errno.

◆ pkt_get_rcv_mode()

int W32_CALL pkt_get_rcv_mode ( void )

Gets the receive mode of the interface (can never be mode 0).

Return values
!0 | Okay - _pkt_errno is 0, _pkt_rxmode and retval is current mode.
0 | Error - _pkt_errno is set.

_pkt_rxmode is one of the following modes: (upon successful return)

  • 1 - turn off receiver
  • 2 - receive only packets sent to this interface
  • 3 - mode 2 plus broadcast packets (default)
  • 4 - mode 3 plus limited multicast packets
  • 5 - mode 3 plus all multicast packets
  • 6 - all packets (a.k.a promiscuous mode)

Definition at line 1049 of file winpkt.c.

References _eth_SwsVpkt, _pkt_errno, _pkt_inf, and _pkt_rxmode.

◆ pkt_get_stats()

int W32_CALL pkt_get_stats | ( | struct PktStats * | stats,
 |  | struct PktStats * | total
 | ) |  |

Get PKTDRVR statistics.

Return both 'stats' for current session and 'total' statistics since driver loaded.

Definition at line 1155 of file winpkt.c.

References _pkt_inf.

◆ pkt_is_init()

BOOL W32_CALL pkt_is_init ( void )

Definition at line 684 of file winpkt.c.

◆ pkt_poll_recv()

struct pkt_rx_element * pkt_poll_recv ( void )

Definition at line 924 of file winpkt.c.

◆ pkt_release()

int W32_CALL pkt_release ( void )
Todo:
We might be called between 1st and 2nd packet-driver upcall. Need to wait for 2nd upcall to finish or else freeing the RMCB too early could cause a crash or a stuck PKTDRVR.

Definition at line 601 of file winpkt.c.

References _eth_win10pcap, _eth_winpcap, _pkt_inf, and _watt_fatal_error.

◆ pkt_send()

int W32_CALL pkt_send | ( | const void * | tx,
 |  | int | length
 | ) |  |

Send a link-layer frame.

For PPP/SLIP 'tx' contains no MAC-header. For EtherNet, Token-Ring, ARCNET and FDDI, 'tx' contains the complete frame.

Todo:
Change this so that we doesn't retry if the driver was stuck for "too long". I've seen drivers using approx. 100 msec on each iteration below. Retrying if the driver is stuck is not worth the time.

Definition at line 970 of file winpkt.c.

References _eth_SwsVpkt, and _pkt_inf.

◆ pkt_set_addr()

int W32_CALL pkt_set_addr ( const void * eth )

Set a new MAC source address.

Definition at line 676 of file winpkt.c.

◆ pkt_set_multicast_list()

int pkt_set_multicast_list | ( | const void * | listbuf,
 |  | int | len
 | ) |  |

Sets the list of multicast addresses for which the PKTDRVR is responsible.

  • listbuf is the buffer containing the list
  • len is the length of listbuf
Return values
0 | upon error - _pkt_errno is set
1 | if set was successful

Definition at line 1207 of file winpkt.c.

References _pkt_errno.

◆ pkt_set_rcv_mode()

int W32_CALL pkt_set_rcv_mode ( int mode )

Sets the receive mode of the interface.

mode is one of the following modes:

  • 1 - turn off receiver
  • 2 - receive only packets sent to this interface
  • 3 - mode 2 plus broadcast packets (default)
  • 4 - mode 3 plus limited multicast packets
  • 5 - mode 3 plus all multicast packets
  • 6 - all packets (AKA promiscuous mode)
Return values
0 | - upon error - _pkt_errno is set
1 | - if the mode was set successfully

Definition at line 1016 of file winpkt.c.

References _eth_SwsVpkt, _pkt_errno, _pkt_inf, _pkt_rxmode, and win_strerror().

◆ pkt_strerror()

const char *W32_CALL pkt_strerror ( int code )

Return textual error representing error-code.

Todo:
Return strings for these: PDERR_GEN_FAIL PDERR_NO_DRIVER PDERR_NO_CLASS PDERR_NO_MULTICAST PDERR_NO_SPACE
  • GetLastError(). Use win_strerror()

Definition at line 1178 of file winpkt.c.

◆ pkt_waiting()

int W32_CALL pkt_waiting ( void )

Return number of packets waiting in queue.

Definition at line 722 of file winpkt.c.

References _pkt_inf.

◆ set_txmode()

static void set_txmode ( const char * value )
static

Select async (overlapping) tx-mode.

NOT YET.

Definition at line 760 of file winpkt.c.

◆ show_link_details()

static void show_link_details ( void )
static

Definition at line 1717 of file winpkt.c.

◆ swsvpkt_callback()

static void swsvpkt_callback | ( | struct SwsVpktUsr * | usr,
 |  | const void * | buf,
 |  | unsigned | len
 | ) |  |
static

Our low-level SwsVpkt receive callback.

Definition at line 879 of file winpkt.c.

References _pkt_inf, pkt_ringbuf::buf_size, pkt_ringbuf::in_index, pkt_ringbuf::num_drop, and pkt_ringbuf::out_index.

◆ winpcap_recv_thread()

static DWORD __stdcall winpcap_recv_thread ( void * arg )
static

Our low-level WinPcap capture thread.

Loop waiting for packet(s) in PacketReceivePacket(). In '_pkt_release()' the receive event-handle (adapter->Readvent) is set. This causes 'WaitForSingleObject()' in 'PacketReceivePacket()' to return. It is vital that the ADAPTER object isn't deallocated before 'PacketReceivePacket()' returns.

The return-value is > 0 if thread exited on it's own. Otherwise it is 0 (from 'GetExitCodeThread()').

Note
: If multiple threads are using Watt-32 function, there could be a race contention here. Maybe 'ENTER_CRIT()' should be moved further up? E.g. if 'gethostbyname()' is called in one side-thread and 'select()' is called in the main-thread, this could cause race hazards in several places. Need to test this carefully. Ref. the '_WINDOWS_NSL' code in Lynx/Win32.
Todo:
: Take the 'adapter' info from 'arg' instead of using the global '_pkt_inf' structure.

Definition at line 787 of file winpkt.c.

References _pkt_inf, pkt_ringbuf::buf_size, pkt_ringbuf::in_index, pkt_ringbuf::num_drop, and pkt_ringbuf::out_index.

◆ winpkt_trace()

void winpkt_trace | ( | const char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 190 of file winpkt.c.

◆ winpkt_trace_fclose()

void winpkt_trace_fclose ( void )

Definition at line 227 of file winpkt.c.

Variable Documentation

◆ _pkt_errno

int _pkt_errno = 0

Definition at line 88 of file winpkt.c.

◆ _pkt_forced_rxmode

int _pkt_forced_rxmode = -1

wattcp.cfg receive mode

Definition at line 91 of file winpkt.c.

◆ _pkt_inf

struct pkt_info* _pkt_inf = NULL

module data that will be locked

Definition at line 95 of file winpkt.c.

◆ _pkt_ip_ofs

WORD _pkt_ip_ofs = 0

Definition at line 86 of file winpkt.c.

◆ _pkt_rxmode

int _pkt_rxmode = RXMODE_DEFAULT

active receive mode

Definition at line 89 of file winpkt.c.

◆ _pkt_rxmode0

int _pkt_rxmode0 = -1

startup receive mode

Definition at line 90 of file winpkt.c.

◆ _pktdevclass

WORD _pktdevclass = PDCLASS_UNKNOWN

Definition at line 85 of file winpkt.c.

◆ _pktdrvr_descr

char _pktdrvr_descr[MAX_VALUELEN+1] = ""

Definition at line 93 of file winpkt.c.

◆ _pktdrvrname

char _pktdrvrname[MAX_VALUELEN+1] = ""

Definition at line 92 of file winpkt.c.

◆ _pktserial

BOOL _pktserial = FALSE

Definition at line 87 of file winpkt.c.

◆ config_pass_1_done

BOOL config_pass_1_done = FALSE
static

Definition at line 114 of file winpkt.c.

◆ dump_fname

char dump_fname[MAX_PATHLEN] = "$(TEMP)\\winpkt_dump.txt"
static

Definition at line 115 of file winpkt.c.

◆ logical_media

const struct search_list logical_media[]
static
Initial value:
= {
{ (DWORD) NdisMediumNull, "Unknown?" },
{ NdisMedium802_3, "802.3" },
{ NdisMedium802_5, "802.5" },
{ NdisMediumFddi, "FDDI" },
{ NdisMediumWan, "WAN" },
{ NdisMediumLocalTalk, "LocalTalk" },
{ NdisMediumDix, "DIX" },
{ NdisMediumArcnetRaw, "ArcNet (raw)" },
{ NdisMediumArcnet878_2, "ArcNet (878.2)" },
{ NdisMediumAtm, "ATM" },
{ NdisMediumWirelessWan, "WiFi" },
{ NdisMediumIrda, "IrDA" },
{ NdisMediumBpc, "BPC" },
{ NdisMediumCoWan, "CoWan" },
{ NdisMedium1394, "1394 FW" },
{ NdisMediumInfiniBand, "Inf-band" },
{ NdisMediumTunnel, "Tunnel" },
{ NdisMediumNative802_11, "Native 802.11" },
{ NdisMediumLoopback, "Loopback" },
{ NdisMediumWiMAX, "WiMax" },
{ NdisMediumIP, "IP" },
{ NdisMediumCHDLC, "CHDLC" },
{ NdisMediumPPPSerial, "PPP-ser" }
}

Definition at line 119 of file winpkt.c.

◆ num_rx_bytes

DWORD num_rx_bytes = 0UL
static

Definition at line 109 of file winpkt.c.

◆ num_rx_pkt

DWORD num_rx_pkt = 0UL
static

Definition at line 108 of file winpkt.c.

◆ num_tx_bytes

DWORD num_tx_bytes = 0UL
static

Definition at line 106 of file winpkt.c.

◆ num_tx_errors

DWORD num_tx_errors = 0UL
static

Definition at line 107 of file winpkt.c.

◆ num_tx_pkt

DWORD num_tx_pkt = 0UL
static

Definition at line 105 of file winpkt.c.

◆ phys_media

const struct search_list phys_media[]
static
Initial value:
= {
{ ND_PHY_WirelessLan, "Wireless LAN" },
{ ND_PHY_CableModem, "Cable" },
{ ND_PHY_PhoneLine, "Phone" },
{ ND_PHY_PowerLine, "PowerLine" },
{ ND_PHY_DSL, "DSL" },
{ ND_PHY_FibreChannel, "Fibre" },
{ ND_PHY_1394, "IEEE1394" },
{ ND_PHY_WirelessWan, "Wireless WAN" },
{ ND_PHY_Native802_11, "802.11" },
{ ND_PHY_Bluetooth, "Bluetooth" },
{ ND_PHY_Infiniband, "Infiniband" },
{ ND_PHY_WiMax, "Wi-Max" },
{ ND_PHY_UWB, "UWB" },
{ ND_PHY_802_3, "802.3" },
{ ND_PHY_802_5, "80.25" },
{ ND_PHY_Irda, "Irda" },
{ ND_PHY_WiredWAN, "Wired WAN" },
{ ND_PHY_WiredCoWan, "Wired CoWan" },
{ ND_PHY_Other, "Other?" }
}

Definition at line 145 of file winpkt.c.

◆ pkt_drop_cnt

DWORD pkt_drop_cnt = 0UL
static

Definition at line 110 of file winpkt.c.

◆ pkt_num_rx_bufs

int pkt_num_rx_bufs = RX_BUFS
static

Definition at line 100 of file winpkt.c.

◆ pkt_txretries

int pkt_txretries = 2
static

Definition at line 111 of file winpkt.c.

◆ thr_realtime

int thr_realtime = 0
static

Definition at line 112 of file winpkt.c.

◆ thr_stopped

BOOL thr_stopped = FALSE
static

Definition at line 113 of file winpkt.c.

◆ trace_file

FILE* trace_file
static

Definition at line 188 of file winpkt.c.

◆ winpkt_trace_file

const char* winpkt_trace_file

Definition at line 183 of file winpkt.c.

◆ winpkt_trace_func

const char* winpkt_trace_func

Definition at line 182 of file winpkt.c.

◆ winpkt_trace_level

UINT winpkt_trace_level = 0

Definition at line 185 of file winpkt.c.

◆ winpkt_trace_line

UINT winpkt_trace_line

Definition at line 184 of file winpkt.c.


Watt-32 tcp/ip: E:/WATT/src/x32vm.c File Reference

  • src
Data Structures | Typedefs | Enumerations | Functions | Variables
x32vm.c File Reference

Go to the source code of this file.

Data Structures

struct RMCB_record

Typedefs

typedef struct RMCB_record RMCB_record

Enumerations

enum ReturnType {
RETF = 0xCB ,
IRET = 0xCF
}

Functions

static void __far | PmodeGlue (int taskIndex)
static void | PmGlueEnd (void)
void | _dx_rmiv_get (int int_no, REALPTR *handler)
void | _dx_rmiv_set (int int_no, REALPTR handler)
void | _dx_pmiv_get (int int_no, FARPTR *handler)
void | _dx_apmiv_set (int int_no, FARPTR handler)
void | _dx_real_int (int int_no, SWI_REGS *regs)
int | _dx_call_real (REALPTR proc, RMC_BLK *rm_reg, DWORD count,...)
void | _dx_rmlink_get (REALPTR *cback, REALPTR *rm_cbuf, DWORD *rm_cbuf_size, void _far **pm_cbuf)
int | _dx_real_above (int para_count, WORD *para, WORD *largest)
int | _dx_real_free (WORD seg)
int | _dx_real_alloc (int para_count, WORD *para, WORD *largest)
int | _dx_lock_pgs (const void _far *addr, int len)
int | _dx_lock_pgsn (const void *addr, int len)
int | _dx_ulock_pgsn (const void *addr, int len)
void | ReadRealMem (void *buf, REALPTR rp, unsigned len)
void | WriteRealMem (REALPTR rp, const void *src, int len)
void | FillRealMem (REALPTR rp, char val, int len)
void | PokeRealWord (REALPTR rp, WORD val)
void | stack_rewind (DWORD start, DWORD base)
static REALPTR | normalize (REALPTR rp)
static REALPTR | _dx_alloc_rmode_wrapper (pmodeHook pmHook, int len, int stack_size, ReturnType returnType)
void | _dx_free_rmode_wrapper (REALPTR dos_addr)
REALPTR | _dx_alloc_rmode_wrapper_retf (pmodeHook pmHook, rmodeHook rmHook, int len, int stack_size)
REALPTR | _dx_alloc_rmode_wrapper_iret (pmodeHook pmHook, int stack_size)
static void __far | PmodeGlue (struct RMCB_record *task_ptr)

Variables

static char | num_wrappers = 0
static DWORD | exc_app_start = 4096
static struct RMCB_record | rmcb [MAX_WRAPPERS]

Detailed Description

FlashTek DOS extender interface.

A Pharlap-like interface for FlashTek's X32VM DOS extender Currently this only supports the Digital Mars compiler.

by G. Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o July 2002

Definition in file x32vm.c.

Enumeration Type Documentation

◆ ReturnType

enum ReturnType

Definition at line 40 of file x32vm.c.

Function Documentation

◆ _dx_alloc_rmode_wrapper()

static REALPTR _dx_alloc_rmode_wrapper | ( | pmodeHook | pmHook,
 |  | int | len,
 |  | int | stack_size,
 |  | ReturnType | returnType
 | ) |  |
static

Definition at line 359 of file x32vm.c.

◆ _dx_alloc_rmode_wrapper_iret()

REALPTR _dx_alloc_rmode_wrapper_iret | ( | pmodeHook | pmHook,
 |  | int | stack_size
 | ) |  |

Definition at line 480 of file x32vm.c.

◆ _dx_alloc_rmode_wrapper_retf()

REALPTR _dx_alloc_rmode_wrapper_retf | ( | pmodeHook | pmHook,
 |  | rmodeHook | rmHook,
 |  | int | len,
 |  | int | stack_size
 | ) |  |

Definition at line 473 of file x32vm.c.

◆ _dx_apmiv_set()

void _dx_apmiv_set | ( | int | int_no,
 |  | FARPTR | handler
 | ) |  |

Definition at line 93 of file x32vm.c.

◆ _dx_call_real()

int _dx_call_real | ( | REALPTR | proc,
 |  | RMC_BLK * | rm_reg,
 |  | DWORD | count,
 |  |  | ...
 | ) |  |

Definition at line 162 of file x32vm.c.

◆ _dx_free_rmode_wrapper()

void _dx_free_rmode_wrapper ( REALPTR dos_addr )

Definition at line 453 of file x32vm.c.

◆ _dx_lock_pgs()

int _dx_lock_pgs | ( | const void _far * | addr,
 |  | int | len
 | ) |  |

Definition at line 252 of file x32vm.c.

◆ _dx_lock_pgsn()

int _dx_lock_pgsn | ( | const void * | addr,
 |  | int | len
 | ) |  |

Definition at line 257 of file x32vm.c.

◆ _dx_pmiv_get()

void _dx_pmiv_get | ( | int | int_no,
 |  | FARPTR * | handler
 | ) |  |

Definition at line 77 of file x32vm.c.

◆ _dx_real_above()

int _dx_real_above | ( | int | para_count,
 |  | WORD * | para,
 |  | WORD * | largest
 | ) |  |

Definition at line 211 of file x32vm.c.

◆ _dx_real_alloc()

int _dx_real_alloc | ( | int | para_count,
 |  | WORD * | para,
 |  | WORD * | largest
 | ) |  |

<

Todo:

Definition at line 233 of file x32vm.c.

◆ _dx_real_free()

int _dx_real_free ( WORD seg )

Definition at line 223 of file x32vm.c.

◆ _dx_real_int()

void _dx_real_int | ( | int | int_no,
 |  | SWI_REGS * | regs
 | ) |  |

Definition at line 107 of file x32vm.c.

◆ _dx_rmiv_get()

void _dx_rmiv_get | ( | int | int_no,
 |  | REALPTR * | handler
 | ) |  |

Definition at line 54 of file x32vm.c.

◆ _dx_rmiv_set()

void _dx_rmiv_set | ( | int | int_no,
 |  | REALPTR | handler
 | ) |  |

Definition at line 65 of file x32vm.c.

◆ _dx_rmlink_get()

void _dx_rmlink_get | ( | REALPTR * | cback,
 |  | REALPTR * | rm_cbuf,
 |  | DWORD * | rm_cbuf_size,
 |  | void _far ** | pm_cbuf
 | ) |  |

Definition at line 183 of file x32vm.c.

◆ _dx_ulock_pgsn()

int _dx_ulock_pgsn | ( | const void * | addr,
 |  | int | len
 | ) |  |

Definition at line 262 of file x32vm.c.

◆ FillRealMem()

void FillRealMem | ( | REALPTR | rp,
 |  | char | val,
 |  | int | len
 | ) |  |

Definition at line 279 of file x32vm.c.

◆ normalize()

static REALPTR normalize ( REALPTR rp )
static

Definition at line 348 of file x32vm.c.

◆ PmGlueEnd()

static void PmGlueEnd ( void )
static
Todo:
Support 32-bit Watcom with X32VM

Definition at line 619 of file x32vm.c.

◆ PmodeGlue()

static void __far PmodeGlue ( struct RMCB_record * task_ptr )
static

Definition at line 487 of file x32vm.c.

◆ PokeRealWord()

void PokeRealWord | ( | REALPTR | rp,
 |  | WORD | val
 | ) |  |

Definition at line 285 of file x32vm.c.

◆ ReadRealMem()

void ReadRealMem | ( | void * | buf,
 |  | REALPTR | rp,
 |  | unsigned | len
 | ) |  |

Definition at line 267 of file x32vm.c.

◆ stack_rewind()

void stack_rewind | ( | DWORD | start,
 |  | DWORD | base
 | ) |  |

Definition at line 295 of file x32vm.c.

◆ WriteRealMem()

void WriteRealMem | ( | REALPTR | rp,
 |  | const void * | src,
 |  | int | len
 | ) |  |

Definition at line 273 of file x32vm.c.

Variable Documentation

◆ exc_app_start

DWORD exc_app_start = 4096
static

Definition at line 46 of file x32vm.c.

◆ num_wrappers

char num_wrappers = 0
static

Definition at line 45 of file x32vm.c.

◆ rmcb

struct RMCB_record rmcb[MAX_WRAPPERS]
static
Todo:
find the real application start

Definition at line 47 of file x32vm.c.


Watt-32 tcp/ip: E:/WATT/src/x32vm.h File Reference

  • src
Data Structures | Typedefs | Functions | Variables
x32vm.h File Reference

Go to the source code of this file.

Data Structures

struct | SWI_REGS
struct | RMC_BLK
struct | RMI_BLK

Typedefs

typedef struct SWI_REGS | SWI_REGS
typedef struct RMC_BLK | RMC_BLK
typedef void(* | pmodeHook) (SWI_REGS *)
typedef void(* | rmodeHook) (void)

Functions

void | _dx_rmiv_get (int int_no, REALPTR *handler)
void | _dx_rmiv_set (int int_no, REALPTR handler)
void | _dx_pmiv_get (int int_no, FARPTR *handler)
void | _dx_apmiv_set (int int_no, FARPTR handler)
void | _dx_real_int (int int_no, SWI_REGS *regs)
int | _dx_real_free (WORD segment)
int | _dx_real_above (int paras, WORD *para, WORD *largest)
int | _dx_real_alloc (int paras, WORD *para, WORD *largest)
int | _dx_call_real (REALPTR proc, RMC_BLK *rm_reg, DWORD count,...)
int | _dx_lock_pgs (const void _far *addr, int len)
int | _dx_lock_pgsn (const void *addr, int len)
int | _dx_ulock_pgsn (const void *addr, int len)
void | _dx_rmlink_get (REALPTR *cback, REALPTR *rm_cbuf, DWORD *rm_cbuf_size, void _far **pm_cbuf)
REALPTR | _dx_alloc_rmode_wrapper_retf (pmodeHook pmHook, rmodeHook rmHook, int len, int stack_size)
REALPTR | _dx_alloc_rmode_wrapper_iret (pmodeHook pmHook, int stack_size)
void | _dx_free_rmode_wrapper (REALPTR dosAddr)
void | ReadRealMem (void *buf, REALPTR rp, unsigned len)
void | WriteRealMem (REALPTR rp, const void *src, int size)
void | PokeRealWord (REALPTR rp, WORD val)
WORD | PeekRealWord (REALPTR rp)
DWORD | PeekRealDWord (REALPTR rp)
void | stack_rewind (DWORD start, DWORD base)

Variables

UINT cdecl _x386_stacklow

Typedef Documentation

◆ pmodeHook

typedef void(* pmodeHook) (SWI_REGS *)

Definition at line 48 of file x32vm.h.

◆ rmodeHook

typedef void(* rmodeHook) (void)

Definition at line 49 of file x32vm.h.

Function Documentation

◆ _dx_alloc_rmode_wrapper_iret()

REALPTR _dx_alloc_rmode_wrapper_iret | ( | pmodeHook | pmHook,
 |  | int | stack_size
 | ) |  |

Definition at line 480 of file x32vm.c.

◆ _dx_alloc_rmode_wrapper_retf()

REALPTR _dx_alloc_rmode_wrapper_retf | ( | pmodeHook | pmHook,
 |  | rmodeHook | rmHook,
 |  | int | len,
 |  | int | stack_size
 | ) |  |

Definition at line 473 of file x32vm.c.

◆ _dx_apmiv_set()

void _dx_apmiv_set | ( | int | int_no,
 |  | FARPTR | handler
 | ) |  |

Definition at line 93 of file x32vm.c.

◆ _dx_call_real()

int _dx_call_real | ( | REALPTR | proc,
 |  | RMC_BLK * | rm_reg,
 |  | DWORD | count,
 |  |  | ...
 | ) |  |

Definition at line 162 of file x32vm.c.

◆ _dx_free_rmode_wrapper()

void _dx_free_rmode_wrapper ( REALPTR dosAddr )

Definition at line 453 of file x32vm.c.

◆ _dx_lock_pgs()

int _dx_lock_pgs | ( | const void _far * | addr,
 |  | int | len
 | ) |  |

Definition at line 252 of file x32vm.c.

◆ _dx_lock_pgsn()

int _dx_lock_pgsn | ( | const void * | addr,
 |  | int | len
 | ) |  |

Definition at line 257 of file x32vm.c.

◆ _dx_pmiv_get()

void _dx_pmiv_get | ( | int | int_no,
 |  | FARPTR * | handler
 | ) |  |

Definition at line 77 of file x32vm.c.

◆ _dx_real_above()

int _dx_real_above | ( | int | paras,
 |  | WORD * | para,
 |  | WORD * | largest
 | ) |  |

Definition at line 211 of file x32vm.c.

◆ _dx_real_alloc()

int _dx_real_alloc | ( | int | paras,
 |  | WORD * | para,
 |  | WORD * | largest
 | ) |  |

<

Todo:

Definition at line 233 of file x32vm.c.

◆ _dx_real_free()

int _dx_real_free ( WORD segment )

Definition at line 223 of file x32vm.c.

◆ _dx_real_int()

void _dx_real_int | ( | int | int_no,
 |  | SWI_REGS * | regs
 | ) |  |

Definition at line 107 of file x32vm.c.

◆ _dx_rmiv_get()

void _dx_rmiv_get | ( | int | int_no,
 |  | REALPTR * | handler
 | ) |  |

Definition at line 54 of file x32vm.c.

◆ _dx_rmiv_set()

void _dx_rmiv_set | ( | int | int_no,
 |  | REALPTR | handler
 | ) |  |

Definition at line 65 of file x32vm.c.

◆ _dx_rmlink_get()

void _dx_rmlink_get | ( | REALPTR * | cback,
 |  | REALPTR * | rm_cbuf,
 |  | DWORD * | rm_cbuf_size,
 |  | void _far ** | pm_cbuf
 | ) |  |

Definition at line 183 of file x32vm.c.

◆ _dx_ulock_pgsn()

int _dx_ulock_pgsn | ( | const void * | addr,
 |  | int | len
 | ) |  |

Definition at line 262 of file x32vm.c.

◆ PokeRealWord()

void PokeRealWord | ( | REALPTR | rp,
 |  | WORD | val
 | ) |  |

Definition at line 285 of file x32vm.c.

◆ ReadRealMem()

void ReadRealMem | ( | void * | buf,
 |  | REALPTR | rp,
 |  | unsigned | len
 | ) |  |

Definition at line 104 of file powerpak.c.

◆ stack_rewind()

void stack_rewind | ( | DWORD | start,
 |  | DWORD | base
 | ) |  |

Definition at line 642 of file wdpmi.c.

◆ WriteRealMem()

void WriteRealMem | ( | REALPTR | rp,
 |  | const void * | src,
 |  | int | size
 | ) |  |

Definition at line 128 of file powerpak.c.


Watt-32 tcp/ip: E:/WATT/src/zadler32.c Source File

  • src
zadler32.c
1/* adler32.c -- compute the Adler-32 checksum of a data stream
2 * Copyright (C) 1995-2003 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* @(#) $Id$ */
7
8#define ZLIB_INTERNAL
9#include "wattcp.h"
10#include "zlib.h"
11
12#if defined(USE_GZIP)
13
14#define BASE 65521UL /* largest prime smaller than 65536 */
15#define NMAX 5552
16/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
17
18#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
19#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
20#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
21#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
22#define DO16(buf) DO8(buf,0); DO8(buf,8);
23
24#ifdef NO_DIVIDE
25# define MOD(a) \
26 do { \
27 if (a >= (BASE << 16)) a -= (BASE << 16); \
28 if (a >= (BASE << 15)) a -= (BASE << 15); \
29 if (a >= (BASE << 14)) a -= (BASE << 14); \
30 if (a >= (BASE << 13)) a -= (BASE << 13); \
31 if (a >= (BASE << 12)) a -= (BASE << 12); \
32 if (a >= (BASE << 11)) a -= (BASE << 11); \
33 if (a >= (BASE << 10)) a -= (BASE << 10); \
34 if (a >= (BASE << 9)) a -= (BASE << 9); \
35 if (a >= (BASE << 8)) a -= (BASE << 8); \
36 if (a >= (BASE << 7)) a -= (BASE << 7); \
37 if (a >= (BASE << 6)) a -= (BASE << 6); \
38 if (a >= (BASE << 5)) a -= (BASE << 5); \
39 if (a >= (BASE << 4)) a -= (BASE << 4); \
40 if (a >= (BASE << 3)) a -= (BASE << 3); \
41 if (a >= (BASE << 2)) a -= (BASE << 2); \
42 if (a >= (BASE << 1)) a -= (BASE << 1); \
43 if (a >= BASE) a -= BASE; \
44 } while (0)
45#else
46# define MOD(a) a %= BASE
47#endif
48
49/* ========================================================================= */
50uLong ZEXPORT adler32 (uLong adler, const Bytef *buf, uInt len)
51{
52 unsigned long s1 = adler & 0xffff;
53 unsigned long s2 = (adler >> 16) & 0xffff;
54
55 if (buf == Z_NULL) return 1L;
56
57 while (len > 0) {
58 int k = len < NMAX ? (int)len : NMAX;
59 len -= k;
60 while (k >= 16) {
61 DO16(buf);
62 buf += 16;
63 k -= 16;
64 }
65 if (k != 0) do {
66 s1 += *buf++;
67 s2 += s1;
68 } while (--k);
69 MOD(s1);
70 MOD(s2);
71 }
72 return (s2 << 16) | s1;
73}
74#endif /* USE_GZIP */
75
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/zcompres.c Source File

  • src
zcompres.c
1/* compress.c -- compress a memory buffer
2 * Copyright (C) 1995-2002 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* @(#) $Id$ */
7
8#define ZLIB_INTERNAL
9#include "wattcp.h"
10#include "zlib.h"
11
12#if defined(USE_GZIP)
13
14/* ===========================================================================
15 Compresses the source buffer into the destination buffer. The level
16 parameter has the same meaning as in deflateInit. sourceLen is the byte
17 length of the source buffer. Upon entry, destLen is the total size of the
18 destination buffer, which must be at least 0.1% larger than sourceLen plus
19 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
20
21 compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
22 memory, Z_BUF_ERROR if there was not enough room in the output buffer,
23 Z_STREAM_ERROR if the level parameter is invalid.
24*/
25int ZEXPORT compress2 (Bytef *dest,
26 uLongf *destLen,
27 const Bytef *source,
28 uLong sourceLen,
29 int level)
30{
31 z_stream stream;
32 int err;
33
34 stream.next_in = (Bytef*)source;
35 stream.avail_in = (uInt)sourceLen;
36#ifdef MAXSEG_64K
37 /* Check for source > 64K on 16-bit machine: */
38 if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
39#endif
40 stream.next_out = dest;
41 stream.avail_out = (uInt)*destLen;
42 if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
43
44 stream.zalloc = (alloc_func)0;
45 stream.zfree = (free_func)0;
46 stream.opaque = (voidpf)0;
47
48 err = deflateInit(&stream, level);
49 if (err != Z_OK) return err;
50
51 err = deflate(&stream, Z_FINISH);
52 if (err != Z_STREAM_END) {
53 deflateEnd(&stream);
54 return err == Z_OK ? Z_BUF_ERROR : err;
55 }
56 *destLen = stream.total_out;
57
58 err = deflateEnd(&stream);
59 return err;
60}
61
62/* ===========================================================================
63 */
64int ZEXPORT compress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
65{
66 return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
67}
68
69/* ===========================================================================
70 If the default memLevel or windowBits for deflateInit() is changed, then
71 this function needs to be updated.
72 */
73uLong ZEXPORT compressBound (uLong sourceLen)
74{
75 return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11;
76}
77#endif /* USE_GZIP */
78
z_stream_s
Definition: zlib.h:84
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/zconf.h Source File

  • src
zconf.h
1/* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2003 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* @(#) $Id$ */
7
8#ifndef ZCONF_H
9#define ZCONF_H
10
11#define Z_PREFIX
12
13/*
14 * If you *really* need a unique prefix for all types and library functions,
15 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
16 */
17#ifdef Z_PREFIX
18# define deflateInit_ _w32_z_deflateInit_
19# define deflate _w32_z_deflate
20# define deflateEnd _w32_z_deflateEnd
21# define inflateInit_ _w32_z_inflateInit_
22# define inflate _w32_z_inflate
23# define inflateEnd _w32_z_inflateEnd
24# define deflateInit2_ _w32_z_deflateInit2_
25# define deflateSetDictionary _w32_z_deflateSetDictionary
26# define deflateCopy _w32_z_deflateCopy
27# define deflate_copyright _w32_z_deflate_copyright
28# define deflateReset _w32_z_deflateReset
29# define deflatePrime _w32_z_deflatePrime
30# define deflateParams _w32_z_deflateParams
31# define deflateBound _w32_z_deflateBound
32# define inflateInit2_ _w32_z_inflateInit2_
33# define inflateSetDictionary _w32_z_inflateSetDictionary
34# define inflateSync _w32_z_inflateSync
35# define inflateSyncPoint _w32_z_inflateSyncPoint
36# define inflateCopy _w32_z_inflateCopy
37# define inflateReset _w32_z_inflateReset
38# define compress _w32_z_compress
39# define compress2 _w32_z_compress2
40# define compressBound _w32_z_compressBound
41# define uncompress _w32_z_uncompress
42# define adler32 _w32_z_adler32
43# define crc32 _w32_z_crc32
44# define get_crc_table _w32_z_get_crc_table
45# define gzopen _w32_z_gzopen
46# define gzprintf _w32_z_gzprintf
47# define gzflush _w32_z_gzflush
48# define gzwrite _w32_z_gzwrite
49# define gzeof _w32_z_gzeof
50# define gzdopen _w32_z_gzdopen
51# define gzputs _w32_z_gzputs
52# define gzputc _w32_z_gzputc
53# define gzerror _w32_z_gzerror
54# define gzclose _w32_z_gzclose
55# define gzsetparams _w32_z_gzsetparams
56# define gzclearerr _w32_z_gzclearerr
57# define gzungetc _w32_z_gzungetc
58# define gzrewind _w32_z_gzrewind
59# define gzread _w32_z_gzread
60# define gzseek _w32_z_gzseek
61# define gztell _w32_z_gztell
62# define gzgetc _w32_z_gzgetc
63# define gzgets _w32_z_gzgets
64# define zcalloc _w32_z_calloc
65# define z_errmsg _w32_z_errmsg
66# define zError _w32_zError
67# define zcfree _w32_zcfree
68# define zlibVersion _w32_zlibVersion
69# define zlibCompileFlags _w32_zlibCompileFlags
70# define _tr_init _w32_z_tr_init
71# define _tr_tally _w32_z_tr_tally
72# define _tr_flush_block _w32_z_tr_flush_block
73# define _tr_align _w32_z_tr_align
74# define _tr_stored_block _w32_z_tr_stored_block
75# define _dist_code _w32_z_dist_code
76# define _length_code _w32_z_length_code
77
78# define Byte z_Byte
79# define uInt z_uInt
80# define uLong z_uLong
81# define Bytef z_Bytef
82# define charf z_charf
83# define intf z_intf
84# define uIntf z_uIntf
85# define uLongf z_uLongf
86# define voidpf z_voidpf
87# define voidp z_voidp
88#endif
89
90#if defined(__MSDOS__) && !defined(MSDOS)
91# define MSDOS
92#endif
93
94#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
95# define OS2
96#endif
97
98#if defined(_WINDOWS) && !defined(WINDOWS)
99# define WINDOWS
100#endif
101
102#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
103# define _WIN32
104#endif
105
106#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) && !defined(_WIN32)
107# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
108# ifndef SYS16BIT
109# define SYS16BIT
110# endif
111# if defined(__DMC__) && defined(__SMALL32__)
112# undef SYS16BIT
113# endif
114# endif
115#endif
116
117/*
118 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
119 * than 64k bytes at a time (needed on systems with 16-bit int).
120 */
121#ifdef SYS16BIT
122# define MAXSEG_64K
123#endif
124#ifdef MSDOS
125# define UNALIGNED_OK
126#endif
127
128#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
129# ifndef STDC99
130# define STDC99
131# endif
132#endif
133
134/* Some Mac compilers merge all .h files incorrectly: */
135#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
136# define NO_DUMMY_DECL
137#endif
138
139/* Maximum value for memLevel in deflateInit2 */
140#ifndef MAX_MEM_LEVEL
141# ifdef MAXSEG_64K
142# define MAX_MEM_LEVEL 8
143# else
144# define MAX_MEM_LEVEL 9
145# endif
146#endif
147
148/* Maximum value for windowBits in deflateInit2 and inflateInit2.
149 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
150 * created by gzip. (Files created by minigzip can still be extracted by
151 * gzip.)
152 */
153#ifndef MAX_WBITS
154# define MAX_WBITS 15 /* 32K LZ77 window */
155#endif
156
157/* The memory requirements for deflate are (in bytes):
158 (1 << (windowBits+2)) + (1 << (memLevel+9))
159 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
160 plus a few kilobytes for small objects. For example, if you want to reduce
161 the default memory requirements from 256K to 128K, compile with
162 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
163 Of course this will generally degrade compression (there's no free lunch).
164
165 The memory requirements for inflate are (in bytes) 1 << windowBits
166 that is, 32K for windowBits=15 (default value) plus a few kilobytes
167 for small objects.
168*/
169
170 /* Type declarations */
171
172/* The following definitions for FAR are needed only for MSDOS mixed
173 * model programming (small or medium model with some far allocations).
174 * This was tested only with MSC; for other MSDOS compilers you may have
175 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
176 * just define FAR to be empty.
177 */
178#ifdef SYS16BIT
179# if defined(M_I86SM) || defined(M_I86MM)
180 /* MSC small or medium model */
181# define SMALL_MEDIUM
182# ifdef _MSC_VER
183# define FAR _far
184# else
185# define FAR far
186# endif
187# endif
188# if (defined(__SMALL__) || defined(__MEDIUM__))
189 /* Turbo C small or medium model */
190# define SMALL_MEDIUM
191# ifdef __BORLANDC__
192# define FAR _far
193# else
194# define FAR far
195# endif
196# endif
197#endif
198
199#if defined(WINDOWS) || defined(_WIN32)
200 /* If building or using zlib as a DLL, define ZLIB_DLL.
201 * This is not mandatory, but it offers a little performance increase.
202 */
203# ifdef ZLIB_DLL
204# if defined(_WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
205# ifdef ZLIB_INTERNAL
206# define ZEXTERN extern __declspec(dllexport)
207# else
208# define ZEXTERN extern __declspec(dllimport)
209# endif
210# endif
211# endif /* ZLIB_DLL */
212 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
213 * define ZLIB_WINAPI.
214 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
215 */
216# ifdef ZLIB_WINAPI
217# ifdef FAR
218# undef FAR
219# endif
220# include <windows.h>
221 /* No need for _export, use ZLIB.DEF instead. */
222 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
223# define ZEXPORT WINAPI
224# ifdef _WIN32
225# define ZEXPORTVA WINAPIV
226# else
227# define ZEXPORTVA FAR CDECL
228# endif
229# endif
230#endif
231
232#if defined (__BEOS__)
233# ifdef ZLIB_DLL
234# ifdef ZLIB_INTERNAL
235# define ZEXPORT __declspec(dllexport)
236# define ZEXPORTVA __declspec(dllexport)
237# else
238# define ZEXPORT __declspec(dllimport)
239# define ZEXPORTVA __declspec(dllimport)
240# endif
241# endif
242#endif
243
244#ifndef ZEXTERN
245# define ZEXTERN extern
246#endif
247#ifndef ZEXPORT
248# define ZEXPORT
249#endif
250#ifndef ZEXPORTVA
251# define ZEXPORTVA
252#endif
253
254#ifndef FAR
255# define FAR
256#endif
257
258typedef unsigned char Byte; /* 8 bits */
259typedef unsigned int uInt; /* 16 bits or more */
260typedef unsigned long uLong; /* 32 bits or more */
261
262#ifdef SMALL_MEDIUM
263 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
264 #undef Bytef
265 #define Bytef Byte FAR
266#else
267 typedef Byte FAR Bytef;
268#endif
269
270typedef char FAR charf;
271typedef int FAR intf;
272typedef uInt FAR uIntf;
273typedef uLong FAR uLongf;
274
275typedef void const *voidpc;
276typedef void FAR *voidpf;
277typedef void *voidp;
278
279#ifndef SEEK_SET
280# define SEEK_SET 0 /* Seek from beginning of file. */
281# define SEEK_CUR 1 /* Seek from current position. */
282# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
283#endif
284
285#ifndef z_off_t
286# define z_off_t long
287#endif
288
289#if defined(__OS400__)
290#define NO_vsnprintf
291#endif
292
293#if defined(__MVS__)
294# define NO_vsnprintf
295# ifdef FAR
296# undef FAR
297# endif
298#endif
299
300/* MVS linker does not support external names larger than 8 bytes */
301#if defined(__MVS__)
302# pragma map(deflateInit_,"DEIN")
303# pragma map(deflateInit2_,"DEIN2")
304# pragma map(deflateEnd,"DEEND")
305# pragma map(deflateBound,"DEBND")
306# pragma map(inflateInit_,"ININ")
307# pragma map(inflateInit2_,"ININ2")
308# pragma map(inflateEnd,"INEND")
309# pragma map(inflateSync,"INSY")
310# pragma map(inflateSetDictionary,"INSEDI")
311# pragma map(compressBound,"CMBND")
312# pragma map(inflate_table,"INTABL")
313# pragma map(inflate_fast,"INFA")
314# pragma map(inflate_copyright,"INCOPY")
315#endif
316
317#endif /* ZCONF_H */


Watt-32 tcp/ip: E:/WATT/src/zcrc32.c Source File

  • src
zcrc32.c
1/* crc32.c -- compute the CRC-32 of a data stream
2 * Copyright (C) 1995-2003 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 *
5 * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
6 * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
7 * tables for updating the shift register in one step with three exclusive-ors
8 * instead of four steps with four exclusive-ors. This results about a factor
9 * of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
10 */
11
12/* @(#) $Id$ */
13
14#include "wattcp.h"
15
16#if defined(USE_GZIP)
17
18#ifdef MAKECRCH
19# include <stdio.h>
20# ifndef DYNAMIC_CRC_TABLE
21# define DYNAMIC_CRC_TABLE
22# endif /* !DYNAMIC_CRC_TABLE */
23#endif /* MAKECRCH */
24
25#include "zutil.h" /* for FAR definitions */
26
27#define local static
28
29/* Find a four-byte integer type for crc32_little() and crc32_big(). */
30#ifndef NOBYFOUR
31# include <limits.h>
32
33# define BYFOUR
34# if (UINT_MAX == 0xffffffffUL)
35 typedef unsigned int u4;
36# else
37# if (ULONG_MAX == 0xffffffffUL)
38 typedef unsigned long u4;
39# else
40# if (USHRT_MAX == 0xffffffffUL)
41 typedef unsigned short u4;
42# else
43# undef BYFOUR /* can't find a four-byte integer type! */
44# endif
45# endif
46# endif
47#endif /* !NOBYFOUR */
48
49/* Definitions for doing the crc four data bytes at a time. */
50#ifdef BYFOUR
51# define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \
52 (((w)&0xff00)<<8)+(((w)&0xff)<<24))
53 local unsigned long crc32_little (unsigned long,
54 const unsigned char FAR *, unsigned);
55 local unsigned long crc32_big (unsigned long,
56 const unsigned char FAR *, unsigned);
57# define TBLS 8
58#else
59# define TBLS 1
60#endif /* BYFOUR */
61
62#ifdef DYNAMIC_CRC_TABLE
63
64local int crc_table_empty = 1;
65local unsigned long FAR crc_table[TBLS][256];
66local void make_crc_table (void);
67#ifdef MAKECRCH
68 local void write_table (FILE *, const unsigned long FAR *);
69#endif /* MAKECRCH */
70
71/*
72 Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
73 x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
74
75 Polynomials over GF(2) are represented in binary, one bit per coefficient,
76 with the lowest powers in the most significant bit. Then adding polynomials
77 is just exclusive-or, and multiplying a polynomial by x is a right shift by
78 one. If we call the above polynomial p, and represent a byte as the
79 polynomial q, also with the lowest power in the most significant bit (so the
80 byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
81 where a mod b means the remainder after dividing a by b.
82
83 This calculation is done using the shift-register method of multiplying and
84 taking the remainder. The register is initialized to zero, and for each
85 incoming bit, x^32 is added mod p to the register if the bit is a one (where
86 x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
87 x (which is shifting right by one and adding x^32 mod p if the bit shifted
88 out is a one). We start with the highest power (least significant bit) of
89 q and repeat for all eight bits of q.
90
91 The first table is simply the CRC of all possible eight bit values. This is
92 all the information needed to generate CRCs on data a byte at a time for all
93 combinations of CRC register values and incoming bytes. The remaining tables
94 allow for word-at-a-time CRC calculation for both big-endian and little-
95 endian machines, where a word is four bytes.
96*/
97local void make_crc_table (void)
98{
99 unsigned long c;
100 int n, k;
101 unsigned long poly; /* polynomial exclusive-or pattern */
102 /* terms of polynomial defining this crc (except x^32): */
103 static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
104
105 /* make exclusive-or pattern from polynomial (0xedb88320UL) */
106 poly = 0UL;
107 for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
108 poly |= 1UL << (31 - p[n]);
109
110 /* generate a crc for every 8-bit value */
111 for (n = 0; n < 256; n++) {
112 c = (unsigned long)n;
113 for (k = 0; k < 8; k++)
114 c = c & 1 ? poly ^ (c >> 1) : c >> 1;
115 crc_table[0][n] = c;
116 }
117
118#ifdef BYFOUR
119 /* generate crc for each value followed by one, two, and three zeros, and
120 then the byte reversal of those as well as the first table */
121 for (n = 0; n < 256; n++) {
122 c = crc_table[0][n];
123 crc_table[4][n] = REV(c);
124 for (k = 1; k < 4; k++) {
125 c = crc_table[0][c & 0xff] ^ (c >> 8);
126 crc_table[k][n] = c;
127 crc_table[k + 4][n] = REV(c);
128 }
129 }
130#endif /* BYFOUR */
131
132 crc_table_empty = 0;
133
134#ifdef MAKECRCH
135 /* write out CRC tables to crc32.h */
136 {
137 FILE *out;
138
139 out = fopen("crc32.h", "w");
140 if (out == NULL) return;
141 fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
142 fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
143 fprintf(out, "local const unsigned long FAR ");
144 fprintf(out, "crc_table[TBLS][256] =\n{\n {\n");
145 write_table(out, crc_table[0]);
146# ifdef BYFOUR
147 fprintf(out, "#ifdef BYFOUR\n");
148 for (k = 1; k < 8; k++) {
149 fprintf(out, " },\n {\n");
150 write_table(out, crc_table[k]);
151 }
152 fprintf(out, "#endif\n");
153# endif /* BYFOUR */
154 fprintf(out, " }\n};\n");
155 fclose(out);
156 }
157#endif /* MAKECRCH */
158}
159
160#ifdef MAKECRCH
161local void write_table (FILE *out, const unsigned long FAR *table)
162{
163 int n;
164
165 for (n = 0; n < 256; n++)
166 fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", table[n],
167 n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
168}
169#endif /* MAKECRCH */
170
171#else /* !DYNAMIC_CRC_TABLE */
172/* ========================================================================
173 * Tables of CRC-32s of all single-byte values, made by make_crc_table().
174 */
175#include "zcrc32.h"
176#endif /* DYNAMIC_CRC_TABLE */
177
178/* =========================================================================
179 * This function can be used by asm versions of crc32()
180 */
181const uLongf * ZEXPORT get_crc_table (void)
182{
183#ifdef DYNAMIC_CRC_TABLE
184 if (crc_table_empty) make_crc_table();
185#endif /* DYNAMIC_CRC_TABLE */
186 return (const unsigned long FAR *)&crc_table[0][0];
187}
188
189/* ========================================================================= */
190#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
191#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
192
193/* ========================================================================= */
194unsigned long ZEXPORT crc32 (unsigned long crc, const unsigned char FAR *buf, unsigned len)
195{
196 if (buf == Z_NULL) return 0UL;
197
198#ifdef DYNAMIC_CRC_TABLE
199 if (crc_table_empty)
200 make_crc_table();
201#endif /* DYNAMIC_CRC_TABLE */
202
203#ifdef BYFOUR
204 if (sizeof(void *) == sizeof(ptrdiff_t)) {
205 u4 endian;
206
207 endian = 1;
208 if (*((unsigned char *)(&endian)))
209 return crc32_little(crc, buf, len);
210 else
211 return crc32_big(crc, buf, len);
212 }
213#endif /* BYFOUR */
214 crc = crc ^ 0xffffffffUL;
215 while (len >= 8) {
216 DO8;
217 len -= 8;
218 }
219 if (len) do {
220 DO1;
221 } while (--len);
222 return crc ^ 0xffffffffUL;
223}
224
225#ifdef BYFOUR
226
227/* ========================================================================= */
228#define DOLIT4 c ^= *buf4++; \
229 c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
230 crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
231#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
232
233/* ========================================================================= */
234local unsigned long crc32_little (unsigned long crc, const unsigned char FAR *buf, unsigned len)
235{
236 u4 c;
237 const u4 FAR *buf4;
238
239 c = (u4)crc;
240 c = ~c;
241 while (len && ((ptrdiff_t)buf & 3)) {
242 c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
243 len--;
244 }
245
246 buf4 = (const u4 FAR *)buf;
247 while (len >= 32) {
248 DOLIT32;
249 len -= 32;
250 }
251 while (len >= 4) {
252 DOLIT4;
253 len -= 4;
254 }
255 buf = (const unsigned char FAR *)buf4;
256
257 if (len) do {
258 c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
259 } while (--len);
260 c = ~c;
261 return (unsigned long)c;
262}
263
264/* ========================================================================= */
265#define DOBIG4 c ^= *++buf4; \
266 c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
267 crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
268#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
269
270/* ========================================================================= */
271local unsigned long crc32_big (unsigned long crc, const unsigned char FAR *buf, unsigned len)
272{
273 u4 c;
274 const u4 FAR *buf4;
275
276 c = REV((u4)crc);
277 c = ~c;
278 while (len && ((ptrdiff_t)buf & 3)) {
279 c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
280 len--;
281 }
282
283 buf4 = (const u4 FAR *)buf;
284 buf4--;
285 while (len >= 32) {
286 DOBIG32;
287 len -= 32;
288 }
289 while (len >= 4) {
290 DOBIG4;
291 len -= 4;
292 }
293 buf4++;
294 buf = (const unsigned char FAR *)buf4;
295
296 if (len) do {
297 c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
298 } while (--len);
299 c = ~c;
300 return (unsigned long)(REV(c));
301}
302
303#endif /* BYFOUR */
304#endif /* USE_GZIP */
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/zcrc32.h Source File

  • src
zcrc32.h
1/* crc32.h -- tables for rapid CRC calculation
2 * Generated automatically by crc32.c
3 */
4
5local const unsigned long FAR crc_table[TBLS][256] =
6{
7 {
8 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
9 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
10 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
11 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
12 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
13 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
14 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
15 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
16 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
17 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
18 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
19 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
20 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
21 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
22 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
23 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
24 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
25 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
26 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
27 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
28 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
29 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
30 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
31 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
32 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
33 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
34 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
35 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
36 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
37 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
38 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
39 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
40 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
41 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
42 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
43 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
44 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
45 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
46 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
47 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
48 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
49 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
50 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
51 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
52 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
53 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
54 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
55 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
56 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
57 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
58 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
59 0x2d02ef8dUL
60#ifdef BYFOUR
61 },
62 {
63 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
64 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
65 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
66 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
67 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
68 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
69 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
70 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
71 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
72 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
73 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
74 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
75 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
76 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
77 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
78 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
79 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
80 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
81 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
82 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
83 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
84 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
85 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
86 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
87 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
88 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
89 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
90 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
91 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
92 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
93 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
94 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
95 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
96 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
97 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
98 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
99 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
100 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
101 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
102 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
103 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
104 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
105 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
106 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
107 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
108 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
109 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
110 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
111 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
112 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
113 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
114 0x9324fd72UL
115 },
116 {
117 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
118 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
119 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
120 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
121 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
122 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
123 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
124 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
125 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
126 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
127 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
128 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
129 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
130 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
131 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
132 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
133 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
134 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
135 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
136 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
137 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
138 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
139 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
140 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
141 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
142 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
143 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
144 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
145 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
146 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
147 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
148 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
149 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
150 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
151 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
152 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
153 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
154 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
155 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
156 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
157 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
158 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
159 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
160 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
161 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
162 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
163 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
164 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
165 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
166 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
167 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
168 0xbe9834edUL
169 },
170 {
171 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
172 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
173 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
174 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
175 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
176 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
177 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
178 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
179 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
180 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
181 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
182 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
183 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
184 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
185 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
186 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
187 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
188 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
189 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
190 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
191 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
192 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
193 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
194 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
195 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
196 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
197 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
198 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
199 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
200 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
201 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
202 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
203 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
204 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
205 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
206 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
207 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
208 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
209 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
210 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
211 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
212 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
213 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
214 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
215 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
216 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
217 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
218 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
219 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
220 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
221 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
222 0xde0506f1UL
223 },
224 {
225 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
226 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
227 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
228 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
229 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
230 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
231 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
232 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
233 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
234 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
235 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
236 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
237 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
238 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
239 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
240 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
241 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
242 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
243 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
244 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
245 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
246 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
247 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
248 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
249 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
250 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
251 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
252 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
253 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
254 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
255 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
256 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
257 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
258 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
259 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
260 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
261 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
262 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
263 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
264 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
265 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
266 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
267 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
268 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
269 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
270 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
271 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
272 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
273 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
274 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
275 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
276 0x8def022dUL
277 },
278 {
279 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
280 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
281 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
282 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
283 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
284 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
285 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
286 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
287 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
288 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
289 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
290 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
291 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
292 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
293 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
294 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
295 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
296 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
297 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
298 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
299 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
300 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
301 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
302 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
303 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
304 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
305 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
306 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
307 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
308 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
309 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
310 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
311 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
312 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
313 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
314 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
315 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
316 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
317 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
318 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
319 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
320 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
321 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
322 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
323 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
324 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
325 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
326 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
327 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
328 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
329 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
330 0x72fd2493UL
331 },
332 {
333 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
334 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
335 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
336 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
337 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
338 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
339 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
340 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
341 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
342 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
343 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
344 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
345 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
346 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
347 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
348 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
349 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
350 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
351 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
352 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
353 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
354 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
355 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
356 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
357 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
358 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
359 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
360 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
361 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
362 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
363 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
364 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
365 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
366 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
367 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
368 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
369 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
370 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
371 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
372 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
373 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
374 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
375 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
376 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
377 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
378 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
379 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
380 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
381 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
382 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
383 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
384 0xed3498beUL
385 },
386 {
387 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
388 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
389 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
390 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
391 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
392 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
393 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
394 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
395 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
396 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
397 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
398 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
399 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
400 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
401 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
402 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
403 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
404 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
405 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
406 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
407 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
408 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
409 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
410 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
411 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
412 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
413 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
414 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
415 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
416 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
417 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
418 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
419 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
420 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
421 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
422 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
423 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
424 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
425 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
426 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
427 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
428 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
429 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
430 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
431 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
432 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
433 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
434 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
435 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
436 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
437 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
438 0xf10605deUL
439#endif
440 }
441};


Watt-32 tcp/ip: E:/WATT/src/zdeflate.c Source File

  • src
zdeflate.c
1/* deflate.c -- compress data using the deflation algorithm
2 * Copyright (C) 1995-2003 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/*
7 * ALGORITHM
8 *
9 * The "deflation" process depends on being able to identify portions
10 * of the input text which are identical to earlier input (within a
11 * sliding window trailing behind the input currently being processed).
12 *
13 * The most straightforward technique turns out to be the fastest for
14 * most input files: try all possible matches and select the longest.
15 * The key feature of this algorithm is that insertions into the string
16 * dictionary are very simple and thus fast, and deletions are avoided
17 * completely. Insertions are performed at each input character, whereas
18 * string matches are performed only when the previous match ends. So it
19 * is preferable to spend more time in matches to allow very fast string
20 * insertions and avoid deletions. The matching algorithm for small
21 * strings is inspired from that of Rabin & Karp. A brute force approach
22 * is used to find longer strings when a small match has been found.
23 * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
24 * (by Leonid Broukhis).
25 * A previous version of this file used a more sophisticated algorithm
26 * (by Fiala and Greene) which is guaranteed to run in linear amortized
27 * time, but has a larger average cost, uses more memory and is patented.
28 * However the F&G algorithm may be faster for some highly redundant
29 * files if the parameter max_chain_length (described below) is too large.
30 *
31 * ACKNOWLEDGEMENTS
32 *
33 * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
34 * I found it in 'freeze' written by Leonid Broukhis.
35 * Thanks to many people for bug reports and testing.
36 *
37 * REFERENCES
38 *
39 * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
40 * Available in http://www.ietf.org/rfc/rfc1951.txt
41 *
42 * A description of the Rabin and Karp algorithm is given in the book
43 * "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
44 *
45 * Fiala,E.R., and Greene,D.H.
46 * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
47 *
48 */
49
50/* @(#) $Id$ */
51
52#include "wattcp.h"
53#include "zdeflate.h"
54
55#if defined(USE_GZIP)
56
57const char deflate_copyright[] =
58 " deflate 1.2.1 Copyright 1995-2003 Jean-loup Gailly ";
59/*
60 If you use the zlib library in a product, an acknowledgment is welcome
61 in the documentation of your product. If for some reason you cannot
62 include such an acknowledgment, I would appreciate that you keep this
63 copyright string in the executable of your product.
64 */
65
66/* ===========================================================================
67 * Function prototypes.
68 */
69typedef enum {
70 need_more, /* block not completed, need more input or more output */
71 block_done, /* block flush performed */
72 finish_started, /* finish started, need only more output at next deflate */
73 finish_done /* finish done, accept no more input or output */
74} block_state;
75
76typedef block_state (*compress_func) (deflate_state *s, int flush);
77/* Compression function. Returns the block state after the call. */
78
79local void fill_window (deflate_state *s);
80local block_state deflate_stored (deflate_state *s, int flush);
81local block_state deflate_fast (deflate_state *s, int flush);
82#ifndef FASTEST
83local block_state deflate_slow (deflate_state *s, int flush);
84#endif
85local void lm_init (deflate_state *s);
86local void putShortMSB (deflate_state *s, uInt b);
87local void flush_pending (z_streamp strm);
88local int read_buf (z_streamp strm, Bytef *buf, unsigned size);
89#ifndef FASTEST
90#ifdef ASMV
91 void match_init (void); /* asm code initialization */
92 uInt longest_match (deflate_state *s, IPos cur_match);
93#else
94local uInt longest_match (deflate_state *s, IPos cur_match);
95#endif
96#endif
97local uInt longest_match_fast (deflate_state *s, IPos cur_match);
98
99#ifdef DEBUG
100local void check_match (deflate_state *s, IPos start, IPos match,
101 int length);
102#endif
103
104/* ===========================================================================
105 * Local data
106 */
107
108#define NIL 0
109/* Tail of hash chains */
110
111#ifndef TOO_FAR
112# define TOO_FAR 4096
113#endif
114/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
115
116#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
117/* Minimum amount of lookahead, except at the end of the input file.
118 * See deflate.c for comments about the MIN_MATCH+1.
119 */
120
121/* Values for max_lazy_match, good_match and max_chain_length, depending on
122 * the desired pack level (0..9). The values given below have been tuned to
123 * exclude worst case performance for pathological files. Better values may be
124 * found for specific files.
125 */
126typedef struct config_s {
127 ush good_length; /* reduce lazy search above this match length */
128 ush max_lazy; /* do not perform lazy search above this match length */
129 ush nice_length; /* quit search above this match length */
130 ush max_chain;
131 compress_func func;
132} config;
133
134#ifdef FASTEST
135local const config configuration_table[2] = {
136/* good lazy nice chain */
137/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
138/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */
139#else
140local const config configuration_table[10] = {
141/* good lazy nice chain */
142/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
143/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */
144/* 2 */ {4, 5, 16, 8, deflate_fast},
145/* 3 */ {4, 6, 32, 32, deflate_fast},
146
147/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */
148/* 5 */ {8, 16, 32, 32, deflate_slow},
149/* 6 */ {8, 16, 128, 128, deflate_slow},
150/* 7 */ {8, 32, 128, 256, deflate_slow},
151/* 8 */ {32, 128, 258, 1024, deflate_slow},
152/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */
153#endif
154
155/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
156 * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
157 * meaning.
158 */
159
160#define EQUAL 0
161/* result of memcmp for equal strings */
162
163#ifndef NO_DUMMY_DECL
164struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
165#endif
166
167/* ===========================================================================
168 * Update a hash value with the given input byte
169 * IN assertion: all calls to to UPDATE_HASH are made with consecutive
170 * input characters, so that a running hash key can be computed from the
171 * previous key instead of complete recalculation each time.
172 */
173#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
174
175
176/* ===========================================================================
177 * Insert string str in the dictionary and set match_head to the previous head
178 * of the hash chain (the most recent string with same hash key). Return
179 * the previous length of the hash chain.
180 * If this file is compiled with -DFASTEST, the compression level is forced
181 * to 1, and no hash chains are maintained.
182 * IN assertion: all calls to to INSERT_STRING are made with consecutive
183 * input characters and the first MIN_MATCH bytes of str are valid
184 * (except for the last MIN_MATCH-1 bytes of the input file).
185 */
186#ifdef FASTEST
187#define INSERT_STRING(s, str, match_head) \
188 (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
189 match_head = s->head[s->ins_h], \
190 s->head[s->ins_h] = (Pos)(str))
191#else
192#define INSERT_STRING(s, str, match_head) \
193 (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
194 match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
195 s->head[s->ins_h] = (Pos)(str))
196#endif
197
198/* ===========================================================================
199 * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
200 * prev[] will be initialized on the fly.
201 */
202#define CLEAR_HASH(s) \
203 s->head[s->hash_size-1] = NIL; \
204 zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
205
206/* ========================================================================= */
207int ZEXPORT deflateInit_ (z_streamp strm,
208 int level,
209 const char *version,
210 int stream_size)
211{
212 return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
213 Z_DEFAULT_STRATEGY, version, stream_size);
214 /* To do: ignore strm->next_in if we use it as window */
215}
216
217/* ========================================================================= */
218int ZEXPORT deflateInit2_ (z_streamp strm,
219 int level,
220 int method,
221 int windowBits,
222 int memLevel,
223 int strategy,
224 const char *version,
225 int stream_size)
226{
227 deflate_state *s;
228 int wrap = 1;
229 static const char my_version[] = ZLIB_VERSION;
230
231 ushf *overlay;
232 /* We overlay pending_buf and d_buf+l_buf. This works since the average
233 * output size for (length,distance) codes is <= 24 bits.
234 */
235
236 if (version == Z_NULL || version[0] != my_version[0] ||
237 stream_size != sizeof(z_stream)) {
238 return Z_VERSION_ERROR;
239 }
240 if (strm == Z_NULL) return Z_STREAM_ERROR;
241
242 strm->msg = Z_NULL;
243 if (strm->zalloc == (alloc_func)0) {
244 strm->zalloc = zcalloc;
245 strm->opaque = (voidpf)0;
246 }
247 if (strm->zfree == (free_func)0) strm->zfree = zcfree;
248
249#ifdef FASTEST
250 if (level != 0) level = 1;
251#else
252 if (level == Z_DEFAULT_COMPRESSION) level = 6;
253#endif
254
255 if (windowBits < 0) { /* suppress zlib wrapper */
256 wrap = 0;
257 windowBits = -windowBits;
258 }
259#ifdef GZIP
260 else if (windowBits > 15) {
261 wrap = 2; /* write gzip wrapper instead */
262 windowBits -= 16;
263 }
264#endif
265 if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
266 windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
267 strategy < 0 || strategy > Z_RLE) {
268 return Z_STREAM_ERROR;
269 }
270 if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */
271 s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
272 if (s == Z_NULL) return Z_MEM_ERROR;
273 strm->state = (struct internal_state FAR *)s;
274 s->strm = strm;
275
276 s->wrap = wrap;
277 s->w_bits = windowBits;
278 s->w_size = 1 << s->w_bits;
279 s->w_mask = s->w_size - 1;
280
281 s->hash_bits = memLevel + 7;
282 s->hash_size = 1 << s->hash_bits;
283 s->hash_mask = s->hash_size - 1;
284 s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
285
286 s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
287 s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
288 s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
289
290 s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
291
292 overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
293 s->pending_buf = (uchf *) overlay;
294 s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
295
296 if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
297 s->pending_buf == Z_NULL) {
298 s->status = FINISH_STATE;
299 strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
300 deflateEnd (strm);
301 return Z_MEM_ERROR;
302 }
303 s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
304 s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
305
306 s->level = level;
307 s->strategy = strategy;
308 s->method = (Byte)method;
309
310 return deflateReset(strm);
311}
312
313/* ========================================================================= */
314int ZEXPORT deflateSetDictionary (z_streamp strm,
315 const Bytef *dictionary,
316 uInt dictLength)
317{
318 deflate_state *s;
319 uInt length = dictLength;
320 uInt n;
321 IPos hash_head = 0;
322
323 if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL ||
324 strm->state->wrap == 2 ||
325 (strm->state->wrap == 1 && strm->state->status != INIT_STATE))
326 return Z_STREAM_ERROR;
327
328 s = strm->state;
329 if (s->wrap)
330 strm->adler = adler32(strm->adler, dictionary, dictLength);
331
332 if (length < MIN_MATCH) return Z_OK;
333 if (length > MAX_DIST(s)) {
334 length = MAX_DIST(s);
335#ifndef USE_DICT_HEAD
336 dictionary += dictLength - length; /* use the tail of the dictionary */
337#endif
338 }
339 zmemcpy(s->window, dictionary, length);
340 s->strstart = length;
341 s->block_start = (long)length;
342
343 /* Insert all strings in the hash table (except for the last two bytes).
344 * s->lookahead stays null, so s->ins_h will be recomputed at the next
345 * call of fill_window.
346 */
347 s->ins_h = s->window[0];
348 UPDATE_HASH(s, s->ins_h, s->window[1]);
349 for (n = 0; n <= length - MIN_MATCH; n++) {
350 INSERT_STRING(s, n, hash_head);
351 }
352 if (hash_head) hash_head = 0; /* to make compiler happy */
353 return Z_OK;
354}
355
356/* ========================================================================= */
357int ZEXPORT deflateReset (z_streamp strm)
358{
359 deflate_state *s;
360
361 if (strm == Z_NULL || strm->state == Z_NULL ||
362 strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
363 return Z_STREAM_ERROR;
364 }
365
366 strm->total_in = strm->total_out = 0;
367 strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
368 strm->data_type = Z_UNKNOWN;
369
370 s = (deflate_state *)strm->state;
371 s->pending = 0;
372 s->pending_out = s->pending_buf;
373
374 if (s->wrap < 0) {
375 s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
376 }
377 s->status = s->wrap ? INIT_STATE : BUSY_STATE;
378 strm->adler =
379#ifdef GZIP
380 s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
381#endif
382 adler32(0L, Z_NULL, 0);
383 s->last_flush = Z_NO_FLUSH;
384
385 _tr_init(s);
386 lm_init(s);
387
388 return Z_OK;
389}
390
391/* ========================================================================= */
392int ZEXPORT deflatePrime (z_streamp strm, int bits, int value)
393{
394 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
395 strm->state->bi_valid = bits;
396 strm->state->bi_buf = (ush)(value & ((1 << bits) - 1));
397 return Z_OK;
398}
399
400/* ========================================================================= */
401int ZEXPORT deflateParams (z_streamp strm, int level, int strategy)
402{
403 deflate_state *s;
404 compress_func func;
405 int err = Z_OK;
406
407 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
408 s = strm->state;
409
410#ifdef FASTEST
411 if (level != 0) level = 1;
412#else
413 if (level == Z_DEFAULT_COMPRESSION) level = 6;
414#endif
415 if (level < 0 || level > 9 || strategy < 0 || strategy > Z_RLE) {
416 return Z_STREAM_ERROR;
417 }
418 func = configuration_table[s->level].func;
419
420 if (func != configuration_table[level].func && strm->total_in != 0) {
421 /* Flush the last buffer: */
422 err = deflate(strm, Z_PARTIAL_FLUSH);
423 }
424 if (s->level != level) {
425 s->level = level;
426 s->max_lazy_match = configuration_table[level].max_lazy;
427 s->good_match = configuration_table[level].good_length;
428 s->nice_match = configuration_table[level].nice_length;
429 s->max_chain_length = configuration_table[level].max_chain;
430 }
431 s->strategy = strategy;
432 return err;
433}
434
435/* =========================================================================
436 * For the default windowBits of 15 and memLevel of 8, this function returns
437 * a close to exact, as well as small, upper bound on the compressed size.
438 * They are coded as constants here for a reason--if the #define's are
439 * changed, then this function needs to be changed as well. The return
440 * value for 15 and 8 only works for those exact settings.
441 *
442 * For any setting other than those defaults for windowBits and memLevel,
443 * the value returned is a conservative worst case for the maximum expansion
444 * resulting from using fixed blocks instead of stored blocks, which deflate
445 * can emit on compressed data for some combinations of the parameters.
446 *
447 * This function could be more sophisticated to provide closer upper bounds
448 * for every combination of windowBits and memLevel, as well as wrap.
449 * But even the conservative upper bound of about 14% expansion does not
450 * seem onerous for output buffer allocation.
451 */
452uLong ZEXPORT deflateBound (z_streamp strm, uLong sourceLen)
453{
454 deflate_state *s;
455 uLong destLen;
456
457 /* conservative upper bound */
458 destLen = sourceLen +
459 ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 11;
460
461 /* if can't get parameters, return conservative bound */
462 if (strm == Z_NULL || strm->state == Z_NULL)
463 return destLen;
464
465 /* if not default parameters, return conservative bound */
466 s = strm->state;
467 if (s->w_bits != 15 || s->hash_bits != 8 + 7)
468 return destLen;
469
470 /* default settings: return tight bound for that case */
471 return compressBound(sourceLen);
472}
473
474/* =========================================================================
475 * Put a short in the pending buffer. The 16-bit value is put in MSB order.
476 * IN assertion: the stream state is correct and there is enough room in
477 * pending_buf.
478 */
479local void putShortMSB (deflate_state *s, uInt b)
480{
481 put_byte(s, (Byte)(b >> 8));
482 put_byte(s, (Byte)(b & 0xff));
483}
484
485/* =========================================================================
486 * Flush as much pending output as possible. All deflate() output goes
487 * through this function so some applications may wish to modify it
488 * to avoid allocating a large strm->next_out buffer and copying into it.
489 * (See also read_buf()).
490 */
491local void flush_pending (z_streamp strm)
492{
493 unsigned len = strm->state->pending;
494
495 if (len > strm->avail_out) len = strm->avail_out;
496 if (len == 0) return;
497
498 zmemcpy(strm->next_out, strm->state->pending_out, len);
499 strm->next_out += len;
500 strm->state->pending_out += len;
501 strm->total_out += len;
502 strm->avail_out -= len;
503 strm->state->pending -= len;
504 if (strm->state->pending == 0) {
505 strm->state->pending_out = strm->state->pending_buf;
506 }
507}
508
509/* ========================================================================= */
510int ZEXPORT deflate (z_streamp strm, int flush)
511{
512 int old_flush; /* value of flush param for previous deflate call */
513 deflate_state *s;
514
515 if (strm == Z_NULL || strm->state == Z_NULL ||
516 flush > Z_FINISH || flush < 0) {
517 return Z_STREAM_ERROR;
518 }
519 s = strm->state;
520
521 if (strm->next_out == Z_NULL ||
522 (strm->next_in == Z_NULL && strm->avail_in != 0) ||
523 (s->status == FINISH_STATE && flush != Z_FINISH)) {
524 ERR_RETURN(strm, Z_STREAM_ERROR);
525 }
526 if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
527
528 s->strm = strm; /* just in case */
529 old_flush = s->last_flush;
530 s->last_flush = flush;
531
532 /* Write the header */
533 if (s->status == INIT_STATE) {
534#ifdef GZIP
535 if (s->wrap == 2) {
536 put_byte(s, 31);
537 put_byte(s, 139);
538 put_byte(s, 8);
539 put_byte(s, 0);
540 put_byte(s, 0);
541 put_byte(s, 0);
542 put_byte(s, 0);
543 put_byte(s, 0);
544 put_byte(s, s->level == 9 ? 2 :
545 (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
546 4 : 0));
547 put_byte(s, 255);
548 s->status = BUSY_STATE;
549 strm->adler = crc32(0L, Z_NULL, 0);
550 }
551 else
552#endif
553 {
554 uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
555 uInt level_flags;
556
557 if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
558 level_flags = 0;
559 else if (s->level < 6)
560 level_flags = 1;
561 else if (s->level == 6)
562 level_flags = 2;
563 else
564 level_flags = 3;
565 header |= (level_flags << 6);
566 if (s->strstart != 0) header |= PRESET_DICT;
567 header += 31 - (header % 31);
568
569 s->status = BUSY_STATE;
570 putShortMSB(s, header);
571
572 /* Save the adler32 of the preset dictionary: */
573 if (s->strstart != 0) {
574 putShortMSB(s, (uInt)(strm->adler >> 16));
575 putShortMSB(s, (uInt)(strm->adler & 0xffff));
576 }
577 strm->adler = adler32(0L, Z_NULL, 0);
578 }
579 }
580
581 /* Flush as much pending output as possible */
582 if (s->pending != 0) {
583 flush_pending(strm);
584 if (strm->avail_out == 0) {
585 /* Since avail_out is 0, deflate will be called again with
586 * more output space, but possibly with both pending and
587 * avail_in equal to zero. There won't be anything to do,
588 * but this is not an error situation so make sure we
589 * return OK instead of BUF_ERROR at next call of deflate:
590 */
591 s->last_flush = -1;
592 return Z_OK;
593 }
594
595 /* Make sure there is something to do and avoid duplicate consecutive
596 * flushes. For repeated and useless calls with Z_FINISH, we keep
597 * returning Z_STREAM_END instead of Z_BUF_ERROR.
598 */
599 } else if (strm->avail_in == 0 && flush <= old_flush &&
600 flush != Z_FINISH) {
601 ERR_RETURN(strm, Z_BUF_ERROR);
602 }
603
604 /* User must not provide more input after the first FINISH: */
605 if (s->status == FINISH_STATE && strm->avail_in != 0) {
606 ERR_RETURN(strm, Z_BUF_ERROR);
607 }
608
609 /* Start a new block or continue the current one.
610 */
611 if (strm->avail_in != 0 || s->lookahead != 0 ||
612 (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
613 block_state bstate;
614
615 bstate = (*(configuration_table[s->level].func))(s, flush);
616
617 if (bstate == finish_started || bstate == finish_done) {
618 s->status = FINISH_STATE;
619 }
620 if (bstate == need_more || bstate == finish_started) {
621 if (strm->avail_out == 0) {
622 s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
623 }
624 return Z_OK;
625 /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
626 * of deflate should use the same flush parameter to make sure
627 * that the flush is complete. So we don't have to output an
628 * empty block here, this will be done at next call. This also
629 * ensures that for a very small output buffer, we emit at most
630 * one empty block.
631 */
632 }
633 if (bstate == block_done) {
634 if (flush == Z_PARTIAL_FLUSH) {
635 _tr_align(s);
636 } else { /* FULL_FLUSH or SYNC_FLUSH */
637 _tr_stored_block(s, (char*)0, 0L, 0);
638 /* For a full flush, this empty block will be recognized
639 * as a special marker by inflate_sync().
640 */
641 if (flush == Z_FULL_FLUSH) {
642 CLEAR_HASH(s); /* forget history */
643 }
644 }
645 flush_pending(strm);
646 if (strm->avail_out == 0) {
647 s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
648 return Z_OK;
649 }
650 }
651 }
652 Assert(strm->avail_out > 0, "bug2");
653
654 if (flush != Z_FINISH) return Z_OK;
655 if (s->wrap <= 0) return Z_STREAM_END;
656
657 /* Write the trailer */
658#ifdef GZIP
659 if (s->wrap == 2) {
660 put_byte(s, (Byte)(strm->adler & 0xff));
661 put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
662 put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
663 put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
664 put_byte(s, (Byte)(strm->total_in & 0xff));
665 put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
666 put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
667 put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
668 }
669 else
670#endif
671 {
672 putShortMSB(s, (uInt)(strm->adler >> 16));
673 putShortMSB(s, (uInt)(strm->adler & 0xffff));
674 }
675 flush_pending(strm);
676 /* If avail_out is zero, the application will call deflate again
677 * to flush the rest.
678 */
679 if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
680 return s->pending != 0 ? Z_OK : Z_STREAM_END;
681}
682
683/* ========================================================================= */
684int ZEXPORT deflateEnd (z_streamp strm)
685{
686 int status;
687
688 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
689
690 status = strm->state->status;
691 if (status != INIT_STATE && status != BUSY_STATE &&
692 status != FINISH_STATE) {
693 return Z_STREAM_ERROR;
694 }
695
696 /* Deallocate in reverse order of allocations: */
697 TRY_FREE(strm, strm->state->pending_buf);
698 TRY_FREE(strm, strm->state->head);
699 TRY_FREE(strm, strm->state->prev);
700 TRY_FREE(strm, strm->state->window);
701
702 ZFREE(strm, strm->state);
703 strm->state = Z_NULL;
704
705 return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
706}
707
708/* =========================================================================
709 * Copy the source state to the destination state.
710 * To simplify the source, this is not supported for 16-bit MSDOS (which
711 * doesn't have enough memory anyway to duplicate compression states).
712 */
713int ZEXPORT deflateCopy (z_streamp dest, z_streamp source)
714{
715#ifdef MAXSEG_64K
716 return Z_STREAM_ERROR;
717#else
718 deflate_state *ds;
719 deflate_state *ss;
720 ushf *overlay;
721
722
723 if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
724 return Z_STREAM_ERROR;
725 }
726
727 ss = source->state;
728
729 *dest = *source;
730
731 ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
732 if (ds == Z_NULL) return Z_MEM_ERROR;
733 dest->state = (struct internal_state FAR *) ds;
734 *ds = *ss;
735 ds->strm = dest;
736
737 ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
738 ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
739 ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
740 overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
741 ds->pending_buf = (uchf *) overlay;
742
743 if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
744 ds->pending_buf == Z_NULL) {
745 deflateEnd (dest);
746 return Z_MEM_ERROR;
747 }
748 /* following zmemcpy do not work for 16-bit MSDOS */
749 zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
750 zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
751 zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));
752 zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
753
754 ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
755 ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
756 ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
757
758 ds->l_desc.dyn_tree = ds->dyn_ltree;
759 ds->d_desc.dyn_tree = ds->dyn_dtree;
760 ds->bl_desc.dyn_tree = ds->bl_tree;
761
762 return Z_OK;
763#endif /* MAXSEG_64K */
764}
765
766/* ===========================================================================
767 * Read a new buffer from the current input stream, update the adler32
768 * and total number of bytes read. All deflate() input goes through
769 * this function so some applications may wish to modify it to avoid
770 * allocating a large strm->next_in buffer and copying from it.
771 * (See also flush_pending()).
772 */
773local int read_buf (z_streamp strm, Bytef *buf, unsigned size)
774{
775 unsigned len = strm->avail_in;
776
777 if (len > size) len = size;
778 if (len == 0) return 0;
779
780 strm->avail_in -= len;
781
782 if (strm->state->wrap == 1) {
783 strm->adler = adler32(strm->adler, strm->next_in, len);
784 }
785#ifdef GZIP
786 else if (strm->state->wrap == 2) {
787 strm->adler = crc32(strm->adler, strm->next_in, len);
788 }
789#endif
790 zmemcpy(buf, strm->next_in, len);
791 strm->next_in += len;
792 strm->total_in += len;
793
794 return (int)len;
795}
796
797/* ===========================================================================
798 * Initialize the "longest match" routines for a new zlib stream
799 */
800local void lm_init (deflate_state *s)
801{
802 s->window_size = (ulg)2L*s->w_size;
803
804 CLEAR_HASH(s);
805
806 /* Set the default configuration parameters:
807 */
808 s->max_lazy_match = configuration_table[s->level].max_lazy;
809 s->good_match = configuration_table[s->level].good_length;
810 s->nice_match = configuration_table[s->level].nice_length;
811 s->max_chain_length = configuration_table[s->level].max_chain;
812
813 s->strstart = 0;
814 s->block_start = 0L;
815 s->lookahead = 0;
816 s->match_length = s->prev_length = MIN_MATCH-1;
817 s->match_available = 0;
818 s->ins_h = 0;
819#ifdef ASMV
820 match_init(); /* initialize the asm code */
821#endif
822}
823
824#ifndef FASTEST
825/* ===========================================================================
826 * Set match_start to the longest match starting at the given string and
827 * return its length. Matches shorter or equal to prev_length are discarded,
828 * in which case the result is equal to prev_length and match_start is
829 * garbage.
830 * IN assertions: cur_match is the head of the hash chain for the current
831 * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
832 * OUT assertion: the match length is not greater than s->lookahead.
833 */
834#ifndef ASMV
835/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
836 * match.S. The code will be functionally equivalent.
837 */
838local uInt longest_match (deflate_state *s,
839 IPos cur_match) /* current match */
840{
841 unsigned chain_length = s->max_chain_length; /* max hash chain length */
842 Bytef *scan = s->window + s->strstart; /* current string */
843 Bytef *match; /* matched string */
844 int len; /* length of current match */
845 int best_len = s->prev_length; /* best match length so far */
846 int nice_match = s->nice_match; /* stop if match long enough */
847 IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
848 s->strstart - (IPos)MAX_DIST(s) : NIL;
849 /* Stop when cur_match becomes <= limit. To simplify the code,
850 * we prevent matches with the string of window index 0.
851 */
852 Posf *prev = s->prev;
853 uInt wmask = s->w_mask;
854
855#ifdef UNALIGNED_OK
856 /* Compare two bytes at a time. Note: this is not always beneficial.
857 * Try with and without -DUNALIGNED_OK to check.
858 */
859 Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
860 ush scan_start = *(ushf*)scan;
861 ush scan_end = *(ushf*)(scan+best_len-1);
862#else
863 Bytef *strend = s->window + s->strstart + MAX_MATCH;
864 Byte scan_end1 = scan[best_len-1];
865 Byte scan_end = scan[best_len];
866#endif
867
868 /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
869 * It is easy to get rid of this optimization if necessary.
870 */
871 Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
872
873 /* Do not waste too much time if we already have a good match: */
874 if (s->prev_length >= s->good_match) {
875 chain_length >>= 2;
876 }
877 /* Do not look for matches beyond the end of the input. This is necessary
878 * to make deflate deterministic.
879 */
880 if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
881
882 Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
883
884 do {
885 Assert(cur_match < s->strstart, "no future");
886 match = s->window + cur_match;
887
888 /* Skip to next match if the match length cannot increase
889 * or if the match length is less than 2:
890 */
891#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
892 /* This code assumes sizeof(unsigned short) == 2. Do not use
893 * UNALIGNED_OK if your compiler uses a different size.
894 */
895 if (*(ushf*)(match+best_len-1) != scan_end ||
896 *(ushf*)match != scan_start) continue;
897
898 /* It is not necessary to compare scan[2] and match[2] since they are
899 * always equal when the other bytes match, given that the hash keys
900 * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
901 * strstart+3, +5, ... up to strstart+257. We check for insufficient
902 * lookahead only every 4th comparison; the 128th check will be made
903 * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
904 * necessary to put more guard bytes at the end of the window, or
905 * to check more often for insufficient lookahead.
906 */
907 Assert(scan[2] == match[2], "scan[2]?");
908 scan++, match++;
909 do {
910 } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
911 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
912 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
913 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
914 scan < strend);
915 /* The funny "do {}" generates better code on most compilers */
916
917 /* Here, scan <= window+strstart+257 */
918 Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
919 if (*scan == *match) scan++;
920
921 len = (MAX_MATCH - 1) - (int)(strend-scan);
922 scan = strend - (MAX_MATCH-1);
923
924#else /* UNALIGNED_OK */
925
926 if (match[best_len] != scan_end ||
927 match[best_len-1] != scan_end1 ||
928 *match != *scan ||
929 *++match != scan[1]) continue;
930
931 /* The check at best_len-1 can be removed because it will be made
932 * again later. (This heuristic is not always a win.)
933 * It is not necessary to compare scan[2] and match[2] since they
934 * are always equal when the other bytes match, given that
935 * the hash keys are equal and that HASH_BITS >= 8.
936 */
937 scan += 2, match++;
938 Assert(*scan == *match, "match[2]?");
939
940 /* We check for insufficient lookahead only every 8th comparison;
941 * the 256th check will be made at strstart+258.
942 */
943 do {
944 } while (*++scan == *++match && *++scan == *++match &&
945 *++scan == *++match && *++scan == *++match &&
946 *++scan == *++match && *++scan == *++match &&
947 *++scan == *++match && *++scan == *++match &&
948 scan < strend);
949
950 Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
951
952 len = MAX_MATCH - (int)(strend - scan);
953 scan = strend - MAX_MATCH;
954
955#endif /* UNALIGNED_OK */
956
957 if (len > best_len) {
958 s->match_start = cur_match;
959 best_len = len;
960 if (len >= nice_match) break;
961#ifdef UNALIGNED_OK
962 scan_end = *(ushf*)(scan+best_len-1);
963#else
964 scan_end1 = scan[best_len-1];
965 scan_end = scan[best_len];
966#endif
967 }
968 } while ((cur_match = prev[cur_match & wmask]) > limit
969 && --chain_length != 0);
970
971 if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
972 return s->lookahead;
973}
974#endif /* ASMV */
975#endif /* FASTEST */
976
977/* ---------------------------------------------------------------------------
978 * Optimized version for level == 1 or strategy == Z_RLE only
979 */
980local uInt longest_match_fast (deflate_state *s,
981 IPos cur_match) /* current match */
982{
983 Bytef *scan = s->window + s->strstart; /* current string */
984 Bytef *match; /* matched string */
985 int len; /* length of current match */
986 Bytef *strend = s->window + s->strstart + MAX_MATCH;
987
988 /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
989 * It is easy to get rid of this optimization if necessary.
990 */
991 Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
992
993 Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
994
995 Assert(cur_match < s->strstart, "no future");
996
997 match = s->window + cur_match;
998
999 /* Return failure if the match length is less than 2:
1000 */
1001 if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
1002
1003 /* The check at best_len-1 can be removed because it will be made
1004 * again later. (This heuristic is not always a win.)
1005 * It is not necessary to compare scan[2] and match[2] since they
1006 * are always equal when the other bytes match, given that
1007 * the hash keys are equal and that HASH_BITS >= 8.
1008 */
1009 scan += 2, match += 2;
1010 Assert(*scan == *match, "match[2]?");
1011
1012 /* We check for insufficient lookahead only every 8th comparison;
1013 * the 256th check will be made at strstart+258.
1014 */
1015 do {
1016 } while (*++scan == *++match && *++scan == *++match &&
1017 *++scan == *++match && *++scan == *++match &&
1018 *++scan == *++match && *++scan == *++match &&
1019 *++scan == *++match && *++scan == *++match &&
1020 scan < strend);
1021
1022 Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
1023
1024 len = MAX_MATCH - (int)(strend - scan);
1025
1026 if (len < MIN_MATCH) return MIN_MATCH - 1;
1027
1028 s->match_start = cur_match;
1029 return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
1030}
1031
1032#ifdef DEBUG
1033/* ===========================================================================
1034 * Check that the match at match_start is indeed a match.
1035 */
1036local void check_match (deflate_state *s,
1037 IPos start,
1038 IPos match,
1039 int length)
1040{
1041 /* check that the match is indeed a match */
1042 if (zmemcmp(s->window + match,
1043 s->window + start, length) != EQUAL) {
1044 fprintf(stderr, " start %u, match %u, length %d\n",
1045 start, match, length);
1046 do {
1047 fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
1048 } while (--length != 0);
1049 z_error("invalid match");
1050 }
1051 if (z_verbose > 1) {
1052 fprintf(stderr,"\\[%d,%d]", start-match, length);
1053 do { putc(s->window[start++], stderr); } while (--length != 0);
1054 }
1055}
1056#else
1057# define check_match(s, start, match, length)
1058#endif /* DEBUG */
1059
1060/* ===========================================================================
1061 * Fill the window when the lookahead becomes insufficient.
1062 * Updates strstart and lookahead.
1063 *
1064 * IN assertion: lookahead < MIN_LOOKAHEAD
1065 * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
1066 * At least one byte has been read, or avail_in == 0; reads are
1067 * performed for at least two bytes (required for the zip translate_eol
1068 * option -- not supported here).
1069 */
1070local void fill_window (deflate_state *s)
1071{
1072 unsigned n, m;
1073 Posf *p;
1074 unsigned more; /* Amount of free space at the end of the window. */
1075 uInt wsize = s->w_size;
1076
1077 do {
1078 more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
1079
1080#if (DOSX == 0)
1081 /* Deal with !@#$% 64K limit: */
1082 if (sizeof(int) <= 2) {
1083 if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
1084 more = wsize;
1085
1086 } else if (more == (unsigned)(-1)) {
1087 /* Very unlikely, but possible on 16 bit machine if
1088 * strstart == 0 && lookahead == 1 (input done a byte at time)
1089 */
1090 more--;
1091 }
1092 }
1093#endif
1094
1095 /* If the window is almost full and there is insufficient lookahead,
1096 * move the upper half to the lower one to make room in the upper half.
1097 */
1098 if (s->strstart >= wsize+MAX_DIST(s)) {
1099
1100 zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
1101 s->match_start -= wsize;
1102 s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
1103 s->block_start -= (long) wsize;
1104
1105 /* Slide the hash table (could be avoided with 32 bit values
1106 at the expense of memory usage). We slide even when level == 0
1107 to keep the hash table consistent if we switch back to level > 0
1108 later. (Using level 0 permanently is not an optimal usage of
1109 zlib, so we don't care about this pathological case.)
1110 */
1111 n = s->hash_size;
1112 p = &s->head[n];
1113 do {
1114 m = *--p;
1115 *p = (Pos)(m >= wsize ? m-wsize : NIL);
1116 } while (--n);
1117
1118 n = wsize;
1119#ifndef FASTEST
1120 p = &s->prev[n];
1121 do {
1122 m = *--p;
1123 *p = (Pos)(m >= wsize ? m-wsize : NIL);
1124 /* If n is not on any hash chain, prev[n] is garbage but
1125 * its value will never be used.
1126 */
1127 } while (--n);
1128#endif
1129 more += wsize;
1130 }
1131 if (s->strm->avail_in == 0) return;
1132
1133 /* If there was no sliding:
1134 * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
1135 * more == window_size - lookahead - strstart
1136 * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
1137 * => more >= window_size - 2*WSIZE + 2
1138 * In the BIG_MEM or MMAP case (not yet supported),
1139 * window_size == input_size + MIN_LOOKAHEAD &&
1140 * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
1141 * Otherwise, window_size == 2*WSIZE so more >= 2.
1142 * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
1143 */
1144 Assert(more >= 2, "more < 2");
1145
1146 n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
1147 s->lookahead += n;
1148
1149 /* Initialize the hash value now that we have some input: */
1150 if (s->lookahead >= MIN_MATCH) {
1151 s->ins_h = s->window[s->strstart];
1152 UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
1153#if MIN_MATCH != 3
1154 Call UPDATE_HASH() MIN_MATCH-3 more times
1155#endif
1156 }
1157 /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
1158 * but this is not important since only literal bytes will be emitted.
1159 */
1160
1161 } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
1162}
1163
1164/* ===========================================================================
1165 * Flush the current block, with given end-of-file flag.
1166 * IN assertion: strstart is set to the end of the current match.
1167 */
1168#define FLUSH_BLOCK_ONLY(s, eof) { \
1169 _tr_flush_block(s, (s->block_start >= 0L ? \
1170 (charf *)&s->window[(unsigned)s->block_start] : \
1171 (charf *)Z_NULL), \
1172 (ulg)((long)s->strstart - s->block_start), \
1173 (eof)); \
1174 s->block_start = s->strstart; \
1175 flush_pending(s->strm); \
1176 Tracev((stderr,"[FLUSH]")); \
1177}
1178
1179/* Same but force premature exit if necessary. */
1180#define FLUSH_BLOCK(s, eof) { \
1181 FLUSH_BLOCK_ONLY(s, eof); \
1182 if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
1183}
1184
1185/* ===========================================================================
1186 * Copy without compression as much as possible from the input stream, return
1187 * the current block state.
1188 * This function does not insert new strings in the dictionary since
1189 * uncompressible data is probably not useful. This function is used
1190 * only for the level=0 compression option.
1191 * NOTE: this function should be optimized to avoid extra copying from
1192 * window to pending_buf.
1193 */
1194local block_state deflate_stored (deflate_state *s, int flush)
1195{
1196 /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
1197 * to pending_buf_size, and each stored block has a 5 byte header:
1198 */
1199 ulg max_block_size = 0xffff;
1200 ulg max_start;
1201
1202 if (max_block_size > s->pending_buf_size - 5) {
1203 max_block_size = s->pending_buf_size - 5;
1204 }
1205
1206 /* Copy as much as possible from input to output: */
1207 for (;;) {
1208 /* Fill the window as much as possible: */
1209 if (s->lookahead <= 1) {
1210
1211 Assert(s->strstart < s->w_size+MAX_DIST(s) ||
1212 s->block_start >= (long)s->w_size, "slide too late");
1213
1214 fill_window(s);
1215 if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
1216
1217 if (s->lookahead == 0) break; /* flush the current block */
1218 }
1219 Assert(s->block_start >= 0L, "block gone");
1220
1221 s->strstart += s->lookahead;
1222 s->lookahead = 0;
1223
1224 /* Emit a stored block if pending_buf will be full: */
1225 max_start = s->block_start + max_block_size;
1226 if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
1227 /* strstart == 0 is possible when wraparound on 16-bit machine */
1228 s->lookahead = (uInt)(s->strstart - max_start);
1229 s->strstart = (uInt)max_start;
1230 FLUSH_BLOCK(s, 0);
1231 }
1232 /* Flush if we may have to slide, otherwise block_start may become
1233 * negative and the data will be gone:
1234 */
1235 if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
1236 FLUSH_BLOCK(s, 0);
1237 }
1238 }
1239 FLUSH_BLOCK(s, flush == Z_FINISH);
1240 return flush == Z_FINISH ? finish_done : block_done;
1241}
1242
1243/* ===========================================================================
1244 * Compress as much as possible from the input stream, return the current
1245 * block state.
1246 * This function does not perform lazy evaluation of matches and inserts
1247 * new strings in the dictionary only for unmatched strings or for short
1248 * matches. It is used only for the fast compression options.
1249 */
1250local block_state deflate_fast (deflate_state *s, int flush)
1251{
1252 IPos hash_head = NIL; /* head of the hash chain */
1253 int bflush; /* set if current block must be flushed */
1254
1255 for (;;) {
1256 /* Make sure that we always have enough lookahead, except
1257 * at the end of the input file. We need MAX_MATCH bytes
1258 * for the next match, plus MIN_MATCH bytes to insert the
1259 * string following the next match.
1260 */
1261 if (s->lookahead < MIN_LOOKAHEAD) {
1262 fill_window(s);
1263 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1264 return need_more;
1265 }
1266 if (s->lookahead == 0) break; /* flush the current block */
1267 }
1268
1269 /* Insert the string window[strstart .. strstart+2] in the
1270 * dictionary, and set hash_head to the head of the hash chain:
1271 */
1272 if (s->lookahead >= MIN_MATCH) {
1273 INSERT_STRING(s, s->strstart, hash_head);
1274 }
1275
1276 /* Find the longest match, discarding those <= prev_length.
1277 * At this point we have always match_length < MIN_MATCH
1278 */
1279 if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
1280 /* To simplify the code, we prevent matches with the string
1281 * of window index 0 (in particular we have to avoid a match
1282 * of the string with itself at the start of the input file).
1283 */
1284#ifdef FASTEST
1285 if ((s->strategy < Z_HUFFMAN_ONLY) ||
1286 (s->strategy == Z_RLE && s->strstart - hash_head == 1)) {
1287 s->match_length = longest_match_fast (s, hash_head);
1288 }
1289#else
1290 if (s->strategy < Z_HUFFMAN_ONLY) {
1291 s->match_length = longest_match (s, hash_head);
1292 } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
1293 s->match_length = longest_match_fast (s, hash_head);
1294 }
1295#endif
1296 /* longest_match() or longest_match_fast() sets match_start */
1297 }
1298 if (s->match_length >= MIN_MATCH) {
1299 check_match(s, s->strstart, s->match_start, s->match_length);
1300
1301 _tr_tally_dist(s, s->strstart - s->match_start,
1302 s->match_length - MIN_MATCH, bflush);
1303
1304 s->lookahead -= s->match_length;
1305
1306 /* Insert new strings in the hash table only if the match length
1307 * is not too large. This saves time but degrades compression.
1308 */
1309#ifndef FASTEST
1310 if (s->match_length <= s->max_insert_length &&
1311 s->lookahead >= MIN_MATCH) {
1312 s->match_length--; /* string at strstart already in table */
1313 do {
1314 s->strstart++;
1315 INSERT_STRING(s, s->strstart, hash_head);
1316 /* strstart never exceeds WSIZE-MAX_MATCH, so there are
1317 * always MIN_MATCH bytes ahead.
1318 */
1319 } while (--s->match_length != 0);
1320 s->strstart++;
1321 } else
1322#endif
1323 {
1324 s->strstart += s->match_length;
1325 s->match_length = 0;
1326 s->ins_h = s->window[s->strstart];
1327 UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
1328#if MIN_MATCH != 3
1329 Call UPDATE_HASH() MIN_MATCH-3 more times
1330#endif
1331 /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
1332 * matter since it will be recomputed at next deflate call.
1333 */
1334 }
1335 } else {
1336 /* No match, output a literal byte */
1337 Tracevv((stderr,"%c", s->window[s->strstart]));
1338 _tr_tally_lit (s, s->window[s->strstart], bflush);
1339 s->lookahead--;
1340 s->strstart++;
1341 }
1342 if (bflush) FLUSH_BLOCK(s, 0);
1343 }
1344 FLUSH_BLOCK(s, flush == Z_FINISH);
1345 return flush == Z_FINISH ? finish_done : block_done;
1346}
1347
1348#ifndef FASTEST
1349/* ===========================================================================
1350 * Same as above, but achieves better compression. We use a lazy
1351 * evaluation for matches: a match is finally adopted only if there is
1352 * no better match at the next window position.
1353 */
1354local block_state deflate_slow (deflate_state *s, int flush)
1355{
1356 IPos hash_head = NIL; /* head of hash chain */
1357 int bflush; /* set if current block must be flushed */
1358
1359 /* Process the input block. */
1360 for (;;) {
1361 /* Make sure that we always have enough lookahead, except
1362 * at the end of the input file. We need MAX_MATCH bytes
1363 * for the next match, plus MIN_MATCH bytes to insert the
1364 * string following the next match.
1365 */
1366 if (s->lookahead < MIN_LOOKAHEAD) {
1367 fill_window(s);
1368 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1369 return need_more;
1370 }
1371 if (s->lookahead == 0) break; /* flush the current block */
1372 }
1373
1374 /* Insert the string window[strstart .. strstart+2] in the
1375 * dictionary, and set hash_head to the head of the hash chain:
1376 */
1377 if (s->lookahead >= MIN_MATCH) {
1378 INSERT_STRING(s, s->strstart, hash_head);
1379 }
1380
1381 /* Find the longest match, discarding those <= prev_length.
1382 */
1383 s->prev_length = s->match_length, s->prev_match = s->match_start;
1384 s->match_length = MIN_MATCH-1;
1385
1386 if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
1387 s->strstart - hash_head <= MAX_DIST(s)) {
1388 /* To simplify the code, we prevent matches with the string
1389 * of window index 0 (in particular we have to avoid a match
1390 * of the string with itself at the start of the input file).
1391 */
1392 if (s->strategy < Z_HUFFMAN_ONLY) {
1393 s->match_length = longest_match (s, hash_head);
1394 } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
1395 s->match_length = longest_match_fast (s, hash_head);
1396 }
1397 /* longest_match() or longest_match_fast() sets match_start */
1398
1399 if (s->match_length <= 5 && (s->strategy == Z_FILTERED
1400#if TOO_FAR <= 32767
1401 || (s->match_length == MIN_MATCH &&
1402 s->strstart - s->match_start > TOO_FAR)
1403#endif
1404 )) {
1405
1406 /* If prev_match is also MIN_MATCH, match_start is garbage
1407 * but we will ignore the current match anyway.
1408 */
1409 s->match_length = MIN_MATCH-1;
1410 }
1411 }
1412 /* If there was a match at the previous step and the current
1413 * match is not better, output the previous match:
1414 */
1415 if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
1416 uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
1417 /* Do not insert strings in hash table beyond this. */
1418
1419 check_match(s, s->strstart-1, s->prev_match, s->prev_length);
1420
1421 _tr_tally_dist(s, s->strstart -1 - s->prev_match,
1422 s->prev_length - MIN_MATCH, bflush);
1423
1424 /* Insert in hash table all strings up to the end of the match.
1425 * strstart-1 and strstart are already inserted. If there is not
1426 * enough lookahead, the last two strings are not inserted in
1427 * the hash table.
1428 */
1429 s->lookahead -= s->prev_length-1;
1430 s->prev_length -= 2;
1431 do {
1432 if (++s->strstart <= max_insert) {
1433 INSERT_STRING(s, s->strstart, hash_head);
1434 }
1435 } while (--s->prev_length != 0);
1436 s->match_available = 0;
1437 s->match_length = MIN_MATCH-1;
1438 s->strstart++;
1439
1440 if (bflush) FLUSH_BLOCK(s, 0);
1441
1442 } else if (s->match_available) {
1443 /* If there was no match at the previous position, output a
1444 * single literal. If there was a match but the current match
1445 * is longer, truncate the previous match to a single literal.
1446 */
1447 Tracevv((stderr,"%c", s->window[s->strstart-1]));
1448 _tr_tally_lit(s, s->window[s->strstart-1], bflush);
1449 if (bflush) {
1450 FLUSH_BLOCK_ONLY(s, 0);
1451 }
1452 s->strstart++;
1453 s->lookahead--;
1454 if (s->strm->avail_out == 0) return need_more;
1455 } else {
1456 /* There is no previous match to compare with, wait for
1457 * the next step to decide.
1458 */
1459 s->match_available = 1;
1460 s->strstart++;
1461 s->lookahead--;
1462 }
1463 }
1464 Assert (flush != Z_NO_FLUSH, "no flush?");
1465 if (s->match_available) {
1466 Tracevv((stderr,"%c", s->window[s->strstart-1]));
1467 _tr_tally_lit(s, s->window[s->strstart-1], bflush);
1468 s->match_available = 0;
1469 }
1470 FLUSH_BLOCK(s, flush == Z_FINISH);
1471 return flush == Z_FINISH ? finish_done : block_done;
1472}
1473#endif /* FASTEST */
1474#endif /* USE_GZIP */
1475
config_s
Definition: zdeflate.c:126
internal_state
Definition: zdeflate.h:90
static_tree_desc_s
Definition: zdeflate.c:164
z_stream_s
Definition: zlib.h:84
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/zdeflate.h Source File

  • src
zdeflate.h
1/* deflate.h -- internal compression state
2 * Copyright (C) 1995-2002 Jean-loup Gailly
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* WARNING: this file should *not* be used by applications. It is
7 part of the implementation of the compression library and is
8 subject to change. Applications should only use zlib.h.
9 */
10
11/* @(#) $Id$ */
12
13#ifndef DEFLATE_H
14#define DEFLATE_H
15
16#include "zutil.h"
17
18/* define NO_GZIP when compiling if you want to disable gzip header and
19 trailer creation by deflate(). NO_GZIP would be used to avoid linking in
20 the crc code when it is not needed. For shared libraries, gzip encoding
21 should be left enabled. */
22#ifndef NO_GZIP
23# define GZIP
24#endif
25
26/* ===========================================================================
27 * Internal compression state.
28 */
29
30#define LENGTH_CODES 29
31/* number of length codes, not counting the special END_BLOCK code */
32
33#define LITERALS 256
34/* number of literal bytes 0..255 */
35
36#define L_CODES (LITERALS+1+LENGTH_CODES)
37/* number of Literal or Length codes, including the END_BLOCK code */
38
39#define D_CODES 30
40/* number of distance codes */
41
42#define BL_CODES 19
43/* number of codes used to transfer the bit lengths */
44
45#define HEAP_SIZE (2*L_CODES+1)
46/* maximum heap size */
47
48#define MAX_BITS 15
49/* All codes must not exceed MAX_BITS bits */
50
51#define INIT_STATE 42
52#define BUSY_STATE 113
53#define FINISH_STATE 666
54/* Stream status */
55
56
57/* Data structure describing a single value and its code string. */
58typedef struct ct_data_s {
59 union {
60 ush freq; /* frequency count */
61 ush code; /* bit string */
62 } fc;
63 union {
64 ush dad; /* father node in Huffman tree */
65 ush len; /* length of bit string */
66 } dl;
67} FAR ct_data;
68
69#define Freq fc.freq
70#define Code fc.code
71#define Dad dl.dad
72#define Len dl.len
73
74typedef struct static_tree_desc_s static_tree_desc;
75
76typedef struct tree_desc_s {
77 ct_data *dyn_tree; /* the dynamic tree */
78 int max_code; /* largest code with non zero frequency */
79 static_tree_desc *stat_desc; /* the corresponding static tree */
80} FAR tree_desc;
81
82typedef ush Pos;
83typedef Pos FAR Posf;
84typedef unsigned IPos;
85
86/* A Pos is an index in the character window. We use short instead of int to
87 * save space in the various tables. IPos is used only for parameter passing.
88 */
89
90typedef struct internal_state {
91 z_streamp strm; /* pointer back to this zlib stream */
92 int status; /* as the name implies */
93 Bytef *pending_buf; /* output still pending */
94 ulg pending_buf_size; /* size of pending_buf */
95 Bytef *pending_out; /* next pending byte to output to the stream */
96 int pending; /* nb of bytes in the pending buffer */
97 int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
98 Byte data_type; /* UNKNOWN, BINARY or ASCII */
99 Byte method; /* STORED (for zip only) or DEFLATED */
100 int last_flush; /* value of flush param for previous deflate call */
101
102 /* used by deflate.c: */
103
104 uInt w_size; /* LZ77 window size (32K by default) */
105 uInt w_bits; /* log2(w_size) (8..16) */
106 uInt w_mask; /* w_size - 1 */
107
108 Bytef *window;
109 /* Sliding window. Input bytes are read into the second half of the window,
110 * and move to the first half later to keep a dictionary of at least wSize
111 * bytes. With this organization, matches are limited to a distance of
112 * wSize-MAX_MATCH bytes, but this ensures that IO is always
113 * performed with a length multiple of the block size. Also, it limits
114 * the window size to 64K, which is quite useful on MSDOS.
115 * To do: use the user input buffer as sliding window.
116 */
117
118 ulg window_size;
119 /* Actual size of window: 2*wSize, except when the user input buffer
120 * is directly used as sliding window.
121 */
122
123 Posf *prev;
124 /* Link to older string with same hash index. To limit the size of this
125 * array to 64K, this link is maintained only for the last 32K strings.
126 * An index in this array is thus a window index modulo 32K.
127 */
128
129 Posf *head; /* Heads of the hash chains or NIL. */
130
131 uInt ins_h; /* hash index of string to be inserted */
132 uInt hash_size; /* number of elements in hash table */
133 uInt hash_bits; /* log2(hash_size) */
134 uInt hash_mask; /* hash_size-1 */
135
136 uInt hash_shift;
137 /* Number of bits by which ins_h must be shifted at each input
138 * step. It must be such that after MIN_MATCH steps, the oldest
139 * byte no longer takes part in the hash key, that is:
140 * hash_shift * MIN_MATCH >= hash_bits
141 */
142
143 long block_start;
144 /* Window position at the beginning of the current output block. Gets
145 * negative when the window is moved backwards.
146 */
147
148 uInt match_length; /* length of best match */
149 IPos prev_match; /* previous match */
150 int match_available; /* set if previous match exists */
151 uInt strstart; /* start of string to insert */
152 uInt match_start; /* start of matching string */
153 uInt lookahead; /* number of valid bytes ahead in window */
154
155 uInt prev_length;
156 /* Length of the best match at previous step. Matches not greater than this
157 * are discarded. This is used in the lazy match evaluation.
158 */
159
160 uInt max_chain_length;
161 /* To speed up deflation, hash chains are never searched beyond this
162 * length. A higher limit improves compression ratio but degrades the
163 * speed.
164 */
165
166 uInt max_lazy_match;
167 /* Attempt to find a better match only when the current match is strictly
168 * smaller than this value. This mechanism is used only for compression
169 * levels >= 4.
170 */
171# define max_insert_length max_lazy_match
172 /* Insert new strings in the hash table only if the match length is not
173 * greater than this length. This saves time but degrades compression.
174 * max_insert_length is used only for compression levels <= 3.
175 */
176
177 int level; /* compression level (1..9) */
178 int strategy; /* favor or force Huffman coding*/
179
180 uInt good_match;
181 /* Use a faster search when the previous match is longer than this */
182
183 int nice_match; /* Stop searching when current match exceeds this */
184
185 /* used by trees.c: */
186 /* Didn't use ct_data typedef below to supress compiler warning */
187 struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
188 struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
189 struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
190
191 struct tree_desc_s l_desc; /* desc. for literal tree */
192 struct tree_desc_s d_desc; /* desc. for distance tree */
193 struct tree_desc_s bl_desc; /* desc. for bit length tree */
194
195 ush bl_count[MAX_BITS+1];
196 /* number of codes at each bit length for an optimal tree */
197
198 int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
199 int heap_len; /* number of elements in the heap */
200 int heap_max; /* element of largest frequency */
201 /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
202 * The same heap array is used to build all trees.
203 */
204
205 uch depth[2*L_CODES+1];
206 /* Depth of each subtree used as tie breaker for trees of equal frequency
207 */
208
209 uchf *l_buf; /* buffer for literals or lengths */
210
211 uInt lit_bufsize;
212 /* Size of match buffer for literals/lengths. There are 4 reasons for
213 * limiting lit_bufsize to 64K:
214 * - frequencies can be kept in 16 bit counters
215 * - if compression is not successful for the first block, all input
216 * data is still in the window so we can still emit a stored block even
217 * when input comes from standard input. (This can also be done for
218 * all blocks if lit_bufsize is not greater than 32K.)
219 * - if compression is not successful for a file smaller than 64K, we can
220 * even emit a stored file instead of a stored block (saving 5 bytes).
221 * This is applicable only for zip (not gzip or zlib).
222 * - creating new Huffman trees less frequently may not provide fast
223 * adaptation to changes in the input data statistics. (Take for
224 * example a binary file with poorly compressible code followed by
225 * a highly compressible string table.) Smaller buffer sizes give
226 * fast adaptation but have of course the overhead of transmitting
227 * trees more frequently.
228 * - I can't count above 4
229 */
230
231 uInt last_lit; /* running index in l_buf */
232
233 ushf *d_buf;
234 /* Buffer for distances. To simplify the code, d_buf and l_buf have
235 * the same number of elements. To use different lengths, an extra flag
236 * array would be necessary.
237 */
238
239 ulg opt_len; /* bit length of current block with optimal trees */
240 ulg static_len; /* bit length of current block with static trees */
241 uInt matches; /* number of string matches in current block */
242 int last_eob_len; /* bit length of EOB code for last block */
243
244#ifdef DEBUG
245 ulg compressed_len; /* total bit length of compressed file mod 2^32 */
246 ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
247#endif
248
249 ush bi_buf;
250 /* Output buffer. bits are inserted starting at the bottom (least
251 * significant bits).
252 */
253 int bi_valid;
254 /* Number of valid bits in bi_buf. All bits above the last valid bit
255 * are always zero.
256 */
257
258} FAR deflate_state;
259
260/* Output a byte on the stream.
261 * IN assertion: there is enough room in pending_buf.
262 */
263#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
264
265
266#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
267/* Minimum amount of lookahead, except at the end of the input file.
268 * See deflate.c for comments about the MIN_MATCH+1.
269 */
270
271#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
272/* In order to simplify the code, particularly on 16 bit machines, match
273 * distances are limited to MAX_DIST instead of WSIZE.
274 */
275
276 /* in trees.c */
277void _tr_init (deflate_state *s);
278int _tr_tally (deflate_state *s, unsigned dist, unsigned lc);
279void _tr_flush_block (deflate_state *s, charf *buf, ulg stored_len, int eof);
280void _tr_align (deflate_state *s);
281void _tr_stored_block (deflate_state *s, charf *buf, ulg stored_len, int eof);
282
283#define d_code(dist) \
284 ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
285/* Mapping from a distance to a distance code. dist is the distance - 1 and
286 * must not have side effects. _dist_code[256] and _dist_code[257] are never
287 * used.
288 */
289
290#ifndef DEBUG
291/* Inline versions of _tr_tally for speed: */
292
293extern const uch _length_code[];
294extern const uch _dist_code[];
295
296# define _tr_tally_lit(s, c, flush) \
297 { uch cc = (c); \
298 s->d_buf[s->last_lit] = 0; \
299 s->l_buf[s->last_lit++] = cc; \
300 s->dyn_ltree[cc].Freq++; \
301 flush = (s->last_lit == s->lit_bufsize-1); \
302 }
303# define _tr_tally_dist(s, distance, length, flush) \
304 { uch len = (length); \
305 ush dist = (distance); \
306 s->d_buf[s->last_lit] = dist; \
307 s->l_buf[s->last_lit++] = len; \
308 dist--; \
309 s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
310 s->dyn_dtree[d_code(dist)].Freq++; \
311 flush = (s->last_lit == s->lit_bufsize-1); \
312 }
313#else
314# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
315# define _tr_tally_dist(s, distance, length, flush) \
316 flush = _tr_tally(s, distance, length)
317#endif
318
319#endif /* DEFLATE_H */
code
Definition: zinftree.h:24
ct_data_s
Definition: zdeflate.h:58
internal_state
Definition: zdeflate.h:90
static_tree_desc_s
Definition: zdeflate.c:164
tree_desc_s
Definition: zdeflate.h:76


Watt-32 tcp/ip: E:/WATT/src/zgzio.c Source File

  • src
zgzio.c
1/* gzio.c -- IO on .gz files
2 * Copyright (C) 1995-2003 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 *
5 * Compile this file with -DNO_GZCOMPRESS to avoid the compression code.
6 */
7
8/* @(#) $Id$ */
9
10#include <stdio.h>
11#include <stdarg.h>
12
13#include "wattcp.h"
14#include "zutil.h"
15
16#if defined(USE_GZIP)
17
18#ifdef NO_DEFLATE /* for compatiblity with old definition */
19# define NO_GZCOMPRESS
20#endif
21
22#ifndef NO_DUMMY_DECL
23struct internal_state {int dummy;}; /* for buggy compilers */
24#endif
25
26#ifndef Z_BUFSIZE
27# ifdef MAXSEG_64K
28# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */
29# else
30# define Z_BUFSIZE 16384
31# endif
32#endif
33#ifndef Z_PRINTF_BUFSIZE
34# define Z_PRINTF_BUFSIZE 4096
35#endif
36
37#ifdef __MVS__
38# pragma map (fdopen , "\174\174FDOPEN")
39 FILE *fdopen(int, const char *);
40#endif
41
42#define ALLOC(size) malloc(size)
43#define TRYFREE(p) {if (p) free(p);}
44
45static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
46
47/* gzip flag byte */
48#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
49#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */
50#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
51#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
52#define COMMENT 0x10 /* bit 4 set: file comment present */
53#define RESERVED 0xE0 /* bits 5..7: reserved */
54
55typedef struct gz_stream {
56 z_stream stream;
57 int z_err; /* error code for last stream operation */
58 int z_eof; /* set if end of input file */
59 FILE *file; /* .gz file */
60 Byte *inbuf; /* input buffer */
61 Byte *outbuf; /* output buffer */
62 uLong crc; /* crc32 of uncompressed data */
63 char *msg; /* error message */
64 char *path; /* path name for debugging only */
65 int transparent; /* 1 if input file is not a .gz file */
66 char mode; /* 'w' or 'r' */
67 z_off_t start; /* start of compressed data in file (header skipped) */
68 z_off_t in; /* bytes into deflate or inflate */
69 z_off_t out; /* bytes out of deflate or inflate */
70 int back; /* one character push-back */
71 int last; /* true if push-back is last character */
72} gz_stream;
73
74
75local gzFile gz_open (const char *path, const char *mode, int fd);
76local int do_flush (gzFile file, int flush);
77local int get_byte (gz_stream *s);
78local void check_header (gz_stream *s);
79local int destroy (gz_stream *s);
80local void putLong (FILE *file, uLong x);
81
82#ifndef Z_NO_INFLATE
83local uLong getLong (gz_stream *s);
84#endif
85
86/* ===========================================================================
87 Opens a gzip (.gz) file for reading or writing. The mode parameter
88 is as in fopen ("rb" or "wb"). The file is given either by file descriptor
89 or path name (if fd == -1).
90 gz_open returns NULL if the file could not be opened or if there was
91 insufficient memory to allocate the (de)compression state; errno
92 can be checked to distinguish the two cases (if errno is zero, the
93 zlib error is Z_MEM_ERROR).
94*/
95local gzFile gz_open (const char *path, const char *mode, int fd)
96{
97 int err;
98 int level = Z_DEFAULT_COMPRESSION; /* compression level */
99 int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
100 char *p = (char*)mode;
101 gz_stream *s;
102 char fmode[80]; /* copy of mode, without the compression level */
103 char *m = fmode;
104
105 if (!path || !mode) return Z_NULL;
106
107 s = (gz_stream *)ALLOC(sizeof(gz_stream));
108 if (!s) return Z_NULL;
109
110 s->stream.zalloc = (alloc_func)0;
111 s->stream.zfree = (free_func)0;
112 s->stream.opaque = (voidpf)0;
113 s->stream.next_in = s->inbuf = Z_NULL;
114 s->stream.next_out = s->outbuf = Z_NULL;
115 s->stream.avail_in = s->stream.avail_out = 0;
116 s->file = NULL;
117 s->z_err = Z_OK;
118 s->z_eof = 0;
119 s->in = 0;
120 s->out = 0;
121 s->back = EOF;
122 s->crc = crc32(0L, Z_NULL, 0);
123 s->msg = NULL;
124 s->transparent = 0;
125
126 s->path = (char*)ALLOC(strlen(path)+1);
127 if (s->path == NULL) {
128 return destroy(s), (gzFile)Z_NULL;
129 }
130 strcpy(s->path, path); /* do this early for debugging */
131
132 s->mode = '\0';
133 do {
134 if (*p == 'r') s->mode = 'r';
135 if (*p == 'w' || *p == 'a') s->mode = 'w';
136 if (*p >= '0' && *p <= '9') {
137 level = *p - '0';
138 } else if (*p == 'f') {
139 strategy = Z_FILTERED;
140 } else if (*p == 'h') {
141 strategy = Z_HUFFMAN_ONLY;
142 } else if (*p == 'R') {
143 strategy = Z_RLE;
144 } else {
145 *m++ = *p; /* copy the mode */
146 }
147 } while (*p++ && m != fmode + sizeof(fmode));
148 if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
149
150 if (s->mode == 'w') {
151#ifdef NO_GZCOMPRESS
152 err = Z_STREAM_ERROR;
153#else
154 err = deflateInit2(&(s->stream), level,
155 Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
156 /* windowBits is passed < 0 to suppress zlib header */
157
158 s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
159#endif
160 if (err != Z_OK || s->outbuf == Z_NULL) {
161 return destroy(s), (gzFile)Z_NULL;
162 }
163 } else {
164
165#ifdef Z_NO_INFLATE
166 err = Z_STREAM_ERROR;
167#else
168 s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
169
170 err = inflateInit2(&(s->stream), -MAX_WBITS);
171 /* windowBits is passed < 0 to tell that there is no zlib header.
172 * Note that in this case inflate *requires* an extra "dummy" byte
173 * after the compressed stream in order to complete decompression and
174 * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
175 * present after the compressed stream.
176 */
177#endif
178 if (err != Z_OK || s->inbuf == Z_NULL) {
179 return destroy(s), (gzFile)Z_NULL;
180 }
181 }
182 s->stream.avail_out = Z_BUFSIZE;
183
184 errno = 0;
185 s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode);
186
187 if (s->file == NULL) {
188 return destroy(s), (gzFile)Z_NULL;
189 }
190 if (s->mode == 'w') {
191 /* Write a very simple .gz header:
192 */
193 fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
194 Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
195 s->start = 10L;
196 /* We use 10L instead of ftell(s->file) to because ftell causes an
197 * fflush on some systems. This version of the library doesn't use
198 * start anyway in write mode, so this initialization is not
199 * necessary.
200 */
201 } else {
202 check_header(s); /* skip the .gz header */
203 s->start = ftell(s->file) - s->stream.avail_in;
204 }
205
206 return (gzFile)s;
207}
208
209/* ===========================================================================
210 Opens a gzip (.gz) file for reading or writing.
211*/
212gzFile ZEXPORT gzopen (const char *path, const char *mode)
213{
214 return gz_open (path, mode, -1);
215}
216
217/* ===========================================================================
218 Associate a gzFile with the file descriptor fd. fd is not dup'ed here
219 to mimic the behavio(u)r of fdopen.
220*/
221gzFile ZEXPORT gzdopen (int fd, const char *mode)
222{
223 char name[20];
224
225 if (fd < 0) return (gzFile)Z_NULL;
226 sprintf(name, "<fd:%d>", fd); /* for debugging */
227
228 return gz_open (name, mode, fd);
229}
230
231/* ===========================================================================
232 * Update the compression level and strategy
233 */
234int ZEXPORT gzsetparams (gzFile file, int level, int strategy)
235{
236 gz_stream *s = (gz_stream*)file;
237
238 if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
239
240 /* Make room to allow flushing */
241 if (s->stream.avail_out == 0) {
242
243 s->stream.next_out = s->outbuf;
244 if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
245 s->z_err = Z_ERRNO;
246 }
247 s->stream.avail_out = Z_BUFSIZE;
248 }
249
250 return deflateParams (&(s->stream), level, strategy);
251}
252
253/* ===========================================================================
254 Read a byte from a gz_stream; update next_in and avail_in. Return EOF
255 for end of file.
256 IN assertion: the stream s has been sucessfully opened for reading.
257*/
258local int get_byte (gz_stream *s)
259{
260 if (s->z_eof) return EOF;
261 if (s->stream.avail_in == 0) {
262 errno = 0;
263 s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
264 if (s->stream.avail_in == 0) {
265 s->z_eof = 1;
266 if (ferror(s->file)) s->z_err = Z_ERRNO;
267 return EOF;
268 }
269 s->stream.next_in = s->inbuf;
270 }
271 s->stream.avail_in--;
272 return *(s->stream.next_in)++;
273}
274
275/* ===========================================================================
276 Check the gzip header of a gz_stream opened for reading. Set the stream
277 mode to transparent if the gzip magic header is not present; set s->err
278 to Z_DATA_ERROR if the magic header is present but the rest of the header
279 is incorrect.
280 IN assertion: the stream s has already been created sucessfully;
281 s->stream.avail_in is zero for the first time, but may be non-zero
282 for concatenated .gz files.
283*/
284local void check_header (gz_stream *s)
285{
286 int method; /* method byte */
287 int flags; /* flags byte */
288 uInt len;
289 int c;
290
291 /* Assure two bytes in the buffer so we can peek ahead -- handle case
292 where first byte of header is at the end of the buffer after the last
293 gzip segment */
294 len = s->stream.avail_in;
295 if (len < 2) {
296 if (len) s->inbuf[0] = s->stream.next_in[0];
297 errno = 0;
298 len = fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);
299 if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO;
300 s->stream.avail_in += len;
301 s->stream.next_in = s->inbuf;
302 if (s->stream.avail_in < 2) {
303 s->transparent = s->stream.avail_in;
304 return;
305 }
306 }
307
308 /* Peek ahead to check the gzip magic header */
309 if (s->stream.next_in[0] != gz_magic[0] ||
310 s->stream.next_in[1] != gz_magic[1]) {
311 s->transparent = 1;
312 return;
313 }
314 s->stream.avail_in -= 2;
315 s->stream.next_in += 2;
316
317 /* Check the rest of the gzip header */
318 method = get_byte(s);
319 flags = get_byte(s);
320 if (method != Z_DEFLATED || (flags & RESERVED) != 0) {
321 s->z_err = Z_DATA_ERROR;
322 return;
323 }
324
325 /* Discard time, xflags and OS code: */
326 for (len = 0; len < 6; len++) (void)get_byte(s);
327
328 if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
329 len = (uInt)get_byte(s);
330 len += ((uInt)get_byte(s))<<8;
331 /* len is garbage if EOF but the loop below will quit anyway */
332 while (len-- != 0 && get_byte(s) != EOF) ;
333 }
334 if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
335 while ((c = get_byte(s)) != 0 && c != EOF) ;
336 }
337 if ((flags & COMMENT) != 0) { /* skip the .gz file comment */
338 while ((c = get_byte(s)) != 0 && c != EOF) ;
339 }
340 if ((flags & HEAD_CRC) != 0) { /* skip the header crc */
341 for (len = 0; len < 2; len++) (void)get_byte(s);
342 }
343 s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK;
344}
345
346 /* ===========================================================================
347 * Cleanup then free the given gz_stream. Return a zlib error code.
348 Try freeing in the reverse order of allocations.
349 */
350local int destroy (gz_stream *s)
351{
352 int err = Z_OK;
353
354 if (!s) return Z_STREAM_ERROR;
355
356 TRYFREE(s->msg);
357
358 if (s->stream.state != NULL) {
359 if (s->mode == 'w') {
360#ifdef NO_GZCOMPRESS
361 err = Z_STREAM_ERROR;
362#else
363 err = deflateEnd(&(s->stream));
364#endif
365 } else if (s->mode == 'r') {
366#ifndef Z_NO_INFLATE
367 err = inflateEnd(&(s->stream));
368#endif
369 }
370 }
371 if (s->file != NULL && fclose(s->file)) {
372#ifdef ESPIPE
373 if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */
374#endif
375 err = Z_ERRNO;
376 }
377 if (s->z_err < 0) err = s->z_err;
378
379 TRYFREE(s->inbuf);
380 TRYFREE(s->outbuf);
381 TRYFREE(s->path);
382 TRYFREE(s);
383 return err;
384}
385
386#if !defined(Z_NO_INFLATE)
387
388/* ===========================================================================
389 Reads the given number of uncompressed bytes from the compressed file.
390 gzread returns the number of bytes actually read (0 for end of file).
391*/
392int ZEXPORT gzread (gzFile file, voidp buf, unsigned len)
393{
394 gz_stream *s = (gz_stream*)file;
395 Bytef *start = (Bytef*)buf; /* starting point for crc computation */
396 Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
397
398 if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR;
399
400 if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;
401 if (s->z_err == Z_STREAM_END) return 0; /* EOF */
402
403 next_out = (Byte*)buf;
404 s->stream.next_out = (Bytef*)buf;
405 s->stream.avail_out = len;
406
407 if (s->stream.avail_out && s->back != EOF) {
408 *next_out++ = s->back;
409 s->stream.next_out++;
410 s->stream.avail_out--;
411 s->back = EOF;
412 s->out++;
413 if (s->last) {
414 s->z_err = Z_STREAM_END;
415 return 1;
416 }
417 }
418
419 while (s->stream.avail_out != 0) {
420
421 if (s->transparent) {
422 /* Copy first the lookahead bytes: */
423 uInt n = s->stream.avail_in;
424 if (n > s->stream.avail_out) n = s->stream.avail_out;
425 if (n > 0) {
426 zmemcpy(s->stream.next_out, s->stream.next_in, n);
427 next_out += n;
428 s->stream.next_out = next_out;
429 s->stream.next_in += n;
430 s->stream.avail_out -= n;
431 s->stream.avail_in -= n;
432 }
433 if (s->stream.avail_out > 0) {
434 s->stream.avail_out -= fread(next_out, 1, s->stream.avail_out,
435 s->file);
436 }
437 len -= s->stream.avail_out;
438 s->in += len;
439 s->out += len;
440 if (len == 0) s->z_eof = 1;
441 return (int)len;
442 }
443 if (s->stream.avail_in == 0 && !s->z_eof) {
444
445 errno = 0;
446 s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
447 if (s->stream.avail_in == 0) {
448 s->z_eof = 1;
449 if (ferror(s->file)) {
450 s->z_err = Z_ERRNO;
451 break;
452 }
453 }
454 s->stream.next_in = s->inbuf;
455 }
456 s->in += s->stream.avail_in;
457 s->out += s->stream.avail_out;
458 s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
459 s->in -= s->stream.avail_in;
460 s->out -= s->stream.avail_out;
461
462 if (s->z_err == Z_STREAM_END) {
463 /* Check CRC and original size */
464 s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
465 start = s->stream.next_out;
466
467 if (getLong(s) != s->crc) {
468 s->z_err = Z_DATA_ERROR;
469 } else {
470 (void)getLong(s);
471 /* The uncompressed length returned by above getlong() may be
472 * different from s->out in case of concatenated .gz files.
473 * Check for such files:
474 */
475 check_header(s);
476 if (s->z_err == Z_OK) {
477 inflateReset(&(s->stream));
478 s->crc = crc32(0L, Z_NULL, 0);
479 }
480 }
481 }
482 if (s->z_err != Z_OK || s->z_eof) break;
483 }
484 s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
485
486 return (int)(len - s->stream.avail_out);
487}
488
489
490/* ===========================================================================
491 Reads one byte from the compressed file. gzgetc returns this byte
492 or -1 in case of end of file or error.
493*/
494int ZEXPORT gzgetc (gzFile file)
495{
496 unsigned char c;
497
498 return gzread(file, &c, 1) == 1 ? c : -1;
499}
500
501/* ===========================================================================
502 Push one byte back onto the stream.
503*/
504int ZEXPORT gzungetc (int c, gzFile file)
505{
506 gz_stream *s = (gz_stream*)file;
507
508 if (s == NULL || s->mode != 'r' || c == EOF || s->back != EOF) return EOF;
509 s->back = c;
510 s->out--;
511 s->last = (s->z_err == Z_STREAM_END);
512 if (s->last) s->z_err = Z_OK;
513 s->z_eof = 0;
514 return c;
515}
516
517
518/* ===========================================================================
519 Reads bytes from the compressed file until len-1 characters are
520 read, or a newline character is read and transferred to buf, or an
521 end-of-file condition is encountered. The string is then terminated
522 with a null character.
523 gzgets returns buf, or Z_NULL in case of error.
524
525 The current implementation is not optimized at all.
526*/
527char * ZEXPORT gzgets (gzFile file, char *buf, int len)
528{
529 char *b = buf;
530 if (buf == Z_NULL || len <= 0) return Z_NULL;
531
532 while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ;
533 *buf = '\0';
534 return b == buf && len > 0 ? Z_NULL : b;
535}
536#endif /* Z_NO_INFLATE */
537
538
539#ifndef NO_GZCOMPRESS
540/* ===========================================================================
541 Writes the given number of uncompressed bytes into the compressed file.
542 gzwrite returns the number of bytes actually written (0 in case of error).
543*/
544int ZEXPORT gzwrite (gzFile file, voidpc buf, unsigned len)
545{
546 gz_stream *s = (gz_stream*)file;
547
548 if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
549
550 s->stream.next_in = (Bytef*)buf;
551 s->stream.avail_in = len;
552
553 while (s->stream.avail_in != 0) {
554
555 if (s->stream.avail_out == 0) {
556
557 s->stream.next_out = s->outbuf;
558 if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
559 s->z_err = Z_ERRNO;
560 break;
561 }
562 s->stream.avail_out = Z_BUFSIZE;
563 }
564 s->in += s->stream.avail_in;
565 s->out += s->stream.avail_out;
566 s->z_err = deflate(&(s->stream), Z_NO_FLUSH);
567 s->in -= s->stream.avail_in;
568 s->out -= s->stream.avail_out;
569 if (s->z_err != Z_OK) break;
570 }
571 s->crc = crc32(s->crc, (const Bytef *)buf, len);
572
573 return (int)(len - s->stream.avail_in);
574}
575
576
577/* ===========================================================================
578 Converts, formats, and writes the args to the compressed file under
579 control of the format string, as in fprintf. gzprintf returns the number of
580 uncompressed bytes actually written (0 in case of error).
581*/
582int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...)
583{
584 char buf[Z_PRINTF_BUFSIZE];
585 va_list va;
586 int len;
587
588 buf[sizeof(buf) - 1] = 0;
589 va_start(va, format);
590#ifdef NO_vsnprintf
591# ifdef HAS_vsprintf_void
592 (void)vsprintf(buf, format, va);
593 va_end(va);
594 for (len = 0; len < sizeof(buf); len++)
595 if (buf[len] == 0) break;
596# else
597 len = vsprintf(buf, format, va);
598 va_end(va);
599# endif
600#else
601# ifdef HAS_vsnprintf_void
602 (void)vsnprintf(buf, sizeof(buf), format, va);
603 va_end(va);
604 len = strlen(buf);
605# else
606 len = vsnprintf(buf, sizeof(buf), format, va);
607 va_end(va);
608# endif
609#endif
610 if (len <= 0 || len >= (int)sizeof(buf) || buf[sizeof(buf) - 1] != 0)
611 return 0;
612 return gzwrite(file, buf, (unsigned)len);
613}
614
615/* ===========================================================================
616 Writes c, converted to an unsigned char, into the compressed file.
617 gzputc returns the value that was written, or -1 in case of error.
618*/
619int ZEXPORT gzputc (gzFile file, int c)
620{
621 unsigned char cc = (unsigned char) c; /* required for big endian systems */
622
623 return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1;
624}
625
626
627/* ===========================================================================
628 Writes the given null-terminated string to the compressed file, excluding
629 the terminating null character.
630 gzputs returns the number of characters written, or -1 in case of error.
631*/
632int ZEXPORT gzputs (gzFile file, const char *s)
633{
634 return gzwrite(file, (char*)s, (unsigned)strlen(s));
635}
636
637/* ===========================================================================
638 Flushes all pending output into the compressed file. The parameter
639 flush is as in the deflate() function.
640*/
641local int do_flush (gzFile file, int flush)
642{
643 uInt len;
644 int done = 0;
645 gz_stream *s = (gz_stream*)file;
646
647 if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
648
649 s->stream.avail_in = 0; /* should be zero already anyway */
650
651 for (;;) {
652 len = Z_BUFSIZE - s->stream.avail_out;
653
654 if (len != 0) {
655 if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
656 s->z_err = Z_ERRNO;
657 return Z_ERRNO;
658 }
659 s->stream.next_out = s->outbuf;
660 s->stream.avail_out = Z_BUFSIZE;
661 }
662 if (done) break;
663 s->out += s->stream.avail_out;
664 s->z_err = deflate(&(s->stream), flush);
665 s->out -= s->stream.avail_out;
666
667 /* Ignore the second of two consecutive flushes: */
668 if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;
669
670 /* deflate has finished flushing only when it hasn't used up
671 * all the available space in the output buffer:
672 */
673 done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
674
675 if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
676 }
677 return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
678}
679
680int ZEXPORT gzflush (gzFile file, int flush)
681{
682 gz_stream *s = (gz_stream*)file;
683 int err = do_flush (file, flush);
684
685 if (err) return err;
686 fflush(s->file);
687 return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
688}
689#endif /* NO_GZCOMPRESS */
690
691#ifndef Z_NO_INFLATE
692
693/* ===========================================================================
694 Sets the starting position for the next gzread or gzwrite on the given
695 compressed file. The offset represents a number of bytes in the
696 gzseek returns the resulting offset location as measured in bytes from
697 the beginning of the uncompressed stream, or -1 in case of error.
698 SEEK_END is not implemented, returns error.
699 In this version of the library, gzseek can be extremely slow.
700*/
701
702z_off_t ZEXPORT gzseek (gzFile file, z_off_t offset, int whence)
703{
704 gz_stream *s = (gz_stream*)file;
705
706 if (s == NULL || whence == SEEK_END ||
707 s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) {
708 return -1L;
709 }
710
711 if (s->mode == 'w') {
712#ifdef NO_GZCOMPRESS
713 return -1L;
714#else
715 if (whence == SEEK_SET) {
716 offset -= s->in;
717 }
718 if (offset < 0) return -1L;
719
720 /* At this point, offset is the number of zero bytes to write. */
721 if (s->inbuf == Z_NULL) {
722 s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */
723 if (s->inbuf == Z_NULL) return -1L;
724 zmemzero(s->inbuf, Z_BUFSIZE);
725 }
726 while (offset > 0) {
727 uInt size = Z_BUFSIZE;
728 if (offset < Z_BUFSIZE) size = (uInt)offset;
729
730 size = gzwrite(file, s->inbuf, size);
731 if (size == 0) return -1L;
732
733 offset -= size;
734 }
735 return s->in;
736#endif
737 }
738 /* Rest of function is for reading only */
739
740 /* compute absolute position */
741 if (whence == SEEK_CUR) {
742 offset += s->out;
743 }
744 if (offset < 0) return -1L;
745
746 if (s->transparent) {
747 /* map to fseek */
748 s->back = EOF;
749 s->stream.avail_in = 0;
750 s->stream.next_in = s->inbuf;
751 if (fseek(s->file, offset, SEEK_SET) < 0) return -1L;
752
753 s->in = s->out = offset;
754 return offset;
755 }
756
757 /* For a negative seek, rewind and use positive seek */
758 if (offset >= s->out) {
759 offset -= s->out;
760 } else if (gzrewind(file) < 0) {
761 return -1L;
762 }
763 /* offset is now the number of bytes to skip. */
764
765 if (offset != 0 && s->outbuf == Z_NULL) {
766 s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
767 if (s->outbuf == Z_NULL) return -1L;
768 }
769 if (offset && s->back != EOF) {
770 s->back = EOF;
771 s->out++;
772 offset--;
773 if (s->last) s->z_err = Z_STREAM_END;
774 }
775 while (offset > 0) {
776 int size = Z_BUFSIZE;
777 if (offset < Z_BUFSIZE) size = (int)offset;
778
779 size = gzread(file, s->outbuf, (uInt)size);
780 if (size <= 0) return -1L;
781 offset -= size;
782 }
783 return s->out;
784}
785
786/* ===========================================================================
787 Rewinds input file.
788*/
789int ZEXPORT gzrewind (gzFile file)
790{
791 gz_stream *s = (gz_stream*)file;
792
793 if (s == NULL || s->mode != 'r') return -1;
794
795 s->z_err = Z_OK;
796 s->z_eof = 0;
797 s->back = EOF;
798 s->stream.avail_in = 0;
799 s->stream.next_in = s->inbuf;
800 s->crc = crc32(0L, Z_NULL, 0);
801 if (!s->transparent) (void)inflateReset(&s->stream);
802 s->in = 0;
803 s->out = 0;
804 return fseek(s->file, s->start, SEEK_SET);
805}
806
807/* ===========================================================================
808 Returns the starting position for the next gzread or gzwrite on the
809 given compressed file. This position represents a number of bytes in the
810 uncompressed data stream.
811*/
812z_off_t ZEXPORT gztell (gzFile file)
813{
814 return gzseek(file, 0L, SEEK_CUR);
815}
816#endif /* Z_NO_INFLATE */
817
818/* ===========================================================================
819 Returns 1 when EOF has previously been detected reading the given
820 input stream, otherwise zero.
821*/
822int ZEXPORT gzeof (gzFile file)
823{
824 gz_stream *s = (gz_stream*)file;
825
826 /* With concatenated compressed files that can have embedded
827 * crc trailers, z_eof is no longer the only/best indicator of EOF
828 * on a gz_stream. Handle end-of-stream error explicitly here.
829 */
830 if (s == NULL || s->mode != 'r') return 0;
831 if (s->z_eof) return 1;
832 return s->z_err == Z_STREAM_END;
833}
834
835/* ===========================================================================
836 Outputs a long in LSB order to the given file
837*/
838local void putLong (FILE *file, uLong x)
839{
840 int n;
841 for (n = 0; n < 4; n++) {
842 fputc((int)(x & 0xff), file);
843 x >>= 8;
844 }
845}
846
847/* ===========================================================================
848 Reads a long in LSB order from the given gz_stream. Sets z_err in case
849 of error.
850*/
851#ifndef Z_NO_INFLATE
852local uLong getLong (gz_stream *s)
853{
854 uLong x = (uLong)get_byte(s);
855 int c;
856
857 x += ((uLong)get_byte(s))<<8;
858 x += ((uLong)get_byte(s))<<16;
859 c = get_byte(s);
860 if (c == EOF) s->z_err = Z_DATA_ERROR;
861 x += ((uLong)c)<<24;
862 return x;
863}
864#endif
865
866/* ===========================================================================
867 Flushes all pending output if necessary, closes the compressed file
868 and deallocates all the (de)compression state.
869*/
870int ZEXPORT gzclose (gzFile file)
871{
872 int err;
873 gz_stream *s = (gz_stream*)file;
874
875 if (s == NULL) return Z_STREAM_ERROR;
876
877 if (s->mode == 'w') {
878#ifdef NO_GZCOMPRESS
879 return Z_STREAM_ERROR;
880#else
881 err = do_flush (file, Z_FINISH);
882 if (err != Z_OK) return destroy((gz_stream*)file);
883
884 putLong (s->file, s->crc);
885 putLong (s->file, (uLong)(s->in & 0xffffffff));
886#endif
887 }
888 return destroy((gz_stream*)file);
889}
890
891/* ===========================================================================
892 Returns the error message for the last error which occured on the
893 given compressed file. errnum is set to zlib error number. If an
894 error occured in the file system and not in the compression library,
895 errnum is set to Z_ERRNO and the application may consult errno
896 to get the exact error code.
897*/
898const char * ZEXPORT gzerror (gzFile file, int *errnum)
899{
900 char *m;
901 gz_stream *s = (gz_stream*)file;
902
903 if (s == NULL) {
904 *errnum = Z_STREAM_ERROR;
905 return (const char*)ERR_MSG(Z_STREAM_ERROR);
906 }
907 *errnum = s->z_err;
908 if (*errnum == Z_OK) return (const char*)"";
909
910 m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
911
912 if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);
913
914 TRYFREE(s->msg);
915 s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
916 if (s->msg == Z_NULL) return (const char*)ERR_MSG(Z_MEM_ERROR);
917 strcpy(s->msg, s->path);
918 strcat(s->msg, ": ");
919 strcat(s->msg, m);
920 return (const char*)s->msg;
921}
922
923/* ===========================================================================
924 Clear the error and end-of-file flags, and do the same for the real file.
925*/
926void ZEXPORT gzclearerr (gzFile file)
927{
928 gz_stream *s = (gz_stream*)file;
929
930 if (s == NULL) return;
931 if (s->z_err != Z_STREAM_END) s->z_err = Z_OK;
932 s->z_eof = 0;
933 clearerr(s->file);
934}
935#endif /* USE_GZIP || USE_SCTP */
936
gz_stream
Definition: zgzio.c:55
internal_state
Definition: zdeflate.h:90
z_stream_s
Definition: zlib.h:84
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/zinfback.c Source File

  • src
zinfback.c
1/* infback.c -- inflate using a call-back interface
2 * Copyright (C) 1995-2003 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/*
7 This code is largely copied from inflate.c. Normally either infback.o or
8 inflate.o would be linked into an application--not both. The interface
9 with inffast.c is retained so that optimized assembler-coded versions of
10 inflate_fast() can be used with either inflate.c or infback.c.
11 */
12
13#include "wattcp.h"
14#include "zutil.h"
15#include "zinftree.h"
16#include "zinflate.h"
17#include "zinffast.h"
18
19#if defined(USE_GZIP) && !defined(Z_NO_INFLATE)
20
21#if (W32_GCC_VERSION >= 70000)
22 /*
23 * Suppress warning
24 * zinfback.c:472:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
25 */
26 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
27 W32_GCC_PRAGMA (GCC diagnostic ignored "-Wimplicit-fallthrough")
28#endif
29
30/* function prototypes */
31local void fixedtables (struct inflate_state FAR *state);
32
33/*
34 strm provides memory allocation functions in zalloc and zfree, or
35 Z_NULL to use the library memory allocation functions.
36
37 windowBits is in the range 8..15, and window is a user-supplied
38 window and output buffer that is 2**windowBits bytes.
39 */
40int ZEXPORT inflateBackInit_ (z_stream FAR *strm,
41 int windowBits,
42 unsigned char FAR *window,
43 const char *version,
44 int stream_size)
45{
46 struct inflate_state FAR *state;
47
48 if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
49 stream_size != (int)(sizeof(z_stream)))
50 return Z_VERSION_ERROR;
51 if (strm == Z_NULL || window == Z_NULL ||
52 windowBits < 8 || windowBits > 15)
53 return Z_STREAM_ERROR;
54 strm->msg = Z_NULL; /* in case we return an error */
55 if (strm->zalloc == (alloc_func)0) {
56 strm->zalloc = zcalloc;
57 strm->opaque = (voidpf)0;
58 }
59 if (strm->zfree == (free_func)0) strm->zfree = zcfree;
60 state = (struct inflate_state FAR *)ZALLOC(strm, 1,
61 sizeof(struct inflate_state));
62 if (state == Z_NULL) return Z_MEM_ERROR;
63 Tracev((stderr, "inflate: allocated\n"));
64 strm->state = (voidpf)state;
65 state->wbits = windowBits;
66 state->wsize = 1U << windowBits;
67 state->window = window;
68 state->write = 0;
69 state->whave = 0;
70 return Z_OK;
71}
72
73/*
74 Return state with length and distance decoding tables and index sizes set to
75 fixed code decoding. Normally this returns fixed tables from inffixed.h.
76 If BUILDFIXED is defined, then instead this routine builds the tables the
77 first time it's called, and returns those tables the first time and
78 thereafter. This reduces the size of the code by about 2K bytes, in
79 exchange for a little execution time. However, BUILDFIXED should not be
80 used for threaded applications, since the rewriting of the tables and virgin
81 may not be thread-safe.
82 */
83local void fixedtables (struct inflate_state FAR *state)
84{
85#ifdef BUILDFIXED
86 static int virgin = 1;
87 static code *lenfix, *distfix;
88 static code fixed[544];
89
90 /* build fixed huffman tables if first call (may not be thread safe) */
91 if (virgin) {
92 unsigned sym, bits;
93 static code *next;
94
95 /* literal/length table */
96 sym = 0;
97 while (sym < 144) state->lens[sym++] = 8;
98 while (sym < 256) state->lens[sym++] = 9;
99 while (sym < 280) state->lens[sym++] = 7;
100 while (sym < 288) state->lens[sym++] = 8;
101 next = fixed;
102 lenfix = next;
103 bits = 9;
104 inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
105
106 /* distance table */
107 sym = 0;
108 while (sym < 32) state->lens[sym++] = 5;
109 distfix = next;
110 bits = 5;
111 inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
112
113 /* do this just once */
114 virgin = 0;
115 }
116#else /* !BUILDFIXED */
117# include "zinffix.h"
118#endif /* BUILDFIXED */
119 state->lencode = lenfix;
120 state->lenbits = 9;
121 state->distcode = distfix;
122 state->distbits = 5;
123}
124
125/* Macros for inflateBack(): */
126
127/* Load returned state from inflate_fast() */
128#define LOAD() \
129 do { \
130 put = strm->next_out; \
131 left = strm->avail_out; \
132 next = strm->next_in; \
133 have = strm->avail_in; \
134 hold = state->hold; \
135 bits = state->bits; \
136 } while (0)
137
138/* Set state from registers for inflate_fast() */
139#define RESTORE() \
140 do { \
141 strm->next_out = put; \
142 strm->avail_out = left; \
143 strm->next_in = next; \
144 strm->avail_in = have; \
145 state->hold = hold; \
146 state->bits = bits; \
147 } while (0)
148
149/* Clear the input bit accumulator */
150#define INITBITS() \
151 do { \
152 hold = 0; \
153 bits = 0; \
154 } while (0)
155
156/* Assure that some input is available. If input is requested, but denied,
157 then return a Z_BUF_ERROR from inflateBack(). */
158#define PULL() \
159 do { \
160 if (have == 0) { \
161 have = in(in_desc, &next); \
162 if (have == 0) { \
163 next = Z_NULL; \
164 ret = Z_BUF_ERROR; \
165 goto inf_leave; \
166 } \
167 } \
168 } while (0)
169
170/* Get a byte of input into the bit accumulator, or return from inflateBack()
171 with an error if there is no input available. */
172#define PULLBYTE() \
173 do { \
174 PULL(); \
175 have--; \
176 hold += (unsigned long)(*next++) << bits; \
177 bits += 8; \
178 } while (0)
179
180/* Assure that there are at least n bits in the bit accumulator. If there is
181 not enough available input to do that, then return from inflateBack() with
182 an error. */
183#define NEEDBITS(n) \
184 do { \
185 while (bits < (unsigned)(n)) \
186 PULLBYTE(); \
187 } while (0)
188
189/* Return the low n bits of the bit accumulator (n < 16) */
190#define BITS(n) \
191 ((unsigned)hold & ((1U << (n)) - 1))
192
193/* Remove n bits from the bit accumulator */
194#define DROPBITS(n) \
195 do { \
196 hold >>= (n); \
197 bits -= (unsigned)(n); \
198 } while (0)
199
200/* Remove zero to seven bits as needed to go to a byte boundary */
201#define BYTEBITS() \
202 do { \
203 hold >>= bits & 7; \
204 bits -= bits & 7; \
205 } while (0)
206
207/* Assure that some output space is available, by writing out the window
208 if it's full. If the write fails, return from inflateBack() with a
209 Z_BUF_ERROR. */
210#define ROOM() \
211 do { \
212 if (left == 0) { \
213 put = state->window; \
214 left = state->wsize; \
215 state->whave = left; \
216 if (out(out_desc, put, left)) { \
217 ret = Z_BUF_ERROR; \
218 goto inf_leave; \
219 } \
220 } \
221 } while (0)
222
223/*
224 strm provides the memory allocation functions and window buffer on input,
225 and provides information on the unused input on return. For Z_DATA_ERROR
226 returns, strm will also provide an error message.
227
228 in() and out() are the call-back input and output functions. When
229 inflateBack() needs more input, it calls in(). When inflateBack() has
230 filled the window with output, or when it completes with data in the
231 window, it calls out() to write out the data. The application must not
232 change the provided input until in() is called again or inflateBack()
233 returns. The application must not change the window/output buffer until
234 inflateBack() returns.
235
236 in() and out() are called with a descriptor parameter provided in the
237 inflateBack() call. This parameter can be a structure that provides the
238 information required to do the read or write, as well as accumulated
239 information on the input and output such as totals and check values.
240
241 in() should return zero on failure. out() should return non-zero on
242 failure. If either in() or out() fails, than inflateBack() returns a
243 Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it
244 was in() or out() that caused in the error. Otherwise, inflateBack()
245 returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
246 error, or Z_MEM_ERROR if it could not allocate memory for the state.
247 inflateBack() can also return Z_STREAM_ERROR if the input parameters
248 are not correct, i.e. strm is Z_NULL or the state was not initialized.
249 */
250int ZEXPORT inflateBack (z_stream FAR *strm,
251 in_func in,
252 void FAR *in_desc,
253 out_func out,
254 void FAR *out_desc)
255{
256 struct inflate_state FAR *state;
257 unsigned char FAR *next; /* next input */
258 unsigned char FAR *put; /* next output */
259 unsigned have, left; /* available input and output */
260 unsigned long hold; /* bit buffer */
261 unsigned bits; /* bits in bit buffer */
262 unsigned copy; /* number of stored or match bytes to copy */
263 unsigned char FAR *from; /* where to copy match bytes from */
264 code this; /* current decoding table entry */
265 code last; /* parent table entry */
266 unsigned len; /* length to copy for repeats, bits to drop */
267 int ret; /* return code */
268 static const unsigned short order[19] = /* permutation of code lengths */
269 {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
270
271 /* Check that the strm exists and that the state was initialized */
272 if (strm == Z_NULL || strm->state == Z_NULL)
273 return Z_STREAM_ERROR;
274 state = (struct inflate_state FAR *)strm->state;
275
276 /* Reset the state */
277 strm->msg = Z_NULL;
278 state->mode = TYPE;
279 state->last = 0;
280 state->whave = 0;
281 next = strm->next_in;
282 have = next != Z_NULL ? strm->avail_in : 0;
283 hold = 0;
284 bits = 0;
285 put = state->window;
286 left = state->wsize;
287
288 /* Inflate until end of block marked as last */
289 for (;;)
290 switch (state->mode) {
291 case TYPE:
292 /* determine and dispatch block type */
293 if (state->last) {
294 BYTEBITS();
295 state->mode = DONE;
296 break;
297 }
298 NEEDBITS(3);
299 state->last = BITS(1);
300 DROPBITS(1);
301 switch (BITS(2)) {
302 case 0: /* stored block */
303 Tracev((stderr, "inflate: stored block%s\n",
304 state->last ? " (last)" : ""));
305 state->mode = STORED;
306 break;
307 case 1: /* fixed block */
308 fixedtables(state);
309 Tracev((stderr, "inflate: fixed codes block%s\n",
310 state->last ? " (last)" : ""));
311 state->mode = LEN; /* decode codes */
312 break;
313 case 2: /* dynamic block */
314 Tracev((stderr, "inflate: dynamic codes block%s\n",
315 state->last ? " (last)" : ""));
316 state->mode = TABLE;
317 break;
318 case 3:
319 strm->msg = (char *)"invalid block type";
320 state->mode = BAD;
321 }
322 DROPBITS(2);
323 break;
324
325 case STORED:
326 /* get and verify stored block length */
327 BYTEBITS(); /* go to byte boundary */
328 NEEDBITS(32);
329 if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
330 strm->msg = (char *)"invalid stored block lengths";
331 state->mode = BAD;
332 break;
333 }
334 state->length = (unsigned)hold & 0xffff;
335 Tracev((stderr, "inflate: stored length %u\n",
336 state->length));
337 INITBITS();
338
339 /* copy stored block from input to output */
340 while (state->length != 0) {
341 copy = state->length;
342 PULL();
343 ROOM();
344 if (copy > have) copy = have;
345 if (copy > left) copy = left;
346 zmemcpy(put, next, copy);
347 have -= copy;
348 next += copy;
349 left -= copy;
350 put += copy;
351 state->length -= copy;
352 }
353 Tracev((stderr, "inflate: stored end\n"));
354 state->mode = TYPE;
355 break;
356
357 case TABLE:
358 /* get dynamic table entries descriptor */
359 NEEDBITS(14);
360 state->nlen = BITS(5) + 257;
361 DROPBITS(5);
362 state->ndist = BITS(5) + 1;
363 DROPBITS(5);
364 state->ncode = BITS(4) + 4;
365 DROPBITS(4);
366#ifndef PKZIP_BUG_WORKAROUND
367 if (state->nlen > 286 || state->ndist > 30) {
368 strm->msg = (char *)"too many length or distance symbols";
369 state->mode = BAD;
370 break;
371 }
372#endif
373 Tracev((stderr, "inflate: table sizes ok\n"));
374
375 /* get code length code lengths (not a typo) */
376 state->have = 0;
377 while (state->have < state->ncode) {
378 NEEDBITS(3);
379 state->lens[order[state->have++]] = (unsigned short)BITS(3);
380 DROPBITS(3);
381 }
382 while (state->have < 19)
383 state->lens[order[state->have++]] = 0;
384 state->next = state->codes;
385 state->lencode = (code const FAR *)(state->next);
386 state->lenbits = 7;
387 ret = inflate_table(CODES, state->lens, 19, &(state->next),
388 &(state->lenbits), state->work);
389 if (ret) {
390 strm->msg = (char *)"invalid code lengths set";
391 state->mode = BAD;
392 break;
393 }
394 Tracev((stderr, "inflate: code lengths ok\n"));
395
396 /* get length and distance code code lengths */
397 state->have = 0;
398 while (state->have < state->nlen + state->ndist) {
399 for (;;) {
400 this = state->lencode[BITS(state->lenbits)];
401 if ((unsigned)(this.bits) <= bits) break;
402 PULLBYTE();
403 }
404 if (this.val < 16) {
405 NEEDBITS(this.bits);
406 DROPBITS(this.bits);
407 state->lens[state->have++] = this.val;
408 }
409 else {
410 if (this.val == 16) {
411 NEEDBITS(this.bits + 2);
412 DROPBITS(this.bits);
413 if (state->have == 0) {
414 strm->msg = (char *)"invalid bit length repeat";
415 state->mode = BAD;
416 break;
417 }
418 len = (unsigned)(state->lens[state->have - 1]);
419 copy = 3 + BITS(2);
420 DROPBITS(2);
421 }
422 else if (this.val == 17) {
423 NEEDBITS(this.bits + 3);
424 DROPBITS(this.bits);
425 len = 0;
426 copy = 3 + BITS(3);
427 DROPBITS(3);
428 }
429 else {
430 NEEDBITS(this.bits + 7);
431 DROPBITS(this.bits);
432 len = 0;
433 copy = 11 + BITS(7);
434 DROPBITS(7);
435 }
436 if (state->have + copy > state->nlen + state->ndist) {
437 strm->msg = (char *)"invalid bit length repeat";
438 state->mode = BAD;
439 break;
440 }
441 while (copy--)
442 state->lens[state->have++] = (unsigned short)len;
443 }
444 }
445
446 /* build code tables */
447 state->next = state->codes;
448 state->lencode = (code const FAR *)(state->next);
449 state->lenbits = 9;
450 ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
451 &(state->lenbits), state->work);
452 if (ret) {
453 strm->msg = (char *)"invalid literal/lengths set";
454 state->mode = BAD;
455 break;
456 }
457 state->distcode = (code const FAR *)(state->next);
458 state->distbits = 6;
459 ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
460 &(state->next), &(state->distbits), state->work);
461 if (ret) {
462 strm->msg = (char *)"invalid distances set";
463 state->mode = BAD;
464 break;
465 }
466 Tracev((stderr, "inflate: codes ok\n"));
467 state->mode = LEN;
468
469 case LEN:
470 /* use inflate_fast() if we have enough input and output */
471 if (have >= 6 && left >= 258) {
472 RESTORE();
473 if (state->whave < state->wsize)
474 state->whave = state->wsize - left;
475 inflate_fast(strm, state->wsize);
476 LOAD();
477 break;
478 }
479
480 /* get a literal, length, or end-of-block code */
481 for (;;) {
482 this = state->lencode[BITS(state->lenbits)];
483 if ((unsigned)(this.bits) <= bits) break;
484 PULLBYTE();
485 }
486 if (this.op && (this.op & 0xf0) == 0) {
487 last = this;
488 for (;;) {
489 this = state->lencode[last.val +
490 (BITS(last.bits + last.op) >> last.bits)];
491 if ((unsigned)(last.bits + this.bits) <= bits) break;
492 PULLBYTE();
493 }
494 DROPBITS(last.bits);
495 }
496 DROPBITS(this.bits);
497 state->length = (unsigned)this.val;
498
499 /* process literal */
500 if (this.op == 0) {
501 Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
502 "inflate: literal '%c'\n" :
503 "inflate: literal 0x%02x\n", this.val));
504 ROOM();
505 *put++ = (unsigned char)(state->length);
506 left--;
507 state->mode = LEN;
508 break;
509 }
510
511 /* process end of block */
512 if (this.op & 32) {
513 Tracevv((stderr, "inflate: end of block\n"));
514 state->mode = TYPE;
515 break;
516 }
517
518 /* invalid code */
519 if (this.op & 64) {
520 strm->msg = (char *)"invalid literal/length code";
521 state->mode = BAD;
522 break;
523 }
524
525 /* length code -- get extra bits, if any */
526 state->extra = (unsigned)(this.op) & 15;
527 if (state->extra != 0) {
528 NEEDBITS(state->extra);
529 state->length += BITS(state->extra);
530 DROPBITS(state->extra);
531 }
532 Tracevv((stderr, "inflate: length %u\n", state->length));
533
534 /* get distance code */
535 for (;;) {
536 this = state->distcode[BITS(state->distbits)];
537 if ((unsigned)(this.bits) <= bits) break;
538 PULLBYTE();
539 }
540 if ((this.op & 0xf0) == 0) {
541 last = this;
542 for (;;) {
543 this = state->distcode[last.val +
544 (BITS(last.bits + last.op) >> last.bits)];
545 if ((unsigned)(last.bits + this.bits) <= bits) break;
546 PULLBYTE();
547 }
548 DROPBITS(last.bits);
549 }
550 DROPBITS(this.bits);
551 if (this.op & 64) {
552 strm->msg = (char *)"invalid distance code";
553 state->mode = BAD;
554 break;
555 }
556 state->offset = (unsigned)this.val;
557
558 /* get distance extra bits, if any */
559 state->extra = (unsigned)(this.op) & 15;
560 if (state->extra != 0) {
561 NEEDBITS(state->extra);
562 state->offset += BITS(state->extra);
563 DROPBITS(state->extra);
564 }
565 if (state->offset > state->wsize - (state->whave < state->wsize ?
566 left : 0)) {
567 strm->msg = (char *)"invalid distance too far back";
568 state->mode = BAD;
569 break;
570 }
571 Tracevv((stderr, "inflate: distance %u\n", state->offset));
572
573 /* copy match from window to output */
574 do {
575 ROOM();
576 copy = state->wsize - state->offset;
577 if (copy < left) {
578 from = put + copy;
579 copy = left - copy;
580 }
581 else {
582 from = put - state->offset;
583 copy = left;
584 }
585 if (copy > state->length) copy = state->length;
586 state->length -= copy;
587 left -= copy;
588 do {
589 *put++ = *from++;
590 } while (--copy);
591 } while (state->length != 0);
592 break;
593
594 case DONE:
595 /* inflate stream terminated properly -- write leftover output */
596 ret = Z_STREAM_END;
597 if (left < state->wsize) {
598 if (out(out_desc, state->window, state->wsize - left))
599 ret = Z_BUF_ERROR;
600 }
601 goto inf_leave;
602
603 case BAD:
604 ret = Z_DATA_ERROR;
605 goto inf_leave;
606
607 default: /* can't happen, but makes compilers happy */
608 ret = Z_STREAM_ERROR;
609 goto inf_leave;
610 }
611
612 /* Return unused input */
613 inf_leave:
614 strm->next_in = next;
615 strm->avail_in = have;
616 return ret;
617}
618
619int ZEXPORT inflateBackEnd (z_stream FAR *strm)
620{
621 if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
622 return Z_STREAM_ERROR;
623 ZFREE(strm, strm->state);
624 strm->state = Z_NULL;
625 Tracev((stderr, "inflate: end\n"));
626 return Z_OK;
627}
628#endif /* USE_GZIP && !Z_NO_INFLATE */
629
code
Definition: zinftree.h:24
inflate_state
Definition: zinflate.h:81
z_stream_s
Definition: zlib.h:84
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/zinffast.c Source File

  • src
zinffast.c
1/* inffast.c -- fast decoding
2 * Copyright (C) 1995-2003 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6#include "wattcp.h"
7#include "zutil.h"
8#include "zinftree.h"
9#include "zinflate.h"
10#include "zinffast.h"
11
12#if defined(USE_GZIP) && !defined(Z_NO_INFLATE)
13
14#ifndef ASMINF
15
16/* Allow machine dependent optimization for post-increment or pre-increment.
17 Based on testing to date,
18 Pre-increment preferred for:
19 - PowerPC G3 (Adler)
20 - MIPS R5000 (Randers-Pehrson)
21 Post-increment preferred for:
22 - none
23 No measurable difference:
24 - Pentium III (Anderson)
25 - 68060 (Nikl)
26 */
27#ifdef POSTINC
28# define OFF 0
29# define PUP(a) *(a)++
30#else
31# define OFF 1
32# define PUP(a) *++(a)
33#endif
34
35/*
36 Decode literal, length, and distance codes and write out the resulting
37 literal and match bytes until either not enough input or output is
38 available, an end-of-block is encountered, or a data error is encountered.
39 When large enough input and output buffers are supplied to inflate(), for
40 example, a 16K input buffer and a 64K output buffer, more than 95% of the
41 inflate execution time is spent in this routine.
42
43 Entry assumptions:
44
45 state->mode == LEN
46 strm->avail_in >= 6
47 strm->avail_out >= 258
48 start >= strm->avail_out
49 state->bits < 8
50
51 On return, state->mode is one of:
52
53 LEN -- ran out of enough output space or enough available input
54 TYPE -- reached end of block code, inflate() to interpret next block
55 BAD -- error in block data
56
57 Notes:
58
59 - The maximum input bits used by a length/distance pair is 15 bits for the
60 length code, 5 bits for the length extra, 15 bits for the distance code,
61 and 13 bits for the distance extra. This totals 48 bits, or six bytes.
62 Therefore if strm->avail_in >= 6, then there is enough input to avoid
63 checking for available input while decoding.
64
65 - The maximum bytes that a single length/distance pair can output is 258
66 bytes, which is the maximum length that can be coded. inflate_fast()
67 requires strm->avail_out >= 258 for each loop to avoid checking for
68 output space.
69 */
70void inflate_fast (z_streamp strm,
71 unsigned start) /* inflate()'s starting value for strm->avail_out */
72{
73 struct inflate_state FAR *state;
74 unsigned char FAR *in; /* local strm->next_in */
75 unsigned char FAR *last; /* while in < last, enough input available */
76 unsigned char FAR *out; /* local strm->next_out */
77 unsigned char FAR *beg; /* inflate()'s initial strm->next_out */
78 unsigned char FAR *end; /* while out < end, enough space available */
79 unsigned wsize; /* window size or zero if not using window */
80 unsigned whave; /* valid bytes in the window */
81 unsigned write; /* window write index */
82 unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
83 unsigned long hold; /* local strm->hold */
84 unsigned bits; /* local strm->bits */
85 code const FAR *lcode; /* local strm->lencode */
86 code const FAR *dcode; /* local strm->distcode */
87 unsigned lmask; /* mask for first level of length codes */
88 unsigned dmask; /* mask for first level of distance codes */
89 code this; /* retrieved table entry */
90 unsigned op; /* code bits, operation, extra bits, or */
91 /* window position, window bytes to copy */
92 unsigned len; /* match length, unused bytes */
93 unsigned dist; /* match distance */
94 unsigned char FAR *from; /* where to copy match from */
95
96 /* copy state to local variables */
97 state = (struct inflate_state FAR *)strm->state;
98 in = strm->next_in - OFF;
99 last = in + (strm->avail_in - 5);
100 out = strm->next_out - OFF;
101 beg = out - (start - strm->avail_out);
102 end = out + (strm->avail_out - 257);
103 wsize = state->wsize;
104 whave = state->whave;
105 write = state->write;
106 window = state->window;
107 hold = state->hold;
108 bits = state->bits;
109 lcode = state->lencode;
110 dcode = state->distcode;
111 lmask = (1U << state->lenbits) - 1;
112 dmask = (1U << state->distbits) - 1;
113
114 /* decode literals and length/distances until end-of-block or not enough
115 input data or output space */
116 do {
117 if (bits < 15) {
118 hold += (unsigned long)(PUP(in)) << bits;
119 bits += 8;
120 hold += (unsigned long)(PUP(in)) << bits;
121 bits += 8;
122 }
123 this = lcode[hold & lmask];
124 dolen:
125 op = (unsigned)(this.bits);
126 hold >>= op;
127 bits -= op;
128 op = (unsigned)(this.op);
129 if (op == 0) { /* literal */
130 Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
131 "inflate: literal '%c'\n" :
132 "inflate: literal 0x%02x\n", this.val));
133 PUP(out) = (unsigned char)(this.val);
134 }
135 else if (op & 16) { /* length base */
136 len = (unsigned)(this.val);
137 op &= 15; /* number of extra bits */
138 if (op) {
139 if (bits < op) {
140 hold += (unsigned long)(PUP(in)) << bits;
141 bits += 8;
142 }
143 len += (unsigned)hold & ((1U << op) - 1);
144 hold >>= op;
145 bits -= op;
146 }
147 Tracevv((stderr, "inflate: length %u\n", len));
148 if (bits < 15) {
149 hold += (unsigned long)(PUP(in)) << bits;
150 bits += 8;
151 hold += (unsigned long)(PUP(in)) << bits;
152 bits += 8;
153 }
154 this = dcode[hold & dmask];
155 dodist:
156 op = (unsigned)(this.bits);
157 hold >>= op;
158 bits -= op;
159 op = (unsigned)(this.op);
160 if (op & 16) { /* distance base */
161 dist = (unsigned)(this.val);
162 op &= 15; /* number of extra bits */
163 if (bits < op) {
164 hold += (unsigned long)(PUP(in)) << bits;
165 bits += 8;
166 if (bits < op) {
167 hold += (unsigned long)(PUP(in)) << bits;
168 bits += 8;
169 }
170 }
171 dist += (unsigned)hold & ((1U << op) - 1);
172 hold >>= op;
173 bits -= op;
174 Tracevv((stderr, "inflate: distance %u\n", dist));
175 op = (unsigned)(out - beg); /* max distance in output */
176 if (dist > op) { /* see if copy from window */
177 op = dist - op; /* distance back in window */
178 if (op > whave) {
179 strm->msg = (char *)"invalid distance too far back";
180 state->mode = BAD;
181 break;
182 }
183 from = window - OFF;
184 if (write == 0) { /* very common case */
185 from += wsize - op;
186 if (op < len) { /* some from window */
187 len -= op;
188 do {
189 PUP(out) = PUP(from);
190 } while (--op);
191 from = out - dist; /* rest from output */
192 }
193 }
194 else if (write < op) { /* wrap around window */
195 from += wsize + write - op;
196 op -= write;
197 if (op < len) { /* some from end of window */
198 len -= op;
199 do {
200 PUP(out) = PUP(from);
201 } while (--op);
202 from = window - OFF;
203 if (write < len) { /* some from start of window */
204 op = write;
205 len -= op;
206 do {
207 PUP(out) = PUP(from);
208 } while (--op);
209 from = out - dist; /* rest from output */
210 }
211 }
212 }
213 else { /* contiguous in window */
214 from += write - op;
215 if (op < len) { /* some from window */
216 len -= op;
217 do {
218 PUP(out) = PUP(from);
219 } while (--op);
220 from = out - dist; /* rest from output */
221 }
222 }
223 while (len > 2) {
224 PUP(out) = PUP(from);
225 PUP(out) = PUP(from);
226 PUP(out) = PUP(from);
227 len -= 3;
228 }
229 if (len) {
230 PUP(out) = PUP(from);
231 if (len > 1)
232 PUP(out) = PUP(from);
233 }
234 }
235 else {
236 from = out - dist; /* copy direct from output */
237 do { /* minimum length is three */
238 PUP(out) = PUP(from);
239 PUP(out) = PUP(from);
240 PUP(out) = PUP(from);
241 len -= 3;
242 } while (len > 2);
243 if (len) {
244 PUP(out) = PUP(from);
245 if (len > 1)
246 PUP(out) = PUP(from);
247 }
248 }
249 }
250 else if ((op & 64) == 0) { /* 2nd level distance code */
251 this = dcode[this.val + (hold & ((1U << op) - 1))];
252 goto dodist;
253 }
254 else {
255 strm->msg = (char *)"invalid distance code";
256 state->mode = BAD;
257 break;
258 }
259 }
260 else if ((op & 64) == 0) { /* 2nd level length code */
261 this = lcode[this.val + (hold & ((1U << op) - 1))];
262 goto dolen;
263 }
264 else if (op & 32) { /* end-of-block */
265 Tracevv((stderr, "inflate: end of block\n"));
266 state->mode = TYPE;
267 break;
268 }
269 else {
270 strm->msg = (char *)"invalid literal/length code";
271 state->mode = BAD;
272 break;
273 }
274 } while (in < last && out < end);
275
276 /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
277 len = bits >> 3;
278 in -= len;
279 bits -= len << 3;
280 hold &= (1U << bits) - 1;
281
282 /* update state and return */
283 strm->next_in = in + OFF;
284 strm->next_out = out + OFF;
285 strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
286 strm->avail_out = (unsigned)(out < end ?
287 257 + (end - out) : 257 - (out - end));
288 state->hold = hold;
289 state->bits = bits;
290 return;
291}
292
293/*
294 inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
295 - Using bit fields for code structure
296 - Different op definition to avoid & for extra bits (do & for table bits)
297 - Three separate decoding do-loops for direct, window, and write == 0
298 - Special case for distance > 1 copies to do overlapped load and store copy
299 - Explicit branch predictions (based on measured branch probabilities)
300 - Deferring match copy and interspersed it with decoding subsequent codes
301 - Swapping literal/length else
302 - Swapping window/direct else
303 - Larger unrolled copy loops (three is about right)
304 - Moving len -= 3 statement into middle of loop
305 */
306
307#endif /* !ASMINF */
308#endif /* USE_GZIP && !Z_NO_INFLATE */
309
code
Definition: zinftree.h:24
inflate_state
Definition: zinflate.h:81
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/zinffast.h Source File

  • src
zinffast.h
1/* inffast.h -- header to use inffast.c
2 * Copyright (C) 1995-2003 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* WARNING: this file should *not* be used by applications. It is
7 part of the implementation of the compression library and is
8 subject to change. Applications should only use zlib.h.
9 */
10
11void inflate_fast (z_streamp strm, unsigned start);


Watt-32 tcp/ip: E:/WATT/src/zinffix.h Source File

  • src
zinffix.h
1 /* inffixed.h -- table for decoding fixed codes
2 * Generated automatically by makefixed().
3 */
4
5 /* WARNING: this file should *not* be used by applications. It
6 is part of the implementation of the compression library and
7 is subject to change. Applications should only use zlib.h.
8 */
9
10 static const code lenfix[512] = {
11 {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
12 {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
13 {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
14 {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
15 {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
16 {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
17 {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
18 {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
19 {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
20 {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
21 {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
22 {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
23 {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
24 {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
25 {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
26 {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
27 {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
28 {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
29 {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
30 {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
31 {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
32 {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
33 {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
34 {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
35 {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
36 {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
37 {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
38 {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
39 {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
40 {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
41 {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
42 {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
43 {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
44 {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
45 {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
46 {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
47 {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
48 {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
49 {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
50 {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
51 {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
52 {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
53 {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
54 {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
55 {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
56 {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
57 {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
58 {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
59 {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
60 {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
61 {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
62 {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
63 {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
64 {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
65 {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
66 {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
67 {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
68 {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
69 {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
70 {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
71 {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
72 {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
73 {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
74 {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
75 {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
76 {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
77 {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
78 {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
79 {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
80 {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
81 {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
82 {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
83 {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
84 {0,9,255}
85 };
86
87 static const code distfix[32] = {
88 {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
89 {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
90 {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
91 {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
92 {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
93 {22,5,193},{64,5,0}
94 };
code
Definition: zinftree.h:24


Watt-32 tcp/ip: E:/WATT/src/zinflate.c Source File

  • src
zinflate.c
1/* inflate.c -- zlib decompression
2 * Copyright (C) 1995-2003 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/*
7 * Change history:
8 *
9 * 1.2.beta0 24 Nov 2002
10 * - First version -- complete rewrite of inflate to simplify code, avoid
11 * creation of window when not needed, minimize use of window when it is
12 * needed, make inffast.c even faster, implement gzip decoding, and to
13 * improve code readability and style over the previous zlib inflate code
14 *
15 * 1.2.beta1 25 Nov 2002
16 * - Use pointers for available input and output checking in inffast.c
17 * - Remove input and output counters in inffast.c
18 * - Change inffast.c entry and loop from avail_in >= 7 to >= 6
19 * - Remove unnecessary second byte pull from length extra in inffast.c
20 * - Unroll direct copy to three copies per loop in inffast.c
21 *
22 * 1.2.beta2 4 Dec 2002
23 * - Change external routine names to reduce potential conflicts
24 * - Correct filename to inffixed.h for fixed tables in inflate.c
25 * - Make hbuf[] unsigned char to match parameter type in inflate.c
26 * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
27 * to avoid negation problem on Alphas (64 bit) in inflate.c
28 *
29 * 1.2.beta3 22 Dec 2002
30 * - Add comments on state->bits assertion in inffast.c
31 * - Add comments on op field in inftrees.h
32 * - Fix bug in reuse of allocated window after inflateReset()
33 * - Remove bit fields--back to byte structure for speed
34 * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths
35 * - Change post-increments to pre-increments in inflate_fast(), PPC biased?
36 * - Add compile time option, POSTINC, to use post-increments instead (Intel?)
37 * - Make MATCH copy in inflate() much faster for when inflate_fast() not used
38 * - Use local copies of stream next and avail values, as well as local bit
39 * buffer and bit count in inflate()--for speed when inflate_fast() not used
40 *
41 * 1.2.beta4 1 Jan 2003
42 * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings
43 * - Move a comment on output buffer sizes from inffast.c to inflate.c
44 * - Add comments in inffast.c to introduce the inflate_fast() routine
45 * - Rearrange window copies in inflate_fast() for speed and simplification
46 * - Unroll last copy for window match in inflate_fast()
47 * - Use local copies of window variables in inflate_fast() for speed
48 * - Pull out common write == 0 case for speed in inflate_fast()
49 * - Make op and len in inflate_fast() unsigned for consistency
50 * - Add FAR to lcode and dcode declarations in inflate_fast()
51 * - Simplified bad distance check in inflate_fast()
52 * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new
53 * source file infback.c to provide a call-back interface to inflate for
54 * programs like gzip and unzip -- uses window as output buffer to avoid
55 * window copying
56 *
57 * 1.2.beta5 1 Jan 2003
58 * - Improved inflateBack() interface to allow the caller to provide initial
59 * input in strm.
60 * - Fixed stored blocks bug in inflateBack()
61 *
62 * 1.2.beta6 4 Jan 2003
63 * - Added comments in inffast.c on effectiveness of POSTINC
64 * - Typecasting all around to reduce compiler warnings
65 * - Changed loops from while (1) or do {} while (1) to for (;;), again to
66 * make compilers happy
67 * - Changed type of window in inflateBackInit() to unsigned char *
68 *
69 * 1.2.beta7 27 Jan 2003
70 * - Changed many types to unsigned or unsigned short to avoid warnings
71 * - Added inflateCopy() function
72 *
73 * 1.2.0 9 Mar 2003
74 * - Changed inflateBack() interface to provide separate opaque descriptors
75 * for the in() and out() functions
76 * - Changed inflateBack() argument and in_func typedef to swap the length
77 * and buffer address return values for the input function
78 * - Check next_in and next_out for Z_NULL on entry to inflate()
79 *
80 * The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
81 */
82
83#include "wattcp.h"
84#include "zutil.h"
85#include "zinftree.h"
86#include "zinflate.h"
87#include "zinffast.h"
88
89#if defined(USE_GZIP) && !defined(Z_NO_INFLATE)
90
91#ifdef MAKEFIXED
92# ifndef BUILDFIXED
93# define BUILDFIXED
94# endif
95#endif
96
97#if (W32_GCC_VERSION >= 70000)
98 /*
99 * Suppress warning
100 * zinflate.c:638:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
101 */
102 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
103 W32_GCC_PRAGMA (GCC diagnostic ignored "-Wimplicit-fallthrough")
104#endif
105
106/* function prototypes */
107local void fixedtables (struct inflate_state FAR *state);
108local int updatewindow (z_streamp strm, unsigned out);
109#ifdef BUILDFIXED
110 void makefixed (void);
111#endif
112local unsigned syncsearch (unsigned FAR *have, unsigned char FAR *buf,
113 unsigned len);
114
115int ZEXPORT inflateReset (z_streamp strm)
116{
117 struct inflate_state FAR *state;
118
119 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
120 state = (struct inflate_state FAR *)strm->state;
121 strm->total_in = strm->total_out = state->total = 0;
122 strm->msg = Z_NULL;
123 state->mode = HEAD;
124 state->last = 0;
125 state->havedict = 0;
126 state->wsize = 0;
127 state->whave = 0;
128 state->hold = 0;
129 state->bits = 0;
130 state->lencode = state->distcode = state->next = state->codes;
131 Tracev((stderr, "inflate: reset\n"));
132 return Z_OK;
133}
134
135int ZEXPORT inflateInit2_ (z_streamp strm, int windowBits,
136 const char *version, int stream_size)
137{
138 struct inflate_state FAR *state;
139
140 if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
141 stream_size != (int)(sizeof(z_stream)))
142 return Z_VERSION_ERROR;
143 if (strm == Z_NULL) return Z_STREAM_ERROR;
144 strm->msg = Z_NULL; /* in case we return an error */
145 if (strm->zalloc == (alloc_func)0) {
146 strm->zalloc = zcalloc;
147 strm->opaque = (voidpf)0;
148 }
149 if (strm->zfree == (free_func)0) strm->zfree = zcfree;
150 state = (struct inflate_state FAR *)
151 ZALLOC(strm, 1, sizeof(struct inflate_state));
152 if (state == Z_NULL) return Z_MEM_ERROR;
153 Tracev((stderr, "inflate: allocated\n"));
154 strm->state = (voidpf)state;
155 if (windowBits < 0) {
156 state->wrap = 0;
157 windowBits = -windowBits;
158 }
159 else {
160 state->wrap = (windowBits >> 4) + 1;
161#ifdef GUNZIP
162 if (windowBits < 48) windowBits &= 15;
163#endif
164 }
165 if (windowBits < 8 || windowBits > 15) {
166 ZFREE(strm, state);
167 strm->state = Z_NULL;
168 return Z_STREAM_ERROR;
169 }
170 state->wbits = (unsigned)windowBits;
171 state->window = Z_NULL;
172 return inflateReset(strm);
173}
174
175int ZEXPORT inflateInit_ (z_streamp strm, const char *version, int stream_size)
176{
177 return inflateInit2_(strm, DEF_WBITS, version, stream_size);
178}
179
180/*
181 Return state with length and distance decoding tables and index sizes set to
182 fixed code decoding. Normally this returns fixed tables from inffixed.h.
183 If BUILDFIXED is defined, then instead this routine builds the tables the
184 first time it's called, and returns those tables the first time and
185 thereafter. This reduces the size of the code by about 2K bytes, in
186 exchange for a little execution time. However, BUILDFIXED should not be
187 used for threaded applications, since the rewriting of the tables and virgin
188 may not be thread-safe.
189 */
190local void fixedtables (struct inflate_state FAR *state)
191{
192#ifdef BUILDFIXED
193 static int virgin = 1;
194 static code *lenfix, *distfix;
195 static code fixed[544];
196
197 /* build fixed huffman tables if first call (may not be thread safe) */
198 if (virgin) {
199 unsigned sym, bits;
200 static code *next;
201
202 /* literal/length table */
203 sym = 0;
204 while (sym < 144) state->lens[sym++] = 8;
205 while (sym < 256) state->lens[sym++] = 9;
206 while (sym < 280) state->lens[sym++] = 7;
207 while (sym < 288) state->lens[sym++] = 8;
208 next = fixed;
209 lenfix = next;
210 bits = 9;
211 inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
212
213 /* distance table */
214 sym = 0;
215 while (sym < 32) state->lens[sym++] = 5;
216 distfix = next;
217 bits = 5;
218 inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
219
220 /* do this just once */
221 virgin = 0;
222 }
223#else /* !BUILDFIXED */
224# include "zinffix.h"
225#endif /* BUILDFIXED */
226 state->lencode = lenfix;
227 state->lenbits = 9;
228 state->distcode = distfix;
229 state->distbits = 5;
230}
231
232#ifdef MAKEFIXED
233#include <stdio.h>
234
235/*
236 Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also
237 defines BUILDFIXED, so the tables are built on the fly. makefixed() writes
238 those tables to stdout, which would be piped to inffixed.h. A small program
239 can simply call makefixed to do this:
240
241 void makefixed(void);
242
243 int main(void)
244 {
245 makefixed();
246 return 0;
247 }
248
249 Then that can be linked with zlib built with MAKEFIXED defined and run:
250
251 a.out > inffixed.h
252 */
253void makefixed (void)
254{
255 unsigned low, size;
256 struct inflate_state state;
257
258 fixedtables(&state);
259 puts(" /* inffixed.h -- table for decoding fixed codes");
260 puts(" * Generated automatically by makefixed().");
261 puts(" */");
262 puts("");
263 puts(" /* WARNING: this file should *not* be used by applications.");
264 puts(" It is part of the implementation of this library and is");
265 puts(" subject to change. Applications should only use zlib.h.");
266 puts(" */");
267 puts("");
268 size = 1U << 9;
269 printf(" static const code lenfix[%u] = {", size);
270 low = 0;
271 for (;;) {
272 if ((low % 7) == 0) printf("\n ");
273 printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits,
274 state.lencode[low].val);
275 if (++low == size) break;
276 putchar(',');
277 }
278 puts("\n };");
279 size = 1U << 5;
280 printf("\n static const code distfix[%u] = {", size);
281 low = 0;
282 for (;;) {
283 if ((low % 6) == 0) printf("\n ");
284 printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
285 state.distcode[low].val);
286 if (++low == size) break;
287 putchar(',');
288 }
289 puts("\n };");
290}
291#endif /* MAKEFIXED */
292
293/*
294 Update the window with the last wsize (normally 32K) bytes written before
295 returning. If window does not exist yet, create it. This is only called
296 when a window is already in use, or when output has been written during this
297 inflate call, but the end of the deflate stream has not been reached yet.
298 It is also called to create a window for dictionary data when a dictionary
299 is loaded.
300
301 Providing output buffers larger than 32K to inflate() should provide a speed
302 advantage, since only the last 32K of output is copied to the sliding window
303 upon return from inflate(), and since all distances after the first 32K of
304 output will fall in the output data, making match copies simpler and faster.
305 The advantage may be dependent on the size of the processor's data caches.
306 */
307local int updatewindow (z_streamp strm, unsigned out)
308{
309 struct inflate_state FAR *state;
310 unsigned copy, dist;
311
312 state = (struct inflate_state FAR *)strm->state;
313
314 /* if it hasn't been done already, allocate space for the window */
315 if (state->window == Z_NULL) {
316 state->window = (unsigned char FAR *)
317 ZALLOC(strm, 1U << state->wbits,
318 sizeof(unsigned char));
319 if (state->window == Z_NULL) return 1;
320 }
321
322 /* if window not in use yet, initialize */
323 if (state->wsize == 0) {
324 state->wsize = 1U << state->wbits;
325 state->write = 0;
326 state->whave = 0;
327 }
328
329 /* copy state->wsize or less output bytes into the circular window */
330 copy = out - strm->avail_out;
331 if (copy >= state->wsize) {
332 zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
333 state->write = 0;
334 state->whave = state->wsize;
335 }
336 else {
337 dist = state->wsize - state->write;
338 if (dist > copy) dist = copy;
339 zmemcpy(state->window + state->write, strm->next_out - copy, dist);
340 copy -= dist;
341 if (copy) {
342 zmemcpy(state->window, strm->next_out - copy, copy);
343 state->write = copy;
344 state->whave = state->wsize;
345 }
346 else {
347 state->write += dist;
348 if (state->write == state->wsize) state->write = 0;
349 if (state->whave < state->wsize) state->whave += dist;
350 }
351 }
352 return 0;
353}
354
355/* Macros for inflate(): */
356
357/* check function to use adler32() for zlib or crc32() for gzip */
358#ifdef GUNZIP
359# define UPDATE(check, buf, len) \
360 (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
361#else
362# define UPDATE(check, buf, len) adler32(check, buf, len)
363#endif
364
365/* check macros for header crc */
366#ifdef GUNZIP
367# define CRC2(check, word) \
368 do { \
369 hbuf[0] = (unsigned char)(word); \
370 hbuf[1] = (unsigned char)((word) >> 8); \
371 check = crc32(check, hbuf, 2); \
372 } while (0)
373
374# define CRC4(check, word) \
375 do { \
376 hbuf[0] = (unsigned char)(word); \
377 hbuf[1] = (unsigned char)((word) >> 8); \
378 hbuf[2] = (unsigned char)((word) >> 16); \
379 hbuf[3] = (unsigned char)((word) >> 24); \
380 check = crc32(check, hbuf, 4); \
381 } while (0)
382#endif
383
384/* Load registers with state in inflate() for speed */
385#define LOAD() \
386 do { \
387 put = strm->next_out; \
388 left = strm->avail_out; \
389 next = strm->next_in; \
390 have = strm->avail_in; \
391 hold = state->hold; \
392 bits = state->bits; \
393 } while (0)
394
395/* Restore state from registers in inflate() */
396#define RESTORE() \
397 do { \
398 strm->next_out = put; \
399 strm->avail_out = left; \
400 strm->next_in = next; \
401 strm->avail_in = have; \
402 state->hold = hold; \
403 state->bits = bits; \
404 } while (0)
405
406/* Clear the input bit accumulator */
407#define INITBITS() \
408 do { \
409 hold = 0; \
410 bits = 0; \
411 } while (0)
412
413/* Get a byte of input into the bit accumulator, or return from inflate()
414 if there is no input available. */
415#define PULLBYTE() \
416 do { \
417 if (have == 0) goto inf_leave; \
418 have--; \
419 hold += (unsigned long)(*next++) << bits; \
420 bits += 8; \
421 } while (0)
422
423/* Assure that there are at least n bits in the bit accumulator. If there is
424 not enough available input to do that, then return from inflate(). */
425#define NEEDBITS(n) \
426 do { \
427 while (bits < (unsigned)(n)) \
428 PULLBYTE(); \
429 } while (0)
430
431/* Return the low n bits of the bit accumulator (n < 16) */
432#define BITS(n) \
433 ((unsigned)hold & ((1U << (n)) - 1))
434
435/* Remove n bits from the bit accumulator */
436#define DROPBITS(n) \
437 do { \
438 hold >>= (n); \
439 bits -= (unsigned)(n); \
440 } while (0)
441
442/* Remove zero to seven bits as needed to go to a byte boundary */
443#define BYTEBITS() \
444 do { \
445 hold >>= bits & 7; \
446 bits -= bits & 7; \
447 } while (0)
448
449/* Reverse the bytes in a 32-bit value */
450#define REVERSE(q) \
451 ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
452 (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
453
454/*
455 inflate() uses a state machine to process as much input data and generate as
456 much output data as possible before returning. The state machine is
457 structured roughly as follows:
458
459 for (;;) switch (state) {
460 ...
461 case STATEn:
462 if (not enough input data or output space to make progress)
463 return;
464 ... make progress ...
465 state = STATEm;
466 break;
467 ...
468 }
469
470 so when inflate() is called again, the same case is attempted again, and
471 if the appropriate resources are provided, the machine proceeds to the
472 next state. The NEEDBITS() macro is usually the way the state evaluates
473 whether it can proceed or should return. NEEDBITS() does the return if
474 the requested bits are not available. The typical use of the BITS macros
475 is:
476
477 NEEDBITS(n);
478 ... do something with BITS(n) ...
479 DROPBITS(n);
480
481 where NEEDBITS(n) either returns from inflate() if there isn't enough
482 input left to load n bits into the accumulator, or it continues. BITS(n)
483 gives the low n bits in the accumulator. When done, DROPBITS(n) drops
484 the low n bits off the accumulator. INITBITS() clears the accumulator
485 and sets the number of available bits to zero. BYTEBITS() discards just
486 enough bits to put the accumulator on a byte boundary. After BYTEBITS()
487 and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
488
489 NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
490 if there is no input available. The decoding of variable length codes uses
491 PULLBYTE() directly in order to pull just enough bytes to decode the next
492 code, and no more.
493
494 Some states loop until they get enough input, making sure that enough
495 state information is maintained to continue the loop where it left off
496 if NEEDBITS() returns in the loop. For example, want, need, and keep
497 would all have to actually be part of the saved state in case NEEDBITS()
498 returns:
499
500 case STATEw:
501 while (want < need) {
502 NEEDBITS(n);
503 keep[want++] = BITS(n);
504 DROPBITS(n);
505 }
506 state = STATEx;
507 case STATEx:
508
509 As shown above, if the next state is also the next case, then the break
510 is omitted.
511
512 A state may also return if there is not enough output space available to
513 complete that state. Those states are copying stored data, writing a
514 literal byte, and copying a matching string.
515
516 When returning, a "goto inf_leave" is used to update the total counters,
517 update the check value, and determine whether any progress has been made
518 during that inflate() call in order to return the proper return code.
519 Progress is defined as a change in either strm->avail_in or strm->avail_out.
520 When there is a window, goto inf_leave will update the window with the last
521 output written. If a goto inf_leave occurs in the middle of decompression
522 and there is no window currently, goto inf_leave will create one and copy
523 output to the window for the next call of inflate().
524
525 In this implementation, the flush parameter of inflate() only affects the
526 return code (per zlib.h). inflate() always writes as much as possible to
527 strm->next_out, given the space available and the provided input--the effect
528 documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers
529 the allocation of and copying into a sliding window until necessary, which
530 provides the effect documented in zlib.h for Z_FINISH when the entire input
531 stream available. So the only thing the flush parameter actually does is:
532 when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it
533 will return Z_BUF_ERROR if it has not reached the end of the stream.
534 */
535
536int ZEXPORT inflate (z_streamp strm, int flush)
537{
538 struct inflate_state FAR *state;
539 unsigned char FAR *next; /* next input */
540 unsigned char FAR *put; /* next output */
541 unsigned have, left; /* available input and output */
542 unsigned long hold; /* bit buffer */
543 unsigned bits; /* bits in bit buffer */
544 unsigned in, out; /* save starting available input and output */
545 unsigned copy; /* number of stored or match bytes to copy */
546 unsigned char FAR *from; /* where to copy match bytes from */
547 code this; /* current decoding table entry */
548 code last; /* parent table entry */
549 unsigned len; /* length to copy for repeats, bits to drop */
550 int ret; /* return code */
551#ifdef GUNZIP
552 unsigned char hbuf[4]; /* buffer for gzip header crc calculation */
553#endif
554 static const unsigned short order[19] = /* permutation of code lengths */
555 {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
556
557 if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
558 (strm->next_in == Z_NULL && strm->avail_in != 0))
559 return Z_STREAM_ERROR;
560
561 state = (struct inflate_state FAR *)strm->state;
562 if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */
563 LOAD();
564 in = have;
565 out = left;
566 ret = Z_OK;
567 for (;;)
568 switch (state->mode) {
569 case HEAD:
570 if (state->wrap == 0) {
571 state->mode = TYPEDO;
572 break;
573 }
574 NEEDBITS(16);
575#ifdef GUNZIP
576 if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */
577 state->check = crc32(0L, Z_NULL, 0);
578 CRC2(state->check, hold);
579 INITBITS();
580 state->mode = FLAGS;
581 break;
582 }
583 state->flags = 0; /* expect zlib header */
584 if (!(state->wrap & 1) || /* check if zlib header allowed */
585#else
586 if (
587#endif
588 ((BITS(8) << 8) + (hold >> 8)) % 31) {
589 strm->msg = (char *)"incorrect header check";
590 state->mode = BAD;
591 break;
592 }
593 if (BITS(4) != Z_DEFLATED) {
594 strm->msg = (char *)"unknown compression method";
595 state->mode = BAD;
596 break;
597 }
598 DROPBITS(4);
599 if (BITS(4) + 8 > state->wbits) {
600 strm->msg = (char *)"invalid window size";
601 state->mode = BAD;
602 break;
603 }
604 Tracev((stderr, "inflate: zlib header ok\n"));
605 strm->adler = state->check = adler32(0L, Z_NULL, 0);
606 state->mode = hold & 0x200 ? DICTID : TYPE;
607 INITBITS();
608 break;
609#ifdef GUNZIP
610 case FLAGS:
611 NEEDBITS(16);
612 state->flags = (int)(hold);
613 if ((state->flags & 0xff) != Z_DEFLATED) {
614 strm->msg = (char *)"unknown compression method";
615 state->mode = BAD;
616 break;
617 }
618 if (state->flags & 0xe000) {
619 strm->msg = (char *)"unknown header flags set";
620 state->mode = BAD;
621 break;
622 }
623 if (state->flags & 0x0200) CRC2(state->check, hold);
624 INITBITS();
625 state->mode = TIME;
626 case TIME:
627 NEEDBITS(32);
628 if (state->flags & 0x0200) CRC4(state->check, hold);
629 INITBITS();
630 state->mode = OS;
631 case OS:
632 NEEDBITS(16);
633 if (state->flags & 0x0200) CRC2(state->check, hold);
634 INITBITS();
635 state->mode = EXLEN;
636 case EXLEN:
637 if (state->flags & 0x0400) {
638 NEEDBITS(16);
639 state->length = (unsigned)(hold);
640 if (state->flags & 0x0200) CRC2(state->check, hold);
641 INITBITS();
642 }
643 state->mode = EXTRA;
644 case EXTRA:
645 if (state->flags & 0x0400) {
646 copy = state->length;
647 if (copy > have) copy = have;
648 if (copy) {
649 if (state->flags & 0x0200)
650 state->check = crc32(state->check, next, copy);
651 have -= copy;
652 next += copy;
653 state->length -= copy;
654 }
655 if (state->length) goto inf_leave;
656 }
657 state->mode = NAME;
658 case NAME:
659 if (state->flags & 0x0800) {
660 if (have == 0) goto inf_leave;
661 copy = 0;
662 do {
663 len = (unsigned)(next[copy++]);
664 } while (len && copy < have);
665 if (state->flags & 0x02000)
666 state->check = crc32(state->check, next, copy);
667 have -= copy;
668 next += copy;
669 if (len) goto inf_leave;
670 }
671 state->mode = COMMENT;
672 case COMMENT:
673 if (state->flags & 0x1000) {
674 if (have == 0) goto inf_leave;
675 copy = 0;
676 do {
677 len = (unsigned)(next[copy++]);
678 } while (len && copy < have);
679 if (state->flags & 0x02000)
680 state->check = crc32(state->check, next, copy);
681 have -= copy;
682 next += copy;
683 if (len) goto inf_leave;
684 }
685 state->mode = HCRC;
686 case HCRC:
687 if (state->flags & 0x0200) {
688 NEEDBITS(16);
689 if (hold != (state->check & 0xffff)) {
690 strm->msg = (char *)"header crc mismatch";
691 state->mode = BAD;
692 break;
693 }
694 INITBITS();
695 }
696 strm->adler = state->check = crc32(0L, Z_NULL, 0);
697 state->mode = TYPE;
698 break;
699#endif
700 case DICTID:
701 NEEDBITS(32);
702 strm->adler = state->check = REVERSE(hold);
703 INITBITS();
704 state->mode = DICT;
705 case DICT:
706 if (state->havedict == 0) {
707 RESTORE();
708 return Z_NEED_DICT;
709 }
710 strm->adler = state->check = adler32(0L, Z_NULL, 0);
711 state->mode = TYPE;
712 case TYPE:
713 if (flush == Z_BLOCK) goto inf_leave;
714 case TYPEDO:
715 if (state->last) {
716 BYTEBITS();
717 state->mode = CHECK;
718 break;
719 }
720 NEEDBITS(3);
721 state->last = BITS(1);
722 DROPBITS(1);
723 switch (BITS(2)) {
724 case 0: /* stored block */
725 Tracev((stderr, "inflate: stored block%s\n",
726 state->last ? " (last)" : ""));
727 state->mode = STORED;
728 break;
729 case 1: /* fixed block */
730 fixedtables(state);
731 Tracev((stderr, "inflate: fixed codes block%s\n",
732 state->last ? " (last)" : ""));
733 state->mode = LEN; /* decode codes */
734 break;
735 case 2: /* dynamic block */
736 Tracev((stderr, "inflate: dynamic codes block%s\n",
737 state->last ? " (last)" : ""));
738 state->mode = TABLE;
739 break;
740 case 3:
741 strm->msg = (char *)"invalid block type";
742 state->mode = BAD;
743 }
744 DROPBITS(2);
745 break;
746 case STORED:
747 BYTEBITS(); /* go to byte boundary */
748 NEEDBITS(32);
749 if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
750 strm->msg = (char *)"invalid stored block lengths";
751 state->mode = BAD;
752 break;
753 }
754 state->length = (unsigned)hold & 0xffff;
755 Tracev((stderr, "inflate: stored length %u\n",
756 state->length));
757 INITBITS();
758 state->mode = COPY;
759 case COPY:
760 copy = state->length;
761 if (copy) {
762 if (copy > have) copy = have;
763 if (copy > left) copy = left;
764 if (copy == 0) goto inf_leave;
765 zmemcpy(put, next, copy);
766 have -= copy;
767 next += copy;
768 left -= copy;
769 put += copy;
770 state->length -= copy;
771 break;
772 }
773 Tracev((stderr, "inflate: stored end\n"));
774 state->mode = TYPE;
775 break;
776 case TABLE:
777 NEEDBITS(14);
778 state->nlen = BITS(5) + 257;
779 DROPBITS(5);
780 state->ndist = BITS(5) + 1;
781 DROPBITS(5);
782 state->ncode = BITS(4) + 4;
783 DROPBITS(4);
784#ifndef PKZIP_BUG_WORKAROUND
785 if (state->nlen > 286 || state->ndist > 30) {
786 strm->msg = (char *)"too many length or distance symbols";
787 state->mode = BAD;
788 break;
789 }
790#endif
791 Tracev((stderr, "inflate: table sizes ok\n"));
792 state->have = 0;
793 state->mode = LENLENS;
794 case LENLENS:
795 while (state->have < state->ncode) {
796 NEEDBITS(3);
797 state->lens[order[state->have++]] = (unsigned short)BITS(3);
798 DROPBITS(3);
799 }
800 while (state->have < 19)
801 state->lens[order[state->have++]] = 0;
802 state->next = state->codes;
803 state->lencode = (code const FAR *)(state->next);
804 state->lenbits = 7;
805 ret = inflate_table(CODES, state->lens, 19, &(state->next),
806 &(state->lenbits), state->work);
807 if (ret) {
808 strm->msg = (char *)"invalid code lengths set";
809 state->mode = BAD;
810 break;
811 }
812 Tracev((stderr, "inflate: code lengths ok\n"));
813 state->have = 0;
814 state->mode = CODELENS;
815 case CODELENS:
816 while (state->have < state->nlen + state->ndist) {
817 for (;;) {
818 this = state->lencode[BITS(state->lenbits)];
819 if ((unsigned)(this.bits) <= bits) break;
820 PULLBYTE();
821 }
822 if (this.val < 16) {
823 NEEDBITS(this.bits);
824 DROPBITS(this.bits);
825 state->lens[state->have++] = this.val;
826 }
827 else {
828 if (this.val == 16) {
829 NEEDBITS(this.bits + 2);
830 DROPBITS(this.bits);
831 if (state->have == 0) {
832 strm->msg = (char *)"invalid bit length repeat";
833 state->mode = BAD;
834 break;
835 }
836 len = state->lens[state->have - 1];
837 copy = 3 + BITS(2);
838 DROPBITS(2);
839 }
840 else if (this.val == 17) {
841 NEEDBITS(this.bits + 3);
842 DROPBITS(this.bits);
843 len = 0;
844 copy = 3 + BITS(3);
845 DROPBITS(3);
846 }
847 else {
848 NEEDBITS(this.bits + 7);
849 DROPBITS(this.bits);
850 len = 0;
851 copy = 11 + BITS(7);
852 DROPBITS(7);
853 }
854 if (state->have + copy > state->nlen + state->ndist) {
855 strm->msg = (char *)"invalid bit length repeat";
856 state->mode = BAD;
857 break;
858 }
859 while (copy--)
860 state->lens[state->have++] = (unsigned short)len;
861 }
862 }
863
864 /* build code tables */
865 state->next = state->codes;
866 state->lencode = (code const FAR *)(state->next);
867 state->lenbits = 9;
868 ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
869 &(state->lenbits), state->work);
870 if (ret) {
871 strm->msg = (char *)"invalid literal/lengths set";
872 state->mode = BAD;
873 break;
874 }
875 state->distcode = (code const FAR *)(state->next);
876 state->distbits = 6;
877 ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
878 &(state->next), &(state->distbits), state->work);
879 if (ret) {
880 strm->msg = (char *)"invalid distances set";
881 state->mode = BAD;
882 break;
883 }
884 Tracev((stderr, "inflate: codes ok\n"));
885 state->mode = LEN;
886 case LEN:
887 if (have >= 6 && left >= 258) {
888 RESTORE();
889 inflate_fast(strm, out);
890 LOAD();
891 break;
892 }
893 for (;;) {
894 this = state->lencode[BITS(state->lenbits)];
895 if ((unsigned)(this.bits) <= bits) break;
896 PULLBYTE();
897 }
898 if (this.op && (this.op & 0xf0) == 0) {
899 last = this;
900 for (;;) {
901 this = state->lencode[last.val +
902 (BITS(last.bits + last.op) >> last.bits)];
903 if ((unsigned)(last.bits + this.bits) <= bits) break;
904 PULLBYTE();
905 }
906 DROPBITS(last.bits);
907 }
908 DROPBITS(this.bits);
909 state->length = (unsigned)this.val;
910 if ((int)(this.op) == 0) {
911 Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
912 "inflate: literal '%c'\n" :
913 "inflate: literal 0x%02x\n", this.val));
914 state->mode = LIT;
915 break;
916 }
917 if (this.op & 32) {
918 Tracevv((stderr, "inflate: end of block\n"));
919 state->mode = TYPE;
920 break;
921 }
922 if (this.op & 64) {
923 strm->msg = (char *)"invalid literal/length code";
924 state->mode = BAD;
925 break;
926 }
927 state->extra = (unsigned)(this.op) & 15;
928 state->mode = LENEXT;
929 case LENEXT:
930 if (state->extra) {
931 NEEDBITS(state->extra);
932 state->length += BITS(state->extra);
933 DROPBITS(state->extra);
934 }
935 Tracevv((stderr, "inflate: length %u\n", state->length));
936 state->mode = DIST;
937 case DIST:
938 for (;;) {
939 this = state->distcode[BITS(state->distbits)];
940 if ((unsigned)(this.bits) <= bits) break;
941 PULLBYTE();
942 }
943 if ((this.op & 0xf0) == 0) {
944 last = this;
945 for (;;) {
946 this = state->distcode[last.val +
947 (BITS(last.bits + last.op) >> last.bits)];
948 if ((unsigned)(last.bits + this.bits) <= bits) break;
949 PULLBYTE();
950 }
951 DROPBITS(last.bits);
952 }
953 DROPBITS(this.bits);
954 if (this.op & 64) {
955 strm->msg = (char *)"invalid distance code";
956 state->mode = BAD;
957 break;
958 }
959 state->offset = (unsigned)this.val;
960 state->extra = (unsigned)(this.op) & 15;
961 state->mode = DISTEXT;
962 case DISTEXT:
963 if (state->extra) {
964 NEEDBITS(state->extra);
965 state->offset += BITS(state->extra);
966 DROPBITS(state->extra);
967 }
968 if (state->offset > state->whave + out - left) {
969 strm->msg = (char *)"invalid distance too far back";
970 state->mode = BAD;
971 break;
972 }
973 Tracevv((stderr, "inflate: distance %u\n", state->offset));
974 state->mode = MATCH;
975 case MATCH:
976 if (left == 0) goto inf_leave;
977 copy = out - left;
978 if (state->offset > copy) { /* copy from window */
979 copy = state->offset - copy;
980 if (copy > state->write) {
981 copy -= state->write;
982 from = state->window + (state->wsize - copy);
983 }
984 else
985 from = state->window + (state->write - copy);
986 if (copy > state->length) copy = state->length;
987 }
988 else { /* copy from output */
989 from = put - state->offset;
990 copy = state->length;
991 }
992 if (copy > left) copy = left;
993 left -= copy;
994 state->length -= copy;
995 do {
996 *put++ = *from++;
997 } while (--copy);
998 if (state->length == 0) state->mode = LEN;
999 break;
1000 case LIT:
1001 if (left == 0) goto inf_leave;
1002 *put++ = (unsigned char)(state->length);
1003 left--;
1004 state->mode = LEN;
1005 break;
1006 case CHECK:
1007 if (state->wrap) {
1008 NEEDBITS(32);
1009 out -= left;
1010 strm->total_out += out;
1011 state->total += out;
1012 if (out)
1013 strm->adler = state->check =
1014 UPDATE(state->check, put - out, out);
1015 out = left;
1016 if ((
1017#ifdef GUNZIP
1018 state->flags ? hold :
1019#endif
1020 REVERSE(hold)) != state->check) {
1021 strm->msg = (char *)"incorrect data check";
1022 state->mode = BAD;
1023 break;
1024 }
1025 INITBITS();
1026 Tracev((stderr, "inflate: check matches trailer\n"));
1027 }
1028#ifdef GUNZIP
1029 state->mode = LENGTH;
1030 case LENGTH:
1031 if (state->wrap && state->flags) {
1032 NEEDBITS(32);
1033 if (hold != (state->total & 0xffffffffUL)) {
1034 strm->msg = (char *)"incorrect length check";
1035 state->mode = BAD;
1036 break;
1037 }
1038 INITBITS();
1039 Tracev((stderr, "inflate: length matches trailer\n"));
1040 }
1041#endif
1042 state->mode = DONE;
1043 case DONE:
1044 ret = Z_STREAM_END;
1045 goto inf_leave;
1046 case BAD:
1047 ret = Z_DATA_ERROR;
1048 goto inf_leave;
1049 case MEM:
1050 return Z_MEM_ERROR;
1051 case SYNC:
1052 default:
1053 return Z_STREAM_ERROR;
1054 }
1055
1056 /*
1057 Return from inflate(), updating the total counts and the check value.
1058 If there was no progress during the inflate() call, return a buffer
1059 error. Call updatewindow() to create and/or update the window state.
1060 Note: a memory error from inflate() is non-recoverable.
1061 */
1062 inf_leave:
1063 RESTORE();
1064 if (state->wsize || (state->mode < CHECK && out != strm->avail_out))
1065 if (updatewindow(strm, out)) {
1066 state->mode = MEM;
1067 return Z_MEM_ERROR;
1068 }
1069 in -= strm->avail_in;
1070 out -= strm->avail_out;
1071 strm->total_in += in;
1072 strm->total_out += out;
1073 state->total += out;
1074 if (state->wrap && out)
1075 strm->adler = state->check =
1076 UPDATE(state->check, strm->next_out - out, out);
1077 strm->data_type = state->bits + (state->last ? 64 : 0) +
1078 (state->mode == TYPE ? 128 : 0);
1079 if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
1080 ret = Z_BUF_ERROR;
1081 return ret;
1082}
1083
1084int ZEXPORT inflateEnd (z_streamp strm)
1085{
1086 struct inflate_state FAR *state;
1087 if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
1088 return Z_STREAM_ERROR;
1089 state = (struct inflate_state FAR *)strm->state;
1090 if (state->window != Z_NULL) ZFREE(strm, state->window);
1091 ZFREE(strm, strm->state);
1092 strm->state = Z_NULL;
1093 Tracev((stderr, "inflate: end\n"));
1094 return Z_OK;
1095}
1096
1097int ZEXPORT inflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt dictLength)
1098{
1099 struct inflate_state FAR *state;
1100 unsigned long id;
1101
1102 /* check state */
1103 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
1104 state = (struct inflate_state FAR *)strm->state;
1105 if (state->mode != DICT) return Z_STREAM_ERROR;
1106
1107 /* check for correct dictionary id */
1108 id = adler32(0L, Z_NULL, 0);
1109 id = adler32(id, dictionary, dictLength);
1110 if (id != state->check) return Z_DATA_ERROR;
1111
1112 /* copy dictionary to window */
1113 if (updatewindow(strm, strm->avail_out)) {
1114 state->mode = MEM;
1115 return Z_MEM_ERROR;
1116 }
1117 if (dictLength > state->wsize) {
1118 zmemcpy(state->window, dictionary + dictLength - state->wsize,
1119 state->wsize);
1120 state->whave = state->wsize;
1121 }
1122 else {
1123 zmemcpy(state->window + state->wsize - dictLength, dictionary,
1124 dictLength);
1125 state->whave = dictLength;
1126 }
1127 state->havedict = 1;
1128 Tracev((stderr, "inflate: dictionary set\n"));
1129 return Z_OK;
1130}
1131
1132/*
1133 Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found
1134 or when out of input. When called, *have is the number of pattern bytes
1135 found in order so far, in 0..3. On return *have is updated to the new
1136 state. If on return *have equals four, then the pattern was found and the
1137 return value is how many bytes were read including the last byte of the
1138 pattern. If *have is less than four, then the pattern has not been found
1139 yet and the return value is len. In the latter case, syncsearch() can be
1140 called again with more data and the *have state. *have is initialized to
1141 zero for the first call.
1142 */
1143local unsigned syncsearch (unsigned FAR *have, unsigned char FAR *buf, unsigned len)
1144{
1145 unsigned got;
1146 unsigned next;
1147
1148 got = *have;
1149 next = 0;
1150 while (next < len && got < 4) {
1151 if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
1152 got++;
1153 else if (buf[next])
1154 got = 0;
1155 else
1156 got = 4 - got;
1157 next++;
1158 }
1159 *have = got;
1160 return next;
1161}
1162
1163int ZEXPORT inflateSync (z_streamp strm)
1164{
1165 unsigned len; /* number of bytes to look at or looked at */
1166 unsigned long in, out; /* temporary to save total_in and total_out */
1167 unsigned char buf[4]; /* to restore bit buffer to byte string */
1168 struct inflate_state FAR *state;
1169
1170 /* check parameters */
1171 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
1172 state = (struct inflate_state FAR *)strm->state;
1173 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
1174
1175 /* if first time, start search in bit buffer */
1176 if (state->mode != SYNC) {
1177 state->mode = SYNC;
1178 state->hold <<= state->bits & 7;
1179 state->bits -= state->bits & 7;
1180 len = 0;
1181 while (state->bits >= 8) {
1182 buf[len++] = (unsigned char)(state->hold);
1183 state->hold >>= 8;
1184 state->bits -= 8;
1185 }
1186 state->have = 0;
1187 syncsearch(&(state->have), buf, len);
1188 }
1189
1190 /* search available input */
1191 len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
1192 strm->avail_in -= len;
1193 strm->next_in += len;
1194 strm->total_in += len;
1195
1196 /* return no joy or set up to restart inflate() on a new block */
1197 if (state->have != 4) return Z_DATA_ERROR;
1198 in = strm->total_in; out = strm->total_out;
1199 inflateReset(strm);
1200 strm->total_in = in; strm->total_out = out;
1201 state->mode = TYPE;
1202 return Z_OK;
1203}
1204
1205/*
1206 Returns true if inflate is currently at the end of a block generated by
1207 Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
1208 implementation to provide an additional safety check. PPP uses
1209 Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored
1210 block. When decompressing, PPP checks that at the end of input packet,
1211 inflate is waiting for these length bytes.
1212 */
1213int ZEXPORT inflateSyncPoint (z_streamp strm)
1214{
1215 struct inflate_state FAR *state;
1216
1217 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
1218 state = (struct inflate_state FAR *)strm->state;
1219 return state->mode == STORED && state->bits == 0;
1220}
1221
1222int ZEXPORT inflateCopy (z_streamp dest, z_streamp source)
1223{
1224 struct inflate_state FAR *state;
1225 struct inflate_state FAR *copy;
1226 unsigned char FAR *window;
1227
1228 /* check input */
1229 if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||
1230 source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
1231 return Z_STREAM_ERROR;
1232 state = (struct inflate_state FAR *)source->state;
1233
1234 /* allocate space */
1235 copy = (struct inflate_state FAR *)
1236 ZALLOC(source, 1, sizeof(struct inflate_state));
1237 if (copy == Z_NULL) return Z_MEM_ERROR;
1238 window = Z_NULL;
1239 if (state->window != Z_NULL) {
1240 window = (unsigned char FAR *)
1241 ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
1242 if (window == Z_NULL) {
1243 ZFREE(source, copy);
1244 return Z_MEM_ERROR;
1245 }
1246 }
1247
1248 /* copy state */
1249 *dest = *source;
1250 *copy = *state;
1251 copy->lencode = copy->codes + (state->lencode - state->codes);
1252 copy->distcode = copy->codes + (state->distcode - state->codes);
1253 copy->next = copy->codes + (state->next - state->codes);
1254 if (window != Z_NULL)
1255 zmemcpy(window, state->window, (size_t)(1U << state->wbits));
1256 copy->window = window;
1257 dest->state = (voidpf)copy;
1258 return Z_OK;
1259}
1260#endif /* USE_GZIP && !Z_NO_INFLATE */
1261
code
Definition: zinftree.h:24
inflate_state
Definition: zinflate.h:81
z_stream_s
Definition: zlib.h:84
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/zinflate.h Source File

  • src
zinflate.h
1/* inflate.h -- internal inflate state definition
2 * Copyright (C) 1995-2003 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* WARNING: this file should *not* be used by applications. It is
7 part of the implementation of the compression library and is
8 subject to change. Applications should only use zlib.h.
9 */
10
11/* define NO_GZIP when compiling if you want to disable gzip header and
12 trailer decoding by inflate(). NO_GZIP would be used to avoid linking in
13 the crc code when it is not needed. For shared libraries, gzip decoding
14 should be left enabled. */
15#ifndef NO_GZIP
16# define GUNZIP
17#endif
18
19/* Possible inflate modes between inflate() calls */
20typedef enum {
21 HEAD, /* i: waiting for magic header */
22#ifdef GUNZIP
23 FLAGS, /* i: waiting for method and flags (gzip) */
24 TIME, /* i: waiting for modification time (gzip) */
25 OS, /* i: waiting for extra flags and operating system (gzip) */
26 EXLEN, /* i: waiting for extra length (gzip) */
27 EXTRA, /* i: waiting for extra bytes (gzip) */
28 NAME, /* i: waiting for end of file name (gzip) */
29 COMMENT, /* i: waiting for end of comment (gzip) */
30 HCRC, /* i: waiting for header crc (gzip) */
31#endif
32 DICTID, /* i: waiting for dictionary check value */
33 DICT, /* waiting for inflateSetDictionary() call */
34 TYPE, /* i: waiting for type bits, including last-flag bit */
35 TYPEDO, /* i: same, but skip check to exit inflate on new block */
36 STORED, /* i: waiting for stored size (length and complement) */
37 COPY, /* i/o: waiting for input or output to copy stored block */
38 TABLE, /* i: waiting for dynamic block table lengths */
39 LENLENS, /* i: waiting for code length code lengths */
40 CODELENS, /* i: waiting for length/lit and distance code lengths */
41 LEN, /* i: waiting for length/lit code */
42 LENEXT, /* i: waiting for length extra bits */
43 DIST, /* i: waiting for distance code */
44 DISTEXT, /* i: waiting for distance extra bits */
45 MATCH, /* o: waiting for output space to copy string */
46 LIT, /* o: waiting for output space to write literal */
47 CHECK, /* i: waiting for 32-bit check value */
48#ifdef GUNZIP
49 LENGTH, /* i: waiting for 32-bit length (gzip) */
50#endif
51 DONE, /* finished check, done -- remain here until reset */
52 BAD, /* got a data error -- remain here until reset */
53 MEM, /* got an inflate() memory error -- remain here until reset */
54 SYNC /* looking for synchronization bytes to restart inflate() */
55} inflate_mode;
56
57/*
58 State transitions between above modes -
59
60 (most modes can go to the BAD or MEM mode -- not shown for clarity)
61
62 Process header:
63 HEAD -> (gzip) or (zlib)
64 (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME
65 NAME -> COMMENT -> HCRC -> TYPE
66 (zlib) -> DICTID or TYPE
67 DICTID -> DICT -> TYPE
68 Read deflate blocks:
69 TYPE -> STORED or TABLE or LEN or CHECK
70 STORED -> COPY -> TYPE
71 TABLE -> LENLENS -> CODELENS -> LEN
72 Read deflate codes:
73 LEN -> LENEXT or LIT or TYPE
74 LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
75 LIT -> LEN
76 Process trailer:
77 CHECK -> LENGTH -> DONE
78 */
79
80/* state maintained between inflate() calls. Approximately 7K bytes. */
81struct inflate_state {
82 inflate_mode mode; /* current inflate mode */
83 int last; /* true if processing last block */
84 int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
85 int havedict; /* true if dictionary provided */
86 int flags; /* gzip header method and flags (0 if zlib) */
87 unsigned long check; /* protected copy of check value */
88 unsigned long total; /* protected copy of output count */
89 /* sliding window */
90 unsigned wbits; /* log base 2 of requested window size */
91 unsigned wsize; /* window size or zero if not using window */
92 unsigned whave; /* valid bytes in the window */
93 unsigned write; /* window write index */
94 unsigned char FAR *window; /* allocated sliding window, if needed */
95 /* bit accumulator */
96 unsigned long hold; /* input bit accumulator */
97 unsigned bits; /* number of bits in "in" */
98 /* for string and stored block copying */
99 unsigned length; /* literal or length of data to copy */
100 unsigned offset; /* distance back to copy string from */
101 /* for table and code decoding */
102 unsigned extra; /* extra bits needed */
103 /* fixed and dynamic code tables */
104 code const FAR *lencode; /* starting table for length/literal codes */
105 code const FAR *distcode; /* starting table for distance codes */
106 unsigned lenbits; /* index bits for lencode */
107 unsigned distbits; /* index bits for distcode */
108 /* dynamic table building */
109 unsigned ncode; /* number of code length code lengths */
110 unsigned nlen; /* number of length code lengths */
111 unsigned ndist; /* number of distance code lengths */
112 unsigned have; /* number of code lengths in lens[] */
113 code FAR *next; /* next available space in codes[] */
114 unsigned short lens[320]; /* temporary storage for code lengths */
115 unsigned short work[288]; /* work area for code table building */
116 code codes[ENOUGH]; /* space for code tables */
117};
code
Definition: zinftree.h:24
inflate_state
Definition: zinflate.h:81


Watt-32 tcp/ip: E:/WATT/src/zinftree.c Source File

  • src
zinftree.c
1/* inftrees.c -- generate Huffman trees for efficient decoding
2 * Copyright (C) 1995-2003 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6#include "wattcp.h"
7#include "zutil.h"
8#include "zinftree.h"
9
10#if defined(USE_GZIP) && !defined(Z_NO_INFLATE)
11
12#define MAXBITS 15
13
14const char inflate_copyright[] =
15 " inflate 1.2.1 Copyright 1995-2003 Mark Adler ";
16/*
17 If you use the zlib library in a product, an acknowledgment is welcome
18 in the documentation of your product. If for some reason you cannot
19 include such an acknowledgment, I would appreciate that you keep this
20 copyright string in the executable of your product.
21 */
22
23/*
24 Build a set of tables to decode the provided canonical Huffman code.
25 The code lengths are lens[0..codes-1]. The result starts at *table,
26 whose indices are 0..2^bits-1. work is a writable array of at least
27 lens shorts, which is used as a work area. type is the type of code
28 to be generated, CODES, LENS, or DISTS. On return, zero is success,
29 -1 is an invalid code, and +1 means that ENOUGH isn't enough. table
30 on return points to the next available entry's address. bits is the
31 requested root table index bits, and on return it is the actual root
32 table index bits. It will differ if the request is greater than the
33 longest code or if it is less than the shortest code.
34 */
35int inflate_table (codetype type,
36 unsigned short FAR *lens,
37 unsigned codes,
38 code FAR * FAR *table,
39 unsigned FAR *bits,
40 unsigned short FAR *work)
41{
42 unsigned len; /* a code's length in bits */
43 unsigned sym; /* index of code symbols */
44 unsigned min, max; /* minimum and maximum code lengths */
45 unsigned root; /* number of index bits for root table */
46 unsigned curr; /* number of index bits for current table */
47 unsigned drop; /* code bits to drop for sub-table */
48 int left; /* number of prefix codes available */
49 unsigned used; /* code entries in table used */
50 unsigned huff; /* Huffman code */
51 unsigned incr; /* for incrementing code, index */
52 unsigned fill; /* index for replicating entries */
53 unsigned low; /* low bits for current root entry */
54 unsigned mask; /* mask for low root bits */
55 code this; /* table entry for duplication */
56 code FAR *next; /* next available space in table */
57 const unsigned short FAR *base; /* base value table to use */
58 const unsigned short FAR *extra; /* extra bits table to use */
59 int end; /* use base and extra for symbol > end */
60 unsigned short count[MAXBITS+1]; /* number of codes of each length */
61 unsigned short offs[MAXBITS+1]; /* offsets in table for each length */
62 static const unsigned short lbase[31] = { /* Length codes 257..285 base */
63 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
64 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
65 static const unsigned short lext[31] = { /* Length codes 257..285 extra */
66 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
67 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 76, 66};
68 static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
69 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
70 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
71 8193, 12289, 16385, 24577, 0, 0};
72 static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
73 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
74 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
75 28, 28, 29, 29, 64, 64};
76
77 /*
78 Process a set of code lengths to create a canonical Huffman code. The
79 code lengths are lens[0..codes-1]. Each length corresponds to the
80 symbols 0..codes-1. The Huffman code is generated by first sorting the
81 symbols by length from short to long, and retaining the symbol order
82 for codes with equal lengths. Then the code starts with all zero bits
83 for the first code of the shortest length, and the codes are integer
84 increments for the same length, and zeros are appended as the length
85 increases. For the deflate format, these bits are stored backwards
86 from their more natural integer increment ordering, and so when the
87 decoding tables are built in the large loop below, the integer codes
88 are incremented backwards.
89
90 This routine assumes, but does not check, that all of the entries in
91 lens[] are in the range 0..MAXBITS. The caller must assure this.
92 1..MAXBITS is interpreted as that code length. zero means that that
93 symbol does not occur in this code.
94
95 The codes are sorted by computing a count of codes for each length,
96 creating from that a table of starting indices for each length in the
97 sorted table, and then entering the symbols in order in the sorted
98 table. The sorted table is work[], with that space being provided by
99 the caller.
100
101 The length counts are used for other purposes as well, i.e. finding
102 the minimum and maximum length codes, determining if there are any
103 codes at all, checking for a valid set of lengths, and looking ahead
104 at length counts to determine sub-table sizes when building the
105 decoding tables.
106 */
107
108 /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
109 for (len = 0; len <= MAXBITS; len++)
110 count[len] = 0;
111 for (sym = 0; sym < codes; sym++)
112 count[lens[sym]]++;
113
114 /* bound code lengths, force root to be within code lengths */
115 root = *bits;
116 for (max = MAXBITS; max >= 1; max--)
117 if (count[max] != 0) break;
118 if (root > max) root = max;
119 if (max == 0) return -1; /* no codes! */
120 for (min = 1; min <= MAXBITS; min++)
121 if (count[min] != 0) break;
122 if (root < min) root = min;
123
124 /* check for an over-subscribed or incomplete set of lengths */
125 left = 1;
126 for (len = 1; len <= MAXBITS; len++) {
127 left <<= 1;
128 left -= count[len];
129 if (left < 0) return -1; /* over-subscribed */
130 }
131 if (left > 0 && (type == CODES || (codes - count[0] != 1)))
132 return -1; /* incomplete set */
133
134 /* generate offsets into symbol table for each length for sorting */
135 offs[1] = 0;
136 for (len = 1; len < MAXBITS; len++)
137 offs[len + 1] = offs[len] + count[len];
138
139 /* sort symbols by length, by symbol order within each length */
140 for (sym = 0; sym < codes; sym++)
141 if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
142
143 /*
144 Create and fill in decoding tables. In this loop, the table being
145 filled is at next and has curr index bits. The code being used is huff
146 with length len. That code is converted to an index by dropping drop
147 bits off of the bottom. For codes where len is less than drop + curr,
148 those top drop + curr - len bits are incremented through all values to
149 fill the table with replicated entries.
150
151 root is the number of index bits for the root table. When len exceeds
152 root, sub-tables are created pointed to by the root entry with an index
153 of the low root bits of huff. This is saved in low to check for when a
154 new sub-table should be started. drop is zero when the root table is
155 being filled, and drop is root when sub-tables are being filled.
156
157 When a new sub-table is needed, it is necessary to look ahead in the
158 code lengths to determine what size sub-table is needed. The length
159 counts are used for this, and so count[] is decremented as codes are
160 entered in the tables.
161
162 used keeps track of how many table entries have been allocated from the
163 provided *table space. It is checked when a LENS table is being made
164 against the space in *table, ENOUGH, minus the maximum space needed by
165 the worst case distance code, MAXD. This should never happen, but the
166 sufficiency of ENOUGH has not been proven exhaustively, hence the check.
167 This assumes that when type == LENS, bits == 9.
168
169 sym increments through all symbols, and the loop terminates when
170 all codes of length max, i.e. all codes, have been processed. This
171 routine permits incomplete codes, so another loop after this one fills
172 in the rest of the decoding tables with invalid code markers.
173 */
174
175 /* set up for code type */
176 switch (type) {
177 case CODES:
178 base = extra = work; /* dummy value--not used */
179 end = 19;
180 break;
181 case LENS:
182 base = lbase;
183 base -= 257;
184 extra = lext;
185 extra -= 257;
186 end = 256;
187 break;
188 default: /* DISTS */
189 base = dbase;
190 extra = dext;
191 end = -1;
192 }
193
194 /* initialize state for loop */
195 huff = 0; /* starting code */
196 sym = 0; /* starting code symbol */
197 len = min; /* starting code length */
198 next = *table; /* current table to fill in */
199 curr = root; /* current table index bits */
200 drop = 0; /* current bits to drop from code for index */
201 low = (unsigned)(-1); /* trigger new sub-table when len > root */
202 used = 1U << root; /* use root table entries */
203 mask = used - 1; /* mask for comparing low */
204
205 /* check available table space */
206 if (type == LENS && used >= ENOUGH - MAXD)
207 return 1;
208
209 /* process all codes and make table entries */
210 for (;;) {
211 /* create table entry */
212 this.bits = (unsigned char)(len - drop);
213 if ((int)(work[sym]) < end) {
214 this.op = (unsigned char)0;
215 this.val = work[sym];
216 }
217 else if ((int)(work[sym]) > end) {
218 this.op = (unsigned char)(extra[work[sym]]);
219 this.val = base[work[sym]];
220 }
221 else {
222 this.op = (unsigned char)(32 + 64); /* end of block */
223 this.val = 0;
224 }
225
226 /* replicate for those indices with low len bits equal to huff */
227 incr = 1U << (len - drop);
228 fill = 1U << curr;
229 do {
230 fill -= incr;
231 next[(huff >> drop) + fill] = this;
232 } while (fill != 0);
233
234 /* backwards increment the len-bit code huff */
235 incr = 1U << (len - 1);
236 while (huff & incr)
237 incr >>= 1;
238 if (incr != 0) {
239 huff &= incr - 1;
240 huff += incr;
241 }
242 else
243 huff = 0;
244
245 /* go to next symbol, update count, len */
246 sym++;
247 if (--(count[len]) == 0) {
248 if (len == max) break;
249 len = lens[work[sym]];
250 }
251
252 /* create new sub-table if needed */
253 if (len > root && (huff & mask) != low) {
254 /* if first time, transition to sub-tables */
255 if (drop == 0)
256 drop = root;
257
258 /* increment past last table */
259 next += (size_t) (1U << curr);
260
261 /* determine length of next table */
262 curr = len - drop;
263 left = (int)(1 << curr);
264 while (curr + drop < max) {
265 left -= count[curr + drop];
266 if (left <= 0) break;
267 curr++;
268 left <<= 1;
269 }
270
271 /* check for enough space */
272 used += 1U << curr;
273 if (type == LENS && used >= ENOUGH - MAXD)
274 return 1;
275
276 /* point entry in root table to sub-table */
277 low = huff & mask;
278 (*table)[low].op = (unsigned char)curr;
279 (*table)[low].bits = (unsigned char)root;
280 (*table)[low].val = (unsigned short)(next - *table);
281 }
282 }
283
284 /*
285 Fill in rest of table for incomplete codes. This loop is similar to the
286 loop above in incrementing huff for table indices. It is assumed that
287 len is equal to curr + drop, so there is no loop needed to increment
288 through high index bits. When the current sub-table is filled, the loop
289 drops back to the root table to fill in any remaining entries there.
290 */
291 this.op = (unsigned char)64; /* invalid code marker */
292 this.bits = (unsigned char)(len - drop);
293 this.val = (unsigned short)0;
294 while (huff != 0) {
295 /* when done with sub-table, drop back to root table */
296 if (drop != 0 && (huff & mask) != low) {
297 drop = 0;
298 len = root;
299 next = *table;
300 curr = root;
301 this.bits = (unsigned char)len;
302 }
303
304 /* put invalid code marker in table */
305 next[huff >> drop] = this;
306
307 /* backwards increment the len-bit code huff */
308 incr = 1U << (len - 1);
309 while (huff & incr)
310 incr >>= 1;
311 if (incr != 0) {
312 huff &= incr - 1;
313 huff += incr;
314 }
315 else
316 huff = 0;
317 }
318
319 /* set return parameters */
320 *table += used;
321 *bits = root;
322 return 0;
323}
324#endif /* USE_GZIP && !Z_NO_INFLATE */
325
code
Definition: zinftree.h:24
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/zinftree.h Source File

  • src
zinftree.h
1/* inftrees.h -- header to use inftrees.c
2 * Copyright (C) 1995-2003 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* WARNING: this file should *not* be used by applications. It is
7 part of the implementation of the compression library and is
8 subject to change. Applications should only use zlib.h.
9 */
10
11/* Structure for decoding tables. Each entry provides either the
12 information needed to do the operation requested by the code that
13 indexed that table entry, or it provides a pointer to another
14 table that indexes more bits of the code. op indicates whether
15 the entry is a pointer to another table, a literal, a length or
16 distance, an end-of-block, or an invalid code. For a table
17 pointer, the low four bits of op is the number of index bits of
18 that table. For a length or distance, the low four bits of op
19 is the number of extra bits to get after the code. bits is
20 the number of bits in this code or part of the code to drop off
21 of the bit buffer. val is the actual byte to output in the case
22 of a literal, the base length or distance, or the offset from
23 the current table to the next table. Each entry is four bytes. */
24typedef struct {
25 unsigned char op; /* operation, extra bits, table bits */
26 unsigned char bits; /* bits in this part of the code */
27 unsigned short val; /* offset in table or code value */
28} code;
29
30/* op values as set by inflate_table():
31 00000000 - literal
32 0000tttt - table link, tttt != 0 is the number of table index bits
33 0001eeee - length or distance, eeee is the number of extra bits
34 01100000 - end of block
35 01000000 - invalid code
36 */
37
38/* Maximum size of dynamic tree. The maximum found in a long but non-
39 exhaustive search was 1004 code structures (850 for length/literals
40 and 154 for distances, the latter actually the result of an
41 exhaustive search). The true maximum is not known, but the value
42 below is more than safe. */
43#define ENOUGH 1440
44#define MAXD 154
45
46/* Type of code to build for inftable() */
47typedef enum {
48 CODES,
49 LENS,
50 DISTS
51} codetype;
52
53extern int inflate_table (codetype type, unsigned short FAR *lens,
54 unsigned codes, code FAR * FAR *table,
55 unsigned FAR *bits, unsigned short FAR *work);
code
Definition: zinftree.h:24


Watt-32 tcp/ip: E:/WATT/src/zlib.h Source File

  • src
zlib.h
1/* zlib.h -- interface of the 'zlib' general purpose compression library
2 version 1.2.1, November 17th, 2003
3
4 Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler
5
6 This software is provided 'as-is', without any express or implied
7 warranty. In no event will the authors be held liable for any damages
8 arising from the use of this software.
9
10 Permission is granted to anyone to use this software for any purpose,
11 including commercial applications, and to alter it and redistribute it
12 freely, subject to the following restrictions:
13
14 1. The origin of this software must not be misrepresented; you must not
15 claim that you wrote the original software. If you use this software
16 in a product, an acknowledgment in the product documentation would be
17 appreciated but is not required.
18 2. Altered source versions must be plainly marked as such, and must not be
19 misrepresented as being the original software.
20 3. This notice may not be removed or altered from any source distribution.
21
22 Jean-loup Gailly Mark Adler
23 jloup@gzip.org madler@alumni.caltech.edu
24
25
26 The data format used by the zlib library is described by RFCs (Request for
27 Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
28 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
29*/
30
31#ifndef ZLIB_H
32#define ZLIB_H
33
34#include "zconf.h"
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40#define ZLIB_VERSION "1.2.1"
41#define ZLIB_VERNUM 0x1210
42
43/*
44 The 'zlib' compression library provides in-memory compression and
45 decompression functions, including integrity checks of the uncompressed
46 data. This version of the library supports only one compression method
47 (deflation) but other algorithms will be added later and will have the same
48 stream interface.
49
50 Compression can be done in a single step if the buffers are large
51 enough (for example if an input file is mmap'ed), or can be done by
52 repeated calls of the compression function. In the latter case, the
53 application must provide more input and/or consume the output
54 (providing more output space) before each call.
55
56 The compressed data format used by the in-memory functions is the zlib
57 format, which is a zlib wrapper documented in RFC 1950, wrapped around a
58 deflate stream, which is itself documented in RFC 1951.
59
60 The library also supports reading and writing files in gzip (.gz) format
61 with an interface similar to that of stdio using the functions that start
62 with "gz". The gzip format is different from the zlib format. gzip is a
63 gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
64
65 The zlib format was designed to be compact and fast for use in memory
66 and on communications channels. The gzip format was designed for single-
67 file compression on file systems, has a larger header than zlib to maintain
68 directory information, and uses a different, slower check method than zlib.
69
70 This library does not provide any functions to write gzip files in memory.
71 However such functions could be easily written using zlib's deflate function,
72 the documentation in the gzip RFC, and the examples in gzio.c.
73
74 The library does not install any signal handler. The decoder checks
75 the consistency of the compressed data, so the library should never
76 crash even in case of corrupted input.
77*/
78
79typedef voidpf (*alloc_func) (voidpf opaque, uInt items, uInt size);
80typedef void (*free_func) (voidpf opaque, voidpf address);
81
82struct internal_state;
83
84typedef struct z_stream_s {
85 Bytef *next_in; /* next input byte */
86 uInt avail_in; /* number of bytes available at next_in */
87 uLong total_in; /* total nb of input bytes read so far */
88
89 Bytef *next_out; /* next output byte should be put there */
90 uInt avail_out; /* remaining free space at next_out */
91 uLong total_out; /* total nb of bytes output so far */
92
93 char *msg; /* last error message, NULL if no error */
94 struct internal_state FAR *state; /* not visible by applications */
95
96 alloc_func zalloc; /* used to allocate the internal state */
97 free_func zfree; /* used to free the internal state */
98 voidpf opaque; /* private data object passed to zalloc and zfree */
99
100 int data_type; /* best guess about the data type: ascii or binary */
101 uLong adler; /* adler32 value of the uncompressed data */
102 uLong reserved; /* reserved for future use */
103} z_stream;
104
105typedef z_stream FAR *z_streamp;
106
107/*
108 The application must update next_in and avail_in when avail_in has
109 dropped to zero. It must update next_out and avail_out when avail_out
110 has dropped to zero. The application must initialize zalloc, zfree and
111 opaque before calling the init function. All other fields are set by the
112 compression library and must not be updated by the application.
113
114 The opaque value provided by the application will be passed as the first
115 parameter for calls of zalloc and zfree. This can be useful for custom
116 memory management. The compression library attaches no meaning to the
117 opaque value.
118
119 zalloc must return Z_NULL if there is not enough memory for the object.
120 If zlib is used in a multi-threaded application, zalloc and zfree must be
121 thread safe.
122
123 On 16-bit systems, the functions zalloc and zfree must be able to allocate
124 exactly 65536 bytes, but will not be required to allocate more than this
125 if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
126 pointers returned by zalloc for objects of exactly 65536 bytes *must*
127 have their offset normalized to zero. The default allocation function
128 provided by this library ensures this (see zutil.c). To reduce memory
129 requirements and avoid any allocation of 64K objects, at the expense of
130 compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
131
132 The fields total_in and total_out can be used for statistics or
133 progress reports. After compression, total_in holds the total size of
134 the uncompressed data and may be saved for use in the decompressor
135 (particularly if the decompressor wants to decompress everything in
136 a single step).
137*/
138
139 /* constants */
140
141#define Z_NO_FLUSH 0
142#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
143#define Z_SYNC_FLUSH 2
144#define Z_FULL_FLUSH 3
145#define Z_FINISH 4
146#define Z_BLOCK 5
147/* Allowed flush values; see deflate() and inflate() below for details */
148
149#define Z_OK 0
150#define Z_STREAM_END 1
151#define Z_NEED_DICT 2
152#define Z_ERRNO (-1)
153#define Z_STREAM_ERROR (-2)
154#define Z_DATA_ERROR (-3)
155#define Z_MEM_ERROR (-4)
156#define Z_BUF_ERROR (-5)
157#define Z_VERSION_ERROR (-6)
158/* Return codes for the compression/decompression functions. Negative
159 * values are errors, positive values are used for special but normal events.
160 */
161
162#define Z_NO_COMPRESSION 0
163#define Z_BEST_SPEED 1
164#define Z_BEST_COMPRESSION 9
165#define Z_DEFAULT_COMPRESSION (-1)
166/* compression levels */
167
168#define Z_FILTERED 1
169#define Z_HUFFMAN_ONLY 2
170#define Z_RLE 3
171#define Z_DEFAULT_STRATEGY 0
172/* compression strategy; see deflateInit2() below for details */
173
174#define Z_BINARY 0
175#define Z_ASCII 1
176#define Z_UNKNOWN 2
177/* Possible values of the data_type field (though see inflate()) */
178
179#define Z_DEFLATED 8
180/* The deflate compression method (the only one supported in this version) */
181
182#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
183
184#define zlib_version zlibVersion()
185/* for compatibility with versions < 1.0.2 */
186
187 /* basic functions */
188
189ZEXTERN const char * ZEXPORT zlibVersion (void);
190/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
191 If the first character differs, the library code actually used is
192 not compatible with the zlib.h header file used by the application.
193 This check is automatically made by deflateInit and inflateInit.
194 */
195
196/*
197ZEXTERN int ZEXPORT deflateInit (z_streamp strm, int level);
198
199 Initializes the internal stream state for compression. The fields
200 zalloc, zfree and opaque must be initialized before by the caller.
201 If zalloc and zfree are set to Z_NULL, deflateInit updates them to
202 use default allocation functions.
203
204 The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
205 1 gives best speed, 9 gives best compression, 0 gives no compression at
206 all (the input data is simply copied a block at a time).
207 Z_DEFAULT_COMPRESSION requests a default compromise between speed and
208 compression (currently equivalent to level 6).
209
210 deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
211 enough memory, Z_STREAM_ERROR if level is not a valid compression level,
212 Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
213 with the version assumed by the caller (ZLIB_VERSION).
214 msg is set to null if there is no error message. deflateInit does not
215 perform any compression: this will be done by deflate().
216*/
217
218
219ZEXTERN int ZEXPORT deflate (z_streamp strm, int flush);
220/*
221 deflate compresses as much data as possible, and stops when the input
222 buffer becomes empty or the output buffer becomes full. It may introduce some
223 output latency (reading input without producing any output) except when
224 forced to flush.
225
226 The detailed semantics are as follows. deflate performs one or both of the
227 following actions:
228
229 - Compress more input starting at next_in and update next_in and avail_in
230 accordingly. If not all input can be processed (because there is not
231 enough room in the output buffer), next_in and avail_in are updated and
232 processing will resume at this point for the next call of deflate().
233
234 - Provide more output starting at next_out and update next_out and avail_out
235 accordingly. This action is forced if the parameter flush is non zero.
236 Forcing flush frequently degrades the compression ratio, so this parameter
237 should be set only when necessary (in interactive applications).
238 Some output may be provided even if flush is not set.
239
240 Before the call of deflate(), the application should ensure that at least
241 one of the actions is possible, by providing more input and/or consuming
242 more output, and updating avail_in or avail_out accordingly; avail_out
243 should never be zero before the call. The application can consume the
244 compressed output when it wants, for example when the output buffer is full
245 (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
246 and with zero avail_out, it must be called again after making room in the
247 output buffer because there might be more output pending.
248
249 If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
250 flushed to the output buffer and the output is aligned on a byte boundary, so
251 that the decompressor can get all input data available so far. (In particular
252 avail_in is zero after the call if enough output space has been provided
253 before the call.) Flushing may degrade compression for some compression
254 algorithms and so it should be used only when necessary.
255
256 If flush is set to Z_FULL_FLUSH, all output is flushed as with
257 Z_SYNC_FLUSH, and the compression state is reset so that decompression can
258 restart from this point if previous compressed data has been damaged or if
259 random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
260 the compression.
261
262 If deflate returns with avail_out == 0, this function must be called again
263 with the same value of the flush parameter and more output space (updated
264 avail_out), until the flush is complete (deflate returns with non-zero
265 avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
266 avail_out is greater than six to avoid repeated flush markers due to
267 avail_out == 0 on return.
268
269 If the parameter flush is set to Z_FINISH, pending input is processed,
270 pending output is flushed and deflate returns with Z_STREAM_END if there
271 was enough output space; if deflate returns with Z_OK, this function must be
272 called again with Z_FINISH and more output space (updated avail_out) but no
273 more input data, until it returns with Z_STREAM_END or an error. After
274 deflate has returned Z_STREAM_END, the only possible operations on the
275 stream are deflateReset or deflateEnd.
276
277 Z_FINISH can be used immediately after deflateInit if all the compression
278 is to be done in a single step. In this case, avail_out must be at least
279 the value returned by deflateBound (see below). If deflate does not return
280 Z_STREAM_END, then it must be called again as described above.
281
282 deflate() sets strm->adler to the adler32 checksum of all input read
283 so far (that is, total_in bytes).
284
285 deflate() may update data_type if it can make a good guess about
286 the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
287 binary. This field is only for information purposes and does not affect
288 the compression algorithm in any manner.
289
290 deflate() returns Z_OK if some progress has been made (more input
291 processed or more output produced), Z_STREAM_END if all input has been
292 consumed and all output has been produced (only when flush is set to
293 Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
294 if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
295 (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
296 fatal, and deflate() can be called again with more input and more output
297 space to continue compressing.
298*/
299
300
301ZEXTERN int ZEXPORT deflateEnd (z_streamp strm);
302/*
303 All dynamically allocated data structures for this stream are freed.
304 This function discards any unprocessed input and does not flush any
305 pending output.
306
307 deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
308 stream state was inconsistent, Z_DATA_ERROR if the stream was freed
309 prematurely (some input or output was discarded). In the error case,
310 msg may be set but then points to a static string (which must not be
311 deallocated).
312*/
313
314
315/*
316ZEXTERN int ZEXPORT inflateInit (z_streamp strm);
317
318 Initializes the internal stream state for decompression. The fields
319 next_in, avail_in, zalloc, zfree and opaque must be initialized before by
320 the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
321 value depends on the compression method), inflateInit determines the
322 compression method from the zlib header and allocates all data structures
323 accordingly; otherwise the allocation will be deferred to the first call of
324 inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
325 use default allocation functions.
326
327 inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
328 memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
329 version assumed by the caller. msg is set to null if there is no error
330 message. inflateInit does not perform any decompression apart from reading
331 the zlib header if present: this will be done by inflate(). (So next_in and
332 avail_in may be modified, but next_out and avail_out are unchanged.)
333*/
334
335
336ZEXTERN int ZEXPORT inflate (z_streamp strm, int flush);
337/*
338 inflate decompresses as much data as possible, and stops when the input
339 buffer becomes empty or the output buffer becomes full. It may introduce
340 some output latency (reading input without producing any output) except when
341 forced to flush.
342
343 The detailed semantics are as follows. inflate performs one or both of the
344 following actions:
345
346 - Decompress more input starting at next_in and update next_in and avail_in
347 accordingly. If not all input can be processed (because there is not
348 enough room in the output buffer), next_in is updated and processing
349 will resume at this point for the next call of inflate().
350
351 - Provide more output starting at next_out and update next_out and avail_out
352 accordingly. inflate() provides as much output as possible, until there
353 is no more input data or no more space in the output buffer (see below
354 about the flush parameter).
355
356 Before the call of inflate(), the application should ensure that at least
357 one of the actions is possible, by providing more input and/or consuming
358 more output, and updating the next_* and avail_* values accordingly.
359 The application can consume the uncompressed output when it wants, for
360 example when the output buffer is full (avail_out == 0), or after each
361 call of inflate(). If inflate returns Z_OK and with zero avail_out, it
362 must be called again after making room in the output buffer because there
363 might be more output pending.
364
365 The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
366 Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
367 output as possible to the output buffer. Z_BLOCK requests that inflate() stop
368 if and when it get to the next deflate block boundary. When decoding the zlib
369 or gzip format, this will cause inflate() to return immediately after the
370 header and before the first block. When doing a raw inflate, inflate() will
371 go ahead and process the first block, and will return when it gets to the end
372 of that block, or when it runs out of data.
373
374 The Z_BLOCK option assists in appending to or combining deflate streams.
375 Also to assist in this, on return inflate() will set strm->data_type to the
376 number of unused bits in the last byte taken from strm->next_in, plus 64
377 if inflate() is currently decoding the last block in the deflate stream,
378 plus 128 if inflate() returned immediately after decoding an end-of-block
379 code or decoding the complete header up to just before the first byte of the
380 deflate stream. The end-of-block will not be indicated until all of the
381 uncompressed data from that block has been written to strm->next_out. The
382 number of unused bits may in general be greater than seven, except when
383 bit 7 of data_type is set, in which case the number of unused bits will be
384 less than eight.
385
386 inflate() should normally be called until it returns Z_STREAM_END or an
387 error. However if all decompression is to be performed in a single step
388 (a single call of inflate), the parameter flush should be set to
389 Z_FINISH. In this case all pending input is processed and all pending
390 output is flushed; avail_out must be large enough to hold all the
391 uncompressed data. (The size of the uncompressed data may have been saved
392 by the compressor for this purpose.) The next operation on this stream must
393 be inflateEnd to deallocate the decompression state. The use of Z_FINISH
394 is never required, but can be used to inform inflate that a faster approach
395 may be used for the single inflate() call.
396
397 In this implementation, inflate() always flushes as much output as
398 possible to the output buffer, and always uses the faster approach on the
399 first call. So the only effect of the flush parameter in this implementation
400 is on the return value of inflate(), as noted below, or when it returns early
401 because Z_BLOCK is used.
402
403 If a preset dictionary is needed after this call (see inflateSetDictionary
404 below), inflate sets strm-adler to the adler32 checksum of the dictionary
405 chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
406 strm->adler to the adler32 checksum of all output produced so far (that is,
407 total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
408 below. At the end of the stream, inflate() checks that its computed adler32
409 checksum is equal to that saved by the compressor and returns Z_STREAM_END
410 only if the checksum is correct.
411
412 inflate() will decompress and check either zlib-wrapped or gzip-wrapped
413 deflate data. The header type is detected automatically. Any information
414 contained in the gzip header is not retained, so applications that need that
415 information should instead use raw inflate, see inflateInit2() below, or
416 inflateBack() and perform their own processing of the gzip header and
417 trailer.
418
419 inflate() returns Z_OK if some progress has been made (more input processed
420 or more output produced), Z_STREAM_END if the end of the compressed data has
421 been reached and all uncompressed output has been produced, Z_NEED_DICT if a
422 preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
423 corrupted (input stream not conforming to the zlib format or incorrect check
424 value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
425 if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
426 Z_BUF_ERROR if no progress is possible or if there was not enough room in the
427 output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
428 inflate() can be called again with more input and more output space to
429 continue decompressing. If Z_DATA_ERROR is returned, the application may then
430 call inflateSync() to look for a good compression block if a partial recovery
431 of the data is desired.
432*/
433
434
435ZEXTERN int ZEXPORT inflateEnd (z_streamp strm);
436/*
437 All dynamically allocated data structures for this stream are freed.
438 This function discards any unprocessed input and does not flush any
439 pending output.
440
441 inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
442 was inconsistent. In the error case, msg may be set but then points to a
443 static string (which must not be deallocated).
444*/
445
446 /* Advanced functions */
447
448/*
449 The following functions are needed only in some special applications.
450*/
451
452/*
453ZEXTERN int ZEXPORT deflateInit2 (z_streamp strm,
454 int level,
455 int method,
456 int windowBits,
457 int memLevel,
458 int strategy);
459
460 This is another version of deflateInit with more compression options. The
461 fields next_in, zalloc, zfree and opaque must be initialized before by
462 the caller.
463
464 The method parameter is the compression method. It must be Z_DEFLATED in
465 this version of the library.
466
467 The windowBits parameter is the base two logarithm of the window size
468 (the size of the history buffer). It should be in the range 8..15 for this
469 version of the library. Larger values of this parameter result in better
470 compression at the expense of memory usage. The default value is 15 if
471 deflateInit is used instead.
472
473 windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
474 determines the window size. deflate() will then generate raw deflate data
475 with no zlib header or trailer, and will not compute an adler32 check value.
476
477 windowBits can also be greater than 15 for optional gzip encoding. Add
478 16 to windowBits to write a simple gzip header and trailer around the
479 compressed data instead of a zlib wrapper. The gzip header will have no
480 file name, no extra data, no comment, no modification time (set to zero),
481 no header crc, and the operating system will be set to 255 (unknown).
482
483 The memLevel parameter specifies how much memory should be allocated
484 for the internal compression state. memLevel=1 uses minimum memory but
485 is slow and reduces compression ratio; memLevel=9 uses maximum memory
486 for optimal speed. The default value is 8. See zconf.h for total memory
487 usage as a function of windowBits and memLevel.
488
489 The strategy parameter is used to tune the compression algorithm. Use the
490 value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
491 filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
492 string match), or Z_RLE to limit match distances to one (run-length
493 encoding). Filtered data consists mostly of small values with a somewhat
494 random distribution. In this case, the compression algorithm is tuned to
495 compress them better. The effect of Z_FILTERED is to force more Huffman
496 coding and less string matching; it is somewhat intermediate between
497 Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
498 Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
499 parameter only affects the compression ratio but not the correctness of the
500 compressed output even if it is not set appropriately.
501
502 deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
503 memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
504 method). msg is set to null if there is no error message. deflateInit2 does
505 not perform any compression: this will be done by deflate().
506*/
507
508ZEXTERN int ZEXPORT deflateSetDictionary (z_streamp strm,
509 const Bytef *dictionary,
510 uInt dictLength);
511/*
512 Initializes the compression dictionary from the given byte sequence
513 without producing any compressed output. This function must be called
514 immediately after deflateInit, deflateInit2 or deflateReset, before any
515 call of deflate. The compressor and decompressor must use exactly the same
516 dictionary (see inflateSetDictionary).
517
518 The dictionary should consist of strings (byte sequences) that are likely
519 to be encountered later in the data to be compressed, with the most commonly
520 used strings preferably put towards the end of the dictionary. Using a
521 dictionary is most useful when the data to be compressed is short and can be
522 predicted with good accuracy; the data can then be compressed better than
523 with the default empty dictionary.
524
525 Depending on the size of the compression data structures selected by
526 deflateInit or deflateInit2, a part of the dictionary may in effect be
527 discarded, for example if the dictionary is larger than the window size in
528 deflate or deflate2. Thus the strings most likely to be useful should be
529 put at the end of the dictionary, not at the front.
530
531 Upon return of this function, strm->adler is set to the adler32 value
532 of the dictionary; the decompressor may later use this value to determine
533 which dictionary has been used by the compressor. (The adler32 value
534 applies to the whole dictionary even if only a subset of the dictionary is
535 actually used by the compressor.) If a raw deflate was requested, then the
536 adler32 value is not computed and strm->adler is not set.
537
538 deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
539 parameter is invalid (such as NULL dictionary) or the stream state is
540 inconsistent (for example if deflate has already been called for this stream
541 or if the compression method is bsort). deflateSetDictionary does not
542 perform any compression: this will be done by deflate().
543*/
544
545ZEXTERN int ZEXPORT deflateCopy (z_streamp dest,
546 z_streamp source);
547/*
548 Sets the destination stream as a complete copy of the source stream.
549
550 This function can be useful when several compression strategies will be
551 tried, for example when there are several ways of pre-processing the input
552 data with a filter. The streams that will be discarded should then be freed
553 by calling deflateEnd. Note that deflateCopy duplicates the internal
554 compression state which can be quite large, so this strategy is slow and
555 can consume lots of memory.
556
557 deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
558 enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
559 (such as zalloc being NULL). msg is left unchanged in both source and
560 destination.
561*/
562
563ZEXTERN int ZEXPORT deflateReset (z_streamp strm);
564/*
565 This function is equivalent to deflateEnd followed by deflateInit,
566 but does not free and reallocate all the internal compression state.
567 The stream will keep the same compression level and any other attributes
568 that may have been set by deflateInit2.
569
570 deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
571 stream state was inconsistent (such as zalloc or state being NULL).
572*/
573
574ZEXTERN int ZEXPORT deflateParams (z_streamp strm,
575 int level,
576 int strategy);
577/*
578 Dynamically update the compression level and compression strategy. The
579 interpretation of level and strategy is as in deflateInit2. This can be
580 used to switch between compression and straight copy of the input data, or
581 to switch to a different kind of input data requiring a different
582 strategy. If the compression level is changed, the input available so far
583 is compressed with the old level (and may be flushed); the new level will
584 take effect only at the next call of deflate().
585
586 Before the call of deflateParams, the stream state must be set as for
587 a call of deflate(), since the currently available input may have to
588 be compressed and flushed. In particular, strm->avail_out must be non-zero.
589
590 deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
591 stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
592 if strm->avail_out was zero.
593*/
594
595ZEXTERN uLong ZEXPORT deflateBound (z_streamp strm,
596 uLong sourceLen);
597/*
598 deflateBound() returns an upper bound on the compressed size after
599 deflation of sourceLen bytes. It must be called after deflateInit()
600 or deflateInit2(). This would be used to allocate an output buffer
601 for deflation in a single pass, and so would be called before deflate().
602*/
603
604ZEXTERN int ZEXPORT deflatePrime (z_streamp strm,
605 int bits,
606 int value);
607/*
608 deflatePrime() inserts bits in the deflate output stream. The intent
609 is that this function is used to start off the deflate output with the
610 bits leftover from a previous deflate stream when appending to it. As such,
611 this function can only be used for raw deflate, and must be used before the
612 first deflate() call after a deflateInit2() or deflateReset(). bits must be
613 less than or equal to 16, and that many of the least significant bits of
614 value will be inserted in the output.
615
616 deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
617 stream state was inconsistent.
618*/
619
620/*
621ZEXTERN int ZEXPORT inflateInit2 (z_streamp strm,
622 int windowBits);
623
624 This is another version of inflateInit with an extra parameter. The
625 fields next_in, avail_in, zalloc, zfree and opaque must be initialized
626 before by the caller.
627
628 The windowBits parameter is the base two logarithm of the maximum window
629 size (the size of the history buffer). It should be in the range 8..15 for
630 this version of the library. The default value is 15 if inflateInit is used
631 instead. windowBits must be greater than or equal to the windowBits value
632 provided to deflateInit2() while compressing, or it must be equal to 15 if
633 deflateInit2() was not used. If a compressed stream with a larger window
634 size is given as input, inflate() will return with the error code
635 Z_DATA_ERROR instead of trying to allocate a larger window.
636
637 windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
638 determines the window size. inflate() will then process raw deflate data,
639 not looking for a zlib or gzip header, not generating a check value, and not
640 looking for any check values for comparison at the end of the stream. This
641 is for use with other formats that use the deflate compressed data format
642 such as zip. Those formats provide their own check values. If a custom
643 format is developed using the raw deflate format for compressed data, it is
644 recommended that a check value such as an adler32 or a crc32 be applied to
645 the uncompressed data as is done in the zlib, gzip, and zip formats. For
646 most applications, the zlib format should be used as is. Note that comments
647 above on the use in deflateInit2() applies to the magnitude of windowBits.
648
649 windowBits can also be greater than 15 for optional gzip decoding. Add
650 32 to windowBits to enable zlib and gzip decoding with automatic header
651 detection, or add 16 to decode only the gzip format (the zlib format will
652 return a Z_DATA_ERROR).
653
654 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
655 memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
656 memLevel). msg is set to null if there is no error message. inflateInit2
657 does not perform any decompression apart from reading the zlib header if
658 present: this will be done by inflate(). (So next_in and avail_in may be
659 modified, but next_out and avail_out are unchanged.)
660*/
661
662ZEXTERN int ZEXPORT inflateSetDictionary (z_streamp strm,
663 const Bytef *dictionary,
664 uInt dictLength);
665/*
666 Initializes the decompression dictionary from the given uncompressed byte
667 sequence. This function must be called immediately after a call of inflate
668 if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
669 can be determined from the adler32 value returned by this call of
670 inflate. The compressor and decompressor must use exactly the same
671 dictionary (see deflateSetDictionary).
672
673 inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
674 parameter is invalid (such as NULL dictionary) or the stream state is
675 inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
676 expected one (incorrect adler32 value). inflateSetDictionary does not
677 perform any decompression: this will be done by subsequent calls of
678 inflate().
679*/
680
681ZEXTERN int ZEXPORT inflateSync (z_streamp strm);
682/*
683 Skips invalid compressed data until a full flush point (see above the
684 description of deflate with Z_FULL_FLUSH) can be found, or until all
685 available input is skipped. No output is provided.
686
687 inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
688 if no more input was provided, Z_DATA_ERROR if no flush point has been found,
689 or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
690 case, the application may save the current current value of total_in which
691 indicates where valid compressed data was found. In the error case, the
692 application may repeatedly call inflateSync, providing more input each time,
693 until success or end of the input data.
694*/
695
696ZEXTERN int ZEXPORT inflateCopy (z_streamp dest,
697 z_streamp source);
698/*
699 Sets the destination stream as a complete copy of the source stream.
700
701 This function can be useful when randomly accessing a large stream. The
702 first pass through the stream can periodically record the inflate state,
703 allowing restarting inflate at those points when randomly accessing the
704 stream.
705
706 inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
707 enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
708 (such as zalloc being NULL). msg is left unchanged in both source and
709 destination.
710*/
711
712ZEXTERN int ZEXPORT inflateReset (z_streamp strm);
713/*
714 This function is equivalent to inflateEnd followed by inflateInit,
715 but does not free and reallocate all the internal decompression state.
716 The stream will keep attributes that may have been set by inflateInit2.
717
718 inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
719 stream state was inconsistent (such as zalloc or state being NULL).
720*/
721
722/*
723ZEXTERN int ZEXPORT inflateBackInit (z_stream FAR *strm, int windowBits,
724 unsigned char FAR *window);
725
726 Initialize the internal stream state for decompression using inflateBack()
727 calls. The fields zalloc, zfree and opaque in strm must be initialized
728 before the call. If zalloc and zfree are Z_NULL, then the default library-
729 derived memory allocation routines are used. windowBits is the base two
730 logarithm of the window size, in the range 8..15. window is a caller
731 supplied buffer of that size. Except for special applications where it is
732 assured that deflate was used with small window sizes, windowBits must be 15
733 and a 32K byte window must be supplied to be able to decompress general
734 deflate streams.
735
736 See inflateBack() for the usage of these routines.
737
738 inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
739 the paramaters are invalid, Z_MEM_ERROR if the internal state could not
740 be allocated, or Z_VERSION_ERROR if the version of the library does not
741 match the version of the header file.
742*/
743
744typedef unsigned (*in_func) (void FAR *, unsigned char FAR * FAR *);
745typedef int (*out_func) (void FAR *, unsigned char FAR *, unsigned);
746
747ZEXTERN int ZEXPORT inflateBack (z_stream FAR *strm,
748 in_func in, void FAR *in_desc,
749 out_func out, void FAR *out_desc);
750/*
751 inflateBack() does a raw inflate with a single call using a call-back
752 interface for input and output. This is more efficient than inflate() for
753 file i/o applications in that it avoids copying between the output and the
754 sliding window by simply making the window itself the output buffer. This
755 function trusts the application to not change the output buffer passed by
756 the output function, at least until inflateBack() returns.
757
758 inflateBackInit() must be called first to allocate the internal state
759 and to initialize the state with the user-provided window buffer.
760 inflateBack() may then be used multiple times to inflate a complete, raw
761 deflate stream with each call. inflateBackEnd() is then called to free
762 the allocated state.
763
764 A raw deflate stream is one with no zlib or gzip header or trailer.
765 This routine would normally be used in a utility that reads zip or gzip
766 files and writes out uncompressed files. The utility would decode the
767 header and process the trailer on its own, hence this routine expects
768 only the raw deflate stream to decompress. This is different from the
769 normal behavior of inflate(), which expects either a zlib or gzip header and
770 trailer around the deflate stream.
771
772 inflateBack() uses two subroutines supplied by the caller that are then
773 called by inflateBack() for input and output. inflateBack() calls those
774 routines until it reads a complete deflate stream and writes out all of the
775 uncompressed data, or until it encounters an error. The function's
776 parameters and return types are defined above in the in_func and out_func
777 typedefs. inflateBack() will call in(in_desc, &buf) which should return the
778 number of bytes of provided input, and a pointer to that input in buf. If
779 there is no input available, in() must return zero--buf is ignored in that
780 case--and inflateBack() will return a buffer error. inflateBack() will call
781 out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
782 should return zero on success, or non-zero on failure. If out() returns
783 non-zero, inflateBack() will return with an error. Neither in() nor out()
784 are permitted to change the contents of the window provided to
785 inflateBackInit(), which is also the buffer that out() uses to write from.
786 The length written by out() will be at most the window size. Any non-zero
787 amount of input may be provided by in().
788
789 For convenience, inflateBack() can be provided input on the first call by
790 setting strm->next_in and strm->avail_in. If that input is exhausted, then
791 in() will be called. Therefore strm->next_in must be initialized before
792 calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
793 immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
794 must also be initialized, and then if strm->avail_in is not zero, input will
795 initially be taken from strm->next_in[0 .. strm->avail_in - 1].
796
797 The in_desc and out_desc parameters of inflateBack() is passed as the
798 first parameter of in() and out() respectively when they are called. These
799 descriptors can be optionally used to pass any information that the caller-
800 supplied in() and out() functions need to do their job.
801
802 On return, inflateBack() will set strm->next_in and strm->avail_in to
803 pass back any unused input that was provided by the last in() call. The
804 return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
805 if in() or out() returned an error, Z_DATA_ERROR if there was a format
806 error in the deflate stream (in which case strm->msg is set to indicate the
807 nature of the error), or Z_STREAM_ERROR if the stream was not properly
808 initialized. In the case of Z_BUF_ERROR, an input or output error can be
809 distinguished using strm->next_in which will be Z_NULL only if in() returned
810 an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
811 out() returning non-zero. (in() will always be called before out(), so
812 strm->next_in is assured to be defined if out() returns non-zero.) Note
813 that inflateBack() cannot return Z_OK.
814*/
815
816ZEXTERN int ZEXPORT inflateBackEnd (z_stream FAR *strm);
817/*
818 All memory allocated by inflateBackInit() is freed.
819
820 inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
821 state was inconsistent.
822*/
823
824ZEXTERN uLong ZEXPORT zlibCompileFlags (void);
825/* Return flags indicating compile-time options.
826
827 Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
828 1.0: size of uInt
829 3.2: size of uLong
830 5.4: size of voidpf (pointer)
831 7.6: size of z_off_t
832
833 Compiler, assembler, and debug options:
834 8: DEBUG
835 9: ASMV or ASMINF -- use ASM code
836 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
837 11: 0 (reserved)
838
839 One-time table building (smaller code, but not thread-safe if true):
840 12: BUILDFIXED -- build static block decoding tables when needed
841 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
842 14,15: 0 (reserved)
843
844 Library content (indicates missing functionality):
845 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
846 deflate code when not needed)
847 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
848 and decode gzip streams (to avoid linking crc code)
849 18-19: 0 (reserved)
850
851 Operation variations (changes in library functionality):
852 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
853 21: FASTEST -- deflate algorithm with only one, lowest compression level
854 22,23: 0 (reserved)
855
856 The sprintf variant used by gzprintf (zero is best):
857 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
858 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
859 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
860
861 Remainder:
862 27-31: 0 (reserved)
863 */
864
865
866 /* utility functions */
867
868/*
869 The following utility functions are implemented on top of the
870 basic stream-oriented functions. To simplify the interface, some
871 default options are assumed (compression level and memory usage,
872 standard memory allocation functions). The source code of these
873 utility functions can easily be modified if you need special options.
874*/
875
876ZEXTERN int ZEXPORT compress (Bytef *dest, uLongf *destLen,
877 const Bytef *source, uLong sourceLen);
878/*
879 Compresses the source buffer into the destination buffer. sourceLen is
880 the byte length of the source buffer. Upon entry, destLen is the total
881 size of the destination buffer, which must be at least the value returned
882 by compressBound(sourceLen). Upon exit, destLen is the actual size of the
883 compressed buffer.
884 This function can be used to compress a whole file at once if the
885 input file is mmap'ed.
886 compress returns Z_OK if success, Z_MEM_ERROR if there was not
887 enough memory, Z_BUF_ERROR if there was not enough room in the output
888 buffer.
889*/
890
891ZEXTERN int ZEXPORT compress2 (Bytef *dest, uLongf *destLen,
892 const Bytef *source, uLong sourceLen,
893 int level);
894/*
895 Compresses the source buffer into the destination buffer. The level
896 parameter has the same meaning as in deflateInit. sourceLen is the byte
897 length of the source buffer. Upon entry, destLen is the total size of the
898 destination buffer, which must be at least the value returned by
899 compressBound(sourceLen). Upon exit, destLen is the actual size of the
900 compressed buffer.
901
902 compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
903 memory, Z_BUF_ERROR if there was not enough room in the output buffer,
904 Z_STREAM_ERROR if the level parameter is invalid.
905*/
906
907ZEXTERN uLong ZEXPORT compressBound (uLong sourceLen);
908/*
909 compressBound() returns an upper bound on the compressed size after
910 compress() or compress2() on sourceLen bytes. It would be used before
911 a compress() or compress2() call to allocate the destination buffer.
912*/
913
914ZEXTERN int ZEXPORT uncompress (Bytef *dest, uLongf *destLen,
915 const Bytef *source, uLong sourceLen);
916/*
917 Decompresses the source buffer into the destination buffer. sourceLen is
918 the byte length of the source buffer. Upon entry, destLen is the total
919 size of the destination buffer, which must be large enough to hold the
920 entire uncompressed data. (The size of the uncompressed data must have
921 been saved previously by the compressor and transmitted to the decompressor
922 by some mechanism outside the scope of this compression library.)
923 Upon exit, destLen is the actual size of the compressed buffer.
924 This function can be used to decompress a whole file at once if the
925 input file is mmap'ed.
926
927 uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
928 enough memory, Z_BUF_ERROR if there was not enough room in the output
929 buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
930*/
931
932
933typedef voidp gzFile;
934
935ZEXTERN gzFile ZEXPORT gzopen (const char *path, const char *mode);
936/*
937 Opens a gzip (.gz) file for reading or writing. The mode parameter
938 is as in fopen ("rb" or "wb") but can also include a compression level
939 ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
940 Huffman only compression as in "wb1h", or 'R' for run-length encoding
941 as in "wb1R". (See the description of deflateInit2 for more information
942 about the strategy parameter.)
943
944 gzopen can be used to read a file which is not in gzip format; in this
945 case gzread will directly read from the file without decompression.
946
947 gzopen returns NULL if the file could not be opened or if there was
948 insufficient memory to allocate the (de)compression state; errno
949 can be checked to distinguish the two cases (if errno is zero, the
950 zlib error is Z_MEM_ERROR). */
951
952ZEXTERN gzFile ZEXPORT gzdopen (int fd, const char *mode);
953/*
954 gzdopen() associates a gzFile with the file descriptor fd. File
955 descriptors are obtained from calls like open, dup, creat, pipe or
956 fileno (in the file has been previously opened with fopen).
957 The mode parameter is as in gzopen.
958 The next call of gzclose on the returned gzFile will also close the
959 file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
960 descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
961 gzdopen returns NULL if there was insufficient memory to allocate
962 the (de)compression state.
963*/
964
965ZEXTERN int ZEXPORT gzsetparams (gzFile file, int level, int strategy);
966/*
967 Dynamically update the compression level or strategy. See the description
968 of deflateInit2 for the meaning of these parameters.
969 gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
970 opened for writing.
971*/
972
973ZEXTERN int ZEXPORT gzread (gzFile file, voidp buf, unsigned len);
974/*
975 Reads the given number of uncompressed bytes from the compressed file.
976 If the input file was not in gzip format, gzread copies the given number
977 of bytes into the buffer.
978 gzread returns the number of uncompressed bytes actually read (0 for
979 end of file, -1 for error). */
980
981ZEXTERN int ZEXPORT gzwrite (gzFile file,
982 voidpc buf, unsigned len);
983/*
984 Writes the given number of uncompressed bytes into the compressed file.
985 gzwrite returns the number of uncompressed bytes actually written
986 (0 in case of error).
987*/
988
989ZEXTERN int ZEXPORTVA gzprintf (gzFile file, const char *format, ...);
990/*
991 Converts, formats, and writes the args to the compressed file under
992 control of the format string, as in fprintf. gzprintf returns the number of
993 uncompressed bytes actually written (0 in case of error). The number of
994 uncompressed bytes written is limited to 4095. The caller should assure that
995 this limit is not exceeded. If it is exceeded, then gzprintf() will return
996 return an error (0) with nothing written. In this case, there may also be a
997 buffer overflow with unpredictable consequences, which is possible only if
998 zlib was compiled with the insecure functions sprintf() or vsprintf()
999 because the secure snprintf() or vsnprintf() functions were not available.
1000*/
1001
1002ZEXTERN int ZEXPORT gzputs (gzFile file, const char *s);
1003/*
1004 Writes the given null-terminated string to the compressed file, excluding
1005 the terminating null character.
1006 gzputs returns the number of characters written, or -1 in case of error.
1007*/
1008
1009ZEXTERN char * ZEXPORT gzgets (gzFile file, char *buf, int len);
1010/*
1011 Reads bytes from the compressed file until len-1 characters are read, or
1012 a newline character is read and transferred to buf, or an end-of-file
1013 condition is encountered. The string is then terminated with a null
1014 character.
1015 gzgets returns buf, or Z_NULL in case of error.
1016*/
1017
1018ZEXTERN int ZEXPORT gzputc (gzFile file, int c);
1019/*
1020 Writes c, converted to an unsigned char, into the compressed file.
1021 gzputc returns the value that was written, or -1 in case of error.
1022*/
1023
1024ZEXTERN int ZEXPORT gzgetc (gzFile file);
1025/*
1026 Reads one byte from the compressed file. gzgetc returns this byte
1027 or -1 in case of end of file or error.
1028*/
1029
1030ZEXTERN int ZEXPORT gzungetc (int c, gzFile file);
1031/*
1032 Push one character back onto the stream to be read again later.
1033 Only one character of push-back is allowed. gzungetc() returns the
1034 character pushed, or -1 on failure. gzungetc() will fail if a
1035 character has been pushed but not read yet, or if c is -1. The pushed
1036 character will be discarded if the stream is repositioned with gzseek()
1037 or gzrewind().
1038*/
1039
1040ZEXTERN int ZEXPORT gzflush (gzFile file, int flush);
1041/*
1042 Flushes all pending output into the compressed file. The parameter
1043 flush is as in the deflate() function. The return value is the zlib
1044 error number (see function gzerror below). gzflush returns Z_OK if
1045 the flush parameter is Z_FINISH and all output could be flushed.
1046 gzflush should be called only when strictly necessary because it can
1047 degrade compression.
1048*/
1049
1050ZEXTERN z_off_t ZEXPORT gzseek (gzFile file,
1051 z_off_t offset, int whence);
1052/*
1053 Sets the starting position for the next gzread or gzwrite on the
1054 given compressed file. The offset represents a number of bytes in the
1055 uncompressed data stream. The whence parameter is defined as in lseek(2);
1056 the value SEEK_END is not supported.
1057 If the file is opened for reading, this function is emulated but can be
1058 extremely slow. If the file is opened for writing, only forward seeks are
1059 supported; gzseek then compresses a sequence of zeroes up to the new
1060 starting position.
1061
1062 gzseek returns the resulting offset location as measured in bytes from
1063 the beginning of the uncompressed stream, or -1 in case of error, in
1064 particular if the file is opened for writing and the new starting position
1065 would be before the current position.
1066*/
1067
1068ZEXTERN int ZEXPORT gzrewind (gzFile file);
1069/*
1070 Rewinds the given file. This function is supported only for reading.
1071
1072 gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
1073*/
1074
1075ZEXTERN z_off_t ZEXPORT gztell (gzFile file);
1076/*
1077 Returns the starting position for the next gzread or gzwrite on the
1078 given compressed file. This position represents a number of bytes in the
1079 uncompressed data stream.
1080
1081 gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
1082*/
1083
1084ZEXTERN int ZEXPORT gzeof (gzFile file);
1085/*
1086 Returns 1 when EOF has previously been detected reading the given
1087 input stream, otherwise zero.
1088*/
1089
1090ZEXTERN int ZEXPORT gzclose (gzFile file);
1091/*
1092 Flushes all pending output if necessary, closes the compressed file
1093 and deallocates all the (de)compression state. The return value is the zlib
1094 error number (see function gzerror below).
1095*/
1096
1097ZEXTERN const char * ZEXPORT gzerror (gzFile file, int *errnum);
1098/*
1099 Returns the error message for the last error which occurred on the
1100 given compressed file. errnum is set to zlib error number. If an
1101 error occurred in the file system and not in the compression library,
1102 errnum is set to Z_ERRNO and the application may consult errno
1103 to get the exact error code.
1104*/
1105
1106ZEXTERN void ZEXPORT gzclearerr (gzFile file);
1107/*
1108 Clears the error and end-of-file flags for file. This is analogous to the
1109 clearerr() function in stdio. This is useful for continuing to read a gzip
1110 file that is being written concurrently.
1111*/
1112
1113 /* checksum functions */
1114
1115/*
1116 These functions are not related to compression but are exported
1117 anyway because they might be useful in applications using the
1118 compression library.
1119*/
1120
1121ZEXTERN uLong ZEXPORT adler32 (uLong adler, const Bytef *buf, uInt len);
1122
1123/*
1124 Update a running Adler-32 checksum with the bytes buf[0..len-1] and
1125 return the updated checksum. If buf is NULL, this function returns
1126 the required initial value for the checksum.
1127 An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
1128 much faster. Usage example:
1129
1130 uLong adler = adler32(0L, Z_NULL, 0);
1131
1132 while (read_buffer(buffer, length) != EOF) {
1133 adler = adler32(adler, buffer, length);
1134 }
1135 if (adler != original_adler) error();
1136*/
1137
1138ZEXTERN uLong ZEXPORT crc32 (uLong crc, const Bytef *buf, uInt len);
1139/*
1140 Update a running crc with the bytes buf[0..len-1] and return the updated
1141 crc. If buf is NULL, this function returns the required initial value
1142 for the crc. Pre- and post-conditioning (one's complement) is performed
1143 within this function so it shouldn't be done by the application.
1144 Usage example:
1145
1146 uLong crc = crc32(0L, Z_NULL, 0);
1147
1148 while (read_buffer(buffer, length) != EOF) {
1149 crc = crc32(crc, buffer, length);
1150 }
1151 if (crc != original_crc) error();
1152*/
1153
1154
1155 /* various hacks, don't look :) */
1156
1157/* deflateInit and inflateInit are macros to allow checking the zlib version
1158 * and the compiler's view of z_stream:
1159 */
1160ZEXTERN int ZEXPORT deflateInit_ (z_streamp strm, int level,
1161 const char *version, int stream_size);
1162ZEXTERN int ZEXPORT inflateInit_ (z_streamp strm,
1163 const char *version, int stream_size);
1164ZEXTERN int ZEXPORT deflateInit2_ (z_streamp strm, int level, int method,
1165 int windowBits, int memLevel,
1166 int strategy, const char *version,
1167 int stream_size);
1168ZEXTERN int ZEXPORT inflateInit2_ (z_streamp strm, int windowBits,
1169 const char *version, int stream_size);
1170ZEXTERN int ZEXPORT inflateBackInit_ (z_stream FAR *strm, int windowBits,
1171 unsigned char FAR *window,
1172 const char *version,
1173 int stream_size);
1174
1175#define deflateInit(strm, level) \
1176 deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
1177
1178#define inflateInit(strm) \
1179 inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
1180
1181#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
1182 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
1183 (strategy), ZLIB_VERSION, sizeof(z_stream))
1184
1185#define inflateInit2(strm, windowBits) \
1186 inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
1187
1188#define inflateBackInit(strm, windowBits, window) \
1189 inflateBackInit_((strm), (windowBits), (window), \
1190 ZLIB_VERSION, sizeof(z_stream))
1191
1192
1193#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
1194 struct internal_state {int dummy;}; /* hack for buggy compilers */
1195#endif
1196
1197ZEXTERN const char * ZEXPORT zError (int err);
1198ZEXTERN int ZEXPORT inflateSyncPoint (z_streamp z);
1199ZEXTERN const uLongf * ZEXPORT get_crc_table (void);
1200
1201#ifdef __cplusplus
1202}
1203#endif
1204
1205#endif /* ZLIB_H */
internal_state
Definition: zdeflate.h:90
z_stream_s
Definition: zlib.h:84


Watt-32 tcp/ip: E:/WATT/src/ztrees.c Source File

  • src
ztrees.c
1/* trees.c -- output deflated data using Huffman coding
2 * Copyright (C) 1995-2003 Jean-loup Gailly
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/*
7 * ALGORITHM
8 *
9 * The "deflation" process uses several Huffman trees. The more
10 * common source values are represented by shorter bit sequences.
11 *
12 * Each code tree is stored in a compressed form which is itself
13 * a Huffman encoding of the lengths of all the code strings (in
14 * ascending order by source values). The actual code strings are
15 * reconstructed from the lengths in the inflate process, as described
16 * in the deflate specification.
17 *
18 * REFERENCES
19 *
20 * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
21 * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
22 *
23 * Storer, James A.
24 * Data Compression: Methods and Theory, pp. 49-50.
25 * Computer Science Press, 1988. ISBN 0-7167-8156-5.
26 *
27 * Sedgewick, R.
28 * Algorithms, p290.
29 * Addison-Wesley, 1983. ISBN 0-201-06672-6.
30 */
31
32/* @(#) $Id$ */
33
34/* #define GEN_TREES_H */
35
36#include "wattcp.h"
37#include "zdeflate.h"
38
39#if defined(USE_GZIP)
40
41#ifdef DEBUG
42# include <ctype.h>
43#endif
44
45/* ===========================================================================
46 * Constants
47 */
48
49#define MAX_BL_BITS 7
50/* Bit length codes must not exceed MAX_BL_BITS bits */
51
52#define END_BLOCK 256
53/* end of block literal code */
54
55#define REP_3_6 16
56/* repeat previous bit length 3-6 times (2 bits of repeat count) */
57
58#define REPZ_3_10 17
59/* repeat a zero length 3-10 times (3 bits of repeat count) */
60
61#define REPZ_11_138 18
62/* repeat a zero length 11-138 times (7 bits of repeat count) */
63
64local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
65 = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
66
67local const int extra_dbits[D_CODES] /* extra bits for each distance code */
68 = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
69
70local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
71 = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
72
73local const uch bl_order[BL_CODES]
74 = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
75/* The lengths of the bit length codes are sent in order of decreasing
76 * probability, to avoid transmitting the lengths for unused bit length codes.
77 */
78
79#define Buf_size (8 * 2*sizeof(char))
80/* Number of bits used within bi_buf. (bi_buf might be implemented on
81 * more than 16 bits on some systems.)
82 */
83
84/* ===========================================================================
85 * Local data. These are initialized only once.
86 */
87
88#define DIST_CODE_LEN 512 /* see definition of array dist_code below */
89
90#if defined(GEN_TREES_H)
91/* non ANSI compilers may not accept ztrees.h */
92
93local ct_data static_ltree[L_CODES+2];
94/* The static literal tree. Since the bit lengths are imposed, there is no
95 * need for the L_CODES extra codes used during heap construction. However
96 * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
97 * below).
98 */
99
100local ct_data static_dtree[D_CODES];
101/* The static distance tree. (Actually a trivial tree since all codes use
102 * 5 bits.)
103 */
104
105uch _dist_code[DIST_CODE_LEN];
106/* Distance codes. The first 256 values correspond to the distances
107 * 3 .. 258, the last 256 values correspond to the top 8 bits of
108 * the 15 bit distances.
109 */
110
111uch _length_code[MAX_MATCH-MIN_MATCH+1];
112/* length code for each normalized match length (0 == MIN_MATCH) */
113
114local int base_length[LENGTH_CODES];
115/* First normalized length for each code (0 = MIN_MATCH) */
116
117local int base_dist[D_CODES];
118/* First normalized distance for each code (0 = distance of 1) */
119
120#else
121# include "ztrees.h"
122#endif /* GEN_TREES_H */
123
124struct static_tree_desc_s {
125 const ct_data *static_tree; /* static tree or NULL */
126 const intf *extra_bits; /* extra bits for each code or NULL */
127 int extra_base; /* base index for extra_bits */
128 int elems; /* max number of elements in the tree */
129 int max_length; /* max bit length for the codes */
130};
131
132local static_tree_desc static_l_desc =
133{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
134
135local static_tree_desc static_d_desc =
136{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
137
138local static_tree_desc static_bl_desc =
139{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
140
141/* ===========================================================================
142 * Local (static) routines in this file.
143 */
144
145local void tr_static_init (void);
146local void init_block (deflate_state *s);
147local void pqdownheap (deflate_state *s, ct_data *tree, int k);
148local void gen_bitlen (deflate_state *s, tree_desc *desc);
149local void gen_codes (ct_data *tree, int max_code, ushf *bl_count);
150local void build_tree (deflate_state *s, tree_desc *desc);
151local void scan_tree (deflate_state *s, ct_data *tree, int max_code);
152local void send_tree (deflate_state *s, ct_data *tree, int max_code);
153local int build_bl_tree (deflate_state *s);
154local void send_all_trees (deflate_state *s, int lcodes, int dcodes, int blcodes);
155local void compress_block (deflate_state *s, ct_data *ltree, ct_data *dtree);
156local void set_data_type (deflate_state *s);
157local unsigned bi_reverse (unsigned value, int length);
158local void bi_windup (deflate_state *s);
159local void bi_flush (deflate_state *s);
160local void copy_block (deflate_state *s, charf *buf, unsigned len, int header);
161
162#ifdef GEN_TREES_H
163local void gen_trees_header (void);
164#endif
165
166#ifndef DEBUG
167# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
168 /* Send a code of the given tree. c and tree must not have side effects */
169
170#else /* DEBUG */
171# define send_code(s, c, tree) \
172 { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
173 send_bits(s, tree[c].Code, tree[c].Len); }
174#endif
175
176/* ===========================================================================
177 * Output a short LSB first on the stream.
178 * IN assertion: there is enough room in pendingBuf.
179 */
180#define put_short(s, w) { \
181 put_byte(s, (uch)((w) & 0xff)); \
182 put_byte(s, (uch)((ush)(w) >> 8)); \
183}
184
185/* ===========================================================================
186 * Send a value on a given number of bits.
187 * IN assertion: length <= 16 and value fits in length bits.
188 */
189#ifdef DEBUG
190local void send_bits (deflate_state *s, int value, int length);
191
192local void send_bits(s, value, length)
193 deflate_state *s;
194 int value; /* value to send */
195 int length; /* number of bits */
196{
197 Tracevv((stderr," l %2d v %4x ", length, value));
198 Assert(length > 0 && length <= 15, "invalid length");
199 s->bits_sent += (ulg)length;
200
201 /* If not enough room in bi_buf, use (valid) bits from bi_buf and
202 * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
203 * unused bits in value.
204 */
205 if (s->bi_valid > (int)Buf_size - length) {
206 s->bi_buf |= (value << s->bi_valid);
207 put_short(s, s->bi_buf);
208 s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
209 s->bi_valid += length - Buf_size;
210 } else {
211 s->bi_buf |= value << s->bi_valid;
212 s->bi_valid += length;
213 }
214}
215#else /* !DEBUG */
216
217#define send_bits(s, value, length) \
218{ int len = length;\
219 if (s->bi_valid > (int)Buf_size - len) {\
220 int val = value;\
221 s->bi_buf |= (val << s->bi_valid);\
222 put_short(s, s->bi_buf);\
223 s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
224 s->bi_valid += len - Buf_size;\
225 } else {\
226 s->bi_buf |= (value) << s->bi_valid;\
227 s->bi_valid += len;\
228 }\
229}
230#endif /* DEBUG */
231
232
233/* the arguments must not have side effects */
234
235/* ===========================================================================
236 * Initialize the various 'constant' tables.
237 */
238local void tr_static_init()
239{
240#if defined(GEN_TREES_H)
241 static int static_init_done = 0;
242 int n; /* iterates over tree elements */
243 int bits; /* bit counter */
244 int length; /* length value */
245 int code; /* code value */
246 int dist; /* distance index */
247 ush bl_count[MAX_BITS+1];
248 /* number of codes at each bit length for an optimal tree */
249
250 if (static_init_done) return;
251
252 /* For some embedded targets, global variables are not initialized: */
253 static_l_desc.static_tree = static_ltree;
254 static_l_desc.extra_bits = extra_lbits;
255 static_d_desc.static_tree = static_dtree;
256 static_d_desc.extra_bits = extra_dbits;
257 static_bl_desc.extra_bits = extra_blbits;
258
259 /* Initialize the mapping length (0..255) -> length code (0..28) */
260 length = 0;
261 for (code = 0; code < LENGTH_CODES-1; code++) {
262 base_length[code] = length;
263 for (n = 0; n < (1<<extra_lbits[code]); n++) {
264 _length_code[length++] = (uch)code;
265 }
266 }
267 Assert (length == 256, "tr_static_init: length != 256");
268 /* Note that the length 255 (match length 258) can be represented
269 * in two different ways: code 284 + 5 bits or code 285, so we
270 * overwrite length_code[255] to use the best encoding:
271 */
272 _length_code[length-1] = (uch)code;
273
274 /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
275 dist = 0;
276 for (code = 0 ; code < 16; code++) {
277 base_dist[code] = dist;
278 for (n = 0; n < (1<<extra_dbits[code]); n++) {
279 _dist_code[dist++] = (uch)code;
280 }
281 }
282 Assert (dist == 256, "tr_static_init: dist != 256");
283 dist >>= 7; /* from now on, all distances are divided by 128 */
284 for ( ; code < D_CODES; code++) {
285 base_dist[code] = dist << 7;
286 for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
287 _dist_code[256 + dist++] = (uch)code;
288 }
289 }
290 Assert (dist == 256, "tr_static_init: 256+dist != 512");
291
292 /* Construct the codes of the static literal tree */
293 for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
294 n = 0;
295 while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
296 while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
297 while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
298 while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
299 /* Codes 286 and 287 do not exist, but we must include them in the
300 * tree construction to get a canonical Huffman tree (longest code
301 * all ones)
302 */
303 gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
304
305 /* The static distance tree is trivial: */
306 for (n = 0; n < D_CODES; n++) {
307 static_dtree[n].Len = 5;
308 static_dtree[n].Code = bi_reverse((unsigned)n, 5);
309 }
310 static_init_done = 1;
311
312# ifdef GEN_TREES_H
313 gen_trees_header();
314# endif
315#endif /* defined(GEN_TREES_H) */
316}
317
318/* ===========================================================================
319 * Genererate the file trees.h describing the static trees.
320 */
321#ifdef GEN_TREES_H
322# ifndef DEBUG
323# include <stdio.h>
324# endif
325
326# define SEPARATOR(i, last, width) \
327 ((i) == (last)? "\n};\n\n" : \
328 ((i) % (width) == (width)-1 ? ",\n" : ", "))
329
330void gen_trees_header()
331{
332 FILE *header = fopen("ztrees.h", "w");
333 int i;
334
335 Assert (header != NULL, "Can't open ztrees.h");
336 fprintf(header,
337 "/* header created automatically with -DGEN_TREES_H */\n\n");
338
339 fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
340 for (i = 0; i < L_CODES+2; i++) {
341 fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
342 static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
343 }
344
345 fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
346 for (i = 0; i < D_CODES; i++) {
347 fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
348 static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
349 }
350
351 fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
352 for (i = 0; i < DIST_CODE_LEN; i++) {
353 fprintf(header, "%2u%s", _dist_code[i],
354 SEPARATOR(i, DIST_CODE_LEN-1, 20));
355 }
356
357 fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
358 for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
359 fprintf(header, "%2u%s", _length_code[i],
360 SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
361 }
362
363 fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
364 for (i = 0; i < LENGTH_CODES; i++) {
365 fprintf(header, "%1u%s", base_length[i],
366 SEPARATOR(i, LENGTH_CODES-1, 20));
367 }
368
369 fprintf(header, "local const int base_dist[D_CODES] = {\n");
370 for (i = 0; i < D_CODES; i++) {
371 fprintf(header, "%5u%s", base_dist[i],
372 SEPARATOR(i, D_CODES-1, 10));
373 }
374
375 fclose(header);
376}
377#endif /* GEN_TREES_H */
378
379/* ===========================================================================
380 * Initialize the tree data structures for a new zlib stream.
381 */
382void _tr_init(deflate_state *s)
383{
384 tr_static_init();
385
386 s->l_desc.dyn_tree = s->dyn_ltree;
387 s->l_desc.stat_desc = &static_l_desc;
388
389 s->d_desc.dyn_tree = s->dyn_dtree;
390 s->d_desc.stat_desc = &static_d_desc;
391
392 s->bl_desc.dyn_tree = s->bl_tree;
393 s->bl_desc.stat_desc = &static_bl_desc;
394
395 s->bi_buf = 0;
396 s->bi_valid = 0;
397 s->last_eob_len = 8; /* enough lookahead for inflate */
398#ifdef DEBUG
399 s->compressed_len = 0L;
400 s->bits_sent = 0L;
401#endif
402
403 /* Initialize the first block of the first file: */
404 init_block(s);
405}
406
407/* ===========================================================================
408 * Initialize a new block.
409 */
410local void init_block(deflate_state *s)
411{
412 int n; /* iterates over tree elements */
413
414 /* Initialize the trees. */
415 for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
416 for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
417 for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
418
419 s->dyn_ltree[END_BLOCK].Freq = 1;
420 s->opt_len = s->static_len = 0L;
421 s->last_lit = s->matches = 0;
422}
423
424#define SMALLEST 1
425/* Index within the heap array of least frequent node in the Huffman tree */
426
427
428/* ===========================================================================
429 * Remove the smallest element from the heap and recreate the heap with
430 * one less element. Updates heap and heap_len.
431 */
432#define pqremove(s, tree, top) \
433{\
434 top = s->heap[SMALLEST]; \
435 s->heap[SMALLEST] = s->heap[s->heap_len--]; \
436 pqdownheap(s, tree, SMALLEST); \
437}
438
439/* ===========================================================================
440 * Compares to subtrees, using the tree depth as tie breaker when
441 * the subtrees have equal frequency. This minimizes the worst case length.
442 */
443#define smaller(tree, n, m, depth) \
444 (tree[n].Freq < tree[m].Freq || \
445 (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
446
447/* ===========================================================================
448 * Restore the heap property by moving down the tree starting at node k,
449 * exchanging a node with the smallest of its two sons if necessary, stopping
450 * when the heap property is re-established (each father smaller than its
451 * two sons).
452 */
453local void pqdownheap (deflate_state *s,
454 ct_data *tree, /* the tree to restore */
455 int k) /* node to move down */
456{
457 int v = s->heap[k];
458 int j = k << 1; /* left son of k */
459 while (j <= s->heap_len) {
460 /* Set j to the smallest of the two sons: */
461 if (j < s->heap_len &&
462 smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
463 j++;
464 }
465 /* Exit if v is smaller than both sons */
466 if (smaller(tree, v, s->heap[j], s->depth)) break;
467
468 /* Exchange v with the smallest son */
469 s->heap[k] = s->heap[j]; k = j;
470
471 /* And continue down the tree, setting j to the left son of k */
472 j <<= 1;
473 }
474 s->heap[k] = v;
475}
476
477/* ===========================================================================
478 * Compute the optimal bit lengths for a tree and update the total bit length
479 * for the current block.
480 * IN assertion: the fields freq and dad are set, heap[heap_max] and
481 * above are the tree nodes sorted by increasing frequency.
482 * OUT assertions: the field len is set to the optimal bit length, the
483 * array bl_count contains the frequencies for each bit length.
484 * The length opt_len is updated; static_len is also updated if stree is
485 * not null.
486 */
487local void gen_bitlen (deflate_state *s,
488 tree_desc *desc) /* the tree descriptor */
489{
490 ct_data *tree = desc->dyn_tree;
491 int max_code = desc->max_code;
492 const ct_data *stree = desc->stat_desc->static_tree;
493 const intf *extra = desc->stat_desc->extra_bits;
494 int base = desc->stat_desc->extra_base;
495 int max_length = desc->stat_desc->max_length;
496 int h; /* heap index */
497 int n, m; /* iterate over the tree elements */
498 int bits; /* bit length */
499 int xbits; /* extra bits */
500 ush f; /* frequency */
501 int overflow = 0; /* number of elements with bit length too large */
502
503 for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
504
505 /* In a first pass, compute the optimal bit lengths (which may
506 * overflow in the case of the bit length tree).
507 */
508 tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
509
510 for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
511 n = s->heap[h];
512 bits = tree[tree[n].Dad].Len + 1;
513 if (bits > max_length) bits = max_length, overflow++;
514 tree[n].Len = (ush)bits;
515 /* We overwrite tree[n].Dad which is no longer needed */
516
517 if (n > max_code) continue; /* not a leaf node */
518
519 s->bl_count[bits]++;
520 xbits = 0;
521 if (n >= base) xbits = extra[n-base];
522 f = tree[n].Freq;
523 s->opt_len += (ulg)f * (bits + xbits);
524 if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
525 }
526 if (overflow == 0) return;
527
528 Trace((stderr,"\nbit length overflow\n"));
529 /* This happens for example on obj2 and pic of the Calgary corpus */
530
531 /* Find the first bit length which could increase: */
532 do {
533 bits = max_length-1;
534 while (s->bl_count[bits] == 0) bits--;
535 s->bl_count[bits]--; /* move one leaf down the tree */
536 s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
537 s->bl_count[max_length]--;
538 /* The brother of the overflow item also moves one step up,
539 * but this does not affect bl_count[max_length]
540 */
541 overflow -= 2;
542 } while (overflow > 0);
543
544 /* Now recompute all bit lengths, scanning in increasing frequency.
545 * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
546 * lengths instead of fixing only the wrong ones. This idea is taken
547 * from 'ar' written by Haruhiko Okumura.)
548 */
549 for (bits = max_length; bits != 0; bits--) {
550 n = s->bl_count[bits];
551 while (n != 0) {
552 m = s->heap[--h];
553 if (m > max_code) continue;
554 if (tree[m].Len != (unsigned) bits) {
555 Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
556 s->opt_len += ((long)bits - (long)tree[m].Len)
557 *(long)tree[m].Freq;
558 tree[m].Len = (ush)bits;
559 }
560 n--;
561 }
562 }
563}
564
565/* ===========================================================================
566 * Generate the codes for a given tree and bit counts (which need not be
567 * optimal).
568 * IN assertion: the array bl_count contains the bit length statistics for
569 * the given tree and the field len is set for all tree elements.
570 * OUT assertion: the field code is set for all tree elements of non
571 * zero code length.
572 */
573local void gen_codes (ct_data *tree, /* the tree to decorate */
574 int max_code, /* largest code with non zero frequency */
575 ushf *bl_count) /* number of codes at each bit length */
576{
577 ush next_code[MAX_BITS+1]; /* next code value for each bit length */
578 ush code = 0; /* running code value */
579 int bits; /* bit index */
580 int n; /* code index */
581
582 /* The distribution counts are first used to generate the code values
583 * without bit reversal.
584 */
585 for (bits = 1; bits <= MAX_BITS; bits++) {
586 next_code[bits] = code = (code + bl_count[bits-1]) << 1;
587 }
588 /* Check that the bit counts in bl_count are consistent. The last code
589 * must be all ones.
590 */
591 Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
592 "inconsistent bit counts");
593 Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
594
595 for (n = 0; n <= max_code; n++) {
596 int len = tree[n].Len;
597 if (len == 0) continue;
598 /* Now reverse the bits */
599 tree[n].Code = bi_reverse(next_code[len]++, len);
600
601 Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
602 n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
603 }
604}
605
606/* ===========================================================================
607 * Construct one Huffman tree and assigns the code bit strings and lengths.
608 * Update the total bit length for the current block.
609 * IN assertion: the field freq is set for all tree elements.
610 * OUT assertions: the fields len and code are set to the optimal bit length
611 * and corresponding code. The length opt_len is updated; static_len is
612 * also updated if stree is not null. The field max_code is set.
613 */
614local void build_tree (deflate_state *s,
615 tree_desc *desc) /* the tree descriptor */
616{
617 ct_data *tree = desc->dyn_tree;
618 const ct_data *stree = desc->stat_desc->static_tree;
619 int elems = desc->stat_desc->elems;
620 int n, m; /* iterate over heap elements */
621 int max_code = -1; /* largest code with non zero frequency */
622 int node; /* new node being created */
623
624 /* Construct the initial heap, with least frequent element in
625 * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
626 * heap[0] is not used.
627 */
628 s->heap_len = 0, s->heap_max = HEAP_SIZE;
629
630 for (n = 0; n < elems; n++) {
631 if (tree[n].Freq != 0) {
632 s->heap[++(s->heap_len)] = max_code = n;
633 s->depth[n] = 0;
634 } else {
635 tree[n].Len = 0;
636 }
637 }
638
639 /* The pkzip format requires that at least one distance code exists,
640 * and that at least one bit should be sent even if there is only one
641 * possible code. So to avoid special checks later on we force at least
642 * two codes of non zero frequency.
643 */
644 while (s->heap_len < 2) {
645 node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
646 tree[node].Freq = 1;
647 s->depth[node] = 0;
648 s->opt_len--; if (stree) s->static_len -= stree[node].Len;
649 /* node is 0 or 1 so it does not have extra bits */
650 }
651 desc->max_code = max_code;
652
653 /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
654 * establish sub-heaps of increasing lengths:
655 */
656 for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
657
658 /* Construct the Huffman tree by repeatedly combining the least two
659 * frequent nodes.
660 */
661 node = elems; /* next internal node of the tree */
662 do {
663 pqremove(s, tree, n); /* n = node of least frequency */
664 m = s->heap[SMALLEST]; /* m = node of next least frequency */
665
666 s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
667 s->heap[--(s->heap_max)] = m;
668
669 /* Create a new node father of n and m */
670 tree[node].Freq = tree[n].Freq + tree[m].Freq;
671 s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
672 s->depth[n] : s->depth[m]) + 1);
673 tree[n].Dad = tree[m].Dad = (ush)node;
674#ifdef DUMP_BL_TREE
675 if (tree == s->bl_tree) {
676 fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
677 node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
678 }
679#endif
680 /* and insert the new node in the heap */
681 s->heap[SMALLEST] = node++;
682 pqdownheap(s, tree, SMALLEST);
683
684 } while (s->heap_len >= 2);
685
686 s->heap[--(s->heap_max)] = s->heap[SMALLEST];
687
688 /* At this point, the fields freq and dad are set. We can now
689 * generate the bit lengths.
690 */
691 gen_bitlen(s, (tree_desc *)desc);
692
693 /* The field len is now set, we can generate the bit codes */
694 gen_codes ((ct_data *)tree, max_code, s->bl_count);
695}
696
697/* ===========================================================================
698 * Scan a literal or distance tree to determine the frequencies of the codes
699 * in the bit length tree.
700 */
701local void scan_tree (deflate_state *s,
702 ct_data *tree, /* the tree to be scanned */
703 int max_code) /* and its largest code of non zero frequency */
704{
705 int n; /* iterates over all tree elements */
706 int prevlen = -1; /* last emitted length */
707 int curlen; /* length of current code */
708 int nextlen = tree[0].Len; /* length of next code */
709 int count = 0; /* repeat count of the current code */
710 int max_count = 7; /* max repeat count */
711 int min_count = 4; /* min repeat count */
712
713 if (nextlen == 0) max_count = 138, min_count = 3;
714 tree[max_code+1].Len = (ush)0xffff; /* guard */
715
716 for (n = 0; n <= max_code; n++) {
717 curlen = nextlen; nextlen = tree[n+1].Len;
718 if (++count < max_count && curlen == nextlen) {
719 continue;
720 } else if (count < min_count) {
721 s->bl_tree[curlen].Freq += count;
722 } else if (curlen != 0) {
723 if (curlen != prevlen) s->bl_tree[curlen].Freq++;
724 s->bl_tree[REP_3_6].Freq++;
725 } else if (count <= 10) {
726 s->bl_tree[REPZ_3_10].Freq++;
727 } else {
728 s->bl_tree[REPZ_11_138].Freq++;
729 }
730 count = 0; prevlen = curlen;
731 if (nextlen == 0) {
732 max_count = 138, min_count = 3;
733 } else if (curlen == nextlen) {
734 max_count = 6, min_count = 3;
735 } else {
736 max_count = 7, min_count = 4;
737 }
738 }
739}
740
741/* ===========================================================================
742 * Send a literal or distance tree in compressed form, using the codes in
743 * bl_tree.
744 */
745local void send_tree (deflate_state *s,
746 ct_data *tree, /* the tree to be scanned */
747 int max_code) /* and its largest code of non zero frequency */
748{
749 int n; /* iterates over all tree elements */
750 int prevlen = -1; /* last emitted length */
751 int curlen; /* length of current code */
752 int nextlen = tree[0].Len; /* length of next code */
753 int count = 0; /* repeat count of the current code */
754 int max_count = 7; /* max repeat count */
755 int min_count = 4; /* min repeat count */
756
757 /* tree[max_code+1].Len = -1; */ /* guard already set */
758 if (nextlen == 0) max_count = 138, min_count = 3;
759
760 for (n = 0; n <= max_code; n++) {
761 curlen = nextlen; nextlen = tree[n+1].Len;
762 if (++count < max_count && curlen == nextlen) {
763 continue;
764 } else if (count < min_count) {
765 do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
766
767 } else if (curlen != 0) {
768 if (curlen != prevlen) {
769 send_code(s, curlen, s->bl_tree); count--;
770 }
771 Assert(count >= 3 && count <= 6, " 3_6?");
772 send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
773
774 } else if (count <= 10) {
775 send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
776
777 } else {
778 send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
779 }
780 count = 0; prevlen = curlen;
781 if (nextlen == 0) {
782 max_count = 138, min_count = 3;
783 } else if (curlen == nextlen) {
784 max_count = 6, min_count = 3;
785 } else {
786 max_count = 7, min_count = 4;
787 }
788 }
789}
790
791/* ===========================================================================
792 * Construct the Huffman tree for the bit lengths and return the index in
793 * bl_order of the last bit length code to send.
794 */
795local int build_bl_tree (deflate_state *s)
796{
797 int max_blindex; /* index of last bit length code of non zero freq */
798
799 /* Determine the bit length frequencies for literal and distance trees */
800 scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
801 scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
802
803 /* Build the bit length tree: */
804 build_tree(s, (tree_desc *)(&(s->bl_desc)));
805 /* opt_len now includes the length of the tree representations, except
806 * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
807 */
808
809 /* Determine the number of bit length codes to send. The pkzip format
810 * requires that at least 4 bit length codes be sent. (appnote.txt says
811 * 3 but the actual value used is 4.)
812 */
813 for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
814 if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
815 }
816 /* Update opt_len to include the bit length tree and counts */
817 s->opt_len += 3*(max_blindex+1) + 5+5+4;
818 Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
819 s->opt_len, s->static_len));
820
821 return max_blindex;
822}
823
824/* ===========================================================================
825 * Send the header for a block using dynamic Huffman trees: the counts, the
826 * lengths of the bit length codes, the literal tree and the distance tree.
827 * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
828 */
829local void send_all_trees (deflate_state *s,
830 int lcodes, int dcodes, int blcodes) /* number of codes for each tree */
831{
832 int rank; /* index in bl_order */
833
834 Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
835 Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
836 "too many codes");
837 Tracev((stderr, "\nbl counts: "));
838 send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
839 send_bits(s, dcodes-1, 5);
840 send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
841 for (rank = 0; rank < blcodes; rank++) {
842 Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
843 send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
844 }
845 Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
846
847 send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
848 Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
849
850 send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
851 Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
852}
853
854/* ===========================================================================
855 * Send a stored block
856 */
857void _tr_stored_block (deflate_state *s,
858 charf *buf, /* input block */
859 ulg stored_len, /* length of input block */
860 int eof) /* true if this is the last block for a file */
861{
862 send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
863#ifdef DEBUG
864 s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
865 s->compressed_len += (stored_len + 4) << 3;
866#endif
867 copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
868}
869
870/* ===========================================================================
871 * Send one empty static block to give enough lookahead for inflate.
872 * This takes 10 bits, of which 7 may remain in the bit buffer.
873 * The current inflate code requires 9 bits of lookahead. If the
874 * last two codes for the previous block (real code plus EOB) were coded
875 * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
876 * the last real code. In this case we send two empty static blocks instead
877 * of one. (There are no problems if the previous block is stored or fixed.)
878 * To simplify the code, we assume the worst case of last real code encoded
879 * on one bit only.
880 */
881void _tr_align (deflate_state *s)
882{
883 send_bits(s, STATIC_TREES<<1, 3);
884 send_code(s, END_BLOCK, static_ltree);
885#ifdef DEBUG
886 s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
887#endif
888 bi_flush(s);
889 /* Of the 10 bits for the empty block, we have already sent
890 * (10 - bi_valid) bits. The lookahead for the last real code (before
891 * the EOB of the previous block) was thus at least one plus the length
892 * of the EOB plus what we have just sent of the empty static block.
893 */
894 if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
895 send_bits(s, STATIC_TREES<<1, 3);
896 send_code(s, END_BLOCK, static_ltree);
897#ifdef DEBUG
898 s->compressed_len += 10L;
899#endif
900 bi_flush(s);
901 }
902 s->last_eob_len = 7;
903}
904
905/* ===========================================================================
906 * Determine the best encoding for the current block: dynamic trees, static
907 * trees or store, and output the encoded block to the zip file.
908 */
909void _tr_flush_block (deflate_state *s,
910 charf *buf, /* input block, or NULL if too old */
911 ulg stored_len, /* length of input block */
912 int eof) /* true if this is the last block for a file */
913{
914 ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
915 int max_blindex = 0; /* index of last bit length code of non zero freq */
916
917 /* Build the Huffman trees unless a stored block is forced */
918 if (s->level > 0) {
919
920 /* Check if the file is ascii or binary */
921 if (s->data_type == Z_UNKNOWN) set_data_type(s);
922
923 /* Construct the literal and distance trees */
924 build_tree(s, (tree_desc *)(&(s->l_desc)));
925 Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
926 s->static_len));
927
928 build_tree(s, (tree_desc *)(&(s->d_desc)));
929 Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
930 s->static_len));
931 /* At this point, opt_len and static_len are the total bit lengths of
932 * the compressed block data, excluding the tree representations.
933 */
934
935 /* Build the bit length tree for the above two trees, and get the index
936 * in bl_order of the last bit length code to send.
937 */
938 max_blindex = build_bl_tree(s);
939
940 /* Determine the best encoding. Compute the block lengths in bytes. */
941 opt_lenb = (s->opt_len+3+7)>>3;
942 static_lenb = (s->static_len+3+7)>>3;
943
944 Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
945 opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
946 s->last_lit));
947
948 if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
949
950 } else {
951 Assert(buf != (char*)0, "lost buf");
952 opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
953 }
954
955#ifdef FORCE_STORED
956 if (buf != (char*)0) { /* force stored block */
957#else
958 if (stored_len+4 <= opt_lenb && buf != (char*)0) {
959 /* 4: two words for the lengths */
960#endif
961 /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
962 * Otherwise we can't have processed more than WSIZE input bytes since
963 * the last block flush, because compression would have been
964 * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
965 * transform a block into a stored block.
966 */
967 _tr_stored_block(s, buf, stored_len, eof);
968
969#ifdef FORCE_STATIC
970 } else if (static_lenb >= 0) { /* force static trees */
971#else
972 } else if (static_lenb == opt_lenb) {
973#endif
974 send_bits(s, (STATIC_TREES<<1)+eof, 3);
975 compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
976#ifdef DEBUG
977 s->compressed_len += 3 + s->static_len;
978#endif
979 } else {
980 send_bits(s, (DYN_TREES<<1)+eof, 3);
981 send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
982 max_blindex+1);
983 compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
984#ifdef DEBUG
985 s->compressed_len += 3 + s->opt_len;
986#endif
987 }
988 Assert (s->compressed_len == s->bits_sent, "bad compressed size");
989 /* The above check is made mod 2^32, for files larger than 512 MB
990 * and uLong implemented on 32 bits.
991 */
992 init_block(s);
993
994 if (eof) {
995 bi_windup(s);
996#ifdef DEBUG
997 s->compressed_len += 7; /* align on byte boundary */
998#endif
999 }
1000 Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
1001 s->compressed_len-7*eof));
1002}
1003
1004/* ===========================================================================
1005 * Save the match info and tally the frequency counts. Return true if
1006 * the current block must be flushed.
1007 */
1008int _tr_tally (deflate_state *s,
1009 unsigned dist, /* distance of matched string */
1010 unsigned lc) /* match length-MIN_MATCH or unmatched char (if dist==0) */
1011{
1012 s->d_buf[s->last_lit] = (ush)dist;
1013 s->l_buf[s->last_lit++] = (uch)lc;
1014 if (dist == 0) {
1015 /* lc is the unmatched char */
1016 s->dyn_ltree[lc].Freq++;
1017 } else {
1018 s->matches++;
1019 /* Here, lc is the match length - MIN_MATCH */
1020 dist--; /* dist = match distance - 1 */
1021 Assert((ush)dist < (ush)MAX_DIST(s) &&
1022 (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
1023 (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
1024
1025 s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
1026 s->dyn_dtree[d_code(dist)].Freq++;
1027 }
1028
1029#ifdef TRUNCATE_BLOCK
1030 /* Try to guess if it is profitable to stop the current block here */
1031 if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
1032 /* Compute an upper bound for the compressed length */
1033 ulg out_length = (ulg)s->last_lit*8L;
1034 ulg in_length = (ulg)((long)s->strstart - s->block_start);
1035 int dcode;
1036 for (dcode = 0; dcode < D_CODES; dcode++) {
1037 out_length += (ulg)s->dyn_dtree[dcode].Freq *
1038 (5L+extra_dbits[dcode]);
1039 }
1040 out_length >>= 3;
1041 Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
1042 s->last_lit, in_length, out_length,
1043 100L - out_length*100L/in_length));
1044 if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
1045 }
1046#endif
1047 return (s->last_lit == s->lit_bufsize-1);
1048 /* We avoid equality with lit_bufsize because of wraparound at 64K
1049 * on 16 bit machines and because stored blocks are restricted to
1050 * 64K-1 bytes.
1051 */
1052}
1053
1054/* ===========================================================================
1055 * Send the block data compressed using the given Huffman trees
1056 */
1057local void compress_block (deflate_state *s,
1058 ct_data *ltree, /* literal tree */
1059 ct_data *dtree) /* distance tree */
1060{
1061 unsigned dist; /* distance of matched string */
1062 int lc; /* match length or unmatched char (if dist == 0) */
1063 unsigned lx = 0; /* running index in l_buf */
1064 unsigned code; /* the code to send */
1065 int extra; /* number of extra bits to send */
1066
1067 if (s->last_lit != 0) do {
1068 dist = s->d_buf[lx];
1069 lc = s->l_buf[lx++];
1070 if (dist == 0) {
1071 send_code(s, lc, ltree); /* send a literal byte */
1072 Tracecv(isgraph(lc), (stderr," '%c' ", lc));
1073 } else {
1074 /* Here, lc is the match length - MIN_MATCH */
1075 code = _length_code[lc];
1076 send_code(s, code+LITERALS+1, ltree); /* send the length code */
1077 extra = extra_lbits[code];
1078 if (extra != 0) {
1079 lc -= base_length[code];
1080 send_bits(s, lc, extra); /* send the extra length bits */
1081 }
1082 dist--; /* dist is now the match distance - 1 */
1083 code = d_code(dist);
1084 Assert (code < D_CODES, "bad d_code");
1085
1086 send_code(s, code, dtree); /* send the distance code */
1087 extra = extra_dbits[code];
1088 if (extra != 0) {
1089 dist -= base_dist[code];
1090 send_bits(s, dist, extra); /* send the extra distance bits */
1091 }
1092 } /* literal or match pair ? */
1093
1094 /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
1095 Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
1096 "pendingBuf overflow");
1097
1098 } while (lx < s->last_lit);
1099
1100 send_code(s, END_BLOCK, ltree);
1101 s->last_eob_len = ltree[END_BLOCK].Len;
1102}
1103
1104/* ===========================================================================
1105 * Set the data type to ASCII or BINARY, using a crude approximation:
1106 * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise.
1107 * IN assertion: the fields freq of dyn_ltree are set and the total of all
1108 * frequencies does not exceed 64K (to fit in an int on 16 bit machines).
1109 */
1110local void set_data_type (deflate_state *s)
1111{
1112 int n = 0;
1113 unsigned ascii_freq = 0;
1114 unsigned bin_freq = 0;
1115 while (n < 7) bin_freq += s->dyn_ltree[n++].Freq;
1116 while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq;
1117 while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq;
1118 s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII);
1119}
1120
1121/* ===========================================================================
1122 * Reverse the first len bits of a code, using straightforward code (a faster
1123 * method would use a table)
1124 * IN assertion: 1 <= len <= 15
1125 */
1126local unsigned bi_reverse (unsigned code, /* the value to invert */
1127 int len) /* its bit length */
1128{
1129 unsigned res = 0;
1130 do {
1131 res |= code & 1;
1132 code >>= 1, res <<= 1;
1133 } while (--len > 0);
1134 return res >> 1;
1135}
1136
1137/* ===========================================================================
1138 * Flush the bit buffer, keeping at most 7 bits in it.
1139 */
1140local void bi_flush (deflate_state *s)
1141{
1142 if (s->bi_valid == 16) {
1143 put_short(s, s->bi_buf);
1144 s->bi_buf = 0;
1145 s->bi_valid = 0;
1146 } else if (s->bi_valid >= 8) {
1147 put_byte(s, (Byte)s->bi_buf);
1148 s->bi_buf >>= 8;
1149 s->bi_valid -= 8;
1150 }
1151}
1152
1153/* ===========================================================================
1154 * Flush the bit buffer and align the output on a byte boundary
1155 */
1156local void bi_windup (deflate_state *s)
1157{
1158 if (s->bi_valid > 8) {
1159 put_short(s, s->bi_buf);
1160 } else if (s->bi_valid > 0) {
1161 put_byte(s, (Byte)s->bi_buf);
1162 }
1163 s->bi_buf = 0;
1164 s->bi_valid = 0;
1165#ifdef DEBUG
1166 s->bits_sent = (s->bits_sent+7) & ~7;
1167#endif
1168}
1169
1170/* ===========================================================================
1171 * Copy a stored block, storing first the length and its
1172 * one's complement if requested.
1173 */
1174local void copy_block (deflate_state *s,
1175 charf *buf, /* the input data */
1176 unsigned len, /* its length */
1177 int header) /* true if block header must be written */
1178{
1179 bi_windup(s); /* align on byte boundary */
1180 s->last_eob_len = 8; /* enough lookahead for inflate */
1181
1182 if (header) {
1183 put_short(s, (ush)len);
1184 put_short(s, (ush)~len);
1185#ifdef DEBUG
1186 s->bits_sent += 2*16;
1187#endif
1188 }
1189#ifdef DEBUG
1190 s->bits_sent += (ulg)len<<3;
1191#endif
1192 while (len--) {
1193 put_byte(s, *buf++);
1194 }
1195}
1196#endif /* USE_GZIP */
1197
code
Definition: zinftree.h:24
ct_data_s
Definition: zdeflate.h:58
internal_state
Definition: zdeflate.h:90
static_tree_desc_s
Definition: zdeflate.c:164
tree_desc_s
Definition: zdeflate.h:76
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/ztrees.h Source File

  • src
ztrees.h
1/* header created automatically with -DGEN_TREES_H */
2
3local const ct_data static_ltree[L_CODES+2] = {
4{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
5{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
6{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
7{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
8{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
9{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
10{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
11{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
12{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
13{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
14{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
15{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
16{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
17{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
18{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
19{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
20{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
21{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
22{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
23{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
24{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
25{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
26{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
27{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
28{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
29{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
30{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
31{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
32{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
33{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
34{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
35{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
36{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
37{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
38{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
39{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
40{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
41{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
42{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
43{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
44{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
45{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
46{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
47{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
48{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
49{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
50{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
51{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
52{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
53{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
54{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
55{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
56{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
57{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
58{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
59{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
60{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
61{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
62};
63
64local const ct_data static_dtree[D_CODES] = {
65{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
66{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
67{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
68{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
69{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
70{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
71};
72
73const uch _dist_code[DIST_CODE_LEN] = {
74 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
75 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
7610, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
7711, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
7812, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
7913, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
8013, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
8114, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
8214, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
8314, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
8415, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
8515, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
8615, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
8718, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
8823, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
8924, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
9026, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
9126, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
9227, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
9327, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
9428, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
9528, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
9628, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
9729, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
9829, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
9929, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
100};
101
102const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
103 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
10413, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
10517, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
10619, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
10721, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
10822, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
10923, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
11024, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
11125, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
11225, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
11326, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
11426, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
11527, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
116};
117
118local const int base_length[LENGTH_CODES] = {
1190, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
12064, 80, 96, 112, 128, 160, 192, 224, 0
121};
122
123local const int base_dist[D_CODES] = {
124 0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
125 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
126 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
127};
128
ct_data_s
Definition: zdeflate.h:58


Watt-32 tcp/ip: E:/WATT/src/zuncompr.c Source File

  • src
zuncompr.c
1/* uncompr.c -- decompress a memory buffer
2 * Copyright (C) 1995-2003 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* @(#) $Id$ */
7
8#define ZLIB_INTERNAL
9#include "wattcp.h"
10#include "zlib.h"
11
12#if defined(USE_GZIP)
13
14/* ===========================================================================
15 Decompresses the source buffer into the destination buffer. sourceLen is
16 the byte length of the source buffer. Upon entry, destLen is the total
17 size of the destination buffer, which must be large enough to hold the
18 entire uncompressed data. (The size of the uncompressed data must have
19 been saved previously by the compressor and transmitted to the decompressor
20 by some mechanism outside the scope of this compression library.)
21 Upon exit, destLen is the actual size of the compressed buffer.
22 This function can be used to decompress a whole file at once if the
23 input file is mmap'ed.
24
25 uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
26 enough memory, Z_BUF_ERROR if there was not enough room in the output
27 buffer, or Z_DATA_ERROR if the input data was corrupted.
28*/
29int ZEXPORT uncompress (Bytef *dest,
30 uLongf *destLen,
31 const Bytef *source,
32 uLong sourceLen)
33{
34 z_stream stream;
35 int err;
36
37 stream.next_in = (Bytef*)source;
38 stream.avail_in = (uInt)sourceLen;
39 /* Check for source > 64K on 16-bit machine: */
40 if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
41
42 stream.next_out = dest;
43 stream.avail_out = (uInt)*destLen;
44 if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
45
46 stream.zalloc = (alloc_func)0;
47 stream.zfree = (free_func)0;
48
49 err = inflateInit(&stream);
50 if (err != Z_OK) return err;
51
52 err = inflate(&stream, Z_FINISH);
53 if (err != Z_STREAM_END) {
54 inflateEnd(&stream);
55 if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
56 return Z_DATA_ERROR;
57 return err;
58 }
59 *destLen = stream.total_out;
60
61 err = inflateEnd(&stream);
62 return err;
63}
64#endif /* USE_GZIP */
65
z_stream_s
Definition: zlib.h:84
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/zutil.c Source File

  • src
zutil.c
1/* zutil.c -- target dependent utility functions for the compression library
2 * Copyright (C) 1995-2003 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* @(#) $Id$ */
7
8#include "wattcp.h"
9#include "zutil.h"
10
11#if defined(USE_GZIP)
12
13#ifndef NO_DUMMY_DECL
14struct internal_state { int dummy; }; /* for buggy compilers */
15#endif
16
17const char * const z_errmsg[10] = {
18"need dictionary", /* Z_NEED_DICT 2 */
19"stream end", /* Z_STREAM_END 1 */
20"", /* Z_OK 0 */
21"file error", /* Z_ERRNO (-1) */
22"stream error", /* Z_STREAM_ERROR (-2) */
23"data error", /* Z_DATA_ERROR (-3) */
24"insufficient memory", /* Z_MEM_ERROR (-4) */
25"buffer error", /* Z_BUF_ERROR (-5) */
26"incompatible version",/* Z_VERSION_ERROR (-6) */
27""};
28
29
30const char * ZEXPORT zlibVersion (void)
31{
32 return ZLIB_VERSION;
33}
34
35uLong ZEXPORT zlibCompileFlags (void)
36{
37 uLong flags;
38
39 flags = 0;
40 switch (sizeof(uInt)) {
41 case 2: break;
42 case 4: flags += 1; break;
43 case 8: flags += 2; break;
44 default: flags += 3;
45 }
46 switch (sizeof(uLong)) {
47 case 2: break;
48 case 4: flags += 1 << 2; break;
49 case 8: flags += 2 << 2; break;
50 default: flags += 3 << 2;
51 }
52 switch (sizeof(voidpf)) {
53 case 2: break;
54 case 4: flags += 1 << 4; break;
55 case 8: flags += 2 << 4; break;
56 default: flags += 3 << 4;
57 }
58 switch (sizeof(z_off_t)) {
59 case 2: break;
60 case 4: flags += 1 << 6; break;
61 case 8: flags += 2 << 6; break;
62 default: flags += 3 << 6;
63 }
64#ifdef DEBUG
65 flags += 1 << 8;
66#endif
67#if defined(ASMV) || defined(ASMINF)
68 flags += 1 << 9;
69#endif
70#ifdef ZLIB_WINAPI
71 flags += 1 << 10;
72#endif
73#ifdef BUILDFIXED
74 flags += 1 << 12;
75#endif
76#ifdef DYNAMIC_CRC_TABLE
77 flags += 1 << 13;
78#endif
79#ifdef NO_GZCOMPRESS
80 flags += 1 << 16;
81#endif
82#ifdef NO_GZIP
83 flags += 1 << 17;
84#endif
85#ifdef PKZIP_BUG_WORKAROUND
86 flags += 1 << 20;
87#endif
88#ifdef FASTEST
89 flags += 1 << 21;
90#endif
91
92#ifdef NO_vsnprintf
93 flags += 1 << 25;
94# ifdef HAS_vsprintf_void
95 flags += 1 << 26;
96# endif
97#else
98# ifdef HAS_vsnprintf_void
99 flags += 1 << 26;
100# endif
101#endif
102
103 return flags;
104}
105
106#ifdef DEBUG
107
108# ifndef verbose
109# define verbose 0
110# endif
111int z_verbose = verbose;
112
113void z_error (char *m)
114{
115 fprintf(stderr, "%s\n", m);
116 exit(1);
117}
118#endif
119
120/* exported to allow conversion of error code to string for compress() and
121 * uncompress()
122 */
123const char * ZEXPORT zError (int err)
124{
125 return ERR_MSG (err);
126}
127
128#if defined(_WIN32_WCE)
129 /* does not exist on WCE */
130 int errno = 0;
131#endif
132
133#ifndef HAVE_MEMCPY
134
135void zmemcpy (Bytef* dest, const Bytef* source, uInt len)
136{
137 if (len == 0)
138 return;
139 do {
140 *dest++ = *source++; /* ??? to be unrolled */
141 } while (--len != 0);
142}
143
144int zmemcmp (const Bytef* s1, const Bytef* s2, uInt len)
145{
146 uInt j;
147
148 for (j = 0; j < len; j++) {
149 if (s1[j] != s2[j])
150 return (2 * (s1[j] > s2[j]) - 1);
151 }
152 return 0;
153}
154
155void zmemzero (Bytef* dest, uInt len)
156{
157 if (len == 0)
158 return;
159 do {
160 *dest++ = 0; /* ??? to be unrolled */
161 } while (--len != 0);
162}
163#endif
164
165
166#ifdef SYS16BIT
167
168#ifdef __TURBOC__
169/* Turbo C in 16-bit mode */
170
171# define MY_ZCALLOC
172
173/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
174 * and farmalloc(64K) returns a pointer with an offset of 8, so we
175 * must fix the pointer. Warning: the pointer must be put back to its
176 * original form in order to free it, use zcfree().
177 */
178
179#define MAX_PTR 10
180/* 10*64K = 640K */
181
182local int next_ptr = 0;
183
184typedef struct ptr_table_s {
185 voidpf org_ptr;
186 voidpf new_ptr;
187} ptr_table;
188
189local ptr_table table[MAX_PTR];
190
191/* This table is used to remember the original form of pointers
192 * to large buffers (64K). Such pointers are normalized with a zero offset.
193 * Since MSDOS is not a preemptive multitasking OS, this table is not
194 * protected from concurrent access. This hack doesn't work anyway on
195 * a protected system like OS/2. Use Microsoft C instead.
196 */
197
198voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
199{
200 voidpf buf = opaque; /* just to make some compilers happy */
201 ulg bsize = (ulg)items*size;
202
203 /* If we allocate less than 65520 bytes, we assume that farmalloc
204 * will return a usable pointer which doesn't have to be normalized.
205 */
206 if (bsize < 65520L) {
207 buf = farmalloc(bsize);
208 if (*(ush*)&buf != 0) return buf;
209 } else {
210 buf = farmalloc(bsize + 16L);
211 }
212 if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
213 table[next_ptr].org_ptr = buf;
214
215 /* Normalize the pointer to seg:0 */
216 *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
217 *(ush*)&buf = 0;
218 table[next_ptr++].new_ptr = buf;
219 return buf;
220}
221
222void zcfree (voidpf opaque, voidpf ptr)
223{
224 int n;
225 if (*(ush*)&ptr != 0) { /* object < 64K */
226 farfree(ptr);
227 return;
228 }
229 /* Find the original pointer */
230 for (n = 0; n < next_ptr; n++) {
231 if (ptr != table[n].new_ptr) continue;
232
233 farfree(table[n].org_ptr);
234 while (++n < next_ptr) {
235 table[n-1] = table[n];
236 }
237 next_ptr--;
238 return;
239 }
240 ptr = opaque; /* just to make some compilers happy */
241 Assert(0, "zcfree: ptr not found");
242}
243
244#endif /* __TURBOC__ */
245
246
247#ifdef M_I86
248/* Microsoft C in 16-bit mode */
249
250# define MY_ZCALLOC
251
252#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
253# define _halloc halloc
254# define _hfree hfree
255#endif
256
257voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
258{
259 if (opaque) opaque = 0; /* to make compiler happy */
260 return _halloc((long)items, size);
261}
262
263void zcfree (voidpf opaque, voidpf ptr)
264{
265 if (opaque) opaque = 0; /* to make compiler happy */
266 _hfree(ptr);
267}
268
269#endif /* M_I86 */
270
271#endif /* SYS16BIT */
272
273
274#ifndef MY_ZCALLOC /* Any system without a special alloc function */
275
276voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
277{
278 if (opaque)
279 items += size - size; /* make compiler happy */
280 return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
281 (voidpf)calloc(items, size);
282}
283
284void zcfree (voidpf opaque, voidpf ptr)
285{
286 free(ptr);
287 if (opaque)
288 return; /* make compiler happy */
289}
290#endif /* MY_ZCALLOC */
291#endif /* USE_GZIP */
292
internal_state
Definition: zdeflate.h:90
ptr_table_s
Definition: zutil.c:184
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/zutil.h Source File

  • src
zutil.h
1/* zutil.h -- internal interface and configuration of the compression library
2 * Copyright (C) 1995-2003 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* WARNING: this file should *not* be used by applications. It is
7 part of the implementation of the compression library and is
8 subject to change. Applications should only use zlib.h.
9 */
10
11/* @(#) $Id$ */
12
13#ifndef ZUTIL_H
14#define ZUTIL_H
15
16#define ZLIB_INTERNAL
17#include "zlib.h"
18
19#include <stddef.h>
20#include <string.h>
21#include <stdlib.h>
22
23#ifdef NO_ERRNO_H
24 extern int errno;
25#else
26# include <errno.h>
27#endif
28
29#ifndef local
30# define local static
31#endif
32/* compile with -Dlocal if your debugger can't find static symbols */
33
34typedef unsigned char uch;
35typedef uch FAR uchf;
36typedef unsigned short ush;
37typedef ush FAR ushf;
38typedef unsigned long ulg;
39
40extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
41/* (size given to avoid silly warnings with Visual C++) */
42
43#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
44
45#define ERR_RETURN(strm,err) \
46 return (strm->msg = (char*)ERR_MSG(err), (err))
47/* To be used only when the state is known to be valid */
48
49 /* common constants */
50
51#ifndef DEF_WBITS
52# define DEF_WBITS MAX_WBITS
53#endif
54/* default windowBits for decompression. MAX_WBITS is for compression only */
55
56#if MAX_MEM_LEVEL >= 8
57# define DEF_MEM_LEVEL 8
58#else
59# define DEF_MEM_LEVEL MAX_MEM_LEVEL
60#endif
61/* default memLevel */
62
63#define STORED_BLOCK 0
64#define STATIC_TREES 1
65#define DYN_TREES 2
66/* The three kinds of block type */
67
68#define MIN_MATCH 3
69#define MAX_MATCH 258
70/* The minimum and maximum match lengths */
71
72#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
73
74 /* target dependencies */
75
76#if defined(MSDOS) || (defined(WINDOWS) && !defined(_WIN32))
77# define OS_CODE 0x00
78# if defined(__TURBOC__) || defined(__BORLANDC__)
79# if defined(__LARGE__) || defined(__COMPACT__)
80 /* Allow compilation with ANSI keywords only enabled */
81 void _Cdecl farfree( void *block );
82 void *_Cdecl farmalloc( unsigned long nbytes );
83# else
84# include <alloc.h>
85# endif
86# else /* MSC or DJGPP */
87# include <malloc.h>
88# endif
89#endif
90
91#ifdef AMIGA
92# define OS_CODE 0x01
93#endif
94
95#if defined(VAXC) || defined(VMS)
96# define OS_CODE 0x02
97# define F_OPEN(name, mode) \
98 fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
99#endif
100
101#if defined(ATARI) || defined(atarist)
102# define OS_CODE 0x05
103#endif
104
105#ifdef OS2
106# define OS_CODE 0x06
107#endif
108
109#if defined(MACOS) || defined(TARGET_OS_MAC)
110# define OS_CODE 0x07
111# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
112# include <unix.h> /* for fdopen */
113# else
114# ifndef fdopen
115# define fdopen(fd,mode) NULL /* No fdopen() */
116# endif
117# endif
118#endif
119
120#ifdef TOPS20
121# define OS_CODE 0x0a
122#endif
123
124#ifdef _WIN32
125# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */
126# define OS_CODE 0x0b
127# endif
128#endif
129
130#ifdef __50SERIES /* Prime/PRIMOS */
131# define OS_CODE 0x0f
132#endif
133
134#if defined(_BEOS_) || defined(RISCOS)
135# define fdopen(fd,mode) NULL /* No fdopen() */
136#endif
137
138#if (defined(_MSC_VER) && (_MSC_VER > 600))
139# if defined(_WIN32_WCE)
140# define fdopen(fd,mode) NULL /* No fdopen() */
141# ifndef _PTRDIFF_T_DEFINED
142 typedef int ptrdiff_t;
143# define _PTRDIFF_T_DEFINED
144# endif
145# else
146# define fdopen(fd,type) _fdopen(fd,type)
147# endif
148#endif
149
150 /* common defaults */
151
152#ifndef OS_CODE
153# define OS_CODE 0x03 /* assume Unix */
154#endif
155
156#ifndef F_OPEN
157# define F_OPEN(name, mode) fopen((name), (mode))
158#endif
159
160 /* functions */
161
162#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
163# ifndef HAVE_VSNPRINTF
164# define HAVE_VSNPRINTF
165# endif
166#endif
167
168#if defined(__CYGWIN__)
169# ifndef HAVE_VSNPRINTF
170# define HAVE_VSNPRINTF
171# endif
172#endif
173
174#ifndef HAVE_VSNPRINTF
175# ifdef MSDOS
176 /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
177 but for now we just assume it doesn't. */
178# define NO_vsnprintf
179# endif
180# ifdef __TURBOC__
181# define NO_vsnprintf
182# endif
183# ifdef _WIN32
184 /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
185# if !defined(vsnprintf) && !defined(NO_vsnprintf)
186# define vsnprintf _vsnprintf
187# endif
188# endif
189# ifdef __SASC
190# define NO_vsnprintf
191# endif
192#endif
193
194#ifdef HAVE_STRERROR
195 extern char *strerror (int);
196# define zstrerror(errnum) strerror(errnum)
197#else
198# define zstrerror(errnum) ""
199#endif
200
201#if defined(pyr)
202# define NO_MEMCPY
203#endif
204#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
205 /* Use our own functions for small and medium model with MSC <= 5.0.
206 * You may have to use the same strategy for Borland C (untested).
207 * The __SC__ check is for Symantec.
208 */
209# define NO_MEMCPY
210#endif
211
212#if !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
213# define HAVE_MEMCPY
214#endif
215
216#ifdef HAVE_MEMCPY
217# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
218# define zmemcpy _fmemcpy
219# define zmemcmp _fmemcmp
220# define zmemzero(dest, len) _fmemset(dest, 0, len)
221# else
222# define zmemcpy memcpy
223# define zmemcmp memcmp
224# define zmemzero(dest, len) memset(dest, 0, len)
225# endif
226#else
227 extern void zmemcpy (Bytef* dest, const Bytef* source, uInt len);
228 extern int zmemcmp (const Bytef* s1, const Bytef* s2, uInt len);
229 extern void zmemzero (Bytef* dest, uInt len);
230#endif
231
232/* Diagnostic functions */
233#ifdef DEBUG
234# include <stdio.h>
235 extern int z_verbose;
236 extern void z_error (char *m);
237# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
238# define Trace(x) {if (z_verbose>=0) fprintf x ;}
239# define Tracev(x) {if (z_verbose>0) fprintf x ;}
240# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
241# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
242# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
243#else
244# define Assert(cond,msg)
245# define Trace(x)
246# define Tracev(x)
247# define Tracevv(x)
248# define Tracec(c,x)
249# define Tracecv(c,x)
250#endif
251
252
253voidpf zcalloc (voidpf opaque, unsigned items, unsigned size);
254void zcfree (voidpf opaque, voidpf ptr);
255
256#define ZALLOC(strm, items, size) \
257 (*((strm)->zalloc))((strm)->opaque, (items), (size))
258#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
259#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
260
261#endif /* ZUTIL_H */
errno.h
strerror
char *MS_CDECL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- _ -

  • __eth_release() : pcsed.c
  • __get_sock_from_s() : socket.c, socket.h
  • _arp_add_gateway() : pcarp.c, pcarp.h
  • _arp_cache_add() : pcarp.c, pcarp.h
  • _arp_cache_del() : pcarp.c, pcarp.h
  • _arp_cache_get() : pcarp.c, pcarp.h
  • _arp_check_gateways() : pcarp.c, pcarp.h
  • _arp_check_own_ip() : pcarp.c, pcarp.h
  • _arp_debug_dump() : pcarp.c, pcarp.h
  • _arp_gateways_get() : pcarp.c, pcarp.h
  • _arp_handler() : pcarp.c, pcarp.h
  • _arp_have_default_gw() : pcarp.c, pcarp.h
  • _arp_init() : pcarp.c, pcarp.h
  • _arp_kill_gateways() : pcarp.c, pcarp.h
  • _arp_lookup() : pcarp.c, pcarp.h
  • _arp_lookup_fixed() : pcarp.c, pcarp.h
  • _arp_lookup_pending() : pcarp.c, pcarp.h
  • _arp_register() : pcarp.c, pcarp.h
  • _arp_reply() : pcarp.c, pcarp.h
  • _arp_resolve() : pcarp.c, pcarp.h, tcp.h
  • _arp_start_lookup() : pcarp.c, pcarp.h
  • _bootp_on : sock_ini.c, sock_ini.h
  • _chk_ping() : pcping.c, tcp.h
  • _default_tos : ip4_out.c, ip4_out.h
  • _default_ttl : ip4_out.c, ip4_out.h
  • _dhcp6_on : sock_ini.c, sock_ini.h
  • _dhcp_on : sock_ini.c, sock_ini.h
  • _do_mask_req : sock_ini.c, sock_ini.h
  • _dx_real_alloc() : x32vm.c, x32vm.h
  • _eth_addr : pcsed.c, pcsed.h
  • _eth_arrived() : pcsed.c, tcp.h
  • _eth_brdcast : pcsed.c, pcsed.h
  • _eth_formatpacket() : pcsed.c, tcp.h
  • _eth_free() : pcsed.c, tcp.h
  • _eth_get_hwtype() : pcsed.c, tcp.h
  • _eth_init() : pcsed.c, tcp.h
  • _eth_is_init : pcsed.c
  • _eth_join_mcast_group() : pcsed.c, pcsed.h
  • _eth_last : pcsed.c, pcsed.h
  • _eth_leave_mcast_group() : pcsed.c, pcsed.h
  • _eth_loop_addr : pcsed.c, pcsed.h
  • _eth_mac_dst() : pcsed.c, pcsed.h
  • _eth_mac_hdr() : pcsed.c, pcsed.h
  • _eth_mac_len : pcsed.c, pcsed.h
  • _eth_mac_src() : pcsed.c, pcsed.h
  • _eth_mac_typ() : pcsed.c, pcsed.h
  • _eth_ndis3pkt : pcsed.c, pcsed.h
  • _eth_real_addr : pcsed.c, pcsed.h
  • _eth_recv_hook() : pcsed.c
  • _eth_release() : pcsed.c, tcp.h
  • _eth_send() : pcsed.c, tcp.h
  • _eth_set_addr() : pcsed.c, tcp.h
  • _eth_SwsVpkt : pcsed.c
  • _eth_wanpacket : pcsed.c
  • _eth_win10pcap : pcsed.c
  • _eth_winpcap : pcsed.c
  • _get_ip4_id() : ip4_out.c, ip4_out.h
  • _get_machine_name() : bsdname.c, bsdname.h
  • _get_this_ip4_id() : ip4_out.c, ip4_out.h
  • _gethostid() : bsdname.c, tcp.h
  • _gethostid6() : bsdname.c, bsdname.h
  • _getpeername() : bsdname.c, tcp.h
  • _getsockname() : bsdname.c, tcp.h
  • _inet6_addr() : netaddr.c, netaddr.h
  • _inet6_ntoa() : netaddr.c, netaddr.h
  • _inet_addr() : netaddr.c, tcp.h
  • _inet_atoeth() : netaddr.c, netaddr.h
  • _inet_ntoa() : netaddr.c, tcp.h
  • _ip4_dont_frag : ip4_out.c, ip4_out.h
  • _ip4_handler() : ip4_in.c, ip4_in.h
  • _ip4_id_increment : ip4_out.c, ip4_out.h
  • _ip4_output() : ip4_out.c, ip4_out.h
  • _ip4_send_fragments() : ip4_out.c, ip4_out.h
  • _ip6_checksum() : chksum.c, chksum.h
  • _ip6_output() : ip6_out.c, ip6_out.h
  • _ip6_tcp_checksum() : chksum.c, chksum.h
  • _ip6_udp_checksum() : chksum.c, chksum.h
  • _ip_recursion : pcsed.c, pcsed.h
  • _list_lookup() : winadinf.c
  • _ping() : pcping.c, tcp.h
  • _pkt_errno : pcpkt.c, pcpkt.h
  • _pkt_forced_rxmode : pcpkt.h, winpkt.c
  • _pkt_inf : pcpkt.c, pcpkt.h, winpkt.c, winpkt.h
  • _pkt_ip_ofs : pcpkt.c, pcpkt.h
  • _pkt_rxmode : pcpkt.c, pcpkt.h, winpkt.c
  • _pkt_rxmode0 : pcpkt.c, pcpkt.h, winpkt.c
  • _pkt_type_ofs : pcpkt.c
  • _pktdevclass : pcpkt.c, pcpkt.h
  • _pktdevlevel : pcpkt.c, pcpkt.h
  • _pktdrvrname : pcpkt.h
  • _pktserial : pcpkt.c, pcpkt.h
  • _printk_file : printk.c, printk.h
  • _printk_safe : printk.c, printk.h
  • _rarp_handler() : pcrarp.c, pcrarp.h
  • _rarp_on : sock_ini.c, sock_ini.h
  • _sarp_debug_dump() : pcsarp.c
  • _sethostid() : bsdname.c, tcp.h
  • _sethostid6() : bsdname.c, bsdname.h
  • _sock_append() : accept.c, socket.h
  • _sock_calloc() : socket.c, socket.h
  • _sock_chk_sockaddr() : socket.c, socket.h
  • _sock_crit_start() : socket.c, socket.h
  • _sock_crit_stop() : socket.c, socket.h
  • _sock_del_fd() : socket.c, socket.h
  • _sock_dos_fd() : socket.c, socket.h
  • _sock_free_rcv_buf() : socket.c, socket.h
  • _sock_half_open() : socket.c, socket.h
  • _sock_pending_connect() : socket.c, socket.h
  • _sock_set_rcv_buf() : socket.c, socket.h
  • _socklist_find() : socket.c, socket.h
  • _strlcpy() : misc_str.c, misc_str.h
  • _TCP6_listen() : socket.c, socket.h
  • _TCP6_open() : socket.c, socket.h
  • _tcp_abort() : pctcp.c, pctcp.h
  • _tcp_allsocs : pctcp.c, pctcp.h
  • _tcp_cancel() : pctcp.c, pctcp.h
  • _tcp_close() : pctcp.c, pctcp.h
  • _tcp_handler() : pctcp.c, pctcp.h
  • _TCP_open() : socket.c, socket.h
  • _tcp_sendsoon() : pctcp.c, pctcp.h
  • _tcp_unthread() : pctcp.c, pctcp.h
  • _UDP6_listen() : socket.c, socket.h
  • _UDP6_open() : socket.c, socket.h
  • _udp_allsocs : pctcp.c, pctcp.h
  • _udp_cancel() : pctcp.c, pctcp.h
  • _udp_handler() : pctcp.c, pctcp.h
  • _udp_listen() : pctcp.c, pctcp.h
  • _UDP_open() : socket.c, socket.h
  • _udp_open() : pctcp.c, pctcp.h
  • _w32_get_rdtsc() : timer.c
  • _w32_intel() : misc.c, winadinf.c, swap.h
  • _w32_intel16() : misc.c, winadinf.c, swap.h
  • _w32_intr() : misc.c
  • _w_watt_optarg : getopt.c, tcp.h
  • _watt_assert_buf : misc.c, misc.h
  • _watt_cbroke : misc.h, pc_cbrk.c, tcp.h
  • _watt_crtdbg_check : misc.c, misc.h
  • _watt_do_exit : sock_ini.c
  • _watt_fatal_error : misc.c, misc.h
  • _watt_handle_cbreak : misc.h, pc_cbrk.c, tcp.h
  • _watt_is_init : sock_ini.c, sock_ini.h
  • _watt_is_win9x : misc.h, winmisc.c
  • _watt_is_wow64 : winmisc.c
  • _watt_no_config : sock_ini.c
  • _watt_os_ver : misc.c, misc.h
  • _watt_user_config() : sock_ini.c, tcp.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- a -

  • accept() : accept.c
  • add_ping() : pcping.c, tcp.h
  • addr_mask_id : pcicmp.c
  • afd_list_init() : get_ai.c
  • arcnet_mac_format() : pcsed.c
  • ARG_ATOB : tcp.h
  • ARG_ATOI : tcp.h
  • ARG_ATOIP : tcp.h
  • ARG_ATOW : tcp.h
  • ARG_ATOX_B : tcp.h
  • ARG_ATOX_D : tcp.h
  • ARG_ATOX_W : tcp.h
  • ARG_FUNC : tcp.h
  • ARG_RESOLVE : tcp.h
  • ARG_STRCPY : tcp.h
  • ARG_STRDUP : tcp.h
  • arp_check_common() : pcarp.c
  • arp_check_timeouts() : pcarp.c
  • arp_daemon() : pcarp.c
  • arp_move_entry() : pcarp.c
  • arp_send() : pcarp.c
  • arp_send_request() : pcarp.c
  • assert_fail() : misc.c, misc.h
  • aton() : netaddr.c, tcp.h
  • aton_dotless() : netaddr.c, tcp.h
  • atox() : misc_str.c, misc_str.h
  • ax25_Header : pcsed.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- b -

  • bind() : bind.c, socket.h
  • block_icmp : pctcp.c
  • block_ip : pctcp.c
  • block_tcp : pctcp.c
  • block_udp : pctcp.c
  • BOOTP_do_boot() : pcbootp.c, pcbootp.h
  • build_pad() : pppoe.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- c -

  • called_from_resolve : pcdns.c, pcdns.h
  • change_ip_addr() : pcdhcp.c
  • check_errno_version() : socket.c
  • check_intr_num() : pcpkt.c
  • chk_timeout() : timer.c, tcp.h
  • chkip_method() : dynip.c
  • client_error() : pcdns.c
  • clockbits() : timer.c, timer.h
  • clocks_per_usec : timer.c
  • CloseHostFile() : get_xby.h, gethost.c
  • cmp_timers() : timer.c, tcp.h
  • compare() : pcarp.c, pcping.c
  • config_tab_types : tcp.h
  • crtdbg_exit() : misc.c
  • cstate_dseg : pcpkt.c
  • ctime_r() : misc.c, misc.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- d -

  • dbg_mode_all : pcdbug.c, pcdbug.h
  • dbug_exit() : pcdbug.c
  • defaultdomain : pcdns.c
  • DHCP_arp_check() : pcdhcp.c
  • DHCP_cfg_hook() : pcdhcp.c
  • DHCP_discover() : pcdhcp.c
  • DHCP_do_boot() : pcdhcp.c
  • DHCP_exit() : pcdhcp.c
  • dhcp_fsm() : pcdhcp.c
  • DHCP_get_server() : pcdhcp.c, tcp.h
  • DHCP_init() : pcdhcp.c, pcdhcp.h
  • DHCP_is_ack() : pcdhcp.c
  • DHCP_is_nack() : pcdhcp.c
  • DHCP_offer() : pcdhcp.c
  • dhcp_open() : pcdhcp.c
  • dhcp_options_add() : pcdhcp.c
  • DHCP_read_config() : pcdhcp.c, tcp.h
  • DHCP_release() : pcdhcp.c, tcp.h
  • DHCP_release_decline() : pcdhcp.c
  • DHCP_request() : pcdhcp.c
  • DHCP_set_config_func() : pcdhcp.c, tcp.h
  • dhcp_set_timers() : pcdhcp.c
  • DHCP_state_BOUND() : pcdhcp.c
  • DHCP_state_INIT() : pcdhcp.c
  • DHCP_state_REBINDING() : pcdhcp.c
  • DHCP_state_REBOOTING() : pcdhcp.c
  • DHCP_state_RENEWING() : pcdhcp.c
  • DHCP_state_REQUESTING() : pcdhcp.c
  • DHCP_state_SELECTING() : pcdhcp.c
  • do_exit() : sock_ini.c
  • do_include_file() : pcconfig.c
  • do_keepalive() : socket.c
  • dom_strerror() : pcdns.c, tcp.h
  • dump_data() : winadinf.c
  • dword_str() : misc.c, misc.h
  • dword_string() : winadinf.c
  • dyndns_params() : dynip.c
  • dynip_config() : dynip.c
  • dynip_exit() : dynip.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- e -

  • echo_discard_exit() : echo.c
  • echo_discard_init() : echo.c, echo.h
  • elapsed_str() : timer.c, timer.h
  • erase_config() : pcdhcp.c
  • eth_ifnet() : ioctl.c
  • eth_mac_format() : pcsed.c
  • eth_mac_xmit() : pcsed.c
  • eval_timers() : pcdhcp.c
  • exc_app_start : wdpmi.c
  • exc_select() : select.c
  • except_handler() : sock_ini.c
  • exit_localport() : ports.c
  • expand_var_str() : pcconfig.c, pcconfig.h
  • extract_cname() : pcdns.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- f -

  • fc_readbyte() : pcconfig.c, pcconfig.h
  • fcntlsocket() : fcntl.c, socket.h
  • fddi_mac_format() : pcsed.c
  • find_adapter() : winpkt.c
  • find_free_raw_sock() : socket.c
  • find_winpcap_adapter() : winpkt.c
  • fix_llc_head() : pcsed.c
  • fopen_excl() : misc.c, misc.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- g -

  • GET_ADDRESSES() : winadinf.c
  • get_argv0() : pcconfig.c, pcconfig.h
  • get_cpu_speed() : timer.c, timer.h
  • get_day_num() : misc.c, misc.h
  • get_file_version() : misc.h, winmisc.c
  • get_header() : dynip.c
  • get_if_type_swsvpkt() : winpkt.c
  • get_phys_address() : winadinf.c
  • get_pkt_type_eth() : socket.c
  • get_rmode_data() : pcpkt.c
  • get_sol_opt() : sockopt.c
  • get_timediff() : timer.c, tcp.h
  • get_url() : dynip.c
  • getdomainname() : bsdname.c, socket.h
  • gethostbyaddr6_internal() : gethost6.c
  • gethostbyaddr_internal() : gethost.c
  • gethostbyname_internal() : gethost.c
  • gethostent() : gethost.c, netdb.h
  • gethostid() : bsdname.c, tcp.h, socket.h
  • GetHostsFile() : get_xby.h, gethost.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- h -

  • has_8254 : timer.c, timer.h
  • has_rdtsc : timer.c
  • hires_timer() : timer.c, timer.h, tcp.h
  • hms_str() : timer.c, timer.h
  • hostname : pctcp.c, pctcp.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- i -

  • icmp4_dump() : pcdbug.c
  • icmp6_neigh_solic() : pcicmp6.c, pcicmp6.h
  • icmp_bogus() : pcicmp.c
  • icmp_check() : pcicmp.c
  • icmp_doredirect() : pcicmp.c, pcicmp.h
  • icmp_handler() : pcicmp.c, pcicmp.h
  • icmp_id : pcarp.c
  • icmp_loopback() : loopback.c
  • icmp_redirect() : pcicmp.c
  • icmp_send() : pcicmp.c
  • icmp_send_timexceed() : pcicmp.c, pcicmp.h
  • icmp_send_unreach() : pcicmp.c, pcicmp.h
  • iconv_init() : idna.h
  • iconv_strerror() : idna.h
  • IDNA_convert_from_ACE() : idna.h
  • IDNA_convert_to_ACE() : idna.h
  • iface_ioctrl() : ioctl.c
  • in_checksum() : chksum.c, tcp.h
  • inet_lnaof() : netaddr.c, inet.h
  • inet_makeaddr() : netaddr.c, inet.h
  • inet_netof() : netaddr.c, inet.h
  • inet_ntop() : presaddr.c, inet.h
  • inet_ntop4() : presaddr.c
  • inet_ntop6() : presaddr.c
  • inet_pton() : presaddr.c, inet.h
  • inet_pton4() : presaddr.c
  • inet_pton6() : presaddr.c
  • init_frag() : ip4_frag.c
  • init_localport() : pctcp.h, ports.c
  • init_misc() : misc.c, tcp.h
  • init_sockets() : socket.c
  • init_timers() : timer.c, timer.h
  • init_userSuppliedTimerTick() : timer.c, tcp.h
  • int64 : wattcp.h
  • inuse : socket.c
  • ip4_transmit() : transmit.c
  • ip6_transmit() : transmit.c
  • is_known_host() : pcsarp.c
  • is_on_LAN() : pcarp.c
  • is_secure_host() : pcsarp.c
  • is_watt32_func() : highc.c
  • isaddr() : netaddr.c, tcp.h
  • isaddr_dotless() : netaddr.c, tcp.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- k -

  • keyword_not_found() : pcconfig.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- l -

  • LAN_lookup() : pcarp.c
  • LAN_lookup_pending() : pcarp.c
  • LAN_start_lookup() : pcarp.c
  • lcp_echo_intv : pppoe.c
  • legal_recv_mode() : winpkt.c
  • link_Packet : pcsed.h
  • list_lookup() : misc.c, misc.h
  • localtime_r() : misc.c, misc.h
  • lookup_domain() : pcdns.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- m -

  • MAC_address() : misc.c, misc.h
  • mac_tx_format : pcsed.c
  • main() : echo.c
  • make_boot_header() : pcdhcp.c
  • match_ip6_dest() : pcdbug.c
  • mcast_set : socket.c
  • millisec_clock() : timer.c, timer.h
  • mtu_blackhole : pctcp.c, pctcp.h
  • mtu_discover : pctcp.c, pctcp.h
  • my_ip_addr : pctcp.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- n -

  • netdb_init() : pcconfig.c, pcconfig.h
  • new_abort_handler() : winmisc.c
  • new_int_8() : timer.c
  • next_domain() : pcdns.c
  • null_mac_format() : pcsed.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- o -

  • ods_printf() : bsddbug.c
  • old_break : sock_ini.c
  • open_npcap_adapter() : winpkt.c
  • open_swsvpkt_adapter() : winpkt.c
  • open_wanpacket_adapter() : winpkt.c
  • open_win10pcap_adapter() : winpkt.c
  • open_winpcap_adapter() : winpkt.c
  • other_raw_socks() : socket.c
  • other_tcp_listeners() : socket.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- p -

  • pack_domain() : pcdns.c
  • parse_config_pass_1() : pcpkt.c, winpkt.c
  • parse_config_table() : pcconfig.c, tcp.h
  • parse_dyndns_response() : dynip.c
  • parse_myip_address() : dynip.c
  • period() : pcdhcp.c
  • pkt16_drvr_init() : pcpkt.c
  • pkt_api_entry() : pcpkt.c
  • pkt_buf_wipe() : pcpkt.c, winpkt.c, tcp.h
  • pkt_dropped() : pcpkt.c, winpkt.c, tcp.h
  • pkt_drvr_info() : pcpkt.c
  • pkt_enqueue() : pcpkt.c
  • pkt_error : pcpkt.c
  • pkt_eth_init() : pcpkt.c, winpkt.c, tcp.h
  • pkt_free_pkt() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_addr() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_api_ver() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_drvr_ver() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_mac_len() : pcpkt.c
  • pkt_get_mtu() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_multicast_list() : pcpkt.c, pcpkt.h, winpkt.c, winpkt.h
  • pkt_get_params() : pcpkt.c, tcp.h
  • pkt_get_rcv_mode() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_stats() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_vector() : pcpkt.c, tcp.h
  • pkt_release() : pcpkt.c, winpkt.c, tcp.h
  • pkt_release_handle() : pcpkt.c
  • pkt_reset_handle() : pcpkt.c, tcp.h
  • pkt_send() : pcpkt.c, winpkt.c, tcp.h
  • pkt_set_access() : pcpkt.c
  • pkt_set_addr() : pcpkt.c, winpkt.c, tcp.h
  • pkt_set_multicast_list() : pcpkt.c, pcpkt.h, winpkt.c, winpkt.h
  • pkt_set_rcv_mode() : pcpkt.c, winpkt.c, tcp.h
  • pkt_strerror() : pcpkt.c, winpkt.c, tcp.h
  • pkt_tx_buf() : pcpkt.c, pcpkt.h
  • pkt_waiting() : pcpkt.c, winpkt.c, tcp.h
  • PmGlueEnd() : x32vm.c
  • poll_recv_queue() : pcsed.c
  • ppp_input() : ppp.c, ppp.h
  • pppoe_discovery() : pppoe.c
  • pppoe_exit() : pppoe.c, pppoe.h
  • pppoe_handler() : pppoe.c, pppoe.h
  • pppoe_Header : pcsed.h
  • pppoe_init() : pppoe.c, pppoe.h
  • pppoe_is_up() : pppoe.c, pppoe.h
  • pppoe_mac_format() : pppoe.c, pppoe.h
  • pppoe_send_disc() : pppoe.c
  • pppoe_send_sess() : pppoe.c, pppoe.h
  • pppoe_start() : pppoe.c, pppoe.h
  • pppoe_wait() : pppoe.c
  • priv_addr() : netaddr.c, tcp.h
  • put_hardware_opt() : pcdhcp.c
  • put_request_list() : pcdhcp.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- q -

  • query_init() : pcdns.c
  • query_init_ip4() : udp_rev.c
  • query_init_ip6() : udp_rev.c
  • qword_str() : misc.c, misc.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- r -

  • Random() : misc.c, tcp.h
  • RandomWait() : misc.c, tcp.h
  • raw6_rx_buf() : sockopt.c
  • raw6_tx_buf() : sockopt.c
  • raw_rx_buf() : sockopt.c
  • raw_tx_buf() : sockopt.c
  • read_response() : pcdns.c
  • ReadEthersFile() : get_xby.h, geteth.c
  • ReceiveModes : pcpkt.h, winpkt.h
  • recv_packet() : tftp.c
  • release_real_mem() : pcpkt.c
  • ReopenHostFile() : get_xby.h, gethost.c
  • res_mkquery() : res_mkqu.c, resolv.h
  • resolve() : pcdns.c, tcp.h
  • resolve_ip() : oldstuff.c, tcp.h
  • reverse_lookup() : udp_rev.c
  • reverse_lookup_myip() : pcdns.h, udp_rev.c
  • rip() : misc_str.c, tcp.h
  • rmcb : x32vm.c
  • route_check_timeouts() : pcarp.c
  • route_lookup() : pcarp.c
  • route_lookup_pending() : pcarp.c
  • route_start_lookup() : pcarp.c
  • RXMODE_ALL_LOCAL : winpkt.h
  • RXMODE_BROADCAST : pcpkt.h, winpkt.h
  • RXMODE_DIRECT : pcpkt.h, winpkt.h
  • RXMODE_MULTICAST1 : pcpkt.h, winpkt.h
  • RXMODE_MULTICAST2 : pcpkt.h, winpkt.h
  • RXMODE_OFF : pcpkt.h, winpkt.h
  • RXMODE_PROMISCOUS : pcpkt.h, winpkt.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- s -

  • sarp_init() : pcsarp.c, pcsarp.h
  • sarp_parse() : pcsarp.c
  • sarp_receive() : pcsarp.c
  • select_s() : select.c, tcp.h
  • send_ack() : tftp.c
  • send_loopback() : pcsed.c
  • send_query() : pcdns.c
  • send_req() : tftp.c
  • server_error() : pcdns.c
  • set_cbreak() : misc.h, pc_cbrk.c
  • set_eaddr() : pcconfig.c
  • set_ethip() : pcconfig.c
  • set_my_ip() : pcdhcp.c
  • set_proto() : socket.c
  • set_request_list() : pcdhcp.c
  • set_timediff() : timer.c, tcp.h
  • set_timeout() : timer.c, tcp.h
  • set_ttimeout() : oldstuff.c, tcp.h
  • set_txmode() : winpkt.c
  • set_user_class() : pcdhcp.c
  • set_utc_offset() : gettod.c, gettod.h
  • set_value() : pcconfig.c
  • set_vend_class() : pcdhcp.c
  • setdomainname() : bsdname.c, socket.h
  • sethostid() : bsdname.c, tcp.h, socket.h
  • sethostname() : bsdname.c
  • setup_info_adapter_print() : winadinf.c
  • setup_pkt_inf() : pcpkt.c
  • setup_sig_handlers() : sock_ini.c
  • shutdown() : shutdown.c, socket.h
  • sig_handler_watt() : misc.h, pc_cbrk.c
  • sign_opt : pctcp.c
  • sin_mask : pctcp.c
  • sk_list_del() : socket.c
  • sk_scope : bsddbug.c
  • sock_daemon() : socket.c
  • sock_dataready() : sock_io.c, tcp.h
  • sock_exit() : sock_ini.c, tcp.h
  • sock_find_fd() : socket.c
  • sock_find_tcp() : socket.c
  • sock_find_udp() : socket.c
  • sock_getcw() : sock_io.c
  • sock_getsw() : sock_io.c
  • sock_init_called : sock_ini.c
  • sock_packet_add() : socket.c
  • sock_packet_receive() : socket.c, socket.h
  • sock_putcw() : sock_io.c
  • sock_puts() : sock_io.c, tcp.h
  • sock_putsw() : sock_io.c
  • sock_raw4_recv() : socket.c
  • sock_raw_add() : socket.c
  • sock_raw_del() : socket.c
  • sock_reduce_mss() : pctcp.c
  • sock_sig_exit() : sock_ini.c, tcp.h
  • sock_sturdy() : oldstuff.c, tcp.h
  • sock_type : wattcp.h
  • socket() : socket.c, socket.h
  • socket_op_demux() : socket.c
  • socketpair() : socket.c
  • socklist_add() : socket.c
  • speed64_string() : winadinf.c
  • speed_string() : winadinf.c
  • split_ip6() : split.c
  • start_day : timer.c
  • start_time : timer.c
  • state_name() : pcdhcp.c
  • std_negotiation() : ppp.c
  • std_write_config() : pcdhcp.c
  • store_alt_address() : pcdns.c
  • store_DHCP_server_MAC() : pcdhcp.c
  • stream_cancel() : socket.c
  • strerror() : neterr.c, werrno.h
  • strltrim() : misc_str.c, misc_str.h
  • strntrimcpy() : misc_str.c, misc_str.h
  • strreplace() : misc_str.c, misc_str.h
  • strrtrim() : misc_str.c, misc_str.h
  • strtrim() : misc_str.c, misc_str.h
  • survive_bootp : sock_ini.c
  • survive_dhcp : sock_ini.c, sock_ini.h, tcp.h
  • survive_eth : sock_ini.c, sock_ini.h, tcp.h
  • survive_rarp : sock_ini.c
  • swsvpkt_callback() : winpkt.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- t -

  • tcp_cbreak() : pc_cbrk.c, tcp.h
  • tcp_cbrk() : oldstuff.c, tcp.h
  • tcp_checksum() : pctcp.c
  • tcp_CLOSE_TO : pctcp.c
  • tcp_do_bootp() : sock_ini.c
  • tcp_established() : pctcp.c, tcp.h
  • tcp_findseq() : pctcp.c
  • tcp_init() : sock_ini.c
  • tcp_inject_config() : pcconfig.c, tcp.h
  • tcp_inject_config_direct() : pcconfig.c
  • tcp_is_init : sock_ini.c
  • tcp_keep_idle : pctcp.c
  • tcp_keep_intvl : pctcp.c
  • tcp_listen() : pctcp.c, tcp.h
  • tcp_max_idle : pctcp.c
  • tcp_MAX_VJSA : pctcp.c
  • tcp_MAX_VJSD : pctcp.c
  • tcp_nagle : pctcp.c, pctcp.h
  • tcp_no_arp() : pctcp.c
  • tcp_open() : pctcp.c, tcp.h
  • tcp_OPEN_TO : pctcp.c
  • tcp_opt_maxsegment() : pctcp.c
  • tcp_opt_timestamp() : pctcp.c
  • tcp_opt_ts : pctcp.c, pctcp.h
  • tcp_post_init() : sock_ini.c
  • tcp_process_data() : tcp_fsm.c
  • tcp_process_options() : tcp_fsm.c
  • tcp_read() : pctcp.c
  • tcp_reassemble() : tcp_fsm.c
  • tcp_receive() : receive.c
  • tcp_recv_win : pctcp.c
  • tcp_RETRAN_TIME : pctcp.c
  • tcp_Retransmitter() : pctcp.c, pctcp.h
  • tcp_RST_TIME : pctcp.c
  • tcp_RTO_ADD : pctcp.c
  • tcp_RTO_BASE : pctcp.c
  • tcp_RTO_SCALE : pctcp.c
  • tcp_rtt_win() : pctcp.c
  • tcp_set_debug_state() : pcconfig.c, tcp.h
  • tcp_set_window() : tcp_fsm.c
  • tcp_shutdown() : sock_ini.c
  • tcp_sock_daemon() : socket.c
  • tcp_sockreset() : pctcp.c
  • tcp_synsent_state() : tcp_fsm.c
  • tcp_tick() : pctcp.c, tcp.h
  • tcp_transmit() : transmit.c
  • tcp_upd_win() : pctcp.c
  • tcp_write() : pctcp.c
  • tftp_boot_load() : tftp.c, tftp.h
  • tftp_close() : tftp.c
  • tftp_exit() : tftp.c
  • tftp_get_block() : tftp.c
  • tftp_init() : tftp.c, tftp.h
  • tftp_open() : tftp.c
  • tftp_set_boot_fname() : tftp.c, tftp.h
  • tftp_set_server() : tftp.c, tftp.h
  • tftp_set_xfer_mode() : tftp.c
  • tftp_strerror() : tftp.c
  • time_str() : timer.c, timer.h
  • timeval_diff() : timer.c, tcp.h
  • tok_ifnet() : ioctl.c
  • tok_mac_format() : pcsed.c
  • transient_cfg : pcdhcp.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- u -

  • udp_callback() : tftp.c
  • udp_checksum() : pctcp.c
  • udp_close() : pctcp.c
  • udp_demux() : pctcp.c
  • udp_handler() : echo.c
  • udp_listen() : pctcp.c
  • udp_loopback() : loopback.c
  • udp_open() : pctcp.c
  • udp_read() : pctcp.c
  • udp_receive() : receive.c
  • udp_SetTTL() : pctcp.c
  • udp_sock_daemon() : socket.c
  • udp_write() : pctcp.c
  • uint64 : wattcp.h
  • unpack_domain() : pcdns.c
  • update_in_stat() : pcstat.c, pcstat.h
  • update_out_stat() : pcstat.c, pcstat.h
  • url_free() : dynip.c
  • url_parse() : dynip.c
  • use_except : sock_ini.c
  • use_rdtsc : timer.c
  • user_name : pppoe.c
  • userTimerTick() : timer.c, tcp.h
  • using_int8 : timer.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- v -

  • vendor_version() : socket.c
  • void() : pcarp.c, pcconfig.c, pcconfig.h, tftp.c, tcp.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- w -

  • w32_cflags2 : version.c
  • W32_CLANG_PACK_WARN_DEF() : pcdhcp.h, pcdns.h, pcicmp.h, pcigmp.c, pctcp.c, tcp.h, socket.h, icmp6.h, ip_var.h, udp_var.h
  • W32_GCC_FUNC_TYPE_WARN_DEF() : echo.c
  • W32_GCC_FUNC_TYPE_WARN_OFF() : echo.c
  • W32_GCC_PRAGMA() : oldstuff.c
  • Wait() : misc.c, misc.h
  • waterm_ioctrl() : ioctl.c
  • watt_filelength() : misc.c, tcp.h
  • watt_kbhit() : misc.c, tcp.h
  • watt_sock_init() : sock_ini.c, tcp.h
  • wattcpBuildCC() : version.c, tcp.h
  • wattcpBuildCCexe() : version.c, tcp.h
  • wattcpCapabilities() : version.c, tcp.h
  • wattcpVersion() : version.c, tcp.h
  • win32_dos_box : misc.c, misc.h
  • win_strerror() : winmisc.c, tcp.h
  • winpcap_recv_thread() : winpkt.c
  • write_config() : pcdhcp.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- _ -

  • __eth_release() : pcsed.c
  • __get_sock_from_s() : socket.c, socket.h
  • _arp_add_gateway() : pcarp.c, pcarp.h
  • _arp_cache_add() : pcarp.c, pcarp.h
  • _arp_cache_del() : pcarp.c, pcarp.h
  • _arp_cache_get() : pcarp.c, pcarp.h
  • _arp_check_gateways() : pcarp.c, pcarp.h
  • _arp_check_own_ip() : pcarp.c, pcarp.h
  • _arp_debug_dump() : pcarp.c, pcarp.h
  • _arp_gateways_get() : pcarp.c, pcarp.h
  • _arp_handler() : pcarp.c, pcarp.h
  • _arp_have_default_gw() : pcarp.c, pcarp.h
  • _arp_init() : pcarp.c, pcarp.h
  • _arp_kill_gateways() : pcarp.c, pcarp.h
  • _arp_lookup() : pcarp.c, pcarp.h
  • _arp_lookup_fixed() : pcarp.c, pcarp.h
  • _arp_lookup_pending() : pcarp.c, pcarp.h
  • _arp_register() : pcarp.c, pcarp.h
  • _arp_reply() : pcarp.c, pcarp.h
  • _arp_resolve() : pcarp.c, pcarp.h, tcp.h
  • _arp_start_lookup() : pcarp.c, pcarp.h
  • _chk_ping() : pcping.c, tcp.h
  • _dx_real_alloc() : x32vm.c, x32vm.h
  • _eth_arrived() : pcsed.c, tcp.h
  • _eth_formatpacket() : pcsed.c, tcp.h
  • _eth_free() : pcsed.c, tcp.h
  • _eth_get_hwtype() : pcsed.c, tcp.h
  • _eth_init() : pcsed.c, tcp.h
  • _eth_join_mcast_group() : pcsed.c, pcsed.h
  • _eth_leave_mcast_group() : pcsed.c, pcsed.h
  • _eth_mac_dst() : pcsed.c, pcsed.h
  • _eth_mac_hdr() : pcsed.c, pcsed.h
  • _eth_mac_src() : pcsed.c, pcsed.h
  • _eth_mac_typ() : pcsed.c, pcsed.h
  • _eth_recv_hook() : pcsed.c
  • _eth_release() : pcsed.c, tcp.h
  • _eth_send() : pcsed.c, tcp.h
  • _eth_set_addr() : pcsed.c, tcp.h
  • _get_ip4_id() : ip4_out.c, ip4_out.h
  • _get_machine_name() : bsdname.c, bsdname.h
  • _get_this_ip4_id() : ip4_out.c, ip4_out.h
  • _gethostid() : bsdname.c, tcp.h
  • _gethostid6() : bsdname.c, bsdname.h
  • _getpeername() : bsdname.c, tcp.h
  • _getsockname() : bsdname.c, tcp.h
  • _inet6_addr() : netaddr.c, netaddr.h
  • _inet6_ntoa() : netaddr.c, netaddr.h
  • _inet_addr() : netaddr.c, tcp.h
  • _inet_atoeth() : netaddr.c, netaddr.h
  • _inet_ntoa() : netaddr.c, tcp.h
  • _ip4_handler() : ip4_in.c, ip4_in.h
  • _ip4_output() : ip4_out.c, ip4_out.h
  • _ip4_send_fragments() : ip4_out.c, ip4_out.h
  • _ip6_checksum() : chksum.c, chksum.h
  • _ip6_output() : ip6_out.c, ip6_out.h
  • _ip6_tcp_checksum() : chksum.c, chksum.h
  • _ip6_udp_checksum() : chksum.c, chksum.h
  • _list_lookup() : winadinf.c
  • _ping() : pcping.c, tcp.h
  • _rarp_handler() : pcrarp.c, pcrarp.h
  • _sarp_debug_dump() : pcsarp.c
  • _sethostid() : bsdname.c, tcp.h
  • _sethostid6() : bsdname.c, bsdname.h
  • _sock_append() : accept.c, socket.h
  • _sock_calloc() : socket.c, socket.h
  • _sock_chk_sockaddr() : socket.c, socket.h
  • _sock_crit_start() : socket.c, socket.h
  • _sock_crit_stop() : socket.c, socket.h
  • _sock_del_fd() : socket.c, socket.h
  • _sock_dos_fd() : socket.c, socket.h
  • _sock_free_rcv_buf() : socket.c, socket.h
  • _sock_half_open() : socket.c, socket.h
  • _sock_pending_connect() : socket.c, socket.h
  • _sock_set_rcv_buf() : socket.c, socket.h
  • _socklist_find() : socket.c, socket.h
  • _strlcpy() : misc_str.c, misc_str.h
  • _TCP6_listen() : socket.c, socket.h
  • _TCP6_open() : socket.c, socket.h
  • _tcp_abort() : pctcp.c, pctcp.h
  • _tcp_cancel() : pctcp.c, pctcp.h
  • _tcp_close() : pctcp.c, pctcp.h
  • _tcp_handler() : pctcp.c, pctcp.h
  • _TCP_open() : socket.c, socket.h
  • _tcp_sendsoon() : pctcp.c, pctcp.h
  • _tcp_unthread() : pctcp.c, pctcp.h
  • _UDP6_listen() : socket.c, socket.h
  • _UDP6_open() : socket.c, socket.h
  • _udp_cancel() : pctcp.c, pctcp.h
  • _udp_handler() : pctcp.c, pctcp.h
  • _udp_listen() : pctcp.c, pctcp.h
  • _UDP_open() : socket.c, socket.h
  • _udp_open() : pctcp.c, pctcp.h
  • _w32_get_rdtsc() : timer.c
  • _w32_intel() : misc.c, winadinf.c, swap.h
  • _w32_intel16() : misc.c, winadinf.c, swap.h
  • _w32_intr() : misc.c
  • _watt_user_config() : sock_ini.c, tcp.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- a -

  • accept() : accept.c
  • add_ping() : pcping.c, tcp.h
  • afd_list_init() : get_ai.c
  • arcnet_mac_format() : pcsed.c
  • arp_check_common() : pcarp.c
  • arp_check_timeouts() : pcarp.c
  • arp_daemon() : pcarp.c
  • arp_move_entry() : pcarp.c
  • arp_send() : pcarp.c
  • arp_send_request() : pcarp.c
  • assert_fail() : misc.c, misc.h
  • aton() : netaddr.c, tcp.h
  • aton_dotless() : netaddr.c, tcp.h
  • atox() : misc_str.c, misc_str.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- b -

  • bind() : bind.c, socket.h
  • BOOTP_do_boot() : pcbootp.c, pcbootp.h
  • build_pad() : pppoe.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- c -

  • change_ip_addr() : pcdhcp.c
  • check_errno_version() : socket.c
  • check_intr_num() : pcpkt.c
  • chk_timeout() : timer.c, tcp.h
  • chkip_method() : dynip.c
  • client_error() : pcdns.c
  • clockbits() : timer.c, timer.h
  • CloseHostFile() : get_xby.h, gethost.c
  • cmp_timers() : timer.c, tcp.h
  • compare() : pcarp.c, pcping.c
  • crtdbg_exit() : misc.c
  • ctime_r() : misc.c, misc.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- d -

  • dbug_exit() : pcdbug.c
  • DHCP_arp_check() : pcdhcp.c
  • DHCP_cfg_hook() : pcdhcp.c
  • DHCP_discover() : pcdhcp.c
  • DHCP_do_boot() : pcdhcp.c
  • DHCP_exit() : pcdhcp.c
  • dhcp_fsm() : pcdhcp.c
  • DHCP_get_server() : pcdhcp.c, tcp.h
  • DHCP_init() : pcdhcp.c, pcdhcp.h
  • DHCP_is_ack() : pcdhcp.c
  • DHCP_is_nack() : pcdhcp.c
  • DHCP_offer() : pcdhcp.c
  • dhcp_open() : pcdhcp.c
  • dhcp_options_add() : pcdhcp.c
  • DHCP_read_config() : pcdhcp.c, tcp.h
  • DHCP_release() : pcdhcp.c, tcp.h
  • DHCP_release_decline() : pcdhcp.c
  • DHCP_request() : pcdhcp.c
  • DHCP_set_config_func() : pcdhcp.c, tcp.h
  • dhcp_set_timers() : pcdhcp.c
  • DHCP_state_BOUND() : pcdhcp.c
  • DHCP_state_INIT() : pcdhcp.c
  • DHCP_state_REBINDING() : pcdhcp.c
  • DHCP_state_REBOOTING() : pcdhcp.c
  • DHCP_state_RENEWING() : pcdhcp.c
  • DHCP_state_REQUESTING() : pcdhcp.c
  • DHCP_state_SELECTING() : pcdhcp.c
  • do_exit() : sock_ini.c
  • do_include_file() : pcconfig.c
  • do_keepalive() : socket.c
  • dom_strerror() : pcdns.c, tcp.h
  • dump_data() : winadinf.c
  • dword_str() : misc.c, misc.h
  • dword_string() : winadinf.c
  • dyndns_params() : dynip.c
  • dynip_config() : dynip.c
  • dynip_exit() : dynip.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- e -

  • echo_discard_exit() : echo.c
  • echo_discard_init() : echo.c, echo.h
  • elapsed_str() : timer.c, timer.h
  • erase_config() : pcdhcp.c
  • eth_ifnet() : ioctl.c
  • eth_mac_format() : pcsed.c
  • eth_mac_xmit() : pcsed.c
  • eval_timers() : pcdhcp.c
  • exc_select() : select.c
  • except_handler() : sock_ini.c
  • exit_localport() : ports.c
  • expand_var_str() : pcconfig.c, pcconfig.h
  • extract_cname() : pcdns.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- f -

  • fc_readbyte() : pcconfig.c, pcconfig.h
  • fcntlsocket() : fcntl.c, socket.h
  • fddi_mac_format() : pcsed.c
  • find_adapter() : winpkt.c
  • find_free_raw_sock() : socket.c
  • find_winpcap_adapter() : winpkt.c
  • fix_llc_head() : pcsed.c
  • fopen_excl() : misc.c, misc.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- g -

  • GET_ADDRESSES() : winadinf.c
  • get_argv0() : pcconfig.c, pcconfig.h
  • get_cpu_speed() : timer.c, timer.h
  • get_day_num() : misc.c, misc.h
  • get_file_version() : misc.h, winmisc.c
  • get_header() : dynip.c
  • get_if_type_swsvpkt() : winpkt.c
  • get_phys_address() : winadinf.c
  • get_pkt_type_eth() : socket.c
  • get_rmode_data() : pcpkt.c
  • get_sol_opt() : sockopt.c
  • get_timediff() : timer.c, tcp.h
  • get_url() : dynip.c
  • getdomainname() : bsdname.c, socket.h
  • gethostbyaddr6_internal() : gethost6.c
  • gethostbyaddr_internal() : gethost.c
  • gethostbyname_internal() : gethost.c
  • gethostent() : gethost.c, netdb.h
  • gethostid() : bsdname.c, tcp.h, socket.h
  • GetHostsFile() : get_xby.h, gethost.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- h -

  • hires_timer() : timer.c, timer.h, tcp.h
  • hms_str() : timer.c, timer.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- i -

  • icmp4_dump() : pcdbug.c
  • icmp6_neigh_solic() : pcicmp6.c, pcicmp6.h
  • icmp_bogus() : pcicmp.c
  • icmp_check() : pcicmp.c
  • icmp_doredirect() : pcicmp.c, pcicmp.h
  • icmp_handler() : pcicmp.c, pcicmp.h
  • icmp_loopback() : loopback.c
  • icmp_redirect() : pcicmp.c
  • icmp_send() : pcicmp.c
  • icmp_send_timexceed() : pcicmp.c, pcicmp.h
  • icmp_send_unreach() : pcicmp.c, pcicmp.h
  • iconv_init() : idna.h
  • iconv_strerror() : idna.h
  • IDNA_convert_from_ACE() : idna.h
  • IDNA_convert_to_ACE() : idna.h
  • iface_ioctrl() : ioctl.c
  • in_checksum() : chksum.c, tcp.h
  • inet_lnaof() : netaddr.c, inet.h
  • inet_makeaddr() : netaddr.c, inet.h
  • inet_netof() : netaddr.c, inet.h
  • inet_ntop() : presaddr.c, inet.h
  • inet_ntop4() : presaddr.c
  • inet_ntop6() : presaddr.c
  • inet_pton() : presaddr.c, inet.h
  • inet_pton4() : presaddr.c
  • inet_pton6() : presaddr.c
  • init_frag() : ip4_frag.c
  • init_localport() : pctcp.h, ports.c
  • init_misc() : misc.c, tcp.h
  • init_sockets() : socket.c
  • init_timers() : timer.c, timer.h
  • init_userSuppliedTimerTick() : timer.c, tcp.h
  • ip4_transmit() : transmit.c
  • ip6_transmit() : transmit.c
  • is_known_host() : pcsarp.c
  • is_on_LAN() : pcarp.c
  • is_secure_host() : pcsarp.c
  • is_watt32_func() : highc.c
  • isaddr() : netaddr.c, tcp.h
  • isaddr_dotless() : netaddr.c, tcp.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- k -

  • keyword_not_found() : pcconfig.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- l -

  • LAN_lookup() : pcarp.c
  • LAN_lookup_pending() : pcarp.c
  • LAN_start_lookup() : pcarp.c
  • legal_recv_mode() : winpkt.c
  • list_lookup() : misc.c, misc.h
  • localtime_r() : misc.c, misc.h
  • lookup_domain() : pcdns.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- m -

  • MAC_address() : misc.c, misc.h
  • main() : echo.c
  • make_boot_header() : pcdhcp.c
  • match_ip6_dest() : pcdbug.c
  • millisec_clock() : timer.c, timer.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- n -

  • netdb_init() : pcconfig.c, pcconfig.h
  • new_abort_handler() : winmisc.c
  • new_int_8() : timer.c
  • next_domain() : pcdns.c
  • null_mac_format() : pcsed.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- o -

  • ods_printf() : bsddbug.c
  • open_npcap_adapter() : winpkt.c
  • open_swsvpkt_adapter() : winpkt.c
  • open_wanpacket_adapter() : winpkt.c
  • open_win10pcap_adapter() : winpkt.c
  • open_winpcap_adapter() : winpkt.c
  • other_raw_socks() : socket.c
  • other_tcp_listeners() : socket.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- p -

  • pack_domain() : pcdns.c
  • parse_config_pass_1() : pcpkt.c, winpkt.c
  • parse_config_table() : pcconfig.c, tcp.h
  • parse_dyndns_response() : dynip.c
  • parse_myip_address() : dynip.c
  • period() : pcdhcp.c
  • pkt16_drvr_init() : pcpkt.c
  • pkt_api_entry() : pcpkt.c
  • pkt_buf_wipe() : pcpkt.c, winpkt.c, tcp.h
  • pkt_dropped() : pcpkt.c, winpkt.c, tcp.h
  • pkt_drvr_info() : pcpkt.c
  • pkt_enqueue() : pcpkt.c
  • pkt_eth_init() : pcpkt.c, winpkt.c, tcp.h
  • pkt_free_pkt() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_addr() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_api_ver() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_drvr_ver() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_mac_len() : pcpkt.c
  • pkt_get_mtu() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_multicast_list() : pcpkt.c, pcpkt.h, winpkt.c, winpkt.h
  • pkt_get_params() : pcpkt.c, tcp.h
  • pkt_get_rcv_mode() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_stats() : pcpkt.c, winpkt.c, tcp.h
  • pkt_get_vector() : pcpkt.c, tcp.h
  • pkt_release() : pcpkt.c, winpkt.c, tcp.h
  • pkt_release_handle() : pcpkt.c
  • pkt_reset_handle() : pcpkt.c, tcp.h
  • pkt_send() : pcpkt.c, winpkt.c, tcp.h
  • pkt_set_access() : pcpkt.c
  • pkt_set_addr() : pcpkt.c, winpkt.c, tcp.h
  • pkt_set_multicast_list() : pcpkt.c, pcpkt.h, winpkt.c, winpkt.h
  • pkt_set_rcv_mode() : pcpkt.c, winpkt.c, tcp.h
  • pkt_strerror() : pcpkt.c, winpkt.c, tcp.h
  • pkt_tx_buf() : pcpkt.c, pcpkt.h
  • pkt_waiting() : pcpkt.c, winpkt.c, tcp.h
  • PmGlueEnd() : x32vm.c
  • poll_recv_queue() : pcsed.c
  • ppp_input() : ppp.c, ppp.h
  • pppoe_discovery() : pppoe.c
  • pppoe_exit() : pppoe.c, pppoe.h
  • pppoe_handler() : pppoe.c, pppoe.h
  • pppoe_init() : pppoe.c, pppoe.h
  • pppoe_is_up() : pppoe.c, pppoe.h
  • pppoe_mac_format() : pppoe.c, pppoe.h
  • pppoe_send_disc() : pppoe.c
  • pppoe_send_sess() : pppoe.c, pppoe.h
  • pppoe_start() : pppoe.c, pppoe.h
  • pppoe_wait() : pppoe.c
  • priv_addr() : netaddr.c, tcp.h
  • put_hardware_opt() : pcdhcp.c
  • put_request_list() : pcdhcp.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- q -

  • query_init() : pcdns.c
  • query_init_ip4() : udp_rev.c
  • query_init_ip6() : udp_rev.c
  • qword_str() : misc.c, misc.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- r -

  • Random() : misc.c, tcp.h
  • RandomWait() : misc.c, tcp.h
  • raw6_rx_buf() : sockopt.c
  • raw6_tx_buf() : sockopt.c
  • raw_rx_buf() : sockopt.c
  • raw_tx_buf() : sockopt.c
  • read_response() : pcdns.c
  • ReadEthersFile() : get_xby.h, geteth.c
  • recv_packet() : tftp.c
  • release_real_mem() : pcpkt.c
  • ReopenHostFile() : get_xby.h, gethost.c
  • res_mkquery() : res_mkqu.c, resolv.h
  • resolve() : pcdns.c, tcp.h
  • resolve_ip() : oldstuff.c, tcp.h
  • reverse_lookup() : udp_rev.c
  • reverse_lookup_myip() : pcdns.h, udp_rev.c
  • rip() : misc_str.c, tcp.h
  • route_check_timeouts() : pcarp.c
  • route_lookup() : pcarp.c
  • route_lookup_pending() : pcarp.c
  • route_start_lookup() : pcarp.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- s -

  • sarp_init() : pcsarp.c, pcsarp.h
  • sarp_parse() : pcsarp.c
  • sarp_receive() : pcsarp.c
  • select_s() : select.c, tcp.h
  • send_ack() : tftp.c
  • send_loopback() : pcsed.c
  • send_query() : pcdns.c
  • send_req() : tftp.c
  • server_error() : pcdns.c
  • set_cbreak() : misc.h, pc_cbrk.c
  • set_eaddr() : pcconfig.c
  • set_ethip() : pcconfig.c
  • set_my_ip() : pcdhcp.c
  • set_proto() : socket.c
  • set_request_list() : pcdhcp.c
  • set_timediff() : timer.c, tcp.h
  • set_timeout() : timer.c, tcp.h
  • set_ttimeout() : oldstuff.c, tcp.h
  • set_txmode() : winpkt.c
  • set_user_class() : pcdhcp.c
  • set_utc_offset() : gettod.c, gettod.h
  • set_value() : pcconfig.c
  • set_vend_class() : pcdhcp.c
  • setdomainname() : bsdname.c, socket.h
  • sethostid() : bsdname.c, tcp.h, socket.h
  • sethostname() : bsdname.c
  • setup_info_adapter_print() : winadinf.c
  • setup_pkt_inf() : pcpkt.c
  • setup_sig_handlers() : sock_ini.c
  • shutdown() : shutdown.c, socket.h
  • sig_handler_watt() : misc.h, pc_cbrk.c
  • sk_list_del() : socket.c
  • sock_daemon() : socket.c
  • sock_dataready() : sock_io.c, tcp.h
  • sock_exit() : sock_ini.c, tcp.h
  • sock_find_fd() : socket.c
  • sock_find_tcp() : socket.c
  • sock_find_udp() : socket.c
  • sock_getcw() : sock_io.c
  • sock_getsw() : sock_io.c
  • sock_packet_add() : socket.c
  • sock_packet_receive() : socket.c, socket.h
  • sock_putcw() : sock_io.c
  • sock_puts() : sock_io.c, tcp.h
  • sock_putsw() : sock_io.c
  • sock_raw4_recv() : socket.c
  • sock_raw_add() : socket.c
  • sock_raw_del() : socket.c
  • sock_reduce_mss() : pctcp.c
  • sock_sig_exit() : sock_ini.c, tcp.h
  • sock_sturdy() : oldstuff.c, tcp.h
  • socket() : socket.c, socket.h
  • socket_op_demux() : socket.c
  • socketpair() : socket.c
  • socklist_add() : socket.c
  • speed64_string() : winadinf.c
  • speed_string() : winadinf.c
  • split_ip6() : split.c
  • state_name() : pcdhcp.c
  • std_negotiation() : ppp.c
  • std_write_config() : pcdhcp.c
  • store_alt_address() : pcdns.c
  • store_DHCP_server_MAC() : pcdhcp.c
  • stream_cancel() : socket.c
  • strerror() : neterr.c, werrno.h
  • strltrim() : misc_str.c, misc_str.h
  • strntrimcpy() : misc_str.c, misc_str.h
  • strreplace() : misc_str.c, misc_str.h
  • strrtrim() : misc_str.c, misc_str.h
  • strtrim() : misc_str.c, misc_str.h
  • swsvpkt_callback() : winpkt.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- t -

  • tcp_cbreak() : pc_cbrk.c, tcp.h
  • tcp_cbrk() : oldstuff.c, tcp.h
  • tcp_checksum() : pctcp.c
  • tcp_do_bootp() : sock_ini.c
  • tcp_established() : pctcp.c, tcp.h
  • tcp_findseq() : pctcp.c
  • tcp_init() : sock_ini.c
  • tcp_inject_config() : pcconfig.c, tcp.h
  • tcp_inject_config_direct() : pcconfig.c
  • tcp_listen() : pctcp.c, tcp.h
  • tcp_no_arp() : pctcp.c
  • tcp_open() : pctcp.c, tcp.h
  • tcp_opt_maxsegment() : pctcp.c
  • tcp_opt_timestamp() : pctcp.c
  • tcp_post_init() : sock_ini.c
  • tcp_process_data() : tcp_fsm.c
  • tcp_process_options() : tcp_fsm.c
  • tcp_read() : pctcp.c
  • tcp_reassemble() : tcp_fsm.c
  • tcp_receive() : receive.c
  • tcp_Retransmitter() : pctcp.c, pctcp.h
  • tcp_rtt_win() : pctcp.c
  • tcp_set_debug_state() : pcconfig.c, tcp.h
  • tcp_set_window() : tcp_fsm.c
  • tcp_shutdown() : sock_ini.c
  • tcp_sock_daemon() : socket.c
  • tcp_sockreset() : pctcp.c
  • tcp_synsent_state() : tcp_fsm.c
  • tcp_tick() : pctcp.c, tcp.h
  • tcp_transmit() : transmit.c
  • tcp_upd_win() : pctcp.c
  • tcp_write() : pctcp.c
  • tftp_boot_load() : tftp.c, tftp.h
  • tftp_close() : tftp.c
  • tftp_exit() : tftp.c
  • tftp_get_block() : tftp.c
  • tftp_init() : tftp.c, tftp.h
  • tftp_open() : tftp.c
  • tftp_set_boot_fname() : tftp.c, tftp.h
  • tftp_set_server() : tftp.c, tftp.h
  • tftp_set_xfer_mode() : tftp.c
  • tftp_strerror() : tftp.c
  • time_str() : timer.c, timer.h
  • timeval_diff() : timer.c, tcp.h
  • tok_ifnet() : ioctl.c
  • tok_mac_format() : pcsed.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- u -

  • udp_callback() : tftp.c
  • udp_checksum() : pctcp.c
  • udp_close() : pctcp.c
  • udp_demux() : pctcp.c
  • udp_handler() : echo.c
  • udp_listen() : pctcp.c
  • udp_loopback() : loopback.c
  • udp_open() : pctcp.c
  • udp_read() : pctcp.c
  • udp_receive() : receive.c
  • udp_SetTTL() : pctcp.c
  • udp_sock_daemon() : socket.c
  • udp_write() : pctcp.c
  • unpack_domain() : pcdns.c
  • update_in_stat() : pcstat.c, pcstat.h
  • update_out_stat() : pcstat.c, pcstat.h
  • url_free() : dynip.c
  • url_parse() : dynip.c
  • userTimerTick() : timer.c, tcp.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- v -

  • vendor_version() : socket.c
  • void() : pcarp.c, pcconfig.c, pcconfig.h, tftp.c, tcp.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- w -

  • W32_CLANG_PACK_WARN_DEF() : pcdhcp.h, pcdns.h, pcicmp.h, pcigmp.c, pctcp.c, tcp.h, socket.h, icmp6.h, ip_var.h, udp_var.h
  • W32_GCC_FUNC_TYPE_WARN_DEF() : echo.c
  • W32_GCC_FUNC_TYPE_WARN_OFF() : echo.c
  • W32_GCC_PRAGMA() : oldstuff.c
  • Wait() : misc.c, misc.h
  • waterm_ioctrl() : ioctl.c
  • watt_filelength() : misc.c, tcp.h
  • watt_kbhit() : misc.c, tcp.h
  • watt_sock_init() : sock_ini.c, tcp.h
  • wattcpBuildCC() : version.c, tcp.h
  • wattcpBuildCCexe() : version.c, tcp.h
  • wattcpCapabilities() : version.c, tcp.h
  • wattcpVersion() : version.c, tcp.h
  • win_strerror() : winmisc.c, tcp.h
  • winpcap_recv_thread() : winpkt.c
  • write_config() : pcdhcp.c


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • _
  • a
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- _ -

  • _bootp_on : sock_ini.c, sock_ini.h
  • _default_tos : ip4_out.c, ip4_out.h
  • _default_ttl : ip4_out.c, ip4_out.h
  • _dhcp6_on : sock_ini.c, sock_ini.h
  • _dhcp_on : sock_ini.c, sock_ini.h
  • _do_mask_req : sock_ini.c, sock_ini.h
  • _eth_addr : pcsed.c, pcsed.h
  • _eth_brdcast : pcsed.c, pcsed.h
  • _eth_is_init : pcsed.c
  • _eth_last : pcsed.c, pcsed.h
  • _eth_loop_addr : pcsed.c, pcsed.h
  • _eth_mac_len : pcsed.c, pcsed.h
  • _eth_ndis3pkt : pcsed.c, pcsed.h
  • _eth_real_addr : pcsed.c, pcsed.h
  • _eth_SwsVpkt : pcsed.c
  • _eth_wanpacket : pcsed.c
  • _eth_win10pcap : pcsed.c
  • _eth_winpcap : pcsed.c
  • _ip4_dont_frag : ip4_out.c, ip4_out.h
  • _ip4_id_increment : ip4_out.c, ip4_out.h
  • _ip_recursion : pcsed.c, pcsed.h
  • _pkt_errno : pcpkt.c, pcpkt.h
  • _pkt_forced_rxmode : pcpkt.h, winpkt.c
  • _pkt_inf : pcpkt.c, pcpkt.h, winpkt.c, winpkt.h
  • _pkt_ip_ofs : pcpkt.c, pcpkt.h
  • _pkt_rxmode : pcpkt.c, pcpkt.h, winpkt.c
  • _pkt_rxmode0 : pcpkt.c, pcpkt.h, winpkt.c
  • _pkt_type_ofs : pcpkt.c
  • _pktdevclass : pcpkt.c, pcpkt.h
  • _pktdevlevel : pcpkt.c, pcpkt.h
  • _pktdrvrname : pcpkt.h
  • _pktserial : pcpkt.c, pcpkt.h
  • _printk_file : printk.c, printk.h
  • _printk_safe : printk.c, printk.h
  • _rarp_on : sock_ini.c, sock_ini.h
  • _tcp_allsocs : pctcp.c, pctcp.h
  • _udp_allsocs : pctcp.c, pctcp.h
  • _w_watt_optarg : getopt.c, tcp.h
  • _watt_assert_buf : misc.c, misc.h
  • _watt_cbroke : misc.h, pc_cbrk.c, tcp.h
  • _watt_crtdbg_check : misc.c, misc.h
  • _watt_do_exit : sock_ini.c
  • _watt_fatal_error : misc.c, misc.h
  • _watt_handle_cbreak : misc.h, pc_cbrk.c, tcp.h
  • _watt_is_init : sock_ini.c, sock_ini.h
  • _watt_is_win9x : misc.h, winmisc.c
  • _watt_is_wow64 : winmisc.c
  • _watt_no_config : sock_ini.c
  • _watt_os_ver : misc.c, misc.h

- a -

  • addr_mask_id : pcicmp.c

- b -

  • block_icmp : pctcp.c
  • block_ip : pctcp.c
  • block_tcp : pctcp.c
  • block_udp : pctcp.c

- c -

  • called_from_resolve : pcdns.c, pcdns.h
  • clocks_per_usec : timer.c
  • cstate_dseg : pcpkt.c

- d -

  • dbg_mode_all : pcdbug.c, pcdbug.h
  • defaultdomain : pcdns.c

- e -

  • exc_app_start : wdpmi.c

- h -

  • has_8254 : timer.c, timer.h
  • has_rdtsc : timer.c
  • hostname : pctcp.c, pctcp.h

- i -

  • icmp_id : pcarp.c
  • inuse : socket.c

- l -

  • lcp_echo_intv : pppoe.c

- m -

  • mac_tx_format : pcsed.c
  • mcast_set : socket.c
  • mtu_blackhole : pctcp.c, pctcp.h
  • mtu_discover : pctcp.c, pctcp.h
  • my_ip_addr : pctcp.c

- o -

  • old_break : sock_ini.c

- p -

  • pkt_error : pcpkt.c

- r -

  • rmcb : x32vm.c

- s -

  • sign_opt : pctcp.c
  • sin_mask : pctcp.c
  • sk_scope : bsddbug.c
  • sock_init_called : sock_ini.c
  • start_day : timer.c
  • start_time : timer.c
  • survive_bootp : sock_ini.c
  • survive_dhcp : sock_ini.c, sock_ini.h, tcp.h
  • survive_eth : sock_ini.c, sock_ini.h, tcp.h
  • survive_rarp : sock_ini.c

- t -

  • tcp_CLOSE_TO : pctcp.c
  • tcp_is_init : sock_ini.c
  • tcp_keep_idle : pctcp.c
  • tcp_keep_intvl : pctcp.c
  • tcp_max_idle : pctcp.c
  • tcp_MAX_VJSA : pctcp.c
  • tcp_MAX_VJSD : pctcp.c
  • tcp_nagle : pctcp.c, pctcp.h
  • tcp_OPEN_TO : pctcp.c
  • tcp_opt_ts : pctcp.c, pctcp.h
  • tcp_recv_win : pctcp.c
  • tcp_RETRAN_TIME : pctcp.c
  • tcp_RST_TIME : pctcp.c
  • tcp_RTO_ADD : pctcp.c
  • tcp_RTO_BASE : pctcp.c
  • tcp_RTO_SCALE : pctcp.c
  • transient_cfg : pcdhcp.c

- u -

  • use_except : sock_ini.c
  • use_rdtsc : timer.c
  • user_name : pppoe.c
  • using_int8 : timer.c

- w -

  • w32_cflags2 : version.c
  • win32_dos_box : misc.c, misc.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • ax25_Header : pcsed.h
  • int64 : wattcp.h
  • link_Packet : pcsed.h
  • pppoe_Header : pcsed.h
  • sock_type : wattcp.h
  • uint64 : wattcp.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • config_tab_types : tcp.h
  • ReceiveModes : pcpkt.h, winpkt.h


Watt-32 tcp/ip: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • ARG_ATOB : tcp.h
  • ARG_ATOI : tcp.h
  • ARG_ATOIP : tcp.h
  • ARG_ATOW : tcp.h
  • ARG_ATOX_B : tcp.h
  • ARG_ATOX_D : tcp.h
  • ARG_ATOX_W : tcp.h
  • ARG_FUNC : tcp.h
  • ARG_RESOLVE : tcp.h
  • ARG_STRCPY : tcp.h
  • ARG_STRDUP : tcp.h
  • RXMODE_ALL_LOCAL : winpkt.h
  • RXMODE_BROADCAST : pcpkt.h, winpkt.h
  • RXMODE_DIRECT : pcpkt.h, winpkt.h
  • RXMODE_MULTICAST1 : pcpkt.h, winpkt.h
  • RXMODE_MULTICAST2 : pcpkt.h, winpkt.h
  • RXMODE_OFF : pcpkt.h, winpkt.h
  • RXMODE_PROMISCOUS : pcpkt.h, winpkt.h


Watt-32 tcp/ip: E:/WATT/src/accept.c Source File

  • src
accept.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 * 0.6 : Sep 16, 1999 : fixes by Claus Oberste-Brandenburg
37 * 0.7 : Nov 22, 1999 : G. Vanem - simplified the socket 'dup' action.
38 * Simply allocate a new 'remote_addr'.
39 * Poll backlogged listen-queue in accept-loop.
40 * 0.8 : Dec 15, 1999 : Listen-queue filled in _sock_append() and TCB
41 * is cloned when SYN is received in tcp_listen_state().
42 * 0.9 : Mar 09, 2000 : Plugged a memory leak in dup_bind() where 'tcp_sock'
43 * memory from socket() wasn't free'ed. Thanks to
44 * Francisco Pastor <fpastor.etra-id@etra.es> for
45 * finding this.
46 * 0.91: Jun 01, 2000 : Rearranged accept-loop for EWOULDBLOCK with no
47 * listen_queue element (dropped 'continue' construct).
48 * 0.92: Aug 07, 2002 : G. Vanem - added AF_INET6 support
49 */
50
51#include "socket.h"
52
53#if defined(USE_BSD_API)
54
55#if defined(__WATCOMC__)
56 /*
57 * Warning! W201: Unreachable code.
58 * Due to 'SOCK_ERRNO (EINVAL)' after 'SOCK_FATAL()'.
59 */
60 #pragma disable_message (201)
61#endif
62
63static int dup_bind (Socket *socket, Socket **clone, int idx);
64static int alloc_addr (Socket *socket, Socket *clone);
65static void listen_free(Socket *socket, int idx);
66
67int W32_CALL accept (int s, struct sockaddr *addr, socklen_t *addrlen)
68{
69 Socket *socket, *clone = NULL;
70 volatile DWORD timeout;
71 volatile int newsock = -1;
72 volatile int que_idx;
73 volatile int maxconn;
74 volatile BOOL is_ip6;
75
76 socket = _socklist_find (s);
77
78 SOCK_PROLOGUE (socket, "\naccept:%d", s);
79
80 is_ip6 = (socket->so_family == AF_INET6);
81
82 if (socket->so_type != SOCK_STREAM)
83 {
84 SOCK_DEBUGF ((", EOPNOTSUPP"));
85 SOCK_ERRNO (EOPNOTSUPP);
86 return (-1);
87 }
88
89 if (!socket->local_addr)
90 {
91 SOCK_DEBUGF ((", not bound"));
92 SOCK_ERRNO (ENOTCONN);
93 return (-1);
94 }
95
96 if (!(socket->so_options & SO_ACCEPTCONN)) /* listen() not called */
97 {
98 SOCK_DEBUGF ((", not SO_ACCEPTCONN"));
99 SOCK_ERRNO (EINVAL);
100 return (-1);
101 }
102
103 if (!(socket->so_state & (SS_ISLISTENING | SS_ISCONNECTING)))
104 {
105 SOCK_DEBUGF ((", not listening"));
106 SOCK_ERRNO (ENOTCONN);
107 return (-1);
108 }
109
110 if (addr && addrlen)
111 {
112 socklen_t sa_len = is_ip6 ? sizeof(struct sockaddr_in6) :
113 sizeof(struct sockaddr_in);
114 if (*addrlen < sa_len)
115 {
116 SOCK_DEBUGF ((", EFAULT"));
117 SOCK_ERRNO (EFAULT);
118 return (-1);
119 }
120 VERIFY_RW (addr, sa_len);
121 }
122
123 /* Get max possible TCBs on listen-queue.
124 * Some (or all) may be NULL until a SYN comes in.
125 */
126 maxconn = socket->backlog;
127 if (maxconn < 1 || maxconn > SOMAXCONN)
128 {
129 SOCK_FATAL (("%s(%d): Illegal socket backlog %d\n",
130 __FILE__, __LINE__, maxconn));
131 SOCK_ERRNO (EINVAL);
132 return (-1);
133 }
134
135 /* A listening socket should have infinite timeout unless
136 * option SO_RCVTIMEO used. I.e. socket->timeout = 0.
137 * Ref. listen.c.
138 */
139 if (socket->timeout)
140 timeout = set_timeout (1000 * socket->timeout);
141 else timeout = 0UL;
142
143 if (_sock_sig_setup() < 0)
144 {
145 SOCK_ERRNO (EINTR);
146 goto accept_fail;
147 }
148
149 _sock_crit_start();
150
151 /* Loop over all queue-slots and accept first connected TCB
152 */
153 for (que_idx = 0; ; que_idx = (que_idx+1) % maxconn)
154 {
155 _tcp_Socket *sk = socket->listen_queue [que_idx];
156
157 tcp_tick (NULL);
158
159 WATT_YIELD();
160
161 if (_sock_sig_pending())
162 {
163 SOCK_DEBUGF ((", EINTR"));
164 SOCK_ERRNO (EINTR);
165 goto accept_fail;
166 }
167
168 /* No SYNs received yet. This shouldn't happen if we called 'accept()'
169 * after 'select_s()' said that socket was readable. (At least one
170 * connection on the listen-queue).
171 */
172 if (sk)
173 {
174 /* This could happen if 'accept()' was called too long after connection
175 * was established and then closed by peer. This could also happen if
176 * someone did a portscan on us. I.e. he sent 'SYN', we replied with
177 * 'SYN+ACK' and he never sent an 'ACK'. Thus we timeout in
178 * 'tcp_Retransmitter()' and abort the TCB.
179 *
180 * Queue slot is in any case ready for another 'SYN' to come and be
181 * handled by '_sock_append()'.
182 */
183 if (sk->state >= tcp_StateESTCL && sk->ip_type == 0)
184 {
185 SOCK_DEBUGF ((", aborted TCB (idx %d)", que_idx));
186 listen_free (socket, que_idx);
187 continue;
188 }
189
193 if (sk->state >= tcp_StateESTAB && sk->state < tcp_StateCLOSED)
194 {
195 SOCK_DEBUGF ((", connected! (idx %d)", que_idx));
196 break;
197 }
198 }
199
200 /* We've polled all listen-queue slots and none are connected.
201 * Return fail if socket is non-blocking.
202 */
203 if (que_idx == maxconn-1 && (socket->so_state & SS_NBIO))
204 {
205 SOCK_DEBUGF ((", would block"));
206 SOCK_ERRNO (EWOULDBLOCK);
207 goto accept_fail;
208 }
209
210 if (chk_timeout(timeout))
211 {
212 SOCK_DEBUGF ((", ETIMEDOUT"));
213 SOCK_ERRNO (ETIMEDOUT);
214 goto accept_fail;
215 }
216 }
217
218 /* We're here only when above 'tcp_established()' succeeded.
219 * Now duplicate 'socket' into a new listening socket 'clone'
220 * with handle 'newsock'.
221 */
222 SOCK_ENTER_SCOPE();
223 newsock = dup_bind (socket, &clone, que_idx);
224 if (newsock < 0)
225 goto accept_fail;
226
227 if (!alloc_addr(socket, clone))
228 {
229 SOCK_DEL_FD (newsock);
230 goto accept_fail;
231 }
232
233 /* Clone is connected, but *not* listening/accepting.
234 * Note: other 'so_state' bits from parent is unchanged.
235 * e.g. clone may be non-blocking.
236 */
237 clone->so_state |= SS_ISCONNECTED;
238 clone->so_state &= ~(SS_ISLISTENING | SS_ISCONNECTING);
239 clone->so_options &= ~SO_ACCEPTCONN;
240
241#if 1
242 /* Prevent a PUSH on first segment sent.
243 */
244 sock_noflush ((sock_type*)clone->tcp_sock);
245#endif
246
247#if defined(USE_IPV6)
248 if (is_ip6)
249 {
250 struct sockaddr_in6 *ra = (struct sockaddr_in6*)clone->remote_addr;
251
252 SOCK_DEBUGF (("\nremote %s (%u)",
253 _inet6_ntoa (&ra->sin6_addr), ntohs(ra->sin6_port)));
254 ARGSUSED (ra);
255 }
256 else
257#endif
258 SOCK_DEBUGF (("\nremote %s (%u)",
259 inet_ntoa (clone->remote_addr->sin_addr),
260 ntohs (clone->remote_addr->sin_port)));
261
262 if (addr && addrlen)
263 {
264#if defined(USE_IPV6)
265 if (socket->so_family == AF_INET6)
266 {
267 struct sockaddr_in6 *sa = (struct sockaddr_in6*)addr;
268
269 memset (sa, 0, sizeof(*sa));
270 memcpy (&sa->sin6_addr, &clone->remote_addr->sin_addr, sizeof(sa->sin6_addr));
271 sa->sin6_family = AF_INET6;
272 sa->sin6_port = clone->remote_addr->sin_port;
273 sa->sin6_flowinfo = sa->sin6_scope_id = 0; /* !! */
274 *addrlen = sizeof(*sa);
275 }
276 else
277#endif
278 {
279 struct sockaddr_in *sa = (struct sockaddr_in*)addr;
280
281 sa->sin_family = AF_INET;
282 sa->sin_port = clone->remote_addr->sin_port;
283 sa->sin_addr = clone->remote_addr->sin_addr;
284 memset (sa->sin_zero, 0, sizeof(sa->sin_zero));
285 *addrlen = sizeof(*sa);
286 }
287 }
288
289 SOCK_LEAVE_SCOPE();
290 _sock_crit_stop();
291 _sock_sig_restore();
292 return (newsock);
293
294accept_fail:
295 SOCK_LEAVE_SCOPE();
296 _sock_crit_stop();
297 _sock_sig_restore();
298 return (-1);
299}
300
301
302/*
303 * Duplicate a SOCK_STREAM 'sock' to '*newconn'. Doesn't set
304 * local/remote addresses. Transfer TCB from listen-queue[idx] of
305 * 'sock' to TCB of 'clone'.
306 */
307static int dup_bind (Socket *sock, Socket **newconn, int idx)
308{
309 Socket *clone;
310 int fd = socket (sock->so_family, SOCK_STREAM, IPPROTO_TCP);
311
312 if (fd < 0)
313 return (fd);
314
315 clone = _socklist_find (fd); /* cannot fail */
316
317 /* child gets state from parent
318 */
319 clone->timeout = sock->timeout;
320 clone->close_time = sock->close_time;
321 clone->keepalive = sock->keepalive;
322 clone->ip_tos = sock->ip_tos;
323 clone->ip_ttl = sock->ip_ttl;
324 clone->so_state = sock->so_state;
325 clone->so_options = sock->so_options;
326
327 /* TCB for clone is from listen-queue[idx]; free tcp_sock from
328 * socket(). Reuse listen-queue slot for another SYN.
329 */
330 free (clone->tcp_sock);
331 clone->tcp_sock = sock->listen_queue[idx];
332 sock->listen_queue [idx] = NULL;
333 sock->syn_timestamp[idx] = 0UL;
334 *newconn = clone;
335 return (fd);
336}
337
338/*
339 * Allocate and fill local/remote addresses for 'clone'.
340 * Take local address from 'socket', and remote address from
341 * TCB of clone.
342 */
343static int alloc_addr (Socket *socket, Socket *clone)
344{
345 BOOL is_ip6 = (socket->so_family == AF_INET6);
346 int sa_len = is_ip6 ? sizeof(struct sockaddr_in6) :
347 sizeof(struct sockaddr_in);
348
349 clone->local_addr = SOCK_CALLOC (sa_len);
350 if (!clone->local_addr)
351 {
352 SOCK_DEBUGF ((", ENOMEM"));
353 SOCK_ERRNO (ENOMEM);
354 return (0);
355 }
356
357 clone->remote_addr = SOCK_CALLOC (sa_len);
358 if (!clone->remote_addr)
359 {
360 SOCK_DEBUGF ((", ENOMEM"));
361 SOCK_ERRNO (ENOMEM);
362 free (clone->local_addr);
363 clone->local_addr = NULL;
364 return (0);
365 }
366
367#if defined(USE_IPV6)
368 if (is_ip6)
369 {
370 struct sockaddr_in6 *la = (struct sockaddr_in6*) clone->local_addr;
371 struct sockaddr_in6 *ra = (struct sockaddr_in6*) clone->remote_addr;
372 struct sockaddr_in6 *sa = (struct sockaddr_in6*) socket->local_addr;
373
374 la->sin6_family = AF_INET6;
375 la->sin6_port = sa->sin6_port;
376 memcpy (&la->sin6_addr, &sa->sin6_addr, sizeof(la->sin6_addr));
377
378 ra->sin6_family = AF_INET6;
379 ra->sin6_port = htons (clone->tcp_sock->hisport);
380 memcpy (&ra->sin6_addr, &clone->tcp_sock->his6addr, sizeof(ra->sin6_addr));
381 }
382 else
383#endif
384 {
385 struct in_addr peer;
386
387 peer.s_addr = htonl (clone->tcp_sock->hisaddr);
388 clone->local_addr->sin_family = AF_INET;
389 clone->local_addr->sin_port = socket->local_addr->sin_port;
390 clone->local_addr->sin_addr = socket->local_addr->sin_addr;
391
392 clone->remote_addr->sin_family = AF_INET;
393 clone->remote_addr->sin_port = htons (clone->tcp_sock->hisport);
394 clone->remote_addr->sin_addr = peer;
395 }
396 ARGSUSED (is_ip6);
397 return (1);
398}
399
400/*
401 * Release a listen-queue slot and associated memory.
402 */
403static void listen_free (Socket *socket, int idx)
404{
405 _tcp_Socket *tcb = socket->listen_queue [idx];
406
407 _tcp_unthread (tcb, TRUE);
408 _sock_free_rcv_buf ((sock_type*)tcb); /* free large Rx buffer */
409 free (tcb);
410 socket->listen_queue [idx] = NULL;
411}
412
426int _sock_append (_tcp_Socket **tcp)
427{
428 _tcp_Socket *clone;
429 _tcp_Socket *orig = *tcp;
430 Socket *sock = NULL; /* associated socket for 'orig' */
431 int i;
432
433 /* Lookup BSD-socket for TCB
434 */
435 if (!_bsd_socket_hook ||
436 (sock = (*_bsd_socket_hook)(BSO_FIND_SOCK,orig)) == NULL)
437 {
438 /* This could be a native Wattcp socket. Pass it on in
439 * tcp_listen_state() for further processing.
440 */
441 SOCK_DEBUGF (("\n sock_append: not found!?"));
442 return (1);
443 }
444
445 SOCK_DEBUGF (("\n sock_append:%d", sock->fd));
446
447 if (!(sock->so_options & SO_ACCEPTCONN))
448 {
449 SOCK_DEBUGF ((", not SO_ACCEPTCONN"));
450 return (0); /* How could this happen (SYN attack)? */
451 }
452
453 /* Find the first vacant slot for this clone
454 */
455 for (i = 0; i < sock->backlog; i++)
456 if (!sock->listen_queue[i])
457 break;
458
461 if (i >= sock->backlog || i >= SOMAXCONN)
462 {
465 SOCK_DEBUGF ((", queue full (idx %d)", i));
466 return (0);
467 }
468
469 SOCK_DEBUGF ((", idx %d", i));
470
471 clone = (_tcp_Socket*) SOCK_CALLOC (sizeof(*clone));
472 if (!clone)
473 {
474 SOCK_DEBUGF ((", ENOMEM"));
475 return (0);
476 }
477
478 /* Link in the semi-connected socket (SYN received, ACK will be sent)
479 */
480 sock->listen_queue[i] = clone;
481 sock->syn_timestamp[i] = set_timeout (0);
482
483 /* Copy the TCB to clone. Tx buffer of clone must not
484 * be set to parent's Tx buffer.
485 */
486 memcpy (clone, orig, sizeof(*clone));
487 clone->tx_data = &clone->tx_buf[0];
488 clone->tx_datalen = 0;
489 clone->max_tx_data = sizeof (clone->tx_buf) - 1;
490
491#if defined(USE_DEBUG) /* !!needs some work */
492 clone->last_acknum[0] = orig->last_acknum[0];
493 clone->last_acknum[1] = orig->last_acknum[1];
494 clone->last_seqnum[0] = orig->last_seqnum[0];
495 clone->last_seqnum[1] = orig->last_seqnum[1];
496 orig->last_acknum[0] = orig->last_acknum[1] = 0L;
497 orig->last_seqnum[0] = orig->last_seqnum[1] = 0L;
498#endif
499
500 /* Increase the TCP window (to 16kB by default)
501 */
502 _sock_set_rcv_buf ((sock_type*)clone, tcp_recv_win);
503
504 /* Undo what tcp_handler() and tcp_listen_state() did to
505 * this listening socket.
506 */
507 orig->hisport = 0;
508 orig->hisaddr = 0;
509 orig->myaddr = 0;
510#if defined(USE_IPV6)
511 memset (&orig->my6addr, 0, sizeof(orig->my6addr));
512#endif
513
514 orig->send_next = INIT_SEQ(); /* set new ISS */
515 orig->unhappy = FALSE;
516 CLR_PEER_MAC_ADDR (orig);
517
518 clone->next = _tcp_allsocs;
519 _tcp_allsocs = clone; /* prepend clone to TCB-list */
520 *tcp = clone; /* the new TCB is now the clone */
521 return (1);
522}
523
524/*
525 A handy note from:
526 http://help.netscape.com/kb/corporate/960513-73.html
527
528Solaris 2.3, 2.4, and 2.5 have a listen backlog queue for incoming
529TCP/IP connections; its maximum length is 5 by default. If you leave
530this set to the default, then you will frequently see connections to
531your web server time out under moderate loads, even though there are
532enough idle web server listener processes available to handle the
533connections and your Solaris system shows no other signs of resource
534saturation.
535
536The listen backlog queue holds connections that are "half-open" (in
537the process of being opened), as well as connections that have been
538fully opened but have not yet been accepted by any local processes.
539This has no effect on the total number of open TCP/IP connections that
540your Solaris system can deal with at once; it only means that your
541system can't juggle more than five loose connections at a time, and
542any other connections that come in while Solaris is busy with five
543loose connections will be dropped and will time out on the client end.
544
545On Solaris 2.3 and 2.4, you can bring the maximum queue length from 5
546up to 32 by using the "ndd" command, which must be run as root:
547
548 /usr/sbin/ndd -set /dev/tcp tcp_conn_req_max 32
549
550 It is theoretically possible to increase this number beyond 32,
551 although this is not recommended. If increasing the maximum length
552 from 5 to 32 solved the problem temporarily for you but your web
553 server's traffic has now increased to a point where the symptoms
554 appear with the maximum queue length set to 32, then you should
555 contact Sun for further help with this.
556
557 The Netscape servers on any Unix system will request a listen backlog
558 queue length of 128 when they run; the operating system then reduces
559 that to something it can handle.
560
561 Solaris 2.5 allows a maximum listen backlog queue length as high as
562 1024 (and you can raise it in the same way), but it still defaults to
563 a maximum queue length of 5.
564
565*/
566
567#endif /* USE_BSD_API */
_sock_append
int _sock_append(_tcp_Socket **tcp)
Called from tcp_fsm.c / tcp_listen_state() (via _bsd_socket_hook) to append a new connection to the l...
Definition: accept.c:426
accept
int W32_CALL accept(int s, struct sockaddr *addr, socklen_t *addrlen)
Definition: accept.c:67
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
tcp_recv_win
DWORD tcp_recv_win
RWIN for BSD sockets only.
Definition: pctcp.c:138
_tcp_allsocs
_tcp_Socket * _tcp_allsocs
list of tcp-sockets
Definition: pctcp.c:140
_tcp_unthread
_tcp_Socket * _tcp_unthread(_tcp_Socket *ds, BOOL free_tx)
Unthread a socket from the tcp socket list, if it's there.
Definition: pctcp.c:602
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
_sock_set_rcv_buf
int _sock_set_rcv_buf(sock_type *s, size_t len)
Setup a bigger receive buffer, the default in Wattcp is only 2k.
Definition: socket.c:232
_sock_free_rcv_buf
void _sock_free_rcv_buf(sock_type *s)
Free receive buffer associated with udp/tcp sockets.
Definition: socket.c:247
_sock_crit_start
void _sock_crit_start(void)
Start a critical region.
Definition: socket.c:1266
_sock_crit_stop
void _sock_crit_stop(void)
Mark the end of a critical region.
Definition: socket.c:1276
Socket
Definition: socket.h:158
in_addr
Definition: in.h:143
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::tx_datalen
UINT tx_datalen
number of bytes of data to send
Definition: wattcp.h:652
tcp_Socket::last_acknum
DWORD last_acknum[2]
for pcdbug.c; to follow SEQ/ACK
Definition: wattcp.h:600
tcp_Socket::unhappy
BYTE unhappy
flag, indicates retransmitting segt's
Definition: wattcp.h:604
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
tcp_Socket::tx_data
BYTE * tx_data
Tx data buffer (default tx_buf[])
Definition: wattcp.h:654
tcp_Socket::last_seqnum
DWORD last_seqnum[2]
increments
Definition: wattcp.h:601
tcp_Socket::next
struct tcp_Socket * next
link to next tcp-socket
Definition: wattcp.h:585
tcp_Socket::tx_buf
BYTE tx_buf[tcp_MaxTxBufSize+1]
data for transmission
Definition: wattcp.h:655
tcp_Socket::his6addr
ip6_address his6addr
peer's IPv6 address
Definition: wattcp.h:592
tcp_Socket::send_next
DWORD send_next
SEQ we send but not ACK-ed by peer.
Definition: wattcp.h:596
tcp_Socket::my6addr
ip6_address my6addr
our IPv6 address
Definition: wattcp.h:591
tcp_Socket::max_tx_data
UINT max_tx_data
Last index for tx_data[].
Definition: wattcp.h:653
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ah6.h Source File

  • inc
  • netinet6
ah6.h
Go to the documentation of this file.
1
5/*
6 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34/*
35 * RFC1826/2402 authentication header.
36 */
37
38#ifndef _NETINET6_AH6_H_
39#define _NETINET6_AH6_H_
40
41#ifdef _KERNEL
42
43#ifndef __SYS_MBUF_H
44#include <sys/mbuf.h>
45#endif
46
47struct secasvar;
48
49extern int ah6_input (struct mbuf **, int *, int));
50extern int ah6_output (struct mbuf *, u_char *, struct mbuf *,
51 struct ipsecrequest *);
52extern int ah6_calccksum (struct mbuf *, caddr_t, size_t,
53 const struct ah_algorithm *, struct secasvar *);
54
55extern void ah6_ctlinput (int, struct sockaddr *, void *);
56#endif
57
58#endif /*_NETINET6_AH6_H_*/
ah_algorithm
Definition: ah.h:70
ipsecrequest
Definition: ipsec.h:102
mbuf
Definition: mbuf.h:6
sockaddr
Definition: socket.h:181


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ah.h Source File

  • inc
  • netinet6
ah.h
Go to the documentation of this file.
1
5/*
6 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34/*
35 * RFC1826/2402 authentication header.
36 */
37
38#ifndef _NETINET6_AH_H_
39#define _NETINET6_AH_H_
40
41#if defined(_KERNEL) && !defined(_LKM)
42#include "opt_inet.h"
43#endif
44
45struct ah {
46 u_int8_t ah_nxt; /* Next Header */
47 u_int8_t ah_len; /* Length of data, in 32bit */
48 u_int16_t ah_reserve; /* Reserved for future use */
49 u_int32_t ah_spi; /* Security parameter index */
50 /* variable size, 32bit bound*/ /* Authentication data */
51};
52
53struct newah {
54 u_int8_t ah_nxt; /* Next Header */
55 u_int8_t ah_len; /* Length of data + 1, in 32bit */
56 u_int16_t ah_reserve; /* Reserved for future use */
57 u_int32_t ah_spi; /* Security parameter index */
58 u_int32_t ah_seq; /* Sequence number field */
59 /* variable size, 32bit bound*/ /* Authentication data */
60};
61
62#ifdef _KERNEL
63struct secasvar;
64
65struct ah_algorithm_state {
66 struct secasvar *sav;
67 void* foo; /* per algorithm data - maybe */
68};
69
70struct ah_algorithm {
71 int (*sumsiz) (struct secasvar *);
72 int (*mature) (struct secasvar *);
73 int keymin; /* in bits */
74 int keymax; /* in bits */
75 const char *name;
76 int (*init) (struct ah_algorithm_state *, struct secasvar *);
77 void (*update) (struct ah_algorithm_state *, caddr_t, size_t);
78 void (*result) (struct ah_algorithm_state *, caddr_t);
79};
80
81#define AH_MAXSUMSIZE 16
82
83extern const struct ah_algorithm *ah_algorithm_lookup (int);
84
85/* cksum routines */
86extern int ah_hdrlen (struct secasvar *);
87
88extern size_t ah_hdrsiz (struct ipsecrequest *);
89extern void ah4_input (struct mbuf *, int);
90extern int ah4_output (struct mbuf *, struct ipsecrequest *);
91extern int ah4_calccksum (struct mbuf *, caddr_t, size_t,
92 const struct ah_algorithm *, struct secasvar *);
93#endif /* _KERNEL */
94
95#endif /* _NETINET6_AH_H_ */
ah_algorithm_state
Definition: ah.h:65
ah_algorithm
Definition: ah.h:70
ah
Definition: ah.h:45
ipsecrequest
Definition: ipsec.h:102
mbuf
Definition: mbuf.h:6
newah
Definition: ah.h:53


Watt-32 tcp/ip: E:/WATT/src/asmpkt.h Source File

  • src
asmpkt.h
Go to the documentation of this file.
1
5#ifndef _w32_ASMPKT_H
6#define _w32_ASMPKT_H
7
8#if (DOSX == 0) /* for real-mode targets */
9 extern void far cdecl pkt_receiver_rm (void); /* in asmpkt.asm */
10
11#elif (DOSX & DOS4GW) && !defined(USE_FAST_PKT) /* in asmpkt4.asm */
12 extern WORD cdecl asmpkt_size_chk;
13 extern struct pkt_info *cdecl asmpkt_inf;
14
15 extern void cdecl pkt_receiver4_start (void);
16 extern void cdecl pkt_receiver4_rm (void);
17 extern void cdecl pkt_receiver4_end (void);
18#endif
19
20#endif
21
pkt_info
Placeholder for vital data accessed by capture thread.
Definition: pcpkt.h:206


Watt-32 tcp/ip: E:/WATT/inc/rpc/auth.h Source File

  • inc
  • rpc
auth.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * auth.h, Authentication interface.
36 *
37 * Copyright (C) 1984, Sun Microsystems, Inc.
38 *
39 * The data structures are completely opaque to the client. The client
40 * is required to pass a AUTH * to routines that create rpc
41 * "sessions".
42 */
43
44#ifndef __RPC_AUTH_H
45#define __RPC_AUTH_H
46
47#ifndef __SYS_CDEFS_H
48#include <sys/cdefs.h>
49#endif
50
51#ifndef __SYS_SOCKET_H
52#include <sys/socket.h>
53#endif
54
55#include <rpc/xdr.h>
56
57#define MAX_AUTH_BYTES 400
58#define MAXNETNAMELEN 255 /* maximum length of network user's name */
59
60/*
61 * Status returned from authentication check
62 */
63enum auth_stat {
64 AUTH_OK = 0,
65 /*
66 * failed at remote end
67 */
68 AUTH_BADCRED = 1, /* bogus credentials (seal broken) */
69 AUTH_REJECTEDCRED = 2, /* client should begin new session */
70 AUTH_BADVERF = 3, /* bogus verifier (seal broken) */
71 AUTH_REJECTEDVERF = 4, /* verifier expired or was replayed */
72 AUTH_TOOWEAK = 5, /* rejected due to security reasons */
73 /*
74 * failed locally
75 */
76 AUTH_INVALIDRESP = 6, /* bogus response verifier */
77 AUTH_FAILED = 7 /* some unknown reason */
78};
79
80union des_block {
81 struct {
82 u_long high;
83 u_long low;
84 } key;
85 char c[8];
86 };
87
88typedef union des_block des_block;
89
90__BEGIN_DECLS
91
92extern bool_t xdr_des_block (XDR *, des_block *);
93
94__END_DECLS
95
96/*
97 * Authentication info. Opaque to client.
98 */
99struct opaque_auth {
100 enum_t oa_flavor; /* flavor of auth */
101 caddr_t oa_base; /* address of more auth stuff */
102 u_int oa_length; /* not to exceed MAX_AUTH_BYTES */
103 };
104
105/*
106 * Auth handle, interface to client side authenticators.
107 */
108typedef struct {
109 struct opaque_auth ah_cred;
110 struct opaque_auth ah_verf;
111 union des_block ah_key;
112 struct auth_ops {
113 void (*ah_nextverf)();
114 int (*ah_marshal)(); /* nextverf & serialize */
115 int (*ah_validate)(); /* validate verifier */
116 int (*ah_refresh)(); /* refresh credentials */
117 void (*ah_destroy)(); /* destroy this structure */
118 } *ah_ops;
119 caddr_t ah_private;
120 } AUTH;
121
122
123/*
124 * Authentication ops.
125 * The ops and the auth handle provide the interface to the authenticators.
126 *
127 * AUTH *auth;
128 * XDR *xdrs;
129 * struct opaque_auth verf;
130 */
131#define AUTH_NEXTVERF(auth) ((*((auth)->ah_ops->ah_nextverf))(auth))
132#define auth_nextverf(auth) ((*((auth)->ah_ops->ah_nextverf))(auth))
133
134#define AUTH_MARSHALL(auth,xdrs) ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
135#define auth_marshall(auth,xdrs) ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
136
137#define AUTH_VALIDATE(auth,verfp) ((*((auth)->ah_ops->ah_validate))((auth), verfp))
138#define auth_validate(auth,verfp) ((*((auth)->ah_ops->ah_validate))((auth), verfp))
139
140#define AUTH_REFRESH(auth) ((*((auth)->ah_ops->ah_refresh))(auth))
141#define auth_refresh(auth) ((*((auth)->ah_ops->ah_refresh))(auth))
142
143#define AUTH_DESTROY(auth) ((*((auth)->ah_ops->ah_destroy))(auth))
144#define auth_destroy(auth) ((*((auth)->ah_ops->ah_destroy))(auth))
145
146extern struct opaque_auth _null_auth;
147
148
149/*
150 * These are the various implementations of client side authenticators.
151 */
152
153/*
154 * Unix style authentication
155 * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
156 * char *machname;
157 * int uid;
158 * int gid;
159 * int len;
160 * int *aup_gids;
161 */
162
163__BEGIN_DECLS
164
165extern AUTH *authunix_create (char *, int, int, int, int *);
166extern AUTH *authunix_create_default(void);
167extern AUTH *authnone_create (void);
168extern AUTH *authdes_create (char*, u_int, struct sockaddr*, des_block*);
169
170__END_DECLS
171
172#define AUTH_NONE 0 /* no authentication */
173#define AUTH_NULL 0 /* backward compatibility */
174#define AUTH_UNIX 1 /* unix style (uid, gids) */
175#define AUTH_SHORT 2 /* short hand unix style */
176#define AUTH_DES 3 /* des style (encrypted timestamps) */
177
178#endif
cdefs.h
socket.h
AUTH::auth_ops
Definition: auth.h:112
AUTH
Definition: auth.h:108
XDR
Definition: xdr.h:116
opaque_auth
Definition: auth.h:99
sockaddr
Definition: socket.h:181
des_block
Definition: auth.h:80
xdr.h


Watt-32 tcp/ip: E:/WATT/inc/rpc/auth_des.h Source File

  • inc
  • rpc
auth_des.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * Copyright (c) 1988 by Sun Microsystems, Inc.
36 *
37 * auth_des.h, Protocol for DES style authentication for RPC
38 */
39
40#ifndef __AUTH_DES_H
41#define __AUTH_DES_H
42
43#include <rpc/auth.h>
44
45/*
46 * There are two kinds of "names": fullnames and nicknames
47 */
48enum authdes_namekind {
49 ADN_FULLNAME,
50 ADN_NICKNAME
51};
52
53/*
54 * A fullname contains the network name of the client,
55 * a conversation key and the window
56 */
57struct authdes_fullname {
58 char *name; /* network name of client, up to MAXNETNAMELEN */
59 des_block key; /* conversation key */
60 u_long window; /* associated window */
61};
62
63/*
64 * A credential
65 */
66struct authdes_cred {
67 enum authdes_namekind adc_namekind;
68 struct authdes_fullname adc_fullname;
69 u_long adc_nickname;
70};
71
72/*
73 * A des authentication verifier
74 */
75struct authdes_verf {
76 union {
77 struct timeval adv_ctime; /* clear time */
78 des_block adv_xtime; /* crypt time */
79 } adv_time_u;
80 u_long adv_int_u;
81};
82
83/*
84 * des authentication verifier: client variety
85 *
86 * adv_timestamp is the current time.
87 * adv_winverf is the credential window + 1.
88 * Both are encrypted using the conversation key.
89 */
90#define adv_timestamp adv_time_u.adv_ctime
91#define adv_xtimestamp adv_time_u.adv_xtime
92#define adv_winverf adv_int_u
93
94/*
95 * des authentication verifier: server variety
96 *
97 * adv_timeverf is the client's timestamp + client's window
98 * adv_nickname is the server's nickname for the client.
99 * adv_timeverf is encrypted using the conversation key.
100 */
101#define adv_timeverf adv_time_u.adv_ctime
102#define adv_xtimeverf adv_time_u.adv_xtime
103#define adv_nickname adv_int_u
104
105#endif /* !__AUTH_DES_H */
auth.h
authdes_cred
Definition: auth_des.h:66
authdes_fullname
Definition: auth_des.h:57
authdes_verf
Definition: auth_des.h:75
timeval
Definition: wtime.h:30
des_block
Definition: auth.h:80


Watt-32 tcp/ip: E:/WATT/inc/rpc/auth_uni.h Source File

  • inc
  • rpc
auth_uni.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * auth_unix.h, Protocol for UNIX style authentication parameters for RPC
36 *
37 * Copyright (C) 1984, Sun Microsystems, Inc.
38 */
39
40/*
41 * The system is very weak. The client uses no encryption for it
42 * credentials and only sends null verifiers. The server sends backs
43 * null verifiers or optionally a verifier that suggests a new short hand
44 * for the credentials.
45 */
46
47#ifndef __RPC_AUTH_UNIX_H
48#define __RPC_AUTH_UNIX_H
49
50#include <rpc/auth.h>
51
52/* The machine name is part of a credential; it may not exceed 255 bytes */
53#define MAX_MACHINE_NAME 255
54
55/* gids compose part of a credential; there may not be more than 16 of them */
56#define NGRPS 16
57
58/*
59 * Unix style credentials.
60 */
61struct authunix_parms {
62 u_long aup_time;
63 char *aup_machname;
64 int aup_uid;
65 int aup_gid;
66 u_int aup_len;
67 int *aup_gids;
68};
69
70__BEGIN_DECLS
71
72extern bool_t xdr_authunix_parms (XDR *, struct authunix_parms *);
73
74__END_DECLS
75
76/*
77 * If a response verifier has flavor AUTH_SHORT,
78 * then the body of the response verifier encapsulates the following structure;
79 * again it is serialized in the obvious fashion.
80 */
81struct short_hand_verf {
82 struct opaque_auth new_cred;
83};
84
85#endif
auth.h
XDR
Definition: xdr.h:116
authunix_parms
Definition: auth_uni.h:61
opaque_auth
Definition: auth.h:99
short_hand_verf
Definition: auth_uni.h:81


Watt-32 tcp/ip: E:/WATT/src/bind.c Source File

  • src
bind.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 * 0.6 : Aug 06, 2002 : G. Vanem - added AF_INET6 support
37 */
38
39#include "socket.h"
40
41#if defined(USE_BSD_API)
42
63int W32_CALL bind (int s, const struct sockaddr *myaddr, socklen_t namelen)
64{
65 Socket *socket = _socklist_find (s);
66 struct sockaddr_in *addr = (struct sockaddr_in*) myaddr;
67 struct sockaddr_in6 *addr6 = (struct sockaddr_in6*) myaddr;
68 BOOL bind_any, is_bcast, is_mcast, our_addr;
69 WORD local_port;
70 BOOL is_ip6;
71 int sa_len;
72
73 SOCK_PROLOGUE (socket, "\nbind:%d", s);
74
75 is_ip6 = (socket->so_family == AF_INET6);
76 sa_len = is_ip6 ? sizeof(*addr6) : sizeof(*addr);
77
78 if (_sock_chk_sockaddr(socket, myaddr, namelen) < 0)
79 return (-1);
80
81 if (socket->so_type == SOCK_STREAM)
82 {
83 if (is_ip6)
84 is_mcast = IN6_IS_ADDR_MULTICAST (&addr6->sin6_addr);
85 else is_mcast = IN_MULTICAST (ntohl(addr->sin_addr.s_addr));
86 if (is_mcast)
87 {
88 SOCK_DEBUGF ((", EINVAL (mcast)"));
89 SOCK_ERRNO (EINVAL);
90 return (-1);
91 }
92 }
93
94 /* binding to any address/port on local machine?
95 */
96#if defined(USE_IPV6)
97 if (is_ip6)
98 {
99 our_addr = _ip6_is_local_addr (&addr6->sin6_addr);
100 bind_any = IN6_ARE_ADDR_EQUAL (&addr6->sin6_addr, &in6addr_any);
101 is_bcast = IN6_IS_ADDR_MC_GLOBAL (&addr6->sin6_addr); /* ?? */
102 }
103 else
104#endif
105 {
106 our_addr = _ip4_is_local_addr (ntohl(addr->sin_addr.s_addr));
107 bind_any = (addr->sin_addr.s_addr == INADDR_ANY);
108 is_bcast = ((~addr->sin_addr.s_addr & ~sin_mask) == 0);
109 }
110
111 if (socket->so_type == SOCK_STREAM &&
112 !bind_any && !our_addr && !is_bcast)
113 {
114 SOCK_DEBUGF ((", EADDRNOTAVAIL"));
115 SOCK_ERRNO (EADDRNOTAVAIL);
116 return (-1);
117 }
118
119 if (socket->local_addr)
120 {
121 struct in6_addr *ip6 = &((struct sockaddr_in6*) socket->local_addr)->sin6_addr;
122 u_short port = socket->local_addr->sin_port;
123 u_long ip4 = socket->local_addr->sin_addr.s_addr;
124 BOOL equal = (!is_ip6 && ip4 == addr->sin_addr.s_addr) ||
125 (is_ip6 && IN6_ARE_ADDR_EQUAL(ip6,&addr6->sin6_addr));
126
127 if ((addr->sin_port != IPPORT_ANY && addr->sin_port == port) ||
128 (!bind_any && equal))
129 {
130 SOCK_DEBUGF ((", EADDRINUSE, local port %d, bind_any %d",
131 ntohs(port), bind_any));
132 SOCK_ERRNO (EADDRINUSE);
133 return (-1);
134 }
135
139 }
140 else
141 {
142 socket->local_addr = (struct sockaddr_in*) SOCK_CALLOC (sa_len);
143 if (!socket->local_addr)
144 {
145 SOCK_DEBUGF ((", ENOMEM"));
146 SOCK_ERRNO (ENOMEM);
147 return (-1);
148 }
149 }
150
151#if defined(USE_IPV6)
152 if (is_ip6 && addr6->sin6_port == IPPORT_ANY)
153 {
154 local_port = find_free_port (0, TRUE);
155 addr6->sin6_port = htons (local_port);
156 }
157 else
158#endif
159 if (!is_ip6 && addr->sin_port == IPPORT_ANY)
160 {
161 local_port = find_free_port (0, TRUE);
162 addr->sin_port = htons (local_port);
163 }
164 else /* check if requested port is vacant */
165 {
166 local_port = ntohs (addr->sin_port);
167 if (grab_localport(local_port) < 0)
168 {
169 SOCK_DEBUGF ((", EADDRNOTAVAIL, local port %d", local_port));
170 SOCK_ERRNO (EADDRNOTAVAIL);
171 return (-1);
172 }
173 }
174
175#if defined(USE_IPV6)
176 if (is_ip6)
177 {
178 struct sockaddr_in6 *la = (struct sockaddr_in6*)socket->local_addr;
179
180 la->sin6_family = AF_INET6;
181 la->sin6_port = addr6->sin6_port;
182 memcpy (&la->sin6_addr, &addr6->sin6_addr, sizeof(la->sin6_addr));
183
184 SOCK_DEBUGF ((", %s, (%d)",
185 bind_any ? "INADDR_ANY" : _inet6_ntoa(&addr6->sin6_addr),
186 ntohs(addr->sin_port)));
187 }
188 else
189#endif
190 {
191 socket->local_addr->sin_port = addr->sin_port;
192 socket->local_addr->sin_addr = addr->sin_addr;
193 socket->local_addr->sin_family = AF_INET;
194
195 SOCK_DEBUGF ((", %s, (%d)",
196 bind_any ? "INADDR_ANY" : inet_ntoa(addr->sin_addr),
197 ntohs(addr->sin_port)));
198 }
199
200 /* Since SOCK_DGRAM sockets are connectionless, the application need
201 * not use connect() or accept(). Hence we need to use _UDP_listen().
202 */
203 if (socket->so_type == SOCK_DGRAM)
204 {
205 if (bind_any)
206 socket->so_state |= SS_PRIV; /* privileged for broadcast reception */
207
208#if defined(USE_IPV6)
209 if (is_ip6)
210 {
211 if (_UDP6_listen (socket, &addr6->sin6_addr, addr6->sin6_port) < 0)
212 return (-1);
213 }
214 else
215#endif
216 if (_UDP_listen (socket, addr->sin_addr, addr->sin_port) < 0)
217 return (-1);
218 }
219 return (0);
220}
221#endif /* USE_BSD_API */
222
223/*
224 * A small test djgpp program
225 */
226#if defined(TEST_PROG)
227#if !defined(USE_BSD_API)
228int main (void)
229{
230 puts ("This program needs '#define USE_BSD_API'");
231 return (1);
232}
233#else /* rest of file */
234
235#define MY_PORT_ID 6060
236#undef close
237
238#if !defined(__CYGWIN__)
239#include <conio.h>
240#endif
241
242#ifndef STDIN_FILENO
243#define STDIN_FILENO 0
244#endif
245
246#include "pcdbug.h"
247
248int main (int argc, char **argv)
249{
250 struct sockaddr_in addr;
251 int sock, quit;
252
253 dbug_init();
254
255 sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
256 if (sock < 0)
257 {
258 perror ("socket");
259 return (-1);
260 }
261
262 memset (&addr, 0, sizeof(addr));
263 addr.sin_family = AF_INET;
264
265 if (argc >= 2 && !strcmp(argv[1],"-frag")) /* test Tx of large datagrams */
266 {
267 #define CHUNK_SIZE 500
268 char data [3*CHUNK_SIZE];
269 size_t i;
270
271 for (i = 0; i < sizeof(data); i++)
272 data[i] = i;
273
274 addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
275 addr.sin_port = IPPORT_ANY;
276
277 if (sendto (sock, &data, sizeof(data), 0, (struct sockaddr*)&addr, sizeof(addr)) < 0)
278 perror ("sendto");
279
280 close (sock);
281 return (-1);
282 }
283
284 /* INADDR_ANY will take all the address of the system
285 */
286 addr.sin_addr.s_addr = htonl (INADDR_ANY);
287 addr.sin_port = htons (MY_PORT_ID);
288
289 if (bind(sock, (struct sockaddr*)&addr, sizeof(addr)) < 0)
290 {
291 perror ("bind");
292 close (sock);
293 return (-1);
294 }
295
296#if 0
297 if (listen (sock, 5) < 0)
298 {
299 perror ("listen");
300 close (sock);
301 return (-1);
302 }
303#endif
304
305 quit = 0;
306
307 while (!quit)
308 {
309 struct timeval tv;
310 struct sockaddr from;
311 fd_set fd_read, fd_write, fd_exc;
312 int num, from_len = sizeof(from);
313
314 FD_ZERO (&fd_read);
315 FD_ZERO (&fd_write);
316 FD_ZERO (&fd_exc);
317 FD_SET (STDIN_FILENO, &fd_read);
318 FD_SET (sock, &fd_read);
319 FD_SET (sock, &fd_write);
320 FD_SET (sock, &fd_exc);
321 tv.tv_usec = 0;
322 tv.tv_sec = 1;
323
324 num = select (sock+1, &fd_read, &fd_write, &fd_exc, &tv);
325
326 if (FD_ISSET(sock, &fd_read)) fputc ('r', stderr);
327 if (FD_ISSET(sock, &fd_write)) fputc ('w', stderr);
328 if (FD_ISSET(sock, &fd_exc)) fputc ('x', stderr);
329
330 if (FD_ISSET(STDIN_FILENO, &fd_read))
331 {
332 int ch = getch();
333 quit = (ch == 27);
334 fputc (ch, stderr);
335 }
336
337 if (FD_ISSET(sock, &fd_read) &&
338 accept (sock, &from, &from_len) < 0)
339 {
340 perror ("accept");
341 break;
342 }
343 if (num < 0)
344 {
345 perror ("select");
346 break;
347 }
348 fputc ('.', stderr);
349 usleep (300000); /* 300ms */
350 }
351
352 close (sock);
353 return (0);
354}
355#endif /* USE_BSD_API */
356#endif /* TEST_PROG */
357
accept
int W32_CALL accept(int s, struct sockaddr *addr, socklen_t *addrlen)
Definition: accept.c:67
bind
int W32_CALL bind(int s, const struct sockaddr *myaddr, socklen_t namelen)
bind() - bind name to socket.
Definition: bind.c:63
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
pcdbug.h
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
_sock_chk_sockaddr
int _sock_chk_sockaddr(Socket *socket, const struct sockaddr *sa, socklen_t len)
Check ‘sockaddr*’ passed to bind/connect.
Definition: socket.c:819
_UDP6_listen
int _UDP6_listen(Socket *socket, const void *host, WORD port)
Definition: socket.c:2171
Socket
Definition: socket.h:158
fd_set
Definition: wtypes.h:256
in6_addr
Definition: in.h:151
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
timeval
Definition: wtime.h:30


Watt-32 tcp/ip: E:/WATT/inc/net/bpf.h Source File

  • inc
  • net
bpf.h
Go to the documentation of this file.
1
4/*
5 * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from the Stanford/CMU enet packet filter,
9 * (net/enet.c) distributed as part of 4.3BSD, and code contributed
10 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
11 * Berkeley Laboratory.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgement:
23 * This product includes software developed by the University of
24 * California, Berkeley and its contributors.
25 * 4. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 */
41
42#ifndef __NET_BPF_H
43#define __NET_BPF_H
44
45#ifndef __SYS_WTYPES_H
46#include <sys/wtypes.h>
47#endif
48
49#ifndef __SYS_WTIME_H
50#include <sys/wtime.h>
51#endif
52
53/* BSD style release date */
54#define BPF_RELEASE 199606
55
56typedef long bpf_int32;
57typedef u_int32_t bpf_u_int32;
58
59/*
60 * Alignment macros. BPF_WORDALIGN rounds up to the next
61 * even multiple of BPF_ALIGNMENT.
62 */
63#define BPF_ALIGNMENT sizeof(long)
64#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1)) & ~(BPF_ALIGNMENT-1))
65
66#define BPF_MAXINSNS 512
67#define BPF_MAXBUFSIZE 0x8000
68#define BPF_MINBUFSIZE 32
69
70/*
71 * Structure for BIOCSETF.
72 */
73struct bpf_program {
74 u_int bf_len;
75 struct bpf_insn *bf_insns;
76 };
77
78/*
79 * Struct returned by BIOCGSTATS.
80 */
81struct bpf_stat {
82 u_int bs_recv; /* number of packets received */
83 u_int bs_drop; /* number of packets dropped */
84 };
85
86/*
87 * Struct return by BIOCVERSION. This represents the version number of
88 * the filter language described by the instruction encodings below.
89 * bpf understands a program iff kernel_major == filter_major &&
90 * kernel_minor >= filter_minor, that is, if the value returned by the
91 * running kernel has the same major number and a minor number equal
92 * equal to or less than the filter being downloaded. Otherwise, the
93 * results are undefined, meaning an error may be returned or packets
94 * may be accepted haphazardly.
95 * It has nothing to do with the source code version.
96 */
97struct bpf_version {
98 u_short bv_major;
99 u_short bv_minor;
100 };
101
102/* Current version number of filter architecture. */
103#define BPF_MAJOR_VERSION 1
104#define BPF_MINOR_VERSION 1
105
106/*
107 * BPF ioctls
108 *
109 * The first set is for compatibility with Sun's pcc style
110 * header files. If your using gcc, we assume that you
111 * have run fixincludes so the latter set should work.
112 */
113#if (defined(sun) || defined(ibm032)) && !defined(__GNUC__)
114# define BIOCGBLEN _IOR(B,102, u_int)
115# define BIOCSBLEN _IOWR(B,102, u_int)
116# define BIOCSETF _IOW(B,103, struct bpf_program)
117# define BIOCFLUSH _IO(B,104)
118# define BIOCPROMISC _IO(B,105)
119# define BIOCGDLT _IOR(B,106, u_int)
120# define BIOCGETIF _IOR(B,107, struct ifreq)
121# define BIOCSETIF _IOW(B,108, struct ifreq)
122# define BIOCSRTIMEOUT _IOW(B,109, struct timeval)
123# define BIOCGRTIMEOUT _IOR(B,110, struct timeval)
124# define BIOCGSTATS _IOR(B,111, struct bpf_stat)
125# define BIOCIMMEDIATE _IOW(B,112, u_int)
126# define BIOCVERSION _IOR(B,113, struct bpf_version)
127# define BIOCSTCPF _IOW(B,114, struct bpf_program)
128# define BIOCSUDPF _IOW(B,115, struct bpf_program)
129#else
130# define BIOCGBLEN _IOR('B',102, u_int)
131# define BIOCSBLEN _IOWR('B',102, u_int)
132# define BIOCSETF _IOW('B',103, struct bpf_program)
133# define BIOCFLUSH _IO('B',104)
134# define BIOCPROMISC _IO('B',105)
135# define BIOCGDLT _IOR('B',106, u_int)
136# define BIOCGETIF _IOR('B',107, struct ifreq)
137# define BIOCSETIF _IOW('B',108, struct ifreq)
138# define BIOCSRTIMEOUT _IOW('B',109, struct timeval)
139# define BIOCGRTIMEOUT _IOR('B',110, struct timeval)
140# define BIOCGSTATS _IOR('B',111, struct bpf_stat)
141# define BIOCIMMEDIATE _IOW('B',112, u_int)
142# define BIOCVERSION _IOR('B',113, struct bpf_version)
143# define BIOCSTCPF _IOW('B',114, struct bpf_program)
144# define BIOCSUDPF _IOW('B',115, struct bpf_program)
145#endif
146
147/*
148 * Structure prepended to each packet.
149 */
150struct bpf_hdr {
151 struct timeval bh_tstamp; /* time stamp */
152 u_int32_t bh_caplen; /* length of captured portion */
153 u_int32_t bh_datalen; /* original length of packet */
154 u_int16_t bh_hdrlen; /* length of bpf header (this struct */
155 }; /* plus alignment padding) */
156
157/*
158 * Because the structure above is not a multiple of 4 bytes, some compilers
159 * will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work.
160 * Only the kernel needs to know about it; applications use bh_hdrlen.
161 * XXX To save a few bytes on 32-bit machines, we avoid end-of-struct
162 * XXX padding by using the size of the header data elements. This is
163 * XXX fail-safe: on new machines, we just use the 'safe' sizeof.
164 */
165#define SIZEOF_BPF_HDR sizeof(struct bpf_hdr)
166
167/*
168 * Data-link level type codes.
169 */
170#define DLT_NULL 0 /* no link-layer encapsulation */
171#define DLT_EN10MB 1 /* Ethernet (10Mb) */
172#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */
173#define DLT_AX25 3 /* Amateur Radio AX.25 */
174#define DLT_PRONET 4 /* Proteon ProNET Token Ring */
175#define DLT_CHAOS 5 /* Chaos */
176#define DLT_IEEE802 6 /* IEEE 802 Networks */
177#define DLT_ARCNET 7 /* ARCNET */
178#define DLT_SLIP 8 /* Serial Line IP */
179#define DLT_PPP 9 /* Point-to-point Protocol */
180#define DLT_FDDI 10 /* FDDI */
181#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
182#define DLT_RAW 12 /* raw IP */
183#define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */
184#define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */
185#define DLT_LANE8023 15 /* LANE 802.3(Ethernet) */
186#define DLT_CIP 16 /* ATM Classical IP */
187
188/*
189 * The instruction encondings.
190 */
191/* instruction classes */
192#define BPF_CLASS(code) ((code) & 0x07)
193#define BPF_LD 0x00
194#define BPF_LDX 0x01
195#define BPF_ST 0x02
196#define BPF_STX 0x03
197#define BPF_ALU 0x04
198#define BPF_JMP 0x05
199#define BPF_RET 0x06
200#define BPF_MISC 0x07
201
202/* ld/ldx fields */
203#define BPF_SIZE(code) ((code) & 0x18)
204#define BPF_W 0x00
205#define BPF_H 0x08
206#define BPF_B 0x10
207#define BPF_MODE(code) ((code) & 0xe0)
208#define BPF_IMM 0x00
209#define BPF_ABS 0x20
210#define BPF_IND 0x40
211#define BPF_MEM 0x60
212#define BPF_LEN 0x80
213#define BPF_MSH 0xa0
214
215/* alu/jmp fields */
216#define BPF_OP(code) ((code) & 0xf0)
217#define BPF_ADD 0x00
218#define BPF_SUB 0x10
219#define BPF_MUL 0x20
220#define BPF_DIV 0x30
221#define BPF_OR 0x40
222#define BPF_AND 0x50
223#define BPF_LSH 0x60
224#define BPF_RSH 0x70
225#define BPF_NEG 0x80
226#define BPF_JA 0x00
227#define BPF_JEQ 0x10
228#define BPF_JGT 0x20
229#define BPF_JGE 0x30
230#define BPF_JSET 0x40
231#define BPF_SRC(code) ((code) & 0x08)
232#define BPF_K 0x00
233#define BPF_X 0x08
234
235/* ret - BPF_K and BPF_X also apply */
236#define BPF_RVAL(code) ((code) & 0x18)
237#define BPF_A 0x10
238
239/* misc */
240#define BPF_MISCOP(code) ((code) & 0xf8)
241#define BPF_TAX 0x00
242#define BPF_TXA 0x80
243
244/*
245 * The instruction data structure.
246 */
247struct bpf_insn {
248 u_int16_t code;
249 u_char jt;
250 u_char jf;
251 int32_t k;
252 };
253
254/*
255 * Macros for insn array initializers.
256 */
257#define BPF_STMT(code, k) { (u_int16_t)(code), 0, 0, k }
258#define BPF_JUMP(code, k, jt, jf) { (u_int16_t)(code), jt, jf, k }
259
260u_int bpf_filter (struct bpf_insn *, u_char *, u_int, u_int);
261
262/*
263 * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
264 */
265#define BPF_MEMWORDS 16
266
267#endif
bpf_hdr
Berkeley Packet Filter header.
Definition: packet32.h:241
bpf_insn
Definition: bpf.h:247
bpf_program
Definition: bpf.h:73
bpf_stat
Definition: packet32.h:251
bpf_version
Definition: bpf.h:97
code
Definition: zinftree.h:24
timeval
Definition: wtime.h:30
wtime.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/net/bpfdesc.h Source File

  • inc
  • net
bpfdesc.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1990, 1991, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * This code is derived from the Stanford/CMU enet packet filter,
10 * (net/enet.c) distributed as part of 4.3BSD, and code contributed
11 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
12 * Berkeley Laboratory.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 * 3. All advertising materials mentioning features or use of this software
23 * must display the following acknowledgement:
24 * This product includes software developed by the University of
25 * California, Berkeley and its contributors.
26 * 4. Neither the name of the University nor the names of its contributors
27 * may be used to endorse or promote products derived from this software
28 * without specific prior written permission.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
31 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 *
42 */
43
44#ifndef __NET_BPF_DESC_H
45#define __NET_BPF_DESC_H
46
47#include <sys/wtypes.h>
48
49/*
50 * Descriptor associated with each open bpf file.
51 */
52struct bpf_d {
53 struct bpf_d *bd_next; /* Linked list of descriptors */
54 /*
55 * Buffer slots: two mbuf clusters buffer the incoming packets.
56 * The model has three slots. Sbuf is always occupied.
57 * sbuf (store) - Receive interrupt puts packets here.
58 * hbuf (hold) - When sbuf is full, put cluster here and
59 * wakeup read (replace sbuf with fbuf).
60 * fbuf (free) - When read is done, put cluster here.
61 * On receiving, if sbuf is full and fbuf is 0, packet is dropped.
62 */
63 caddr_t bd_sbuf; /* store slot */
64 caddr_t bd_hbuf; /* hold slot */
65 caddr_t bd_fbuf; /* free slot */
66 int bd_slen; /* current length of store buffer */
67 int bd_hlen; /* current length of hold buffer */
68
69 int bd_bufsize; /* absolute length of buffers */
70
71 struct bpf_if *bd_bif; /* interface descriptor */
72 u_long bd_rtout; /* Read timeout in 'ticks' */
73 struct bpf_insn *bd_filter; /* filter code */
74 u_long bd_rcount; /* number of packets received */
75 u_long bd_dcount; /* number of packets dropped */
76
77 u_char bd_promisc; /* true if listening promiscuously */
78 u_char bd_state; /* idle, waiting, or timed out */
79 u_char bd_immediate; /* true to return on packet arrival */
80 int bd_async; /* non-zero if packet reception should generate signal */
81 int bd_pgid; /* process or group id for signal */
82 u_char bd_pad; /* explicit alignment */
83 struct selinfo bd_sel; /* bsd select info */
84};
85
86/*
87 * Descriptor associated with each attached hardware interface.
88 */
89struct bpf_if {
90 struct bpf_if *bif_next; /* list of all interfaces */
91 struct bpf_d *bif_dlist; /* descriptor list */
92 struct bpf_if **bif_driverp; /* pointer into softc */
93 u_int bif_dlt; /* link layer type */
94 u_int bif_hdrlen; /* length of header (with padding) */
95 struct ifnet *bif_ifp; /* correspoding interface */
96};
97#endif
bpf_d
Definition: bpfdesc.h:52
bpf_if
Definition: bpfdesc.h:89
bpf_insn
Definition: bpf.h:247
ifnet
Definition: if.h:136
selinfo
Definition: wtypes.h:364
wtypes.h


Watt-32 tcp/ip: E:/WATT/src/bsddbug.c Source File

  • src
bsddbug.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 * Debug functions moved from socket.c
37 */
38
39#include "socket.h"
40#include "run.h"
41#include "get_xby.h"
42
43#if defined(USE_DEBUG) && defined(USE_BSD_API) /* Whole file */
44
45#define USE_PRINTK 0
46#define SCOPE_INDENT 2 /* How much to indent printout at each new scope */
47
48static int sk_scope = 0;
50static void (W32_CALL *prev_hook) (const char*, const char*);
51
52static BOOL dbg_use_ods = FALSE;
53static FILE *dbg_file = NULL;
54static char dbg_omode[5] = "w+"; /* max "w+tc" */
55static char dbg_fname[MAX_PATHLEN+1] = "";
56
57static void W32_CALL bsddbug_exit (void);
58static void bsddbug_close (void);
59
60#if defined(WIN32)
61static int ods_printf (const char *fmt, va_list arg);
62#endif
63
64int MS_CDECL _sock_debugf (const char *fmt, ...)
65{
66 int len = 0, rc = 0;
67 char buf[256];
68 va_list arg;
69 int err, errno_save = errno;
70
71 if (!debug_xmit || !fmt) /* dbug_init() not called */
72 return (0);
73
74#if defined(WIN32)
75 if (dbg_use_ods)
76 {
77 va_start (arg, fmt);
78 rc = ods_printf (fmt, arg);
79 va_end (arg);
80 return (rc);
81 }
82#endif
83
84 if (!dbg_file)
85 return (rc);
86
87 va_start (arg, fmt);
88
89 if (*fmt == '\n')
90 {
91#if (USE_PRINTK)
92 len = _printk ("\n%9s: ", elapsed_str(set_timeout(0)));
93 if (sk_scope > 0)
94 len += _printk ("%*s", SCOPE_INDENT*sk_scope, "");
95#else
96 len = fprintf (dbg_file, "\n%9s: ", elapsed_str(set_timeout(0)));
97 if (sk_scope > 0)
98 len += fprintf (dbg_file, "%*s", SCOPE_INDENT*sk_scope, "");
99#endif
100 fmt++;
101 if (*fmt == '\0')
102 return (len);
103 }
104
105#if (USE_PRINTK)
106 _vsnprintk (buf, sizeof(buf), fmt, arg);
107 rc = _fputsk (buf, dbg_file);
108#else
109 vsprintf (buf, fmt, arg);
110 rc = fputs (buf, dbg_file);
111#endif
112
113 err = errno;
114 _sock_dbug_flush();
115
116 if (rc == EOF)
117 {
118 TRACE_CONSOLE (1, "%s (%d): write failed; %s\n",
119 __FILE__, __LINE__, strerror(err));
120 bsddbug_close();
121 }
122 else
123 len += rc;
124
125 errno = errno_save;
126 va_end (arg);
127 return (len);
128}
129
130BOOL _sock_dbug_active (void)
131{
132 return (dbg_file != NULL || dbg_use_ods);
133}
134
135void _sock_dbug_flush (void)
136{
137 if (!dbg_file)
138 return;
139
140#if (USE_PRINTK)
141 _printk_safe = TRUE;
142 _printk_flush();
143#else
144 fflush (dbg_file);
145#endif
146}
147
148/*
149 * Called from sock_ini.c if 'debug_xmit' != NULL.
150 */
151void _sock_dbug_open (void)
152{
153 if (dbg_file == stdout || dbg_file == stderr || dbg_use_ods)
154 return;
155
156#if (USE_PRINTK)
157 if (_printk_init(2000, dbg_fname))
158 {
159 dbg_file = _printk_file;
160 RUNDOWN_ADD (bsddbug_exit, 150);
161 }
162#else
163 if (!dbg_fname[0])
164 return;
165
166 errno = 0;
167 dbg_file = fopen_excl (dbg_fname, dbg_omode);
168 if (dbg_file)
169 {
170#if !defined(__BORLANDC__) && !defined(__AVR__) /* buggy output with this */
171 static char buf [1024];
172 setvbuf (dbg_file, buf, _IOLBF, sizeof(buf));
173#endif
174 RUNDOWN_ADD (bsddbug_exit, 150);
175 }
176#endif /* USE_PRINTK */
177
178 TRACE_CONSOLE (2, "%s (%d): dbg_file `%s', handle %d, errno %d\n",
179 __FILE__, __LINE__, dbg_fname,
180 dbg_file ? fileno(dbg_file) : -1, errno);
181}
182
183/*
184 * Callbacks for config-table parser.
185 */
186static void set_dbg_fname (const char *value)
187{
188 _strlcpy (dbg_fname, value, sizeof(dbg_fname));
189
190 if (!stricmp(dbg_fname,"stderr"))
191 dbg_file = stderr;
192 if (!stricmp(dbg_fname,"stdout") || !stricmp(dbg_fname,"con"))
193 dbg_file = stdout;
194#if defined(WIN32)
195 if (!stricmp(dbg_fname,"$ods"))
196 dbg_use_ods = TRUE;
197#endif
198}
199
200static void set_dbg_openmode (const char *value)
201{
202 _strlcpy (dbg_omode, value, sizeof(dbg_omode));
203}
204
205/*
206 * Config-file hook routine called from parser.
207 * (set_values() in pcconfig.c and via ourinit() in pcdbug.c)
208 *
209 * Parses keywords:
210 * SK_DEBUG.DEVICE = <file>
211 * SK_DEBUG.OPENMODE = <mode>
212 */
213static void W32_CALL dbug_parse (const char *name, const char *value)
214{
215 static const struct config_table cfg[] = {
216 { "DEVICE", ARG_FUNC, (void*)set_dbg_fname },
217 { "OPENMODE", ARG_FUNC, (void*)set_dbg_openmode },
218 { NULL, 0, NULL }
219 };
220
221 if (!parse_config_table(&cfg[0], "SK_DEBUG.", name, value) && prev_hook)
222 (*prev_hook) (name, value);
223}
224
225/*
226 * Normally called from dbug_init() (in pcdbug.c) if USE_DEBUG is defined.
227 * Must be called before watt_sock_init() and any other socket functions.
228 */
229void _sock_dbug_init (void)
230{
231 prev_hook = usr_init;
232 usr_init = dbug_parse;
233}
234
235static void show_local_ports_inuse (void)
236{
237 WORD port, num = 0;
238
239 if (!dbg_file)
240 return;
241
242#if (USE_PRINTK)
243 _printk ("\nLocal ports still in use:\n");
244#else
245 fprintf (dbg_file, "\nLocal ports still in use:\n");
246#endif
247
248 for (port = 1025; port < USHRT_MAX; port++)
249 {
250 int rc = reuse_localport (port);
251
252 if (rc < 0)
253 break;
254 if (rc > 0)
255 {
256 num++;
257#if (USE_PRINTK)
258 _printk ("%5u%c", port, num % 12 ? ',' : '\n');
259#else
260 fprintf (dbg_file, "%5u%c", port, (num % 12) ? ',' : '\n');
261#endif
262 }
263 }
264}
265
266#if defined(WIN32)
270static int ods_printf (const char *fmt, va_list arg)
271{
272 char buf1[300];
273 char buf2[400];
274 char *p1 = buf1;
275 char *p2 = buf2;
276 size_t left = sizeof(buf1);
277
278 if (*fmt == '\n')
279 {
280 p1 += SNPRINTF (p1, left, "\n%9s: ", elapsed_str(set_timeout(0)));
281 left -= p1 - buf1;
282 fmt++;
283 if (sk_scope > 0)
284 {
285 p1 += SNPRINTF (p1, left, "%*s", SCOPE_INDENT*sk_scope, "");
286 left -= p1 - buf1;
287 }
288 }
289
290 VSNPRINTF (p1, left, fmt, arg);
291
292 for (p1 = buf1, p2 = buf2; *p1 && p2 < buf2 + sizeof(buf2); p1++, p2++)
293 {
294 if (p1[0] == '\n' && p1[-1] != '\r')
295 *p2++ = '\r';
296 *p2 = *p1;
297 }
298
299#if 0
300 if (p2[-2] != '\r' || p2[-1] != '\n')
301 strcpy (p2, "\r\n"), p2 += 2;
302#endif
303
304 *p2++ = '\0';
305 OutputDebugStringA (buf2);
306
307 /* Because of clang:
308 * warning: Value stored to 'p2' during its initialization is never read
309 */
310 ARGSUSED (p2);
311 return (p2 - buf2);
312}
313#endif /* WIN32 */
314
315
316#include "nochkstk.h"
317
318static void bsddbug_close (void)
319{
320#if (USE_PRINTK == 0)
321 if (dbg_file && dbg_file != stdout && dbg_file != stderr)
322 fclose (dbg_file);
323#endif
324 dbg_file = NULL;
325}
326
327static void W32_CALL bsddbug_exit (void)
328{
329 if (!_watt_fatal_error && dbg_file)
330 {
331 DumpEthersCache();
332 DumpHostsCache();
333#if defined(USE_IPV6)
334 DumpHosts6Cache();
335#endif
336 show_local_ports_inuse();
337 _sock_dbug_flush();
338 }
339 bsddbug_close();
340 set_dbg_openmode ("at"); /* append next time we open it */
341}
342
343/*
344 * These two functions are meant to increase/decrease the suspension
345 * depth of a "task". I.e. _sock_enter_scope() should awake other
346 * sleeping "tasks" waiting to be signalled. Ref. sk_block in socket.c.
347 * Now they're only used to make the sock-trace prettier.
348 */
349void _sock_enter_scope (void)
350{
351 if (sk_scope < INT_MAX)
352 sk_scope++;
353}
354
355void _sock_leave_scope (void)
356{
357 if (sk_scope > 0)
358 sk_scope--;
359}
360#endif /* USE_DEBUG && USE_BSD_API */
361
ods_printf
static int ods_printf(const char *fmt, va_list arg)
Definition: bsddbug.c:270
sk_scope
static int sk_scope
Definition: bsddbug.c:48
get_xby.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
fopen_excl
FILE * fopen_excl(const char *file, const char *mode)
WIN32: Open an existing file (or create) in share-mode but deny other processes to write to the file.
Definition: misc.c:453
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
strerror
char *MS_CDECL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207
nochkstk.h
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
_printk_file
FILE * _printk_file
Definition: printk.c:58
_printk_safe
int _printk_safe
Definition: printk.c:55
config_table
Definition: tcp.h:461
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
elapsed_str
const char * elapsed_str(DWORD val)
Return string "xx:xx" for time elapsed since started.
Definition: timer.c:729


Watt-32 tcp/ip: E:/WATT/src/bsddbug.h Source File

  • src
bsddbug.h
Go to the documentation of this file.
1
3#ifndef _w32_BSDDBUG_H
4#define _w32_BSDDBUG_H
5
6/*
7 * Debugging of BSD-socket API. Writes to "sk_debug.device"
8 * when dbug_init() is called or `SO_DEBUG' is set on socket.
9 */
10#if defined(USE_DEBUG) && defined(USE_BSD_API)
11 #if defined(__POCC__)
12 extern _CRTCHK(printf, 2, 3) int _sock_debugf (const char *fmt, ...);
13 #else
14 extern int MS_CDECL _sock_debugf (_Printf_format_string_
15 const char *fmt, ...) W32_ATTR_PRINTF (1, 2);
16 #endif
17
18 extern void _sock_dbug_flush (void);
19 extern void _sock_dbug_init (void);
20 extern void _sock_dbug_open (void);
21 extern BOOL _sock_dbug_active (void);
22 extern void _sock_enter_scope (void);
23 extern void _sock_leave_scope (void);
24
25 #define SOCK_DEBUGF(x) _sock_debugf x
26 #define SOCK_DBUG_FLUSH() _sock_dbug_flush()
27 #define SOCK_ENTER_SCOPE() _sock_enter_scope()
28 #define SOCK_LEAVE_SCOPE() _sock_leave_scope()
29#else
30 #define SOCK_DEBUGF(x) ((void)0)
31 #define SOCK_DBUG_FLUSH() ((void)0)
32 #define SOCK_ENTER_SCOPE() ((void)0)
33 #define SOCK_LEAVE_SCOPE() ((void)0)
34#endif
35
36#endif


Watt-32 tcp/ip: E:/WATT/src/bsdname.c Source File

  • src
bsdname.c
Go to the documentation of this file.
1
7#include <stdio.h>
8#include <stdlib.h>
9#include <string.h>
10#include <errno.h>
11#include <sys/socket.h>
12
13#include "copyrigh.h"
14#include "wattcp.h"
15#include "pcdns.h"
16#include "pcbuf.h"
17#include "pctcp.h"
18#include "pcdbug.h"
19#include "pcconfig.h"
20#include "ip6_out.h"
21#include "misc.h"
22#include "misc_str.h"
23#include "wdpmi.h"
24#include "x32vm.h"
25#include "win_dll.h"
26#include "powerpak.h"
27#include "bsdname.h"
28
29#ifdef __CYGWIN__
30 #define XHOSTID_RETV long
31 #define SETHOSTNAME_ARG2 size_t
32#else
33 #define XHOSTID_RETV u_long
34 #define SETHOSTNAME_ARG2 int
35#endif
36
37#ifdef __DJGPP__
38 #define GETHOSTNAME_ARG2 int
39#else
40 #define GETHOSTNAME_ARG2 size_t
41#endif
42
43
44
49DWORD W32_CALL _gethostid (void)
50{
51 return (my_ip_addr);
52}
53
58DWORD W32_CALL _sethostid (DWORD ip)
59{
60 return (my_ip_addr = ip);
61}
62
63#if defined(USE_BSD_API)
68XHOSTID_RETV W32_CALL gethostid (void)
69{
70 if (!netdb_init())
71 return (INADDR_NONE);
72 return htonl (my_ip_addr);
73}
74
79XHOSTID_RETV W32_CALL sethostid (u_long ip)
80{
81 return (my_ip_addr = ntohl(ip));
82}
83#endif /* USE_BSD_API */
84
85#if defined(USE_IPV6)
91const void *_gethostid6 (void)
92{
93 if (!netdb_init())
94 return (&in6addr_any);
95 return (&in6addr_my_ip);
96}
97
102void _sethostid6 (const void *addr)
103{
104 memcpy (&in6addr_my_ip, addr, sizeof(in6addr_my_ip));
105}
106#endif /* USE_IPV6 */
107
112int W32_CALL _getpeername (const sock_type *s, void *dest, int *len)
113{
114 struct watt_sockaddr temp;
115 size_t ltemp;
116 int chk = _chk_socket (s);
117
118 if (!s->tcp.hisaddr || !s->tcp.hisport ||
119 (chk != VALID_UDP && chk != VALID_TCP))
120 {
121 if (len)
122 *len = 0;
123 return (-1);
124 }
125
126 memset (&temp, 0, sizeof(temp));
127 temp.s_ip = s->tcp.hisaddr;
128 temp.s_port = s->tcp.hisport;
129 temp.s_type = s->tcp.ip_type;
130
131 /* how much do we move?
132 */
133 ltemp = (len ? *(size_t*)len : sizeof(struct watt_sockaddr));
134 if (ltemp > sizeof (struct watt_sockaddr))
135 ltemp = sizeof (struct watt_sockaddr);
136 memcpy (dest, &temp, ltemp);
137
138 if (len)
139 *len = (int)ltemp;
140 return (0);
141}
142
147int W32_CALL _getsockname (const sock_type *s, void *dest, int *len)
148{
149 struct watt_sockaddr temp;
150 size_t ltemp;
151 int chk = _chk_socket (s);
152
153 if (!s->tcp.myaddr || !s->tcp.myport ||
154 (chk != VALID_UDP && chk != VALID_TCP))
155 {
156 if (len)
157 *len = 0;
158 return (-1);
159 }
160
161 memset (&temp, 0, sizeof(temp));
162 temp.s_ip = s->tcp.myaddr;
163 temp.s_port = s->tcp.myport;
164 temp.s_type = s->tcp.ip_type;
165
166 /* how much do we move
167 */
168 ltemp = (len ? *(size_t*)len : sizeof (struct watt_sockaddr));
169 if (ltemp > sizeof (struct watt_sockaddr))
170 ltemp = sizeof (struct watt_sockaddr);
171 memcpy (dest, &temp, ltemp);
172
173 if (len)
174 *len = (int)ltemp;
175 return (0);
176}
177
186int W32_CALL getdomainname (char *buffer, size_t buflen)
187{
188 const char *my_domainname = def_domain ? def_domain : "";
189
190 if (!buffer || buflen < strlen(my_domainname))
191 {
192 SOCK_ERRNO (EINVAL);
193 return (-1);
194 }
195#if (DOSX)
196 if (!valid_addr(buffer, buflen))
197 {
198 SOCK_ERRNO (EFAULT);
199 return (-1);
200 }
201#endif
202
203 strncpy (buffer, my_domainname, buflen);
204 /* no terminating '\0' needs to be forced here per BSD spec */
205 return (0);
206}
207
213int W32_CALL setdomainname (const char *name, size_t len)
214{
215 if (!name || len > sizeof(defaultdomain)-1)
216 {
217 SOCK_ERRNO (EINVAL);
218 return (-1);
219 }
220
221#if (DOSX)
222 if (!valid_addr(name, len))
223 {
224 SOCK_ERRNO (EFAULT);
225 return (-1);
226 }
227#endif
228
229 def_domain = _strlcpy (defaultdomain, name, len);
230 return (0);
231}
232
233/*
234 * BSD-style: \n
235 * Make a FQDN from `hostname' & `def_domain'.
236 * Set errno on failure and return -1.
237 */
238int W32_CALL gethostname (char *buffer, GETHOSTNAME_ARG2 buflen)
239{
240 /* the FQDN when no hostname has been set is "localhost.localdomain".
241 * the FQDN when a hostname has been set, but no my_domname is set, is 'my_hostname'
242 * the FQDN when both are set is 'my_hostname.my_domname'
243 */
244 const char *my_hostname = "localhost";
245 const char *my_domname = "localdomain";
246 GETHOSTNAME_ARG2 pos;
247
248 if (!buffer)
249 {
250 SOCK_ERRNO (EINVAL);
251 return (-1);
252 }
253 if (buflen == 0)
254 return (0);
255
256#if (DOSX)
257 if (!valid_addr(buffer, buflen))
258 {
259 SOCK_ERRNO (EFAULT);
260 return (-1);
261 }
262#endif
263
264 if (*hostname) /* otherwise use localhost.localdomain */
265 {
266 my_hostname = hostname;
267 my_domname = NULL; /* have hostname but no domain name */
268 if (def_domain && *def_domain)
269 my_domname = def_domain;
270 }
271 pos = 0;
272 while (pos < buflen && *my_hostname)
273 buffer[pos++] = *my_hostname++;
274
275 if (pos < buflen && my_domname)
276 {
277 buffer[pos++] = '.';
278 while (pos < buflen && *my_domname)
279 buffer[pos++] = *my_domname++;
280 }
281 if (pos < buflen)
282 buffer[pos] = '\0';
283 return (0);
284}
285
292int W32_CALL sethostname (const char *fqdn, SETHOSTNAME_ARG2 len)
293{
294 SETHOSTNAME_ARG2 pos;
295
296 if (!fqdn || !*fqdn || len == 0 || len > MAX_HOSTLEN)
297 {
298 SOCK_ERRNO (EINVAL);
299 return (-1);
300 }
301
302#if (DOSX)
303 if (!valid_addr(fqdn, len))
304 {
305 SOCK_ERRNO (EFAULT);
306 return (-1);
307 }
308#endif
309
310 pos = 0;
311 while (pos < len && fqdn[pos] != '.')
312 {
313 if (!fqdn[pos])
314 {
315 pos = 0;
316 break;
317 }
318 pos++;
319 }
320 if (pos == 0) /* leading '.' or invalid char in name */
321 {
322 SOCK_ERRNO (EINVAL);
323 return (-1);
324 }
325 if (pos >= SIZEOF(hostname))
326 {
327 SOCK_ERRNO (ERANGE);
328 return (-1);
329 }
330 if (fqdn[pos] == '.') /* a trailing '.' is ok too */
331 {
332 if (setdomainname(&fqdn[pos+1], len-pos) != 0)
333 return (-1);
334 }
335 memcpy (&hostname[0], fqdn, pos);
336 hostname[pos] = '\0';
337 return (0);
338}
339
340
341#if defined(WIN32)
342
343#ifndef ComputerNameDnsHostname
344#define ComputerNameDnsHostname 1
345#endif
346
347/*
348 * Get hostname excluding domain-name
349 */
350int _get_machine_name (char *buf, int size)
351{
352 DWORD sz = size;
353 int rc;
354
355 if (p_GetComputerNameExA)
356 rc = (*p_GetComputerNameExA) (ComputerNameDnsHostname, buf, &sz);
357 else rc = GetComputerNameA (buf, &sz);
358
359 rc = rc ? 0 : -1;
360 TRACE_CONSOLE (2, "_get_machine_name(): \"%s\", rc %d\n", buf, rc);
361 return (rc);
362}
363
364#else
365
366/*
367 * From Ralf Brown's interrupt list
368 *
369 * --------D-215E00-----------------------------
370 * INT 21 - DOS 3.1+ network - GET MACHINE NAME
371 * AX = 5E00h
372 * DS:DX -> 16-byte buffer for ASCII machine name
373 * Return: CF clear if successful
374 * CH = validity
375 * 00h name invalid
376 * nonzero valid
377 * CL = NetBIOS number for machine name
378 * DS:DX buffer filled with blank-paded name
379 * CF set on error
380 * AX = error code (01h) (see #1366 at AH=59h)
381 * Note: supported by OS/2 v1.3+ compatibility box, PC-NFS
382 */
383
384/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
385/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
386
391int _get_machine_name (char *buf, int size)
392{
393 IREGS reg;
394 char *h;
395 char dosBuf[16];
396 int len;
397
398 memset (&reg, 0, sizeof(reg));
399 reg.r_ax = 0x5E00;
400
401#if (DOSX & DJGPP)
402 if (_go32_info_block.size_of_transfer_buffer < sizeof(dosBuf))
403 return (-1);
404 reg.r_ds = __tb / 16;
405 reg.r_dx = __tb & 15;
406
407#elif (DOSX & (PHARLAP|X32VM|POWERPAK))
408 if (_watt_dosTbSize < sizeof(dosBuf) || !_watt_dosTbr)
409 return (-1);
410 reg.r_ds = RP_SEG (_watt_dosTbr);
411 reg.r_dx = RP_OFF (_watt_dosTbr);
412
413#elif (DOSX & DOS4GW)
414 if (_watt_dosTbSize < sizeof(dosBuf) || !_watt_dosTbSeg)
415 return (-1);
416 reg.r_ds = _watt_dosTbSeg;
417 reg.r_dx = 0;
418
419#elif (DOSX & ATMEL)
420 return (-1);
422#elif (DOSX == 0)
423 reg.r_ds = FP_SEG (dosBuf);
424 reg.r_dx = FP_OFF (dosBuf);
425
426#else
427 #error Help me!
428#endif
429
430 GEN_INTERRUPT (0x21, &reg);
431 if ((reg.r_flags & CARRY_BIT) || hiBYTE(reg.r_cx) == 0)
432 return (-1);
433
434#if (DOSX & DJGPP)
435 dosmemget (__tb, sizeof(dosBuf), dosBuf);
436
437#elif (DOSX & (PHARLAP|X32VM|POWERPAK))
438 ReadRealMem ((void*)&dosBuf, _watt_dosTbr, sizeof(dosBuf));
439
440#elif (DOSX & DOS4GW)
441 memcpy (dosBuf, SEG_OFS_TO_LIN(_watt_dosTbSeg,0), sizeof(dosBuf));
442#endif
443
444 h = strrtrim (dosBuf);
445 len = strlen (h);
446 if (len + 1 > size)
447 {
448 SOCK_ERRNO (ERANGE);
449 return (-1);
450 }
451 strcpy (buf, h);
452 strlwr (buf);
453 return (0);
454}
455#endif /* WIN32 */
456
_get_machine_name
int _get_machine_name(char *buf, int size)
Try asking a LAN extension of DOS for a host-name.
Definition: bsdname.c:350
_gethostid
DWORD W32_CALL _gethostid(void)
Core style: Returns local IPv4-address.
Definition: bsdname.c:49
_sethostid6
void _sethostid6(const void *addr)
Core-style: Sets local IPv6-address.
Definition: bsdname.c:102
sethostname
int W32_CALL sethostname(const char *fqdn, SETHOSTNAME_ARG2 len)
BSD-style: Expects a "Fully Qualified Domain Name" in ‘fqdn’.
Definition: bsdname.c:292
_getsockname
int W32_CALL _getsockname(const sock_type *s, void *dest, int *len)
Core-style: Return 'watt_sockaddr' for our side of a UDP/TCP connection.
Definition: bsdname.c:147
_gethostid6
const void * _gethostid6(void)
Core-style: Returns local IPv6-address.
Definition: bsdname.c:91
_sethostid
DWORD W32_CALL _sethostid(DWORD ip)
Core-style: Sets local IPv4-address.
Definition: bsdname.c:58
setdomainname
int W32_CALL setdomainname(const char *name, size_t len)
BSD-style: Set the host's domain name.
Definition: bsdname.c:213
sethostid
XHOSTID_RETV W32_CALL sethostid(u_long ip)
BSD-style: Sets local IPv4-address.
Definition: bsdname.c:79
_getpeername
int W32_CALL _getpeername(const sock_type *s, void *dest, int *len)
Core-style: Return 'watt_sockaddr' for peer in a UDP/TCP connection.
Definition: bsdname.c:112
getdomainname
int W32_CALL getdomainname(char *buffer, size_t buflen)
BSD-style: Return domain name of this host.
Definition: bsdname.c:186
gethostid
XHOSTID_RETV W32_CALL gethostid(void)
BSD style: returns local IPv4-address.
Definition: bsdname.c:68
bsdname.h
copyrigh.h
errno.h
socket.h
ip6_out.h
misc.h
strrtrim
char * strrtrim(char *s)
Return pointer to string with trailing blanks (space/tab) removed.
Definition: misc_str.c:262
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
pcbuf.h
netdb_init
int netdb_init(void)
Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise thing...
Definition: pcconfig.c:1284
pcconfig.h
pcdbug.h
defaultdomain
char defaultdomain[MAX_HOSTLEN+1]
The 2 next variables are loaded from WATTCP.CFG file.
Definition: pcdns.c:71
pcdns.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
hostname
char hostname[MAX_HOSTLEN+1]
Our configured hostname.
Definition: pctcp.c:58
pctcp.h
powerpak.h
IREGS
Definition: misc.h:610
watt_sockaddr
Definition: tcp.h:609
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.
wdpmi.h
win_dll.h
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/bsdname.h Source File

  • src
bsdname.h
Go to the documentation of this file.
1
3#ifndef _w32_BSDNAME_H
4#define _w32_BSDNAME_H
5
6/* privates */
7
8extern int _get_machine_name (char *buf, int size);
9extern void _sethostid6 (const void *addr);
10extern const void *_gethostid6 (void);
11
12#endif
_get_machine_name
int _get_machine_name(char *buf, int size)
Try asking a LAN extension of DOS for a host-name.
Definition: bsdname.c:350
_sethostid6
void _sethostid6(const void *addr)
Core-style: Sets local IPv6-address.
Definition: bsdname.c:102
_gethostid6
const void * _gethostid6(void)
Core-style: Returns local IPv6-address.
Definition: bsdname.c:91


Watt-32 tcp/ip: E:/WATT/src/btrace.h Source File

  • src
btrace.h
Go to the documentation of this file.
1#ifndef _w32_BACKTRACE_H
2#define _w32_BACKTRACE_H
3
11#define backtrace W32_NAMESPACE (backtrace)
12#define backtrace_init W32_NAMESPACE (backtrace_init)
13#define backtrace_symbols_fd W32_NAMESPACE (backtrace_symbols_fd)
14
15extern int backtrace_init (const char *prog);
16extern int backtrace (void **buf, int size);
17extern int backtrace_symbols_fd (const void *buf, int size, int file);
18extern int traceback_exit (const void *caller);
19
20#if defined(__GNUC__)
21 #define CALLER_CS() -1
22 #define CALLER_EIP(stk) __builtin_return_address (0)
23
24#elif (DOSX)
25 #define CALLER_CS() -1
26 #define CALLER_EIP(stk) *(DWORD*)(&(stk)+1))
27
28#elif defined(__LARGE__)
29 #define CALLER_CS() *(WORD*)(&(stk)+1))
30 #define CALLER_EIP(stk) *(WORD*)(&(stk)+2))
31
32#else /* small model */
33 #define CALLER_CS() MY_CS()
34 #define CALLER_EIP(stk) *(WORD*)(&(stk)+1))
35#endif
36
37#endif


Watt-32 tcp/ip: E:/WATT/inc/sys/cdefs.h Source File

  • inc
  • sys
cdefs.h
Go to the documentation of this file.
1
7/*
8 * Copyright (c) 1991, 1993
9 * The Regents of the University of California. All rights reserved.
10 *
11 * This code is derived from software contributed to Berkeley by
12 * Berkeley Software Design, Inc.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 * 3. All advertising materials mentioning features or use of this software
23 * must display the following acknowledgement:
24 * This product includes software developed by the University of
25 * California, Berkeley and its contributors.
26 * 4. Neither the name of the University nor the names of its contributors
27 * may be used to endorse or promote products derived from this software
28 * without specific prior written permission.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
31 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 */
42
43#ifndef __SYS_CDEFS_H
44#define __SYS_CDEFS_H
45
46#if defined(__HIGHC__)
47 /*
48 * Note to High-C users:
49 * The below pragma (to suppress warning for '#include_next' line) has no effect
50 * here. The pragma needs to be put in your CFLAGS as
51 * '-Hpragma=Offwarn(491)'.
52 *
53 * The warning w/o this pragma is something like:
54 * "w "../../inc/sys/cdefs.h",L59/C23(#491): Unrecognized preprocessor directive:"
55 */
56#endif
57
58#if defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW64__)
59 #include_next <sys/cdefs.h>
60
61#else
62 #if defined(__cplusplus)
63 #define __BEGIN_DECLS extern "C" {
64 #define __END_DECLS }
65 #else
66 #define __BEGIN_DECLS
67 #define __END_DECLS
68 #endif
69#endif
70
71/*
72 * Gets the 'gcc' version as 'MmmP' where:
73 * 'M' = major: >= 3.
74 * 'mm' = minor: 00 - 99.
75 * 'P' = patch-level.
76 *
77 * gcc >= 3.1 is assumed throughout the Watt-32 library.
78 */
79#if defined(__GNUC__)
80 #define W32_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + \
81 __GNUC_PATCHLEVEL__)
82#else
83 #define W32_GCC_VERSION 0
84#endif
85
86/*
87 * Macros for 'gcc / clang-cl' features.
88 */
89#if defined(__GNUC__) || defined(__clang__)
90 #if (W32_GCC_VERSION >= 50100) /* correct? */
91 #define W32_ATTR_PRINTF(_1,_2) __attribute__ ((__format__(gnu_printf,_1,_2)))
92 #define W32_ATTR_SCANF(_1,_2) __attribute__ ((__format__(gnu_scanf,_1,_2)))
93 #else
94 #define W32_ATTR_PRINTF(_1,_2) __attribute__ ((format(printf,_1,_2)))
95 #define W32_ATTR_SCANF(_1,_2) __attribute__ ((format(scanf,_1,_2)))
96 #endif
97
98 #define W32_ATTR_NOINLINE() __attribute__ ((__noinline__)) /* do not inline this func */
99 #define W32_ATTR_REGPARM(_n) __attribute__ ((regparm(_n))) /* parameters are in registers. */
100 #define W32_ATTR_NORETURN() __attribute__ ((noreturn)) /* function never returns */
101 #define W32_ARG_NONNULL(_1) __attribute__ ((nonnull(_1))) /* argument cannot be NULL */
102#else
103 #define W32_ATTR_PRINTF(_1,_2)
104 #define W32_ATTR_SCANF(_1,_2)
105 #define W32_ATTR_NOINLINE()
106 #define W32_ATTR_REGPARM(_n)
107 #define W32_ATTR_NORETURN()
108 #define W32_ARG_NONNULL(_1)
109#endif
110
118#include <stdio.h>
119
120#ifndef _Printf_format_string_
121#define _Printf_format_string_
122#endif
123
124#ifndef _Scanf_format_string_
125#define _Scanf_format_string_
126#endif
127
128/* Warn on deprecated type/func.
129 */
130#if defined(__GNUC__) || defined(__clang__)
131 #define W32_ATTR_DEPRECATED __attribute__((__deprecated__))
132#else
133 #if defined(_MSC_VER) && (_MSC_VER >= 1700) /* Visual Studio 2011+ ? */
134 #define W32_ATTR_DEPRECATED __declspec(deprecated)
135 #else
136 #define W32_ATTR_DEPRECATED
137 #endif
138#endif
139
140/* Detection of the various Borland/CodeGearC/CBuilder versions.
141 * Not sure about the '0x0700' value.
142 *
143 * Refs: https://sourceforge.net/p/predef/wiki/Compilers/
144 * https://en.wikipedia.org/wiki/C%2B%2BBuilder
145 */
146#if defined(__BORLANDC__)
147 #if (__BORLANDC__ >= 0x0700)
148 //#pragma message ("I am Embarcadero")
149 #define W32_IS_EMBARCADERO 1
150 #endif
151
152 #if defined(__CODEGEARC__)
153 //#pragma message ("I am CodeGearC")
154 #define W32_IS_CODEGEARC 1
155 #endif
156#endif
157
158#if defined(__MINGW32__) || defined(__CYGWIN__)
159 #if defined(cdecl)
160 #define W32_CDECL cdecl
161 #else
162 #define W32_CDECL __attribute__((__cdecl__))
163 #endif
164#endif
165
166#if defined(_MSC_VER) || defined(__POCC__)
167 #if (_MSC_VER <= 600) && !defined(__POCC__)
168 #define W32_CDECL _cdecl
169 #undef __STDC__
170 #define __STDC__ 1
171 #else
172 #define W32_CDECL __cdecl
173 #endif
174 #define NO_ANSI_KEYWORDS
175
176#elif defined(__DMC__) /* Digital Mars compiler */
177 #define NO_UNDERSCORE __syscall
178 /* e.g. int NO_UNDERSCORE foo (void); */
179#endif
180
181#ifndef W32_CDECL
182#define W32_CDECL
183#endif
184
185/*
186 * MinGW-w64 defines both __MINGW64__ *and* __MINGW32__, but __MINGW64__
187 * is only defined for _WIN64 targets. __MINGW64_VERSION_[MAJOR|MINOR]
188 * is defined in MinGW64's <_mingw.h>.
189 *
190 * MinGW-w64. I.e. "GCC for both x64 & x86 Windows".
191 * This is not from the mingw.org folks, but from these:
192 * http://mingw-w64.sourceforge.net/
193 *
194 * Or to make this even more confusing, the TDM-gcc should act the same
195 * as MinGW-w64:
196 * http://tdm-gcc.tdragon.net/
197 *
198 * It uses it's own versioning.
199 */
200#if defined(__MINGW32__)
201 #include <_mingw.h>
202#endif
203
204#if defined(_MSC_VER) && !defined(__POCC__)
205 /*
206 * All MS compilers (Quick-C/Visual-C for DOS, VC for Windows) insists
207 * that signal-handlers, atexit functions and var-arg functions must be
208 * defined as cdecl. This is only an issue if a program is using 'fastcall'
209 * globally (cl option '-Gr').
210 * Ref. the use of 'WINAPIV' in the Windows SDKs.
211 *
212 * But Watcom's register call doesn't need this. (wcc386 -ecf)
213 *
214 * See <sys/w32api.h> for the rationale behind 'W32_CALL'. It's
215 * currently forced to 'cdecl' on Windows. Thus 'MS_CDECL' should be
216 * important for MSVC users on Windows only. But I'm not sure....
217 */
218 #undef MS_CDECL
219 #define MS_CDECL W32_CDECL
220#else
221 #define MS_CDECL
222#endif
223
224#if ((defined(__STDC__) && __STDC__) || defined(__cplusplus) || \
225 defined(__TURBOC__)) && !defined(__CYGWIN__)
226
227 #if defined(__cplusplus)
228 #define __inline inline /* convert to C++ keyword */
229 #elif !defined(__GNUC__) && !defined(_MSC_VER) && !defined(__WATCOMC__)
230 #define __inline /* delete GCC/MSC/Watcom keyword */
231 #endif
232
233#else
234 #if !defined(__GNUC__) && !defined(_MSC_VER) && !defined(__WATCOMC__)
235 #define __inline
236 #endif
237#endif /* (__STDC__ || __cpluplus) && !__CYGWIN__ */
238
239#if defined(OLD_JUNK_NOT_NEEDED)
240 /*
241 * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
242 * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
243 * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
244 * in between its arguments. __CONCAT can also concatenate double-quoted
245 * strings produced by the __STRING macro, but this only works with ANSI C.
246 */
247 #define __CONCAT(x,y) x ## y
248 #define __STRING(x) #x
249
250 #if !defined(__GNUC__)
251 /*
252 * In non-ANSI C environments, new programs will want ANSI-only C keywords
253 * deleted from the program and old programs will want them left alone.
254 * When using a compiler other than gcc, programs using the ANSI C keywords
255 * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
256 * When using "gcc -traditional", we assume that this is the intent; if
257 * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
258 */
259 #if !defined(NO_ANSI_KEYWORDS)
260 #define const /* delete ANSI C keywords */
261 #define inline
262 #define signed
263 #define volatile
264 #endif
265 #endif /* !__GNUC__ */
266#endif
267
268/*
269 * Macros for gcc 4.6+ Pragmas. Ref.:
270 * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html
271 */
272#if (W32_GCC_VERSION >= 40600) || defined(__clang__) || defined(__ORANGEC__)
273 #define W32_GCC_PRAGMA(x) _Pragma (#x)
274#else
275 #define W32_GCC_PRAGMA(x)
276#endif
277
278/*
279 * The above could be used as:
280 * W32_GCC_PRAGMA (message: "Fix this")
281 *
282 * or:
283 * #if (W32_GCC_VERSION >= 40600)
284 * #pragma message ("Fix this")
285 * #endif
286 *
287 * But MSVC (and others besides High-C) doesn't handle a pragma in a
288 * #define statement. Hence must enclose it in an #ifdef. Like:
289 *
290 * #if defined(_MSC_VER) && (_MSC_VER >= 1500)
291 * #pragma message ("Fix this")
292 * #endif
293 */
294
295
296/*
297 * gcc >= 4.2 have an issue with '__inline__'. We must ensure
298 * that always traditional GNU extern inline semantics are used
299 * (aka -fgnu89-inline) even if ISO C99 semantics have been specified.
300 */
301#if (W32_GCC_VERSION >= 40200) && !defined(__NO_INLINE__) /* -O0 */
302 #define W32_GCC_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
303#else
304 #define W32_GCC_INLINE extern __inline__
305#endif
306
307#if defined(__GNUC__)
308 #define W32_INLINE W32_GCC_INLINE
309#else
310 #define W32_INLINE __inline
311#endif
312
313#define W32_CLANG_PACK_WARN_OFF()
314#define W32_CLANG_PACK_WARN_DEF()
315
316#if defined(__clang__)
317 /*
318 * To suppress clang warnings like:
319 * Array access (from variable 'x') results in a null pointer dereference
320 *
321 * in statements like:
322 * if (!x[0]) {
323 * ...
324 *
325 * So one could write it like:
326 * if (W32_CLANG_NONNULL(x) || !x[0]) {
327 * ...
328 */
329 #define W32_CLANG_NONNULL(x) !(x)
330
331 #if (__clang_major__ >= 6)
332 /*
333 * clang v6.x introdused several new warnings. Especially annoying when including
334 * <sys/pack_on.h> and <sys/pack_off.h> is this:
335 * the current #pragma pack aligment value is modified in the included file [-Wpragma-pack]
336 *
337 * Control these warnings using the below macros.
338 * Always used when building *or* using Watt-32. Used like this:
339 *
340 * W32_CLANG_PACK_WARN_OFF() // "push" warning state and turn off "-Wpragma-pack".
341 * #include <sys/pack_on.h>
342 *
343 * ... some structures that needs tight 1-byte packing of members.
344 *
345 * #include <sys/pack_off.h> // restore default packing
346 * W32_CLANG_PACK_WARN_DEF() // "pop" the warning set by 'W32_CLANG_PACK_WARN_OFF()'.
347 */
348 #undef W32_CLANG_PACK_WARN_OFF
349 #define W32_CLANG_PACK_WARN_OFF() W32_GCC_PRAGMA (clang diagnostic push) \
350 W32_GCC_PRAGMA (clang diagnostic ignored "-Wpragma-pack")
351
352 #undef W32_CLANG_PACK_WARN_DEF
353 #define W32_CLANG_PACK_WARN_DEF() W32_GCC_PRAGMA (clang diagnostic pop)
354 #endif
355
356#else
357 #define W32_CLANG_NONNULL(x) 0
358#endif
359
360/*
361 * And make gcc 8+ shut up about warnings like this:
362 * tftp.c:201:31: warning: cast between incompatible function types from
363 * 'void (*)(_udp_Socket *, int, int)' {aka 'void (*)(struct udp_Socket *,
364 * int, int)'} to 'int (*)(void *, BYTE, BYTE)' {aka 'int (*)(void *, unsigned char, unsigned char)'}
365 * [-Wcast-function-type]
366 * 201 | sock->udp.icmp_callb = (icmp_upcall) udp_callback;
367 * | ^
368 *
369 * And to complicate things further, older clang compilers do not have
370 * '-Wcast-function-type'. Hence define it for gcc 8+ only.
371 */
372#if defined(__GNUC__) && (__GNUC__ >= 8)
373 #define W32_GCC_FUNC_TYPE_WARN_OFF() \
374 W32_GCC_PRAGMA (GCC diagnostic push) \
375 W32_GCC_PRAGMA (GCC diagnostic ignored "-Wcast-function-type")
376
377 #define W32_GCC_FUNC_TYPE_WARN_DEF() \
378 W32_GCC_PRAGMA (GCC diagnostic pop) /* restore the warning options */
379
380 /*
381 * And similarily for this annoying gcc warning:
382 * res_loc.c:87:24: warning: '.' directive writing 1 byte into a region of size between 0 and 17 [-Wformat-overflow=]
383 * 87 | sprintf (retbuf, "%lu.%.2lu", value / 100, value % 100);
384 * | ^
385 */
386 #define W32_GCC_OVERFLOW_WARN_OFF() \
387 W32_GCC_PRAGMA (GCC diagnostic push) \
388 W32_GCC_PRAGMA (GCC diagnostic ignored "-Wformat-overflow=")
389
390 #define W32_GCC_OVERFLOW_WARN_DEF() \
391 W32_GCC_PRAGMA (GCC diagnostic pop) /* restore the warning options */
392#else
393 #define W32_GCC_FUNC_TYPE_WARN_OFF()
394 #define W32_GCC_FUNC_TYPE_WARN_DEF()
395 #define W32_GCC_OVERFLOW_WARN_OFF()
396 #define W32_GCC_OVERFLOW_WARN_DEF()
397#endif
398
399
400/*
401 * A simple compile-time assert() macro.
402 * Use it like 'W32_COMPILE_TIME_ASSERT (some_typedef, sizeof(some_typedef) == 10);'
403 *
404 * If 'sizeof(some_typedef) != 10' (i.e. 'x == 0'), it expands to
405 * 'typedef int w32_compile_time_assert_some_typedef [-1];' which will not compile.
406 */
407#define W32_COMPILE_TIME_ASSERT(name, x) \
408 typedef int w32_compile_time_assert_ ## name [(x) * 2 - 1]
409
410
411/*
412 * Delete pseudo-keywords wherever they are not available or needed.
413 * This seems to break MinGW in mysterious ways, so leave it.
414 */
415#ifndef __dead
416#define __dead
417#endif
418
419#ifndef __dead2
420#define __dead2
421#endif
422
423#ifndef __pure
424#define __pure
425#endif
426
427#if !defined(__cplusplus)
428 /*
429 * min() & max() macros
430 */
431 #if defined(__HIGHC__)
432 #undef min
433 #undef max
434 #define min(a, b) _min(a, b) /* intrinsic functions */
435 #define max(a, b) _max(a, b)
436 #endif
437
438 #ifndef min
439 #define min(a, b) (((a) < (b)) ? (a) : (b))
440 #endif
441
442 #ifndef max
443 #define max(a, b) (((a) > (b)) ? (a) : (b))
444 #endif
445#endif
446
447#else /* __SYS_CDEFS_H */
448
449 /*
450 * Handle recursive include_next.
451 */
452 #if defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW64__)
453 #include_next <sys/cdefs.h>
454 #endif
455
456#endif /* __SYS_CDEFS_H */


Watt-32 tcp/ip: E:/WATT/src/chksum.c Source File

  • src
chksum.c
Go to the documentation of this file.
1
7#include <stdio.h>
8#include <stdlib.h>
9
10#include "wattcp.h"
11#include "pcicmp.h"
12#include "pcdbug.h"
13#include "pcstat.h"
14#include "language.h"
15#include "misc.h"
16#include "misc_str.h"
17#include "ip6_in.h"
18#include "chksum.h"
19
24WORD W32_CALL in_checksum (const void *ptr, unsigned len)
25{
26 register long sum = 0;
27 register long slen = (long) len; /* must be signed */
28 register const WORD *wrd = (const WORD*) ptr;
29
30 while (slen > 1)
31 {
32 sum += *wrd++;
33 slen -= 2;
34 }
35 if (slen > 0)
36 sum += *(const BYTE*)wrd;
37
38 while (sum >> 16)
39 sum = (sum & 0xFFFF) + (sum >> 16);
40
41 return (WORD)sum;
42}
43
44#if defined(USE_IPV6)
48WORD _ip6_checksum (const in6_Header *ip, WORD proto,
49 const void *payload, unsigned payloadlen)
50{
51 tcp_PseudoHeader6 ph;
52 DWORD chksum;
53
54 memset (&ph, 0, sizeof(ph));
55 memcpy (&ph.src, &ip->source, sizeof(ph.src));
56 memcpy (&ph.dst, &ip->destination, sizeof(ph.dst));
57 ph.length = intel16 (payloadlen);
58 ph.next_hdr = (BYTE)proto;
59
60 chksum = CHECKSUM (&ph, sizeof(ph));
61 chksum += CHECKSUM (payload, payloadlen);
62
63 /* Wrap in the carries to reduce chksum to 16 bits.
64 */
65 chksum = (chksum >> 16) + (chksum & 0xFFFF);
66 chksum += (chksum >> 16);
67
68 /* Take ones-complement and replace 0 with 0xFFFF.
69 */
70 chksum = (WORD)~chksum;
71 if (chksum == 0UL)
72 chksum = 0xFFFFUL;
73
74 return (WORD)chksum;
75}
76
80int _ip6_tcp_checksum (const in6_Header *ip, const tcp_Header *tcp, unsigned len)
81{
82 if (_ip6_checksum(ip, IP6_NEXT_TCP, tcp, len) != 0xFFFF)
83 {
84 STAT (tcpstats.tcps_rcvbadsum++);
85 if (debug_on)
86 outsnl (_LANG("bad IPv6/TCP checksum"));
87 return (0);
88 }
89 return (1);
90}
91
95int _ip6_udp_checksum (const in6_Header *ip, const udp_Header *udp, unsigned len)
96{
97 if (_ip6_checksum(ip, IP6_NEXT_UDP, udp, len) != 0xFFFF)
98 {
99 STAT (udpstats.udps_badsum++);
100 if (debug_on)
101 outsnl (_LANG("bad IPv6/UDP checksum"));
102 return (0);
103 }
104 return (1);
105}
106
107/*
108 * Check ICMP header checksum of an IPv6 packet.
109 * Caller upcates stats.
110 */
111int _ip6_icmp_checksum (const in6_Header *ip, const void *icmp, unsigned len)
112{
113 return (_ip6_checksum(ip, IP6_NEXT_ICMP, icmp, len) == 0xFFFF);
114}
115#endif /* USE_IPV6 */
116
117#if defined(NOT_USED)
118
119#define CKSUM_CARRY(x) (x = (x >> 16) + (x & 0xffff), \
120 (~(x + (x >> 16)) & 0xffff) )
121
122#ifndef IP_PROTO
123#define IP_PROTO 0 /* dummy for IP */
124#endif
125
126/*
127 * Set header checksum on outgoing packets.
128 * Dug Song came up with this very cool checksuming implementation
129 * eliminating the need for explicit psuedoheader use. Check it out.
130 *
131 * Ripped from libnet 1.0.1
132 */
133int do_checksum (const BYTE *buf, BYTE protocol, unsigned len)
134{
135 struct in_Header *ip = (struct in_Header*) buf;
136 struct tcp_Header *tcp;
137 struct udp_Header *udp;
138 struct IGMPv1_packet *igmp;
139 union icmp_pkt *icmp;
140 WORD sum = 0;
141
142 unsigned ip_hlen = in_GetHdrLen (ip);
143
144 switch (protocol)
145 {
146 case TCP_PROTO:
147 tcp = (struct tcp_Header*) (buf + ip_hlen);
148 tcp->checksum = 0;
149 sum = CHECKSUM (&ip->source, 8);
150 sum += intel16 (TCP_PROTO + len);
151 sum += CHECKSUM (tcp, len);
152 tcp->checksum = CKSUM_CARRY (sum);
153 break;
154
155 case UDP_PROTO:
156 udp = (struct udp_Header*) (buf + ip_hlen);
157 udp->checksum = 0;
158 sum = CHECKSUM (&ip->source, 8);
159 sum += intel16 (UDP_PROTO + len);
160 sum += CHECKSUM (udp, len);
161 udp->checksum = CKSUM_CARRY (sum);
162 break;
163
164 case ICMP_PROTO:
165 icmp = (union icmp_pkt*) (buf + ip_hlen);
166 icmp->unused.checksum = 0;
167 sum = CHECKSUM (icmp, len);
168 icmp->unused.checksum = CKSUM_CARRY (sum);
169 break;
170
171 case IGMP_PROTO:
172 igmp = (struct IGMPv1_packet*) (buf + ip_hlen);
173 igmp->checksum = 0;
174 sum += CHECKSUM (igmp, len);
175 igmp->checksum = CKSUM_CARRY (sum);
176 break;
177
178 case IP_PROTO:
179 ip->checksum = 0;
180 sum = CHECKSUM (ip, len);
181 ip->checksum = CKSUM_CARRY (sum);
182 break;
183
184 default:
185 TRACE_CONSOLE (2, "do_checksum: unknown protocol %d\n", protocol);
186 return (-1);
187 }
188 return (1);
189}
190#endif /* NOT_USED */
191
_ip6_udp_checksum
int _ip6_udp_checksum(const in6_Header *ip, const udp_Header *udp, unsigned len)
Check udp header checksum of an IPv6 packet.
Definition: chksum.c:95
_ip6_tcp_checksum
int _ip6_tcp_checksum(const in6_Header *ip, const tcp_Header *tcp, unsigned len)
Check tcp header checksum of an IPv6 packet.
Definition: chksum.c:80
_ip6_checksum
WORD _ip6_checksum(const in6_Header *ip, WORD proto, const void *payload, unsigned payloadlen)
Generic IPv6 checksum function.
Definition: chksum.c:48
in_checksum
WORD W32_CALL in_checksum(const void *ptr, unsigned len)
This checksum routine is now used for all targets since in_checksum_fast() was removed.
Definition: chksum.c:24
chksum.h
ip6_in.h
language.h
misc.h
misc_str.h
pcdbug.h
pcicmp.h
pcstat.h
IGMPv1_packet
Definition: pcigmp.h:23
icmp
Definition: ip_icmp.h:66
in6_Header
Definition: wattcp.h:381
in_Header
Definition: wattcp.h:329
tcp_Header
Definition: wattcp.h:418
tcp_PseudoHeader6
Definition: wattcp.h:463
udp_Header
Definition: wattcp.h:406
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/chksum.h Source File

  • src
chksum.h
Go to the documentation of this file.
1
3#ifndef _w32_CHECK_SUM_H
4#define _w32_CHECK_SUM_H
5
6extern int do_checksum (const BYTE *buf, BYTE proto, unsigned len);
7
8extern WORD _ip6_checksum (const in6_Header *ip, WORD proto,
9 const void *payload, unsigned payloadlen);
10
11extern int _ip6_tcp_checksum (const in6_Header *ip, const tcp_Header *tcp, unsigned len);
12extern int _ip6_udp_checksum (const in6_Header *ip, const udp_Header *udp, unsigned len);
13extern int _ip6_icmp_checksum (const in6_Header *ip, const void *icmp, unsigned len);
14
19#define CHECKSUM(p, len) in_checksum (p, len)
20#endif
_ip6_udp_checksum
int _ip6_udp_checksum(const in6_Header *ip, const udp_Header *udp, unsigned len)
Check udp header checksum of an IPv6 packet.
Definition: chksum.c:95
_ip6_tcp_checksum
int _ip6_tcp_checksum(const in6_Header *ip, const tcp_Header *tcp, unsigned len)
Check tcp header checksum of an IPv6 packet.
Definition: chksum.c:80
_ip6_checksum
WORD _ip6_checksum(const in6_Header *ip, WORD proto, const void *payload, unsigned payloadlen)
Generic IPv6 checksum function.
Definition: chksum.c:48
icmp
Definition: ip_icmp.h:66
in6_Header
Definition: wattcp.h:381
tcp_Header
Definition: wattcp.h:418
udp_Header
Definition: wattcp.h:406


Watt-32 tcp/ip: E:/WATT/inc/rpc/clnt.h Source File

  • inc
  • rpc
clnt.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * clnt.h - Client side remote procedure call interface.
36 *
37 * Copyright (C) 1984, Sun Microsystems, Inc.
38 */
39
40#ifndef __RPC_CLIENT_H
41#define __RPC_CLIENT_H
42
43#include <sys/cdefs.h>
44#include <rpc/types.h>
45#include <rpc/auth.h>
46
47/*
48 * Rpc calls return an enum clnt_stat. This should be looked at more,
49 * since each implementation is required to live with this (implementation
50 * independent) list of errors.
51 */
52enum clnt_stat {
53 RPC_SUCCESS=0, /* call succeeded */
54 /*
55 * local errors
56 */
57 RPC_CANTENCODEARGS=1, /* can't encode arguments */
58 RPC_CANTDECODERES=2, /* can't decode results */
59 RPC_CANTSEND=3, /* failure in sending call */
60 RPC_CANTRECV=4, /* failure in receiving result */
61 RPC_TIMEDOUT=5, /* call timed out */
62 /*
63 * remote errors
64 */
65 RPC_VERSMISMATCH=6, /* rpc versions not compatible */
66 RPC_AUTHERROR=7, /* authentication error */
67 RPC_PROGUNAVAIL=8, /* program not available */
68 RPC_PROGVERSMISMATCH=9, /* program version mismatched */
69 RPC_PROCUNAVAIL=10, /* procedure unavailable */
70 RPC_CANTDECODEARGS=11, /* decode arguments error */
71 RPC_SYSTEMERROR=12, /* generic "other problem" */
72
73 /*
74 * callrpc & clnt_create errors
75 */
76 RPC_UNKNOWNHOST=13, /* unknown host name */
77 RPC_UNKNOWNPROTO=17, /* unkown protocol */
78
79 /*
80 * _ create errors
81 */
82 RPC_PMAPFAILURE=14, /* the pmapper failed in its call */
83 RPC_PROGNOTREGISTERED=15, /* remote program is not registered */
84 /*
85 * unspecified error
86 */
87 RPC_FAILED=16
88 };
89
90
91/*
92 * Error info.
93 */
94struct rpc_err {
95 enum clnt_stat re_status;
96 union {
97 int RE_errno; /* related system error */
98 enum auth_stat RE_why; /* why the auth error occurred */
99 struct {
100 u_long low; /* lowest verion supported */
101 u_long high; /* highest verion supported */
102 } RE_vers;
103 struct { /* maybe meaningful if RPC_FAILED */
104 long s1;
105 long s2;
106 } RE_lb; /* life boot & debugging only */
107 } ru;
108#define re_errno ru.RE_errno
109#define re_why ru.RE_why
110#define re_vers ru.RE_vers
111#define re_lb ru.RE_lb
112};
113
114
115/*
116 * Client rpc handle.
117 * Created by individual implementations, see e.g. rpc_udp.c.
118 * Client is responsible for initializing auth, see e.g. auth_none.c.
119 */
120typedef struct {
121 AUTH *cl_auth; /* authenticator */
122 struct clnt_ops {
123 enum clnt_stat(*cl_call)(); /* call remote procedure */
124 void (*cl_abort)(); /* abort a call */
125 void (*cl_geterr)(); /* get specific error code */
126 bool_t (*cl_freeres)(); /* frees results */
127 void (*cl_destroy)(); /* destroy this structure */
128 bool_t (*cl_control)(); /* the ioctl() of rpc */
129 } *cl_ops;
130 caddr_t cl_private; /* private stuff */
131} CLIENT;
132
133
134/*
135 * client side rpc interface ops
136 *
137 * Parameter types are:
138 *
139 */
140
141/*
142 * enum clnt_stat
143 * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
144 * CLIENT *rh;
145 * u_long proc;
146 * xdrproc_t xargs;
147 * caddr_t argsp;
148 * xdrproc_t xres;
149 * caddr_t resp;
150 * struct timeval timeout;
151 */
152#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
153 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
154
155#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
156 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
157
158/*
159 * void
160 * CLNT_ABORT(rh);
161 * CLIENT *rh;
162 */
163#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh))
164#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh))
165
166/*
167 * struct rpc_err
168 * CLNT_GETERR(rh);
169 * CLIENT *rh;
170 */
171#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
172#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
173
174
175/*
176 * bool_t
177 * CLNT_FREERES(rh, xres, resp);
178 * CLIENT *rh;
179 * xdrproc_t xres;
180 * caddr_t resp;
181 */
182#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
183#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
184
185/*
186 * bool_t
187 * CLNT_CONTROL(cl, request, info)
188 * CLIENT *cl;
189 * u_int request;
190 * char *info;
191 */
192#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
193#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
194
195/*
196 * control operations that apply to both udp and tcp transports
197 */
198#define CLSET_TIMEOUT 1 /* set timeout (timeval) */
199#define CLGET_TIMEOUT 2 /* get timeout (timeval) */
200#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */
201/*
202 * udp only control operations
203 */
204#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */
205#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */
206
207/*
208 * void
209 * CLNT_DESTROY(rh);
210 * CLIENT *rh;
211 */
212#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
213#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
214
215
216/*
217 * RPCTEST is a test program which is accessible on every rpc
218 * transport/port. It is used for testing, performance evaluation,
219 * and network administration.
220 */
221
222#define RPCTEST_PROGRAM ((u_long)1)
223#define RPCTEST_VERSION ((u_long)1)
224#define RPCTEST_NULL_PROC ((u_long)2)
225#define RPCTEST_NULL_BATCH_PROC ((u_long)3)
226
227/*
228 * By convention, procedure 0 takes null arguments and returns them
229 */
230
231#define NULLPROC ((u_long)0)
232
233__BEGIN_DECLS
234
235/*
236 * Below are the client handle creation routines for the various
237 * implementations of client side rpc. They can return NULL if a
238 * creation failure occurs.
239 */
240
241/*
242 * Memory based rpc (for speed check and testing)
243 * CLIENT *
244 * clntraw_create(prog, vers)
245 * u_long prog;
246 * u_long vers;
247 */
248extern CLIENT *clntraw_create (u_long, u_long);
249
250/*
251 * Generic client creation routine. Supported protocols are "udp" and "tcp"
252 * CLIENT *
253 * clnt_create(host, prog, vers, prot);
254 * char *host; -- hostname
255 * u_long prog; -- program number
256 * u_long vers; -- version number
257 * char *prot; -- protocol
258 */
259extern CLIENT *clnt_create (char *, u_long, u_long, char *);
260
261
262/*
263 * TCP based rpc
264 * CLIENT *
265 * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
266 * struct sockaddr_in *raddr;
267 * u_long prog;
268 * u_long version;
269 * register int *sockp;
270 * u_int sendsz;
271 * u_int recvsz;
272 */
273
274extern CLIENT *clnttcp_create (struct sockaddr_in *, u_long, u_long,
275 int *, u_int, u_int);
276
277/*
278 * UDP based rpc.
279 * CLIENT *
280 * clntudp_create(raddr, program, version, wait, sockp)
281 * struct sockaddr_in *raddr;
282 * u_long program;
283 * u_long version;
284 * struct timeval wait;
285 * int *sockp;
286 *
287 * Same as above, but you specify max packet sizes.
288 * CLIENT *
289 * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
290 * struct sockaddr_in *raddr;
291 * u_long program;
292 * u_long version;
293 * struct timeval wait;
294 * int *sockp;
295 * u_int sendsz;
296 * u_int recvsz;
297 */
298
299extern CLIENT *clntudp_create (struct sockaddr_in *, u_long, u_long,
300 struct timeval, int *);
301extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long,
302 struct timeval, int *, u_int, u_int);
303
304
305/*
306 * Print why creation failed
307 */
308
309extern void clnt_pcreateerror (char *); /* stderr */
310extern char *clnt_spcreateerror (char *); /* string */
311
312/*
313 * Like clnt_perror(), but is more verbose in its output
314 */
315
316extern void clnt_perrno (enum clnt_stat); /* stderr */
317extern char *clnt_sperrno(enum clnt_stat); /* string */
318
319/*
320 * Print an English error message, given the client error code
321 */
322
323extern void clnt_perror (CLIENT *, char *); /* stderr */
324extern char *clnt_sperror(CLIENT *, char *); /* string */
325
326/*
327 * Call routine on remote host
328 */
329
330extern int callrpc (char *host, u_long prognum, u_long versnum, u_long procnum,
331 xdrproc_t inproc, char *in,
332 xdrproc_t outproc, char *out);
333
334__END_DECLS
335
336
337/*
338 * If a creation fails, the following allows the user to figure out why.
339 */
340struct rpc_createerr {
341 enum clnt_stat cf_stat;
342 struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
343 const char *cf_file; /* failed file + line */
344 unsigned cf_line;
345 };
346
347extern struct rpc_createerr rpc_createerr;
348
349
350#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
351#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */
352
353#endif
auth.h
cdefs.h
AUTH
Definition: auth.h:108
CLIENT::clnt_ops
Definition: clnt.h:122
CLIENT
Definition: clnt.h:120
rpc_createerr
Definition: clnt.h:340
rpc_err
Definition: clnt.h:94
sockaddr_in
Definition: in.h:224
timeval
Definition: wtime.h:30
types.h


Watt-32 tcp/ip: E:/WATT/src/close.c Source File

  • src
close.c
Go to the documentation of this file.
1
5/*
6 * BSD sockets functionality for Watt-32 TCP/IP
7 *
8 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Gisle Vanem
21 * Bergen, Norway.
22 *
23 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 * Version
35 *
36 * 0.5 : Dec 18, 1997 : G. Vanem - created
37 */
38
39#include "socket.h"
40
41#if defined(USE_BSD_API)
42
43static int close_dgram (Socket *socket);
44static int close_stream (Socket *socket);
45
46int W32_CALL close_s (int s)
47{
48 Socket *socket = _socklist_find (s);
49
50 SOCK_PROLOGUE (socket, "\nclose_s:%d", s);
51
52 socket->so_error = 0;
53
54 switch (socket->so_type)
55 {
56 case SOCK_PACKET:
57 case SOCK_RAW:
58 SOCK_DEL_FD (s);
59 return (0);
60
61 case SOCK_DGRAM:
62 return close_dgram (socket);
63
64 case SOCK_STREAM:
65 return close_stream (socket);
66 }
67 SOCK_ERRNO (EOPNOTSUPP);
68 return (-1);
69}
70
71int W32_CALL closesocket (int s)
72{
73 return close_s (s);
74}
75
76/*
77 * Close a SOCK_DGRAM socket
78 */
79static int close_dgram (Socket *socket)
80{
81 sock_type *sk = (sock_type*)socket->udp_sock;
82
83 sk->udp.rx_datalen = 0; /* flush Rx data */
84 sock_close (sk);
85 socket->so_state |= (SS_ISDISCONNECTING | SS_CANTSENDMORE);
86
87 if (!socket->local_addr)
88 SOCK_DEL_FD (socket->fd);
89 return (0);
90}
91
92/*
93 * Close a SOCK_STREAM socket
94 */
95static int close_stream (Socket *socket)
96{
97 sock_type *sk = (sock_type*)socket->tcp_sock;
98 BOOL abort_it = FALSE;
99 BOOL blocking_close = FALSE;
100 int i, s;
101
102 if ((socket->so_state & SS_ISDISCONNECTING) && socket->close_time)
103 {
104 SOCK_DEBUGF ((", close already called"));
105 SOCK_ERRNO (EBADF);
106 return (-1);
107 }
108
109 if (socket->so_options & SO_LINGER)
110 {
111 if (socket->linger_time == 0)
112 {
113 abort_it = TRUE;
114 sk = NULL;
115 SOCK_DEBUGF ((", zero-linger RST"));
116 }
117 else if (socket->linger_time > 0 && socket->linger_on)
118 {
119 blocking_close = TRUE;
120 SOCK_DEBUGF ((", blocking lingering close"));
121 }
122 }
123
124 if (!socket->local_addr) /* Not bound or never received anything */
125 {
126 abort_it = TRUE;
127 sk = NULL;
128 }
129
130 /* Save memory and abort listen() socket and queue now.
131 */
132 if (socket->so_options & SO_ACCEPTCONN)
133 {
134 SOCK_DEBUGF ((", listen abort, backlog %d", socket->backlog));
135 abort_it = TRUE;
136 sk = NULL;
137 for (i = 0; i < socket->backlog && i < SOMAXCONN; i++)
138 {
139 sock_type *tcb = (sock_type*) socket->listen_queue[i];
140
141 if (!tcb)
142 continue;
143
144 tcb->tcp.rx_datalen = 0; /* flush Rx data */
145 TCP_ABORT (&tcb->tcp);
146 free (tcb);
147 socket->listen_queue[i] = NULL;
148 }
149 }
150
151 if (sk)
152 {
153 sk->tcp.rx_datalen = 0;
154 sock_flush (sk);
155 sock_close (sk);
156 }
157
158 s = socket->fd;
159
160 if (abort_it)
161 {
162 SOCK_DEBUGF ((", fast kill!"));
163 SOCK_DEL_FD (s); /* calls _tcp_abort() */
164 }
165 else
166 {
167 /* sock_daemon() will free socket from list and inuse array.
168 * Local port is marked for reuse after TCP_LINGERTIME (2min).
169 */
170 socket->so_state |= (SS_ISDISCONNECTING | SS_CANTSENDMORE);
171 socket->so_state |= SS_CANTRCVMORE; /* !! should we do this? */
172 socket->close_time = time (NULL);
173 }
174
175 if (blocking_close)
176 {
177 while (_socklist_find(s)) /* while still alive */
178 {
179 tcp_tick (NULL); /* poll, sock_daemon() will delete it */
180 WATT_YIELD();
181 }
182 }
183 return (0);
184}
185#endif /* USE_BSD_API */
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
Socket
Definition: socket.h:158
socket
Definition: if.h:82
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/src/config.h Source File

  • src
config.h
Go to the documentation of this file.
1
6#ifndef _w32_CONFIG_H
7#define _w32_CONFIG_H
8
9#if defined(_w32_WATTCP_H) && !defined(_w32_TARGET_H)
10#error "CONFIG.H must be included after TARGET.H"
11#endif
12
21#undef USE_DEBUG /* Include debug code */
22#undef USE_MULTICAST /* Include IP multicast code by Jim Martin */
23#undef USE_BIND /* Include Bind resolver code */
24#undef USE_BSD_API /* Include BSD-sockets */
25#undef USE_BSD_FATAL /* Exit application on BSD-socket fatal errors */
26#undef USE_BOOTP /* Include BOOTP client code */
27#undef USE_DHCP /* Include DHCP boot client code */
28#undef USE_RARP /* Include RARP boot client code. Contributed by Dan Kegel. */
29#undef USE_GEOIP /* Include GeoIP support. From Tor's geoip.c */
30#undef USE_IPV6 /* Include IPv6 dual-stack support */
31#undef USE_LANGUAGE /* Include Language translation code */
32#undef USE_FRAGMENTS /* Include IP-fragment handling */
33#undef USE_STATISTICS /* Include protocol statistics count */
34#undef USE_STACKWALKER /* Use StackWalker for allocations and crash-dumps. */
35#undef USE_FSEXT /* Use djgpp's File Extensions for file I/O functions */
36#undef USE_LOOPBACK /* Use the simple loopback device */
37#undef USE_EMBEDDED /* Make an embeddable (ROM-able) target. See note at end */
38#undef USE_BUFFERED_IO /* Use buffered file I/O in pcconfig.c. Otherwise use a simple read-ahead cache */
39#undef USE_TFTP /* Include TFTP protocol for simple file retrival */
40#undef USE_UDP_ONLY /* Exclude all stuff related to the TCP protocol */
41#undef USE_TCP_SACK /* Include TCP Selective ACK feature (not yet) */
42#undef USE_ECHO_DISC /* Include echo/discard servers */
43#undef USE_PPPOE /* PPP-over-Ethernet encapsulation */
44#undef USE_FAST_PKT /* Use faster all real-mode PKTDRVR receiver (DOSX only) */
45#undef USE_DEAD_GWD /* Dead Gateway detection in ARP module */
46#undef USE_GZIP /* Use gzip compression for PPP and/or pcap debug file. Also for SCTP. */
47#undef USE_PROFILER /* Include simple execution profiler (only DOSX with 64-bit types) */
48#undef USE_TCP_MD5 /* TCP MD5 signature option */
49#undef USE_IDNA /* Support national characters in DNS name lookups. */
50#undef USE_DYNIP_CLI /* Support DynDNS.org name/IP client */
51#undef USE_SCTP /* Stream Control Transfer Protocol; experimental */
52
53/*
54 * Building small-model applications doesn't leave
55 * much room for the fancy stuff :-(
56 */
57#if !defined(OPT_DEFINED) && defined(__SMALL__) && !(defined(__SMALL32__) || defined(WATCOM386))
58 #define USE_UDP_ONLY /* test udp-only (cookie,ping) */
59 #define OPT_DEFINED
60#endif
61
62/*
63 * MS's Quick-C (6.0 at least) is severly limited in many ways..
64 */
65#if !defined(OPT_DEFINED) && (defined(_MSC_VER) && (_MSC_VER <= 600) && defined(__LARGE__))
66 #define OPT_DEFINED
67#endif
68
69/*
70 * For other large models define these options:
71 */
72#if !defined(OPT_DEFINED) && defined(__LARGE__)
73 #define USE_DEBUG
74 #define OPT_DEFINED
75#endif
76
77/*
78 * Otherwise, for all targets define these options:
79 */
80#if !defined(OPT_DEFINED)
81 #define USE_DEBUG
82 #define USE_BOOTP
83 #define USE_DHCP
84 #define USE_LANGUAGE
85 #define USE_FRAGMENTS
86 #define USE_STATISTICS
87 #define USE_BIND
88 #define USE_BSD_API
89 #define USE_BSD_FATAL
90 #define USE_LOOPBACK
91//#define USE_BUFFERED_IO
92 #define USE_TFTP
93 #define USE_MULTICAST
94 #define OPT_DEFINED
95#endif
96
97/*
98 * Add some more options for djgpp, HighC, 32-bit Watcom/DMC and Win32/64
99 */
100#if defined(__DJGPP__) || defined(__HIGHC__) || defined(WATCOM386) || \
101 defined(DMC386) || defined(_WIN32) || defined(_WIN64)
102 #define USE_ECHO_DISC
103 #define USE_RARP
104 #define USE_IPV6
105 #define USE_IDNA
106 #define USE_TCP_MD5
107 #define USE_GZIP
108 #define USE_DYNIP_CLI
109//#define USE_SCTP
110 #define USE_DEAD_GWD
111#endif
112
113#if defined(__DJGPP__)
114 #define USE_FSEXT
115#endif
116
117#if (DOSX && DOSX != WINWATT)
118 #define USE_FAST_PKT
119#endif
120
121#if (DOSX) && defined(HAVE_UINT64)
122 #define USE_PROFILER
123#endif
124
125/*
126 * SCTP needs gzip compress/uncompress.
127 */
128#if defined(USE_SCTP)
129 #define USE_GZIP
130#endif
131
132/*
133 * Select malloc debuggers on Windows
134 */
135#if defined(_WIN32) && defined(_MSC_VER) && defined(_DEBUG) /* cl -MDd -D_DEBUG */
136 #define USE_CRTDBG /* use CrtDebug? */
137
138#elif defined(_WIN32) && defined(__WATCOMC__)
139/* #define USE_STACKWALKER */ /* Not possible */
140
141#elif defined(__CYGWIN__) && !defined(NDEBUG)
142 #define USE_BUFFERED_IO
143#endif
144
145#if defined(_WIN32) && !defined(_WIN64)
146 /*
147 * Test the C++ code in stkwalk.cpp with a true clang-cl.
148 * That does NOT include a CBuilder that is possibly LLVM based.
149 */
150 #if defined(__clang__) && !defined(__BORLANDC__)
151 #define USE_STACKWALKER
152
153 #elif defined(_MSC_VER) && !defined(__clang__)
154 /*
155 * Use BugTrap DLL loaded at runtime.
156 * Ref: http://www.intellesoft.net/default.shtml and
157 * https://github.com/bchavez/BugTrap
158 */
159 /* #define USE_BUGTRAP */
160 /* #define USE_STACKWALKER */
161 #endif
162#endif
163
173#if defined(__clang__) && defined(USE_UBSAN)
174 #undef USE_IDNA
175#endif
176
177/*
178 * When generating a Swig wrapper for Python, misc.c is included
179 * in the Swig interface file (Python/watt32.swg). Then we must use
180 * whatever mallocer python*.lib was built with.
181 */
182#if defined(SWIG)
183 #undef USE_IPV6
184 #undef USE_SCTP
185 #undef USE_CRTDBG
186 #undef USE_BUGTRAP
187#endif
188
189#if defined(_MSC_VER) && 0
190 #undef USE_FRAGMENTS
191 #undef USE_MULTICAST
192 #undef USE_DHCP
193 #undef USE_RARP
194 #undef USE_IPV6
195 #undef USE_SCTP
196 #undef USE_LANGUAGE
197 #undef USE_BUFFERED_IO
198 #undef USE_TFTP
199 #undef USE_LOOPBACK
200 #undef USE_BIND
201#endif
202
203/*
204 * Test some illegal combinations.
205 */
206#if defined(USE_BSD_API)
207 #if defined(USE_UDP_ONLY)
208 #error "USE_UDP_ONLY and USE_BSD_API are meaningless"
209 #endif
210#else
211 #if defined(USE_IPV6)
212 #error "USE_IPV6 requires USE_BSD_API"
213 #endif
214
215 #if defined(USE_BIND)
216 #error "USE_BIND requires USE_BSD_API"
217 #endif
218#endif
219
220#if defined(USE_SCTP) && !defined(USE_IPV6)
221 #error "USE_SCTP requires USE_IPV6"
222#endif
223
224#if defined(USE_UDP_ONLY) && defined(USE_DYNIP_CLI)
225 #error "USE_UDP_ONLY and USE_DYNIP_CLI are meaningless"
226#endif
227
228#if defined(USE_PROFILER) && (!DOSX || !defined(HAVE_UINT64))
229 #error "Cannot define USE_PROFILER for this target"
230#endif
231
232#if defined(__TURBOC__) && (__TURBOC__ <= 0x301)
233 #if defined(USE_BIND) || defined(USE_SOCKET) || defined(USE_STATISTICS)
234 #error "tcc 2.0 cannot compile resolver, socket code or statistics"
235 #endif
236#endif
237
248/*
249 * Hack fix: When building with djgpp 2.04, but the
250 * ./util/dj_err.exe was compiled with 2.03, it's
251 * necessary to define the following.
252 */
253#undef MIXING_DJGPP_203_AND_204
254
255/*
256 * If building .html-documentation with Doxygen, document everything.
257 * And add some stuff Doxygen doesn't know about.
258 */
259#if defined(DOXYGEN)
260 #define W32_NAMESPACE(x) x
261 #define W32_CALL
262 #define __far
263 #define far
264 #define __interrupt
265 #define interrupt
266 #define __cdecl
267 #define cdecl
268 #define USE_BIND
269 #define USE_BSD_API
270 #define USE_BSD_FATAL
271 #define USE_BOOTP
272 #define USE_DEBUG
273 #define USE_DHCP
274 #define USE_MULTICAST
275 #define USE_GEOIP
276 #define USE_RARP
277 #define USE_IPV6
278 #define USE_LANGUAGE
279 #define USE_FRAGMENTS
280 #define USE_STATISTICS
281 #define USE_FSEXT
282 #define USE_LOOPBACK
283 #define USE_EMBEDDED
284 #define USE_BUFFERED_IO
285 #define USE_TFTP
286 #define USE_UDP_ONLY
287 #define USE_TCP_SACK
288 #define USE_ECHO_DISC
289 #define USE_FAST_PKT
290 #define USE_TCP_MD5
291#endif
292
293#if defined(USE_GZIP)
294/*#define Z_NO_INFLATE */ /* we don't need to read gzip streams */
295 #define Z_PREFIX /* use 'z_' prefix for zlib functions */
296 #define FASTEST /* use fastest deflate method */
297/*#define ASMV */ /* use assembly version of longest_match() */
298 #define NO_vsnprintf
299 #define Z_PRINTF_BUFSIZE 1024
300#endif
301
302/*
303 * A small HAVE_x section here.
304 */
305#if defined(WIN32) || defined(WIN64)
306 #define HAVE_WINDNS_H
307#endif
308
309#if (defined(__BORLANDC__) && (__BORLANDC__ < 0x5600)) || \
310 defined(__SALFORDC__) || defined(__DMC__) || defined(__ORANGEC__)
311 #undef HAVE_WINDNS_H
312#endif
313
314#endif /* _w32_CONFIG_H */
315


Watt-32 tcp/ip: E:/WATT/src/connect.c Source File

  • src
connect.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 * 0.6 : Aug 06, 2002 : G. Vanem - added AF_INET6 support
37 */
38
39#include "socket.h"
40
41#if defined(USE_BSD_API)
42
43static int tcp_connect (Socket *socket);
44static int udp_connect (Socket *socket);
45static int raw_connect (Socket *socket);
46
47/*
48 * connect()
49 * "connect" will attempt to open a connection on a foreign IP address and
50 * foreign port address. This is achieved by specifying the foreign IP
51 * address and foreign port number in the "servaddr".
52 */
53int W32_CALL connect (int s, const struct sockaddr *servaddr, socklen_t addrlen)
54{
55 struct sockaddr_in *addr = (struct sockaddr_in*) servaddr;
56 struct sockaddr_in6 *addr6 = (struct sockaddr_in6*) servaddr;
57 struct Socket *socket = _socklist_find (s);
58 volatile int rc, sa_len;
59 BOOL is_ip6;
60
61 SOCK_PROLOGUE (socket, "\nconnect:%d", s);
62
63 is_ip6 = (socket->so_family == AF_INET6);
64 sa_len = is_ip6 ? sizeof(*addr6) : sizeof(*addr);
65
66 if (_sock_chk_sockaddr(socket, servaddr, addrlen) < 0)
67 return (-1);
68
69 if (socket->so_type == SOCK_STREAM)
70 {
71 if (socket->so_state & SS_ISCONNECTED)
72 {
73 SOCK_DEBUGF ((", EISCONN"));
74 SOCK_ERRNO (EISCONN);
75 return (-1);
76 }
77 if (socket->so_options & SO_ACCEPTCONN)
78 {
79 SOCK_DEBUGF ((", EOPNOTSUPP (listen sock)"));
80 SOCK_ERRNO (EOPNOTSUPP);
81 return (-1);
82 }
83 if (!is_ip6 && IN_MULTICAST(ntohl(addr->sin_addr.s_addr)))
84 {
85 SOCK_DEBUGF ((", EINVAL (mcast)"));
86 SOCK_ERRNO (EINVAL);
87 return (-1);
88 }
89 else if (is_ip6 && IN6_IS_ADDR_MULTICAST(&addr6->sin6_addr))
90 {
91 SOCK_DEBUGF ((", EINVAL (mcast)"));
92 SOCK_ERRNO (EINVAL);
93 return (-1);
94 }
95 }
96
97 if (socket->remote_addr)
98 {
99 if (socket->so_type == SOCK_STREAM)
100 {
101 if (socket->so_state & SS_ISCONNECTING)
102 {
103 tcp_tick (NULL);
104
105 if (_sock_pending_connect (socket))
106 {
107 SOCK_DEBUGF ((", EALREADY"));
108 SOCK_ERRNO (EALREADY);
109 return (-1);
110 }
111
112 if (socket->so_error != 0)
113 {
114 SOCK_DEBUGF ((", SO_ERROR: %s", short_strerror(socket->so_error)));
115 SOCK_ERRNO (socket->so_error);
116 socket->so_error = 0;
117 return (-1);
118 }
119 }
120
121 SOCK_DEBUGF ((", connect already done!"));
122 SOCK_ERRNO (EISCONN);
123 return (-1);
124 }
125
126 SOCK_DEBUGF ((", reconnecting"));
127
128 /* No need to reconnect if same peer address/port.
129 */
130 if (!is_ip6)
131 {
132 const struct sockaddr_in *ra = (const struct sockaddr_in*)socket->remote_addr;
133
134 if (addr->sin_addr.s_addr == ra->sin_addr.s_addr &&
135 addr->sin_port == ra->sin_port)
136 return (0);
137 }
138#if defined(USE_IPV6)
139 else
140 {
141 const struct sockaddr_in6 *ra = (const struct sockaddr_in6*)socket->remote_addr;
142
143 if (!memcmp(&addr6->sin6_addr, &ra->sin6_addr, sizeof(addr6->sin6_addr)) &&
144 addr6->sin6_port == ra->sin6_port)
145 return (0);
146 }
147#endif
148
149 /* Clear any effect of previous ICMP errors etc.
150 */
151 socket->so_state &= ~(SS_CONN_REFUSED | SS_CANTSENDMORE | SS_CANTRCVMORE);
152 socket->so_error = 0;
153 }
154 else
155 {
156 socket->remote_addr = SOCK_CALLOC (sa_len);
157 if (!socket->remote_addr)
158 {
159 SOCK_DEBUGF ((", ENOMEM (rem)"));
160 SOCK_ERRNO (ENOMEM);
161 return (-1);
162 }
163 }
164
165#if defined(USE_IPV6)
166 if (is_ip6)
167 {
168 struct sockaddr_in6 *ra = (struct sockaddr_in6*)socket->remote_addr;
169
170 ra->sin6_family = AF_INET6;
171 ra->sin6_port = addr6->sin6_port;
172 memcpy (&ra->sin6_addr, &addr6->sin6_addr, sizeof(ra->sin6_addr));
173 }
174 else
175#endif
176 {
177 socket->remote_addr->sin_family = AF_INET;
178 socket->remote_addr->sin_port = addr->sin_port;
179 socket->remote_addr->sin_addr = addr->sin_addr;
180 }
181
182 if (!socket->local_addr)
183 {
184 SOCK_DEBUGF ((", auto-binding"));
185
186 socket->local_addr = (struct sockaddr_in*) SOCK_CALLOC (sa_len);
187 if (!socket->local_addr)
188 {
189 free (socket->remote_addr);
190 socket->remote_addr = NULL;
191 SOCK_DEBUGF ((", ENOMEM (loc)"));
192 SOCK_ERRNO (ENOMEM);
193 return (-1);
194 }
195
196#if defined(USE_IPV6)
197 if (is_ip6)
198 {
199 struct sockaddr_in6 *la = (struct sockaddr_in6*)socket->local_addr;
200
201 la->sin6_family = AF_INET6;
202 la->sin6_port = htons (find_free_port(0,TRUE));
203 memcpy (&la->sin6_addr, &in6addr_my_ip, sizeof(la->sin6_addr));
204 }
205 else
206#endif
207 {
208 socket->local_addr->sin_family = AF_INET;
209 socket->local_addr->sin_port = htons (find_free_port(0,TRUE));
210 socket->local_addr->sin_addr.s_addr = htonl (my_ip_addr);
211 }
212 }
213
214 SOCK_DEBUGF ((", src/dest ports: %u/%u",
215 ntohs(socket->local_addr->sin_port),
216 ntohs(socket->remote_addr->sin_port)));
217
218
219 /* Not safe to run sock_daemon() now
220 */
221 _sock_crit_start();
222
223 /* Setup SIGINT handler now.
224 */
225 if (_sock_sig_setup() < 0)
226 {
227 SOCK_DEBUGF ((", EINTR"));
228 SOCK_ERRNO (EINTR);
229 _sock_crit_stop();
230 return (-1);
231 }
232
233 switch (socket->so_type)
234 {
235 case SOCK_STREAM:
236 rc = tcp_connect (socket);
237 break;
238
239 case SOCK_DGRAM:
240 rc = udp_connect (socket);
241 break;
242
243 case SOCK_RAW:
244 rc = raw_connect (socket);
245 break;
246
247 default:
248 SOCK_ERRNO (EPROTONOSUPPORT);
249 rc = -1;
250 break;
251 }
252
253 _sock_sig_restore();
254 _sock_crit_stop();
255
256 return (rc);
257}
258
259/*
260 * Handle SOCK_DGRAM connection. Always blocking in _arp_resolve()
261 */
262static int udp_connect (Socket *socket)
263{
264#if defined(USE_IPV6)
265 if (socket->so_family == AF_INET6)
266 {
267 const struct sockaddr_in6 *la = (const struct sockaddr_in6*) socket->local_addr;
268 const struct sockaddr_in6 *ra = (const struct sockaddr_in6*) socket->remote_addr;
269
270 if (!_UDP6_open (socket, &ra->sin6_addr, la->sin6_port, ra->sin6_port))
271 {
272 SOCK_DEBUGF ((", no route (udp6)"));
273 SOCK_ERRNO (EHOSTUNREACH);
274 STAT (ip6stats.ip6s_noroute++);
275 return (-1);
276 }
277 }
278 else
279#endif
280 if (!_UDP_open (socket,
281 socket->remote_addr->sin_addr,
282 socket->local_addr->sin_port,
283 socket->remote_addr->sin_port))
284 {
285 /* errno already set in udp_open() */
286 SOCK_DEBUGF ((", %s", socket->udp_sock->err_msg));
287 return (-1);
288 }
289
290 socket->so_state &= ~SS_UNCONNECTED;
291 socket->so_state |= SS_ISCONNECTED;
292 return (0);
293}
294
295
296/*
297 * SOCK_RAW "connect" is very simple.
298 */
299static int raw_connect (Socket *socket)
300{
301 socket->so_state |= SS_ISCONNECTED;
302
303 /* Note: _arp_resolve() is done in ip_transmit()
304 */
305 return (0);
306}
307
308/*
309 * Check for catched signals
310 */
311static int chk_signals (void)
312{
313 if (_sock_sig_pending())
314 {
315 SOCK_DEBUGF ((", EINTR"));
316 SOCK_ERRNO (EINTR);
317 return (-1);
318 }
319 return (0);
320}
321
322/*
323 * Handle SOCK_STREAM blocking connection. Or non-blocking connect
324 * the first time connect() is called.
325 */
326static int tcp_connect (Socket *socket)
327{
328 DWORD timeout;
329 int status;
330
331#if defined(USE_IPV6)
332 if (socket->so_family == AF_INET6)
333 {
334 const struct sockaddr_in6 *la = (const struct sockaddr_in6*) socket->local_addr;
335 const struct sockaddr_in6 *ra = (const struct sockaddr_in6*) socket->remote_addr;
336
337 if (!_TCP6_open (socket, &ra->sin6_addr, la->sin6_port, ra->sin6_port))
338 {
339 /* errno already set in _TCP6_open() */
340 SOCK_DEBUGF ((", %s", socket->tcp_sock->err_msg));
341 return (-1);
342 }
343 }
344 else
345#endif
346 if (!_TCP_open (socket,
347 socket->remote_addr->sin_addr,
348 socket->local_addr->sin_port,
349 socket->remote_addr->sin_port))
350 {
351 /* errno already set in tcp_open() */
352 SOCK_DEBUGF ((", %s", socket->tcp_sock->err_msg));
353 return (-1);
354 }
355
356 /* Don't let tcp_Retransmitter() kill this socket
357 * before our `socket->timeout' expires
358 */
359 socket->tcp_sock->locflags |= LF_RCVTIMEO;
360
361 /* We're here only when connect() is called the 1st time
362 * (blocking or non-blocking socket).
363 */
364 socket->so_state |= SS_ISCONNECTING;
365 socket->so_error = 0;
366
367 if (socket->so_state & SS_NBIO)
368 {
369 /* Use default 'sock_delay' for timeout, since 'socket->timeout'
370 * will be 0 for non-blocking sockets.
371 */
372 socket->nb_timer = set_timeout (1000 * sock_delay);
373
374 SOCK_DEBUGF ((", EINPROGRESS (-1)"));
375 SOCK_ERRNO (EINPROGRESS);
376 return (-1);
377 }
378
379 timeout = set_timeout (1000 * socket->timeout);
380
381 /* Handle blocking stream socket connect.
382 * Maybe we should use select_s() instead ?
383 * Maybe set LF_NOCLOSE for all BSD sockets?
384 *
385 * And make gcc 8+ shut up about this warning:
386 * connect.c:343:41: warning: cast between incompatible function types from
387 * 'int (*)(void)' to 'int (*)(void *)' [-Wcast-function-type]
388 * 343 | socket->timeout, (UserHandler)chk_signals,
389 * | ^
390 */
391 W32_GCC_FUNC_TYPE_WARN_OFF()
392
393 status = _ip_delay0 ((sock_type*)socket->tcp_sock,
394 socket->timeout, (UserHandler)chk_signals,
395 NULL);
396
397 W32_GCC_FUNC_TYPE_WARN_DEF()
398
399 if (socket->so_error != 0)
400 {
401 SOCK_DEBUGF ((", SO_ERROR: %s", socket->tcp_sock->err_msg ?
402 socket->tcp_sock->err_msg :
403 short_strerror (socket->so_error)));
404 SOCK_ERRNO (socket->so_error);
405 socket->so_error = 0;
406 return (-1);
407 }
408
409 if (status < 0 && chk_timeout(timeout))
410 {
411 socket->so_state &= ~SS_ISCONNECTING;
412 SOCK_DEBUGF ((", ETIMEDOUT"));
413 SOCK_ERRNO (ETIMEDOUT);
414 return (-1);
415 }
416
417 if (status < 0)
418 {
419 socket->so_state &= ~SS_ISCONNECTING;
420 SOCK_DEBUGF ((", ECONNRESET"));
421 SOCK_ERRNO (ECONNRESET);
422 return (-1);
423 }
424
425 socket->so_state &= ~(SS_UNCONNECTED | SS_ISCONNECTING);
426 socket->so_state |= SS_ISCONNECTED;
427 return (0);
428}
429
430#endif /* USE_BSD_API */
W32_GCC_FUNC_TYPE_WARN_DEF
W32_GCC_FUNC_TYPE_WARN_DEF() static void W32_CALL echo_discard_daemon(void)
"background" process handling echo + discard TCP sockets.
Definition: echo.c:191
W32_GCC_FUNC_TYPE_WARN_OFF
W32_GCC_FUNC_TYPE_WARN_OFF() void echo_discard_start(void)
Make gcc 8+ shut up about this warning: echo.c:143:19: warning: cast between incompatible function ty...
Definition: echo.c:135
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
_UDP6_open
int _UDP6_open(Socket *socket, const void *host, WORD loc_port, WORD rem_port)
Definition: socket.c:2157
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
_sock_chk_sockaddr
int _sock_chk_sockaddr(Socket *socket, const struct sockaddr *sa, socklen_t len)
Check ‘sockaddr*’ passed to bind/connect.
Definition: socket.c:819
_TCP6_open
int _TCP6_open(Socket *socket, const void *dst, WORD loc_port, WORD rem_port)
Definition: socket.c:2058
_sock_pending_connect
BOOL _sock_pending_connect(Socket *socket)
Check progress on a non-blocking SOCK_STREAM socket that has SS_ISCONNECTING set.
Definition: socket.c:2186
_sock_crit_start
void _sock_crit_start(void)
Start a critical region.
Definition: socket.c:1266
_sock_crit_stop
void _sock_crit_stop(void)
Mark the end of a critical region.
Definition: socket.c:1276
_UDP_open
int _UDP_open(Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
Open and listen routines for SOCK_DGRAM at the socket-level.
Definition: socket.c:1942
_TCP_open
int _TCP_open(Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
Open and listen routines for SOCK_STREAM at the socket-level.
Definition: socket.c:2015
Socket
Definition: socket.h:158
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/src/copyrigh.h Source File

  • src
copyrigh.h
Go to the documentation of this file.
1


Watt-32 tcp/ip: E:/WATT/src/country.c Source File

  • src
country.c
Go to the documentation of this file.
1
6/*
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 *
34 * These funtions are meant to:
35 * 1) automatic detection and selection of language for the _LANG()
36 * function. But not use yet.
37 * 2) obtaining the active codepage for IDNA/ACE conversion stuff.
38 */
39
40#include <stdio.h>
41#include <stdlib.h>
42
43#include "wattcp.h"
44#include "wdpmi.h"
45#include "x32vm.h"
46#include "powerpak.h"
47#include "misc.h"
48
49#if defined(__MSDOS__)
50
51static char country_info[35]; /* not used yet */
52
53int GetCountryCode (void)
54{
55 IREGS reg;
56
57 if (_watt_os_ver < 0x300)
58 return (0);
59
60 memset (&reg, 0, sizeof(reg));
61 reg.r_ax = 0x3800;
62
63#if (DOSX & DJGPP)
64 if (_go32_info_block.size_of_transfer_buffer < sizeof(country_info))
65 return (0);
66 reg.r_ds = __tb / 16;
67 reg.r_dx = __tb & 15;
68
69#elif (DOSX & (PHARLAP|X32VM|POWERPAK))
70 if (_watt_dosTbSize < sizeof(country_info))
71 return (0);
72 reg.r_ds = RP_SEG (_watt_dosTbr);
73 reg.r_dx = RP_OFF (_watt_dosTbr);
74
75#elif (DOSX & DOS4GW)
76 if (_watt_dosTbSize < sizeof(country_info))
77 return (0);
78 reg.r_ds = _watt_dosTbSeg;
79 reg.r_dx = 0;
80
81#elif (DOSX == 0)
82 reg.r_ds = FP_SEG (country_info);
83 reg.r_dx = FP_OFF (country_info);
84
85#else
86 #error Unexpected target!
87#endif
88
89 GEN_INTERRUPT (0x21, &reg);
90 if (reg.r_flags & 1)
91 return (0);
92
93 memset (&country_info, 0, sizeof(country_info));
94
95#if (DOSX & DJGPP)
96 dosmemget (__tb, sizeof(country_info), &country_info);
97
98#elif (DOSX & (PHARLAP|X32VM|POWERPAK))
99 ReadRealMem (&country_info, _watt_dosTbr, sizeof(country_info));
100
101#elif (DOSX & DOS4GW)
102 memcpy (&country_info, SEG_OFS_TO_LIN(_watt_dosTbSeg,0), sizeof(country_info));
103#endif
104
105 return (WORD)reg.r_bx;
106}
107
108/*
109 * Return active codepage
110 */
111int GetCodePage (void)
112{
113 IREGS reg;
114
115 if (_watt_os_ver < 0x303)
116 return (0);
117
118 memset (&reg, 0, sizeof(reg));
119 reg.r_ax = 0x6601;
120 GEN_INTERRUPT (0x21, &reg);
121 if (reg.r_flags & CARRY_BIT)
122 return (0);
123 return (WORD)reg.r_bx;
124}
125#endif /* __MSDOS__ */
126
_watt_os_ver
WORD _watt_os_ver
Definition: misc.c:74
misc.h
powerpak.h
IREGS
Definition: misc.h:610
wattcp.h
Core definitions.
wdpmi.h
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/cpumodel.h Source File

  • src
cpumodel.h
Go to the documentation of this file.
1
4/*
5 * This file contains declaration for variables and code
6 * that may be used to get the Intel Cpu identification
7 * that has been performed by CheckCpuType() function.
8 *
9 * COPYRIGHT (c) 1998 valette@crf.canon.fr
10 *
11 * The license and distribution terms for this file may be
12 * found in the file LICENSE in this distribution or at
13 * http://www.OARcorp.com/rtems/license.html.
14 *
15 * $Id: cpumodel.h,v 1.2 1998/08/05 16:51:39 joel Exp $
16 */
17
18#if !defined(_w32_CPUMODEL_H) && (DOSX) /* Only for DOSX/Win32 targets */
19#define _w32_CPUMODEL_H
20
21#if defined(__DMC__)
22 #define SYSCALL __syscall /* no underscore prefix */
23#else
24 #define SYSCALL
25#endif
26
27#if defined(__GNUC__) || defined(__POCC__) || defined(_MSC_VER)
28 #define DATA_DECL
29#else
30 #define DATA_DECL cdecl
31#endif
32
33extern char DATA_DECL x86_type; /* type of CPU (3=386, 4=486, ...) */
34extern char DATA_DECL x86_model;
35extern char DATA_DECL x86_mask;
36extern int DATA_DECL x86_hard_math; /* FPU present */
37extern DWORD DATA_DECL x86_capability;
38extern int DATA_DECL x86_have_cpuid;
39extern char DATA_DECL x86_vendor_id[13];
40
41/* x86_capability bits
42 */
43#define X86_CAPA_FPU (1UL << 0) /* Floating Point processor */
44#define X86_CAPA_VME (1UL << 1) /* V86 Mode Extensions */
45#define X86_CAPA_DE (1UL << 2) /* Debug Extensions */
46#define X86_CAPA_PSE (1UL << 3) /* Page Size Extensions */
47#define X86_CAPA_TSC (1UL << 4) /* Time Stamp Counter */
48#define X86_CAPA_MSR (1UL << 5) /* Model Specific Registers */
49#define X86_CAPA_PAE (1UL << 6) /* Physical Address Extensions */
50#define X86_CAPA_MCE (1UL << 7) /* Machine Check Exception */
51#define X86_CAPA_CX8 (1UL << 8) /* CMPXCHG8B instruction available */
52#define X86_CAPA_APIC (1UL << 9) /* APIC present (multiproc support) */
53#define X86_CAPA_FSC (1UL << 10) /* Fast System Call (AMD K6/Cyrix) */
54#define X86_CAPA_SEP (1UL << 11) /* Fast system call (SYSENTER/SYSEXIT) */
55#define X86_CAPA_MTRR (1UL << 12) /* Memory Type Range Registers */
56#define X86_CAPA_PGE (1UL << 13) /* Page Global Enable */
57#define X86_CAPA_MCA (1UL << 14) /* Machine Check Architecture */
58#define X86_CAPA_CMOV (1UL << 15) /* Conditional MOVe instructions */
59#define X86_CAPA_PAT (1UL << 16) /* Page Attribute Table */
60#define X86_CAPA_PSE36 (1UL << 17) /* 36 bit Page Size Extenions */
61#define X86_CAPA_PSN (1UL << 18) /* Processor Serial Number */
62#define X86_CAPA_CFLSH (1UL << 19) /* Cache Flush */
63#define X86_CAPA_RSRV_20 (1UL << 20) /* Reserved */
64#define X86_CAPA_DTES (1UL << 21) /* Debug Trace Store */
65#define X86_CAPA_ACPI (1UL << 22) /* ACPI support */
66#define X86_CAPA_MMX (1UL << 23) /* MultiMedia Extensions */
67#define X86_CAPA_FXSR (1UL << 24) /* FXSAVE/FXRSTOR instructions */
68#define X86_CAPA_SSE (1UL << 25) /* SSE instructions */
69#define X86_CAPA_SSE2 (1UL << 26) /* SSE2 instructions */
70#define X86_CAPA_SSNOOP (1UL << 27) /* SELFSNOOP */
71#define X86_CAPA_RSRV_28 (1UL << 28) /* Reserved */
72#define X86_CAPA_ACC (1UL << 29) /* Automatic Clock Control */
73#define X86_CAPA_IA64 (1UL << 30) /* IA64 instructions */
74#define X86_CAPA_RSRV_31 (1UL << 31) /* Reserved */
75
76/* CR4 register bits.
77 */
78#define CR4_TS_DISABLE 0x004
79#define CR4_OSFXSR 0x100 /* ?? OS does FXSAVE/FXRSTOR on task switch */
80
81#define CheckCpuType W32_NAMESPACE (CheckCpuType)
82#define MY_CS W32_NAMESPACE (MY_CS)
83#define MY_DS W32_NAMESPACE (MY_DS)
84#define MY_ES W32_NAMESPACE (MY_ES)
85#define MY_SS W32_NAMESPACE (MY_SS)
86#define asm_ffs W32_NAMESPACE (asm_ffs)
87#define Get_CR4 W32_NAMESPACE (Get_CR4)
88#define SelWriteable W32_NAMESPACE (SelWriteable)
89#define SelReadable W32_NAMESPACE (SelReadable)
90#define get_cpuid W32_NAMESPACE (get_cpuid)
91#define get_rdtsc W32_NAMESPACE (get_rdtsc)
92#define get_rdtsc2 W32_NAMESPACE (get_rdtsc2)
93
94extern void SYSCALL cdecl CheckCpuType (void);
95extern int SYSCALL cdecl asm_ffs (int val);
96
97extern WORD SYSCALL cdecl MY_CS (void);
98extern WORD SYSCALL cdecl MY_DS (void);
99extern WORD SYSCALL cdecl MY_ES (void);
100extern WORD SYSCALL cdecl MY_SS (void);
101extern DWORD SYSCALL cdecl Get_CR4 (void);
102
103extern BOOL SYSCALL cdecl SelWriteable (WORD sel);
104extern BOOL SYSCALL cdecl SelReadable (WORD sel);
105
106#if defined(__HIGHC__)
107 #pragma alias (x86_type, "x86_type")
108 #pragma alias (x86_model, "x86_model")
109 #pragma alias (x86_mask, "x86_mask")
110 #pragma alias (x86_hard_math, "x86_hard_math")
111 #pragma alias (x86_capability, "x86_capability")
112 #pragma alias (x86_vendor_id, "x86_vendor_id")
113 #pragma alias (x86_have_cpuid, "x86_have_cpuid")
114
115 #pragma alias (_w32_CheckCpuType,"_w32_CheckCpuType")
116 #pragma alias (_w32_MY_CS, "_w32_MY_CS")
117 #pragma alias (_w32_MY_DS, "_w32_MY_DS")
118 #pragma alias (_w32_MY_ES, "_w32_MY_ES")
119 #pragma alias (_w32_MY_SS, "_w32_MY_SS")
120 #pragma alias (_w32_asm_ffs, "_w32_asm_ffs")
121 #pragma alias (_w32_Get_CR4, "_w32_Get_CR4")
122 #pragma alias (_w32_SelWriteable,"_w32_SelWriteable")
123 #pragma alias (_w32_SelReadable, "_w32_SelReadable")
124#endif
125
126
127/*
128 * If __NO_INLINE__ is defined no functions are provided at all, thus disable
129 * this exlusion at least for DJGPP or the build will fail for -O0!
130 */
131#if defined(__GNUC__) && defined(__i386__) && (!defined(__NO_INLINE__) || defined(__DJGPP__))
132 /*
133 * Call this only if x86_have_cpuid == TRUE.
134 */
135 W32_GCC_INLINE void get_cpuid (DWORD val, DWORD *eax,
136 DWORD *ebx, DWORD *ecx,
137 DWORD *edx)
138 {
139 __asm__ __volatile__ (
140 ".byte 0x0F,0xA2;" /* cpuid opcode */
141 : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
142 : "0" (val));
143 ARGSUSED (val);
144 ARGSUSED (eax);
145 ARGSUSED (ebx);
146 ARGSUSED (ecx);
147 ARGSUSED (edx);
148 }
149
150 /*
151 * Return CPU timestamp value. Don't call unless 'has_rdtsc'
152 * is TRUE. This code is originally by
153 * Tom Burgess <Tom_Burgess@bc.sympatico.ca> and
154 * Douglas Eleveld <deleveld@dds.nl>
155 */
156 W32_GCC_INLINE uint64 get_rdtsc (void)
157 {
158 register uint64 tsc;
159 __asm__ __volatile__ (
160 ".byte 0x0F, 0x31;" /* rdtsc opcode */
161 : "=A" (tsc) );
162 return (tsc);
163 }
164
165 W32_GCC_INLINE void get_rdtsc2 (struct ulong_long *tsc)
166 {
167 __asm__ __volatile__ (
168 ".byte 0x0F, 0x31;"
169 : "=a" (tsc->lo), "=d" (tsc->hi) : );
170 }
171
172#elif defined(__GNUC__) && defined(__x86_64__) && !defined(__NO_INLINE__)
173 /*
174 * We can safely assume all x64 CPUs have 'x86_have_cpuid == TRUE'.
175 */
176 W32_GCC_INLINE void get_cpuid (DWORD val, DWORD *r1,
177 DWORD *r2, DWORD *r3,
178 DWORD *r4)
179 {
180 __asm__ __volatile__ (
181 "cpuid"
182 : "=a" (*r1), "=b" (*r2), "=c" (*r3), "=d" (*r4)
183 : "a" (val));
184 ARGSUSED (val); /* for lint */
185 ARGSUSED (r1);
186 ARGSUSED (r2);
187 ARGSUSED (r3);
188 ARGSUSED (r4);
189 }
190
191 /*
192 * Taken from:
193 * http://stackoverflow.com/questions/9887839/clock-cycle-count-wth-gcc
194 */
195 W32_GCC_INLINE uint64 get_rdtsc (void)
196 {
197 unsigned hi, lo;
198 __asm__ __volatile__ (
199 "rdtsc" : "=a" (lo), "=d" (hi) );
200 return ( (uint64)lo) | ( ((uint64)hi) << 32 );
201 }
202
203#elif defined(WATCOM386)
204 /*
205 * Call this only if x86_have_cpuid == TRUE.
206 */
207 extern void get_cpuid (DWORD val, DWORD *eax, DWORD *ebx, DWORD *ecx, DWORD *edx);
208 #pragma aux _w32_get_cpuid = \
209 ".586" \
210 "push eax" \
211 "push ebx" \
212 "push ecx" \
213 "push edx" \
214 "mov eax, esi" \
215 "cpuid" \
216 "mov esi, [esp]" \
217 "mov [esi], edx" \
218 "mov esi, [esp+4]" \
219 "mov [esi], ecx" \
220 "mov esi, [esp+8]" \
221 "mov [esi], ebx" \
222 "mov esi, [esp+12]" \
223 "mov [esi], eax" \
224 "add esp, 16" \
225 __parm [__esi] [__eax] [__ebx] [__ecx] [__edx] \
226 __modify [__esi __eax __ebx __ecx __edx];
227
228 extern uint64 get_rdtsc (void);
229 #pragma aux _w32_get_rdtsc = \
230 ".586" \
231 "db 0Fh, 31h" \
232 "cld" \
233 "nop" \
234 "nop" \
235 "nop" \
236 "nop" \
237 __modify [__eax __edx];
238
239#else
240 /*
241 * No inlining for other targets
242 */
243 extern void SYSCALL cdecl get_cpuid (DWORD val, DWORD *_eax,
244 DWORD *_ebx, DWORD *_ecx,
245 DWORD *_edx);
246 #ifdef HAVE_UINT64
247 extern uint64 cdecl get_rdtsc (void);
248 #endif
249#endif
250
251#if (DOSX) && !defined(__GNUC__)
252 extern void cdecl get_rdtsc2 (struct ulong_long *);
253#endif
254
255#if defined(__HIGHC__)
256 #pragma alias (get_cpuid, "_w32_get_cpuid")
257 #pragma alias (get_rdtsc, "_w32_get_rdtsc")
258 #pragma alias (get_rdtsc2, "_w32_get_rdtsc2")
259#endif
260
261#if defined(_WIN64)
262 #define GET_RDTSC() __rdtsc() /* In '<intrin.h>' */
263
264#elif defined(_WIN32)
265 extern uint64 win_get_rdtsc (void); /* In 'timer.c' */
266 #define GET_RDTSC() win_get_rdtsc()
267
268#else
269 #define GET_RDTSC() get_rdtsc()
270#endif
271
272#undef SYSCALL
273#undef DATA_DECL
274
275#if defined(__x86_64__) || defined(_M_X64)
276 /*
277 * All 64-bit CPU's have CPUID
278 */
279 W32_INLINE BOOL have_cpuid (void)
280 {
281 return (TRUE);
282 }
283#endif
284
285/*
286 * Check if a CPUID instruction is available on this CPU.
287 * Not used at the moment. See cpumodel.asm instead.
288 */
289#if defined(__GNUC__) && defined(__i386__) && !defined(__NO_INLINE__)
290 W32_GCC_INLINE BOOL have_cpuid (void)
291 {
292 int result = -1;
293
294 /* We're checking if the bit #21 of EFLAGS
295 * can be toggled. If yes = CPUID is available.
296 */
297 __asm__ __volatile__ (
298 "pushf\n"
299 "popl %%eax\n"
300 "xorl $0x200000, %%eax\n"
301 "movl %%eax, %%ecx\n"
302 "andl $0x200000, %%ecx\n"
303 "pushl %%eax\n"
304 "popf\n"
305 "pushf\n"
306 "popl %%eax\n"
307 "andl $0x200000, %%eax\n"
308 "xorl %%eax, %%ecx\n"
309 "movl %%ecx, %0\n"
310 : "=r" (result) : : "eax", "ecx");
311 return (result == 0);
312 }
313
314#elif (defined(_MSC_VER) || defined(__POCC__)) && !defined(_M_X64) /* Not for 64-bit compilers */
315 #if defined(__POCC__)
316 #pragma warn(push)
317 #pragma warn(disable:2135)
318 #endif
319
320 __declspec(naked) W32_INLINE BOOL have_cpuid (void)
321 {
322 _asm {
323 pushfd
324 pop eax
325 mov ecx, eax
326 xor eax, 1 << 21
327 push eax
328 popfd
329 pushfd
330 pop eax
331 xor eax, ecx
332 bt eax, 21
333 jnc no_cpuid
334 mov eax, 1
335 ret
336 no_cpuid:
337 mov eax, 0
338 ret
339 }
340 }
341
342 #if defined(__POCC__)
343 #pragma warn(pop)
344 #endif
345
346/*
347 * And finally a RDTSC + CPUID hack for 64-bit CPUs.
348 * Use the '__rdtsc()' from <intrin.h>.
349 */
350#elif defined(_MSC_VER) && defined(_M_X64)
351 #include <intrin.h>
352
353 #pragma intrinsic (__rdtsc)
354 #undef get_rdtsc
355 #define get_rdtsc() __rdtsc()
356
357 W32_INLINE void get_cpuid (DWORD val, DWORD *rax,
358 DWORD *rbx, DWORD *rcx,
359 DWORD *rdx)
360 {
361 int regs[4];
362
363 __cpuid (regs, val);
364 if (rax)
365 *rax = (DWORD) regs[0];
366 if (rbx)
367 *rbx = (DWORD) regs[1];
368 if (rcx)
369 *rcx = (DWORD) regs[2];
370 if (rdx)
371 *rdx = (DWORD) regs[3];
372 }
373#endif
374
375#endif /* !_w32_CPUMODEL_H && DOSX */
376
ulong_long
Definition: wattcp.h:90
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65


Watt-32 tcp/ip: E:/WATT/src/crc.c Source File

  • src
crc.c
Go to the documentation of this file.
1
10#include <stdio.h>
11#include <stdlib.h>
12
13#include "wattcp.h"
14#include "misc.h"
15
16#define CRC_BITS 32
17#define CRC_HIBIT ((DWORD) (1L << (CRC_BITS-1)))
18#define CRC_SHIFTS (CRC_BITS-8)
19
20/*
21 * When using UBSAN ("Undefined Behavior Sanitizer"):
22 * crc.c:51:13: runtime error: left shift of 1 by 31 places cannot be represented in type 'long'
23 */
24#if defined(USE_UBSAN)
25 #undef CRC_HIBIT
26 #define CRC_HIBIT 0x80000000
27#endif
28
29/* Our PRZ's 24-bit CRC generator polynomial. Ref:
30 * http://en.wikipedia.org/wiki/Cyclic_redundancy_check
31 * Section "Commonly used and standardized CRCs"
32 */
33#define CRC_PRZ 0x864CFBL
34
35DWORD *crc_table; /* Pre-generated table for speeding up CRC calculations. */
36
37/*
38 * mk_crctbl() derives a CRC lookup table from the CRC polynomial.
39 * The table is used later by crc_bytes() below.
40 * mk_crctbl() only needs to be called once at the dawn of time.
41 * I.e. in crc_init().
42 *
43 * The theory behind mk_crctbl() is that table[i] is initialized
44 * with the CRC of i, and this is related to the CRC of `i >> 1',
45 * so the CRC of `i >> 1' (pointed to by p) can be used to derive
46 * the CRC of i (pointed to by q).
47 */
48static void mk_crctbl (DWORD poly, DWORD *tab)
49{
50 DWORD *p = tab;
51 DWORD *q = tab;
52 int i;
53
54 *q++ = 0;
55 *q++ = poly;
56 for (i = 1; i < 128; i++)
57 {
58 DWORD t = *(++p);
59
60 if (t & CRC_HIBIT)
61 {
62 t <<= 1;
63 *q++ = t ^ poly;
64 *q++ = t;
65 }
66 else
67 {
68 t <<= 1;
69 *q++ = t;
70 *q++ = t ^ poly;
71 }
72 }
73}
74
75/*
76 * Calculate 32-bit CRC on buffer 'buf' with length 'len'.
77 */
78DWORD crc_bytes (const char *buf, size_t len)
79{
80 DWORD accum;
81
82 for (accum = 0; crc_table && len > 0; len--)
83 accum = (accum << 8) ^ crc_table[(BYTE)(accum >> CRC_SHIFTS) ^ *buf++];
84 return (accum);
85}
86
87BOOL crc_init (void)
88{
89 if (crc_table)
90 return (TRUE);
91
92 crc_table = calloc (sizeof(DWORD), 256);
93 if (!crc_table)
94 return (FALSE);
95
96 mk_crctbl (CRC_PRZ, crc_table);
97 return (TRUE);
98}
99
misc.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/crit.c Source File

  • src
crit.c
Go to the documentation of this file.
1
5/* Targets:
6 * Metaware HighC / PharLap
7 * WatcomC (real/prot mode) \todo finish suport for Watcom
8 * GNU C / djgpp2
9 * real-mode DOS targets
10 *
11 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgement:
23 * This product includes software developed by Gisle Vanem
24 * Bergen, Norway.
25 *
26 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
30 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
33 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 */
38
39#include <stdio.h>
40#include <stdlib.h>
41
42#include "wattcp.h"
43#include "language.h"
44#include "x32vm.h"
45#include "misc.h"
46
47#if defined(NOT_USED_ANYMORE) || 1
48
49#if (DOSX & PHARLAP)
50#include <mw/exc.h>
51#endif
52
53#include "nochkstk.h" /* disable stack-checking here */
54
55#if defined(__HIGHC__)
56 #pragma off(Call_trace)
57 #pragma off(Prolog_trace)
58 #pragma off(Epilog_trace)
59#endif
60
61#if (DOSX & (PHARLAP|X32VM))
62 static REALPTR int24_old, rmcb;
63
64 static void cdecl int24_isr (SWI_REGS *reg)
65 {
66 reg->r_ax = 3; /* simply fail the function */
67 } /* note: this only works on DOS 3.0 and above */
68
69 void int24_restore (void)
70 {
71 if (!rmcb)
72 return;
73 _dx_ulock_pgsn (&int24_isr, 20);
74 _dx_rmiv_set (CRIT_VECT, int24_old);
75 _dx_free_rmode_wrapper (rmcb);
76 rmcb = 0;
77 }
78
79 void int24_init (void)
80 {
81 if (_watt_os_ver < 0x300)
82 return;
83
84 _dx_rmiv_get (CRIT_VECT, &int24_old);
85 rmcb = _dx_alloc_rmode_wrapper_iret (int24_isr, 256);
86
87 if (!rmcb)
88 return;
89
90 _dx_lock_pgsn (&int24_isr, 20);
91 _dx_rmiv_set (CRIT_VECT, rmcb);
92 RUNDOWN_ADD (int24_restore, 20);
93 }
94
95/*---------------------------------------------------------------------*/
96
97#elif (defined (__DMC__) && !defined(DMC386)) || defined(__WATCOMC__)
98 static int _far int24_isr (unsigned dev_err, unsigned err_code,
99 unsigned _far *dev_hdr)
100 {
101 ARGSUSED (dev_err);
102 ARGSUSED (dev_hdr);
103 ARGSUSED (err_code);
104 return (_HARDERR_FAIL);
105 }
106
107 void int24_init (void)
108 {
109 if (_watt_os_ver >= 0x300)
110 _harderr (int24_isr);
111 }
112
113/*---------------------------------------------------------------------*/
114
115#elif (DOSX & DJGPP)
116 static _go32_dpmi_seginfo rm_cb, int24_old;
117 static __dpmi_regs rm_reg;
118
119 static void int24_isr (void)
120 {
121 rm_reg.x.ax = 3;
122 }
123
124 void int24_restore (void)
125 {
126 if (int24_old.rm_segment)
127 {
128 _go32_dpmi_set_real_mode_interrupt_vector (CRIT_VECT, &int24_old);
129 _go32_dpmi_free_real_mode_callback (&rm_cb);
130 int24_old.rm_segment = 0;
131 }
132 }
133
134 void int24_init (void)
135 {
136 if (_watt_os_ver < 0x300)
137 return;
138
139 _go32_dpmi_get_real_mode_interrupt_vector (CRIT_VECT, &int24_old);
140 rm_cb.pm_offset = (DWORD) int24_isr;
141 if (_go32_dpmi_allocate_real_mode_callback_iret(&rm_cb,&rm_reg))
142 return;
143
144 _go32_dpmi_set_real_mode_interrupt_vector (CRIT_VECT, &rm_cb);
145 RUNDOWN_ADD (int24_restore, 20);
146 }
147
148/*---------------------------------------------------------------------*/
149
150#elif DOSX == 0 /* real-mode targets */
151 static W32_IntrHandler int24_old;
152
153 static INTR_PROTOTYPE int24_isr (bp,di,si,ds,es,dx,cx,bx,ax,ip,cs,flags)
154 {
155 ax = 3;
156 ARGSUSED (bp); ARGSUSED (di); ARGSUSED (si); ARGSUSED (ds);
157 ARGSUSED (es); ARGSUSED (dx); ARGSUSED (cx); ARGSUSED (bx);
158 ARGSUSED (ax); ARGSUSED (ip); ARGSUSED (cs); ARGSUSED (flags);
159 }
160
161 void int24_restore (void)
162 {
163 if (int24_old)
164 setvect (CRIT_VECT, int24_old);
165 int24_old = NULL;
166 }
167
168 void int24_init (void)
169 {
170 if (_watt_os_ver >= 0x300)
171 {
172 int24_old = getvect (CRIT_VECT);
173 setvect (CRIT_VECT, int24_isr);
174 RUNDOWN_ADD (int24_restore, 20);
175 }
176 }
177#endif
178
179#endif /* NOT_USED_ANYMORE */
language.h
_watt_os_ver
WORD _watt_os_ver
Definition: misc.c:74
misc.h
nochkstk.h
SWI_REGS
Definition: x32vm.h:16
wattcp.h
Core definitions.
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/doxy-dox Directory Reference

  • src
  • doxy-dox
doxy-dox Directory Reference
Directory dependency graph for doxy-dox:


Watt-32 tcp/ip: E:/WATT/inc/protocol/dumprest.h Source File

  • inc
  • protocol
dumprest.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1980, 1993
7 * The Regents of the University of California. All rights reserved.
8 * (c) UNIX System Laboratories, Inc.
9 * All or some portions of this file are derived from material licensed
10 * to the University of California by American Telephone and Telegraph
11 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
12 * the permission of UNIX System Laboratories, Inc.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 * 3. All advertising materials mentioning features or use of this software
23 * must display the following acknowledgement:
24 * This product includes software developed by the University of
25 * California, Berkeley and its contributors.
26 * 4. Neither the name of the University nor the names of its contributors
27 * may be used to endorse or promote products derived from this software
28 * without specific prior written permission.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
31 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 */
42
43#ifndef __PROTOCOL_DUMPRESTORE_H
44#define __PROTOCOL_DUMPRESTORE_H
45
46#include <sys/wtypes.h>
47
48/*
49 * TP_BSIZE is the size of file blocks on the dump tapes.
50 * Note that TP_BSIZE must be a multiple of DEV_BSIZE.
51 *
52 * NTREC is the number of TP_BSIZE blocks that are written
53 * in each tape record. HIGHDENSITYTREC is the number of
54 * TP_BSIZE blocks that are written in each tape record on
55 * 6250 BPI or higher density tapes.
56 *
57 * TP_NINDIR is the number of indirect pointers in a TS_INODE
58 * or TS_ADDR record. Note that it must be a power of two.
59 */
60#define TP_BSIZE 1024
61#define NTREC 10
62#define HIGHDENSITYTREC 32
63#define TP_NINDIR (TP_BSIZE / 2)
64#define LBLSIZE 16
65#define NAMELEN 64
66
67#define OFS_MAGIC (int)60011
68#define NFS_MAGIC (int)60012
69#define CHECKSUM (int)84446
70
71#include <sys/pack_on.h>
72
73typedef union __u_spcl {
74 char dummy[TP_BSIZE];
75 struct s_spcl {
76 int32_t c_type; /* record type (see below) */
77 time_t c_date; /* date of this dump */
78 time_t c_ddate; /* date of previous dump */
79 int32_t c_volume; /* dump volume number */
80 daddr_t c_tapea; /* logical block of this record */
81 u_int32_t c_inumber; /* number of inode */
82 int32_t c_magic; /* magic number (see above) */
83 int32_t c_checksum; /* record checksum */
84 // struct dinode c_dinode; /* ownership and mode of inode */
85 int32_t c_count; /* number of valid c_addr entries */
86 char c_addr[TP_NINDIR]; /* 1 => data; 0 => hole in inode */
87 char c_label[LBLSIZE]; /* dump label */
88 int32_t c_level; /* level of this dump */
89 char c_filesys[NAMELEN]; /* name of dumpped file system */
90 char c_dev[NAMELEN]; /* name of dumpped device */
91 char c_host[NAMELEN]; /* name of dumpped host */
92 int32_t c_flags; /* additional information */
93 int32_t c_firstrec; /* first record on volume */
94 int32_t c_spare[32]; /* reserved for future uses */
95 } s_spcl;
96 } __u_spcl;
97
98extern union __u_spcl u_spcl;
99
100#include <sys/pack_off.h>
101
102#define spcl u_spcl.s_spcl
103/*
104 * special record types
105 */
106#define TS_TAPE 1 /* dump tape header */
107#define TS_INODE 2 /* beginning of file record */
108#define TS_ADDR 4 /* continuation of file record */
109#define TS_BITS 3 /* map of inodes on tape */
110#define TS_CLRI 6 /* map of inodes deleted since last dump */
111#define TS_END 5 /* end of volume marker */
112
113/*
114 * flag values
115 */
116#define DR_NEWHEADER 0x0001 /* new format tape header */
117#define DR_NEWINODEFMT 0x0002 /* new format inodes on tape */
118
119#define DUMPOUTFMT "%-16s %c %s" /* for printf */
120 /* name, level, ctime(date) */
121#define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */
122
123#endif
pack_off.h
pack_on.h
__u_spcl::s_spcl
Definition: dumprest.h:75
__u_spcl
Definition: dumprest.h:73
wtypes.h


Watt-32 tcp/ip: E:/WATT/src/dynip.c Source File

  • src
dynip.c
Go to the documentation of this file.
1
10#include <stdio.h>
11#include <stdlib.h>
12#include <string.h>
13#include <limits.h>
14#include <ctype.h>
15#include <netdb.h>
16
17#include "wattcp.h"
18#include "language.h"
19#include "misc.h"
20#include "misc_str.h"
21#include "run.h"
22#include "pcconfig.h"
23#include "pcbuf.h"
24#include "pctcp.h"
25#include "pcdns.h"
26#include "netaddr.h"
27#include "dynip.h"
28
29#if defined(USE_DYNIP_CLI) /* Rest of file */
30
31#if defined(SNPRINTF)
32 #define BUF(buf) buf, sizeof(buf)
33 #define _SNPRINTF SNPRINTF
34
35#else
36 #define BUF(buf) buf
37 #define _SNPRINTF sprintf
38#endif
39
40#if defined(USE_DEBUG)
41 #define TRACE(level, arg) \
42 do { \
43 if (trace_level >= level && dynip_enable) { \
44 (*_printf) arg; \
45 fflush (stdout); \
46 } \
47 } while (0)
48#else
49 #define TRACE(level, arg) ((void)0)
50#endif
51
52struct URL {
53 char *host;
54 char *get_req;
55 WORD port;
56 BOOL on_heap;
57 };
58
59static char dyndns_user [MAX_VALUELEN+1] = "";
60static char dyndns_passwd [MAX_VALUELEN+1] = "";
61static char dyn_myhostname [MAX_VALUELEN+1] = "";
62static char dyn_myip [20] = "";
63static BOOL dynip_enable = FALSE;
64static int dyndns_refresh = 3600;
65static int trace_level = 0;
66static char config_file [MAX_PATHLEN+1] = "$(TEMP)\\W32DYNIP.TMP";
67
68static struct URL dyndns = { (char*) "members.dyndns.com",
69 (char*) "/nic/update?system=dyndns&hostname=%s",
70 80, FALSE
71 };
72static struct URL chkip = { NULL, NULL, 0, FALSE };
73
74static char resp_buf [2048];
75static void (W32_CALL *prev_hook) (const char *key, const char *value);
76
77static int get_url (const char *host, int port, const char *path,
78 const char *user_pass);
79
80static const char *parse_myip_address (const char *buf);
81static int parse_dyndns_response (const char *buf);
82static int chkip_method (const char *value);
83static int dyndns_params (const char *value);
84static void url_free (struct URL *url);
85static BOOL url_parse (struct URL *res, const char *url);
86
92static void W32_CALL dynip_config (const char *name, const char *value)
93{
94 static const struct config_table dynip_cfg[] = {
95 { "ENABLE", ARG_ATOI, (void*) &dynip_enable },
96 { "MY_IPADDRESS", ARG_FUNC, (void*) chkip_method },
97 { "MY_HOSTNAME", ARG_STRCPY, (void*) &dyn_myhostname },
98 { "UPDATE", ARG_FUNC, (void*) dyndns_params },
99 { "USER", ARG_STRCPY, (void*) &dyndns_user },
100 { "PASSWD", ARG_STRCPY, (void*) &dyndns_passwd },
101 { "REFRESH", ARG_ATOI, (void*) &dyndns_refresh },
102 { "TRACE", ARG_ATOI, (void*) &trace_level },
103 { "CONFIG", ARG_STRCPY, (void*) &config_file }, /* \todo */
104 { NULL, 0, NULL }
105 };
106
107 if (!parse_config_table(&dynip_cfg[0], "DYNIP.", name, value) && prev_hook)
108 (*prev_hook) (name, value);
109}
110
114static void W32_CALL dynip_exit (void)
115{
116 if (!_watt_fatal_error)
117 {
118 url_free (&chkip);
119 url_free (&dyndns);
120 }
121}
122
123void dynip_init (void)
124{
125 prev_hook = usr_init;
126 usr_init = dynip_config;
127 RUNDOWN_ADD (dynip_exit, 262);
128}
129
130/*
131 * Do this at most once each hour:
132 *
133 * 1. Get our WAN ip (<wan-ip> below) by fetching:
134 * http://checkip.dyndns.com/ or http://ipdetect.dnspark.com/
135 *
136 * 2. Send HTTP request to members.dyndns.com:
137 * GET /nic/update?system=dyndns&hostname=<host-name>&myip=<wan-ip> HTTP/1.1
138 * Host: members.dyndns.com
139 * Authorization: Basic <user-name>:<password> base64 encoded
140 * Connection: close
141 *
142 * 3. Get result: "nohost" means <host-name> isn't registered in DynDNS.
143 * "noauth" means wrong <user-name> or <passord>.
144 * "notfqdn" means invalid <host-name> etc.
145 * "nochg <wan-ip>" means no update needed.
146 * "good <wan-ip>" means the update was acccepted.
147 *
148 * \todo: this should be rewritten as a non-blocking Watt-32 daemon.
149 * Use daemon_add (dynip_exec).
150 */
151int dynip_exec (void)
152{
153 char auth_buf [512] = "";
154 char request [512], *p;
155 int num_arg, rc = 0;
156
157 if (!dynip_enable)
158 return (0);
159
160 if (!dyn_myip[0] && chkip.host) /* Not already entered as dotted quad */
161 {
162 const char *myip;
163
164 rc = get_url (chkip.host, chkip.port, chkip.get_req, NULL);
165 if (rc <= 0)
166 return (0);
167
168 /* 'resp_buf[]' is the non-HTTP part filled by 'get_url()' above.
169 */
170 myip = parse_myip_address (resp_buf);
171
172 TRACE (2, ("Got %d bytes HTML, Found myip: `%s'\r\n", rc, myip));
173 if (!myip)
174 return (0);
175 _strlcpy (dyn_myip, myip, sizeof(dyn_myip));
176 }
177
178 if (!dyn_myhostname[0] || !dyndns.get_req)
179 return (0);
180
181 for (num_arg = 0, p = strstr(dyndns.get_req, "%s"); p;
182 p = strstr (p + 1, "%s"))
183 num_arg++;
184
185 if (num_arg != 1 && num_arg != 2)
186 {
187 TRACE (1, ("Update URL (%s) must contain 1 or 2 \"%%s\" parameters\n",
188 dyndns.get_req));
189 return (0);
190 }
191
192 if (dyndns_user[0] && dyndns_passwd[0])
193 _SNPRINTF (BUF(auth_buf), "%s:%s", dyndns_user, dyndns_passwd);
194 else if (dyndns_user[0])
195 _SNPRINTF (BUF(auth_buf), "%s", dyndns_user);
196
197 _SNPRINTF (BUF(request), dyndns.get_req, dyn_myhostname, dyn_myip);
198
199 if (!dyn_myip[0])
200 {
201 p = strrchr (request, '&'); /* chop of "&myip.." */
202 if (p)
203 *p = '\0';
204 }
205 rc = get_url (dyndns.host, dyndns.port, request,
206 *auth_buf ? auth_buf : NULL);
207 if (rc <= 0)
208 return (0);
209 return parse_dyndns_response (resp_buf);
210}
211
216static const char *parse_myip_address (const char *orig)
217{
218 const char *body, *end, *ret, *p;
219 char *buf;
220 static char res [20];
221
222 buf = strdup (orig);
223 if (!buf)
224 {
225 TRACE (1, ("No memory\n"));
226 return (NULL);
227 }
228
229 strlwr (buf);
230
231 /* Accept "<body>" or "<body bgcolor..>" etc.
232 */
233 body = strstr (buf, "<body");
234 if (!body)
235 {
236 TRACE (1, ("No <body>\n"));
237 free (buf);
238 return (NULL);
239 }
240
241 p = body + sizeof("<body")-1;
242 end = strstr (p, "</body>");
243 if (!end)
244 {
245 TRACE (1, ("No </body>\n"));
246 free (buf);
247 return (NULL);
248 }
249
250 /* Find an IP-address between 'p' and 'end'
251 */
252 TRACE (2, ("p: `%s', len %d\n", p, (int)(end - p)));
253 ret = NULL;
254
255 for ( ; *p && p < end; p++)
256 if (isdigit((int)*p) && aton(p))
257 {
258 ret = _strlcpy (res, p, min(end - p + 1, SIZEOF(res)));
259 break;
260 }
261 free (buf);
262 return (ret);
263}
264
268static int parse_dyndns_response (const char *buf)
269{
270 TRACE (1, ("DynDNS resp: `%s'\n", buf));
271
272#if 0
273 if (!strncmp(buf, "nohost", 6))
274 ;
275 if (!strncmp(buf, "noauth", 6))
276 ;
277 if (!strncmp(buf, "notfqdn", 7))
278 ;
279 if (!strncmp(buf, "nochg", 5))
280 ;
281 if (!strncmp(buf, "good", 4))
282 ;
283 if (!strncmp(buf, "!yours", 6))
284 ;
285 if (!strncmp(buf, "abuse", 5))
286 ;
287 if (!strncmp(buf, "numhost", 7))
288 ;
289 if (!strncmp(buf, "dnserr", 6))
290 ;
291#endif
292 ARGSUSED (buf);
293 return (1);
294}
295
300static BOOL url_parse (struct URL *res, const char *url)
301{
302 char scheme [20+1];
303 char buf [256+1];
304 char *p;
305 const char *orig_url = url;
306 int num;
307
308 res->port = 80; /* default values */
309 res->host = NULL;
310 res->get_req = NULL;
311 res->on_heap = FALSE;
312
313 p = strstr (url, "://");
314 if (p)
315 {
316 _strlcpy (scheme, url, min(SIZEOF(scheme), p - url + 1));
317 if (stricmp(scheme, "http"))
318 {
319 TRACE (1, ("Unsupported scheme `%s'\n", scheme));
320 return (FALSE);
321 }
322 url = p + 3;
323 }
324
325 num = sscanf (url, "%256[^/]/%*s", buf);
326
327 p = strrchr (url, '/'); /* workaround for djgpp 2.04 sscanf() bug */
328 if (p && !*(p+1))
329 num = 1;
330
331 if (num >= 1)
332 {
333 p = strchr (buf, ':');
334 if (p)
335 {
336 res->port = atoi (p + 1);
337 *p = '\0';
338 }
339 res->host = strdup (buf);
340 res->on_heap = TRUE;
341 p = strchr (url, '/');
342
343 res->get_req = p ? strdup (p) : strdup ("/");
344 TRACE (2, ("url_parse: host `%s', port %u, req `%s'\r\n",
345 res->host, res->port, res->get_req));
346 return (TRUE);
347 }
348 TRACE (1, ("Malformed URL `%s'\r\n", orig_url));
349 ARGSUSED (orig_url);
350 return (FALSE);
351}
352
356static void url_free (struct URL *url)
357{
358 if (url->on_heap)
359 {
360 DO_FREE (url->get_req);
361 DO_FREE (url->host);
362 }
363 url->on_heap = FALSE;
364}
365
370static int chkip_method (const char *value)
371{
372 if (isaddr(value))
373 _strlcpy (dyn_myip, value, sizeof(dyn_myip));
374 else
375 {
376 url_free (&chkip);
377 url_parse (&chkip, value);
378 }
379 return (1);
380}
381
386static int dyndns_params (const char *value)
387{
388 url_free (&dyndns);
389 url_parse (&dyndns, value);
390 return (1);
391}
392
393/*
394 * Taken from:
395 *
396 * HTGET
397 *
398 * Get a document via HTTP
399 *
400 * This program was compiled under Borland C++ 3.1 in C mode for the small
401 * model. You will require the WATTCP libraries. A copy is included in the
402 * distribution. For the sources of WATTCP, ask archie where the archives
403 * are.
404 *
405 * Please send bug fixes, ports and enhancements to the author for
406 * incorporation in newer versions.
407 *
408 * Copyright (C) 1996 Ken Yap (ken@syd.dit.csiro.au)
409 *
410 * This program is free software; you can redistribute it and/or modify it
411 * under the terms of the Artistic License, a copy of which is included
412 * with this distribution.
413 *
414 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
415 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
416 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
417 */
418#define USER_AGENT "Watt-32/DynIP-client 0.5"
419#define AUTHOR "Copyright (C) 1996 Ken Yap (ken@syd.dit.csiro.au)"
420
421#define HTTPVER "HTTP/1.0" /* HTTP version to use */
422#define HTTPVER_10 "HTTP/1.0"
423#define HTTPVER_11 "HTTP/1.1"
424
425#define STARTS_WITH(s, what) (strnicmp (s, what, sizeof(what)-1) == 0)
426
427static int base64encode (const char *in, char *out, size_t out_len)
428{
429 int c1, c2, c3;
430 static char basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"\
431 "abcdefghijklmnopqrstuvwxyz0123456789+/";
432 while (*in)
433 {
434 c1 = *in++;
435 if (*in == '\0')
436 c2 = c3 = 0;
437 else
438 {
439 c2 = *in++;
440 if (*in == '\0')
441 c3 = 0;
442 else c3 = *in++;
443 }
444 out_len -= 4;
445 if (out_len <= 4)
446 return (-1);
447
448 *out++ = basis_64 [c1 >> 2];
449 *out++ = basis_64 [((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4)];
450 if (c2 == 0 && c3 == 0)
451 {
452 *out++ = '=';
453 *out++ = '=';
454 }
455 else if (c3 == 0)
456 {
457 *out++ = basis_64 [((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6)];
458 *out++ = '=';
459 }
460 else
461 {
462 *out++ = basis_64 [((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6)];
463 *out++ = basis_64 [c3 & 0x3F];
464 }
465 }
466 *out = '\0';
467 return (0);
468}
469
475static BOOL get_header (void *sock, long *cont_len_ptr)
476{
477 int len, response;
478 long content_length;
479 size_t i;
480 char buf [512];
481 char *s;
482
483 *cont_len_ptr = 0L;
484
485 len = sock_gets (sock, (BYTE*)buf, sizeof(buf));
486 if (len <= 0)
487 {
488 TRACE (1, ("EOF from server\n"));
489 return (FALSE);
490 }
491 TRACE (1, ("HTTP: `%.*s'\r\n", len, buf));
492
493 if (!STARTS_WITH(buf, HTTPVER_10) && /* no HTTP/1.[01]? */
494 !STARTS_WITH(buf, HTTPVER_11))
495 {
496 TRACE (1, ("Not a HTTP/1.[01] server\n"));
497 return (FALSE);
498 }
499
500 s = buf + sizeof(HTTPVER_10) - 1;
501 i = strspn (s, " \t");
502 if (i == 0) /* no whitespace? */
503 {
504 TRACE (1, ("Malformed HTTP/1.[01] line\n"));
505 return (FALSE);
506 }
507
508 s += i;
509 response = 500;
510 sscanf (s, "%3d", &response);
511 if (response == 401)
512 {
513 TRACE (1, ("Authorisation failed\n"));
514 return (FALSE);
515 }
516 if (response != 200 && response != 301 &&
517 response != 302 && response != 304)
518 {
519 TRACE (1, ("Unexpected response %s\n", s));
520 return (FALSE);
521 }
522
523 /* Eat up the other header lines here.
524 * Set to LONG_MAX, in case of no "Content-length" header.
525 */
526 content_length = LONG_MAX;
527
528 while ((len = sock_gets(sock, (BYTE*)buf, sizeof(buf))) > 0)
529 {
530 TRACE (1, ("HTTP: `%.*s'\r\n", len, buf));
531 s = buf;
532 if (STARTS_WITH(s, "Content-Length:"))
533 {
534 s += sizeof("Content-Length:") - 1;
535 content_length = atol (s);
536 }
537#if 0
538 else if (STARTS_WITH(s, "Transfer-encoding: chunked"))
539 {
540 TRACE (1, ("Chunked encoding not supported\n"));
541 return (FALSE);
542 }
543#endif
544 else if (STARTS_WITH(buf, "Location:"))
545 {
546 if (response == 301 || response == 302)
547 TRACE (1, ("Location at %s\n", buf));
548 }
549 else if (strchr(" \t", buf[0]))
550 TRACE (1, ("Warning: continuation line encountered\n"));
551 }
552 *cont_len_ptr = content_length;
553 return (TRUE);
554}
555
559static int get_url (const char *host, int port, const char *path,
560 const char *user_pass)
561{
562 DWORD addr;
563 int status = 0;
564 int length;
565 long content_length = 0L;
566 char req_buf [512], *p;
567 sock_type *sock;
568
569 if (!host)
570 {
571 TRACE (1, ("get_url: NULL host\n"));
572 return (-1);
573 }
574
575 addr = resolve (host);
576 if (!addr)
577 {
578 TRACE (1, ("%s\n", dom_strerror(dom_errno)));
579 return (-1);
580 }
581
582 sock = malloc (sizeof(*sock));
583 if (!sock)
584 {
585 puts ("get_url: No memory");
586 return (-1);
587 }
588
589 if (!tcp_open(&sock->tcp, 0, addr, port, NULL))
590 {
591 printf ("Cannot connect to `%s'\n", host);
592 free (sock);
593 return (-1);
594 }
595
596 length = 0;
597
598 sock_wait_established (sock, 10, NULL, &status);
599 if (!tcp_tick(sock)) /* in case they sent reset */
600 {
601 status = -1;
602 goto sock_err;
603 }
604
605 p = req_buf;
606 p += _SNPRINTF (BUF(req_buf),
607 "GET %s %s\r\n"
608 "Host: %s\r\n"
609 "User-Agent: %s\r\n",
610 path, HTTPVER, host, USER_AGENT);
611 if (user_pass)
612 {
613 char encoded_auth [256];
614
615 if (base64encode(user_pass, encoded_auth, sizeof(encoded_auth)) < 0)
616 goto sock_err;
617 p += sprintf (p, "Authorization: Basic %s\r\n", encoded_auth);
618 }
619
620 p += sprintf (p, "Connection: close\r\n\r\n");
621
622 TRACE (2, ("Sent: %s\n", req_buf));
623
624 sock_write (sock, (BYTE*)req_buf, (int)(p - req_buf));
625 sock_wait_input (sock, 10, NULL, &status);
626
627 if (get_header (sock, &content_length))
628 TRACE (2, ("Content-length %ld, remaining %u\n",
629 content_length, sock_dataready(sock)));
630
631 if (content_length >= 0L)
632 {
633 while (sock_dataready(sock) > 0)
634 {
635 int i = sock_gets (sock, (BYTE*)(resp_buf + length),
636 sizeof(resp_buf) - 1 - length);
637
638 TRACE (1, ("%s", resp_buf+length));
639 length += i;
640 if (length > SIZEOF(resp_buf))
641 {
642 length = SIZEOF(resp_buf);
643 break;
644 }
645 }
646 if (content_length != LONG_MAX && length != content_length)
647 TRACE (1, ("Warning, actual length = %d, content length = %ld\n",
648 length, content_length));
649 }
650
651sock_err:
652 sock_abort (sock); /* Kill 'sock' from the '_tcp_allsocs' list. */
653
654 if (status == -1)
655 TRACE (1, ("get_url(): %s, %s, ", host, sockerr(sock)));
656 TRACE (2, ("got %d bytes\n", length));
657 free (sock);
658 return (length);
659}
660#endif /* USE_DYNIP_CLI */
661
get_header
static BOOL get_header(void *sock, long *cont_len_ptr)
Receive and parse the HTTP header.
Definition: dynip.c:475
chkip_method
static int chkip_method(const char *value)
Select method of getting your public IP (WAN-side) address.
Definition: dynip.c:370
dyndns_params
static int dyndns_params(const char *value)
Extracts the host, port and request from the value.
Definition: dynip.c:386
get_url
static int get_url(const char *host, int port, const char *path, const char *user_pass)
Fetch a single URL optionally with authentication.
Definition: dynip.c:559
parse_dyndns_response
static int parse_dyndns_response(const char *buf)
Parse the status response from DynDNS.
Definition: dynip.c:268
url_free
static void url_free(struct URL *url)
Free the URL.
Definition: dynip.c:356
dynip_config
static void W32_CALL dynip_config(const char *name, const char *value)
Parser for DYNIP configuration.
Definition: dynip.c:92
dynip_exit
static void W32_CALL dynip_exit(void)
Free allocated memory.
Definition: dynip.c:114
parse_myip_address
static const char * parse_myip_address(const char *buf)
Parse response buffer and find the first IP-address.
Definition: dynip.c:216
url_parse
static BOOL url_parse(struct URL *res, const char *url)
Simple URL parser; accepts only "http://" prefixes (optional).
Definition: dynip.c:300
dynip.h
language.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
misc.h
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
aton
DWORD W32_CALL aton(const char *str)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
Definition: netaddr.c:86
isaddr
BOOL W32_CALL isaddr(const char *str)
Check if 'str' is simply an ip address.
Definition: netaddr.c:128
netaddr.h
netdb.h
pcbuf.h
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
pcconfig.h
dom_strerror
const char *W32_CALL dom_strerror(int err)
Return text for error code (dom_errno).
Definition: pcdns.c:742
resolve
DWORD W32_CALL resolve(const char *name)
Convert host name to an address.
Definition: pcdns.c:771
pcdns.h
tcp_open
int W32_CALL tcp_open(_tcp_Socket *s, WORD lport, DWORD ip, WORD rport, ProtoHandler handler)
Actively open a TCP connection.
Definition: pctcp.c:328
pctcp.h
sock_dataready
WORD W32_CALL sock_dataready(sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
Definition: sock_io.c:246
URL
Definition: dynip.c:52
config_table
Definition: tcp.h:461
ARG_STRCPY
@ ARG_STRCPY
copy string value
Definition: tcp.h:456
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/dynip.h Source File

  • src
dynip.h
Go to the documentation of this file.
1
3#ifndef _w32_DYNIP_H
4#define _w32_DYNIP_H
5
6#define dynip_init W32_NAMESPACE (dynip_init)
7#define dynip_exec W32_NAMESPACE (dynip_exec)
8
9void dynip_init (void);
10int dynip_exec (void);
11
12#endif


Watt-32 tcp/ip: E:/WATT/src/echo.c Source File

  • src
echo.c
Go to the documentation of this file.
1
7/*
8 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Gisle Vanem
21 * Bergen, Norway.
22 *
23 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
35
36#include <stdio.h>
37#include <stdlib.h>
38
39#include "wattcp.h"
40#include "pcconfig.h"
41#include "pctcp.h"
42#include "pcdbug.h"
43#include "misc.h"
44#include "misc_str.h"
45#include "run.h"
46#include "netaddr.h"
47#include "echo.h"
48
49#if defined(USE_ECHO_DISC)
50
51static _udp_Socket *udp_echo_sock, *udp_disc_sock;
52static _tcp_Socket *tcp_echo_sock, *tcp_disc_sock;
53
54static BOOL do_echo = 0;
55static WORD echo_port = 7;
56static DWORD echo_host = 0;
57
58static BOOL do_disc = 0;
59static WORD disc_port = 9;
60static DWORD disc_host = 0;
61
62static void (W32_CALL *prev_hook) (const char*, const char*) = NULL;
63
64static void W32_CALL echo_discard_daemon (void);
65
66static void W32_CALL udp_handler (sock_type *s, void *data, int len,
67 const tcp_PseudoHeader *ph,
68 const void *udp_hdr);
69
70/*
71 * Parse and match "echo.daemon = 0/1", "echo.port = <n>" etc.
72 */
73static void W32_CALL echo_config (const char *name, const char *value)
74{
75 static const struct config_table echo_cfg[] = {
76 { "DAEMON", ARG_ATOI, (void*)&do_echo },
77 { "HOST", ARG_RESOLVE, (void*)&echo_host },
78 { "PORT", ARG_ATOW, (void*)&echo_port },
79 { NULL, 0, NULL }
80 };
81 static const struct config_table disc_cfg[] = {
82 { "DAEMON", ARG_ATOI, (void*)&do_disc },
83 { "HOST", ARG_RESOLVE, (void*)&disc_host },
84 { "PORT", ARG_ATOW, (void*)&disc_port },
85 { NULL, 0, NULL }
86 };
87
88 if (!parse_config_table(&echo_cfg[0], "ECHO.", name, value) &&
89 !parse_config_table(&disc_cfg[0], "DISCARD.", name, value))
90 {
91 if (prev_hook)
92 (*prev_hook) (name, value);
93 }
94}
95
100static void W32_CALL echo_discard_exit (void)
101{
102 DAEMON_DEL (echo_discard_daemon);
103 if (udp_echo_sock)
104 free (udp_echo_sock);
105 if (tcp_echo_sock)
106 free (tcp_echo_sock);
107 if (udp_disc_sock)
108 free (udp_disc_sock);
109 if (tcp_disc_sock)
110 free (tcp_disc_sock);
111}
112
117void echo_discard_init (void)
118{
119 prev_hook = usr_init;
120 usr_init = echo_config;
121 udp_echo_sock = udp_disc_sock = NULL;
122 tcp_echo_sock = tcp_disc_sock = NULL;
123 RUNDOWN_ADD (echo_discard_exit, 258);
124}
125
135 W32_GCC_FUNC_TYPE_WARN_OFF()
136
137
140void echo_discard_start (void)
141{
142 if (do_echo)
143 {
144 udp_echo_sock = malloc (sizeof(*udp_echo_sock));
145#if !defined(USE_UDP_ONLY)
146 tcp_echo_sock = malloc (sizeof(*tcp_echo_sock));
147#endif
148 if (!udp_echo_sock && !tcp_echo_sock)
149 do_echo = FALSE;
150
151 if (udp_echo_sock)
152 {
153 udp_listen (udp_echo_sock, echo_port, echo_host, 0,
154 (ProtoHandler)udp_handler);
155 udp_echo_sock->sockmode &= ~SOCK_MODE_UDPCHK; /* no checksum testing */
156 }
157#if !defined(USE_UDP_ONLY)
158 if (tcp_echo_sock)
159 tcp_listen (tcp_echo_sock, echo_port, echo_host, 0, NULL, 0);
160#endif
161 }
162
163 if (do_disc)
164 {
165 udp_disc_sock = malloc (sizeof(*udp_disc_sock));
166#if !defined(USE_UDP_ONLY)
167 tcp_disc_sock = malloc (sizeof(*tcp_disc_sock));
168#endif
169 if (!udp_disc_sock && !tcp_disc_sock)
170 do_disc = FALSE;
171
172 if (udp_disc_sock)
173 {
174 udp_listen (udp_disc_sock, disc_port, disc_host, 0,
175 (ProtoHandler)udp_handler);
176 udp_disc_sock->sockmode &= ~SOCK_MODE_UDPCHK;
177 }
178#if !defined(USE_UDP_ONLY)
179 if (tcp_disc_sock)
180 tcp_listen (tcp_disc_sock, disc_port, disc_host, 0, NULL, 0);
181#endif
182 }
183
184 if (do_echo || do_disc)
185 DAEMON_ADD (echo_discard_daemon);
186}
187
188/*
189 * Restore warning '-Wcast-function-type'
190 */
191 W32_GCC_FUNC_TYPE_WARN_DEF()
192
193
194
198static void W32_CALL echo_discard_daemon (void)
199{
200 sock_type *s = (sock_type*) tcp_echo_sock;
201
202 if (!s || !tcp_disc_sock)
203 return;
204
205 if (sock_dataready(s)) /* only echo back from echo-socket */
206 {
207 BYTE buf[MAX_IP4_DATA-sizeof(tcp_Header)];
208 int len = sock_read (s, buf, sizeof(buf));
209 sock_write (s, buf, len);
210 }
211 tcp_disc_sock->rx_datalen = 0; /* discard recv data */
212}
213
217static void W32_CALL udp_handler (sock_type *s, void *data, int len,
218 const tcp_PseudoHeader *ph,
219 const void *udp)
220{
221 if (s == (sock_type*)udp_echo_sock)
222 {
223 TRACE_CONSOLE (2, "echo (udp): looping %d bytes from %s\n",
224 len, _inet_ntoa(NULL,intel(ph->src)));
225
226 if (!sock_enqueue(s, (const BYTE*)data, len))
227 sock_close (s);
228 }
229 else /* discard packet */
230 {
231 TRACE_CONSOLE (2, "discard (udp): dropping %d bytes from %s\n",
232 len, _inet_ntoa(NULL,intel(ph->src)));
233 }
234 ARGSUSED (ph);
235 ARGSUSED (udp);
236}
237#endif /* USE_ECHO_DISC */
238
239#if defined(TEST_PROG)
240int main (int argc, char **argv)
241{
244#if !defined(USE_ECHO_DISC)
245 puts ("This program needs '#define USE_ECHO_DISC'");
246#endif
247 ARGSUSED (argc);
248 ARGSUSED (argv);
249 return (0);
250}
251#endif /* TEST_PROG */
252
253
echo_discard_exit
static void W32_CALL echo_discard_exit(void)
Don't bother resetting any connections.
Definition: echo.c:100
W32_GCC_FUNC_TYPE_WARN_DEF
W32_GCC_FUNC_TYPE_WARN_DEF() static void W32_CALL echo_discard_daemon(void)
"background" process handling echo + discard TCP sockets.
Definition: echo.c:191
echo_discard_init
void echo_discard_init(void)
Called from watt_sock_init(): Setup config-file parser for "echo..." and "discard....
Definition: echo.c:117
W32_GCC_FUNC_TYPE_WARN_OFF
W32_GCC_FUNC_TYPE_WARN_OFF() void echo_discard_start(void)
Make gcc 8+ shut up about this warning: echo.c:143:19: warning: cast between incompatible function ty...
Definition: echo.c:135
udp_handler
static void W32_CALL udp_handler(sock_type *s, void *data, int len, const tcp_PseudoHeader *ph, const void *udp_hdr)
Callback handler for echo + discard UDP sockets.
Definition: echo.c:217
echo.h
misc.h
misc_str.h
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
pcconfig.h
pcdbug.h
tcp_listen
int W32_CALL tcp_listen(_tcp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler, WORD timeout)
Passively opens TCP a connection.
Definition: pctcp.c:407
udp_listen
int W32_CALL udp_listen(_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP passive open.
Definition: pctcp.c:190
pctcp.h
sock_dataready
WORD W32_CALL sock_dataready(sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
Definition: sock_io.c:246
config_table
Definition: tcp.h:461
tcp_Header
Definition: wattcp.h:418
tcp_PseudoHeader
Definition: wattcp.h:449
tcp_Socket
Definition: wattcp.h:584
ARG_RESOLVE
@ ARG_RESOLVE
resolve host to IPv4-address
Definition: tcp.h:457
ARG_ATOW
@ ARG_ATOW
convert to 16-bit word
Definition: tcp.h:450
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/echo.h Source File

  • src
echo.h
Go to the documentation of this file.
1
3#ifndef _w32_ECHO_DISCARD_H
4#define _w32_ECHO_DISCARD_H
5
6extern void echo_discard_init (void);
7extern void echo_discard_start (void);
8
9#endif
echo_discard_init
void echo_discard_init(void)
Called from watt_sock_init(): Setup config-file parser for "echo..." and "discard....
Definition: echo.c:117


Watt-32 tcp/ip: E:/WATT/inc/err.h Source File

  • inc
err.h
Go to the documentation of this file.
1
5#ifndef __SYS_WERRNO_H
6#include <sys/werrno.h>
7#endif
8
werrno.h


Watt-32 tcp/ip: E:/WATT/inc/sys/errno.h Source File

  • inc
  • sys
errno.h
Go to the documentation of this file.
1
6/*
7 * The naming <sys/w??.h> is required for those compilers that
8 * have <sys/??.h> in the usual place but doesn't define stuff
9 * related to Watt-32's BSD-socket interface.
10 */
11
12#ifndef __SYS_WERRNO_H
13#include <sys/werrno.h>
14#endif
15
16/*
17 * This file shadows CygWin's or Orange-C's <sys/errno.h>. This hack pulls
18 * in the default <sys/errno.h>
19 */
20#if defined(__CYGWIN__) || defined(__ORANGEC__)
21#include_next <sys/errno.h>
22#endif
23
werrno.h


Watt-32 tcp/ip: E:/WATT/inc/netinet6/esp6.h Source File

  • inc
  • netinet6
esp6.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * RFC1827/2406 Encapsulated Security Payload.
35 */
36
37#ifndef _NETINET6_ESP6_H_
38#define _NETINET6_ESP6_H_
39
40#ifndef __SYS_MBUF_H
41#include <sys/mbuf.h>
42#endif
43
44#ifdef _KERNEL
45extern int esp6_output (struct mbuf *, u_char *, struct mbuf *, struct ipsecrequest *);
46extern int esp6_input (struct mbuf **, int *, int);
47
48extern void esp6_ctlinput (int, struct sockaddr *, void *);
49#endif /*_KERNEL*/
50
51#endif /*_NETINET6_ESP6_H_*/
ipsecrequest
Definition: ipsec.h:102
mbuf
Definition: mbuf.h:6
sockaddr
Definition: socket.h:181


Watt-32 tcp/ip: E:/WATT/inc/netinet6/esp.h Source File

  • inc
  • netinet6
esp.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * RFC1827/2406 Encapsulated Security Payload.
35 */
36
37#ifndef _NETINET6_ESP_H_
38#define _NETINET6_ESP_H_
39
40#if defined(_KERNEL) && !defined(_LKM)
41#include "opt_inet.h"
42#endif
43
44struct esp {
45 u_int32_t esp_spi; /* ESP */
46 /* variable size, 32bit bound *//* Initialization Vector */
47 /* variable size */ /* Payload data */
48 /* variable size */ /* padding */
49 /* 8bit */ /* pad size */
50 /* 8bit */ /* next header */
51 /* 8bit */ /* next header */
52 /* variable size, 32bit bound */ /* Authentication data (new IPsec) */
53 };
54
55struct newesp {
56 u_int32_t esp_spi; /* ESP */
57 u_int32_t esp_seq; /* Sequence number */
58 /* variable size */ /* (IV and) Payload data */
59 /* variable size */ /* padding */
60 /* 8bit */ /* pad size */
61 /* 8bit */ /* next header */
62 /* 8bit */ /* next header */
63 /* variable size, 32bit bound *//* Authentication data */
64 };
65
66struct esptail {
67 u_int8_t esp_padlen; /* pad length */
68 u_int8_t esp_nxt; /* Next header */
69 /* variable size, 32bit bound *//* Authentication data (new IPsec)*/
70 };
71
72#ifdef _KERNEL
73struct mbuf;
74struct secasvar;
75
76struct esp_algorithm {
77 size_t padbound; /* pad boundary, in byte */
78 int ivlenval; /* iv length, in byte */
79 int (*mature) (struct secasvar *);
80 int keymin; /* in bits */
81 int keymax; /* in bits */
82 int (*schedlen) (const struct esp_algorithm *);
83 const char *name;
84 int (*ivlen) (const struct esp_algorithm *, struct secasvar *);
85 int (*decrypt) (struct mbuf *, size_t,
86 struct secasvar *, const struct esp_algorithm *, int);
87 int (*encrypt) (struct mbuf *, size_t, size_t,
88 struct secasvar *, const struct esp_algorithm *, int);
89 /* not supposed to be called directly */
90 int (*schedule) (const struct esp_algorithm *, struct secasvar *);
91 int (*blockdecrypt) (const struct esp_algorithm *,
92 struct secasvar *, u_int8_t *, u_int8_t *);
93 int (*blockencrypt) (const struct esp_algorithm *,
94 struct secasvar *, u_int8_t *, u_int8_t *);
95 };
96
97extern const struct esp_algorithm *esp_algorithm_lookup (int);
98extern int esp_max_ivlen (void);
99
100/* crypt routines */
101extern int esp4_output (struct mbuf *, struct ipsecrequest *);
102extern void esp4_input (struct mbuf *, int);
103extern size_t esp_hdrsiz (struct ipsecrequest *);
104
105extern int esp_schedule (const struct esp_algorithm *, struct secasvar *);
106extern int esp_auth (struct mbuf *, size_t, size_t,
107 struct secasvar *, u_char *);
108#endif /* _KERNEL */
109
110#endif /* _NETINET6_ESP_H_ */
esp_algorithm
Definition: esp.h:76
esp
Definition: esp.h:44
esptail
Definition: esp.h:66
ipsecrequest
Definition: ipsec.h:102
mbuf
Definition: mbuf.h:6
newesp
Definition: esp.h:55


Watt-32 tcp/ip: E:/WATT/inc/netinet6/esp_rijn.h Source File

  • inc
  • netinet6
esp_rijn.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32#ifndef _NETINET_ESP_RIJN_H_
33#define _NETINET_ESP_RIJN_H_
34
35int esp_rijndael_schedlen (const struct esp_algorithm *);
36int esp_rijndael_schedule (const struct esp_algorithm *, struct secasvar *);
37int esp_rijndael_blockdecrypt (const struct esp_algorithm *, struct secasvar *, u_int8_t *, u_int8_t *);
38int esp_rijndael_blockencrypt (const struct esp_algorithm *, struct secasvar *, u_int8_t *, u_int8_t *);
39
40#endif
esp_algorithm
Definition: esp.h:76


Watt-32 tcp/ip: E:/WATT/inc/net/ethertyp.h Source File

  • inc
  • net
ethertyp.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38/*
39 * Ethernet protocol types.
40 *
41 * According to "assigned numbers", the Ethernet protocol numbers are also
42 * used as ARP protocol type numbers.
43 *
44 * I factor them out here to avoid pulling all the Ethernet header file
45 * into the hardware independent ARP code. -is
46 */
47
48#ifndef __NET_ETHERTYPE_H
49#define __NET_ETHERTYPE_H
50
51#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
52#define ETHERTYPE_IP 0x0800 /* IP protocol */
53#define ETHERTYPE_ARP 0x0806 /* address resolution protocol */
54#define ETHERTYPE_REVARP 0x8035 /* reverse addr resolution protocol */
55
56/*
57 * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
58 * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
59 * by an ETHER type (as given above) and then the (variable-length) header.
60 */
61#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
62#define ETHERTYPE_NTRAILER 16
63
64#endif


Watt-32 tcp/ip: E:/WATT/src/fcntl.c Source File

  • src
fcntl.c
Go to the documentation of this file.
1
5/*
6 * BSD sockets functionality for Watt-32 TCP/IP
7 *
8 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Gisle Vanem
21 * Bergen, Norway.
22 *
23 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 * Version
35 *
36 * 0.5 : 19 Aug 1999 : by Claus Oberste-Brandenburg
37 * <Claus.OBERSTE-BRANDENBURG@jacala.ensmp.fr>
38 *
39 * 0.6 : 19 Aug 1999 : Changed function prototype, added fd_duped (GV)
40 */
41
42#include "socket.h"
43
44#if defined(USE_BSD_API)
45
46#ifndef O_NONBLOCK
47#define O_NONBLOCK 0x2000
48#endif
49
50#if defined(USE_DEBUG)
51/*
52 * Return string for fcntlsocket() command
53 */
54static const struct search_list commands[] = {
55 { F_DUPFD, "F_DUPFD" },
56 { F_GETFL, "F_GETFL" },
57 { F_SETFL, "F_SETFL" },
58 { F_GETFD, "F_GETFD" },
59 { F_SETFD, "F_SETFD" },
60 { F_GETLK, "F_GETLK" },
61 { F_SETLK, "F_SETLK" },
62 { F_SETLKW, "F_SETLKW" },
63 { F_GETOWN, "F_GETOWN" },
64 { F_SETOWN, "F_SETOWN" }
65 };
66#endif /* USE_DEBUG */
67
68
69int MS_CDECL fcntlsocket (int s, int cmd, ...)
70{
71 Socket *socket = _socklist_find (s);
72 size_t arg; /* same size as a pointer */
73 int rc = 0;
74 va_list va;
75
76 va_start (va, cmd);
77 arg = va_arg (va, size_t);
78
79 SOCK_PROLOGUE (socket, "\nfcntlsocket:%d, ", s);
80
81 SOCK_DEBUGF ((", %s: ", list_lookup(cmd,commands,DIM(commands))));
82
83 /* fcntl is always file-ioctrl
84 */
85 switch (cmd)
86 {
87 case F_DUPFD:
88 socket->fd_duped++;
89 SOCK_DEBUGF (("dup %d", socket->fd_duped));
90 return (0);
91
92 case F_GETFL:
95 if (socket->so_state & SS_NBIO)
96 {
97 SOCK_DEBUGF (("non-blocking"));
98 return (O_NONBLOCK);
99 }
100 SOCK_DEBUGF (("blocking"));
101 return (0);
102
103 case F_SETFL:
104 if (arg & O_NONBLOCK) /* O_APPEND will not be served */
105 {
106 SOCK_DEBUGF (("non-blocking"));
107 socket->so_state |= SS_NBIO;
108 socket->timeout = 0;
109 if (socket->tcp_sock)
110 socket->tcp_sock->timeout = 0;
111 }
112 else
113 {
114 SOCK_DEBUGF (("blocking"));
115 socket->so_state &= ~SS_NBIO;
116 socket->timeout = sock_delay;
117 }
118 return (0);
119
120 case F_GETFD:
121 return (0); /* socket remains open across exec() */
122
123 case F_SETFD:
124 case F_GETLK:
125 case F_SETLK:
126 case F_SETLKW:
127 case F_GETOWN:
128 case F_SETOWN:
129 SOCK_DEBUGF (("not supported"));
130 SOCK_ERRNO (ESOCKTNOSUPPORT);
131 rc = -1;
132 break;
133
134 default:
135 SOCK_ENTER_SCOPE();
136 if (ioctlsocket(s, cmd, (char*)arg) < 0)
137 {
138 SOCK_DEBUGF ((", unknown cmd %d", cmd));
139 SOCK_ERRNO (ESOCKTNOSUPPORT);
140 rc = -1;
141 }
142 SOCK_LEAVE_SCOPE();
143 }
144 return (rc);
145}
146#endif /* USE_BSD_API */
147
fcntlsocket
int MS_CDECL fcntlsocket(int s, int cmd,...)
Definition: fcntl.c:69
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
Socket
Definition: socket.h:158
search_list
Definition: misc.h:131
socket
Definition: if.h:82


Watt-32 tcp/ip: E:/WATT/src/fsext.c Source File

  • src
fsext.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Jan 21, 1998 : G. Vanem - created
36 * 0.6 : Apr 28, 2003 : G. Vanem - updates for djgpp 2.04
37 */
38
39#include "socket.h"
40
41#if defined(__DJGPP__) && defined(USE_BSD_API) && defined(USE_FSEXT)
42
43#include <sys/fsext.h>
44#include <sys/stat.h>
45#include <fcntl.h>
46#include <unistd.h>
47
48#ifndef S_IFSOCK
49#define S_IFSOCK 0x10000
50#endif
51
52#if (DJGPP_MINOR < 4)
53#define blksize_t off_t
54#endif
55
56struct wstat {
57 time_t st_atime;
58 time_t st_ctime;
59 dev_t st_dev;
60 gid_t st_gid;
61 ino_t st_ino;
62 mode_t st_mode;
63 time_t st_mtime;
64 nlink_t st_nlink;
65 off_t st_size;
66 blksize_t st_blksize;
67 uid_t st_uid;
68 dev_t st_rdev;
69 };
70
71
72#if defined(USE_DEBUG)
73/*
74 * Handle printing of function names
75 */
76static const struct search_list fs_func[] = {
77 { __FSEXT_nop, "nop" },
78 { __FSEXT_open, "open" },
79 { __FSEXT_creat, "creat" },
80 { __FSEXT_read, "read" },
81 { __FSEXT_write, "write" },
82 { __FSEXT_ready, "ready" },
83 { __FSEXT_close, "close" },
84 { __FSEXT_fcntl, "fcntl" },
85 { __FSEXT_ioctl, "ioctl" },
86 { __FSEXT_lseek, "lseek" },
87 { __FSEXT_link, "link" },
88 { __FSEXT_unlink,"unlink" },
89#if (DJGPP_MINOR >= 2)
90 { __FSEXT_dup, "dup" },
91 { __FSEXT_dup2, "dup2" },
92 { __FSEXT_fstat, "fstat" },
93 { __FSEXT_stat, "stat" },
94#endif
95#if (DJGPP_MINOR >= 4)
96 { __FSEXT_llseek, "llseek" },
97 { __FSEXT_readlink,"readlink" },
98 { __FSEXT_symlink, "symlink" },
99 { __FSEXT_fchown, "fchown" },
100 { __FSEXT_chmod, "chmod", },
101 { __FSEXT_chown, "chown", },
102 { __FSEXT_fchmod, "fchmod" }
103#endif
104 };
105#endif /* USE_DEBUG */
106
107/*
108 * Filesystem extensions for BSD-sockets and djgpp 2.x
109 */
110int _fsext_demux (__FSEXT_Fnumber func, int *rv, va_list _args)
111{
112 int fd = va_arg (_args, int);
113 int cmd = va_arg (_args, int);
114 int arg = va_arg (_args, int);
115 Socket *sock = __FSEXT_get_data (fd); /* same as _socklist_find(fd) */
116
117 SOCK_DEBUGF (("\n_fsext_demux: fd %d%c, func %d = \"%s\", cmd %08lX, arg %08lX",
118 fd, sock ? 's' : 'f', func,
119 list_lookup(func, fs_func, DIM(fs_func)),
120 (DWORD)cmd, (DWORD)arg));
121
122 /* fd is not a valid socket, pass on to lower layer
123 */
124 if (!sock)
125 return (0);
126
127 switch (func)
128 {
129 case __FSEXT_read: /* read (fd,&buf,len) */
130 *rv = read_s (fd, (char*)cmd, arg);
131 return (1);
132
133 case __FSEXT_write: /* write (fd,&buf,len) */
134 *rv = write_s (fd, (char*)cmd, arg);
135 return (1);
136
137 case __FSEXT_close: /* close (fd) */
138 if (sock->fd_duped == 0)
139 *rv = close_s (fd);
140 else
141 {
142 sock->fd_duped--;
143 *rv = 0;
144 }
145 return (1);
146
147 case __FSEXT_ioctl: /* ioctl (fd,cmd,...) */
148 *rv = ioctlsocket (fd, cmd, (char*)arg);
149 return (1);
150
151 case __FSEXT_fcntl: /* 'fcntl (fd,cmd)' or 'fcntl (fd,cmd,arg)' */
152 *rv = fcntlsocket (fd, cmd, (long)arg);
153 return (1);
154
155 case __FSEXT_ready: /* ready (fd) called from select() */
156 *rv = _fsext_ready (fd);
157 return (1);
158
159 case __FSEXT_creat:
160 return (0);
161
162#if (DJGPP_MINOR >= 2) /* functions added in v2.02 */
163 case __FSEXT_dup: /* dup (fd) */
164 *rv = fd;
165 if (sock->fd_duped < UINT_MAX)
166 sock->fd_duped++;
167 return (1);
168
169 case __FSEXT_dup2: /* dup2 (oldfd,newfd) */
170 close (cmd); /* close (newd) */
171 *rv = socket (sock->so_family, sock->so_type, sock->so_proto);
172 return (1);
173
174 case __FSEXT_fstat:
175#if defined(USE_STATISTICS)
176 {
177 struct wstat *stat = (struct wstat*) cmd;
178 int size;
179
180 *rv = 0;
181 stat->st_mode = S_IFSOCK;
182
183 /* Hmm. If user really want this, lets return it */
184 switch (sock->so_proto)
185 {
186 case IPPROTO_TCP:
187 size = min (sizeof(tcpstats), sizeof(struct stat));
188 memcpy (rv, &tcpstats, size);
189 break;
190 case IPPROTO_UDP:
191 size = min (sizeof(udpstats), sizeof(struct stat));
192 memcpy (rv, &udpstats, size);
193 break;
194 case IPPROTO_ICMP:
195 size = min (sizeof(icmpstats), sizeof(struct stat));
196 memcpy (rv, &icmpstats, size);
197 break;
198 case IPPROTO_IGMP:
199 size = min (sizeof(igmpstats), sizeof(struct stat));
200 memcpy (rv, &igmpstats, size);
201 break;
202 case IPPROTO_IP:
203 size = min (sizeof(ip4stats), sizeof(struct stat));
204 memcpy (rv, &ip4stats, size);
205 break;
206#if defined(IPPROTO_IP6)
207 case IPPROTO_IP6:
208 size = min (sizeof(ip6stats), sizeof(struct stat));
209 memcpy (rv, &ip6stats, size);
210 break;
211#endif
212 default:
213 *rv = -1;
214 }
215 }
216 return (1);
217#else
218 return (0);
219#endif /* USE_STATISTICS */
220
221#endif /* DJGPP_MINOR >= 2 */
222
223 default:
224 SOCK_DEBUGF ((" unhandled FSext function"));
225 break;
226 }
227 return (0); /* unhandled, pass on to lower layer */
228}
229
230#endif /* __DJGPP__ && USE_BSD_API && USE_FSEXT */
231
fcntlsocket
int MS_CDECL fcntlsocket(int s, int cmd,...)
Definition: fcntl.c:69
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
Socket
Definition: socket.h:158
search_list
Definition: misc.h:131
socket
Definition: if.h:82
wstat
Definition: fsext.c:56


Watt-32 tcp/ip: E:/WATT/inc/arpa/ftp.h Source File

  • inc
  • arpa
ftp.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1983, 1989 Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __ARPA_FTP_H
39#define __ARPA_FTP_H
40
41/* Definitions for FTP; see RFC-765. */
42
43/*
44 * Reply codes.
45 */
46#define PRELIM 1 /* positive preliminary */
47#define COMPLETE 2 /* positive completion */
48#define CONTINUE 3 /* positive intermediate */
49#define TRANSIENT 4 /* transient negative completion */
50#undef ERROR /* <wingdi.h> */
51#define ERROR 5 /* permanent negative completion */
52
53/*
54 * Type codes
55 */
56#define TYPE_A 1 /* ASCII */
57#define TYPE_E 2 /* EBCDIC */
58#define TYPE_I 3 /* image */
59#define TYPE_L 4 /* local byte size */
60
61#ifdef FTP_NAMES
62const char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
63#endif
64
65/*
66 * Form codes
67 */
68#define FORM_N 1 /* non-print */
69#define FORM_T 2 /* telnet format effectors */
70#define FORM_C 3 /* carriage control (ASA) */
71#ifdef FTP_NAMES
72const char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
73#endif
74
75/*
76 * Structure codes
77 */
78#define STRU_F 1 /* file (no record structure) */
79#define STRU_R 2 /* record structure */
80#define STRU_P 3 /* page structure */
81#ifdef FTP_NAMES
82const char *strunames[] = {"0", "File", "Record", "Page" };
83#endif
84
85/*
86 * Mode types
87 */
88#define MODE_S 1 /* stream */
89#define MODE_B 2 /* block */
90#define MODE_C 3 /* compressed */
91#ifdef FTP_NAMES
92const char *modenames[] = {"0", "Stream", "Block", "Compressed" };
93#endif
94
95/*
96 * Protection levels
97 */
98#define PROT_C 1 /* clear */
99#define PROT_S 2 /* safe */
100#define PROT_P 3 /* private */
101#define PROT_E 4 /* confidential */
102
103#ifdef FTP_NAMES
104const char *levelnames[] = {"0", "Clear", "Safe", "Private", "Confidential" };
105#endif
106
107#if defined(KERBEROS) && defined(NOENCRYPTION)
108 /* Define away krb_rd_priv and krb_mk_priv. Don't need them anyway.
109 * This might not be the best place for this ...
110 */
111 #define krb_rd_priv(o,l,ses,s,h,c,m) krb_rd_safe(o,l,s,h,c,m)
112 #define krb_mk_priv(i,o,l,ses,s,h,c) krb_mk_safe(i,o,l,s,h,c)
113#endif
114
115/*
116 * Record Tokens
117 */
118#define REC_ESC '\377' /* Record-mode Escape */
119#define REC_EOR '\001' /* Record-mode End-of-Record */
120#define REC_EOF '\002' /* Record-mode End-of-File */
121
122/*
123 * Block Header
124 */
125#define BLK_EOR 0x80 /* Block is End-of-Record */
126#define BLK_EOF 0x40 /* Block is End-of-File */
127#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
128#define BLK_RESTART 0x10 /* Block is Restart Marker */
129
130#define BLK_BYTECOUNT 2 /* Bytes in this block */
131
132#endif


Watt-32 tcp/ip: E:/WATT/src/get_ai.c Source File

  • src
get_ai.c
Go to the documentation of this file.
1
5/* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * "FAITH" part is local hack for supporting IPv4-v6 translator.
35 *
36 * Issues to be discussed:
37 * - Thread safe-ness must be checked.
38 * - Return values. There are nonstandard return values defined and used
39 * in the source code. This is because RFC2553 is silent about which error
40 * code must be returned for which situation.
41 * Note:
42 * - The code filters out AFs that are not supported by the kernel,
43 * when globbing NULL hostname (to loopback, or wildcard). Is it the right
44 * thing to do? What is the relationship with post-RFC2553 AI_ADDRCONFIG
45 * in ai_flags?
46 *
47 * Adapted for Watt-32 tcp/ip stack by G. Vanem <gvanem@yahoo.no>, Aug 2002.
48 */
49
50#include "socket.h"
51#include "pcdns.h"
52
53#if defined(USE_BSD_API)
54
55#define ANY 0
56#define YES 1
57#define NO 0
58#define PTON_MAX 16
59
60/* Addresss family descriptor
61 */
62struct afd {
63 int a_af;
64 int a_addrlen;
65 int a_socklen;
66 int a_off;
67 const char *a_addrany;
68 const char *a_loopback;
69 int a_scoped;
70 };
71
72struct explore {
73 int e_af;
74 int e_socktype;
75 int e_protocol;
76 const char *e_protostr;
77 int e_wild;
78#define WILD_AF(ex) ((ex)->e_wild & 0x01)
79#define WILD_SOCKTYPE(ex) ((ex)->e_wild & 0x02)
80#define WILD_PROTOCOL(ex) ((ex)->e_wild & 0x04)
81 };
82
83static struct explore explore[] = {
84 { AF_INET6, SOCK_DGRAM, IPPROTO_UDP, "udp", 7 },
85 { AF_INET6, SOCK_STREAM, IPPROTO_TCP, "tcp", 7 },
86 { AF_INET6, SOCK_RAW, ANY, NULL, 5 },
87 { AF_INET, SOCK_DGRAM, IPPROTO_UDP, "udp", 7 },
88 { AF_INET, SOCK_STREAM, IPPROTO_TCP, "tcp", 7 },
89 { AF_INET, SOCK_RAW, ANY, NULL, 5 },
90 { -1, 0, 0, NULL, 0 }
91 };
92
93BOOL called_from_getai = FALSE;
94
95static struct afd afd_list [3];
96
97static int str_isnumber (const char *);
98static int explore_fqdn (const struct addrinfo *, const char *, const char *,
99 struct addrinfo **res);
100
101static int explore_null (const struct addrinfo *, const char *,
102 struct addrinfo **);
103
104static int explore_numeric (const struct addrinfo *, const char *, const char *,
105 struct addrinfo **);
106
107static int explore_numeric_scope (const struct addrinfo *, const char *,
108 const char *, struct addrinfo **);
109
110static int get_name (const char *, const struct afd *, struct addrinfo **,
111 char *, const struct addrinfo *, const char *);
112
113static int get_canonname (const struct addrinfo *, struct addrinfo *,
114 const char *);
115
116static struct addrinfo *get_ai (const struct addrinfo *, const struct afd *,
117 const char *);
118
119static int get_portmatch (const struct addrinfo *, const char *);
120static int get_port (struct addrinfo *, const char *, int);
121static const struct afd *find_afd (int);
122
123static const char *ai_errlist [] = {
124 "Success",
125 "Address family for hostname not supported", /* EAI_ADDRFAMILY */
126 "Temporary failure in name resolution", /* EAI_AGAIN */
127 "Invalid value for ai_flags", /* EAI_BADFLAGS */
128 "Non-recoverable failure in name resolution", /* EAI_FAIL */
129 "ai_family not supported", /* EAI_FAMILY */
130 "Memory allocation failure", /* EAI_MEMORY */
131 "No address associated with hostname", /* EAI_NODATA */
132 "hostname nor servname provided, or not known", /* EAI_NONAME */
133 "servname not supported for ai_socktype", /* EAI_SERVICE */
134 "ai_socktype not supported", /* EAI_SOCKTYPE */
135 "System error returned in errno", /* EAI_SYSTEM */
136 "Invalid value for hints", /* EAI_BADHINTS */
137 "Resolved protocol is unknown", /* EAI_PROTOCOL */
138 "Unknown error", /* EAI_MAX */
139};
140
141/* XXX macros that make external reference is BAD. */
142
143#define GET_AI(ai, afd, addr) do { \
144 /* external reference: pai, error and free_it */ \
145 (ai) = get_ai (pai, (afd), (const char*) (addr)); \
146 if ((ai) == NULL) { \
147 error = EAI_MEMORY; \
148 goto free_it; \
149 } \
150 } while (0)
151
152#define GET_PORT(ai, serv) do { \
153 /* external reference: error and free_it */ \
154 error = get_port ((ai), (serv), 0); \
155 if (error != 0) \
156 goto free_it; \
157 } while (0)
158
159#define GET_CANONNAME(ai, str) do { \
160 /* external reference: pai, error and free_it */ \
161 error = get_canonname (pai, (ai), (str)); \
162 if (error != 0) \
163 goto free_it; \
164 } while (0)
165
166#define ERR(err) do { \
167 /* external reference: error, and label bad */ \
168 error = (err); \
169 goto bad; \
170 } while (0)
171
172#define MATCH_FAMILY(x, y, w) \
173 ((x) == (y) || ((w) && ((x) == AF_UNSPEC || (y) == AF_UNSPEC)))
174
175#define MATCH(x, y, w) \
176 ((x) == (y) || ((w) && ((x) == ANY || (y) == ANY)))
177
178char * W32_CALL gai_strerror (int ecode)
179{
180 if (ecode < 0 || ecode > EAI_MAX)
181 ecode = EAI_MAX;
182 return (char*) ai_errlist [ecode];
183}
184
185/*
186 * We only have 1 interface.
187 * Size of 'if_name' must be >= IF_NAMESIZE.
188 * Assume __get_ifname() returns name with trailing digit.
189 */
190int W32_CALL if_nametoindex (const char *if_name)
191{
192 char name [IF_NAMESIZE];
193 char id;
194
195 __get_ifname (name);
196 id = name [strlen(name)] - '0';
197 if (!stricmp(if_name, name))
198 return (id+1);
199 return (0);
200}
201
202char * W32_CALL if_indextoname (int if_id, char *if_name)
203{
204 char name [IF_NAMESIZE];
205 int id;
206
207 __get_ifname (name);
208 id = name [strlen(name)] - '0';
209 if (if_id != id+1)
210 {
211 SOCK_ERRNO (ENXIO);
212 return (NULL);
213 }
214 return strcpy (if_name, name);
215}
216
217int __scope_ascii_to_id (const char *str)
218{
219 if (!isdigit((int)*str))
220 return (0);
221 return (*str - '0');
222}
223
224int __scope_id_to_ascii (int scope)
225{
226 scope += '0';
227 if (!isdigit(scope))
228 return (0);
229 return (scope);
230}
231
232static void free_addrinfo (struct addrinfo *ai)
233{
234 struct addrinfo *next;
235
236 for ( ; ai; ai = next)
237 {
238 next = ai->ai_next;
239 if (ai->ai_canonname)
240 free (ai->ai_canonname);
241 free (ai);
242 }
243}
244
245void W32_CALL freeaddrinfo (struct addrinfo *ai)
246{
247 SOCK_DEBUGF (("\nfreeaddrinfo: 0x%" ADDR_FMT, ADDR_CAST(ai)));
248 free_addrinfo (ai);
249}
250
251static int str_isnumber (const char *p)
252{
253 char *q = (char *) p;
254
255 while (*q)
256 {
257 if (!isdigit((int)*q))
258 return (NO);
259 q++;
260 }
261 return (YES);
262}
263
268static void afd_list_init (BOOL ip6_prio)
269{
270 static const char in4addr_loopback[] = { 127, 0, 0, 1 };
271 static const char in4addr_addrany[] = { 0, 0, 0, 0 };
272#if !defined(USE_IPV6)
273 static const struct in6_addr in6addr_loopback = {{ 0, 0, 0, 0, 0, 0, 0, 0,
274 0, 0, 0, 0, 0, 0, 0, 1 }};
275 static const struct in6_addr in6addr_any = {{ 0, 0, 0, 0, 0, 0, 0, 0,
276 0, 0, 0, 0, 0, 0, 0, 0 }};
277#endif
278
279 int i = (ip6_prio ? 0 : 1);
280
281 memset (&afd_list, 0, sizeof(afd_list));
282
283 afd_list[i].a_af = AF_INET6;
284 afd_list[i].a_addrlen = sizeof (struct in6_addr);
285 afd_list[i].a_socklen = sizeof (struct sockaddr_in6);
286 afd_list[i].a_off = offsetof (struct sockaddr_in6, sin6_addr);
287 afd_list[i].a_addrany = (const char*) &in6addr_any;
288 afd_list[i].a_loopback = (const char*) &in6addr_loopback;
289 afd_list[i].a_scoped = 1;
290
291 i ^= 1;
292 afd_list[i].a_af = AF_INET;
293 afd_list[i].a_addrlen = sizeof (struct in_addr);
294 afd_list[i].a_socklen = sizeof (struct sockaddr_in);
295 afd_list[i].a_off = offsetof (struct sockaddr_in, sin_addr);
296 afd_list[i].a_addrany = in4addr_addrany;
297 afd_list[i].a_loopback = in4addr_loopback;
298 afd_list[i].a_scoped = 0;
299
300 if (!ip6_prio)
301 {
302 explore[0].e_af = explore[1].e_af = explore[2].e_af = AF_INET;
303 explore[3].e_af = explore[4].e_af = explore[5].e_af = AF_INET6;
304 }
305}
306
307int W32_CALL getaddrinfo (const char *_hostname, const char *_servname,
308 const struct addrinfo *hints, struct addrinfo **res)
309{
310 static BOOL init = FALSE;
311 struct addrinfo *cur, *pai, ai, ai0, sentinel;
312 const struct afd *afd;
313 const struct explore *ex;
314 int error = 0;
315
316 if (!init)
317 afd_list_init (TRUE); /* Give IPv6 highest priority */
318 init = TRUE;
319
320 sentinel.ai_next = NULL;
321 cur = &sentinel;
322 pai = &ai;
323 pai->ai_flags = 0;
324 pai->ai_family = AF_UNSPEC;
325 pai->ai_socktype = ANY;
326 pai->ai_protocol = ANY;
327 pai->ai_addrlen = 0;
328 pai->ai_canonname = NULL;
329 pai->ai_addr = NULL;
330 pai->ai_next = NULL;
331
332 SOCK_DEBUGF (("\ngetaddrinfo: `%s', `%s'",
333 _hostname, _servname));
334
335 if (!_hostname && !_servname)
336 ERR (EAI_NONAME);
337
338 if (hints)
339 {
340 /* error check for hints */
341 if (hints->ai_addrlen || hints->ai_canonname ||
342 hints->ai_addr || hints->ai_next)
343 ERR (EAI_BADHINTS); /* xxx */
344
345 if (hints->ai_flags & ~AI_MASK)
346 ERR (EAI_BADFLAGS);
347
348 switch (hints->ai_family)
349 {
350 case AF_UNSPEC:
351 case AF_INET:
352 case AF_INET6:
353 break;
354 default:
355 ERR (EAI_FAMILY);
356 }
357 *pai = *hints;
358
359 /* if both socktype/protocol are specified, check if they
360 * are meaningful combination.
361 */
362 if (pai->ai_socktype != ANY && pai->ai_protocol != ANY)
363 {
364 for (ex = explore; ex->e_af >= 0; ex++)
365 {
366 if (pai->ai_family != ex->e_af ||
367 ex->e_socktype == ANY ||
368 ex->e_protocol == ANY)
369 continue;
370
371 if (pai->ai_socktype == ex->e_socktype &&
372 pai->ai_protocol != ex->e_protocol)
373 ERR (EAI_BADHINTS);
374 }
375 }
376 }
377
378 /* Check for special cases:
379 * (1) numeric _servname is disallowed if socktype/protocol are left
380 * unspecified.
381 * (2) _servname is disallowed for raw and other inet{,6} sockets.
382 */
383 if (MATCH_FAMILY(pai->ai_family, AF_INET, 1) ||
384 MATCH_FAMILY(pai->ai_family, AF_INET6, 1))
385 {
386 ai0 = *pai;
387
388 if (pai->ai_family == AF_UNSPEC)
389 pai->ai_family = AF_INET6;
390 error = get_portmatch (pai, _servname);
391 if (error)
392 ERR (error);
393 *pai = ai0;
394 }
395
396 ai0 = *pai;
397
398 /* NULL _hostname, or numeric _hostname
399 */
400 for (ex = explore; ex->e_af >= 0; ex++)
401 {
402 *pai = ai0;
403
404 if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex)))
405 continue;
406
407 if (!MATCH(pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex)))
408 continue;
409
410 if (!MATCH(pai->ai_protocol, ex->e_protocol, WILD_PROTOCOL(ex)))
411 continue;
412
413 if (pai->ai_family == AF_UNSPEC)
414 pai->ai_family = ex->e_af;
415 if (pai->ai_socktype == ANY && ex->e_socktype != ANY)
416 pai->ai_socktype = ex->e_socktype;
417 if (pai->ai_protocol == ANY && ex->e_protocol != ANY)
418 pai->ai_protocol = ex->e_protocol;
419
420 if (!_hostname)
421 error = explore_null (pai, _servname, &cur->ai_next);
422 else error = explore_numeric_scope (pai, _hostname, _servname, &cur->ai_next);
423
424 if (error)
425 goto free_it;
426
427 while (cur && cur->ai_next)
428 cur = cur->ai_next;
429 }
430
431 /* If numeric representation of AF1 can be interpreted as FQDN
432 * representation of AF2, we need to think again about the code below.
433 */
434 if (sentinel.ai_next)
435 goto good;
436
437 if (pai->ai_flags & AI_NUMERICHOST)
438 ERR (EAI_NONAME);
439
440 if (!_hostname)
441 ERR (EAI_NONAME);
442
443 /* _hostname as alphabetical name.
444 * We would like to prefer AF_INET6 than AF_INET, so we'll make a
445 * outer loop by AFs.
446 */
447 for (afd = afd_list; afd->a_af; afd++)
448 {
449 *pai = ai0;
450
451 if (!MATCH_FAMILY (pai->ai_family, afd->a_af, 1))
452 continue;
453
454 for (ex = explore; ex->e_af >= 0; ex++)
455 {
456 *pai = ai0;
457
458 if (pai->ai_family == AF_UNSPEC)
459 pai->ai_family = afd->a_af;
460
461 if (!MATCH_FAMILY (pai->ai_family, ex->e_af, WILD_AF(ex)))
462 continue;
463
464 if (!MATCH (pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex)))
465 continue;
466
467 if (!MATCH (pai->ai_protocol, ex->e_protocol, WILD_PROTOCOL(ex)))
468 continue;
469
470 if (pai->ai_family == AF_UNSPEC)
471 pai->ai_family = ex->e_af;
472 if (pai->ai_socktype == ANY && ex->e_socktype != ANY)
473 pai->ai_socktype = ex->e_socktype;
474 if (pai->ai_protocol == ANY && ex->e_protocol != ANY)
475 pai->ai_protocol = ex->e_protocol;
476
477 error = explore_fqdn (pai, _hostname, _servname, &cur->ai_next);
478
479 if (_resolve_exit) /* interrupted or other fail */
480 {
481 error = EAI_MAX;
482 goto free_it;
483 }
484 while (cur && cur->ai_next)
485 cur = cur->ai_next;
486 }
487 }
488
489good:
490 if (sentinel.ai_next)
491 error = 0;
492
493 if (error == 0)
494 {
495 if (sentinel.ai_next)
496 {
497 if (res)
498 *res = sentinel.ai_next;
499 // dump_addrinfo (*res);
500 return (0); /* success */
501 }
502 error = EAI_FAIL;
503 }
504
505free_it:
506bad:
507 free_addrinfo (sentinel.ai_next);
508 if (res)
509 *res = NULL;
510 SOCK_DEBUGF ((": %s", ai_errlist [error]));
511 return (error);
512}
513
514/*
515 * FQDN hostname, DNS lookup
516 */
517static int explore_fqdn (const struct addrinfo *pai, const char *_hostname,
518 const char *_servname, struct addrinfo **res)
519{
520 static struct hostent copy;
521 static struct in6_addr addr [MAX_ADDRESSES+1];
522 static char *list [MAX_ADDRESSES+1], *ap;
523 struct hostent *hp = NULL;
524 struct addrinfo sentinel, *cur;
525 const struct afd *afd;
526 int af, i, error = 0;
527
528#ifdef TEST_PROG
529 SOCK_DEBUGF (("\nexplore_fqdn"));
530#endif
531
532 *res = NULL;
533 cur = &sentinel;
534 sentinel.ai_next = NULL;
535
536 /* Do not filter unsupported AFs here. We need to honor content of
537 * databases (/etc/hosts, DNS and others). Otherwise we cannot
538 * replace gethostbyname() by getaddrinfo().
539 */
540
541 /* if the _servname does not match socktype/protocol, ignore it.
542 */
543 if (get_portmatch(pai, _servname) != 0)
544 return (0);
545
546 afd = find_afd (pai->ai_family);
547
548 /* Post-RFC2553: should look at (pai->ai_flags & AI_ADDRCONFIG)
549 * rather than hardcoding it. We may need to add AI_ADDRCONFIG
550 * handling code by ourselves.
551 */
552 SOCK_ENTER_SCOPE();
553 hp = gethostbyname2 (_hostname, pai->ai_family);
554 SOCK_LEAVE_SCOPE();
555
556 if (!hp)
557 {
558 switch (h_errno)
559 {
560 case HOST_NOT_FOUND:
561 case NO_DATA:
562 error = EAI_NODATA;
563 break;
564 case TRY_AGAIN:
565 error = EAI_AGAIN;
566 break;
567 case NO_RECOVERY:
568 case NETDB_INTERNAL:
569 default:
570 error = EAI_FAIL;
571 break;
572 }
573
574 }
575 else if (!hp->h_name || !hp->h_name[0] || !hp->h_addr_list[0])
576 {
577 hp = NULL;
578 error = EAI_FAIL;
579 }
580
581 if (!hp)
582 goto free_it;
583
584 /* Perform a shallow copy of 'hp'. Since 'hp' is returned from
585 * fill_hostent(), the contents will be destroyed in below
586 * get_name() otherwise.
587 */
588 copy = *hp;
589 memset (&addr, 0, sizeof(addr));
590 memset (&list, 0, sizeof(list));
591 for (i = 0; hp->h_addr_list[i]; i++)
592 {
593 memcpy (&addr[i], hp->h_addr_list[i], hp->h_length);
594 list[i] = (char*) &addr[i];
595 }
596 list[i] = NULL;
597 copy.h_addr_list = list;
598 hp = &copy;
599
600 for (i = 0; hp->h_addr_list[i]; i++)
601 {
602 af = hp->h_addrtype;
603 ap = hp->h_addr_list[i];
604 if (af == AF_INET6 && IN6_IS_ADDR_V4MAPPED(ap))
605 {
606 af = AF_INET;
607 ap += sizeof(struct in6_addr) - sizeof(struct in_addr);
608 }
609
610 if (af != pai->ai_family)
611 continue;
612
613 if (!(pai->ai_flags & AI_CANONNAME))
614 {
615 GET_AI (cur->ai_next, afd, ap);
616 GET_PORT (cur->ai_next, _servname);
617 }
618 else
619 {
620 /* if AI_CANONNAME and if reverse lookup fail, return ai anyway
621 * to pacify calling application.
622 *
623 * XXX getaddrinfo() is a name to address translation function,
624 * and it looks strange that we do addr to name translation here.
625 */
626 get_name (ap, afd, &cur->ai_next, ap, pai, _servname);
627 }
628 while (cur && cur->ai_next)
629 cur = cur->ai_next;
630 }
631 *res = sentinel.ai_next;
632 return (0);
633
634free_it:
635 free_addrinfo (sentinel.ai_next);
636 return (error);
637}
638
639/*
640 * hostname == NULL.
641 * passive socket -> anyaddr (0.0.0.0 or ::)
642 * non-passive socket -> localhost (127.0.0.1 or ::1)
643 */
644static int explore_null (const struct addrinfo *pai, const char *servname,
645 struct addrinfo **res)
646{
647 const struct afd *afd;
648 struct addrinfo *cur, sentinel;
649 int s, error;
650
651#ifdef TEST_PROG
652 SOCK_DEBUGF (("\nexplore_null"));
653#endif
654
655 *res = NULL;
656 sentinel.ai_next = NULL;
657 cur = &sentinel;
658
659 /* filter out AFs that are not supported
660 */
661 SOCK_ENTER_SCOPE();
662 s = socket (pai->ai_family, SOCK_DGRAM, 0);
663 if (s >= 0)
664 close_s (s);
665 SOCK_LEAVE_SCOPE();
666
667 if (s < 0)
668 return (0);
669
670 /* if the servname does not match socktype/protocol, ignore it.
671 */
672 if (get_portmatch (pai, servname) != 0)
673 return (0);
674
675 afd = find_afd (pai->ai_family);
676
677 if (pai->ai_flags & AI_PASSIVE)
678 {
679 GET_AI (cur->ai_next, afd, afd->a_addrany);
680
681 /* xxx meaningless?
682 * GET_CANONNAME(cur->ai_next, "anyaddr");
683 */
684 GET_PORT (cur->ai_next, servname);
685 }
686 else
687 {
688 GET_AI (cur->ai_next, afd, afd->a_loopback);
689
690 /* xxx meaningless?
691 * GET_CANONNAME(cur->ai_next, "localhost");
692 */
693 GET_PORT (cur->ai_next, servname);
694 }
695
696 *res = sentinel.ai_next;
697 return (0);
698
699free_it:
700 free_addrinfo (sentinel.ai_next);
701 return (error);
702}
703
704/*
705 * numeric _hostname
706 */
707static int explore_numeric (const struct addrinfo *pai, const char *_hostname,
708 const char *_servname, struct addrinfo **res)
709{
710 const struct afd *afd;
711 struct addrinfo *cur, sentinel;
712 int error, flags;
713 union {
714 struct in_addr a4;
715 struct in6_addr a6;
716 } pton;
717
718#ifdef TEST_PROG
719 SOCK_DEBUGF (("\nexplore_numeric"));
720#endif
721
722 *res = NULL;
723 sentinel.ai_next = NULL;
724 cur = &sentinel;
725
726 /* if the _servname does not match socktype/protocol, ignore it.
727 */
728 if (get_portmatch (pai, _servname) != 0)
729 return (0);
730
731 afd = find_afd (pai->ai_family);
732 flags = pai->ai_flags;
733
734 if (inet_pton (afd->a_af, _hostname, &pton) == 1)
735 {
736 DWORD v4a;
737 BYTE pfx;
738
739 switch (afd->a_af)
740 {
741 case AF_INET:
742 v4a = (DWORD) ntohl (pton.a4.s_addr);
743 if (IN_MULTICAST (v4a) || IN_EXPERIMENTAL(v4a))
744 flags &= ~AI_CANONNAME;
745 v4a >>= IN_CLASSA_NSHIFT;
746 if (v4a == 0 || v4a == IN_LOOPBACKNET)
747 flags &= ~AI_CANONNAME;
748 break;
749
750 case AF_INET6:
751 pfx = pton.a6.s6_addr[0];
752 if (pfx == 0 || pfx == 0xfe || pfx == 0xff)
753 flags &= ~AI_CANONNAME;
754 break;
755 }
756
757 if (pai->ai_family == afd->a_af || pai->ai_family == AF_UNSPEC)
758 {
759 if (!(flags & AI_CANONNAME))
760 {
761 GET_AI (cur->ai_next, afd, &pton);
762 GET_PORT (cur->ai_next, _servname);
763 }
764 else
765 {
766 /* if AI_CANONNAME and if reverse lookup fail, return ai anyway
767 * to pacify calling application.
768 *
769 * XXX getaddrinfo() is a name to address translation function,
770 * and it looks strange that we do addr to name translation here.
771 */
772 get_name ((const char*)&pton, afd, &cur->ai_next,
773 (char*)&pton, pai, _servname);
774 }
775 while (cur && cur->ai_next)
776 cur = cur->ai_next;
777 }
778 else
779 ERR (EAI_FAMILY); /* xxx */
780 }
781 *res = sentinel.ai_next;
782 return (0);
783
784free_it:
785bad:
786 free_addrinfo (sentinel.ai_next);
787 return (error);
788}
789
790/*
791 * numeric _hostname with scope
792 */
793static int explore_numeric_scope (const struct addrinfo *pai,
794 const char *_hostname, const char *_servname,
795 struct addrinfo **res)
796{
797 const struct afd *afd;
798 struct addrinfo *cur;
799 struct sockaddr_in6 *sin6;
800 char *cp, hostname2 [MAX_HOSTLEN];
801 int error, scope = 0;
802
803#ifdef TEST_PROG
804 SOCK_DEBUGF (("\nexplore_numeric_scope"));
805#endif
806
807 /* if the _servname does not match socktype/protocol, ignore it.
808 */
809 if (get_portmatch (pai, _servname) != 0)
810 return (0);
811
812 afd = find_afd (pai->ai_family);
813 if (!afd->a_scoped)
814 return explore_numeric (pai, _hostname, _servname, res);
815
816 cp = strchr (_hostname, SCOPE_DELIMITER);
817 if (!cp || (cp - _hostname) >= SIZEOF(hostname2))
818 return explore_numeric (pai, _hostname, _servname, res);
819
820 /* Handle special case of <scoped_address>%<scope id>
821 * 'scope id' is numeric "1..x".
822 */
823 _strlcpy (hostname2, _hostname, sizeof(hostname2));
824
825 /* terminate at the delimiter
826 */
827 hostname2 [cp - _hostname] = '\0';
828
829 switch (pai->ai_family)
830 {
831 case AF_INET6:
832 scope = __scope_ascii_to_id (cp + 1);
833 if (scope == 0)
834 return (EAI_NONAME);
835 break;
836 }
837
838 error = explore_numeric (pai, hostname2, _servname, res);
839 if (error == 0)
840 {
841 for (cur = *res; cur; cur = cur->ai_next)
842 {
843 if (cur->ai_family != AF_INET6)
844 continue;
845
846 sin6 = (struct sockaddr_in6*) cur->ai_addr;
847 if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) ||
848 IN6_IS_ADDR_MC_LINKLOCAL(&sin6->sin6_addr))
849 sin6->sin6_scope_id = scope;
850 }
851 }
852 return (error);
853}
854
855static int get_name (const char *addr, const struct afd *afd,
856 struct addrinfo **res, char *numaddr,
857 const struct addrinfo *pai, const char *servname)
858{
859 struct hostent *hp;
860 struct addrinfo *cur = NULL;
861 int error = 0;
862
863 SOCK_ENTER_SCOPE();
864 called_from_getai = TRUE;
865 hp = gethostbyaddr (addr, afd->a_addrlen, afd->a_af);
866 called_from_getai = FALSE;
867 SOCK_LEAVE_SCOPE();
868
869 if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0])
870 {
871 GET_AI (cur, afd, hp->h_addr);
872 GET_PORT (cur, servname);
873 GET_CANONNAME (cur, hp->h_name);
874 }
875 else
876 {
877 GET_AI (cur, afd, numaddr);
878 GET_PORT (cur, servname);
879 }
880
881 *res = cur;
882 return (0); /* success */
883
884free_it:
885 free_addrinfo (cur);
886 *res = NULL;
887 return (error);
888}
889
890static int get_canonname (const struct addrinfo *pai, struct addrinfo *ai,
891 const char *str)
892{
893 if (pai->ai_flags & AI_CANONNAME)
894 {
895 ai->ai_canonname = strdup (str);
896 if (!ai->ai_canonname)
897 return (EAI_MEMORY);
898 }
899 return (0);
900}
901
902static struct addrinfo *get_ai (const struct addrinfo *pai,
903 const struct afd *afd,
904 const char *addr)
905{
906 struct addrinfo *ai;
907 char *p;
908
909 ai = calloc (sizeof(*ai) + afd->a_socklen, 1);
910 if (!ai)
911 return (NULL);
912
913 *ai = *pai;
914 ai->ai_addr = (struct sockaddr*) (ai + 1);
915 ai->ai_addrlen = afd->a_socklen;
916 ai->ai_addr->sa_family = ai->ai_family = afd->a_af;
917
918 p = (char*)ai->ai_addr + afd->a_off;
919 memcpy (p, addr, afd->a_addrlen);
920 return (ai);
921}
922
923static int get_portmatch (const struct addrinfo *ai, const char *servname)
924{
925 /* get_port does not touch first argument. when matchonly == 1. */
926 return get_port ((struct addrinfo*)ai, servname, 1);
927}
928
929static int get_port (struct addrinfo *ai, const char *servname, int matchonly)
930{
931 struct servent *sp;
932 const char *proto;
933 WORD port;
934 BOOL allownumeric;
935
936 if (!servname ||
937 (ai->ai_family != AF_INET && ai->ai_family != AF_INET6))
938 return (0);
939
940 switch (ai->ai_socktype)
941 {
942 case SOCK_RAW:
943 case SOCK_PACKET:
944 return (EAI_SERVICE);
945 case SOCK_DGRAM:
946 case SOCK_STREAM:
947 case ANY:
948 allownumeric = TRUE;
949 break;
950 default:
951 return (EAI_SOCKTYPE);
952 }
953
954 if (str_isnumber(servname))
955 {
956 if (!allownumeric)
957 return (EAI_SERVICE);
958 port = htons (ATOI(servname));
959 }
960 else
961 {
962 switch (ai->ai_socktype)
963 {
964 case SOCK_DGRAM:
965 proto = "udp";
966 break;
967 case SOCK_STREAM:
968 proto = "tcp";
969 break;
970 default:
971 proto = NULL;
972 break;
973 }
974
975 SOCK_ENTER_SCOPE();
976 sp = getservbyname (servname, proto);
977 SOCK_LEAVE_SCOPE();
978
979 if (!sp)
980 return (EAI_SERVICE);
981 port = sp->s_port;
982 }
983
984 if (!matchonly)
985 {
986 switch (ai->ai_family)
987 {
988 case AF_INET:
989 ((struct sockaddr_in*)ai->ai_addr)->sin_port = port;
990 break;
991 case AF_INET6:
992 ((struct sockaddr_in6*)ai->ai_addr)->sin6_port = port;
993 break;
994 }
995 }
996 return (0);
997}
998
999static const struct afd *find_afd (int af)
1000{
1001 const struct afd *afd;
1002
1003 if (af == AF_UNSPEC)
1004 return (NULL);
1005
1006 for (afd = afd_list; afd->a_af; afd++)
1007 if (afd->a_af == af)
1008 return (afd);
1009 return (NULL);
1010}
1011#endif /* USE_BSD_API */
1012
1013#if defined(TEST_PROG)
1014#if !defined(USE_BSD_API)
1015int main (void)
1016{
1017 puts ("This program needs '#define USE_BSD_API'");
1018 return (1);
1019}
1020#else /* rest of file */
1021
1022static void dump_addrinfo (const struct addrinfo *ai)
1023{
1024 for ( ; ai; ai = ai->ai_next)
1025 {
1026 const struct sockaddr_in *sa4 = (const struct sockaddr_in*) ai->ai_addr;
1027 const struct sockaddr_in6 *sa6 = (const struct sockaddr_in6*) ai->ai_addr;
1028 int af = ai->ai_family;
1029 char buf [INET6_ADDRSTRLEN];
1030
1031 printf (" family %2d, CNAME %s, ",
1032 af, ai->ai_canonname ? ai->ai_canonname : "<none>");
1033 printf ("%s\n",
1034 af == AF_INET ? inet_ntop(af, &sa4->sin_addr, buf, sizeof(buf)) :
1035 af == AF_INET6 ? inet_ntop(af, &sa6->sin6_addr, buf, sizeof(buf)) :
1036 "??");
1037 }
1038}
1039
1040static void test_getaddrinfo (const char *host, const char *serv)
1041{
1042 struct addrinfo hints, *res = NULL;
1043 int rc;
1044
1045 printf ("Calling: getaddrinfo (\"%s\", \"%s\",...);", host, serv);
1046 memset (&hints, 0, sizeof(hints));
1047 hints.ai_family = AF_UNSPEC;
1048 hints.ai_socktype = SOCK_STREAM;
1049 hints.ai_flags = AI_CANONNAME;
1050
1051 rc = getaddrinfo (host, serv, &hints, &res);
1052 puts ("");
1053 if (res)
1054 dump_addrinfo (res);
1055 else printf ("fail; %s\n", gai_strerror(rc));
1056
1057 if (res)
1058 freeaddrinfo (res);
1059}
1060
1061int main (void)
1062{
1063 dbug_init();
1064 sock_init();
1065
1066 test_getaddrinfo ("www.kame.net", "http");
1067 test_getaddrinfo ("www.watt-32.net", "http");
1068
1069 return (0);
1070}
1071#endif /* USE_BSD_API */
1072#endif /* TEST_PROG */
1073
afd_list_init
static void afd_list_init(BOOL ip6_prio)
Initialise afd_list[].
Definition: get_ai.c:268
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
pcdns.h
inet_pton
int W32_CALL inet_pton(int af, const char *src, void *dst)
Convert from presentation format (which usually means ASCII printable) to network format (which is us...
Definition: presaddr.c:73
inet_ntop
const char *W32_CALL inet_ntop(int af, const void *src, char *dst, size_t size)
Convert a network format address to presentation format.
Definition: presaddr.c:43
addrinfo
Definition: netdb.h:137
afd
Definition: get_ai.c:62
explore
Definition: get_ai.c:72
hostent
Definition: netdb.h:104
in6_addr
Definition: in.h:151
in_addr
Definition: in.h:143
servent
Definition: netdb.h:124
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82


Watt-32 tcp/ip: E:/WATT/src/get_ip.c Source File

  • src
get_ip.c
Go to the documentation of this file.
1
6/*
7 * Copyright (C) 1999-2001 Internet Software Consortium.
8 *
9 * Permission to use, copy, modify, and distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
14 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
16 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
17 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
18 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
19 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
20 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 */
22
23/* $Id: getipnode.c,v 1.30 2001/07/18 02:37:08 mayer Exp $ */
24
25/* Originally from ISC's BIND 9.21; lightweigth resolver library (lwres).
26 * Rewritten an simplified for Watt-32 by <gvanem@yahoo.no> Nov-2003.
27 */
28
29#include "socket.h"
30#include "get_xby.h"
31#include "pcdns.h"
32
33#if defined(USE_BSD_API)
34
35static struct hostent *copyandmerge (const struct hostent *he1,
36 const struct hostent *he2,
37 int af, int *err);
38
39static __inline void scan_interface (BOOL *have_v4, BOOL *have_v6)
40{
41 if (have_v4)
42 *have_v4 = TRUE;
43
44 if (have_v6)
45#if defined(USE_IPV6)
46 *have_v6 = dns_do_ipv6;
47#else
48 *have_v6 = FALSE;
49#endif
50}
51
52/*
53 * AI_V4MAPPED + AF_INET6
54 * If no IPv6 address then a query for IPv4 and map returned values.
55 *
56 * AI_ALL + AI_V4MAPPED + AF_INET6
57 * Return IPv6 and IPv4 mapped.
58 *
59 * AI_ADDRCONFIG
60 * Only return IPv6 / IPv4 address if there is an interface of that
61 * type active.
62 */
63struct hostent * W32_CALL
64getipnodebyname (const char *name, int af, int flags, int *error)
65{
66 struct hostent *he1 = NULL;
67 struct hostent *he2 = NULL;
68 struct in_addr in4;
69 struct in6_addr in6;
70 BOOL have_v4 = TRUE;
71 BOOL have_v6 = TRUE;
72 BOOL v4 = FALSE;
73 BOOL v6 = FALSE;
74 int tmp_err;
75
76 SOCK_DEBUGF (("\ngetipnodebyname: %s ", name));
77
78#if !defined(USE_IPV6)
79 if (af == AF_INET6)
80 {
81 *error = HOST_NOT_FOUND;
82 return (NULL);
83 }
84#endif
85
86 /* If we care about active interfaces then check.
87 */
88 if (flags & AI_ADDRCONFIG)
89 scan_interface (&have_v4, &have_v6);
90
91 /* Check for literal address.
92 */
93 v4 = inet_pton (AF_INET, name, &in4);
94 if (!v4)
95 v6 = inet_pton (AF_INET6, name, &in6);
96
97 /* Impossible combination?
98 */
99 if ((af == AF_INET6 && !(flags & AI_V4MAPPED) && v4) ||
100 (af == AF_INET && v6) ||
101 (!have_v4 && v4) ||
102 (!have_v6 && v6) ||
103 (!have_v4 && af == AF_INET) ||
104 ((!have_v6 && af == AF_INET6) && ((flags & AI_V4MAPPED) && have_v4)) ||
105 !(flags & AI_V4MAPPED))
106 {
107 *error = HOST_NOT_FOUND;
108 return (NULL);
109 }
110
111 /* Literal address?
112 */
113 if (v4 || v6)
114 {
115 struct hostent he;
116 char *addr_list[2];
117 char *aliases[1];
118
119 he.h_name = (char*) name;
120 he.h_addr_list = addr_list;
121 he.h_addr_list[0] = (v4 ? (char*)&in4 : (char*)&in6);
122 he.h_addr_list[1] = NULL;
123 he.h_aliases = aliases;
124 he.h_aliases[0] = NULL;
125 he.h_length = (v4 ? INADDRSZ : IN6ADDRSZ);
126 he.h_addrtype = (v4 ? AF_INET : AF_INET6);
127 return copyandmerge (&he, NULL, af, error);
128 }
129
130 tmp_err = NO_RECOVERY;
131 if (have_v6 && af == AF_INET6)
132 {
133#if defined(USE_IPV6)
134 he1 = gethostbyname6 (name);
135#else
136 he1 = NULL;
137#endif
138 if (!he1)
139 tmp_err = HOST_NOT_FOUND;
140 }
141
142 if (have_v4 &&
143 (af == AF_INET ||
144 (af == AF_INET6 &&
145 (flags & AI_V4MAPPED) && (!he1 || (flags & AI_ALL)))))
146 {
147 SOCK_ENTER_SCOPE();
148 he2 = gethostbyname (name);
149 SOCK_LEAVE_SCOPE();
150 if (!he2 || !he1)
151 {
152 *error = HOST_NOT_FOUND;
153 return (NULL);
154 }
155 }
156 else
157 *error = tmp_err;
158
159 return copyandmerge (he1, he2, af, error);
160}
161
162struct hostent * W32_CALL
163getipnodebyaddr (const void *src, size_t len, int af, int *error)
164{
165 struct hostent *he1, *he2 = NULL;
166 const BYTE *cp = (const BYTE*) src;
167
168 SOCK_DEBUGF (("\ngetipnodebyaddr: "));
169
170 if (!src)
171 {
172 *error = NO_RECOVERY;
173 return (NULL);
174 }
175
176 switch (af)
177 {
178 case AF_INET:
179 if (len < INADDRSZ)
180 {
181 *error = NO_RECOVERY;
182 return (NULL);
183 }
184 break;
185#if defined(USE_IPV6)
186 case AF_INET6:
187 if (len < IN6ADDRSZ)
188 {
189 *error = NO_RECOVERY;
190 return (NULL);
191 }
192 break;
193#endif
194 default:
195 *error = NO_RECOVERY;
196 return (NULL);
197 }
198
199 /* Look up IPv4 and IPv4 mapped/compatible addresses.
200 */
201 if ((af == AF_INET6 && IN6_IS_ADDR_V4COMPAT(cp)) ||
202 (af == AF_INET6 && IN6_IS_ADDR_V4MAPPED(cp)) ||
203 (af == AF_INET))
204 {
205 if (af == AF_INET6)
206 cp += 12;
207
208 SOCK_ENTER_SCOPE();
209 he1 = gethostbyaddr ((const char*)cp, 4, AF_INET);
210 SOCK_LEAVE_SCOPE();
211
212 if (af == AF_INET)
213 goto ret_copy;
214
215#if defined(USE_IPV6)
216 /* Convert from AF_INET to AF_INET6.
217 */
218 he2 = copyandmerge (he1, NULL, af, error);
219 if (he2)
220 {
221 memcpy (he2->h_addr, src, len); /* Restore original address */
222 SOCK_DEBUGF (("%s", af == AF_INET ?
223 inet_ntoa(*(struct in_addr*)&he2->h_addr) :
224 _inet6_ntoa(he2->h_addr)));
225 }
226#endif
227 return (he2);
228 }
229
230 he1 = gethostbyaddr (src, len, AF_INET6); /* Lookup IPv6 address */
231
232ret_copy:
233 if (!he1)
234 {
235 *error = HOST_NOT_FOUND;
236 return (NULL);
237 }
238 return copyandmerge (he1, NULL, af, error);
239}
240
241void W32_CALL freehostent (struct hostent *he)
242{
243 char *p;
244
245 SOCK_DEBUGF (("\nfreehostent: %s ", he->h_name));
246
247 if (!he->h_name) /* possible double freeing */
248 return;
249
250 DO_FREE (he->h_name);
251
252 for (p = he->h_addr_list[0]; p; p++)
253 free (p);
254
255 for (p = he->h_aliases[0]; p; p++)
256 free (p);
257
258 free (he->h_aliases);
259 free (he->h_addr_list);
260 free (he);
261}
262
263static struct hostent *copyandmerge (const struct hostent *he1,
264 const struct hostent *he2,
265 int af, int *error)
266{
267 struct hostent *he = NULL;
268 int addresses = 1; /* NULL terminator */
269 int names = 1; /* NULL terminator */
270 char **cpp, **npp;
271
272#if !defined(USE_IPV6)
273 BYTE in6addr_mapped [12];
274
275 WATT_ASSERT (af != AF_INET6);
276#endif
277
278 /* Work out array sizes.
279 */
280 if (he1)
281 {
282 cpp = he1->h_addr_list;
283 while (*cpp)
284 {
285 addresses++;
286 cpp++;
287 }
288 cpp = he1->h_aliases;
289 while (*cpp)
290 {
291 names++;
292 cpp++;
293 }
294 }
295
296 if (he2)
297 {
298 cpp = he2->h_addr_list;
299 while (*cpp)
300 {
301 addresses++;
302 cpp++;
303 }
304 if (!he1)
305 {
306 cpp = he2->h_aliases;
307 while (*cpp)
308 {
309 names++;
310 cpp++;
311 }
312 }
313 }
314
315 if (addresses == 1)
316 {
317 *error = NO_ADDRESS;
318 return (NULL);
319 }
320
321 he = malloc (sizeof(*he));
322 if (!he)
323 {
324 *error = NO_RECOVERY;
325 return (NULL);
326 }
327
328 he->h_addr_list = calloc (addresses * sizeof(char*), 1);
329 if (!he->h_addr_list)
330 goto cleanup0;
331
332 /* Copy addresses.
333 */
334 npp = he->h_addr_list;
335 if (he1)
336 {
337 cpp = he1->h_addr_list;
338 while (*cpp)
339 {
340 *npp = malloc (af == AF_INET ? INADDRSZ : IN6ADDRSZ);
341 if (!*npp)
342 goto cleanup1;
343
344 /* Convert to mapped if required.
345 */
346 if (af == AF_INET6 && he1->h_addrtype == AF_INET)
347 {
348 memcpy (*npp, in6addr_mapped, sizeof(in6addr_mapped));
349 memcpy (*npp + sizeof(in6addr_mapped), *cpp, INADDRSZ);
350 }
351 else
352 memcpy (*npp, *cpp, af == AF_INET ? INADDRSZ : IN6ADDRSZ);
353 cpp++;
354 npp++;
355 }
356 }
357
358 if (he2)
359 {
360 cpp = he2->h_addr_list;
361 while (*cpp)
362 {
363 *npp = malloc (af == AF_INET ? INADDRSZ : IN6ADDRSZ);
364 if (!*npp)
365 goto cleanup1;
366
367 /* Convert to mapped if required.
368 */
369 if (af == AF_INET6 && he2->h_addrtype == AF_INET)
370 {
371 memcpy (*npp, in6addr_mapped, sizeof(in6addr_mapped));
372 memcpy (*npp + sizeof(in6addr_mapped), *cpp, INADDRSZ);
373 }
374 else
375 memcpy (*npp, *cpp, af == AF_INET ? INADDRSZ : IN6ADDRSZ);
376 cpp++;
377 npp++;
378 }
379 }
380
381 he->h_aliases = calloc (names * sizeof(char*), 1);
382 if (!he->h_aliases)
383 goto cleanup1;
384
385 /* Copy aliases.
386 */
387 npp = he->h_aliases;
388 cpp = (he1 ? he1->h_aliases : he2->h_aliases);
389 while (*cpp)
390 {
391 *npp = strdup (*cpp);
392 if (!*npp)
393 goto cleanup2;
394 npp++;
395 cpp++;
396 }
397
398 /* Copy hostname.
399 */
400 if (he1)
401 he->h_name = strdup (he1->h_name);
402 else he->h_name = strdup (he2->h_name);
403
404 if (!he->h_name)
405 goto cleanup2;
406
407 he->h_addrtype = af;
408 he->h_length = (af == AF_INET ? INADDRSZ : IN6ADDRSZ);
409 return (he);
410
411cleanup2:
412 for (cpp = he->h_aliases; *cpp; *cpp++ = NULL)
413 free (*cpp);
414 free (he->h_aliases);
415
416cleanup1:
417 for (cpp = he->h_addr_list; *cpp; *cpp++ = NULL)
418 free (*cpp);
419 free (he->h_addr_list);
420
421cleanup0:
422 free (he);
423 *error = NO_RECOVERY;
424 return (NULL);
425}
426#endif /* USE_BSD_API */
get_xby.h
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
pcdns.h
inet_pton
int W32_CALL inet_pton(int af, const char *src, void *dst)
Convert from presentation format (which usually means ASCII printable) to network format (which is us...
Definition: presaddr.c:73
hostent
Definition: netdb.h:104
in6_addr
Definition: in.h:151
in_addr
Definition: in.h:143


Watt-32 tcp/ip: E:/WATT/src/get_ni.c Source File

  • src
get_ni.c
Go to the documentation of this file.
1
5/* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * Issues to be discussed:
35 * - Thread safe-ness must be checked
36 * - Return values. There seems to be no standard for return value (RFC2553)
37 * but INRIA implementation returns EAI_xxx defined for getaddrinfo().
38 * - RFC2553 says that we should raise error on short buffer. X/Open says
39 * we need to truncate the result. We obey RFC2553 (and X/Open should be
40 * modified).
41 *
42 * Adapted for Watt-32 tcp/ip stack by G. Vanem <gvanem@yahoo.no>, Aug 2002.
43 */
44
45#include "socket.h"
46
47#if defined(USE_BSD_API)
48
49#define NI_SUCCESS 0
50#define ANY 0
51#define YES 1
52#define NO 0
53
54#define ENI_NOSOCKET EINVAL
55#define ENI_NOHOSTNAME EINVAL
56#define ENI_MEMORY ENOMEM
57#define ENI_SALEN EINVAL
58#define ENI_FAMILY EAFNOSUPPORT
59#define ENI_SYSTEM -1
60
61#define GI_RESULT(err) gi_result (err, #err, __LINE__)
62
63static struct afd {
64 int a_af;
65 int a_addrlen;
66 int a_socklen;
67 int a_off;
68 } afd_list [3];
69
70struct sockinet {
71 BYTE si_len;
72 BYTE si_family;
73 WORD si_port;
74 };
75
76/*
77 * Initialise afd_list[] with IPv6 protocol at highest priority.
78 */
79static void afd_list_init (BOOL ip6_prio)
80{
81 int i = (ip6_prio ? 0 : 1);
82
83 memset (&afd_list, 0, sizeof(afd_list));
84 afd_list[i].a_af = AF_INET6;
85 afd_list[i].a_addrlen = sizeof (struct in6_addr);
86 afd_list[i].a_socklen = sizeof (struct sockaddr_in6);
87 afd_list[i].a_off = offsetof (struct sockaddr_in6, sin6_addr);
88
89 i ^= 1;
90 afd_list[i].a_af = AF_INET;
91 afd_list[i].a_addrlen = sizeof (struct in_addr);
92 afd_list[i].a_socklen = sizeof (struct sockaddr_in);
93 afd_list[i].a_off = offsetof (struct sockaddr_in, sin_addr);
94}
95
96static int gi_result (int err, const char *str, unsigned line)
97{
98 SOCK_LEAVE_SCOPE();
99 if (err)
100 {
101 SOCK_DEBUGF ((", %s (%d) at line %u", str, err, line));
102 if (err > 0)
103 SOCK_ERRNO (err);
104 }
105 else
106 SOCK_DEBUGF ((", okay"));
107
108 ARGSUSED (str);
109 ARGSUSED (line);
110 return (err);
111}
112
113int W32_CALL getnameinfo (const struct sockaddr *sa, socklen_t salen,
114 char *host, socklen_t hostlen,
115 char *serv, socklen_t servlen, int flags)
116{
117 static BOOL init = FALSE;
118 struct afd *afd;
119 sa_family_t family = (sa_family_t) -1;
120 DWORD v4a;
121 WORD port;
122 char numserv[512];
123 char numaddr[512];
124 char *addr, *p;
125 int i;
126
127 const struct servent *sp;
128 const struct hostent *hp;
129 const struct sockaddr_in *a4 = (const struct sockaddr_in *) sa;
130 const struct sockaddr_in6 *a6 = (const struct sockaddr_in6*) sa;
131
132 if (!init)
133 afd_list_init (TRUE);
134 init = TRUE;
135
136 SOCK_DEBUGF (("\ngetnameinfo: "));
137
138 if (!sa)
139 return GI_RESULT (ENI_NOSOCKET);
140
141 family = sa->sa_family;
142
143 SOCK_DEBUGF (("name %s, serv %.10s, flags %04X",
144 family == AF_INET ? inet_ntoa(a4->sin_addr) :
145 family == AF_INET6 ? _inet6_ntoa(&a6->sin6_addr) : "??",
146 ((flags & NI_NUMERICSERV) || flags == 0) ? "<get>" : serv,
147 flags));
148
149 for (i = 0; afd_list[i].a_af; i++)
150 if (afd_list[i].a_af == family)
151 {
152 afd = &afd_list[i];
153 goto found;
154 }
155 return GI_RESULT (ENI_FAMILY);
156
157found:
158 if (salen != afd->a_socklen)
159 return GI_RESULT (ENI_SALEN);
160
161 port = ((struct sockinet*)sa)->si_port; /* network byte order */
162 addr = (char*) sa + afd->a_off;
163
164 SOCK_ENTER_SCOPE();
165
166 if (!serv || servlen == 0)
167 {
168 /* do nothing in this case.
169 * in case you are wondering if "&&" is more correct than
170 * "||" here: RFC2553 says that serv == NULL OR servlen == 0
171 * means that the caller does not want the result.
172 */
173 }
174 else
175 {
176 if (flags & NI_NUMERICSERV)
177 sp = NULL;
178 else sp = getservbyport (port, (flags & NI_DGRAM) ? "udp" : "tcp");
179 if (sp)
180 {
181 if ((int)strlen(sp->s_name) + 1 > servlen)
182 return GI_RESULT (ENI_MEMORY);
183 strcpy (serv, sp->s_name);
184 }
185 else
186 {
187 itoa (ntohs(port), numserv, 10);
188 if ((int)strlen(numserv) + 1 > servlen)
189 return GI_RESULT (ENI_MEMORY);
190 strcpy (serv, numserv);
191 }
192 }
193
194 switch (sa->sa_family)
195 {
196 case AF_INET:
197 v4a = ntohl (((struct sockaddr_in*)sa)->sin_addr.s_addr);
198 if (IN_MULTICAST (v4a) || IN_EXPERIMENTAL (v4a))
199 flags |= NI_NUMERICHOST;
200 v4a >>= IN_CLASSA_NSHIFT;
201 if (v4a == 0)
202 flags |= NI_NUMERICHOST;
203 break;
204
205 case AF_INET6:
206 switch (a6->sin6_addr.s6_addr[0])
207 {
208 case 0x00:
209 if (IN6_IS_ADDR_V4MAPPED(&a6->sin6_addr))
210 ;
211 else if (IN6_IS_ADDR_LOOPBACK(&a6->sin6_addr))
212 ;
213 else
214 flags |= NI_NUMERICHOST;
215 break;
216 default:
217 if (IN6_IS_ADDR_LINKLOCAL(&a6->sin6_addr))
218 flags |= NI_NUMERICHOST;
219 else if (IN6_IS_ADDR_MULTICAST(&a6->sin6_addr))
220 flags |= NI_NUMERICHOST;
221 break;
222 }
223 break;
224 }
225
226 if (!host || hostlen == 0)
227 {
228 /* do nothing in this case.
229 * in case you are wondering if "&&" is more correct than
230 * "||" here: RFC2553 says that host == NULL OR hostlen == 0
231 * means that the caller does not want the result.
232 */
233 }
234 else if (flags & NI_NUMERICHOST)
235 {
236 /* NUMERICHOST and NAMEREQD conflicts with each other
237 */
238 if (flags & NI_NAMEREQD)
239 return GI_RESULT (ENI_NOHOSTNAME);
240
241 if (inet_ntop (afd->a_af, addr, numaddr, sizeof(numaddr)) == NULL)
242 return GI_RESULT (ENI_SYSTEM);
243
244 if ((int)strlen(numaddr) + 1 > hostlen)
245 return GI_RESULT (ENI_MEMORY);
246
247 strcpy (host, numaddr);
248
249 if (afd->a_af == AF_INET6 &&
250 (IN6_IS_ADDR_LINKLOCAL(addr) ||
251 IN6_IS_ADDR_MULTICAST(addr)) &&
252 ((struct sockaddr_in6*)sa)->sin6_scope_id)
253 {
254#if !defined(ALWAYS_WITHSCOPE)
255 if (flags & NI_WITHSCOPEID)
256#endif
257 {
258 char *ep = strchr (host, '\0');
259 int id = ((struct sockaddr_in6*)sa)->sin6_scope_id;
260 int scope = __scope_id_to_ascii (id); /* '1' ... N */
261
262 *ep++ = SCOPE_DELIMITER;
263 *ep++ = scope ? scope : '?';
264 *ep = '\0';
265 }
266 }
267 }
268 else
269 {
270 hp = gethostbyaddr (addr, afd->a_addrlen, afd->a_af);
271 if (hp)
272 {
273 if (flags & NI_NOFQDN)
274 {
275 p = strchr (hp->h_name, '.');
276 if (p)
277 *p = '\0';
278 }
279 if ((int)strlen(hp->h_name) + 1 > hostlen)
280 return GI_RESULT (ENI_MEMORY);
281 strcpy (host, hp->h_name);
282 }
283 else
284 {
285 if (flags & NI_NAMEREQD)
286 return GI_RESULT (ENI_NOHOSTNAME);
287
288 if (inet_ntop (afd->a_af, addr, numaddr, sizeof(numaddr)) == NULL)
289 return GI_RESULT (ENI_NOHOSTNAME);
290
291 if ((int)strlen(numaddr) + 1 > hostlen)
292 return GI_RESULT (ENI_MEMORY);
293
294 strcpy (host, numaddr);
295 }
296 }
297 ARGSUSED (a4);
298 return GI_RESULT (NI_SUCCESS);
299}
300#endif /* USE_BSD_API */
301
302#if defined(TEST_PROG)
303#if !defined(USE_BSD_API)
304int main (void)
305{
306 puts ("This program needs '#define USE_BSD_API'");
307 return (1);
308}
309#else /* rest of file */
310
311#undef ni_flags /* <netinet/icmp6.> */
312
313static int ni_flags = NI_NAMEREQD; // NI_NUMERICHOST
314
315static int ip4_resolve (const char *name)
316{
317 struct sockaddr_in a4;
318 char buf[40];
319 int rc;
320
321 printf ("getnameinfo(): ");
322 fflush (stdout);
323
324 a4.sin_family = AF_INET;
325 inet_pton (AF_INET, "203.178.141.194", &a4.sin_addr);
326 rc = getnameinfo ((const struct sockaddr*)&a4, sizeof(a4),
327 buf, sizeof(buf), NULL, 0, ni_flags);
328 if (rc)
329 perror (NULL);
330 else puts (buf);
331 ARGSUSED (name);
332 return (rc);
333}
334
335static int ip6_resolve (const char *name)
336{
337 struct sockaddr_in6 a6;
338 char buf[40];
339 int rc;
340
341 printf ("getnameinfo(): ");
342 fflush (stdout);
343
344 a6.sin6_family = AF_INET6; /* www.kame.net */
345 inet_pton (AF_INET6, "2001:200:DFF:FFF1:216:3EFF:FEB1:44D7", &a6.sin6_addr);
346 rc = getnameinfo ((const struct sockaddr*)&a6, sizeof(a6),
347 buf, sizeof(buf), NULL, 0, ni_flags);
348 if (rc)
349 puts (hstrerror(h_errno));
350 else puts (buf);
351 ARGSUSED (name);
352 return (rc);
353}
354
355int main (int argc, char **argv)
356{
357 int af = -1;
358
359 if (argc < 2)
360 goto usage;
361
362 dbug_init();
363 sock_init();
364
365 if (!stricmp(argv[1],"AF_INET"))
366 af = AF_INET;
367
368 else if (!stricmp(argv[1],"AF_INET6"))
369 af = AF_INET6;
370
371 if (af == AF_INET6)
372 return ip6_resolve ("www.kame.net");
373
374 if (af == AF_INET)
375 return ip4_resolve ("www.kame.net");
376
377usage:
378 printf ("Usage: <AF_INET | AF_INET6>");
379 return (1);
380}
381#endif /* USE_BSD_API */
382#endif /* TEST_PROG */
383
afd_list_init
static void afd_list_init(BOOL ip6_prio)
Initialise afd_list[].
Definition: get_ai.c:268
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
inet_pton
int W32_CALL inet_pton(int af, const char *src, void *dst)
Convert from presentation format (which usually means ASCII printable) to network format (which is us...
Definition: presaddr.c:73
inet_ntop
const char *W32_CALL inet_ntop(int af, const void *src, char *dst, size_t size)
Convert a network format address to presentation format.
Definition: presaddr.c:43
afd
Definition: get_ai.c:62
hostent
Definition: netdb.h:104
in6_addr
Definition: in.h:151
in_addr
Definition: in.h:143
servent
Definition: netdb.h:124
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
sockaddr
Definition: socket.h:181
sockinet
Definition: get_ni.c:70


Watt-32 tcp/ip: E:/WATT/src/get_xby.h Source File

  • src
get_xby.h
Go to the documentation of this file.
1
3#ifndef _w32_GET_X_BY_Y_H
4#define _w32_GET_X_BY_Y_H
5
6#ifndef _REENTRANT
7#define _REENTRANT /* pull in the *_r() prototypes */
8#endif
9
10#ifndef __NETDB_H
11#include <netdb.h>
12#endif
13
14#define MAX_SERV_ALIASES 5
15#define MAX_HOST_ALIASES 5
16#define MAX_NETENT_ALIASES 5
17#define MAX_PROTO_ALIASES 0
18#define MAX_CACHE_LIFE (15*60)
19
20#define ReadHostsFile W32_NAMESPACE (ReadHostsFile)
21#define GetHostsFile W32_NAMESPACE (GetHostsFile)
22#define CloseHostFile W32_NAMESPACE (CloseHostFile)
23
24#define ReadHosts6File W32_NAMESPACE (ReadHosts6File)
25#define CloseHost6File W32_NAMESPACE (CloseHost6File)
26#define GetHosts6File W32_NAMESPACE (GetHosts6File)
27
28#define ReadServFile W32_NAMESPACE (ReadServFile)
29#define GetServFile W32_NAMESPACE (GetServFile)
30#define CloseServFile W32_NAMESPACE (CloseServFile)
31
32#define ReadProtoFile W32_NAMESPACE (ReadProtoFile)
33#define GetProtoFile W32_NAMESPACE (GetProtoFile)
34#define CloseProtoFile W32_NAMESPACE (CloseProtoFile)
35
36#define ReadNetworksFile W32_NAMESPACE (ReadNetworksFile)
37#define CloseNetworksFile W32_NAMESPACE (CloseNetworksFile)
38#define GetNetFile W32_NAMESPACE (GetNetFile)
39
40#define InitEthersFile W32_NAMESPACE (InitEthersFile)
41#define ReadEthersFile W32_NAMESPACE (ReadEthersFile)
42#define GetEthersFile W32_NAMESPACE (GetEthersFile)
43#define GetEtherName W32_NAMESPACE (GetEtherName)
44#define NumEtherEntries W32_NAMESPACE (NumEtherEntries)
45
46#define DumpHostsCache W32_NAMESPACE (DumpHostsCache)
47#define DumpHosts6Cache W32_NAMESPACE (DumpHosts6Cache)
48#define DumpEthersCache W32_NAMESPACE (DumpEthersCache)
49
53struct _hostent {
54 char *h_name; /* official name of host */
55 char *h_aliases[MAX_HOST_ALIASES+1]; /* hostname alias list */
56 int h_num_addr; /* how many real addr below */
57 DWORD h_address[MAX_ADDRESSES+1]; /* addresses (network order) */
58 DWORD h_real_ttl; /* TTL from udp_dom.c */
59 time_t h_timeout; /* cached entry expiry time */
60 struct _hostent *h_next; /* next entry (or NULL) */
61};
62
66struct _hostent6 {
67 char *h_name; /* official name of host */
68 char *h_aliases[MAX_HOST_ALIASES+1]; /* hostname alias list */
69 int h_num_addr; /* how many real addr below */
70 ip6_address h_address[MAX_ADDRESSES+1]; /* addresses */
71 DWORD h_real_ttl; /* TTL from udp_dom.c */
72 time_t h_timeout; /* cached entry expiry time */
73 struct _hostent6 *h_next;
74};
75
79struct _netent {
80 char *n_name; /* official name of net */
81 char *n_aliases [MAX_NETENT_ALIASES+1]; /* alias list */
82 int n_addrtype; /* net address type */
83 DWORD n_net; /* network (host order) */
84 struct _netent *n_next;
85};
86
90struct _protoent {
91 char *p_name;
92 char *p_aliases [MAX_PROTO_ALIASES+1];
93 int p_proto;
94 struct _protoent *p_next;
95};
96
100struct _servent {
101 char *s_name;
102 char *s_aliases [MAX_SERV_ALIASES+1];
103 int s_port;
104 char *s_proto;
105 struct _servent *s_next;
106};
107
108extern BOOL called_from_getai;
109extern unsigned netdbCacheLife;
110
111/* These are not in any ./inc headers (<netdb.h> etc.). We export
112 * them anyway since they could come in handy. Now, only ./bin/tcpinfo.c
113 * uses some of them.
114 */
115
116W32_FUNC void W32_CALL ReadHostsFile (const char *fname); /* gethost.c */
117W32_FUNC void W32_CALL ReadServFile (const char *fname); /* getserv.c */
118W32_FUNC void W32_CALL ReadProtoFile (const char *fname); /* getprot.c */
119W32_FUNC void W32_CALL ReadNetworksFile (const char *fname); /* getnet.c */
120W32_FUNC void W32_CALL ReadEthersFile (void); /* geteth.c */
121W32_FUNC int W32_CALL NumEtherEntries (void); /* geteth.c */
122W32_FUNC void W32_CALL InitEthersFile (const char *fname); /* geteth.c */
123
124W32_FUNC void W32_CALL CloseHostFile (void);
125W32_FUNC void W32_CALL CloseServFile (void);
126W32_FUNC void W32_CALL CloseProtoFile (void);
127W32_FUNC void W32_CALL CloseNetworksFile(void);
128
129W32_FUNC const char *W32_CALL GetHostsFile (void);
130W32_FUNC const char *W32_CALL GetServFile (void);
131W32_FUNC const char *W32_CALL GetProtoFile (void);
132W32_FUNC const char *W32_CALL GetNetFile (void);
133W32_FUNC const char *W32_CALL GetEthersFile(void);
134W32_FUNC const char *W32_CALL GetEtherName (const eth_address *eth);
135
136W32_FUNC void W32_CALL DumpHostsCache (void);
137W32_FUNC void W32_CALL DumpEthersCache (void);
138
139W32_FUNC void W32_CALL ReopenHostFile (void);
140W32_FUNC void W32_CALL ReopenNetworksFile (void);
141W32_FUNC void W32_CALL ReopenProtoFile (void);
142W32_FUNC void W32_CALL ReopenServFile (void);
143
144#if defined(USE_BSD_API) && defined(USE_IPV6) /* gethost6.c */
145 W32_FUNC void W32_CALL ReadHosts6File (const char *fname);
146 W32_FUNC void W32_CALL CloseHost6File (void);
147 W32_FUNC void W32_CALL DumpHosts6Cache (void);
148 W32_FUNC const char *W32_CALL GetHosts6File (void);
149 W32_FUNC void W32_CALL ReopenHost6File (void);
150#endif
151
152#endif
GetHostsFile
W32_FUNC const char *W32_CALL GetHostsFile(void)
Return name of hosts-file.
Definition: gethost.c:186
ReopenHostFile
W32_FUNC void W32_CALL ReopenHostFile(void)
Reopen hosts-file.
Definition: gethost.c:207
ReadEthersFile
W32_FUNC void W32_CALL ReadEthersFile(void)
Read the /etc/ethers file.
Definition: geteth.c:101
CloseHostFile
W32_FUNC void W32_CALL CloseHostFile(void)
Close hosts-file.
Definition: gethost.c:196
netdb.h
_hostent6
Definition: get_xby.h:66
_hostent
Definition: get_xby.h:53
_netent
Definition: get_xby.h:79
_protoent
Definition: get_xby.h:90
_servent
Definition: get_xby.h:100


Watt-32 tcp/ip: E:/WATT/src/geteth.c Source File

  • src
geteth.c
Go to the documentation of this file.
1
6/* Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Gisle Vanem
19 * Bergen, Norway.
20 *
21 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 *
33 * 28.apr 2000 - Created
34 */
35
36#include <stdio.h>
37#include <stdlib.h>
38#include <string.h>
39
40#include "wattcp.h"
41#include "misc.h"
42#include "misc_str.h"
43#include "run.h"
44#include "pcarp.h"
45#include "pcconfig.h"
46#include "pcdns.h"
47#include "pcdbug.h"
48#include "netaddr.h"
49#include "bsddbug.h"
50#include "get_xby.h"
51
52#if defined(USE_BSD_API)
53
54#include <net/if.h>
55#include <net/if_arp.h>
56#include <net/if_dl.h>
57#include <net/if_ether.h>
58#include <net/route.h>
59
60#if defined(TEST_PROG)
61 #undef SOCK_DEBUGF
62 #define SOCK_DEBUGF(args) printf args
63#endif
64
65struct ethent {
66 eth_address eth_addr; /* ether/MAC address of host */
67 DWORD ip_addr; /* IP-address (host order) */
68 char *name; /* host-name for IP-address */
69 struct ethent *next;
70 };
71
72static struct ethent *eth0 = NULL;
73static int num_entries = -1;
74static char ethersFname [MAX_PATHLEN] = "";
75
76static void W32_CALL end_ether_entries (void);
77static int get_ether_entry (char *in_buf, eth_address *e,
78 char *out_buf, size_t out_buf_size);
79
80void W32_CALL InitEthersFile (const char *fname)
81{
82 if (fname && *fname)
83 _strlcpy (ethersFname, fname, sizeof(ethersFname));
84}
85
86const char * W32_CALL GetEthersFile (void)
87{
88 return (ethersFname[0] ? ethersFname : NULL);
89}
90
91int W32_CALL NumEtherEntries (void)
92{
93 return (num_entries);
94}
95
101void W32_CALL ReadEthersFile (void)
102{
103 FILE *file;
104 char buf [2*MAX_HOSTLEN];
105
106 if (!ethersFname[0])
107 return;
108
109 file = fopen (ethersFname, "rt");
110 if (!file)
111 {
112 netdb_warn (ethersFname);
113 return;
114 }
115
116 while (fgets(buf,sizeof(buf),file))
117 {
118 struct ethent *e;
119 struct hostent *h;
120 char host_ip [MAX_HOSTLEN];
121 int save;
122 eth_address eth;
123
124 if (!get_ether_entry(buf, &eth, host_ip, sizeof(host_ip)))
125 continue;
126
127 if (num_entries == -1)
128 num_entries = 0;
129 num_entries++;
130
131 save = called_from_resolve;
132 called_from_resolve = TRUE; /* prevent a DNS lookup */
133 h = gethostbyname (host_ip);
134 called_from_resolve = save;
135
136 /* If 'h == NULL': means 'host_ip' contained a host-name that cannot be resolved
137 * at this moment. gethostbyname()+resolve() cannot be called at startup.
138 * If 'h != NULL': means 'host_ip' is simply an IPv4-address or a host-name (or alias)
139 * that is in '/etc/hosts' file.
140 */
141 if (!h)
142 {
143 TRACE_CONSOLE (4, "ReadEthersFile(): gethostbyname() failed\n");
144 continue;
145 }
146 TRACE_CONSOLE (4, "\n");
147
148 e = calloc (sizeof(*e), 1);
149 if (!e)
150 break;
151
152 e->ip_addr = ntohl (*(DWORD*)h->h_addr);
153 memcpy (&e->eth_addr, &eth, sizeof(e->eth_addr));
154
155 /* Add this to the permanent ARP-cache.
156 */
157 _arp_cache_add (e->ip_addr, &e->eth_addr, FALSE);
158
159 if (h->h_name)
160 {
161 e->name = strdup (h->h_name);
162 if (!e->name)
163 break;
164 }
165 e->next = eth0;
166 eth0 = e;
167 }
168
169 fclose (file);
170 RUNDOWN_ADD (end_ether_entries, 250);
171}
172
173/*
174 * Parse a string of text containing an ethernet address and
175 * hostname/IP-address and separate it into its component parts.
176 * E.g.
177 * in_buf -> "88-87-17-17-5a-3e 10.0.0.4"
178 * in_buf -> "E0-CA-94-3D-74-F0 printer"
179 */
180#define MIN_LEN sizeof("0:0:0:0:0:0 a.b.c.d")
181
182static int get_ether_entry (char *in_buf, eth_address *e,
183 char *name, size_t name_max)
184{
185 size_t len, i;
186 unsigned eth [sizeof(*e)];
187 BOOL ok, colon;
188 char *token = strltrim (in_buf);
189 char *ip_name;
190 char *tok_buf = NULL;
191
192 if (*token == '#' || *token == ';' || *token == '\n' || strlen(token) < MIN_LEN)
193 return (0);
194
195 colon = (token[2] == ':');
196
197 ok = colon ? (sscanf(token, "%02x:%02x:%02x:%02x:%02x:%02x",
198 &eth[0], &eth[1], &eth[2],
199 &eth[3], &eth[4], &eth[5]) == DIM(eth)) :
200 (sscanf(token, "%02x-%02x-%02x-%02x-%02x-%02x",
201 &eth[0], &eth[1], &eth[2],
202 &eth[3], &eth[4], &eth[5]) == DIM(eth));
203 if (!ok)
204 {
205 TRACE_CONSOLE (1, "get_ether_entry(): sscanf() failed\n");
206 return (0);
207 }
208
209 token = strtok_r (token, " \t", &tok_buf);
210 ip_name = strtok_r (NULL, " #\t\n", &tok_buf);
211
212 if (!token || !ip_name || (len = strlen(ip_name)) < 1 || len > name_max)
213 {
214 TRACE_CONSOLE (1, "get_ether_entry(): short line or malformed ip_name '%s'\n", ip_name);
215 return (0);
216 }
217
218 ip_name = (char*) expand_var_str (ip_name);
219
220 _strlcpy (name, ip_name, name_max);
221
222 for (i = 0; i < sizeof(*e); i++)
223 ((BYTE*)e)[i] = eth[i];
224
225 TRACE_CONSOLE (4, "get_ether_entry(): ip: %s, eth: %02X:%02X:%02X:%02X:%02X:%02X\n",
226 ip_name, eth[0],eth[1],eth[2],eth[3],eth[4],eth[5]);
227
228 return (1);
229}
230
231/*
232 * Free memory in 'eth0' array
233 */
234static void W32_CALL end_ether_entries (void)
235{
236 struct ethent *e, *next;
237
238 if (_watt_fatal_error)
239 return;
240
241 for (e = eth0; e; e = next)
242 {
243 DO_FREE (e->name);
244 next = e->next;
245 free (e);
246 }
247 eth0 = NULL;
248 num_entries = 0;
249}
250
251void W32_CALL DumpEthersCache (void)
252{
253 const struct ethent *e;
254
255 if (!ethersFname[0])
256 {
257 SOCK_DEBUGF (("\nNo ETHERS line found in WATTCP.CFG\n"));
258 return;
259 }
260
261 SOCK_DEBUGF (("\n%s entries:\n", ethersFname));
262 for (e = eth0; e; e = e->next)
263 SOCK_DEBUGF ((" %s = %-15.15s (%s)\n",
264 MAC_address(&e->eth_addr), _inet_ntoa(NULL,e->ip_addr),
265 e->name ? e->name : "none"));
266}
267#endif /* USE_BSD_API */
268
269/*
270 * Find the name associated with ether-addr 'eth'.
271 * Returns null if not found in 'eth0' list.
272 */
273const char * W32_CALL GetEtherName (const eth_address *eth)
274{
275#if defined(USE_BSD_API)
276 const struct ethent *e;
277
278 for (e = eth0; e; e = e->next)
279 if (!memcmp(eth, e->eth_addr, sizeof(*eth)))
280 return (e->name);
281#endif
282 ARGSUSED (eth);
283 return (NULL);
284}
285
286#if defined(TEST_PROG)
287
288#include "pcdbug.h"
289#include "sock_ini.h"
290
291int main (void)
292{
293#if defined(USE_BSD_API)
294 debug_on = 2;
295 dbug_init();
296 sock_init();
297 DumpEthersCache();
298
299#else
300 puts ("\"USE_BSD_API\" not defined");
301#endif /* USE_BSD_API */
302 return (0);
303}
304#endif /* TEST_PROG */
bsddbug.h
get_xby.h
ReadEthersFile
void W32_CALL ReadEthersFile(void)
Read the /etc/ethers file.
Definition: geteth.c:101
if.h
if_arp.h
if_dl.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
MAC_address
const char * MAC_address(const void *addr)
Return hexa-decimal string for an 6/7 byte MAC-address.
Definition: misc.c:997
misc.h
strltrim
char * strltrim(char *s)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
_arp_cache_add
BOOL W32_CALL _arp_cache_add(DWORD ip, const void *eth, BOOL expires)
Add given IP/Ether address to ARP-cache.
Definition: pcarp.c:1351
pcarp.h
expand_var_str
const char * expand_var_str(const char *str)
Return a string with a environment variable expanded (only one).
Definition: pcconfig.c:234
pcconfig.h
pcdbug.h
called_from_resolve
BOOL called_from_resolve
Hacks to make gethostbyname() and resolve() cooperate.
Definition: pcdns.c:60
pcdns.h
route.h
sock_ini.h
ethent
Definition: geteth.c:65
hostent
Definition: netdb.h:104
token
Definition: pcdbug.c:1473
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/gethost6.c Source File

  • src
gethost6.c
Go to the documentation of this file.
1
6/*
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 *
34 * 03.Aug 2002 (GV) - Created
35 */
36
37#include <stdio.h>
38#include <stdlib.h>
39#include <string.h>
40#include <ctype.h>
41#include <time.h>
42#include <netdb.h>
43#include <arpa/nameser.h>
44#include <arpa/inet.h>
45#include <netinet/in.h>
46#include <resolv.h>
47
48#include "wattcp.h"
49#include "misc.h"
50#include "misc_str.h"
51#include "run.h"
52#include "timer.h"
53#include "language.h"
54#include "ip6_out.h"
55#include "pcconfig.h"
56#include "pctcp.h"
57#include "netaddr.h"
58#include "bsdname.h"
59#include "bsddbug.h"
60#include "pcdns.h"
61#include "get_xby.h"
62
63/* \if USE_IPV6 */
64#if defined(USE_BSD_API) && defined(USE_IPV6)
65
66static char *host6Fname = NULL;
67static FILE *host6file = NULL;
68static BOOL hostClose = FALSE;
69static struct _hostent6 *host0 = NULL;
70
71static BOOL did_lookup = FALSE; /* tried a DNS lookup */
72static BOOL is_addr = FALSE; /* name is simply an IPv6 address */
73
74static BOOL gethostbyname6_internal (const char *name,
75 const char **alias,
76 struct _hostent6 *ret);
77
78static BOOL gethostbyaddr6_internal (const char *addr,
79 struct _hostent6 *ret);
80
81static struct hostent *fill_hostent6 (const struct _hostent6 *h);
82
83static struct _hostent6 *add_hostent6 (struct _hostent6 *h,
84 const char *name,
85 const char *cname,
86 const void *addr_list,
87 const void *addr,
88 DWORD ttl);
89
90static void W32_CALL _endhostent6 (void)
91{
92 endhostent6();
93}
94
95void W32_CALL ReadHosts6File (const char *fname)
96{
97 static BOOL been_here = FALSE;
98
99 if (!fname || !*fname)
100 return;
101
102 if (been_here) /* loading multiple hosts6 files */
103 {
104 free (host6Fname);
105 CloseHost6File();
106 }
107
108 host6Fname = strdup (fname);
109 if (!host6Fname)
110 return;
111
112 sethostent6 (1);
113 if (!host6file)
114 return;
115
116 been_here = TRUE;
117
118 while (1)
119 {
120 struct hostent *h = gethostent6();
121 struct _hostent6 *h2;
122 int i;
123
124 if (!h)
125 break;
126
127 h2 = calloc (sizeof(*h2), 1);
128 if (!h2)
129 {
130 (*_printf) (_LANG("%s too big!\n"), host6Fname);
131 break;
132 }
133 for (i = 0; h->h_aliases[i]; i++)
134 h2->h_aliases[i] = strdup (h->h_aliases[i]);
135 memcpy (&h2->h_address[0], h->h_addr_list[0], sizeof(h2->h_address[0]));
136 h2->h_num_addr = 1;
137 h2->h_name = strdup (h->h_name);
138 h2->h_timeout = 0; /* don't expire */
139 h2->h_real_ttl = 0;
140 if (!h2->h_name)
141 break;
142
143 h2->h_next = host0;
144 host0 = h2;
145 }
146
147#if 0 /* test !! */
148 {
149 const struct _hostent6 *h;
150 int i;
151
152 printf ("\n%s entries:\n", host6Fname);
153 for (h = host0; h; h = h->h_next)
154 {
155 printf ("address %-40.40s name %-30.30s Aliases:",
156 _inet6_ntoa(&h->h_address[0]), h->h_name);
157 for (i = 0; h->h_aliases[i]; i++)
158 printf (" %s,", h->h_aliases[i]);
159 puts ("");
160 }
161 fflush (stdout);
162 }
163#endif
164
165 rewind (host6file);
166 RUNDOWN_ADD (_endhostent6, 256);
167}
168
169const char * W32_CALL GetHosts6File (void)
170{
171 return (host6Fname);
172}
173
174/*
175 * To prevent running out of file-handles, one should close the
176 * 'hosts' file before spawning a new shell.
177 */
178void W32_CALL CloseHost6File (void)
179{
180 if (!host6file)
181 return;
182 fclose (host6file);
183 host6file = NULL;
184}
185
186void W32_CALL ReopenHost6File (void)
187{
188 ReadHosts6File (host6Fname);
189}
190
191/*
192 * Return the next (non-commented) line from the host6-file
193 * Format is:
194 * IPv6-address [=] host-name [alias..] {\n | # ..}
195 */
196struct hostent * W32_CALL gethostent6 (void)
197{
198 struct _hostent6 h;
199 char *tok, *ip, *name, *alias, *tok_buf = NULL;
200 char buf [2*MAX_HOSTLEN];
201 int i;
202
203 if (!netdb_init() || !host6file)
204 {
205 h_errno = NO_RECOVERY;
206 return (NULL);
207 }
208
209 memset (&h, 0, sizeof(h));
210
211 while (1)
212 {
213 if (!fgets(buf, sizeof(buf), host6file))
214 return (NULL);
215
216 tok = strltrim (buf);
217 if (*tok == '#' || *tok == ';' || *tok == '\n')
218 continue;
219
220 ip = strtok_r (tok, " \t", &tok_buf);
221 name = strtok_r (NULL, " \t\n", &tok_buf);
222 if (ip && name && inet_pton(AF_INET6, ip, &h.h_address[0]) == 1)
223 break;
224 }
225
226 if (hostClose)
227 endhostent6();
228
229 h.h_num_addr = 1;
230 h.h_name = name;
231 alias = strtok_r (NULL, " \t\n", &tok_buf);
232
233 for (i = 0; alias && i < MAX_HOST_ALIASES; i++)
234 {
235 static char aliases [MAX_HOST_ALIASES][MAX_HOSTLEN];
236
237 if (*alias == '#' || *alias == ';')
238 break;
239
240 h.h_aliases[i] = _strlcpy (aliases[i], alias, sizeof(aliases[i]));
241 alias = strtok_r (NULL, " \t\n", &tok_buf);
242 }
243 return fill_hostent6 (&h);
244}
245
246/*------------------------------------------------------------------*/
247
248struct hostent * W32_CALL gethostbyname6 (const char *name)
249{
250 struct _hostent6 h;
251 const char *alias;
252
253 SOCK_DEBUGF (("\ngethostbyname6: `%s'", name));
254 is_addr = FALSE;
255
256 if (gethostbyname6_internal(name, &alias, &h))
257 {
258#if defined(USE_DEBUG)
259 int i;
260 for (i = 0; i < h.h_num_addr; i++)
261 SOCK_DEBUGF ((" %s,", _inet6_ntoa(&h.h_address[i])));
262
263 if (!did_lookup)
264 SOCK_DEBUGF ((" %s", is_addr ? "" :
265 h.h_timeout ? "cached" :
266 "hosts6-file"));
267 if (alias)
268 SOCK_DEBUGF ((" (alias %s)", alias));
269#endif
270 return fill_hostent6 (&h);
271 }
272
273 SOCK_DEBUGF ((", failed (%s)", did_lookup ? dom_strerror(dom_errno) :
274 hstrerror(h_errno)));
275 return (NULL);
276}
277
278static BOOL gethostbyname6_internal (const char *name, const char **alias,
279 struct _hostent6 *ret)
280{
281 static char our_name[MAX_HOSTLEN];
282 struct in6_addr addr;
283 struct _hostent6 *h;
284 time_t now;
285 int rc;
286
287 h_errno = HOST_NOT_FOUND;
288 did_lookup = FALSE;
289
290 _resolve_exit = _resolve_timeout = 0;
291 memset (ret, 0, sizeof(*ret));
292 *alias = NULL;
293
294 if (!netdb_init() || !name)
295 {
296 h_errno = NO_RECOVERY;
297 return (FALSE);
298 }
299
300 if (inet_pton(AF_INET6,name,&addr) == 1)
301 {
302 ret->h_name = (char*) name;
303 memcpy (&ret->h_address[0], &addr, sizeof(ret->h_address[0]));
304 is_addr = TRUE;
305 return (TRUE);
306 }
307
308 now = time (NULL);
309
310 for (h = host0; h; h = h->h_next)
311 {
312 int i;
313
314 if (h->h_name && !stricmp(h->h_name, name))
315 {
316 /* if cached entry expired, do DNS lookup
317 */
318 if (h->h_timeout && now > h->h_timeout)
319 goto expired;
320
321 if (IN6_ARE_ADDR_EQUAL(&h->h_address[0], &in6addr_all_1))
322 return (FALSE);
323
324 *ret = *h;
325 return (TRUE);
326 }
327 for (i = 0; i < MAX_HOST_ALIASES && h->h_aliases[i]; i++)
328 if (!stricmp(name, h->h_aliases[i]))
329 {
330 if (h->h_timeout && now > h->h_timeout)
331 goto expired;
332
333 if (IN6_ARE_ADDR_EQUAL(&h->h_address[0], &in6addr_all_1))
334 return (FALSE);
335 *alias = h->h_aliases[i];
336 *ret = *h;
337 return (TRUE);
338 }
339 }
340
341 /* Not found in linked list (hosts6 file or cache). Check name
342 * against our own host-name (short-name or FQDN)
343 */
344 if (hostname[0] && !stricmp(name, hostname))
345 {
346 memcpy (&ret->h_address[0], &in6addr_my_ip, sizeof(ret->h_address[0]));
347 ret->h_num_addr = 1;
348 ret->h_name = hostname;
349 return (TRUE);
350 }
351
352 if (!gethostname(our_name, sizeof(our_name)) && !stricmp(name, our_name))
353 {
354 memcpy (&ret->h_address[0], &in6addr_my_ip, sizeof(ret->h_address[0]));
355 ret->h_num_addr = 1;
356 ret->h_name = our_name;
357 return (TRUE);
358 }
359
360expired:
361
362 /* do a full DNS lookup
363 */
364 rc = resolve_ip6 (name, &addr);
365 did_lookup = TRUE;
366
367 if (_resolve_exit || /* interrupted by _resolve_hook() */
368 _resolve_timeout) /* timed out resolving */
369 return (FALSE);
370
371 if (rc) /* successfully resolved */
372 {
373 h = add_hostent6 (h, name, dom_cname, &dom_a6list, &addr, dom_ttl);
374 if (h)
375 *ret = *h;
376 return (h ? TRUE : FALSE);
377 }
378
379 /* Add the IP to the list even if DNS failed (but not interrupted by
380 * _resolve_hook() or timedout). Thus the next call to gethostbyxxx6()
381 * will return immediately.
382 */
383 add_hostent6 (h, name, NULL, NULL, &in6addr_all_1, netdbCacheLife);
384 return (FALSE);
385}
386
387/*------------------------------------------------------------------*/
388
389void W32_CALL sethostent6 (int stayopen)
390{
391 hostClose = (stayopen == 0);
392 if (!netdb_init() || !host6Fname)
393 return;
394
395 if (!host6file)
396 host6file = fopen (host6Fname, "rt");
397 else rewind (host6file);
398}
399
400/*------------------------------------------------------------------*/
401
402void W32_CALL endhostent6 (void)
403{
404 struct _hostent6 *h, *next;
405
406 if (_watt_fatal_error)
407 return;
408
409 if (host6Fname)
410 free (host6Fname);
411 host6Fname = NULL;
412 CloseHost6File();
413
414 for (h = host0; h; h = next)
415 {
416 int i;
417 for (i = 0; h->h_aliases[i]; i++)
418 free (h->h_aliases[i]);
419 next = h->h_next;
420 free (h->h_name);
421 free (h);
422 }
423 host0 = NULL;
424 hostClose = TRUE;
425}
426
427/*
428 * Return a 'struct hostent *' for an IPv6 address.
429 */
430struct hostent * W32_CALL gethostbyaddr6 (const void *addr)
431{
432 struct _hostent6 h;
433
434 SOCK_DEBUGF (("\ngethostbyaddr6: %s", _inet6_ntoa(addr)));
435
436 if (gethostbyaddr6_internal (addr, &h))
437 {
438 SOCK_DEBUGF ((" `%s'", h.h_name));
439 if (!did_lookup)
440 SOCK_DEBUGF ((", %s", h.h_timeout ? "cached" : "hosts-file"));
441 return fill_hostent6 (&h);
442 }
443
444 SOCK_DEBUGF ((", failed (%s) ", did_lookup ? dom_strerror(dom_errno) :
445 hstrerror(h_errno)));
446 return (NULL);
447}
448
449static BOOL gethostbyaddr6_internal (const char *addr, struct _hostent6 *ret)
450{
451 static char name [MAX_HOSTLEN];
452 struct _hostent6 *h;
453 ip6_address ip;
454 time_t now;
455 int rc;
456
457 h_errno = HOST_NOT_FOUND;
458 did_lookup = FALSE;
459 _resolve_exit = _resolve_timeout = 0;
460 memset (ret, 0, sizeof(*ret));
461 memcpy (&ip, addr, sizeof(ip));
462
463 if (!netdb_init())
464 {
465 h_errno = NO_RECOVERY;
466 return (FALSE);
467 }
468
469 if ((IN6_ARE_ADDR_EQUAL(&ip, &in6addr_any) || /* :: -> in6addr_myip */
470 IN6_IS_ADDR_LINKLOCAL(&ip)) && /* FE8/119 */
471 gethostname(name, sizeof(name)) == 0)
472 {
473 memcpy (&ret->h_address[0], &in6addr_my_ip, sizeof(ret->h_address[0]));
474 ret->h_num_addr = 1;
475 ret->h_name = name;
476 return (TRUE);
477 }
478
479 now = time (NULL);
480
481 for (h = host0; h; h = h->h_next)
485 if (IN6_ARE_ADDR_EQUAL(&h->h_address[0], &ip))
486 {
487 /* if cached entry expired, do a new reverse lookup
488 */
489 if (h->h_timeout && now > h->h_timeout)
490 break;
491
492 *ret = *h;
493 return (TRUE);
494 }
495
496 /* do a reverse IPv6 lookup
497 */
498 did_lookup = TRUE;
499 rc = reverse_resolve_ip6 (&ip, name, sizeof(name));
500
501 /* interrupted or timedout
502 */
503 if (!rc && (_resolve_exit || _resolve_timeout))
504 return (FALSE);
505
506 if (rc) /* successfully resolved */
507 {
508 h = add_hostent6 (h, name, NULL, NULL, &ip, dom_ttl);
509 if (h)
510 *ret = *h;
511
513 return (h ? TRUE : FALSE);
514 }
515
516 /* Add the IP to the list even if reverse lookup failed and not
517 * interrupted by _resolve_hook(). Thus the next call to gethostbyxx()
518 * will return immediately.
519 */
520 add_hostent6 (h, "*unknown*", NULL, NULL, &ip, 0UL);
521 return (FALSE);
522}
523
524/*
525 * Return a 'struct hostent*' from an internal 'struct _hostent6*'
526 */
527static struct hostent *fill_hostent6 (const struct _hostent6 *h)
528{
529 static struct hostent ret;
530 static struct in6_addr addr [MAX_ADDRESSES+1];
531 static char *list [MAX_ADDRESSES+1];
532 static char _hostname [MAX_HOSTLEN];
533 static char *_aliases [MAX_HOST_ALIASES+1];
534 int i;
535
536 if (!h->h_name)
537 return (NULL);
538
539 memset (&addr, 0, sizeof(addr));
540 memcpy (&_aliases, h->h_aliases, sizeof(_aliases));
541
542 for (i = 0; i < h->h_num_addr && i < MAX_ADDRESSES; i++)
543 {
544 memcpy (&addr[i].s6_addr, &h->h_address[i], sizeof(addr[i].s6_addr));
545 list[i] = (char*) &addr[i];
546 }
547
548 list[i] = NULL;
549 ret.h_addr_list = list;
550 ret.h_name = _strlcpy (_hostname, h->h_name, sizeof(_hostname));
551 ret.h_aliases = _aliases;
552 ret.h_addrtype = AF_INET6;
553 ret.h_length = sizeof (addr[0].s6_addr);
554 h_errno = NETDB_SUCCESS;
555 return (&ret);
556}
557
558/*
559 * Modify an expired cached entry or add a new node to
560 * the linked list. Not used for entries in hosts-file.
561 */
562static struct _hostent6 *add_hostent6 (
563 struct _hostent6 *h,
564 const char *name,
565 const char *cname, /* Canonical name (CNAME) */
566 const void *alist, /* List of alternate addr */
567 const void *addr, /* Main IP6-address */
568 DWORD ttl) /* Time-to-live (sec) */
569{
570 DWORD real_ttl = ttl;
571 int i;
572
573 ttl = min (ttl, netdbCacheLife); /* clamp the TTL */
574
575 if (h) /* reuse expired entry */
576 {
577 if (h->h_name)
578 free (h->h_name);
579 if (h->h_aliases[0])
580 free (h->h_aliases[0]); /* !! max 1 alias */
581 memset (&h->h_address[1], 0, /* clear old addresses */
582 sizeof(h->h_address) - sizeof(ip6_address));
583 h->h_aliases[0] = NULL;
584 }
585 else /* create a new node */
586 {
587 h = calloc (sizeof(*h), 1);
588 if (h)
589 {
590 h->h_next = host0;
591 host0 = h;
592 }
593 }
594
595 if (!cname || !cname[0])
596 cname = NULL;
597
598 if (addr != &in6addr_all_1)
599 SOCK_DEBUGF ((", CNAME %s, ttl %lus,",
600 cname ? cname : "<none>", (long unsigned int)real_ttl));
601 if (h)
602 {
603 const ip6_address *a6list = (const ip6_address*) alist;
604
605 h->h_timeout = ttl ? time (NULL) + ttl : 0;
606 h->h_real_ttl = real_ttl;
607 h->h_num_addr = 1;
608 memcpy (&h->h_address[0], addr, sizeof(h->h_address[0]));
609 for (i = 0; a6list && !IN6_IS_ADDR_UNSPECIFIED(a6list[i]); i++)
610 {
611 memcpy (&h->h_address[i+1], a6list[i], sizeof(ip6_address));
612 h->h_num_addr++;
613 }
614 if (cname) /* swap name with CNAME */
615 {
616 h->h_name = strdup (cname);
617 h->h_aliases[0] = strdup (name); /* !! only allow 1 alias */
618 }
619 else
620 h->h_name = strdup (name);
621 }
622 else
623 SOCK_DEBUGF ((" ENOMEM"));
624
625 return (h);
626}
627
628#if defined(USE_DEBUG)
629/*
630 * Reverse the 'host0' list before printing it (a bit nicer and intuitive).
631 * I.e. on same order the host-names where put in the list by add_hostent().
632 */
633static BOOL ReverseHosts6List (void)
634{
635 struct _hostent6 *h, **list;
636 int i, num_total, num_dynamic;
637
638 for (h = host0, num_total = num_dynamic = 0; h; h = h->h_next)
639 {
640 num_total++;
641 if (h->h_timeout > 0)
642 num_dynamic++;
643 }
644 if (num_total == 0 || num_dynamic == 0)
645 return (FALSE);
646
647 list = malloc (num_total * sizeof(*list));
648 if (!list)
649 return (FALSE);
650
651 for (h = host0, i = 0; h; h = h->h_next)
652 list[i++] = h;
653
654 for (host0 = NULL, i = 0; i < num_total; i++)
655 {
656 h = list[i];
657 h->h_next = host0;
658 host0 = h;
659 }
660 free (list);
661 return (TRUE);
662}
663
664void W32_CALL DumpHosts6Cache (void)
665{
666 struct _hostent6 *h;
667 time_t now;
668
669 if (!ReverseHosts6List())
670 return;
671
672 SOCK_DEBUGF ((" \n\nCached IPv6 hosts: "
673 "Address TTL Alias\n"));
674 now = time (NULL);
675
676 for (h = host0; h; h = h->h_next)
677 {
678 const char *addr;
679 int i;
680 long dT;
681
682 if (h->h_real_ttl == 0) /* skip static records */
683 continue;
684
685 dT = (long)(h->h_timeout - now);
686 if (IN6_ARE_ADDR_EQUAL(&h->h_address[0], &in6addr_all_1))
687 addr = "::";
688 else addr = _inet6_ntoa (&h->h_address[0]);
689
690 SOCK_DEBUGF ((" %-50s %-40s %8s ", h->h_name, addr,
691 dT < 0 ? "timedout" : hms_str(h->h_real_ttl)));
692
693 for (i = 0; h->h_aliases[i]; i++)
694 SOCK_DEBUGF (("%s ", h->h_aliases[i]));
695 if (i == 0)
696 SOCK_DEBUGF (("<none>\n"));
697 else SOCK_DEBUGF ((" \n"));
698
699 for (i = 1; i < h->h_num_addr; i++)
700 SOCK_DEBUGF (("%62s %s\n", "", _inet6_ntoa(&h->h_address[i])));
701
702 }
703}
704#endif /* USE_DEBUG */
705#endif /* USE_BSD_API && USE_IPV6 */
706
707/*------------------------------------------------------------------*/
708
709#if defined(TEST_PROG)
710#if !defined(USE_BSD_API) || !defined(USE_IPV6)
711int main (void)
712{
713 puts ("This program needs '#define USE_BSD_API' and '#define USE_IPV6'");
714 return (1);
715}
716#else /* rest of file */
717
718#include "pcdbug.h"
719#include "sock_ini.h"
720
721/*
722 * Print list of hosts unsorted.
723 */
724static void print_hosts (void)
725{
726 const struct _hostent6 *h;
727
728 for (h = host0; h; h = h->h_next)
729 {
730 int i;
731 printf ("%-40s -> %s; Aliases:", _inet6_ntoa(&h->h_address), h->h_name);
732
733 for (i = 0; h->h_aliases[i]; i++)
734 printf (" %s,", h->h_aliases[i]);
735 puts ("");
736 }
737 fflush (stdout);
738}
739
740int main (void)
741{
742 dbug_init();
743 sock_init();
744 print_hosts();
745 return (0);
746}
747#endif /* USE_BSD_API && USE_IPV6 */
748#endif /* TEST_PROG */
749
750/* \endif */
751
bsddbug.h
bsdname.h
get_xby.h
gethostbyaddr6_internal
static BOOL gethostbyaddr6_internal(const char *addr, struct _hostent6 *ret)
Definition: gethost6.c:449
in.h
inet.h
ip6_out.h
language.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
misc.h
strltrim
char * strltrim(char *s)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
nameser.h
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
netaddr.h
netdb.h
netdb_init
int netdb_init(void)
Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise thing...
Definition: pcconfig.c:1284
pcconfig.h
pcdbug.h
dom_strerror
const char *W32_CALL dom_strerror(int err)
Return text for error code (dom_errno).
Definition: pcdns.c:742
pcdns.h
hostname
char hostname[MAX_HOSTLEN+1]
Our configured hostname.
Definition: pctcp.c:58
pctcp.h
inet_pton
int W32_CALL inet_pton(int af, const char *src, void *dst)
Convert from presentation format (which usually means ASCII printable) to network format (which is us...
Definition: presaddr.c:73
resolv.h
sock_ini.h
_hostent6
Definition: get_xby.h:66
hostent
Definition: netdb.h:104
in6_addr
Definition: in.h:151
tok
Definition: oui-generated.c:13
hms_str
const char * hms_str(DWORD sec)
Return string "HH:MM:SS" for a time in seconds.
Definition: timer.c:715
timer.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/gethost.c Source File

  • src
gethost.c
Go to the documentation of this file.
1
6/*
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 *
34 * 18.aug 1996 (GV) - Created
35 * 02.dec 1997 (GV) - Integrated with resolve()
36 * 05.jan 1998 (GV) - Added host cache functionality
37 * 18.may 1999 (GV) - Added timeout of cached values
38 *
39 * todo: support real host aliases as they come from the name server
40 * todo: accept "rooted FQDN" strings as normal FQDN strings.
41 * Note: "domain_name.com" and "domain_name.com." are equivalent
42 * (both are valid forms of fully qualified domain names (FQDNs);
43 * with the period, it is referred to as a rooted FQDN). Both forms
44 * should work with all mail clients and servers. However, using the
45 * trailing "." is rarely used (except in DNS maintenance).
46 *
47 * Note: if gethostbyname("some.host") returns address a.b.c.d, then
48 * a call to gethostbyaddr(a.b.c.d) will return "some.host"
49 * immediately (from cached info provided it didn't time out).
50 * This is contrary to most Unixes where the calls doesn't share
51 * the same information.
52 */
53
54#include <stdio.h>
55#include <stdlib.h>
56#include <string.h>
57#include <ctype.h>
58#include <time.h>
59#include <netdb.h>
60#include <arpa/inet.h>
61
62#include "wattcp.h"
63#include "misc.h"
64#include "misc_str.h"
65#include "run.h"
66#include "timer.h"
67#include "language.h"
68#include "pcconfig.h"
69#include "netaddr.h"
70#include "pctcp.h"
71#include "bsdname.h"
72#include "bsddbug.h"
73#include "pcdns.h"
74#include "get_xby.h"
75
76int h_errno = 0;
77
78#if defined(USE_BSD_API)
79
80unsigned netdbCacheLife = MAX_CACHE_LIFE;
81
82static char *hostFname = NULL;
83static FILE *hostFile = NULL;
84static BOOL hostClose = FALSE;
85static const char *from_where = NULL;
86static struct _hostent *host0 = NULL;
87
88static BOOL did_lookup = FALSE; /* tried a DNS lookup */
89static BOOL is_addr = FALSE; /* name is simply an IPv4 address */
90
91static BOOL gethostbyname_internal (const char *name,
92 const char **alias,
93 struct _hostent *ret);
94
95static BOOL gethostbyaddr_internal (const char *addr_name, int len, int type,
96 struct _hostent *ret);
97
98static struct hostent *fill_hostent (const struct _hostent *h);
99
100static struct _hostent *add_hostent (struct _hostent *h,
101 const char *name, const char *cname,
102 DWORD *alist, DWORD addr, DWORD ttl,
103 BOOL windns);
104
105static void W32_CALL _endhostent (void)
106{
107 endhostent();
108}
109
110void W32_CALL ReadHostsFile (const char *fname)
111{
112 static BOOL been_here = FALSE;
113
114 if (!fname || !*fname)
115 return;
116
117 if (been_here) /* loading multiple hosts files */
118 {
119 free (hostFname);
120 fclose (hostFile);
121 hostFile = NULL;
122 }
123
124 hostFname = strdup (fname);
125 if (!hostFname)
126 return;
127
128 sethostent (1);
129 if (!hostFile)
130 return;
131
132 been_here = TRUE;
133
134 while (1)
135 {
136 struct hostent *h = gethostent();
137 struct _hostent *h2;
138 int i;
139
140 if (!h)
141 break;
142
143 h2 = calloc (sizeof(*h2), 1);
144 if (!h2)
145 {
146 (*_printf) (_LANG("%s too big!\n"), hostFname);
147 break;
148 }
149
150 for (i = 0; h->h_aliases[i]; i++)
151 h2->h_aliases[i] = strdup (h->h_aliases[i]);
152 h2->h_name = strdup (h->h_name);
153 h2->h_address[0] = *(DWORD*) h->h_addr_list[0];
154 h2->h_num_addr = 1;
155 if (!h2->h_name)
156 break;
157 h2->h_next = host0;
158 host0 = h2;
159 }
160
161#if 0 /* test !! */
162 {
163 const struct _hostent *h;
164 int i;
165
166 printf ("\n%s entries:\n", hostFname);
167 for (h = host0; h; h = h->h_next)
168 {
169 printf ("address = %-17.17s name = %-30.30s Aliases:",
170 inet_ntoa(*(struct in_addr*)&h->h_address[0]), h->h_name);
171 for (i = 0; h->h_aliases[i]; i++)
172 printf (" %s,", h->h_aliases[i]);
173 puts ("");
174 }
175 fflush (stdout);
176 }
177#endif
178 rewind (hostFile);
179 RUNDOWN_ADD (_endhostent, 254);
180}
181
186const char * W32_CALL GetHostsFile (void)
187{
188 return (hostFname);
189}
190
196void W32_CALL CloseHostFile (void)
197{
198 if (hostFile)
199 fclose (hostFile);
200 hostFile = NULL;
201}
202
207void W32_CALL ReopenHostFile (void)
208{
209 ReadHostsFile (hostFname);
210}
211
219struct hostent *W32_CALL gethostent (void)
220{
221 struct _hostent h;
222 char *tok, *ip, *name, *alias, *tok_buf = NULL;
223 char buf [2*MAX_HOSTLEN];
224 int i;
225
226 if (!netdb_init() || !hostFile)
227 {
228 h_errno = NO_RECOVERY;
229 return (NULL);
230 }
231
232 while (1)
233 {
234 if (!fgets(buf,sizeof(buf), hostFile))
235 return (NULL);
236
237 tok = strltrim (buf);
238 if (*tok == '#' || *tok == ';' || *tok == '\n')
239 continue;
240
241 ip = strtok_r (tok, " \t", &tok_buf);
242 name = strtok_r (NULL, " \t\n", &tok_buf);
243 if (ip && name && isaddr(ip))
244 break;
245 }
246
247 if (hostClose)
248 endhostent();
249
250 memset (&h, 0, sizeof(h));
251 if (!strcmp(ip, "0.0.0.0")) /* inet_addr() maps 0 -> INADDR_NONE */
252 h.h_address[0] = INADDR_ANY;
253 else h.h_address[0] = inet_addr (ip);
254
255 h.h_num_addr = 1;
256 h.h_name = name;
257 alias = strtok_r (NULL, " \t\n", &tok_buf);
258
259 for (i = 0; alias && i < MAX_HOST_ALIASES; i++)
260 {
261 static char aliases [MAX_HOST_ALIASES][MAX_HOSTLEN];
262
263 if (*alias == '#' || *alias == ';')
264 break;
265
266 h.h_aliases[i] = _strlcpy (aliases[i], alias, sizeof(aliases[i]));
267 alias = strtok_r (NULL, " \t\n", &tok_buf);
268 }
269 return fill_hostent (&h);
270}
271
272/*
273 * Return a 'struct hostent *' for name.
274 */
275struct hostent * W32_CALL gethostbyname (const char *name)
276{
277 struct _hostent h;
278 const char *alias;
279
280 SOCK_DEBUGF (("\ngethostbyname: `%s'", name));
281 is_addr = FALSE;
282
283 if (gethostbyname_internal(name, &alias, &h))
284 {
285#if defined(USE_DEBUG)
286 int i;
287 for (i = 0; i < h.h_num_addr; i++)
288 SOCK_DEBUGF ((" %s,", inet_ntoa(*(struct in_addr*)&h.h_address[i])));
289
290 if (!did_lookup)
291 SOCK_DEBUGF ((" %s", is_addr ? "" :
292 h.h_timeout ? "cached" :
293 from_where ? from_where : "hosts-file"));
294 if (alias)
295 SOCK_DEBUGF ((" (alias %s)", alias));
296#endif
297 return fill_hostent (&h);
298 }
299
300 if (called_from_resolve)
301 SOCK_DEBUGF ((", unknown (called from resolve)"));
302 else SOCK_DEBUGF ((", failed (%s)", did_lookup ? dom_strerror(dom_errno) :
303 hstrerror(h_errno)));
304 return (NULL);
305}
306
307static BOOL gethostbyname_internal (const char *name, const char **alias,
308 struct _hostent *ret)
309{
310 static char our_name [MAX_HOSTLEN];
311 struct in_addr addr;
312 struct _hostent *h;
313 time_t now;
314 DWORD ip;
315
316 h_errno = HOST_NOT_FOUND;
317 did_lookup = FALSE;
318 from_where = NULL;
319
320 _resolve_exit = _resolve_timeout = 0;
321 memset (ret, 0, sizeof(*ret));
322 *alias = NULL;
323
324 if (!netdb_init())
325 {
326 h_errno = NO_RECOVERY;
327 return (FALSE);
328 }
329
330 if (inet_aton(name,&addr))
331 {
333 ret->h_name = (char*) name;
334 ret->h_address[0] = addr.s_addr;
335 ret->h_num_addr = 1;
336 is_addr = TRUE;
337 return (TRUE);
338 }
339
340 now = time (NULL);
341
342 for (h = host0; h; h = h->h_next)
343 {
344 int i;
345
346 if (h->h_name && !stricmp(h->h_name, name))
347 {
348 /* if cached entry expired, do DNS lookup
349 */
350 if (h->h_timeout && now > h->h_timeout)
351 goto expired;
352
353 *ret = *h;
354 return (h->h_address[0] != INADDR_NONE ? TRUE : FALSE);
355 }
356 for (i = 0; i < MAX_HOST_ALIASES && h->h_aliases[i]; i++)
357 if (!stricmp(name, h->h_aliases[i]))
358 {
359 if (h->h_timeout && now > h->h_timeout)
360 goto expired;
361
362 *alias = h->h_aliases[i];
363 *ret = *h;
364 return (h->h_address[0] != INADDR_NONE ? TRUE : FALSE);
365 }
366 }
367
368 /* Not found in linked list (hosts file or cache). Check name
369 * against our own host-name (short-name or FQDN).
370 * \todo Should return all our addresses if we're multihomed.
371 */
372 if (hostname[0] && !stricmp(name, hostname))
373 {
374 ret->h_num_addr = 1;
375 ret->h_address[0] = gethostid();
376 ret->h_name = hostname;
377 from_where = "gethostname";
378 return (TRUE);
379 }
380
381 if (!gethostname(our_name, sizeof(our_name)) && !stricmp(name, our_name))
382 {
383 ret->h_num_addr = 1;
384 ret->h_address[0] = gethostid();
385 ret->h_name = our_name;
386 from_where = "gethostname";
387 return (TRUE);
388 }
389
390expired:
391
392 if (called_from_resolve) /* prevent recursion */
393 return (FALSE);
394
395 /* Do a full DNS lookup
396 */
397 called_from_ghbn = TRUE;
398 ip = resolve (name); /* do a normal lookup */
399 called_from_ghbn = FALSE;
400 did_lookup = TRUE;
401
402 if (_resolve_exit || /* interrupted or other fail */
403 _resolve_timeout) /* timed out resolving */
404 return (FALSE);
405
406 if (ip) /* successfully resolved */
407 {
408 h = add_hostent (h, name, dom_cname, dom_a4list, htonl(ip),
409 dom_ttl, from_windns);
410 if (h)
411 *ret = *h;
412 return (h ? TRUE : FALSE);
413 }
414
415 /* Add the name to the list even if we got a negative DNS reply.
416 * Thus the next call to gethostbyxx() will return immediately.
417 */
418 add_hostent (h, name, NULL, NULL, INADDR_NONE, netdbCacheLife, from_windns);
419 return (FALSE);
420}
421
422struct hostent * W32_CALL gethostbyname2 (const char *name, int family)
423{
424 if (family == AF_INET)
425 return gethostbyname (name);
426
427#if defined(USE_IPV6)
428 if (family == AF_INET6)
429 return gethostbyname6 (name);
430#endif
431
432 h_errno = TRY_AGAIN;
433 return (NULL);
434}
435
436
437/*
438 * Return a 'struct hostent *' for an address.
439 */
440struct hostent * W32_CALL gethostbyaddr (const char *addr_name, int len, int type)
441{
442 struct _hostent h;
443
444 SOCK_DEBUGF (("\ngethostbyaddr: %s",
445 (type == AF_INET && addr_name) ?
446 inet_ntoa(*(struct in_addr*)addr_name) :
447 (type == AF_INET6 && addr_name) ?
448 _inet6_ntoa(addr_name) : ""));
449
450#if defined(USE_IPV6)
451 if (type == AF_INET6 && len == sizeof(struct in6_addr))
452 {
453 struct hostent *he;
454
455 SOCK_ENTER_SCOPE();
456 he = gethostbyaddr6 (addr_name);
457 SOCK_LEAVE_SCOPE();
458 return (he);
459 }
460#endif
461
462 if (gethostbyaddr_internal (addr_name, len, type, &h))
463 {
464 SOCK_DEBUGF ((" `%s'", h.h_name));
465 if (!did_lookup)
466 SOCK_DEBUGF ((", %s", h.h_timeout ? "cached" : "hosts-file"));
467 return fill_hostent (&h);
468 }
469
470 SOCK_DEBUGF ((" failed (%s) ", did_lookup ? dom_strerror(dom_errno) :
471 hstrerror(h_errno)));
472 return (NULL);
473}
474
475void W32_CALL sethostent (int stayopen)
476{
477 hostClose = (stayopen == 0);
478 if (!netdb_init() || !hostFname)
479 return;
480
481 if (!hostFile)
482 hostFile = fopen (hostFname, "rt");
483 else rewind (hostFile);
484}
485
486void W32_CALL endhostent (void)
487{
488 struct _hostent *h, *next = NULL;
489
490 if (_watt_fatal_error)
491 return;
492
493 if (hostFname)
494 free (hostFname);
495 if (hostFile)
496 fclose (hostFile);
497 hostFname = NULL;
498 hostFile = NULL;
499
500 for (h = host0; h; h = next)
501 {
502 int i;
503 for (i = 0; h->h_aliases[i]; i++)
504 free (h->h_aliases[i]);
505 next = h->h_next;
506 free (h->h_name);
507 free (h);
508 }
509 host0 = NULL;
510 hostClose = TRUE;
511}
512
513static BOOL gethostbyaddr_internal (const char *addr_name, int len, int type,
514 struct _hostent *ret)
515{
516 static char name [MAX_HOSTLEN];
517 struct _hostent *h = NULL;
518 DWORD addr;
519 BOOL rc;
520 time_t now;
521
522 h_errno = HOST_NOT_FOUND;
523 did_lookup = FALSE;
524 from_where = NULL;
525 _resolve_exit = _resolve_timeout = 0;
526 memset (ret, 0, sizeof(*ret));
527
528 if (type != AF_INET || len < SIZEOF(addr))
529 {
530 h_errno = NO_RECOVERY;
531 return (FALSE);
532 }
533
534 if (!netdb_init())
535 {
536 h_errno = NO_RECOVERY;
537 return (FALSE);
538 }
539
540 addr = *(DWORD*) addr_name;
541
542 if ((addr == INADDR_ANY || /* 0.0.0.0 -> my_ip_addr */
543 addr == (DWORD)gethostid()) &&
544 gethostname(name, sizeof(name)) == 0)
545 {
548 ret->h_num_addr = 1;
549 ret->h_address[0] = gethostid();
550 ret->h_name = name;
551 from_where = "gethostname";
552 return (TRUE);
553 }
554
555 if (addr == INADDR_BROADCAST || /* 255.255.255.255 */
556 (~ntohl(addr) & ~sin_mask) == 0) /* directed broadcast */
557 {
558 ret->h_num_addr = 1;
559 ret->h_address[0] = addr;
560 ret->h_name = (char*) "broadcast";
561 return (TRUE);
562 }
563
564 now = time (NULL);
565
566 /* If called from getnameinfo() with AI_CANONNAME, we
567 * should not search the host0 list. But do a full reeverse
568 * lookup.
569 */
570 if (called_from_getai)
571 goto expired;
572
573 for (h = host0; h; h = h->h_next)
574 {
575 int i;
576
577 for (i = 0; i < h->h_num_addr && h->h_address[i] != INADDR_NONE; i++)
578 {
579 if (addr == h->h_address[i])
580 {
581 /* if cached entry expired, do a new reverse lookup
582 */
583 if (h->h_timeout && now > h->h_timeout)
584 goto expired;
585
586 *ret = *h;
587 if (!strcmp(h->h_name, "*unknown*"))
588 return (FALSE);
589 return (TRUE);
590 }
591 }
592 }
593
594expired:
595
596 /* do a reverse ip lookup
597 */
598 did_lookup = TRUE;
599 rc = reverse_resolve_ip4 (addr, name, sizeof(name));
600
601 /* interrupted or timedout
602 */
603 if (!rc && (_resolve_exit || _resolve_timeout))
604 return (FALSE);
605
606 if (rc) /* successfully resolved */
607 {
608 h = add_hostent (h, name, dom_cname, NULL, addr, dom_ttl, from_windns);
609 if (h)
610 *ret = *h;
611
613 return (h ? TRUE : FALSE);
614 }
615
616 /* Add the IP to the list even if reverse lookup failed and not
617 * interrupted by _resolve_hook(). Thus the next call to gethostbyxx()
618 * will return immediately.
619 */
620 add_hostent (h, "*unknown*", NULL, NULL, addr, 0UL, FALSE);
621 return (FALSE);
622}
623
624#if defined(NOT_USED)
625/*
626 * Warn about calling 'getXbyY()' functions before calling
627 * 'watt_sock_init()'. Many other functions will fail if we're not
628 * initialised, but 'getXbyY()' are often used during application
629 * startup.
630 */
631void uninit_warn (const char *func)
632{
633 (*_printf) ("Warning: function \"%s()\" called before \"sock_init()\".",
634 func);
635}
636#endif
637
638int * W32_CALL __h_errno_location (void)
639{
640 return (&h_errno);
641}
642
643static struct hostent *fill_hostent (const struct _hostent *h)
644{
645 static struct hostent ret;
646 static struct in_addr addr [MAX_ADDRESSES+1];
647 static char *list [MAX_ADDRESSES+1];
648 static char hostnam [MAX_HOSTLEN+1];
649 static char *aliases [MAX_HOST_ALIASES+1];
650 int i;
651
652 if (!h->h_name)
653 return (NULL);
654
655 memset (&addr, 0, sizeof(addr));
656 memcpy (&aliases, h->h_aliases, sizeof(aliases));
657
658 for (i = 0; i < h->h_num_addr && i < MAX_ADDRESSES; i++)
659 {
660 addr[i].s_addr = h->h_address[i];
661 list[i] = (char*) &addr[i];
662 }
663
664 list[i] = NULL;
665 ret.h_addr_list = list;
666 ret.h_name = _strlcpy (hostnam, h->h_name, sizeof(hostnam));
667 ret.h_aliases = aliases;
668 ret.h_addrtype = AF_INET;
669 ret.h_length = sizeof (addr[0].s_addr);
670 h_errno = NETDB_SUCCESS;
671 return (&ret);
672}
673
674/*
675 * Modify an expired cached entry or create a new node and
676 * add it to the linked list. Not used for entries in hosts-file.
677 */
678static struct _hostent *add_hostent
679 (struct _hostent *h,
680 const char *name, /* Host name */
681 const char *cname, /* Canonical name (CNAME) */
682 DWORD *alist, /* List of alternate addresses */
683 DWORD addr, /* Main IP-address */
684 DWORD ttl, /* Time-to-live (sec) */
685 BOOL windns) /* answer came from WinDNS */
686{
687 DWORD real_ttl = ttl;
688 int i;
689
690 ttl = min (ttl, netdbCacheLife); /* clamp the TTL */
691
692 if (h) /* reuse expired entry */
693 {
694 if (h->h_name)
695 free (h->h_name);
696 if (h->h_aliases[0])
697 free (h->h_aliases[0]); /* !! max 1 alias */
698 memset (&h->h_address[1], 0, /* clear old alternates */
699 sizeof(h->h_address)-sizeof(u_long));
700 h->h_aliases[0] = NULL;
701 }
702 else /* create a new node */
703 {
704 h = calloc (sizeof(*h), 1);
705 if (h)
706 {
707 h->h_next = host0;
708 host0 = h;
709 }
710 }
711
712 if (!cname || !cname[0])
713 cname = NULL;
714
715 if (addr != INADDR_NONE)
716 {
717 SOCK_DEBUGF ((", CNAME %s, TTL %s, ",
718 cname ? cname : "<none>", hms_str(real_ttl)));
719#if defined(WIN32)
720 SOCK_DEBUGF (("WinDNS %d, ", windns));
721#endif
722 }
723
724 if (h)
725 {
726 h->h_timeout = ttl ? time (NULL) + ttl : 0;
727 h->h_real_ttl = real_ttl;
728 h->h_address[0] = addr;
729 h->h_num_addr = 1;
730
731 for (i = 0; alist; i++)
732 {
733 if (alist[i] == INADDR_NONE || alist[i] == INADDR_ANY)
734 break;
735 h->h_address[i+1] = alist[i];
736 h->h_num_addr++;
737 }
738 if (cname) /* swap name with CNAME */
739 {
740 h->h_name = strdup (cname);
741 h->h_aliases[0] = strdup (name); /* !! only allow 1 alias */
742 }
743 else
744 h->h_name = strdup (name);
745 }
746 else
747 SOCK_DEBUGF ((" ENOMEM"));
748
749#if defined(TEST_PROG) /* test updated cache */
750 if (h)
751 {
752 printf ("new entry: name %-30.30s -> address %s ",
753 h->h_name, inet_ntoa(*(struct in_addr*)&h->h_address[0]));
754 for (i = 1; i < h->h_num_addr; i++)
755 printf (", %s",
756 inet_ntoa(*(struct in_addr*)&h->h_address[i]));
757 puts ("");
758 }
759 else
760 printf ("new entry: ENOMEM\n");
761#endif
762
763 ARGSUSED (windns);
764 return (h);
765}
766
767#if defined(USE_DEBUG)
768/*
769 * Reverse the 'host0' list before printing it. I.e. on same order
770 * the host-names where put in the list by add_hostent().
771 */
772static BOOL ReverseHostsList (void)
773{
774 struct _hostent *h, **list;
775 int i, num_total, num_dynamic;
776
777 for (h = host0, num_total = num_dynamic = 0; h; h = h->h_next)
778 {
779 num_total++;
780 if (h->h_timeout > 0)
781 num_dynamic++;
782 }
783 if (num_total == 0 || num_dynamic == 0)
784 return (FALSE);
785
786 list = malloc (num_total * sizeof(*list));
787 if (!list)
788 return (FALSE);
789
790 for (h = host0, i = 0; h; h = h->h_next)
791 list[i++] = h;
792
793 for (host0 = NULL, i = 0; i < num_total; i++)
794 {
795 h = list[i];
796 h->h_next = host0;
797 host0 = h;
798 }
799 free (list);
800 return (TRUE);
801}
802
803void W32_CALL DumpHostsCache (void)
804{
805 struct _hostent *h;
806 time_t now;
807
808 if (!ReverseHostsList())
809 return;
810
811 SOCK_DEBUGF ((" \n\nCached IPv4 hosts: "
812 "Address TTL Alias\n"));
813 now = time (NULL);
814
815 for (h = host0; h; h = h->h_next)
816 {
817 const char *ip_str, *cache_time;
818 int i;
819
820 if (h->h_real_ttl == 0) /* skip fixed hosts-file records */
821 continue;
822
823 cache_time = ((long)(h->h_timeout - now) < 0) ? "timedout" :
824 hms_str(h->h_real_ttl);
825 ip_str = (h->h_address[0] == INADDR_NONE) ? "<none>" :
826 inet_ntoa(*(struct in_addr*)&h->h_address[0]);
827
828 SOCK_DEBUGF ((" %-50s %-15s %9s ", h->h_name, ip_str, cache_time));
829 for (i = 0; h->h_aliases[i]; i++)
830 SOCK_DEBUGF (("%s ", h->h_aliases[i]));
831 if (i == 0)
832 SOCK_DEBUGF (("<none>\n"));
833 else SOCK_DEBUGF ((" \n"));
834
835 for (i = 1; i < h->h_num_addr; i++)
836 SOCK_DEBUGF (("%52s %-15s\n", "", inet_ntoa(*(struct in_addr*)&h->h_address[i])));
837 }
838}
839#endif /* TEST_PROG */
840#endif /* USE_BSD_API */
841
842#if defined(TEST_PROG)
843#if !defined(__CYGWIN__)
844#include <conio.h>
845#endif
846
847#if defined(HAVE_UNISTD_H)
848#include <unistd.h>
849#endif
850
851#include "pcdbug.h"
852#include "sock_ini.h"
853
854#if !defined(USE_BSD_API)
855int main (void)
856{
857 puts ("This program needs '#define USE_BSD_API' (and '#define USE_IPV6')");
858 return (1);
859}
860#else /* rest of file */
861
862/*
863 * Print list of hosts unsorted.
864 */
865static void print_hosts (void)
866{
867 const struct _hostent *h;
868
869 for (h = host0; h; h = h->h_next)
870 {
871 int i;
872
873 printf ("address %-17.17s name %s;",
874 inet_ntoa(*(struct in_addr*)&h->h_address[0]), h->h_name);
875
876 for (i = 0; h->h_aliases[i]; i++)
877 {
878 if (i == 0)
879 printf (" Aliases:");
880 printf (" %s,", h->h_aliases[i]);
881 }
882 puts ("");
883 }
884 fflush (stdout);
885}
886
887void do_sleep (int time)
888{
889 while (time)
890 {
891 if (kbhit())
892 {
893 int ch = getch();
894 if (ch == 27 || ch == 'q')
895 {
896 fputc ('\n', stderr);
897 return;
898 }
899 }
900 fprintf (stderr, "%4d", time--);
901#ifdef WIN32
902 Sleep (1000);
903#else
904 sleep (1);
905#endif
906 tcp_tick (NULL); /* empty rx-buffers */
907 fprintf (stderr, "\b\b\b\b");
908 }
909}
910
911int main (void)
912{
913 const struct hostent *h;
914 const char *host_name = "test-host"; /* This doesn't exist in real life */
915 int wait_time;
916 DWORD addr_list [MAX_ADDRESSES+1];
917
918 dbug_init();
919 sock_init();
920 print_hosts();
921
922 wait_time = netdbCacheLife + 1;
923 memset (&addr_list, 0, sizeof(addr_list));
924 addr_list[0] = htonl (_inet_addr("80.22.33.45"));
925 addr_list[1] = htonl (_inet_addr("222.22.33.46"));
926 addr_list[2] = htonl (_inet_addr("217.22.33.47"));
927 addr_list[3] = htonl (_inet_addr("81.22.33.48"));
928 addr_list[4] = INADDR_NONE;
929
930 SOCK_DEBUGF (("\nadd_hostent: `%s'", host_name));
931 add_hostent (NULL, host_name, "some.cname.org", &addr_list[1],
932 addr_list[0], netdbCacheLife, FALSE);
933 h = gethostbyname (host_name);
934 if (!h)
935 {
936 fprintf (stderr, "gethostbyname() failed!. h_errno = %d\n", h_errno);
937 return (1);
938 }
939
940 fprintf (stderr, "Waiting for cache-entry to timeout..");
941 do_sleep (wait_time);
942
943 fprintf (stderr, "gethostbyname() should do a DNS lookup now.\n");
944
945 /* Since "test-host" doesn't exist in real life, a new lookup should fail.
946 * If 'h != NULL', it should mean the cached entry didn't timeout.
947 */
948 h = gethostbyname (host_name);
949 if (h)
950 fprintf (stderr, "entry didn't timeout!.\n");
951
952 return (0);
953}
954#endif /* USE_BSD_API */
955#endif /* TEST_PROG */
956
bsddbug.h
gethostid
XHOSTID_RETV W32_CALL gethostid(void)
BSD style: returns local IPv4-address.
Definition: bsdname.c:68
bsdname.h
get_xby.h
ReopenHostFile
void W32_CALL ReopenHostFile(void)
Reopen hosts-file.
Definition: gethost.c:207
GetHostsFile
const char *W32_CALL GetHostsFile(void)
Return name of hosts-file.
Definition: gethost.c:186
gethostent
struct hostent *W32_CALL gethostent(void)
Return the next (non-commented) line from the host-file.
Definition: gethost.c:219
gethostbyaddr_internal
static BOOL gethostbyaddr_internal(const char *addr_name, int len, int type, struct _hostent *ret)
Definition: gethost.c:513
CloseHostFile
void W32_CALL CloseHostFile(void)
Close hosts-file.
Definition: gethost.c:196
gethostbyname_internal
static BOOL gethostbyname_internal(const char *name, const char **alias, struct _hostent *ret)
Definition: gethost.c:307
inet.h
language.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
misc.h
strltrim
char * strltrim(char *s)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
_inet_addr
DWORD W32_CALL _inet_addr(const char *s)
Convert a string into an IP-address.
Definition: netaddr.c:70
isaddr
BOOL W32_CALL isaddr(const char *str)
Check if 'str' is simply an ip address.
Definition: netaddr.c:128
netaddr.h
netdb.h
netdb_init
int netdb_init(void)
Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise thing...
Definition: pcconfig.c:1284
pcconfig.h
pcdbug.h
dom_strerror
const char *W32_CALL dom_strerror(int err)
Return text for error code (dom_errno).
Definition: pcdns.c:742
resolve
DWORD W32_CALL resolve(const char *name)
Convert host name to an address.
Definition: pcdns.c:771
called_from_resolve
BOOL called_from_resolve
Hacks to make gethostbyname() and resolve() cooperate.
Definition: pcdns.c:60
pcdns.h
hostname
char hostname[MAX_HOSTLEN+1]
Our configured hostname.
Definition: pctcp.c:58
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
pctcp.h
sock_ini.h
_hostent
Definition: get_xby.h:53
hostent
Definition: netdb.h:104
in6_addr
Definition: in.h:151
in_addr
Definition: in.h:143
tok
Definition: oui-generated.c:13
hms_str
const char * hms_str(DWORD sec)
Return string "HH:MM:SS" for a time in seconds.
Definition: timer.c:715
timer.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/getname.c Source File

  • src
getname.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 * 0.6 : Aug 07, 2002 : G. Vanem - added AF_INET6 support
37 */
38
39#include "socket.h"
40
41#if defined(USE_BSD_API)
42
43int W32_CALL getsockname (int s, struct sockaddr *name, socklen_t *namelen)
44{
45 Socket *socket = _socklist_find (s);
46 socklen_t sa_len;
47
48 SOCK_PROLOGUE (socket, "\ngetsockname:%d", s);
49
50 if (!socket)
51 goto einval;
52
53 sa_len = (socket->so_family == AF_INET6) ? sizeof(struct sockaddr_in6) :
54 sizeof(struct sockaddr_in);
55
56 if (!name || !namelen || (*namelen < sa_len))
57 {
58einval:
59 SOCK_DEBUGF ((", EINVAL"));
60 SOCK_ERRNO (EINVAL);
61 if (namelen)
62 *namelen = 0;
63 return (-1);
64 }
65
66 if (!socket->local_addr)
67 {
68 SOCK_DEBUGF ((", EINVAL"));
69 SOCK_ERRNO (EINVAL); /* according to HP/UX manpage */
70 return (-1);
71 }
72
73 VERIFY_RW (name, *namelen);
74
75 *namelen = sa_len;
76 memcpy (name, socket->local_addr, sa_len);
77
78#if defined(USE_IPV6)
79 if (socket->so_family == AF_INET6)
80 {
81 const struct sockaddr_in6 *la = (const struct sockaddr_in6*)socket->local_addr;
82
83 SOCK_DEBUGF ((", %s (%d)", _inet6_ntoa(&la->sin6_addr), ntohs(la->sin6_port)));
84 ARGSUSED (la);
85 }
86 else
87#endif
88 {
89 const struct sockaddr_in *la = socket->local_addr;
90
91 SOCK_DEBUGF ((", %s (%d)", inet_ntoa(la->sin_addr), ntohs(la->sin_port)));
92 ARGSUSED (la);
93 }
94 return (0);
95}
96
97int W32_CALL getpeername (int s, struct sockaddr *name, socklen_t *namelen)
98{
99 Socket *socket = _socklist_find (s);
100 socklen_t sa_len;
101
102 SOCK_PROLOGUE (socket, "\ngetpeername:%d", s);
103
104 sa_len = (socket->so_family == AF_INET6) ? sizeof(struct sockaddr_in6) :
105 sizeof(struct sockaddr_in);
106
107 if (!name || !namelen || (*namelen < sa_len))
108 {
109 SOCK_DEBUGF ((", EINVAL"));
110 SOCK_ERRNO (EINVAL);
111 if (namelen)
112 *namelen = 0;
113 return (-1);
114 }
115
116 if (!socket->remote_addr)
117 {
118 SOCK_DEBUGF ((", ENOTCONN"));
119 SOCK_ERRNO (ENOTCONN);
120 return (-1);
121 }
122
123 VERIFY_RW (name, *namelen);
124
125 *namelen = sa_len;
126 memcpy (name, socket->remote_addr, *namelen);
127
128#if defined(USE_IPV6)
129 if (socket->so_family == AF_INET6)
130 {
131 const struct sockaddr_in6 *ra = (const struct sockaddr_in6*)socket->remote_addr;
132
133 SOCK_DEBUGF ((", %s (%d)", _inet6_ntoa(&ra->sin6_addr), ntohs(ra->sin6_port)));
134 ARGSUSED (ra);
135 }
136 else
137#endif
138 {
139 const struct sockaddr_in *ra = socket->remote_addr;
140
141 SOCK_DEBUGF ((", %s (%d)", inet_ntoa(ra->sin_addr), ntohs(ra->sin_port)));
142 ARGSUSED (ra);
143 }
144 return (0);
145}
146#endif
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
Socket
Definition: socket.h:158
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82


Watt-32 tcp/ip: E:/WATT/src/getnet.c Source File

  • src
getnet.c
Go to the documentation of this file.
1
6/* Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Gisle Vanem
19 * Bergen, Norway.
20 *
21 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 *
33 * 18.aug 1996 - Created
34 */
35
36#include <stdio.h>
37#include <stdlib.h>
38#include <string.h>
39#include <arpa/inet.h>
40
41#include "wattcp.h"
42#include "misc.h"
43#include "misc_str.h"
44#include "run.h"
45#include "pcconfig.h"
46#include "language.h"
47#include "get_xby.h"
48
49#if defined(USE_BSD_API)
50
51static struct _netent *network0 = NULL;
52static char *networkFname = NULL;
53static FILE *networkFile = NULL;
54static BOOL networkClose = FALSE;
55
56static __inline struct netent *fill_netent (const struct _netent *n)
57{
58 static struct netent ret;
59 static char name [MAX_NAMELEN];
60 static char *aliases [MAX_NETENT_ALIASES+1];
61
62 memcpy (&aliases, n->n_aliases, sizeof(aliases));
63 ret.n_name = _strlcpy (name, n->n_name, sizeof(name));
64 ret.n_aliases = aliases;
65 ret.n_net = n->n_net;
66 ret.n_addrtype = AF_INET;
67 return (&ret);
68}
69
70static void W32_CALL _endnetent (void)
71{
72 endnetent();
73}
74
75void W32_CALL ReadNetworksFile (const char *fname)
76{
77 static BOOL been_here = FALSE;
78
79 if (!fname || !*fname)
80 return;
81
82 if (been_here) /* loading multiple network files */
83 {
84 free (networkFname);
85 fclose (networkFile);
86 networkFile = NULL;
87 }
88
89 networkFname = strdup (fname);
90 if (!networkFname)
91 return;
92
93 setnetent (1);
94 if (!networkFile)
95 return;
96
97 been_here = TRUE;
98
99 while (1)
100 {
101 struct netent *n = getnetent();
102 struct _netent *n2;
103 int i;
104
105 if (!n)
106 break;
107
108 n2 = calloc (sizeof(*n2), 1);
109 if (!n2)
110 {
111 (*_printf) (_LANG("%s too big!\n"), networkFname);
112 break;
113 }
114
115 for (i = 0; n->n_aliases[i]; i++)
116 n2->n_aliases[i] = strdup (n->n_aliases[i]);
117 n2->n_net = n->n_net;
118 n2->n_addrtype = n->n_addrtype;
119 n2->n_name = strdup (n->n_name);
120 if (!n2->n_name)
121 break;
122 n2->n_next = network0;
123 network0 = n2;
124 }
125 rewind (networkFile);
126 RUNDOWN_ADD (_endnetent, 251);
127
128#if 0 /* test */
129 {
130 struct _netent *n;
131
132 printf ("\n%s entries:\n", networkFname);
133
134 for (n = network0; n; n = n->n_next)
135 {
136 int i;
137 printf ("net %-15.15s name %-10.10s Aliases:",
138 inet_ntoa(inet_makeaddr(n->n_net,0)), n->n_name);
139 for (i = 0; n->n_aliases[i]; i++)
140 printf (" %s,", n->n_aliases[i]);
141 puts ("");
142 }
143 fflush (stdout);
144 }
145#endif
146}
147
148/*
149 * Return name of networks file
150 */
151const char * W32_CALL GetNetFile (void)
152{
153 return (networkFname);
154}
155
156/*
157 * To prevent running out of file-handles, one should close the
158 * 'networks' file before spawning a new shell.
159 */
160void W32_CALL CloseNetworksFile (void)
161{
162 fclose (networkFile);
163 networkFile = NULL;
164}
165
166void W32_CALL ReopenNetworksFile (void)
167{
168 ReadNetworksFile (networkFname);
169}
170
171/*
172 * Return the next (non-commented) line from the network-file
173 * Format is:
174 * name [=] net [alias..] {\n | # ..}
175 *
176 * e.g.
177 * loopback 127
178 * arpanet 10 arpa
179 */
180struct netent * W32_CALL getnetent (void)
181{
182 struct _netent n;
183 char *name, *net, *alias, *tok_buf = NULL;
184 char buf [2*MAX_NAMELEN], *tok;
185 int i;
186
187 if (!netdb_init() || !networkFile)
188 return (NULL);
189
190 while (1)
191 {
192 if (!fgets(buf,sizeof(buf),networkFile))
193 return (NULL);
194
195 tok = strltrim (buf);
196 if (*tok == '#' || *tok == ';' || *tok == '\n')
197 continue;
198
199 name = strtok_r (tok, " \t", &tok_buf);
200 net = strtok_r (NULL, "= \t\n", &tok_buf);
201 if (name && net)
202 break;
203 }
204
205 if (networkClose)
206 endnetent();
207
208 memset (&n, 0, sizeof(n));
209 n.n_net = inet_network (net);
210 n.n_name = name;
211 alias = strtok_r (NULL, " \t\n", &tok_buf);
212
213 for (i = 0; alias && i < MAX_NETENT_ALIASES; i++)
214 {
215 static char aliases [MAX_NETENT_ALIASES][MAX_NAMELEN];
216
217 if (*alias == '#' || *alias == ';')
218 break;
219
220 n.n_aliases[i] = _strlcpy (aliases[i], alias, sizeof(aliases[i]));
221 alias = strtok_r (NULL, " \t\n", &tok_buf);
222 }
223 return fill_netent (&n);
224}
225
226/*
227 * Return a 'netent' structure for network 'name' or
228 * NULL if not found.
229 */
230struct netent * W32_CALL getnetbyname (const char *name)
231{
232 const struct _netent *n;
233
234 if (!netdb_init() || !name)
235 return (NULL);
236
237 for (n = network0; n; n = n->n_next)
238 {
239 int i;
240
241 if (n->n_name && !stricmp(n->n_name,name))
242 return fill_netent (n);
243
244 for (i = 0; n->n_aliases[i]; i++)
245 if (!stricmp(name,n->n_aliases[i]))
246 return fill_netent (n);
247 }
248 return (NULL);
249}
250
251/*
252 * Return a 'netent' structure for network number 'net' or
253 * NULL if not found.
254 */
255struct netent * W32_CALL getnetbyaddr (long net, int type)
256{
257 const struct _netent *n;
258
259 if (!netdb_init())
260 return (NULL);
261
262 for (n = network0; n; n = n->n_next)
263 if ((u_long)net == n->n_net && type == n->n_addrtype && n->n_name)
264 return fill_netent (n);
265 return (NULL);
266}
267
268/*
269 * Open the network file.
270 */
271void W32_CALL setnetent (int stayopen)
272{
273 networkClose = (stayopen == 0);
274
275 if (!netdb_init() || !networkFname)
276 return;
277
278 if (!networkFile)
279 networkFile = fopen (networkFname, "rt");
280 else rewind (networkFile);
281}
282
283/*
284 * Close the network file and free associated memory
285 */
286void W32_CALL endnetent (void)
287{
288 struct _netent *n, *next;
289
290 if (_watt_fatal_error)
291 return;
292
293 if (networkFname)
294 free (networkFname);
295 if (networkFile)
296 fclose (networkFile);
297 networkFname = NULL;
298 networkFile = NULL;
299
300 for (n = network0; n; n = next)
301 {
302 int i;
303 for (i = 0; n->n_aliases[i]; i++)
304 free (n->n_aliases[i]);
305 next = n->n_next;
306 free (n->n_name);
307 free (n);
308 }
309 network0 = NULL;
310 networkClose = TRUE;
311}
312#endif /* USE_BSD_API */
get_xby.h
inet.h
language.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
misc.h
strltrim
char * strltrim(char *s)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
inet_makeaddr
struct in_addr W32_CALL inet_makeaddr(u_long net, u_long host)
Formulate an Internet address from network + host (with subnet address).
Definition: netaddr.c:377
netdb_init
int netdb_init(void)
Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise thing...
Definition: pcconfig.c:1284
pcconfig.h
_netent
Definition: get_xby.h:79
netent
Definition: netdb.h:117
tok
Definition: oui-generated.c:13
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/getopt.c Source File

  • src
getopt.c
Go to the documentation of this file.
1
5/* (emx+gcc) -- Copyright (c) 1990-1993 by Eberhard Mattes
6 * Adapted for Watt-32 TCP/IP by G. Vanem Nov-96
7 */
8
9#include <stdio.h>
10#include <stdlib.h>
11#include <string.h>
12
13#include "wattcp.h"
14#include "language.h"
15#include "misc_str.h"
16
17char *watt_optarg = NULL;
18int watt_optopt = 0;
19int watt_optind = 0; /* Default: first call */
20int watt_opterr = 1; /* Default: error messages enabled */
21char *watt_optswchar = "-/"; /* '-' or '/' starts options */
22
23enum _watt_optmode watt_optmode = GETOPT_UNIX;
24
25static char *next_opt; /* Next character in cluster of options */
26static char *empty = ""; /* Empty string */
27
28static BOOL done;
29static char sw_char;
30
31static char **options; /* List of entries which are options */
32static char **non_options; /* List of entries which are not options */
33static int options_count;
34static int non_options_count;
35
36#define PUT(dst) do { \
37 if (watt_optmode == GETOPT_ANY) \
38 dst[dst##_count++] = argv[watt_optind]; \
39 } while (0)
40
41#undef ERROR
42
43#if defined(USE_DEBUG)
44 #define ERROR(str,fmt,ch) printf (str), printf (fmt, ch), puts ("")
45#else /* avoid pulling in printf() */
46 #define ERROR(str,fmt,ch) outsnl (str)
47#endif
48
49
50int W32_CALL watt_getopt (int argc, char *const *_argv, const char *opt_str)
51{
52 char c;
53 char *q;
54 int i, j;
55 char **argv = (char **) _argv;
56
57 if (watt_optind == 0)
58 {
59 watt_optind = 1;
60 done = FALSE;
61 next_opt = empty;
62 if (watt_optmode == GETOPT_ANY)
63 {
64 options = malloc (argc * sizeof(char*));
65 non_options = malloc (argc * sizeof(char*));
66 if (!options || !non_options)
67 {
68 outsnl ("out of memory (getopt)");
69 exit (255);
70 }
71 options_count = 0;
72 non_options_count = 0;
73 }
74 }
75 if (done)
76 return (EOF);
77
78restart:
79 watt_optarg = NULL;
80 if (*next_opt == 0)
81 {
82 if (watt_optind >= argc)
83 {
84 if (watt_optmode == GETOPT_ANY)
85 {
86 j = 1;
87 for (i = 0; i < options_count; ++i)
88 argv[j++] = options[i];
89 for (i = 0; i < non_options_count; ++i)
90 argv[j++] = non_options[i];
91 watt_optind = options_count+1;
92 free (options);
93 free (non_options);
94 }
95 done = TRUE;
96 return (EOF);
97 }
98 else if (!strchr (watt_optswchar, argv[watt_optind][0]) || argv[watt_optind][1] == 0)
99 {
100 if (watt_optmode == GETOPT_UNIX)
101 {
102 done = TRUE;
103 return (EOF);
104 }
105 PUT (non_options);
106 watt_optarg = argv[watt_optind++];
107 if (watt_optmode == GETOPT_ANY)
108 goto restart;
109 /* watt_optmode==GETOPT_KEEP */
110 return (0);
111 }
112 else if (argv[watt_optind][0] == argv[watt_optind][1] && argv[watt_optind][2] == 0)
113 {
114 if (watt_optmode == GETOPT_ANY)
115 {
116 j = 1;
117 for (i = 0; i < options_count; ++i)
118 argv[j++] = options[i];
119 argv[j++] = argv[watt_optind];
120 for (i = 0; i < non_options_count; ++i)
121 argv[j++] = non_options[i];
122 for (i = watt_optind+1; i < argc; ++i)
123 argv[j++] = argv[i];
124 watt_optind = options_count + 2;
125 free (options);
126 free (non_options);
127 }
128 ++watt_optind;
129 done = TRUE;
130 return (EOF);
131 }
132 else
133 {
134 PUT (options);
135 sw_char = argv[watt_optind][0];
136 next_opt = argv[watt_optind] + 1;
137 }
138 }
139 c = *next_opt++;
140 if (*next_opt == 0) /* Move to next argument if end of argument reached */
141 watt_optind++;
142 if (c == ':' || (q = strchr (opt_str, c)) == NULL)
143 {
144 if (watt_opterr)
145 {
146 if (c < ' ' || c >= 127)
147 ERROR ("Invalid option", "; character code=0x%.2x", c);
148 else ERROR ("Invalid option", " -%c", c);
149 }
150 watt_optopt = '?';
151 return ('?');
152 }
153 if (q[1] == ':')
154 {
155 if (*next_opt != 0) /* Argument given */
156 {
157 watt_optarg = next_opt;
158 next_opt = empty;
159 ++watt_optind;
160 }
161 else if (q[2] == ':')
162 watt_optarg = NULL; /* Optional argument missing */
163 else if (watt_optind >= argc)
164 { /* Required argument missing */
165 if (watt_opterr)
166 ERROR ("No argument for option", " `-%c'", c);
167 c = '?';
168 }
169 else
170 {
171 PUT (options);
172 watt_optarg = argv[watt_optind++];
173 }
174 }
175 watt_optopt = c;
176 return (c);
177}
178
179
180#if defined(WATT32_ON_WINDOWS)
181
184W32_DATA wchar_t *_w_watt_optarg;
185W32_DATA wchar_t *_w_watt_optswchar;
186
187wchar_t *_w_next_opt; /* Next character in cluster of options */
188wchar_t *_w_empty = L""; /* Empty string */
189wchar_t _w_sw_char;
190
191wchar_t **_w_options; /* List of entries which are options */
192wchar_t **_w_non_options; /* List of entries which are not options */
193
194int W32_CALL _w_watt_getopt (int argc, wchar_t *const *argv, const wchar_t *opt_str)
195{
196 ARGSUSED (argc);
197 ARGSUSED (argv);
198 ARGSUSED (opt_str);
199 return (0);
200}
201#endif
202
203
_w_watt_optarg
W32_DATA wchar_t * _w_watt_optarg
Definition: getopt.c:184
language.h
misc_str.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/getprot.c Source File

  • src
getprot.c
Go to the documentation of this file.
1
6/* Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Gisle Vanem
19 * Bergen, Norway.
20 *
21 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 *
33 * 21.aug 1996 - Created
34 */
35
36#include <stdio.h>
37#include <stdlib.h>
38#include <string.h>
39#include <ctype.h>
40
41#include "wattcp.h"
42#include "misc.h"
43#include "misc_str.h"
44#include "run.h"
45#include "language.h"
46#include "pcconfig.h"
47#include "get_xby.h"
48
49#if defined(USE_BSD_API)
50
51static struct _protoent *proto0 = NULL;
52static char *protoFname = NULL;
53static FILE *protoFile = NULL;
54static BOOL protoClose = FALSE;
55
56static __inline struct protoent *fill_protoent (const struct _protoent *p)
57{
58 static struct protoent ret;
59 static char name [30];
60 static char *aliases [MAX_PROTO_ALIASES+1];
61
62 memcpy (&aliases, p->p_aliases, sizeof(aliases));
63 ret.p_name = _strlcpy (name, p->p_name, sizeof(name));
64 ret.p_proto = p->p_proto;
65 ret.p_aliases = aliases;
66 h_errno = NETDB_SUCCESS;
67 return (&ret);
68}
69
70static void W32_CALL _endprotoent (void)
71{
72 endprotoent();
73}
74
75void W32_CALL ReadProtoFile (const char *fname)
76{
77 static BOOL been_here = FALSE;
78
79 if (!fname || !*fname)
80 return;
81
82 if (been_here) /* loading multiple protocol files */
83 {
84 free (protoFname);
85 fclose (protoFile);
86 protoFile = NULL;
87 }
88
89 protoFname = strdup (fname);
90 if (!protoFname)
91 return;
92
93 setprotoent (1);
94 if (!protoFile)
95 return;
96
97 been_here = TRUE;
98
99 while (1)
100 {
101 struct protoent *p = getprotoent();
102 struct _protoent *p2;
103 int i;
104
105 if (!p)
106 break;
107
108 p2 = calloc (sizeof(*p2), 1);
109 if (!p2)
110 {
111 (*_printf) (_LANG("%s too big!\n"), protoFname);
112 break;
113 }
114 for (i = 0; p->p_aliases[i]; i++)
115 p2->p_aliases[i] = strdup (p->p_aliases[i]);
116 p2->p_proto = p->p_proto;
117 p2->p_name = strdup (p->p_name);
118
119 if (!p2->p_name)
120 break;
121
122 p2->p_next = proto0;
123 proto0 = p2;
124 }
125 rewind (protoFile);
126 RUNDOWN_ADD (_endprotoent, 257);
127
128#if 0 /* test */
129 {
130 const struct _protoent *p;
131 int i;
132
133 printf ("\n%s entries:\n", protoFname);
134 for (p = proto0; p; p = p->p_next)
135 {
136 printf ("proto %3d name %-10.10s Aliases:", p->p_proto, p->p_name);
137 for (i = 0; p->p_aliases[i]; i++)
138 printf (" %s,", p->p_aliases[i]);
139 puts ("");
140 }
141 fflush (stdout);
142 }
143#endif
144}
145
146/*------------------------------------------------------------------*/
147
148const char * W32_CALL GetProtoFile (void)
149{
150 return (protoFname);
151}
152
153void W32_CALL CloseProtoFile (void)
154{
155 fclose (protoFile);
156 protoFile = NULL;
157}
158
159void W32_CALL ReopenProtoFile (void)
160{
161 ReadProtoFile (protoFname);
162}
163
164/*------------------------------------------------------------------*/
165
166struct protoent * W32_CALL getprotoent (void)
167{
168 static struct _protoent p;
169 char *proto, *name;
170 char buf [2*MAX_NAMELEN], *tok, *tok_buf = NULL;
171
172 if (!netdb_init() || !protoFile)
173 {
174 h_errno = NO_DATA;
175 return (NULL);
176 }
177
178 /* Protocol Name
179 * ----------------------------------------
180 * 0 reserved
181 * 1 icmp, internet control message
182 * 2 igmp, internet group management
183 * 3 ggp, # gateway-gateway protocol
184 */
185
186 while (1)
187 {
188 if (!fgets(buf, sizeof(buf), protoFile))
189 {
190 h_errno = NO_DATA;
191 return (NULL);
192 }
193
194 tok = strltrim (buf);
195 if (*tok == '#' || *tok == ';' || *tok == '\n')
196 continue;
197
198 proto = strtok_r (tok, " \t", &tok_buf);
199 name = strtok_r (NULL, " ,\t\n", &tok_buf);
200 if (proto && name)
201 break;
202 }
203
204 if (protoClose)
205 endprotoent();
206
207 memset (&p, 0, sizeof(p));
208 p.p_proto = atoi (proto);
209 p.p_name = name;
210 return fill_protoent (&p);
211}
212
213/*------------------------------------------------------------------*/
214
215struct protoent * W32_CALL getprotobyname (const char *proto)
216{
217 struct _protoent fixed;
218 const struct _protoent *p;
219 int i;
220
221 memset (&fixed, 0, sizeof(fixed));
222
223 if (!netdb_init() || !proto)
224 {
225 h_errno = NO_DATA;
226 return (NULL);
227 }
228
229 /* No chances UDP/TCP protocols are renumbered
230 */
231 if (!stricmp(proto,"udp"))
232 {
233 fixed.p_name = (char*) "udp";
234 fixed.p_proto = UDP_PROTO;
235 return fill_protoent (&fixed);
236 }
237
238 if (!stricmp(proto,"tcp"))
239 {
240 fixed.p_name = (char*) "tcp";
241 fixed.p_proto = TCP_PROTO;
242 return fill_protoent (&fixed);
243 }
244
245 for (p = proto0; p; p = p->p_next)
246 {
247 if (p->p_name && !stricmp(p->p_name,proto))
248 return fill_protoent (p);
249
250 /* aliases not supported (no need)
251 */
252 for (i = 0; p->p_aliases[i] && i < DIM(p->p_aliases); i++)
253 if (!stricmp(proto,p->p_aliases[i]))
254 return fill_protoent (p);
255 }
256 h_errno = NO_DATA;
257 return (NULL);
258}
259
260/*------------------------------------------------------------------*/
261
262struct protoent * W32_CALL getprotobynumber (int proto)
263{
264 const struct _protoent *p;
265
266 if (!netdb_init())
267 {
268 h_errno = NO_DATA;
269 return (NULL);
270 }
271
272 for (p = proto0; p; p = p->p_next)
273 if (p->p_proto == proto)
274 return fill_protoent (p);
275 h_errno = NO_DATA;
276 return (NULL);
277}
278
279/*------------------------------------------------------------------*/
280
281void W32_CALL setprotoent (int stayopen)
282{
283 protoClose = (stayopen == 0);
284
285 if (!netdb_init() || !protoFname)
286 return;
287
288 if (!protoFile)
289 protoFile = fopen (protoFname, "rt");
290 else rewind (protoFile);
291}
292
293/*------------------------------------------------------------------*/
294
295void W32_CALL endprotoent (void)
296{
297 struct _protoent *p, *next;
298
299 if (_watt_fatal_error)
300 return;
301
302 if (protoFname)
303 free (protoFname);
304 if (protoFile)
305 fclose (protoFile);
306 protoFname = NULL;
307 protoFile = NULL;
308
309 for (p = proto0; p; p = next)
310 {
311 int i;
312 for (i = 0; p->p_aliases[i] && i < DIM(p->p_aliases); i++)
313 free (p->p_aliases[i]);
314 next = p->p_next;
315 free (p->p_name);
316 free (p);
317 }
318 proto0 = NULL;
319 protoClose = TRUE;
320}
321#endif /* USE_BSD_API */
get_xby.h
language.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
misc.h
strltrim
char * strltrim(char *s)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
netdb_init
int netdb_init(void)
Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise thing...
Definition: pcconfig.c:1284
pcconfig.h
_protoent
Definition: get_xby.h:90
protoent
Definition: netdb.h:131
tok
Definition: oui-generated.c:13
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/getput.c Source File

  • src
getput.c
Go to the documentation of this file.
1
6/* Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Gisle Vanem
19 * Bergen, Norway.
20 *
21 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
34#include <arpa/nameser.h>
35#include <resolv.h>
36
37#include "wattcp.h"
38#include "chksum.h"
39#include "misc.h"
40
41#undef GETSHORT
42#undef GETLONG
43#undef PUTSHORT
44#undef PUTLONG
45
46/*
47 * Functions for get/put short/long. Pointer is _NOT_ advanced.
48 */
49#define GETSHORT(s, cp) { \
50 u_char *t_cp = (u_char*)(cp); \
51 (s) = ((u_short)t_cp[0] << 8) \
52 | ((u_short)t_cp[1]); \
53 }
54
55#define GETLONG(l, cp) { \
56 u_char *t_cp = (u_char*)(cp); \
57 (l) = ((u_long)t_cp[0] << 24) \
58 | ((u_long)t_cp[1] << 16) \
59 | ((u_long)t_cp[2] << 8) \
60 | ((u_long)t_cp[3]); \
61 }
62
63#define PUTSHORT(s, cp) { \
64 u_short t_s = (u_short)(s); \
65 u_char *t_cp = (u_char*)(cp); \
66 *t_cp++ = (u_char)(t_s >> 8); \
67 *t_cp = (u_char)t_s; \
68 }
69
70#define PUTLONG(l, cp) { \
71 u_long t_l = (u_long)(l); \
72 u_char *t_cp = (u_char*)(cp); \
73 *t_cp++ = (u_char)(t_l >> 24); \
74 *t_cp++ = (u_char)(t_l >> 16); \
75 *t_cp++ = (u_char)(t_l >> 8); \
76 *t_cp = (u_char)t_l; \
77 }
78
79
80u_short W32_CALL _getshort (const u_char *x) /* in <arpa/nameserv.h> */
81{
82 u_short res;
83 GETSHORT (res, x);
84 return (res);
85}
86
87u_long W32_CALL _getlong (const u_char *x) /* in <arpa/nameserv.h> */
88{
89 u_long res;
90 GETLONG (res, x);
91 return (res);
92}
93
94void W32_CALL __putshort (u_short var, u_char *ptr) /* in <resolv.h> */
95{
96 PUTSHORT (var, ptr);
97}
98
99void W32_CALL __putlong (u_long var, u_char *ptr) /* in <resolv.h> */
100{
101 PUTLONG (var, ptr);
102}
103
104/*
105 * The below causes an 'Error! E1119: Internal compiler error 97'
106 * in 'wcc386 -ml'.
107 */
108#if !defined(__WATCOMC__) && !defined(__LARGE__)
109
110/*
111 * If compiler/linker doesn't see our defines for htonl() etc.
112 */
113#undef htonl
114#undef ntohl
115#undef htons
116#undef ntohs
117
118unsigned long W32_CALL htonl (unsigned long val)
119{
120 return intel (val);
121}
122unsigned long W32_CALL ntohl (unsigned long val)
123{
124 return intel (val);
125}
126unsigned short W32_CALL htons (unsigned short val)
127{
128 return intel16 (val);
129}
130unsigned short W32_CALL ntohs (unsigned short val)
131{
132 return intel16 (val);
133}
134#endif
chksum.h
misc.h
nameser.h
resolv.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/getserv.c Source File

  • src
getserv.c
Go to the documentation of this file.
1
6/* Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Gisle Vanem
19 * Bergen, Norway.
20 *
21 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 *
33 * 20.aug 1996 - Created
34 */
35
36#include <stdio.h>
37#include <stdlib.h>
38#include <string.h>
39#include <ctype.h>
40
41#include "wattcp.h"
42#include "misc.h"
43#include "misc_str.h"
44#include "run.h"
45#include "language.h"
46#include "netaddr.h"
47#include "pcconfig.h"
48#include "get_xby.h"
49
50#if defined(USE_BSD_API)
51
52#include <sys/socket.h>
53#include <netdb.h>
54
55static struct _servent *serv0 = NULL;
56static char *servFname = NULL;
57static FILE *servFile = NULL;
58static BOOL servClose = FALSE;
59
60/* For DOSX targets we use a small hash table to speed-up searches.
61 */
62#if (DOSX)
63 #define PORT_HASH_SIZE 256 /* must be 2^n */
64 #define GET_HASH(p) port_hash [(p) & (PORT_HASH_SIZE-1)]
65 #define SET_HASH(se) port_hash [se->s_port & (PORT_HASH_SIZE-1)] = se
66 static struct _servent *port_hash [PORT_HASH_SIZE];
67#else
68 #define GET_HASH(p) serv0
69 #define SET_HASH(p) ((void)0)
70#endif
71
72#define MAX_SERVLEN 20
73#define MAX_PROTLEN 20
74
75static __inline struct servent *fill_servent (const struct _servent *s)
76{
77 static struct servent ret;
78 static char name [MAX_SERVLEN];
79 static char prot [MAX_PROTLEN];
80 static char *aliases [MAX_SERV_ALIASES+1];
81
82 memcpy (&aliases, s->s_aliases, sizeof(aliases));
83 ret.s_name = _strlcpy (name, s->s_name, sizeof(name));
84 ret.s_proto = _strlcpy (prot, s->s_proto, sizeof(prot));
85 ret.s_aliases = aliases;
86 ret.s_port = s->s_port;
87 h_errno = NETDB_SUCCESS;
88 return (&ret);
89}
90
91static void W32_CALL _endservent (void)
92{
93 endservent();
94}
95
96/*
97 * Read the \i services file and build linked-list.
98 */
99void W32_CALL ReadServFile (const char *fname)
100{
101 static BOOL been_here = FALSE;
102
103 if (!fname || !*fname)
104 return;
105
106 if (been_here) /* loading multiple services files */
107 {
108 free (servFname);
109 fclose (servFile);
110 servFile = NULL;
111 }
112 servFname = strdup (fname);
113 if (!servFname)
114 return;
115
116 setservent (1);
117 if (!servFile)
118 return;
119
120 been_here = TRUE;
121
122 while (1)
123 {
124 struct servent *s = getservent();
125 struct _servent *s2;
126 int i;
127
128 if (!s)
129 break;
130
131 s2 = calloc (sizeof(*s2), 1);
132 if (!s2)
133 {
134 (*_printf) (_LANG("%s too big!\n"), servFname);
135 return;
136 }
137 for (i = 0; s->s_aliases[i]; i++)
138 s2->s_aliases[i] = strdup (s->s_aliases[i]);
139 s2->s_port = s->s_port;
140 s2->s_name = strdup (s->s_name);
141 s2->s_proto = strdup (s->s_proto);
142
143 if (!s2->s_name || !s2->s_proto)
144 break;
145
146 s2->s_next = serv0;
147 serv0 = s2;
148 SET_HASH (s2);
149 }
150 rewind (servFile);
151 RUNDOWN_ADD (_endservent, 255);
152}
153
154/*
155 * Return name of \i /etc/services file.
156 */
157const char * W32_CALL GetServFile (void)
158{
159 return (servFname);
160}
161
162/*
163 * Close the \i /etc/services file.
164 */
165void W32_CALL CloseServFile (void)
166{
167 fclose (servFile);
168 servFile = NULL;
169}
170
171/*
172 * Reopen the \i /etc/services file.
173 */
174void W32_CALL ReopenServFile (void)
175{
176 ReadServFile (servFname);
177}
178
179/*------------------------------------------------------------------*/
180
181struct servent * W32_CALL getservent (void)
182{
183 static struct _servent s;
184 char *name, *proto, *alias, *tok_buf = NULL;
185 char buf [2*MAX_NAMELEN], *tok;
186 WORD port;
187 int i;
188
189 if (!netdb_init() || !servFile)
190 {
191 h_errno = NO_DATA;
192 return (NULL);
193 }
194
195 while (1)
196 {
197 if (!fgets(buf, sizeof(buf), servFile))
198 {
199 h_errno = NO_DATA;
200 return (NULL);
201 }
202
203 tok = strltrim (buf);
204 if (*tok == '#' || *tok == ';' || *tok == '\n')
205 continue;
206
207 /* # Service port/prot alias(es)
208 * #-------------------------------------------
209 * rtmp 1/ddp <- we only support "udp"/"tcp"
210 * echo 7/tcp
211 * echo 7/udp
212 * discard 9/tcp sink null
213 * discard 9/udp sink null
214 */
215
216 name = strtok_r (tok, " \t", &tok_buf);
217 tok = strtok_r (NULL, "/ \t\n", &tok_buf);
218 if (!tok)
219 continue;
220
221 port = intel16 (atoi(tok));
222 proto = strtok_r (NULL, " \t\n", &tok_buf);
223 if (name && port && proto &&
224 (!stricmp(proto, "udp") || !stricmp(proto, "tcp")))
225 break;
226 }
227
228 if (servClose)
229 endservent();
230
231 memset (&s, 0, sizeof(s));
232 s.s_name = name;
233 s.s_proto = proto;
234 s.s_port = port;
235
236 alias = strtok_r (NULL, " \t\n", &tok_buf);
237
238 for (i = 0; alias && i < MAX_SERV_ALIASES; i++)
239 {
240 static char aliases [MAX_SERV_ALIASES][MAX_SERVLEN];
241
242 if (*alias == '#' || *alias == ';')
243 break;
244
245 s.s_aliases[i] = _strlcpy (aliases[i], alias, sizeof(aliases[i]));
246 alias = strtok_r (NULL, " \t\n", &tok_buf);
247 }
248 return fill_servent (&s);
249}
250
251/*------------------------------------------------------------------*/
252
253struct servent * W32_CALL getservbyname (const char *serv, const char *proto)
254{
255 const struct _servent *s;
256 int i;
257
258 if (!netdb_init() || !serv) /* proto == NULL is okay */
259 {
260 h_errno = NO_DATA;
261 return (NULL);
262 }
263
264 for (s = serv0; s; s = s->s_next)
265 {
266 BOOL chk_prot = FALSE;
267
268 if (s->s_name && !stricmp(s->s_name,serv))
269 chk_prot = TRUE;
270
271 else for (i = 0; s->s_aliases[i]; i++)
272 if (!stricmp(serv,s->s_aliases[i]))
273 {
274 chk_prot = TRUE;
275 break;
276 }
277 if (chk_prot && (!proto || !stricmp(proto,s->s_proto)))
278 return fill_servent (s);
279 }
280 h_errno = NO_DATA;
281 return (NULL);
282}
283
284/*------------------------------------------------------------------*/
285
286struct servent * W32_CALL getservbyport (int port, const char *proto)
287{
288 const struct _servent *s;
289
290 if (!netdb_init() || !proto) /* proto == NULL is okay */
291 {
292 h_errno = NO_DATA;
293 return (NULL);
294 }
295
296 for (s = GET_HASH(port); s; s = s->s_next)
297 if (s->s_port == port &&
298 (!proto || !stricmp(s->s_proto,proto)))
299 return fill_servent (s);
300 h_errno = NO_DATA;
301 return (NULL);
302}
303
304/*------------------------------------------------------------------*/
305
306void W32_CALL setservent (int stayopen)
307{
308 servClose = (stayopen == 0);
309 if (!netdb_init() || !servFname)
310 return;
311
312 if (!servFile)
313 servFile = fopen (servFname, "rt");
314 else rewind (servFile);
315}
316
317/*------------------------------------------------------------------*/
318
319void W32_CALL endservent (void)
320{
321 struct _servent *s, *next;
322
323 if (_watt_fatal_error)
324 return;
325
326 if (servFname)
327 free (servFname);
328 if (servFile)
329 fclose (servFile);
330 servFname = NULL;
331 servFile = NULL;
332
333 for (s = serv0; s; s = next)
334 {
335 int i;
336 for (i = 0; s->s_aliases[i]; i++)
337 free (s->s_aliases[i]);
338 next = s->s_next;
339 free (s->s_name);
340 free (s->s_proto);
341 free (s);
342 }
343 serv0 = NULL;
344 servClose = TRUE;
345}
346#endif /* USE_BSD_API */
347
348#if defined(TEST_PROG)
349
350#include "pcdbug.h"
351#include "sock_ini.h"
352
353int main (void)
354{
355 const struct _servent *s;
356 int i;
357
358 dbug_init();
359 sock_init();
360
361 printf ("\n%s entries:\n", servFname);
362
363 for (s = serv0; s; s = s->s_next)
364 {
365 printf ("proto %-6.6s port %4d name %-10.10s Aliases:",
366 s->s_proto, intel16(s->s_port), s->s_name);
367 for (i = 0; s->s_aliases[i]; i++)
368 printf (" %s", s->s_aliases[i]);
369 puts ("");
370 }
371 fflush (stdout);
372 return (0);
373}
374#endif /* TEST_PROG */
375
376
get_xby.h
socket.h
language.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
misc.h
strltrim
char * strltrim(char *s)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
netaddr.h
netdb.h
netdb_init
int netdb_init(void)
Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise thing...
Definition: pcconfig.c:1284
pcconfig.h
pcdbug.h
sock_ini.h
_servent
Definition: get_xby.h:100
servent
Definition: netdb.h:124
tok
Definition: oui-generated.c:13
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/gettod.c Source File

  • src
gettod.c
Go to the documentation of this file.
1
7/* Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 *
34 * 10.aug 1996 - Created
35 *
36 */
37
38#include <stdio.h>
39#include <stdlib.h>
40#include <stddef.h>
41#include <time.h>
42#include <errno.h>
43
44#include "wattcp.h"
45#include "misc.h"
46#include "misc_str.h"
47#include "timer.h"
48#include "x32vm.h"
49#include "cpumodel.h"
50#include "win_dll.h"
51#include "gettod.h"
52
53#define STEVES_PATCHES 1
54
55#if defined(WIN32)
56 #include <sys/timeb.h>
57#else
58 static long utc_offset = 0; /* UTC to local offset in seconds */
59#endif
60
61/*
62 * Timezone defines.
63 */
64#if defined(__WATCOMC__)
65 #define _timezone timezone
66#elif defined(__TURBOC__) && (__TURBOC__ <= 0x410) /* TCC/BCC <= 3.1 */
67 #define _timezone timezone
68#elif defined(__POCC__) || defined(__AVR__)
69 #define _timezone 0
70#elif defined(_MSC_VER) && (_MSC_VER <= 600)
71 #define _timezone timezone
72#endif
73
74#ifndef __inline
75#define __inline
76#endif
77
78static void get_zone (struct timezone *tz, time_t now)
79{
80 struct tm res;
81 struct tm *tm = localtime_r (&now, &res);
82
83 if (tm && tz)
84 {
85#ifdef __DJGPP__
86 tz->tz_minuteswest = - res.__tm_gmtoff / 60;
87#else
88 tz->tz_minuteswest = - (int)_timezone;
89#endif
90 tz->tz_dsttime = res.tm_isdst;
91 }
92}
93
94#if defined(WIN32)
95/*
96 * Stolen and modified from APR (Apache Portable Runtime):
97 * Number of micro-seconds between the beginning of the Windows epoch
98 * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970).
99 *
100 * This assumes all Win32 compilers have 64-bit support.
101 */
102#define DELTA_EPOCH_IN_USEC U64_SUFFIX (11644473600000000)
103
104 uint64 FILETIME_to_unix_epoch (const FILETIME *ft)
105{
106 uint64 res = (uint64) ft->dwHighDateTime << 32;
107
108 res |= ft->dwLowDateTime;
109 res /= 10; /* from 100 nano-sec periods to usec */
110 res -= DELTA_EPOCH_IN_USEC; /* from Win epoch to Unix epoch */
111 return (res);
112}
113
114W32_GCC_PRAGMA (GCC diagnostic push)
115W32_GCC_PRAGMA (GCC diagnostic ignored "-Wformat")
116W32_GCC_PRAGMA (GCC diagnostic ignored "-Wformat-extra-args")
117
118const char *ULONGLONG_to_ctime (ULONGLONG ts)
119{
120 LARGE_INTEGER ft;
121 time_t t;
122 const struct tm *tm;
123 static char buf[30];
124 static BOOL tz_set = FALSE;
125
126 if (!tz_set)
127 tzset();
128 tz_set = TRUE;
129
130 ft.QuadPart = ts;
131 t = FILETIME_to_unix_epoch ((const FILETIME*)&ft) / U64_SUFFIX(1000000);
132 tm = localtime (&t);
133 if (tm)
134 strftime (buf, sizeof(buf), "%Y-%m-%d/%H:%M:%S", tm);
135 else SNPRINTF (buf, sizeof(buf), "%lu/%" U64_FMT, (u_long)t, ts);
136 return (buf);
137}
138
139W32_GCC_PRAGMA (GCC diagnostic pop)
140
141W32_FUNC int W32_CALL W32_NAMESPACE (gettimeofday) (
142 struct timeval *tv,
143 struct timezone *tz)
144{
145 if (!tv && !tz)
146 {
147 SOCK_ERRNO (EINVAL);
148 return (-1);
149 }
150
151 if (tv)
152 {
153 FILETIME ft;
154 uint64 tim;
155
156 if (p_GetSystemTimePreciseAsFileTime)
157 (*p_GetSystemTimePreciseAsFileTime) (&ft);
158 else GetSystemTimeAsFileTime (&ft);
159
160 tim = FILETIME_to_unix_epoch (&ft);
161 tv->tv_sec = (long) (tim / 1000000L);
162 tv->tv_usec = (long) (tim % 1000000L);
163 }
164 if (tz)
165 get_zone (tz, tv->tv_sec);
166 return (0);
167}
168#else
169
173void set_utc_offset (void)
174{
175 struct timezone tz = { 0, 0 };
176
177#if !defined(__POCC__) && !defined(__AVR__)
178 tzset();
179#endif
180 get_zone (&tz, time(NULL));
181 utc_offset = 60 * tz.tz_minuteswest;
182
183#ifdef TEST_PROG
184 printf ("Minutes west %d, DST %d\n", tz.tz_minuteswest, tz.tz_dsttime);
185#endif
186}
187#endif /* WIN32 */
188
189
190#if (DOSX == 0)
191
192#include <dos.h>
193
194#if defined(DMC386)
195 #define CX_WORD_REG(r) r.x.cx
196#else
197 #define CX_WORD_REG(r) r.w.cx
198#endif
199
200int W32_CALL W32_NAMESPACE (gettimeofday) (struct timeval *tv, struct timezone *tz)
201{
202 union REGS reg;
203 struct tm tm;
204
205 if (!tv)
206 {
207 SOCK_ERRNO (EINVAL);
208 return (-1);
209 }
210
211 reg.h.ah = 0x2C;
212 int86 (0x21, &reg, &reg);
213
214 tv->tv_usec = reg.h.dl * 10000UL;
215 tm.tm_sec = reg.h.dh;
216 tm.tm_min = reg.h.cl;
217 tm.tm_hour = reg.h.ch;
218
219 reg.h.ah = 0x2A;
220 int86 (0x21, &reg, &reg);
221
222 tm.tm_mday = reg.h.dl;
223 tm.tm_mon = reg.h.dh - 1;
224 tm.tm_year = (CX_WORD_REG(reg) & 0x7FF) - 1900;
225 tm.tm_wday = tm.tm_yday = 0;
226 tm.tm_isdst = -1;
227
228 tv->tv_sec = mktime (&tm);
229
230 if (tz)
231 get_zone (tz, tv->tv_sec);
232 return (0);
233}
234
235#elif (DOSX & (PHARLAP|X32VM))
236int W32_CALL W32_NAMESPACE (gettimeofday) (struct timeval *tv, struct timezone *tz)
237{
238 SWI_REGS reg;
239 struct tm tm;
240
241 if (!tv)
242 {
243 SOCK_ERRNO (EINVAL);
244 return (-1);
245 }
246
247 reg.r_ax = 0x2C00;
248 _dx_real_int (0x21, &reg);
249
250 tv->tv_usec = loBYTE (reg.r_dx) * 10000UL;
251 tm.tm_sec = hiBYTE (reg.r_dx);
252 tm.tm_min = loBYTE (reg.r_cx);
253 tm.tm_hour = hiBYTE (reg.r_cx);
254
255 reg.r_ax = 0x2A00;
256 _dx_real_int (0x21, &reg);
257
258 tm.tm_mday = loBYTE (reg.r_dx);
259 tm.tm_mon = hiBYTE (reg.r_dx) - 1;
260 tm.tm_year = (reg.r_cx & 0x7FF) - 1900;
261 tm.tm_wday = tm.tm_yday = 0;
262 tm.tm_isdst = -1;
263
264 tv->tv_sec = mktime (&tm);
265 if (tz)
266 get_zone (tz, tv->tv_sec);
267 return (0);
268}
269
270#elif defined(__MSDOS__) && (defined(WATCOM386) || defined(BORLAND386))
271int W32_CALL W32_NAMESPACE (gettimeofday) (struct timeval *tv, struct timezone *tz)
272{
273 union REGS reg;
274 struct tm tm;
275
276 if (!tv)
277 {
278 SOCK_ERRNO (EINVAL);
279 return (-1);
280 }
281
282 reg.x.eax = 0x2C00;
283 int386 (0x21, &reg, &reg);
284
285 tv->tv_usec = reg.h.dl * 10000UL;
286 tm.tm_sec = reg.h.dh;
287 tm.tm_min = reg.h.cl;
288 tm.tm_hour = reg.h.ch;
289
290 reg.x.eax = 0x2A00;
291 int386 (0x21, &reg, &reg);
292
293 tm.tm_mday = reg.h.dl;
294 tm.tm_mon = reg.h.dh - 1;
295 tm.tm_year = (reg.x.ecx & 0x7FF) - 1900;
296 tm.tm_wday = tm.tm_yday = 0;
297 tm.tm_isdst = -1;
298
299 tv->tv_sec = mktime (&tm);
300 if (tz)
301 get_zone (tz, tv->tv_sec);
302 return (0);
303}
304#endif /* DOSX == 0 */
305
306
307#if defined(HAVE_UINT64) && defined(__MSDOS__)
308/*
309 * Return hardware time-of-day in microseconds.
310 * NOTE: hardware counter (lo) counts down from 65536 at a rate of
311 * 1.19318 MHz (4.77/4).
312 */
313static __inline uint64 microsec_clock (void)
314{
315 DWORD hi;
316 long lo;
317 uint64 rc;
318
319 do
320 {
321 hi = PEEKL (0, BIOS_CLK);
322 lo = clockbits();
323 }
324 while (hi != PEEKL(0, BIOS_CLK)); /* tick count changed, try again */
325 lo = 0 - lo;
326 rc = ((uint64)hi << 16) + lo;
327 return (rc * U64_SUFFIX(4000000) / U64_SUFFIX(4770000));
328}
329
330#if (DOSX)
331/*
332 * Return CPU time-stamp counter in microseconds since epoch
333 * (1 Jan 1970 UTC) or from '*base'.
334 */
335static uint64 tsc_microsec (const uint64 *base)
336{
337 static uint64 time_ofs = U64_SUFFIX(-1);
338 static time_t start = 0;
339 uint64 rc, now;
340
341 if (clocks_per_usec == 0)
342 return (0);
343
344 if (time_ofs == U64_SUFFIX(-1))
345 {
346 start = time (NULL);
347 while (time(NULL) == start)
348 ENABLE();
349 time_ofs = GET_RDTSC();
350 }
351 if (base)
352 now = *base;
353 else now = GET_RDTSC();
354 rc = (now - time_ofs) / clocks_per_usec;
355 rc += U64_SUFFIX(1000000) * (start+1);
356 return (rc);
357}
358
359static void adjust_cpu_clock (const struct timeval *tv)
360{
361 static DWORD last = 0;
362 DWORD tick = PEEKL (0, BIOS_CLK);
363
364 if (((tick % 5) == 0) && last != tick) /* 260msec passed */
365 {
366 static double sample[4];
367 static int idx = 0;
368
369 if (idx < DIM(sample))
370 {
371 struct timeval tv0;
372
373 gettimeofday (&tv0, NULL);
374 sample[idx++] = timeval_diff (&tv0, tv);
375 }
376 else
377 {
378 double diff = 0.0;
379 int i, corr;
380
381 for (i = 0; i < DIM(sample); i++)
382 diff += sample[i];
383 idx = 0;
384 diff = diff / DIM(sample);
385 corr = abs ((int)last-(int)tick) / 8;
386 corr = diff < 0.0 ? -corr : +corr;
387 clocks_per_usec += corr;
388
389#ifdef TEST_PROG
390 printf ("diff %.6f, corr %d\n", diff/1E6, corr);
391#endif
392 }
393 last = tick;
394 }
395}
396
397/*
398 * Return a 'timeval' from a CPU timestamp.
399 */
400BOOL get_tv_from_tsc (const struct ulong_long *tsc, struct timeval *tv)
401{
402 uint64 usecs;
403
404 if (!tsc || !tv || !has_rdtsc)
405 return (FALSE);
406
407 usecs = tsc_microsec ((const uint64*)tsc);
408 if (!usecs)
409 return (FALSE);
410
411 tv->tv_usec = (long) (usecs % U64_SUFFIX(1000000));
412 tv->tv_sec = (time_t) ((usecs - tv->tv_usec) / U64_SUFFIX(1000000));
413 return (TRUE);
414}
415#endif /* DOSX */
416#endif /* HAVE_UINT64 && __MSDOS__ */
417
418
419/*
420 * A high-resolution [1us] version of gettimeofday() needed in
421 * select_s() etc. Should return 'tv_sec' in UTC.
422 */
423#if defined(WIN32)
424int W32_CALL gettimeofday2 (struct timeval *tv, struct timezone *tz)
425{
426 init_misc();
427 return gettimeofday (tv, tz);
428}
429
430#else
431
432int W32_CALL gettimeofday2 (struct timeval *tv, struct timezone *tz)
433{
434 init_misc();
435
436 if (user_tick_active)
437 {
438 tv->tv_usec = (long) (1000UL * (user_tick_msec % 1000UL));
439 tv->tv_sec = (DWORD) user_tick_base + (user_tick_msec / 1000UL);
440
441 if (tz)
442 get_zone (tz, tv->tv_sec);
443 return (0);
444 }
445
446#if defined(HAVE_UINT64)
447#if (DOSX)
448 if (has_rdtsc && use_rdtsc)
449 {
450 uint64 usecs = tsc_microsec (NULL);
451
452 if (!usecs)
453 return (-1);
454
455 tv->tv_usec = (long) (usecs % U64_SUFFIX(1000000));
456 tv->tv_sec = (time_t) ((usecs - tv->tv_usec) / U64_SUFFIX(1000000));
457 if (tz)
458 get_zone (tz, tv->tv_sec);
459 adjust_cpu_clock (tv);
460 return (0);
461 }
462#endif
463
464 if (has_8254)
465 {
466 static time_t secs = 0; /* seconds since midnight */
467 uint64 usecs = microsec_clock(); /* usec day-clock */
468
469#if STEVES_PATCHES
470 secs = time (NULL);
471#else
472 static uint64 last = 0;
473 if (secs == 0 || usecs < last) /* not init or wrapped */
474 {
475 secs = time (NULL);
476 secs -= (secs % (24*3600));
477 }
478 last = usecs;
479#endif
480 tv->tv_usec = (long) (usecs % U64_SUFFIX(1000000));
481#if STEVES_PATCHES
482 tv->tv_sec = (time_t) secs;
483#else
484 tv->tv_sec = (time_t) ((usecs - tv->tv_usec) / U64_SUFFIX(1000000) + (uint64)secs);
485#endif
486 tv->tv_sec += utc_offset;
487
488 if (tz)
489 get_zone (tz, tv->tv_sec);
490 return (0);
491 }
492#endif /* HAVE_UINT64 */
493
494 return gettimeofday (tv, tz);
495}
496#endif
497
498
499#if defined(TEST_PROG)
500
501#include "printk.h"
502
503#ifdef __MSDOS__
504 static __inline BOOL day_rollover (void)
505 {
506 return PEEKB (0, 0x470);
507 }
508#else
509 #define day_rollover() 0
510 #undef hires_timer
511 #define hires_timer(x) ((void)0)
512#endif
513
514#if !defined(__DJGPP__) && 0
515static void usleep (DWORD usec)
516{
517 struct timeval now, start, expiry;
518
519 gettimeofday2 (&start, NULL);
520 expiry.tv_sec = start.tv_sec + (usec / 1000000UL);
521 expiry.tv_usec = start.tv_usec + (usec % 1000000UL);
522 while (expiry.tv_usec >= 1000000UL)
523 {
524 expiry.tv_usec -= 1000000UL;
525 expiry.tv_sec++;
526 }
527 while (1)
528 {
529 gettimeofday2 (&now, NULL);
530 if (now.tv_sec > expiry.tv_sec ||
531 (now.tv_sec == expiry.tv_sec && now.tv_usec > expiry.tv_usec))
532 break;
533 }
534}
535#endif
536
537int main (int argc, char **argv)
538{
539 DWORD loops = 0;
540 BOOL do_cmp = FALSE;
541 BOOL use_isr = FALSE;
542 int ch, i;
543
544 putenv ("USE_RDTSC=0");
545 use_rdtsc = has_rdtsc = 0;
546
547 init_misc();
548
549 while ((ch = getopt(argc, argv, "?hcHir")) != EOF)
550 switch (ch)
551 {
552 case 'c':
553 do_cmp = TRUE;
554 break;
555 case 'H':
556 hires_timer (0);
557 break;
558 case 'i':
559 init_timer_isr();
560 use_isr = TRUE;
561 break;
562 case 'r':
563 if (use_isr)
564 {
565 puts ("Cannot use both `-i' and `-r'");
566 return (-1);
567 }
568 use_rdtsc = has_rdtsc = 1;
569 putenv ("USE_RDTSC=1");
570 break;
571 case '?':
572 case 'h':
573 default:
574 printf ("Usage: %s [-chir]\n"
575 " -c compare gettimeofday2() and gettimeofday()\n"
576 " -H don't use hi-res 8254 PIT (DOS only)\n"
577 " -i use timer ISR (DOS only)\n"
578 " -r use RDTSC for gettimeofday2()\n",
579 argv[0]);
580 return (0);
581 }
582
583 if (do_cmp)
584 puts ("gettimeofday2(), gettimeofday(), tv2-tv ctime rollover");
585 else puts ("gettimeofday2(), sleep, (ctime)");
586
587 puts ("------------------------------------------------------------------------");
588 puts ("Running 30 times or until a keypress.");
589
590 for (i = 0; i < 30 && !kbhit(); i++)
591 {
592 struct timeval tv, tv2;
593 struct timeval last;
594 time_t t;
595 double delta;
596 const char *ct;
597
598 gettimeofday (&tv, NULL);
599 gettimeofday2 (&tv2, NULL);
600
601 if (loops > 0)
602 delta = timeval_diff (&tv2, &last);
603 else delta = 0.0;
604 last.tv_sec = tv2.tv_sec;
605 last.tv_usec = tv2.tv_usec;
606
607 if (do_cmp)
608 {
609 printf ("%10ld.%06lu, %10ld.%06lu, %12.6f",
610 (long)tv2.tv_sec, tv2.tv_usec, (long)tv.tv_sec, tv.tv_usec,
611 timeval_diff(&tv2,&tv)/1E6);
612 }
613 else
614 printf ("%10ld.%06lu, %.6f", (long)tv2.tv_sec, tv2.tv_usec, delta/1E6);
615
616 t = tv2.tv_sec;
617 ct = ctime (&t); /* Cannot do 'ctime (&tv2.tv_sec)' directly since 'tv2.tv_sec' is a 'long' */
618 printf (", %.8s, %d\n", ct ? ct+11 : "??", day_rollover());
619
620#if defined(__DJGPP__) /* don't use delay(). It doesn't work under Win2K/XP */
621 usleep (1000000);
622#elif defined(_WIN32)
623 Sleep (1000);
624#else
625 sleep (1);
626#endif
627 loops++;
628 }
629 return (0);
630}
631#endif /* TEST_PROG */
632
cpumodel.h
errno.h
set_utc_offset
void set_utc_offset(void)
Called from init_timers() once.
Definition: gettod.c:173
gettod.h
init_misc
void W32_CALL init_misc(void)
Initialise various stuff.
Definition: misc.c:345
localtime_r
struct tm * localtime_r(const time_t *t, struct tm *res)
A reentrant localtime().
Definition: misc.c:900
misc.h
misc_str.h
printk.h
SWI_REGS
Definition: x32vm.h:16
timeval
Definition: wtime.h:30
timezone
Definition: wtime.h:55
ulong_long
Definition: wattcp.h:90
clockbits
DWORD clockbits(void)
The following 2 routines are modified versions from KA9Q NOS by Phil Karn.
Definition: timer.c:409
hires_timer
int hires_timer(int on)
Control use of high-resolution timer.
Definition: timer.c:377
clocks_per_usec
DWORD clocks_per_usec
Measured CPU speed (MHz)
Definition: timer.c:64
timeval_diff
double W32_CALL timeval_diff(const struct timeval *newer, const struct timeval *older)
Return difference (in micro-sec) between timevals *newer and *older.
Definition: timer.c:638
use_rdtsc
BOOL use_rdtsc
Ditto.
Definition: timer.c:55
has_8254
BOOL has_8254
Do we have a working 8254 timer chip?
Definition: timer.c:58
has_rdtsc
BOOL has_rdtsc
Never set in Watt-32.
Definition: timer.c:54
timer.h
wattcp.h
Core definitions.
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65
win_dll.h
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/gettod.h Source File

  • src
gettod.h
Go to the documentation of this file.
1
3#ifndef _w32_GETTIMEOFDAY_H
4#define _w32_GETTIMEOFDAY_H
5
6extern void set_utc_offset (void);
7
8#if (DOSX) && defined(HAVE_UINT64)
9extern BOOL get_tv_from_tsc (const struct ulong_long *tsc,
10 struct timeval *tv);
11#endif
12
13#if defined(_WIN32) || defined(WIN32)
14 extern uint64 FILETIME_to_unix_epoch (const FILETIME *ft);
15 extern const char *ULONGLONG_to_ctime (ULONGLONG ts);
16#endif
17
18#endif
set_utc_offset
void set_utc_offset(void)
Called from init_timers() once.
Definition: gettod.c:173
timeval
Definition: wtime.h:30
ulong_long
Definition: wattcp.h:90
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65


Watt-32 tcp/ip: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };
/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };
/* Class not documented with doxygen comments */
class Undocumented { };
/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };
/*! A template class */
template<class T> class Templ { };
/*! Class that is inherited using protected inheritance */
class ProtectedBase { };
/*! Class that is inherited using private inheritance */
class PrivateBase { };
/*! Class that is used by the Inherited class */
class Used { };
/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
protected ProtectedBase,
private PrivateBase,
public Undocumented,
public Templ<int>
{
private:
Used *m_usedClass;
};

This will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled gray box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a gray border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.

The arrows have the following meaning:

  • A blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labelled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labelled with the template parameters of the instance.


Watt-32 tcp/ip: E:/WATT/src/highc.c Source File

  • src
highc.c
Go to the documentation of this file.
1
36#include <stdio.h>
37#include <stdlib.h>
38#include <string.h>
39#include <ctype.h>
40#include <io.h>
41
42#include "wattcp.h"
43#include "misc_str.h"
44#include "pcconfig.h"
45
46#if defined(__HIGHC__) && (DOSX & PHARLAP)
47
48/*
49 * HighC's putenv() doesn't modify the inherited environment.
50 * We must do it ourself.
51 */
52static char *setup_environment (void)
53{
54 char *copy;
55 char *start;
56 char **env = _environ; /* list of env.var + putenv() vars */
57 UINT size = 0;
58
59 if (!env || !*env)
60 return (NULL);
61
62 while (env && *env) /* find how many bytes we need to malloc */
63 size += strlen (*env++) + 1;
64
65 size++;
66 copy = malloc (size);
67 if (!copy)
68 return (NULL);
69
70 start = copy;
71 env = _environ;
72 while (env && *env) /* make a new continuous environment block */
73 {
74 int len = strlen (*env) + 1;
75
76 memcpy (copy, *env++, len);
77 copy += len;
78 }
79 *copy = '\0'; /* final termination */
80 return (start);
81}
82
83static int execute (const char *path, const char *args, const char *env)
84{
85 union REGS reg;
86 EXEC_BLK blk;
87 char buf[256];
88 int len;
89 ULONG minPages, maxPages;
90
91 len = strlen (args);
92 if (len > sizeof(buf)-2)
93 return (0);
94
95 _dx_cmem_usage (0, FALSE, &minPages, &maxPages);
96
97 strcpy (buf+1, args);
98 buf [0] = len++;
99 buf [len] = '\r';
100
101 /* if `env' is NULL we'll inherit the environment without any
102 * variables added by `putenv()'
103 */
104 blk.ex_eoff = (UCHAR*)env; /* pass new environment */
105 blk.ex_eseg = SS_DATA;
106 blk.ex_coff = (UCHAR*) buf; /* command line address */
107 blk.ex_cseg = SS_DATA;
108 reg.x.ax = 0x4B00;
109 reg.x.bx = (UINT) &blk;
110 reg.x.dx = (UINT) path;
111 fflush (stdout); /* flush buffers now */
112 fflush (stderr);
113
114 intdos (&reg, &reg);
115 if (reg.x.cflag & 1) /* carry set, return -1 */
116 return (-1);
117
118 reg.x.ax = 0x4D00;
119 intdos (&reg, &reg);
120 return (reg.h.al); /* return child exit code */
121}
122
123/*
124 * This replaces system() in hc386.lib
125 * Note: this is aliased in <tcp.h>
126 */
127int _mw_watt_system (const char *cmd)
128{
129 char buf[150];
130 const char *env;
131 const char *comspec = getenv ("COMSPEC");
132 int rc;
133
134 if (!comspec || access(comspec,0))
135 {
136 (*_printf) ("Bad COMSPEC variable\n");
137 return (0);
138 }
139
140 if (cmd && *cmd)
141 _bprintf (buf, sizeof(buf), " /c %s", cmd);
142 else _bprintf (buf, sizeof(buf), "%s", cmd);
143
144 env = setup_environment();
145 rc = execute (comspec, buf, env);
146
147 if (env)
148 free (env);
149 return (rc);
150}
151
152void TRACE_FILE (const char *fmt, ...)
153{
154 ARGSUSED (fmt);
155}
156
157void TRACE_CONSOLE (int level, const char *fmt, ...)
158{
159 ARGSUSED (level);
160 ARGSUSED (fmt);
161}
162
163/*
164 * The following functions are called when Call_trace, Prolog_trace
165 * and Epilog_trace pragmas are in effect.
166 * Library must be compiled with: -Hon=Call_trace
167 * -Hon=Prolog_trace
168 * and -Hon=Epilog_trace
169 */
170
171#pragma Off(Call_trace) /* no trace of trace itself */
172#pragma Off(Prolog_trace)
173#pragma Off(Epilog_trace)
174#pragma Global_aliasing_convention("%r")
175
176#if defined(USE_DEBUG)
177
178#define MAX_LEVEL 1000
179
180
181static int level = 0;
182static const char *caller [MAX_LEVEL];
183
184static BOOL is_watt32_func (const char *func) /* incomplete */
185{
186 if (!strcmp(func, "watt_sock_init"))
187 return (TRUE);
188 if (!strcmp(func, "sock_init"))
189 return (TRUE);
190 if (!strcmp(func, "_w32_init_misc"))
191 return (TRUE);
192 if (!strcmp(func, "setup_dos_xfer_buf"))
193 return (TRUE);
194 if (!strcmp(func, "RDTSC_enabled"))
195 return (TRUE);
196 if (!strcmp(func, "_w32_init_timers"))
197 return (TRUE);
198 if (!strcmp(func, "set_utc_offset"))
199 return (TRUE);
200 if (!strcmp(func, "get_zone"))
201 return (TRUE);
202 if (!strcmp(func, "tcp_init"))
203 return (TRUE);
204 if (!strcmp(func, "_eth_init"))
205 return (TRUE);
206 return (FALSE);
207}
208
209void _call_trace (const char *from, const char *module, unsigned line,
210 const char *to)
211{
212 static const char *last_module = NULL;
213 char where[30];
214
215 if (!ctrace_on || level >= DIM(caller)-1)
216 return;
217
218 _bprintf (where, sizeof(where), "%s(%u)", module, line);
219
220 (*_printf) ("%-16s:%*s %s() -> %s()\n", where, level, "", from, to);
221
222 if (caller[level] == NULL ||
223 (strcmp(from, caller[level])) && is_watt32_func(to))
224 caller[level++] = from;
225
226 else if (last_module && !strcmp(module, last_module) && level > 0)
227 level--;
228
229 last_module = module;
230}
231
232void _prolog_trace (const char *func)
233{
234#if 0
235 if (ctrace_on)
236 (*_printf) ("%s()\n", func);
237#endif
238 ARGSUSED (func);
239}
240
241void _epilog_trace (const char *func)
242{
243 if (level > 0 && ctrace_on)
244 --level;
245}
246#else /* !USE_DEBUG */
247
248void _call_trace (const char *from, const char *module, unsigned line, const char *to)
249{
250 ARGSUSED (from);
251 ARGSUSED (module);
252 ARGSUSED (line);
253 ARGSUSED (to);
254}
255
256void _prolog_trace (const char *func)
257{
258 ARGSUSED (func);
259}
260
261void _epilog_trace (const char *func)
262{
263 ARGSUSED (func);
264}
265#endif /* USE_DEBUG */
266#endif /* __HIGHC__ && (DOSX & PHARLAP) */
is_watt32_func
static BOOL is_watt32_func(const char *func)
Definition: highc.c:184
misc_str.h
pcconfig.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/inc/netinet/icmp6.h Source File

  • inc
  • netinet
icmp6.h
Go to the documentation of this file.
1
5/*
6 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34/*
35 * Copyright (c) 1982, 1986, 1993
36 * The Regents of the University of California. All rights reserved.
37 *
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
41 * 1. Redistributions of source code must retain the above copyright
42 * notice, this list of conditions and the following disclaimer.
43 * 2. Redistributions in binary form must reproduce the above copyright
44 * notice, this list of conditions and the following disclaimer in the
45 * documentation and/or other materials provided with the distribution.
46 * 3. All advertising materials mentioning features or use of this software
47 * must display the following acknowledgement:
48 * This product includes software developed by the University of
49 * California, Berkeley and its contributors.
50 * 4. Neither the name of the University nor the names of its contributors
51 * may be used to endorse or promote products derived from this software
52 * without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
55 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE.
65 */
66
67#ifndef _NETINET_ICMP6_H_
68#define _NETINET_ICMP6_H_
69
70#ifndef __SYS_WTYPES_H
71#include <sys/wtypes.h>
72#endif
73
74#ifndef __SYS_MBUF_H
75#include <sys/mbuf.h>
76#endif
77
78#include <netinet/in.h>
79
80#define ICMPV6_PLD_MAXLEN 1232 /* IPV6_MMTU - sizeof(struct ip6_hdr)
81 - sizeof(struct icmp6_hdr) */
82W32_CLANG_PACK_WARN_OFF()
83
84#include <sys/pack_on.h>
85
86struct 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 } icmp6_dataun;
95};
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_DST_UNREACH 1 /* dest unreachable, codes: */
107#define ICMP6_PACKET_TOO_BIG 2 /* packet too big */
108#define ICMP6_TIME_EXCEEDED 3 /* time exceeded, code: */
109#define ICMP6_PARAM_PROB 4 /* ip6 header bad */
110
111#define ICMP6_ECHO_REQUEST 128 /* echo service */
112#define ICMP6_ECHO_REPLY 129 /* echo reply */
113#define ICMP6_MEMBERSHIP_QUERY 130 /* group membership query */
114#define MLD_LISTENER_QUERY 130 /* multicast listener query */
115#define ICMP6_MEMBERSHIP_REPORT 131 /* group membership report */
116#define MLD_LISTENER_REPORT 131 /* multicast listener report */
117#define ICMP6_MEMBERSHIP_REDUCTION 132 /* group membership termination */
118#define MLD_LISTENER_DONE 132 /* multicast listener done */
119
120#ifndef _KERNEL
121/* the followings are for backward compatibility to old KAME apps. */
122#define MLD6_LISTENER_QUERY MLD_LISTENER_QUERY
123#define MLD6_LISTENER_REPORT MLD_LISTENER_REPORT
124#define MLD6_LISTENER_DONE MLD_LISTENER_DONE
125#endif
126
127#define ND_ROUTER_SOLICIT 133 /* router solicitation */
128#define ND_ROUTER_ADVERT 134 /* router advertisment */
129#define ND_NEIGHBOR_SOLICIT 135 /* neighbor solicitation */
130#define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisment */
131#define ND_REDIRECT 137 /* redirect */
132
133#define ICMP6_ROUTER_RENUMBERING 138 /* router renumbering */
134
135#define ICMP6_WRUREQUEST 139 /* who are you request */
136#define ICMP6_WRUREPLY 140 /* who are you reply */
137#define ICMP6_FQDN_QUERY 139 /* FQDN query */
138#define ICMP6_FQDN_REPLY 140 /* FQDN reply */
139#define ICMP6_NI_QUERY 139 /* node information request */
140#define ICMP6_NI_REPLY 140 /* node information reply */
141
142/* The definitions below are experimental. TBA */
143#define MLD_MTRACE_RESP 200 /* mtrace resp (to sender) */
144#define MLD_MTRACE 201 /* mtrace messages */
145
146#define ICMP6_HADISCOV_REQUEST 202 /* XXX To be defined */
147#define ICMP6_HADISCOV_REPLY 203 /* XXX To be defined */
148
149#ifndef _KERNEL
150#define MLD6_MTRACE_RESP MLD_MTRACE_RESP
151#define MLD6_MTRACE MLD_MTRACE
152#endif
153
154#define ICMP6_MAXTYPE 203
155
156#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
157#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */
158#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */
159#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
160#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */
161#define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */
162
163#define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */
164#define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */
165
166#define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */
167#define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */
168#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */
169
170#define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */
171
172#define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */
173#define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */
174#define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */
175
176#define ICMP6_NI_SUCCESS 0 /* node information successful reply */
177#define ICMP6_NI_REFUSED 1 /* node information request is refused */
178#define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */
179
180#define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */
181#define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */
182#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */
183
184/* Used in kernel only */
185#define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */
186#define ND_REDIRECT_ROUTER 1 /* redirect to a better router */
187
188/*
189 * Multicast Listener Discovery
190 */
191struct mld_hdr {
192 struct icmp6_hdr mld_icmp6_hdr;
193 struct in6_addr mld_addr; /* multicast address */
194 };
195
196/* definitions to provide backward compatibility to old KAME applications */
197#ifndef _KERNEL
198#define mld6_hdr mld_hdr
199#define mld6_type mld_type
200#define mld6_code mld_code
201#define mld6_cksum mld_cksum
202#define mld6_maxdelay mld_maxdelay
203#define mld6_reserved mld_reserved
204#define mld6_addr mld_addr
205#endif
206
207/* shortcut macro definitions */
208#define mld_type mld_icmp6_hdr.icmp6_type
209#define mld_code mld_icmp6_hdr.icmp6_code
210#define mld_cksum mld_icmp6_hdr.icmp6_cksum
211#define mld_maxdelay mld_icmp6_hdr.icmp6_data16[0]
212#define mld_reserved mld_icmp6_hdr.icmp6_data16[1]
213
214/*
215 * Neighbor Discovery
216 */
217
218struct nd_router_solicit { /* router solicitation */
219 struct icmp6_hdr nd_rs_hdr;
220 /* could be followed by options */
221 };
222
223#define nd_rs_type nd_rs_hdr.icmp6_type
224#define nd_rs_code nd_rs_hdr.icmp6_code
225#define nd_rs_cksum nd_rs_hdr.icmp6_cksum
226#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]
227
228struct nd_router_advert { /* router advertisement */
229 struct icmp6_hdr nd_ra_hdr;
230 u_int32_t nd_ra_reachable; /* reachable time */
231 u_int32_t nd_ra_retransmit; /* retransmit timer */
232 /* could be followed by options */
233 };
234
235#define nd_ra_type nd_ra_hdr.icmp6_type
236#define nd_ra_code nd_ra_hdr.icmp6_code
237#define nd_ra_cksum nd_ra_hdr.icmp6_cksum
238#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0]
239#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
240#define ND_RA_FLAG_MANAGED 0x80
241#define ND_RA_FLAG_OTHER 0x40
242#define ND_RA_FLAG_HA 0x20
243
244/*
245 * Router preference values based on draft-draves-ipngwg-router-selection-01.
246 * These are non-standard definitions.
247 */
248#define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */
249
250#define ND_RA_FLAG_RTPREF_HIGH 0x08 /* 00001000 */
251#define ND_RA_FLAG_RTPREF_MEDIUM 0x00 /* 00000000 */
252#define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */
253#define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */
254
255#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
256
257struct nd_neighbor_solicit { /* neighbor solicitation */
258 struct icmp6_hdr nd_ns_hdr;
259 struct in6_addr nd_ns_target; /*target address */
260 /* could be followed by options */
261 };
262
263#define nd_ns_type nd_ns_hdr.icmp6_type
264#define nd_ns_code nd_ns_hdr.icmp6_code
265#define nd_ns_cksum nd_ns_hdr.icmp6_cksum
266#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]
267
268struct nd_neighbor_advert { /* neighbor advertisement */
269 struct icmp6_hdr nd_na_hdr;
270 struct in6_addr nd_na_target; /* target address */
271 /* could be followed by options */
272 };
273
274#define nd_na_type nd_na_hdr.icmp6_type
275#define nd_na_code nd_na_hdr.icmp6_code
276#define nd_na_cksum nd_na_hdr.icmp6_cksum
277#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
278#if BYTE_ORDER == BIG_ENDIAN
279#define ND_NA_FLAG_ROUTER 0x80000000
280#define ND_NA_FLAG_SOLICITED 0x40000000
281#define ND_NA_FLAG_OVERRIDE 0x20000000
282#else
283#if BYTE_ORDER == LITTLE_ENDIAN
284#define ND_NA_FLAG_ROUTER 0x80
285#define ND_NA_FLAG_SOLICITED 0x40
286#define ND_NA_FLAG_OVERRIDE 0x20
287#endif
288#endif
289
290struct nd_redirect { /* redirect */
291 struct icmp6_hdr nd_rd_hdr;
292 struct in6_addr nd_rd_target; /* target address */
293 struct in6_addr nd_rd_dst; /* destination address */
294 /* could be followed by options */
295 };
296
297#define nd_rd_type nd_rd_hdr.icmp6_type
298#define nd_rd_code nd_rd_hdr.icmp6_code
299#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
300#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]
301
302struct nd_opt_hdr { /* Neighbor discovery option header */
303 u_int8_t nd_opt_type;
304 u_int8_t nd_opt_len;
305 /* followed by option specific data*/
306 };
307
308#define ND_OPT_SOURCE_LINKADDR 1
309#define ND_OPT_TARGET_LINKADDR 2
310#define ND_OPT_PREFIX_INFORMATION 3
311#define ND_OPT_REDIRECTED_HEADER 4
312#define ND_OPT_MTU 5
313
314#define ND_OPT_ROUTE_INFO 200 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */
315
316struct nd_opt_prefix_info { /* prefix information */
317 u_int8_t nd_opt_pi_type;
318 u_int8_t nd_opt_pi_len;
319 u_int8_t nd_opt_pi_prefix_len;
320 u_int8_t nd_opt_pi_flags_reserved;
321 u_int32_t nd_opt_pi_valid_time;
322 u_int32_t nd_opt_pi_preferred_time;
323 u_int32_t nd_opt_pi_reserved2;
324 struct in6_addr nd_opt_pi_prefix;
325 };
326
327#define ND_OPT_PI_FLAG_ONLINK 0x80
328#define ND_OPT_PI_FLAG_AUTO 0x40
329
330struct nd_opt_rd_hdr { /* redirected header */
331 u_int8_t nd_opt_rh_type;
332 u_int8_t nd_opt_rh_len;
333 u_int16_t nd_opt_rh_reserved1;
334 u_int32_t nd_opt_rh_reserved2;
335 /* followed by IP header and data */
336 };
337
338struct nd_opt_mtu { /* MTU option */
339 u_int8_t nd_opt_mtu_type;
340 u_int8_t nd_opt_mtu_len;
341 u_int16_t nd_opt_mtu_reserved;
342 u_int32_t nd_opt_mtu_mtu;
343 };
344
345struct nd_opt_route_info { /* route info */
346 u_int8_t nd_opt_rti_type;
347 u_int8_t nd_opt_rti_len;
348 u_int8_t nd_opt_rti_prefixlen;
349 u_int8_t nd_opt_rti_flags;
350 u_int32_t nd_opt_rti_lifetime;
351 /* prefix follows */
352 };
353
354/*
355 * icmp6 namelookup
356 */
357
358struct icmp6_namelookup {
359 struct icmp6_hdr icmp6_nl_hdr;
360 u_int8_t icmp6_nl_nonce[8];
361 int32_t icmp6_nl_ttl;
362#if 0
363 u_int8_t icmp6_nl_len;
364 u_int8_t icmp6_nl_name[3];
365#endif
366 /* could be followed by options */
367 };
368
369/*
370 * icmp6 node information
371 */
372struct icmp6_nodeinfo {
373 struct icmp6_hdr icmp6_ni_hdr;
374 u_int8_t icmp6_ni_nonce[8];
375 /* could be followed by reply data */
376 };
377
378#define ni_type icmp6_ni_hdr.icmp6_type
379#define ni_code icmp6_ni_hdr.icmp6_code
380#define ni_cksum icmp6_ni_hdr.icmp6_cksum
381#define ni_qtype icmp6_ni_hdr.icmp6_data16[0]
382#define ni_flags icmp6_ni_hdr.icmp6_data16[1]
383
384#define NI_QTYPE_NOOP 0 /* NOOP */
385#define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */
386#define NI_QTYPE_FQDN 2 /* FQDN (draft 04) */
387#define NI_QTYPE_DNSNAME 2 /* DNS Name */
388#define NI_QTYPE_NODEADDR 3 /* Node Addresses */
389#define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */
390
391#if BYTE_ORDER == BIG_ENDIAN
392#define NI_SUPTYPE_FLAG_COMPRESS 0x1
393#define NI_FQDN_FLAG_VALIDTTL 0x1
394#elif BYTE_ORDER == LITTLE_ENDIAN
395#define NI_SUPTYPE_FLAG_COMPRESS 0x0100
396#define NI_FQDN_FLAG_VALIDTTL 0x0100
397#endif
398
399#ifdef NAME_LOOKUPS_04
400#if BYTE_ORDER == BIG_ENDIAN
401#define NI_NODEADDR_FLAG_LINKLOCAL 0x1
402#define NI_NODEADDR_FLAG_SITELOCAL 0x2
403#define NI_NODEADDR_FLAG_GLOBAL 0x4
404#define NI_NODEADDR_FLAG_ALL 0x8
405#define NI_NODEADDR_FLAG_TRUNCATE 0x10
406#define NI_NODEADDR_FLAG_ANYCAST 0x20 /* just experimental. not in spec */
407#elif BYTE_ORDER == LITTLE_ENDIAN
408#define NI_NODEADDR_FLAG_LINKLOCAL 0x0100
409#define NI_NODEADDR_FLAG_SITELOCAL 0x0200
410#define NI_NODEADDR_FLAG_GLOBAL 0x0400
411#define NI_NODEADDR_FLAG_ALL 0x0800
412#define NI_NODEADDR_FLAG_TRUNCATE 0x1000
413#define NI_NODEADDR_FLAG_ANYCAST 0x2000 /* just experimental. not in spec */
414#endif
415#else /* draft-ietf-ipngwg-icmp-name-lookups-05 (and later?) */
416#if BYTE_ORDER == BIG_ENDIAN
417#define NI_NODEADDR_FLAG_TRUNCATE 0x1
418#define NI_NODEADDR_FLAG_ALL 0x2
419#define NI_NODEADDR_FLAG_COMPAT 0x4
420#define NI_NODEADDR_FLAG_LINKLOCAL 0x8
421#define NI_NODEADDR_FLAG_SITELOCAL 0x10
422#define NI_NODEADDR_FLAG_GLOBAL 0x20
423#define NI_NODEADDR_FLAG_ANYCAST 0x40 /* just experimental. not in spec */
424#elif BYTE_ORDER == LITTLE_ENDIAN
425#define NI_NODEADDR_FLAG_TRUNCATE 0x0100
426#define NI_NODEADDR_FLAG_ALL 0x0200
427#define NI_NODEADDR_FLAG_COMPAT 0x0400
428#define NI_NODEADDR_FLAG_LINKLOCAL 0x0800
429#define NI_NODEADDR_FLAG_SITELOCAL 0x1000
430#define NI_NODEADDR_FLAG_GLOBAL 0x2000
431#define NI_NODEADDR_FLAG_ANYCAST 0x4000 /* just experimental. not in spec */
432#endif
433#endif
434
435struct ni_reply_fqdn {
436 u_int32_t ni_fqdn_ttl; /* TTL */
437 u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */
438 u_int8_t ni_fqdn_name[3]; /* XXX: alignment */
439 };
440
441/*
442 * Router Renumbering. as router-renum-08.txt
443 */
444struct icmp6_router_renum { /* router renumbering header */
445 struct icmp6_hdr rr_hdr;
446 u_int8_t rr_segnum;
447 u_int8_t rr_flags;
448 u_int16_t rr_maxdelay;
449 u_int32_t rr_reserved;
450 };
451
452#define ICMP6_RR_FLAGS_TEST 0x80
453#define ICMP6_RR_FLAGS_REQRESULT 0x40
454#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
455#define ICMP6_RR_FLAGS_SPECSITE 0x10
456#define ICMP6_RR_FLAGS_PREVDONE 0x08
457
458#define rr_type rr_hdr.icmp6_type
459#define rr_code rr_hdr.icmp6_code
460#define rr_cksum rr_hdr.icmp6_cksum
461#define rr_seqnum rr_hdr.icmp6_data32[0]
462
463struct rr_pco_match { /* match prefix part */
464 u_int8_t rpm_code;
465 u_int8_t rpm_len;
466 u_int8_t rpm_ordinal;
467 u_int8_t rpm_matchlen;
468 u_int8_t rpm_minlen;
469 u_int8_t rpm_maxlen;
470 u_int16_t rpm_reserved;
471 struct in6_addr rpm_prefix;
472 };
473
474#define RPM_PCO_ADD 1
475#define RPM_PCO_CHANGE 2
476#define RPM_PCO_SETGLOBAL 3
477#define RPM_PCO_MAX 4
478
479struct rr_pco_use { /* use prefix part */
480 u_int8_t rpu_uselen;
481 u_int8_t rpu_keeplen;
482 u_int8_t rpu_ramask;
483 u_int8_t rpu_raflags;
484 u_int32_t rpu_vltime;
485 u_int32_t rpu_pltime;
486 u_int32_t rpu_flags;
487 struct in6_addr rpu_prefix;
488 };
489
490#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80
491#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40
492
493#if BYTE_ORDER == BIG_ENDIAN
494#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
495#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
496#elif BYTE_ORDER == LITTLE_ENDIAN
497#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
498#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
499#endif
500
501struct rr_result { /* router renumbering result message */
502 u_int16_t rrr_flags;
503 u_int8_t rrr_ordinal;
504 u_int8_t rrr_matchedlen;
505 u_int32_t rrr_ifid;
506 struct in6_addr rrr_prefix;
507 };
508
509#include <sys/pack_off.h>
510
511 W32_CLANG_PACK_WARN_DEF()
512
513#if BYTE_ORDER == BIG_ENDIAN
514#define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
515#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
516#elif BYTE_ORDER == LITTLE_ENDIAN
517#define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
518#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
519#endif
520
521/*
522 * icmp6 filter structures.
523 */
524
525struct icmp6_filter {
526 u_int32_t icmp6_filt[8];
527 };
528
529#define ICMP6_FILTER_SETPASSALL(filterp) \
530 memset(filterp, 0xff, sizeof(struct icmp6_filter))
531#define ICMP6_FILTER_SETBLOCKALL(filterp) \
532 memset(filterp, 0x00, sizeof(struct icmp6_filter))
533
534#define ICMP6_FILTER_SETPASS(type, filterp) \
535 (((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31)))
536#define ICMP6_FILTER_SETBLOCK(type, filterp) \
537 (((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31)))
538#define ICMP6_FILTER_WILLPASS(type, filterp) \
539 ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
540#define ICMP6_FILTER_WILLBLOCK(type, filterp) \
541 ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
542
543/*
544 * Variables related to this implementation
545 * of the internet control message protocol version 6.
546 */
547struct icmp6errstat {
548 u_quad_t icp6errs_dst_unreach_noroute;
549 u_quad_t icp6errs_dst_unreach_admin;
550 u_quad_t icp6errs_dst_unreach_beyondscope;
551 u_quad_t icp6errs_dst_unreach_addr;
552 u_quad_t icp6errs_dst_unreach_noport;
553 u_quad_t icp6errs_packet_too_big;
554 u_quad_t icp6errs_time_exceed_transit;
555 u_quad_t icp6errs_time_exceed_reassembly;
556 u_quad_t icp6errs_paramprob_header;
557 u_quad_t icp6errs_paramprob_nextheader;
558 u_quad_t icp6errs_paramprob_option;
559 u_quad_t icp6errs_redirect; /* we regard redirect as an error here */
560 u_quad_t icp6errs_unknown;
561 };
562
563struct icmp6stat {
564 /* statistics related to icmp6 packets generated */
565 u_quad_t icp6s_error; /* # of calls to icmp6_error */
566 u_quad_t icp6s_canterror; /* no error 'cuz old was icmp */
567 u_quad_t icp6s_toofreq; /* no error 'cuz rate limitation */
568 u_quad_t icp6s_outhist[256];
569
570 /* statistics related to input message processed */
571 u_quad_t icp6s_badcode; /* icmp6_code out of range */
572 u_quad_t icp6s_tooshort; /* packet < sizeof(struct icmp6_hdr) */
573 u_quad_t icp6s_checksum; /* bad checksum */
574 u_quad_t icp6s_badlen; /* calculated bound mismatch */
575 /*
576 * number of responses: this member is inherited from netinet code, but
577 * for netinet6 code, it is already available in icp6s_outhist[].
578 */
579 u_quad_t icp6s_reflect;
580 u_quad_t icp6s_inhist[256];
581 u_quad_t icp6s_nd_toomanyopt; /* too many ND options */
582 struct icmp6errstat icp6s_outerrhist;
583#define icp6s_odst_unreach_noroute \
584 icp6s_outerrhist.icp6errs_dst_unreach_noroute
585#define icp6s_odst_unreach_admin icp6s_outerrhist.icp6errs_dst_unreach_admin
586#define icp6s_odst_unreach_beyondscope \
587 icp6s_outerrhist.icp6errs_dst_unreach_beyondscope
588#define icp6s_odst_unreach_addr icp6s_outerrhist.icp6errs_dst_unreach_addr
589#define icp6s_odst_unreach_noport icp6s_outerrhist.icp6errs_dst_unreach_noport
590#define icp6s_opacket_too_big icp6s_outerrhist.icp6errs_packet_too_big
591#define icp6s_otime_exceed_transit \
592 icp6s_outerrhist.icp6errs_time_exceed_transit
593#define icp6s_otime_exceed_reassembly \
594 icp6s_outerrhist.icp6errs_time_exceed_reassembly
595#define icp6s_oparamprob_header icp6s_outerrhist.icp6errs_paramprob_header
596#define icp6s_oparamprob_nextheader \
597 icp6s_outerrhist.icp6errs_paramprob_nextheader
598#define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option
599#define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect
600#define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown
601 u_quad_t icp6s_pmtuchg; /* path MTU changes */
602 u_quad_t icp6s_nd_badopt; /* bad ND options */
603 u_quad_t icp6s_badns; /* bad neighbor solicitation */
604 u_quad_t icp6s_badna; /* bad neighbor advertisement */
605 u_quad_t icp6s_badrs; /* bad router advertisement */
606 u_quad_t icp6s_badra; /* bad router advertisement */
607 u_quad_t icp6s_badredirect; /* bad redirect message */
608 };
609
610/*
611 * Names for ICMP sysctl objects
612 */
613#define ICMPV6CTL_STATS 1
614#define ICMPV6CTL_REDIRACCEPT 2 /* accept/process redirects */
615#define ICMPV6CTL_REDIRTIMEOUT 3 /* redirect cache time */
616#define ICMPV6CTL_ND6_PRUNE 6
617#define ICMPV6CTL_ND6_DELAY 8
618#define ICMPV6CTL_ND6_UMAXTRIES 9
619#define ICMPV6CTL_ND6_MMAXTRIES 10
620#define ICMPV6CTL_ND6_USELOOPBACK 11
621/*#define ICMPV6CTL_ND6_PROXYALL 12 obsoleted, do not reuse here */
622#define ICMPV6CTL_NODEINFO 13
623#define ICMPV6CTL_ERRPPSLIMIT 14 /* ICMPv6 error pps limitation */
624#define ICMPV6CTL_ND6_MAXNUDHINT 15
625#define ICMPV6CTL_MTUDISC_HIWAT 16
626#define ICMPV6CTL_MTUDISC_LOWAT 17
627#define ICMPV6CTL_ND6_DEBUG 18
628#define ICMPV6CTL_ND6_DRLIST 19
629#define ICMPV6CTL_ND6_PRLIST 20
630#define ICMPV6CTL_MAXID 21
631
632#define ICMPV6CTL_NAMES { \
633 { 0, 0 }, \
634 { 0, 0 }, \
635 { "rediraccept", CTLTYPE_INT }, \
636 { "redirtimeout", CTLTYPE_INT }, \
637 { 0, 0 }, \
638 { 0, 0 }, \
639 { "nd6_prune", CTLTYPE_INT }, \
640 { 0, 0 }, \
641 { "nd6_delay", CTLTYPE_INT }, \
642 { "nd6_umaxtries", CTLTYPE_INT }, \
643 { "nd6_mmaxtries", CTLTYPE_INT }, \
644 { "nd6_useloopback", CTLTYPE_INT }, \
645 { 0, 0 }, \
646 { "nodeinfo", CTLTYPE_INT }, \
647 { "errppslimit", CTLTYPE_INT }, \
648 { "nd6_maxnudhint", CTLTYPE_INT }, \
649 { "mtudisc_hiwat", CTLTYPE_INT }, \
650 { "mtudisc_lowat", CTLTYPE_INT }, \
651 { "nd6_debug", CTLTYPE_INT }, \
652 { 0, 0 }, \
653 { 0, 0 }, \
654}
655
656#define RTF_PROBEMTU RTF_PROTO1
657
658#ifdef _KERNEL
659# ifdef __STDC__
660struct rtentry;
661struct rttimer;
662struct in6_multi;
663# endif
664void icmp6_init(void);
665void icmp6_paramerror(struct mbuf *, int);
666void icmp6_error(struct mbuf *, int, int, int);
667int icmp6_input(struct mbuf **, int *, int);
668void icmp6_fasttimo(void);
669void icmp6_reflect(struct mbuf *, size_t);
670void icmp6_prepare(struct mbuf *);
671void icmp6_redirect_input(struct mbuf *, int);
672void icmp6_redirect_output(struct mbuf *, struct rtentry *);
673
674struct ip6ctlparam;
675void icmp6_mtudisc_update(struct ip6ctlparam *, int);
676
677/* XXX: is this the right place for these macros? */
678#define icmp6_ifstat_inc(ifp, tag) \
679do { \
680 if ((ifp) && (ifp)->if_index <= if_index \
681 && (ifp)->if_index < icmp6_ifstatmax \
682 && icmp6_ifstat && icmp6_ifstat[(ifp)->if_index]) { \
683 icmp6_ifstat[(ifp)->if_index]->tag++; \
684 } \
685} while (0)
686
687#define icmp6_ifoutstat_inc(ifp, type, code) \
688do { \
689 icmp6_ifstat_inc(ifp, ifs6_out_msg); \
690 if (type < ICMP6_INFOMSG_MASK) \
691 icmp6_ifstat_inc(ifp, ifs6_out_error); \
692 switch(type) { \
693 case ICMP6_DST_UNREACH: \
694 icmp6_ifstat_inc(ifp, ifs6_out_dstunreach); \
695 if (code == ICMP6_DST_UNREACH_ADMIN) \
696 icmp6_ifstat_inc(ifp, ifs6_out_adminprohib); \
697 break; \
698 case ICMP6_PACKET_TOO_BIG: \
699 icmp6_ifstat_inc(ifp, ifs6_out_pkttoobig); \
700 break; \
701 case ICMP6_TIME_EXCEEDED: \
702 icmp6_ifstat_inc(ifp, ifs6_out_timeexceed); \
703 break; \
704 case ICMP6_PARAM_PROB: \
705 icmp6_ifstat_inc(ifp, ifs6_out_paramprob); \
706 break; \
707 case ICMP6_ECHO_REQUEST: \
708 icmp6_ifstat_inc(ifp, ifs6_out_echo); \
709 break; \
710 case ICMP6_ECHO_REPLY: \
711 icmp6_ifstat_inc(ifp, ifs6_out_echoreply); \
712 break; \
713 case MLD_LISTENER_QUERY: \
714 icmp6_ifstat_inc(ifp, ifs6_out_mldquery); \
715 break; \
716 case MLD_LISTENER_REPORT: \
717 icmp6_ifstat_inc(ifp, ifs6_out_mldreport); \
718 break; \
719 case MLD_LISTENER_DONE: \
720 icmp6_ifstat_inc(ifp, ifs6_out_mlddone); \
721 break; \
722 case ND_ROUTER_SOLICIT: \
723 icmp6_ifstat_inc(ifp, ifs6_out_routersolicit); \
724 break; \
725 case ND_ROUTER_ADVERT: \
726 icmp6_ifstat_inc(ifp, ifs6_out_routeradvert); \
727 break; \
728 case ND_NEIGHBOR_SOLICIT: \
729 icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit); \
730 break; \
731 case ND_NEIGHBOR_ADVERT: \
732 icmp6_ifstat_inc(ifp, ifs6_out_neighboradvert); \
733 break; \
734 case ND_REDIRECT: \
735 icmp6_ifstat_inc(ifp, ifs6_out_redirect); \
736 break; \
737 } \
738} while (0)
739
740extern int icmp6_rediraccept; /* accept/process redirects */
741extern int icmp6_redirtimeout; /* cache time for redirect routes */
742#endif /* _KERNEL */
743
744#endif /* not _NETINET_ICMP6_H_ */
W32_CLANG_PACK_WARN_DEF
W32_CLANG_PACK_WARN_DEF() struct icmp6_filter
This hook is to prevent the BSD-socket API being linked in by default.
Definition: icmp6.h:511
in.h
pack_off.h
icmp6_namelookup
Definition: icmp6.h:358
icmp6_nodeinfo
Definition: icmp6.h:372
icmp6_router_renum
Definition: icmp6.h:444
icmp6errstat
Definition: icmp6.h:547
icmp6stat
Definition: icmp6.h:563
in6_addr
Definition: in.h:151
in6_multi
Definition: in6_var.h:522
ip6ctlparam
Definition: ip6proto.h:107
mbuf
Definition: mbuf.h:6
mld_hdr
Definition: icmp6.h:191
nd_neighbor_advert
Definition: icmp6.h:268
nd_neighbor_solicit
Definition: icmp6.h:257
nd_opt_hdr
Definition: icmp6.h:302
nd_opt_mtu
Definition: icmp6.h:338
nd_opt_prefix_info
Definition: icmp6.h:316
nd_opt_rd_hdr
Definition: icmp6.h:330
nd_opt_route_info
Definition: icmp6.h:345
nd_redirect
Definition: icmp6.h:290
nd_router_advert
Definition: icmp6.h:228
nd_router_solicit
Definition: icmp6.h:218
ni_reply_fqdn
Definition: icmp6.h:435
rr_pco_match
Definition: icmp6.h:463
rr_pco_use
Definition: icmp6.h:479
rr_result
Definition: icmp6.h:501
rtentry
Definition: route.h:97
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/netinet/icmp_var.h Source File

  • inc
  • netinet
icmp_var.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_ICMP_VAR_H
39#define __NETINET_ICMP_VAR_H
40
41#include <sys/wtypes.h>
42
43#ifndef ICMP_MAXTYPE
44#define ICMP_MAXTYPE 18
45#endif
46
47/*
48 * Variables related to this implementation
49 * of the internet control message protocol.
50 */
51struct icmpstat {
52/* statistics related to icmp packets generated */
53 u_long icps_error; /* # of calls to icmp_error */
54 u_long icps_oldshort; /* no error 'cuz old ip too short */
55 u_long icps_oldicmp; /* no error 'cuz old was icmp */
56 u_long icps_outhist[ICMP_MAXTYPE + 1];
57/* statistics related to input messages processed */
58 u_long icps_badcode; /* icmp_code out of range */
59 u_long icps_tooshort; /* packet < ICMP_MINLEN */
60 u_long icps_checksum; /* bad checksum */
61 u_long icps_badlen; /* calculated bound mismatch */
62 u_long icps_reflect; /* number of responses */
63 u_long icps_inhist[ICMP_MAXTYPE + 1];
64 u_long icps_bmcastecho; /* b/mcast echo requests dropped */
65 u_long icps_bmcasttstamp; /* b/mcast tstamp requests dropped */
66 u_long icps_badaddr; /* bad return address */
67 u_long icps_noroute; /* no route back */
68};
69
70/*
71 * Names for ICMP sysctl objects
72 */
73#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
74#define ICMPCTL_STATS 2 /* statistics (read-only) */
75#define ICMPCTL_ICMPLIM 3
76#define ICMPCTL_MAXID 4
77
78#define ICMPCTL_NAMES { \
79 { 0, 0 }, \
80 { "maskrepl", CTLTYPE_INT }, \
81 { "stats", CTLTYPE_STRUCT }, \
82 { "icmplim", CTLTYPE_INT }, \
83}
84
85#endif
icmpstat
Definition: icmp_var.h:51
wtypes.h


Watt-32 tcp/ip: E:/WATT/src/idna.h Source File

  • src
idna.h
Go to the documentation of this file.
1
3#ifndef _w32_IDNA_H
4#define _w32_IDNA_H
5
6typedef long ucs4_t;
7
8typedef struct {
9 int istate;
10 } *conv_t;
11
12typedef struct {
13 WORD indx; /* index into big table */
14 WORD used; /* bitmask of used entries */
15 } Summary16;
16
17#define iconv_init W32_NAMESPACE (iconv_init)
18#define iconv_strerror W32_NAMESPACE (iconv_strerror)
19#define IDNA_convert_to_ACE W32_NAMESPACE (IDNA_convert_to_ACE)
20#define IDNA_convert_from_ACE W32_NAMESPACE (IDNA_convert_from_ACE)
21
22extern const char *iconv_strerror (int rc);
23extern BOOL iconv_init (WORD code_page);
24
25extern BOOL IDNA_convert_to_ACE (char *name, size_t *size);
26extern BOOL IDNA_convert_from_ACE (char *name, size_t *size);
27
28#ifndef MAX_LABELS
29#define MAX_LABELS 8
30#endif
31
32#if defined(USE_DEBUG) || defined(TEST_PROG)
33 #define IDNA_DEBUG(lvl, args) \
34 do { \
35 if (debug_on >= lvl) { \
36 (*_printf) ("%s(%u): ", __FILE__, __LINE__); \
37 (*_printf) args; \
38 fflush (stdout); \
39 } \
40 } while (0)
41#else
42 #define IDNA_DEBUG(lvl, args) ((void)0)
43#endif
44
45#define RET_ILUNI -1
46#define RET_ILSEQ -2
47#define RET_TOOSMALL -3
48#define RET_TOOFEW(n) (-4-(n))
49
50#endif /* _w32_IDNA_H */
51
IDNA_convert_from_ACE
BOOL IDNA_convert_from_ACE(char *name, size_t *size)
Convert a possibly ACE-encoded name to a name in native codepage.
Definition: idna.c:450
iconv_init
BOOL iconv_init(WORD code_page)
Initialise iconv; find codepage and mapping functions to use.
Definition: idna.c:157
IDNA_convert_to_ACE
BOOL IDNA_convert_to_ACE(char *name, size_t *size)
Convert a possibly non-ASCII name into ACE-form.
Definition: idna.c:383
iconv_strerror
const char * iconv_strerror(int rc)
Return textual error for 'rc'.
Definition: idna.c:180
Summary16
Definition: idna.h:12
conv_t
Definition: idna.h:8


Watt-32 tcp/ip: E:/WATT/inc/net/if.h Source File

  • inc
  • net
if.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1989, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NET_IF_H
39#define __NET_IF_H
40
41#include <sys/socket.h>
42
43#ifndef __SYS_QUEUE_H
44#include <sys/queue.h>
45#endif
46
47#ifndef __SYS_MBUF_H
48#include <sys/mbuf.h>
49#endif
50
51/*
52 * Structures defining a network interface, providing a packet
53 * transport mechanism (ala level 0 of the PUP protocols).
54 *
55 * Each interface accepts output datagrams of a specified maximum
56 * length, and provides higher level routines with input datagrams
57 * received from its medium.
58 *
59 * Output occurs when the routine if_output is called, with four parameters:
60 * (*ifp->if_output)(ifp, m, dst, rt)
61 * Here m is the mbuf chain to be sent and dst is the destination address.
62 * The output routine encapsulates the supplied datagram if necessary,
63 * and then transmits it on its medium.
64 *
65 * On input, each interface unwraps the data received by it, and either
66 * places it on the input queue of a internetwork datagram routine
67 * and posts the associated software interrupt, or passes the datagram to a raw
68 * packet input routine.
69 *
70 * Routines exist for locating interfaces by their addresses
71 * or for locating a interface on a certain network, as well as more general
72 * routing and gateway routines maintaining information used to locate
73 * interfaces. These routines live in the files if.c and route.c
74 */
75#ifndef __SYS_WTIME_H
76#include <sys/wtime.h>
77#endif
78
79struct rtentry;
80struct ether_header;
81struct proc { int dummy; };
82struct socket { int dummy; };
83
84/*
85 * Structure defining statistics and other data kept regarding a network
86 * interface.
87 */
88struct if_data {
89 /* generic interface information */
90 u_char ifi_type; /* ethernet, tokenring, etc. */
91 u_char ifi_addrlen; /* media address length */
92 u_char ifi_hdrlen; /* media header length */
93 u_long ifi_mtu; /* maximum transmission unit */
94 u_long ifi_metric; /* routing metric (external only) */
95 u_long ifi_baudrate; /* linespeed */
96 /* volatile statistics */
97 u_long ifi_ipackets; /* packets received on interface */
98 u_long ifi_ierrors; /* input errors on interface */
99 u_long ifi_opackets; /* packets sent on interface */
100 u_long ifi_oerrors; /* output errors on interface */
101 u_long ifi_collisions; /* collisions on csma interfaces */
102 u_long ifi_ibytes; /* total number of octets received */
103 u_long ifi_obytes; /* total number of octets sent */
104 u_long ifi_imcasts; /* packets received via multicast */
105 u_long ifi_omcasts; /* packets sent via multicast */
106 u_long ifi_iqdrops; /* dropped on input, this interface */
107 u_long ifi_noproto; /* destined for unsupported protocol */
108 struct timeval ifi_lastchange; /* last updated */
109};
110
111/*
112 * Structure defining a queue for a network interface.
113 *
114 * (Would like to call this struct ``if'', but C isn't PL/1.)
115 */
116TAILQ_HEAD(ifnet_head, ifnet); /* the actual queue head */
117
118/*
119 * Length of interface external name, including terminating '\0'.
120 * Note: this is the same size as a generic device's external name.
121 */
122#define IFNAMSIZ 16
123
124#ifndef IF_NAMESIZE
125#define IF_NAMESIZE IFNAMSIZ
126#endif
127
128struct ifqueue {
129 struct mbuf *ifq_head;
130 struct mbuf *ifq_tail;
131 int ifq_len;
132 int ifq_maxlen;
133 int ifq_drops;
134 };
135
136struct ifnet { /* and the entries */
137 void *if_softc; /* lower-level data for this if */
138 TAILQ_ENTRY(ifnet) if_list; /* all struct ifnets are chained */
139 TAILQ_HEAD(xx, ifaddr) if_addrlist; /* linked list of addresses per if */
140 char if_xname[IFNAMSIZ]; /* external name (name + unit) */
141 int if_pcount; /* number of promiscuous listeners */
142 caddr_t if_bpf; /* packet filter structure */
143 u_short if_index; /* numeric abbreviation for this if */
144 short if_timer; /* time 'til if_watchdog called */
145 short if_flags; /* up/down, broadcast, etc. */
146 short if__pad1; /* be nice to m68k ports */
147 struct if_data if_data; /* statistics and other data about if */
148
149 /* procedure handles */
150 int (*if_output) /* output routine (enqueue) */
151 (struct ifnet *, struct mbuf *, struct sockaddr *,
152 struct rtentry *);
153 void (*if_start) /* initiate output routine */
154 (struct ifnet *);
155 int (*if_ioctl) /* ioctl routine */
156 (struct ifnet *, u_long, caddr_t);
157 int (*if_reset) /* XXX bus reset routine */
158 (struct ifnet *);
159 void (*if_watchdog) /* timer routine */
160 (struct ifnet *);
161 struct ifqueue if_snd; /* output queue */
162 struct sockaddr_dl *if_sadl; /* pointer to our sockaddr_dl */
163 u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */
164};
165
166#define if_mtu if_data.ifi_mtu
167#define if_type if_data.ifi_type
168#define if_addrlen if_data.ifi_addrlen
169#define if_hdrlen if_data.ifi_hdrlen
170#define if_metric if_data.ifi_metric
171#define if_baudrate if_data.ifi_baudrate
172#define if_ipackets if_data.ifi_ipackets
173#define if_ierrors if_data.ifi_ierrors
174#define if_opackets if_data.ifi_opackets
175#define if_oerrors if_data.ifi_oerrors
176#define if_collisions if_data.ifi_collisions
177#define if_ibytes if_data.ifi_ibytes
178#define if_obytes if_data.ifi_obytes
179#define if_imcasts if_data.ifi_imcasts
180#define if_omcasts if_data.ifi_omcasts
181#define if_iqdrops if_data.ifi_iqdrops
182#define if_noproto if_data.ifi_noproto
183#define if_lastchange if_data.ifi_lastchange
184
185#define IFF_UP 0x1 /* interface is up */
186#define IFF_BROADCAST 0x2 /* broadcast address valid */
187#define IFF_DEBUG 0x4 /* turn on debugging */
188#define IFF_LOOPBACK 0x8 /* is a loopback net */
189#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
190#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */
191#define IFF_RUNNING 0x40 /* resources allocated */
192#define IFF_NOARP 0x80 /* no address resolution protocol */
193#define IFF_PROMISC 0x100 /* receive all packets */
194#define IFF_ALLMULTI 0x200 /* receive all multicast packets */
195#define IFF_OACTIVE 0x400 /* transmission in progress */
196#define IFF_SIMPLEX 0x800 /* can't hear own transmissions */
197#define IFF_LINK0 0x1000 /* per link layer defined bit */
198#define IFF_LINK1 0x2000 /* per link layer defined bit */
199#define IFF_LINK2 0x4000 /* per link layer defined bit */
200#define IFF_MULTICAST 0x8000 /* supports multicast */
201
202/* flags set internally only: */
203#define IFF_CANTCHANGE \
204 (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\
205 IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI)
206
207/*
208 * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1)
209 * input routines have queues of messages stored on ifqueue structures
210 * (defined above). Entries are added to and deleted from these structures
211 * by these macros, which should be called with ipl raised to splimp().
212 */
213#define IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen)
214#define IF_DROP(ifq) ((ifq)->ifq_drops++)
215#define IF_ENQUEUE(ifq, m) { \
216 (m)->m_nextpkt = 0; \
217 if ((ifq)->ifq_tail == 0) \
218 (ifq)->ifq_head = m; \
219 else \
220 (ifq)->ifq_tail->m_nextpkt = m; \
221 (ifq)->ifq_tail = m; \
222 (ifq)->ifq_len++; \
223}
224#define IF_PREPEND(ifq, m) { \
225 (m)->m_nextpkt = (ifq)->ifq_head; \
226 if ((ifq)->ifq_tail == 0) \
227 (ifq)->ifq_tail = (m); \
228 (ifq)->ifq_head = (m); \
229 (ifq)->ifq_len++; \
230}
231#define IF_DEQUEUE(ifq, m) { \
232 (m) = (ifq)->ifq_head; \
233 if (m) { \
234 if (((ifq)->ifq_head = (m)->m_nextpkt) == 0) \
235 (ifq)->ifq_tail = 0; \
236 (m)->m_nextpkt = 0; \
237 (ifq)->ifq_len--; \
238 } \
239}
240
241#define IFQ_MAXLEN 50
242#define IFNET_SLOWHZ 1 /* granularity is 1 second */
243
244/*
245 * The ifaddr structure contains information about one address
246 * of an interface. They are maintained by the different address families,
247 * are allocated and attached when an address is set, and are linked
248 * together so all addresses for an interface can be located.
249 */
250struct ifaddr {
251 struct sockaddr *ifa_addr; /* address of interface */
252 struct sockaddr *ifa_dstaddr; /* other end of p-to-p link */
253#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
254 struct sockaddr *ifa_netmask; /* used to determine subnet */
255 struct ifnet *ifa_ifp; /* back-pointer to interface */
256 TAILQ_ENTRY(ifaddr) ifa_list; /* list of addresses for interface */
257 void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */
258 (int, struct rtentry *, struct sockaddr *);
259 u_short ifa_flags; /* mostly rt_flags for cloning */
260 short ifa_refcnt; /* count of references */
261 int ifa_metric; /* cost of going out this interface */
262};
263#define IFA_ROUTE RTF_UP /* route installed */
264
265/*
266 * Message format for use in obtaining information about interfaces
267 * from sysctl and the routing socket.
268 */
269struct if_msghdr {
270 u_short ifm_msglen; /* to skip over non-understood messages */
271 u_char ifm_version; /* future binary compatability */
272 u_char ifm_type; /* message type */
273 int ifm_addrs; /* like rtm_addrs */
274 int ifm_flags; /* value of if_flags */
275 u_short ifm_index; /* index for associated ifp */
276 struct if_data ifm_data; /* statistics and other data about if */
277};
278
279/*
280 * Message format for use in obtaining information about interface addresses
281 * from sysctl and the routing socket.
282 */
283struct ifa_msghdr {
284 u_short ifam_msglen; /* to skip over non-understood messages */
285 u_char ifam_version; /* future binary compatability */
286 u_char ifam_type; /* message type */
287 int ifam_addrs; /* like rtm_addrs */
288 int ifam_flags; /* value of ifa_flags */
289 u_short ifam_index; /* index for associated ifp */
290 int ifam_metric; /* value of ifa_metric */
291};
292
293/*
294 * Interface request structure used for socket
295 * ioctl's. All interface ioctl's must have parameter
296 * definitions which begin with ifr_name. The
297 * remainder may be interface specific.
298 */
299struct ifreq {
300 char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
301 union {
302 struct sockaddr ifru_addr;
303 struct sockaddr ifru_dstaddr;
304 struct sockaddr ifru_hwaddr;
305 struct sockaddr ifru_broadaddr;
306 short ifru_flags;
307 int ifru_metric;
308 int ifru_mtu;
309 caddr_t ifru_data;
310 } ifr_ifru;
311#define ifr_addr ifr_ifru.ifru_addr /* address */
312#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
313#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* hardware address */
314#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
315#define ifr_flags ifr_ifru.ifru_flags /* flags */
316#define ifr_metric ifr_ifru.ifru_metric /* metric */
317#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
318#define ifr_media ifr_ifru.ifru_metric /* media options (overload) */
319#define ifr_data ifr_ifru.ifru_data /* for use by interface */
320};
321
322struct ifaliasreq {
323 char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
324 struct sockaddr ifra_addr;
325 struct sockaddr ifra_dstaddr;
326#define ifra_broadaddr ifra_dstaddr
327 struct sockaddr ifra_mask;
328};
329
330struct ifmediareq {
331 char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
332 int ifm_current; /* current media options */
333 int ifm_mask; /* don't care mask */
334 int ifm_status; /* media status */
335 int ifm_active; /* active options */
336 int ifm_count; /* # entries in ifm_ulist array */
337 int *ifm_ulist; /* media words */
338};
339
340/*
341 * Structure used in SIOCGIFCONF request.
342 * Used to retrieve interface configuration
343 * for machine (useful for programs which
344 * must know all networks accessible).
345 */
346struct ifconf {
347 int ifc_len; /* size of associated buffer */
348 union {
349 caddr_t ifcu_buf;
350 struct ifreq *ifcu_req;
351 } ifc_ifcu;
352#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
353#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
354};
355
356#ifndef __NET_IF_ARP_H
357#include <net/if_arp.h>
358#endif
359
360#endif
if_arp.h
socket.h
queue.h
ether_header
Definition: if_ether.h:71
if_data
Definition: if.h:88
if_msghdr
Definition: if.h:269
ifa_msghdr
Definition: if.h:283
ifaddr
Definition: if.h:250
ifaliasreq
Definition: if.h:322
ifconf
Definition: if.h:346
ifmediareq
Definition: if.h:330
ifnet
Definition: if.h:136
ifqueue
Definition: if.h:128
ifreq
Definition: if.h:299
mbuf
Definition: mbuf.h:6
proc
Definition: if.h:81
rtentry
Definition: route.h:97
sockaddr_dl
Definition: if_dl.h:71
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
timeval
Definition: wtime.h:30
wtime.h


Watt-32 tcp/ip: E:/WATT/inc/net/if_arc.h Source File

  • inc
  • net
if_arc.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 */
38
39#ifndef __NET_IF_ARC_H
40#define __NET_IF_ARC_H
41
42#include <net/if.h>
43
44#ifndef __SYS_MBUF_H
45#include <sys/mbuf.h>
46#endif
47
48W32_CLANG_PACK_WARN_OFF()
49
50#include <sys/pack_on.h>
51
52/*
53 * Arcnet address - 1 octets
54 * don't know who uses this.
55 */
56struct arc_addr {
57 u_int8_t arc_addr_octet[1];
58};
59
60/*
61 * Structure of a 2.5MB/s Arcnet header.
62 * as given to interface code.
63 */
64struct arc_header {
65 u_int8_t arc_shost;
66 u_int8_t arc_dhost;
67 u_int8_t arc_type;
68 /*
69 * only present for newstyle encoding with LL fragmentation.
70 * Don't use sizeof(anything), use ARC_HDR{,NEW}LEN instead.
71 */
72 u_int8_t arc_flag;
73 u_int16_t arc_seqid;
74
75 /*
76 * only present in exception packets (arc_flag == 0xff)
77 */
78 u_int8_t arc_type2; /* same as arc_type */
79 u_int8_t arc_flag2; /* real flag value */
80 u_int16_t arc_seqid2; /* real seqid value */
81};
82
83#define ARC_ADDR_LEN 1
84
85#define ARC_HDRLEN 3
86#define ARC_HDRNEWLEN 6
87
88/* these lengths are data link layer length - 2*ARC_ADDR_LEN */
89#define ARC_MIN_LEN 1
90#define ARC_MIN_FORBID_LEN 254
91#define ARC_MAX_FORBID_LEN 256
92#define ARC_MAX_LEN 508
93
94
95/* RFC 1051 */
96#define ARCTYPE_IP_OLD 240 /* IP protocol */
97#define ARCTYPE_ARP_OLD 241 /* address resolution protocol */
98
99/* RFC 1201 */
100#define ARCTYPE_IP 212 /* IP protocol */
101#define ARCTYPE_ARP 213 /* address resolution protocol */
102#define ARCTYPE_REVARP 214 /* reverse addr resolution protocol */
103
104#define ARCTYPE_ATALK 221 /* Appletalk */
105#define ARCTYPE_BANIAN 247 /* Banyan Vines */
106#define ARCTYPE_IPX 250 /* Novell IPX */
107
108#define ARCMTU 507
109#define ARCMIN 0
110
111struct arccom {
112 struct ifnet ac_if; /* network-visible interface */
113
114 u_int16_t ac_seqid; /* seq. id used by PHDS encap. */
115
116 struct ac_frag {
117 u_int8_t af_maxflag; /* from first packet */
118 u_int8_t af_lastseen; /* last split flag seen */
119 u_int16_t af_seqid;
120 struct mbuf *af_packet;
121 } ac_fragtab[256]; /* indexed by sender ll address */
122
123};
124
125#include <sys/pack_off.h>
126
127W32_CLANG_PACK_WARN_DEF()
128
129#endif
if.h
pack_off.h
arc_header
Definition: if_arc.h:64
arccom::ac_frag
Definition: if_arc.h:116
arccom
Definition: if_arc.h:111
ifnet
Definition: if.h:136
mbuf
Definition: mbuf.h:6


Watt-32 tcp/ip: E:/WATT/inc/net/if_arp.h Source File

  • inc
  • net
if_arp.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NET_IF_ARP_H
39#define __NET_IF_ARP_H
40
41#include <net/if.h>
42
43/*
44 * Address Resolution Protocol.
45 *
46 * See RFC 826 for protocol description. ARP packets are variable
47 * in size; the arphdr structure defines the fixed-length portion.
48 * Protocol type values are the same as those for 10 Mb/s Ethernet.
49 * It is followed by the variable-sized fields ar_sha, arp_spa,
50 * arp_tha and arp_tpa in that order, according to the lengths
51 * specified. Field names used correspond to RFC 826.
52 */
53
54W32_CLANG_PACK_WARN_OFF()
55
56#include <sys/pack_on.h>
57
58struct arphdr {
59 u_int16_t ar_hrd; /* format of hardware address */
60#define ARPHRD_ETHER 1 /* ethernet hardware format */
61#define ARPHRD_TOKEN 6 /* TokenRing hardware format */
62#define ARPHRD_ARCNET 7 /* ethernet hardware format */
63#define ARPHRD_FRELAY 15 /* frame relay hardware format */
64#define ARPHRD_STRIP 23 /* Ricochet Starmode Radio hardware format */
65 u_int16_t ar_pro; /* format of protocol address */
66 u_int8_t ar_hln; /* length of hardware address */
67 u_int8_t ar_pln; /* length of protocol address */
68 u_int16_t ar_op; /* one of: */
69#define ARPOP_REQUEST 1 /* request to resolve address */
70#define ARPOP_REPLY 2 /* response to previous request */
71#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
72#define ARPOP_REVREPLY 4 /* response giving protocol address */
73#define ARPOP_INVREQUEST 8 /* request to identify peer */
74#define ARPOP_INVREPLY 9 /* response identifying peer */
75/*
76 * The remaining fields are variable in size,
77 * according to the sizes above.
78 */
79#ifdef COMMENT_ONLY
80 u_int8_t ar_sha[]; /* sender hardware address */
81 u_int8_t ar_spa[]; /* sender protocol address */
82 u_int8_t ar_tha[]; /* target hardware address */
83 u_int8_t ar_tpa[]; /* target protocol address */
84#endif
85#ifdef __GNUC__ /* only GNU C allows zero arrays */
86 u_int8_t ar_remain[0]; /* minimum size, normally bigger */
87 #define ar_sha(ap) (((ap)->ar_remain)+0)
88 #define ar_spa(ap) (((ap)->ar_remain)+(ap)->ar_hln)
89 #define ar_tha(ap) (((ap)->ar_remain)+(ap)->ar_hln+(ap)->ar_pln)
90 #define ar_tpa(ap) (((ap)->ar_remain)+2*(ap)->ar_hln+(ap)->ar_pln)
91#else
92 #define ar_sha(ap) (((ap)->ar_op)+2)
93 #define ar_spa(ap) (((ap)->ar_op)+2+(ap)->ar_hln)
94 #define ar_tha(ap) (((ap)->ar_op)+2+(ap)->ar_hln+(ap)->ar_pln)
95 #define ar_tpa(ap) (((ap)->ar_op)+2+2*(ap)->ar_hln+(ap)->ar_pln)
96#endif
97};
98
99
100/*
101 * ARP ioctl request
102 */
103struct arpreq {
104 struct sockaddr arp_pa; /* protocol address */
105 struct sockaddr arp_ha; /* hardware address */
106 int arp_flags; /* flags */
107};
108
109#include <sys/pack_off.h>
110
111 W32_CLANG_PACK_WARN_DEF()
112
113
114/* arp_flags and at_flags field values */
115#define ATF_INUSE 0x01 /* entry in use */
116#define ATF_COM 0x02 /* completed entry (enaddr valid) */
117#define ATF_PERM 0x04 /* permanent entry */
118#define ATF_PUBL 0x08 /* publish entry (respond for other host) */
119#define ATF_USETRAILERS 0x10 /* has requested trailers */
120
121#endif
if.h
W32_CLANG_PACK_WARN_DEF
W32_CLANG_PACK_WARN_DEF() __BEGIN_DECLS W32_FUNC int W32_CALL accept(int
This hook is to prevent the BSD-socket API being linked in by default.
Definition: pcsed.h:261
pack_off.h
arpreq
Definition: if_arp.h:103
sockaddr
Definition: socket.h:181


Watt-32 tcp/ip: E:/WATT/inc/net/if_atm.h Source File

  • inc
  • net
if_atm.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1996 Charles D. Cranor and Washington University.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Charles D. Cranor and
20 * Washington University.
21 * 4. The name of the author may not be used to endorse or promote products
22 * derived from this software without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */
35#ifndef __NET_IF_ATM_H
36#define __NET_IF_ATM_H
37
38#include <sys/cdefs.h>
39#include <sys/wtypes.h>
40
41#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
42 #define RTALLOC1(A,B) rtalloc1((A),(B))
43#elif defined(__FreeBSD__)
44 #define RTALLOC1(A,B) rtalloc1((A),(B),0UL)
45#endif
46
47W32_CLANG_PACK_WARN_OFF()
48
49#include <sys/pack_on.h>
50
51/*
52 * pseudo header for packet transmission
53 */
54
55struct atm_pseudohdr {
56 u_int8_t atm_ph[4]; /* flags+VPI+VCI1(msb)+VCI2(lsb) */
57};
58
59#define ATM_PH_FLAGS(X) ((X)->atm_ph[0])
60#define ATM_PH_VPI(X) ((X)->atm_ph[1])
61#define ATM_PH_VCI(X) ((((X)->atm_ph[2]) << 8) | ((X)->atm_ph[3]))
62#define ATM_PH_SETVCI(X,V) { \
63 (X)->atm_ph[2] = ((V) >> 8) & 0xff; \
64 (X)->atm_ph[3] = ((V) & 0xff); \
65}
66
67#define ATM_PH_AAL5 0x01 /* use AAL5? (0 == aal0) */
68#define ATM_PH_LLCSNAP 0x02 /* use the LLC SNAP encoding (iff aal5) */
69
70#define ATM_PH_DRIVER7 0x40 /* reserve for driver's use */
71#define ATM_PH_DRIVER8 0x80 /* reserve for driver's use */
72
73#define ATMMTU 9180 /* ATM MTU size for IP */
74 /* XXX: could be 9188 with LLC/SNAP according
75 to comer */
76
77/* user's ioctl hook for raw atm mode */
78#define SIOCRAWATM _IOWR('a', 122, int) /* set driver's raw mode */
79
80/* atm_pseudoioctl: turns on and off RX VCIs [for internal use only!] */
81struct atm_pseudoioctl {
82 struct atm_pseudohdr aph;
83 void *rxhand;
84};
85#define SIOCATMENA _IOWR('a', 123, struct atm_pseudoioctl) /* enable */
86#define SIOCATMDIS _IOWR('a', 124, struct atm_pseudoioctl) /* disable */
87
88/*
89 * XXX forget all the garbage in if_llc.h and do it the easy way
90 */
91
92#define ATMLLC_HDR "\252\252\3\0\0\0"
93struct atmllc {
94 u_int8_t llchdr[6]; /* aa.aa.03.00.00.00 */
95 u_int8_t type[2]; /* "ethernet" type */
96};
97
98#include <sys/pack_off.h>
99
100W32_CLANG_PACK_WARN_DEF()
101
102/* ATM_LLC macros: note type code in host byte order */
103#define ATM_LLC_TYPE(X) (((X)->type[0] << 8) | ((X)->type[1]))
104#define ATM_LLC_SETTYPE(X,V) { \
105 (X)->type[1] = ((V) >> 8) & 0xff; \
106 (X)->type[0] = ((V) & 0xff); \
107}
108
109#endif
cdefs.h
pack_off.h
atm_pseudoioctl
Definition: if_atm.h:81
atmllc
Definition: if_atm.h:93
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/net/if_dl.h Source File

  • inc
  • net
if_dl.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1990, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37#ifndef __NET_IF_DL_H
38#define __NET_IF_DL_H
39
40#ifndef __SYS_W32API_H
41#include <sys/w32api.h>
42#endif
43
44#ifndef __SYS_CDEFS_H
45#include <sys/cdefs.h>
46#endif
47
48#include <sys/wtypes.h>
49
50/*
51 * A Link-Level Sockaddr may specify the interface in one of two
52 * ways: either by means of a system-provided index number (computed
53 * anew and possibly differently on every reboot), or by a human-readable
54 * string such as "il0" (for managerial convenience).
55 *
56 * Census taking actions, such as something akin to SIOCGCONF would return
57 * both the index and the human name.
58 *
59 * High volume transactions (such as giving a link-level ``from'' address
60 * in a recvfrom or recvmsg call) may be likely only to provide the indexed
61 * form, (which requires fewer copy operations and less space).
62 *
63 * The form and interpretation of the link-level address is purely a matter
64 * of convention between the device driver and its consumers; however, it is
65 * expected that all drivers for an interface of a given if_type will agree.
66 */
67
68/*
69 * Structure of a Link-Level sockaddr:
70 */
71struct sockaddr_dl {
72 u_char sdl_len; /* Total length of sockaddr */
73 u_char sdl_family; /* AF_DLI */
74 u_int16_t sdl_index; /* if != 0, system given index for interface */
75 u_char sdl_type; /* interface type */
76 u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
77 u_char sdl_alen; /* link level address length */
78 u_char sdl_slen; /* link layer selector length */
79 char sdl_data[12]; /* minimum work area, can be larger;
80 * contains both if name and ll address */
81};
82
83#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
84
85__BEGIN_DECLS
86
87W32_FUNC void W32_CALL link_addr (const char *, struct sockaddr_dl *);
88W32_FUNC char *W32_CALL link_ntoa (const struct sockaddr_dl *);
89
90__END_DECLS
91
92#endif
cdefs.h
sockaddr_dl
Definition: if_dl.h:71
w32api.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/net/if_llc.h Source File

  • inc
  • net
if_llc.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1988, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37#ifndef __NET_IF_LLC_H
38#define __NET_IF_LLC_H
39
40#include <sys/cdefs.h>
41#include <sys/wtypes.h>
42
43/*
44 * IEEE 802.2 Link Level Control headers, for use in conjunction with
45 * 802.{3,4,5} media access control methods.
46 *
47 * Headers here do not use bit fields due to shortcommings in many
48 * compilers.
49 */
50
51W32_CLANG_PACK_WARN_OFF()
52
53#include <sys/pack_on.h>
54
55struct llc {
56 u_int8_t llc_dsap;
57 u_int8_t llc_ssap;
58 union {
59 struct {
60 u_int8_t control;
61 u_int8_t format_id;
62 u_int8_t class_id;
63 u_int8_t window_x2;
64 } type_u;
65 struct {
66 u_int8_t num_snd_x2;
67 u_int8_t num_rcv_x2;
68 } type_i;
69 struct {
70 u_int8_t control;
71 u_int8_t num_rcv_x2;
72 } type_s;
73 struct {
74 u_int8_t control;
75 /*
76 * We cannot put the following fields in a structure because
77 * the structure rounding might cause padding.
78 */
79 u_int8_t frmr_rej_pdu0;
80 u_int8_t frmr_rej_pdu1;
81 u_int8_t frmr_control;
82 u_int8_t frmr_control_ext;
83 u_int8_t frmr_cause;
84 } type_frmr;
85 struct {
86 u_int8_t control;
87 u_int8_t org_code[3];
88 u_int16_t ether_type;
89 } type_snap;
90 struct {
91 u_int8_t control;
92 u_int8_t control_ext;
93 } type_raw;
94 } llc_un;
95};
96
97struct frmrinfo {
98 u_int8_t frmr_rej_pdu0;
99 u_int8_t frmr_rej_pdu1;
100 u_int8_t frmr_control;
101 u_int8_t frmr_control_ext;
102 u_int8_t frmr_cause;
103};
104
105#include <sys/pack_off.h>
106
107W32_CLANG_PACK_WARN_DEF()
108
109#define llc_control llc_un.type_u.control
110#define llc_control_ext llc_un.type_raw.control_ext
111#define llc_fid llc_un.type_u.format_id
112#define llc_class llc_un.type_u.class_id
113#define llc_window llc_un.type_u.window_x2
114#define llc_frmrinfo llc_un.type_frmr.frmr_rej_pdu0
115#define llc_frmr_pdu0 llc_un.type_frmr.frmr_rej_pdu0
116#define llc_frmr_pdu1 llc_un.type_frmr.frmr_rej_pdu1
117#define llc_frmr_control llc_un.type_frmr.frmr_control
118#define llc_frmr_control_ext llc_un.type_frmr.frmr_control_ext
119#define llc_frmr_cause llc_un.type_frmr.frmr_cause
120
121/*
122 * Don't use sizeof(struct llc_un) for LLC header sizes
123 */
124#define LLC_ISFRAMELEN 4
125#define LLC_UFRAMELEN 3
126#define LLC_FRMRLEN 7
127
128/*
129 * Unnumbered LLC format commands
130 */
131#define LLC_UI 0x3
132#define LLC_UI_P 0x13
133#define LLC_DISC 0x43
134#define LLC_DISC_P 0x53
135#define LLC_UA 0x63
136#define LLC_UA_P 0x73
137#define LLC_TEST 0xe3
138#define LLC_TEST_P 0xf3
139#define LLC_FRMR 0x87
140#define LLC_FRMR_P 0x97
141#define LLC_DM 0x0f
142#define LLC_DM_P 0x1f
143#define LLC_XID 0xaf
144#define LLC_XID_P 0xbf
145#define LLC_SABME 0x6f
146#define LLC_SABME_P 0x7f
147
148/*
149 * Supervisory LLC commands
150 */
151#define LLC_RR 0x01
152#define LLC_RNR 0x05
153#define LLC_REJ 0x09
154
155/*
156 * Info format - dummy only
157 */
158#define LLC_INFO 0x00
159
160/*
161 * ISO PDTR 10178 contains among others
162 */
163#define LLC_X25_LSAP 0x7e
164#define LLC_SNAP_LSAP 0xaa
165#define LLC_ISO_LSAP 0xfe
166
167#endif
cdefs.h
pack_off.h
frmrinfo
Definition: if_llc.h:97
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/net/if_media.h Source File

  • inc
  • net
if_media.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1997
7 * Jonathan Stone and Jason R. Thorpe. All rights reserved.
8 *
9 * This software is derived from information provided by Matt Thomas.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by Jonathan Stone
22 * and Jason R. Thorpe for the NetBSD Project.
23 * 4. The names of the authors may not be used to endorse or promote products
24 * derived from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
27 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
33 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
34 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 */
38
39#ifndef __NET_IF_MEDIA_H
40#define __NET_IF_MEDIA_H
41
42/*
43 * Prototypes and definitions for BSD/OS-compatible network interface
44 * media selection.
45 *
46 * Where it is safe to do so, this code strays slightly from the BSD/OS
47 * design. Software which uses the API (device drivers, basically)
48 * shouldn't notice any difference.
49 *
50 * Many thanks to Matt Thomas for providing the information necessary
51 * to implement this interface.
52 */
53
54
55/*
56 * if_media Options word:
57 * Bits Use
58 * ---- -------
59 * 0-3 Media variant
60 * 4 RFU
61 * 5-7 Media type
62 * 8-15 Type specific options
63 * 16-19 RFU
64 * 20-27 Shared (global) options
65 * 28-31 Instance
66 */
67
68/*
69 * Ethernet
70 */
71#define IFM_ETHER 0x00000020
72#define IFM_10_T 3 /* 10BaseT - RJ45 */
73#define IFM_10_2 4 /* 10Base2 - Thinnet */
74#define IFM_10_5 5 /* 10Base5 - AUI */
75#define IFM_100_TX 6 /* 100BaseTX - RJ45 */
76#define IFM_100_FX 7 /* 100BaseFX - Fiber */
77#define IFM_100_T4 8 /* 100BaseT4 - 4 pair cat 3 */
78#define IFM_100_VG 9 /* 100VG-AnyLAN */
79#define IFM_100_T2 10 /* 100BaseT2 */
80
81/*
82 * Token ring
83 */
84#define IFM_TOKEN 0x00000040
85#define IFM_TOK_STP4 3 /* Shielded twisted pair 4m - DB9 */
86#define IFM_TOK_STP16 4 /* Shielded twisted pair 16m - DB9 */
87#define IFM_TOK_UTP4 5 /* Unshielded twisted pair 4m - RJ45 */
88#define IFM_TOK_UTP16 6 /* Unshielded twisted pair 16m - RJ45 */
89#define IFM_TOK_ETR 0x00000200 /* Early token release */
90#define IFM_TOK_SRCRT 0x00000400 /* Enable source routing features */
91#define IFM_TOK_ALLR 0x00000800 /* All routes / Single route bcast */
92
93/*
94 * FDDI
95 */
96#define IFM_FDDI 0x00000060
97#define IFM_FDDI_SMF 3 /* Single-mode fiber */
98#define IFM_FDDI_MMF 4 /* Multi-mode fiber */
99#define IFM_FDDI_UTP 5 /* CDDI / UTP */
100#define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */
101
102/*
103 * Shared media sub-types
104 */
105#define IFM_AUTO 0 /* Autoselect best media */
106#define IFM_MANUAL 1 /* Jumper/dipswitch selects media */
107#define IFM_NONE 2 /* Deselect all media */
108
109/*
110 * Shared options
111 */
112#define IFM_FDX 0x00100000 /* Force full duplex */
113#define IFM_HDX 0x00200000 /* Force half duplex */
114#define IFM_FLAG0 0x01000000 /* Driver defined flag */
115#define IFM_FLAG1 0x02000000 /* Driver defined flag */
116#define IFM_FLAG2 0x04000000 /* Driver defined flag */
117#define IFM_LOOP 0x08000000 /* Put hardware in loopback */
118
119/*
120 * Masks
121 */
122#define IFM_NMASK 0x000000e0 /* Network type */
123#define IFM_TMASK 0x0000000f /* Media sub-type */
124#define IFM_IMASK 0xf0000000 /* Instance */
125#define IFM_ISHIFT 28 /* Instance shift */
126#define IFM_OMASK 0x0000ff00 /* Type specific options */
127#define IFM_GMASK 0x0ff00000 /* Global options */
128
129/*
130 * Status bits
131 */
132#define IFM_AVALID 0x00000001 /* Active bit valid */
133#define IFM_ACTIVE 0x00000002 /* Interface attached to working net */
134
135/*
136 * Macros to extract various bits of information from the media word.
137 */
138#define IFM_TYPE(x) ((x) & IFM_NMASK)
139#define IFM_SUBTYPE(x) ((x) & IFM_TMASK)
140#define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT)
141
142/*
143 * NetBSD extension not defined in the BSDI API. This is used in various
144 * places to get the canonical description for a given type/subtype.
145 *
146 * NOTE: all but the top-level type descriptions must contain NO whitespace!
147 * Otherwise, parsing these in ifconfig(8) would be a nightmare.
148 */
149struct ifmedia_description {
150 int ifmt_word; /* word value; may be masked */
151 const char *ifmt_string; /* description */
152};
153
154#define IFM_TYPE_DESCRIPTIONS { \
155 { IFM_ETHER, "Ethernet" }, \
156 { IFM_TOKEN, "Token ring" }, \
157 { IFM_FDDI, "FDDI" }, \
158 { 0, NULL }, \
159}
160
161#define IFM_SUBTYPE_ETHERNET_DESCRIPTIONS { \
162 { IFM_10_T, "10baseT/UTP" }, \
163 { IFM_10_2, "10base2/BNC" }, \
164 { IFM_10_5, "10base5/AUI" }, \
165 { IFM_100_TX, "100baseTX" }, \
166 { IFM_100_FX, "100baseFX" }, \
167 { IFM_100_T4, "100baseT4" }, \
168 { IFM_100_VG, "100baseVG" }, \
169 { IFM_100_T2, "100baseT2" }, \
170 { 0, NULL }, \
171}
172
173#define IFM_SUBTYPE_ETHERNET_ALIASES { \
174 { IFM_10_T, "UTP" }, \
175 { IFM_10_T, "10UTP" }, \
176 { IFM_10_2, "BNC" }, \
177 { IFM_10_2, "10BNC" }, \
178 { IFM_10_5, "AUI" }, \
179 { IFM_10_5, "10AUI" }, \
180 { IFM_100_TX, "100TX" }, \
181 { IFM_100_FX, "100FX" }, \
182 { IFM_100_T4, "100T4" }, \
183 { IFM_100_VG, "100VG" }, \
184 { IFM_100_T2, "100T2" }, \
185 { 0, NULL }, \
186}
187
188#define IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS { \
189 { 0, NULL }, \
190}
191
192#define IFM_SUBTYPE_TOKENRING_DESCRIPTIONS { \
193 { IFM_TOK_STP4, "DB9/4Mbit" }, \
194 { IFM_TOK_STP16, "DB9/16Mbit" }, \
195 { IFM_TOK_UTP4, "UTP/4Mbit" }, \
196 { IFM_TOK_UTP16, "UTP/16Mbit" }, \
197 { 0, NULL }, \
198}
199
200#define IFM_SUBTYPE_TOKENRING_ALIASES { \
201 { IFM_TOK_STP4, "4STP" }, \
202 { IFM_TOK_STP16, "16STP" }, \
203 { IFM_TOK_UTP4, "4UTP" }, \
204 { IFM_TOK_UTP16, "16UTP" }, \
205 { 0, NULL }, \
206}
207
208#define IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS { \
209 { IFM_TOK_ETR, "EarlyTokenRelease" }, \
210 { IFM_TOK_SRCRT, "SourceRouting" }, \
211 { IFM_TOK_ALLR, "AllRoutes" }, \
212 { 0, NULL }, \
213}
214
215#define IFM_SUBTYPE_FDDI_DESCRIPTIONS { \
216 { IFM_FDDI_SMF, "Single-mode" }, \
217 { IFM_FDDI_MMF, "Multi-mode" }, \
218 { IFM_FDDI_UTP, "UTP" }, \
219 { 0, NULL }, \
220}
221
222#define IFM_SUBTYPE_FDDI_ALIASES { \
223 { IFM_FDDI_SMF, "SMF" }, \
224 { IFM_FDDI_MMF, "MMF" }, \
225 { IFM_FDDI_UTP, "CDDI" }, \
226 { 0, NULL }, \
227}
228
229#define IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS { \
230 { IFM_FDDI_DA, "Dual-attach" }, \
231 { 0, NULL }, \
232}
233
234#define IFM_SUBTYPE_SHARED_DESCRIPTIONS { \
235 { IFM_AUTO, "autoselect" }, \
236 { IFM_MANUAL, "manual" }, \
237 { IFM_NONE, "none" }, \
238 { 0, NULL }, \
239}
240
241#define IFM_SUBTYPE_SHARED_ALIASES { \
242 { IFM_AUTO, "auto" }, \
243 { 0, NULL }, \
244}
245
246#define IFM_SHARED_OPTION_DESCRIPTIONS { \
247 { IFM_FDX, "full-duplex" }, \
248 { IFM_HDX, "half-duplex" }, \
249 { IFM_FLAG0, "flag0" }, \
250 { IFM_FLAG1, "flag1" }, \
251 { IFM_FLAG2, "flag2" }, \
252 { IFM_LOOP, "hw-loopback" }, \
253 { 0, NULL }, \
254}
255
256#endif
ifmedia_description
Definition: if_media.h:149


Watt-32 tcp/ip: E:/WATT/inc/net/if_packe.h Source File

  • inc
  • net
if_packe.h
Go to the documentation of this file.
1
5#ifndef __LINUX_IF_PACKE_H
6#define __LINUX_IF_PACKE_H
7
8struct sockaddr_pkt
9{
10 unsigned short spkt_family;
11 unsigned char spkt_device[14];
12 unsigned short spkt_protocol;
13};
14
15struct sockaddr_ll
16{
17 unsigned short sll_family;
18 unsigned short sll_protocol;
19 int sll_ifindex;
20 unsigned short sll_hatype;
21 unsigned char sll_pkttype;
22 unsigned char sll_halen;
23 unsigned char sll_addr[8];
24};
25
26/* Packet types */
27
28#define PACKET_HOST 0 /* To us */
29#define PACKET_BROADCAST 1 /* To all */
30#define PACKET_MULTICAST 2 /* To group */
31#define PACKET_OTHERHOST 3 /* To someone else */
32#define PACKET_OUTGOING 4 /* Outgoing of any type */
33
34/* These ones are invisible by user level */
35#define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */
36#define PACKET_FASTROUTE 6 /* Fastrouted frame */
37
38/* Packet socket options */
39
40#define PACKET_ADD_MEMBERSHIP 1
41#define PACKET_DROP_MEMBERSHIP 2
42#define PACKET_RECV_OUTPUT 3
43
44/* Value 4 is still used by obsolete turbo-packet. */
45#define PACKET_RX_RING 5
46#define PACKET_STATISTICS 6
47#define PACKET_COPY_THRESH 7
48
49struct tpacket_stats
50{
51 unsigned int tp_packets;
52 unsigned int tp_drops;
53};
54
55struct tpacket_hdr
56{
57 unsigned long tp_status;
58#define TP_STATUS_KERNEL 0
59#define TP_STATUS_USER 1
60#define TP_STATUS_COPY 2
61#define TP_STATUS_LOSING 4
62#define TP_STATUS_CSUMNOTREADY 8
63 unsigned int tp_len;
64 unsigned int tp_snaplen;
65 unsigned short tp_mac;
66 unsigned short tp_net;
67 unsigned int tp_sec;
68 unsigned int tp_usec;
69};
70
71#define TPACKET_ALIGNMENT 16
72#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1) & ~(TPACKET_ALIGNMENT-1))
73#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
74
75/*
76 Frame structure:
77
78 - Start. Frame must be aligned to TPACKET_ALIGNMENT=16
79 - struct tpacket_hdr
80 - pad to TPACKET_ALIGNMENT=16
81 - struct sockaddr_ll
82 - Gap, chosen so that packet data (Start+tp_net) alignes to TPACKET_ALIGNMENT=16
83 - Start+tp_mac: [ Optional MAC header ]
84 - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16.
85 - Pad to align to TPACKET_ALIGNMENT=16
86 */
87
88struct tpacket_req
89{
90 unsigned int tp_block_size; /* Minimal size of contiguous block */
91 unsigned int tp_block_nr; /* Number of blocks */
92 unsigned int tp_frame_size; /* Size of frame */
93 unsigned int tp_frame_nr; /* Total number of frames */
94};
95
96struct packet_mreq
97{
98 int mr_ifindex;
99 unsigned short mr_type;
100 unsigned short mr_alen;
101 unsigned char mr_address[8];
102};
103
104#define PACKET_MR_MULTICAST 0
105#define PACKET_MR_PROMISC 1
106#define PACKET_MR_ALLMULTI 2
107
108#endif /* __LINUX_IF_PACKE_H */
packet_mreq
Definition: if_packe.h:97
sockaddr_ll
Definition: if_packe.h:16
sockaddr_pkt
Definition: if_packe.h:9
tpacket_hdr
Definition: if_packe.h:56
tpacket_req
Definition: if_packe.h:89
tpacket_stats
Definition: if_packe.h:50


Watt-32 tcp/ip: E:/WATT/inc/net/if_packet.h Source File

  • inc
  • net
if_packet.h
Go to the documentation of this file.
1
3#ifndef __LINUX_IF_PACKET_H
4#define __LINUX_IF_PACKET_H
5#include <net/if_packe.h> /* Short DOS name */
6#endif
if_packe.h


Watt-32 tcp/ip: E:/WATT/inc/net/if_ppp.h Source File

  • inc
  • net
if_ppp.h
Go to the documentation of this file.
1
5/*
6 * if_ppp.h - Point-to-Point Protocol definitions.
7 *
8 * Copyright (c) 1989 Carnegie Mellon University.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms are permitted
12 * provided that the above copyright notice and this paragraph are
13 * duplicated in all such forms and that any documentation,
14 * advertising materials, and other materials related to such
15 * distribution and use acknowledge that the software was developed
16 * by Carnegie Mellon University. The name of the
17 * University may not be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
21 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 */
23
24#ifndef __NET_IF_PPP_H
25#define __NET_IF_PPP_H
26
27#include <net/if.h>
28#include <net/ppp_defs.h>
29
30/*
31 * Bit definitions for flags.
32 */
33#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
34#define SC_COMP_AC 0x00000002 /* header compression (output) */
35#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
36#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
37#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
38#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
39#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
40#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
41#define SC_DEBUG 0x00010000 /* enable debug messages */
42#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
43#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
44#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
45#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
46#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
47#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
48#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
49#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
50#define SC_MASK 0x0fff00ff /* bits that user can change */
51
52/*
53 * State bits in sc_flags, not changeable by user.
54 */
55#define SC_TIMEOUT 0x00000400 /* timeout is currently pending */
56#define SC_VJ_RESET 0x00000800 /* need to reset VJ decomp */
57#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
58#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
59#define SC_DC_ERROR 0x00004000 /* non-fatal decomp error detected */
60#define SC_DC_FERROR 0x00008000 /* fatal decomp error detected */
61#define SC_TBUSY 0x10000000 /* xmitter doesn't need a packet yet */
62#define SC_PKTLOST 0x20000000 /* have lost or dropped a packet */
63#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */
64#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */
65
66/*
67 * Ioctl definitions.
68 */
69
70struct npioctl {
71 int protocol; /* PPP procotol, e.g. PPP_IP */
72 enum NPmode mode;
73};
74
75/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
76struct ppp_option_data {
77 u_char *ptr;
78 u_int length;
79 int transmit;
80};
81
82struct ifpppstatsreq {
83 char ifr_name[IFNAMSIZ];
84 struct ppp_stats stats;
85};
86
87struct ifpppcstatsreq {
88 char ifr_name[IFNAMSIZ];
89 struct ppp_comp_stats stats;
90};
91
92/*
93 * Ioctl definitions.
94 */
95#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
96#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
97#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
98#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
99#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
100#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
101#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
102#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
103#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
104#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
105#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
106#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
107#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
108#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
109#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
110#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
111#define PPPIOCGIDLE _IOR('t', 74, struct ppp_idle) /* get idle time */
112#ifdef PPP_FILTER
113 #define PPPIOCSPASS _IOW('t', 71, struct bpf_program) /* set pass filter */
114 #define PPPIOCSACTIVE _IOW('t', 70, struct bpf_program) /* set active filt */
115#endif /* PPP_FILTER */
116
117/* PPPIOC[GS]MTU are alternatives to SIOC[GS]IFMTU, used under Ultrix */
118#define PPPIOCGMTU _IOR('t', 73, int) /* get interface MTU */
119#define PPPIOCSMTU _IOW('t', 72, int) /* set interface MTU */
120
121/*
122 * These two are interface ioctls so that pppstats can do them on
123 * a socket without having to open the serial device.
124 */
125#define SIOCGPPPSTATS _IOWR('i', 123, struct ifpppstatsreq)
126#define SIOCGPPPCSTATS _IOWR('i', 122, struct ifpppcstatsreq)
127
128#ifndef ifr_mtu
129#define ifr_mtu ifr_ifru.ifru_metric
130#endif
131
132#endif
if.h
ppp_defs.h
ifpppcstatsreq
Definition: if_ppp.h:87
ifpppstatsreq
Definition: if_ppp.h:82
npioctl
Definition: if_ppp.h:70
ppp_comp_stats
Definition: ppp_defs.h:181
ppp_option_data
Definition: if_ppp.h:76
ppp_stats
Definition: ppp_defs.h:166


Watt-32 tcp/ip: E:/WATT/inc/net/if_pppva.h Source File

  • inc
  • net
if_pppva.h
Go to the documentation of this file.
1
5/*
6 * if_pppvar.h - private structures and declarations for PPP.
7 *
8 * Copyright (c) 1994 The Australian National University.
9 * All rights reserved.
10 *
11 * Permission to use, copy, modify, and distribute this software and its
12 * documentation is hereby granted, provided that the above copyright
13 * notice appears in all copies. This software is provided without any
14 * warranty, express or implied. The Australian National University
15 * makes no representations about the suitability of this software for
16 * any purpose.
17 *
18 * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
19 * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
20 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
21 * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
22 * OF SUCH DAMAGE.
23 *
24 * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
25 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
27 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
28 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
29 * OR MODIFICATIONS.
30 *
31 * Copyright (c) 1989 Carnegie Mellon University.
32 * All rights reserved.
33 *
34 * Redistribution and use in source and binary forms are permitted
35 * provided that the above copyright notice and this paragraph are
36 * duplicated in all such forms and that any documentation,
37 * advertising materials, and other materials related to such
38 * distribution and use acknowledge that the software was developed
39 * by Carnegie Mellon University. The name of the
40 * University may not be used to endorse or promote products derived
41 * from this software without specific prior written permission.
42 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
43 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
44 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
45 */
46
47#ifndef __NET_IF_PPPVAR_H
48#define __NET_IF_PPPVAR_H
49
50#include <net/if.h>
51#include <net/ppp_defs.h>
52
53#ifndef __SYS_MBUF_H
54#include <sys/mbuf.h>
55#endif
56
57/*
58 * Supported network protocols. These values are used for
59 * indexing sc_npmode.
60 */
61#define NP_IP 0 /* Internet Protocol */
62#define NUM_NP 1 /* Number of NPs. */
63
64/*
65 * Structure describing each ppp unit.
66 */
67struct ppp_softc {
68 struct ifnet sc_if; /* network-visible interface */
69 int sc_unit; /* XXX unit number */
70 u_int sc_flags; /* control/status bits; see if_ppp.h */
71 void *sc_devp; /* pointer to device-dep structure */
72 void (*sc_start) (struct ppp_softc *); /* start output proc */
73 void (*sc_ctlp) (struct ppp_softc *); /* rcvd control pkt */
74 void (*sc_relinq) (struct ppp_softc *); /* relinquish ifunit */
75 u_int16_t sc_mru; /* max receive unit */
76 int sc_xfer; /* used in transferring unit */
77 struct ifqueue sc_rawq; /* received packets */
78 struct ifqueue sc_inq; /* queue of input packets for daemon */
79 struct ifqueue sc_fastq; /* interactive output packet q */
80 struct mbuf *sc_togo; /* output packet ready to go */
81 struct mbuf *sc_npqueue; /* output packets not to be sent yet */
82 struct mbuf **sc_npqtail; /* ptr to last next ptr in npqueue */
83 struct pppstat sc_stats; /* count of bytes/pkts sent/rcvd */
84 caddr_t sc_bpf; /* hook for BPF */
85 enum NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
86 struct compressor *sc_xcomp; /* transmit compressor */
87 void *sc_xc_state; /* transmit compressor state */
88 struct compressor *sc_rcomp; /* receive decompressor */
89 void *sc_rc_state; /* receive decompressor state */
90 time_t sc_last_sent; /* time (secs) last NP pkt sent */
91 time_t sc_last_recv; /* time (secs) last NP pkt rcvd */
92#ifdef PPP_FILTER
93 struct bpf_program sc_pass_filt; /* filter for packets to pass */
94 struct bpf_program sc_active_filt; /* filter for "non-idle" packets */
95#endif
96#ifdef VJC
97 struct slcompress *sc_comp; /* vjc control buffer */
98#endif
99
100 /* Device-dependent part for async lines. */
101 ext_accm sc_asyncmap; /* async control character map */
102 u_int32_t sc_rasyncmap; /* receive async control char map */
103 struct mbuf *sc_outm; /* mbuf chain currently being output */
104 struct mbuf *sc_m; /* pointer to input mbuf chain */
105 struct mbuf *sc_mc; /* pointer to current input mbuf */
106 char *sc_mp; /* ptr to next char in input mbuf */
107 u_int16_t sc_ilen; /* length of input packet so far */
108 u_int16_t sc_fcs; /* FCS so far (input) */
109 u_int16_t sc_outfcs; /* FCS so far for output packet */
110 u_char sc_rawin[16]; /* chars as received */
111 int sc_rawin_count; /* # in sc_rawin */
112};
113
114#endif
if.h
ppp_defs.h
bpf_program
Definition: bpf.h:73
compressor
Definition: ppp-comp.h:54
ifnet
Definition: if.h:136
ifqueue
Definition: if.h:128
mbuf
Definition: mbuf.h:6
ppp_softc
Definition: if_pppva.h:67
pppstat
Definition: ppp_defs.h:146
slcompress
Definition: pcpkt.h:148


Watt-32 tcp/ip: E:/WATT/inc/net/if_slvar.h Source File

  • inc
  • net
if_slvar.h
Go to the documentation of this file.
1
5/*-
6 * Copyright (c) 1991, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37#ifndef __NET_IF_SLVAR_H
38#define __NET_IF_SLVAR_H
39
40#include <net/if.h>
41
42/*
43 * Definitions for SLIP interface data structures
44 *
45 * (This exists so programs like slstats can get at the definition
46 * of sl_softc.)
47 */
48
49struct sl_softc {
50 struct ifnet sc_if; /* network-visible interface */
51 int sc_unit; /* XXX unit number */
52 struct ifqueue sc_fastq; /* interactive output queue */
53 struct tty *sc_ttyp; /* pointer to tty structure */
54 u_char *sc_mp; /* pointer to next available buf char */
55 u_char *sc_ep; /* pointer to last available buf char */
56 u_char *sc_buf; /* input buffer */
57 u_char *sc_xxx; /* XXX don't ask... */
58 u_int sc_flags; /* see below */
59 u_int sc_escape; /* =1 if last char input was FRAME_ESCAPE */
60 long sc_lasttime; /* last time a char arrived */
61 long sc_abortcount; /* number of abort esacpe chars */
62 long sc_starttime; /* time of first abort in window */
63 long sc_oqlen; /* previous output queue size */
64 long sc_otimeout; /* number of times output's stalled */
65#ifdef NetBSD
66 int sc_oldbufsize; /* previous output buffer size */
67 int sc_oldbufquot; /* previous output buffer quoting */
68#endif
69#ifdef INET /* XXX */
70 struct slcompress sc_comp; /* tcp compression data */
71#endif
72 caddr_t sc_bpf; /* BPF data */
73};
74
75/* internal flags */
76#define SC_ERROR 0x0001 /* had an input error */
77
78/* visible flags */
79#define SC_COMPRESS IFF_LINK0 /* compress TCP traffic */
80#define SC_NOICMP IFF_LINK1 /* supress ICMP traffic */
81#define SC_AUTOCOMP IFF_LINK2 /* auto-enable TCP compression */
82
83#endif
if.h
ifnet
Definition: if.h:136
ifqueue
Definition: if.h:128
sl_softc
Definition: if_slvar.h:49
slcompress
Definition: pcpkt.h:148


Watt-32 tcp/ip: E:/WATT/inc/net/if_strip.h Source File

  • inc
  • net
if_strip.h
Go to the documentation of this file.
1
5/*
6 * Definitions for SLIP interface data structures
7 *
8 * (This exists so programs like slstats can get at the definition
9 * of sl_softc.)
10 */
11
12#ifndef __NET_IF_STRIP_H
13#define __NET_IF_STRIP_H
14
15#include <net/if.h>
16
17struct strip_softc {
18 struct ifnet sc_if; /* network-visible interface */
19 int sc_unit; /* XXX unit number */
20 struct ifqueue sc_fastq; /* interactive output queue */
21 struct tty *sc_ttyp; /* pointer to tty structure */
22 u_char *sc_mp; /* pointer to next available buf char */
23 u_char *sc_ep; /* pointer to last available buf char */
24 u_char *sc_buf; /* input buffer */
25 u_char *sc_rxbuf; /* input destuffing buffer */
26 u_char *sc_txbuf; /* output stuffing buffer */
27 u_char *sc_xxx; /* XXX don't ask... */
28 u_int sc_flags; /* see below */
29 long sc_oqlen; /* previous output queue size */
30 long sc_otimeout; /* number of times output's stalled */
31#ifdef __NetBSD__
32 int sc_oldbufsize; /* previous output buffer size */
33 int sc_oldbufquot; /* previous output buffer quoting */
34#endif
35#ifdef INET /* XXX */
36 struct slcompress sc_comp; /* tcp compression data */
37#endif
38
39 int sc_state; /* Radio reset state-machine */
40#define ST_ALIVE 0x0 /* answered probe */
41#define ST_PROBE_SENT 0x1 /* probe sent, answer pending */
42#define ST_DEAD 0x2 /* no answer to probe; do reset */
43
44 long sc_statetimo; /* When (secs) current state ends */
45
46 caddr_t sc_bpf; /* BPF data */
47};
48
49
50/* Internal flags */
51#define SC_ERROR 0x0001 /* Incurred error reading current pkt*/
52
53#define SC_TIMEOUT 0x00000400 /* timeout is currently pending */
54
55/* visible flags */
56#define SC_COMPRESS IFF_LINK0 /* compress TCP traffic */
57#define SC_NOICMP IFF_LINK1 /* supress ICMP traffic */
58#define SC_AUTOCOMP IFF_LINK2 /* auto-enable TCP compression */
59
60#endif
if.h
ifnet
Definition: if.h:136
ifqueue
Definition: if.h:128
slcompress
Definition: pcpkt.h:148
strip_softc
Definition: if_strip.h:17


Watt-32 tcp/ip: E:/WATT/inc/net/if_tun.h Source File

  • inc
  • net
if_tun.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
7 * Nottingham University 1987.
8 *
9 * This source may be freely distributed, however I would be interested
10 * in any changes that are made.
11 *
12 * This driver takes packets off the IP i/f and hands them up to a
13 * user process to have it's wicked way with. This driver has it's
14 * roots in a similar driver written by Phil Cockcroft (formerly) at
15 * UCL. This driver is based much more on read/write/select mode of
16 * operation though.
17 */
18
19#ifndef __NET_IF_TUN_H
20#define __NET_IF_TUN_H
21
22#include <net/if.h>
23
24struct tun_softc {
25 u_short tun_flags; /* misc flags */
26#define TUN_OPEN 0x0001
27#define TUN_INITED 0x0002
28#define TUN_RCOLL 0x0004
29#define TUN_IASET 0x0008
30#define TUN_DSTADDR 0x0010
31#define TUN_RWAIT 0x0040
32#define TUN_ASYNC 0x0080
33#define TUN_NBIO 0x0100
34#define TUN_PREPADDR 0x0200
35
36#define TUN_READY (TUN_OPEN | TUN_INITED | TUN_IASET)
37
38 struct ifnet tun_if; /* the interface */
39 int tun_pgrp; /* the process group - if any */
40 struct selinfo tun_rsel; /* read select */
41 struct selinfo tun_wsel; /* write select (not used) */
42#if defined(NBPFILTER) && (NBPFILTER > 0)
43 caddr_t tun_bpf;
44#endif
45};
46
47/* Maximum packet size */
48#define TUNMTU 1500
49
50/* ioctl's for get/set debug */
51#define TUNSDEBUG _IOW('t', 90, int)
52#define TUNGDEBUG _IOR('t', 89, int)
53#define TUNSIFMODE _IOW('t', 88, int)
54#define TUNSLMODE _IOW('t', 87, int)
55
56#endif
if.h
ifnet
Definition: if.h:136
selinfo
Definition: wtypes.h:364
tun_softc
Definition: if_tun.h:24


Watt-32 tcp/ip: E:/WATT/inc/net/if_types.h Source File

  • inc
  • net
if_types.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1989, 1993, 1994
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38/*
39 * Interface types for benefit of parsing media address headers.
40 * This list is derived from the SNMP list of ifTypes, currently
41 * documented in RFC1573.
42 */
43#ifndef __NET_IF_TYPES_H
44#define __NET_IF_TYPES_H
45
46#define IFT_OTHER 0x1 /* none of the following */
47#define IFT_1822 0x2 /* old-style arpanet imp */
48#define IFT_HDH1822 0x3 /* HDH arpanet imp */
49#define IFT_X25DDN 0x4 /* x25 to imp */
50#define IFT_X25 0x5 /* PDN X25 interface (RFC877) */
51#define IFT_ETHER 0x6 /* Ethernet CSMACD */
52#define IFT_ISO88023 0x7 /* CMSA CD */
53#define IFT_ISO88024 0x8 /* Token Bus */
54#define IFT_ISO88025 0x9 /* Token Ring */
55#define IFT_ISO88026 0xa /* MAN */
56#define IFT_STARLAN 0xb
57#define IFT_P10 0xc /* Proteon 10MBit ring */
58#define IFT_P80 0xd /* Proteon 80MBit ring */
59#define IFT_HY 0xe /* Hyperchannel */
60#define IFT_FDDI 0xf
61#define IFT_LAPB 0x10
62#define IFT_SDLC 0x11
63#define IFT_T1 0x12
64#define IFT_CEPT 0x13 /* E1 - european T1 */
65#define IFT_ISDNBASIC 0x14
66#define IFT_ISDNPRIMARY 0x15
67#define IFT_PTPSERIAL 0x16 /* Proprietary PTP serial */
68#define IFT_PPP 0x17 /* RFC 1331 */
69#define IFT_LOOP 0x18 /* loopback */
70#define IFT_EON 0x19 /* ISO over IP */
71#define IFT_XETHER 0x1a /* obsolete 3MB experimental ethernet */
72#define IFT_NSIP 0x1b /* XNS over IP */
73#define IFT_SLIP 0x1c /* IP over generic TTY */
74#define IFT_ULTRA 0x1d /* Ultra Technologies */
75#define IFT_DS3 0x1e /* Generic T3 */
76#define IFT_SIP 0x1f /* SMDS */
77#define IFT_FRELAY 0x20 /* Frame Relay DTE only */
78#define IFT_RS232 0x21
79#define IFT_PARA 0x22 /* parallel-port */
80#define IFT_ARCNET 0x23
81#define IFT_ARCNETPLUS 0x24
82#define IFT_ATM 0x25 /* ATM cells */
83#define IFT_MIOX25 0x26
84#define IFT_SONET 0x27 /* SONET or SDH */
85#define IFT_X25PLE 0x28
86#define IFT_ISO88022LLC 0x29
87#define IFT_LOCALTALK 0x2a
88#define IFT_SMDSDXI 0x2b
89#define IFT_FRELAYDCE 0x2c /* Frame Relay DCE */
90#define IFT_V35 0x2d
91#define IFT_HSSI 0x2e
92#define IFT_HIPPI 0x2f
93#define IFT_MODEM 0x30 /* Generic Modem */
94#define IFT_AAL5 0x31 /* AAL5 over ATM */
95#define IFT_SONETPATH 0x32
96#define IFT_SONETVT 0x33
97#define IFT_SMDSICIP 0x34 /* SMDS InterCarrier Interface */
98#define IFT_PROPVIRTUAL 0x35 /* Proprietary Virtual/internal */
99#define IFT_PROPMUX 0x36 /* Proprietary Multiplexing */
100
101#endif


Watt-32 tcp/ip: E:/WATT/inc/netinet/igmp.h Source File

  • inc
  • netinet
igmp.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1988 Stephen Deering.
7 * Copyright (c) 1992, 1993
8 * The Regents of the University of California. All rights reserved.
9 *
10 * This code is derived from software contributed to Berkeley by
11 * Stephen Deering of Stanford University.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgement:
23 * This product includes software developed by the University of
24 * California, Berkeley and its contributors.
25 * 4. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 */
41
42#ifndef __NETINET_IGMP_H
43#define __NETINET_IGMP_H
44
45#include <netinet/in.h>
46
47/*
48 * Internet Group Management Protocol (IGMP) definitions.
49 *
50 * Written by Steve Deering, Stanford, May 1988.
51 *
52 * MULTICAST Revision: 3.5.1.2
53 */
54
55/*
56 * IGMP packet format.
57 */
58W32_CLANG_PACK_WARN_OFF()
59
60#include <sys/pack_on.h>
61
62struct igmp {
63 u_char igmp_type; /* version & type of IGMP message */
64 u_char igmp_code; /* subtype for routing msgs */
65 u_short igmp_cksum; /* IP-style checksum */
66 struct in_addr igmp_group; /* group address being reported */
67}; /* (zero for queries) */
68
69#include <sys/pack_off.h>
70
71W32_CLANG_PACK_WARN_DEF()
72
73#define IGMP_MINLEN 8
74
75/*
76 * Message types, including version number.
77 */
78#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
79#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
80#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
81#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */
82
83#define IGMP_DVMRP 0x13 /* DVMRP routing message */
84#define IGMP_PIM 0x14 /* PIM routing message */
85
86#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/
87#define IGMP_MTRACE 0x1f /* mcast traceroute messages */
88
89#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
90 /* query (in seconds) according */
91 /* to RFC1112 */
92
93
94#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */
95 /* specifies time in 10th of seconds*/
96
97/*
98 * The following four defininitions are for backwards compatibility.
99 * They should be removed as soon as all applications are updated to
100 * use the new constant names.
101 */
102#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
103#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
104#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
105#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
106
107#endif
in.h
pack_off.h
in_addr
Definition: in.h:143


Watt-32 tcp/ip: E:/WATT/inc/netinet/igmp_var.h Source File

  • inc
  • netinet
igmp_var.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1988 Stephen Deering.
7 * Copyright (c) 1992, 1993
8 * The Regents of the University of California. All rights reserved.
9 *
10 * This code is derived from software contributed to Berkeley by
11 * Stephen Deering of Stanford University.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgement:
23 * This product includes software developed by the University of
24 * California, Berkeley and its contributors.
25 * 4. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 */
41
42#ifndef __NETINET_IGMP_VAR_H
43#define __NETINET_IGMP_VAR_H
44
45#include <sys/wtypes.h>
46
47/*
48 * Internet Group Management Protocol (IGMP),
49 * implementation-specific definitions.
50 *
51 * Written by Steve Deering, Stanford, May 1988.
52 *
53 * MULTICAST Revision: 3.5.1.3
54 */
55
56struct igmpstat {
57 u_int igps_rcv_total; /* total IGMP messages received */
58 u_int igps_rcv_tooshort; /* received with too few bytes */
59 u_int igps_rcv_badsum; /* received with bad checksum */
60 u_int igps_rcv_queries; /* received membership queries */
61 u_int igps_rcv_badqueries; /* received invalid queries */
62 u_int igps_rcv_reports; /* received membership reports */
63 u_int igps_rcv_badreports; /* received invalid reports */
64 u_int igps_rcv_ourreports; /* received reports for our groups */
65 u_int igps_snd_reports; /* sent membership reports */
66};
67
68/*
69 * Names for IGMP sysctl objects
70 */
71#define IGMPCTL_STATS 1 /* statistics (read-only) */
72#define IGMPCTL_MAXID 2
73
74#define IGMPCTL_NAMES { \
75 { 0, 0 }, \
76 { "stats", CTLTYPE_STRUCT }, \
77}
78
79#endif
80
81
igmpstat
Definition: igmp_var.h:56
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6.h Source File

  • inc
  • netinet6
in6.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * Copyright (c) 1982, 1986, 1990, 1993
35 * The Regents of the University of California. All rights reserved.
36 *
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
39 * are met:
40 * 1. Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * 2. Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in the
44 * documentation and/or other materials provided with the distribution.
45 * 3. All advertising materials mentioning features or use of this software
46 * must display the following acknowledgement:
47 * This product includes software developed by the University of
48 * California, Berkeley and its contributors.
49 * 4. Neither the name of the University nor the names of its contributors
50 * may be used to endorse or promote products derived from this software
51 * without specific prior written permission.
52 *
53 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
54 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
57 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * SUCH DAMAGE.
64 */
65
66#ifndef _NETINET6_IN6_H_
67#define _NETINET6_IN6_H_
68
69/*
70 * Identification of the network protocol stack
71 * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE
72 * has the table of implementation/integration differences.
73 */
74#define __KAME__
75#define __KAME_VERSION "20010528/FreeBSD"
76
77#ifndef __SYS_SOCKET_H
78#include <sys/socket.h>
79#endif
80
81/*
82 * Local port number conventions:
83 *
84 * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root),
85 * unless a kernel is compiled with IPNOPRIVPORTS defined.
86 *
87 * When a user does a bind(2) or connect(2) with a port number of zero,
88 * a non-conflicting local port address is chosen.
89 *
90 * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although
91 * that is settable by sysctl(3); net.inet.ip.anonportmin and
92 * net.inet.ip.anonportmax respectively.
93 *
94 * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
95 * default assignment range.
96 *
97 * The value IP_PORTRANGE_DEFAULT causes the default behavior.
98 *
99 * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT,
100 * and exists only for FreeBSD compatibility purposes.
101 *
102 * The value IP_PORTRANGE_LOW changes the range to the "low" are
103 * that is (by convention) restricted to privileged processes.
104 * This convention is based on "vouchsafe" principles only.
105 * It is only secure if you trust the remote host to restrict these ports.
106 * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX.
107 */
108#if defined(__BSD_VISIBLE) && (__BSD_VISIBLE != 0)
109#define IPV6PORT_RESERVED 1024
110#define IPV6PORT_ANONMIN 49152
111#define IPV6PORT_ANONMAX 65535
112#define IPV6PORT_RESERVEDMIN 600
113#define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1)
114#define SIN6_LEN
115#endif
116
117#define INET6_ADDRSTRLEN 46
118
119#ifndef __NETINET_IN_H
120 /*
121 * IPv6 address
122 */
123 struct in6_addr {
124 union {
125 uint8_t __u6_addr8[16];
126 uint16_t __u6_addr16[8];
127 uint32_t __u6_addr32[4];
128 } __u6_addr; /* 128-bit IP6 address */
129 };
130
131 #define s6_addr __u6_addr.__u6_addr8
132
133 /*
134 * Socket address for IPv6
135 */
136 struct sockaddr_in6 {
137 uint8_t sin6_len; /* length of this struct */
138 sa_family_t sin6_family; /* AF_INET6 */
139 uint16_t sin6_port; /* Transport layer port # */
140 uint32_t sin6_flowinfo; /* IP6 flow information */
141 struct in6_addr sin6_addr; /* IP6 address */
142 uint32_t sin6_scope_id; /* scope zone index */
143 };
144
145 /*
146 * Definition of some useful macros to handle IP6 addresses
147 */
148 #if defined(__BSD_VISIBLE) && (__BSD_VISIBLE != 0)
149 #define IN6ADDR_ANY_INIT \
150 {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
151 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
152 #define IN6ADDR_LOOPBACK_INIT \
153 {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
154 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
155 #define IN6ADDR_NODELOCAL_ALLNODES_INIT \
156 {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
157 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
158 #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
159 {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
160 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
161 #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
162 {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
163 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
164 #endif
165
166 W32_DATA const struct in6_addr in6addr_any;
167 W32_DATA const struct in6_addr in6addr_loopback;
168
169 W32_DATA const struct in6_addr in6addr_nodelocal_allnodes;
170 W32_DATA const struct in6_addr in6addr_linklocal_allnodes;
171 W32_DATA const struct in6_addr in6addr_linklocal_allrouters;
172#endif /* __NETINET_IN_H */
173
174/*
175 * Equality
176 * NOTE: Some of kernel programming environment (for example, openbsd/sparc)
177 * does not supply memcmp(). For userland memcmp() is preferred as it is
178 * in ANSI standard.
179 */
180#ifndef IN6_ARE_ADDR_EQUAL
181#define IN6_ARE_ADDR_EQUAL(a, b) \
182 (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
183#endif
184
185#ifndef SA6_ARE_ADDR_EQUAL
186 /*
187 * see if two addresses are equal in a scope-conscious manner.
188 */
189 #define SA6_ARE_ADDR_EQUAL(a, b) \
190 (((a)->sin6_scope_id == 0 || (b)->sin6_scope_id == 0 || \
191 ((a)->sin6_scope_id == (b)->sin6_scope_id)) && \
192 (memcmp(&(a)->sin6_addr, &(b)->sin6_addr, sizeof(struct in6_addr)) == 0))
193#endif
194
195#ifndef __NETINET_IN_H
196/*
197 * Unspecified
198 */
199#define IN6_IS_ADDR_UNSPECIFIED(a) \
200 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
201 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
202 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
203 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0))
204
205/*
206 * Loopback
207 */
208#define IN6_IS_ADDR_LOOPBACK(a) \
209 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
210 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
211 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
212 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1)))
213
214/*
215 * IPv4 compatible
216 */
217#define IN6_IS_ADDR_V4COMPAT(a) \
218 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
219 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
220 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
221 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \
222 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1)))
223
224/*
225 * Mapped
226 */
227#define IN6_IS_ADDR_V4MAPPED(a) \
228 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
229 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
230 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
231
232/*
233 * KAME Scope Values
234 */
235#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01
236#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02
237#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05
238#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
239#define __IPV6_ADDR_SCOPE_GLOBAL 0x0e
240
241/*
242 * Unicast Scope
243 * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373).
244 */
245#define IN6_IS_ADDR_LINKLOCAL(a) \
246 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
247
248#define IN6_IS_ADDR_SITELOCAL(a) \
249 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
250
251/*
252 * Multicast
253 */
254#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
255
256#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
257
258/*
259 * Multicast Scope
260 */
261#define IN6_IS_ADDR_MC_NODELOCAL(a) \
262 (IN6_IS_ADDR_MULTICAST(a) && \
263 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL))
264
265#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
266 (IN6_IS_ADDR_MULTICAST(a) && \
267 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL))
268
269#define IN6_IS_ADDR_MC_SITELOCAL(a) \
270 (IN6_IS_ADDR_MULTICAST(a) && \
271 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL))
272
273#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
274 (IN6_IS_ADDR_MULTICAST(a) && \
275 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL))
276
277#define IN6_IS_ADDR_MC_GLOBAL(a) \
278 (IN6_IS_ADDR_MULTICAST(a) && \
279 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL))
280
281#endif /* __NETINET_IN_H */
282
283#ifndef _NETINET6_IP6_VAR_H_
284 /*
285 * IP6 route structure
286 */
287 struct route_in6 {
288 struct rtentry *ro_rt;
289 struct sockaddr_in6 ro_dst;
290 };
291#endif
292
293/*
294 * Options for use with [gs]etsockopt at the IPV6 level.
295 * First word of comment is data type; bool is stored in int.
296 */
297#define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */
298#define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */
299#define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */
300#define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */
301#define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 multicast loopback */
302#define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */
303#define IPV6_V6ONLY 27 /* bool; only bind INET6 at wildcard bind */
304
305#if defined(__BSD_VISIBLE) && (__BSD_VISIBLE != 0)
306#define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */
307#define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */
308#define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */
309
310/* RFC2292 options */
311#define IPV6_PKTINFO 19 /* bool; send/recv if, src/dst addr */
312#define IPV6_HOPLIMIT 20 /* bool; hop limit */
313#define IPV6_NEXTHOP 21 /* bool; next hop addr */
314#define IPV6_HOPOPTS 22 /* bool; hop-by-hop option */
315#define IPV6_DSTOPTS 23 /* bool; destination option */
316#define IPV6_RTHDR 24 /* bool; routing header */
317#define IPV6_PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */
318
319#define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */
320
321#define IPV6_BINDV6ONLY IPV6_V6ONLY
322
323#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */
324#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */
325
326#define IPV6_FW_ADD 30 /* add a firewall rule to chain */
327#define IPV6_FW_DEL 31 /* delete a firewall rule from chain */
328#define IPV6_FW_FLUSH 32 /* flush firewall rule chain */
329#define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */
330#define IPV6_FW_GET 34 /* get entire firewall rule chain */
331
332/* to define items, should talk with KAME guys first, for *BSD compatibility */
333
334#define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */
335#define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */
336#define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */
337
338/*
339 * Defaults and limits for options
340 */
341#define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */
342#define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
343
344/*
345 * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP.
346 */
347#ifndef __NETINET_IN_H
348 struct ipv6_mreq {
349 struct in6_addr ipv6mr_multiaddr;
350 unsigned int ipv6mr_interface;
351 };
352#endif
353
354/*
355 * IPV6_PKTINFO: Packet information(RFC2292 sec 5)
356 */
357struct in6_pktinfo {
358 struct in6_addr ipi6_addr; /* src/dst IPv6 address */
359 unsigned int ipi6_ifindex; /* send/recv interface index */
360};
361
362/*
363 * Argument for IPV6_PORTRANGE:
364 * - which range to search when port is unspecified at bind() or connect()
365 */
366#define IPV6_PORTRANGE_DEFAULT 0 /* default range */
367#define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
368#define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
369
370/*
371 * Definitions for inet6 sysctl operations.
372 *
373 * Third level is protocol number.
374 * Fourth level is desired variable within that protocol.
375 */
376#define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */
377
378#define CTL_IPV6PROTO_NAMES { \
379 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
380 { 0, 0 }, \
381 { "tcp6", CTLTYPE_NODE }, \
382 { 0, 0 }, \
383 { 0, 0 }, \
384 { 0, 0 }, \
385 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
386 { 0, 0 }, \
387 { 0, 0 }, \
388 { "udp6", CTLTYPE_NODE }, \
389 { 0, 0 }, \
390 { 0, 0 }, \
391 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
392 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
393 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
394 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
395 { 0, 0 }, \
396 { "ip6", CTLTYPE_NODE }, \
397 { 0, 0 }, \
398 { 0, 0 }, \
399 { 0, 0 }, \
400 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
401 { 0, 0 }, \
402 { "ipsec6", CTLTYPE_NODE }, \
403 { 0, 0 }, \
404 { 0, 0 }, \
405 { 0, 0 }, \
406 { 0, 0 }, \
407 { 0, 0 }, \
408 { 0, 0 }, \
409 { "icmp6", CTLTYPE_NODE }, \
410 { 0, 0 }, \
411 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
412 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
413 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
414 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
415 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
416 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
417 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
418 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
419 { 0, 0 }, \
420 { 0, 0 }, \
421 { 0, 0 }, \
422 { "pim6", CTLTYPE_NODE }, \
423}
424
425/*
426 * Names for IP sysctl objects
427 */
428#define IPV6CTL_FORWARDING 1 /* act as router */
429#define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/
430#define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */
431#define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */
432#define IPV6CTL_STATS 6 /* stats */
433#define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */
434#define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */
435#define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */
436#define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */
437#define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */
438#define IPV6CTL_ACCEPT_RTADV 12
439#define IPV6CTL_KEEPFAITH 13
440#define IPV6CTL_LOG_INTERVAL 14
441#define IPV6CTL_HDRNESTLIMIT 15
442#define IPV6CTL_DAD_COUNT 16
443#define IPV6CTL_AUTO_FLOWLABEL 17
444#define IPV6CTL_DEFMCASTHLIM 18
445#define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */
446#define IPV6CTL_KAME_VERSION 20
447#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */
448#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */
449#define IPV6CTL_V6ONLY 24
450#define IPV6CTL_RTEXPIRE 25 /* cloned route expiration time */
451#define IPV6CTL_RTMINEXPIRE 26 /* min value for expiration time */
452#define IPV6CTL_RTMAXCACHE 27 /* trigger level for dynamic expire */
453
454#define IPV6CTL_USETEMPADDR 32 /* use temporary addresses (RFC3041) */
455#define IPV6CTL_TEMPPLTIME 33 /* preferred lifetime for tmpaddrs */
456#define IPV6CTL_TEMPVLTIME 34 /* valid lifetime for tmpaddrs */
457#define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */
458#define IPV6CTL_RIP6STATS 36 /* raw_ip6 stats */
459
460/* New entries should be added here from current IPV6CTL_MAXID value. */
461/* to define items, should talk with KAME guys first, for *BSD compatibility
462 */
463#define IPV6CTL_MAXID 37
464
465/*
466 * Redefinition of mbuf flags
467 */
468#define M_AUTHIPHDR M_PROTO2
469#define M_DECRYPTED M_PROTO3
470#define M_LOOP M_PROTO4
471#define M_AUTHIPDGM M_PROTO5
472
473__BEGIN_DECLS
474
475struct cmsghdr;
476
477extern int inet6_option_space (int);
478extern int inet6_option_init (void *, struct cmsghdr **, int);
479extern int inet6_option_append (struct cmsghdr *, const uint8_t *, int, int);
480extern uint8_t *inet6_option_alloc (struct cmsghdr *, int, int, int);
481extern int inet6_option_next (const struct cmsghdr *, uint8_t **);
482extern int inet6_option_find (const struct cmsghdr *, uint8_t **, int);
483
484extern size_t inet6_rthdr_space (int, int);
485extern struct cmsghdr *inet6_rthdr_init (void *, int);
486extern int inet6_rthdr_add (struct cmsghdr *, const struct in6_addr *, unsigned int);
487extern int inet6_rthdr_lasthop (struct cmsghdr *, unsigned int);
488
489extern int inet6_rthdr_segments (const struct cmsghdr *);
490extern struct in6_addr *inet6_rthdr_getaddr (struct cmsghdr *, int);
491extern int inet6_rthdr_getflags (const struct cmsghdr *, int);
492
493extern int inet6_opt_init (void *, size_t);
494extern int inet6_opt_append (void *, size_t, int, uint8_t, size_t, uint8_t, void **);
495extern int inet6_opt_finish (void *, size_t, int);
496extern int inet6_opt_set_val (void *, size_t, void *, int);
497
498extern int inet6_opt_next (void *, size_t, int, uint8_t *, size_t *, void **);
499extern int inet6_opt_find (void *, size_t, int, uint8_t, size_t *, void **);
500extern int inet6_opt_get_val (void *, size_t, void *, int);
501extern size_t inet6_rth_space (int, int);
502extern void *inet6_rth_init (void *, int, int, int);
503extern int inet6_rth_add (void *, const struct in6_addr *);
504extern int inet6_rth_reverse (const void *, void *);
505extern int inet6_rth_segments (const void *);
506extern struct in6_addr *inet6_rth_getaddr (const void *, int);
507
508__END_DECLS
509
510#endif /* __BSD_VISIBLE */
511
512#endif /* !_NETINET6_IN6_H_ */
socket.h
cmsghdr
Definition: socket.h:251
in6_addr
Definition: in.h:151
in6_pktinfo
Definition: ipv6.h:67
ipv6_mreq
Definition: in.h:255
route_in6
Definition: in6.h:287
rtentry
Definition: route.h:97
sockaddr_in6
Definition: in.h:231


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6_gif.h Source File

  • inc
  • netinet6
in6_gif.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#ifndef _NETINET6_IN6_GIF_H_
34#define _NETINET6_IN6_GIF_H_
35
36#ifndef __SYS_MBUF_H
37#include <sys/mbuf.h>
38#endif
39
40#define GIF_HLIM 30
41
42int in6_gif_input (struct mbuf **, int *, int);
43int in6_gif_output (struct ifnet *, int, struct mbuf *, struct rtentry *);
44int gif_encapcheck6 (const struct mbuf *, int, int, void *);
45
46#endif /*_NETINET6_IN6_GIF_H_*/
ifnet
Definition: if.h:136
mbuf
Definition: mbuf.h:6
rtentry
Definition: route.h:97


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6_ifat.h Source File

  • inc
  • netinet6
in6_ifat.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#ifndef _NETINET6_IN6_IFATTACH_H_
34#define _NETINET6_IN6_IFATTACH_H_
35
36#ifdef _KERNEL
37void in6_nigroup_attach (const char *, int);
38void in6_nigroup_detach (const char *, int);
39void in6_ifattach (struct ifnet *, struct ifnet *);
40void in6_ifdetach (struct ifnet *);
41void in6_get_tmpifid (struct ifnet *, u_int8_t *, const u_int8_t *, int);
42void in6_tmpaddrtimer (void *);
43int in6_nigroup (struct ifnet *, const char *, int, struct in6_addr *);
44#endif /* _KERNEL */
45
46#endif /* _NETINET6_IN6_IFATTACH_H_ */
ifnet
Definition: if.h:136
in6_addr
Definition: in.h:151


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6_pcb.h Source File

  • inc
  • netinet6
in6_pcb.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 */
33
34/*
35 * Copyright (c) 1982, 1986, 1990, 1993
36 * The Regents of the University of California. All rights reserved.
37 *
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
41 * 1. Redistributions of source code must retain the above copyright
42 * notice, this list of conditions and the following disclaimer.
43 * 2. Redistributions in binary form must reproduce the above copyright
44 * notice, this list of conditions and the following disclaimer in the
45 * documentation and/or other materials provided with the distribution.
46 * 3. All advertising materials mentioning features or use of this software
47 * must display the following acknowledgement:
48 * This product includes software developed by the University of
49 * California, Berkeley and its contributors.
50 * 4. Neither the name of the University nor the names of its contributors
51 * may be used to endorse or promote products derived from this software
52 * without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
55 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE.
65 */
66
67#ifndef _NETINET6_IN6_PCB_H_
68#define _NETINET6_IN6_PCB_H_
69
70#ifdef _KERNEL
71
72#ifndef __SYS_MBUF_H
73#include <sys/mbuf.h>
74#endif
75
76#define satosin6(sa) ((struct sockaddr_in6 *)(sa))
77#define sin6tosa(sin6) ((struct sockaddr *)(sin6))
78#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa))
79
80void in6_pcbpurgeif0 (struct in6pcb *, struct ifnet *);
81void in6_losing (struct inpcb *);
82int in6_pcballoc (struct socket *, struct inpcbinfo *, struct thread *));
83int in6_pcbbind (struct inpcb *, struct sockaddr *, struct thread *);
84int in6_pcbconnect (struct inpcb *, struct sockaddr *, struct thread *);
85void in6_pcbdetach (struct inpcb *);
86void in6_pcbdisconnect (struct inpcb *);
87int in6_pcbladdr (struct inpcb *, struct sockaddr *, struct in6_addr **);
88
89struct inpcb *in6_pcblookup_local (struct inpcbinfo *, struct in6_addr *, u_int, int);
90struct inpcb *in6_pcblookup_hash (struct inpcbinfo *,
91 struct in6_addr *, u_int, struct in6_addr *,
92 u_int, int, struct ifnet *);
93void in6_pcbnotify (struct inpcbhead *, struct sockaddr *,
94 u_int, const struct sockaddr *, u_int, int,
95 struct inpcb *(*)(struct inpcb *, int));
96
97struct inpcb *in6_rtchange (struct inpcb *, int);
98int in6_setpeeraddr (struct socket *so, struct sockaddr **nam);
99int in6_setsockaddr (struct socket *so, struct sockaddr **nam);
100int in6_mapped_sockaddr (struct socket *so, struct sockaddr **nam);
101int in6_mapped_peeraddr (struct socket *so, struct sockaddr **nam);
102
103struct in6_addr *in6_selectsrc (struct sockaddr_in6 *,
104 struct ip6_pktopts *,
105 struct ip6_moptions *,
106 struct route_in6 *,
107 struct in6_addr *, int *);
108
109int in6_selecthlim (struct in6pcb *, struct ifnet *);
110int in6_pcbsetport (struct in6_addr *, struct inpcb *, struct thread *);
111void init_sin6 (struct sockaddr_in6 *sin6, struct mbuf *m);
112#endif /* _KERNEL */
113
114#endif /* !_NETINET6_IN6_PCB_H_ */
ifnet
Definition: if.h:136
in6_addr
Definition: in.h:151
inpcb
Definition: in_pcb.h:61
inpcbinfo
Definition: in_pcb.h:78
ip6_moptions
Definition: ip6_var.h:120
ip6_pktopts
Definition: ip6_var.h:148
mbuf
Definition: mbuf.h:6
route_in6
Definition: in6.h:287
sockaddr_in6
Definition: in.h:231
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6_pref.h Source File

  • inc
  • netinet6
in6_pref.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, 1998 and 1999 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32#ifndef _NETINET6_IN6_PREF_H_
33#define _NETINET6_IN6_PREF_H_
34
35#undef STRUCT_IFPREFIX_NEEDED
36#define STRUCT_IFPREFIX_NEEDED
37
38#ifndef __SYS_WTYPES_H
39#error "Include <sys/wtypes.h> before me."
40#endif
41
42#include <sys/wtypes.h>
43#include <netinet6/in6_var.h>
44
45struct rr_prefix {
46 struct ifprefix rp_ifpr;
47 LIST_ENTRY(rr_prefix) rp_entry;
48 LIST_HEAD(rp_addrhead, rp_addr) rp_addrhead;
49 struct sockaddr_in6 rp_prefix; /* prefix */
50 u_int32_t rp_vltime; /* advertised valid lifetime */
51 u_int32_t rp_pltime; /* advertised preferred lifetime */
52 time_t rp_expire; /* expiration time of the prefix */
53 time_t rp_preferred; /* preferred time of the prefix */
54 struct in6_prflags rp_flags;
55 u_char rp_origin; /* from where this prefix info is obtained */
56 struct rp_stateflags {
57 /* if some prefix should be added to this prefix */
58 u_char addmark : 1;
59 u_char delmark : 1; /* if this prefix will be deleted */
60 } rp_stateflags;
61};
62
63#define rp_type rp_ifpr.ifpr_type
64#define rp_ifp rp_ifpr.ifpr_ifp
65#define rp_plen rp_ifpr.ifpr_plen
66
67#define rp_raf rp_flags.prf_ra
68#define rp_raf_onlink rp_flags.prf_ra.onlink
69#define rp_raf_auto rp_flags.prf_ra.autonomous
70
71#define rp_statef_addmark rp_stateflags.addmark
72#define rp_statef_delmark rp_stateflags.delmark
73
74#define rp_rrf rp_flags.prf_rr
75#define rp_rrf_decrvalid rp_flags.prf_rr.decrvalid
76#define rp_rrf_decrprefd rp_flags.prf_rr.decrprefd
77
78struct rp_addr {
79 LIST_ENTRY(rp_addr) ra_entry;
80 struct in6_addr ra_ifid;
81 struct in6_ifaddr *ra_addr;
82 struct ra_flags {
83 u_char anycast : 1;
84 } ra_flags;
85};
86
87#define ifpr2rp(ifpr) ((struct rr_prefix *)(ifpr))
88#define rp2ifpr(rp) ((struct ifprefix *)(rp))
89
90#define RP_IN6(rp) (&(rp)->rp_prefix.sin6_addr)
91
92#define RR_INFINITE_LIFETIME 0xffffffff
93
94LIST_HEAD(rr_prhead, rr_prefix);
95
96extern struct rr_prhead rr_prefix;
97extern struct callout in6_rr_timer_ch;
98
99extern void in6_rr_timer (void *);
100extern int delete_each_prefix (struct rr_prefix *rpp, u_char origin);
101
102#endif /* _NETINET6_IN6_PREF_H_ */
in6_var.h
callout
Definition: wtypes.h:402
ifprefix
Definition: wtypes.h:383
in6_addr
Definition: in.h:151
in6_ifaddr
Definition: in6_var.h:91
in6_prflags
Definition: in6_var.h:296
rp_addr::ra_flags
Definition: in6_pref.h:82
rp_addr
Definition: in6_pref.h:78
rr_prefix::rp_stateflags
Definition: in6_pref.h:56
rr_prefix
Definition: in6_pref.h:45
sockaddr_in6
Definition: in.h:231
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/netinet6/in6_var.h Source File

  • inc
  • netinet6
in6_var.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * Copyright (c) 1985, 1986, 1993
35 * The Regents of the University of California. All rights reserved.
36 *
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
39 * are met:
40 * 1. Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * 2. Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in the
44 * documentation and/or other materials provided with the distribution.
45 * 3. All advertising materials mentioning features or use of this software
46 * must display the following acknowledgement:
47 * This product includes software developed by the University of
48 * California, Berkeley and its contributors.
49 * 4. Neither the name of the University nor the names of its contributors
50 * may be used to endorse or promote products derived from this software
51 * without specific prior written permission.
52 *
53 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
54 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
57 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * SUCH DAMAGE.
64 */
65
66#ifndef _NETINET6_IN6_VAR_H_
67#define _NETINET6_IN6_VAR_H_
68
69/*
70 * Interface address, Internet version. One of these structures
71 * is allocated for each interface with an Internet address.
72 * The ifaddr structure contains the protocol-independent part
73 * of the structure and is assumed to be first.
74 */
75
76/*
77 * pltime/vltime are just for future reference (required to implements 2
78 * hour rule for hosts). they should never be modified by nd6_timeout or
79 * anywhere else.
80 * userland -> kernel: accept pltime/vltime
81 * kernel -> userland: throw up everything
82 * in kernel: modify preferred/expire only
83 */
84struct in6_addrlifetime {
85 time_t ia6t_expire; /* valid lifetime expiration time */
86 time_t ia6t_preferred; /* preferred lifetime expiration time */
87 u_int32_t ia6t_vltime; /* valid lifetime */
88 u_int32_t ia6t_pltime; /* prefix lifetime */
89};
90
91struct in6_ifaddr {
92 struct ifaddr ia_ifa; /* protocol-independent info */
93#define ia_ifp ia_ifa.ifa_ifp
94#define ia_flags ia_ifa.ifa_flags
95 struct sockaddr_in6 ia_addr; /* interface address */
96 struct sockaddr_in6 ia_net; /* network number of interface */
97 struct sockaddr_in6 ia_dstaddr; /* space for destination addr */
98 struct sockaddr_in6 ia_prefixmask; /* prefix mask */
99 u_int32_t ia_plen; /* prefix length */
100 struct in6_ifaddr *ia_next; /* next in6 list of IP6 addresses */
101 int ia6_flags;
102
103 struct in6_addrlifetime ia6_lifetime;
104 struct ifprefix *ia6_ifpr; /* back pointer to ifprefix */
105
106 struct nd_prefix *ia6_ndpr; /* back pointer to the ND prefix
107 * (for autoconfigured addresses only)
108 */
109};
110
111/*
112 * IPv6 interface statistics, as defined in RFC2465 Ipv6IfStatsEntry (p12).
113 */
114struct in6_ifstat {
115 u_quad_t ifs6_in_receive; /* # of total input datagram */
116 u_quad_t ifs6_in_hdrerr; /* # of datagrams with invalid hdr */
117 u_quad_t ifs6_in_toobig; /* # of datagrams exceeded MTU */
118 u_quad_t ifs6_in_noroute; /* # of datagrams with no route */
119 u_quad_t ifs6_in_addrerr; /* # of datagrams with invalid dst */
120 u_quad_t ifs6_in_protounknown; /* # of datagrams with unknown proto */
121 /* NOTE: increment on final dst if */
122 u_quad_t ifs6_in_truncated; /* # of truncated datagrams */
123 u_quad_t ifs6_in_discard; /* # of discarded datagrams */
124 /* NOTE: fragment timeout is not here */
125 u_quad_t ifs6_in_deliver; /* # of datagrams delivered to ULP */
126 /* NOTE: increment on final dst if */
127 u_quad_t ifs6_out_forward; /* # of datagrams forwarded */
128 /* NOTE: increment on outgoing if */
129 u_quad_t ifs6_out_request; /* # of outgoing datagrams from ULP */
130 /* NOTE: does not include forwrads */
131 u_quad_t ifs6_out_discard; /* # of discarded datagrams */
132 u_quad_t ifs6_out_fragok; /* # of datagrams fragmented */
133 u_quad_t ifs6_out_fragfail; /* # of datagrams failed on fragment */
134 u_quad_t ifs6_out_fragcreat; /* # of fragment datagrams */
135 /* NOTE: this is # after fragment */
136 u_quad_t ifs6_reass_reqd; /* # of incoming fragmented packets */
137 /* NOTE: increment on final dst if */
138 u_quad_t ifs6_reass_ok; /* # of reassembled packets */
139 /* NOTE: this is # after reass */
140 /* NOTE: increment on final dst if */
141 u_quad_t ifs6_reass_fail; /* # of reass failures */
142 /* NOTE: may not be packet count */
143 /* NOTE: increment on final dst if */
144 u_quad_t ifs6_in_mcast; /* # of inbound multicast datagrams */
145 u_quad_t ifs6_out_mcast; /* # of outbound multicast datagrams */
146};
147
148/*
149 * ICMPv6 interface statistics, as defined in RFC2466 Ipv6IfIcmpEntry.
150 * XXX: I'm not sure if this file is the right place for this structure...
151 */
152struct icmp6_ifstat {
153 /*
154 * Input statistics
155 */
156 /* ipv6IfIcmpInMsgs, total # of input messages */
157 u_quad_t ifs6_in_msg;
158 /* ipv6IfIcmpInErrors, # of input error messages */
159 u_quad_t ifs6_in_error;
160 /* ipv6IfIcmpInDestUnreachs, # of input dest unreach errors */
161 u_quad_t ifs6_in_dstunreach;
162 /* ipv6IfIcmpInAdminProhibs, # of input administratively prohibited errs */
163 u_quad_t ifs6_in_adminprohib;
164 /* ipv6IfIcmpInTimeExcds, # of input time exceeded errors */
165 u_quad_t ifs6_in_timeexceed;
166 /* ipv6IfIcmpInParmProblems, # of input parameter problem errors */
167 u_quad_t ifs6_in_paramprob;
168 /* ipv6IfIcmpInPktTooBigs, # of input packet too big errors */
169 u_quad_t ifs6_in_pkttoobig;
170 /* ipv6IfIcmpInEchos, # of input echo requests */
171 u_quad_t ifs6_in_echo;
172 /* ipv6IfIcmpInEchoReplies, # of input echo replies */
173 u_quad_t ifs6_in_echoreply;
174 /* ipv6IfIcmpInRouterSolicits, # of input router solicitations */
175 u_quad_t ifs6_in_routersolicit;
176 /* ipv6IfIcmpInRouterAdvertisements, # of input router advertisements */
177 u_quad_t ifs6_in_routeradvert;
178 /* ipv6IfIcmpInNeighborSolicits, # of input neighbor solicitations */
179 u_quad_t ifs6_in_neighborsolicit;
180 /* ipv6IfIcmpInNeighborAdvertisements, # of input neighbor advertisements */
181 u_quad_t ifs6_in_neighboradvert;
182 /* ipv6IfIcmpInRedirects, # of input redirects */
183 u_quad_t ifs6_in_redirect;
184 /* ipv6IfIcmpInGroupMembQueries, # of input MLD queries */
185 u_quad_t ifs6_in_mldquery;
186 /* ipv6IfIcmpInGroupMembResponses, # of input MLD reports */
187 u_quad_t ifs6_in_mldreport;
188 /* ipv6IfIcmpInGroupMembReductions, # of input MLD done */
189 u_quad_t ifs6_in_mlddone;
190
191 /*
192 * Output statistics. We should solve unresolved routing problem...
193 */
194 /* ipv6IfIcmpOutMsgs, total # of output messages */
195 u_quad_t ifs6_out_msg;
196 /* ipv6IfIcmpOutErrors, # of output error messages */
197 u_quad_t ifs6_out_error;
198 /* ipv6IfIcmpOutDestUnreachs, # of output dest unreach errors */
199 u_quad_t ifs6_out_dstunreach;
200 /* ipv6IfIcmpOutAdminProhibs, # of output administratively prohibited errs */
201 u_quad_t ifs6_out_adminprohib;
202 /* ipv6IfIcmpOutTimeExcds, # of output time exceeded errors */
203 u_quad_t ifs6_out_timeexceed;
204 /* ipv6IfIcmpOutParmProblems, # of output parameter problem errors */
205 u_quad_t ifs6_out_paramprob;
206 /* ipv6IfIcmpOutPktTooBigs, # of output packet too big errors */
207 u_quad_t ifs6_out_pkttoobig;
208 /* ipv6IfIcmpOutEchos, # of output echo requests */
209 u_quad_t ifs6_out_echo;
210 /* ipv6IfIcmpOutEchoReplies, # of output echo replies */
211 u_quad_t ifs6_out_echoreply;
212 /* ipv6IfIcmpOutRouterSolicits, # of output router solicitations */
213 u_quad_t ifs6_out_routersolicit;
214 /* ipv6IfIcmpOutRouterAdvertisements, # of output router advertisements */
215 u_quad_t ifs6_out_routeradvert;
216 /* ipv6IfIcmpOutNeighborSolicits, # of output neighbor solicitations */
217 u_quad_t ifs6_out_neighborsolicit;
218 /* ipv6IfIcmpOutNeighborAdvertisements, # of output neighbor advertisements */
219 u_quad_t ifs6_out_neighboradvert;
220 /* ipv6IfIcmpOutRedirects, # of output redirects */
221 u_quad_t ifs6_out_redirect;
222 /* ipv6IfIcmpOutGroupMembQueries, # of output MLD queries */
223 u_quad_t ifs6_out_mldquery;
224 /* ipv6IfIcmpOutGroupMembResponses, # of output MLD reports */
225 u_quad_t ifs6_out_mldreport;
226 /* ipv6IfIcmpOutGroupMembReductions, # of output MLD done */
227 u_quad_t ifs6_out_mlddone;
228};
229
230#if !defined(_NET_IPV6_H) && !defined(STRUCT_IN6_IFREQ_DEFINED)
231#define STRUCT_IN6_IFREQ_DEFINED
232
233struct in6_ifreq {
234 char ifr_name[IFNAMSIZ];
235 union {
236 struct sockaddr_in6 ifru_addr;
237 struct sockaddr_in6 ifru_dstaddr;
238 short ifru_flags;
239 int ifru_flags6;
240 int ifru_metric;
241 caddr_t ifru_data;
242 struct in6_addrlifetime ifru_lifetime;
243 struct in6_ifstat ifru_stat;
244 struct icmp6_ifstat ifru_icmp6stat;
245 u_int32_t ifru_scope_id [16];
246 } ifr_ifru;
247};
248#endif
249
250/*
251 * Undefine 'ifra_dstaddr' because of:
252 *
253 * .\netinet6/in6_var.h(253,30): warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
254 * struct sockaddr_in6 ifra_dstaddr;
255 * ^
256 * .\netinet/in_var.h(72,22): note: expanded from macro 'ifra_dstaddr'
257 * #define ifra_dstaddr ifra_broadaddr
258 * ^
259 * .\net/if.h(321,25): note: expanded from macro 'ifra_broadaddr'
260 * #define ifra_broadaddr ifra_dstaddr
261 * ^
262*/
263#undef ifra_dstaddr
264
265struct in6_aliasreq {
266 char ifra_name [IFNAMSIZ];
267 struct sockaddr_in6 ifra_addr;
268 struct sockaddr_in6 ifra_dstaddr;
269 struct sockaddr_in6 ifra_prefixmask;
270 int ifra_flags;
271 struct in6_addrlifetime ifra_lifetime;
272};
273
274/* prefix type macro */
275#define IN6_PREFIX_ND 1
276#define IN6_PREFIX_RR 2
277
278/* prefix "router advert" */
279struct prf_ra {
280 u_char onlink : 1;
281 u_char autonomous : 1;
282 u_char reserved : 6;
283 };
284
285/* prefix "router resource"? */
286struct prf_rr {
287 u_char decrvalid : 1;
288 u_char decrprefd : 1;
289 u_char reserved : 6;
290 };
291
292/*
293 * prefix related flags passed between kernel(NDP related part) and
294 * user land command(ifconfig) and daemon(rtadvd).
295 */
296struct in6_prflags {
297 struct prf_ra prf_ra;
298 u_char prf_reserved1;
299 u_short prf_reserved2;
300
301 /* want to put this on 4byte offset */
302 struct prf_rr prf_rr;
303 u_char prf_reserved3;
304 u_short prf_reserved4;
305};
306
307struct in6_prefixreq {
308 char ipr_name [IFNAMSIZ];
309 u_char ipr_origin;
310 u_char ipr_plen;
311 u_int32_t ipr_vltime;
312 u_int32_t ipr_pltime;
313 struct in6_prflags ipr_flags;
314 struct sockaddr_in6 ipr_prefix;
315};
316
317#define PR_ORIG_RA 0
318#define PR_ORIG_RR 1
319#define PR_ORIG_STATIC 2
320#define PR_ORIG_KERNEL 3
321
322#define ipr_raf_onlink ipr_flags.prf_ra.onlink
323#define ipr_raf_auto ipr_flags.prf_ra.autonomous
324
325#define ipr_statef_onlink ipr_flags.prf_state.onlink
326
327#define ipr_rrf_decrvalid ipr_flags.prf_rr.decrvalid
328#define ipr_rrf_decrprefd ipr_flags.prf_rr.decrprefd
329
330struct in6_rrenumreq {
331 char irr_name[IFNAMSIZ];
332 u_char irr_origin;
333 u_char irr_m_len; /* match len for matchprefix */
334 u_char irr_m_minlen; /* minlen for matching prefix */
335 u_char irr_m_maxlen; /* maxlen for matching prefix */
336 u_char irr_u_uselen; /* uselen for adding prefix */
337 u_char irr_u_keeplen; /* keeplen from matching prefix */
338 struct irr_raflagmask {
339 u_char onlink : 1;
340 u_char autonomous : 1;
341 u_char reserved : 6;
342 } irr_raflagmask;
343 u_int32_t irr_vltime;
344 u_int32_t irr_pltime;
345 struct in6_prflags irr_flags;
346 struct sockaddr_in6 irr_matchprefix;
347 struct sockaddr_in6 irr_useprefix;
348};
349
350#define irr_raf_mask_onlink irr_raflagmask.onlink
351#define irr_raf_mask_auto irr_raflagmask.autonomous
352#define irr_raf_mask_reserved irr_raflagmask.reserved
353
354#define irr_raf_onlink irr_flags.prf_ra.onlink
355#define irr_raf_auto irr_flags.prf_ra.autonomous
356
357#define irr_statef_onlink irr_flags.prf_state.onlink
358
359#define irr_rrf irr_flags.prf_rr
360#define irr_rrf_decrvalid irr_flags.prf_rr.decrvalid
361#define irr_rrf_decrprefd irr_flags.prf_rr.decrprefd
362
363/*
364 * Given a pointer to an in6_ifaddr (ifaddr),
365 * return a pointer to the addr as a sockaddr_in6
366 */
367#define IA6_IN6(ia) (&((ia)->ia_addr.sin6_addr))
368#define IA6_DSTIN6(ia) (&((ia)->ia_dstaddr.sin6_addr))
369#define IA6_MASKIN6(ia) (&((ia)->ia_prefixmask.sin6_addr))
370#define IA6_SIN6(ia) (&((ia)->ia_addr))
371#define IA6_DSTSIN6(ia) (&((ia)->ia_dstaddr))
372#define IFA_IN6(x) (&((struct sockaddr_in6 *)((x)->ifa_addr))->sin6_addr)
373#define IFA_DSTIN6(x) (&((struct sockaddr_in6 *)((x)->ifa_dstaddr))->sin6_addr)
374
375#define IFPR_IN6(x) (&((struct sockaddr_in6 *)((x)->ifpr_prefix))->sin6_addr)
376
377#ifdef _KERNEL
378 #define IN6_ARE_MASKED_ADDR_EQUAL(d, a, m) ( \
379 (((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \
380 (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \
381 (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \
382 (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 )
383#endif
384
385#define SIOCSIFADDR_IN6 _IOW('i', 12, struct in6_ifreq)
386#define SIOCGIFADDR_IN6 _IOWR('i', 33, struct in6_ifreq)
387
388#ifdef _KERNEL
389 /*
390 * SIOCSxxx ioctls should be unused (see comments in in6.c), but
391 * we do not shift numbers for binary compatibility.
392 */
393 #define SIOCSIFDSTADDR_IN6 _IOW('i', 14, struct in6_ifreq)
394 #define SIOCSIFNETMASK_IN6 _IOW('i', 22, struct in6_ifreq)
395#endif
396
397#define SIOCGIFDSTADDR_IN6 _IOWR('i', 34, struct in6_ifreq)
398#define SIOCGIFNETMASK_IN6 _IOWR('i', 37, struct in6_ifreq)
399
400#define SIOCDIFADDR_IN6 _IOW('i', 25, struct in6_ifreq)
401#define SIOCAIFADDR_IN6 _IOW('i', 26, struct in6_aliasreq)
402
403#define SIOCSIFPHYADDR_IN6 _IOW('i', 70, struct in6_aliasreq)
404#define SIOCGIFPSRCADDR_IN6 _IOWR('i', 71, struct in6_ifreq)
405#define SIOCGIFPDSTADDR_IN6 _IOWR('i', 72, struct in6_ifreq)
406
407#define SIOCGIFAFLAG_IN6 _IOWR('i', 73, struct in6_ifreq)
408
409#define SIOCGDRLST_IN6 _IOWR('i', 74, struct in6_drlist)
410#define SIOCGPRLST_IN6 _IOWR('i', 75, struct in6_prlist)
411
412#ifdef _KERNEL
413#define OSIOCGIFINFO_IN6 _IOWR('i', 76, struct in6_ondireq)
414#endif
415
416#define SIOCGIFINFO_IN6 _IOWR('i', 108, struct in6_ndireq)
417#define SIOCSNDFLUSH_IN6 _IOWR('i', 77, struct in6_ifreq)
418#define SIOCGNBRINFO_IN6 _IOWR('i', 78, struct in6_nbrinfo)
419#define SIOCSPFXFLUSH_IN6 _IOWR('i', 79, struct in6_ifreq)
420#define SIOCSRTRFLUSH_IN6 _IOWR('i', 80, struct in6_ifreq)
421
422#define SIOCGIFALIFETIME_IN6 _IOWR('i', 81, struct in6_ifreq)
423#define SIOCSIFALIFETIME_IN6 _IOWR('i', 82, struct in6_ifreq)
424#define SIOCGIFSTAT_IN6 _IOWR('i', 83, struct in6_ifreq)
425#define SIOCGIFSTAT_ICMP6 _IOWR('i', 84, struct in6_ifreq)
426
427#define SIOCSDEFIFACE_IN6 _IOWR('i', 85, struct in6_ndifreq)
428#define SIOCGDEFIFACE_IN6 _IOWR('i', 86, struct in6_ndifreq)
429
430#define SIOCSIFINFO_FLAGS _IOWR('i', 87, struct in6_ndireq) /* XXX */
431
432#define SIOCSSCOPE6 _IOW('i', 88, struct in6_ifreq)
433#define SIOCGSCOPE6 _IOWR('i', 89, struct in6_ifreq)
434#define SIOCGSCOPE6DEF _IOWR('i', 90, struct in6_ifreq)
435
436#define SIOCSIFPREFIX_IN6 _IOW('i', 100, struct in6_prefixreq) /* set */
437#define SIOCGIFPREFIX_IN6 _IOWR('i', 101, struct in6_prefixreq) /* get */
438#define SIOCDIFPREFIX_IN6 _IOW('i', 102, struct in6_prefixreq) /* del */
439#define SIOCAIFPREFIX_IN6 _IOW('i', 103, struct in6_rrenumreq) /* add */
440#define SIOCCIFPREFIX_IN6 _IOW('i', 104, struct in6_rrenumreq) /* change */
441#define SIOCSGIFPREFIX_IN6 _IOW('i', 105, struct in6_rrenumreq) /* set global */
442
443#define SIOCGETSGCNT_IN6 _IOWR('u', 106, struct sioc_sg_req6) /* get s,g pkt cnt */
444#define SIOCGETMIFCNT_IN6 _IOWR('u', 107, struct sioc_mif_req6) /* get pkt cnt per if */
445
446#define IN6_IFF_ANYCAST 0x01 /* anycast address */
447#define IN6_IFF_TENTATIVE 0x02 /* tentative address */
448#define IN6_IFF_DUPLICATED 0x04 /* DAD detected duplicate */
449#define IN6_IFF_DETACHED 0x08 /* may be detached from the link */
450#define IN6_IFF_DEPRECATED 0x10 /* deprecated address */
451#define IN6_IFF_NODAD 0x20 /* don't perform DAD on this address
452 * (used only at first SIOC* call)
453 */
454#define IN6_IFF_AUTOCONF 0x40 /* autoconfigurable address. */
455#define IN6_IFF_TEMPORARY 0x80 /* temporary (anonymous) address. */
456#define IN6_IFF_NOPFX 0x8000 /* skip kernel prefix management.
457 * XXX: this should be temporary.
458 */
459
460/* do not input/output */
461#define IN6_IFF_NOTREADY (IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED)
462
463#ifdef _KERNEL
464 #define IN6_ARE_SCOPE_CMP(a,b) ((a)-(b))
465 #define IN6_ARE_SCOPE_EQUAL(a,b) ((a)==(b))
466
467 extern struct in6_ifaddr *in6_ifaddr;
468
469 extern struct in6_ifstat **in6_ifstat;
470 extern size_t in6_ifstatmax;
471 extern struct icmp6stat icmp6stat;
472 extern struct icmp6_ifstat **icmp6_ifstat;
473 extern size_t icmp6_ifstatmax;
474
475 #define in6_ifstat_inc(ifp, tag) \
476 do { \
477 if ((ifp) && (ifp)->if_index <= if_index \
478 && (ifp)->if_index < in6_ifstatmax \
479 && in6_ifstat && in6_ifstat[(ifp)->if_index]) { \
480 in6_ifstat[(ifp)->if_index]->tag++; \
481 } \
482 } while (0)
483
484 extern struct ifqueue ip6intrq; /* IP6 packet input queue */
485 extern struct in6_addr zeroin6_addr;
486 extern u_char inet6ctlerrmap[];
487 extern unsigned long in6_maxmtu;
488
489 #ifdef MALLOC_DECLARE
490 MALLOC_DECLARE(M_IPMADDR);
491 #endif
492
493 /*
494 * Macro for finding the internet address structure (in6_ifaddr) corresponding
495 * to a given interface (ifnet structure).
496 */
497 #define IFP_TO_IA6(ifp, ia) \
498 /* struct ifnet *ifp; */ \
499 /* struct in6_ifaddr *ia; */ \
500 do { \
501 struct ifaddr *ifa; \
502 for (ifa = (ifp)->if_addrlist.tqh_first; ifa; ifa = ifa->ifa_list.tqe_next) { \
503 if (!ifa->ifa_addr) \
504 continue; \
505 if (ifa->ifa_addr->sa_family == AF_INET6) \
506 break; \
507 } \
508 (ia) = (struct in6_ifaddr *)ifa; \
509 } while (0)
510
511#endif /* _KERNEL */
512
513/*
514 * Multi-cast membership entry. One for each group/ifp that a PCB
515 * belongs to.
516 */
517struct in6_multi_mship {
518 struct in6_multi *i6mm_maddr; /* Multicast address pointer */
519 LIST_ENTRY(in6_multi_mship) i6mm_chain; /* multicast options chain */
520};
521
522struct in6_multi {
523 LIST_ENTRY(in6_multi) in6m_entry; /* list glue */
524 struct in6_addr in6m_addr; /* IP6 multicast address */
525 struct ifnet *in6m_ifp; /* back pointer to ifnet */
526 struct ifmultiaddr *in6m_ifma; /* back pointer to ifmultiaddr */
527 u_int in6m_refcount; /* # membership claims by sockets */
528 u_int in6m_state; /* state of the membership */
529 u_int in6m_timer; /* MLD6 listener report timer */
530};
531
532#ifdef _KERNEL
533extern LIST_HEAD(in6_multihead, in6_multi) in6_multihead;
534
535/*
536 * Structure used by macros below to remember position when stepping through
537 * all of the in6_multi records.
538 */
539struct in6_multistep {
540 struct in6_ifaddr *i_ia;
541 struct in6_multi *i_in6m;
542};
543
544/*
545 * Macros for looking up the in6_multi record for a given IP6 multicast
546 * address on a given interface. If no matching record is found, "in6m"
547 * returns NLL.
548 */
549#define IN6_LOOKUP_MULTI(addr, ifp, in6m) \
550 /* struct in6_addr addr; */ \
551 /* struct ifnet *ifp; */ \
552 /* struct in6_multi *in6m; */ \
553 do { \
554 struct ifmultiaddr *ifma; \
555 TAILQ_FOREACH(ifma, &(ifp)->if_multiaddrs, ifma_link) { \
556 if (ifma->ifma_addr->sa_family == AF_INET6 && \
557 IN6_ARE_ADDR_EQUAL(&((struct sockaddr_in6 *)ifma->ifma_addr)->sin6_addr, \
558 &(addr))) \
559 break; \
560 } \
561 (in6m) = (struct in6_multi *)(ifma ? ifma->ifma_protospec : 0); \
562 } while(0)
563
564/*
565 * Macro to step through all of the in6_multi records, one at a time.
566 * The current position is remembered in "step", which the caller must
567 * provide. IN6_FIRST_MULTI(), below, must be called to initialize "step"
568 * and get the first record. Both macros return a NULL "in6m" when there
569 * are no remaining records.
570 */
571#define IN6_NEXT_MULTI(step, in6m) \
572 /* struct in6_multistep step; */ \
573 /* struct in6_multi *in6m; */ \
574 do { \
575 if (((in6m) = (step).i_in6m) != NULL) \
576 (step).i_in6m = (step).i_in6m->in6m_entry.le_next; \
577 } while(0)
578
579#define IN6_FIRST_MULTI(step, in6m) \
580 /* struct in6_multistep step; */ \
581 /* struct in6_multi *in6m */ \
582 do { \
583 (step).i_in6m = in6_multihead.lh_first; \
584 IN6_NEXT_MULTI((step), (in6m)); \
585 } while(0)
586
587struct in6_multi *in6_addmulti (struct in6_addr *, struct ifnet *, int *);
588void in6_delmulti (struct in6_multi *);
589extern int in6_ifindex2scopeid (int);
590extern int in6_mask2len (struct in6_addr *, u_char *);
591extern void in6_len2mask (struct in6_addr *, int);
592int in6_control (struct socket *, u_long, caddr_t, struct ifnet *, struct thread *);
593int in6_update_ifa (struct ifnet *, struct in6_aliasreq *, struct in6_ifaddr *);
594void in6_purgeaddr (struct ifaddr *);
595int in6if_do_dad (struct ifnet *);
596void in6_purgeif (struct ifnet *);
597void in6_savemkludge (struct in6_ifaddr *);
598void in6_setmaxmtu (void);
599void in6_restoremkludge (struct in6_ifaddr *, struct ifnet *);
600void in6_purgemkludge (struct ifnet *);
601struct in6_ifaddr *in6ifa_ifpforlinklocal (struct ifnet *, int);
602struct in6_ifaddr *in6ifa_ifpwithaddr (struct ifnet *, struct in6_addr *);
603char *ip6_sprintf (const struct in6_addr *);
604int in6_addr2scopeid (struct ifnet *, struct in6_addr *);
605int in6_matchlen (struct in6_addr *, struct in6_addr *);
606int in6_are_prefix_equal (struct in6_addr *p1, struct in6_addr *p2, int len);
607void in6_prefixlen2mask (struct in6_addr *maskp, int len);
608int in6_prefix_ioctl (struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp);
609int in6_prefix_add_ifid (int iilen, struct in6_ifaddr *ia);
610void in6_prefix_remove_ifid (int iilen, struct in6_ifaddr *ia);
611void in6_purgeprefix (struct ifnet *);
612int in6_is_addr_deprecated (struct sockaddr_in6 *);
613
614struct inpcb;
615int in6_embedscope (struct in6_addr *, const struct sockaddr_in6 *, struct inpcb *, struct ifnet **);
616int in6_recoverscope (struct sockaddr_in6 *, const struct in6_addr *, struct ifnet *);
617void in6_clearscope (struct in6_addr *);
618#endif /* _KERNEL */
619
620#endif /* _NETINET6_IN6_VAR_H_ */
icmp6_ifstat
Definition: in6_var.h:152
icmp6stat
Definition: icmp6.h:563
ifaddr
Definition: if.h:250
ifnet
Definition: if.h:136
ifprefix
Definition: wtypes.h:383
ifqueue
Definition: if.h:128
in6_addr
Definition: in.h:151
in6_addrlifetime
Definition: in6_var.h:84
in6_aliasreq
Definition: in6_var.h:265
in6_ifaddr
Definition: in6_var.h:91
in6_ifreq
Definition: ipv6.h:72
in6_ifstat
Definition: in6_var.h:114
in6_multi_mship
Definition: in6_var.h:517
in6_multi
Definition: in6_var.h:522
in6_multistep
Definition: in6_var.h:539
in6_prefixreq
Definition: in6_var.h:307
in6_prflags
Definition: in6_var.h:296
in6_rrenumreq::irr_raflagmask
Definition: in6_var.h:338
in6_rrenumreq
Definition: in6_var.h:330
inpcb
Definition: in_pcb.h:61
nd_prefix
Definition: nd6.h:223
prf_ra
Definition: in6_var.h:279
prf_rr
Definition: in6_var.h:286
sockaddr_in6
Definition: in.h:231
socket
Definition: if.h:82


Watt-32 tcp/ip: E:/WATT/inc/netinet/in.h Source File

  • inc
  • netinet
in.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1990, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_IN_H
39#define __NETINET_IN_H
40
41#ifndef __SYS_SOCKET_H
42#include <sys/socket.h>
43#endif
44
45/*
46 * Constants and structures defined by the internet system,
47 * Per RFC 790, September 1981, and numerous additions.
48 */
49
50/*
51 * Protocols
52 */
53#define IPPROTO_IP 0 /* dummy for IP */
54#define IPPROTO_ICMP 1 /* control message protocol */
55#define IPPROTO_IGMP 2 /* group mgmt protocol */
56#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
57#define IPPROTO_IPIP 4 /* IP encapsulation in IP */
58#define IPPROTO_TCP 6 /* tcp */
59#define IPPROTO_EGP 8 /* exterior gateway protocol */
60#define IPPROTO_IGRP 9 /* interior gw routing protocol */
61#define IPPROTO_PUP 12 /* pup */
62#define IPPROTO_UDP 17 /* user datagram protocol */
63#define IPPROTO_IDP 22 /* xns idp */
64#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */
65#define IPPROTO_XTP 36 /* eXpress Transfer Protocol */
66#define IPPROTO_RSVP 46 /* resource reservation */
67#define IPPROTO_ESP 50
68#define IPPROTO_AH 51 /* authenticate header */
69#define IPPROTO_ICMPV6 58 /* ICMP v6 */
70#define IPPROTO_NONE 59
71#define IPPROTO_EON 80 /* ISO cnlp */
72#define IPPROTO_ENCAP 98 /* encapsulation header */
73#define IPPROTO_PIM 103
74#define IPPROTO_VRRP 112
75#define IPPROTO_SCTP 132
76
77#define IPPROTO_DIVERT 254 /* divert pseudo-protocol */
78#define IPPROTO_RAW 255 /* raw IP packet */
79#define IPPROTO_MAX 256
80
81
82/*
83 * Local port number conventions:
84 *
85 * When a user does a bind(2) or connect(2) with a port number of zero,
86 * a non-conflicting local port address is chosen.
87 * The default range is IPPORT_RESERVED through
88 * IPPORT_USERRESERVED, although that is settable by sysctl.
89 *
90 * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
91 * default assignment range.
92 *
93 * The value IP_PORTRANGE_DEFAULT causes the default behavior.
94 *
95 * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers
96 * into the "high" range. These are reserved for client outbound connections
97 * which do not want to be filtered by any firewalls.
98 *
99 * The value IP_PORTRANGE_LOW changes the range to the "low" are
100 * that is (by convention) restricted to privileged processes. This
101 * convention is based on "vouchsafe" principles only. It is only secure
102 * if you trust the remote host to restrict these ports.
103 *
104 * The default range of ports and the high range can be changed by
105 * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto)
106 *
107 * Changing those values has bad security implications if you are
108 * using a a stateless firewall that is allowing packets outside of that
109 * range in order to allow transparent outgoing connections.
110 *
111 * Such a firewall configuration will generally depend on the use of these
112 * default values. If you change them, you may find your Security
113 * Administrator looking for you with a heavy object.
114 */
115
116/*
117 * Ports < IPPORT_RESERVED are reserved for
118 * privileged processes (e.g. root). (IP_PORTRANGE_LOW)
119 * Ports > IPPORT_USERRESERVED are reserved
120 * for servers, not necessarily privileged. (IP_PORTRANGE_DEFAULT)
121 */
122#define IPPORT_RESERVED 1024
123#define IPPORT_USERRESERVED 5000
124
125/*
126 * Default local port range to use by setting IP_PORTRANGE_HIGH
127 */
128#define IPPORT_HIFIRSTAUTO 40000
129#define IPPORT_HILASTAUTO 44999
130
131/*
132 * Scanning for a free reserved port return a value below IPPORT_RESERVED,
133 * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was
134 * 512, but that conflicts with some well-known-services that firewalls may
135 * have a fit if we use.
136 */
137#define IPPORT_RESERVEDSTART 600
138
139
140/*
141 * Internet address (a structure for historical reasons)
142 */
143struct in_addr {
144 u_int32_t s_addr;
145 };
146
147/*
148 * For IPv6 from RFC2133
149 */
150#if 0
151 struct in6_addr {
152 u_int8_t s6_addr [16];
153 };
154#else
155 struct in6_addr {
156 union {
157 u_int8_t _S6_u8 [16];
158 u_int16_t _S6_u16 [8];
159 u_int32_t _S6_u32 [4];
160 } _S6_un;
161 };
162 /* s6_addr is the standard name */
163 #define s6_addr _S6_un._S6_u8
164 #define s6_bytes _S6_un._S6_u8
165 #define s6_words _S6_un._S6_u16
166#endif
167
168/*
169 * Definitions of bits in internet address integers.
170 * On subnets, the decomposition of addresses to host and net parts
171 * is done according to subnet mask, not the masks here.
172 */
173#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0)
174#define IN_CLASSA_NET 0xff000000
175#define IN_CLASSA_NSHIFT 24
176#define IN_CLASSA_HOST 0x00ffffff
177#define IN_CLASSA_MAX 128
178
179#define IN_CLASSB(i) (((long)(i) & 0xC0000000) == 0x80000000)
180#define IN_CLASSB_NET 0xffff0000
181#define IN_CLASSB_NSHIFT 16
182#define IN_CLASSB_HOST 0x0000ffff
183#define IN_CLASSB_MAX 65536
184
185#define IN_CLASSC(i) (((long)(i) & 0xE0000000) == 0xC0000000)
186#define IN_CLASSC_NET 0xffffff00
187#define IN_CLASSC_NSHIFT 8
188#define IN_CLASSC_HOST 0x000000ff
189
190#define IN_CLASSD(i) (((long)(i) & 0xF0000000) == 0xE0000000)
191#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
192#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
193#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
194#define IN_MULTICAST(i) IN_CLASSD(i)
195
196#define IN_EXPERIMENTAL(i) (((long)(i) & 0xF0000000) == 0xF0000000)
197#define IN_BADCLASS(i) (((long)(i) & 0xF0000000) == 0xF0000000)
198
199#define INADDR_ANY (u_int32_t)0x00000000
200#define INADDR_BROADCAST (u_int32_t)0xFFFFFFFF /* must be masked */
201#define INADDR_LOOPBACK (u_int32_t)0x7F000001 /* 127.0.0.1 */
202#define INADDR_NONE 0xFFFFFFFF /* -1 return */
203
204#define INADDR_UNSPEC_GROUP (u_int32_t)0xE0000000 /* 224.0.0.0 */
205#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xE0000001 /* 224.0.0.1 */
206#define INADDR_ALLRTRS_GROUP (u_int32_t)0xE0000002 /* 224.0.0.2 */
207#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xE00000FF /* 224.0.0.255 */
208
209#define IN_LOOPBACKNET 127 /* official! */
210
211W32_DATA const struct in6_addr in6addr_any; /* :: */
212W32_DATA const struct in6_addr in6addr_loopback; /* ::1 */
213
214#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
215#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
216
217#define INET_ADDRSTRLEN 16
218#define INET6_ADDRSTRLEN 46
219
220
221/*
222 * Socket address, internet style.
223 */
224struct sockaddr_in {
225 sa_family_t sin_family;
226 u_short sin_port;
227 struct in_addr sin_addr;
228 char sin_zero[8];
229 };
230
231struct sockaddr_in6 {
232 u_int16_t sin6_family;
233 u_int16_t sin6_port;
234 u_int32_t sin6_flowinfo;
235 struct in6_addr sin6_addr;
236 u_int32_t sin6_scope_id; /* IPv6 scope-id */
237 };
238
239/*
240 * Stolen from winsock2.h (hope this is portable)
241 * Portable IPv6/IPv4 version of sockaddr.
242 * Uses padding to force 8 byte alignment
243 * and maximum size of 128 bytes
244 */
245struct sockaddr_storage {
246 sa_family_t ss_family;
247 u_short ss_len; /* !! added for BSD progs, gv Nov-2003 */
248 char __ss_pad1[6]; /* pad to 8 */
249 long __ss_align1, __ssalign2; /* force alignment */
250 char __ss_pad2[110]; /* pad to 128 */
251 };
252
253
254/* IPv6 multicast request. */
255struct ipv6_mreq {
256 /* IPv6 multicast address of group */
257 struct in6_addr ipv6mr_multiaddr;
258
259 /* local interface */
260 unsigned long ipv6mr_interface;
261 };
262
263/*
264 * Structure used to describe IP options.
265 * Used to store options internally, to pass them to a process,
266 * or to restore options retrieved earlier.
267 * The ip_dst is used for the first-hop gateway when using a source route
268 * (this gets put into the header proper).
269 */
270struct ip_opts {
271 struct in_addr ip_dst; /* first hop, 0 w/o src rt */
272 char IP_opts[40]; /* actually variable in size */
273 };
274
275/*
276 * Options for use with [gs]etsockopt at the IP level.
277 * First word of comment is data type; bool is stored in int.
278 */
279#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */
280#define IP_HDRINCL 2 /* int; header is included with data */
281#define IP_TOS 3 /* int; IP type of service and preced. */
282#define IP_TTL 4 /* int; IP time to live */
283#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */
284#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */
285#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */
286#define IP_RETOPTS 8 /* ip_opts; set/get IP options */
287#define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */
288#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
289#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
290#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
291#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
292#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */
293#define IP_RSVP_ON 15 /* enable RSVP in kernel */
294#define IP_RSVP_OFF 16 /* disable RSVP in kernel */
295#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */
296#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */
297#define IP_PORTRANGE 19 /* int; range to choose for unspec port */
298#define IP_RECVIF 20 /* bool; receive reception if w/dgram */
299
300#define IP_FW_ADD 50 /* add a firewall rule to chain */
301#define IP_FW_DEL 51 /* delete a firewall rule from chain */
302#define IP_FW_FLUSH 52 /* flush firewall rule chain */
303#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */
304#define IP_FW_GET 54 /* get entire firewall rule chain */
305#define IP_NAT 55 /* set/get NAT opts */
306
307/*
308 * Defaults and limits for options
309 */
310#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
311#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
312#define IP_MAX_MEMBERSHIPS 20 /* per socket */
313
314/*
315 * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
316 */
317struct ip_mreq {
318 struct in_addr imr_multiaddr; /* IP multicast address of group */
319 struct in_addr imr_interface; /* local IP address of interface */
320};
321
322/*
323 * Argument for IP_PORTRANGE:
324 * - which range to search when port is unspecified at bind() or connect()
325 */
326#define IP_PORTRANGE_DEFAULT 0 /* default range */
327#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
328#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
329
330/*
331 * Definitions for inet sysctl operations.
332 *
333 * Third level is protocol number.
334 * Fourth level is desired variable within that protocol.
335 */
336#define IPPROTO_MAXID (IPPROTO_IDP + 1) /* don't list to IPPROTO_MAX */
337
338#define CTL_IPPROTO_NAMES { \
339 { "ip", CTLTYPE_NODE }, \
340 { "icmp", CTLTYPE_NODE }, \
341 { "igmp", CTLTYPE_NODE }, \
342 { "ggp", CTLTYPE_NODE }, \
343 { 0, 0 }, \
344 { 0, 0 }, \
345 { "tcp", CTLTYPE_NODE }, \
346 { 0, 0 }, \
347 { "egp", CTLTYPE_NODE }, \
348 { 0, 0 }, \
349 { 0, 0 }, \
350 { 0, 0 }, \
351 { "pup", CTLTYPE_NODE }, \
352 { 0, 0 }, \
353 { 0, 0 }, \
354 { 0, 0 }, \
355 { 0, 0 }, \
356 { "udp", CTLTYPE_NODE }, \
357 { 0, 0 }, \
358 { 0, 0 }, \
359 { 0, 0 }, \
360 { 0, 0 }, \
361 { "idp", CTLTYPE_NODE }, \
362}
363
364/*
365 * Names for IP sysctl objects
366 */
367#define IPCTL_FORWARDING 1 /* act as router */
368#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
369#define IPCTL_DEFTTL 3 /* default TTL */
370#define IPCTL_DEFMTU 4 /* default MTU */
371#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */
372#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */
373#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */
374#define IPCTL_SOURCEROUTE 8 /* may perform source routes */
375#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */
376#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */
377#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */
378#define IPCTL_MAXID 12
379
380#define IPCTL_NAMES { \
381 { 0, 0 }, \
382 { "forwarding", CTLTYPE_INT }, \
383 { "redirect", CTLTYPE_INT }, \
384 { "ttl", CTLTYPE_INT }, \
385 { "mtu", CTLTYPE_INT }, \
386 { "rtexpire", CTLTYPE_INT }, \
387 { "rtminexpire", CTLTYPE_INT }, \
388 { "rtmaxcache", CTLTYPE_INT }, \
389 { "sourceroute", CTLTYPE_INT }, \
390 { "directed-broadcast", CTLTYPE_INT }, \
391 { "intr-queue-maxlen", CTLTYPE_INT }, \
392 { "intr-queue-drops", CTLTYPE_INT }, \
393}
394
395
396/*
397 * IPv6 address macros
398 */
399#ifndef IN6_IS_ADDR_UNSPECIFIED
400#define IN6_IS_ADDR_UNSPECIFIED(a) \
401 (((u_int32_t*)(a))[0] == 0 \
402 && ((u_int32_t*)(a))[1] == 0 \
403 && ((u_int32_t*)(a))[2] == 0 \
404 && ((u_int32_t*)(a))[3] == 0)
405#endif
406
407#ifndef IN6_IS_ADDR_LOOPBACK
408#define IN6_IS_ADDR_LOOPBACK(a) \
409 (((u_int32_t*)(a))[0] == 0 \
410 && ((u_int32_t*)(a))[1] == 0 \
411 && ((u_int32_t*)(a))[2] == 0 \
412 && ((u_int32_t*)(a))[3] == htonl (1))
413#endif
414
415#ifndef IN6_IS_ADDR_MULTICAST
416#define IN6_IS_ADDR_MULTICAST(a) (((u_int8_t*) (a))[0] == 0xff)
417#endif
418
419#define IN6_IS_ADDR_LINKLOCAL(a) \
420 ((((u_int32_t*)(a))[0] & htonl(0xffc00000)) == htonl(0xfe800000))
421
422#ifndef IN6_IS_ADDR_SITELOCAL
423#define IN6_IS_ADDR_SITELOCAL(a) \
424 ((((u_int32_t*)(a))[0] & htonl(0xffc00000)) == htonl(0xfec00000))
425#endif
426
427#ifndef IN6_IS_ADDR_V4MAPPED
428#define IN6_IS_ADDR_V4MAPPED(a) \
429 ((((u_int32_t*)(a))[0] == 0) \
430 && (((u_int32_t*)(a))[1] == 0) \
431 && (((u_int32_t*)(a))[2] == htonl(0xffff)))
432#endif
433
434#ifndef IN6_IS_ADDR_V4COMPAT
435#define IN6_IS_ADDR_V4COMPAT(a) \
436 ((((u_int32_t*)(a))[0] == 0) \
437 && (((u_int32_t*)(a))[1] == 0) \
438 && (((u_int32_t*)(a))[2] == 0) \
439 && (ntohl(((u_int32_t*)(a))[3]) > 1))
440#endif
441
442#ifndef IN6_ARE_ADDR_EQUAL
443#define IN6_ARE_ADDR_EQUAL(a, b) \
444 (memcmp ((void*)(a), (void*)(b), sizeof(struct in6_addr)) == 0)
445#endif
446
447#ifndef IN6_ADDR_EQUAL
448#define IN6_ADDR_EQUAL(a, b) IN6_ARE_ADDR_EQUAL(a, b)
449#endif
450
451#ifndef IN6_IS_ADDR_MC_NODELOCAL
452#define IN6_IS_ADDR_MC_NODELOCAL(a) \
453 (IN6_IS_ADDR_MULTICAST(a) && ((((u_int8_t*)(a))[1] & 0xf) == 0x1))
454#endif
455
456#ifndef IN6_IS_ADDR_MC_LINKLOCAL
457#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
458 (IN6_IS_ADDR_MULTICAST(a) && ((((u_int8_t*)(a))[1] & 0xf) == 0x2))
459#endif
460
461#ifndef IN6_IS_ADDR_MC_SITELOCAL
462#define IN6_IS_ADDR_MC_SITELOCAL(a) \
463 (IN6_IS_ADDR_MULTICAST(a) && ((((u_int8_t*)(a))[1] & 0xf) == 0x5))
464#endif
465
466#ifndef IN6_IS_ADDR_MC_ORGLOCAL
467#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
468 (IN6_IS_ADDR_MULTICAST(a) && ((((u_int8_t*)(a))[1] & 0xf) == 0x8))
469#endif
470
471#ifndef IN6_IS_ADDR_MC_GLOBAL
472#define IN6_IS_ADDR_MC_GLOBAL(a) \
473 (IN6_IS_ADDR_MULTICAST(a) && ((((u_int8_t*)(a))[1] & 0xf) == 0xe))
474#endif
475
476#endif /* __NETINET_IN_H */
477
socket.h
in6_addr
Definition: in.h:151
in_addr
Definition: in.h:143
ip_mreq
Definition: in.h:317
ip_opts
Definition: in.h:270
ipv6_mreq
Definition: in.h:255
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
sockaddr_storage
Definition: in.h:245


Watt-32 tcp/ip: E:/WATT/inc/netinet/in_pcb.h Source File

  • inc
  • netinet
in_pcb.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1990, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_IN_PCB_H
39#define __NETINET_IN_PCB_H
40
41#ifndef __SYS_MBUF_H
42#include <sys/mbuf.h>
43#endif
44
45#ifndef __SYS_QUEUE_H
46#include <sys/queue.h>
47#endif
48
49#include <netinet/ip.h>
50#include <net/route.h>
51
52/*
53 * Common structure pcb for internet protocol implementation.
54 * Here are stored pointers to local and foreign host table
55 * entries, local and foreign socket numbers, and pointers
56 * up (to a socket structure) and down (to a protocol-specific)
57 * control block.
58 */
59LIST_HEAD(inpcbhead, inpcb);
60
61struct inpcb {
62 LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */
63 LIST_ENTRY(inpcb) inp_hash; /* hash list */
64 struct inpcbinfo *inp_pcbinfo;
65 struct in_addr inp_faddr; /* foreign host table entry */
66 u_short inp_fport; /* foreign port */
67 struct in_addr inp_laddr; /* local host table entry */
68 u_short inp_lport; /* local port */
69 struct socket *inp_socket; /* back pointer to socket */
70 caddr_t inp_ppcb; /* pointer to per-protocol pcb */
71 struct route inp_route; /* placeholder for routing entry */
72 int inp_flags; /* generic IP/datagram flags */
73 struct ip inp_ip; /* header prototype; should have more */
74 struct mbuf *inp_options; /* IP options */
75 struct ip_moptions *inp_moptions; /* IP multicast options */
76};
77
78struct inpcbinfo {
79 struct inpcbhead *listhead;
80 struct inpcbhead *hashbase;
81 unsigned long hashmask;
82 unsigned short lastport;
83 unsigned short lastlow;
84 unsigned short lasthi;
85};
86
87#define INP_PCBHASH(faddr, lport, fport, mask) \
88 (((faddr) ^ ((faddr) >> 16) ^ (lport) ^ (fport)) & (mask))
89
90/* flags in inp_flags: */
91#define INP_RECVOPTS 0x01 /* receive incoming IP options */
92#define INP_RECVRETOPTS 0x02 /* receive IP options for reply */
93#define INP_RECVDSTADDR 0x04 /* receive IP dst address */
94#define INP_HDRINCL 0x08 /* user supplies entire IP header */
95#define INP_HIGHPORT 0x10 /* user wants "high" port binding */
96#define INP_LOWPORT 0x20 /* user wants "low" port binding */
97#define INP_ANONPORT 0x40 /* port chosen for user */
98#define INP_RECVIF 0x80 /* receive incoming interface */
99#define INP_CONTROLOPTS (INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR|\
100 INP_RECVIF)
101
102#define INPLOOKUP_WILDCARD 1
103
104#define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb)
105
106#endif
ip.h
queue.h
route.h
in_addr
Definition: in.h:143
inpcb
Definition: in_pcb.h:61
inpcbinfo
Definition: in_pcb.h:78
ip_moptions
Definition: ip_var.h:125
mbuf
Definition: mbuf.h:6
route
Definition: route.h:55
socket
Definition: if.h:82


Watt-32 tcp/ip: E:/WATT/inc/netinet/in_systm.h Source File

  • inc
  • netinet
in_systm.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_IN_SYSTM_H
39#define __NETINET_IN_SYSTM_H
40
41#include <sys/wtypes.h>
42
43/*
44 * Miscellaneous internetwork
45 * definitions for kernel.
46 */
47
48/*
49 * Network types.
50 *
51 * Internally the system keeps counters in the headers with the bytes
52 * swapped so that VAX instructions will work on them. It reverses
53 * the bytes before transmission at each protocol level. The n_ types
54 * represent the types with the bytes in ``high-ender'' order.
55 */
56typedef u_short n_short; /* short as received from the net */
57typedef u_long n_long; /* long as received from the net */
58
59typedef u_long n_time; /* ms since 00:00 GMT, byte rev */
60
61#endif
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/netinet/in_var.h Source File

  • inc
  • netinet
in_var.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1985, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_IN_VAR_H
39#define __NETINET_IN_VAR_H
40
41#include <sys/queue.h>
42#include <netinet/in.h>
43#include <net/if.h>
44
45/*
46 * Interface address, Internet version. One of these structures
47 * is allocated for each interface with an Internet address.
48 * The ifaddr structure contains the protocol-independent part
49 * of the structure and is assumed to be first.
50 */
51struct in_ifaddr {
52 struct ifaddr ia_ifa; /* protocol-independent info */
53#define ia_ifp ia_ifa.ifa_ifp
54#define ia_flags ia_ifa.ifa_flags
55 /* ia_{,sub}net{,mask} in host order */
56 u_long ia_net; /* network number of interface */
57 u_long ia_netmask; /* mask of net part */
58 u_long ia_subnet; /* subnet number, including net */
59 u_long ia_subnetmask; /* mask of subnet part */
60 struct in_addr ia_netbroadcast; /* to recognize net broadcasts */
61 struct in_ifaddr *ia_next; /* next in list of internet addresses */
62 struct sockaddr_in ia_addr; /* reserve space for interface name */
63 struct sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */
64#define ia_broadaddr ia_dstaddr
65 struct sockaddr_in ia_sockmask; /* reserve space for general netmask */
66 LIST_HEAD(in_multihead, in_multi) ia_multiaddrs;
67 /* list of multicast addresses */
68};
69
70struct in_aliasreq {
71 char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
72 struct sockaddr_in ifra_addr;
73 struct sockaddr_in ifra_broadaddr;
74#define ifra_dstaddr ifra_broadaddr
75 struct sockaddr_in ifra_mask;
76};
77/*
78 * Given a pointer to an in_ifaddr (ifaddr),
79 * return a pointer to the addr as a sockaddr_in.
80 */
81#define IA_SIN(ia) (&(((struct in_ifaddr *)(ia))->ia_addr))
82#define IA_DSTSIN(ia) (&(((struct in_ifaddr *)(ia))->ia_dstaddr))
83
84#define IN_LNAOF(in, ifa) \
85 ((ntohl((in).s_addr) & ~((struct in_ifaddr *)(ifa)->ia_subnetmask))
86
87
88/*
89 * This information should be part of the ifnet structure but we don't wish
90 * to change that - as it might break a number of things
91 */
92
93struct router_info {
94 struct ifnet *rti_ifp;
95 int rti_type; /* type of router which is querier on this interface */
96 int rti_time; /* # of slow timeouts since last old query */
97 struct router_info *rti_next;
98};
99
100/*
101 * Internet multicast address structure. There is one of these for each IP
102 * multicast group to which this host belongs on a given network interface.
103 * They are kept in a linked list, rooted in the interface's in_ifaddr
104 * structure.
105 */
106struct in_multi {
107 LIST_ENTRY(in_multi) inm_entry; /* list glue */
108 struct in_addr inm_addr; /* IP multicast address */
109 struct ifnet *inm_ifp; /* back pointer to ifnet */
110 struct in_ifaddr *inm_ia; /* back pointer to in_ifaddr */
111 u_int inm_refcount; /* no. membership claims by sockets */
112 u_int inm_timer; /* IGMP membership report timer */
113 u_int inm_state; /* state of the membership */
114 struct router_info *inm_rti; /* router info*/
115};
116
117#endif
if.h
in.h
queue.h
ifaddr
Definition: if.h:250
ifnet
Definition: if.h:136
in_addr
Definition: in.h:143
in_aliasreq
Definition: in_var.h:70
in_ifaddr
Definition: in_var.h:51
in_multi
Definition: in_var.h:106
router_info
Definition: in_var.h:93
sockaddr_in
Definition: in.h:224


Watt-32 tcp/ip: E:/WATT/inc/arpa/tftp.h Source File

  • inc
  • arpa
tftp.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1983, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __ARPA_TFTP_H
39#define __ARPA_TFTP_H
40
41#include <sys/cdefs.h>
42
43/*
44 * Trivial File Transfer Protocol (IEN-133)
45 */
46#define SEGSIZE 512 /* data segment size */
47
48/*
49 * Packet types.
50 */
51#define RRQ 01 /* read request */
52#define WRQ 02 /* write request */
53#define DATA 03 /* data packet */
54#define ACK 04 /* acknowledgement */
55#undef ERROR /* In <wingdi.h> */
56#define ERROR 05 /* error code */
57#define OACK 06 /* option acknowledgement */
58
59W32_CLANG_PACK_WARN_OFF()
60
61#include <sys/pack_on.h>
62
63struct tftphdr {
64 unsigned short th_opcode; /* packet type */
65 union {
66 unsigned short tu_block; /* block # */
67 unsigned short tu_code; /* error code */
68 char tu_stuff[1]; /* request packet stuff */
69 } th_u;
70 char th_data[1]; /* data or error string */
71 };
72
73#include <sys/pack_off.h>
74
75W32_CLANG_PACK_WARN_DEF()
76
77#define th_block th_u.tu_block
78#define th_code th_u.tu_code
79#define th_stuff th_u.tu_stuff
80#define th_msg th_data
81
82/*
83 * Error codes.
84 */
85#define EUNDEF 0 /* not defined */
86#define ENOTFOUND 1 /* file not found */
87#define EACCESS 2 /* access violation */
88#define ENOSPACE 3 /* disk full or allocation exceeded */
89#define EBADOP 4 /* illegal TFTP operation */
90#define EBADID 5 /* unknown transfer ID */
91#define EEXISTS 6 /* file already exists */
92#define ENOUSER 7 /* no such user */
93#define EOPTNEG 8 /* option negotiation failed */
94
95#endif
cdefs.h
pack_off.h


Watt-32 tcp/ip: E:/WATT/inc/sys/socket.h Source File

  • inc
  • sys
socket.h
Go to the documentation of this file.
1
6/* Modified for emx by hv and em 1994-1995
7 *
8 * Copyright (c) 1982,1985,1986,1988 Regents of the University of California.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 */
39
40#ifndef __SYS_SOCKET_H
41#define __SYS_SOCKET_H
42
43#ifndef __SYS_W32API_H
44#include <sys/w32api.h>
45#endif
46
47#ifndef __SYS_WERRNO_H
48#include <sys/werrno.h>
49#endif
50
51#ifndef __SYS_CDEFS_H
52#include <sys/cdefs.h>
53#endif
54
55#ifndef __SYS_WTYPES_H
56#include <sys/wtypes.h>
57#endif
58
59#ifndef __SYS_WTIME_H
60#include <sys/wtime.h>
61#endif
62
63#ifndef __NETINET_IN_H
64#include <netinet/in.h>
65#endif
66
67/*
68 * Definitions related to sockets: types, address families, options.
69 */
70
71/* The following constants should be used for the second parameter,
72 the "how" field, of `shutdown'. */
73enum
74{
75 SHUT_RD = 0, /* Further receives are disallowed */
76#define SHUT_RD SHUT_RD
77 SHUT_WR, /* Further sends are disallowed */
78#define SHUT_WR SHUT_WR
79 SHUT_RDWR /* Further sends and receives are disallowed */
80#define SHUT_RDWR SHUT_RDWR
81};
82
83/*
84 * This is used instead of -1, since the socket type is signed.
85 */
86#define INVALID_SOCKET (int)(~0)
87#define SOCKET_ERROR (-1)
88
89/*
90 * Types
91 */
92#define SOCK_STREAM 1 /* stream socket */
93#define SOCK_DGRAM 2 /* datagram socket */
94#define SOCK_RAW 3 /* raw-protocol interface */
95#define SOCK_RDM 4 /* reliably-delivered message */
96#define SOCK_SEQPACKET 5 /* sequenced packet stream */
97#define SOCK_PACKET 10 /* linux specific way of */
98 /* getting packets at the dev */
99 /* level. For writing rarp and */
100 /* other similar things on the */
101 /* user level. */
102
103/*
104 * Option flags per-socket.
105 */
106#define SO_DEBUG 0x0001 /* turn on debugging info recording */
107#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
108#define SO_REUSEADDR 0x0004 /* allow local address reuse */
109#define SO_KEEPALIVE 0x0008 /* keep connections alive */
110#define SO_DONTROUTE 0x0010 /* just use interface addresses */
111#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
112#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
113#define SO_LINGER 0x0080 /* linger on close if data present */
114#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
115
116#define SO_DONTLINGER (int)(~SO_LINGER)
117
118/*
119 * Additional options, not kept in so_options.
120 */
121#define SO_SNDBUF 0x1001 /* send buffer size */
122#define SO_RCVBUF 0x1002 /* receive buffer size */
123#define SO_SNDLOWAT 0x1003 /* send low-water mark */
124#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
125#define SO_SNDTIMEO 0x1005 /* send timeout */
126#define SO_RCVTIMEO 0x1006 /* receive timeout */
127#define SO_ERROR 0x1007 /* get error status and clear */
128#define SO_TYPE 0x1008 /* get socket type */
129
130W32_CLANG_PACK_WARN_OFF()
131
132#include <sys/pack_on.h>
133
134/*
135 * Structure used for manipulating linger option.
136 */
137struct linger {
138 int l_onoff; /* option on/off */
139 int l_linger; /* linger time */
140 };
141
142/*
143 * Level number for (get/set)sockopt() to apply to socket itself.
144 */
145#define SOL_SOCKET 0xffff /* options for socket level */
146
147/*
148 * Address families.
149 */
150#define AF_UNSPEC 0 /* unspecified */
151#define AF_UNIX 1 /* local to host (pipes, portals) */
152#define AF_LOCAL 1 /* POSIX name for AF_UNIX */
153#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
154#define AF_IMPLINK 3 /* arpanet imp addresses */
155#define AF_PUP 4 /* pup protocols: e.g. BSP */
156#define AF_CHAOS 5 /* mit CHAOS protocols */
157#define AF_NS 6 /* XEROX NS protocols */
158#define AF_ISO 7 /* ISO protocols */
159#define AF_OSI AF_ISO
160#define AF_ECMA 8 /* european computer manufacturers */
161#define AF_DATAKIT 9 /* datakit protocols */
162#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
163#define AF_SNA 11 /* IBM SNA */
164#define AF_DECnet 12 /* DECnet */
165#define AF_DLI 13 /* DEC Direct data link interface */
166#define AF_LAT 14 /* LAT */
167#define AF_HYLINK 15 /* NSC Hyperchannel */
168#define AF_APPLETALK 16 /* Apple Talk */
169#define AF_ROUTE 17 /* Internal Routing Protocol */
170#define AF_LINK 18 /* Link layer interface */
171#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
172#define AF_INET6 24 /* IPv6 address family */
173#define AF_PACKET 25 /* raw packets */
174#define AF_MAX 26
175
176/*
177 * Structure used by kernel to store most
178 * addresses.
179 * is called struct osockaddr in 4.4BSD
180 */
181struct sockaddr {
182 sa_family_t sa_family; /* address family */
183 char sa_data[14]; /* up to 14 bytes of direct address */
184 };
185
186/*
187 * Structure used by kernel to pass protocol
188 * information in raw sockets.
189 */
190struct sockproto {
191 u_short sp_family; /* address family */
192 u_short sp_protocol; /* protocol */
193 };
194
195/*
196 * Protocol families, same as address families for now.
197 */
198#define PF_UNSPEC AF_UNSPEC
199#define PF_UNIX AF_UNIX
200#define PF_INET AF_INET
201#define PF_INET6 AF_INET6
202#define PF_IMPLINK AF_IMPLINK
203#define PF_PUP AF_PUP
204#define PF_CHAOS AF_CHAOS
205#define PF_NS AF_NS
206#define PF_ISO AF_ISO
207#define PF_OSI AF_ISO
208#define PF_ECMA AF_ECMA
209#define PF_DATAKIT AF_DATAKIT
210#define PF_CCITT AF_CCITT
211#define PF_SNA AF_SNA
212#define PF_DECnet AF_DECnet
213#define PF_DLI AF_DLI
214#define PF_LAT AF_LAT
215#define PF_HYLINK AF_HYLINK
216#define PF_APPLETALK AF_APPLETALK
217#define PF_ROUTE AF_ROUTE
218#define PF_LINK AF_LINK
219#define PF_PACKET AF_PACKET
220#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
221
222#define PF_MAX AF_MAX
223
224/*
225 * Maximum queue length specifiable by listen.
226 */
227#define SOMAXCONN 32
228
229/*
230 * Flags for send(), sendto(), recv() and recvfrom():
231 */
232#define MSG_OOB 0x1 /* process out-of-band data */
233#define MSG_PEEK 0x2 /* peek at incoming message */
234#define MSG_DONTROUTE 0x4 /* send without using routing tables */
235#define MSG_EOR 0x8 /* data completes record */
236#define MSG_TRUNC 0x10 /* data discarded before delivery */
237#define MSG_CTRUNC 0x20 /* control data lost before delivery */
238#define MSG_WAITALL 0x40 /* wait for full request or error */
239#define MSG_NOSIGNAL 0x80 /* don't raise SIGPIPE on reset */
240#define MSG_MORE 0x100 /* avoid flush, don't set PUSH bit */
241
242#define MSG_MAXIOVLEN 16
243
244
245/*
246 * Header for ancillary data objects in msg_control buffer.
247 * Used for additional information with/about a datagram
248 * not expressible by flags. The format is a sequence
249 * of message elements headed by cmsghdr structures.
250 */
251struct cmsghdr {
252 u_int cmsg_len; /* data byte count, including hdr */
253 int cmsg_level; /* originating protocol */
254 int cmsg_type; /* protocol-specific type */
255 /* followed by u_char cmsg_data[]; */
256 };
257
258struct msghdr {
259 char *msg_name; /* Contains an optional address. */
260 socklen_t msg_namelen; /* len of optional address */
261 struct iovec *msg_iov; /* scatter/gather array. */
262 int msg_iovlen; /* number of elements in msg_iov */
263 char *msg_accrights; /* does not apply to IP - not changed */
264 int msg_accrightslen; /* does not apply to IP */
265 void * msg_control; /* Ancillary data */
266 socklen_t msg_controllen; /* Ancillary data buffer length */
267 int msg_flags; /* Received flags on recvmsg */
268 };
269
270/* CMSG_DATA clashes with <wincrypt.h>
271 */
272#if (defined(WIN32) || defined(_WIN32)) && !defined(__CYGWIN__) && \
273 !defined(_WINDOWS_H) && !defined(_INC_WINDOWS) && !defined(__windows_h__) && \
274 !defined(_GNU_H_WINDOWS_H)
275 #error Include <windows.h> before this point.
276#endif
277
278/* given pointer to 'struct cmsghdr', return pointer to data
279 */
280#undef CMSG_DATA
281#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
282
283/* given pointer to 'struct msghdr', return pointer to next 'msghdr'
284 */
285#define CMSG_NXTHDR(mhdr, cmsg) \
286 (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
287 (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
288 (struct cmsghdr *)NULL : \
289 (struct cmsghdr *)((caddr_t)(cmsg) + (cmsg)->cmsg_len))
290
291#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
292
293/* "Socket"-level control message types: */
294#define SCM_RIGHTS 0x01 /* access rights (array of int) */
295
296#include <sys/pack_off.h>
297
298 W32_CLANG_PACK_WARN_DEF()
299
300__BEGIN_DECLS
301
302W32_FUNC int W32_CALL accept (int, struct sockaddr *, socklen_t *);
303W32_FUNC int W32_CALL bind (int, const struct sockaddr *, socklen_t);
304W32_FUNC int W32_CALL closesocket (int s);
305W32_FUNC int W32_CALL connect (int, const struct sockaddr *, socklen_t);
306W32_FUNC int W32_CALL ioctlsocket (int s, long cmd, void *argp);
307W32_FUNC int MS_CDECL fcntlsocket (int s, int cmd, ...);
308
309W32_FUNC int W32_CALL getdomainname (char *name, size_t len);
310W32_FUNC int W32_CALL setdomainname (const char *name, size_t len);
311
312W32_FUNC int W32_CALL getpeername (int, struct sockaddr *, socklen_t *);
313W32_FUNC int W32_CALL getsockname (int, struct sockaddr *, socklen_t *);
314W32_FUNC int W32_CALL getsockopt (int, int, int, void *, socklen_t *);
315W32_FUNC int W32_CALL listen (int, int);
316W32_FUNC int W32_CALL recv (int, void *, int, int);
317W32_FUNC int W32_CALL recvfrom (int, void *, int, int, struct sockaddr *, socklen_t *);
318W32_FUNC int W32_CALL recvmsg (int, struct msghdr *, int);
319W32_FUNC int W32_CALL send (int, const void *, int, int);
320W32_FUNC int W32_CALL sendto (int, const void *, int, int, const struct sockaddr *, socklen_t);
321W32_FUNC int W32_CALL sendmsg (int, const struct msghdr *, int);
322
323W32_FUNC int W32_CALL setsockopt (int, int, int, const void *, socklen_t);
324W32_FUNC int W32_CALL shutdown (int, int);
325W32_FUNC int W32_CALL socket (int, int, int);
326
327#ifdef __DJGPP__
328 W32_FUNC int W32_CALL gethostname (char *name, int len);
329#else
330 W32_FUNC int W32_CALL gethostname (char *name, size_t len);
331#endif
332
333#if defined(__CYGWIN__)
334 /*
335 * CygWin's <unistd.h> doesn't agree with other vendors here.
336 */
337 W32_FUNC long W32_CALL gethostid (void);
338 W32_FUNC long W32_CALL sethostid (u_long ip);
339 W32_FUNC int W32_CALL sethostname (const char *name, size_t len);
340#else
341 W32_FUNC u_long W32_CALL gethostid (void);
342 W32_FUNC u_long W32_CALL sethostid (u_long ip);
343 W32_FUNC int W32_CALL sethostname (const char *name, int len);
344#endif
345
346__END_DECLS
347
348#endif
accept
int W32_CALL accept(int s, struct sockaddr *addr, socklen_t *addrlen)
Definition: accept.c:67
sethostname
int W32_CALL sethostname(const char *fqdn, SETHOSTNAME_ARG2 len)
BSD-style: Expects a "Fully Qualified Domain Name" in ‘fqdn’.
Definition: bsdname.c:292
cdefs.h
in.h
getdomainname
W32_FUNC int W32_CALL getdomainname(char *name, size_t len)
BSD-style: Return domain name of this host.
Definition: bsdname.c:186
W32_CLANG_PACK_WARN_DEF
W32_CLANG_PACK_WARN_DEF() __BEGIN_DECLS W32_FUNC int W32_CALL accept(int
This hook is to prevent the BSD-socket API being linked in by default.
Definition: pcsed.h:261
sethostid
W32_FUNC long W32_CALL sethostid(u_long ip)
BSD-style: Sets local IPv4-address.
Definition: bsdname.c:79
gethostid
W32_FUNC long W32_CALL gethostid(void)
BSD style: returns local IPv4-address.
Definition: bsdname.c:68
bind
struct sockaddr socklen_t *W32_FUNC int W32_CALL bind(int, const struct sockaddr *, socklen_t)
bind() - bind name to socket.
Definition: bind.c:63
setdomainname
W32_FUNC int W32_CALL setdomainname(const char *name, size_t len)
BSD-style: Set the host's domain name.
Definition: bsdname.c:213
fcntlsocket
W32_FUNC int MS_CDECL fcntlsocket(int s, int cmd,...)
Definition: fcntl.c:69
shutdown
W32_FUNC int W32_CALL shutdown(int, int)
Definition: shutdown.c:42
pack_off.h
cmsghdr
Definition: socket.h:251
iovec
Definition: wtypes.h:222
msghdr
Definition: socket.h:258
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
sockproto
Definition: socket.h:190
w32api.h
werrno.h
wtime.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/arpa/inet.h Source File

  • inc
  • arpa
inet.h
Go to the documentation of this file.
1
5/* Modified for emx by hv and em 1994
6 *
7 * Copyright (c) 1983, 1993
8 * The Regents of the University of California. All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 */
38
39#ifndef __ARPA_INET_H
40#define __ARPA_INET_H
41
42#ifndef __SYS_W32API_H
43#include <sys/w32api.h>
44#endif
45
46#ifndef __SYS_TYPES_H
47#include <sys/wtypes.h>
48#endif
49
50#ifndef __SYS_CDEFS_H
51#include <sys/cdefs.h>
52#endif
53
54#ifndef __NETINET_IN_H
55#include <netinet/in.h>
56#endif
57
58
59__BEGIN_DECLS
60
61W32_FUNC int W32_CALL ascii2addr (int, const char *, void *);
62W32_FUNC char *W32_CALL addr2ascii (int, const void *, int, char *);
63
64W32_FUNC struct in_addr W32_CALL inet_makeaddr (u_long, u_long);
65W32_FUNC u_long W32_CALL inet_addr (const char*);
66W32_FUNC u_long W32_CALL inet_lnaof (struct in_addr);
67W32_FUNC u_long W32_CALL inet_netof (struct in_addr);
68W32_FUNC u_long W32_CALL inet_network (const char*);
69W32_FUNC int W32_CALL inet_aton (const char *s, struct in_addr *adr);
70W32_FUNC char* W32_CALL inet_ntoa (struct in_addr);
71W32_FUNC char* W32_CALL inet_ntoa_r (struct in_addr adr, char *buf, int buflen);
72
73W32_FUNC char *W32_CALL inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii);
74W32_FUNC u_int W32_CALL inet_nsap_addr(const char *ascii, u_char *binary, int maxlen);
75W32_FUNC const char *W32_CALL inet_ntop (int af, const void *src, char *dst, size_t size);
76W32_FUNC int W32_CALL inet_pton (int af, const char *src, void *dst);
77
78__END_DECLS
79
80#endif /* !__ARPA_INET_H_ */
cdefs.h
in.h
inet_pton
W32_FUNC int W32_CALL inet_pton(int af, const char *src, void *dst)
Convert from presentation format (which usually means ASCII printable) to network format (which is us...
Definition: presaddr.c:73
inet_makeaddr
W32_FUNC struct in_addr W32_CALL inet_makeaddr(u_long, u_long)
Formulate an Internet address from network + host (with subnet address).
Definition: netaddr.c:377
inet_ntop
W32_FUNC const char *W32_CALL inet_ntop(int af, const void *src, char *dst, size_t size)
Convert a network format address to presentation format.
Definition: presaddr.c:43
inet_netof
W32_FUNC u_long W32_CALL inet_netof(struct in_addr)
Return the network number from an internet address; handles class A/B/C network #'s.
Definition: netaddr.c:341
inet_lnaof
W32_FUNC u_long W32_CALL inet_lnaof(struct in_addr)
Return the local network address portion of an internet address; handles class A/B/C network number f...
Definition: netaddr.c:360
in_addr
Definition: in.h:143
w32api.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/src/ioctl.c Source File

  • src
ioctl.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 */
37
38#define BSD /* in order to include SIOxx macros in <sys/ioctl.h> */
39
40#include "socket.h"
41
42#if defined(USE_BSD_API)
43
44static int file_ioctrl (Socket *socket, long cmd, void *argp);
45static int iface_ioctrl (Socket *socket, long cmd, void *argp);
46static int arp_ioctrl (Socket *socket, long cmd, void *argp);
47static int waterm_ioctrl(Socket *socket, long cmd, void *argp);
48
49#define NO_CMD(cmd) SOCK_DEBUGF ((", unsupported cmd %d, group %c", \
50 (int)((cmd) & IOCPARM_MASK), \
51 (char)IOCGROUP(cmd)))
52#ifdef USE_DEBUG
53static const char *get_ioctl_cmd (long cmd);
54#endif
55
56#ifndef NUM_IFACES
57#define NUM_IFACES 1
58#endif
59
60#ifndef ARPHRD_FDDI
61#define ARPHRD_FDDI 10
62#endif
63
64int W32_CALL ioctlsocket (int s, long cmd, void *argp)
65{
66 Socket *socket = _socklist_find (s);
67
68 SOCK_PROLOGUE (socket, "\nioctlsocket:%d", s);
69
70 SOCK_DEBUGF ((", %s", get_ioctl_cmd(cmd)));
71
72 switch (IOCGROUP(cmd))
73 {
74 case 'f':
75 return file_ioctrl (socket, cmd, argp);
76
77 case 'I':
78 return iface_ioctrl (socket, cmd, argp);
79
80 case 's':
81 return waterm_ioctrl (socket, cmd, argp);
82
83 default:
84 NO_CMD (cmd);
85 SOCK_ERRNO (ESOCKTNOSUPPORT);
86 }
87 return (-1);
88}
89
90/*
91 * IO-control for "file" handles (i.e. stream/datagram sockets)
92 */
93static int file_ioctrl (Socket *socket, long cmd, void *argp)
94{
95 int len;
96
97 switch ((DWORD)cmd)
98 {
99 case FIONREAD:
100 VERIFY_RW (argp, sizeof(u_long));
101
102 if (socket->so_type != SOCK_DGRAM &&
103 socket->so_type != SOCK_STREAM)
104 {
105 SOCK_ERRNO (EBADF);
106 return (-1);
107 }
108 if (socket->so_type == SOCK_DGRAM)
109 {
110 if (socket->so_state & SS_PRIV)
111 len = sock_recv_used ((sock_type*)socket->udp_sock);
112 else len = sock_rbused ((sock_type*)socket->udp_sock);
113 }
114 else
115 len = sock_rbused ((sock_type*)socket->tcp_sock);
116
117 if (len < 0)
118 {
119 SOCK_ERRNO (EBADF);
120 return (-1);
121 }
122
123 SOCK_DEBUGF ((" %d", len));
124 if (len >= 0)
125 *(u_long*)argp = len;
126 break;
127
128 case FIONBIO: /* set nonblocking I/O on/off */
129 VERIFY_RW (argp, sizeof(char));
130
131 if (*(char*)argp)
132 {
133 socket->so_state |= SS_NBIO;
134 socket->timeout = 0;
135 if (socket->tcp_sock)
136 socket->tcp_sock->timeout = 0;
137 }
138 else
139 {
140 socket->so_state &= ~SS_NBIO;
141 if (socket->tcp_sock) /* Only TCP sockets timeout on inactivety */
142 socket->timeout = sock_delay;
143 }
144 SOCK_DEBUGF ((" %d", (socket->so_state & SS_NBIO) ? 1 : 0));
145 break;
146
147#if 0
148 case FIOASYNC:
149 case FIOCLEX:
150 case FIONCLEX:
151 case FIONREAD:
152 case FIOSETOWN:
153 case FIOGETOWN:
154#endif
155
156 default:
157 NO_CMD (cmd);
158 SOCK_ERRNO (ESOCKTNOSUPPORT);
159 return (-1);
160 }
161 return (0);
162}
163
164/*
165 * Return name of this interface.
166 * We only support a single interface at a time.
167 */
168static char eth_ifname [IFNAMSIZ] = "eth0";
169static char arc_ifname [IFNAMSIZ] = "arch0";
170static char tok_ifname [IFNAMSIZ] = "tr0";
171static char fddi_ifname[IFNAMSIZ] = "fddi0";
172static char ppp_ifname [IFNAMSIZ] = "ppp0";
173static char slp_ifname [IFNAMSIZ] = "slp0";
174
175void __get_ifname (char *if_name)
176{
177 switch (_pktdevclass)
178 {
179 case PDCLASS_ETHER:
180 strcpy (if_name, eth_ifname);
181 break;
182 case PDCLASS_TOKEN:
183 strcpy (if_name, tok_ifname);
184 break;
185 case PDCLASS_FDDI:
186 strcpy (if_name, fddi_ifname);
187 break;
188 case PDCLASS_ARCNET:
189 strcpy (if_name, arc_ifname);
190 break;
191 case PDCLASS_SLIP:
192 strcpy (if_name, slp_ifname);
193 break;
194 case PDCLASS_PPP:
195 strcpy (if_name, ppp_ifname);
196 break;
197 default:
198 strcpy (if_name, "??");
199 break;
200 }
201}
202
203#ifdef NOT_USED_YET
204/*
205 * Set a new name for this interface.
206 */
207void __set_ifname (const char *if_name)
208{
209 switch (_pktdevclass)
210 {
211 case PDCLASS_ETHER:
212 strcpy (eth_ifname, if_name);
213 break;
214 case PDCLASS_TOKEN:
215 strcpy (tok_ifname, if_name);
216 break;
217 case PDCLASS_FDDI:
218 strcpy (fddi_name, if_ifname);
219 break;
220 case PDCLASS_ARCNET:
221 strcpy (arc_name, if_ifname);
222 break;
223 case PDCLASS_SLIP:
224 strcpy (slp_ifname, if_name);
225 break;
226 case PDCLASS_PPP:
227 strcpy (ppp_ifname, if_name);
228 break;
229 default:
230 break;
231 }
232}
233
234static struct ifnet *eth_ifnet (void)
235{
236 static struct ifnet net;
237
239 return (&net);
240}
241
242static struct ifnet *tok_ifnet (void)
243{
244 static struct ifnet net;
245
247 return (&net);
248}
249#endif
250
251/*
252 * Ensure we do not 'memcpy()' too much from a '_eth_addr' which is only 6 bytes.
253 * The size of 'ifr_hwaddr.sa_data[]' could be 16.
254 *
255 * With gcc 7.x, a warning for:
256 * memcpy (&ifr->ifr_hwaddr.sa_data[0], &_eth_addr,
257 * sizeof(ifr->ifr_hwaddr.sa_data));
258 *
259 * was issued:
260 * ioctl.c:466:17: warning: 'memcpy' forming offset [7, 14] is out of the bounds [0, 6] of object
261 * '_eth_addr' with type 'eth_address' {aka 'unsigned char[6]'} [-Warray-bounds]
262 */
263#define FILL_hwaddr_sa_data(data, eth) \
264 memset (& data, '\0', sizeof(data)); \
265 memcpy (& data, & eth, sizeof(eth))
266
267/*
268 * Handler for interface request get/set commands
269 */
270static int iface_ioctrl (Socket *socket, long cmd, void *argp)
271{
272 struct ifreq *ifr = (struct ifreq *) argp;
273 struct ifconf *ifc = (struct ifconf*) argp;
274 struct sockaddr_in *sin;
275#if defined(USE_IPV6)
276 struct sockaddr_in6 *sin6;
277#endif
278 const eth_address *eth;
279 int len, i;
280
281 VERIFY_RW (argp, sizeof(*ifr));
282
283 switch ((DWORD)cmd)
284 {
285 case SIOCSARP:
286 case SIOCGARP:
287 case SIOCDARP:
288 return arp_ioctrl (socket, cmd, argp);
289
290 case SIOCGIFADDR: /* get interface address */
291 case OSIOCGIFADDR:
292 __get_ifname (ifr->ifr_name);
293
294 if (ifr->ifr_addr.sa_family == AF_INET)
295 {
296 sin = (struct sockaddr_in*) &ifr->ifr_addr;
297 sin->sin_addr.s_addr = htonl (my_ip_addr);
298 break;
299 }
300#if defined(USE_IPV6)
301 if (ifr->ifr_addr.sa_family == AF_INET6)
302 {
303 sin6 = (struct sockaddr_in6*) &ifr->ifr_addr;
304 memcpy (&sin6->sin6_addr, &in6addr_my_ip, sizeof(sin6->sin6_addr));
305 break;
306 }
307#endif
308 if (_pktdevclass == PDCLASS_TOKEN || /* otherwise return MAC addr? */
309 _pktdevclass == PDCLASS_ETHER ||
310 _pktdevclass == PDCLASS_ARCNET ||
311 _pktdevclass == PDCLASS_FDDI)
312 memcpy (&ifr->ifr_addr.sa_data[0], &_eth_addr, sizeof(_eth_addr));
313 else memset (&ifr->ifr_addr.sa_data[0], '\0', sizeof(ifr->ifr_addr.sa_data));
314 break;
315
316 case SIOCGIFMTU: /* get interface MTU */
317 ifr->ifr_mtu = _mtu;
318 break;
319
320#if 0
321 case SIOCGIFNAME: /* get interface name */
322 break;
323#endif
324
325 case SIOCSIFADDR: /* set interface address */
326 if (ifr->ifr_addr.sa_family == AF_INET)
327 {
328 sin = (struct sockaddr_in*) &ifr->ifr_addr;
329 my_ip_addr = ntohl (sin->sin_addr.s_addr);
330 break;
331 }
332#if defined(USE_IPV6)
333 if (ifr->ifr_addr.sa_family == AF_INET6)
334 {
335 sin6 = (struct sockaddr_in6*) &ifr->ifr_addr;
336 memcpy ((void*)&in6addr_my_ip, &sin6->sin6_addr, sizeof(in6addr_my_ip));
337 break;
338 }
339#endif
340 eth = (const eth_address*) ifr->ifr_addr.sa_data; /* ?? */
341 if (!_eth_set_addr(eth))
342 {
343 SOCK_ERRNO (EINVAL);
344 return (-1);
345 }
346 break;
347
348 case OSIOCGIFDSTADDR:
349 case SIOCGIFDSTADDR:
351 break;
352
353 case SIOCSIFDSTADDR:
355 break;
356
357 case SIOCSIFFLAGS: /* set iface flags */
358 /* Allow other socket types to do this?
359 */
360 if (socket->so_type == SOCK_PACKET)
361 {
362 BOOL rc;
363
364 if (ifr->ifr_flags & IFF_PROMISC)
365 rc = _sock_set_promisc_rx_mode();
366 else if (ifr->ifr_flags & IFF_ALLMULTI)
367 rc = _sock_set_mcast_rx_mode();
368 else rc = _sock_set_normal_rx_mode (socket);
369 if (!rc)
370 {
371 SOCK_ERRNO (ENETDOWN);
372 return (-1);
373 }
374 }
375 break;
376
377 case SIOCGIFFLAGS: /* get iface flags */
378 ifr->ifr_flags = 0;
379 if (_eth_is_init)
380 {
381 ifr->ifr_flags |= (IFF_UP | IFF_RUNNING);
382
383 if (_pkt_rxmode == RXMODE_PROMISCOUS)
384 ifr->ifr_flags |= IFF_PROMISC;
385
386 if (_pkt_rxmode >= RXMODE_MULTICAST2)
387 ifr->ifr_flags |= IFF_ALLMULTI;
388
389 if (_pktdevclass == PDCLASS_PPP ||
390 _pktdevclass == PDCLASS_SLIP ||
391 _pktdevclass == PDCLASS_AX25)
392 ifr->ifr_flags |= IFF_POINTOPOINT;
393 else ifr->ifr_flags |= IFF_BROADCAST; /* ARCNET broadcast? */
394
395#if defined(USE_MULTICAST)
396 if (_multicast_on)
397 ifr->ifr_flags |= IFF_MULTICAST;
398#endif
399 }
400 break;
401
402 case SIOCGIFBRDADDR: /* get IP broadcast address */
403 case OSIOCGIFBRDADDR:
404 sin = (struct sockaddr_in*) &ifr->ifr_broadaddr;
405 sin->sin_addr.s_addr = htonl (my_ip_addr | ~sin_mask);
406 sin->sin_family = AF_INET;
407 __get_ifname (ifr->ifr_name);
408 break;
409
410 case SIOCSIFBRDADDR: /* set IP broadcast address */
411 break;
412
413 case SIOCGIFMETRIC: /* get interface metric */
414 ifr->ifr_metric = 1;
415 __get_ifname (ifr->ifr_name);
416 break;
417
418 case SIOCSIFMETRIC:
420 break;
421
422 case SIOCDIFADDR: /* delete interface addr */
423#if defined(USE_IPV6)
424 if (ifr->ifr_addr.sa_family == AF_INET6)
425 {
426 memset ((void*)&in6addr_my_ip, 0, sizeof(in6addr_my_ip));
427 break;
428 }
429#endif
430 if (ifr->ifr_addr.sa_family == AF_INET)
431 {
432 my_ip_addr = 0;
433 break;
434 }
435
437 break;
438
439 case SIOCAIFADDR:
441 break;
442
443 case SIOCGIFNETMASK: /* get interface net-mask */
444 case OSIOCGIFNETMASK:
445 sin = (struct sockaddr_in*) &ifr->ifr_addr;
446 sin->sin_addr.s_addr = htonl (sin_mask);
447 sin->sin_family = AF_INET;
448 __get_ifname (ifr->ifr_name);
449 break;
450
451 case SIOCSIFNETMASK: /* set interface net-mask */
452 sin = (struct sockaddr_in*) &ifr->ifr_addr;
453 sin_mask = ntohl (sin->sin_addr.s_addr);
454 break;
455
456 case SIOCGIFCONF: /* get interfaces config */
457 case OSIOCGIFCONF:
458 len = ifc->ifc_len = min (ifc->ifc_len, NUM_IFACES*SIZEOF(*ifr));
459 ifc = (struct ifconf*) ifc->ifc_buf; /* user's buffer */
460 VERIFY_RW (ifc, len);
461
462 i = 0;
463 for (ifr = (struct ifreq*)ifc; i < len; ifr++, i += sizeof(*ifr))
464 {
465 __get_ifname (ifr->ifr_name);
466 sin = (struct sockaddr_in*) &ifr->ifr_addr;
467 sin->sin_addr.s_addr = htonl (my_ip_addr);
468 sin->sin_family = AF_INET;
469 }
470 break;
471
472 case SIOCGIFHWADDR:
473 switch (_pktdevclass)
474 {
475 case PDCLASS_ETHER:
476 ifr->ifr_hwaddr.sa_family = ARPHRD_ETHER;
477 FILL_hwaddr_sa_data (ifr->ifr_hwaddr.sa_data, _eth_addr);
478 break;
479 case PDCLASS_TOKEN:
480 ifr->ifr_hwaddr.sa_family = ARPHRD_TOKEN;
481 FILL_hwaddr_sa_data (ifr->ifr_hwaddr.sa_data, _eth_addr);
482 break;
483 case PDCLASS_FDDI:
484 ifr->ifr_hwaddr.sa_family = ARPHRD_FDDI;
485 FILL_hwaddr_sa_data (ifr->ifr_hwaddr.sa_data, _eth_addr);
486 break;
487 case PDCLASS_ARCNET:
488 ifr->ifr_hwaddr.sa_family = ARPHRD_ARCNET;
489 ifr->ifr_hwaddr.sa_data[0] = _eth_addr[0];
490 break;
491 case PDCLASS_SLIP:
492 case PDCLASS_PPP:
493 ifr->ifr_hwaddr.sa_family = 0;
494 memset (ifr->ifr_hwaddr.sa_data, '\0',
495 sizeof(ifr->ifr_hwaddr.sa_data));
496 break;
497 default:
498 return (-1);
499 }
500 break;
501
502 default:
503 NO_CMD (cmd);
504 SOCK_ERRNO (ESOCKTNOSUPPORT);
505 return (-1);
506 }
507 ARGSUSED (len);
508 return (0);
509}
510
511
512/*
513 * Handler for buffer hi/lo watermark and urgent data (OOB)
514 */
515static int waterm_ioctrl (Socket *socket, long cmd, void *argp)
516{
517 switch ((DWORD)cmd)
518 {
519 case SIOCSHIWAT:
521 break;
522
523 case SIOCGHIWAT:
525 break;
526
527 case SIOCSLOWAT:
529 break;
530
531 case SIOCGLOWAT:
533 break;
534
535 case SIOCATMARK:
537 break;
538
539 default:
540 NO_CMD (cmd);
541 SOCK_ERRNO (ESOCKTNOSUPPORT);
542 return (-1);
543 }
544 ARGSUSED (socket);
545 ARGSUSED (argp);
546 return (0);
547}
548
549
550/*
551 * Handler for ARP-cache interface commands
552 */
553static int arp_ioctrl (Socket *socket, long cmd, void *argp)
554{
555 struct arpreq *arp = (struct arpreq*) argp;
556 eth_address *eth;
557 DWORD ip;
558
559 switch ((DWORD)cmd)
560 {
561 case SIOCSARP: /* add given IP/MAC-addr pair to ARP cache */
562 ip = intel (*(DWORD*)arp->arp_pa.sa_data);
563 eth = (eth_address*) arp->arp_ha.sa_data;
564 if (!_arp_cache_add (ip, (const eth_address*)eth, FALSE))
565 {
566 SOCK_ERRNO (EINVAL);
567 return (-1);
568 }
569 break;
570
571 case SIOCGARP: /* return ARP entry for given ip */
572 case OSIOCGARP:
573 ip = intel (*(DWORD*)arp->arp_pa.sa_data);
574 eth = (eth_address*) arp->arp_ha.sa_data;
575 if (_arp_lookup_fixed (ip, eth))
576 {
577 arp->arp_flags |= (ATF_INUSE | ATF_COM | ATF_PERM); /* fixed addr */
578 }
579 else if (_arp_lookup (ip, eth))
580 {
581 arp->arp_flags |= (ATF_INUSE | ATF_COM); /* dynamic addr */
582 }
583 else
584 {
585 arp->arp_flags = 0;
586 SOCK_ERRNO (ENOENT);
587 return (-1);
588 }
589 break;
590
591 case SIOCDARP: /* delete ARP-entry for given ip */
592 ip = intel (*(DWORD*)arp->arp_pa.sa_data);
593 if (!_arp_cache_del(ip))
594 {
595 SOCK_ERRNO (ENOENT);
596 return (-1);
597 }
598 break;
599
600 default:
601 NO_CMD (cmd);
602 SOCK_ERRNO (ESOCKTNOSUPPORT);
603 return (-1);
604 }
605 ARGSUSED (socket);
606 return (0);
607}
608
609/*
610 * Return string for ioctlsocket() command
611 */
612#if defined(USE_DEBUG)
613static const struct search_list commands[] = {
614 { FIOCLEX, "FIOCLEX" },
615 { FIONCLEX, "FIONCLEX" },
616 { FIONREAD, "FIONREAD" },
617 { FIONBIO, "FIONBIO" },
618 { FIOASYNC, "FIOASYNC" },
619 { FIOSETOWN, "FIOSETOWN" },
620 { FIOGETOWN, "FIOGETOWN" },
621 { SIOCSPGRP, "SIOCSPGRP" },
622 { SIOCGPGRP, "SIOCGPGRP" },
623 { SIOCADDRT, "SIOCADDRT" },
624 { SIOCDELRT, "SIOCDELRT" },
625 { SIOCSIFADDR, "SIOCSIFADDR" },
626 { OSIOCGIFADDR, "OSIOCGIFADDR" },
627 { SIOCGIFADDR, "SIOCGIFADDR" },
628 { SIOCSIFDSTADDR, "SIOCSIFDSTADDR" },
629 { OSIOCGIFDSTADDR, "OSIOCGIFDSTADDR" },
630 { SIOCGIFDSTADDR, "SIOCGIFDSTADDR" },
631 { SIOCSIFFLAGS, "SIOCSIFFLAGS" },
632 { SIOCGIFFLAGS, "SIOCGIFFLAGS" },
633 { OSIOCGIFBRDADDR, "OSIOCGIFBRDADDR" },
634 { SIOCGIFBRDADDR, "SIOCGIFBRDADDR" },
635 { SIOCSIFBRDADDR, "SIOCSIFBRDADDR" },
636 { OSIOCGIFCONF, "OSIOCGIFCONF" },
637 { SIOCGIFCONF, "SIOCGIFCONF" },
638 { OSIOCGIFNETMASK, "OSIOCGIFNETMASK" },
639 { SIOCGIFNETMASK, "SIOCGIFNETMASK" },
640 { SIOCSIFNETMASK, "SIOCSIFNETMASK" },
641 { SIOCGIFMETRIC, "SIOCGIFMETRIC" },
642 { SIOCSIFMETRIC, "SIOCSIFMETRIC" },
643 { SIOCDIFADDR, "SIOCDIFADDR" },
644 { SIOCAIFADDR, "SIOCAIFADDR" },
645 { SIOCGIFMTU, "SIOCGIFMTU" },
646 { SIOCSARP, "SIOCSARP" },
647 { OSIOCGARP, "OSIOCGARP" },
648 { SIOCGARP, "SIOCGARP" },
649 { SIOCDARP, "SIOCDARP" },
650 { SIOCSHIWAT, "SIOCSHIWAT" },
651 { SIOCGHIWAT, "SIOCGHIWAT" },
652 { SIOCSLOWAT, "SIOCSLOWAT" },
653 { SIOCGLOWAT, "SIOCGLOWAT" },
654 { SIOCATMARK, "SIOCATMARK" },
655 { SIOCGIFHWADDR, "SIOCGIFHWADDR" }
656 };
657
658static const char *get_ioctl_cmd (long cmd)
659{
660 static char buf[50];
661
662 switch (IOCGROUP(cmd))
663 {
664 case 'f':
665 strcpy (buf, "file cmd: ");
666 break;
667
668 case 'I':
669 strcpy (buf, "iface cmd: ");
670 break;
671
672 case 's':
673 strcpy (buf, "waterm cmd: ");
674 break;
675
676 default:
677 return ("??unknown");
678 }
679 strcat (buf, list_lookup(cmd, commands, DIM(commands)));
680 return (buf);
681}
682#endif /* USE_DEBUG */
683#endif /* USE_BSD_API */
684
685/*
686 * A small test program for above functions.
687 */
688#if defined(TEST_PROG)
689#if !defined(USE_BSD_API)
690int main (void)
691{
692 puts ("This program needs '#define USE_BSD_API'");
693 return (1);
694}
695#else /* rest of file */
696
697#undef assert
698#define assert(x) ((x) ? (void)0 : __assert_fail(__LINE__))
699
700void __assert_fail (unsigned line)
701{
702 fprintf (stderr, "\nAssert failed at line %d, errno = %d (%s)\n",
703 line, errno, strerror(errno));
704 exit (-1);
705}
706
707const char *eth_addr_string (struct ether_addr *eth)
708{
709 static char buf[20];
710
711 sprintf (buf, "%02X:%02X:%02X:%02X:%02X:%02X",
712 eth->ether_addr_octet[0],
713 eth->ether_addr_octet[1],
714 eth->ether_addr_octet[2],
715 eth->ether_addr_octet[3],
716 eth->ether_addr_octet[4],
717 eth->ether_addr_octet[5]);
718 return (buf);
719}
720
721const char *if_flags_string (unsigned short flags)
722{
723 static char buf[200];
724
725 buf[0] = '\0';
726
727 if (flags & IFF_UP)
728 strcat (buf,"up,");
729 if (flags & IFF_BROADCAST)
730 strcat (buf,"broadcast,");
731 if (flags & IFF_DEBUG)
732 strcat (buf,"debug,");
733 if (flags & IFF_LOOPBACK)
734 strcat (buf,"loopback,");
735 if (flags & IFF_POINTOPOINT)
736 strcat (buf,"p-to-p,");
737 if (flags & IFF_NOTRAILERS)
738 strcat (buf,"no-trail,");
739 if (flags & IFF_RUNNING)
740 strcat (buf,"running,");
741 if (flags & IFF_NOARP)
742 strcat (buf,"no-arp,");
743 if (flags & IFF_PROMISC)
744 strcat (buf,"promisc,");
745 if (flags & IFF_ALLMULTI)
746 strcat (buf,"all-multi,");
747 if (flags & IFF_OACTIVE)
748 strcat (buf,"out-act,");
749 if (flags & IFF_SIMPLEX)
750 strcat (buf,"simplex,");
751 if (flags & IFF_LINK0)
752 strcat (buf,"link0,");
753 if (flags & IFF_LINK1)
754 strcat (buf,"link1,");
755 if (flags & IFF_LINK2)
756 strcat (buf,"link2,");
757 if (flags & IFF_MULTICAST)
758 strcat (buf,"mcast,");
759
760 if (buf[0])
761 buf[strlen(buf)-1] = '\0';
762 return (buf);
763}
764
765int main (void)
766{
767 struct ifreq ifr;
768 struct sockaddr_in *sin;
769 int sock, on = 1;
770
771 dbug_init();
772
773 sock = socket (AF_INET, SOCK_DGRAM, 0);
774 assert (sock > 0);
775 assert (setsockopt(sock, SOL_SOCKET, SO_DEBUG, &on,sizeof(on)) == 0);
776
777 ifr.ifr_addr.sa_family = AF_UNSPEC; /* get MAC-address */
778
779 assert (ioctlsocket (sock, SIOCGIFADDR, (char*)&ifr) == 0);
780 printf ("Interface `%s':\n\t ether-addr: %s\n",
781 ifr.ifr_name,
782 eth_addr_string ((struct ether_addr*)&ifr.ifr_hwaddr.sa_data));
783
784 assert (ioctlsocket (sock, SIOCGIFBRDADDR, (char*)&ifr) == 0);
785 sin = (struct sockaddr_in*) &ifr.ifr_broadaddr;
786 printf ("\t bcast-addr: %s\n", inet_ntoa (sin->sin_addr));
787
788 ifr.ifr_addr.sa_family = AF_INET;
789
790 assert (ioctlsocket (sock, SIOCGIFADDR, (char*)&ifr) == 0);
791 sin = (struct sockaddr_in*) &ifr.ifr_addr;
792 printf ("\t inet-addr: %s\n", inet_ntoa (sin->sin_addr));
793
794 assert (ioctlsocket (sock, SIOCGIFNETMASK, (char*)&ifr) == 0);
795 sin = (struct sockaddr_in*) &ifr.ifr_addr;
796 printf ("\t net-mask : %s\n", inet_ntoa (sin->sin_addr));
797
798 assert (ioctlsocket (sock, SIOCGIFMTU, (char*)&ifr) == 0);
799 printf ("\t MTU : %u\n",ifr.ifr_mtu);
800
801 assert (ioctlsocket (sock, SIOCGIFFLAGS, (char*)&ifr) == 0);
802 printf ("\t Flags : 0x%04X: %s\n",
803 ifr.ifr_flags, if_flags_string(ifr.ifr_flags));
804
805 assert (close_s(sock) >= 0);
806 return (0);
807}
808#endif /* USE_BSD_API */
809#endif /* TEST_PROG */
iface_ioctrl
static int iface_ioctrl(Socket *socket, long cmd, void *argp)
Definition: ioctl.c:270
tok_ifnet
static struct ifnet * tok_ifnet(void)
Definition: ioctl.c:242
eth_ifnet
static struct ifnet * eth_ifnet(void)
Definition: ioctl.c:234
waterm_ioctrl
static int waterm_ioctrl(Socket *socket, long cmd, void *argp)
Definition: ioctl.c:515
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
strerror
char *MS_CDECL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207
_arp_cache_add
BOOL W32_CALL _arp_cache_add(DWORD ip, const void *eth, BOOL expires)
Add given IP/Ether address to ARP-cache.
Definition: pcarp.c:1351
_arp_lookup_fixed
BOOL W32_CALL _arp_lookup_fixed(DWORD ip, eth_address *eth)
Lookup fixed MAC-address of 'ip'.
Definition: pcarp.c:1218
_arp_lookup
BOOL W32_CALL _arp_lookup(DWORD ip, eth_address *eth)
Lookup MAC-address of 'ip'.
Definition: pcarp.c:1185
_arp_cache_del
BOOL W32_CALL _arp_cache_del(DWORD ip)
Delete given 'ip' address from ARP-cache (dynamic, fixed or pending).
Definition: pcarp.c:1420
_pkt_rxmode
int _pkt_rxmode
active receive mode
Definition: pcpkt.c:53
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
RXMODE_PROMISCOUS
@ RXMODE_PROMISCOUS
receive all packets on network
Definition: pcpkt.h:114
RXMODE_MULTICAST2
@ RXMODE_MULTICAST2
BROADCAST + all multicast
Definition: pcpkt.h:113
_eth_is_init
BOOL _eth_is_init
we are initialised
Definition: pcsed.c:54
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
_eth_set_addr
int W32_CALL _eth_set_addr(const void *addr)
Sets a new MAC address for our interface.
Definition: pcsed.c:712
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
Socket
Definition: socket.h:158
arp
arpreq
Definition: if_arp.h:103
ifconf
Definition: if.h:346
ifnet
Definition: if.h:136
ifreq
Definition: if.h:299
search_list
Definition: misc.h:131
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
socket
Definition: if.h:82
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/inc/sys/ioctl.h Source File

  • inc
  • sys
ioctl.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#if !defined(__SYS_IOCTL_H) && !defined(__SYS_SO_IOCTL_H)
39#define __SYS_IOCTL_H
40
41/*
42 * Commands for ioctlsocket(), taken from the BSD file fcntl.h.
43 *
44 * Ioctl's have the command encoded in the lower word,
45 * and the size of any in or out parameters in the upper
46 * word. The high 2 bits of the upper word are used
47 * to encode the in/out status of the parameter; for now
48 * we restrict parameters to at most 128 bytes.
49 */
50
51#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */
52
53#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)
54#define IOCBASECMD(x) ((x) & ~IOCPARM_MASK)
55#define IOCGROUP(x) (((x) >> 8) & 0xff)
56
57#define IOCPARM_MAX 4096 /* max size of ioctl */
58#define IOC_VOID 0x20000000 /* no parameters */
59#define IOC_OUT 0x40000000 /* copy out parameters */
60#define IOC_IN 0x80000000 /* copy in parameters */
61#define IOC_INOUT (IOC_IN|IOC_OUT) /* 0x20000000 distinguishes new &
62 old ioctl's */
63#define IOC_DIRMASK 0xe0000000 /* mask for IN/OUT/VOID */
64
65#define _IO(x,y) (IOC_VOID|(x<<8)|y)
66#define _IOR(x,y,t) (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
67#define _IOW(x,y,t) (IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
68/* this should be _IORW, but stdio got there first */
69#define _IOWR(x,y,t) (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
70
71/*
72 * file i/o controls
73 */
74#define FIOCLEX _IO('f', 1) /* set close on exec on fd */
75#define FIONCLEX _IO('f', 2) /* remove close on exec */
76#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */
77#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */
78#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */
79#define FIOSETOWN _IOW('f', 124, int) /* set owner (struct Task *) */
80#define FIOGETOWN _IOR('f', 123, int) /* get owner (struct Task *) */
81
82/*
83 * socket i/o controls
84 *
85 * SIOCSPGRP and SIOCGPGRP are identical to the FIOSETOWN and FIOGETOWN,
86 * respectively.
87 */
88#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
89#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
90
91/* #ifdef BSD */
92#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */
93#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */
94
95#define SIOCSIFADDR _IOW('I', 12, struct ifreq) /* set ifnet address */
96#define OSIOCGIFADDR _IOWR('I',13, struct ifreq) /* get ifnet address */
97#define SIOCGIFADDR _IOWR('I',33, struct ifreq) /* get ifnet address */
98#define SIOCSIFDSTADDR _IOW('I', 14, struct ifreq) /* set p-p address */
99#define OSIOCGIFDSTADDR _IOWR('I',15, struct ifreq) /* get p-p address */
100#define SIOCGIFDSTADDR _IOWR('I',34, struct ifreq) /* get p-p address */
101#define SIOCSIFFLAGS _IOW('I', 16, struct ifreq) /* set ifnet flags */
102#define SIOCGIFFLAGS _IOWR('I',17, struct ifreq) /* get ifnet flags */
103#define OSIOCGIFBRDADDR _IOWR('I',18, struct ifreq) /* get broadcast addr */
104#define SIOCGIFBRDADDR _IOWR('I',35, struct ifreq) /* get broadcast addr */
105#define SIOCSIFBRDADDR _IOW('I',19, struct ifreq) /* set broadcast addr */
106#define OSIOCGIFCONF _IOWR('I',20, struct ifconf) /* get ifnet list */
107#define SIOCGIFCONF _IOWR('I',36, struct ifconf) /* get ifnet list */
108#define OSIOCGIFNETMASK _IOWR('I',21, struct ifreq) /* get net addr mask */
109#define SIOCGIFNETMASK _IOWR('I',37, struct ifreq) /* get net addr mask */
110#define SIOCSIFNETMASK _IOW('I',22, struct ifreq) /* set net addr mask */
111#define SIOCGIFMETRIC _IOWR('I',23, struct ifreq) /* get IF metric */
112#define SIOCSIFMETRIC _IOW('I',24, struct ifreq) /* set IF metric */
113#define SIOCDIFADDR _IOW('I',25, struct ifreq) /* delete IF addr */
114#define SIOCAIFADDR _IOW('I',26, struct ifaliasreq)/* add/chg IF alias */
115#define SIOCGIFMTU _IOWR('I',27, struct ifreq) /* get IF mtu */
116#define SIOCGIFHWADDR _IOWR('I',28, struct ifconf) /* get hardware addr */
117#define OSIOCGIFHWADDR SIOCGIFHWADDR
118
119#define SIOCSARP _IOW('I', 30, struct arpreq) /* set arp entry */
120#define OSIOCGARP _IOWR('I',31, struct arpreq) /* get arp entry */
121#define SIOCGARP _IOWR('I',38, struct arpreq) /* get arp entry */
122#define SIOCDARP _IOW('I', 32, struct arpreq) /* delete arp entry */
123/* #endif */ /* BSD */
124
125/* MS-DOS */
126#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */
127#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */
128#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */
129#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */
130#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */
131
132#endif /* !__SYS_IOCTL_H */
133
134/* Since this file shadows the normal djgpp <sys/ioctl.h>, we include
135 * that last.
136 */
137#if defined(__DJGPP__)
138 #include_next <sys/ioctl.h> /* ioctl() */
139#endif


Watt-32 tcp/ip: E:/WATT/src/ioport.h Source File

  • src
ioport.h
Go to the documentation of this file.
1
3#ifndef _w32_IOPORT_H
4#define _w32_IOPORT_H
5
6/*
7 * Make sure <conio.h> (or <pc.h> for djgpp) gets included
8 */
9#if !defined(_w32_TARGET_H)
10#error You must include IOPORT.H after TARGET.H
11#endif
12
13/*
14 * Macros necessary to bypass the limitation of Borland's BCC32 not
15 * to allow inline port functions. Assignements should be volatile,
16 * check the .asm output.
17 * NB! macro-args must be TASM/MASM compatible
18 */
19
20#if defined(__BORLANDC__) && defined(__FLAT__) && \
21 !(defined(W32_IS_EMBARCADERO) || defined(W32_IS_CODEGEARC))
22
23 #define VOLATILE volatile
24 #define __in(p,t,z) ( _DX = (unsigned short)(p),__emit__(0xEC+z),(unsigned t)_AX )
25 #define __out(p,x,z) { _AX = (unsigned short)(x); _DX = (unsigned short)(p);__emit__(0xEE+z); }
26 #define _inportb(p) __in(p,char,0)
27 #define _inportw(p) __in(p,short,1)
28 #define _outportb(p,x) __out(p,x,0)
29 #define _outportw(p,x) __out(p,x,1)
30
31#elif defined(__HIGHC__)
32 #define _inportb(p) _inb(p)
33 #define _inportw(p) _inw(p)
34 #define _outportb(p,x) _outb(p,x)
35 #define _outportw(p,x) _outpw(p,x)
36 #define VOLATILE
37
38#elif defined(__DJGPP__) || defined(__EMX__)
39 #define _inportb(p) inportb(p)
40 #define _inport(p) inportw(p)
41 #define _outportb(p,x) outportb(p,x)
42 #define _outportw(p,x) outportw(p,x)
43 #define VOLATILE
44
45#elif defined(_MSC_VER) && defined(__clang__)
46
47 /* Windows implied. Should be no need for this.
48 */
49
50#elif defined(_MSC_VER) && (_MSC_VER >= 800)
51 #include <conio.h>
52 #pragma intrinsic (_inp, _inpw, _outp, _outpw)
53 #define _inportb(p) _inp(p)
54 #define _inportw(p) _inpw(p)
55 #define _outportb(p,x) _outp(p,x)
56 #define _outportw(p,x) _outpw(p,x)
57 #define VOLATILE
58
59#else
60 #define _inportb(p) inp(p)
61 #define _inportw(p) inpw(p)
62 #define _outportb(p,x) outp(p,x)
63 #define _outportw(p,x) outpw(p,x)
64 #define VOLATILE
65#endif
66
67#if defined(__EMX__)
68
69/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
70
71W32_GCC_INLINE unsigned char inportb (unsigned short port)
72{
73 unsigned char rc;
74 __asm__ __volatile__ (
75 "inb %1, %0"
76 : "=a" (rc)
77 : "dN" (port));
78 return (rc);
79}
80
81W32_GCC_INLINE unsigned short inportw (unsigned short port)
82{
83 unsigned short rc;
84 __asm__ __volatile__ (
85 "inw %1, %0"
86 : "=a" (rc)
87 : "dN" (port));
88 return (rc);
89}
90
91W32_GCC_INLINE void outportb (unsigned short port, unsigned char data)
92{
93 __asm__ __volatile__ (
94 "outb %1, %0"
95 :: "dN" (port),
96 "a" (data));
97}
98
99W32_GCC_INLINE void outportw (unsigned short port, unsigned short data)
100{
101 __asm__ __volatile__ (
102 "outw %1, %0"
103 :: "dN" (port),
104 "a" (data));
105}
106#endif /* __EMX__ */
107#endif /* _w32_IOPORT_H */
108


Watt-32 tcp/ip: E:/WATT/src/ip4_frag.c Source File

  • src
ip4_frag.c
Go to the documentation of this file.
1
5/*
6 * Packet de-fragmentation code for WATTCP
7 * Written by and COPYRIGHT (c)1993 to Quentin Smart
8 * smart@actrix.gen.nz
9 * all rights reserved.
10 *
11 * This software is distributed in the hope that it will be useful,
12 * but without any warranty; without even the implied warranty of
13 * merchantability or fitness for a particular purpose.
14 *
15 * You may freely distribute this source code, but if distributed for
16 * financial gain then only executables derived from the source may be
17 * sold.
18 *
19 * Murf = Murf@perftech.com
20 * other fragfix = mdurkin@tsoft.net
21 *
22 * Based on RFC815
23 *
24 * Code used to use pktbuf[] as reassembly buffer. It now allocates
25 * a "bucket" dynamically at startup. There are 'MAX_IP_FRAGS' buckets
26 * to handle at the same time.
27 *
28 * G.Vanem 1998 <gvanem@yahoo.no>
29 */
30
31#include <stdio.h>
32#include <stdlib.h>
33#include <limits.h>
34#include <arpa/inet.h>
35
36#include "wattcp.h"
37#include "language.h"
38#include "misc.h"
39#include "misc_str.h"
40#include "timer.h"
41#include "chksum.h"
42#include "pcconfig.h"
43#include "pcqueue.h"
44#include "pcstat.h"
45#include "pcpkt.h"
46#include "pcicmp.h"
47#include "pctcp.h"
48#include "pcdbug.h"
49#include "netaddr.h"
50#include "run.h"
51#include "ip4_in.h"
52#include "ip4_out.h"
53#include "ip4_frag.h"
54
55#define MAX_IP_FRAGS 2 /* max # of fragmented IP-packets */
56#define MAX_IP_HOLDTIME 15 /* time (in sec) to hold before discarding */
57
58int _ip4_frag_reasm = MAX_IP_HOLDTIME; /* configurable; pcconfig.c */
59
60#if defined(USE_FRAGMENTS)
61
62#if defined(__HIGHC__)
63 static void TRACE_MSG (int color, const char *fmt, ...)
64 {
65 ARGSUSED (color);
66 ARGSUSED (fmt);
67 }
68
69#elif defined(TEST_PROG)
70 #define TRACE_MSG(color, args, ...) \
71 do { \
72 SET_ATTR (color); \
73 printf ("%s(%u): " args, \
74 __FILE__, __LINE__, ## __VA_ARGS__); \
75 NORM_TEXT(); \
76 } while (0)
77
78#else
79 #define TRACE_MSG(color, args, ...) TRACE_FILE(args, ## __VA_ARGS__)
80#endif
81
82#if 0
83 #undef MAX_FRAGMENTS
84 #define MAX_FRAGMENTS 20U /* !! test */
85 #define MAX_FRAG_SIZE (MAX_FRAGMENTS * MAX_IP4_DATA) /* 29600 */
86#endif
87
88#define BUCKET_MARKER 0xDEAFABBA
89
90/*
91 * Number of 'fd_set' required to hold MAX_SOCKETS.
92 */
93#define NUM_FD_SETS ((MAX_FRAG_SIZE+sizeof(fd_set)-1) / sizeof(fd_set))
94
95typedef fd_set used_map [NUM_FD_SETS];
96
97struct huge_ip {
98 in_Header hdr;
99 BYTE data [MAX_FRAG_SIZE]; /* 66600 for DOSX */
100 DWORD marker;
101 };
102
103struct frag_key {
104 DWORD source;
105 DWORD destin;
106 WORD ident;
107 BYTE proto;
108 };
109
110struct frag_bucket {
111 BOOL used; /* this bucket is taken */
112 BOOL got_ofs0; /* we've received ofs-0 fragment */
113 int active; /* # of active fragments */
114 used_map map; /* map of bits received */
115 mac_address mac_src; /* remember for icmp_send_timexceed() */
116 struct frag_key key; /* key for matching new fragments */
117 struct huge_ip *ip; /* calloc'ed on startup */
118 };
119
120struct hole { /* structure for missing chunks */
121 struct hole *next;
122 long start;
123 long end;
124 };
125
126struct frag_ctrl {
127 BOOL used; /* this position in table is in use */
128 DWORD timer; /* expiry for this fragment */
129 struct hole *hole_first;
130 in_Header *ip;
131 BYTE *data_offset;
132 };
133
134static struct frag_ctrl frag_control [MAX_IP_FRAGS][MAX_FRAGMENTS];
135static struct frag_bucket frag_buckets [MAX_IP_FRAGS];
136
137static long data_start; /* NB! global data; not reentrant */
138static long data_end;
139static long data_length;
140
141enum frag_bits {
142 IS_NONE = 0x00,
143 IS_FRAG = 0x01,
144 IS_LAST = 0x02,
145 IS_FIRST = 0x04
146 };
147
148/*
149 frag_bucket[]: Holds the fragments with offsets (0-MAX_FRAG_SIZE)
150 ------------------------------------------------------
151 0: | struct huge_ip |
152 ------------------------------------------------------
153 . .
154 . .
155 ------------------------------------------------------
156 MAX_IP_FRAGS-1: | |
157 ------------------------------------------------------
158 ^ ^
159 | |
160 0 MAX_FRAG_SIZE
161
162 */
163
164static enum frag_bits fbits; /* IPv4 fragment bits */
165
166#if defined(TEST_PROG)
167static void dump_frag_holes (const char *where, const struct frag_ctrl *fc, const struct hole *hole)
168{
169 const struct hole *h;
170
171 if (!fc)
172 {
173 TRACE_MSG (FOREGOUND_YELLOW, "%s, No frag!\n", where);
174 return;
175 }
176
177 TRACE_MSG (FOREGOUND_WHITE, "%s: fc->used: %d, fc->data_offset: %" ADDR_FMT "\n",
178 where, fc->used, ADDR_CAST(fc->data_offset));
179
180 for (h = hole; h; h = h->next)
181 {
182 TRACE_MSG (FOREGOUND_WHITE, "hole: %" ADDR_FMT ", h->start: %ld, h->end: %ld\n",
183 ADDR_CAST(h), h->start, h->end);
184 }
185}
186#endif
187
188#if defined(USE_DEBUG)
189static const char *decode_fbits (int fb)
190{
191 static char buf[50];
192 char *end;
193
194 buf[0] = '\0';
195 if (fb & IS_FRAG)
196 strcat (buf, "IS_FRAG+");
197
198 if (fb & IS_LAST)
199 strcat (buf, "IS_LAST+");
200
201 if (fb & IS_FIRST)
202 strcat (buf, "IS_FIRST+");
203
204 end = strrchr (buf, '+');
205 if (end)
206 *end = '\0';
207 return (buf);
208}
209#endif
210
211
212/*
213 * Check if this packet is part of a fragment-chain. It might be
214 * a last fragment (MF=0) with ofs 0. This would be normal for
215 * fragments sent from Linux. Look in 'frag_buckets' for a match.
216 *
217 * If the 'fk' was not found, set '*free_bucket' to next free bucket
218 * and return FALSE.
219 *
220 * If found, set '*bucket' to matching bucket and '*slot' to free
221 * slot in '*bucket' and return TRUE.
222 */
223static BOOL match_frag (const in_Header *ip, int *slot, int *bucket, int *free_bucket)
224{
225 struct frag_key fk;
226 int i, b;
227
228 *bucket = -1;
229 *slot = -1;
230 *free_bucket = -1;
231
232 fk.source = ip->source;
233 fk.destin = ip->destination;
234 fk.ident = ip->identification;
235 fk.proto = ip->proto;
236
237 for (b = 0; b < DIM(frag_buckets); b++)
238 {
239 const struct frag_bucket *fb = frag_buckets + b;
240 const struct frag_ctrl *fc = &frag_control[b][0];
241
242 if (!fb->used)
243 {
244 if (*free_bucket == -1) /* get 1st vacant bucket */
245 *free_bucket = b;
246 continue;
247 }
248
249 if (memcmp(&fk,&fb->key,sizeof(fk)))
250 continue;
251
252 for (i = 0; i < (int)MAX_FRAGMENTS; i++, fc++)
253 {
254 if (!fc->used)
255 {
256 *bucket = b;
257 return (TRUE);
258 }
259 *slot = i; /* This frag-control is used. Return it's index */
260 }
261 }
262 return (FALSE);
263}
264
265/*
266 * Check and report if fragment data 'ofs' and 'end' are okay
267 */
268static __inline BOOL check_frag_ofs (const in_Header *ip, DWORD ofs, DWORD end)
269{
270 if (ofs + end <= MAX_FRAG_SIZE && /* fragment offset okay, < 65528 */
271 ofs + end <= USHRT_MAX-8) /* must not wrap around 64kB */
272 return (TRUE);
273
274 TRACE_CONSOLE (2, "Bad frag-ofs: %lu, frag-end: %lu, ip-prot %u (%s -> %s)\n",
275 (u_long)ofs, (u_long)end, ip->proto,
276 _inet_ntoa(NULL,intel(ip->source)),
277 _inet_ntoa(NULL,intel(ip->destination)));
278 ARGSUSED (ip);
279 return (FALSE);
280}
281
282static __inline void set_fbits (DWORD offset, WORD flags)
283{
284 fbits = IS_NONE;
285
286 if (flags & IP_MF)
287 {
288 fbits |= IS_FRAG;
289 if (offset == 0)
290 fbits |= IS_FIRST;
291 }
292 else if (offset)
293 {
294 fbits = (IS_FRAG | IS_LAST);
295 }
296}
297
298/*
299 * Prepare and setup for reassembly
300 */
301static BOOL setup_first_frag (const in_Header *ip, int idx)
302{
303 struct frag_ctrl *fc;
304 struct frag_bucket *fb = frag_buckets + idx; /* do fragment hanlding in this bucket */
305 struct huge_ip *hip = fb->ip;
306 struct hole *hole;
307 unsigned i;
308
309 /* Marker destroyed!
310 */
311 if (hip->marker != BUCKET_MARKER)
312 TRACE_CONSOLE (0, "frag_buckets[%d] destroyed\n!", idx);
313
314 TRACE_MSG (FOREGOUND_WHITE, "frag_bucket[%d] = %" ADDR_FMT "\n", idx, ADDR_CAST(hip));
315
316 /* Remember MAC source address
317 */
318 if (_pktserial)
319 memset (&fb->mac_src, 0, sizeof(mac_address));
320 else memcpy (&fb->mac_src, MAC_SRC(ip), sizeof(mac_address));
321
322 WATT_ASSERT (fb->used == 0);
323
324 fb->used = TRUE;
325 fb->got_ofs0 = FALSE;
326
327 /* Find first empty slot
328 */
329 fc = &frag_control[idx][0];
330 for (i = 0; i < MAX_FRAGMENTS; i++, fc++)
331 if (!fc->used)
332 break;
333
334 if (i == MAX_FRAGMENTS)
335 return (FALSE);
336
337 fc->used = TRUE; /* mark as used */
338 fb->active++; /* inc active frags counter */
339
340 WATT_ASSERT (fb->active == 1);
341 TRACE_MSG (FOREGOUND_WHITE, "bucket=%d, active=%u, i=%u\n", idx, fb->active, i);
342
343 /* Setup frag header data, first packet
344 */
345 fb->key.proto = ip->proto;
346 fb->key.source = ip->source;
347 fb->key.destin = ip->destination;
348 fb->key.ident = ip->identification;
349
350 fc->ip = &fb->ip->hdr;
351 fc->timer = set_timeout (1000 * min(_ip4_frag_reasm, ip->ttl));
352
353 /* Set pointers to beginning of IP packet data
354 */
355 fc->data_offset = (BYTE*)fc->ip + in_GetHdrLen(ip);
356
357 /* Setup initial hole-list.
358 */
359 if (data_start == 0) /* 1st fragment sent is 1st fragment received */
360 {
361 WORD ip_len = intel16 (ip->length);
362 BYTE *dst = (BYTE*) fc->ip;
363
364 ip_len = min (ip_len, _mtu);
365 memcpy (dst, ip, ip_len);
366 hole = (struct hole*) (dst + ip_len + 1);
367 fc->hole_first = hole;
368 fb->got_ofs0 = TRUE;
369 }
370 else
371 {
372 /* !!fix-me: assumes header length of this fragment is same as
373 * in reassembled IP packet (may have IP-options)
374 */
375 BYTE *src = (BYTE*)ip + in_GetHdrLen(ip);
376 BYTE *dst = fc->data_offset + data_start;
377
378 memcpy (dst, src, (size_t)data_length);
379
380 /* Bracket beginning of data
381 */
382 hole = fc->hole_first = (struct hole*)fc->data_offset;
383 hole->start = 0;
384 hole->end = data_start - 1;
385
386 if (!(fbits & IS_LAST))
387 {
388 hole->next = (struct hole*) (fc->data_offset + data_length + 1);
389 hole = hole->next;
390 }
391 else
392 {
393 hole = fc->hole_first->next = NULL;
394 /* Adjust length */
395 fc->ip->length = intel16 ((WORD)(data_end + in_GetHdrLen(ip)));
396 }
397 }
398
399 if (hole)
400 {
401 hole->start = data_length;
402 hole->end = MAX_FRAG_SIZE;
403 hole->next = NULL;
404
405 TRACE_MSG (FOREGOUND_WHITE, "hole %" ADDR_FMT ", hole->start %lu, hole->end %lu\n",
406 ADDR_CAST(hole), hole->start, hole->end);
407 }
408
409#if defined(TEST_PROG)
410 dump_frag_holes ("setup_first_frag", fc, hole);
411#endif
412
413 return (TRUE);
414}
415
416/*
417 * ip4_defragment() is called if '*ip_ptr' is part of a new or existing
418 * fragment chain.
419 *
420 * IP header already checked in _ip4_handler().
421 * Return the reassembled segment (ICMP, UDP or TCP) in '*ip_ptr'.
422 * We assume MAC-header is the same on all fragments.
423 * We return a packet with the MAC-header of the first
424 * fragment received.
425 */
426int ip4_defragment (const in_Header **ip_ptr, DWORD offset, WORD flags)
427{
428 struct frag_ctrl *fc = NULL;
429 struct frag_bucket *fb = NULL;
430 struct hole *hole = NULL;
431 struct hole *prev_hole = NULL;
432 const in_Header *ip = *ip_ptr;
433
434 BOOL found = FALSE;
435 BOOL got_hole = FALSE;
436 int slot, bucket, free_bucket;
437
438 /* Not a fragment (or part of a chain) if offset is 0 and !IP_MF.
439 */
440 if (offset == 0 && !(flags & IP_MF))
441 return (1);
442
443 set_fbits (offset, flags);
444
445 /* Check if part of an existing frag-chain or a new fragment
446 */
447 if (!match_frag(ip,&slot,&bucket,&free_bucket))
448 {
449 if (slot == MAX_FRAGMENTS-1) /* found but no slots free */
450 {
451 STAT (ip4stats.ips_fragments++);
452 goto drop_frag;
453 }
454
455#if 0
456 if (!(fbits & IS_FRAG)) /* A normal non-fragmented IP-packet */
457 return (1);
458#endif
459
460 /* Not in frag-list, but ofs > 0 or MF set. Must be a part of
461 * a (possibly new) fragment chain.
462 */
463 }
464
465 STAT (ip4stats.ips_fragments++);
466
467 /* Calculate where data should go
468 */
469 data_start = (long) offset;
470 data_length = (long) intel16 (ip->length) - in_GetHdrLen (ip);
471 data_end = data_start + data_length;
472
473 TRACE_MSG (FOREGOUND_WHITE, "\nip4_defrag: %s -> %s, id 0x%04X, len %ld, ofs %ld, fbits %s\n",
474 _inet_ntoa(NULL,intel(ip->source)),
475 _inet_ntoa(NULL,intel(ip->destination)),
476 intel16(ip->identification), data_length, data_start,
477 decode_fbits(fbits));
478
479 if ((flags & IP_MF) && data_length == 0 && offset != 0)
480 {
481 TRACE_MSG (FOREGOUND_WHITE, "No data.\n");
482 goto drop_frag;
483 }
484
485 if ((flags & IP_MF) && (data_length & 7) != 0)
486 {
487 TRACE_MSG (FOREGOUND_WHITE, "Frag-data not multiple of 8.\n");
488 goto drop_frag;
489 }
490
491 if (!check_frag_ofs(ip,data_start,data_end))
492 goto drop_frag;
493
494 found = (bucket > -1);
495
496 if (!found)
497 {
498 TRACE_MSG (FOREGOUND_WHITE, "bucket=%d, i=%d, key not found\n", free_bucket, slot);
499 bucket = free_bucket;
500 fb = frag_buckets + bucket;
501
502 /* Can't handle any new frags, drop packet
503 */
504 if (bucket == -1 || fb->active == MAX_FRAGMENTS)
505 goto drop_frag;
506
507 if (!setup_first_frag (ip, bucket)) /* Setup first fragment received */
508 goto drop_frag;
509
510 /* Okay so far. Wait for next IP and continue defragmentation.
511 */
512 DEBUG_RX (NULL, ip);
513 return (0);
514 }
515
516 fc = &frag_control [bucket][slot];
517 fb = frag_buckets + bucket;
518
519 TRACE_MSG (FOREGOUND_WHITE, "bucket=%d, slot=%d key found, fbits: %s, active=%d\n",
520 bucket, slot, decode_fbits(fbits), fb->active);
521
522 if (fbits & IS_LAST) /* Adjust length */
523 fc->ip->length = intel16 ((WORD)(data_end + in_GetHdrLen(ip)));
524
525 if (offset == 0)
526 fb->got_ofs0 = TRUE;
527
528 hole = fc->hole_first; /* Hole handling */
529
530 do
531 {
532#if defined(TEST_PROG)
533 dump_frag_holes ("ip4_defragment(1)", fc, hole);
534#endif
535
536 if (hole && (data_start <= hole->end) && /* We've found the spot */
537 (data_end >= hole->start))
538 {
539 long last_end = hole->end; /* Pick up old hole end for later */
540
541 got_hole = TRUE;
542
543 /* Find where to insert fragment.
544 * Check if there's a hole before the new frag
545 */
546 if (data_start > hole->start)
547 {
548 hole->end = data_start - 1;
549 prev_hole = hole; /* We have a new prev */
550 }
551 else
552 {
553 /* No, delete current hole
554 */
555 if (!prev_hole)
556 fc->hole_first = hole->next;
557 else prev_hole->next = hole->next;
558 }
559
560 /* Is there a hole after the current fragment?
561 * Only if we're not last and more to come
562 */
563 if (data_end < hole->end)
564 {
565 hole = (struct hole*) (data_end + 1 + fc->data_offset);
566 hole->start = data_end + 1;
567 hole->end = last_end;
568
569 /* prev_hole = NULL if first
570 */
571 if (!prev_hole)
572 {
573 hole->next = fc->hole_first;
574 fc->hole_first = hole;
575 }
576 else
577 {
578 hole->next = prev_hole->next;
579 prev_hole->next = hole;
580 }
581 }
582 }
583 prev_hole = hole;
584 hole = hole->next;
585
586#if defined(TEST_PROG)
587 dump_frag_holes ("ip4_defragment(2)", fc, hole);
588#endif
589 }
590 while (hole); /* Until we got to the end or found */
591
592
593 /* Thats all setup so copy in the data
594 */
595 if (got_hole)
596 memcpy (fc->data_offset + data_start,
597 (BYTE*)ip + in_GetHdrLen(ip), (size_t)data_length);
598
599 TRACE_MSG (FOREGOUND_WHITE, "got_hole %d, fc->hole_first %" ADDR_FMT "\n",
600 got_hole, ADDR_CAST(fc->hole_first));
601
602 if (fc->hole_first == NULL) /* Now we have all the parts */
603 {
604 if (fb->active >= 1)
605 fb->active--;
606
607 /* Redo checksum as we've changed the length in the header
608 */
609 fc->ip->frag_ofs = 0; /* no MF or frag-ofs */
610 fc->ip->checksum = 0;
611 fc->ip->checksum = ~CHECKSUM (fc->ip, sizeof(in_Header));
612
613 STAT (ip4stats.ips_reassembled++);
614 *ip_ptr = fc->ip; /* MAC-header is in front of IP */
615 return (1);
616 }
617
618 STAT (ip4stats.ips_fragdropped--);
619
620drop_frag:
621 STAT (ip4stats.ips_fragdropped++);
622 DEBUG_RX (NULL, ip);
623 return (0);
624}
625
626/*
627 * Release a reassembled IP-packet.
628 * Or mark a frag_bucket as inactive because of reassembly timeout.
629 */
630int ip4_free_fragment (const in_Header *ip)
631{
632 unsigned i, j;
633
634 for (j = 0; j < DIM(frag_buckets); j++)
635 {
636 struct frag_bucket *fb = frag_buckets + j;
637 struct huge_ip *hip = fb->ip;
638
639 if (hip->marker != BUCKET_MARKER)
640 TRACE_CONSOLE (0, "frag_buckets[%d] destroyed\n!", j);
641
642 if (fb->used && ip == &hip->hdr)
643 {
644 TRACE_MSG (FOREGOUND_WHITE, "ip4_free_fragment(%" ADDR_FMT "), bucket=%d, active=%d\n",
645 ADDR_CAST(ip), j, fb->active);
646
647 fb->used = FALSE;
648 fb->active = 0;
649 for (i = 0; i < MAX_FRAGMENTS; i++)
650 frag_control[j][i].used = FALSE;
651 return (1);
652 }
653 }
654 return (0);
655}
656
657/*
658 * Check if any fragment chains has timed-out
659 */
660static void W32_CALL chk_timeout_frags (void)
661{
662 unsigned i, j;
663
664 for (j = 0; j < DIM(frag_buckets); j++)
665 {
666 struct frag_bucket *fb = frag_buckets + j;
667 struct frag_ctrl *fc = &frag_control[j][0];
668
669 TRACE_MSG (FOREGOUND_YELLOW, "chk_timeout_frags(), bucket %u, active %d, used %d\n",
670 j, fb->active, fb->used);
671 if (!fb->active)
672 continue;
673
674 for (i = 0; i < MAX_FRAGMENTS; i++, fc++)
675 {
676 if (!fc->used || !chk_timeout(fc->timer))
677 continue;
678
679 if (fb->got_ofs0)
680 {
681 struct in_Header ip;
682
683 memset (&ip, 0, sizeof(ip));
684 ip.identification = fb->key.ident;
685 ip.proto = fb->key.proto;
686 ip.source = fb->key.source;
687 ip.destination = fb->key.destin;
688
689 /* send an ICMP_TIMXCEED (code 1)
690 */
691 icmp_send_timexceed (&ip, (const void*)&fb->mac_src);
692 }
693
694 STAT (ip4stats.ips_fragtimeout++);
695
696 TRACE_MSG (FOREGOUND_YELLOW, "chk_timeout_frags(), bucket %u, slot %d, id %04X\n",
697 j, i, intel16(fb->key.ident));
698
699 if (ip4_free_fragment(&fb->ip->hdr))
700 return;
701 }
702 }
703}
704
705/*
706 * Free memeory allocated at startup by ip4_frag_init().
707 */
708static void W32_CALL free_frag_buckets (void)
709{
710 int i;
711
712 for (i = 0; i < DIM(frag_buckets); i++)
713 {
714 struct frag_bucket *fb = frag_buckets + i;
715 struct huge_ip *hip = fb->ip;
716
717 if (hip && hip->marker == BUCKET_MARKER)
718 {
719 hip->marker = 0;
720 free (hip);
721 }
722 }
723}
724
725/*
726 * Allocate 'frag_buckets[]::ip' for doing reassembly.
727 */
728void ip4_frag_init (void)
729{
730 int i;
731
732 for (i = 0; i < DIM(frag_buckets); i++)
733 {
734 struct frag_bucket *fb = frag_buckets + i;
735 struct huge_ip *hip = calloc (sizeof(*hip), 1);
736
737 if (!hip)
738 break;
739
740 memset (fb, '\0', sizeof(*fb));
741 fb->ip = hip;
742 hip->marker = BUCKET_MARKER;
743 }
744
745 /* Add a daemon to check for IPv4-fragment time-outs.
746 */
747 DAEMON_ADD (chk_timeout_frags);
748 RUNDOWN_ADD (free_frag_buckets, 260);
749}
750#endif /* USE_FRAGMENTS */
751
752/*----------------------------------------------------------------------*/
753
754#if defined(TEST_PROG) /* a small test program */
755#if !defined(USE_FRAGMENTS)
756int main (void)
757{
758 puts ("This program needs '#define USE_FRAGMENTS'");
759 return (1);
760}
761#else /* rest of file */
762
763#undef FP_OFF
764#undef enable
765#undef disable
766
767#if defined(HAVE_UNISTD_H)
768#include <unistd.h>
769#endif
770
771#ifdef _WIN32
772#define sleep(sec) Sleep (1000*(sec))
773#endif
774
775#include "sock_ini.h"
776#include "loopback.h"
777#include "pcarp.h"
778
779static DWORD to_host = 0;
780static WORD frag_ofs = 0;
781static int max_frags = 5;
782static int frag_size = 1000;
783static int rand_frag = 0;
784static int rev_order = 0;
785static int time_frag = 0;
786
787#ifdef WIN32
788
789/* Put this somewhere else */
790
791static struct {
792 const char *col_name;
793 int col_value;
794 } colors[] = {
795 { "black", 0 },
796 { "blue", FOREGROUND_BLUE },
797 { "green", FOREGROUND_GREEN },
798 { "cyan", FOREGROUND_BLUE | FOREGROUND_GREEN },
799 { "red", FOREGROUND_RED },
800 { "magenta", FOREGROUND_BLUE | FOREGROUND_RED },
801 { "brown", FOREGROUND_RED | FOREGROUND_GREEN },
802 { "lightgray", FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED },
803 { "darkgray", FOREGROUND_INTENSITY | 0 },
804 { "lightblue", FOREGROUND_INTENSITY | FOREGROUND_BLUE },
805 { "lightgreen", FOREGROUND_INTENSITY | FOREGROUND_GREEN },
806 { "lightcyan", FOREGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_GREEN },
807 { "lightred", FOREGROUND_INTENSITY | FOREGROUND_RED },
808 { "lightmagenta", FOREGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_RED },
809 { "yellow", FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN },
810 { "white", FOREGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED }
811 };
812
813void test_colors (void)
814{
815 int i;
816
817 for (i = 0; i < DIM(colors); i++)
818 {
819 SetConsoleTextAttribute (stdout_hnd, (console_info.wAttributes & ~7) | colors[i].col_value);
820 printf ("Color %2d: %2d = %s\n", i, colors[i].col_value, colors[i].col_name);
821 SetConsoleTextAttribute (stdout_hnd, console_info.wAttributes);
822 }
823}
824#endif
825
826void usage (const char *argv0)
827{
828 printf ("%s [-n num] [-s size] [-h ip] [-r] [-R] [-t]\n"
829 "Send fragmented ICMP Echo Request (ping)\n\n"
830 "options:\n"
831 " -n number of fragments to send (default %d)\n"
832 " -s size of each fragment (default %d)\n"
833 " -h specify destination IP (default 127.0.0.1)\n"
834 " -r send fragments in random order (default %s)\n"
835 " -R send fragments in reverse order (default %s)\n"
836 " -t simulate fragment timeout (default %s)\n",
837 argv0, max_frags, frag_size,
838 rand_frag ? "yes" : "no",
839 rev_order ? "yes" : "no",
840 time_frag ? "yes" : "no");
841 exit (0);
842}
843
844BYTE *init_frag (int argc, char **argv)
845{
846 int i, ch;
847 BYTE *data;
848
849 while ((ch = getopt(argc, argv, "h:n:s:rRt?")) != EOF)
850 switch (ch)
851 {
852 case 'h': to_host = inet_addr (optarg);
853 if (to_host == INADDR_NONE)
854 {
855 printf ("Illegal IP-address\n");
856 exit (-1);
857 }
858 break;
859 case 'n': max_frags = atoi (optarg);
860 break;
861 case 's': frag_size = atoi (optarg) / 8; /* multiples of 8 */
862 frag_size <<= 3;
863 break;
864 case 'r': rand_frag = 1;
865 break;
866 case 'R': rev_order = 1;
867 break;
868 case 't': time_frag = 1;
869 break;
870 case '?':
871 default : usage (argv[0]);
872 }
873
874 if (max_frags < 1 || max_frags > FD_SETSIZE)
875 {
876 printf ("# of fragments is 1 - %d\n", FD_SETSIZE);
877 exit (-1);
878 }
879
880 if (frag_size < 8 || frag_size > (int)MAX_IP4_DATA)
881 {
882 printf ("Fragsize range is 8 - %lu\n", (unsigned long)MAX_IP4_DATA);
883 exit (-1);
884 }
885
886 if ((unsigned)(frag_size * max_frags) > USHRT_MAX)
887 {
888 printf ("Total fragsize must be < 64kB\n");
889 exit (-1);
890 }
891
892 data = calloc (frag_size * max_frags, 1);
893 if (!data)
894 {
895 printf ("no memory\n");
896 exit (-1);
897 }
898
899 for (i = 0; i < max_frags; i++)
900 memset (data + i*frag_size, 'a'+i, frag_size);
901
902 loopback_mode |= LBACK_MODE_ENABLE;
903 dbug_init();
904 sock_init();
905
906 if (!to_host)
907 to_host = htonl (INADDR_LOOPBACK);
908 return (data);
909}
910
911/*----------------------------------------------------------------------*/
912
913int rand_packet (fd_set *fd, int max)
914{
915 int count = 0;
916
917 while (1)
918 {
919 int i = Random (0, max);
920 if (i < max && !FD_ISSET(i,fd))
921 {
922 FD_SET (i, fd);
923 return (i);
924 }
925 if (++count == 10*max)
926 return (-1);
927 }
928}
929
930/*----------------------------------------------------------------------*/
931
932int main (int argc, char **argv)
933{
934 fd_set is_sent;
935 int i;
936 eth_address eth;
937 in_Header *ip;
938 ICMP_PKT *icmp;
939 WORD frag_flag;
940 BYTE *data = init_frag (argc, argv);
941
942 if (!_arp_resolve(ntohl(to_host), &eth))
943 {
944 printf ("ARP failed\n");
945 return (-1);
946 }
947
948 _ip4_frag_reasm = 3;
949
950 ip = (in_Header*) _eth_formatpacket (&eth, IP4_TYPE);
951 icmp = (ICMP_PKT*) data;
952
953 ip->hdrlen = sizeof(*ip)/4;
954 ip->ver = 4;
955 ip->tos = _default_tos;
956 ip->identification = _get_ip4_id();
957 ip->ttl = 15; /* max 15sec reassembly time */
958 ip->proto = ICMP_PROTO;
959
960 icmp->echo.type = ICMP_ECHO;
961 icmp->echo.code = 0;
962 icmp->echo.identifier = 0;
963 icmp->echo.index = 1;
964 icmp->echo.sequence = set_timeout (1) & 0xFFFF; /* "random" id */
965 icmp->echo.checksum = 0;
966 icmp->echo.checksum = ~CHECKSUM (icmp, max_frags*frag_size);
967
968 FD_ZERO (&is_sent);
969
970#if 0 /* test random generation */
971 if (rand_frag)
972 for (i = 0; i < max_frags; i++)
973 {
974 int j = rand_packet (&is_sent, max_frags);
975 printf ("index %d\n", j);
976 }
977 exit (0);
978#endif
979
980 for (i = 0; i < max_frags; i++)
981 {
982 int j;
983
984 if (rand_frag)
985 {
986 j = rand_packet (&is_sent, max_frags);
987 if (j < 0)
988 break;
989 }
990 if (rev_order)
991 {
992 j = max_frags - i - 1;
993 frag_flag = (j > 0) ? IP_MF : 0;
994 }
995 else
996 {
997 j = i;
998 frag_flag = (j == max_frags-1) ? 0 : IP_MF;
999 }
1000
1001 frag_ofs = (j * frag_size);
1002 memcpy ((BYTE*)(ip+1), data+frag_ofs, frag_size);
1003
1004 /* The loopback device swaps src/dest IP; hence we must set them
1005 * on each iteration of the loop
1006 */
1007 ip->source = intel (my_ip_addr);
1008 ip->destination = to_host;
1009 ip->frag_ofs = intel16 (frag_ofs/8 | frag_flag);
1010 ip->length = intel16 (frag_size + sizeof(*ip));
1011 ip->checksum = 0;
1012 ip->checksum = ~CHECKSUM (ip, sizeof(*ip));
1013
1014 _eth_send (frag_size+sizeof(*ip), NULL, __FILE__, __LINE__);
1015
1016 STAT (ip4stats.ips_ofragments++);
1017 }
1018
1019 puts ("Calling tcp_tick(). Press a key to quit.");
1020 debug_on = 2;
1021
1022 while (!kbhit())
1023 {
1024 tcp_tick (NULL);
1025 sleep (1);
1026 }
1027
1028 free (data);
1029 return (0);
1030}
1031#endif /* USE_FRAGMENTS */
1032#endif /* TEST_PROG */
1033
chksum.h
inet.h
init_frag
BYTE * init_frag(int argc, char **argv)
Definition: ip4_frag.c:844
ip4_frag.h
ip4_in.h
_default_tos
BYTE _default_tos
Definition: ip4_out.c:53
_get_ip4_id
WORD _get_ip4_id(void)
Increment IPv4-identifier before returning it.
Definition: ip4_out.c:65
ip4_out.h
language.h
loopback.h
Random
unsigned W32_CALL Random(unsigned a, unsigned b)
Returns a random integer in range [a..b].
Definition: misc.c:743
misc.h
misc_str.h
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
_arp_resolve
BOOL W32_CALL _arp_resolve(DWORD ip, eth_address *eth)
The blocking lookup function visible to higher functions.
Definition: pcarp.c:1278
pcarp.h
pcconfig.h
pcdbug.h
icmp_send_timexceed
int icmp_send_timexceed(const in_Header *ip, const void *mac_dest)
Send an "ICMP Time Exceeded" (reassebly timeout) back to 'ip->source'.
Definition: pcicmp.c:229
pcicmp.h
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
pcpkt.h
pcqueue.h
_eth_send
int W32_CALL _eth_send(WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
Definition: pcsed.c:301
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
pcstat.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
pctcp.h
sock_ini.h
fd_set
Definition: wtypes.h:256
frag_bucket
Definition: ip4_frag.c:110
frag_ctrl
Definition: ip4_frag.c:126
frag_key
Definition: ip4_frag.c:103
hole
Definition: ip4_frag.c:120
huge_ip
Definition: ip4_frag.c:97
icmp
Definition: ip_icmp.h:66
in_Header
Definition: wattcp.h:329
ipstat::ips_reassembled
u_long ips_reassembled
Definition: ip_var.h:152
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
ICMP_PKT
Definition: pcicmp.h:126
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/ip4_frag.h Source File

  • src
ip4_frag.h
Go to the documentation of this file.
1
3#ifndef _w32_IP4_FRAG_H
4#define _w32_IP4_FRAG_H
5
6extern int _ip4_frag_reasm;
7
8extern void ip4_frag_init (void);
9extern int ip4_defragment (const in_Header **ip, DWORD ofs, WORD flags);
10extern int ip4_free_fragment (const in_Header *ip);
11
12#endif
13
in_Header
Definition: wattcp.h:329


Watt-32 tcp/ip: E:/WATT/src/ip4_in.c Source File

  • src
ip4_in.c
Go to the documentation of this file.
1
11#include <stdio.h>
12#include <stdlib.h>
13
14#include "wattcp.h"
15#include "misc.h"
16#include "misc_str.h"
17#include "chksum.h"
18#include "pcconfig.h"
19#include "pcigmp.h"
20#include "pcdbug.h"
21#include "pcsed.h"
22#include "pctcp.h"
23#include "pcstat.h"
24#include "pcicmp.h"
25#include "ip4_frag.h"
26#include "ip4_in.h"
27
28/*
29 * _ip4_handler - do a simple check on IPv4 header.
30 * - check the fragment chain queue for a match.
31 * - Demultiplex packet to correct protocol handler.
32 */
33int _ip4_handler (const in_Header *ip, BOOL broadcast)
34{
35#if defined(USE_FRAGMENTS)
36 const in_Header *in_ip = ip;
37#endif
38 sock_type *s = NULL;
39 DWORD frag_ofs;
40 WORD frag_flg;
41 BOOL delivered = TRUE; /* assume yes */
42
43 if (block_ip || !_chk_ip4_header(ip))
44 return (0);
45
46 frag_ofs = intel16 (ip->frag_ofs);
47 frag_flg = (WORD) (frag_ofs & ~IP_OFFMASK);
48 frag_ofs = (frag_ofs & IP_OFFMASK) << 3; /* 0 <= frag_ofs <= 65536-8 */
49
50#if defined(USE_FRAGMENTS)
51 if (!ip4_defragment(&ip,frag_ofs,frag_flg)) /* not defragged yet */
52 return (0);
53#else
54 ARGSUSED (frag_flg);
55 if (frag_ofs)
56 return (0);
57#endif
58
64#if defined(USE_BSD_API)
65 /*
66 * Match 'ip' against all SOCK_RAW sockets before doing normal
67 * protocol multiplexing below.
68 *
69 * Note: _bsd_socket_hook does nothing unless we have allocated at least
70 * one SOCK_RAW socket.
71 *
72 * Should we return if the hook consumed packet (returns non-NULL) ?
73 */
74 if (_bsd_socket_hook)
75 (*_bsd_socket_hook) (BSO_IP4_RAW, ip);
76#endif
77
78
79 switch (ip->proto)
80 {
81 case TCP_PROTO:
82#if !defined(USE_UDP_ONLY)
83 s = (sock_type*) _tcp_handler (ip, broadcast);
84#endif
85 break;
86
87 case UDP_PROTO:
88 s = (sock_type*) _udp_handler (ip, broadcast);
89 break;
90
91 case ICMP_PROTO:
92 icmp_handler (ip, broadcast);
93 break;
94
95 case IGMP_PROTO:
96#if defined(USE_MULTICAST)
97 igmp_handler (ip, broadcast);
98#endif
99 break;
100
101 case IPCOMP_PROTO:
104 default:
105 DEBUG_RX (NULL, ip);
106 if (!broadcast)
107 {
108 if (_ip4_is_local_addr(intel(ip->destination)))
109 icmp_send_unreach (ip, ICMP_UNREACH_PROTOCOL);
110 STAT (ip4stats.ips_noproto++);
111 }
112 delivered = FALSE;
113 break;
114 }
115
116#ifdef NOT_USED
117 if (s) /* Check if peer allows IP-fragments */
118 {
119 if (intel16(ip->frag_ofs) & IP_DF)
120 s->tcp.locflags |= LF_NO_IPFRAGS;
121 else s->tcp.locflags &= ~LF_NO_IPFRAGMS;
122 }
123#endif
124
125#if defined(USE_FRAGMENTS)
126 if (ip != in_ip)
127 ip4_free_fragment (ip); /* free this fragment chain */
128#endif
129
130 if (delivered)
131 STAT (ip4stats.ips_delivered++);
132 ARGSUSED (s);
133 return (1);
134}
135
136/*
137 * Check for correct IP-version, header length and header checksum.
138 * If failed, discard the packet. ref. RFC1122: section 3.1.2.2
139 */
140int _chk_ip4_header (const in_Header *ip)
141{
142 unsigned hlen = in_GetHdrLen (ip);
143
144 if (ip->ver != 4) /* We only speak IPv4 */
145 {
146 DEBUG_RX (NULL, ip);
147 STAT (ip4stats.ips_badvers++);
148 return (0);
149 }
150 if (hlen < sizeof(*ip))
151 {
152 DEBUG_RX (NULL, ip);
153 STAT (ip4stats.ips_tooshort++);
154 return (0);
155 }
156 if (CHECKSUM(ip,hlen) != 0xFFFF)
157 {
158 DEBUG_RX (NULL, ip);
159 STAT (ip4stats.ips_badsum++);
160 return (0);
161 }
162 return (1);
163}
164
165/*
166 * Return TRUE if ip address is a local address or on the
167 * loopback network (127.x.x.x). `ip' is on host order.
168 * If netmask is 255.255.255.255, 'ip' *could* be remote.
169 */
170int _ip4_is_local_addr (DWORD ip)
171{
172 if (sin_mask == 0xFFFFFFFFUL)
173 return (0);
174 return _ip4_is_loopback_addr(ip) || _ip4_is_multihome_addr(ip);
175}
176
177int _ip4_is_loopback_addr (DWORD ip)
178{
179 return ((ip >> 24) == 127);
180}
181
182/*
183 * Return TRUE if ip address is a legal address for
184 * a unique host. `ip' is on host order.
185 */
186int _ip4_is_unique_addr (DWORD ip)
187{
188 return (ip && (ip & ~sin_mask) == 0);
189}
190
191/*
192 * Return TRUE if ip address is among our interface addresses
193 * [my_ip_addr.. (my_ip_addr+multihomes)], `ip' is on host order.
194 */
195int _ip4_is_multihome_addr (DWORD ip)
196{
197 if (!my_ip_addr || ip < my_ip_addr)
198 return (0);
199 if (ip - my_ip_addr <= multihomes)
200 return (1);
201 return (0);
202}
203
204/*
205 * return TRUE if ip packet is a (directed) broadcast packet.
206 */
207int _ip4_is_ip_brdcast (const in_Header *ip)
208{
209 DWORD dst = intel (ip->destination);
210 return ((~dst & ~sin_mask) == 0); /* (directed) ip-broadcast */
211}
212
213/*
214 * determines if the given IP addr is Class D (Multicast)
215 *
216 * int _ip4_is_multicast (DWORD ip)
217 * Where:
218 * `ip' is on host order.
219 * Returns:
220 * 1 if ip is Class D
221 * 0 if ip is not Class D
222 *
223 * Note: class-D is 224.0.0.0 - 239.255.255.255, but
224 * range 224.0.0.0 - 224.0.0.255 is reserved for mcast
225 * routing information.
226 */
227int _ip4_is_multicast (DWORD ip)
228{
229 return IN_MULTICAST(ip);
230}
231
chksum.h
ip4_frag.h
_ip4_handler
int _ip4_handler(const in_Header *ip, BOOL broadcast)
Definition: ip4_in.c:33
ip4_in.h
misc.h
misc_str.h
pcconfig.h
pcdbug.h
icmp_handler
void icmp_handler(const in_Header *ip, BOOL broadcast)
Handler for incoming ICMP packets.
Definition: pcicmp.c:380
icmp_send_unreach
int icmp_send_unreach(const in_Header *ip, int code)
Send an ICMP destination/protocol unreachable back to 'ip->source'.
Definition: pcicmp.c:198
pcicmp.h
pcigmp.h
pcsed.h
pcstat.h
block_ip
BOOL block_ip
when application handles IP itself
Definition: pctcp.c:67
_tcp_handler
_tcp_Socket * _tcp_handler(const in_Header *ip, BOOL broadcast)
The main TCP input handler.
Definition: pctcp.c:649
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
_udp_handler
_udp_Socket * _udp_handler(const in_Header *ip, BOOL broadcast)
Handler for incoming UDP packets.
Definition: pctcp.c:1042
pctcp.h
in_Header
Definition: wattcp.h:329
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/ip4_in.h Source File

  • src
ip4_in.h
Go to the documentation of this file.
1
3#ifndef _w32_IP4_IN_H
4#define _w32_IP4_IN_H
5
9#define IPOPT_EOL 0
10#define IPOPT_NOP 1
11#define IPOPT_RR 7
12#define IPOPT_TS 68
13#define IPOPT_SECURITY 130
14#define IPOPT_LSRR 131
15#define IPOPT_SATID 136
16#define IPOPT_SSRR 137
17#define IPOPT_RA 148
22#ifndef IN_MULTICAST
23#define IN_MULTICAST(ip) ((ip & 0xF0000000UL) == 0xE0000000UL)
24#endif
25
26#ifndef IN_EXPERIMENTAL
27#define IN_EXPERIMENTAL(ip) ((ip & 0xF0000000UL) == 0xF0000000UL)
28#endif
29
30extern int _ip4_handler (const in_Header *ip, BOOL broadcast);
31extern int _chk_ip4_header (const in_Header *ip);
32
33extern int _ip4_is_local_addr (DWORD ip);
34extern int _ip4_is_unique_addr (DWORD ip);
35extern int _ip4_is_multihome_addr (DWORD ip);
36extern int _ip4_is_ip_brdcast (const in_Header *ip);
37extern int _ip4_is_multicast (DWORD ip);
38extern int _ip4_is_loopback_addr (DWORD ip);
39
40#endif
_ip4_handler
int _ip4_handler(const in_Header *ip, BOOL broadcast)
Definition: ip4_in.c:33
in_Header
Definition: wattcp.h:329


Watt-32 tcp/ip: E:/WATT/src/ip4_out.c Source File

  • src
ip4_out.c
Go to the documentation of this file.
1
5/* Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Gisle Vanem
18 * Bergen, Norway.
19 *
20 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
24 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * Version
32 *
33 * 1.0 : Apr 18, 1999 : G. Vanem - created
34 * 1.1 : Jan 29, 2000 : G. Vanem - added functions for
35 * handling list of IP-fragments.
36 */
37
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>
41#include <sys/socket.h>
42
43#include "wattcp.h"
44#include "misc.h"
45#include "chksum.h"
46#include "pcdbug.h"
47#include "pcsed.h"
48#include "pctcp.h"
49#include "pcstat.h"
50#include "pcicmp.h"
51#include "socket.h"
52
53BYTE _default_tos = 0; /* Type-Of-Service */
54int _default_ttl = 254; /* TTL on outgoing packets */
55int _ip4_id_increment = 1; /* Some stacks uses 5 */
56BOOL _ip4_dont_frag = FALSE; /* Don't set DF bit on every packet */
57
58static WORD ip4_id = 0;
59
65WORD _get_ip4_id (void)
66{
67 ip4_id += _ip4_id_increment;
68 return intel16 (ip4_id);
69}
70
74WORD _get_this_ip4_id (void)
75{
76 return intel16 (ip4_id);
77}
78
86int _ip4_output (in_Header *ip, /* ip-structure to fill in */
87 DWORD src_ip, /* from address (network order!) */
88 DWORD dst_ip, /* dest address (network order!) */
89 BYTE protocol, /* IP-protocol number */
90 BYTE ttl, /* Time To Live */
91 BYTE tos, /* Type Of Service, 0 unspecified */
92 WORD ip_id, /* IP identification, normally 0 */
93 int data_len, /* length of data after ip header */
94 const void *sock, /* which socket is this */
95 const char *file, /* Debug: from what file */
96 unsigned line) /* and line was _ip4_output called */
97{
98 int len = sizeof(*ip) + data_len;
99
100 /*
101 * Note: the 'ip->frag_ofs' field isn't normally set here (it's
102 * cleared in eth_formatpacket() causing IP_DF bit to off).
103 * If sending fragments it's set in _ip4_send_fragments() below.
104 */
105
106 if (src_ip == 0)
107 src_ip = intel (my_ip_addr);
108
109 if (_ip4_dont_frag)
110 ip->frag_ofs |= intel16 (IP_DF);
111
112 ip->ver = 4;
113 ip->hdrlen = sizeof(*ip) / 4;
114 ip->length = intel16 (len);
115 ip->tos = tos & IP_TOSMASK;
116 ip->ttl = ttl ? ttl : _default_ttl;
117 ip->identification = ip_id ? ip_id : _get_ip4_id();
118 ip->proto = protocol;
119 ip->source = src_ip;
120 ip->destination = dst_ip;
121 ip->checksum = 0;
122 ip->checksum = ~CHECKSUM (ip, sizeof(*ip));
123
124 return _eth_send (len, sock, file, line);
125}
126
127#if defined(USE_FRAGMENTS)
128/*
129 * Note: host is on network order.
130 * No IP options supported here.
131 */
132static __inline in_Header *make_ip_pkt (DWORD host, BOOL first, char **data)
133{
134 eth_address dest;
135 in_Header *ip;
136
137 if (first && !_arp_resolve(intel(host),&dest))
138 {
139 if (debug_on)
140 outsnl (_LANG("make_ip_pkt(): ARP failed"));
141 SOCK_DEBUGF ((", EHOSTUNREACH"));
142 SOCK_ERRNO (EHOSTUNREACH);
143 return (NULL);
144 }
145
146 ip = (in_Header*) _eth_formatpacket (&dest, IP4_TYPE);
147 *data = (char*) (ip+1);
148 return (ip);
149}
150
151/*
152 * \todo Handle IP/TCP options.
153 */
154static in_Header *make_tcp_pkt (const _tcp_Socket *s,
155 BOOL first, char **data)
156{
157 in_Header *ip = (in_Header*) _eth_formatpacket (&s->his_ethaddr, IP4_TYPE);
158
159 if (first)
160 {
161 tcp_Header *tcp = (tcp_Header*) (ip+1);
162 tcp_PseudoHeader ph;
163 WORD tcp_len = sizeof(*tcp);
164
165 tcp->srcPort = intel16 (s->myport);
166 tcp->dstPort = intel16 (s->hisport);
167 tcp->seqnum = intel (s->send_next + s->send_una);
168 tcp->acknum = intel (s->recv_next);
169 tcp->window = intel16 (s->max_rx_data - s->rx_datalen);
170 tcp->flags = (BYTE) s->flags;
171 tcp->unused = 0;
172 tcp->checksum = 0;
173 tcp->urgent = 0;
174 tcp->offset = tcp_len / 4;
175
176 memset (&ph, 0, sizeof(ph));
177 ph.src = intel (s->myaddr);
178 ph.dst = intel (s->hisaddr);
179 ph.protocol = TCP_PROTO;
180 ph.length = intel16 (tcp_len);
181 ph.checksum = CHECKSUM (tcp, tcp_len);
182 tcp->checksum = ~CHECKSUM (&ph, sizeof(ph));
183 *data = (char*)tcp + sizeof(*tcp);
184 }
185 else
186 *data = (char*)(ip+1);
187
188 return (ip);
189}
190
191/*
192 * Note: We assume 's->his_ethaddr' is filled by udp_open() or udp_demux().
193 * I.e. socket is active and not a broadcast socket.
194 */
195static __inline in_Header *make_udp_pkt (const _udp_Socket *s, BOOL first,
196 unsigned len, char **data)
197{
198 in_Header *ip = (in_Header*) _eth_formatpacket (&s->his_ethaddr, IP4_TYPE);
199
200 if (first)
201 {
202 udp_Header *udp = (udp_Header*) (ip+1);
203 tcp_PseudoHeader ph;
204
205 udp->srcPort = intel16 (s->myport);
206 udp->dstPort = intel16 (s->hisport);
207 udp->checksum = 0;
208 udp->length = intel16 ((WORD)(sizeof(*udp) + len));
209 memset (&ph, 0, sizeof(ph));
210 ph.src = intel (s->myaddr);
211 ph.dst = intel (s->hisaddr);
212
213 if (s->sockmode & SOCK_MODE_UDPCHK)
214 {
215 ph.protocol = UDP_PROTO;
216 ph.length = udp->length;
217 ph.checksum = CHECKSUM (udp, sizeof(*udp)) + CHECKSUM (*data, len);
218 udp->checksum = ~CHECKSUM (&ph, sizeof(ph));
219 }
220 *data = (char*)udp + sizeof(*udp);
221 }
222 else
223 *data = (char*)(ip+1);
224
225 return (ip);
226}
227
228
229/*
230 * Sends a chain of IPv4 fragments for proto. `buf' is higher-level
231 * protocol (ICMP/UDP/TCP).
232 * Note: `dest' is on network order. This function is only called
233 * when we're sure fragment are needed; num_frags >= 1.
234 */
235int _ip4_send_fragments (sock_type *s, BYTE proto, DWORD dest,
236 const void *buf, unsigned len,
237 const char *file, unsigned line)
238{
239 int i, num_frags, rc = 0;
240 int frag_size, frag_ofs;
241 WORD ip_id;
242 WORD ip_max = _mtu - sizeof(in_Header);
243
244 num_frags = len / ip_max;
245
246 WATT_ASSERT (num_frags >= 1);
247
248 if (len % ip_max)
249 num_frags++;
250
251 /* Increment IP-identifier. Use same value for all fragments
252 */
253 ip_id = _get_ip4_id();
254
257 for (frag_ofs = i = 0; i < num_frags; i++)
258 {
259 in_Header *ip = NULL;
260 char *data = (char*) buf;
261
262 switch (proto)
263 {
264#if 0
265 case IP4_TYPE: /* raw IP type (from ip4_transmit) */
266 proto = ((in_Header*)buf)->proto;
267 /* fall through */
268#endif
269 case ICMP_PROTO:
270 ip = make_ip_pkt (dest, frag_ofs == 0, &data);
271 if (!ip)
272 return (-1);
273 break;
274
275 case UDP_PROTO:
276 ip = make_udp_pkt (&s->udp, frag_ofs == 0, len, &data);
277 break;
278
279 case TCP_PROTO:
280 if (s->tcp.state != tcp_StateESTAB)
281 return (0);
282 ip = make_tcp_pkt (&s->tcp, frag_ofs == 0, &data);
283 break;
284
285 default:
286 TRACE_CONSOLE (0, "%s (%d): Illegal protocol %04X\n",
287 __FILE__, __LINE__, proto);
288 return (0);
289 }
290
291 if (i == num_frags-1) /* last fragment */
292 {
293 frag_size = len;
294 ip->frag_ofs = intel16 (frag_ofs/8);
295 /* memset (data+frag_size-8, 0, len); */ /* padding */
296 }
297 else
298 {
299 frag_size = ip_max;
300 ip->frag_ofs = intel16 (frag_ofs/8 | IP_MF);
301 }
302
303 memcpy (data, (const char*)buf + frag_ofs, frag_size);
304
305 if (_ip4_output (ip, 0, dest, proto, 0, 0, ip_id, frag_size,
306 s, file, line) <= 0)
307 {
308 SOCK_DEBUGF ((", ENETDOWN"));
309 SOCK_ERRNO (ENETDOWN);
310 rc = -1;
311 break;
312 }
313 STAT (ip4stats.ips_ofragments++);
314
315 frag_ofs += frag_size;
316 len -= frag_size;
317 rc += frag_size;
318 }
319
320 tcp_tick (NULL); /* !! for viewing loopback trace */
321 return (rc);
322}
323#endif /* USE_FRAGMENTS */
324
chksum.h
socket.h
_default_tos
BYTE _default_tos
Definition: ip4_out.c:53
_ip4_output
int _ip4_output(in_Header *ip, DWORD src_ip, DWORD dst_ip, BYTE protocol, BYTE ttl, BYTE tos, WORD ip_id, int data_len, const void *sock, const char *file, unsigned line)
The IP4 packet transmitter.
Definition: ip4_out.c:86
_ip4_id_increment
int _ip4_id_increment
Definition: ip4_out.c:55
_default_ttl
int _default_ttl
Definition: ip4_out.c:54
_ip4_dont_frag
BOOL _ip4_dont_frag
Definition: ip4_out.c:56
_get_this_ip4_id
WORD _get_this_ip4_id(void)
Return IPv4-identifier but don't increment it.
Definition: ip4_out.c:74
_get_ip4_id
WORD _get_ip4_id(void)
Increment IPv4-identifier before returning it.
Definition: ip4_out.c:65
_ip4_send_fragments
int _ip4_send_fragments(sock_type *s, BYTE proto, DWORD dest, const void *buf, unsigned len, const char *file, unsigned line)
Definition: ip4_out.c:235
misc.h
_arp_resolve
BOOL W32_CALL _arp_resolve(DWORD ip, eth_address *eth)
The blocking lookup function visible to higher functions.
Definition: pcarp.c:1278
pcdbug.h
pcicmp.h
_eth_send
int W32_CALL _eth_send(WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
Definition: pcsed.c:301
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
pcsed.h
pcstat.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
pctcp.h
in_Header
Definition: wattcp.h:329
tcp_Header
Definition: wattcp.h:418
tcp_PseudoHeader
Definition: wattcp.h:449
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
tcp_Socket::send_una
long send_una
unacked send data, must be signed
Definition: wattcp.h:597
tcp_Socket::send_next
DWORD send_next
SEQ we send but not ACK-ed by peer.
Definition: wattcp.h:596
tcp_Socket::recv_next
DWORD recv_next
SEQ number we expect to receive.
Definition: wattcp.h:595
tcp_Socket::flags
WORD flags
TCP flags used in next Tx.
Definition: wattcp.h:606
udp_Header
Definition: wattcp.h:406
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/ip4_out.h Source File

  • src
ip4_out.h
Go to the documentation of this file.
1
3#ifndef _w32_IP_OUT_H
4#define _w32_IP_OUT_H
5
6extern BOOL _ip4_dont_frag;
7extern int _ip4_id_increment;
8extern int _default_ttl;
9extern BYTE _default_tos;
11extern WORD _get_ip4_id (void);
12extern WORD _get_this_ip4_id (void);
13
14extern int _ip4_output (in_Header *ip, DWORD src_ip, DWORD dst_ip,
15 BYTE protocol, BYTE ttl, BYTE tos, WORD ip_id,
16 int data_len, const void *sock,
17 const char *file, unsigned line);
18
19#define IP4_OUTPUT(ip, src, dst, proto, ttl, tos, ip_id, data_len, sock) \
20 _ip4_output(ip, src, dst, proto, ttl, tos, ip_id, data_len, sock, \
21 __FILE__, __LINE__)
22
23
24#if defined(USE_FRAGMENTS)
25 int _ip4_send_fragments (sock_type *sk, BYTE proto, DWORD dest,
26 const void *buf, unsigned len, const char *file,
27 unsigned line);
28
29 #define _IP4_SEND_FRAGMENTS(sk, proto, dest, buf, len) \
30 _ip4_send_fragments(sk, proto, dest, buf, len, __FILE__, __LINE__)
31#endif
32
33#endif
_default_tos
BYTE _default_tos
Definition: ip4_out.c:53
_ip4_output
int _ip4_output(in_Header *ip, DWORD src_ip, DWORD dst_ip, BYTE protocol, BYTE ttl, BYTE tos, WORD ip_id, int data_len, const void *sock, const char *file, unsigned line)
The IP4 packet transmitter.
Definition: ip4_out.c:86
_ip4_id_increment
int _ip4_id_increment
Definition: ip4_out.c:55
_default_ttl
int _default_ttl
Definition: ip4_out.c:54
_ip4_dont_frag
BOOL _ip4_dont_frag
Definition: ip4_out.c:56
_get_this_ip4_id
WORD _get_this_ip4_id(void)
Return IPv4-identifier but don't increment it.
Definition: ip4_out.c:74
_get_ip4_id
WORD _get_ip4_id(void)
Increment IPv4-identifier before returning it.
Definition: ip4_out.c:65
_ip4_send_fragments
int _ip4_send_fragments(sock_type *sk, BYTE proto, DWORD dest, const void *buf, unsigned len, const char *file, unsigned line)
Definition: ip4_out.c:235
in_Header
Definition: wattcp.h:329
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip6.h Source File

  • inc
  • netinet
ip6.h
Go to the documentation of this file.
1
5/*
6 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34/*
35 * Copyright (c) 1982, 1986, 1993
36 * The Regents of the University of California. All rights reserved.
37 *
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
41 * 1. Redistributions of source code must retain the above copyright
42 * notice, this list of conditions and the following disclaimer.
43 * 2. Redistributions in binary form must reproduce the above copyright
44 * notice, this list of conditions and the following disclaimer in the
45 * documentation and/or other materials provided with the distribution.
46 * 3. All advertising materials mentioning features or use of this software
47 * must display the following acknowledgement:
48 * This product includes software developed by the University of
49 * California, Berkeley and its contributors.
50 * 4. Neither the name of the University nor the names of its contributors
51 * may be used to endorse or promote products derived from this software
52 * without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
55 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE.
65 */
66
67#ifndef _NETINET_IP6_H_
68#define _NETINET_IP6_H_
69
70/*
71 * Definition for internet protocol version 6.
72 * RFC 2460
73 */
74
75#ifndef __SYS_SOCKET_H
76#include <sys/socket.h>
77#endif
78
79W32_CLANG_PACK_WARN_OFF()
80
81#include <sys/pack_on.h>
82
83struct ip6_hdr {
84 union {
85 struct ip6_hdrctl {
86 u_int32_t ip6_un1_flow; /* 20 bits of flow-ID */
87 u_int16_t ip6_un1_plen; /* payload length */
88 u_int8_t ip6_un1_nxt; /* next header */
89 u_int8_t ip6_un1_hlim; /* hop limit */
90 } ip6_un1;
91 u_int8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */
92 } ip6_ctlun;
93 struct in6_addr ip6_src; /* source address */
94 struct in6_addr ip6_dst; /* destination address */
95 };
96
97#define ip6_vfc ip6_ctlun.ip6_un2_vfc
98#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
99#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
100#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
101#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
102#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
103
104#define IPV6_VERSION 0x60
105#define IPV6_VERSION_MASK 0xf0
106
107#if BYTE_ORDER == BIG_ENDIAN
108#define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */
109#define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */
110#else
111#if BYTE_ORDER == LITTLE_ENDIAN
112#define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */
113#define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */
114#endif /* LITTLE_ENDIAN */
115#endif
116
117#if 1
118 /* ECN bits proposed by Sally Floyd */
119 #define IP6TOS_CE 0x01 /* congestion experienced */
120 #define IP6TOS_ECT 0x02 /* ECN-capable transport */
121#endif
122
123/*
124 * Extension Headers
125 */
126
127struct ip6_ext {
128 u_int8_t ip6e_nxt;
129 u_int8_t ip6e_len;
130 };
131
132/* Hop-by-Hop options header */
133/* XXX should we pad it to force alignment on an 8-byte boundary? */
134struct ip6_hbh {
135 u_int8_t ip6h_nxt; /* next header */
136 u_int8_t ip6h_len; /* length in units of 8 octets */
137 /* followed by options */
138 };
139
140/* Destination options header */
141/* XXX should we pad it to force alignment on an 8-byte boundary? */
142struct ip6_dest {
143 u_int8_t ip6d_nxt; /* next header */
144 u_int8_t ip6d_len; /* length in units of 8 octets */
145 /* followed by options */
146 };
147
148/* Option types and related macros */
149#define IP6OPT_PAD1 0x00 /* 00 0 00000 */
150#define IP6OPT_PADN 0x01 /* 00 0 00001 */
151#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */
152#define IP6OPT_NSAP_ADDR 0xC3 /* 11 0 00011 */
153#define IP6OPT_TUNNEL_LIMIT 0x04 /* 00 0 00100 */
154#define IP6OPT_RTALERT 0x05 /* 00 0 00101 (KAME definition) */
155
156#define IP6OPT_RTALERT_LEN 4
157#define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */
158#define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */
159#define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */
160#define IP6OPT_MINLEN 2
161
162#define IP6OPT_BINDING_UPDATE 0xc6 /* 11 0 00110 */
163#define IP6OPT_BINDING_ACK 0x07 /* 00 0 00111 */
164#define IP6OPT_BINDING_REQ 0x08 /* 00 0 01000 */
165#define IP6OPT_HOME_ADDRESS 0xc9 /* 11 0 01001 */
166#define IP6OPT_EID 0x8a /* 10 0 01010 */
167
168#define IP6OPT_TYPE(o) ((o) & 0xC0)
169#define IP6OPT_TYPE_SKIP 0x00
170#define IP6OPT_TYPE_DISCARD 0x40
171#define IP6OPT_TYPE_FORCEICMP 0x80
172#define IP6OPT_TYPE_ICMP 0xC0
173
174#define IP6OPT_MUTABLE 0x20
175
176#define IP6OPT_JUMBO_LEN 6
177
178/* Routing header */
179struct ip6_rthdr {
180 u_int8_t ip6r_nxt; /* next header */
181 u_int8_t ip6r_len; /* length in units of 8 octets */
182 u_int8_t ip6r_type; /* routing type */
183 u_int8_t ip6r_segleft; /* segments left */
184 /* followed by routing type specific data */
185 };
186
187/* Type 0 Routing header */
188struct ip6_rthdr0 {
189 u_int8_t ip6r0_nxt; /* next header */
190 u_int8_t ip6r0_len; /* length in units of 8 octets */
191 u_int8_t ip6r0_type; /* always zero */
192 u_int8_t ip6r0_segleft; /* segments left */
193 u_int8_t ip6r0_reserved; /* reserved field */
194 u_int8_t ip6r0_slmap[3]; /* strict/loose bit map */
195 struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */
196 };
197
198/* Fragment header */
199struct ip6_frag {
200 u_int8_t ip6f_nxt; /* next header */
201 u_int8_t ip6f_reserved; /* reserved field */
202 u_int16_t ip6f_offlg; /* offset, reserved, and flag */
203 u_int32_t ip6f_ident; /* identification */
204 };
205
206#include <sys/pack_off.h>
207
208W32_CLANG_PACK_WARN_DEF()
209
210#if BYTE_ORDER == BIG_ENDIAN
211#define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
212#define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
213#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
214#else /* BYTE_ORDER == LITTLE_ENDIAN */
215#define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */
216#define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */
217#define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */
218#endif /* BYTE_ORDER == LITTLE_ENDIAN */
219
220/*
221 * Internet implementation parameters.
222 */
223#define IPV6_MAXHLIM 255 /* maximun hoplimit */
224#define IPV6_DEFHLIM 64 /* default hlim */
225#define IPV6_FRAGTTL 120 /* ttl for fragment packets, in slowtimo tick */
226#define IPV6_HLIMDEC 1 /* subtracted when forwaeding */
227
228#define IPV6_MMTU 1280 /* minimal MTU and reassembly. 1024 + 256 */
229#define IPV6_MAXPACKET 65535 /* ip6 max packet size without Jumbo payload*/
230
231#ifdef _KERNEL
232/*
233 * IP6_EXTHDR_CHECK ensures that region between the IP6 header and the
234 * target header (including IPv6 itself, extension headers and
235 * TCP/UDP/ICMP6 headers) are continuous. KAME requires drivers
236 * to store incoming data into one internal mbuf or one or more external
237 * mbufs(never into two or more internal mbufs). Thus, the third case is
238 * supposed to never be matched but is prepared just in case.
239 */
240
241#define IP6_EXTHDR_CHECK(m, off, hlen, ret) \
242do { \
243 if ((m)->m_next != NULL) { \
244 if (((m)->m_flags & M_LOOP) && \
245 ((m)->m_len < (off) + (hlen)) && \
246 (((m) = m_pullup((m), (off) + (hlen))) == NULL)) { \
247 ip6stat.ip6s_exthdrtoolong++; \
248 return ret; \
249 } else if ((m)->m_flags & M_EXT) { \
250 if ((m)->m_len < (off) + (hlen)) { \
251 ip6stat.ip6s_exthdrtoolong++; \
252 m_freem(m); \
253 return ret; \
254 } \
255 } else { \
256 if ((m)->m_len < (off) + (hlen)) { \
257 ip6stat.ip6s_exthdrtoolong++; \
258 m_freem(m); \
259 return ret; \
260 } \
261 } \
262 } else { \
263 if ((m)->m_len < (off) + (hlen)) { \
264 ip6stat.ip6s_tooshort++; \
265 in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_truncated); \
266 m_freem(m); \
267 return ret; \
268 } \
269 } \
270} while (0)
271
272/*
273 * IP6_EXTHDR_GET ensures that intermediate protocol header (from "off" to
274 * "len") is located in single mbuf, on contiguous memory region.
275 * The pointer to the region will be returned to pointer variable "val",
276 * with type "typ".
277 * IP6_EXTHDR_GET0 does the same, except that it aligns the structure at the
278 * very top of mbuf. GET0 is likely to make memory copy than GET.
279 *
280 * XXX we're now testing this, needs m_pulldown()
281 */
282#define IP6_EXTHDR_GET(val, typ, m, off, len) \
283do { \
284 struct mbuf *t; \
285 int tmp; \
286 if ((m)->m_len >= (off) + (len)) \
287 (val) = (typ)(mtod((m), caddr_t) + (off)); \
288 else { \
289 t = m_pulldown((m), (off), (len), &tmp); \
290 if (t) { \
291 if (t->m_len < tmp + (len)) \
292 panic("m_pulldown malfunction"); \
293 (val) = (typ)(mtod(t, caddr_t) + tmp); \
294 } else { \
295 (val) = (typ)NULL; \
296 (m) = NULL; \
297 } \
298 } \
299} while (0)
300
301#define IP6_EXTHDR_GET0(val, typ, m, off, len) \
302do { \
303 struct mbuf *t; \
304 if ((off) == 0) \
305 (val) = (typ)mtod(m, caddr_t); \
306 else { \
307 t = m_pulldown((m), (off), (len), NULL); \
308 if (t) { \
309 if (t->m_len < (len)) \
310 panic("m_pulldown malfunction"); \
311 (val) = (typ)mtod(t, caddr_t); \
312 } else { \
313 (val) = (typ)NULL; \
314 (m) = NULL; \
315 } \
316 } \
317} while (0)
318#endif /*_KERNEL*/
319
320#endif /* not _NETINET_IP6_H_ */
socket.h
pack_off.h
in6_addr
Definition: in.h:151
ip6_dest
Definition: ip6.h:142
ip6_ext
Definition: ip6.h:127
ip6_frag
Definition: ip6.h:199
ip6_hbh
Definition: ip6.h:134
ip6_rthdr0
Definition: ip6.h:188
ip6_rthdr
Definition: ip6.h:179


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ip6_ecn.h Source File

  • inc
  • netinet6
ip6_ecn.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1999 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * ECN consideration on tunnel ingress/egress operation.
33 * http://www.aciri.org/floyd/papers/draft-ipsec-ecn-00.txt
34 */
35#ifdef _KERNEL
36extern void ip6_ecn_ingress (int, u_int32_t *, const u_int32_t *);
37extern void ip6_ecn_egress (int, const u_int32_t *, u_int32_t *);
38#endif


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ip6_fw.h Source File

  • inc
  • netinet6
ip6_fw.h
Go to the documentation of this file.
1
5/*
6 * Copyright (C) 1998, 1999, 2000 and 2001 WIDE Project.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34/*
35 * Copyright (c) 1993 Daniel Boulet
36 * Copyright (c) 1994 Ugen J.S.Antsilevich
37 *
38 * Redistribution and use in source forms, with and without modification,
39 * are permitted provided that this entire comment appears intact.
40 *
41 * Redistribution in binary form may occur without any restrictions.
42 * Obviously, it would be nice if you gave credit where credit is due
43 * but requiring it would be too onerous.
44 *
45 * This software is provided ``AS IS'' without any warranties of any kind.
46 *
47 */
48
49#ifndef _IP6_FW_H
50#define _IP6_FW_H
51
52#include <net/if.h>
53
54/*
55 * This union structure identifies an interface, either explicitly
56 * by name or implicitly by IP address. The flags IP_FW_F_IIFNAME
57 * and IP_FW_F_OIFNAME say how to interpret this structure. An
58 * interface unit number of -1 matches any unit number, while an
59 * IP address of 0.0.0.0 indicates matches any interface.
60 *
61 * The receive and transmit interfaces are only compared against the
62 * the packet if the corresponding bit (IP_FW_F_IIFACE or IP_FW_F_OIFACE)
63 * is set. Note some packets lack a receive or transmit interface
64 * (in which case the missing "interface" never matches).
65 */
66
67union ip6_fw_if {
68 struct in6_addr fu_via_ip6; /* Specified by IPv6 address */
69 struct { /* Specified by interface name */
70#define IP6FW_IFNLEN IFNAMSIZ
71 char name[IP6FW_IFNLEN];
72 short unit; /* -1 means match any unit */
73 } fu_via_if;
74};
75
76/*
77 * Format of an IP firewall descriptor
78 *
79 * fw_src, fw_dst, fw_smsk, fw_dmsk are always stored in network byte order.
80 * fw_flg and fw_n*p are stored in host byte order (of course).
81 * Port numbers are stored in HOST byte order.
82 * Warning: setsockopt() will fail if sizeof(struct ip_fw) > MLEN (108)
83 */
84
85struct ip6_fw {
86 u_long fw_pcnt,fw_bcnt; /* Packet and byte counters */
87 struct in6_addr fw_src, fw_dst; /* Source and destination IPv6 addr */
88 struct in6_addr fw_smsk, fw_dmsk; /* Mask for src and dest IPv6 addr */
89 u_short fw_number; /* Rule number */
90 u_short fw_flg; /* Flags word */
91#define IPV6_FW_MAX_PORTS 10 /* A reasonable maximum */
92 u_int fw_ipflg; /* IP flags word */
93 u_short fw_pts[IPV6_FW_MAX_PORTS]; /* Array of port numbers to match */
94 u_char fw_ip6opt,fw_ip6nopt; /* IPv6 options set/unset */
95 u_char fw_tcpf,fw_tcpnf; /* TCP flags set/unset */
96#define IPV6_FW_ICMPTYPES_DIM (256 / (sizeof(unsigned) * 8))
97 unsigned fw_icmp6types[IPV6_FW_ICMPTYPES_DIM]; /* ICMP types bitmap */
98 long timestamp; /* timestamp (tv_sec) of last match */
99 union ip6_fw_if fw_in_if, fw_out_if;/* Incoming and outgoing interfaces */
100 union {
101 u_short fu_divert_port; /* Divert/tee port (options IP6DIVERT) */
102 u_short fu_skipto_rule; /* SKIPTO command rule number */
103 u_short fu_reject_code; /* REJECT response code */
104 } fw_un;
105 u_char fw_prot; /* IPv6 protocol */
106 u_char fw_nports; /* N'of src ports and # of dst ports */
107 /* in ports array (dst ports follow */
108 /* src ports; max of 10 ports in all; */
109 /* count of 0 means match all ports) */
110};
111
112#define IPV6_FW_GETNSRCP(rule) ((rule)->fw_nports & 0x0f)
113#define IPV6_FW_SETNSRCP(rule, n) do { \
114 (rule)->fw_nports &= ~0x0f; \
115 (rule)->fw_nports |= (n); \
116 } while (0)
117#define IPV6_FW_GETNDSTP(rule) ((rule)->fw_nports >> 4)
118#define IPV6_FW_SETNDSTP(rule, n) do { \
119 (rule)->fw_nports &= ~0xf0; \
120 (rule)->fw_nports |= (n) << 4;\
121 } while (0)
122
123#define fw_divert_port fw_un.fu_divert_port
124#define fw_skipto_rule fw_un.fu_skipto_rule
125#define fw_reject_code fw_un.fu_reject_code
126
127struct ip6_fw_chain {
128 LIST_ENTRY(ip6_fw_chain) chain;
129 struct ip6_fw *rule;
130};
131
132/*
133 * Values for "flags" field .
134 */
135#define IPV6_FW_F_IN 0x0001 /* Check inbound packets */
136#define IPV6_FW_F_OUT 0x0002 /* Check outbound packets */
137#define IPV6_FW_F_IIFACE 0x0004 /* Apply inbound interface test */
138#define IPV6_FW_F_OIFACE 0x0008 /* Apply outbound interface test */
139
140#define IPV6_FW_F_COMMAND 0x0070 /* Mask for type of chain entry: */
141#define IPV6_FW_F_DENY 0x0000 /* This is a deny rule */
142#define IPV6_FW_F_REJECT 0x0010 /* Deny and send a response packet */
143#define IPV6_FW_F_ACCEPT 0x0020 /* This is an accept rule */
144#define IPV6_FW_F_COUNT 0x0030 /* This is a count rule */
145#define IPV6_FW_F_DIVERT 0x0040 /* This is a divert rule */
146#define IPV6_FW_F_TEE 0x0050 /* This is a tee rule */
147#define IPV6_FW_F_SKIPTO 0x0060 /* This is a skipto rule */
148
149#define IPV6_FW_F_PRN 0x0080 /* Print if this rule matches */
150
151#define IPV6_FW_F_SRNG 0x0100 /* The first two src ports are a min *
152 * and max range (stored in host byte *
153 * order). */
154
155#define IPV6_FW_F_DRNG 0x0200 /* The first two dst ports are a min *
156 * and max range (stored in host byte *
157 * order). */
158
159#define IPV6_FW_F_IIFNAME 0x0400 /* In interface by name/unit (not IP) */
160#define IPV6_FW_F_OIFNAME 0x0800 /* Out interface by name/unit (not IP) */
161
162#define IPV6_FW_F_INVSRC 0x1000 /* Invert sense of src check */
163#define IPV6_FW_F_INVDST 0x2000 /* Invert sense of dst check */
164
165#define IPV6_FW_F_FRAG 0x4000 /* Fragment */
166
167#define IPV6_FW_F_ICMPBIT 0x8000 /* ICMP type bitmap is valid */
168
169#define IPV6_FW_F_MASK 0xFFFF /* All possible flag bits mask */
170
171/*
172 * Flags for the 'fw_ipflg' field, for comparing values of ip and its protocols. */
173#define IPV6_FW_IF_TCPEST 0x00000020 /* established TCP connection */
174#define IPV6_FW_IF_TCPMSK 0x00000020 /* mask of all TCP values */
175
176/*
177 * For backwards compatibility with rules specifying "via iface" but
178 * not restricted to only "in" or "out" packets, we define this combination
179 * of bits to represent this configuration.
180 */
181
182#define IF6_FW_F_VIAHACK (IPV6_FW_F_IN|IPV6_FW_F_OUT|IPV6_FW_F_IIFACE|IPV6_FW_F_OIFACE)
183
184/*
185 * Definitions for REJECT response codes.
186 * Values less than 256 correspond to ICMP unreachable codes.
187 */
188#define IPV6_FW_REJECT_RST 0x0100 /* TCP packets: send RST */
189
190/*
191 * Definitions for IPv6 option names.
192 */
193#define IPV6_FW_IP6OPT_HOPOPT 0x01
194#define IPV6_FW_IP6OPT_ROUTE 0x02
195#define IPV6_FW_IP6OPT_FRAG 0x04
196#define IPV6_FW_IP6OPT_ESP 0x08
197#define IPV6_FW_IP6OPT_AH 0x10
198#define IPV6_FW_IP6OPT_NONXT 0x20
199#define IPV6_FW_IP6OPT_OPTS 0x40
200
201/*
202 * Definitions for TCP flags.
203 */
204#define IPV6_FW_TCPF_FIN TH_FIN
205#define IPV6_FW_TCPF_SYN TH_SYN
206#define IPV6_FW_TCPF_RST TH_RST
207#define IPV6_FW_TCPF_PSH TH_PUSH
208#define IPV6_FW_TCPF_ACK TH_ACK
209#define IPV6_FW_TCPF_URG TH_URG
210
211/*
212 * Main firewall chains definitions and global var's definitions.
213 */
214#ifdef _KERNEL
215#ifndef __SYS_MBUF_H
216#include <sys/mbuf.h>
217#endif
218
219/*
220 * Function definitions.
221 */
222void ip6_fw_init(void);
223
224/* Firewall hooks */
225struct ip6_hdr;
226typedef int ip6_fw_chk_t (struct ip6_hdr**, struct ifnet*, u_short *, struct mbuf**);
227typedef int ip6_fw_ctl_t (int, struct mbuf**);
228extern ip6_fw_chk_t *ip6_fw_chk_ptr;
229extern ip6_fw_ctl_t *ip6_fw_ctl_ptr;
230extern int ip6_fw_enable;
231
232#endif /* _KERNEL */
233
234#endif /* _IP6_FW_H */
if.h
ifnet
Definition: if.h:136
in6_addr
Definition: in.h:151
ip6_fw_chain
Definition: ip6_fw.h:127
ip6_fw
Definition: ip6_fw.h:85
mbuf
Definition: mbuf.h:6
ip6_fw_if
Definition: ip6_fw.h:67


Watt-32 tcp/ip: E:/WATT/src/ip6_in.c Source File

  • src
ip6_in.c
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Gisle Vanem
19 * Bergen, Norway.
20 *
21 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 * Version
33 *
34 * 0.5 : Jul 29, 2002 : G. Vanem - created
35 *
36 */
37
38#include <stdio.h>
39#include <stdlib.h>
40#include <arpa/inet.h>
41
42#include "wattcp.h"
43#include "misc.h"
44#include "misc_str.h"
45#include "chksum.h"
46#include "language.h"
47#include "sock_ini.h"
48#include "split.h"
49#include "pctcp.h"
50#include "pcsed.h"
51#include "pcstat.h"
52#include "pcdbug.h"
53#include "pcpkt.h"
54#include "pcconfig.h"
55#include "pcicmp6.h"
56#include "bsddbug.h"
57#include "netaddr.h"
58#include "get_xby.h"
59#include "ip6_out.h"
60#include "ip6_in.h"
61
62/* \if USE_IPV6 */
63#if defined(USE_IPV6)
64
65/*
66 * _ip6_handler - do a simple check on IPv6 header
67 * - Demultiplex packet to correct protocol handler
68 */
69int _ip6_handler (const in6_Header *ip, BOOL broadcast)
70{
71 const struct pkt_split *ps;
72
73 if (block_ip)
74 return (0);
75
76 if (ip->ver != 6)
77 {
78 DEBUG_RX (NULL, ip);
79 STAT (ip6stats.ip6s_badvers++);
80 return (0);
81 }
82
83 /* Match 'ip' against all SOCK_RAW sockets before doing normal
84 * protocol multiplexing below.
85 */
86 if (_bsd_socket_hook)
87 (*_bsd_socket_hook) (BSO_IP6_RAW, ip);
88
89 for (ps = pkt_get_split_in(); ps->data; ps++)
90 switch (ps->type)
91 {
92 case TYPE_TOKEN_HEAD:
93 case TYPE_FDDI_HEAD:
94 case TYPE_ETHER_HEAD:
95 case TYPE_IP6:
96 break;
97
98 case TYPE_TCP_HEAD:
99 _tcp_handler ((const in_Header*)ip, broadcast);
100 break;
101
102 case TYPE_UDP_HEAD:
103 _udp_handler ((const in_Header*)ip, broadcast);
104 break;
105
106 case TYPE_IP6_ICMP:
107 icmp6_handler (ip);
108 break;
109
110 case TYPE_IP6_NONE:
111 break;
112
113 case TYPE_IP6_UNSUPP:
114#if defined(USE_DEBUG)
115 dbug_printf ("Received unsupported IPv6 message, next-hdr %d,"
116 " broadcast %d\n", ip->next_hdr, broadcast);
117#endif
118 break;
119
120 default:
121 DEBUG_RX (NULL, ip);
122 if ((ps->type >= TYPE_IP6_HOP && ps->type <= TYPE_IP6_DEST) &&
123 !broadcast)
124 {
125 if (IN6_IS_ADDR_LINKLOCAL(&ip->destination))
126 icmp6_unreach (ip, 2); /* protocol unreachable */
127 STAT (ip6stats.ip6s_cantforward++);
128 }
129 break;
130 }
131
132#if 0
133 if (ip->next_hdr != IP6_NEXT_ICMP) /* !! bug hunt */
134 dbug_printf ("IP6 packet, next-hdr %d, brdcast %d\n",
135 ip->next_hdr, broadcast);
136#endif
137
138 STAT (ip6stats.ip6s_delivered++);
139 return (1);
140}
141
142/*
143 * Return TRUE if IPv6 address is a local address or on the
144 * loopback network (::1).
145 */
146int _ip6_is_local_addr (const void *ip)
147{
148 if (!memcmp(&in6addr_my_ip,ip,sizeof(in6addr_my_ip)) ||
149 !memcmp(&in6addr_loopback,ip,sizeof(in6addr_loopback)))
150 return (1);
151 return (0);
152}
153
154#ifdef NOT_USED /* use IN6_xx macros in <netinet/in.h> instead */
155/*
156 * Return true if address has a IPv4 prefix (0:0:0:0:0:FFFF)
157 */
158static WORD v4_prefix[6] = { 0,0,0,0,0,0xFFFF };
159
160int _ip6_is_addr_v4mapped (const void *ip)
161{
162 if (!memcmp(ip,&v4_prefix,sizeof(v4_prefix)))
163 return (1);
164 return (0);
165}
166
167int _ip6_is_addr_loopback (const void *ip)
168{
169 if (!memcmp(ip,&in6addr_loopback,sizeof(in6addr_loopback)))
170 return (1);
171 return (0);
172}
173#endif /* NOT_USED */
174
175
176static void (W32_CALL *prev_hook) (const char*, const char*) = NULL;
177
178static void set_my_ip6 (const char *value)
179{
180 if (!stricmp(value,"dhcp") || !stricmp(value,"dhcp6"))
181 _dhcp6_on = 1;
182 else if (!inet_pton(AF_INET6, value, (void*)&in6addr_my_ip))
183 printf (_LANG("\"IP6.MY_IP\": Invalid IPv6 address \"%s\"\n"), value);
184}
185
186static void W32_CALL ip6_config (const char *name, const char *value)
187{
188 static const struct config_table ip6_cfg[] = {
189 { "MY_IP", ARG_FUNC, (void*)set_my_ip6 },
190 { "6TO4_GATEWAY", ARG_ATOIP, (void*)&icmp6_6to4_gateway },
191 { "DEF_TTL", ARG_ATOI, (void*)&_default6_ttl },
192 { NULL, 0, NULL }
193 };
194 if (!parse_config_table(&ip6_cfg[0], "IP6.", name, value) && prev_hook)
195 (*prev_hook) (name, value);
196}
197
198int _ip6_init (void)
199{
200 prev_hook = usr_init;
201 usr_init = ip6_config;
202 return (1);
203}
204
205/*
206 * Sets default (preferred link-local) IPv6 address to
207 * FE80::201:80FF:FE <last 3 bytes of MAC-address>
208 */
209static void set_default_ip (void)
210{
211 BYTE *a = (BYTE*) &in6addr_my_ip.s6_addr[0];
212
213 memset (a, 0, sizeof(in6addr_my_ip));
214 a[0] = 0xFE;
215 a[1] = 0x80;
216 a[8] = 0x20;
217 a[9] = 0x01;
218 a[10] = 0x80;
219 a[11] = 0xFF;
220 a[12] = 0xFE;
221 a[13] = _eth_real_addr[3];
222 a[14] = _eth_real_addr[4];
223 a[15] = _eth_real_addr[5];
224}
225
226/*
227 * Called from socket.c only (I.e. IPv6 requires BSD-sockets. Core
228 * API cannot be used for IPv6).
229 */
230int _ip6_pkt_init (void)
231{
232 if (!memcmp(&in6addr_my_ip,&in6addr_any,sizeof(in6addr_my_ip)))
233 set_default_ip();
234
235 if (_pktserial) /* IPv6 cannot work on any known serial drivers */
236 return (0);
237
238 /* Ignore result, not much we can do if it fails anyway.
239 */
240 if (_pkt_rxmode < RXMODE_MULTICAST2) /* if not already set */
241 return pkt_set_rcv_mode (RXMODE_MULTICAST2);
242 return (1); /* promiscous mode is okay */
243}
244
245/*
246 * Called from sock_ini.c after config read
247 */
248void _ip6_post_init (void)
249{
250 if (icmp6_6to4_gateway)
251 icmp6_add_gateway4();
252}
253#endif /* USE_IPV6 */
254/* \endif */
bsddbug.h
chksum.h
get_xby.h
inet.h
ip6_in.h
ip6_out.h
language.h
misc.h
misc_str.h
netaddr.h
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
pcconfig.h
pcdbug.h
pcicmp6.h
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
_pkt_rxmode
int _pkt_rxmode
active receive mode
Definition: pcpkt.c:53
pkt_set_rcv_mode
int pkt_set_rcv_mode(int mode)
Sets the receive mode of the interface.
Definition: pcpkt.c:1953
pcpkt.h
RXMODE_MULTICAST2
@ RXMODE_MULTICAST2
BROADCAST + all multicast
Definition: pcpkt.h:113
_eth_real_addr
mac_address _eth_real_addr
Our real MAC address.
Definition: pcsed.c:52
pcsed.h
pcstat.h
block_ip
BOOL block_ip
when application handles IP itself
Definition: pctcp.c:67
_tcp_handler
_tcp_Socket * _tcp_handler(const in_Header *ip, BOOL broadcast)
The main TCP input handler.
Definition: pctcp.c:649
_udp_handler
_udp_Socket * _udp_handler(const in_Header *ip, BOOL broadcast)
Handler for incoming UDP packets.
Definition: pctcp.c:1042
pctcp.h
inet_pton
int W32_CALL inet_pton(int af, const char *src, void *dst)
Convert from presentation format (which usually means ASCII printable) to network format (which is us...
Definition: presaddr.c:73
_dhcp6_on
BOOL _dhcp6_on
Try booting using DHCP6 ?
Definition: sock_ini.c:131
sock_ini.h
split.h
config_table
Definition: tcp.h:461
in6_Header
Definition: wattcp.h:381
in_Header
Definition: wattcp.h:329
pkt_split
Definition: split.h:46
ARG_ATOIP
@ ARG_ATOIP
convert to ip-address (host order)
Definition: tcp.h:451
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/ip6_in.h Source File

  • src
ip6_in.h
Go to the documentation of this file.
1
3#ifndef _w32_IP6_IN_H
4#define _w32_IP6_IN_H
5
6/*
7 * `struct in6_Header::next_hdr' field.
8 */
9#define IP6_NEXT_HOP 0 /* Hop-by-hop option header */
10#define IP6_NEXT_TCP 6 /* TCP segment */
11#define IP6_NEXT_UDP 17 /* UDP message */
12#define IP6_NEXT_IPV6 41 /* IPv6 in IPv6 */
13#define IP6_NEXT_ROUTING 43 /* Routing header */
14#define IP6_NEXT_FRAGMENT 44 /* Fragmentation/reassembly header */
15#define IP6_NEXT_ESP 50 /* Encapsulating security payload */
16#define IP6_NEXT_AUTH 51 /* Authentication header */
17#define IP6_NEXT_ICMP 58 /* ICMP for IPv6 */
18#define IP6_NEXT_NONE 59 /* No next header */
19#define IP6_NEXT_DEST 60 /* Destination options header */
20#define IP6_NEXT_COMP 108 /* Compression options header */
21#define IP6_NEXT_SCTP 132 /* Stream Control Transfer Protocol */
22
23typedef struct ip6_RouteHdr {
24 BYTE next_hdr;
25 BYTE hdrlen;
26 BYTE type;
27 BYTE seg_left;
28 } ip6_RouteHdr;
29
30#if defined(USE_IPV6)
31 extern int _ip6_handler (const in6_Header *ip, BOOL broadcast);
32 extern int _ip6_init (void);
33 extern int _ip6_pkt_init (void);
34 extern void _ip6_post_init (void);
35 extern int _ip6_is_local_addr (const void *ip);
36#endif /* USE_IPV6 */
37#endif
in6_Header
Definition: wattcp.h:381
ip6_RouteHdr
Definition: ip6_in.h:23


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ip6_mrou.h Source File

  • inc
  • netinet6
ip6_mrou.h
Go to the documentation of this file.
1
5/*
6 * Copyright (C) 1998 WIDE Project.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34/*
35 * Definitions for IP multicast forwarding.
36 *
37 * Written by David Waitzman, BBN Labs, August 1988.
38 * Modified by Steve Deering, Stanford, February 1989.
39 * Modified by Ajit Thyagarajan, PARC, August 1993.
40 * Modified by Ajit Thyagarajan, PARC, August 1994.
41 * Modified by Ahmed Helmy, USC, September 1996.
42 *
43 * MROUTING Revision: 1.2
44 */
45
46#ifndef _NETINET6_IP6_MROUTE_H_
47#define _NETINET6_IP6_MROUTE_H_
48
49#ifndef __SYS_MBUF_H
50#include <sys/mbuf.h>
51#endif
52
53/*
54 * Multicast Routing set/getsockopt commands.
55 */
56#ifdef _KERNEL
57#define MRT6_OINIT 100 /* initialize forwarder (omrt6msg) */
58#endif
59#define MRT6_DONE 101 /* shut down forwarder */
60#define MRT6_ADD_MIF 102 /* add multicast interface */
61#define MRT6_DEL_MIF 103 /* delete multicast interface */
62#define MRT6_ADD_MFC 104 /* insert forwarding cache entry */
63#define MRT6_DEL_MFC 105 /* delete forwarding cache entry */
64#define MRT6_PIM 107 /* enable pim code */
65#define MRT6_INIT 108 /* initialize forwarder (mrt6msg) */
66
67#undef GET_TIME
68
69#if BSD >= 199103
70 #define GET_TIME(t) microtime(&t)
71#elif defined(sun)
72 #define GET_TIME(t) uniqtime(&t)
73#else
74 #define GET_TIME(t) ((t) = time)
75#endif
76
77/*
78 * Types and macros for handling bitmaps with one bit per multicast interface.
79 */
80typedef u_short mifi_t; /* type of a mif index */
81#define MAXMIFS 64
82
83#ifndef IF_SETSIZE
84#define IF_SETSIZE 256
85#endif
86
87typedef u_int32_t if_mask;
88#define NIFBITS (sizeof(if_mask) * NBBY) /* bits per mask */
89
90#ifndef howmany
91#define howmany(x, y) (((x) + ((y) - 1)) / (y))
92#endif
93
94typedef struct if_set {
95 if_mask ifs_bits[howmany(IF_SETSIZE, NIFBITS)];
96} if_set;
97
98#define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
99#define IF_CLR(n, p) ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))
100#define IF_ISSET(n, p) ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))
101#define IF_COPY(f, t) bcopy(f, t, sizeof(*(f)))
102#define IF_ZERO(p) bzero(p, sizeof(*(p)))
103
104/*
105 * Argument structure for MRT6_ADD_IF.
106 */
107struct mif6ctl {
108 mifi_t mif6c_mifi; /* the index of the mif to be added */
109 u_char mif6c_flags; /* MIFF_ flags defined below */
110 u_short mif6c_pifi; /* the index of the physical IF */
111#ifdef notyet
112 u_int mif6c_rate_limit; /* max rate */
113#endif
114};
115
116#define MIFF_REGISTER 0x1 /* mif represents a register end-point */
117
118/*
119 * Argument structure for MRT6_ADD_MFC and MRT6_DEL_MFC
120 */
121struct mf6cctl {
122 struct sockaddr_in6 mf6cc_origin; /* IPv6 origin of mcasts */
123 struct sockaddr_in6 mf6cc_mcastgrp; /* multicast group associated */
124 mifi_t mf6cc_parent; /* incoming ifindex */
125 struct if_set mf6cc_ifset; /* set of forwarding ifs */
126};
127
128/*
129 * The kernel's multicast routing statistics.
130 */
131struct mrt6stat {
132 u_quad_t mrt6s_mfc_lookups; /* # forw. cache hash table hits */
133 u_quad_t mrt6s_mfc_misses; /* # forw. cache hash table misses */
134 u_quad_t mrt6s_upcalls; /* # calls to mrouted */
135 u_quad_t mrt6s_no_route; /* no route for packet's origin */
136 u_quad_t mrt6s_bad_tunnel; /* malformed tunnel options */
137 u_quad_t mrt6s_cant_tunnel; /* no room for tunnel options */
138 u_quad_t mrt6s_wrong_if; /* arrived on wrong interface */
139 u_quad_t mrt6s_upq_ovflw; /* upcall Q overflow */
140 u_quad_t mrt6s_cache_cleanups; /* # entries with no upcalls */
141 u_quad_t mrt6s_drop_sel; /* pkts dropped selectively */
142 u_quad_t mrt6s_q_overflow; /* pkts dropped - Q overflow */
143 u_quad_t mrt6s_pkt2large; /* pkts dropped - size > BKT SIZE */
144 u_quad_t mrt6s_upq_sockfull; /* upcalls dropped - socket full */
145};
146
147#ifdef MRT6_OINIT
148/*
149 * Struct used to communicate from kernel to multicast router
150 * note the convenient similarity to an IPv6 header.
151 * XXX old version, superseded by mrt6msg.
152 */
153struct omrt6msg {
154 u_long unused1;
155 u_char im6_msgtype; /* what type of message */
156#if 0
157#define MRT6MSG_NOCACHE 1
158#define MRT6MSG_WRONGMIF 2
159#define MRT6MSG_WHOLEPKT 3 /* used for user level encap*/
160#endif
161 u_char im6_mbz; /* must be zero */
162 u_char im6_mif; /* mif rec'd on */
163 u_char unused2;
164 struct in6_addr im6_src, im6_dst;
165};
166#endif
167
168/*
169 * Structure used to communicate from kernel to multicast router.
170 * We'll overlay the structure onto an MLD header (not an IPv6 header
171 * like igmpmsg{} used for IPv4 implementation). This is because this
172 * structure will be passed via an IPv6 raw socket, on which an application
173 * will only receive the payload i.e. the data after the IPv6 header and all
174 * the extension headers. (see Section 3 of draft-ietf-ipngwg-2292bis-01)
175 */
176struct mrt6msg {
177#define MRT6MSG_NOCACHE 1
178#define MRT6MSG_WRONGMIF 2
179#define MRT6MSG_WHOLEPKT 3 /* used for user level encap*/
180 u_char im6_mbz; /* must be zero */
181 u_char im6_msgtype; /* what type of message */
182 u_int16_t im6_mif; /* mif rec'd on */
183 u_int32_t im6_pad; /* padding for 64bit arch */
184 struct in6_addr im6_src, im6_dst;
185};
186
187/*
188 * Argument structure used by multicast routing daemon to get src-grp
189 * packet counts
190 */
191struct sioc_sg_req6 {
192 struct sockaddr_in6 src;
193 struct sockaddr_in6 grp;
194 u_quad_t pktcnt;
195 u_quad_t bytecnt;
196 u_quad_t wrong_if;
197};
198
199/*
200 * Argument structure used by mrouted to get mif pkt counts
201 */
202struct sioc_mif_req6 {
203 mifi_t mifi; /* mif number */
204 u_quad_t icount; /* Input packet count on mif */
205 u_quad_t ocount; /* Output packet count on mif */
206 u_quad_t ibytes; /* Input byte count on mif */
207 u_quad_t obytes; /* Output byte count on mif */
208};
209
210#if defined(_KERNEL) || defined(KERNEL)
211/*
212 * The kernel's multicast-interface structure.
213 */
214struct mif6 {
215 u_char m6_flags; /* MIFF_ flags defined above */
216 u_int m6_rate_limit; /* max rate */
217#ifdef notyet
218 struct tbf *m6_tbf; /* token bucket structure at intf. */
219#endif
220 struct in6_addr m6_lcl_addr; /* local interface address */
221 struct ifnet *m6_ifp; /* pointer to interface */
222 u_quad_t m6_pkt_in; /* # pkts in on interface */
223 u_quad_t m6_pkt_out; /* # pkts out on interface */
224 u_quad_t m6_bytes_in; /* # bytes in on interface */
225 u_quad_t m6_bytes_out; /* # bytes out on interface */
226 struct route_in6 m6_route;/* cached route if this is a tunnel */
227#ifdef notyet
228 u_int m6_rsvp_on; /* RSVP listening on this vif */
229 struct socket *m6_rsvpd; /* RSVP daemon socket */
230#endif
231};
232
233/*
234 * The kernel's multicast forwarding cache entry structure
235 */
236struct mf6c {
237 struct sockaddr_in6 mf6c_origin; /* IPv6 origin of mcasts */
238 struct sockaddr_in6 mf6c_mcastgrp; /* multicast group associated*/
239 mifi_t mf6c_parent; /* incoming IF */
240 struct if_set mf6c_ifset; /* set of outgoing IFs */
241
242 u_quad_t mf6c_pkt_cnt; /* pkt count for src-grp */
243 u_quad_t mf6c_byte_cnt; /* byte count for src-grp */
244 u_quad_t mf6c_wrong_if; /* wrong if for src-grp */
245 int mf6c_expire; /* time to clean entry up */
246 struct timeval mf6c_last_assert; /* last time I sent an assert*/
247 struct rtdetq *mf6c_stall; /* pkts waiting for route */
248 struct mf6c *mf6c_next; /* hash table linkage */
249};
250
251#define MF6C_INCOMPLETE_PARENT ((mifi_t)-1)
252
253/*
254 * Argument structure used for pkt info. while upcall is made
255 */
256#ifndef __NETINET_IP_MROUTE_H
257struct rtdetq { /* XXX: rtdetq is also defined in ip_mroute.h */
258 struct mbuf *m; /* A copy of the packet */
259 struct ifnet *ifp; /* Interface pkt came in on */
260#ifdef UPCALL_TIMING
261 struct timeval t; /* Timestamp */
262#endif
263 struct rtdetq *next;
264};
265#endif /* __NETINET_IP_MROUTE_H */
266
267#define MF6CTBLSIZ 256
268#if (MF6CTBLSIZ & (MF6CTBLSIZ - 1)) == 0 /* from sys:route.h */
269#define MF6CHASHMOD(h) ((h) & (MF6CTBLSIZ - 1))
270#else
271#define MF6CHASHMOD(h) ((h) % MF6CTBLSIZ)
272#endif
273
274#define MAX_UPQ6 4 /* max. no of pkts in upcall Q */
275
276int ip6_mrouter_set (struct socket *so, struct sockopt *sopt);
277int ip6_mrouter_get (struct socket *so, struct sockopt *sopt);
278int ip6_mrouter_done (void);
279int mrt6_ioctl (int, caddr_t);
280#endif /* _KERNEL */
281
282#endif /* !_NETINET6_IP6_MROUTE_H_ */
if_set
Definition: ip6_mrou.h:94
ifnet
Definition: if.h:136
in6_addr
Definition: in.h:151
mbuf
Definition: mbuf.h:6
mf6c
Definition: ip6_mrou.h:236
mf6cctl
Definition: ip6_mrou.h:121
mif6
Definition: ip6_mrou.h:214
mif6ctl
Definition: ip6_mrou.h:107
mrt6msg
Definition: ip6_mrou.h:176
mrt6stat
Definition: ip6_mrou.h:131
omrt6msg
Definition: ip6_mrou.h:153
route_in6
Definition: in6.h:287
rtdetq
Definition: ip_mrout.h:220
sioc_mif_req6
Definition: ip6_mrou.h:202
sioc_sg_req6
Definition: ip6_mrou.h:191
sockaddr_in6
Definition: in.h:231
socket
Definition: if.h:82
tbf
Definition: ip_mrout.h:248
timeval
Definition: wtime.h:30


Watt-32 tcp/ip: E:/WATT/src/ip6_out.c Source File

  • src
ip6_out.c
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Gisle Vanem
19 * Bergen, Norway.
20 *
21 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 * Version
33 *
34 * 0.5 : Jul 29, 2002 : G. Vanem - created
35 *
36 */
37
38#include <stdio.h>
39#include <stdlib.h>
40
41#include "wattcp.h"
42#include "misc.h"
43#include "chksum.h"
44#include "pcsed.h"
45#include "ip4_out.h"
46#include "ip6_out.h"
47#include "socket.h"
48
49/* \if USE_IPV6 */
50#if defined(USE_IPV6)
51
52W32_GCC_PRAGMA (GCC diagnostic push)
53W32_GCC_PRAGMA (GCC diagnostic ignored "-Wmissing-braces")
54
55struct in6_addr in6addr_my_ip = {{ 0,0,0,0,0,0,0,0,
56 0,0,0,0,0,0,0,0 }};
57
58const struct in6_addr in6addr_loopback = {{ 0,0,0,0,0,0,0,0,
59 0,0,0,0,0,0,0,1 }};
60const struct in6_addr in6addr_any = {{ 0,0,0,0,0,0,0,0,
61 0,0,0,0,0,0,0,0 }};
62const struct in6_addr in6addr_all_1 = {{ 0xFF,0xFF,0xFF,0xFF,
63 0xFF,0xFF,0xFF,0xFF,
64 0xFF,0xFF,0xFF,0xFF,
65 0xFF,0xFF,0xFF,0xFF }};
66/* all nodes multicast address */
67const struct in6_addr in6addr_alln_mc = {{ 0xFF,2,0,0,0,0,0,0,
68 0,0,0,0,0,0,0,1 }};
69/* all routers multicast address */
70const struct in6_addr in6addr_allr_mc = {{ 0xFF,2,0,0,0,0,0,0,
71 0,0,0,0,0,0,0,2 }};
72
73const BYTE in6addr_mapped[12] = { 0,0,0,0, 0,0,0,0, 0,0,0xFF,0xFF };
74
75W32_GCC_PRAGMA (GCC diagnostic pop)
76
77int _default6_ttl = 255; /* TTL on outgoing packets */
78
79int _ip6_output (in6_Header *ip, /* IPv6-structure to fill in */
80 ip6_address *src_ip, /* Source address */
81 ip6_address *dst_ip, /* Destination address */
82 BYTE protocol, /* Upper-level protocol */
83 unsigned data_len, /* Length of data after IPv6 header */
84 int hop_lim, /* Hop limit, 0 means default */
85 const void *sock, /* Which socket is this */
86 const char *file, /* Debug: from what file */
87 unsigned line) /* and line we where called */
88{
89 unsigned total = data_len + sizeof(*ip);
90
91 if (total > _mtu)
92 return (0);
93
94 if (!src_ip)
95 src_ip = (ip6_address*)&in6addr_my_ip;
96
97 ip->pri = 0;
98 ip->ver = 6;
99 ip->len = intel16 ((WORD)data_len);
100 ip->hop_limit = hop_lim ? hop_lim : _default6_ttl;
101
102 if (protocol == 0 || data_len == 0) /* Only an IP6 header */
103 ip->next_hdr = IP6_NEXT_NONE;
104 else ip->next_hdr = protocol;
105
106 memset (&ip->flow_lbl, 0, sizeof(ip->flow_lbl));
107
108 if (&ip->source != src_ip) /* assumes ptr set by caller */
109 memcpy (&ip->source, src_ip, sizeof(ip->source));
110
111 if (&ip->destination != dst_ip)
112 memcpy (&ip->destination, dst_ip, sizeof(ip->destination));
113
114 if (IN6_IS_ADDR_LOOPBACK(&ip->destination) ||
115 IN6_IS_ADDR_MULTICAST(&ip->source))
116 return (0);
117
120 return _eth_send (total, sock, file, line);
121}
122#endif /* USE_IPV6 */
123/* \endif */
chksum.h
ip4_out.h
_ip6_output
int _ip6_output(in6_Header *ip, ip6_address *src_ip, ip6_address *dst_ip, BYTE protocol, unsigned data_len, int hop_lim, const void *sock, const char *file, unsigned line)
Definition: ip6_out.c:79
ip6_out.h
misc.h
_eth_send
int W32_CALL _eth_send(WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
Definition: pcsed.c:301
pcsed.h
in6_Header
Definition: wattcp.h:381
in6_addr
Definition: in.h:151
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/ip6_out.h Source File

  • src
ip6_out.h
Go to the documentation of this file.
1
3#ifndef _w32_IP6_OUTPUT_H
4#define _w32_IP6_OUTPUT_H
5
6#ifndef __NETINET_IN_H
7#include <netinet/in.h> /* struct in6_addr */
8#endif
9
10#if defined(USE_IPV6)
11
12W32_DATA struct in6_addr in6addr_my_ip;
13
14extern const struct in6_addr in6addr_all_1;
15extern const struct in6_addr in6addr_alln_mc;
16extern const struct in6_addr in6addr_allr_mc;
17extern const BYTE in6addr_mapped[12];
18
19extern int _default6_ttl;
20
21extern int _ip6_output (in6_Header *ip, ip6_address *src_ip,
22 ip6_address *dst_ip, BYTE next_hdr,
23 unsigned data_len, int hop_lim, const void *sock,
24 const char *file, unsigned line);
25
26#define IP6_OUTPUT(ip, src, dst, next_hdr, data_len, hop_lim, sock) \
27 _ip6_output(ip, src, dst, next_hdr, data_len, hop_lim, sock, \
28 __FILE__, __LINE__)
29
30#endif /* USE_IPV6 */
31#endif
32
in.h
_ip6_output
int _ip6_output(in6_Header *ip, ip6_address *src_ip, ip6_address *dst_ip, BYTE next_hdr, unsigned data_len, int hop_lim, const void *sock, const char *file, unsigned line)
Definition: ip6_out.c:79
in6_Header
Definition: wattcp.h:381
in6_addr
Definition: in.h:151


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ip6_var.h Source File

  • inc
  • netinet6
ip6_var.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * Copyright (c) 1982, 1986, 1993
35 * The Regents of the University of California. All rights reserved.
36 *
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
39 * are met:
40 * 1. Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * 2. Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in the
44 * documentation and/or other materials provided with the distribution.
45 * 3. All advertising materials mentioning features or use of this software
46 * must display the following acknowledgement:
47 * This product includes software developed by the University of
48 * California, Berkeley and its contributors.
49 * 4. Neither the name of the University nor the names of its contributors
50 * may be used to endorse or promote products derived from this software
51 * without specific prior written permission.
52 *
53 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
54 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
57 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * SUCH DAMAGE.
64 */
65
66#ifndef _NETINET6_IP6_VAR_H_
67#define _NETINET6_IP6_VAR_H_
68
69#ifndef __SYS_QUEUE_H
70#include <sys/queue.h>
71#endif
72
73#ifndef __SYS_MBUF_H
74#include <sys/mbuf.h>
75#endif
76
77#if !defined(__BORLANDC__) /* stop warnings for undefined structs */
78/*
79 * IP6 reassembly queue structure. Each fragment
80 * being reassembled is attached to one of these structures.
81 */
82struct ip6q {
83 u_int32_t ip6q_head;
84 u_int16_t ip6q_len;
85 u_int8_t ip6q_nxt; /* ip6f_nxt in first fragment */
86 u_int8_t ip6q_hlim;
87 struct ip6asfrag *ip6q_down;
88 struct ip6asfrag *ip6q_up;
89 u_int32_t ip6q_ident;
90 u_int8_t ip6q_arrive;
91 u_int8_t ip6q_ttl;
92 struct in6_addr ip6q_src, ip6q_dst;
93 struct ip6q *ip6q_next;
94 struct ip6q *ip6q_prev;
95 int ip6q_unfrglen; /* len of unfragmentable part */
96#ifdef notyet
97 u_char *ip6q_nxtp;
98#endif
99};
100
101struct ip6asfrag {
102 u_int32_t ip6af_head;
103 u_int16_t ip6af_len;
104 u_int8_t ip6af_nxt;
105 u_int8_t ip6af_hlim;
106
107 /* must not override the above members during reassembling
108 */
109 struct ip6asfrag *ip6af_down;
110 struct ip6asfrag *ip6af_up;
111 struct mbuf *ip6af_m;
112 int ip6af_offset; /* offset in ip6af_m to next header */
113 int ip6af_frglen; /* fragmentable part length */
114 int ip6af_off; /* fragment offset */
115 u_int16_t ip6af_mff; /* more fragment bit in frag off */
116};
117
118#define IP6_REASS_MBUF(ip6af) (*(struct mbuf **)&((ip6af)->ip6af_m))
119
120struct ip6_moptions {
121 struct ifnet *im6o_multicast_ifp; /* ifp for outgoing multicasts */
122 u_char im6o_multicast_hlim; /* hoplimit for outgoing multicasts */
123 u_char im6o_multicast_loop; /* 1 >= hear sends if a member */
124 LIST_HEAD(dummy, in6_multi_mship) im6o_memberships;
125};
126#endif /* __BORLANDC__ */
127
128#ifndef _NETINET6_IN6_H_
129struct route_in6 {
130 struct rtentry *ro_rt;
131 struct sockaddr_in6 ro_dst;
132};
133#endif
134
135/*
136 * Control options for outgoing packets
137 */
138
139/* Routing header related info */
140#if !defined(__BORLANDC__)
141struct ip6po_rhinfo {
142 struct ip6_rthdr *ip6po_rhi_rthdr; /* Routing header */
143 struct route_in6 ip6po_rhi_route; /* Route to the 1st hop */
144};
145#define ip6po_rthdr ip6po_rhinfo.ip6po_rhi_rthdr
146#define ip6po_route ip6po_rhinfo.ip6po_rhi_route
147
148struct ip6_pktopts {
149 struct mbuf *ip6po_m; /* Pointer to mbuf storing the data */
150 int ip6po_hlim; /* Hoplimit for outgoing packets */
151
152 /* Outgoing IF/address information */
153 struct in6_pktinfo *ip6po_pktinfo;
154
155 struct sockaddr *ip6po_nexthop; /* Next-hop address */
156
157 struct ip6_hbh *ip6po_hbh; /* Hop-by-Hop options header */
158
159 /* Destination options header (before a routing header) */
160 struct ip6_dest *ip6po_dest1;
161
162 /* Routing header related info. */
163 struct ip6po_rhinfo ip6po_rhinfo;
164
165 /* Destination options header (after a routing header) */
166 struct ip6_dest *ip6po_dest2;
167};
168#endif /* __BORLANDC__ */
169
170/*
171 * Control options for incoming packets
172 */
173
174struct ip6stat {
175 u_quad_t ip6s_total; /* total packets received */
176 u_quad_t ip6s_tooshort; /* packet too short */
177 u_quad_t ip6s_toosmall; /* not enough data */
178 u_quad_t ip6s_fragments; /* fragments received */
179 u_quad_t ip6s_fragdropped; /* frags dropped(dups, out of space) */
180 u_quad_t ip6s_fragtimeout; /* fragments timed out */
181 u_quad_t ip6s_fragoverflow; /* fragments that exceeded limit */
182 u_quad_t ip6s_forward; /* packets forwarded */
183 u_quad_t ip6s_cantforward; /* packets rcvd for unreachable dest */
184 u_quad_t ip6s_redirectsent; /* packets forwarded on same net */
185 u_quad_t ip6s_delivered; /* datagrams delivered to upper level*/
186 u_quad_t ip6s_localout; /* total ip packets generated here */
187 u_quad_t ip6s_odropped; /* lost packets due to nobufs, etc. */
188 u_quad_t ip6s_reassembled; /* total packets reassembled ok */
189 u_quad_t ip6s_fragmented; /* datagrams sucessfully fragmented */
190 u_quad_t ip6s_ofragments; /* output fragments created */
191 u_quad_t ip6s_cantfrag; /* don't fragment flag was set, etc. */
192 u_quad_t ip6s_badoptions; /* error in option processing */
193 u_quad_t ip6s_noroute; /* packets discarded due to no route */
194 u_quad_t ip6s_badvers; /* ip6 version != 6 */
195 u_quad_t ip6s_rawout; /* total raw ip packets generated */
196 u_quad_t ip6s_badscope; /* scope error */
197 u_quad_t ip6s_notmember; /* don't join this multicast group */
198 u_quad_t ip6s_nxthist[256]; /* next header history */
199 u_quad_t ip6s_m1; /* one mbuf */
200 u_quad_t ip6s_m2m[32]; /* two or more mbuf */
201 u_quad_t ip6s_mext1; /* one ext mbuf */
202 u_quad_t ip6s_mext2m; /* two or more ext mbuf */
203 u_quad_t ip6s_exthdrtoolong; /* ext hdr are not continuous */
204 u_quad_t ip6s_nogif; /* no match gif found */
205 u_quad_t ip6s_toomanyhdr; /* discarded due to too many headers */
206
207 /*
208 * statistics for improvement of the source address selection
209 * algorithm:
210 * XXX: hardcoded 16 = # of ip6 multicast scope types + 1
211 */
212 /* number of times that address selection fails */
213 u_quad_t ip6s_sources_none;
214 /* number of times that an address on the outgoing I/F is chosen */
215 u_quad_t ip6s_sources_sameif[16];
216 /* number of times that an address on a non-outgoing I/F is chosen */
217 u_quad_t ip6s_sources_otherif[16];
218 /*
219 * number of times that an address that has the same scope
220 * from the destination is chosen.
221 */
222 u_quad_t ip6s_sources_samescope[16];
223 /*
224 * number of times that an address that has a different scope
225 * from the destination is chosen.
226 */
227 u_quad_t ip6s_sources_otherscope[16];
228 /* number of times that an deprecated address is chosen */
229 u_quad_t ip6s_sources_deprecated[16];
230
231 u_quad_t ip6s_forward_cachehit;
232 u_quad_t ip6s_forward_cachemiss;
233};
234
235#ifdef _KERNEL
236/*
237 * IPv6 onion peeling state.
238 * it will be initialized when we come into ip6_input().
239 * XXX do not make it a kitchen sink!
240 */
241struct ip6aux {
242 u_int32_t ip6a_flags;
243#define IP6A_SWAP 0x01 /* swapped home/care-of on packet */
244#define IP6A_HASEEN 0x02 /* HA was present */
245#define IP6A_BRUID 0x04 /* BR Unique Identifier was present */
246#define IP6A_RTALERTSEEN 0x08 /* rtalert present */
247
248 /* ip6.ip6_src */
249 struct in6_addr ip6a_careof; /* care-of address of the peer */
250 struct in6_addr ip6a_home; /* home address of the peer */
251 u_int16_t ip6a_bruid; /* BR unique identifier */
252
253 /* ip6.ip6_dst */
254 struct in6_ifaddr *ip6a_dstia6; /* my ifaddr that matches ip6_dst */
255
256 /* rtalert */
257 u_int16_t ip6a_rtalert; /* rtalert option value */
258
259 /*
260 * decapsulation history will be here.
261 * with IPsec it may not be accurate.
262 */
263};
264#endif
265
266#ifdef _KERNEL
267/* flags passed to ip6_output as last parameter */
268#define IPV6_DADOUTPUT 0x01 /* DAD */
269#define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */
270#define IPV6_MINMTU 0x04 /* use minimum MTU (IPV6_USE_MIN_MTU) */
271
272extern struct ip6stat ip6stat; /* statistics */
273extern u_int32_t ip6_id; /* fragment identifier */
274extern int ip6_defhlim; /* default hop limit */
275extern int ip6_defmcasthlim; /* default multicast hop limit */
276extern int ip6_forwarding; /* act as router? */
277extern int ip6_forward_srcrt; /* forward src-routed? */
278extern int ip6_gif_hlim; /* Hop limit for gif encap packet */
279extern int ip6_use_deprecated; /* allow deprecated addr as source */
280extern int ip6_rr_prune; /* router renumbering prefix
281 * walk list every 5 sec. */
282extern int ip6_v6only;
283
284extern struct socket *ip6_mrouter; /* multicast routing daemon */
285extern int ip6_sendredirects; /* send IP redirects when forwarding? */
286extern int ip6_maxfragpackets; /* Maximum packets in reassembly queue */
287extern int ip6_sourcecheck; /* Verify source interface */
288extern int ip6_sourcecheck_interval; /* Interval between log messages */
289extern int ip6_accept_rtadv; /* Acts as a host not a router */
290extern int ip6_keepfaith; /* Firewall Aided Internet Translator */
291extern int ip6_log_interval;
292extern time_t ip6_log_time;
293extern int ip6_hdrnestlimit; /* upper limit of # of extension headers */
294extern int ip6_dad_count; /* DupAddrDetectionTransmits */
295
296extern u_int32_t ip6_flow_seq;
297extern int ip6_auto_flowlabel;
298extern int ip6_auto_linklocal;
299
300extern int ip6_anonportmin; /* minimum ephemeral port */
301extern int ip6_anonportmax; /* maximum ephemeral port */
302extern int ip6_lowportmin; /* minimum reserved port */
303extern int ip6_lowportmax; /* maximum reserved port */
304
305extern int ip6_use_tempaddr; /* whether to use temporary addresses. */
306
307extern struct pr_usrreqs rip6_usrreqs;
308struct sockopt;
309
310struct inpcb;
311
312int icmp6_ctloutput (struct socket *, struct sockopt *sopt);
313
314struct in6_ifaddr;
315void ip6_init (void);
316void ip6intr (void);
317void ip6_input (struct mbuf *);
318struct in6_ifaddr *ip6_getdstifaddr (struct mbuf *);
319void ip6_freepcbopts (struct ip6_pktopts *);
320void ip6_freemoptions (struct ip6_moptions *);
321int ip6_unknown_opt (u_int8_t *, struct mbuf *, int);
322char * ip6_get_prevhdr (struct mbuf *, int);
323int ip6_nexthdr (struct mbuf *, int, int, int *);
324int ip6_lasthdr (struct mbuf *, int, int, int *);
325
326struct mbuf *ip6_addaux (struct mbuf *);
327struct mbuf *ip6_findaux (struct mbuf *);
328void ip6_delaux (struct mbuf *);
329
330int ip6_mforward (struct ip6_hdr *, struct ifnet *, struct mbuf *);
331int ip6_process_hopopts (struct mbuf *, u_int8_t *, int, u_int32_t *, u_int32_t *);
332void ip6_savecontrol (struct inpcb *, struct mbuf **, struct ip6_hdr *, struct mbuf *);
333void ip6_notify_pmtu (struct inpcb *, struct sockaddr_in6 *, u_int32_t *);
334int ip6_sysctl (int *, u_int, void *, size_t *, void *, size_t);
335
336void ip6_forward (struct mbuf *, int);
337
338void ip6_mloopback (struct ifnet *, struct mbuf *, struct sockaddr_in6 *);
339int ip6_output (struct mbuf *, struct ip6_pktopts *, struct route_in6 *, int, struct ip6_moptions *, struct ifnet **);
340int ip6_ctloutput (struct socket *, struct sockopt *sopt);
341void init_ip6pktopts (struct ip6_pktopts *);
342int ip6_setpktoptions (struct mbuf *, struct ip6_pktopts *, int, int);
343void ip6_clearpktopts (struct ip6_pktopts *, int, int);
344struct ip6_pktopts *ip6_copypktopts (struct ip6_pktopts *, int);
345int ip6_optlen (struct inpcb *);
346
347int route6_input (struct mbuf **, int *, int);
348
349void frag6_init (void);
350int frag6_input (struct mbuf **, int *, int);
351void frag6_slowtimo (void);
352void frag6_drain (void);
353
354void rip6_init (void);
355int rip6_input (struct mbuf **mp, int *offp, int proto);
356void rip6_ctlinput (int, struct sockaddr *, void *);
357int rip6_ctloutput (struct socket *so, struct sockopt *sopt);
358int rip6_output (struct mbuf *, ...);
359int rip6_usrreq (struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct thread *);
360
361int dest6_input (struct mbuf **, int *, int);
362int none_input (struct mbuf **, int *, int);
363#endif /* _KERNEL */
364
365#endif /* !_NETINET6_IP6_VAR_H_ */
queue.h
ifnet
Definition: if.h:136
in6_addr
Definition: in.h:151
in6_ifaddr
Definition: in6_var.h:91
in6_multi_mship
Definition: in6_var.h:517
in6_pktinfo
Definition: ipv6.h:67
inpcb
Definition: in_pcb.h:61
ip6_dest
Definition: ip6.h:142
ip6_hbh
Definition: ip6.h:134
ip6_moptions
Definition: ip6_var.h:120
ip6_pktopts
Definition: ip6_var.h:148
ip6_rthdr
Definition: ip6.h:179
ip6asfrag
Definition: ip6_var.h:101
ip6aux
Definition: ip6_var.h:241
ip6po_rhinfo
Definition: ip6_var.h:141
ip6q
Definition: ip6_var.h:82
ip6stat
Definition: ip6_var.h:174
mbuf
Definition: mbuf.h:6
route_in6
Definition: in6.h:287
rtentry
Definition: route.h:97
sockaddr_in6
Definition: in.h:231
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ip6proto.h Source File

  • inc
  • netinet6
ip6proto.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 */
33
34/*-
35 * Copyright (c) 1982, 1986, 1993
36 * The Regents of the University of California. All rights reserved.
37 *
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
41 * 1. Redistributions of source code must retain the above copyright
42 * notice, this list of conditions and the following disclaimer.
43 * 2. Redistributions in binary form must reproduce the above copyright
44 * notice, this list of conditions and the following disclaimer in the
45 * documentation and/or other materials provided with the distribution.
46 * 3. All advertising materials mentioning features or use of this software
47 * must display the following acknowledgement:
48 * This product includes software developed by the University of
49 * California, Berkeley and its contributors.
50 * 4. Neither the name of the University nor the names of its contributors
51 * may be used to endorse or promote products derived from this software
52 * without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
55 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE.
65 */
66#ifndef _NETINET6_IP6PROTOSW_H_
67#define _NETINET6_IP6PROTOSW_H_
68
69/*
70 * For pfil_head structure.
71 */
72#include <net/pfil.h>
73
74/*
75 * Protocol switch table for IPv6.
76 * All other definitions should refer to sys/protosw.h
77 */
78
79struct mbuf;
80struct sockaddr;
81struct socket;
82struct domain;
83struct thread;
84struct ip6_hdr;
85struct icmp6_hdr;
86struct in6_addr;
87struct pr_usrreqs;
88
89/*
90 * argument type for the last arg of pr_ctlinput().
91 * should be consulted only with AF_INET6 family.
92 *
93 * IPv6 ICMP IPv6 [exthdrs] finalhdr paylaod
94 * ^ ^ ^ ^
95 * | | ip6c_ip6 ip6c_off
96 * | ip6c_icmp6
97 * ip6c_m
98 *
99 * ip6c_finaldst usually points to ip6c_ip6->ip6_dst. if the original
100 * (internal) packet carries a routing header, it may point the final
101 * dstination address in the routing header.
102 *
103 * ip6c_src: ip6c_ip6->ip6_src + scope info + flowlabel in ip6c_ip6
104 * (beware of flowlabel, if you try to compare it against others)
105 * ip6c_dst: ip6c_finaldst + scope info
106 */
107struct ip6ctlparam {
108 struct mbuf *ip6c_m; /* start of mbuf chain */
109 struct icmp6_hdr *ip6c_icmp6; /* icmp6 header of target packet */
110 struct ip6_hdr *ip6c_ip6; /* ip6 header of target packet */
111 int ip6c_off; /* offset of the target proto header */
112 struct sockaddr_in6 *ip6c_src; /* srcaddr w/ additional info */
113 struct sockaddr_in6 *ip6c_dst; /* (final) dstaddr w/ additional info */
114 struct in6_addr *ip6c_finaldst; /* final destination address */
115 void *ip6c_cmdarg; /* control command dependent data */
116 u_int8_t ip6c_nxt; /* final next header field */
117};
118
119struct ip6protosw {
120 short pr_type; /* socket type used for */
121 struct domain *pr_domain; /* domain protocol a member of */
122 short pr_protocol; /* protocol number */
123 short pr_flags; /* see below */
124
125/* protocol-protocol hooks */
126 int (*pr_input) /* input to protocol (from below) */
127 (struct mbuf **, int *, int);
128 int (*pr_output) /* output to protocol (from above) */
129 (struct mbuf *, ...);
130 void (*pr_ctlinput) /* control input (from below) */
131 (int, struct sockaddr *, void *);
132 int (*pr_ctloutput) /* control output (from above) */
133 (struct socket *, struct sockopt *);
134
135/* user-protocol hook */
136 int (*pr_usrreq) /* user request: see list below */
137 (struct socket *, int, struct mbuf *,
138 struct mbuf *, struct mbuf *, struct thread *);
139
140/* utility hooks */
141 void (*pr_init) /* initialization hook */
142 (void);
143
144 void (*pr_fasttimo) /* fast timeout (200ms) */
145 (void);
146 void (*pr_slowtimo) /* slow timeout (500ms) */
147 (void);
148 void (*pr_drain) /* flush any excess space possible */
149 (void);
150 struct pr_usrreqs *pr_usrreqs; /* supersedes pr_usrreq() */
151// struct pfil_head pr_pfh;
152};
153
154#ifdef _KERNEL
155extern struct ip6protosw inet6sw[];
156#endif
157
158#endif /* !_NETINET6_IP6PROTOSW_H_ */
pfil.h
in6_addr
Definition: in.h:151
ip6ctlparam
Definition: ip6proto.h:107
ip6protosw
Definition: ip6proto.h:119
mbuf
Definition: mbuf.h:6
sockaddr_in6
Definition: in.h:231
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip.h Source File

  • inc
  • netinet
ip.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_IP_H
39#define __NETINET_IP_H
40
41#include <netinet/in.h>
42
43#ifndef __NETINET_IN_SYSTM_H
44#include <netinet/in_systm.h>
45#endif
46
47#if defined(__TURBOC__) || defined(__BORLANDC__)
48#pragma warn -bbf- /* "Bitfields must be signed or unsigned int" warning */
49#endif
50
51/*
52 * Definitions for internet protocol version 4.
53 * Per RFC 791, September 1981.
54 */
55#define IPVERSION 4
56
57W32_CLANG_PACK_WARN_OFF()
58
59#include <sys/pack_on.h>
60
61/*
62 * Structure of an internet header, naked of options.
63 *
64 * We declare ip_len and ip_off to be short, rather than u_short
65 * pragmatically since otherwise unsigned comparisons can result
66 * against negative integers quite easily, and fail in subtle ways.
67 */
68struct ip {
69#ifdef _IP_VHL
70 u_char ip_vhl; /* version << 4 | header length >> 2 */
71#else
72 u_char ip_hl:4; /* header length */
73 u_char ip_v:4; /* version */
74#endif
75 u_char ip_tos; /* type of service */
76 u_short ip_len; /* total length */
77 u_short ip_id; /* identification */
78 u_short ip_off; /* fragment offset field */
79#define IP_DF 0x4000 /* dont fragment flag */
80#define IP_MF 0x2000 /* more fragments flag */
81#define IP_OFFMASK 0x1FFF /* mask for fragmenting bits */
82 u_char ip_ttl; /* time to live */
83 u_char ip_p; /* protocol */
84 u_short ip_sum; /* checksum */
85 struct in_addr ip_src,ip_dst; /* source and dest address */
86};
87
88#ifdef _IP_VHL
89#define IP_MAKE_VHL(v,hl) ((v) << 4 | (hl))
90#define IP_VHL_HL(vhl) ((vhl) & 0x0f)
91#define IP_VHL_V(vhl) ((vhl) >> 4)
92#define IP_VHL_BORING 0x45
93#endif
94
95#define IP_MAXPACKET 65535 /* maximum packet size */
96
97/*
98 * Definitions for IP type of service (ip_tos)
99 */
100#define IPTOS_LOWDELAY 0x10
101#define IPTOS_THROUGHPUT 0x08
102#define IPTOS_RELIABILITY 0x04
103#define IPTOS_MINCOST 0x02
104
105/*
106 * Definitions for IP precedence (also in ip_tos) (hopefully unused)
107 */
108#define IPTOS_PREC_NETCONTROL 0xe0
109#define IPTOS_PREC_INTERNETCONTROL 0xc0
110#define IPTOS_PREC_CRITIC_ECP 0xa0
111#define IPTOS_PREC_FLASHOVERRIDE 0x80
112#define IPTOS_PREC_FLASH 0x60
113#define IPTOS_PREC_IMMEDIATE 0x40
114#define IPTOS_PREC_PRIORITY 0x20
115#define IPTOS_PREC_ROUTINE 0x00
116
117/*
118 * Definitions for options.
119 */
120#define IPOPT_COPIED(o) ((o)&0x80)
121#define IPOPT_CLASS(o) ((o)&0x60)
122#define IPOPT_NUMBER(o) ((o)&0x1f)
123
124#define IPOPT_CONTROL 0x00
125#define IPOPT_RESERVED1 0x20
126#define IPOPT_DEBMEAS 0x40
127#define IPOPT_RESERVED2 0x60
128
129#define IPOPT_EOL 0 /* end of option list */
130#define IPOPT_NOP 1 /* no operation */
131
132#define IPOPT_RR 7 /* record packet route */
133#define IPOPT_TS 68 /* timestamp */
134#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
135#define IPOPT_LSRR 131 /* loose source route */
136#define IPOPT_SATID 136 /* satnet id */
137#define IPOPT_SSRR 137 /* strict source route */
138#define IPOPT_RA 148 /* router alert */
139
140/*
141 * Offsets to fields in options other than EOL and NOP.
142 */
143#define IPOPT_OPTVAL 0 /* option ID */
144#define IPOPT_OLEN 1 /* option length */
145#define IPOPT_OFFSET 2 /* offset within option */
146#define IPOPT_MINOFF 4 /* min value of above */
147
148/*
149 * Time stamp option structure.
150 */
151struct ip_timestamp {
152 u_char ipt_code; /* IPOPT_TS */
153 u_char ipt_len; /* size of structure (variable) */
154 u_char ipt_ptr; /* index of current entry */
155 u_char ipt_flg:4; /* flags, see below */
156 u_char ipt_oflw:4; /* overflow counter */
157 union ipt_timestamp {
158 n_long ipt_time[1];
159 struct ipt_ta {
160 struct in_addr ipt_addr;
161 n_long ipt_time;
162 } ipt_ta[1];
163 } ipt_timestamp;
164};
165
166#include <sys/pack_off.h>
167
168W32_CLANG_PACK_WARN_DEF()
169
170/* flag bits for ipt_flg */
171#define IPOPT_TS_TSONLY 0 /* timestamps only */
172#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
173#define IPOPT_TS_PRESPEC 3 /* specified modules only */
174
175/* bits for security (not byte swapped) */
176#define IPOPT_SECUR_UNCLASS 0x0000
177#define IPOPT_SECUR_CONFID 0xf135
178#define IPOPT_SECUR_EFTO 0x789a
179#define IPOPT_SECUR_MMMM 0xbc4d
180#define IPOPT_SECUR_RESTR 0xaf13
181#define IPOPT_SECUR_SECRET 0xd788
182#define IPOPT_SECUR_TOPSECRET 0x6bc5
183
184/*
185 * Internet implementation parameters.
186 */
187#define MAXTTL 255 /* maximum time to live (seconds) */
188#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
189#define IPFRAGTTL 60 /* time to live for frags, slowhz */
190#define IPTTLDEC 1 /* subtracted when forwarding */
191
192#define IP_MSS 576 /* default maximum segment size */
193
194#if defined(__TURBOC__) || defined(__BORLANDC__)
195#pragma warn -bbf.
196#endif
197
198#endif
in.h
in_systm.h
pack_off.h
in_addr
Definition: in.h:143
ip_timestamp::ipt_timestamp::ipt_ta
Definition: ip.h:159
ip_timestamp
Definition: ip.h:151
ip_timestamp::ipt_timestamp
Definition: ip.h:157


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip_fw.h Source File

  • inc
  • netinet
ip_fw.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1993 Daniel Boulet
7 * Copyright (c) 1994 Ugen J.S.Antsilevich
8 *
9 * Redistribution and use in source forms, with and without modification,
10 * are permitted provided that this entire comment appears intact.
11 *
12 * Redistribution in binary form may occur without any restrictions.
13 * Obviously, it would be nice if you gave credit where credit is due
14 * but requiring it would be too onerous.
15 *
16 * This software is provided ``AS IS'' without any warranties of any kind.
17 */
18
19/*
20 * Format of an IP firewall descriptor
21 *
22 * fw_src, fw_dst, fw_smsk, fw_dmsk are always stored in network byte order.
23 * fw_flg and fw_n*p are stored in host byte order (of course).
24 * Port numbers are stored in HOST byte order.
25 */
26
27#ifndef __NETINET_IP_FW_H
28#define __NETINET_IP_FW_H
29
30#include <netinet/in.h>
31#include <sys/queue.h>
32
33struct ip_fw {
34 u_long fw_pcnt,fw_bcnt; /* Packet and byte counters */
35 struct in_addr fw_src, fw_dst; /* Source and destination IP addr */
36 struct in_addr fw_smsk, fw_dmsk; /* Mask for src and dest IP addr */
37 union {
38 struct in_addr fu_via_ip; /* Specified by IP address */
39 struct { /* Specified by interface name */
40#define FW_IFNLEN 6 /* To keep structure on 2^x boundary */
41 char fu_via_name[FW_IFNLEN];
42 short fu_via_unit;
43 } fu_via_if;
44 } fu_via_un;
45#define fw_via_ip fu_via_un.fu_via_ip
46#define fw_via_name fu_via_un.fu_via_if.fu_via_name
47#define fw_via_unit fu_via_un.fu_via_if.fu_via_unit
48 u_short fw_number;
49 u_short fw_flg; /* Flags word */
50 u_short fw_nsp, fw_ndp; /* N'of src ports and # of dst ports */
51 /* in ports array (dst ports follow */
52 /* src ports; max of 10 ports in all; */
53 /* count of 0 means match all ports) */
54#define IP_FW_MAX_PORTS 10 /* A reasonable maximum */
55 u_short fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */
56 u_char fw_ipopt,fw_ipnopt; /* IP options set/unset */
57 u_char fw_tcpf,fw_tcpnf; /* TCP flags set/unset */
58#define IP_FW_ICMPTYPES_DIM (256 / (sizeof(unsigned) * 8))
59 unsigned fw_icmptypes[IP_FW_ICMPTYPES_DIM]; /* ICMP types bitmap */
60 long timestamp; /* timestamp (tv_sec) of last match */
61 u_short fw_divert_port; /* Divert port (options IPDIVERT) */
62 u_char fw_prot; /* IP protocol */
63};
64
65struct ip_fw_chain {
66 LIST_ENTRY(ip_fw_chain) chain;
67 struct ip_fw *rule;
68};
69
70/*
71 * Values for "flags" field .
72 */
73#define IP_FW_F_INVSRC 0x0001 /* Invert sense of src check */
74#define IP_FW_F_INVDST 0x0002 /* Invert sense of dst check */
75#define IP_FW_F_IN 0x0004 /* Inbound */
76#define IP_FW_F_OUT 0x0008 /* Outbound */
77
78#define IP_FW_F_COMMAND 0x0030 /* Mask for type of chain entry: */
79#define IP_FW_F_ACCEPT 0x0010 /* This is an accept rule */
80#define IP_FW_F_COUNT 0x0020 /* This is a count rule */
81#define IP_FW_F_DIVERT 0x0030 /* This is a divert rule */
82#define IP_FW_F_DENY 0x0000 /* This is a deny rule */
83
84#define IP_FW_F_PRN 0x0040 /* Print if this rule matches */
85#define IP_FW_F_ICMPRPL 0x0080 /* Send back icmp unreachable packet */
86
87#define IP_FW_F_SRNG 0x0100 /* The first two src ports are a min *
88 * and max range (stored in host byte *
89 * order). */
90
91#define IP_FW_F_DRNG 0x0200 /* The first two dst ports are a min *
92 * and max range (stored in host byte *
93 * order). */
94
95#define IP_FW_F_IFNAME 0x0400 /* Use interface name/unit (not IP) */
96
97#define IP_FW_F_FRAG 0x0800 /* Fragment */
98
99#define IP_FW_F_ICMPBIT 0x1000 /* ICMP type bitmap is valid */
100
101#define IP_FW_F_IFUWILD 0x2000 /* Match all interface units */
102
103#define IP_FW_F_MASK 0x3FFF /* All possible flag bits mask */
104
105/*
106 * Definitions for IP option names.
107 */
108#define IP_FW_IPOPT_LSRR 0x01
109#define IP_FW_IPOPT_SSRR 0x02
110#define IP_FW_IPOPT_RR 0x04
111#define IP_FW_IPOPT_TS 0x08
112
113/*
114 * Definitions for TCP flags.
115 */
116#define IP_FW_TCPF_FIN TH_FIN
117#define IP_FW_TCPF_SYN TH_SYN
118#define IP_FW_TCPF_RST TH_RST
119#define IP_FW_TCPF_PSH TH_PUSH
120#define IP_FW_TCPF_ACK TH_ACK
121#define IP_FW_TCPF_URG TH_URG
122#define IP_FW_TCPF_ESTAB 0x40
123
124#endif
in.h
queue.h
in_addr
Definition: in.h:143
ip_fw_chain
Definition: ip_fw.h:65
ip_fw
Definition: ip_fw.h:33


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip_icmp.h Source File

  • inc
  • netinet
ip_icmp.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_IP_ICMP_H
39#define __NETINET_IP_ICMP_H
40
41#include <sys/wtypes.h>
42#include <sys/cdefs.h>
43#include <netinet/in.h>
44#include <netinet/ip.h>
45
46W32_CLANG_PACK_WARN_OFF()
47
48#include <sys/pack_on.h>
49
50/*
51 * Interface Control Message Protocol Definitions.
52 * Per RFC 792, September 1981.
53 */
54
55/*
56 * Internal of an ICMP Router Advertisement
57 */
58struct icmp_ra_addr {
59 u_int32_t ira_addr;
60 u_int32_t ira_preference;
61};
62
63/*
64 * Structure of an icmp header.
65 */
66struct icmp {
67 u_char icmp_type; /* type of message, see below */
68 u_char icmp_code; /* type sub code */
69 u_short icmp_cksum; /* ones complement cksum of struct */
70 union {
71 u_char ih_pptr; /* ICMP_PARAMPROB */
72 struct in_addr ih_gwaddr; /* ICMP_REDIRECT */
73 struct ih_idseq {
74 n_short icd_id;
75 n_short icd_seq;
76 } ih_idseq;
77 u_int32_t ih_void; /* was 'int' */
78
79 /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
80 struct ih_pmtu {
81 n_short ipm_void;
82 n_short ipm_nextmtu;
83 } ih_pmtu;
84
85 struct ih_rtradv {
86 u_char irt_num_addrs;
87 u_char irt_wpa;
88 u_int16_t irt_lifetime;
89 } ih_rtradv;
90 } icmp_hun;
91#define icmp_pptr icmp_hun.ih_pptr
92#define icmp_gwaddr icmp_hun.ih_gwaddr
93#define icmp_id icmp_hun.ih_idseq.icd_id
94#define icmp_seq icmp_hun.ih_idseq.icd_seq
95#define icmp_void icmp_hun.ih_void
96#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
97#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
98#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
99#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
100#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
101 union {
102 struct id_ts {
103 n_time its_otime;
104 n_time its_rtime;
105 n_time its_ttime;
106 } id_ts;
107 struct id_ip {
108 struct ip idi_ip;
109 /* options and then 64 bits of data */
110 } id_ip;
111 struct icmp_ra_addr id_radv;
112 u_long id_mask;
113 char id_data[1];
114 } icmp_dun;
115#define icmp_otime icmp_dun.id_ts.its_otime
116#define icmp_rtime icmp_dun.id_ts.its_rtime
117#define icmp_ttime icmp_dun.id_ts.its_ttime
118#define icmp_ip icmp_dun.id_ip.idi_ip
119#define icmp_radv icmp_dun.id_radv
120#define icmp_mask icmp_dun.id_mask
121#define icmp_data icmp_dun.id_data
122};
123
124#include <sys/pack_off.h>
125
126W32_CLANG_PACK_WARN_DEF()
127
128/*
129 * Lower bounds on packet lengths for various types.
130 * For the error advice packets must first insure that the
131 * packet is large enough to contain the returned ip header.
132 * Only then can we do the check to see if 64 bits of packet
133 * data have been returned, since we need to check the returned
134 * ip header length.
135 */
136#define ICMP_MINLEN 8 /* abs minimum */
137#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
138#define ICMP_MASKLEN 12 /* address mask */
139#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
140#ifndef _IP_VHL
141#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
142 /* N.B.: must separately check that ip_hl >= 5 */
143#else
144#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
145 /* N.B.: must separately check that header length >= 5 */
146#endif
147
148/*
149 * Definition of type and code field values.
150 */
151#define ICMP_ECHOREPLY 0 /* echo reply */
152#define ICMP_UNREACH 3 /* dest unreachable, codes: */
153#define ICMP_UNREACH_NET 0 /* bad net */
154#define ICMP_UNREACH_HOST 1 /* bad host */
155#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
156#define ICMP_UNREACH_PORT 3 /* bad port */
157#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
158#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
159#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
160#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
161#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
162#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */
163#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */
164#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
165#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
166#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
167#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
168#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
169#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
170#define ICMP_REDIRECT 5 /* shorter route, codes: */
171#define ICMP_REDIRECT_NET 0 /* for network */
172#define ICMP_REDIRECT_HOST 1 /* for host */
173#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
174#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
175#define ICMP_ECHO 8 /* echo service */
176#define ICMP_ROUTERADVERT 9 /* router advertisement */
177#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
178#define ICMP_TIMXCEED 11 /* time exceeded, code: */
179#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
180#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
181#define ICMP_PARAMPROB 12 /* ip header bad */
182#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
183#define ICMP_TSTAMP 13 /* timestamp request */
184#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
185#define ICMP_IREQ 15 /* information request */
186#define ICMP_IREQREPLY 16 /* information reply */
187#define ICMP_MASKREQ 17 /* address mask request */
188#define ICMP_MASKREPLY 18 /* address mask reply */
189
190#ifndef ICMP_MAXTYPE
191#define ICMP_MAXTYPE 18
192#endif
193
194#define ICMP_INFOTYPE(type) \
195 ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
196 (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
197 (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
198 (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
199 (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
200
201#endif
cdefs.h
in.h
ip.h
pack_off.h
icmp
Definition: ip_icmp.h:66
in_addr
Definition: in.h:143
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip_mrout.h Source File

  • inc
  • netinet
ip_mrout.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1989 Stephen Deering.
7 * Copyright (c) 1992, 1993
8 * The Regents of the University of California. All rights reserved.
9 *
10 * This code is derived from software contributed to Berkeley by
11 * Stephen Deering of Stanford University.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgement:
23 * This product includes software developed by the University of
24 * California, Berkeley and its contributors.
25 * 4. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 */
41
42#ifndef __NETINET_IP_MROUTE_H
43#define __NETINET_IP_MROUTE_H
44
45#ifndef __SYS_MBUF_H
46#include <sys/mbuf.h>
47#endif
48
49#include <netinet/in.h>
50#include <net/route.h>
51
52/*
53 * Definitions for IP multicast forwarding.
54 *
55 * Written by David Waitzman, BBN Labs, August 1988.
56 * Modified by Steve Deering, Stanford, February 1989.
57 * Modified by Ajit Thyagarajan, PARC, August 1993.
58 * Modified by Ajit Thyagarajan, PARC, August 1994.
59 *
60 * MROUTING Revision: 3.3.1.3
61 */
62
63
64/*
65 * Multicast Routing set/getsockopt commands.
66 */
67#define MRT_INIT 100 /* initialize forwarder */
68#define MRT_DONE 101 /* shut down forwarder */
69#define MRT_ADD_VIF 102 /* create virtual interface */
70#define MRT_DEL_VIF 103 /* delete virtual interface */
71#define MRT_ADD_MFC 104 /* insert forwarding cache entry */
72#define MRT_DEL_MFC 105 /* delete forwarding cache entry */
73#define MRT_VERSION 106 /* get kernel version number */
74#define MRT_ASSERT 107 /* enable PIM assert processing */
75
76#undef GET_TIME
77#define GET_TIME(t) microtime(&t)
78
79/*
80 * Types and macros for handling bitmaps with one bit per virtual interface.
81 */
82#define MAXVIFS 32
83typedef u_long vifbitmap_t;
84typedef u_short vifi_t; /* type of a vif index */
85#define ALL_VIFS (vifi_t)-1
86
87#define VIFM_SET(n, m) ((m) |= (1 << (n)))
88#define VIFM_CLR(n, m) ((m) &= ~(1 << (n)))
89#define VIFM_ISSET(n, m) ((m) & (1 << (n)))
90#define VIFM_CLRALL(m) ((m) = 0x00000000)
91#define VIFM_COPY(mfrom, mto) ((mto) = (mfrom))
92#define VIFM_SAME(m1, m2) ((m1) == (m2))
93
94
95/*
96 * Argument structure for MRT_ADD_VIF.
97 * (MRT_DEL_VIF takes a single vifi_t argument.)
98 */
99struct vifctl {
100 vifi_t vifc_vifi; /* the index of the vif to be added */
101 u_char vifc_flags; /* VIFF_ flags defined below */
102 u_char vifc_threshold; /* min ttl required to forward on vif */
103 u_int vifc_rate_limit; /* max rate */
104 struct in_addr vifc_lcl_addr; /* local interface address */
105 struct in_addr vifc_rmt_addr; /* remote address (tunnels only) */
106};
107
108#define VIFF_TUNNEL 0x1 /* vif represents a tunnel end-point */
109#define VIFF_SRCRT 0x2 /* tunnel uses IP source routing */
110
111/*
112 * Argument structure for MRT_ADD_MFC and MRT_DEL_MFC
113 * (mfcc_tos to be added at a future point)
114 */
115struct mfcctl {
116 struct in_addr mfcc_origin; /* ip origin of mcasts */
117 struct in_addr mfcc_mcastgrp; /* multicast group associated*/
118 vifi_t mfcc_parent; /* incoming vif */
119 u_char mfcc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
120};
121
122/*
123 * The kernel's multicast routing statistics.
124 */
125struct mrtstat {
126 u_long mrts_mfc_lookups; /* # forw. cache hash table hits */
127 u_long mrts_mfc_misses; /* # forw. cache hash table misses */
128 u_long mrts_upcalls; /* # calls to mrouted */
129 u_long mrts_no_route; /* no route for packet's origin */
130 u_long mrts_bad_tunnel; /* malformed tunnel options */
131 u_long mrts_cant_tunnel; /* no room for tunnel options */
132 u_long mrts_wrong_if; /* arrived on wrong interface */
133 u_long mrts_upq_ovflw; /* upcall Q overflow */
134 u_long mrts_cache_cleanups; /* # entries with no upcalls */
135 u_long mrts_drop_sel; /* pkts dropped selectively */
136 u_long mrts_q_overflow; /* pkts dropped - Q overflow */
137 u_long mrts_pkt2large; /* pkts dropped - size > BKT SIZE */
138 u_long mrts_upq_sockfull; /* upcalls dropped - socket full */
139};
140
141/*
142 * Argument structure used by mrouted to get src-grp pkt counts
143 */
144struct sioc_sg_req {
145 struct in_addr src;
146 struct in_addr grp;
147 u_long pktcnt;
148 u_long bytecnt;
149 u_long wrong_if;
150};
151
152/*
153 * Argument structure used by mrouted to get vif pkt counts
154 */
155struct sioc_vif_req {
156 vifi_t vifi; /* vif number */
157 u_long icount; /* Input packet count on vif */
158 u_long ocount; /* Output packet count on vif */
159 u_long ibytes; /* Input byte count on vif */
160 u_long obytes; /* Output byte count on vif */
161};
162
163
164/*
165 * The kernel's virtual-interface structure.
166 */
167struct vif {
168 u_char v_flags; /* VIFF_ flags defined above */
169 u_char v_threshold; /* min ttl required to forward on vif*/
170 u_int v_rate_limit; /* max rate */
171 struct tbf *v_tbf; /* token bucket structure at intf. */
172 struct in_addr v_lcl_addr; /* local interface address */
173 struct in_addr v_rmt_addr; /* remote address (tunnels only) */
174 struct ifnet *v_ifp; /* pointer to interface */
175 u_long v_pkt_in; /* # pkts in on interface */
176 u_long v_pkt_out; /* # pkts out on interface */
177 u_long v_bytes_in; /* # bytes in on interface */
178 u_long v_bytes_out; /* # bytes out on interface */
179 struct route v_route; /* cached route if this is a tunnel */
180 u_int v_rsvp_on; /* RSVP listening on this vif */
181 struct socket *v_rsvpd; /* RSVP daemon socket */
182};
183
184/*
185 * The kernel's multicast forwarding cache entry structure
186 * (A field for the type of service (mfc_tos) is to be added
187 * at a future point)
188 */
189struct mfc {
190 struct in_addr mfc_origin; /* IP origin of mcasts */
191 struct in_addr mfc_mcastgrp; /* multicast group associated*/
192 vifi_t mfc_parent; /* incoming vif */
193 u_char mfc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
194 u_long mfc_pkt_cnt; /* pkt count for src-grp */
195 u_long mfc_byte_cnt; /* byte count for src-grp */
196 u_long mfc_wrong_if; /* wrong if for src-grp */
197 int mfc_expire; /* time to clean entry up */
198 struct timeval mfc_last_assert; /* last time I sent an assert*/
199};
200
201/*
202 * Struct used to communicate from kernel to multicast router
203 * note the convenient similarity to an IP packet
204 */
205struct igmpmsg {
206 u_long unused1;
207 u_long unused2;
208 u_char im_msgtype; /* what type of message */
209#define IGMPMSG_NOCACHE 1
210#define IGMPMSG_WRONGVIF 2
211 u_char im_mbz; /* must be zero */
212 u_char im_vif; /* vif rec'd on */
213 u_char unused3;
214 struct in_addr im_src, im_dst;
215};
216
217/*
218 * Argument structure used for pkt info. while upcall is made
219 */
220struct rtdetq {
221 struct mbuf *m; /* A copy of the packet */
222 struct ifnet *ifp; /* Interface pkt came in on */
223 vifi_t xmt_vif; /* Saved copy of imo_multicast_vif */
224#ifdef UPCALL_TIMING
225 struct timeval t; /* Timestamp */
226#endif
227};
228
229#define MFCTBLSIZ 256
230#if (MFCTBLSIZ & (MFCTBLSIZ - 1)) == 0 /* from sys:route.h */
231#define MFCHASHMOD(h) ((h) & (MFCTBLSIZ - 1))
232#else
233#define MFCHASHMOD(h) ((h) % MFCTBLSIZ)
234#endif
235
236#define MAX_UPQ 4 /* max. no of pkts in upcall Q */
237
238/*
239 * Token Bucket filter code
240 */
241#define MAX_BKT_SIZE 10000 /* 10K bytes size */
242#define MAXQSIZE 10 /* max # of pkts in queue */
243
244/*
245 * the token bucket filter at each vif
246 */
247struct tbf
248{
249 struct timeval tbf_last_pkt_t; /* arr. time of last pkt */
250 u_long tbf_n_tok; /* no of tokens in bucket */
251 u_long tbf_q_len; /* length of queue at this vif */
252 u_long tbf_max_q_len; /* max. queue length */
253 struct mbuf *tbf_q; /* Packet queue */
254 struct mbuf *tbf_t; /* tail-insertion pointer */
255};
256
257#endif
in.h
route.h
ifnet
Definition: if.h:136
igmpmsg
Definition: ip_mrout.h:205
in_addr
Definition: in.h:143
mbuf
Definition: mbuf.h:6
mfc
Definition: ip_mrout.h:189
mfcctl
Definition: ip_mrout.h:115
mrtstat
Definition: ip_mrout.h:125
route
Definition: route.h:55
rtdetq
Definition: ip_mrout.h:220
sioc_sg_req
Definition: ip_mrout.h:144
sioc_vif_req
Definition: ip_mrout.h:155
socket
Definition: if.h:82
tbf
Definition: ip_mrout.h:248
timeval
Definition: wtime.h:30
vif
Definition: ip_mrout.h:167
vifctl
Definition: ip_mrout.h:99


Watt-32 tcp/ip: E:/WATT/inc/netinet/ip_var.h Source File

  • inc
  • netinet
ip_var.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_IP_VAR_H
39#define __NETINET_IP_VAR_H
40
41#include <netinet/in.h>
42
43W32_CLANG_PACK_WARN_OFF()
44
45#include <sys/pack_on.h>
46
47#if defined(__TURBOC__) || defined(__BORLANDC__)
48#pragma warn -bbf- /* "Bitfields must be signed or unsigned int" warning */
49#endif
50
51/*
52 * Overlay for ip header used by other protocols (tcp, udp).
53 */
54struct ipovly {
55 caddr_t ih_next, ih_prev; /* for protocol sequence q's */
56 u_char ih_x1; /* (unused) */
57 u_char ih_pr; /* protocol */
58 u_short ih_len; /* protocol length */
59 struct in_addr ih_src; /* source internet address */
60 struct in_addr ih_dst; /* destination internet address */
61};
62
63
64/*
65 * Ip header, when holding a fragment.
66 *
67 * Note: ipf_next must be at same offset as ipq_next above
68 */
69struct ipasfrag {
70 u_char ip_hl:4;
71 u_char ip_v:4;
72 u_char ipf_mff; /* XXX overlays ip_tos: use low bit
73 * to avoid destroying tos;
74 * copied from (ip_off&IP_MF) */
75 u_short ip_len;
76 u_short ip_id;
77 u_short ip_off;
78 u_char ip_ttl;
79 u_char ip_p;
80 u_short ip_sum;
81 struct ipasfrag *ipf_next; /* next fragment */
82 struct ipasfrag *ipf_prev; /* previous fragment */
83};
84
85#include <sys/pack_off.h>
86
87 W32_CLANG_PACK_WARN_DEF()
88
89/*
90 * Ip reassembly queue structure. Each fragment
91 * being reassembled is attached to one of these structures.
92 * They are timed out after ipq_ttl drops to 0, and may also
93 * be reclaimed if memory becomes tight.
94 */
95struct ipq {
96 struct ipq *next,*prev; /* to other reass headers */
97 u_char ipq_ttl; /* time for reass q to live */
98 u_char ipq_p; /* protocol of this fragment */
99 u_short ipq_id; /* sequence id for reassembly */
100 struct ipasfrag *ipq_next,*ipq_prev;
101 /* to ip headers of fragments */
102 struct in_addr ipq_src,ipq_dst;
103#ifdef IPDIVERT
104 u_short ipq_divert; /* divert protocol port */
105#endif
106};
107
108/*
109 * Structure stored in mbuf in inpcb.ip_options
110 * and passed to ip_output when ip options are in use.
111 * The actual length of the options (including ipopt_dst)
112 * is in m_len.
113 */
114#define MAX_IPOPTLEN 40
115
116struct ipoption {
117 struct in_addr ipopt_dst; /* first-hop dst if source routed */
118 char ipopt_list[MAX_IPOPTLEN]; /* options proper */
119};
120
121/*
122 * Structure attached to inpcb.ip_moptions and
123 * passed to ip_output when IP multicast options are in use.
124 */
125struct ip_moptions {
126 struct ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */
127 u_char imo_multicast_ttl; /* TTL for outgoing multicasts */
128 u_char imo_multicast_loop; /* 1 => hear sends if a member */
129 u_short imo_num_memberships; /* no. memberships this socket */
130 struct in_multi *imo_membership[IP_MAX_MEMBERSHIPS];
131 u_long imo_multicast_vif; /* vif num outgoing multicasts */
132};
133
134struct ipstat {
135 u_long ips_total; /* total packets received */
136 u_long ips_badsum; /* checksum bad */
137 u_long ips_tooshort; /* packet too short */
138 u_long ips_toosmall; /* not enough data */
139 u_long ips_badhlen; /* ip header length < data size */
140 u_long ips_badlen; /* ip length < ip header length */
141 u_long ips_fragments; /* fragments received */
142 u_long ips_fragdropped; /* frags dropped (dups, out of space) */
143 u_long ips_fragtimeout; /* fragments timed out */
144 u_long ips_forward; /* packets forwarded */
145 u_long ips_cantforward; /* packets rcvd for unreachable dest */
146 u_long ips_redirectsent; /* packets forwarded on same net */
147 u_long ips_noproto; /* unknown or unsupported protocol */
148 u_long ips_delivered; /* datagrams delivered to upper level*/
149 u_long ips_localout; /* total ip packets generated here */
150 u_long ips_odropped; /* lost out packets due to nobufs, etc. */
151 u_long ips_idropped;
152 u_long ips_reassembled; /* total packets reassembled ok */
153 u_long ips_fragmented; /* datagrams successfully fragmented */
154 u_long ips_ofragments; /* output fragments created */
155 u_long ips_cantfrag; /* don't fragment flag was set, etc. */
156 u_long ips_badoptions; /* error in option processing */
157 u_long ips_noroute; /* packets discarded due to no route */
158 u_long ips_badvers; /* ip version != 4 */
159 u_long ips_rawout; /* total raw ip packets generated */
160 u_long ips_toolong; /* ip length > max ip packet size */
161};
162
163#if defined(__TURBOC__) || defined(__BORLANDC__)
164#pragma warn -bbf.
165#endif
166
167#endif
in.h
W32_CLANG_PACK_WARN_DEF
W32_CLANG_PACK_WARN_DEF() struct ipq
This hook is to prevent the BSD-socket API being linked in by default.
Definition: ip_var.h:87
pack_off.h
ifnet
Definition: if.h:136
in_addr
Definition: in.h:143
in_multi
Definition: in_var.h:106
ip_moptions
Definition: ip_var.h:125
ipasfrag
Definition: ip_var.h:69
ipoption
Definition: ip_var.h:116
ipstat
Definition: ip_var.h:134
ipstat::ips_reassembled
u_long ips_reassembled
Definition: ip_var.h:152


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ipcomp6.h Source File

  • inc
  • netinet6
ipcomp6.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1999 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * RFC2393 IP payload compression protocol (IPComp).
35 */
36
37#ifndef _NETINET6_IPCOMP6_H_
38#define _NETINET6_IPCOMP6_H_
39
40#ifdef _KERNEL
41extern int ipcomp6_input (struct mbuf **, int *, int);
42extern int ipcomp6_output (struct mbuf *, u_char *, struct mbuf *,struct ipsecrequest *);
43#endif
44
45#endif /*_NETINET6_IPCOMP6_H_*/
ipsecrequest
Definition: ipsec.h:102
mbuf
Definition: mbuf.h:6


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ipcomp.h Source File

  • inc
  • netinet6
ipcomp.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1999 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * RFC2393 IP payload compression protocol (IPComp).
35 */
36
37#ifndef _NETINET6_IPCOMP_H_
38#define _NETINET6_IPCOMP_H_
39
40#if defined(_KERNEL) && !defined(_LKM)
41#include "opt_inet.h"
42#endif
43
44struct ipcomp {
45 u_int8_t comp_nxt; /* Next Header */
46 u_int8_t comp_flags; /* reserved, must be zero */
47 u_int16_t comp_cpi; /* Compression parameter index */
48};
49
50/* well-known algorithm number (in CPI), from RFC2409
51 */
52#define IPCOMP_OUI 1 /* vendor specific */
53#define IPCOMP_DEFLATE 2 /* RFC2394 */
54#define IPCOMP_LZS 3 /* RFC2395 */
55#define IPCOMP_MAX 4
56
57#define IPCOMP_CPI_NEGOTIATE_MIN 256
58
59#ifdef _KERNEL
60struct ipcomp_algorithm {
61 int (*compress) (struct mbuf *, struct mbuf *, size_t *);
62 int (*decompress) (struct mbuf *, struct mbuf *, size_t *);
63 size_t minplen; /* minimum required length for compression */
64};
65
66struct ipsecrequest;
67extern const struct ipcomp_algorithm *ipcomp_algorithm_lookup (int);
68extern void ipcomp4_input (struct mbuf *, int);
69extern int ipcomp4_output (struct mbuf *, struct ipsecrequest *);
70#endif /* KERNEL */
71
72#endif /* _NETINET6_IPCOMP_H_ */
ipcomp_algorithm
Definition: ipcomp.h:60
ipcomp
Definition: ipcomp.h:44
ipsecrequest
Definition: ipsec.h:102
mbuf
Definition: mbuf.h:6


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ipsec6.h Source File

  • inc
  • netinet6
ipsec6.h
Go to the documentation of this file.
1
5/*
6 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34/*
35 * IPsec controller part.
36 */
37
38#ifndef _NETINET6_IPSEC6_H_
39#define _NETINET6_IPSEC6_H_
40
41#include <net/pfkeyv2.h>
42// #include <netkey/keydb.h>
43
44#ifdef _KERNEL
45extern struct ipsecstat ipsec6stat;
46extern struct secpolicy ip6_def_policy;
47extern int ip6_esp_trans_deflev;
48extern int ip6_esp_net_deflev;
49extern int ip6_ah_trans_deflev;
50extern int ip6_ah_net_deflev;
51extern int ip6_ipsec_ecn;
52extern int ip6_esp_randpad;
53
54extern struct secpolicy *ipsec6_getpolicybysock (struct mbuf *, u_int, struct socket *, int *);
55extern struct secpolicy *ipsec6_getpolicybyaddr (struct mbuf *, u_int, int, int *);
56
57struct inpcb;
58
59extern int ipsec6_in_reject_so (struct mbuf *, struct socket *);
60extern int ipsec6_delete_pcbpolicy (struct inpcb *);
61extern int ipsec6_set_policy (struct inpcb *inp, int optname, caddr_t request, size_t len, int priv);
62extern int ipsec6_get_policy (struct inpcb *inp, caddr_t request, size_t len, struct mbuf **mp);
63extern int ipsec6_in_reject (struct mbuf *, struct inpcb *);
64
65struct tcp6cb;
66
67extern size_t ipsec6_hdrsiz (struct mbuf *, u_int, struct inpcb *);
68
69struct ip6_hdr;
70extern const char *ipsec6_logpacketstr (struct ip6_hdr *, u_int32_t);
71
72extern int ipsec6_output_trans (struct ipsec_output_state *, u_char *, struct mbuf *, struct secpolicy *, int, int *);
73extern int ipsec6_output_tunnel (struct ipsec_output_state *, struct secpolicy *, int);
74extern int ipsec6_tunnel_validate (struct mbuf *, int, u_int, struct secasvar *);
75#endif /*_KERNEL*/
76
77#endif /*_NETINET6_IPSEC6_H_*/
inpcb
Definition: in_pcb.h:61
ipsec_output_state
Definition: ipsec.h:274
ipsecstat
Definition: ipsec.h:187
mbuf
Definition: mbuf.h:6
secpolicy
Definition: ipsec.h:73
socket
Definition: if.h:82


Watt-32 tcp/ip: E:/WATT/inc/netinet6/ipsec.h Source File

  • inc
  • netinet6
ipsec.h
Go to the documentation of this file.
1
5/*
6 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34/*
35 * IPsec controller part.
36 */
37
38#ifndef _NETINET6_IPSEC_H_
39#define _NETINET6_IPSEC_H_
40
41#if defined(_KERNEL)
42
43#if !defined(_LKM) && !defined(KLD_MODULE)
44#include "opt_inet.h"
45#include "opt_ipsec.h"
46#endif
47
48#include <net/pfkeyv2.h>
49#include <netkey/keydb.h>
50
51/*
52 * Security Policy Index
53 * Ensure that both address families in the "src" and "dst" are same.
54 * When the value of the ul_proto is ICMPv6, the port field in "src"
55 * specifies ICMPv6 type, and the port field in "dst" specifies ICMPv6 code.
56 */
57struct secpolicyindex {
58 u_int8_t dir; /* direction of packet flow, see blow */
59 struct sockaddr_storage src; /* IP src address for SP */
60 struct sockaddr_storage dst; /* IP dst address for SP */
61 u_int8_t prefs; /* prefix length in bits for src */
62 u_int8_t prefd; /* prefix length in bits for dst */
63 u_int16_t ul_proto; /* upper layer Protocol */
64#ifdef notyet
65 uid_t uids;
66 uid_t uidd;
67 gid_t gids;
68 gid_t gidd;
69#endif
70};
71
72/* Security Policy Data Base */
73struct secpolicy {
74 LIST_ENTRY(secpolicy) chain;
75
76 int refcnt; /* reference count */
77 struct secpolicyindex spidx; /* selector */
78 u_int32_t id; /* It's unique number on the system. */
79 u_int state; /* 0: dead, others: alive */
80#define IPSEC_SPSTATE_DEAD 0
81#define IPSEC_SPSTATE_ALIVE 1
82
83 u_int policy; /* DISCARD, NONE or IPSEC, see keyv2.h */
84 struct ipsecrequest *req;
85 /* pointer to the ipsec request tree, */
86 /* if policy == IPSEC else this value == NULL.*/
87
88 /*
89 * lifetime handler.
90 * the policy can be used without limitiation if both lifetime and
91 * validtime are zero.
92 * "lifetime" is passed by sadb_lifetime.sadb_lifetime_addtime.
93 * "validtime" is passed by sadb_lifetime.sadb_lifetime_usetime.
94 */
95 long created; /* time created the policy */
96 long lastused; /* updated every when kernel sends a packet */
97 long lifetime; /* duration of the lifetime of this policy */
98 long validtime; /* duration this policy is valid without use */
99};
100
101/* Request for IPsec */
102struct ipsecrequest {
103 struct ipsecrequest *next;
104 /* pointer to next structure */
105 /* If NULL, it means the end of chain. */
106 struct secasindex saidx; /* hint for search proper SA */
107 /* if __ss_len == 0 then no address specified.*/
108 u_int level; /* IPsec level defined below. */
109
110 struct secasvar *sav; /* place holder of SA for use */
111 struct secpolicy *sp; /* back pointer to SP */
112};
113
114/* security policy in PCB */
115struct inpcbpolicy {
116 struct secpolicy *sp_in;
117 struct secpolicy *sp_out;
118 int priv; /* privileged socket ? */
119};
120
121/* SP acquiring list table. */
122struct secspacq {
123 LIST_ENTRY(secspacq) chain;
124
125 struct secpolicyindex spidx;
126
127 long created; /* for lifetime */
128 int count; /* for lifetime */
129 /* XXX: here is mbuf place holder to be sent ? */
130};
131#endif /* _KERNEL */
132
133/* according to IANA assignment, port 0x0000 and proto 0xff are reserved. */
134#define IPSEC_PORT_ANY 0
135#define IPSEC_ULPROTO_ANY 255
136#define IPSEC_PROTO_ANY 255
137
138/* mode of security protocol */
139/* NOTE: DON'T use IPSEC_MODE_ANY at SPD. It's only use in SAD */
140#define IPSEC_MODE_ANY 0 /* i.e. wildcard. */
141#define IPSEC_MODE_TRANSPORT 1
142#define IPSEC_MODE_TUNNEL 2
143
144/*
145 * Direction of security policy.
146 * NOTE: Since INVALID is used just as flag.
147 * The other are used for loop counter too.
148 */
149#define IPSEC_DIR_ANY 0
150#define IPSEC_DIR_INBOUND 1
151#define IPSEC_DIR_OUTBOUND 2
152#define IPSEC_DIR_MAX 3
153#define IPSEC_DIR_INVALID 4
154
155/* Policy level */
156/*
157 * IPSEC, ENTRUST and BYPASS are allowed for setsockopt() in PCB,
158 * DISCARD, IPSEC and NONE are allowed for setkey() in SPD.
159 * DISCARD and NONE are allowed for system default.
160 */
161#define IPSEC_POLICY_DISCARD 0 /* discarding packet */
162#define IPSEC_POLICY_NONE 1 /* through IPsec engine */
163#define IPSEC_POLICY_IPSEC 2 /* do IPsec */
164#define IPSEC_POLICY_ENTRUST 3 /* consulting SPD if present. */
165#define IPSEC_POLICY_BYPASS 4 /* only for privileged socket. */
166
167/* Security protocol level */
168#define IPSEC_LEVEL_DEFAULT 0 /* reference to system default */
169#define IPSEC_LEVEL_USE 1 /* use SA if present. */
170#define IPSEC_LEVEL_REQUIRE 2 /* require SA. */
171#define IPSEC_LEVEL_UNIQUE 3 /* unique SA. */
172
173#define IPSEC_MANUAL_REQID_MAX 0x3fff
174 /*
175 * if security policy level == unique, this id
176 * indicate to a relative SA for use, else is
177 * zero.
178 * 1 - 0x3fff are reserved for manual keying.
179 * 0 are reserved for above reason. Others is
180 * for kernel use.
181 * Note that this id doesn't identify SA
182 * by only itself.
183 */
184#define IPSEC_REPLAYWSIZE 32
185
186/* statistics for ipsec processing */
187struct ipsecstat {
188 u_quad_t in_success; /* succeeded inbound process */
189 u_quad_t in_polvio;
190 /* security policy violation for inbound process */
191 u_quad_t in_nosa; /* inbound SA is unavailable */
192 u_quad_t in_inval; /* inbound processing failed due to EINVAL */
193 u_quad_t in_nomem; /* inbound processing failed due to ENOBUFS */
194 u_quad_t in_badspi; /* failed getting a SPI */
195 u_quad_t in_ahreplay; /* AH replay check failed */
196 u_quad_t in_espreplay; /* ESP replay check failed */
197 u_quad_t in_ahauthsucc; /* AH authentication success */
198 u_quad_t in_ahauthfail; /* AH authentication failure */
199 u_quad_t in_espauthsucc; /* ESP authentication success */
200 u_quad_t in_espauthfail; /* ESP authentication failure */
201 u_quad_t in_esphist[256];
202 u_quad_t in_ahhist[256];
203 u_quad_t in_comphist[256];
204 u_quad_t out_success; /* succeeded outbound process */
205 u_quad_t out_polvio;
206 /* security policy violation for outbound process */
207 u_quad_t out_nosa; /* outbound SA is unavailable */
208 u_quad_t out_inval; /* outbound process failed due to EINVAL */
209 u_quad_t out_nomem; /* inbound processing failed due to ENOBUFS */
210 u_quad_t out_noroute; /* there is no route */
211 u_quad_t out_esphist[256];
212 u_quad_t out_ahhist[256];
213 u_quad_t out_comphist[256];
214};
215
216/*
217 * Definitions for IPsec & Key sysctl operations.
218 */
219/*
220 * Names for IPsec & Key sysctl objects
221 */
222#define IPSECCTL_STATS 1 /* stats */
223#define IPSECCTL_DEF_POLICY 2
224#define IPSECCTL_DEF_ESP_TRANSLEV 3 /* int; ESP transport mode */
225#define IPSECCTL_DEF_ESP_NETLEV 4 /* int; ESP tunnel mode */
226#define IPSECCTL_DEF_AH_TRANSLEV 5 /* int; AH transport mode */
227#define IPSECCTL_DEF_AH_NETLEV 6 /* int; AH tunnel mode */
228#if 0 /* obsolete, do not reuse */
229#define IPSECCTL_INBOUND_CALL_IKE 7
230#endif
231#define IPSECCTL_AH_CLEARTOS 8
232#define IPSECCTL_AH_OFFSETMASK 9
233#define IPSECCTL_DFBIT 10
234#define IPSECCTL_ECN 11
235#define IPSECCTL_DEBUG 12
236#define IPSECCTL_ESP_RANDPAD 13
237#define IPSECCTL_MAXID 14
238
239#define IPSECCTL_NAMES { \
240 { 0, 0 }, \
241 { 0, 0 }, \
242 { "def_policy", CTLTYPE_INT }, \
243 { "esp_trans_deflev", CTLTYPE_INT }, \
244 { "esp_net_deflev", CTLTYPE_INT }, \
245 { "ah_trans_deflev", CTLTYPE_INT }, \
246 { "ah_net_deflev", CTLTYPE_INT }, \
247 { 0, 0 }, \
248 { "ah_cleartos", CTLTYPE_INT }, \
249 { "ah_offsetmask", CTLTYPE_INT }, \
250 { "dfbit", CTLTYPE_INT }, \
251 { "ecn", CTLTYPE_INT }, \
252 { "debug", CTLTYPE_INT }, \
253 { "esp_randpad", CTLTYPE_INT }, \
254}
255
256#define IPSEC6CTL_NAMES { \
257 { 0, 0 }, \
258 { 0, 0 }, \
259 { "def_policy", CTLTYPE_INT }, \
260 { "esp_trans_deflev", CTLTYPE_INT }, \
261 { "esp_net_deflev", CTLTYPE_INT }, \
262 { "ah_trans_deflev", CTLTYPE_INT }, \
263 { "ah_net_deflev", CTLTYPE_INT }, \
264 { 0, 0 }, \
265 { 0, 0 }, \
266 { 0, 0 }, \
267 { 0, 0 }, \
268 { "ecn", CTLTYPE_INT }, \
269 { "debug", CTLTYPE_INT }, \
270 { "esp_randpad", CTLTYPE_INT }, \
271}
272
273#ifdef _KERNEL
274struct ipsec_output_state {
275 struct mbuf *m;
276 struct route *ro;
277 struct sockaddr *dst;
278};
279
280struct ipsec_history {
281 int ih_proto;
282 u_int32_t ih_spi;
283};
284
285extern int ipsec_debug;
286
287extern struct ipsecstat ipsecstat;
288extern struct secpolicy ip4_def_policy;
289extern int ip4_esp_trans_deflev;
290extern int ip4_esp_net_deflev;
291extern int ip4_ah_trans_deflev;
292extern int ip4_ah_net_deflev;
293extern int ip4_ah_cleartos;
294extern int ip4_ah_offsetmask;
295extern int ip4_ipsec_dfbit;
296extern int ip4_ipsec_ecn;
297extern int ip4_esp_randpad;
298
299#define ipseclog(x) do { if (ipsec_debug) log x; } while (0)
300
301extern struct secpolicy *ipsec4_getpolicybysock (struct mbuf *, u_int, struct socket *, int *);
302extern struct secpolicy *ipsec4_getpolicybyaddr (struct mbuf *, u_int, int, int *);
303
304struct inpcb;
305extern int ipsec_init_policy (struct socket *so, struct inpcbpolicy **);
306extern int ipsec_copy_policy (struct inpcbpolicy *, struct inpcbpolicy *);
307extern u_int ipsec_get_reqlevel (struct ipsecrequest *);
308
309extern int ipsec4_set_policy (struct inpcb *inp, int optname, caddr_t request, size_t len, int priv);
310extern int ipsec4_get_policy (struct inpcb *inpcb, caddr_t request, size_t len, struct mbuf **mp);
311extern int ipsec4_delete_pcbpolicy (struct inpcb *);
312extern int ipsec4_in_reject_so (struct mbuf *, struct socket *);
313extern int ipsec4_in_reject (struct mbuf *, struct inpcb *);
314
315struct secas;
316struct tcpcb;
317extern int ipsec_chkreplay (u_int32_t, struct secasvar *);
318extern int ipsec_updatereplay (u_int32_t, struct secasvar *);
319
320extern size_t ipsec4_hdrsiz (struct mbuf *, u_int, struct inpcb *);
321extern size_t ipsec_hdrsiz_tcp (struct tcpcb *);
322
323struct ip;
324extern const char *ipsec4_logpacketstr (struct ip *, u_int32_t);
325extern const char *ipsec_logsastr (struct secasvar *);
326#endif /* _KERNEL */
327
328extern void ipsec_dumpmbuf (struct mbuf *);
329
330extern int ipsec4_output (struct ipsec_output_state *, struct secpolicy *, int);
331extern int ipsec4_tunnel_validate (struct mbuf *, int, u_int, struct secasvar *);
332extern struct mbuf *ipsec_copypkt (struct mbuf *);
333extern void ipsec_delaux (struct mbuf *);
334extern int ipsec_setsocket (struct mbuf *, struct socket *);
335extern struct socket *ipsec_getsocket (struct mbuf *);
336extern int ipsec_addhist (struct mbuf *, int, u_int32_t);
337extern struct ipsec_history *ipsec_gethist (struct mbuf *, int *);
338extern void ipsec_clearhist (struct mbuf *);
339
340extern caddr_t ipsec_set_policy (char *, int);
341extern int ipsec_get_policylen (caddr_t);
342extern char *ipsec_dump_policy (caddr_t, char *);
343
344extern const char *ipsec_strerror (void);
345
346#endif /* _NETINET6_IPSEC_H_ */
inpcb
Definition: in_pcb.h:61
inpcbpolicy
Definition: ipsec.h:115
ipsec_history
Definition: ipsec.h:280
ipsec_output_state
Definition: ipsec.h:274
ipsecrequest
Definition: ipsec.h:102
ipsecstat
Definition: ipsec.h:187
mbuf
Definition: mbuf.h:6
route
Definition: route.h:55
secpolicy
Definition: ipsec.h:73
secpolicyindex
Definition: ipsec.h:57
secspacq
Definition: ipsec.h:122
sockaddr_storage
Definition: in.h:245
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
tcpcb
Definition: tcp_var.h:81


Watt-32 tcp/ip: E:/WATT/inc/netinet/ipv6.h Source File

  • inc
  • netinet
ipv6.h
Go to the documentation of this file.
1
5/*
6 * Linux INET6 implementation
7 *
8 * Authors:
9 * Pedro Roque <roque@di.fc.ul.pt>
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 *
16 * NB! Don't use this file. Use <netinet/in.h> instread.
17 */
18
19#ifndef _NET_IPV6_H
20#define _NET_IPV6_H
21
22#ifndef __NETINET_IN_H
23#include <netinet/in.h> /* in6_addr */
24#endif
25
26/*
27 * Advanced API
28 * source interface/address selection, source routing, etc...
29 * *under construction*
30 */
31W32_CLANG_PACK_WARN_OFF()
32
33#include <sys/pack_on.h>
34
35/*
36 * IPv6 fixed header
37 */
38struct ipv6hdr {
39 unsigned char ipv6_priority:4;
40 unsigned char ipv6_version:4;
41 unsigned char ipv6_flow_lbl[3];
42 unsigned short ipv6_len;
43 unsigned char ipv6_nextheader;
44 unsigned char ipv6_hoplimit;
45 struct in6_addr ipv6_src;
46 struct in6_addr ipv6_dst;
47 };
48
49
50/*
51 * The length of this struct cannot be greater than the length of
52 * the proto_priv field in a sk_buff which is currently
53 * defined to be 16 bytes.
54 * Pointers take upto 8 bytes (sizeof(void *) is 8 on the alpha).
55 */
56struct ipv6_options {
57 /* length of extension headers */
58 unsigned short opt_flen; /* after fragment hdr */
59 unsigned short opt_nflen; /* before fragment hdr */
60 /*
61 * protocol options
62 * usualy carried in IPv6 extension headers
63 */
64 struct ipv6_rt_hdr *srcrt; /* Routing Header */
65 };
66
67struct in6_pktinfo {
68 struct in6_addr ipi6_addr;
69 int ipi6_ifindex;
70 };
71
72struct in6_ifreq {
73 struct in6_addr ifr6_addr;
74 unsigned long ifr6_prefixlen;
75 unsigned long ifr6_ifindex;
76 };
77
78#define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */
79#define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */
80
81/*
82 * routing header
83 */
84struct ipv6_rt_hdr {
85 unsigned char nexthdr;
86 unsigned char hdrlen;
87 unsigned char type;
88 unsigned char segments_left;
89 /*
90 * type specific data
91 * variable length field
92 */
93 };
94
95/*
96 * routing header type 0 (used in cmsghdr struct)
97 */
98struct ipv6_rt0_hdr {
99 struct ipv6_rt_hdr rt_hdr;
100 unsigned long bitmap; /* strict/loose bit map */
101#ifndef __WATCOMC__
102 struct in6_addr addr[0];
103#endif
104#define rt0_type rt_hdr.type;
105 };
106
107/*
108 * NextHeader field of IPv6 header
109 */
110
111#define NEXTHDR_HOP 0 /* Hop-by-hop option header. */
112#define NEXTHDR_TCP 6 /* TCP segment. */
113#define NEXTHDR_UDP 17 /* UDP message. */
114#define NEXTHDR_IPV6 41 /* IPv6 in IPv6 */
115#define NEXTHDR_ROUTING 43 /* Routing header. */
116#define NEXTHDR_FRAGMENT 44 /* Fragmentation/reassembly header. */
117#define NEXTHDR_ESP 50 /* Encapsulating security payload. */
118#define NEXTHDR_AUTH 51 /* Authentication header. */
119#define NEXTHDR_ICMP 58 /* ICMP for IPv6. */
120#define NEXTHDR_NONE 59 /* No next header */
121#define NEXTHDR_DEST 60 /* Destination options header. */
122
123#define NEXTHDR_MAX 255
124
125
126#define IPV6_DEFAULT_HOPLIMIT 64
127#define IPV6_DEFAULT_MCASTHOPS 1
128
129/*
130 * Addr type
131 *
132 * type - unicast | multicast | anycast
133 * scope - local | site | global
134 * v4 - compat
135 * v4mapped
136 * any
137 * loopback
138 */
139
140#define IPV6_ADDR_ANY 0x0000U
141
142#define IPV6_ADDR_UNICAST 0x0001U
143#define IPV6_ADDR_MULTICAST 0x0002U
144#define IPV6_ADDR_ANYCAST 0x0004U
145
146#define IPV6_ADDR_LOOPBACK 0x0010U
147#define IPV6_ADDR_LINKLOCAL 0x0020U
148#define IPV6_ADDR_SITELOCAL 0x0040U
149
150#define IPV6_ADDR_COMPATv4 0x0080U
151
152#define IPV6_ADDR_SCOPE_MASK 0x00f0U
153
154#define IPV6_ADDR_MAPPED 0x1000U
155#define IPV6_ADDR_RESERVED 0x2000U /* reserved address space */
156
157/*
158 * fragmentation header
159 */
160struct ipv6_fraghdr {
161 unsigned char nexthdr;
162 unsigned char reserved;
163 unsigned short frag_off;
164 unsigned long identification;
165 };
166#define fraghdr ipv6_fraghdr
167
168#include <sys/pack_off.h>
169
170W32_CLANG_PACK_WARN_DEF()
171
172#endif
173
in.h
pack_off.h
in6_addr
Definition: in.h:151
in6_ifreq
Definition: ipv6.h:72
in6_pktinfo
Definition: ipv6.h:67
ipv6_fraghdr
Definition: ipv6.h:160
ipv6_options
Definition: ipv6.h:56
ipv6_rt0_hdr
Definition: ipv6.h:98
ipv6_rt_hdr
Definition: ipv6.h:84


Watt-32 tcp/ip: E:/WATT/inc/rpc/key_prot.h Source File

  • inc
  • rpc
key_prot.h
Go to the documentation of this file.
1
5/*
6 * This is a RPCGEN generated file. Do not edit.
7 *
8 * Generated: Sun Mar 14 19:22:40 1999
9 */
10
11#ifndef __KEY_PROT_H
12#define __KEY_PROT_H
13
14#include <rpc/auth.h>
15
16/*
17 * Copyright (c) 1988 by Sun Microsystems, Inc.
18 */
19#define PROOT 3
20#define HEXMODULUS "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b"
21#define HEXKEYBYTES 48
22#define KEYSIZE 192
23#define KEYBYTES 24
24#define KEYCHECKSUMSIZE 16
25
26typedef enum keystatus {
27 KEY_SUCCESS = 0,
28 KEY_NOSECRET = 1,
29 KEY_UNKNOWN = 2,
30 KEY_SYSTEMERR = 3
31 } keystatus;
32bool_t xdr_keystatus();
33
34#ifndef KERNEL
35
36typedef char keybuf[HEXKEYBYTES];
37bool_t xdr_keybuf();
38
39#endif
40
41typedef char *netnamestr;
42bool_t xdr_netnamestr();
43
44
45typedef struct cryptkeyarg {
46 netnamestr remotename;
47 des_block deskey;
48 } cryptkeyarg;
49bool_t xdr_cryptkeyarg();
50
51
52typedef struct cryptkeyres {
53 keystatus status;
54 union {
55 des_block deskey;
56 } cryptkeyres_u;
57 } cryptkeyres;
58bool_t xdr_cryptkeyres();
59
60#define MAXGIDS 16
61
62typedef struct unixcred {
63 long uid;
64 long gid;
65 struct {
66 u_long gids_len;
67 long *gids_val;
68 } gids;
69 } unixcred;
70bool_t xdr_unixcred();
71
72
73typedef struct getcredres {
74 keystatus status;
75 union {
76 unixcred cred;
77 } getcredres_u;
78 } getcredres;
79bool_t xdr_getcredres();
80
81
82#define KEY_PROG 100029UL
83#define KEY_VERS 1UL
84#define KEY_SET 1UL
85extern long *key_set_1();
86
87#define KEY_ENCRYPT 2UL
88extern cryptkeyres *key_encrypt_1();
89
90#define KEY_DECRYPT 3UL
91extern cryptkeyres *key_decrypt_1();
92
93#define KEY_GEN 4UL
94extern des_block *key_gen_1();
95
96#define KEY_GETCRED 5UL
97extern getcredres *key_getcred_1();
98
99
100#endif /* !__KEY_PROT_H */
auth.h
cryptkeyarg
Definition: key_prot.h:45
cryptkeyres
Definition: key_prot.h:52
getcredres
Definition: key_prot.h:73
unixcred
Definition: key_prot.h:62
des_block
Definition: auth.h:80


Watt-32 tcp/ip: E:/WATT/src/language.c Source File

  • src
language.c
Go to the documentation of this file.
1
15#include <stdio.h>
16#include <stdlib.h>
17#include <string.h>
18#include <ctype.h>
19#include <setjmp.h>
20
21#if defined(_MSC_VER) || defined(__TURBOC__) || defined(__BORLANDC__)
22 #define YY_NO_UNISTD_H
23
24#elif defined(__WATCOMC__)
25 #include <stdint.h>
26
27#elif defined(__BORLANDC__)
28 /*
29 * Refer Makefile.all for the '-DFLEXINT_H=1' etc. hacks.
30 */
31#endif
32
33#define YY_NO_INPUT 1
34#define YY_MAIN 0 /* no main() function */
35#define YY_STACK_USED 0 /* only in some old Flex'er */
36#define YY_ALWAYS_INTERACTIVE 0
37#define YY_NEVER_INTERACTIVE 1
38#define YY_FATAL_ERROR(msg) Fatal (msg, NULL)
39
40#include "wattcp.h"
41#include "sock_ini.h"
42#include "pcconfig.h"
43#include "run.h"
44#include "misc.h"
45#include "misc_str.h"
46
47#if defined(USE_LANGUAGE)
48 #define WATT32_COMPILE_LANG_C
49 #include "language.h"
50 #include "lang.c"
51
52#elif defined(TEST_PROG)
53int main (void)
54{
55 puts ("This program needs '#define USE_LANGUAGE'");
56 return (1);
57}
58#endif
language.h
misc.h
misc_str.h
pcconfig.h
sock_ini.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/language.h Source File

  • src
language.h
Go to the documentation of this file.
1#ifndef _w32_LANGUAGE_H
2#define _w32_LANGUAGE_H
3
14#if defined(USE_LANGUAGE)
15 extern void lang_init (const char *value);
16 extern const char *lang_xlate (const char *str);
17 #define _LANG(str) lang_xlate (str)
18#else
19 #define _LANG(str) str
20#endif
21
22/*
23 * __LANG() must be used for array string constants. This macro is used by
24 * the `mklang' to generate an entry in the language database.
25 */
26#define __LANG(str) str
27
28#endif


Watt-32 tcp/ip: E:/WATT/src/linkaddr.c Source File

  • src
linkaddr.c
Go to the documentation of this file.
1
5/* Copyright (c) 1990, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * $Id: linkaddr.c,v 1.2 1998/08/20 21:56:24 joel Exp $
37 */
38
39#include "socket.h"
40
41#if defined(USE_BSD_API)
42
43/* States
44 */
45#define NAMING 0
46#define GOTONE 1
47#define GOTTWO 2
48#define RESET 3
49
50/* Inputs
51 */
52#define DIGIT (4*0)
53#define END (4*1)
54#define DELIM (4*2)
55#define LETTER (4*3)
56
57void W32_CALL link_addr (const char *addr, struct sockaddr_dl *sdl)
58{
59 char *cp = sdl->sdl_data;
60 char *cplim = sdl->sdl_len + (char*) sdl;
61 int Byte = 0;
62 int state = NAMING;
63 int New = 0;
64
65 memset (&sdl->sdl_family, 0, sdl->sdl_len - 1);
66 sdl->sdl_family = AF_LINK;
67
68 do
69 {
70 state &= ~LETTER;
71 if (*addr >= '0' && *addr <= '9')
72 New = *addr - '0';
73
74 else if (*addr >= 'a' && *addr <= 'f')
75 New = *addr - 'a' + 10;
76
77 else if (*addr >= 'A' && *addr <= 'F')
78 New = *addr - 'A' + 10;
79
80 else if (*addr == 0)
81 state |= END;
82
83 else if (state == NAMING &&
84 ((*addr >= 'A' && *addr <= 'Z') ||
85 (*addr >= 'a' && *addr <= 'z')))
86 state |= LETTER;
87
88 else
89 state |= DELIM;
90
91 addr++;
92 switch (state)
93 {
94 case NAMING | DIGIT:
95 case NAMING | LETTER:
96 *cp++ = addr[-1];
97 continue;
98 case NAMING | DELIM:
99 state = RESET;
100 sdl->sdl_nlen = (u_char)(cp - sdl->sdl_data);
101 continue;
102 case GOTTWO | DIGIT:
103 *cp++ = Byte;
104 /* FALLTHROUGH */
105 case RESET | DIGIT:
106 state = GOTONE;
107 Byte = New;
108 continue;
109 case GOTONE | DIGIT:
110 state = GOTTWO;
111 Byte = New + (Byte << 4);
112 continue;
113 default: /* | DELIM */
114 state = RESET;
115 *cp++ = Byte;
116 Byte = 0;
117 continue;
118 case GOTONE | END:
119 case GOTTWO | END:
120 *cp++ = Byte;
121 /* FALLTHROUGH */
122 case RESET | END:
123 break;
124 }
125 break;
126 }
127 while (cp < cplim);
128
129 sdl->sdl_alen = (u_char)(cp - LLADDR(sdl));
130 New = (int) (cp - (char*)sdl);
131 if (New > (int)sizeof(*sdl))
132 sdl->sdl_len = New;
133}
134
135char * W32_CALL link_ntoa (const struct sockaddr_dl *sdl)
136{
137 static char obuf[64];
138 char *out = obuf;
139 const BYTE *in = (const BYTE*) LLADDR (sdl);
140 const BYTE *inlim = in + sdl->sdl_alen;
141 BOOL firsttime = TRUE;
142
143 if (sdl->sdl_nlen)
144 {
145 memcpy (obuf, sdl->sdl_data, sdl->sdl_nlen);
146 out += sdl->sdl_nlen;
147 if (sdl->sdl_alen)
148 *out++ = ':';
149 }
150 while (in < inlim && out < obuf+sizeof(obuf)-3)
151 {
152 int Byte = *in++;
153
154 if (firsttime)
155 firsttime = FALSE;
156 else *out++ = '.';
157 if (Byte > 0xF)
158 {
159 *out++ = hex_chars_lower [Byte >> 4];
160 *out++ = hex_chars_lower [Byte & 0xf];
161 }
162 else
163 *out++ = hex_chars_lower [Byte];
164 }
165 *out = '\0';
166 return (obuf);
167}
168#endif /* USE_BSD_API */
169
sockaddr_dl
Definition: if_dl.h:71


Watt-32 tcp/ip: E:/WATT/src/listen.c Source File

  • src
listen.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 * 0.6 : Aug 08, 2002 : G. Vanem - added AF_INET6 support
37 */
38
39#include "socket.h"
40
41#if defined(USE_BSD_API)
42
43int W32_CALL listen (int s, int backlog)
44{
45 Socket *socket = _socklist_find (s);
46
47 SOCK_PROLOGUE (socket, "\nlisten:%d", s);
48
49 if (!socket->local_addr) /* bind() not called */
50 {
51 SOCK_DEBUGF ((", EINVAL"));
52 SOCK_ERRNO (EINVAL);
53 return (-1);
54 }
55
56 if (socket->so_type != SOCK_STREAM)
57 {
58 SOCK_DEBUGF ((", EOPNOTSUPP"));
59 SOCK_ERRNO (EOPNOTSUPP);
60 return (-1);
61 }
62
63 _sock_set_syn_hook (_sock_append);
64
65#if defined(USE_IPV6)
66 if (socket->so_family == AF_INET6)
67 {
68 struct in6_addr addr;
69
70 memset (&addr, 0, sizeof(addr)); /* unspecified addr */
71 _TCP6_listen (socket, &addr, socket->local_addr->sin_port);
72 }
73 else
74#endif
75 {
76 struct in_addr addr;
77
78 addr.s_addr = INADDR_ANY;
79 _TCP_listen (socket, addr, socket->local_addr->sin_port);
80 }
81
82 SOCK_DEBUGF ((", port %d", ntohs(socket->local_addr->sin_port)));
83
84 /* A listen socket should never time out unless
85 * setsockopt(SO_RCVTIMEOUT) is called prior to
86 * accept().
87 */
88 socket->timeout = 0;
89 socket->so_state |= SS_ISLISTENING;
90 socket->so_options |= SO_ACCEPTCONN;
91
92 /* legal backlog range [1..SOMAXCONN>
93 */
94 socket->backlog = min (backlog, SOMAXCONN-1);
95 socket->backlog = max (socket->backlog, 1);
96 SOCK_DEBUGF ((", backlog %d ", socket->backlog));
97 return (0);
98}
99#endif /* USE_BSD_API */
100
101#if defined(TEST_PROG) /* A simple finger server */
102#if !defined(USE_BSD_API)
103int main (void)
104{
105 puts ("This program needs '#define USE_BSD_API'");
106 return (1);
107}
108#else /* rest of file */
109
110#ifndef __CYGWIN__
111#include <conio.h>
112#endif
113
114#define FINGER_PORT 79
115
116int main (void)
117{
118 struct sockaddr_in addr;
119 int serv_sock, cli_sock = -1;
120 BOOL quit = FALSE;
121
122 dbug_init();
123
124 serv_sock = socket (AF_INET, SOCK_STREAM, 0);
125 if (serv_sock < 0)
126 {
127 perror ("socket");
128 return (-1);
129 }
130
131 memset (&addr, 0, sizeof(addr));
132 addr.sin_family = AF_INET;
133 addr.sin_port = htons (FINGER_PORT);
134 addr.sin_addr.s_addr = htonl (INADDR_ANY);
135
136 if (bind(serv_sock, (struct sockaddr*)&addr, sizeof(addr)) < 0)
137 {
138 perror ("bind");
139 close_s (serv_sock);
140 return (-1);
141 }
142
143 if (listen(serv_sock, 5) == -1)
144 {
145 perror ("listen");
146 close_s (serv_sock);
147 return (-1);
148 }
149
150 printf ("Watt-32 finger server.\nPress ESC to quit\n");
151
152 while (!quit)
153 {
154 struct timeval tv = { 1, 0 };
155 struct sockaddr_in peer;
156 const char *who = "Login Name Tty Idle Login Time\r\n"
157 "root root *1 Aug 22 10:15\r\n"
158 "guest guest *2 Aug 22 11:22\r\n";
159 fd_set rd;
160 int len = sizeof(peer);
161 int num;
162
163 if (kbhit() && getch() == 27)
164 quit = TRUE;
165
166 FD_ZERO (&rd);
167 FD_SET (serv_sock, &rd);
168
169 num = select_s (serv_sock+1, &rd, NULL, NULL, &tv);
170 if (num < 0)
171 {
172 perror ("select_s");
173 break;
174 }
175 if (num == 0)
176 {
177 putchar ('.');
178 fflush (stdout);
179 continue;
180 }
181
182 if (!FD_ISSET(serv_sock,&rd))
183 continue;
184
185 cli_sock = accept (serv_sock, (struct sockaddr*)&peer, &len);
186 if (cli_sock < 0)
187 {
188 perror ("accept");
189 break;
190 }
191
192 printf ("Finger request from %s (%u)\n",
193 inet_ntoa(peer.sin_addr), ntohs(peer.sin_port));
194
195 if (send(cli_sock, who, strlen(who), 0) < 0)
196 {
197 perror ("write_s");
198 break;
199 }
200 close_s (cli_sock); /* ready for next client */
201 cli_sock = -1;
202 }
203
204 if (cli_sock != -1)
205 close_s (cli_sock);
206 close_s (serv_sock);
207 return (0);
208}
209#endif /* TEST_PROG */
210#endif /* USE_BSD_API */
_sock_append
int _sock_append(_tcp_Socket **tcp)
Called from tcp_fsm.c / tcp_listen_state() (via _bsd_socket_hook) to append a new connection to the l...
Definition: accept.c:426
accept
int W32_CALL accept(int s, struct sockaddr *addr, socklen_t *addrlen)
Definition: accept.c:67
bind
int W32_CALL bind(int s, const struct sockaddr *myaddr, socklen_t namelen)
bind() - bind name to socket.
Definition: bind.c:63
select_s
int W32_CALL select_s(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
The select_s() function.
Definition: select.c:107
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
_TCP6_listen
int _TCP6_listen(Socket *socket, const void *host, WORD loc_port)
Definition: socket.c:2148
Socket
Definition: socket.h:158
fd_set
Definition: wtypes.h:256
in6_addr
Definition: in.h:151
in_addr
Definition: in.h:143
sockaddr_in
Definition: in.h:224
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
timeval
Definition: wtime.h:30


Watt-32 tcp/ip: E:/WATT/src/lookup.c Source File

  • src
lookup.c
Go to the documentation of this file.
1
31#include <stdio.h>
32#include <stdlib.h>
33#include <string.h>
34
35#include "wattcp.h"
36#include "language.h"
37#include "netaddr.h"
38#include "misc.h"
39#include "misc_str.h"
40#include "pcdns.h"
41#include "ip4_in.h"
42#include "pcdbug.h"
43#include "pctcp.h"
44
45DWORD W32_CALL lookup_host (const char *host, char *ip_str)
46{
47 DWORD ip;
48
49 WATT_ASSERT (host);
50
51 if (isaddr(host))
52 ip = aton (host);
53 else
54 {
55 outs (_LANG("Resolving "));
56 outs (host);
57 outs ("...");
58 ip = resolve (host);
59 if (ip)
60 {
61 if (dom_cname[0] && debug_on >= 1)
62 {
63 outs ("CNAME ");
64 outs (dom_cname);
65 outs (" ");
66 }
67 outsnl (_inet_ntoa(NULL,ip));
68 }
69 }
70
71 if (!_ip4_is_loopback_addr(ip) && _ip4_is_multihome_addr(ip))
72 {
73#if defined(USE_DEBUG)
74 (*_printf) ("Cannot connect to ourself\n");
75#endif
76 return (0);
77 }
78
79 if (ip_str)
80 _inet_ntoa (ip_str, ip);
81 return (ip);
82}
ip4_in.h
language.h
misc.h
misc_str.h
aton
DWORD W32_CALL aton(const char *str)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
Definition: netaddr.c:86
isaddr
BOOL W32_CALL isaddr(const char *str)
Check if 'str' is simply an ip address.
Definition: netaddr.c:128
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
pcdbug.h
resolve
DWORD W32_CALL resolve(const char *name)
Convert host name to an address.
Definition: pcdns.c:771
pcdns.h
pctcp.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/loopback.c Source File

  • src
loopback.c
Go to the documentation of this file.
1
48#include <stdio.h>
49#include <stdlib.h>
50
51#include "wattcp.h"
52#include "misc.h"
53#include "misc_str.h"
54#include "chksum.h"
55#include "ip4_in.h"
56#include "ip6_in.h"
57#include "pcsed.h"
58#include "pcstat.h"
59#include "pcicmp.h"
60#include "loopback.h"
61
62WORD loopback_mode = LBACK_MODE_ENABLE;
63
64#if defined(USE_LOOPBACK)
65
66#if 0
67
68 A sketch of calls involved in sending/receiving an IP-packet
69
70
71 Sending an IP-packet | Receiving an IP-packet
72 --------------------------------|-----------------------------------
73 | | |
74 | | tcp_tick()
75 | | |
76 _eth_formatpacket() ->buffer X | _eth_arrived()
77 | | |
78 _ip4_output() | poll_recv_queue()
79 | | |
80 | | |
81 _eth_send() enqueue copy of |
82 | X to IP-queue |
83 *----->loopback_device()--*-->>>>>>-<-------pkt_poll_recv()
84 | (1) | | | | |
85 | | | | | |
86 | | | | | |
87 | | | | | |
88 _pkt_send() drop buffer X \ | | none _ip4_handler()
89 | | | | |
90 | | | \ ip4_defragment()
91 | | | |
92 | | | protocol handlers
93 | | | |
94 | | | _eth_free()
95 v | | |
96 packet-driver | `-----------<-- pkt_free_pkt()
97 | | |
98 Ethernet/PPP \
99
100 From the above it evident the current design cannot easily send
101 IP-fragments. _ip4_output() must be rewritten to handle max. 64kB
102 packets, split them in make_fragments(), format a link-layer packet
103 using _eth_formatpacket() and repetively call _eth_send().
104
105 (1): A future Win32 version could try enqueueing to the Winsock
106 loopback handler. A TDI provider??
107#endif
108
109
110int (W32_CALL *loopback_handler) (in_Header*) = NULL;
111
112static int icmp_loopback (ICMP_PKT *icmp, unsigned icmp_len);
113static int udp_loopback (udp_Header *udp, unsigned udp_len);
114
122int loopback_device (in_Header *ip)
123{
124 int ip_len = 0;
125 DWORD ip_dst;
126 DWORD ip_ofs;
127 WORD ip_flg;
128
129 if (!(loopback_mode & LBACK_MODE_ENABLE))
130 return (-1);
131
132 if (ip->ver == 4)
133 {
134 int ip_hlen;
135
136 if (!_chk_ip4_header(ip)) /* silently discard */
137 return (-1);
138
139 ip_hlen = in_GetHdrLen (ip); /* length of IP-header (w/options) */
140 ip_len = intel16 (ip->length); /* total length of IP-packet */
141 ip_dst = ip->destination;
142
143 ip->destination = ip->source; /* swap source and destination */
144 ip->source = ip_dst;
145 ip->checksum = 0;
146 ip->checksum = ~CHECKSUM (ip, ip_hlen); /* redo check-sum */
147
148 ip_ofs = intel16 (ip->frag_ofs);
149 ip_flg = (WORD) (ip_ofs & ~IP_OFFMASK);
150 ip_ofs = (ip_ofs & IP_OFFMASK) << 3; /* 0 <= ip_ofs <= 65536-8 */
151
152 if (ip_ofs || (ip_flg & IP_MF)) /* fragment; let ip4_defragment() */
153 return (ip_len); /* handle it on next poll */
154
155 if (ip->proto == ICMP_PROTO)
156 {
157 ICMP_PKT *icmp = (ICMP_PKT*) ((BYTE*)ip + ip_hlen);
158 int len = icmp_loopback (icmp, ip_len - ip_hlen);
159
160 if (len > 0)
161 return (ip_hlen+len);
162 }
163 else if (ip->proto == UDP_PROTO)
164 {
165 udp_Header *udp = (udp_Header*) ((BYTE*)ip + ip_hlen);
166 int len = udp_loopback (udp, ip_len-ip_hlen);
167
168 if (len > 0)
169 return (ip_hlen+len);
170 }
171 }
172#if defined(USE_IPV6)
173 else if (ip->ver == 6)
174 {
175 in6_Header *ip6 = (in6_Header*)ip;
176 ip6_address ip6_dst;
177
178 ip_len = intel16 (ip6->len);
179 memcpy (&ip6_dst, &ip6->destination, sizeof(ip6_dst));
180 memcpy (&ip6->destination, &ip6->source, sizeof(ip6->destination));
181 memcpy (&ip6->source, &ip6_dst, sizeof(ip6->source));
182
183 if (ip6->next_hdr == IP6_NEXT_ICMP)
184 {
185 ICMP_PKT *icmp = (ICMP_PKT*) (ip6 + 1);
186 int len = icmp_loopback (icmp, ip_len);
187
188 if (len > 0)
189 return (len + sizeof(*ip6));
190 }
191 else if (ip6->next_hdr == UDP_PROTO)
192 {
193 udp_Header *udp = (udp_Header*) (ip6 + 1);
194 int len = udp_loopback (udp, ip_len);
195
196 if (len > 0)
197 return (len + sizeof(*ip6));
198 }
199 }
200 else
201 {
202 (*_printf) ("%s: Illegal IP-packet (ver %d) for loopback device\n",
203 __FILE__, ip->ver);
204 return (-1);
205 }
206#endif
207
208 if (loopback_handler)
209 ip_len = (*loopback_handler) (ip);
210 return (ip_len);
211}
212
213static int icmp_loopback (ICMP_PKT *icmp, unsigned icmp_len)
214{
215 if (icmp_len >= sizeof(icmp->echo) &&
216 CHECKSUM(icmp,icmp_len) == 0xFFFF &&
217 icmp->echo.type == ICMP_ECHO)
218 {
219 static WORD echo_seq_num = 0;
220
221 icmp->echo.type = ICMP_ECHOREPLY;
222 icmp->echo.sequence = echo_seq_num++;
223 icmp->echo.checksum = 0;
224 icmp->echo.checksum = ~CHECKSUM (icmp, icmp_len);
225 STAT (icmpstats.icps_reflect++);
226 STAT (icmpstats.icps_outhist[ICMP_ECHOREPLY]++);
227 return (icmp_len);
228 }
231 return (0);
232}
233
234static int udp_loopback (udp_Header *udp, unsigned udp_len)
235{
236 if (intel16(udp->dstPort) == IPPORT_ECHO)
237 {
239 }
240 else if (intel16(udp->dstPort) == IPPORT_DISCARD)
241 {
243 }
244 ARGSUSED (udp_len);
245 return (0);
246}
247
248/*
249 * An example loopback handler for RPC Portmapper (udp port 111)
250 * (Maybe an contradiction in terms to do RPC locally :-)
251 *
252 * int (W32_CALL *old_loopback) (const in_Header*) = NULL;
253 *
254 * static W32_CALL int pmap_loopback (const in_Header *ip)
255 * {
256 * WORD hlen = in_GetHdrLen (ip);
257 * const udp_Header *udp = (const udp_Header*) ((BYTE*)ip + hlen);
258 *
259 * if (ip->proto == UDP_PROTO && intel16(udp->dstPort) == 111)
260 * return do_portmapper (udp); // return length of IP reply packet
261 *
262 * if (old_loopback)
263 * return (*old_loopback) (ip);
264 * return intel16 (ip->length);
265 * }
266 *
267 * void init_pmap_loopback (void)
268 * {
269 * old_loopback = loopback_handler;
270 * loopback_handler = pmap_loopback;
271 * }
272 */
273
274#endif /* USE_LOOPBACK */
chksum.h
_ip4_handler
int _ip4_handler(const in_Header *ip, BOOL broadcast)
Definition: ip4_in.c:33
ip4_in.h
_ip4_output
int _ip4_output(in_Header *ip, DWORD src_ip, DWORD dst_ip, BYTE protocol, BYTE ttl, BYTE tos, WORD ip_id, int data_len, const void *sock, const char *file, unsigned line)
The IP4 packet transmitter.
Definition: ip4_out.c:86
ip6_in.h
udp_loopback
static int udp_loopback(udp_Header *udp, unsigned udp_len)
Definition: loopback.c:234
icmp_loopback
static int icmp_loopback(ICMP_PKT *icmp, unsigned icmp_len)
Definition: loopback.c:213
loopback.h
misc.h
misc_str.h
pcicmp.h
pkt_free_pkt
void pkt_free_pkt(const void *pkt)
Release a packet from the receive queue.
Definition: pcpkt.c:1346
poll_recv_queue
static union link_Packet * poll_recv_queue(WORD *type)
Poll the packet queue.
Definition: pcsed.c:868
_eth_send
int W32_CALL _eth_send(WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
Definition: pcsed.c:301
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
_eth_arrived
void *W32_CALL _eth_arrived(WORD *type_ptr, BOOL *broadcast)
Poll for arrival of new packets (IP/ARP/RARP/PPPoE protocol).
Definition: pcsed.c:996
_eth_free
void W32_CALL _eth_free(const void *pkt)
Free an input buffer once it is no longer needed.
Definition: pcsed.c:769
pcsed.h
pcstat.h
icmp
Definition: ip_icmp.h:66
in6_Header
Definition: wattcp.h:381
in_Header
Definition: wattcp.h:329
udp_Header
Definition: wattcp.h:406
ICMP_PKT
Definition: pcicmp.h:126
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/loopback.h Source File

  • src
loopback.h
Go to the documentation of this file.
1
3#ifndef _w32_LOOPBACK_H
4#define _w32_LOOPBACK_H
5
6#ifndef IPPORT_ECHO
7#define IPPORT_ECHO 7
8#endif
9
10#ifndef IPPORT_DISCARD
11#define IPPORT_DISCARD 9
12#endif
13
14#define LBACK_MODE_ENABLE 0x01
15#define LBACK_MODE_WINSOCK 0x10 /* highly experimental */
16
17extern WORD loopback_mode;
18extern int loopback_device (in_Header *);
19
20#endif
in_Header
Definition: wattcp.h:329


Watt-32 tcp/ip: E:/WATT/src/misc.c Source File

  • src
misc.c
Go to the documentation of this file.
1
14#include <signal.h>
15#include <limits.h>
16#include <math.h>
17
18#if defined(__HIGHC__)
19 #include <init.h> /* _mwlsl(), _msgetcs() */
20
21#elif defined(__DJGPP__)
22 #include <io.h> /* filelength() */
23
24#elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(__CYGWIN__)
25 #include <io.h>
26 #include <fcntl.h>
27 #include <sys/stat.h>
28
29 #if !defined(__CYGWIN__) && !defined(__POCC__)
30 #include <share.h>
31 #endif
32
33 #if defined(__ORANGEC__)
34 #ifndef _O_APPEND
35 #define _O_APPEND O_APPEND
36 #endif
37 #endif
38#endif
39
40#include "wattcp.h"
41#include "wdpmi.h"
42#include "x32vm.h"
43#include "powerpak.h"
44#include "cpumodel.h"
45#include "sock_ini.h"
46#include "pcsed.h"
47#include "pcpkt.h"
48#include "pcconfig.h"
49#include "pcdbug.h"
50#include "bsddbug.h"
51#include "ioport.h"
52#include "timer.h"
53#include "run.h"
54#include "misc_str.h"
55#include "misc.h"
56
57#ifndef LLONG_MAX
58#define LLONG_MAX 9223372036854775807LL
59#endif
60
61#if defined(USE_STACKWALKER)
62 /* Ref: http://blog.kalmbachnet.de/files/04-10-01__leakfinder.htm */
63 #include "stkwalk.h"
64#endif
65
66/* These arrays are used in several places (save some space)
67 */
68const char hex_chars_lower[] = "0123456789abcdef";
69const char hex_chars_upper[] = "0123456789ABCDEF";
70
71BOOL win32_dos_box = FALSE;
72BOOL _watt_crtdbg_check = FALSE;
73BOOL _watt_fatal_error = FALSE;
74WORD _watt_os_ver = 0x622;
75char _watt_assert_buf[256];
77/*
78 * Set through macro SOCK_ERRNO() in <sys/werrno.h>.
79 */
80int _w32_errno = 0;
81
82#if (DOSX & (PHARLAP|X32VM)) && defined(HAVE_FARPTR48)
83 FARPTR _watt_dosFp; /* we have 48-bit far-pointers */
84#endif
85
86/* The 64-bit gcc versions of these (i.e. MinGW64) are in cpumodel.S.
87 * But for other 64-bit targets, put this here for now.
88 */
89#if defined(__x86_64__) || defined(_M_X64)
90 int x86_have_cpuid = TRUE; /* All 64-bit CPU's have CPUID */
91 DWORD x86_capability;
92 char x86_type;
93 char x86_model;
94 char x86_mask;
95 int x86_hard_math;
96 char x86_vendor_id[13];
97
98 void cdecl CheckCpuType (void)
99 {
100 x86_type = 6;
101 x86_hard_math = 1;
102 x86_capability = (DWORD) -1; /* All flags on! */
103 strcpy (x86_vendor_id, "GenuineIntel");
104 }
105#endif
106
107#if (DOSX)
108 static void setup_dos_xfer_buf (void);
109#endif
110
111#define STATIC /* ease dis-assembly */
112
113#if defined(__BORLANDC__)
114 #pragma inline /* Will get inline if called. But not called for Win32 */
115
116 #if defined(USE_DEBUG) && (defined(__SMALL__) || defined(__LARGE__))
117 STATIC int setup_stk_check (void);
118 #endif
119
120#elif defined(WATCOM386) && defined(__MSDOS__)
121 extern char cdecl __begtext; /* label at TEXT start */
122 extern UINT cdecl _x386_stacklow;
123
124 #if defined(__SW_3S) /* wcc386 -3s */
125 void cdecl _fatal_runtime_error (UINT stk);
126 #define FATAL_HANDLER _fatal_runtime_error
127 #else
128 void cdecl _fatal_runtime_error_ (UINT stk);
129 #define FATAL_HANDLER _fatal_runtime_error_
130 #endif
131
132
133 /* Prevent linker (with 'option eliminate') to strip our
134 * '_fatal_runtime_error()' function from .exe-image.
135 */
136 char *dummy_fatal_rte = (char*)&FATAL_HANDLER;
137#endif
138
139/*
140 * These targets have a writable code-segment:
141 * Pharlap, X32VM or real-mode.
142 */
143#if (DOSX & (PHARLAP|X32VM)) || (DOSX == 0)
144#define CS_WRITABLE
145#endif
146
147#define MAKE_CS_WRITABLE() ((void)0)
148#define UNDO_CS_ACCESS() ((void)0)
150#if defined(USE_DEBUG) && defined(__BORLANDC__) && (defined(__SMALL__) || defined(__LARGE__))
151STATIC void test_stk_check (void)
152{
153 char buf [1000];
154 sprintf (buf, "In test_stk_check(): CS:IP %04X:%04X\n",
155 _CS, FP_OFF(test_stk_check));
156 puts (buf);
157}
158#endif
159
160/*
161 * Turn off stack-checking to avoid destroying assumptions
162 * made in bswap patch code below. And also to make this run
163 * a bit faster.
164 */
165#include "nochkstk.h"
166
171unsigned long W32_CDECL _w32_intel (unsigned long val)
172{
173 return ((val & 0x000000FFU) << 24) |
174 ((val & 0x0000FF00U) << 8) |
175 ((val & 0x00FF0000U) >> 8) |
176 ((val & 0xFF000000U) >> 24);
177}
178
183unsigned short W32_CDECL _w32_intel16 (unsigned short val)
184{
185 return ((val & 0x00FF) << 8) | ((val & 0xFF00) >> 8);
186}
187
188#if (DOSX) && defined(CS_WRITABLE)
189static const BYTE bswap32[] = {
190 0x8B, 0x44, 0x24, 0x04, /* mov eax, [esp+4] */
191 0x0F, 0xC8, /* bswap eax */
192 0xC3 /* ret */
193 };
194
195static const BYTE bswap16[] = {
196 0x8B, 0x44, 0x24, 0x04, /* mov eax, [esp+4] */
197 0x0F, 0xC8, /* bswap eax */
198 0xC1, 0xE8, 0x10, /* shr eax, 16 */
199 0xC3 /* ret */
200 };
201
202/*
203 * Modify functions intel/intel16 (htonl/htons) to use the
204 * BSWAP instruction on 80486+ CPUs. We don't bother with real-mode
205 * targets on a 80486+ CPU. Hope that size of overwritten functions
206 * are big enough.
207 */
208static void patch_with_bswap (void)
209{
210 MAKE_CS_WRITABLE(); /* save descriptor access, make RW */
211 memcpy ((void*)_w32_intel, (const void*)&bswap32, sizeof(bswap32));
212 memcpy ((void*)_w32_intel16,(const void*)&bswap16, sizeof(bswap16));
213 UNDO_CS_ACCESS(); /* set old descriptor access */
214}
215#endif /* (DOSX) && defined(CS_WRITABLE) */
216
222DWORD get_day_num (void)
223{
224#if defined(WIN32)
225 time_t now;
226
227 time (&now);
228 return ((DWORD)now / (24*3600));
229#else
230 struct dosdate_t d;
231
232 memset (&d, '\0', sizeof(d));
233 _dos_getdate (&d);
234 --d.month;
235 --d.day;
236 return ((d.year - 1970) * 365 + d.month * 31 + d.day);
237#endif
238}
239
240#if (DOSX) && defined(__MSDOS__)
241/*
242 * Safe check for an enabled RDTSC instruction.
243 * Requires an "GenuineIntel" Pentium CPU to call Get_CR4()
244 * (crashes on AMD K6-2 etc.).
245 */
246static BOOL RDTSC_enabled (void)
247{
248 const char *env = getenv ("USE_RDTSC");
249
250 use_rdtsc = (env && ATOI(env) > 0);
251
252 if (!use_rdtsc || /* Usage not enabled */
253 x86_type < 5) /* Not a Pentium class CPU */
254 return (FALSE);
255
256 if (!strncmp(x86_vendor_id, "AuthenticAMD", 12) &&
257 (x86_capability & X86_CAPA_TSC)) /* AMD with TSC, okay? */
258 return (TRUE);
259
260 if (!strncmp(x86_vendor_id, "CentaurHauls", 12)) /* Centaur/VIA is okay */
261 {
262#if 0
263 /* The following code was originally written by
264 * Michal Ludvig <michal@logix.cz> for VIA PadLock code
265 * in OpenSSL. http://www.logix.cz/michal
266 */
267 DWORD eax, ebx, ecx, edx;
268
269 get_cpuid (0xC0000000, &eax, &ebx, &ecx, &edx);
270 centaur_eflag = (eax >= 0xC0000001);
271 if (centaur_eflag)
272 {
273 get_cpuid (0xC0000001, &eax, &ebx, &ecx, &edx);
274 use_ace = ((edx & (0x3 << 6)) == (0x3 << 6)); /* Advanced Cryptography Engine */
275 use_rng = ((edx & (0x3 <<2 )) == (0x3 << 2)); /* Random Number Generator */
276 }
277#endif
278 return (TRUE);
279 }
280
281 if (strncmp(x86_vendor_id, "GenuineIntel", 12) || /* Not Genuine Intel or */
282 (x86_capability & X86_CAPA_TSC) == 0) /* RDTSC not supported */
283 return (FALSE);
284
285#if (DOSX)
286 return ((Get_CR4() & CR4_TS_DISABLE) == 0); /* True if not disabled */
287#else
288 return (TRUE); /* RDTSC never disabled in real-mode */
289#endif
290}
291#endif /* DOSX && __MSDOS__ */
292
293
294#if (DOSX == 0) && defined(USE_DEBUG)
302#define OffsetOf(x) (unsigned) &(x)
303
304static BOOL check_reg_struct (void)
305{
306#if defined(__WATCOMC__)
307 struct IREGS *r1 = NULL;
308 union REGPACK *r2 = NULL;
309
310 if ((OffsetOf(r2->w.ax) != OffsetOf(r1->r_ax)) ||
311 (OffsetOf(r2->w.bx) != OffsetOf(r1->r_bx)) ||
312 (OffsetOf(r2->w.cx) != OffsetOf(r1->r_cx)) ||
313 (OffsetOf(r2->w.dx) != OffsetOf(r1->r_dx)) ||
314 (OffsetOf(r2->w.bp) != OffsetOf(r1->r_bp)) ||
315 (OffsetOf(r2->w.si) != OffsetOf(r1->r_si)) ||
316 (OffsetOf(r2->w.di) != OffsetOf(r1->r_di)) ||
317 (OffsetOf(r2->w.ds) != OffsetOf(r1->r_ds)) ||
318 (OffsetOf(r2->w.es) != OffsetOf(r1->r_es)) ||
319 (OffsetOf(r2->x.flags) != OffsetOf(r1->r_flags)))
320 return (FALSE);
321
322#elif defined(__BORLANDC__)
323 struct IREGS *r1 = NULL;
324 struct REGPACK *r2 = NULL;
325
326 if ((OffsetOf(r2->r_ax) != OffsetOf(r1->r_ax)) ||
327 (OffsetOf(r2->r_bx) != OffsetOf(r1->r_bx)) ||
328 (OffsetOf(r2->r_cx) != OffsetOf(r1->r_cx)) ||
329 (OffsetOf(r2->r_dx) != OffsetOf(r1->r_dx)) ||
330 (OffsetOf(r2->r_bp) != OffsetOf(r1->r_bp)) ||
331 (OffsetOf(r2->r_si) != OffsetOf(r1->r_si)) ||
332 (OffsetOf(r2->r_di) != OffsetOf(r1->r_di)) ||
333 (OffsetOf(r2->r_ds) != OffsetOf(r1->r_ds)) ||
334 (OffsetOf(r2->r_es) != OffsetOf(r1->r_es)) ||
335 (OffsetOf(r2->r_flags) != OffsetOf(r1->r_flags)))
336 return (FALSE);
337#endif
338 return (TRUE);
339}
340#endif /* (DOSX == 0) && USE_DEBUG */
341
345void W32_CALL init_misc (void)
346{
347 static BOOL init = FALSE;
348
349 if (init)
350 return;
351
352 _watt_assert_buf[0] = '\0';
353
354#if defined(WIN32)
355 init_win_misc();
356
357#elif defined(__DJGPP__)
358 _watt_os_ver = _get_dos_version (1);
359
360#elif defined(MSC386)
361 _watt_os_ver = 0x500; /* Fake it for 32-bit MSVC */
362
363#else
364 _watt_os_ver = (_osmajor << 8) + _osminor;
365#endif
366
367#if defined(WIN32)
368 win32_dos_box = FALSE;
369#else
370 win32_dos_box = (_watt_os_ver >= 0x700 || /* DOS 7.x/8.x; Win-9x/ME */
371 _watt_os_ver == 0x501 || /* Borland PowerPak under Win32 */
372 _watt_os_ver == 0x532); /* DOS 5.50; Win-NT+ */
373#endif
374
375#if (DOSX & PHARLAP) && defined(HAVE_FARPTR48)
376 /*
377 * For 32-bit compilers with 48-bit far-pointers.
378 * `init_misc' MUST be called before `PEEKx()' functions are used.
379 */
380 FP_SET (_watt_dosFp, 0, SS_DOSMEM);
381
382#elif (DOSX & X32VM)
383 _watt_dosFp = MK_FP (_x386_zero_base_selector, 0);
384
385#elif defined(HAVE_FARPTR48) /* MSVC */
386 UNFINISHED();
387#endif
388
389#if defined(__DJGPP__) || defined(__HIGHC__)
390/* backtrace_init(); */
391#endif
392
393#if (DOSX)
394 setup_dos_xfer_buf(); /* A no-op on djgpp and Win32 */
395
396#elif defined(USE_DEBUG) /* real-mode */
397 if (!check_reg_struct())
398 {
399 outsnl (__FILE__ ": IREGS/REGPACK size mismatch!");
400 exit (-1);
401 }
402
403 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__LARGE__))
404 setup_stk_check();
405 #endif
406#endif
407
408 /* Check CPU type. Use RDTSC instruction if not forced off and
409 * it's not disabled. No CPU detection on big-endian machines yet.
410 */
411#if (DOSX) && defined(__MSDOS__)
412#if !(defined(__BORLANDC__) && defined(WIN32))
413 CheckCpuType();
414#endif
415
416 if (RDTSC_enabled()) /* Check if use of RDTSC is safe */
417 has_rdtsc = TRUE;
418
419#if defined(CS_WRITABLE) /* FALSE on most targets */
420 if (x86_type >= 4)
421 patch_with_bswap();
422#endif
423#endif /* DOSX && __MSDOS__ */
424
425#if defined(WIN32)
426 srand (GetTickCount()); /* should be redundant */
427#else
428 srand (PEEKW(0,0x46C)); /* initialize rand() using BIOS clock */
429#endif
430
431 /* init_misc() is called from gettimeofday2(). So don't do all this
432 * again when init_timers() calls gettimeofday2().
433 */
434 init = TRUE;
435 init_timers();
436
437#if 0 /* test */
438 printf ("qword_str(1234): '%s'\n", qword_str(1234ULL));
439 printf ("qword_str(123456789): '%s'\n", qword_str(123456789ULL));
440 printf ("qword_str(-123456789): '%s'\n", qword_str(-123456789ULL));
441 printf ("qword_str(LLONG_MAX+1): '%s'\n", qword_str(LLONG_MAX + 1ULL));
442 exit (0);
443#endif
444}
445
453FILE *fopen_excl (const char *file, const char *mode)
454{
455#if defined(WIN32) && !defined(__WATCOMC__) && !defined(__CYGWIN__)
456 int fd, flags = _O_CREAT | _O_WRONLY;
457
458#ifdef _O_SEQUENTIAL
459 flags |= _O_SEQUENTIAL;
460#endif
461
462 if (*mode == 'a')
463 flags |= _O_APPEND;
464 else flags |= _O_TRUNC;
465
466 if (mode[strlen(mode) - 1] == 'b')
467 flags |= O_BINARY;
468
469 fd = _sopen (file, flags, SH_DENYWR, S_IREAD | S_IWRITE);
470 if (fd <= -1)
471 return (NULL);
472 return fdopen (fd, mode);
473
474#else
475 return fopen (file, mode);
476#endif
477}
478
479/*
480 * Consolidated memory debug for MSVC CrtDbg.
481 */
482#if defined(USE_CRTDBG) /* For _MSC_VER / clang-cl (Win32/Win64) only */
483 #if !defined(_MSC_VER)
484 #error "Something wrong; USE_CRTDBG is for Visual-C only"
485 #endif
486
487/*
488 * USE_CRTDBG is set only when building with "cl -MDd" or "cl -MTd" (_DEBUG set).
489 */
490#if !defined(_CRT_RPTHOOK_INSTALL) && (_MSC_VER < 1300) /* VC headers too old */
491 #define _CRT_RPTHOOK_INSTALL 0
492 #define _CRT_RPTHOOK_REMOVE 1
493
494 _CRTIMP _CRT_REPORT_HOOK __cdecl _CrtSetReportHook2 (int, _CRT_REPORT_HOOK);
495#endif
496
497static _CrtMemState last_state;
498static void __cdecl crtdbg_exit (void);
499
500static const char *report_name (int type)
501{
502 return (type == _CRT_WARN ? "Warn" :
503 type == _CRT_ERROR ? "Error" :
504 type == _CRT_ASSERT ? "Assert" :
505 type == _CRT_ERRCNT ? "ErrCnt" : "??");
506}
507
508/*
509 * This doesn't seem to be called (?)
510 */
511static void __cdecl crtdbg_dump (void *buf, size_t len)
512{
513 const BYTE *p = (const BYTE*) buf;
514 size_t i;
515 int c;
516
517 fprintf (stderr, "dump: buf %p, %zu bytes\n", buf, len);
518 len = min (len, 30);
519 for (i = 0; i < len; i++)
520 {
521 c = *p++;
522 fprintf (stderr, "%c", isprint(c) ? c : '.');
523 }
524}
525
526static BOOL got_crt_assert;
527
528static int __cdecl crtdbg_report (int type, char *message, int *ret_val)
529{
530 fprintf (stderr, "%s: %s\n", report_name(type), message);
531 got_crt_assert = (type == _CRT_ASSERT);
532
533 if (message && !strnicmp(message, "Run-Time Check", 14)) /* 'cl -EHsc -RTCc' causes these */
534 got_crt_assert = 1;
535
536 if (got_crt_assert)
537 crtdbg_exit();
538
539 if (ret_val)
540 *ret_val = got_crt_assert; /* stopping forces a breakpoint (int 3) */
541 return (type == _CRT_ASSERT);
542}
543
544static void __cdecl crtdbg_exit (void)
545{
546#if defined(USE_STACKWALKER)
547 CONTEXT ctx;
548
549 memset (&ctx, '\0', sizeof(ctx));
550 if (got_crt_assert)
551 {
552 ctx.ContextFlags = CONTEXT_FULL;
553 got_crt_assert = FALSE; /* prevent reentry */
554 RtlCaptureContext (&ctx);
555
560 TRACE_CONSOLE (0, "\nGot _CRT_ASSERT. Backtrace:\n");
561 ShowStack (GetCurrentThread(), &ctx, NULL);
562 }
563
564 if (DeInitAllocCheck() > 0)
565 (*_printf) ("Mem-leaks detected; look at '%s' for details.\n", StackWalkLogFile());
566#endif /* USE_STACKWALKER */
567
568 /* Some bug is causing this not to be called every time.
569 */
570 _eth_release();
571
572 if (_watt_crtdbg_check)
573 {
574 _CrtMemState new_state, diff_state;
575
576 _CrtMemCheckpoint (&new_state);
577 _CrtSetReportHook (NULL);
578
579 /* Do this only if there is a significant difference in the mem-state.
580 */
581 if (_CrtMemDifference(&diff_state, &last_state, &new_state))
582 {
583 TRACE_CONSOLE (0, "\nA significant difference in the mem-state.\n");
584
585 _CrtMemDumpAllObjectsSince (&last_state);
586 _CrtMemDumpStatistics (&last_state);
587 _CrtCheckMemory();
588 _CrtDumpMemoryLeaks();
589 }
590 else
591 TRACE_CONSOLE (0, "\nNo significant difference in the mem-state.\n");
592 }
593}
594
595void memdbg_init (void)
596{
597#if defined(USE_STACKWALKER)
598 InitAllocCheck (ACOutput_Simple, TRUE, 0);
599
600#elif (_MSC_VER < 1500) || 1 /* !! */
601 _HFILE file = _CRTDBG_FILE_STDERR;
602 int mode = _CRTDBG_MODE_FILE;
603 int flags = _CRTDBG_LEAK_CHECK_DF |
604 _CRTDBG_DELAY_FREE_MEM_DF |
605 /* _CRTDBG_CHECK_CRT_DF | */ /* Don't report allocs in CRT */
606 _CRTDBG_CHECK_ALWAYS_DF |
607 _CRTDBG_ALLOC_MEM_DF;
608
609 if (getenv("WATT32-CRTDBG"))
610 _watt_crtdbg_check = TRUE;
611
612 TRACE_CONSOLE (2, "memdbg_init(): _watt_crtdbg_check = %d\n", _watt_crtdbg_check);
613
614 if (_watt_crtdbg_check)
615 {
616 _CrtSetReportFile (_CRT_ASSERT, file);
617 _CrtSetReportMode (_CRT_ASSERT, mode);
618 _CrtSetReportFile (_CRT_ERROR, file);
619 _CrtSetReportMode (_CRT_ERROR, mode);
620 _CrtSetReportFile (_CRT_WARN, file);
621 _CrtSetReportMode (_CRT_WARN, mode);
622
623 _CrtSetDbgFlag (flags | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG));
624
625 _CrtSetReportHook (crtdbg_report);
626 _CrtMemCheckpoint (&last_state);
627 _CrtSetDumpClient (crtdbg_dump);
628 }
629#endif /* USE_STACKWALKER */
630
631 RUNDOWN_ADD (crtdbg_exit, 311); /* after win32_exit() */
632}
633
634void memdbg_post_init (void)
635{
636#if defined(USE_STACKWALKER)
637 if (stkwalk_details == 1)
638 SetCallStackOutputType (ACOutput_Simple);
639 else if (stkwalk_details == 2)
640 SetCallStackOutputType (ACOutput_Advanced);
641#endif
642}
643#endif /* USE_CRTDBG */
644
645#if !defined(USE_CRTDBG)
646 void memdbg_init (void) {}
647 void memdbg_post_init (void) {}
648#endif
649
653void assert_fail (const char *file, unsigned line, const char *what)
654{
655 int (MS_CDECL *save_printf) (const char*, ...) = _printf;
656 int len;
657
658#if defined(WIN32)
659 DWORD err = GetLastError();
660
661#if defined(USE_STACKWALKER)
662 /*
663 * When calling ShowStack() we must do minimal work
664 * in sock_exit(). Fix this bug!!
665 */
666 _watt_fatal_error = 1;
667#endif
668
669 if (_watt_is_gui_app)
670 _printf = gui_printf;
671#endif /* WIN32 */
672
673#if defined(SNPRINTF)
674 len = SNPRINTF (_watt_assert_buf, sizeof(_watt_assert_buf) - 1,
675#else
676 len = sprintf (_watt_assert_buf,
677#endif
678 "%s (%u): Assertion `%s' failed.\n", file, line, what);
679
680#if defined(WIN32)
681 if (err && len > 0)
682 SNPRINTF (len + _watt_assert_buf, sizeof(_watt_assert_buf) - len, \
683 " GetLastError() %s", win_strerror(err));
684#endif
685
686 (*_printf) ("%s\n", _watt_assert_buf);
687 _printf = save_printf;
688
689 /*
690 * On djgpp abort() doesn't call atexit() functions but
691 * makes a handy traceback. We need to force a rundown_run()
692 * to release te packet-driver.
693 */
694 rundown_run();
695 abort(); /* doesn't return */
696 ARGSUSED (len);
697}
698
699/*
700 * Some tests for assert(), abort(), exception and mem-leak code.
701 */
702void W32_CALL assert_fail_test (void)
703{
704 int printer_ready = FALSE;
705
706#if defined(WIN32)
707 SetLastError (ERROR_PRINTER_DELETED); /* :-) */
708#endif
709
710 WATT_ASSERT (printer_ready);
711 ARGSUSED (printer_ready);
712}
713
714void W32_CALL abort_test (void)
715{
716 abort();
717 exit (-1);
718}
719
720void W32_CALL except_test (void)
721{
722 char **p = NULL;
723 *p = (char*) '\0';
724 exit (-1);
725}
726
727void W32_CALL leak_test (void)
728{
729 char *s = strdup ("foo-bar");
730
731 ARGSUSED (s);
732
733#ifdef USE_STACKWALKER
734 if (DeInitAllocCheck() > 0) /* Test leak reporting */
735 (*_printf) ("Mem-leaks detected; look at '%s' for details.\n", StackWalkLogFile());
736#endif
737 exit (-1);
738}
739
743unsigned W32_CALL Random (unsigned a, unsigned b)
744{
745 if (a == b)
746 return (a);
747
748 if (a > b)
749 {
750 unsigned tmp = b;
751 b = a;
752 a = tmp;
753 }
754 return (a + (unsigned)(rand() % (b-a+1)));
755}
756
760void W32_CALL RandomWait (unsigned a, unsigned b)
761{
762 DWORD t = set_timeout (Random(a, b));
763
764 while (!chk_timeout(t))
765 {
766#if defined(WIN32)
767 Sleep (1);
768#else
769 ENABLE();
770#endif
771 }
772}
773
777void Wait (unsigned msec)
778{
779 DWORD t = set_timeout (msec);
780
781 while (!chk_timeout(t))
782 {
783#if defined(WIN32)
784 Sleep (1);
785#else
786 ENABLE();
787#endif
788 }
789}
790
791/*
792 * Return a sensible name for running DOS-extender or subsystem.
793 */
794const char *dos_extender_name (void)
795{
796#if (DOSX & DOS4GW)
797 return dos4gw_extender_name();
798
799#elif (DOSX & DJGPP)
800 return ("djgpp");
801
802#elif (DOSX & PHARLAP)
803 return ("PharLap");
804
805#elif (DOSX & POWERPAK)
806 return ("PowerPak");
807
808#elif (DOSX & X32VM)
809 return ("X32VM");
810
811#elif defined(_WIN64)
812 return ("Win64");
813
814#elif (DOSX & WINWATT)
815 return ("Win32");
816
817#else
818 return (NULL);
819#endif
820}
821
822#if defined(WIN32)
823void os_yield (void)
824{
825 /* Since on Windows we cannot longjmp()
826 * out of our SIGINT-handler watt_sig_handler_watt(),
827 * we check the flag here.
828 */
829 if (!_watt_is_gui_app && _watt_cbroke)
830 {
831 BEEP();
832 sock_sig_exit ("\nTerminating.", SIGINT);
833 }
834 Sleep (10);
835}
836
837#else /* !WIN32 */
838
839void os_yield (void)
840{
841 static BOOL do_yield = TRUE;
842
843#if defined(__DJGPP__)
844 if (do_yield)
845 {
846 __dpmi_yield();
847 do_yield = (errno != ENOSYS);
848 }
849#else
850 if (!watt_kbhit() && do_yield) /* watt_kbhit() to enable ^C generation */
851 {
852 IREGS reg;
853
854 memset (&reg, '\0', sizeof(reg));
855 reg.r_ax = 0x1680;
856 GEN_INTERRUPT (0x2F, &reg);
857 do_yield = (loBYTE(reg.r_ax) != 0x80);
858 }
859#endif
860}
861#endif /* WIN32 */
862
863
864#if defined(NOT_USED)
865BOOL watt_check_break (void)
866{
867 WORD head = 0x400 + PEEKW (0, 0x41A);
868 WORD tail = 0x400 + PEEKW (0, 0x41C);
869 int ofs, num;
870
871 printf ("\nwatt_check_break(): head %04X, tail %04X, keys:\n",
872 head, tail);
873 for (num = 0, ofs = head; ofs != tail && num < 32; num++)
874 {
875 printf (" ofs %04X: %02X\n", ofs, PEEKB(0,ofs));
876 if (++ofs > 32+0x41E)
877 ofs = 0x41E;
878 }
879 puts ("");
880 return (FALSE);
881}
882#endif
883
887char *ctime_r (const time_t *t, char *res)
888{
889 const char *r = ctime (t);
890
891 WATT_ASSERT (res);
892 if (res && r)
893 return strcpy (res, r);
894 return (NULL);
895}
896
900struct tm *localtime_r (const time_t *t, struct tm *res)
901{
902 struct tm *r;
903
904 WATT_ASSERT (res);
905 r = localtime (t);
906 if (r && res)
907 {
908 memcpy (res, r, sizeof(*res));
909 return (r);
910 }
911 return (NULL);
912}
913
917int W32_CALL watt_kbhit (void)
918{
919#if defined(WIN32)
920 os_yield();
921 return kbhit(); /* for CygWin, kbhit() is in winmisc.c */
922
923#else
924 if (_watt_cbroke)
925 return (1);
926
927 /* If head and tail index of the keyboard buffer are the same,
928 * no key is waiting.
929 */
930 if (PEEKW(0,0x41A) == PEEKW(0,0x41C))
931 return (0);
932
933 /* RTL's kbhit() calls INT16/11 or INT21/0B which triggers INT 23
934 * which in turn should raise SIGINT in RTL. Except for djgpp under
935 * Windows where normal/extended BREAK checking is turned off (since
936 * SIGINT delivery by pressing ^C is so unreliable under Windows).
937 */
938 return kbhit();
939#endif
940}
941
946long W32_CALL watt_filelength (int fd)
947{
948#ifdef __CYGWIN__
949 struct stat st;
950
951 if (fstat(fd, &st) != 0)
952 return (-1);
953 return (st.st_size);
954#else
955 return filelength (fd);
956#endif
957}
958
959#if defined(USE_DEBUG)
963const char *list_lookup (DWORD type, const struct search_list *list, int num)
964{
965 static char buf [15];
966
967 while (num > 0 && list->name)
968 {
969 if (list->type == type)
970 return (list->name);
971 num--;
972 list++;
973 }
974 sprintf (buf, "?%lu", (u_long)type);
975 return (buf);
976}
977
978const char *list_lookupX (DWORD type, const struct search_list *list, int num)
979{
980 static char buf [15];
981
982 while (num > 0 && list->name)
983 {
984 if (list->type == type)
985 return (list->name);
986 num--;
987 list++;
988 }
989 sprintf (buf, "?0x%lX", (u_long)type);
990 return (buf);
991}
992
997const char *MAC_address (const void *addr)
998{
999 static char buf [2][25];
1000 static int idx = 0;
1001 char *rc = buf [idx];
1002 char *p = rc;
1003 const char *a = (const char*)addr;
1004
1005 p += sprintf (p, "%02X:%02X:%02X:%02X:%02X:%02X",
1006 a[0] & 255, a[1] & 255, a[2] & 255,
1007 a[3] & 255, a[4] & 255, a[5] & 255);
1008
1009 /* assume '*addr' is an 7-byte AX25 address
1010 */
1011 if (_pktdevclass == PDCLASS_AX25)
1012 sprintf (p, ":%02X", a[6] & 255);
1013
1014 idx ^= 1;
1015 return (rc);
1016}
1017
1022const char *dword_str (DWORD val)
1023{
1024 static char buf [20];
1025 char tmp[20];
1026
1027 if (val < 1000UL)
1028 {
1029 sprintf (buf, "%lu", (u_long)val);
1030 return (buf);
1031 }
1032 if (val < 1000000UL) /* 1E6 */
1033 {
1034 sprintf (buf, "%lu,%03lu", (u_long)(val/1000UL), (u_long)(val % 1000UL));
1035 return (buf);
1036 }
1037 if (val < 1000000000UL) /* 1E9 */
1038 {
1039 sprintf (tmp, "%9lu", (u_long)val);
1040 sprintf (buf, "%.3s,%.3s,%.3s", tmp, tmp+3, tmp+6);
1041 return strltrim (buf);
1042 }
1043 sprintf (tmp, "%12lu", (u_long)val);
1044 sprintf (buf, "%.3s,%.3s,%.3s,%.3s", tmp, tmp+3, tmp+6, tmp+9);
1045 return strltrim (buf);
1046}
1047
1048#if defined(HAVE_UINT64)
1053const char *qword_str (uint64 val)
1054{
1055 static char buf [30];
1056 char tmp [30], *p;
1057 const char *fmt = (val > LLONG_MAX) ? "%" S64_FMT : "%" U64_FMT;
1058 int len, i, j;
1059
1060#if defined(SNPRINTF)
1061 len = SNPRINTF (tmp, sizeof(tmp), fmt, val);
1062#else
1063 len = sprintf (tmp, fmt, val);
1064#endif
1065
1066 p = buf + sizeof(buf) - 1;
1067 *p-- = '\0';
1068
1069 /* Copy 'tmp[]' into 'buf[]' in reverse order. Add commas after each 3 digit.
1070 */
1071 for (i = len, j = -1; i >= 0; i--, j++)
1072 {
1073 if (tmp[i] != '-' && j > 0 && (j % 3) == 0)
1074 *p-- = ',';
1075 *p-- = tmp [i];
1076 }
1077 return (p+1);
1078}
1079#endif /* HAVE_UINT64 */
1080#endif /* USE_DEBUG */
1081
1082void unfinished (const char *func, const char *file, unsigned line)
1083{
1084 if (func)
1085 fprintf (stderr, "In `%s' ", func);
1086 fprintf (stderr, "%s (%u):\7 Help! Unfinished code.\n", file, line);
1087 exit (-1);
1088}
1089
1090void unimplemented (const char *func, const char *file, unsigned line)
1091{
1092 fprintf (stderr, "%s (%u): Function \"%s()\" not implemented for this target.\n",
1093 file, line, func);
1094}
1095
1096
1097#if (DOSX)
1098#if defined(BORLAND386) || defined(DMC386) || defined(MSC386)
1099DWORD get_ds_limit (void)
1100{
1101 DWORD res;
1102 asm mov ax, ds
1103 asm and eax, 0FFFFh
1104 asm lsl eax, eax
1105 asm mov res, eax
1106 return (res);
1107}
1108
1109DWORD get_cs_limit (void)
1110{
1111 DWORD res;
1112 asm mov ax, cs
1113 asm and eax, 0FFFFh
1114 asm lsl eax, eax
1115 asm mov res, eax
1116 return (res);
1117}
1118
1119DWORD get_ss_limit (void)
1120{
1121 DWORD res;
1122 asm mov ax, ss
1123 asm and eax, 0FFFFh
1124 asm lsl eax, eax
1125 asm mov res, eax
1126 return (res);
1127}
1128#endif /* BORLAND386 || DMC386 || MSC386 */
1129
1130/*
1131 * Test for valid read/write data address.
1132 * We assume linear address 'addr' is both readable and writable.
1133 *
1134 * \note MinGW (and other Win32 compilers?) puts 'const' data in
1135 * read-only sections (.rdata). Detectable with IsBadWritePtr().
1136 */
1137BOOL valid_addr (const void *addr, unsigned len)
1138{
1139#if defined(WIN32)
1140 /*
1141 * It seems it's a bad idea to use the IsBadXxxPtr() functions.
1142 * See the comment section here:
1143 * http://msdn.microsoft.com/en-us/library/windows/desktop/aa366716(v=vs.85).aspx
1144 */
1145 BOOL bad;
1146
1147#if !defined(__ORANGEC__)
1148 if (_watt_crit_sect.SpinCount == (ULONG_PTR)-1) /* DeleteCriticalSection() was called!? */
1149 return (FALSE);
1150#endif
1151
1152 ENTER_CRIT();
1153 bad = IsBadWritePtr ((void*)addr,len) || IsBadReadPtr (addr,len);
1154 LEAVE_CRIT();
1155 if (bad)
1156 return (FALSE);
1157
1158#else
1159
1160 DWORD limit, addr_ = (DWORD)addr;
1161
1162 if (addr_ < 4096) /* Valid in DOS4GW, but we never use such address */
1163 return (FALSE);
1164
1165 /* In X32VM: DS != SS. addr may be in data or stack.
1166 */
1167#if defined(DMC386) && (DOSX & X32VM) && 0 /* Doesn't work :-( */
1168 if (selector == MY_SS())
1169 {
1170 limit = get_ss_limit();
1171 if (addr_ < _x386_stacklow || addr_ + len >= limit)
1172 return (FALSE);
1173 if (limit > len && addr_ >= limit - len) /* Segment wrap */
1174 return (FALSE);
1175 }
1176 else if (selector != MY_DS())
1177 return (FALSE);
1178#endif
1179
1180#if defined(__DJGPP__)
1181 limit = __dpmi_get_segment_limit (_my_ds());
1182#elif defined(__HIGHC__)
1183 limit = _mwlsl (_mwgetcs()); /* DS & CS are aliases */
1184#else
1185 limit = get_ds_limit();
1186#endif
1187
1188 if (addr_ + len >= limit)
1189 return (FALSE);
1190 if (limit > len && addr_ >= limit - len) /* Segment wrap */
1191 return (FALSE);
1192#endif /* WIN32 */
1193
1194 return (TRUE);
1195}
1196#endif /* DOSX */
1197
1198/*
1199 * Pharlap/X32VM targets: Get location of (or allocate a) transfer buffer.
1200 * DOS4GW/PowerPak targets: Allocate a small (1kB) transfer buffer.
1201 * djgpp/Win32/Win64: Nothing special to do.
1202 */
1203#if (DOSX & (PHARLAP|X32VM))
1204 REALPTR _watt_dosTbr;
1205 DWORD _watt_dosTbSize = 0;
1206 static WORD rm_seg = 0;
1207
1208 static void free_selector (void)
1209 {
1210 if (rm_seg)
1211 _dx_real_free (rm_seg);
1212 rm_seg = 0;
1213 _watt_dosTbr = 0;
1214 _watt_dosTbSize = 0;
1215 }
1216
1217 static void setup_dos_xfer_buf (void)
1218 {
1219 FARPTR dos_tbp; /* pmode transfer-buffer address */
1220 REALPTR r2p_addr; /* rmode to pmode call address */
1221 WORD temp;
1222 int len = 1024; /* min size we need */
1223
1224 _dx_rmlink_get (&r2p_addr, &_watt_dosTbr,
1225 &_watt_dosTbSize, &dos_tbp);
1226
1227 if (_watt_dosTbSize < len &&
1228 _dx_real_above(len, &rm_seg, &temp) == 0)
1229 {
1230 RP_SET (_watt_dosTbr, 0, rm_seg);
1231 _watt_dosTbSize = len;
1232 RUNDOWN_ADD (free_selector, 15);
1233 }
1234 }
1235
1236#elif (DOSX & DOS4GW)
1237 WORD _watt_dosTbSeg = 0; /* paragraph address of xfer buffer */
1238 WORD _watt_dosTbSel = 0; /* selector for transfer buffer */
1239 DWORD _watt_dosTbSize = 0; /* size of transfer buffer */
1240
1241 static void free_selector (void)
1242 {
1243 if (_watt_dosTbSel)
1244 dpmi_real_free (_watt_dosTbSel);
1245 _watt_dosTbSel = 0;
1246 }
1247
1248 static void setup_dos_xfer_buf (void)
1249 {
1250 _watt_dosTbSize = 1024;
1251 _watt_dosTbSeg = dpmi_real_malloc (_watt_dosTbSize, &_watt_dosTbSel);
1252
1253 if (!_watt_dosTbSeg)
1254 _watt_dosTbSize = 0;
1255 else RUNDOWN_ADD (free_selector, 15);
1256 }
1257
1258#elif (DOSX & POWERPAK)
1259 WORD _watt_dos_ds;
1260 WORD _watt_dosTbSeg = 0;
1261 WORD _watt_dosTbSel = 0;
1262 DWORD _watt_dosTbr = 0;
1263 DWORD _watt_dosTbSize = 0;
1264
1265 static void free_selector (void)
1266 {
1267 if (_watt_dosTbSel)
1268 dpmi_real_free (_watt_dosTbSel);
1269 _watt_dosTbSel = 0;
1270 if (_watt_dos_ds)
1271 dpmi_free_dos_selector (_watt_dos_ds);
1272 _watt_dos_ds = 0;
1273 _watt_dosTbr = 0;
1274 }
1275
1276 static void setup_dos_xfer_buf (void)
1277 {
1278 _watt_dos_ds = dpmi_create_dos_selector();
1279 if (!_watt_dos_ds)
1280 {
1281 fprintf (stderr, "Fatal: Failed to create DOS selector. "
1282 "DPMI error 0x%04X.\n", __dpmi_errno);
1283 exit (-1);
1284 }
1285 _watt_dosTbSize = 1024;
1286 _watt_dosTbSeg = dpmi_real_malloc (_watt_dosTbSize, &_watt_dosTbSel);
1287 if (!_watt_dosTbSeg)
1288 _watt_dosTbSize = 0;
1289 else
1290 {
1291 RUNDOWN_ADD (free_selector, 15);
1292 _watt_dosTbr = (_watt_dosTbSeg << 16);
1293 }
1294 }
1295
1296#elif (DOSX)
1297 static void setup_dos_xfer_buf (void)
1298 {
1299 /* no-op */
1300 }
1301#endif
1302
1303
1304#if defined(USE_BSD_API)
1305/*
1306 * ffs() isn't needed yet, but could be used in select_s()
1307 *
1308 * Copyright (C) 1991, 1992 Free Software Foundation, Inc.
1309 * Contributed by Torbjorn Granlund (tege@sics.se).
1310 *
1311 * The GNU C Library is free software; you can redistribute it and/or
1312 * modify it under the terms of the GNU Library General Public License as
1313 * published by the Free Software Foundation; either version 2 of the
1314 * License, or (at your option) any later version.
1315 *
1316 * The GNU C Library is distributed in the hope that it will be useful,
1317 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1318 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1319 * Library General Public License for more details.
1320 *
1321 * You should have received a copy of the GNU Library General Public
1322 * License along with the GNU C Library; see the file COPYING.LIB. If
1323 * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
1324 * Cambridge, MA 02139, USA.
1325 */
1326
1327/*
1328 * Returns the index of first bit set in 'i'. Counting from 1 at
1329 * "right side". Returns 0 if 'i' is 0.
1330 */
1331int W32_CALL _w32_ffs (int i)
1332{
1333 static const BYTE table[] = {
1334 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
1335 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
1336 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
1337 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
1338 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
1339 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
1340 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
1341 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
1342 };
1343 DWORD a, x;
1344
1345#if (DOSX) && !(defined(__BORLANDC__) && defined(WIN32)) && !defined(__MINGW64__) && !defined(_M_X64)
1346 if (x86_type >= 3)
1347 return asm_ffs (i); /* BSF requires 386+ */
1348#endif
1349
1350 x = i & -i;
1351 a = x <= 0xFFFFUL ? (x <= 0xFF ? 0 : 8) : (x <= 0xFFFFFF ? 16 : 24);
1352 return (table[x >> a] + a);
1353}
1354#endif /* USE_BSD_API */
1355
1356
1357/*
1358 * Checks for bugs when compiling in large model C compiler
1359 *
1360 * Borland C uses a 4K stack by default. In all memory models the
1361 * stack grows down toward the heap.
1362 *
1363 * If you accidentally place _tcp_Socket onto the stack, then you
1364 * will have already used up that whole 4K and then some!
1365 *
1366 * In large model, this will mess up the data space in a major way
1367 * because the stack starts at SS:_stklen, or SS:1000, so you will
1368 * wrap the SP pointer back around to FFFE and start writing over
1369 * the far heap. Yuck.
1370 *
1371 * In small model it usually doesn't kill your application because
1372 * you would have to be down to your last 4K of memory and this is
1373 * not as common.
1374 *
1375 * The solutions: declare your sockets as static, or put them on the
1376 * heap, or bump up your stack size by using the global special variable:
1377 *
1378 * unsigned _stklen = 16536;
1379 */
1380
1381#if defined(__LARGE__)
1382void watt_large_check (const void *sock, int size,
1383 const char *file, unsigned line)
1384{
1385 if ((unsigned)(FP_OFF(sock)) > (unsigned)(-size))
1386 {
1387#if defined(USE_DEBUG)
1388 fprintf (stderr, "%s (%d): user stack size error", file, line);
1389#else
1390 outsnl ("user stack size error");
1391 ARGSUSED (file);
1392 ARGSUSED (line);
1393#endif
1394 exit (3);
1395 }
1396}
1397#endif /* __LARGE__ */
1398
1399
1400#if defined(USE_DEBUG)
1401#if defined(NOT_USED)
1402BOOL is_big_endian (void)
1403{
1404 /* From Harbison & Steele.
1405 */
1406 union {
1407 long l;
1408 char c[sizeof(long)];
1409 } u;
1410
1411 u.l = 1;
1412 return (u.c[sizeof(long)-1] == 1);
1413}
1414
1418#include <sys/pack_on.h>
1419
1420struct cmd_block {
1421 BYTE len;
1422 char buf [256];
1423 };
1424
1425#include <sys/pack_off.h>
1426
1427BOOL shell_exec (const char *cmd)
1428{
1429 struct cmd_block blk;
1430 size_t i = sizeof(blk.buf)-1;
1431 IREGS regs;
1432
1433 _strlcpy (blk.buf, cmd, i);
1434 i = min (i, strlen(blk.buf));
1435 blk.len = i;
1436 blk.buf[i] = '\r';
1437
1438#if (DOSX & DJGPP)
1439 regs.r_ds = __tb / 16;
1440 regs.r_si = __tb & 15;
1441 dosmemput (&blk, sizeof(blk), __tb);
1442
1443#elif (DOSX == 0)
1444 regs.r_ds = FP_SEG (&blk);
1445 regs.r_si = FP_OFF (&blk);
1446#endif
1447
1448 GEN_INTERRUPT (0x2E, &regs);
1449 return (regs.r_ax != 0xFFFF);
1450}
1451#endif /* NOT_USED */
1452
1453
1457#if (defined(_MSC_VER) || defined(__DMC__)) && (DOSX == 0)
1458#undef intr
1459void _w32_intr (int int_no, IREGS *reg)
1460{
1461 union REGS r;
1462 struct SREGS s;
1463
1464 r.x.ax = reg->r_ax;
1465 r.x.bx = reg->r_bx;
1466 r.x.cx = reg->r_cx;
1467 r.x.dx = reg->r_dx;
1468 r.x.si = reg->r_si;
1469 r.x.di = reg->r_di;
1470 s.ds = reg->r_ds;
1471 s.es = reg->r_es;
1472 int86x (int_no, &r, &r, &s);
1473 reg->r_flags = r.x.cflag;
1474 reg->r_ax = r.x.ax;
1475 reg->r_bx = r.x.bx;
1476 reg->r_cx = r.x.cx;
1477 reg->r_dx = r.x.dx;
1478 reg->r_si = r.x.si;
1479 reg->r_di = r.x.di;
1480 reg->r_ds = s.ds;
1481 reg->r_es = s.es;
1482}
1483#endif
1484
1485#if defined(__BORLANDC__) && defined(__LARGE__)
1486/*
1487 * Large model with option '-N' generates code like:
1488 * < .. standard prologue ...>
1489 * 39 26 00 00 cmp DGROUP:__stklen,sp
1490 * 77 05 ja Lxx
1491 * 9A 00 00 00 00 call F_OVERFLOW@
1492 * Lxx:
1493 *
1494 * We need to find the address of F_OVERFLOW@ (it cannot be addressed
1495 * from C).
1496 */
1497STATIC void stk_overflow (WORD ret_addr)
1498{
1499 static WORD cs, ip;
1500 static WORD stk[128];
1501
1502 cs = *(WORD*) (&ret_addr-1);
1503 ip = *(WORD*) (&ret_addr-2);
1504
1505 _SS = FP_SEG (stk);
1506 _SP = (WORD) &stk [DIM(stk)-1];
1507 _stklen = 0x7FFF;
1508 _watt_fatal_error = TRUE;
1509 fprintf (stderr, "\nStack overflow at %04X:%04X!\n", cs, ip);
1510 _eth_release();
1511 _exit (-1);
1512}
1513
1514STATIC int setup_stk_check (void)
1515{
1516 BYTE sign[] = { 0x39, 0x26, 0,0, 0x77, 5, 0x9A };
1517 BYTE *p = (BYTE*) _eth_arrived;
1518 int i;
1519
1520 *(WORD*)&sign[2] = FP_OFF (&_stklen);
1521
1522 for (i = 0; i < 10; i++, p++)
1523 {
1524 if (!memcmp(p, sign, sizeof(sign)))
1525 {
1526 DWORD addr = *(DWORD*) (p + sizeof(sign));
1527 BYTE *patch;
1528
1529 /* printf ("F_OVERFLOW@ at %04X:%04X\n", (WORD)(addr >> 16), (WORD)addr); */
1530 patch = (BYTE*) addr;
1531 *patch++ = 0x2E;
1532 *patch++ = 0xFF;
1533 *patch++ = 0x2E;
1534 *(WORD*)patch = 6 - 1 + (WORD)addr; /* relocation of [where] */
1535 patch += 2;
1536 *(WORD*)patch = FP_OFF (stk_overflow);
1537 patch += 2;
1538 *(WORD*)patch = FP_SEG (stk_overflow);
1539
1540 /*
1541 * 0001 F_OVERFLOW@:
1542 * 0001 2E: FF 2E 0006r jmp dword ptr cs:[where]
1543 * 0006 ???????? where dd ?
1544 */
1545#if 0
1546 printf ("test_stk_check() at CS:IP %04X:%04X\n",
1547 _CS, FP_OFF(test_stk_check));
1548 _stklen = 10;
1549 test_stk_check();
1550#endif
1551 return (1);
1552 }
1553 }
1554 return (0);
1555}
1556
1557#elif defined(__BORLANDC__) && defined(__SMALL__)
1558/*
1559 * Small model with option '-N' generates code like:
1560 * < .. standard prologue ...>
1561 * 39 26 00 00 cmp ___brklvl,sp
1562 * 72 03 jb L$1
1563 * E8 00 00 call N_OVERFLOW@
1564 * L$1:
1565 *
1566 * We need to find the address of 'N_OVERFLOW@' (it cannot be addressed
1567 * from C). It should be the same code as in large model.
1568 */
1569extern int __brklvl;
1570
1571static void stk_overflow (UINT ret_addr)
1572{
1573 static WORD cs, ip;
1574 static WORD stk[128];
1575
1576 cs = _CS;
1577 ip = *(WORD*) (&ret_addr-1);
1578
1579 _SS = FP_SEG (stk);
1580 _SP = (WORD) &stk [DIM(stk)-1];
1581
1582 _stklen = 0x7FFF;
1583 _watt_fatal_error = TRUE;
1584 fprintf (stderr, "\nStack overflow at %04X:%04X!\n", cs, ip);
1585 _eth_release();
1586 _exit (1); /* do minimal work, no rundown_run() */
1587}
1588
1589static int stk_check_setup (void)
1590{
1591 BYTE sign[] = { 0x39, 0x26, 0,0, 0x72, 3, 0xE8 };
1592 BYTE *p = (BYTE*) _eth_arrived;
1593 int i;
1594
1595 *(WORD*)&sign[2] = FP_OFF (&__brklvl);
1596 for (i = 0; i < 10; i++, p++)
1597 if (!memcmp(p, sign, sizeof(sign)))
1598 {
1599 BYTE *addr = *(BYTE*)(++p);
1600 *addr = (BYTE*) stk_overflow;
1601 return (1);
1602 }
1603 return (0);
1604}
1605
1606#elif defined(WATCOM386) && !defined(WIN32)
1607/*
1608 * For tracking down stack overflow bugs.
1609 * Stack checker __CHK is pascal-style with stack-size at [esp+4].
1610 * __CHK calls __STK which in turn may call _fatal_runtime_error()
1611 *
1612 * Compiling with stack-checking on, this prologue is in every function:
1613 * (*) push <stack size needed> <- 68h, dword size at EIP-9
1614 * call __CHK <- 5 bytes
1615 * ... <- extracted EIP of return
1616 */
1617static void stk_overflow (WORD cs, UINT eip)
1618{
1619 UINT size = *(UINT*)(eip-9);
1620
1621 eip -= (UINT)&__begtext - 9; /* print .map-file address of (*) */
1622
1623 _watt_fatal_error = TRUE;
1624 fprintf (stderr, "Stack overflow (%u bytes needed) detected at %X:%08lXh\n",
1625 size, cs, (DWORD)eip);
1626 _eth_release();
1627 _exit (1); /* do minimal work, no rundown_run() */
1628}
1629
1630void FATAL_HANDLER (UINT stk)
1631{
1632#if defined(__SMALL__)
1633 _x386_stacklow = stk + 2;
1634 stk_overflow (MY_CS(), *(DWORD*)(&stk+1));
1635
1636#elif defined(__LARGE__)
1637 _x386_stacklow = stk + 4;
1638 stk_overflow (*(WORD*)(&stk+1), *(WORD*)(&stk+2)); /* far-call */
1639
1640#else /* wcc386/DOS */
1641 _x386_stacklow = stk + 4;
1642 stk_overflow (MY_CS(), *(WORD*)(&stk+1));
1643#endif
1644}
1645#endif /* WATCOM386 && !WIN32 */
1646#endif /* USE_DEBUG */
1647
1648/*
1649 * Functions needed for "gcc -O0". These are inlined on -O1 or above.
1650 */
1651#if defined(__GNUC__)
1652 #undef __SYS_SWAP_BYTES_H
1653 #undef _w32_CPUMODEL_H
1654 #undef _w32_MISC_H
1655 #undef _w32_IOPORT_H
1656 #undef W32_INLINE
1657 #undef W32_GCC_INLINE
1658 #undef BEEP
1659
1660 #define W32_INLINE
1661 #define W32_GCC_INLINE
1662//#define extern
1663 #define __inline__
1664 #define __inline
1665
1666 #if defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(__DJGPP__)
1667 #undef intel
1668 #undef intel16
1669 #undef __NO_INLINE__ /* A built-in on "gcc 4.2 -O0" */
1670 #define __NO_INLINE__ /* emulate -O0 */
1671 #define __attribute__(x) /* remove __gnu_inline__ */
1672 #undef get_rdtsc
1673
1674 /* Undefine these too. Some of these might not have been defined
1675 * as 'W32_INLINE foo()' or prefixed with 'W32_NAMESPACE'.
1676 */
1677 #undef get_rdtsc2
1678 #undef get_cpuid
1679 #undef get_fs_reg
1680 #undef get_gs_reg
1681 #undef set_fs_reg
1682 #undef set_gs_reg
1683 #undef Get_CR4
1684 #undef MY_CS
1685 #undef MY_DS
1686 #undef MY_ES
1687 #undef MY_SS
1688 #undef SelWriteable
1689 #undef SelReadable
1690 #undef CheckCpuType
1691 #undef asm_ffs
1692 #endif
1693
1694 #include <sys/swap.h>
1695 #include "misc.h"
1696 #include "cpumodel.h"
1697
1698 #if defined(__EMX__)
1699 #include "ioport.h"
1700 #endif
1701#endif /* __GNUC__ */
1702
1703
1704#if defined(TEST_PROG)
1705
1706#define PRINT_SIZE(_struct) \
1707 do { \
1708 int len = printf ("sizeof (struct %s):", #_struct); \
1709 printf ("%*s %4zu\n", 30-len, "", sizeof(struct _struct)); \
1710 } while (0)
1711
1712static void print_pkt_sizes (void)
1713{
1714 PRINT_SIZE (arcnet_Header);
1715 PRINT_SIZE (arcnet_Packet);
1716
1717 PRINT_SIZE (ax25_Header);
1718 PRINT_SIZE (ax25_Packet);
1719
1720 PRINT_SIZE (eth_Header);
1721 PRINT_SIZE (eth_Packet);
1722
1723 PRINT_SIZE (llc_Header);
1724 PRINT_SIZE (llc_Packet);
1725
1726 PRINT_SIZE (pppoe_Header);
1727 PRINT_SIZE (pppoe_Packet);
1728
1729 PRINT_SIZE (tok_Header);
1730 PRINT_SIZE (tok_Packet);
1731
1732 PRINT_SIZE (fddi_Header);
1733 PRINT_SIZE (fddi_Packet);
1734
1735 PRINT_SIZE (vlan_Header);
1736 PRINT_SIZE (vlan_Packet);
1737}
1738
1739#if defined(WIN32) || defined(WIN64)
1740static void itoa_tests (void)
1741{
1742 extern char *_w32_itoa (int val, char *buf, int radix); /* winmisc.c */
1743 char buf [20];
1744 int i, val[] = {10, 100, 9999, -10001, 12345678 };
1745
1746 for (i = 0; i < DIM(val); i++)
1747 printf ("%d: _w32_itoa: %8d -> %8s\n", i, val[i], _w32_itoa(val[i],buf,10));
1748}
1749
1750#elif defined(__MSDOS__)
1751/*
1752 * Get/set DOS' memory allocation strategy.
1753 */
1754static BOOL get_mem_strat (BYTE *strat)
1755{
1756 IREGS reg;
1757
1758 memset (&reg, '\0', sizeof(reg));
1759 reg.r_ax = 0x5800;
1760 GEN_INTERRUPT (0x21, &reg);
1761 if (reg.r_flags & CARRY_BIT)
1762 return (FALSE);
1763 *strat = loBYTE (reg.r_ax);
1764 return (TRUE);
1765}
1766
1767static BOOL set_mem_strat (BYTE strat)
1768{
1769 IREGS reg;
1770
1771 memset (&reg, '\0', sizeof(reg));
1772 reg.r_ax = 0x5801;
1773 reg.r_bx = strat;
1774 GEN_INTERRUPT (0x21, &reg);
1775 if (reg.r_flags & CARRY_BIT)
1776 return (FALSE);
1777 return (TRUE);
1778}
1779#endif
1780
1781void W32_CALL foo_10 (void) { puts ("I'm foo_10()"); }
1782void W32_CALL foo_20 (void) { puts ("I'm foo_20()"); }
1783void W32_CALL foo_30 (void) { puts ("I'm foo_30()"); }
1784void W32_CALL foo_40 (void) { puts ("I'm foo_40()"); }
1785void W32_CALL foo_50 (void) { puts ("I'm foo_50()"); }
1786void W32_CALL foo_60 (void) { puts ("I'm foo_60()"); }
1787void W32_CALL foo_70 (void) { puts ("I'm foo_70()"); }
1788
1789int main (void)
1790{
1791#if defined(__MSDOS__)
1792 BYTE strat = 0;
1793
1794 printf ("DOS memory allocation strategy: ");
1795 if (!get_mem_strat(&strat))
1796 puts ("failed");
1797 else printf ("0x%02X\n", strat);
1798
1799 printf ("Setting \"low memory best fit\" ");
1800 if (!set_mem_strat(1))
1801 puts ("failed");
1802 else puts ("okay");
1803
1804 set_mem_strat (strat);
1805
1806#elif defined(WIN32) || defined(WIN64)
1807 itoa_tests();
1808#endif /* __MSDOS__ */
1809
1810 RUNDOWN_ADD (foo_40, 40);
1811 RUNDOWN_ADD (foo_10, 10);
1812 RUNDOWN_ADD (foo_60, 60);
1813 RUNDOWN_ADD (foo_30, 30);
1814 RUNDOWN_ADD (foo_20, 20);
1815 RUNDOWN_ADD (foo_50, 50);
1816 RUNDOWN_ADD (foo_70, 70);
1817 debug_on = 2;
1818 rundown_run();
1819 print_pkt_sizes();
1820 return (0);
1821}
1822#endif /* TEST_PROG */
1823
bsddbug.h
cpumodel.h
ioport.h
watt_kbhit
int W32_CALL watt_kbhit(void)
A less CPU hogging kbhit().
Definition: misc.c:917
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
_w32_intr
void _w32_intr(int int_no, IREGS *reg)
Microsoft/Digital Mars doesn't have intr() so we make our own.
Definition: misc.c:1459
_watt_os_ver
WORD _watt_os_ver
Definition: misc.c:74
fopen_excl
FILE * fopen_excl(const char *file, const char *mode)
WIN32: Open an existing file (or create) in share-mode but deny other processes to write to the file.
Definition: misc.c:453
RandomWait
void W32_CALL RandomWait(unsigned a, unsigned b)
Wait for a random period in range [a..b] millisec.
Definition: misc.c:760
Random
unsigned W32_CALL Random(unsigned a, unsigned b)
Returns a random integer in range [a..b].
Definition: misc.c:743
win32_dos_box
BOOL win32_dos_box
Definition: misc.c:71
MAC_address
const char * MAC_address(const void *addr)
Return hexa-decimal string for an 6/7 byte MAC-address.
Definition: misc.c:997
assert_fail
void assert_fail(const char *file, unsigned line, const char *what)
Store the "assert fail" text for later before printing it.
Definition: misc.c:653
_w32_intel16
unsigned short W32_CDECL _w32_intel16(unsigned short val)
Convert 16-bit big-endian (network order) to intel (host order) format.
Definition: misc.c:183
init_misc
void W32_CALL init_misc(void)
Initialise various stuff.
Definition: misc.c:345
_watt_assert_buf
char _watt_assert_buf[256]
Definition: misc.c:75
qword_str
const char * qword_str(uint64 val)
The same as above.
Definition: misc.c:1053
Wait
void Wait(unsigned msec)
Not all vendors have delay().
Definition: misc.c:777
get_day_num
DWORD get_day_num(void)
Simplified method of getting days since 1970-01-01.
Definition: misc.c:222
_w32_intel
unsigned long W32_CDECL _w32_intel(unsigned long val)
Convert 32-bit big-endian (network order) to intel (host order) format.
Definition: misc.c:171
_watt_crtdbg_check
BOOL _watt_crtdbg_check
Definition: misc.c:72
dword_str
const char * dword_str(DWORD val)
Return nicely formatted string "xx,xxx,xxx" with thousand separators (left adjusted).
Definition: misc.c:1022
watt_filelength
long W32_CALL watt_filelength(int fd)
filelength() is needed in pcconfig.c and some applications.
Definition: misc.c:946
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
ctime_r
char * ctime_r(const time_t *t, char *res)
A reentrant ctime().
Definition: misc.c:887
crtdbg_exit
static void __cdecl crtdbg_exit(void)
Definition: misc.c:544
localtime_r
struct tm * localtime_r(const time_t *t, struct tm *res)
A reentrant localtime().
Definition: misc.c:900
misc.h
_watt_cbroke
volatile int _watt_cbroke
Definition: pc_cbrk.c:48
strltrim
char * strltrim(char *s)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
nochkstk.h
pack_off.h
pack_on.h
pcconfig.h
pcdbug.h
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
pcpkt.h
_eth_release
void W32_CALL _eth_release(void)
Release the hardware driver.
Definition: pcsed.c:1349
_eth_arrived
void *W32_CALL _eth_arrived(WORD *type_ptr, BOOL *broadcast)
Poll for arrival of new packets (IP/ARP/RARP/PPPoE protocol).
Definition: pcsed.c:996
pcsed.h
powerpak.h
sock_sig_exit
void W32_CALL sock_sig_exit(const char *msg, int sig)
Exit handler for unhandled signals.
Definition: sock_ini.c:1076
sock_ini.h
IREGS
Definition: misc.h:610
arcnet_Header
Definition: pcsed.h:180
arcnet_Packet
Definition: pcsed.h:201
ax25_Header
Definition: pcsed.h:214
ax25_Packet
Definition: pcsed.h:220
cmd_block
Run a COMMAND.COM/4DOS external/internal command.
Definition: misc.c:1420
eth_Header
Definition: pcsed.h:20
eth_Packet
Definition: pcsed.h:38
fddi_Header
Definition: pcsed.h:149
fddi_Packet
Definition: pcsed.h:164
llc_Header
Definition: pcsed.h:107
llc_Packet
Definition: pcsed.h:129
pppoe_Header
Definition: pcsed.h:229
pppoe_Packet
Definition: pcsed.h:237
search_list
Definition: misc.h:131
tok_Header
Definition: pcsed.h:70
tok_Packet
Definition: pcsed.h:98
vlan_Header
Definition: pcsed.h:48
vlan_Packet
Definition: pcsed.h:60
swap.h
use_rdtsc
BOOL use_rdtsc
Ditto.
Definition: timer.c:55
init_timers
void init_timers(void)
Setup timer stuff and measure CPU speed.
Definition: timer.c:114
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
has_rdtsc
BOOL has_rdtsc
Never set in Watt-32.
Definition: timer.c:54
timer.h
wattcp.h
Core definitions.
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65
wdpmi.h
win_strerror
char *W32_CALL win_strerror(DWORD err)
Return err-number and string for 'err'.
Definition: winmisc.c:208
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/misc.h Source File

  • src
misc.h
Go to the documentation of this file.
1
3#ifndef _w32_MISC_H
4#define _w32_MISC_H
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10#ifndef __SYS_SWAP_BYTES_H
11#include <sys/swap.h> /* intel() etc. */
12#endif
13
14#ifndef __SYS_WTIME_H
15#include <sys/wtime.h> /* struct timeval */
16#endif
17
18#ifndef __SYS_CDEFS_H
19#include <sys/cdefs.h>
20#endif
21
22#if defined(__DJGPP__) || defined(__HIGHC__) || defined(__WATCOMC__) || \
23 defined(__CYGWIN__) || defined(__DMC__)
24
25 #if !defined(__CYGWIN__)
26 #undef _WIN32 /* Needed for __DMC__ */
27 #endif
28
29 #if !defined(HAVE_UNISTD_H)
30 #define HAVE_UNISTD_H
31 #endif
32
33 #include <unistd.h>
34#endif
35
36#if defined(__POCC__) || defined(__CYGWIN__) || defined(__MINGW64_VERSION_MAJOR)
37 #include <intrin.h>
38#endif
39
40/*
41 * Hacks to shut-up Cygwin x64.
42 */
43#if !defined(__CYGWIN__) || !defined(__USE_W32_SOCKETS)
44 #define __ms_u_long u_long
45//#define __ms_timeval timeval
46#endif
47
48/*
49 * Because kbhit() will pull in more conio function that we
50 * really need, use the simple kbhit() variant (without ungetch()
51 * option). This also prevents multiple definition trouble when
52 * linking e.g. PD-curses and Watt-32 library.
53 */
54#if defined(__DJGPP__)
55 #ifdef __dj_include_conio_h_
56 #error "Don't include <conio.h>"
57 #endif
58 #include <pc.h> /* simple kbhit() */
59
60#elif defined(_MSC_VER) && defined(__386__)
61 /*
62 * Problems including <conio.h> from Visual C 4.0
63 */
64 extern int __cdecl kbhit (void);
65
66#elif defined(__BORLANDC__)
67 /*
68 * Some trouble with multiple symbols in Borland's <conio.h>.
69 * Hence just don't include it.
70 */
71 #define __CONIO_H
72 int _RTLENTRY _EXPFUNC kbhit (void);
73 int _RTLENTRY _EXPFUNC getch (void);
74 int _RTLENTRY _EXPFUNC cputs (const char *str);
75
76#elif defined(__CYGWIN__)
77 /*
78 * More CygWin quirks.
79 */
80 #include <string.h>
81 #include <strings.h>
82
83 #define stricmp(s1, s2) strcasecmp (s1, s2)
84 #define strnicmp(s1, s2, len) strncasecmp (s1, s2, len)
85
86 /* Use kbhit(), getch() below
87 */
88#elif defined(__AVR__)
89 /*
90 * Some AVR quirks.
91 */
92 #include <string.h>
93
94 #define stricmp(s1, s2) strcasecmp (s1, s2)
95 #define strnicmp(s1, s2, len) strncasecmp (s1, s2, len)
96
97#else /* no other option */
98 #include <conio.h>
99#endif
100
101/*
102 * In misc.c
103 *
104 * Protect internal symbols with a namespace
105 */
106#define Wait W32_NAMESPACE (Wait)
107#define valid_addr W32_NAMESPACE (valid_addr)
108#define is_in_stack W32_NAMESPACE (is_in_stack)
109#define used_stack W32_NAMESPACE (used_stack)
110#define os_yield W32_NAMESPACE (os_yield)
111#define hex_chars_lower W32_NAMESPACE (hex_chars_lower)
112#define hex_chars_upper W32_NAMESPACE (hex_chars_upper)
113#define win32_dos_box W32_NAMESPACE (win32_dos_box)
114#define get_day_num W32_NAMESPACE (get_day_num)
115#define dword_str W32_NAMESPACE (dword_str)
116#define qword_str W32_NAMESPACE (qword_str)
117#define shell_exec W32_NAMESPACE (shell_exec)
118#define assert_fail W32_NAMESPACE (assert_fail)
119#define ctime_r W32_NAMESPACE (ctime_r)
120#define localtime_r W32_NAMESPACE (localtime_r)
121#define strtok_r W32_NAMESPACE (strtok_r)
122
123#define memdbg_init W32_NAMESPACE (memdbg_init)
124#define memdbg_post_init W32_NAMESPACE (memdbg_post_init)
125#define fopen_excl W32_NAMESPACE (fopen_excl)
126#define unfinished W32_NAMESPACE (unfinished)
127#define unimplemented W32_NAMESPACE (unimplemented)
128
129#if !defined(SEARCH_LIST_DEFINED)
130 #define SEARCH_LIST_DEFINED
131 struct search_list {
132 DWORD type;
133 const char *name;
134 };
135#endif
136
137#define DO_FREE(x) do { \
138 if (x) { \
139 free ((void*)(x)); \
140 x = NULL; \
141 } \
142 } while (0)
143
144#if defined(WIN32) || defined(WIN64)
145 #define SOCK_ERRNO(err) WSASetLastError (err)
146#else
147 #define SOCK_ERRNO(err) errno = _w32_errno = err
148#endif
149
150extern const char hex_chars_lower[];
151extern const char hex_chars_upper[];
152
153extern BOOL win32_dos_box;
154extern BOOL _watt_fatal_error;
155extern BOOL _watt_crtdbg_check;
156extern WORD _watt_os_ver;
157extern char _watt_assert_buf[256];
158
159extern void Wait (unsigned msec);
160extern BOOL valid_addr (const void *addr, unsigned len);
161
162#if !defined(SWIG)
163 extern BOOL is_in_stack (const void *ptr);
164 extern unsigned used_stack (void);
165 extern unsigned _get_frame_size (const char *x);
166#endif
167
168extern void os_yield (void);
169extern void assert_fail (const char *file, unsigned line, const char *what);
170
171extern DWORD get_day_num (void);
172extern void memdbg_init (void);
173extern void memdbg_post_init (void);
174extern FILE *fopen_excl (const char *file, const char *mode);
175
176extern void unfinished (const char *func, const char *file, unsigned line);
177extern void unimplemented (const char *func, const char *file, unsigned line);
178
179#define UNFINISHED() unfinished (__FUNCTION__, __FILE__, __LINE__)
180#define UNIMPLEMENTED() unimplemented (__FUNCTION__, __FILE__, __LINE__)
181
182extern char *ctime_r (const time_t *t, char *res);
183extern struct tm *localtime_r (const time_t *t, struct tm *res);
184extern char *strtok_r (char *ptr, const char *sep, char **end);
185
186extern const char *dos_extender_name (void);
187extern const char *dword_str (DWORD val);
188
189#if defined(HAVE_UINT64)
190extern const char *qword_str (uint64 val);
191#endif
192
193/*
194 */
195#if defined(__POCC__) && defined(WIN64)
196 #undef HandleToUlong
197 #define HandleToUlong(h) ( (unsigned long)(ULONG_PTR)(h) )
198#endif
199
200/*
201 * A patch from Ozkan Sezer <sezeroz@gmail.com>.
202 * Using 'access()' in djgpp pulls in unnecessary big dependencies, so
203 * '_chmod()' is smaller and cheaper to use. And plenty good enough.
204 */
205#if defined(__DJGPP__)
206 #define FILE_EXIST(fname) (_chmod(fname, 0) != -1)
207#else
208 #define FILE_EXIST(fname) (access(fname, 0) == 0)
209#endif
210
211/*
212 * Yielding while waiting on network reduces CPU-loading.
213 */
214#if (DOSX & (DJGPP|DOS4GW|PHARLAP|X32VM|WINWATT))
215 #define WATT_YIELD() os_yield() /* includes kbhit() for non-djgpp */
216#else
217 #define WATT_YIELD() watt_kbhit()
218#endif
219
220#if defined(USE_DEBUG)
221 #define list_lookup W32_NAMESPACE (list_lookup)
222 #define list_lookupX W32_NAMESPACE (list_lookupX)
223 #define MAC_address W32_NAMESPACE (MAC_address)
224
225 extern const char *list_lookup (DWORD, const struct search_list *, int);
226 extern const char *list_lookupX (DWORD, const struct search_list *, int);
227 extern const char *MAC_address (const void *addr);
228#endif
229
230#if defined(__LARGE__)
231 extern void watt_large_check (const void *sock, int size,
232 const char *file, unsigned line);
233 #define WATT_LARGE_CHECK(sock, size) \
234 watt_large_check(sock, size, __FILE__, __LINE__)
235#else
236 #define WATT_LARGE_CHECK(sock, size) ((void)0)
237#endif
238
239#if defined(USE_DEBUG) && !defined(NDEBUG)
240 #define WATT_ASSERT(x) do { \
241 if (!(x)) \
242 assert_fail (__FILE__, __LINE__, #x); \
243 } while (0)
244#else
245 #define WATT_ASSERT(x) ((void)0)
246#endif
247
248/*
249 * Compare function used in qsort() + bsearch().
250 * Cast your function with this.
251 */
252#if !defined(_CmpFunc_T)
253 #define _CmpFunc_T
254 typedef int (MS_CDECL *CmpFunc) (const void *, const void *);
255#endif
256
257#if defined(__CYGWIN__)
258 /*
259 * We use these only under CygWin, but compile them for all Win32 DLLs
260 * since we want e.g. a MinGW built watt-32.dll to work with CygWin.
261 */
262 #define kbhit W32_NAMESPACE (kbhit)
263 #define getch W32_NAMESPACE (getch)
264 #define itoa W32_NAMESPACE (itoa)
265
266 extern int kbhit (void);
267 extern int getch (void);
268 extern char *itoa (int val, char *buf, int radix);
269#endif
270
271#if defined(WIN32) || defined(WIN64)
272 /*
273 * In winmisc.c
274 */
275 #define init_win_misc W32_NAMESPACE (init_win_misc)
276 #define print_thread_times W32_NAMESPACE (print_thread_times)
277 #define print_perf_times W32_NAMESPACE (print_perf_times)
278 #define print_process_times W32_NAMESPACE (print_process_times)
279
280 #define WinDnsQueryA4 W32_NAMESPACE (WinDnsQueryA4)
281 #define WinDnsQueryA6 W32_NAMESPACE (WinDnsQueryA6)
282 #define WinDnsQueryPTR4 W32_NAMESPACE (WinDnsQueryPTR4)
283 #define WinDnsQueryPTR6 W32_NAMESPACE (WinDnsQueryPTR6)
284 #define WinDnsCachePut_A4 W32_NAMESPACE (WinDnsCachePut_A4)
285 #define WinDnsCachePut_A6 W32_NAMESPACE (WinDnsCachePut_A6)
286 #define get_file_version W32_NAMESPACE (get_file_version)
287
288 extern HANDLE stdin_hnd, stdout_hnd;
289 extern BOOL _watt_is_win9x, _watt_is_wow64;
290 extern BOOL _watt_is_gui_app, _watt_use_bugtrap;
291
292 extern CONSOLE_SCREEN_BUFFER_INFO console_info;
293
294 extern BOOL init_win_misc (void);
295
296 extern BOOL WinDnsQuery_A4 (const char *name, DWORD *ip4);
297 extern BOOL WinDnsQuery_A6 (const char *name, void *ip6);
298 extern BOOL WinDnsQuery_PTR4 (DWORD ip4, char *name, size_t size);
299 extern BOOL WinDnsQuery_PTR6 (const void *ip6, char *name, size_t size);
300 extern BOOL WinDnsCachePut_A4 (const char *name, DWORD ip4);
301 extern BOOL WinDnsCachePut_A6 (const char *name, const void *ip6);
302 extern BOOL get_file_version (const char *file, char *buf, size_t buf_len);
303 extern void print_thread_times (HANDLE thread);
304 extern void print_perf_times (void);
305 extern void print_process_times(void);
306#endif /* WIN32 || WIN64 */
307
308#if defined(HAVE_UINT64)
309 /*
310 * Format for printing 64-bit types. E.g. "%10"S64_FMT.
311 * Watt-32 code should not try to print a 64-bit number unless
312 * 'HAVE_UINT64' is defined.
313 */
314
315 /* gcc on Win32 and Win64 are 2 different things regarding
316 * printf-parameters and '-Wformat'. gcc erroneously assumes
317 * that only Microsoft's non-standard formatting is valid on
318 * Windows. Both MinGW and MinGW-w64 provides an ISO compatible
319 * alternative printf(). Hence this:
320 */
321
322 #if defined(__GNUC__)
323 #if defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW64_VERSION_MAJOR)
324 /*
325 * Per the above gcc mess, the use of 'x64_FMT' could trigger a warning that
326 * can be suppressed using:
327 * W32_GCC_PRAGMA (GCC diagnostic push)
328 * W32_GCC_PRAGMA (GCC diagnostic ignored "-Wformat")
329 *
330 * prior to using the 'x64_FMT' format. And a:
331 * W32_GCC_PRAGMA (GCC diagnostic pop)
332 * after the last use.
333 */
334 #define S64_FMT "lld"
335 #define U64_FMT "llu"
336 #define X64_FMT "llX"
337 #define S64_SUFFIX(x) (x##LL)
338 #define U64_SUFFIX(x) (x##ULL)
339
340 #elif defined(__MINGW32__)
341 #define S64_FMT "I64d"
342 #define U64_FMT "I64u"
343 #define X64_FMT "l64X"
344 #define S64_SUFFIX(x) (x##LL)
345 #define U64_SUFFIX(x) (x##ULL)
346 #endif
347
348 #elif defined(_MSC_VER) || defined(_MSC_EXTENSIONS) || \
349 defined(__WATCOMC__) || (defined(__BORLANDC__) && __BORLANDC__ < 0x0700)
350 #define S64_FMT "I64d"
351 #define U64_FMT "I64u"
352 #define X64_FMT "I64X"
353 #define S64_SUFFIX(x) (x##i64)
354 #define U64_SUFFIX(x) (x##Ui64)
355
356 #elif defined(__BORLANDC__)
357 /*
358 * __BORLANDC__ >= 0x0700 is similar to 'gcc'
359 */
360 #define S64_FMT "lld"
361 #define U64_FMT "llu"
362 #define X64_FMT "llX"
363 #define S64_SUFFIX(x) (x##LL)
364 #define U64_SUFFIX(x) (x##ULL)
365
366 #else
367 #define S64_FMT "Ld"
368 #define U64_FMT "Lu"
369 #define X64_FMT "LX"
370 #define S64_SUFFIX(x) (x##LL)
371 #define U64_SUFFIX(x) (x##ULL)
372 #endif
373#endif
374
375/* Printing a wide string on Windows.
376 * E.g. printf (buf, "%"WIDESTR_FMT, wide_str);
377 *
378 * Note: We do not support building with '-D_UNICODE'.
379 * Hence Ascii formats sometimes
380 * need to print wide-chars using this format.
381 */
382#if defined(__GNUC__) || defined(__BORLANDC__)
383 #define WIDESTR_FMT "S"
384#elif defined(__POCC__)
385 #define WIDESTR_FMT "ls"
386#else
387 #define WIDESTR_FMT "ws"
388#endif
389
390/*
391 * Printing an hex linear address.
392 * Printing an decimal value from the address-bus (e.g. a stack-limit)
393 * E.g. printf (buf, "0x%" ADDR_FMT, ADDR_CAST(ptr));
394 */
395#if defined(WIN64) && defined(_MSC_VER)
396 #define ADDR_FMT "016I64X"
397 #define ADDR_CAST(x) ((uint64)(x))
398 #define ABUS_VAL_FMT U64_FMT
399
400 /* 64-bit CygWin or MinGW64
401 */
402#elif defined(WIN64) && (defined(__CYGWIN__) || defined(__MINGW64_VERSION_MAJOR))
403 #define ADDR_FMT "016llX"
404 #define ADDR_CAST(x) ((uint64)(x))
405 #define ABUS_VAL_FMT U64_FMT
406
407#elif defined(WIN64) && defined(__GNUC__) /* (MinGW64 usually) */
408 #define ADDR_FMT "016I64X" /* Or "016llX" ? */
409 #define ADDR_CAST(x) ((uint64)(x))
410 #define ABUS_VAL_FMT U64_FMT
411
412#elif (DOSX != 0)
413 #define ADDR_FMT "08lX"
414 #define ADDR_CAST(x) ((DWORD_PTR)(x)) /* "cl -Wp64" warns here. Ignore it. */
415 #define ABUS_VAL_FMT "u" /* should match an UINT_PTR */
416
417#else
418 #define ADDR_FMT "04X" /* real-mode segment or offset. */
419 #define ADDR_CAST(x) ((WORD)(x))
420 #define ABUS_VAL_FMT "u"
421#endif
422
423/*
424 * To fix the warnings for the use of "%lu" with a DWORD-arg.
425 * Or warnings with "%ld" and an 'int' argument.
426 * Especially noisy for 'x64' builds since CygWin is a LP64-platform:
427 * https://en.wikipedia.org/wiki/64-bit_computing
428 */
429#if defined(__CYGWIN__)
430 #define DWORD_CAST(x) ((unsigned long)(x))
431 #define LONG_CAST(x) ((long int)(x))
432
433#else
434 #define DWORD_CAST(x) x
435 #define LONG_CAST(x) x
436#endif
437
438/*
439 * Setting console colours. Windows only.
440 */
441#if defined(WIN32) || defined(WIN64)
442 #define SET_ATTR(a) SetConsoleTextAttribute (stdout_hnd, (console_info.wAttributes & ~7) | \
443 (FOREGROUND_INTENSITY | (a)))
444 #define NORM_TEXT() SetConsoleTextAttribute (stdout_hnd, console_info.wAttributes & ~FOREGROUND_INTENSITY)
445 #define HIGH_TEXT() SetConsoleTextAttribute (stdout_hnd, console_info.wAttributes | FOREGROUND_INTENSITY)
446 #define YELLOW_TEXT() SET_ATTR (FOREGOUND_YELLOW)
447 #define RED_TEXT() SET_ATTR (FOREGROUND_RED)
448#else
449 #define SET_ATTR(a) ((void)0)
450 #define NORM_TEXT() ((void)0)
451 #define HIGH_TEXT() ((void)0)
452 #define YELLOW_TEXT() ((void)0)
453 #define RED_TEXT() ((void)0)
454 #define FOREGROUND_BLUE 0
455 #define FOREGROUND_GREEN 0
456 #define FOREGROUND_RED 0
457#endif
458
459#define FOREGOUND_YELLOW (FOREGROUND_GREEN | FOREGROUND_RED)
460#define FOREGOUND_WHITE (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)
461
462/*
463 * In pc_cbrk.c
464 */
465extern WORD _watt_handle_cbreak;
466extern volatile int _watt_cbroke;
467
468extern BOOL tcp_cbreak_off (void);
469extern int set_cbreak (int want_brk);
470extern void MS_CDECL sig_handler_watt (int sig);
471
472#define NEW_BREAK_MODE(old_mode,new_mode) \
473 old_mode = _watt_handle_cbreak, \
474 _watt_handle_cbreak = new_mode, /* enable special interrupt mode */ \
475 _watt_cbroke = 0
476
477#define OLD_BREAK_MODE(old_mode) \
478 _watt_cbroke = 0, /* always clean up */ \
479 _watt_handle_cbreak = old_mode
480
481
482#if defined(__MSDOS__)
483 /*
484 * In country.c. Used only in IDNA code.
485 */
486 #define GetCountryCode W32_NAMESPACE (GetCountryCode)
487 #define GetCodePage W32_NAMESPACE (GetCodePage)
488
489 extern int GetCountryCode (void);
490 extern int GetCodePage (void);
491
492 /*
493 * In crit.c; Sets up a critical error handler.
494 * No longer used.
495 */
496 #define CRIT_VECT 0x24
497 #define int24_init W32_NAMESPACE (int24_init)
498 #define int24_restore W32_NAMESPACE (int24_restore)
499
500 extern void int24_init (void);
501 extern void int24_restore (void);
502
503 /*
504 * In qmsg.c
505 */
506 #define dbg_colour W32_NAMESPACE (dbg_colour)
507 #define dbg_scrpos W32_NAMESPACE (dbg_scrpos)
508 #define dbg_scrstart W32_NAMESPACE (dbg_scrstart)
509 #define dputch W32_NAMESPACE (dputch)
510 #define dmsg W32_NAMESPACE (dmsg)
511 #define dhex1int W32_NAMESPACE (dhex1int)
512 #define dhex2int W32_NAMESPACE (dhex2int)
513 #define dhex4int W32_NAMESPACE (dhex4int)
514 #define dhex8int W32_NAMESPACE (dhex8int)
515
516 extern BYTE dbg_colour;
517 extern WORD dbg_scrpos;
518 extern WORD dbg_scrstart;
519
520 extern void dputch (char x);
521 extern void dmsg (const char *s);
522 extern void dhex1int (int x);
523 extern void dhex2int (int x);
524 extern void dhex4int (int x);
525 extern void dhex8int (DWORD x);
526#endif /* __MSDOS__ */
527
528/*
529 * In crc.c
530 */
531#define crc_init W32_NAMESPACE (crc_init)
532#define crc_bytes W32_NAMESPACE (crc_bytes)
533#define crc_table W32_NAMESPACE (crc_table)
534
535extern DWORD *crc_table;
536extern BOOL crc_init (void);
537extern DWORD crc_bytes (const char *buf, size_t len);
538
539/*
540 * In neterr.c
541 */
542#define short_strerror W32_NAMESPACE (short_strerror)
543#define pull_neterr_module W32_NAMESPACE (pull_neterr_module)
544
545extern int pull_neterr_module;
546extern const char *short_strerror (int errnum);
547
548
549/*
550 * IREGS structures for pkt_api_entry() etc.
551 * Defines to simplify issuing real-mode interrupts
552 */
553#if (DOSX & PHARLAP)
554 #define IREGS SWI_REGS /* in Pharlap's <pharlap.h> */
555 #define r_flags flags
556 #define r_ax eax
557 #define r_bx ebx
558 #define r_dx edx
559 #define r_cx ecx
560 #define r_si esi
561 #define r_di edi
562 #define r_ds ds
563 #define r_es es
564 #define r_fs fs
565 #define r_gs gs
566
567#elif (DOSX & DJGPP)
568 #define IREGS __dpmi_regs /* in <dpmi.h> */
569 #define r_flags x.flags
570 #define r_ax d.eax
571 #define r_bx d.ebx
572 #define r_dx d.edx
573 #define r_cx d.ecx
574 #define r_si d.esi
575 #define r_di d.edi
576 #define r_ip x.ip
577 #define r_cs x.cs
578 #define r_ds x.ds
579 #define r_es x.es
580 #define r_fs x.fs
581 #define r_gs x.gs
582 #define r_ss x.ss
583 #define r_sp x.sp
584
585#elif (DOSX & X32VM)
586 #define IREGS SWI_REGS /* in "x32vm.h" */
587
588#elif (DOSX & (DOS4GW|POWERPAK))
589 typedef struct DPMI_regs {
590 DWORD r_di;
591 DWORD r_si;
592 DWORD r_bp;
593 DWORD reserved;
594 DWORD r_bx;
595 DWORD r_dx;
596 DWORD r_cx;
597 DWORD r_ax;
598 WORD r_flags;
599 WORD r_es, r_ds, r_fs, r_gs;
600 WORD r_ip, r_cs, r_sp, r_ss;
601 } IREGS;
602
603#elif defined(__MSDOS__) /* r-mode targets */
604
605 /* IREGS must have same layout and size as Borland's 'struct REGPACK'
606 * and Watcom's 'union REGPACK'. This is checked in `check_reg_struct()'.
607 */
608 #include <sys/pack_on.h>
609
610 typedef struct IREGS {
611 WORD r_ax, r_bx, r_cx, r_dx, r_bp;
612 WORD r_si, r_di, r_ds, r_es, r_flags;
613 } IREGS;
614
615 #include <sys/pack_off.h>
616
617 #if (defined(_MSC_VER) || defined(__DMC__)) && (DOSX == 0)
618 #define intr W32_NAMESPACE (intr)
619 extern void intr (int int_no, IREGS *regs);
620 #endif
621#endif
622
623#if !defined(WIN32)
624 #define CARRY_BIT 1 /* LSB in r_flags */
625#endif
626
627/* Macro to ease generation of real-mode interrupts.
628 * `_r' should be `IREGS'.
629 */
630#if (DOSX & DJGPP)
631 #define GEN_INTERRUPT(_i, _r) __dpmi_int ((int)(_i), _r)
632
633#elif (DOSX & (PHARLAP|X32VM))
634 #define GEN_INTERRUPT(_i, _r) _dx_real_int ((UINT)(_i), _r)
635
636#elif (DOSX & (DOS4GW|POWERPAK))
637 #define GEN_INTERRUPT(_i, _r) dpmi_real_interrupt ((_i), _r)
638
639#elif (DOSX == 0)
640 #if defined(_MSC_VER) || defined(__DMC__)
641 #define GEN_INTERRUPT(_i, _r) intr ((int)(_i), _r) /* our own version */
642
643 #elif defined(__WATCOMC__)
644 #define GEN_INTERRUPT(_i, _r) intr ((int)(_i), (union REGPACK*)(_r))
645
646 #else
647 #define GEN_INTERRUPT(_i, _r) intr ((int)(_i), (struct REGPACK*)(_r))
648 #endif
649
650#elif (DOSX & ATMEL)
654 #define GEN_INTERRUPT(_i, _r) ((void)0)
655
656#elif (DOSX & WINWATT)
657 /*
658 * No interrupts on Win32
659 */
660
661#else
662 #error "Help, unknown target."
663#endif
664
665
666/*
667 * Fixes for Quick-C and Digital Mars to allow an address as lvalue
668 * in FP_SEG/OFF macros (only used in wdpmi.c)
669 */
670#if (!DOSX)
671 #if defined(_MSC_VER)
672 /*#pragma warning (disable:4759) */
673 #undef FP_SEG
674 #undef FP_OFF
675 #define FP_SEG(p) ((unsigned)(_segment)(void _far *)(p))
676 #define FP_OFF(p) ((unsigned)(p))
677
678 #elif defined(__DMC__)
679 #undef FP_SEG
680 #undef FP_OFF
681 #define FP_SEG(p) ((unsigned)((DWORD)(void _far*)(p) >> 16))
682 #define FP_OFF(p) ((unsigned)(p))
683 #endif
684
685#elif defined(BORLAND386)
686 #undef FP_SEG
687 #undef FP_OFF
688 #define FP_SEG(p) _DS /* segment of something is always our DS */
689 #define FP_OFF(p) (DWORD)(p)
690
691#elif (defined(DMC386) || defined(MSC386)) && defined(__MSDOS__)
692 #undef FP_SEG
693 #undef FP_OFF
694 #define FP_SEG(p) ((unsigned)((DWORD)(void _far*)(p) >> 16))
695 #define FP_OFF(p) ((unsigned)(p))
696#endif
697
698
699#if (defined(MSC386) || defined(__HIGHC__)) && defined(__MSDOS__)
700 #include <pldos32.h>
701 #define dosdate_t _dosdate_t
702 #define dostime_t _dostime_t
703#endif
704
705#if defined(__DMC__) && defined(__MSDOS__)
706 #define dosdate_t dos_date_t
707 #define dostime_t dos_time_t
708#endif
709
710
711/*
712 * The Watcom STACK_SET() function is from Dan Kegel's RARP implementation
713 */
714#if defined(__WATCOMC__) && !defined(__386__) /* 16-bit Watcom */
715 extern void STACK_SET (void far *stack);
716 #pragma aux STACK_SET = \
717 "mov ax, ss" \
718 "mov bx, sp" \
719 "mov ss, dx" \
720 "mov sp, si" \
721 "push ax" \
722 "push bx" \
723 __parm [__dx __si] \
724 __modify [__ax __bx];
725
726 extern void STACK_RESTORE (void);
727 #pragma aux STACK_RESTORE = \
728 "pop bx" \
729 "pop ax" \
730 "mov ss, ax" \
731 "mov sp, bx" \
732 __modify [__ax __bx];
733
734 extern void PUSHF_CLI (void);
735 #pragma aux PUSHF_CLI = \
736 "pushf" \
737 "cli";
738
739 extern void POPF (void);
740 #pragma aux POPF = \
741 "popf";
742
743#elif defined(WATCOM386) /* 32-bit Watcom targets */
744 extern void STACK_SET (void *stack);
745 #pragma aux STACK_SET = \
746 "mov ax, ss" \
747 "mov ebx, esp" \
748 "mov cx, ds" \
749 "mov ss, cx" \
750 "mov esp, esi" \
751 "push eax" \
752 "push ebx" \
753 __parm [__esi] \
754 __modify [__eax __ebx __ecx];
755
756 extern void STACK_RESTORE (void);
757 #pragma aux STACK_RESTORE = \
758 "lss esp, [esp]";
759
760 extern void PUSHF_CLI (void);
761 #pragma aux PUSHF_CLI = \
762 "pushfd" \
763 "cli";
764
765 extern void POPF (void);
766 #pragma aux POPF = \
767 "popfd";
768
769 extern WORD watcom_MY_CS (void);
770 #pragma aux watcom_MY_CS = \
771 "mov ax, cs" \
772 __modify [__ax];
773
774 extern WORD watcom_MY_DS(void);
775 #pragma aux watcom_MY_DS = \
776 "mov ax, ds" \
777 __modify [__ax];
778
779 extern DWORD GET_LIMIT (WORD sel);
780 #pragma aux GET_LIMIT = \
781 ".386p" \
782 "lsl eax, eax" \
783 __parm [__eax];
784
785 #define get_cs_limit() GET_LIMIT (watcom_MY_CS())
786 #define get_ds_limit() GET_LIMIT (watcom_MY_DS())
787
788#elif defined(BORLAND386) || defined(DMC386) || defined(MSC386)
789 #define STACK_SET(stk) __asm { mov ax, ss; \
790 mov ebx, esp; \
791 mov cx, ds; \
792 mov ss, cx; \
793 mov esp, stk; \
794 push eax; \
795 push ebx \
796 }
797
798 #define STACK_RESTORE() __asm lss esp, [esp]
799 #define PUSHF_CLI() __emit__ (0x9C,0xFA) /* pushfd; cli */
800 #define POPF() __emit__ (0x9D) /* popfd */
801
802 extern DWORD get_ds_limit (void);
803 extern DWORD get_cs_limit (void);
804 extern DWORD get_ss_limit (void); /* only needed for X32 */
805
806#elif defined(__HIGHC__)
807 #define PUSHF_CLI() _inline (0x9C,0xFA) /* pushfd; cli */
808 #define POPF() _inline (0x9D) /* popfd */
809
810#elif defined(__GNUC__) && defined(__i386__)
811 #define PUSHF_CLI() int eflags_; __asm__ __volatile__ ("pushfl; cli; popl %0" : "=rm" (eflags_))
812 #define POPF() __asm__ __volatile__ ("pushl %0; popfl" :: "rm" (eflags_))
813
814#elif (defined(__SMALL__) || defined(__LARGE__)) && !defined(__SMALL32__)
815 #if defined(__BORLANDC__) /* prevent spawning tasm.exe */
816 #define PUSHF_CLI() __emit__ (0x9C,0xFA)
817 #define POPF() __emit__ (0x9D)
818
819 #elif defined(__DMC__) || (defined(_MSC_VER) && !defined(NO_INLINE_ASM))
820 #define PUSHF_CLI() __asm pushf; \
821 __asm cli
822 #define POPF() __asm popf
823 #endif
824#endif
825
826#if !defined(__WATCOMC__) /* Because these are pragmas on Watcom */
827 #ifndef PUSHF_CLI
828 #define PUSHF_CLI() ((void)0)
829 #endif
830
831 #ifndef POPF
832 #define POPF() ((void)0)
833 #endif
834#endif
835
836
837#define BEEP_FREQ 7000
838#define BEEP_MSEC 1
839
840#if defined(WIN32) || defined(WIN64)
841 #define BEEP() MessageBeep (MB_OK)
842
843#elif defined(_MSC_VER)
844 #define BEEP() ((void)0) /* doesn't even have delay() :-< */
845
846#elif defined(__DMC__)
847 #define BEEP() sound_note (BEEP_FREQ, BEEP_MSEC)
848
849#elif defined(__DJGPP__)
850 #define BEEP() do { \
851 sound (BEEP_FREQ); \
852 /* delay() don't */ usleep (1000*BEEP_MSEC); \
853 /* work under NT */ nosound(); \
854 } while (0)
855
856#elif defined(__HIGHC__) /* Limited <conio.h> */
857 #define BEEP() putchar (7)
858
859#else
860 #define BEEP() do { \
861 sound (BEEP_FREQ); \
862 delay (BEEP_MSEC); \
863 nosound(); \
864 } while (0)
865#endif
866
867/* Macros for sleeping. Reference on djgpp's usleep().
868 */
869#if (defined(WIN32) || defined(WIN64)) && !defined(WATT32_DJGPP_MINGW)
870 #ifndef __MINGW32__
871 #define usleep(us) Sleep((us)/1000)
872 #endif
873 #define uclock() clock()
874 #define UCLOCKS_PER_SEC CLOCKS_PER_SEC
875 #define uclock_t clock_t
876
877#elif defined(__WATCOMC__) || defined(__HIGHC__)
878 #define usleep(us) delay((us)/1000)
879 #define uclock() clock()
880 #define UCLOCKS_PER_SEC CLOCKS_PER_SEC
881 #define uclock_t clock_t
882#endif
883
884
885/*
886 * Defines for real/pmode-mode interrupt handlers (crit.c, netback.c and pcintr.c)
887 */
888#if !defined(INTR_PROTOTYPE)
889 #if defined(WIN32) || defined(WIN64)
890 /* No need for this on Windows */
891
892 #elif (DOSX == 0)
893 #if (__WATCOMC__ >= 1200) /* OpenWatcom 1.0+ */
894 #define INTR_PROTOTYPE void interrupt far
895 typedef INTR_PROTOTYPE (*W32_IntrHandler)();
896
897 #elif defined(__TURBOC__)
898 #define INTR_PROTOTYPE void cdecl interrupt
899 typedef void interrupt (*W32_IntrHandler)(void);
900
901 #else
902 #define INTR_PROTOTYPE void cdecl interrupt
903 typedef void (cdecl interrupt *W32_IntrHandler)();
904 #endif
905
906 #elif defined(WATCOM386)
907 #define INTR_PROTOTYPE void __interrupt __far
908 typedef INTR_PROTOTYPE (*W32_IntrHandler)();
909
910 #elif defined(__HIGHC__)
911 #define INTR_PROTOTYPE _Far void _CC (_INTERRUPT|_CALLING_CONVENTION)
912 typedef INTR_PROTOTYPE (*W32_IntrHandler)();
913
914 #elif defined(__DJGPP__)
915 #define INTR_PROTOTYPE void /* simply a SIGALRM handler */
916 typedef void (*W32_IntrHandler)(int);
917
918 #else
919 /* Figure out what to do for others .. */
920 #endif
921#endif
922
923
924#if defined(__i386__) && (DOSX & DJGPP) /* also for gcc -m486 and better */
925 /*
926 * This is not used yet since the benefits/drawbacks are unknown.
927 * Define 32-bit multiplication asm macros.
928 *
929 * umul_ppmm (high_prod, low_prod, multiplier, multiplicand)
930 * multiplies two unsigned long integers multiplier and multiplicand,
931 * and generates a two unsigned word product in high_prod and
932 * low_prod.
933 */
934 #define umul_ppmm(w1,w0,u,v) \
935 __asm__ __volatile__ ( \
936 "mull %3" \
937 : "=a" ((DWORD)(w0)), "=d" ((DWORD)(w1)) \
938 : "%0" ((DWORD)(u)), "rm" ((DWORD)(v)))
939
940 #define mul32(u,v) ({ union ulong_long w; \
941 umul_ppmm (w.s.hi, w.s.lo, u, v); \
942 w.ull; })
943 /* Use as:
944 * DWORD x,y;
945 * ..
946 * uint64 z = mul32 (x,y);
947 */
948
949 /* Borrowed from djgpp's <sys/farptr.h>
950 * Needed in pkt_receiver_pm() because djgpp 2.03 doesn't
951 * save/restore FS/GS registers in the rmode callback stub.
952 * Not needed if 'USE_FAST_PKT' is used.
953 */
954 W32_GCC_INLINE WORD get_fs_reg (void)
955 {
956 WORD sel;
957 __asm__ __volatile__ (
958 "movw %%fs, %w0"
959 : "=r" (sel) : );
960 return (sel);
961 }
962 W32_GCC_INLINE WORD get_gs_reg (void)
963 {
964 WORD sel;
965 __asm__ __volatile__ (
966 "movw %%gs, %w0"
967 : "=r" (sel) : );
968 return (sel);
969 }
970 W32_GCC_INLINE void set_fs_reg (WORD sel)
971 {
972 __asm__ __volatile__ (
973 "movw %w0, %%fs"
974 :: "rm" (sel));
975 }
976 W32_GCC_INLINE void set_gs_reg (WORD sel)
977 {
978 __asm__ __volatile__ (
979 "movw %w0, %%gs"
980 :: "rm" (sel));
981 }
982#else
983 #define get_fs_reg() (1)
984 #define get_gs_reg() (1)
985 #define set_fs_reg(fs) ((void)0)
986 #define set_gs_reg(gs) ((void)0)
987#endif /* __i386__ && (DOSX & DJGPP) */
988
989
990/*
991 * Macros for formatted printing.
992 *
993 * Note: Some versions of snprintf() return -1 if they truncate
994 * the output. Others return size of truncated output.
995 */
996#undef SNPRINTF
997#undef VSNPRINTF
998
999#if defined(__CYGWIN__)
1000 #define SNPRINTF snprintf
1001 #define VSNPRINTF vsnprintf
1002
1003#elif defined(WIN32)
1004 #define SNPRINTF _snprintf
1005 #define VSNPRINTF _vsnprintf
1006
1007#elif defined(__HIGHC__) || defined(__WATCOMC__)
1008 #define SNPRINTF _bprintf
1009 #define VSNPRINTF _vbprintf
1010
1011#elif defined(__DMC__) || (defined(_MSC_VER) && (_MSC_VER >= 700))
1012 #define SNPRINTF _snprintf
1013 #define VSNPRINTF _vsnprintf
1014
1015#elif defined(__DJGPP__) && (__DJGPP_MINOR__ >= 4)
1016 #define SNPRINTF snprintf
1017 #define VSNPRINTF vsnprintf
1018#endif
1019
1020#define UNCONST(type, var, val) (*(type *)&(var)) = val
1021
1022/*
1023 * Used to turn off some clang UBSAN checks.
1024 * Use like:
1025 * CLANG_NO_SANITIZE ("undefined") int func (void)
1026 *
1027 * in the *implementation*.
1028 *
1029 * Ref: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#disabling-instrumentation-with-attribute-no-sanitize-undefined
1030 */
1031#if defined(__clang__) && defined(USE_UBSAN)
1032 #define CLANG_NO_SANITIZE(x) __attribute__((no_sanitize(x)))
1033#else
1034 #define CLANG_NO_SANITIZE(x)
1035#endif
1036
1041#if defined(__CYGWIN__)
1042 #define _aligned_malloc(_size, _alignment) aligned_alloc (_alignment, _size)
1043#elif defined(__WATCOMC__)
1044 #define _aligned_malloc(_size, _alignment) malloc (_size)
1045#endif
1046
1047/*
1048 * The MinGW compiler (espesially the one used on AppVeyor), does not understand
1049 * '%llu' as used in 'ADDR_FMT'. And '%4zu' as used in the 'PRINT_SIZE()' macro.
1050 Just turn these warnings off globally.
1051 */
1052#if defined(__MINGW32__) && defined(TEST_PROG)
1053 #pragma GCC diagnostic ignored "-Wformat"
1054 #pragma GCC diagnostic ignored "-Wformat-extra-args"
1055#endif
1056
1057#ifdef __cplusplus
1058};
1059#endif
1060
1061#endif /* _w32_MISC_H */
1062
cdefs.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
_watt_os_ver
WORD _watt_os_ver
Definition: misc.c:74
_watt_is_win9x
BOOL _watt_is_win9x
Definition: winmisc.c:49
fopen_excl
FILE * fopen_excl(const char *file, const char *mode)
WIN32: Open an existing file (or create) in share-mode but deny other processes to write to the file.
Definition: misc.c:453
_watt_handle_cbreak
WORD _watt_handle_cbreak
Turn off stack-checking here because stack may be out of bounds.
Definition: pc_cbrk.c:47
win32_dos_box
BOOL win32_dos_box
Definition: misc.c:71
set_cbreak
int set_cbreak(int want_brk)
Sets normal and extended BREAK mode.
Definition: pc_cbrk.c:130
MAC_address
const char * MAC_address(const void *addr)
Return hexa-decimal string for an 6/7 byte MAC-address.
Definition: misc.c:997
_watt_cbroke
volatile int _watt_cbroke
Definition: pc_cbrk.c:48
assert_fail
void assert_fail(const char *file, unsigned line, const char *what)
Store the "assert fail" text for later before printing it.
Definition: misc.c:653
get_file_version
BOOL get_file_version(const char *file, char *buf, size_t buf_len)
Returns the version of a PE image (.sys, .dll or .exe).
Definition: winmisc.c:227
_watt_assert_buf
char _watt_assert_buf[256]
Definition: misc.c:75
sig_handler_watt
void MS_CDECL sig_handler_watt(int sig)
SIGINT/SIGBREAK handler function.
Definition: pc_cbrk.c:74
qword_str
const char * qword_str(uint64 val)
The same as above.
Definition: misc.c:1053
Wait
void Wait(unsigned msec)
Not all vendors have delay().
Definition: misc.c:777
get_day_num
DWORD get_day_num(void)
Simplified method of getting days since 1970-01-01.
Definition: misc.c:222
_watt_crtdbg_check
BOOL _watt_crtdbg_check
Definition: misc.c:72
list_lookup
const char * list_lookup(DWORD, const struct search_list *, int)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
dword_str
const char * dword_str(DWORD val)
Return nicely formatted string "xx,xxx,xxx" with thousand separators (left adjusted).
Definition: misc.c:1022
ctime_r
char * ctime_r(const time_t *t, char *res)
A reentrant ctime().
Definition: misc.c:887
localtime_r
struct tm * localtime_r(const time_t *t, struct tm *res)
A reentrant localtime().
Definition: misc.c:900
pack_off.h
pack_on.h
DPMI_regs
Definition: misc.h:589
IREGS
Definition: misc.h:610
search_list
Definition: misc.h:131
swap.h
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65
wtime.h


Watt-32 tcp/ip: E:/WATT/src/misc_str.c Source File

  • src
misc_str.c
Go to the documentation of this file.
1
5#include <stdio.h>
6#include <stdlib.h>
7#include <string.h>
8#include <ctype.h>
9
10#include "wattcp.h"
11#include "misc.h"
12#include "pcdbug.h"
13#include "misc_str.h"
14
15/*
16 * This file contains some gross hacks. Take great care !
17 */
18#include "nochkstk.h"
19
20#ifdef __WATCOMC__
21 extern void _outchar (char c);
22 #pragma aux _outchar = \
23 "mov ah, 2" \
24 "int 21h" \
25 __parm [__dl] \
26 __modify [__ax];
27#endif
28
32#define VALID_CH(c) ((c) >= -1 && (c) <= 255)
33
34#define ISASCII(c) isascii ((int)(c))
35#define ISSPACE(c) (ISASCII (c) && isspace ((int)(c)))
36
37/*
38 * Print a single character to stdout.
39 */
40static int W32_CALL outch (char chr)
41{
42 if (chr == (char)0x1A) /* EOF (^Z) causes trouble to stdout */
43 return (0);
44
45#if defined(WIN32)
46 if (stdout_hnd != INVALID_HANDLE_VALUE)
47 {
48 DWORD written = 0UL;
49
50 WriteConsoleA (stdout_hnd, &chr, 1, &written, NULL);
51 return (int) written;
52 }
53 fputc (chr, stdout);
54
55#elif !(DOSX)
56 /* Qemm doesn't like INT 21 without a valid ES reg. intdos() sets up that.
57 */
58 {
59 union REGS r;
60 r.h.ah = 2;
61 r.h.dl = chr;
62 intdos (&r, &r);
63 }
64
65#elif (DOSX & POWERPAK)
66 {
67 union REGS r;
68 r.h.ah = 2;
69 r.h.dl = chr;
70 int386 (0x21, &r, &r);
71 }
72
73#elif defined(__BORLANDC__) /* avoid spawning tasm.exe */
74 _ES = _DS;
75 _DL = chr;
76 _AL = 2;
77 geninterrupt (0x21);
78
79#elif defined(_MSC_VER) || defined(__DMC__)
80 asm mov dl, chr
81 asm mov ah, 2
82 asm int 21h
83
84#elif defined(__WATCOMC__)
85 _outchar (chr);
86
87#elif defined(__HIGHC__) /* outch() must not be optimised! */
88 _inline (0x8A,0x55,0x08); /* mov dl,[ebp+8] */
89 _inline (0xB4,0x02); /* mov ah,2 */
90 _inline (0xCD,0x21); /* int 21h */
91
92#elif defined(__GNUC__)
93 __asm__ __volatile__
94 ("movb %b0, %%dl\n\t"
95 "movb $2, %%ah\n\t"
96 "int $0x21\n\t"
97 :
98 : "r" (chr)
99 : "%eax", "%edx" );
100
101#else
102 #error Tell me how to do this
103#endif
104
105 return (1);
106}
107
108int (W32_CALL *_outch)(char c) = outch;
109
110/*---------------------------------------------------*/
111
112#if defined(USE_DEBUG)
113 int (MS_CDECL *_printf) (const char*, ...) = printf;
114#else
115 static int MS_CDECL empty_printf (const char *fmt, ...)
116 {
117 outsnl ("`(*_printf)()' called outside `USE_DEBUG'");
118 ARGSUSED (fmt);
119 return (0);
120 }
121 int (MS_CDECL *_printf) (const char*, ...) = empty_printf;
122#endif
123
124/*---------------------------------------------------*/
125
126void W32_CALL outs (const char *s)
127{
128 while (_outch && s && *s)
129 {
130 if (*s == '\n')
131 (*_outch) ('\r');
132 (*_outch) (*s++);
133 }
134}
135
136void W32_CALL outsnl (const char *s)
137{
138 outs (s);
139 outs ("\n");
140}
141
142void W32_CALL outsn (const char *s, int n)
143{
144 while (_outch && *s != '\0' && n-- >= 0)
145 {
146 if (*s == '\n')
147 (*_outch) ('\r');
148 (*_outch) (*s++);
149 }
150}
151
152void W32_CALL outhex (char c)
153{
154 char lo, hi;
155
156 if (!_outch)
157 return;
158
159 hi = (c & 0xF0) >> 4;
160 lo = c & 15;
161
162 if (hi > 9)
163 (*_outch) ((char)(hi-10+'A'));
164 else (*_outch) ((char)(hi+'0'));
165
166 if (lo > 9)
167 (*_outch) ((char)(lo-10+'A'));
168 else (*_outch) ((char)(lo+'0'));
169}
170
171void W32_CALL outhexes (const char *s, int n)
172{
173 while (_outch && n-- > 0)
174 {
175 outhex (*s++);
176 (*_outch) (' ');
177 }
178}
179
185char * W32_CALL rip (char *s)
186{
187 char *p;
188
189 if ((p = strrchr(s,'\n')) != NULL) *p = '\0';
190 if ((p = strrchr(s,'\r')) != NULL) *p = '\0';
191 return (s);
192}
193
199BYTE atox (const char *hex)
200{
201 unsigned hi = toupper ((int)hex[2]);
202 unsigned lo = toupper ((int)hex[3]);
203
204 hi -= isdigit (hi) ? '0' : 'A'-10;
205 lo -= isdigit (lo) ? '0' : 'A'-10;
206 return (BYTE) ((hi << 4) + lo);
207}
208
212char *strreplace (int ch1, int ch2, char *str)
213{
214 char *s = str;
215
216 WATT_ASSERT (str != NULL);
217
218 while (*s)
219 {
220 if (*s == ch1)
221 *s = ch2;
222 s++;
223 }
224 return (str);
225}
226
230char *_strlcpy (char *dst, const char *src, size_t len)
231{
232 size_t slen;
233
234 WATT_ASSERT (src != NULL);
235 WATT_ASSERT (dst != NULL);
236 WATT_ASSERT (len > 0);
237
238 slen = strlen (src);
239 if (slen < len)
240 return strcpy (dst, src);
241
242 memcpy (dst, src, len-1);
243 dst [len-1] = '\0';
244 return (dst);
245}
246
250char *strltrim (char *s)
251{
252 WATT_ASSERT (s != NULL);
253
254 while (s[0] && s[1] && VALID_CH((int)s[0]) && ISSPACE(s[0]))
255 s++;
256 return (char*)s;
257}
258
262char *strrtrim (char *s)
263{
264 size_t n;
265 int ch;
266
267 WATT_ASSERT (s != NULL);
268
269 n = strlen (s);
270 if (n > 0)
271 {
272 n--;
273 while (n)
274 {
275 ch = (int)s [n];
276 if (VALID_CH(ch) && !isspace(ch))
277 break;
278 s [n--] = '\0';
279 }
280 }
281 return (s);
282}
283
287char *strtrim (const char *orig, char *dest, size_t len)
288{
289 size_t i, j;
290 int ch, last = -1;
291
292 WATT_ASSERT (orig != NULL);
293 WATT_ASSERT (dest != NULL);
294
295 for (i = j = 0; i < len && j < len-1; i++)
296 {
297 ch = orig [i];
298 if (ISSPACE(ch) && ISSPACE(last))
299 {
300 last = ch;
301 continue;
302 }
303 dest [j++] = ch;
304 last = ch;
305 }
306 dest [j] = '\0';
307 return (dest);
308}
309
310/*
311 * Reverse string 'str' in place.
312 */
313char *strreverse (char *str)
314{
315 int i, j;
316
317 for (i = 0, j = strlen(str)-1; i < j; i++, j--)
318 {
319 char c = str[i];
320 str[i] = str[j];
321 str[j] = c;
322 }
323 return (str);
324}
325
332size_t strntrimcpy (char *dst, const char *src, size_t n)
333{
334 size_t len;
335 const char *s;
336
337 WATT_ASSERT (src != NULL);
338 WATT_ASSERT (dst != NULL);
339
340 len = 0;
341 s = src;
342
343 if (n && s[0])
344 {
345 while (ISSPACE(*s))
346 ++s;
347 len = strlen (s);
348 if (len)
349 {
350 const char *e = &s[len-1];
351 while (ISSPACE(*e))
352 {
353 --e;
354 --len;
355 }
356 if (len > n)
357 len = n;
358 strncpy (dst, s, len);
359 }
360 }
361 if (len < n)
362 dst[len] = '\0';
363 return (len);
364}
365
366/*
367 * A strtok_r() function taken from libcurl:
368 *
369 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
370 */
371char *strtok_r (char *ptr, const char *sep, char **end)
372{
373 if (!ptr)
374 {
375 /* we got NULL input so then we get our last position instead */
376 ptr = *end;
377 }
378
379 /* pass all letters that are including in the separator string */
380 while (*ptr && strchr(sep, *ptr))
381 ++ptr;
382
383 if (*ptr)
384 {
385 /* so this is where the next piece of string starts */
386 char *start = ptr;
387
388 /* set the end pointer to the first byte after the start */
389 *end = start + 1;
390
391 /* scan through the string to find where it ends, it ends on a
392 * null byte or a character that exists in the separator string.
393 */
394 while (**end && !strchr(sep, **end))
395 ++*end;
396
397 if (**end)
398 {
399 /* the end is not a null byte */
400 **end = '\0'; /* zero terminate it! */
401 ++*end; /* advance the last pointer to beyond the null byte */
402 }
403 return (start); /* return the position where the string starts */
404 }
405 /* we ended up on a null byte, there are no more strings to find! */
406 return (NULL);
407}
408
409#ifdef NOT_USED
410int isstring (const char *str, size_t len)
411{
412 if (strlen(str) > len-1)
413 return (0);
414
415 while (*str)
416 {
417 if (!isprint(*str++))
418 {
419 str--;
420 if (!ISSPACE(*str++))
421 return (0);
422 }
423 }
424 return (1);
425}
426#endif
427
428#if defined(WIN32) || defined(WIN64) /* rest of file */
429#include <wchar.h>
430
431static const char *wide_string (const wchar_t *in_str, UINT cp)
432{
433 static char buf [300];
434
435 buf[0] = '\0';
436 if (WideCharToMultiByte(cp, 0, in_str, -1,
437 buf, sizeof(buf), NULL, NULL) == 0)
438 SNPRINTF (buf, sizeof(buf),
439 "WideCharToMultiByte() failed: %s", win_strerror(GetLastError()));
440 return (buf);
441}
442
443static const wchar_t *ascii_string (const char *in_str, UINT cp)
444{
445 static wchar_t buf [300];
446
447 buf[0] = '\0';
448 if (MultiByteToWideChar(cp, 0, in_str, -1, buf, DIM(buf)) == 0)
449 {
450 TRACE_CONSOLE (2, "MultiByteToWideChar() failed: %s", win_strerror(GetLastError()));
451 return (L"??");
452 }
453 return (buf);
454}
455
456const wchar_t *astring_acp (const char *in_str)
457{
458 return ascii_string (in_str, CP_ACP);
459}
460
461const wchar_t *astring_utf8 (const char *in_str)
462{
463 return ascii_string (in_str, CP_UTF8);
464}
465
466const char *wstring_acp (const wchar_t *in_str)
467{
468 return wide_string (in_str, CP_ACP);
469}
470
471const char *wstring_utf8 (const wchar_t *in_str)
472{
473 return wide_string (in_str, CP_UTF8);
474}
475#endif /* WIN32 || WIN64 */
476
477
misc.h
strltrim
char * strltrim(char *s)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250
atox
BYTE atox(const char *hex)
Convert hexstring "0x??" to hex.
Definition: misc_str.c:199
strtrim
char * strtrim(const char *orig, char *dest, size_t len)
Copy a string (to 'dest') with all excessive blanks (space/tab) removed.
Definition: misc_str.c:287
strreplace
char * strreplace(int ch1, int ch2, char *str)
Replace 'ch1' to 'ch2' in string 'str'.
Definition: misc_str.c:212
strrtrim
char * strrtrim(char *s)
Return pointer to string with trailing blanks (space/tab) removed.
Definition: misc_str.c:262
strntrimcpy
size_t strntrimcpy(char *dst, const char *src, size_t n)
Copy a string, stripping leading and trailing blanks (space/tab).
Definition: misc_str.c:332
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
nochkstk.h
pcdbug.h
ah
Definition: ah.h:45
rip
Definition: routed.h:111
wattcp.h
Core definitions.
win_strerror
char *W32_CALL win_strerror(DWORD err)
Return err-number and string for 'err'.
Definition: winmisc.c:208


Watt-32 tcp/ip: E:/WATT/src/misc_str.h Source File

  • src
misc_str.h
Go to the documentation of this file.
1
3#ifndef _w32_MISC_STR_H
4#define _w32_MISC_STR_H
5
6extern char *_strlcpy (char *dst, const char *src, size_t len);
7extern char *strreplace (int ch1, int ch2, char *str);
8extern size_t strntrimcpy (char *dst, const char *src, size_t len);
9extern char *strrtrim (char *src);
10extern char *strltrim (char *src);
11extern char *strtrim (const char *orig, char *dest, size_t len);
12extern char *strreverse (char *src);
13extern BYTE atox (const char *src);
14
15#if defined(WIN32) || defined(WIN64)
16 #define astring_acp W32_NAMESPACE (astring_acp)
17 #define astring_utf8 W32_NAMESPACE (astring_utf8)
18 #define wstring_utf8 W32_NAMESPACE (wstring_utf8)
19 #define wstring_acp W32_NAMESPACE (wstring_acp)
20
21 extern const char *wstring_acp (const wchar_t *in_str);
22 extern const char *wstring_utf8 (const wchar_t *in_str);
23 extern const wchar_t *astring_acp (const char *in_str);
24 extern const wchar_t *astring_utf8 (const char *in_str);
25#endif
26
27#endif
28
atox
BYTE atox(const char *src)
Convert hexstring "0x??" to hex.
Definition: misc_str.c:199
strntrimcpy
size_t strntrimcpy(char *dst, const char *src, size_t len)
Copy a string, stripping leading and trailing blanks (space/tab).
Definition: misc_str.c:332
strtrim
char * strtrim(const char *orig, char *dest, size_t len)
Copy a string (to 'dest') with all excessive blanks (space/tab) removed.
Definition: misc_str.c:287
strreplace
char * strreplace(int ch1, int ch2, char *str)
Replace 'ch1' to 'ch2' in string 'str'.
Definition: misc_str.c:212
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
strrtrim
char * strrtrim(char *src)
Return pointer to string with trailing blanks (space/tab) removed.
Definition: misc_str.c:262
strltrim
char * strltrim(char *src)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250


Watt-32 tcp/ip: E:/WATT/inc/netinet6/mld6_var.h Source File

  • inc
  • netinet6
mld6_var.h
Go to the documentation of this file.
1
5/*
6 * Copyright (C) 1998 WIDE Project.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef _NETINET6_MLD6_VAR_H_
35#define _NETINET6_MLD6_VAR_H_
36
37#ifdef _KERNEL
38
39#define MLD6_RANDOM_DELAY(X) (random() % (X) + 1)
40
41/*
42 * States for MLD stop-listening processing
43 */
44#define MLD6_OTHERLISTENER 0
45#define MLD6_IREPORTEDLAST 1
46
47void mld6_init (void);
48void mld6_input (struct mbuf *, int);
49void mld6_start_listening (struct in6_multi *);
50void mld6_stop_listening (struct in6_multi *);
51void mld6_fasttimeo (void);
52#endif /* _KERNEL */
53
54#endif /* _NETINET6_MLD6_VAR_H_ */
in6_multi
Definition: in6_var.h:522
mbuf
Definition: mbuf.h:6


Watt-32 tcp/ip: E:/WATT/inc/arpa/nameser.h Source File

  • inc
  • arpa
nameser.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1983, 1989, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * -
38 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
39 *
40 * Permission to use, copy, modify, and distribute this software for any
41 * purpose with or without fee is hereby granted, provided that the above
42 * copyright notice and this permission notice appear in all copies, and that
43 * the name of Digital Equipment Corporation not be used in advertising or
44 * publicity pertaining to distribution of the document or software without
45 * specific, written prior permission.
46 *
47 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
48 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
50 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
51 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
52 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
53 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
54 * SOFTWARE.
55 * -
56 * --Copyright--
57 */
58
59#ifndef __ARPA_NAMESER_H
60#define __ARPA_NAMESER_H
61
62#ifndef __SYS_W32API_H
63#include <sys/w32api.h>
64#endif
65
66#ifndef __SYS_PARAM_H
67#include <sys/param.h>
68#endif
69
70#ifndef __SYS_WTYPES_H
71#include <sys/wtypes.h>
72#endif
73
74#ifndef __SYS_CDEFS_H
75#include <sys/cdefs.h>
76#endif
77
78/*
79 * revision information. this is the release date in YYYYMMDD format.
80 * it can change every day so the right thing to do with it is use it
81 * in preprocessor commands such as "#if (__BIND > 19931104)". do not
82 * compare for equality; rather, use it to determine whether your resolver
83 * is new enough to contain a certain feature.
84 */
85
86#define __BIND 19960801 /* interface version stamp */
87
88/*
89 * Define constants based on rfc883
90 */
91#define PACKETSZ 512 /* maximum packet size */
92#define MAXDNAME 1025 /* maximum domain name */
93#define MAXCDNAME 255 /* maximum compressed domain name */
94#define MAXLABEL 63 /* maximum length of domain label */
95#define HFIXEDSZ 12 /* #/bytes of fixed data in header */
96#define QFIXEDSZ 4 /* #/bytes of fixed data in query */
97#define RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
98#define INT32SZ 4 /* for systems without 32-bit ints */
99#define INT16SZ 2 /* for systems without 16-bit ints */
100#define INADDRSZ 4 /* IPv4 T_A */
101#define IN6ADDRSZ 16 /* IPv6 T_AAAA */
102
103
104/*
105 * Internet nameserver port number
106 */
107#define NAMESERVER_PORT 53
108
109/*
110 * Currently defined opcodes
111 */
112#define QUERY 0x0 /* standard query */
113#define IQUERY 0x1 /* inverse query */
114#define STATUS 0x2 /* nameserver status query */
115#define NS_NOTIFY_OP 0x4 /* notify secondary of SOA change */
116
117#ifdef ALLOW_UPDATES
118 /* non standard - supports ALLOW_UPDATES stuff from Mike Schwartz */
119# define UPDATEA 0x9 /* add resource record */
120# define UPDATED 0xa /* delete a specific resource record */
121# define UPDATEDA 0xb /* delete all named resource record */
122# define UPDATEM 0xc /* modify a specific resource record */
123# define UPDATEMA 0xd /* modify all named resource record */
124# define ZONEINIT 0xe /* initial zone transfer */
125# define ZONEREF 0xf /* incremental zone referesh */
126#endif
127
128/*
129 * Currently defined response codes
130 */
131#if !defined(WIN32) && !defined(_WIN32) /* <winerror.h> value is okay */
132#define NOERROR 0 /* no error */
133#endif
134
135/* A fix for the 'c-ares' resolver library that has a:
136 * #ifndef NOERROR
137 * #define NOERROR ns_r_noerror
138 * #endif
139 */
140#define ns_r_noerror 0
141
142#define FORMERR 1 /* format error */
143#define SERVFAIL 2 /* server failure */
144#define NXDOMAIN 3 /* non existent domain */
145#define NOTIMP 4 /* not implemented */
146#define REFUSED 5 /* query refused */
147
148#ifdef ALLOW_UPDATES
149 /* non standard */
150# define NOCHANGE 0xf /* update failed to change db */
151#endif
152
153/*
154 * Type values for resources and queries
155 */
156#define T_A 1 /* host address */
157#define T_NS 2 /* authoritative server */
158#define T_MD 3 /* mail destination */
159#define T_MF 4 /* mail forwarder */
160#define T_CNAME 5 /* canonical name */
161#define T_SOA 6 /* start of authority zone */
162#define T_MB 7 /* mailbox domain name */
163#define T_MG 8 /* mail group member */
164#define T_MR 9 /* mail rename name */
165#define T_NULL 10 /* null resource record */
166#define T_WKS 11 /* well known service */
167#define T_PTR 12 /* domain name pointer */
168#define T_HINFO 13 /* host information */
169#define T_MINFO 14 /* mailbox information */
170#define T_MX 15 /* mail routing information */
171#define T_TXT 16 /* text strings */
172#define T_RP 17 /* responsible person */
173#define T_AFSDB 18 /* AFS cell database */
174#define T_X25 19 /* X_25 calling address */
175#define T_ISDN 20 /* ISDN calling address */
176#define T_RT 21 /* router */
177#define T_NSAP 22 /* NSAP address */
178#define T_NSAP_PTR 23 /* reverse NSAP lookup (deprecated) */
179#define T_SIG 24 /* security signature */
180#define T_KEY 25 /* security key */
181#define T_PX 26 /* X.400 mail mapping */
182#define T_GPOS 27 /* geographical position (withdrawn) */
183#define T_AAAA 28 /* IP6 Address */
184#define T_LOC 29 /* Location Information */
185#define T_NXT 30 /* Next Valid Name in Zone */
186#define T_EID 31 /* Endpoint identifier */
187#define T_NIMLOC 32 /* Nimrod locator */
188#define T_SRV 33 /* Server selection */
189#define T_ATMA 34 /* ATM Address */
190#define T_NAPTR 35 /* Naming Authority PoinTeR */
191#define T_OPT 41 /* Extension mechanisms for DNS (EDNS) */
192 /* non standard */
193#define T_UINFO 100 /* user (finger) information */
194#define T_UID 101 /* user ID */
195#define T_GID 102 /* group ID */
196#define T_UNSPEC 103 /* Unspecified format (binary data) */
197 /* Query type values which do not appear in resource records */
198#define T_IXFR 251 /* incremental zone transfer */
199#define T_AXFR 252 /* transfer zone of authority */
200#define T_MAILB 253 /* transfer mailbox records */
201#define T_MAILA 254 /* transfer mail agent records */
202#define T_ANY 255 /* wildcard match */
203#define T_CAA 257 /* Certification Authority Authorization, RFC-6844 */
204#define T_WINS 0xFF01 /* WINS name lookup */
205#define T_WINSR 0xFF02 /* WINS reverse lookup */
206
207/*
208 * Values for class field
209 */
210
211#define C_IN 1 /* the arpa internet */
212#define C_CHAOS 3 /* for chaos net (MIT) */
213#define C_HS 4 /* for Hesiod name server (MIT) (XXX) */
214 /* Query class values which do not appear in resource records */
215#define C_ANY 255 /* wildcard match */
216
217/*
218 * Status return codes for T_UNSPEC conversion routines
219 */
220#define CONV_SUCCESS 0
221#define CONV_OVERFLOW (-1)
222#define CONV_BADFMT (-2)
223#define CONV_BADCKSUM (-3)
224#define CONV_BADBUFLEN (-4)
225
226W32_CLANG_PACK_WARN_OFF()
227
228#include <sys/pack_on.h>
229
230/*
231 * Structure for query header. The order of the fields is machine- and
232 * compiler-dependent, depending on the byte/bit order and the layout
233 * of bit fields. We use bit fields only in int variables, as this
234 * is all ANSI requires. This requires a somewhat confusing rearrangement.
235 */
236
237typedef struct {
238 unsigned id : 16; /* query identification number */
239
240 /* fields in third byte */
241 unsigned rd : 1; /* recursion desired */
242 unsigned tc : 1; /* truncated message */
243 unsigned aa : 1; /* authoritative answer */
244 unsigned opcode : 4; /* purpose of message */
245 unsigned qr : 1; /* response flag */
246
247 /* fields in fourth byte */
248 unsigned rcode : 4; /* response code */
249 unsigned cd : 1; /* checking disabled by resolver */
250 unsigned ad : 1; /* authentic data from named */
251 unsigned unused : 1; /* unused bits (MBZ as of 4.9.3a3) */
252 unsigned ra : 1; /* recursion available */
253
254 /* remaining bytes */
255 unsigned qdcount : 16; /* number of question entries */
256 unsigned ancount : 16; /* number of answer entries */
257 unsigned nscount : 16; /* number of authority entries */
258 unsigned arcount : 16; /* number of resource entries */
259 } HEADER;
260
261
262/*
263 * Defines for handling compressed domain names
264 */
265#define INDIR_MASK 0xc0
266
267/*
268 * Structure for passing resource records around.
269 */
270struct rrec {
271 u_short r_zone; /* zone number */
272 u_short r_class; /* class number */
273 u_short r_type; /* type number */
274 u_long r_ttl; /* time to live */
275 int r_size; /* size of data area */
276 char *r_data; /* pointer to data */
277 };
278
279#include <sys/pack_off.h>
280
281W32_CLANG_PACK_WARN_DEF()
282
283__BEGIN_DECLS
284
285W32_FUNC u_short W32_CALL _getshort (const u_char *);
286W32_FUNC u_long W32_CALL _getlong (const u_char *);
287
288__END_DECLS
289
290/*
291 * Inline versions of get/put short/long. Pointer is advanced.
292 *
293 * These macros demonstrate the property of C whereby it can be
294 * portable or it can be elegant but rarely both.
295 */
296#define GETSHORT(s, cp) do { \
297 register u_char *t_cp = (u_char *)(cp); \
298 (s) = ((u_short)t_cp[0] << 8) \
299 | ((u_short)t_cp[1]); \
300 (cp) += INT16SZ; \
301 } while (0)
302
303#define GETLONG(l, cp) do { \
304 register u_char *t_cp = (u_char *)(cp); \
305 (l) = ((u_long)t_cp[0] << 24) \
306 | ((u_long)t_cp[1] << 16) \
307 | ((u_long)t_cp[2] << 8) \
308 | ((u_long)t_cp[3]); \
309 (cp) += INT32SZ; \
310 } while (0)
311
312#define PUTSHORT(s, cp) do { \
313 register u_short t_s = (u_short)(s); \
314 register u_char *t_cp = (u_char *)(cp); \
315 *t_cp++ = (u_char) (t_s >> 8); \
316 *t_cp = (u_char) t_s; \
317 (cp) += INT16SZ; \
318 } while (0)
319
320#define PUTLONG(l, cp) do { \
321 register u_long t_l = (u_long)(l); \
322 register u_char *t_cp = (u_char *)(cp); \
323 *t_cp++ = (u_char) (t_l >> 24); \
324 *t_cp++ = (u_char) (t_l >> 16); \
325 *t_cp++ = (u_char) (t_l >> 8); \
326 *t_cp = (u_char) t_l; \
327 (cp) += INT32SZ; \
328 } while (0)
329
330#endif
cdefs.h
pack_off.h
param.h
HEADER
Definition: nameser_compat.h:50
rrec
Definition: nameser.h:270
w32api.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/netinet6/nd6.h Source File

  • inc
  • netinet6
nd6.h
Go to the documentation of this file.
1
5/*
6 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef _NETINET6_ND6_H_
35#define _NETINET6_ND6_H_
36
37/* see net/route.h, or net/if_inarp.h
38 */
39#ifndef RTF_ANNOUNCE
40#define RTF_ANNOUNCE RTF_PROTO2
41#endif
42
43#include <sys/queue.h>
44
45#ifndef _NETINET6_IN6_VAR_H_
46#include <netinet6/in6_var.h>
47#endif
48
49struct llinfo_nd6 {
50 struct llinfo_nd6 *ln_next;
51 struct llinfo_nd6 *ln_prev;
52 struct rtentry *ln_rt;
53 struct mbuf *ln_hold; /* last packet until resolved/timeout */
54 long ln_asked; /* number of queries already sent for this addr */
55 u_long ln_expire; /* lifetime for NDP state transition */
56 short ln_state; /* reachability state */
57 short ln_router; /* 2^0: ND6 router bit */
58 int ln_byhint; /* # of times we made it reachable by UL hint */
59};
60
61#define ND6_LLINFO_NOSTATE -2
62/*
63 * We don't need the WAITDELETE state any more, but we keep the definition
64 * in a comment line instead of removing it. This is necessary to avoid
65 * unintentionally reusing the value for another purpose, which might
66 * affect backward compatibility with old applications.
67 * (20000711 jinmei@kame.net)
68 */
69/* #define ND6_LLINFO_WAITDELETE -1 */
70#define ND6_LLINFO_INCOMPLETE 0
71#define ND6_LLINFO_REACHABLE 1
72#define ND6_LLINFO_STALE 2
73#define ND6_LLINFO_DELAY 3
74#define ND6_LLINFO_PROBE 4
75
76#define ND6_IS_LLINFO_PROBREACH(n) ((n)->ln_state > ND6_LLINFO_INCOMPLETE)
77
78struct nd_ifinfo {
79 u_int32_t linkmtu; /* LinkMTU */
80 u_int32_t maxmtu; /* Upper bound of LinkMTU */
81 u_int32_t basereachable; /* BaseReachableTime */
82 u_int32_t reachable; /* Reachable Time */
83 u_int32_t retrans; /* Retrans Timer */
84 u_int32_t flags; /* Flags */
85 int recalctm; /* BaseReacable re-calculation timer */
86 u_int8_t chlim; /* CurHopLimit */
87 u_int8_t receivedra;
88 /* the following 3 members are for privacy extension for addrconf */
89 u_int8_t randomseed0[8]; /* upper 64 bits of MD5 digest */
90 u_int8_t randomseed1[8]; /* lower 64 bits (usually the EUI64 IFID) */
91 u_int8_t randomid[8]; /* current random ID */
92};
93
94#define ND6_IFF_PERFORMNUD 0x1
95
96struct in6_nbrinfo {
97 char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */
98 struct in6_addr addr; /* IPv6 address of the neighbor */
99 long asked; /* number of queries already sent for this addr */
100 int isrouter; /* if it acts as a router */
101 int state; /* reachability state */
102 int expire; /* lifetime for NDP state transition */
103};
104
105#define DRLSTSIZ 10
106#define PRLSTSIZ 10
107struct in6_drlist {
108 char ifname[IFNAMSIZ];
109 struct {
110 struct in6_addr rtaddr;
111 u_char flags;
112 u_short rtlifetime;
113 u_long expire;
114 u_short if_index;
115 } defrouter[DRLSTSIZ];
116};
117
118struct in6_defrouter {
119 struct sockaddr_in6 rtaddr;
120 u_char flags;
121 u_short rtlifetime;
122 u_long expire;
123 u_short if_index;
124};
125
126struct in6_prlist {
127 char ifname[IFNAMSIZ];
128 struct {
129 struct in6_addr prefix;
130 struct prf_ra raflags;
131 u_char prefixlen;
132 u_char origin;
133 u_int32_t vltime;
134 u_int32_t pltime;
135 time_t expire;
136 u_short if_index;
137 u_short advrtrs; /* number of advertisement routers */
138 struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */
139 } prefix[PRLSTSIZ];
140};
141
142struct in6_prefix {
143 struct sockaddr_in6 prefix;
144 struct prf_ra raflags;
145 u_char prefixlen;
146 u_char origin;
147 u_long vltime;
148 u_long pltime;
149 u_long expire;
150 u_int32_t flags;
151 int refcnt;
152 u_short if_index;
153 u_short advrtrs; /* number of advertisement routers */
154 /* struct sockaddr_in6 advrtr[] */
155};
156
157#ifdef _KERNEL
158struct in6_ondireq {
159 char ifname[IFNAMSIZ];
160 struct {
161 u_int32_t linkmtu; /* LinkMTU */
162 u_int32_t maxmtu; /* Upper bound of LinkMTU */
163 u_int32_t basereachable; /* BaseReachableTime */
164 u_int32_t reachable; /* Reachable Time */
165 u_int32_t retrans; /* Retrans Timer */
166 u_int32_t flags; /* Flags */
167 int recalctm; /* BaseReacable re-calculation timer */
168 u_int8_t chlim; /* CurHopLimit */
169 u_int8_t receivedra;
170 } ndi;
171};
172#endif
173
174struct in6_ndireq {
175 char ifname[IFNAMSIZ];
176 struct nd_ifinfo ndi;
177};
178
179struct in6_ndifreq {
180 char ifname[IFNAMSIZ];
181 u_long ifindex;
182};
183
184/* Prefix status */
185#define NDPRF_ONLINK 0x1
186#define NDPRF_DETACHED 0x2
187
188/* protocol constants */
189#define MAX_RTR_SOLICITATION_DELAY 1 /* 1sec */
190#define RTR_SOLICITATION_INTERVAL 4 /* 4sec */
191#define MAX_RTR_SOLICITATIONS 3
192
193#define ND6_INFINITE_LIFETIME 0xffffffff
194
195#ifdef _KERNEL
196/* node constants */
197#define MAX_REACHABLE_TIME 3600000 /* msec */
198#define REACHABLE_TIME 30000 /* msec */
199#define RETRANS_TIMER 1000 /* msec */
200#define MIN_RANDOM_FACTOR 512 /* 1024 * 0.5 */
201#define MAX_RANDOM_FACTOR 1536 /* 1024 * 1.5 */
202#define DEF_TEMP_VALID_LIFETIME 604800 /* 1 week */
203#define DEF_TEMP_PREFERRED_LIFETIME 86400 /* 1 day */
204#define TEMPADDR_REGEN_ADVANCE 5 /* sec */
205#define MAX_TEMP_DESYNC_FACTOR 600 /* 10 min */
206#define ND_COMPUTE_RTIME(x) \
207 (((MIN_RANDOM_FACTOR * (x >> 10)) + (random() & \
208 ((MAX_RANDOM_FACTOR - MIN_RANDOM_FACTOR) * (x >> 10)))) /1000)
209
210TAILQ_HEAD(nd_drhead, nd_defrouter);
211struct nd_defrouter {
212 TAILQ_ENTRY(nd_defrouter) dr_entry;
213 struct in6_addr rtaddr;
214 u_char flags; /* flags on RA message */
215 u_short rtlifetime;
216 u_long expire;
217 u_long advint; /* Mobile IPv6 addition (milliseconds) */
218 u_long advint_expire; /* Mobile IPv6 addition */
219 int advints_lost; /* Mobile IPv6 addition */
220 struct ifnet *ifp;
221};
222
223struct nd_prefix {
224 struct ifnet *ndpr_ifp;
225 LIST_ENTRY(nd_prefix) ndpr_entry;
226 struct sockaddr_in6 ndpr_prefix; /* prefix */
227 struct in6_addr ndpr_mask; /* netmask derived from the prefix */
228 struct in6_addr ndpr_addr; /* address that is derived from the prefix */
229 u_int32_t ndpr_vltime; /* advertised valid lifetime */
230 u_int32_t ndpr_pltime; /* advertised preferred lifetime */
231 time_t ndpr_expire; /* expiration time of the prefix */
232 time_t ndpr_preferred; /* preferred time of the prefix */
233 struct prf_ra ndpr_flags;
234 u_int32_t ndpr_stateflags; /* actual state flags */
235 /* list of routers that advertise the prefix: */
236 LIST_HEAD(pr_rtrhead, nd_pfxrouter) ndpr_advrtrs;
237 u_char ndpr_plen;
238 int ndpr_refcnt; /* reference couter from addresses */
239};
240
241#define ndpr_next ndpr_entry.le_next
242
243#define ndpr_raf ndpr_flags
244#define ndpr_raf_onlink ndpr_flags.onlink
245#define ndpr_raf_auto ndpr_flags.autonomous
246
247/*
248 * We keep expired prefix for certain amount of time, for validation purposes.
249 * 1800s = MaxRtrAdvInterval
250 */
251#define NDPR_KEEP_EXPIRED (1800 * 2)
252
253/*
254 * Message format for use in obtaining information about prefixes
255 * from inet6 sysctl function
256 */
257struct inet6_ndpr_msghdr {
258 u_short inpm_msglen; /* to skip over non-understood messages */
259 u_char inpm_version; /* future binary compatibility */
260 u_char inpm_type; /* message type */
261 struct in6_addr inpm_prefix;
262 u_long prm_vltim;
263 u_long prm_pltime;
264 u_long prm_expire;
265 u_long prm_preferred;
266 struct in6_prflags prm_flags;
267 u_short prm_index; /* index for associated ifp */
268 u_char prm_plen; /* length of prefix in bits */
269};
270
271#define prm_raf_onlink prm_flags.prf_ra.onlink
272#define prm_raf_auto prm_flags.prf_ra.autonomous
273
274#define prm_statef_onlink prm_flags.prf_state.onlink
275
276#define prm_rrf_decrvalid prm_flags.prf_rr.decrvalid
277#define prm_rrf_decrprefd prm_flags.prf_rr.decrprefd
278
279#define ifpr2ndpr(ifpr) ((struct nd_prefix *)(ifpr))
280#define ndpr2ifpr(ndpr) ((struct ifprefix *)(ndpr))
281
282struct nd_pfxrouter {
283 LIST_ENTRY(nd_pfxrouter) pfr_entry;
284
285#define pfr_next pfr_entry.le_next
286 struct nd_defrouter *router;
287};
288
289LIST_HEAD(nd_prhead, nd_prefix);
290
291/* nd6.c */
292extern int nd6_prune;
293extern int nd6_delay;
294extern int nd6_umaxtries;
295extern int nd6_mmaxtries;
296extern int nd6_useloopback;
297extern int nd6_maxnudhint;
298extern int nd6_gctimer;
299extern struct llinfo_nd6 llinfo_nd6;
300extern struct nd_ifinfo *nd_ifinfo;
301extern struct nd_drhead nd_defrouter;
302extern struct nd_prhead nd_prefix;
303extern int nd6_debug;
304
305#define nd6log(x) do { if (nd6_debug) log x; } while (0)
306
307extern struct callout nd6_timer_ch;
308
309/* nd6_rtr.c */
310extern int nd6_defifindex;
311extern int ip6_desync_factor; /* seconds */
312extern u_int32_t ip6_temp_preferred_lifetime; /* seconds */
313extern u_int32_t ip6_temp_valid_lifetime; /* seconds */
314extern int ip6_temp_regen_advance; /* seconds */
315
316union nd_opts {
317 struct nd_opt_hdr *nd_opt_array[9]; /* max = home agent info */
318 struct {
319 struct nd_opt_hdr *zero;
320 struct nd_opt_hdr *src_lladdr;
321 struct nd_opt_hdr *tgt_lladdr;
322 struct nd_opt_prefix_info *pi_beg; /* multiple opts, start */
323 struct nd_opt_rd_hdr *rh;
324 struct nd_opt_mtu *mtu;
325 struct nd_opt_hdr *six;
326 struct nd_opt_advint *adv;
327 struct nd_opt_hai *hai;
328 struct nd_opt_hdr *search; /* multiple opts */
329 struct nd_opt_hdr *last; /* multiple opts */
330 int done;
331 struct nd_opt_prefix_info *pi_end; /* multiple opts, end */
332 } nd_opt_each;
333};
334#define nd_opts_src_lladdr nd_opt_each.src_lladdr
335#define nd_opts_tgt_lladdr nd_opt_each.tgt_lladdr
336#define nd_opts_pi nd_opt_each.pi_beg
337#define nd_opts_pi_end nd_opt_each.pi_end
338#define nd_opts_rh nd_opt_each.rh
339#define nd_opts_mtu nd_opt_each.mtu
340#define nd_opts_adv nd_opt_each.adv
341#define nd_opts_hai nd_opt_each.hai
342#define nd_opts_search nd_opt_each.search
343#define nd_opts_last nd_opt_each.last
344#define nd_opts_done nd_opt_each.done
345
346/* XXX: need nd6_var.h?? */
347
348/* nd6.c */
349void nd6_init (void);
350void nd6_ifattach (struct ifnet *);
351int nd6_is_addr_neighbor (struct sockaddr_in6 *, struct ifnet *);
352void nd6_option_init (void *, int, union nd_opts *);
353struct nd_opt_hdr *nd6_option (union nd_opts *);
354int nd6_options (union nd_opts *);
355struct rtentry *nd6_lookup (struct in6_addr *, int, struct ifnet *);
356void nd6_setmtu (struct ifnet *);
357void nd6_timer (void *);
358void nd6_purge (struct ifnet *);
359struct llinfo_nd6 *nd6_free (struct rtentry *);
360void nd6_nud_hint (struct rtentry *, struct in6_addr *, int);
361int nd6_resolve (struct ifnet *, struct rtentry *, struct mbuf *, struct sockaddr *, u_char *);
362void nd6_rtrequest (int, struct rtentry *, struct rt_addrinfo *);
363int nd6_ioctl (u_long, caddr_t, struct ifnet *);
364struct rtentry *nd6_cache_lladdr (struct ifnet *, struct in6_addr *, char *, int, int, int);
365int nd6_output (struct ifnet *, struct ifnet *, struct mbuf *, struct sockaddr_in6 *, struct rtentry *);
366int nd6_storelladdr (struct ifnet *, struct rtentry *, struct mbuf *, struct sockaddr *, u_char *);
367int nd6_need_cache (struct ifnet *);
368
369/* nd6_nbr.c */
370void nd6_na_input (struct mbuf *, int, int);
371void nd6_na_output (struct ifnet *, const struct in6_addr *, const struct in6_addr *, u_long, int, struct sockaddr *);
372void nd6_ns_input (struct mbuf *, int, int);
373void nd6_ns_output (struct ifnet *, const struct in6_addr *, const struct in6_addr *, struct llinfo_nd6 *, int);
374caddr_t nd6_ifptomac (struct ifnet *);
375void nd6_dad_start (struct ifaddr *, int *);
376void nd6_dad_stop (struct ifaddr *);
377void nd6_dad_duplicated (struct ifaddr *);
378
379/* nd6_rtr.c */
380void nd6_rs_input (struct mbuf *, int, int);
381void nd6_ra_input (struct mbuf *, int, int);
382void prelist_del (struct nd_prefix *);
383void defrouter_addreq (struct nd_defrouter *);
384void defrouter_delreq (struct nd_defrouter *, int);
385void defrouter_select (void);
386void defrtrlist_del (struct nd_defrouter *);
387void prelist_remove (struct nd_prefix *);
388int prelist_update (struct nd_prefix *, struct nd_defrouter *, struct mbuf *);
389int nd6_prelist_add (struct nd_prefix *, struct nd_defrouter *, struct nd_prefix **);
390int nd6_prefix_onlink (struct nd_prefix *);
391int nd6_prefix_offlink (struct nd_prefix *);
392void pfxlist_onlink_check (void);
393struct nd_defrouter *defrouter_lookup (struct in6_addr *, struct ifnet *);
394struct nd_prefix *nd6_prefix_lookup (struct nd_prefix *);
395int in6_init_prefix_ltimes (struct nd_prefix *ndpr);
396void rt6_flush (struct in6_addr *, struct ifnet *);
397int nd6_setdefaultiface (int);
398int in6_tmpifadd (const struct in6_ifaddr *, int);
399
400#endif /* _KERNEL */
401
402#endif /* _NETINET6_ND6_H_ */
in6_var.h
queue.h
callout
Definition: wtypes.h:402
ifaddr
Definition: if.h:250
ifnet
Definition: if.h:136
in6_addr
Definition: in.h:151
in6_defrouter
Definition: nd6.h:118
in6_drlist
Definition: nd6.h:107
in6_ifaddr
Definition: in6_var.h:91
in6_nbrinfo
Definition: nd6.h:96
in6_ndifreq
Definition: nd6.h:179
in6_ndireq
Definition: nd6.h:174
in6_ondireq
Definition: nd6.h:158
in6_prefix
Definition: nd6.h:142
in6_prflags
Definition: in6_var.h:296
in6_prlist
Definition: nd6.h:126
inet6_ndpr_msghdr
Definition: nd6.h:257
llinfo_nd6
Definition: nd6.h:49
mbuf
Definition: mbuf.h:6
nd_defrouter
Definition: nd6.h:211
nd_ifinfo
Definition: nd6.h:78
nd_opt_hdr
Definition: icmp6.h:302
nd_opt_mtu
Definition: icmp6.h:338
nd_opt_prefix_info
Definition: icmp6.h:316
nd_opt_rd_hdr
Definition: icmp6.h:330
nd_pfxrouter
Definition: nd6.h:282
nd_prefix
Definition: nd6.h:223
prf_ra
Definition: in6_var.h:279
rt_addrinfo
Definition: route.h:223
rtentry
Definition: route.h:97
sockaddr_in6
Definition: in.h:231
sockaddr
Definition: socket.h:181
nd_opts
Definition: nd6.h:316


Watt-32 tcp/ip: E:/WATT/inc/net/if_fddi.h Source File

  • inc
  • net
if_fddi.h
Go to the documentation of this file.
1
4#include <netinet/if_fddi.h>
if_fddi.h


Watt-32 tcp/ip: E:/WATT/src/netaddr.c Source File

  • src
netaddr.c
Go to the documentation of this file.
1
23#include <stdio.h>
24#include <stdlib.h>
25#include <string.h>
26#include <ctype.h>
27
28#include "wattcp.h"
29#include "misc.h"
30#include "misc_str.h"
31#include "netaddr.h"
32#include "cpumodel.h"
33
34#if defined(USE_BSD_API)
35#include "socket.h"
36#endif
37
44char * W32_CALL _inet_ntoa (char *s, DWORD ip)
45{
46 static char buf [4][20];
47 static int idx = 0;
48 char *p = s;
49
50 if (!p)
51 {
52 p = buf [idx++];
53 idx &= 3;
54 }
55 itoa ((int)(ip >> 24), p, 10);
56 strcat (p, ".");
57 itoa ((int)(ip >> 16) & 0xFF, strchr(p, '\0'), 10);
58 strcat (p, ".");
59 itoa ((int)(ip >> 8) & 0xFF, strchr(p, '\0'), 10);
60 strcat (p, ".");
61 itoa ((int)(ip & 0xFF), strchr(p, '\0'), 10);
62 return (p);
63}
64
70DWORD W32_CALL _inet_addr (const char *s)
71{
72 DWORD addr = 0;
73
74 if (isaddr(s))
75 return aton (s);
76 if (isaddr_dotless(s, &addr))
77 return (addr);
78 return (0);
79}
80
86DWORD W32_CALL aton (const char *str)
87{
88 DWORD ip = 0;
89 int i;
90 char *s = (char*) str;
91
92 if (*s == '[')
93 ++s;
94
95 for (i = 24; i >= 0; i -= 8)
96 {
97 int cur = ATOI (s);
98
99 ip |= (DWORD)(cur & 0xFF) << i;
100 if (!i)
101 return (ip);
102
103 s = strchr (s, '.');
104 if (!s)
105 return (0); /* return 0 on error */
106 s++;
107 }
108 return (0); /* cannot happen ?? */
109}
110
115DWORD W32_CALL aton_dotless (const char *str)
116{
117 DWORD ip = 0UL;
118
119 isaddr_dotless (str, &ip);
120 return (ip);
121}
122
128BOOL W32_CALL isaddr (const char *str)
129{
130 int ch;
131
132 while ((ch = *str++) != 0)
133 {
134 if (isdigit(ch))
135 continue;
136 if (ch == '.' || ch == ' ' || ch == '[' || ch == ']')
137 continue;
138 return (FALSE);
139 }
140 return (TRUE);
141}
142
148BOOL W32_CALL isaddr_dotless (const char *str, DWORD *ip)
149{
150 char buf [10] = { 0 };
151 int ch, i = 0;
152 DWORD addr;
153
154 while ((ch = *str++) != '\0')
155 {
156 if (ch == '.' || i == SIZEOF(buf))
157 return (FALSE);
158
159 if (isdigit(ch))
160 {
161 buf [i++] = ch;
162 continue;
163 }
164 if (ch == ' ' || ch == '[' || ch == ']')
165 continue;
166 return (FALSE);
167 }
168
169 buf [i] = '\0';
170 addr = atol (buf);
171 if (addr == 0)
172 return (FALSE);
173
174 if ((addr % 256) == 0) /* LSB must be non-zero */
175 return (FALSE);
176
177 if (((addr >> 24) % 256) == 0) /* MSB must be non-zero */
178 return (FALSE);
179
180 if (ip)
181 *ip = addr;
182 return (TRUE);
183}
184
185char * W32_CALL inet_ntoa (struct in_addr addr)
186{
187 static char buf [4][20]; /* use max 4 at a time */
188 static int idx = 0;
189 char *rc = buf [idx++];
190
191 idx &= 3;
192 return _inet_ntoa (rc, ntohl(addr.s_addr));
193}
194
205const char *_inet_atoeth (const char *src, eth_address *p_eth)
206{
207 BYTE *eth = (BYTE*) p_eth;
208
209#if (DOSX)
210 int tmp [sizeof(eth_address)];
211 BOOL ok, colon = (src[2] == ':');
212
213 ok = colon ? (sscanf(src, "%02x:%02x:%02x:%02x:%02x:%02x",
214 &tmp[0], &tmp[1], &tmp[2],
215 &tmp[3], &tmp[4], &tmp[5]) == DIM(tmp)) :
216 (sscanf(src, "%02x-%02x-%02x-%02x-%02x-%02x",
217 &tmp[0], &tmp[1], &tmp[2],
218 &tmp[3], &tmp[4], &tmp[5]) == DIM(tmp));
219 if (!ok)
220 return (NULL);
221
222 eth [0] = tmp [0];
223 eth [1] = tmp [1];
224 eth [2] = tmp [2];
225 eth [3] = tmp [3];
226 eth [4] = tmp [4];
227 eth [5] = tmp [5];
228 src = strrchr(src, colon ? ':' : '-') + 3;
229#else
230 eth [0] = atox (src - 2); /* xx:xx:xx:xx:xx:xx */
231 eth [1] = atox (src + 1); /* ^src-2 */
232 eth [2] = atox (src + 4); /* ^src+1 */
233 eth [3] = atox (src + 7);
234 eth [4] = atox (src + 10);
235 eth [5] = atox (src + 13);
236
237 src += strlen ("xx:xx:xx:xx:xx:xx");
238#endif
239
240 if (*src == ',')
241 ++src;
242 return strltrim (src);
243}
244
245#if defined(USE_BSD_API)
246
247char * W32_CALL inet_ntoa_r (struct in_addr addr, char *buf, int buflen)
248{
249 if (buf && buflen >= SIZEOF("255.255.255.255"))
250 return _inet_ntoa (buf, ntohl(addr.s_addr));
251 return (NULL);
252}
253
254int W32_CALL inet_aton (const char *name, struct in_addr *addr)
255{
256 u_long ip = inet_addr (name);
257
258 if (ip == INADDR_NONE && strcmp(name, "255.255.255.255"))
259 return (0);
260 addr->s_addr = ip;
261 return (1);
262}
263
264u_long W32_CALL inet_addr (const char *addr)
265{
266 DWORD ip = htonl (_inet_addr(addr));
267
268 if (ip)
269 return (ip);
270 return (INADDR_NONE);
271}
272
273u_long W32_CALL inet_network (const char *name)
274{
275 u_long val, base;
276 u_long parts[4];
277 u_long *pp = parts;
278 int i, c, n;
279
280again:
281 /* Collect number up to ``.''. Values are specified as for C:
282 * 0x=hex, 0=octal, other=decimal.
283 */
284 val = 0;
285 base = 10;
286
287 /* The 4.4BSD version of this file also accepts 'x__' as a hexa
288 * number. I don't think this is correct. -- Uli
289 */
290 if (*name == '0')
291 {
292 if (*++name == 'x' || *name == 'X')
293 base = 16, name++;
294 else base = 8;
295 }
296 while ((c = *name) != '\0')
297 {
298 if (isdigit(c))
299 {
300 val = (val * base) + (c - '0');
301 name++;
302 continue;
303 }
304 if (base == 16 && isxdigit(c))
305 {
306 val = (val << 4) + (c + 10 - (islower(c) ? 'a' : 'A'));
307 name++;
308 continue;
309 }
310 break;
311 }
312 if (*name == '.')
313 {
314 if (pp >= parts + 4)
315 return (INADDR_NONE);
316
317 *pp++ = val;
318 name++;
319 goto again;
320 }
321 if (*name && !isspace((int)*name))
322 return (INADDR_NONE);
323
324 *pp++ = val;
325 n = (int) (pp - parts);
326 if (n > 4)
327 return (INADDR_NONE);
328
329 for (val = 0, i = 0; i < n; i++)
330 {
331 val <<= 8;
332 val |= parts[i] & 0xff;
333 }
334 return (val);
335}
336
341u_long W32_CALL inet_netof (struct in_addr addr)
342{
343 u_long a = ntohl (addr.s_addr);
344
345 if (IN_CLASSA(a))
346 return ((a & IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
347
348 if (IN_CLASSB(a))
349 return ((a & IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
350
351 return ((a & IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
352}
353
360u_long W32_CALL inet_lnaof (struct in_addr addr)
361{
362 u_long a = ntohl (addr.s_addr);
363
364 if (IN_CLASSA(a))
365 return (a & IN_CLASSA_HOST);
366
367 if (IN_CLASSB(a))
368 return (a & IN_CLASSB_HOST);
369
370 return (a & IN_CLASSC_HOST);
371}
372
377struct in_addr W32_CALL inet_makeaddr (u_long net, u_long host)
378{
379 u_long addr;
380
381 if (net < 128)
382 addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
383
384 else if (net < 65536)
385 addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
386
387 else if (net < 16777216L)
388 addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
389
390 else addr = (net | host);
391
392 addr = htonl (addr);
393 return (*(struct in_addr*) &addr);
394}
395
401const char *_inet6_ntoa (const void *ip)
402{
403 static char buf [4][50]; /* use max 4 at a time */
404 static int idx = 0;
405 char *rc = buf [idx++];
406
407 /* inet_ntop() should never return NULL.
408 */
409 idx &= 3;
410 rc = (char*) inet_ntop (AF_INET6, ip, rc, sizeof(buf[0]));
411 return (const char*) rc;
412}
413
419const ip6_address *_inet6_addr (const char *str)
420{
421 static ip6_address ip6;
422
423 if (!inet_pton(AF_INET6, str, &ip6))
424 return (NULL);
425 return (const ip6_address*) ip6;
426}
427
428/*
429 * Convert ASCII to network addresses.
430 */
431int W32_CALL ascii2addr (int af, const char *ascii, void *result)
432{
433 struct in_addr *ina;
434 char strbuf [4*sizeof("123")]; /* long enough for V4 only */
435
436 switch (af)
437 {
438 case AF_INET:
439 ina = (struct in_addr*) result;
440 strbuf[0] = '\0';
441 strncat (strbuf, ascii, sizeof(strbuf)-1);
442 if (inet_aton (strbuf, ina))
443 return sizeof (*ina);
444 SOCK_ERRNO (EINVAL);
445 break;
446
447 case AF_LINK:
448 link_addr (ascii, (struct sockaddr_dl*)result);
449 /* oops... no way to detect failure */
450 return sizeof (struct sockaddr_dl);
451
452#if defined(USE_IPV6)
453 case AF_INET6:
454 return inet_pton (AF_INET6, ascii, result);
455#endif
456
457 default:
458 SOCK_ERRNO (EPROTONOSUPPORT);
459 break;
460 }
461 return (-1);
462}
463
464/*-
465 * Convert a network address from binary to printable numeric format.
466 * This API is copied from INRIA's IPv6 implementation, but it is a
467 * bit bogus in two ways:
468 *
469 * 1) There is no value in passing both an address family and
470 * an address length; either one should imply the other,
471 * or we should be passing sockaddrs instead.
472 * 2) There should by contrast be /added/ a length for the buffer
473 * that we pass in, so that programmers are spared the need to
474 * manually calculate (read: ``guess'') the maximum length.
475 *
476 * Flash: the API is also the same in the NRL implementation, and seems to
477 * be some sort of standard, so we appear to be stuck with both the bad
478 * naming and the poor choice of arguments.
479 */
480char * W32_CALL addr2ascii (int af, const void *addrp, int len, char *buf)
481{
482 static char staticbuf [64]; /* 64 for AF_LINK > 16 for AF_INET */
483
484 if (!buf)
485 buf = staticbuf;
486
487 switch (af)
488 {
489 case AF_INET:
490 if (len != sizeof (struct in_addr))
491 {
492 SOCK_ERRNO (ENAMETOOLONG);
493 return (NULL);
494 }
495 strcpy (buf, inet_ntoa (*(const struct in_addr*) addrp));
496 break;
497
498 case AF_LINK:
499 if (len != sizeof (struct sockaddr_dl))
500 {
501 SOCK_ERRNO (ENAMETOOLONG);
502 return (NULL);
503 }
504 strcpy (buf, link_ntoa ((const struct sockaddr_dl*) addrp));
505 break;
506
507 default:
508 SOCK_ERRNO (EPROTONOSUPPORT);
509 return (NULL);
510 }
511 return (buf);
512}
513#endif /* USE_BSD_API */
514
515
516BOOL W32_CALL priv_addr (DWORD ip)
517{
528 if (ip >= aton("10.0.0.0") && ip <= aton("10.255.255.255"))
529 return (TRUE);
530
531 if (ip >= aton("172.16.0.0") && ip <= aton("172.31.255.255"))
532 return (TRUE);
533
534 if (ip >= aton("192.168.0.0") && ip <= aton("192.168.255.255"))
535 return (TRUE);
536
537 return (FALSE);
538}
539
540/*
541 * Lev Walkin <vlm@lionet.info> provided these handy mask-checking
542 * macros/routines.
543 *
544 * Masklen to mask convertor.
545 */
546#define MLEN2MASK(mlen) ((mlen) ? (((DWORD)-1) << (32 - (mlen))) : 0)
547
548/*
549 * Get the number of 0-bits of a mask.
550 * E.g. 255.255.255.0 -> 8
551 */
552int mask_len (DWORD mask)
553{
554 int len = 0;
555
556 mask = ~mask;
557 while (mask & 1)
558 {
559 len++;
560 mask >>= 1;
561 }
562 return (len);
563}
564
565#if defined(HAVE_POPCOUNT)
566 #if defined(__GNUC__)
567 /*
568 * gcc 4.4.1 (?) have the '__builtin_popcount' instruction.
569 */
570 #define POPCOUNT(x) __builtin_popcount (x)
571 #elif defined(_MSC_VER)
572 /*
573 * MSVC >= 1500 have the '_mm_popcnt_u32' inline instruction.
574 */
575 #define POPCOUNT(x) _mm_popcnt_u32 (x)
576 #else
577 #error "Help!!"
578 #endif
579#endif
580
581/*
582 * Determine number of bits set in an IPv4 mask.
583 */
584static DWORD bit_set (DWORD v)
585{
586 DWORD m;
587#if defined(HAVE_POPCOUNT)
588 static int have_popcnt = -1;
589
590 if (have_popcnt == -1)
591 have_popcnt = (x86_have_cpuid && (x86_capability & X86_CAPA_MMX));
592 if (have_popcnt)
593 return POPCOUNT (v);
594
595 /* Fall through */
596#endif
597
598 m = v;
599 m = (m & 0x55555555) + ((m & 0xAAAAAAAA) >> 1);
600 m = (m & 0x33333333) + ((m & 0xCCCCCCCC) >> 2);
601 m = (m & 0x0F0F0F0F) + ((m & 0xF0F0F0F0) >> 4);
602 m = (m & 0x00FF00FF) + ((m & 0xFF00FF00) >> 8);
603 m = (m & 0x0000FFFF) + ((m & 0xFFFF0000) >> 16);
604 return (m);
605}
606
607/*
608 * Check the mask for correctness.
609 */
610int check_mask (DWORD mask)
611{
612 DWORD v = bit_set (mask);
613 return (MLEN2MASK(v) == mask);
614}
615
616#if defined(USE_BSD_API)
617/*
618 * The string-based version of above function.
619 * Inside 'USE_BSD_API' since inet_aton() is needed.
620 */
621int check_mask2 (const char *mask)
622{
623 struct in_addr imask;
624
625 if (inet_aton(mask,&imask) != 1)
626 return (-1);
627 return check_mask (ntohl(imask.s_addr));
628}
629#endif /* USE_BSD_API */
630
631
cpumodel.h
misc.h
strltrim
char * strltrim(char *s)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250
atox
BYTE atox(const char *hex)
Convert hexstring "0x??" to hex.
Definition: misc_str.c:199
misc_str.h
inet_makeaddr
struct in_addr W32_CALL inet_makeaddr(u_long net, u_long host)
Formulate an Internet address from network + host (with subnet address).
Definition: netaddr.c:377
priv_addr
BOOL W32_CALL priv_addr(DWORD ip)
Definition: netaddr.c:516
_inet6_addr
const ip6_address * _inet6_addr(const char *str)
Convert a string 'str' into an IPv6-address.
Definition: netaddr.c:419
isaddr_dotless
BOOL W32_CALL isaddr_dotless(const char *str, DWORD *ip)
Check if 'str' is a dotless ip address.
Definition: netaddr.c:148
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
_inet_addr
DWORD W32_CALL _inet_addr(const char *s)
Convert a string into an IP-address.
Definition: netaddr.c:70
inet_netof
u_long W32_CALL inet_netof(struct in_addr addr)
Return the network number from an internet address; handles class A/B/C network #'s.
Definition: netaddr.c:341
aton_dotless
DWORD W32_CALL aton_dotless(const char *str)
Converts ‘[dotless]’ or ‘dotless’ to 32 bit long (host order)
Definition: netaddr.c:115
aton
DWORD W32_CALL aton(const char *str)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
Definition: netaddr.c:86
_inet_atoeth
const char * _inet_atoeth(const char *src, eth_address *p_eth)
Parse string "ether-addr, ip-addr".
Definition: netaddr.c:205
inet_lnaof
u_long W32_CALL inet_lnaof(struct in_addr addr)
Return the local network address portion of an internet address; handles class A/B/C network number f...
Definition: netaddr.c:360
isaddr
BOOL W32_CALL isaddr(const char *str)
Check if 'str' is simply an ip address.
Definition: netaddr.c:128
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
inet_pton
int W32_CALL inet_pton(int af, const char *src, void *dst)
Convert from presentation format (which usually means ASCII printable) to network format (which is us...
Definition: presaddr.c:73
inet_ntop
const char *W32_CALL inet_ntop(int af, const void *src, char *dst, size_t size)
Convert a network format address to presentation format.
Definition: presaddr.c:43
in_addr
Definition: in.h:143
sockaddr_dl
Definition: if_dl.h:71
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/netaddr.h Source File

  • src
netaddr.h
Go to the documentation of this file.
1
3#ifndef _w32_NETADDR_H
4#define _w32_NETADDR_H
5
6extern int mask_len (DWORD mask);
7extern int check_mask (DWORD mask);
8extern int check_mask2 (const char *mask);
9
10extern const char *_inet_atoeth (const char *src, eth_address *eth);
11
12extern const char *_inet6_ntoa (const void *ip);
13extern const ip6_address *_inet6_addr (const char *str);
14
15#endif
_inet6_addr
const ip6_address * _inet6_addr(const char *str)
Convert a string 'str' into an IPv6-address.
Definition: netaddr.c:419
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
_inet_atoeth
const char * _inet_atoeth(const char *src, eth_address *eth)
Parse string "ether-addr, ip-addr".
Definition: netaddr.c:205


Watt-32 tcp/ip: E:/WATT/src/netback.c Source File

  • src
netback.c
Go to the documentation of this file.
1
4#include <stdio.h>
5#include <stdlib.h>
6
7#include "wattcp.h"
8#include "language.h"
9#include "pctcp.h"
10#include "wdpmi.h"
11#include "misc.h"
12#include "misc_str.h"
13
14#define TIMER_INTR 8
15#define STK_SIZE 1024
16
17
18#if (DOSX)
19 void backgroundon (void)
20 {
21 outsnl (_LANG("Use wintr_init() / wintr_enable() instead"));
22 exit (3);
23 }
24
25#elif !defined(NO_INLINE_ASM) /* MSC <=6 unsupported */
26
27 static void (*user_routine)(void) = NULL;
28 static int inside = 0;
29
30 static W32_IntrHandler oldinterrupt;
31
32 static INTR_PROTOTYPE newinterrupt (void)
33 {
34 (*oldinterrupt)();
35 DISABLE();
36 if (inside)
37 {
38 static UINT tempstack [STK_SIZE];
39 #ifdef __WATCOMC__
40 STACK_SET (&tempstack[STK_SIZE-1]);
41 #else
42 static UINT old_SP;
43 static WORD old_SS;
44 asm mov ax, ss
45 asm mov old_SS, ax
46 asm mov ax, sp
47 asm mov old_SP, ax
48 asm mov ax, ds
49 asm mov ss, ax
50 asm lea sp, tempstack[STK_SIZE-1]
51
52 #endif
53 ENABLE();
54
55 if (user_routine)
56 (*user_routine)();
57 tcp_tick (NULL);
58
59 DISABLE();
60
61 #ifdef __WATCOMC__
62 STACK_RESTORE();
63 #else
64 asm mov ax, old_SS
65 asm mov ss, ax
66 asm mov ax, old_SP
67 asm mov sp, ax
68
69 #endif
70 inside = 0;
71 }
72 ENABLE();
73 }
74
75 void backgroundon (void)
76 {
77 oldinterrupt = getvect (TIMER_INTR);
78 setvect (TIMER_INTR, newinterrupt);
79 }
80
81 void backgroundoff (void)
82 {
83 setvect (TIMER_INTR, oldinterrupt);
84 }
85
86 void backgroundfn (void (*fn)(void))
87 {
88 user_routine = fn;
89 }
90#endif /* DOSX */
language.h
misc.h
misc_str.h
pctcp.h
wattcp.h
Core definitions.
wdpmi.h


Watt-32 tcp/ip: E:/WATT/inc/netdb.h Source File

  • inc
netdb.h
Go to the documentation of this file.
1
5/*-
6 * Copyright (c) 1980, 1983, 1988, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * -
38 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
39 *
40 * Permission to use, copy, modify, and distribute this software for any
41 * purpose with or without fee is hereby granted, provided that the above
42 * copyright notice and this permission notice appear in all copies, and that
43 * the name of Digital Equipment Corporation not be used in advertising or
44 * publicity pertaining to distribution of the document or software without
45 * specific, written prior permission.
46 *
47 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
48 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
50 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
51 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
52 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
53 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
54 * SOFTWARE.
55 * -
56 * --Copyright--
57 */
58
59#ifndef __NETDB_H
60#define __NETDB_H
61
62#ifndef _PATH_HEQUIV
63#define _PATH_HEQUIV "/etc/hosts.equiv"
64#endif
65
66#ifndef _PATH_HOSTS
67#define _PATH_HOSTS "/etc/hosts"
68#endif
69
70#ifndef _PATH_NETWORKS
71#define _PATH_NETWORKS "/etc/networks"
72#endif
73
74#ifndef _PATH_PROTOCOLS
75#define _PATH_PROTOCOLS "/etc/protocols"
76#endif
77
78#ifndef _PATH_SERVICES
79#define _PATH_SERVICES "/etc/services"
80#endif
81
82#ifndef __SYS_W32API_H
83#include <sys/w32api.h>
84#endif
85
86#ifndef __SYS_SOCKET_H
87#include <sys/socket.h> /* struct sockaddr */
88#endif
89
90#ifndef __SYS_CDEFS_H
91#include <sys/cdefs.h>
92#endif
93
94#ifndef __SYS_CDEFS_H
95#include <sys/w32api.h>
96#endif
97
98
99/*
100 * Structures returned by network data base library. All addresses are
101 * supplied in host order, and returned in network order (suitable for
102 * use in system calls).
103 */
104struct hostent {
105 char *h_name; /* official name of host */
106 char **h_aliases; /* alias list */
107 int h_addrtype; /* host address type */
108 int h_length; /* length of address */
109 char **h_addr_list; /* list of addresses from name server */
110#define h_addr h_addr_list[0] /* address, for backward compatiblity */
111};
112
113/*
114 * Assumption here is that a network number
115 * fits in 32 bits -- probably a poor one.
116 */
117struct netent {
118 char *n_name; /* official name of net */
119 char **n_aliases; /* alias list */
120 int n_addrtype; /* net address type */
121 unsigned long n_net; /* network # */
122 };
123
124struct servent {
125 char *s_name; /* official service name */
126 char **s_aliases; /* alias list */
127 int s_port; /* port # */
128 char *s_proto; /* protocol to use */
129 };
130
131struct protoent {
132 char *p_name; /* official protocol name */
133 char **p_aliases; /* alias list */
134 int p_proto; /* protocol # */
135 };
136
137struct addrinfo {
138 int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
139 int ai_family; /* PF_xxx */
140 int ai_socktype; /* SOCK_xxx */
141 int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
142 int ai_addrlen; /* length of ai_addr */
143 char *ai_canonname; /* canonical name for hostname */
144 struct sockaddr *ai_addr; /* binary address */
145 struct addrinfo *ai_next; /* next structure in linked list */
146 };
147
148/*
149 * Error return codes from gethostbyname() and gethostbyaddr()
150 * (left in extern int h_errno).
151 */
152W32_DATA int h_errno;
153
154#define NETDB_INTERNAL -1 /* see errno */
155#define NETDB_SUCCESS 0 /* no problem */
156#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
157#define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */
158#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
159#define NO_DATA 4 /* Valid name, no data record of requested type */
160#define NO_ADDRESS NO_DATA /* no address, look for MX record */
161
162
163/*
164 * Error return codes from getaddrinfo()
165 */
166#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */
167#define EAI_AGAIN 2 /* temporary failure in name resolution */
168#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
169#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
170#define EAI_FAMILY 5 /* ai_family not supported */
171#define EAI_MEMORY 6 /* memory allocation failure */
172#define EAI_NODATA 7 /* no address associated with hostname */
173#define EAI_NONAME 8 /* hostname nor servname provided, or not known */
174#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
175#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
176#define EAI_SYSTEM 11 /* system error returned in errno */
177#define EAI_BADHINTS 12
178#define EAI_PROTOCOL 13
179#define EAI_MAX 14
180
181/*
182 * Flag values for getaddrinfo()
183 */
184#define AI_PASSIVE 0x00000001 /* get address to use bind() */
185#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
186#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */
187#define AI_NUMERICSERV 0x00000008 /* has no effect */
188#define AI_IDN 0x00000010 /* convert ti IDN form as needed */
189
190/* valid flags for addrinfo
191 */
192#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_IDN)
193
194#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
195#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */
196#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */
197#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */
198
199/* special recommended flags for getipnodebyname
200 */
201#define AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG)
202
203/*
204 * Constants for getnameinfo()
205 */
206#define NI_MAXHOST 1025
207#define NI_MAXSERV 32
208
209/*
210 * Flag values for getnameinfo()
211 */
212#define NI_NOFQDN 0x00000001
213#define NI_NUMERICHOST 0x00000002
214#define NI_NAMEREQD 0x00000004
215#define NI_NUMERICSERV 0x00000008
216#define NI_DGRAM 0x00000010
217#define NI_WITHSCOPEID 0x00000020
218
219/*
220 * Scope delimit character
221 */
222#define SCOPE_DELIMITER '%'
223
224__BEGIN_DECLS
225
226W32_FUNC void W32_CALL endhostent (void);
227W32_FUNC void W32_CALL endhostent6 (void);
228W32_FUNC void W32_CALL endnetent (void);
229W32_FUNC void W32_CALL endprotoent (void);
230W32_FUNC void W32_CALL endservent (void);
231W32_FUNC struct hostent * W32_CALL gethostbyaddr (const char *, socklen_t, int);
232W32_FUNC struct hostent * W32_CALL gethostbyaddr6 (const void *);
233W32_FUNC struct hostent * W32_CALL gethostbyname (const char *name);
234W32_FUNC struct hostent * W32_CALL gethostbyname2 (const char *name, int af);
235W32_FUNC struct hostent * W32_CALL gethostbyname6 (const char *name);
236W32_FUNC struct hostent * W32_CALL gethostent (void);
237W32_FUNC struct hostent * W32_CALL gethostent6 (void);
238W32_FUNC struct hostent * W32_CALL getipnodebyaddr(const void *, size_t, int, int *);
239W32_FUNC struct hostent * W32_CALL getipnodebyname(const char *, int, int, int *);
240W32_FUNC struct netent * W32_CALL getnetbyaddr (long, int);
241W32_FUNC struct netent * W32_CALL getnetbyname (const char *);
242W32_FUNC struct netent * W32_CALL getnetent (void);
243W32_FUNC struct protoent * W32_CALL getprotobyname (const char *);
244W32_FUNC struct protoent * W32_CALL getprotobynumber (int);
245W32_FUNC struct protoent * W32_CALL getprotoent (void);
246W32_FUNC struct servent * W32_CALL getservbyname (const char *, const char *);
247W32_FUNC struct servent * W32_CALL getservbyport (int, const char *);
248W32_FUNC struct servent * W32_CALL getservent (void);
249W32_FUNC void W32_CALL herror (const char *);
250W32_FUNC const char * W32_CALL hstrerror (int);
251W32_FUNC void W32_CALL sethostent (int stayopen);
252W32_FUNC void W32_CALL sethostent6 (int stayopen);
253W32_FUNC void W32_CALL setnetent (int);
254W32_FUNC void W32_CALL setprotoent (int);
255W32_FUNC void W32_CALL setservent (int);
256
257W32_FUNC int W32_CALL getnameinfo (const struct sockaddr *sa, socklen_t salen,
258 char *host, socklen_t hostlen,
259 char *serv, socklen_t servlen, int flags);
260
261W32_FUNC int W32_CALL getaddrinfo (const char *hostname, const char *servname,
262 const struct addrinfo *hints,
263 struct addrinfo **res);
264
265W32_FUNC void W32_CALL freeaddrinfo (struct addrinfo *ai);
266W32_FUNC void W32_CALL freehostent (struct hostent *);
267W32_FUNC char * W32_CALL gai_strerror (int ecode);
268
269W32_FUNC int W32_CALL if_nametoindex (const char *);
270W32_FUNC char * W32_CALL if_indextoname (int, char *);
271
272W32_FUNC int * W32_CALL __h_errno_location (void);
273
274/*
275 * The implementation of these reentrant 'getXbyY_r()' functions is not
276 * finished (ref. ./src/get_xbyr.c). And since MinGW-w64 has '_REENTRANT'
277 * as a built-in, we do not provide any prototypes for these yet.
278 */
279#if defined(_REENTRANT) && !defined(__MINGW64_VERSION_MAJOR)
280 W32_FUNC int W32_CALL gethostbyaddr_r (
281 const void *addr, socklen_t len, int type,
282 struct hostent *ret, char *buf, size_t buflen,
283 struct hostent **result, int *h_errnop);
284
285 W32_FUNC int W32_CALL gethostbyname_r (
286 const char *name,
287 struct hostent *ret, char *buf, size_t buflen,
288 struct hostent **result, int *h_errnop);
289
290 W32_FUNC int W32_CALL gethostent_r (
291 struct hostent *ret, char *buf, size_t buflen,
292 struct hostent **result, int *h_errnop);
293
294 W32_FUNC int W32_CALL getnetbyaddr_r (
295 u_int32_t net, int type, struct netent *result_buf, char *buf,
296 size_t buflen, struct netent **result, int *h_errnop);
297
298 W32_FUNC int W32_CALL getnetbyname_r (
299 const char *name, struct netent *result_buf, char *buf,
300 size_t buflen, struct netent **result, int *h_errnop);
301
302 W32_FUNC int W32_CALL getnetent_r (
303 struct netent *result_buf, char *buf,
304 size_t buflen, struct netent **result, int *h_errnop);
305
306 W32_FUNC int W32_CALL getprotobyname_r (
307 const char *name, struct protoent *result_buf, char *buf,
308 size_t buflen, struct protoent **result);
309
310 W32_FUNC int W32_CALL getprotobynumber_r (
311 int proto, struct protoent *result_buf, char *buf,
312 size_t buflen, struct protoent **result);
313
314 W32_FUNC int W32_CALL getprotoent_r (
315 struct protoent *result_buf, char *buf,
316 size_t buflen, struct protoent **result);
317
318 W32_FUNC int W32_CALL getservbyname_r (
319 const char *name, const char *proto,
320 struct servent *result_buf, char *buf,
321 size_t buflen, struct servent **result);
322
323 W32_FUNC int W32_CALL getservbyport_r (
324 int port, const char *proto,
325 struct servent *result_buf, char *buf,
326 size_t buflen, struct servent **result);
327
328 W32_FUNC int W32_CALL getservent_r (
329 struct servent *result_buf, char *buf,
330 size_t buflen, struct servent **result);
331
332 W32_FUNC int W32_CALL sethostent_r (
333 int stay_open, struct hostent *buffer);
334
335 W32_FUNC int W32_CALL endhostent_r (
336 struct hostent *buffer);
337
338 W32_FUNC int W32_CALL setprotoent_r (
339 int stay_open, struct protoent *buffer);
340
341 W32_FUNC int W32_CALL endprotoent_r (struct protoent *buffer);
342
343#endif /* _REENTRANT && !__MINGW64_VERSION_MAJOR */
344
345__END_DECLS
346
347#endif
cdefs.h
socket.h
gethostent
W32_FUNC struct hostent *W32_CALL gethostent(void)
Return the next (non-commented) line from the host-file.
Definition: gethost.c:219
hostname
char hostname[MAX_HOSTLEN+1]
Our configured hostname.
Definition: pctcp.c:58
addrinfo
Definition: netdb.h:137
hostent
Definition: netdb.h:104
netent
Definition: netdb.h:117
protoent
Definition: netdb.h:131
servent
Definition: netdb.h:124
sockaddr
Definition: socket.h:181
w32api.h


Watt-32 tcp/ip: E:/WATT/src/neterr.c Source File

  • src
neterr.c
Go to the documentation of this file.
1
38#include "socket.h"
39
40#if !defined(W32_NEW_ERRNO)
41
42/* These should be present in respective './build/x/syserr.c' files.
43 */
44#if 0
45 char __syserr00[] = "No Error";
46 char __syserr000[] = "No Error";
47#endif
48
49#if defined(__WATCOMC__) && (__WATCOMC__ > 1290)
50 /* data-modifier; near/far depending on model */
51 #define DATA_MOD _WCDATA
52#else
53 #define DATA_MOD
54#endif
55
56#if defined(__TURBOC__) && (__TURBOC__ <= 0x410) /* TCC/BCC <= 3.1 */
57 #define SYS_ERRLIST sys_errlist
58 #define SYS_NERR sys_nerr
59
60 #include "build/borland/syserr.c" /* @NO_DEP */
61
62#elif defined(__BORLANDC__)
63 #define SYS_ERRLIST _sys_errlist
64 #define SYS_NERR _sys_nerr
65
66 #include "build/borland/syserr.c" /* @NO_DEP */
67
68#elif defined(__HIGHC__)
69 #define SYS_ERRLIST _sys_errlist
70 #define SYS_NERR _sys_nerr
71
72 #include "build/highc/syserr.c" /* @NO_DEP */
73
74#elif defined(__POCC__)
75 #define SYS_ERRLIST sys_errlist
76 #define SYS_NERR EILSEQ
77
78 #include "build/pellesc/syserr.c" /* @NO_DEP */
79
80#elif defined(__WATCOMC__)
81 #if defined(WIN32)
82 #define SYS_ERRLIST _w32_sys_errlist
83 #define SYS_NERR _w32_sys_nerr
84 #else
85 #define SYS_ERRLIST DATA_MOD _sys_errlist
86 #define SYS_NERR _sys_nerr
87 #endif
88
89 #include "build/watcom/syserr.c" /* @NO_DEP */
90
91#elif defined(__DMC__)
92 #if defined(WIN32)
93 #define SYS_ERRLIST _w32_sys_errlist
94 #define SYS_NERR _w32_sys_nerr
95 #else
96 #define SYS_ERRLIST sys_errlist
97 #define SYS_NERR sys_nerr
98 #endif
99
100 char __syserr37[] = "No Error"; /* !!fixme: isn't generated by dm_err.exe */
101
102 #include "build/digmars/syserr.c" /* @NO_DEP */
103
104#elif defined(__clang__)
105 #define SYS_ERRLIST _w32_sys_errlist
106 #define SYS_NERR _w32_sys_nerr
107
108 #include "build/clang/syserr.c" /* @NO_DEP */
109
110 #undef SYS_ERRLIST
111 #define SYS_ERRLIST sys_errlist
112
113#elif defined(_MSC_VER) && (_MSC_VER <= 800)
114 #error "Quick-C is no longer supported"
115
116#elif defined(_MSC_VER) /* Visual C, assuming Win32 */
117 #define SYS_ERRLIST _w32_sys_errlist
118 #define SYS_NERR _w32_sys_nerr
119
120 #include "build/visualc/syserr.c" /* @NO_DEP */
121
122 #undef SYS_ERRLIST
123 #define SYS_ERRLIST sys_errlist
124
125#elif defined(__DJGPP__)
126 #define SYS_ERRLIST sys_errlist
127 #define SYS_NERR sys_nerr
128
129 #include "build/djgpp/syserr.c" /* @NO_DEP */
130
131#elif defined(__ORANGEC__)
132 #define SYS_ERRLIST sys_errlist
133 #define SYS_NERR sys_nerr
134
135 #include "build/orangec/syserr.c" /* @NO_DEP */
136
137#elif defined(__CYGWIN__)
138 #define SYS_ERRLIST _sys_errlist
139 #define SYS_NERR _sys_nerr
140
141#elif defined(__MINGW64__) || defined(__MINGW64_VERSION_MAJOR)
142 #define SYS_ERRLIST _w32_sys_errlist
143 #define SYS_NERR _w32_sys_nerr
144
145 #include "build/MinGW64/syserr.c" /* @NO_DEP */
146
147#elif defined(__MINGW32__)
148 #define SYS_ERRLIST _w32_sys_errlist
149 #define SYS_NERR _w32_sys_nerr
150
151 #include "build/MinGW32/syserr.c" /* @NO_DEP */
152
153#else
154 #error Unknown target!
155#endif
156
157/*
158 * A hack for Watcom.
159 */
160#if defined(__WATCOMC__) && !defined(WIN32)
161 #define SYS_ERRLIST2 _sys_errlist
162#else
163 #define SYS_ERRLIST2 SYS_ERRLIST
164#endif
165
166/*
167 * A hack to make the linker use this sys_errlist[]
168 * and not the normal one in the C-library.
169 * Is there a better way?
170 */
171int pull_neterr_module = 0;
172
173#if defined(__CYGWIN__)
174 /* Nothing to do here */
175
176#elif defined(__POCC__)
177 int _w32_sys_nerr = 120; /* pocc bug */
178
179#elif defined(WIN32) && !defined(__BORLANDC__)
180 #if defined(_MSC_VER) || defined(__WATCOMC__)
181 int _w32_sys_nerr = DIM(_w32_sys_errlist);
182 #else
183 int DATA_MOD SYS_NERR = DIM(SYS_ERRLIST2);
184 #endif
185
186 int *_sys_nerr_dll = &_w32_sys_nerr;
187 int *_imp___sys_nerr = &_w32_sys_nerr;
188#endif
189
190#if !defined(_MSC_VER) && defined(__MSDOS__)
191void MS_CDECL perror (const char *str)
192{
193 if (str && *str)
194 fprintf (stderr, "%s: ", str);
195
196#if defined(__GNUC__) /* Posix (?) dictates a newline */
197 fprintf (stderr, "%s\n", strerror(errno));
198#else
199 fprintf (stderr, "%s", strerror(errno));
200#endif
201}
202
207char * MS_CDECL strerror (int errnum)
208{
209 static char buf[70];
210
211 if (errnum >= 0 && errnum < SYS_NERR)
212 _strlcpy (buf, SYS_ERRLIST2[errnum], sizeof(buf));
213 else sprintf (buf, "Unknown error: %d", errnum);
214
215#if !defined(__GNUC__)
216 /*
217 * Posix doesn't specify a newline at the end.
218 */
219 strcat (buf, "\n");
220#endif
221
222 return (buf);
223}
224#endif /* !_MSC_VER && __MSDOS__ */
225
226/*
227 * For non-Win32 errno == _w32_errno for all network calls
228 */
229#if defined(WIN32)
230/*
231 * Winsock compatibility.
232 */
233int __stdcall WSAGetLastError (void)
234{
235 int err = _w32_errno;
236 _w32_errno = 0;
237 return (err);
238}
239
240void __stdcall WSASetLastError (int err)
241{
242#if defined(__POCC__)
243 #if defined(_DLL) || defined(_MT)
244 *__errno() = err;
245 #else
246 errno = err;
247 #endif
248
249#elif defined(_MSC_VER) || defined(__DMC__)
250 #if defined(_DLL) || defined(_MT)
251 *_errno() = err;
252 #else
253 errno = err;
254 #endif
255
256#elif defined(__ORANGEC__)
257 #if defined(_DLL) || defined(_MT)
258 *__errno() = err;
259 #else
260 errno = err;
261 #endif
262
263#elif defined(__MINGW32__) || defined(__MINGW64__)
264 *_errno() = err;
265
266#elif defined(__CYGWIN__)
267 *__errno() = err;
268
269#elif defined(__BORLANDC__)
270 int * _RTLENTRY _EXPFUNC __errno (void);
271 *__errno() = err;
272
273#elif defined(__WATCOMC__)
274 *__get_errno_ptr() = err;
275 errno = err;
276
277#else
278 #error Help me!
279#endif
280
281 _w32_errno = err;
282}
283#endif /* WIN32 */
284#endif /* W32_NEW_ERRNO */
285
286
287#if defined(USE_DEBUG)
288/*
289 * Return only the Exx part of strerror()
290 */
291const char *short_strerror (int errnum)
292{
293 static char buf[256];
294 char *l_par, *r_par;
295
296 _strlcpy (buf, strerror(errnum), sizeof(buf));
297 l_par = strchr (buf, '(');
298 if (!l_par)
299 {
300 sprintf (buf, "errno %d", errnum);
301 return (buf);
302 }
303
304 r_par = strchr (l_par, ')');
305 if (r_par)
306 *r_par = '\0';
307 return (l_par+1);
308}
309#endif
310
311/*
312 * Incase you have trouble with multiple defined symbols,
313 * make sure the following functions are used before
314 * perror/strerror/sys_errlist in your C-library.
315 */
316void W32_CALL perror_s (const char *str)
317{
318 perror (str);
319}
320
321char * W32_CALL strerror_s_ (int errnum)
322{
323 return strerror (errnum);
324}
325
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
strerror
char *MS_CDECL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207


Watt-32 tcp/ip: E:/WATT/inc/netinet/if_ether.h Source File

  • inc
  • netinet
if_ether.h
Go to the documentation of this file.
1
5/* Modified for emx by hv 1994
6 *
7 * Copyright (c) 1982, 1986 Regents of the University of California.
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 */
38
39#ifndef __NETINET_IF_ETHER_H
40#define __NETINET_IF_ETHER_H
41
42#ifndef __SYS_MBUF_H
43#include <sys/mbuf.h>
44#endif
45
46#ifndef __NET_IF_H
47#include <net/if.h>
48#endif
49
50#ifndef __NET_IF_ARP_H
51#include <net/if_arp.h>
52#endif
53
54#include <sys/wtypes.h>
55
56W32_CLANG_PACK_WARN_OFF()
57
58#include <sys/pack_on.h>
59
60/*
61 * Ethernet address - 6 octets
62 * this is only used by the ethers(3) functions.
63 */
64struct ether_addr {
65 u_char ether_addr_octet[6];
66 };
67
68/*
69 * Structure of a 10Mb/s Ethernet header.
70 */
71struct ether_header {
72 u_char ether_dhost[6];
73 u_char ether_shost[6];
74 u_short ether_type;
75 };
76
77#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
78/* the IBM header corrects the following to 0x608 for OS/2 but I believe
79 * this is just a dirty hack
80 */
81#define ETHERTYPE_ARP 0x0806 /* address resolution protocol */
82#define ETHERTYPE_IP 0x0800 /* IP protocol */
83#define ETHERTYPE_REVARP 0x8035 /* reverse addr resolution protocol */
84
85/*
86 * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
87 * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
88 * by an ETHER type (as given above) and then the (variable-length) header.
89 */
90#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
91#define ETHERTYPE_NTRAILER 16
92
93#define ETHERMTU 1500
94#define ETHERMIN (60-14)
95
96/*
97 * Macro to map an IP multicast address to an Ethernet multicast address.
98 * The high-order 25 bits of the Ethernet address are statically assigned,
99 * and the low-order 23 bits are taken from the low end of the IP address.
100 */
101#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
102 /* struct in_addr *ipaddr; */ \
103 /* u_char enaddr[6]; */ \
104 { \
105 (enaddr)[0] = 0x01; \
106 (enaddr)[1] = 0x00; \
107 (enaddr)[2] = 0x5e; \
108 (enaddr)[3] = ((u_char *)ipaddr)[1] & 0x7f; \
109 (enaddr)[4] = ((u_char *)ipaddr)[2]; \
110 (enaddr)[5] = ((u_char *)ipaddr)[3]; \
111 }
112
113/*
114 * Ethernet Address Resolution Protocol.
115 *
116 * See RFC 826 for protocol description. Structure below is adapted
117 * to resolving internet addresses. Field names used correspond to
118 * RFC 826.
119 */
120struct ether_arp {
121 struct arphdr ea_hdr; /* fixed-size header */
122 u_char arp_sha[6]; /* sender hardware address */
123 u_char arp_spa[4]; /* sender protocol address */
124 u_char arp_tha[6]; /* target hardware address */
125 u_char arp_tpa[4]; /* target protocol address */
126 };
127#define arp_hrd ea_hdr.ar_hrd
128#define arp_pro ea_hdr.ar_pro
129#define arp_hln ea_hdr.ar_hln
130#define arp_pln ea_hdr.ar_pln
131#define arp_op ea_hdr.ar_op
132
133
134/*
135 * Structure shared between the ethernet driver modules and
136 * the address resolution code. For example, each ec_softc or il_softc
137 * begins with this structure.
138 */
139struct arpcom {
140 struct ifnet ac_if; /* network-visible interface */
141 u_char ac_enaddr[6]; /* ethernet hardware address */
142 struct in_addr ac_ipaddr; /* copy of ip address- XXX */
143 struct ether_multi *ac_multiaddrs; /* list of ether multicast addrs */
144 int ac_multicnt; /* length of ac_multiaddrs list */
145};
146
147/*
148 * Internet to ethernet address resolution table.
149 */
150
151struct arptab {
152 struct in_addr at_iaddr; /* internet address */
153 u_char at_enaddr[6]; /* ethernet address */
154 u_char at_timer; /* minutes since last reference */
155 u_char at_flags; /* flags */
156 struct mbuf *at_hold; /* last packet until resolved/timeout */
157/* only os2 */
158 u_short at_rcf;
159 u_short at_rseg[8];
160 u_long at_millisec;
161 int at_interface;
162};
163
164
165extern u_char etherbroadcastaddr[6];
166extern u_char ether_ipmulticast_min[6];
167extern u_char ether_ipmulticast_max[6];
168
169/*
170 * Ethernet multicast address structure. There is one of these for each
171 * multicast address or range of multicast addresses that we are supposed
172 * to listen to on a particular interface. They are kept in a linked list,
173 * rooted in the interface's arpcom structure. (This really has nothing to
174 * do with ARP, or with the Internet address family, but this appears to be
175 * the minimally-disrupting place to put it.)
176 */
177struct ether_multi {
178 u_char enm_addrlo[6]; /* low or only address of range */
179 u_char enm_addrhi[6]; /* high or only address of range */
180 struct arpcom *enm_ac; /* back pointer to arpcom */
181 u_int enm_refcount; /* no. claims to this addr/range */
182 struct ether_multi *enm_next; /* ptr to next ether_multi */
183 };
184
185/*
186 * Structure used by macros below to remember position when stepping through
187 * all of the ether_multi records.
188 */
189struct ether_multistep {
190 struct ether_multi *e_enm;
191 };
192
193#include <sys/pack_off.h>
194
195W32_CLANG_PACK_WARN_DEF()
196
197/*
198 * Macro for looking up the ether_multi record for a given range of Ethernet
199 * multicast addresses connected to a given arpcom structure. If no matching
200 * record is found, "enm" returns NULL.
201 */
202#define ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm) \
203 /* u_char addrlo[6]; */ \
204 /* u_char addrhi[6]; */ \
205 /* struct arpcom *ac; */ \
206 /* struct ether_multi *enm; */ \
207{ \
208 for ((enm) = (ac)->ac_multiaddrs; \
209 (enm) != NULL && \
210 (bcmp((enm)->enm_addrlo, (addrlo), 6) != 0 || \
211 bcmp((enm)->enm_addrhi, (addrhi), 6) != 0); \
212 (enm) = (enm)->enm_next); \
213}
214
215/*
216 * Macro to step through all of the ether_multi records, one at a time.
217 * The current position is remembered in "step", which the caller must
218 * provide. ETHER_FIRST_MULTI(), below, must be called to initialize "step"
219 * and get the first record. Both macros return a NULL "enm" when there
220 * are no remaining records.
221 */
222#define ETHER_NEXT_MULTI(step, enm) \
223 /* struct ether_multistep step; */ \
224 /* struct ether_multi *enm; */ \
225{ \
226 if (((enm) = (step).e_enm) != NULL) \
227 (step).e_enm = (enm)->enm_next; \
228}
229
230#define ETHER_FIRST_MULTI(step, ac, enm) \
231 /* struct ether_multistep step; */ \
232 /* struct arpcom *ac; */ \
233 /* struct ether_multi *enm; */ \
234{ \
235 (step).e_enm = (ac)->ac_multiaddrs; \
236 ETHER_NEXT_MULTI((step), (enm)); \
237}
238
239#endif
if.h
if_arp.h
pack_off.h
arpcom
Definition: if_ether.h:139
arptab
Definition: if_ether.h:151
ether_arp
Definition: if_ether.h:120
ether_header
Definition: if_ether.h:71
ether_multi
Definition: if_ether.h:177
ether_multistep
Definition: if_ether.h:189
ifnet
Definition: if.h:136
in_addr
Definition: in.h:143
mbuf
Definition: mbuf.h:6
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/netinet/if_fddi.h Source File

  • inc
  • netinet
if_fddi.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 * Copyright (c) 1995 Matt Thomas (thomas@lkg.dec.com)
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 */
39
40#ifndef __NETINET_IF_FDDI_H
41#define __NETINET_IF_FDDI_H
42
43#include <sys/cdefs.h>
44#include <sys/wtypes.h>
45
46W32_CLANG_PACK_WARN_OFF()
47
48#include <sys/pack_on.h>
49
50/*
51 * Structure of an 100Mb/s FDDI header.
52 */
53struct fddi_header {
54 u_char fddi_fc;
55 u_char fddi_dhost[6];
56 u_char fddi_shost[6];
57};
58
59#include <sys/pack_off.h>
60
61W32_CLANG_PACK_WARN_DEF()
62
63#define FDDIIPMTU 4352
64#define FDDIMTU 4470
65#define FDDIMIN 3
66
67#define FDDIFC_C 0x80 /* 0b10000000 */
68#define FDDIFC_L 0x40 /* 0b01000000 */
69#define FDDIFC_F 0x30 /* 0b00110000 */
70#define FDDIFC_Z 0x0F /* 0b00001111 */
71
72#define FDDIFC_LLC_ASYNC 0x50
73#define FDDIFC_LLC_PRIO0 0
74#define FDDIFC_LLC_PRIO1 1
75#define FDDIFC_LLC_PRIO2 2
76#define FDDIFC_LLC_PRIO3 3
77#define FDDIFC_LLC_PRIO4 4
78#define FDDIFC_LLC_PRIO5 5
79#define FDDIFC_LLC_PRIO6 6
80#define FDDIFC_LLC_PRIO7 7
81#define FDDIFC_LLC_SYNC 0xd0
82#define FDDIFC_SMT 0x40
83
84#endif
cdefs.h
pack_off.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp.h Source File

  • inc
  • netinet
tcp.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_TCP_H
39#define __NETINET_TCP_H
40
41#include <sys/cdefs.h>
42#include <sys/wtypes.h>
43
44typedef u_long tcp_seq;
45typedef u_long tcp_cc; /* connection count per rfc1644 */
46
47W32_CLANG_PACK_WARN_OFF()
48
49#include <sys/pack_on.h>
50
51/*
52 * TCP header.
53 * Per RFC 793, September, 1981.
54 */
55struct tcphdr {
56 u_short th_sport; /* source port */
57 u_short th_dport; /* destination port */
58 tcp_seq th_seq; /* sequence number */
59 tcp_seq th_ack; /* acknowledgement number */
60 u_char th_x2:4; /* (unused) */
61 u_char th_off:4; /* data offset */
62 u_char th_flags;
63#define TH_FIN 0x01
64#define TH_SYN 0x02
65#define TH_RST 0x04
66#define TH_PUSH 0x08
67#define TH_ACK 0x10
68#define TH_URG 0x20
69#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG)
70
71 u_short th_win; /* window */
72 u_short th_sum; /* checksum */
73 u_short th_urp; /* urgent pointer */
74};
75
76#include <sys/pack_off.h>
77
78W32_CLANG_PACK_WARN_DEF()
79
80#define TCPOPT_EOL 0
81#define TCPOPT_NOP 1
82#define TCPOPT_MAXSEG 2
83#define TCPOLEN_MAXSEG 4
84#define TCPOPT_WINDOW 3
85#define TCPOLEN_WINDOW 3
86#define TCPOPT_SACK_PERMITTED 4
87#define TCPOLEN_SACK_PERMITTED 2
88#define TCPOPT_SACK 5
89#define TCPOPT_TIMESTAMP 8
90#define TCPOLEN_TIMESTAMP 10
91#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
92
93#define TCPOPT_TSTAMP_HDR \
94 (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
95
96#define TCPOPT_CC 11 /* CC options: RFC-1644 */
97#define TCPOPT_CCNEW 12
98#define TCPOPT_CCECHO 13
99#define TCPOLEN_CC 6
100#define TCPOLEN_CC_APPA (TCPOLEN_CC+2)
101#define TCPOPT_CC_HDR(ccopt) \
102 (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC)
103
104#define TCPOPT_SIGNATURE 19
105#define TCP_SIGLEN 16
106
107/*
108 * Default maximum segment size for TCP.
109 * With an IP MSS of 576, this is 536,
110 * but 512 is probably more convenient.
111 * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
112 */
113#define TCP_MSS 512
114
115#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
116#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */
117
118#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
119
120#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
121#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
122 /* max space left for options */
123
124/*
125 * User-settable options (used with setsockopt).
126 */
127#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
128#define TCP_MAXSEG 0x02 /* set maximum segment size */
129#ifdef TCP_AUTO
130#define TCP_AUTO_OP 0x03 /* 0 to disable autotuning, 1 to reenable */
131#endif
132#define TCP_NOPUSH 0x04 /* don't push last block of write */
133#define TCP_NOOPT 0x08 /* don't use TCP options */
134
135/* For PSC modifications */
136#if defined(TCP_AUTO) || defined(TCP_SACK) || defined(TCP_FACK)
137#define PSC_VERSION "0.8"
138#endif
139
140#endif
cdefs.h
pack_off.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/net/netisr.h Source File

  • inc
  • net
netisr.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1980, 1986, 1989, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NET_NETISR_H
39#define __NET_NETISR_H
40
41/*
42 * The networking code runs off software interrupts.
43 *
44 * You can switch into the network by doing splsoftnet() and return by splx().
45 * The software interrupt level for the network is higher than the software
46 * level for the clock (so you can enter the network in routines called
47 * at timeout time).
48 *
49 * The routine to request a network software interrupt, setsoftnet(),
50 * is defined in the machine-specific include files.
51 */
52
53/*
54 * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
55 * word which is used to de-multiplex a single software
56 * interrupt used for scheduling the network code to calls
57 * on the lowest level routine of each protocol.
58 */
59#define NETISR_IP 2 /* same as AF_INET */
60#define NETISR_IMP 3 /* same as AF_IMPLINK */
61#define NETISR_NS 6 /* same as AF_NS */
62#define NETISR_ISO 7 /* same as AF_ISO */
63#define NETISR_CCITT 10 /* same as AF_CCITT */
64#define NETISR_ATALK 16 /* same as AF_APPLETALK */
65#define NETISR_ARP 18 /* same as AF_LINK */
66#define NETISR_ISDN 26 /* same as AF_E164 */
67#define NETISR_NATM 27 /* same as AF_NATM */
68#define NETISR_PPP 28 /* for PPP processing */
69
70#define schednetisr(anisr) { netisr |= 1<<(anisr); setsoftnet(); }
71
72extern int netisr; /* scheduling bits for network */
73
74#endif


Watt-32 tcp/ip: E:/WATT/src/nettime.c Source File

  • src
nettime.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 *
34 * 14.may 1999 (GV) - Created
35 *
36 * This module implements time counters for "user" and "system"
37 * calls. NOTE: "system" time is counted only when signals are
38 * trapped. i.e. around select_s(), connect() loops.
39 *
40 * Based on djgpp version of times().
41 *
42 */
43
44#include "socket.h"
45
46#if defined(USE_BSD_API)
47
48static DWORD sock_sys_time;
49static DWORD start;
50
51void _sock_start_timer (void)
52{
53 start = set_timeout (0);
54}
55
56void _sock_stop_timer (void)
57{
58 DWORD now = set_timeout (0);
59
60 if (now > start)
61 sock_sys_time += (now - start);
62 else sock_sys_time += (start - now); /* msec/tick counter wrapped */
63}
64
65static DWORD sys_time (void)
66{
67 return (sock_sys_time);
68}
69
70static DWORD usr_time (void)
71{
72 return (set_timeout(0) - start_time - sock_sys_time);
73}
74
75unsigned long W32_CALL net_times (struct tms *tms)
76{
77 if (!tms)
78 {
79 SOCK_ERRNO (EINVAL);
80 return (unsigned long)(-1);
81 }
82 memset (tms, 0, sizeof(*tms));
83 if (_watt_is_init)
84 {
85#ifdef WIN32
86 DWORD divisor = 1000;
87#else
88 DWORD divisor = (has_8254 || has_rdtsc) ? 1000 : 18;
89#endif
90
91 tms->tms_utime = (CLOCKS_PER_SEC * usr_time()) / divisor;
92 tms->tms_stime = (CLOCKS_PER_SEC * sys_time()) / divisor;
93 }
94 return (tms->tms_utime);
95}
96#endif /* USE_BSD_API */
97
_watt_is_init
BOOL _watt_is_init
watt_sock_init() done (but with possible failed boot)
Definition: sock_ini.c:158
tms
Definition: wtime.h:61
has_8254
BOOL has_8254
Do we have a working 8254 timer chip?
Definition: timer.c:58
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
has_rdtsc
BOOL has_rdtsc
Never set in Watt-32.
Definition: timer.c:54
start_time
DWORD start_time
Start-time of watt_sock_init() (in msec)
Definition: timer.c:46


Watt-32 tcp/ip: E:/WATT/src/nochkstk.h Source File

  • src
nochkstk.h
Go to the documentation of this file.
1
5#if defined(__HIGHC__) || defined(__WATCOMC__)
6 #pragma Off (check_stack)
7
8#elif defined(__POCC__) && !defined(WIN32)
9 #pragma check_stack (off)
10
11#elif defined(_MSC_VER) && (_MSC_VER >= 800) && !defined(WIN32)
12 #pragma check_stack (off)
13
14#elif defined(__DMC__)
15 /* #pragma .. */
16
17#elif (defined(__TURBOC__) || defined(__BORLANDC__)) && !defined(WIN32)
18 #pragma option -N-
19#endif


Watt-32 tcp/ip: E:/WATT/src/nsapaddr.c Source File

  • src
nsapaddr.c
Go to the documentation of this file.
1
5/* Copyright (c) 1996 by Internet Software Consortium.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
12 * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
13 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
14 * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
16 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
17 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
18 * SOFTWARE.
19 */
20
21#include "socket.h"
22
23#if defined(USE_BSD_API) || defined(USE_BIND)
24
25static __inline char xtob (int c)
26{
27 return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
28}
29
30u_int W32_CALL inet_nsap_addr (const char *ascii, u_char *binary, int maxlen)
31{
32 u_char c, nib;
33 int len = 0;
34
35 while ((c = *ascii++) != '\0' && len < maxlen)
36 {
37 if (c == '.' || c == '+' || c == '/')
38 continue;
39
40 c = toupper (c);
41 if (!isxdigit(c))
42 return (0);
43
44 nib = xtob (c);
45 if ((c = *ascii++) == '\0')
46 return (0);
47
48 c = toupper (c);
49 if (!isxdigit(c))
50 return (0);
51
52 *binary++ = (nib << 4) | xtob(c);
53 len++;
54 }
55 return (u_int)len;
56}
57
58char * W32_CALL inet_nsap_ntoa (int binlen, const u_char *binary, char *ascii)
59{
60 static char tmpbuf[255*3+1];
61 char *start;
62 int i;
63
64 if (ascii)
65 start = ascii;
66 else
67 {
68 ascii = tmpbuf;
69 start = tmpbuf;
70 }
71
72 if (binlen > 255)
73 binlen = 255;
74
75 for (i = 0; i < binlen; i++)
76 {
77 int nib = *binary >> 4;
78
79 *ascii++ = nib + (nib < 10 ? '0' : '7');
80 nib = *binary++ & 0x0f;
81 *ascii++ = nib + (nib < 10 ? '0' : '7');
82 if (((i % 2) == 0 && (i + 1) < binlen))
83 *ascii++ = '.';
84 }
85 *ascii = '\0';
86 return (start);
87}
88
89#endif


Watt-32 tcp/ip: E:/WATT/src/oldstuff.c Source File

  • src
oldstuff.c
Go to the documentation of this file.
1
6#include <stdio.h>
7#include <stdlib.h>
8#include <time.h>
9
10#include "copyrigh.h"
11#include "wattcp.h"
12#include "pctcp.h"
13#include "netaddr.h"
14#include "chksum.h"
15#include "misc.h"
16#include "misc_str.h"
17#include "timer.h"
18#include "pcdns.h"
19
20#undef tcp_cbrk
21#undef inchksum
22
27int tcp_cbrk (int mode)
28{
29 return tcp_cbreak (mode);
30}
31
36unsigned long set_ttimeout (unsigned ticks)
37{
38#ifdef WIN32
39 DWORD now = set_timeout (0);
40 return (ticks + now);
41#else
42 int tmp = has_8254;
43 DWORD now;
44
45 has_8254 = 0;
46 now = set_timeout (0);
47 has_8254 = tmp;
48 return (ticks + now);
49#endif
50}
51
52/*
53 * Not needed in Watt-32. Print remote tcp address and port.
54 */
55void W32_CALL psocket (const sock_type *s)
56{
57 char buf[20];
58
59 (*_outch) ('[');
60 outs (_inet_ntoa(buf, s->tcp.hisaddr));
61 (*_outch) (':');
62 itoa (s->tcp.hisport, buf, 10);
63 outs (buf);
64 (*_outch) (']');
65}
66
71void W32_CALL sock_sturdy (sock_type *s, int level)
72{
73 s->tcp.rigid = level;
74 if (s->tcp.rigid < s->tcp.stress)
75 sock_abort (s);
76}
77
81int W32_CALL resolve_ip (DWORD ip, char *name, int len)
82{
83 return reverse_resolve_ip4 (ip, name, len);
84}
85
86#undef time
87
88/*
89 * Some time/date conversion function only (?) found in Borland libs.
90 * Only(?) djgpp/DMC besides Borland have "struct time" etc.
91 */
92#if defined(__DJGPP__) || defined(__DMC__)
93W32_FUNC time_t W32_CALL dostounix (const struct date *d, const struct time *t)
94{
95 struct tm tm;
96
97 if (!d || !t)
98 return (0);
99
100 tm.tm_year = d->da_year - 1900;
101 tm.tm_mon = d->da_mon - 1;
102 tm.tm_mday = d->da_day;
103 tm.tm_isdst = 0;
104 tm.tm_hour = t->ti_hour;
105 tm.tm_min = t->ti_min;
106 tm.tm_sec = t->ti_sec;
107 return mktime (&tm);
108}
109
110W32_FUNC void W32_CALL unixtodos (time_t time, struct date *d, struct time *t)
111{
112 struct tm *tm = localtime (&time);
113
114 if (d && tm)
115 {
116 d->da_year = tm->tm_year;
117 d->da_mon = tm->tm_mon;
118 d->da_day = tm->tm_mday;
119 }
120 if (t && tm)
121 {
122 t->ti_hour = tm->tm_hour;
123 t->ti_min = tm->tm_min;
124 t->ti_sec = tm->tm_sec;
125 t->ti_hund = 0;
126 }
127}
128#endif
129
130WORD inchksum (const void *ptr, int len)
131{
132#ifdef HAVE_IN_CHECKSUM_FAST
133 return _w32_in_checksum_fast (ptr, len);
134#else
135 return _w32_in_checksum (ptr, len);
136#endif
137}
138
139WORD _w32_inchksum (const void *ptr, int len)
140{
141#ifdef HAVE_IN_CHECKSUM_FAST
142 return _w32_in_checksum_fast (ptr, len);
143#else
144 return _w32_in_checksum (ptr, len);
145#endif
146}
147
148#if !defined(WATT32_NO_INLINE_INTEL)
149/*
150 * If linking old .o-files with new watt*.lib.
151 * Or user didn't include <sys/swap.h> (via tcp.h).
152 */
153#undef intel
154#undef intel16
155#undef htons
156#undef htonl
157#undef ntohs
158#undef ntohl
159
160 W32_GCC_PRAGMA (GCC diagnostic push)
161 W32_GCC_PRAGMA (GCC diagnostic ignored "-Wmissing-prototypes")
162
163DWORD intel (DWORD val)
164{
165#ifdef W32_GCC_USING_BSWAP
166 return __builtin_bswap32 (val);
167#else
168 return __NtoHL (val);
169#endif
170}
171
172WORD intel16 (WORD val)
173{
174#ifdef W32_GCC_USING_BSWAP
175 return __builtin_bswap16 (val);
176#else
177 return __NtoHS (val);
178#endif
179}
180#endif /* WATT32_NO_INLINE_INTEL */
181
182#if defined(TEST_PROG)
183
184#if defined(__WATCOMC__)
185 #error "Not for Watcom"
186#elif !defined(__MSDOS__)
187 #error For MSDOS only
188#endif
189
190int main (void)
191{
192 struct date d;
193 struct time t;
194 time_t now = time (NULL);
195
196 getdate (&d);
197 gettime (&t);
198
199 printf ("time now is: %s", ctime(&now));
200 now = dostounix (&d, &t);
201 printf ("dostounix(): %s", ctime(&now));
202 printf ("unixtodos(): %02d/%02d/%04d %02d:%02d:%02d\n",
203 d.da_day, d.da_mon, d.da_year,
204 t.ti_hour, t.ti_min, t.ti_sec);
205 return (0);
206}
207#endif
208
chksum.h
copyrigh.h
misc.h
misc_str.h
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
resolve_ip
int W32_CALL resolve_ip(DWORD ip, char *name, int len)
Resolve an IP-address to a name.
Definition: oldstuff.c:81
set_ttimeout
unsigned long set_ttimeout(unsigned ticks)
Definition: oldstuff.c:36
W32_GCC_PRAGMA
W32_GCC_PRAGMA(GCC diagnostic push) W32_GCC_PRAGMA(GCC diagnostic ignored "-Wmissing-prototypes") DWORD intel(DWORD val)
Language prefix.
Definition: oldstuff.c:160
tcp_cbrk
int tcp_cbrk(int mode)
Some deprecated functions.
Definition: oldstuff.c:27
sock_sturdy
void W32_CALL sock_sturdy(sock_type *s, int level)
Keep the socket open inspite of receiving "ICMP Unreachable" For UDP or TCP socket.
Definition: oldstuff.c:71
tcp_cbreak
int W32_CALL tcp_cbreak(int mode)
Sets our break mode.
Definition: pc_cbrk.c:208
pcdns.h
pctcp.h
has_8254
BOOL has_8254
Do we have a working 8254 timer chip?
Definition: timer.c:58
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
timer.h
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/inc/sys/pack_off.h Source File

  • inc
  • sys
pack_off.h
Go to the documentation of this file.
1
6/*++
7
8Copyright (c) 1990,91 Microsoft Corporation
9
10Module Name:
11
12 pack_off.h
13
14Abstract:
15
16 This file turns packing of structures off. (That is, it enables
17 automatic alignment of structure fields.) An include file is needed
18 because various compilers do this in different ways.
19
20 pack_off.h is the complement to pack_on.h. An inclusion of pack_off.h
21 MUST ALWAYS be preceded by an inclusion of pack_on.h, in one-to-one
22 correspondence.
23
24Author:
25
26 Chuck Lenzmeier (chuckl) 4-Mar-1990
27
28Revision History:
29
30 15-Apr-1991 JohnRo
31 Created lint-able variant.
32
33 20-Oct-1997 G.Vanem
34 Added Metaware support
35
36 05-Jul-1999 G.Vanem
37 Added LADsoft support
38
39 01-Nov-2000 G. Vanem
40 Added Visual C/C++ support
41
42--*/
43
44#if !(defined(lint) || defined(_lint))
45 #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
46 #pragma option push -b -a8 -pc -A- /*P_O_Push*/
47 #endif
48
49 #if defined(_MSC_VER) && (_MSC_VER >= 800)
50 #pragma warning(disable:4103)
51 #endif
52
53 #if defined(__HIGHC__)
54 #pragma pop_align_members();
55 #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1000)
56 #pragma pack(__pop);
57 #elif (defined(_MSC_VER) && (_MSC_VER > 800)) || \
58 (defined(__GNUC__) && ((__GNUC__ > 2) || \
59 (__GNUC__ == 2 && __GNUC_MINOR__ > 95))) || \
60 (defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)) || \
61 defined(__POCC__)
62 #pragma pack(pop)
63 #else
64 #pragma pack()
65 #endif
66
67 #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
68 #pragma option pop /*P_O_Pop*/
69 #endif
70#endif
71


Watt-32 tcp/ip: E:/WATT/inc/sys/pack_on.h Source File

  • inc
  • sys
pack_on.h
Go to the documentation of this file.
1
6/*++
7
8Copyright (c) 1990,91 Microsoft Corporation
9
10Module Name:
11
12 pack_on.h
13
14Abstract:
15
16 This file turns packing of structures on. (That is, it disables
17 automatic alignment of structure fields.) An include file is needed
18 because various compilers do this in different ways.
19
20 The file pack_off.h is the complement to this file.
21
22Author:
23
24 Chuck Lenzmeier (chuckl) 4-Mar-1990
25
26Revision History:
27
28 15-Apr-1991 JohnRo
29 Created lint-able variant.
30
31 20-Oct-1997 G.Vanem
32 Added Metaware support
33
34 05-Jul-1999 G.Vanem
35 Added LADsoft support
36
37 01-Nov-2000 G. Vanem
38 Added Visual C/C++ support
39
40--*/
41
42#if !(defined(lint) || defined(_lint))
43 #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
44 #pragma option push -b -a8 -pc -A- /*P_O_Push*/
45 #endif
46
47 #if defined(_MSC_VER) && (_MSC_VER >= 800)
48 #pragma warning(disable:4103)
49 #endif
50
51 #if defined(__HIGHC__)
52 #pragma push_align_members(1);
53 #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1000)
54 #pragma pack(__push,1);
55 #elif (defined(_MSC_VER) && (_MSC_VER > 800)) || \
56 (defined(__GNUC__) && ((__GNUC__ > 2) || \
57 (__GNUC__ == 2 && __GNUC_MINOR__ > 95))) || \
58 (defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)) || \
59 defined(__POCC__)
60 #pragma pack(push,1)
61 #else
62 #pragma pack(1)
63 #endif
64
65 #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
66 #pragma option pop /*P_O_Pop*/
67 #endif
68#endif
69


Watt-32 tcp/ip: Related Pages

Related Pages
Here is a list of all related documentation pages:
Todo List
Deprecated List


Watt-32 tcp/ip: E:/WATT/inc/sys/param.h Source File

  • inc
  • sys
param.h
Go to the documentation of this file.
1
6/* sys/param.h (wattcp) */
7
8#ifndef __SYS_PARAM_H
9#define __SYS_PARAM_H
10
11#ifndef PAGE_SIZE
12#define PAGE_SIZE 0x1000
13#endif
14
15#ifndef HZ
16#define HZ 100
17#endif
18
19#ifndef MAXNAMLEN
20#define MAXNAMLEN 260
21#endif
22
23#ifndef MAXPATHLEN
24#define MAXPATHLEN 260
25#endif
26
27#ifndef MAXHOSTNAMELEN
28#define MAXHOSTNAMELEN 256
29#endif
30
31#ifndef __SYS_SWAP_BYTES_H
32#include <sys/swap.h>
33#endif
34
35#endif
swap.h


Watt-32 tcp/ip: E:/WATT/src/pc_cbrk.c Source File

  • src
pc_cbrk.c
Go to the documentation of this file.
1
5#include <stdio.h>
6#include <stdlib.h>
7#include <setjmp.h>
8#include <signal.h>
9
10#include "copyrigh.h"
11#include "wattcp.h"
12#include "sock_ini.h"
13#include "wdpmi.h"
14#include "x32vm.h"
15#include "misc.h"
16#include "misc_str.h"
17#include "printk.h"
18#include "bsddbug.h"
19#include "language.h"
20
21#if defined(__DJGPP__)
22#include <sys/exceptn.h>
23#endif
24
25#if defined(__HIGHC__)
26 extern UINT _mwstack_limit[2]; /* stack-check limits */
27 pragma Alias (_mwstack_limit, "_mwstack_limit");
28 #undef SIGBREAK /* SIGBREAK == SIGQUIT */
29
30#elif defined(__DMC__) /* ditto */
31 #undef SIGBREAK
32#endif
33
34#if defined(TEST_PROG) && !defined(__CYGWIN__) && \
35 !(defined(__MINGW32__) || defined(__x86_64__)) /* MinGW64 has no cputs()! */
36 #include <conio.h>
37 #undef outsnl
38 #define outsnl(str) cputs (str)
39#endif
40
45#include "nochkstk.h"
46
47WORD _watt_handle_cbreak = 0;
48volatile int _watt_cbroke = 0;
50static int cbreak_mode;
51static jmp_buf sig_jmp;
52
74void MS_CDECL sig_handler_watt (int sig)
75{
76#if defined(TEST_PROG)
77 BEEP();
78
79 #if defined(__CYGWIN__) && 0
80 _watt_cbroke++;
81 longjmp (sig_jmp, sig);
82 #endif
83#endif
84
85 if (_watt_handle_cbreak) /* inside _arp_resolve(), lookup_domain() etc. */
86 {
87 _watt_cbroke++;
88 if (cbreak_mode & 0x10)
89 outsnl (_LANG("\nInterrupting"));
90 }
91 else if (cbreak_mode & 1)
92 {
93 outsnl (_LANG("\nBreaks ignored"));
94 }
95 else
96 {
97#if defined(WIN32)
98 _watt_cbroke++;
99#else
100#if defined(__HIGHC__)
101 static UINT new_stk [1024];
102 _mwstack_limit[1] = (UINT)&new_stk; /* set new Bottom-Of-Stack */
103#elif defined(__DJGPP__)
104 signal (sig, SIG_IGN); /* ignore until we quit */
105#endif
106 _watt_cbroke++;
107 longjmp (sig_jmp, sig); /* jump back to where setjmp() was called */
108#endif /* WIN32 */
109 }
110
111 signal (sig, sig_handler_watt); /* rearm our handler */
112
113#if !defined(WIN32)
114 /* !! Seems the BREAK state of NTVDM gets reenabled when pressing ^C.
115 * So disable the state again (not reentrant)
116 */
117 if (sig == SIGINT && (cbreak_mode & 1))
118 set_cbreak (0);
119#endif
120}
121
130int set_cbreak (int want_brk)
131{
132#if defined(WIN32)
133 ARGSUSED (want_brk);
134 return (0);
135#else
136 IREGS reg;
137 WORD brk;
138
139#if 0
140 /*
141 * After much testing (ref .\tests\pc_cbrk.exe), I found the following
142 * to be most reliable for both DOS and Windows-NT. Using any combination
143 * of `cbreak_mode' and pressing ^C seems to work in Win-NT, but ^Break still
144 * have problems...
145 */
146 __djgpp_set_ctrl_c (want_brk & 1);
147
148 /* don't count ^Breaks; the 0x1B vector isn't always restored
149 * at program exit
150 */
151 _go32_want_ctrl_break (want_brk & 1);
152#endif
153
154 reg.r_ax = 0x3300; /* get normal BREAK state */
155 GEN_INTERRUPT (0x21, &reg);
156 brk = loBYTE (reg.r_dx);
157
158#if 0
159 if (want_brk & 0x0100)
160 {
161 reg.r_ax = 0x3302;
162 GEN_INTERRUPT (0x21, &reg);
163 brk |= loBYTE(reg.r_dx) << 8;
164 }
165#endif
166
167 if (want_brk == 0)
168 {
169 reg.r_ax = 0x3301; /* set normal BREAK state off */
170 reg.r_dx = 0;
171 GEN_INTERRUPT (0x21, &reg);
172 reg.r_ax = 0x3302; /* set extended BREAK state off */
173 reg.r_dx = 0;
174 GEN_INTERRUPT (0x21, &reg);
175 }
176 else /* set normal/extended BREAK state on */
177 {
178 reg.r_ax = (want_brk >= 0x0100) ? 0x3302 : 0x3301;
179 reg.r_dx = 1;
180 GEN_INTERRUPT (0x21, &reg);
181 }
182 return (brk);
183#endif /* WIN32 */
184}
185
186#if defined(WIN32) && 0
187/*
188 * Ref. http://msdn.microsoft.com/en-us/library/ms683242(v=vs.85).aspx
189 */
190static BOOL WINAPI console_handler (DWORD event)
191{
192 if (event == CTRL_C_EVENT || event == CTRL_BREAK_EVENT)
193 {
194 sig_handler_watt (SIGINT);
195 return (TRUE);
196 }
197 return (FALSE);
198}
199#endif /* WIN32 */
200
201
208int W32_CALL tcp_cbreak (int mode)
209{
210 volatile int rc = 0;
211
212 signal (SIGINT, sig_handler_watt);
213
214#if defined(SIGBREAK)
215 signal (SIGBREAK, sig_handler_watt);
216#endif
217
218#if defined(__CYGWIN__) && 0
219 {
220 static sigset_t old_mask, new_mask;
221
222 sigemptyset (&new_mask);
223 sigaddset (&new_mask, SIGINT);
224 sigprocmask (SIG_SETMASK, &new_mask, &old_mask);
225 }
226#endif
227
228#if defined(__DJGPP__)
229 if (win32_dos_box)
230 rc = set_cbreak (0); /* ignore DOS BREAK checking */
231 else
232#endif
233 rc = set_cbreak (!(mode & 1));
234
235 cbreak_mode = mode;
236
237 {
238 int sig;
239
240 /* Some vendors calls signal-handlers with a very limited stack.
241 * We longjmp() out of it to restore to a safe stack.
242 */
243 sig = setjmp (sig_jmp);
244 if (sig)
245 sock_sig_exit ("\nTerminating.", sig);
246 }
247 return (rc);
248}
249
250/*
251 * Return TRUE if ^C/^Break should be disabled
252 */
253BOOL tcp_cbreak_off (void)
254{
255 return (cbreak_mode & 1);
256}
257
258#if defined(TEST_PROG)
259
260void usage (const char *argv0)
261{
262 printf ("Usage: %s normal | nobrk | graceful\n", argv0);
263 exit (-1);
264}
265
266int old_brk = -1;
267
268int main (int argc, char **argv)
269{
270 int mode = 0, show_brk = 1;
271
272 if (argc != 2)
273 usage (argv[0]);
274
275 if (!stricmp(argv[1],"normal"))
276 {
277 mode = 0x10;
278 _watt_handle_cbreak = 0;
279 }
280 else if (!stricmp(argv[1],"nobrk"))
281 {
282 mode = 0x01;
283 _watt_handle_cbreak = 1;
284 puts ("Press <^BREAK> three times to exit");
285 }
286 else if (!stricmp(argv[1],"graceful"))
287 {
288 mode = 0x00;
289 _watt_handle_cbreak = 1;
290 puts ("Press <^C> or <^BREAK> three times to exit");
291 }
292 else
293 usage (argv[0]);
294
295 if (show_brk)
296 mode |= 0x10;
297
298 old_brk = tcp_cbreak (mode);
299 _watt_cbroke = 0;
300
301 while (_watt_cbroke < 3)
302 {
303 usleep (200000);
304
305#ifdef __MSDOS__
306 /* PEEKB on djgpp changes the FS register. This is just to
307 * test if SIGINT handler restores FS/GS registers.
308 */
309 (void) PEEKB (0, 0);
310#endif
311
312#ifdef __CYGWIN__
313 // os_yield(); /* Hard to raise SIGINT on Cygwin w/o this. */
314#endif
315
316 kbhit();
317 putchar ('.');
318 fflush (stdout);
319 }
320 printf ("`_watt_cbroke' set %d times\n", _watt_cbroke);
321 set_cbreak (old_brk);
322 return (1);
323}
324#endif /* TEST_PROG */
bsddbug.h
copyrigh.h
language.h
win32_dos_box
BOOL win32_dos_box
Definition: misc.c:71
misc.h
misc_str.h
nochkstk.h
tcp_cbreak
int W32_CALL tcp_cbreak(int mode)
Sets our break mode.
Definition: pc_cbrk.c:208
_watt_handle_cbreak
WORD _watt_handle_cbreak
Turn off stack-checking here because stack may be out of bounds.
Definition: pc_cbrk.c:47
set_cbreak
int set_cbreak(int want_brk)
Sets normal and extended BREAK mode.
Definition: pc_cbrk.c:130
_watt_cbroke
volatile int _watt_cbroke
Definition: pc_cbrk.c:48
sig_handler_watt
void MS_CDECL sig_handler_watt(int sig)
SIGINT/SIGBREAK handler function.
Definition: pc_cbrk.c:74
printk.h
sock_sig_exit
void W32_CALL sock_sig_exit(const char *msg, int sig)
Exit handler for unhandled signals.
Definition: sock_ini.c:1076
sock_ini.h
IREGS
Definition: misc.h:610
wattcp.h
Core definitions.
wdpmi.h
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/pcarp.c Source File

  • src
pcarp.c
Go to the documentation of this file.
1
11#include <stdio.h>
12#include <stdlib.h>
13#include <string.h>
14
15#include "copyrigh.h"
16#include "wattcp.h"
17#include "language.h"
18#include "netaddr.h"
19#include "misc.h"
20#include "misc_str.h"
21#include "run.h"
22#include "timer.h"
23#include "ip4_in.h"
24#include "ip4_out.h"
25#include "sock_ini.h"
26#include "chksum.h"
27#include "pcdbug.h"
28#include "pctcp.h"
29#include "pcsed.h"
30#include "pcconfig.h"
31#include "pcqueue.h"
32#include "pcstat.h"
33#include "pcicmp.h"
34#include "pcdhcp.h"
35#include "pcpkt.h"
36#include "pcarp.h"
37
38#define DO_SORT_GATEWAYS 1
39
40#if defined(USE_DEBUG)
41 #define TRACE(args) do { \
42 if (arp_trace_level > 0) { \
43 if (arp_trace_level > 1) \
44 (*_printf) ("%s (%u): ", __FILE__,__LINE__); \
45 (*_printf) (" "); \
46 (*_printf) args; \
47 } \
48 } while (0)
49
50 static const char *get_ARP_flags (WORD flg);
51 static const char *get_route_flags (WORD flg);
52#else
53 #define TRACE(args) ((void)0)
54#endif
55
56#define INET_NTOA(ip) _inet_ntoa (NULL, ip)
57
61#define ON_SAME_NETWORK(addr1, addr2, mask) ((addr1 & mask) == (addr2 & mask))
62
63
64/* Local parameters.
65 */
66static int arp_trace_level = 0; /* trace level for this code (>1 include file/line) */
67static int arp_timeout = 2; /* 2 seconds ARP timeout */
68static int arp_alive = 300; /* 5 min ARP cache lifespan */
69static int arp_rexmit_to = 250; /* 250 milliseconds per try */
70static BOOL dead_gw_detect = FALSE; /* Enable Dead Gateway detection */
71static BOOL arp_gratiotous = FALSE;
72
73static BOOL LAN_lookup (DWORD ip, eth_address *eth);
74static BOOL is_on_LAN (DWORD ip);
75
76static BOOL arp_check_common (DWORD ip, eth_address *eth);
77static void W32_CALL arp_daemon (void);
78
82#define DEAD_GW_TIMEOUT 10000 /* 10 sec */
83#define GATE_TOP_OF_CACHE 8
84
85static int gate_top = 0; /* index into gate_list */
86
87static struct gate_entry gate_list [GATE_TOP_OF_CACHE];
88
94int W32_CALL _arp_gateways_get (const struct gate_entry **rc)
95{
96 *rc = gate_list;
97 return (gate_top);
98}
99
100#if defined(USE_DEAD_GWD)
105static WORD icmp_id = 0;
106static WORD icmp_seq = 0;
107
108static int ping_gateway (DWORD host, void *eth)
109{
110 struct ping_pkt *pkt;
111 struct ICMP_echo *icmp;
112 struct in_Header *ip;
113 int len;
114
115 pkt = (struct ping_pkt*) _eth_formatpacket (eth, IP4_TYPE);
116 ip = &pkt->in;
117 icmp = &pkt->icmp;
118 len = sizeof (*icmp);
119 icmp_id = (WORD) set_timeout (0); /* "random" id */
120
121 TRACE (("ping_gateway (%s)\n", INET_NTOA(host)));
122
123 icmp->type = ICMP_ECHO;
124 icmp->code = 0;
125 icmp->index = 1;
126 icmp->identifier = icmp_id;
127 icmp->sequence = icmp_seq++;
128 icmp->checksum = 0;
129 icmp->checksum = ~CHECKSUM (icmp, len);
130
131 return IP4_OUTPUT (ip, 0, intel(host), ICMP_PROTO, 1,
132 (BYTE)_default_tos, 0, len, NULL);
133}
134
135/*
136 * This function is called once each second.
137 */
138static void check_dead_gw (void)
139{
140 static int i = 0;
141
142 if (i >= gate_top)
143 i = 0;
144
145 for ( ; i < gate_top; i++)
146 {
147 struct gate_entry *gw = gate_list + i;
148 eth_address eth;
149
150 TRACE (("check_dead_gw (1), i %d\n", i));
151
152 if (!is_on_LAN(gw->gate_ip))
153 continue;
154
155 if (!LAN_lookup(gw->gate_ip,&eth))
156 {
157 TRACE (("check_dead_gw (2), IP %s\n", INET_NTOA(gw->gate_ip)));
158 continue;
159 }
160
161 if (gw->chk_timer == 0UL || !chk_timeout(gw->chk_timer))
162 {
163 gw->chk_timer = set_timeout (DEAD_GW_TIMEOUT);
164 continue;
165 }
166
167 if (gw->echo_pending &&
168 _chk_ping(gw->gate_ip,NULL) == (DWORD)-1)
169 {
170 TRACE (("check_dead_gw (3), i %d\n", i));
171
172 gw->is_dead = TRUE;
173 gw->echo_pending = FALSE;
174 TRACE (("Dead default GW %s (%d) detected\n",
175 INET_NTOA(gw->gate_ip), i));
176 }
177
178 if (ping_gateway(gw->gate_ip, eth))
179 gw->echo_pending = TRUE;
180
181 gw->chk_timer = set_timeout (DEAD_GW_TIMEOUT);
182 return; /* only one ping per interval */
183 }
184}
185#endif /* USE_DEAD_GWD */
186
187/*
188 * Check if a mask is legal for specified address.
189 */
190static BOOL legal_mask (DWORD mask, DWORD addr)
191{
192#if 1
193 ARGSUSED (addr);
194 return check_mask (mask);
195#else
196 if (addr & ~mask) /* E.g. '10.0.0.5' AND '0.0.0.255' */
197 return (FALSE);
198 mask = intel (~mask);
199 if (mask & (mask+1))
200 return (FALSE);
201 return (TRUE);
202#endif
203}
204
205#if DO_SORT_GATEWAYS
217static int MS_CDECL compare (const struct gate_entry *a,
218 const struct gate_entry *b)
219{
220 return (int)(a->mask - b->mask);
221}
222#endif
223
247BOOL W32_CALL _arp_add_gateway (const char *config_string, DWORD ip)
248{
249 struct gate_entry *gw;
250 DWORD subnet = 0UL;
251 DWORD mask = 0UL;
252 int i;
253
254 if (config_string)
255 {
256 const char *subnetp, *maskp;
257
258 /* Get gateway IP address from string
259 */
260 ip = aton (config_string);
261 if (ip == 0)
262 return (FALSE); /* invalid */
263
264 /* Check if optional subnet was supplied
265 */
266 subnetp = strchr (config_string, ',');
267 if (subnetp)
268 {
269 /* NB: atoi (used in aton) stops conversion when the first non-number
270 * is hit, so there is no need to manually null-terminate the string.
271 * i.e. aton ("123.123.123.123,blabla") = 123.123.123.123
272 */
273 subnet = aton (++subnetp);
274
275 /* Check if optional mask was supplied
276 */
277 maskp = strchr (subnetp, ',');
278 if (maskp)
279 {
280 mask = aton (++maskp);
281 }
282 else /* No mask was supplied, we derive it from the supplied subnet */
283 {
284 switch (subnet >> 30)
285 {
286 case 0:
287 case 1:
288 mask = CLASS_A_ADDR;
289 break;
290 case 2:
291 mask = CLASS_B_ADDR;
292 break;
293 case 3:
294 default:
295 mask = CLASS_C_ADDR;
296 break;
297 }
298 }
299 }
300 }
301 else /* (config_string == NULL) */
302 {
303 if (ip == 0UL)
304 {
305 outsnl ("_arp_add_gateway(): Illegal router");
306 return (FALSE); /* args invalid */
307 }
308 }
309
310 TRACE (("_arp_add_gateway (%s)\n"
311 " ip: %s, mask: %s, subnet: %s\n",
312 config_string ? config_string : "<none>",
313 INET_NTOA(ip), INET_NTOA(mask), INET_NTOA(subnet)));
314
315 if (!legal_mask(mask,subnet))
316 {
317 outs ("Illegal mask "); outs (INET_NTOA(mask));
318 outs (" for subnet "); outsnl (INET_NTOA(subnet));
319 return (FALSE);
320 }
321
322 /* Figure out where to put our new gateway
323 */
324 gw = NULL;
325
326 /* Check if gateway is already is in list
327 */
328 for (i = 0; i < gate_top; i++)
329 if (gate_list[i].gate_ip == ip)
330 {
331 gw = gate_list + i;
332 break;
333 }
334
335 /* If a 'new' gateway, we check if we have enough room and simply
336 * add it to the end of the list.
337 *
338 * There is not much point in sorting the list, as the 'whole' list is
339 * scanned when a gateway is needed. Usually there will only be 1 anyway.
340 * If we do sort, we would use plain old insert-sort and NOT quicksort,
341 * as quicksort goes O(n^2) on an already sorted list, plus it has a high
342 * overhead that especially hurts on a tiny list like this.
343 */
344 if (gw == NULL)
345 {
346 if (gate_top == DIM(gate_list)-1)
347 {
348 outsnl (_LANG("Gateway table full"));
349 return (FALSE); /* no more room */
350 }
351 gw = gate_list + gate_top;
352 gate_top++;
353 }
354
355 /* Fill in new (or reused) entry
356 */
357 memset (gw, 0, sizeof(*gw));
358 gw->gate_ip = ip;
359 gw->mask = mask;
360 gw->subnet = subnet;
361
362#if DO_SORT_GATEWAYS
363 qsort ((void*)&gate_list, gate_top, sizeof(gate_list[0]),
364 (CmpFunc)compare);
365#endif
366
367 return (TRUE);
368}
369
373void W32_CALL _arp_kill_gateways (void)
374{
375 TRACE (("gate_top=%d, _arp_kill_gateways(), gate_top=0\n", gate_top));
376 gate_top = 0;
377}
378
382BOOL W32_CALL _arp_have_default_gw (void)
383{
384 int i, num = 0;
385
386 for (i = 0; i < gate_top; i++)
387 if (gate_list[i].subnet == 0UL)
388 num++;
389 TRACE (("_arp_have_default_gw(), num: %d\n", num));
390 return (num > 0);
391}
392
393
437#define ARP_TOP_OF_CACHE 64
440#define ARP_TOP_PENDING ARP_TOP_OF_CACHE
441#define ARP_TOP_FREE arp_first_pending
442#define ARP_TOP_DYNAMIC arp_first_free
443#define ARP_TOP_FIXED arp_first_dynamic
444#define ARP_FIRST_FIXED 0
445
446static int arp_first_pending = ARP_TOP_PENDING;
447static int arp_first_free = 0;
448static int arp_first_dynamic = 0;
449
450static struct arp_entry arp_list [ARP_TOP_OF_CACHE];
451
455static BOOL arp_send (const arp_Header *arp, unsigned line)
456{
457 TRACE (("_arp_send()\n"));
458 ARGSUSED (arp);
459 return _eth_send (sizeof(*arp), NULL, __FILE__, line);
460}
461
462
466static BOOL arp_send_request (DWORD ip)
467{
468 arp_Header *arp = (arp_Header*) _eth_formatpacket (&_eth_brdcast[0], ARP_TYPE);
469
470 TRACE (("_arp_send_request (%s)\n", INET_NTOA(ip)));
471
472 arp->hwType = intel16 (_eth_get_hwtype(NULL,NULL));
473 arp->protType = IP4_TYPE;
474 arp->hwAddrLen = sizeof (eth_address);
475 arp->protoAddrLen = sizeof (ip);
476 arp->opcode = ARP_REQUEST;
477 arp->srcIPAddr = intel (my_ip_addr);
478 arp->dstIPAddr = intel (ip);
479 memcpy (arp->srcEthAddr, _eth_addr, sizeof(arp->srcEthAddr));
480 memset (arp->dstEthAddr, 0, sizeof(arp->dstEthAddr));
481 return arp_send (arp, __LINE__);
482}
483
484
489BOOL W32_CALL _arp_reply (const void *e_dst, DWORD src_ip, DWORD dst_ip)
490{
491 arp_Header *arp;
492
493 if (!e_dst)
494 e_dst = &_eth_brdcast;
495
496 TRACE (("Sending ARP reply (%s [%s] -> %s [%s])\n",
497 INET_NTOA(src_ip), MAC_address(&_eth_addr),
498 INET_NTOA(dst_ip), MAC_address(e_dst)));
499
500 arp = (arp_Header*) _eth_formatpacket (e_dst, ARP_TYPE);
501 arp->hwType = intel16 (_eth_get_hwtype(NULL,NULL));
502 arp->protType = IP4_TYPE;
503 arp->hwAddrLen = sizeof (mac_address);
504 arp->protoAddrLen = sizeof (dst_ip);
505 arp->opcode = ARP_REPLY;
506 arp->srcIPAddr = intel (src_ip);
507 arp->dstIPAddr = intel (dst_ip);
508
509 memcpy (arp->srcEthAddr, _eth_addr, sizeof(mac_address));
510 memcpy (arp->dstEthAddr, e_dst, sizeof(mac_address));
511 return arp_send (arp, __LINE__);
512}
513
517static void arp_move_entry (int to_index, int from_index)
518{
519 memcpy (&arp_list[to_index], &arp_list[from_index], sizeof(struct arp_entry));
520}
521
527int W32_CALL _arp_cache_get (const struct arp_entry **rc)
528{
529 *rc = arp_list;
530 return DIM(arp_list);
531}
532
539static BOOL LAN_start_lookup (DWORD ip)
540{
541 struct arp_entry *ae;
542 int i;
543
544 TRACE (("LAN_start_lookup (%s)\n", INET_NTOA(ip)));
545
546 /* Ignore if IP is already in any list section (pending, fixed, dynamic)
547 */
548 for (i = arp_first_pending; i < ARP_TOP_PENDING; i++)
549 if (arp_list[i].ip == ip)
550 return (TRUE);
551
552 for (i = arp_first_dynamic; i < ARP_TOP_DYNAMIC; i++)
553 if (arp_list[i].ip == ip)
554 {
555 STAT (cache_stats.num_arp_hits++);
556 return (TRUE);
557 }
558
559 for (i = ARP_FIRST_FIXED; i < ARP_TOP_FIXED; i++)
560 if (arp_list[i].ip == ip)
561 {
562 STAT (cache_stats.num_arp_hits++);
563 return (TRUE);
564 }
565
566 /* Figure out where to put the new guy
567 */
568 if (arp_first_free < ARP_TOP_FREE) /* Do we have any free slots? */
569 {
570 /* yes, ok! */
571 }
572 else if (arp_first_dynamic < ARP_TOP_DYNAMIC) /* any dynamic entries? */
573 {
574 /* This new request is probably more important than an existing
575 * dynamic entry, so we sacrifice the top dynamic entry. It might be
576 * neater to kill the oldest entry, but all this shouldn't happen anyway.
577 * NB: Table size reallocation would go here.
578 */
579 --ARP_TOP_DYNAMIC; /* nuke top entry */
580 STAT (cache_stats.num_arp_overflow++);
581 outsnl (_LANG("ARP table overflow"));
582 }
583 else /* No more room - table is full with pending + fixed entries. */
584 {
585 outsnl (_LANG("ARP table full"));
586 STAT (cache_stats.num_arp_overflow++);
587 return (FALSE); /* failed, nothing we can do right now. */
588 }
589
590 /* Fill new slot, send out ARP request
591 */
592 --arp_first_pending;
593 ae = arp_list + arp_first_pending;
594 ae->ip = ip;
595 ae->expiry = set_timeout (1000UL * arp_timeout);
596 ae->flags = (ARP_FLG_INUSE | ARP_FLG_PENDING);
597 ae->retransmit_to = set_timeout (arp_rexmit_to);
598
599 STAT (cache_stats.num_arp_misses++);
600
601 /* If request fails, we try again a little sooner
602 */
603 if (!arp_send_request(ip))
604 ae->retransmit_to = set_timeout (arp_rexmit_to / 4);
605 else ae->retransmit_to = set_timeout (arp_rexmit_to);
606
607 return (TRUE); /* ok, new request logged */
608}
609
613static BOOL LAN_lookup (DWORD ip, eth_address *eth)
614{
615 int i;
616 BOOL rc = FALSE;
617
618 /* Check in dynamic + fixed list section
619 */
620 for (i = ARP_FIRST_FIXED; i < ARP_TOP_DYNAMIC; i++)
621 {
622 if (arp_list[i].ip != ip)
623 continue;
624 if (eth)
625 memcpy (eth, arp_list[i].hardware, sizeof(*eth));
626 rc = TRUE;
627 break;
628 }
629 TRACE (("LAN_lookup (%s), i: %d, flg: %s, rc: %d\n",
630 INET_NTOA(ip), i, rc ? get_ARP_flags(arp_list[i].flags) : "<n/a>", rc));
631 return (rc);
632}
633
637static BOOL LAN_lookup_pending (DWORD ip)
638{
639 BOOL rc = FALSE;
640 int i;
641
642 /* Scan pending list section
643 */
644 for (i = arp_first_pending; i < ARP_TOP_PENDING; i++)
645 if (arp_list[i].ip == ip)
646 {
647 rc = TRUE;
648 break;
649 }
650
651 TRACE (("LAN_lookup_pending (%s), i: %d, flg: %s, rc: %d\n",
652 INET_NTOA(ip), i, rc ? get_ARP_flags(arp_list[i].flags) : "<n/a>",
653 rc));
654 return (rc);
655}
656
664static void arp_check_timeouts (BOOL check_dynamic_entries)
665{
666 struct arp_entry *ae;
667 int i, num = 0;
668
669 /* Check pending entries for retansmit & expiry
670 */
671 for (i = arp_first_pending; i < ARP_TOP_PENDING; i++)
672 {
673 ae = arp_list + i;
674
675 /* If entry has expired (without being resolved): kill it
676 */
677 if (chk_timeout(ae->expiry))
678 {
679 num++;
680 if (i > arp_first_pending)
681 {
682 ae->flags &= ~ARP_FLG_INUSE;
683 arp_move_entry (i--, arp_first_pending); /* fill hole */
684 arp_first_pending++;
685 continue; /* backed 'i' up a step, now re-check 'new' current entry */
686 }
687 ++arp_first_pending;
688 }
689 /* If time for a retransmission: do it & restart timeout
690 */
691 else if (chk_timeout(ae->retransmit_to))
692 {
693 /* If request fails, we try again a little sooner
694 */
695 ae->retransmit_to = set_timeout (arp_send_request(ae->ip) ?
696 arp_rexmit_to : arp_rexmit_to / 4);
697 }
698 }
699
700 /* Check dynamic entries for expiry
701 */
702 if (!check_dynamic_entries)
703 goto quit;
704
705 for (i = arp_first_dynamic; i < ARP_TOP_DYNAMIC; i++)
706 {
707 ae = arp_list + i;
708
709 if (chk_timeout(ae->expiry)) /* entry has expired: kill it */
710 {
711 if (i < --ARP_TOP_DYNAMIC)
712 {
713 ae->flags &= ~ARP_FLG_INUSE;
714 num++;
715 arp_move_entry (i--, ARP_TOP_DYNAMIC); /* fill hole */
716 /* backed 'i' up a step, now re-check 'new' current entry */
717 }
718 }
719 }
720
721quit:
722 TRACE (("arp_check_timeouts (%d), num expired/rechecked: %d\n", check_dynamic_entries, num));
723}
724
725
730/* Routing table internal structure:
731 * \verbatim
732 *
733 * Index pointers Route cache table
734 * -------------- -----------------
735 *
736 * (top_of_cache) ->
737 * (= top_pending) ----------------------
738 * | ...
739 * | PENDING ROUTE ENTRIES (ARPing gateway - no reply yet)
740 * first_pending -> | ... grow downwards (into free slots)
741 * (= top_free) ----------------------
742 * | ...
743 * | ...
744 * | FREE SLOTS
745 * | ...
746 * first_free ----> | ...
747 * (= top_dynamic) ----------------------
748 * | ... grow upwards (into free slots)
749 * | ...
750 * | "DYNAMIC" ROUTE ENTRIES
751 * first_dynamic -> | ...
752 * ----------------------
753 * \endverbatim
754 *
755 * \note
756 * - "Top" means last entry + 1.
757 * - The entries inside each section are not ordered in any way.
758 * - The route cache only holds entries of hosts that are OUTSIDE of our LAN.
759 * - The entries time-out when the gateways ARP cache entry times out.
760 *
761 * \note
762 * Although we don't support multiple physical interfaces, we support
763 * multiple gateways connected to our interface.
764 */
765
766#define ROUTE_TOP_OF_CACHE 32
767#define ROUTE_TOP_PENDING ROUTE_TOP_OF_CACHE
768#define route_top_free route_first_pending
769#define route_top_dynamic route_first_free
770#define ROUTE_FIRST_DYNAMIC 0
771
772static int route_first_pending = ROUTE_TOP_PENDING;
773static int route_first_free = 0;
774
775static struct route_entry route_list [ROUTE_TOP_OF_CACHE];
776
777static void route_move_entry (int to_index, int from_index)
778{
779 memcpy (&route_list[to_index], &route_list[from_index], /* never overlapping mem-area */
780 sizeof(route_list[0]));
781}
782
783static BOOL route_make_new_slot (DWORD host_ip, DWORD gate_ip, DWORD mask)
784{
785 struct route_entry *re;
786
787 /* We assume IP was already checked for, otherwise we would add it twice.
788 * Check where we have room.
789 */
790 if (route_first_free < route_top_free)
791 {
792 /* Ok, free slots available */
793 }
794 else if (ROUTE_FIRST_DYNAMIC < route_top_dynamic)
795 {
796 /* Slaughter first dynamic entry, as new entry probably is more important
797 */
798 if (ROUTE_FIRST_DYNAMIC < --route_top_dynamic)
799 route_move_entry (ROUTE_FIRST_DYNAMIC, route_top_dynamic);
800 outsnl (_LANG("Route table overflow"));
801 }
802 else
803 {
804 outsnl (_LANG("Route table full"));
805 return (FALSE); /* Nothing we can do - list is full of pending entries */
806 }
807
808 /* Put the new entry in
809 */
810 --route_first_pending;
811 re = route_list + route_first_pending;
812 re->host_ip = host_ip; /* when connection to this host ... */
813 re->gate_ip = gate_ip; /* ... use this gateway */
814 re->mask = mask; /* remember the mask */
815 re->flags = (ROUTE_FLG_USED | ROUTE_FLG_PENDING);
816
817 TRACE (("route_make_new_slot(): added host %s, GW %s, mask %s at index %d\n",
818 INET_NTOA(host_ip), INET_NTOA(gate_ip), INET_NTOA(mask), route_first_pending));
819 return (TRUE);
820}
821
825static BOOL is_on_LAN (DWORD ip)
826{
827#if 1
828 return (((ip ^ my_ip_addr) & sin_mask) == 0);
829#else
830 return (ip && sin_mask && ((ip ^ my_ip_addr) & sin_mask) == 0);
831#endif
832
833}
834
842BOOL W32_CALL _arp_register (DWORD use_this_gateway_ip, DWORD for_this_host_ip)
843{
844 int i;
845
846 TRACE (("_arp_register (%s, %s)\n",
847 INET_NTOA(use_this_gateway_ip),
848 INET_NTOA(for_this_host_ip)));
849
850 /* Only makes sense if ("old") host is outside of our LAN,
851 * and ("new") gateway is on LAN.
852 */
853 if (!is_on_LAN(use_this_gateway_ip) || is_on_LAN(for_this_host_ip))
854 return (FALSE);
855
856 /* See if this guy is in our dynamic table
857 */
858 for (i = ROUTE_FIRST_DYNAMIC; i < route_top_dynamic; i++)
859 {
860 struct route_entry *re = route_list + i;
861
862 if (re->host_ip != for_this_host_ip)
863 continue;
864
865 if (re->gate_ip == use_this_gateway_ip)
866 return (TRUE); /* Already done */
867
868 if (LAN_lookup(use_this_gateway_ip, NULL))
869 {
870 re->gate_ip = use_this_gateway_ip;
871 return (TRUE); /* New gateway is already in ARP cache, done */
872 }
873
874 if (!LAN_start_lookup(use_this_gateway_ip))
875 {
876 outsnl (_LANG ("Unable to add redirect to ARP cache"));
877 return (FALSE); /* ARP table full */
878 }
879
880 /* Kill 'old' dynamic entry, fill hole
881 */
882 if (i < --route_top_dynamic)
883 route_move_entry (i, route_top_dynamic);
884
885 /* Add new request, the new dynamic slot will be created when the
886 * gateway ARP reply comes
887 */
888 return route_make_new_slot (use_this_gateway_ip, for_this_host_ip, sin_mask);
889 }
890
891 /* Note: We do not check the pending section, as the gateway sending
892 * the redirect could not really know the best route to a host that
893 * we have not yet even started to connect to. Redirects referring
894 * to a pending entry could be some sort of redirect attack.
895 */
896 return (FALSE);
897}
898
902static BOOL route_lookup (DWORD ip, eth_address *eth)
903{
904 BOOL rc = FALSE;
905 int i;
906
907 TRACE (("route_lookup (%s), ROUTE_FIRST_DYNAMIC: %d, route_top_dynamic: %d\n",
908 INET_NTOA(ip), ROUTE_FIRST_DYNAMIC, route_top_dynamic));
909
910 /* 1st, we need to find the gateway entry for the specified host
911 * in our route table
912 */
913 for (i = ROUTE_FIRST_DYNAMIC; i < route_top_dynamic; i++)
914 {
915 struct route_entry *re = route_list + i;
916 BOOL same_net = ON_SAME_NETWORK (ip, re->host_ip, re->mask);
917
918 TRACE ((" route_list[%d]: gate_ip %s, host_ip: %s, ON_SAME_NETWORK: %d\n",
919 i, INET_NTOA(re->gate_ip), INET_NTOA(re->host_ip), same_net));
920
921 if (re->host_ip != ip && !same_net) // !!
922 continue;
923
924 /* 2nd, the gateway needs to be in the ARP table
925 */
926 re->flags |= ROUTE_FLG_PENDING;
927 rc = LAN_lookup (re->gate_ip, eth);
928 if (rc)
929 re->flags &= ~ROUTE_FLG_PENDING;
930 break;
931 }
932 TRACE ((" rc: %d\n", rc));
933 return (rc);
934}
935
940static BOOL route_lookup_pending (DWORD ip)
941{
942 const struct route_entry *re = NULL;
943 BOOL rc = FALSE;
944 int i = 0;
945
946 /* Scan our pending list for the supplied IP
947 */
948 for (i = route_first_pending; i < ROUTE_TOP_PENDING; i++)
949 {
950 re = route_list + i;
951 if (re->host_ip == ip)
952 {
953 rc = TRUE;
954 break;
955 }
956 }
957 TRACE (("route_lookup_pending (%s), idx: %d, rc: %d, re->flags: %s\n",
958 INET_NTOA(ip), i, rc, rc ? get_route_flags(re->flags) : "<n/a>"));
959 return (rc);
960}
961
965static BOOL route_start_lookup (DWORD ip)
966{
967 DWORD first_gate_ip;
968 DWORD first_gate_mask;
969 int i;
970
971 TRACE (("route_start_lookup (%s), gate_top: %d\n", INET_NTOA(ip), gate_top));
972
973 /* Check if we already have an entry anywhere for this host
974 */
975 for (i = route_first_pending; i < ROUTE_TOP_PENDING; i++)
976 if (route_list[i].host_ip == ip)
977 return (TRUE); /* Already here */
978
979 for (i = ROUTE_FIRST_DYNAMIC; i < route_top_dynamic; i++)
980 if (route_list[i].host_ip == ip)
981 return (TRUE); /* Already here */
982
983 /* Abort if we don't have any gateways
984 */
985 if (gate_top <= 0)
986 {
987 outsnl (_LANG ("No gateways defined."));
988 return (FALSE);
989 }
990
991 /* Find the first 'fitting' gateway
992 */
993 first_gate_ip = 0; /* we remember the first gateway IP that fits */
994 first_gate_mask = 0;
995
996 for (i = 0; i < gate_top; i++)
997 {
998 const struct gate_entry *gw = gate_list + i;
999
1000 TRACE ((" i %d, gw->gate_ip %s, gw->subnet %s, gw->mask %s, gw->is_dead %d\n", i,
1001 INET_NTOA(gw->gate_ip), INET_NTOA(gw->subnet),
1002 INET_NTOA(gw->mask), gw->is_dead));
1003
1004 if (/* sin_mask != IP_BCAST_ADDR && */ !is_on_LAN(gw->gate_ip))
1005 continue;
1006
1007 if ((gw->mask & ip) != gw->subnet) /* IP not on same subnet as gw->gate_ip */
1008 continue;
1009
1010 if (gw->is_dead)
1011 continue;
1012
1013 if (!LAN_start_lookup(gw->gate_ip))
1014 {
1015 outsnl (_LANG ("Unable to add gateway to ARP cache"));
1016 return (FALSE); /* ARP table full, no point in going on right now */
1017 }
1018 first_gate_ip = gw->gate_ip; /* We start with this guy */
1019 first_gate_mask = gw->mask;
1020 break;
1021 }
1022
1023 /* Abort if we didn't find anybody at all to ARP, or all ARPs failed
1024 */
1025 if (first_gate_ip == 0)
1026 {
1027 outsnl (_LANG ("No matching gateway"));
1028 return (FALSE);
1029 }
1030
1031 /* Create a new route cache slot with our guy
1032 */
1033 route_make_new_slot (ip, first_gate_ip, first_gate_mask);
1034 return (TRUE);
1035}
1036
1037
1045static void route_check_timeouts (BOOL check_dynamic_entries)
1046{
1047 struct route_entry *re, temp;
1048 int i, j;
1049
1050 /* Check our pending entries
1051 */
1052 for (i = route_first_pending; i < ROUTE_TOP_PENDING; i++)
1053 {
1054 re = route_list + i;
1055
1056 /* Was the ARP lookup able to resolve the gateway IP?
1057 */
1058 if (LAN_lookup(re->gate_ip, NULL))
1059 {
1060 /* Success - move route entry from pending to dynamic list
1061 */
1062 temp = *re; /* Make a copy so we can safely delete the pending entry */
1063 if (i > route_first_pending)
1064 route_move_entry (i--, route_first_pending); /* fill hole */
1065 /* (i-- to "re"check new current entry) */
1066
1067 temp.flags &= ~ROUTE_FLG_PENDING;
1068 ++route_first_pending; /* remove from pending list */
1069 route_list [route_top_dynamic] = temp; /* add to dynamic list */
1070 ++route_top_dynamic;
1071 }
1072 /* Is the ARP lookup still pending? -> Keep waiting
1073 */
1074 else if (LAN_lookup_pending(re->gate_ip))
1075 {
1076 /* Do nothing */
1077 }
1078 /* The ARP lookup failed, we try the next possible gateway
1079 */
1080 else
1081 {
1082 /* Find the gateway that was tried last (the one that just timed out)
1083 */
1084 BOOL found_last_gw = FALSE;
1085 BOOL found_next_gw = FALSE;
1086
1087 for (j = 0; j < gate_top; j++)
1088 {
1089 if (gate_list[j].gate_ip != re->gate_ip)
1090 continue;
1091 found_last_gw = TRUE;
1092 break;
1093 }
1094
1095 if (!found_last_gw)
1096 j = -1; /* If search failed, we try the first gateway "again". */
1097
1098 /* Now we look for the next gateway that could be used
1099 */
1100 while (++j < gate_top)
1101 {
1102 const struct gate_entry *gw = gate_list + j;
1103
1104 if (/* sin_mask != IP_BCAST_ADDR && */ !is_on_LAN(gw->gate_ip))
1105 continue;
1106
1107 if ((gw->mask & re->host_ip) != gw->subnet)
1108 continue;
1109
1110 if (!LAN_start_lookup(gw->gate_ip))
1111 break; /* No room in ARP table, fail */
1112
1113 re->gate_ip = gw->gate_ip; /* Ok, now we try this gateway */
1114 found_next_gw = TRUE;
1115 break;
1116 }
1117
1118 /* No more gateways to try, hence lookup failed, kill entry
1119 */
1120 if (!found_next_gw)
1121 {
1122 if (i > route_first_pending)
1123 route_move_entry (i--, route_first_pending); /* fill hole */
1124 ++route_first_pending;
1125 }
1126 }
1127 }
1128
1129 if (!check_dynamic_entries)
1130 return;
1131
1132 /* Check our dynamic list for expired entries
1133 */
1134 for (i = ROUTE_FIRST_DYNAMIC; i < route_top_dynamic; i++)
1135 {
1136 re = route_list + i;
1137 if (LAN_lookup(re->gate_ip, NULL))
1138 continue; /* Still in ARP cache - ok */
1139
1140 /* ARP entry expired. Remove from list.
1141 */
1142 if (i < --route_top_dynamic)
1143 {
1144 route_move_entry (i--, route_top_dynamic); /* fill hole */
1145 /* (i backed up a step so 'new' slot is rechecked) */
1146 re = route_list + i;
1147 re->flags &= ~ROUTE_FLG_USED;
1148 }
1149 }
1150}
1151
1152
1162#if !defined(USE_UDP_ONLY)
1168BOOL W32_CALL _arp_start_lookup (DWORD ip)
1169{
1170 TRACE (("_arp_start_lookup (%s)\n", INET_NTOA(ip)));
1171
1172 if (arp_check_common(ip,NULL))
1173 return (TRUE);
1174
1175 if (is_on_LAN(ip))
1176 return LAN_start_lookup (ip);
1177 return route_start_lookup (ip);
1178}
1179
1180
1185BOOL W32_CALL _arp_lookup (DWORD ip, eth_address *eth)
1186{
1187 TRACE (("_arp_lookup (%s), is_on_LAN(): %d\n",
1188 INET_NTOA(ip), is_on_LAN(ip)));
1189
1190 if (arp_check_common(ip,eth))
1191 return (TRUE);
1192
1193 if (is_on_LAN(ip))
1194 return LAN_lookup (ip, eth);
1195 return route_lookup (ip, eth);
1196}
1197
1198
1205BOOL W32_CALL _arp_lookup_pending (DWORD ip)
1206{
1207 TRACE (("_arp_lookup_pending (%s)\n", INET_NTOA(ip)));
1208
1209 if (is_on_LAN(ip))
1210 return LAN_lookup_pending (ip);
1211 return route_lookup_pending (ip);
1212}
1213
1218BOOL W32_CALL _arp_lookup_fixed (DWORD ip, eth_address *eth)
1219{
1220 int i;
1221
1222 TRACE (("_arp_lookup_fixed (%s)\n", INET_NTOA(ip)));
1223
1224 if (arp_check_common(ip,eth))
1225 return (TRUE);
1226
1227 if (!is_on_LAN(ip)) /* We only have/need a LAN version */
1228 return (FALSE);
1229
1230 /* Scan fixed table section
1231 */
1232 for (i = ARP_FIRST_FIXED; i < ARP_TOP_FIXED; i++)
1233 {
1234 if (arp_list[i].ip != ip)
1235 continue;
1236 if (eth)
1237 memcpy (eth, arp_list[i].hardware, sizeof(*eth));
1238 return (TRUE);
1239 }
1240 return (FALSE);
1241}
1242#endif /* USE_UDP_ONLY */
1243
1247static BOOL arp_check_common (DWORD ip, eth_address *eth)
1248{
1249#if defined(USE_DEBUG)
1250 if (arp_trace_level >= 4)
1251 {
1252 _arp_cache_dump();
1253 _arp_gateways_dump();
1254 _arp_routes_dump();
1255 }
1256#endif
1257
1258 STAT (cache_stats.num_arp_search++);
1259
1260 if (_pktserial) /* A serial driver uses a null MAC */
1261 {
1262 if (eth)
1263 memset (eth, 0, sizeof(*eth));
1264 return (TRUE);
1265 }
1266 if (_ip4_is_local_addr(ip)) /* A local address uses own MAC */
1267 {
1268 if (eth)
1269 memcpy (eth, _eth_addr, sizeof(*eth));
1270 return (TRUE);
1271 }
1272 return (FALSE);
1273}
1274
1278BOOL W32_CALL _arp_resolve (DWORD ip, eth_address *eth)
1279{
1280 BOOL (*lookup) (DWORD ip, eth_address *eth);
1281 BOOL (*start_lookup) (DWORD ip);
1282 BOOL (*pending_lookup) (DWORD ip);
1283 BOOL rc = FALSE;
1284 WORD brk_mode;
1285
1286 TRACE (("_arp_resolve (%s)\n", INET_NTOA(ip)));
1287
1288 if (arp_check_common(ip,eth))
1289 return (TRUE);
1290
1291 /* Quick check if we have this guy in our cache.
1292 */
1293 if (is_on_LAN(ip))
1294 {
1295 lookup = LAN_lookup;
1296 start_lookup = LAN_start_lookup;
1297 pending_lookup = LAN_lookup_pending;
1298 }
1299 else
1300 {
1301 lookup = route_lookup;
1302 start_lookup = route_start_lookup;
1303 pending_lookup = route_lookup_pending;
1304 }
1305
1306 if ((*lookup)(ip, eth))
1307 return (TRUE); /* Ok, done */
1308
1309 /* Put out the request for the MAC
1310 */
1311 if (!(*start_lookup)(ip))
1312 {
1313 TRACE (("%s() failed\n", (start_lookup == LAN_start_lookup) ?
1314 "LAN_start_lookup" : "route_start_lookup"));
1315 return (FALSE); /* Request failed, resolve doomed */
1316 }
1317
1318 NEW_BREAK_MODE (brk_mode, 1);
1319
1320 /* Now busy-wait until reply is here or timeout (or Ctrl-C)
1321 */
1322 do
1323 {
1324 tcp_tick (NULL); /* will call our daemon to timeout/retran */
1325 arp_daemon(); /* added for faster lookup */
1326
1327 if ((*lookup)(ip, eth))
1328 {
1329 rc = TRUE;
1330 break;
1331 }
1332 WATT_YIELD();
1333
1334 if (_watt_cbroke)
1335 {
1336 _watt_cbroke = 0;
1337 break;
1338 }
1339 }
1340 while ((*pending_lookup)(ip));
1341
1342 OLD_BREAK_MODE (brk_mode);
1343 return (rc);
1344}
1345
1346
1351BOOL W32_CALL _arp_cache_add (DWORD ip, const void *eth, BOOL expires)
1352{
1353 struct arp_entry *ae;
1354
1355 TRACE (("_arp_cache_add (%s), expires: %d\n", INET_NTOA(ip), expires));
1356
1357 if (!my_ip_addr && !expires)
1358 {
1359 /* If called from e.g. pcconfig, my_ip_addr may be 0 when using
1360 * DHCP. Allow adding fixed entries.
1361 */
1362 }
1363 else if (!is_on_LAN (ip)) /* Only makes sense if on our LAN. */
1364 return (FALSE);
1365
1366 _arp_cache_del (ip); /* Kill it if already here somewhere */
1367
1368 /* Now add to correct list
1369 */
1370 if (expires) /* dynamic list */
1371 {
1372 if (arp_first_free >= ARP_TOP_FREE) /* No free dynamic slots */
1373 return (FALSE);
1374
1375 /* Fill new slot data
1376 */
1377 ae = arp_list + ARP_TOP_DYNAMIC;
1378 ARP_TOP_DYNAMIC++;
1379 ae->ip = ip;
1380 memcpy (&ae->hardware, eth, sizeof(ae->hardware));
1381 ae->expiry = set_timeout (1000UL * arp_alive);
1382 ae->flags = (ARP_FLG_INUSE | ARP_FLG_DYNAMIC);
1383 }
1384 else /* fixed list */
1385 {
1386 /* Check if we have any free slots; make room if possible
1387 */
1388 if (arp_first_free >= ARP_TOP_FREE) /* No more fixed slots? */
1389 {
1390 if (arp_first_dynamic >= ARP_TOP_DYNAMIC)
1391 return (FALSE); /* No free AND no dynamic slots! */
1392 --ARP_TOP_DYNAMIC; /* Kill the top dynamic slot to make room */
1393 }
1394
1395 /* Roll dynamic entires up one slot to make room for the new fixed entry
1396 */
1397 if (arp_first_dynamic < ARP_TOP_DYNAMIC)
1398 arp_move_entry (ARP_TOP_DYNAMIC, arp_first_dynamic);
1399 ++ARP_TOP_DYNAMIC;
1400
1401 /* Fill new slot data
1402 */
1403 ae = arp_list + ARP_TOP_FIXED; /* implies ++arp_first_dynamic! */
1404 ARP_TOP_FIXED++;
1405 ae->ip = ip;
1406 ae->flags = (ARP_FLG_INUSE | ARP_FLG_FIXED);
1407 memcpy (&ae->hardware, eth, sizeof(ae->hardware));
1408
1409 TRACE_CONSOLE (4, "_arp_cache_add(): ip: %s, eth: %s, ARP_TOP_FIXED: %d, flags: %02X\n",
1410 _inet_ntoa(NULL,ip), MAC_address(eth), ARP_TOP_FIXED-1, ae->flags);
1411 }
1412 return (TRUE);
1413}
1414
1415
1420BOOL W32_CALL _arp_cache_del (DWORD ip)
1421{
1422 struct arp_entry *ae;
1423 BOOL rc = FALSE;
1424 int i;
1425
1426 /* Remove from dynamic list if present
1427 */
1428 for (i = arp_first_dynamic; i < ARP_TOP_DYNAMIC; i++)
1429 {
1430 ae = arp_list + i;
1431 if (ae->ip != ip)
1432 continue;
1433
1434 if (i < --ARP_TOP_DYNAMIC)
1435 arp_move_entry (i, ARP_TOP_DYNAMIC); /* fill hole */
1436 ae->flags &= ~ARP_FLG_INUSE;
1437 rc = TRUE;
1438 goto quit;
1439 }
1440
1441 /* Remove from fixed list if present
1442 */
1443 for (i = ARP_FIRST_FIXED; i < ARP_TOP_FIXED; i++)
1444 {
1445 ae = arp_list + i;
1446 if (ae->ip != ip)
1447 continue;
1448
1449 if (i < --ARP_TOP_FIXED)
1450 arp_move_entry (i, ARP_TOP_FIXED); /* fill hole */
1451
1452 /* Do we have any dynamic entries we need to roll down one slot?
1453 * arp_first_dynamic same as ARP_TOP_FIXED, already implicity
1454 * decremented above!
1455 */
1456 if (arp_first_dynamic < --ARP_TOP_DYNAMIC)
1457 arp_move_entry (arp_first_dynamic, ARP_TOP_DYNAMIC);
1458 ae->flags &= ~ARP_FLG_INUSE;
1459 rc = TRUE;
1460 goto quit;
1461 }
1462
1463 /* Remove from pending list if present
1464 */
1465 for (i = arp_first_pending; i < ARP_TOP_PENDING; i++)
1466 {
1467 ae = arp_list + i;
1468 if (ae->ip != ip)
1469 continue;
1470
1471 if (i > arp_first_pending)
1472 arp_move_entry (i, arp_first_pending); /* fill hole */
1473 ++arp_first_pending;
1474 ae->flags &= ~ARP_FLG_INUSE;
1475 rc = TRUE;
1476 goto quit;
1477 }
1478
1479 /* Didn't have it in cache */
1480
1481quit:
1482 TRACE (("_arp_cache_del (%s). i: %d, rc: %d\n", INET_NTOA(ip), i, rc));
1483 return (rc);
1484}
1485
1493static void W32_CALL arp_daemon (void)
1494{
1495 static BOOL check_dynamic = TRUE;
1496 static DWORD check_dynamic_timer = 0UL;
1497
1498 arp_check_timeouts (check_dynamic);
1499 route_check_timeouts (check_dynamic);
1500
1501 if (check_dynamic)
1502 {
1503#if defined(USE_DEAD_GWD) /* check dead gateways if we have >1 default GW */
1504 if (dead_gw_detect)
1505 {
1506 if (_arp_check_gateways() <= 1)
1507 dead_gw_detect = FALSE;
1508 else check_dead_gw();
1509 }
1510#endif
1511
1512 /* Preset check_dynamic for next call (1 sec)
1513 */
1514 check_dynamic_timer = set_timeout (1000UL);
1515 check_dynamic = FALSE;
1516 }
1517 else if (chk_timeout(check_dynamic_timer))
1518 {
1519 check_dynamic = TRUE;
1520 }
1521}
1522
1526static void (W32_CALL *prev_cfg_hook) (const char*, const char*);
1527
1528static void W32_CALL arp_parse (const char *name, const char *value)
1529{
1530 static const struct config_table arp_cfg[] = {
1531 { "ALIVE", ARG_ATOI, (void*)&arp_alive },
1532 { "DEAD_GW_DETECT",ARG_ATOI, (void*)&dead_gw_detect },
1533 { "GRATIOTOUS", ARG_ATOI, (void*)&arp_gratiotous },
1534 { "RETRANS_TO", ARG_ATOI, (void*)&arp_rexmit_to },
1535 { "TIMEOUT", ARG_ATOI, (void*)&arp_timeout },
1536 { "TRACE", ARG_ATOI, (void*)&arp_trace_level },
1537 { NULL, 0, NULL }
1538 };
1539 if (!parse_config_table(&arp_cfg[0], "ARP.", name, value) && prev_cfg_hook)
1540 (*prev_cfg_hook) (name, value);
1541}
1542
1546void W32_CALL _arp_init (void)
1547{
1548 DAEMON_ADD (arp_daemon);
1549
1550 memset (&arp_list, 0, sizeof(arp_list));
1551 prev_cfg_hook = usr_init;
1552 usr_init = arp_parse;
1553}
1554
1555#if defined(WIN32)
1556 #define BROADCAST_MODE() (_pkt_rxmode & RXMODE_BROADCAST)
1557#else
1558 #define BROADCAST_MODE() (_pkt_rxmode <= RXMODE_BROADCAST)
1559#endif
1560
1565BOOL W32_CALL _arp_handler (const arp_Header *ah, BOOL brdcast)
1566{
1567 struct arp_entry *ae;
1568 const eth_address *e_src, *e_dst; /* src/dest eth-addresses */
1569 DWORD src, dst; /* src/dest IP-addresses */
1570 WORD hw_needed = intel16 (_eth_get_hwtype(NULL,NULL));
1571 BOOL to_us, do_reply = FALSE;
1572 int i;
1573
1574 DEBUG_RX (NULL, ah);
1575
1576 if (ah->hwType != hw_needed || /* wrong hardware type, */
1577 ah->protType != IP4_TYPE) /* or not IPv4-protocol */
1578 {
1579 TRACE (("Bogus ARP-header; hwType: %04X, protoType: %04X.\n",
1580 ah->hwAddrLen, ah->protoAddrLen));
1581 return (FALSE);
1582 }
1583
1584 if (ah->hwAddrLen != sizeof(mac_address) ||
1585 ah->protoAddrLen != sizeof(src))
1586 {
1587 TRACE (("Bogus ARP-header; hwAddrLen: %d, protoAddrLen: %d.\n",
1588 ah->hwAddrLen, ah->protoAddrLen));
1589 return (FALSE);
1590 }
1591
1592 src = intel (ah->srcIPAddr);
1593 dst = intel (ah->dstIPAddr);
1594
1595 e_src = &ah->srcEthAddr;
1596 e_dst = &ah->dstEthAddr;
1597
1598 to_us = !memcmp(&_eth_addr,MAC_DST(ah),_eth_mac_len) ||
1599 !memcmp(&_eth_addr,e_dst,_eth_mac_len);
1600
1601 /* Does someone else want our Ethernet address?
1602 */
1603 if (ah->opcode == ARP_REQUEST)
1604 {
1605 if (_ip4_is_local_addr(dst) &&
1606 !_ip4_is_multicast(dst) &&
1607 !_ip4_is_loopback_addr(dst))
1608 do_reply = TRUE;
1609
1610 if (!to_us && !BROADCAST_MODE())
1611 {
1612 if (src == my_ip_addr)
1613 TRACE (("Address conflict from %s [%s]\n",
1614 INET_NTOA(src), MAC_address(e_src)));
1615
1616 /* Prevent anti-sniffers detecting us if we're not in normal rx-mode
1617 */
1618 if (memcmp(MAC_DST(ah),_eth_brdcast,sizeof(_eth_brdcast))) /* not bcast */
1619 do_reply = FALSE;
1620 }
1621
1622 if (do_reply)
1623 _arp_reply (e_src, dst, src);
1624 }
1625
1626 /* See if the senders IP & MAC is anything we can use
1627 */
1628
1629 /* Is this the awaited reply to a pending entry?
1630 */
1631 for (i = arp_first_pending; i < ARP_TOP_PENDING; i++)
1632 {
1633 ae = arp_list + i;
1634 if (ah->opcode != ARP_REPLY || ae->ip != src)
1635 continue;
1636
1637 /* Remove from pending list
1638 */
1639 if (i > arp_first_pending)
1640 arp_move_entry (i, arp_first_pending); /* fill 'hole' */
1641 ++arp_first_pending;
1642
1643 ae->flags &= ~(ARP_FLG_INUSE | ARP_FLG_PENDING);
1644
1645 /* fill new dynamic entry
1646 * (at least one slot is free because we just freed a pending slot)
1647 */
1648#if 1
1649 _arp_cache_add (src, e_src, TRUE);
1650#else
1651 ae = arp_list + ARP_TOP_DYNAMIC;
1652 ARP_TOP_DYNAMIC++;
1653 ae->ip = src;
1654 ae->flags = (ARP_FLG_INUSE | ARP_FLG_DYNAMIC);
1655 memcpy (&ae->hardware, e_src, sizeof(*e_src));
1656 ae->expiry = set_timeout (1000UL * arp_alive);
1657#endif
1658
1659 TRACE (("Got ARP-reply from %s [%s]. No longer pending.\n",
1660 INET_NTOA(src), MAC_address(e_src)));
1661 return (TRUE);
1662 }
1663
1664 /* Or is this a 'refresher' of a dynamic entry?
1665 * We'll use both ARP_REQUEST and ARP_REPLY to refresh.
1666 */
1667 if (ah->opcode != ARP_REQUEST && ah->opcode != ARP_REPLY)
1668 goto quit;
1669
1670 for (i = arp_first_dynamic; i < ARP_TOP_DYNAMIC; i++)
1671 {
1672 BOOL equal;
1673 DWORD timeout;
1674
1675 ae = arp_list + i;
1676 if (ae->ip != src)
1677 continue;
1678
1679 /* This could also be an 'ARP poisoning attack', where an attacker is
1680 * trying to slip us a fake MAC address.
1681 * Knowing that, we check if the MAC address has changed, and if so
1682 * prematurely expire the entry. We will re-request it when we need it.
1683 * If the MAC address is 'still' the same, we just restart the timeout.
1684 */
1685 equal = (memcmp(&ae->hardware, e_src, sizeof(*e_src)) == 0);
1686
1687 /* if poisoned, we give the 'real guy' 500 ms grace to reclaim his MAC ;)
1688 */
1689 timeout = (equal ? (1000UL * arp_alive) : 500UL);
1690 ae->expiry = set_timeout (timeout);
1691 TRACE (("Got refreshed (%sequal) entry for %s [%s].\n",
1692 equal ? "" : "not ", INET_NTOA(src), MAC_address(e_src)));
1693 return (TRUE);
1694 }
1695
1696 /* Add to cache if we replied.
1697 */
1698 if (do_reply)
1699 {
1700 _arp_cache_add (src, e_src, TRUE);
1701 TRACE (("Added entry for %s [%s]\n", INET_NTOA(src), MAC_address(e_src)));
1702 return (TRUE);
1703 }
1704
1705 /* Most TCP stacks add any 'sniffed' ARP replies to their cache in case
1706 * they're needed later. But what are the odds? :)
1707 * Anyway, this could quickly fill the table with 'junk' entries on
1708 * heavily populated LANs; plus it makes us vulnerable to ARP-flooding
1709 * attacks ... so it's probably wiser to just ignore them.
1710 */
1711
1712quit:
1713 if (src != my_ip_addr)
1714 TRACE (("ARP-packet from %s [%s] not handled.\n",
1715 INET_NTOA(src), MAC_address(e_src)));
1716 ARGSUSED (brdcast);
1717 return (FALSE);
1718}
1719
1720
1721#if defined(USE_DHCP)
1728BOOL W32_CALL _arp_check_own_ip (eth_address *other_guy)
1729{
1730 DWORD save = my_ip_addr;
1731 BOOL rc;
1732
1733 TRACE (("_arp_check_own_ip()\n"));
1734
1735 my_ip_addr = 0;
1736 memset (other_guy, 0, sizeof(*other_guy));
1737 rc = _arp_resolve (save, other_guy);
1738 my_ip_addr = save;
1739
1740 if (rc && memcmp(other_guy,(const void*)"\0\0\0\0\0\0",sizeof(*other_guy)))
1741 return (FALSE);
1742 return (TRUE);
1743}
1744#else
1745/* \todo: Add an empty stub */
1746#endif
1747
1751int W32_CALL _arp_check_gateways (void)
1752{
1753 int i, num = 0;
1754
1755 TRACE (("_arp_check_gateways()\n"));
1756
1757 /* Send a gratiotous ARP. Don't if already done DHCP_arp_check().
1758 */
1759#if defined(USE_DHCP)
1760 if (DHCP_did_gratuitous_arp)
1761 arp_gratiotous = FALSE;
1762#endif
1763
1764 if (arp_gratiotous)
1765 _arp_reply (NULL, my_ip_addr, IP_BCAST_ADDR);
1766
1767 for (i = 0; i < gate_top; i++)
1768 if (gate_list[i].subnet == 0UL)
1769 num++;
1770 return (num);
1771}
1772
1773#if defined(USE_DEBUG)
1774void W32_CALL _arp_cache_dump (void)
1775{
1776 const struct arp_entry *ae;
1777 DWORD now = set_timeout (0);
1778 int i, num = 0, max = _arp_cache_get (&ae);
1779
1780 (*_printf) ("\nARP-cache:\n");
1781
1782 for (i = 0; i < max; i++, ae++)
1783 {
1784 const char *remain;
1785 char remain_buf [30];
1786
1787 if (!(ae->flags & ARP_FLG_INUSE))
1788 continue;
1789
1790 num++;
1791 if (ae->expiry)
1792 {
1793 if (ae->expiry > now)
1794 {
1795 sprintf (remain_buf, "expires in %ss", time_str(ae->expiry-now));
1796 remain = remain_buf;
1797 }
1798 else
1799 remain = "timed out";
1800 }
1801 else
1802 remain = "no expiry";
1803
1804 (*_printf) (" IP: %-15s -> %s, %s %s\n",
1805 INET_NTOA(ae->ip), MAC_address(&ae->hardware),
1806 (ae->flags & ARP_FLG_FIXED) ? "Fixed, " :
1807 (ae->flags & ARP_FLG_DYNAMIC) ? "Dynamic," :
1808 (ae->flags & ARP_FLG_PENDING) ? "Pending," : "??, ",
1809 remain);
1810 }
1811 if (num == 0)
1812 (*_printf) (" <Empty>\n");
1813}
1814
1815void W32_CALL _arp_routes_dump (void)
1816{
1817 const struct route_entry *re = route_list;
1818 int i;
1819
1820 (*_printf) ("\nRoutes:\n"
1821 " # GATEWAY HOST MASK FLAGS\n");
1822
1823 for (i = 0; i < DIM(route_list); i++, re++)
1824 {
1825 if (!(re->flags & ROUTE_FLG_USED))
1826 continue;
1827 (*_printf) (" %2d %-15s %-15s %-15s %s\n",
1828 i, INET_NTOA(re->gate_ip), INET_NTOA(re->host_ip),
1829 INET_NTOA(re->mask), get_route_flags(re->flags));
1830 }
1831}
1832
1833#if defined(USE_BSD_API)
1834 /*
1835 * In ioctl.c
1836 */
1837 extern void __get_ifname (char *if_name);
1838#else
1839 /*
1840 * Just fake.
1841 */
1842 #define __get_ifname(var) strcpy (var, "eth0")
1843#endif
1844
1845
1846void W32_CALL _arp_gateways_dump (void)
1847{
1848 const struct gate_entry *gw = gate_list;
1849 int i;
1850
1851 (*_printf) ("\nGateways:\n");
1852 if (gate_top <= 0)
1853 {
1854 (*_printf) ("NONE\n");
1855 return;
1856 }
1857
1858#if 0
1859 (*_printf) (" GATEWAY'S IP SUBNET SUBNET MASK\n");
1860
1861 for (i = 0 ; i < gate_top; i++, gw++)
1862 {
1863 char gate[20], subnet[20], mask[20];
1864
1865 strcpy (gate, INET_NTOA(gw->gate_ip));
1866
1867 if (gw->subnet)
1868 strcpy (subnet, INET_NTOA(gw->subnet));
1869 else strcpy (subnet, "0.0.0.0 (def)");
1870
1871 if (gw->mask)
1872 strcpy (mask, INET_NTOA(gw->mask));
1873 else strcpy (mask, INET_NTOA(sin_mask)), strcat (mask," (def)");
1874
1875 (*_printf) (" %-15s %-15s %-15s\n", gate, subnet, mask);
1876 }
1877#else
1878/*
1879 Print it like "nmap --iflist" does:
1880
1881 **************************ROUTES**************************
1882 DST/MASK DEV GATEWAY
1883 255.255.255.255/32 eth1 10.0.0.6 my_ip
1884 10.0.0.6/32 lo0 127.0.0.1 loopback network
1885 10.255.255.255/32 eth1 10.0.0.6 all 1 broadcast
1886 255.255.255.255/32 eth1 10.0.0.6 directed broadcast
1887 10.0.0.0/24 eth1 10.0.0.6
1888 127.0.0.0/8 lo0 127.0.0.1
1889 224.0.0.0/4 eth1 10.0.0.6
1890 0.0.0.0/0 eth1 10.0.0.1
1891 */
1892 (*_printf) (" DEST/MASK DEV GATEWAY (MASK)\n");
1893
1894 for (i = 0 ; i < gate_top; i++, gw++)
1895 {
1896 DWORD mask = gw->mask; // ? gw->mask : sin_mask;
1897 char *subnet = INET_NTOA(gw->subnet);
1898 char ifname[10];
1899 int padding, mlen = mask_len(mask);
1900
1901 __get_ifname (ifname);
1902 padding = 14 - strlen (subnet);
1903 if (mlen > 9)
1904 padding--;
1905
1906 (*_printf) (" %s/%d%*s %s %-15s (%s)\n",
1907 subnet, mlen, padding, "", ifname,
1908 INET_NTOA(gw->gate_ip), INET_NTOA(mask));
1909 }
1910#endif
1911}
1912
1918void W32_CALL _arp_debug_dump (void)
1919{
1920 const struct arp_entry *ae;
1921 const struct gate_entry *gw;
1922 const struct route_entry *re;
1923 DWORD now = set_timeout (0UL);
1924 DWORD mask;
1925 int i;
1926
1927 /* Gateways
1928 */
1929 if (!dbug_printf ("Gateway list:\n"))
1930 return;
1931
1932 if (gate_top == 0)
1933 {
1934 dbug_printf (" --none--\n");
1935 }
1936 else for (i = 0; i < gate_top; i++)
1937 {
1938 gw = gate_list + i;
1939 mask = gw->mask ? gw->mask : sin_mask;
1940 dbug_printf (" #%03d: %-15s ", i, INET_NTOA(gw->gate_ip));
1941 dbug_printf ("(network: %-15s ", INET_NTOA(gw->subnet));
1942 dbug_printf ("mask: %s)\n" , INET_NTOA(mask));
1943 }
1944
1945 /* Route table
1946 */
1947 dbug_printf ("\nRouting cache:\n"
1948 "------- top of cache -----------------------------------------------\n"
1949 " (%03d) top of pending slots ---------------------------------------\n",
1950 ROUTE_TOP_PENDING);
1951
1952 if (route_first_pending == ROUTE_TOP_PENDING)
1953 {
1954 dbug_printf (" --none--\n");
1955 }
1956 else if (route_first_pending > ROUTE_TOP_PENDING)
1957 {
1958 dbug_printf (" INDEX ERROR!\n");
1959 }
1960 else for (i = ROUTE_TOP_PENDING-1; i >= route_first_pending; i--)
1961 {
1962 re = route_list + i;
1963 dbug_printf (" #%03d: IP: %-15s -> gateway IP %-15s\n",
1964 i, INET_NTOA(re->host_ip), INET_NTOA(re->gate_ip));
1965 }
1966
1967 dbug_printf ("- (%03d) top of free slots ------------------------------------------\n",
1968 route_top_free);
1969
1970 if (route_first_free == route_top_free)
1971 {
1972 dbug_printf (" --none--\n");
1973 }
1974 else if (route_first_free > route_top_free)
1975 {
1976 dbug_printf (" INDEX ERROR!\n");
1977 }
1978 else if (route_top_free - route_first_free <= 3)
1979 {
1980 for (i = route_top_free-1; i >= route_first_free; i--)
1981 dbug_printf (" #%03d: (free)\n", i);
1982 }
1983 else
1984 {
1985 dbug_printf (" #%03d: (free)\n", route_top_free-1);
1986 dbug_printf (" ... (free)\n");
1987 dbug_printf (" #%03d: (free)\n", route_first_free);
1988 }
1989
1990 dbug_printf ("- (%03d) top of dynamic slots ---------------------------------------\n",
1991 route_top_dynamic);
1992 if (ROUTE_FIRST_DYNAMIC == route_top_dynamic)
1993 {
1994 dbug_printf (" --none--\n");
1995 }
1996 else if (ROUTE_FIRST_DYNAMIC > route_top_dynamic)
1997 {
1998 dbug_printf (" INDEX ERROR!\n");
1999 }
2000 else for (i = route_top_dynamic-1; i >= ROUTE_FIRST_DYNAMIC; i--)
2001 {
2002 re = route_list + i;
2003 dbug_printf (" #%03d: IP: %-15s -> gateway IP %-15s\n",
2004 i, INET_NTOA(re->host_ip), INET_NTOA(re->gate_ip));
2005 }
2006 dbug_printf ("------- bottom of cache --------------------------------------------\n");
2007
2008 /* ARP table
2009 */
2010 dbug_printf ("\nARP cache:\n"
2011 "------- top of cache -----------------------------------------------\n"
2012 " (%03d) top of pending slots ---------------------------------------\n",
2013 ARP_TOP_PENDING);
2014
2015 if (arp_first_pending == ARP_TOP_PENDING)
2016 {
2017 dbug_printf (" --none--\n");
2018 }
2019 else if (arp_first_pending > ARP_TOP_PENDING)
2020 {
2021 dbug_printf (" INDEX ERROR!\n");
2022 }
2023 else for (i = ARP_TOP_PENDING-1; i >= arp_first_pending; i--)
2024 {
2025 ae = arp_list + i;
2026 dbug_printf (" #%03d: IP: %-15s -> ??:??:??:??:??:?? expires in %ss\n",
2027 i, INET_NTOA(ae->ip), time_str(ae->expiry - now));
2028 }
2029
2030 dbug_printf ("- (%03d) top of free slots ------------------------------------------\n",
2031 ARP_TOP_FREE);
2032 if (arp_first_free == ARP_TOP_FREE)
2033 {
2034 dbug_printf (" --none--\n");
2035 }
2036 else if (arp_first_free > ARP_TOP_FREE)
2037 {
2038 dbug_printf (" INDEX ERROR!\n");
2039 }
2040 else if (ARP_TOP_FREE - arp_first_free <= 3)
2041 {
2042 for (i = ARP_TOP_FREE-1; i >= arp_first_free; i--)
2043 dbug_printf (" #%03d: (free)\n", i);
2044 }
2045 else
2046 {
2047 dbug_printf (" #%03d: (free)\n", ARP_TOP_FREE-1);
2048 dbug_printf (" ... (free)\n");
2049 dbug_printf (" #%03d: (free)\n", arp_first_free);
2050 }
2051
2052 dbug_printf ("- (%03d) top of dynamic slots ---------------------------------------\n",
2053 ARP_TOP_DYNAMIC);
2054 if (arp_first_dynamic == ARP_TOP_DYNAMIC)
2055 {
2056 dbug_printf (" --none--\n");
2057 }
2058 else if (arp_first_dynamic > ARP_TOP_DYNAMIC)
2059 {
2060 dbug_printf (" INDEX ERROR!\n");
2061 }
2062 else for (i = ARP_TOP_DYNAMIC-1; i >= arp_first_dynamic; i--)
2063 {
2064 ae = arp_list + i;
2065 dbug_printf (" #%03d: IP: %-15s -> %s expires in %ss\n",
2066 i, INET_NTOA(ae->ip), MAC_address(&ae->hardware),
2067 time_str(ae->expiry - now));
2068 }
2069
2070 dbug_printf ("- (%03d) top of fixed slots -----------------------------------------\n",
2071 ARP_TOP_FIXED);
2072 if (ARP_FIRST_FIXED == ARP_TOP_FIXED)
2073 {
2074 dbug_printf (" --none--\n");
2075 }
2076 else if (ARP_FIRST_FIXED > ARP_TOP_FIXED)
2077 {
2078 dbug_printf (" INDEX ERROR!\n");
2079 }
2080 else for (i = ARP_TOP_FIXED-1; i >= ARP_FIRST_FIXED; i--)
2081 {
2082 ae = arp_list + i;
2083 dbug_printf (" #%03d: IP: %-15s -> %s\n",
2084 i, INET_NTOA(ae->ip), MAC_address(&ae->hardware));
2085 }
2086 dbug_printf ("------- bottom of cache --------------------------------------------\n");
2087}
2088
2089static const char *get_ARP_flags (WORD flg)
2090{
2091 static char buf[50];
2092 char *p;
2093
2094 buf[0] = '\0';
2095 if (flg & ARP_FLG_INUSE)
2096 strcat (buf, "INUSE,");
2097 if (flg & ARP_FLG_PENDING)
2098 strcat (buf, "PEND,");
2099 if (flg & ARP_FLG_DYNAMIC)
2100 strcat (buf, "DYN,");
2101 if (flg & ARP_FLG_FIXED)
2102 strcat (buf, "FIXED,");
2103 p = strrchr (buf,',');
2104 if (p)
2105 *p = '\0';
2106 return (buf);
2107}
2108
2109static const char *get_route_flags (WORD flg)
2110{
2111 static char buf[50];
2112 char *p;
2113
2114 buf[0] = '\0';
2115 if (flg & ROUTE_FLG_USED)
2116 strcat (buf, "INUSE, ");
2117 if (flg & ROUTE_FLG_PENDING)
2118 strcat (buf, "PEND, ");
2119 if (flg & ROUTE_FLG_DYNAMIC)
2120 strcat (buf, "DYN, ");
2121 if (flg & ROUTE_FLG_FIXED)
2122 strcat (buf, "FIXED,");
2123 p = strrchr (buf,',');
2124 if (p)
2125 *p = '\0';
2126 return (buf);
2127}
2128
2129#else
2130 W32_CALL void W32_CALL _arp_cache_dump (void) {}
2131 W32_CALL void W32_CALL _arp_gateways_dump (void) {}
2132 W32_CALL void W32_CALL _arp_routes_dump (void) {}
2133 W32_CALL void W32_CALL _arp_debug_dump (void) {}
2134#endif /* USE_DEBUG */
2135
2136
2137#if defined(TEST_PROG)
2138
2139#if defined(__WATCOMC__)
2140 #pragma disable_message (202)
2141#endif
2142
2143/*
2144 * Find the best 'fitting' gateway for destination IP.
2145 * Return INADDR_ANY if 'ip' is directly reachable.
2146 */
2147static DWORD _route_destin (DWORD ip)
2148{
2149 DWORD rc = 0;
2150 int i;
2151
2152 TRACE (("_route_destin (%s)\n", INET_NTOA(ip)));
2153
2154 for (i = 0; i < gate_top; i++)
2155 {
2156 const struct gate_entry *gw = gate_list + i;
2157
2158 TRACE ((" i %d, gw->gate_ip %s, gw->subnet %s, gw->mask %s\n"
2159 " ON_SAME_NETWORK: %d\n", i,
2160 INET_NTOA(gw->gate_ip), INET_NTOA(gw->subnet),
2161 INET_NTOA(gw->mask), ON_SAME_NETWORK(gw->subnet,ip,gw->mask)));
2162#if 0
2163 if (sin_mask != IP_BCAST_ADDR && !is_on_LAN(gw->gate_ip))
2164 continue;
2165 if (!ON_SAME_NETWORK(gw->subnet,ip,gw->mask))
2166 continue;
2167#else
2168 if (((ip ^ gw->subnet) & gw->mask) == 0) /* IP on same subnet as gw->gate_ip */
2169 return (gw->gate_ip);
2170#endif
2171 }
2172// if (rc)
2173 return (rc);
2174// return (is_on_LAN(ip) ? INADDR_ANY : INADDR_NONE);
2175}
2176
2177
2178#include "pcdns.h"
2179#include "pcbuf.h"
2180
2181#if !defined(__DJGPP__)
2182 W32_GCC_PRAGMA (GCC diagnostic ignored "-Wunused-variable")
2183 W32_GCC_PRAGMA (GCC diagnostic ignored "-Wunused-function")
2184
2185 static int num_okay = 0;
2186 static int num_fail = 0;
2187#endif
2188
2189#define TEST(func, args, expect) do { \
2190 HIGH_TEXT(); \
2191 (*_printf) ("%s() ", #func); \
2192 NORM_TEXT(); \
2193 if (func args == expect) { \
2194 num_okay++; \
2195 YELLOW_TEXT(); \
2196 (*_printf) ("OK\n"); \
2197 } else { \
2198 num_fail++; \
2199 RED_TEXT(); \
2200 (*_printf) ("FAIL\n"); \
2201 } \
2202 NORM_TEXT(); \
2203 } while (0)
2204
2205#define TEST_EQUAL(func, args, expect) do { \
2206 int rc; \
2207 HIGH_TEXT(); \
2208 (*_printf) ("%s() ", #func); \
2209 NORM_TEXT(); \
2210 rc = func args; \
2211 if (rc == expect) { \
2212 num_okay++; \
2213 (*_printf) ("OK\n"); \
2214 } else { \
2215 num_fail++; \
2216 (*_printf) ("FAIL. Got %d\n", rc); \
2217 } \
2218 } while (0)
2219
2220#define TEST_ROUTE(dest) do { \
2221 DWORD ip = _route_destin (aton(dest)); \
2222 HIGH_TEXT(); \
2223 (*_printf) ("Best route for %s is %s\n", \
2224 dest, INET_NTOA(ip)); \
2225 NORM_TEXT(); \
2226 } while (0)
2227
2228static void W32_CALL callback (void)
2229{
2230 static char fan[] = "\\|/-";
2231 static int idx = 0;
2232
2233 if (_watt_cbroke)
2234 {
2235 RED_TEXT(); (*_printf) ("^C/^Break detected\n");
2236 NORM_TEXT();
2237 exit (-1);
2238 }
2239 (*_outch) (fan[idx++]);
2240 (*_outch) ('\b');
2241 idx &= 3;
2242}
2243
2244int main (int argc, char **argv)
2245{
2246 sock_type sock;
2247 const char *host = "www.google.com";
2248 int status = 0;
2249 DWORD ip;
2250 char buf[1000];
2251 int len;
2252 mac_address eth1, eth2, eth3;
2253
2254 debug_on = 0;
2255 dbug_init();
2256 sock_init();
2257
2258#if 0
2259// arp_trace_level = 0;
2260 _arp_kill_gateways();
2261
2262 /* Gateway Subnet Mask */
2263 TEST (_arp_add_gateway, ("127.0.0.1, 127.0.0.0, 255.0.0.0", 0UL), TRUE);
2264 TEST (_arp_add_gateway, ("10.0.0.10, 10.0.0.2, 255.255.255.255", 0UL), TRUE); /* special LAN rule */
2265 TEST (_arp_add_gateway, ("10.0.0.1", 0UL), TRUE); /* default route (Class A-mask) */
2266 TEST (_arp_add_gateway, ("10.0.0.4, 162.100.102.0, 255.255.255.248", 0UL), TRUE); /* special route */
2267
2268 arp_gateways_dump();
2269
2270 TEST (legal_mask, (aton("255.255.255.0"), aton("127.0.0.0")), FALSE /*TRUE*/);
2271 TEST (legal_mask, (aton("128.255.255.0"), aton("127.0.0.0")), FALSE);
2272
2273 TEST (check_mask2, ("255.255.255.128"), 1);
2274 TEST (check_mask2, ("255.255.255.127"), 0);
2275 TEST (check_mask2, ("0.0.0.1"), 0);
2276 TEST (check_mask2, ("255.255.255.2"), 0);
2277 TEST (check_mask2, ("255.255.255.254"), 1);
2278 TEST (check_mask2, ("127.255.255.255"), 0);
2279
2280 TEST_EQUAL (mask_len, (aton("255.255.255.0")), 8);
2281 TEST_EQUAL (mask_len, (aton("255.255.0.0")), 16);
2282 TEST_EQUAL (mask_len, (aton("255.0.0.0")), 24);
2283 TEST_EQUAL (mask_len, (aton("0.0.0.0")), 32);
2284
2285 TEST_ROUTE ("10.0.0.1");
2286 TEST_ROUTE ("10.0.0.2");
2287 TEST_ROUTE ("10.0.0.3");
2288 TEST_ROUTE ("11.0.0.1");
2289 TEST_ROUTE ("100.101.102.103");
2290 TEST_ROUTE ("162.100.102.1");
2291 TEST_ROUTE ("127.22.0.5");
2292
2293//arp_trace_level = 4;
2294 TEST (_arp_resolve, (aton("10.0.0.1"), &eth1), TRUE);
2295 (*_printf) (" -> %s\n", MAC_address(&eth1));
2296
2297 TEST (_arp_resolve, (def_nameservers[0], &eth2), TRUE);
2298 (*_printf) (" -> %s\n", MAC_address(&eth2));
2299
2300 TEST (_arp_resolve, (aton("55.44.33.22"), &eth3), TRUE);
2301 (*_printf) (" -> %s\n", MAC_address(&eth3));
2302
2303 TEST (memcmp, (&eth1, &eth2, sizeof(eth1)), 0);
2304 TEST (memcmp, (&eth1, &eth3, sizeof(eth1)), 0);
2305
2306 (*_printf) ("\nTEST RESULT: %d okay, %d fail\n", num_okay, num_fail);
2307
2308 _arp_cache_dump();
2309
2310#else
2311 ip = lookup_host (host, NULL);
2312 if (!ip)
2313 {
2314 printf ("%s", dom_strerror(dom_errno));
2315 return (1);
2316 }
2317 if (tcp_open(&sock.tcp, 0, ip, 80, NULL))
2318 {
2319 sock_yield (&sock.tcp, callback);
2320 sock_wait_established (&sock, sock_delay, NULL, &status);
2321 printf ("Connected. Awaiting response...");
2322 fflush (stdout);
2323 sock_puts (&sock, (const BYTE*)
2324 "GET /index.html HTTP/1.0\r\n"
2325 "User-Agent: pcarp test\r\n\r\n");
2326
2327 while ((len = sock_read(&sock,(BYTE*)buf,sizeof(buf))) > 0)
2328 fwrite (buf, len, 1, stdout);
2329 }
2330
2331sock_err:
2332 if (status == -1)
2333 printf ("Cannot connect to %s: %s\n", host, sockerr(&sock));
2334
2335 ARGSUSED (eth1);
2336 ARGSUSED (eth2);
2337 ARGSUSED (eth3);
2338#endif
2339
2340 ARGSUSED (argc);
2341 ARGSUSED (argv);
2342
2343 return (status);
2344}
2345#endif /* TEST_PROG */
chksum.h
copyrigh.h
ip4_in.h
_default_tos
BYTE _default_tos
Definition: ip4_out.c:53
ip4_out.h
language.h
MAC_address
const char * MAC_address(const void *addr)
Return hexa-decimal string for an 6/7 byte MAC-address.
Definition: misc.c:997
misc.h
_watt_cbroke
volatile int _watt_cbroke
Definition: pc_cbrk.c:48
misc_str.h
aton
DWORD W32_CALL aton(const char *str)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
Definition: netaddr.c:86
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
LAN_lookup_pending
static BOOL LAN_lookup_pending(DWORD ip)
Lookup host in pending list.
Definition: pcarp.c:637
_arp_resolve
BOOL W32_CALL _arp_resolve(DWORD ip, eth_address *eth)
The blocking lookup function visible to higher functions.
Definition: pcarp.c:1278
_arp_add_gateway
BOOL W32_CALL _arp_add_gateway(const char *config_string, DWORD ip)
Add a gateway to the routing table.
Definition: pcarp.c:247
route_lookup_pending
static BOOL route_lookup_pending(DWORD ip)
Returns TRUE if the lookup of the gateway (assigned to the supplied ip) is still pending.
Definition: pcarp.c:940
is_on_LAN
static BOOL is_on_LAN(DWORD ip)
This should probably go into route.c.
Definition: pcarp.c:825
LAN_lookup
static BOOL LAN_lookup(DWORD ip, eth_address *eth)
Lookup host in fixed/dynamic list.
Definition: pcarp.c:613
_arp_kill_gateways
void W32_CALL _arp_kill_gateways(void)
Delete all gateways.
Definition: pcarp.c:373
_arp_cache_add
BOOL W32_CALL _arp_cache_add(DWORD ip, const void *eth, BOOL expires)
Add given IP/Ether address to ARP-cache.
Definition: pcarp.c:1351
_arp_have_default_gw
BOOL W32_CALL _arp_have_default_gw(void)
Check if we have at least one default gateway.
Definition: pcarp.c:382
_arp_lookup_fixed
BOOL W32_CALL _arp_lookup_fixed(DWORD ip, eth_address *eth)
Lookup fixed MAC-address of 'ip'.
Definition: pcarp.c:1218
compare
static int MS_CDECL compare(const struct gate_entry *a, const struct gate_entry *b)
Compare two entries in gateway-list.
Definition: pcarp.c:217
route_start_lookup
static BOOL route_start_lookup(DWORD ip)
Start a route lookup.
Definition: pcarp.c:965
arp_daemon
static void W32_CALL arp_daemon(void)
ARP background daemon.
Definition: pcarp.c:1493
arp_send_request
static BOOL arp_send_request(DWORD ip)
Send broadcast ARP request.
Definition: pcarp.c:466
LAN_start_lookup
static BOOL LAN_start_lookup(DWORD ip)
Start a host lookup on the LAN.
Definition: pcarp.c:539
_arp_lookup
BOOL W32_CALL _arp_lookup(DWORD ip, eth_address *eth)
Lookup MAC-address of 'ip'.
Definition: pcarp.c:1185
arp_send
static BOOL arp_send(const arp_Header *arp, unsigned line)
Low-level ARP send function.
Definition: pcarp.c:455
arp_check_common
static BOOL arp_check_common(DWORD ip, eth_address *eth)
Common stuff for _arp_resolve() and _arp_lookup()
Definition: pcarp.c:1247
_arp_init
void W32_CALL _arp_init(void)
Setup config-table parse function and add background ARP deamon.
Definition: pcarp.c:1546
_arp_debug_dump
void W32_CALL _arp_debug_dump(void)
Debug-dump of configured gateways, route table and ARP cache.
Definition: pcarp.c:1918
_arp_gateways_get
int W32_CALL _arp_gateways_get(const struct gate_entry **rc)
Return start of gate_list[].
Definition: pcarp.c:94
_arp_cache_del
BOOL W32_CALL _arp_cache_del(DWORD ip)
Delete given 'ip' address from ARP-cache (dynamic, fixed or pending).
Definition: pcarp.c:1420
route_lookup
static BOOL route_lookup(DWORD ip, eth_address *eth)
Gets MAC of gateway needed to reach the given host.
Definition: pcarp.c:902
_arp_handler
BOOL W32_CALL _arp_handler(const arp_Header *ah, BOOL brdcast)
Receive ARP handler.
Definition: pcarp.c:1565
_arp_cache_get
int W32_CALL _arp_cache_get(const struct arp_entry **rc)
Return start of arp_list[].
Definition: pcarp.c:527
icmp_id
static WORD icmp_id
Send a ping (with TTL=1) to a gateway.
Definition: pcarp.c:105
_arp_reply
BOOL W32_CALL _arp_reply(const void *e_dst, DWORD src_ip, DWORD dst_ip)
Send unicast/broadcast ARP reply.
Definition: pcarp.c:489
_arp_lookup_pending
BOOL W32_CALL _arp_lookup_pending(DWORD ip)
An ARP-lookup timeout check.
Definition: pcarp.c:1205
_arp_check_gateways
int W32_CALL _arp_check_gateways(void)
Return number of default gateways.
Definition: pcarp.c:1751
_arp_check_own_ip
BOOL W32_CALL _arp_check_own_ip(eth_address *other_guy)
Used by DHCP initialisation.
Definition: pcarp.c:1728
route_check_timeouts
static void route_check_timeouts(BOOL check_dynamic_entries)
Periodic route checker.
Definition: pcarp.c:1045
arp_check_timeouts
static void arp_check_timeouts(BOOL check_dynamic_entries)
Check ARP entries for timeout.
Definition: pcarp.c:664
arp_move_entry
static void arp_move_entry(int to_index, int from_index)
Move an ARP entry from from_index to to_index.
Definition: pcarp.c:517
_arp_register
BOOL W32_CALL _arp_register(DWORD use_this_gateway_ip, DWORD for_this_host_ip)
Register a new host as gateway.
Definition: pcarp.c:842
_arp_start_lookup
BOOL W32_CALL _arp_start_lookup(DWORD ip)
"PUBLIC" ARP/ROUTE FUNCTIONS.
Definition: pcarp.c:1168
pcarp.h
pcbuf.h
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
pcconfig.h
pcdbug.h
pcdhcp.h
dom_strerror
const char *W32_CALL dom_strerror(int err)
Return text for error code (dom_errno).
Definition: pcdns.c:742
pcdns.h
pcicmp.h
_chk_ping
DWORD W32_CALL _chk_ping(DWORD host, DWORD *number)
Check for ICMP echo reply in ping-cache.
Definition: pcping.c:169
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
pcpkt.h
pcqueue.h
_eth_send
int W32_CALL _eth_send(WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
Definition: pcsed.c:301
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
_eth_get_hwtype
BYTE W32_CALL _eth_get_hwtype(BYTE *hwtype, BYTE *hwlen)
Fill in hardware address type/length for BOOTP/DHCP packets.
Definition: pcsed.c:730
_eth_mac_len
BYTE _eth_mac_len
Size of a MAC address.
Definition: pcsed.c:53
_eth_brdcast
mac_address _eth_brdcast
Link-layer broadcast address.
Definition: pcsed.c:50
pcsed.h
pcstat.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
tcp_open
int W32_CALL tcp_open(_tcp_Socket *s, WORD lport, DWORD ip, WORD rport, ProtoHandler handler)
Actively open a TCP connection.
Definition: pctcp.c:328
pctcp.h
sock_ini.h
sock_puts
int W32_CALL sock_puts(sock_type *s, const BYTE *data)
Definition: sock_io.c:39
ICMP_echo
Definition: pcicmp.h:55
ah
Definition: ah.h:45
arp_Header
Definition: wattcp.h:476
arp_entry
Definition: pcarp.h:23
arp_entry::flags
WORD flags
ARP flags, see below.
Definition: pcarp.h:28
arp_entry::ip
DWORD ip
IP address of ARP entry.
Definition: pcarp.h:24
arp_entry::retransmit_to
DWORD retransmit_to
used only for re-requesting MAC while 'pending'
Definition: pcarp.h:27
arp_entry::expiry
DWORD expiry
'pending timeout' or 'dynamic expiry'
Definition: pcarp.h:26
arp_entry::hardware
eth_address hardware
MAC address of ARP entry.
Definition: pcarp.h:25
arp
config_table
Definition: tcp.h:461
gate_entry
Definition: pcarp.h:11
gate_entry::gate_ip
DWORD gate_ip
The IP address of gateway.
Definition: pcarp.h:12
gate_entry::mask
DWORD mask
The netmask fgor the above entry.
Definition: pcarp.h:14
gate_entry::subnet
DWORD subnet
The subnet mask of gateway.
Definition: pcarp.h:13
icmp
Definition: ip_icmp.h:66
in_Header
Definition: wattcp.h:329
ping_pkt
Definition: pcicmp.h:141
route_entry
Definition: pcarp.h:43
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
time_str
const char * time_str(DWORD val)
Return string x.xx for timeout value.
Definition: timer.c:680
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcarp.h Source File

  • src
pcarp.h
Go to the documentation of this file.
1
4#ifndef _w32_PCARP_H
5#define _w32_PCARP_H
6
11struct gate_entry {
12 DWORD gate_ip;
13 DWORD subnet;
14 DWORD mask;
15 BOOL is_dead; /* Dead Gate detection: */
16 BOOL echo_pending; /* echo-reply pending */
17 DWORD chk_timer; /* check interval timer */
18 };
19
23struct arp_entry {
24 DWORD ip;
25 eth_address hardware;
26 DWORD expiry;
27 DWORD retransmit_to;
28 WORD flags;
29 };
30
31
34#define ARP_FLG_INUSE 0x01
35#define ARP_FLG_FIXED 0x02
36#define ARP_FLG_DYNAMIC 0x04
37#define ARP_FLG_PENDING 0x08
43struct route_entry {
44 DWORD host_ip; /* when connection to this host ... */
45 DWORD gate_ip; /* ... we use this gateway */
46 DWORD mask; /* mask used to calculate this route */
47 DWORD flags; /* not used yet */
48 };
49
52#define ROUTE_FLG_USED 0x01
53#define ROUTE_FLG_PENDING 0x02
54#define ROUTE_FLG_DYNAMIC 0x04
55#define ROUTE_FLG_FIXED 0x08
56
57
64W32_FUNC int W32_CALL _arp_gateways_get (const struct gate_entry **);
65W32_FUNC int W32_CALL _arp_check_gateways (void);
66W32_FUNC BOOL W32_CALL _arp_add_gateway (const char* config_string, DWORD ip);
67W32_FUNC BOOL W32_CALL _arp_have_default_gw (void);
68W32_FUNC void W32_CALL _arp_kill_gateways (void);
69
74W32_FUNC BOOL W32_CALL _arp_resolve (DWORD ina, eth_address *eth);
75W32_FUNC BOOL W32_CALL _arp_check_own_ip (eth_address *eth);
76
79W32_FUNC BOOL W32_CALL _arp_start_lookup (DWORD ip);
80W32_FUNC BOOL W32_CALL _arp_lookup (DWORD ip, eth_address *eth);
81W32_FUNC BOOL W32_CALL _arp_lookup_fixed (DWORD ip, eth_address *eth);
82W32_FUNC BOOL W32_CALL _arp_lookup_pending (DWORD ip);
83
86W32_FUNC BOOL W32_CALL _arp_cache_add (DWORD ip, const void *eth, BOOL expire);
87W32_FUNC BOOL W32_CALL _arp_cache_del (DWORD ip);
88W32_FUNC int W32_CALL _arp_cache_get (const struct arp_entry **);
89W32_FUNC void W32_CALL _arp_cache_dump (void);
90W32_FUNC void W32_CALL _arp_gateways_dump (void);
91W32_FUNC void W32_CALL _arp_routes_dump (void);
92W32_FUNC void W32_CALL _arp_debug_dump (void);
93
96W32_FUNC void W32_CALL _arp_init (void);
97W32_FUNC BOOL W32_CALL _arp_reply (const void *mac_dst, DWORD src_ip, DWORD dst_ip);
98W32_FUNC BOOL W32_CALL _arp_handler (const arp_Header *arp, BOOL brdcast);
99
102W32_FUNC BOOL W32_CALL _arp_register (DWORD use_this_gateway_ip, DWORD for_this_host_ip);
103
104#endif
_arp_add_gateway
W32_FUNC BOOL W32_CALL _arp_add_gateway(const char *config_string, DWORD ip)
Add a gateway to the routing table.
Definition: pcarp.c:247
_arp_resolve
W32_FUNC BOOL W32_CALL _arp_resolve(DWORD ina, eth_address *eth)
Blocking ARP resolve functions.
Definition: pcarp.c:1278
_arp_init
W32_FUNC void W32_CALL _arp_init(void)
'Internal' interface to pctcp.c & others.
Definition: pcarp.c:1546
_arp_debug_dump
W32_FUNC void W32_CALL _arp_debug_dump(void)
Debug-dump of configured gateways, route table and ARP cache.
Definition: pcarp.c:1918
_arp_start_lookup
W32_FUNC BOOL W32_CALL _arp_start_lookup(DWORD ip)
New non-blocking functions, GvB 2002-09.
Definition: pcarp.c:1168
_arp_check_own_ip
W32_FUNC BOOL W32_CALL _arp_check_own_ip(eth_address *eth)
Used by DHCP initialisation.
Definition: pcarp.c:1728
_arp_reply
W32_FUNC BOOL W32_CALL _arp_reply(const void *mac_dst, DWORD src_ip, DWORD dst_ip)
Send unicast/broadcast ARP reply.
Definition: pcarp.c:489
_arp_check_gateways
W32_FUNC int W32_CALL _arp_check_gateways(void)
Return number of default gateways.
Definition: pcarp.c:1751
_arp_lookup
W32_FUNC BOOL W32_CALL _arp_lookup(DWORD ip, eth_address *eth)
Lookup MAC-address of 'ip'.
Definition: pcarp.c:1185
_arp_cache_del
W32_FUNC BOOL W32_CALL _arp_cache_del(DWORD ip)
Delete given 'ip' address from ARP-cache (dynamic, fixed or pending).
Definition: pcarp.c:1420
_arp_lookup_pending
W32_FUNC BOOL W32_CALL _arp_lookup_pending(DWORD ip)
An ARP-lookup timeout check.
Definition: pcarp.c:1205
_arp_lookup_fixed
W32_FUNC BOOL W32_CALL _arp_lookup_fixed(DWORD ip, eth_address *eth)
Lookup fixed MAC-address of 'ip'.
Definition: pcarp.c:1218
_arp_cache_get
W32_FUNC int W32_CALL _arp_cache_get(const struct arp_entry **)
Return start of arp_list[].
Definition: pcarp.c:527
_arp_gateways_get
W32_FUNC int W32_CALL _arp_gateways_get(const struct gate_entry **)
Gateway functions.
Definition: pcarp.c:94
_arp_handler
W32_FUNC BOOL W32_CALL _arp_handler(const arp_Header *arp, BOOL brdcast)
Receive ARP handler.
Definition: pcarp.c:1565
_arp_kill_gateways
W32_FUNC void W32_CALL _arp_kill_gateways(void)
Delete all gateways.
Definition: pcarp.c:373
_arp_register
W32_FUNC BOOL W32_CALL _arp_register(DWORD use_this_gateway_ip, DWORD for_this_host_ip)
ICMP redirection.
Definition: pcarp.c:842
_arp_have_default_gw
W32_FUNC BOOL W32_CALL _arp_have_default_gw(void)
Check if we have at least one default gateway.
Definition: pcarp.c:382
_arp_cache_add
W32_FUNC BOOL W32_CALL _arp_cache_add(DWORD ip, const void *eth, BOOL expire)
ARP cache functions.
Definition: pcarp.c:1351
arp_Header
Definition: wattcp.h:476
arp_entry
Definition: pcarp.h:23
arp_entry::flags
WORD flags
ARP flags, see below.
Definition: pcarp.h:28
arp_entry::ip
DWORD ip
IP address of ARP entry.
Definition: pcarp.h:24
arp_entry::retransmit_to
DWORD retransmit_to
used only for re-requesting MAC while 'pending'
Definition: pcarp.h:27
arp_entry::expiry
DWORD expiry
'pending timeout' or 'dynamic expiry'
Definition: pcarp.h:26
arp_entry::hardware
eth_address hardware
MAC address of ARP entry.
Definition: pcarp.h:25
arp
gate_entry
Definition: pcarp.h:11
gate_entry::gate_ip
DWORD gate_ip
The IP address of gateway.
Definition: pcarp.h:12
gate_entry::mask
DWORD mask
The netmask fgor the above entry.
Definition: pcarp.h:14
gate_entry::subnet
DWORD subnet
The subnet mask of gateway.
Definition: pcarp.h:13
route_entry
Definition: pcarp.h:43


Watt-32 tcp/ip: E:/WATT/src/pcbootp.c Source File

  • src
pcbootp.c
Go to the documentation of this file.
1
13#include <stdio.h>
14#include <stdlib.h>
15
16#include "copyrigh.h"
17#include "wattcp.h"
18#include "language.h"
19#include "pcdns.h"
20#include "syslog2.h"
21#include "misc.h"
22#include "misc_str.h"
23#include "timer.h"
24#include "netaddr.h"
25#include "pctcp.h"
26#include "pcsed.h"
27#include "pcarp.h"
28#include "pcconfig.h"
29#include "pcqueue.h"
30#include "pcpkt.h"
31#include "pcbootp.h"
32
33#undef udp_Socket
34
35DWORD _bootp_host = IP_BCAST_ADDR;
36
37#if defined(USE_DHCP)
38 int _bootp_timeout = 15; /* give DHCP a chance also (sock_delay=30) */
39#else
40 int _bootp_timeout = 30;
41#endif
42
43#if defined(USE_BOOTP) /* Rest of file */
44
45static sock_type *boot_sock;
46
47static int bootp_xmit (struct bootp *bootp_out);
48static BOOL bootp_recv (struct bootp *bootp_out, struct bootp *bootp_in);
49static void bootp_parse (const struct bootp *bootp_in, int len);
50
60int BOOTP_do_boot (void)
61{
62 struct bootp bootp_out, bootp_in;
63 struct udp_Socket sock;
64 DWORD save_ip = my_ip_addr;
65 int rc = 0;
66
67 boot_sock = (sock_type*) &sock;
68
69 outs (_LANG("Configuring through BOOTP.."));
70
71 my_ip_addr = 0UL; /* We must use IP address 0.0.0.0 for sending */
72
73 if (!udp_open(&sock,IPPORT_BOOTPC,_bootp_host,IPPORT_BOOTPS,NULL))
74 {
75 outsnl (boot_sock->udp.err_msg);
76 my_ip_addr = save_ip;
77 }
78 else
79 {
80 memset (&bootp_in, 0, sizeof(bootp_in));
81 memset (&bootp_out, 0, sizeof(bootp_out));
82 bootp_xmit (&bootp_out);
83 if (bootp_recv(&bootp_out, &bootp_in))
84 {
85 my_ip_addr = intel (bootp_in.bp_yiaddr);
86 rc = 1;
87 }
88 }
89 sock_close (boot_sock);
90 boot_sock = NULL;
91 outsnl (rc ? "okay" : "failed");
92 return (rc);
93}
94
95static int bootp_xmit (struct bootp *bootp_out)
96{
97 DWORD exchange_id = set_timeout (0); /* "random" exchange ID */
98
99 _eth_get_hwtype (&bootp_out->bp_htype, &bootp_out->bp_hlen);
100
101 bootp_out->bp_op = BOOTP_REQUEST;
102 bootp_out->bp_xid = exchange_id;
103 bootp_out->bp_secs = intel16 (((WORD)exchange_id & 7) + 7);
104 *(DWORD*) &bootp_out->bp_vend = intel (VM_RFC1048); /* Magic Number */
105
106 memcpy (&bootp_out->bp_chaddr, _eth_addr, _eth_mac_len);
107 return sock_fastwrite (boot_sock, (BYTE*)bootp_out, sizeof(*bootp_out));
108}
109
110static BOOL bootp_recv (struct bootp *bootp_out, struct bootp *bootp_in)
111{
112 DWORD exchange_id = bootp_out->bp_xid;
113 DWORD boot_timer = set_timeout (1000 * _bootp_timeout);
114
115 while (1)
116 {
117 DWORD vendor;
118 int len;
119
120 WATT_YIELD();
121
122 if (chk_timeout(boot_timer) || !tcp_tick(boot_sock))
123 return (FALSE);
124
125 if (sock_dataready(boot_sock) < sizeof(*bootp_in))
126 continue;
127
128 /* got a response, lets consider it
129 */
130 memset (bootp_in, 0, sizeof(*bootp_in));
131 len = sock_fastread (boot_sock, (BYTE*)bootp_in, sizeof(*bootp_in));
132 if (len < BOOTP_MIN_SIZE ||
133 bootp_in->bp_op != BOOTP_REPLY)
134 continue;
135
136 /* Check if transaction ID and MAC-address matches
137 */
138 if (bootp_in->bp_xid != exchange_id ||
139 memcmp(&bootp_in->bp_chaddr, _eth_addr, _eth_mac_len))
140 continue;
141
142 vendor = intel (*(DWORD*)&bootp_in->bp_vend);
143 if (vendor == VM_RFC1048)
144 bootp_parse (bootp_in, len);
145 break;
146 }
147 return (TRUE);
148}
149
150/*
151 * Parse RFC1048 compliant BOOTP vendor field.
152 * Based heavily on NCSA Telnet BOOTP
153 */
154static void bootp_parse (const struct bootp *bootp_in, int max)
155{
156 const BYTE *p = &bootp_in->bp_vend[4]; /* Point after magic value */
157 const BYTE *end = max + (const BYTE*)bootp_in;
158 BOOL got_end = FALSE;
159
160 while (!got_end && p < end)
161 {
162 DWORD ip;
163 int i, len;
164
165 switch (*p)
166 {
167 case BOOTP_OPT_PAD:
168 p++;
169 continue;
170
171 case BOOTP_OPT_SUBNET_MASK:
172 sin_mask = intel (*(DWORD*)(p+2));
173 break;
174
175 case BOOTP_OPT_ROUTERS_ON_SNET:
176 /* only add first */
177 ip = intel (*(DWORD*)(p+2));
178 _arp_add_gateway (NULL, ip);
179 break;
180
181 case BOOTP_OPT_DNS_SRV:
182 for (i = 0; i < *(p+1); i += sizeof(ip))
183 {
184 ip = intel (*(DWORD*)(p+2+i));
185 _add_server (&last_nameserver, def_nameservers,
186 DIM(def_nameservers), ip);
187 }
188 break;
189
190 case BOOTP_OPT_COOKIE_SRV:
191 for (i = 0; i < *(p+1) ; i += sizeof(ip))
192 {
193 ip = intel (*(DWORD*)(p+2+i));
194 _add_server (&last_cookie, Cookies, DIM(Cookies), ip);
195 }
196 break;
197
198#if defined(USE_BSD_API)
199 case BOOTP_OPT_LOG_SRV:
200 ip = intel (*(DWORD*)(p+2)); /* select 1st host */
201 if (!syslog_host_name[0] && /* not in config-file */
202 p[1] % 4 == 0) /* length = n * 4 */
203 _strlcpy (syslog_host_name, _inet_ntoa(NULL,ip),
204 sizeof(syslog_host_name));
205 break;
206#endif
207
208 case BOOTP_OPT_HOST_NAME:
209 len = min (p[1], sizeof(hostname));
210 memcpy (&hostname[0], p+2, len);
211 hostname[len] = '\0';
212 break;
213
214 case BOOTP_OPT_NAME_SRV: /* IEN-116 name server */
215 case BOOTP_OPT_LPR_SRV:
216 case BOOTP_OPT_IMPRESS_SRV:
217 case BOOTP_OPT_RES_LOCATION_SRV:
218 case BOOTP_OPT_TIME_SRV:
219 case BOOTP_OPT_TIME_OFFSET:
220 break;
221
222 case BOOTP_OPT_END:
223 got_end = TRUE;
224 break;
225
226 default:
227 break;
228 }
229 p += *(p+1) + 2;
230 }
231}
232#endif /* USE_BOOTP */
233
copyrigh.h
language.h
misc.h
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
_arp_add_gateway
BOOL W32_CALL _arp_add_gateway(const char *config_string, DWORD ip)
Add a gateway to the routing table.
Definition: pcarp.c:247
pcarp.h
BOOTP_do_boot
int BOOTP_do_boot(void)
Main BOOTP initialisation.
Definition: pcbootp.c:60
pcbootp.h
pcconfig.h
pcdns.h
pcpkt.h
pcqueue.h
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
_eth_get_hwtype
BYTE W32_CALL _eth_get_hwtype(BYTE *hwtype, BYTE *hwlen)
Fill in hardware address type/length for BOOTP/DHCP packets.
Definition: pcsed.c:730
_eth_mac_len
BYTE _eth_mac_len
Size of a MAC address.
Definition: pcsed.c:53
pcsed.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
hostname
char hostname[MAX_HOSTLEN+1]
Our configured hostname.
Definition: pctcp.c:58
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
udp_open
int W32_CALL udp_open(_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP active open.
Definition: pctcp.c:262
pctcp.h
sock_dataready
WORD W32_CALL sock_dataready(sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
Definition: sock_io.c:246
bootp
Definition: pcbootp.h:57
udp_Socket
ARP definitions.
Definition: tcp.h:87
syslog2.h
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcbootp.h Source File

  • src
pcbootp.h
Go to the documentation of this file.
1
7#ifndef _w32_PCBOOTP_H
8#define _w32_PCBOOTP_H
9
10extern DWORD _bootp_host;
11extern int _bootp_timeout;
12
13extern int BOOTP_do_boot (void);
14
15#define BOOTP_REQUEST 1
16#define BOOTP_REPLY 2
17
18/*
19 * BOOTP options and values.
20 */
21enum BOOTP_Options {
22 BOOTP_OPT_PAD = 0,
23 BOOTP_OPT_SUBNET_MASK = 1,
24 BOOTP_OPT_TIME_OFFSET = 2,
25 BOOTP_OPT_ROUTERS_ON_SNET = 3,
26 BOOTP_OPT_TIME_SRV = 4,
27 BOOTP_OPT_NAME_SRV = 5,
28 BOOTP_OPT_DNS_SRV = 6,
29 BOOTP_OPT_LOG_SRV = 7,
30 BOOTP_OPT_COOKIE_SRV = 8,
31 BOOTP_OPT_LPR_SRV = 9,
32 BOOTP_OPT_IMPRESS_SRV = 10,
33 BOOTP_OPT_RES_LOCATION_SRV = 11,
34 BOOTP_OPT_HOST_NAME = 12,
35 BOOTP_OPT_BOOT_FSIZE = 13,
36 BOOTP_OPT_DOMAIN_NAME = 15,
37 BOOTP_OPT_NON_LOCAL_SRC_ROUTE = 20,
38 BOOTP_OPT_POLICY_FILTER = 21,
39 BOOTP_OPT_MAX_DGRAM_REASM_SIZE = 22,
40 BOOTP_OPT_IP_DEFAULT_TTL = 23,
41 BOOTP_OPT_PATH_MTU_AGING_TIMEOUT = 24,
42 BOOTP_OPT_PATH_MTU_PLATEAU_TABLE = 25,
43 BOOTP_OPT_IF_MTU = 26,
44 BOOTP_OPT_ALL_SUBNETS_LOCAL = 27,
45 BOOTP_OPT_BROADCAST_ADDR = 28,
46 BOOTP_OPT_PERFORM_MASK_DISCOVERY = 29,
47 BOOTP_OPT_MASK_SUPPLIER = 30,
48 BOOTP_OPT_PERFORM_ROUTER_DISCOVERY = 31,
49 BOOTP_OPT_ROUTER_SOLICITATION_ADDR = 32,
50 BOOTP_OPT_STATIC_ROUTE = 33,
51 BOOTP_OPT_TRAILER_ENCAPSULATION = 34,
52 BOOTP_OPT_ARP_CACHE_TIMEOUT = 35,
53 BOOTP_OPT_ETHERNET_ENCAPSULATION = 36,
54 BOOTP_OPT_END = 255,
55 };
56
57W32_CLANG_PACK_WARN_OFF()
58
59#include <sys/pack_on.h>
60
65struct bootp {
66 BYTE bp_op; /* packet op code / message type. */
67 BYTE bp_htype; /* hardware address type, 1 = 10 mb ethernet */
68 BYTE bp_hlen; /* hardware address len, eg '6' for 10mb eth */
69 BYTE bp_hops; /* client sets to zero, optionally used by */
70 /* gateways in cross-gateway booting. */
71 DWORD bp_xid; /* transaction ID, a random number */
72 WORD bp_secs; /* filled in by client, seconds elapsed */
73 /* since client started trying to boot. */
74 WORD bp_spare;
75 DWORD bp_ciaddr; /* client IP address filled by client if known */
76 DWORD bp_yiaddr; /* 'your' (client) IP address */
77 /* filled by server if client doesn't know */
78 DWORD bp_siaddr; /* server IP address returned in bootreply */
79 DWORD bp_giaddr; /* gateway IP address, */
80 /* used in optional cross-gateway booting. */
81 BYTE bp_chaddr[16]; /* client hardware address, filled by client */
82 BYTE bp_sname[64]; /* optional server host name, null terminated*/
83
84 BYTE bp_file[128]; /* boot file name, null terminated string */
85 /* 'generic' name or null in bootrequest, */
86 /* fully qualified directory-path */
87 /* name in bootreply. */
88 BYTE bp_vend[64]; /* optional vendor-specific area */
89 };
90
91#define BOOTP_MIN_SIZE 44
92
93/*
94 * UDP port numbers, server and client.
95 */
96#define IPPORT_BOOTPS 67
97#define IPPORT_BOOTPC 68
98
99
100/******** the following is stolen from NCSA which came from CUTCP *********/
101/* I have not implemented these, but someone may wish to in the future so */
102/* I kept them around. */
103/**************************************************************************/
104
109struct bootp_vend {
110 BYTE v_magic[4]; /* magic number */
111 DWORD v_flags; /* flags/opcodes, etc. */
112 BYTE v_unused[56]; /* currently unused */
113 };
114
115#include <sys/pack_off.h>
116
117W32_CLANG_PACK_WARN_DEF()
118
119#define VM_STANFORD 0x5354414EUL /* v_magic for Stanford ("STAN") */
120#define VM_RFC1048 0x63825363UL /* v_magic for RFC client/servers */
121
122/*
123 * 'v_flags' values.
124 */
125#define VF_PCBOOT 1 /* an IBMPC or Mac wants environment info */
126#define VF_HELP 2 /* help me, I'm not registered */
127#define TAG_BOOTFILE_SIZE 13 /* tag used by bootp_vend fields, RFC 1048 */
128
129#endif
pack_off.h
BOOTP_do_boot
int BOOTP_do_boot(void)
Main BOOTP initialisation.
Definition: pcbootp.c:60
bootp_vend
Definition: pcbootp.h:109
bootp
Definition: pcbootp.h:57


Watt-32 tcp/ip: E:/WATT/src/pcbuf.c Source File

  • src
pcbuf.c
Go to the documentation of this file.
1
5#include <stdio.h>
6#include <stdlib.h>
7#include <string.h>
8#include <limits.h>
9
10#include "copyrigh.h"
11#include "wattcp.h"
12#include "language.h"
13#include "misc.h"
14#include "misc_str.h"
15#include "pctcp.h"
16#include "pcdbug.h"
17#include "pcbuf.h"
18
19#if defined(USE_BSD_API)
20static int num_free_raw (const _raw_Socket *raw)
21{
22 int num;
23
24 for (num = 0; raw; raw = raw->next)
25 if (!raw->used)
26 num++;
27 return (num);
28}
29#endif
30
31#if defined(USE_IPV6)
32static int num_free_raw6 (const _raw6_Socket *raw)
33{
34 int num;
35
36 for (num = 0; raw; raw = raw->next)
37 if (!raw->used)
38 num++;
39 return (num);
40}
41#endif
42
43
44size_t W32_CALL sock_rbsize (const sock_type *s)
45{
46 switch (_chk_socket(s))
47 {
48 case VALID_IP4:
49 return (sizeof(s->raw.ip) + sizeof(s->raw.rx_data));
50#if defined(USE_IPV6)
51 case VALID_IP6:
52 return (sizeof(s->raw6.ip6) + sizeof(s->raw6.rx_data));
53#endif
54 case VALID_UDP:
55 return (s->udp.max_rx_data);
56 case VALID_TCP:
57 return (s->tcp.max_rx_data);
58 }
59 return (0);
60}
61
62size_t W32_CALL sock_rbused (const sock_type *s)
63{
64 switch (_chk_socket(s))
65 {
66#if defined(USE_BSD_API)
67 case VALID_IP4:
68 {
69 const _raw_Socket *raw = find_oldest_raw (&s->raw);
70 return (raw ? intel16 (raw->ip.length) : 0);
71 }
72#if defined(USE_IPV6)
73 case VALID_IP6:
74 {
75 const _raw6_Socket *raw = find_oldest_raw6 (&s->raw6);
76 return (raw ? intel16 (raw->ip6.len) : 0);
77 }
78#endif
79#endif
80 case VALID_UDP:
81 return (s->udp.rx_datalen);
82 case VALID_TCP:
83 return (s->tcp.rx_datalen);
84 }
85 return (0);
86}
87
88size_t W32_CALL sock_rbleft (const sock_type *s)
89{
90 switch (_chk_socket(s))
91 {
92#if defined(USE_BSD_API)
93 case VALID_IP4:
94 return num_free_raw (&s->raw) *
95 (sizeof(s->raw.ip) + sizeof(s->raw.rx_data));
96#if defined(USE_IPV6)
97 case VALID_IP6:
98 return num_free_raw6 (&s->raw6) *
99 (sizeof(s->raw6.ip6) + sizeof(s->raw6.rx_data));
100#endif
101#endif
102 case VALID_UDP:
103 return (s->tcp.max_rx_data - s->udp.rx_datalen);
104 case VALID_TCP:
105 return (s->tcp.max_rx_data - s->tcp.rx_datalen);
106 }
107 return (0);
108}
109
110size_t W32_CALL sock_tbsize (const sock_type *s)
111{
112 switch (_chk_socket(s))
113 {
114 case VALID_IP4:
115 case VALID_IP6:
116 return (_mtu);
117 case VALID_TCP:
118 return (s->tcp.max_tx_data);
119 case VALID_UDP:
120 return (_mtu - UDP_OVERHEAD);
121 }
122 return (0);
123}
124
125size_t W32_CALL sock_tbleft (const sock_type *s)
126{
127 switch (_chk_socket(s))
128 {
129 case VALID_IP4:
130 case VALID_IP6:
131 return (_mtu);
132 case VALID_TCP:
133 return (s->tcp.max_tx_data - s->tcp.tx_datalen - 1);
134 case VALID_UDP:
135 return (_mtu - UDP_OVERHEAD);
136 }
137 return (0);
138}
139
140size_t W32_CALL sock_tbused (const sock_type *s)
141{
142 if (_chk_socket(s) == VALID_TCP)
143 return (s->tcp.tx_datalen);
144 return (0);
145}
146
147/*
148 * Sets new buffer for Rx-data (for udp/tcp).
149 * Set debug-marker in front and at end of buffer.
150 * \note does not copy the old content over to new buffer.
151 */
152size_t W32_CALL sock_setbuf (sock_type *s, BYTE *rx_buf, size_t rx_len)
153{
154 int type = _chk_socket (s);
155
156 /* Raw-sockets use fixed buffer
157 */
158 if (!type || type == VALID_IP4 || type == VALID_IP6)
159 return (0);
160
161 if (rx_len < 8 || !rx_buf)
162 {
163 if (type == VALID_TCP)
164 {
165 s->tcp.rx_data = &s->tcp.rx_buf[0];
166 s->tcp.max_rx_data = sizeof(s->tcp.rx_buf) - 1;
167 }
168 else /* type == VALID_UDP */
169 {
170 s->udp.rx_data = &s->udp.rx_buf[0];
171 s->udp.max_rx_data = sizeof(s->udp.rx_buf) - 1;
172 }
173 }
174 else
175 {
176 size_t len = min (rx_len, USHRT_MAX-1) - 8;
177
178 *(DWORD*)rx_buf = SAFETY_TCP;
179 *(DWORD*)(rx_buf+4+len) = SAFETY_TCP;
180 s->tcp.rx_data = rx_buf + 4;
181 s->tcp.max_rx_data = (UINT) (len - 1);
182 }
183 return (s->tcp.max_rx_data);
184}
185
186#if defined(USE_DEBUG)
187/*
188 * Check the Rx-buffer marker signatures of Rx/Tx-buffers.
189 * Rx-buffer may have been allocated in above sock_setbuf().
190 * Tx-buffer may have been allocated in tcp_set_window().
191 * Only usable for TCP sockets.
192 */
193void _sock_check_tcp_buffers (const _tcp_Socket *tcp)
194{
195 const BYTE *rx, *tx;
196
197 if (tcp->ip_type != TCP_PROTO) /* should already be true */
198 return;
199
200 rx = tcp->rx_data;
201 tx = tcp->tx_data;
202
203 WATT_ASSERT (tcp->safetysig == SAFETY_TCP);
204 WATT_ASSERT (tcp->safetytcp == SAFETY_TCP);
205
206#if (DOSX)
207 WATT_ASSERT (valid_addr(rx, tcp->max_rx_data));
208 WATT_ASSERT (valid_addr(tx, tcp->max_tx_data));
209#endif
210
211 if (rx != &tcp->rx_buf[0])
212 {
213 WATT_ASSERT (*(DWORD*)(rx-4) == SAFETY_TCP);
214 WATT_ASSERT (*(DWORD*)(rx+1+tcp->max_rx_data) == SAFETY_TCP);
215 }
216 if (tx != &tcp->tx_buf[0])
217 {
218 WATT_ASSERT (*(DWORD*)(tx-4) == SAFETY_TCP);
219 WATT_ASSERT (*(DWORD*)(tx+1+tcp->max_tx_data) == SAFETY_TCP);
220 }
221}
222
223void _sock_check_udp_buffers (const _udp_Socket *udp)
224{
225 ARGSUSED (udp); /* \todo */
226}
227#endif
228
229
230int W32_CALL sock_preread (const sock_type *s, BYTE *buf, int len)
231{
232 int count;
233 int type = _chk_socket (s);
234
235 /* Raw-sockets use fixed buffer
236 */
237 if (!type || type == VALID_IP4 || type == VALID_IP6)
238 return (0);
239
240 count = s->tcp.rx_datalen;
241 if (count < 1)
242 return (count);
243
244 if (count > len)
245 count = len;
246 if (buf)
247 memcpy (buf, s->tcp.rx_data, count);
248 return (count);
249}
250
251/*
252 * chk_socket - determine whether a real socket or not
253 */
254int W32_CALL _chk_socket (const sock_type *s)
255{
256 if (!s)
257 return (0);
258
259 if (s->tcp.ip_type == TCP_PROTO && s->tcp.state <= tcp_StateCLOSED)
260 return (VALID_TCP);
261
262 if (s->udp.ip_type == UDP_PROTO)
263 return (VALID_UDP);
264
265 if (s->raw.ip_type == IP4_TYPE)
266 return (VALID_IP4);
267
268 if (s->raw6.ip_type == IP6_TYPE)
269 return (VALID_IP6);
270
271 return (0);
272}
273
274const char *W32_CALL sockerr (const sock_type *s)
275{
276 if (s && s->tcp.err_msg)
277 return (s->tcp.err_msg);
278 return (NULL);
279}
280
281void W32_CALL sockerr_clear (sock_type *s)
282{
283 if (s)
284 {
285 s->tcp.err_msg = NULL;
286 s->tcp.err_buf[0] = '\0';
287 }
288}
289
290const char *W32_CALL sockstate (const sock_type *s)
291{
292 switch (_chk_socket(s))
293 {
294 case VALID_IP4:
295 return (_LANG("Raw IPv4 Socket"));
296
297 case VALID_IP6:
298 return (_LANG("Raw IPv6 Socket"));
299
300 case VALID_UDP:
301 return (_LANG("UDP Socket"));
302
303 case VALID_TCP:
304 return (_LANG(tcpStateName(s->tcp.state)));
305
306 default:
307 return (_LANG("Not an active socket"));
308 }
309}
310
311#if defined(USE_BSD_API)
312const _raw_Socket *find_oldest_raw (const _raw_Socket *raw)
313{
314 const _raw_Socket *s;
315
316 for (s = raw; raw; raw = raw->next)
317 {
318 if (raw->used && raw->seq_num < s->seq_num)
319 s = raw;
320 }
321 return (s->used ? s : NULL);
322}
323
324#if defined(USE_IPV6)
325const _raw6_Socket *find_oldest_raw6 (const _raw6_Socket *raw)
326{
327 const _raw6_Socket *s;
328
329 for (s = raw; raw; raw = raw->next)
330 {
331 if (raw->used && raw->seq_num < s->seq_num)
332 s = raw;
333 }
334 return (s->used ? s : NULL);
335}
336#endif
337#endif
338
copyrigh.h
language.h
misc.h
misc_str.h
pcbuf.h
pcdbug.h
pctcp.h
_raw6_Socket
Definition: wattcp.h:679
_raw_Socket
Definition: wattcp.h:665
_raw_Socket::used
BOOL used
used flag; packet not read yet
Definition: wattcp.h:668
_raw_Socket::seq_num
DWORD seq_num
counter for finding oldest pkt
Definition: wattcp.h:669
_raw_Socket::ip_type
WORD ip_type
same ofs as for udp/tcp Socket
Definition: wattcp.h:667
_raw_Socket::rx_data
BYTE rx_data[MAX_FRAG_SIZE]
room for 1 jumbo IP packet
Definition: wattcp.h:671
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::safetytcp
DWORD safetytcp
extra magic marker
Definition: wattcp.h:657
tcp_Socket::tx_datalen
UINT tx_datalen
number of bytes of data to send
Definition: wattcp.h:652
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
tcp_Socket::tx_data
BYTE * tx_data
Tx data buffer (default tx_buf[])
Definition: wattcp.h:654
tcp_Socket::safetysig
DWORD safetysig
magic marker
Definition: wattcp.h:656
tcp_Socket::rx_buf
BYTE rx_buf[tcp_MaxBufSize+1]
received data buffer
Definition: wattcp.h:588
tcp_Socket::tx_buf
BYTE tx_buf[tcp_MaxTxBufSize+1]
data for transmission
Definition: wattcp.h:655
tcp_Socket::max_tx_data
UINT max_tx_data
Last index for tx_data[].
Definition: wattcp.h:653
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcbuf.h Source File

  • src
pcbuf.h
Go to the documentation of this file.
1
3#ifndef _w32_PCBUF_H
4#define _w32_PCBUF_H
5
6#if 0
7#define VALID_UDP 1
8#define VALID_TCP 2
9#define VALID_IP4 3
10#define VALID_IP6 4
11#endif
12
13extern void _sock_check_tcp_buffers (const _tcp_Socket *tcp);
14extern void _sock_check_udp_buffers (const _udp_Socket *udp);
15
16extern const _raw_Socket *find_oldest_raw (const _raw_Socket *raw);
17
18#if defined(USE_IPV6)
19extern const _raw6_Socket *find_oldest_raw6 (const _raw6_Socket *raw);
20#endif
21
22#endif
23
_raw6_Socket
Definition: wattcp.h:679
_raw_Socket
Definition: wattcp.h:665
tcp_Socket
Definition: wattcp.h:584


Watt-32 tcp/ip: E:/WATT/src/pcconfig.c Source File

  • src
pcconfig.c
Go to the documentation of this file.
1
6#include <stdio.h>
7#include <stdlib.h>
8#include <io.h>
9#include <ctype.h>
10#include <string.h>
11#include <limits.h>
12#include <fcntl.h>
13#include <arpa/inet.h>
14
15#include "copyrigh.h"
16#include "wattcp.h"
17#include "misc.h"
18#include "misc_str.h"
19#include "timer.h"
20#include "language.h"
21#include "pcdns.h"
22#include "netaddr.h"
23#include "bsdname.h"
24#include "pcqueue.h"
25#include "pcdbug.h"
26#include "pcsed.h"
27#include "pcpkt.h"
28#include "pctcp.h"
29#include "pcarp.h"
30#include "pcrarp.h"
31#include "pcdhcp.h"
32#include "pcbootp.h"
33#include "pcicmp.h"
34#include "sock_ini.h"
35#include "ip4_frag.h"
36#include "ip4_out.h"
37#include "ip6_out.h"
38#include "loopback.h"
39#include "get_xby.h"
40#include "printk.h"
41#include "profile.h"
42#include "pcconfig.h"
43
44#if defined(USE_IPV6)
45#include "pcicmp6.h"
46#include "teredo64.h"
47#endif
48
49#if (DOSX & DJGPP)
50 #include <crt0.h>
51#endif
52
53#if (DOSX & PHARLAP)
54 #include <hw386.h>
55#endif
56
57#if defined(__BORLANDC__)
58 #pragma warn -pro
59#endif
60
61
62int debug_on = 0; /* general debug level */
63int ctrace_on = 0; /* tracing; on/off (High-C only) */
64int sock_delay = 30;
65int sock_inactive = 0; /* defaults to forever */
66int sock_data_timeout = 0; /* timeout sending no data (forever) */
67WORD multihomes = 0; /* We have more than 1 IP-addresses */
68BOOL dynamic_host = 0; /* Reverse resolve assigned IP to true FQDN */
69int stkwalk_details = 1; /* Win: simple (1) or detailed(2) stack-trace. */
70 /* Effective only with USE_STACKWALKER. */
71
72DWORD Cookies [MAX_COOKIES];
73WORD last_cookie = 0;
74
75static void deprecated_key (const char *old_key, const char *new_key);
76static void W32_CALL keyword_not_found (const char *key, const char *value);
77
78void (W32_CALL *print_hook) (const char*) = NULL;
79void (W32_CALL *usr_init) (const char*, const char*) = keyword_not_found;
80
83void (W32_CALL *usr_post_init) (void) = NULL;
84
85static char *config_name = (char*) "WATTCP.CFG"; /* name of config file */
86static char *current_file = NULL;
87static UINT current_line = 0;
88static BOOL got_eol = FALSE; /* got end-of-line in 'current_line' */
89
90static const char *environ_names[] = {
91 "WATTCP.CFG", /* pointer to config-file */
92 "WATTCP_CFG" /* ditto, for bash */
93 };
94
95enum ParseMode {
96 ModeKeyword = 0,
97 ModeValue,
98 ModeComment
99 };
100
101#if defined(USE_DEBUG)
102 #define CONFIG_DBG_MSG(lvl, args) \
103 do { \
104 if (debug_on >= lvl) { \
105 UINT line = got_eol ? current_line : current_line+1; \
106 if (current_file) \
107 (*_printf) ("%s (%u): ", current_file, line); \
108 else (*_printf) ("CONFIG: "); \
109 (*_printf) args; \
110 fflush (stdout); \
111 } \
112 } while (0)
113
114 static const char *type_name (int type)
115 {
116 return (type == ARG_ATOI ? "ATOI " :
117 type == ARG_ATOB ? "ATOB " :
118 type == ARG_ATOW ? "ATOW " :
119 type == ARG_ATOIP ? "ATOIP " :
120 type == ARG_ATOX_B ? "ATOX_B " :
121 type == ARG_ATOX_W ? "ATOX_W " :
122 type == ARG_FUNC ? "FUNC " :
123 type == ARG_RESOLVE ? "RESOLVE" :
124 type == ARG_STRDUP ? "STRDUP " :
125 type == ARG_STRCPY ? "STRCPY " : "??");
126 }
127
128 #define RANGE_CHECK(val, low, high) \
129 do { \
130 if (((val) < (low)) || ((val) > (high))) \
131 CONFIG_DBG_MSG (0, ("Value %ld exceedes range [%d - %d]\n", \
132 val, low, high)); \
133 } while (0)
134#else
135 #define CONFIG_DBG_MSG(lvl, args) ((void)0)
136 #define RANGE_CHECK(val, low, high) ((void)0)
137#endif
138
139
140#if defined(USE_BSD_API)
141 /*
142 * Since ARG_FUNC handlers expect the calling-convention specified
143 * in the makefile, we must call the get_xby.h functions via these
144 * small stub-functions.
145 * Some makefiles can specify '-Gr' (fastcall for MSVC) and not
146 * W32_CALL which normally is 'cdecl'.
147 */
148 #define FUNC_TO_W32CALL(func) static void _##func (const char *fname) { func (fname); }
149
150 FUNC_TO_W32CALL (ReadHostsFile)
151 FUNC_TO_W32CALL (ReadServFile)
152 FUNC_TO_W32CALL (ReadProtoFile)
153 FUNC_TO_W32CALL (ReadNetworksFile)
154 FUNC_TO_W32CALL (InitEthersFile)
155#if defined(USE_IPV6)
156 FUNC_TO_W32CALL (ReadHosts6File)
157#endif
158#endif
159
160/*
161 * Set 'debug_on' if not already set before tcp_config() called.
162 */
163static void set_debug_on (const char *value)
164{
165 if (debug_on == 0)
166 debug_on = ATOI (value);
167}
168
173static void set_ethip (const char *value)
174{
175 eth_address eth;
176 const char *trailer = _inet_atoeth (value, &eth);
177 DWORD ip4;
178
179 if (!trailer)
180 return;
181
182 ip4 = _inet_addr (trailer);
183
184 /* Don't add our MAC/IP-address
185 */
186 if (!memcmp (&eth, _eth_real_addr, sizeof(eth)))
187 return;
188
189 if (!ip4)
190 {
191#if defined(USE_IPV6)
192 const void *ip6 = _inet6_addr (trailer);
193 if (ip6)
194 icmp6_ncache_insert_fix (ip6, &eth);
195#endif
196 return;
197 }
198
199 /* Add IPv4-addr to ARP-cache.
200 */
201 _arp_cache_add (ip4, (const eth_address*)&eth, FALSE);
202}
203
204void _add_server (WORD *counter, DWORD *array, int array_dim, DWORD value)
205{
206 if (value && *counter < array_dim)
207 {
208 int i, duplicate = 0;
209
210 for (i = 0; i < *counter; i++)
211 if (array[i] == value)
212 {
213 duplicate = 1;
214 TRACE_CONSOLE (3, "value %lu duplicated in array %p\n", (u_long)value, array);
215 }
216
217 if (!duplicate)
218 array [(*counter)++] = value;
219 }
220 if (*counter >= array_dim)
221 TRACE_CONSOLE (1, "array %p to small\n", array);
222}
223
234const char *expand_var_str (const char *str)
235{
236 static char buf [MAX_PATHLEN+MAX_VALUELEN+1];
237 char env [30];
238 const char *e, *p = strstr (str, "$(");
239 const char *dollar = p;
240 size_t i;
241
242 if (!p || strlen(p) < 4 || !strchr(p+3, ')')) /* minimum "$(x)" */
243 return (str);
244
245 for (i = 0, p += 2; i < sizeof(env)-1; i++)
246 {
247 if (*p == ')')
248 break;
249 env[i] = *p++;
250 }
251 env[i] = '\0';
252 strupr (env);
253 e = getenv (env);
254 if (!e)
255 {
256 e = env;
257 env[0] = '\0';
258 }
259
260 i = dollar - str;
261 strncpy (buf, str, i);
262 buf[i] = '\0';
263 strncat (buf, e, sizeof(buf)-1-i);
264 return strcat (buf, p+1);
265}
266
267const char *_w32_ExpandVarStr (const char *str)
268{
269 return expand_var_str (str);
270}
271
276static void W32_CALL keyword_not_found (const char *key, const char *value)
277{
278 CONFIG_DBG_MSG (2, ("unhandled key/value: \"%s = %s\"\n", key, value));
279 ARGSUSED (key);
280 ARGSUSED (value);
281}
282
288static BOOL set_value (BOOL is_hex, const char *value, void *arg, int size)
289{
290 long val = 0;
291 BOOL ok = FALSE;
292 const char *s = value;
293
294#if (DOSX)
295 if (is_hex)
296 ok = (sscanf(s, "0x%8lX", &val) == 1 || sscanf(s, "x%8lX", &val) == 1);
297 if (!ok)
298 ok = (sscanf(s, "%10ld", &val) == 1); /* "2147483647"; 10 digits */
299#else
300 if (is_hex)
301 {
302 int ch, len = 0;
303
304 if (s[0] == '0' && s[1] == 'x' && strlen(s) >= 4)
305 {
306 len += 2;
307 s += 2;
308 }
309 else if (s[0] == 'x' && strlen(s) >= 3)
310 {
311 len++;
312 s++;
313 }
314
315 ch = toupper (*s);
316 if (len > 0 && strchr(hex_chars_upper, ch))
317 {
318 val = atox (s-2);
319 if (strlen(s) >= 4)
320 val = (val << 8) + atox (s);
321 if (strlen(s) >= 6)
322 val = (val << 8) + atox (s+2);
323 if (strlen(s) >= 8)
324 val = (val << 8) + atox (s+4);
325 ok = TRUE;
326 }
327 }
328 if (!ok)
329 {
330 val = ATOI (value);
331 ok = TRUE; /* could be unconvertable */
332 }
333#endif
334
335 if (!ok)
336 {
337 CONFIG_DBG_MSG (0, ("failed to match `%s' as %sdecimal.\n",
338 s, is_hex ? "hex or " : ""));
339 return (FALSE);
340 }
341
342 CONFIG_DBG_MSG (4, ("got value %ld/%#lx from `%s'\n",
343 val, val, value));
344 switch (size)
345 {
346 case 1:
347 RANGE_CHECK (val, 0, UCHAR_MAX);
348 *(BYTE*)arg = (BYTE) min (val, UCHAR_MAX);
349 break;
350 case 2:
351#if (DOSX == 0)
352 RANGE_CHECK (val, INT_MIN, INT_MAX);
353 *(int*)arg = (int) min (max(val, INT_MIN), INT_MAX);
354#else
355 RANGE_CHECK (val, 0, (int)USHRT_MAX);
356 *(WORD*)arg = (WORD) min (val, USHRT_MAX);
357#endif
358 break;
359 case 4:
360 *(DWORD*)arg = (DWORD)val;
361 break;
362
363 default:
364#if (DOSX)
365 if (!valid_addr(arg, sizeof(int)))
366 {
367 CONFIG_DBG_MSG (0, ("Illegal `arg' addr %" ADDR_FMT "\n", ADDR_CAST(arg)));
368 return (FALSE);
369 }
370#endif
371 *(int*)arg = val;
372 break;
373 }
374 return (TRUE);
375}
376
382int W32_CALL parse_config_table (const struct config_table *tab,
383 const char *section,
384 const char *name,
385 const char *value)
386{
387 for ( ; tab && tab->keyword; tab++)
388 {
389 char keyword [MAX_NAMELEN], *p;
390 DWORD host;
391 void *arg;
392
393 if (section)
394 {
395 if (strlen(section) + strlen(tab->keyword) >= sizeof(keyword))
396 continue;
397 strcpy (keyword, section);
398 strcat (keyword, tab->keyword); /* "SECTION.KEYWORD" */
399 }
400 else
401 _strlcpy (keyword, tab->keyword, sizeof(keyword));
402
403 if (strcmp(name,keyword))
404 continue;
405
406 arg = tab->arg_func; /* storage or function to call */
407 if (!arg)
408 {
409 CONFIG_DBG_MSG (2, ("No storage for \"%s\", type %s (%d)\n",
410 keyword, type_name(tab->type), tab->type));
411 return (1);
412 }
413
414 switch (tab->type)
415 {
416 case ARG_ATOI:
417 set_value (FALSE, value, arg, sizeof(int));
418 break;
419
420 case ARG_ATOB:
421 set_value (FALSE, value, arg, sizeof(BYTE));
422 break;
423
424 case ARG_ATOX_B:
425 set_value (TRUE, value, arg, sizeof(BYTE));
426 break;
427
428 case ARG_ATOW:
429 set_value (FALSE, value, arg, sizeof(WORD));
430 break;
431
432 case ARG_ATOX_W:
433 set_value (TRUE, value, arg, sizeof(WORD));
434 break;
435
436 case ARG_ATOX_D:
437 set_value (TRUE, value, arg, sizeof(DWORD));
438 break;
439
440 case ARG_ATOIP:
441 *(DWORD*)arg = aton (value);
442 break;
443
444 case ARG_FUNC: /* This only works if 'arg' is __cdecl */
445 (*(void(*)(const char*, size_t))arg) (value, strlen(value));
446 break;
447
448 case ARG_RESOLVE:
449 host = resolve (value);
450 if (!host && !isaddr(value))
451 {
452 outs (name);
453 outs (_LANG(": Cannot resolve \""));
454 outs (value);
455 outsnl ("\"");
456 }
457 else
458 *(DWORD*)arg = host;
459 break;
460
461 case ARG_STRDUP:
462 p = strdup (value);
463 if (!p)
464 {
465 outs (_LANG("No memory for \""));
466 outs (name);
467 outsnl ("\"");
468 }
469 else
470 *(char**)arg = p;
471 break;
472
473 case ARG_STRCPY:
474 _strlcpy ((char*)arg, value, MAX_VALUELEN);
475 break;
476
477 default:
478#if defined(USE_DEBUG)
479 fprintf (stderr, "Something wrong in parse_config_table().\n"
480 "Section %s; `%s' = `%s'. type = %s (%d)\n",
481 section, name, value, type_name(tab->type), tab->type);
482 exit (-1);
483#endif
484 break;
485 }
486
487 TRACE_CONSOLE (3, "ARG_%s, matched `%s' = `%s'\n",
488 type_name(tab->type), keyword, value);
489 return (1);
490 }
491 return (0);
492}
493
494static void set_my_ip (const char *value)
495{
496 if (!stricmp(value, "bootp"))
497 _bootp_on = 1;
498 else if (!stricmp(value, "dhcp"))
499 _dhcp_on = 1;
500 else if (!stricmp(value, "rarp"))
501 _rarp_on = 1;
502 else my_ip_addr = resolve (value);
503}
504
505static void set_hostname (const char *value)
506{
507 _strlcpy (hostname, value, sizeof(hostname));
508}
509
510static void set_gateway (const char *value)
511{
512 _arp_add_gateway (value, 0L); /* accept gateip[,subnet[,mask]] */
513}
514
515static void set_nameserv (const char *value)
516{
517 DWORD ip = resolve (value);
518
519 _add_server (&last_nameserver, def_nameservers,
520 DIM(def_nameservers), ip);
521}
522
523static void set_cookie (const char *value)
524{
525 DWORD ip = resolve (value);
526
527 _add_server (&last_cookie, Cookies, DIM(Cookies), ip);
528}
529
533static void set_eaddr (const char *value)
534{
535 eth_address eth;
536
537 if (!_inet_atoeth (value, &eth))
538 return;
539
540 if (memcmp (&eth, _eth_real_addr, sizeof(eth)))
541 {
542 if (!_eth_set_addr(&eth))
543 outsnl (_LANG("Cannot set Ether-addr"));
544#if defined(USE_RARP)
545 else
546 {
547 WORD save_to = _rarptimeout;
548 DWORD save_ip = my_ip_addr;
549
550 /* We need to debug the RARP messages. It doesn't hurt to
551 * call dbug_open() again in sock_ini.c
552 */
553#if defined(USE_DEBUG)
554 if (debug_xmit)
555 dbug_open();
556#endif
557 _rarptimeout = 2; /* use only 2 sec timeout */
558 my_ip_addr = 0;
559 if (_dorarp() && my_ip_addr == save_ip)
560 outsnl (_LANG("Warning: MAC-addr already in use"));
561 my_ip_addr = save_ip;
562 _rarptimeout = save_to;
563 }
564#endif
565 }
566
567}
568
569static void set_domain (const char *value)
570{
571 setdomainname (value, sizeof(defaultdomain)-1);
572}
573
574static void depr_set_domain1 (const char *value)
575{
576 deprecated_key ("DOMAINSLIST", "DOMAIN.SUFFIX");
577 setdomainname (value, sizeof(defaultdomain)-1);
578}
579
580static void depr_set_domain2 (const char *value)
581{
582 deprecated_key ("DOMAIN_LIST", "DOMAIN.SUFFIX");
583 setdomainname (value, sizeof(defaultdomain)-1);
584}
585
586static void do_print (const char *str)
587{
588 if (print_hook)
589 (*print_hook) (str);
590 else outsnl (str);
591}
592
593static void depr_dns_timeout1 (const char *value)
594{
595 deprecated_key ("DOMAINTO", "DOMAIN.TIMEOUT");
596 dns_timeout = ATOI (value);
597}
598
599static void depr_dns_timeout2 (const char *value)
600{
601 deprecated_key ("DOMAIN_TO", "DOMAIN.TIMEOUT");
602 dns_timeout = ATOI (value);
603}
604
605static void depr_dns_recurse (const char *value)
606{
607 deprecated_key ("DOMAIN_RECURSE", "DOMAIN.RECURSE");
608 dns_recurse = ATOI (value);
609}
610
616static long do_include_file (const char *value, int len)
617{
618 const char *p = value;
619 long rc = 0;
620
621 if (*p == '?' && len > 1)
622 ++p;
623
624 /* If this is pass 1 of the parsing (ref. pcpkt.c), then return
625 */
626 if (usr_init == NULL)
627 {
628 CONFIG_DBG_MSG (2, ("Skipping include file `%s'\n", p));
629 return (0);
630 }
631
632 if (FILE_EXIST(p))
633 {
634 /* Recursion, but we're reentrant.
635 * !!Fix-me: recursion depth should be limited.
636 */
637 UINT tmp_line = current_line;
638 char *tmp_file = current_file;
639
640 rc = tcp_config (p);
641
642 current_line = tmp_line;
643 current_file = tmp_file;
644 }
645 else if (*value != '?')
646 {
647 outs (_LANG("\nUnable to open \""));
648 outs (p);
649 outsnl ("\"");
650 rc = 0;
651 }
652 return (rc);
653}
654
655static void deprecated_key (const char *old_key, const char *new_key)
656{
657#if defined(USE_DEBUG)
658 if (current_file && current_line > 0)
659 printf ("%s (%u): ", current_file, current_line);
660 printf ("Keyword \"%s\" is deprecated. Use \"%s\" instead.\n",
661 old_key, new_key);
662#endif
663
664 ARGSUSED (old_key);
665 ARGSUSED (new_key);
666}
667
671const char *get_argv0 (void)
672{
673 const char *ret;
674
675#if defined(WIN32)
676 static char buf [MAX_PATH];
677
678 if (GetModuleFileNameA(NULL, buf, sizeof(buf)))
679 ret = buf;
680 else ret = NULL;
681
682#elif (DOSX & PHARLAP)
683 static char buf [MAX_PATHLEN];
684 CONFIG_INF cnf;
685 UINT limit;
686 CD_DES descr;
687 FARPTR fp;
688 char *env, *start;
689
690 _dx_config_inf (&cnf, (UCHAR*)&cnf);
691
692 if (_dx_ldt_rd(cnf.c_env_sel, (UCHAR*)&descr))
693 return (NULL);
694
695 limit = descr.limit0_15 + ((descr.limit16_19 & 15) << 16);
696 env = malloc (limit);
697 if (!env)
698 return (NULL);
699
700 start = env;
701 FP_SET (fp, 0, cnf.c_env_sel);
702 ReadFarMem ((void*)env, fp, limit);
703
704 /* The environment is organised like this:
705 * 'PATH=c:\dos;c:\util',0
706 * ..
707 * 'COMSPEC=c:\dos\command.com',0,0,0
708 * 'program.exe',0
709 *
710 */
711 while (*(env+1))
712 env += 1 + strlen (env);
713 env += 2;
714 _strlcpy (buf, env, sizeof(buf));
715 free (start);
716 ret = buf;
717
718#elif defined(__DMC__)
719 ret = __argv[0];
720
721#elif defined(__DJGPP__)
722 ret = __crt0_argv[0];
723
724#elif defined(_MSC_VER)
725 extern char **__argv;
726 ret = __argv[0];
727
728#else
729 extern char **_argv; /* Borland, Watcom */
730 ret = _argv[0];
731#endif
732
733 if (!ret || !ret[0])
734 return (NULL);
735 return (ret);
736}
737
738#if !defined(USE_UDP_ONLY)
739static void set_recv_win (const char *value)
740{
741 DWORD val = ATOL (value);
742
743 if (val < tcp_MaxBufSize)
744 val = tcp_MaxBufSize;
745 if (val > MAX_WINDOW)
746 val = MAX_WINDOW; /* Window-scaling not yet supported */
747 tcp_recv_win = val;
748}
749#endif
750
751
752
753/*
754 * Our table of Wattcp "core" values. Other modules have their
755 * own tables which are hooked into the chain via `usr_init'.
756 * If `name' (left column) isn't found in table below, `usr_init'
757 * is called to pass on `name' and `value' to another module or
758 * application.
759 */
760static const struct config_table normal_cfg[] = {
761 { "MY_IP", ARG_FUNC, (void*)set_my_ip },
762 { "HOSTNAME", ARG_FUNC, (void*)set_hostname },
763 { "NETMASK", ARG_ATOIP, (void*)&sin_mask },
764 { "GATEWAY", ARG_FUNC, (void*)set_gateway },
765 { "NAMESERVER", ARG_FUNC, (void*)set_nameserv },
766 { "COOKIE", ARG_FUNC, (void*)set_cookie },
767 { "EADDR", ARG_FUNC, (void*)set_eaddr },
768 { "ETHIP", ARG_FUNC, (void*)set_ethip },
769 { "DEBUG", ARG_FUNC, (void*)set_debug_on },
770 { "BOOTP", ARG_RESOLVE,(void*)&_bootp_host },
771 { "BOOTPTO", ARG_ATOI, (void*)&_bootp_timeout },
772 { "BOOTP_TO", ARG_ATOI, (void*)&_bootp_timeout },
773 { "SOCKDELAY", ARG_ATOI, (void*)&sock_delay },
774 { "MSS", ARG_ATOI, (void*)&_mss },
775 { "MTU", ARG_ATOI, (void*)&_mtu },
776
777 { "DOMAIN.SUFFIX", ARG_FUNC, (void*)set_domain },
778 { "DOMAIN.TIMEOUT", ARG_ATOW, (void*)&dns_timeout },
779 { "DOMAIN.RECURSE", ARG_ATOI, (void*)&dns_recurse },
780 { "DOMAIN.IDNA", ARG_ATOI, (void*)&dns_do_idna },
781 { "DOMAIN.DO_IPV6", ARG_ATOI, (void*)&dns_do_ipv6 },
782 { "DOMAIN.WINDNS", ARG_ATOX_W, (void*)&dns_windns },
783
784 /* These are kept for backward compatability. Delete
785 * them some day.
786 */
787 { "DOMAINSLIST", ARG_FUNC, (void*)depr_set_domain1 },
788 { "DOMAIN_LIST", ARG_FUNC, (void*)depr_set_domain2 },
789 { "DOMAINTO", ARG_FUNC, (void*)depr_dns_timeout1 },
790 { "DOMAIN_TO", ARG_FUNC, (void*)depr_dns_timeout2 },
791 { "DOMAIN_RECURSE", ARG_FUNC, (void*)depr_dns_recurse },
792
793 { "MULTIHOMES", ARG_ATOI, (void*)&multihomes },
794 { "ICMP_MASK_REQ", ARG_ATOI, (void*)&_do_mask_req },
795 { "DYNAMIC_HOST", ARG_ATOI, (void*)&dynamic_host },
796 { "RAND_LPORT", ARG_ATOI, (void*)&use_rand_lport },
797 { "REDIRECTS", ARG_FUNC, (void*)icmp_doredirect },
798 { "PRINT", ARG_FUNC, (void*)do_print },
799 { "INCLUDE", ARG_FUNC, (void*)do_include_file },
800#if defined(USE_PROFILER)
801 { "PROFILE.ENABLE", ARG_ATOI, (void*)&profile_enable },
802 { "PROFILE.FILE", ARG_STRCPY, (void*)&profile_file },
803#endif
804#if defined(USE_LANGUAGE)
805 { "LANGUAGE", ARG_FUNC, (void*)lang_init },
806#endif
807#if defined(USE_BSD_API)
808 { "HOSTS", ARG_FUNC, (void*)_ReadHostsFile },
809#if defined(USE_IPV6)
810 { "HOSTS6", ARG_FUNC, (void*)_ReadHosts6File },
811#endif
812 { "SERVICES", ARG_FUNC, (void*)_ReadServFile },
813 { "PROTOCOLS", ARG_FUNC, (void*)_ReadProtoFile },
814 { "NETWORKS", ARG_FUNC, (void*)_ReadNetworksFile },
815 { "NETDB_ALIVE", ARG_ATOI, (void*)&netdbCacheLife },
816 { "ETHERS", ARG_FUNC, (void*)_InitEthersFile },
817#endif
818 { "IP.DEF_TTL", ARG_ATOI, (void*)&_default_ttl },
819 { "IP.DEF_TOS", ARG_ATOX_B, (void*)&_default_tos },
820 { "IP.ID_INCR", ARG_ATOI, (void*)&_ip4_id_increment },
821 { "IP.DONT_FRAG", ARG_ATOI, (void*)&_ip4_dont_frag },
822 { "IP.FRAG_REASM", ARG_ATOI, (void*)&_ip4_frag_reasm },
823 { "IP.LOOPBACK", ARG_ATOX_W, (void*)&loopback_mode },
824#if !defined(USE_UDP_ONLY)
825 { "DATATIMEOUT", ARG_ATOI, (void*)&sock_data_timeout },
826 { "INACTIVE", ARG_ATOI, (void*)&sock_inactive },
827 { "TCP.NAGLE", ARG_ATOI, (void*)&tcp_nagle },
828 { "TCP.OPT.TS", ARG_ATOI, (void*)&tcp_opt_ts },
829 { "TCP.OPT.SACK", ARG_ATOI, (void*)&tcp_opt_sack },
830 { "TCP.OPT.WSCALE", ARG_ATOI, (void*)&tcp_opt_wscale },
831 { "TCP.TIMER.OPEN_TO", ARG_ATOI, (void*)&tcp_OPEN_TO },
832 { "TCP.TIMER.CLOSE_TO", ARG_ATOI, (void*)&tcp_CLOSE_TO },
833 { "TCP.TIMER.RTO_ADD", ARG_ATOI, (void*)&tcp_RTO_ADD },
834 { "TCP.TIMER.RTO_BASE", ARG_ATOI, (void*)&tcp_RTO_BASE },
835 { "TCP.TIMER.RTO_SCALE", ARG_ATOI, (void*)&tcp_RTO_SCALE },
836 { "TCP.TIMER.RESET_TO", ARG_ATOI, (void*)&tcp_RST_TIME },
837 { "TCP.TIMER.RETRAN_TO", ARG_ATOI, (void*)&tcp_RETRAN_TIME },
838 { "TCP.TIMER.KEEPALIVE", ARG_ATOI, (void*)&tcp_keep_idle },
839 { "TCP.TIMER.KEEPINTVL", ARG_ATOI, (void*)&tcp_keep_intvl },
840 { "TCP.TIMER.MAX_IDLE", ARG_ATOI, (void*)&tcp_max_idle },
841 { "TCP.TIMER.MAX_VJSA", ARG_ATOI, (void*)&tcp_MAX_VJSA },
842 { "TCP.TIMER.MAX_VJSD", ARG_ATOI, (void*)&tcp_MAX_VJSD },
843 { "TCP.MTU_DISCOVERY", ARG_ATOI, (void*)&mtu_discover },
844 { "TCP.BLACKHOLE_DETECT", ARG_ATOI, (void*)&mtu_blackhole },
845 { "TCP.RECV_WIN", ARG_FUNC, (void*)set_recv_win },
846#endif
847 { "MEMDBG.STACK_DUMP", ARG_ATOI, (void*)&stkwalk_details }, /* put this somewehere else */
848 { NULL, 0, NULL }
849 };
850
856void W32_CALL tcp_set_debug_state (WORD val)
857{
858 if (val >= debug_on)
859 debug_on = val;
860}
861
867static void
868 tcp_inject_config_direct (
869 const struct config_table *cfg,
870 const char *key,
871 const char *value)
872{
873 WATT_ASSERT (key);
874 WATT_ASSERT (value);
875
876 if (W32_CLANG_NONNULL(key) || !key[0])
877 {
878 CONFIG_DBG_MSG (1, ("empty keyword\n"));
879 return;
880 }
881 if (W32_CLANG_NONNULL(key) || !value[0]) /* don't pass empty values to the parser */
882 {
883 CONFIG_DBG_MSG (1, ("keyword `%s' with no value\n", key));
884 return;
885 }
886
887 value = expand_var_str (value);
888 if (!parse_config_table(cfg, NULL, key, value) && usr_init)
889 (*usr_init) (key, value);
890}
891
897void W32_CALL tcp_inject_config (const struct config_table *cfg,
898 const char *key,
899 const char *value)
900{
901 char theKey [MAX_NAMELEN +1];
902 char theValue[MAX_VALUELEN+1];
903 char *save_current_file = current_file;
904 UINT save_current_line = current_line;
905
906 if (!key)
907 {
908 CONFIG_DBG_MSG (1, ("NULL keyword\n"));
909 return;
910 }
911
912 strntrimcpy (theKey, key, MAX_NAMELEN);
913 theKey[MAX_NAMELEN] = '\0';
914 strupr (theKey);
915
916 if (!value)
917 {
918 CONFIG_DBG_MSG (1, ("keyword `%s' with NULL value\n", theKey));
919 return;
920 }
921
922 strntrimcpy (theValue, value, MAX_VALUELEN);
923 theValue[MAX_VALUELEN] = '\0';
924
925 current_file = NULL;
926 current_line = 0;
927
928 tcp_inject_config_direct (cfg, theKey, theValue);
929
930 current_file = save_current_file;
931 current_line = save_current_line;
932}
933
934#if !defined(USE_BUFFERED_IO)
935/*
936 * A small simple read-ahead cache for sequential file-reads.
937 * 'fc_open()' accepts 'mode = [O_BINARY, O_TEXT]' only.
938 *
939 * Contributed by Mateusz Viste <mateusz@viste.fr>
940 */
941struct FCFILE *fc_open (const char *fname, int mode)
942{
943 struct FCFILE *fid = malloc (sizeof(*fid));
944
945 if (fid == NULL)
946 return (NULL);
947
948 fid->fd = open (fname, O_RDONLY | mode);
949 if (fid->fd < 0)
950 {
951 free (fid);
952 return (NULL);
953 }
954
955 /* Mark cache as empty
956 */
957 fid->cache_pos = sizeof (fid->cache);
958 fid->cache_max = sizeof (fid->cache);
959 return (fid);
960}
961
962void fc_close (struct FCFILE *f)
963{
964 if (f)
965 {
966 close (f->fd);
967 free (f);
968 }
969}
970
976int fc_readbyte (struct FCFILE *f, char *c)
977{
978 if (f->cache_pos < f->cache_max)
979 {
980 *c = f->cache [f->cache_pos++];
981 return (1);
982 }
983
984 /* Reload cache with fresh content, unless EOF
985 */
986 if ((size_t)f->cache_max < sizeof(f->cache))
987 return(-1);
988
989 f->cache_max = read (f->fd, f->cache, sizeof(f->cache));
990 if (f->cache_max < 1)
991 return (-1);
992
993 *c = f->cache[0];
994 f->cache_pos = 1;
995 return (1);
996}
997#endif /* USE_BUFFERED_IO */
998
999
1000/*
1001 * Read a character:
1002 * - if failed (EOF/26) or read a ^Z, set 'eof' and return '\0'.
1003 * - else update 'num_read' counter and return char read.
1004 */
1005#define READ_NEXT_CH(ch, f) \
1006 (ch = 0, (FREAD(&(ch), f) == 1) && (ch != 26) ? (++num_read, ch) : \
1007 (last_eol = got_eol, got_eol = eof = TRUE, ch = '\0'))
1008
1009/* Either read a char or retrieve the one "read ahead" before.
1010 */
1011#define READ_CH(ch, next, f) \
1012 (next ? (ch = next, next = '\0', ch) : READ_NEXT_CH(ch, f))
1013
1014long tcp_parse_file (WFILE f, const struct config_table *cfg)
1015{
1016 char key [MAX_NAMELEN+1];
1017 char value[MAX_VALUELEN+1];
1018 int ch, nextch; /* !! was 'char' */
1019 size_t num; /* # of char in key/value */
1020 long num_read; /* # of bytes read */
1021 enum ParseMode mode;
1022 BOOL quote_mode;
1023 BOOL stripping;
1024 BOOL eof;
1025 BOOL last_eol = FALSE;
1026 BOOL equal_sign;
1027
1028 num_read = 0;
1029 nextch = '\0';
1030 eof = FALSE;
1031
1032 while (!eof)
1033 {
1034 *key = *value = '\0';
1035 mode = ModeKeyword;
1036 num = 0;
1037 got_eol = FALSE;
1038 quote_mode = FALSE;
1039 equal_sign = FALSE;
1040 stripping = TRUE;
1041
1042 for (;;)
1043 {
1044 switch (READ_CH(ch, nextch, f))
1045 {
1046 case '\0':
1047 if (!last_eol && num)
1048 CONFIG_DBG_MSG (0, ("Missing line-termination "
1049 "could break old WatTcp programs.\n"));
1050 break;
1051
1052 case '\r':
1053 if (READ_NEXT_CH(nextch, f) == '\n')
1054 nextch = '\0';
1055 /* Fall through */
1056
1057 case '\n':
1058 got_eol = TRUE;
1059 ch = '\0'; /* Do not add */
1060 break;
1061
1062 case '#':
1063 case ';':
1064 if (!quote_mode)
1065 mode = ModeComment;
1066 break;
1067
1068 case '=':
1069 if (!quote_mode && mode == ModeKeyword)
1070 {
1071 mode = ModeValue;
1072 num = 0;
1073 ch = '\0'; /* Don't add */
1074 stripping = TRUE;
1075 equal_sign = TRUE;
1076 }
1077 break;
1078
1079 case '\"':
1080 if (mode != ModeValue)
1081 {
1082 ch = '\0';
1083 break;
1084 }
1085
1086 /* Double quotes may be inserted by doubling them (VB-style)
1087 * Ex.: SETTING_1 = "This is a ""quoted"" string."
1088 * SETTING_2 = This_is_a_""quoted""_string.
1089 */
1090 if (READ_NEXT_CH(nextch, f) == '\"')
1091 {
1092 nextch = '\0'; /* Ignore next, but keep this 'ch' */
1093 }
1094 else
1095 {
1096 quote_mode ^= 1;
1097 stripping = FALSE;
1098 ch = '\0'; /* Do not add */
1099 }
1100 break;
1101
1102 case ' ':
1103 case '\t':
1104 if (stripping)
1105 ch = '\0';
1106 break;
1107 } /* end switch */
1108
1109 if (ch)
1110 {
1111 switch (mode)
1112 {
1113 case ModeKeyword:
1114 stripping = FALSE;
1115 if (num <= sizeof(key)-2)
1116 {
1117 key[num++] = toupper (ch);
1118 key[num] = '\0';
1119 }
1120 break;
1121 case ModeValue:
1122 stripping = FALSE;
1123 if (num <= sizeof(value)-2)
1124 {
1125 value[num++] = ch;
1126 value[num] = '\0';
1127 }
1128 break;
1129 default: /* squelch gcc warning */
1130 break;
1131 }
1132 }
1133
1134 if (got_eol)
1135 {
1136 if (!eof)
1137 current_line++;
1138 if (quote_mode)
1139 CONFIG_DBG_MSG (0, ("Missing right \" in quoted string: `%s'\n",
1140 value));
1141 strrtrim (key);
1142 strrtrim (value);
1143 if (key[0] && value[0])
1144 tcp_inject_config_direct (cfg, key, value);
1145 else if (!key[0] && !value[0] && equal_sign)
1146 CONFIG_DBG_MSG (0, ("Both keyword and value missing\n"));
1147 break;
1148 }
1149 } /* end for (;;) */
1150 } /* end while (!eof) */
1151
1152 return (num_read);
1153}
1154
1155/*
1156 * Public only because of tcpinfo program.
1157 */
1158int W32_CALL tcp_config_name (char *name, int max)
1159{
1160 char *path = NULL, *temp;
1161 int i;
1162
1163 for (i = 0; i < DIM(environ_names); i++)
1164 {
1165 path = getenv (environ_names[i]);
1166 if (path)
1167 {
1168 path = _strlcpy (name, path, max-2);
1169 break;
1170 }
1171 }
1172
1173 if (path)
1174 {
1175 temp = strrchr (path, '\0');
1176 if (temp[-1] != '\\' && temp[-1] != '/')
1177 {
1178 *temp++ = '\\';
1179 *temp = '\0';
1180 }
1181 }
1182 else if (FILE_EXIST(config_name)) /* found in current directory */
1183 {
1184 strcpy (name, ".\\");
1185 path = name;
1186 }
1187 else if (_watt_os_ver >= 0x300) /* not found, get path from argv[0] */
1188 {
1189 const char *argv0 = get_argv0();
1190
1191 if (!argv0 || !argv0[0])
1192 return (0);
1193
1194 _strlcpy (name, argv0, max);
1195 strreplace ('/', '\\', name);
1196
1197 /* If path == "x:", extract path.
1198 * temp -> last '\\' in path.
1199 */
1200 path = (isalpha((int)name[0]) && name[1] == ':') ? name+2 : name;
1201 temp = strrchr (path, '\\');
1202 if (!temp)
1203 temp = (char*)path;
1204 temp++;
1205 *temp = '\0'; /* 'name' = path of program ("x:\path\") */
1206 }
1207
1208 i = max - (int)strlen(name) - 1;
1209 if (i < 0)
1210 return (0);
1211
1212 strncat (name, config_name, i); /* 'name' = "x:\path\wattcp.cfg" */
1213 strlwr (name);
1214 return (1);
1215}
1216
1217/*
1218 * Hack for pcpkt.c/winpkt.c: Bypass parsing of "normal_cfg".
1219 * tcp_config() is called in pcpkt.c/winpkt.c with another config-table.
1220 */
1221const struct config_table *watt_init_cfg = normal_cfg;
1222
1223long W32_CALL tcp_config (const char *path)
1224{
1225 char name[MAX_PATHLEN] = { 0 };
1226 char *fname = config_name;
1227 WFILE file;
1228 long len;
1229 int pass = (usr_init == NULL) ? 1 : 2;
1230
1231 if (_watt_no_config && !path)
1232 {
1233 if (!_watt_user_config_fn)
1234 return (0);
1235 current_file = NULL;
1236 current_line = 0;
1237 return (*_watt_user_config_fn) (pass, watt_init_cfg);
1238 }
1239
1240 if (!path)
1241 {
1242 if (!tcp_config_name(name, sizeof(name)))
1243 goto not_found;
1244 fname = name;
1245 }
1246 else
1247 {
1248 fname = name;
1249 _strlcpy (name, path, sizeof(name));
1250 if (!FILE_EXIST(fname))
1251 goto not_found;
1252 }
1253
1254 if (!FOPEN_BIN(file, fname)) /* shouldn't happen */
1255 goto not_found;
1256
1257 current_file = name;
1258 current_line = 0;
1259
1260 TRACE_CONSOLE (2, "Parsing `%s' (pass %d)\n", fname, pass);
1261
1262 len = tcp_parse_file (file, watt_init_cfg);
1263
1264 FCLOSE (file);
1265 return (len);
1266
1267not_found:
1268
1269 /* Warn unless parsing from pcpkt.c/winpkt.c.
1270 */
1271 if (watt_init_cfg == normal_cfg)
1272 {
1273 outs (fname);
1274 outsnl (_LANG(" not found"));
1275 }
1276 return (0);
1277}
1278
1279#if defined(USE_BSD_API)
1284int netdb_init (void)
1285{
1286 int rc, save = _watt_do_exit;
1287
1288 _watt_do_exit = 0; /* don't make watt_sock_init() call exit() */
1289 rc = watt_sock_init (0, 0, sizeof(time_t));
1290 _watt_do_exit = save;
1291 return (rc == 0);
1292}
1293
1294void netdb_warn (const char *fname)
1295{
1296 fprintf (stderr, "Warning: `%s' not found\n", fname);
1297}
1298#endif
1299
1300/*
1301 * A test program.
1302 */
1303#if defined(TEST_PROG)
1304
1305const char *cfg_file;
1306
1307static void W32_CALL not_found2 (const char *key, const char *value)
1308{
1309 size_t len = strlen (value);
1310 DWORD ret = 0;
1311
1312 printf ("Unmatched: key `%s', value `%s', len %lu %s\n",
1313 key, value, (unsigned long)len,
1314 (len >= MAX_VALUELEN-1) ? "(truncated)" : "");
1315
1316 if (!stricmp("HEX_BYTE",key))
1317 set_value (TRUE, value, &ret, sizeof(BYTE));
1318
1319 if (!stricmp("HEX_WORD",key))
1320 set_value (TRUE, value, &ret, sizeof(WORD));
1321
1322 if (!stricmp("HEX_DWORD",key))
1323 set_value (TRUE, value, &ret, sizeof(DWORD));
1324}
1325
1326static long W32_CALL my_injector (int pass, const struct config_table *cfg)
1327{
1328 printf ("my_injector(), pass %d\n", pass);
1329 tcp_inject_config (cfg, "My_IP", "192.168.0.98");
1330 tcp_inject_config (cfg, "NetMask", "255.255.255.0");
1331
1332 /* doing the file again doesn't work
1333 */
1334 tcp_inject_config (cfg, "include", cfg_file);
1335 return (1);
1336}
1337
1338void Usage (void)
1339{
1340 puts ("Usage: pcconfig [-d debug-level] [config-file]\n"
1341 "if config-file is omitted, the default "
1342 "$(WATTCP.CFG)\\WATTCP.CFG is used.");
1343 exit (0);
1344}
1345
1346#if !defined(USE_BUFFERED_IO)
1347 #undef fileno
1348 #define fileno(file) 0
1349 #define watt_filelength(fd) 0
1350#endif
1351
1352int main (int argc, char **argv)
1353{
1354 int ch, cfg_len;
1355 long file_len = 0L;
1356
1357 while ((ch = getopt(argc, argv, "h?d:")) != EOF)
1358 switch (ch)
1359 {
1360 case 'd':
1361 debug_on = ATOI (optarg);
1362 break;
1363 case '?':
1364 case 'h':
1365 default:
1366 Usage();
1367 break;
1368 }
1369
1370 argc -= optind;
1371 argv += optind;
1372 cfg_file = NULL; /* use the default wattcp.cfg */
1373
1374 if (*argv)
1375 {
1376 WFILE cfg;
1377
1378 cfg_file = *argv;
1379 if (FOPEN_BIN(cfg,cfg_file))
1380 {
1381 file_len = watt_filelength (fileno(cfg));
1382 FCLOSE (cfg);
1383 }
1384 }
1385
1386 usr_init = not_found2;
1387 cfg_len = tcp_config (cfg_file);
1388
1389 if (file_len > 0)
1390 printf ("filesize %ld, %d bytes parsed\n", file_len, cfg_len);
1391
1392 printf ("\nTest the config injector:\n");
1393 _watt_user_config (my_injector);
1394 _watt_no_config = 1;
1395 tcp_config (NULL);
1396 return (0);
1397}
1398#endif /* TEST_PROG */
1399
setdomainname
int W32_CALL setdomainname(const char *name, size_t len)
BSD-style: Set the host's domain name.
Definition: bsdname.c:213
bsdname.h
copyrigh.h
get_xby.h
inet.h
ip4_frag.h
_default_tos
BYTE _default_tos
Definition: ip4_out.c:53
_ip4_id_increment
int _ip4_id_increment
Definition: ip4_out.c:55
_default_ttl
int _default_ttl
Definition: ip4_out.c:54
_ip4_dont_frag
BOOL _ip4_dont_frag
Definition: ip4_out.c:56
ip4_out.h
ip6_out.h
language.h
loopback.h
_watt_os_ver
WORD _watt_os_ver
Definition: misc.c:74
watt_filelength
long W32_CALL watt_filelength(int fd)
filelength() is needed in pcconfig.c and some applications.
Definition: misc.c:946
misc.h
atox
BYTE atox(const char *hex)
Convert hexstring "0x??" to hex.
Definition: misc_str.c:199
strreplace
char * strreplace(int ch1, int ch2, char *str)
Replace 'ch1' to 'ch2' in string 'str'.
Definition: misc_str.c:212
strrtrim
char * strrtrim(char *s)
Return pointer to string with trailing blanks (space/tab) removed.
Definition: misc_str.c:262
strntrimcpy
size_t strntrimcpy(char *dst, const char *src, size_t n)
Copy a string, stripping leading and trailing blanks (space/tab).
Definition: misc_str.c:332
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
_inet6_addr
const ip6_address * _inet6_addr(const char *str)
Convert a string 'str' into an IPv6-address.
Definition: netaddr.c:419
_inet_addr
DWORD W32_CALL _inet_addr(const char *s)
Convert a string into an IP-address.
Definition: netaddr.c:70
aton
DWORD W32_CALL aton(const char *str)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
Definition: netaddr.c:86
_inet_atoeth
const char * _inet_atoeth(const char *src, eth_address *p_eth)
Parse string "ether-addr, ip-addr".
Definition: netaddr.c:205
isaddr
BOOL W32_CALL isaddr(const char *str)
Check if 'str' is simply an ip address.
Definition: netaddr.c:128
netaddr.h
_arp_add_gateway
BOOL W32_CALL _arp_add_gateway(const char *config_string, DWORD ip)
Add a gateway to the routing table.
Definition: pcarp.c:247
_arp_cache_add
BOOL W32_CALL _arp_cache_add(DWORD ip, const void *eth, BOOL expires)
Add given IP/Ether address to ARP-cache.
Definition: pcarp.c:1351
pcarp.h
pcbootp.h
tcp_set_debug_state
void W32_CALL tcp_set_debug_state(WORD val)
Old comptibility function.
Definition: pcconfig.c:856
expand_var_str
const char * expand_var_str(const char *str)
Return a string with a environment variable expanded (only one).
Definition: pcconfig.c:234
get_argv0
const char * get_argv0(void)
Return argv[0] as passed to main().
Definition: pcconfig.c:671
keyword_not_found
static void W32_CALL keyword_not_found(const char *key, const char *value)
This function eventually gets called if no keyword was matched.
Definition: pcconfig.c:276
set_ethip
static void set_ethip(const char *value)
Add an "ether, IPv4-address" pair to the static ARP-cache.
Definition: pcconfig.c:173
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
netdb_init
int netdb_init(void)
Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise thing...
Definition: pcconfig.c:1284
do_include_file
static long do_include_file(const char *value, int len)
Open and parse an include file.
Definition: pcconfig.c:616
set_value
static BOOL set_value(BOOL is_hex, const char *value, void *arg, int size)
Parse and store ARG_ATOX_B, ARG_ATOX_W or ARG_ATOI value.
Definition: pcconfig.c:288
fc_readbyte
int fc_readbyte(struct FCFILE *f, char *c)
Read next byte from file f and write it to c.
Definition: pcconfig.c:976
set_eaddr
static void set_eaddr(const char *value)
Set new ether-address from "ether" value.
Definition: pcconfig.c:533
tcp_inject_config_direct
static void tcp_inject_config_direct(const struct config_table *cfg, const char *key, const char *value)
Called from config-file parser after "key = value" is found.
Definition: pcconfig.c:868
tcp_inject_config
void W32_CALL tcp_inject_config(const struct config_table *cfg, const char *key, const char *value)
Callable from a user application to inject config values before the normal WATTCP....
Definition: pcconfig.c:897
pcconfig.h
pcdbug.h
pcdhcp.h
defaultdomain
char defaultdomain[MAX_HOSTLEN+1]
The 2 next variables are loaded from WATTCP.CFG file.
Definition: pcdns.c:71
resolve
DWORD W32_CALL resolve(const char *name)
Convert host name to an address.
Definition: pcdns.c:771
pcdns.h
pcicmp6.h
icmp_doredirect
void icmp_doredirect(const char *value)
Determine which protocols we shall act upon when ICMP redirect is received.
Definition: pcicmp.c:601
pcicmp.h
pcpkt.h
pcqueue.h
pcrarp.h
_eth_set_addr
int W32_CALL _eth_set_addr(const void *addr)
Sets a new MAC address for our interface.
Definition: pcsed.c:712
_eth_real_addr
mac_address _eth_real_addr
Our real MAC address.
Definition: pcsed.c:52
pcsed.h
tcp_recv_win
DWORD tcp_recv_win
RWIN for BSD sockets only.
Definition: pctcp.c:138
tcp_OPEN_TO
unsigned tcp_OPEN_TO
TCP timer values.
Definition: pctcp.c:116
tcp_opt_ts
BOOL tcp_opt_ts
TCP option config flags (RFC 1323).
Definition: pctcp.c:128
tcp_max_idle
unsigned tcp_max_idle
max idle time before kill
Definition: pctcp.c:137
tcp_CLOSE_TO
unsigned tcp_CLOSE_TO
Default close timeout.
Definition: pctcp.c:117
tcp_RST_TIME
unsigned tcp_RST_TIME
Don't generate RST too often.
Definition: pctcp.c:121
mtu_blackhole
BOOL mtu_blackhole
Definition: pctcp.c:63
tcp_RETRAN_TIME
unsigned tcp_RETRAN_TIME
Default retransmission time.
Definition: pctcp.c:122
tcp_nagle
BOOL tcp_nagle
Misc TCP values.
Definition: pctcp.c:134
tcp_keep_intvl
unsigned tcp_keep_intvl
time between keepalive probes
Definition: pctcp.c:136
mtu_discover
BOOL mtu_discover
Definition: pctcp.c:62
tcp_MAX_VJSA
unsigned tcp_MAX_VJSA
Default max VJ std.
Definition: pctcp.c:123
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
tcp_RTO_SCALE
unsigned tcp_RTO_SCALE
Scaling used in RTO calculation.
Definition: pctcp.c:120
hostname
char hostname[MAX_HOSTLEN+1]
Our configured hostname.
Definition: pctcp.c:58
tcp_RTO_BASE
unsigned tcp_RTO_BASE
Base time for RTO calculation.
Definition: pctcp.c:119
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
tcp_RTO_ADD
unsigned tcp_RTO_ADD
Time added in RTO calculation.
Definition: pctcp.c:118
tcp_MAX_VJSD
unsigned tcp_MAX_VJSD
Default max VJ std.
Definition: pctcp.c:124
tcp_keep_idle
unsigned tcp_keep_idle
idle time before sending keepalive
Definition: pctcp.c:135
pctcp.h
printk.h
profile.h
_bootp_on
BOOL _bootp_on
Try booting using BOOTP ?
Definition: sock_ini.c:129
_rarp_on
BOOL _rarp_on
Try booting using RARP ?
Definition: sock_ini.c:132
_watt_no_config
BOOL _watt_no_config
run with no config file (embedded/diskless)
Definition: sock_ini.c:134
_do_mask_req
BOOL _do_mask_req
do an "ICMP Mask Request" when configured
Definition: sock_ini.c:133
_dhcp_on
BOOL _dhcp_on
Try booting using DHCP ?
Definition: sock_ini.c:130
_watt_user_config
WattUserConfigFunc W32_CALL _watt_user_config(WattUserConfigFunc fn)
A user application may call the ‘_watt_user_config()’ function prior to calling sock_init() to inject...
Definition: sock_ini.c:200
watt_sock_init
int W32_CALL watt_sock_init(size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
Definition: sock_ini.c:769
_watt_do_exit
BOOL _watt_do_exit
exit program when all boot attempts failed
Definition: sock_ini.c:136
sock_ini.h
FCFILE
Definition: pcconfig.h:68
config_table
Definition: tcp.h:461
ARG_RESOLVE
@ ARG_RESOLVE
resolve host to IPv4-address
Definition: tcp.h:457
ARG_STRCPY
@ ARG_STRCPY
copy string value
Definition: tcp.h:456
ARG_STRDUP
@ ARG_STRDUP
duplicate string value
Definition: tcp.h:455
ARG_ATOX_D
@ ARG_ATOX_D
convert to hex-dword
Definition: tcp.h:454
ARG_ATOIP
@ ARG_ATOIP
convert to ip-address (host order)
Definition: tcp.h:451
ARG_ATOX_W
@ ARG_ATOX_W
convert to hex-word
Definition: tcp.h:453
ARG_ATOB
@ ARG_ATOB
convert to 8-bit byte
Definition: tcp.h:449
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
ARG_ATOW
@ ARG_ATOW
convert to 16-bit word
Definition: tcp.h:450
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
ARG_ATOX_B
@ ARG_ATOX_B
convert to hex-byte
Definition: tcp.h:452
teredo64.h
timer.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcconfig.h Source File

  • src
pcconfig.h
Go to the documentation of this file.
1
3#ifndef _w32_PCCONFIG_H
4#define _w32_PCCONFIG_H
5
6#if !defined(USE_BUFFERED_IO)
7#include <fcntl.h> /* Defines O_RDONLY and O_BINARY, needed by FOPEN_x macros */
8#endif
9
10#define sock_inactive W32_NAMESPACE (sock_inactive)
11#define sock_data_timeout W32_NAMESPACE (sock_data_timeout)
12#define sock_delay W32_NAMESPACE (sock_delay)
13#define multihomes W32_NAMESPACE (multihomes)
14#define print_hook W32_NAMESPACE (print_hook)
15#define usr_post_init W32_NAMESPACE (usr_post_init)
16#define Cookies W32_NAMESPACE (Cookies)
17#define last_cookie W32_NAMESPACE (last_cookie)
18#define ctrace_on W32_NAMESPACE (ctrace_on)
19#define dynamic_host W32_NAMESPACE (dynamic_host)
20#define get_argv0 W32_NAMESPACE (get_argv0)
21#define parse_config_table W32_NAMESPACE (parse_config_table)
22#define expand_var_str W32_NAMESPACE (expand_var_str)
23
24extern int sock_inactive;
25extern int sock_data_timeout;
26extern int sock_delay;
27extern WORD multihomes;
28
29extern void (W32_CALL *print_hook) (const char *);
30
31extern DWORD Cookies [MAX_COOKIES];
32extern WORD last_cookie;
33extern int ctrace_on;
34extern BOOL dynamic_host;
35extern int stkwalk_details;
36
37extern const struct config_table *watt_init_cfg;
38
39extern const char *get_argv0 (void);
40extern void _add_server (WORD *counter, DWORD *array, int array_dim, DWORD value);
41extern int netdb_init (void);
42extern void netdb_warn (const char *fname);
43extern const char *expand_var_str (const char *str);
44
45/*
46 * Using buffered I/O speeds up reading config-file, but uses more data/code.
47 * Non-DOSX targets where memory is tight doesn't have "#define USE_BUFFERED_IO"
48 * by default (see config.h)
49 */
50
51#undef FREAD /* In CygWin's /usr/include/sys/_default_fcntl.h */
52
53#if defined(USE_BUFFERED_IO) /* The normal case */
54 typedef FILE* WFILE;
55
56 #define FOPEN_BIN(fil, name) (fil = fopen (name, "rb"))
57 #define FOPEN_TXT(fil, name) (fil = fopen (name, "rt"))
58 #define FOPEN_APP(fil, name) (fil = fopen (name, "at"))
59 #define FREAD(ptr, fil) fread ((char*)(ptr), 1, 1, fil)
60 #define FCLOSE(fil) fclose (fil)
61
62#else
63
64 /* Use this simple read-ahead cache when memory is tight.
65 * A 32 byte cache seems plenty to speed-up the reading of
66 * the "wattcp.cfg".
67 */
68 struct FCFILE {
69 int fd;
70 char cache [32];
71 short cache_pos;
72 short cache_max;
73 };
74
75 typedef struct FCFILE* WFILE;
76
77 #if 0 /* Old version */
78 #define FOPEN_BIN(fil, name) (fil = open (name, O_RDONLY|O_BINARY), (fil != -1))
79 #define FOPEN_TXT(fil, name) (fil = open (name, O_RDONLY|O_TEXT), (fil != -1))
80 #else
81 #define FOPEN_BIN(fil, name) (fil = fc_open(name, O_BINARY))
82 #define FOPEN_TXT(fil, name) (fil = fc_open(name, O_TEXT))
83 #endif
84
85 #define FOPEN_APP(fil,name) UNIMPLEMENTED()
86 #define FREAD(ptr,fil) fc_readbyte (fil, (char*)(ptr))
87 #define FCLOSE(fil) fc_close (fil)
88
89 extern struct FCFILE *fc_open (const char *fname, int mode);
90 extern void fc_close (struct FCFILE *f);
91 extern int fc_readbyte (struct FCFILE *f, char *c);
92#endif
93
94extern long tcp_parse_file (WFILE fil, const struct config_table *cfg);
95
96#endif
97
expand_var_str
const char * expand_var_str(const char *str)
Return a string with a environment variable expanded (only one).
Definition: pcconfig.c:234
get_argv0
const char * get_argv0(void)
Return argv[0] as passed to main().
Definition: pcconfig.c:671
netdb_init
int netdb_init(void)
Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise thing...
Definition: pcconfig.c:1284
fc_readbyte
int fc_readbyte(struct FCFILE *f, char *c)
Read next byte from file f and write it to c.
Definition: pcconfig.c:976
FCFILE
Definition: pcconfig.h:68
config_table
Definition: tcp.h:461


Watt-32 tcp/ip: E:/WATT/src/pcdbug.c Source File

  • src
pcdbug.c
Go to the documentation of this file.
1
11#include <stdio.h>
12#include <stdlib.h>
13#include <stdarg.h>
14#include <string.h>
15#include <setjmp.h>
16#include <limits.h>
17#include <sys/types.h>
18#include <sys/stat.h>
19#include <io.h>
20#include <arpa/nameser.h>
21#include <resolv.h>
22
23#if defined(__DJGPP__) && (DJGPP_MINOR >= 4)
24 #include <sys/xdevices.h>
25#endif
26
27#if defined(_WIN32) && !defined(__CYGWIN__)
28 #include <fcntl.h>
29
30 #if !defined(__POCC__)
31 #include <share.h>
32 #endif
33#endif
34
35#include "wattcp.h"
36#include "pcdns.h"
37#include "misc.h"
38#include "misc_str.h"
39#include "run.h"
40#include "timer.h"
41#include "sock_ini.h"
42#include "chksum.h"
43#include "ip4_in.h"
44#include "ip6_in.h"
45#include "ip6_out.h"
46#include "pctcp.h"
47#include "pcsed.h"
48#include "pcarp.h"
49#include "pcqueue.h"
50#include "pcpkt.h"
51#include "pcstat.h"
52#include "pcicmp.h"
53#include "pcicmp6.h"
54#include "pcconfig.h"
55#include "netaddr.h"
56#include "language.h"
57#include "printk.h"
58#include "gettod.h"
59#include "get_xby.h"
60#include "pppoe.h"
61#include "ppp.h"
62#include "split.h"
63#include "bsddbug.h"
64#include "pcdbug.h"
65
66#if defined(USE_GZIP)
67 #include "zlib.h"
68#endif
69
70#if defined(USE_SCTP)
71 #include "sctp.h"
72#endif
73
74#define DEBUG_RTP 1
76const char *tcpStateName (UINT state)
77{
78 static char buf [20];
79 static const char *tcpStates[] = {
80 "LISTEN", "RESOLVE", "SYNSENT", "SYNREC", "ESTAB",
81 "ESTCLOSE", "FINWT1", "FINWT2", "CLOSWT", "CLOSING",
82 "LASTACK", "TIMEWT", "CLOSED"
83 };
84
85 if (state < DIM(tcpStates))
86 return tcpStates [(int)state];
87 return itoa (state, buf, 10);
88}
89
90DebugProc debug_xmit = NULL;
91DebugProc debug_recv = NULL;
92
93#if !defined(USE_DEBUG)
94
95void dbug_init (void)
96{
97 outsnl ("Debug-mode disabled");
98}
99
100#else /* rest of file */
101
102static void W32_CALL dbug_exit (void);
103static void dbug_close (void);
104
105static void dump_ip_opt (const void *opt, int len);
106static void dump_tcp_opt(const void *opt, int len, DWORD ack);
107static DWORD dump_data (const void *data, UINT datalen);
108static int udp_dump (const _udp_Socket *sock, const in_Header *ip);
109static int tcp_dump (const _tcp_Socket *sock, const in_Header *ip);
110
111static unsigned dns_dump (const BYTE *, unsigned, unsigned);
112static const BYTE *dns_resource (const BYTE *, const BYTE *, const BYTE *);
113static const BYTE *dns_labels (const BYTE *, const BYTE *, const BYTE *);
114
115static int write_pcap_header (void);
116static int write_pcap_packet (const void *pkt, BOOL out);
117
118#if defined(USE_PPPOE)
119 static unsigned ccp_dump (const BYTE *bp);
120 static unsigned lcp_dump (const BYTE *bp);
121 static unsigned ipcp_dump (const BYTE *bp);
122#endif
123
124#if (DOSX) && !(defined(__CYGWIN__) && defined(__x86_64__)) && \
125 !defined(__NO_INLINE__) /* Don't do this if 'gcc -O0' is used */
126 #define PRINT_CPU_INFO
127 #define COMPILING_PCDBUG_C
128 #define CPU_TEST
129
130 #include "cpumodel.h"
131 #include "tests/cpu.c"
132 static void print_cpu_info (void);
133#endif
134
135
136static void (W32_CALL *prev_hook) (const char *, const char *) = NULL;
137
138static jmp_buf dbg_jmp;
139static char dbg_name [MAX_PATHLEN+1] = "WATTCP.DBG";
140static BOOL dbg_linebuf = FALSE;
141static BOOL pcap_mode = FALSE;
142static DWORD now; /* ticks or milli-sec */
143static BOOL outbound; /* transmitting packet? */
144static BOOL in_dbug_dump;
145static BOOL use_gzip; /* if using pcap-mode, use gzip-compression */
146static BOOL use_ods = FALSE; /* Win32: use OutputDebugString() */
147static char ip4_src [20];
148static char ip4_dst [20];
149
150static union {
151 FILE *stream;
152 void *gz_stream;
153 } dbg_file;
154
155
156/* IP-fragment handling
157 */
158#define IS_FRAG 0x01 /* is this a fragment? */
159#define IS_LAST 0x02 /* is this last fragment? */
160#define IS_FIRST 0x04 /* is this first fragment? */
161
162static int frag_status; /* IPv4 fragment bits */
163
164
165#if defined(USE_IPV6)
166 static char ip6_src [50];
167 static char ip6_dst [50];
168 static int udp6_dump (const _udp_Socket *sock, const in6_Header *ip);
169#endif
170
171static struct {
172 char MAC;
173 char ARP;
174 char RARP;
175 char IP; /* both IPv4 and IPv6 */
176 char BCAST;
177 char MCAST;
178 char LOOP;
179 char NONE;
180 } filter = { 1,1,1,1,1,1,0,0 };
181
182static struct {
183 char MAC;
184 char LLC;
185 char ARP;
186 char RARP;
187 char IP;
188 char UDP;
189 char TCP;
190 char ICMP;
191 char IGMP;
192 char SCTP;
193 } debug = { 0,0,1,1,1,1,1,1,1,1 };
194
199BOOL dbg_mode_all = 1;
200BOOL dbg_print_stat = 1;
201BOOL dbg_print_size = 0;
202BOOL dbg_dns_details = 1;
203
204#if defined(USE_GZIP)
205static DWORD bytes_raw = 0UL; /* raw uncompressed bytes written */
206#endif
207
208
209/*----------------------------------------------------------------------*/
210
211BOOL dbug_file (void)
212{
213 if (pcap_mode) /* don't let anyone mess with this file */
214 return (FALSE);
215 return (dbg_file.stream != NULL || use_ods);
216}
217
218void dbug_open (void)
219{
220 const char *fmode = pcap_mode ? "w+b" : "w+t";
221 const char *end;
222
223 if (dbg_file.stream || use_ods) /* Already opened; quit */
224 return;
225
226#if defined(__DJGPP__) && (DJGPP_MINOR >= 4) /* Just for testing */
227 if (!stricmp(dbg_name, "/dev/zero"))
228 __install_dev_zero();
229
230 else if (!stricmp(dbg_name, "/dev/full"))
231 __install_dev_full();
232#endif
233
234 end = strchr (dbg_name, '\0');
235 use_gzip = (end && !stricmp(end - 3, ".gz"));
236
237 if (!stricmp(dbg_name, "con") || !stricmp(dbg_name, "stdout"))
238 dbg_file.stream = stdout;
239
240 else if (!stricmp(dbg_name, "stderr"))
241 dbg_file.stream = stderr;
242
243#if defined(_WIN32)
244 else if (!stricmp(dbg_name, "$ods"))
245 {
246 use_ods = TRUE;
247 goto quit;
248 }
249#endif
250
251#if defined(USE_GZIP)
252 else if (pcap_mode && use_gzip)
253 {
254#if defined(_WIN32) && !defined(__WATCOMC__) && !defined(__CYGWIN__)
255 int fd = _sopen (dbg_name, _O_CREAT | _O_TRUNC | _O_WRONLY,
256 SH_DENYWR, S_IREAD | S_IWRITE);
257 if (fd > -1)
258 dbg_file.gz_stream = gzdopen (fd, "w+b2"); /* compression level 2 */
259#else
260 errno = 0;
261 dbg_file.gz_stream = gzopen (dbg_name, "w+b2"); /* compression level 2 */
262#endif
263 }
264#endif /* USE_GZIP */
265 else
266 {
267 dbg_file.stream = fopen_excl (dbg_name, fmode);
268 use_gzip = FALSE;
269 }
270
271 if (!dbg_file.stream)
272 {
273 (*_printf) (_LANG("ERROR: unable to open debug file %s; %s\n"),
274 dbg_name, strerror(errno));
275 errno = 0; /* clear it. It coult confuse callers */
276 return;
277 }
278
279 if (pcap_mode)
280 {
281 if (dbg_file.stream == stdout || dbg_file.stream == stderr)
282 {
283 outsnl (_LANG("ERROR: cannot debug to screen with \"DEBUG.PCAP=1\""));
284 dbug_close();
285 return;
286 }
287 if (write_pcap_header() < 0)
288 {
289 (*_printf) (_LANG("ERROR: Failed to write pcap header; %s\n"),
290 strerror(errno));
291 dbug_close();
292 return;
293 }
294 }
295#if !defined(__BORLANDC__) /* buggy output with this */
296 else if (dbg_linebuf)
297 {
298 static char buf [256];
299 setvbuf (dbg_file.stream, buf, _IOLBF, sizeof(buf));
300 }
301#endif
302
303#if defined(_WIN32)
304 quit:
305#endif
306
307 RUNDOWN_ADD (dbug_exit, 5);
308}
309
310/*
311 * Return TRUE if MAC address is multicast (LSB bit 0 set).
312 */
313static __inline BOOL MAC_is_mcast (const void *addr)
314{
315 return ((*(const BYTE*)addr & 1) == 1);
316}
317
318/*
319 * Return TRUE if MAC address is broadcast.
320 */
321static __inline BOOL MAC_is_bcast (const void *addr)
322{
323 return (!memcmp(addr, _eth_brdcast, _eth_mac_len));
324}
325
326/*
327 * Using NDIS3PKT causes all non-broadcast packets sent to
328 * appear in receive buffer approx 100 msec later.
329 * WinPcap: Also if _pkt_rxmode == RXMODE_ALL_LOCAL.
330 *
331 * To avoid confusion, we print a warning in this case.
332 */
333static __inline BOOL is_looped (const in_Header *ip)
334{
335 if (outbound || _pktserial)
336 return (FALSE);
337
338 if (memcmp(MAC_SRC(ip), _eth_addr, _eth_mac_len))
339 return (FALSE);
340
341 if (MAC_TYP(ip) != IP4_TYPE) /* assume looped if not IPv4 */
342 return (TRUE);
343
344 /* if MAC-src matches, but IP-src is different it could be
345 * Winsock sending. Thus it's not a looped packet.
346 */
347 return (ntohl(ip->source) == my_ip_addr);
348}
349
350/*
351 * Return TRUE if MAC destination address of received/sent link-layer
352 * packet:
353 * - matches our link-layer address.
354 * - is broadcast and we don't filter broadcast.
355 * - is multicast and we don't filter multicast.
356 */
357static __inline BOOL match_link_destination (const void *addr)
358{
359 if (!memcmp(addr, _eth_addr, _eth_mac_len) ||
360 (!filter.BCAST && MAC_is_bcast(addr)) ||
361 (!filter.MCAST && MAC_is_mcast(addr)))
362 return (TRUE);
363 return (FALSE);
364}
365
366/*
367 * Return TRUE if destination address of received/sent ARP packet:
368 * - matches our ether/IP-address.
369 * - is broadcast and we don't filter broadcast
370 * (ARP/RARP packets should never use multicast in it's header).
371 */
372static __inline BOOL match_arp_rarp (const arp_Header *arp)
373{
374 if (!memcmp(&arp->dstEthAddr, _eth_addr, _eth_mac_len) ||
375 _ip4_is_local_addr(intel(arp->dstIPAddr)))
376 return (TRUE);
377
378 if (!filter.BCAST && MAC_is_bcast(&arp->dstEthAddr))
379 return (TRUE);
380 return (FALSE);
381}
382
383/*
384 * Return TRUE if destination address of received/sent IP packet:
385 * - matches our IP-address.
386 * - is broadcast and we don't filter (directed) IP-broadcast.
387 */
388static __inline BOOL match_ip4_dest (const in_Header *ip)
389{
390 DWORD destin = intel (ip->destination);
391
392 if (_ip4_is_local_addr(destin) || (!filter.BCAST && _ip4_is_ip_brdcast(ip)))
393 return (TRUE);
394 return (FALSE);
395}
396
397#if defined(USE_IPV6)
398static __inline BOOL match_ip6_dest (const in6_Header *ip)
399{
400 const void *dest = &ip->destination;
401
402 if (_ip6_is_local_addr(dest) ||
403 IN6_IS_ADDR_MC_GLOBAL(dest))
404 return (TRUE);
405 return (FALSE);
406}
407#endif
408
409/*
410 * Return checksum and print "ok" or "ERROR"
411 */
412static __inline const char *do_check_sum (WORD value, const void *p, int len)
413{
414 static char buf [20];
415 WORD chk = CHECKSUM (p, len);
416
417 sprintf (buf, "%04X (%s)", value, (chk == 0xFFFF) ? "ok" : "ERROR");
418 return (buf);
419}
420
421/*
422 * Return name of some known link-layer protocols.
423 */
424static __inline const char *link_protocol (WORD type)
425{
426 switch (type)
427 {
428 case IP4_TYPE:
429 return ("IP");
430 case IP6_TYPE:
431 return ("IP6");
432 case ARP_TYPE:
433 return ("ARP");
434 case RARP_TYPE:
435 return ("RARP");
436 case IEEE802_1Q_TYPE:
437 return ("VLAN");
438 case PPPOE_DISC_TYPE:
439 return ("PPPoE DISCOVERY");
440 case PPPOE_SESS_TYPE:
441 return ("PPPoE SESSION");
442 default:
443 return ("unknown");
444 }
445}
446
447/*
448 * Return name of known IP-protocols.
449 */
450static __inline const char *ip4_protocol (BYTE prot)
451{
452 static char buf [4];
453
454 switch (prot)
455 {
456 case UDP_PROTO:
457 return ("UDP");
458 case TCP_PROTO:
459 return ("TCP");
460 case ICMP_PROTO:
461 return ("ICMP");
462 case IGMP_PROTO:
463 return ("IGMP");
464 case SCTP_PROTO:
465 return ("SCTP");
466 }
467 return itoa (prot, buf, 10);
468}
469
470/*
471 * Return name for IP's "Type Of Service".
472 */
473static const char *type_of_service (BYTE tos)
474{
475 static char buf [30];
476 char *p = buf;
477
478 if (tos == 0)
479 return (" 0");
480
481 *p = '\0';
482 if (tos & IP_MINCOST)
483 {
484 strcat (buf, " Mcost");
485 tos &= ~IP_MINCOST;
486 }
487 if (tos & IP_RELIABILITY)
488 {
489 strcat (buf, " Rel");
490 tos &= ~IP_RELIABILITY;
491 }
492 if (tos & IP_THROUGHPUT)
493 {
494 strcat (buf, " ThPut");
495 tos &= ~IP_THROUGHPUT;
496 }
497 if (tos & IP_LOWDELAY)
498 {
499 strcat (buf, " LwDly");
500 tos &= ~IP_LOWDELAY;
501 }
502 p = strchr (buf, '\0');
503 if (tos)
504 sprintf (p, " %02X", tos);
505 return (buf);
506}
507
508/*
509 * Format time for "Round Trip Time" in msec.
510 */
511static __inline const char *RTT_str (DWORD rtt, DWORD now)
512{
513 static char buf [40];
514
515 if (rtt == 0UL || rtt < now)
516 return ("--"); /* RTT timer stopped */
517
518 sprintf (buf, "%ld", get_timediff (rtt, now));
519 return (buf);
520}
521
522
523/*
524 * Return string for ARP/RARP opcodes.
525 */
526static __inline const char *arp_opcode (WORD code)
527{
528 if (code == ARP_REQUEST || code == RARP_REQUEST)
529 return ("Request");
530
531 if (code == ARP_REPLY || code == RARP_REPLY)
532 return ("Reply");
533
534 return ("? op");
535}
536
537/*
538 * Print IP source/destination addresses and ports;
539 * "host1 (a) -> host2 (b)"
540 *
541 * Note: the udp_Header src/dst port field are not printed.
542 */
543static void dump_addr_port (const char *proto,
544 const void *sock,
545 const in_Header *ip)
546{
547 const tcp_Header *tcp = (const tcp_Header*) ((BYTE*)ip + in_GetHdrLen(ip));
548
549 if (!sock)
550 dbug_printf ("%s: NO SOCKET: %s (%d) -> %s (%d)\n", proto,
551 ip4_src, intel16(tcp->srcPort),
552 ip4_dst, intel16(tcp->dstPort));
553 else
554 {
555 const _tcp_Socket *sk = (const _tcp_Socket*) sock;
556
557 if (outbound)
558 dbug_printf ("%s: %s (%d) -> %s (%d), sock %" ADDR_FMT "\n", proto,
559 _inet_ntoa(NULL, my_ip_addr), sk->myport,
560 _inet_ntoa(NULL, sk->hisaddr), sk->hisport,
561 ADDR_CAST(sock));
562
563 else dbug_printf ("%s: %s (%d) -> %s (%d), sock %" ADDR_FMT "\n", proto,
564 _inet_ntoa(NULL, sk->hisaddr), sk->hisport,
565 _inet_ntoa(NULL, my_ip_addr), sk->myport,
566 ADDR_CAST(sock));
567 }
568}
569
570#if defined(USE_IPV6)
571static __inline void ip6_addr_type (char *ret, const void *addr)
572{
573 if (IN6_IS_ADDR_UNSPECIFIED(addr))
574 strcpy (ret, "(anycast) ");
575
576 else if (IN6_IS_ADDR_MULTICAST(addr))
577 strcpy (ret, "(multicast) ");
578
579 else if (IN6_IS_ADDR_MC_NODELOCAL(addr))
580 strcpy (ret, "(MC node) ");
581
582 else if (IN6_IS_ADDR_MC_LINKLOCAL(addr))
583 strcpy (ret, "(MC link) ");
584
585 else if (IN6_IS_ADDR_MC_SITELOCAL(addr))
586 strcpy (ret, "(MC site) ");
587
588 else if (IN6_IS_ADDR_MC_GLOBAL(addr))
589 strcpy (ret, "(MC global) ");
590
591 else if (IN6_IS_ADDR_V4MAPPED(addr))
592 strcpy (ret, "(ip4-mapped) ");
593
594 else if (IN6_IS_ADDR_V4COMPAT(addr))
595 strcpy (ret, "(ip4-compat) ");
596
597 else if (IN6_IS_ADDR_LOOPBACK(addr))
598 strcpy (ret, "(loopback) ");
599
600 else *ret = '\0';
601}
602
603static void dump_addr6_port (const char *proto,
604 const void *sock,
605 const in6_Header *ip)
606{
607 const tcp_Header *tcp = (const tcp_Header*) (ip + 1);
608 const _tcp_Socket *sk = (const _tcp_Socket*) sock;
609
610 if (!sock)
611 dbug_printf ("%s: NO SOCKET: %s (%d) -> %s (%d)\n", proto,
612 ip6_src, intel16(tcp->srcPort),
613 ip6_dst, intel16(tcp->dstPort));
614
615 else if (outbound)
616 dbug_printf ("%s: %s (%d) -> %s (%d)\n", proto,
617 _inet6_ntoa(&in6addr_my_ip), sk->myport,
618 _inet6_ntoa(sk->his6addr), sk->hisport);
619
620 else dbug_printf ("%s: %s (%d) -> %s (%d)\n", proto,
621 _inet6_ntoa(sk->his6addr), sk->hisport,
622 _inet6_ntoa(&in6addr_my_ip), sk->myport);
623}
624#endif
625
626/*----------------------------------------------------------------------*/
627
628static void link_head_dump (const union link_Packet *pkt)
629{
630 const struct eth_Header *eth;
631 const char *src_name, *dst_name;
632 WORD type;
633
634 if (_pktdevclass == PDCLASS_TOKEN || _pktdevclass == PDCLASS_TOKEN_RIF)
635 {
636 const struct tok_Header *tok = &pkt->tok.head;
637
638 dbug_printf ("TR: destin %s, AC %02X, FC %02X\n"
639 " source %s, DSAP %02X, SSAP %02X, Ctrl %02X\n"
640 " type %s (%04X)\n",
641 MAC_address (tok->destination), tok->accessCtrl, tok->frameCtrl,
642 MAC_address (tok->source), tok->DSAP, tok->SSAP, tok->ctrl,
643 link_protocol(tok->type), intel16(tok->type));
644 return;
645 }
646
647 if (_pktdevclass == PDCLASS_FDDI)
648 {
649 const struct fddi_Header *fddi = &pkt->fddi.head;
650
651 dbug_printf ("FDDI: destin %s, FC %02X\n"
652 " source %s, DSAP %02X, SSAP %02X, Ctrl %02X\n"
653 " type %s (%04X)\n",
654 MAC_address (fddi->destination), fddi->frameCtrl,
655 MAC_address (fddi->source), fddi->DSAP, fddi->SSAP,
656 fddi->ctrl, link_protocol(fddi->type), intel16(fddi->type));
657 return;
658 }
659
660 if (_pktdevclass == PDCLASS_ARCNET)
661 {
662 static const struct search_list arcnet_protos[] = {
663 { ARCNET_DP_BOOT, "DataPoint Boot" },
664 { ARCNET_DP_MOUNT, "DataPoint Mount" },
665 { ARCNET_PL_BEACON, "PowerLAN Beacon" },
666 { ARCNET_PL_BEACON2, "PowerLAN Beacon2" },
667 { ARCNET_DIAG, "Diagnose" },
668 { ARCNET_IP6, "IPv6" },
669 { ARCNET_BACNET, "BACNET" },
670 { ARCNET_IP_1201, "IPv4 (RFC-1201)" },
671 { ARCNET_ARP_1201, "ARP (RFC-1201)" },
672 { ARCNET_RARP_1201, "RARP (RFC-1201)" },
673 { ARCNET_ATALK, "AppleTalk" },
674 { ARCNET_ETHER, "Raw Ether" }, /* MS LAN-Man/WfWg */
675 { ARCNET_NOVELL, "Novell Encap" },
676 { ARCNET_IP_1051, "IPv4 (RFC-1051)" },
677 { ARCNET_ARP_1051, "ARP (RFC-1051)" },
678 { ARCNET_BANYAN, "Banyan" },
679 { ARCNET_IPX, "IPX" },
680 { ARCNET_LANSOFT, "LanSoft" }
681 };
682 const struct arcnet_Header *arc = &pkt->arc.head;
683 const char *proto = list_lookup (arc->type, arcnet_protos,
684 DIM(arcnet_protos));
685
686 dbug_printf ("ARCNET:destin %02X, flags %02X, sequence %04X\n"
687 " source %02X %s\n"
688 " type %s\n",
689 arc->destination, arc->flags, arc->sequence,
690 arc->source, arc->flags == 0xFF ? "Exc-packet" : "",
691 proto);
692 return;
693 }
694
695 WATT_ASSERT (_pktdevclass == PDCLASS_ETHER);
696
697 eth = &pkt->eth.head;
698
699 /* src/dst_names comes from /etc/ethers file
700 */
701 src_name = GetEtherName (&eth->source);
702 dst_name = GetEtherName (&eth->destination);
703
704 dbug_printf ("ETH: destin %s %s %s\n"
705 " source %s %s %s\n",
706 MAC_address (&eth->destination),
707 MAC_is_bcast(&eth->destination) ? "(broadcast)" :
708 MAC_is_mcast(&eth->destination) ? "(multicast)" : "",
709 dst_name ? dst_name : "",
710 MAC_address (&eth->source),
711 MAC_is_bcast(&eth->source) ? "(broadcast)" :
712 MAC_is_mcast(&eth->source) ? "(multicast)" : "",
713 src_name ? src_name : "");
714
715 type = intel16 (eth->type);
716 if (type == 0xFFFF)
717 {
718 dbug_printf (" Novell IPX\n");
719 }
720 else if (type < 0x600) /* type is LLC length field */
721 {
722 const llc_Header *llc = (const llc_Header*) (eth+1);
723 unsigned len = type;
724
725 dbug_printf (" IEEE 802.3 encap (LLC: DSAP %02X, SSAP %02X, len %u)\n",
726 llc->DSAP, llc->SSAP, len);
727 }
728 else
729 dbug_printf (" type %s (%04X)\n", link_protocol(eth->type), type);
730}
731
732/*----------------------------------------------------------------------*/
733
734static int arp_dump (const arp_Header *arp)
735{
736 _inet_ntoa (ip4_src, intel(arp->srcIPAddr));
737 _inet_ntoa (ip4_dst, intel(arp->dstIPAddr));
738
739 return dbug_printf ("ARP: %s (%d), hw %04X, type %04X\n"
740 " %s (%s) -> %s (%s)\n",
741 arp_opcode(arp->opcode), intel16(arp->opcode),
742 arp->hwType, intel16(arp->protType),
743 MAC_address (&arp->srcEthAddr), ip4_src,
744 MAC_address (&arp->dstEthAddr), ip4_dst);
745}
746
747/*----------------------------------------------------------------------*/
748
749static int rarp_dump (const rarp_Header *rarp)
750{
751 _inet_ntoa (ip4_src, intel(rarp->srcIPAddr));
752 _inet_ntoa (ip4_dst, intel(rarp->dstIPAddr));
753
754 return dbug_printf ("RARP: %s (%d), hw %04X, type %04X\n"
755 " %s (%s) -> %s (%s)\n",
756 arp_opcode(rarp->opcode), intel16(rarp->opcode),
757 rarp->hwType, intel16(rarp->protType),
758 MAC_address (&rarp->srcEthAddr), ip4_src,
759 MAC_address (&rarp->dstEthAddr), ip4_dst);
760}
761
762/*----------------------------------------------------------------------*/
763
764static void ip4_dump (const in_Header *ip)
765{
766 WORD ihl, flg;
767 DWORD ofs;
768 int opt_len;
769 const char *chk_ok;
770
771 ofs = intel16 (ip->frag_ofs);
772 flg = (WORD) (ofs & ~IP_OFFMASK);
773 ofs = (ofs & IP_OFFMASK) << 3;
774
775 frag_status = 0;
776
777 if (flg & IP_MF)
778 {
779 frag_status |= IS_FRAG;
780
781 /* This is 1st fragment. */
782 if (ofs == 0)
783 frag_status |= IS_FIRST;
784 }
785 else if (ofs)
786 frag_status = (IS_FRAG | IS_LAST); /* last fragment */
787
788 if (!debug.IP)
789 return;
790
791 dbug_printf ("IP4: %s -> %s\n", ip4_src, ip4_dst);
792
793 ihl = in_GetHdrLen (ip);
794 if (ihl < sizeof(*ip))
795 {
796 dbug_write (" Bad header\n");
797 return;
798 }
799
800 dbug_printf (" IHL %u, ver %u, tos%s, len %u,",
801 ihl, (BYTE)ip->ver, type_of_service(ip->tos),
802 intel16(ip->length));
803
804 chk_ok = do_check_sum (ip->checksum, ip, ihl);
805 dbug_printf (" ttl %u, prot %s, chksum %s\n"
806 " id %04X, ofs %lu",
807 (BYTE)ip->ttl, ip4_protocol(ip->proto), chk_ok,
808 intel16(ip->identification), (u_long)ofs);
809 dbug_flush();
810
811 if (flg & IP_CE)
812 dbug_write (", CE");
813
814 if (flg & IP_DF)
815 dbug_write (", DF");
816
817 if (frag_status)
818 {
819 if (frag_status & IS_FIRST)
820 dbug_write (", 1st frag");
821 if (frag_status & IS_LAST)
822 dbug_write (", last frag");
823 }
824
825 dbug_putc ('\n');
826 opt_len = ihl - sizeof(*ip);
827 if (opt_len > 0)
828 dump_ip_opt (ip + 1, opt_len);
829}
830
831/*----------------------------------------------------------------------*/
832
833static int ip4_orig_dump (const in_Header *this_ip,
834 const in_Header *orig_ip, int icmp_len)
835{
836 WORD ihl;
837 DWORD ofs;
838
839 if (icmp_len < SIZEOF(*orig_ip))
840 {
841 dbug_write (" Too little of original IP-header\n");
842 return dump_data (this_ip, intel16(this_ip->length));
843 }
844
845 ihl = in_GetHdrLen (orig_ip);
846 if (ihl < sizeof(*orig_ip))
847 {
848 dbug_write (" Bad orig. header\n");
849 return dump_data (this_ip, intel16(this_ip->length));
850 }
851
852 dbug_printf (" Orig IP: %s -> %s\n",
853 _inet_ntoa(NULL, intel(orig_ip->source)),
854 _inet_ntoa(NULL, intel(orig_ip->destination)));
855
856 ofs = (intel16(orig_ip->frag_ofs) & IP_OFFMASK) << 3;
857
858 dbug_printf (" IHL %u, ver %u, tos%s, len %u,"
859 " ttl %u, prot %s\n"
860 " chksum %s, id %04X, ofs %lu\n",
861 ihl, (BYTE)orig_ip->ver, type_of_service(orig_ip->tos),
862 intel16(orig_ip->length), (BYTE)orig_ip->ttl,
863 ip4_protocol (orig_ip->proto),
864 do_check_sum (orig_ip->checksum, orig_ip, ihl),
865 intel16 (orig_ip->identification), (u_long)ofs);
866
867 if (icmp_len <= ihl)
868 dbug_write (" No transport header present\n");
869
870 else if (orig_ip->proto == TCP_PROTO && icmp_len - ihl >= 4)
871 {
872 const tcp_Header *tcp = (const tcp_Header*) ((const BYTE*)orig_ip + ihl);
873
874 dbug_printf (" TCP: port %u -> %u\n",
875 intel16(tcp->srcPort), intel16(tcp->dstPort));
876 }
877 else if (orig_ip->proto == UDP_PROTO && icmp_len - ihl >= 4)
878 {
879 const udp_Header *udp = (const udp_Header*) ((const BYTE*)orig_ip + ihl);
880
881 dbug_printf (" UDP: port %u -> %u\n",
882 intel16(udp->srcPort), intel16(udp->dstPort));
883 }
884
885 if (icmp_len > 0) /* consider only original IP as payload */
886 return dump_data (orig_ip, icmp_len);
887 return (1);
888}
889
890/*----------------------------------------------------------------------*/
891
892static int icmp4_dump (const in_Header *ip)
893{
894 WORD len = in_GetHdrLen (ip);
895 const ICMP_PKT *icmp = (const ICMP_PKT*) ((const BYTE*)ip + len);
896 const char *type_str, *chk_ok;
897 char buf [200] = "";
898 char *p = buf;
899 int type, code;
900
901 len = intel16 (ip->length) - len; /* ICMP length */
902 type = icmp->unused.type;
903 code = icmp->unused.code;
904
905 if (len < sizeof(struct ICMP_info))
906 {
907 dbug_write ("ICMP: Short header\n");
908 return (1);
909 }
910
911 /* Simply dump the remaining data if this is a fragment.
912 */
913 if (frag_status)
914 return dump_data (icmp, len);
915
916 switch (type)
917 {
918 case ICMP_UNREACH:
919 type_str = icmp_type_str [ICMP_UNREACH];
920 if (code < DIM(icmp_unreach_str))
921 sprintf (buf, "%s: %s", type_str, icmp_unreach_str[code]);
922 else sprintf (buf, "%s: code %d", type_str, code);
923 break;
924
925 case ICMP_TIMXCEED:
926 type_str = icmp_type_str [ICMP_TIMXCEED];
927 if (code < DIM(icmp_exceed_str))
928 p += sprintf (p, "%s: %s", type_str, icmp_exceed_str[code]);
929 else p += sprintf (buf, "%s: code %d", type_str, code);
930 break;
931
932 case ICMP_REDIRECT:
933 if (code < DIM(icmp_redirect_str))
934 strcpy (buf, icmp_redirect_str[code]);
935 else sprintf (buf, "Redirect; code %d", code);
936 break;
937
938 case ICMP_PARAMPROB:
939 if (code)
940 sprintf (buf, "Param prob code %d", code);
941 else sprintf (buf, "Param prob at %d", icmp->pointer.pointer);
942 break;
943
944 case ICMP_MASKREQ:
945 case ICMP_MASKREPLY:
946 sprintf (buf, "ICMP %s: %s", icmp_type_str[type],
947 _inet_ntoa(NULL, intel(icmp->mask.mask)));
948 break;
949
950#if 0
953 case ICMP_ROUTERADVERT:
954 case ICMP_ROUTERSOLICIT:
955 case ICMP_TSTAMP:
956 case ICMP_TSTAMPREPLY:
957 case ICMP_IREQ:
958 case ICMP_IREQREPLY:
959#endif
960
961 default:
962 sprintf (buf, "%s (%d), code %d",
963 type < DIM(icmp_type_str) ?
964 icmp_type_str[type] : "Unknown", type, code);
965 }
966
967 chk_ok = do_check_sum (icmp->unused.checksum, icmp, len);
968
969 dbug_printf ("ICMP: %s -> %s\n"
970 " %s, chksum %s\n",
971 ip4_src, ip4_dst, buf, chk_ok);
972
973 if (type == ICMP_UNREACH || type == ICMP_PARAMPROB)
974 return ip4_orig_dump (ip, &icmp->ip.ip, len - 8);
975
976 if (type == ICMP_TIMXCEED)
977 return ip4_orig_dump (ip, &icmp->unused.ip, len - 8);
978
979 return dump_data (icmp, len);
980}
981
982/*----------------------------------------------------------------------*/
983
984#if defined(USE_MULTICAST)
985
986static int igmp0_dump (const IGMPv0_packet *igmp, WORD len)
987{
988 ARGSUSED (len);
989 return dbug_printf ("IGMP: unfinished IGMP v0 parser. addr %s\n",
990 _inet_ntoa(NULL, intel(igmp->address)));
991}
992
993static int igmp1_dump (const IGMPv1_packet *igmp, WORD len)
994{
995 static const struct search_list types[] = {
996 { IGMPv1_QUERY, "Query" },
997 { IGMPv1_REPORT, "Report" },
998 { IGMPv1_DVMRP, "DVMRP" }
999 };
1000 return dbug_printf ("IGMP: %s, ver %d, chksum %s, addr %s\n",
1001 list_lookup(igmp->type, types, DIM(types)),
1002 igmp->version, do_check_sum(igmp->checksum, igmp, len),
1003 _inet_ntoa(NULL, intel(igmp->address)));
1004}
1005
1006static int igmp2_dump (const IGMPv2_packet *igmp, WORD len)
1007{
1008 ARGSUSED (len);
1009 return dbug_printf ("IGMP: unfinished IGMP v2 parser. addr %s\n",
1010 _inet_ntoa(NULL, intel(igmp->address)));
1011}
1012
1013static int igmp3_dump (const IGMPv3_packet *igmp, WORD len)
1014{
1015 ARGSUSED (len);
1016 return dbug_printf ("IGMP: unfinished IGMP v3 parser. addr %s\n",
1017 _inet_ntoa(NULL, intel(igmp->address)));
1018}
1019
1020static int igmp_dump (const in_Header *ip)
1021{
1022 WORD hdr_len = in_GetHdrLen (ip); /* length of IP-header */
1023 const IGMPv0_packet *igmp0 = (const IGMPv0_packet*) ((const BYTE*)ip + hdr_len);
1024 const IGMPv1_packet *igmp1 = (const IGMPv1_packet*) igmp0;
1025 const IGMPv2_packet *igmp2 = (const IGMPv2_packet*) igmp0;
1026 const IGMPv3_packet *igmp3 = (const IGMPv3_packet*) igmp0;
1027 WORD igmp_len = intel16 (ip->length) - hdr_len;
1028 BOOL is_v [4] = { FALSE, FALSE, FALSE, FALSE };
1029
1030 if (igmp_len == sizeof(*igmp1) && igmp1->version == 1) /* 8 byte */
1031 is_v[1] = TRUE;
1032 else if (igmp_len == sizeof(*igmp2)) /* 8 byte */
1033 is_v[2] = TRUE;
1034 else if (igmp_len == sizeof(*igmp0)) /* 16 byte */
1035 is_v[0] = TRUE;
1036 else if (igmp_len >= sizeof(*igmp3)) /* >= 14 byte, multiple of 4 (14,18,22..) */
1037 is_v[3] = TRUE;
1038 else return dbug_printf ("IGMP: Header length %u??\n", igmp_len);
1039
1040 if (is_v[0])
1041 return igmp0_dump (igmp0, igmp_len);
1042 if (is_v[1])
1043 return igmp1_dump (igmp1, igmp_len);
1044 if (is_v[2])
1045 return igmp2_dump (igmp2, igmp_len);
1046 if (is_v[3])
1047 return igmp3_dump (igmp3, igmp_len);
1048
1049 return dbug_printf ("IGMP: Unknown pkt, len %u\n", igmp_len);
1050}
1051#endif /* USE_MULTICAST */
1052
1053/*----------------------------------------------------------------------*/
1054
1055#if defined(USE_SCTP)
1056/*
1057 * A simple SCTP dumper used for both SCTP inside IPv4 and IPv6 packets.
1058 *
1059 * Refs:
1060 * RFC 2960, 3309, 3758, 4460
1061 */
1062static const struct search_list sctp_chunks[] = {
1063 { SCTP_DATA, "DATA" },
1064 { SCTP_INITIATION, "INIT" },
1065 { SCTP_INITIATION_ACK, "INIT-ACK" },
1066 { SCTP_SELECTIVE_ACK, "SACK" },
1067 { SCTP_HEARTBEAT_REQUEST, "HB REQ" },
1068 { SCTP_HEARTBEAT_ACK, "HB ACK" },
1069 { SCTP_ABORT_ASSOCIATION, "ABORT" },
1070 { SCTP_SHUTDOWN, "SHUTDOWN" },
1071 { SCTP_SHUTDOWN_ACK, "SHUTDOWN ACK" },
1072 { SCTP_OPERATION_ERR, "OP ERR" },
1073 { SCTP_COOKIE_ECHO, "COOKIE ECHO" },
1074 { SCTP_COOKIE_ACK, "COOKIE ACK" },
1075 { SCTP_ECN_ECHO, "ECN ECHO" },
1076 { SCTP_ECN_CWR, "ECN CWR" },
1077 { SCTP_SHUTDOWN_COMPLETE, "SHUTDOWN COMPLETE" },
1078 { SCTP_FORWARD_CUM_TSN, "FOR CUM TSN" },
1079 { SCTP_RELIABLE_CNTL, "REL CTRL" },
1080 { SCTP_RELIABLE_CNTL_ACK, "REL CTRL ACK" },
1081 { SCTP_ASCONF_ACK_CHUNK_ID, "ASCONF ACK CHUNK ID" },
1082 { SCTP_PKTDROP_CHUNK_ID, "PKTDROP CHUNK ID" },
1083 { SCTP_STREAM_RESET_CHUNK_ID, "STREAM RESET_CHUNK ID" },
1084 { SCTP_IETF_EXT, "IETF EXT" }
1085 };
1086
1087static const struct search_list sctp_params[] = {
1088 { SCTP_IPV4_PARAM_TYPE, "IPV4 PARAM TYPE" },
1089 { SCTP_IPV6_PARAM_TYPE, "IPV6 PARAM TYPE" },
1090 { SCTP_RESPONDER_COOKIE, "RESPONDER COOKIE" },
1091 { SCTP_UNRECOG_PARAM, "UNRECOG_PARAM" },
1092 { SCTP_COOKIE_PRESERVE, "COOKIE PRESERVE" },
1093 { SCTP_HOSTNAME_VIA_DNS, "HOSTNAME VIA_DNS" },
1094 { SCTP_RESTRICT_ADDR_TO, "RESTRICT ADDR_TO" },
1095 { SCTP_ECN_I_CAN_DO_ECN, "I CAN DO ECN" },
1096 { SCTP_OPERATION_SUCCEED, "OPERATION SUCCEED" },
1097 { SCTP_ERROR_NOT_EXECUTED, "ERROR NOT EXECUTED" },
1098 { SCTP_UNRELIABLE_STRM, "UNRELIABLE STRM" },
1099 { SCTP_ADD_IP_ADDRESS, "ADD IP ADDRESS" },
1100 { SCTP_DEL_IP_ADDRESS, "DEL IP ADDRESS" },
1101 { SCTP_STRM_FLOW_LIMIT, "STRM FLOW LIMIT" },
1102 { SCTP_PARTIAL_CSUM, "PARTIAL CSUM" },
1103 { SCTP_ERROR_CAUSE_TLV, "ERROR CAUSE TLV" },
1104 { SCTP_MIT_STACK_NAME, "MIT STACK NAME" },
1105 { SCTP_SETADDRESS_PRIMARY, "SETADDRESS PRIMARY" },
1106 { SCTP_RANDOM_PARAM, "RANDOM PARAM" },
1107 { SCTP_AUTH_CHUNK, "AUTH CHUNK" },
1108 { SCTP_REQ_HMAC_ALGO, "REQ HMAC ALGO" },
1109 { SCTP_SUPPORTED_EXT, "SUPPORTED EXT" }
1110 };
1111
1112static void sctp_dump_params (const BYTE *p, int len)
1113{
1114 while (len > 0)
1115 {
1116 const struct sctp_ParamDesc *param = (const struct sctp_ParamDesc*) p;
1117 WORD plen = intel16 (param->paramLength);
1118 WORD ptype = intel16 (param->paramType);
1119 WORD align = 0;
1120
1121 dbug_printf (" param: plen %d, %s\n",
1122 plen, list_lookupX(ptype, sctp_params, DIM(sctp_params)));
1123 align = plen % 4;
1124 if (align != 0)
1125 align = 4 - align;
1126 len -= plen + align;
1127 p += plen + align;
1128 }
1129}
1130
1131static void sctp_dump_init (const struct sctp_Initiation *init, const BYTE *chunk_end)
1132{
1133 dbug_printf (" init tag %lu, rwnd %lu, OS %u, MIS %u, init TSN %lu\n",
1134 intel(init->initTag), intel(init->rcvWindowCredit),
1135 intel16(init->NumPreopenStreams), intel16(init->MaxInboundStreams),
1136 intel(init->initialTSN));
1137 init++;
1138 /* optional parameters after init-message */
1139 if ((const BYTE*)init < chunk_end)
1140 sctp_dump_params ((const BYTE*)init, chunk_end - (const BYTE*)init);
1141}
1142
1143static int sctp_dump (const in_Header *ip4, const in6_Header *ip6)
1144{
1145 const struct sctp_Header *head;
1146 const struct sctp_ChunkDesc *chunk;
1147 WORD hlen, chunk_cnt, chunk_len;
1148 size_t len;
1149
1150 if (ip4)
1151 {
1152 hlen = in_GetHdrLen (ip4);
1153 head = (const struct sctp_Header*) ((const BYTE*)ip4 + hlen);
1154 len = intel16 (ip4->length) - hlen;
1155 }
1156 else
1157 {
1158 len = intel16 (ip6->len);
1159 len = min (len, MAX_IP6_DATA - sizeof(*ip6));
1160 head = (const struct sctp_Header*) (ip6 + 1);
1161 }
1162
1163 if (len < sizeof(*head))
1164 {
1165 dbug_printf ("SCTP: Bogus length %u\n", (unsigned)len);
1166 return (0);
1167 }
1168
1169 dbug_printf ("SCTP: %s (%d) -> %s (%d), Verif 0x%08lX, Adler 0x%08lX\n",
1170 ip4 ? ip4_src : ip6_src, intel16(head->source),
1171 ip4 ? ip4_dst : ip6_dst, intel16(head->destination),
1172 intel(head->verificationTag), intel(head->adler32));
1173
1174 len -= sizeof(*head);
1175 if (len < sizeof(*chunk))
1176 {
1177 dbug_printf (" no chunks!!, len %u\n", (unsigned)len);
1178 return (0);
1179 }
1180 chunk = (const struct sctp_ChunkDesc*) (head + 1);
1181
1182 for (chunk_cnt = 1; len > 0; chunk_cnt++)
1183 {
1184 const BYTE *chunk_end;
1185 WORD align;
1186
1187 chunk_len = intel16 (chunk->chunkLength);
1188 chunk_end = ((const BYTE*)chunk + chunk_len);
1189
1190 if (chunk_len < sizeof(*chunk))
1191 {
1192 dbug_printf ("%d) [Bad chunk length %u]\n", chunk_cnt + 1, chunk_len);
1193 break;
1194 }
1195 dbug_printf (" chunk %d: [%s], len %d, flag 0x%02X\n",
1196 chunk_cnt, list_lookup(chunk->chunkID, sctp_chunks, DIM(sctp_chunks)),
1197 chunk_len, chunk->chunkFlg);
1198
1199 if (chunk->chunkID == SCTP_INITIATION || chunk->chunkID == SCTP_INITIATION_ACK)
1200 sctp_dump_init ((const struct sctp_Initiation*)(chunk + 1), chunk_end);
1201
1202 align = chunk_len % 4;
1203 if (align != 0)
1204 align = 4 - align;
1205
1206 chunk = (const struct sctp_ChunkDesc*) (chunk_end + align);
1207 len -= chunk_len + align;
1208 }
1209 return dump_data (chunk, len);
1210}
1211#endif
1212
1213/*----------------------------------------------------------------------*/
1214
1215static unsigned ip4_payload_dump (const void *sock, const in_Header *ip)
1216{
1217#if defined(USE_MULTICAST)
1218 if (ip->proto == IGMP_PROTO && debug.IGMP)
1219 return igmp_dump (ip);
1220#endif
1221
1222#if defined(USE_SCTP)
1223 if (ip->proto == SCTP_PROTO && debug.SCTP)
1224 return sctp_dump (ip, FALSE);
1225#endif
1226
1227 if (ip->proto == ICMP_PROTO && debug.ICMP)
1228 return icmp4_dump (ip);
1229
1230 if (ip->proto == UDP_PROTO && debug.UDP)
1231 return udp_dump ((const _udp_Socket*)sock, ip);
1232
1233 if (ip->proto == TCP_PROTO && debug.TCP)
1234 return tcp_dump ((const _tcp_Socket*)sock, ip);
1235
1236 if (debug.IP) /* dump unsupported IPv4 protocols as hex */
1237 {
1238 WORD hlen = in_GetHdrLen (ip);
1239 WORD len = intel16 (ip->length) - hlen;
1240 const BYTE *data = (const BYTE*)ip + hlen;
1241 return dump_data (data, min(len, (WORD)(MAX_IP4_DATA - hlen)));
1242 }
1243 return (0);
1244}
1245
1246/*----------------------------------------------------------------------*/
1247
1248#if defined(USE_IPV6)
1249static const char *ip6_next_hdr (BYTE nxt)
1250{
1251 switch (nxt)
1252 {
1253 case IP6_NEXT_HOP:
1254 return ("HBH");
1255 case IP6_NEXT_TCP:
1256 return ("TCP");
1257 case IP6_NEXT_UDP:
1258 return ("UDP");
1259 case IP6_NEXT_IPV6:
1260 return ("IPV6");
1261 case IP6_NEXT_ROUTING:
1262 return ("ROUTE");
1263 case IP6_NEXT_FRAGMENT:
1264 return ("FRAG");
1265 case IP6_NEXT_ESP:
1266 return ("ESP");
1267 case IP6_NEXT_AUTH:
1268 return ("AUTH");
1269 case IP6_NEXT_ICMP:
1270 return ("ICMP6");
1271 case IP6_NEXT_NONE:
1272 return ("NONE");
1273 case IP6_NEXT_DEST:
1274 return ("DEST");
1275 case IP6_NEXT_SCTP:
1276 return ("SCTP");
1277 default:
1278 return ("??");
1279 }
1280}
1281
1282static const char *icmp6_options (const BYTE *opt, int tot_len)
1283{
1284 static char buf [50];
1285 char *p = buf;
1286 int len, val;
1287
1288 while (tot_len > 0 && p < buf + DIM(buf))
1289 {
1290 switch (val = *opt++)
1291 {
1292 case ND_OPT_SOURCE_LINKADDR:
1293 p += sprintf (p, "src MAC %s, ", MAC_address(opt));
1294 break;
1295 case 0:
1296 p += sprintf (p, "EOL, ");
1297 break;
1298 default:
1299 p += sprintf (p, "opt %d?, ", val);
1300 break;
1301 }
1302 len = (*opt++) << 3;
1303 tot_len -= len;
1304 if (tot_len <= 0)
1305 {
1306 p -= 2;
1307 *p = '\0';
1308 return (buf);
1309 }
1310 }
1311 return (NULL);
1312}
1313
1314static int icmp6_dump (const in6_Header *ip)
1315{
1316 const union ICMP6_PKT *icmp = (const union ICMP6_PKT*) (ip + 1);
1317 unsigned len = intel16 (ip->len);
1318 unsigned type = icmp->unused.type;
1319 char buf [200] = "";
1320 char *p = buf;
1321 const BYTE *opt = NULL;
1322 int rc;
1323
1324 if (len < sizeof(icmp->unused))
1325 {
1326 dbug_write ("ICMP6: Short packet\n");
1327 return (1);
1328 }
1329
1330 switch (type)
1331 {
1332 case ICMP6_DST_UNREACH:
1333 sprintf (buf, "Dest unreach");
1334 break;
1335
1336 case ICMP6_PACKET_TOO_BIG:
1337 sprintf (buf, "Pkt too big");
1338 break;
1339
1340 case ICMP6_TIME_EXCEEDED:
1341 sprintf (buf, "Time exceeded");
1342 break;
1343
1344 case ICMP6_PARAM_PROB:
1345 sprintf (buf, "Param problem");
1346 break;
1347
1348 case ICMP6_ECHO_REQUEST:
1349 sprintf (buf, "Echo request");
1350 break;
1351
1352 case ICMP6_ECHO_REPLY:
1353 sprintf (buf, "Echo reply");
1354 break;
1355
1356 case ICMP6_MEMBERSHIP_QUERY:
1357 sprintf (buf, "Member query");
1358 break;
1359
1360 case ICMP6_MEMBERSHIP_REPORT:
1361 sprintf (buf, "Member report");
1362 break;
1363
1364 case ICMP6_MEMBERSHIP_REDUCTION:
1365 sprintf (buf, "Member reduction");
1366 break;
1367
1368 case ICMP6_ROUTER_RENUMBERING:
1369 sprintf (buf, "Router renum");
1370 break;
1371
1372 case ICMP6_WRUREQUEST:
1373 sprintf (buf, "Who are you request");
1374 break;
1375
1376 case ICMP6_WRUREPLY:
1377 sprintf (buf, "Who are you reply");
1378 break;
1379
1380 case ND_ROUTER_SOLICIT:
1381 sprintf (buf, "Router solicitation");
1382 break;
1383
1384 case ND_ROUTER_ADVERT:
1385 p += sprintf (p, "Router advert");
1386 if (len >= sizeof(icmp->radvert))
1387 p += sprintf (p, ", hop-lim %d, managed %d, lifetime %u\n"
1388 " reach-time %lu, retrans-time %lu",
1389 icmp->radvert.hop_limit, icmp->radvert.managed,
1390 intel16(icmp->radvert.lifetime),
1391 (u_long)intel(icmp->radvert.reach_time),
1392 (u_long)intel(icmp->radvert.retrans_time));
1393 else p += sprintf (p, ", short packet");
1394 break;
1395
1396 case ND_NEIGHBOR_SOLICIT:
1397 sprintf (buf, "Neighbor solicitation, target %s",
1398 _inet6_ntoa(&icmp->nd_solic.target));
1399 opt = (const BYTE*)icmp + sizeof(icmp->nd_solic);
1400 opt = (const BYTE*)icmp6_options (opt, len - sizeof(icmp->nd_solic));
1401 break;
1402
1403 case ND_NEIGHBOR_ADVERT:
1404 sprintf (buf, "Neighbor advert");
1405 break;
1406
1407 case ND_REDIRECT:
1408 sprintf (buf, "Redirect");
1409 break;
1410
1411 default:
1412 sprintf (buf, "Unknown type %d", type);
1413 break;
1414 }
1415
1416 rc = dbug_printf ("ICMP6: %s, code %d\n"
1417 " chksum %04X (%s)\n",
1418 buf, icmp->unused.code, icmp->unused.checksum,
1419 _ip6_icmp_checksum(ip, icmp, len) ? "ok" : "ERROR");
1420 if (opt)
1421 rc += dbug_printf (" Opt: %s\n", opt);
1422 return (rc);
1423}
1424
1425static int ip6_header_dump (const in6_Header *ip)
1426{
1427 char src_type [20];
1428 char dst_type [20];
1429 int len;
1430
1431 ip6_addr_type (src_type, &ip->source);
1432 ip6_addr_type (dst_type, &ip->destination);
1433
1434 len = dbug_printf ("IP6: %s %s-> %s %s\n",
1435 ip6_src, src_type, ip6_dst, dst_type);
1436 len += dbug_printf (" ver %d, pri %d, flow %d,%d,%d, len %u, "
1437 "next-hdr %s (%u), hop-lim %d\n",
1438 ip->ver, ip->pri, ip->flow_lbl [0], ip->flow_lbl [1], ip->flow_lbl [2],
1439 intel16(ip->len), ip6_next_hdr(ip->next_hdr), ip->next_hdr, ip->hop_limit);
1440 return (len);
1441}
1442
1443static unsigned ip6_payload_dump (const void *sock, const in6_Header *ip)
1444{
1445 if (ip->next_hdr == IP6_NEXT_ICMP && debug.ICMP)
1446 return icmp6_dump (ip);
1447
1448 if (ip->next_hdr == IP6_NEXT_UDP && debug.UDP)
1449 return udp6_dump ((const _udp_Socket*)sock, ip);
1450
1451 if (ip->next_hdr == IP6_NEXT_TCP && debug.TCP)
1452 return tcp_dump ((const _tcp_Socket*)sock, (const in_Header*)ip);
1453
1454#if defined(USE_SCTP)
1455 if (ip->next_hdr == IP6_NEXT_SCTP && debug.SCTP)
1456 return sctp_dump (NULL, ip);
1457#endif
1458
1459 if (debug.IP) /* dump IPv6-network protocols as hex */
1460 {
1461 WORD len = intel16 (ip->len);
1462
1463 len = min (len, MAX_IP6_DATA - sizeof(*ip));
1464 return dump_data (ip + 1, len);
1465 }
1466 return (0);
1467}
1468#endif /* USE_IPV6 */
1469
1470/*----------------------------------------------------------------------*/
1471
1472#if defined(USE_PPPOE)
1473struct token {
1474 int v;
1475 const char *s;
1476 };
1477
1478const struct token ppp_type2str[] = {
1479 { PPP_IP, "IP" },
1480 { PPP_IPV6, "IP6" },
1481 { PPP_IPX, "IPX" },
1482 { PPP_VJC, "VJC" },
1483 { PPP_VJNC, "VJNC" },
1484 { PPP_IPCP, "IPCP" },
1485 { PPP_IPXCP, "IPXCP" },
1486 { PPP_LCP, "LCP" },
1487 { PPP_LQR, "LQR" },
1488 { PPP_CCP, "CCP" },
1489 { PPP_PAP, "PAP" },
1490 { PPP_CHAP, "CHAP" },
1491 { PPP_CBCP, "CBCP" },
1492 { PPP_COMP, "COMP" },
1493 { 0, NULL }
1494 };
1495
1496/*
1497 * Convert a token value to a string; use "fmt" if not found.
1498 */
1499static const char *tok2str (const struct token *lp, const char *fmt, int v)
1500{
1501 static char buf [128];
1502
1503 while (lp->s)
1504 {
1505 if (lp->v == v)
1506 return (lp->s);
1507 ++lp;
1508 }
1509 if (!fmt)
1510 fmt = "#%d";
1511 sprintf (buf, fmt, v);
1512 return (buf);
1513}
1514
1515static const char *pppoe_get_tag (const BYTE *tag)
1516{
1517 static char buf [100];
1518 char *p = buf;
1519 WORD type = *(WORD*)tag;
1520 int len = intel16 (*(WORD*)(tag+2));
1521
1522 switch (type)
1523 {
1524 case PPPOE_TAG_END_LIST:
1525 return ("end");
1526
1527 case PPPOE_TAG_SERVICE_NAME:
1528 len = min (len, SIZEOF(buf) - 12);
1529 sprintf (buf, "service-name `%.*s'", len, tag + PPPOE_TAG_HDR_SIZE);
1530 break;
1531
1532 case PPPOE_TAG_AC_NAME:
1533 len = min (len, SIZEOF(buf) - 12);
1534 sprintf (buf, "AC-name `%.*s'", len, tag + PPPOE_TAG_HDR_SIZE);
1535 break;
1536
1537 case PPPOE_TAG_AC_COOKIE:
1538 p += sprintf (p, "AC-cookie ");
1539 tag += PPPOE_TAG_HDR_SIZE;
1540 while (len > 0 && p < buf + sizeof(buf) - 4)
1541 {
1542 p += sprintf (p, "%02X-", *tag & 255);
1543 tag++;
1544 len--;
1545 }
1546 *(p-1) = '\0';
1547 break;
1548
1549 case PPPOE_TAG_HOST_UNIQ:
1550 p += sprintf (p, "host-uniq ");
1551 tag += PPPOE_TAG_HDR_SIZE;
1552 while (len > 0 && p < buf + sizeof(buf) - 4)
1553 {
1554 p += sprintf (p, "%02X-", *tag & 255);
1555 tag++;
1556 len--;
1557 }
1558 *(p-1) = '\0';
1559 break;
1560
1561 case PPPOE_TAG_VENDOR_SPES:
1562 sprintf (buf, "vendor spec ID %08lX", *(DWORD*)(tag+4));
1563 break;
1564
1565 case PPPOE_TAG_RELAY_SESS:
1566 sprintf (buf, "relay session %d", *(WORD*)(tag+4));
1567 break;
1568
1569 case PPPOE_TAG_HOST_URL:
1570 len = min (len, SIZEOF(buf) - 12);
1571 sprintf (buf, "host URL `%.*s'", len, tag + PPPOE_TAG_HDR_SIZE);
1572 break;
1573
1574 case PPPOE_TAG_MOTM:
1575 len = min (len, SIZEOF(buf) - 12);
1576 sprintf (buf, "msg-of-the-minute `%.*s'",
1577 len, tag + PPPOE_TAG_HDR_SIZE);
1578 break;
1579
1580 case PPPOE_TAG_IP_ROUTE_ADD:
1581 {
1582 char buf1 [20];
1583 char buf2 [20];
1584 char buf3 [20];
1585 const char *dest_net = _inet_ntoa (buf1, intel(*(DWORD*)(tag+4)));
1586 const char *dest_mask = _inet_ntoa (buf2, intel(*(DWORD*)(tag+8)));
1587 const char *gateway = _inet_ntoa (buf3, intel(*(DWORD*)(tag+12)));
1588 DWORD metric = intel (*(DWORD*)(tag+16));
1589
1590 sprintf (buf, "route add: %s %s %s / %lu",
1591 dest_net, dest_mask, gateway, metric);
1592 }
1593 break;
1594
1595 case PPPOE_TAG_SERVICE_ERR:
1596 return ("service error");
1597
1598 case PPPOE_TAG_AC_SYSTEM_ERR:
1599 return ("AC-system err");
1600
1601 case PPPOE_TAG_GENERIC_ERR:
1602 return ("generic error");
1603
1604 default:
1605 sprintf (buf, "unknown %04X", intel16(type));
1606 break;
1607 }
1608 return (buf);
1609}
1610
1611const char *pppoe_get_code (WORD code)
1612{
1613 switch (code)
1614 {
1615 case PPPOE_CODE_PADI:
1616 return ("PADI");
1617 case PPPOE_CODE_PADO:
1618 return ("PADO");
1619 case PPPOE_CODE_PADR:
1620 return ("PADR");
1621 case PPPOE_CODE_PADS:
1622 return ("PADS");
1623 case PPPOE_CODE_PADT:
1624 return ("PADT");
1625 case PPPOE_CODE_PADM:
1626 return ("PADM");
1627 case PPPOE_CODE_PADN:
1628 return ("PADN");
1629 default:
1630 return ("??");
1631 }
1632}
1633
1634static __inline int pppoe_head_dump (const struct pppoe_Header *head,
1635 const char *proto)
1636{
1637 WORD len = intel16 (head->length);
1638
1639 if (head->ver != 1 || head->type != 1 || len > PPPOE_MAX_DATA)
1640 {
1641 dbug_printf ("PPPOE: bogus header: ver %u, type %u, len %u\n",
1642 head->ver, head->type, len);
1643 return (0);
1644 }
1645 return dbug_printf ("PPPOE: %s, len %u, code %s (%04X), session %d\n",
1646 proto, len, pppoe_get_code(head->code), head->code,
1647 intel16(head->session));
1648}
1649
1650static int pppoe_disc_dump (const struct pppoe_Packet *pppoe)
1651{
1652 WORD tlen;
1653 const BYTE *tags;
1654
1655 if (!pppoe_head_dump(&pppoe->head, "Discovery"))
1656 return (1);
1657
1658 tags = (const BYTE*) &pppoe->data[0];
1659 tlen = intel16 (pppoe->head.length);
1660 while (tlen > 0)
1661 {
1662 WORD tag_len = intel16 (*(WORD*)(tags+2));
1663
1664 dbug_printf (" tag: %s\n", pppoe_get_tag(tags));
1665 tlen -= (PPPOE_TAG_HDR_SIZE + tag_len);
1666 tags += (PPPOE_TAG_HDR_SIZE + tag_len);
1667 }
1668 return (1);
1669}
1670
1671static int pppoe_sess_dump (const void *sock, const struct pppoe_Packet *pppoe)
1672{
1673 WORD proto, len;
1674 const BYTE *buf;
1675
1676 if (!pppoe_head_dump(&pppoe->head, "Session"))
1677 return (1);
1678
1679 len = intel16 (pppoe->head.length) - 2;
1680 proto = intel16 (*(WORD*)&pppoe->data[0]);
1681 buf = &pppoe->data[2];
1682
1683 dbug_printf (" Protocol %04X (%s)\n", proto,
1684 tok2str(ppp_type2str, "%u??", proto));
1685
1686 if (proto == PPP_IP)
1687 {
1688 const in_Header *ip = (const in_Header*) buf;
1689
1690 _inet_ntoa (ip4_src, intel(ip->source));
1691 _inet_ntoa (ip4_dst, intel(ip->destination));
1692
1693 ip4_dump (ip);
1694 return ip4_payload_dump (sock, ip);
1695 }
1696
1697 if (proto == PPP_CCP)
1698 return ccp_dump (buf);
1699
1700 if (proto == PPP_LCP)
1701 return lcp_dump (buf);
1702
1703 if (proto == PPP_IPCP)
1704 return ipcp_dump (buf);
1705
1706 return dump_data (buf, len);
1707}
1708#endif
1709
1710/*----------------------------------------------------------------------*/
1711
1712static const char *udp_tcp_checksum (const in_Header *ip,
1713 const udp_Header *udp,
1714 const tcp_Header *tcp)
1715{
1716 tcp_PseudoHeader ph;
1717 int len;
1718
1719 memset (&ph, '\0', sizeof(ph));
1720 if (udp)
1721 {
1722 len = intel16 (udp->length);
1723 ph.protocol = UDP_PROTO;
1724 ph.checksum = CHECKSUM (udp, len);
1725 }
1726 else
1727 {
1728 len = intel16 (ip->length) - in_GetHdrLen (ip);
1729 ph.protocol = TCP_PROTO;
1730 ph.checksum = CHECKSUM (tcp, len);
1731 }
1732
1733 ph.src = ip->source;
1734 ph.dst = ip->destination;
1735 ph.length = intel16 (len);
1736
1737 if (CHECKSUM(&ph, sizeof(ph)) == 0xFFFF)
1738 return ("ok");
1739 return ("ERROR");
1740}
1741
1742#if defined(USE_IPV6)
1743static const char *udp_checksum (const in6_Header *ip, const udp_Header *udp)
1744{
1745 if (_ip6_checksum(ip, IP6_NEXT_UDP, udp, intel16(ip->len)) == 0xFFFF)
1746 return ("ok");
1747 return ("ERROR");
1748}
1749
1750static const char *tcp_checksum (const in6_Header *ip, const tcp_Header *tcp)
1751{
1752 if (_ip6_checksum(ip, IP6_NEXT_TCP, tcp, intel16(ip->len)) == 0xFFFF)
1753 return ("ok");
1754 return ("ERROR");
1755}
1756#endif
1757
1758/*----------------------------------------------------------------------*/
1759
1760static BOOL is_dns_packet (WORD src_port, WORD dst_port)
1761{
1762 WORD dns_port;
1763
1764 if (!dbg_dns_details)
1765 return (FALSE);
1766
1767 dns_port = intel16 (DOM_DST_PORT);
1768
1769#if 1
1770 if (src_port == dns_port || dst_port == dns_port)
1771 return (TRUE);
1772#else
1773 if ((!outbound && src_port == dns_port) || /* Rx from DNS */
1774 ( outbound && dst_port == dns_port)) /* Tx to DNS */
1775 return (TRUE);
1776#endif
1777 return (FALSE);
1778}
1779
1780/*----------------------------------------------------------------------*/
1781
1782static int udp_dump (const _udp_Socket *sock, const in_Header *ip)
1783{
1784 const char *chk_ok = "n/a";
1785 WORD iplen = intel16 (ip->length) - sizeof(*ip);
1786 const udp_Header *udp = (const udp_Header*) ((BYTE*)ip + in_GetHdrLen(ip));
1787 WORD udplen = intel16 (udp->length) - sizeof(*udp);
1788 const BYTE *data = (const BYTE*) (udp+1);
1789
1790 if (udp->checksum && !frag_status)
1791 chk_ok = udp_tcp_checksum (ip, udp, NULL);
1792
1793 if (frag_status || udplen > iplen)
1794 udplen = min (udplen, iplen);
1795
1796 if (frag_status && !(frag_status & IS_FIRST)) /* is a fragment and not 1st */
1797 return dump_data (udp, iplen);
1798
1799 dump_addr_port ("UDP", sock, ip);
1800
1801 dbug_printf (" len %d, chksum %04X (%s)\n",
1802 intel16(udp->length), intel16(udp->checksum), chk_ok);
1803
1804 if (udplen >= sizeof(struct DNS_Header) &&
1805 is_dns_packet(udp->srcPort,udp->dstPort))
1806 return dns_dump (data, udplen, 0);
1807 return dump_data (data, udplen);
1808}
1809
1810#if defined(USE_IPV6)
1811static int udp6_dump (const _udp_Socket *sock, const in6_Header *ip)
1812{
1813 WORD iplen = intel16 (ip->len);
1814 const udp_Header *udp = (const udp_Header*) (ip + 1);
1815 WORD udplen = intel16 (udp->length) - sizeof(*udp);
1816 const BYTE *data = (const BYTE*) (udp + 1);
1817 const char *chk_ok = udp_checksum (ip, udp);
1818
1819 udplen = min (udplen, (WORD)(iplen - sizeof(*udp)));
1820
1821 dump_addr6_port ("UDP", sock, ip);
1822
1823 dbug_printf (" len %d, chksum %04X (%s)\n",
1824 intel16(udp->length), intel16(udp->checksum), chk_ok);
1825
1826 if (udplen >= sizeof(struct DNS_Header) &&
1827 is_dns_packet(udp->srcPort, udp->dstPort))
1828 return dns_dump (data, udplen, 0);
1829 return dump_data (data, udplen);
1830}
1831#endif /* USE_IPV6 */
1832
1833/*----------------------------------------------------------------------*/
1834
1835static int tcp_dump (const _tcp_Socket *sock, const in_Header *ip)
1836{
1837 const tcp_Header *tcp;
1838 const BYTE *data;
1839 const char *chk_ok = "n/a";
1840 WORD hlen;
1841 WORD iplen, dlen, olen;
1842 DWORD win, ack, seq;
1843 char flg_buf [4*8+1] = { 0 };
1844
1845#if defined(USE_IPV6)
1846 const in6_Header *ip6 = (const in6_Header*) ip;
1847
1848 if (ip->ver == 6)
1849 {
1850 iplen = intel16 (ip6->len);
1851 tcp = (const tcp_Header*) (ip6 + 1);
1852 hlen = tcp->offset << 2;
1853 dlen = iplen - hlen;
1854 }
1855 else
1856#endif
1857 {
1858 int j;
1859 iplen = intel16 (ip->length) - sizeof(*ip);
1860 j = in_GetHdrLen (ip);
1861 tcp = (const tcp_Header*) ((const BYTE*)ip + j);
1862 hlen = tcp->offset << 2;
1863 dlen = intel16 (ip->length) - j - hlen;
1864 }
1865
1866 data = (const BYTE*) tcp + hlen;
1867 win = intel16 (tcp->window);
1868
1869 if (frag_status || dlen > iplen)
1870 dlen = min (dlen, iplen);
1871
1872 if (hlen < sizeof(*tcp))
1873 {
1874 dbug_write (" Bad header\n");
1875 return (0);
1876 }
1877
1878 if (frag_status && !(frag_status & IS_FIRST))
1879 return dump_data (tcp, iplen);
1880
1881 if (tcp->flags & tcp_FlagACK) strcat (flg_buf, " ACK");
1882 if (tcp->flags & tcp_FlagFIN) strcat (flg_buf, " FIN");
1883 if (tcp->flags & tcp_FlagSYN) strcat (flg_buf, " SYN");
1884 if (tcp->flags & tcp_FlagPUSH) strcat (flg_buf, " PSH");
1885 if (tcp->flags & tcp_FlagRST) strcat (flg_buf, " RST");
1886 if (tcp->flags & tcp_FlagURG) strcat (flg_buf, " URG");
1887 if (tcp->flags & tcp_FlagECN) strcat (flg_buf, " ECN");
1888 if (tcp->flags & tcp_FlagCWR) strcat (flg_buf, " CWR");
1889
1890 if (!frag_status || (frag_status & IS_FIRST))
1891 {
1892#if defined(USE_IPV6)
1893 if (ip->ver == 6)
1894 chk_ok = tcp_checksum (ip6, tcp);
1895 else
1896#endif
1897 chk_ok = udp_tcp_checksum (ip, NULL, tcp);
1898 }
1899
1900#if defined(USE_IPV6)
1901 if (ip->ver == 6)
1902 dump_addr6_port ("TCP", sock, ip6);
1903 else
1904#endif
1905 dump_addr_port ("TCP", sock, ip);
1906
1907 if (sock)
1908 win <<= outbound ? sock->tx_wscale : sock->rx_wscale;
1909
1910 ack = intel (tcp->acknum);
1911 seq = intel (tcp->seqnum);
1912
1913 dbug_printf (" flags%s, win %lu, chksum %04X (%s), urg %u\n"
1914 " SEQ %10lu, ACK %10lu\n",
1915 flg_buf, (u_long)win, intel16(tcp->checksum), chk_ok,
1916 intel16(tcp->urgent), (u_long)seq, (u_long)ack);
1917 if (sock)
1918 {
1919 BOOL in_seq_space;
1920 UINT state = sock->state;
1921 long delta_seq, delta_ack;
1922 long ms_left, ms_right;
1923
1924 if (outbound)
1925 {
1926 if (state == tcp_StateSYNREC && sock->last_acknum[0] == 0)
1927 delta_ack = 0;
1928 else delta_ack = ack - sock->last_acknum[0];
1929
1930 if (state == tcp_StateSYNSENT && sock->last_seqnum[0] == 0)
1931 delta_seq = 0;
1932 else delta_seq = seq - sock->last_seqnum[0];
1933
1934 ((_tcp_Socket*)sock)->last_seqnum[0] = seq; /* !! unconst */
1935 ((_tcp_Socket*)sock)->last_acknum[0] = ack;
1936 }
1937 else
1938 {
1939 if (state == tcp_StateLISTEN && sock->last_seqnum[1] == 0)
1940 delta_seq = 0;
1941 else delta_seq = seq - sock->last_seqnum[1];
1942
1943 if (state == tcp_StateSYNSENT && sock->last_acknum[1] == 0)
1944 delta_ack = 0;
1945 else delta_ack = ack - sock->last_acknum[1];
1946
1947 ((_tcp_Socket*)sock)->last_seqnum[1] = seq;
1948 ((_tcp_Socket*)sock)->last_acknum[1] = ack;
1949 }
1950
1951 if (sock->missed_seq[0] != sock->missed_seq[1] && !outbound)
1952 {
1953 /* show missing edges relative to his SEQ
1954 */
1955 ms_left = (long) (seq - sock->missed_seq[1]);
1956 ms_right = (long) (seq - sock->missed_seq[0]);
1957 in_seq_space = SEQ_BETWEEN (seq, sock->missed_seq[1], sock->missed_seq[0]);
1958 }
1959 else if (sock->missed_seq[0] != sock->missed_seq[1] && outbound)
1960 {
1961 /* show missing edges relative to our ACK
1962 */
1963 ms_left = (long) (ack - sock->missed_seq[1]);
1964 ms_right = (long) (ack - sock->missed_seq[0]);
1965 in_seq_space = FALSE;
1966 }
1967 else
1968 {
1969 ms_left = 0UL;
1970 ms_right = 0UL;
1971 in_seq_space = FALSE;
1972 }
1973
1974 dbug_printf (" %-8.8s (dSEQ %10ld, dACK %10ld), MS %ld/%ld%s%s\n"
1975 " RCV.NXT %lu, SND.NXT %lu, SND.UNA %ld\n"
1976 " KC %d, vjSA %lu, vjSD %lu, CW %d, WW %d, RTO %d, ",
1977 tcpStateName(state), delta_seq, delta_ack, ms_left, ms_right,
1978 in_seq_space ? ", in-SEQ" : "",
1979 sock->unhappy ? ", Unhappy" : "",
1980 (u_long)sock->recv_next, (u_long)sock->send_next, (u_long)sock->send_una,
1981 sock->karn_count, (u_long)sock->vj_sa, (u_long)sock->vj_sd,
1982 sock->cwindow, sock->wwindow, sock->rto);
1983 dbug_printf ("RTT-diff %s\n", RTT_str(sock->rtt_time, now));
1984 }
1985
1986 olen = (WORD) (hlen - sizeof(*tcp));
1987 if (olen > 0)
1988 dump_tcp_opt (tcp + 1, olen, ack);
1989
1990 if (dlen > sizeof(struct DNS_Header) &&
1991 is_dns_packet(tcp->srcPort, tcp->dstPort))
1992 {
1993 WORD dns_len = intel16 (*(WORD*)data);
1994
1995 if (dns_len == dlen - 2)
1996 return dns_dump (data + 2, dns_len, dns_len);
1997 }
1998 return dump_data (data, dlen);
1999}
2000
2001/*----------------------------------------------------------------------*/
2002
2003static BOOL dbug_filter (void)
2004{
2005#if defined(NEED_PKT_SPLIT)
2006 const struct pkt_split *ps = outbound ? pkt_get_split_out() :
2007 pkt_get_split_in();
2008 for ( ; ps->data; ps++)
2009 {
2010 switch (ps->type)
2011 {
2012 case TYPE_ETHER_HEAD:
2013 if (!outbound)
2014 {
2015 const eth_Header *eth = (const eth_Header*) ps->data;
2016
2017 if (filter.MAC && !match_link_destination(&eth->destination))
2018 return (FALSE);
2019 if (filter.LOOP && !memcmp(&eth->source, _eth_addr, _eth_mac_len))
2020 return (FALSE);
2021 }
2022 break;
2023
2024 case TYPE_TOKEN_HEAD:
2025 if (!outbound)
2026 {
2027 const tok_Header *tok = (const tok_Header*) ps->data;
2028
2029 if (filter.MAC && !match_link_destination(&tok->destination))
2030 return (FALSE);
2031 if (filter.LOOP && !memcmp(&tok->source, _eth_addr, _eth_mac_len))
2032 return (FALSE);
2033 }
2034 break;
2035
2036 case TYPE_FDDI_HEAD:
2037 if (!outbound)
2038 {
2039 const fddi_Header *fddi = (const fddi_Header*) ps->data;
2040
2041 if (filter.MAC && !match_link_destination(&fddi->destination))
2042 return (FALSE);
2043 if (filter.LOOP && !memcmp(&fddi->source, _eth_addr, _eth_mac_len))
2044 return (FALSE);
2045 }
2046 break;
2047
2048 case TYPE_ARP:
2049 if (!outbound)
2050 {
2051 const arp_Header *arp = (const arp_Header*) ps->data;
2052
2053 if (filter.ARP && !match_arp_rarp(arp))
2054 return (FALSE);
2055 if (filter.LOOP && !memcmp(&arp->srcEthAddr, _eth_addr, _eth_mac_len))
2056 return (FALSE);
2057 }
2058 return (debug.ARP);
2059
2060 case TYPE_RARP:
2061 if (!outbound)
2062 {
2063 const rarp_Header *rarp = (const rarp_Header*) ps->data;
2064
2065 if (filter.RARP && !match_arp_rarp(rarp))
2066 return (FALSE);
2067 if (filter.LOOP && !memcmp(&rarp->srcEthAddr, _eth_addr, _eth_mac_len))
2068 return (FALSE);
2069 }
2070 return (debug.RARP);
2071
2072 case TYPE_PPPOE_SESS:
2073 case TYPE_PPPOE_DISC:
2074 break;
2075
2076 case TYPE_IP4:
2077 if (!outbound)
2078 {
2079 const in_Header *ip = (const in_Header*) ps->data;
2080
2081 if (filter.IP && !match_ip4_dest(ip))
2082 return (FALSE);
2083 if (filter.LOOP && intel(ip->source) == my_ip_addr)
2084 return (FALSE);
2085 }
2086 return (TRUE);
2087
2088#if defined(USE_IPV6)
2089 case TYPE_IP6:
2090 if (!outbound)
2091 {
2092 const in6_Header *ip6 = (const in6_Header*) ps->data;
2093
2094 if (filter.IP && !match_ip6_dest(ip6))
2095 return (FALSE);
2096 if (filter.LOOP &&
2097 IN6_ARE_ADDR_EQUAL(&ip6->source, &in6addr_my_ip))
2098 return (FALSE);
2099 }
2100 return (TRUE);
2101#endif
2102
2103 default:
2104 return (TRUE); /* don't have filter for anything else */
2105 }
2106 }
2107#endif /* NEED_PKT_SPLIT */
2108 return (TRUE); /* didn't match the component; allow it */
2109}
2110
2111/*----------------------------------------------------------------------*/
2112
2113static const char *pcdbug_driver_ver (void)
2114{
2115 static char buf [30];
2116 WORD major, minor, unused, build;
2117
2118 if (!pkt_get_drvr_ver(&major, &minor, &unused, &build))
2119 return ("?");
2120
2121#if defined(_WIN32) /* NPF.SYS/SwsVpkt.sys ver e.g. 3.1.0.22 */
2122 sprintf (buf, "%u.%u.%u.%u", major, minor, unused, build);
2123#else
2124 sprintf (buf, "%d.%02d", major, minor);
2125#endif
2126
2127 return (buf);
2128}
2129
2130static const char *pcdbug_api_ver (void)
2131{
2132 static char buf [10];
2133 WORD ver;
2134
2135 /* DOS: return pktdrvr API version (1.09 hopefully).
2136 * Win32: return NDIS version.
2137 */
2138 if (!pkt_get_api_ver(&ver))
2139 return ("?");
2140
2141#if defined(_WIN32)
2142 sprintf (buf, "%d.%d", hiBYTE(ver), loBYTE(ver));
2143#else
2144 if (ver >= 255) /* assumed to be MSB.LSB */
2145 sprintf (buf, "%d.%02d", hiBYTE(ver), loBYTE(ver));
2146 else sprintf (buf, "%d", loBYTE(ver));
2147#endif
2148 return (buf);
2149}
2150
2151/*----------------------------------------------------------------------*/
2152
2153static void print_driver_info (void)
2154{
2155#if defined(_WIN32)
2156 /* What is needed to enable promiscous receive mode?*/
2157 #define PROMISC_RECV() (_pkt_rxmode & RXMODE_PROMISCOUS)
2158 #define CONFIG_RXMODE "winpkt.rxmode"
2159
2160 const char *api = (_pkt_inf ? _pkt_inf->api_name : "??");
2161 const char *sys = (_pkt_inf ? _pkt_inf->sys_drvr_name : "??");
2162
2163 dbug_printf ("%s\n"
2164 "Using: %s, \"%s\" (%s)\n"
2165 " %s ver %s, NDIS ver %s, mode 0x%02X\n",
2166 wattcpVersion(), api, _pktdrvrname, _pktdrvr_descr,
2167 sys, pcdbug_driver_ver(), pcdbug_api_ver(), _pkt_rxmode);
2168
2169#else
2170 #define PROMISC_RECV() (_pkt_rxmode >= RXMODE_PROMISCOUS)
2171 #define CONFIG_RXMODE "pkt.rxmode"
2172
2173 dbug_printf ("%s\nPKTDRVR: \"%s\", ver %s, API ver %s, mode %d\n",
2174 wattcpVersion(), _pktdrvrname, pcdbug_driver_ver(),
2175 pcdbug_api_ver(), _pkt_rxmode);
2176#endif
2177}
2178
2179/*----------------------------------------------------------------------*/
2180
2181static void dbug_dump (const void *sock, const in_Header *ip,
2182 const char *fname, unsigned line, BOOL out)
2183{
2184 static BOOL print_once = FALSE;
2185 char sz_buf [30];
2186 int err;
2187
2188 WATT_ASSERT (ip);
2189
2190 outbound = out;
2191 frag_status = 0;
2192 now = set_timeout (0);
2193
2194 if ((err = setjmp(dbg_jmp)) != 0)
2195 {
2196 (*_printf) ("\ndbug_dump: write failed; %s (%d)\n", strerror(err), err);
2197 dbug_close();
2198 goto quit;
2199 }
2200
2201 if (pcap_mode && !use_ods)
2202 {
2203 int rc = 0;
2204
2205 if (!dbg_file.stream || !(filter.NONE || dbug_filter()))
2206 goto quit;
2207
2208 if (out && _eth_last.tx.size)
2209 rc = write_pcap_packet (MAC_HDR(ip), TRUE);
2210
2211 else if (!out && _eth_last.rx.size)
2212 rc = write_pcap_packet (MAC_HDR(ip), FALSE);
2213
2214 if (rc < 0)
2215 {
2216 (*_printf) (_LANG("\ndbug_dump: write failed; %s\n"), strerror(errno));
2217 dbug_close();
2218 }
2219 goto quit;
2220 }
2221
2222 if (!print_once)
2223 {
2224 print_once = TRUE;
2225 print_driver_info();
2226
2227#if defined(PRINT_CPU_INFO)
2228 print_cpu_info();
2229#endif
2230
2231 if (!PROMISC_RECV() && filter.NONE)
2232 dbug_printf ("\nNB: receive-mode (%s = 0x%02X) is not suitable for "
2233 "receiving all traffic.\n", CONFIG_RXMODE, _pkt_rxmode);
2234 dbug_putc ('\n');
2235
2236#if !defined(__BORLANDC__) && 0 /* Some weird bug with Borland */
2237 _arp_debug_dump(); /* GvB 2002-09 now encapsuled in pcarp.c */
2238
2239 if (_bootp_on || _dhcp_on || _rarp_on)
2240 dbug_printf (" Above routing data may be overridden by "
2241 "DHCP/BOOTP/RARP\n");
2242#endif
2243 }
2244
2245 if (!filter.NONE && !dbug_filter())
2246 goto quit;
2247
2248 if (use_ods)
2249 dbug_putc ('\n'); /* !! Why do I need this? */
2250
2251 if (dbg_print_size) /* debug.rx_size = 1 */
2252 snprintf (sz_buf, sizeof(sz_buf), ", size %u",
2253 out ? _eth_last.tx.size : _eth_last.rx.size);
2254 else sz_buf [0] = '\0';
2255
2256 dbug_printf ("\n%s: %s (%u), time %s%s%s\n",
2257 outbound ? "Transmitted" : "Received",
2258 fname, line, elapsed_str(now), sz_buf,
2259 is_looped(ip) ? ", Link-layer loop!" : "");
2260
2261 /* Either PDCLASS_ETHER, PDCLASS_TOKEN, PDCLASS_FDDI or PDCLASS_ARCNET
2262 */
2263 if (!_pktserial)
2264 {
2265 union link_Packet *pkt = (union link_Packet*) MAC_HDR (ip);
2266 WORD type = MAC_TYP (ip);
2267
2268 if (debug.MAC)
2269 link_head_dump (pkt);
2270
2271 if (_pktdevclass == PDCLASS_ARCNET)
2272 {
2273 if (type == ARCNET_IP_1051 || /* Map to IANA proto-numbers */
2274 type == ARCNET_IP_1201)
2275 type = IP4_TYPE;
2276 else if (type == ARCNET_ARP_1051 ||
2277 type == ARCNET_ARP_1201)
2278 type = ARP_TYPE;
2279 else type = 0; /* unsupported */
2280 }
2281 else if (type == 0xFFFF)
2282 {
2283 dbug_printf ("IPX: unsupported\n");
2284 goto quit;
2285 }
2286 else if (intel16(type) < 0x600) /* 0x600=1536; type is IEEE 802.3 length field */
2287 {
2288 const llc_Header *llc = (const llc_Header*) (&pkt->eth.head + 1);
2289
2290 /* !! could be NetBeui, VLAN etc. */
2291 dbug_printf ("LLC: unsupported\n");
2292 if (debug.LLC)
2293 dump_data (llc + 1, intel16(type));
2294 goto quit;
2295 }
2296
2297 if (type == ARP_TYPE)
2298 {
2299 arp_dump ((const arp_Header*)ip);
2300 goto quit;
2301 }
2302
2303 if (type == RARP_TYPE)
2304 {
2305 rarp_dump ((const rarp_Header*)ip);
2306 goto quit;
2307 }
2308
2309#if defined(USE_PPPOE)
2310 if (type == PPPOE_DISC_TYPE)
2311 {
2312 pppoe_disc_dump ((const struct pppoe_Packet*) pkt->eth.data);
2313 goto quit;
2314 }
2315 if (type == PPPOE_SESS_TYPE)
2316 {
2317 pppoe_sess_dump (sock, (const struct pppoe_Packet*) pkt->eth.data);
2318 goto quit;
2319 }
2320#endif
2321
2322#if defined(USE_IPV6)
2323 if (type == IP6_TYPE && ip->ver == 6)
2324 goto ip6_dmp;
2325#endif
2326
2327 if (type != IP4_TYPE)
2328 {
2329 const BYTE *data;
2330
2331 if (!debug.MAC)
2332 dbug_printf ("Unknown type %04X\n",
2333 _pktdevclass == PDCLASS_ARCNET ? type : intel16(type));
2334
2335 data = (const BYTE*)pkt + _pkt_ip_ofs;
2336 if (out && _eth_last.tx.size > (unsigned)_pkt_ip_ofs)
2337 dump_data (data, _eth_last.tx.size - _pkt_ip_ofs);
2338 else if (!out && _eth_last.rx.size > (unsigned)_pkt_ip_ofs)
2339 dump_data (data, _eth_last.rx.size - _pkt_ip_ofs);
2340 goto quit;
2341 }
2342 }
2343
2344 if (ip->ver == 4)
2345 {
2346 _inet_ntoa (ip4_src, intel(ip->source));
2347 _inet_ntoa (ip4_dst, intel(ip->destination));
2348
2349 ip4_dump (ip);
2350 ip4_payload_dump (sock, ip);
2351 }
2352#if defined(USE_IPV6)
2353 else if (ip->ver == 6)
2354 {
2355 const struct in6_Header *ip6;
2356 const char *addr;
2357
2358ip6_dmp:
2359 ip6 = (const struct in6_Header*) ip;
2360 addr = _inet6_ntoa (ip6->source);
2361 strcpy (ip6_src, addr ? addr : "(null)");
2362
2363 addr = _inet6_ntoa (ip6->destination);
2364 strcpy (ip6_dst, addr ? addr : "(null)");
2365
2366 if (debug.IP)
2367 ip6_header_dump (ip6);
2368 ip6_payload_dump (sock, ip6);
2369 }
2370#endif
2371 else
2372 {
2373 WORD len = intel16 (ip->length);
2374 dbug_printf ("IP?: ver %d\n", ip->ver);
2375 dump_data (ip, min(ETH_MAX_DATA, len));
2376 }
2377
2378quit:
2379 return;
2380}
2381
2382/*----------------------------------------------------------------------*/
2383
2384static void trace_xmit_pkt (const void *sock, const in_Header *ip,
2385 const char *fname, unsigned line)
2386{
2387 if (use_ods || dbg_file.stream)
2388 {
2389 in_dbug_dump = TRUE;
2390 dbug_dump (sock, ip, fname, line, TRUE);
2391 in_dbug_dump = FALSE;
2392 dbug_flush();
2393 }
2394}
2395
2396static void trace_recv_pkt (const void *sock, const in_Header *ip,
2397 const char *fname, unsigned line)
2398{
2399 if (use_ods || dbg_file.stream)
2400 {
2401 in_dbug_dump = TRUE;
2402 dbug_dump (sock, ip, fname, line, FALSE);
2403 in_dbug_dump = FALSE;
2404 dbug_flush();
2405 }
2406}
2407
2408/*
2409 * Print IP-options
2410 */
2411static void dump_ip_opt (const void *opt_p, int len)
2412{
2413 const BYTE *opt = (const BYTE*) opt_p;
2414 const BYTE *start = opt;
2415 WORD val16;
2416 DWORD val32, ip, ts;
2417 int i, num, num_opt = 0;
2418
2419 dbug_write (" Options:");
2420
2421 while (opt < start + len && num_opt < 10)
2422 {
2423 switch (*opt) /* Note: IP-option includes copy/class bits */
2424 {
2425 case IPOPT_EOL:
2426 dbug_write (" EOL\n");
2427 return;
2428
2429 case IPOPT_NOP:
2430 dbug_write (" NOP");
2431 opt++;
2432 continue;
2433
2434 case IPOPT_RR:
2435 dbug_write (" RR");
2436 num = *(opt+1) - 3;
2437 num = min (num, len - 1);
2438 for (i = 0; i < num; i += sizeof(DWORD))
2439 {
2440 val32 = intel (*(DWORD*)(opt+3+i));
2441 dbug_printf (" %s", _inet_ntoa(NULL, val32));
2442 }
2443 break;
2444
2445 case IPOPT_TS:
2446 ip = intel (*(DWORD*)(opt+4));
2447 ts = intel (*(DWORD*)(opt+8));
2448 dbug_printf (" TS <%s/%lus..>", _inet_ntoa(NULL, ip), (u_long)ts);
2449 break;
2450
2451 case IPOPT_SECURITY:
2452 val32 = intel (*(DWORD*)(opt+2));
2453 dbug_printf (" SEC %08lX", (u_long)val32);
2454 break;
2455
2456 case IPOPT_SATID:
2457 val16 = intel16 (*(WORD*)(opt+2));
2458 dbug_printf (" SATID %04X", val16);
2459 break;
2460
2461 case IPOPT_RA:
2462 val16 = intel16 (*(WORD*)(opt+2));
2463 dbug_printf (" RA %u", val16);
2464 break;
2465
2466 case IPOPT_LSRR:
2467 case IPOPT_SSRR:
2468 dbug_write (*opt == IPOPT_LSRR ? " LSRR" : " SSRR");
2469 num = *(opt+1) - 3;
2470 num = min (num, len - 1);
2471 for (i = 0; i < num; i += sizeof(DWORD))
2472 {
2473 DWORD route = intel (*(DWORD*)(opt + 3 + i));
2474 dbug_printf (" %s", _inet_ntoa(NULL, route));
2475 }
2476 break;
2477
2478 default:
2479 dbug_printf (" opt %d?", *opt);
2480 }
2481 opt += *(opt+1);
2482 num_opt++;
2483 }
2484 dbug_putc ('\n');
2485}
2486
2487/*
2488 * Print TCP-options
2489 */
2490static void dump_tcp_opt (const void *opt_p, int len, DWORD ack)
2491{
2492 const BYTE *opt = (const BYTE*) opt_p;
2493 const BYTE *start = opt;
2494 BYTE val8;
2495 WORD val16;
2496 DWORD val32;
2497 int i, num, num_opt = 0;
2498
2499 dbug_write (" Options:");
2500
2501 while (opt < start + len && num_opt < 10)
2502 {
2503 switch (*opt)
2504 {
2505 case TCPOPT_EOL:
2506 dbug_write (" EOL\n");
2507 return;
2508
2509 case TCPOPT_NOP:
2510 dbug_write (" NOP");
2511 opt++;
2512 continue;
2513
2514 case TCPOPT_MAXSEG:
2515 val16 = intel16 (*(WORD*)(opt+2));
2516 dbug_printf (" MSS %u", val16);
2517 break;
2518
2519 case TCPOPT_WINDOW:
2520 val8 = opt[2];
2521 dbug_printf (" Wscale 2^%d", val8);
2522 break;
2523
2524 case TCPOPT_SACK:
2525 dbug_write (" SACK ");
2526 num = (*(opt+1) - 2) / SIZEOF(DWORD);
2527 num = min (num, len / SIZEOF(DWORD));
2528
2529 for (i = 0; i < num; i++)
2530 {
2531 DWORD origin = intel (*(DWORD*)(opt+2+4*i));
2532 DWORD relsize = intel (*(DWORD*)(opt+6+4*i));
2533 dbug_printf ("blk %d {%ld/%ld}, ", i + 1,
2534 (long)(ack - origin - 1),
2535 (long)(ack - origin + relsize));
2536 }
2537 break;
2538
2539 case TCPOPT_SACK_PERM:
2540 dbug_write (" SACK-OK");
2541 break;
2542
2543 case TCPOPT_ECHO:
2544 val32 = intel (*(DWORD*)(opt+2));
2545 dbug_printf (" Echo %lu", (u_long)val32);
2546 break;
2547
2548 case TCPOPT_CHKSUM_REQ:
2549 val8 = opt[2];
2550 dbug_printf (" ChkReq %d", val8);
2551 break;
2552
2553 case TCPOPT_CHKSUM_DAT:
2554 num = opt[1];
2555 dbug_write (" ChkDat ");
2556 for (i = 0; i < num; i++)
2557 dbug_printf ("%02X", opt[2+i]);
2558 break;
2559
2560 case TCPOPT_ECHOREPLY:
2561 val32 = intel (*(DWORD*)(opt+2));
2562 dbug_printf (" Echoreply %lu", (u_long)val32);
2563 break;
2564
2565 case TCPOPT_TIMESTAMP:
2566 val32 = intel (*(DWORD*)(opt+2));
2567 dbug_printf (" TS <%lu", (u_long)val32);
2568 val32 = intel (*(DWORD*)(opt+6));
2569 dbug_printf ("/%lu>", (u_long)val32);
2570 break;
2571
2572 case TCPOPT_CC:
2573 val32 = intel (*(DWORD*)(opt+2));
2574 dbug_printf (" CC %lu", (u_long)val32);
2575 break;
2576
2577 case TCPOPT_CCNEW:
2578 val32 = intel (*(DWORD*)(opt+2));
2579 dbug_printf (" CCnew %lu", (u_long)val32);
2580 break;
2581
2582 case TCPOPT_CCECHO:
2583 val32 = intel (*(DWORD*)(opt+2));
2584 dbug_printf (" CCecho %lu", (u_long)val32);
2585 break;
2586
2587 case TCPOPT_SIGNATURE:
2588 if (opt > (const BYTE*)opt_p)
2589 dbug_write ("\n ");
2590 dbug_write (" MD5 ");
2591 for (i = 0; i < TCPOPT_SIGN_LEN; i++)
2592 dbug_printf ("%02X ", opt[2+i]);
2593 break;
2594
2595 default:
2596 dbug_printf (" opt %d?", *opt);
2597 }
2598 opt += *(opt+1);
2599 num_opt++;
2600 }
2601 dbug_putc ('\n');
2602}
2603
2604/*----------------------------------------------------------------------*/
2605
2606static DWORD dump_data (const void *data_p, UINT datalen)
2607{
2608 const BYTE *data = (const BYTE*) data_p;
2609 UINT ofs;
2610 DWORD len = 0;
2611
2612 if (!dbg_mode_all)
2613 return (1);
2614
2615 for (ofs = 0; ofs < datalen; ofs += 16)
2616 {
2617 UINT j;
2618
2619 if (ofs == 0)
2620 len += dbug_printf ("%u:%s%04X: ", datalen,
2621 datalen > 9999 ? " " :
2622 datalen > 999 ? " " :
2623 datalen > 99 ? " " :
2624 datalen > 9 ? " " :
2625 " ",
2626 ofs);
2627 else len += dbug_printf (" %04X: ", ofs);
2628
2629 for (j = 0; j < 16 && j+ofs < datalen; j++)
2630 len += dbug_printf ("%02X%c", (unsigned)data [j + ofs],
2631 j == 7 ? '-' : ' '); /* no beeps */
2632
2633 for ( ; j < 16; j++) /* pad line to 16 positions */
2634 len += dbug_write (" ");
2635
2636 for (j = 0; j < 16 && j+ofs < datalen; j++)
2637 {
2638 int ch = data[j+ofs];
2639
2640 if (ch < ' ') /* non-printable */
2641 dbug_putc ('.');
2642 else dbug_putc (ch);
2643 len++;
2644 }
2645 dbug_putc ('\n');
2646 len++;
2647 }
2648 return (len);
2649}
2650
2651/*----------------------------------------------------------------------*/
2652
2653static void set_debug_file (const char *value)
2654{
2655 _strlcpy (dbg_name, value, sizeof(dbg_name)-1);
2656}
2657
2658static void set_debug_mode (const char *value)
2659{
2660 if (!stricmp(value, "ALL"))
2661 dbg_mode_all = 1;
2662 if (!stricmp(value, "HEADER"))
2663 dbg_mode_all = 0;
2664}
2665
2666static void set_debug_filter (const char *value)
2667{
2668 char val[80];
2669
2670 _strlcpy (val, value, sizeof(val));
2671 strupr (val);
2672
2673 if (strstr(val, "ALL"))
2674 {
2675 memset (&filter, 1, sizeof(filter));
2676 filter.NONE = FALSE;
2677 }
2678 else if (strstr(val, "NONE"))
2679 {
2680 memset (&filter, 0, sizeof(filter));
2681 filter.NONE = TRUE;
2682 }
2683 else
2684 {
2685 filter.NONE = FALSE;
2686 filter.MAC = (strstr(val, "ETH" ) != NULL) || (strstr(val, "MAC") != NULL);
2687 filter.ARP = (strstr(val, "ARP" ) != NULL);
2688 filter.RARP = (strstr(val, "RARP") != NULL);
2689 filter.IP = (strstr(val, "IP" ) != NULL);
2690 filter.BCAST = (strstr(val, "BCAST") != NULL);
2691 filter.MCAST = (strstr(val, "MCAST") != NULL);
2692 filter.LOOP = (strstr(val, "LOOP") != NULL);
2693 }
2694}
2695
2696static void set_debug_proto (const char *value)
2697{
2698 char val[80];
2699
2700 _strlcpy (val, value, sizeof(val));
2701 strupr (val);
2702
2703 if (!strcmp(val, "ALL"))
2704 memset (&debug, 1, sizeof(debug));
2705 else
2706 {
2707 memset (&debug, 0, sizeof(debug));
2708 debug.MAC = (strstr(val, "ETH" ) != NULL) || (strstr(val, "MAC") != NULL);
2709 debug.LLC = (strstr(val, "LLC" ) != NULL);
2710 debug.ARP = (strstr(val, "ARP" ) != NULL);
2711 debug.RARP = (strstr(val, "RARP") != NULL);
2712 debug.IP = (strstr(val, "IP" ) != NULL);
2713 debug.TCP = (strstr(val, "TCP" ) != NULL);
2714 debug.UDP = (strstr(val, "UDP" ) != NULL);
2715 debug.ICMP = (strstr(val, "ICMP") != NULL);
2716 debug.IGMP = (strstr(val, "IGMP") != NULL);
2717 debug.SCTP = (strstr(val, "SCTP") != NULL);
2718 }
2719}
2720
2721static void W32_CALL dbug_cfg_parse (const char *name, const char *value)
2722{
2723 static const struct config_table debug_cfg[] = {
2724 { "FILE", ARG_FUNC, (void*)set_debug_file },
2725 { "MODE", ARG_FUNC, (void*)set_debug_mode },
2726 { "LINEBUF", ARG_ATOI, (void*)&dbg_linebuf },
2727 { "FILTER", ARG_FUNC, (void*)set_debug_filter },
2728 { "PROTO", ARG_FUNC, (void*)set_debug_proto },
2729 { "RX_SIZE", ARG_ATOI, (void*)&dbg_print_size },
2730 { "STAT", ARG_ATOI, (void*)&dbg_print_stat },
2731 { "DNS", ARG_ATOI, (void*)&dbg_dns_details },
2732 { "PCAP", ARG_ATOI, (void*)&pcap_mode },
2733 { NULL, 0, NULL }
2734 };
2735 if (!parse_config_table(&debug_cfg[0], "DEBUG.", name, value) && prev_hook)
2736 (*prev_hook) (name, value);
2737}
2738
2739#if defined(_WIN32)
2740 static char ods_buf [4000];
2741 static char *ods_ptr = ods_buf;
2742
2743 static int flush_ods (void)
2744 {
2745 WATT_ASSERT (ods_ptr >= ods_buf);
2746 WATT_ASSERT (ods_ptr < ods_buf + sizeof(ods_buf) - 2);
2747
2748 if (ods_ptr == ods_buf)
2749 return (0);
2750
2751 if (ods_ptr[-2] != '\r' && ods_ptr[-1] != '\n')
2752 {
2753 *ods_ptr++ = '\r';
2754 *ods_ptr++ = '\n';
2755 }
2756 *ods_ptr = '\0';
2757 ods_ptr = ods_buf; /* restart buffer */
2758 OutputDebugStringA (ods_buf);
2759 return (1);
2760 }
2761#endif
2762
2763
2764int MS_CDECL dbug_printf (const char *format, ...)
2765{
2766 va_list arg;
2767 int len = 0;
2768
2769#if defined(_WIN32)
2770 if (use_ods)
2771 {
2772 len = ods_buf + sizeof(ods_buf) - ods_ptr - 1; /* length left on ods_buf[] */
2773 va_start (arg, format);
2774 if (len > 2)
2775 len = VSNPRINTF (ods_ptr, len, format, arg);
2776 va_end (arg);
2777 if (len > 0)
2778 ods_ptr += len;
2779 return (len);
2780 }
2781#endif
2782
2783 /* don't let anyone else write if pcap-mode
2784 */
2785 if (dbg_file.stream && !pcap_mode)
2786 {
2787 va_start (arg, format);
2788 len = vfprintf (dbg_file.stream, format, arg);
2789 va_end (arg);
2790 if (in_dbug_dump && ferror(dbg_file.stream))
2791 longjmp (dbg_jmp, errno);
2792 }
2793 return (len);
2794}
2795
2796int dbug_write (const char *buf)
2797{
2798 int len = -1;
2799
2800#if defined(_WIN32)
2801 if (use_ods)
2802 {
2803 len = strlen (buf);
2804 len = min (len, ods_buf + sizeof(ods_buf) - ods_ptr - 1);
2805 memcpy (ods_ptr, buf, len);
2806 ods_ptr += len;
2807 return (len);
2808 }
2809#endif
2810
2811 if (dbg_file.stream && !pcap_mode)
2812 {
2813 len = fputs (buf, dbg_file.stream);
2814 if (in_dbug_dump && (len < 0 || ferror(dbg_file.stream)))
2815 longjmp (dbg_jmp, errno);
2816 }
2817 return (len);
2818}
2819
2820int dbug_putc (int c)
2821{
2822#if defined(_WIN32)
2823 if (use_ods)
2824 {
2825 WATT_ASSERT (ods_ptr);
2826 WATT_ASSERT (ods_ptr >= ods_buf);
2827 WATT_ASSERT (ods_ptr <= ods_buf + sizeof(ods_buf) - 2);
2828
2829 if (c == '\n')
2830 {
2831 *ods_ptr++ = '\r';
2832 *ods_ptr++ = '\n';
2833 return flush_ods();
2834 }
2835 *ods_ptr++ = c;
2836 return (1);
2837 }
2838#endif
2839 return fputc (c, dbg_file.stream);
2840}
2841
2842static void dbug_close (void)
2843{
2844 if (dbg_file.stream &&
2845 dbg_file.stream != stdout && dbg_file.stream != stderr)
2846 {
2847#if defined(USE_GZIP)
2848 if (use_gzip)
2849 gzclose (dbg_file.gz_stream);
2850 else
2851#endif
2852 fclose (dbg_file.stream);
2853 }
2854 dbg_file.stream = NULL;
2855}
2856
2857void dbug_flush (void)
2858{
2859#if defined(_WIN32)
2860 if (use_ods)
2861 flush_ods();
2862 else
2863#endif
2864 if (dbg_file.stream && !pcap_mode)
2865 {
2866 fflush (dbg_file.stream);
2867#if 0
2868 if (dbg_file.stream != stdout && /* no point */
2869 dbg_file.stream != stderr)
2870 _dos_commit (fileno(dbg_file.stream));
2871#endif
2872 }
2873}
2874
2875/*
2876 * Public initialisation
2877 */
2878void W32_CALL dbug_init (void)
2879{
2880 static BOOL init = FALSE;
2881
2882 if (init)
2883 {
2884 outsnl ("dbug_init() already called");
2885 return;
2886 }
2887 init = TRUE;
2888 prev_hook = usr_init;
2889 usr_init = dbug_cfg_parse;
2890 debug_xmit = trace_xmit_pkt;
2891 debug_recv = trace_recv_pkt;
2892
2893#if defined(USE_BSD_API)
2894 _sock_dbug_init();
2895#endif
2896
2897 if (_watt_is_init && !dbg_file.stream)
2898 fprintf (stderr, "`dbug_init()' called after `sock_init()'.\n\7");
2899 else memset (&filter, 0, sizeof(filter));
2900}
2901
2902
2910static void W32_CALL dbug_exit (void)
2911{
2912 int (MS_CDECL *save_printf) (const char*, ...) = _printf;
2913
2914 if (!_watt_fatal_error) /* an assert isn't fatal */
2915 {
2916 if (dbg_file.stream && !pcap_mode)
2917 _printf = dbug_printf; /* dump to wattcp.dbg */
2918#if defined(USE_BSD_API)
2919 else if (_sock_dbug_active())
2920 _printf = _sock_debugf; /* dump to wattcp.sk */
2921#endif
2922 else _printf = NULL;
2923
2924 if (_printf)
2925 {
2926#if defined(USE_STATISTICS)
2927 if (dbg_print_stat)
2928 {
2929 //_arp_debug_dump(); /* Moved from startup to closing */
2930 _arp_cache_dump();
2931 _arp_gateways_dump();
2932 _arp_routes_dump();
2933 print_all_stats();
2934 }
2935#endif
2936
2937 if (_watt_cbroke)
2938 dbug_printf ("\nTerminating on SIGINT\n");
2939 if (_watt_assert_buf[0])
2940 dbug_printf ("\n%s\n", _watt_assert_buf);
2941 _watt_assert_buf [0] = '\0';
2942 }
2943 }
2944 dbug_close();
2945
2946#if defined(USE_GZIP)
2947 if (use_gzip && !_watt_fatal_error)
2948 {
2949 struct stat st;
2950
2951 if (stat(dbg_name, &st) == 0 && st.st_size > 0)
2952 (*_printf) (" \ngzip compression: %lu raw, %lu compressed (%lu%%)\n",
2953 (u_long)bytes_raw, (u_long)st.st_size,
2954 (u_long)(100 - (100*st.st_size) / bytes_raw));
2955 }
2956#endif
2957
2958 _printf = save_printf;
2959}
2960
2961
2971static const char *dns_opcodes [16] = {
2972 "standard", /* DNS_OP_QUERY */
2973 "inverse", /* DNS_OP_INVERSE */
2974 "server status",
2975 "op 3??",
2976 "op 4??",
2977 "update",
2978 "op 6??",
2979 "op 7??",
2980 "op 8??",
2981 "op 9??",
2982 "op 10??",
2983 "op 11??",
2984 "op 12??",
2985 "op 13??",
2986 "op 14??",
2987 "op 15??"
2988 };
2989
2990static const char *dns_responses [16] = {
2991 "no error", /* DNS_SRV_OK */
2992 "format error", /* DNS_SRV_FORM */
2993 "server error", /* DNS_SRV_FAIL */
2994 "NXDOMAIN", /* DNS_SRV_NAME */
2995 "not implemented", /* DNS_SRV_NOTIMP */
2996 "service refused", /* DNS_SRV_REFUSE */
2997 "resp 6??",
2998 "resp 7??",
2999 "resp 8??",
3000 "resp 9??",
3001 "resp 10??",
3002 "resp 11??",
3003 "resp 12??",
3004 "resp 13??",
3005 "resp 14??",
3006 "resp 15??"
3007 };
3008
3009/*
3010 * dns_query()
3011 *
3012 * Return a string describing the numeric value of a DNS query type
3013 */
3014static __inline const char *dns_query (WORD type)
3015{
3016 switch (type)
3017 {
3018 case T_A:
3019 return ("A");
3020 case T_AAAA:
3021 return ("AAAA");
3022 case T_NS:
3023 return ("NS");
3024 case T_CNAME:
3025 return ("CNAME");
3026 case T_PTR:
3027 return ("PTR");
3028 case T_HINFO:
3029 return ("HINFO");
3030 case T_MX:
3031 return ("MX");
3032 case T_MB:
3033 return ("MB");
3034 case T_SOA:
3035 return ("SOA");
3036 case T_SRV:
3037 return ("SRV");
3038 case T_AXFR:
3039 return ("AXFR");
3040 case T_TXT:
3041 return ("TXT");
3042 case T_CAA:
3043 return ("CAA");
3044 case T_WINS:
3045 return ("WINS");
3046 case T_WINSR:
3047 return ("WINS-R");
3048 case T_ANY:
3049 return ("ANY");
3050 default:
3051 return ("??");
3052 }
3053}
3054
3055/*
3056 * Parse DNS packet and dump fields
3057 */
3058static unsigned dns_dump (const BYTE *bp, unsigned length, unsigned dns_len)
3059{
3060 #define CHK_BOGUS(p) if (p > bp+length) goto bogus
3061
3062 const struct DNS_Header *dns = (const struct DNS_Header*) bp;
3063 const BYTE *body = (const BYTE*)bp + sizeof(*dns);
3064 const BYTE *end_p = (const BYTE*)bp + length;
3065 const char *opcode = dns_opcodes [dns->dns_fl_opcode];
3066 const char *rcode = dns_responses [dns->dns_fl_rcode];
3067 int i, t;
3068 unsigned len = 0;
3069
3070 if (!dbg_mode_all)
3071 return (1);
3072
3073 dbug_write ("DNS: ");
3074 if (dns_len)
3075 dbug_printf ("length %u, ", dns_len);
3076
3077 len += dbug_printf ("Ident %u, %s, Opcode: %s, %sAuth\n",
3078 intel16(dns->dns_id), dns->dns_fl_qr ?
3079 "Response" : "Query", opcode ? opcode : "??",
3080 !dns->dns_fl_ad ? "Non-" : "");
3081
3082 if (!dns->dns_fl_qr && rcode) /* Response code only in responses */
3083 rcode = "";
3084
3085 len += dbug_printf (" auth answer %d, truncated %d, rec-req %d, "
3086 "rec-avail %d, %s\n",
3087 dns->dns_fl_aa, dns->dns_fl_tc, dns->dns_fl_rd,
3088 dns->dns_fl_ra, rcode ? rcode : "??");
3089 if (!opcode || !rcode)
3090 goto bogus;
3091
3092 if (length <= sizeof(*dns)) /* no body present */
3093 return (length);
3094
3095 /* Do the question part of the packet.
3096 */
3097 i = intel16 (dns->dns_num_q);
3098
3099 while (i > 0)
3100 {
3101 WORD qtype, qclass;
3102
3103 dbug_write (" Question: query name ");
3104 body = dns_labels (body, bp, end_p);
3105 CHK_BOGUS (body);
3106
3107 qtype = intel16 (*(WORD*)body); body += sizeof(qtype);
3108 qclass = intel16 (*(WORD*)body); body += sizeof(qclass);
3109
3110 dbug_printf (" query type %d (%s), class %d\n",
3111 qtype, dns_query(qtype), qclass);
3112 i--;
3113 }
3114
3115 /* Dump the resource records for the answers
3116 */
3117 i = intel16 (dns->dns_num_ans);
3118 t = i;
3119 while (i > 0)
3120 {
3121 dbug_printf (" Answer %d: ", t - i + 1);
3122 body = dns_resource (body, bp, end_p);
3123 CHK_BOGUS (body);
3124 i--;
3125 }
3126
3127 /* Dump the resource records for the authoritative answers
3128 */
3129 i = intel16 (dns->dns_num_auth);
3130 t = i;
3131 while (i > 0)
3132 {
3133 dbug_printf (" Auth %d: ", t - i + 1);
3134 body = dns_resource (body, bp, end_p);
3135 CHK_BOGUS (body);
3136 i--;
3137 }
3138
3139 /* Dump the resource records for the additional info
3140 */
3141 i = intel16 (dns->dns_num_add);
3142 t = i;
3143 while (i > 0)
3144 {
3145 dbug_printf (" Additional %d: ", t - i + 1);
3146 body = dns_resource (body, bp, end_p);
3147 CHK_BOGUS (body);
3148 i--;
3149 }
3150 return (len);
3151
3152bogus:
3153 dbug_printf (" Looks like a bogus packet; length %d\n", length);
3154 return (len);
3155}
3156
3157/*
3158 * Print the contents of a resource record
3159 */
3160static const BYTE *dns_resource (const BYTE *p, const BYTE *bp, const BYTE *ep)
3161{
3162 DWORD ttl, val;
3163 WORD qtype, qclass, reslen;
3164 const char *ip;
3165
3166 dbug_write ("server name: ");
3167 p = dns_labels (p, bp, ep);
3168
3169 /* Do query type, class, ttl and resource length
3170 */
3171 qtype = intel16 (*(WORD*)p); p += sizeof(qtype);
3172 qclass = intel16 (*(WORD*)p); p += sizeof(qclass);
3173 ttl = intel (*(DWORD*)p); p += sizeof(ttl);
3174 reslen = intel16 (*(WORD*)p); p += sizeof(reslen);
3175
3176 dbug_printf (" type %d (%s), class %d, TTL %s, length %u\n",
3177 qtype, dns_query(qtype), qclass, hms_str(ttl), reslen);
3178
3179 /* Do resource data.
3180 */
3181 switch (qtype)
3182 {
3183 case T_A: /* A record; ip4 address(es) */
3184 if (reslen == 4)
3185 {
3186 ip = _inet_ntoa (NULL, intel(*(DWORD*)p));
3187 dbug_printf (" IP4 address: %s\n", ip);
3188 }
3189 else if (reslen == 7)
3190 {
3191 ip = _inet_ntoa (NULL, intel(*(DWORD*)p));
3192 dbug_printf (" IP4 address: %s, proto %u, port %u\n",
3193 ip, *(p+4), intel16(*(WORD*)(p + 5)));
3194 }
3195 else
3196 dbug_printf (" IP4 address: bogus reslen %u\n", reslen);
3197
3198 p += reslen;
3199 break;
3200
3201#if defined(USE_IPV6)
3202 case T_AAAA: /* AAAA record; ip6 address(es) */
3203 while (reslen >= sizeof(ip6_address))
3204 {
3205 const char *addr = _inet6_ntoa ((const void*)p);
3206 dbug_printf (" IP6 address: %s\n", addr);
3207 p += sizeof (ip6_address);
3208 reslen -= sizeof (ip6_address);
3209 }
3210 break;
3211#endif
3212 case T_NS: /* NS record; Name Server */
3213 dbug_write (" auth host: ");
3214 p = dns_labels (p, bp, ep);
3215 break;
3216
3217 case T_MX: /* MX record; Mail Exchange */
3218 dbug_printf (" mail exchange host (%u): ", intel16(*(WORD*)p));
3219 p += 2;
3220 p = dns_labels (p, bp, ep);
3221 break;
3222
3223 case T_CNAME: /* CNAME record; canonical name */
3224 dbug_write (" canon host: ");
3225 p = dns_labels (p, bp, ep);
3226 break;
3227
3228 case T_PTR: /* PTR record; hostname for IP */
3229 dbug_write (" host name: ");
3230 p = dns_labels (p, bp, ep);
3231 break;
3232
3233 case T_TXT: /* TXT record; 1 or more text labels */
3234 dbug_write (" TXT info: ");
3235 p = dns_labels (p, bp, ep);
3236 break;
3237
3238 case T_WINS: /* WINS record; */
3239 dbug_write (" WINS name: ");
3240 p = dns_labels (p, bp, ep);
3241 break;
3242
3243 case T_WINSR: /* WINS-reverse record; */
3244 dbug_write (" WINS-R addr: ");
3245 p = dns_labels (p, bp, ep);
3246 break;
3247
3248 case T_SOA:
3249 dbug_write (" SOA: ");
3250 p = dns_labels (p, bp, ep);
3251 if (p < ep)
3252 {
3253 dbug_write (" ");
3254 p = dns_labels (p, bp, ep);
3255
3256 val = intel (*(DWORD*)p);
3257 p += 4;
3258 dbug_printf (" serial %lu", (u_long)val);
3259
3260 val = intel (*(DWORD*)p);
3261 p += 4;
3262 dbug_printf (", refresh %s", hms_str(val));
3263
3264 val = intel (*(DWORD*)p);
3265 p += 4;
3266 dbug_printf (", retry %s\n", hms_str(val));
3267
3268 val = intel (*(DWORD*)p);
3269 p += 4;
3270 dbug_printf (" expire %s", hms_str(val));
3271
3272 val = intel (*(DWORD*)p);
3273 p += 4;
3274 dbug_printf (", minimum %s\n", hms_str(val));
3275 }
3276 break;
3277
3278 default:
3279 p += reslen;
3280 }
3281 return (p);
3282}
3283
3284/*
3285 * Recursively parse a label entry in a DNS packet
3286 * 'p' points to a DNS label.
3287 * 'bp' points to a beginning of DNS header.
3288 */
3289static const BYTE *dns_labels (const BYTE *p, const BYTE *bp, const BYTE *ep)
3290{
3291 while (1)
3292 {
3293 BYTE count = *p++;
3294
3295 if (count >= 0xC0)
3296 {
3297 /* There's a pointer (rel to 'bp' start) in this label.
3298 * Let's grab the 14 low-order bits and run with them.
3299 */
3300 WORD offset = (WORD) (((unsigned)(count - 0xC0) << 8) + *p++);
3301
3302 /* dbug_printf ("(ofs %u) ", offset); !! show where the offset is */
3303 dns_labels (bp+offset, bp, ep);
3304 return (p);
3305 }
3306 if (count == 0)
3307 break;
3308
3309 while (count > 0)
3310 {
3311 if (p <= ep)
3312 {
3313 dbug_putc (*p++);
3314 count--;
3315 }
3316 else
3317 {
3318 dbug_write ("\nPacket length exceeded\n");
3319 return (p);
3320 }
3321 }
3322 dbug_putc ('.');
3323 }
3324 dbug_putc ('\n');
3325 return (p);
3326}
3327
3328
3329#if defined(USE_PPPOE)
3330
3331/* NCP Codes */
3332enum ncp_codes {
3333 CONFREQ = 1,
3334 CONFACK = 2,
3335 CONFNAK = 3,
3336 CONFREJ = 4,
3337 TERMREQ = 5,
3338 TERMACK = 6,
3339 CODEREJ = 7,
3340 PROTREJ = 8,
3341 ECHOREQ = 9,
3342 ECHOREP = 10,
3343 DISCARD = 11
3344 };
3345
3346enum lcp_options {
3347 LCP_RESERVED = 0,
3348 LCP_MRU = 1,
3349 LCP_ASYNCMAP = 2,
3350 LCP_AUTHPROTO = 3,
3351 LCP_QUALPROTO = 4,
3352 LCP_MAGICNUM = 5,
3353 LCP_PCOMP = 7,
3354 LCP_ACFCOMP = 8,
3355 LCP_CALLBACK = 13
3356 };
3357
3358enum ipcp_options {
3359 IPCP_RESERVED = 0,
3360 IPCP_ADDRS = 1,
3361 IPCP_COMPRTYPE = 2,
3362 IPCP_ADDR = 3,
3363 IPCP_MS_DNS1 = 129,
3364 IPCP_MS_WINS1 = 130,
3365 IPCP_MS_DNS2 = 131,
3366 IPCP_MS_WINS2 = 132,
3367 };
3368
3369static const struct token ncp_code2str[] = { /* LCP/IPCP codes */
3370 { CONFREQ, "ConfReq" },
3371 { CONFACK, "ConfAck" },
3372 { CONFNAK, "ConfNak" },
3373 { CONFREJ, "ConfRej" },
3374 { TERMREQ, "TermReq" },
3375 { TERMACK, "TermAck" },
3376 { CODEREJ, "CodeRej" },
3377 { PROTREJ, "ProtRej" },
3378 { ECHOREQ, "EchoReq" },
3379 { ECHOREP, "EchoRep" },
3380 { DISCARD, "Discard" },
3381 { 0, NULL }
3382 };
3383
3384static const struct token lcp_option2str[] = {
3385 { LCP_RESERVED, "reserved" },
3386 { LCP_MRU, "MRU" },
3387 { LCP_ASYNCMAP, "AsyncMap" },
3388 { LCP_AUTHPROTO,"AUTH" },
3389 { LCP_QUALPROTO,"QUAL" },
3390 { LCP_MAGICNUM, "MAGIC" },
3391 { LCP_PCOMP, "PCOMP" },
3392 { LCP_ACFCOMP, "ACFcomp" },
3393 { LCP_CALLBACK, "CallBack" },
3394 { 0, NULL }
3395 };
3396
3397static const struct token ipcp_option2str[] = {
3398 { IPCP_RESERVED, "reserved" },
3399 { IPCP_ADDRS, "Addrs" },
3400 { IPCP_COMPRTYPE,"Compr" },
3401 { IPCP_ADDR, "Addr" },
3402 { IPCP_MS_DNS1, "DNS1" },
3403 { IPCP_MS_WINS1, "Wins1" },
3404 { IPCP_MS_DNS2, "DNS2" },
3405 { IPCP_MS_WINS2, "Win2" },
3406 { 0, NULL }
3407 };
3408
3409static const struct token lcpauth2str[] = {
3410 { 0xc023, "PAP" },
3411 { 0xc223, "CHAP" },
3412 { 0, NULL }
3413 };
3414
3415static const struct token lcpqual2str[] = {
3416 { 0xc025, "LQR" },
3417 { 0, NULL }
3418 };
3419
3420static const struct token lcpchap2str[] = {
3421 { 0x05, "MD5" },
3422 { 0x80, "MS" },
3423 { 0, NULL }
3424 };
3425
3426/*
3427 * Dump PPP-LCP contents. Functions taken from tcpdump.
3428 */
3429static unsigned lcp_dump (const BYTE *bp)
3430{
3431 WORD lcp_code, lcp_id, lcp_length, arg;
3432 const BYTE *lcp_data, *p;
3433 unsigned len = 0;
3434
3435 lcp_code = bp [0];
3436 lcp_id = bp [1];
3437 lcp_length = intel16 (*(WORD*)(bp+2));
3438 lcp_data = bp + 4;
3439
3440 len += dbug_printf ("LCP: %s id=0x%02x ",
3441 tok2str(ncp_code2str,"LCP-#%d", lcp_code), lcp_id);
3442
3443 switch (lcp_code)
3444 {
3445 case CONFREQ:
3446 case CONFACK:
3447 case CONFNAK:
3448 case CONFREJ:
3449 p = lcp_data;
3450
3451 while (p + 2 < lcp_data + lcp_length)
3452 {
3453 BYTE opt_type = p[0];
3454 BYTE opt_length = p[1];
3455
3456 p += 2;
3457 dbug_printf ("<%s ", tok2str(lcp_option2str, "option-#%d", opt_type));
3458 if (opt_length)
3459 {
3460 switch (opt_type)
3461 {
3462 case LCP_MRU:
3463 arg = intel16 (*(WORD*)p);
3464 dbug_printf ("%u", arg);
3465 break;
3466
3467 case LCP_AUTHPROTO:
3468 arg = intel16 (*(WORD*)p);
3469 dbug_printf ("%s", tok2str (lcpauth2str, "AUTH-%x", arg));
3470 if (opt_length >= 5)
3471 dbug_printf (" %s", tok2str(lcpchap2str, "%x", p[0]));
3472 break;
3473
3474 case LCP_QUALPROTO:
3475 arg = intel16 (*(WORD*)p);
3476 dbug_printf ("%s", tok2str(lcpqual2str, "QUAL-%x", arg));
3477 break;
3478
3479 case LCP_ASYNCMAP:
3480 case LCP_MAGICNUM:
3481 arg = intel16 (*(WORD*)(p+4));
3482 dbug_printf ("0x%08lX%04X", intel(*(DWORD*)p), arg);
3483 break;
3484
3485 case LCP_PCOMP:
3486 case LCP_ACFCOMP:
3487 case LCP_RESERVED:
3488 break;
3489
3490 default:
3491 break;
3492 }
3493 }
3494 dbug_putc ('>');
3495 p += opt_length - 2;
3496 }
3497 break;
3498
3499 case ECHOREQ:
3500 case ECHOREP:
3501 case DISCARD:
3502 dbug_printf ("magic=0x%08lX", intel(*(DWORD*)lcp_data));
3503 lcp_data += 4;
3504 break;
3505
3506 case PROTREJ:
3507 arg = intel16 (*(WORD*)lcp_data);
3508 dbug_printf ("prot=%s", tok2str(ppp_type2str, "PROT-%#x", arg));
3509 break;
3510
3511 case CODEREJ:
3512 dbug_putc ('\n');
3513 lcp_dump (lcp_data);
3514 break;
3515
3516 case TERMREQ:
3517 case TERMACK:
3518 break;
3519
3520 default:
3521 break;
3522 }
3523 dbug_putc ('\n');
3524 return (len);
3525}
3526
3527/*
3528 * Dump PPP-CCP contents (compression control protocol).
3529 */
3530static unsigned ccp_dump (const BYTE *bp)
3531{
3532 ARGSUSED (bp);
3533 return (0);
3534}
3535
3536/*
3537 * Dump PPP-IPCP contents.
3538 */
3539static unsigned ipcp_dump (const BYTE *bp)
3540{
3541 WORD ipcp_code, ipcp_id, ipcp_length;
3542 const BYTE *ipcp_data, *p;
3543 unsigned len = 0;
3544
3545 ipcp_code = bp[0];
3546 ipcp_id = bp[1];
3547 ipcp_length = intel16 (*(WORD*)(bp+2));
3548 ipcp_data = bp + 4;
3549
3550 len += dbug_printf ("IPCP: %s id=0x%02x ",
3551 tok2str(ncp_code2str, "IPCP-#%d", ipcp_code), ipcp_id);
3552
3553 switch (ipcp_code)
3554 {
3555 case CONFREQ:
3556 case CONFACK:
3557 case CONFNAK:
3558 case CONFREJ:
3559 p = ipcp_data;
3560
3561 while (p + 2 < ipcp_data + ipcp_length)
3562 {
3563 BYTE opt_type = p[0];
3564 BYTE opt_length = p[1];
3565 DWORD addr;
3566
3567 p += 2;
3568 dbug_printf ("<%s ", tok2str(ipcp_option2str, "option-#%d", opt_type));
3569 if (opt_length)
3570 {
3571 switch (opt_type)
3572 {
3573 case IPCP_ADDRS:
3574 addr = intel (*(DWORD*)p);
3575 dbug_printf ("addrs %s ", _inet_ntoa(NULL, addr));
3576 addr = intel (*(DWORD*)(p+4));
3577 dbug_printf ("%s", _inet_ntoa(NULL, addr));
3578 break;
3579
3580 case IPCP_ADDR:
3581 addr = intel (*(DWORD*)p);
3582 dbug_printf ("addr %s", _inet_ntoa(NULL, addr));
3583 break;
3584
3585 case IPCP_COMPRTYPE:
3586 dbug_printf ("compress %u", intel16(*(WORD*)p));
3587 break;
3588
3589 case IPCP_MS_DNS1:
3590 case IPCP_MS_DNS2:
3591 addr = intel (*(DWORD*)p);
3592 dbug_printf ("MS-DNS %s", _inet_ntoa(NULL, addr));
3593 break;
3594
3595 case IPCP_MS_WINS1:
3596 case IPCP_MS_WINS2:
3597 addr = intel (*(DWORD*)p);
3598 dbug_printf ("MS-WINS %s", _inet_ntoa(NULL, addr));
3599 break;
3600
3601 default:
3602 break;
3603 }
3604 }
3605 dbug_putc ('>');
3606 p += opt_length - 2;
3607 }
3608 break;
3609
3610 case TERMREQ:
3611 case TERMACK:
3612 break;
3613
3614 default:
3615 break;
3616 }
3617 dbug_putc ('\n');
3618 return (len);
3619}
3620#endif /* USE_PPPOE */
3621
3622/*
3623 * Functions for writing dump-file in pcap-format
3624 * (gzip compressed or non-compressed pcap format).
3625 */
3626#define TCPDUMP_MAGIC 0xA1B2C3D4
3627#define PCAP_VERSION_MAJOR 2
3628#define PCAP_VERSION_MINOR 4
3629
3630W32_CLANG_PACK_WARN_OFF()
3631
3632#include <sys/pack_on.h>
3633
3634struct pcap_file_header {
3635 DWORD magic;
3636 WORD version_major;
3637 WORD version_minor;
3638 DWORD thiszone; /* GMT to local correction */
3639 DWORD sigfigs; /* accuracy of timestamps */
3640 DWORD snap_len; /* max length saved portion of each pkt */
3641 DWORD linktype; /* data link type (DLT_*) */
3642 };
3643
3644/*
3645 * Each packet in the dump file is prepended with this generic header.
3646 * This gets around the problem of different headers for different
3647 * packet interfaces.
3648 */
3649struct pcap_pkt_header {
3650 struct timeval ts; /* time stamp */
3651 DWORD caplen; /* length of portion present */
3652 DWORD len; /* length of this packet (off wire) */
3653 DWORD family; /* protocol family value (for DLT_NULL) */
3654 };
3655
3656#include <sys/pack_off.h>
3657
3658W32_CLANG_PACK_WARN_DEF()
3659
3660static int write_pcap_header (void)
3661{
3662 struct pcap_file_header pf_hdr;
3663 struct timeval tv;
3664 struct timezone tz;
3665 size_t rc;
3666
3667 gettimeofday2 (&tv, &tz);
3668 memset (&pf_hdr, '\0', sizeof(pf_hdr));
3669
3670 pf_hdr.magic = TCPDUMP_MAGIC;
3671 pf_hdr.version_major = PCAP_VERSION_MAJOR;
3672 pf_hdr.version_minor = PCAP_VERSION_MINOR;
3673 pf_hdr.thiszone = 60 * tz.tz_minuteswest;
3674 pf_hdr.sigfigs = 0;
3675 pf_hdr.snap_len = _mtu + _pkt_ip_ofs;
3676 pf_hdr.linktype = _pktserial ? 101 : _eth_get_hwtype(NULL, NULL);
3677
3678#if defined(USE_GZIP)
3679 if (use_gzip)
3680 {
3681 rc = gzwrite (dbg_file.gz_stream, &pf_hdr, sizeof(pf_hdr));
3682 bytes_raw += sizeof(pf_hdr);
3683 }
3684 else
3685#endif
3686 rc = fwrite (&pf_hdr, 1, sizeof(pf_hdr), dbg_file.stream);
3687 return (rc == 0 ? -1 : (int)rc);
3688}
3689
3690static int write_pcap_packet (const void *pkt, BOOL out)
3691{
3692 const struct in_Header *ip = (const struct in_Header*) pkt;
3693 struct pcap_pkt_header pc_hdr;
3694 size_t hlen, pkt_len, rc;
3695
3696 memset (&pc_hdr, '\0', sizeof(pc_hdr));
3697
3698 if (out)
3699 {
3700#if (DOSX) && defined(HAVE_UINT64) && defined(__MSDOS__)
3701 if (!_eth_last.tx.tstamp.lo ||
3702 !get_tv_from_tsc (&_eth_last.tx.tstamp, &pc_hdr.ts))
3703#endif
3704 gettimeofday2 (&pc_hdr.ts, NULL);
3705 pkt_len = _eth_last.tx.size;
3706 }
3707 else
3708 {
3709#if (DOSX) && defined(HAVE_UINT64) && defined(__MSDOS__)
3710 if (!_eth_last.rx.tstamp.lo ||
3711 !get_tv_from_tsc (&_eth_last.rx.tstamp, &pc_hdr.ts))
3712#endif
3713 gettimeofday2 (&pc_hdr.ts, NULL);
3714 pkt_len = _eth_last.rx.size;
3715 }
3716
3717 if (_pktserial) /* write DLT_NULL header */
3718 {
3719 pc_hdr.len = (DWORD) (pkt_len + sizeof(pc_hdr.family));
3720 pc_hdr.family = (ip->ver == 4) ? AF_INET : AF_INET6;
3721 hlen = sizeof (pc_hdr);
3722 }
3723 else
3724 {
3725 pc_hdr.len = (DWORD)pkt_len;
3726 hlen = sizeof (pc_hdr) - sizeof(pc_hdr.family);
3727 }
3728 pc_hdr.caplen = (DWORD)pkt_len;
3729
3730#if defined(USE_GZIP)
3731 if (use_gzip)
3732 {
3733 rc = gzwrite (dbg_file.gz_stream, &pc_hdr, (unsigned)hlen);
3734 bytes_raw += (DWORD) hlen;
3735 rc = gzwrite (dbg_file.gz_stream, pkt, (unsigned)pkt_len);
3736 bytes_raw += (DWORD) pkt_len;
3737 }
3738 else
3739#endif
3740 {
3741 fwrite (&pc_hdr, hlen, 1, dbg_file.stream);
3742 rc = fwrite (pkt, 1, pkt_len, dbg_file.stream);
3743 }
3744 return (rc == 0 ? -1 : (int)rc);
3745}
3746
3747/*
3748 * This stuff is taken mostly from tests/cpu.c.
3749 */
3750#if defined(PRINT_CPU_INFO)
3751
3752#if 0 /* Use code in tests/cpu.c instead */
3753const char *i486_model (int model)
3754{
3755 static const char *models[] = {
3756 "0", "DX", "SX", "DX/2", "4", "SX/2", "6",
3757 "DX/2-WB", "DX/4", "DX/4-WB", "10", "11", "12", "13",
3758 "Am5x86-WT", "Am5x86-WB"
3759 };
3760 if (model < DIM(models))
3761 return (models[model]);
3762 return (NULL);
3763}
3764
3765const char *i586_model (int model)
3766{
3767 static const char *models[] = {
3768 "0", "Pentium 60/66", "Pentium 75+", "OverDrive PODP5V83",
3769 "Pentium MMX", NULL, NULL, "Mobile Pentium 75+",
3770 "Mobile Pentium MMX"
3771 };
3772 if (model < DIM(models))
3773 return (models[model]);
3774 return (NULL);
3775}
3776
3777const char *Cx86_model (int type)
3778{
3779 int model;
3780 static const char *models[] = {
3781 "unknown", "6x86", "6x86L", "6x86MX", "MII"
3782 };
3783 switch (type)
3784 {
3785 case 5:
3786 /* CX8 flag only on 6x86L */
3787 model = ((x86_capability & X86_CAPA_CX8) ? 2 : 1);
3788 break;
3789 case 6:
3790 model = 3;
3791 break;
3792 default:
3793 model = 0;
3794 }
3795 return (models[model]);
3796}
3797
3798const char *i686_model (int model)
3799{
3800 static const char *models[] = {
3801 "PPro A-step", "Pentium Pro"
3802 };
3803 if (model < DIM(models))
3804 return (models[model]);
3805 return (NULL);
3806}
3807
3808struct model_info {
3809 int type;
3810 const char *names[16];
3811 };
3812
3813const char *AMD_model (int type, int model)
3814{
3815 static const struct model_info amd_models[] = {
3816 { 4,
3817 { NULL, NULL, NULL, "DX/2", NULL, NULL, NULL, "DX/2-WB", "DX/4",
3818 "DX/4-WB", NULL, NULL, NULL, NULL, "Am5x86-WT", "Am5x86-WB"
3819 }
3820 },
3821 { 5,
3822 { "K5/SSA5 (PR-75, PR-90, PR-100)", "K5 (PR-120, PR-133)",
3823 "K5 (PR-166)", "K5 (PR-200)", NULL, NULL,
3824 "K6 (166-266)", "K6 (166-300)", "K6-2 (200-450)",
3825 "K6-3D-Plus (200-450)", NULL, NULL, NULL, NULL, NULL, NULL
3826 }
3827 }
3828 };
3829 int i;
3830
3831 if (model < 16)
3832 for (i = 0; i < DIM(amd_models); i++)
3833 if (amd_models[i].type == type)
3834 return (amd_models[i].names[model]);
3835 return (NULL);
3836}
3837
3838const char *cpu_get_model (int type, int model)
3839{
3840 const char *p = NULL;
3841 const char *vendor = x86_vendor_id;
3842 static char buf [12];
3843
3844 if (!x86_have_cpuid)
3845 return ("unknown");
3846
3847 if (!strncmp(vendor, "Cyrix", 5))
3848 p = Cx86_model (type);
3849 else if (!strcmp(vendor, "AuthenticAMD"))
3850 p = AMD_model (type, model);
3851#if 0
3852 else if (!strcmp(vendor, "UMC UMC UMC "))
3853 p = UMC_model (type, model);
3854 else if (!strcmp(vendor, "NexGenDriven"))
3855 p = NexGen_model (type, model);
3856 else if (!strcmp(vendor, "CentaurHauls"))
3857 p = Centaur_model (type, model);
3858 else if (!strcmp(vendor, "RiseRiseRise")) /* Rise Technology */
3859 p = Rise_model (type, model);
3860 else if (!strcmp(vendor, "GenuineTMx86")) /* Transmeta */
3861 p = Transmeta_model (type, model);
3862 else if (!strcmp(vendor, "Geode by NSC")) /* National Semiconductor */
3863 p = National_model (type, model);
3864#endif
3865 else /* Intel */
3866 {
3867 switch (type & 0x07) /* mask off extended family bit */
3868 {
3869 case 4:
3870 p = i486_model (model);
3871 break;
3872 case 5:
3873 p = i586_model (model); /* Pentium I */
3874 break;
3875 case 6:
3876 p = i686_model (model); /* Pentium II */
3877 break;
3878 case 7:
3879 p = "Pentium 3";
3880 break;
3881 case 8:
3882 p = "Pentium 4";
3883 break;
3884 }
3885 }
3886 if (p)
3887 return (p);
3888 return itoa (model, buf, 10);
3889}
3890#endif /* 0 */
3891
3892static void print_cpu_info (void)
3893{
3894 uint64 Hz;
3895 char speed [20];
3896
3897 CheckCpuType();
3898
3899 Hz = get_cpu_speed();
3900 if (Hz)
3901 sprintf (speed, "%.3f", (double)Hz/1E6);
3902 else strcpy (speed, "??");
3903
3904 dbug_printf ("CPU: %d86, model: %s, vendor: %s, speed: %s MHz (%d CPU core%s)\n",
3905 x86_type, cpu_get_model(x86_type,x86_model),
3906 x86_vendor_id[0] ? x86_vendor_id : "unknown", speed,
3907 num_cpus, num_cpus > 1 ? "s" : "");
3908}
3909#endif /* PRINT_CPU_INFO */
3910#endif /* USE_DEBUG */
bsddbug.h
_ip6_checksum
WORD _ip6_checksum(const in6_Header *ip, WORD proto, const void *payload, unsigned payloadlen)
Generic IPv6 checksum function.
Definition: chksum.c:48
chksum.h
cpumodel.h
get_xby.h
gettod.h
ip4_in.h
ip6_in.h
ip6_out.h
language.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
fopen_excl
FILE * fopen_excl(const char *file, const char *mode)
WIN32: Open an existing file (or create) in share-mode but deny other processes to write to the file.
Definition: misc.c:453
MAC_address
const char * MAC_address(const void *addr)
Return hexa-decimal string for an 6/7 byte MAC-address.
Definition: misc.c:997
_watt_assert_buf
char _watt_assert_buf[256]
Definition: misc.c:75
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
misc.h
_watt_cbroke
volatile int _watt_cbroke
Definition: pc_cbrk.c:48
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
nameser.h
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
strerror
char *MS_CDECL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207
pack_off.h
_arp_debug_dump
void W32_CALL _arp_debug_dump(void)
Debug-dump of configured gateways, route table and ARP cache.
Definition: pcarp.c:1918
pcarp.h
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
pcconfig.h
dbug_exit
static void W32_CALL dbug_exit(void)
Print ARP-cache and statistics counters to one of the debug-files.
Definition: pcdbug.c:2910
icmp4_dump
static int icmp4_dump(const in_Header *ip)
Definition: pcdbug.c:892
dbg_mode_all
BOOL dbg_mode_all
These are public so they can be set by application if running without a config-file.
Definition: pcdbug.c:199
match_ip6_dest
static __inline BOOL match_ip6_dest(const in6_Header *ip)
Definition: pcdbug.c:398
pcdbug.h
pcdns.h
pcicmp6.h
pcicmp.h
pkt_get_drvr_ver
int pkt_get_drvr_ver(WORD *major, WORD *minor, WORD *unused1, WORD *unused2)
Return version of PKTDRVR.
Definition: pcpkt.c:531
pkt_get_api_ver
int pkt_get_api_ver(WORD *ver)
Return version of spec.
Definition: pcpkt.c:518
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
_pkt_inf
struct pkt_info * _pkt_inf
module data that will be locked
Definition: pcpkt.c:61
_pkt_ip_ofs
WORD _pkt_ip_ofs
ofs from link-layer head to ip
Definition: pcpkt.c:49
_pkt_rxmode
int _pkt_rxmode
active receive mode
Definition: pcpkt.c:53
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
pcpkt.h
pcqueue.h
_eth_last
struct _eth_last_info _eth_last
Sizes and timestamps of last packet recv/sent.
Definition: pcsed.c:67
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
_eth_get_hwtype
BYTE W32_CALL _eth_get_hwtype(BYTE *hwtype, BYTE *hwlen)
Fill in hardware address type/length for BOOTP/DHCP packets.
Definition: pcsed.c:730
_eth_mac_len
BYTE _eth_mac_len
Size of a MAC address.
Definition: pcsed.c:53
_eth_brdcast
mac_address _eth_brdcast
Link-layer broadcast address.
Definition: pcsed.c:50
pcsed.h
pcstat.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
pctcp.h
ppp.h
pppoe.h
printk.h
resolv.h
_bootp_on
BOOL _bootp_on
Try booting using BOOTP ?
Definition: sock_ini.c:129
_rarp_on
BOOL _rarp_on
Try booting using RARP ?
Definition: sock_ini.c:132
_watt_is_init
BOOL _watt_is_init
watt_sock_init() done (but with possible failed boot)
Definition: sock_ini.c:158
_dhcp_on
BOOL _dhcp_on
Try booting using DHCP ?
Definition: sock_ini.c:130
sock_ini.h
split.h
DNS_Header
Another definition of 'struct DNS_head'.
Definition: pcdns.h:96
ICMP_info
Definition: pcicmp.h:79
IGMPv0_packet
Definition: pcigmp.h:10
IGMPv1_packet
Definition: pcigmp.h:23
IGMPv2_packet
Definition: pcigmp.h:35
IGMPv3_packet
Definition: pcigmp.h:46
arcnet_Header
Definition: pcsed.h:180
arp_Header
Definition: wattcp.h:476
arp
code
Definition: zinftree.h:24
config_table
Definition: tcp.h:461
eth_Header
Definition: pcsed.h:20
fddi_Header
Definition: pcsed.h:149
gz_stream
Definition: zgzio.c:55
icmp
Definition: ip_icmp.h:66
in6_Header
Definition: wattcp.h:381
in_Header
Definition: wattcp.h:329
llc_Header
Definition: pcsed.h:107
pkt_split
Definition: split.h:46
pppoe_Header
Definition: pcsed.h:229
pppoe_Packet
Definition: pcsed.h:237
rarp
route
Definition: route.h:55
sctp_ChunkDesc
Definition: sctp.h:577
sctp_Header
Definition: sctp.h:568
sctp_Initiation
Definition: sctp.h:608
sctp_ParamDesc
Definition: sctp.h:583
search_list
Definition: misc.h:131
tcp_Header
Definition: wattcp.h:418
tcp_PseudoHeader
Definition: wattcp.h:449
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::tx_wscale
BYTE tx_wscale
Definition: wattcp.h:647
tcp_Socket::vj_sa
DWORD vj_sa
VJ's alg, standard average (SRTT)
Definition: wattcp.h:615
tcp_Socket::rto
UINT rto
retransmission timeout
Definition: wattcp.h:618
tcp_Socket::wwindow
BYTE wwindow
Van Jacobson's algorithm.
Definition: wattcp.h:612
tcp_Socket::last_acknum
DWORD last_acknum[2]
for pcdbug.c; to follow SEQ/ACK
Definition: wattcp.h:600
tcp_Socket::cwindow
BYTE cwindow
Congestion window.
Definition: wattcp.h:611
tcp_Socket::karn_count
BYTE karn_count
count of packets
Definition: wattcp.h:619
tcp_Socket::rtt_time
DWORD rtt_time
Round Trip Time value.
Definition: wattcp.h:623
tcp_Socket::unhappy
BYTE unhappy
flag, indicates retransmitting segt's
Definition: wattcp.h:604
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
tcp_Socket::last_seqnum
DWORD last_seqnum[2]
increments
Definition: wattcp.h:601
tcp_Socket::missed_seq
DWORD missed_seq[2]
S.
Definition: wattcp.h:637
tcp_Socket::send_una
long send_una
unacked send data, must be signed
Definition: wattcp.h:597
tcp_Socket::vj_sd
DWORD vj_sd
VJ's alg, standard deviation (RTTVAR)
Definition: wattcp.h:616
tcp_Socket::his6addr
ip6_address his6addr
peer's IPv6 address
Definition: wattcp.h:592
tcp_Socket::send_next
DWORD send_next
SEQ we send but not ACK-ed by peer.
Definition: wattcp.h:596
tcp_Socket::recv_next
DWORD recv_next
SEQ number we expect to receive.
Definition: wattcp.h:595
timeval
Definition: wtime.h:30
timezone
Definition: wtime.h:55
tok_Header
Definition: pcsed.h:70
tok
Definition: oui-generated.c:13
token
Definition: pcdbug.c:1473
udp_Header
Definition: wattcp.h:406
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
hms_str
const char * hms_str(DWORD sec)
Return string "HH:MM:SS" for a time in seconds.
Definition: timer.c:715
get_timediff
long W32_CALL get_timediff(DWORD now, DWORD tim)
Return time difference between timers now and tim.
Definition: timer.c:620
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
get_cpu_speed
uint64 get_cpu_speed(void)
Return estimated CPU speed in Hz.
Definition: timer.c:839
elapsed_str
const char * elapsed_str(DWORD val)
Return string "xx:xx" for time elapsed since started.
Definition: timer.c:729
timer.h
ICMP6_PKT
Definition: pcicmp6.h:111
ICMP_PKT
Definition: pcicmp.h:126
link_Packet
Definition: pcsed.h:247
wattcpVersion
const char *W32_CALL wattcpVersion(void)
Return string for Watt-32 version.
Definition: version.c:77
wattcp.h
Core definitions.
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65


Watt-32 tcp/ip: E:/WATT/src/pcdbug.h Source File

  • src
pcdbug.h
Go to the documentation of this file.
1
3#ifndef _w32_PCDBUG_H
4#define _w32_PCDBUG_H
5
6#include "misc_str.h" /* _printf */
7
8typedef void (*DebugProc) (const void *sock, const in_Header *ip,
9 const char *file, unsigned line);
10
11#define debug_xmit W32_NAMESPACE (debug_xmit)
12#define debug_recv W32_NAMESPACE (debug_recv)
13#define debug_on W32_NAMESPACE (debug_on)
14
15W32_DATA DebugProc debug_xmit, debug_recv;
16W32_DATA int debug_on;
17
18extern const char *tcpStateName (UINT state);
19
20extern BOOL dbg_mode_all, dbg_print_stat, dbg_dns_details;
21
22extern void dbug_open (void);
23extern BOOL dbug_file (void);
24extern int dbug_write (const char *);
25extern int dbug_putc (int c);
26extern void dbug_flush (void);
27
28#if !defined(SWIG)
29 #if defined(__POCC__)
30 extern _CRTCHK(printf, 1, 2) int dbug_printf (const char *fmt, ...);
31 #else
32 extern int MS_CDECL dbug_printf (_Printf_format_string_
33 const char *fmt, ...) W32_ATTR_PRINTF (1, 2);
34 #endif
35#endif
36
37#if defined(USE_PPPOE)
38 extern const char *pppoe_get_code (WORD code);
39#endif
40
41/*
42 * Send Rx/Tx packet to debug-file.
43 * 'nw_pkt' must point to network layer packet.
44*
45 * Since High-C does not handle the below 'var-args', use a dummy
46 * function in 'highc.c'.
47 */
48#if defined(USE_DEBUG) && !defined(__HIGHC__)
49 #define DEBUG_RX(sock, nw_pkt) \
50 do { \
51 if (debug_recv) \
52 (*debug_recv) (sock, (const in_Header*)nw_pkt, \
53 __FILE__, __LINE__); \
54 } while (0)
55
56 #define DEBUG_TX(sock, nw_pkt) \
57 do { \
58 if (debug_xmit) \
59 (*debug_xmit) (sock, (const in_Header*)nw_pkt, \
60 __FILE__, __LINE__); \
61 } while (0)
62
63
64 /* Trace to console if 'debug_on >= ' specified 'level'.
65 */
66 #define TRACE_CONSOLE(level, args, ...) \
67 do { \
68 if (debug_on >= level) \
69 (*_printf) (args, ## __VA_ARGS__); \
70 } while (0)
71
72 /* Generic trace to wattcp.dbg file. No level is used here.
73 */
74 #define TRACE_FILE(args, ...) \
75 do { \
76 if (dbug_file()) \
77 dbug_printf (args, ## __VA_ARGS__); \
78 } while (0)
79#else
80 #define DEBUG_RX(sock, ip) ((void)0)
81 #define DEBUG_TX(sock, ip) ((void)0)
82
83 #if defined(__HIGHC__)
84 extern void TRACE_FILE (const char *fmt, ...);
85 extern void TRACE_CONSOLE (int level, const char *fmt, ...);
86 #else
87 #define TRACE_FILE(args, ...) ((void)0)
88 #define TRACE_CONSOLE(level, args, ...) ((void)0)
89 #endif
90#endif
91
92#endif
93
misc_str.h
dbg_mode_all
BOOL dbg_mode_all
These are public so they can be set by application if running without a config-file.
Definition: pcdbug.c:199
code
Definition: zinftree.h:24
in_Header
Definition: wattcp.h:329


Watt-32 tcp/ip: E:/WATT/src/pcdhcp.c Source File

  • src
pcdhcp.c
Go to the documentation of this file.
1
8/* Copyright (c) 1997-2007 Gisle Vanem <gvanem@yahoo.no>
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Gisle Vanem
21 * Bergen, Norway.
22 *
23 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/* \version 0.5: Oct 28, 1996 :
36 * G. Vanem - implemented from RFC1541 with help from pcbootp.c.
37 *
38 * \version 0.6: May 18, 1997 :
39 * G. Vanem - added RFC2131 DHCPINFORM message.
40 *
41 * \version 0.7: Apr 25, 2002 :
42 * G. Vanem - added RFC3004 User Class option.
43 *
44 * \version 0.8: Jul 24, 2002 :
45 * G. Vanem - Rewitten as a non-blocking FSM.
46 * - Removed DHCPINFORM message.
47 *
48 * \version 0.9: Nov 08, 2002 :
49 * G. Vanem - added handling of option 60 (Vendor Class)
50 *
51 * \version 0.91: Feb 21, 2003 :
52 * Greg Bredthauer found some bugs in DHCP_request(); DHCP_USER_CLASS
53 * and DHCP_CLASS_ID tags had 2 bytes of zeros in them.
54 * Added sending DHCP_CLIENT_ID in DHCP_request() since some DHCP-servers
55 * doesn't reply without it.
56 *
57 * \version 0.92: Jul 17, 2003:
58 * Riccardo De Agostini contibuted changes for application hooking of
59 * transient configuration; dhcp_set_config_func() etc.
60 *
61 * \version 0.93: Jul 2, 2004:
62 * Fixed logic around reading transient config.
63 *
64 * \version 0.94: Oct 22, 2007:
65 * Fixes for Linux dhcp servers: parse dhcp options in ACK msgs.
66 * Changed DHCP_do_boot() to handle renew and rebind as well as init.
67 * Renegotiate lease if past the renew or rebind times.
68 *
69 * \version 0.95: Dec 20, 2023:
70 * J.W. Jagersma - Improved DHCP bootstrap performance
71 * - Improved DHCP daemon stability on non-Pentium builds
72 */
73
74#include <stdio.h>
75#include <stdlib.h>
76#include <string.h>
77#include <time.h>
78#include <io.h>
79#include <ctype.h>
80#include <errno.h>
81
82#include "wattcp.h"
83#include "language.h"
84#include "misc.h"
85#include "misc_str.h"
86#include "run.h"
87#include "timer.h"
88#include "pcdns.h"
89#include "netaddr.h"
90#include "bsdname.h"
91#include "ip4_out.h"
92#include "syslog2.h"
93#include "sock_ini.h"
94#include "printk.h"
95#include "tftp.h"
96#include "pctcp.h"
97#include "pcsed.h"
98#include "pcarp.h"
99#include "pcqueue.h"
100#include "pcdbug.h"
101#include "pcpkt.h"
102#include "pcconfig.h"
103#include "pcbootp.h"
104#include "pcdhcp.h"
105
106#if defined(USE_DHCP)
107
108#define BROADCAST_FLAG intel16 (0x8000) /* network order (LSB=1) */
109
110/* This was 284, but D-Link 614+ router ACKs are too small
111 */
112#define DHCP_MIN_SIZE 280
113
114BOOL DHCP_did_gratuitous_arp = FALSE;
115
116static WattDHCPConfigFunc config_func = NULL;
117
118static DWORD exchange_id;
119static DWORD router, nameserver;
120static DWORD dhcp_server = 0;
121static DWORD dhcp_renewal = 0;
122static DWORD dhcp_rebind = 0;
123static DWORD dhcp_iplease = 0;
124static DWORD suggest_lease = 0;
125static DWORD old_ip_addr = 0;
126
127static BOOL bcast_flag = TRUE;
128static BOOL got_offer = FALSE;
129static BOOL configured = FALSE;
130static BOOL arp_check_ip = FALSE;
131static BOOL cfg_read = FALSE;
132static BOOL cfg_saved = FALSE;
133
134static int dhcp_timeout = 10;
135static int max_retries = 3;
136static int discover_loops = 0;
137
138static struct dhcp dhcp_in, dhcp_out;
139
140static void (*DHCP_state) (int) = NULL;
141static time_t renewal_timeout;
142static time_t rebind_timeout;
143static time_t lease_timeout;
144static DWORD send_timeout;
145static BOOL trace_on = FALSE;
146
147static char config_file [MAX_VALUELEN+1] = "";
148static sock_type *sock = NULL;
149
150/* Default list of DHCP request values
151 */
152static const BYTE default_request_list[] = {
153 DHCP_OPT_SUBNET_MASK,
154 DHCP_OPT_ROUTERS_ON_SNET,
155 DHCP_OPT_DNS_SRV,
156 DHCP_OPT_COOKIE_SRV,
157 DHCP_OPT_LPR_SRV,
158 DHCP_OPT_HOST_NAME,
159 DHCP_OPT_DOMAIN_NAME,
160 DHCP_OPT_IP_DEFAULT_TTL,
161 DHCP_OPT_IF_MTU,
162 DHCP_OPT_ARP_CACHE_TIMEOUT,
163 DHCP_OPT_ETHERNET_ENCAPSULATION,
164 DHCP_OPT_TCP_DEFAULT_TTL,
165#if defined(USE_BSD_API)
166 DHCP_OPT_LOG_SRV, /* links in syslog2.c */
167 DHCP_OPT_NBIOS_NAME_SRV, /* SMB-lib needs these */
168 DHCP_OPT_NBIOS_NODE_TYPE,
169 DHCP_OPT_NBIOS_SCOPE,
170#endif
171#if defined(USE_TFTP)
172 DHCP_OPT_TFTP_SERVER,
173 DHCP_OPT_BOOT_FILENAME
174#endif
175 };
176
177static struct DHCP_list request_list = {
178 (BYTE*) &default_request_list,
179 sizeof (default_request_list)
180 };
181
182static struct DHCP_list extra_options = { NULL, 0 };
183static struct DHCP_list user_class = { NULL, 0 };
184static struct DHCP_list vend_class = { (BYTE*)"Watt-32", 7 };
185
186static void DHCP_state_INIT (int event);
187static void DHCP_state_BOUND (int event);
188static void DHCP_state_RENEWING (int event);
189static void DHCP_state_REQUESTING (int event);
190static void DHCP_state_SELECTING (int event);
191static void DHCP_state_REBINDING (int event);
192
193static void dhcp_options_add (const BYTE *opt, unsigned max);
194static void dhcp_set_timers (void);
195static void change_ip_addr (void);
196static BYTE *put_request_list (BYTE *opt, int filled);
197static int write_config (void);
198static void erase_config (void);
199
200static void W32_CALL dhcp_fsm (void);
201
202#define DHCP_SEND(end) sock_fastwrite (sock, (const BYTE*)&dhcp_out, /* structure to send */ \
203 end - (BYTE*)&dhcp_out) /* length of structue */
204
205#if defined(USE_DEBUG)
206 #define TRACE(x) do { if (trace_on) (*_printf) x; } while (0)
207 #define INET_NTOA(x) _inet_ntoa (NULL, x)
208#else
209 #define TRACE(x) ((void)0)
210 #define INET_NTOA(x) ((void)0)
211#endif
212
213#if defined(USE_DEBUG)
217static const char *state_name (void)
218{
219 return (DHCP_state == DHCP_state_INIT ? "INIT" :
220 DHCP_state == DHCP_state_BOUND ? "BOUND" :
221 DHCP_state == DHCP_state_RENEWING ? "RENEWING" :
222 DHCP_state == DHCP_state_REQUESTING ? "REQUESTING" :
223 DHCP_state == DHCP_state_SELECTING ? "SELECTING" :
224 DHCP_state == DHCP_state_REBINDING ? "REBINDING" : "??");
225}
226
230static const char *period (DWORD sec)
231{
232 static char buf [25];
233 DWORD hours = sec / 3600UL;
234
235 if (sec < 60UL)
236 sprintf (buf, "%lus", (u_long)sec);
237 else if (sec < 3600UL)
238 sprintf (buf, "%lu:%02lu", (u_long)(sec/60), (u_long)(sec % 60));
239 else sprintf (buf, "%lu:%02lu:%02lu", (u_long)hours, (u_long)(sec/60-hours*60), (u_long)(sec % 60));
240 return (buf);
241}
242#endif
243
247static BYTE *make_boot_header (void)
248{
249 DWORD my_ip = 0UL;
250
251 if (DHCP_state == DHCP_state_BOUND ||
252 DHCP_state == DHCP_state_RENEWING ||
253 DHCP_state == DHCP_state_REBINDING)
254 my_ip = intel (my_ip_addr);
255
256 memset (&dhcp_out, 0, sizeof(dhcp_out));
257
258 _eth_get_hwtype (&dhcp_out.dh_htype, &dhcp_out.dh_hlen);
259
260 dhcp_out.dh_op = BOOTP_REQUEST;
261 dhcp_out.dh_xid = exchange_id;
262 dhcp_out.dh_secs = 0;
263 dhcp_out.dh_flags = bcast_flag ? BROADCAST_FLAG : 0;
264 dhcp_out.dh_yiaddr = 0;
265 dhcp_out.dh_ciaddr = my_ip;
266 dhcp_out.dh_giaddr = 0;
267 memcpy (dhcp_out.dh_chaddr, _eth_addr, _eth_mac_len);
268 *(DWORD*) &dhcp_out.dh_opt[0] = DHCP_MAGIC_COOKIE;
269 return (&dhcp_out.dh_opt[4]);
270}
271
275static BYTE *put_hardware_opt (BYTE *opt)
276{
277 BYTE hw_type, hw_len;
278
279 _eth_get_hwtype (&hw_type, &hw_len);
280 *opt++ = DHCP_OPT_CLIENT_ID;
281 *opt++ = hw_len + 1;
282 *opt++ = hw_type;
283 memcpy (opt, _eth_addr, hw_len);
284 opt += hw_len;
285 return (opt);
286}
287
291static int DHCP_discover (void)
292{
293 BYTE *opt, *start;
294
295 exchange_id = set_timeout (0); /* random exchange ID */
296 opt = start = make_boot_header();
297 *opt++ = DHCP_OPT_MSG_TYPE;
298 *opt++ = 1;
299 *opt++ = DHCP_DISCOVER;
300
301 opt = put_hardware_opt (opt);
302
303 *opt++ = DHCP_OPT_MAX_MSG_SIZE; /* Maximum DHCP message size */
304 *opt++ = 2;
305 *(WORD*)opt = intel16 (sizeof(struct dhcp));
306 opt += 2;
307
308 if (suggest_lease)
309 {
310 *opt++ = DHCP_OPT_IP_ADDR_LEASE_TIME;
311 *opt++ = sizeof (suggest_lease);
312 *(DWORD*)opt = intel (suggest_lease);
313 opt += sizeof (suggest_lease);
314 }
315 opt = put_request_list (opt, opt-start);
316 *opt++ = DHCP_OPT_END;
317 return DHCP_SEND (opt);
318}
319
323static int DHCP_request (BOOL renew)
324{
325 BYTE *opt = make_boot_header();
326
327 *opt++ = DHCP_OPT_MSG_TYPE;
328 *opt++ = 1;
329 *opt++ = DHCP_REQUEST;
330
331 if (!renew)
332 {
333 *opt++ = DHCP_OPT_SRV_IDENTIFIER;
334 *opt++ = sizeof (dhcp_server);
335 *(DWORD*)opt = intel (dhcp_server);
336 opt += sizeof (dhcp_server);
337 *opt++ = DHCP_OPT_REQUESTED_IP_ADDR;
338 *opt++ = sizeof (my_ip_addr);
339 *(DWORD*)opt = intel (my_ip_addr);
340 opt += sizeof (my_ip_addr);
341 }
342
343 /* Some DHCP-daemons require this tag in a REQUEST.
344 */
345 opt = put_hardware_opt (opt);
346
347/* ... don't know why we would ever renew a lease
348 * for the time remaining on our current lease...
349 */
350#if 0
351 if (dhcp_iplease && dhcp_iplease < (DWORD)-1)
352 {
353 *opt++ = DHCP_OPT_IP_ADDR_LEASE_TIME;
354 *opt++ = sizeof (dhcp_iplease);
355 *(DWORD*)opt = intel (dhcp_iplease);
356 opt += sizeof (dhcp_iplease);
357 }
358#endif
359
360 if (user_class.data)
361 {
362 *opt++ = DHCP_OPT_USER_CLASS;
363 *opt++ = user_class.size;
364 memcpy (opt, user_class.data, user_class.size);
365 opt += user_class.size;
366 }
367
368 if (vend_class.data)
369 {
370 *opt++ = DHCP_OPT_CLASS_ID;
371 *opt++ = vend_class.size;
372 memcpy (opt, vend_class.data, vend_class.size);
373 opt += vend_class.size;
374 }
375
376 *opt++ = DHCP_OPT_END;
377 TRACE (("DHCP req: renew(%d) dst(%s)\n",
378 renew, INET_NTOA(sock->udp.hisaddr)));
379 return DHCP_SEND (opt);
380}
381
387static int DHCP_release_decline (int msg_type, const char *msg)
388{
389 BYTE *opt;
390
391 exchange_id = set_timeout (0); /* new exchange ID */
392 opt = make_boot_header();
393
394 *opt++ = DHCP_OPT_MSG_TYPE;
395 *opt++ = 1;
396 *opt++ = msg_type;
397 *opt++ = DHCP_OPT_SRV_IDENTIFIER;
398 *opt++ = sizeof (dhcp_server);
399 *(DWORD*)opt = intel (dhcp_server);
400 opt += sizeof (dhcp_server);
401
402 if (msg)
403 {
404 const BYTE *end = &dhcp_out.dh_opt [sizeof(dhcp_out.dh_opt)-1];
405 size_t len = strlen (msg);
406
407 len = min (len, 255);
408 len = min (len, (size_t)(end-opt-3));
409 *opt++ = DHCP_OPT_MSG;
410 *opt++ = (BYTE)len;
411 memcpy (opt, msg, len);
412 opt += len;
413 }
414 *opt++ = DHCP_OPT_END;
415 return DHCP_SEND (opt);
416}
417
425static BOOL DHCP_arp_check (DWORD my_ip)
426{
427 eth_address eth;
428
429 if (_pktserial)
430 return (TRUE);
431
432 /* ARP broadcast to announce our new IP.
433 */
434 _arp_reply (NULL, my_ip, my_ip | ~sin_mask);
435 DHCP_did_gratuitous_arp = TRUE;
436
437 if (!arp_check_ip)
438 return (TRUE);
439
440 /* Check if IP is used by anybody else
441 */
442 TRACE (("Checking ARP.."));
443
444 if (!_arp_check_own_ip(&eth))
445 {
446 TRACE (("station %s claims to have my IP %s! Declining..\n",
447 MAC_address(&eth), INET_NTOA(my_ip)));
448 if (!trace_on)
449 outsnl ("Someone claims to have my IP! Declining..\7");
450 return (FALSE);
451 }
452 TRACE (("\n"));
453 return (TRUE);
454}
455
460static int DHCP_offer (const struct dhcp *in)
461{
462 int len;
463 DWORD ip;
464 const BYTE *opt = (const BYTE*) &in->dh_opt[4];
465
466 while (opt < in->dh_opt + sizeof(in->dh_opt))
467 {
468 switch (*opt)
469 {
470 case DHCP_OPT_PAD:
471 opt++;
472 continue;
473
474 case DHCP_OPT_SUBNET_MASK:
475 sin_mask = intel (*(DWORD*)(opt+2));
476 TRACE (("Net-mask: %s\n", INET_NTOA(sin_mask)));
477 break;
478
479 case DHCP_OPT_TIME_OFFSET:
480#if defined(USE_DEBUG)
481 {
482 long ofs = *(long*)(opt+2);
483 TRACE (("Time-ofs: %.2fh\n", (double)ofs/3600.0));
484 }
485#endif
486 break;
487
488 case DHCP_OPT_ROUTERS_ON_SNET:
489 {
490 static BOOL gw_added = FALSE;
491
492 if (!gw_added)
493 _arp_kill_gateways(); /* delete gateways from cfg-file */
494 gw_added = TRUE;
495 router = intel (*(DWORD*)(opt+2));
496 _arp_add_gateway (NULL, router);
497 TRACE (("Gateway: %s\n", INET_NTOA(router)));
498 }
499 break;
500
501 case DHCP_OPT_DNS_SRV:
502 {
503 static BOOL dns_added = FALSE;
504
505 for (len = 0; len < *(opt+1); len += sizeof(DWORD))
506 {
507 ip = intel (*(DWORD*)(opt+2+len));
508 if (!dns_added)
509 last_nameserver = 0; /* delete nameserver from cfg-file */
510
511 /*
512 * !!fix-me: Add only first name-server cause resolve() doesn't
513 * handle multiple servers (in different nets) very well
514 */
515 if (len == 0)
516 {
517 nameserver = ip;
518 _add_server (&last_nameserver, def_nameservers,
519 DIM(def_nameservers), ip);
520 }
521 dns_added = TRUE;
522 TRACE (("DNS: %s\n", INET_NTOA(ip)));
523 }
524 }
525 break;
526
527#if defined(USE_BSD_API)
528 case DHCP_OPT_LOG_SRV:
529 if (!syslog_host_name[0] && /* not already set */
530 opt[1] % 4 == 0) /* length = n * 4 */
531 {
532 ip = intel (*(DWORD*)(opt+2)); /* select 1st host */
533 _strlcpy (syslog_host_name, _inet_ntoa(NULL, ip),
534 sizeof(syslog_host_name));
535 TRACE (("Syslog: %s\n", syslog_host_name));
536 }
537 break;
538
539 case DHCP_OPT_NBIOS_NAME_SRV:
540 ip = intel (*(DWORD*)(opt+2));
541 TRACE (("WINS: %s\n", INET_NTOA(ip)));
543 break;
544
545 case DHCP_OPT_NBIOS_NODE_TYPE:
546 TRACE (("NBT node: %02X\n", opt[2]));
547 break;
548
549 case DHCP_OPT_NBIOS_SCOPE:
550 TRACE (("NBT scope: %.*s\n", opt[1], opt+2));
551 break;
552#endif
553 case DHCP_OPT_HOST_NAME:
554 /* Don't use sethostname() because '*(opt+2)' is not a FQDN.
555 */
556 len = min (opt[1], sizeof(hostname));
557 memcpy (hostname, opt+2, len);
558 hostname [len] = '\0';
559 TRACE (("Host name: `%s'\n", hostname));
560 break;
561
562 case DHCP_OPT_DOMAIN_NAME:
563 len = min (opt[1], sizeof(defaultdomain)-1);
564 setdomainname ((const char*)(opt+2), len+1);
565 TRACE (("Domain: `%s'\n", def_domain));
566 break;
567
568 case DHCP_OPT_IP_DEFAULT_TTL:
569 case DHCP_OPT_TCP_DEFAULT_TTL:
570 _default_ttl = opt[2];
571 break;
572
573 case DHCP_OPT_MSG_TYPE:
574 if (opt[2] == DHCP_OFFER)
575 got_offer = TRUE;
576 break;
577
578 case DHCP_OPT_MSG:
579 outsn ((const char*)(opt+2), *(opt+1));
580 break;
581
582 case DHCP_OPT_SRV_IDENTIFIER:
583 dhcp_server = intel (*(DWORD*)(opt+2));
584 TRACE (("Server: %s\n", INET_NTOA(dhcp_server)));
585 break;
586
587 case DHCP_OPT_IP_ADDR_LEASE_TIME:
588 dhcp_iplease = intel (*(DWORD*)(opt+2));
589 TRACE (("IP lease: %s\n", period(dhcp_iplease)));
590 break;
591
592 case DHCP_OPT_T1_VALUE:
593 dhcp_renewal = intel (*(DWORD*)(opt+2));
594 TRACE (("Renewal: %s\n", period(dhcp_renewal)));
595 break;
596
597 case DHCP_OPT_T2_VALUE:
598 dhcp_rebind = intel (*(DWORD*)(opt+2));
599 TRACE (("Rebind: %s\n", period(dhcp_rebind)));
600 break;
601
602 case DHCP_OPT_TCP_KEEPALIVE_INTERVAL:
603#if !defined(USE_UDP_ONLY)
604 tcp_keep_intvl = intel (*(DWORD*)(opt+2));
605#endif
606 break;
607
608 case DHCP_OPT_OVERLOAD:
609 switch (opt[2])
610 {
611 case 1:
612 TRACE (("Overload: `dh_file' options\n"));
613 dhcp_options_add (in->dh_file, sizeof(in->dh_file));
614 break;
615 case 2:
616 TRACE (("Overload: `dh_sname' options\n"));
617 dhcp_options_add (in->dh_sname, sizeof(in->dh_sname));
618 break;
619 case 3:
620 TRACE (("Overload: `dh_file/dh_sname' options\n"));
621 dhcp_options_add (in->dh_file, sizeof(in->dh_file));
622 dhcp_options_add (in->dh_sname, sizeof(in->dh_sname));
623 break;
624 }
625 break;
626
627#if defined(USE_TFTP)
628 case DHCP_OPT_TFTP_SERVER:
629 {
630 const char *serv;
631 len = opt[1];
632 serv = tftp_set_server ((const char*)(opt+2), len);
633 TRACE (("TFTP-serv: `%s'\n", serv));
634 ARGSUSED (serv);
635 }
636 break;
637
638 case DHCP_OPT_BOOT_FILENAME:
639 {
640 const char *file;
641 len = opt[1];
642 file = tftp_set_boot_fname ((const char*)(opt+2), len);
643 TRACE (("BOOT-file: `%s'\n", file));
644 ARGSUSED (file);
645 }
646 break;
647#endif
648
649 case DHCP_OPT_USER_CLASS: /* these options are ignored in replies */
650 case DHCP_OPT_CLASS_ID:
651 break;
652
653 case DHCP_OPT_GRUB_MENU: /* GRUB loader config-file */
654 TRACE (("GRUB: %.*s\n", opt[1], opt+2));
655 break;
656
657 case DHCP_OPT_ETHERNET_ENCAPSULATION:
658 TRACE (("Encap: %s\n", opt[2] ? "IEEE 802.3" : "Ethernet II"));
659 if (opt[2] != 0)
660 outsnl (_LANG("Only Ethernet II encapsulation supported"));
661 break;
662
663 case DHCP_OPT_END:
664 TRACE (("got end-option\n"));
665 return (got_offer);
666
667 case DHCP_OPT_BROADCAST_ADDR:
668 ip = intel (*(DWORD*)(opt+2));
669 TRACE (("Ignoring option BROADCAST_ADDR: %s\n", INET_NTOA(ip)));
670 break;
671
672 default:
673 TRACE (("Ignoring option %d\n", *opt));
674 break;
675 }
676 opt += *(opt+1) + 2;
677 }
678
679 if (extra_options.data)
680 {
681 struct dhcp ext;
682
683 len = min (extra_options.size, sizeof(ext.dh_opt));
684 extra_options.data [len] = DHCP_OPT_END;
685 memcpy (ext.dh_opt, extra_options.data, len);
686 DHCP_offer (&ext);
687 }
688 return (got_offer);
689}
690
694static int DHCP_is_ack (void)
695{
696 const BYTE *opt = (const BYTE*) &dhcp_in.dh_opt [4];
697
698 return (opt[0] == DHCP_OPT_MSG_TYPE && opt[1] == 1 && opt[2] == DHCP_ACK);
699}
700
704static int DHCP_is_nack (void)
705{
706 const BYTE *opt = (const BYTE*) &dhcp_in.dh_opt [4];
707
708 return (opt[0] == DHCP_OPT_MSG_TYPE && opt[1] == 1 && opt[2] == DHCP_NAK);
709}
710
711/*
712 * A callback for ICMP-messages.
713 * Does nothing yet.
714 */
715static int W32_CALL DHCP_icmp_callback (void *s, BYTE icmp_type, BYTE icmp_code)
716{
717 TRACE (("DHCP_icmp_callback(): icmp_type: %d, icmp_code: %d \n", icmp_type, icmp_code));
718
719 ARGSUSED (s);
720 ARGSUSED (icmp_type);
721 ARGSUSED (icmp_code);
722 return (0);
723}
724
725
732void W32_CALL DHCP_release (BOOL force)
733{
734 if (force)
735 {
736 TRACE (("Sending DHCP release 01\n"));
737 DHCP_release_decline (DHCP_RELEASE, NULL);
738 }
739 else if (configured)
740 {
741 /* Don't release if:
742 * DHCP-config is saved on disk and remaining lease is
743 * above minimum.
744 */
745 if (!(cfg_saved &&
746 (lease_timeout && (lease_timeout - time(NULL) > DHCP_MIN_LEASE))))
747 {
748 TRACE (("Sending DHCP release 02\n"));
749 DHCP_release_decline (DHCP_RELEASE, NULL);
750 }
751 }
752 DAEMON_DEL (dhcp_fsm);
753 if (sock)
754 {
755 sock_close (sock);
756 free (sock);
757 sock = NULL;
758 }
759}
760
764DWORD W32_CALL DHCP_get_server (void)
765{
766 return (dhcp_server);
767}
768
772static sock_type *dhcp_open (const char *msg, BOOL use_broadcast)
773{
774 udp_Socket *sock = malloc (sizeof(*sock));
775 DWORD host;
776
777 if (!sock)
778 {
779 outs (_LANG("DHCP: malloc failed\n"));
780 return (NULL);
781 }
782
783 if (msg && (trace_on || debug_on))
784 outs (msg);
785
786 if (use_broadcast)
787 host = IP_BCAST_ADDR; /* 255.255.255.255 */
788 else host = dhcp_server; /* default is 0.0.0.0 which maps to 255.255.255.255 */
789
790 if (!udp_open (sock, IPPORT_BOOTPC, host, IPPORT_BOOTPS, NULL))
791 {
792 if (trace_on || debug_on)
793 {
794 outs ("DHCP: ");
795 outsnl (sock->err_msg);
796 }
797 free (sock);
798 sock = NULL;
799 }
800 TRACE (("DHCP open: brdcast(%d) srvr(%s)\n",
801 use_broadcast, INET_NTOA(dhcp_server)));
802
803 if (sock)
804 sock->icmp_callb = DHCP_icmp_callback;
805
806 return (sock_type*)sock; /* sock is free'd in DHCP_exit() */
807}
808
812static void store_DHCP_server_MAC (void)
813{
814 if ((_pktdevclass == PDCLASS_ETHER || _pktdevclass == PDCLASS_TOKEN) &&
815 memcmp(sock->udp.his_ethaddr, _eth_brdcast, sizeof(_eth_brdcast)))
816 {
817 const eth_address *eth = (const eth_address*) sock->udp.his_ethaddr;
818 _arp_cache_add (dhcp_server, eth, TRUE);
819 }
820}
821
826static void DHCP_state_BOUND (int event)
827{
828 if (event == EVENT_T1_TIMEOUT) /* renewal timeout */
829 {
830 old_ip_addr = my_ip_addr; /* remember current address */
831 got_offer = FALSE;
832
833 TRACE (("Sending DHCP request 01\n"));
834 DHCP_request (1);
835 DHCP_state = DHCP_state_RENEWING;
836 }
837}
838
845static void DHCP_state_REQUESTING (int event)
846{
847 if (event == EVENT_SEND_TIMEOUT)
848 {
849 TRACE (("Sending DHCP request 00\n"));
850 DHCP_request (0);
851
852 /*UPDATE: 05MAR2006 paul.suggs@vgt.net
853 * There is a timing condition within the FSM where the state has changed
854 * to REQUESTING but in dhcp_fsm(), chk_timeout() will be evaluated true
855 * which sets send_timeout to 0 before the first execution of this state
856 * handler. Once set to 0, we have to wait for rollover to resend the
857 * above request if it is lost for some reason
858 */
859 send_timeout = set_timeout (Random(4000, 6000));
860 }
861 else if (event == EVENT_ACK)
862 {
863 TRACE (("Got DHCP ack while requesting\n"));
864
865 if (!DHCP_arp_check(my_ip_addr))
866 {
867 my_ip_addr = 0; /* decline from 0.0.0.0 */
868 DHCP_release_decline (DHCP_DECLINE, "IP is not free");
869 send_timeout = set_timeout (Random(4000, 6000));
870 DHCP_state = DHCP_state_INIT;
871 }
872 else
873 {
874 DHCP_offer (&dhcp_in); /* parse options in the ack too */
875 configured = 1; /* we are (re)configured */
876 if (dhcp_server)
877 store_DHCP_server_MAC();
878 dhcp_set_timers();
879 send_timeout = 0UL;
880 DHCP_state = DHCP_state_BOUND;
881 }
882 }
883 else if (event == EVENT_NAK)
884 {
885 send_timeout = set_timeout (Random(4000, 6000));
886 my_ip_addr = 0UL;
887 DHCP_state = DHCP_state_INIT;
888 }
889}
890
896static void DHCP_state_REBINDING (int event)
897{
898 if (event == EVENT_ACK)
899 {
900 TRACE (("Got DHCP ack while rebinding\n"));
901 dhcp_set_timers();
902 DHCP_offer (&dhcp_in);
903 change_ip_addr();
904 DHCP_state = DHCP_state_BOUND;
905 }
906 else if (event == EVENT_NAK)
907 {
908 send_timeout = set_timeout (Random(4000, 6000));
909 my_ip_addr = 0UL;
910 DHCP_state = DHCP_state_INIT;
911 }
912}
913
921static void DHCP_state_RENEWING (int event)
922{
923 if (event == EVENT_SEND_TIMEOUT)
924 {
925 TRACE (("Sending DHCP request for renew\n"));
926 DHCP_request (1);
927 }
928 else if (event == EVENT_T2_TIMEOUT)
929 {
930 TRACE (("Sending DHCP request for rebind\n"));
931 bcast_flag = TRUE;
932 DHCP_request (1);
933 DHCP_state = DHCP_state_REBINDING;
934 }
935 else if (event == EVENT_ACK)
936 {
937 TRACE (("Got DHCP ack while renewing\n"));
938 dhcp_set_timers();
939 DHCP_offer (&dhcp_in);
940 change_ip_addr();
941 DHCP_state = DHCP_state_BOUND;
942 }
943 else if (event == EVENT_NAK)
944 {
945 TRACE (("Got DHCP nack while renewing\n"));
946 send_timeout = set_timeout (Random(4000, 6000));
947 my_ip_addr = 0;
948 DHCP_state = DHCP_state_INIT;
949 }
950}
951
957static void DHCP_state_SELECTING (int event)
958{
959 if (event == EVENT_OFFER && !got_offer && DHCP_offer(&dhcp_in))
960 {
961 TRACE (("Got DHCP offer\n"));
962 send_timeout = set_timeout (Random(100, 500));
963
964 if (dhcp_renewal == 0L)
965 dhcp_renewal = dhcp_iplease / 2; /* default T1 time */
966 if (dhcp_rebind == 0)
967 dhcp_rebind = dhcp_iplease * 7 / 8; /* default T2 time */
968
969 /* Remember my_ip_addr from OFFER because WinNT server
970 * doesn't include it in ACK message.
971 */
972 my_ip_addr = ((_udp_Socket*)sock)->myaddr = intel (dhcp_in.dh_yiaddr);
973 TRACE (("my_ip_addr = %s\n", INET_NTOA(my_ip_addr)));
974 send_timeout = set_timeout (100);
975 DHCP_state = DHCP_state_REQUESTING;
976 }
977 else if (event == EVENT_SEND_TIMEOUT) /* retransmit timeout */
978 {
979 DHCP_state = DHCP_state_INIT;
980 (*DHCP_state) (event);
981 }
982}
983
988static void DHCP_state_INIT (int event)
989{
990 if (event == EVENT_SEND_TIMEOUT)
991 {
992 discover_loops++;
993 exchange_id = set_timeout (0); /* random exchange ID */
994
995 TRACE (("Sending DHCP discover (%d)\n", discover_loops));
996
997 send_timeout = set_timeout (1000 * dhcp_timeout);
998 DHCP_discover();
999 DHCP_state = DHCP_state_SELECTING;
1000 }
1001}
1002
1003#ifdef NOT_USED
1007static void DHCP_state_REBOOTING (int event)
1008{
1009 if (event == EVENT_ACK)
1010 {
1011 DHCP_state = DHCP_state_BOUND;
1012 }
1013 else if (event == EVENT_NAK)
1014 {
1015 send_timeout = set_timeout (Random(4000, 6000));
1016 DHCP_state = DHCP_state_INIT;
1017 }
1018}
1019#endif
1020
1024static void W32_CALL dhcp_fsm (void)
1025{
1026 if (sock_dataready(sock))
1027 {
1028 int len = sock_fastread (sock, (BYTE*)&dhcp_in, sizeof(dhcp_in));
1029
1030 if (len >= DHCP_MIN_SIZE && /* packet large enough */
1031 dhcp_in.dh_op == BOOTP_REPLY && /* got a BOOTP reply */
1032 dhcp_in.dh_xid == dhcp_out.dh_xid && /* got our exchange ID */
1033 !memcmp(dhcp_in.dh_chaddr, _eth_addr, /* correct hardware addr */
1034 sizeof(eth_address)))
1035 {
1036 if (DHCP_is_ack())
1037 {
1038 TRACE (("%s/ACK: ", state_name()));
1039 (*DHCP_state) (EVENT_ACK);
1040 }
1041 else if (DHCP_is_nack())
1042 {
1043 TRACE (("%s/NAK: ", state_name()));
1044 (*DHCP_state) (EVENT_NAK);
1045 }
1046 else
1047 {
1048 TRACE (("%s/OFFER: ", state_name()));
1049 (*DHCP_state) (EVENT_OFFER);
1050 }
1051 }
1052 }
1053
1054 if (send_timeout == (DWORD)-1 || chk_timeout(send_timeout))
1055 {
1056 send_timeout = 0UL;
1057 TRACE (("%s/SEND_TIMEOUT: ", state_name()));
1058 (*DHCP_state) (EVENT_SEND_TIMEOUT);
1059 }
1060
1061 if (renewal_timeout && time(NULL) >= renewal_timeout)
1062 {
1063 renewal_timeout = 0UL;
1064 TRACE (("%s/T1_TIMEOUT: ", state_name()));
1065 (*DHCP_state) (EVENT_T1_TIMEOUT);
1066 }
1067
1068 if (rebind_timeout && time(NULL) >= rebind_timeout)
1069 {
1070 rebind_timeout = 0UL;
1071 TRACE (("%s/T2_TIMEOUT: ", state_name()));
1072 (*DHCP_state) (EVENT_T2_TIMEOUT);
1073 }
1074}
1075
1085int DHCP_do_boot (void)
1086{
1087 int save_mtu = _mtu;
1088 time_t last, now, timeout;
1089
1090 if (cfg_read) /* DHCP_read_config() okay */
1091 return (1);
1092
1093 outs (_LANG("Configuring through DHCP.."));
1094 if (!sock)
1095 sock = dhcp_open (NULL, bcast_flag);
1096 if (!sock)
1097 return (0);
1098
1099 if (DHCP_state != DHCP_state_RENEWING &&
1100 DHCP_state != DHCP_state_REBINDING)
1101 {
1102 my_ip_addr = 0;
1103 sin_mask = 0;
1104 }
1105
1106 _mtu = ETH_MAX_DATA;
1107 discover_loops = 0;
1108
1109 erase_config(); /* delete old configuration */
1110
1111 /* kick start DISCOVER message now please
1112 */
1113 send_timeout = (DWORD)-1;
1114
1115 if (DHCP_state != DHCP_state_RENEWING &&
1116 DHCP_state != DHCP_state_REBINDING)
1117 DHCP_state = DHCP_state_INIT;
1118
1119 last = time (NULL);
1120 timeout = last + (dhcp_timeout * max_retries) + 1;
1121
1122 while (DHCP_state != DHCP_state_BOUND)
1123 {
1124 tcp_tick (NULL);
1125 dhcp_fsm ();
1126
1127 if (discover_loops >= max_retries) /* retries exhaused */
1128 break;
1129
1130 now = time (NULL);
1131 if (last != now)
1132 {
1133 last = now;
1134 putc ('.', stderr); /* indicate activity */
1135 if (now > timeout) /* timeout reached */
1136 break;
1137 }
1138 WATT_YIELD();
1139 }
1140
1141 got_offer = FALSE; /* ready for next cycle */
1142 _mtu = save_mtu;
1143
1144 if (my_ip_addr)
1145 {
1146 cfg_saved = write_config() > 0;
1147
1148 /* add "background" daemon. For a DHCP-RENEWAL etc.
1149 */
1150 if (!DAEMON_ADD (dhcp_fsm))
1151 return (0);
1152
1153 putc ('\n', stderr);
1154 return (1);
1155 }
1156 return (0);
1157}
1158
1162static void dhcp_options_add (const BYTE *opt, unsigned max)
1163{
1164 int len = 0;
1165 char *add;
1166 const BYTE *end = opt + max;
1167
1168 extra_options.data = (BYTE*) realloc (extra_options.data, max);
1169 if (!extra_options.data)
1170 return;
1171
1172 add = (char*)&extra_options.data + extra_options.size;
1173
1174 /* Loop over `opt' and append to `add'. Strip away DHCP_OPT_END
1175 * and DHCP_OPT_PAD options.
1176 */
1177 while (opt < end)
1178 {
1179 if (*opt == DHCP_OPT_PAD)
1180 continue;
1181 if (*opt == DHCP_OPT_END)
1182 return;
1183
1184 len = opt[1];
1185 memcpy (add, opt, len+2);
1186 add += len + 2;
1187 opt += len + 2;
1188 extra_options.size += len + 2;
1189 }
1190}
1191
1195static void dhcp_set_timers (void)
1196{
1197 time_t now = time (NULL);
1198
1199 if (dhcp_iplease == 0UL)
1200 lease_timeout = (time_t)-1;
1201 else lease_timeout = now + dhcp_iplease;
1202
1203 if (dhcp_renewal == 0UL)
1204 renewal_timeout = (time_t)-1;
1205 else renewal_timeout = now + dhcp_renewal;
1206
1207 if (dhcp_rebind == 0UL)
1208 rebind_timeout = (time_t)-1;
1209 else
1210 {
1211 rebind_timeout = now + dhcp_rebind;
1212 if (rebind_timeout == renewal_timeout)
1213 rebind_timeout += 10; /* add 10 seconds */
1214 }
1215 if (dhcp_iplease == 0UL)
1216 TRACE (("Infinite lease!!\n"));
1217}
1218
1222static void change_ip_addr (void)
1223{
1224 _udp_Socket *udp;
1225 _tcp_Socket *tcp;
1226
1227 if (my_ip_addr == old_ip_addr)
1228 return;
1229
1230#if !defined(USE_UDP_ONLY)
1231 for (tcp = _tcp_allsocs; tcp; tcp = tcp->next)
1232 if (tcp->myaddr)
1233 tcp->myaddr = my_ip_addr;
1234#endif
1235 for (udp = _udp_allsocs; udp; udp = udp->next)
1236 if (udp->myaddr)
1237 udp->myaddr = my_ip_addr;
1238}
1239
1244static int set_request_list (char *options)
1245{
1246 static BOOL init = FALSE;
1247 int num = 0;
1248 int maxreq = 312 - 27; /* sizeof(dh_opt) - min size of rest */
1249 BYTE *list, *start, *tok, *end;
1250 char *tok_buf = NULL;
1251
1252 if (init || (list = calloc(maxreq, 1)) == NULL)
1253 return (0);
1254
1255 init = TRUE;
1256 start = list;
1257 end = start + maxreq - 1;
1258 tok = (BYTE*) strtok_r (options, ", \t", &tok_buf);
1259
1260 while (tok && list < end)
1261 {
1262 *list = ATOI ((const char*)tok);
1263 tok = (BYTE*) strtok_r (NULL, ", \t", &tok_buf);
1264
1265 /* If request list start with Pad option ("DHCP.REQ_LIST=0"),
1266 * disable options all-together.
1267 */
1268 if (num == 0 && *list == '0')
1269 break;
1270 num++;
1271 list++;
1272 }
1273
1274 request_list.data = start;
1275 request_list.size = num;
1276
1277#if 0 /* test */
1278 {
1279 int i;
1280 for (i = 0; i < request_list.size; i++)
1281 printf ("%2d, ", request_list.data[i]);
1282 puts ("");
1283 }
1284#endif
1285 return (1);
1286}
1287
1291static BYTE *put_request_list (BYTE *opt, int filled)
1292{
1293 size_t size = min (request_list.size, sizeof(dhcp_out.dh_opt)-filled-1);
1294 /* room for DHCP_OPT_END ^ */
1295 if (size > 0 && request_list.data)
1296 {
1297 size = min (size, 255);
1298 *opt++ = DHCP_OPT_PARAM_REQUEST;
1299 *opt++ = (BYTE)size;
1300 memcpy (opt, request_list.data, size);
1301 opt += size;
1302 }
1303 return (opt);
1304}
1305
1311static int set_user_class (const char *value)
1312{
1313 static BOOL init = FALSE;
1314 int total = 0;
1315 int maxreq = sizeof(dhcp_out.dh_opt) - 27; /* adjust for rest */
1316 char *list, *list_start;
1317 char *list_end;
1318 const char *value_end;
1319
1320 if (init || (list = (char*)calloc(maxreq, 1)) == NULL)
1321 return (0);
1322
1323 init = TRUE;
1324 list_start = list;
1325 list_end = list + maxreq - 1;
1326 value_end = value + strlen (value);
1327
1328 while (list < list_end && value < value_end)
1329 {
1330 const char *comma = strchr (value, ',');
1331 int size;
1332
1333 if (comma)
1334 size = comma - value; /* "xxx,xxx" */
1335 else size = strlen (value); /* "xxxx" */
1336 *list++ = size;
1337 memcpy (list, value, size);
1338 list += size;
1339 value += size + 1;
1340 total += size + 1;
1341 }
1342
1343 user_class.data = (BYTE*) list_start;
1344 user_class.size = total;
1345
1346#if 0 /* test */
1347 {
1348 size_t i;
1349 for (i = 0; i < user_class.size; i++)
1350 {
1351 int ch = user_class.data [i];
1352
1353 if (isprint(ch))
1354 printf ("%c", ch);
1355 else printf ("\\x%02X", ch);
1356 }
1357 puts ("");
1358 }
1359#endif
1360 return (1);
1361}
1362
1366static int set_vend_class (const char *value)
1367{
1369 ARGSUSED (value);
1370 return (0);
1371}
1372
1373/*-------------------------------------------------------------------*/
1374
1375static void (W32_CALL *prev_hook) (const char*, const char*) = NULL;
1376
1377/* Absolute times for expiry of lease, renewal and rebind
1378 * read from user (config_func) or transient config file.
1379 */
1380static time_t cfg_dhcp_iplease;
1381static time_t cfg_dhcp_renewal;
1382static time_t cfg_dhcp_rebind;
1383
1389static void W32_CALL DHCP_cfg_hook (const char *name, const char *value)
1390{
1391 static const struct config_table dhcp_cfg[] = {
1392 { "REQ_LIST", ARG_FUNC, (void*)set_request_list },
1393 { "TRACE", ARG_ATOI, (void*)&trace_on },
1394 { "BCAST", ARG_ATOI, (void*)&bcast_flag },
1395 { "TIMEOUT", ARG_ATOI, (void*)&dhcp_timeout },
1396 { "RETRIES", ARG_ATOI, (void*)&max_retries },
1397 { "ARPCHECK", ARG_ATOI, (void*)&arp_check_ip },
1398 { "HOST", ARG_RESOLVE,(void*)&dhcp_server },
1399 { "USERCLASS",ARG_FUNC, (void*)set_user_class },
1400 { "VENDCLASS",ARG_FUNC, (void*)set_vend_class },
1401 { "CONFIG", ARG_STRCPY, (void*)&config_file },
1402 { NULL, 0, NULL }
1403 };
1404
1405 if (!parse_config_table(&dhcp_cfg[0], "DHCP.", name, value) && prev_hook)
1406 (*prev_hook) (name, value);
1407}
1408
1412static void W32_CALL DHCP_exit (void)
1413{
1414 if (_watt_fatal_error)
1415 return;
1416
1417 DO_FREE (user_class.data);
1418 DO_FREE (extra_options.data);
1419 DO_FREE (sock);
1420 if (request_list.data != (BYTE*)&default_request_list)
1421 DO_FREE (request_list.data);
1422
1423#if defined(USE_BSD_API)
1424 syslog_host_name[0] = '\0';
1425#endif
1426}
1427
1431void DHCP_init (void)
1432{
1433 prev_hook = usr_init;
1434 usr_init = DHCP_cfg_hook;
1435 RUNDOWN_ADD (DHCP_exit, 259);
1436}
1437
1441static void set_my_ip (const char *value)
1442{
1443 TRACE (("DHCP: using previous address %s\n", value));
1444 my_ip_addr = aton (value);
1445}
1446
1447static void set_netmask (const char *value)
1448{
1449 TRACE (("DHCP: using previous netmask %s\n", value));
1450 sin_mask = aton (value);
1451}
1452
1453static void set_gateway (const char *value)
1454{
1455 router = aton (value);
1456 if (router)
1457 {
1458 _arp_kill_gateways(); /* delete gateways from cfg-file */
1459 TRACE (("DHCP: using previous gateway %s\n", value));
1460 _arp_add_gateway (NULL, router);
1461 }
1462 else
1463 TRACE (("DHCP: previous gateway is 0.0.0.0!\n"));
1464}
1465
1466static void set_nameserv (const char *value)
1467{
1468 TRACE (("DHCP: using previous nameserv %s\n", value));
1469 nameserver = aton (value);
1470 _add_server (&last_nameserver, def_nameservers, DIM(def_nameservers), nameserver);
1471}
1472
1473static void set_server (const char *value)
1474{
1475 TRACE (("DHCP: using previous server %s\n", value));
1476 dhcp_server = aton (value);
1477}
1478
1479static void set_domain (const char *value)
1480{
1481 TRACE (("DHCP: using previous domain %s\n", value));
1482 setdomainname (value, strlen(value)+1);
1483}
1484
1485static void set_lease (const char *value)
1486{
1487 cfg_dhcp_iplease = ATOL (value);
1488}
1489
1490static void set_renew (const char *value)
1491{
1492 cfg_dhcp_renewal = ATOL (value);
1493}
1494
1495static void set_rebind (const char *value)
1496{
1497 cfg_dhcp_rebind = ATOL (value);
1498}
1499
1511static BOOL eval_timers (void)
1512{
1513 time_t now = time (NULL);
1514#if defined(USE_DEBUG)
1515 char ct_buf [30];
1516#endif
1517
1518 TRACE (("DHCP: IP-lease expires %s", ctime_r(&cfg_dhcp_iplease, ct_buf)));
1519 TRACE (("DHCP: rebinding expires %s", ctime_r(&cfg_dhcp_rebind, ct_buf)));
1520 TRACE (("DHCP: renewal expires %s", ctime_r(&cfg_dhcp_renewal, ct_buf)));
1521
1522 if (cfg_dhcp_iplease < now)
1523 dhcp_iplease = DHCP_MIN_LEASE;
1524 else dhcp_iplease = (DWORD)(cfg_dhcp_iplease - now);
1525
1526 if (cfg_dhcp_renewal < now)
1527 dhcp_renewal = dhcp_iplease / 2;
1528 else dhcp_renewal = (DWORD)(cfg_dhcp_renewal - now);
1529
1530 if (cfg_dhcp_rebind < now)
1531 dhcp_rebind = dhcp_iplease * 7 / 8;
1532 else dhcp_rebind = (DWORD)(cfg_dhcp_rebind - now);
1533
1534 discover_loops = 0;
1535
1536 if (now < cfg_dhcp_renewal)
1537 {
1538 TRACE (("DHCP: BOUND\n"));
1539 DHCP_state = DHCP_state_BOUND; /* no action, goto BOUND */
1540 return (TRUE);
1541 }
1542
1543 if (now >= cfg_dhcp_renewal && now < cfg_dhcp_rebind)
1544 {
1545 TRACE (("DHCP: RENEWING\n"));
1546 DHCP_state = DHCP_state_BOUND;
1547 (*DHCP_state) (EVENT_T1_TIMEOUT); /* goto RENEWING */
1548 return (FALSE);
1549 }
1550
1551 if (now >= cfg_dhcp_rebind && now < cfg_dhcp_iplease)
1552 {
1553 TRACE (("DHCP: REBINDING\n"));
1554 DHCP_state = DHCP_state_RENEWING;
1555 (*DHCP_state) (EVENT_T2_TIMEOUT); /* goto REBINDING */
1556 return (FALSE);
1557 }
1558 return (FALSE);
1559}
1560
1567static const struct config_table transient_cfg[] = {
1568 { "DHCP.LEASE", ARG_FUNC, (void*)set_lease },
1569 { "DHCP.RENEW", ARG_FUNC, (void*)set_renew },
1570 { "DHCP.REBIND", ARG_FUNC, (void*)set_rebind },
1571 { "DHCP.MY_IP", ARG_FUNC, (void*)set_my_ip },
1572 { "DHCP.NETMASK", ARG_FUNC, (void*)set_netmask },
1573 { "DHCP.GATEWAY", ARG_FUNC, (void*)set_gateway },
1574 { "DHCP.NAMESERV", ARG_FUNC, (void*)set_nameserv },
1575 { "DHCP.SERVER", ARG_FUNC, (void*)set_server },
1576 { "DHCP.DOMAIN", ARG_FUNC, (void*)set_domain },
1577 { "DHCP.HOSTNAME", ARG_STRCPY, (void*)hostname },
1578#if defined(USE_BSD_API)
1579 { "DHCP.LOGHOST", ARG_STRCPY, (void*)&syslog_host_name },
1580#endif
1581 { "DHCP.DEF_TTL", ARG_ATOI, (void*)&_default_ttl },
1582#if !defined(USE_UDP_ONLY)
1583 { "DHCP.TCP_KEEP", ARG_ATOI, (void*)&tcp_keep_intvl },
1584#endif
1585 { NULL, 0, NULL }
1586 };
1587
1588/*
1589 * Return name of transient config-file.
1590 */
1591static const char *get_config_file (void)
1592{
1593 if (config_file[0])
1594 return (config_file);
1595 return expand_var_str ("$(TEMP)\\W32DHCP.TMP");
1596}
1597
1598/*
1599 * The standard DHCP config eraser.
1600 */
1601static void std_erase_config (void)
1602{
1603 unlink (get_config_file());
1604}
1605
1606/*
1607 * The standard DHCP config reader.
1608 */
1609static int std_read_config (void)
1610{
1611 WFILE file;
1612 const char *fname = get_config_file();
1613
1614 if (!FOPEN_TXT(file, fname))
1615 {
1616 TRACE (("`%s' not found\n", fname));
1617 return (0);
1618 }
1619
1620 prev_hook = usr_init;
1621 usr_init = NULL; /* don't chain to other parsers */
1622 tcp_parse_file (file, &transient_cfg[0]);
1623 usr_init = prev_hook;
1624
1625 FCLOSE (file);
1626 return (1);
1627}
1628
1635static int std_write_config (void)
1636{
1637 char buf[20];
1638 FILE *file;
1639 time_t tim, now = time (NULL);
1640 int rc = 0;
1641 const char *fname = get_config_file();
1642 char ct_buf [30];
1643
1644 if (!FILE_EXIST(fname)) /* file not found, create */
1645 {
1646 file = fopen (fname, "w+t");
1647 if (!file)
1648 goto fail;
1649
1650 rc = fprintf (file,
1651 "#\n"
1652 "# GENERATED FILE. DO NOT EDIT!\n"
1653 "#\n"
1654 "# DHCP transient configuration; values that must\n"
1655 "# be known between consecutive runs of applications.\n"
1656 "# Version: %s\n"
1657 "#\n", wattcpVersion());
1658 }
1659 else
1660 {
1661 file = fopen (fname, "at");
1662 if (!file)
1663 goto fail;
1664 }
1665
1666 rc += fprintf (file, "# This file saved at %.20s\n#\n", ctime_r(&now, ct_buf)+4);
1667
1668 tim = dhcp_iplease + now;
1669 rc += fprintf (file, "DHCP.LEASE = %-20lu # lease expires %.20s\n",
1670 (u_long)tim, ctime_r(&tim, ct_buf)+4);
1671
1672 tim = dhcp_renewal + now;
1673 rc += fprintf (file, "DHCP.RENEW = %-20lu # renew expires %.20s\n",
1674 (u_long)tim, ctime_r(&tim, ct_buf)+4);
1675
1676 tim = dhcp_rebind + now;
1677 rc += fprintf (file,
1678 "DHCP.REBIND = %-20lu # rebind expires %.20s\n"
1679 "DHCP.MY_IP = %-20s # assigned ip-address\n",
1680 (u_long)tim, ctime_r(&tim, ct_buf)+4, _inet_ntoa(buf, my_ip_addr));
1681
1682 rc += fprintf (file, "DHCP.NETMASK = %-20s # assigned netmask\n",
1683 _inet_ntoa(buf, sin_mask));
1684
1685 rc += fprintf (file, "DHCP.GATEWAY = %-20s # assigned gateway\n",
1686 _inet_ntoa(buf, router));
1687
1688 rc += fprintf (file, "DHCP.NAMESERV = %-20s # assigned nameserver\n",
1689 _inet_ntoa(buf, nameserver));
1690
1691 rc += fprintf (file, "DHCP.SERVER = %-20s # DHCP server\n",
1692 _inet_ntoa(buf, dhcp_server));
1693
1694 rc += fprintf (file, "DHCP.HOSTNAME = %-20s # assigned hostname\n",
1695 hostname);
1696
1697 rc += fprintf (file, "DHCP.DOMAIN = %-20s # assigned domain\n",
1698 def_domain);
1699
1700#if defined(USE_BSD_API)
1701 if (syslog_host_name[0])
1702 rc += fprintf (file, "DHCP.LOGHOST = %-20s # assigned syslog host\n",
1703 syslog_host_name);
1704#endif
1705
1706 rc += fprintf (file, "DHCP.DEF_TTL = %-20d # default TTL\n",
1707 _default_ttl);
1708
1709#if !defined(USE_UDP_ONLY)
1710 rc += fprintf (file, "DHCP.TCP_KEEP = %-20d # TCP keepalive interval\n",
1711 tcp_keep_intvl);
1712#endif
1713
1714 fclose (file);
1715 return (rc);
1716
1717fail:
1718 TRACE_CONSOLE (0, "Writing %s failed; %s\n", fname, strerror(errno));
1719 return (0);
1720}
1721
1722/*
1723 * The user-defined DHCP config eraser.
1724 */
1725static void usr_erase_config (void)
1726{
1727 (*config_func) (DHCP_OP_ERASE, NULL);
1728}
1729
1730static int usr_read_config (void)
1731{
1732 struct DHCP_config cfg;
1733
1734 memset (&cfg, 0, sizeof(cfg));
1735
1736 if (!(*config_func)(DHCP_OP_READ, &cfg))
1737 return (0);
1738
1739 TRACE (("DHCP: using previous address %s\n", INET_NTOA(cfg.my_ip)));
1740 my_ip_addr = cfg.my_ip;
1741
1742 TRACE (("DHCP: using previous netmask %s\n", INET_NTOA(cfg.netmask)));
1743 sin_mask = cfg.netmask;
1744
1745 if (!_arp_have_default_gw())
1746 {
1747 TRACE (("DHCP: using previous gateway %s\n", INET_NTOA(cfg.gateway)));
1748 router = cfg.gateway;
1749 _arp_add_gateway (NULL, router);
1750 }
1751 else
1752 TRACE (("DHCP: already have default gateway\n"));
1753
1754 TRACE (("DHCP: using previous nameserv %s\n", INET_NTOA(cfg.nameserver)));
1755 nameserver = cfg.nameserver;
1756 _add_server (&last_nameserver, def_nameservers, DIM(def_nameservers), nameserver);
1757
1758 TRACE (("DHCP: using previous server %s\n", INET_NTOA(cfg.server)));
1759 dhcp_server = cfg.server;
1760
1761 cfg_dhcp_iplease = cfg.iplease;
1762 cfg_dhcp_renewal = cfg.renewal;
1763 cfg_dhcp_rebind = cfg.rebind;
1764
1765 _default_ttl = cfg.default_ttl;
1766#if !defined(USE_UDP_ONLY)
1767 tcp_keep_intvl = cfg.tcp_keep_intvl;
1768#endif
1769
1770 _strlcpy (hostname, cfg._hostname, sizeof(hostname));
1771
1772 TRACE (("DHCP: using previous domain %s\n", cfg.domain));
1773 setdomainname (cfg.domain, strlen(cfg.domain)+1);
1774
1775#if defined(USE_BSD_API)
1776 if (cfg.loghost[0])
1777 _strlcpy (syslog_host_name, cfg.loghost, sizeof(syslog_host_name));
1778#endif
1779
1780 return (1);
1781}
1782
1783static int usr_write_config (void)
1784{
1785 struct DHCP_config cfg;
1786 time_t now = time (NULL);
1787
1788 memset (&cfg, 0, sizeof(cfg));
1789 cfg.my_ip = my_ip_addr;
1790 cfg.netmask = sin_mask;
1791 cfg.gateway = router;
1792 cfg.nameserver = nameserver;
1793 cfg.server = dhcp_server;
1794 cfg.iplease = (DWORD)now + dhcp_iplease;
1795 cfg.renewal = (DWORD)now + dhcp_renewal;
1796 cfg.rebind = (DWORD)now + dhcp_rebind;
1797 cfg.default_ttl = _default_ttl;
1798#if !defined(USE_UDP_ONLY)
1799 cfg.tcp_keep_intvl = tcp_keep_intvl;
1800#endif
1801
1802 _strlcpy (cfg._hostname, hostname, sizeof(cfg._hostname));
1803 _strlcpy (cfg.domain, def_domain, sizeof(cfg.domain));
1804
1805#if defined(USE_BSD_API)
1806 if (syslog_host_name[0])
1807 _strlcpy (cfg.loghost, syslog_host_name, sizeof(cfg.loghost));
1808#endif
1809
1810 return (*config_func) (DHCP_OP_WRITE, &cfg);
1811}
1812
1816static void erase_config (void)
1817{
1818 config_func ? usr_erase_config() : std_erase_config();
1819}
1820
1826int W32_CALL DHCP_read_config (void)
1827{
1828 cfg_read = FALSE;
1829
1830 if (config_func ? usr_read_config() : std_read_config() > 0)
1831 {
1832 sock = dhcp_open (NULL, bcast_flag);
1833 if (!sock)
1834 return (0);
1835
1836 if (eval_timers())
1837 {
1838 cfg_read = TRUE;
1839 dhcp_set_timers();
1840 return (1);
1841 }
1842 TRACE (("DHCP: config too old.\n"));
1843 sock->udp.myaddr = 0;
1844 sock->udp.hisaddr = IP_BCAST_ADDR;
1845 }
1846
1847 /* Reading config failed or timers expired; must do the whole
1848 * DHCP configuration when sock_init.c calls DHCP_do_boot().
1849 */
1850 return (0);
1851}
1852
1857static int write_config (void)
1858{
1859 return (config_func ? usr_write_config() : std_write_config());
1860}
1861
1865WattDHCPConfigFunc W32_CALL DHCP_set_config_func (WattDHCPConfigFunc fn)
1866{
1867 WattDHCPConfigFunc old_fn = config_func;
1868 config_func = fn;
1869 return (old_fn);
1870}
1871#endif /* USE_DHCP */
setdomainname
int W32_CALL setdomainname(const char *name, size_t len)
BSD-style: Set the host's domain name.
Definition: bsdname.c:213
bsdname.h
errno.h
_default_ttl
int _default_ttl
Definition: ip4_out.c:54
ip4_out.h
language.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
Random
unsigned W32_CALL Random(unsigned a, unsigned b)
Returns a random integer in range [a..b].
Definition: misc.c:743
MAC_address
const char * MAC_address(const void *addr)
Return hexa-decimal string for an 6/7 byte MAC-address.
Definition: misc.c:997
ctime_r
char * ctime_r(const time_t *t, char *res)
A reentrant ctime().
Definition: misc.c:887
misc.h
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
aton
DWORD W32_CALL aton(const char *str)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
Definition: netaddr.c:86
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
strerror
char *MS_CDECL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207
_arp_add_gateway
BOOL W32_CALL _arp_add_gateway(const char *config_string, DWORD ip)
Add a gateway to the routing table.
Definition: pcarp.c:247
_arp_kill_gateways
void W32_CALL _arp_kill_gateways(void)
Delete all gateways.
Definition: pcarp.c:373
_arp_cache_add
BOOL W32_CALL _arp_cache_add(DWORD ip, const void *eth, BOOL expires)
Add given IP/Ether address to ARP-cache.
Definition: pcarp.c:1351
_arp_have_default_gw
BOOL W32_CALL _arp_have_default_gw(void)
Check if we have at least one default gateway.
Definition: pcarp.c:382
_arp_reply
BOOL W32_CALL _arp_reply(const void *e_dst, DWORD src_ip, DWORD dst_ip)
Send unicast/broadcast ARP reply.
Definition: pcarp.c:489
_arp_check_own_ip
BOOL W32_CALL _arp_check_own_ip(eth_address *other_guy)
Used by DHCP initialisation.
Definition: pcarp.c:1728
pcarp.h
pcbootp.h
expand_var_str
const char * expand_var_str(const char *str)
Return a string with a environment variable expanded (only one).
Definition: pcconfig.c:234
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
pcconfig.h
pcdbug.h
dhcp_set_timers
static void dhcp_set_timers(void)
Set all timers required by the DHCP state machine.
Definition: pcdhcp.c:1195
DHCP_state_INIT
static void DHCP_state_INIT(int event)
DHCP state machine: state INIT.
Definition: pcdhcp.c:988
change_ip_addr
static void change_ip_addr(void)
Change my_ip_addr of all tcp/udp sockets.
Definition: pcdhcp.c:1222
DHCP_arp_check
static BOOL DHCP_arp_check(DWORD my_ip)
Send an ARP reply to announce our new IP-address.
Definition: pcdhcp.c:425
DHCP_request
static int DHCP_request(BOOL renew)
Send a DHCP request message.
Definition: pcdhcp.c:323
dhcp_options_add
static void dhcp_options_add(const BYTE *opt, unsigned max)
Add options from a DHCP_OPT_OVERLOAD tag to 'extra_options' list.
Definition: pcdhcp.c:1162
DHCP_state_REBINDING
static void DHCP_state_REBINDING(int event)
DHCP state machine: state REBINDING.
Definition: pcdhcp.c:896
DHCP_release_decline
static int DHCP_release_decline(int msg_type, const char *msg)
Send a DHCP release or decline message.
Definition: pcdhcp.c:387
DHCP_cfg_hook
static void W32_CALL DHCP_cfg_hook(const char *name, const char *value)
Parser for DHCP configuration.
Definition: pcdhcp.c:1389
DHCP_release
void W32_CALL DHCP_release(BOOL force)
Possibly send a DHCP release.
Definition: pcdhcp.c:732
DHCP_state_REBOOTING
static void DHCP_state_REBOOTING(int event)
DHCP state machine: Combined BOOT and BOOTING state.
Definition: pcdhcp.c:1007
DHCP_is_nack
static int DHCP_is_nack(void)
Return TRUE if DHCP message is a NACK.
Definition: pcdhcp.c:704
write_config
static int write_config(void)
Write the transient DHCP configuration, either to file or via user-defined function.
Definition: pcdhcp.c:1857
erase_config
static void erase_config(void)
Erase the transient configuration.
Definition: pcdhcp.c:1816
std_write_config
static int std_write_config(void)
Write the transient DHCP configuration to file.
Definition: pcdhcp.c:1635
set_request_list
static int set_request_list(char *options)
Parse a list of DHCP-request options from config-file.
Definition: pcdhcp.c:1244
set_vend_class
static int set_vend_class(const char *value)
Set vendor class option.
Definition: pcdhcp.c:1366
DHCP_init
void DHCP_init(void)
Initialises the DHCP config-parser.
Definition: pcdhcp.c:1431
set_my_ip
static void set_my_ip(const char *value)
Functions called by config-file parser while reading c:/W32DHCP.TMP.
Definition: pcdhcp.c:1441
dhcp_fsm
static void W32_CALL dhcp_fsm(void)
DHCP state machine: the event driver.
Definition: pcdhcp.c:1024
DHCP_offer
static int DHCP_offer(const struct dhcp *in)
Parse DHCP offer reply.
Definition: pcdhcp.c:460
DHCP_set_config_func
WattDHCPConfigFunc W32_CALL DHCP_set_config_func(WattDHCPConfigFunc fn)
Sets up an application hook for doing DHCP operations (DHCP_config_op)
Definition: pcdhcp.c:1865
DHCP_state_SELECTING
static void DHCP_state_SELECTING(int event)
DHCP state machine: state SELECTING.
Definition: pcdhcp.c:957
DHCP_get_server
DWORD W32_CALL DHCP_get_server(void)
Return current DHCP server address.
Definition: pcdhcp.c:764
period
static const char * period(DWORD sec)
Return nicely formatted string for a time-period.
Definition: pcdhcp.c:230
DHCP_exit
static void W32_CALL DHCP_exit(void)
Free allocated memory.
Definition: pcdhcp.c:1412
DHCP_state_REQUESTING
static void DHCP_state_REQUESTING(int event)
DHCP state machine: state REQUESTING.
Definition: pcdhcp.c:845
DHCP_state_RENEWING
static void DHCP_state_RENEWING(int event)
DHCP state machine: state RENEWING.
Definition: pcdhcp.c:921
DHCP_state_BOUND
static void DHCP_state_BOUND(int event)
DHCP state machine: state BOUND.
Definition: pcdhcp.c:826
store_DHCP_server_MAC
static void store_DHCP_server_MAC(void)
Add MAC address of DHCP sever to our ARP cache.
Definition: pcdhcp.c:812
DHCP_read_config
int W32_CALL DHCP_read_config(void)
Called from watt_sock_init() after "\c WATTCP.CFG" has been parsed.
Definition: pcdhcp.c:1826
DHCP_is_ack
static int DHCP_is_ack(void)
Return TRUE if DHCP message is an ACK.
Definition: pcdhcp.c:694
put_hardware_opt
static BYTE * put_hardware_opt(BYTE *opt)
Fill in the hardware type/len in Client ID option tag.
Definition: pcdhcp.c:275
DHCP_do_boot
int DHCP_do_boot(void)
Our first time DHCP handler.
Definition: pcdhcp.c:1085
set_user_class
static int set_user_class(const char *value)
Parse user-class as specified in config-file.
Definition: pcdhcp.c:1311
dhcp_open
static sock_type * dhcp_open(const char *msg, BOOL use_broadcast)
Allocate and open a UDP socket for DHCP message exchange.
Definition: pcdhcp.c:772
eval_timers
static BOOL eval_timers(void)
Check timers read from config-file and set state according to following rules:
Definition: pcdhcp.c:1511
make_boot_header
static BYTE * make_boot_header(void)
Format a BOOTP header.
Definition: pcdhcp.c:247
put_request_list
static BYTE * put_request_list(BYTE *opt, int filled)
Append options from 'request_list' to 'opt'.
Definition: pcdhcp.c:1291
transient_cfg
static const struct config_table transient_cfg[]
Open and parse Wattcp transient configuration.
Definition: pcdhcp.c:1567
DHCP_discover
static int DHCP_discover(void)
Send a DHCP discover message.
Definition: pcdhcp.c:291
state_name
static const char * state_name(void)
Return name of current DHCP state function.
Definition: pcdhcp.c:217
pcdhcp.h
defaultdomain
char defaultdomain[MAX_HOSTLEN+1]
The 2 next variables are loaded from WATTCP.CFG file.
Definition: pcdns.c:71
pcdns.h
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
pcpkt.h
pcqueue.h
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
_eth_get_hwtype
BYTE W32_CALL _eth_get_hwtype(BYTE *hwtype, BYTE *hwlen)
Fill in hardware address type/length for BOOTP/DHCP packets.
Definition: pcsed.c:730
_eth_mac_len
BYTE _eth_mac_len
Size of a MAC address.
Definition: pcsed.c:53
_eth_brdcast
mac_address _eth_brdcast
Link-layer broadcast address.
Definition: pcsed.c:50
pcsed.h
tcp_keep_intvl
unsigned tcp_keep_intvl
time between keepalive probes
Definition: pctcp.c:136
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
_udp_allsocs
_udp_Socket * _udp_allsocs
list of udp-sockets
Definition: pctcp.c:72
hostname
char hostname[MAX_HOSTLEN+1]
Our configured hostname.
Definition: pctcp.c:58
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
_tcp_allsocs
_tcp_Socket * _tcp_allsocs
list of tcp-sockets
Definition: pctcp.c:140
udp_open
int W32_CALL udp_open(_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP active open.
Definition: pctcp.c:262
pctcp.h
printk.h
sock_ini.h
sock_dataready
WORD W32_CALL sock_dataready(sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
Definition: sock_io.c:246
DHCP_list
Definition: pcdhcp.h:116
config_table
Definition: tcp.h:461
dhcp
Definition: pcdhcp.h:121
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::next
struct tcp_Socket * next
link to next tcp-socket
Definition: wattcp.h:585
tok
Definition: oui-generated.c:13
udp_Socket
ARP definitions.
Definition: tcp.h:87
syslog2.h
ARG_RESOLVE
@ ARG_RESOLVE
resolve host to IPv4-address
Definition: tcp.h:457
ARG_STRCPY
@ ARG_STRCPY
copy string value
Definition: tcp.h:456
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
tftp_set_server
char * tftp_set_server(const char *name, int len)
Set the name of TFTP server.
Definition: tftp.c:381
tftp_set_boot_fname
char * tftp_set_boot_fname(const char *name, int len)
Set the name of remote/local file to load from TFTP server.
Definition: tftp.c:392
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
sock_type
Definition: wattcp.h:692
wattcpVersion
const char *W32_CALL wattcpVersion(void)
Return string for Watt-32 version.
Definition: version.c:77
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcdhcp.h Source File

  • src
pcdhcp.h
Go to the documentation of this file.
1
3#ifndef _w32_PCDHCP_H
4#define _w32_PCDHCP_H
5
6#define DHCP_MAGIC_COOKIE 0x63538263 /* magic cookie */
7#define DHCP_MIN_LEASE 10 /* 10s min. lease */
8
9enum DHCP_MsgTypes {
10 DHCP_DISCOVER = 1,
11 DHCP_OFFER,
12 DHCP_REQUEST,
13 DHCP_DECLINE,
14 DHCP_ACK,
15 DHCP_NAK ,
16 DHCP_RELEASE,
17 DHCP_INFORM
18 };
19
20enum DHCP_Events {
21 EVENT_OFFER = 1,
22 EVENT_SEND_TIMEOUT,
23 EVENT_T1_TIMEOUT,
24 EVENT_T2_TIMEOUT,
25 EVENT_ACK,
26 EVENT_NAK,
27 };
28
29/*
30 * DHCP options and values (ref. RFC1533/RFC2132).
31 * Many are also BOOTP options.
32 */
33enum DHCP_Options {
34 DHCP_OPT_PAD = 0,
35 DHCP_OPT_SUBNET_MASK = 1,
36 DHCP_OPT_TIME_OFFSET = 2,
37 DHCP_OPT_ROUTERS_ON_SNET = 3,
38 DHCP_OPT_TIME_SRV = 4,
39 DHCP_OPT_NAME_SRV = 5,
40 DHCP_OPT_DNS_SRV = 6,
41 DHCP_OPT_LOG_SRV = 7,
42 DHCP_OPT_COOKIE_SRV = 8,
43 DHCP_OPT_LPR_SRV = 9,
44 DHCP_OPT_IMPRESS_SRV = 10,
45 DHCP_OPT_RES_LOCATION_SRV = 11,
46 DHCP_OPT_HOST_NAME = 12,
47 DHCP_OPT_BOOT_FSIZE = 13,
48 DHCP_OPT_MERIT_DUMPFILE = 14,
49 DHCP_OPT_DOMAIN_NAME = 15,
50 DHCP_OPT_SWAP_SRV = 16,
51 DHCP_OPT_ROOT_PATH = 17,
52 DHCP_OPT_EXTENTIONS_PATH = 18,
53 DHCP_OPT_IP_FORWARDING = 19,
54 DHCP_OPT_NON_LOCAL_SRC_ROUTE = 20,
55 DHCP_OPT_POLICY_FILTER = 21,
56 DHCP_OPT_MAX_DGRAM_REASM_SIZE = 22,
57 DHCP_OPT_IP_DEFAULT_TTL = 23,
58 DHCP_OPT_PATH_MTU_AGING_TIMEOUT = 24,
59 DHCP_OPT_PATH_MTU_PLATEAU_TABLE = 25,
60 DHCP_OPT_IF_MTU = 26,
61 DHCP_OPT_ALL_SUBNETS_LOCAL = 27,
62 DHCP_OPT_BROADCAST_ADDR = 28,
63 DHCP_OPT_PERFORM_MASK_DISCOVERY = 29,
64 DHCP_OPT_MASK_SUPPLIER = 30,
65 DHCP_OPT_PERFORM_ROUTER_DISCOVERY = 31,
66 DHCP_OPT_ROUTER_SOLICITATION_ADDR = 32,
67 DHCP_OPT_STATIC_ROUTE = 33,
68 DHCP_OPT_TRAILER_ENCAPSULATION = 34,
69 DHCP_OPT_ARP_CACHE_TIMEOUT = 35,
70 DHCP_OPT_ETHERNET_ENCAPSULATION = 36,
71 DHCP_OPT_TCP_DEFAULT_TTL = 37,
72 DHCP_OPT_TCP_KEEPALIVE_INTERVAL = 38,
73 DHCP_OPT_TCP_KEEPALIVE_GARBAGE = 39,
74 DHCP_OPT_NIS_DOMAIN_NAME = 40,
75 DHCP_OPT_NIS_SRVS = 41,
76 DHCP_OPT_NTP_SRVS = 42,
77 DHCP_OPT_VENDOR_SPECIFIC_INFO = 43,
78 DHCP_OPT_NBIOS_NAME_SRV = 44,
79 DHCP_OPT_NBIOS_DGRAM_DIST_SRV = 45,
80 DHCP_OPT_NBIOS_NODE_TYPE = 46,
81 DHCP_OPT_NBIOS_SCOPE = 47,
82 DHCP_OPT_XFONT_SRV = 48,
83 DHCP_OPT_XDISPLAY_MANAGER = 49,
84 DHCP_OPT_REQUESTED_IP_ADDR = 50,
85 DHCP_OPT_IP_ADDR_LEASE_TIME = 51,
86 DHCP_OPT_OVERLOAD = 52,
87 DHCP_OPT_MSG_TYPE = 53,
88 DHCP_OPT_SRV_IDENTIFIER = 54,
89 DHCP_OPT_PARAM_REQUEST = 55,
90 DHCP_OPT_MSG = 56,
91 DHCP_OPT_MAX_MSG_SIZE = 57,
92 DHCP_OPT_T1_VALUE = 58,
93 DHCP_OPT_T2_VALUE = 59,
94 DHCP_OPT_CLASS_ID = 60,
95 DHCP_OPT_CLIENT_ID = 61,
96 DHCP_OPT_NIS_DOMAIN = 64,
97 DHCP_OPT_NIS_SRV_OPT = 65,
98 DHCP_OPT_TFTP_SERVER = 66,
99 DHCP_OPT_BOOT_FILENAME = 67,
100 DHCP_OPT_MOBIP_HOME_AGENTS = 68,
101 DHCP_OPT_SMTP_SRVS = 69,
102 DHCP_OPT_POP3_SRVS = 70,
103 DHCP_OPT_NNTP_SRVS = 71,
104 DHCP_OPT_WWW_SRVS = 72,
105 DHCP_OPT_FINGER_SRVS = 73,
106 DHCP_OPT_IRC_SRVS = 74,
107 DHCP_OPT_STREET_TALK_SRVS = 75,
108 DHCP_OPT_STDA_SRVS = 76,
109 DHCP_OPT_USER_CLASS = 77,
110 DHCP_OPT_GRUB_MENU = 150,
111 DHCP_OPT_END = 255
112 };
113
116struct DHCP_list {
117 BYTE *data;
118 unsigned size;
119 };
120
121W32_CLANG_PACK_WARN_OFF()
122
123#include <sys/pack_on.h>
129struct dhcp {
130 BYTE dh_op; /* packet op code / message type. */
131 BYTE dh_htype; /* hardware address type, 1 = 10 mb ethernet */
132 BYTE dh_hlen; /* hardware address len, eg '6' for ethernet */
133 BYTE dh_hops; /* client sets to zero, optionally used by */
134 /* gateways in cross-gateway booting. */
135 DWORD dh_xid; /* transaction ID, a random number */
136 WORD dh_secs; /* filled in by client, seconds elapsed */
137 /* since client started trying to boot. */
138 WORD dh_flags; /* Flag (0x8000 for broadcast, else 0) */
139 DWORD dh_ciaddr; /* client IP address filled in by client if known */
140 DWORD dh_yiaddr; /* 'your' (client) IP address */
141 /* filled by server if client doesn't know */
142 DWORD dh_siaddr; /* server IP address returned in bootreply */
143 DWORD dh_giaddr; /* gateway IP address, */
144 /* used in optional cross-gateway booting. */
145 BYTE dh_chaddr[16]; /* client hardware address, filled by client */
146 BYTE dh_sname[64]; /* optional server host name, null terminated */
147
148 BYTE dh_file[128]; /* boot file name, null terminated string */
149 /* 'generic' name or null in bootrequest, */
150 /* fully qualified directory-path */
151 /* name in bootreply. */
152 BYTE dh_opt[312]; /* DHCP options area (minimum 308 bytes) */
153 };
154
155#include <sys/pack_off.h>
157 W32_CLANG_PACK_WARN_DEF()
158
159extern int DHCP_do_boot (void);
160extern void DHCP_init (void);
161
162#endif
pack_off.h
DHCP_do_boot
int DHCP_do_boot(void)
Our first time DHCP handler.
Definition: pcdhcp.c:1085
DHCP_init
void DHCP_init(void)
Initialises the DHCP config-parser.
Definition: pcdhcp.c:1431
W32_CLANG_PACK_WARN_DEF
W32_CLANG_PACK_WARN_DEF() extern int DHCP_do_boot(void)
This hook is to prevent the BSD-socket API being linked in by default.
Definition: pcsed.h:261
DHCP_list
Definition: pcdhcp.h:116
dhcp
Definition: pcdhcp.h:121


Watt-32 tcp/ip: E:/WATT/src/pcdns.c Source File

  • src
pcdns.c
Go to the documentation of this file.
1
33#include <stdio.h>
34#include <stdlib.h>
35#include <string.h>
36#include <limits.h>
37#include <sys/werrno.h>
38
39#include "copyrigh.h"
40#include "wattcp.h"
41#include "misc.h"
42#include "misc_str.h"
43#include "timer.h"
44#include "language.h"
45#include "pcconfig.h"
46#include "pcdbug.h"
47#include "pctcp.h"
48#include "netaddr.h"
49#include "idna.h"
50#include "ip6_out.h"
51#include "netaddr.h"
52#include "pcdns.h"
53
57#if defined(USE_BSD_API)
58 #include <netdb.h>
59
60 BOOL called_from_resolve = FALSE;
61 BOOL called_from_ghbn = FALSE;
62#endif
63
64#if !defined(WIN32)
65 #define TCHAR
66#endif
67
71char defaultdomain [MAX_HOSTLEN+1] = "your.domain.com";
72char *def_domain = defaultdomain;
73
74int (W32_CALL *_resolve_hook)(void); /* user hook for terminating resolve() */
75
76BOOL _resolve_exit; /* user hook interrupted */
77BOOL _resolve_timeout; /* (reverse) lookup timeout */
78BOOL from_windns; /* the answer came from WinDNS */
79DWORD dom_ttl; /* Time-to-Live of last response */
80int dom_errno; /* domain errno (DNS_SRV_xx/DNS_CLI_xx) */
81char dom_cname [MAX_HOSTLEN+1]; /* CNAME of last response */
82
83DWORD def_nameservers [MAX_NAMESERVERS];
84WORD last_nameserver = 0;
85WORD dns_timeout = 0;
86BOOL dns_recurse = TRUE; /* Recurse over dotless names */
87BOOL dns_do_ipv6 = TRUE; /* Do try to resolve to IPv6 */
88BOOL dns_do_idna = FALSE; /* Convert non-ASCII names to/from ACE */
89WORD dns_windns = 0; /* How to read/write the WinDns cache */
90
91static const char *loc_domain; /* current subname to be used */
92static DWORD res_timeout;
93
94/* Additional addresses from last resolve().
95 * dom_a4_list is on network order!
96 */
97DWORD dom_a4list [MAX_ADDRESSES+1];
98
99#if defined(USE_IPV6)
100ip6_address dom_a6list [MAX_ADDRESSES+1];
101#endif
102
106static void query_init (struct DNS_query *q, BOOL is_ip6)
107{
108 int i;
109
110 memset (&q->head, 0, sizeof(q->head));
111 q->head.flags = intel16 (DRD); /* Query, Recursion desired */
112 q->head.qdcount = intel16 (1);
113
114#if defined(USE_IPV6)
115 if (is_ip6)
116 memset (&dom_a6list, 0, sizeof(dom_a6list));
117 else
118#endif
119 for (i = 0; i < DIM(dom_a4list); i++)
120 dom_a4list[i] = INADDR_NONE;
121 ARGSUSED (is_ip6);
122}
123
127static void store_alt_address (const void *data, int idx, BOOL is_ip6)
128{
129 if (idx < 0 || idx >= MAX_ADDRESSES)
130 return;
131
132#if defined(USE_IPV6)
133 if (is_ip6)
134 memcpy (&dom_a6list[idx], data, sizeof(ip6_address));
135 else
136#endif
137 dom_a4list [idx] = *(DWORD*)data; /* store on network order */
138 ARGSUSED (is_ip6);
139}
140
147static int pack_domain (BYTE *dst, const char *src)
148{
149 const char *p;
150 BYTE *q, *savedst;
151 BOOL dotflag, defflag;
152 int i;
153
154 dotflag = defflag = FALSE;
155 savedst = dst;
156 p = src;
157
158 do /* copy whole string */
159 {
160 *dst = '\0';
161 q = dst + 1;
162 while (*p && *p != '.')
163 *q++ = *p++;
164
165 i = p - src;
166 if (i > MAX_LABEL_SIZE) /* label length exceeded */
167 return (-1);
168
169 *dst = i;
170 *q = '\0';
171
172 if (*p) /* update pointers */
173 {
174 dotflag = TRUE;
175 src = ++p;
176 dst = q;
177 }
178 else if (!dotflag && !defflag && loc_domain)
179 {
180 p = loc_domain; /* continue packing with default */
181 defflag = TRUE;
182 src = p;
183 dst = q;
184 }
185 }
186 while (*p);
187
188 q++;
189 return (q - savedst); /* length of packed string */
190}
191
196static int send_query (sock_type *sock, struct DNS_query *q,
197 const char *name, DWORD towho, WORD qtype)
198{
199 WORD len;
200 BYTE *p;
201 int i;
202
203 if (!udp_open(&sock->udp, DOM_SRC_PORT, towho, DOM_DST_PORT, NULL))
204 {
205 dom_errno = DNS_CLI_SYSTEM; /* errno ENETDOWN/EHOSTUNREACH etc. */
206 if (debug_on)
207 {
208 outs (_LANG("Domain: "));
209 outsnl (sock->udp.err_msg);
210 }
211 return (0);
212 }
213
214 p = &q->body[0];
215 i = pack_domain (p, name);
216 if (i < 0)
217 {
218 dom_errno = DNS_CLI_TOOBIG;
219 return (0);
220 }
221
222 p += i;
223 *(WORD*)p = intel16 (qtype); /* QTYPE is A or AAAA */
224 p += sizeof(WORD);
225 *(WORD*)p = intel16 (DIN); /* QCLASS is always internet */
226 p += sizeof(WORD);
227
228 len = p - (BYTE*)q;
229 if (sock_write (sock, (const BYTE*)q, len) < len)
230 {
231 dom_errno = DNS_CLI_SYSTEM;
232 return (0);
233 }
234 return (len);
235}
236
237static __inline int count_paths (const char *path_str)
238{
239 int count = 0;
240 const char *p;
241
242 for (p = path_str; *p || *(p+1); p++)
243 if (*p == '\0')
244 count++;
245 return (++count);
246}
247
248static __inline const char *get_path (
249 const char *path_str, /* the path list to search */
250 int which_one) /* which path to get, starts at 1 */
251{
252 const char *p;
253
254 if (which_one > count_paths(path_str))
255 return (NULL);
256
257 which_one--;
258 for (p = path_str; which_one; p++)
259 if (*p == '\0')
260 which_one--;
261 return (p);
262}
263
267static void extract_cname (const struct DNS_query *q, const char *src,
268 char *dest, size_t max)
269{
270 const char *p = src;
271 const char *start = dest;
272 const char *end = dest + max;
273
274 while (dest < end)
275 {
276 BYTE count = *p++;
277 WORD ofs;
278
279 if ((count & 0xC0) == 0xC0)
280 {
281 ofs = ((count - 0xC0) << 8) + *p++; /* new offset */
282 p = (const char*)q + ofs;
283 count = *p++;
284 }
285 if (count == 0)
286 break;
287
288 while (count > 0)
289 {
290 if (dest > end)
291 break;
292 *dest++ = *p++;
293 count--;
294 }
295 *dest++ = '.';
296 }
297 if (dest > start && *(dest-1) == '.') /* remove trailing '.' */
298 dest--;
299 *dest = '\0';
300}
301
312static int unpack_domain (const struct DNS_query *q,
313 const BYTE *src, size_t src_size,
314 BYTE *dst, size_t dst_size)
315{
316 int retval = 0;
317 const BYTE *start = src;
318 const BYTE *src_max = src + src_size;
319 const BYTE *dst_max = dst + dst_size;
320 const BYTE *base = (const BYTE*)q;
321
322 while (*src && src < src_max && dst < dst_max)
323 {
324 int i, j = *src;
325
326 while ((j & 0xC0) == 0xC0)
327 {
328 if (!retval)
329 retval = src - start + 2;
330 src++;
331 src = &base [((j - 0xC0) << 8) + *src];
332 j = *src;
333 }
334
335 src++;
336 for (i = 0; i < (j & ~0xC0); i++)
337 {
338 if (dst >= dst_max-1)
339 return (-1);
340 *dst++ = *src++;
341 }
342 *dst++ = '.';
343 }
344
345 if (src > start)
346 {
347 *(--dst) = '\0'; /* add terminator */
348 src++; /* account for terminator on src */
349 }
350
351 if (!retval)
352 retval = src - start;
353 return (retval);
354}
355
365static int read_response (const struct DNS_query *q, int len,
366 WORD qtype, void *addr)
367{
368 WORD nans = intel16 (q->head.ancount); /* # of answers */
369 WORD flags = intel16 (q->head.flags);
370 BYTE rcode = (DRCODE & flags);
371 BYTE space [sizeof(q->body)];
372 const BYTE *p;
373 int i, num_addr;
374
375 if (rcode != DNS_SRV_OK) /* not okay reply */
376 {
377 dom_errno = rcode;
378 return (0);
379 }
380
381 if (nans == 0 || /* not at least one answer */
382 !(flags & DQR)) /* response flag not set */
383 {
384 dom_errno = DNS_SRV_NAME;
385 return (0);
386 }
387
388 len -= sizeof(q->head);
389 p = &q->body[0];
390 i = unpack_domain (q, p, len, space, sizeof(space));
391 if (i < 0)
392 {
393 dom_errno = DNS_CLI_ILL_RESP;
394 return (0);
395 }
396
397 /* spec defines name then QTYPE + QCLASS = 4 bytes
398 */
399 p += i + 4;
400
401 /* no canonical name yet
402 */
403 dom_cname[0] = '\0';
404
405 /* There may be several answers. We will return the first A or
406 * AAAA-record. If there's a CNAME-record, store the name too.
407 */
408 num_addr = 0;
409 while (nans-- > 0 && len > 0) /* look at each answer */
410 {
411 const struct DNS_resource *rrp;
412 size_t rr_len;
413 WORD rr_type;
414
415 i = unpack_domain (q, p, len, space, sizeof(space));
416 if (i < 0)
417 break;
418
419 p += i; /* account for string */
420 rrp = (struct DNS_resource*) p; /* resource record here */
421 rr_len = intel16 (rrp->rdlength); /* length of this record */
422 rr_type = intel16 (rrp->rtype);
423
424 if (intel16(rrp->rclass) == DIN) /* Internet (ARPA) class */
425 {
426 if (rr_type == qtype) /* Record type A or AAAA */
427 {
428 BOOL is_ip6 = (qtype == DTYPE_AAAA);
429
430 if (num_addr == 0) /* prefered address should always be 1st */
431 {
432 /* save IPv4/IPv6 address */
433 if (is_ip6)
434 memcpy (addr, &rrp->rdata[0], sizeof(ip6_address));
435 else *(DWORD*)addr = intel (*(DWORD*)&rrp->rdata[0]);
436
437 dom_ttl = intel (rrp->ttl); /* TTL in seconds */
438 dom_errno = DNS_SRV_OK;
439 }
440 else
441 store_alt_address (&rrp->rdata[0], num_addr-1, is_ip6);
442 num_addr++;
443 }
444 else if (rr_type == DTYPE_CNAME && !dom_cname[0])
445 {
446 size_t max = sizeof(dom_cname) - 1;
447 extract_cname (q, (const char*)rrp->rdata, dom_cname, max);
448 }
449 }
450 p += RESOURCE_HEAD_SIZE + rr_len; /* length of rest of RR */
451 len -= RESOURCE_HEAD_SIZE + rr_len;
452 }
453
454 if (num_addr > 0)
455 return (1);
456
457 /* Could be a reponse with a CNAME record but no A record, so
458 * turn it into a "Hostname not found" error.
459 */
460 dom_errno = DNS_SRV_NAME;
461 return (0);
462}
463
464/*
465 * Check if the ID in the reply is among our ID(s) sent.
466 * If not, ignore the response and keep waiting.
467 */
468static __inline BOOL legal_ident (WORD id, const WORD *cache, int num)
469{
470 int i;
471
472 for (i = 0; i < num; i++)
473 if (id == cache[i])
474 return (TRUE);
475 return (FALSE);
476}
477
487static int lookup_domain (
488 struct DNS_query *q, /* the UDP/IPv4 query packet */
489 const char *mname, /* the host-name to query */
490 BOOL add_dom, /* append domain suffix */
491 DWORD nameserver, /* nameserver to use */
492 BOOL *timedout, /* set on timeout */
493 BOOL is_aaaa, /* Query A or AAAA record */
494 void *addr) /* return address */
495{
496 _udp_Socket sock;
497 sock_type *dom_sock = NULL;
498
499 struct DNS_query reply;
500 char namebuf [3*MAX_HOSTLEN]; /* may overflow!! */
501 size_t len;
502 int rc;
503 WORD qtype = is_aaaa ? DTYPE_AAAA : DTYPE_A;
504 WORD id_cache [100]; /* should be plenty */
505 int id_index = 0;
506 WORD sec;
507
508 *timedout = TRUE; /* assume we will timeout */
509
510 if (!nameserver) /* no nameserver, give up now */
511 {
512 _resolve_exit = TRUE;
513 dom_errno = DNS_CLI_NOSERV;
514 outsnl (dom_strerror(dom_errno));
515 return (0);
516 }
517
518 while (*mname && *mname <= ' ') /* kill leading cruft */
519 mname++;
520
521 if (*mname == '\0')
522 {
523 dom_errno = DNS_CLI_OTHER;
524 return (0);
525 }
526
527 strcpy (namebuf, mname);
528
529#if defined(USE_IDNA)
530 /*
531 * Convert 'namebuf' to ACE form if needed
532 */
533 len = sizeof (namebuf);
534 if (dns_do_idna && !IDNA_convert_to_ACE(namebuf, &len))
535 {
536 dom_errno = DNS_CLI_ILL_IDNA;
537 return (0);
538 }
539#endif
540
541 if (add_dom)
542 {
543 int dot = strlen (namebuf) - 1;
544
545 if (namebuf[dot] != '.') /* if no trailing dot */
546 {
547 if (loc_domain) /* there is a search list */
548 {
549 strcat (namebuf, ".");
550 strcat (namebuf, get_path(loc_domain, 1));
551 }
552 }
553 else
554 namebuf [dot] = '\0'; /* kill trailing dot */
555 }
556
557 /*
558 * This is not terribly good, but it attempts to use a binary
559 * exponentially increasing delay.
560 */
561
562 for (sec = 2; sec < dns_timeout-1 && !_resolve_exit; sec *= 2)
563 {
564 q->head.ident = Random (1, USHRT_MAX);
565
566 /* We might get a reply for a previous request with different ID.
567 * We therefore use a small cache of IDs sent.
568 */
569 if (id_index < DIM(id_cache))
570 id_cache [id_index++] = q->head.ident;
571 else outsnl (_LANG("udp_dom(): ID cache full"));
572
573 dom_sock = (sock_type*) &sock;
574
575 if (!send_query(dom_sock, q, namebuf, nameserver, qtype))
576 {
577 _resolve_timeout = TRUE;
578 rc = 0;
579 goto quit; /* doesn't hurt to do sock_close() if udp_open() fails */
580 }
581
582again:
583 ip_timer_init (dom_sock, sec);
584 do
585 {
586 if (!tcp_tick(dom_sock)) /* ICMP Port unreachable etc. */
587 {
588 rc = 0;
589 dom_errno = DNS_CLI_REFUSE;
590 goto quit;
591 }
592
593 if (ip_timer_expired(dom_sock) || chk_timeout(res_timeout))
594 {
595 /* continue the for-loop with a new request */
596 break;
597 }
598
599 if (_watt_cbroke || (_resolve_hook && (*_resolve_hook)() == 0))
600 {
601 dom_errno = DNS_CLI_USERQUIT;
602 _resolve_exit = TRUE;
603 rc = 0;
604 goto quit;
605 }
606
607 if (dom_sock->udp.usr_yield)
608 (*dom_sock->udp.usr_yield)();
609 else WATT_YIELD();
610
611 if (sock_dataready(dom_sock))
612 *timedout = FALSE;
613 }
614 while (*timedout);
615
616 if (!*timedout) /* got an answer */
617 break;
618 }
619
620 if (*timedout || !dom_sock)
621 {
622 _resolve_timeout = TRUE;
623 rc = 0;
624 dom_errno = DNS_CLI_TIMEOUT;
625 }
626 else
627 {
628 memset (&reply, 0, sizeof(reply));
629 len = sock_fastread (dom_sock, (BYTE*)&reply, sizeof(reply));
630 if (len < SIZEOF(reply.head))
631 {
632 dom_errno = DNS_CLI_ILL_RESP;
633 rc = 0;
634 }
635 else if (!legal_ident(reply.head.ident, id_cache, id_index))
636 {
637 *timedout = TRUE;
638 goto again;
639 }
640 else
641 {
642 rc = read_response (&reply, len, qtype, addr);
643#if defined(USE_IDNA)
644 if (dns_do_idna && dom_cname[0])
645 {
646 len = sizeof(dom_cname);
647 IDNA_convert_from_ACE (dom_cname, &len);
648 dom_remove_dot (dom_cname);
649 }
650#endif
651 }
652 }
653
654quit:
655 if (dom_sock) /* if we ran the above for-loop */
656 sock_close (dom_sock);
657 return (rc);
658}
659
664static const char *next_domain (const char *domain, int count)
665{
666 const char *p = domain;
667 int i;
668
669 for (i = 0; i < count; i++)
670 {
671 p = strchr (p, '.');
672 if (!p)
673 return (NULL);
674 p++;
675 }
676 return (p);
677}
678
682static const char *server_error (enum DNS_serv_resp err)
683{
684 switch (err)
685 {
686 case DNS_SRV_OK:
687 return ("Success");
688 case DNS_SRV_FORM:
689 return ("Format error");
690 case DNS_SRV_FAIL:
691 return ("Error in response");
692 case DNS_SRV_NAME:
693 return ("Hostname not found");
694 case DNS_SRV_NOTIMPL:
695 return ("Not implemented");
696 case DNS_SRV_REFUSE:
697 return ("Service refused");
698 case DNS_SRV_MAX:
699 break;
700 }
701 return (NULL);
702}
703
707static const char *client_error (enum DNS_client_code err)
708{
709 switch (err)
710 {
711 case DNS_CLI_SYSTEM:
712 return (char*) strerror_s_ (_w32_errno);
713 case DNS_CLI_USERQUIT:
714 return ("User terminated");
715 case DNS_CLI_NOSERV:
716 return ("No nameserver defined");
717 case DNS_CLI_TIMEOUT:
718 return ("Request timeout");
719 case DNS_CLI_ILL_RESP:
720 return ("Illegal short response");
721 case DNS_CLI_ILL_IDNA:
722 return ("IDNA convertion failed");
723 case DNS_CLI_TOOBIG:
724 return ("Name too large");
725 case DNS_CLI_REFUSE:
726 return ("Service refused");
727 case DNS_CLI_NOIP:
728 return ("Cannot resolve without IP");
729 case DNS_CLI_NOIPV6:
730 return ("IPv6 DNS disabled");
731 case DNS_CLI_OTHER:
732 return ("Other error");
733 case DNS_CLI_MAX:
734 break;
735 }
736 return (NULL);
737}
738
742const char *W32_CALL dom_strerror (int err)
743{
744 static char buf [80];
745 const char *rc = err < DNS_SRV_MAX ? server_error (err) :
746 err < DNS_CLI_MAX ? client_error (err) : NULL;
747 if (rc)
748 return (rc);
749 strcpy (buf, "Unknown error ");
750 itoa (err, buf+strlen(buf), 10);
751 return (buf);
752}
753
754/*
755 *
756 */
757char *W32_CALL dom_remove_dot (char *name)
758{
759 char *dot = strrchr (name, '.');
760
761 if (dot && dot[1] == '\0' && dot > name+1)
762 *dot = '\0';
763 return (name);
764}
765
771DWORD W32_CALL resolve (const char *name)
772{
773 DWORD ip4_addr = 0UL;
774 int count;
775 char namebuf [MAX_HOSTLEN], *dot;
776 BOOL timeout [MAX_NAMESERVERS];
777 BOOL got_ip = FALSE;
778 BOOL recurse = TRUE;
779 unsigned len;
780 static WORD brk_mode;
781 struct DNS_query request;
782
783 if (!name || *name == '\0')
784 {
785 dom_errno = DNS_CLI_OTHER;
786 return (0);
787 }
788
789 len = strlen (name);
790 if (len >= sizeof(namebuf)-1)
791 {
792 dom_errno = DNS_CLI_TOOBIG;
793 return (0);
794 }
795
796 memcpy (namebuf, name, len+1); /* make a copy of 'name' */
797 rip (namebuf); /* strip off '\r' and/or '\n' */
798
799 if (isaddr(namebuf))
800 {
801 dom_errno = 0;
802 return aton (namebuf);
803 }
804
805 /* Names with trailing '.' shall not perform a DNS recursion
806 */
807 dot = strrchr (namebuf, '.');
808 if (dot && dot[1] == '\0')
809 {
810 *dot = '\0';
811 recurse = FALSE;
812 }
813
814#if defined(USE_BSD_API)
815 if (!called_from_ghbn) /* This hack avoids reentrancy */
816 { /* from gethostbyname() */
817 const struct hostent *h;
818
819 called_from_resolve = TRUE; /* ditto hack ! (vice versa) */
820 h = gethostbyname (namebuf);
821 called_from_resolve = FALSE;
822 if (h) /* IP from host-file or cache */
823 {
824 /*
825 * NOTE: gethostbyname() returns network order
826 * We assume IPv4 (32-bit)
827 */
828 dom_errno = 0;
829 return intel (*(DWORD*)h->h_addr_list[0]);
830 }
831
832 /* not found in host-file or cache, ask the DNS server(s)
833 */
834 }
835#endif
836
837#if defined(WIN32)
838 /*
839 * Try the WinDns cache first
840 */
841 if (WinDnsQuery_A4(namebuf, &ip4_addr))
842 return (ip4_addr);
843#endif
844
845 /* If no nameserver, give up now
846 */
847 if (last_nameserver == 0)
848 {
849 dom_errno = DNS_CLI_NOSERV;
850 outsnl (dom_strerror(dom_errno));
851 return (0);
852 }
853
854 /* We have no IP-address, give up now
855 */
856 if (my_ip_addr == 0)
857 {
858 dom_errno = DNS_CLI_NOIP;
859 outsnl (dom_strerror(dom_errno));
860 return (0);
861 }
862
863 if (dns_timeout == 0)
864 dns_timeout = sock_delay << 2;
865 res_timeout = set_timeout (1000 * dns_timeout);
866
867 count = 0;
868 memset (&timeout, 0, sizeof(timeout));
869 query_init (&request, FALSE);
870
871 NEW_BREAK_MODE (brk_mode, 1);
872
873 _resolve_exit = _resolve_timeout = FALSE;
874
875 do
876 {
877 int i;
878
879 if (!recurse || strchr(namebuf,'.'))
880 {
881 loc_domain = NULL;
882 count = -1;
883 }
884 else if (!dns_recurse && count == 0)
885 {
886 loc_domain = NULL;
887 count = -1;
888 }
889 else
890 {
891 loc_domain = next_domain (def_domain, count);
892 if (!loc_domain)
893 count = -1; /* use default name */
894 }
895
896 for (i = 0; i < last_nameserver; i++)
897 {
898 if (!timeout[i])
899 {
900 int rc = lookup_domain (&request, namebuf, count != -1,
901 def_nameservers[i], timeout+i,
902 FALSE, &ip4_addr);
903 if (rc)
904 {
905 got_ip = TRUE;
906 break; /* got address, bail out of for loop */
907 }
908 if (_resolve_exit)
909 break; /* an error occured, return to caller */
910 }
911
912 /*
913 * Should we really try the other nameservers if the first
914 * says the host doesn't exist? Maybe a trusting mechanism
915 * is needed (?)
916 */
917 }
918 if (count == -1)
919 break;
920 count++;
921 }
922 while (!got_ip && !_resolve_exit);
923
924#if defined(WIN32)
925 /* Put the result in the WinDns cache.
926 */
927 if (got_ip)
928 WinDnsCachePut_A4 (namebuf, ip4_addr);
929#endif
930
931 OLD_BREAK_MODE (brk_mode);
932
933 return (ip4_addr);
934}
935
936#if defined(USE_IPV6)
937int W32_CALL resolve_ip6 (const char *name, void *addr)
938{
939 struct DNS_query request;
940 ip6_address ip6_addr;
941
942 int count;
943 unsigned len;
944 char namebuf [MAX_HOSTLEN];
945 BOOL timeout [MAX_NAMESERVERS];
946 WORD brk_mode;
947 BOOL got_ip = FALSE;
948
949 if (!dns_do_ipv6)
950 {
951 dom_errno = DNS_CLI_NOIPV6;
952 TRACE_CONSOLE (1, "%s\n", dom_strerror(dom_errno));
953 return (0);
954 }
955
956 len = strlen (name);
957 if (len >= sizeof(namebuf)-1)
958 {
959 dom_errno = DNS_CLI_TOOBIG;
960 TRACE_CONSOLE (1, "%s\n", dom_strerror(dom_errno));
961 return (0);
962 }
963
964 memcpy (namebuf, name, len+1);
965 rip (namebuf);
966
967#if defined(WIN32)
968 /*
969 * Try the WinDns cache first
970 */
971 if (WinDnsQuery_A6(namebuf, &ip6_addr))
972 {
973 memcpy (addr, &ip6_addr, sizeof(ip6_addr));
974 return (1);
975 }
976#endif
977
978 if (last_nameserver == 0)
979 {
980 dom_errno = DNS_CLI_NOSERV;
981 outsnl (dom_strerror(dom_errno));
982 return (0);
983 }
984
985 if (my_ip_addr == 0)
986 {
987 dom_errno = DNS_CLI_NOIP;
988 outsnl (dom_strerror(dom_errno));
989 return (0);
990 }
991
992 if (dns_timeout == 0)
993 dns_timeout = sock_delay << 2;
994 res_timeout = set_timeout (1000 * dns_timeout);
995
996 count = 0;
997 memset (&timeout, 0, sizeof(timeout));
998 query_init (&request, TRUE);
999
1000 NEW_BREAK_MODE (brk_mode, 1);
1001 _resolve_exit = _resolve_timeout = FALSE;
1002
1003 do
1004 {
1005 int i;
1006
1007 if (strchr(namebuf,'.'))
1008 {
1009 loc_domain = NULL;
1010 count = -1;
1011 }
1012 else if (!dns_recurse && count == 0)
1013 {
1014 loc_domain = NULL;
1015 count = -1;
1016 }
1017 else
1018 {
1019 loc_domain = next_domain (def_domain, count);
1020 if (!loc_domain)
1021 count = -1;
1022 }
1023
1024 for (i = 0; i < last_nameserver; i++)
1025 {
1026 if (!timeout[i])
1027 {
1028 int rc = lookup_domain (&request, namebuf, count != -1,
1029 def_nameservers[i], timeout+i,
1030 TRUE, &ip6_addr);
1031 if (rc)
1032 {
1033 got_ip = TRUE;
1034 break; /* got name, bail out of for loop */
1035 }
1036 if (_resolve_exit)
1037 break; /* an error occured, return to caller */
1038 }
1039
1040 /*
1041 * Should we really try the other nameservers if the first
1042 * says the host doesn't exist? Maybe a trusting mechanism
1043 * is needed (?)
1044 */
1045 }
1046 if (count == -1)
1047 break;
1048 count++;
1049 }
1050 while (!got_ip && !_resolve_exit);
1051
1052 if (got_ip)
1053 {
1054 memcpy (addr, &ip6_addr, sizeof(ip6_addr));
1055
1056#if defined(WIN32)
1057 /* Put the result in the WinDns cache.
1058 */
1059 WinDnsCachePut_A6 (namebuf, &ip6_addr);
1060#endif
1061 }
1062
1063 OLD_BREAK_MODE (brk_mode);
1064 return (got_ip ? 1 : 0);
1065}
1066#endif /* USE_IPV6 */
1067
copyrigh.h
idna.h
ip6_out.h
language.h
Random
unsigned W32_CALL Random(unsigned a, unsigned b)
Returns a random integer in range [a..b].
Definition: misc.c:743
misc.h
_watt_cbroke
volatile int _watt_cbroke
Definition: pc_cbrk.c:48
misc_str.h
aton
DWORD W32_CALL aton(const char *str)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
Definition: netaddr.c:86
isaddr
BOOL W32_CALL isaddr(const char *str)
Check if 'str' is simply an ip address.
Definition: netaddr.c:128
netaddr.h
netdb.h
pcconfig.h
pcdbug.h
dom_strerror
const char *W32_CALL dom_strerror(int err)
Return text for error code (dom_errno).
Definition: pcdns.c:742
send_query
static int send_query(sock_type *sock, struct DNS_query *q, const char *name, DWORD towho, WORD qtype)
Put together a domain lookup packet and send it.
Definition: pcdns.c:196
server_error
static const char * server_error(enum DNS_serv_resp err)
Return text for server-side errors.
Definition: pcdns.c:682
query_init
static void query_init(struct DNS_query *q, BOOL is_ip6)
Initialise the query header and clear the alternate addr-list.
Definition: pcdns.c:106
defaultdomain
char defaultdomain[MAX_HOSTLEN+1]
The 2 next variables are loaded from WATTCP.CFG file.
Definition: pcdns.c:71
unpack_domain
static int unpack_domain(const struct DNS_query *q, const BYTE *src, size_t src_size, BYTE *dst, size_t dst_size)
Unpack a received compressed domain name.
Definition: pcdns.c:312
next_domain
static const char * next_domain(const char *domain, int count)
Given domain and count = 0,1,2,..., return next larger domain or NULL when no more are available.
Definition: pcdns.c:664
read_response
static int read_response(const struct DNS_query *q, int len, WORD qtype, void *addr)
Extract the IPv4/v6 address from a response message (A or AAAA record).
Definition: pcdns.c:365
store_alt_address
static void store_alt_address(const void *data, int idx, BOOL is_ip6)
Remember alternate address in dom_a?list[].
Definition: pcdns.c:127
client_error
static const char * client_error(enum DNS_client_code err)
Return text for client-side errors.
Definition: pcdns.c:707
lookup_domain
static int lookup_domain(struct DNS_query *q, const char *mname, BOOL add_dom, DWORD nameserver, BOOL *timedout, BOOL is_aaaa, void *addr)
DOMAIN based name lookup.
Definition: pcdns.c:487
resolve
DWORD W32_CALL resolve(const char *name)
Convert host name to an address.
Definition: pcdns.c:771
extract_cname
static void extract_cname(const struct DNS_query *q, const char *src, char *dest, size_t max)
Extract the CNAME from a resource record.
Definition: pcdns.c:267
pack_domain
static int pack_domain(BYTE *dst, const char *src)
Pack a regular text string into a packed domain name, suitable for the name server.
Definition: pcdns.c:147
called_from_resolve
BOOL called_from_resolve
Hacks to make gethostbyname() and resolve() cooperate.
Definition: pcdns.c:60
pcdns.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
udp_open
int W32_CALL udp_open(_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP active open.
Definition: pctcp.c:262
pctcp.h
sock_dataready
WORD W32_CALL sock_dataready(sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
Definition: sock_io.c:246
DNS_query
Definition: pcdns.h:187
DNS_resource
Definition: pcdns.h:202
hostent
Definition: netdb.h:104
rip
Definition: routed.h:111
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.
werrno.h


Watt-32 tcp/ip: E:/WATT/src/pcdns.h Source File

  • src
pcdns.h
Go to the documentation of this file.
1
3#ifndef _w32_UDP_DOM_H
4#define _w32_UDP_DOM_H
5
6#define MAX_LABEL_SIZE 63 /* maximum length of a single domain label */
7#define DOMSIZE 512 /* maximum domain message size to mess with */
8#define DOM_DST_PORT 53 /* destination port number for DNS protocol */
9#define DOM_SRC_PORT 1415 /* local port number for DNS protocol. Old */
10 /* port 997 didn't work with some firewalls */
11
12W32_CLANG_PACK_WARN_OFF()
13
14#include <sys/pack_on.h>
15
16/*
17 * Header format (struct DNS_head), from RFC 1035:
18 * 1 1 1 1 1 1
19 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
20 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
21 * | ID |
22 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
23 * |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
24 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
25 * | QDCOUNT |
26 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
27 * | ANCOUNT |
28 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
29 * | NSCOUNT |
30 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
31 * | ARCOUNT |
32 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
33 *
34 * AA, TC, RA, and RCODE are only set in responses.
35 * Brief description of the remaining fields:
36 * ID Identifier to match responses with queries
37 * QR Query (0) or response (1)
38 * Opcode For our purposes, always QUERY
39 * RD Recursion desired
40 * Z Reserved (zero)
41 * QDCOUNT Number of queries
42 * ANCOUNT Number of answers
43 * NSCOUNT Number of name server records
44 * ARCOUNT Number of additional records
45 *
46 * Question format, from RFC 1035:
47 * 1 1 1 1 1 1
48 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
49 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
50 * | |
51 * / QNAME /
52 * / /
53 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
54 * | QTYPE |
55 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
56 * | QCLASS |
57 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
58 *
59 * The QNAME is encoded as a series of labels, each represented
60 * as a one-byte length (maximum 63) followed by the text of the
61 * label. The list is terminated by a label of length zero (which can
62 * be thought of as the root domain).
63 */
64
65/*
66 * Header for the DOMAIN queries.
67 * ALL OF THESE ARE BYTE SWAPPED QUANTITIES!
68 * We are the poor slobs who are incompatible with the world's byte order.
69 */
70struct DNS_head {
71 WORD ident; /* Unique identifier */
72#if 1
73 WORD flags; /* See below */
74#else
75 unsigned rd : 1; /* Recursion desired */
76 unsigned tc : 1; /* Truncated message */
77 unsigned aa : 1; /* Authoritative answer */
78 unsigned opcode : 4; /* See below */
79 unsigned qr : 1; /* Response = 1, Query = 0 */
80 unsigned rcode : 4; /* Response code */
81 unsigned cd : 1; /* Checking disabled by resolver */
82 unsigned ad : 1; /* Authentic data from named */
83 unsigned unused : 1; /* Unused bits */
84 unsigned ra : 1; /* Recursion available */
85#endif
86 WORD qdcount; /* Question section, # of entries */
87 WORD ancount; /* Answers, how many */
88 WORD nscount; /* Count of name server RRs */
89 WORD arcount; /* Number of "additional" records */
90 };
91
92
96struct DNS_Header {
97 WORD dns_id;
98 WORD dns_fl_rd : 1; /* recursion desired */
99 WORD dns_fl_tc : 1; /* truncated message */
100 WORD dns_fl_aa : 1; /* authoritative answer */
101 WORD dns_fl_opcode: 4; /* purpose of message */
102 WORD dns_fl_qr : 1; /* response flag */
103 WORD dns_fl_rcode : 4; /* response code */
104 WORD dns_fl_cd : 1; /* checking disabled by resolver */
105 WORD dns_fl_ad : 1; /* authentic data from named */
106 WORD dns_fl_unused: 1; /* unused bits (MBZ as of 4.9.3a3) */
107 WORD dns_fl_ra : 1; /* recursion available */
108 WORD dns_num_q;
109 WORD dns_num_ans;
110 WORD dns_num_auth;
111 WORD dns_num_add;
112 };
113
114
115/*
116 * DNS_head::flags
117 */
118#define DQR 0x8000 /* Query = 0, Response = 1 */
119#define DOPCODE 0x7100 /* Opcode mask, see below */
120#define DAA 0x0400 /* Authoritative answer */
121#define DTC 0x0200 /* Truncated response */
122#define DRD 0x0100 /* Recursion desired */
123#define DRA 0x0080 /* Recursion available */
124#define DRCODE 0x000F /* Response code mask, see below */
125
126/*
127 * Opcode possible values:
128 */
129#define DOPQUERY 0 /* a standard query */
130#define DOPIQ 1 /* an inverse query */
131#define DOPCQM 2 /* a completion query, multiple reply */
132#define DOPCQU 3 /* a completion query, single reply */
133#define DUPDATE 5 /* DNS update (RFC-2136) */
134/* the rest reserved for future */
135
136/*
137 * DNS server response codes; RCODE (stored in dom_errno)
138 */
139enum DNS_serv_resp {
140 DNS_SRV_OK = 0, /* 0 = okay response */
141 DNS_SRV_FORM, /* 1 = format error */
142 DNS_SRV_FAIL, /* 2 = server failed */
143 DNS_SRV_NAME, /* 3 = name error (NXDOMAIN) */
144 DNS_SRV_NOTIMPL, /* 4 = function not implemented */
145 DNS_SRV_REFUSE, /* 5 = service refused */
146 DNS_SRV_MAX = 15
147 };
148
149/*
150 * DNS client codes (stored in dom_errno)
151 */
152enum DNS_client_code {
153 DNS_CLI_SYSTEM = DNS_SRV_MAX, /* See 'errno' */
154 DNS_CLI_REFUSE, /* Name server refused */
155 DNS_CLI_USERQUIT, /* User terminated via hook or ^C */
156 DNS_CLI_NOSERV, /* No nameserver defined */
157 DNS_CLI_TIMEOUT, /* Timeout, no reply */
158 DNS_CLI_ILL_RESP, /* Illegal/short response */
159 DNS_CLI_ILL_IDNA, /* Convert to/from international name failed */
160 DNS_CLI_TOOBIG, /* Name/label too large */
161 DNS_CLI_NOIP, /* my_ip_addr == 0 */
162 DNS_CLI_NOIPV6, /* IPv6 DNS disabled */
163 DNS_CLI_OTHER, /* Other general error */
164 DNS_CLI_MAX
165 };
166
167/*
168 * Query types (QTYPE)
169 */
170#define DTYPE_A 1 /* host address resource record (A) */
171#define DTYPE_CNAME 5 /* host's canonical name record (CNAME) */
172#define DTYPE_AAAA 28 /* host address resource record (AAAA) */
173#define DTYPE_PTR 12 /* domain name ptr (PTR) */
174#define DTYPE_SOA 6 /* start of authority zone (SOA) */
175#define DTYPE_SRV 33 /* server selection (SRV), RFC-2052 */
176#define DTYPE_CAA 257 /* Certification Authority Authorization, RFC-6844 */
177
178/*
179 * Query class (QCLASS)
180 */
181#define DIN 1 /* ARPA internet class */
182#define DWILD 255 /* Wildcard for several classifications */
183
184/*
185 * DNS Query request/response header.
186 */
187struct DNS_query {
188 struct DNS_head head;
189 BYTE body [DOMSIZE];
190 };
191
192struct DNS_Query {
193 struct DNS_Header head;
194 BYTE body [DOMSIZE];
195 };
196
197/*
198 * A resource record is made up of a compressed domain name followed by
199 * this structure. All of these words need to be byteswapped before use.
200 * Part of 'struct DNS_query::body'.
201 */
202struct DNS_resource {
203 WORD rtype; /* resource record type = DTYPE_A/AAAA */
204 WORD rclass; /* RR class = DIN */
205 DWORD ttl; /* time-to-live, changed to 32 bits */
206 WORD rdlength; /* length of next field */
207 BYTE rdata [DOMSIZE-10]; /* data field */
208 };
209
210#define RESOURCE_HEAD_SIZE 10
211
212#include <sys/pack_off.h>
213
214 W32_CLANG_PACK_WARN_DEF()
215
216extern char dom_cname [MAX_HOSTLEN+1];
217extern DWORD dom_ttl;
218extern BOOL dns_do_ipv6;
219extern BOOL dns_do_idna;
220extern WORD dns_windns;
221extern BOOL called_from_resolve;
222extern BOOL called_from_ghbn;
223extern BOOL from_windns;
224
225extern DWORD dom_a4list [MAX_ADDRESSES+1];
226extern ip6_address dom_a6list [MAX_ADDRESSES+1];
227
228/* In udp_rev.c
229 */
230extern int reverse_lookup_myip (void);
231extern int reverse_resolve_ip4 (DWORD ipv4, char *result, size_t size);
232
233#if defined(USE_IPV6)
234extern int reverse_resolve_ip6 (const void *ipv6, char *result, size_t size);
235#endif
236
237#endif
pack_off.h
W32_CLANG_PACK_WARN_DEF
W32_CLANG_PACK_WARN_DEF() extern char dom_cname[MAX_HOSTLEN+1]
This hook is to prevent the BSD-socket API being linked in by default.
Definition: pcsed.h:261
reverse_lookup_myip
int reverse_lookup_myip(void)
Do a reverse lookup on ‘my_ip_addr’.
Definition: udp_rev.c:176
called_from_resolve
BOOL called_from_resolve
Hacks to make gethostbyname() and resolve() cooperate.
Definition: pcdns.c:60
DNS_Header
Another definition of 'struct DNS_head'.
Definition: pcdns.h:96
DNS_Query
Definition: pcdns.h:192
DNS_query
Definition: pcdns.h:187
DNS_resource
Definition: pcdns.h:202


Watt-32 tcp/ip: E:/WATT/src/pcicmp6.c Source File

  • src
pcicmp6.c
Go to the documentation of this file.
1
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>
41#include <arpa/inet.h>
42
43#include "wattcp.h"
44#include "misc.h"
45#include "misc_str.h"
46#include "timer.h"
47#include "chksum.h"
48#include "netaddr.h"
49#include "language.h"
50#include "ip6_in.h"
51#include "ip6_out.h"
52#include "ip4_out.h"
53#include "split.h"
54#include "pctcp.h"
55#include "pcsed.h"
56#include "pcstat.h"
57#include "pcdbug.h"
58#include "pcpkt.h"
59#include "pcarp.h"
60#include "pcconfig.h"
61#include "pcicmp6.h"
62
64#if defined(USE_IPV6) /* Rest of file */
65
66struct prefix_table {
67 size_t len;
68 ip6_address prefix;
69 };
70
71struct prefix_table prefix_list [10];
72struct icmp6_cache neighbor_cache [ND_CACHE_SIZE];
73struct icmp6_cache destin_cache [ND_CACHE_SIZE];
74
75int icmp6_prefix_len;
76ip6_address icmp6_prefix;
77DWORD icmp6_6to4_gateway = 0; /* host order */
78
79W32_CLANG_PACK_WARN_OFF()
80
81#include <sys/pack_on.h>
82
83struct _pkt {
84 in6_Header in;
85 ICMP6_PKT icmp;
86 BYTE options[1];
87 };
88
89#include <sys/pack_off.h>
90
91W32_CLANG_PACK_WARN_DEF()
92
93
94#if 0
95static const char *icmp6_options_str [] = {
96 "",
97 __LANG ("source link-layer addr"),
98 __LANG ("target link-layer addr"),
99 __LANG ("prefix information"),
100 __LANG ("redirected header"),
101 __LANG ("MTU")
102 };
103#endif
104
105static WORD route_lifetime;
106
107static void icmp6_print (int dbg_lvl, const char *msg, const void *src);
108static int icmp6_send (in6_Header *ip, ICMP6_PKT *icmp, UINT len);
109static void router_advert (const union ICMP6_PKT *icmp, unsigned len);
110static int neighbor_advert (const eth_address *eth);
111static void echo_reply (const in6_Header *ip, const union ICMP6_PKT *icmp);
112
113/*
114 * Make a Ethernet destination address from a (solicited node) ip-address.
115 * From /etc/manuf: 33:33:0:0:0:0/16, IPv6 neighbor discovery.
116 */
117static const void *icmp6_mac_addr (const void *ip_addr)
118{
119 static mac_address mac;
120 const BYTE *addr = (const BYTE*)ip_addr;
121
122 mac[0] = 0x33;
123 mac[1] = 0x33;
124 mac[2] = 0xFF;
125 mac[3] = addr[13];
126 mac[4] = addr[14];
127 mac[5] = addr[15];
128 return (&mac[0]);
129}
130
131int icmp6_router_solicitation (void)
132{
133 struct _pkt *pkt;
134 struct in6_Header *ip;
135 struct ICMP6_route_sol *icmp;
136
137 pkt = (struct _pkt*) _eth_formatpacket (_eth_brdcast, IP6_TYPE);
138 ip = &pkt->in;
139 icmp = &pkt->icmp.rsolic;
140 icmp->type = ND_ROUTER_SOLICIT;
141 icmp->code = 0;
142 icmp->reserved = 0;
143
144 memcpy (&ip->source, &in6addr_my_ip, sizeof(ip->source));
145 memcpy (&ip->destination, &in6addr_allr_mc, sizeof(ip->destination));
146 return icmp6_send (ip, (ICMP6_PKT*)icmp, sizeof(*icmp));
147}
148
149/*
150 * Add the IPv4 'icmp6_6to4_gateway' address to the ND cache
151 */
152BOOL icmp6_add_gateway4 (void)
153{
154 struct icmp6_cache *ce = NULL;
155 ip6_address ip;
156 mac_address eth;
157 BOOL arp_ok;
158
159 arp_ok = _arp_resolve (icmp6_6to4_gateway, &eth);
160 if (arp_ok)
161 {
162 memcpy (&ip, in6addr_mapped, sizeof(in6addr_mapped));
163 *(DWORD*) &ip[12] = intel (icmp6_6to4_gateway);
164 ce = icmp6_ncache_insert_fix (&ip, eth);
165 }
166 TRACE_CONSOLE (1, "Adding %s as 6-to-4 gateway, ARP %s, Insert %s\n",
167 _inet_ntoa(NULL,intel(icmp6_6to4_gateway)),
168 arp_ok ? "OK" : "failed",
169 ce ? "OK" : "failed");
170 return (arp_ok && ce);
171}
172
173/*
174 * Perform an "ICMPv6 Neighbor Solicitation" on 'addr' to resolve it's
175 * MAC address (the role of ARP in IPv4).
176 */
177int icmp6_neigh_solic (const void *addr, eth_address *eth)
178{
179 struct _pkt *pkt;
180 struct in6_Header *ip;
181 struct ICMP6_nd_sol *icmp;
182 struct icmp6_cache *cache;
183 struct in6_addr dest;
184 BYTE *options;
185
186 WATT_ASSERT (eth != NULL);
187
188 if (_ip6_is_local_addr(addr))
189 {
190 memcpy (eth, _eth_addr, sizeof(*eth));
191 return (1);
192 }
193
194 cache = icmp6_ncache_lookup (addr);
195 if (cache)
196 {
197 memcpy (eth, &cache->eth, sizeof(*eth));
198 return (1);
199 }
200
201 pkt = (struct _pkt*) _eth_formatpacket (icmp6_mac_addr(addr), IP6_TYPE);
202 ip = &pkt->in;
203 icmp = &pkt->icmp.nd_solic;
204 icmp->type = ND_NEIGHBOR_SOLICIT;
205 icmp->code = 0;
206 icmp->reserved = 0;
207
208 memcpy (&dest, &in6addr_alln_mc, sizeof(dest)); /* All nodes MC address */
209 dest.s6_addr[11] ^= 1; /* toggle G-bit */
210 dest.s6_addr[12] = 0xFF;
211 dest.s6_addr[13] = ((BYTE*)addr)[13];
212 dest.s6_addr[14] = ((BYTE*)addr)[14];
213 dest.s6_addr[15] = ((BYTE*)addr)[15];
214
215 memcpy (&icmp->target, addr, sizeof(icmp->target));
216 memcpy (&ip->source, &in6addr_my_ip, sizeof(ip->source));
217 memcpy (&ip->destination, &dest, sizeof(ip->destination));
218
219 /* Insert "src-mac address" option
220 */
221 options = (BYTE*) (icmp + 1);
222 *options++ = ND_OPT_SOURCE_LINKADDR;
223 *options++ = 1; /* multiple of 8 bytes */
224 memcpy (options, _eth_addr, sizeof(_eth_addr));
225 options += sizeof(_eth_addr);
226 *options++ = 0; /* End option */
227 *options++ = 0;
228
229 icmp6_send (ip, (ICMP6_PKT*)icmp, options - (BYTE*)icmp);
230
231#if 0
232 while (1)
233 {
234 eth = ..
235 }
236#endif
237
238 icmp6_ncache_insert (addr, eth);
239
241 return (0);
242}
243
244void icmp6_handler (const in6_Header *ip)
245{
246 const struct pkt_split *pkt;
247 const union ICMP6_PKT *icmp;
248 int type, code;
249 unsigned len;
250 BOOL for_me;
251
252 DEBUG_RX (NULL, ip);
253
254 pkt = pkt_get_type_in (TYPE_IP6_ICMP);
255 icmp = (const union ICMP6_PKT*) pkt->data;
256 len = pkt->len;
257 for_me = !memcmp (ip->destination, &in6addr_my_ip, sizeof(ip->destination));
258
259 if (len < sizeof(icmp->unused))
260 {
261 STAT (icmp6stats.icp6s_tooshort++);
262 return;
263 }
264
265 if (!_ip6_icmp_checksum(ip,icmp,intel16(ip->len)))
266 {
267 STAT (icmp6stats.icp6s_checksum++);
268 icmp6_print (1, _LANG("bad checksum"), ip->source);
269 return;
270 }
271
272 type = icmp->unused.type;
273 code = icmp->unused.code;
274
275 switch (type)
276 {
277 case ICMP6_DST_UNREACH:
278 break;
279
280 case ICMP6_PACKET_TOO_BIG:
281 break;
282
283 case ICMP6_TIME_EXCEEDED:
284 break;
285
286 case ICMP6_PARAM_PROB:
287 break;
288
289 case ICMP6_ECHO_REQUEST:
290 if (for_me)
291 {
292 icmp6_print (2, _LANG("PING6 requested of us"), ip->source);
293 echo_reply (ip, icmp);
294 }
295 break;
296
297 case ICMP6_ECHO_REPLY:
298 break;
299
300 case ICMP6_MEMBERSHIP_QUERY:
301 break;
302
303 case ICMP6_MEMBERSHIP_REPORT:
304 break;
305
306 case ICMP6_MEMBERSHIP_REDUCTION:
307 break;
308
309 case ICMP6_ROUTER_RENUMBERING:
310 break;
311
312 case ICMP6_WRUREQUEST:
313 break;
314
315 case ICMP6_WRUREPLY:
316 break;
317
318 case ND_ROUTER_SOLICIT: /* silently discard */
319 break;
320
321 case ND_ROUTER_ADVERT:
322 if (IN6_IS_ADDR_LINKLOCAL(ip->source) && ip->hop_limit == 255)
323 router_advert (icmp, len);
324 break;
325
326 case ND_NEIGHBOR_SOLICIT:
327 if (IN6_ARE_ADDR_EQUAL(icmp->nd_solic.target, &in6addr_my_ip))
328 neighbor_advert ((const eth_address*)MAC_SRC(ip));
329 break;
330
331 case ND_NEIGHBOR_ADVERT:
332 break;
333
334 case ND_REDIRECT:
335 break;
336 }
337 ARGSUSED (code);
338}
339
340void icmp6_unreach (const in6_Header *ip, int code)
341{
342 ARGSUSED (ip);
343 ARGSUSED (code);
344}
345
346struct icmp6_cache *icmp6_ncache_lookup (const void *ip)
347{
348 struct icmp6_cache *entry = &neighbor_cache[0];
349 time_t now = time (NULL);
350 int i;
351
352 for (i = 0; i < DIM(neighbor_cache); i++, entry++)
353 {
354#if 0 /* !! test */
355 printf ("%2d: ip '%s', entry '%s'\n",
356 i, _inet6_ntoa(ip), _inet6_ntoa(entry->ip));
357#endif
358
359 if (entry->state != ND_CACHE_REACHABLE)
360 continue;
361
362 if (entry->expiry && now >= entry->expiry)
363 {
364 entry->state = ND_CACHE_UNUSED;
365 entry->expiry = 0;
366 continue;
367 }
368
369#if 0 /* test !! */
370 if (*(DWORD*)&entry->ip[12] == intel(icmp6_6to4_gateway))
371 return (entry);
372#endif
373
374 if (IN6_IS_ADDR_V4MAPPED(ip) &&
375 *(DWORD*)&entry->ip[12] == intel(icmp6_6to4_gateway))
376 return (entry);
377
378 if (IN6_ARE_ADDR_EQUAL(ip,entry->ip))
379 return (entry);
380 }
381 return (NULL);
382}
383
384struct icmp6_cache *icmp6_ncache_insert (const void *ip, const void *eth)
385{
386 struct icmp6_cache *found = NULL;
387 struct icmp6_cache *entry = &neighbor_cache[0];
388 static WORD index = 0; /* rotates round-robin */
389 int i;
390
391 for (i = 0; i < DIM(neighbor_cache); i++, entry++)
392 {
393 if (entry->state == ND_CACHE_PROBE || IN6_IS_ADDR_UNSPECIFIED(entry->ip))
394 {
395 found = entry;
396 break;
397 }
398 }
399
400 if (!found) /* not found, grab a "random" slot */
401 {
402 index++;
403 index %= DIM (neighbor_cache);
404 found = &neighbor_cache [index];
405 }
406 memcpy (found->ip, ip, sizeof(found->ip));
407 memcpy (found->eth, eth, sizeof(found->eth));
408 found->state = ND_CACHE_INCOMPLETE;
409 found->expiry = time (NULL);
410 return (found);
411}
412
413struct icmp6_cache *icmp6_ncache_insert_fix (const void *ip, const void *eth)
414{
415 struct icmp6_cache *ce = icmp6_ncache_insert (ip, eth);
416
417 if (ce)
418 {
419 ce->state = ND_CACHE_REACHABLE; /* always reachable */
420 ce->expiry = 0; /* never expire */
421 }
422 return (ce);
423}
424
425static void icmp6_print (int dbg_lvl, const char *msg, const void *src)
426{
427 if (debug_on < dbg_lvl)
428 return;
429
430 outs ("\nICMP6: ");
431 if (src)
432 {
433 const char *addr = _inet6_ntoa (src);
434 outs ("(");
435 outs (addr ? addr : "(null?)");
436 outs ("): ");
437 }
438 outsnl (_LANG(msg));
439}
440
441static int icmp6_send (in6_Header *ip, ICMP6_PKT *icmp, UINT len)
442{
443 icmp->unused.checksum = 0;
444 icmp->unused.checksum = _ip6_checksum (ip, IP6_NEXT_ICMP, icmp, len);
445 return IP6_OUTPUT (ip, &ip->source, &ip->destination, IP6_NEXT_ICMP,
446 len, 0, NULL);
447}
448
449static void parse_options (const BYTE *opt, unsigned max)
450{
451 const BYTE *start = opt;
452
453 while (opt < start + max)
454 {
455 const struct nd_opt_prefix_info *pi = (const struct nd_opt_prefix_info*) opt;
456 BYTE type = opt[0];
457 int len = opt[1] << 3;
458
459 switch (type)
460 {
461 case ND_OPT_PREFIX_INFORMATION:
462 if (pi->nd_opt_pi_len == 4)
463 {
464 icmp6_prefix_len = pi->nd_opt_pi_prefix_len;
465 memcpy (&icmp6_prefix, &pi->nd_opt_pi_prefix, sizeof(icmp6_prefix));
466 }
467 break;
468 case ND_OPT_SOURCE_LINKADDR:
469 case ND_OPT_TARGET_LINKADDR:
470 case ND_OPT_REDIRECTED_HEADER:
471 case ND_OPT_MTU:
472 case 0: /* EOL */
473 break;
474 default:
475 icmp6_print (1, _LANG("Illegal option"), NULL);
476 break;
477 }
478 opt += len;
479 }
480}
481
482static void router_advert (const union ICMP6_PKT *icmp, unsigned len)
483{
484 if (icmp->radvert.hop_limit)
485 _default6_ttl = icmp->radvert.hop_limit;
486 if (icmp->radvert.lifetime)
487 route_lifetime = intel16 (icmp->radvert.lifetime);
488 if (len > sizeof(icmp->radvert))
489 parse_options ((const BYTE*)icmp + sizeof(icmp->radvert),
490 len - sizeof(icmp->radvert));
491}
492
493static int neighbor_advert (const eth_address *eth)
494{
495 struct _pkt *pkt;
496 struct in6_Header *ip;
497 struct ICMP6_nd_adv *icmp;
498
499 pkt = (struct _pkt*) _eth_formatpacket (eth, IP6_TYPE);
500 ip = &pkt->in;
501 icmp = &pkt->icmp.nd_adv;
502 icmp->type = ND_NEIGHBOR_ADVERT;
503 icmp->code = 0;
504 icmp->reserved1 = 0;
505 icmp->reserved2 = 0;
506 icmp->reserved3 = 0;
507 icmp->router = 0;
508 icmp->solicited = 1;
509 icmp->override = 1;
510
511 memcpy (&icmp->target, &in6addr_my_ip, sizeof(icmp->target));
512 memcpy (&ip->source, &in6addr_my_ip, sizeof(ip->source));
513 memcpy (&ip->destination, &in6addr_allr_mc, sizeof(ip->destination));
514 return icmp6_send (ip, (ICMP6_PKT*)icmp, sizeof(*icmp));
515}
516
517static void echo_reply (const in6_Header *orig_ip,
518 const union ICMP6_PKT *orig_icmp)
519{
520 struct _pkt *pkt;
521 struct in6_Header *ip;
522 union ICMP6_PKT *icmp;
523 WORD len = intel16 (orig_ip->len);
524
525 pkt = (struct _pkt*) _eth_formatpacket (MAC_SRC(orig_ip), IP6_TYPE);
526 ip = &pkt->in;
527 icmp = &pkt->icmp;
528
529 /* Don't let a huge reassembled ICMP-packet kill us.
530 */
531 len = min (len, _mtu - sizeof(*ip));
532 memcpy (icmp, orig_icmp, len);
533 icmp->echo.type = ICMP6_ECHO_REPLY;
534 icmp->echo.code = orig_icmp->echo.code;
535
536 /* Use supplied ip values in case we ever multi-home.
537 * Note that ip values are still in network order.
538 */
539 memcpy (&ip->source, &in6addr_my_ip, sizeof(ip->source));
540 memcpy (&ip->destination, &orig_ip->source, sizeof(ip->destination));
541 ip->hop_limit = orig_ip->hop_limit;
542
543 icmp6_print (2, _LANG("PING reply sent"), NULL);
544 icmp6_send (ip, (ICMP6_PKT*)icmp, len);
545}
546#endif /* USE_IPV6 */
_ip6_checksum
WORD _ip6_checksum(const in6_Header *ip, WORD proto, const void *payload, unsigned payloadlen)
Generic IPv6 checksum function.
Definition: chksum.c:48
chksum.h
inet.h
ip4_out.h
ip6_in.h
ip6_out.h
language.h
misc.h
misc_str.h
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
pack_off.h
_arp_resolve
BOOL W32_CALL _arp_resolve(DWORD ip, eth_address *eth)
The blocking lookup function visible to higher functions.
Definition: pcarp.c:1278
pcarp.h
pcconfig.h
pcdbug.h
icmp6_neigh_solic
int icmp6_neigh_solic(const void *addr, eth_address *eth)
Definition: pcicmp6.c:177
pcicmp6.h
pcpkt.h
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
_eth_brdcast
mac_address _eth_brdcast
Link-layer broadcast address.
Definition: pcsed.c:50
pcsed.h
pcstat.h
pctcp.h
split.h
_pkt
Definition: pcicmp.c:85
ICMP6_nd_adv
Definition: pcicmp6.h:73
ICMP6_nd_sol
Definition: pcicmp6.h:101
ICMP6_route_sol
Definition: pcicmp6.h:21
code
Definition: zinftree.h:24
icmp6_cache
Definition: pcicmp6.h:135
icmp
Definition: ip_icmp.h:66
in6_Header
Definition: wattcp.h:381
in6_addr
Definition: in.h:151
nd_opt_prefix_info
Definition: icmp6.h:316
pkt_split
Definition: split.h:46
prefix_table
Definition: pcicmp6.c:66
timer.h
ICMP6_PKT
Definition: pcicmp6.h:111
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcicmp6.h Source File

  • src
pcicmp6.h
Go to the documentation of this file.
1
3#ifndef _w32_PCICMP6_H
4#define _w32_PCICMP6_H
5
6W32_CLANG_PACK_WARN_OFF()
7
8#include <sys/pack_on.h>
9
12struct ICMP6_unused {
13 BYTE type;
14 BYTE code;
15 WORD checksum;
16 DWORD unused;
17 };
18
21struct ICMP6_route_sol {
22 BYTE type;
23 BYTE code;
24 WORD checksum;
25 DWORD reserved;
26 };
27
30struct ICMP6_route_adv {
31 BYTE type;
32 BYTE code;
33 WORD checksum;
34 BYTE hop_limit;
35 BYTE reserved : 6;
36 BYTE other : 1;
37 BYTE managed : 1;
38 WORD lifetime;
39 DWORD reach_time;
40 DWORD retrans_time;
41 };
42
45struct ICMP6_pointer {
46 BYTE type;
47 BYTE code;
48 WORD checksum;
49 DWORD pointer;
50 };
51
54struct ICMP6_MTU {
55 BYTE type;
56 BYTE code;
57 WORD checksum;
58 DWORD MTU;
59 };
60
63struct ICMP6_echo {
64 BYTE type;
65 BYTE code;
66 WORD checksum;
67 WORD identifier;
68 WORD sequence;
69 };
70
73struct ICMP6_nd_adv {
74 BYTE type;
75 BYTE code;
76 WORD checksum;
77 BYTE reserved1 : 5;
78 BYTE override : 1;
79 BYTE solicited : 1;
80 BYTE router : 1;
81 BYTE reserved2;
82 WORD reserved3;
83 ip6_address target;
84 };
85
88struct ICMP6_nd_ra {
89 BYTE type;
90 BYTE code;
91 WORD checksum;
92 BYTE hop_limit;
93 BYTE reserved : 6;
94 BYTE other : 1;
95 BYTE managed : 1;
96 WORD lifetime;
97 };
98
101struct ICMP6_nd_sol {
102 BYTE type;
103 BYTE code;
104 WORD checksum;
105 DWORD reserved;
106 ip6_address target;
107 };
108
111typedef union ICMP6_PKT {
112 struct ICMP6_unused unused;
113 struct ICMP6_route_sol rsolic;
114 struct ICMP6_route_adv radvert;
115 struct ICMP6_pointer pointer;
116 struct ICMP6_MTU MTU;
117 struct ICMP6_echo echo;
118 struct ICMP6_nd_adv nd_adv;
119 struct ICMP6_nd_ra nd_ra;
120 struct ICMP6_nd_sol nd_solic;
121 } ICMP6_PKT;
122
123#include <sys/pack_off.h>
124
125W32_CLANG_PACK_WARN_OFF()
126
127enum ND_cacheState {
128 ND_CACHE_UNUSED, /* entry not used */
129 ND_CACHE_INCOMPLETE, /* lookup incomplete */
130 ND_CACHE_REACHABLE, /* responds to ND solitations */
131 ND_CACHE_PROBE, /* ?? */
132 ND_CACHE_MAX
133 };
134
135struct icmp6_cache {
136 ip6_address ip;
137 eth_address eth;
138 WORD flags;
139 enum ND_cacheState state;
140 time_t expiry;
141 };
142
143#define ND_CACHE_SIZE 10
144
145extern DWORD icmp6_6to4_gateway;
146
147extern void icmp6_handler (const in6_Header *ip);
148extern void icmp6_unreach (const in6_Header *ip, int code);
149
150extern int icmp6_neigh_solic (const void *addr, eth_address *eth);
151extern int icmp6_neighbor_advert (const eth_address *eth);
152extern int icmp6_router_solicitation (void);
153extern BOOL icmp6_add_gateway4 (void);
154
155struct icmp6_cache *icmp6_ncache_lookup (const void *ip);
156struct icmp6_cache *icmp6_ncache_insert (const void *ip, const void *eth);
157struct icmp6_cache *icmp6_ncache_insert_fix (const void *ip, const void *eth);
158
159#endif
160
pack_off.h
icmp6_neigh_solic
int icmp6_neigh_solic(const void *addr, eth_address *eth)
Definition: pcicmp6.c:177
ICMP6_MTU
Definition: pcicmp6.h:54
ICMP6_echo
Definition: pcicmp6.h:63
ICMP6_nd_adv
Definition: pcicmp6.h:73
ICMP6_nd_ra
Definition: pcicmp6.h:88
ICMP6_nd_sol
Definition: pcicmp6.h:101
ICMP6_pointer
Definition: pcicmp6.h:45
ICMP6_route_adv
Definition: pcicmp6.h:30
ICMP6_route_sol
Definition: pcicmp6.h:21
ICMP6_unused
Definition: pcicmp6.h:6
code
Definition: zinftree.h:24
icmp6_cache
Definition: pcicmp6.h:135
in6_Header
Definition: wattcp.h:381
ICMP6_PKT
Definition: pcicmp6.h:111


Watt-32 tcp/ip: E:/WATT/src/pcicmp.c Source File

  • src
pcicmp.c
Go to the documentation of this file.
1
5#include <stdio.h>
6#include <stdlib.h>
7#include <string.h>
8
9#include "copyrigh.h"
10#include "wattcp.h"
11#include "language.h"
12#include "misc.h"
13#include "misc_str.h"
14#include "timer.h"
15#include "chksum.h"
16#include "ip4_in.h"
17#include "pctcp.h"
18#include "pcsed.h"
19#include "pcarp.h"
20#include "pcstat.h"
21#include "pcdbug.h"
22#include "pcqueue.h"
23#include "pcconfig.h"
24#include "pcpkt.h"
25#include "sock_ini.h"
26#include "netaddr.h"
27#include "ip4_out.h"
28#include "pcicmp.h"
29
30const char *icmp_type_str [ICMP_MAXTYPE+1] = {
31 __LANG("Echo Reply"), "1", "2",
32 __LANG("Destination Unreachable"),
33 __LANG("Source Quench"),
34 __LANG("Redirect"), "6", "7",
35 __LANG("Echo Request"),
36 __LANG("Router Advert"),
37 __LANG("Router Solic"),
38 __LANG("TTL exceeded"),
39 __LANG("Param Problem"),
40 __LANG("Timestamp Message"),
41 __LANG("Timestamp Reply"),
42 __LANG("Info Request"),
43 __LANG("Info Reply"),
44 __LANG("Mask Request"),
45 __LANG("Mask Reply")
46 };
47
48/* code-strings for type ICMP_UNREACH
49 */
50const char *icmp_unreach_str [16] = {
51 __LANG("Network Unreachable"), /* 0 */
52 __LANG("Host Unreachable"),
53 __LANG("Protocol Unreachable"), /* 2 */
54 __LANG("Port Unreachable"),
55 __LANG("Fragmentation needed and DF set"), /* 4 */
56 __LANG("Source Route Failed"),
57 __LANG("Network unknown"), /* 6 */
58 __LANG("Host unknown"),
59 __LANG("Source host isolated"), /* 8 */
60 __LANG("Net-access denied"),
61 __LANG("Host-access denied"), /* 10 */
62 __LANG("Bad TOS for net"),
63 __LANG("Bad TOS for host"), /* 12 */
64 __LANG("Admin prohibited"),
65 __LANG("Host precedence violation"), /* 14 */
66 __LANG("Precedence cutoff")
67 };
68
69/* code-strings for type ICMP_REDIRECT
70 */
71const char *icmp_redirect_str [4] = {
72 __LANG("Redirect for Network"),
73 __LANG("Redirect for Host"),
74 __LANG("Redirect for TOS and Network"),
75 __LANG("Redirect for TOS and Host")
76 };
77
78/* code-strings for type ICMP_TIMXCEED
79 */
80const char *icmp_exceed_str [2] = {
81 __LANG("TTL exceeded in transit"),
82 __LANG("Fragment reassembly time exceeded")
83 };
84
85W32_CLANG_PACK_WARN_OFF()
86
87#include <sys/pack_on.h>
88
91struct _pkt {
92 in_Header ip;
93 ICMP_PKT icmp;
94 in_Header data;
95 };
96
97#include <sys/pack_off.h>
98
99W32_CLANG_PACK_WARN_DEF()
100
101
103static struct {
104 char icmp;
105 char igmp;
106 char udp;
107 char tcp;
108 } do_redirect = { 1,1,1,1 };
109
110
111static void icmp_print (int dbg_lvl, const char *msg, DWORD src)
112{
113 if (debug_on < dbg_lvl)
114 return;
115
116 outs ("\nICMP: ");
117 if (src)
118 {
119 outs ("(");
120 outs (_inet_ntoa(NULL,intel(src)));
121 outs ("): ");
122 }
123 outsnl (_LANG(msg));
124}
125
130static void icmp_bogus (const in_Header *ip, int type, const char *msg)
131{
132 char buf[100];
133
134 strcpy (buf, _LANG("Bogus "));
135 strcat (buf, _LANG(icmp_type_str[type]));
136 if (msg)
137 strcat (buf, msg);
138 icmp_print (1, buf, ip->source);
139}
140
147static BOOL icmp_check (const in_Header *ip, int type)
148{
149 DWORD src, dst;
150 BOOL bcast;
151
152 src = intel (ip->source);
153 dst = intel (ip->destination);
154 bcast = (~src & ~sin_mask) == 0;
155
156 if (bcast)
157 {
158 icmp_bogus (ip, type, _LANG(" (broadcast)"));
159 return (FALSE);
160 }
161 if (ip->source == 0UL)
162 {
163 icmp_bogus (ip, type, _LANG(" (network)"));
164 return (FALSE);
165 }
166 if (IN_MULTICAST(dst))
167 {
168 icmp_bogus (ip, type, _LANG(" (multicast)"));
169 return (FALSE);
170 }
171 if (IN_EXPERIMENTAL(dst))
172 {
173 icmp_bogus (ip, type, _LANG(" (experimental)"));
174 return (FALSE);
175 }
176 return (TRUE);
177}
178
183static int icmp_send (struct _pkt *pkt, DWORD src, DWORD dest, int length)
184{
185 in_Header *ip = &pkt->ip;
186 ICMP_PKT *icmp = &pkt->icmp;
187
188 icmp->unused.checksum = 0;
189 icmp->unused.checksum = ~CHECKSUM (icmp, length);
190
191 return IP4_OUTPUT (ip, src, dest, ICMP_PROTO, 0, 0, 0, length, NULL);
192}
193
198int icmp_send_unreach (const in_Header *ip, int code)
199{
200 static DWORD next_time = 0UL;
201 struct _pkt *pkt;
202 union ICMP_PKT *unr;
203 unsigned len;
204
205 if (!icmp_check(ip,ICMP_UNREACH))
206 return (0);
207
208 if (next_time && !chk_timeout(next_time))
209 return (0);
210
211 next_time = set_timeout (50);
212
213 pkt = (struct _pkt*) _eth_formatpacket (MAC_SRC(ip), IP4_TYPE);
214 unr = &pkt->icmp;
215 len = intel16 (ip->length) - in_GetHdrLen (ip);
216 len = min (len, sizeof(*ip)+sizeof(unr->unused.spares));
217
218 icmp_print (1, _LANG(icmp_unreach_str[code]), ip->destination);
219 memcpy (&unr->unused.ip, ip, len);
220 unr->unused.type = ICMP_UNREACH;
221 unr->unused.code = (BYTE) code;
222
223 return icmp_send (pkt, ip->destination, ip->source, sizeof(unr->unused));
224}
225
229int icmp_send_timexceed (const in_Header *ip, const void *mac_dest)
230{
231 struct _pkt *pkt;
232 union ICMP_PKT *icmp;
233
234 if (!icmp_check(ip,ICMP_TIMXCEED))
235 return (0);
236
237 pkt = (struct _pkt*) _eth_formatpacket (mac_dest, IP4_TYPE);
238 icmp = &pkt->icmp;
239
240 icmp_print (1, icmp_exceed_str[1], ip->destination);
241
242 memset (&icmp->unused, 0, sizeof(icmp->unused));
243
244 icmp->unused.type = ICMP_TIMXCEED;
245 icmp->unused.code = 1;
246
247 icmp->unused.ip.hdrlen = sizeof(in_Header) / 4;
248 icmp->unused.ip.ver = 4;
249 icmp->unused.ip.ttl = _default_ttl;
250 icmp->unused.ip.identification = ip->identification;
251 icmp->unused.ip.length = intel16 (sizeof(in_Header));
252 icmp->unused.ip.proto = ip->proto;
253 icmp->unused.ip.checksum = ~CHECKSUM (&icmp->unused.ip, sizeof(in_Header));
254
255 return icmp_send (pkt, ip->destination, ip->source, sizeof(icmp->unused));
256}
257
262static WORD addr_mask_id = 0;
263static WORD addr_mask_seq = 0;
264
265int icmp_send_mask_req (void)
266{
267 mac_address *dst = (_pktserial ? NULL : &_eth_brdcast);
268 struct _pkt *pkt = (struct _pkt*) _eth_formatpacket (dst, IP4_TYPE);
269 union ICMP_PKT *icmp = &pkt->icmp;
270
271 addr_mask_id = (WORD) set_timeout (0); /* get a random ID */
272 icmp->mask.type = ICMP_MASKREQ;
273 icmp->mask.code = 0;
274 icmp->mask.identifier = addr_mask_id;
275 icmp->mask.sequence = addr_mask_seq++;
276 icmp->mask.mask = 0;
277 return icmp_send (pkt, 0, (DWORD)INADDR_BROADCAST, sizeof(icmp->mask));
278}
279
280static int icmp_echo_reply (const in_Header *ip, const union ICMP_PKT *req,
281 unsigned len)
282{
283 struct _pkt *pkt;
284 union ICMP_PKT *icmp;
285
286 if (!icmp_check(ip,ICMP_ECHO))
287 return (0);
288
289 icmp_print (2, _LANG("PING reply sent"), 0);
290
291#if defined(USE_FRAGMENTS)
292 if (len > _mtu - sizeof(*ip))
293 {
294 icmp = (union ICMP_PKT*) req; /* reuse input for output */
295 icmp->echo.type = ICMP_ECHOREPLY;
296 icmp->echo.checksum = 0;
297 icmp->echo.checksum = ~CHECKSUM (icmp, len);
298 return _IP4_SEND_FRAGMENTS (NULL, ICMP_PROTO, ip->source, icmp, len);
299 }
300#endif
301
302 pkt = (struct _pkt*) _eth_formatpacket (MAC_SRC(ip), IP4_TYPE);
303 icmp = &pkt->icmp;
304
305 len = min (len, _mtu - sizeof(*ip));
306 memcpy (icmp, req, len);
307 icmp->echo.type = ICMP_ECHOREPLY;
308 icmp->echo.code = req->echo.code; /* Win uses 0, Unix !0 */
309
310 /* Use supplied ip values in case we ever multi-home.
311 * Note that ip values are still in network order.
312 */
313 return icmp_send (pkt, ip->destination, ip->source, len);
314}
315
319static void icmp_redirect (const union ICMP_PKT *icmp, const in_Header *ip,
320 const in_Header *orig_ip, int code)
321{
322 DWORD new_ip = intel (icmp->ip.ipaddr);
323 DWORD old_ip = intel (orig_ip->destination);
324 const char *msg;
325
326 if (new_ip == old_ip)
327 {
328 /* Possibly because we and router use different netmasks
329 */
330 }
331 else if ((new_ip ^ my_ip_addr) & sin_mask) /* new host not on subnet */
332 {
333 char buf[100];
334
335 strcpy (buf, ", GW = ");
336 strcat (buf, _inet_ntoa(NULL,new_ip));
337 icmp_bogus (ip, ICMP_REDIRECT, buf);
338 return;
339 }
340
341 msg = icmp_redirect_str[code];
342 icmp_print (1, msg, ip->source);
343
344 switch (orig_ip->proto)
345 {
346#if !defined(USE_UDP_ONLY)
347 case TCP_PROTO:
348 if (do_redirect.tcp) /* do it to some socket */
349 _tcp_cancel (orig_ip, ICMP_REDIRECT, code, msg, &new_ip);
350 break;
351#endif
352 case UDP_PROTO:
353 if (do_redirect.udp)
354 _udp_cancel (orig_ip, ICMP_REDIRECT, code, msg, &new_ip);
355 break;
356
357 case ICMP_PROTO:
358 if (do_redirect.icmp)
359 {
360 /* _ip_recursion = TRUE; !! */
361 _arp_register (new_ip, old_ip);
362 /* _ip_recursion = FALSE; !! */
363 }
364 break;
365
366 case IGMP_PROTO:
367 if (do_redirect.igmp)
368 {
369 /* _ip_recursion = TRUE; !! */
370 _arp_register (new_ip, old_ip);
371 /* _ip_recursion = FALSE; !! */
372 }
373 break;
374 }
375}
376
380void icmp_handler (const in_Header *ip, BOOL broadcast)
381{
382 union ICMP_PKT *icmp;
383 const in_Header *orig_ip;
384 int type, code;
385 unsigned len;
386 DWORD delta_time;
387 BOOL for_me, i_orig; /* is it for me, did I originate it */
388 const char *msg;
389
390 DEBUG_RX (NULL, ip);
391
392 if (block_icmp) /* application is handling ICMP on it's own; exit now */
393 return;
394
395 len = in_GetHdrLen (ip);
396 icmp = (union ICMP_PKT*) ((BYTE*)ip + len);
397 len = intel16 (ip->length) - len;
398 for_me = _ip4_is_multihome_addr (intel(ip->destination));
399
400 if (!for_me || broadcast) /* drop broadcast pings.. */
401 return;
402
403 if (len < sizeof(icmp->info))
404 {
405 STAT (icmpstats.icps_tooshort++);
406 return;
407 }
408
409 if (CHECKSUM(icmp,len) != 0xFFFF)
410 {
411 STAT (icmpstats.icps_checksum++);
412 icmp_print (1, _LANG("bad checksum"), ip->source);
413 return;
414 }
415
416 type = icmp->unused.type;
417 code = icmp->unused.code;
418 orig_ip = &icmp->ip.ip;
419 i_orig = _ip4_is_local_addr (intel(orig_ip->source));
420
421 if (type == ICMP_MASKREPLY)
422 {
423 if (!_do_mask_req)
424 return;
425 i_orig = TRUE;
426 }
427
428 /* !! this needs work
429 */
430 if (!i_orig &&
431 (type != ICMP_ECHOREPLY && type != ICMP_ECHO &&
432 type != ICMP_IREQREPLY && type != ICMP_TSTAMP))
433 {
434 icmp_bogus (ip, type, NULL);
435 return;
436 }
437
438 switch (type)
439 {
440 case ICMP_ECHOREPLY: /* check if we were waiting for it */
441 delta_time = set_timeout(0) - icmp->echo.identifier;
442 add_ping (intel(ip->source), delta_time, icmp->echo.index);
443 return;
444
445 case ICMP_UNREACH:
446 if (code < DIM(icmp_unreach_str))
447 {
448 UINT len_needed = 8 + in_GetHdrLen (orig_ip);
449 WORD next_mtu = 0;
450
451 msg = _LANG (icmp_unreach_str[code]);
452 icmp_print (1, msg, ip->source);
453
454 if (orig_ip->proto == TCP_PROTO ||
455 orig_ip->proto == UDP_PROTO)
456 len_needed += 4; /* Need the src/dest port numbers */
457
458 if (len >= len_needed)
459 {
460 if (code == ICMP_UNREACH_NEEDFRAG)
461 next_mtu = intel16 (icmp->needfrag.next_mtu);
462
463#if !defined(USE_UDP_ONLY)
464 if (orig_ip->proto == TCP_PROTO)
465 _tcp_cancel (orig_ip, ICMP_UNREACH, code, msg, &next_mtu);
466 else
467#endif
468 if (orig_ip->proto == UDP_PROTO)
469 _udp_cancel (orig_ip, ICMP_UNREACH, code, msg, &next_mtu);
470
472#if defined(USE_BSD_API) && 0
473 else
474 _raw_cancel (orig_ip, ICMP_UNREACH, code, msg);
475#endif
476 }
477 else
478 STAT (icmpstats.icps_tooshort++);
479 }
480 else
481 STAT (icmpstats.icps_badcode++);
482 return;
483
484 case ICMP_SOURCEQUENCH:
485#if !defined(USE_UDP_ONLY)
486 if (orig_ip->proto == TCP_PROTO)
487 {
488 msg = _LANG (icmp_type_str[type]);
489 icmp_print (1, msg, ip->source);
490 _tcp_cancel (orig_ip, ICMP_SOURCEQUENCH, code, msg, NULL);
491 }
492#endif
493 return;
494
495 case ICMP_REDIRECT:
496 if (code < DIM(icmp_redirect_str))
497 icmp_redirect (icmp, ip, orig_ip, code);
498 else STAT (icmpstats.icps_badcode++);
499 return;
500
501 case ICMP_ECHO:
502 icmp_print (2, _LANG("PING requested of us"), ip->source);
503 icmp_echo_reply (ip, icmp, len);
504 return;
505
506 case ICMP_TIMXCEED:
507 if (code >= DIM(icmp_exceed_str))
508 {
509 STAT (icmpstats.icps_badcode++);
510 return;
511 }
512 if (code == 0) /* "TTL exceeded in transit" */
513 switch (orig_ip->proto)
514 {
515#if !defined(USE_UDP_ONLY)
516 case TCP_PROTO:
517 msg = _LANG (icmp_exceed_str[0]);
518 icmp_print (1, msg, ip->source);
519 _tcp_cancel (orig_ip, ICMP_TIMXCEED, code, msg, NULL);
520 break;
521#endif
522 case UDP_PROTO:
523 msg = _LANG (icmp_exceed_str[0]);
524 icmp_print (1, msg, ip->source);
525 _udp_cancel (orig_ip, ICMP_TIMXCEED, code, msg, NULL);
526 break;
527 }
528 return;
529
530 case ICMP_PARAMPROB:
531 msg = _LANG (icmp_type_str[ICMP_PARAMPROB]);
532 switch (orig_ip->proto)
533 {
534#if !defined(USE_UDP_ONLY)
535 case TCP_PROTO:
536 icmp_print (0, msg, ip->source);
537 _tcp_cancel (orig_ip, ICMP_PARAMPROB, code, msg, NULL);
538 break;
539#endif
540 case UDP_PROTO:
541 icmp_print (0, msg, ip->source);
542 _udp_cancel (orig_ip, ICMP_PARAMPROB, code, msg, NULL);
543 break;
544 }
545 return;
546
547 case ICMP_ROUTERADVERT:
548 msg = _LANG (icmp_type_str[ICMP_ROUTERADVERT]);
549 icmp_print (1, msg, ip->source);
550 return;
551
552 case ICMP_ROUTERSOLICIT:
553 msg = _LANG (icmp_type_str[ICMP_ROUTERSOLICIT]);
554 icmp_print (1, msg, ip->source);
555 return;
556
557 case ICMP_TSTAMP:
558 msg = _LANG (icmp_type_str[ICMP_TSTAMP]);
559 icmp_print (1, msg, ip->source);
561 return;
562
563 case ICMP_TSTAMPREPLY:
564 msg = _LANG (icmp_type_str[ICMP_TSTAMPREPLY]);
565 icmp_print (1, msg, ip->source);
567 return;
568
569 case ICMP_IREQ:
570 msg = _LANG (icmp_type_str[ICMP_IREQ]);
571 icmp_print (1, msg, ip->source);
573 return;
574
575 case ICMP_IREQREPLY:
576 msg = _LANG (icmp_type_str[ICMP_IREQREPLY]);
577 icmp_print (1, msg, ip->source);
579 return;
580
581 case ICMP_MASKREQ:
582 /* might be sent by us, never answer */
583 break;
584
585 case ICMP_MASKREPLY:
586 msg = _LANG (icmp_type_str[ICMP_MASKREPLY]);
587 icmp_print (0, msg, ip->source);
588 if ((icmp->mask.identifier == addr_mask_id) &&
589 (icmp->mask.sequence == addr_mask_seq-1) &&
590 sin_mask != intel(icmp->mask.mask))
591 outsnl ("Conflicting net-mask from \"ICMP Addr Mask Reply\"\7");
592 addr_mask_id = 0;
593 return;
594 }
595}
596
601void icmp_doredirect (const char *value)
602{
603 char *val = strdup (value);
604
605 if (val)
606 {
607 strupr (val);
608 do_redirect.icmp = (strstr(val,"ICMP") != NULL);
609 do_redirect.igmp = (strstr(val,"IGMP") != NULL);
610 do_redirect.udp = (strstr(val,"UDP") != NULL);
611 do_redirect.tcp = (strstr(val,"TCP") != NULL);
612 free (val);
613 }
614}
chksum.h
copyrigh.h
ip4_in.h
_default_ttl
int _default_ttl
Definition: ip4_out.c:54
ip4_out.h
language.h
misc.h
misc_str.h
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
pack_off.h
_arp_register
BOOL W32_CALL _arp_register(DWORD use_this_gateway_ip, DWORD for_this_host_ip)
Register a new host as gateway.
Definition: pcarp.c:842
pcarp.h
pcconfig.h
pcdbug.h
addr_mask_id
static WORD addr_mask_id
Send an ICMP Address Mask Request as link-layer + IP broadcast.
Definition: pcicmp.c:262
icmp_send_timexceed
int icmp_send_timexceed(const in_Header *ip, const void *mac_dest)
Send an "ICMP Time Exceeded" (reassebly timeout) back to 'ip->source'.
Definition: pcicmp.c:229
icmp_check
static BOOL icmp_check(const in_Header *ip, int type)
Check if ip-source is a (directed) broadcast address.
Definition: pcicmp.c:147
icmp_redirect
static void icmp_redirect(const union ICMP_PKT *icmp, const in_Header *ip, const in_Header *orig_ip, int code)
Handle ICMP_REDIRECT messages.
Definition: pcicmp.c:319
icmp_handler
void icmp_handler(const in_Header *ip, BOOL broadcast)
Handler for incoming ICMP packets.
Definition: pcicmp.c:380
icmp_doredirect
void icmp_doredirect(const char *value)
Determine which protocols we shall act upon when ICMP redirect is received.
Definition: pcicmp.c:601
icmp_send_unreach
int icmp_send_unreach(const in_Header *ip, int code)
Send an ICMP destination/protocol unreachable back to 'ip->source'.
Definition: pcicmp.c:198
icmp_send
static int icmp_send(struct _pkt *pkt, DWORD src, DWORD dest, int length)
Format and send a ICMP packet.
Definition: pcicmp.c:183
icmp_bogus
static void icmp_bogus(const in_Header *ip, int type, const char *msg)
Print info about bogus and possibly dangerous ICMP messages.
Definition: pcicmp.c:130
pcicmp.h
add_ping
void W32_CALL add_ping(DWORD host, DWORD time, DWORD number)
Add an ICMP echo reply to the ping-cache.
Definition: pcping.c:147
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
pcpkt.h
pcqueue.h
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
_eth_brdcast
mac_address _eth_brdcast
Link-layer broadcast address.
Definition: pcsed.c:50
pcsed.h
pcstat.h
_tcp_cancel
void _tcp_cancel(const in_Header *ip, int icmp_type, int icmp_code, const char *msg, const void *arg)
Cancel a TCP socket.
Definition: pctcp.c:1734
block_icmp
BOOL block_icmp
when application handles ICMP itself
Definition: pctcp.c:66
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
_udp_cancel
void _udp_cancel(const in_Header *ip, int icmp_type, int icmp_code, const char *msg, const void *arg)
Cancel an UDP socket.
Definition: pctcp.c:1628
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
pctcp.h
_do_mask_req
BOOL _do_mask_req
do an "ICMP Mask Request" when configured
Definition: sock_ini.c:133
sock_ini.h
_pkt
Definition: pcicmp.c:85
code
Definition: zinftree.h:24
do_redirect
Definition: pcicmp.c:99
icmp
Definition: ip_icmp.h:66
in_Header
Definition: wattcp.h:329
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
ICMP_PKT
Definition: pcicmp.h:126
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcicmp.h Source File

  • src
pcicmp.h
Go to the documentation of this file.
1
3#ifndef _w32_PCICMP_H
4#define _w32_PCICMP_H
5
6W32_CLANG_PACK_WARN_OFF()
7
8#include <sys/pack_on.h>
9
10/* When passing thise file throght swig:
11 * Warning 314: 'in' is a python keyword, renaming to '_in'
12 *
13 * Triggered by the below "in_Header in;"
14 */
15#ifdef SWIG
16#define in _in
17#endif
18
22struct ICMP_unused {
23 BYTE type;
24 BYTE code;
25 WORD checksum;
26 DWORD unused;
27 in_Header ip;
28 BYTE spares [8];
29 };
30
33struct ICMP_pointer {
34 BYTE type;
35 BYTE code;
36 WORD checksum;
37 BYTE pointer;
38 BYTE unused [3];
39 in_Header ip;
40 };
41
45struct ICMP_ip {
46 BYTE type;
47 BYTE code;
48 WORD checksum;
49 DWORD ipaddr; /* redirect gateway */
50 in_Header ip; /* original ip-header */
51 };
52
55struct ICMP_echo {
56 BYTE type;
57 BYTE code;
58 WORD checksum;
59 WORD identifier;
60 WORD sequence;
61 DWORD index;
62 };
63
66struct ICMP_timestamp {
67 BYTE type;
68 BYTE code;
69 WORD checksum;
70 WORD identifier;
71 WORD sequence;
72 DWORD original; /* original timestamp */
73 DWORD receive; /* receive timestamp */
74 DWORD transmit; /* transmit timestamp */
75 };
76
79struct ICMP_info {
80 BYTE type;
81 BYTE code;
82 WORD checksum;
83 WORD identifier;
84 WORD sequence;
85 };
86
89struct ICMP_addr_mask {
90 BYTE type;
91 BYTE code;
92 WORD checksum;
93 WORD identifier;
94 WORD sequence;
95 DWORD mask;
96 };
97
100struct ICMP_traceroute {
101 BYTE type;
102 BYTE code;
103 WORD checksum;
104 WORD identifier;
105 WORD unused;
106 WORD outbound_hop;
107 WORD return_hop;
108 DWORD link_speed;
109 DWORD link_mtu;
110 };
111
112
116struct ICMP_needfrag {
117 BYTE type;
118 BYTE code;
119 WORD checksum;
120 WORD unused; /* 32-bit 0 here for router that doesn't support RFC-1191 */
121 WORD next_mtu;
122 };
123
126typedef union ICMP_PKT {
127 struct ICMP_unused unused;
128 struct ICMP_pointer pointer;
129 struct ICMP_ip ip;
130 struct ICMP_echo echo;
131 struct ICMP_timestamp timestamp;
132 struct ICMP_info info;
133 struct ICMP_addr_mask mask;
134 struct ICMP_traceroute tracert;
135 struct ICMP_needfrag needfrag;
136 } ICMP_PKT;
137
141struct ping_pkt {
142 in_Header in;
143 struct ICMP_echo icmp;
144 /* BYTE data[]; */
145 };
146
147#include <sys/pack_off.h>
148
149 W32_CLANG_PACK_WARN_DEF()
150
151
154#define ICMP_ECHOREPLY 0
155#define ICMP_UNREACH 3
156#define ICMP_SOURCEQUENCH 4
157#define ICMP_REDIRECT 5
158#define ICMP_ECHO 8
159#define ICMP_ROUTERADVERT 9
160#define ICMP_ROUTERSOLICIT 10
161#define ICMP_TIMXCEED 11
162#define ICMP_PARAMPROB 12
163#define ICMP_TSTAMP 13
164#define ICMP_TSTAMPREPLY 14
165#define ICMP_IREQ 15
166#define ICMP_IREQREPLY 16
167#define ICMP_MASKREQ 17
168#define ICMP_MASKREPLY 18
170#ifndef ICMP_MAXTYPE
171#define ICMP_MAXTYPE 18
172#endif
173
174
175/*
176 * ICMP_UNREACH codes. E.g. 'struct ICMP_unused::code'.
177 */
178#define ICMP_UNREACH_NET 0
179#define ICMP_UNREACH_HOST 1
180#define ICMP_UNREACH_PROTOCOL 2
181#define ICMP_UNREACH_PORT 3
182#define ICMP_UNREACH_NEEDFRAG 4
183#define ICMP_UNREACH_SRCFAIL 5
184#define ICMP_UNREACH_NET_UNKNOWN 6
185#define ICMP_UNREACH_HOST_UNKNOWN 7
186#define ICMP_UNREACH_ISOLATED 8
187#define ICMP_UNREACH_NET_PROHIB 9
188#define ICMP_UNREACH_HOST_PROHIB 10
189#define ICMP_UNREACH_TOSNET 11
190#define ICMP_UNREACH_TOSHOST 12
191#define ICMP_UNREACH_FILTER_PROHIB 13
192#define ICMP_UNREACH_HOST_PRECEDENCE 14
193#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15
194
195extern const char *icmp_type_str [ICMP_MAXTYPE+1];
196extern const char *icmp_unreach_str [16];
197extern const char *icmp_redirect_str [4];
198extern const char *icmp_exceed_str [2];
199
200extern void icmp_handler (const in_Header *ip, BOOL broadcast);
201extern void icmp_doredirect (const char *value);
202extern int icmp_send_timexceed (const in_Header *ip, const void *mac_dest);
203extern int icmp_send_unreach (const in_Header *ip, int code);
204extern int icmp_send_mask_req (void);
205
206#endif
pack_off.h
icmp_send_timexceed
int icmp_send_timexceed(const in_Header *ip, const void *mac_dest)
Send an "ICMP Time Exceeded" (reassebly timeout) back to 'ip->source'.
Definition: pcicmp.c:229
W32_CLANG_PACK_WARN_DEF
W32_CLANG_PACK_WARN_DEF() extern const char *icmp_type_str[ICMP_MAXTYPE+1]
These are the ICMP messages.
icmp_handler
void icmp_handler(const in_Header *ip, BOOL broadcast)
Handler for incoming ICMP packets.
Definition: pcicmp.c:380
icmp_doredirect
void icmp_doredirect(const char *value)
Determine which protocols we shall act upon when ICMP redirect is received.
Definition: pcicmp.c:601
icmp_send_unreach
int icmp_send_unreach(const in_Header *ip, int code)
Send an ICMP destination/protocol unreachable back to 'ip->source'.
Definition: pcicmp.c:198
ICMP_addr_mask
Definition: pcicmp.h:89
ICMP_echo
Definition: pcicmp.h:55
ICMP_info
Definition: pcicmp.h:79
ICMP_ip
Definition: pcicmp.h:45
ICMP_needfrag
Definition: pcicmp.h:116
ICMP_pointer
Definition: pcicmp.h:33
ICMP_timestamp
Definition: pcicmp.h:66
ICMP_traceroute
Definition: pcicmp.h:100
ICMP_unused
Definition: pcicmp.h:6
code
Definition: zinftree.h:24
icmp
Definition: ip_icmp.h:66
in_Header
Definition: wattcp.h:329
ping_pkt
Definition: pcicmp.h:141
ICMP_PKT
Definition: pcicmp.h:126


Watt-32 tcp/ip: E:/WATT/src/pcigmp.c Source File

  • src
pcigmp.c
Go to the documentation of this file.
1
19#include <stdio.h>
20
21#include "copyrigh.h"
22#include "wattcp.h"
23#include "misc.h"
24#include "misc_str.h"
25#include "run.h"
26#include "timer.h"
27#include "chksum.h"
28#include "ip4_in.h"
29#include "ip4_out.h"
30#include "netaddr.h"
31#include "pcconfig.h"
32#include "pcpkt.h"
33#include "pcsed.h"
34#include "pctcp.h"
35#include "pcdbug.h"
36#include "pcstat.h"
37#include "pcigmp.h"
38
39/*
40 * Application must set this to non-zero before calling watt_sock_init().
41 * Not needed if using the BSD-socket API. Set for mcast options in
42 * setsockopt().
43 */
44int _multicast_on = 0;
45int _multicast_intvl = 0; /* Send a report every x sec when idling */
46
47#if defined(USE_MULTICAST)
48
49W32_CLANG_PACK_WARN_OFF()
50
51#include <sys/pack_on.h>
52
53struct IGMP_PKT {
54 in_Header in;
55 IGMPv1_packet igmp;
56 };
57
58#include <sys/pack_off.h>
59
60 W32_CLANG_PACK_WARN_DEF()
61
62#define ETH_MULTI 0x01005EUL
63#define CLASS_D_MASK 0xE0000000UL
64#define IPMULTI_MASK 0x007FFFFFUL
66static struct MultiCast mcast_list [IPMULTI_SIZE];
67static BOOL daemon_on = FALSE;
68
69static void W32_CALL check_mcast_reports (void);
70
71/*
72 * Check the LSB bit 0 of ether destination address.
73 */
74static __inline BOOL is_eth_multicast (const in_Header *ip)
75{
76 const BYTE *eth_dst;
77
78 /* How could this happen? Assume yes anyway
79 */
80 if (_pktdevclass != PDCLASS_ETHER)
81 return (TRUE);
82 eth_dst = (const BYTE*) MAC_DST (ip);
83 return (eth_dst[0] & 1); /* LSB=1 is mcast */
84}
85
86/*
87 * Calculates the proper ethernet address for a given
88 * IP Multicast address.
89 *
90 * Where:
91 * ip: IP address to be converted
92 * eth: pointer to ethernet MAC address
93 */
94int W32_CALL multi_to_eth (DWORD ip, eth_address *mac)
95{
96 DWORD top = ETH_MULTI;
97 BYTE *eth = (BYTE*)mac;
98
99 ip &= IPMULTI_MASK;
100 eth[0] = (BYTE) (top >> 16);
101 eth[1] = (BYTE) ((top >> 8) & 0xFF);
102 eth[2] = (BYTE) (top & 0xFF);
103 eth[3] = (BYTE) (ip >> 16);
104 eth[4] = (BYTE) ((ip >> 8) & 0xFF);
105 eth[5] = (BYTE) (ip & 0xFF);
106 return (1);
107}
108
109/*
110 * Joins a multicast group
111 *
112 * Where:
113 * ip - address of the group to be joined (host order)
114 * Returns:
115 * 1 - if the group was joined successfully
116 * 0 - if attempt failed
117 */
118int W32_CALL join_mcast_group (DWORD ip)
119{
120 struct MultiCast *mc;
121 int i;
122
123 if (!_multicast_on)
124 return (0);
125
126 /* first verify that it's a valid mcast address
127 */
128 if (!_ip4_is_multicast(ip))
129 {
130 TRACE_CONSOLE (1, "%s isn't a multicast address\n", _inet_ntoa(NULL,ip));
131 return (0);
132 }
133
134 if (!daemon_on)
135 DAEMON_ADD (check_mcast_reports);
136 daemon_on = TRUE;
137
138 /* Determine if the group has already been joined.
139 * As well as what the first free slot is.
140 */
141 for (i = 0, mc = mcast_list; i < DIM(mcast_list); i++, mc++)
142 {
143 if (mc->active && mc->ip == ip)
144 {
145 if (mc->processes < 255)
146 mc->processes++;
147 return (1);
148 }
149 if (!mc->active)
150 break;
151 }
152
153 /* alas, no...we need to join it
154 */
155 if (i >= DIM(mcast_list)) /* out of slots! */
156 return (0);
157
158 /* Fill in the hardware address
159 */
160 multi_to_eth (ip, &mc->ethaddr);
161
162 if (!_eth_join_mcast_group(mc))
163 return (0);
164
165 mc->active = TRUE;
166 mc->ip = ip;
167 mc->reply_timer = set_timeout (0); /* report ASAP */
168 mc->processes = 1;
169 return (1);
170}
171
172/*
173 * Leaves a multicast group
174 *
175 * Where:
176 * ip - address of the group to be joined
177 * Returns:
178 * 1 - if the group was left successfully
179 * 0 - if attempt failed
180 */
181int W32_CALL leave_mcast_group (DWORD ip)
182{
183 struct MultiCast *mc;
184 int i, rc, num_total = 0;
185
186 if (!_multicast_on)
187 return (0);
188
189 /* first verify that it's a valid mcast address
190 */
191 if (!_ip4_is_multicast(ip))
192 {
193 TRACE_CONSOLE (1, "%s isn't a multicast address\n", _inet_ntoa(NULL,ip));
194 return (0);
195 }
196
197 /* Determine if the group has more than one interested
198 * process. If so, then just decrement ref-count and return
199 */
200 for (i = 0, mc = mcast_list; i < DIM(mcast_list); i++, mc++)
201 {
202 if (!mc->active)
203 continue;
204
205 num_total++;
206 if (mc->ip != ip)
207 continue;
208
209 if (mc->processes > 1)
210 {
211 mc->processes--;
212 return (1);
213 }
214 break;
215 }
216
217 /* did the IP-addr they gave match anything in mcast_list ??
218 */
219 if (i >= DIM(mcast_list))
220 return (0);
221
222 /* alas...we need to physically leave it
223 */
224 rc = _eth_leave_mcast_group (mc);
225 mc->active = FALSE;
226
227 /* Remove daemon if no longer needed
228 */
229 if (num_total <= 1)
230 {
231 daemon_on = FALSE;
232 DAEMON_DEL (check_mcast_reports);
233 }
234 return (rc);
235}
236
237/*
238 * Count number of active multicast groups
239 */
240int W32_CALL num_mcast_active (void)
241{
242 int i, num = 0;
243
244 for (i = 0; i < DIM(mcast_list); i++)
245 if (mcast_list[i].active)
246 num++;
247 return (num);
248}
249
250/*
251 * Handles the incoming IGMP packets
252 *
253 * Where:
254 * ip - the IP packet in question
255 */
256void igmp_handler (const in_Header *ip, BOOL broadcast)
257{
258 BYTE i;
259 DWORD src_ip, host;
260 BOOL found = FALSE;
261 WORD len = in_GetHdrLen (ip);
262 const IGMPv1_packet *igmp = (const IGMPv1_packet*) ((BYTE*)ip + len);
263 struct MultiCast *mc;
264
265 DEBUG_RX (NULL, ip);
266
267 if (igmp->version != IGMP_VERSION_1) /* We only speak v1 */
268 return;
269
270 len = intel16 (ip->length) - len;
271 if (len < sizeof(*igmp))
272 {
273 STAT (igmpstats.igps_rcv_tooshort++);
274 return;
275 }
276
277 if (CHECKSUM(igmp,sizeof(*igmp)) != 0xFFFF)
278 {
279 STAT (igmpstats.igps_rcv_badsum++);
280 return;
281 }
282
283 host = intel (igmp->address);
284 src_ip = intel (ip->source);
285
286 /* drop our own looped packets
287 */
288 if (_ip4_is_local_addr(src_ip))
289 return;
290
291 /* Determine whether this is a report or a query
292 */
293 switch (igmp->type)
294 {
295 case IGMPv1_QUERY:
296 STAT (igmpstats.igps_rcv_queries++);
297 for (i = 0, mc = mcast_list; i < DIM(mcast_list); i++, mc++)
298 if (mc->active && mc->reply_timer == 0UL &&
299 mc->ip != MCAST_ALL_SYST)
300 {
301 mc->reply_timer = set_timeout (Random(500,1000));
302 found = TRUE;
303 }
304 if (!found && !broadcast && !is_eth_multicast(ip))
305 STAT (igmpstats.igps_rcv_badqueries++);
306 break;
307
308 case IGMPv1_REPORT:
309 STAT (igmpstats.igps_rcv_reports++);
310 for (i = 0, mc = mcast_list; i < DIM(mcast_list); i++, mc++)
311 if (mc->active && mc->ip == host &&
312 host != MCAST_ALL_SYST)
313 {
314 mc->reply_timer = 0UL;
315 found = TRUE;
316 STAT (igmpstats.igps_rcv_ourreports++);
317 break;
318 }
319 if (!found && !broadcast && !is_eth_multicast(ip))
320 STAT (igmpstats.igps_rcv_badreports++);
321 break;
322
323 default:
324 break;
325 }
326}
327
328/*
329 * Send a IGMPv1 Report packet
330 *
331 * Where:
332 * ip is the IP address to report (on host order).
333 *
334 * Returns:
335 * 0 - if unable to send report
336 * 1 - report was sent successfully
337 */
338static int igmp_report (DWORD ip)
339{
340 struct IGMP_PKT *pkt;
341 struct IGMPv1_packet *igmp;
342 eth_address eth;
343
344 /* get the ethernet addr of the destination
345 */
346 multi_to_eth (MCAST_ALL_SYST, &eth);
347
348 /* format the packet with the request's hardware address
349 */
350 pkt = (struct IGMP_PKT*) _eth_formatpacket (eth, IP4_TYPE);
351 igmp = &pkt->igmp;
352 ip = intel (ip);
353
354 /* fill in the igmp packet
355 */
356 igmp->type = IGMPv1_REPORT;
357 igmp->version = IGMP_VERSION_1;
358 igmp->unused = 0;
359 igmp->address = ip;
360 igmp->checksum = 0;
361 igmp->checksum = ~CHECKSUM (igmp, sizeof(*igmp));
362
363 return IP4_OUTPUT (&pkt->in, 0, ip, IGMP_PROTO,
364 0, 0, 0, sizeof(*igmp), NULL);
365}
366
367/*
368 * Check to see if we owe any IGMP Reports
369 * Called as a daemon from tcp_tick()
370 */
371static void W32_CALL check_mcast_reports (void)
372{
373 struct MultiCast *mc;
374 int i;
375
376 if (!_multicast_on)
377 return;
378
379 for (i = 0, mc = mcast_list; i < DIM(mcast_list); i++, mc++)
380 {
381 if (!mc->active || mc->ip == MCAST_ALL_SYST || !chk_timeout(mc->reply_timer))
382 continue;
383
384 mc->reply_timer = _multicast_intvl > 0 ?
385 set_timeout (1000 * _multicast_intvl) : 0UL;
386 igmp_report (mc->ip);
387 }
388}
389#endif /* USE_MULTICAST */
390
chksum.h
copyrigh.h
ip4_in.h
ip4_out.h
Random
unsigned W32_CALL Random(unsigned a, unsigned b)
Returns a random integer in range [a..b].
Definition: misc.c:743
misc.h
misc_str.h
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
pack_off.h
pcconfig.h
pcdbug.h
W32_CLANG_PACK_WARN_DEF
W32_CLANG_PACK_WARN_DEF() static struct MultiCast mcast_list[IPMULTI_SIZE]
This hook is to prevent the BSD-socket API being linked in by default.
Definition: pcsed.h:261
pcigmp.h
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
pcpkt.h
_eth_join_mcast_group
BOOL _eth_join_mcast_group(const struct MultiCast *mc)
Joins a multicast group (at the physical layer).
Definition: pcsed.c:1204
_eth_leave_mcast_group
BOOL _eth_leave_mcast_group(const struct MultiCast *mc)
Leaves a multicast group (at the physical layer)
Definition: pcsed.c:1278
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
pcsed.h
pcstat.h
pctcp.h
IGMPv1_packet
Definition: pcigmp.h:23
MultiCast
Multicast internal structure.
Definition: pcigmp.h:104
MultiCast::active
BOOL active
is this an active entry
Definition: pcigmp.h:109
MultiCast::ethaddr
eth_address ethaddr
Ethernet address of group.
Definition: pcigmp.h:106
MultiCast::ip
DWORD ip
IP address of group.
Definition: pcigmp.h:105
MultiCast::processes
BYTE processes
number of interested processes
Definition: pcigmp.h:107
MultiCast::reply_timer
DWORD reply_timer
IGMP query reply timer.
Definition: pcigmp.h:108
in_Header
Definition: wattcp.h:329
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcigmp.h Source File

  • src
pcigmp.h
Go to the documentation of this file.
1
3#ifndef _w32_PCMULTI_H
4#define _w32_PCMULTI_H
5
10typedef struct IGMPv0_packet {
11 BYTE type;
12 BYTE code;
13 WORD checksum;
14 WORD ident;
15 DWORD address;
16 DWORD access_key;
17 } IGMPv0_packet;
18
23typedef struct IGMPv1_packet {
24 int type : 4;
25 int version : 4;
26 BYTE unused;
27 WORD checksum;
28 DWORD address;
29 } IGMPv1_packet;
30
35typedef struct IGMPv2_packet {
36 BYTE type;
37 BYTE max_resp;
38 WORD checksum;
39 DWORD address;
40 } IGMPv2_packet;
41
46typedef struct IGMPv3_packet {
47 BYTE type;
48 BYTE max_resp;
49 WORD checksum;
50 DWORD address;
51 int QRV : 3;
52 int s_bit : 1;
53 int resv : 4;
54 BYTE QQIC;
55 WORD num_src;
56 DWORD src_addr; /* \todo: Fixme; array of IPs */
57 } IGMPv3_packet;
58
59
60#define IGMP_VERSION_1 1
61#define IGMP_VERSION_2 2
62
63/* 'type' field for IGMP v0 */
64#define IGMPv0_CG_REQUEST 1
65#define IGMPv0_CG_REPORT 2
66#define IGMPv0_JG_REQUEST 3
67#define IGMPv0_JG_REPLY 4
68#define IGMPv0_LG_REQUEST 5
69#define IGMPv0_LG_REPLY 6
70#define IGMPv0_CONFIRM_REQUEST 7
71#define IGMPv0_CONFIRM_REPLY 8
72
73/* 'type' field for IGMP v1 */
74#define IGMPv1_QUERY 1
75#define IGMPv1_REPORT 2
76#define IGMPv1_DVMRP 3
77
78/* 'type' field for IGMP v2 */
79#define IGMPv2_MEMB_QUERY 0x11
80#define IGMPv2_MEMB_v1_REPORT 0x12
81#define IGMPv2_DVMRP 0x13
82#define IGMPv2_PIMv1 0x14
83
84/* etc, etc... */
85
86/* 'type' field for IGMP v3 */
87#define IGMPv3_QUERY 0x11
88#define IGMPv3_REPORT 0x22
89#define IGMPv3_MEMB_v1_REPORT 0x12
90#define IGMPv3_MEMB_v2_REPORT 0x16
91#define IGMPv3_LEAVE 0x17
92
93#if defined(USE_MULTICAST)
97 #define IPMULTI_SIZE 20
98 #define MCAST_ALL_SYST 0xE0000001UL
104 struct MultiCast {
105 DWORD ip;
106 eth_address ethaddr;
107 BYTE processes;
108 DWORD reply_timer;
109 BOOL active;
110 };
111
112 extern void igmp_handler (const in_Header *ip, BOOL brdcast);
113#endif
114#endif
IGMPv0_packet
Definition: pcigmp.h:10
IGMPv1_packet
Definition: pcigmp.h:23
IGMPv2_packet
Definition: pcigmp.h:35
IGMPv3_packet
Definition: pcigmp.h:46
MultiCast
Multicast internal structure.
Definition: pcigmp.h:104
MultiCast::active
BOOL active
is this an active entry
Definition: pcigmp.h:109
MultiCast::ethaddr
eth_address ethaddr
Ethernet address of group.
Definition: pcigmp.h:106
MultiCast::ip
DWORD ip
IP address of group.
Definition: pcigmp.h:105
MultiCast::processes
BYTE processes
number of interested processes
Definition: pcigmp.h:107
MultiCast::reply_timer
DWORD reply_timer
IGMP query reply timer.
Definition: pcigmp.h:108
code
Definition: zinftree.h:24
in_Header
Definition: wattcp.h:329


Watt-32 tcp/ip: E:/WATT/src/pcintr.c Source File

  • src
pcintr.c
Go to the documentation of this file.
1
15#include <stdio.h>
16#include <stdlib.h>
17#include <signal.h>
18
19#include "wattcp.h"
20#include "language.h"
21#include "misc.h"
22#include "misc_str.h"
23#include "run.h"
24#include "pctcp.h"
25#include "wdpmi.h"
26#include "x32vm.h"
27#include "powerpak.h"
28
29#if (DOSX & DJGPP)
30 #include <sys/time.h>
31#elif (DOSX & PHARLAP)
32 #include <mw/exc.h> /* _dx_alloc_rmode_wrapper_iret() */
33#endif
34
35#if defined(__MSDOS__) /* Rest of file */
36
37#define TIMER_INTR 0x08
38#define STK_SIZE 1024
39
40void (W32_CALL *wintr_chain)(void) = NULL;
41
42static BOOL on_isr8;
43
44#if !(DOSX & POWERPAK)
45 static BOOL inside_isr8 = FALSE;
46 static WORD indos_flag_seg, indos_flag_ofs;
47 static WORD crit_err_seg, crit_err_ofs; /* only for DOS 3.1+ */
48
49 static void find_DOS_flags (void);
50 static BOOL DOS_is_idle (void);
51#endif
52
53#if (DOSX & DJGPP)
54 static void (*old_sigalrm) (int);
55
56#elif !(DOSX & (PHARLAP|X32VM|POWERPAK))
57 static UINT locstack [STK_SIZE];
58
59 static void stack_probe (void)
60 {
61#if defined(USE_DEBUG)
62 int used;
63 UINT *p;
64
65 for (p = locstack, used = 0; *p && used < DIM(locstack); p++)
66 used++;
67 if (used >= DIM(locstack))
68 {
69 (*_printf) ("pcintr.c: Stack overflow. Increase STK_SIZE\n");
70 fflush (stdout);
71 exit (-1);
72 }
73#endif
74 }
75#endif
76
77BOOL wintr_enable (void)
78{
79 BOOL old = on_isr8;
80 on_isr8 = TRUE;
81 return (old);
82}
83
84void wintr_disable (void)
85{
86 on_isr8 = FALSE;
87}
88
89#if (DOSX & (PHARLAP|X32VM))
90 static REALPTR oldint, timer_cb;
91 static RMC_BLK rmRegs;
92
93 static void NewTimer (void)
94 {
95 _dx_call_real (oldint, &rmRegs, 1);
96
97 if (!inside_isr8)
98 {
99 inside_isr8 = TRUE;
100 if (on_isr8 && DOS_is_idle())
101 {
102 if (wintr_chain)
103 (*wintr_chain)();
104 tcp_tick (NULL);
105 }
106 inside_isr8 = FALSE;
107 }
108 }
109
110 void wintr_shutdown (void)
111 {
112 if (oldint)
113 {
114 _dx_rmiv_set (TIMER_INTR, oldint);
115 _dx_free_rmode_wrapper (timer_cb);
116 oldint = 0;
117 }
118 }
119
120 void wintr_init (void)
121 {
122 timer_cb = _dx_alloc_rmode_wrapper_iret ((pmodeHook)NewTimer, 80000);
123 if (!timer_cb)
124 {
125 outsnl (_LANG("Cannot allocate real-mode timer callback"));
126 exit (1);
127 }
128 find_DOS_flags();
129 _dx_rmiv_get (TIMER_INTR, &oldint);
130 _dx_rmiv_set (TIMER_INTR, timer_cb);
131 RUNDOWN_ADD (wintr_shutdown, -1); /* call it very early */
132 }
133
134#elif (DOSX & DJGPP)
135 static void NewTimer (int sig)
136 {
137 if (!inside_isr8)
138 {
139 inside_isr8 = TRUE;
140 if (old_sigalrm)
141 (*old_sigalrm) (sig);
142 if (on_isr8 && DOS_is_idle())
143 {
144 if (wintr_chain)
145 (*wintr_chain)();
146 tcp_tick (NULL);
147 }
148 inside_isr8 = FALSE;
149 }
150 }
151
152 void wintr_shutdown (void)
153 {
154 struct itimerval tim;
155
156 tim.it_interval.tv_sec = 0;
157 tim.it_interval.tv_usec = 0;
158 signal (SIGALRM, old_sigalrm);
159 setitimer (ITIMER_REAL, &tim, NULL);
160 }
161
162 void wintr_init (void)
163 {
164 struct itimerval tim;
165
166 find_DOS_flags();
167 tim.it_interval.tv_usec = 54945; /* 1000000/18.2 */
168 tim.it_interval.tv_sec = 0;
169 tim.it_value = tim.it_interval;
170 old_sigalrm = signal (SIGALRM, NewTimer);
171 setitimer (ITIMER_REAL, &tim, NULL);
172 }
173
174#elif defined(WATCOM386) && (DOSX & DOS4GW)
175 static void (__interrupt __far *oldint)();
176
177 static void __interrupt __far NewTimer (void)
178 {
179 if (!inside_isr8)
180 {
181 inside_isr8 = TRUE;
182 if (on_isr8 && DOS_is_idle())
183 {
184 DISABLE();
185 STACK_SET (&locstack[STK_SIZE-1]);
186
187 if (wintr_chain)
188 (*wintr_chain)();
189 tcp_tick (NULL);
190
191 STACK_RESTORE();
192 ENABLE();
193 stack_probe();
194 }
195 inside_isr8 = FALSE;
196 }
197 _chain_intr (oldint);
198 }
199
200 void wintr_shutdown (void)
201 {
202 if (oldint)
203 {
204 _dos_setvect (TIMER_INTR, oldint);
205 oldint = NULL;
206 }
207 }
208
209 void wintr_init (void)
210 {
211 find_DOS_flags();
212 oldint = _dos_getvect (TIMER_INTR);
213 _dos_setvect (TIMER_INTR, NewTimer);
214 memset (&locstack, 0, sizeof(locstack));
215 RUNDOWN_ADD (wintr_shutdown, -1);
216 }
217
218#elif (DOSX & POWERPAK) && defined(NOT_YET)
219 static struct {
220 DWORD offset;
221 WORD selector;
222 } oldint;
223
224 static WORD our_ds;
225
226 void NewTimerPre (void);
227
228 static void NewTimer (void)
229 {
230 __asm {
231 push es
232 push ds
233 mov ds, cs:[our_ds]
234 mov es, cs:[our_ds]
235 }
236
237 if (!inside_isr8)
238 {
239 inside_isr8 = TRUE;
240 if (on_isr8 && DOS_is_idle())
241 {
242 DISABLE();
243 STACK_SET (offset locstack[STK_SIZE-1]);
244
245 if (wintr_chain)
246 (*wintr_chain)();
247 tcp_tick (NULL);
248
249 STACK_RESTORE();
250 ENABLE();
251 stack_probe();
252 }
253 inside_isr8 = FALSE;
254 }
255 dpmi_chain_intr (oldint.selector, oldint.offset);
256 }
257
258 void wintr_shutdown (void)
259 {
260 if (oldint.selector)
261 {
262 dpmi_setvect (TIMER_INTR, oldint.selector, oldint.offset);
263 oldint.selector = NULL;
264 }
265 }
266
267 void wintr_init (void)
268 {
269 find_DOS_flags();
270 our_ds = _DS;
271 dpmi_getvect (TIMER_INTR, &oldint.selector, &oldint.offset);
272 dpmi_setvect (TIMER_INTR, _CS, (DWORD)NewTimer);
273 memset (&locstack, 0, sizeof(locstack));
274 RUNDOWN_ADD (wintr_shutdown, -1);
275 }
276
277#elif (DOSX == 0) && !defined(NO_INLINE_ASM)
278
279 static W32_IntrHandler oldint;
280
281 static INTR_PROTOTYPE NewTimer (void)
282 {
283 (*oldint)(); /* chain now */
284
285 if (!inside_isr8)
286 {
287 inside_isr8 = TRUE;
288
289 if (on_isr8 && DOS_is_idle())
290 {
291 #ifdef __WATCOMC__
292 DISABLE();
293 STACK_SET (&locstack[STK_SIZE-1]);
294 #else
295 static UINT old_SP;
296 static WORD old_SS;
297 asm pushf
298 asm cli
299 asm mov ax, ss
300 asm mov old_SS, ax
301 asm mov ax, sp
302 asm mov old_SP, ax
303 asm mov ax, ds
304 asm mov ss, ax
305 asm lea sp, locstack[STK_SIZE-1]
306 #endif
307 ENABLE();
308
309 if (wintr_chain)
310 (*wintr_chain)();
311 tcp_tick (NULL);
312
313 DISABLE();
314 #ifdef __WATCOMC__
315 STACK_RESTORE();
316 #else
317 asm mov ax,old_SS
318 asm mov ss,ax
319 asm mov ax,old_SP
320 asm mov sp,ax
321 #endif
322 ENABLE();
323 stack_probe();
324 }
325 inside_isr8 = FALSE;
326 }
327 }
328
329 void wintr_shutdown (void)
330 {
331 if (oldint)
332 {
333 setvect (TIMER_INTR, oldint);
334 oldint = NULL;
335 }
336 }
337
338 void wintr_init (void)
339 {
340 find_DOS_flags();
341 oldint = getvect (TIMER_INTR);
342 setvect (TIMER_INTR, NewTimer);
343 memset (&locstack, 0, sizeof(locstack));
344 RUNDOWN_ADD (wintr_shutdown, -1);
345 }
346#endif
347
348#if !(DOSX & POWERPAK)
349static void find_DOS_flags (void)
350{
351 IREGS regs;
352
353 memset (&regs, 0, sizeof(regs));
354 regs.r_ax = 0x3400;
355
356 GEN_INTERRUPT (0x21, &regs);
357 indos_flag_seg = regs.r_es;
358 indos_flag_ofs = regs.r_bx;
359 if (_watt_os_ver >= 0x0301)
360 {
361 crit_err_seg = regs.r_es;
362 crit_err_ofs = regs.r_bx - 1;
363 }
364}
365
366static BOOL DOS_is_idle (void)
367{
368 BYTE indos, crit = 0;
369
370 indos = PEEKB (indos_flag_seg, indos_flag_ofs);
371 if (_watt_os_ver >= 0x0301)
372 crit = PEEKB (crit_err_seg, crit_err_ofs);
373 return (crit == 0 && indos == 0);
374}
375#endif
376#endif /* __MSDOS__ */
377
language.h
_watt_os_ver
WORD _watt_os_ver
Definition: misc.c:74
misc.h
misc_str.h
pctcp.h
powerpak.h
IREGS
Definition: misc.h:610
RMC_BLK
Definition: x32vm.h:30
itimerval
Definition: wtime.h:75
wattcp.h
Core definitions.
wdpmi.h
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/pcping.c Source File

  • src
pcping.c
Go to the documentation of this file.
1
5#include <stdio.h>
6#include <stdlib.h>
7#include <limits.h>
8
9#include "copyrigh.h"
10#include "wattcp.h"
11#include "misc.h"
12#include "misc_str.h"
13#include "timer.h"
14#include "chksum.h"
15#include "language.h"
16#include "ip4_in.h"
17#include "ip4_out.h"
18#include "pcsed.h"
19#include "pcarp.h"
20#include "pcdbug.h"
21#include "pctcp.h"
22#include "pcicmp.h"
23
24// #undef time
25
29static struct ping_cache {
30 DWORD host;
31 DWORD time;
32 DWORD number;
33 } pcache [10];
34
45int W32_CALL _ping (DWORD host, DWORD countnum, const BYTE *pattern, size_t len)
46{
47 struct ping_pkt *pkt;
48 struct ICMP_echo *icmp;
49 struct in_Header *ip;
50 eth_address dest;
51
52 if (sin_mask != 0xFFFFFFFF && !_ip4_is_loopback_addr(host) &&
53 !(~host & ~sin_mask))
54 {
55 outsnl (_LANG("Cannot ping a network!"));
56 return (0);
57 }
58
59 if (!_arp_resolve(host,&dest))
60 {
61 outsnl (_LANG("Cannot resolve host's hardware address"));
62 return (0);
63 }
64
65 if (debug_on >= 2)
66 {
67 outs (_LANG("\nDEBUG: destination hardware: "));
68 outhexes ((char*)&dest, sizeof(dest));
69 outs ("\n");
70 }
71
72 host = intel (host);
73
74 /* Jumbo packets must be sent as IP fragments
75 */
76#if defined(USE_FRAGMENTS)
77 if (len > (size_t)(_mtu - sizeof(*ip) - sizeof(*icmp)))
78 {
79 int rc = 0;
80
81 len = min (len, USHRT_MAX - sizeof(*ip) - sizeof(*icmp));
82 icmp = (struct ICMP_echo*) malloc (len + sizeof(*icmp));
83 if (!icmp)
84 {
85 if (debug_on)
86 outsnl (_LANG("_ping(): malloc failed"));
87 return (0);
88 }
89
90 if (pattern)
91 memcpy (icmp+1, pattern, len);
92 len += sizeof(*icmp);
93 icmp->type = ICMP_ECHO;
94 icmp->code = 0;
95 icmp->index = countnum;
96 icmp->identifier = set_timeout (0) & 0xFFFF; /* "random" id */
97 icmp->sequence = 0;
98 icmp->checksum = 0;
99 icmp->checksum = ~CHECKSUM (icmp, len);
100 rc = _IP4_SEND_FRAGMENTS (NULL, ICMP_PROTO, host, icmp, len);
101 free (icmp);
102 return (rc < 0 ? 0 : rc);
103 }
104#else
105 len = min (len, _mtu - sizeof(*ip) - sizeof(*icmp)); /* truncate */
106#endif
107
108 /* Ordinary small pings; format an Ethernet packet with IPv4 type
109 */
110 pkt = (struct ping_pkt*) _eth_formatpacket (&dest, IP4_TYPE);
111 ip = &pkt->in;
112 icmp = &pkt->icmp;
113
114 if (pattern && len > 0)
115 {
116 len = min (len, _mtu-sizeof(struct ping_pkt));
117 memcpy (icmp+1, pattern, len); /* pattern after echo header */
118 len += sizeof (*icmp);
119 }
120 else
121 len = sizeof (*icmp);
122
123 icmp->type = ICMP_ECHO;
124 icmp->code = 0;
125 icmp->index = countnum;
126 icmp->identifier = set_timeout (0) & 0xFFFF; /* "random" id */
127 icmp->sequence = 0;
128 icmp->checksum = 0;
129 icmp->checksum = ~CHECKSUM (icmp, len);
130
131 return IP4_OUTPUT (ip, 0, host, ICMP_PROTO, 0, (BYTE)_default_tos,
132 0, len, NULL);
133}
134
138static int MS_CDECL compare (const struct ping_cache *a,
139 const struct ping_cache *b)
140{
141 return ((long)a->number - (long)b->number);
142}
143
147void W32_CALL add_ping (DWORD host, DWORD time, DWORD number)
148{
149 int i;
150
151 for (i = 0; i < DIM(pcache); i++)
152 if (host && pcache[i].host == 0) /* vacant entry */
153 {
154 if (time > 0x7FFFFFFFL)
155 time += 0x1800B0L;
156 pcache[i].host = host;
157 pcache[i].time = time;
158 pcache[i].number = number;
159 qsort ((void*)&pcache, DIM(pcache), sizeof(pcache[0]), (CmpFunc)compare);
160 break;
161 }
162}
163
169DWORD W32_CALL _chk_ping (DWORD host, DWORD *number)
170{
171 int i;
172
173 WATT_YIELD();
174
175 for (i = 0; i < DIM(pcache); i++)
176 if (host && pcache[i].host == host)
177 {
178 pcache[i].host = 0; /* clear entry */
179 if (number)
180 *number = pcache[i].number;
181 return (pcache[i].time);
182 }
183 return (0xFFFFFFFFUL);
184}
185
186
chksum.h
copyrigh.h
ip4_in.h
_default_tos
BYTE _default_tos
Definition: ip4_out.c:53
ip4_out.h
language.h
misc.h
misc_str.h
_arp_resolve
BOOL W32_CALL _arp_resolve(DWORD ip, eth_address *eth)
The blocking lookup function visible to higher functions.
Definition: pcarp.c:1278
pcarp.h
pcdbug.h
pcicmp.h
add_ping
void W32_CALL add_ping(DWORD host, DWORD time, DWORD number)
Add an ICMP echo reply to the ping-cache.
Definition: pcping.c:147
compare
static int MS_CDECL compare(const struct ping_cache *a, const struct ping_cache *b)
Compare two entries in ping-cache.
Definition: pcping.c:138
_chk_ping
DWORD W32_CALL _chk_ping(DWORD host, DWORD *number)
Check for ICMP echo reply in ping-cache.
Definition: pcping.c:169
_ping
int W32_CALL _ping(DWORD host, DWORD countnum, const BYTE *pattern, size_t len)
Format and send an ICMP echo request (ping).
Definition: pcping.c:45
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
pcsed.h
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
pctcp.h
ICMP_echo
Definition: pcicmp.h:55
icmp
Definition: ip_icmp.h:66
in_Header
Definition: wattcp.h:329
ping_cache
Definition: pcping.c:29
ping_pkt
Definition: pcicmp.h:141
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
timer.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcpkt32.c Source File

  • src
pcpkt32.c
Go to the documentation of this file.
1
36#include <stdio.h>
37#include <stdlib.h>
38
39#include "wattcp.h"
40
41#if defined(__MSDOS__) && DOSX
42
43#include "pcconfig.h"
44#include "wdpmi.h"
45#include "x32vm.h"
46#include "misc.h"
47#include "pcsed.h"
48#include "pcpkt.h"
49#include "pcpkt32.h"
50
51int (*_pkt32_drvr)(IREGS*) = NULL;
52
53const struct PM_driver pm_driver_list[] = {
54 { PM_DRVR_3C501, "3c501" },
55 { PM_DRVR_3C503, "3c503" },
56 { PM_DRVR_3C505, "3c505" },
57 { PM_DRVR_3C507, "3c507" },
58 { PM_DRVR_3C5x9, "3c5x9" },
59 { PM_DRVR_3C59x, "3c59x" },
60 { PM_DRVR_NE2000, "NE2000" },
61 { PM_DRVR_EEXPR, "EthExp" },
62 { PM_DRVR_RTL8139, "RTL8139" },
63 { 0, NULL }
64 };
65
66int pkt32_drvr_probe (const PM_driver *drivers)
67{
68 ARGSUSED (drivers);
69 return (-1);
70}
71
72int pkt32_drvr_init (int driver, mac_address *addr)
73{
74 ARGSUSED (driver);
75 ARGSUSED (addr);
76 return (-1);
77}
78
79const char *pkt32_drvr_name (int driver)
80{
81 int i;
82 for (i = 0; pm_driver_list[i].type; i++)
83 if (pm_driver_list[i].type == driver)
84 return (pm_driver_list[i].name);
85
86 return ("unknown");
87}
88#endif /* __MSDOS__ && DOSX */
misc.h
pcconfig.h
pcpkt32.h
pcpkt.h
pcsed.h
IREGS
Definition: misc.h:610
PM_driver
Definition: pcpkt32.h:18
wattcp.h
Core definitions.
wdpmi.h
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/pcpkt32.h Source File

  • src
pcpkt32.h
Go to the documentation of this file.
1
3#if !defined(_w32_PCPKT32_H) && (DOSX)
4#define _w32_PCPKT32_H
5
6#define PM_DRVR_3C501 1 /* 3COM EtherLink I, a real museum piece! */
7#define PM_DRVR_3C503 2
8#define PM_DRVR_3C505 3 /* 3COM EtherLink II */
9#define PM_DRVR_3C507 4
10#define PM_DRVR_3C5x9 5 /* 3COM EtherLink III, ISA */
11#define PM_DRVR_3C59x 6 /* 3COM EtherLink III, PCI */
12#define PM_DRVR_NE2000 7 /* NE2000 compatible cards */
13#define PM_DRVR_EEXPR 8 /* Intel EtherExpress */
14#define PM_DRVR_RTL8139 9 /* RealTek RTL8139 */
15
18typedef struct PM_driver {
19 int type;
20 const char *name;
21 } PM_driver;
22
23extern int (*_pkt32_drvr)(IREGS*);
24
25extern const struct PM_driver pm_driver_list[];
26
27extern int pkt32_drvr_probe (const PM_driver *drivers);
28extern int pkt32_drvr_init (int driver, mac_address *addr);
29extern const char *pkt32_drvr_name (int driver);
30
31#endif
32
IREGS
Definition: misc.h:610
PM_driver
Definition: pcpkt32.h:18


Watt-32 tcp/ip: E:/WATT/src/pcpkt.c Source File

  • src
pcpkt.c
Go to the documentation of this file.
1
9#include <stdio.h>
10#include <stdlib.h>
11#include <stddef.h>
12#include <string.h>
13#include <limits.h>
14
15#include "copyrigh.h"
16#include "wattcp.h"
17
18/* All this is for MS-DOS only. For Win32, refer winpkt.c instead.
19 */
20#if defined(__MSDOS__)
21
22#if defined(__DJGPP__)
23 #include <sys/exceptn.h>
24 #include <sys/nearptr.h>
25 #include <crt0.h>
26#endif
27
28#include "wdpmi.h"
29#include "x32vm.h"
30#include "powerpak.h"
31#include "asmpkt.h"
32#include "language.h"
33#include "sock_ini.h"
34#include "cpumodel.h"
35#include "misc.h"
36#include "misc_str.h"
37#include "timer.h"
38#include "profile.h"
39#include "pcsed.h"
40#include "pcstat.h"
41#include "pcconfig.h"
42#include "pcdbug.h"
43#include "pcigmp.h"
44#include "pcqueue.h"
45#include "pcpkt.h"
46#include "pcpkt32.h"
47
48WORD _pktdevclass = PDCLASS_UNKNOWN;
49WORD _pkt_ip_ofs = 0;
50WORD _pkt_type_ofs = 0;
51BOOL _pktserial = FALSE;
52BYTE _pktdevlevel = 1;
53int _pkt_rxmode = RXMODE_BROADCAST;
54int _pkt_rxmode0 = -1;
55int _pkt_errno = 0;
56const char *pkt_error = NULL;
58int _pkt_forced_rxmode = -1;
59char _pktdrvrname[20] = "unknown";
60
61struct pkt_info *_pkt_inf = NULL;
63static char pkt_sign[] = "PKT DRVR";
64static WORD pkt_interrupt = 0;
65static DWORD pkt_drop_cnt = 0;
66static BYTE pkt_txretries = 2;
67static int pkt_txwait = 0; /* # msec to wait if Tx fails */
68static BOOL pkt_use_near = FALSE; /* Use near-ptr if enabled */
69static BOOL pkt_do_reset = FALSE; /* reset handle at exit */
70static int pkt_drvr_ver = 0; /* Driver internal version */
71static int pkt_num_rx_bufs = RX_BUFS;
72
73#if defined(USE_STATISTICS)
74 static struct PktStats init_stats;
75 static void get_init_stats (void);
76#endif
77
78static struct PktParameters pkt_params;
79static BOOL got_params = FALSE;
80
81int pkt_release_handle (WORD handle);
82int pkt_reset_handle (WORD handle);
83
88#define PKT_FIRST_VEC 0x60
89#define PKT_LAST_VEC 0x80
90#define PKT_FIRST_VEC_11 0x20
91#define PKT_LAST_VEC_11 0xFF
92
93
94#if (DOSX & PHARLAP)
95 #include <mw/exc.h>
96
97 REALPTR rm_base;
98
99 /*
100 * real-data is organised as follows: PKT_TMP at rm_base + 0x40
101 * TX_BUF at PKT_TMP + PKT_TMP_SIZE
102 * RX_BUF at TX_BUF + RX_SIZE
103 */
104 #define PKT_TMP() (WORD) 0x40
105 #define TX_BUF() (PKT_TMP() + PKT_TMP_SIZE) /* DWORD boundary */
106 #define RX_BUF() (TX_BUF() + RX_SIZE)
107 #define RDATA_SIZE (RX_BUF() + RX_SIZE)
108 #define RP_SEGM() RP_SEG (rm_base)
109
110#elif (DOSX & X32VM) /* X32VM is very similar to Pharlap except that it */
111 REALPTR rm_base; /* automatically maps DOS memory into our DS */
112
113 #define PKT_TMP() (WORD) 0x40
114 #define TX_BUF() (PKT_TMP() + PKT_TMP_SIZE)
115 #define RX_BUF() (TX_BUF() + RX_SIZE)
116 #define RDATA_SIZE (RX_BUF() + RX_SIZE)
117 #define RP_SEGM() RP_SEG (rm_base)
118
119#elif (DOSX & DJGPP)
120 #if !defined(USE_FAST_PKT)
121 #define RMCB_STK_SIZE 2048
122 #include "gormcb_c.inc"
123
124 static _go32_dpmi_seginfo rm_cb;
125 #endif
126
127 static DWORD rm_base;
128
129 /*
130 * real-data is organised as follows: PKT_TMP at rm_base + 0
131 * TX_BUF at PKT_TMP + PKT_TMP_SIZE
132 * RX_BUF at TX_BUF + RX_SIZE
133 */
134 #define PKT_TMP() 0
135 #define TX_BUF() (PKT_TMP() + PKT_TMP_SIZE)
136 #define RX_BUF() (TX_BUF() + RX_SIZE)
137 #define RDATA_SIZE (RX_BUF() + RX_SIZE)
138 #define RP_SEGM() _pkt_inf->rm_seg
139
140#elif (DOSX & DOS4GW) /* All DOS4GW type extenders */
141
142 static DWORD rm_base; /* Linear address (in DOS) for allocated area */
143
144 #if !defined(USE_FAST_PKT)
145 static WORD pkt_inf_sel; /* selector returned from `_pkt_inf' allocation */
146 #endif
147
148 /*
149 * The DOS-area (0-1MB) is automagically mapped into application
150 * data. This eases communication with packet-driver, but clean
151 * crashes can not be expected. i.e. bugs (dereferencing null-ptr)
152 * in application will most likely hang the machine.
153 *
154 * Real-mode code/data is organised like this:
155 * pkt_receiver4_start() copied to allocated area at rm_base
156 * PKT_TMP at rm_base + (pkt_receiver4_end() - pkt_receiver4_start())
157 * TX_BUF at PKT_TMP + PKT_TMP_SIZE
158 * end area at TX_BUF + RX_SIZE
159 * RX_BUF is in DOS-allocated `_pkt_inf' structure.
160 */
161 #define PKT_TMP() ((DWORD)pkt_receiver4_end - \
162 (DWORD)pkt_receiver4_start)
163 #define TX_BUF() (PKT_TMP() + PKT_TMP_SIZE)
164 #define RCV_OFS() ((DWORD)pkt_receiver4_rm - \
165 (DWORD)pkt_receiver4_start)
166 #define RP_SEGM() _pkt_inf->rm_seg
167
168#elif (DOSX & POWERPAK)
169 static REALPTR rm_base;
170
171 #if !defined(USE_FAST_PKT)
172 static DPMI_callback rm_cb;
173 #endif
174
175 #define PKT_TMP() 0
176 #define TX_BUF() (PKT_TMP() + PKT_TMP_SIZE)
177 #define RX_BUF() (TX_BUF() + RX_SIZE)
178 #define RDATA_SIZE (RX_BUF() + RX_SIZE)
179 #define RP_SEGM() _pkt_inf->rm_seg
180
181#elif (DOSX == 0)
182 void (__cdecl _far * pkt_enque_ptr) (BYTE _far *buf, WORD len);
183 void (__cdecl _far *_pkt_enque_ptr) (BYTE _far *buf, WORD len);
184
185#else
186 #error Help me!
187#endif
188
189
190#if defined(USE_FAST_PKT)
191 #include "pcpkt2.c"
192
193#elif (DOSX)
194 static int setup_rmode_callback (void);
195 static int lock_code_and_data (void);
196 static int unlock_code_and_data (void);
197#endif
198
199static int find_vector (int first, int num);
200static int setup_pkt_inf (void);
201static void get_rmode_data (void *dest, unsigned size, WORD seg, WORD ofs);
202static BOOL pkt_api_entry (IREGS *reg, unsigned called_from_line);
203
204#define PKT_API(reg) pkt_api_entry (reg, __LINE__)
205#define CARRY_BIT 1 /* carry bit in (e)flags register */
206
207#define PKT_ERR(str,code) do { \
208 const char *err = pkt_strerror (code); \
209 outs (_LANG(str)); \
210 outsnl (err); \
211 } while (0)
212
216const char * W32_CALL pkt_strerror (int code)
217{
218 static char buf[50];
219 static const char *errors[] = {
220 __LANG("Unknown driver error (0x--)"),
221 /* 1 */ __LANG("Invalid handle number"),
222 __LANG("No interfaces of specified class found"),
223 /* 3 */ __LANG("No interfaces of specified type found"),
224 __LANG("No interfaces of specified number found"),
225 /* 5 */ __LANG("Bad packet type specified"),
226 __LANG("This interface does not support multicast"),
227 /* 7 */ __LANG("This packet driver cannot terminate"),
228 __LANG("An invalid receiver mode was specified"),
229 /* 9 */ __LANG("Operation failed because of insufficient space"),
230 __LANG("Type previously accessed, and not released"),
231 /* 11 */ __LANG("The command was out of range, or not implemented"),
232 __LANG("Cannot send packet (hardware error)"),
233 /* 13 */ __LANG("Cannot change hardware address"),
234 __LANG("Hardware address has bad length/format"),
235 /* 15 */ __LANG("Could not reset interface"),
236 __LANG("Extended driver needed")
237 };
238 const char *rc;
239 char *p;
240
241 if (code > 0 && code < DIM(errors))
242 return (_LANG(errors[code]));
243
244 rc = _strlcpy (buf, _LANG(errors[0]), sizeof(buf));
245 p = strchr (rc, '(');
246 if (p && strlen(p) >= 5)
247 {
248 code &= 0xFF;
249 p[3] = hex_chars_upper [code >> 4];
250 p[4] = hex_chars_upper [code & 15];
251 }
252 return (buf);
253}
254
255/* Return TRUE is adapter is up.
256 */
257BOOL W32_CALL pkt_is_init (void)
258{
259 return (_pkt_inf != NULL);
260}
261
262/*
263 * Only for testing asmpkt4.asm
264 */
265#if (DOSX & DOS4GW) && 0
266static void dump_asm4 (void)
267{
268 const BYTE *p = (const BYTE*) rm_base;
269 int i;
270
271 printf ("PKT_INF %08lX, HEAD %08lX, QUEUE %08lX, INDEX %04X, XYPOS %d\n",
272 *(DWORD*)p, *(DWORD*)(p+4), *(DWORD*)(p+8), *(WORD*)(p+12),
273 *(WORD*)(p+14));
274
275 printf ("rm_base %08lX, handle %04X, is_serial %d\n",
276 rm_base, _pkt_inf->handle, _pkt_inf->is_serial);
277
278 printf ("VAR_1-14: ");
279 for (i = 16; i <= 42; i += 2)
280 printf ("%04X ", *(WORD*)(p+i));
281
282#if 0
283 printf ("PKT_RECV: ");
284 for (i = RCV_OFS(); i < RCV_OFS()+10; i++)
285 printf ("%02X ", p[i]);
286
287 printf ("\nPKT_TMP: ");
288 for (i = PKT_TMP(); i < PKT_TMP()+PKT_TMP_SIZE; i++)
289 printf ("%02X ", p[i]);
290#endif
291 fflush (stdout);
292}
293#endif
294
295
301#if (DOSX & DOS4GW)
302void *pkt_tx_buf (void)
303{
304 return (void*)(rm_base + TX_BUF());
305}
306
307#elif (DOSX & DJGPP)
308void *pkt_tx_buf (void)
309{
310 if (_pkt_inf && _pkt_inf->use_near_ptr)
311 return (void*)(rm_base + TX_BUF() + __djgpp_conventional_base);
312 fprintf (stderr, "%s (%d): wrong usage of pkt_tx_buf()\n",
313 __FILE__, __LINE__);
314 exit (-1);
315 return (NULL);
316}
317
318#elif (DOSX & X32VM)
319void *pkt_tx_buf (void)
320{
321 return (void*) ((RP_SEG(rm_base) << 4) + RP_OFF(rm_base) +
322 (DWORD)_x386_zero_base_ptr + TX_BUF());
323}
324#endif
325
331static int pkt_set_access (void)
332{
333 IREGS regs;
334
335 ASSERT_PKT_INF (0);
336
337 memset (&regs, 0, sizeof(regs));
338
339 regs.r_ax = PD_ACCESS | _pktdevclass;
340 regs.r_bx = 0xFFFF; /* any type */
341 regs.r_dx = 0; /* generic interface */
342 regs.r_cx = 0; /* receive any proto */
343
344#if defined(USE_FAST_PKT)
345 regs.r_es = _pkt_inf->rm_seg;
346 regs.r_di = PktReceiver;
347
348#elif (DOSX & DJGPP)
349 regs.r_es = rm_cb.rm_segment;
350 regs.r_di = rm_cb.rm_offset;
351
352#elif (DOSX & (PHARLAP|X32VM))
353 regs.r_es = RP_SEGM();
354 regs.r_di = 0; /* RMCB aligned at para address */
355
356#elif (DOSX & POWERPAK)
357 regs.r_es = RP_SEG (rm_cb.rm_addr);
358 regs.r_di = RP_OFF (rm_cb.rm_addr);
359
360#elif (DOSX & DOS4GW)
361 regs.r_es = RP_SEGM();
362 regs.r_di = RCV_OFS();
363
364#else /* real-mode targets */
365 regs.r_es = FP_SEG (pkt_receiver_rm); /* = this CS */
366 regs.r_di = FP_OFF (pkt_receiver_rm);
367#endif
368
369 if (!PKT_API(&regs))
370 {
371 PKT_ERR ("Error allocating handle: ", _pkt_errno);
372 return (0);
373 }
374 _pkt_inf->handle = (WORD) regs.r_ax;
375 return (1);
376}
377
381static int pkt_drvr_info (void)
382{
383 IREGS regs;
384 int rc = 1; /* assume okay */
385
386 ASSERT_PKT_INF (0);
387
388 /* Lets find out about the driver
389 */
390 memset (&regs, 0, sizeof(regs));
391 regs.r_ax = PD_DRIVER_INFO;
392
393 if (!PKT_API(&regs))
394 {
395 TRACE_CONSOLE (1, "Warning: old-type PKTDRVR\n");
396 _pktdevclass = PDCLASS_ETHER; /* assume Ethernet */
397 _pkt_ip_ofs = sizeof(eth_Header);
398 _pkt_type_ofs = offsetof (struct eth_Header, type);
399 _pkt_errno = 0;
400 }
401 else /* new Packet-Driver (1.09+) */
402 {
403 _pktdevlevel = loBYTE (regs.r_ax);
404 _pktdevclass = hiBYTE (regs.r_cx);
405 pkt_drvr_ver = regs.r_bx & 0xFFFF;
406
407 switch (_pktdevclass)
408 {
409 case PDCLASS_TOKEN:
410 case PDCLASS_TOKEN_RIF: /* !! fix me */
411 _pkt_ip_ofs = sizeof(tok_Header);
412 _pkt_type_ofs = offsetof (struct tok_Header, type);
413 break;
414
415 case PDCLASS_ETHER:
416 _pkt_ip_ofs = sizeof(eth_Header);
417 _pkt_type_ofs = offsetof (struct eth_Header, type);
418 break;
419
420 case PDCLASS_FDDI:
421 _pkt_ip_ofs = sizeof(fddi_Header);
422 _pkt_type_ofs = offsetof (struct fddi_Header, type);
423 break;
424
425 case PDCLASS_ARCNET:
426 _pkt_ip_ofs = ARC_HDRLEN;
427 _pkt_type_ofs = ARC_TYPE_OFS;
428 break;
429
430 case PDCLASS_SLIP:
431 case PDCLASS_PPP:
432 case PDCLASS_AX25: /* !! for now */
433 _pkt_ip_ofs = 0;
434 _pkt_type_ofs = 0;
435 break;
436
437 default:
438 outs (_LANG("PKT-ERROR: Unsupported driver class "));
439 outhex ((char)_pktdevclass);
440 outsnl ("h");
441 _pkt_errno = PDERR_NO_CLASS;
442 rc = 0;
443 }
444 get_rmode_data (_pktdrvrname, sizeof(_pktdrvrname), regs.r_ds, regs.r_si);
445 _pktdrvrname [sizeof(_pktdrvrname)-1] = '\0';
446
447 if (pkt_txwait == 0 &&
448 !strcmp(_pktdrvrname,"NDIS3PKT"))
449 pkt_txwait = 1; /* This helps when using NDIS3PKT */
450 }
451
452 _pktserial = (_pktdevclass == PDCLASS_SLIP ||
453 _pktdevclass == PDCLASS_PPP ||
454 _pktdevclass == PDCLASS_AX25);
455
456 _pkt_inf->is_serial = _pktserial;
457 _pkt_inf->pkt_ip_ofs = _pkt_ip_ofs;
458 _pkt_inf->pkt_type_ofs = _pkt_type_ofs;
459 return (rc);
460}
461
465int pkt_get_params (struct PktParameters *params)
466{
467 IREGS regs;
468 int rc = 0;
469
470 memset (&regs, 0, sizeof(regs));
471 regs.r_ax = PD_GET_PARAM; /* get driver parameters */
472
473 DISABLE();
474 if (PKT_API(&regs))
475 {
476 get_rmode_data (params, sizeof(*params), regs.r_es, regs.r_di);
477 got_params = TRUE;
478 rc = 1;
479 }
480 ENABLE();
481 return (rc);
482}
483
488int pkt_get_mtu (void)
489{
490 if (_pktdevclass == PDCLASS_ARCNET)
491 return (ARCNET_MAX_DATA - 8);
492
493 if (got_params)
494 return (pkt_params.mtu);
495 return (-1);
496}
497
498#ifdef NOT_USED
503int pkt_get_mac_len (void)
504{
505 if (_pktdevclass == PDCLASS_ARCNET)
506 return (sizeof(arcnet_address));
507 if (got_params)
508 return (pkt_params.addr_len);
509 return (-1);
510}
511#endif
512
518int pkt_get_api_ver (WORD *ver)
519{
520 if (got_params)
521 {
522 *ver = ((pkt_params.major_rev << 8) + pkt_params.minor_rev);
523 return (1);
524 }
525 return (0);
526}
527
531int pkt_get_drvr_ver (WORD *major, WORD *minor, WORD *unused1, WORD *unused2)
532{
533 if (!pkt_drvr_ver)
534 return (0);
535 *major = pkt_drvr_ver >> 8;
536 *minor = pkt_drvr_ver & 255;
537 ARGSUSED (unused1);
538 ARGSUSED (unused2);
539 return (1);
540}
541
545W32_FUNC int W32_CALL pkt_get_vector (void)
546{
547 return (pkt_interrupt);
548}
549
550/*
551 * Return driver class
552 */
553W32_FUNC WORD W32_CALL pkt_get_drvr_class (void)
554{
555 return (_pktdevclass);
556}
557
558/*
559 * Returns low-level PktDriver name.
560 */
561const char * W32_CALL pkt_get_device_name (void)
562{
563 return (_pktdrvrname);
564}
565
577static int pkt16_drvr_init (mac_address *mac_addr)
578{
579 /* If interrupt specified in config-file ("PKT.VECTOR = 0xNN"),
580 * check a single vector. Else, search for the 1st driver in range
581 * 0x60-0x80.
582 */
583 if (pkt_interrupt)
584 pkt_interrupt = find_vector (pkt_interrupt, 1);
585 else pkt_interrupt = find_vector (PKT_FIRST_VEC,
586 PKT_LAST_VEC - PKT_FIRST_VEC + 1);
587
588 if (pkt_interrupt == 0)
589 {
590 outsnl (_LANG("NO PACKET DRIVER FOUND."));
591 return (WERR_NO_DRIVER);
592 }
593
594 if (!setup_pkt_inf())
595 {
596 outsnl (_LANG("Failed to allocate PACKET DRIVER data."));
597 return (WERR_NO_MEM);
598 }
599
600#if defined(USE_FAST_PKT)
601 switch (setup_rmode_receiver())
602 {
603 case -1:
604 outsnl (_LANG("Error in PACKET DRIVER stub code."));
605 return (WERR_PKT_ERROR);
606 }
607#elif (DOSX)
608 switch (setup_rmode_callback())
609 {
610 case -1:
611 outsnl (_LANG("Failed to allocate callback for PACKET DRIVER."));
612 return (WERR_NO_MEM);
613 case -2:
614 outsnl (_LANG("Failed to allocate DOS-mem for PACKET DRIVER."));
615 case -3: /* msg already printed */
616 return (WERR_NO_MEM);
617 }
618
619 if (lock_code_and_data() < 0)
620 {
621 outsnl (_LANG("Failed to lock code/data for PACKET DRIVER."));
622 return (WERR_PKT_ERROR);
623 }
624#endif /* USE_FAST_PKT */
625
626 if (!pkt_drvr_info()) /* get device class etc. of driver */
627 return (WERR_PKT_ERROR);
628
629 if (!pkt_set_access()) /* set upcall receive handler */
630 {
631 pkt_release();
632 return (WERR_PKT_ERROR);
633 }
634
635 if (!pkt_get_addr(mac_addr)) /* get our MAC address */
636 {
637 pkt_release();
638 return (WERR_PKT_ERROR);
639 }
640
641 memset (&pkt_params, 0, sizeof(pkt_params));
642 got_params = FALSE;
643
644 if (_pktdevlevel >= 5 && _pktdevlevel < 255) /* high-performance driver */
645 {
646 if (!pkt_get_params(&pkt_params))
647 TRACE_CONSOLE (1, "Failed to get PKTDRVR params; %s\n",
648 pkt_strerror(_pkt_errno));
649 }
650
651#if defined(USE_STATISTICS)
652 if (_pktdevlevel >= 2 && _pktdevlevel < 255) /* extended driver */
653 get_init_stats();
654#endif
655
656 if (_pktserial)
657 return (0); /* success */
658
659 /* Set Rx-mode forced via config.
660 */
661 if (_pkt_forced_rxmode != -1 &&
662 (_pkt_forced_rxmode < -1 ||
663 _pkt_forced_rxmode > RXMODE_PROMISCOUS))
664 {
665 TRACE_CONSOLE (0, "Illegal Rx-mode (%d) specified\n",
666 _pkt_forced_rxmode);
667 _pkt_forced_rxmode = -1;
668 }
669
670 if (pkt_get_rcv_mode())
671 _pkt_rxmode0 = _pkt_rxmode; /* remember startup mode */
672
673 if (_pkt_forced_rxmode != -1 &&
674 _pkt_forced_rxmode != _pkt_rxmode0)
675 pkt_set_rcv_mode (_pkt_forced_rxmode);
676
677 /* else hope _pkt_rxmode0 is >= RXMODE_BROADCAST */
678
679 return (0); /* success */
680}
681
682/*
683 * The following functions (ending at '_pkt_end()') are called
684 * at interrupt time (or asynchronously). 'pkt_release()' may be
685 * called from SIGSEGV handler. Therefore don't assume anything
686 * about the state of our stack (except hope it's large enough).
687 * And don't use large local variables here. Hope we will not be
688 * reentered since not all functions below are reentrant.
689 */
690
691/* Disable stack-checking here
692 */
693#if defined(__HIGHC__)
694 #pragma off(Call_trace)
695 #pragma off(Prolog_trace)
696 #pragma off(Epilog_trace)
697#endif
698
699#if defined(WATCOM386)
700 /* #pragma option -zu */ /* assume SS != DS (doesn't work) */
701 /* #pragma aux pkt_release __modify[__ss] */ /* !! fix-me (doesn't work) */
702#endif
703
704#include "nochkstk.h"
705
706
710int pkt_release_handle (WORD handle)
711{
712 static IREGS regs; /* `static' because the stack could be too small */
713
714 memset (&regs, 0, sizeof(regs));
715 regs.r_ax = PD_RELEASE;
716 regs.r_bx = handle;
717
718 if (!PKT_API(&regs) && !_watt_fatal_error)
719 PKT_ERR ("Error releasing handle: ", _pkt_errno);
720 return (1);
721}
722
726int pkt_reset_handle (WORD handle)
727{
728 static IREGS regs; /* `static' because the stack could be too small */
729
730 memset (&regs, 0, sizeof(regs));
731 regs.r_ax = PD_RESET;
732 regs.r_bx = handle;
733
734 if (!PKT_API(&regs))
735 PKT_ERR ("Error resetting handle: ", _pkt_errno);
736 return (1);
737}
738
739#if (DOSX) && !defined(USE_FAST_PKT)
740static void release_callback (void)
741{
742#if (DOSX & (PHARLAP|X32VM))
743 if (rm_base)
744 _dx_free_rmode_wrapper (rm_base);
745 rm_base = 0;
746
747#elif (DOSX & POWERPAK)
748 if (rm_cb.pm_func)
749 dpmi_free_callback_retf (&rm_cb);
750 rm_cb.pm_func = 0;
751
752#elif (DOSX & DJGPP)
753 if (rm_cb.pm_offset)
754 _pkt_dpmi_free_real_mode_callback (&rm_cb);
755 rm_cb.pm_offset = 0;
756#endif
757}
758#endif /* DOSX && !USE_FAST_PKT */
759
760
764#if (DOSX) && defined(USE_FAST_PKT)
765static void release_real_mem (void)
766{
767#if (DOSX & PHARLAP)
768 if (_pkt_inf && _pkt_inf->rm_seg)
769 _dx_real_free (_pkt_inf->rm_seg);
770 rm_base = 0;
771
772#elif (DOSX & X32VM)
773 if (rm_base)
774 _x32_real_free (rm_base);
775 rm_base = 0;
776
777#elif (DOSX & POWERPAK)
778 if (_pkt_inf && _pkt_inf->rm_sel)
779 dpmi_real_free (_pkt_inf->rm_sel);
780
781#elif (DOSX & DJGPP)
782 if (_pkt_inf && _pkt_inf->rm_sel)
783 {
784 __dpmi_error = 0;
785 __dpmi_free_dos_memory (_pkt_inf->rm_sel); /* DPMI fn 101h */
786 if (__dpmi_error)
787 {
788 (*_printf) ("%s (%u): DPMI/DOS error %04Xh\n",
789 __FILE__, __LINE__, __dpmi_error);
790 TRACE_FILE ("release_real_mem: dpmi_error %u\n", __dpmi_error);
791 }
792 }
793 rm_base = (DWORD)-1; /* crash if used after freed */
794
795#elif (DOSX & DOS4GW)
796 if (!_watt_fatal_error && _pkt_inf)
797 {
798 if (_pkt_inf->rm_sel)
799 dpmi_real_free (_pkt_inf->rm_sel);
800
801#if !defined(USE_FAST_PKT)
802 if (pkt_inf_sel)
803 dpmi_real_free (pkt_inf_sel);
804 pkt_inf_sel = 0;
805#endif
806 }
807#endif
808
809 if (_pkt_inf)
810 _pkt_inf->rm_sel = _pkt_inf->rm_seg = 0;
811
812#if !defined(USE_FAST_PKT)
813 _pkt_inf = NULL; /* don't free this ptr below */
814#endif
815}
816#endif /* DOSX && USE_FAST_PKT */
817
818
827#ifdef __WATCOMC__
828#pragma aux pkt_release loadds;
829#endif
830
831#if defined(__GNUC__)
832#define DTOR __attribute__((destructor))
833#else
834#define DTOR
835#endif
836
837int DTOR pkt_release (void)
838{
839 DISABLE();
840
841 if (_pkt_inf)
842 {
843 /* Don't do this by default. It may cause some (RealTek)
844 * packet-drivers to fail all further upcalls.
845 */
846 if (pkt_do_reset)
847 pkt_reset_handle (_pkt_inf->handle);
848 pkt_release_handle (_pkt_inf->handle);
849 }
850
851/* !! pkt_interrupt = 0; */
852
860#if (DOSX)
861 #if defined(USE_FAST_PKT)
862 release_real_mem();
863 #else
864 unlock_code_and_data(); /* unlock before freeing */
865 release_callback();
866 #endif
867#endif
868
869 if (_pkt_inf && !_watt_fatal_error)
870 free (_pkt_inf);
871
872 _pkt_inf = NULL; /* drop anything still in the queue */
873
874 ENABLE();
875 return (1);
876}
877
878#if defined(__BORLANDC__)
879 #pragma exit pkt_release 100
880#endif
881
882
883#if !defined(USE_FAST_PKT) && !(DOSX & DOS4GW)
884
912#if (DOSX)
913static void pkt_enqueue (unsigned rxBuf, WORD rxLen)
914#else
915static void __cdecl _far pkt_enqueue (BYTE _far *rxBuf, WORD rxLen)
916#endif
917{
918 struct pkt_ringbuf *q = &_pkt_inf->pkt_queue;
919 int index;
920
921 /* don't use pktq_in_index() and pktq_in_buf() because they
922 * are not in locked code area.
923 */
924 index = q->in_index + 1;
925 if (index >= q->num_buf)
926 index = 0;
927
928 if (index != q->out_index)
929 {
930 char *head = (char*)q->buf_start + (q->buf_size * q->in_index);
931 int padLen = q->buf_size - 4 - rxLen;
932
933 if (rxLen > q->buf_size - 4) /* don't overwrite marker */
934 {
935 rxLen = q->buf_size - 4;
936 padLen = 0;
937 }
938
939#if (DOSX & (PHARLAP|X32VM|POWERPAK))
940 ReadRealMem (head, rm_base + rxBuf, rxLen);
941
942#elif (DOSX & DJGPP)
943 if (_pkt_inf->use_near_ptr)
944 memcpy (head, (void*)(rm_base+rxBuf+__djgpp_conventional_base), rxLen);
945 else DOSMEMGETL (rm_base + rxBuf, (rxLen+3)/4, head);
946
947#else /* real-mode targets */
948 _fmemcpy (head, rxBuf, rxLen);
949#endif
950
951 /* Zero-fill remaining old data in this buffer.
952 */
953 head += rxLen;
954 while (padLen--)
955 *head++ = '\0';
956 q->in_index = index; /* update buffer tail-index */
957 }
958 else
959 q->num_drop++; /* no room, increment drop count */
960}
961
962
963/*
964 * We have allocated a real-mode callback (RMCB) to gain control
965 * here when the packet-driver makes an upcall.
966 *
967 * Entry AL = 0; driver requests a buffer. We return ES:DI of real-mode buffer
968 * BX = handle (IP, ARP or RARP)
969 * CX = length of packet
970 *
971 * Entry AL = 1; driver has put the data in buffer, we then enqueues the buffer
972 * BX = handle (IP, ARP or RARP)
973 * CX = length of packet (same as CX above)
974 * DS:SI = *must* be same as ES:DI returned above.
975 * ES:DI = should be same as ES:DI returned above (but don't count on it).
976 *
977 * Interrupts are disabled on entry.
978 * Note: This function MUST be declared cdecl (not register called).
979 */
980#if (DOSX & (PHARLAP|X32VM))
981 static void cdecl pkt_receiver_pm (SWI_REGS *r)
982 {
983 PUSHF_CLI();
984
985 if ((BYTE)r->r_ax == 0) /* AL == 0; rx-buffer request */
986 {
987 if (!_pkt_inf || (WORD)r->r_cx > ETH_MAX)
988 {
989 r->r_es = 0;
990 r->r_di = 0;
991 }
992 else
993 {
994 r->r_es = RP_SEGM();
995 r->r_di = RX_BUF();
996 }
997 }
998 else if ((WORD)r->r_si && _pkt_inf) /* AL != 0; rx-buffer filled */
999 {
1000 pkt_enqueue (RX_BUF(), (WORD)r->r_cx);
1001 }
1002 POPF();
1003 }
1004
1005#elif (DOSX & DJGPP)
1006 static void cdecl pkt_receiver_pm (__dpmi_regs *r)
1007 {
1008 WORD fs, gs;
1009
1010 PUSHF_CLI(); /* "cld" already done in RMCB wrapper */
1011
1012 fs = get_fs_reg();
1013 gs = get_gs_reg();
1014
1015 if (r->h.al == 0)
1016 {
1017 if (!_pkt_inf || r->x.cx > ETH_MAX)
1018 {
1019 r->x.es = 0;
1020 r->x.di = 0;
1021 }
1022 else
1023 {
1024 r->x.es = RP_SEGM();
1025 r->x.di = RX_BUF();
1026 }
1027 }
1028 else if (r->x.si && _pkt_inf)
1029 {
1030 pkt_enqueue (RX_BUF(), r->x.cx);
1031 }
1032
1033 set_fs_reg (fs);
1034 set_gs_reg (gs);
1035
1036 POPF();
1037 }
1038
1039#elif (DOSX & POWERPAK)
1040 static void cdecl pkt_receiver_pm (void)
1041 {
1042 REAL_regs *r;
1043
1044 PUSHF_CLI();
1045 r = &rm_cb.rm_regs;
1046
1047 if ((BYTE)r->r_ax == 0)
1048 {
1049 if (!_pkt_inf || (WORD)r->r_cx > ETH_MAX)
1050 {
1051 r->r_es = 0;
1052 r->r_di = 0;
1053 }
1054 else
1055 {
1056 r->r_es = RP_SEGM();
1057 r->r_di = RX_BUF();
1058 }
1059 }
1060 else if (r->r_si && _pkt_inf)
1061 {
1062 pkt_enqueue (RX_BUF(), (WORD)r->r_cx);
1063 }
1064 POPF();
1065 }
1066#endif
1067
1068void _pkt_end (void) {}
1069
1070#if defined(__WATCOMC__)
1071#pragma alloc_text (pkt_lock_TEXT, pkt_enqueue, pkt_receiver_pm, _pkt_end);
1072#endif
1073
1074#endif /* !(DOSX & DOS4GW) && !USE_FAST_PKT */
1075
1076
1087int pkt_send (const void *tx, int length)
1088{
1089 IREGS regs;
1090 WORD tx_seg, tx_ofs;
1091 BOOL fail = FALSE;
1092 int tx_cnt;
1093
1094 if (!_pkt_inf)
1095 return (0);
1096
1097 PROFILE_START ("pkt_send");
1098
1099 memset (&regs, 0, sizeof(regs));
1100
1101#if (DOSX & (PHARLAP|POWERPAK))
1102 tx_seg = RP_SEGM();
1103 tx_ofs = TX_BUF();
1104 WriteRealMem (rm_base + tx_ofs, (void*)tx, length);
1105
1106#elif (DOSX & (DOS4GW|X32VM))
1107 tx_seg = RP_SEGM();
1108 tx_ofs = TX_BUF();
1109 WATT_ASSERT (tx == pkt_tx_buf()); /* no need to copy anything */
1110
1111#elif (DOSX & DJGPP)
1112 tx_seg = RP_SEGM();
1113 tx_ofs = TX_BUF();
1114 if (_pkt_inf->use_near_ptr)
1115 WATT_ASSERT (tx == pkt_tx_buf());
1116 else DOSMEMPUTL (tx, (length+3)/4, rm_base + tx_ofs);
1117
1118#else
1119 tx_seg = FP_SEG (tx);
1120 tx_ofs = FP_OFF (tx);
1121#endif
1122
1123 for (tx_cnt = 0; tx_cnt <= pkt_txretries; tx_cnt++)
1124 {
1125 regs.r_cx = length;
1126 regs.r_ax = PD_SEND;
1127 regs.r_ds = tx_seg;
1128 regs.r_si = tx_ofs;
1129
1130 fail = FALSE;
1131
1132 if (PKT_API(&regs)) /* success */
1133 break;
1134
1135 fail = TRUE;
1136 if (pkt_txwait > 0)
1137 Wait (pkt_txwait);
1138 }
1139
1140 if (tx_cnt > 0)
1141 STAT (macstats.num_tx_retry += tx_cnt-1);
1142
1143 if (fail)
1144 length = 0;
1145
1146 if (length == 0)
1147 STAT (macstats.num_tx_err++);
1148
1149 PROFILE_STOP();
1150 return (length);
1151}
1152
1156int pkt_get_addr (mac_address *mac)
1157{
1158 IREGS regs;
1159 WORD seg, ofs;
1160 int rc;
1161
1162 ASSERT_PKT_INF (0);
1163
1164 PROFILE_START ("pkt_get_addr");
1165
1166 regs.r_ax = PD_GET_ADDRESS;
1167 regs.r_bx = _pkt_inf->handle;
1168 regs.r_cx = sizeof (*mac);
1169
1170#if (DOSX)
1171 regs.r_es = seg = RP_SEGM();
1172 regs.r_di = ofs = PKT_TMP();
1173#else
1174 regs.r_es = seg = FP_SEG (mac);
1175 regs.r_di = ofs = FP_OFF (mac);
1176#endif
1177
1178 if (!PKT_API(&regs))
1179 {
1180 PKT_ERR ("Cannot read own MAC address: ", _pkt_errno);
1181 rc = 0;
1182 }
1183 else
1184 {
1185 get_rmode_data (mac, sizeof(*mac), seg, ofs);
1186 rc = 1;
1187 }
1188 PROFILE_STOP();
1189 return (rc);
1190}
1191
1195int pkt_set_addr (const void *addr)
1196{
1197 IREGS regs;
1198
1199 ASSERT_PKT_INF (0);
1200
1201 regs.r_ax = PD_SET_ADDR;
1202 regs.r_cx = sizeof (mac_address);
1203
1204#if (DOSX & DJGPP)
1205 DOSMEMPUT (addr, sizeof(mac_address), rm_base + PKT_TMP());
1206 regs.r_es = RP_SEGM();
1207 regs.r_di = PKT_TMP();
1208
1209#elif (DOSX & DOS4GW)
1210 memcpy ((void*)(rm_base + PKT_TMP()), addr, sizeof(mac_address));
1211 regs.r_es = RP_SEGM();
1212 regs.r_di = PKT_TMP();
1213
1214#elif (DOSX & (PHARLAP|X32VM|POWERPAK))
1215 WriteRealMem (rm_base + PKT_TMP(), (void*)addr, sizeof(mac_address));
1216 regs.r_es = RP_SEGM();
1217 regs.r_di = PKT_TMP();
1218
1219#else
1220 {
1221 mac_address tmp;
1222 memcpy (&tmp, addr, sizeof(tmp)); /* prevent driver modifying '*addr' */
1223 regs.r_es = FP_SEG (&tmp);
1224 regs.r_di = FP_OFF (&tmp);
1225 }
1226#endif
1227
1228 if (!PKT_API(&regs))
1229 return (0);
1230 return (1);
1231}
1232
1233#if defined(USE_STATISTICS)
1240int pkt_get_stats (struct PktStats *stats, struct PktStats *total)
1241{
1242 IREGS regs;
1243 int rc = 0;
1244
1245 PROFILE_START ("pkt_get_stats");
1246 DISABLE();
1247
1248 /* Handle in BX is optional for 1.11 drivers
1249 */
1250 regs.r_bx = _pkt_inf ? _pkt_inf->handle : 0;
1251 regs.r_ax = PD_GET_STATS;
1252
1253 if (!PKT_API(&regs))
1254 goto fail;
1255
1256 rc = 1;
1257 get_rmode_data (stats, sizeof(*stats), regs.r_ds, regs.r_si);
1258
1259 if (total)
1260 *total = *stats;
1261
1262 stats->in_packets -= init_stats.in_packets;
1263 stats->out_packets -= init_stats.out_packets;
1264 stats->in_bytes -= init_stats.in_bytes;
1265 stats->out_bytes -= init_stats.out_bytes;
1266 stats->in_errors -= init_stats.in_errors;
1267 stats->out_errors -= init_stats.out_errors;
1268 stats->lost -= init_stats.lost;
1269fail:
1270 ENABLE();
1271 PROFILE_STOP();
1272 return (rc);
1273}
1274
1275static void get_init_stats (void)
1276{
1277 IREGS regs;
1278
1279 regs.r_ax = PD_GET_STATS;
1280 regs.r_bx = _pkt_inf->handle;
1281 memset (&init_stats, 0, sizeof(init_stats));
1282
1283 DISABLE();
1284 if (PKT_API(&regs))
1285 get_rmode_data (&init_stats, sizeof(init_stats), regs.r_ds, regs.r_si);
1286 ENABLE();
1287}
1288
1289
1294static WORD cstate_dseg = 0;
1295
1296int pkt_get_vjstats (struct slcompress *vjstats)
1297{
1298 IREGS regs;
1299 int rc = 0;
1300
1301 regs.r_ax = PD_GET_VJSTATS;
1302 regs.r_bx = sizeof (*vjstats);
1303
1304 DISABLE();
1305 if (PKT_API(&regs))
1306 {
1307 get_rmode_data (vjstats, sizeof(*vjstats), regs.r_ds, regs.r_si);
1308 cstate_dseg = regs.r_ds;
1309 rc = 1;
1310 }
1311 ENABLE();
1312 return (rc);
1313}
1314
1315int pkt_get_cstate (struct cstate *cs, WORD cstate_ofs)
1316{
1317 if (cstate_dseg == 0 || cstate_ofs == 0)
1318 return (0);
1319
1320 DISABLE();
1321 get_rmode_data (cs, sizeof(*cs), cstate_dseg, cstate_ofs);
1322 ENABLE();
1323 return (1);
1324}
1325#endif /* USE_STATISTICS */
1326
1327
1331int pkt_buf_wipe (void)
1332{
1333#if defined(USE_FAST_PKT)
1334 pktq_clear (NULL);
1335#else
1336 ASSERT_PKT_INF (0);
1337 pktq_clear (&_pkt_inf->pkt_queue);
1338#endif
1339 return (1);
1340}
1341
1346void pkt_free_pkt (const void *pkt)
1347{
1348#if !defined(USE_FAST_PKT) /* packet already copied in pcsed.c */
1349 struct pkt_ringbuf *q;
1350
1351 if (!_pkt_inf || !pkt)
1352 return;
1353
1354 q = &_pkt_inf->pkt_queue;
1355 pkt_drop_cnt = q->num_drop;
1356
1357 if (pkt != (const void*) (pktq_out_buf(q) + _pkt_ip_ofs))
1358 {
1359 TRACE_CONSOLE (0, "%s: freeing illegal packet 0x%p.\n", __FILE__, pkt);
1360 pktq_clear (q);
1361 }
1362 else
1363 pktq_inc_out (q);
1364#else
1365 if (rm_base && rm_base < (DWORD)-1)
1366 pkt_drop_cnt = FAR_PEEK_DWORD (struct pkt_info, pkt_queue.num_drop);
1367 ARGSUSED (pkt);
1368#endif
1369}
1370
1371
1375int pkt_waiting (void)
1376{
1377#if defined(USE_FAST_PKT)
1378 if (rm_base && rm_base < (DWORD)-1)
1379 return pkt_buffers_used();
1380 return (-1);
1381#else
1382 if (_pkt_inf)
1383 return pktq_queued (&_pkt_inf->pkt_queue);
1384 return (-1);
1385#endif
1386}
1387
1391DWORD pkt_dropped (void)
1392{
1393#if defined(USE_FAST_PKT)
1394 if (rm_base && rm_base < (DWORD)-1)
1395 return pkt_rx_dropped();
1396#else
1397 if (_pkt_inf)
1398 return (_pkt_inf->pkt_queue.num_drop);
1399#endif
1400 return (pkt_drop_cnt); /* return last known value */
1401}
1402
1407static int parse_config_pass_1 (void)
1408{
1409 static int vect = 0;
1410 static const struct config_table pkt_init_cfg[] = {
1411 { "PKT.VECTOR", ARG_ATOX_B, (void*)&vect },
1412 { "PKT.TXRETRIES", ARG_ATOB, (void*)&pkt_txretries },
1413 { "PKT.TXWAIT", ARG_ATOI, (void*)&pkt_txwait },
1414 { "PKT.RXMODE", ARG_ATOI, (void*)&_pkt_forced_rxmode },
1415 { "PKT.RXBUFS", ARG_ATOI, (void*)&pkt_num_rx_bufs },
1416 { "PKT.NEAR_PTR", ARG_ATOI, (void*)&pkt_use_near },
1417 { "PKT.RESET", ARG_ATOI, (void*)&pkt_do_reset },
1418 { NULL, 0, NULL }
1419 };
1420 const struct config_table *cfg_save = watt_init_cfg;
1421 void (W32_CALL *init_save) (const char*, const char*) = usr_init;
1422 int rc;
1423
1424 watt_init_cfg = pkt_init_cfg;
1425 usr_init = NULL; /* only pkt_init_cfg[] gets parsed */
1426 rc = tcp_config (NULL);
1427 usr_init = init_save;
1428 watt_init_cfg = cfg_save;
1429 if (!rc)
1430 return (0);
1431 return (vect);
1432}
1433
1446int pkt_eth_init (mac_address *addr)
1447{
1448 int vector, rc = -1;
1449
1450 if (_watt_no_config && !_watt_user_config_fn)
1451 vector = 0;
1452 else vector = parse_config_pass_1();
1453
1454 if (vector)
1455 {
1456 pkt_interrupt = vector;
1457 if (pkt_interrupt < PKT_FIRST_VEC_11 || /* 0x20-0xFF range for 1.11 drvr */
1458 pkt_interrupt > PKT_LAST_VEC_11)
1459 pkt_interrupt = 0; /* discard illegal value */
1460 }
1461 else
1462 pkt_interrupt = 0;
1463
1464 {
1465#if (DOSX)
1466 int pm_driver = pkt32_drvr_probe (pm_driver_list);
1467
1468 if (pm_driver > -1)
1469 {
1470 rc = pkt32_drvr_init (pm_driver, addr);
1471 if (rc == 0)
1472 TRACE_CONSOLE (2, "Using Pmode `%s' driver at %08lX\n",
1473 pkt32_drvr_name(pm_driver), (DWORD)_pkt32_drvr);
1474 }
1475 if (rc) /* pmode driver failed, try real-mode driver */
1476#endif
1477 rc = pkt16_drvr_init (addr);
1478
1479 if (rc)
1480 return (rc); /* no suitable driver found */
1481 }
1482
1483#if defined(USE_FAST_PKT)
1484 FAR_POKE_WORD (struct pkt_info, handle, _pkt_inf->handle);
1485 FAR_POKE_WORD (struct pkt_info, is_serial, _pkt_inf->is_serial);
1486 FAR_POKE_WORD (struct pkt_info, pkt_ip_ofs, _pkt_inf->pkt_ip_ofs);
1487 FAR_POKE_WORD (struct pkt_info, pkt_type_ofs, _pkt_inf->pkt_type_ofs);
1488
1489#if (DOSX & X32VM) && 0
1490 if (!pkt_test_upcall())
1491 {
1492 pkt_release();
1493 return (-1);
1494 }
1495#endif
1496#endif
1497
1498 return (0);
1499}
1500
1505#if (DOSX & (PHARLAP|X32VM))
1506 static BOOL check_intr_num (WORD intr_num)
1507 {
1508 REALPTR rp;
1509 char temp[16];
1510
1511 _dx_rmiv_get (intr_num, &rp);
1512 if (rp)
1513 {
1514 ReadRealMem (&temp, rp, sizeof(temp));
1515 if (!memcmp(temp+3, pkt_sign, strlen(pkt_sign)))
1516 return (TRUE);
1517 }
1518 return (FALSE);
1519 }
1520
1521#elif (DOSX & DJGPP)
1522 static BOOL check_intr_num (WORD intr_num)
1523 {
1524 char temp[16];
1525 DWORD rp;
1526 __dpmi_raddr realAdr;
1527
1528 __dpmi_get_real_mode_interrupt_vector (intr_num, &realAdr);
1529 rp = (realAdr.segment << 4) + realAdr.offset16;
1530 if (rp)
1531 {
1532 dosmemget (rp, sizeof(temp), &temp);
1533 if (!memcmp(temp+3, pkt_sign, strlen(pkt_sign)))
1534 return (TRUE);
1535 }
1536 return (FALSE);
1537 }
1538
1539#elif (DOSX & DOS4GW)
1540 static BOOL check_intr_num (WORD intr_num)
1541 {
1542 const BYTE *addr = (const BYTE*) dpmi_get_real_vector (intr_num);
1543
1544 if (addr && !memcmp(addr+3, pkt_sign, strlen(pkt_sign)))
1545 return (TRUE);
1546 return (FALSE);
1547 }
1548
1549#elif (DOSX & POWERPAK)
1550 static BOOL check_intr_num (WORD intr_num)
1551 {
1552 char temp[16];
1553 DWORD addr = (DWORD) dpmi_get_real_vector (intr_num);
1554 REALPTR rp;
1555
1556 RP_SET (rp, addr & 0xF, addr >> 4);
1557 ReadRealMem (&temp, rp, sizeof(temp));
1558 if (!memcmp(temp+3, pkt_sign, strlen(pkt_sign)))
1559 return (TRUE);
1560 return (FALSE);
1561 }
1562
1563#else /* real-mode version */
1564 static BOOL check_intr_num (WORD intr_num)
1565 {
1566 char _far *addr = (char _far*) getvect (intr_num);
1567
1568#if !defined(USE_FAST_PKT)
1569 pkt_enque_ptr = pkt_enqueue;
1570 _pkt_enque_ptr = pkt_enqueue;
1571#endif
1572
1573 if (addr && !_fmemcmp(addr+3, pkt_sign, strlen(pkt_sign)))
1574 return (TRUE);
1575 return (FALSE);
1576 }
1577#endif
1578
1579/*
1580 * Find the interrupt-number for the PKTDRVR by searching interrupt
1581 * handler entries (at vector+3) for signature string "PKT DRVR".
1582 */
1583static int find_vector (int first, int num)
1584{
1585 int inum;
1586
1587 for (inum = first; inum < first + num; inum++)
1588 {
1589 if (inum != 0x67 && /* can never be at EMS vector */
1590 check_intr_num(inum))
1591 return (inum);
1592 }
1593 return (0);
1594}
1595
1596#if !defined(USE_FAST_PKT)
1597/*
1598 * DOS-extender functions for allocation a real-mode callback that
1599 * the real-mode PKTDRVR will call when a packet is received.
1600 * Lock down all code and data that is touched in this callback.
1601 */
1602#if (DOSX & (PHARLAP|X32VM))
1603 static int setup_rmode_callback (void)
1604 {
1605 rm_base = _dx_alloc_rmode_wrapper_retf (pkt_receiver_pm, NULL,
1606 RDATA_SIZE, 1024);
1607 if (!rm_base)
1608 return (-1);
1609 return (0);
1610 }
1611
1612 static int lock_code_and_data (void) /* Needed for 386|VMM only (?) */
1613 {
1614 UINT size = (UINT)_pkt_end - (UINT)pkt_enqueue;
1615
1616 _dx_lock_pgsn ((void*)pkt_enqueue, size);
1617 _dx_lock_pgsn ((void*)ReadRealMem, 100);
1618 _dx_lock_pgsn ((void*)_pkt_inf, sizeof(*_pkt_inf));
1619 _dx_lock_pgsn ((void*)&_pkt_inf, sizeof(_pkt_inf));
1620
1621 #if (DOSX & X32VM)
1622 _dx_lock_pgsn ((void*)memcpy, 200);
1623 #endif
1624 return (0);
1625 }
1626
1627 static int unlock_code_and_data (void)
1628 {
1629 UINT size = (UINT)_pkt_end - (UINT)pkt_enqueue;
1630
1631 _dx_ulock_pgsn ((void*)pkt_enqueue, size);
1632 _dx_ulock_pgsn ((void*)ReadRealMem, 100);
1633 _dx_ulock_pgsn ((void*)_pkt_inf, sizeof(*_pkt_inf));
1634 _dx_ulock_pgsn ((void*)&_pkt_inf, sizeof(_pkt_inf));
1635
1636 #if (DOSX & X32VM)
1637 _dx_ulock_pgsn ((void*)memcpy, 200);
1638 #endif
1639 return (0);
1640 }
1641
1642#elif (DOSX & DJGPP)
1643 static int setup_rmode_callback (void)
1644 {
1645 static __dpmi_regs rm_reg;
1646 int seg = __dpmi_allocate_dos_memory ((RDATA_SIZE + 15) / 16,
1647 (int*)&_pkt_inf->rm_sel);
1648 if (seg < 0)
1649 return (-2);
1650
1651 _pkt_inf->rm_seg = seg;
1652 rm_cb.pm_offset = (DWORD) pkt_receiver_pm;
1653
1654 memset (&rm_reg, 0, sizeof(rm_reg));
1655 if (_pkt_dpmi_allocate_real_mode_callback_retf (&rm_cb,&rm_reg))
1656 return (-1);
1657
1658 rm_base = (_pkt_inf->rm_seg << 4);
1659
1660 DOSMEMCLR (rm_base, RDATA_SIZE);
1661 return (0);
1662 }
1663
1664 static int lock_code_and_data (void)
1665 {
1666 DWORD size = (DWORD)_pkt_end - (DWORD)pkt_enqueue;
1667
1668 WATT_ASSERT ((DWORD)_pkt_end > (DWORD)pkt_enqueue);
1669
1670 if (_go32_dpmi_lock_code((void*)pkt_enqueue, size) ||
1671 _go32_dpmi_lock_code((void*)__movedata, 30) ||
1672 _go32_dpmi_lock_code((void*)_movedatal, 30) ||
1673 _go32_dpmi_lock_code((void*)__dj_movedata, 100) ||
1674 _go32_dpmi_lock_data(&_pkt_inf, sizeof(_pkt_inf)) ||
1675 _go32_dpmi_lock_data(_pkt_inf, sizeof(*_pkt_inf)))
1676 return (-1);
1677 /* rm_reg is already locked */
1678 return (0);
1679 }
1680
1681 static void _unlock (const void *addr, DWORD size)
1682 {
1683 __dpmi_meminfo mem;
1684 DWORD base = 0;
1685
1686 __dpmi_get_segment_base_address (_my_ds(), &base);
1687 mem.address = base + (DWORD)addr;
1688 mem.size = size;
1689 __dpmi_unlock_linear_region (&mem);
1690 }
1691
1692 static int unlock_code_and_data (void)
1693 {
1694 _unlock ((void*)pkt_enqueue, (DWORD)_pkt_end - (DWORD)pkt_enqueue);
1695 _unlock ((void*)__movedata, 30);
1696 _unlock ((void*)_movedatal, 30);
1697 _unlock ((void*)__dj_movedata, 100);
1698 _unlock (_pkt_inf, sizeof(*_pkt_inf));
1699 _unlock (&_pkt_inf, sizeof(_pkt_inf));
1700 return (0);
1701 }
1702
1703#elif (DOSX & DOS4GW)
1704 static int setup_rmode_callback (void)
1705 {
1706 int length;
1707
1708 /* test for asmpkt4.asm/pcpkt.h mismatch
1709 */
1710 if (asmpkt_size_chk != sizeof(*_pkt_inf))
1711 {
1712#ifdef USE_DEBUG
1713 fprintf (stderr,
1714 "%s (%u): Development error:\n"
1715 " sizeof(pkt_info) = %u pcpkt.h\n"
1716 " sizeof(pkt_info) = %u asmpkt4.asm, (diff %d)\n",
1717 __FILE__, __LINE__,
1718 sizeof(*_pkt_inf), asmpkt_size_chk,
1719 sizeof(*_pkt_inf) - asmpkt_size_chk);
1720#endif
1721 return (-3);
1722 }
1723
1724 /* Allocate DOS-memory for pkt_receiver4_rm() and temp/Tx buffers.
1725 */
1726 length = TX_BUF() + RX_SIZE;
1727 _pkt_inf->rm_seg = dpmi_real_malloc (length, &_pkt_inf->rm_sel);
1728 if (!_pkt_inf->rm_seg)
1729 return (-2);
1730
1731 rm_base = ((DWORD)_pkt_inf->rm_seg) << 4;
1732
1733 /* Clear DOS area and copy code down into it.
1734 */
1735 memset ((void*)rm_base, 0, length);
1736 length = PKT_TMP() - 1;
1737 memcpy ((void*)rm_base, pkt_receiver4_start, length);
1738 return (0);
1739 }
1740
1741 /* No need (?) to lock anything.
1742 */
1743 static int lock_code_and_data (void)
1744 {
1745 return (0);
1746 }
1747
1748 static int unlock_code_and_data (void)
1749 {
1750 return (0);
1751 }
1752
1753#elif (DOSX & POWERPAK)
1754 static int setup_rmode_callback (void)
1755 {
1756 /* Allocate DOS-memory for temp/Tx buffers.
1757 */
1758 _pkt_inf->rm_seg = dpmi_real_malloc (RDATA_SIZE, &_pkt_inf->rm_sel);
1759 if (!_pkt_inf->rm_seg)
1760 return (-2);
1761
1762 rm_base = (REALPTR) ((DWORD)_pkt_inf->rm_seg << 16);
1763
1764 rm_cb.pm_func = pkt_receiver_pm;
1765 if (!dpmi_alloc_callback_retf(&rm_cb))
1766 return (-1);
1767 return (0);
1768 }
1769
1770 static int lock_code_and_data (void)
1771 {
1772 unsigned size = (unsigned)_pkt_end - (unsigned)pkt_enqueue;
1773
1774 if (!dpmi_lock_region ((void*)pkt_enqueue, size) ||
1775 !dpmi_lock_region ((void*)ReadRealMem, 100) ||
1776 !dpmi_lock_region ((void*)_pkt_inf, sizeof(*_pkt_inf)) ||
1777 !dpmi_lock_region ((void*)&_pkt_inf, sizeof(_pkt_inf)))
1778 return (-1);
1779 return (0);
1780 }
1781
1782 static int unlock_code_and_data (void)
1783 {
1784 unsigned size = (unsigned)_pkt_end - (unsigned)pkt_enqueue;
1785
1786 if (!dpmi_unlock_region ((void*)pkt_enqueue, size) ||
1787 !dpmi_unlock_region ((void*)ReadRealMem, 100) ||
1788 !dpmi_unlock_region ((void*)_pkt_inf, sizeof(*_pkt_inf)) ||
1789 !dpmi_unlock_region ((void*)&_pkt_inf, sizeof(_pkt_inf)))
1790 return (-1);
1791 return (0);
1792 }
1793#endif
1794#endif /* !USE_FAST_PKT */
1795
1796
1797/*
1798 * For DOS4GW targets, allocate the '_pkt_inf' structure
1799 * from DOS memory. All others allocate from heap.
1800 */
1801static int setup_pkt_inf (void)
1802{
1807 int size = sizeof (*_pkt_inf);
1808
1809#if (DOSX & DOS4GW) && !defined(USE_FAST_PKT)
1810 DWORD seg;
1811
1812 WATT_ASSERT (size < USHRT_MAX); /* max alloc from DOS is 64k */
1813
1814 seg = dpmi_real_malloc (size, &pkt_inf_sel);
1815
1816 asmpkt_inf = (struct pkt_info*) (seg << 16); /* run-time location */
1817 _pkt_inf = (struct pkt_info*) (seg << 4);
1818
1819#else
1820 _pkt_inf = malloc (size);
1821#endif
1822
1823 if (!_pkt_inf) /* Allocation failed */
1824 return (0);
1825
1826 memset (_pkt_inf, 0, size); /* Clear area */
1827
1828#if defined(USE_FAST_PKT)
1829 rm_base = setup_pkt_inf_fast();
1830 if (!rm_base)
1831 return (0);
1832
1833#else
1834 pktq_init (&_pkt_inf->pkt_queue,
1835 sizeof(_pkt_inf->rx_buf[0]), /* RX_SIZE */
1836 DIM(_pkt_inf->rx_buf), /* RX_BUFS */
1837 (char*)&_pkt_inf->rx_buf);
1838#endif
1839
1840#if (DOSX & DOS4GW) && !defined(USE_FAST_PKT)
1841 _pkt_inf->pkt_queue.dos_ofs = offsetof (struct pkt_info, rx_buf[0]);
1842#elif (DOSX & DJGPP)
1843 _pkt_inf->dos_ds = _dos_ds;
1844#endif
1845
1846#if (DOSX & DJGPP)
1847 if (pkt_use_near)
1848 {
1849 if (!(_crt0_startup_flags & _CRT0_FLAG_NEARPTR))
1850 TRACE_CONSOLE (1, "Near-pointers not enabled\n");
1851 else
1852 {
1853 _pkt_inf->use_near_ptr = TRUE;
1854 TRACE_CONSOLE (1, "Near-pointers enabled\n");
1855 }
1856 }
1857 else if (_crt0_startup_flags & _CRT0_FLAG_NEARPTR)
1858 TRACE_CONSOLE (1, "Near-pointers on, but \"PKT.NEAR_PTR = 0\"\n");
1859#endif
1860
1861 return (1);
1862}
1863
1864
1868static void get_rmode_data (void *dest, unsigned size, WORD seg, WORD ofs)
1869{
1870#if (DOSX & (PHARLAP|X32VM|POWERPAK))
1871 REALPTR rp;
1872 RP_SET (rp, ofs, seg);
1873 ReadRealMem (dest, rp, size);
1874
1875#elif (DOSX & DOS4GW)
1876 memcpy (dest, SEG_OFS_TO_LIN(seg,ofs), size);
1877
1878#elif (DOSX & DJGPP)
1879 dosmemget (ofs + (seg << 4), size, dest);
1880
1881#else
1882 _fmemcpy (dest, MK_FP(seg,ofs), size);
1883#endif
1884}
1885
1886
1895static BOOL pkt_api_entry (IREGS *reg, unsigned line)
1896{
1897 _pkt_errno = 0;
1898 reg->r_flags = 0;
1899
1900#if (DOSX)
1903 if (_pkt32_drvr)
1904 {
1905 if (!(*_pkt32_drvr)(reg)) /* call the pmode interface */
1906 {
1907 /* _pkt_errno should be set above */
1908 reg->r_flags |= CARRY_BIT;
1909 return (FALSE);
1910 }
1911 return (TRUE);
1912 }
1913#endif
1914
1915 if (!pkt_interrupt)
1916 {
1917#if defined(USE_DEBUG)
1918 fprintf (stderr, "%s (%d): API called after deinit.\n", __FILE__, line);
1919#endif
1920 reg->r_flags |= CARRY_BIT;
1921 ARGSUSED (line);
1922 _pkt_errno = PDERR_BAD_COMMAND;
1923 return (FALSE);
1924 }
1925
1926 /* Use the 16-bit real-mode PKTDRVR API.
1927 */
1928 GEN_INTERRUPT (pkt_interrupt, reg);
1929
1930 if (reg->r_flags & CARRY_BIT)
1931 {
1932 _pkt_errno = hiBYTE (reg->r_dx); /* DH has error-code */
1933 return (FALSE);
1934 }
1935 return (TRUE);
1936}
1937
1938
1953int pkt_set_rcv_mode (int mode)
1954{
1955 IREGS regs;
1956
1957 if (!_pkt_inf)
1958 {
1959 _pkt_errno = PDERR_BAD_HANDLE;
1960 return (0);
1961 }
1962
1963 regs.r_ax = PD_SET_RCV;
1964 regs.r_bx = _pkt_inf->handle;
1965 regs.r_cx = mode;
1966
1967 /* This needs an Extended driver. SLIP/PPP is point-to-point.
1968 */
1969 if (_pktdevlevel < 2 || _pktserial)
1970 {
1971 _pkt_errno = PDERR_CANT_SET;
1972 return (0);
1973 }
1974
1975 if (!PKT_API(&regs))
1976 {
1977 PKT_ERR ("Error setting receiver mode: ", _pkt_errno);
1978 return (0);
1979 }
1980 _pkt_rxmode = mode;
1981 return (1);
1982}
1983
1997int pkt_get_rcv_mode (void)
1998{
1999 IREGS regs;
2000
2001 ASSERT_PKT_INF (-1);
2002
2003 regs.r_ax = PD_GET_RCV;
2004 regs.r_bx = _pkt_inf->handle;
2005
2006 /* This needs an Extended driver (not SLIP/PPP)
2007 */
2008 if (_pktdevlevel < 2 || _pktserial)
2009 {
2010 _pkt_errno = PDERR_BAD_COMMAND;
2011 return (0);
2012 }
2013
2014 if (!PKT_API(&regs))
2015 {
2016 PKT_ERR ("Error getting receive mode: ", _pkt_errno);
2017 return (0);
2018 }
2019 _pkt_rxmode = regs.r_ax;
2020 return (regs.r_ax);
2021}
2022
2023
2024#if defined(USE_MULTICAST)
2035int pkt_get_multicast_list (mac_address *listbuf, int *lenp)
2036{
2037 IREGS regs;
2038 int len = *lenp;
2039
2040 ASSERT_PKT_INF (0);
2041
2042 regs.r_ax = PD_GET_MULTI;
2043 _pkt_errno = PDERR_NO_MULTICAST;
2044
2045 /* Basic drivers don't support multicast
2046 */
2047 if (_pktdevlevel < 2 || _pktserial ||
2048 (got_params && pkt_params.multicast_avail == 0) ||
2049 !PKT_API(&regs))
2050 {
2051 if (debug_on > 0)
2052 PKT_ERR ("Error getting multicast list: ", _pkt_errno);
2053 return (0);
2054 }
2055
2056 if ((WORD)regs.r_cx == 0) /* no MC addresses, okay */
2057 {
2058 memset (listbuf, 0, len);
2059 *lenp = 0;
2060 return (1);
2061 }
2062
2063 /* move it into the caller's buffer
2064 */
2065 DISABLE();
2066 len = min (len, (WORD)regs.r_cx);
2067 get_rmode_data (listbuf, len, regs.r_es, regs.r_di);
2068 *lenp = len;
2069 ENABLE();
2070 return (1);
2071}
2072
2082int pkt_set_multicast_list (const void *listbuf, int len)
2083{
2084 IREGS regs;
2085 WORD seg, ofs;
2086
2087 ASSERT_PKT_INF (0);
2088
2089 /* Basic drivers don't support multicast
2090 */
2091 if (_pktdevlevel < 2 || _pktserial ||
2092 (got_params && pkt_params.multicast_avail == 0)) /* no point in trying */
2093 {
2094 _pkt_errno = PDERR_NO_MULTICAST;
2095 return (0);
2096 }
2097
2098#if (DOSX)
2099 if (len > PKT_TMP_SIZE)
2100 {
2101 _pkt_errno = PDERR_NO_SPACE;
2102 return (0);
2103 }
2104#endif
2105
2106 DISABLE();
2107
2108#if (DOSX & (PHARLAP|X32VM|POWERPAK))
2109 seg = RP_SEGM();
2110 ofs = PKT_TMP();
2111 WriteRealMem (rm_base + PKT_TMP(), (void*)listbuf, len);
2112
2113#elif (DOSX & DOS4GW)
2114 seg = RP_SEGM();
2115 ofs = PKT_TMP();
2116 memcpy ((void*)(rm_base + PKT_TMP()), listbuf, len);
2117
2118#elif (DOSX & DJGPP)
2119 seg = RP_SEGM();
2120 ofs = PKT_TMP();
2121 DOSMEMPUT (listbuf, len, rm_base + PKT_TMP());
2122
2123#else
2124 seg = FP_SEG (listbuf);
2125 ofs = FP_OFF (listbuf);
2126#endif
2127
2128 ENABLE();
2129
2130 regs.r_ax = PD_SET_MULTI;
2131 regs.r_cx = len;
2132 regs.r_es = seg;
2133 regs.r_di = ofs;
2134
2135 if (!PKT_API(&regs))
2136 {
2137 if (debug_on > 0)
2138 PKT_ERR ("Error setting multicast list: ", _pkt_errno);
2139 return (0);
2140 }
2141 return (1);
2142}
2143#endif /* USE_MULTICAST */
2144#endif /* __MSDOS__ */
2145
asmpkt.h
copyrigh.h
cpumodel.h
language.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
Wait
void Wait(unsigned msec)
Not all vendors have delay().
Definition: misc.c:777
misc.h
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
nochkstk.h
pcconfig.h
pcdbug.h
pcigmp.h
pcpkt32.h
pkt16_drvr_init
static int pkt16_drvr_init(mac_address *mac_addr)
Called from pkt_eth_init() to search for PKTDRVR.
Definition: pcpkt.c:577
cstate_dseg
static WORD cstate_dseg
Get VJ-compression statistics from pkt-driver.
Definition: pcpkt.c:1294
_pktdevlevel
BYTE _pktdevlevel
basic unless otherwise specified
Definition: pcpkt.c:52
pkt_buf_wipe
int pkt_buf_wipe(void)
Clear the receive queue.
Definition: pcpkt.c:1331
pkt_get_params
int pkt_get_params(struct PktParameters *params)
Get PKTDRVR parameters (MTU, version etc.)
Definition: pcpkt.c:465
pkt_set_access
static int pkt_set_access(void)
Setup the receiver upcall handler.
Definition: pcpkt.c:331
_pkt_rxmode0
int _pkt_rxmode0
startup receive mode
Definition: pcpkt.c:54
pkt_get_drvr_ver
int pkt_get_drvr_ver(WORD *major, WORD *minor, WORD *unused1, WORD *unused2)
Return version of PKTDRVR.
Definition: pcpkt.c:531
pkt_get_api_ver
int pkt_get_api_ver(WORD *ver)
Return version of spec.
Definition: pcpkt.c:518
pkt_get_mtu
int pkt_get_mtu(void)
Return PKTDRVR maximum-transmit-units (MTU).
Definition: pcpkt.c:488
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
pkt_get_rcv_mode
int pkt_get_rcv_mode(void)
Gets the receive mode of the interface (can never be mode 0).
Definition: pcpkt.c:1997
pkt_error
const char * pkt_error
Last pkt error string
Definition: pcpkt.c:56
pkt_get_vector
W32_FUNC int W32_CALL pkt_get_vector(void)
Return PKTDRVR vector.
Definition: pcpkt.c:545
pkt_free_pkt
void pkt_free_pkt(const void *pkt)
Release a packet from the receive queue.
Definition: pcpkt.c:1346
parse_config_pass_1
static int parse_config_pass_1(void)
Search WATTCP.CFG file for "PKT.VECTOR = 0x??" etc.
Definition: pcpkt.c:1407
_pkt_inf
struct pkt_info * _pkt_inf
module data that will be locked
Definition: pcpkt.c:61
pkt_set_multicast_list
int pkt_set_multicast_list(const void *listbuf, int len)
Sets the list of multicast addresses for which the PKTDRVR is responsible.
Definition: pcpkt.c:2082
pkt_release
int DTOR pkt_release(void)
Definition: pcpkt.c:837
pkt_tx_buf
void * pkt_tx_buf(void)
Return address of DOS memory Tx-buffer.
Definition: pcpkt.c:302
_pkt_ip_ofs
WORD _pkt_ip_ofs
ofs from link-layer head to ip
Definition: pcpkt.c:49
pkt_get_multicast_list
int pkt_get_multicast_list(mac_address *listbuf, int *lenp)
Gets the current list of multicast addresses from the PKTDRVR.
Definition: pcpkt.c:2035
pkt_enqueue
static void pkt_enqueue(unsigned rxBuf, WORD rxLen) static void __cdecl _far pkt_enqueue(BYTE _far *rxBuf
Enqueue a received packet into '_pkt_inf->pkt_queue'.
pkt_drvr_info
static int pkt_drvr_info(void)
Fetch the PKTDRVR information.
Definition: pcpkt.c:381
_pkt_rxmode
int _pkt_rxmode
active receive mode
Definition: pcpkt.c:53
pkt_eth_init
int pkt_eth_init(mac_address *addr)
Initialise Packet driver interface.
Definition: pcpkt.c:1446
check_intr_num
static BOOL check_intr_num(WORD intr_num)
Check a single interrupt vector for signature string "PKT DRVR" at offset 3 into intr-handler.
Definition: pcpkt.c:1506
_pkt_errno
int _pkt_errno
error code set in pcpkt.c API
Definition: pcpkt.c:55
pkt_reset_handle
int pkt_reset_handle(WORD handle)
Reset the driver-state associated with handle.
Definition: pcpkt.c:726
pkt_dropped
DWORD pkt_dropped(void)
Return number of packets dropped.
Definition: pcpkt.c:1391
pkt_get_stats
int pkt_get_stats(struct PktStats *stats, struct PktStats *total)
Get PKTDRVR statistics.
Definition: pcpkt.c:1240
pkt_waiting
int pkt_waiting(void)
Return number of packets waiting in queue.
Definition: pcpkt.c:1375
release_real_mem
static void release_real_mem(void)
Release allocated DOS memory.
Definition: pcpkt.c:765
pkt_release_handle
int pkt_release_handle(WORD handle)
Release the allocated protocol handle.
Definition: pcpkt.c:710
pkt_get_mac_len
int pkt_get_mac_len(void)
Return length of MAC address.
Definition: pcpkt.c:503
pkt_strerror
const char *W32_CALL pkt_strerror(int code)
Return textual error representing error-code.
Definition: pcpkt.c:216
pkt_api_entry
static BOOL pkt_api_entry(IREGS *reg, unsigned called_from_line)
The API entry to the network link-driver.
Definition: pcpkt.c:1895
pkt_set_addr
int pkt_set_addr(const void *addr)
Set a new MAC source address.
Definition: pcpkt.c:1195
_pkt_type_ofs
WORD _pkt_type_ofs
ofs from link-layer head to type
Definition: pcpkt.c:50
get_rmode_data
static void get_rmode_data(void *dest, unsigned size, WORD seg, WORD ofs)
Return PKTDRVR data at seg:ofs, Copy to 'dest'.
Definition: pcpkt.c:1868
pkt_get_addr
int pkt_get_addr(mac_address *mac)
Return the MAC address.
Definition: pcpkt.c:1156
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
pkt_send
int pkt_send(const void *tx, int length)
Send a link-layer frame.
Definition: pcpkt.c:1087
pkt_set_rcv_mode
int pkt_set_rcv_mode(int mode)
Sets the receive mode of the interface.
Definition: pcpkt.c:1953
setup_pkt_inf
static int setup_pkt_inf(void)
Definition: pcpkt.c:1801
pcpkt.h
RXMODE_PROMISCOUS
@ RXMODE_PROMISCOUS
receive all packets on network
Definition: pcpkt.h:114
RXMODE_BROADCAST
@ RXMODE_BROADCAST
DIRECT + broadcast packets
Definition: pcpkt.h:111
pcqueue.h
pcsed.h
pcstat.h
powerpak.h
profile.h
_watt_no_config
BOOL _watt_no_config
run with no config file (embedded/diskless)
Definition: sock_ini.c:134
sock_ini.h
DPMI_callback
Definition: powerpak.h:33
IREGS
Definition: misc.h:610
PktParameters
Definition: tcp.h:830
PktStats
Definition: tcp.h:806
REAL_regs
Definition: powerpak.h:17
SWI_REGS
Definition: x32vm.h:16
code
Definition: zinftree.h:24
config_table
Definition: tcp.h:461
cstate
Definition: pcpkt.h:135
eth_Header
Definition: pcsed.h:20
fddi_Header
Definition: pcsed.h:149
pkt_info
Placeholder for vital data accessed by capture thread.
Definition: pcpkt.h:206
pkt_ringbuf
FIFO style ring-buffer.
Definition: pcqueue.h:81
pkt_ringbuf::buf_start
DWORD_PTR buf_start
start of buffer pool (linear addr)
Definition: pcqueue.h:87
pkt_ringbuf::num_drop
volatile DWORD num_drop
number of dropped pkts
Definition: pcqueue.h:86
pkt_ringbuf::num_buf
WORD num_buf
number of buffers
Definition: pcqueue.h:85
pkt_ringbuf::out_index
WORD out_index
index of buffer pulled out
Definition: pcqueue.h:83
pkt_ringbuf::dos_ofs
WORD dos_ofs
offset of pool, used by rmode stub
Definition: pcqueue.h:89
pkt_ringbuf::in_index
volatile WORD in_index
index ahead of last buffer put
Definition: pcqueue.h:82
pkt_ringbuf::buf_size
WORD buf_size
size of each buffer
Definition: pcqueue.h:84
slcompress
Definition: pcpkt.h:148
tok_Header
Definition: pcsed.h:70
ARG_ATOB
@ ARG_ATOB
convert to 8-bit byte
Definition: tcp.h:449
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
ARG_ATOX_B
@ ARG_ATOX_B
convert to hex-byte
Definition: tcp.h:452
timer.h
wattcp.h
Core definitions.
wdpmi.h
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/pcpkt.h Source File

  • src
pcpkt.h
Go to the documentation of this file.
1
3#ifndef _w32_PCPKT_H
4#define _w32_PCPKT_H
5
6#ifndef _w32_PCQUEUE_H
7#include "pcqueue.h"
8#endif
9
10#ifndef _w32_PCSED_H
11#include "pcsed.h"
12#endif
13
14
15#if defined(WIN32)
16 #define PKTDRVR_STR "WinPcap"
17#else
18 #define PKTDRVR_STR "PKTDRVR"
19#endif
20
21/*
22 * Common stuff for PKTDRVR and Windows interfaces
23 */
24#if defined(USE_DEBUG)
25 #define ASSERT_PKT_INF(rc) do { \
26 if (!_pkt_inf) { \
27 (*_printf) ("%s (%u): " \
28 "_pkt_inf == NULL\n", \
29 __FILE__, __LINE__); \
30 return (rc); \
31 } \
32 } while (0)
33#else
34 #define ASSERT_PKT_INF(rc) do { \
35 if (!_pkt_inf) \
36 return (rc); \
37 } while (0)
38#endif
39
40W32_DATA WORD _pktdevclass;
41W32_DATA WORD _pkt_ip_ofs;
42W32_DATA BOOL _pktserial;
43W32_DATA char _pktdrvrname[];
44W32_DATA int _pkt_rxmode;
45W32_DATA int _pkt_rxmode0;
46W32_DATA int _pkt_forced_rxmode;
47W32_DATA int _pkt_errno;
54#if defined(WIN32)
55
56#include "winpkt.h"
57
58#else /* rest of file */
59
60/* Basic PD Functions.
61 */
62#define PD_DRIVER_INFO 0x01FF
63#define PD_ACCESS 0x0200
64#define PD_RELEASE 0x0300
65#define PD_SEND 0x0400
66#define PD_TERMINATE 0x0500
67#define PD_GET_ADDRESS 0x0600
68#define PD_RESET 0x0700
69
70/* Extended PD Functions (1.09+)
71 */
72#define PD_GET_PARAM 0x0A00
73#define PD_ASY_SEND_109 0x0B00
74#define PD_ASY_SEND 0x0C00
75#define PD_ASY_DROP 0x0D00
76#define PD_SET_RCV 0x1400
77#define PD_GET_RCV 0x1500
78#define PD_SET_MULTI 0x1600
79#define PD_GET_MULTI 0x1700
80#define PD_GET_STATS 0x1800
81#define PD_SET_ADDR 0x1900
82#define PD_RAW_SEND 0x1A00
83#define PD_RAW_FLUSH 0x1B00
84#define PD_RAW_GET 0x1C00
85#define PD_SIGNAL 0x1D00
86#define PD_GET_STRUCT 0x1E00
87#define PD_GET_VJSTATS 0x8100
89/* Packet-Driver Error Returns.
90 */
91#define PDERR_BAD_HANDLE 1
92#define PDERR_NO_CLASS 2
93#define PDERR_NO_TYPE 3
94#define PDERR_NO_NUMBER 4
95#define PDERR_BAD_TYPE 5
96#define PDERR_NO_MULTICAST 6
97#define PDERR_CANT_TERMINATE 7
98#define PDERR_BAD_MODE 8
99#define PDERR_NO_SPACE 9
100#define PDERR_TYPE_INUSE 10
101#define PDERR_BAD_COMMAND 11
102#define PDERR_CANT_SEND 12
103#define PDERR_CANT_SET 13
104#define PDERR_BAD_ADDRESS 14
105#define PDERR_CANT_RESET 15
106#define PDERR_BASIC_DVR 16
107
108enum ReceiveModes {
109 RXMODE_OFF = 1,
110 RXMODE_DIRECT = 2,
111 RXMODE_BROADCAST = 3,
112 RXMODE_MULTICAST1 = 4,
113 RXMODE_MULTICAST2 = 5,
114 RXMODE_PROMISCOUS = 6
115 };
116
117W32_DATA BYTE _pktdevlevel;
119#if defined(USE_MULTICAST)
120 extern int pkt_get_multicast_list (mac_address *listbuf, int *len);
121 extern int pkt_set_multicast_list (const void *listbuf, int len);
122#endif
123
124#include <sys/pack_on.h> /* cstate, slcompress etc. must be packed */
125
126/*\struct cstate
127 *
128 * Statistics returned from DOS-PPP.
129 *
130 * "state" data for each active tcp conversation on the wire. This is
131 * basically a copy of the entire IP/TCP header from the last packet
132 * we saw from the conversation together with a small identifier
133 * the transmit & receive ends of the line use to locate saved header.
134 */
135struct cstate {
136 BYTE cs_this; /* connection id number (xmit) */
137 WORD cs_next; /* next in ring (xmit) */
138 in_Header cs_ip; /* ip/tcp hdr from most recent packet */
139 tcp_Header cs_tcp;
140 BYTE cs_ipopt[40];
141 BYTE cs_tcpopt[40];
142 };
143
144/*\struct slcompress
145 *
146 * Serial line compression statistics.
147 */
148struct slcompress {
149 WORD cstate_ptr_tstate; /* transmit connection states (DOSPPP is small model) */
150 WORD cstate_ptr_rstate; /* receive connection states */
151
152 BYTE tslot_limit; /* highest transmit slot id (0-l) */
153 BYTE rslot_limit; /* highest receive slot id (0-l) */
154
155 BYTE xmit_oldest; /* oldest xmit in ring */
156 BYTE xmit_current; /* most recent xmit id */
157 BYTE recv_current; /* most recent rcvd id */
158 BYTE flags;
159
160 DWORD sls_o_nontcp; /* outbound non-TCP packets */
161 DWORD sls_o_tcp; /* outbound TCP packets */
162 DWORD sls_o_uncompressed; /* outbound uncompressed packets */
163 DWORD sls_o_compressed; /* outbound compressed packets */
164 DWORD sls_o_searches; /* searches for connection state */
165 DWORD sls_o_misses; /* times couldn't find conn. state */
166
167 DWORD sls_i_uncompressed; /* inbound uncompressed packets */
168 DWORD sls_i_compressed; /* inbound compressed packets */
169 DWORD sls_i_error; /* inbound error packets */
170 DWORD sls_i_tossed; /* inbound packets tossed because of error */
171
172 DWORD sls_i_runt; /* inbound packets too short */
173 DWORD sls_i_badcheck; /* inbound IP-packets with chksum error */
174 };
175
176extern int pkt_get_vjstats (struct slcompress *vjstats);
177extern int pkt_get_cstate (struct cstate *cs, WORD cstate_ofs);
178
179
180/*\struct async_iocb
181 *
182 * I/O structure for asynchronous transmit function (v1.11, AH = 12)
183 * (not used)
184 */
185struct async_iocb {
186 DWORD buffer; /* Pointer to xmit buffer */
187 WORD length; /* Length of buffer */
188 BYTE flagbits; /* Flag bits */
189 BYTE code; /* Error code */
190 DWORD xmit_func; /* Transmitter upcall */
191 char reserved[4]; /* Future gather-write data */
192 char priv_data[8]; /* Driver's private data */
193 };
194
195#define ASY_DONE 1 /* packet driver is done with this iocb */
196#define ASY_UPCALL 2 /* requests an upcall when the buffer is re-usable */
197
198/*\struct pkt_info
199 *
200 * Placeholder for vital data accessed on packet-driver upcall.
201 *
202 * Keep it gathered to simplify locking memory at `_pkt_inf'.
203 * For DOS4GW targets; this structure \b MUST match same structure
204 * in \b asmpkt4.asm.
205 */
206struct pkt_info {
207 WORD rm_sel, rm_seg, rm_ofs; /* real selector, segment, ofs */
208 WORD dos_ds; /* copy of _dos_ds */
209 WORD use_near_ptr; /* near-pointers enabled */
210 WORD handle; /* Packet-driver handle */
211 WORD is_serial; /* duplicated from _pktserial */
212 WORD pkt_ip_ofs; /* store length of MAC-header */
213 WORD pkt_type_ofs; /* offset to MAC-type */
214 struct pkt_ringbuf pkt_queue; /* Ring-struct for enqueueing */
215
216#if !defined(USE_FAST_PKT)
217 /* USE_FAST_PKT uses a single rx_buf in pcpkt2.c
218 */
219 struct pkt_rx_element rx_buf [RX_BUFS];
220#endif
221 };
222
223extern struct pkt_info *_pkt_inf;
224
225#include <sys/pack_off.h> /* restore default packing */
226
227/*
228 * sizeof(*_pkt_inf), __LARGE__
229 * 3*2 = 6
230 * 16 = 16
231 * 5*1524 = 7620
232 * = 7642
233 *
234 * sizeof(*_pkt_inf), DOS4GW
235 * 3*2 = 6
236 * 26 = 26
237 * 20*(14+1500+10) = 30480
238 * = 30512
239 */
240
241#if (DOSX & (DOS4GW|X32VM|DJGPP))
242 extern void *pkt_tx_buf (void);
243#endif
244
245/* pcpkt2.c */
246extern DWORD pkt_rx_dropped (void);
247extern int pkt_test_reordering (void);
248
249#if defined(USE_FAST_PKT)
250 extern int pkt_append_recv (const void *tx, unsigned len);
251 extern int pkt_buffers_used (void);
252 extern int pkt_test_upcall (void);
253 extern void pkt_dump_real_mem(void);
254
255 extern struct pkt_rx_element *pkt_poll_recv (void);
256#endif
257
258
259#define ROUND_UP32(sz) (4 * (((sz) + 3) / 4))
260
261#if (DOSX & DJGPP)
262 extern void __dj_movedata (void); /* called by __movedata() */
263 extern void __movedata (unsigned src_sel, unsigned src_ofs,
264 unsigned dst_sel, unsigned dst_ofs,
265 size_t bytes);
266
267 #define DOSMEMGET(ofs,len,buf) __movedata (_pkt_inf->dos_ds, \
268 (unsigned)(ofs), \
269 (unsigned)_my_ds(), \
270 (unsigned)(buf), \
271 len)
272 #define DOSMEMGETL(ofs,d32,buf) _movedatal (_pkt_inf->dos_ds, \
273 (unsigned)(ofs), \
274 (unsigned)_my_ds(), \
275 (unsigned)(buf), \
276 d32)
277 #define DOSMEMPUT(buf,len,ofs) __movedata ((unsigned)_my_ds(), \
278 (unsigned)(buf), \
279 _pkt_inf->dos_ds, \
280 (unsigned)(ofs), \
281 len)
282 #define DOSMEMPUTL(buf,d32,ofs) _movedatal ((unsigned)_my_ds(), \
283 (unsigned)(buf), \
284 _pkt_inf->dos_ds, \
285 (unsigned)(ofs), \
286 d32)
287
288 #define DOSMEMCLR(ofs,len) \
289 do { \
290 int i = ROUND_UP32 (len) - 4; \
291 _farsetsel (_dos_ds); /* FS=dos DS */ \
292 for ( ; i >= 0; i -= 4) \
293 _farnspokel (ofs+i, 0L); \
294 } while (0)
295
296#endif /* (DOSX & DJGPP) */
297#endif /* WIN32 */
298#endif
299
pack_off.h
pack_on.h
_pktdevclass
W32_DATA WORD _pktdevclass
Driver class; <tcp.h> for values.
Definition: pcpkt.h:40
_pkt_ip_ofs
W32_DATA WORD _pkt_ip_ofs
Offset from MAC-header to IP-header.
Definition: pcpkt.h:41
pkt_get_multicast_list
int pkt_get_multicast_list(mac_address *listbuf, int *len)
Gets the current list of multicast addresses from the PKTDRVR.
Definition: pcpkt.c:2035
ReceiveModes
ReceiveModes
Definition: pcpkt.h:108
RXMODE_OFF
@ RXMODE_OFF
turn off receiver
Definition: pcpkt.h:109
RXMODE_PROMISCOUS
@ RXMODE_PROMISCOUS
receive all packets on network
Definition: pcpkt.h:114
RXMODE_DIRECT
@ RXMODE_DIRECT
receive only to this interface
Definition: pcpkt.h:110
RXMODE_BROADCAST
@ RXMODE_BROADCAST
DIRECT + broadcast packets
Definition: pcpkt.h:111
RXMODE_MULTICAST2
@ RXMODE_MULTICAST2
BROADCAST + all multicast
Definition: pcpkt.h:113
RXMODE_MULTICAST1
@ RXMODE_MULTICAST1
BROADCAST + limited multicast
Definition: pcpkt.h:112
_pkt_rxmode
W32_DATA int _pkt_rxmode
Current PKTDRVR/WinPcap Rx-mode.
Definition: pcpkt.h:44
_pkt_inf
struct pkt_info * _pkt_inf
module data that will be locked
Definition: pcpkt.c:61
pkt_set_multicast_list
int pkt_set_multicast_list(const void *listbuf, int len)
Sets the list of multicast addresses for which the PKTDRVR is responsible.
Definition: pcpkt.c:2082
pkt_tx_buf
void * pkt_tx_buf(void)
Return address of DOS memory Tx-buffer.
Definition: pcpkt.c:302
_pkt_errno
W32_DATA int _pkt_errno
Last PKTDRVR error code.
Definition: pcpkt.h:47
_pktserial
W32_DATA BOOL _pktserial
Driver is a serial (SLIP/PPP) driver.
Definition: pcpkt.h:42
_pkt_rxmode0
W32_DATA int _pkt_rxmode0
Startup receive mode.
Definition: pcpkt.h:45
_pkt_forced_rxmode
W32_DATA int _pkt_forced_rxmode
Forced Rx-mode via WATTCP.CFG.
Definition: pcpkt.h:46
_pktdevlevel
W32_DATA BYTE _pktdevlevel
Device level.
Definition: pcpkt.h:117
_pktdrvrname
W32_DATA char _pktdrvrname[]
Name of PKDRVR.
Definition: pcpkt.h:43
pcqueue.h
pcsed.h
async_iocb
Definition: pcpkt.h:185
code
Definition: zinftree.h:24
cstate
Definition: pcpkt.h:135
in_Header
Definition: wattcp.h:329
pkt_info
Placeholder for vital data accessed by capture thread.
Definition: pcpkt.h:206
pkt_ringbuf
FIFO style ring-buffer.
Definition: pcqueue.h:81
pkt_rx_element
Definition: pcqueue.h:54
slcompress
Definition: pcpkt.h:148
tcp_Header
Definition: wattcp.h:418
winpkt.h


Watt-32 tcp/ip: E:/WATT/src/pcqueue.c Source File

  • src
pcqueue.c
Go to the documentation of this file.
1
35#include <stdio.h>
36#include <stdlib.h>
37#include <stddef.h>
38
39#include "wattcp.h"
40#include "misc.h"
41#include "misc_str.h"
42#include "x32vm.h"
43#include "powerpak.h"
44#include "pcpkt.h"
45#include "pcqueue.h"
46
47#if defined(USE_DEBUG)
48int pktq_check (struct pkt_ringbuf *q)
49{
50 int i;
51 char *buf;
52
53 if (!q || !q->num_buf || !q->buf_start)
54 return (0);
55
56 buf = (char*) q->buf_start;
57
58 for (i = 0; i < q->num_buf; i++)
59 {
60 buf += q->buf_size;
61 if (*(DWORD*)(buf - sizeof(DWORD)) != PKTQ_MARKER)
62 return (0);
63 }
64 return (1);
65}
66#endif /* USE_DEBUG */
67
68
69int pktq_init (struct pkt_ringbuf *q, int size, int num, char *buf)
70{
71 q->buf_size = size;
72 q->num_buf = num;
73 q->buf_start = (DWORD_PTR) buf;
74 q->in_index = 0;
75 q->out_index = 0;
76#if (DOSX & DOS4GW)
77 q->dos_ofs = 0; /* must be set manually */
78#endif
79
80#if defined(USE_DEBUG)
81 WATT_ASSERT (size > 0);
82 WATT_ASSERT (num > 0);
83 WATT_ASSERT (buf != NULL);
84 {
85 int i;
86 for (i = 0; i < q->num_buf; i++)
87 {
88 buf += q->buf_size;
89 *(DWORD*) (buf - sizeof(DWORD)) = PKTQ_MARKER;
90 }
91 }
92#endif
93 return (1);
94}
95
96/*
97 * Increment the queue 'in_index' (head).
98 * Check for wraps.
99 */
100int pktq_inc_in (struct pkt_ringbuf *q)
101{
102 q->in_index++;
103 if (q->in_index >= q->num_buf)
104 q->in_index = 0;
105 return (q->in_index);
106}
107
108/*
109 * Increment the queue 'out_index' (tail).
110 * Check for wraps.
111 */
112int pktq_inc_out (struct pkt_ringbuf *q)
113{
114 q->out_index++;
115 if (q->out_index >= q->num_buf)
116 q->out_index = 0;
117 return (q->out_index);
118}
119
120/*
121 * Return the queue's next 'in_index' (head).
122 * Check for wraps. Caller is responsible for using cli/sti
123 * around this function when needed.
124 */
125int pktq_in_index (struct pkt_ringbuf *q)
126{
127 int index = q->in_index + 1;
128
129 if (index >= q->num_buf)
130 index = 0;
131 return (index);
132}
133
134/*
135 * Return the queue's head-buffer.
136 * Should be interruptable because 'in_index' is 'volatile'.
137 */
138char *pktq_in_buf (struct pkt_ringbuf *q)
139{
140 return ((char*)q->buf_start + (q->buf_size * q->in_index));
141}
142
143/*
144 * Return the queue's tail-buffer.
145 */
146char *pktq_out_buf (struct pkt_ringbuf *q)
147{
148 return ((char*)q->buf_start + (q->buf_size * q->out_index));
149}
150
151
152/*
153 * Clear the queue ring-buffer by setting head = tail.
154 */
155void pktq_clear (struct pkt_ringbuf *q)
156{
157#if defined(USE_FAST_PKT) && defined(__MSDOS__)
158 WORD out_ofs;
159
160 DISABLE();
161 out_ofs = FAR_PEEK_WORD (struct pkt_info, pkt_queue.out_index);
162 FAR_POKE_WORD (struct pkt_info, pkt_queue.in_index, out_ofs);
163 ENABLE();
164 ARGSUSED (q);
165#else
166 DISABLE();
167 q->in_index = q->out_index;
168 ENABLE();
169#endif
170}
171
172/*
173 * Return number of buffers waiting in queue. Check for wraps.
174 * Should be interruptable because 'in_index' is 'volatile'.
175 */
176int pktq_queued (struct pkt_ringbuf *q)
177{
178 register int index = q->out_index;
179 register int num = 0;
180
181 DISABLE();
182
183 while (index != q->in_index)
184 {
185 num++;
186 if (++index >= q->num_buf)
187 index = 0;
188 }
189 ENABLE();
190 return (num);
191}
192
193
194#if defined(USE_FAST_PKT) && defined(__MSDOS__)
195
196#if (DOSX == 0)
197#error USE_FAST_PKT is not for real-mode targets.
198#endif
199
200DWORD asmpkt_rm_base;
201
202#if defined(USE_DEBUG)
203int pktq_far_check (struct pkt_ringbuf *q)
204{
205 DWORD buf_start, buf, marker;
206 int i, size;
207
208 i = FAR_PEEK_WORD (struct pkt_info, pkt_queue.num_buf);
209 if (i != q->num_buf)
210 {
211 (*_printf) ("pktq_far_check(): num = %d\n", i);
212 pkt_dump_real_mem();
213 return (0);
214 }
215
216 buf = FAR_PEEK_DWORD (struct pkt_info, pkt_queue.buf_start);
217 size = FAR_PEEK_WORD (struct pkt_info, pkt_queue.buf_size);
218 buf_start = buf;
219
220 for (i = 0; i < q->num_buf; i++)
221 {
222 buf += size;
223
224 if (buf < asmpkt_rm_base || buf > asmpkt_rm_base + 64*1024)
225 {
226 (*_printf) ("pktq_far_check(): illegal buf = %08lX, size %d\n",
227 buf, size);
228 pkt_dump_real_mem();
229 return (0);
230 }
231 marker = PEEKL (0, buf - sizeof(DWORD));
232 if (marker != PKTQ_MARKER)
233 {
234 (*_printf) ("pktq_far_check(): size = %d, buf_start = %08lX, "
235 "marker[%d] = %08lX\n", size, buf_start, i, marker);
236 pkt_dump_real_mem();
237 return (0);
238 }
239 }
240 return (1);
241}
242#endif /* USE_DEBUG */
243
244
245int pktq_far_init (int size, int num, DWORD real_base)
246{
247 struct pkt_ringbuf q;
248 DWORD dos_addr;
249 size_t rx_buf_ofs = sizeof(struct pkt_info); /* rx_buf[] after _pkt_inf */
250 int i;
251
252 memset (&q, 0, sizeof(q));
253 q.buf_size = size;
254 q.buf_start = real_base + rx_buf_ofs;
255 q.num_buf = num;
256 q.dos_ofs = rx_buf_ofs;
257 asmpkt_rm_base = real_base;
258
259 WATT_ASSERT (size > 0);
260 WATT_ASSERT (num > 0);
261
262 for (i = 0; i < q.num_buf; i++)
263 {
264 real_base += q.buf_size;
265 POKEL (0, q.dos_ofs + real_base - sizeof(DWORD), PKTQ_MARKER);
266 }
267
268 dos_addr = asmpkt_rm_base + offsetof(struct pkt_info,pkt_queue);
269
270#if (DOSX & (PHARLAP|X32VM|POWERPAK))
271 WriteRealMem (dos_addr, &q, sizeof(q));
272#elif (DOSX & DOS4GW)
273 memcpy ((void*)dos_addr, &q, sizeof(q));
274#elif (DOSX & DJGPP)
275 dosmemput (&q, sizeof(q), dos_addr);
276#else
277 #error Help!
278#endif
279 return (1);
280}
281#endif /* USE_FAST_PKT && __MSDOS__ */
misc.h
misc_str.h
pcpkt.h
pcqueue.h
powerpak.h
pkt_info
Placeholder for vital data accessed by capture thread.
Definition: pcpkt.h:206
pkt_ringbuf
FIFO style ring-buffer.
Definition: pcqueue.h:81
pkt_ringbuf::buf_start
DWORD_PTR buf_start
start of buffer pool (linear addr)
Definition: pcqueue.h:87
pkt_ringbuf::num_buf
WORD num_buf
number of buffers
Definition: pcqueue.h:85
pkt_ringbuf::out_index
WORD out_index
index of buffer pulled out
Definition: pcqueue.h:83
pkt_ringbuf::dos_ofs
WORD dos_ofs
offset of pool, used by rmode stub
Definition: pcqueue.h:89
pkt_ringbuf::in_index
volatile WORD in_index
index ahead of last buffer put
Definition: pcqueue.h:82
pkt_ringbuf::buf_size
WORD buf_size
size of each buffer
Definition: pcqueue.h:84
wattcp.h
Core definitions.
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/pcqueue.h Source File

  • src
pcqueue.h
Go to the documentation of this file.
1
3#ifndef _w32_PCQUEUE_H
4#define _w32_PCQUEUE_H
5
6#include <stddef.h>
7
8#ifndef __SYS_WTIME_H
9#include <sys/wtime.h>
10#endif
11
12#ifndef _w32_PCSED_H
13#include "pcsed.h"
14#endif
15
19#if defined(WIN32)
20 /*
21 * \todo Make RX_BUFS (i.e. size of thread queue) configurable.
22 * Only the NPF kernel-buffer size is configurable now (pkt_num_rx_bufs).
23 */
24 #define RX_BUFS 50
25
26#elif defined(USE_FAST_PKT)
27 #define RX_BUFS 40 /* max # that will fit in 64 kB */
28
29#elif (DOSX)
30 #if (DOSX & DOS4GW) /* allocation from DOS is limited to 64kB */
31 #define RX_BUFS 30
32 #else
33 #define RX_BUFS 50 /* # of receive buffers to use in queue */
34 #endif /* should be greater than MAX_FRAGMENT */
35
36#else
37 #define RX_BUFS 5
38#endif
39
40#if (DOSX)
41 #define PKT_TMP_SIZE 64 /* scratch buffer only needed for 32-bit DOS */
42#endif
43
44#define PKTQ_MARKER 0xDEAFBABE
45
46/*
47 * asmpkt4.asm depends on these structs beeing packed
48 */
49#if (DOSX & DOS4GW) || defined(USE_FAST_PKT)
50#include <sys/pack_on.h>
51#endif
52
53#if defined(WIN32)
54 struct pkt_rx_element {
55 uint64 tstamp_put; /* timestamp from recv-thread */
56 uint64 tstamp_get; /* timestamp when polled */
57 WORD rx_length; /* length from PacketReceivePacket() */
58 BYTE rx_buf [ETH_MAX+10]; /* add some margin */
59 };
60#else
61 struct pkt_rx_element {
62 DWORD tstamp_put[2]; /* RDTSC timestamp on 1st upcall */
63 DWORD tstamp_get[2]; /* RDTSC timestamp when polled */
64 WORD handle; /* Packet-driver handle of upcall */
65 WORD rx_length_1; /* length on 1st upcall */
66 WORD rx_length_2; /* length on 2nd upcall */
67 WORD filler; /* 4 byte alignment */
68 BYTE rx_buf [ETH_MAX+10]; /* add some margin */
69 }; /* = 1548 bytes */
70#endif
71
72/* DOS: 1524+24=1548
73 */
74#define RX_SIZE sizeof(struct pkt_rx_element)
75#define RX_ELEMENT_HEAD_SIZE offsetof (struct pkt_rx_element, rx_buf[0])
76
81struct pkt_ringbuf {
82 volatile WORD in_index;
83 WORD out_index;
84 WORD buf_size;
85 WORD num_buf;
86 volatile DWORD num_drop;
87 DWORD_PTR buf_start;
88#if (DOSX & (DOS4GW|POWERPAK)) || defined(USE_FAST_PKT)
89 WORD dos_ofs;
90#endif
91 };
92
93#if (DOSX & DOS4GW) || defined(USE_FAST_PKT)
94#include <sys/pack_off.h>
95#endif
96
97extern int pktq_inc_in (struct pkt_ringbuf *q);
98extern int pktq_inc_out (struct pkt_ringbuf *q);
99extern int pktq_check (struct pkt_ringbuf *q);
100extern void pktq_clear (struct pkt_ringbuf *q);
101
102extern int pktq_init (struct pkt_ringbuf *q, int size, int num, char *buf);
103extern int pktq_in_index (struct pkt_ringbuf *q);
104extern char *pktq_in_buf (struct pkt_ringbuf *q);
105extern char *pktq_out_buf (struct pkt_ringbuf *q);
106extern int pktq_queued (struct pkt_ringbuf *q);
107
108#if defined(USE_FAST_PKT) && defined(__MSDOS__)
109 extern DWORD asmpkt_rm_base;
110
111 /* Macros to access runtime location of 'asmpkt_inf'
112 */
113 #define FAR_PEEK_WORD(struc,mbr) PEEKW (0, asmpkt_rm_base + offsetof(struc,mbr))
114 #define FAR_PEEK_DWORD(struc,mbr) PEEKL (0, asmpkt_rm_base + offsetof(struc,mbr))
115
116 #define FAR_POKE_WORD(struc,mbr,x) POKEW (0, asmpkt_rm_base + offsetof(struc,mbr), x)
117 #define FAR_POKE_DWORD(struc,mbr,x) POKEL (0, asmpkt_rm_base + offsetof(struc,mbr), x)
118
119 extern int pktq_far_init (int size, int num, DWORD asmpkt_real_base);
120 extern int pktq_far_queued (void);
121 extern int pktq_far_check (struct pkt_ringbuf *q);
122#endif
123
124#endif
pack_off.h
pack_on.h
pcsed.h
pkt_ringbuf
FIFO style ring-buffer.
Definition: pcqueue.h:81
pkt_ringbuf::buf_start
DWORD_PTR buf_start
start of buffer pool (linear addr)
Definition: pcqueue.h:87
pkt_ringbuf::num_drop
volatile DWORD num_drop
number of dropped pkts
Definition: pcqueue.h:86
pkt_ringbuf::num_buf
WORD num_buf
number of buffers
Definition: pcqueue.h:85
pkt_ringbuf::out_index
WORD out_index
index of buffer pulled out
Definition: pcqueue.h:83
pkt_ringbuf::dos_ofs
WORD dos_ofs
offset of pool, used by rmode stub
Definition: pcqueue.h:89
pkt_ringbuf::in_index
volatile WORD in_index
index ahead of last buffer put
Definition: pcqueue.h:82
pkt_ringbuf::buf_size
WORD buf_size
size of each buffer
Definition: pcqueue.h:84
pkt_rx_element
Definition: pcqueue.h:54
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65
wtime.h


Watt-32 tcp/ip: E:/WATT/src/pcrarp.c Source File

  • src
pcrarp.c
Go to the documentation of this file.
1
13#include <stdio.h>
14#include <string.h>
15
16#include "copyrigh.h"
17#include "wattcp.h"
18#include "language.h"
19#include "misc.h"
20#include "misc_str.h"
21#include "timer.h"
22#include "pcsed.h"
23#include "pctcp.h"
24#include "pcdbug.h"
25#include "pcrarp.h"
26
27#if defined(USE_RARP)
28
29WORD _rarptimeout = 5;
30
31static int _rarp_request (void)
32{
33 rarp_Header *rarp = (rarp_Header*) _eth_formatpacket (&_eth_brdcast[0],
34 RARP_TYPE);
35 rarp->hwType = intel16 (_eth_get_hwtype(NULL,NULL));
36 rarp->protType = IP4_TYPE;
37 rarp->hwAddrLen = sizeof (mac_address);
38 rarp->protoAddrLen = sizeof (my_ip_addr);
39 rarp->opcode = RARP_REQUEST;
40 rarp->srcIPAddr = 0;
41 rarp->dstIPAddr = 0;
42 memcpy (rarp->srcEthAddr, _eth_addr, sizeof(mac_address));
43 memcpy (rarp->dstEthAddr, _eth_addr, sizeof(mac_address));
44
45 return _eth_send (sizeof(*rarp), NULL, __FILE__, __LINE__);
46}
47
51BOOL _rarp_handler (const rarp_Header *rh, BOOL brdcast)
52{
53 DEBUG_RX (NULL, rh);
54
55 if (!brdcast && rh->opcode == RARP_REPLY && rh->protType == IP4_TYPE &&
56 !memcmp(rh->dstEthAddr,_eth_addr,sizeof(mac_address)))
57 {
58 my_ip_addr = intel (rh->dstIPAddr);
59 return (TRUE);
60 }
61 return (FALSE);
62}
63
64/*
65 * _dorarp - Checks global variable _rarptimeout
66 * returns 1 on success and sets ip address
67 */
68int _dorarp (void)
69{
70 DWORD rarptimeout = set_timeout (1000 * _rarptimeout);
71 WORD magictimeout = Random (7000, 14000);
72
73 outs (_LANG("Configuring through RARP..."));
74
75 while (1)
76 {
77 DWORD sendtimeout;
78
79 if (!_rarp_request())
80 break;
81
82 sendtimeout = set_timeout (magictimeout);
83 magictimeout += Random (1000, 7000);
84
85 while (!chk_timeout(sendtimeout))
86 {
87 const struct rarp_Header *rarp;
88 WORD eth_type;
89 BOOL bcast;
90
91 if (chk_timeout(rarptimeout))
92 return (0);
93
94 WATT_YIELD();
95
96 rarp = (rarp_Header*) _eth_arrived (&eth_type, &bcast);
97 if (!rarp)
98 continue;
99
100 DEBUG_RX (NULL, rarp);
101
102 if (eth_type == RARP_TYPE && !bcast &&
103 rarp->opcode == RARP_REPLY && rarp->protType == IP4_TYPE &&
104 !memcmp(rarp->dstEthAddr,_eth_addr,sizeof(mac_address)))
105 {
106 my_ip_addr = intel (rarp->dstIPAddr);
107 _eth_free (rarp);
108 return (1);
109 }
110 _eth_free (rarp);
111 }
112 }
113 return (0);
114}
115#endif
copyrigh.h
language.h
Random
unsigned W32_CALL Random(unsigned a, unsigned b)
Returns a random integer in range [a..b].
Definition: misc.c:743
misc.h
misc_str.h
pcdbug.h
_rarp_handler
BOOL _rarp_handler(const rarp_Header *rh, BOOL brdcast)
Handle incoming RARP packets.
Definition: pcrarp.c:51
pcrarp.h
_eth_send
int W32_CALL _eth_send(WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
Definition: pcsed.c:301
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
_eth_arrived
void *W32_CALL _eth_arrived(WORD *type_ptr, BOOL *broadcast)
Poll for arrival of new packets (IP/ARP/RARP/PPPoE protocol).
Definition: pcsed.c:996
_eth_get_hwtype
BYTE W32_CALL _eth_get_hwtype(BYTE *hwtype, BYTE *hwlen)
Fill in hardware address type/length for BOOTP/DHCP packets.
Definition: pcsed.c:730
_eth_brdcast
mac_address _eth_brdcast
Link-layer broadcast address.
Definition: pcsed.c:50
_eth_free
void W32_CALL _eth_free(const void *pkt)
Free an input buffer once it is no longer needed.
Definition: pcsed.c:769
pcsed.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
pctcp.h
rarp
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcrarp.h Source File

  • src
pcrarp.h
Go to the documentation of this file.
1
3#ifndef _w32_PCRARP_H
4#define _w32_PCRARP_H
5
6extern WORD _rarptimeout;
7extern int _dorarp (void);
8extern BOOL _rarp_handler (const rarp_Header *rh, BOOL brdcast);
9
10#endif
_rarp_handler
BOOL _rarp_handler(const rarp_Header *rh, BOOL brdcast)
Handle incoming RARP packets.
Definition: pcrarp.c:51


Watt-32 tcp/ip: E:/WATT/src/pcrecv.c Source File

  • src
pcrecv.c
Go to the documentation of this file.
1
6#include <stdio.h>
7#include <stdlib.h>
8#include <limits.h>
9
10#include "wattcp.h"
11#include "language.h"
12#include "bsddbug.h"
13#include "misc.h"
14#include "misc_str.h"
15#include "pcsed.h"
16#include "pcbuf.h"
17#include "pctcp.h"
18#include "pcrecv.h"
19
20#define RECV_USED 0xF7E3D2B1L
21#define RECV_UNUSED 0xE6D2C1AFL
22
23/* UDP "sequence number" for finding the oldest packet.
24 * Newest received has higher 'p->buf_seqnum' number
25 */
26static long seq_num = 0;
27
28/*
29 * Gets upcalled when data arrives.
30 * We MUST set 'p->buf_len = -1' to signal a 0-byte UDP packet
31 * not 0
32 */
33static int W32_CALL sock_recvdaemon (
34 sock_type *s, const void *data, unsigned len,
35 const tcp_PseudoHeader *ph, const udp_Header *udp)
36{
37 recv_data *r;
38 recv_buf *p;
39 unsigned i;
40
41 switch (s->udp.ip_type)
42 {
43 case UDP_PROTO:
44 r = (recv_data*) s->udp.rx_data;
45 p = (recv_buf*) r->recv_bufs;
46 if (r->recv_sig != RECV_USED)
47 {
48 outsnl (_LANG("ERROR: udp recv data conflict"));
49 return (0);
50 }
51 /* find an unused buffer
52 */
53 for (i = 0; i < r->recv_bufnum; i++, p++)
54 switch (p->buf_sig)
55 {
56 case RECV_USED:
57 break;
58 case RECV_UNUSED: /* take this one */
59 p->buf_sig = RECV_USED;
60 p->buf_hisport = udp->srcPort;
61 p->buf_seqnum = seq_num++;
62#if defined(USE_IPV6)
63 if (s->udp.is_ip6)
64 memcpy (&p->buf_hisip6, &((tcp_PseudoHeader6*)ph)->src,
65 sizeof(p->buf_hisip6));
66
67 else
68#endif
69 p->buf_hisip = ph->src;
70 len = min (len, sizeof(p->buf_data));
71 if (len > 0)
72 {
73 memcpy (p->buf_data, data, len);
74 p->buf_len = (short) len;
75 }
76 else
77 p->buf_len = -1; /* a 0-byte probe */
78#if 0
79 SOCK_DEBUGF (("\nsock_recvdaemon(): buffer %d, "
80 "seq-num %ld, len %d",
81 i, seq_num-1, p->buf_len));
82#endif
83 return (0);
84 default:
85 outsnl (_LANG("ERROR: sock_recv_daemon data err"));
86 return (0);
87 }
88 return (0);
89
90#if !defined(USE_UDP_ONLY)
91 case TCP_PROTO:
92 {
93 _tcp_Socket *t = &s->tcp;
94
95 r = (recv_data*) t->rx_data;
96
97 if (r->recv_sig != RECV_USED)
98 {
99 outsnl (_LANG("ERROR: tcp recv data conflict"));
100 return (0);
101 }
102 /* stick it on the end if you can
103 */
104 i = t->max_rx_data - t->rx_datalen;
105 if (i > 1)
106 {
107 /* we can accept some of this */
108 if (len > i)
109 len = i;
110 if (len > 0)
111 memcpy (r->recv_bufs + t->rx_datalen, data, len);
112 t->rx_datalen += len;
113 return (len);
114 }
115 return (0); /* didn't take none */
116 }
117#endif
118 }
119 return (0);
120}
121
122
123int W32_CALL sock_recv_used (const sock_type *s)
124{
125 const recv_data *r;
126 const recv_buf *p;
127
128 int i, len;
129
130 switch (_chk_socket(s))
131 {
132 case VALID_UDP:
133 r = (const recv_data*) s->udp.rx_data;
134 p = (const recv_buf*) r->recv_bufs;
135 if (r->recv_sig != RECV_USED)
136 return (-1);
137
138 for (i = len = 0; i < r->recv_bufnum; i++, p++)
139 if (p->buf_sig == RECV_USED)
140 len += abs (p->buf_len); /* -1 -> 1 */
141 return (len);
142
143#if !defined(USE_UDP_ONLY)
144 case VALID_TCP:
145 r = (const recv_data*) s->tcp.rx_data;
146 if (r->recv_sig != RECV_USED)
147 return (-1);
148 return (s->tcp.rx_datalen);
149#endif
150 }
151 return (0);
152}
153
154
155int W32_CALL sock_recv_init (sock_type *s, void *space, unsigned len)
156{
157 recv_buf *p = (recv_buf*) space;
158 recv_data *r = (recv_data*) s->udp.rx_data;
159 int i;
160
161 WATT_ASSERT ((DWORD)len <= USHRT_MAX);
162 memset (r, 0, s->udp.max_rx_data); /* clear Rx-buffer */
163 memset (p, 0, len); /* clear data area */
164
165 s->udp.protoHandler = (ProtoHandler)sock_recvdaemon;
166 r->recv_sig = RECV_USED;
167 r->recv_bufs = (BYTE*) p;
168 r->recv_bufnum = (WORD) (len / sizeof(recv_buf));
169
170 if (s->udp.ip_type == UDP_PROTO)
171 for (i = 0; i < r->recv_bufnum; i++, p++)
172 p->buf_sig = RECV_UNUSED;
173 return (0);
174}
175
176int W32_CALL sock_recv_from (sock_type *s, DWORD *hisip, WORD *hisport,
177 void *buffer, unsigned len, int peek)
178{
179#if !defined(USE_UDP_ONLY)
180 _tcp_Socket *t;
181#endif
182 recv_buf *p, *oldest = NULL;
183 recv_data *r = (recv_data*) s->udp.rx_data;
184 long seqnum = LONG_MAX;
185 int i;
186
187 if (r->recv_sig != RECV_USED)
188 {
189 SOCK_ERRNO (EBADF);
190
191 /* To differentiate an error from 0-byte probe (also -1) */
192 return (-1);
193 }
194
195 switch (s->udp.ip_type)
196 {
197 case UDP_PROTO:
198 p = (recv_buf*) r->recv_bufs;
199
200 /* find the oldest used UDP buffer.
201 */
202 for (i = 0; i < r->recv_bufnum; i++, p++)
203 {
204 switch (p->buf_sig)
205 {
206 case RECV_UNUSED:
207 break;
208
209 case RECV_USED:
210#if defined(__MSDOS__)
211 /* Drop looped packets sent by us (running
212 * under Win32 DOS box using NDIS3PKT or SwsVpkt).
213 */
214 if ((_eth_ndis3pkt || _eth_SwsVpkt) &&
215 !s->tcp.is_ip6 && p->buf_hisip == intel(my_ip_addr))
216 {
217 p->buf_sig = RECV_UNUSED;
218 continue;
219 }
220#endif
221 if (p->buf_seqnum < seqnum) /* ignore wraps */
222 {
223 seqnum = p->buf_seqnum;
224 oldest = p;
225#if 0
226 SOCK_DEBUGF (("\nsock_recv_from(): buffer %d, "
227 "seq-num %ld, len %d",
228 i, seqnum, p->buf_len));
229#endif
230 }
231 break;
232
233 default:
234 outsnl (_LANG("ERROR: sock_recv_init data err"));
235 return (0);
236 }
237 }
238 break;
239
240#if !defined(USE_UDP_ONLY)
241 case TCP_PROTO:
242 t = &s->tcp;
243 len = min (len, (unsigned)t->rx_datalen);
244 if (len)
245 memcpy (buffer, r->recv_bufs, len);
246 return (len);
247#endif
248 }
249
250 if (!oldest)
251 return (0);
252
253 /* found the oldest UDP packet */
254
255 p = oldest;
256 if (p->buf_len < 0) /* a 0-byte probe packet */
257 len = (unsigned) -1;
258 else
259 {
260 len = min ((unsigned)p->buf_len, len);
261 memcpy (buffer, p->buf_data, len);
262 }
263
264#if defined(USE_IPV6)
265 if (s->tcp.is_ip6)
266 {
267 if (hisip)
268 memcpy (hisip, &p->buf_hisip6, sizeof(ip6_address));
269 }
270 else
271#endif
272 if (hisip)
273 *hisip = p->buf_hisip;
274
275 if (hisport)
276 *hisport = p->buf_hisport;
277
278 if (!peek)
279 p->buf_sig = RECV_UNUSED;
280 return (len);
281}
282
283int W32_CALL sock_recv (sock_type *s, void *buffer, unsigned len)
284{
285 return sock_recv_from (s, NULL, NULL, buffer, len, 0);
286}
287
bsddbug.h
language.h
misc.h
misc_str.h
pcbuf.h
pcrecv.h
_eth_ndis3pkt
BOOL _eth_ndis3pkt
for DOS-programs only
Definition: pcsed.c:56
_eth_SwsVpkt
BOOL _eth_SwsVpkt
for DOS and Win32 programs
Definition: pcsed.c:57
pcsed.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
pctcp.h
recv_buf
Definition: pcrecv.h:16
recv_data
Definition: pcrecv.h:8
tcp_PseudoHeader6
Definition: wattcp.h:463
tcp_PseudoHeader
Definition: wattcp.h:449
tcp_Socket
Definition: wattcp.h:584
udp_Header
Definition: wattcp.h:406
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcrecv.h Source File

  • src
pcrecv.h
Go to the documentation of this file.
1
3#ifndef _w32_PCRECV_H
4#define _w32_PCRECV_H
5
8typedef struct recv_data {
9 DWORD recv_sig;
10 BYTE *recv_bufs;
11 WORD recv_bufnum;
12 } recv_data;
13
16typedef struct recv_buf {
17 DWORD buf_sig;
18 DWORD buf_hisip;
19 long buf_seqnum;
20#if defined(USE_IPV6)
21 ip6_address buf_hisip6;
22#endif
23 WORD buf_hisport;
24 short buf_len;
25 BYTE buf_data [ETH_MAX]; /* sock_packet_peek() needs 1514 */
26 } recv_buf;
27
28#endif
recv_buf
Definition: pcrecv.h:16
recv_data
Definition: pcrecv.h:8


Watt-32 tcp/ip: E:/WATT/src/pcsarp.c Source File

  • src
pcsarp.c
Go to the documentation of this file.
1
15#include <stdio.h>
16#include <stdlib.h>
17#include <string.h>
18
19#include "wattcp.h"
20#include "netaddr.h"
21#include "misc.h"
22#include "misc_str.h"
23#include "pcdbug.h"
24#include "pcconfig.h"
25#include "pctcp.h"
26#include "pcsed.h"
27#include "pcpkt.h"
28#include "pcarp.h"
29#include "pcsarp.h"
30
31
32#if defined(USE_SECURE_ARP)
33/*
34 * OpenSSL include path should be in %INCLUDE% or %C_INCLUDE_PATH%.
35 */
36#include <openssl/dsa.h>
37#include <openssl/sha.h>
38#include <openssl/rand.h>
39#include <openssl/bio.h>
40#include <openssl/evp.h>
41
42#if defined(USE_DEBUG)
43 #define SARP_DEBUG(level, args) \
44 do { \
45 if (sarp_debug >= level) { \
46 (*_printf) args; \
47 fflush (stdout); \
48 } \
49 } while (0)
50#else
51 #define SARP_DEBUG(args, level) ((void)0)
52#endif
53
54struct host_list {
55 DWORD ip; /* on host order */
56 eth_address mac;
57 BOOL secure;
58 DSA *dsa;
59 struct host_list *next;
60 };
61
62static void (W32_CALL *prev_cfg_hook) (const char*, const char*);
63static void W32_CALL sarp_parse (const char *name, const char *value);
64
65static char *ca_keyfile = NULL;
66static char *priv_keyfile = NULL;
67static int sarp_debug = 0;
68
69static struct host_list *known_hosts = NULL;
70static struct host_list *secure_hosts = NULL;
71
72static int sarp_receive (const struct sarp_Packet *sarp);
73static int sarp_transmit (struct sarp_Packet *sarp);
74
79int sarp_init (void)
80{
81 const char *rand = getenv ("RANDFILE");
82
83 prev_cfg_hook = usr_init;
84 usr_init = sarp_parse;
85 _sarp_recv_hook = sarp_receive;
86 _sarp_xmit_hook = sarp_transmit;
87
88 if (rand && FILE_EXIST(rand))
89 RAND_load_file (rand, -1);
90 else SARP_DEBUG (0, ("Warning: No random seed file found\n"));
91 return (0);
92}
93
94static int read_ca_keyfile (const char *value)
95{
96 DSA *dsa;
97
98 DSA_free (dsa);
99}
100
101static int read_priv_keyfile (const char *value)
102{
103 FILE *fil;
104
105 ca_keyfile = strdup (value);
106 if (!ca_keyfile)
107 return (0);
108
109 fil = fopen (ca_keyfile, "rt");
110 if (!fil)
111 return (0);
112
113#if 0
114 priv = d2i_RSAPrivateKey_fp (fil, NULL);
115#endif
116 fclose (fil);
117 return (1);
118}
119
120static BOOL crypto_load_sarp_file (const char *pem_file, DSA **dsa)
121{
122 FILE *fil = fopen (pem_file, "rt");
123
124 *dsa = d2i_DSAPublicKey (NULL, raw, len);
125
126 if (!crypto_verify_sign(message,strlen(message),sig,siglen,*dsa))
127 {
128 SARP_DEBUG (0, ("%s has illegal signature\n", pem_file));
129 DSA_free (*dsa);
130 return (FALSE);
131 }
132}
133
134/*
135 * Parse "SECURE_HOST" 'value' "<IP>, <MAC>, <public-key-file>"
136 */
137static int set_secure_host (const char *value)
138{
139 struct host_list *host;
140 char ip[16], mac[21], pem_file[256];
141 DWORD ip_addr;
142 DSA *dsa;
143
144 if (sscanf(value,"%15[^,],%20[^,],%255[^\r\n]", ip, mac, pem_file) != 3)
145 return (0);
146
147 ip_addr = _inet_addr (ip);
148 if (!ip_addr)
149 return (0);
150
151 host = calloc (sizeof(*host), 1);
152 if (!host)
153 return (0);
154
155 if (!_inet_atoeth(mac, &host->mac) ||
156 !crypto_load_sarp_file(pem_file, &dsa))
157 {
158 free (host);
159 return (0);
160 }
161
162 host->secure = TRUE;
163 host->ip = ip_addr;
164 host->dsa = dsa;
165 host->next = secure_hosts;
166 secure_hosts = host;
167 return (1);
168}
169
170/*
171 * Parse "KNOWN_HOST" 'value' "<IP>, <MAC>"
172 */
173static int set_known_host (const char *value, int value_len)
174{
175 struct host_list *host;
176 char ip[16], mac[21];
177
178 if (sscanf(value,"%15[^,],%20[^\r\n]", ip, mac) != 2)
179 return (0);
180
181 host = calloc (sizeof(*host), 1);
182 if (!host)
183 return (0);
184
185 if (!_inet_atoeth (mac, &host->mac))
186 {
187 free (host);
188 return (0);
189 }
190
191 host->secure = FALSE;
192 host->ip = _inet_addr (ip);
193 host->next = known_hosts;
194 known_hosts = host;
195 return (1);
196}
197
198
202static void W32_CALL sarp_parse (const char *name, const char *value)
203{
204 static const struct config_table sarp_cfg[] = {
205 { "CA_KEY", ARG_FUNC, (void*)read_ca_keyfile },
206 { "PRIV_KEY", ARG_FUNC, (void*)read_priv_keyfile },
207 { "SECURE_HOST", ARG_FUNC, (void*)set_secure_host },
208 { "KNOWN_HOST", ARG_FUNC, (void*)set_known_host },
209 { NULL, 0, NULL }
210 };
211
212 if (!parse_config_table(&sarp_cfg[0], "SEC_ARP.", name, value) &&
213 prev_cfg_hook)
214 (*prev_cfg_hook) (name, value);
215}
216
220static __inline BOOL is_secure_host (DWORD ip)
221{
222 const struct host_list *host;
223
224 for (host = secure_hosts; host; host = host->next)
225 if (host->ip == ip)
226 return (host->dsa != NULL);
227 return (FALSE);
228}
229
233static __inline BOOL is_known_host (DWORD ip)
234{
235 const struct host_list *host;
236
237 for (host = known_hosts; host; host = host->next)
238 if (host->ip == ip)
239 return (TRUE);
240 return (FALSE);
241}
242
243static int make_auth_Header (struct sarp_Packet *sarp)
244{
245 ARGSUSED (sarp);
246 return (0);
247}
248
249/*
250 * Called from _arp_handler() after HW-type and protocol (IPv4) is
251 * verified. Must completely replace _arp_handler().
252 */
253static int sarp_receive (const struct sarp_Packet *sarp)
254{
255 DWORD src_ip = ntohl (sarp->arp.srcIPAddr);
256
257 if (!is_secure_host(src_ip) && !is_known_host(src_ip))
258 return (0); /* drop it */
259
261 return (1);
262}
263
264/*
265 * Called from arp_send(). Add any authentication header as needed.
266 * Return total length of what's need to be transmitted.
267 */
268static int sarp_transmit (struct sarp_Packet *sarp)
269{
270 DWORD dst_ip = ntohl (sarp->arp.dstIPAddr);
271 WORD len = sizeof (sarp->arp);
272
273 if (!is_secure_host(dst_ip))
274 return (len); /* send as-is */
275
276 memset (&sarp->auth, 0, sizeof(sarp->auth));
277 len += make_auth_Header (sarp);
278 return (len);
279}
280
284void _sarp_debug_dump (void)
285{
286}
287#endif /* USE_SECURE_ARP */
misc.h
misc_str.h
_inet_addr
DWORD W32_CALL _inet_addr(const char *s)
Convert a string into an IP-address.
Definition: netaddr.c:70
_inet_atoeth
const char * _inet_atoeth(const char *src, eth_address *p_eth)
Parse string "ether-addr, ip-addr".
Definition: netaddr.c:205
netaddr.h
pcarp.h
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
pcconfig.h
pcdbug.h
pcpkt.h
_sarp_debug_dump
void _sarp_debug_dump(void)
Secure-ARP debug dump.
Definition: pcsarp.c:284
sarp_receive
static int sarp_receive(const struct sarp_Packet *sarp)
Definition: pcsarp.c:253
is_secure_host
static __inline BOOL is_secure_host(DWORD ip)
Check if host should use secure ARP.
Definition: pcsarp.c:220
is_known_host
static __inline BOOL is_known_host(DWORD ip)
Check if host is among the known hosts.
Definition: pcsarp.c:233
sarp_parse
static const char *static void W32_CALL sarp_parse(const char *name, const char *value)
Parser for "SEC_ARP.xx" keywords in WATTCP.CFG (or SARP.CFG).
Definition: pcsarp.c:202
sarp_init
int sarp_init(void)
Application must call this before sock_init() so we don't link in OpenSSL libs by default.
Definition: pcsarp.c:79
pcsarp.h
pcsed.h
pctcp.h
config_table
Definition: tcp.h:461
host_list
Definition: pcsarp.c:54
sarp_Packet
Definition: pcsarp.h:18
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pcsarp.h Source File

  • src
pcsarp.h
Go to the documentation of this file.
1
5#ifndef _w32_PCSARP_H
6#define _w32_PCSARP_H
7
8#include <sys/pack_on.h>
9
10struct sarp_Auth {
11 DWORD magic;
12 BYTE type;
13 BYTE siglen;
14 WORD datalen;
15 DWORD timestamp;
16 };
17
18struct sarp_Packet {
19 struct arp_Header arp;
20 struct sarp_Auth auth;
21 };
22
23#include <sys/pack_off.h>
24
25int sarp_init (void);
26
27#endif
28
pack_off.h
pack_on.h
sarp_init
int sarp_init(void)
Application must call this before sock_init() so we don't link in OpenSSL libs by default.
Definition: pcsarp.c:79
arp_Header
Definition: wattcp.h:476
arp
sarp_Auth
Definition: pcsarp.h:10
sarp_Packet
Definition: pcsarp.h:18


Watt-32 tcp/ip: E:/WATT/src/pcsed.c Source File

  • src
pcsed.c
Go to the documentation of this file.
1
16#include <stdio.h>
17#include <stdlib.h>
18#include <string.h>
19
20#include "copyrigh.h"
21#include "wattcp.h"
22#include "wdpmi.h"
23#include "language.h"
24#include "sock_ini.h"
25#include "loopback.h"
26#include "cpumodel.h"
27#include "misc.h"
28#include "misc_str.h"
29#include "run.h"
30#include "timer.h"
31#include "profile.h"
32#include "split.h"
33#include "ip4_in.h"
34#include "ip6_in.h"
35#include "bsddbug.h"
36#include "pcigmp.h"
37#include "pcqueue.h"
38#include "pcconfig.h"
39#include "pcdbug.h"
40#include "pctcp.h"
41#include "pcstat.h"
42#include "pcpkt.h"
43#include "pcsed.h"
44#include "pppoe.h"
45
46/* !!fix-me: Should allow the largest possible MAC-address to be used;
47 * An AX-25 address is 7 bytes.
48 */
49mac_address _eth_addr;
50mac_address _eth_brdcast;
51mac_address _eth_loop_addr;
52mac_address _eth_real_addr;
53BYTE _eth_mac_len;
54BOOL _eth_is_init = FALSE;
55BOOL _ip_recursion = FALSE;
56BOOL _eth_ndis3pkt = FALSE;
57BOOL _eth_SwsVpkt = FALSE;
58BOOL _eth_wanpacket = FALSE;
59BOOL _eth_win10pcap = FALSE;
60BOOL _eth_winpcap = FALSE;
62const char *_eth_not_init = "Packet driver not initialised";
63
67struct _eth_last_info _eth_last;
68
90void *(W32_CALL *_eth_recv_hook) (WORD *type) = NULL;
91int (W32_CALL *_eth_recv_peek) (void *mac_buf) = NULL;
92int (W32_CALL *_eth_xmit_hook) (const void *mac_buf, unsigned len) = NULL;
93
98static void *(*mac_tx_format)(void *mac_buf, const void *mac_dest, WORD type);
99static int (*mac_transmit) (const void *mac_buf, WORD len);
100
101static WORD proto; /* protocol set in _eth_formatpacket() */
102static void *nw_pkt; /* where network protocol packet starts */
103
104static void W32_CALL __eth_release (void);
105
115#if (DOSX & (DOS4GW|X32VM))
116 #define TX_BUF() ((union link_Packet*) pkt_tx_buf())
117
118#elif (DOSX & DJGPP)
119 static union link_Packet outbuf;
120
121 #define TX_BUF() (_pkt_inf && _pkt_inf->use_near_ptr ? \
122 (union link_Packet*)pkt_tx_buf() : \
123 (&outbuf))
124#else
125 static union link_Packet outbuf;
126 #define TX_BUF() (&outbuf)
127#endif
128
134void * W32_CALL _eth_formatpacket (const void *mac_dest, WORD eth_type)
135{
136 nw_pkt = (*mac_tx_format) (TX_BUF(), mac_dest, eth_type);
137 return (nw_pkt);
138}
139
140
141#if defined(USE_LOOPBACK)
151static int send_loopback (link_Packet pkt, BOOL is_ip6, unsigned *err_line)
152{
153 struct pkt_ringbuf *q;
154 const in_Header *ip;
155 int ip_len;
156
157 if (!_pkt_inf)
158 {
159 *err_line = __LINE__;
160 goto drop_it;
161 }
162
163 /* Call loopback handler with IP-packet
164 */
165 ip = (in_Header*) ((BYTE*)&pkt + _pkt_ip_ofs);
166 ip_len = loopback_device ((in_Header*)ip);
167
168 q = &_pkt_inf->pkt_queue;
169
170 if (!q || ip_len > (int)_mtu)
171 {
172 *err_line = __LINE__;
173 goto drop_it;
174 }
175
176 if (ip_len > 0)
177 {
178#if defined(USE_FAST_PKT)
179 /*
180 * Don't let pkt_receiver() modify the queue while testing/copying.
181 */
182 if (pkt_buffers_used() >= _pkt_inf->pkt_queue.num_buf - 1)
183 {
184 *err_line = __LINE__;
185 goto drop_it;
186 }
187 {
188 char tx_buf [ETH_MAX];
189 unsigned len = ip_len;
190
191 /* Enqueue packet to head of input IP-queue.
192 */
193 if (!_pktserial)
194 {
195 void *data = (*mac_tx_format) (tx_buf, _eth_addr,
196 is_ip6 ? IP6_TYPE : IP4_TYPE);
197 memcpy (MAC_SRC(data), &_eth_loop_addr, sizeof(mac_address));
198 memcpy (data, ip, ip_len);
199 len += _pkt_ip_ofs;
200 }
201 else
202 memcpy (tx_buf, ip, ip_len);
203
204 if (!pkt_append_recv(tx_buf, len))
205 {
206 *err_line = __LINE__;
207 goto drop_it;
208 }
209 }
210#elif defined(WIN32)
211 struct pkt_rx_element *head;
212
213 ENTER_CRIT();
214 if (pktq_in_index(q) == q->out_index) /* queue is full, drop it */
215 {
216 q->num_drop++;
217 LEAVE_CRIT();
218 *err_line = __LINE__;
219 goto drop_it;
220 }
221
222 head = (struct pkt_rx_element*) pktq_in_buf (q);
223 head->rx_length = _pkt_ip_ofs + ip_len;
224 head->tstamp_put = win_get_perf_count();
225
226 /* Enqueue packet to head of input IP-queue.
227 */
228 if (!_pktserial)
229 {
230 void *data = (*mac_tx_format) (&head->rx_buf, _eth_addr,
231 is_ip6 ? IP6_TYPE : IP4_TYPE);
232 memcpy (MAC_SRC(data), &_eth_loop_addr, sizeof(mac_address));
233 memcpy (data, ip, ip_len);
234 }
235 else
236 memcpy (head, ip, ip_len);
237
238 /* Update queue head index
239 */
240 q->in_index = pktq_in_index (q);
241
242 LEAVE_CRIT();
243
244#else
245 union link_Packet *head;
246
247 DISABLE();
248 if (pktq_in_index(q) == q->out_index) /* queue is full, drop it */
249 {
250 q->num_drop++;
251 ENABLE();
252 *err_line = __LINE__;
253 goto drop_it;
254 }
255
256 head = (union link_Packet*) pktq_in_buf (q);
257
258 /* Enqueue packet to head of input IP-queue.
259 */
260 if (!_pktserial)
261 {
262 void *data = (*mac_tx_format) (head, _eth_addr,
263 is_ip6 ? IP6_TYPE : IP4_TYPE);
264 memcpy (MAC_SRC(data), &_eth_loop_addr, sizeof(mac_address));
265 memcpy (data, ip, ip_len);
266 }
267 else
268 memcpy (head, ip, ip_len);
269
270 /* Update queue head index
271 */
272 q->in_index = pktq_in_index (q);
273
274 ENABLE();
275#endif
276 }
277 *err_line = 0;
278 return (ip_len + _pkt_ip_ofs);
279
280drop_it:
281 /*
282 * Maybe this should be an input counter
283 */
284 if (is_ip6)
285 STAT (ip6stats.ip6s_odropped++);
286 else STAT (ip4stats.ips_odropped++);
287 return (0);
288}
289#endif /* USE_LOOPBACK */
290
291
301int W32_CALL _eth_send (WORD len, const void *sock, const char *file, unsigned line)
302{
303#if defined(USE_DEBUG) || defined(USE_LOOPBACK)
304 unsigned errline = 0;
305#endif
306 BOOL send_loopback_to_driver = FALSE;
307
308 if (!_eth_is_init) /* GvB 2002-09, Lets us run without a working eth */
309 {
310 SOCK_ERRNO (ENETDOWN);
311 return (0);
312 }
313
314#if defined(WIN32)
315 /*
316 * Just a test for now; send it to the driver and look what happens....
317 * They go on the wire and not to the Winsock loopback provider.
318 * No surprise here yet.
319 */
320 if (loopback_mode & LBACK_MODE_WINSOCK)
321 send_loopback_to_driver = TRUE;
322#endif
323
324 if (proto == IP4_TYPE)
325 {
326 /* Sending to loopback device if IPv4.
327 */
328 const in_Header *ip = (const in_Header*) nw_pkt;
329
330 if (!send_loopback_to_driver &&
331 _ip4_is_loopback_addr(intel(ip->destination)))
332 {
333#if defined(USE_LOOPBACK)
334 len = send_loopback (*TX_BUF(), FALSE, &errline);
335#else
336 STAT (ip4stats.ips_odropped++); /* packet dropped (null-device) */
337#endif
338 goto debug_tx;
339 }
340 }
341
342#if defined(USE_IPV6)
343 else if (proto == IP6_TYPE)
344 {
345 const in6_Header *ip = (const in6_Header*) nw_pkt;
346
347 if (!send_loopback_to_driver &&
348 IN6_IS_ADDR_LOOPBACK(&ip->destination))
349 {
350#if defined(USE_LOOPBACK)
351 len = send_loopback (*TX_BUF(), TRUE, &errline);
352#else
353 STAT (ip6stats.ip6s_odropped++);
354#endif
355 goto debug_tx;
356 }
357 }
358#endif /* USE_IPV6 */
359
360#if defined(USE_PPPOE)
361 else if (proto == PPPOE_SESS_TYPE)
362 {
363 pppoe_Packet *pppoe = (pppoe_Packet*) TX_BUF()->eth.data;
364
365 pppoe->head.length = intel16 (len+2);
366 len += PPPOE_HDR_SIZE + 2; /* add 2 for protocol */
367 }
368#endif
369
370 /* Store the last Tx CPU timestamp (for debugging).
371 */
372#if (DOSX)
373 if (debug_xmit && has_rdtsc)
374 {
375 #if defined(WIN32)
376 uint64 cnt = win_get_perf_count();
377 memcpy (&_eth_last.tx.tstamp, &cnt, sizeof(_eth_last.tx.tstamp));
378 #else
379 get_rdtsc2 (&_eth_last.tx.tstamp);
380 #endif
381 }
382#endif
383
384 /* Do the MAC-dependent transmit. `len' on return is total length
385 * of link-layer packet sent. `len' is 0 on failure. The xmit-hook
386 * is used by e.g. libpcap/libnet.
387 */
388 if (_eth_xmit_hook)
389 len = (*_eth_xmit_hook) (TX_BUF(), len + _pkt_ip_ofs);
390 else len = (*mac_transmit) (TX_BUF(), len + _pkt_ip_ofs);
391
392 if (len > _pkt_ip_ofs)
393 {
394 _eth_last.tx.size = len;
395 len -= _pkt_ip_ofs;
396 }
397 else
398 {
399 if (debug_on)
400 outs ("Tx failed. ");
401 len = 0;
402 _eth_last.tx.size = 0;
403 }
404
405debug_tx:
406
407#if defined(NEED_PKT_SPLIT)
408 pkt_split_mac_out (TX_BUF());
409#endif
410
411#if defined(USE_STATISTICS)
412 if (len > 0)
413 update_out_stat();
414#endif
415
416#if defined(USE_DEBUG)
417 if (debug_xmit)
418 (*debug_xmit) (sock, (const in_Header*)nw_pkt, file, line);
419
420 if (len == 0)
421 {
422 if (errline && !send_loopback_to_driver)
423 dbug_printf ("** Error in loopback handler, line %u\n", errline);
424 else
425 {
426 const char err[] = "** Transmit fault **\n";
427
428 TRACE_CONSOLE (1, err);
429 dbug_printf (err);
430 }
431 }
432#else
433 ARGSUSED (sock);
434 ARGSUSED (file);
435 ARGSUSED (line);
436#endif
437
438 /* Undo hack done in pppoe_mac_format()
439 */
440 if (proto == PPPOE_SESS_TYPE || _pktdevclass == PDCLASS_ETHER)
441 _pkt_ip_ofs = sizeof(eth_Header);
442 return (len);
443}
444
448static void *eth_mac_format (void *mac_buf, const void *mac_dest, WORD type)
449{
450 union link_Packet *buf = (union link_Packet*) mac_buf;
451
452 proto = type; /* remember protocol for _eth_send() */
453
454 /* Clear any remains of an old small packet.
455 */
456 memset (&buf->eth.data[0], 0, ETH_MIN-sizeof(eth_Header));
457
458#if defined(USE_PPPOE)
459 if (type == IP4_TYPE && pppoe_is_up(mac_dest))
460 {
461 proto = PPPOE_SESS_TYPE;
462 return pppoe_mac_format (buf);
463 }
464#endif
465
466 if (mac_dest)
467 memcpy (&buf->eth.head.destination, mac_dest, sizeof(mac_address));
468 memcpy (&buf->eth.head.source, &_eth_addr, sizeof(mac_address));
469
470 buf->eth.head.type = type;
471 return (&buf->eth.data);
472}
473
477static void *tok_mac_format (void *mac_buf, const void *mac_dest, WORD type)
478{
479 union link_Packet *buf = (union link_Packet*) mac_buf;
480
481 /* No need to clear data behind header.
482 */
483 if (mac_dest)
484 memcpy (&buf->tok.head.destination, mac_dest, sizeof(mac_address));
485 memcpy (&buf->tok.head.source, &_eth_addr, sizeof(mac_address));
486
487#if 0
488 /* !!fix me: need to expand the RIF
489 */
490 if (_pktdevclass == PDCLASSS_TOKEN_RIF)
491 ((void)0);
492#endif
493
494 buf->tok.head.accessCtrl = TR_AC;
495 buf->tok.head.frameCtrl = TR_FC;
496 buf->tok.head.DSAP = TR_DSAP;
497 buf->tok.head.SSAP = TR_SSAP;
498 buf->tok.head.ctrl = TR_CTRL;
499 buf->tok.head.org[0] = TR_ORG;
500 buf->tok.head.org[1] = TR_ORG;
501 buf->tok.head.org[2] = TR_ORG;
502 buf->tok.head.type = type;
503 proto = type;
504 return (&buf->tok.data);
505}
506
510static void *fddi_mac_format (void *mac_buf, const void *mac_dest, WORD type)
511{
512 union link_Packet *buf = (union link_Packet*) mac_buf;
513
514 memset (&buf->fddi.data[0], 0, FDDI_MIN-sizeof(fddi_Header));
515 if (mac_dest)
516 memcpy (&buf->fddi.head.destination, mac_dest, sizeof(mac_address));
517 memcpy (&buf->fddi.head.source, &_eth_addr, sizeof(mac_address));
518
519 buf->fddi.head.frameCtrl = FDDI_FC;
520 buf->fddi.head.DSAP = FDDI_DSAP;
521 buf->fddi.head.SSAP = FDDI_SSAP;
522 buf->fddi.head.ctrl = FDDI_CTRL;
523 buf->fddi.head.org[0] = FDDI_ORG;
524 buf->fddi.head.org[1] = FDDI_ORG;
525 buf->fddi.head.org[2] = FDDI_ORG;
526 buf->fddi.head.type = type;
527 proto = type;
528 return (&buf->fddi.data);
529}
530
534static void *arcnet_mac_format (void *mac_buf, const void *mac_dest, WORD type)
535{
536 union link_Packet *buf = (union link_Packet*) mac_buf;
537 BYTE dest;
538
539 if (type == IP4_TYPE) /* Map to DataPoint proto types */
540 type = ARCNET_IP_1201;
541 else if (type == IP6_TYPE)
542 type = ARCNET_IP6;
543 else if (type == ARP_TYPE)
544 type = ARCNET_ARP_1201;
545 else if (type == RARP_TYPE)
546 type = ARCNET_RARP_1201;
547
548 if (!mac_dest || !memcmp(mac_dest, &_eth_brdcast, sizeof(_eth_brdcast)))
549 dest = 0x00; /* map to ARCNET broadcast */
550 else dest = *(BYTE*)mac_dest; /* Use MSB as destination */
551
552 buf->arc.head.source = _eth_addr[0];
553 buf->arc.head.destination = dest;
554 buf->arc.head.type = (BYTE) type;
555 buf->arc.head.flags = 0; /* !! */
556 buf->arc.head.sequence = 0; /* !! */
557#if 0 /* should never be transmitted */
558 buf->arc.head.type2 = type;
559 buf->arc.head.flags2 = 0; /* !! */
560 buf->arc.head.sequence2 = 0; /* !! */
561#endif
562
563 proto = (BYTE) type;
564 return (void*) ((BYTE*)&buf->arc + ARC_HDRLEN);
565}
566
571static void *null_mac_format (void *mac_buf, const void *mac_dest, WORD type)
572{
573 union link_Packet *buf = (union link_Packet*) mac_buf;
574
575 memset (&buf->ip.head, 0, sizeof(buf->ip.head));
576 ARGSUSED (mac_dest);
577 ARGSUSED (type);
578 proto = IP4_TYPE;
579 return (void*) (&buf->ip.head);
580}
581
586static int eth_mac_xmit (const void *buf, WORD len)
587{
588 if (len < ETH_MIN)
589 len = ETH_MIN; /* zero padding already done in eth_mac_format() */
590 else if (len > ETH_MAX)
591 len = ETH_MAX;
592
593 return pkt_send (buf, len);
594}
595
596static int fddi_mac_xmit (const void *buf, WORD len)
597{
598 if (len < FDDI_MIN)
599 len = FDDI_MIN;
600 else if (len > FDDI_MAX)
601 len = FDDI_MAX;
602
603 return pkt_send (buf, len);
604}
605
606static int arcnet_mac_xmit (const void *buf, WORD len)
607{
608 if (len < ARCNET_MIN)
609 len = ARCNET_MIN;
610 else if (len > ARCNET_MAX)
611 len = ARCNET_MAX;
612
613 return pkt_send (buf, len);
614}
615
616static int tok_mac_xmit (const void *buf, WORD len)
617{
618 if (len > TOK_MAX) /* Token-Ring has no min. length */
619 len = TOK_MAX;
620 return pkt_send (buf, len);
621}
622
623static int null_mac_xmit (const void *buf, WORD len)
624{
625 return pkt_send (buf, len);
626}
627
628
634int W32_CALL _eth_init (void)
635{
636 int rc;
637
638 if (_eth_is_init)
639 return (0);
640
641 rc = pkt_eth_init (&_eth_addr);
642 if (rc)
643 {
644 if (rc == WERR_NO_DRIVER)
645 {
646 /* Initialize to some sane default. */
647 mac_tx_format = null_mac_format;
648 mac_transmit = null_mac_xmit;
649 }
650 return (rc); /* error message already printed */
651 }
652
653 /* Save our MAC-address incase we change it. Change back at exit.
654 */
655 memcpy (_eth_real_addr, _eth_addr, sizeof(_eth_real_addr));
656
657 switch (_pktdevclass)
658 {
659 case PDCLASS_ETHER:
660 mac_tx_format = eth_mac_format;
661 mac_transmit = eth_mac_xmit;
662 break;
663 case PDCLASS_TOKEN:
664 case PDCLASS_TOKEN_RIF:
665 mac_tx_format = tok_mac_format;
666 mac_transmit = tok_mac_xmit;
667 break;
668 case PDCLASS_FDDI:
669 mac_tx_format = fddi_mac_format;
670 mac_transmit = fddi_mac_xmit;
671 break;
672 case PDCLASS_ARCNET:
673 mac_tx_format = arcnet_mac_format;
674 mac_transmit = arcnet_mac_xmit;
675 break;
676 case PDCLASS_SLIP:
677 case PDCLASS_PPP:
678 case PDCLASS_AX25: /* !! for now */
679 mac_tx_format = null_mac_format;
680 mac_transmit = null_mac_xmit;
681 break;
682 default:
683 outsnl (_LANG("No supported driver class found"));
684 return (WERR_NO_DRIVER);
685 }
686
687 memset (TX_BUF(), 0, sizeof(union link_Packet));
688 memset (&_eth_brdcast, 0xFF, sizeof(_eth_brdcast));
689 _eth_loop_addr[0] = 0xCF;
690 pkt_buf_wipe();
691
692 if (!_eth_get_hwtype(NULL, &_eth_mac_len))
693 _eth_mac_len = sizeof(eth_address);
694
695#if defined(__MSDOS__)
696 if (!strcmp(_pktdrvrname,"NDIS3PKT"))
697 _eth_ndis3pkt = TRUE;
698
699 else if (!strcmp(_pktdrvrname,"SwsVpkt"))
700 _eth_SwsVpkt = TRUE;
701#endif
702
703 _eth_is_init = TRUE;
704 RUNDOWN_ADD (__eth_release, 10);
705
706 return (0); /* everything okay */
707}
708
712int W32_CALL _eth_set_addr (const void *addr)
713{
714 if (_pktserial || _pktdevclass == PDCLASS_ARCNET)
715 return (1);
716
717 if (pkt_set_addr(addr))
718 {
719 memcpy (_eth_addr, addr, sizeof(_eth_addr));
720 return (1);
721 }
722 return (0);
723}
724
725
730BYTE W32_CALL _eth_get_hwtype (BYTE *hwtype, BYTE *hwlen)
731{
732 if (_pktdevclass == PDCLASS_ETHER)
733 {
734 if (hwlen) *hwlen = sizeof (eth_address);
735 if (hwtype) *hwtype = HW_TYPE_ETHER;
736 return (HW_TYPE_ETHER);
737 }
738 if (_pktdevclass == PDCLASS_FDDI)
739 {
740 if (hwlen) *hwlen = sizeof (fddi_address);
741 if (hwtype) *hwtype = HW_TYPE_FDDI;
742 return (HW_TYPE_FDDI);
743 }
744 if (_pktdevclass == PDCLASS_TOKEN || _pktdevclass == PDCLASS_TOKEN_RIF)
745 {
746 if (hwlen) *hwlen = sizeof (tok_address);
747 if (hwtype) *hwtype = HW_TYPE_TOKEN;
748 return (HW_TYPE_TOKEN);
749 }
750 if (_pktdevclass == PDCLASS_AX25)
751 {
752 if (hwlen) *hwlen = sizeof (ax25_address);
753 if (hwtype) *hwtype = HW_TYPE_AX25;
754 return (HW_TYPE_AX25);
755 }
756 if (_pktdevclass == PDCLASS_ARCNET)
757 {
758 if (hwlen) *hwlen = sizeof (arcnet_address); /* 1 byte */
759 if (hwtype) *hwtype = HW_TYPE_ARCNET;
760 return (HW_TYPE_ARCNET);
761 }
762 return (0);
763}
764
765
769void W32_CALL _eth_free (const void *pkt)
770{
771 if (_eth_recv_hook) /* hook-function should free it's own packet */
772 return;
773
774 if (!pkt)
775 pkt_buf_wipe(); /* restart the queue */
776 else pkt_free_pkt (pkt);
777}
778
779
785#define RCF DSAP /* Routing Control where DSAP is when no routing */
786
787#define TR_IS_SROUTED(th) ((th)->source[0] & 0x80)
788#define TR_IS_BROADCAST(th) (((intel16((th)->RCF) & 0xE000) >> 13) >= 4)
789#define TR_RIF_LENGTH(th) ((intel16((th)->RCF) & 0x1F00) >> 8)
790
791#define TR_MAC_SIZE (2+2+2*sizeof(mac_address)) /* AC,FC,src/dst */
792
793static void fix_tok_head (tok_Header **trp)
794{
795 tok_Header *tr = *trp;
796
797#if defined(USE_DEBUG)
798 const BYTE *raw = (const BYTE*)tr;
799 int i;
800
801 dbug_write ("TR raw: ");
802 for (i = 0; i < 50; i++)
803 dbug_printf ("%02X ", raw[i]);
804 dbug_write ("\n");
805#endif
806
807 if (TR_IS_SROUTED(tr)) /* Source routed */
808 {
809 int rlen = TR_RIF_LENGTH (tr);
810
811 tr->source[0] &= 0x7F; /* clear RII bit */
812
813 /* Set our notion of link-layer broadcast
814 */
815 if (TR_IS_BROADCAST(tr))
816 tr->destination[0] |= 1;
817
818 /* Copy MAC-header rlen bytes upwards
819 */
820 memmove ((BYTE*)tr + rlen, tr, TR_MAC_SIZE);
821 *trp = (tok_Header*) ((BYTE*)tr + rlen);
822 }
823}
824
825/*
826 * Check (and fix?) the received ARCNET header.
827 * All frames must have a common layout with headlen ARC_HDRLEN.
828 */
829static BOOL fix_arc_head (const arcnet_Header *head, WORD *type)
830{
831#if defined(USE_DEBUG)
832 const BYTE *raw = (const BYTE*)head;
833 int i;
834
835 dbug_write ("ARC raw: ");
836 for (i = 0; i < 50; i++)
837 dbug_printf ("%02X ", raw[i]);
838 dbug_write ("\n");
839#endif
840
841 *type = head->type;
842
843 /* Map to IANA numbers
844 */
845 if (*type == ARCNET_IP_1051 || *type == ARCNET_IP_1201)
846 *type = IP4_TYPE;
847 if (*type == ARCNET_ARP_1051 || *type == ARCNET_ARP_1201)
848 *type = ARP_TYPE;
849
850 if (head->flags == 0xFF || /* Exception packet */
851 (*type != IP4_TYPE && /* Neither IP nor ARP */
852 *type != ARP_TYPE))
853 return (FALSE);
854 return (TRUE);
855}
856
868static union link_Packet *poll_recv_queue (WORD *type)
869{
870#if defined(USE_FAST_PKT) || defined(WIN32)
871 struct pkt_rx_element *buf;
872#endif
873 struct pkt_ringbuf *q = &_pkt_inf->pkt_queue;
874 union link_Packet *pkt;
875 struct in_Header *ip;
876
877 ASSERT_PKT_INF (NULL);
878
879#if defined(USE_DEBUG)
880#if defined(USE_FAST_PKT)
881 if (!pktq_far_check(q)) /* MSDOS only */
882#else
883 if (!pktq_check(q))
884#endif
885 {
886 fprintf (stderr, "%s: pkt-queue destroyed!\n", __FILE__);
887 exit (-1);
888 }
889#endif /* USE_DEBUG */
890
891#if defined(WIN32)
892 buf = pkt_poll_recv();
893 if (!buf)
894 return (NULL);
895
896 PROFILE_RECV (buf->tstamp_put, buf->tstamp_get);
897 _eth_last.rx.size = buf->rx_length;
898 memcpy (&_eth_last.rx.tstamp, &buf->tstamp_put, sizeof(_eth_last.rx.tstamp));
899 pkt = (link_Packet*) &buf->rx_buf[0];
900
901#elif defined(USE_FAST_PKT)
902 buf = pkt_poll_recv();
903 if (!buf)
904 return (NULL);
905
906 PROFILE_RECV (*(uint64*)&buf->tstamp_put, *(uint64*)&buf->tstamp_get);
907 pkt = (link_Packet*) buf->rx_buf;
908 _eth_last.rx.size = buf->rx_length_1; /* length on 1st upcall */
909 _eth_last.rx.tstamp.lo = buf->tstamp_put[0]; /* TSC set in asmpkt */
910 _eth_last.rx.tstamp.hi = buf->tstamp_put[1];
911
912#else
913 if (!pktq_queued(q))
914 return (NULL);
915
916 pkt = (link_Packet*) pktq_out_buf (q);
917 _eth_last.rx.size = ETH_MAX; /* !! wrong, but doesn't matter for pcap */
918 _eth_last.rx.tstamp.lo = 0UL; /* pcdbug.c writes rx-time == dbg-time */
919 _eth_last.rx.tstamp.hi = 0UL;
920#endif
921
922
923 if (_pktserial)
924 {
925 ip = &pkt->ip.head; /* SLIP/PPP/AX25 */
926 *type = (ip->ver == 4) ? IP4_TYPE : IP6_TYPE;
927 return (pkt);
928 }
929
930 if (_pktdevclass == PDCLASS_TOKEN || _pktdevclass == PDCLASS_TOKEN_RIF)
931 {
932 tok_Header *tr = &pkt->tok.head;
933
934 fix_tok_head (&tr);
935 *type = tr->type;
936 return (union link_Packet*) tr;
937 }
938
939 if (_pktdevclass == PDCLASS_ARCNET)
940 {
941 arcnet_Packet *arc = &pkt->arc;
942
943 if (!fix_arc_head(&arc->head, type))
944 {
945 DEBUG_RX (NULL, &arc->data);
946 pkt_free_pkt (pkt);
947 pkt = NULL;
948 }
949 return (pkt);
950 }
951
952 if (_pktdevclass == PDCLASS_FDDI)
953 {
954 fddi_Packet *fddi = &pkt->fddi;
955
956 *type = fddi->head.type;
957 return (pkt);
958 }
959
960 /* must be PDCLASS_ETHER */
961
962 *type = pkt->eth.head.type;
963 ARGSUSED (q);
964 return (pkt);
965}
966
967/*
968 * Fix the LLC header to look like ordinary Ethernet II
969 * !! not yet.
970 */
971static void fix_llc_head (void **mac)
972{
973#if 1
974 DEBUG_RX (NULL, *mac);
975 _eth_free (*mac);
976 *mac = NULL;
977#else
980#endif
981}
982
983
996void * W32_CALL _eth_arrived (WORD *type_ptr, BOOL *broadcast)
997{
998 union link_Packet *pkt;
999 mac_address *dst;
1000 void *ret = NULL;
1001 BOOL is_bcast = FALSE;
1002 WORD type = 0;
1003
1004 if (!_eth_is_init) /* GvB 2002-09, Lets us run without a working driver */
1005 return (NULL);
1006
1007 if (_eth_recv_hook)
1008 pkt = (union link_Packet*) (*_eth_recv_hook) (&type);
1009 else pkt = poll_recv_queue (&type);
1010
1011 if (!pkt)
1012 return (NULL);
1013
1014 if (_eth_recv_peek && !(*_eth_recv_peek)(pkt))
1015 {
1016 _eth_free (pkt);
1017 return (NULL);
1018 }
1019
1020 /* Hack: If _ip?_handler() can't be reentered, only accept
1021 * non-IP packets. Assume PPPoE session packets carries only IP.
1022 */
1023 if (_ip_recursion &&
1024 (type == IP4_TYPE || type == IP6_TYPE || type == PPPOE_SESS_TYPE))
1025 {
1027 STAT (macstats.num_ip_recurse++);
1028 _eth_free (pkt);
1029 return (NULL);
1030 }
1031
1032 if (_pktserial)
1033 {
1034 dst = NULL;
1035 ret = (void*) &pkt->ip;
1036 }
1037 else if (_pktdevclass == PDCLASS_TOKEN || _pktdevclass == PDCLASS_TOKEN_RIF)
1038 {
1039 dst = &pkt->tok.head.destination;
1040 ret = (void*) &pkt->tok.data;
1041 }
1042 else if (_pktdevclass == PDCLASS_FDDI)
1043 {
1044 dst = &pkt->fddi.head.destination;
1045 ret = (void*) &pkt->fddi.data;
1046 }
1047 else if (_pktdevclass == PDCLASS_ARCNET)
1048 {
1049 dst = (mac_address*) &pkt->arc.head.destination;
1050 ret = (void*) ((BYTE*)pkt + ARC_HDRLEN);
1051 }
1052 else /* must be ether */
1053 {
1054 dst = &pkt->eth.head.destination;
1055 ret = (void*) &pkt->eth.data;
1056 }
1057
1058#if defined(NEED_PKT_SPLIT)
1059 pkt_split_mac_in (pkt);
1060#endif
1061
1062#if defined(USE_STATISTICS)
1063 update_in_stat();
1064#endif
1065
1066#if defined(NEED_PKT_SPLIT) && defined(USE_DEBUG) && 0 /* test */
1067 pkt_print_split_in();
1068#endif
1069
1070 /* ARCnet should never have LLC fields. So don't test for it
1071 */
1072 if (_pktdevclass != PDCLASS_ARCNET)
1073 {
1074 if (dst && !memcmp(dst, &_eth_brdcast, sizeof(_eth_brdcast)))
1075 is_bcast = TRUE;
1076
1077 if (intel16(type) < 0x600) /* LLC length field */
1078 fix_llc_head (&ret);
1079 }
1080 else if (dst && *(BYTE*)dst == 0) /* ARCnet broadcast */
1081 {
1082 is_bcast = TRUE;
1083 }
1084
1085 if (type_ptr)
1086 *type_ptr = type;
1087
1088 if (broadcast)
1089 *broadcast = is_bcast;
1090
1091 return (ret);
1092}
1093
1094
1095#if defined(NOT_USED)
1099void *_eth_mac_hdr (const in_Header *ip)
1100{
1101 if (!_pktserial)
1102 return (void*) ((BYTE*)ip - _pkt_ip_ofs);
1103
1104 (*_printf) ("Illegal use of `_eth_mac_hdr()' for class %d\n",
1105 _pktdevclass);
1106 exit (-1);
1107 return (NULL);
1108}
1109
1113void *_eth_mac_dst (const in_Header *ip)
1114{
1115 const union link_Packet *pkt;
1116
1117 pkt = (const union link_Packet*) ((BYTE*)ip - _pkt_ip_ofs);
1118
1119 if (_pktdevclass == PDCLASS_ETHER)
1120 return (void*) &pkt->eth.head.destination;
1121
1122 if (_pktdevclass == PDCLASS_TOKEN || _pktdevclass == PDCLASS_TOKEN_RIF)
1123 return (void*) &pkt->tok.head.destination;
1124
1125 if (_pktdevclass == PDCLASS_FDDI)
1126 return (void*) &pkt->fddi.head.destination;
1127
1128 if (_pktdevclass == PDCLASS_ARCNET)
1129 return (void*) &pkt->arc.head.destination;
1130
1131 (*_printf) ("Illegal use of `_eth_mac_dst()' for class %d\n",
1132 _pktdevclass);
1133 exit (-1);
1134 return (NULL);
1135}
1136
1140void *_eth_mac_src (const in_Header *ip)
1141{
1142 const union link_Packet *pkt;
1143
1144 pkt = (const union link_Packet*) ((BYTE*)ip - _pkt_ip_ofs);
1145
1146 if (_pktdevclass == PDCLASS_ETHER)
1147 return (void*) &pkt->eth.head.source;
1148
1149 if (_pktdevclass == PDCLASS_TOKEN || _pktdevclass == PDCLASS_TOKEN_RIF)
1150 return (void*) &pkt->tok.head.source;
1151
1152 if (_pktdevclass == PDCLASS_FDDI)
1153 return (void*) &pkt->fddi.head.source;
1154
1155 if (_pktdevclass == PDCLASS_ARCNET)
1156 return (void*) &pkt->arc.head.source;
1157
1158 (*_printf) ("Illegal use of `_eth_mac_src()' for class %d\n",
1159 _pktdevclass);
1160 exit (-1);
1161 return (NULL);
1162}
1163
1167WORD _eth_mac_typ (const in_Header *ip)
1168{
1169 const union link_Packet *pkt;
1170
1171 pkt = (const union link_Packet*) ((BYTE*)ip - _pkt_ip_ofs);
1172
1173 if (_pktdevclass == PDCLASS_ETHER)
1174 return (pkt->eth.head.type);
1175
1176 if (_pktdevclass == PDCLASS_TOKEN || _pktdevclass == PDCLASS_TOKEN_RIF)
1177 return (pkt->tok.head.type);
1178
1179 if (_pktdevclass == PDCLASS_FDDI)
1180 return (pkt->fddi.head.type);
1181
1182 if (_pktdevclass == PDCLASS_ARCNET)
1183 return (pkt->arc.head.type);
1184
1185 (*_printf) ("Illegal use of `_eth_mac_typ()' for class %d\n",
1186 _pktdevclass);
1187 exit (-1);
1188 return (0);
1189}
1190#endif /* NOT_USED */
1191
1192
1193/*
1194 * Jim Martin's Multicast extensions
1195 */
1196
1197#if defined(USE_MULTICAST)
1204BOOL _eth_join_mcast_group (const struct MultiCast *mc)
1205{
1206 eth_address list [IPMULTI_SIZE];
1207 int i, len, nextentry;
1208 BOOL is_mcast1, is_mcast2, is_promis;
1209
1210 /* Return if we're already receiving all multicasts or is in
1211 * promiscous mode.
1212 */
1213#if defined(WIN32)
1214 is_mcast1 = (_pkt_rxmode & RXMODE_MULTICAST1);
1215 is_mcast2 = (_pkt_rxmode & RXMODE_MULTICAST2);
1216 is_promis = (_pkt_rxmode & RXMODE_PROMISCOUS);
1217#else
1218 is_mcast1 = (_pkt_rxmode >= RXMODE_MULTICAST1);
1219 is_mcast2 = (_pkt_rxmode >= RXMODE_MULTICAST2);
1220 is_promis = (_pkt_rxmode >= RXMODE_PROMISCOUS);
1221#endif
1222
1223 if (is_mcast2 || is_promis)
1224 return (TRUE);
1225
1226 if (!is_mcast1)
1227 {
1228 is_mcast1 = pkt_set_rcv_mode(RXMODE_MULTICAST1);
1229 if (!is_mcast1)
1230 is_promis = pkt_set_rcv_mode(RXMODE_PROMISCOUS);
1231 if (is_promis)
1232 return (TRUE);
1233 if (!is_mcast1 && !is_promis)
1234 return (FALSE); /* hopeless, give up */
1235 }
1236
1237 len = sizeof(list);
1238 if (!pkt_get_multicast_list (list, &len))
1239 {
1240 /* If no MC support, switch to MC2 mode
1241 */
1242 if (_pkt_errno == PDERR_NO_MULTICAST)
1243 return pkt_set_rcv_mode (RXMODE_MULTICAST2);
1244 return (FALSE);
1245 }
1246
1247 /* check to see if the address is already in the list
1248 */
1249 for (i = 0; i < len / SIZEOF(list[0]); i++)
1250 if (!memcmp(list[i], &mc->ethaddr, sizeof(list[0])))
1251 return (TRUE);
1252
1253 if (len > 0)
1254 nextentry = len / sizeof(list[0]); /* append entry */
1255 else nextentry = 0;
1256
1257 memcpy (&list[nextentry], &mc->ethaddr, sizeof(eth_address));
1258 len += sizeof (list[0]);
1259
1260 if (!pkt_set_multicast_list((const eth_address*)&list,len))
1261 {
1262 /* If no space or no MC support, switch to MC2 mode
1263 */
1264 if (_pkt_errno == PDERR_NO_SPACE ||
1265 _pkt_errno == PDERR_NO_MULTICAST)
1266 return pkt_set_rcv_mode (RXMODE_MULTICAST2);
1267 return (FALSE);
1268 }
1269 return (TRUE);
1270}
1271
1278BOOL _eth_leave_mcast_group (const struct MultiCast *mc)
1279{
1280 eth_address list[IPMULTI_SIZE];
1281 int i, len, idx;
1282
1283 /* \note This should be expanded to include switching back to
1284 * RXMODE_MULTCAST1 if the list of multicast addresses has
1285 * shrunk sufficiently.
1286 *
1287 * First check to see if we're in RXMODE_MULTICAST2. if so return
1288 */
1289#if defined(WIN32)
1290 if (_pkt_rxmode & RXMODE_MULTICAST2)
1291 return (TRUE);
1292#else
1293 if (_pkt_rxmode >= RXMODE_MULTICAST2)
1294 return (TRUE);
1295#endif
1296
1297 /* get the list of current multicast addresses
1298 */
1299 len = sizeof(list);
1300 if (!pkt_get_multicast_list (list, &len))
1301 return (FALSE);
1302
1303 /* find the apropriate entry
1304 */
1305 for (i = 0, idx = -1; i < len/SIZEOF(list[0]); i++)
1306 if (!memcmp(list[i],&mc->ethaddr,sizeof(list[0])))
1307 idx = i;
1308
1309 /* if it's not in the list, just return
1310 */
1311 if (idx == -1)
1312 return (TRUE);
1313
1314 /* ahh, but it _is_ in the list. So shorten the list
1315 * and send it back to the PKTDRVR
1316 */
1317 if (idx+1 < len/SIZEOF(list[0]))
1318 memmove (&list[idx], &list[idx+1], len-(idx+1)*sizeof(list[0]));
1319
1320 len -= sizeof(list[0]);
1321
1322 if (!pkt_set_multicast_list((const eth_address*)&list, len))
1323 {
1324 /* If no space or no MC support, switch mode
1325 */
1326 if (_pkt_errno == PDERR_NO_SPACE ||
1327 _pkt_errno == PDERR_NO_MULTICAST)
1328 return pkt_set_rcv_mode (RXMODE_MULTICAST2);
1329 return (FALSE);
1330 }
1331 return (TRUE);
1332}
1333#endif /* USE_MULTICAST */
1334
1339#include "nochkstk.h"
1340
1341static void W32_CALL __eth_release (void)
1342{
1343 _eth_release();
1344}
1345
1349void W32_CALL _eth_release (void)
1350{
1351 if (!_eth_is_init)
1352 return;
1353
1354 /* Set original MAC address (if not fatal-error or serial-driver)
1355 */
1356 if (!_watt_fatal_error)
1357 {
1358 if (!_pktserial)
1359 {
1360 if (memcmp(&_eth_addr, &_eth_real_addr, sizeof(_eth_addr)))
1361 pkt_set_addr (&_eth_real_addr);
1362
1363#if defined(USE_MULTICAST) || defined(USE_IPV6) /* restore startup Rx mode */
1364 if (_pkt_rxmode0 > -1 && _pkt_rxmode0 != _pkt_rxmode)
1365 pkt_set_rcv_mode (_pkt_rxmode0);
1366#endif
1367 }
1368
1369#if defined(USE_DEBUG)
1370 if (debug_on > 0)
1371 {
1372 u_long drops = pkt_dropped();
1373 if (drops)
1374 (*_printf) ("%lu packets dropped\n", drops);
1375 }
1376#endif
1377 }
1378 _eth_is_init = FALSE; /* in case we crash in pkt_release() */
1379 pkt_release();
1380}
1381
bsddbug.h
copyrigh.h
cpumodel.h
ip4_in.h
ip6_in.h
language.h
loopback.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
misc.h
misc_str.h
nochkstk.h
pcconfig.h
pcdbug.h
pcigmp.h
pkt_buf_wipe
int pkt_buf_wipe(void)
Clear the receive queue.
Definition: pcpkt.c:1331
_pkt_rxmode0
int _pkt_rxmode0
startup receive mode
Definition: pcpkt.c:54
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
pkt_free_pkt
void pkt_free_pkt(const void *pkt)
Release a packet from the receive queue.
Definition: pcpkt.c:1346
_pkt_inf
struct pkt_info * _pkt_inf
module data that will be locked
Definition: pcpkt.c:61
pkt_set_multicast_list
int pkt_set_multicast_list(const void *listbuf, int len)
Sets the list of multicast addresses for which the PKTDRVR is responsible.
Definition: pcpkt.c:2082
pkt_release
int DTOR pkt_release(void)
Definition: pcpkt.c:837
_pkt_ip_ofs
WORD _pkt_ip_ofs
ofs from link-layer head to ip
Definition: pcpkt.c:49
pkt_get_multicast_list
int pkt_get_multicast_list(mac_address *listbuf, int *lenp)
Gets the current list of multicast addresses from the PKTDRVR.
Definition: pcpkt.c:2035
_pkt_rxmode
int _pkt_rxmode
active receive mode
Definition: pcpkt.c:53
pkt_eth_init
int pkt_eth_init(mac_address *addr)
Initialise Packet driver interface.
Definition: pcpkt.c:1446
_pkt_errno
int _pkt_errno
error code set in pcpkt.c API
Definition: pcpkt.c:55
pkt_dropped
DWORD pkt_dropped(void)
Return number of packets dropped.
Definition: pcpkt.c:1391
pkt_set_addr
int pkt_set_addr(const void *addr)
Set a new MAC source address.
Definition: pcpkt.c:1195
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
pkt_send
int pkt_send(const void *tx, int length)
Send a link-layer frame.
Definition: pcpkt.c:1087
pkt_set_rcv_mode
int pkt_set_rcv_mode(int mode)
Sets the receive mode of the interface.
Definition: pcpkt.c:1953
pcpkt.h
RXMODE_PROMISCOUS
@ RXMODE_PROMISCOUS
receive all packets on network
Definition: pcpkt.h:114
RXMODE_MULTICAST2
@ RXMODE_MULTICAST2
BROADCAST + all multicast
Definition: pcpkt.h:113
RXMODE_MULTICAST1
@ RXMODE_MULTICAST1
BROADCAST + limited multicast
Definition: pcpkt.h:112
pcqueue.h
eth_mac_xmit
static int eth_mac_xmit(const void *buf, WORD len)
Functions called via function pointer ‘mac_transmit’ to actually send the data.
Definition: pcsed.c:586
_eth_release
void W32_CALL _eth_release(void)
Release the hardware driver.
Definition: pcsed.c:1349
tok_mac_format
static void * tok_mac_format(void *mac_buf, const void *mac_dest, WORD type)
Format the MAC-header for Token-Ring.
Definition: pcsed.c:477
_eth_join_mcast_group
BOOL _eth_join_mcast_group(const struct MultiCast *mc)
Joins a multicast group (at the physical layer).
Definition: pcsed.c:1204
_eth_is_init
BOOL _eth_is_init
we are initialised
Definition: pcsed.c:54
mac_tx_format
static void *(* mac_tx_format)(void *mac_buf, const void *mac_dest, WORD type)
Pointer to functions that does the filling of correct MAC-header and sends the link-layer packet.
Definition: pcsed.c:98
_eth_last
struct _eth_last_info _eth_last
Sizes and timestamps of last packet recv/sent.
Definition: pcsed.c:67
_eth_mac_typ
WORD _eth_mac_typ(const in_Header *ip)
Return value of protocol-type given an IP packet.
Definition: pcsed.c:1167
_eth_leave_mcast_group
BOOL _eth_leave_mcast_group(const struct MultiCast *mc)
Leaves a multicast group (at the physical layer)
Definition: pcsed.c:1278
_eth_ndis3pkt
BOOL _eth_ndis3pkt
for DOS-programs only
Definition: pcsed.c:56
poll_recv_queue
static union link_Packet * poll_recv_queue(WORD *type)
Poll the packet queue.
Definition: pcsed.c:868
_eth_win10pcap
BOOL _eth_win10pcap
for Win32 using an Win10Pcap adapter
Definition: pcsed.c:59
_eth_loop_addr
mac_address _eth_loop_addr
Link-layer loopback address.
Definition: pcsed.c:51
arcnet_mac_format
static void * arcnet_mac_format(void *mac_buf, const void *mac_dest, WORD type)
Format the MAC-header for ARCNET.
Definition: pcsed.c:534
_eth_send
int W32_CALL _eth_send(WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
Definition: pcsed.c:301
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
_eth_set_addr
int W32_CALL _eth_set_addr(const void *addr)
Sets a new MAC address for our interface.
Definition: pcsed.c:712
_eth_mac_hdr
void * _eth_mac_hdr(const in_Header *ip)
Return pointer to MAC header start address of an IP packet.
Definition: pcsed.c:1099
eth_mac_format
static void * eth_mac_format(void *mac_buf, const void *mac_dest, WORD type)
Format the MAC-header for Ethernet.
Definition: pcsed.c:448
_eth_init
int W32_CALL _eth_init(void)
Initialize the network driver interface.
Definition: pcsed.c:634
fix_llc_head
static void fix_llc_head(void **mac)
Definition: pcsed.c:971
_eth_mac_dst
void * _eth_mac_dst(const in_Header *ip)
Return pointer to MAC destination address of an IP packet.
Definition: pcsed.c:1113
_eth_wanpacket
BOOL _eth_wanpacket
for Win32 using an WanPacket adapter
Definition: pcsed.c:58
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
__eth_release
static void W32_CALL __eth_release(void)
Turn off stack-checking because _eth_release() might be called from an exception handler.
Definition: pcsed.c:1341
_eth_winpcap
BOOL _eth_winpcap
for Win32 using an WinPcap or NPcap adapter (default)
Definition: pcsed.c:60
null_mac_format
static void * null_mac_format(void *mac_buf, const void *mac_dest, WORD type)
Format MAC-header for protocols without MAC-headers.
Definition: pcsed.c:571
_eth_recv_hook
void *W32_CALL * _eth_recv_hook(WORD *type)
Pointer to functions that when set changes the behaviour of polling and send functions _eth_arrived()...
_eth_mac_src
void * _eth_mac_src(const in_Header *ip)
Return pointer to MAC source address of an IP packet.
Definition: pcsed.c:1140
_eth_arrived
void *W32_CALL _eth_arrived(WORD *type_ptr, BOOL *broadcast)
Poll for arrival of new packets (IP/ARP/RARP/PPPoE protocol).
Definition: pcsed.c:996
_eth_get_hwtype
BYTE W32_CALL _eth_get_hwtype(BYTE *hwtype, BYTE *hwlen)
Fill in hardware address type/length for BOOTP/DHCP packets.
Definition: pcsed.c:730
_eth_SwsVpkt
BOOL _eth_SwsVpkt
for DOS and Win32 programs
Definition: pcsed.c:57
_ip_recursion
BOOL _ip_recursion
avoid recursion in arp_resolve()
Definition: pcsed.c:55
_eth_mac_len
BYTE _eth_mac_len
Size of a MAC address.
Definition: pcsed.c:53
fddi_mac_format
static void * fddi_mac_format(void *mac_buf, const void *mac_dest, WORD type)
Format the MAC-header for FDDI.
Definition: pcsed.c:510
send_loopback
static int send_loopback(link_Packet pkt, BOOL is_ip6, unsigned *err_line)
Enqueue a link-layer frame (IPv4/v6 only) to the internal loopback device.
Definition: pcsed.c:151
_eth_brdcast
mac_address _eth_brdcast
Link-layer broadcast address.
Definition: pcsed.c:50
_eth_real_addr
mac_address _eth_real_addr
Our real MAC address.
Definition: pcsed.c:52
_eth_free
void W32_CALL _eth_free(const void *pkt)
Free an input buffer once it is no longer needed.
Definition: pcsed.c:769
pcsed.h
update_out_stat
void update_out_stat(void)
Definition: pcstat.c:724
update_in_stat
void update_in_stat(void)
Definition: pcstat.c:583
pcstat.h
pctcp.h
pppoe_mac_format
void * pppoe_mac_format(union link_Packet *tx)
Build a PPPoE session packet header.
Definition: pppoe.c:378
pppoe_is_up
BOOL pppoe_is_up(const void *dest)
Determine if we have a PPPoE session with the machine given by 'dest'.
Definition: pppoe.c:288
pppoe.h
profile.h
sock_ini.h
split.h
MultiCast
Multicast internal structure.
Definition: pcigmp.h:104
MultiCast::ethaddr
eth_address ethaddr
Ethernet address of group.
Definition: pcigmp.h:106
arcnet_Header
Definition: pcsed.h:180
arcnet_Packet
Definition: pcsed.h:201
eth_Header
Definition: pcsed.h:20
fddi_Header
Definition: pcsed.h:149
fddi_Packet
Definition: pcsed.h:164
in6_Header
Definition: wattcp.h:381
in_Header
Definition: wattcp.h:329
pkt_ringbuf
FIFO style ring-buffer.
Definition: pcqueue.h:81
pkt_ringbuf::num_drop
volatile DWORD num_drop
number of dropped pkts
Definition: pcqueue.h:86
pkt_ringbuf::num_buf
WORD num_buf
number of buffers
Definition: pcqueue.h:85
pkt_ringbuf::out_index
WORD out_index
index of buffer pulled out
Definition: pcqueue.h:83
pkt_ringbuf::in_index
volatile WORD in_index
index ahead of last buffer put
Definition: pcqueue.h:82
pkt_rx_element
Definition: pcqueue.h:54
pppoe_Packet
Definition: pcsed.h:237
tok_Header
Definition: pcsed.h:70
has_rdtsc
BOOL has_rdtsc
Never set in Watt-32.
Definition: timer.c:54
timer.h
link_Packet
Definition: pcsed.h:247
wattcp.h
Core definitions.
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65
wdpmi.h


Watt-32 tcp/ip: E:/WATT/src/pcsed.h Source File

  • src
pcsed.h
Go to the documentation of this file.
1
6#ifndef _w32_PCSED_H
7#define _w32_PCSED_H
8
12#define HW_TYPE_ETHER 1 /* Ether >= 10MB */
13#define HW_TYPE_ETHER_3MB 2 /* Ether = 3MB */
14#define HW_TYPE_AX25 3 /* Amateur packet-radio */
15#define HW_TYPE_TOKEN 6 /* IEEE 802 Networks */
16#define HW_TYPE_ARCNET 7 /* 2.5 MBit ARCNET */
17#define HW_TYPE_APPLETALK 8 /* Not at all supported */
18#define HW_TYPE_FDDI 10 /* Not really supported */
19
20W32_CLANG_PACK_WARN_OFF()
21
22#include <sys/pack_on.h> /* align structs on byte boundaries */
23
28typedef struct eth_Header {
29 eth_address destination;
30 eth_address source;
31 WORD type;
32 } eth_Header;
33
38typedef struct eth_Packet {
39 eth_Header head;
40 BYTE data [ETH_MAX_DATA];
41 } eth_Packet;
42
43
48typedef struct vlan_Header {
49 eth_address destination;
50 eth_address source;
51 WORD proto; /* 0x8100 */
52 WORD tci;
53 WORD encap_proto;
54 } vlan_Header;
55
60typedef struct vlan_Packet {
61 vlan_Header head; /* 18 */
62 BYTE data [VLAN_MAX_DATA]; /* 1496 */
63 } vlan_Packet;
64
65
70typedef struct tok_Header {
71 /* MAC header.
72 */
73 BYTE accessCtrl;
74 BYTE frameCtrl;
75 mac_address destination;
76 mac_address source;
77
78 /* 2-18 bytes of Routing Information (RIF) may be present here.
79 * We discard it anyway (see fix_tok_head()).
80 */
81
82 /* LLC header.
83 */
84 BYTE DSAP;
85 BYTE SSAP;
86 BYTE ctrl;
87
88 /* SNAP extension.
89 */
90 BYTE org[3];
91 WORD type;
92 } tok_Header;
93
98typedef struct tok_Packet {
99 tok_Header head;
100 BYTE data [TOK_MAX_DATA];
101 } tok_Packet;
102
107typedef struct llc_Header {
108 BYTE DSAP;
109 BYTE SSAP;
110 union {
111 BYTE u_ctl;
112 WORD is_ctl;
113 struct {
114 BYTE snap_ui;
115 BYTE snap_pi[5];
116 } snap;
117 struct {
118 BYTE snap_ui;
119 BYTE snap_orgcode [3];
120 BYTE snap_ethertype [2];
121 } snap_ether;
122 } ctl;
123 } llc_Header;
124
125/* Just pretend IEEE 802.3 encapsulated data could this:
126*/
127#define LLC_MAX_DATA (ETH_MAX_DATA - sizeof(llc_Header))
128
129typedef struct llc_Packet {
130 llc_Header head;
131 BYTE data [LLC_MAX_DATA];
132 } llc_Packet;
133
137#define TR_AC 0x10 /* Access Control; Frame bit (not token) */
138#define TR_FC 0x40 /* Frame Control; LLC header follows */
139#define TR_DSAP 0xAA /* DSAP field; SNAP follows LLC */
140#define TR_SSAP 0xAA /* SSAP field; SNAP follows LLC */
141#define TR_CTRL 0x03 /* Unnumbered Information */
142#define TR_ORG 0x00 /* Organisation Code or Protocol Id */
143
144
149typedef struct fddi_Header {
150 BYTE frameCtrl;
151 eth_address destination;
152 eth_address source;
153 BYTE DSAP;
154 BYTE SSAP;
155 BYTE ctrl;
156 BYTE org[3];
157 WORD type;
158 } fddi_Header;
159
164typedef struct fddi_Packet {
165 fddi_Header head;
166 BYTE data [FDDI_MAX_DATA];
167 } fddi_Packet;
168
169#define FDDI_FC 0x40 /* See above */
170#define FDDI_DSAP 0xAA
171#define FDDI_SSAP 0xAA
172#define FDDI_CTRL 0x03
173#define FDDI_ORG 0x00
174
175
180typedef struct arcnet_Header {
181 BYTE source;
182 BYTE destination;
183 BYTE type;
184 BYTE flags;
185 WORD sequence;
186
187 /* Only present in exception packets (flags == 0xFF)
188 */
189 BYTE type2; /* same as 'type' */
190 BYTE flags2;
191 WORD sequence2;
192 } arcnet_Header;
193
194#define ARC_HDRLEN 6 /* normal header length */
195#define ARC_TYPE_OFS 2
196
201typedef struct arcnet_Packet {
202 arcnet_Header head;
203 BYTE data [ARCNET_MAX_DATA];
204 } arcnet_Packet;
205
212#define AX25_ADDR_LEN 7
213
214typedef struct ax25_Header {
215 char dest [AX25_ADDR_LEN]; /* Destination address */
216 char source [AX25_ADDR_LEN]; /* Source address */
217 char digis [8] [AX25_ADDR_LEN]; /* Digi string */
218 } ax25_Header;
219
220typedef struct ax25_Packet {
221 ax25_Header head;
222 BYTE data [AX25_MAX_DATA];
223 } ax25_Packet;
224
229typedef struct pppoe_Header {
230 BYTE ver : 4;
231 BYTE type : 4;
232 BYTE code;
233 WORD session;
234 WORD length;
235 } pppoe_Header;
236
237typedef struct pppoe_Packet {
238 pppoe_Header head;
239 BYTE data [PPPOE_MAX_DATA]; /* higher level proto at data[2] */
240 } pppoe_Packet;
241
242
247typedef union link_Packet {
248 struct eth_Packet eth; /* _pktdevclass = PDCLASS_ETHER */
249 struct tok_Packet tok; /* _pktdevclass = PDCLASS_TOKEN (_RIF) */
250 struct fddi_Packet fddi; /* _pktdevclass = PDCLASS_FDDI */
251 struct arcnet_Packet arc; /* _pktdevclass = PDCLASS_ARCNET */
252 struct ip_Packet ip; /* _pktdevclass = PDCLASS_PPP/PDCLASS_SLIP */
253 struct pppoe_Packet pppoe; /* _pktdevclass = PDCLASS_ETHER */
254 struct ax25_Packet ax25; /* _pktdevclass = PDCLASS_AX25; untested */
255 struct vlan_Packet vlan; /* not supported */
256 } link_Packet;
257
258
259#include <sys/pack_off.h> /* restore default packing */
260
261W32_CLANG_PACK_WARN_DEF()
262
263struct _eth_last_info {
264 struct {
265 unsigned size; /* frame-size of last Rx */
266 struct ulong_long tstamp; /* timestamp of last Tx */
267 } tx;
268 struct {
269 unsigned size; /* frame-size of last Rx */
270 struct ulong_long tstamp; /* timestamp of last Rx 1st upcall */
271 } rx;
272 };
273
274extern struct _eth_last_info _eth_last;
275
276extern BOOL _ip_recursion, _eth_is_init;
277extern BOOL _eth_ndis3pkt, _eth_winpcap, _eth_win10pcap, _eth_SwsVpkt, _eth_wanpacket;
278extern BYTE _eth_mac_len;
279extern const char *_eth_not_init;
280
281extern mac_address _eth_addr; /* Current MAC-address (not AX-25) */
282extern mac_address _eth_real_addr; /* MAC-addr before _eth_set_addr() */
283extern mac_address _eth_loop_addr; /* CF:00:00:00:00:00 */
284extern mac_address _eth_brdcast; /* FF:FF:FF:FF:FF:FF */
285
286#if defined(USE_MULTICAST)
287 #include "pcigmp.h"
288
289 BOOL _eth_join_mcast_group (const struct MultiCast *mc);
290 BOOL _eth_leave_mcast_group (const struct MultiCast *mc);
291#endif
292
293/*
294 * Return pointer to hardware source address of
295 * an IP packet. For Ethernet:
296 *
297 * struct eth_Packet {
298 * BYTE dest [6]; <- -14
299 * BYTE src [6]; <- -8
300 * WORD type;
301 * BYTE data [1500]; <- ip
302 * };
303 *
304 * For Token-Ring:
305 * struct tok_Packet {
306 * BYTE AC, FC; <- -22
307 * BYTE dest [6];
308 * BYTE src [6]; <- -14
309 * BYTE DSAP, SSAP, ctrl;
310 * BYTE org [3];
311 * WORD type;
312 * BYTE data [1500]; <- ip
313 *
314 * These macros and functions should never be called for serial protocols
315 * except that it doesn't hurt to use MAC_SRC() for all driver classes.
316 */
317
318#if defined(NOT_USED)
319 /* Slower, but safer method. The ATTR_NORETURN() is for the cases
320 * where these used functions are used wrongly. In which case we exit().
321 */
322 extern void *_eth_mac_hdr (const in_Header *ip) ATTR_NORETURN();
323 extern void *_eth_mac_dst (const in_Header *ip) ATTR_NORETURN();
324 extern void *_eth_mac_src (const in_Header *ip) ATTR_NORETURN();
325 extern WORD _eth_mac_typ (const in_Header *ip) ATTR_NORETURN();
326
327 #define MAC_HDR(ip) _eth_mac_hdr(ip)
328 #define MAC_DST(ip) _eth_mac_dst(ip)
329 #define MAC_SRC(ip) _eth_mac_src(ip)
330 #define MAC_TYP(ip) _eth_mac_typ(ip)
331#else
332 #define MAC_HDR(ip) (void*) ((BYTE*)(ip) - _pkt_ip_ofs)
333
334 #define MAC_DST(ip) (void*) ((BYTE*)(ip) - \
335 (_pktdevclass == PDCLASS_TOKEN ? _pkt_ip_ofs-2 : \
336 _pktdevclass == PDCLASS_ARCNET ? _pkt_ip_ofs-1 : \
337 _pktdevclass == PDCLASS_FDDI ? _pkt_ip_ofs-5 : \
338 _pkt_ip_ofs))
339
340 #define MAC_SRC(ip) (void*) ((BYTE*)(ip) - \
341 (_pktdevclass == PDCLASS_TOKEN ? _pkt_ip_ofs-8 : \
342 _pktdevclass == PDCLASS_ARCNET ? _pkt_ip_ofs : \
343 _pktdevclass == PDCLASS_FDDI ? _pkt_ip_ofs-7 : \
344 _pkt_ip_ofs-6))
345
346 #define MAC_TYP(ip) (*(WORD*) ((BYTE*)(ip) - \
347 (_pktdevclass == PDCLASS_ARCNET ? _pkt_ip_ofs-2 : 2)))
348#endif
349
350/*
351 * Macros to set or clear peer's source MAC-address stored in
352 * the _udp_Socket / _tcp_Socket.
353 * Only used on passive (listening) udp/tcp sockets.
354 * We don't use arp_resolve() because of reentrancy problems.
355 * But if inbound packets come from a different gateway than
356 * outbound packets, then we're toast..
357 */
358#define SET_PEER_MAC_ADDR(tcb,ip) do { \
359 if (!_pktserial) \
360 memcpy (&(tcb)->his_ethaddr[0], MAC_SRC(ip), 6); \
361 } while (0)
362
363#define CLR_PEER_MAC_ADDR(tcb) do { \
364 if (!_pktserial) \
365 memset (&(tcb)->his_ethaddr[0], 0, 6); \
366 } while (0)
367
368#endif
pack_off.h
pcigmp.h
_eth_is_init
BOOL _eth_is_init
we are initialised
Definition: pcsed.c:54
_eth_win10pcap
BOOL _eth_win10pcap
for Win32 using an Win10Pcap adapter
Definition: pcsed.c:59
_eth_wanpacket
BOOL _eth_wanpacket
for Win32 using an WanPacket adapter
Definition: pcsed.c:58
_eth_winpcap
BOOL _eth_winpcap
for Win32 using an WinPcap or NPcap adapter (default)
Definition: pcsed.c:60
_eth_SwsVpkt
BOOL _eth_SwsVpkt
for DOS and Win32 programs
Definition: pcsed.c:57
_eth_join_mcast_group
BOOL _eth_join_mcast_group(const struct MultiCast *mc)
Joins a multicast group (at the physical layer).
Definition: pcsed.c:1204
_eth_last
struct _eth_last_info _eth_last
Sizes and timestamps of last packet recv/sent.
Definition: pcsed.c:67
_eth_leave_mcast_group
BOOL _eth_leave_mcast_group(const struct MultiCast *mc)
Leaves a multicast group (at the physical layer)
Definition: pcsed.c:1278
_eth_ndis3pkt
BOOL _eth_ndis3pkt
for DOS-programs only
Definition: pcsed.c:56
_eth_mac_dst
void * _eth_mac_dst(const in_Header *ip) ATTR_NORETURN()
Return pointer to MAC destination address of an IP packet.
Definition: pcsed.c:1113
_eth_mac_src
void * _eth_mac_src(const in_Header *ip) ATTR_NORETURN()
Return pointer to MAC source address of an IP packet.
Definition: pcsed.c:1140
_eth_loop_addr
mac_address _eth_loop_addr
Link-layer loopback address.
Definition: pcsed.c:51
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
_eth_mac_typ
WORD _eth_mac_typ(const in_Header *ip) ATTR_NORETURN()
Return value of protocol-type given an IP packet.
Definition: pcsed.c:1167
_eth_mac_hdr
void * _eth_mac_hdr(const in_Header *ip) ATTR_NORETURN()
Return pointer to MAC header start address of an IP packet.
Definition: pcsed.c:1099
_ip_recursion
BOOL _ip_recursion
avoid recursion in arp_resolve()
Definition: pcsed.c:55
_eth_mac_len
BYTE _eth_mac_len
Size of a MAC address.
Definition: pcsed.c:53
_eth_brdcast
mac_address _eth_brdcast
Link-layer broadcast address.
Definition: pcsed.c:50
_eth_real_addr
mac_address _eth_real_addr
Our real MAC address.
Definition: pcsed.c:52
MultiCast
Multicast internal structure.
Definition: pcigmp.h:104
arcnet_Header
Definition: pcsed.h:180
arcnet_Packet
Definition: pcsed.h:201
ax25_Header
Definition: pcsed.h:214
ax25_Packet
Definition: pcsed.h:220
code
Definition: zinftree.h:24
eth_Header
Definition: pcsed.h:20
eth_Packet
Definition: pcsed.h:38
fddi_Header
Definition: pcsed.h:149
fddi_Packet
Definition: pcsed.h:164
in_Header
Definition: wattcp.h:329
ip_Packet
Definition: wattcp.h:396
llc_Header
Definition: pcsed.h:107
llc_Packet
Definition: pcsed.h:129
pppoe_Header
Definition: pcsed.h:229
pppoe_Packet
Definition: pcsed.h:237
tok_Header
Definition: pcsed.h:70
tok_Packet
Definition: pcsed.h:98
tok
Definition: oui-generated.c:13
ulong_long
Definition: wattcp.h:90
vlan_Header
Definition: pcsed.h:48
vlan_Packet
Definition: pcsed.h:60
link_Packet
Definition: pcsed.h:247


Watt-32 tcp/ip: E:/WATT/src/pcslip.h Source File

  • src
pcslip.h
Go to the documentation of this file.
1
4#ifndef _w32_PCSLIP_H
5#define _w32_PCSLIP_H
6
7extern int slip_init (void);
8
9#endif


Watt-32 tcp/ip: E:/WATT/src/pcstat.c Source File

  • src
pcstat.c
Go to the documentation of this file.
1
5/* Update and printing of MAC/IP/ICMP/IGMP/UDP/TCP input/output
6 * statistics counters.
7 *
8 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Gisle Vanem
21 * Bergen, Norway.
22 *
23 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 * G. Vanem <gvanem@yahoo.no> 1997
35 */
36
37#include <stdio.h>
38#include <string.h>
39#include <netinet/in.h>
40#include <net/ppp_defs.h>
41#include <arpa/inet.h>
42
43#include "wattcp.h"
44#include "sock_ini.h"
45#include "pcconfig.h"
46#include "pcicmp.h"
47#include "pcqueue.h"
48#include "pcsed.h"
49#include "split.h"
50#include "misc.h"
51#include "misc_str.h"
52#include "timer.h"
53#include "pcpkt.h"
54#include "pcdbug.h"
55#include "pppoe.h"
56#include "pcstat.h"
57
58int W32_CALL sock_stats (sock_type *sock, DWORD *days, WORD *inactive,
59 WORD *cwindow, DWORD *avg, DWORD *sd)
60{
61 _tcp_Socket *s = &sock->tcp;
62
63 if (s->ip_type != TCP_PROTO)
64 return (0);
65
66 if (days) *days = get_day_num() - start_day;
67 if (inactive) *inactive = sock_inactive;
68#if defined(USE_UDP_ONLY)
69 if (cwindow) *cwindow = 0;
70 if (avg) *avg = 0;
71 if (sd) *sd = 0;
72#else
73 if (cwindow) *cwindow = s->cwindow;
74 if (avg) *avg = s->vj_sa >> 3;
75 if (sd) *sd = s->vj_sd >> 2;
76#endif
77 return (1);
78}
79
80#if !defined(USE_STATISTICS)
81 void print_mac_stats (void) {}
82 void print_vjc_stats (void) {}
83 void print_pkt_stats (void) {}
84 void print_ip4_stats (void) {}
85 void print_ip6_stats (void) {}
86 void print_icmp_stats(void) {}
87 void print_icmp6_stats(void) {}
88 void print_igmp_stats(void) {}
89 void print_udp_stats (void) {}
90 void print_tcp_stats (void) {}
91 void print_cache_stats(void) {}
92 void print_all_stats (void) {}
93 void reset_stats (void) {}
94
95#else /* rest of file */
96
97struct macstat macstats;
98struct ipstat ip4stats;
99struct ip6stat ip6stats;
100struct udpstat udpstats;
101struct icmpstat icmpstats;
102struct icmp6stat icmp6stats;
103struct igmpstat igmpstats;
104struct pppoestat pppoestats;
105struct cache_stat cache_stats;
106
107#if !defined(USE_UDP_ONLY)
108struct tcpstat tcpstats;
109#endif
110
111void W32_CALL reset_stats (void)
112{
113 memset (&macstats, 0, sizeof(macstats));
114 memset (&ip4stats, 0, sizeof(ip4stats));
115 memset (&ip6stats, 0, sizeof(ip6stats));
116 memset (&udpstats, 0, sizeof(udpstats));
117 memset (&icmpstats, 0, sizeof(icmpstats));
118 memset (&igmpstats, 0, sizeof(igmpstats));
119 memset (&pppoestats, 0, sizeof(pppoestats));
120 memset (&cache_stats,0, sizeof(cache_stats));
121#if !defined(USE_UDP_ONLY)
122 memset (&tcpstats, 0, sizeof(tcpstats));
123#endif
124}
125
126static __inline void show_stat (const char *name, DWORD num)
127{
128 if (num)
129 (*_printf) (" %-13s %10lu\n", name, (u_long)num);
130}
131
132#if defined(HAVE_UINT64) && defined(USE_IPV6)
133static __inline void show_stat64 (const char *name, uint64 num)
134{
135 if (num)
136 (*_printf) (" %-13s %10" U64_FMT "\n", name, num);
137}
138#endif
139
140void W32_CALL print_cache_stats (void)
141{
142 (*_printf) ("Cache stats:\n"
143 " ARP-cache: hits %lu, misses %lu\n"
144 " Route-cache: hits %lu, misses %lu\n\n",
145 (u_long)cache_stats.num_arp_hits, (u_long)cache_stats.num_arp_misses,
146 (u_long)cache_stats.num_route_hits, (u_long)cache_stats.num_route_misses);
147}
148
149void W32_CALL print_mac_stats (void)
150{
151 (*_printf) ("MAC input stats:\n"
152 " dropped %lu, waiting %d, looped %lu, non-IP recv %lu sent %lu\n"
153 " unknown types, %lu, LLC frames %lu, IP-recursions %lu",
154 (u_long)pkt_dropped(), pkt_waiting(), (u_long)macstats.num_mac_loop,
155 (u_long)macstats.non_ip_recv, (u_long)macstats.non_ip_sent,
156 (u_long)macstats.num_unk_type, (u_long)macstats.num_llc_frames,
157 (u_long)macstats.num_ip_recurse);
158
159#if defined(USE_FAST_PKT) || defined(WIN32)
160 (*_printf) (" \n wrong handle %lu, bad-sync %lu, too large %lu, too small %lu",
161 (u_long)macstats.num_wrong_handle, (u_long)macstats.num_bad_sync,
162 (u_long)macstats.num_too_large, (u_long)macstats.num_too_small);
163#endif
164
165 (*_printf) (" \nMAC output stats:\n"
166 " Tx errors %10lu %s\n"
167 " Tx retries %10lu\n"
168 " Tx timeout %10lu\n",
169 (u_long)macstats.num_tx_err, macstats.num_tx_err ? "****" : "",
170 (u_long)macstats.num_tx_retry, (u_long)macstats.num_tx_timeout);
171}
172
173void W32_CALL print_arp_stats (void)
174{
175 (*_printf) ("ARP Requests: %10lu recv\n"
176 " Requests: %10lu sent\n"
177 " Replies: %10lu recv\n"
178 " Replies: %10lu sent\n",
179 (u_long)macstats.arp.request_recv, (u_long)macstats.arp.request_sent,
180 (u_long)macstats.arp.reply_recv, (u_long)macstats.arp.reply_sent);
181}
182
183void W32_CALL print_rarp_stats (void)
184{
185#if defined(USE_RARP)
186 DWORD total = macstats.rarp.request_recv +
187 macstats.rarp.request_sent +
188 macstats.rarp.reply_recv +
189 macstats.rarp.reply_sent;
190
191 if (total > 0)
192 (*_printf) ("RARP Requests: %10lu recv\n"
193 " Requests: %10lu sent\n"
194 " Replies: %10lu recv\n"
195 " Replies: %10lu sent\n",
196 (u_long)macstats.rarp.request_recv, (u_long)macstats.rarp.request_sent,
197 (u_long)macstats.rarp.reply_recv, (u_long)macstats.rarp.reply_sent);
198#endif
199}
200
201void W32_CALL print_vjc_stats (void)
202{
203#if defined(__MSDOS__)
204 struct slcompress vjc;
205
206 if (stricmp(_pktdrvrname,"PPPD220F") && /* not using DOSPPP driver */
207 stricmp(_pktdrvrname,"LADSoftPPP$")) /* or LadSoft's lsppp */
208 return;
209
210 (*_printf) ("VJ compression:\n");
211
212 if (!pkt_get_vjstats(&vjc))
213 {
214 (*_printf) (" not available\n\n");
215 return;
216 }
217
218 (*_printf) (" Tx TCP packets: %lu, non-TCP: %lu\n",
219 (u_long)vjc.sls_o_tcp, (u_long)vjc.sls_o_nontcp);
220
221 (*_printf) (" Rx error packets: %lu, tossed: %lu\n",
222 (u_long)vjc.sls_i_error, (u_long)vjc.sls_i_tossed);
223
224 (*_printf) (" Rx runt packets: %lu, bad checksum: %lu\n",
225 (u_long)vjc.sls_i_runt, (u_long)vjc.sls_i_badcheck);
226
227 (*_printf) (" connection state searches: %lu, misses: %lu\n",
228 (u_long)vjc.sls_o_searches, (u_long)vjc.sls_o_misses);
229
230 (*_printf) (" oldest xmit in ring: %-9u\n", vjc.xmit_oldest);
231 (*_printf) (" compression state flags: 0x%X\n", vjc.flags);
232
233 (*_printf) (" highest slot: Tx %-5u Rx %u\n",
234 vjc.tslot_limit, vjc.rslot_limit);
235
236 (*_printf) (" most recent id: Tx %-5u Rx %u\n",
237 vjc.xmit_current, vjc.recv_current);
238
239 (*_printf) (" uncompressed packets: Tx %-5lu Rx %lu\n",
240 (u_long)vjc.sls_o_uncompressed, (u_long)vjc.sls_i_uncompressed);
241
242 (*_printf) (" compressed packets: Tx %-5lu Rx %lu\n",
243 (u_long)vjc.sls_o_compressed, (u_long)vjc.sls_i_compressed);
244
245 if (!stricmp(_pktdrvrname,"PPPD220F")) /* using DOSPPP driver */
246 {
247 struct cstate cstate;
248 WORD cs_ofs, rx_num = 0, tx_num = 0;
249
250 (*_printf) (" Connection states:\n");
251
252 for (cs_ofs = vjc.cstate_ptr_tstate;
253 pkt_get_cstate(&cstate,cs_ofs) && tx_num < vjc.tslot_limit;
254 cs_ofs = cstate.cs_next, tx_num++)
255 (*_printf) (" Tx-id %2d: IP %15s -> %15s, TCP port %u -> %d\n",
256 cstate.cs_this,
257 inet_ntoa(*(struct in_addr*)&cstate.cs_ip.source),
258 inet_ntoa(*(struct in_addr*)&cstate.cs_ip.destination),
259 intel16(cstate.cs_tcp.srcPort),
260 intel16(cstate.cs_tcp.dstPort));
261
262 for (cs_ofs = vjc.cstate_ptr_rstate;
263 pkt_get_cstate(&cstate,cs_ofs) && rx_num < vjc.rslot_limit;
264 cs_ofs = cstate.cs_next, rx_num++)
265 (*_printf) (" Rx-id %2d: IP %15s -> %15s, TCP port %u -> %d\n",
266 cstate.cs_this,
267 inet_ntoa(*(struct in_addr*)&cstate.cs_ip.source),
268 inet_ntoa(*(struct in_addr*)&cstate.cs_ip.destination),
269 intel16(cstate.cs_tcp.srcPort),
270 intel16(cstate.cs_tcp.dstPort));
271 if (rx_num + tx_num == 0)
272 (*_printf) (" not available\n");
273 }
274 (*_printf) (" \n");
275#endif /* __MSDOS__ */
276}
277
278void W32_CALL print_pkt_stats (void)
279{
280 struct PktStats stat, total;
281 char tot_rx [15] = " ?";
282 char tot_tx [15] = " ?";
283
284 (*_printf) ("Driver statistics:\n");
285 if (!pkt_get_stats(&stat,&total))
286 {
287 (*_printf) (" Not available\n\n");
288 return;
289 }
290
291 /*
292 * The total.in_bytes and total.out_bytes (since boot) are only
293 * available for DOS packet-drivers. Win32 drivers count only total
294 * packets since driver was started. Print a '? for Win32.
295 */
296#if defined(__MSDOS__)
297 sprintf (tot_rx, "%10lu", total.in_bytes);
298 sprintf (tot_tx, "%10lu", total.out_bytes);
299#endif
300
301 (*_printf) (" Rx: %9lu pkt, %10lu bytes, %6lu errors, %6lu lost (this session)\n",
302 (u_long)stat.in_packets, (u_long)stat.in_bytes, (u_long)stat.in_errors, (u_long)stat.lost);
303 (*_printf) (" Tx: %9lu pkt, %10lu bytes, %6lu errors\n",
304 (u_long)stat.out_packets, (u_long)stat.out_bytes, (u_long)stat.out_errors);
305
306 (*_printf) (" Rx: %9lu pkt, %s bytes, %6lu errors, %6lu lost (since boot)\n",
307 (u_long)total.in_packets, tot_rx, (u_long)total.in_errors, (u_long)total.lost);
308 (*_printf) (" Tx: %9lu pkt, %s bytes, %6lu errors\n\n",
309 (u_long)total.out_packets, tot_tx, (u_long)total.out_errors);
310}
311
312void W32_CALL print_pppoe_stats (void)
313{
314#if defined(USE_PPPOE)
315 (*_printf) ("PPPoE stats:\n");
316 show_stat ("Tx Discovery:", pppoestats.num_disc_sent);
317 show_stat ("Rx Discovery:", pppoestats.num_disc_recv);
318 show_stat ("Tx Session:", pppoestats.num_sess_sent);
319 show_stat ("Rx Session:", pppoestats.num_sess_recv);
320#endif
321}
322
323void W32_CALL print_ip4_stats (void)
324{
325 (*_printf) ("IP4 input stats:\n");
326 show_stat ("total:", ip4stats.ips_total);
327 show_stat ("badsum:", ip4stats.ips_badsum);
328 show_stat ("badver:", ip4stats.ips_badvers);
329 show_stat ("short:", ip4stats.ips_tooshort);
330 show_stat ("frags:", ip4stats.ips_fragments);
331 show_stat ("fragdrop:", ip4stats.ips_fragdropped);
332 show_stat ("fragtimeout:",ip4stats.ips_fragtimeout);
333 show_stat ("reassemble:", ip4stats.ips_reassembled);
334 show_stat ("noproto:", ip4stats.ips_noproto);
335 show_stat ("delivered:", ip4stats.ips_delivered);
336 show_stat ("badoptions:", ip4stats.ips_badoptions);
337 show_stat ("dropped:", ip4stats.ips_idropped);
338
339 (*_printf) ("IP4 output stats:\n");
340 show_stat ("total:", ip4stats.ips_rawout);
341 show_stat ("noroute:", ip4stats.ips_noroute);
342 show_stat ("frags:", ip4stats.ips_ofragments);
343 show_stat ("dropped:", ip4stats.ips_odropped);
344}
345
346void W32_CALL print_ip6_stats (void)
347{
348#if defined(HAVE_UINT64) && defined(USE_IPV6)
349 (*_printf) ("IP6 input stats:\n");
350 show_stat64 ("total:", ip6stats.ip6s_total);
351 show_stat64 ("badver:", ip6stats.ip6s_badvers);
352 show_stat64 ("short:", ip6stats.ip6s_tooshort);
353 show_stat64 ("frags:", ip6stats.ip6s_fragments);
354 show_stat64 ("fragdrop:", ip6stats.ip6s_fragdropped);
355 show_stat64 ("fragtime:", ip6stats.ip6s_fragtimeout);
356 show_stat64 ("reassemble:",ip6stats.ip6s_reassembled);
357 show_stat64 ("delivered:", ip6stats.ip6s_delivered);
358 show_stat64 ("badoptions:",ip6stats.ip6s_badoptions);
359
360 (*_printf) ("IP6 output stats:\n");
361 show_stat64 ("total:", ip6stats.ip6s_rawout);
362 show_stat64 ("noroute:", ip6stats.ip6s_noroute);
363 show_stat64 ("frags:", ip6stats.ip6s_ofragments);
364 show_stat64 ("dropped:", ip6stats.ip6s_odropped);
365#endif
366}
367
368void W32_CALL print_icmp6_stats (void)
369{
370#if defined(HAVE_UINT64) && defined(USE_IPV6)
371 uint64 total_in = 0;
372 uint64 total_out = 0;
373 int i;
374
375 (*_printf) ("ICMP6 input stats:\n");
376
377 for (i = 0; i < DIM(icmp6stats.icp6s_inhist); i++)
378 total_in += icmp6stats.icp6s_inhist[i];
379
380 show_stat64 ("total:", total_in);
381 show_stat64 ("badsum:", icmp6stats.icp6s_checksum);
382 show_stat64 ("short:", icmp6stats.icp6s_tooshort);
383 show_stat64 ("badcode:", icmp6stats.icp6s_badcode);
384
385 (*_printf) ("ICMP6 output stats:\n");
386 for (i = 0; i < DIM(icmp6stats.icp6s_outhist); i++)
387 total_out += icmp6stats.icp6s_outhist[i];
388
389 show_stat64 ("total:", total_out);
390 show_stat64 ("too big:", icmp6stats.icp6s_opacket_too_big);
391 show_stat64 ("exceed xmit:", icmp6stats.icp6s_otime_exceed_transit);
392 show_stat64 ("exceed reasm:",icmp6stats.icp6s_otime_exceed_reassembly);
393#endif
394}
395
396void W32_CALL print_icmp_stats (void)
397{
398 DWORD total_in = 0;
399 DWORD total_out = 0;
400 int i;
401 static const char *types[ICMP_MAXTYPE+1] = {
402 "echoreply:",
403 "1?:",
404 "2?:",
405 "unreach:",
406 "srcquench:",
407 "redirect:",
408 "6?:",
409 "7?:",
410 "echorequest:",
411 "router adv:",
412 "router sol:",
413 "timex:",
414 "parm prob:",
415 "tstamp req:",
416 "tstamp rep:",
417 "info req:",
418 "info rep:",
419 "mask req:",
420 "mask rep:"
421 };
422
423 (*_printf) ("ICMP input stats:\n");
424 for (i = 0; i < ICMP_MAXTYPE; i++)
425 total_in += icmpstats.icps_inhist[i];
426 show_stat ("total:", total_in);
427
428 show_stat ("badsum:", icmpstats.icps_checksum);
429 show_stat ("badcode:",icmpstats.icps_badcode);
430 show_stat ("short:", icmpstats.icps_tooshort);
431
432 for (i = 0; i < ICMP_MAXTYPE; i++)
433 show_stat (types[i], icmpstats.icps_inhist[i]);
434
435 (*_printf) ("ICMP output stats:\n");
436 for (i = 0; i < ICMP_MAXTYPE; i++)
437 total_out += icmpstats.icps_outhist[i];
438 show_stat ("total:", total_out);
439
440 for (i = 0; i < ICMP_MAXTYPE; i++)
441 show_stat (types[i], icmpstats.icps_outhist[i]);
442}
443
444void W32_CALL print_igmp_stats (void)
445{
446#if defined(USE_MULTICAST)
447 (*_printf) ("IGMP input stats:\n");
448 show_stat ("total:", igmpstats.igps_rcv_total);
449 show_stat ("badsum:", igmpstats.igps_rcv_badsum);
450 show_stat ("short:", igmpstats.igps_rcv_tooshort);
451 show_stat ("queries:", igmpstats.igps_rcv_queries);
452 show_stat ("queries (bad):",igmpstats.igps_rcv_badqueries);
453 show_stat ("reports:", igmpstats.igps_rcv_reports);
454 show_stat (" bad:", igmpstats.igps_rcv_badreports);
455 show_stat (" group:", igmpstats.igps_rcv_ourreports);
456
457 (*_printf) ("IGMP output stats:\n");
458 show_stat ("reports:", igmpstats.igps_snd_reports);
459#endif
460}
461
462void W32_CALL print_udp_stats (void)
463{
464 (*_printf) ("UDP input stats:\n");
465 show_stat ("total:", udpstats.udps_ipackets);
466 show_stat ("drops:", udpstats.udps_hdrops);
467 show_stat ("badsum:", udpstats.udps_badsum);
468 show_stat ("no service:", udpstats.udps_noport);
469 show_stat ("broadcast:", udpstats.udps_noportbcast);
470 show_stat ("queue full:", udpstats.udps_fullsock);
471
472 (*_printf) ("UDP output stats:\n");
473 show_stat ("total:", udpstats.udps_opackets);
474}
475
476void W32_CALL print_tcp_stats (void)
477{
478#if !defined(USE_UDP_ONLY)
479 (*_printf) ("TCP input stats:\n");
480 show_stat ("total:", tcpstats.tcps_rcvtotal);
481 show_stat ("drops:", tcpstats.tcps_drops);
482 show_stat ("badsum:", tcpstats.tcps_rcvbadsum);
483 show_stat ("badhofs:", tcpstats.tcps_rcvbadoff);
484 show_stat ("conn-okay:", tcpstats.tcps_connects);
485 show_stat ("conn-accept:", tcpstats.tcps_accepts);
486 show_stat ("conn-drops:", tcpstats.tcps_conndrops);
487 show_stat ("inS pkts:", tcpstats.tcps_rcvpack);
488 show_stat ("inS bytes:", tcpstats.tcps_rcvbyte);
489 show_stat ("OoO pkts:", tcpstats.tcps_rcvoopack);
490 show_stat ("OoO bytes:", tcpstats.tcps_rcvoobyte);
491 show_stat ("ACK pkts:", tcpstats.tcps_rcvackpack);
492 show_stat ("ACK bytes:", tcpstats.tcps_rcvackbyte);
493 show_stat ("ACK nosent:", tcpstats.tcps_rcvacktoomuch);
494 show_stat ("dup ACK:", tcpstats.tcps_rcvduppack);
495 show_stat ("dup bytes:", tcpstats.tcps_rcvdupbyte);
496 show_stat ("Outside win:", tcpstats.tcps_rcvpackafterwin);
497 show_stat ("pers-drop:", tcpstats.tcps_persistdrop);
498
499 (*_printf) ("TCP output stats:\n");
500 show_stat ("total:", tcpstats.tcps_sndtotal);
501 show_stat ("data pkts:", tcpstats.tcps_sndpack);
502 show_stat ("data bytes:", tcpstats.tcps_sndbyte);
503 show_stat ("conn-attempt:",tcpstats.tcps_connattempt);
504 show_stat ("SYN/FIN/RST:", tcpstats.tcps_sndctrl);
505 show_stat ("close/drops:", tcpstats.tcps_closed);
506 show_stat ("OOB pkts:", tcpstats.tcps_sndurg);
507 show_stat ("ACK pkts:", tcpstats.tcps_sndacks);
508 show_stat ("ACK dly:", tcpstats.tcps_delack);
509 show_stat ("ACK win upd:", tcpstats.tcps_sndwinup);
510 show_stat ("retrans to:", tcpstats.tcps_rexmttimeo);
511 show_stat ("keepalive pr:",tcpstats.tcps_keepprobe);
512 show_stat ("keepalive to:",tcpstats.tcps_keeptimeo);
513 show_stat ("RTTcache add:",tcpstats.tcps_cachedrtt);
514 show_stat ("RTTcache get:",tcpstats.tcps_usedrtt);
515#endif
516}
517
518/* \todo print a nice table of everything. Something like:
519
520 IP4 SENT RECEIVED
521 total
522 badsum
523 tooshort
524 toosmall
525 badhlen
526 badlen
527 fragments
528 fragdropped
529 fragtimeout
530 forward
531 cantforward
532 redirectsent
533 noproto
534 delivered
535 localout
536 odropped
537 idropped
538 reassembled
539 fragmented
540 ofragments
541 cantfrag
542 badoptions
543 noroute
544 badvers
545 rawout
546 toolong
547
548 */
549void W32_CALL print_all_stats (void)
550{
551 int save = ctrace_on;
552
553 ctrace_on = 0;
554
555 (*_printf) ("\n");
556
557 print_cache_stats();
558 print_vjc_stats();
559 print_pkt_stats();
560 print_mac_stats();
561
562 if (!_pktserial)
563 {
564 print_arp_stats();
565 print_rarp_stats();
566 print_pppoe_stats();
567 }
568
569 print_ip4_stats();
570 print_ip6_stats();
571 print_icmp_stats();
572 print_icmp6_stats();
573 print_igmp_stats();
574 print_udp_stats();
575 print_tcp_stats();
576
577 ctrace_on = save;
578}
579
580/*
581 * Called from the link-layer input routine _eth_arrived().
582 */
583void update_in_stat (void)
584{
585 const struct pkt_split *ps;
586 const eth_Header *eth;
587 const tok_Header *tok;
588 const fddi_Header *fddi;
589 const ICMP_PKT *icmp;
590 BOOL got_ip = FALSE;
591 BYTE type;
592
593 for (ps = pkt_get_split_in(); ps->data; ps++)
594 {
595 switch (ps->type)
596 {
597 case TYPE_ETHER_HEAD:
598 eth = (const eth_Header*) ps->data;
599 if (!memcmp(eth->source,_eth_addr,sizeof(_eth_addr)))
600 macstats.num_mac_loop++;
601 break;
602
603 case TYPE_TOKEN_HEAD:
604 tok = (const tok_Header*) ps->data;
605 if (!memcmp(tok->source,_eth_addr,sizeof(_eth_addr)))
606 macstats.num_mac_loop++;
607 break;
608
609 case TYPE_FDDI_HEAD:
610 fddi = (const fddi_Header*) ps->data;
611 if (!memcmp(fddi->source,_eth_addr,sizeof(_eth_addr)))
612 macstats.num_mac_loop++;
613 break;
614
615 case TYPE_LLC_HEAD:
616 macstats.num_llc_frames++;
617 break;
618
619 case TYPE_ARP:
620 {
621 const arp_Header *arp = (const arp_Header*) ps->data;
622
623 if (arp->opcode == ARP_REQUEST)
624 macstats.arp.request_recv++;
625 else if (arp->opcode == ARP_REPLY)
626 macstats.arp.reply_recv++;
627 break;
628 }
629#if defined(USE_RARP)
630 case TYPE_RARP:
631 {
632 const rarp_Header *rarp = (const rarp_Header*) ps->data;
633
634 if (rarp->opcode == RARP_REQUEST)
635 macstats.rarp.request_recv++;
636 else if (rarp->opcode == RARP_REPLY)
637 macstats.rarp.reply_recv++;
638 break;
639 }
640#endif
641
642#if defined(USE_PPPOE)
643 case TYPE_PPPOE_DISC:
644 pppoestats.num_disc_recv++;
645 break;
646
647 case TYPE_PPPOE_SESS:
648 pppoestats.num_sess_recv++;
649 break;
650
651 case TYPE_PPP_LCP:
652 case TYPE_PPP_IPCP:
654 break;
655#endif
656
657#if defined(USE_IPV6)
658 case TYPE_IP6:
659 ip6stats.ip6s_total++;
660 got_ip = TRUE;
661 break;
662
663 case TYPE_IP6_HOP:
664 case TYPE_IP6_IPV6:
665 case TYPE_IP6_ROUTING:
666 case TYPE_IP6_FRAGMENT:
667 case TYPE_IP6_ESP:
668 case TYPE_IP6_AUTH:
669 case TYPE_IP6_ICMP:
670 case TYPE_IP6_DEST:
672 break;
673 case TYPE_IP6_NONE:
674 case TYPE_IP6_UNSUPP:
675 break; /* ignore */
676#endif
677
678 case TYPE_IP4:
679 ip4stats.ips_total++;
680 got_ip = TRUE;
681 break;
682
683 case TYPE_IP4_FRAG:
684 got_ip = TRUE;
685 case TYPE_IP4_OPTIONS:
686 break;
687
688 case TYPE_ICMP:
689 icmp = (const ICMP_PKT*) ps->data;
690 type = icmp->unused.type;
691 if (type <= ICMP_MAXTYPE)
692 icmpstats.icps_inhist[(int)type]++;
693 return;
694
695 case TYPE_IGMP:
696 igmpstats.igps_rcv_total++;
697 return;
698
699 case TYPE_UDP_HEAD:
700 udpstats.udps_ipackets++;
701 return;
702
703#if !defined(USE_UDP_ONLY)
704 case TYPE_TCP_HEAD:
705 tcpstats.tcps_rcvtotal++;
706 return;
707#endif
708
709 default:
710#if defined(USE_DEBUG)
711 dbug_printf ("Unknown split-type %d\n", ps->type);
712#endif
713 macstats.num_unk_type++;
714 break;
715 }
716 }
717 if (!got_ip)
718 macstats.non_ip_recv++;
719}
720
721/*
722 * Called from the link-layer output routine _eth_send().
723 */
724void update_out_stat (void)
725{
726 const struct pkt_split *ps;
727 const arp_Header *arp;
728 const in_Header *ip;
729 const ICMP_PKT *icmp;
730 BOOL got_ip = FALSE;
731 BYTE type;
732 DWORD ofs;
733
734 for (ps = pkt_get_split_out(); ps->data; ps++)
735 {
736 switch (ps->type)
737 {
738 case TYPE_ARP:
739 arp = (arp_Header*) ps->data;
740 if (arp->opcode == ARP_REQUEST)
741 macstats.arp.request_sent++;
742 else if (arp->opcode == ARP_REPLY)
743 macstats.arp.reply_sent++;
744 break;
745
746#if defined(USE_RARP)
747 case TYPE_RARP:
748 {
749 const rarp_Header *rarp = (rarp_Header*) ps->data;
750
751 if (rarp->opcode == RARP_REQUEST)
752 macstats.rarp.request_sent++;
753 else if (rarp->opcode == RARP_REPLY)
754 macstats.rarp.reply_sent++;
755 }
756 break;
757#endif
758
759#if defined(USE_PPPOE)
760 case TYPE_PPPOE_DISC:
761 pppoestats.num_disc_sent++;
762 break;
763
764 case TYPE_PPPOE_SESS:
765 pppoestats.num_sess_sent++;
766
767 case TYPE_PPP_LCP:
768 case TYPE_PPP_IPCP:
770 break;
771#endif
772
773#if defined(USE_IPV6)
774 case TYPE_IP6:
775 got_ip = TRUE;
776 ip6stats.ip6s_rawout++;
777 break;
778
779 case TYPE_IP6_HOP:
780 case TYPE_IP6_IPV6:
781 case TYPE_IP6_ROUTING:
782 case TYPE_IP6_FRAGMENT:
783 case TYPE_IP6_ESP:
784 case TYPE_IP6_AUTH:
785 case TYPE_IP6_ICMP:
786 case TYPE_IP6_DEST:
788 break;
789#endif
790
791 case TYPE_IP4:
792 got_ip = TRUE;
793 ip = (const struct in_Header*) ps->data;
794 ip4stats.ips_rawout++; /* count raw IP (fragmented or not) */
795
796 ofs = intel16 (ip->frag_ofs);
797 ofs = (ofs & IP_OFFMASK) << 3;
798 if (ofs)
799 return; /* only fragments with ofs 0 (already counted) */
800 break;
801
802 case TYPE_ICMP:
803 icmp = (const ICMP_PKT*) ps->data;
804 type = icmp->unused.type;
805 if (type <= ICMP_MAXTYPE)
806 icmpstats.icps_outhist[(int)type]++;
807 return;
808
809#if defined(USE_MULTICAST)
810 case TYPE_IGMP:
811 {
812 const IGMPv1_packet *igmp = (const IGMPv1_packet*) ps->data;
813
814 if (igmp->version == 1 && igmp->type == IGMPv1_REPORT)
815 igmpstats.igps_snd_reports++;
816 return;
817 }
818#endif
819
820 case TYPE_UDP_HEAD:
821 udpstats.udps_opackets++;
822 return;
823
824#if !defined(USE_UDP_ONLY)
825 case TYPE_TCP_HEAD:
826 {
827 const tcp_Header *tcp = (const tcp_Header*) ps->data;
828 BYTE flags;
829
830 flags = tcp->flags & tcp_FlagMASK;
831 tcpstats.tcps_sndtotal++;
832
833 if (flags & (tcp_FlagSYN|tcp_FlagFIN|tcp_FlagRST))
834 tcpstats.tcps_sndctrl++;
835 else if (flags & tcp_FlagACK) /* ACK only flag */
836 tcpstats.tcps_sndacks++;
837 if (flags & tcp_FlagURG)
838 tcpstats.tcps_sndurg++;
839 if (flags & (tcp_FlagFIN|tcp_FlagRST))
840 tcpstats.tcps_closed++;
841 }
842 break;
843
844 case TYPE_TCP_DATA:
845 if (ps->len > 0)
846 {
847 tcpstats.tcps_sndpack++;
848 tcpstats.tcps_sndbyte += ps->len;
849 }
850 return; /* nothing behind this */
851#endif
852
853 default: ; /* squelch gcc warning */
854 }
855 }
856
857 if (!got_ip)
858 macstats.non_ip_sent++;
859}
860#endif /* USE_STATISTICS */
861
in.h
inet.h
get_day_num
DWORD get_day_num(void)
Simplified method of getting days since 1970-01-01.
Definition: misc.c:222
misc.h
misc_str.h
pcconfig.h
pcdbug.h
pcicmp.h
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
pkt_dropped
DWORD pkt_dropped(void)
Return number of packets dropped.
Definition: pcpkt.c:1391
pkt_get_stats
int pkt_get_stats(struct PktStats *stats, struct PktStats *total)
Get PKTDRVR statistics.
Definition: pcpkt.c:1240
pkt_waiting
int pkt_waiting(void)
Return number of packets waiting in queue.
Definition: pcpkt.c:1375
pcpkt.h
pcqueue.h
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
pcsed.h
update_out_stat
void update_out_stat(void)
Definition: pcstat.c:724
update_in_stat
void update_in_stat(void)
Definition: pcstat.c:583
pcstat.h
ppp_defs.h
pppoe.h
sock_ini.h
split.h
IGMPv1_packet
Definition: pcigmp.h:23
PktStats
Definition: tcp.h:806
arp_Header
Definition: wattcp.h:476
arp
cache_stat
Definition: pcstat.h:83
cstate
Definition: pcpkt.h:135
eth_Header
Definition: pcsed.h:20
fddi_Header
Definition: pcsed.h:149
icmp6stat
Definition: icmp6.h:563
icmp
Definition: ip_icmp.h:66
icmpstat
Definition: icmp_var.h:51
igmpstat
Definition: igmp_var.h:56
in_Header
Definition: wattcp.h:329
in_addr
Definition: in.h:143
ip6stat
Definition: ip6_var.h:174
ipstat
Definition: ip_var.h:134
ipstat::ips_reassembled
u_long ips_reassembled
Definition: ip_var.h:152
macstat
Definition: pcstat.h:36
pkt_split
Definition: split.h:46
pppoestat
Definition: pcstat.h:72
rarp
slcompress
Definition: pcpkt.h:148
tcp_Header
Definition: wattcp.h:418
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::vj_sa
DWORD vj_sa
VJ's alg, standard average (SRTT)
Definition: wattcp.h:615
tcp_Socket::cwindow
BYTE cwindow
Congestion window.
Definition: wattcp.h:611
tcp_Socket::vj_sd
DWORD vj_sd
VJ's alg, standard deviation (RTTVAR)
Definition: wattcp.h:616
tcpstat
Definition: tcp_var.h:305
tok_Header
Definition: pcsed.h:70
tok
Definition: oui-generated.c:13
start_day
DWORD start_day
Start-day of watt_sock_init()
Definition: timer.c:47
timer.h
ICMP_PKT
Definition: pcicmp.h:126
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65


Watt-32 tcp/ip: E:/WATT/src/pcstat.h Source File

  • src
pcstat.h
Go to the documentation of this file.
1
3#ifndef _w32_PCSTAT_H
4#define _w32_PCSTAT_H
5
6#ifndef ICMP_MAXTYPE
7#define ICMP_MAXTYPE 18
8#endif
9
10#include <sys/socket.h>
11#include <net/if.h>
12#include <net/if_dl.h>
13#include <net/if_ether.h>
14#include <net/route.h>
15#include <netinet/in.h>
16#include <netinet/in_systm.h>
17#include <netinet/in_var.h>
18#include <netinet/ip.h>
19#include <netinet/ip_var.h>
20#include <netinet/in_pcb.h>
21#include <netinet/tcp.h>
22#include <netinet/tcp_time.h>
23#include <netinet/tcpip.h>
24#include <netinet/udp.h>
25#include <netinet/udp_var.h>
26#include <netinet/tcp_var.h>
27#include <netinet/icmp_var.h>
28#include <netinet/igmp_var.h>
29#include <netinet/icmp6.h>
30#include <netinet6/ip6_var.h>
31
36struct macstat {
37 DWORD non_ip_recv; /* # of non-IP packets received */
38 DWORD non_ip_sent; /* sent */
39 DWORD num_tx_err; /* # of transmission errors */
40 DWORD num_tx_retry; /* # of transmission retries */
41 DWORD num_tx_timeout; /* # of async transmission timeouts */
42 DWORD num_unk_type; /* # of unhandled types */
43 DWORD num_llc_frames; /* # of LLC frames received */
44 DWORD num_wrong_handle; /* # upcalls with wrong handle */
45 DWORD num_bad_sync; /* # upcalls with different lengths */
46 DWORD num_too_large; /* # upcalls with > ETH_MAX pkts */
47 DWORD num_too_small; /* # upcalls with < ETH_MIN pkts */
48 DWORD num_mac_loop; /* # of pkts looped by NDIS */
49 DWORD num_ip_recurse; /* # of IP-pkts blocked due to recursion */
50
52 struct {
53 DWORD request_recv; /* # of ARP requests received */
54 DWORD request_sent; /* sent */
55 DWORD reply_recv; /* # of ARP replies received */
56 DWORD reply_sent; /* sent */
57 } arp;
58
60 struct {
61 DWORD request_recv; /* # of RARP requests received */
62 DWORD request_sent; /* sent */
63 DWORD reply_recv; /* # of RARP replies received */
64 DWORD reply_sent; /* sent */
65 } rarp;
66 };
67
72struct pppoestat {
73 DWORD num_disc_sent;
74 DWORD num_disc_recv;
75 DWORD num_sess_sent;
76 DWORD num_sess_recv;
77 };
78
83struct cache_stat {
84 DWORD num_arp_search;
85 DWORD num_arp_hits;
86 DWORD num_arp_misses;
87 DWORD num_arp_overflow;
88 DWORD num_route_hits;
89 DWORD num_route_misses;
90 };
91
92/*
93 * IP statistics for all in/out messages, <netinet/ip_var.h>
94 *
95 * ips_total; - total packets received
96 * ips_badsum; - checksum bad
97 * ips_tooshort; - packet too short
98 * ips_toosmall; - not enough data
99 * ips_badhlen; - ip header length < data size
100 * ips_badlen; - ip length < ip header length
101 * ips_fragments; - fragments received
102 * ips_fragdropped; - frags dropped (dups, out of space)
103 * ips_fragtimeout; - fragments timed out
104 * ips_forward; - packets forwarded
105 * ips_cantforward; - packets rcvd for unreachable dest
106 * ips_redirectsent; - packets forwarded on same net
107 * ips_noproto; - unknown or unsupported protocol
108 * ips_delivered; - datagrams delivered to upper level
109 * ips_localout; - total ip packets generated here
110 * ips_odropped; - lost out packets due to nobufs, etc.
111 * ips_idropped; - lost in packets due to nobufs, etc. !! added
112 * ips_reassembled; - total packets reassembled ok
113 * ips_fragmented; - datagrams successfully fragmented
114 * ips_ofragments; - output fragments created
115 * ips_cantfrag; - don't fragment flag was set, etc.
116 * ips_badoptions; - error in option processing
117 * ips_noroute; - packets discarded due to no route
118 * ips_badvers; - ip version != 4
119 * ips_rawout; - total raw ip packets generated
120 * ips_toolong; - ip length > max ip packet size
121 *
122 *
123 * UDP statistics, <netinet/udp_var.h>
124 *
125 * udps_ipackets - total input packets
126 * udps_hdrops - packet shorter than header
127 * udps_badsum - checksum error
128 * udps_badlen - data length larger than packet
129 * udps_noport - no socket on port
130 * udps_noportbcast - as above, arrived as broadcast
131 * udps_fullsock - not delivered, input socket full
132 * udpps_pcbcachemiss - input packets missing pcb cache
133 * udpps_pcbhashmiss - input packets not for hashed pcb
134 * udps_opackets - total output packets
135 *
136 *
137 * TCP statistics for all connections, <netinet/tcp_var.h>
138 *
139 * tcps_connattempt - connections initiated (output)
140 * tcps_accepts - connections accepted (input)
141 * tcps_connects - connections established (input)
142 * tcps_drops - connections dropped (output)
143 * tcps_conndrops - embryonic connections dropped (output)
144 * tcps_closed - conn. closed (includes drops)
145 * tcps_segstimed - segs where we tried to get rtt
146 * tcps_rttupdated - times we succeeded
147 * tcps_delack - delayed acks sent
148 * tcps_timeoutdrop - conn. dropped in rxmt timeout
149 * tcps_rexmttimeo - retransmit timeouts
150 * tcps_persisttimeo - persist timeouts
151 * tcps_keeptimeo - keepalive timeouts
152 * tcps_keepprobe - keepalive probes sent
153 * tcps_keepdrops - connections dropped in keepalive
154 *
155 * tcps_sndtotal - total packets sent
156 * tcps_sndpack - data packets sent
157 * tcps_sndbyte - data bytes sent
158 * tcps_sndrexmitpack - data packets retransmitted
159 * tcps_sndrexmitbyte - data bytes retransmitted
160 * tcps_sndacks - ack-only packets sent
161 * tcps_sndprobe - window probes sent
162 * tcps_sndurg - packets sent with URG only
163 * tcps_sndwinup - window update -only packets sent
164 * tcps_sndctrl - control (SYN|FIN|RST) packets sent
165 *
166 * tcps_rcvtotal - total packets received
167 * tcps_rcvpack - packets received in sequence
168 * tcps_rcvbyte - bytes received in sequence
169 * tcps_rcvbadsum - packets received with ccksum errs
170 * tcps_rcvbadoff - packets received with bad offset
171 * tcps_rcvshort - packets received too short
172 * tcps_rcvduppack - duplicate-only packets received
173 * tcps_rcvdupbyte - duplicate-only bytes received
174 * tcps_rcvpartduppack - packets with some duplicate data
175 * tcps_rcvpartdupbyte - dup. bytes in part-dup. packets
176 * tcps_rcvoopack - out-of-order packets received
177 * tcps_rcvoobyte - out-of-order bytes received
178 * tcps_rcvpackafterwin - packets with data after window
179 * tcps_rcvbyteafterwin - bytes rcvd after window
180 * tcps_rcvafterclose - packets rcvd after "close"
181 * tcps_rcvwinprobe - rcvd window probe packets
182 * tcps_rcvdupack - rcvd duplicate acks
183 * tcps_rcvacktoomuch - rcvd acks for unsent data
184 * tcps_rcvackpack - rcvd ack packets
185 * tcps_rcvackbyte - bytes acked by rcvd acks
186 * tcps_rcvwinupd - rcvd window update packets
187 * tcps_pawsdrop - segments dropped due to PAWS (protected against wrapped segments)
188 * tcps_predack - times hdr predict ok for acks
189 * tcps_preddat - times hdr predict ok for data pkts
190 * tcps_pcbcachemiss - times missed cache for input segment
191 * tcps_cachedrtt - times cached RTT in route updated
192 * tcps_cachedrttvar - times cached rttvar updated
193 * tcps_cachedssthresh - times cached ssthresh updated
194 * tcps_usedrtt - times RTT initialized from route
195 * tcps_usedrttvar - times RTTVAR initialized from rt
196 * tcps_usedssthresh - times ssthresh initialized from rt
197 * tcps_persistdrop - timeout in persist state
198 * tcps_badsyn - bogus SYN, e.g. premature ACK
199 * tcps_mturesent - resends due to MTU discovery
200 * tcps_listendrop - listen queue overflows
201 * #ifdef TCP_FACK
202 * tcps_fack_recovery; - recovery episodes
203 * tcps_fack_sndpack; - data packets sent
204 * tcps_fack_sndbyte; - data bytes sent
205 * tcps_fack_sndrexmitpack - data packets retransmitted
206 * tcps_fack_sndrexmitbyte - data bytes retransmitted
207 * #endif
208 *
209 *
210 * ICMP statistics, in <netinet/icmp_var.h>
211 *
212 * icps_error - # of calls to icmp_error
213 * icps_oldshort - no error 'cuz old ip too short
214 * icps_oldicmp - no error 'cuz old was icmp
215 * icps_outhist[18+1] - output counters for ICMP_xx
216 * icps_badcode - icmp_code out of range
217 * icps_tooshort - packet < ICMP_MINLEN
218 * icps_checksum - bad checksum
219 * icps_badlen - calculated bound mismatch
220 * icps_reflect - number of responses
221 * icps_inhist[18+1] - input counters for ICMP_xx
222 *
223 *
224 * IGMP statistics, <netinet/igmp_var.h>
225 *
226 * igps_rcv_total - total IGMP messages received
227 * igps_rcv_tooshort - received with too few bytes
228 * igps_rcv_badsum - received with bad checksum
229 * igps_rcv_queries - received membership queries
230 * igps_rcv_badqueries - received invalid queries
231 * igps_rcv_reports - received membership reports
232 * igps_rcv_badreports - received invalid reports
233 * igps_rcv_ourreports - received reports for our groups
234 * igps_snd_reports - sent membership reports
235 */
236
237#if defined(USE_STATISTICS)
238 #define macstats W32_NAMESPACE (macstats)
239 #define ip4stats W32_NAMESPACE (ip4stats)
240 #define ip6stats W32_NAMESPACE (ip6stats)
241 #define udpstats W32_NAMESPACE (udpstats)
242 #define tcpstats W32_NAMESPACE (tcpstats)
243 #define icmpstats W32_NAMESPACE (icmpstats)
244 #define icmp6stats W32_NAMESPACE (icmp6stats)
245 #define igmpstats W32_NAMESPACE (igmpstats)
246 #define pppoestats W32_NAMESPACE (pppoestats)
247 #define cache_stats W32_NAMESPACE (cache_stats)
248
249 extern struct macstat macstats;
250 extern struct ipstat ip4stats;
251 extern struct ip6stat ip6stats;
252 extern struct udpstat udpstats;
253 extern struct tcpstat tcpstats;
254 extern struct icmpstat icmpstats;
255 extern struct icmp6stat icmp6stats;
256 extern struct igmpstat igmpstats;
257 extern struct pppoestat pppoestats;
258 extern struct cache_stat cache_stats;
259
260 extern void update_in_stat (void);
261 extern void update_out_stat (void);
262
263 #define STAT(x) x
264
265#else
266 #define STAT(x) ((void)0)
267#endif
268
269#endif /* !_w32_PCSTAT_H */
270
icmp6.h
icmp_var.h
if.h
if_dl.h
igmp_var.h
in.h
in_pcb.h
in_systm.h
in_var.h
socket.h
ip6_var.h
ip.h
ip_var.h
tcp.h
update_out_stat
void update_out_stat(void)
Definition: pcstat.c:724
update_in_stat
void update_in_stat(void)
Definition: pcstat.c:583
route.h
arp
cache_stat
Definition: pcstat.h:83
icmp6stat
Definition: icmp6.h:563
icmpstat
Definition: icmp_var.h:51
igmpstat
Definition: igmp_var.h:56
ip6stat
Definition: ip6_var.h:174
ipstat
Definition: ip_var.h:134
macstat
Definition: pcstat.h:36
pppoestat
Definition: pcstat.h:72
rarp
tcpstat
Definition: tcp_var.h:305
tcp_time.h
tcp_var.h
tcpip.h
udp.h
udp_var.h


Watt-32 tcp/ip: E:/WATT/src/pctcp.c Source File

  • src
pctcp.c
Go to the documentation of this file.
1
12#include <stdio.h>
13#include <stdarg.h>
14#include <stdlib.h>
15#include <string.h>
16#include <limits.h>
17
18#include "copyrigh.h"
19#include "wattcp.h"
20#include "chksum.h"
21#include "language.h"
22#include "pcdns.h"
23#include "bsdname.h"
24#include "pcconfig.h"
25#include "pcqueue.h"
26#include "pcsed.h"
27#include "pcstat.h"
28#include "pcpkt.h"
29#include "pcicmp.h"
30#include "pcicmp6.h"
31#include "pcigmp.h"
32#include "pcdbug.h"
33#include "pcdhcp.h"
34#include "pcarp.h"
35#include "pcbuf.h"
36#include "netaddr.h"
37#include "ip4_frag.h"
38#include "ip4_in.h"
39#include "ip4_out.h"
40#include "misc.h"
41#include "misc_str.h"
42#include "run.h"
43#include "timer.h"
44#include "split.h"
45#include "pppoe.h"
46#include "pctcp.h"
47
48#if defined(USE_BSD_API) || defined(USE_IPV6)
49#include "socket.h"
50#endif
51
52#ifndef __inline
53#define __inline
54#endif
55
58char hostname [MAX_HOSTLEN+1] = "random-pc";
59
60unsigned _mss = ETH_MAX_DATA - TCP_OVERHEAD;
61unsigned _mtu = ETH_MAX_DATA;
62BOOL mtu_discover = 0;
63BOOL mtu_blackhole = 0;
64BOOL block_tcp = 0;
65BOOL block_udp = 0;
66BOOL block_icmp = 0;
67BOOL block_ip = 0;
69DWORD my_ip_addr = 0L;
70DWORD sin_mask = 0xFFFFFF00L;
72_udp_Socket *_udp_allsocs = NULL;
74W32_CLANG_PACK_WARN_OFF()
75
76#include <sys/pack_on.h>
77
78struct ip4_packet {
79 in_Header in;
80 udp_Header udp;
81 /* BYTE data[]; */
82 };
83
84struct ip6_packet {
85 in6_Header in;
86 udp_Header udp;
87 /* BYTE data[]; */
88 };
89
90struct tcp_pkt {
91 in_Header in;
92 tcp_Header tcp;
93 };
94
95struct tcp6_pkt {
96 in6_Header in;
97 tcp_Header tcp;
98 };
99
100#include <sys/pack_off.h>
101
102 W32_CLANG_PACK_WARN_DEF()
103
104#if defined(USE_BSD_API)
109 void *(MS_CDECL *_bsd_socket_hook) (enum BSD_SOCKET_OPS op, ...) = NULL;
110#endif
111
112#if !defined(USE_UDP_ONLY)
113
116 unsigned tcp_OPEN_TO = DEF_OPEN_TO;
117 unsigned tcp_CLOSE_TO = DEF_CLOSE_TO;
118 unsigned tcp_RTO_ADD = DEF_RTO_ADD;
119 unsigned tcp_RTO_BASE = DEF_RTO_BASE;
120 unsigned tcp_RTO_SCALE = DEF_RTO_SCALE;
121 unsigned tcp_RST_TIME = DEF_RST_TIME;
122 unsigned tcp_RETRAN_TIME = DEF_RETRAN_TIME;
123 unsigned tcp_MAX_VJSA = DEF_MAX_VJSA;
124 unsigned tcp_MAX_VJSD = DEF_MAX_VJSD;
128 BOOL tcp_opt_ts = FALSE;
129 BOOL tcp_opt_wscale = FALSE;
130 BOOL tcp_opt_sack = FALSE;
131
134 BOOL tcp_nagle = TRUE;
135 unsigned tcp_keep_idle = 2*60;
136 unsigned tcp_keep_intvl = 30;
137 unsigned tcp_max_idle = 60;
138 DWORD tcp_recv_win = DEF_RECV_WIN;
140 _tcp_Socket *_tcp_allsocs = NULL;
142 static _tcp_Socket *tcp_findseq (const in_Header *ip, const tcp_Header *tcp);
143 static void tcp_sockreset (_tcp_Socket *s, BOOL proxy);
144
145 static void tcp_no_arp (_tcp_Socket *s);
146 static void tcp_rtt_win (_tcp_Socket *s);
147 static void tcp_upd_win (_tcp_Socket *s, unsigned line);
148 static BOOL tcp_checksum (const in_Header *ip, const tcp_Header *tcp, int len);
149#endif
150
151static void udp_close (const _udp_Socket *s);
152
153static void (W32_CALL *system_yield)(void) = NULL;
154
158int _udp_listen (_udp_Socket *s, WORD lport, DWORD ip, WORD port)
159{
160 if (!_eth_is_init) /* GvB 2002-09, Lets us survive without a working eth */
161 {
162 SOCK_ERRNO (ENETDOWN);
163 s->err_msg = _LANG (_eth_not_init);
164 return (0);
165 }
166
167 s->ip_type = UDP_PROTO;
168 s->myaddr = my_ip_addr;
169 s->myport = lport;
170 s->hisaddr = ip;
171 s->hisport = port;
172
173 if (!s->rx_data)
174 {
175 /* This is a new socket, set default options and insert it in the chain.
176 */
177 s->sockmode = SOCK_MODE_BINARY | SOCK_MODE_UDPCHK;
178 s->ttl = _default_ttl;
179 s->usr_yield = system_yield;
180 s->safetysig = SAFETY_UDP;
181 s->next = _udp_allsocs;
182 _udp_allsocs = s;
183 }
184 return (1);
185}
186
190int W32_CALL udp_listen (_udp_Socket *s, WORD lport, DWORD ip,
191 WORD port, ProtoHandler handler)
192{
193 udp_close (s);
194 WATT_LARGE_CHECK (s, sizeof(*s));
195 memset (s, 0, sizeof(*s));
196
197 lport = find_free_port (lport, 0);
198
199 if (!_udp_listen (s, lport, ip, port))
200 {
201 reuse_localport (lport);
202 return (0);
203 }
204
205 s->rx_data = &s->rx_buf[0];
206 s->max_rx_data = sizeof(s->rx_buf) - 1;
207 s->protoHandler = handler;
208 return (1);
209}
210
214int _udp_open (_udp_Socket *s, WORD lport, DWORD ip, WORD port)
215{
216 BOOL bcast;
217
218 if (ip && _ip4_is_multihome_addr(ip)) /* 0.0.0.0 is legal */
219 {
220 SOCK_ERRNO (EINVAL);
221 strcpy (s->err_buf, _LANG("Illegal destination "));
222 strcat (s->err_buf, _inet_ntoa(NULL,ip));
223 s->err_msg = s->err_buf;
224 return (0);
225 }
226
227 if (!_udp_listen(s, lport, ip, port))
228 return (0);
229
230 bcast = ((ip == IP_BCAST_ADDR) || (~ip & ~sin_mask) == 0);
231
232 if (bcast || !ip) /* check for broadcast */
233 {
234 memset (s->his_ethaddr, 0xFF, sizeof(eth_address));
235 if (!ip)
236 s->hisaddr = IP_BCAST_ADDR; /* 255.255.255.255 (this network) */
237 }
238#if defined(USE_MULTICAST)
239 else if (_ip4_is_multicast(ip)) /* check for multicast */
240 {
241 multi_to_eth (ip, &s->his_ethaddr);
242 s->ttl = 1; /* so we don't send worldwide as default */
243 }
244#endif
245 else if (!_arp_resolve(ip,&s->his_ethaddr))
246 {
247 SOCK_ERRNO (EHOSTUNREACH);
248 strcpy (s->err_buf, _LANG("ARP failed "));
249 strcat (s->err_buf, _inet_ntoa(NULL,ip));
250 s->err_msg = s->err_buf;
251 STAT (ip4stats.ips_noroute++);
252 udp_close (s);
253 return (0);
254 }
255
256 return (1);
257}
258
262int W32_CALL udp_open (_udp_Socket *s, WORD lport, DWORD ip,
263 WORD port, ProtoHandler handler)
264{
265 udp_close (s);
266 WATT_LARGE_CHECK (s, sizeof(*s));
267 memset (s, 0, sizeof(*s));
268
269 lport = find_free_port (lport, 0);
270
271 if (!_udp_open (s, lport, ip, port))
272 {
273 reuse_localport (lport);
274 return (0);
275 }
276
277 s->rx_data = &s->rx_buf[0];
278 s->max_rx_data = sizeof(s->rx_buf) - 1;
279 s->protoHandler = handler;
280 return (1);
281}
282
287static void udp_close (const _udp_Socket *udp)
288{
289 _udp_Socket *s, *prev;
290
291 for (s = prev = _udp_allsocs; s; prev = s, s = s->next)
292 {
293 if (udp != s)
294 continue;
295
296 reuse_localport (s->myport);
297
298 if (s == _udp_allsocs)
299 _udp_allsocs = s->next;
300 else prev->next = s->next;
301 SET_ERR_MSG (s, _LANG("UDP Close called"));
302 break;
303 }
304}
305
309int W32_CALL udp_SetTTL (_udp_Socket *s, BYTE ttl)
310{
311 s->ttl = ttl;
312 return (0);
313}
314
315
316#if !defined(USE_UDP_ONLY)
317
328int W32_CALL tcp_open (_tcp_Socket *s, WORD lport, DWORD ip,
329 WORD rport, ProtoHandler handler)
330{
331 WATT_LARGE_CHECK (s, sizeof(*s));
332 _tcp_unthread (s, FALSE); /* just in case not totally closed */
333
334 memset (s, 0, sizeof(*s));
335 s->state = tcp_StateCLOSED; /* otherwise is tcp_StateLISTEN on failure */
336
337 STAT (tcpstats.tcps_connattempt++);
338
339 if (!_eth_is_init) /* GvB 2002-09, Lets us survive without a working eth */
340 {
341 SOCK_ERRNO (ENETDOWN);
342 s->err_msg = _LANG (_eth_not_init);
343 return (0);
344 }
345
346 if (!ip || _ip4_is_multihome_addr(ip) || _ip4_is_multicast(ip))
347 {
348 SOCK_ERRNO (EINVAL);
349 strcpy (s->err_buf, _LANG("Illegal destination "));
350 strcat (s->err_buf, _inet_ntoa(NULL,ip));
351 s->err_msg = s->err_buf;
352 return (0);
353 }
354
355 if (!_arp_start_lookup(ip)) /* GvB 2002-09, now non-blocking */
356 {
357 SOCK_ERRNO (EHOSTUNREACH);
358 strcpy (s->err_buf, _LANG("Failed to start ARP lookup "));
359 strcat (s->err_buf, _inet_ntoa(NULL,ip));
360 s->err_msg = s->err_buf;
361 return (0);
362 }
363
364 s->rx_data = &s->rx_buf[0];
365 s->max_rx_data = sizeof(s->rx_buf) - 1;
366 s->tx_data = &s->tx_buf[0];
367 s->max_tx_data = sizeof(s->tx_buf) - 1;
368 s->ip_type = TCP_PROTO;
369 s->max_seg = _mss;
370 s->state = tcp_StateRESOLVE;
371
372 s->cwindow = 1;
373 s->wwindow = 0; /* slow start VJ algorithm */
374 s->vj_sa = INIT_VJSA;
375 s->rto = tcp_OPEN_TO; /* added 14-Dec 1999, GV */
376 s->myaddr = my_ip_addr;
377 s->myport = find_free_port (lport,1); /* get a nonzero port val */
378 s->locflags = LF_LINGER; /* close via TIMEWT state */
379 s->ttl = _default_ttl;
380 s->hisaddr = ip;
381 s->hisport = rport;
382 s->send_next = INIT_SEQ();
383 s->flags = tcp_FlagSYN;
384 s->unhappy = TRUE;
385 s->protoHandler = handler;
386 s->usr_yield = system_yield;
387
388 s->safetysig = SAFETY_TCP; /* marker signatures */
389 s->safetytcp = SAFETY_TCP;
390 s->next = _tcp_allsocs; /* insert into chain */
391 _tcp_allsocs = s;
392
395 if (tcp_nagle)
396 s->sockmode = SOCK_MODE_NAGLE;
397 s->sockmode |= SOCK_MODE_BINARY;
398
399 return (1);
400}
401
407int W32_CALL tcp_listen (_tcp_Socket *s, WORD lport, DWORD ip,
408 WORD port, ProtoHandler handler, WORD timeout)
409{
410 WATT_LARGE_CHECK (s, sizeof(*s));
411 _tcp_unthread (s, FALSE); /* just in case not totally closed */
412 memset (s, 0, sizeof(*s));
413
414 s->state = tcp_StateCLOSED; /* otherwise is tcp_StateLISTEN if success */
415
416 if (!_eth_is_init) /* GvB 2002-09, Lets us survive without a working eth */
417 {
418 SOCK_ERRNO (ENETDOWN);
419 s->err_msg = _LANG (_eth_not_init);
420 return (0);
421 }
422
423 if (_ip4_is_multicast(ip)) /* 0.0.0.0 is legal */
424 {
425 SOCK_ERRNO (EINVAL);
426 strcpy (s->err_buf, _LANG("Illegal destination "));
427 strcat (s->err_buf, _inet_ntoa(NULL,ip));
428 s->err_msg = s->err_buf;
429 return (0);
430 }
431
432 s->rx_data = &s->rx_buf[0];
433 s->max_rx_data = sizeof(s->rx_buf) - 1;
434 s->tx_data = &s->tx_buf[0];
435 s->max_tx_data = sizeof(s->tx_buf) - 1;
436 s->ip_type = TCP_PROTO;
437 s->max_seg = _mss;
438 s->cwindow = 1;
439 s->wwindow = 0; /* slow start VJ algorithm */
440 s->vj_sa = INIT_VJSA;
441 s->state = tcp_StateLISTEN;
442 s->locflags = LF_LINGER | LF_IS_SERVER;
443 s->myport = find_free_port (lport, 0);
444 s->hisport = port;
445 s->hisaddr = ip;
446 s->send_next = INIT_SEQ();
447 s->unhappy = FALSE;
448 s->ttl = _default_ttl;
449 s->protoHandler = handler;
450 s->usr_yield = system_yield;
451 s->safetysig = SAFETY_TCP; /* marker signatures */
452 s->safetytcp = SAFETY_TCP;
453 s->next = _tcp_allsocs; /* insert into chain */
454 _tcp_allsocs = s;
455
456 if (tcp_nagle)
457 s->sockmode = SOCK_MODE_NAGLE;
458 s->sockmode |= SOCK_MODE_BINARY;
459
460 if (timeout != 0)
461 s->timeout = set_timeout (1000 * timeout);
462 return (1);
463}
464
471void _tcp_close (_tcp_Socket *s)
472{
473 if (s->ip_type != TCP_PROTO)
474 return;
475
476 if (s->state == tcp_StateESTAB ||
477 s->state == tcp_StateESTCL ||
478 s->state == tcp_StateSYNREC)
479 {
480 if (s->tx_datalen) /* must first flush all Tx data */
481 {
482 s->flags |= (tcp_FlagPUSH | tcp_FlagACK);
483 if (s->state < tcp_StateESTCL)
484 {
485 s->state = tcp_StateESTCL;
486 TCP_SENDSOON (s);
487 }
488 }
489 else /* really closing */
490 {
491 SET_ERR_MSG (s, _LANG("Connection closed normally"));
492 s->flags = (tcp_FlagACK | tcp_FlagFIN);
493 s->state = tcp_StateFINWT1;
494 s->timeout = set_timeout (tcp_TIMEOUT);
495 s->rtt_time = 0UL; /* stop RTT timer */
496 TCP_SEND (s);
497 }
498 s->unhappy = TRUE;
499 }
500 else if (s->state == tcp_StateCLOSWT)
501 {
502 /* need to ACK the FIN and get on with it
503 */
504 s->timeout = set_timeout (tcp_LASTACK_TIME); /* Added AGW 6 Jan 2001 */
505 s->state = tcp_StateLASTACK;
506 s->flags |= tcp_FlagFIN;
507 TCP_SEND (s);
508 s->unhappy = TRUE;
509 }
510 else if (s->state == tcp_StateRESOLVE || /* unlink failed connection */
511 s->state == tcp_StateSYNSENT)
512 {
513 s->state = tcp_StateCLOSED;
514 maybe_reuse_localport (s);
515 _tcp_unthread (s, FALSE);
516 }
517}
518
522 _tcp_Socket *_tcp_abort (_tcp_Socket *s, const char *file, unsigned line)
523{
524 SET_ERR_MSG (s, _LANG("TCP Abort"));
525
526 TRACE_FILE ("_tcp_abort(%" ADDR_FMT ") called from %s (%u). State %s\n",
527 ADDR_CAST(s), file, line, tcpStateName(s->state));
528
529 if (s->state >= tcp_StateSYNSENT &&
530 s->state <= tcp_StateLASTACK)
531 {
532 s->flags = (tcp_FlagRST | tcp_FlagACK);
533 s->unhappy = TRUE;
534 if (s->state <= tcp_StateSYNREC)
535 {
536 s->rtt_time = 0UL; /* Stop RTT timer */
537 tcp_rtt_clr (s); /* Clear cached RTT */
538 }
539 s->tx_datalen = 0; /* RST should not carry any data */
540 TCP_SEND (s);
541 }
542 s->unhappy = FALSE;
543 s->ip_type = 0;
544 s->tx_datalen = 0; /* discard Tx buffer, but not Rx buffer */
545
546 maybe_reuse_localport (s);
547 ARGSUSED (file);
548 ARGSUSED (line);
549 return _tcp_unthread (s, TRUE);
550}
551
563int _tcp_sendsoon (_tcp_Socket *s, const char *file, unsigned line)
564{
565 DWORD timeout;
566
567 if (s->ip_type != TCP_PROTO)
568 return (0);
569
570 if (s->state >= tcp_StateCLOSWT)
571 timeout = set_timeout (tcp_CLOSE_TO);
572 else timeout = set_timeout (tcp_RTO_BASE);
573
574 if (s->rto <= tcp_RTO_BASE && s->recent == 0 &&
575 cmp_timers(s->rtt_time,timeout) <= 0)
576 { /* !! was == */
577 int rc;
578
579 s->karn_count = 0;
580 rc = _tcp_send (s, file, line);
581 s->recent = 1;
582 return (rc);
583 }
584
585 if ((s->unhappy || s->tx_datalen > 0 || s->karn_count == 1) &&
586 (s->rtt_time && cmp_timers(s->rtt_time,timeout) < 0))
587 return (0);
588
589 if (s->state == tcp_StateSYNSENT) /* relaxed in SYNSENT state */
590 s->rtt_time = set_timeout (tcp_OPEN_TO);
591 else s->rtt_time = set_timeout (s->rto / tcp_RTO_SCALE);
592
593 s->karn_count = 1;
594
595 return (0);
596}
597
602 _tcp_Socket *_tcp_unthread (_tcp_Socket *ds, BOOL free_tx)
603{
604 _tcp_Socket *s, *prev;
605 _tcp_Socket *next = NULL;
606
607 if (ds == NULL)
608 return (NULL);
609
610 for (s = prev = _tcp_allsocs; s; prev = s, s = s->next)
611 {
612 if (ds != s)
613 continue;
614
615 if (s == _tcp_allsocs)
616 _tcp_allsocs = s->next;
617 else prev->next = s->next;
618 next = s->next;
619 break;
620 }
621
622 if (ds->rx_datalen == 0 || (ds->state > tcp_StateESTCL))
623 ds->ip_type = 0; /* fail further I/O */
624 ds->state = tcp_StateCLOSED; /* tcp_tick needs this */
625
626 if (free_tx && ds->tx_data != NULL && ds->tx_data != &ds->tx_buf[0] &&
627 *(DWORD*)(ds->tx_data-4) == SAFETY_TCP)
628 {
629 free (ds->tx_data-4);
630 ds->tx_data = NULL;
631 ds->tx_datalen = 0; /* should already be 0 */
632 }
633 return (next);
634}
635
639int W32_CALL tcp_established (const _tcp_Socket *s)
640{
641 return (s->state >= tcp_StateESTAB);
642}
643
649 _tcp_Socket *_tcp_handler (const in_Header *ip, BOOL broadcast)
650{
651#if defined(USE_IPV6)
652 const in6_Header *ip6 = (const in6_Header*)ip;
653 ip6_address ip6_src, ip6_dst;
654#endif
655
656 tcp_Header *tcp;
657 _tcp_Socket *s;
658 int len;
659 BYTE flags;
660 DWORD source = intel (ip->source);
661 DWORD destin = intel (ip->destination);
662 DWORD seq;
663 WORD dstPort, srcPort;
664 BOOL is_ip4 = (ip->ver == 4);
665
666 if (is_ip4)
667 {
668 if (broadcast || block_tcp ||
669 !_ip4_is_local_addr(destin) || _ip4_is_multicast(source))
670 {
671 DEBUG_RX (NULL, ip);
672 return (NULL);
673 }
674
675 len = in_GetHdrLen (ip); /* len of IP header */
676 tcp = (tcp_Header*) ((BYTE*)ip + len); /* tcp frame pointer */
677 len = intel16 (ip->length) - len; /* len of tcp+data */
678 flags = tcp->flags & tcp_FlagMASK; /* get TCP flags */
679
680 if (!tcp_checksum(ip,tcp,len))
681 {
682 DEBUG_RX (NULL, ip);
683 return (NULL);
684 }
685 }
686#if defined(USE_IPV6)
687 else
688 {
689 if (broadcast || block_tcp ||
690 !IN6_IS_ADDR_LINKLOCAL(&ip6->destination) ||
691 IN6_IS_ADDR_MULTICAST(&ip6->source))
692 {
693 DEBUG_RX (NULL, ip);
694 return (NULL);
695 }
696
697 len = intel16 (ip6->len);
698 tcp = (tcp_Header*) pkt_get_type_in (TYPE_TCP_HEAD)->data;
699 flags = tcp->flags & tcp_FlagMASK;
700 memcpy (&ip6_dst, &ip6->destination, sizeof(ip6_dst));
701 memcpy (&ip6_src, &ip6->source, sizeof(ip6_src));
702 if (!_ip6_tcp_checksum(ip6,tcp,len))
703 {
704 DEBUG_RX (NULL, ip6);
705 return (NULL);
706 }
707 }
708#else
709 else
710 {
711 DEBUG_RX (NULL, ip);
712 return (NULL);
713 }
714#endif
715
716
717 dstPort = intel16 (tcp->dstPort);
718 srcPort = intel16 (tcp->srcPort);
719
720 /* demux to active sockets
721 */
722 for (s = _tcp_allsocs; s; s = s->next)
723 {
724 if (s->safetysig != SAFETY_TCP || s->safetytcp != SAFETY_TCP)
725 {
726 outsnl (_LANG("Error in _tcp_handler()"));
727 DEBUG_RX (s, ip);
728 return (NULL);
729 }
730
731 if (s->is_ip6 && !is_ip4)
732 {
733#if defined(USE_IPV6)
734 if (s->hisport &&
735 !memcmp(&ip6_dst, &s->my6addr, sizeof(ip6_dst)) &&
736 !memcmp(&ip6_src, &s->his6addr, sizeof(ip6_src)) &&
737 dstPort == s->myport &&
738 srcPort == s->hisport)
739 break;
740#endif
741 }
742 else if (is_ip4)
743 {
744 if (s->hisport && /* IP4: not a listening socket */
745 destin == s->myaddr && /* addressed to my IP */
746 source == s->hisaddr && /* and from my peer address */
747 dstPort == s->myport && /* addressed to my local port */
748 srcPort == s->hisport) /* and from correct remote port */
749 break;
750 }
751 }
752
753 if (!s && (flags & tcp_FlagSYN))
754 {
755 /* demux to passive (listening) sockets, must be a new session
756 */
757 for (s = _tcp_allsocs; s; s = s->next)
758 if (s->hisport == 0 && /* =0, listening socket */
759 s->myport == dstPort) /* addressed to my local port */
760 {
761 if (s->is_ip6)
762 {
763#if defined(USE_IPV6)
764 if (!is_ip4)
765 {
766 s->hisaddr = source;
767 s->hisport = srcPort;
768 memcpy (&s->my6addr, ip6_dst, sizeof(s->my6addr));
769 }
770#endif
771 }
772 else if (is_ip4)
773 {
774 s->hisaddr = source; /* remember his IP-address */
775 s->hisport = srcPort; /* and src-port */
776 s->myaddr = destin; /* socket is now active (should be same) */
777 }
778 break;
779 }
780 }
781
782 DEBUG_RX (s, ip);
783
784 if (!s)
785 {
786 if (!(flags & tcp_FlagRST)) /* don't answer RST */
787 {
788 TCP_SEND_RESET (NULL, ip, tcp);
789 }
790 else if ((flags & tcp_FlagACK) && /* got ACK,RS */
791 (s = tcp_findseq(ip,tcp)) != NULL) /* ACK = SEQ + 1 */
792 {
793 /* e.g. a firewall is sending RST for host on inside.
794 */
795 tcp_sockreset (s, TRUE);
796 }
797 return (NULL);
798 }
799
800#if defined(USE_TCP_MD5)
801 if (is_ip4)
802 {
803 /* \todo: check in a src-host database and drop if not found
804 * and MD5 fails.
805 */
806 check_md5_signature (s, ip);
807 }
808#endif
809
810 /* Restart idle-timer unless overridden by tcp_connect().
811 */
812 if (sock_inactive && !(s->locflags & LF_RCVTIMEO))
813 s->inactive_to = set_timeout (1000 * sock_inactive);
814
815 /* Got a RST with correct SEQ (RCV.NXT - RCV.NXT-RCV.RWIN+1).
816 * Reset socket (if socket is a server, go back to listening).
817 */
818 seq = intel (tcp->seqnum);
819 if ((flags & tcp_FlagRST) &&
820 SEQ_GEQ(seq, s->recv_next) &&
821 SEQ_LEQ(seq, s->recv_next+s->adv_win+1))
822 {
823 TRACE_FILE ("_tcp_handler(): got RST, SEQ %lu\n", (u_long)seq);
824 tcp_sockreset (s, FALSE);
825 return (NULL);
826 }
827
828 if (flags & tcp_FlagPUSH) /* EE 2002.2.28 */
829 s->locflags |= LF_GOT_PUSH;
830 else s->locflags &= ~LF_GOT_PUSH;
831
832 tcp_rtt_win (s); /* update retrans timer, windows etc. */
833
834 if (_tcp_fsm(&s,ip) && /* do input tcp state-machine */
835 s->unhappy) /* if "unhappy", retransmit soon */
836 TCP_SENDSOON (s);
837
838#if defined(USE_DEBUG)
839 _sock_check_tcp_buffers (s);
840#endif
841
842 return (s);
843}
844#endif /* !USE_UDP_ONLY */
845
846
850static BOOL udp_checksum (const in_Header *ip, const udp_Header *udp, int len)
851{
852 tcp_PseudoHeader ph = { 0,0,0,0,0,0 };
853
854 ph.src = ip->source; /* already network order */
855 ph.dst = ip->destination;
856 ph.protocol = UDP_PROTO;
857 ph.length = udp->length;
858 ph.checksum = CHECKSUM (udp, len);
859
860 if (CHECKSUM(&ph,sizeof(ph)) != 0xFFFF)
861 {
862 TRACE_CONSOLE (1, "Bad udp checksum. ");
863 TRACE_FILE ("Bad udp checksum\n");
864 STAT (udpstats.udps_badsum++);
865 return (FALSE);
866 }
867 return (TRUE);
868}
869
870
875static _udp_Socket *udp_demux (const in_Header *ip, BOOL ip_bcast,
876 DWORD destin, WORD srcPort, WORD dstPort,
877 BOOL *udp_err)
878{
879 _udp_Socket *s;
880 BOOL is_ip4 = (ip->ver == 4);
881
882#if defined(USE_IPV6)
883 const in6_Header *ip6 = (const in6_Header*)ip;
884 ip6_address ip6_src, ip6_dst;
885
886 if (!is_ip4)
887 {
888 memcpy (&ip6_dst, &ip6->destination, sizeof(ip6_dst));
889 memcpy (&ip6_src, &ip6->source, sizeof(ip6_src));
890 }
891 else
892 {
893 /*
894 * To supress GCC 5.x warning:
895 * pctcp.c:951:14: warning: 'ip6_dst' may be used uninitialized in this function [-Wmaybe-uninitialized]
896 * memcpy (&s->my6addr, &ip6_dst, sizeof(s->my6addr));
897 */
898 memset (&ip6_dst, 0, sizeof(ip6_dst));
899 }
900#endif
901
902 *udp_err = FALSE; /* assume socket-list is OK */
903
907 for (s = _udp_allsocs; s; s = s->next)
908 {
909 if (s->safetysig != SAFETY_UDP)
910 {
911 outsnl (_LANG("Error in udp_demux()"));
912 s->safetysig = SAFETY_UDP;
913 DEBUG_RX (s, ip);
914 *udp_err = TRUE;
915 return (NULL);
916 }
917
918 if (!ip_bcast &&
919 (s->hisport != 0) &&
920 (dstPort == s->myport) &&
921 (srcPort == s->hisport))
922 {
923 if (s->is_ip6)
924 {
925#if defined(USE_IPV6)
926 if (!is_ip4 &&
927 IN6_ARE_ADDR_EQUAL(&ip6_src, &s->his6addr)) /* !!mask */
928 {
929 DEBUG_RX (s, ip);
930 break;
931 }
932#endif
933 }
934 else if (is_ip4 &&
935 ((destin & sin_mask) == (s->myaddr & sin_mask)) &&
936 (intel(ip->source) == s->hisaddr))
937 {
938 DEBUG_RX (s, ip);
939 break;
940 }
941 }
942 }
943
944 if (!s)
945 {
946 /* demux to passive sockets
947 */
948 for (s = _udp_allsocs; s; s = s->next)
949 {
950 if (s->is_ip6)
951 {
952#if defined(USE_IPV6)
953 if (!is_ip4 && dstPort == s->myport &&
954 IN6_IS_ADDR_UNSPECIFIED(&s->his6addr))
955 {
956 DEBUG_RX (s, ip);
957
958 memcpy (&s->his6addr, &ip6_src, sizeof(s->his6addr));
959 s->hisport = srcPort;
960 SET_PEER_MAC_ADDR (s, ip6);
961 if (!ip_bcast)
962 memcpy (&s->my6addr, &ip6_dst, sizeof(s->my6addr));
963 break;
964 }
965#endif
966 }
967 else if (is_ip4 && (s->hisaddr == 0 || s->hisaddr == IP_BCAST_ADDR) &&
968 dstPort == s->myport)
969 {
970 DEBUG_RX (s, ip);
971
972 if (s->hisaddr == 0)
973 {
974 s->hisaddr = intel (ip->source); /* socket now active */
975 s->hisport = srcPort;
976 SET_PEER_MAC_ADDR (s, ip);
977
978 /* take on value of expected destination
979 * unless it is broadcast
980 */
981 if (!ip_bcast)
982 s->myaddr = destin;
983 }
984 break;
985 }
986 }
987 }
988
989
990#if defined(USE_MULTICAST)
991 if (is_ip4 && !s)
992 {
993 /* demux to multicast sockets
994 */
995 for (s = _udp_allsocs; s; s = s->next)
996 {
997 if (s->hisport != 0 &&
998 s->hisaddr == destin &&
999 dstPort == s->myport &&
1000 _ip4_is_multicast(destin))
1001 {
1002 DEBUG_RX (s, ip);
1003 break;
1004 }
1005 }
1006 }
1007#endif
1008
1009 if (!s)
1010 {
1011 /* Demux to broadcast sockets.
1012 */
1013 for (s = _udp_allsocs; s; s = s->next)
1014 {
1015 if (s->is_ip6 && !is_ip4)
1016 {
1017#if defined(USE_IPV6)
1018 if (dstPort == s->myport && IN6_IS_ADDR_UNSPECIFIED(&s->his6addr))
1019 {
1020 DEBUG_RX (s, ip);
1021 break;
1022 }
1023#endif
1024 }
1025 else if (is_ip4)
1026 {
1027 if (s->hisaddr == IP_BCAST_ADDR && dstPort == s->myport)
1028 {
1029 DEBUG_RX (s, ip);
1030 break;
1031 }
1032 }
1033 }
1034 }
1035 return (s);
1036}
1037
1038
1042_udp_Socket *_udp_handler (const in_Header *ip, BOOL broadcast)
1043{
1044#if defined(USE_IPV6)
1045 const in6_Header *ip6 = (const in6_Header*)ip;
1046 ip6_address ip6_src, ip6_dst;
1047#endif
1048
1049 _udp_Socket *s;
1050 UINT len = 0;
1051 WORD dst_port, src_port;
1052 DWORD destin = 0;
1053 BOOL is_ip4 = (ip->ver == 4);
1054 BOOL ip_bcast = 0;
1055 BOOL udp_err;
1056
1057 const BYTE *data;
1058 const udp_Header *udp = NULL;
1059
1060 if (is_ip4)
1061 {
1062 destin = intel (ip->destination);
1063 ip_bcast = broadcast || /* link-layer broadcast */
1064 _ip4_is_ip_brdcast(ip); /* (directed) ip-broadcast */
1065 }
1066#if defined(USE_IPV6)
1067 else
1068 {
1069 memcpy (&ip6_dst, &ip6->destination, sizeof(ip6_dst));
1070 memcpy (&ip6_src, &ip6->source, sizeof(ip6_src));
1071 ip_bcast = broadcast ||
1072 IN6_IS_ADDR_MULTICAST (&ip6->destination); /* !! */
1073 }
1074#endif
1075
1076#if !defined(USE_MULTICAST)
1077
1078 /* dst = ip number
1079 * or 255.255.255.255
1080 * or sin_mask.255.255
1081 * This is the only really gross hack in the multicasting stuff.
1082 * I'll fix it as soon as I can figure out what I want to do here.
1083 * -JRM 8/1/93
1084 */
1085 if (is_ip4 && !ip_bcast && /* not a IPv4 broadcast packet */
1086 my_ip_addr && /* and I know my address */
1087 !_ip4_is_multihome_addr(destin)) /* and not my address */
1088 {
1089 DEBUG_RX (NULL, ip);
1090 STAT (udpstats.udps_noport++);
1091 return (NULL);
1092 }
1093#endif
1094
1095 if (is_ip4)
1096 {
1097 len = in_GetHdrLen (ip);
1098 udp = (const udp_Header*) ((BYTE*)ip + len); /* udp segment pointer */
1099 len = intel16 (udp->length);
1100 }
1101#if defined(USE_IPV6)
1102 else
1103 {
1104 len = intel16 (ip6->len);
1105 udp = (const udp_Header*) pkt_get_type_in (TYPE_UDP_HEAD)->data;
1106 len = intel16 (udp->length);
1107 }
1108#endif
1109
1110 if (len < sizeof(*udp))
1111 {
1112 DEBUG_RX (NULL, ip);
1113 STAT (udpstats.udps_hdrops++);
1114 return (NULL);
1115 }
1116
1117 src_port = intel16 (udp->srcPort);
1118 dst_port = intel16 (udp->dstPort);
1119
1120 if (dst_port == 0 || src_port == 0)
1121 {
1122 DEBUG_RX (NULL, ip);
1123 return (NULL);
1124 }
1125
1126 s = udp_demux (ip, ip_bcast, destin, src_port, dst_port, &udp_err);
1127
1128 if (!s) /* no demultiplexer found anything */
1129 {
1130 if (udp_err) /* error in udp_allsocs, don't send ICMP */
1131 return (NULL);
1132
1133 DEBUG_RX (NULL, ip);
1134
1135#if defined(USE_IPV6)
1136 if (!is_ip4 && !IN6_IS_ADDR_UNSPECIFIED(&in6addr_my_ip) &&
1137 !memcmp(&in6addr_my_ip, &ip6_dst, sizeof(in6addr_my_ip)))
1138 {
1139 if (!ip_bcast && src_port != DOM_DST_PORT)
1140 icmp6_unreach (ip6, 3);
1141
1142 if (ip_bcast)
1143 STAT (udpstats.udps_noportbcast++);
1144 else STAT (udpstats.udps_noport++);
1145 }
1146 else
1147#endif
1148 if (is_ip4 && my_ip_addr && _ip4_is_multihome_addr(destin))
1149 {
1150 if (!ip_bcast && /* not broadcast */
1151 src_port != DOM_DST_PORT) /* not a late reply from a nameserver */
1152 icmp_send_unreach (ip, ICMP_UNREACH_PORT);
1153
1154 if (ip_bcast)
1155 STAT (udpstats.udps_noportbcast++);
1156 else STAT (udpstats.udps_noport++);
1157 }
1158 return (NULL);
1159 }
1160
1161 if (is_ip4)
1162 {
1163 if (udp->checksum && (s->sockmode & SOCK_MODE_UDPCHK) &&
1164 !udp_checksum (ip,udp,len))
1165 return (s);
1166 }
1167#if defined(USE_IPV6)
1168 else
1169 {
1170 if (_ip6_udp_checksum(ip6,udp,len)) /* checksums are compulsary */
1171 return (s);
1172 }
1173#endif
1174
1175
1176 /* Process user data. 0-byte probe is legal for s->protoHandler.
1177 */
1178 data = (const BYTE*) (udp+1);
1179 len -= sizeof(*udp);
1180
1181 if (s->protoHandler)
1182 {
1183 if (is_ip4)
1184 {
1185 tcp_PseudoHeader ph = { 0,0,0,0,0,0 };
1186 ph.src = ip->source; /* only source needed by protoHandler */
1187 (*s->protoHandler) (s, data, len, &ph, udp);
1188 }
1189#if defined(USE_IPV6)
1190 else
1191 {
1192 tcp_PseudoHeader6 ph6;
1193 memset (&ph6, 0, sizeof(ph6));
1194 memcpy (&ph6.src, &ip6->source, sizeof(ph6.src));
1195 (*s->protoHandler) (s, data, len, &ph6, udp);
1196 }
1197#endif
1198 }
1199 else if (len > 0 /* && s->rx_datalen == 0 !! overwrite current data */)
1200 {
1201 if (len > s->max_rx_data) /* truncate data :-( */
1202 {
1203 len = s->max_rx_data;
1204 STAT (udpstats.udps_fullsock++);
1205 }
1206 memcpy (s->rx_data, data, len);
1207 s->rx_datalen = len;
1208 }
1209 return (s);
1210}
1211
1212
1213#if !defined(USE_UDP_ONLY)
1218void tcp_Retransmitter (BOOL force)
1219{
1220 _tcp_Socket *s, *next;
1221
1222 static DWORD timeout = 0UL;
1223
1224 /* do this once per tcp_RETRAN_TIME
1225 */
1226 if (!force && timeout && !chk_timeout(timeout))
1227 return;
1228
1229 timeout = set_timeout (tcp_RETRAN_TIME);
1230
1231 for (s = _tcp_allsocs; s; s = next)
1232 {
1233 next = s->next;
1234
1235 /* Check on ARP resolve status, GvB 2002-09
1236 */
1237 if (s->state == tcp_StateRESOLVE)
1238 {
1239 if (_arp_lookup(s->hisaddr, &s->his_ethaddr)) /* Success */
1240 {
1241 UINT rtt, MTU;
1242
1243 s->state = tcp_StateSYNSENT;
1244 s->timeout = set_timeout (tcp_LONGTIMEOUT);
1245 TCP_SEND (s); /* send opening SYN */
1246
1247 /* find previous RTT replacing RTT set in tcp_send() above
1248 */
1249 if (tcp_rtt_get(s, &rtt, &MTU))
1250 s->rtt_time = set_timeout (rtt);
1251 else s->rtt_time = set_timeout (tcp_OPEN_TO);
1252 }
1253
1254 /* If ARP no longer pending (timed out), hence we abort
1255 */
1256 else if (!_arp_lookup_pending(s->hisaddr)) /* ARP timed out */
1257 {
1258 tcp_no_arp (s);
1259 next = TCP_ABORT (s);
1260 }
1261 continue; /* don't do anything more on this TCB */
1262 }
1263
1264 /* possible to be closed with Rx-data still queued
1265 */
1266 if (s->state == tcp_StateCLOSED)
1267 {
1268 if (s->rx_datalen == 0)
1269 {
1270 maybe_reuse_localport (s);
1271 next = _tcp_unthread (s, TRUE);
1272 }
1273 continue;
1274 }
1275
1276 /* Need to send a window update? Because we advertised a 0 window
1277 * in a previous _tcp_send() (but only in ESTAB state).
1278 */
1279 if ((s->locflags & LF_WINUPDATE) && sock_rbleft((sock_type*)s) > 0)
1280 {
1281 STAT (tcpstats.tcps_sndwinup++);
1282 s->locflags &= ~LF_WINUPDATE;
1283 s->flags |= tcp_FlagACK;
1284 TCP_SEND (s);
1285 }
1286
1287 else if (s->tx_datalen > 0 || s->unhappy || s->karn_count == 1)
1288 {
1289 if (chk_timeout(s->rtt_time)) /* retransmission timeout */
1290 {
1291 s->rtt_time = 0UL; /* stop RTT timer */
1292
1293 TRACE_CONSOLE (3, "Regular retran TO set unacked back to "
1294 "0 from %ld\n", s->send_una);
1295
1296 /* strategy handles closed windows. JD + EE
1297 */
1298 if (s->window == 0 && s->karn_count == 2)
1299 s->window = 1;
1300
1301 if (s->karn_count == 0)
1302 {
1303 /* Simple "Slow start" algorithm:
1304 * Use the backed off RTO - implied, no code necessary.
1305 * Reduce the congestion window by 25%
1306 */
1307 unsigned cwindow = ((unsigned)(s->cwindow + 1) * 3) >> 2;
1308
1309 s->cwindow = (BYTE) cwindow;
1310 if (s->cwindow == 0)
1311 s->cwindow = 1;
1312
1313 s->wwindow = 0;
1314#if 0
1316 s->send_ssthresh = s->cwindow * s->max_seg;
1317#endif
1318 /* if really did timeout
1319 */
1320 s->karn_count = 2;
1321 s->send_una = 0;
1322 }
1323
1324 if (s->tx_datalen > 0)
1325 {
1326 s->flags |= (tcp_FlagPUSH | tcp_FlagACK);
1327 if (s->cwindow > 1)
1328 s->cwindow--;
1329 }
1330
1331 if (s->unhappy)
1332 STAT (tcpstats.tcps_rexmttimeo++); /* Normal re-xmit */
1333 else if (s->flags & tcp_FlagACK)
1334 STAT (tcpstats.tcps_delack++);
1335
1336 TCP_SEND (s);
1337
1338 if (s->state == tcp_StateSYNSENT)
1339 {
1342 TRACE_FILE ("SYN (re)sent in tcp_Retransmitter(), rtt_time %ld\n",
1343 get_timediff(s->rtt_time,set_timeout(0)));
1344 }
1345 }
1346
1347 /* handle inactive tcp timeouts (not sending data)
1348 */
1349 else if (chk_timeout(s->datatimer)) /* EE 99.08.23 */
1350 {
1351 next = TCP_ABORT (s);
1352 s->datatimer = 0UL;
1353 s->err_msg = _LANG ("Connection timed out - no data sent");
1354 }
1355 } /* end of retransmission strategy */
1356
1357
1358 /* handle inactive TCP timeouts (not received anything)
1359 */
1360 if (chk_timeout(s->inactive_to))
1361 {
1362 /* this baby has timed out. Don't do this again.
1363 */
1364 s->inactive_to = 0UL;
1365 s->err_msg = _LANG ("Timeout, nothing received");
1366 sock_close ((sock_type*)s);
1367 }
1368 else if (chk_timeout(s->timeout))
1369 {
1370 if (s->state == tcp_StateTIMEWT)
1371 {
1372 s->state = tcp_StateCLOSED;
1373 break;
1374 }
1375 if (s->state != tcp_StateESTAB && s->state != tcp_StateESTCL)
1376 {
1377 next = TCP_ABORT (s);
1378 s->err_msg = _LANG ("Timeout, aborting");
1379 break;
1380 }
1381 }
1382 }
1383}
1384#endif /* !USE_UDP_ONLY */
1385
1386
1395WORD W32_CALL tcp_tick (sock_type *s)
1396{
1397 static int tick_active = 0;
1398
1399 if (tick_active > 0)
1400 {
1401 TRACE_CONSOLE (1, "tcp_tick() reentered\n");
1402 return (s ? s->tcp.ip_type : 0);
1403 }
1404
1405 tick_active++;
1406
1407#if !defined(USE_UDP_ONLY)
1408 /*
1409 * Finish off dead sockets
1410 */
1411 if (s)
1412 {
1413 if (s->tcp.ip_type == TCP_PROTO &&
1414 s->tcp.state == tcp_StateCLOSED &&
1415 s->tcp.rx_datalen == 0)
1416 {
1417 _tcp_unthread (&s->tcp, TRUE);
1418 s->tcp.ip_type = 0; /* fail further I/O */
1419 }
1420 }
1421#endif
1422
1428 while (tick_active == 1)
1429 {
1430 WORD eth_type = 0;
1431 BOOL brdcast = FALSE;
1432 void *packet = _eth_arrived (&eth_type, &brdcast);
1433
1434 if (!packet) /* packet points to network layer protocol */
1435 break;
1436
1437 switch (eth_type)
1438 {
1439 case IP4_TYPE:
1440 _ip4_handler ((in_Header*)packet, brdcast);
1441 break;
1442
1443 case ARP_TYPE:
1444 _arp_handler ((arp_Header*)packet, brdcast);
1445 break;
1446#if 0
1447 case RARP_TYPE:
1448 _rarp_handler ((rarp_Header*)packet, brdcast);
1449 break;
1450#endif
1451
1452#if defined(USE_IPV6)
1453 case IP6_TYPE:
1454 _ip6_handler ((in6_Header*)packet, brdcast);
1455 break;
1456#endif
1457
1458#if defined(USE_PPPOE)
1459 case PPPOE_DISC_TYPE:
1460 case PPPOE_SESS_TYPE:
1461 pppoe_handler ((pppoe_Packet*)packet);
1462 break;
1463#endif
1464
1465 default:
1466#if defined(USE_DEBUG)
1467 dbug_printf ("\n%s (%d): Unhandled Rx packet, type %04X, "
1468 "broadcast %d\n", __FILE__, __LINE__,
1469 intel16(eth_type), brdcast);
1470#endif
1471 break;
1472
1473 /* RARP is only used during boot. Not needed here */
1474 }
1475 _eth_free (packet);
1476 }
1477
1478#if !defined(USE_UDP_ONLY)
1479 tcp_Retransmitter (FALSE); /* check for our outstanding packets */
1480#endif
1481
1482 daemon_run(); /* check and optionally run background processes */
1483
1484 --tick_active;
1485 return (s ? s->tcp.ip_type : 0);
1486}
1487
1496static int udp_write (_udp_Socket *s, const BYTE *data, int len)
1497{
1498 struct ip4_packet *ip4_pkt = NULL;
1499
1500#if defined(USE_IPV6)
1501 struct ip6_packet *ip6_pkt = NULL;
1502 struct in6_Header *ip6 = NULL;
1503#endif
1504
1505 mac_address *dst = (_pktserial ? NULL : &s->his_ethaddr);
1506 in_Header *ip4 = NULL;
1507 udp_Header *udp;
1508
1509#if defined(USE_IPV6)
1510 if (s->is_ip6)
1511 {
1512 ip6_pkt = (struct ip6_packet*) _eth_formatpacket (dst, IP6_TYPE);
1513 ip6 = &ip6_pkt->in;
1514 udp = &ip6_pkt->udp;
1515 }
1516 else
1517#endif
1518 {
1519 ip4_pkt = (struct ip4_packet*) _eth_formatpacket (dst, IP4_TYPE);
1520 ip4 = &ip4_pkt->in;
1521 udp = &ip4_pkt->udp;
1522 }
1523
1524 /* build udp header
1525 */
1526 udp->srcPort = intel16 (s->myport);
1527 udp->dstPort = intel16 (s->hisport);
1528 udp->checksum = 0;
1529 udp->length = intel16 (sizeof(*udp)+len);
1530
1531#if defined(USE_IPV6)
1532 if (s->is_ip6)
1533 {
1534 memcpy (&ip6->source, &in6addr_my_ip, sizeof(ip6->source));
1535 memcpy (&ip6->destination, &s->his6addr, sizeof(ip6->destination));
1536 memcpy (ip6_pkt+1, data, len); /* copy 'data' to 'ip6_pkt->data[]' */
1537 udp->checksum = _ip6_checksum (ip6, IP6_NEXT_UDP, udp, sizeof(*udp)+len);
1538 if (!IP6_OUTPUT(ip6, &ip6->source, &ip6->destination, IP6_NEXT_UDP,
1539 sizeof(*udp)+len, 0, s))
1540 return (-1);
1541 return (len);
1542 }
1543 else
1544#endif
1545 {
1546 tcp_PseudoHeader ph;
1547
1548 memset (&ph, 0, sizeof(ph));
1549 ph.src = intel (s->myaddr);
1550 ph.dst = intel (s->hisaddr);
1551 if (len > 0)
1552 memcpy (ip4_pkt+1, data, len); /* copy 'data' to 'ip4_pkt->data[]' */
1553
1554 if (s->sockmode & SOCK_MODE_UDPCHK)
1555 {
1556 ph.protocol = UDP_PROTO;
1557 ph.length = udp->length;
1558 ph.checksum = CHECKSUM (udp, sizeof(*udp)+len);
1559 udp->checksum = ~CHECKSUM (&ph, sizeof(ph));
1560 }
1561 if (!IP4_OUTPUT(ip4, ph.src, ph.dst, UDP_PROTO, s->ttl,
1562 (BYTE)_default_tos, 0, sizeof(*udp)+len, s))
1563 return (-1);
1564 return (len);
1565 }
1566}
1567
1574static int udp_read (_udp_Socket *s, BYTE *buf, int maxlen)
1575{
1576 int len = s->rx_datalen;
1577
1578 if (maxlen < 0)
1579 maxlen = INT_MAX;
1580
1581 if (len > maxlen)
1582 len = maxlen;
1583
1584 if (len > 0)
1585 {
1586 if (buf)
1587 memcpy (buf, s->rx_data, len);
1588 s->rx_datalen -= len;
1589 if (s->rx_datalen > 0)
1590 memmove (s->rx_data, s->rx_data+len, s->rx_datalen);
1591 }
1592 return (len);
1593}
1594
1599static void sock_reduce_mss (sock_type *s, WORD MTU)
1600{
1601 if (s->tcp.ip_type == TCP_PROTO)
1602 {
1603#if !defined(USE_UDP_ONLY)
1604 _tcp_Socket *tcp = &s->tcp;
1605
1606 if (MTU)
1607 tcp->max_seg = _mtu - TCP_OVERHEAD;
1608 else if (tcp->max_seg > MSS_MIN)
1609 tcp->max_seg -= MSS_REDUCE;
1610 tcp->max_seg = min (max(MSS_MIN, tcp->max_seg), _mss);
1611
1612 TRACE_FILE ("MSS for %s reduced to %u\n",
1613 _inet_ntoa(NULL,tcp->hisaddr), tcp->max_seg);
1614#endif
1615 }
1616 else
1617 {
1618 /* doesn't use MSS yet (always MTU-28) */
1619 }
1620 ARGSUSED (MTU);
1621}
1622
1628void _udp_cancel (const in_Header *ip, int icmp_type, int icmp_code,
1629 const char *msg, const void *arg) /* use a var-arg here ? */
1630{
1631 WORD src_port, dst_port;
1632 BOOL passive = FALSE;
1633 int len = in_GetHdrLen (ip);
1634 udp_Header *udp = (udp_Header*) ((BYTE*)ip + len);
1635 _udp_Socket *s;
1636
1637 src_port = intel16 (udp->srcPort);
1638 dst_port = intel16 (udp->dstPort);
1639
1640 for (s = _udp_allsocs; s; s = s->next) /* demux to active sockets */
1641 {
1642 if (s->hisport > 0 &&
1643 dst_port == s->hisport && src_port == s->myport &&
1644 intel(ip->destination) == s->hisaddr)
1645 break;
1646 }
1647
1648 if (!s) /* check passive sockets */
1649 {
1650 passive = TRUE;
1651 for (s = _udp_allsocs; s; s = s->next)
1652 if (s->hisport == 0 && dst_port == s->myport)
1653 break;
1654 }
1655
1656 if (s)
1657 {
1658 SET_ERR_MSG (s, msg);
1659
1660 /* handle ICMP-errors on active sockets
1661 */
1662 if (icmp_type == ICMP_REDIRECT && !passive)
1663 {
1664 DWORD gateway;
1665
1666 WATT_ASSERT (arg != NULL);
1667 gateway = *(DWORD*)arg;
1668 _ip_recursion = 1;
1669 _arp_resolve (gateway, &s->his_ethaddr);
1670 _ip_recursion = 0;
1671 }
1672 else if (icmp_type == ICMP_UNREACH && icmp_code == ICMP_UNREACH_NEEDFRAG && !passive)
1673 {
1674 WORD next_mtu;
1675
1676 WATT_ASSERT (arg != NULL);
1677 next_mtu = *(WORD*) arg;
1678 sock_reduce_mss ((sock_type*)s, next_mtu);
1679 }
1680 else if (icmp_type != ICMP_TIMXCEED && !passive)
1681 {
1682 /* UDP isn't sturdy, close it on 1st ICMP error
1683 */
1684 SET_ERR_MSG (s, _LANG("Port unreachable"));
1685 s->ip_type = 0;
1686 s->locflags |= LF_GOT_ICMP;
1687 udp_close (s);
1688 }
1689 if (s->icmp_callb) /* tell the socket layer about it */
1690 (*s->icmp_callb) (s, icmp_type, icmp_code);
1691 }
1692 else
1693 {
1694 /* tell the INADDR_ANY sockets about it
1695 */
1696 for (s = _udp_allsocs; s; s = s->next)
1697 {
1698 if (s->icmp_callb)
1699 (*s->icmp_callb) (s, icmp_type, icmp_code);
1700 }
1701 }
1702}
1703
1704#if !defined(USE_UDP_ONLY)
1705/*
1706 * Default is to terminate socket on receiving 2nd
1707 * ICMP error. Use sock_sturdy() to change.
1708 */
1709static BOOL tcp_stress_test (_tcp_Socket *s, const char *msg)
1710{
1711 if (s->stress++ > s->rigid && s->rigid < 100) /* halt it */
1712 {
1713 SET_ERR_MSG (s, msg);
1714 s->rx_datalen = 0;
1715 s->tx_datalen = 0;
1716 s->unhappy = FALSE;
1717 s->locflags |= LF_GOT_ICMP;
1718 return (FALSE);
1719 }
1720 return (TRUE);
1721}
1722
1734void _tcp_cancel (const in_Header *ip, int icmp_type, int icmp_code,
1735 const char *msg, const void *arg) /* use a var-arg here ? */
1736{
1737 tcp_Header *tcp = (tcp_Header*) ((BYTE*)ip + in_GetHdrLen (ip));
1738 _tcp_Socket *s;
1739 DWORD gateway;
1740 WORD next_mtu;
1741 WORD src_port = intel16 (tcp->srcPort);
1742 WORD dst_port = intel16 (tcp->dstPort);
1743
1744 /* demux to active sockets (passive cannot get ICMP)
1745 */
1746 for (s = _tcp_allsocs; s; s = s->next)
1747 {
1748 if (src_port != s->myport || dst_port != s->hisport ||
1749 intel(ip->destination) != s->hisaddr)
1750 continue;
1751
1752 switch (icmp_type)
1753 {
1754 case ICMP_TIMXCEED:
1755 if (s->ttl < 255)
1756 s->ttl++;
1757 if (tcp_stress_test(s,msg))
1758 goto quench_it;
1759 TCP_ABORT (s);
1760 break;
1761
1762 case ICMP_UNREACH:
1763 if (icmp_code == ICMP_UNREACH_NEEDFRAG)
1764 {
1765 WATT_ASSERT (arg != NULL);
1766 next_mtu = *(WORD*) arg;
1767
1768 /* This should never happen since we normally don't send
1769 * with "Don't Fragment" set. As an optimisation we should
1770 * maybe reduce 'max_seg' for all sockets to this destination.
1771 */
1772 sock_reduce_mss ((sock_type*)s, next_mtu);
1773 break;
1774 }
1775 /* Other types are "fatal"
1776 */
1777 if (!tcp_stress_test(s,msg))
1778 {
1779 TCP_ABORT (s);
1780 break;
1781 }
1782 /* FALLTHROUGH */
1783
1784 case ICMP_SOURCEQUENCH:
1785 quench_it:
1786 s->cwindow = 1; /* slow-down tx-rate */
1787 s->wwindow = 1;
1788 s->vj_sa <<= 2;
1789 s->vj_sd <<= 2;
1790 s->rto <<= 2;
1791 tcp_rtt_add (s, s->rto, _mtu);
1792 break;
1793
1794 case ICMP_REDIRECT:
1795 /* don't bother handling redirect if we're closing
1796 */
1797 if (s->state < tcp_StateFINWT1)
1798 {
1799 WATT_ASSERT (arg != NULL);
1800 gateway = *(DWORD*)arg;
1801 SET_ERR_MSG (s, msg);
1802 _ip_recursion = 1;
1803 _arp_resolve (gateway, &s->his_ethaddr);
1804 _ip_recursion = 0;
1805 }
1806 break;
1807
1808 case ICMP_PARAMPROB:
1809 SET_ERR_MSG (s, msg);
1810 TCP_ABORT (s);
1811 break;
1812 }
1813 if (s->icmp_callb)
1814 (*s->icmp_callb) (s, icmp_type, icmp_code); /* Notify BSD-socket */
1815
1816 return; /* One ICMP message should only match one TCP socket */
1817 }
1818}
1819
1825static int tcp_read (_tcp_Socket *s, BYTE *buf, int maxlen)
1826{
1827 int len;
1828
1829 if (maxlen < 0)
1830 maxlen = INT_MAX;
1831
1832 len = min (maxlen, s->rx_datalen);
1833
1834 if (len > 0)
1835 {
1836 int to_move;
1837
1838 if (buf)
1839 memcpy (buf, s->rx_data, len);
1840 s->rx_datalen -= len;
1841
1842 to_move = s->rx_datalen;
1843 if (s->missed_seq[0] != s->missed_seq[1])
1844 to_move += s->missed_seq[1] - s->recv_next;
1845
1846 if (to_move > 0)
1847 {
1848 memmove (s->rx_data, s->rx_data + len, to_move);
1849
1850 TCP_SENDSOON (s); /* delayed ACK */
1851 }
1852 else
1853 tcp_upd_win (s, __LINE__);
1854 }
1855 else if (s->state == tcp_StateCLOSWT)
1856 _tcp_close (s);
1857
1858 /* Added new EOF condition (GV, 11-Oct-2003)
1859 */
1860 if (len == 0 && (s->locflags & LF_GOT_FIN))
1861 return (-1);
1862 return (len);
1863}
1864
1871static int tcp_write (_tcp_Socket *s, const BYTE *data, UINT len)
1872{
1873 UINT room;
1874 BYTE push = 0;
1875
1876 if (s->state != tcp_StateESTAB)
1877 return (0);
1878
1879 room = s->max_tx_data - s->tx_datalen - 1;
1880 if (len > room)
1881 {
1882 len = room;
1883 if (len > 0) /* partial write, don't set PUSH bit yet */
1884 {
1885 push = s->flags & tcp_FlagPUSH;
1886 s->flags &= ~tcp_FlagPUSH;
1887 }
1888 }
1889
1890 if (len > 0)
1891 {
1892 int rc = 0;
1893
1894#if defined(USE_DEBUG)
1895 _sock_check_tcp_buffers (s);
1896#endif
1897
1898 memcpy (s->tx_data + s->tx_datalen, data, len);
1899 s->tx_datalen += len;
1900
1901 s->unhappy = TRUE; /* redundant because we have outstanding data */
1902 if (sock_data_timeout)
1903 s->datatimer = set_timeout (1000*sock_data_timeout); /* EE 99.08.23 */
1904 else s->datatimer = 0;
1905
1906 if ((s->sockmode & SOCK_MODE_LOCAL) && /* queue up data */
1907 len < room) /* only flush if buffer is full */
1908 return (len);
1909
1910 if (!(s->sockmode & SOCK_MODE_NAGLE)) /* Nagle mode off */
1911 rc = TCP_SEND (s);
1912 else
1913 {
1914 /* Transmit if first segment or reached min (socket_MSS,MSS).
1915 */
1916 if (s->tx_datalen == len ||
1917 s->tx_datalen - s->send_una >= min(s->max_seg,_mss))
1918 rc = TCP_SEND (s);
1919 else rc = TCP_SENDSOON (s);
1920 }
1921
1922 s->flags |= push;
1923
1924 if (rc < 0)
1925 return (-1);
1926 }
1927 return (len);
1928}
1929
1930
1936static _tcp_Socket *tcp_findseq (const in_Header *ip, const tcp_Header *tcp)
1937{
1938 _tcp_Socket *s;
1939 DWORD dst_host = intel (ip->destination);
1940 DWORD ack_num = intel (tcp->acknum);
1941 WORD dst_port = intel16 (tcp->dstPort);
1942
1943 for (s = _tcp_allsocs; s; s = s->next)
1944 {
1945 if (s->hisport != 0 &&
1946 dst_host == s->myaddr &&
1947 dst_port == s->myport &&
1948 ack_num == s->send_next+1)
1949 break;
1950 }
1951 return (s);
1952}
1953
1957static void tcp_sockreset (_tcp_Socket *s, BOOL proxy)
1958{
1959 const char *str = proxy ? "Proxy reset connection"
1960 : "Remote reset connection";
1961
1962 if (debug_on)
1963 outsnl (_LANG(str));
1964
1965 if (s->state == tcp_StateSYNREC)
1966 STAT (tcpstats.tcps_conndrops++); /* embryonic connection drop */
1967 else STAT (tcpstats.tcps_drops++);
1968
1969 if (s->state != tcp_StateCLOSED && s->state != tcp_StateLASTACK)
1970 s->rx_datalen = 0;
1971
1972 s->missed_seq[0] = s->missed_seq[1] = 0; /* discard buffered out-of-order */
1973
1974 s->tx_datalen = 0; /* Empty Tx buffer */
1975
1976 if (s->locflags & LF_IS_SERVER)
1977 {
1978 CLR_PEER_MAC_ADDR (s);
1979 s->cwindow = 1;
1980 s->rtt_time = 0UL;
1981 s->unhappy = FALSE;
1982 s->hisport = 0;
1983 s->hisaddr = 0UL;
1984 s->locflags &= ~(LF_WINUPDATE | LF_KEEPALIVE | LF_GOT_FIN | LF_GOT_ICMP);
1985
1986 s->datatimer = 0UL;
1987 s->inactive_to = 0;
1988 s->timeout = 0;
1989 s->karn_count = 0;
1990 s->state = tcp_StateLISTEN;
1991 TRACE_FILE ("tcp_sockreset(): continue to LISTEN\n");
1992 }
1993 else
1994 {
1995 s->err_msg = _LANG (str);
1996 s->state = tcp_StateCLOSED;
1997 s->ip_type = 0; /* 2001.1.18 - make it fail tcp_tick() */
1998
1999#if defined(USE_BSD_API)
2000 if (_bsd_socket_hook)
2001 (*_bsd_socket_hook) (BSO_RST_CALLBACK, s);
2002#endif
2003 _tcp_unthread (s, TRUE);
2004 }
2005}
2006
2011static void tcp_no_arp (_tcp_Socket *s)
2012{
2013 s->err_msg = _LANG ("No ARP reply");
2014 STAT (ip4stats.ips_noroute++);
2015
2016#if defined(USE_BSD_API)
2017 if (_bsd_socket_hook)
2018 {
2019 Socket *sock = (Socket*) (*_bsd_socket_hook) (BSO_FIND_SOCK, s);
2020
2021 if (sock) /* do a "read-wakeup" on the SOCK_STREAM socket */
2022 {
2023 sock->so_state |= SS_ISDISCONNECTING;
2024 sock->so_error = EHOSTUNREACH; /* !! Or ETIMEDOUT? */
2025 }
2026 }
2027#endif
2028}
2029
2034static BOOL tcp_checksum (const in_Header *ip, const tcp_Header *tcp, int len)
2035{
2036 tcp_PseudoHeader ph = { 0,0,0,0,0,0 };
2037
2038 ph.src = ip->source;
2039 ph.dst = ip->destination;
2040 ph.protocol = TCP_PROTO;
2041 ph.length = intel16 (len);
2042 ph.checksum = CHECKSUM (tcp, len);
2043
2044 if (CHECKSUM(&ph,sizeof(ph)) != 0xFFFF)
2045 {
2046 STAT (tcpstats.tcps_rcvbadsum++);
2047 TRACE_CONSOLE (1, "Bad tcp checksum. ");
2048 TRACE_FILE ("Bad tcp checksum\n");
2049 return (FALSE);
2050 }
2051 return (TRUE);
2052}
2053
2058static void tcp_rtt_win (_tcp_Socket *s)
2059{
2060 DWORD timeout;
2061
2062 /* update our retransmission stuff (Karn algorithm)
2063 */
2064 if (s->karn_count == 2) /* Wake up from slow-start */
2065 {
2066 TRACE_CONSOLE (2, "Finally got it safely zapped from %ld to ???\n",
2067 s->send_una);
2068 }
2069 else if (s->vj_last) /* We expect an immediate response */
2070 {
2071 long dT; /* Time (msec) since last (re)transmission */
2072 DWORD now;
2073
2074 chk_timeout (0UL); /* Update date/date_ms */
2075 now = set_timeout (0);
2076
2077#if 0
2078 if (s->ts_echo && s->ts_echo >= s->ts_sent)
2079 dT = get_timediff (s->ts_echo, s->ts_sent) >> 1;
2080 else
2081#else
2082 dT = get_timediff (now, s->vj_last);
2083#endif
2084
2085 if (dT >= 0)
2086 {
2087 dT -= (DWORD)(s->vj_sa >> 3);
2088 s->vj_sa += dT;
2089
2090 if (dT < 0)
2091 dT = -dT;
2092
2093 dT -= (s->vj_sd >> 2);
2094 s->vj_sd += dT; /* vj_sd = RTTVAR, rtt variance */
2095
2096 if (s->vj_sa > tcp_MAX_VJSA) /* vj_sa = SRTT, smoothed RTT */
2097 s->vj_sa = tcp_MAX_VJSA;
2098 if (s->vj_sd > tcp_MAX_VJSD)
2099 s->vj_sd = tcp_MAX_VJSD;
2100 }
2101
2102 /* only recompute RTT hence RTO after success
2103 */
2104 s->rto = tcp_RTO_BASE + (((s->vj_sa >> 2) + (s->vj_sd)) >> 1);
2105
2106 tcp_rtt_add (s, s->rto, _mtu);
2107
2108 TRACE_CONSOLE (2, "RTO %u sa %lu sd %lu cwindow %u"
2109 " wwindow %u unacked %ld\n",
2110 s->rto, (u_long)s->vj_sa, (u_long)s->vj_sd, s->cwindow,
2111 s->wwindow, s->send_una);
2112 }
2113
2114 s->karn_count = 0;
2115 if (s->wwindow != 255)
2116 {
2119#if 0
2120 if (s->cwindow * s->max_seg < s->send_ssthresh)
2121 s->cwindow++;
2122#else
2123
2124 /* A. Iljasov (iljasov@oduurl.ru) suggested this pre-increment
2125 */
2126 if (++s->wwindow >= s->cwindow)
2127 {
2128 if (s->cwindow != 255)
2129 s->cwindow++;
2130 s->wwindow = 0; /* mdurkin -- added 95.05.02 */
2131 }
2132#endif
2133 }
2134
2135 /* Restart RTT timer or postpone retransmission based on
2136 * calculated RTO. Make sure date/date_ms variables are updated
2137 * close to midnight.
2138 */
2139 chk_timeout (0UL);
2140 timeout = set_timeout (s->rto + tcp_RTO_ADD);
2141
2142 if (s->rtt_time == 0UL || cmp_timers(s->rtt_time,timeout) < 0)
2143 s->rtt_time = timeout;
2144
2145 s->datatimer = 0UL; /* resetting tx-timer, EE 99.08.23 */
2146}
2147
2151static void tcp_upd_win (_tcp_Socket *s, unsigned line)
2152{
2153 UINT winfree = s->max_rx_data - (UINT)s->rx_datalen;
2154
2155 if (winfree < s->max_seg/2)
2156 {
2157 _tcp_send (s, __FILE__, line); /* update window now */
2158 TRACE_CONSOLE (2, "tcp_upd_win(%d): win-free %u\n", line, winfree);
2159 }
2160}
2161
2170static __inline int tcp_opt_maxsegment (const _tcp_Socket *s, BYTE *opt)
2171{
2172 *opt++ = TCPOPT_MAXSEG; /* option: MAXSEG,length,MSS */
2173 *opt++ = 4;
2174 *(WORD*) opt = intel16 ((WORD)s->max_seg);
2175 return (4);
2176}
2177
2183static __inline int tcp_opt_timestamp (_tcp_Socket *s, BYTE *opt, DWORD ts_echo)
2184{
2185 DWORD ts_now = set_timeout (0) - start_time; /* TSval */
2186 BYTE *start = opt;
2187
2188 *opt++ = TCPOPT_NOP; /* NOP,NOP,TIMESTAMP,length,TSval,TSecho */
2189 *opt++ = TCPOPT_NOP; /* ---------- = 10 ------------- */
2190 *opt++ = TCPOPT_TIMESTAMP;
2191 *opt++ = 10;
2192 *(DWORD*) opt = intel (ts_now);
2193 opt += sizeof(ts_now);
2194 *(DWORD*) opt = intel (ts_echo);
2195 opt += sizeof(ts_echo);
2196 s->ts_sent = ts_now; /* remember TSval */
2197 return (opt - start); /* 20 bytes */
2198}
2199
2200#if defined(USE_TCP_MD5)
2204static BYTE *sign_opt;
2205
2206/*
2207 * Make this 'gcc' warning go away:
2208 * In function 'tcp_opt_md5_sign',
2209 * pctcp.c:2177:10: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
2210 */
2211
2212#if !defined(__clang__)
2213 W32_GCC_PRAGMA (GCC diagnostic push) \
2214 W32_GCC_PRAGMA (GCC diagnostic ignored "-Wstringop-overflow=")
2215#endif
2216
2217static __inline int tcp_opt_md5_sign (BYTE *opt)
2218{
2219 *opt++ = TCPOPT_SIGNATURE; /* option: 19,length,MD5-signature,NOP,NOP */
2220 *opt++ = 2+TCPOPT_SIGN_LEN;
2221 sign_opt = opt; /* remember for finalise_md5_sign() */
2222 opt += TCPOPT_SIGN_LEN;
2223 *opt++ = TCPOPT_NOP;
2224 *opt++ = TCPOPT_NOP;
2225 return (4+TCPOPT_SIGN_LEN);
2226}
2227
2228#if !defined(__clang__)
2229 W32_GCC_PRAGMA (GCC diagnostic pop)
2230#endif
2231
2232static __inline void finalise_md5_sign (const in_Header *ip,
2233 const tcp_Header *tcp,
2234 WORD tcp_len, const char *secret)
2235{
2236 if (secret && sign_opt)
2237 make_md5_signature (ip, tcp, tcp_len, secret, sign_opt);
2238 sign_opt = NULL;
2239}
2240#endif
2241
2242
2243#if defined(NOT_USED_YET)
2247static __inline int tcp_opt_padding (BYTE *opt, int len)
2248{
2249 int pad = len % 4;
2250
2251 if (pad > 0)
2252 *opt++ = TCPOPT_NOP;
2253 if (pad > 1)
2254 *opt++ = TCPOPT_NOP;
2255 if (pad > 2)
2256 *opt++ = TCPOPT_NOP;
2257 if (pad > 3)
2258 *opt++ = TCPOPT_NOP;
2259 return (pad);
2260}
2261
2262static __inline int tcp_opt_winscale (const _tcp_Socket *s, BYTE *opt)
2263{
2264 *opt++ = TCPOPT_WINDOW; /* option: WINDOW,length,wscale */
2265 *opt++ = 3;
2266 *opt = s->tx_wscale;
2267 return (4);
2268}
2269
2270static __inline int tcp_opt_sack_ok (const _tcp_Socket *s, BYTE *opt)
2271{
2272 *opt++ = TCPOPT_SACKOK;
2273 *opt++ = 2;
2274 *opt++ = TCPOPT_NOP;
2275 *opt++ = TCPOPT_NOP;
2276 return (4);
2277}
2278
2279static __inline int tcp_opt_sack (const _tcp_Socket *s, BYTE *opt,
2280 const struct SACK_list *sack)
2281{
2282 int i, len = 2 + 8 * sack->num_blk;
2283
2284 *opt++ = TCPOPT_SACK; /* option: SACK,length,left,right,.. */
2285 *opt++ = len;
2286 for (i = 0; i < sack->num_blk; i++)
2287 {
2288 *(DWORD*) opt = intel (sack->list[i].left_edge);
2289 opt += sizeof(DWORD);
2290 *(DWORD*) opt = intel (sack->list[i].right_edge);
2291 opt += sizeof(DWORD);
2292 }
2293 return (len + tcp_opt_padding(opt,len));
2294}
2295#endif /* NOT_USED_YET */
2296
2297
2301static __inline int tcp_options (_tcp_Socket *s, BYTE *opt, BOOL is_syn)
2302{
2303 int len = 0;
2304
2305 if (s->locflags & LF_NOOPT) /* we suppress options */
2306 return (0);
2307
2308 if (is_syn)
2309 {
2310 len = tcp_opt_maxsegment (s, opt);
2311
2312 if (tcp_opt_ts)
2313 len += tcp_opt_timestamp (s, opt+len, 0UL);
2314#if 0
2315 if (s->locflags & LF_REQ_SCALE)
2316 len += tcp_opt_winscale (s, opt+len);
2317 if (tcp_opt_sack)
2318 len += tcp_opt_sack_ok (s, opt+len);
2319#endif
2320 }
2321 else if (tcp_opt_ts &&
2322 !(s->flags & (tcp_FlagFIN|tcp_FlagRST)) &&
2323 (s->locflags & LF_USE_TSTAMP))
2324 {
2325 /* We got a TS option in a previous SYN or SYN-ACK.
2326 * Echo it if "tcp.opt.ts = 1" and not sending a FIN/RST.
2327 */
2328 len = tcp_opt_timestamp (s, opt, s->ts_recent);
2329 s->locflags &= ~LF_USE_TSTAMP; /* don't echo this again */
2330 }
2331
2332#if defined(USE_TCP_MD5)
2333 if (s->secret)
2334 len += tcp_opt_md5_sign (opt+len);
2335#endif
2336
2337 WATT_ASSERT (len == 0 || (len % 4) == 0);
2338 return (len);
2339}
2340
2345int _tcp_send (_tcp_Socket *s, const char *file, unsigned line)
2346{
2347 struct tcp_pkt *pkt;
2348
2349#if defined(USE_IPV6)
2350 struct tcp6_pkt *pkt6;
2351 struct in6_Header *ip6 = NULL;
2352#endif
2353
2354 BOOL tx_ok;
2355 BYTE *data; /* where to copy user's data */
2356 mac_address *dst;
2357 in_Header *ip = NULL;
2358 tcp_Header *tcp;
2359 int send_tot_len = 0; /* count of data length we've sent */
2360 int send_data_len; /* how much data in this segment */
2361 int start_data; /* where data starts in tx-buffer */
2362 int send_tot_data; /* total amount of data to send */
2363 int tcp_len; /* total length of TCP segment */
2364 int opt_len; /* total length of TCP options */
2365 int pkt_num; /* 0 .. s->cwindow-1 */
2366 int rtt;
2367
2368 s->recent = 0;
2369 dst = (_pktserial ? NULL : &s->his_ethaddr);
2370
2371#if defined(USE_IPV6)
2372 if (s->is_ip6)
2373 {
2374 pkt6 = (struct tcp6_pkt*) _eth_formatpacket (dst, IP6_TYPE);
2375 ip6 = &pkt6->in;
2376 tcp = &pkt6->tcp;
2377 }
2378 else
2379#endif
2380 {
2381 pkt = (struct tcp_pkt*) _eth_formatpacket (dst, IP4_TYPE);
2382 ip = &pkt->in;
2383 tcp = &pkt->tcp;
2384 }
2385
2386 data = (BYTE*) (tcp+1); /* data starts here if no options */
2387
2388 if (s->karn_count == 2) /* doing slow-start */
2389 {
2390 send_tot_data = min (s->tx_datalen, s->window);
2391 start_data = 0;
2392 }
2393 else
2394 {
2395 /* Morten Terstrup <MorTer@dk-online.dk> found this signed bug
2396 */
2397 int size = min (s->tx_datalen, s->window);
2398
2399 send_tot_data = size - s->send_una;
2400 if (send_tot_data < 0)
2401 send_tot_data = 0;
2402 start_data = s->send_una; /* relative tx_data[] */
2403 }
2404
2405 /* step through our packets
2406 */
2407 for (pkt_num = 0; pkt_num < s->cwindow; pkt_num++)
2408 {
2409#if 1
2410 if (s->safetysig != SAFETY_TCP || s->safetytcp != SAFETY_TCP)
2411 {
2412 outsnl (_LANG("Error in _tcp_send()"));
2413 s->safetysig = s->safetytcp = SAFETY_TCP;
2414 return (0);
2415 }
2416#else
2417 WATT_ASSERT (s->safetysig == SAFETY_TCP); /* hard to find GoAhead bug! */
2418 WATT_ASSERT (s->safetytcp == SAFETY_TCP);
2419#endif
2420
2421 /* make tcp header
2422 */
2423 tcp->srcPort = intel16 (s->myport);
2424 tcp->dstPort = intel16 (s->hisport);
2425 tcp->seqnum = intel (s->send_next + start_data); /* unacked - no longer send_tot_len */
2426 tcp->acknum = intel (s->recv_next);
2427
2428 s->adv_win = s->max_rx_data - s->rx_datalen; /* Our new advertised recv window */
2429 tcp->window = intel16 ((WORD)s->adv_win);
2430 tcp->flags = (BYTE) (s->flags & ~tcp_FlagPUSH);
2431 tcp->unused = 0;
2432 tcp->checksum = 0;
2433 tcp->urgent = 0;
2434
2435 /* Insert any TCP options after header.
2436 */
2437 if (pkt_num == 0 && (s->flags & tcp_FlagSYN) == tcp_FlagSYN)
2438 {
2439 opt_len = tcp_options (s, data, TRUE);
2440 send_data_len = 0; /* no data, only options */
2441 }
2442 else
2443 {
2444 int data_free;
2445
2446 opt_len = tcp_options (s, data, FALSE);
2447 data_free = s->max_seg - opt_len;
2448 if (data_free < 0)
2449 data_free = 0;
2450 send_data_len = min (send_tot_data, data_free);
2451 }
2452
2453 tcp_len = sizeof(*tcp) + opt_len; /* TCP header length */
2454 data += opt_len;
2455 tcp->offset = tcp_len/4; /* # of 32-bit dwords */
2456
2457 if (send_data_len > 0) /* non-SYN packets with data */
2458 {
2459 tcp_len += send_data_len;
2460 if (s->tx_queuelen)
2461 memcpy (data, s->tx_queue+start_data, send_data_len);
2462 else memcpy (data, s->tx_data +start_data, send_data_len);
2463
2464 if (send_data_len == send_tot_data &&
2465 (s->flags & tcp_FlagPUSH))
2466 {
2467 /* Set PUSH bit on last segment.
2468 */
2469 tcp->flags |= tcp_FlagPUSH;
2470 s->flags &= ~tcp_FlagPUSH;
2471 }
2472 }
2473
2474#if defined(USE_TCP_MD5)
2475 finalise_md5_sign (ip, tcp, tcp_len-sizeof(*tcp), s->secret);
2476#endif
2477
2478 /* Send using _ip?_output()
2479 */
2480#if defined(USE_IPV6)
2481 if (s->is_ip6)
2482 {
2483 memcpy (&ip6->source, &s->my6addr, sizeof(ip6->source));
2484 memcpy (&ip6->destination, &s->his6addr, sizeof(ip6->destination));
2485 tcp->checksum = _ip6_checksum (ip6, IP6_NEXT_TCP, tcp, tcp_len);
2486 tx_ok = _ip6_output (ip6, &ip6->source, &ip6->destination, IP6_NEXT_TCP,
2487 tcp_len, 0, s, file, line) != 0;
2488 }
2489 else
2490#endif
2491 {
2492 tcp_PseudoHeader ph = { 0,0,0,0,0,0 };
2493
2494 ph.src = intel (s->myaddr);
2495 ph.dst = intel (s->hisaddr);
2496 ph.protocol = TCP_PROTO;
2497 ph.length = intel16 (tcp_len);
2498 ph.checksum = CHECKSUM (tcp, tcp_len);
2499 tcp->checksum = ~CHECKSUM (&ph, sizeof(ph));
2500
2501 tx_ok = _ip4_output (ip, ph.src, ph.dst, TCP_PROTO,
2502 s->ttl, s->tos, 0, tcp_len, s, file, line) != 0;
2503 }
2504
2505 if (!tx_ok)
2506 {
2507 TCP_SENDSOON (s);
2508 return (-1);
2509 }
2510
2511 /* do next packet
2512 */
2513 if (send_data_len > 0)
2514 {
2515 send_tot_len += send_data_len;
2516 start_data += send_data_len; /* new start of data */
2517 send_tot_data -= send_data_len; /* total data remaining */
2518 }
2519 if (send_tot_data <= 0)
2520 {
2521 pkt_num++;
2522 break;
2523 }
2524 }
2525
2526 s->send_una = start_data; /* relative start of tx_data[] buffer */
2527
2528 TRACE_CONSOLE (2, "tcp_send (called from %s/%u): sent %u bytes in %u "
2529 "packets with (%ld) unacked. SND.NXT %lu\n",
2530 file, line, send_tot_len, pkt_num, s->send_una,
2531 (u_long)s->send_next);
2532
2533 s->vj_last = 0UL;
2534 if (s->karn_count == 2)
2535 {
2536 if (s->rto)
2537 s->rto = (s->rto * 3) / 2; /* increase by 50% */
2538 else s->rto = 2*tcp_RTO_ADD; /* !!was 4 tick */
2539 }
2540 else
2541 {
2542 /* vj_last nonzero if we expect an immediate response
2543 */
2544 if (s->unhappy || s->tx_datalen)
2545 s->vj_last = set_timeout (0);
2546 s->karn_count = 0;
2547 }
2548
2549 /* Determine when a retransmission should be sent
2550 */
2551 rtt = s->rto + tcp_RTO_ADD;
2552
2553 s->rtt_time = set_timeout (rtt);
2554
2555 if (send_tot_len > 0)
2556 s->rtt_lasttran = s->rtt_time;
2557
2558 return (send_tot_len);
2559}
2560
2565int _tcp_send_reset (_tcp_Socket *s, const in_Header *his_ip,
2566 const tcp_Header *org_tcp, const char *file, unsigned line)
2567{
2568 tcp_PseudoHeader ph;
2569
2570 W32_CLANG_PACK_WARN_OFF()
2571
2572 #include <sys/pack_on.h>
2573
2574 struct ip4_packet {
2575 in_Header ip;
2576 tcp_Header tcp;
2577 } *ip4_pkt = NULL;
2578
2579#if defined(USE_IPV6)
2580 struct ip6_packet {
2581 in6_Header ip;
2582 tcp_Header tcp;
2583 } *ip6_pkt = NULL;
2584#endif
2585
2586 #include <sys/pack_off.h>
2587
2588 W32_CLANG_PACK_WARN_DEF()
2589
2590 BYTE flags;
2591 tcp_Header *tcp;
2592 BOOL is_ip4 = (his_ip->ver == 4);
2593 DWORD acknum, seqnum;
2594 WORD tcp_len;
2595
2596 if (tcp_RST_TIME) /* tcp_RST_TIME = 0: always send RST */
2597 {
2598 static DWORD next_RST_time = 0UL;
2599
2600 if (next_RST_time && !chk_timeout(next_RST_time))
2601 return (-1);
2602
2603 next_RST_time = set_timeout (tcp_RST_TIME);
2604 }
2605
2606 flags = org_tcp->flags;
2607 if (flags == 0 || /* ignore if no flags set */
2608 (flags & tcp_FlagRST)) /* or RST set */
2609 return (-1);
2610
2611 if ((flags & (tcp_FlagSYN|tcp_FlagACK)) == tcp_FlagSYN) /* SYN only */
2612 {
2613 acknum = intel (org_tcp->seqnum) + 1;
2614 seqnum = 0;
2615 flags = tcp_FlagACK;
2616 }
2617 else if (flags & tcp_FlagACK)
2618 {
2619 seqnum = intel (org_tcp->acknum);
2620 acknum = 0;
2621 flags = 0;
2622 }
2623 else
2624 {
2625 const in6_Header *his_ip6 = (const in6_Header*) his_ip;
2626 int len, ofs = org_tcp->offset << 2;
2627
2628 if (is_ip4)
2629 len = intel16 (his_ip->length) - in_GetHdrLen (his_ip);
2630 else len = intel16 (his_ip6->len);
2631
2632 acknum = intel (org_tcp->seqnum) + (len - ofs);
2633 seqnum = 0;
2634 flags = 0;
2635 }
2636
2637#if defined(USE_IPV6)
2638 if (!is_ip4)
2639 {
2640 ip6_pkt = (struct ip6_packet*) _eth_formatpacket (MAC_SRC(his_ip),
2641 IP6_TYPE);
2642 tcp = &ip6_pkt->tcp;
2643 }
2644 else
2645#endif
2646 {
2647 ip4_pkt = (struct ip4_packet*) _eth_formatpacket (MAC_SRC(his_ip),
2648 IP4_TYPE);
2649 tcp = &ip4_pkt->tcp;
2650 }
2651
2652 /* tcp header
2653 */
2654 tcp_len = sizeof(*tcp);
2655 tcp->srcPort = org_tcp->dstPort;
2656 tcp->dstPort = org_tcp->srcPort;
2657 tcp->seqnum = intel (seqnum);
2658 tcp->acknum = intel (acknum);
2659 tcp->window = 0; /* non-zero means "BSD derived" */
2660 tcp->flags = (flags & tcp_FlagMASK) | tcp_FlagRST;
2661 tcp->unused = 0;
2662 tcp->checksum = 0;
2663 tcp->urgent = 0;
2664
2665#if defined(USE_TCP_MD5)
2666 if (is_ip4 && s && s->secret)
2667 {
2668 tcp_len += tcp_opt_md5_sign ((BYTE*)(tcp+1));
2669 finalise_md5_sign (&ip4_pkt->ip, tcp, 0, s->secret);
2670 }
2671#endif
2672
2673 tcp->offset = tcp_len / 4;
2674
2675#if defined(USE_IPV6)
2676 if (!is_ip4)
2677 {
2678 in6_Header *ip6 = &ip6_pkt->ip;
2679
2680 memcpy (&ip6->source, &in6addr_my_ip, sizeof(ip6->source));
2681 memcpy (&ip6->destination, ((in6_Header*)his_ip)->source, sizeof(ip6->destination));
2682 tcp->checksum = 0;
2683 tcp->checksum = _ip6_checksum (ip6, IP6_NEXT_TCP, tcp, tcp_len);
2684
2685 return _ip6_output (ip6, &ip6->source, &ip6->destination,
2686 IP6_NEXT_TCP, tcp_len, 0, s, file, line);
2687 }
2688#endif
2689
2690 memset (&ph, 0, sizeof(ph));
2691 ph.src = his_ip->destination;
2692 ph.dst = his_ip->source;
2693 ph.protocol = TCP_PROTO;
2694 ph.length = intel16 (tcp_len);
2695 ph.checksum = CHECKSUM (tcp, tcp_len);
2696
2697 tcp->checksum = ~CHECKSUM (&ph, sizeof(ph));
2698
2699 return _ip4_output (&ip4_pkt->ip, ph.src, ph.dst, TCP_PROTO,
2700 s ? s->ttl : _default_ttl, his_ip->tos, 0,
2701 tcp_len, s, file, line);
2702}
2703
2712int _tcp_keepalive (_tcp_Socket *tcp)
2713{
2714 DWORD ack, seq;
2715 BYTE kc;
2716 int rc;
2717
2718 if (tcp->ip_type != TCP_PROTO || tcp->state < tcp_StateSYNSENT ||
2719 tcp->tx_datalen > 0)
2720 return (0);
2721
2722 ack = tcp->recv_next;
2723 seq = tcp->send_next;
2724 kc = tcp->karn_count;
2725
2726 tcp->recv_next = tcp->send_next;
2727 tcp->send_next = tcp->send_next + tcp->send_una - 1;
2728 tcp->flags &= tcp_FlagPUSH;
2729 tcp->flags |= tcp_FlagACK;
2730 tcp->karn_count = 2;
2731 tcp->tx_datalen = 1; /* BSD 4.2 requires data to respond to a keepalive */
2732 tcp->tx_data[0] = '0';
2733 rc = TCP_SEND (tcp);
2734
2735 tcp->tx_datalen = 0;
2736 tcp->recv_next = ack;
2737 tcp->send_next = seq;
2738 tcp->karn_count = kc;
2739 tcp->locflags &= ~LF_KEEPALIVE;
2740
2741 STAT (tcpstats.tcps_keepprobe++);
2742 STAT (tcpstats.tcps_keeptimeo++);
2743 return (rc);
2744}
2745
2746int W32_CALL sock_keepalive (sock_type *s)
2747{
2748 return _tcp_keepalive (&s->tcp);
2749}
2750#endif /* !USE_UDP_ONLY */
2751
2752
2761#define TCP_H_SM_BINARY 0x01
2762#define TCP_H_SM_ASCII 0x02
2763#define TCP_H_SM_UDP_MODE_CHK 0x04
2764#define TCP_H_SM_UDP_MODE_NOCHK 0x08
2765#define TCP_H_SM_TCP_MODE_NAGLE 0x10
2766#define TCP_H_SM_TCP_MODE_NONAGLE 0x20
2767#define TCP_H_SM_MASK 0x3F
2768
2769WORD W32_CALL sock_mode (sock_type *s, WORD mode)
2770{
2771 if (s->tcp.ip_type == TCP_PROTO || s->tcp.ip_type == UDP_PROTO)
2772 {
2773 int old_nagle = (s->tcp.sockmode & SOCK_MODE_NAGLE);
2774 int old_bmode = (s->tcp.sockmode & SOCK_MODE_BINARY);
2775 int old_udpchk = (s->udp.sockmode &= SOCK_MODE_UDPCHK);
2776
2777 mode &= TCP_H_SM_MASK;
2778 if (mode == 0)
2779 return (s->tcp.sockmode & SOCK_MODE_MASK);
2780
2781 s->tcp.sockmode &= ~SOCK_MODE_MASK; /* turn all bits off */
2782
2783 if (mode & TCP_H_SM_BINARY)
2784 s->tcp.sockmode |= SOCK_MODE_BINARY;
2785 else if (mode & TCP_H_SM_ASCII)
2786 s->tcp.sockmode &= ~SOCK_MODE_BINARY;
2787 else
2788 s->tcp.sockmode |= old_bmode;
2789
2790 if (s->tcp.ip_type == UDP_PROTO)
2791 {
2792 if (mode & TCP_H_SM_UDP_MODE_CHK)
2793 s->udp.sockmode |= SOCK_MODE_UDPCHK;
2794 else if (mode & TCP_H_SM_UDP_MODE_NOCHK)
2795 s->udp.sockmode &= ~SOCK_MODE_UDPCHK;
2796 else
2797 s->udp.sockmode |= old_udpchk;
2798 return (s->udp.sockmode);
2799 }
2800
2801 if (mode & TCP_H_SM_TCP_MODE_NAGLE)
2802 s->tcp.sockmode |= SOCK_MODE_NAGLE;
2803 else if (mode & TCP_H_SM_TCP_MODE_NONAGLE)
2804 s->tcp.sockmode &= ~SOCK_MODE_NAGLE;
2805 else
2806 s->tcp.sockmode |= old_nagle;
2807 return (s->tcp.sockmode);
2808 }
2809 return (0);
2810}
2811
2816VoidProc W32_CALL sock_yield (_tcp_Socket *s, VoidProc func)
2817{
2818 VoidProc old;
2819
2820 if (s)
2821 {
2822 old = s->usr_yield;
2823 s->usr_yield = func;
2824 }
2825 else
2826 {
2827 old = system_yield;
2828 system_yield = func;
2829 }
2830 return (old);
2831}
2832
2836int W32_CALL sock_abort (sock_type *s)
2837{
2838 switch (s->tcp.ip_type)
2839 {
2840#if !defined(USE_UDP_ONLY)
2841 case TCP_PROTO:
2842 TCP_ABORT (&s->tcp);
2843 break;
2844#endif
2845 case UDP_PROTO:
2846 udp_close (&s->udp);
2847 break;
2848 case IP4_TYPE:
2849 s->raw.ip_type = 0;
2850 s->raw.used = 0;
2851 break;
2852 }
2853 return (1);
2854}
2855
2856#if defined(USE_BSD_API)
2860static int raw_read (_raw_Socket *raw, BYTE *buf, int maxlen)
2861{
2862 int len = 0;
2863
2864 if (raw->used)
2865 {
2866 int hlen = in_GetHdrLen (&raw->ip);
2867 BYTE *data = (BYTE*)&raw->ip + hlen;
2868
2869 len = intel16 (raw->ip.length) - hlen;
2870 len = min (len, maxlen);
2871 memcpy (buf, data, len);
2872 raw->used = 0;
2873 }
2874 return (len);
2875}
2876#endif
2877
2884int W32_CALL sock_read (sock_type *s, BYTE *buf, size_t maxlen)
2885{
2886 int count = 0;
2887
2888 do
2889 {
2890 int len = 0;
2891 int raw = 0;
2892
2893 switch (s->udp.ip_type)
2894 {
2895#if !defined(USE_UDP_ONLY)
2896 case TCP_PROTO:
2897 len = tcp_read (&s->tcp, buf, maxlen);
2898 break;
2899#endif
2900 case UDP_PROTO:
2901 len = udp_read (&s->udp, buf, maxlen);
2902 break;
2903
2904#if defined(USE_BSD_API)
2905 case IP4_TYPE:
2906 raw = TRUE;
2907 len = raw_read (&s->raw, buf, maxlen);
2908 break;
2909#endif
2910 }
2911
2912 if (len < 1)
2913 {
2914 if (!tcp_tick(s) || len < 0)
2915 break;
2916 }
2917 else
2918 {
2919 count += len;
2920 buf += len;
2921 maxlen -= len;
2922 }
2923 if (maxlen > 0 && !raw)
2924 {
2925 if (s->tcp.usr_yield) /* yield only when room */
2926 (*s->tcp.usr_yield)(); /* 99.07.01 EE */
2927 else WATT_YIELD();
2928 }
2929 }
2930 while (maxlen);
2931 return (count);
2932}
2933
2938int W32_CALL sock_fastread (sock_type *s, BYTE *buf, int len)
2939{
2940 if (s->udp.ip_type == UDP_PROTO)
2941 return udp_read (&s->udp, buf, len);
2942
2943#if !defined(USE_UDP_ONLY)
2944 if (s->tcp.ip_type == TCP_PROTO || s->tcp.rx_datalen > 0)
2945 return tcp_read (&s->tcp, buf, len);
2946#endif
2947
2948#if defined(USE_BSD_API)
2949 if (s->raw.ip_type == IP4_TYPE)
2950 return raw_read (&s->raw, buf, len);
2951#endif
2952
2953 return (-1);
2954}
2955
2956
2965int W32_CALL sock_write (sock_type *s, const BYTE *data, int len)
2966{
2967 size_t chunk;
2968 size_t remain = len;
2969 int written = 0;
2970
2971 while (1)
2972 {
2973 switch (s->udp.ip_type)
2974 {
2975#if !defined(USE_UDP_ONLY)
2976 case TCP_PROTO:
2977 if (!(s->tcp.sockmode & SOCK_MODE_LOCAL))
2978 s->tcp.flags |= tcp_FlagPUSH;
2979 written = tcp_write (&s->tcp, data, remain);
2980 break;
2981#endif
2982 case UDP_PROTO:
2983 chunk = min (_mtu - UDP_OVERHEAD, remain);
2984 written = udp_write (&s->udp, data, chunk);
2985 break;
2986
2987#if defined(USE_BSD_API)
2988 case IP4_TYPE:
2989 case IP6_TYPE:
2990 return (0); /* not supported yet */
2991#endif
2992 default: /* EE 99.06.14 */
2993#if defined(USE_DEBUG)
2994 dbug_printf ("sock_write() called with unknown proto %04Xh\n",
2995 s->udp.ip_type);
2996#endif
2997 return (0);
2998 }
2999
3000 if (written < 0)
3001 {
3002 s->udp.err_msg = _LANG ("Tx Error");
3003 len = 0;
3004 break;
3005 }
3006 data += written;
3007 remain -= written;
3008
3009 if (remain == 0)
3010 break;
3011
3012 if (s->udp.usr_yield)
3013 (*s->udp.usr_yield)();
3014 else WATT_YIELD();
3015
3016 if (!tcp_tick(s))
3017 {
3018 len = 0; /* !! should be 'len - remain' ? */
3019 break;
3020 }
3021 }
3022
3023 if (s->tcp.ip_type == TCP_PROTO)
3024 s->tcp.sockmode &= ~SOCK_MODE_LOCAL;
3025
3026 return (len);
3027}
3028
3034int W32_CALL sock_fastwrite (sock_type *s, const BYTE *data, int len)
3035{
3036 switch (s->udp.ip_type)
3037 {
3038 case UDP_PROTO:
3039 len = min ((int)(_mtu - UDP_OVERHEAD), len);
3040 len = udp_write (&s->udp, data, len);
3041 return (len < 0 ? 0 : len);
3042
3043#if !defined(USE_UDP_ONLY)
3044 case TCP_PROTO:
3045 len = tcp_write (&s->tcp, data, len);
3046 s->tcp.sockmode &= ~SOCK_MODE_LOCAL;
3047 return (len < 0 ? 0 : len);
3048#endif
3049 }
3050 return (0);
3051}
3052
3059int W32_CALL sock_enqueue (sock_type *s, const BYTE *data, int len)
3060{
3061 if (len <= 0)
3062 return (0);
3063
3064 if (s->udp.ip_type == UDP_PROTO)
3065 {
3066 int written = 0;
3067 int total = 0;
3068 do
3069 {
3070 len = min ((int)(_mtu - UDP_OVERHEAD), len);
3071 written = udp_write (&s->udp, data, len);
3072 if (written < 0)
3073 {
3074 s->udp.err_msg = _LANG ("Tx Error");
3075 break;
3076 }
3077 data += written;
3078 len -= written;
3079 total += written;
3080 }
3081 while (len > 0);
3082 return (total);
3083 }
3084
3085#if !defined(USE_UDP_ONLY)
3086 if (s->tcp.ip_type == TCP_PROTO)
3087 {
3088 s->tcp.tx_queue = data;
3089 s->tcp.tx_queuelen = len;
3090 s->tcp.tx_datalen = len;
3091 return TCP_SEND (&s->tcp);
3092 }
3093#endif
3094 return (0);
3095}
3096
3097#if !defined(USE_UDP_ONLY)
3101void W32_CALL sock_noflush (sock_type *s)
3102{
3103 if (s->tcp.ip_type == TCP_PROTO)
3104 s->tcp.sockmode |= SOCK_MODE_LOCAL;
3105}
3106
3111void W32_CALL sock_flush (sock_type *s)
3112{
3113 if (s->tcp.ip_type == TCP_PROTO)
3114 {
3115 _tcp_Socket *tcp = &s->tcp;
3116
3117 tcp->sockmode &= ~SOCK_MODE_LOCAL;
3118 if (tcp->tx_datalen > (unsigned long)tcp->send_una)
3119 {
3120 tcp->flags |= tcp_FlagPUSH;
3121 if (s->tcp.send_una == 0) /* !! S. Lawson - only if data not moving */
3122 TCP_SEND (tcp);
3123 }
3124 }
3125}
3126
3130void W32_CALL sock_flushnext (sock_type *s)
3131{
3132 if (s->tcp.ip_type == TCP_PROTO)
3133 {
3134 s->tcp.flags |= tcp_FlagPUSH;
3135 s->tcp.sockmode &= ~SOCK_MODE_LOCAL;
3136 }
3137}
3138#endif /* !USE_UDP_ONLY */
3139
3143int W32_CALL sock_close (sock_type *s)
3144{
3145 switch (s->tcp.ip_type)
3146 {
3147 case UDP_PROTO:
3148 udp_close (&s->udp);
3149 break;
3150
3151#if !defined(USE_UDP_ONLY)
3152 case TCP_PROTO:
3153 _tcp_close (&s->tcp);
3154 tcp_tick (s);
3155 break;
3156#endif
3157 }
3158 return (0);
3159}
3160
3161#if !defined(USE_UDP_ONLY)
3162
3175static struct tcp_rtt rtt_cache [RTTCACHE];
3176
3177void tcp_rtt_add (const _tcp_Socket *s, UINT rto, UINT MTU)
3178{
3179 struct tcp_rtt *rtt;
3180 DWORD addr = s->hisaddr;
3181
3182 if (~addr & ~sin_mask) /* 0.0.0.0 or broadcast addresses? */
3183 return;
3184
3185 rtt = &rtt_cache [(WORD)addr % RTTCACHE];
3186
3187 /* Cache-slot is vacant or we're updating previous RTO
3188 * for same peer
3189 */
3190 if (!rtt->ip || rtt->ip == addr)
3191 {
3192 rtt->ip = addr;
3193 rtt->rto = rto;
3194 rtt->MTU = MTU;
3195 STAT (tcpstats.tcps_cachedrtt++);
3196 }
3197}
3198
3199BOOL tcp_rtt_get (const _tcp_Socket *s, UINT *rto, UINT *MTU)
3200{
3201 struct tcp_rtt *rtt = &rtt_cache [(s->hisaddr & 0xFFFF) % RTTCACHE];
3202
3203 STAT (tcpstats.tcps_segstimed++);
3204
3205 if (s->hisaddr && rtt->ip == s->hisaddr && rtt->rto > 0)
3206 {
3207#if defined(USE_DEBUG) && !defined(_MSC_VER) /* MSC6 crashes below */
3208 dbug_printf ("\nRTT-cache: host %s: %ss\n\n",
3209 _inet_ntoa(NULL, rtt->ip), time_str(rtt->rto));
3210#endif
3211
3212 STAT (tcpstats.tcps_usedrtt++);
3213 if (rto)
3214 *rto = rtt->rto;
3215 if (MTU)
3216 *MTU = rtt->MTU;
3217 return (TRUE);
3218 }
3219 return (FALSE);
3220}
3221
3222void tcp_rtt_clr (const _tcp_Socket *s)
3223{
3224 struct tcp_rtt *rtt = &rtt_cache [(s->hisaddr & 0xFFFF) % RTTCACHE];
3225
3226 if (s->hisaddr && rtt->ip == s->hisaddr)
3227 {
3228 rtt->ip = 0;
3229 rtt->rto = 0;
3230 rtt->MTU = 0;
3231 }
3232}
3233#endif /* !USE_UDP_ONLY */
bsdname.h
_ip6_udp_checksum
int _ip6_udp_checksum(const in6_Header *ip, const udp_Header *udp, unsigned len)
Check udp header checksum of an IPv6 packet.
Definition: chksum.c:95
_ip6_tcp_checksum
int _ip6_tcp_checksum(const in6_Header *ip, const tcp_Header *tcp, unsigned len)
Check tcp header checksum of an IPv6 packet.
Definition: chksum.c:80
_ip6_checksum
WORD _ip6_checksum(const in6_Header *ip, WORD proto, const void *payload, unsigned payloadlen)
Generic IPv6 checksum function.
Definition: chksum.c:48
chksum.h
copyrigh.h
ip4_frag.h
_ip4_handler
int _ip4_handler(const in_Header *ip, BOOL broadcast)
Definition: ip4_in.c:33
ip4_in.h
_default_tos
BYTE _default_tos
Definition: ip4_out.c:53
_ip4_output
int _ip4_output(in_Header *ip, DWORD src_ip, DWORD dst_ip, BYTE protocol, BYTE ttl, BYTE tos, WORD ip_id, int data_len, const void *sock, const char *file, unsigned line)
The IP4 packet transmitter.
Definition: ip4_out.c:86
_default_ttl
int _default_ttl
Definition: ip4_out.c:54
ip4_out.h
_ip6_output
int _ip6_output(in6_Header *ip, ip6_address *src_ip, ip6_address *dst_ip, BYTE protocol, unsigned data_len, int hop_lim, const void *sock, const char *file, unsigned line)
Definition: ip6_out.c:79
language.h
misc.h
misc_str.h
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
pack_off.h
_arp_resolve
BOOL W32_CALL _arp_resolve(DWORD ip, eth_address *eth)
The blocking lookup function visible to higher functions.
Definition: pcarp.c:1278
_arp_lookup
BOOL W32_CALL _arp_lookup(DWORD ip, eth_address *eth)
Lookup MAC-address of 'ip'.
Definition: pcarp.c:1185
_arp_handler
BOOL W32_CALL _arp_handler(const arp_Header *ah, BOOL brdcast)
Receive ARP handler.
Definition: pcarp.c:1565
_arp_lookup_pending
BOOL W32_CALL _arp_lookup_pending(DWORD ip)
An ARP-lookup timeout check.
Definition: pcarp.c:1205
_arp_start_lookup
BOOL W32_CALL _arp_start_lookup(DWORD ip)
"PUBLIC" ARP/ROUTE FUNCTIONS.
Definition: pcarp.c:1168
pcarp.h
pcbuf.h
pcconfig.h
pcdbug.h
pcdhcp.h
pcdns.h
pcicmp6.h
icmp_send_unreach
int icmp_send_unreach(const in_Header *ip, int code)
Send an ICMP destination/protocol unreachable back to 'ip->source'.
Definition: pcicmp.c:198
pcicmp.h
pcigmp.h
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
pcpkt.h
pcqueue.h
_rarp_handler
BOOL _rarp_handler(const rarp_Header *rh, BOOL brdcast)
Handle incoming RARP packets.
Definition: pcrarp.c:51
_eth_is_init
BOOL _eth_is_init
we are initialised
Definition: pcsed.c:54
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
_eth_arrived
void *W32_CALL _eth_arrived(WORD *type_ptr, BOOL *broadcast)
Poll for arrival of new packets (IP/ARP/RARP/PPPoE protocol).
Definition: pcsed.c:996
_ip_recursion
BOOL _ip_recursion
avoid recursion in arp_resolve()
Definition: pcsed.c:55
_eth_free
void W32_CALL _eth_free(const void *pkt)
Free an input buffer once it is no longer needed.
Definition: pcsed.c:769
pcsed.h
pcstat.h
tcp_recv_win
DWORD tcp_recv_win
RWIN for BSD sockets only.
Definition: pctcp.c:138
block_ip
BOOL block_ip
when application handles IP itself
Definition: pctcp.c:67
tcp_established
int W32_CALL tcp_established(const _tcp_Socket *s)
Returns 1 if TCP connection is established.
Definition: pctcp.c:639
tcp_OPEN_TO
unsigned tcp_OPEN_TO
TCP timer values.
Definition: pctcp.c:116
tcp_opt_ts
BOOL tcp_opt_ts
TCP option config flags (RFC 1323).
Definition: pctcp.c:128
tcp_findseq
static _tcp_Socket * tcp_findseq(const in_Header *ip, const tcp_Header *tcp)
Find the TCP socket that matches the tripplet: DESTADDR=MYADDR, DESTPORT=MYPORT and ACKNUM=SEQNUM+1 C...
Definition: pctcp.c:1936
tcp_max_idle
unsigned tcp_max_idle
max idle time before kill
Definition: pctcp.c:137
_tcp_abort
_tcp_Socket * _tcp_abort(_tcp_Socket *s, const char *file, unsigned line)
Abort a TCP connection.
Definition: pctcp.c:522
tcp_read
static int tcp_read(_tcp_Socket *s, BYTE *buf, int maxlen)
Read from a TCP socket.
Definition: pctcp.c:1825
tcp_write
static int tcp_write(_tcp_Socket *s, const BYTE *data, UINT len)
Write data to a TCP connection.
Definition: pctcp.c:1871
_tcp_handler
_tcp_Socket * _tcp_handler(const in_Header *ip, BOOL broadcast)
The main TCP input handler.
Definition: pctcp.c:649
tcp_Retransmitter
void tcp_Retransmitter(BOOL force)
Called periodically to perform retransmissions.
Definition: pctcp.c:1218
udp_read
static int udp_read(_udp_Socket *s, BYTE *buf, int maxlen)
Read from UDP socket.
Definition: pctcp.c:1574
tcp_CLOSE_TO
unsigned tcp_CLOSE_TO
Default close timeout.
Definition: pctcp.c:117
block_udp
BOOL block_udp
when application handles UDP itself
Definition: pctcp.c:65
_tcp_cancel
void _tcp_cancel(const in_Header *ip, int icmp_type, int icmp_code, const char *msg, const void *arg)
Cancel a TCP socket.
Definition: pctcp.c:1734
tcp_RST_TIME
unsigned tcp_RST_TIME
Don't generate RST too often.
Definition: pctcp.c:121
mtu_blackhole
BOOL mtu_blackhole
Definition: pctcp.c:63
tcp_RETRAN_TIME
unsigned tcp_RETRAN_TIME
Default retransmission time.
Definition: pctcp.c:122
tcp_nagle
BOOL tcp_nagle
Misc TCP values.
Definition: pctcp.c:134
tcp_rtt_win
static void tcp_rtt_win(_tcp_Socket *s)
Update retransmission timer, VJ algorithm and TCP windows.
Definition: pctcp.c:2058
block_icmp
BOOL block_icmp
when application handles ICMP itself
Definition: pctcp.c:66
tcp_listen
int W32_CALL tcp_listen(_tcp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler, WORD timeout)
Passively opens TCP a connection.
Definition: pctcp.c:407
tcp_keep_intvl
unsigned tcp_keep_intvl
time between keepalive probes
Definition: pctcp.c:136
_udp_listen
int _udp_listen(_udp_Socket *s, WORD lport, DWORD ip, WORD port)
Implementation for udp_listen() and udp_open().
Definition: pctcp.c:158
sock_reduce_mss
static void sock_reduce_mss(sock_type *s, WORD MTU)
Reduce socket MSS upon receiving ICMP_UNREACH_NEEDFRAG.
Definition: pctcp.c:1599
tcp_opt_maxsegment
static __inline int tcp_opt_maxsegment(const _tcp_Socket *s, BYTE *opt)
TCP option routines.
Definition: pctcp.c:2170
mtu_discover
BOOL mtu_discover
Definition: pctcp.c:62
udp_demux
static _udp_Socket * udp_demux(const in_Header *ip, BOOL ip_bcast, DWORD destin, WORD srcPort, WORD dstPort, BOOL *udp_err)
Demultiplexer for incoming UDP packets.
Definition: pctcp.c:875
tcp_MAX_VJSA
unsigned tcp_MAX_VJSA
Default max VJ std.
Definition: pctcp.c:123
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
tcp_upd_win
static void tcp_upd_win(_tcp_Socket *s, unsigned line)
Check if receive window needs an update.
Definition: pctcp.c:2151
_udp_allsocs
_udp_Socket * _udp_allsocs
list of udp-sockets
Definition: pctcp.c:72
tcp_RTO_SCALE
unsigned tcp_RTO_SCALE
Scaling used in RTO calculation.
Definition: pctcp.c:120
tcp_sockreset
static void tcp_sockreset(_tcp_Socket *s, BOOL proxy)
Resets a TCP connection.
Definition: pctcp.c:1957
_udp_cancel
void _udp_cancel(const in_Header *ip, int icmp_type, int icmp_code, const char *msg, const void *arg)
Cancel an UDP socket.
Definition: pctcp.c:1628
hostname
char hostname[MAX_HOSTLEN+1]
Our configured hostname.
Definition: pctcp.c:58
tcp_RTO_BASE
unsigned tcp_RTO_BASE
Base time for RTO calculation.
Definition: pctcp.c:119
_tcp_sendsoon
int _tcp_sendsoon(_tcp_Socket *s, const char *file, unsigned line)
Schedule a transmission pretty soon.
Definition: pctcp.c:563
tcp_checksum
static BOOL tcp_checksum(const in_Header *ip, const tcp_Header *tcp, int len)
Verify the TCP header checksum.
Definition: pctcp.c:2034
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
tcp_no_arp
static void tcp_no_arp(_tcp_Socket *s)
Called for a TCP socket when ARP lookup fails.
Definition: pctcp.c:2011
_udp_handler
_udp_Socket * _udp_handler(const in_Header *ip, BOOL broadcast)
Handler for incoming UDP packets.
Definition: pctcp.c:1042
udp_listen
int W32_CALL udp_listen(_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP passive open.
Definition: pctcp.c:190
_tcp_close
void _tcp_close(_tcp_Socket *s)
Close a TCP connection.
Definition: pctcp.c:471
udp_close
static void udp_close(const _udp_Socket *s)
Since UDP is stateless, simply reclaim the local-port and unthread the socket from the list.
Definition: pctcp.c:287
tcp_open
int W32_CALL tcp_open(_tcp_Socket *s, WORD lport, DWORD ip, WORD rport, ProtoHandler handler)
Actively open a TCP connection.
Definition: pctcp.c:328
_tcp_allsocs
_tcp_Socket * _tcp_allsocs
list of tcp-sockets
Definition: pctcp.c:140
_tcp_unthread
_tcp_Socket * _tcp_unthread(_tcp_Socket *ds, BOOL free_tx)
Unthread a socket from the tcp socket list, if it's there.
Definition: pctcp.c:602
udp_write
static int udp_write(_udp_Socket *s, const BYTE *data, int len)
Write an UDP packet.
Definition: pctcp.c:1496
W32_CLANG_PACK_WARN_DEF
W32_CLANG_PACK_WARN_DEF() void *(MS_CDECL *_bsd_socket_hook)(enum BSD_SOCKET_OPS op
This hook is to prevent the BSD-socket API being linked in by default.
Definition: pcsed.h:261
tcp_RTO_ADD
unsigned tcp_RTO_ADD
Time added in RTO calculation.
Definition: pctcp.c:118
block_tcp
BOOL block_tcp
when application handles TCP itself
Definition: pctcp.c:64
sign_opt
static BYTE * sign_opt
Prepare to insert MD5 option.
Definition: pctcp.c:2204
tcp_MAX_VJSD
unsigned tcp_MAX_VJSD
Default max VJ std.
Definition: pctcp.c:124
tcp_opt_timestamp
static __inline int tcp_opt_timestamp(_tcp_Socket *s, BYTE *opt, DWORD ts_echo)
Insert TimeStamp option.
Definition: pctcp.c:2183
_udp_open
int _udp_open(_udp_Socket *s, WORD lport, DWORD ip, WORD port)
Implementation for udp_open(), also used by BSD connect().
Definition: pctcp.c:214
udp_open
int W32_CALL udp_open(_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP active open.
Definition: pctcp.c:262
udp_SetTTL
int W32_CALL udp_SetTTL(_udp_Socket *s, BYTE ttl)
Set the TTL on an outgoing UDP datagram.
Definition: pctcp.c:309
tcp_keep_idle
unsigned tcp_keep_idle
idle time before sending keepalive
Definition: pctcp.c:135
udp_checksum
static BOOL udp_checksum(const in_Header *ip, const udp_Header *udp, int len)
Verify checksum for an UDP packet.
Definition: pctcp.c:850
pctcp.h
pppoe_handler
int pppoe_handler(const pppoe_Packet *pkt)
Handle incoming PPPoE packets.
Definition: pppoe.c:223
pppoe.h
split.h
_raw_Socket
Definition: wattcp.h:665
_raw_Socket::used
BOOL used
used flag; packet not read yet
Definition: wattcp.h:668
_raw_Socket::ip_type
WORD ip_type
same ofs as for udp/tcp Socket
Definition: wattcp.h:667
Socket
Definition: socket.h:158
arp_Header
Definition: wattcp.h:476
in6_Header
Definition: wattcp.h:381
in_Header
Definition: wattcp.h:329
ip6_packet
Definition: pctcp.c:84
pppoe_Packet
Definition: pcsed.h:237
tcp6_pkt
Definition: pctcp.c:95
tcp_Header
Definition: wattcp.h:418
tcp_PseudoHeader6
Definition: wattcp.h:463
tcp_PseudoHeader
Definition: wattcp.h:449
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::window
UINT window
other guy's window
Definition: wattcp.h:608
tcp_Socket::tx_queuelen
UINT tx_queuelen
optional Tx queue length
Definition: wattcp.h:649
tcp_Socket::datatimer
DWORD datatimer
inactive timer (no Tx data)
Definition: wattcp.h:644
tcp_Socket::tx_wscale
BYTE tx_wscale
Definition: wattcp.h:647
tcp_Socket::vj_sa
DWORD vj_sa
VJ's alg, standard average (SRTT)
Definition: wattcp.h:615
tcp_Socket::safetytcp
DWORD safetytcp
extra magic marker
Definition: wattcp.h:657
tcp_Socket::rtt_lasttran
DWORD rtt_lasttran
RTT at last transmission.
Definition: wattcp.h:624
tcp_Socket::recent
BYTE recent
1 if recently transmitted
Definition: wattcp.h:605
tcp_Socket::rto
UINT rto
retransmission timeout
Definition: wattcp.h:618
tcp_Socket::tx_datalen
UINT tx_datalen
number of bytes of data to send
Definition: wattcp.h:652
tcp_Socket::wwindow
BYTE wwindow
Van Jacobson's algorithm.
Definition: wattcp.h:612
tcp_Socket::max_seg
UINT max_seg
MSS for this connection.
Definition: wattcp.h:630
tcp_Socket::ts_sent
DWORD ts_sent
last TimeStamp value sent
Definition: wattcp.h:626
tcp_Socket::tos
BYTE tos
TOS from IP-header.
Definition: wattcp.h:620
tcp_Socket::cwindow
BYTE cwindow
Congestion window.
Definition: wattcp.h:611
tcp_Socket::karn_count
BYTE karn_count
count of packets
Definition: wattcp.h:619
tcp_Socket::rtt_time
DWORD rtt_time
Round Trip Time value.
Definition: wattcp.h:623
tcp_Socket::unhappy
BYTE unhappy
flag, indicates retransmitting segt's
Definition: wattcp.h:604
tcp_Socket::vj_last
DWORD vj_last
last transmit time
Definition: wattcp.h:617
tcp_Socket::timeout
DWORD timeout
timer for retrans etc.
Definition: wattcp.h:603
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
tcp_Socket::tx_data
BYTE * tx_data
Tx data buffer (default tx_buf[])
Definition: wattcp.h:654
tcp_Socket::ts_echo
DWORD ts_echo
last TimeStamp echo received
Definition: wattcp.h:628
tcp_Socket::next
struct tcp_Socket * next
link to next tcp-socket
Definition: wattcp.h:585
tcp_Socket::safetysig
DWORD safetysig
magic marker
Definition: wattcp.h:656
tcp_Socket::adv_win
UINT adv_win
our last advertised window
Definition: wattcp.h:609
tcp_Socket::missed_seq
DWORD missed_seq[2]
S.
Definition: wattcp.h:637
tcp_Socket::rx_buf
BYTE rx_buf[tcp_MaxBufSize+1]
received data buffer
Definition: wattcp.h:588
tcp_Socket::tx_buf
BYTE tx_buf[tcp_MaxTxBufSize+1]
data for transmission
Definition: wattcp.h:655
tcp_Socket::send_una
long send_una
unacked send data, must be signed
Definition: wattcp.h:597
tcp_Socket::ts_recent
DWORD ts_recent
last TimeStamp value received
Definition: wattcp.h:627
tcp_Socket::vj_sd
DWORD vj_sd
VJ's alg, standard deviation (RTTVAR)
Definition: wattcp.h:616
tcp_Socket::his6addr
ip6_address his6addr
peer's IPv6 address
Definition: wattcp.h:592
tcp_Socket::send_next
DWORD send_next
SEQ we send but not ACK-ed by peer.
Definition: wattcp.h:596
tcp_Socket::my6addr
ip6_address my6addr
our IPv6 address
Definition: wattcp.h:591
tcp_Socket::max_tx_data
UINT max_tx_data
Last index for tx_data[].
Definition: wattcp.h:653
tcp_Socket::inactive_to
DWORD inactive_to
inactive timer (no Rx data)
Definition: wattcp.h:643
tcp_Socket::secret
char * secret
< linked-list of frags; not yet
Definition: wattcp.h:641
tcp_Socket::recv_next
DWORD recv_next
SEQ number we expect to receive.
Definition: wattcp.h:595
tcp_Socket::flags
WORD flags
TCP flags used in next Tx.
Definition: wattcp.h:606
tcp_pkt
Definition: pctcp.c:90
tcp_rtt
Definition: pctcp.h:174
tcp_rtt::ip
DWORD ip
IP-address of this entry.
Definition: pctcp.h:175
tcp_rtt::rto
UINT rto
Round-trip timeout for this entry.
Definition: pctcp.h:176
tcp_rtt::MTU
UINT MTU
Path-MTU discovered for this entry.
Definition: pctcp.h:177
udp_Header
Definition: wattcp.h:406
cmp_timers
int W32_CALL cmp_timers(DWORD t1, DWORD t2)
Compare two timers with expirary at 't1' and 't2'.
Definition: timer.c:358
time_str
const char * time_str(DWORD val)
Return string x.xx for timeout value.
Definition: timer.c:680
get_timediff
long W32_CALL get_timediff(DWORD now, DWORD tim)
Return time difference between timers now and tim.
Definition: timer.c:620
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
start_time
DWORD start_time
Start-time of watt_sock_init() (in msec)
Definition: timer.c:46
timer.h
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pctcp.h Source File

  • src
pctcp.h
Go to the documentation of this file.
1
3#ifndef _w32_PCTCP_H
4#define _w32_PCTCP_H
5
10#define tcp_TIMEOUT 13000UL /* timeout during a connection */
11#define tcp_LONGTIMEOUT (1000UL*sock_delay) /* timeout for open */
12#define tcp_LASTACK_TIME 10000 /* timeout in the LASTACK state added AGW 5th Jan 2001 */
13
14#define DEF_OPEN_TO 1000UL /* # of msec in tcp-open (<=3s; RFC1122) */
15#define DEF_CLOSE_TO 1000UL /* # of msec for CLOSEWT state */
16#define DEF_RTO_ADD 100UL /* # of msec delay in RTT increment */
17#define DEF_RTO_BASE 10UL /* # of msec in RTO recalculation */
18#define DEF_RTO_SCALE 64 /* RTO scale factor in _tcp_sendsoon() */
19#define DEF_RST_TIME 100UL /* # of msec before sending RST */
20#define DEF_RETRAN_TIME 10UL /* do retransmit logic every 10ms */
21#define DEF_RECV_WIN (16*1024) /* default receive window, 16kB */
22
23
24/*
25 * S. Lawson - define a short TIME_WAIT timeout. It should be from
26 * .5 to 4 minutes (2MSL) but it's not really practical for us.
27 * 2 secs will hopefully handle the case where ACK must be retransmitted,
28 * but can't protect future connections on the same port from old packets.
29 */
30#define tcp_TIMEWT_TO 2000UL
31
32#if !defined(__NETINET_TCP_SEQ_H)
33
41 #define SEQ_LT(a,b) ((long)((a) - (b)) < 0)
42 #define SEQ_LEQ(a,b) ((long)((a) - (b)) <= 0)
43 #define SEQ_GT(a,b) ((long)((a) - (b)) > 0)
44 #define SEQ_GEQ(a,b) ((long)((a) - (b)) >= 0)
45 #define SEQ_BETWEEN(seq,lo,hi) ((seq - lo) <= (hi - lo))
46 /* (SEG_GEQ(seq,lo) && SEG_LEQ(seq,hi)) */
47#endif
48
56#define INIT_SEQ() intel (Random(1,0xFFFFFFFF)) /* intel (set_timeout(1)) */
57
61#define DEF_MAX_VJSA 60000U
62#define DEF_MAX_VJSD 20000U
63#define INIT_VJSA 220
64
68#define TCPOPT_EOL 0
69#define TCPOPT_NOP 1
70#define TCPOPT_MAXSEG 2
71#define TCPOPT_WINDOW 3
72#define TCPOPT_SACK_PERM 4
73#define TCPOPT_SACK 5
74#define TCPOPT_ECHO 6
75#define TCPOPT_ECHOREPLY 7
76#define TCPOPT_TIMESTAMP 8
77#define TCPOPT_CC 11
78#define TCPOPT_CCNEW 12
79#define TCPOPT_CCECHO 13
80#define TCPOPT_CHKSUM_REQ 14
81#define TCPOPT_CHKSUM_DAT 15
82#define TCPOPT_SIGNATURE 19
83#define TCPOPT_SIGN_LEN 16
84
85#define TCP_MAX_WINSHIFT 14
92#define MSS_MAX (_mtu - TCP_OVERHEAD)
93#define MSS_MIN (576 - TCP_OVERHEAD)
94#define MSS_REDUCE 20 /* do better than this (exponentially decrease) */
95
96#define my_ip_addr W32_NAMESPACE (my_ip_addr)
97#define sin_mask W32_NAMESPACE (sin_mask)
98#define block_tcp W32_NAMESPACE (block_tcp)
99#define block_udp W32_NAMESPACE (block_udp)
100#define block_ip W32_NAMESPACE (block_ip)
101#define block_icmp W32_NAMESPACE (block_icmp)
102#define use_rand_lport W32_NAMESPACE (use_rand_lport)
103
104#define mtu_discover W32_NAMESPACE (mtu_discover)
105#define mtu_blackhole W32_NAMESPACE (mtu_blackhole)
106
107#define tcp_nagle W32_NAMESPACE (tcp_nagle)
108#define tcp_keep_idle W32_NAMESPACE (tcp_keep_idle)
109#define tcp_keep_intvl W32_NAMESPACE (tcp_keep_intvl)
110#define tcp_max_idle W32_NAMESPACE (tcp_max_idle)
111#define tcp_opt_ts W32_NAMESPACE (tcp_opt_ts)
112#define tcp_opt_sack W32_NAMESPACE (tcp_opt_sack)
113#define tcp_opt_wscale W32_NAMESPACE (tcp_opt_wscale)
114#define hostname W32_NAMESPACE (hostname)
115
116extern BOOL mtu_discover;
117extern BOOL mtu_blackhole;
118extern BOOL use_rand_lport;
119extern BOOL tcp_nagle;
120extern BOOL tcp_opt_ts;
121extern BOOL tcp_opt_sack;
122extern BOOL tcp_opt_wscale;
123
124extern char hostname [MAX_HOSTLEN+1];
125
126extern _tcp_Socket *_tcp_allsocs;
127extern _udp_Socket *_udp_allsocs;
128
129extern int _udp_listen (_udp_Socket *s, WORD lport, DWORD ip, WORD port);
130extern int _udp_open (_udp_Socket *s, WORD lport, DWORD ip, WORD port);
131
132extern void _udp_cancel (const in_Header *ip, int icmp_type, int icmp_code,
133 const char *msg, const void *arg);
134
135extern void _tcp_cancel (const in_Header *ip, int icmp_type, int icmp_code,
136 const char *msg, const void *arg);
137
138extern void _tcp_close (_tcp_Socket *s);
139extern void tcp_rtt_add (const _tcp_Socket *s, UINT rto, UINT MTU);
140extern void tcp_rtt_clr (const _tcp_Socket *s);
141extern BOOL tcp_rtt_get (const _tcp_Socket *s, UINT *rto, UINT *MTU);
142
143extern int _tcp_send (_tcp_Socket *s, const char *file, unsigned line);
144extern int _tcp_sendsoon (_tcp_Socket *s, const char *file, unsigned line);
145extern int _tcp_keepalive (_tcp_Socket *s);
146
147extern void tcp_Retransmitter (BOOL force);
148
149extern _udp_Socket *_udp_handler (const in_Header *ip, BOOL broadcast);
150extern _tcp_Socket *_tcp_handler (const in_Header *ip, BOOL broadcast);
151extern _tcp_Socket *_tcp_unthread (_tcp_Socket *s, BOOL free_tx);
152extern _tcp_Socket *_tcp_abort (_tcp_Socket *s, const char *file, unsigned line);
153extern int _tcp_send_reset (_tcp_Socket *s, const in_Header *ip,
154 const tcp_Header *tcp, const char *file,
155 unsigned line);
156
157#define TCP_SEND(s) _tcp_send (s, __FILE__, __LINE__)
158#define TCP_SENDSOON(s) _tcp_sendsoon (s, __FILE__, __LINE__)
159#define TCP_ABORT(s) _tcp_abort (s, __FILE__, __LINE__)
160
161#define TCP_SEND_RESET(s, ip, tcp) \
162 _tcp_send_reset(s, ip, tcp, __FILE__, __LINE__)
163
164#define SET_ERR_MSG(s, msg) \
165 do { \
166 if (s && s->err_msg == NULL && msg != NULL) \
167 s->err_msg = _strlcpy (s->err_buf, msg, sizeof(s->err_buf)); \
168 } while (0)
169
174struct tcp_rtt {
175 DWORD ip;
176 UINT rto;
177 UINT MTU;
178 };
179
180#define RTTCACHE 16
183#if defined(USE_BSD_API)
184 /*
185 * Operations for the '_bsd_socket_hook'.
186 */
187 enum BSD_SOCKET_OPS {
188 BSO_FIND_SOCK = 1, /* return a 'Socket*' from '_tcp_Socket*' */
189 BSO_SYN_CALLBACK, /* called on SYN received */
190 BSO_RST_CALLBACK, /* called on RST received */
191 BSO_IP4_RAW, /* called on IPv4 input. */
192 BSO_IP6_RAW, /* called on IPv6 input. */
193 BSO_DEBUG, /* called to perform SO_DEBUG stuff */
194 };
195
196 extern void * (MS_CDECL *_bsd_socket_hook) (enum BSD_SOCKET_OPS op, ...);
197#endif
198
199/* In ports.c
200 */
201extern WORD init_localport (void);
202extern WORD find_free_port (WORD oldport, BOOL sleep_msl);
203extern int grab_localport (WORD port);
204extern int reuse_localport (WORD port);
205extern int maybe_reuse_localport (_tcp_Socket *s);
206
207#endif
tcp_opt_ts
BOOL tcp_opt_ts
TCP option config flags (RFC 1323).
Definition: pctcp.c:128
_tcp_abort
_tcp_Socket * _tcp_abort(_tcp_Socket *s, const char *file, unsigned line)
Abort a TCP connection.
Definition: pctcp.c:522
_tcp_handler
_tcp_Socket * _tcp_handler(const in_Header *ip, BOOL broadcast)
The main TCP input handler.
Definition: pctcp.c:649
tcp_Retransmitter
void tcp_Retransmitter(BOOL force)
Called periodically to perform retransmissions.
Definition: pctcp.c:1218
_tcp_cancel
void _tcp_cancel(const in_Header *ip, int icmp_type, int icmp_code, const char *msg, const void *arg)
Cancel a TCP socket.
Definition: pctcp.c:1734
init_localport
WORD init_localport(void)
Allocate the "lport_inuse" bit-array from heap.
Definition: ports.c:51
mtu_blackhole
BOOL mtu_blackhole
Definition: pctcp.c:63
tcp_nagle
BOOL tcp_nagle
Misc TCP values.
Definition: pctcp.c:134
_udp_listen
int _udp_listen(_udp_Socket *s, WORD lport, DWORD ip, WORD port)
Implementation for udp_listen() and udp_open().
Definition: pctcp.c:158
mtu_discover
BOOL mtu_discover
Definition: pctcp.c:62
_udp_allsocs
_udp_Socket * _udp_allsocs
list of udp-sockets
Definition: pctcp.c:72
_udp_cancel
void _udp_cancel(const in_Header *ip, int icmp_type, int icmp_code, const char *msg, const void *arg)
Cancel an UDP socket.
Definition: pctcp.c:1628
hostname
char hostname[MAX_HOSTLEN+1]
Our configured hostname.
Definition: pctcp.c:58
_tcp_sendsoon
int _tcp_sendsoon(_tcp_Socket *s, const char *file, unsigned line)
Schedule a transmission pretty soon.
Definition: pctcp.c:563
_udp_handler
_udp_Socket * _udp_handler(const in_Header *ip, BOOL broadcast)
Handler for incoming UDP packets.
Definition: pctcp.c:1042
_tcp_close
void _tcp_close(_tcp_Socket *s)
Close a TCP connection.
Definition: pctcp.c:471
_tcp_unthread
_tcp_Socket * _tcp_unthread(_tcp_Socket *s, BOOL free_tx)
Unthread a socket from the tcp socket list, if it's there.
Definition: pctcp.c:602
_tcp_allsocs
_tcp_Socket * _tcp_allsocs
list of tcp-sockets
Definition: pctcp.c:140
_udp_open
int _udp_open(_udp_Socket *s, WORD lport, DWORD ip, WORD port)
Implementation for udp_open(), also used by BSD connect().
Definition: pctcp.c:214
in_Header
Definition: wattcp.h:329
tcp_Header
Definition: wattcp.h:418
tcp_Socket
Definition: wattcp.h:584
tcp_rtt
Definition: pctcp.h:174
tcp_rtt::ip
DWORD ip
IP-address of this entry.
Definition: pctcp.h:175
tcp_rtt::rto
UINT rto
Round-trip timeout for this entry.
Definition: pctcp.h:176
tcp_rtt::MTU
UINT MTU
Path-MTU discovered for this entry.
Definition: pctcp.h:177


Watt-32 tcp/ip: E:/WATT/inc/net/pfil.h Source File

  • inc
  • net
pfil.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1996 Matthew R. Green
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. The name of the author may not be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#ifndef __NET_PFIL_H
34#define __NET_PFIL_H
35
36/* note: this file needs <net/if.h> and <sys/mbuf.h> */
37
38#if defined(NIPFILTER) && (NIPFILTER > 0)
39#undef PFIL_HOOKS
40#define PFIL_HOOKS
41#endif
42
43#endif


Watt-32 tcp/ip: E:/WATT/inc/netinet6/pim6.h Source File

  • inc
  • netinet6
pim6.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32/*
33 * Protocol Independent Multicast (PIM) definitions
34 *
35 * Written by Ahmed Helmy, SGI, July 1996
36 *
37 * MULTICAST
38 */
39
40/*
41 * PIM packet header
42 */
43#define PIM_VERSION 2
44
45struct pim {
46#if defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN)
47 u_char pim_type:4, /* the PIM message type, currently they are:
48 * Hello, Register, Register-Stop, Join/Prune,
49 * Bootstrap, Assert, Graft (PIM-DM only),
50 * Graft-Ack (PIM-DM only), C-RP-Adv
51 */
52 pim_ver:4; /* PIM version number; 2 for PIMv2 */
53#else
54 u_char pim_ver:4, /* PIM version */
55 pim_type:4; /* PIM type */
56#endif
57 u_char pim_rsv; /* Reserved */
58 u_short pim_cksum; /* IP style check sum */
59};
60
61#define PIM_MINLEN 8 /* The header min. length is 8 */
62#define PIM6_REG_MINLEN (PIM_MINLEN+40) /* Register message + inner IP6 header */
63
64/*
65 * Message types
66 */
67#define PIM_REGISTER 1 /* PIM Register type is 1 */
68
69/* second bit in reg_head is the null bit */
70#define PIM_NULL_REGISTER 0x40000000
pim
Definition: pim6.h:45


Watt-32 tcp/ip: E:/WATT/inc/netinet6/pim6_var.h Source File

  • inc
  • netinet6
pim6_var.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#ifndef _NETINET6_PIM6_VAR_H_
34#define _NETINET6_PIM6_VAR_H_
35
36/*
37 * Protocol Independent Multicast (PIM),
38 * implementation-specific definitions.
39 *
40 * Written by George Edmond Eddy (Rusty), ISI, February 1998
41 * Modified by Pavlin Ivanov Radoslavov, USC/ISI, May 1998
42 */
43
44struct pim6stat {
45 u_quad_t pim6s_rcv_total; /* total PIM messages received */
46 u_quad_t pim6s_rcv_tooshort; /* received with too few bytes */
47 u_quad_t pim6s_rcv_badsum; /* received with bad checksum */
48 u_quad_t pim6s_rcv_badversion; /* received bad PIM version */
49 u_quad_t pim6s_rcv_registers; /* received registers */
50 u_quad_t pim6s_rcv_badregisters; /* received invalid registers */
51 u_quad_t pim6s_snd_registers; /* sent registers */
52};
53
54#if (defined(KERNEL)) || (defined(_KERNEL))
55extern struct pim6stat pim6stat;
56
57int pim6_input (struct mbuf **, int*, int);
58#endif /* KERNEL */
59
60/*
61 * Names for PIM sysctl objects
62 */
63#define PIM6CTL_STATS 1 /* statistics (read-only) */
64#define PIM6CTL_MAXID 2
65
66#define PIM6CTL_NAMES { \
67 { 0, 0 }, \
68 { 0, 0 }, \
69}
70#endif /* _NETINET6_PIM6_VAR_H_ */
mbuf
Definition: mbuf.h:6
pim6stat
Definition: pim6_var.h:44


Watt-32 tcp/ip: E:/WATT/inc/rpc/pmap_cln.h Source File

  • inc
  • rpc
pmap_cln.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * pmap_clnt.h
36 * Supplies C routines to get to portmap services.
37 *
38 * Copyright (C) 1984, Sun Microsystems, Inc.
39 */
40
41/*
42 * Usage:
43 * success = pmap_set(program, version, protocol, port);
44 * success = pmap_unset(program, version);
45 * port = pmap_getport(address, program, version, protocol);
46 * head = pmap_getmaps(address);
47 * clnt_stat = pmap_rmtcall(address, program, version, procedure,
48 * xdrargs, argsp, xdrres, resp, tout, port_ptr)
49 * (works for udp only.)
50 * clnt_stat = clnt_broadcast(program, version, procedure,
51 * xdrargs, argsp, xdrres, resp, eachresult)
52 * (like pmap_rmtcall, except the call is broadcasted to all
53 * locally connected nets. For each valid response received,
54 * the procedure eachresult is called. Its form is:
55 * done = eachresult(resp, raddr)
56 * bool_t done;
57 * caddr_t resp;
58 * struct sockaddr_in raddr;
59 * where resp points to the results of the call and raddr is the
60 * address if the responder to the broadcast.
61 */
62
63#ifndef __RPC_PMAP_CLIENT_H
64#define __RPC_PMAP_CLIENT_H
65
66#include <netinet/in.h>
67#include <rpc/xdr.h>
68
69__BEGIN_DECLS
70
71extern bool_t pmap_set (u_long, u_long, int, int);
72extern bool_t pmap_unset (u_long, u_long);
73extern struct pmaplist *pmap_getmaps (struct sockaddr_in *);
74extern enum clnt_stat pmap_rmtcall (struct sockaddr_in *, u_long, u_long,
75 u_long, xdrproc_t, caddr_t, xdrproc_t,
76 caddr_t, struct timeval, u_long *);
77extern enum clnt_stat clnt_broadcast(u_long, u_long, u_long, xdrproc_t,
78 char *, xdrproc_t, char *, bool_t (*)());
79extern u_short pmap_getport (struct sockaddr_in *, u_long, u_long, u_int);
80
81__END_DECLS
82
83#endif
in.h
pmaplist
Definition: pmap_pro.h:95
sockaddr_in
Definition: in.h:224
timeval
Definition: wtime.h:30
xdr.h


Watt-32 tcp/ip: E:/WATT/inc/rpc/pmap_pro.h Source File

  • inc
  • rpc
pmap_pro.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * pmap_prot.h
36 * Protocol for the local binder service, or pmap.
37 *
38 * Copyright (C) 1984, Sun Microsystems, Inc.
39 *
40 * The following procedures are supported by the protocol:
41 *
42 * PMAPPROC_NULL() returns ()
43 * takes nothing, returns nothing
44 *
45 * PMAPPROC_SET(struct pmap) returns (bool_t)
46 * TRUE is success, FALSE is failure. Registers the tuple
47 * [prog, vers, prot, port].
48 *
49 * PMAPPROC_UNSET(struct pmap) returns (bool_t)
50 * TRUE is success, FALSE is failure. Un-registers pair
51 * [prog, vers]. prot and port are ignored.
52 *
53 * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
54 * 0 is failure. Otherwise returns the port number where the pair
55 * [prog, vers] is registered. It may lie!
56 *
57 * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
58 *
59 * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
60 * RETURNS (port, string<>);
61 * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
62 * Calls the procedure on the local machine. If it is not registered,
63 * this procedure is quite; ie it does not return error information!!!
64 * This procedure only is supported on rpc/udp and calls via
65 * rpc/udp. This routine only passes null authentication parameters.
66 * This file has no interface to xdr routines for PMAPPROC_CALLIT.
67 *
68 * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
69 */
70
71#ifndef __RPC_PMAP_PROT_H
72#define __RPC_PMAP_PROT_H
73
74#include <rpc/xdr.h>
75
76#define PMAPPORT ((u_short)111)
77#define PMAPPROG ((u_long)100000)
78#define PMAPVERS ((u_long)2)
79#define PMAPVERS_PROTO ((u_long)2)
80#define PMAPVERS_ORIG ((u_long)1)
81#define PMAPPROC_NULL ((u_long)0)
82#define PMAPPROC_SET ((u_long)1)
83#define PMAPPROC_UNSET ((u_long)2)
84#define PMAPPROC_GETPORT ((u_long)3)
85#define PMAPPROC_DUMP ((u_long)4)
86#define PMAPPROC_CALLIT ((u_long)5)
87
88struct pmap {
89 long unsigned pm_prog;
90 long unsigned pm_vers;
91 long unsigned pm_prot;
92 long unsigned pm_port;
93 };
94
95struct pmaplist {
96 struct pmap pml_map;
97 struct pmaplist *pml_next;
98 };
99
100__BEGIN_DECLS
101
102extern bool_t xdr_pmap (XDR *, struct pmap *);
103extern bool_t xdr_pmaplist(XDR *, struct pmaplist **);
104
105__END_DECLS
106
107#endif
XDR
Definition: xdr.h:116
pmap
Definition: pmap_pro.h:88
pmaplist
Definition: pmap_pro.h:95
xdr.h


Watt-32 tcp/ip: E:/WATT/inc/rpc/pmap_rmt.h Source File

  • inc
  • rpc
pmap_rmt.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * Structures and XDR routines for parameters to and replies from
36 * the portmapper remote-call-service.
37 *
38 * Copyright (C) 1986, Sun Microsystems, Inc.
39 */
40
41#ifndef __RPC_PMAP_REMOTE_H
42#define __RPC_PMAP_REMOTE_H
43
44#include <rpc/xdr.h>
45
46struct rmtcallargs {
47 u_long prog, vers, proc, arglen;
48 caddr_t args_ptr;
49 xdrproc_t xdr_args;
50 };
51
52struct rmtcallres {
53 u_long *port_ptr;
54 u_long resultslen;
55 caddr_t results_ptr;
56 xdrproc_t xdr_results;
57 };
58
59__BEGIN_DECLS
60
61extern bool_t xdr_rmtcall_args (XDR *, struct rmtcallargs *);
62extern bool_t xdr_rmtcallres (XDR *, struct rmtcallres *);
63
64__END_DECLS
65
66#endif
XDR
Definition: xdr.h:116
proc
Definition: if.h:81
rmtcallargs
Definition: pmap_rmt.h:46
rmtcallres
Definition: pmap_rmt.h:52
xdr.h


Watt-32 tcp/ip: E:/WATT/inc/poll.h Source File

  • inc
poll.h
Go to the documentation of this file.
1
4/*
5 * POSIX requires (AFAIK) this file in a base-dir
6 */
7#ifndef __POLL_H
8#define __POLL_H
9
10#include <sys/poll.h>
11
12#endif
poll.h


Watt-32 tcp/ip: E:/WATT/src/ports.c Source File

  • src
ports.c
Go to the documentation of this file.
1
8#include <stdio.h>
9#include <stdlib.h>
10#include <limits.h>
11
12#include "copyrigh.h"
13#include "wattcp.h"
14#include "misc.h"
15#include "misc_str.h"
16#include "run.h"
17#include "pctcp.h"
18
19#if (DOSX)
20 #define MAX_PORT USHRT_MAX /* 65535 */
21#else
22 #define MAX_PORT 5000
23#endif
24
25/*
26 * Allocated local TCP/UDP-ports start at 1025 (empherical range). We can
27 * at max handle MAX_PORT local ports. Use an array of 'fd_set' to check which
28 * port is free or not.
29 */
30#define MIN_PORT 1025
31#define NUM_FD_SETS (1 + (MAX_PORT / (8*sizeof(fd_set))))
32
33int use_rand_lport = TRUE;
34static fd_set *lport_inuse;
35
39static void W32_CALL exit_localport (void)
40{
41 if (!_watt_fatal_error)
42 DO_FREE (lport_inuse);
43}
44
51WORD init_localport (void)
52{
53 size_t size = sizeof(fd_set) * NUM_FD_SETS;
54
55 lport_inuse = calloc (size, 1);
56 if (!lport_inuse)
57 return (0);
58
59 RUNDOWN_ADD (exit_localport, 303);
60 return (MAX_PORT);
61}
62
63/*
64 * Return unused local port
65 * - port = 0 -> normal port,
66 * - port = 1 -> special port (513-1023)
67 *
68 * `linger' is set if port shall be matched against "sleeping" ports.
69 * Local tcp-ports should not be reused 60sec (2*MSL) after they have
70 * been closed. Note this is NOT related to 'sock_delay'.
71 */
72WORD find_free_port (WORD port, BOOL linger)
73{
74 WORD p, lo_port, hi_port;
75
76 if (!lport_inuse)
77 return (port);
78
79 if (port > 0 && port < USHRT_MAX) /* return port as-is */
80 return (port);
81
82 if (port == 0)
83 {
84 if (use_rand_lport)
85 lo_port = Random (MIN_PORT, 1500);
86 else lo_port = MIN_PORT;
87 }
88 else
89 lo_port = 513;
90
91 hi_port = MAX_PORT; /* our empherical max-port */
92
93 for (p = lo_port; p <= hi_port; p++)
94 {
95 if (linger && FD_ISSET(p,lport_inuse)) /* inuse, try next */
96 continue;
97
98 if (_udp_allsocs)
99 {
100 const _udp_Socket *udp = _udp_allsocs;
101
102 while (udp->next && udp->myport != p)
103 udp = udp->next;
104 if (udp->myport == p)
105 continue;
106 }
107#if !defined(USE_UDP_ONLY)
108 if (_tcp_allsocs)
109 {
110 const _tcp_Socket *tcp = _tcp_allsocs;
111
112 while (tcp->next && tcp->myport != p)
113 tcp = tcp->next;
114 if (tcp->myport == p)
115 continue;
116 }
117#endif
118 break;
119 }
120 FD_SET (p, lport_inuse);
121 return (p);
122}
123
124#if defined(USE_BSD_API)
125/*
126 * Set the "lport_inuse" bit for a local port.
127 * 'port' is in host order.
128 * Returns original state or -1 if port above our range.
129 */
130int grab_localport (WORD port)
131{
132 int rc;
133
134#if (MAX_PORT < USHRT_MAX)
135 if (port > MAX_PORT)
136 return (-1);
137#endif
138
139 if (!lport_inuse)
140 return (-1);
141
142 rc = FD_ISSET (port, lport_inuse);
143 FD_SET (port, lport_inuse);
144 return (rc);
145}
146
147#else
148int grab_localport (WORD port)
149{
150 ARGSUSED (port);
151 return (-1);
152}
153#endif
154
155/*
156 * Clear the "lport_inuse" bit for a local port.
157 * 'port' is in host order. Port 0 is not considered a port.
158 * Returns original state or -1 if port above our range.
159 */
160int reuse_localport (WORD port)
161{
162 int rc;
163
164#if (MAX_PORT < USHRT_MAX)
165 if (port > MAX_PORT)
166 return (-1);
167#endif
168
169 if (!lport_inuse)
170 return (-1);
171
172 rc = FD_ISSET (port, lport_inuse);
173 FD_CLR (port, lport_inuse);
174 return (rc);
175}
176
177#if !defined(USE_UDP_ONLY)
178/*
179 * Reuse local port now if not owned by a STREAM-socket.
180 * Otherwise let socket daemon free local port when linger period
181 * expires. We don't care about rapid reuse of local ports associated
182 * with DGRAM-sockets.
183 */
184int maybe_reuse_localport (_tcp_Socket *s)
185{
186#if defined(USE_BSD_API)
187 if (!_bsd_socket_hook || !(*_bsd_socket_hook)(BSO_FIND_SOCK,s))
188 return reuse_localport (s->myport);
189 return (0);
190#else
191 return reuse_localport (s->myport);
192#endif
193}
194#endif /* USE_UDP_ONLY */
copyrigh.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
Random
unsigned W32_CALL Random(unsigned a, unsigned b)
Returns a random integer in range [a..b].
Definition: misc.c:743
misc.h
misc_str.h
_udp_allsocs
_udp_Socket * _udp_allsocs
list of udp-sockets
Definition: pctcp.c:72
_tcp_allsocs
_tcp_Socket * _tcp_allsocs
list of tcp-sockets
Definition: pctcp.c:140
pctcp.h
exit_localport
static void W32_CALL exit_localport(void)
Free allocated memory.
Definition: ports.c:39
init_localport
WORD init_localport(void)
Allocate the "lport_inuse" bit-array from heap.
Definition: ports.c:51
fd_set
Definition: wtypes.h:256
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::next
struct tcp_Socket * next
link to next tcp-socket
Definition: wattcp.h:585
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/powerpak.c Source File

  • src
powerpak.c
Go to the documentation of this file.
1
15#include <stdio.h>
16#include <stdlib.h>
17#include <string.h>
18
19#include "wattcp.h"
20#include "printk.h"
21#include "misc.h"
22#include "wdpmi.h"
23#include "powerpak.h"
24
25#if (DOSX & POWERPAK) && defined(BORLAND386)
26
27extern int _ostype;
28
29/* Don't include <windows.h> because of conflicting types etc.
30 */
31#define WINAPI __stdcall __import
32
33extern void * WINAPI GetModuleHandleA (const char *module);
34extern void * WINAPI GetProcAddress (void *module, const char *func);
35
36/* these are missing in Win32, damn...
37 */
38static UINT (WINAPI* _AllocSelector) (UINT);
39static UINT (WINAPI* _FreeSelector) (UINT);
40
41BOOL powerpak_init (void)
42{
43 void *mod;
44
45 if (_ostype == 2) /* plain DOS */
46 return (TRUE);
47
48 mod = GetModuleHandleA ("kernel32.dll");
49 if (!mod)
50 return (FALSE);
51
52 _AllocSelector = (UINT (WINAPI*)(UINT)) GetProcAddress (mod, "AllocSelector");
53 _FreeSelector = (UINT (WINAPI*)(UINT)) GetProcAddress (mod, "FreeSelector");
54 return (_AllocSelector && _FreeSelector);
55}
56
57WORD dpmi_create_dos_selector (void)
58{
59 WORD sel;
60
61 if (_ostype != 2) /* Not plain DOS */
62 return (*_AllocSelector) (0);
63
64 __dpmi_errno = 0;
65 _EAX = 0; /* DPMI 0: create selector */
66 _ECX = 1;
67 geninterrupt (0x31);
68 if (_FLAGS & CARRY_BIT)
69 {
70 __dpmi_errno = _AX;
71 return (0);
72 }
73 sel = _AX;
74 _EAX = 8; /* DPMI 8: set limit 1MByte */
75 _BX = sel;
76 _CX = 0x0F;
77 _DX = 0xFFFF;
78 geninterrupt (0x31);
79 if (_FLAGS & CARRY_BIT)
80 {
81 __dpmi_errno = _AX;
82 return (0);
83 }
84 return (sel);
85}
86
87int dpmi_free_dos_selector (WORD sel)
88{
89 if (_ostype != 2) /* Not plain DOS */
90 return (*_FreeSelector) (sel);
91
92 __dpmi_errno = 0;
93 _EAX = 1;
94 _BX = sel;
95 geninterrupt (0x31);
96 if (_FLAGS & CARRY_BIT)
97 {
98 __dpmi_errno = _AX;
99 return (0);
100 }
101 return (1);
102}
103
104void ReadRealMem (void *dst, REALPTR rp, unsigned size)
105{
106 DWORD lin = (RP_SEG(rp) << 4) + RP_OFF(rp);
107
108 __asm {
109 push ds
110 push edi
111 push esi
112 mov ds, _watt_dos_ds
113 mov esi, lin
114 mov edi, dst
115 mov ecx, size
116 shr ecx, 2
117 cld
118 db 0F3h, 0A5h /* rep movsd */
119 mov ecx, size
120 and ecx, 3
121 rep movsb /* move rest */
122 pop esi
123 pop edi
124 pop ds
125 }
126}
127
128void WriteRealMem (REALPTR rp, const void *src, int size)
129{
130 DWORD lin = (RP_SEG(rp) << 4) + RP_OFF(rp);
131
132 __asm {
133 push es
134 push edi
135 push esi
136 mov es, _watt_dos_ds
137 mov edi, lin
138 mov esi, src
139 mov ecx, size
140 shr ecx, 2
141 cld
142 db 0F3h, 0A5h /* rep movsd */
143 mov ecx, size
144 and ecx, 3
145 rep movsb /* move rest */
146 pop esi
147 pop edi
148 pop es
149 }
150}
151
152BYTE _farpeekb (WORD sel, DWORD ofs)
153{
154 __asm {
155 push es
156 mov ax, sel
157 mov edx, ofs
158 mov es, ax
159 mov al, es:[edx]
160 pop es
161 }
162 return (_AL);
163}
164
165WORD _farpeekw (WORD sel, DWORD ofs)
166{
167 __asm {
168 push es
169 mov ax, sel
170 mov edx, ofs
171 mov es, ax
172 mov ax, es:[edx]
173 pop es
174 }
175 return (_AX);
176}
177
178DWORD _farpeekl (WORD sel, DWORD ofs)
179{
180 __asm {
181 push es
182 mov ax, sel
183 mov edx, ofs
184 mov es, ax
185 mov eax, es:[edx]
186 pop es
187 }
188 return (_EAX);
189}
190
191void _farpokeb (WORD sel, DWORD ofs, BYTE val)
192{
193 __asm {
194 push es
195 mov ax, sel
196 mov edx, ofs
197 mov es, ax
198 mov al, val
199 mov es:[edx], al
200 pop es
201 }
202}
203
204void _farpokew (WORD sel, DWORD ofs, WORD val)
205{
206 __asm {
207 push es
208 mov ax, sel
209 mov edx, ofs
210 mov es, ax
211 mov ax, val
212 mov es:[edx], ax
213 pop es
214 }
215}
216
217void _farpokel (WORD sel, DWORD ofs, DWORD val)
218{
219 __asm {
220 push es
221 mov ax, sel
222 mov edx, ofs
223 mov es, ax
224 mov eax, val
225 mov es:[edx], eax
226 pop es
227 }
228}
229
230int dpmi_getvect (int intr, WORD *sel, DWORD *ofs)
231{
232 __asm {
233 push ebx
234 push es
235 mov ah, 0x35
236 mov al, byte ptr intr
237 int 0x21
238 mov ax, es
239 pop es
240 mov edx, sel
241 mov [edx], ax
242 mov edx, ofs
243 mov [edx], ebx
244 pop ebx
245 }
246 return (1);
247}
248
249int dpmi_setvect (int intr, WORD sel, DWORD ofs)
250{
251 __asm {
252 push ds
253 mov edx, ofs
254 mov ax, sel
255 mov ds, ax
256 mov ah, 0x25
257 mov al, byte ptr intr
258 int 0x21
259 pop ds
260 }
261 return (1);
262}
263
264#if !defined(USE_FAST_PKT)
265
266/* Some code below borrowed from djgpp, some heavily modified */
267
268/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
269/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
270/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
271/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
272
273/* This code really can't be nested since the RMCB structure isn't copied,
274 * so the stack check isn't really useful. But someone may fix it someday.
275 * On entry CS is known to be ours, ES is probably ours (since we passed it),
276 * SS:ESP is locked 4K stack. ES:EDI is regs structure, DS:ESI is RM SS:SP.
277 * Do NOT enable interrupts in the user routine. Thanks to ctm@ardi.com for
278 * the improvements. C. Sandmann 3/95
279 */
280
281#define FILL 0x00
282
283static BYTE wrapper_code[] = {
284/* 00 */ 0x06, /* push es */
285/* 01 */ 0x1E, /* push ds */
286/* 02 */ 0x06, /* push es */
287/* 03 */ 0x1F, /* pop ds */
288/* 04 */ 0x66, 0xB8, /* mov ax, */
289/* 06 */ FILL, FILL, /* _our_selector */
290/* 08 */ 0x8E, 0xD8, /* mov ds, ax */
291/* 0A */ 0xFF, 0x05, /* incl */
292/* 0C */ FILL, FILL, FILL, FILL, /* _call_count */
293/* 10 */ 0x83, 0x3D, /* cmpl */
294/* 12 */ FILL, FILL, FILL, FILL, /* _in_this_handler */
295/* 16 */ 0x00, /* $0 */
296/* 17 */ 0x75, /* jne */
297/* 18 */ 0x33, /* out */
298/* 19 */ 0xC6, 0x05, /* movb */
299/* 1B */ FILL, FILL, FILL, FILL, /* _in_this_handler */
300/* 1F */ 0x01, /* $1 */
301/* 20 */ 0x8E, 0xC0, /* mov es, ax */
302/* 22 */ 0x8E, 0xE0, /* mov fs, ax */
303/* 24 */ 0x8E, 0xE8, /* mov gs, ax */
304/* 26 */ 0xBB, /* mov ebx, */
305/* 27 */ FILL, FILL, FILL, FILL, /* _local_stack */
306/* 2B */ 0xFC, /* cld */
307/* 2C */ 0x89, 0xE1, /* mov ecx, esp */
308/* 2E */ 0x8C, 0xD2, /* mov dx, ss */
309/* 30 */ 0x8E, 0xD0, /* mov ss, ax */
310/* 32 */ 0x89, 0xDC, /* mov esp, ebx */
311/* 34 */ 0x52, /* push edx */
312/* 35 */ 0x51, /* push ecx */
313/* 36 */ 0x56, /* push esi */
314/* 37 */ 0x57, /* push edi */
315/* 38 */ 0xE8, /* call */
316/* 39 */ FILL, FILL, FILL, FILL, /* _rmcb */
317/* 3D */ 0x5F, /* pop edi */
318/* 3E */ 0x5E, /* pop esi */
319/* 3F */ 0x58, /* pop eax */
320/* 40 */ 0x5B, /* pop ebx */
321/* 41 */ 0x8E, 0xD3, /* mov ss, bx */
322/* 43 */ 0x89, 0xC4, /* mov esp, eax */
323/* 45 */ 0xC6, 0x05, /* movb */
324/* 47 */ FILL, FILL, FILL, FILL, /* _in_this_handler */
325/* 4B */ 0x00, /* $0 */
326/* 4C */ 0x1F, /* out:pop ds */
327/* 4D */ 0x07, /* pop es */
328/* 4E */ 0x8B, 0x06, /* mov eax,[esi] */
329/* 50 */ 0x26, 0x89, 0x47,0x2A, /* mov es:[edi+42],eax */
330/* 54 */ 0x66, 0x26, 0x83,0x47,0x2E,4, /* add es:[edi+46],0x4 */
331 0xCF /* iret */
332 };
333
334#define RMCB_STACK_SIZE (4*1024)
335
336static REALPTR alloc_callback (void (*callback)(void), REAL_regs *regs)
337{
338 __asm { /* I had to use assembly here because int386x() crashed */
339 mov __dpmi_errno, 0
340 push es
341 push ds
342 push edi
343 push esi
344 mov ax, ds
345
346 mov edi, regs
347 mov es, ax /* ES:EDI = DS:regs */
348
349 mov ax, cs
350 mov ds, ax
351 mov esi, callback /* DS:ESI = CS:callback */
352
353 mov ax, 303h
354 int 31h
355 pop esi
356 pop edi
357 pop ds
358 pop es
359 jc fail:
360 }
361 return (_CX << 16) + _DX;
362
363fail:
364 __dpmi_errno = _AX;
365 return (0);
366}
367
368REALPTR dpmi_alloc_callback_retf (DPMI_callback *cb)
369{
370 REALPTR rmcb;
371 BYTE *wrapper = calloc (sizeof(wrapper_code) + RMCB_STACK_SIZE, 1);
372 BYTE *stack = wrapper + sizeof(wrapper_code);
373
374 if (!wrapper)
375 return (0);
376
377 memcpy (wrapper, wrapper_code, sizeof(wrapper_code));
378
379 if (!dpmi_lock_region(&cb->rm_regs, sizeof(cb->rm_regs)) ||
380 !dpmi_lock_region(wrapper, sizeof(wrapper_code) + RMCB_STACK_SIZE))
381 {
382 fprintf (stderr, "dpmi_lock_region: DPMI error %04Xh\n", __dpmi_errno);
383 free (wrapper);
384 free (stack);
385 return (0);
386 }
387
388 *(short*)(wrapper+0x06) = _DS;
389 *(long*) (wrapper+0x0C) = (long) stack + 8;
390 *(long*) (wrapper+0x12) = (long) stack + 4;
391 *(long*) (wrapper+0x1B) = (long) stack + 4;
392 *(long*) (wrapper+0x27) = (long) stack + RMCB_STACK_SIZE; /* !! was -4 */
393 *(long*) (wrapper+0x39) = (long) cb->pm_func - ((long)wrapper + 0x3D);
394 *(long*) (wrapper+0x47) = (long) stack + 4;
395
396 rmcb = alloc_callback ((void(*)(void))wrapper, &cb->rm_regs);
397 if (!rmcb)
398 {
399 free (wrapper);
400 fprintf (stderr, "dpmi_alloc_callback: DPMI error %04Xh\n", __dpmi_errno);
401 return (0);
402 }
403 cb->wrapper = wrapper;
404 cb->rm_addr = rmcb;
405 return (1);
406}
407
408int dpmi_free_callback_retf (DPMI_callback *cb)
409{
410 union REGS r;
411
412 if (!cb || !cb->wrapper)
413 return (0);
414
415 free (cb->wrapper);
416 cb->wrapper = NULL;
417 cb->pm_func = NULL;
418
419 __dpmi_errno = 0;
420 r.w.ax = 0x304;
421 r.w.cx = RP_SEG (cb->rm_addr);
422 r.w.dx = RP_OFF (cb->rm_addr);
423 int386 (0x31, &r, &r);
424 if (r.w.cflag & 1)
425 {
426 __dpmi_errno = r.w.ax;
427 return (0);
428 }
429 return (1);
430}
431#endif /* USE_FAST_PKT */
432#endif /* (DOSX & POWERPAK) && BORLAND386 */
433
misc.h
powerpak.h
printk.h
DPMI_callback
Definition: powerpak.h:33
REAL_regs
Definition: powerpak.h:17
ah
Definition: ah.h:45
wattcp.h
Core definitions.
wdpmi.h


Watt-32 tcp/ip: E:/WATT/src/powerpak.h Source File

  • src
powerpak.h
Go to the documentation of this file.
1
3#ifndef _w32_POWERPAK_H
4#define _w32_POWERPAK_H
5
6#if (DOSX & POWERPAK) && defined(BORLAND386)
7
8#undef REALPTR
9#define REALPTR DWORD /* segment in upper 16 bits */
10#define RP_SET(rp,ofs,seg) (rp = ((DWORD)(seg) << 16) + (ofs))
11#define RP_OFF(rp) (WORD)((DWORD)(rp) & 0xFFFF)
12#define RP_SEG(rp) (WORD)((DWORD)(rp) >> 16)
13#define PokeRealWord(rp,x) WriteRealMem (rp, &(x), sizeof(WORD))
14
15#include <sys/pack_on.h>
16
17typedef struct {
18 DWORD r_di;
19 DWORD r_si;
20 DWORD r_bp;
21 DWORD reserved;
22 DWORD r_bx;
23 DWORD r_dx;
24 DWORD r_cx;
25 DWORD r_ax;
26 WORD r_flags;
27 WORD r_es, r_ds, r_fs, r_gs;
28 WORD r_ip, r_cs, r_sp, r_ss;
29 } REAL_regs;
30
31#include <sys/pack_off.h>
32
33typedef struct {
34 void (*pm_func)(void);
35 BYTE *wrapper;
36 REALPTR rm_addr;
37 REAL_regs rm_regs;
38 } DPMI_callback;
39
40extern BOOL powerpak_init (void);
41
42extern WORD dpmi_create_dos_selector (void);
43extern int dpmi_free_dos_selector (WORD sel);
44extern int dpmi_delete_memory_alias (void);
45extern DWORD dpmi_create_memory_alias (DWORD addr, DWORD len);
46extern REALPTR dpmi_alloc_callback_retf (DPMI_callback *cb);
47extern int dpmi_free_callback_retf (DPMI_callback *cb);
48
49extern int dpmi_getvect (int intr, WORD *sel, DWORD *ofs);
50extern int dpmi_setvect (int intr, WORD sel, DWORD ofs);
51
52extern void ReadRealMem (void *buf, REALPTR rp, unsigned len);
53extern void WriteRealMem (REALPTR rp, const void *src, int size);
54
55extern BYTE _farpeekb (WORD sel, DWORD ofs);
56extern WORD _farpeekw (WORD sel, DWORD ofs);
57extern DWORD _farpeekl (WORD sel, DWORD ofs);
58extern void _farpokeb (WORD sel, DWORD ofs, BYTE val);
59extern void _farpokew (WORD sel, DWORD ofs, WORD val);
60extern void _farpokel (WORD sel, DWORD ofs, DWORD val);
61
62#endif
63#endif
pack_off.h
pack_on.h
DPMI_callback
Definition: powerpak.h:33
REAL_regs
Definition: powerpak.h:17


Watt-32 tcp/ip: E:/WATT/inc/net/ppp-comp.h Source File

  • inc
  • net
ppp-comp.h
Go to the documentation of this file.
1
5/*
6 * ppp-comp.h - Definitions for doing PPP packet compression.
7 *
8 * Copyright (c) 1994 The Australian National University.
9 * All rights reserved.
10 *
11 * Permission to use, copy, modify, and distribute this software and its
12 * documentation is hereby granted, provided that the above copyright
13 * notice appears in all copies. This software is provided without any
14 * warranty, express or implied. The Australian National University
15 * makes no representations about the suitability of this software for
16 * any purpose.
17 *
18 * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
19 * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
20 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
21 * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
22 * OF SUCH DAMAGE.
23 *
24 * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
25 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
27 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
28 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
29 * OR MODIFICATIONS.
30 */
31
32#ifndef __NET_PPP_COMP_H
33#define __NET_PPP_COMP_H
34
35/*
36 * The following symbols control whether we include code for
37 * various compression methods.
38 */
39#ifndef DO_BSD_COMPRESS
40#define DO_BSD_COMPRESS 1 /* by default, include BSD-Compress */
41#endif
42
43#ifndef DO_DEFLATE
44#define DO_DEFLATE 1 /* by default, include Deflate */
45#endif
46
47#define DO_PREDICTOR_1 0
48#define DO_PREDICTOR_2 0
49
50/*
51 * Structure giving methods for compression/decompression.
52 */
53#ifdef PACKETPTR
54struct compressor {
55 int compress_proto; /* CCP compression protocol number */
56
57 /* Allocate space for a compressor (transmit side) */
58 void *(*comp_alloc) (u_char *options, int opt_len);
59
60 /* Free space used by a compressor */
61 void (*comp_free) (void *state);
62
63 /* Initialize a compressor */
64 int (*comp_init) (void *state, u_char *options, int opt_len,
65 int unit, int hdrlen, int debug);
66 /* Reset a compressor */
67 void (*comp_reset) (void *state);
68
69 /* Compress a packet */
70 int (*compress) (void *state, PACKETPTR *mret,
71 PACKETPTR mp, int orig_len, int max_len);
72
73 /* Return compression statistics */
74 void (*comp_stat) (void *state, struct compstat *stats);
75
76 /* Allocate space for a decompressor (receive side) */
77 void *(*decomp_alloc) (u_char *options, int opt_len);
78
79 /* Free space used by a decompressor */
80 void (*decomp_free) (void *state);
81
82 /* Initialize a decompressor */
83 int (*decomp_init) (void *state, u_char *options, int opt_len,
84 int unit, int hdrlen, int mru, int debug);
85 /* Reset a decompressor */
86 void (*decomp_reset) (void *state);
87
88 /* Decompress a packet. */
89 int (*decompress) (void *state, PACKETPTR mp, PACKETPTR *dmpp);
90
91 /* Update state for an incompressible packet received */
92 void (*incomp) (void *state, PACKETPTR mp);
93
94 /* Return decompression statistics */
95 void (*decomp_stat) (void *state, struct compstat *stats);
96};
97#endif /* PACKETPTR */
98
99/*
100 * Return values for decompress routine.
101 * We need to make these distinctions so that we can disable certain
102 * useful functionality, namely sending a CCP reset-request as a result
103 * of an error detected after decompression. This is to avoid infringing
104 * a patent held by Motorola.
105 * Don't you just lurve software patents.
106 */
107#define DECOMP_OK 0 /* everything went OK */
108#define DECOMP_ERROR 1 /* error detected before decomp. */
109#define DECOMP_FATALERROR 2 /* error detected after decomp. */
110
111/*
112 * CCP codes.
113 */
114#define CCP_CONFREQ 1
115#define CCP_CONFACK 2
116#define CCP_TERMREQ 5
117#define CCP_TERMACK 6
118#define CCP_RESETREQ 14
119#define CCP_RESETACK 15
120
121/*
122 * Max # bytes for a CCP option
123 */
124#define CCP_MAX_OPTION_LENGTH 32
125
126/*
127 * Parts of a CCP packet.
128 */
129#define CCP_CODE(dp) ((dp)[0])
130#define CCP_ID(dp) ((dp)[1])
131#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3])
132#define CCP_HDRLEN 4
133
134#define CCP_OPT_CODE(dp) ((dp)[0])
135#define CCP_OPT_LENGTH(dp) ((dp)[1])
136#define CCP_OPT_MINLEN 2
137
138/*
139 * Definitions for BSD-Compress.
140 */
141#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */
142#define CILEN_BSD_COMPRESS 3 /* length of config. option */
143
144/* Macros for handling the 3rd byte of the BSD-Compress config option. */
145#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */
146#define BSD_VERSION(x) ((x) >> 5) /* version of option format */
147#define BSD_CURRENT_VERSION 1 /* current version number */
148#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n))
149
150#define BSD_MIN_BITS 9 /* smallest code size supported */
151#define BSD_MAX_BITS 15 /* largest code size supported */
152
153/*
154 * Definitions for Deflate.
155 */
156#define CI_DEFLATE 24 /* config option for Deflate */
157#define CILEN_DEFLATE 4 /* length of its config option */
158
159#define DEFLATE_MIN_SIZE 8
160#define DEFLATE_MAX_SIZE 15
161#define DEFLATE_METHOD_VAL 8
162#define DEFLATE_SIZE(x) (((x) >> 4) + DEFLATE_MIN_SIZE)
163#define DEFLATE_METHOD(x) ((x) & 0x0F)
164#define DEFLATE_MAKE_OPT(w) ((((w) - DEFLATE_MIN_SIZE) << 4) \
165 + DEFLATE_METHOD_VAL)
166#define DEFLATE_CHK_SEQUENCE 0
167
168/*
169 * Definitions for other, as yet unsupported, compression methods.
170 */
171#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */
172#define CILEN_PREDICTOR_1 2 /* length of its config option */
173#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */
174#define CILEN_PREDICTOR_2 2 /* length of its config option */
175
176#endif
compressor
Definition: ppp-comp.h:54
compstat
Definition: ppp_defs.h:171


Watt-32 tcp/ip: E:/WATT/src/ppp.c Source File

  • src
ppp.c
Go to the documentation of this file.
1
26#include <stdio.h>
27#include <stdlib.h>
28#include <string.h>
29#include <ctype.h>
30#include <time.h>
31#include <limits.h>
32#include <netinet/in.h>
33
34#include "wattcp.h"
35#include "misc.h"
36#include "misc_str.h"
37#include "pcdbug.h"
38#include "pcqueue.h"
39#include "pcconfig.h"
40#include "pcarp.h"
41#include "pcsed.h"
42#include "pcpkt.h"
43#include "pctcp.h"
44#include "run.h"
45#include "ip4_in.h"
46#include "netaddr.h"
47#include "pppoe.h"
48#include "ppp.h"
49
50#if defined(USE_PPPOE)
51
52#define INITIAL_TIMEOUT 2
53#define MAX_TERMINATE 2
54#define MAX_CONFIGURE 10
55#define MAX_FAILURE 5
56#define MAX_TIMEOUT 8
57
58
59static DWORD remote_ip_base = 0x0A000000;
60static DWORD remote_ip_mask = 0xFF000000;
61static int debug = 0;
62
63
64static struct ppp_state mystate;
65
66static void ipcp_addr_req (struct ppp_state *state,
67 struct ppp_xcp *xcp, const struct xcp_type *tp,
68 const BYTE *buf, int len);
69
70static void ipcp_addr_nak (struct ppp_state *state,
71 struct ppp_xcp *xcp, const struct xcp_type *tp,
72 const BYTE *buf, int len);
73
74static void ipcp_addr_show (struct ppp_state *state,
75 struct ppp_xcp *xcp, const struct xcp_type *tp,
76 const BYTE *buf, int len);
77
78static void send_event (struct ppp_state *state, struct ppp_xcp *xcp,
79 enum ppp_event event);
80
81static void change_phase (struct ppp_state *state, enum ppp_phase phase);
82
83
84static const struct xcp_type lcp_types[] = {
85 { NULL, -1, 0, 0, 0, 0, NULL, NULL, NULL }
86 };
87
88static const struct xcp_type ipcp_types[] = {
89 { "IP-Address", 3, 1, 6, 6, 0, ipcp_addr_req,
90 ipcp_addr_nak, ipcp_addr_show },
91 { NULL, -1, 0, 0, 0, 0, NULL, NULL, NULL }
92 };
93
94
95/* Dispatch table from RFC 1661
96 */
97static const struct ppp_dispatch {
98 enum xcp_state next;
99 enum xcp_action act[3];
100 } ppp_dispatch[10][16] = {
101
102 { /* stInitial */
103 /* evUp */ { stClosed, { acNull, acNull, acNull } },
104 /* evDown */ { stNoChange, { acNull, acNull, acNull } },
105 /* evOpen */ { stStarting, { acTls, acNull, acNull } },
106 /* evClose */ { stClosed, { acNull, acNull, acNull } },
107 /* evTOp */ { stNoChange, { acNull, acNull, acNull } },
108 /* evTOm */ { stNoChange, { acNull, acNull, acNull } },
109 /* evRCRp */ { stNoChange, { acNull, acNull, acNull } },
110 /* evRCRm */ { stNoChange, { acNull, acNull, acNull } },
111 /* evRCA */ { stNoChange, { acNull, acNull, acNull } },
112 /* evRCN */ { stNoChange, { acNull, acNull, acNull } },
113 /* evRTR */ { stNoChange, { acNull, acNull, acNull } },
114 /* evRTA */ { stNoChange, { acNull, acNull, acNull } },
115 /* evRUC */ { stNoChange, { acNull, acNull, acNull } },
116 /* evRXJp */ { stNoChange, { acNull, acNull, acNull } },
117 /* evRXJm */ { stNoChange, { acNull, acNull, acNull } },
118 /* evRXR */ { stNoChange, { acNull, acNull, acNull } },
119 },
120 { /* stStarting */
121 /* evUp */ { stReqSent, { acIrc, acScr, acNull } },
122 /* evDown */ { stNoChange, { acNull, acNull, acNull } },
123 /* evOpen */ { stStarting, { acNull, acNull, acNull } },
124 /* evClose */ { stInitial, { acTlf, acNull, acNull } },
125 /* evTOp */ { stNoChange, { acNull, acNull, acNull } },
126 /* evTOm */ { stNoChange, { acNull, acNull, acNull } },
127 /* evRCRp */ { stNoChange, { acNull, acNull, acNull } },
128 /* evRCRm */ { stNoChange, { acNull, acNull, acNull } },
129 /* evRCA */ { stNoChange, { acNull, acNull, acNull } },
130 /* evRCN */ { stNoChange, { acNull, acNull, acNull } },
131 /* evRTR */ { stNoChange, { acNull, acNull, acNull } },
132 /* evRTA */ { stNoChange, { acNull, acNull, acNull } },
133 /* evRUC */ { stNoChange, { acNull, acNull, acNull } },
134 /* evRXJp */ { stNoChange, { acNull, acNull, acNull } },
135 /* evRXJm */ { stNoChange, { acNull, acNull, acNull } },
136 /* evRXR */ { stNoChange, { acNull, acNull, acNull } },
137 },
138 { /* stClosed */
139 /* evUp */ { stNoChange, { acNull, acNull, acNull } },
140 /* evDown */ { stInitial, { acNull, acNull, acNull } },
141 /* evOpen */ { stReqSent, { acIrc, acScr, acNull } },
142 /* evClose */ { stClosed, { acNull, acNull, acNull } },
143 /* evTOp */ { stNoChange, { acNull, acNull, acNull } },
144 /* evTOm */ { stNoChange, { acNull, acNull, acNull } },
145 /* evRCRp */ { stClosed, { acSta, acNull, acNull } },
146 /* evRCRm */ { stClosed, { acSta, acNull, acNull } },
147 /* evRCA */ { stClosed, { acSta, acNull, acNull } },
148 /* evRCN */ { stClosed, { acSta, acNull, acNull } },
149 /* evRTR */ { stClosed, { acSta, acNull, acNull } },
150 /* evRTA */ { stClosed, { acNull, acNull, acNull } },
151 /* evRUC */ { stClosed, { acScj, acNull, acNull } },
152 /* evRXJp */ { stClosed, { acNull, acNull, acNull } },
153 /* evRXJm */ { stClosed, { acTlf, acNull, acNull } },
154 /* evRXR */ { stClosed, { acNull, acNull, acNull } },
155 },
156 { /* stStopped */
157 /* evUp */ { stNoChange, { acNull, acNull, acNull } },
158 /* evDown */ { stStarting, { acTls, acNull, acNull } },
159 /* evOpen */ { stStopped, { acNull, acNull, acNull } },
160 /* evClose */ { stClosed, { acNull, acNull, acNull } },
161 /* evTOp */ { stNoChange, { acNull, acNull, acNull } },
162 /* evTOm */ { stNoChange, { acNull, acNull, acNull } },
163 /* evRCRp */ { stAckSent, { acIrc, acScr, acSca } },
164 /* evRCRm */ { stReqSent, { acIrc, acScr, acScn } },
165 /* evRCA */ { stStopped, { acSta, acNull, acNull } },
166 /* evRCN */ { stStopped, { acSta, acNull, acNull } },
167 /* evRTR */ { stStopped, { acSta, acNull, acNull } },
168 /* evRTA */ { stStopped, { acNull, acNull, acNull } },
169 /* evRUC */ { stStopped, { acScj, acNull, acNull } },
170 /* evRXJp */ { stStopped, { acNull, acNull, acNull } },
171 /* evRXJm */ { stStopped, { acTlf, acNull, acNull } },
172 /* evRXR */ { stStopped, { acNull, acNull, acNull } },
173 },
174 { /* stClosing */
175 /* evUp */ { stNoChange, { acNull, acNull, acNull } },
176 /* evDown */ { stInitial, { acNull, acNull, acNull } },
177 /* evOpen */ { stStopping, { acNull, acNull, acNull } },
178 /* evClose */ { stClosing, { acNull, acNull, acNull } },
179 /* evTOp */ { stClosing, { acStr, acNull, acNull } },
180 /* evTOm */ { stClosed, { acTlf, acNull, acNull } },
181 /* evRCRp */ { stClosing, { acNull, acNull, acNull } },
182 /* evRCRm */ { stClosing, { acNull, acNull, acNull } },
183 /* evRCA */ { stClosing, { acNull, acNull, acNull } },
184 /* evRCN */ { stClosing, { acNull, acNull, acNull } },
185 /* evRTR */ { stClosing, { acSta, acNull, acNull } },
186 /* evRTA */ { stClosed, { acTlf, acNull, acNull } },
187 /* evRUC */ { stClosing, { acScj, acNull, acNull } },
188 /* evRXJp */ { stClosing, { acNull, acNull, acNull } },
189 /* evRXJm */ { stClosed, { acTlf, acNull, acNull } },
190 /* evRXR */ { stClosing, { acNull, acNull, acNull } },
191 },
192 { /* stStopping */
193 /* evUp */ { stNoChange, { acNull, acNull, acNull } },
194 /* evDown */ { stInitial, { acNull, acNull, acNull } },
195 /* evOpen */ { stStopping, { acNull, acNull, acNull } },
196 /* evClose */ { stClosing, { acNull, acNull, acNull } },
197 /* evTOp */ { stStopping, { acStr, acNull, acNull } },
198 /* evTOm */ { stStopped, { acTlf, acNull, acNull } },
199 /* evRCRp */ { stStopping, { acNull, acNull, acNull } },
200 /* evRCRm */ { stStopping, { acNull, acNull, acNull } },
201 /* evRCA */ { stStopping, { acNull, acNull, acNull } },
202 /* evRCN */ { stStopping, { acNull, acNull, acNull } },
203 /* evRTR */ { stStopping, { acSta, acNull, acNull } },
204 /* evRTA */ { stStopped, { acTlf, acNull, acNull } },
205 /* evRUC */ { stStopping, { acScj, acNull, acNull } },
206 /* evRXJp */ { stStopping, { acNull, acNull, acNull } },
207 /* evRXJm */ { stStopped, { acTlf, acNull, acNull } },
208 /* evRXR */ { stStopping, { acNull, acNull, acNull } },
209 },
210 { /* stReqSent */
211 /* evUp */ { stNoChange, { acNull, acNull, acNull } },
212 /* evDown */ { stStarting, { acNull, acNull, acNull } },
213 /* evOpen */ { stReqSent, { acNull, acNull, acNull } },
214 /* evClose */ { stClosing, { acIrc, acStr, acNull } },
215 /* evTOp */ { stReqSent, { acScr, acNull, acNull } },
216 /* evTOm */ { stStopped, { acTlf, acNull, acNull } },
217 /* evRCRp */ { stAckSent, { acSca, acNull, acNull } },
218 /* evRCRm */ { stReqSent, { acScn, acNull, acNull } },
219 /* evRCA */ { stAckRcvd, { acIrc, acNull, acNull } },
220 /* evRCN */ { stReqSent, { acIrc, acScr, acNull } },
221 /* evRTR */ { stReqSent, { acSta, acNull, acNull } },
222 /* evRTA */ { stReqSent, { acNull, acNull, acNull } },
223 /* evRUC */ { stReqSent, { acScj, acNull, acNull } },
224 /* evRXJp */ { stReqSent, { acNull, acNull, acNull } },
225 /* evRXJm */ { stStopped, { acTlf, acNull, acNull } },
226 /* evRXR */ { stReqSent, { acNull, acNull, acNull } },
227 },
228 { /* stAckRcvd */
229 /* evUp */ { stNoChange, { acNull, acNull, acNull } },
230 /* evDown */ { stStarting, { acNull, acNull, acNull } },
231 /* evOpen */ { stAckRcvd, { acNull, acNull, acNull } },
232 /* evClose */ { stClosing, { acIrc, acStr, acNull } },
233 /* evTOp */ { stReqSent, { acScr, acNull, acNull } },
234 /* evTOm */ { stStopped, { acTlf, acNull, acNull } },
235 /* evRCRp */ { stOpened, { acSca, acTlu, acNull } },
236 /* evRCRm */ { stAckRcvd, { acScn, acNull, acNull } },
237 /* evRCA */ { stReqSent, { acScr, acNull, acNull } },
238 /* evRCN */ { stReqSent, { acScr, acNull, acNull } },
239 /* evRTR */ { stReqSent, { acSta, acNull, acNull } },
240 /* evRTA */ { stReqSent, { acNull, acNull, acNull } },
241 /* evRUC */ { stAckRcvd, { acScj, acNull, acNull } },
242 /* evRXJp */ { stReqSent, { acNull, acNull, acNull } },
243 /* evRXJm */ { stStopped, { acTlf, acNull, acNull } },
244 /* evRXR */ { stAckRcvd, { acNull, acNull, acNull } },
245 },
246 { /* stAckSent */
247 /* evUp */ { stNoChange, { acNull, acNull, acNull } },
248 /* evDown */ { stStarting, { acNull, acNull, acNull } },
249 /* evOpen */ { stAckSent, { acNull, acNull, acNull } },
250 /* evClose */ { stClosing, { acIrc, acStr, acNull } },
251 /* evTOp */ { stAckSent, { acScr, acNull, acNull } },
252 /* evTOm */ { stStopped, { acTlf, acNull, acNull } },
253 /* evRCRp */ { stAckSent, { acSca, acNull, acNull } },
254 /* evRCRm */ { stReqSent, { acScn, acNull, acNull } },
255 /* evRCA */ { stOpened, { acIrc, acTlu, acNull } },
256 /* evRCN */ { stAckSent, { acIrc, acScr, acNull } },
257 /* evRTR */ { stReqSent, { acSta, acNull, acNull } },
258 /* evRTA */ { stAckSent, { acNull, acNull, acNull } },
259 /* evRUC */ { stAckSent, { acScj, acNull, acNull } },
260 /* evRXJp */ { stAckSent, { acNull, acNull, acNull } },
261 /* evRXJm */ { stStopped, { acTlf, acNull, acNull } },
262 /* evRXR */ { stAckSent, { acNull, acNull, acNull } },
263 },
264 { /* stOpened */
265 /* evUp */ { stNoChange, { acNull, acNull, acNull } },
266 /* evDown */ { stStarting, { acTld, acNull, acNull } },
267 /* evOpen */ { stOpened, { acNull, acNull, acNull } },
268 /* evClose */ { stClosing, { acTld, acIrc, acStr } },
269 /* evTOp */ { stNoChange, { acNull, acNull, acNull } },
270 /* evTOm */ { stNoChange, { acNull, acNull, acNull } },
271 /* evRCRp */ { stAckSent, { acTld, acScr, acSca } },
272 /* evRCRm */ { stReqSent, { acTld, acScr, acScn } },
273 /* evRCA */ { stReqSent, { acTld, acScr, acNull } },
274 /* evRCN */ { stReqSent, { acTld, acScr, acNull } },
275 /* evRTR */ { stStopping, { acTld, acZrc, acSta } },
276 /* evRTA */ { stReqSent, { acTld, acScr, acNull } },
277 /* evRUC */ { stOpened, { acScj, acNull, acNull } },
278 /* evRXJp */ { stOpened, { acNull, acNull, acNull } },
279 /* evRXJm */ { stStopping, { acTld, acIrc, acStr } },
280 /* evRXR */ { stOpened, { acSer, acNull, acNull } },
281 }
282 };
283
284
285#if defined(USE_DEBUG)
286
287static const char *ph_str[] = {
288 "Dead", "Establish", "Authenticate",
289 "Network", "Terminate"
290 };
291
292static const char *ev_str[] = {
293 "Up", "Down", "Open", "Close", "TO+", "TO-",
294 "RCR+", "RCR-", "RCA", "RCN", "RTR", "RTA",
295 "RUC", "RXJ+", "RXJ-", "RXR"
296 };
297
298static const char *st_str[] = {
299 "Initial", "Starting", "Closed", "Stopped",
300 "Closing", "Stopping", "Req-Sent", "Ack-Rcvd",
301 "Ack-Sent", "Opened", "No-Change"
302 };
303
304static const char *ac_str[] = {
305 "Null", "irc", "scr", "tls", "tlf", "str", "sta",
306 "sca", "scn", "scj", "tld", "tlu", "zrc", "ser"
307 };
308
309/*
310 * Display contents of buffer
311 */
312static void buffer_print (const char *verb, const BYTE *buf, int len)
313{
314 int i, j;
315
316 (*_printf) ("%s %d bytes:\n", verb, len);
317
318 for (i = 0; i < len; i += 16)
319 {
320 (*_printf) (" %04X: ", i);
321 for (j = i; j < len && j < i + 16; j++)
322 (*_printf) (" %02X", buf[j]);
323 (*_printf) ("\n");
324 }
325}
326
327/*
328 * Print text string safely.
329 */
330static void safe_string (const BYTE *bp, int len)
331{
332 (*_printf) ("\"");
333
334 while (--len >= 0)
335 {
336 char buf[2];
337 int chr = *bp++;
338
339 buf[0] = chr;
340 buf[1] ='\0';
341 if (isascii(chr) && isprint(chr))
342 (*_printf) (buf);
343 else (*_printf) ("\\%03o", chr);
344 }
345
346 (*_printf) ("\"");
347}
348
349/*
350 * Show all options in negotiation message.
351 */
352static void option_show (const struct ppp_state *state,
353 const struct ppp_xcp *xcp,
354 const BYTE *bp, int rlen)
355{
356 while (rlen > 0)
357 {
358 const struct xcp_type *tp;
359 int i;
360
361 (*_printf) (" ");
362 if (rlen < 2)
363 {
364 (*_printf) ("[trail %02X]\n", bp[0]);
365 break;
366 }
367 if (bp[1] > rlen)
368 {
369 (*_printf) ("[trunc %02X %d>%d]\n", bp[0], bp[1], rlen);
370 break;
371 }
372 for (tp = xcp->types; tp->type != -1; tp++)
373 if (tp->type == bp[0])
374 break;
375
376 if (tp->show)
377 {
378 /* Valid option; use defined printing routine
379 */
380 (*tp->show) ((struct ppp_state*)state, (struct ppp_xcp*)xcp,
381 tp, bp + 2, bp[1]);
382 }
383 else
384 {
385 /* Undefined option; just dump contents.
386 */
387 if (tp->name == NULL)
388 (*_printf) ("%02X:", bp[0]);
389 else (*_printf) ("%s:", tp->name);
390 for (i = 2; i < bp[1]; i++)
391 (*_printf) ("%02X", bp[i]);
392 }
393 i = bp[1];
394 if (i < 2)
395 i = 2;
396 rlen -= i;
397 bp += i;
398 }
399}
400
401/*
402 * Show a negotiation packet.
403 * Assumes 'bp' points to the code number (after PPP Protocol ID).
404 */
405static void show_packet (const char *inout, const struct ppp_state *state,
406 const struct ppp_xcp *xcp, const BYTE *bp, int len)
407{
408 static const char *code_str[] = {
409 "Vendor", "Configure-Request", "Configure-Ack",
410 "Configure-Nak", "Configure-Reject", "Terminate-Request",
411 "Terminate-Ack", "Code-Reject", "Protocol-Reject",
412 "Echo-Request", "Echo-Reply", "Discard-Request"
413 };
414 int code = *bp++;
415 int id = *bp++;
416 int length = intel16 (*(WORD*)bp);
417
418 bp += 2;
419 if (len > length)
420 len = length;
421 len -= PPP_HDRLEN;
422
423 (*_printf) ("%s %s ", inout, xcp->name);
424 if (code < DIM(code_str) && code_str[code])
425 (*_printf) ("%s", code_str[code]);
426 else (*_printf) ("code:%d", code);
427
428 (*_printf) (" ID:%d", id);
429 if ((code == CODE_CONF_ACK || code == CODE_CONF_NAK ||
430 code == CODE_CONF_REJ || code == CODE_TERM_ACK ||
431 code == CODE_ECHO_REP) && id != xcp->ident)
432 (*_printf) (" **ERR**");
433 (*_printf) (" len:%d", length);
434
435 switch (code)
436 {
437 case CODE_CONF_REQ:
438 case CODE_CONF_ACK:
439 case CODE_CONF_NAK:
440 case CODE_CONF_REJ:
441 option_show (state, xcp, bp, len);
442 break;
443 case CODE_TERM_REQ:
444 case CODE_TERM_ACK:
445 if (len > 0)
446 {
447 (*_printf) (" ");
448 safe_string (bp, len);
449 }
450 break;
451 case CODE_CODE_REJ:
452 (*_printf) (" code %d", *bp);
453 break;
454 case CODE_PROTO_REJ:
455 (*_printf) (" protocol %02X%02X", bp[0], bp[1]);
456 break;
457 case CODE_ECHO_REQ:
458 case CODE_ECHO_REP:
459 case CODE_DISCARD_REQ:
460 if (len >= 4)
461 (*_printf) (" magic %02X%02X%02X%02X", bp[0], bp[1], bp[2], bp[3]);
462 if (len > 4)
463 {
464 (*_printf) (" ");
465 safe_string (bp+4, len-4);
466 }
467 break;
468 }
469 (*_printf) ("\n");
470}
471
472#undef PRINTF
473#define PRINTF(lvl,arg) do { \
474 if (debug >= lvl) \
475 (*_printf) arg; \
476 } while (0)
477#else
478 #undef PRINTF
479 #define PRINTF(lvl,arg) ((void)0)
480#endif /* USE_DEBUG */
481
482
483/*
484 * Write packet to PPPoE session. Display contents if debugging.
485 */
486static void ppp_write (const struct ppp_state *state,
487 const struct ppp_xcp *xcp,
488 const BYTE *buf, int len)
489{
490 WATT_ASSERT (state);
491 WATT_ASSERT (xcp);
492
493#if defined(USE_DEBUG)
494 if (debug > 3)
495 buffer_print ("Transmitting", buf, len);
496
497 if (debug > 2)
498 {
499 int retv = buf[0] == 0xFF ? 2 : 0;
500 retv += buf[retv] & 1 ? 1 : 2;
501 show_packet ("SENT", state, xcp, buf + retv, len - retv);
502 }
503#endif
504 pppoe_send_sess (NULL /*\todo state->sock */, buf, len);
505
506 ARGSUSED (state);
507 ARGSUSED (xcp);
508}
509
510/*
511 * Insert PPP protocol field.
512 */
513static __inline BYTE *setup_acpf (BYTE *buf, WORD proto)
514{
515 *(WORD*)buf = intel16 (proto);
516 return (buf + 2);
517}
518
519/*
520 * Set up buffer for a new message (Configure-Request, Protocol-Reject,
521 * Echo-Request, or Discard-Request).
522 */
523static BYTE *code_id (struct ppp_state *state, struct ppp_xcp *xcp, int code)
524{
525 BYTE *buf = setup_acpf (state->outbuffer, xcp->proto);
526
527 *buf++ = code;
528 *buf++ = ++xcp->ident;
529 *buf++ = 0;
530 *buf++ = 4;
531 return (buf);
532}
533
534/*
535 * Set up buffer for a reply to a previous message (Configure-Ack,
536 * Configure-Nak, Configure-Reject, Echo-Reply).
537 */
538static BYTE *code_reply (struct ppp_state *state, struct ppp_xcp *xcp, int code)
539{
540 BYTE *buf = setup_acpf (state->outbuffer, xcp->proto);
541
542 *buf++ = code;
543 *buf++ = state->inbuffer[3]; /* ident */
544 *buf++ = 0;
545 *buf++ = 4;
546 return (buf);
547}
548
549/*
550 * Find a given option in the list for an XCP.
551 */
552static struct option_state *find_option (const struct ppp_xcp *xcp, int type)
553{
554 const struct xcp_type *tp;
555
556 for (tp = xcp->types; tp->type != -1; tp++)
557 if (tp->type == type)
558 return (xcp->opts + (tp - xcp->types));
559 return (NULL);
560}
561
562/*
563 * Loop over all known options and insert into a Configure-Request
564 * being built.
565 */
566static void create_request (struct ppp_state *state, struct ppp_xcp *xcp)
567{
568 struct xcp_type *tp;
569 struct option_state *os;
570 BYTE *bp, *obp;
571
572 obp = bp = code_id (state, xcp, CODE_CONF_REQ);
573 for (tp = xcp->types, os = xcp->opts; tp->type != -1; tp++, os++)
574 {
575 if (os->state == osUnusable)
576 continue;
577
578 if (!tp->flag && os->my_value == tp->default_value)
579 continue;
580
581 bp[0] = (BYTE) tp->type;
582 bp[1] = tp->minlen;
583 if (tp->minlen > 2)
584 bp[2] = (BYTE) (os->my_value >> (8 * (tp->minlen - 3))) & 0xFF;
585 if (tp->minlen > 3)
586 bp[3] = (BYTE) (os->my_value >> (8 * (tp->minlen - 4))) & 0xFF;
587 if (tp->minlen > 4)
588 bp[4] = (BYTE) (os->my_value >> (8 * (tp->minlen - 5))) & 0xFF;
589 if (tp->minlen > 5)
590 bp[5] = (BYTE) os->my_value;
591 bp += bp[1];
592 }
593 *(WORD*) (obp-2) = intel16 (bp-obp+4);
594 state->up = bp;
595}
596
597/*
598 * We've gotten a Configure-Request we like (RCR+), so we're agreeing
599 * with the peer. Set up to send Configure-Ack.
600 */
601static void copy_peer_values (const struct ppp_state *state, struct ppp_xcp *xcp)
602{
603 struct option_state *os;
604 const struct xcp_type *tp;
605 const BYTE *bp;
606 int rlen;
607 DWORD val;
608
609 for (tp = xcp->types, os = xcp->opts; tp->type != -1; tp++, os++)
610 os->peer_value = tp->default_value;
611 bp = state->bp;
612 rlen = state->mlen;
613 while (rlen > 0)
614 {
615 for (tp = xcp->types; tp->type != -1; tp++)
616 if (tp->type == bp[0])
617 break;
618
619 os = xcp->opts + (tp - xcp->types);
620 val = bp[2];
621 if (bp[1] > 3)
622 val = (val << 8) + bp[3];
623 if (bp[1] > 4)
624 val = (val << 8) + bp[4];
625 if (bp[1] > 5)
626 val = (val << 8) + bp[5];
627 os->peer_value = val;
628 rlen -= bp[1];
629 bp += bp[1];
630 }
631}
632
633/*
634 * Perform RFC 1661 actions as indicated by state machine.
635 */
636static void dispatch_action (struct ppp_state *state, struct ppp_xcp *xcp,
637 enum xcp_action act)
638{
639 BYTE *bp;
640
641 if (act == acNull)
642 return;
643
644 PRINTF (2, ("%s action %s (%d)\n", xcp->name, ac_str[act], act));
645
646 switch (act)
647 {
648 case acNull:
649 break;
650
651 case acIrc:
652 xcp->restart = state->phase == phTerminate ? MAX_TERMINATE : MAX_CONFIGURE;
653 state->timeout_period = INITIAL_TIMEOUT;
654 break;
655
656 case acScr:
657 if (xcp->restart > 0)
658 {
659 xcp->restart--;
660 create_request (state, xcp);
661 ppp_write (state, xcp, state->outbuffer, state->up - state->outbuffer);
662 }
663 xcp->timeout = time (NULL) + state->timeout_period;
664 break;
665
666 case acTls:
667 if (xcp == &state->xcps[XCP_IPCP])
668 send_event (state, &state->xcps[XCP_LCP], evOpen);
669 else change_phase (state, phEstablish);
670 break;
671
672 case acTlf:
673 if (xcp == &state->xcps[XCP_IPCP])
674 send_event (state, &state->xcps[XCP_LCP], evClose);
675 else change_phase (state, phTerminate);
676 break;
677
678 case acStr:
679 if (xcp->restart > 0)
680 {
681 xcp->restart--;
682 bp = code_id (state, xcp, CODE_TERM_REQ);
683 ppp_write (state, xcp, state->outbuffer, bp - state->outbuffer);
684 }
685 xcp->timeout = time (NULL) + state->timeout_period;
686 break;
687
688 case acSta:
689 bp = code_reply (state, xcp, CODE_TERM_ACK);
690 ppp_write (state, xcp, state->outbuffer, bp - state->outbuffer);
691 break;
692
693 case acSca:
694 copy_peer_values (state, xcp);
695 state->inbuffer[2] = CODE_CONF_ACK;
696 ppp_write (state, xcp, state->inbuffer, state->mlen +
697 (state->bp - state->inbuffer));
698 break;
699
700 case acScn:
701 if (xcp->naks_sent++ >= MAX_FAILURE)
702 state->outbuffer[4] = CODE_CONF_REJ;
703 /* fall-through */
704
705 case acScj:
706 ppp_write (state, xcp, state->outbuffer, state->up - state->outbuffer);
707 break;
708
709 case acTld:
710 if (xcp == &state->xcps[XCP_LCP])
711 change_phase (state, phTerminate);
712 else PRINTF (0, ("IPCP down!\n"));
713 break;
714
715 case acTlu:
716 if (xcp == &state->xcps[XCP_LCP])
717 change_phase (state, phAuthenticate);
718 else
719 {
720 struct option_state *os = find_option (xcp, 3);
721 DWORD addr = intel (os->my_value);
722
723 my_ip_addr = addr;
724 PRINTF (0, ("IPCP up! Local address %s, ",
725 _inet_ntoa(NULL,addr)));
726 addr = intel (os->peer_value);
727 _arp_kill_gateways();
728 _arp_add_gateway (NULL, addr);
729 PRINTF (0, ("remote %s\n", _inet_ntoa(NULL,addr)));
730 }
731 xcp->restart = MAX_CONFIGURE;
732 xcp->timeout = 0;
733 break;
734
735 case acZrc:
736 xcp->restart = 0;
737 state->timeout_period = INITIAL_TIMEOUT;
738 break;
739
740 case acSer:
741 state->inbuffer[2] = CODE_ECHO_REP;
742 *(long*) (state->inbuffer + 6) = intel (state->mymagic);
743 ppp_write (state, xcp, state->inbuffer, state->mlen +
744 (state->bp - state->inbuffer));
745 break;
746 }
747}
748
749/*
750 * Issue event into XCP state machine -- go to next state and
751 * invoke associated actions.
752 */
753static void send_event (struct ppp_state *state, struct ppp_xcp *xcp,
754 enum ppp_event event)
755{
756 const struct ppp_dispatch *dp = &ppp_dispatch [xcp->state][event];
757
758 if (dp->next == stNoChange)
759 {
760 PRINTF (2, ("%s got illegal %s event (%d) in %s state (%d)\n"
761 "\t(RFC 1661 section 4.4)\n",
762 xcp->name, ev_str[event], event, st_str[xcp->state],
763 xcp->state));
764 }
765 else
766 {
767 PRINTF (2, ("%s got %s event (%d) in %s state (%d), next is %s state (%d)\n",
768 xcp->name, ev_str[event], event, st_str[xcp->state],
769 xcp->state, st_str[dp->next], dp->next));
770 xcp->state = dp->next;
771 }
772 dispatch_action (state, xcp, dp->act[0]);
773 dispatch_action (state, xcp, dp->act[1]);
774 dispatch_action (state, xcp, dp->act[2]);
775}
776
777/*
778 * Change overall link phase. Central routine helps with
779 * debugging.
780 */
781static void change_phase (struct ppp_state *state, enum ppp_phase phase)
782{
783 PRINTF (2, ("Current PPP phase is %s, switching to %s\n",
784 ph_str[state->phase], ph_str[phase]));
785
786 switch (phase)
787 {
788 case phEstablish:
789 if (state->phase == phDead)
790 send_event (state, &state->xcps[XCP_LCP], evUp);
791 break;
792 case phAuthenticate:
793 break;
794 case phNetwork:
795 if (state->phase == phAuthenticate)
796 send_event (state, &state->xcps[XCP_IPCP], evUp);
797 break;
798 case phTerminate:
799 send_event (state, &state->xcps[XCP_IPCP], evDown);
800 break;
801 case phDead:
802 break;
803 }
804 state->phase = phase;
805 if (phase == phAuthenticate)
806 change_phase (state, phNetwork); /* XXX - no auth yet */
807}
808
809/*
810 * Check for time-outs
811 */
812static void check_timeouts (void)
813{
814 time_t now;
815 int i;
816
817 if (mystate.timeout_period < MAX_TIMEOUT)
818 mystate.timeout_period <<= 1;
819 now = time (NULL);
820
821 for (i = 0; i < DIM(mystate.xcps); i++)
822 {
823 if (mystate.xcps[i].timeout && now >= mystate.xcps[i].timeout)
824 {
825 mystate.xcps[i].timeout = 0;
826
827 /* Hack -- send with same ID on timeout.
828 */
829 if (mystate.xcps[i].restart > 0)
830 mystate.xcps[i].ident--;
831
832 PRINTF (4, ("Sending TO%c to %s\n",
833 mystate.xcps[i].restart > 0 ? '+' : '-',
834 mystate.xcps[i].name));
835
836 send_event (&mystate, mystate.xcps+i,
837 mystate.xcps[i].restart > 0 ? evTOp : evTOm);
838 }
839 }
840}
841
845void ppp_input (const BYTE *inbuffer, WORD len)
846{
847 struct ppp_state *state = &mystate;
848 int i;
849 WORD proto;
850
851 state->inbuffer = (BYTE*) inbuffer;
852
853#if defined(USE_DEBUG)
854 if (debug > 3)
855 buffer_print ("Received", state->inbuffer, len);
856#endif
857
858#if 0 /* no proto-compression used in PPPoE */
859 if (state->inbuffer[0] & 0x1)
860 {
861 proto = state->inbuffer[0];
862 state->inbuffer++;
863 len--;
864 }
865 else if (state->inbuffer[1] & 0x1)
866 {
867 proto = intel16 (*(WORD*)state->inbuffer);
868 state->inbuffer += 2;
869 len -=2;
870 }
871 else
872 {
873 proto = intel16 (*(WORD*)state->inbuffer);
874 PRINTF (0, ("Bad protocol field %04X\n", proto));
875 return;
876 }
877#else
878 proto = intel16 (*(WORD*)state->inbuffer);
879 state->inbuffer += 2;
880 len -= 2;
881#endif
882
883 if (proto == PPP_IP)
884 {
885 _ip4_handler ((const in_Header*)state->inbuffer, FALSE);
886 return;
887 }
888
889 /* Find XCP (IPCP/LCP) for indicated protocol
890 */
891 for (i = 0; i < DIM(state->xcps); i++)
892 if (state->xcps[i].proto == proto)
893 break;
894
895 if (i >= DIM(state->xcps))
896 {
897 /* Generate LCP Protocol-Reject for unknown things.
898 */
899 PRINTF (0, ("Unknown protocol 0x%04X\n", proto));
900
901 if (state->xcps[XCP_LCP].state == stOpened)
902 {
903 BYTE *bp = code_id (state, &state->xcps[XCP_LCP], CODE_PROTO_REJ);
904
905 i = sizeof(state->outbuffer) - (bp - state->outbuffer);
906 if (len > i)
907 len = i;
908 memcpy (bp, state->inbuffer-2, len);
909 len += bp - state->outbuffer;
910 *(WORD*) (state->outbuffer+2) = intel16 (len-4);
911 ppp_write (state, &state->xcps[XCP_LCP], state->outbuffer, len);
912 }
913 return;
914 }
915
916 state->bp = state->inbuffer;
917 state->mlen = len;
918 (*state->xcps[i].deliver) (state, state->xcps + i);
919}
920
921/*
922 * Add current option to list of options to be sent in Configure-Reject.
923 */
924static void set_reject (struct ppp_state *state, struct ppp_xcp *xcp,
925 const BYTE *bp)
926{
927 int i;
928
929 if (state->parse_state == psBad)
930 return;
931
932 /* If this is the first reject for this packet, then set up.
933 */
934 if (state->parse_state != psRej)
935 {
936 state->up = code_reply (state, xcp, CODE_CONF_REJ);
937 state->parse_state = psRej;
938 }
939
940 /* Handle malformed options; make sure we don't send anything illegal
941 * to the peer (even if he's sending us junk).
942 */
943 i = bp[1];
944 if (i < 2)
945 i = 2;
946 memcpy (state->up, bp, i);
947 state->up[1] = i;
948 state->up += i;
949}
950
951/*
952 * Add current option to list of options to be sent in Configure-Nak.
953 */
954static void set_nak (struct ppp_state *state, struct ppp_xcp *xcp, int type,
955 int len, const BYTE *bp)
956{
957 /* If we're rejecting, then no point in doing naks.
958 */
959 if (state->parse_state == psBad || state->parse_state == psRej)
960 return;
961
962 /* If this is the first nak for this packet, then set up.
963 */
964 if (state->parse_state != psNak)
965 {
966 state->up = code_reply (state, xcp, CODE_CONF_NAK);
967 state->parse_state = psNak;
968 }
969 *state->up++ = type;
970 *state->up++ = len;
971 while (--len > 1)
972 *state->up++ = *bp++;
973}
974
975/*
976 * Check Configure-Request options from peer against list of
977 * known, valid, and desired options.
978 */
979static int validate_request (struct ppp_state *state, struct ppp_xcp *xcp)
980{
981 const struct xcp_type *tp;
982 const BYTE *bp;
983 int rlen, i;
984
985 state->parse_state = psOK;
986 rlen = state->mlen;
987 bp = state->bp;
988
989 while (rlen > 0)
990 {
991 if (rlen < 2 || bp[1] > rlen)
992 {
993 state->parse_state = psBad;
994 break;
995 }
996 for (tp = xcp->types; tp->type != -1; tp++)
997 if (tp->type == bp[0])
998 break;
999
1000 if (tp->type == -1)
1001 set_reject (state, xcp, bp);
1002 else if (bp[1] < tp->minlen)
1003 set_nak (state, xcp, tp->type, tp->minlen, bp + 2);
1004 else if (bp[1] > tp->maxlen)
1005 set_nak (state, xcp, tp->type, tp->maxlen, bp + 2);
1006 else if (tp->validate_req)
1007 (*tp->validate_req) (state, xcp, tp, bp + 2, bp[1]);
1008
1009 i = bp[1];
1010 if (i < 2)
1011 i = 2;
1012 rlen -= i;
1013 bp += i;
1014 }
1015 if (state->parse_state == psNak || state->parse_state == psRej)
1016 {
1017 i = (state->up - state->outbuffer) - 4;
1018 state->outbuffer[6] = (i >> 8) & 0xFF;
1019 state->outbuffer[7] = i & 0xFF;
1020 }
1021 return (state->parse_state == psOK);
1022}
1023
1024/*
1025 * Process options in a Configure-{Ack,Nak,Reject}.
1026 */
1027static void process_rcx (struct ppp_state *state, struct ppp_xcp *xcp, BYTE code)
1028{
1029 struct option_state *os;
1030 const struct xcp_type *tp;
1031 int rlen, i, val;
1032 BYTE *bp;
1033
1034 rlen = state->mlen;
1035 bp = state->bp;
1036
1037 while (rlen > 0)
1038 {
1039 if (rlen < 2 || bp[1] > rlen)
1040 break;
1041
1042 for (tp = xcp->types; tp->type != -1; tp++)
1043 if (tp->type == bp[0])
1044 break;
1045
1046 if (tp->type != -1)
1047 {
1048 os = xcp->opts + (tp - xcp->types);
1049 if (code == CODE_CONF_REJ)
1050 os->state = osUnusable;
1051 else if (code == CODE_CONF_ACK || tp->validate_nak == NULL)
1052 {
1053 if (bp[1] > 6 || bp[1] <= 2)
1054 os->my_value = tp->default_value;
1055 else
1056 {
1057 val = bp[2];
1058 if (bp[1] > 3)
1059 val = (val << 8) + bp[3];
1060 if (bp[1] > 4)
1061 val = (val << 8) + bp[4];
1062 if (bp[1] > 5)
1063 val = (val << 8) + bp[5];
1064 os->my_value = val;
1065 }
1066 }
1067 else
1068 (*tp->validate_nak) (state, xcp, tp, bp + 2, bp[1]);
1069 }
1070 if ((i = bp[1]) < 2)
1071 i = 2;
1072 rlen -= i;
1073 bp += i;
1074 }
1075}
1076
1077/*
1078 * Standard negotiation entry point. This is assigned as the
1079 * 'delivery' function for control protocols, like LCP and IPCP.
1080 */
1081static void std_negotiation (struct ppp_state *state, struct ppp_xcp *xcp)
1082{
1083 BYTE code, id;
1084 WORD proto;
1085 int i, length;
1086
1087 /* Validate overall message length
1088 */
1089 if (state->mlen < 4)
1090 {
1091 PRINTF (0, ("Malformed negotiation message; %d < 4\n", state->mlen));
1092 return;
1093 }
1094
1095 code = *state->bp++;
1096 id = *state->bp++;
1097 length = intel16 (*(WORD*)state->bp); /* !! */
1098 if (length > state->mlen)
1099 {
1100 PRINTF (0, ("Truncated negotiation message; %d > %d\n",
1101 length, state->mlen));
1102 return;
1103 }
1104 if (length < state->mlen)
1105 {
1106 PRINTF (0, ("Trimmed negotiation message; %d < %d\n",
1107 length, state->mlen));
1108 state->mlen = length;
1109 }
1110 state->bp += 2;
1111 state->mlen -= 4;
1112
1113#if defined(USE_DEBUG)
1114 if (debug > 2)
1115 show_packet ("RCVD", state, xcp, state->bp-4, state->mlen+4);
1116#endif
1117
1118 /* Now switch out on received code number
1119 */
1120 switch (code)
1121 {
1122 case CODE_CONF_REQ:
1123 /* If request is good, then RCR+, if bad, then RCR-
1124 */
1125 if (validate_request (state, xcp))
1126 send_event (state, xcp, evRCRp);
1127 else send_event (state, xcp, evRCRm);
1128 break;
1129
1130 case CODE_CONF_ACK:
1131 /* Configure-Ack ID number must match last sent.
1132 */
1133 if (id == xcp->ident)
1134 {
1135 /* Should validate contents against last req sent, but we don't.
1136 */
1137 process_rcx (state, xcp, code);
1138 send_event (state, xcp, evRCA);
1139 }
1141 break;
1142
1143 case CODE_CONF_NAK:
1144 case CODE_CONF_REJ:
1145 /* Configure-Nak/Reject ID number must match last sent.
1146 */
1147 if (id == xcp->ident)
1148 {
1149 process_rcx (state, xcp, code);
1150 send_event (state, xcp, evRCN);
1151 }
1152 break;
1153
1154 case CODE_TERM_REQ:
1155 send_event (state, xcp, evRTR);
1156 break;
1157
1158 case CODE_TERM_ACK:
1159 if (id == xcp->ident)
1160 send_event (state, xcp, evRTA);
1161 break;
1162
1163 case CODE_CODE_REJ:
1164 code = *state->bp++;
1165
1166 /* Peer cannot reject well-known code numbers.
1167 */
1168 if (code && code < CODE_ECHO_REQ)
1169 {
1170 PRINTF (0, ("Invalid code reject for %d\n", code));
1171 send_event (state, xcp, evRXJm);
1172 }
1173 else
1174 send_event (state, xcp, evRXJp);
1175 break;
1176
1177 case CODE_PROTO_REJ:
1178 proto = intel16 (*(WORD*)state->bp); /* !! */
1179
1180 /* Peer cannot reject LCP!
1181 */
1182 if (proto == state->xcps[XCP_LCP].proto)
1183 {
1184 PRINTF (0, ("Peer protocol-rejected LCP itself!\n"));
1185 send_event (state, &state->xcps[XCP_LCP], evRXJm);
1186 }
1187 else
1188 {
1189 send_event (state, xcp, evRXJp);
1190 for (i = 0; i < DIM(state->xcps); i++)
1191 if (state->xcps[i].proto == proto)
1192 state->xcps[i].state = stInitial;
1193 }
1194 break;
1195
1196 case CODE_ECHO_REQ:
1197 /* send a reply here. */
1198 send_event (state, xcp, evRXR);
1199 break;
1200
1201 case CODE_DISCARD_REQ:
1202 send_event (state, xcp, evRXR);
1203 break;
1204
1205 case CODE_ECHO_REP:
1206 /* ID number in Echo-Reply must match last echo sent.
1207 */
1208 if (id == xcp->ident)
1209 send_event (state, xcp, evRXR);
1210 break;
1211
1212 default:
1213 state->bp -= 4;
1214 send_event (state, xcp, evRUC);
1215 break;
1216 }
1217}
1218
1219/*
1220 * Initialize an XCP (LCP or NCP).
1221 */
1222static void init_xcp (const char *name, struct ppp_xcp *xcp,
1223 void (*deliver) (struct ppp_state *state,
1224 struct ppp_xcp *xcp),
1225 const struct xcp_type *types, int ntypes, WORD proto)
1226{
1227 struct option_state *os;
1228
1229 xcp->name = name;
1230 xcp->state = stInitial;
1231 xcp->restart = 0;
1232 xcp->timeout = 0;
1233 xcp->deliver = deliver;
1234 xcp->types = (struct xcp_type*)types;
1235 xcp->proto = proto;
1236
1237 /* If no options, then no vector to store negotiated values.
1238 */
1239 if (ntypes <= 0)
1240 {
1241 xcp->opts = NULL;
1242 return;
1243 }
1244 /* Otherwise, allocate vector and initialize options
1245 */
1246 os = xcp->opts = (struct option_state*) calloc (ntypes, sizeof(*os));
1247
1248 while (--ntypes >= 0)
1249 {
1250 os->my_value = os->peer_value = types->default_value;
1251 os->state = osUsable;
1252 os++;
1253 types++;
1254 }
1255}
1256
1257/*
1258 * Handle Configure-Request from peer. If it's in the range we think
1259 * it should be, then do nothing (allow Configure-Ack). Otherwise,
1260 * send Configure-Nak with something more appropriate.
1261 */
1262static void ipcp_addr_req (struct ppp_state *state,
1263 struct ppp_xcp *xcp,
1264 const struct xcp_type *tp,
1265 const BYTE *buf, int len)
1266{
1267 struct option_state *os;
1268 BYTE lbuf[4];
1269 DWORD addr = intel (*(DWORD*)buf);
1270
1271 os = xcp->opts + (tp - xcp->types);
1272 if (addr != os->my_value && (addr & remote_ip_mask) == remote_ip_base)
1273 return;
1274
1275 addr = xcp->opts [tp-xcp->types].peer_value;
1276 *(DWORD*) &lbuf = intel (addr);
1277 set_nak (state, xcp, tp->type, tp->minlen, lbuf);
1278 ARGSUSED (len);
1279}
1280
1281/*
1282 * Got a Configure-Nak of our address. Just change; we're flexible.
1283 */
1284static void ipcp_addr_nak (struct ppp_state *state,
1285 struct ppp_xcp *xcp,
1286 const struct xcp_type *tp,
1287 const BYTE *buf, int len)
1288{
1289 xcp->opts [tp-xcp->types].my_value = intel (*(DWORD*)buf);
1290 ARGSUSED (state);
1291 ARGSUSED (len);
1292}
1293
1294/*
1295 * Show IP address.
1296 */
1297static void ipcp_addr_show (struct ppp_state *state,
1298 struct ppp_xcp *xcp, const struct xcp_type *tp,
1299 const BYTE *buf, int len)
1300{
1301 PRINTF (0, ("%s", _inet_ntoa(NULL, intel(*(DWORD*)buf))));
1302 ARGSUSED (state);
1303 ARGSUSED (xcp);
1304 ARGSUSED (tp);
1305 ARGSUSED (buf);
1306 ARGSUSED (len);
1307}
1308
1309/*
1310 * Set local value (for Configure-Request).
1311 */
1312static void set_option_value_lcl (struct ppp_xcp *xcp, int type, int value)
1313{
1314 struct option_state *os = find_option (xcp, type);
1315
1316 if (os)
1317 os->my_value = value;
1318}
1319
1320/*
1321 * Set desired value for peer (we'll Configure-Nak with this).
1322 */
1323static void set_option_value_rem (struct ppp_xcp *xcp, int type, int value)
1324{
1325 struct option_state *os = find_option (xcp, type);
1326
1327 if (os)
1328 os->peer_value = value;
1329}
1330
1331void ppp_start (int dbg_level)
1332{
1333 struct ppp_state *state = &mystate;
1334
1335 debug = dbg_level;
1336
1337 /* Initialize PPP state machine and add LCP and IPCP.
1338 */
1339 state->phase = phDead;
1340 state->timeout_period = INITIAL_TIMEOUT;
1341 state->mymagic = Random (0, UINT_MAX);
1342
1343 init_xcp ("LCP", &state->xcps[XCP_LCP], std_negotiation,
1344 lcp_types, DIM(lcp_types) - 1, PPP_LCP);
1345
1346 init_xcp ("IPCP", &state->xcps[XCP_IPCP], std_negotiation,
1347 ipcp_types, DIM(ipcp_types) - 1, PPP_IPCP);
1348
1349 set_option_value_lcl (&state->xcps[XCP_IPCP], 3, 0x0A000000 + (rand() % 1000));
1350 set_option_value_rem (&state->xcps[XCP_IPCP], 3, 0x0A00000A + (rand() % 1000));
1351
1352 /* Tell LCP to open
1353 */
1354 send_event (state, &state->xcps[XCP_IPCP], evOpen);
1355
1356 /* Add handler for checking timeouts (via tcp_tick)
1357 */
1358 DAEMON_ADD (check_timeouts);
1359}
1360
1361#endif /* USE_PPPOE */
1362
in.h
_ip4_handler
int _ip4_handler(const in_Header *ip, BOOL broadcast)
Definition: ip4_in.c:33
ip4_in.h
Random
unsigned W32_CALL Random(unsigned a, unsigned b)
Returns a random integer in range [a..b].
Definition: misc.c:743
misc.h
misc_str.h
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
_arp_add_gateway
BOOL W32_CALL _arp_add_gateway(const char *config_string, DWORD ip)
Add a gateway to the routing table.
Definition: pcarp.c:247
_arp_kill_gateways
void W32_CALL _arp_kill_gateways(void)
Delete all gateways.
Definition: pcarp.c:373
pcarp.h
pcconfig.h
pcdbug.h
pcpkt.h
pcqueue.h
pcsed.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
pctcp.h
ppp_input
void ppp_input(const BYTE *inbuffer, WORD len)
The PPP input handler.
Definition: ppp.c:845
std_negotiation
static void std_negotiation(struct ppp_state *state, struct ppp_xcp *xcp)
Definition: ppp.c:1081
ppp.h
pppoe_send_sess
int pppoe_send_sess(const void *sock, const BYTE *buf, WORD len)
Build and send a PPPoE Session packet (IPCP or LCP packet).
Definition: pppoe.c:358
pppoe.h
code
Definition: zinftree.h:24
in_Header
Definition: wattcp.h:329
option_state
Definition: ppp.h:90
ppp_dispatch
Definition: ppp.c:97
ppp_state
Definition: ppp.h:114
ppp_xcp
Definition: ppp.h:96
xcp_type
Definition: ppp.h:73
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/ppp.h Source File

  • src
ppp.h
Go to the documentation of this file.
1
3#ifndef _w32_PPP_H
4#define _w32_PPP_H
5
6#include <time.h>
7#include <sys/socket.h> /* <sys/wtypes.h> */
8#include <net/ppp_defs.h> /* PPP_MRU etc. */
9
10void ppp_start (int debug);
11void ppp_input (const BYTE *inbuf, WORD len);
12
13
14/* Standard link phases
15 */
16enum ppp_phase {
17 phDead, phEstablish, phAuthenticate,
18 phNetwork, phTerminate
19 };
20
21/* Standard set of events
22 */
23enum ppp_event {
24 evUp, evDown, evOpen, evClose, evTOp,
25 evTOm, evRCRp, evRCRm, evRCA, evRCN,
26 evRTR, evRTA, evRUC, evRXJp, evRXJm, evRXR
27 };
28
29/* Standard negotiation states
30 */
31enum xcp_state {
32 stInitial, stStarting, stClosed, stStopped,
33 stClosing, stStopping, stReqSent, stAckRcvd,
34 stAckSent, stOpened, stNoChange
35 };
36
37/* Standard set of actions
38 */
39enum xcp_action {
40 acNull, acIrc, acScr, acTls, acTlf, acStr, acSta,
41 acSca, acScn, acScj, acTld, acTlu, acZrc, acSer
42 };
43
44/* Standard message code numbers
45 */
46#define CODE_CONF_REQ 1
47#define CODE_CONF_ACK 2
48#define CODE_CONF_NAK 3
49#define CODE_CONF_REJ 4
50#define CODE_TERM_REQ 5
51#define CODE_TERM_ACK 6
52#define CODE_CODE_REJ 7
53#define CODE_PROTO_REJ 8
54#define CODE_ECHO_REQ 9
55#define CODE_ECHO_REP 10
56#define CODE_DISCARD_REQ 11
57
58
59struct ppp_xcp;
60struct ppp_state;
61struct xcp_type;
62
63typedef void (*xcp_func) (struct ppp_state *state,
64 struct ppp_xcp *xcp,
65 const struct xcp_type *tp,
66 const BYTE *buf, int len);
67
68typedef void (*ppp_func) (struct ppp_state *state,
69 struct ppp_xcp *xcp);
70
71/* Basic information about an option.
72 */
73struct xcp_type {
74 char *name; /* Printable name */
75 short type; /* option number (-1 to end) */
76 short flag; /* set to ignore default value */
77 BYTE minlen; /* minimum overall length */
78 BYTE maxlen; /* maximum overall length */
79 DWORD default_value; /* default */
80 xcp_func validate_req;
81 xcp_func validate_nak;
82 xcp_func show;
83 };
84
85enum os_state {
86 osUsable,
87 osUnusable
88 };
89
90struct option_state {
91 DWORD my_value; /* sent in Configure-Request */
92 DWORD peer_value; /* last received */
93 enum os_state state; /* flag for rejects */
94 };
95
96struct ppp_xcp {
97 const char *name; /* name of control protocol */
98 enum xcp_state state; /* state machine */
99 int restart; /* standard restart count */
100 time_t timeout; /* standard restart timer */
101 int naks_sent;/* consecutive naks sent */
102 ppp_func deliver; /* handler */
103 struct xcp_type *types; /* option types supported here */
104 struct option_state *opts; /* current negotiation state */
105 WORD proto; /* PPP protocol ID */
106 BYTE ident; /* current ID number */
107 };
108
109enum parse_state {
110 psOK, psNak,
111 psRej, psBad
112 };
113
114struct ppp_state {
115 enum ppp_phase phase; /* link phase */
116 enum parse_state parse_state; /* request parsing state */
117 struct ppp_xcp xcps[2]; /* installed XCPs */
118#define XCP_LCP 0
119#define XCP_IPCP 1
120 int timeout_period; /* value for restart timer */
121 int mlen; /* packet length */
122 DWORD mymagic, hismagic; /* magic numbers (for echo) */
123 BYTE *bp, *up; /* pointers to packet buffers */
124 BYTE *inbuffer;
125 BYTE outbuffer [PPP_MRU];
126 };
127
128#endif /* _w32_PPP_H */
socket.h
ppp_input
void ppp_input(const BYTE *inbuf, WORD len)
The PPP input handler.
Definition: ppp.c:845
ppp_defs.h
option_state
Definition: ppp.h:90
ppp_state
Definition: ppp.h:114
ppp_xcp
Definition: ppp.h:96
xcp_type
Definition: ppp.h:73


Watt-32 tcp/ip: E:/WATT/inc/net/ppp_defs.h Source File

  • inc
  • net
ppp_defs.h
Go to the documentation of this file.
1
5/*
6 * ppp_defs.h - PPP definitions.
7 *
8 * Copyright (c) 1994 The Australian National University.
9 * All rights reserved.
10 *
11 * Permission to use, copy, modify, and distribute this software and its
12 * documentation is hereby granted, provided that the above copyright
13 * notice appears in all copies. This software is provided without any
14 * warranty, express or implied. The Australian National University
15 * makes no representations about the suitability of this software for
16 * any purpose.
17 *
18 * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
19 * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
20 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
21 * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
22 * OF SUCH DAMAGE.
23 *
24 * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
25 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
27 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
28 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
29 * OR MODIFICATIONS.
30 */
31
32#ifndef __NET_PPP_DEFS_H
33#define __NET_PPP_DEFS_H
34
35#include <time.h>
36
37/*
38 * The basic PPP frame.
39 */
40#define PPP_HDRLEN 4 /* octets for standard ppp header */
41#define PPP_FCSLEN 2 /* octets for FCS */
42
43/*
44 * Packet sizes
45 *
46 * Note - lcp shouldn't be allowed to negotiate stuff outside these
47 * limits. See lcp.h in the pppd directory.
48 * (XXX - these constants should simply be shared by lcp.c instead
49 * of living in lcp.h)
50 */
51#define PPP_MTU 1500 /* Default MTU (size of Info field) */
52#define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN)
53#define PPP_MINMTU 64
54#define PPP_MRU 1500 /* default MRU = max length of info field */
55#define PPP_MAXMRU 65000 /* Largest MRU we allow */
56#define PPP_MINMRU 128
57
58#define PPP_ADDRESS(p) (((u_char *)(p))[0])
59#define PPP_CONTROL(p) (((u_char *)(p))[1])
60#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3])
61
62/*
63 * Significant octet values.
64 */
65#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */
66#define PPP_UI 0x03 /* Unnumbered Information */
67#define PPP_FLAG 0x7e /* Flag Sequence */
68#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */
69#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */
70
71/*
72 * Protocol field values.
73 */
74#define PPP_IP 0x0021 /* Raw IP */
75#define PPP_OSI 0x0023 /* OSI Network Layer */
76#define PPP_NS 0x0025 /* Xerox NS IDP */
77#define PPP_DECNET 0x0027 /* DECnet Phase IV */
78#define PPP_APPLE 0x0029 /* Appletalk */
79#define PPP_IPX 0x002b /* Novell IPX */
80#define PPP_VJC 0x002d /* Van Jacobson Compressed TCP/IP */
81#define PPP_VJNC 0x002f /* Van Jacobson Uncompressed TCP/IP */
82#define PPP_VJC_COMP PPP_VJC
83#define PPP_VJC_UNCOMP PPP_VJNC
84#define PPP_BRPDU 0x0031 /* Bridging PDU */
85#define PPP_STII 0x0033 /* Stream Protocol (ST-II) */
86#define PPP_VINES 0x0035 /* Banyan Vines */
87#define PPP_IPV6 0x0057 /* Internet Protocol Version 6 */
88#define PPP_COMP 0x00fd /* compressed packet */
89
90#define PPP_HELLO 0x0201 /* 802.1d Hello Packets */
91#define PPP_LUXCOM 0x0231 /* Luxcom */
92#define PPP_SNS 0x0233 /* Sigma Network Systems */
93
94#define PPP_IPCP 0x8021 /* IP Control Protocol */
95#define PPP_OSICP 0x8023 /* OSI Network Layer Control Protocol */
96#define PPP_NSCP 0x8025 /* Xerox NS IDP Control Protocol */
97#define PPP_DECNETCP 0x8027 /* DECnet Control Protocol */
98#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */
99#define PPP_IPXCP 0x802b /* IPX Control Protocol */
100#define PPP_STIICP 0x8033 /* Strean Protocol Control Protocol */
101#define PPP_VINESCP 0x8035 /* Banyan Vines Control Protocol */
102#define PPP_CCP 0x80fd /* Compression Control Protocol */
103
104#define PPP_LCP 0xc021 /* Link Control Protocol */
105#define PPP_PAP 0xc023 /* Password Authentication Protocol */
106#define PPP_LQR 0xc025 /* Link Quality Report protocol */
107#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */
108#define PPP_CBCP 0xc029 /* Callback Control Protocol */
109
110/*
111 * Values for FCS calculations.
112 */
113#define PPP_INITFCS 0xffff /* Initial FCS value */
114#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */
115#define PPP_FCS(fcs, c) (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
116
117/*
118 * A 32-bit unsigned integral type.
119 */
120#if !defined(__BIT_TYPES_DEFINED__) && !defined(_BITYPES) && !defined(__SYS_WTYPES_H)
121 #ifdef UINT32_T
122 typedef UINT32_T u_int32_t;
123 #else
124 typedef unsigned long u_int32_t;
125 #endif
126#endif
127
128/*
129 * Extended asyncmap - allows any character to be escaped.
130 */
131typedef u_int32_t ext_accm[8];
132
133/*
134 * What to do with network protocol (NP) packets.
135 */
136enum NPmode {
137 NPMODE_PASS, /* pass the packet through */
138 NPMODE_DROP, /* silently drop the packet */
139 NPMODE_ERROR, /* return an error */
140 NPMODE_QUEUE /* save it up for later. */
141};
142
143/*
144 * Statistics.
145 */
146struct pppstat {
147 unsigned int ppp_ibytes; /* bytes received */
148 unsigned int ppp_ipackets; /* packets received */
149 unsigned int ppp_ierrors; /* receive errors */
150 unsigned int ppp_obytes; /* bytes sent */
151 unsigned int ppp_opackets; /* packets sent */
152 unsigned int ppp_oerrors; /* transmit errors */
153};
154
155struct vjstat {
156 unsigned int vjs_packets; /* outbound packets */
157 unsigned int vjs_compressed; /* outbound compressed packets */
158 unsigned int vjs_searches; /* searches for connection state */
159 unsigned int vjs_misses; /* times couldn't find conn. state */
160 unsigned int vjs_uncompressedin; /* inbound uncompressed packets */
161 unsigned int vjs_compressedin; /* inbound compressed packets */
162 unsigned int vjs_errorin; /* inbound unknown type packets */
163 unsigned int vjs_tossed; /* inbound packets tossed because of error */
164};
165
166struct ppp_stats {
167 struct pppstat p; /* basic PPP statistics */
168 struct vjstat vj; /* VJ header compression statistics */
169};
170
171struct compstat {
172 unsigned int unc_bytes; /* total uncompressed bytes */
173 unsigned int unc_packets; /* total uncompressed packets */
174 unsigned int comp_bytes; /* compressed bytes */
175 unsigned int comp_packets; /* compressed packets */
176 unsigned int inc_bytes; /* incompressible bytes */
177 unsigned int inc_packets; /* incompressible packets */
178 unsigned int ratio; /* recent compression ratio << 8 */
179};
180
181struct ppp_comp_stats {
182 struct compstat c; /* packet compression statistics */
183 struct compstat d; /* packet decompression statistics */
184};
185
186/*
187 * The following structure records the time in seconds since
188 * the last NP packet was sent or received.
189 */
190struct ppp_idle {
191 time_t xmit_idle; /* time since last NP packet sent */
192 time_t recv_idle; /* time since last NP packet received */
193};
194
195#endif
compstat
Definition: ppp_defs.h:171
ppp_comp_stats
Definition: ppp_defs.h:181
ppp_idle
Definition: ppp_defs.h:190
ppp_stats
Definition: ppp_defs.h:166
pppstat
Definition: ppp_defs.h:146
vjstat
Definition: ppp_defs.h:155


Watt-32 tcp/ip: E:/WATT/src/pppoe.c Source File

  • src
pppoe.c
Go to the documentation of this file.
1
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>
41#include <time.h>
42
43#include "wattcp.h"
44#include "misc.h"
45#include "misc_str.h"
46#include "timer.h"
47#include "language.h"
48#include "run.h"
49#include "pcconfig.h"
50#include "pcdbug.h"
51#include "pcqueue.h"
52#include "pctcp.h"
53#include "pcsed.h"
54#include "pcpkt.h"
55#include "pppoe.h"
56#include "ppp.h"
57
58#if defined(USE_PPPOE)
59
60enum States {
61 STATE_NONE = 0,
62 STATE_DISCOVERY,
63 STATE_SESSION
64 };
65
66static void (W32_CALL *prev_hook) (const char*, const char*) = NULL;
67
68static BOOL got_PADO;
69static BOOL got_PADS;
70static BOOL got_PADT;
71static BOOL got_PADM;
72static WORD session = 0;
73static enum States state = STATE_NONE;
74static mac_address ac_mac_addr; /* Access Consentrator's (AC) MAC address */
75
76static struct {
77 int enable;
78 int trace;
79 int timeout;
80 int retries;
81 int lcp_echo_intv;
82 char service_name [MAX_VALUELEN+1];
83 char user_name [MAX_VALUELEN+1];
84 char password [MAX_VALUELEN+1];
85 } cfg = { 0, 0, 1, 3, 60, "", "", "" };
86
87static int pppoe_send_disc (int code);
88
89static void W32_CALL pppoe_config (const char *name, const char *value)
90{
91 static const struct config_table pppoe_cfg[] = {
92 { "ENABLE", ARG_ATOI, (void*)&cfg.enable },
93 { "TRACE", ARG_ATOI, (void*)&cfg.trace },
94 { "TIMEOUT", ARG_ATOI, (void*)&cfg.timeout },
95 { "RETRIES", ARG_ATOI, (void*)&cfg.retries },
96 { "LCP_ECHO", ARG_ATOI, (void*)&cfg.lcp_echo_intv },
97 { "SERVICENAME", ARG_STRCPY, (void*)&cfg.service_name },
98 { "USER", ARG_STRCPY, (void*)&cfg.user_name },
99 { "PASSWD", ARG_STRCPY, (void*)&cfg.password },
100 { NULL, 0, NULL }
101 };
102 if (!parse_config_table(&pppoe_cfg[0], "PPPOE.", name, value) && prev_hook)
103 (*prev_hook) (name, value);
104}
105
110static BOOL pppoe_wait (int wait_code)
111{
112 DWORD timer = set_timeout (1000 * cfg.timeout);
113
114 while (1)
115 {
116 tcp_tick (NULL);
117
118 if ((wait_code == PPPOE_CODE_PADO && got_PADO) ||
119 (wait_code == PPPOE_CODE_PADS && got_PADS))
120 {
121#if defined(USE_DEBUG)
122 if (cfg.trace)
123 (*_printf) ("PPPoE: got %s\n", pppoe_get_code(wait_code));
124#endif
125 return (TRUE);
126 }
127 if (chk_timeout(timer))
128 break;
129 }
130 return (FALSE);
131}
132
137static BOOL pppoe_discovery (void)
138{
139 int loop;
140
141 for (loop = 1; loop <= cfg.retries; loop++)
142 {
143 if (!pppoe_send_disc(PPPOE_CODE_PADI)) /* send Init packet */
144 return (FALSE);
145
146 if (pppoe_wait(PPPOE_CODE_PADO)) /* wait for Offer */
147 break;
148 }
149 if (loop > cfg.retries)
150 return (FALSE);
151
152 for (loop = 1; loop <= cfg.retries; loop++)
153 {
154 if (!pppoe_send_disc(PPPOE_CODE_PADR)) /* send Request */
155 return (FALSE);
156
157 if (pppoe_wait(PPPOE_CODE_PADS)) /* wait for Session-confirm */
158 break;
159 }
160 return (loop <= cfg.retries);
161}
162
166void pppoe_init (void)
167{
168 prev_hook = usr_init;
169 usr_init = pppoe_config;
170 state = STATE_DISCOVERY;
171 got_PADO = got_PADS = got_PADT = FALSE;
172 memcpy (ac_mac_addr, _eth_brdcast, sizeof(ac_mac_addr));
173}
174
175
184int pppoe_start (void)
185{
186 if (!cfg.enable || _pktdevclass != PDCLASS_ETHER)
187 return (1);
188
189 if (!pppoe_discovery())
190 return (0);
191
192#undef MSS_MAX
193#define MSS_MAX (PPPOE_MAX_DATA - TCP_OVERHEAD)
194 _mss = min (_mss, MSS_MAX);
195
196 /* If not already clamped by user/pktdrvr, set MTU == 1492
197 */
198 if (_mtu > PPPOE_MAX_DATA)
199 _mtu = PPPOE_MAX_DATA;
200
201 state = STATE_SESSION;
202 ppp_start (cfg.trace);
203 return (1);
204}
205
209void pppoe_exit (void)
210{
211 if (!cfg.enable || state == STATE_NONE)
212 return;
213
214 pppoe_send_disc (PPPOE_CODE_PADT);
215 session = 0;
216 state = STATE_NONE;
217 memcpy (ac_mac_addr, _eth_brdcast, sizeof(ac_mac_addr));
218}
219
223int pppoe_handler (const pppoe_Packet *pkt)
224{
225 const BYTE *buf;
226 const void *src;
227 const void *dst;
228 const pppoe_Header *head = &pkt->head;
229 WORD proto, len;
230 BOOL bcast, delivered = FALSE;
231
232 if (head->type != 1 || head->ver != 1)
233 return (0);
234
235 src = MAC_SRC (pkt);
236 dst = MAC_DST (pkt);
237 proto = MAC_TYP (pkt);
238 bcast = !memcmp (dst, _eth_brdcast, _eth_mac_len);
239
240 if (proto == PPPOE_SESS_TYPE && state == STATE_SESSION)
241 {
242 if (head->code == PPPOE_CODE_SESS &&
243 head->session == session &&
244 !bcast &&
245 !memcmp(dst, _eth_addr, _eth_mac_len) && /* to us? */
246 !memcmp(src, ac_mac_addr, _eth_mac_len))
247 {
248 len = intel16 (head->length);
249 buf = (const BYTE*) (head + 1);
250 ppp_input (buf, len); /* assume ppp_input() traces it */
251 delivered = TRUE;
252 }
253 }
254 else if (!bcast && proto == PPPOE_DISC_TYPE && state == STATE_DISCOVERY)
255 {
256 if (head->code == PPPOE_CODE_PADO) /* Offer (can this be bcast?) */
257 {
258 got_PADO = TRUE;
259 memcpy (ac_mac_addr, src, _eth_mac_len);
260 }
261 else if (head->code == PPPOE_CODE_PADT && /* Terminate */
262 head->session == session)
263 {
264 if (cfg.trace)
265 outsnl (_LANG("PPPoE: session terminated"));
266 got_PADT = TRUE;
267 session = 0;
268 }
269 else if (head->code == PPPOE_CODE_PADS) /* Session-confirmation */
270 {
271 got_PADS = TRUE;
272 session = head->session;
273 }
274 else if (head->code == PPPOE_CODE_PADM) /* Message (what to do?) */
275 {
276 got_PADM = TRUE;
277 }
278 }
279 if (!delivered)
280 DEBUG_RX (NULL, pkt);
281 return (1);
282}
283
288BOOL pppoe_is_up (const void *dest)
289{
290#if 1
291 if (!cfg.enable || memcmp(dest, ac_mac_addr, _eth_mac_len))
292 return (FALSE);
293 return (session != 0 && !got_PADT);
294#else
295 session = 0xAA55;
296 return (TRUE); /* test */
297#endif
298}
299
303static WORD build_pad (struct pppoe_Packet *pkt, WORD code)
304{
305 BYTE *tags = &pkt->data[0];
306
307 if (code == PPPOE_CODE_PADI || code == PPPOE_CODE_PADR)
308 {
309 WORD srv_len = 0;
310
311 *(WORD*) tags = PPPOE_TAG_SERVICE_NAME;
312 tags += 2;
313 if (cfg.service_name[0])
314 {
315 srv_len = strlen (cfg.service_name);
316 srv_len = min (srv_len, sizeof(pkt->data)-2 - PPPOE_TAG_HDR_SIZE);
317 memcpy (tags+2, cfg.service_name, srv_len);
318 }
319 *(WORD*) tags = intel16 (srv_len);
320
321 /* Insert PPPOE_TAG_END_LIST ?
322 */
323 return (srv_len + PPPOE_TAG_HDR_SIZE);
324 }
325 *(WORD*)tags = 0; /* No tags */
326 return (0);
327}
328
333static int pppoe_send_disc (int code)
334{
335 pppoe_Packet *pkt;
336 WORD len;
337
338 pkt = (pppoe_Packet*) _eth_formatpacket (&ac_mac_addr[0], PPPOE_DISC_TYPE);
339 len = build_pad (pkt, code);
340
341 pkt->head.ver = 1;
342 pkt->head.type = 1;
343 pkt->head.code = code;
344 pkt->head.session = session;
345 pkt->head.length = intel16 (len);
346
347#if defined(USE_DEBUG)
348 if (cfg.trace)
349 (*_printf) ("PPPOE: sending %s\n", pppoe_get_code(code));
350#endif
351
352 return _eth_send (len + PPPOE_HDR_SIZE, NULL, __FILE__, __LINE__);
353}
354
358int pppoe_send_sess (const void *sock, const BYTE *buf, WORD len)
359{
360 pppoe_Packet *pkt;
361
362 pkt = (pppoe_Packet*) _eth_formatpacket (&ac_mac_addr[0], PPPOE_SESS_TYPE);
363
364 pkt->head.ver = 1;
365 pkt->head.type = 1;
366 pkt->head.code = PPPOE_CODE_SESS;
367 pkt->head.session = session;
368 pkt->head.length = intel16 (len);
369
370 memcpy (pkt->data, buf, len);
371 return _eth_send (len + PPPOE_HDR_SIZE, sock, __FILE__, __LINE__);
372}
373
378void *pppoe_mac_format (union link_Packet *tx)
379{
380 pppoe_Packet *pppoe = (pppoe_Packet*) tx->eth.data;
381
382 memcpy (&tx->eth.head.destination[0], ac_mac_addr, sizeof(mac_address));
383 memcpy (&tx->eth.head.source[0], _eth_addr, sizeof(mac_address));
384
385 tx->eth.head.type = PPPOE_SESS_TYPE;
386 pppoe->head.ver = 1;
387 pppoe->head.type = 1;
388 pppoe->head.code = PPPOE_CODE_SESS;
389 pppoe->head.session = session;
390 _pkt_ip_ofs = sizeof(eth_Header) + PPPOE_HDR_SIZE + 2; /* !! see _eth_send() */
391 *(WORD*) &pppoe->data[0] = intel16 (PPP_IP);
392 return (void*) &pppoe->data[2];
393}
394#endif /* USE_PPPOE */
395
language.h
misc.h
misc_str.h
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
pcconfig.h
pcdbug.h
_pkt_ip_ofs
WORD _pkt_ip_ofs
ofs from link-layer head to ip
Definition: pcpkt.c:49
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
pcpkt.h
pcqueue.h
_eth_send
int W32_CALL _eth_send(WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
Definition: pcsed.c:301
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
_eth_mac_len
BYTE _eth_mac_len
Size of a MAC address.
Definition: pcsed.c:53
_eth_brdcast
mac_address _eth_brdcast
Link-layer broadcast address.
Definition: pcsed.c:50
pcsed.h
pctcp.h
ppp_input
void ppp_input(const BYTE *inbuffer, WORD len)
The PPP input handler.
Definition: ppp.c:845
ppp.h
lcp_echo_intv
int lcp_echo_intv
Not used.
Definition: pppoe.c:81
pppoe_wait
static BOOL pppoe_wait(int wait_code)
Loop waiting for timeout or a PAD response.
Definition: pppoe.c:110
pppoe_handler
int pppoe_handler(const pppoe_Packet *pkt)
Handle incoming PPPoE packets.
Definition: pppoe.c:223
pppoe_init
void pppoe_init(void)
Set config-parser hook and initial values.
Definition: pppoe.c:166
user_name
char user_name[MAX_VALUELEN+1]
Definition: pppoe.c:83
pppoe_exit
void pppoe_exit(void)
Close down PPPoE by sending a PADT.
Definition: pppoe.c:209
pppoe_mac_format
void * pppoe_mac_format(union link_Packet *tx)
Build a PPPoE session packet header.
Definition: pppoe.c:378
build_pad
static WORD build_pad(struct pppoe_Packet *pkt, WORD code)
Build a PADx packet.
Definition: pppoe.c:303
pppoe_send_sess
int pppoe_send_sess(const void *sock, const BYTE *buf, WORD len)
Build and send a PPPoE Session packet (IPCP or LCP packet).
Definition: pppoe.c:358
pppoe_send_disc
static int pppoe_send_disc(int code)
Build and send a PADx (PPPoE Active Discovery) packet as link-layer broadcast or unicast.
Definition: pppoe.c:333
pppoe_start
int pppoe_start(void)
Start PPPoE by doing a Discovery.
Definition: pppoe.c:184
pppoe_discovery
static BOOL pppoe_discovery(void)
The PPPoE Discovery handler.
Definition: pppoe.c:137
pppoe_is_up
BOOL pppoe_is_up(const void *dest)
Determine if we have a PPPoE session with the machine given by 'dest'.
Definition: pppoe.c:288
pppoe.h
code
Definition: zinftree.h:24
config_table
Definition: tcp.h:461
eth_Header
Definition: pcsed.h:20
pppoe_Header
Definition: pcsed.h:229
pppoe_Packet
Definition: pcsed.h:237
ARG_STRCPY
@ ARG_STRCPY
copy string value
Definition: tcp.h:456
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
link_Packet
Definition: pcsed.h:247
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/pppoe.h Source File

  • src
pppoe.h
Go to the documentation of this file.
1
3#ifndef _w32_PPPOE_H
4#define _w32_PPPOE_H
5
6#define PPPOE_CODE_PADI 0x09 /* Active Discovery Initiation */
7#define PPPOE_CODE_PADO 0x07 /* Active Discovery Offer packet */
8#define PPPOE_CODE_PADR 0x19 /* Active Discovery Request */
9#define PPPOE_CODE_PADS 0x65 /* Active Discovery Session-confirmation */
10#define PPPOE_CODE_PADT 0xA7 /* Active Discovery Terminate */
11#define PPPOE_CODE_PADM 0xD3 /* Active Discovery Message packet */
12#define PPPOE_CODE_PADN 0xD4 /* Active Discovery Network packet */
13#define PPPOE_CODE_SESS 0x00 /* code when we have a session */
14
15/* These 16-bit tags are on network order (RFC2516).
16 */
17#define PPPOE_TAG_END_LIST 0x0000
18#define PPPOE_TAG_SERVICE_NAME 0x0101
19#define PPPOE_TAG_AC_NAME 0x0102
20#define PPPOE_TAG_HOST_UNIQ 0x0103
21#define PPPOE_TAG_AC_COOKIE 0x0104
22#define PPPOE_TAG_VENDOR_SPES 0x0105
23#define PPPOE_TAG_RELAY_SESS 0x0106
24#define PPPOE_TAG_HOST_URL 0x0111
25#define PPPOE_TAG_MOTM 0x0112
26#define PPPOE_TAG_IP_ROUTE_ADD 0x0121
27#define PPPOE_TAG_SERVICE_ERR 0x0201
28#define PPPOE_TAG_AC_SYSTEM_ERR 0x0202
29#define PPPOE_TAG_GENERIC_ERR 0x0203
30
31#define PPPOE_HDR_SIZE 6 /* ver/type, code, session, length */
32#define PPPOE_TAG_HDR_SIZE 4 /* type, length header */
33
34extern void pppoe_init (void);
35extern void pppoe_exit (void);
36extern int pppoe_start (void);
37extern int pppoe_handler (const pppoe_Packet *pkt);
38extern BOOL pppoe_is_up (const void *dest);
39extern int pppoe_send_sess (const void *sock, const BYTE *buf, WORD len);
40extern void *pppoe_mac_format (union link_Packet *buf);
41
42#endif
pppoe_handler
int pppoe_handler(const pppoe_Packet *pkt)
Handle incoming PPPoE packets.
Definition: pppoe.c:223
pppoe_init
void pppoe_init(void)
Set config-parser hook and initial values.
Definition: pppoe.c:166
pppoe_mac_format
void * pppoe_mac_format(union link_Packet *buf)
Build a PPPoE session packet header.
Definition: pppoe.c:378
pppoe_exit
void pppoe_exit(void)
Close down PPPoE by sending a PADT.
Definition: pppoe.c:209
pppoe_send_sess
int pppoe_send_sess(const void *sock, const BYTE *buf, WORD len)
Build and send a PPPoE Session packet (IPCP or LCP packet).
Definition: pppoe.c:358
pppoe_start
int pppoe_start(void)
Start PPPoE by doing a Discovery.
Definition: pppoe.c:184
pppoe_is_up
BOOL pppoe_is_up(const void *dest)
Determine if we have a PPPoE session with the machine given by 'dest'.
Definition: pppoe.c:288
pppoe_Packet
Definition: pcsed.h:237
link_Packet
Definition: pcsed.h:247


Watt-32 tcp/ip: E:/WATT/src/presaddr.c Source File

  • src
presaddr.c
Go to the documentation of this file.
1
5/* Copyright (c) 1996 by Internet Software Consortium.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
12 * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
13 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
14 * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
16 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
17 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
18 * SOFTWARE.
19 */
20
21#include "socket.h"
22
23#if defined(USE_BSD_API)
24
25static const char *inet_ntop4 (const u_char *src, char *dst, size_t size);
26static int inet_pton4 (const char *src, u_char *dst);
27
28#if defined(USE_IPV6)
29static const char *inet_ntop6 (const u_char *src, char *dst, size_t size);
30static int inet_pton6 (const char *src, u_char *dst);
31#endif
32
33#undef inet_ntop /* provide the un-prefixed versions too */
34#undef inet_pton
35
43const char * W32_CALL inet_ntop (int af, const void *src, char *dst, size_t size)
44{
45 switch (af)
46 {
47 case AF_INET:
48 return inet_ntop4 ((const u_char*)src, dst, size);
49#if defined(USE_IPV6)
50 case AF_INET6:
51 return inet_ntop6 ((const u_char*)src, dst, size);
52#endif
53 default:
54 SOCK_ERRNO (EAFNOSUPPORT);
55 return (NULL);
56 }
57}
58
59const char * W32_CALL _w32_inet_ntop (int af, const void *src, char *dst, size_t size)
60{
61 return inet_ntop (af, src, dst, size);
62}
63
73int W32_CALL inet_pton (int af, const char *src, void *dst)
74{
75 switch (af)
76 {
77 case AF_INET:
78 return inet_pton4 (src, (u_char*)dst);
79#if defined(USE_IPV6)
80 case AF_INET6:
81 return inet_pton6 (src, (u_char*)dst);
82#endif
83 default:
84 SOCK_ERRNO (EAFNOSUPPORT);
85 return (-1);
86 }
87}
88
89int W32_CALL _w32_inet_pton (int af, const char *src, void *dst)
90{
91 return inet_pton (af, src, dst);
92}
93
103static const char *inet_ntop4 (const u_char *src, char *dst, size_t size)
104{
105 char tmp [sizeof("255.255.255.255")];
106
107 if ((size_t)sprintf(tmp,"%u.%u.%u.%u",src[0],src[1],src[2],src[3]) > size)
108 {
109 SOCK_ERRNO (ENOSPC);
110 return (NULL);
111 }
112 return strcpy (dst, tmp);
113}
114
115#if defined(USE_IPV6)
121static const char *inet_ntop6 (const u_char *src, char *dst, size_t size)
122{
123 /*
124 * Note that int32_t and int16_t need only be "at least" large enough
125 * to contain a value of the specified size. On some systems, like
126 * Crays, there is no such thing as an integer variable with 16 bits.
127 * Keep this in mind if you think this function should have been coded
128 * to use pointer overlays. All the world's not a VAX.
129 */
130 char tmp [sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
131 char *tp;
132 int i;
133 struct {
134 long base;
135 long len;
136 } best, cur;
137 u_long words [IN6ADDRSZ / INT16SZ];
138
139 /* Preprocess:
140 * Copy the input (bytewise) array into a wordwise array.
141 * Find the longest run of 0x00's in src[] for :: shorthanding.
142 */
143 memset (words, '\0', sizeof(words));
144 for (i = 0; i < IN6ADDRSZ; i++)
145 words[i/2] |= (src[i] << ((1 - (i % 2)) << 3));
146
147 best.base = -1;
148 cur.base = -1;
149 best.len = 0;
150 cur.len = 0;
151 for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++)
152 {
153 if (words[i] == 0)
154 {
155 if (cur.base == -1)
156 {
157 cur.base = i;
158 cur.len = 1;
159 }
160 else
161 cur.len++;
162 }
163 else if (cur.base != -1)
164 {
165 if (best.base == -1 || cur.len > best.len)
166 best = cur;
167 cur.base = -1;
168 }
169 }
170
171 if ((cur.base != -1) && (best.base == -1 || cur.len > best.len))
172 best = cur;
173
174 if (best.base != -1 && best.len < 2)
175 best.base = -1;
176
177 /* Format the result.
178 */
179 tp = tmp;
180 for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++)
181 {
182 /* Are we inside the best run of 0x00's?
183 */
184 if (best.base != -1 && i >= best.base && i < (best.base + best.len))
185 {
186 if (i == best.base)
187 *tp++ = ':';
188 continue;
189 }
190
191 /* Are we following an initial run of 0x00s or any real hex?
192 */
193 if (i != 0)
194 *tp++ = ':';
195
196 /* Is this address an encapsulated IPv4?
197 */
198 if (i == 6 && best.base == 0 &&
199 (best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
200 {
201 if (!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp)))
202 {
203 SOCK_ERRNO (ENOSPC);
204 return (NULL);
205 }
206 tp += strlen (tp);
207 break;
208 }
209 tp += sprintf (tp, "%lX", words[i]);
210 }
211
212 /* Was it a trailing run of 0x00's?
213 */
214 if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
215 *tp++ = ':';
216 *tp++ = '\0';
217
218 /* Check for overflow, copy, and we're done.
219 */
220 if ((size_t)(tp - tmp) > size)
221 {
222 SOCK_ERRNO (ENOSPC);
223 return (NULL);
224 }
225 return strcpy (dst, tmp);
226}
227#endif /* USE_IPV6 */
228
238static int inet_pton4 (const char *src, u_char *dst)
239{
240 static const char digits [] = "0123456789";
241 int saw_digit, octets, ch;
242 u_char tmp [INADDRSZ];
243 u_char *tp;
244
245 saw_digit = 0;
246 octets = 0;
247 *(tp = tmp) = '\0';
248 while ((ch = *src++) != '\0')
249 {
250 const char *pch = strchr (digits, ch);
251
252 if (pch)
253 {
254 u_int New = *tp * 10 + (pch - digits);
255
256 if (New > 255)
257 return (0);
258 *tp = New;
259 if (!saw_digit)
260 {
261 if (++octets > 4)
262 return (0);
263 saw_digit = 1;
264 }
265 }
266 else if (ch == '.' && saw_digit)
267 {
268 if (octets == 4)
269 return (0);
270 *++tp = '\0';
271 saw_digit = 0;
272 }
273 else
274 return (0);
275 }
276 if (octets < 4)
277 return (0);
278
279 memcpy (dst, tmp, INADDRSZ);
280 return (1);
281}
282
283#if defined(USE_IPV6)
295static int inet_pton6 (const char *src, u_char *dst)
296{
297 u_char tmp [IN6ADDRSZ];
298 u_char *endp, *colonp, *tp = tmp;
299 const char *curtok;
300 int ch, saw_xdigit;
301 u_int val;
302 u_char val8;
303
304 memset (tmp, 0, sizeof(tmp));
305 endp = tmp + sizeof(tmp);
306 colonp = NULL;
307
308 /* Leading :: requires some special handling.
309 */
310 if (*src == ':' && *++src != ':')
311 return (0);
312
313 curtok = src;
314 saw_xdigit = 0;
315 val = 0;
316
317 while ((ch = *src++) != '\0')
318 {
319 const char *pch;
320
321 ch = tolower (ch);
322 pch = strchr (hex_chars_lower, ch);
323 if (pch)
324 {
325 val <<= 4;
326 val |= (pch - hex_chars_lower);
327 if (val > 0xffff)
328 return (0);
329 saw_xdigit = 1;
330 continue;
331 }
332 if (ch == ':')
333 {
334 curtok = src;
335 if (!saw_xdigit)
336 {
337 if (colonp)
338 return (0);
339 colonp = tp;
340 continue;
341 }
342 if (tp + INT16SZ > endp)
343 return (0);
344
345 *tp++ = (u_char) (val >> 8) & 0xff;
346 *tp++ = (u_char) (val & 0xff);
347 saw_xdigit = 0;
348 val = 0;
349 continue;
350 }
351 if (ch == '.' && ((tp + INADDRSZ) <= endp) && inet_pton4(curtok,tp) > 0)
352 {
353 tp += INADDRSZ;
354 saw_xdigit = 0;
355 break; /* '\0' was seen by inet_pton4(). */
356 }
357 return (0);
358 }
359 if (saw_xdigit)
360 {
361 if (tp + INT16SZ > endp)
362 return (0);
363
364 /* With MSVC's '-RTCc' option a "(u_char) val & 0xff;" causes '_RTC_Failure()' to be called.
365 * Use this 'val8' intermediate value instead.
366 */
367 val8 = loBYTE (val);
368 *tp++ = (u_char) (val >> 8) & 0xff;
369 *tp++ = val8;
370 }
371 if (colonp)
372 {
373 /*
374 * Since some memmove()'s erroneously fail to handle
375 * overlapping regions, we'll do the shift by hand.
376 */
377 const int n = tp - colonp;
378 int i;
379
380 for (i = 1; i <= n; i++)
381 {
382 endp[-i] = colonp[n-i];
383 colonp[n-i] = '\0';
384 }
385 tp = endp;
386 }
387 if (tp != endp)
388 return (0);
389
390 memcpy (dst, tmp, IN6ADDRSZ);
391 return (1);
392}
393#endif /* USE_IPV6 */
394#endif /* USE_BSD_API */
395
396#if defined(TEST_PROG)
397#if !defined(USE_BSD_API)
398int main (void)
399{
400 puts ("This program needs '#define USE_BSD_API' (and '#define USE_IPV6')");
401 return (1);
402}
403#else /* rest of file */
404
405int main (int argc, char **argv)
406{
407 const char *ip6_str;
408 ip6_address ip6_addr;
409
410 if (argc != 2)
411 {
412 printf ("Usage: %s ip6-address\n", argv[0]);
413 return (-1);
414 }
415
416 ip6_str = argv[1];
417 memset (&ip6_addr, 0, sizeof(ip6_addr));
418 if (!inet_pton(AF_INET6, ip6_str, &ip6_addr))
419 {
420 printf ("Invalid IPv6 address `%s'\n", ip6_str);
421 return (-1);
422 }
423
424 printf ("inet_pton(AF_INET6): %s -> %s\n",
425 ip6_str, _inet6_ntoa(&ip6_addr));
426 return (0);
427}
428#endif /* USE_BSD_API */
429#endif /* TEST_PROG */
430
431
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
inet_pton6
static int inet_pton6(const char *src, u_char *dst)
Convert presentation level address to network order binary form.
Definition: presaddr.c:295
inet_ntop6
static const char * inet_ntop6(const u_char *src, char *dst, size_t size)
Convert IPv6 binary address into presentation (printable) format.
Definition: presaddr.c:121
inet_pton4
static int inet_pton4(const char *src, u_char *dst)
Like inet_aton() but without all the hexadecimal and shorthand.
Definition: presaddr.c:238
inet_pton
int W32_CALL inet_pton(int af, const char *src, void *dst)
Convert from presentation format (which usually means ASCII printable) to network format (which is us...
Definition: presaddr.c:73
inet_ntop
const char *W32_CALL inet_ntop(int af, const void *src, char *dst, size_t size)
Convert a network format address to presentation format.
Definition: presaddr.c:43
inet_ntop4
static const char * inet_ntop4(const u_char *src, char *dst, size_t size)
Format an IPv4 address, more or less like inet_ntoa().
Definition: presaddr.c:103


Watt-32 tcp/ip: E:/WATT/src/printk.c Source File

  • src
printk.c
Go to the documentation of this file.
1
36#include <stdio.h>
37#include <stdlib.h>
38#include <stdarg.h>
39#include <string.h>
40#include <signal.h>
41#include <ctype.h>
42#include <errno.h>
43#include <time.h>
44
45#include "wattcp.h"
46#include "misc.h"
47#include "misc_str.h"
48#include "run.h"
49#include "netaddr.h"
50#include "pcconfig.h"
51#include "printk.h"
52
53#if defined(USE_BSD_API) || defined(USE_DEBUG) || (DOSX & (DOS4GW|X32VM))
54
55int _printk_safe = 1; /* must be set to 0 in intr-handlers */
56
57#if defined(_WIN32) || defined(__CYGWIN__)
58 FILE *_printk_file = NULL;
59#else
60 FILE *_printk_file = stderr;
61#endif
62
63static char *printk_ptr = NULL;
64static char *printk_buf = NULL;
65static char *printk_end = NULL;
66
67static const char *str_signal (int sig);
68
69/*
70 * _snprintk - format a message into a buffer. Like snprintf() except
71 * we also handle:
72 * %m - error message from 'strerror(errno)'.
73 * %t - current time.
74 * %I - IPv4 address.
75 * %S - signal name.
76 *
77 * Returns the number of chars put into buf.
78 *
79 * NB! Doesn't do floating-point formats and long modifiers.
80 * (e.g. "%lu").
81 */
82int MS_CDECL _snprintk (char *buf, int buflen, const char *fmt, ...)
83{
84 int len;
85 va_list args;
86
87 va_start (args, fmt);
88 len = _vsnprintk (buf, buflen, fmt, args);
89 va_end (args);
90 return (len);
91}
92
93int MS_CDECL _printk (const char *fmt, ...)
94{
95 int left = (int)(printk_end - printk_ptr);
96 int len = -1;
97
98 if (_printk_file && fmt && left > 0)
99 {
100 va_list args;
101
102 va_start (args, fmt);
103 len = _vsnprintk (printk_ptr, left, fmt, args);
104 printk_ptr += len;
105 _printk_flush();
106 va_end (args);
107 }
108 return (len);
109}
110
111/*
112 * Return 0 if okay, else -1
113 */
114int _fputsk (const char *buf, FILE *stream)
115{
116 int rc = -1;
117
118 if (stream && _printk_safe)
119 rc = fwrite (buf, strlen(buf), 1, stream);
120 return (rc == 1 ? 0 : -1);
121}
122
123void _printk_flush (void)
124{
125 int len = printk_ptr - printk_buf;
126
127 if (_printk_safe && _printk_file && len > 0)
128 {
129 fwrite (printk_buf, len, 1, _printk_file);
130 printk_ptr = printk_buf;
131 }
132}
133
134static void W32_CALL printk_exit (void)
135{
136 _printk_flush();
137 if (_printk_file && _printk_file != stderr && _printk_file != stdout)
138 fclose (_printk_file);
139 _printk_file = NULL;
140
141 DO_FREE (printk_buf); /* Reclaim memory allocated in _printk_init() */
142}
143
144/*
145 * Called from openlog() to allocate print-buffer and
146 * optionally open a file. If file == NULL, print to stderr.
147 */
148int _printk_init (int size, const char *file)
149{
150 if (!printk_buf)
151 {
152 printk_ptr = printk_buf = malloc (size);
153 if (!printk_ptr)
154 {
155 fprintf (stderr, "_printk_init: allocation failed\n");
156 return (0);
157 }
158 }
159
160#if defined(_WIN32) || defined(__CYGWIN__)
161 _printk_file = stderr;
162#endif
163
164 if (file && (_printk_file = fopen(file,"wt")) == NULL)
165 {
166 fprintf (stderr, "_printk_init: cannot open `%s'\n", file);
167 return (0);
168 }
169 printk_end = printk_ptr + size;
170 RUNDOWN_ADD (printk_exit, 301);
171 return (1);
172}
173
174
175/*
176 * _vsnprintk - like _snprintk, takes a va_list instead of a list of args.
177 */
178#define OUTCHAR(c) (void) (buflen > 0 ? (--buflen, *buf++ = (c)) : 0)
179
180int _vsnprintk (char *buf, int buflen, const char *fmt, va_list args)
181{
182 int c, n, width, prec, fillch;
183 int base, len, neg, quoted, upper;
184 long i;
185 BOOL right_pad, is_long;
186 BYTE *p;
187 char *str, *f, *buf0 = buf, *_fmt = (char*)fmt;
188 char num[32], ct_buf[30];
189 time_t t;
190 DWORD_PTR val = 0L;
191
192 if (--buflen < 0)
193 return (-1);
194
195 while (buflen > 0)
196 {
197 for (f = _fmt; *f != '%' && *f != '\0'; ++f)
198 ;
199 if (f > _fmt)
200 {
201 len = f - _fmt;
202 if (len > buflen)
203 len = buflen;
204 memcpy (buf, _fmt, len);
205 buf += len;
206 buflen -= len;
207 _fmt = f;
208 }
209 if (*_fmt == '\0')
210 break;
211
212 is_long = FALSE;
213next:
214 c = *(++_fmt);
215 width = prec = 0;
216 right_pad = FALSE;
217 fillch = ' ';
218 if (c == '0')
219 {
220 fillch = '0';
221 c = *(++_fmt);
222 }
223 if (c == '*')
224 {
225 width = va_arg (args, int);
226 c = *(++_fmt);
227 }
228 else
229 {
230 if (c == '-')
231 {
232 right_pad = TRUE;
233 c = *(++fmt);
234 }
235 while (isdigit(c))
236 {
237 width = width * 10 + c - '0';
238 c = *(++_fmt);
239 }
240 }
241
242 if (c == '.')
243 {
244 c = *(++_fmt);
245 if (c == '*')
246 {
247 prec = va_arg (args, int);
248 c = *(++_fmt);
249 }
250 else
251 {
252 while (isdigit(c))
253 {
254 prec = prec * 10 + c - '0';
255 c = *(++_fmt);
256 }
257 }
258 }
259 str = NULL;
260 base = 0;
261 neg = 0;
262 upper = 0;
263 ++_fmt;
264
265 switch (c)
266 {
267 case 'l':
268 is_long = 1;
269 goto next;
270
271 case 'd':
272 i = is_long ? va_arg (args, long) : va_arg (args, int);
273 if (i < 0)
274 {
275 neg = 1;
276 val = -i;
277 }
278 else
279 val = i;
280 base = 10;
281 break;
282
283 case 'u':
284 val = is_long ? va_arg (args, DWORD) : va_arg (args, unsigned);
285 base = 10;
286 break;
287
288 case 'o':
289 val = is_long ? va_arg (args, unsigned long) :
290 va_arg (args, unsigned int);
291 base = 8;
292 break;
293
294 case 'X':
295 upper = 1;
296 /* fall through */
297 case 'x':
298 val = is_long ? va_arg (args, unsigned long) :
299 va_arg (args, unsigned int);
300 base = 16;
301 break;
302
303 case 'p':
304 val = (DWORD_PTR) va_arg (args, void*);
305 base = 16;
306 neg = 2;
307 upper = 1;
308 break;
309
310 case 's':
311 str = va_arg (args, char*);
312 break;
313
314 case 'S':
315 str = (char*) str_signal (va_arg(args, int));
316 break;
317
318 case 'c':
319 num[0] = va_arg (args, int);
320 num[1] = '\0';
321 str = num;
322 break;
323
324 case 'm':
325 str = rip (strerror(errno));
326 break;
327
328 case 'I':
329 str = _inet_ntoa (num, ntohl(va_arg(args,DWORD)));
330 break;
331
332 case 't':
333 str = (char*) "??";
334 if (!_printk_safe)
335 break;
336 time (&t);
337 str = ctime_r (&t, ct_buf);
338 str += 4; /* chop off the day name */
339 str[15] = '\0'; /* chop off year and newline */
340 break;
341
342 case 'v': /* "visible" string */
343 case 'q': /* quoted string */
344 quoted = (c == 'q');
345 p = va_arg (args, BYTE*);
346 if (fillch == '0' && prec > 0)
347 n = prec;
348 else
349 {
350 n = strlen ((char*)p);
351 if (prec > 0 && prec < n)
352 n = prec;
353 }
354 while (n > 0 && buflen > 0)
355 {
356 c = *p++;
357 --n;
358 if (!quoted && c >= 0x80)
359 {
360 OUTCHAR ('M');
361 OUTCHAR ('-');
362 c -= 0x80;
363 }
364 if (quoted && (c == '"' || c == '\\'))
365 OUTCHAR ('\\');
366 if (c < 0x20 || (0x7F <= c && c < 0xA0))
367 {
368 if (quoted)
369 {
370 OUTCHAR ('\\');
371 switch (c)
372 {
373 case '\t':
374 OUTCHAR ('t');
375 break;
376 case '\n':
377 OUTCHAR ('n');
378 break;
379 case '\b':
380 OUTCHAR ('b');
381 break;
382 case '\f':
383 OUTCHAR ('f');
384 break;
385 default:
386 OUTCHAR ('x');
387 OUTCHAR (hex_chars_lower[c >> 4]);
388 OUTCHAR (hex_chars_lower[c & 0xF]);
389 }
390 }
391 else
392 {
393 if (c == '\t')
394 OUTCHAR (c);
395 else
396 {
397 OUTCHAR ('^');
398 OUTCHAR (c ^ 0x40);
399 }
400 }
401 }
402 else
403 OUTCHAR (c);
404 }
405 continue;
406
407 default:
408 *buf++ = '%';
409 if (c != '%')
410 --_fmt; /* so %z outputs %z etc. */
411 --buflen;
412 continue;
413 }
414
415 if (base)
416 {
417 str = num + sizeof(num);
418 *(--str) = '\0';
419 while (str > num + neg)
420 {
421 int idx = val % base;
422
423 *(--str) = upper ? hex_chars_upper[idx] :
424 hex_chars_lower[idx];
425 val = val / base;
426 if (--prec <= 0 && val == 0)
427 break;
428 }
429 switch (neg)
430 {
431 case 1: *(--str) = '-';
432 break;
433 case 2: *(--str) = 'x';
434 *(--str) = '0';
435 break;
436 }
437 len = num + sizeof(num) - 1 - str;
438 }
439 else
440 {
441 len = strlen (str);
442 if (prec > 0 && len > prec)
443 len = prec;
444 }
445 if (right_pad && width > 0)
446 {
447 if (width > buflen)
448 width = buflen;
449 if ((n = width - len) > 0)
450 {
451 buflen -= n;
452 for (; n > 0; --n)
453 *buf++ = fillch;
454 }
455 }
456 if (len > buflen)
457 len = buflen;
458 memcpy (buf, str, len);
459 buf += len;
460 buflen -= len;
461
462 if (right_pad && width > 0)
463 {
464 if (width > buflen)
465 width = buflen;
466 if ((n = width - len) > 0)
467 {
468 buflen -= n;
469 for (; n > 0; --n)
470 *buf++ = fillch;
471 }
472 }
473 }
474 *buf = '\0';
475 return (buf - buf0);
476}
477
478
479/*
480 * Return name for signal 'sig'
481 */
482#ifdef __HIGHC__
483#undef SIGABRT /* = SIGIOT */
484#endif
485
486#if defined(SIGIOT) && (SIGIOT == SIGABRT)
487#undef SIGIOT /* Could be a problem on MinGW-w64 if 'SIGIOT == SIGABRT' */
488#endif
489
490static const char *str_signal (int sig)
491{
492 static char buf[20];
493
494 switch (sig)
495 {
496 case 0:
497 return ("None");
498#ifdef SIGINT
499 case SIGINT:
500 return ("SIGINT");
501#endif
502#ifdef SIGABRT
503 case SIGABRT:
504 return ("SIGABRT");
505#endif
506#ifdef SIGFPE
507 case SIGFPE:
508 return ("SIGFPE");
509#endif
510#ifdef SIGILL
511 case SIGILL:
512 return ("SIGILL");
513#endif
514#ifdef SIGSEGV
515 case SIGSEGV:
516 return ("SIGSEGV");
517#endif
518#ifdef SIGTERM
519 case SIGTERM:
520 return ("SIGTERM");
521#endif
522#ifdef SIGALRM
523 case SIGALRM:
524 return ("SIGALRM");
525#endif
526#ifdef SIGHUP
527 case SIGHUP:
528 return ("SIGHUP");
529#endif
530#ifdef SIGKILL
531 case SIGKILL:
532 return ("SIGKILL");
533#endif
534#ifdef SIGPIPE
535 case SIGPIPE:
536 return ("SIGPIPE");
537#endif
538#ifdef SIGQUIT
539 case SIGQUIT:
540 return ("SIGQUIT");
541#endif
542#ifdef SIGUSR1
543 case SIGUSR1:
544 return ("SIGUSR1");
545#endif
546#ifdef SIGUSR2
547 case SIGUSR2:
548 return ("SIGUSR2");
549#endif
550#ifdef SIGUSR3
551 case SIGUSR3:
552 return ("SIGUSR3");
553#endif
554#ifdef SIGNOFP
555 case SIGNOFP:
556 return ("SIGNOFP");
557#endif
558#ifdef SIGTRAP
559 case SIGTRAP:
560 return ("SIGTRAP");
561#endif
562#ifdef SIGTIMR
563 case SIGTIMR:
564 return ("SIGTIMR");
565#endif
566#ifdef SIGPROF
567 case SIGPROF:
568 return ("SIGPROF");
569#endif
570#ifdef SIGSTAK
571 case SIGSTAK:
572 return ("SIGSTAK");
573#endif
574#ifdef SIGBRK
575 case SIGBRK:
576 return ("SIGBRK");
577#endif
578#ifdef SIGBUS
579 case SIGBUS:
580 return ("SIGBUS");
581#endif
582#ifdef SIGIOT
583 case SIGIOT:
584 return ("SIGIOT");
585#endif
586#ifdef SIGEMT
587 case SIGEMT:
588 return ("SIGEMT");
589#endif
590#ifdef SIGSYS
591 case SIGSYS:
592 return ("SIGSYS");
593#endif
594#ifdef SIGCHLD
595 case SIGCHLD:
596 return ("SIGCHLD");
597#endif
598#ifdef SIGWINCH
599 case SIGWINCH:
600 return ("SIGWINCH");
601#endif
602#ifdef SIGPOLL
603 case SIGPOLL:
604 return ("SIGPOLL");
605#endif
606#ifdef SIGCONT
607 case SIGCONT:
608 return ("SIGCONT");
609#endif
610#ifdef SIGSTOP
611 case SIGSTOP:
612 return ("SIGSTOP");
613#endif
614#ifdef SIGTSTP
615 case SIGTSTP:
616 return ("SIGTSTP");
617#endif
618#ifdef SIGTTIN
619 case SIGTTIN:
620 return ("SIGTTIN");
621#endif
622#ifdef SIGTTOU
623 case SIGTTOU:
624 return ("SIGTTOU");
625#endif
626#ifdef SIGURG
627 case SIGURG:
628 return ("SIGURG");
629#endif
630#ifdef SIGLOST
631 case SIGLOST:
632 return ("SIGLOST");
633#endif
634#ifdef SIGDIL
635 case SIGDIL:
636 return ("SIGDIL");
637#endif
638#ifdef SIGXCPU
639 case SIGXCPU:
640 return ("SIGXCPU");
641#endif
642#ifdef SIGXFSZ
643 case SIGXFSZ:
644 return ("SIGXFSZ");
645#endif
646 }
647 strcpy (buf, "Unknown ");
648 itoa (sig, buf+8, 10);
649 return (buf);
650}
651
652#endif /* USE_BSD_API || USE_DEBUG || (DOSX & (DOS4GW|X32VM)) */
errno.h
ctime_r
char * ctime_r(const time_t *t, char *res)
A reentrant ctime().
Definition: misc.c:887
misc.h
misc_str.h
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
strerror
char *MS_CDECL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207
pcconfig.h
_printk_file
FILE * _printk_file
Definition: printk.c:58
_printk_safe
int _printk_safe
Definition: printk.c:55
printk.h
rip
Definition: routed.h:111
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/printk.h Source File

  • src
printk.h
Go to the documentation of this file.
1
3#ifndef _w32_PRINTK_H
4#define _w32_PRINTK_H
5
6#include <stdio.h>
7#include <stdarg.h>
8
9#if defined(__DJGPP__) || defined(__HIGHC__) || defined(__WATCOMC__) || defined(__DMC__)
10 #undef _WIN32 /* Needed for __DMC__ */
11 #include <unistd.h>
12#endif
13
14#if defined(__TURBOC__) || defined(_MSC_VER) || defined(__WATCOMC__) || \
15 defined(__DMC__) || defined(__MINGW32__)
16 #include <process.h>
17#endif
18
19#ifndef __SYS_CDEFS_H
20#include <sys/cdefs.h> /* W32_CDECL */
21#endif
22
23#ifdef _w32_WATTCP_H /* if included after wattcp.h (Watt-32 compile) */
24 #define _printk_safe W32_NAMESPACE (_printk_safe)
25 #define _printk_file W32_NAMESPACE (_printk_file)
26 #define _printk_init W32_NAMESPACE (_printk_init)
27 #define _printk_flush W32_NAMESPACE (_printk_flush)
28 #define _printk W32_NAMESPACE (_printk)
29 #define _fputsk W32_NAMESPACE (_fputsk)
30 #define _snprintk W32_NAMESPACE (_snprintk)
31 #define _vsnprintk W32_NAMESPACE (_vsnprintk)
32#endif
33
34extern int _printk_safe;
35extern FILE *_printk_file;
37extern int _printk_init (int size, const char *file);
38extern void _printk_flush (void);
39
40extern int _fputsk (const char *buf, FILE *stream);
41
42#if defined(__POCC__)
43 extern _CRTCHK(printf, 3, 3) int _vsnprintk (char *buf, int len, const char *fmt, va_list ap);
44 extern _CRTCHK(printf, 1, 2) int _printk (const char *fmt, ...);
45 extern _CRTCHK(printf, 3, 4) int _snprintk (char *buf, int len, const char *fmt, ...);
46
47#else
48
49 extern int _vsnprintk (char *buf, int len, const char *fmt, va_list ap)
50 W32_ATTR_PRINTF (3, 0);
51
52 extern int MS_CDECL _printk (_Printf_format_string_ const char *fmt, ...)
53 W32_ATTR_PRINTF (1, 2);
54
55 extern int MS_CDECL _snprintk (char *buf, int len, _Printf_format_string_ const char *fmt, ...)
56 W32_ATTR_PRINTF (3, 4);
57#endif
58
59#endif /* _w32_PRINTK_H */
60
cdefs.h
_printk_file
FILE * _printk_file
Definition: printk.c:58
_printk_safe
int _printk_safe
Definition: printk.c:55


Watt-32 tcp/ip: E:/WATT/src/profile.c Source File

  • src
profile.c
Go to the documentation of this file.
1
6/* Copyright (c) 1997-2007 Gisle Vanem <gvanem@yahoo.no>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Gisle Vanem
19 * Bergen, Norway.
20 *
21 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <stdio.h>
34#include <stdlib.h>
35#include <math.h>
36
37#include "wattcp.h"
38#include "cpumodel.h"
39#include "timer.h"
40#include "misc.h"
41#include "misc_str.h"
42#include "run.h"
43#include "language.h"
44#include "pcconfig.h"
45#include "profile.h"
46
47#if defined(USE_PROFILER)
48
49#if defined(WIN32)
50 #undef GET_RDTSC
51 #define GET_RDTSC() win_get_perf_count()
52#endif
53
54/*
55 * A simple execution profiler
56 */
57BOOL profile_enable = FALSE;
58char profile_file [MAX_PATHLEN+1] = ".\\WATTCP.PRO";
59
60static FILE *prof_fout;
61static uint64 prof_start;
62static uint64 num_profs;
63
64/*
65 * Called on entry of something to profile.
66 * \ref macro 'PROFILE_START(func)'.
67 */
68void profile_start (const char *str)
69{
70 if (prof_fout)
71 {
72 if (str)
73 fprintf (prof_fout, " profiling %-12.12s ", str);
74 prof_start = GET_RDTSC();
75 num_profs++;
76 }
77}
78
79/*
80 * Dumps the time taken (milli-sec and CPU clocks) since
81 * 'PROFILE_STOP(func)' was used.
82 * \ref macro 'PROFILE_STOP()'.
83 */
84void profile_stop (void)
85{
86 if (prof_fout && clocks_per_usec)
87 {
88 int64 clocks = (int64) (GET_RDTSC() - prof_start);
89 double msec = (double)clocks / ((double)clocks_per_usec * 1000.0);
90#if 0
91 fprintf (prof_fout, "%10.3f msec (%10" S64_FMT " clk)\n", msec, clocks);
92#else
93 fprintf (prof_fout, "%10.3f msec (%12s clk)\n", msec, qword_str(clocks));
94#endif
95 }
96}
97
98static void W32_CALL profile_exit (void)
99{
100 if (prof_fout)
101 {
102 fclose (prof_fout);
103 prof_fout = NULL;
104 if (num_profs)
105 (*_printf) ("profiling info written to \"%s\"\n", profile_file);
106 }
107}
108
109/*
110 * Dump some arbitrary data-array to profile dump file.
111 */
112void profile_dump (const uint64 *data, size_t num)
113{
114 unsigned i;
115
116 if (!prof_fout || !clocks_per_usec)
117 return;
118
119 for (i = 0; i < num; i++)
120 {
121 double msec = (double)data[i] / ((double)clocks_per_usec * 1000.0);
122
123#if 0
124 fprintf (prof_fout, "profile_dump: %3u: %12.3f msec (%10" U64_FMT " clk)\n",
125 i, msec, data[i]);
126#else
127 fprintf (prof_fout, "profile_dump: %3u: %12.3f msec (%12s clk)\n",
128 i, msec, qword_str(data[i]));
129#endif
130 }
131}
132
133/*
134 * Profile speed of receiving a packet. Write the difference of
135 * put - DOS: timestamp for 2nd packet upcall.
136 * WIN32: timestamp when recv-thread captured the packet.
137 * get - timestamp when we called 'pkt_poll_recv()'.
138 *
139 * DOS: the 'put' and 'get' are CPU clock timestamps (RDTSC instruction).
140 * WIN32: these are values from 'QueryPerformanceCounter()'.
141 */
142void profile_recv (uint64 put, uint64 get)
143{
144 if (!prof_fout || !clocks_per_usec)
145 return;
146
147 fputs (" profiling pkt_receiver ", prof_fout);
148 if (get == U64_SUFFIX(0) || put == U64_SUFFIX(0))
149 fputs ("<not enabled>\n", prof_fout);
150 else
151 {
152 int64 clocks = (int64) (get - put);
153 double msec = (double)clocks / ((double)clocks_per_usec * 1000.0);
154#if 0
155 fprintf (prof_fout, "%10.3f msec (%10" S64_FMT " clk)\n", msec, clocks);
156#else
157 fprintf (prof_fout, "%10.3f msec (%12s clk)\n", msec, qword_str(clocks));
158#endif
159 }
160}
161
162/*
163 * Must be called after init_timers() or init_misc().
164 */
165int profile_init (void)
166{
167 uint64 overhead, start;
168 time_t now;
169 char ct_buf [30];
170
171 if (!profile_enable || !profile_file[0])
172 return (0);
173
174 if (!has_rdtsc || !clocks_per_usec)
175 {
176 profile_enable = FALSE;
177 (*_printf) (_LANG("Profiling not available (no RDTSC or $USE_RDTSC=1)\n"));
178 return (0);
179 }
180
181 prof_fout = fopen (profile_file, "at");
182 if (!prof_fout)
183 {
184 (*_printf) (_LANG("Failed to open %s: %s\n"),
185 profile_file, strerror(errno));
186 return (0);
187 }
188
189#if !defined(__BORLANDC__) /* buggy output with this */
190 {
191 static char fbuf [256];
192 setvbuf (prof_fout, fbuf, _IOLBF, sizeof(fbuf)); /* line-buffered */
193 }
194#endif
195
196 now = time (NULL);
197 fprintf (prof_fout, "\nProfiling %s, %.15s, %s\n",
198 get_argv0(), ctime_r(&now, ct_buf) + 4, dos_extender_name());
199
200 num_profs = 0;
201 start = GET_RDTSC();
202 profile_start ("dummy");
203 profile_stop();
204 overhead = GET_RDTSC() - start;
205
206#if 0
207 fprintf (prof_fout, " CPU-speed %lu MHz, overhead %" U64_FMT " clocks\n",
208 (u_long)clocks_per_usec, overhead);
209#else
210 fprintf (prof_fout, " CPU-speed %lu MHz, overhead %s clocks\n",
211 (u_long)clocks_per_usec, qword_str(overhead));
212#endif
213
214 RUNDOWN_ADD (profile_exit, 90);
215 return (1);
216}
217
218int profile_on (void)
219{
220 return (prof_fout != NULL);
221}
222#endif /* USE_PROFILER */
223
cpumodel.h
language.h
qword_str
const char * qword_str(uint64 val)
The same as above.
Definition: misc.c:1053
ctime_r
char * ctime_r(const time_t *t, char *res)
A reentrant ctime().
Definition: misc.c:887
misc.h
misc_str.h
strerror
char *MS_CDECL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207
get_argv0
const char * get_argv0(void)
Return argv[0] as passed to main().
Definition: pcconfig.c:671
pcconfig.h
profile.h
clocks_per_usec
DWORD clocks_per_usec
Measured CPU speed (MHz)
Definition: timer.c:64
has_rdtsc
BOOL has_rdtsc
Never set in Watt-32.
Definition: timer.c:54
timer.h
wattcp.h
Core definitions.
int64
long long int64
our signed "long long" type
Definition: wattcp.h:66
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65


Watt-32 tcp/ip: E:/WATT/src/profile.h Source File

  • src
profile.h
Go to the documentation of this file.
1
3#ifndef _w32_PROFILE_H
4#define _w32_PROFILE_H
5
6#if defined(USE_PROFILER)
7 #define profile_start W32_NAMESPACE (profile_start)
8 #define profile_stop W32_NAMESPACE (profile_stop)
9 #define profile_init W32_NAMESPACE (profile_init)
10 #define profile_on W32_NAMESPACE (profile_on)
11 #define profile_dump W32_NAMESPACE (profile_dump)
12 #define profile_recv W32_NAMESPACE (profile_recv)
13 #define profile_file W32_NAMESPACE (profile_file)
14 #define profile_enable W32_NAMESPACE (profile_enable)
15
16 extern BOOL profile_enable;
17 extern char profile_file [MAX_PATHLEN+1];
18
19 extern void profile_start (const char *where);
20 extern void profile_stop (void);
21 extern int profile_init (void);
22 extern int profile_on (void);
23 extern void profile_dump (const uint64 *data, size_t num_elem);
24 extern void profile_recv (uint64 put, uint64 get);
25
26 #define PROFILE_START(func) profile_start (func)
27 #define PROFILE_STOP() profile_stop()
28 #define PROFILE_RECV(put,get) profile_recv (put,get)
29
30#else
31 #define PROFILE_START(func) ((void)0)
32 #define PROFILE_STOP() ((void)0)
33 #define PROFILE_RECV(put,get) ((void)0)
34#endif
35
36#endif
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65


Watt-32 tcp/ip: E:/WATT/src/qmsg.c Source File

  • src
qmsg.c
Go to the documentation of this file.
1
7#include <stdio.h>
8
9#include "copyrigh.h"
10#include "wattcp.h"
11#include "misc.h"
12#include "powerpak.h"
13#include "x32vm.h"
14
15#if defined(__MSDOS__)
16/*
17 * Disable stack-checking here because interrupt handlers might not
18 * setup a legal stack.
19 */
20#include "nochkstk.h"
21
22#define SCR_WIDTH 80
23#define SCR_HEIGHT 50
24#define SCR_SEGMENT 0xB800
25#define SCR_START (2*2*SCR_WIDTH) /* start at line 3 */
26
27BYTE dbg_colour = 14 + (16*1); /* yellow on blue */
28WORD dbg_scrpos = SCR_START;
29WORD dbg_scrstart = SCR_START;
30
31static int curr_line = (SCR_START/(2*SCR_WIDTH));
32
33void dputch (char x)
34{
35 if (x == '\r')
36 {
37 dbg_scrpos = 2 * SCR_WIDTH * curr_line;
38 }
39 else if (x == '\n')
40 {
41 dbg_scrpos += 2 * SCR_WIDTH;
42 curr_line++;
43 }
44 else
45 {
46 POKEW (SCR_SEGMENT, dbg_scrpos, x | (dbg_colour << 8));
47 dbg_scrpos += 2;
48 }
49 if (dbg_scrpos > 2*SCR_HEIGHT*SCR_WIDTH)
50 dbg_scrpos = dbg_scrstart;
51 if (curr_line >= SCR_HEIGHT)
52 curr_line = (SCR_START/(2*SCR_WIDTH));
53}
54
55void dmsg (const char *s)
56{
57 while (s && *s)
58 dputch (*s++);
59}
60
61void dhex1int (int x)
62{
63 x &= 0x0F;
64 if (x > 9)
65 x = 'A' + x - 10;
66 else x += '0';
67 dputch ((char)x);
68}
69
70void dhex2int (int x)
71{
72 x &= 0xFF;
73 dhex1int (x >> 4);
74 dhex1int (x);
75}
76
77void dhex4int (int x)
78{
79 x &= 0xFFFF;
80 dhex2int (x >> 8);
81 dhex2int (x & 0xFF);
82}
83
84void dhex8int (DWORD x)
85{
86 dhex4int ((int)(x >> 16));
87 dhex4int ((int)(x & 0xFFFF));
88 dputch (' ');
89}
90#endif /* __MSDOS__ */
91
copyrigh.h
misc.h
nochkstk.h
powerpak.h
wattcp.h
Core definitions.
x32vm.h


Watt-32 tcp/ip: E:/WATT/inc/sys/queue.h Source File

  • inc
  • sys
queue.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1991, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __SYS_QUEUE_H
39#define __SYS_QUEUE_H
40
41/*
42 * This file defines three types of data structures: lists, tail queues,
43 * and circular queues.
44 *
45 * A list is headed by a single forward pointer (or an array of forward
46 * pointers for a hash table header). The elements are doubly linked
47 * so that an arbitrary element can be removed without a need to
48 * traverse the list. New elements can be added to the list before
49 * or after an existing element or at the head of the list. A list
50 * may only be traversed in the forward direction.
51 *
52 * A tail queue is headed by a pair of pointers, one to the head of the
53 * list and the other to the tail of the list. The elements are doubly
54 * linked so that an arbitrary element can be removed without a need to
55 * traverse the list. New elements can be added to the list before or
56 * after an existing element, at the head of the list, or at the end of
57 * the list. A tail queue may only be traversed in the forward direction.
58 *
59 * A circle queue is headed by a pair of pointers, one to the head of the
60 * list and the other to the tail of the list. The elements are doubly
61 * linked so that an arbitrary element can be removed without a need to
62 * traverse the list. New elements can be added to the list before or after
63 * an existing element, at the head of the list, or at the end of the list.
64 * A circle queue may be traversed in either direction, but has a more
65 * complex end of list detection.
66 *
67 * For details on the use of these macros, see the queue(3) manual page.
68 */
69
70/*
71 * List definitions.
72 */
73#define LIST_HEAD(name, type) \
74 struct name { \
75 struct type *lh_first; /* first element */ \
76 }
77
78#define LIST_ENTRY(type) \
79 struct { \
80 struct type *le_next; /* next element */ \
81 struct type **le_prev; /* address of previous next element */ \
82 }
83
84/*
85 * List functions.
86 */
87#define LIST_INIT(head) { \
88 (head)->lh_first = NULL; \
89 }
90
91#define LIST_INSERT_AFTER(listelm, elm, field) { \
92 if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
93 (listelm)->field.le_next->field.le_prev = \
94 &(elm)->field.le_next; \
95 (listelm)->field.le_next = (elm); \
96 (elm)->field.le_prev = &(listelm)->field.le_next; \
97 }
98
99#define LIST_INSERT_BEFORE(listelm, elm, field) { \
100 (elm)->field.le_prev = (listelm)->field.le_prev; \
101 (elm)->field.le_next = (listelm); \
102 *(listelm)->field.le_prev = (elm); \
103 (listelm)->field.le_prev = &(elm)->field.le_next; \
104 }
105
106#define LIST_INSERT_HEAD(head, elm, field) { \
107 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
108 (head)->lh_first->field.le_prev = &(elm)->field.le_next; \
109 (head)->lh_first = (elm); \
110 (elm)->field.le_prev = &(head)->lh_first; \
111 }
112
113#define LIST_REMOVE(elm, field) { \
114 if ((elm)->field.le_next != NULL) \
115 (elm)->field.le_next->field.le_prev = \
116 (elm)->field.le_prev; \
117 *(elm)->field.le_prev = (elm)->field.le_next; \
118 }
119
120/*
121 * Tail queue definitions.
122 */
123#define TAILQ_HEAD(name, type) \
124 struct name { \
125 struct type *tqh_first; /* first element */ \
126 struct type **tqh_last; /* addr of last next element */ \
127 }
128
129#define TAILQ_ENTRY(type) \
130 struct { \
131 struct type *tqe_next; /* next element */ \
132 struct type **tqe_prev; /* address of previous next element */ \
133 }
134
135/*
136 * Tail queue functions.
137 */
138#define TAILQ_INIT(head) { \
139 (head)->tqh_first = NULL; \
140 (head)->tqh_last = &(head)->tqh_first; \
141 }
142
143#define TAILQ_INSERT_HEAD(head, elm, field) { \
144 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
145 (head)->tqh_first->field.tqe_prev = \
146 &(elm)->field.tqe_next; \
147 else \
148 (head)->tqh_last = &(elm)->field.tqe_next; \
149 (head)->tqh_first = (elm); \
150 (elm)->field.tqe_prev = &(head)->tqh_first; \
151 }
152
153#define TAILQ_INSERT_TAIL(head, elm, field) { \
154 (elm)->field.tqe_next = NULL; \
155 (elm)->field.tqe_prev = (head)->tqh_last; \
156 *(head)->tqh_last = (elm); \
157 (head)->tqh_last = &(elm)->field.tqe_next; \
158 }
159
160#define TAILQ_INSERT_AFTER(head, listelm, elm, field) { \
161 if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
162 (elm)->field.tqe_next->field.tqe_prev = \
163 &(elm)->field.tqe_next; \
164 else \
165 (head)->tqh_last = &(elm)->field.tqe_next; \
166 (listelm)->field.tqe_next = (elm); \
167 (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
168 }
169
170#define TAILQ_INSERT_BEFORE(listelm, elm, field) { \
171 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
172 (elm)->field.tqe_next = (listelm); \
173 *(listelm)->field.tqe_prev = (elm); \
174 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
175 }
176
177#define TAILQ_REMOVE(head, elm, field) { \
178 if (((elm)->field.tqe_next) != NULL) \
179 (elm)->field.tqe_next->field.tqe_prev = \
180 (elm)->field.tqe_prev; \
181 else \
182 (head)->tqh_last = (elm)->field.tqe_prev; \
183 *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
184 }
185
186/*
187 * Circular queue definitions.
188 */
189#define CIRCLEQ_HEAD(name, type) \
190 struct name { \
191 struct type *cqh_first; /* first element */ \
192 struct type *cqh_last; /* last element */ \
193 }
194
195#define CIRCLEQ_ENTRY(type) \
196 struct { \
197 struct type *cqe_next; /* next element */ \
198 struct type *cqe_prev; /* previous element */ \
199 }
200
201/*
202 * Circular queue functions.
203 */
204#define CIRCLEQ_INIT(head) { \
205 (head)->cqh_first = (void *)(head); \
206 (head)->cqh_last = (void *)(head); \
207 }
208
209#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) { \
210 (elm)->field.cqe_next = (listelm)->field.cqe_next; \
211 (elm)->field.cqe_prev = (listelm); \
212 if ((listelm)->field.cqe_next == (void *)(head)) \
213 (head)->cqh_last = (elm); \
214 else \
215 (listelm)->field.cqe_next->field.cqe_prev = (elm); \
216 (listelm)->field.cqe_next = (elm); \
217 }
218
219#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) { \
220 (elm)->field.cqe_next = (listelm); \
221 (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
222 if ((listelm)->field.cqe_prev == (void *)(head)) \
223 (head)->cqh_first = (elm); \
224 else \
225 (listelm)->field.cqe_prev->field.cqe_next = (elm); \
226 (listelm)->field.cqe_prev = (elm); \
227 }
228
229#define CIRCLEQ_INSERT_HEAD(head, elm, field) { \
230 (elm)->field.cqe_next = (head)->cqh_first; \
231 (elm)->field.cqe_prev = (void *)(head); \
232 if ((head)->cqh_last == (void *)(head)) \
233 (head)->cqh_last = (elm); \
234 else \
235 (head)->cqh_first->field.cqe_prev = (elm); \
236 (head)->cqh_first = (elm); \
237}
238
239#define CIRCLEQ_INSERT_TAIL(head, elm, field) { \
240 (elm)->field.cqe_next = (void *)(head); \
241 (elm)->field.cqe_prev = (head)->cqh_last; \
242 if ((head)->cqh_first == (void *)(head)) \
243 (head)->cqh_first = (elm); \
244 else \
245 (head)->cqh_last->field.cqe_next = (elm); \
246 (head)->cqh_last = (elm); \
247}
248
249#define CIRCLEQ_REMOVE(head, elm, field) { \
250 if ((elm)->field.cqe_next == (void *)(head)) \
251 (head)->cqh_last = (elm)->field.cqe_prev; \
252 else \
253 (elm)->field.cqe_next->field.cqe_prev = \
254 (elm)->field.cqe_prev; \
255 if ((elm)->field.cqe_prev == (void *)(head)) \
256 (head)->cqh_first = (elm)->field.cqe_next; \
257 else \
258 (elm)->field.cqe_prev->field.cqe_next = \
259 (elm)->field.cqe_next; \
260}
261#endif


Watt-32 tcp/ip: E:/WATT/inc/net/radix.h Source File

  • inc
  • net
radix.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1988, 1989, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef _NET_RADIX_H_
39#define _NET_RADIX_H_
40
41#ifndef __SYS_W32API_H
42#include <sys/w32api.h>
43#endif
44
45#ifndef __SYS_TYPES_H
46#include <sys/wtypes.h>
47#endif
48
49#ifndef __SYS_CDEFS_H
50#include <sys/cdefs.h>
51#endif
52
53__BEGIN_DECLS
54
55/*
56 * Radix search tree node layout.
57 */
58
59struct radix_node {
60 struct radix_mask *rn_mklist; /* list of masks contained in subtree */
61 struct radix_node *rn_p; /* parent */
62 short rn_b; /* bit offset; -1-index(netmask) */
63 char rn_bmask; /* node: mask for bit test*/
64 u_char rn_flags; /* enumerated next */
65#define RNF_NORMAL 1 /* leaf contains normal route */
66#define RNF_ROOT 2 /* leaf is root leaf for tree */
67#define RNF_ACTIVE 4 /* This node is alive (for rtfree) */
68 union {
69 struct { /* leaf only data: */
70 caddr_t rn_Key; /* object of search */
71 caddr_t rn_Mask; /* netmask, if present */
72 struct radix_node *rn_Dupedkey;
73 } rn_leaf;
74 struct { /* node only data: */
75 int rn_Off; /* where to start compare */
76 struct radix_node *rn_L; /* progeny */
77 struct radix_node *rn_R; /* progeny */
78 } rn_node;
79 } rn_u;
80#ifdef RN_DEBUG
81 int rn_info;
82 struct radix_node *rn_twin;
83 struct radix_node *rn_ybro;
84#endif
85 };
86
87#define rn_dupedkey rn_u.rn_leaf.rn_Dupedkey
88#define rn_key rn_u.rn_leaf.rn_Key
89#define rn_mask rn_u.rn_leaf.rn_Mask
90#define rn_off rn_u.rn_node.rn_Off
91#define rn_l rn_u.rn_node.rn_L
92#define rn_r rn_u.rn_node.rn_R
93
94/*
95 * Annotations to tree concerning potential routes applying to subtrees.
96 */
97struct radix_mask {
98 short rm_b; /* bit offset; -1-index(netmask) */
99 char rm_unused; /* cf. rn_bmask */
100 u_char rm_flags; /* cf. rn_flags */
101 struct radix_mask *rm_mklist; /* more masks to try */
102 union {
103 caddr_t rmu_mask; /* the mask */
104 struct radix_node *rmu_leaf; /* for normal routes */
105 } rm_rmu;
106 int rm_refs; /* # of references to this struct */
107 };
108
109W32_DATA struct radix_mask *rn_mkfreelist; /* not present */
110
111#define rm_mask rm_rmu.rmu_mask
112#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
113
114#define MKGet(m) do { \
115 if (rn_mkfreelist) { \
116 m = rn_mkfreelist; \
117 rn_mkfreelist = (m)->rm_mklist; \
118 } \
119 else \
120 R_Malloc (m, struct radix_mask *, sizeof(*(m))); \
121 } while (0)
122
123#define MKFree(m) { (m)->rm_mklist = rn_mkfreelist; rn_mkfreelist = (m);}
124
125struct radix_node_head {
126 struct radix_node *rnh_treetop;
127 int rnh_addrsize; /* permit, but not require fixed keys */
128 int rnh_pktsize; /* permit, but not require fixed keys */
129 struct radix_node *(*rnh_addaddr) /* add based on sockaddr */
130 (void *v, void *mask,
131 struct radix_node_head *head, struct radix_node nodes[]);
132 struct radix_node *(*rnh_addpkt) /* add based on packet hdr */
133 (void *v, void *mask,
134 struct radix_node_head *head, struct radix_node nodes[]);
135 struct radix_node *(*rnh_deladdr) /* remove based on sockaddr */
136 (void *v, void *mask, struct radix_node_head *head);
137 struct radix_node *(*rnh_delpkt) /* remove based on packet hdr */
138 (void *v, void *mask, struct radix_node_head *head);
139 struct radix_node *(*rnh_matchaddr) /* locate based on sockaddr */
140 (void *v, struct radix_node_head *head);
141 struct radix_node *(*rnh_lookup) /* locate based on sockaddr */
142 (void *v, void *mask, struct radix_node_head *head);
143 struct radix_node *(*rnh_matchpkt) /* locate based on packet hdr */
144 (void *v, struct radix_node_head *head);
145 int (*rnh_walktree) /* traverse tree */
146 (struct radix_node_head *,
147 int (*)(struct radix_node *, void *), void *);
148 struct radix_node rnh_nodes[3]; /* empty tree for common case */
149};
150
151
152#define Bcmp(a,b,n) memcmp (a,b,n)
153#define Bcopy(a,b,n) memcpy (b,a,n)
154#define Bzero(p,n) memset ((void*)(p),0,(int)(n));
155#define R_Malloc(p,t,n) (p = (t) malloc((unsigned int)(n)))
156#define Free(p) free ((void*)p);
157
158W32_FUNC void W32_CALL rn_init (void);
159W32_FUNC int W32_CALL rn_inithead (void **, int);
160W32_FUNC int W32_CALL rn_refines (void *, void *);
161W32_FUNC int W32_CALL rn_walktree (struct radix_node_head *,
162 int (W32_CALL *)(struct radix_node *, void *),
163 void *);
164
165W32_FUNC struct radix_node * W32_CALL rn_addroute (void *, void *, struct radix_node_head *, struct radix_node [2]);
166W32_FUNC struct radix_node * W32_CALL rn_insert (void *, struct radix_node_head *, int *, struct radix_node [2]);
167W32_FUNC struct radix_node * W32_CALL rn_newpair (void *, int, struct radix_node[2]);
168
169W32_FUNC struct radix_node * W32_CALL rn_addmask (void *, int, int);
170W32_FUNC struct radix_node * W32_CALL rn_delete (void *, void *, struct radix_node_head *);
171W32_FUNC struct radix_node * W32_CALL rn_lookup (void *, void *, struct radix_node_head *);
172W32_FUNC struct radix_node * W32_CALL rn_match (void *, struct radix_node_head *);
173W32_FUNC struct radix_node * W32_CALL rn_search (void *, struct radix_node *);
174W32_FUNC struct radix_node * W32_CALL rn_search_m (void *, struct radix_node *, void *);
175
176__END_DECLS
177
178#endif /* _NET_RADIX_H_ */
cdefs.h
radix_mask
Definition: radix.h:97
radix_node_head
Definition: radix.h:125
radix_node
Definition: radix.h:59
w32api.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/net/raw_cb.h Source File

  • inc
  • net
raw_cb.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1980, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NET_RAW_CB_H
39#define __NET_RAW_CB_H
40
41#include <sys/socket.h>
42#include <sys/queue.h>
43
44/*
45 * Raw protocol interface control block. Used
46 * to tie a socket to the generic raw interface.
47 */
48struct rawcb {
49 LIST_ENTRY(rawcb) rcb_list; /* doubly linked list */
50 struct socket *rcb_socket; /* back pointer to socket */
51 struct sockaddr *rcb_faddr; /* destination address */
52 struct sockaddr *rcb_laddr; /* socket's address */
53 struct sockproto rcb_proto; /* protocol family, protocol */
54};
55
56#define sotorawcb(so) ((struct rawcb *)(so)->so_pcb)
57
58/*
59 * Nominal space allocated to a raw socket.
60 */
61#define RAWSNDQ 8192
62#define RAWRCVQ 8192
63
64#endif
socket.h
queue.h
rawcb
Definition: raw_cb.h:48
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
sockproto
Definition: socket.h:190


Watt-32 tcp/ip: E:/WATT/inc/netinet6/raw_ip6.h Source File

  • inc
  • netinet6
raw_ip6.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 2001 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#ifndef _NETINET6_RAW_IP6_H_
34#define _NETINET6_RAW_IP6_H_
35
36/*
37 * ICMPv6 stat is counted separately. see netinet/icmp6.h
38 */
39struct rip6stat {
40 u_quad_t rip6s_ipackets; /* total input packets */
41 u_quad_t rip6s_isum; /* input checksum computations */
42 u_quad_t rip6s_badsum; /* of above, checksum error */
43 u_quad_t rip6s_nosock; /* no matching socket */
44 u_quad_t rip6s_nosockmcast; /* of above, arrived as multicast */
45 u_quad_t rip6s_fullsock; /* not delivered, input socket full */
46
47 u_quad_t rip6s_opackets; /* total output packets */
48};
49
50#ifdef _KERNEL
51extern struct rip6stat rip6stat;
52#endif
53
54#endif
rip6stat
Definition: raw_ip6.h:39


Watt-32 tcp/ip: E:/WATT/src/receive.c Source File

  • src
receive.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 * 0.6 : Aug 08, 2002 : G. Vanem - added AF_INET6 support
37 */
38
39
40#include "socket.h"
41
42#if defined(USE_BSD_API)
43
44static int tcp_receive (Socket *sock, void *buf, int len, int flags,
45 struct sockaddr *from, size_t *fromlen);
46
47static int udp_receive (Socket *sock, void *buf, int len, int flags,
48 struct sockaddr *from, size_t *fromlen);
49
50static int raw_receive (Socket *sock, void *buf, unsigned len, int flags,
51 struct sockaddr *from, size_t *fromlen);
52
53/*
54 * receive() flags:
55 * MSG_PEEK
56 * MSG_WAITALL
57 * MSG_OOB (not yet supported)
58 * MSG_DONTROUTE (not yet supported)
59 * MSG_EOR (not yet supported)
60 * MSG_TRUNC (not yet supported)
61 * MSG_CTRUNC (not yet supported)
62 *
63 * Only one flags bit is handled at a time.
64 */
65
66static int receive (const char *func, int s, void *buf, int len, int flags,
67 struct sockaddr *from, size_t *fromlen)
68{
69 Socket *socket = _socklist_find (s);
70 int ret = 0;
71
72 if (func)
73 SOCK_DEBUGF (("\n%s:%d", func, s));
74
75 if (!socket)
76 {
77 if (_sock_dos_fd(s))
78 {
79 SOCK_DEBUGF ((", ENOTSOCK"));
80 SOCK_ERRNO (ENOTSOCK);
81 return (-1);
82 }
83 SOCK_DEBUGF ((", EBADF"));
84 SOCK_ERRNO (EBADF);
85 return (-1);
86 }
87
88 VERIFY_RW (buf, len);
89
90 if (from && fromlen)
91 {
92 size_t sa_len = (socket->so_family == AF_INET6) ?
93 sizeof(struct sockaddr_in6) :
94 (socket->so_family == AF_PACKET) ?
95 sizeof(struct sockaddr_ll) :
96 sizeof(struct sockaddr_in);
97
98 if (*fromlen < sa_len)
99 {
100 SOCK_DEBUGF ((", EADDRNOTAVAIL (fromlen = %d, sa_len = %d)",
101 (int)*fromlen, (int)sa_len));
102 SOCK_ERRNO (EADDRNOTAVAIL);
103 return (-1);
104 }
105 VERIFY_RW (from, sa_len);
106 }
107
108 if (socket->so_state & SS_ISCONNECTING)
109 {
110 while (1)
111 {
112 tcp_tick (NULL);
113
114 if (!_sock_pending_connect (socket))
115 break;
116
117 if (socket->so_state & SS_NBIO)
118 {
119 SOCK_DEBUGF ((", EAGAIN"));
120 SOCK_ERRNO (EAGAIN);
121 return (-1);
122 }
123
124 if (socket->tcp_sock->usr_yield)
125 (*socket->tcp_sock->usr_yield) ();
126 else WATT_YIELD ();
127 }
128 }
129
130 if (socket->so_error != 0)
131 {
132 SOCK_DEBUGF ((", SO_ERROR: %s", short_strerror (socket->so_error)));
133 SOCK_ERRNO (socket->so_error);
134 socket->so_error = 0;
135 return (-1);
136 }
137
138 if (socket->so_state & SS_CONN_REFUSED)
139 {
140 SOCK_DEBUGF ((", ECONNREFUSED (1)"));
141 SOCK_ERRNO (ECONNREFUSED);
142 return (-1);
143 }
144
145 if (socket->so_state & SS_CANTRCVMORE)
146 {
147 SOCK_DEBUGF ((", EPIPE (can't recv more)"));
148 SOCK_ERRNO (EPIPE); /* !! was ENOTCONN */
149 return (-1);
150 }
151
152 if ((flags & MSG_PEEK) && (flags & MSG_WAITALL))
153 {
154 SOCK_DEBUGF ((", invalid PEEK+WAITALL flags"));
155 SOCK_ERRNO (EINVAL);
156 return (-1);
157 }
158
159 /* If application installs the same signal handlers we do, we must
160 * exit cracefully from below loops.
161 */
162 if (_sock_sig_setup() < 0)
163 {
164 SOCK_DEBUGF ((", EINTR"));
165 SOCK_ERRNO (EINTR);
166 return (-1);
167 }
168
169 switch (socket->so_type)
170 {
171 case SOCK_STREAM:
172 ret = tcp_receive (socket, buf, len, flags, from, fromlen);
173 SOCK_DEBUGF ((", len=%d", ret));
174 break;
175
176 case SOCK_DGRAM:
177 ret = udp_receive (socket, buf, len, flags, from, fromlen);
178 SOCK_DEBUGF ((", len=%d", ret));
179 break;
180
181 case SOCK_RAW:
182 ret = raw_receive (socket, buf, len, flags, from, fromlen);
183 SOCK_DEBUGF ((", len=%d", ret));
184 break;
185
186 case SOCK_PACKET:
187 /* give raw packets a chance to be polled first. */
188 tcp_tick (NULL);
189 ret = sock_packet_receive (socket, buf, len, from, fromlen);
190 SOCK_DEBUGF ((", len=%d", ret));
191 break;
192
193 default:
194 SOCK_DEBUGF ((", EPROTONOSUPPORT"));
195 SOCK_ERRNO (EPROTONOSUPPORT);
196 ret = -1;
197 break;
198 }
199 _sock_sig_restore();
200 return (ret);
201}
202
203/*
204 * recvfrom(): receive from socket 's'. Address (src-ip/port) is put
205 * in 'from' (if non-NULL)
206 */
207int W32_CALL recvfrom (int s, void *buf, int len, int flags,
208 struct sockaddr *from, socklen_t *fromlen)
209{
210 return receive ("recvfrom", s, buf, len, flags, from, (size_t*)fromlen);
211}
212
213/*
214 * recv(): receive data from socket 's'. Flags may be
215 * MSG_PEEK, MSG_OOB or MSG_WAITALL
216 * Normally used on SOCK_STREAM sockets.
217 */
218int W32_CALL recv (int s, void *buf, int len, int flags)
219{
220 return receive ("recv", s, buf, len, flags, NULL, NULL);
221}
222
223/*
224 * read_s(): As above but no flags.
225 */
226int W32_CALL read_s (int s, char *buf, int len)
227{
228 return receive ("read_s", s, buf, len, 0, NULL, NULL);
229}
230
231/*
232 * recvmsg(): read into a 'msg->msg_iov' vector.
233 * Loop for each element in the vector. If 'msg->msg_name'
234 * is non-NULL, fill in from-addr.
235 */
236int W32_CALL recvmsg (int s, struct msghdr *msg, int flags)
237{
238 struct iovec *iov;
239 int count = msg->msg_iovlen;
240 int i, bytes, len;
241 size_t max = 0;
242
243 SOCK_DEBUGF (("\nrecvmsg:%d, iovecs=%d", s, count));
244
245 iov = msg->msg_iov;
246 if (!iov)
247 {
248 SOCK_DEBUGF ((", EFAULT"));
249 SOCK_ERRNO (EFAULT);
250 return (-1);
251 }
252
253 for (i = 0; i < count; ++i)
254 {
255#if (DOSX)
256 if (!valid_addr(iov[i].iov_base, iov[i].iov_len))
257 {
258 SOCK_DEBUGF ((", EFAULT (iovec[%d] = %p/%lu)",
259 i, iov[i].iov_base, (unsigned long)iov[i].iov_len));
260 SOCK_ERRNO (EFAULT);
261 return (-1);
262 }
263#endif
264
265 if (iov[i].iov_len > (unsigned)INT_MAX)
266 {
267 SOCK_DEBUGF ((", EINVAL (iovec[%d]: len %lu > INT_MAX)",
268 i, (unsigned long)iov[i].iov_len));
269 SOCK_ERRNO (EINVAL);
270 return (-1);
271 }
272
273 max += iov[i].iov_len;
274 if (max > (unsigned)INT_MAX)
275 {
276 SOCK_DEBUGF ((", EINVAL (max > INT_MAX)"));
277 SOCK_ERRNO (EINVAL);
278 return (-1);
279 }
280 }
281
282 msg->msg_flags = flags;
283
284 for (i = bytes = 0; i < count; i++)
285 {
286 len = receive (NULL, s, iov[i].iov_base, iov[i].iov_len,
287 msg->msg_flags, (struct sockaddr*)msg->msg_name,
288 (size_t*)&msg->msg_namelen);
289 if (len < 0)
290 {
291 if (bytes == 0)
292 bytes = -1;
293 break;
294 }
295 bytes += len;
296 if ((unsigned)len != iov[i].iov_len) /* nothing more to read */
297 break;
298 }
299 SOCK_DEBUGF ((", total %d", bytes));
300 return (bytes);
301}
302
303/*
304 * readv_s(): Complementary of writev_s().
305 */
306int W32_CALL readv_s (int s, const struct iovec *vector, size_t count)
307{
308 int len, bytes = 0;
309 size_t i, max = 0;
310
311 SOCK_DEBUGF (("\nreadv_s:%d, iovecs=%lu", s, (u_long)count));
312
313 for (i = 0; i < count; ++i)
314 {
315#if (DOSX)
316 if (!valid_addr(vector[i].iov_base, vector[i].iov_len))
317 {
318 SOCK_DEBUGF ((", EFAULT (iovec[%lu] = %p/%lu)",
319 (unsigned long)i, vector[i].iov_base,
320 (unsigned long)vector[i].iov_len));
321 SOCK_ERRNO (EFAULT);
322 return (-1);
323 }
324#endif
325
326 if (vector[i].iov_len > (unsigned)INT_MAX)
327 {
328 SOCK_DEBUGF ((", EINVAL (iovec[%lu]: len %lu > INT_MAX)",
329 (unsigned long)i, (unsigned long)vector[i].iov_len));
330 SOCK_ERRNO (EINVAL);
331 return (-1);
332 }
333
334 max += vector[i].iov_len;
335 if (max > (unsigned)INT_MAX)
336 {
337 SOCK_DEBUGF ((", EINVAL (max > INT_MAX)"));
338 SOCK_ERRNO (EINVAL);
339 return (-1);
340 }
341 }
342
343 for (i = 0; i < count; i++)
344 {
345 len = receive (NULL, s, vector[i].iov_base, vector[i].iov_len,
346 0, NULL, NULL);
347 if (len < 0)
348 {
349 if (bytes == 0)
350 bytes = -1;
351 break;
352 }
353 bytes += len;
354 if ((unsigned)len != vector[i].iov_len) /* nothing more to read */
355 break;
356 }
357 SOCK_DEBUGF ((", total %d", bytes));
358 return (bytes);
359}
360
361/*
362 * Fill in packet's address in 'from' and length in 'fromlen'.
363 * Only used for UDP & Raw-IP. TCP have peer info in 'socket->remote_addr'.
364 */
365static void udp_raw_fill_from_ip4 (struct sockaddr *from, size_t *fromlen,
366 const struct in_addr *peer, WORD port)
367{
368 struct sockaddr_in *sa = (struct sockaddr_in*) from;
369
370 if (sa && fromlen && *fromlen >= sizeof(*sa))
371 {
372 memset (sa, 0, sizeof(*sa));
373 sa->sin_addr = *peer;
374 sa->sin_family = AF_INET;
375 sa->sin_port = port;
376 }
377 if (fromlen)
378 *fromlen = sizeof (*sa);
379}
380
381#if defined(USE_IPV6)
382static void udp_raw_fill_from_ip6 (struct sockaddr *from, size_t *fromlen,
383 const void *peer, WORD port)
384{
385 struct sockaddr_in6 *sa = (struct sockaddr_in6*) from;
386
387 if (sa && fromlen)
388 {
389 memset (sa, 0, sizeof(*sa));
390 memcpy (&sa->sin6_addr, peer, sizeof(sa->sin6_addr));
391 sa->sin6_family = AF_INET6;
392 sa->sin6_port = port;
393 }
394 if (fromlen)
395 *fromlen = sizeof (*sa);
396}
397#endif
398
399/*
400 * TCP receiver
401 */
402static int tcp_receive (Socket *socket, void *buf, int len, int flags,
403 struct sockaddr *from, size_t *fromlen)
404{
405 int ret = 0;
406 BOOL got_fin = FALSE; /* got FIN from peer */
407 DWORD timer = 0UL;
408 sock_type *sk = (sock_type*) socket->tcp_sock;
409
410 if (!from && !socket->local_addr)
411 {
412 SOCK_DEBUGF ((", no local_addr"));
413 SOCK_ERRNO (ENOTCONN);
414 return (-1);
415 }
416
417 if (flags & MSG_OOB)
418 {
419 SOCK_DEBUGF ((", no OOB-data"));
420 SOCK_ERRNO (EWOULDBLOCK);
421 return (-1);
422 }
423
424 if (socket->timeout && sock_inactive)
425 timer = set_timeout (1000 * socket->timeout);
426
427 while (1)
428 {
429 BOOL ok = (tcp_tick(sk) != 0);
430
431 tcp_Retransmitter (TRUE);
432
433 if (socket->so_state & SS_ISDISCONNECTING)
434 {
435 got_fin = TRUE; /* might not have got a FIN, but need to read */
436 goto read_it;
437 }
438
440#if 0
441 if ((socket-so_options & SO_OOBINLINE) && urgent_data(sk))
442 {
443 ret = urgent_data_read (sk, (BYTE*)buf, len);
444 break;
445 }
446#endif
447
448 /* Don't do this for a listening socket
449 */
450 if (!(socket->so_options & SO_ACCEPTCONN))
451 {
452 if ((sk->tcp.locflags & LF_GOT_FIN) && /* got FIN, no unACK data */
453 sk->tcp.rx_datalen == 0)
454 {
455 socket->so_state |= SS_ISDISCONNECTING; /* We may receive more */
456 socket->so_state &= ~SS_ISCONNECTED; /* no longer ESTAB state */
457 got_fin = TRUE;
458 SOCK_DEBUGF ((", got FIN"));
459 goto read_it;
460 }
461
462 if (!ok)
463 {
464 socket->so_state |= (SS_CANTRCVMORE | SS_ISDISCONNECTING);
465 socket->so_state &= ~SS_ISCONNECTED;
466 SOCK_DEBUGF ((", EPIPE"));
467 SOCK_ERRNO (EPIPE); /* !! was ENOTCONN */
468 return (-1);
469 }
470 }
471
472 if (sock_rbused(sk) > socket->recv_lowat)
473 {
474read_it:
475 if (flags & MSG_PEEK)
476 ret = sock_preread (sk, (BYTE*)buf, len);
477 else if (flags & MSG_WAITALL)
478 ret = sock_read (sk, (BYTE*)buf, len);
479 else ret = sock_fastread (sk, (BYTE*)buf, len);
480 break;
481 }
482
483 if (socket->so_error != 0)
484 {
485 SOCK_DEBUGF ((", SO_ERROR: %s", short_strerror (socket->so_error)));
486 SOCK_ERRNO (socket->so_error);
487 socket->so_error = 0;
488 return (-1);
489 }
490
491 if (socket->so_state & SS_NBIO)
492 {
493 SOCK_DEBUGF ((", EWOULDBLOCK"));
494 SOCK_ERRNO (EWOULDBLOCK);
495 return (-1);
496 }
497
498 if (chk_timeout(timer))
499 {
500 SOCK_DEBUGF ((", ETIMEDOUT"));
501 SOCK_ERRNO (ETIMEDOUT);
502 return (-1);
503 }
504
505 if (_sock_sig_pending())
506 {
507 SOCK_DEBUGF ((", EINTR"));
508 SOCK_ERRNO (EINTR);
509 return (-1);
510 }
511
512 if (sk->tcp.usr_yield)
513 (*sk->tcp.usr_yield)();
514 else WATT_YIELD();
515 }
516
517 if (ret > 0)
518 {
519 int sa_len = (socket->so_family == AF_INET6) ?
520 sizeof(struct sockaddr_in6) :
521 sizeof(struct sockaddr_in);
522 if (from)
523 memcpy (from, socket->remote_addr, sa_len);
524 if (fromlen)
525 *fromlen = sa_len;
526 socket->keepalive = 0UL; /* reset keep-alive timer */
527 }
528 else if (ret < 0)
529 {
530 if (got_fin) /* A FIN and -1 from sock_xread() maps to 0 */
531 ret = 0;
532 else /* else some buffer/socket error */
533 {
534 SOCK_DEBUGF ((", EIO"));
535 SOCK_ERRNO (EIO);
536 }
537 }
538 return (ret);
539}
540
541
542/*
543 * UDP receiver
544 */
545static int udp_receive (Socket *socket, void *buf, int len, int flags,
546 struct sockaddr *from, size_t *fromlen)
547{
548 int ret = 0;
549 DWORD timer = 0UL;
550
551 if (socket->timeout)
552 timer = set_timeout (1000 * socket->timeout);
553
555#if 0
556 /* If bind() not called, allow data from anybody on any port !!
557 */
558 if (from && !socket->local_addr)
559 {
560 struct sockaddr_in addr = { AF_INET, 0, { INADDR_ANY }};
561
562 socket->so_state |= SS_PRIV;
563
564 if (_UDP_listen (socket, addr.sin_addr, addr.sin_port) < 0)
565 return (-1);
566 }
567#endif
568
569 while (1)
570 {
571 sock_type *sk = (sock_type*) socket->udp_sock;
572 BOOL ok = (tcp_tick(sk) != 0);
573
574 WATT_YIELD();
575
576 if (socket->so_error == ECONNREFUSED ||
577 (sk->udp.locflags & LF_GOT_ICMP))
578 {
579 socket->so_state |= (SS_CANTRCVMORE | SS_CANTSENDMORE);
580 SOCK_DEBUGF ((", ECONNREFUSED"));
581 SOCK_ERRNO (ECONNREFUSED);
582 return (-1);
583 }
584
585 if (!ok)
586 {
587 socket->so_state |= (SS_CANTRCVMORE | SS_CANTSENDMORE);
588 SOCK_DEBUGF ((", EPIPE"));
589 SOCK_ERRNO (EPIPE); /* !! was ENOTCONN */
590 return (-1);
591 }
592
593 tcp_Retransmitter (TRUE);
594
595 /* If this socket is for broadcast (or is unbound), check the
596 * queue setup by sock_recv_init() (in _UDP_listen).
597 * Note: it is possible to receive 0-byte probe packets.
598 */
599 if (socket->so_family == AF_INET && (socket->so_state & SS_PRIV))
600 {
601 struct in_addr peer = { 0 };
602 sock_type *udp = (sock_type*)socket->udp_sock;
603 WORD port;
604
605 SOCK_ERRNO (0);
606 ret = sock_recv_from (udp, (DWORD*)&peer.s_addr, &port, buf, len,
607 (flags & MSG_PEEK) ? 1 : 0);
608
609 if (ret && _w32_errno != EBADF && peer.s_addr)
610 {
611 udp_raw_fill_from_ip4 (from, fromlen, &peer, port);
612 SOCK_DEBUGF ((", 1: remote: %s (%d)", inet_ntoa(peer), ntohs(port)));
613
614 if (ret < 0) /* 0-byte probe */
615 return (0);
616 return (ret);
617 }
618 }
619
620#if defined(USE_IPV6)
621 else if (socket->so_family == AF_INET6 && (socket->so_state & SS_PRIV))
622 {
623 struct in6_addr peer;
624 sock_type *udp = (sock_type*) socket->udp_sock;
625 WORD port;
626
627 SOCK_ERRNO (0);
628 memcpy (&peer, &in6addr_any, sizeof(peer));
629 ret = sock_recv_from (udp, (DWORD*)&peer, &port, buf, len,
630 (flags & MSG_PEEK) ? 1 : 0);
631
632 if (ret && _w32_errno != EBADF && !IN6_IS_ADDR_UNSPECIFIED(&peer))
633 {
634 udp_raw_fill_from_ip6 (from, fromlen, &peer, port);
635 SOCK_DEBUGF ((", 1: remote: %s (%d)", _inet6_ntoa(&peer), ntohs(port)));
636
637 if (ret < 0) /* 0-byte probe */
638 return (0);
639 return (ret);
640 }
641 }
642#endif
643
644 else if (sock_rbused(sk) > socket->recv_lowat)
645 {
646 if (flags & MSG_PEEK)
647 ret = sock_preread (sk, (BYTE*)buf, len);
648 else if (flags & MSG_WAITALL)
649 ret = sock_read (sk, (BYTE*)buf, len);
650 else ret = sock_fastread (sk, (BYTE*)buf, len);
651 break;
652 }
653
654 if (socket->so_error != 0)
655 {
656 SOCK_DEBUGF ((", SO_ERROR: %s", short_strerror (socket->so_error)));
657 SOCK_ERRNO (socket->so_error);
658 socket->so_error = 0;
659 return (-1);
660 }
661
662 if (socket->so_state & SS_NBIO)
663 {
664 SOCK_DEBUGF ((", EWOULDBLOCK"));
665 SOCK_ERRNO (EWOULDBLOCK);
666 return (-1);
667 }
668
669 if (chk_timeout(timer))
670 {
671 SOCK_DEBUGF ((", ETIMEDOUT"));
672 SOCK_ERRNO (ETIMEDOUT);
673 return (-1);
674 }
675
676 if (_sock_sig_pending())
677 {
678 SOCK_DEBUGF ((", EINTR"));
679 SOCK_ERRNO (EINTR);
680 return (-1);
681 }
682 }
683
684 if (ret > 0)
685 {
686#if defined(USE_IPV6)
687 if (socket->so_family == AF_INET6)
688 {
689 WORD port = htons (socket->udp_sock->hisport);
690 const void *peer = &socket->udp_sock->his6addr[0];
691
692 udp_raw_fill_from_ip6 (from, fromlen, peer, port);
693
694 if (socket->remote_addr)
695 {
696 struct sockaddr_in6 *ra = (struct sockaddr_in6*)socket->remote_addr;
697
698 ra->sin6_family = AF_INET6;
699 ra->sin6_port = port;
700 memcpy (&ra->sin6_addr, peer, sizeof(ra->sin6_addr));
701 }
702 SOCK_DEBUGF ((", 2: remote: %s (%d)", _inet6_ntoa(peer), ntohs(port)));
703 }
704 else
705#endif
706 {
707 struct in_addr peer;
708 _udp_Socket *udp = socket->udp_sock;
709 WORD port;
710
711 port = htons (udp->hisport);
712 peer.s_addr = htonl (udp->hisaddr);
713
714 udp_raw_fill_from_ip4 (from, fromlen, &peer, port);
715
716 if (socket->remote_addr)
717 {
718 socket->remote_addr->sin_family = AF_INET;
719 socket->remote_addr->sin_addr = peer;
720 socket->remote_addr->sin_port = port;
721 }
722 SOCK_DEBUGF ((", 2: remote: %s (%d)", inet_ntoa(peer), ntohs(port)));
723 }
724 }
725 return (ret);
726}
727
728
729/*
730 * Raw-IP receiver. Doesn't handle IP-options yet.
731 */
732static int raw_receive (Socket *socket, void *buf, unsigned len, int flags,
733 struct sockaddr *from, size_t *fromlen)
734{
735 _raw_Socket *raw = NULL;
736 DWORD timer, loop;
737
738#if defined(USE_IPV6)
739 _raw6_Socket *raw6 = NULL;
740
741 if (socket->so_family == AF_INET6)
742 {
743 if (len < sizeof(raw6->ip6))
744 {
745 SOCK_DEBUGF (("EINVAL"));
746 SOCK_ERRNO (EINVAL);
747 return (-1);
748 }
749 }
750 else
751#endif
752 if (len < sizeof(raw->ip))
753 {
754 SOCK_DEBUGF (("EINVAL"));
755 SOCK_ERRNO (EINVAL);
756 return (-1);
757 }
758
759 if (socket->timeout)
760 timer = set_timeout (1000 * socket->timeout);
761 else timer = 0;
762 loop = 1;
763
764 while (1)
765 {
766 unsigned ip_len, hdr_len;
767
768 /* give sock_rbused() and memcpy() below a chance to run
769 * before sock_raw_recv() (via tcp_tick) drops a packet
770 */
771 if (loop++ > 1)
772 {
773 tcp_tick (NULL);
774 tcp_Retransmitter (TRUE);
775 }
776
777#if defined(USE_IPV6)
778 if (socket->so_family == AF_INET6)
779 {
780 raw6 = (_raw6_Socket*) find_oldest_raw6 (socket->raw6_sock);
781 ip_len = raw6 ? intel16 (raw6->ip6.len) : 0;
782 hdr_len = sizeof(in6_Header);
783 }
784 else
785#endif
786 {
787 raw = (_raw_Socket*) find_oldest_raw (socket->raw_sock);
788 ip_len = raw ? intel16 (raw->ip.length) : 0; /* includes header length */
789 hdr_len = sizeof(in_Header);
790 }
791
792#if defined(USE_IPV6)
793 if (socket->so_family == AF_INET6)
794 {
795 if (ip_len >= hdr_len + socket->recv_lowat)
796 {
797 struct in6_Header *ip6 = (struct in6_Header*) buf;
798
799 /* SOCK_RAW shall always return IP-header and data in 'buf'
800 */
801 memcpy (ip6, &raw6->ip6, hdr_len);
802 len = min (ip_len - hdr_len, len);
803 if (len > 0)
804 memcpy (++ip6, &raw6->rx_data[0], len);
805
806 raw6->used = FALSE;
807
808 udp_raw_fill_from_ip6 (from, fromlen, &raw6->ip6.source[0], 0);
809 SOCK_DEBUGF ((", remote: %s", _inet6_ntoa(&raw6->ip6.source[0])));
810 return (len + hdr_len);
811 }
812 }
813 else
814#endif
815 if (ip_len >= hdr_len + socket->recv_lowat)
816 {
817 struct in_addr peer;
818 struct in_Header *ip = (struct in_Header*) buf;
819
820 /* SOCK_RAW shall always return IP-header and data in 'buf'
821 */
822 memcpy (ip, &raw->ip, min(hdr_len,len)); /* first, copy the IP-header */
823 len = min (ip_len - hdr_len, len);
824 if (len > 0)
825 memcpy (++ip, &raw->rx_data[0], len); /* copy the rest. max 666000 bytes */
826
827 peer.s_addr = raw->ip.source;
828 raw->used = FALSE;
829
830 udp_raw_fill_from_ip4 (from, fromlen, &peer, 0);
831 SOCK_DEBUGF ((", remote: %s", inet_ntoa(peer)));
832 return (len + hdr_len);
833 }
834
835 if (socket->so_state & SS_NBIO)
836 {
837 SOCK_DEBUGF ((", EWOULDBLOCK"));
838 SOCK_ERRNO (EWOULDBLOCK);
839 break;
840 }
841
842 if (chk_timeout(timer))
843 {
844 SOCK_DEBUGF ((", ETIMEDOUT"));
845 SOCK_ERRNO (ETIMEDOUT);
846 break;
847 }
848
849 if (_sock_sig_pending())
850 {
851 SOCK_DEBUGF ((", EINTR"));
852 SOCK_ERRNO (EINTR);
853 break;
854 }
855
856 WATT_YIELD();
857 }
858
859 ARGSUSED (flags);
860 return (-1);
861}
862#endif /* USE_BSD_API */
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
tcp_Retransmitter
void tcp_Retransmitter(BOOL force)
Called periodically to perform retransmissions.
Definition: pctcp.c:1218
udp_receive
static int udp_receive(Socket *sock, void *buf, int len, int flags, struct sockaddr *from, size_t *fromlen)
Definition: receive.c:545
tcp_receive
static int tcp_receive(Socket *sock, void *buf, int len, int flags, struct sockaddr *from, size_t *fromlen)
Definition: receive.c:402
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
_sock_pending_connect
BOOL _sock_pending_connect(Socket *socket)
Check progress on a non-blocking SOCK_STREAM socket that has SS_ISCONNECTING set.
Definition: socket.c:2186
sock_packet_receive
unsigned sock_packet_receive(Socket *sock, void *buf, unsigned len, struct sockaddr *from, size_t *fromlen)
Called from receive.c for AF_PACKET sockets.
Definition: socket.c:582
_sock_dos_fd
BOOL _sock_dos_fd(int s)
_sock_dos_fd - Return TRUE if ‘s’ is a valid DOS/Win32 handle.
Definition: socket.c:202
_raw6_Socket
Definition: wattcp.h:679
_raw_Socket
Definition: wattcp.h:665
_raw_Socket::used
BOOL used
used flag; packet not read yet
Definition: wattcp.h:668
_raw_Socket::rx_data
BYTE rx_data[MAX_FRAG_SIZE]
room for 1 jumbo IP packet
Definition: wattcp.h:671
Socket
Definition: socket.h:158
in6_Header
Definition: wattcp.h:381
in6_addr
Definition: in.h:151
in_Header
Definition: wattcp.h:329
in_addr
Definition: in.h:143
iovec
Definition: wtypes.h:222
msghdr
Definition: socket.h:258
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
sockaddr_ll
Definition: if_packe.h:16
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/src/register.h Source File

  • src
register.h
Go to the documentation of this file.
1
14#ifndef _w32_REGISTER_H
15#define _w32_REGISTER_H
16
17/*
18 * Definition related to EFLAGS.
19 */
20#define EFLAGS_CARRY 0x1
21#define EFLAGS_PARITY 0x4
22
23#define EFLAGS_AUX_CARRY 0x10
24#define EFLAGS_ZERO 0x40
25#define EFLAGS_SIGN 0x80
26
27#define EFLAGS_TRAP 0x100
28#define EFLAGS_INTR_ENABLE 0x200
29#define EFLAGS_DIRECTION 0x400
30#define EFLAGS_OVERFLOW 0x800
31
32#define EFLAGS_IOPL_MASK 0x3000
33#define EFLAGS_NESTED_TASK 0x8000
34
35#define EFLAGS_RESUME 0x10000
36#define EFLAGS_VIRTUAL_MODE 0x20000
37#define EFLAGS_ALIGN_CHECK 0x40000
38#define EFLAGS_VIRTUAL_INTR 0x80000
39
40#define EFLAGS_VIRTUAL_INTR_PEND 0x100000
41#define EFLAGS_ID 0x200000
42
43/*
44 * Definitions related to CR0.
45 */
46#define CR0_PROTECTION_ENABLE 0x1
47#define CR0_MONITOR_COPROC 0x2
48#define CR0_COPROC_SOFT_EMUL 0x4
49#define CR0_FLOATING_INSTR_EXCEPTION 0x8
50
51#define CR0_EXTENSION_TYPE 0x10
52#define CR0_NUMERIC_ERROR 0x20
53
54#define CR0_WRITE_PROTECT 0x10000
55#define CR0_ALIGMENT_MASK 0x40000
56
57#define CR0_NO_WRITE_THROUGH 0x20000000
58#define CR0_PAGE_LEVEL_CACHE_DISABLE 0x40000000
59#define CR0_PAGING 0x80000000
60
61#if defined(IN_ASM_FILE) /* Only set in .S-files used by GCC */
62 #if defined(__DJGPP__)
63 #include <machine/asm.h>
64
65 /* Use only after ".data" */
66 #define DATA(x,type) .align 2; .globl _##x; _##x: type
67
68 #elif defined(__CYGWIN__) && defined(__x86_64__)
69 #define ENTRY(f) .globl f; f:
70 #define DATA(x,type) .globl x; x: type
71 #define _C_LABEL(x) x
72
73 #elif defined(__x86_64__)
74 #define ENTRY(f) .text; .p2align 8,,15; .globl f; f:
75 #define DATA(x,type) .align 8; .globl x; x: type
76 #define _C_LABEL(x) x
77
78 #else /* 32-bit GNU assembler */
79 #define ENTRY(f) .text; .p2align 4,,15; .globl _##f; _##f:
80 #define DATA(x,type) .align 4; .globl _##x; _##x: type
81 #define _C_LABEL(x) _##x
82 #endif
83
84#else
85
86 /*
87 * Definition of eflags registers has a bit field structure.
88 */
89 typedef struct {
90 /*
91 * first byte : bits 0->7
92 */
93 unsigned int carry : 1;
94 unsigned int : 1;
95 unsigned int parity : 1;
96 unsigned int : 1;
97
98 unsigned int auxiliary_carry : 1;
99 unsigned int : 1;
100 unsigned int zero : 1; /* result is zero */
101 unsigned int sign : 1; /* result is less than zero */
102 /*
103 * Second byte : bits 7->15
104 */
105 unsigned int trap : 1;
106 unsigned int intr_enable : 1; /* set => intr on */
107 unsigned int direction : 1; /* set => autodecrement */
108 unsigned int overflow : 1;
109
110 unsigned int IO_privilege : 2;
111 unsigned int nested_task : 1;
112 unsigned int : 1;
113 /*
114 * Third byte : bits 15->23
115 */
116 unsigned int resume : 1;
117 unsigned int virtual_mode : 1;
118 unsigned int aligment_check : 1;
119 unsigned int virtual_intr : 1;
120 unsigned int virtual_intr_pending : 1;
121 unsigned int id : 1;
122 unsigned int : 2;
123 /*
124 * fourth byte : bits 24->31 : UNUSED
125 */
126 unsigned int : 8;
127 } eflags_bits;
128
129 typedef union {
130 eflags_bits eflags;
131 unsigned int i;
132 } eflags;
133
134 /*
135 * Definition of CR registers has a bit field structure.
136 */
137 typedef struct {
138 /*
139 * first byte : bits 0->7
140 */
141 unsigned int protection_enable : 1;
142 unsigned int monitor_coproc : 1;
143 unsigned int coproc_soft_emul : 1;
144 unsigned int floating_instr_except : 1;
145
146 unsigned int extension_type : 1;
147 unsigned int numeric_error : 1;
148 unsigned int : 2;
149 /*
150 * second byte 8->15 : UNUSED
151 */
152 unsigned int : 8;
153 /*
154 * third byte 16->23
155 */
156 unsigned int write_protect : 1;
157 unsigned int : 1;
158 unsigned int aligment_mask : 1;
159 unsigned int : 1;
160
161 unsigned int : 4;
162 /*
163 * fourth byte 24->31
164 */
165 unsigned int : 4;
166 unsigned int : 1;
167 unsigned int no_write_through : 1;
168 unsigned int page_level_cache_disable : 1;
169 unsigned int paging : 1;
170 } cr0_bits;
171
172 typedef union {
173 cr0_bits cr0;
174 unsigned long i;
175 } cr0;
176
177#endif /* IN_ASM_FILE */
178
179#endif
180
cr0_bits
Definition: register.h:137
eflags_bits
Definition: register.h:89
cr0
Definition: register.h:172
eflags
Definition: register.h:129


Watt-32 tcp/ip: E:/WATT/src/res_comp.c Source File

  • src
res_comp.c
Go to the documentation of this file.
1
5/* ++Copyright++ 1985, 1993
6 * -
7 * Copyright (c) 1985, 1993
8 * The Regents of the University of California. All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 * -
38 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
39 *
40 * Permission to use, copy, modify, and distribute this software for any
41 * purpose with or without fee is hereby granted, provided that the above
42 * copyright notice and this permission notice appear in all copies, and that
43 * the name of Digital Equipment Corporation not be used in advertising or
44 * publicity pertaining to distribution of the document or software without
45 * specific, written prior permission.
46 *
47 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
48 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
50 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
51 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
52 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
53 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
54 * SOFTWARE.
55 * -
56 * --Copyright--
57 */
58
59#include "resolver.h"
60
61#if defined(USE_BIND)
62
63static int mklower (int);
64static int dn_find (u_char *, u_char *, u_char **, u_char **);
65
66/*
67 * Expand compressed domain name 'comp_dn' to full domain name.
68 * 'msg' is a pointer to the begining of the message,
69 * 'eom_orig' points to the first location after the message,
70 * 'exp_dn' is a pointer to a buffer of size 'length' for the result.
71 * Return size of compressed name or -1 if there was an error.
72 */
73int W32_CALL dn_expand (const u_char *msg, const u_char *eom_orig,
74 const u_char *comp_dn, char *exp_dn, int length)
75{
76 const u_char *cp;
77 char *dn, *eom;
78 int n, len = -1, checked = 0;
79
80 dn = exp_dn;
81 cp = comp_dn;
82 eom = exp_dn + length;
83
84 /* Fetch next label in domain name
85 */
86 while ((n = *cp++) != 0)
87 {
88 /* Check for indirection
89 */
90 switch (n & INDIR_MASK)
91 {
92 case 0:
93 if (dn != exp_dn)
94 {
95 if (dn >= eom)
96 return (-1);
97 *dn++ = '.';
98 }
99 if (dn+n >= eom)
100 return (-1);
101 checked += n + 1;
102 while (--n >= 0)
103 {
104 int c = *cp++;
105 if ((c == '.') || (c == '\\'))
106 {
107 if (dn + n + 2 >= eom)
108 return (-1);
109 *dn++ = '\\';
110 }
111 *dn++ = c;
112 if (cp >= eom_orig) /* out of range */
113 return (-1);
114 }
115 break;
116
117 case INDIR_MASK:
118 if (len < 0)
119 len = cp - comp_dn + 1;
120 cp = msg + (((n & 0x3f) << 8) | (*cp & 0xff));
121 if (cp < msg || cp >= eom_orig) /* out of range */
122 return (-1);
123 checked += 2;
124 /*
125 * Check for loops in the compressed name;
126 * if we've looked at the whole message,
127 * there must be a loop.
128 */
129 if (checked >= eom_orig - msg)
130 return (-1);
131 break;
132
133 default:
134 return (-1); /* flag error */
135 }
136 }
137
138 *dn = '\0';
139 {
140 int c;
141 for (dn = exp_dn; (c = *dn) != '\0'; dn++)
142 if (isascii(c) && isspace(c))
143 return (-1);
144 }
145
146 if (len < 0)
147 len = cp - comp_dn;
148 return (len);
149}
150
151/*
152 * Compress domain name 'exp_dn' into 'comp_dn'.
153 * Return the size of the compressed name or -1.
154 * 'length' is the size of the array pointed to by 'comp_dn'.
155 * 'dnptrs' is a list of pointers to previous compressed names. dnptrs[0]
156 * is a pointer to the beginning of the message. The list ends with NULL.
157 * 'lastdnptr' is a pointer to the end of the arrary pointed to
158 * by 'dnptrs'. Side effect is to update the list of pointers for
159 * labels inserted into the message as we compress the name.
160 * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
161 * is NULL, we don't update the list.
162 */
163int W32_CALL dn_comp (const char *exp_dn, u_char *comp_dn, int length,
164 u_char **dnptrs, u_char **lastdnptr)
165{
166 u_char *cp, *dn;
167 u_char **cpp, **lpp, *eob;
168 u_char *msg;
169 u_char *sp = NULL;
170 int c, l = 0;
171
172 dn = (u_char *)exp_dn;
173 cp = comp_dn;
174 eob = cp + length;
175 lpp = cpp = NULL;
176 if (dnptrs)
177 {
178 if ((msg = *dnptrs++) != NULL)
179 {
180 for (cpp = dnptrs; *cpp; cpp++)
181 ;
182 lpp = cpp; /* end of list to search */
183 }
184 }
185 else
186 msg = NULL;
187
188 for (c = *dn++; c != '\0'; )
189 {
190 /* look to see if we can use pointers */
191 if (msg)
192 {
193 if ((l = dn_find (dn-1, msg, dnptrs, lpp)) >= 0)
194 {
195 if (cp+1 >= eob)
196 return (-1);
197 *cp++ = (l >> 8) | INDIR_MASK;
198 *cp++ = l % 256;
199 return (cp - comp_dn);
200 }
201 /* not found, save it */
202 if (lastdnptr && cpp < lastdnptr-1)
203 {
204 *cpp++ = cp;
205 *cpp = NULL;
206 }
207 }
208 sp = cp++; /* save ptr to length byte */
209 do
210 {
211 if (c == '.')
212 {
213 c = *dn++;
214 break;
215 }
216 if (c == '\\')
217 {
218 if ((c = *dn++) == '\0')
219 break;
220 }
221 if (cp >= eob)
222 {
223 if (msg)
224 *lpp = NULL;
225 return (-1);
226 }
227 *cp++ = c;
228 }
229 while ((c = *dn++) != '\0');
230
231 /* catch trailing '.'s but not '..' */
232 if ((l = cp - sp - 1) == 0 && c == '\0')
233 {
234 cp--;
235 break;
236 }
237 if (l <= 0 || l > MAXLABEL)
238 {
239 if (msg)
240 *lpp = NULL;
241 return (-1);
242 }
243 *sp = l;
244 }
245 if (cp >= eob)
246 {
247 if (msg)
248 *lpp = NULL;
249 return (-1);
250 }
251 *cp++ = '\0';
252 return (cp - comp_dn);
253}
254
255/*
256 * Skip over a compressed domain name. Return the size or -1.
257 */
258int W32_CALL __dn_skipname (const u_char *comp_dn, const u_char *eom)
259{
260 const u_char *cp = comp_dn;
261
262 while (cp < eom)
263 {
264 int n = *cp++;
265 if (!n)
266 break;
267
268 /* check for indirection
269 */
270 switch (n & INDIR_MASK)
271 {
272 case 0: /* normal case, n == len */
273 cp += n;
274 continue;
275 case INDIR_MASK: /* indirection */
276 cp++;
277 break;
278 default: /* illegal type */
279 return (-1);
280 }
281 break;
282 }
283 if (cp > eom)
284 return (-1);
285 return (cp - comp_dn);
286}
287
288
289static int mklower (int ch)
290{
291 if (isascii(ch) && isupper(ch))
292 return (tolower(ch));
293 return (ch);
294}
295
296/*
297 * Search for expanded name from a list of previously compressed names.
298 * Return the offset from msg if found or -1.
299 * dnptrs is the pointer to the first name on the list,
300 * not the pointer to the start of the message.
301 */
302static int dn_find (u_char *exp_dn, u_char *msg, u_char **dnptrs, u_char **lastdnptr)
303{
304 u_char **cpp;
305
306 for (cpp = dnptrs; cpp < lastdnptr; cpp++)
307 {
308 u_char *dn = exp_dn;
309 u_char *sp = *cpp;
310 u_char *cp = *cpp;
311 int n;
312
313 while ((n = *cp++) != 0)
314 {
315 /*
316 * check for indirection
317 */
318 switch (n & INDIR_MASK)
319 {
320 case 0: /* normal case, n == len */
321 while (--n >= 0)
322 {
323 if (*dn == '.')
324 goto next;
325 if (*dn == '\\')
326 dn++;
327 if (mklower(*dn++) != mklower(*cp++))
328 goto next;
329 }
330 if ((n = *dn++) == '\0' && *cp == '\0')
331 return (sp - msg);
332 if (n == '.')
333 continue;
334 goto next;
335
336 case INDIR_MASK: /* indirection */
337 cp = msg + (((n & 0x3f) << 8) | *cp);
338 break;
339
340 default: /* illegal type */
341 return (-1);
342 }
343 }
344 if (*dn == '\0')
345 return (sp - msg);
346 next: ;
347 }
348 return (-1);
349}
350#endif /* USE_BIND */
351
resolver.h


Watt-32 tcp/ip: E:/WATT/src/res_data.c Source File

  • src
res_data.c
Go to the documentation of this file.
1
5/* ++Copyright++ 1995
6 * -
7 * Copyright (c) 1995
8 * The Regents of the University of California. All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 * -
38 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
39 *
40 * Permission to use, copy, modify, and distribute this software for any
41 * purpose with or without fee is hereby granted, provided that the above
42 * copyright notice and this permission notice appear in all copies, and that
43 * the name of Digital Equipment Corporation not be used in advertising or
44 * publicity pertaining to distribution of the document or software without
45 * specific, written prior permission.
46 *
47 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
48 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
50 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
51 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
52 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
53 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
54 * SOFTWARE.
55 * -
56 * --Copyright--
57 */
58
59#include "resolver.h"
60
61#if defined(USE_BSD_API) || defined(USE_BIND)
62
63const char *_res_opcodes[] = {
64 "QUERY",
65 "IQUERY",
66 "CQUERYM",
67 "CQUERYU", /* experimental */
68 "NOTIFY", /* experimental */
69 "5",
70 "6",
71 "7",
72 "8",
73 "UPDATEA",
74 "UPDATED",
75 "UPDATEDA",
76 "UPDATEM",
77 "UPDATEMA",
78 "ZONEINIT",
79 "ZONEREF"
80 };
81
82const char *_res_resultcodes[] = {
83 "NOERROR",
84 "FORMERR",
85 "SERVFAIL",
86 "NXDOMAIN",
87 "NOTIMP",
88 "REFUSED",
89 "6",
90 "7",
91 "8",
92 "9",
93 "10",
94 "11",
95 "12",
96 "13",
97 "14",
98 "NOCHANGE"
99 };
100
101const char *h_errlist[] = {
102 "Error 0", /* 0 NETDB_SUCCESS */
103 "Unknown host", /* 1 HOST_NOT_FOUND */
104 "Host name lookup failure", /* 2 TRY_AGAIN */
105 "Unknown server error", /* 3 NO_RECOVERY */
106 "No address associated with name", /* 4 NO_ADDRESS / NO_DATA */
107 };
108
109int h_nerr = DIM (h_errlist);
110
111/*
112 * herror --
113 * print the error indicated by the h_errno value.
114 */
115void W32_CALL herror (const char *prefix)
116{
117 if (prefix && *prefix)
118 fprintf (stderr, "%s :", prefix);
119
120 fputs (hstrerror(h_errno), stderr);
121
122#ifdef __DJGPP__
123 fputc ('\n', stderr); /* only djgpp(?) use newline, ref. perror() */
124#endif
125}
126
127const char * W32_CALL hstrerror (int err)
128{
129 if (err < 0)
130 return ("Resolver internal error");
131 if (err < h_nerr)
132 return (h_errlist[err]);
133 return ("Unknown resolver error");
134}
135#endif /* USE_BSD_API || USE_BIND */
136
resolver.h


Watt-32 tcp/ip: E:/WATT/src/res_debu.c Source File

  • src
res_debu.c
Go to the documentation of this file.
1
5/* ++Copyright++ 1985, 1990, 1993
6 * -
7 * Copyright (c) 1985, 1990, 1993
8 * The Regents of the University of California. All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 * -
38 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
39 *
40 * Permission to use, copy, modify, and distribute this software for any
41 * purpose with or without fee is hereby granted, provided that the above
42 * copyright notice and this permission notice appear in all copies, and that
43 * the name of Digital Equipment Corporation not be used in advertising or
44 * publicity pertaining to distribution of the document or software without
45 * specific, written prior permission.
46 *
47 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
48 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
50 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
51 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
52 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
53 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
54 * SOFTWARE.
55 * -
56 * --Copyright--
57 */
58
59#include "resolver.h"
60
61#if defined(USE_BIND)
62
63static const char *dewks (int wks)
64{
65 static char buf[20];
66
67 switch (wks)
68 {
69 case 5: return "rje";
70 case 7: return "echo";
71 case 9: return "discard";
72 case 11: return "systat";
73 case 13: return "daytime";
74 case 15: return "netstat";
75 case 17: return "qotd";
76 case 19: return "chargen";
77 case 20: return "ftp-data";
78 case 21: return "ftp";
79 case 23: return "telnet";
80 case 25: return "smtp";
81 case 37: return "time";
82 case 39: return "rlp";
83 case 42: return "name";
84 case 43: return "whois";
85 case 53: return "domain";
86 case 57: return "apts";
87 case 59: return "apfs";
88 case 67: return "bootps";
89 case 68: return "bootpc";
90 case 69: return "tftp";
91 case 77: return "rje";
92 case 79: return "finger";
93 case 87: return "link";
94 case 95: return "supdup";
95 case 100: return "newacct";
96 case 101: return "hostnames";
97 case 102: return "iso-tsap";
98 case 103: return "x400";
99 case 104: return "x400-snd";
100 case 105: return "csnet-ns";
101 case 109: return "pop-2";
102 case 111: return "sunrpc";
103 case 113: return "auth";
104 case 115: return "sftp";
105 case 117: return "uucp-path";
106 case 119: return "nntp";
107 case 121: return "erpc";
108 case 123: return "ntp";
109 case 133: return "statsrv";
110 case 136: return "profile";
111 case 144: return "NeWS";
112 case 161: return "snmp";
113 case 162: return "snmp-trap";
114 case 170: return "print-srv";
115 }
116 return itoa (wks, buf, 10);
117}
118
119static const char *deproto (int protonum)
120{
121 static char buf[20];
122
123 switch (protonum)
124 {
125 case 1: return "icmp";
126 case 2: return "igmp";
127 case 3: return "ggp";
128 case 5: return "st";
129 case 6: return "tcp";
130 case 7: return "ucl";
131 case 8: return "egp";
132 case 9: return "igp";
133 case 11: return "nvp-II";
134 case 12: return "pup";
135 case 16: return "chaos";
136 case 17: return "udp";
137 }
138 return itoa (protonum, buf, 10);
139}
140
141static const u_char *do_rrset (const u_char *msg, int len, const u_char *cp,
142 int cnt, int pflag, FILE *file, const char *hs)
143{
144 int n, sflag;
145
146 /* Print answer records.
147 */
148 sflag = (_res.pfcode & pflag);
149 if ((n = ntohs(cnt)) != 0)
150 {
151 if (!_res.pfcode || (sflag && (_res.pfcode & RES_PRF_HEAD1)))
152 fprintf (file, "%s", hs);
153
154 while (--n >= 0)
155 {
156 if ((!_res.pfcode) || sflag)
157 cp = __p_rr (cp, msg, file);
158 else
159 {
160 unsigned dlen;
161
162 cp += __dn_skipname (cp, cp + MAXCDNAME);
163 cp += INT16SZ;
164 cp += INT16SZ;
165 cp += INT32SZ;
166 dlen = _getshort ((u_char*)cp);
167 cp += INT16SZ;
168 cp += dlen;
169 }
170 if ((cp - msg) > len)
171 return (NULL);
172 }
173 if (!_res.pfcode || (sflag && (_res.pfcode & RES_PRF_HEAD1)))
174 putc ('\n', file);
175 }
176 return (cp);
177}
178
179void W32_CALL __p_query (const u_char *msg)
180{
181 __fp_query (msg,stdout);
182}
183
184
185/*
186 * Print the current options.
187 * This is intended to be primarily a debugging routine.
188 */
189void W32_CALL __fp_resstat (struct __res_state *statp, FILE *file)
190{
191 u_long mask;
192
193 fprintf (file, ";; res options:");
194 if (!statp)
195 statp = &_res;
196 for (mask = 1; mask; mask <<= 1)
197 if (statp->options & mask)
198 fprintf (file, " %s", p_option(mask));
199 putc ('\n', file);
200}
201
202/*
203 * Print the contents of a query.
204 * This is intended to be primarily a debugging routine.
205 */
206void W32_CALL __fp_nquery (const u_char *msg, int len, FILE *file)
207{
208 const u_char *cp, *endMark;
209 const HEADER *hp;
210 int n, tline;
211
212 if (!(_res.options & RES_INIT) && res_init() == -1)
213 return;
214
215#define TruncTest(x) do { \
216 if (x >= endMark) { \
217 tline = __LINE__; \
218 goto trunc; \
219 } \
220 } while (0)
221
222#define ErrorTest(x) do { \
223 if (x == NULL) { \
224 tline = __LINE__; \
225 goto error; \
226 } \
227 } while (0)
228
229 /* Print header fields.
230 */
231 hp = (HEADER*) msg;
232 cp = msg + HFIXEDSZ;
233 endMark = cp + len;
234
235 if (!_res.pfcode || (_res.pfcode & RES_PRF_HEADX) || hp->rcode)
236 {
237 fprintf (file, ";; ->>HEADER<<- opcode: %s, status: %s, id: %d",
238 _res_opcodes[hp->opcode], _res_resultcodes[hp->rcode],
239 ntohs(hp->id));
240 putc ('\n', file);
241 }
242 if (!_res.pfcode || (_res.pfcode & RES_PRF_HEADX))
243 putc (';', file);
244
245 if (!_res.pfcode || (_res.pfcode & RES_PRF_HEAD2))
246 {
247 fprintf (file, "; flags:");
248 if (hp->qr) fprintf (file, " qr");
249 if (hp->aa) fprintf (file, " aa");
250 if (hp->tc) fprintf (file, " tc");
251 if (hp->rd) fprintf (file, " rd");
252 if (hp->ra) fprintf (file, " ra");
253 }
254 if (!_res.pfcode || (_res.pfcode & RES_PRF_HEAD1))
255 {
256 fprintf (file, "; Ques: %d", ntohs(hp->qdcount));
257 fprintf (file, ", Ans: %d", ntohs(hp->ancount));
258 fprintf (file, ", Auth: %d", ntohs(hp->nscount));
259 fprintf (file, ", Addit: %d",ntohs(hp->arcount));
260 }
261 if (!_res.pfcode ||
262 (_res.pfcode & (RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1)))
263 putc ('\n', file);
264
265 /* Print question records.
266 */
267 n = ntohs (hp->qdcount);
268 if (n != 0)
269 {
270 if (!_res.pfcode || (_res.pfcode & RES_PRF_QUES))
271 fprintf (file, ";; QUESTIONS:\n");
272
273 while (--n >= 0)
274 {
275 if (!_res.pfcode || (_res.pfcode & RES_PRF_QUES))
276 fprintf (file, ";;\t");
277 TruncTest (cp);
278 if (!_res.pfcode || (_res.pfcode & RES_PRF_QUES))
279 cp = p_cdnname (cp, msg, len, file);
280 else
281 {
282 char name [MAXDNAME];
283
284 n = dn_expand (msg, msg+len, cp, name, sizeof(name));
285 if (n < 0)
286 cp = NULL;
287 else cp += n;
288 }
289 ErrorTest (cp);
290 TruncTest (cp);
291 if (!_res.pfcode || (_res.pfcode & RES_PRF_QUES))
292 fprintf (file, ", type = %s", __p_type(_getshort((u_char*)cp)));
293 cp += INT16SZ;
294
295 TruncTest (cp);
296 if (!_res.pfcode || (_res.pfcode & RES_PRF_QUES))
297 fprintf (file, ", class = %s\n", __p_class(_getshort((u_char*)cp)));
298 cp += INT16SZ;
299
300 if (!_res.pfcode || (_res.pfcode & RES_PRF_QUES))
301 putc ('\n', file);
302 }
303 }
304 /* Print authoritative answer records
305 */
306 TruncTest (cp);
307 cp = do_rrset (msg, len, cp, hp->ancount, RES_PRF_ANS, file,
308 ";; ANSWERS:\n");
309 ErrorTest (cp);
310
311 /* print name server records
312 */
313 TruncTest (cp);
314 cp = do_rrset (msg, len, cp, hp->nscount, RES_PRF_AUTH, file,
315 ";; AUTHORITY RECORDS:\n");
316 ErrorTest (cp);
317 TruncTest (cp);
318
319 /* print additional records
320 */
321 cp = do_rrset (msg, len, cp, hp->arcount, RES_PRF_ADD, file,
322 ";; ADDITIONAL RECORDS:\n");
323 ErrorTest(cp);
324 return;
325
326trunc:
327 fprintf (file, "\n;; ...truncated (%s, line %d)\n", __FILE__, tline);
328 return;
329
330error:
331 fprintf (file, "\n;; ...malformed (%s, line %d)\n", __FILE__, tline);
332}
333
334void W32_CALL __fp_query (const u_char *msg, FILE *file)
335{
336 fp_nquery (msg, PACKETSZ, file);
337}
338
339const u_char * W32_CALL __p_cdnname (const u_char *cp,
340 const u_char *msg,
341 int len, FILE *file)
342{
343 char name[MAXDNAME];
344 int n;
345
346 if ((n = dn_expand(msg, msg + len, cp, name, sizeof name)) < 0)
347 return (NULL);
348 if (name[0] == '\0')
349 putc ('.', file);
350 else fputs (name, file);
351 return (cp + n);
352}
353
354const u_char * W32_CALL __p_cdname (const u_char *cp, const u_char *msg, FILE *file)
355{
356 return (p_cdnname(cp, msg, PACKETSZ, file));
357}
358
359/* XXX: the rest of these functions need to become length-limited, too. (vix)
360 */
361
362const u_char * W32_CALL __p_fqname (const u_char *cp, const u_char *msg, FILE *file)
363{
364 char name[MAXDNAME];
365 int n = dn_expand (msg, cp + MAXCDNAME, cp, name, sizeof(name));
366
367 if (n < 0)
368 return (NULL);
369
370 if (name[0] == '\0')
371 putc ('.', file);
372 else
373 {
374 fputs (name, file);
375 if (name[strlen(name)-1] != '.')
376 putc ('.', file);
377 }
378 return (cp + n);
379}
380
381/*
382 * Print resource record fields in human readable form.
383 */
384const u_char * W32_CALL __p_rr (const u_char *cp, const u_char *msg, FILE *file)
385{
386 struct in_addr inaddr;
387 const u_char *cp1, *cp2;
388 int type, Class, dlen;
389 int n = 0, c = 0;
390 int lcnt;
391 u_long tmpttl, t;
392
393 if (!(_res.options & RES_INIT) && res_init() == -1)
394 {
395 h_errno = NETDB_INTERNAL;
396 return (NULL);
397 }
398
399 cp = p_fqname (cp, msg, file);
400 if (!cp)
401 return (NULL); /* compression error */
402
403 type = _getshort ((u_char*)cp);
404 cp += INT16SZ;
405 Class = _getshort ((u_char*)cp);
406 cp += INT16SZ;
407 tmpttl = _getlong ((u_char*)cp);
408 cp += INT32SZ;
409 dlen = _getshort ((u_char*)cp);
410 cp += INT16SZ;
411 cp1 = cp;
412
413 if (!_res.pfcode || (_res.pfcode & RES_PRF_TTLID))
414 fprintf (file, "\t%lu", (u_long)tmpttl);
415
416 if (!_res.pfcode || (_res.pfcode & RES_PRF_CLASS))
417 fprintf (file, "\t%s", __p_class(Class));
418
419 fprintf (file, "\t%s", __p_type(type));
420
421 /* Print type specific data, if appropriate
422 */
423 switch (type)
424 {
425 case T_A:
426 switch (Class)
427 {
428 case C_IN:
429 case C_HS:
430 memcpy (&inaddr, cp, INADDRSZ);
431 if (dlen == 4)
432 {
433 fprintf (file, "\t%s", inet_ntoa(inaddr));
434 cp += dlen;
435 }
436 else if (dlen == 7)
437 {
438 char *address;
439 u_char protocol;
440 u_short port;
441
442 address = inet_ntoa (inaddr);
443 cp += INADDRSZ;
444 protocol = *(u_char*)cp;
445 cp += sizeof(u_char);
446 port = _getshort ((u_char*)cp);
447 cp += INT16SZ;
448 fprintf (file, "\t%s\t; proto %d, port %d",
449 address, protocol, port);
450 }
451 break;
452 default:
453 cp += dlen;
454 }
455 break;
456
457 case T_CNAME:
458 case T_MB:
459 case T_MG:
460 case T_MR:
461 case T_NS:
462 case T_PTR:
463 putc ('\t', file);
464 cp = p_fqname (cp, msg, file);
465 if (!cp)
466 return (NULL);
467 break;
468
469 case T_HINFO:
470 case T_ISDN:
471 cp2 = cp + dlen;
472 n = *cp++;
473 if (n != 0)
474 {
475 fprintf (file, "\t%.*s", n, cp);
476 cp += n;
477 }
478 if ((cp < cp2) && (n = *cp++) != 0)
479 {
480 fprintf (file, "\t%.*s", n, cp);
481 cp += n;
482 }
483 else if (type == T_HINFO)
484 fprintf (file, "\n;; *** Warning *** OS-type missing");
485 break;
486
487 case T_SOA:
488 putc ('\t', file);
489 cp = p_fqname (cp, msg, file);
490 if (!cp)
491 return (NULL);
492 putc (' ', file);
493 cp = p_fqname (cp, msg, file);
494 if (!cp)
495 return (NULL);
496 fputs (" (\n", file);
497 t = _getlong ((u_char*)cp);
498 cp += INT32SZ;
499 fprintf (file, "\t\t\t%lu\t; serial\n", (u_long)t);
500 t = _getlong ((u_char*)cp);
501 cp += INT32SZ;
502 fprintf (file, "\t\t\t%lu\t; refresh (%s)\n", (u_long)t, __p_time(t));
503 t = _getlong ((u_char*)cp);
504 cp += INT32SZ;
505 fprintf (file, "\t\t\t%lu\t; retry (%s)\n", (u_long)t, __p_time(t));
506 t = _getlong ((u_char*)cp);
507 cp += INT32SZ;
508 fprintf (file, "\t\t\t%lu\t; expire (%s)\n", (u_long)t, __p_time(t));
509 t = _getlong ((u_char*)cp);
510 cp += INT32SZ;
511 fprintf (file, "\t\t\t%lu )\t; minimum (%s)", (u_long)t, __p_time(t));
512 break;
513
514 case T_MX:
515 case T_AFSDB:
516 case T_RT:
517 fprintf (file, "\t%d ", _getshort((u_char*)cp));
518 cp += INT16SZ;
519 cp = p_fqname (cp, msg, file);
520 if (!cp)
521 return (NULL);
522 break;
523
524 case T_PX:
525 fprintf (file, "\t%d ", _getshort((u_char*)cp));
526 cp += INT16SZ;
527 cp = p_fqname (cp, msg, file);
528 if (!cp)
529 return (NULL);
530 putc (' ', file);
531 cp = p_fqname (cp, msg, file);
532 if (!cp)
533 return (NULL);
534 break;
535
536 case T_TXT:
537 case T_X25:
538 fputs ("\t\"", file);
539 cp2 = cp1 + dlen;
540 while (cp < cp2)
541 {
542 n = (BYTE)*cp++;
543 if (n != 0)
544 {
545 for (c = n; c > 0 && cp < cp2; c--)
546 if (*cp == '\n' || *cp == '"')
547 {
548 putc ('\\', file);
549 putc (*cp++, file);
550 }
551 else
552 putc (*cp++, file);
553 }
554 }
555 putc ('"', file);
556 break;
557
558 case T_NSAP:
559 fprintf (file, "\t%s", inet_nsap_ntoa(dlen, cp, NULL));
560 cp += dlen;
561 break;
562
563 case T_MINFO:
564 case T_RP:
565 putc ('\t', file);
566 cp = p_fqname (cp, msg, file);
567 if (!cp)
568 return (NULL);
569 putc (' ', file);
570 cp = p_fqname (cp, msg, file);
571 if (!cp)
572 return (NULL);
573 break;
574
575 case T_UINFO:
576 putc ('\t', file);
577 fputs ((char*)cp, file);
578 cp += dlen;
579 break;
580
581 case T_UID:
582 case T_GID:
583 if (dlen == 4)
584 {
585 fprintf (file, "\t%u", (unsigned)_getlong((u_char*)cp));
586 cp += INT32SZ;
587 }
588 break;
589
590 case T_WKS:
591 if (dlen < INT32SZ + 1)
592 break;
593 memcpy (&inaddr, cp, INADDRSZ);
594 cp += INT32SZ;
595 fprintf (file, "\t%s %s ( ", inet_ntoa(inaddr), deproto((int)*cp));
596 cp += sizeof(u_char);
597 n = 0;
598 lcnt = 0;
599 while (cp < cp1 + dlen)
600 {
601 c = *cp++;
602 do
603 {
604 if (c & 0200)
605 {
606 if (lcnt == 0)
607 {
608 fputs ("\n\t\t\t", file);
609 lcnt = 5;
610 }
611 fputs (dewks(n), file);
612 putc (' ', file);
613 lcnt--;
614 }
615 c <<= 1;
616 }
617 while (++n & 07);
618 }
619 putc (')', file);
620 break;
621
622#if ALLOW_T_UNSPEC
623 case T_UNSPEC:
624 {
625 int numBytes = 8;
626 u_char *dataPtr;
627 int i;
628
629 if (dlen < numBytes)
630 numBytes = dlen;
631 fprintf (file, "\tFirst %d bytes of hex data:", numBytes);
632 for (i = 0, dataPtr = cp; i < numBytes; i++, dataPtr++)
633 fprintf (file, " %x", *dataPtr);
634 cp += dlen;
635 }
636 break;
637#endif
638
639 default:
640 fprintf (file, "\t?%d?", type);
641 cp += dlen;
642 }
643
644#if 0
645 fprintf (file, "\t; dlen=%d, ttl %s\n", dlen, __p_time(tmpttl));
646#else
647 putc ('\n', file);
648#endif
649
650 if (cp - cp1 != dlen)
651 {
652 fprintf (file, ";; packet size error (found %d, dlen was %d)\n",
653 (int)(cp - cp1), dlen);
654 cp = NULL;
655 }
656 return (cp);
657}
658
659/*
660 * Return a string for the type
661 */
662const char * W32_CALL __p_type (int type)
663{
664 static char buf[20];
665
666 switch (type)
667 {
668 case T_A: return "A";
669 case T_NS: return "NS";
670 case T_CNAME: return "CNAME";
671 case T_SOA: return "SOA";
672 case T_SRV: return "SRV";
673 case T_MB: return "MB";
674 case T_MG: return "MG";
675 case T_MR: return "MR";
676 case T_NULL: return "NULL";
677 case T_WKS: return "WKS";
678 case T_PTR: return "PTR";
679 case T_HINFO: return "HINFO";
680 case T_MINFO: return "MINFO";
681 case T_MX: return "MX";
682 case T_TXT: return "TXT";
683 case T_RP: return "RP";
684 case T_AFSDB: return "AFSDB";
685 case T_X25: return "X25";
686 case T_ISDN: return "ISDN";
687 case T_RT: return "RT";
688 case T_NSAP: return "NSAP";
689 case T_NSAP_PTR: return "NSAP_PTR";
690 case T_SIG: return "SIG";
691 case T_KEY: return "KEY";
692 case T_PX: return "PX";
693 case T_GPOS: return "GPOS";
694 case T_AAAA: return "AAAA";
695 case T_LOC: return "LOC";
696 case T_AXFR: return "AXFR";
697 case T_MAILB: return "MAILB";
698 case T_MAILA: return "MAILA";
699 case T_ANY: return "ANY";
700 case T_UINFO: return "UINFO";
701 case T_UID: return "UID";
702 case T_GID: return "GID";
703 case T_WINS: return "WINS";
704 case T_WINSR: return "WINS-R";
705#if ALLOW_T_UNSPEC
706 case T_UNSPEC: return "UNSPEC";
707#endif
708 }
709 return itoa (type, buf, 10);
710}
711
712/*
713 * Return a mnemonic for class
714 */
715const char * W32_CALL __p_class (int Class)
716{
717 static char buf[20];
718
719 switch (Class)
720 {
721 case C_IN:
722 return ("IN");
723 case C_HS:
724 return ("HS");
725 case C_ANY:
726 return ("ANY");
727 }
728 return itoa (Class, buf, 10);
729}
730
731/*
732 * Return a mnemonic for an option
733 */
734const char * W32_CALL __p_option (u_long option)
735{
736 static char buf[40];
737
738 switch (option)
739 {
740 case RES_INIT: return "init";
741 case RES_DEBUG: return "debug";
742 case RES_AAONLY: return "aaonly(unimpl)";
743 case RES_USEVC: return "usevc";
744 case RES_PRIMARY: return "primry(unimpl)";
745 case RES_IGNTC: return "igntc";
746 case RES_RECURSE: return "recurs";
747 case RES_DEFNAMES: return "defnam";
748 case RES_STAYOPEN: return "styopn";
749 case RES_DNSRCH: return "dnsrch";
750 case RES_INSECURE1: return "insecure1";
751 case RES_INSECURE2: return "insecure2";
752 }
753 sprintf (buf, "?0x%lx?", option);
754 return (buf);
755}
756
757/*
758 * Return a mnemonic for a time to live
759 */
760char * W32_CALL __p_time (u_long value)
761{
762 static char buf[120];
763 int secs, mins, hours, days;
764 char *p;
765
766 if (value == 0)
767 {
768 strcpy (buf, "0 secs");
769 return (buf);
770 }
771
772 secs = value % 60;
773 value /= 60;
774 mins = value % 60;
775 value /= 60;
776 hours = value % 24;
777 value /= 24;
778 days = value;
779 value = 0;
780
781#define PLURALISE(x) x, (x == 1) ? "" : "s"
782 p = buf;
783 if (days)
784 {
785 sprintf (p, "%d day%s", PLURALISE(days));
786 while (*++p) ;
787 }
788 if (hours)
789 {
790 if (days)
791 *p++ = ' ';
792 sprintf (p, "%d hour%s", PLURALISE(hours));
793 while (*++p) ;
794 }
795 if (mins)
796 {
797 if (days || hours)
798 *p++ = ' ';
799 sprintf (p, "%d min%s", PLURALISE(mins));
800 while (*++p) ;
801 }
802 if (secs || ! (days || hours || mins))
803 {
804 if (days || hours || mins)
805 *p++ = ' ';
806 sprintf (p, "%d sec%s", PLURALISE(secs));
807 }
808 return (buf);
809}
810#endif /* USE_BIND */
811
resolver.h
__res_state
Definition: resolv.h:125
HEADER
Definition: nameser_compat.h:50
HEADER::rd
unsigned rd
recursion desired
Definition: nameser_compat.h:58
HEADER::nscount
unsigned nscount
number of authority entries
Definition: nameser_compat.h:83
HEADER::qdcount
unsigned qdcount
number of question entries
Definition: nameser_compat.h:81
HEADER::opcode
unsigned opcode
purpose of message
Definition: nameser_compat.h:55
HEADER::rcode
unsigned rcode
response code
Definition: nameser_compat.h:64
HEADER::arcount
unsigned arcount
number of resource entries
Definition: nameser_compat.h:84
HEADER::ancount
unsigned ancount
number of answer entries
Definition: nameser_compat.h:82
HEADER::tc
unsigned tc
truncated message
Definition: nameser_compat.h:57
HEADER::ra
unsigned ra
recursion available
Definition: nameser_compat.h:60
HEADER::aa
unsigned aa
authoritive answer
Definition: nameser_compat.h:56
HEADER::qr
unsigned qr
response flag
Definition: nameser_compat.h:54
HEADER::id
unsigned id
query identification number
Definition: nameser_compat.h:51
in_addr
Definition: in.h:143


Watt-32 tcp/ip: E:/WATT/src/res_init.c Source File

  • src
res_init.c
Go to the documentation of this file.
1
5/* ++Copyright++ 1985, 1989, 1993
6 * -
7 * Copyright (c) 1985, 1989, 1993
8 * The Regents of the University of California. All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 * -
38 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
39 *
40 * Permission to use, copy, modify, and distribute this software for any
41 * purpose with or without fee is hereby granted, provided that the above
42 * copyright notice and this permission notice appear in all copies, and that
43 * the name of Digital Equipment Corporation not be used in advertising or
44 * publicity pertaining to distribution of the document or software without
45 * specific, written prior permission.
46 *
47 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
48 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
50 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
51 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
52 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
53 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
54 * SOFTWARE.
55 * -
56 * --Copyright--
57 */
58
59#include "resolver.h"
60
61#if defined(USE_BIND)
62
63/*----------------- info about "sortlist" -----------------------------
64 *
65 * Marc Majka 1994/04/16
66 * Allan Nathanson 1994/10/29 (BIND 4.9.3.x)
67 *
68 * NetInfo resolver configuration directory support.
69 *
70 * Allow a NetInfo directory to be created in the hierarchy which
71 * contains the same information as the resolver configuration file.
72 *
73 * - The local domain name is stored as the value of the "domain" property.
74 * - The Internet address(es) of the name server(s) are stored as values
75 * of the "nameserver" property.
76 * - The name server addresses are stored as values of the "nameserver"
77 * property.
78 * - The search list for host-name lookup is stored as values of the
79 * "search" property.
80 * - The sortlist comprised of IP address netmask pairs are stored as
81 * values of the "sortlist" property. The IP address and optional netmask
82 * should be seperated by a slash (/) or ampersand (&) character.
83 * - Internal resolver variables can be set from the value of the "options"
84 * property.
85 */
86
87#undef is_it
88#define is_it(cp,x) !strncmp(cp,x,sizeof(x)-1)
89
90#ifndef INADDR_LOOPBACK
91#define INADDR_LOOPBACK (u_long)0x7F000001
92#endif
93
94char *res_cfg_options = NULL; /* resolver options */
95char *res_cfg_aliases = NULL; /* hostaliases file */
96
97/*
98 * Resolver state default settings.
99 */
100struct __res_state _res;
101
102static void res_setoptions (const char *options, const char *source)
103{
104 const char *cp = options;
105
106 if (_res.options & RES_DEBUG)
107 (*_printf) (";; res_setoptions(\"%s\", \"%s\")...\n", options, source);
108
109 while (*cp)
110 {
111 /* skip leading and inner runs of spaces
112 */
113 while (*cp == ' ' || *cp == '\t')
114 ++cp;
115
116 /* search for and process individual options
117 */
118 if (is_it(cp,"ndots:"))
119 {
120 int i = atoi (cp + sizeof("ndots:") - 1);
121
122 if (i <= RES_MAXNDOTS)
123 _res.ndots = i;
124 else _res.ndots = RES_MAXNDOTS;
125
126 if (_res.options & RES_DEBUG)
127 (*_printf) (";;\tndots=%d\n", _res.ndots);
128 }
129 else if (is_it(cp,"debug"))
130 {
131 if (!(_res.options & RES_DEBUG))
132 {
133 (*_printf) (";; res_setoptions(\"%s\", \"%s\")..\n", options, source);
134 _res.options |= RES_DEBUG;
135 }
136 (*_printf) (";;\tdebug\n");
137 }
138 else
139 {
140 /* XXX - print a warning here? */
141 }
142 /* skip to next run of spaces
143 */
144 while (*cp && *cp != ' ' && *cp != '\t')
145 cp++;
146 }
147}
148
149u_int16_t W32_CALL res_randomid (void)
150{
151 return (0xFFFF & rand());
152}
153
154
155/*
156 * Set up default settings. If the configuration file exist, the values
157 * there will have precedence. Otherwise, the server address is set to
158 * INADDR_ANY and the default domain name comes from the gethostname().
159 *
160 * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1
161 * rather than INADDR_ANY ("0.0.0.0") as the default name server address
162 * since it was noted that INADDR_ANY actually meant ``the first interface
163 * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface,
164 * it had to be "up" in order for you to reach your own name server. It
165 * was later decided that since the recommended practice is to always
166 * install local static routes through 127.0.0.1 for all your network
167 * interfaces, that we could solve this problem without a code change.
168 *
169 * The configuration file should always be used, since it is the only way
170 * to specify a default domain. If you are running a server on your local
171 * machine, you should say "nameserver 0.0.0.0" or "nameserver 127.0.0.1"
172 * in the configuration file.
173 *
174 * Return 0 if completes successfully, -1 on error
175 */
176int W32_CALL res_init (void)
177{
178 char *cp;
179 char dom[MAX_HOSTLEN];
180 char buf[BUFSIZ];
181 int nserv;
182
183 watt_sock_init (0, 0, 0);
184
185 /*
186 * These three fields used to be statically initialized. This made
187 * it hard to use this code in a shared library. It is necessary,
188 * now that we're doing dynamic initialization here, that we preserve
189 * the old semantics: if an application modifies one of these three
190 * fields of _res before res_init() is called, res_init() will not
191 * alter them. Of course, if an application is setting them to
192 * _zero_ before calling res_init(), hoping to override what used
193 * to be the static default, we can't detect it and unexpected results
194 * will follow. Zero for any of these fields would make no sense,
195 * so one can safely assume that the applications were already getting
196 * unexpected results.
197 *
198 * _res.options is tricky since some apps were known to diddle the bits
199 * before res_init() was first called. We can't replicate that semantic
200 * with dynamic initialization (they may have turned bits off that are
201 * set in RES_DEFAULT). Our solution is to declare such applications
202 * "broken". They could fool us by setting RES_INIT but none do (yet).
203 */
204 if (!_res.retrans) _res.retrans = RES_TIMEOUT;
205 if (!_res.retry) _res.retry = 4;
206 if (!(_res.options & RES_INIT)) _res.options = RES_DEFAULT;
207
208 /*
209 * This one used to initialize implicitly to zero, so unless the app
210 * has set it to something in particular, we can randomize it now.
211 */
212 if (_res.id == 0)
213 _res.id = res_randomid();
214
215 _res.nsaddr.sin_addr.s_addr = INADDR_ANY;
216 _res.nsaddr.sin_family = AF_INET;
217 _res.nsaddr.sin_port = htons (NAMESERVER_PORT);
218 _res.nscount = 0;
219 _res.pfcode = 0;
220 _res.dnsrch[0] = _res.defdname;
221 _res.dnsrch[1] = NULL;
222 if (!(_res.options & RES_INIT))
223 _res.ndots = 1;
224
225 if (getdomainname (dom,sizeof(dom)) == 0)
226 {
227 strncpy (_res.defdname, dom, sizeof(_res.defdname)-1);
228 _res.defdname [sizeof(_res.defdname)-1] = '\0';
229 }
230 else
231 _res.defdname[0] = 0;
232
233 for (nserv = 0; nserv < MAXNS; nserv++)
234 {
235 _res.nsaddr_list[nserv].sin_family = AF_INET;
236 _res.nsaddr_list[nserv].sin_port = htons (NAMESERVER_PORT);
237 if (nserv < last_nameserver)
238 {
239 _res.nsaddr_list[nserv].sin_addr.s_addr = htonl (def_nameservers[nserv]);
240 _res.nscount++;
241 }
242 else
243 _res.nsaddr_list[nserv].sin_addr.s_addr = htonl (INADDR_LOOPBACK);
244 }
245
246 if (_res.options & RES_DEBUG)
247 {
248 int i;
249 for (i = 1; i <= _res.nscount; i++)
250 (*_printf) ("Nameserv #%d: %s (%d)\n",
251 i, inet_ntoa(_res.nsaddr_list[i-1].sin_addr),
252 NAMESERVER_PORT);
253 }
254
255 if (_res.defdname[0] == 0 &&
256 gethostname (buf,sizeof(_res.defdname)-1) == 0 &&
257 (cp = strchr(buf, '.')) != NULL)
258 strcpy (_res.defdname, cp+1);
259
260 cp = getenv ("RES_OPTIONS");
261 if (!cp)
262 cp = res_cfg_options;
263 if (cp)
264 res_setoptions (cp, "env");
265
266 _res.options |= RES_INIT;
267 return (0);
268}
269
270/*
271 * Configure hook routine for bind resolver. Must be called
272 * before res_init() (via watt_sock_init).
273 */
274static void (W32_CALL *prev_hook) (const char*, const char*);
275
276static const struct config_table bind_cfg[] = {
277 { "RES_OPTIONS", ARG_STRDUP, (void*)&res_cfg_options },
278 { "HOSTALIASES", ARG_STRDUP, (void*)&res_cfg_aliases },
279 { NULL, 0, NULL }
280 };
281
282static void W32_CALL resolver_init (const char *name, const char *value)
283{
284 if (!parse_config_table(&bind_cfg[0], "BIND.", name, value) && prev_hook)
285 (*prev_hook) (name, value);
286}
287
288static void W32_CALL res_exit (void)
289{
290 DO_FREE (res_cfg_options);
291 DO_FREE (res_cfg_aliases);
292}
293
294void W32_CALL res_init0 (void)
295{
296 prev_hook = usr_init;
297 usr_init = resolver_init;
298 RUNDOWN_ADD (res_exit, 200);
299}
300#endif /* USE_BIND */
301
getdomainname
int W32_CALL getdomainname(char *buffer, size_t buflen)
BSD-style: Return domain name of this host.
Definition: bsdname.c:186
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
resolver.h
watt_sock_init
int W32_CALL watt_sock_init(size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
Definition: sock_ini.c:769
__res_state
Definition: resolv.h:125
config_table
Definition: tcp.h:461
ARG_STRDUP
@ ARG_STRDUP
duplicate string value
Definition: tcp.h:455


Watt-32 tcp/ip: E:/WATT/src/res_loc.c Source File

  • src
res_loc.c
Go to the documentation of this file.
1
5/* ++Copyright++ 1985, 1989, 1993
6 * -
7 * Copyright (c) 1985, 1989, 1993
8 * The Regents of the University of California. All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 * -
38 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
39 *
40 * Permission to use, copy, modify, and distribute this software for any
41 * purpose with or without fee is hereby granted, provided that the above
42 * copyright notice and this permission notice appear in all copies, and that
43 * the name of Digital Equipment Corporation not be used in advertising or
44 * publicity pertaining to distribution of the document or software without
45 * specific, written prior permission.
46 *
47 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
48 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
50 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
51 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
52 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
53 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
54 * SOFTWARE.
55 * -
56 * --Copyright--
57 *
58 * Code taken from RFC-1876
59 *
60 * Routines to convert between on-the-wire RR format and zone file
61 * format. Does not contain conversion to/from decimal degrees;
62 * divide or multiply by 60*60*1000 for that.
63 *
64 * Adapted for Watt-32 by Gisle Vanem 1997
65 */
66
67#include "resolver.h"
68
69#if defined(USE_BIND)
70
71static unsigned long power_of_ten[10] = {
72 1, 10, 100, 1000, 10000, 100000,
73 1000000,10000000,100000000,1000000000
74 };
75
76/*
77 * takes an XeY precision/size value, returns a string representation.
78 */
79static const char *precsize_ntoa (BYTE prec)
80{
81 static char retbuf [sizeof("90000000000000.00")];
82
83 int mantissa = (int)((prec >> 4) & 0x0f) % 10;
84 int exponent = (int)((prec >> 0) & 0x0f) % 10;
85 u_long value = mantissa * power_of_ten [exponent];
86
87 W32_GCC_OVERFLOW_WARN_OFF()
88
89 sprintf (retbuf, "%lu.%.2lu", value / 100, value % 100);
90
91 W32_GCC_OVERFLOW_WARN_DEF()
92
93 return (retbuf);
94}
95
96/*
97 * converts ASCII size/precision X * 10**Y(cm) to 0xXY. moves pointer.
98 */
99static BYTE precsize_aton (char **strptr)
100{
101 UINT mval = 0;
102 UINT cmval = 0;
103 BYTE retval = 0;
104 char *cp = *strptr;
105 int exponent;
106 int mantissa;
107
108 while (isdigit((int)*cp))
109 mval = mval * 10 + (*cp++ - '0');
110
111 if (*cp == '.') /* centimeters */
112 {
113 cp++;
114 if (isdigit((int)*cp))
115 {
116 cmval = (*cp++ - '0') * 10;
117 if (isdigit((int)*cp))
118 cmval += (*cp++ - '0');
119 }
120 }
121 cmval = (mval * 100) + cmval;
122
123 for (exponent = 0; exponent < 9; exponent++)
124 if (cmval < power_of_ten[exponent+1])
125 break;
126
127 mantissa = cmval / power_of_ten[exponent];
128 if (mantissa > 9)
129 mantissa = 9;
130
131 retval = (mantissa << 4) | exponent;
132 *strptr = cp;
133 return (retval);
134}
135
136/*
137 * Converts ASCII lat/long to unsigned encoded 32-bit number
138 */
139static DWORD latlon2ul (char **latlonstrptr, int *which)
140{
141 DWORD retval;
142 char *cp = *latlonstrptr;
143 int deg = 0;
144 int min = 0;
145 int secs = 0;
146 int secsfrac = 0;
147
148 while (isdigit((int)*cp))
149 deg = deg * 10 + (*cp++ - '0');
150
151 while (isspace((int)*cp))
152 cp++;
153
154 if (!(isdigit((int)*cp)))
155 goto fndhemi;
156
157 while (isdigit((int)*cp))
158 min = min * 10 + (*cp++ - '0');
159
160 while (isspace((int)*cp))
161 cp++;
162
163 if (!(isdigit((int)*cp)))
164 goto fndhemi;
165
166 while (isdigit((int)*cp))
167 secs = secs * 10 + (*cp++ - '0');
168
169 if (*cp == '.') /* decimal seconds */
170 {
171 cp++;
172 if (isdigit((int)*cp))
173 {
174 secsfrac = (*cp++ - '0') * 100;
175 if (isdigit((int)*cp))
176 {
177 secsfrac += (*cp++ - '0') * 10;
178 if (isdigit((int)*cp))
179 secsfrac += (*cp++ - '0');
180 }
181 }
182 }
183
184 while (!isspace((int)*cp)) /* if any trailing garbage */
185 cp++;
186
187 while (isspace((int)*cp))
188 cp++;
189
190fndhemi:
191
192 switch (toupper((int)*cp))
193 {
194 case 'N':
195 case 'E':
196 retval = (1UL << 31UL)
197 + (((((deg * 60UL) + min) * 60UL) + secs) * 1000UL)
198 + secsfrac;
199 break;
200 case 'S':
201 case 'W':
202 retval = (1UL << 31UL)
203 - (((((deg * 60UL) + min) * 60UL) + secs) * 1000UL)
204 - secsfrac;
205 break;
206 default:
207 retval = 0; /* invalid value -- indicates error */
208 break;
209 }
210
211 switch (toupper((int)*cp))
212 {
213 case 'N':
214 case 'S':
215 *which = 1; /* latitude */
216 break;
217 case 'E':
218 case 'W':
219 *which = 2; /* longitude */
220 break;
221 default:
222 *which = 0; /* error */
223 break;
224 }
225
226 cp++; /* skip the hemisphere */
227
228 while (!isspace((int)*cp)) /* if any trailing garbage */
229 cp++;
230
231 while (isspace((int)*cp)) /* move to next field */
232 cp++;
233
234 *latlonstrptr = cp;
235 return (retval);
236}
237
238/*
239 * Converts a zone file representation in a string to an RDATA
240 * on-the-wire representation.
241 */
242int W32_CALL loc_aton (const char *ascii, u_char *binary)
243{
244 char *cp, *maxcp;
245 BYTE *bcp;
246 DWORD latit = 0, longit = 0, alt = 0;
247 DWORD lltemp1 = 0, lltemp2 = 0;
248 int altmeters = 0;
249 int altfrac = 0;
250 int altsign = 1;
251 BYTE hp = 0x16; /* default = 1E6 cm = 10000.00m = 10km */
252 BYTE vp = 0x13; /* default = 1E3 cm = 10.00m */
253 BYTE siz = 0x12; /* default = 1E2 cm = 1.00m */
254 int which1 = 0;
255 int which2 = 0;
256
257 cp = (char*)ascii;
258 maxcp = cp + strlen (ascii);
259
260 lltemp1 = latlon2ul (&cp, &which1);
261 lltemp2 = latlon2ul (&cp, &which2);
262
263 switch (which1 + which2)
264 {
265 case 3: /* 1 + 2, the only valid combination */
266 if (which1 == 1 && which2 == 2) /* normal case */
267 {
268 latit = lltemp1;
269 longit = lltemp2;
270 }
271 else if (which1 == 2 && which2 == 1) /* reversed */
272 {
273 longit = lltemp1;
274 latit = lltemp2;
275 }
276 else /* some kind of brokenness */
277 return (0);
278 break;
279 default: /* we didn't get one of each */
280 return (0);
281 }
282
283 /* altitude */
284 if (*cp == '-')
285 {
286 altsign = -1;
287 cp++;
288 }
289
290 if (*cp == '+')
291 ++cp;
292
293 while (isdigit((int)*cp))
294 altmeters = altmeters * 10 + (*cp++ - '0');
295
296 if (*cp == '.') /* decimal meters */
297 {
298 cp++;
299 if (isdigit((int)*cp))
300 {
301 altfrac = (*cp++ - '0') * 10;
302 if (isdigit((int)*cp))
303 altfrac += (*cp++ - '0');
304 }
305 }
306
307 alt = (10000000 + (altsign * (altmeters * 100 + altfrac)));
308
309 while (!isspace((int)*cp) && (cp < maxcp))
310 cp++; /* if trailing garbage or m */
311
312 while (isspace((int)*cp) && (cp < maxcp))
313 cp++;
314
315 if (cp >= maxcp)
316 goto defaults;
317
318 siz = precsize_aton (&cp);
319
320 while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
321 cp++;
322
323 while (isspace((int)*cp) && (cp < maxcp))
324 cp++;
325
326 if (cp >= maxcp)
327 goto defaults;
328
329 hp = precsize_aton (&cp);
330
331 while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
332 cp++;
333
334 while (isspace((int)*cp) && (cp < maxcp))
335 cp++;
336
337 if (cp >= maxcp)
338 goto defaults;
339
340 vp = precsize_aton (&cp);
341
342 defaults:
343
344 bcp = binary;
345 *bcp++ = (BYTE) 0; /* version byte */
346 *bcp++ = siz;
347 *bcp++ = hp;
348 *bcp++ = vp;
349 PUTLONG (latit, bcp);
350 PUTLONG (longit, bcp);
351 PUTLONG (alt, bcp);
352
353 return (16); /* size of RR in octets */
354}
355
356/*
357 * Takes an on-the-wire LOC RR and prints it in zone file
358 * (human readable) format.
359 */
360char * W32_CALL loc_ntoa (const u_char *binary, char *ascii)
361{
362 static char tmpbuf [255*3];
363 const DWORD referencealt = 100000UL * 100UL;
364 const BYTE *rcp;
365 char *cp0, *cp;
366
367 int latdeg, latmin, latsec, latsecfrac;
368 int longdeg, longmin, longsec, longsecfrac;
369 char northsouth, eastwest;
370 int altmeters, altfrac, altsign;
371
372 long latval, longval, altval;
373 DWORD templ;
374 BYTE sizeval, hpval, vpval, versionval;
375
376 rcp = binary;
377 if (ascii)
378 cp0 = cp = ascii;
379 else cp0 = cp = tmpbuf;
380
381 versionval = *rcp++;
382
383 if (versionval)
384 {
385 sprintf (cp, "; error: unknown LOC RR version");
386 return (cp);
387 }
388
389 sizeval = *rcp++;
390 hpval = *rcp++;
391 vpval = *rcp++;
392
393 GETLONG (templ, rcp);
394 latval = (templ - (1UL << 31));
395
396 GETLONG (templ, rcp);
397 longval = (templ - (1UL << 31));
398
399 GETLONG (templ, rcp);
400 if (templ < referencealt) /* below WGS 84 spheroid */
401 {
402 altval = referencealt - templ;
403 altsign = -1;
404 }
405 else
406 {
407 altval = templ - referencealt;
408 altsign = 1;
409 }
410
411 if (latval < 0)
412 {
413 northsouth = 'S';
414 latval = -latval;
415 }
416 else
417 northsouth = 'N';
418
419 latsecfrac = latval % 1000;
420 latval = latval / 1000;
421 latsec = latval % 60;
422 latval = latval / 60;
423 latmin = latval % 60;
424 latval = latval / 60;
425 latdeg = latval;
426
427 if (longval < 0)
428 {
429 eastwest = 'W';
430 longval = -longval;
431 }
432 else
433 eastwest = 'E';
434
435 longsecfrac = longval % 1000;
436 longval = longval / 1000;
437 longsec = longval % 60;
438 longval = longval / 60;
439 longmin = longval % 60;
440 longval = longval / 60;
441 longdeg = longval;
442
443 altfrac = altval % 100;
444 altmeters = (altval / 100) * altsign;
445
446 cp += sprintf (cp,
447 "%d %.2d %.2d.%.3d %c %d %.2d %.2d.%.3d %c %d.%.2dm",
448 latdeg, latmin, latsec, latsecfrac, northsouth,
449 longdeg, longmin, longsec, longsecfrac, eastwest,
450 altmeters, altfrac);
451
452 cp += sprintf (cp, " %sm", precsize_ntoa(sizeval));
453 cp += sprintf (cp, " %sm", precsize_ntoa(hpval));
454 cp += sprintf (cp, " %sm", precsize_ntoa(vpval));
455
456 return (cp0);
457}
458#endif /* USE_BIND */
459
resolver.h


Watt-32 tcp/ip: E:/WATT/src/res_mkqu.c Source File

  • src
res_mkqu.c
Go to the documentation of this file.
1
5/* ++Copyright++ 1985, 1993
6 * -
7 * Copyright (c) 1985, 1993
8 * The Regents of the University of California. All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 * -
38 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
39 *
40 * Permission to use, copy, modify, and distribute this software for any
41 * purpose with or without fee is hereby granted, provided that the above
42 * copyright notice and this permission notice appear in all copies, and that
43 * the name of Digital Equipment Corporation not be used in advertising or
44 * publicity pertaining to distribution of the document or software without
45 * specific, written prior permission.
46 *
47 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
48 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
50 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
51 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
52 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
53 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
54 * SOFTWARE.
55 * -
56 * --Copyright--
57 */
58
59#include "resolver.h"
60
61#if defined(USE_BIND)
62
63/*
64 * Form all types of queries.
65 * Returns the size of the result or -1.
66 */
67int W32_CALL res_mkquery (
68 int op, /* opcode of query */
69 const char *dname, /* domain name */
70 int Class, /* class of query */
71 int type, /* type of query */
72 const u_char *data, /* resource record data */
73 int datalen, /* length of data */
74 const u_char *newrr_in, /* new rr for modify or append */
75 u_char *buf, /* buffer to put query */
76 int buflen) /* size of buffer */
77{
78 struct rrec *newrr = (struct rrec *) newrr_in;
79 HEADER *hp;
80 u_char *cp;
81 u_char *dnptrs[20];
82 u_char **dpp, **lastdnptr;
83 int n;
84
85 if ((_res.options & RES_INIT) == 0 && res_init() == -1)
86 {
87 h_errno = NETDB_INTERNAL;
88 return (-1);
89 }
90
91 if (_res.options & RES_DEBUG)
92 (*_printf) (";; res_mkquery(%d, %s, %d, %d)\n", op, dname, Class, type);
93
94 /* Initialize header fields.
95 */
96 if (!buf || buflen < HFIXEDSZ)
97 return (-1);
98
99 memset (buf, 0, HFIXEDSZ);
100 hp = (HEADER*) buf;
101 hp->id = htons (++_res.id);
102 hp->opcode = op;
103 hp->rd = (_res.options & RES_RECURSE) != 0;
104 hp->rcode = NOERROR;
105 cp = buf + HFIXEDSZ;
106 buflen -= HFIXEDSZ;
107 dpp = dnptrs;
108 *dpp++ = buf;
109 *dpp++ = NULL;
110 lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
111
112 /* perform opcode specific processing
113 */
114 switch (op)
115 {
116 case STATUS:
117 return (-1);
118
119 case QUERY:
120 /* fallthrough */
121
122 case NS_NOTIFY_OP: /* Notify secondary server of SOA change */
123 buflen -= QFIXEDSZ;
124 if (buflen < 0)
125 return (-1);
126
127 if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
128 return (-1);
129 cp += n;
130 buflen -= n;
131 __putshort (type, cp);
132 cp += INT16SZ;
133 __putshort (Class, cp);
134 cp += INT16SZ;
135 hp->qdcount = htons (1);
136 if (op == QUERY || !data)
137 break;
138 /*
139 * Make an additional record for completion domain.
140 */
141 buflen -= RRFIXEDSZ;
142 n = dn_comp ((char*)data, cp, buflen, dnptrs, lastdnptr);
143 if (n < 0)
144 return (-1);
145 cp += n;
146 buflen -= n;
147 __putshort (T_NULL, cp);
148 cp += INT16SZ;
149 __putshort (Class, cp);
150 cp += INT16SZ;
151 __putlong (0, cp);
152 cp += INT32SZ;
153 __putshort (0, cp);
154 cp += INT16SZ;
155 hp->arcount = htons (1);
156 break;
157
158 case IQUERY:
159 /*
160 * Initialize answer section
161 */
162 if (buflen < 1 + RRFIXEDSZ + datalen)
163 return (-1);
164 *cp++ = '\0'; /* no domain name */
165 __putshort (type, cp);
166 cp += INT16SZ;
167 __putshort (Class, cp);
168 cp += INT16SZ;
169 __putlong (0, cp);
170 cp += INT32SZ;
171 __putshort (datalen, cp);
172 cp += INT16SZ;
173 if (datalen)
174 {
175 memcpy (cp,data,datalen);
176 cp += datalen;
177 }
178 hp->ancount = htons (1);
179 break;
180
181#if ALLOW_UPDATES
182 /*
183 * For UPDATEM/UPDATEMA, do UPDATED/UPDATEDA followed by UPDATEA
184 * (Record to be modified is followed by its replacement in msg.)
185 */
186 case UPDATEM:
187 case UPDATEMA:
188 case UPDATED:
189 /*
190 * The res code for UPDATED and UPDATEDA is the same; user
191 * calls them differently: specifies data for UPDATED; server
192 * ignores data if specified for UPDATEDA.
193 */
194 case UPDATEDA:
195 buflen -= RRFIXEDSZ + datalen;
196 if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
197 return (-1);
198 cp += n;
199 __putshort (type, cp);
200 cp += INT16SZ;
201 __putshort (Class, cp);
202 cp += INT16SZ;
203 __putlong (0, cp);
204 cp += INT32SZ;
205 __putshort (datalen, cp);
206 cp += INT16SZ;
207 if (datalen)
208 {
209 memcpy (cp,data,datalen);
210 cp += datalen;
211 }
212 if (op == UPDATED || op == UPDATEDA)
213 {
214 hp->ancount = 0;
215 break;
216 }
217 /* Else UPDATEM/UPDATEMA, so drop into code for UPDATEA
218 */
219
220 case UPDATEA: /* Add new resource record */
221 buflen -= RRFIXEDSZ + datalen;
222 if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
223 return (-1);
224 cp += n;
225 __putshort (newrr->r_type, cp);
226 cp += INT16SZ;
227 __putshort (newrr->r_class, cp);
228 cp += INT16SZ;
229 __putlong (0, cp);
230 cp += INT32SZ;
231 __putshort (newrr->r_size, cp);
232 cp += INT16SZ;
233 if (newrr->r_size)
234 {
235 memcpy (cp,newrr->r_data,newrr->r_size);
236 cp += newrr->r_size;
237 }
238 hp->ancount = 0;
239 break;
240#endif
241 default:
242 return (-1);
243 }
244
245#if ALLOW_UPDATES == 0
246 ARGSUSED (newrr);
247 ARGSUSED (newrr_in);
248#endif
249
250 return (cp - buf);
251}
252#endif /* USE_BIND */
253
res_mkquery
int W32_CALL res_mkquery(int op, const char *dname, int Class, int type, const u_char *data, int datalen, const u_char *newrr_in, u_char *buf, int buflen)
Definition: res_mkqu.c:67
resolver.h
HEADER
Definition: nameser_compat.h:50
HEADER::rd
unsigned rd
recursion desired
Definition: nameser_compat.h:58
HEADER::qdcount
unsigned qdcount
number of question entries
Definition: nameser_compat.h:81
HEADER::opcode
unsigned opcode
purpose of message
Definition: nameser_compat.h:55
HEADER::rcode
unsigned rcode
response code
Definition: nameser_compat.h:64
HEADER::arcount
unsigned arcount
number of resource entries
Definition: nameser_compat.h:84
HEADER::ancount
unsigned ancount
number of answer entries
Definition: nameser_compat.h:82
HEADER::id
unsigned id
query identification number
Definition: nameser_compat.h:51
rrec
Definition: nameser.h:270


Watt-32 tcp/ip: E:/WATT/src/res_quer.c Source File

  • src
res_quer.c
Go to the documentation of this file.
1
5/*
6 * ++Copyright++ 1988, 1993
7 * -
8 * Copyright (c) 1988, 1993
9 * The Regents of the University of California. All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 * -
39 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
40 *
41 * Permission to use, copy, modify, and distribute this software for any
42 * purpose with or without fee is hereby granted, provided that the above
43 * copyright notice and this permission notice appear in all copies, and that
44 * the name of Digital Equipment Corporation not be used in advertising or
45 * publicity pertaining to distribution of the document or software without
46 * specific, written prior permission.
47 *
48 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
49 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
50 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
51 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
52 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
53 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
54 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
55 * SOFTWARE.
56 * -
57 * --Copyright--
58 */
59
60#include "resolver.h"
61
62#if defined(USE_BIND)
63
64#if (PACKETSZ > 1024)
65 #define MAX_PACKET PACKETSZ
66#else
67 #define MAX_PACKET 1024
68#endif
69
70/*
71 * Formulate a normal query, send, and await answer.
72 * Returned answer is placed in supplied buffer "answer".
73 * Perform preliminary check of answer, returning success only
74 * if no error is indicated and the answer count is nonzero.
75 * Return the size of the response on success, -1 on error.
76 * Error number is left in h_errno.
77 *
78 * Caller must parse answer and determine whether it answers the question.
79 */
80int W32_CALL res_query (const char *name, int Class, int type,
81 u_char *answer, int anslen)
82{
83 u_char buf[MAX_PACKET];
84 HEADER *hp = (HEADER*) answer;
85 int n;
86
87 hp->rcode = NOERROR; /* default */
88
89 if ((_res.options & RES_INIT) == 0 && res_init() == -1)
90 {
91 h_errno = NETDB_INTERNAL;
92 return (-1);
93 }
94
95 if (_res.options & RES_DEBUG)
96 (*_printf) (";; res_query(%s, %d, %d)\n", name, Class, type);
97
98 n = res_mkquery (QUERY, name, Class, type, NULL, 0, NULL,
99 buf, sizeof(buf));
100 if (n <= 0)
101 {
102 if (_res.options & RES_DEBUG)
103 (*_printf) (";; res_query: mkquery failed\n");
104
105 h_errno = NO_RECOVERY;
106 return (n);
107 }
108 n = res_send (buf, n, answer, anslen);
109 if (n < 0)
110 {
111 if (_res.options & RES_DEBUG)
112 (*_printf) (";; res_query: send error\n");
113
114 h_errno = TRY_AGAIN;
115 return (n);
116 }
117
118 if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0)
119 {
120 if (_res.options & RES_DEBUG)
121 (*_printf) (";; rcode = %d, ancount=%d\n",
122 hp->rcode, ntohs(hp->ancount));
123
124 switch (hp->rcode)
125 {
126 case NXDOMAIN:
127 h_errno = HOST_NOT_FOUND;
128 break;
129 case SERVFAIL:
130 h_errno = TRY_AGAIN;
131 break;
132 case NOERROR:
133 h_errno = NO_DATA;
134 break;
135 case FORMERR:
136 case NOTIMP:
137 case REFUSED:
138 default:
139 h_errno = NO_RECOVERY;
140 break;
141 }
142 return (-1);
143 }
144 return (n);
145}
146
147/*
148 * Formulate a normal query, send, and retrieve answer in supplied buffer.
149 * Return the size of the response on success, -1 on error.
150 * If enabled, implement search rules until answer or unrecoverable failure
151 * is detected. Error code, if any, is left in h_errno.
152 */
153int W32_CALL res_search (const char *name, int Class, int type,
154 u_char *answer, int anslen)
155{
156 #define RDBG(x) (*_printf) ("res_search() = %d at line %u\n", x, __LINE__)
157
158 const char *cp;
159 const char *const *domain;
160 HEADER *hp = (HEADER *) answer;
161 u_int dots;
162 int trailing_dot, ret = -1;
163 int saved_herrno;
164 int got_nodata = 0;
165 int got_servfail = 0;
166 int tried_as_is = 0;
167 int done = 0;
168
169 if ((_res.options & RES_INIT) == 0 && res_init() == -1)
170 {
171 h_errno = NETDB_INTERNAL;
172 RDBG (-1);
173 return (-1);
174 }
175
176 SOCK_ERRNO (0);
177 h_errno = 0; /* default, if we never query */
178 dots = 0;
179
180 for (cp = name; *cp; cp++)
181 dots += (*cp == '.');
182
183 trailing_dot = 0;
184 if (cp > name && *--cp == '.')
185 trailing_dot++;
186
187 /* if there aren't any dots, it could be a user-level alias
188 */
189 if (!dots && (cp = __hostalias(name)) != NULL)
190 {
191 int rc = res_query (cp, Class, type, answer, anslen);
192 RDBG (rc);
193 return (rc);
194 }
195
196 /* If there are dots in the name already, let's just give it a try
197 * 'as is'. The threshold can be set with the "ndots" option.
198 */
199 saved_herrno = -1;
200 if (dots >= _res.ndots)
201 {
202 ret = res_querydomain (name, NULL, Class, type, answer, anslen);
203 if (ret > 0)
204 {
205 RDBG (ret);
206 return (ret);
207 }
208 saved_herrno = h_errno;
209 tried_as_is++;
210 }
211
212 /*
213 * We do at least one level of search if
214 * - there is no dot and RES_DEFNAME is set, or
215 * - there is at least one dot, there is no trailing dot,
216 * and RES_DNSRCH is set.
217 */
218 if ((!dots && (_res.options & RES_DEFNAMES)) ||
219 (dots && !trailing_dot && (_res.options & RES_DNSRCH)))
220 {
221 for (domain = (const char * const*)_res.dnsrch; *domain && !done; domain++)
222 {
223 ret = res_querydomain (name, *domain, Class, type, answer, anslen);
224 if (ret > 0)
225 {
226 RDBG (ret);
227 return (ret);
228 }
229
230 /*
231 * If no server present, give up.
232 * If name isn't found in this domain,
233 * keep trying higher domains in the search list
234 * (if that's enabled).
235 * On a NO_DATA error, keep trying, otherwise
236 * a wildcard entry of another type could keep us
237 * from finding this entry higher in the domain.
238 * If we get some other error (negative answer or
239 * server failure), then stop searching up,
240 * but try the input name below in case it's
241 * fully-qualified.
242 */
243 if (errno == ECONNREFUSED)
244 {
245 h_errno = TRY_AGAIN;
246 RDBG (-1);
247 return (-1);
248 }
249
250 switch (h_errno)
251 {
252 case NO_DATA:
253 got_nodata++;
254 /* fallthrough */
255 case HOST_NOT_FOUND:
256 /* keep trying */
257 break;
258 case TRY_AGAIN:
259 if (hp->rcode == SERVFAIL)
260 {
261 /* try next search element, if any */
262 got_servfail++;
263 break;
264 }
265 /* fallthrough */
266 default:
267 /* anything else implies that we're done */
268 done++;
269 }
270
271 /* if we got here for some reason other than DNSRCH,
272 * we only wanted one iteration of the loop, so stop.
273 */
274 if (!(_res.options & RES_DNSRCH))
275 done++;
276 }
277 }
278
279 /* if we have not already tried the name "as is", do that now.
280 * note that we do this regardless of how many dots were in the
281 * name or whether it ends with a dot.
282 */
283 if (!tried_as_is)
284 {
285 ret = res_querydomain (name, NULL, Class, type, answer, anslen);
286 if (ret > 0)
287 {
288 RDBG (ret);
289 return (ret);
290 }
291 }
292
293 /* if we got here, we didn't satisfy the search.
294 * if we did an initial full query, return that query's h_errno
295 * (note that we wouldn't be here if that query had succeeded).
296 * else if we ever got a nodata, send that back as the reason.
297 * else send back meaningless h_errno, that being the one from
298 * the last DNSRCH we did.
299 */
300 if (saved_herrno != -1)
301 h_errno = saved_herrno;
302
303 else if (got_nodata)
304 h_errno = NO_DATA;
305
306 else if (got_servfail)
307 h_errno = TRY_AGAIN;
308
309 if (done || h_errno == 0)
310 return (1);
311
312 TRACE_CONSOLE (1, "res_search() / h_errno = %d\n", h_errno);
313 RDBG (-1);
314 return (-1);
315}
316
317
318/*
319 * Perform a call on res_query on the concatenation of name and domain,
320 * removing a trailing dot from name if domain is NULL.
321 */
322int W32_CALL res_querydomain (const char *name, const char *domain, int Class,
323 int type, u_char *answer, int anslen)
324{
325 char nbuf [2*MAXDNAME+2];
326 const char *longname = nbuf;
327
328 if ((_res.options & RES_INIT) == 0 && res_init() == -1)
329 {
330 h_errno = NETDB_INTERNAL;
331 return (-1);
332 }
333
334 if (_res.options & RES_DEBUG)
335 (*_printf) (";; res_querydomain(%s, %s, %d, %d)\n",
336 name, domain ? domain : "<Nil>", Class, type);
337
338 if (!domain)
339 {
340 /* Check for trailing '.'; copy without '.' if present.
341 */
342 size_t len = strlen (name) - 1;
343
344 if (len < sizeof(nbuf)-1 && name[len] == '.')
345 {
346 memcpy (nbuf, name, len);
347 nbuf [len] = '\0';
348 }
349 else
350 longname = name;
351 }
352 else
353 {
354 /* won't overflow
355 */
356 sprintf (nbuf, "%.*s.%.*s", MAXDNAME, name, MAXDNAME, domain);
357 }
358
359 return res_query (longname, Class, type, answer, anslen);
360}
361
362/*
363 * Open and parse hostalias file. Lines may have comments ('#' or ';').
364 * Line format is:
365 * [ ].host[ ]*alias{#}.[\r\n]
366 */
367char * W32_CALL __hostalias (const char *name)
368{
369 const char *file;
370 char buf[BUFSIZ], *tok_buf = NULL;
371 static char abuf[MAXDNAME];
372 FILE *fp;
373
374 if (_res.options & RES_NOALIASES)
375 return (NULL);
376
377 file = getenv ("HOSTALIASES");
378 if (!file)
379 file = res_cfg_aliases;
380
381 if (!file || (fp = fopen(file, "r")) == NULL)
382 return (NULL);
383
384 abuf[0] = '\0';
385
386 while (fgets(buf, sizeof(buf), fp))
387 {
388 char *p, *host, *alias;
389
390 p = strltrim (buf);
391 if (!*p || *p == '\n' || *p == '#' || *p == ';')
392 continue;
393
394 host = strtok_r (p, " \t", &tok_buf);
395 alias = strtok_r (NULL, " \t\n", &tok_buf);
396 if (!host || !alias)
397 continue;
398
399 if (!stricmp(host, name))
400 {
401 _strlcpy (abuf, alias, sizeof(abuf)-1);
402 break;
403 }
404 }
405 fclose (fp);
406 return (abuf[0] ? abuf : NULL);
407}
408#endif /* USE_BIND */
409
strltrim
char * strltrim(char *s)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
res_mkquery
int W32_CALL res_mkquery(int op, const char *dname, int Class, int type, const u_char *data, int datalen, const u_char *newrr_in, u_char *buf, int buflen)
Definition: res_mkqu.c:67
resolver.h
HEADER
Definition: nameser_compat.h:50
HEADER::rcode
unsigned rcode
response code
Definition: nameser_compat.h:64
HEADER::ancount
unsigned ancount
number of answer entries
Definition: nameser_compat.h:82


Watt-32 tcp/ip: E:/WATT/src/res_send.c Source File

  • src
res_send.c
Go to the documentation of this file.
1
5/*
6 * ++Copyright++ 1985, 1989, 1993
7 * -
8 * Copyright (c) 1985, 1989, 1993
9 * The Regents of the University of California. All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 * -
39 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
40 *
41 * Permission to use, copy, modify, and distribute this software for any
42 * purpose with or without fee is hereby granted, provided that the above
43 * copyright notice and this permission notice appear in all copies, and that
44 * the name of Digital Equipment Corporation not be used in advertising or
45 * publicity pertaining to distribution of the document or software without
46 * specific, written prior permission.
47 *
48 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
49 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
50 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
51 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
52 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
53 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
54 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
55 * SOFTWARE.
56 * -
57 * --Copyright--
58 */
59
60/*
61 * 10.Dec-97 Adapted for Watt-32 TCP/IP - G. Vanem (gvanem@yahoo.no)
62 *
63 */
64
65/*
66 * Send query to name server and wait for reply.
67 */
68
69#include "resolver.h"
70
71#if defined(USE_BIND)
72
73static sock_type *sock = NULL; /* socket used for communications */
74static int vc = 0; /* is the socket a virtual ciruit? */
75static int connected = 0; /* is the socket connected */
76
77static int name_server_send (int ns, struct sockaddr_in *nsap);
78static void resolve_close (void);
79
80#define SAME_NS (-1)
81#define NEXT_NS (-2)
82
83
84#define Dprint(cond,args) if (cond) do { \
85 (*_printf) args; \
86 } while (0)
87
88#define DprintQ(cond,args,query,size) \
89 if (cond) do { \
90 (*_printf) args; \
91 __fp_nquery (query,size,stdout); \
92 } while (0)
93
94static void Aerror (const char *str, const char *error,
95 struct sockaddr_in address)
96{
97 if (_res.options & RES_DEBUG)
98 (*_printf) ("res_send: %s (%s/%u): %s\n",
99 str, inet_ntoa(address.sin_addr),
100 ntohs(address.sin_port), error);
101}
102
103static void Perror (const char *str, const char *error)
104{
105 if (_res.options & RES_DEBUG)
106 (*_printf) ("res_send: %s: %s\n", str, error);
107}
108
109static res_send_qhook Qhook = NULL;
110static res_send_rhook Rhook = NULL;
111
112void W32_CALL res_send_setqhook (res_send_qhook hook)
113{
114 Qhook = hook;
115}
116
117void W32_CALL res_send_setrhook (res_send_rhook hook)
118{
119 Rhook = hook;
120}
121
122/*
123 * int res_isourserver(ina)
124 * looks up "ina" in _res.ns_addr_list[]
125 * returns:
126 * 0 : not found
127 * >0 : found
128 * author:
129 * paul vixie, 29may94
130 */
131int W32_CALL res_isourserver (const struct sockaddr_in *inp)
132{
133 struct sockaddr_in ina = *inp;
134 int ns;
135
136 for (ns = 0; ns < _res.nscount; ns++)
137 {
138 const struct sockaddr_in *srv = &_res.nsaddr_list[ns];
139
140 if (srv->sin_family == ina.sin_family &&
141 srv->sin_port == ina.sin_port &&
142 (srv->sin_addr.s_addr == INADDR_ANY ||
143 srv->sin_addr.s_addr == ina.sin_addr.s_addr))
144 return (1);
145 }
146 return (0);
147}
148
149/*
150 * int res_nameinquery(name, type, class, buf, eom)
151 * look for (name,type,class) in the query section of packet (buf,eom)
152 * returns:
153 * -1 : format error
154 * 0 : not found
155 * >0 : found
156 * author:
157 * paul vixie, 29may94
158 */
159int W32_CALL res_nameinquery (const char *name, int type, int Class,
160 const u_char *buf, const u_char *eom)
161{
162 const u_char *cp = buf + HFIXEDSZ;
163 int qdcount = ntohs (((HEADER*)buf)->qdcount);
164
165 while (qdcount-- > 0)
166 {
167 char tname[MAXDNAME+1];
168 int n, ttype, tclass;
169
170 n = dn_expand (buf, eom, cp, tname, sizeof(tname));
171 if (n < 0)
172 return (-1);
173 cp += n;
174 ttype = _getshort (cp);
175 cp += INT16SZ;
176 tclass = _getshort (cp);
177 cp += INT16SZ;
178 if (ttype == type && tclass == Class && !stricmp(tname,name))
179 return (1);
180 }
181 return (0);
182}
183
184
185/*
186 * int res_queriesmatch(buf1, eom1, buf2, eom2)
187 * is there a 1:1 mapping of (name,type,Class)
188 * in (buf1,eom1) and (buf2,eom2)?
189 * returns:
190 * -1 : format error
191 * 0 : not a 1:1 mapping
192 * >0 : is a 1:1 mapping
193 * author:
194 * paul vixie, 29may94
195 */
196int W32_CALL res_queriesmatch (const u_char *buf1, const u_char *eom1,
197 const u_char *buf2, const u_char *eom2)
198{
199 const u_char *cp = buf1 + HFIXEDSZ;
200 int qdcount = ntohs (((HEADER*)buf1)->qdcount);
201
202 if (qdcount != ntohs(((HEADER*)buf2)->qdcount))
203 return (0);
204
205 while (qdcount-- > 0)
206 {
207 char tname[MAXDNAME+1];
208 int n, ttype, tclass;
209
210 n = dn_expand (buf1, eom1, cp, tname, sizeof(tname));
211 if (n < 0)
212 return (-1);
213 cp += n;
214 ttype = _getshort (cp);
215 cp += INT16SZ;
216 tclass = _getshort (cp);
217 cp += INT16SZ;
218 if (!res_nameinquery(tname, ttype, tclass, buf2, eom2))
219 return (0);
220 }
221 return (1);
222}
223
224/*--------------------------------------------------------------------*/
225
226static HEADER *hp, *anhp;
227static int gotsomewhere, connreset, terrno, Try;
228static int v_circuit, ns, n;
229static int ns_buflen, ns_anssiz;
230static u_long badns;
231static u_char *ns_buf, *ns_ans;
232
233int W32_CALL res_send (const u_char *buf, int buflen, u_char *ans, int anssiz)
234{
235 hp = (HEADER *) buf;
236 anhp = (HEADER *) ans;
237
238 ns_buf = (u_char*)buf;
239 ns_ans = ans;
240 ns_buflen = buflen;
241 ns_anssiz = anssiz;
242
243 if ((_res.options & RES_INIT) == 0 && res_init() == -1)
244 {
245 /* errno should have been set by res_init() in this case
246 */
247 return (-1);
248 }
249 DprintQ ((_res.options & RES_DEBUG) || (_res.pfcode & RES_PRF_QUERY),
250 (";; res_send()\n"), buf, buflen);
251
252 v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ;
253 gotsomewhere = 0;
254 connreset = 0;
255 terrno = ETIMEDOUT;
256 badns = 0;
257
258 /* Send request, RETRY times, or until successful
259 */
260 for (Try = 0; Try < _res.retry; Try++)
261 {
262 for (ns = 0; ns < _res.nscount; ns++)
263 {
264 struct sockaddr_in *nsap = &_res.nsaddr_list[ns];
265 int rc;
266
267 do
268 rc = name_server_send (ns, nsap);
269 while (rc == SAME_NS);
270
271 if (rc != NEXT_NS)
272 return (rc);
273 }
274 }
275
276 resolve_close();
277 if (!v_circuit)
278 {
279 if (!gotsomewhere)
280 SOCK_ERRNO (ECONNREFUSED); /* no nameservers found */
281 else SOCK_ERRNO (ETIMEDOUT); /* no answer obtained */
282 }
283 else
284 SOCK_ERRNO (terrno);
285 return (-1);
286}
287
288/*------------------------------------------------------------------------*/
289
290#if defined(_MSC_VER)
291 #define ERROR_TYPE int volatile /* because '&errno' is used below */
292#else
293 #define ERROR_TYPE int
294#endif
295
296static int tcp_conn (_tcp_Socket *sock, ERROR_TYPE *error, DWORD timeout)
297{
298 DWORD timer = set_timeout (timeout);
299 int status = _ip_delay0 ((sock_type*)sock, (int)timeout, NULL, NULL);
300
301 if (status == -1)
302 {
303 *error = chk_timeout(timer) ? ETIMEDOUT : ECONNREFUSED;
304 return (0);
305 }
306 *error = 0;
307 return (1);
308}
309
310/*------------------------------------------------------------------------*/
311
312static int tcp_read (_tcp_Socket *sock, u_char *buf, int len,
313 ERROR_TYPE *error, DWORD timeout)
314{
315 int status = _ip_delay1 ((sock_type*)sock, (int)timeout, NULL, NULL);
316
317 if (status == -1)
318 {
319 *error = ETIMEDOUT;
320 return (0);
321 }
322 if (status == 1)
323 {
324 *error = ECONNRESET;
325 return (0);
326 }
327 *error = 0;
328 return sock_fastread ((sock_type*)sock, (BYTE*)buf, len);
329}
330
331/*------------------------------------------------------------------------*/
332
333static int udp_read (_udp_Socket *sock, u_char *buf, int len,
334 ERROR_TYPE *error, DWORD timeout)
335{
336 int status = _ip_delay1 ((sock_type*)sock, (int)timeout, NULL, NULL);
337
338 if (status == -1)
339 {
340 *error = ETIMEDOUT;
341 return (0);
342 }
343 *error = 0;
344 return sock_fastread ((sock_type*)sock, (BYTE*)buf, len);
345}
346
347/*------------------------------------------------------------------------*/
348
349static int name_server_send (int ns, struct sockaddr_in *nsap)
350{
351 int resplen = 0;
352
353 if (badns & (1 << ns)) /* this NameServer already marked bad */
354 {
355 resolve_close();
356 return (NEXT_NS);
357 }
358
359 if (Qhook)
360 {
361 int done = 0;
362 int loops = 0;
363 do
364 {
365 res_sendhookact act = (*Qhook) (&nsap, (const u_char**)&ns_buf,
366 &ns_buflen, ns_ans, ns_anssiz,
367 &resplen);
368 switch (act)
369 {
370 case res_goahead:
371 done = 1;
372 break;
373 case res_nextns:
374 resolve_close();
375 return (NEXT_NS);
376 case res_done:
377 return (resplen);
378 case res_modified:
379 /* give the hook another try */
380 if (++loops < 42)
381 break;
382 /* fallthrough */
383 case res_error:
384 /* fallthrough */
385 default:
386 return (-1);
387 }
388 }
389 while (!done);
390 }
391
392 Dprint (_res.options & RES_DEBUG,
393 (";; Querying server (# %d) address = %s\n",
394 ns + 1, inet_ntoa(nsap->sin_addr)));
395
396 if (v_circuit) /* i.e. TCP */
397 {
398 int truncated, slen;
399 u_short len;
400 u_char *cp;
401
402 /* Use virtual circuit; at most one attempt per server.
403 */
404 Try = _res.retry;
405 truncated = 0;
406 if (!sock || !vc)
407 {
408 DWORD his_ip = ntohl (nsap->sin_addr.s_addr);
409 WORD his_port = ntohs (nsap->sin_port);
410
411 if (sock)
412 resolve_close();
413
414 sock = (sock_type*) calloc (sizeof(_tcp_Socket), 1);
415 if (!sock)
416 {
417 Perror ("calloc(vc)", "no memory");
418 return (-1);
419 }
420
421 if (!tcp_open(&sock->tcp,0,his_ip,his_port,NULL) ||
422 !tcp_conn(&sock->tcp,&errno,dns_timeout))
423 {
424 Aerror ("tcp_open/vc", "failed/timeout", *nsap);
425 badns |= (1 << ns);
426 resolve_close();
427 return (NEXT_NS);
428 }
429 vc = 1;
430 }
431
432 /* Send length & message
433 */
434 {
435 int send_len = INT16SZ + ns_buflen;
436 BYTE *send_buf = (BYTE*) alloca (send_len);
437
438 PUTSHORT (ns_buflen, send_buf);
439 memcpy (send_buf + INT16SZ, ns_buf, ns_buflen);
440 if (sock_write(sock,send_buf,send_len) != send_len)
441 {
442 Perror ("sock_write() failed", sockerr(sock));
443 badns |= (1 << ns);
444 resolve_close();
445 return (NEXT_NS);
446 }
447 }
448
449 /* Receive length & response
450 */
451 cp = ns_ans;
452 len = INT16SZ;
453 while ((n = tcp_read(&sock->tcp,cp,len,&errno,dns_timeout)) > 0)
454 {
455 cp += n;
456 len -= n;
457 slen = (int)len;
458 if (slen <= 0)
459 break;
460 }
461 if (n <= 0)
462 {
463 Perror ("tcp_read() failed", sockerr(sock));
464 resolve_close();
465 return (NEXT_NS);
466 }
467 resplen = _getshort (ns_ans);
468 if (resplen > ns_anssiz)
469 {
470 Dprint (_res.options & RES_DEBUG,(";; response truncated\n"));
471 truncated = 1;
472 len = ns_anssiz;
473 }
474 else
475 len = resplen;
476
477 cp = ns_ans;
478 while (len && (n = tcp_read(&sock->tcp,cp,len,&errno,dns_timeout)) > 0)
479 {
480 cp += n;
481 len -= n;
482 }
483 if (n <= 0)
484 {
485 Perror ("tcp_read(vc)",sockerr(sock));
486 resolve_close();
487 return (NEXT_NS);
488 }
489 if (truncated)
490 {
491 /* Flush rest of answer so connection stays in synch.
492 */
493 anhp->tc = 1;
494 len = resplen - ns_anssiz;
495 while (len)
496 {
497 u_char junk[PACKETSZ];
498
499 n = (len > sizeof(junk) ? sizeof(junk) : len);
500 n = tcp_read (&sock->tcp,junk,n,&errno,dns_timeout);
501 if (n > 0)
502 len -= n;
503 else break;
504 }
505 }
506 }
507 else /* !v_circuit, i.e. UDP */
508 {
509 DWORD timeout;
510
511 if (!sock || vc)
512 {
513 if (vc)
514 resolve_close();
515
516 sock = (sock_type*) calloc (sizeof(_udp_Socket), 1);
517 if (!sock)
518 {
519 Perror ("calloc(dg)", "no memory");
520 return (-1);
521 }
522 connected = 0;
523 }
524
525 /* Connect only if we are sure we won't
526 * receive a response from another server.
527 */
528 if (!connected)
529 {
530 DWORD his_ip = ntohl (nsap->sin_addr.s_addr);
531 WORD his_port = ntohs (nsap->sin_port);
532
533 if (!udp_open(&sock->udp,0,his_ip,his_port,NULL))
534 {
535 Aerror ("connect/dg", "ARP failed", *nsap);
536 badns |= (1 << ns);
537 resolve_close();
538 return (NEXT_NS);
539 }
540 connected = 1;
541 }
542 if (sock_write(sock,(const BYTE*)ns_buf,ns_buflen) != ns_buflen)
543 {
544 Perror ("sock_write() failed", "");
545 badns |= (1 << ns);
546 resolve_close();
547 return (NEXT_NS);
548 }
549
550 /* Wait for reply
551 */
552 timeout = (unsigned)_res.retrans << Try;
553 if (Try > 0)
554 timeout /= _res.nscount;
555 if ((long)timeout <= 0)
556 timeout = 1;
557
558 wait:
559
560 n = udp_read (&sock->udp, ns_ans, ns_anssiz, &errno, timeout);
561 if (n == 0)
562 {
563 Dprint (_res.options & RES_DEBUG, (";; timeout\n"));
564 gotsomewhere = 1;
565 resolve_close();
566 return (NEXT_NS);
567 }
568 gotsomewhere = 1;
569 if (hp->id != anhp->id)
570 {
571 /* response from old query, ignore it.
572 * XXX - potential security hazard could be detected here.
573 */
574 DprintQ ((_res.options & RES_DEBUG) || (_res.pfcode & RES_PRF_REPLY),
575 (";; old answer:\n"), ns_ans, resplen);
576 goto wait;
577 }
578
579 if (!(_res.options & RES_INSECURE2) &&
580 !res_queriesmatch(ns_buf, ns_buf+ns_buflen, ns_ans, ns_ans+ns_anssiz))
581 {
582 /* response contains wrong query? ignore it.
583 * XXX - potential security hazard could be detected here.
584 */
585 DprintQ ((_res.options & RES_DEBUG) || (_res.pfcode & RES_PRF_REPLY),
586 (";; wrong query name:\n"), ns_ans, resplen);
587 goto wait;
588 }
589 if (anhp->rcode == SERVFAIL ||
590 anhp->rcode == NOTIMP ||
591 anhp->rcode == REFUSED)
592 {
593 DprintQ (_res.options & RES_DEBUG,("server rejected query:\n"),
594 ns_ans,resplen);
595 badns |= (1 << ns);
596 resolve_close();
597
598 /* don't retry if called from dig */
599 if (!_res.pfcode)
600 return (NEXT_NS);
601 }
602 if (!(_res.options & RES_IGNTC) && anhp->tc)
603 {
604 /* get rest of answer; use TCP with same server.
605 */
606 Dprint (_res.options & RES_DEBUG, (";; truncated answer\n"));
607 v_circuit = 1;
608 resolve_close();
609 return (SAME_NS);
610 }
611 } /* if vcicuit / dg */
612
613 Dprint ((_res.options & RES_DEBUG) ||
614 ((_res.pfcode & RES_PRF_REPLY) && (_res.pfcode & RES_PRF_HEAD1)),
615 (";; got answer:\n"));
616
617 DprintQ ((_res.options & RES_DEBUG) || (_res.pfcode & RES_PRF_REPLY),
618 (" \b"), ns_ans, resplen);
619
620 /*
621 * If using virtual circuits (TCP), we assume that the first server
622 * is preferred over the rest (i.e. it is on the local machine) and
623 * only keep that one open. If we have temporarily opened a virtual
624 * circuit, or if we haven't been asked to keep a socket open,
625 * close the socket.
626 */
627 if ((v_circuit && (!(_res.options & RES_USEVC) || ns != 0)) ||
628 !(_res.options & RES_STAYOPEN))
629 resolve_close();
630
631 if (Rhook)
632 {
633 int done = 0, loops = 0;
634
635 do
636 {
637 res_sendhookact act = (*Rhook) (nsap, ns_buf, ns_buflen,
638 ns_ans, ns_anssiz, &resplen);
639 switch (act)
640 {
641 case res_goahead:
642 case res_done:
643 done = 1;
644 break;
645 case res_nextns:
646 resolve_close();
647 return (NEXT_NS);
648 case res_modified:
649 /* give the hook another try */
650 if (++loops < 42)
651 break;
652 /* fallthrough */
653 case res_error:
654 /* fallthrough */
655 default:
656 return (-1);
657 }
658 }
659 while (!done);
660 }
661 return (resplen);
662}
663
664/*
665 * This routine is for closing the socket if a virtual circuit is used and
666 * the program wants to close it. This provides support for endhostent()
667 * which expects to close the socket.
668 *
669 * This routine is not expected to be user visible.
670 */
671static void resolve_close (void)
672{
673 if (sock)
674 {
675 sock_close (sock);
676
677 if (sock->tcp.ip_type == TCP_PROTO &&
678 sock->tcp.state < tcp_StateCLOSED)
679 TCP_ABORT (&sock->tcp);
680
681 free (sock);
682 sock = NULL;
683 connected = 0;
684 vc = 0;
685 }
686}
687#endif /* USE_BIND */
688
tcp_read
static int tcp_read(_tcp_Socket *s, BYTE *buf, int maxlen)
Read from a TCP socket.
Definition: pctcp.c:1825
udp_read
static int udp_read(_udp_Socket *s, BYTE *buf, int maxlen)
Read from UDP socket.
Definition: pctcp.c:1574
tcp_open
int W32_CALL tcp_open(_tcp_Socket *s, WORD lport, DWORD ip, WORD rport, ProtoHandler handler)
Actively open a TCP connection.
Definition: pctcp.c:328
udp_open
int W32_CALL udp_open(_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP active open.
Definition: pctcp.c:262
resolver.h
HEADER
Definition: nameser_compat.h:50
HEADER::rcode
unsigned rcode
response code
Definition: nameser_compat.h:64
HEADER::tc
unsigned tc
truncated message
Definition: nameser_compat.h:57
HEADER::id
unsigned id
query identification number
Definition: nameser_compat.h:51
sockaddr_in
Definition: in.h:224
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/inc/resolv.h Source File

  • inc
resolv.h
Go to the documentation of this file.
1
5/*-
6 * Copyright (c) 1983, 1987, 1989, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * -
38 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
39 *
40 * Permission to use, copy, modify, and distribute this software for any
41 * purpose with or without fee is hereby granted, provided that the above
42 * copyright notice and this permission notice appear in all copies, and that
43 * the name of Digital Equipment Corporation not be used in advertising or
44 * publicity pertaining to distribution of the document or software without
45 * specific, written prior permission.
46 *
47 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
48 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
50 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
51 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
52 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
53 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
54 * SOFTWARE.
55 * -
56 * --Copyright--
57 */
58
59#ifndef _RESOLV_H_
60#define _RESOLV_H_
61
62#include <stdio.h>
63
64#ifndef __SYS_W32API_H
65#include <sys/w32api.h>
66#endif
67
68#ifndef __SYS_PARAM_H
69#include <sys/param.h>
70#endif
71
72#ifndef __SYS_WTYPES_H
73#include <sys/wtypes.h>
74#endif
75
76#ifndef __SYS_CDEFS_H
77#include <sys/cdefs.h>
78#endif
79
80#ifndef __ARPA_NAMESER_H
81#include <arpa/nameser.h>
82#endif
83
84/*
85 * revision information. this is the release date in YYYYMMDD format.
86 * it can change every day so the right thing to do with it is use it
87 * in preprocessor commands such as "#if (__RES > 19931104)". do not
88 * compare for equality; rather, use it to determine whether your resolver
89 * is new enough to contain a certain feature.
90 */
91
92#define __RES 19960229
93
94/*
95 * Resolver configuration file.
96 * Normally not present, but may contain the address of the
97 * inital name server(s) to query and the domain search list.
98 */
99
100#ifndef _PATH_RESCONF
101#define _PATH_RESCONF "/etc/resolv.conf"
102#endif
103
104/*
105 * Global defines and variables for resolver stub.
106 */
107#define MAXNS 3 /* max # name servers we'll track */
108#define MAXDFLSRCH 3 /* # default domain levels to try */
109#define MAXDNSRCH 6 /* max # domains in search path */
110#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
111
112#define RES_TIMEOUT 5 /* min. seconds between retries */
113#define MAXRESOLVSORT 10 /* number of net to sort on */
114#define RES_MAXNDOTS 15 /* should reflect bit field size */
115
116#ifndef MAXDNAME
117#define MAXDNAME 1025 /* maximum domain name */
118#endif
119
120struct __res_sort {
121 struct in_addr addr;
122 u_long mask;
123 };
124
125struct __res_state {
126 int retrans; /* retransmition time interval */
127 int retry; /* number of times to retransmit */
128 u_long options; /* option flags - see below. */
129 int nscount; /* number of name servers */
130 struct sockaddr_in
131 nsaddr_list[MAXNS]; /* address of name server */
132#define nsaddr nsaddr_list[0] /* for backward compatibility */
133 u_short id; /* current packet id */
134 char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
135 char defdname[MAXDNAME]; /* default domain */
136 u_long pfcode; /* RES_PRF_ flags - see below. */
137 unsigned ndots : 4; /* threshold for initial abs. query */
138 unsigned nsort : 4; /* number of elements in sort_list[] */
139 char unused[3];
140 struct __res_sort sort_list [MAXRESOLVSORT];
141 char pad[72]; /* On an i386 this means 512b total. */
142 };
143
144/*
145 * Resolver options (keep these in synch with res_debug.c, please)
146 */
147#define RES_INIT 0x00000001 /* address initialized */
148#define RES_DEBUG 0x00000002 /* print debug messages */
149#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
150#define RES_USEVC 0x00000008 /* use virtual circuit */
151#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
152#define RES_IGNTC 0x00000020 /* ignore truncation errors */
153#define RES_RECURSE 0x00000040 /* recursion desired */
154#define RES_DEFNAMES 0x00000080 /* use default domain name */
155#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
156#define RES_DNSRCH 0x00000200 /* search up local domain tree */
157#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
158#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
159#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
160#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
161
162#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
163
164/*
165 * Resolver "pfcode" values. Used by dig.
166 */
167#define RES_PRF_STATS 0x00000001
168/* 0x00000002 */
169#define RES_PRF_CLASS 0x00000004
170#define RES_PRF_CMD 0x00000008
171#define RES_PRF_QUES 0x00000010
172#define RES_PRF_ANS 0x00000020
173#define RES_PRF_AUTH 0x00000040
174#define RES_PRF_ADD 0x00000080
175#define RES_PRF_HEAD1 0x00000100
176#define RES_PRF_HEAD2 0x00000200
177#define RES_PRF_TTLID 0x00000400
178#define RES_PRF_HEADX 0x00000800
179#define RES_PRF_QUERY 0x00001000
180#define RES_PRF_REPLY 0x00002000
181#define RES_PRF_INIT 0x00004000
182/* 0x00008000 */
183
184/* hooks are still experimental as of 4.9.2 */
185typedef enum {
186 res_goahead,
187 res_nextns,
188 res_modified,
189 res_done,
190 res_error
191 } res_sendhookact;
192
193typedef res_sendhookact (W32_CALL *res_send_qhook) (
194 struct sockaddr_in * const *ns,
195 const u_char **query,
196 int *querylen,
197 u_char *ans,
198 int anssiz,
199 int *resplen);
200
201typedef res_sendhookact (W32_CALL *res_send_rhook) (
202 const struct sockaddr_in *ns,
203 const u_char *query,
204 int querylen,
205 u_char *ans,
206 int anssiz,
207 int *resplen);
208
209W32_DATA struct __res_state _res;
210
211W32_DATA int h_errno;
212
213
214/* Private routines shared between libc/net, named, nslookup and others. */
215#define res_hnok __res_hnok
216#define res_ownok __res_ownok
217#define res_mailok __res_mailok
218#define res_dnok __res_dnok
219#define loc_ntoa __loc_ntoa
220#define loc_aton __loc_aton
221#define dn_skipname __dn_skipname
222#define fp_query __fp_query
223#define fp_nquery __fp_nquery
224#define hostalias __hostalias
225#define putlong __putlong
226#define putshort __putshort
227#define p_class __p_class
228#define p_time __p_time
229#define p_type __p_type
230#define p_cdnname __p_cdnname
231#define p_cdname __p_cdname
232#define p_fqname __p_fqname
233#define p_rr __p_rr
234#define p_option __p_option
235#define res_randomid __res_randomid
236#define res_isourserver __res_isourserver
237#define res_nameinquery __res_nameinquery
238#define res_queriesmatch __res_queriesmatch
239
240__BEGIN_DECLS
241
242W32_FUNC int W32_CALL __res_hnok (const char *);
243W32_FUNC int W32_CALL __res_ownok (const char *);
244W32_FUNC int W32_CALL __res_mailok (const char *);
245W32_FUNC int W32_CALL __res_dnok (const char *);
246W32_FUNC int W32_CALL __loc_aton (const char *ascii, u_char *binary);
247W32_FUNC char * W32_CALL __loc_ntoa (const u_char *binary, char *ascii);
248W32_FUNC int W32_CALL __dn_skipname(const u_char *, const u_char *);
249W32_FUNC void W32_CALL __fp_resstat (struct __res_state *, FILE *);
250W32_FUNC void W32_CALL __fp_query (const u_char *, FILE *);
251W32_FUNC void W32_CALL __fp_nquery (const u_char *, int, FILE *);
252W32_FUNC char *W32_CALL __hostalias (const char *);
253W32_FUNC void W32_CALL __putlong (u_long, u_char *);
254W32_FUNC void W32_CALL __putshort (u_short, u_char *);
255W32_FUNC char *W32_CALL __p_time (u_long);
256W32_FUNC void W32_CALL __p_query (const u_char *);
257
258W32_FUNC const u_char *W32_CALL __p_cdnname (const u_char *, const u_char *, int, FILE *);
259W32_FUNC const u_char *W32_CALL __p_cdname (const u_char *, const u_char *, FILE *);
260W32_FUNC const u_char *W32_CALL __p_fqname (const u_char *, const u_char *, FILE *);
261W32_FUNC const u_char *W32_CALL __p_rr (const u_char *, const u_char *, FILE *);
262W32_FUNC const char *W32_CALL __p_type (int);
263W32_FUNC const char *W32_CALL __p_class (int);
264W32_FUNC const char *W32_CALL __p_option (u_long option);
265
266W32_FUNC int W32_CALL dn_comp (const char *, u_char *, int, u_char **, u_char **);
267W32_FUNC int W32_CALL dn_expand (const u_char *, const u_char *, const u_char *, char *, int);
268
269W32_FUNC int W32_CALL res_init (void);
270W32_FUNC u_short W32_CALL res_randomid (void);
271W32_FUNC int W32_CALL res_query (const char *, int, int, u_char *, int);
272W32_FUNC int W32_CALL res_search (const char *, int, int, u_char *, int);
273W32_FUNC int W32_CALL res_querydomain (const char *, const char *, int, int, u_char *, int);
274W32_FUNC int W32_CALL res_mkquery (int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int);
275W32_FUNC int W32_CALL res_send (const u_char *, int, u_char *, int);
276W32_FUNC int W32_CALL res_isourserver (const struct sockaddr_in *);
277W32_FUNC int W32_CALL res_nameinquery (const char *, int, int, const u_char *, const u_char *);
278W32_FUNC int W32_CALL res_queriesmatch (const u_char *, const u_char *, const u_char *, const u_char *);
279
280W32_FUNC void W32_CALL res_send_setqhook (res_send_qhook hook);
281W32_FUNC void W32_CALL res_send_setrhook (res_send_rhook hook);
282
283__END_DECLS
284
285#endif /* !_RESOLV_H_ */
cdefs.h
nameser.h
param.h
res_mkquery
W32_FUNC int W32_CALL res_mkquery(int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int)
Definition: res_mkqu.c:67
__res_sort
Definition: resolv.h:120
__res_state
Definition: resolv.h:125
in_addr
Definition: in.h:143
sockaddr_in
Definition: in.h:224
w32api.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/src/resolver.h Source File

  • src
resolver.h
Go to the documentation of this file.
1
5/* ++Copyright++
6 * -
7 * Copyright (c)
8 * The Regents of the University of California. All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 * -
38 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
39 *
40 * Permission to use, copy, modify, and distribute this software for any
41 * purpose with or without fee is hereby granted, provided that the above
42 * copyright notice and this permission notice appear in all copies, and that
43 * the name of Digital Equipment Corporation not be used in advertising or
44 * publicity pertaining to distribution of the document or software without
45 * specific, written prior permission.
46 *
47 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
48 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
50 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
51 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
52 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
53 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
54 * SOFTWARE.
55 * -
56 * --Copyright--
57 */
58
59/* Key:
60 * ucb = U C Berkeley 4.8.3 release
61 * vix = Paul Vixie of Digital
62 * del = Don Lewis of Harris
63 * mcsun = Piet Beertema of EUNet
64 * asp = Andrew Partan of UUNet
65 * pma = Paul Albitz of Hewlett Packard
66 * bb = Bryan Beecher of UMich
67 * mpa = Mark Andrews of CSIRO - DMS
68 * rossc = Ross Cartlidge of The Univeritsy of Sydney
69 * mtr = Marshall Rose of TPC.INT
70 * bg = Benoit Grange of INRIA
71 * ckd = Christopher Davis of Kapor Enterprises
72 * gns = Greg Shapiro of WPI
73 */
74
75/*
76 * 10.Dec-97 Adapted for Waterloo TCP/IP - G. Vanem (gvanem@yahoo.no)
77 *
78 */
79
80#ifndef _w32_RESOLVER_H_
81#define _w32_RESOLVER_H_
82
83#if defined(__TURBOC__) && (__TURBOC__ <= 0x301)
84 /*
85 * Prevent tcc <= 2.01 from ever looking at this.
86 */
87#else
88
89#include <stdio.h>
90#include <stdlib.h>
91#include <string.h>
92#include <errno.h>
93#include <ctype.h>
94#include <sys/socket.h>
95#include <arpa/nameser.h>
96#include <arpa/inet.h>
97#include <netdb.h>
98#include <resolv.h>
99
100#include "wattcp.h"
101#include "misc.h"
102#include "misc_str.h"
103#include "run.h"
104#include "timer.h"
105#include "bsdname.h"
106#include "sock_ini.h"
107#include "netaddr.h"
108#include "pcdns.h"
109#include "netaddr.h"
110#include "pcbuf.h"
111#include "pcdbug.h"
112#include "pctcp.h"
113#include "pcconfig.h"
114
115/* We export these since they are needed in e.g.e nslookup
116 */
117W32_DATA const char *_res_opcodes[];
118W32_DATA const char *_res_resultcodes[];
119
120W32_DATA char *res_cfg_options, *res_cfg_aliases;
121
122W32_FUNC void W32_CALL res_init0 (void);
123
124#define CHECK_SRVR_ADDR 1 /* check nameserver address in responses */
125#define RESOLVSORT 1 /* allow sorting of addresses in gethostbyname (mpa) */
126#define RFC1535 1 /* use RFC 1535 default for "search" list (vix) */
127#define ALLOW_T_UNSPEC 0 /* enable the "unspec" RR type for old athena (ucb) */
128#define ALLOW_UPDATES 0 /* 1: enable updating resource records */
129
130#endif /* old __TURBOC__ */
131#endif /* _w32_RESOLVER_H_ */
bsdname.h
errno.h
socket.h
inet.h
misc.h
misc_str.h
nameser.h
netaddr.h
netdb.h
pcbuf.h
pcconfig.h
pcdbug.h
pcdns.h
pctcp.h
resolv.h
sock_ini.h
timer.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/inc/net/route.h Source File

  • inc
  • net
route.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1980, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NET_ROUTE_H
39#define __NET_ROUTE_H
40
41#include <sys/socket.h>
42
43/*
44 * Kernel resident routing tables.
45 *
46 * The routing tables are initialized when interface addresses
47 * are set by making entries for all directly connected interfaces.
48 */
49
50/*
51 * A route consists of a destination address and a reference
52 * to a routing entry. These are often held by protocols
53 * in their control blocks, e.g. inpcb.
54 */
55struct route {
56 struct rtentry *ro_rt;
57 struct sockaddr ro_dst;
58};
59
60/*
61 * These numbers are used by reliable protocols for determining
62 * retransmission behavior and are included in the routing structure.
63 */
64struct rt_metrics {
65 u_long rmx_locks; /* Kernel must leave these values alone */
66 u_long rmx_mtu; /* MTU for this path */
67 u_long rmx_hopcount; /* max hops expected */
68 u_long rmx_expire; /* lifetime for route, e.g. redirect */
69 u_long rmx_recvpipe; /* inbound delay-bandwith product */
70 u_long rmx_sendpipe; /* outbound delay-bandwith product */
71 u_long rmx_ssthresh; /* outbound gateway buffer limit */
72 u_long rmx_rtt; /* estimated round trip time */
73 u_long rmx_rttvar; /* estimated rtt variance */
74 u_long rmx_pksent; /* packets sent using this route */
75};
76
77/*
78 * rmx_rtt and rmx_rttvar are stored as microseconds;
79 * RTTTOPRHZ(rtt) converts to a value suitable for use
80 * by a protocol slowtimo counter.
81 */
82#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */
83#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
84
85/*
86 * We distinguish between routes to hosts and routes to networks,
87 * preferring the former if available. For each route we infer
88 * the interface to use from the gateway address supplied when
89 * the route was entered. Routes that forward packets through
90 * gateways are marked so that the output routines know to address the
91 * gateway rather than the ultimate destination.
92 */
93#ifndef RNF_NORMAL
94#include <net/radix.h>
95#endif
96
97struct rtentry {
98 struct radix_node rt_nodes[2]; /* tree glue, and other values */
99#define rt_key(r) ((struct sockaddr *)((r)->rt_nodes->rn_key))
100#define rt_mask(r) ((struct sockaddr *)((r)->rt_nodes->rn_mask))
101 struct sockaddr *rt_gateway; /* value */
102 short rt_flags; /* up/down?, host/net */
103 short rt_refcnt; /* # held references */
104 u_long rt_use; /* raw # packets forwarded */
105 struct ifnet *rt_ifp; /* the answer: interface to use */
106 struct ifaddr *rt_ifa; /* the answer: interface to use */
107 struct sockaddr *rt_genmask; /* for generation of cloned routes */
108 caddr_t rt_llinfo; /* pointer to link level info cache */
109 struct rt_metrics rt_rmx; /* metrics used by rx'ing protocols */
110 struct rtentry *rt_gwroute; /* implied entry for gatewayed routes */
111};
112
113/*
114 * Following structure necessary for 4.3 compatibility;
115 * We should eventually move it to a compat file.
116 */
117struct ortentry {
118 u_int32_t rt_hash; /* to speed lookups */
119 struct sockaddr rt_dst; /* key */
120 struct sockaddr rt_gateway; /* value */
121 int16_t rt_flags; /* up/down?, host/net */
122 int16_t rt_refcnt; /* # held references */
123 u_int32_t rt_use; /* raw # packets forwarded */
124 struct ifnet *rt_ifp; /* the answer: interface to use */
125};
126
127#define RTF_UP 0x1 /* route usable */
128#define RTF_GATEWAY 0x2 /* destination is a gateway */
129#define RTF_HOST 0x4 /* host entry (net otherwise) */
130#define RTF_REJECT 0x8 /* host or net unreachable */
131#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */
132#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */
133#define RTF_DONE 0x40 /* message confirmed */
134#define RTF_MASK 0x80 /* subnet mask present */
135#define RTF_CLONING 0x100 /* generate new routes on use */
136#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
137#define RTF_LLINFO 0x400 /* generated by ARP or ESIS */
138#define RTF_STATIC 0x800 /* manually added */
139#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */
140#define RTF_PROTO2 0x4000 /* protocol specific routing flag */
141#define RTF_PROTO1 0x8000 /* protocol specific routing flag */
142
143
144/*
145 * Routing statistics.
146 */
147struct rtstat {
148 short rts_badredirect; /* bogus redirect calls */
149 short rts_dynamic; /* routes created by redirects */
150 short rts_newgateway; /* routes modified by redirects */
151 short rts_unreach; /* lookups which failed */
152 short rts_wildcard; /* lookups satisfied by a wildcard */
153};
154/*
155 * Structures for routing messages.
156 */
157struct rt_msghdr {
158 u_short rtm_msglen; /* to skip over non-understood messages */
159 u_char rtm_version; /* future binary compatibility */
160 u_char rtm_type; /* message type */
161 u_short rtm_index; /* index for associated ifp */
162 int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
163 int rtm_addrs; /* bitmask identifying sockaddrs in msg */
164 int rtm_pid; /* identify sender */
165 int rtm_seq; /* for sender to identify action */
166 int rtm_errno; /* why failed */
167 int rtm_use; /* from rtentry */
168 u_long rtm_inits; /* which metrics we are initializing */
169 struct rt_metrics rtm_rmx; /* metrics themselves */
170};
171
172#define RTM_VERSION 3 /* Up the ante and ignore older versions */
173
174#define RTM_ADD 0x1 /* Add Route */
175#define RTM_DELETE 0x2 /* Delete Route */
176#define RTM_CHANGE 0x3 /* Change Metrics or flags */
177#define RTM_GET 0x4 /* Report Metrics */
178#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */
179#define RTM_REDIRECT 0x6 /* Told to use different route */
180#define RTM_MISS 0x7 /* Lookup failed on this address */
181#define RTM_LOCK 0x8 /* fix specified metrics */
182#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */
183#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */
184#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */
185#define RTM_NEWADDR 0xc /* address being added to iface */
186#define RTM_DELADDR 0xd /* address being removed from iface */
187#define RTM_IFINFO 0xe /* iface going up/down etc. */
188
189#define RTV_MTU 0x1 /* init or lock _mtu */
190#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */
191#define RTV_EXPIRE 0x4 /* init or lock _hopcount */
192#define RTV_RPIPE 0x8 /* init or lock _recvpipe */
193#define RTV_SPIPE 0x10 /* init or lock _sendpipe */
194#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */
195#define RTV_RTT 0x40 /* init or lock _rtt */
196#define RTV_RTTVAR 0x80 /* init or lock _rttvar */
197
198/*
199 * Bitmask values for rtm_addr.
200 */
201#define RTA_DST 0x1 /* destination sockaddr present */
202#define RTA_GATEWAY 0x2 /* gateway sockaddr present */
203#define RTA_NETMASK 0x4 /* netmask sockaddr present */
204#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */
205#define RTA_IFP 0x10 /* interface name sockaddr present */
206#define RTA_IFA 0x20 /* interface addr sockaddr present */
207#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */
208#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */
209
210/*
211 * Index offsets for sockaddr array for alternate internal encoding.
212 */
213#define RTAX_DST 0 /* destination sockaddr present */
214#define RTAX_GATEWAY 1 /* gateway sockaddr present */
215#define RTAX_NETMASK 2 /* netmask sockaddr present */
216#define RTAX_GENMASK 3 /* cloning mask sockaddr present */
217#define RTAX_IFP 4 /* interface name sockaddr present */
218#define RTAX_IFA 5 /* interface addr sockaddr present */
219#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */
220#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */
221#define RTAX_MAX 8 /* size of array to allocate */
222
223struct rt_addrinfo {
224 int rti_addrs;
225 struct sockaddr *rti_info[RTAX_MAX];
226};
227
228struct route_cb {
229 int ip_count;
230 int ns_count;
231 int iso_count;
232 int any_count;
233};
234
235#endif
socket.h
radix.h
ifaddr
Definition: if.h:250
ifnet
Definition: if.h:136
ortentry
Definition: route.h:117
radix_node
Definition: radix.h:59
route_cb
Definition: route.h:228
route
Definition: route.h:55
rt_addrinfo
Definition: route.h:223
rt_metrics
Definition: route.h:64
rt_msghdr
Definition: route.h:157
rtentry
Definition: route.h:97
rtstat
Definition: route.h:147
sockaddr
Definition: socket.h:181


Watt-32 tcp/ip: E:/WATT/inc/protocol/routed.h Source File

  • inc
  • protocol
routed.h
Go to the documentation of this file.
1
5/*-
6 * Copyright (c) 1983, 1989, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __PROTOCOL_ROUTED_H
39#define __PROTOCOL_ROUTED_H
40
41#include <sys/wtypes.h>
42
43/*
44 * Routing Information Protocol
45 *
46 * Derived from Xerox NS Routing Information Protocol
47 * by changing 32-bit net numbers to sockaddr's and
48 * padding stuff to 32-bit boundaries.
49 */
50
51#define RIP_VERSION_0 0
52#define RIP_VERSION_1 1
53#define RIP_VERSION_2 2
54
55#define RIPv1 RIP_VERSION_1
56#define RIPv2 RIP_VERSION_2
57#ifndef RIPVERSION
58#define RIPVERSION RIPv1
59#endif
60
61#define RIP_PORT 520
62
63#include <sys/pack_on.h>
64
65#if RIPVERSION == 1
66/* We include the V2 fields to get the right size */
67struct netinfo {
68 u_int16_t rip_family;
69 u_int16_t rip_tag;
70 u_int32_t rip_dst; /* destination net/host */
71 u_int32_t rip_dst_mask; /* destination mask (V2 only) */
72 u_int32_t rip_router; /* next host (V2 only) */
73 u_int32_t rip_metric; /* cost of route */
74};
75#else
76struct netinfo {
77 u_int16_t n_family;
78#define RIP_AF_INET htons(AF_INET)
79#define RIP_AF_UNSPEC 0
80#define RIP_AF_AUTH 0xffff
81 u_int16_t n_tag; /* optional in RIPv2 */
82 u_int32_t n_dst; /* destination net or host */
83#define RIP_DEFAULT 0
84 u_int32_t n_mask; /* netmask in RIPv2 */
85 u_int32_t n_nhop; /* optional next hop in RIPv2 */
86 u_int32_t n_metric; /* cost of route */
87};
88#endif
89
90/* RIPv2 authentication */
91struct netauth {
92 u_int16_t a_family; /* always RIP_AF_AUTH */
93 u_int16_t a_type;
94#define RIP_AUTH_NONE 0
95#define RIP_AUTH_PW htons(2) /* password type */
96#define RIP_AUTH_MD5 htons(3) /* Keyed MD5 */
97 union {
98#define RIP_AUTH_PW_LEN 16
99 u_int8_t au_pw[RIP_AUTH_PW_LEN];
100 struct a_md5 {
101 int16_t md5_pkt_len; /* RIP-II packet length */
102 int8_t md5_keyid; /* key ID and auth data len */
103 int8_t md5_auth_len; /* 16 */
104 u_int32_t md5_seqno; /* sequence number */
105 u_int32_t rsvd[2]; /* must be 0 */
106#define RIP_AUTH_MD5_LEN RIP_AUTH_PW_LEN
107 } a_md5;
108 } au;
109};
110
111struct rip {
112 u_int8_t rip_cmd; /* request/response */
113 u_int8_t rip_vers; /* protocol version # */
114 u_int16_t rip_res1; /* pad to 32-bit boundary */
115 union { /* variable length... */
116 struct netinfo ru_nets[1];
117 int8_t ru_tracefile[1];
118 struct netauth ru_auth[1];
119 } ripun;
120#define rip_nets ripun.ru_nets
121#define rip_auths ripun.ru_auth
122#define rip_tracefile ripun.ru_tracefile
123};
124
125#include <sys/pack_off.h>
126
127/* Packet types.
128 */
129#define RIPCMD_REQUEST 1 /* want info */
130#define RIPCMD_RESPONSE 2 /* responding to request */
131#define RIPCMD_TRACEON 3 /* turn tracing on */
132#define RIPCMD_TRACEOFF 4 /* turn it off */
133
134/* Gated extended RIP to include a "poll" command instead of using
135 * RIPCMD_REQUEST with (RIP_AF_UNSPEC, RIP_DEFAULT). RFC 1058 says
136 * command 5 is used by Sun Microsystems for its own purposes.
137 */
138#define RIPCMD_POLL 5
139
140#define RIPCMD_MAX 6
141
142#ifdef RIPCMDS
143char *ripcmds[RIPCMD_MAX] = {
144 "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF"
145};
146#endif
147
148#define HOPCNT_INFINITY 16
149#define MAXPACKETSIZE 512 /* max broadcast size */
150#define NETS_LEN ((MAXPACKETSIZE-sizeof(struct rip)) \
151 / sizeof(struct netinfo) +1)
152
153#define INADDR_RIP_GROUP (u_int32_t)0xe0000009 /* 224.0.0.9 */
154
155
156/* Timer values used in managing the routing table.
157 *
158 * Complete tables are broadcast every SUPPLY_INTERVAL seconds.
159 * If changes occur between updates, dynamic updates containing only changes
160 * may be sent. When these are sent, a timer is set for a random value
161 * between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates
162 * are sent until the timer expires.
163 *
164 * Every update of a routing entry forces an entry's timer to be reset.
165 * After EXPIRE_TIME without updates, the entry is marked invalid,
166 * but held onto until GARBAGE_TIME so that others may see it, to
167 * "poison" the bad route.
168 */
169#define SUPPLY_INTERVAL 30 /* time to supply tables */
170#define MIN_WAITTIME 2 /* min sec until next flash updates */
171#define MAX_WAITTIME 5 /* max sec until flash update */
172
173#define STALE_TIME 90 /* switch to a new gateway */
174#define EXPIRE_TIME 180 /* time to mark entry invalid */
175#define GARBAGE_TIME 240 /* time to garbage collect */
176
177#endif
pack_off.h
pack_on.h
netauth
Definition: routed.h:91
netinfo
Definition: routed.h:67
rip
Definition: routed.h:111
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/rpc/rpc.h Source File

  • inc
  • rpc
rpc.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * rpc.h, Just includes the billions of rpc header files necessary to
36 * do remote procedure calling.
37 *
38 * Copyright (C) 1984, Sun Microsystems, Inc.
39 */
40#ifndef __RPC_RPC_H
41#define __RPC_RPC_H
42
43#include <rpc/types.h> /* some typedefs */
44
45/* external data representation interfaces */
46#include <rpc/xdr.h> /* generic (de)serializer */
47
48/* Client side only authentication */
49#include <rpc/auth.h> /* generic authenticator (client side) */
50
51/* Client side (mostly) remote procedure call */
52#include <rpc/clnt.h> /* generic rpc stuff */
53
54/* semi-private protocol headers */
55#include <rpc/rpc_msg.h> /* protocol for rpc messages */
56#include <rpc/auth_uni.h> /* protocol for unix style cred */
57
58/*
59 * Uncomment-out the next line if you are building the rpc library with
60 * DES Authentication (see the README file in the secure_rpc/ directory).
61 */
62#if 1
63#include <rpc/auth_des.h> /* protocol for des style cred */
64#endif
65
66/* Server side only remote procedure callee */
67#include <rpc/svc.h> /* service manager and multiplexer */
68#include <rpc/svc_auth.h> /* service side authenticator */
69
70/*
71 * COMMENT OUT THE NEXT INCLUDE (or add to the #ifndef) IF RUNNING ON
72 * A VERSION OF UNIX THAT USES SUN'S NFS SOURCE. These systems will
73 * already have the structures defined by <rpc/netdb.h> included in <netdb.h>.
74 */
75/* routines for parsing /etc/rpc */
76
77struct rpcent {
78 char *r_name; /* name of server for this rpc program */
79 char **r_aliases; /* alias list */
80 long r_number; /* rpc program number. */
81}; /* Must be 32-bit for small/large model */
82
83__BEGIN_DECLS
84
85extern struct rpcent *getrpcbyname (char *);
86extern struct rpcent *getrpcbynumber(long);
87extern struct rpcent *getrpcent (void);
88extern void setrpcent (int);
89extern void endrpcent (void);
90
91#if defined(__MSDOS__) || defined(__TURBOC__) || defined(__HIGHC__) || \
92 defined(__DJGPP__) || defined(__WATCOMC__)
93
94 /* from RPC-DOS v0.1Alpha by Mike Durkin <mdurkin@tsoft.net> */
95 /* updated by G.Vanem <gvanem@yahoo.no> */
96
97 extern void rpc_init (void);
98 extern void set_user_id (u_long uid);
99 extern void set_group_id (u_long gid);
100
101 extern u_long __geteuid (void);
102 extern u_long __getegid (void);
103#endif
104
105__END_DECLS
106
107#endif
auth.h
auth_des.h
auth_uni.h
clnt.h
rpc_msg.h
rpcent
Definition: rpc.h:77
svc.h
svc_auth.h
types.h
xdr.h


Watt-32 tcp/ip: E:/WATT/inc/rpc/rpc_msg.h Source File

  • inc
  • rpc
rpc_msg.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * rpc_msg.h
36 * rpc message definition
37 *
38 * Copyright (C) 1984, Sun Microsystems, Inc.
39 */
40
41#ifndef __RPC_RPC_MSG_H
42#define __RPC_RPC_MSG_H
43
44#include <rpc/auth.h>
45
46#define RPC_MSG_VERSION ((u_long) 2)
47#define RPC_SERVICE_PORT ((u_short) 2048)
48
49/*
50 * Bottom up definition of an rpc message.
51 * NOTE: call and reply use the same overall stuct but
52 * different parts of unions within it.
53 */
54#undef CALL
55#undef REPLY
56
57enum msg_type {
58 CALL=0,
59 REPLY=1
60};
61
62enum reply_stat {
63 MSG_ACCEPTED=0,
64 MSG_DENIED=1
65};
66
67#undef SUCCESS
68
69enum accept_stat {
70 SUCCESS=0,
71 PROG_UNAVAIL=1,
72 PROG_MISMATCH=2,
73 PROC_UNAVAIL=3,
74 GARBAGE_ARGS=4,
75 SYSTEM_ERR=5
76};
77
78enum reject_stat {
79 RPC_MISMATCH=0,
80 AUTH_ERROR=1
81};
82
83/*
84 * Reply part of an rpc exchange
85 */
86
87#include <sys/pack_on.h>
88
89/*
90 * Reply to an rpc request that was accepted by the server.
91 * Note: there could be an error even though the request was
92 * accepted.
93 */
94struct accepted_reply {
95 struct opaque_auth ar_verf;
96 enum accept_stat ar_stat;
97 union {
98 struct {
99 u_long low;
100 u_long high;
101 } AR_versions;
102 struct {
103 caddr_t where;
104 xdrproc_t proc;
105 } AR_results;
106 /* and many other null cases */
107 } ru;
108#define ar_results ru.AR_results
109#define ar_vers ru.AR_versions
110};
111
112/*
113 * Reply to an rpc request that was rejected by the server.
114 */
115struct rejected_reply {
116 enum reject_stat rj_stat;
117 union {
118 struct {
119 u_long low;
120 u_long high;
121 } RJ_versions;
122 enum auth_stat RJ_why; /* why authentication did not work */
123 } ru;
124#define rj_vers ru.RJ_versions
125#define rj_why ru.RJ_why
126};
127
128/*
129 * Body of a reply to an rpc request.
130 */
131struct reply_body {
132 enum reply_stat rp_stat;
133 union {
134 struct accepted_reply RP_ar;
135 struct rejected_reply RP_dr;
136 } ru;
137#define rp_acpt ru.RP_ar
138#define rp_rjct ru.RP_dr
139};
140
141/*
142 * Body of an rpc request call.
143 */
144struct call_body {
145 u_long cb_rpcvers; /* must be equal to two */
146 u_long cb_prog;
147 u_long cb_vers;
148 u_long cb_proc;
149 struct opaque_auth cb_cred;
150 struct opaque_auth cb_verf; /* protocol specific - provided by client */
151};
152
153/*
154 * The rpc message
155 */
156struct rpc_msg {
157 u_long rm_xid;
158 enum msg_type rm_direction;
159 union {
160 struct call_body RM_cmb;
161 struct reply_body RM_rmb;
162 } ru;
163#define rm_call ru.RM_cmb
164#define rm_reply ru.RM_rmb
165};
166#define acpted_rply ru.RM_rmb.ru.RP_ar
167#define rjcted_rply ru.RM_rmb.ru.RP_dr
168
169#include <sys/pack_off.h>
170
171__BEGIN_DECLS
172
173/*
174 * XDR routine to handle a rpc message.
175 * xdr_callmsg(xdrs, cmsg)
176 * XDR *xdrs;
177 * struct rpc_msg *cmsg;
178 */
179extern bool_t xdr_callmsg (XDR *, struct rpc_msg *);
180
181/*
182 * XDR routine to pre-serialize the static part of a rpc message.
183 * xdr_callhdr(xdrs, cmsg)
184 * XDR *xdrs;
185 * struct rpc_msg *cmsg;
186 */
187extern bool_t xdr_callhdr (XDR *, struct rpc_msg *);
188
189/*
190 * XDR routine to handle a rpc reply.
191 * xdr_replymsg(xdrs, rmsg)
192 * XDR *xdrs;
193 * struct rpc_msg *rmsg;
194 */
195extern bool_t xdr_replymsg (XDR *, struct rpc_msg *);
196
197/*
198 * Fills in the error part of a reply message.
199 * _seterr_reply(msg, error)
200 * struct rpc_msg *msg;
201 * struct rpc_err *error;
202 */
203struct rpc_err;
204extern void _seterr_reply (struct rpc_msg *, struct rpc_err *);
205
206__END_DECLS
207
208#endif
auth.h
pack_off.h
pack_on.h
XDR
Definition: xdr.h:116
accepted_reply
Definition: rpc_msg.h:94
call_body
Definition: rpc_msg.h:144
opaque_auth
Definition: auth.h:99
proc
Definition: if.h:81
rejected_reply
Definition: rpc_msg.h:115
reply_body
Definition: rpc_msg.h:131
rpc_err
Definition: clnt.h:94
rpc_msg
Definition: rpc_msg.h:156


Watt-32 tcp/ip: E:/WATT/inc/protocol/rwhod.h Source File

  • inc
  • protocol
rwhod.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1983 The Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 */
38
39#ifndef __PROTOCOL_RWHOD_H
40#define __PROTOCOL_RWHOD_H
41
42#include <sys/wtypes.h>
43
44#include <sys/pack_on.h>
45
46/*
47 * rwho protocol packet format.
48 */
49struct outmp {
50 char out_line[8]; /* tty name */
51 char out_name[8]; /* user id */
52 int32_t out_time; /* time on */
53};
54
55struct whod {
56 char wd_vers; /* protocol version # */
57 char wd_type; /* packet type, see below */
58 char wd_pad[2];
59 int32_t wd_sendtime; /* time stamp by sender */
60 int32_t wd_recvtime; /* time stamp applied by receiver */
61 char wd_hostname[32]; /* hosts's name */
62 int32_t wd_loadav[3]; /* load average as in uptime */
63 int32_t wd_boottime; /* time system booted */
64 struct whoent {
65 struct outmp we_utmp; /* active tty info */
66 int32_t we_idle; /* tty idle time */
67 } wd_we[1024 / sizeof (struct whoent)];
68};
69
70#include <sys/pack_off.h>
71
72#define WHODVERSION 1
73#define WHODTYPE_STATUS 1 /* host status */
74
75#define _PATH_RWHODIR "/var/rwho"
76
77#endif
pack_off.h
pack_on.h
outmp
Definition: rwhod.h:49
whod::whoent
Definition: rwhod.h:64
whod
Definition: rwhod.h:55
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/netinet6/scope6_v.h Source File

  • inc
  • netinet6
scope6_v.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 2000 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#ifndef _NETINET6_SCOPE6_VAR_H_
34#define _NETINET6_SCOPE6_VAR_H_
35
36#ifdef _KERNEL
37void scope6_ifattach (struct ifnet *);
38int scope6_set (struct ifnet *, u_int32_t *);
39int scope6_get (struct ifnet *, u_int32_t *);
40void scope6_setdefault (struct ifnet *);
41int scope6_get_default (u_int32_t *);
42u_int32_t scope6_in6_addrscope (struct in6_addr *);
43u_int32_t scope6_addr2default (struct in6_addr *);
44#endif /* _KERNEL */
45
46#endif /* _NETINET6_SCOPE6_VAR_H_ */
ifnet
Definition: if.h:136
in6_addr
Definition: in.h:151


Watt-32 tcp/ip: E:/WATT/src/select.c Source File

  • src
select.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 * 0.6 : Nov 05, 1999 : G. Vanem - several changes;
37 * Protect select-loop as critical region.
38 * Changed criteria for read/writeability.
39 */
40
41#include <sys/poll.h>
42#include "socket.h"
43
44#if defined(USE_BSD_API)
45
46#ifdef __HIGHC__ /* set warning for stack-usage */
47#pragma stack_size_warn (16000) /* ~3*MAX_SOCKETS */
48#endif
49
50#ifndef STDIN_FILENO
51#define STDIN_FILENO 0
52#endif
53
54#ifndef STDOUT_FILENO
55#define STDOUT_FILENO 1
56#endif
57
58#ifndef STDERR_FILENO
59#define STDERR_FILENO 2
60#endif
61
62/*
63 * Select sockets for read, write or exceptions
64 * Returns 1 if socket is ready or
65 * Returns 0 if socket isn't selectable
66 */
67static int read_select (int s, Socket *socket);
68static int write_select (int s, Socket *socket);
69static int exc_select (int s, Socket *socket);
70
71static int select_one (int fd, Socket *socket, int events);
72static int poll_one (int fd, Socket *socket, int events);
73
74/*
75 * Setup for read/write/except_select()
76 */
77static __inline Socket *setup_select (int s, BOOL first_loop)
78{
79 Socket *socket = _socklist_find (s);
80
81 if (first_loop && !socket)
82 {
83 if (_sock_dos_fd(s))
84 {
85 SOCK_DEBUGF ((", ENOTSOCK (%d)", s));
86 SOCK_ERRNO (ENOTSOCK);
87 }
88 else
89 {
90 SOCK_DEBUGF ((", EBADF (%d)", s));
91 SOCK_ERRNO (EBADF);
92 }
93 }
94 return (socket);
95}
96
107int W32_CALL select_s (int nfds, fd_set *readfds, fd_set *writefds,
108 fd_set *exceptfds, struct timeval *timeout)
109{
110 fd_set tmp_read [NUM_SOCK_FDSETS];
111 fd_set tmp_write [NUM_SOCK_FDSETS];
112 fd_set tmp_except[NUM_SOCK_FDSETS];
113 struct timeval starttime, now, expiry = {0, 0 };
114
115 int num_fd = nfds;
116 int ret_count = 0;
117 BOOL expired = FALSE;
118 BOOL loop_1st = TRUE;
119 int s, loops;
120
121#if defined(USE_DEBUG)
122 unsigned total_rd = 0;
123 unsigned total_wr = 0;
124 unsigned total_ex = 0;
125#endif
126
127 SOCK_DEBUGF (("\nselect_s: n=0-%d, %c%c%c", num_fd-1,
128 readfds ? 'r' : '-',
129 writefds ? 'w' : '-',
130 exceptfds ? 'x' : '-'));
131
132
133 /* num_fd == 0 is permitted. Often used to perform delays:
134 * select (0,NULL,NULL,NULL,&tv);
135 *
136 * Some programs uses -1 to mean all possible sockets.
137 */
138 if (num_fd > MAX_SOCKETS || num_fd < 0)
139 num_fd = MAX_SOCKETS;
140
141 if (timeout)
142 {
143 if ((long)timeout->tv_sec < 0 || timeout->tv_usec < 0)
144 {
145 SOCK_DEBUGF ((", EINVAL (negative timeout)"));
146 SOCK_ERRNO (EINVAL);
147 return (-1);
148 }
149
150 gettimeofday2 (&starttime, NULL); /* initialize start time */
151
152 expiry.tv_sec = starttime.tv_sec + timeout->tv_sec;
153 expiry.tv_usec = starttime.tv_usec + timeout->tv_usec;
154 while (expiry.tv_usec >= 1000000L)
155 {
156 expiry.tv_usec -= 1000000L;
157 expiry.tv_sec++;
158 }
159
160 SOCK_DEBUGF ((", timeout %lu.%06lds",
161 (u_long)timeout->tv_sec, timeout->tv_usec));
162 }
163 else
164 SOCK_DEBUGF ((", timeout undef"));
165
166
172 memset (tmp_read, 0, sizeof(tmp_read));
173 memset (tmp_write, 0, sizeof(tmp_write));
174 memset (tmp_except, 0, sizeof(tmp_except));
175
176 /* Not safe to run sock_daemon() (or other "tasks") now
177 */
178 _sock_crit_start();
179 _sock_sig_setup();
180
181 /*
182 * Loop until specified timeout expires or event(s) satisfied.
183 */
184 for (loop_1st = TRUE, loops = 1;; loop_1st = FALSE, loops++)
185 {
186 tcp_tick (NULL);
187
188 for (s = 0; s < num_fd; s++)
189 {
190 /* read/write/except counters for socket 's'
191 */
192 int revents, events = 0;
193 int read_cnt = 0, write_cnt = 0, exc_cnt = 0;
194 Socket *socket = NULL;
195
196 if (readfds && FD_ISSET(s,readfds))
197 events |= POLLIN;
198
199 if (writefds && FD_ISSET(s,writefds))
200 events |= POLLOUT;
201
202 if (exceptfds && FD_ISSET(s,exceptfds))
203 events |= POLLPRI;
204
205 if (events && s >= SK_FIRST)
206 {
207 socket = setup_select (s, loop_1st);
208 if (!socket) /* skip this fd */
209 events = 0;
210 }
211
212 revents = select_one (s, socket, events);
213
214 if (revents & POLLIN)
215 {
216 read_cnt = 1;
217 FD_SET (s, &tmp_read[0]);
218 }
219
220 if (revents & POLLOUT)
221 {
222 write_cnt = 1;
223 FD_SET (s, &tmp_write[0]);
224 }
225
226 if (revents & POLLPRI)
227 {
228 exc_cnt = 1;
229 FD_SET (s, &tmp_except[0]);
230 }
231
232 /* Increment the return and total counters (may increment by 0)
233 */
234 ret_count += (read_cnt + write_cnt + exc_cnt);
235
236#if defined(USE_DEBUG)
237 total_rd += read_cnt;
238 total_wr += write_cnt;
239 total_ex += exc_cnt;
240#endif
241
242 SOCK_DBUG_FLUSH();
243
244 } /* end of for loop; all sockets checked at least once */
245
246 if (timeout)
247 {
248 gettimeofday2 (&now, NULL);
249 if (now.tv_sec > expiry.tv_sec ||
250 (now.tv_sec == expiry.tv_sec && now.tv_usec >= expiry.tv_usec))
251 expired = TRUE;
252 }
253
254 /* If atleast 1 event is set.
255 */
256 if (ret_count > 0)
257 {
258 SOCK_DEBUGF ((", cnt=%d (%dr/%dw/%dx)",
259 ret_count, total_rd, total_wr, total_ex));
260
261 /* Copy our working fd_sets to output fd_sets
262 */
263 for (s = 0; s < num_fd; s++)
264 {
265 if (readfds)
266 {
267 if (FD_ISSET(s, &tmp_read[0]))
268 FD_SET (s, readfds);
269 else FD_CLR (s, readfds);
270 }
271 if (writefds)
272 {
273 if (FD_ISSET(s, &tmp_write[0]))
274 FD_SET (s, writefds);
275 else FD_CLR (s, writefds);
276 }
277 if (exceptfds)
278 {
279 if (FD_ISSET(s, &tmp_except[0]))
280 FD_SET (s, exceptfds);
281 else FD_CLR (s, exceptfds);
282 }
283 }
284
285 /* Do as Linux and return the time left of the period.
286 * NB! The 'tv_sec' can be negative if select_s() took too long.
287 */
288 if (timeout)
289 {
290#if defined(W32_NO_8087)
291 *timeout = timeval_diff2(&now, &expiry);
292#else
293 double remaining = timeval_diff (&now, &expiry);
294
295 timeout->tv_sec = (long)(remaining / 1E6);
296 timeout->tv_usec = (long)remaining % 1000000UL;
297#endif
298 }
299 break;
300 }
301
302 if (expired)
303 {
304#if defined(W32_NO_8087) && defined(USE_DEBUG)
305 struct timeval diff = timeval_diff2(&now, &starttime);
306 SOCK_DEBUGF ((", timeout!: %d.%03u", diff.tv_sec, diff.tv_usec));
307#else
308 SOCK_DEBUGF ((", timeout!: %.6fs", timeval_diff(&now, &starttime)/1E6));
309#endif
310
311 if (readfds)
312 for (s = 0; s < num_fd; s++)
313 FD_CLR (s, readfds);
314
315 if (writefds)
316 for (s = 0; s < num_fd; s++)
317 FD_CLR (s, writefds);
318
319 if (exceptfds)
320 for (s = 0; s < num_fd; s++)
321 FD_CLR (s, exceptfds);
322
323 ret_count = 0; /* should already be 0 */
324 break;
325 }
326
327 /* Poll for caught signals (SIGINT/SIGALRM)
328 */
329 if (_sock_sig_pending())
330 {
331 SOCK_DEBUGF ((", EINTR"));
332 SOCK_ERRNO (EINTR);
333 ret_count = -1;
334 break;
335 }
336
337 WATT_YIELD();
338 }
339
340 _sock_sig_restore();
341 _sock_crit_stop();
342
343 return (ret_count);
344}
345
346#if !defined(__DJGPP__)
347int W32_CALL select (int nfds, fd_set *read_fds, fd_set *write_fds,
348 fd_set *except_fds, struct timeval *timeout)
349{
350 return select_s (nfds, read_fds, write_fds, except_fds, timeout);
351}
352#endif
353
354/*
355 * POSIX poll() function.
356 */
357int W32_CALL poll (struct pollfd *p, int num, int timeout_ms)
358{
359 DWORD timeout_at = 0;
360 int i, ret = 0;
361
362 SOCK_DEBUGF (("\npoll: n=%d", num));
363
364 if (num < 0 || num > MAX_SOCKETS)
365 {
366 SOCK_DEBUGF ((", EINVAL"));
367 SOCK_ERRNO (EINVAL);
368 return (-1);
369 }
370
371 VERIFY_RW (p, num * sizeof (struct pollfd));
372
373 if (timeout_ms > 0)
374 {
375 SOCK_DEBUGF ((", timeout %lu ms", (u_long)timeout_ms));
376 timeout_at = set_timeout (timeout_ms);
377 }
378 else if (timeout_ms < 0)
379 {
380 SOCK_DEBUGF ((", no timeout"));
381 }
382
383 _sock_sig_setup();
384
385 /*
386 * Loop until specified timeout expires or event(s) satisfied.
387 */
388 while (1)
389 {
390 tcp_tick (NULL);
391
392 for (i = 0; i < num; ++i)
393 {
394 Socket *socket = NULL;
395 const int fd = p[i].fd;
396
397 if (fd < 0)
398 goto poll_invalid;
399 if (fd >= SK_FIRST)
400 {
401 socket = _socklist_find (fd);
402 if (!socket)
403 goto poll_invalid;
404 }
405
406 p[i].revents = poll_one (fd, socket, p[i].events);
407 if (p[i].revents)
408 ++ret;
409 continue;
410
411 poll_invalid:
412 p[i].revents = POLLNVAL;
413 ++ret;
414 }
415
416 if (ret || timeout_ms == 0)
417 {
418 SOCK_DEBUGF ((", ret=%d", ret));
419 break;
420 }
421
422 if (timeout_ms > 0 && chk_timeout (timeout_at))
423 {
424 SOCK_DEBUGF ((", timeout!"));
425 break;
426 }
427
428 /* Poll for caught signals (SIGINT/SIGALRM)
429 */
430 if (_sock_sig_pending())
431 {
432 SOCK_DEBUGF ((", EINTR"));
433 SOCK_ERRNO (EINTR);
434 ret = -1;
435 break;
436 }
437
438 WATT_YIELD();
439 }
440
441 _sock_sig_restore();
442
443 return (ret);
444}
445
446#if defined(__DJGPP__) && defined(USE_FSEXT)
447/*
448 * Check one socket. Called by libc select().
449 */
450int _fsext_ready (int fd)
451{
452 Socket *socket;
453 int revents, ret = 0;
454
455 tcp_tick (NULL);
456
457 socket = _socklist_find (fd);
458 if (!socket)
459 return (-1);
460
461 revents = select_one (fd, socket, POLLIN | POLLOUT | POLLPRI);
462
463 if (revents & POLLIN)
464 ret |= __FSEXT_ready_read;
465 if (revents & POLLOUT)
466 ret |= __FSEXT_ready_write;
467 if (revents & POLLPRI)
468 ret |= __FSEXT_ready_error;
469
470 return (ret);
471}
472#endif /* __DJGPP__ && USE_FSEXT */
473
474#ifdef NOT_YET
475int pselect (int nfds, fd_set *readfds, fd_set *writefds,
476 fd_set *exceptfds, struct timespec *timeout,
477 const sigset_t *sigmask)
478{
479 struct timeval tv;
480 sigset_t old_mask;
481 int rc;
482
483 if (timeout)
484 {
485 tv.tv_sec = tv_sec;
486 tv_tv_nsec = 1000UL * tv_usec;
487 }
488 if (sigmask)
489 sigprocmask (SIG_BLOCK, sigmask, &old_mask);
490
491 rc = select (nfds, readfs, writefds, exceptfds, timeout ? &tv : NULL);
492
493 if (sigmask)
494 sigprocmask (SIG_UNBLOCK, &old_mask, NULL);
495
496 return (rc);
497}
498#endif
499
500/*
501 * Check listen-queue for first connected TCB.
502 * Only called for listening (accepting) sockets.
503 */
504static __inline int listen_queued (Socket *socket)
505{
506 int i;
507
508 for (i = 0; i < socket->backlog && i < DIM(socket->listen_queue); i++)
509 {
510 _tcp_Socket *tcb = socket->listen_queue[i];
511
512 if (!tcb)
513 continue;
514
515 /* Socket has reached Established state or receive data above
516 * low water mark. This means, socket may have reached Closed,
517 * but this still counts as a readable event.
518 */
519 if (tcb->state == tcp_StateESTAB ||
520 sock_rbused((sock_type*)tcb) > socket->recv_lowat)
521 return (1);
522 }
523 return (0);
524}
525
526/*
527 * Return TRUE if socket has any of the state flags set in MASK, or a
528 * non-zero SO_ERROR.
529 *
530 * This signalled read/write state is assumed to persist for the
531 * remaining life of the socket.
532 */
533#define READ_STATE_MASK (SS_CANTRCVMORE) /* set in recv() or shutdown() */
534#define WRITE_STATE_MASK (SS_CANTSENDMORE)
535
536static __inline int sock_signalled (Socket *socket, int mask)
537{
538 if (socket->so_state & mask)
539 return (1);
540
541 return (socket->so_error);
542}
543
544#if defined(__MSDOS__)
545/*
546 * Check if a standard handle is ready.
547 * This should return TRUE if handle is redirected.
548 */
549static BOOL handle_ready (int hnd)
550{
551 union REGS regs;
552
553#if defined(__HIGHC__) || defined(__DMC__)
554 regs.x.ax = 0x4406;
555 regs.x.bx = hnd;
556#else
557 regs.w.ax = 0x4406;
558 regs.w.bx = hnd;
559#endif
560
561 intdos (&regs, &regs);
562 return (regs.h.al == 0xFF); /* ready character device */
563}
564#else
565#define handle_ready(hnd) 0
566#endif
567
568/*
569 * Check if 's' can be read from.
570 */
571static int read_select (int s, Socket *socket)
572{
573 if (s == STDIN_FILENO)
574 {
575#if defined(__DJGPP__) && 0
576 struct timeval tv = { 0, 0 };
577 fd_set rd;
578 int rc;
579
580 FD_ZERO (&rd);
581 FD_SET (STDIN_FILENO, &rd);
582 rc = (select) (1, &rd, NULL, NULL, &tv);
583 return (rc == 1 ? 1 : 0);
584#else
585 return (watt_kbhit() || handle_ready(STDIN_FILENO));
586#endif
587 }
588
589 if (s <= STDERR_FILENO)
590 return (0);
591
592 if (socket->so_type == SOCK_PACKET)
593 return sock_packet_rbused (socket) ? 1 : 0;
594
595 if (socket->so_type == SOCK_RAW)
596 {
597#if defined(USE_IPV6)
598 if (socket->so_family == AF_INET6)
599 return sock_rbused ((sock_type*)socket->raw6_sock) ? 1 : 0;
600#endif
601 return sock_rbused ((sock_type*)socket->raw_sock) ? 1 : 0;
602 }
603
604 if (socket->so_type == SOCK_DGRAM)
605 {
606 size_t len;
607
608 if (socket->so_state & SS_PRIV)
609 len = sock_recv_used ((sock_type*)socket->udp_sock);
610 else len = sock_rbused ((sock_type*)socket->udp_sock);
611
612 if (len > socket->recv_lowat ||
613 sock_signalled(socket,READ_STATE_MASK))
614 return (1);
615 return (0);
616 }
617
618 if (socket->so_type == SOCK_STREAM)
619 {
620 sock_type *sk = (sock_type*) socket->tcp_sock;
621
622 if (socket->so_options & SO_ACCEPTCONN) /* incoming connection */
623 return (listen_queued (socket));
624
625 if (sk->tcp.state >= tcp_StateLASTACK) /* got FIN from peer */
626 return (1);
627
628 if (sock_rbused(sk) > socket->recv_lowat) /* Rx-data above low-limit */
629 return (1);
630 }
631 return (0);
632}
633
634/*
635 * Check if 's' can be written to.
636 */
637static int write_select (int s, Socket *socket)
638{
639#if defined(__DJGPP__) && 0
640 if (s == STDOUT_FILENO || s == STDERR_FILENO)
641 {
642 struct timeval tv = { 0, 0 };
643 fd_set wr;
644 int rc;
645
646 FD_ZERO (&wr);
647 FD_SET (s, &wr);
648 rc = (select) (1, NULL, &wr, NULL, &tv);
649 return (rc == 1 ? 1 : 0);
650 }
651#else
652 if (s == STDOUT_FILENO)
653 return !ferror (stdout);
654
655 if (s == STDERR_FILENO)
656 return !ferror (stderr);
657#endif
658
659 if (s == STDIN_FILENO)
660 return (0);
661
662 /* SOCK_PACKET, SOCK_RAW and SOCK_DGRAM sockets are always writable
663 */
664 if (socket->so_type == SOCK_PACKET ||
665 socket->so_type == SOCK_RAW ||
666 socket->so_type == SOCK_DGRAM)
667 return (1);
668
669 if (socket->so_type == SOCK_STREAM)
670 {
671 sock_type *sk = (sock_type*) socket->tcp_sock;
672
673 if (sk->tcp.state >= tcp_StateESTCL)
674 return (1);
675
676 if (sock_tbleft(sk) > socket->send_lowat) /* Tx room above low-limit */
677 return (1);
678 }
679 return (0);
680}
681
682/*
683 * Check 's' for exception or faulty condition.
684 */
685static int exc_select (int s, Socket *socket)
686{
687 if (s < SK_FIRST)
688 return (0);
689
692#if 0
693 if (sock_signalled(socket, READ_STATE_MASK|WRITE_STATE_MASK))
694 return (1);
695#endif
696
697 ARGSUSED (socket);
698 return (0);
699}
700
701/*
702 * Check if socket hasn't connected yet.
703 * Status will be updated by _sock_pending_connect().
704 */
705static BOOL still_connecting (Socket *socket)
706{
707 if ((socket->so_state & SS_ISCONNECTING) &&
708 _sock_pending_connect (socket))
709 return (TRUE);
710 return (FALSE);
711}
712
713/*
714 * Check one socket for select().
715 */
716static int select_one (int fd, Socket *socket, int events)
717{
718 int revents = 0;
719 BOOL connecting = FALSE;
720
721 if (socket)
722 connecting = still_connecting (socket);
723
724 if (events & POLLIN) /* check if readable or error */
725 {
726 if (read_select (fd, socket) ||
727 (socket && sock_signalled (socket, READ_STATE_MASK)))
728 revents |= POLLIN;
729 }
730
731 if ((events & POLLOUT) && /* check if writable or error */
732 !connecting) /* skip if still connecting */
733 {
734 if (write_select (fd, socket) ||
735 (socket && sock_signalled (socket, WRITE_STATE_MASK)))
736 revents |= POLLOUT;
737 }
738
739 if (events & POLLPRI) /* check for OOB data */
740 {
741 if (exc_select (fd, socket))
742 revents |= POLLPRI;
743 }
744
745 return (revents);
746}
747
748/*
749 * Check one socket for poll().
750 */
751static int poll_one (int fd, Socket *socket, int events)
752{
753 int revents = 0;
754 BOOL connecting = FALSE;
755
756 if (socket)
757 {
758 connecting = still_connecting (socket);
759
760 if (socket->so_state & SS_CANTSENDMORE) /* connection closed */
761 revents |= POLLHUP;
762
763 if (socket->so_error != 0) /* error state set */
764 revents |= POLLERR;
765 }
766
767 if (events & POLLIN) /* check if readable */
768 {
769 if (read_select (fd, socket))
770 revents |= POLLIN;
771 }
772
773 if ((events & POLLOUT) && /* check if writable */
774 !(revents & POLLHUP) && /* but skip if closed */
775 !connecting) /* or still connecting */
776 {
777 if (write_select (fd, socket))
778 revents |= POLLOUT;
779 }
780
781 if (events & POLLPRI) /* check for OOB data */
782 {
783 if (exc_select (fd, socket))
784 revents |= POLLPRI;
785 }
786
787 return (revents);
788}
789
790#endif /* USE_BSD_API */
791
792
793/*
794 * A small test program (for djgpp/Watcom/HighC/DMC)
795 */
796#if defined(TEST_PROG)
797
798#include <time.h>
799
800#ifndef __CYGWIN__
801#include <conio.h>
802#endif
803
804#if defined(HAVE_UNISTD_H)
805#include <unistd.h>
806#endif
807
808void usage (const char *argv0)
809{
810 fprintf (stderr,
811 "Usage: %s [-s select_size] [-w micro-sec] [-hid]\n"
812 "\t\t -s set the number of fd's to select for (default 1)\n"
813 "\t\t -w time to wait in select (default 0.5)\n"
814 "\t\t -h don't use 8254 hi-resolution timer function\n"
815 "\t\t -i use timer ISR (init_timer_isr)\n"
816 "\t\t -d write debug to wattcp.sk/wattcp.dbg\n", argv0);
817 exit (-1);
818}
819
820char *fd_set_str (char *buf, size_t len, const fd_set *fd)
821{
822 char *p = buf;
823 char *end = buf + len;
824 int i, num;
825
826#if 0
827 p += sprintf (p, "%d: ", fd->fd_count);
828#endif
829
830 for (i = 0, num = 0; i < 8 * FD_SETSIZE; i++)
831 {
832 if (FD_ISSET(i, fd))
833 {
834 p += sprintf (p, "%d,", i);
835 num++;
836 }
837 if (p > end - 12)
838 {
839 strcat (p, "<overflow>");
840 break;
841 }
842 }
843 if (p < end - 12)
844 strcat (p, "<none set>");
845 return (buf);
846}
847
848void select_dump (int sock_err, int num_fd, const struct timeval *tv,
849 const fd_set *fd_read,
850 const fd_set *fd_write,
851 const fd_set *fd_except)
852{
853 char buf1 [512], buf2 [512], buf3 [512];
854
855 printf ("select_dump: sock_err %d, num_fd %d, timeout %ld.06%lu\n"
856 "\tread-fds: %s\n"
857 "\twrite-fds: %s\n"
858 "\texcept-fds: %s\n",
859 sock_err, num_fd, (long)tv->tv_sec, tv->tv_usec,
860 fd_set_str(buf1,sizeof(buf1),fd_read),
861 fd_set_str(buf2,sizeof(buf2),fd_write),
862 fd_set_str(buf3,sizeof(buf3),fd_except));
863}
864
865int main (int argc, char **argv)
866{
867 BOOL use_8254 = TRUE;
868 BOOL use_isr = FALSE;
869 BOOL debug = FALSE;
870 double sel_wait = 0.5;
871 int sel_size = 1;
872 int c;
873
874 while ((c = getopt(argc, argv, "s:w:hid?")) != EOF)
875 switch (c)
876 {
877 case 'h':
878 use_8254 = FALSE;
879 break;
880
881 case 'i':
882#ifdef MSDOS
883 init_timer_isr();
884 use_isr = TRUE;
885#endif
886 break;
887
888 case 's':
889 sel_size = atoi (optarg);
890 break;
891
892 case 'd':
893 dbug_init();
894 debug = TRUE;
895 break;
896
897 case 'w':
898 sel_wait = atof (optarg);
899 break;
900
901 case '?':
902 default:
903 usage (argv[0]);
904 break;
905 }
906
907 if (sel_size <= 0 || sel_size > MAX_SOCKETS)
908 {
909 printf ("Illegal select-size %d. Range 0 - %d\n", sel_size, MAX_SOCKETS);
910 return (-1);
911 }
912
913 sock_init();
914
915 printf ("select-wait %.3f sec, select-size %d, debug %d, ",
916 sel_wait, sel_size, debug);
917
918#if defined(MSDOS)
919 printf ("has_8254 %d, uses_int8 %d\n", has_8254, use_isr);
920 hires_timer (use_8254);
921#endif
922
923 puts ("Press 'q' to quit");
924
925 while (1)
926 {
927 fd_set read [NUM_SOCK_FDSETS];
928 struct timeval tv;
929 uclock_t start, diff;
930
931 tv.tv_sec = (time_t)sel_wait;
932 tv.tv_usec = 1000000UL * (sel_wait - (double)tv.tv_sec);
933 start = uclock();
934 memset (read, 0, sizeof(read));
935 FD_SET (STDIN_FILENO, &read[0]);
936
937 if (select_s (sel_size, read, NULL, NULL, &tv) < 0)
938 {
939 perror ("select");
940 break;
941 }
942
943 diff = uclock() - start;
944 if (debug)
945 SOCK_DEBUGF ((", diff: %.6fs", (double)diff/(double)UCLOCKS_PER_SEC));
946
947 fputc ('.', stderr);
948 usleep (100000UL);
949
950 if (FD_ISSET(0, &read[0]))
951 {
952 int ch = getch();
953
954 fputc (ch, stderr);
955 if (ch == 'q')
956 break;
957 }
958 }
959 ARGSUSED (use_8254);
960 ARGSUSED (use_isr);
961 return (0);
962}
963#endif /* TEST_PROG */
watt_kbhit
int W32_CALL watt_kbhit(void)
A less CPU hogging kbhit().
Definition: misc.c:917
select_s
int W32_CALL select_s(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
The select_s() function.
Definition: select.c:107
exc_select
static int exc_select(int s, Socket *socket)
Definition: select.c:685
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
_sock_pending_connect
BOOL _sock_pending_connect(Socket *socket)
Check progress on a non-blocking SOCK_STREAM socket that has SS_ISCONNECTING set.
Definition: socket.c:2186
_sock_dos_fd
BOOL _sock_dos_fd(int s)
_sock_dos_fd - Return TRUE if ‘s’ is a valid DOS/Win32 handle.
Definition: socket.c:202
_sock_crit_start
void _sock_crit_start(void)
Start a critical region.
Definition: socket.c:1266
_sock_crit_stop
void _sock_crit_stop(void)
Mark the end of a critical region.
Definition: socket.c:1276
Socket
Definition: socket.h:158
fd_set
Definition: wtypes.h:256
pollfd
Definition: poll.h:17
socket
Definition: if.h:82
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
timespec
Definition: wtime.h:121
timeval
Definition: wtime.h:30
poll.h
hires_timer
int hires_timer(int on)
Control use of high-resolution timer.
Definition: timer.c:377
timeval_diff
double W32_CALL timeval_diff(const struct timeval *newer, const struct timeval *older)
Return difference (in micro-sec) between timevals *newer and *older.
Definition: timer.c:638
has_8254
BOOL has_8254
Do we have a working 8254 timer chip?
Definition: timer.c:58
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/inc/sys/select.h Source File

  • inc
  • sys
select.h
Go to the documentation of this file.
1
6#if defined(__CYGWIN__)
7 #include_next <sys/select.h>
8#else
9 #include <tcp.h> /* select_s() */
10#endif
11


Watt-32 tcp/ip: E:/WATT/src/settod.c Source File

  • src
settod.c
Go to the documentation of this file.
1
16#if !defined(__DJGPP__) && !defined(__CYGWIN__) /* already have settimeofday() */
17
18#include <errno.h> /* EINVAL */
19#include <sys/wtime.h> /* time func/types */
20
21#include "wattcp.h"
22#include "misc.h"
23#include "settod.h"
24
25int MS_CDECL settimeofday (struct timeval *tv, ...)
26{
27 if (tv)
28 {
29 time_t t = (time_t)tv->tv_sec;
30 struct tm res;
31 struct tm *rc = localtime_r (&t, &res);
32
33 if (rc && res.tm_year >= 80)
34 {
35#if defined(WIN32)
36 SYSTEMTIME tim;
37
38 tim.wYear = res.tm_year + 1900;
39 tim.wMonth = res.tm_mon + 1;
40 tim.wDayOfWeek = res.tm_wday;
41 tim.wDay = res.tm_mday;
42 tim.wHour = res.tm_hour;
43 tim.wMinute = res.tm_min;
44 tim.wSecond = res.tm_sec;
45 tim.wMilliseconds = tv->tv_usec / 1000;
46 if (SetLocalTime(&tim))
47 return (0);
48#else
49 struct dosdate_t newdate;
50 struct dostime_t newtime;
51
52 newdate.year = (WORD)(res.tm_year + 1900);
53 newdate.month = (BYTE)(res.tm_mon + 1);
54 newdate.day = (BYTE)(res.tm_mday);
55 newtime.hour = (BYTE)(res.tm_hour);
56 newtime.minute = (BYTE)(res.tm_min);
57 newtime.second = (BYTE)(res.tm_sec);
58 newtime.hsecond = (BYTE)(tv->tv_usec / 10000ul);
59 if (_dos_setdate(&newdate) == 0 && /* int 21h fxn 2Bh */
60 _dos_settime(&newtime) == 0) /* int 21h fxn 2Dh */
61 return (0);
62#endif
63 }
64 }
65 SOCK_ERRNO (EINVAL);
66 return (-1);
67}
68#endif /* !__DJGPP__ && !__CYGWIN__ */
errno.h
localtime_r
struct tm * localtime_r(const time_t *t, struct tm *res)
A reentrant localtime().
Definition: misc.c:900
misc.h
settod.h
timeval
Definition: wtime.h:30
wattcp.h
Core definitions.
wtime.h


Watt-32 tcp/ip: E:/WATT/src/settod.h Source File

  • src
settod.h
Go to the documentation of this file.
1
11#ifndef _w32_SETTIMEOFDAY_H
12#define _w32_SETTIMEOFDAY_H
13
14#if !defined(__DJGPP__) && !defined(__CYGWIN__)
15
16extern int MS_CDECL settimeofday (struct timeval *tv, ...);
17
18#endif
19#endif
timeval
Definition: wtime.h:30


Watt-32 tcp/ip: E:/WATT/src/shutdown.c Source File

  • src
shutdown.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 */
37
38#include "socket.h"
39
40#if defined(USE_BSD_API)
41
42int W32_CALL shutdown (int s, int how)
43{
44 Socket *socket = _socklist_find (s);
45
46#if defined(USE_DEBUG)
47 static char fmt[] = "\nshutdown:%d/??";
48 static char rrw[] = "r w rw";
49
50 how &= 3;
51 fmt [sizeof(fmt)-3] = rrw [2*how];
52 fmt [sizeof(fmt)-2] = rrw [2*how+1];
53#endif
54
55 SOCK_PROLOGUE (socket, fmt, s);
56
57 switch (how)
58 {
59 case SHUT_RD:
60 socket->so_state |= SS_CANTRCVMORE;
61 /* socket->so_options &= ~SO_ACCEPTCONN; */
62
66 return (0);
67
68 case SHUT_WR:
69 socket->so_state |= SS_CANTSENDMORE;
70 socket->so_state &= ~SS_ISLISTENING;
71 /* socket->so_options &= ~SO_ACCEPTCONN; */
72
77 return (0);
78
79 case SHUT_RDWR:
80 socket->so_state |= (SS_CANTRCVMORE | SS_CANTSENDMORE);
81 socket->so_state &= ~SS_ISLISTENING;
82 /* socket->so_options &= ~SO_ACCEPTCONN; */
83 return (0);
84 }
85
86 SOCK_ERRNO (EINVAL);
87 return (-1);
88}
89#endif /* USE_BSD_API */
shutdown
int W32_CALL shutdown(int s, int how)
Definition: shutdown.c:42
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
Socket
Definition: socket.h:158
socket
Definition: if.h:82


Watt-32 tcp/ip: E:/WATT/src/signal.c Source File

  • src
signal.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2007 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 */
37
38#include "socket.h"
39
40#if defined(USE_BSD_API)
41
42#include "nochkstk.h"
43
44#if defined(__HIGHC__) /* Metaware's HighC have SIGBREAK == SIGQUIT */
45 #undef SIGBREAK
46#elif defined(__DMC__) /* Digital Mars have SIGBREAK == SIGINT */
47 #undef SIGBREAK
48#endif
49
50/*
51 * I'm not sure what the benefit of using sigprocmask() on djgpp is.
52 * So leave it alone for the moment.
53 */
54#if defined(__DJGPP__)
55 #define USE_SIGMASK 0
56#else
57 #define USE_SIGMASK 0
58#endif
59
60struct signal_table {
61 void (MS_CDECL *old)(int);
62 int sig_num;
63 const char *sig_name;
64 BOOL caught; /* we caught this signal */
65 BOOL exit; /* exit if app doesn't have a signal-handler */
66 };
67
68static struct signal_table sig_tab[] = {
69 { NULL, SIGINT, "SIGINT", FALSE, TRUE },
70#if defined(SIGBREAK)
71 { NULL, SIGBREAK, "SIGBREAK",FALSE, TRUE }, /* Watcom */
72#endif
73#if defined(SIGQUIT)
74 { NULL, SIGQUIT, "SIGQUIT", FALSE, TRUE }, /* should we trap this? */
75#endif
76#if defined(SIGPIPE)
77 { NULL, SIGPIPE, "SIGPIPE", FALSE, FALSE }, /* djgpp */
78#endif
79#if defined(SIGALRM) && 0 /* Should we hook this? */
80 { NULL, SIGALRM, "SIGALRM", FALSE, FALSE }, /* djgpp */
81#endif
82 };
83
84static int signal_depth = 0; /* Our running signal "depth" */
85
86/*
87 * We block all signals from being raised while running our
88 * loops (connect etc.). Postpone all original signal-handlers until
89 * we're done.
90 */
91#if (USE_SIGMASK == 0)
92/*
93 * Our signal catcher. Set 'caught' flag.
94 */
95static void MS_CDECL sig_catch (int sig)
96{
97 int i;
98
99 for (i = 0; i < DIM(sig_tab); i++)
100 if (sig == sig_tab[i].sig_num)
101 {
102 sig_tab[i].caught = TRUE;
103 break;
104 }
105 signal (sig, SIG_IGN); /* ignore until we restore it */
106}
107#endif
108
109/*
110 * Signal handling for most loops where we can be interrupted
111 * by user pressing ^C/^Break (generating SIGINT/SIGBREAK).
112 */
113int _sock_sig_setup (void)
114{
115#if (USE_SIGMASK)
116 static sigset_t old_mask, new_mask;
117#endif
118 int i;
119
120 if (signal_depth > 0 ||
121 ++signal_depth > 1)
122 return (0);
123
124 _sock_start_timer();
125
126#if (USE_SIGMASK)
127 sigemptyset (&new_mask);
128#endif
129
130 for (i = 0; i < DIM(sig_tab); i++)
131 {
132 struct signal_table *sig = sig_tab + i;
133
134 sig->caught = FALSE;
135
136#if (USE_SIGMASK)
137 sigaddset (&new_mask, sig->sig_num);
138#else
139 sig->old = signal (sig->sig_num, sig_catch);
140#endif
141 }
142
143#if (USE_SIGMASK)
144 sigprocmask (SIG_SETMASK, &new_mask, &old_mask);
145#endif
146
147 return (0);
148}
149
150/*
151 * Return number of blocked signal that are pending/caught.
152 */
153int _sock_sig_pending (void)
154{
155 int i, num = 0;
156
157#if (USE_SIGMASK)
158 sigset_t pending;
159
160 sigpending (&pending);
161 for (i = 0; i < DIM(sig_tab); i++)
162 if (sigismember(&pending, sig_tab[i].sig_num))
163 num++;
164#else
165 for (i = 0; i < DIM(sig_tab); i++)
166 if (sig_tab[i].caught)
167 num++;
168#endif
169 return (num);
170}
171
172/*
173 * Unhook signal-handlers and raise() signals we caught.
174 */
175int _sock_sig_restore (void)
176{
177 int i;
178
179 if (signal_depth == 0 ||
180 --signal_depth > 0)
181 return (0);
182
183 _sock_stop_timer();
184
185 for (i = 0; i < DIM(sig_tab); i++)
186 {
187 struct signal_table *sig = sig_tab + i;
188
189#if (USE_SIGMASK)
190 sigset_t pending, new_set;
191
192 if (sigpending(&pending) == 0 &&
193 sigismember(&pending,sig->sig_num))
194 {
195 /* The signal became pending while we blocked it.
196 * I.e. ^C was pressed, so act on it.
197 */
198 sigemptyset (&new_set);
199 sigaddset (&new_set, sig->sig_num);
200
201 SOCK_DEBUGF ((", raising %s", sig->sig_name));
202 SOCK_ENTER_SCOPE();
203 sigprocmask (SIG_UNBLOCK, &new_set, NULL);
204 SOCK_LEAVE_SCOPE();
205 }
206#else
207 signal (sig->sig_num, sig->old);
208 if (!sig->caught)
209 continue;
210
211 sig->caught = FALSE;
212 if (sig->exit &&
213 (sig->old == SIG_DFL ||
214 sig->old == SIG_IGN ||
215 sig->old == sig_handler_watt))
216 {
217 char buf[30];
218
219 strcpy (buf, "\nTerminating on ");
220 strcat (buf, sig->sig_name);
221 sock_sig_exit (buf, sig->sig_num);
222 /* no return */
223 }
224 SOCK_DEBUGF ((", raising %s", sig->sig_name));
225 SOCK_ENTER_SCOPE();
226 raise (sig->sig_num);
227 SOCK_LEAVE_SCOPE();
228 return (-1);
229#endif
230 }
231 return (0);
232}
233
234/*
235 * Raise SIGPIPE/SIGURG if signal defined (not needed yet).
236 * Return -1 with errno = EPIPE.
237 */
238int _sock_sig_epipe (const Socket *sock)
239{
240#if defined(SIGPIPE)
241 if (!sock->msg_nosig)
242 raise (SIGPIPE);
243#endif
244 SOCK_ERRNO (EPIPE);
245 ARGSUSED (sock);
246 return (-1);
247}
248#endif /* USE_BSD_API */
sig_handler_watt
void MS_CDECL sig_handler_watt(int sig)
SIGINT/SIGBREAK handler function.
Definition: pc_cbrk.c:74
nochkstk.h
sock_sig_exit
void W32_CALL sock_sig_exit(const char *msg, int sig)
Exit handler for unhandled signals.
Definition: sock_ini.c:1076
Socket
Definition: socket.h:158
signal_table
Definition: signal.c:60


Watt-32 tcp/ip: E:/WATT/inc/net/slcompre.h Source File

  • inc
  • net
slcompre.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1989, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38/*
39 * Definitions for tcp compression routines.
40 *
41 * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989:
42 * - Initial distribution.
43 */
44
45#ifndef __NET_SLCOMPRESS_H
46#define __NET_SLCOMPRESS_H
47
48#include <sys/cdefs.h>
49#include <sys/wtypes.h>
50
51#ifndef __SYS_MBUF_H
52#include <sys/mbuf.h>
53#endif
54
55#ifndef MLEN
56#define MLEN 128
57#endif
58
59#define MAX_STATES 16 /* must be > 2 and < 256 */
60#define MAX_HDR MLEN /* XXX 4bsd-ism: should really be 128 */
61
62/*
63 * Compressed packet format:
64 *
65 * The first octet contains the packet type (top 3 bits), TCP
66 * 'push' bit, and flags that indicate which of the 4 TCP sequence
67 * numbers have changed (bottom 5 bits). The next octet is a
68 * conversation number that associates a saved IP/TCP header with
69 * the compressed packet. The next two octets are the TCP checksum
70 * from the original datagram. The next 0 to 15 octets are
71 * sequence number changes, one change per bit set in the header
72 * (there may be no changes and there are two special cases where
73 * the receiver implicitly knows what changed -- see below).
74 *
75 * There are 5 numbers which can change (they are always inserted
76 * in the following order): TCP urgent pointer, window,
77 * acknowlegement, sequence number and IP ID. (The urgent pointer
78 * is different from the others in that its value is sent, not the
79 * change in value.) Since typical use of SLIP links is biased
80 * toward small packets (see comments on MTU/MSS below), changes
81 * use a variable length coding with one octet for numbers in the
82 * range 1 - 255 and 3 octets (0, MSB, LSB) for numbers in the
83 * range 256 - 65535 or 0. (If the change in sequence number or
84 * ack is more than 65535, an uncompressed packet is sent.)
85 */
86
87/*
88 * Packet types (must not conflict with IP protocol version)
89 *
90 * The top nibble of the first octet is the packet type. There are
91 * three possible types: IP (not proto TCP or tcp with one of the
92 * control flags set); uncompressed TCP (a normal IP/TCP packet but
93 * with the 8-bit protocol field replaced by an 8-bit connection id --
94 * this type of packet syncs the sender & receiver); and compressed
95 * TCP (described above).
96 *
97 * LSB of 4-bit field is TCP "PUSH" bit (a worthless anachronism) and
98 * is logically part of the 4-bit "changes" field that follows. Top
99 * three bits are actual packet type. For backward compatibility
100 * and in the interest of conserving bits, numbers are chosen so the
101 * IP protocol version number (4) which normally appears in this nibble
102 * means "IP packet".
103 */
104#include <netinet/ip.h>
105
106/* packet types */
107#define TYPE_IP 0x40
108#define TYPE_UNCOMPRESSED_TCP 0x70
109#define TYPE_COMPRESSED_TCP 0x80
110#define TYPE_ERROR 0x00
111
112/* Bits in first octet of compressed packet */
113#define NEW_C 0x40 /* flag bits for what changed in a packet */
114#define NEW_I 0x20
115#define NEW_S 0x08
116#define NEW_A 0x04
117#define NEW_W 0x02
118#define NEW_U 0x01
119
120/* reserved, special-case values of above */
121#define SPECIAL_I (NEW_S|NEW_W|NEW_U) /* echoed interactive traffic */
122#define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U) /* unidirectional data */
123#define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U)
124
125#define TCP_PUSH_BIT 0x10
126
127__BEGIN_DECLS
128
129/*
130 * "state" data for each active tcp conversation on the wire. This is
131 * basically a copy of the entire IP/TCP header from the last packet
132 * we saw from the conversation together with a small identifier
133 * the transmit & receive ends of the line use to locate saved header.
134 */
135struct cstate {
136 struct cstate *cs_next; /* next most recently used cstate (xmit only) */
137 u_int16_t cs_hlen; /* size of hdr (receive only) */
138 u_char cs_id; /* connection # associated with this state */
139 u_char cs_filler;
140 union {
141 char csu_hdr[MAX_HDR];
142 struct ip csu_ip; /* ip/tcp hdr from most recent packet */
143 } slcs_u;
144};
145#define cs_ip slcs_u.csu_ip
146#define cs_hdr slcs_u.csu_hdr
147
148/*
149 * all the state data for one serial line (we need one of these
150 * per line).
151 */
152struct slcompress {
153 struct cstate *last_cs; /* most recently used tstate */
154 u_char last_recv; /* last rcvd conn. id */
155 u_char last_xmit; /* last sent conn. id */
156 u_int16_t flags;
157#ifndef SL_NO_STATS
158 int sls_packets; /* outbound packets */
159 int sls_compressed; /* outbound compressed packets */
160 int sls_searches; /* searches for connection state */
161 int sls_misses; /* times couldn't find conn. state */
162 int sls_uncompressedin; /* inbound uncompressed packets */
163 int sls_compressedin; /* inbound compressed packets */
164 int sls_errorin; /* inbound unknown type packets */
165 int sls_tossed; /* inbound packets tossed because of error */
166#endif
167 struct cstate tstate[MAX_STATES]; /* xmit connection states */
168 struct cstate rstate[MAX_STATES]; /* receive connection states */
169};
170/* flag values */
171#define SLF_TOSS 1 /* tossing rcvd frames because of input err */
172
173void sl_compress_init (struct slcompress *);
174void sl_compress_setup (struct slcompress *, int);
175u_int sl_compress_tcp (struct mbuf *, struct ip *, struct slcompress *, int);
176int sl_uncompress_tcp (u_char **, int, u_int, struct slcompress *);
177int sl_uncompress_tcp_core (u_char *, int, int, u_int, struct slcompress *, u_char **, u_int *);
178
179__END_DECLS
180
181#endif
cdefs.h
ip.h
cstate
Definition: pcpkt.h:135
mbuf
Definition: mbuf.h:6
slcompress
Definition: pcpkt.h:148
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/net/slip.h Source File

  • inc
  • net
slip.h
Go to the documentation of this file.
1
5/*-
6 * Copyright (c) 1994
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NET_SLIP_H
39#define __NET_SLIP_H
40
41/* Ioctls operating on SLIP ttys. */
42#define SLIOCGUNIT _IOR('t', 88, int) /* get slip unit number */
43
44/*
45 * Definitions of the pseudo-link-level header attached to slip
46 * packets grabbed by the packet filter (bpf) traffic monitor.
47 */
48#define SLIP_HDRLEN 16 /* BPF SLIP header length */
49
50/* Offsets into BPF SLIP header. */
51#define SLX_DIR 0 /* direction; see below */
52#define SLX_CHDR 1 /* compressed header data */
53#define CHDR_LEN 15 /* length of compressed header data */
54
55#define SLIPDIR_IN 0 /* incoming */
56#define SLIPDIR_OUT 1 /* outgoing */
57
58#endif


Watt-32 tcp/ip: E:/WATT/inc/sys/so_ioctl.h Source File

  • inc
  • sys
so_ioctl.h
Go to the documentation of this file.
1
6/* so_ioctl.h derived from BSD's ioctl.h by hv and em 1994
7 *
8 * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 */
39
40#if !defined(__SYS_SO_IOCTL_H) && !defined(__SYS_IOCTL_H)
41#define __SYS_SO_IOCTL_H
42
43#undef _IOC
44#undef _IOW
45#undef _IOR
46#undef _IOWR
47
48#define _IOC(a,b) (((a) << 8) | (b))
49#define _IOW(a,b,c) _IOC(a, b)
50#define _IOR(a,b,c) _IOC(a, b)
51#define _IOWR(a,b,c) _IOC(a, b)
52
53#define _TCPIP_FIONREAD _IOC('f', 127)
54#define FIONBIO _IOC('f', 126)
55#define FIOASYNC _IOC('f', 125)
56#define FIOTCPCKSUM _IOC('f', 128)
57#define FIONSTATUS _IOC('f', 120)
58#define FIONURG _IOC('f', 121)
59
60/* socket i/o controls */
61#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */
62#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */
63#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */
64#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */
65#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */
66#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
67#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
68
69#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */
70#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */
71
72#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */
73#define SIOCGIFADDR _IOWR('i',13, struct ifreg) /* get ifnet addres */
74#define OSIOCGIFADDR SIOCGIFADDR
75#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */
76#define SIOCGIFDSTADDR _IOWR('i',15, struct ifreq) /* get p-p address */
77#define OSIOCGIFDSTADDR SIOCGIFDSTADDR
78#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */
79#define SIOCGIFFLAGS _IOWR('i',17, struct ifreq) /* get ifnet flags */
80#define SIOCGIFBRDADDR _IOWR('i',18, struct ifreq) /* get broadcast addr */
81#define OSIOCGIFBRDADDR SIOCGIFBRDADDR
82#define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */
83#define SIOCGIFCONF _IOWR('i',20, struct ifreq) /* get ifnet list */
84#define OSIOCGIFCONF SIOCGIFCONF
85#define SIOCGIFNETMASK _IOWR('i',21, struct ifreq) /* get net addr mask */
86#define OSIOCGIFNETMASK SIOCGIFNETMASK
87#define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */
88#define SIOCGIFMETRIC _IOWR('i',23, struct ifreq) /* get if metric */
89#define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set if metric */
90
91#define SIOCSARP _IOW('i', 30, struct arpreq) /* set arp entry */
92#define SIOCGARP _IOWR('i',31, struct arpreq) /* get arp entry */
93#define OSIOCGARP SIOCGARP
94#define SIOCDARP _IOW('i', 32, struct arpreq) /* delete arp entry */
95
96#endif


Watt-32 tcp/ip: E:/WATT/src/sock_dbu.c Source File

  • src
sock_dbu.c
Go to the documentation of this file.
1
4#include <stdio.h>
5
6#include "copyrigh.h"
7#include "wattcp.h"
8#include "misc.h"
9#include "misc_str.h"
10#include "timer.h"
11#include "pcdbug.h"
12#include "pcbuf.h"
13
14void W32_CALL sock_debugdump (const sock_type *s)
15{
16#if defined(USE_DEBUG)
17 const _tcp_Socket *tcp = &s->tcp;
18
19 if (s->raw.ip_type == IP4_TYPE)
20 return;
21
22#if defined(__SMALL__) && !defined(__SMALL32__)
23 (*_printf) ("next %04X\n", s->tcp.next);
24#elif defined(__LARGE__)
25 (*_printf) ("next %04X:%04X\n", FP_SEG(s->tcp.next), FP_OFF(s->tcp.next));
26#else
27 (*_printf) ("next %" ADDR_FMT "\n", ADDR_CAST(s->tcp.next));
28#endif
29
30 (*_printf) ("type %d\n", s->tcp.ip_type);
31
32 (*_printf) ("stat/error %s\n", s->tcp.err_msg ? s->tcp.err_msg : "(none)");
33 (*_printf) ("usr-timer %08lX (%sexpired)\n",
34 (u_long)s->tcp.usertimer, chk_timeout(s->tcp.usertimer) ? "" : "not ");
35
36 switch (s->tcp.ip_type)
37 {
38 case UDP_PROTO:
39 (*_printf) ("udp rxdata %u `%.*s'\n",
40 s->tcp.rx_datalen, s->tcp.rx_datalen, s->tcp.rx_data);
41 break;
42 case TCP_PROTO:
43 (*_printf) ("tcp rxdata %u `%.*s'\n",
44 tcp->rx_datalen, tcp->rx_datalen, tcp->rx_data);
45 (*_printf) ("tcp state %u (%s)\n",
46 tcp->state, tcpStateName(tcp->state));
47 break;
48 }
49#else
50 ARGSUSED (s);
51#endif
52}
copyrigh.h
misc.h
misc_str.h
pcbuf.h
pcdbug.h
_raw_Socket::ip_type
WORD ip_type
same ofs as for udp/tcp Socket
Definition: wattcp.h:667
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
tcp_Socket::next
struct tcp_Socket * next
link to next tcp-socket
Definition: wattcp.h:585
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/sock_in.c Source File

  • src
sock_in.c
Go to the documentation of this file.
1
11#include <stdio.h>
12
13#include "copyrigh.h"
14#include "wattcp.h"
15#include "language.h"
16#include "misc.h"
17#include "timer.h"
18#include "wdpmi.h"
19#include "pctcp.h"
20
21/*
22 * ip user level timer stuff
23 * void ip_timer_init (void *s, int delayseconds)
24 * int ip_timer_expired (void *s)
25 * - 0 if not expired
26 */
27void W32_CALL ip_timer_init (sock_type *s, unsigned seconds)
28{
29 if (seconds)
30 s->tcp.usertimer = set_timeout (1000UL * seconds);
31 else s->tcp.usertimer = 0;
32}
33
34int W32_CALL ip_timer_expired (const sock_type *s)
35{
36 if (!s->tcp.usertimer)
37 return (0);
38 return chk_timeout (s->tcp.usertimer);
39}
40
41/*
42 * _ip_delay0 called by macro sock_wait_established()
43 *
44 */
45int W32_CALL _ip_delay0 (sock_type *s, int timeout_sec, UserHandler fn, int *statusptr)
46{
47 int status = -1;
48
49 ip_timer_init (s, timeout_sec);
50 do
51 {
52#if !defined(USE_UDP_ONLY)
53 if (s->tcp.ip_type == TCP_PROTO && tcp_established(&s->tcp))
54 {
55 status = 0;
56 break;
57 }
58#endif
59
60 if (!tcp_tick(s))
61 {
62 if (s->tcp.err_msg == NULL)
63 s->tcp.err_msg = _LANG("Host refused connection");
64 status = -1; /* get an early reset */
65 break;
66 }
67 if (ip_timer_expired(s))
68 {
69 if (s->tcp.err_msg == NULL)
70 s->tcp.err_msg = _LANG("Open timed out");
71 if (!(s->tcp.locflags & LF_NOCLOSE))
72 sock_close (s);
73 status = -1;
74 break;
75 }
76 if (fn && (status = (*fn)(s)) != 0)
77 break;
78
79 if (s->tcp.usr_yield)
80 (*s->tcp.usr_yield)();
81 else WATT_YIELD();
82
83 if (s->tcp.ip_type == UDP_PROTO)
84 {
85 status = 0;
86 break;
87 }
88 }
89 while (1);
90
91 if (statusptr)
92 *statusptr = status;
93 return (status);
94}
95
96/*
97 * _ip_delay1 called by macro sock_wait_input()
98 */
99int W32_CALL _ip_delay1 (sock_type *s, int timeoutseconds, UserHandler fn, int *statusptr)
100{
101 int status = -1;
102
103 ip_timer_init (s, timeoutseconds);
104
105#if !defined(USE_UDP_ONLY)
106 sock_flush (s); /* new enhancement */
107#endif
108
109 do
110 {
111 if (sock_dataready(s))
112 {
113 status = 0;
114 break;
115 }
116 if (s->tcp.locflags & LF_GOT_FIN)
117 {
118 status = 1;
119 break;
120 }
121 if (!tcp_tick(s))
122 {
123 status = 1;
124 break;
125 }
126
127 if (ip_timer_expired(s))
128 {
129 if (s->tcp.err_msg == NULL)
130 s->tcp.err_msg = _LANG("Connection timed out");
131 if (!(s->tcp.locflags & LF_NOCLOSE))
132 sock_close (s);
133 status = -1;
134 break;
135 }
136 if (fn && (status = (*fn)(s)) != 0)
137 break;
138
139 if (s->tcp.usr_yield)
140 (*s->tcp.usr_yield)();
141 else WATT_YIELD();
142 }
143 while (1);
144
145 if (statusptr)
146 *statusptr = status;
147 return (status);
148}
149
150/*
151 * _ip_delay2 called by macro sock_wait_closed();
152 */
153int W32_CALL _ip_delay2 (sock_type *s, int timeoutseconds, UserHandler fn, int *statusptr)
154{
155 int status = -1;
156
157 if (s->tcp.ip_type != TCP_PROTO)
158 {
159 if (statusptr)
160 *statusptr = 1;
161 return (1);
162 }
163
164#if !defined(USE_UDP_ONLY)
165 ip_timer_init (s, timeoutseconds);
166
167 do
168 {
169 /* in this situation we know user is not planning to read rx_data
170 */
171 s->tcp.rx_datalen = 0;
172
173 if (!tcp_tick(s))
174 {
175 status = 1;
176 break;
177 }
178 if (ip_timer_expired(s))
179 {
180 if (s->tcp.err_msg == NULL)
181 s->tcp.err_msg = _LANG("Connection timed out");
182 TCP_ABORT (&s->tcp);
183 status = -1;
184 break;
185 }
186 if (fn && (status = (*fn)(s)) != 0)
187 break;
188
189 if (s->tcp.usr_yield)
190 (*s->tcp.usr_yield)();
191 else WATT_YIELD();
192 }
193 while (1);
194
195 if (statusptr)
196 *statusptr = status;
197
198#else
199 ARGSUSED (fn);
200 ARGSUSED (timeoutseconds);
201#endif
202 return (status);
203}
204
205int W32_CALL sock_timeout (sock_type *s, int sec)
206{
207 if (s->tcp.ip_type != TCP_PROTO)
208 return (1);
209
210#if !defined(USE_UDP_ONLY)
211 if (s->tcp.state != tcp_StateESTAB)
212 return (2);
213
214 s->tcp.timeout = set_timeout (1000UL * sec);
215#else
216 ARGSUSED (sec);
217#endif
218 return (0);
219}
220
221int W32_CALL sock_established (sock_type *s)
222{
223 switch (s->tcp.ip_type)
224 {
225 case UDP_PROTO:
226 return (1);
227
228#if !defined(USE_UDP_ONLY)
229 case TCP_PROTO:
230 return (s->tcp.state == tcp_StateESTAB ||
231 s->tcp.state == tcp_StateESTCL ||
232 s->tcp.state == tcp_StateCLOSWT);
233#endif
234 default:
235 return (0);
236 }
237}
238
copyrigh.h
language.h
misc.h
tcp_established
int W32_CALL tcp_established(const _tcp_Socket *s)
Returns 1 if TCP connection is established.
Definition: pctcp.c:639
pctcp.h
sock_dataready
WORD W32_CALL sock_dataready(sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
Definition: sock_io.c:246
tcp_Socket::timeout
DWORD timeout
timer for retrans etc.
Definition: wattcp.h:603
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.
wdpmi.h


Watt-32 tcp/ip: E:/WATT/src/sock_ini.c Source File

  • src
sock_ini.c
Go to the documentation of this file.
1
32#include <stdio.h>
33#include <stdlib.h>
34#include <signal.h>
35#include <setjmp.h>
36#include <limits.h>
37#include <float.h>
38#include <math.h>
39#include <time.h>
40#include <io.h>
41
42#ifdef __HIGHC__
43#include <init.h> /* _mwenv(), PL_ENV */
44#endif
45
46#ifdef __DJGPP__
47#include <sys/exceptn.h>
48#endif
49
50#include "copyrigh.h"
51#include "wattcp.h"
52#include "language.h"
53#include "misc.h"
54#include "misc_str.h"
55#include "run.h"
56#include "timer.h"
57#include "profile.h"
58#include "wdpmi.h"
59#include "x32vm.h"
60#include "powerpak.h"
61#include "pcbootp.h"
62#include "pcrarp.h"
63#include "pcdhcp.h"
64#include "pcconfig.h"
65#include "pcigmp.h"
66#include "pcicmp.h"
67#include "pctcp.h"
68#include "pcarp.h"
69#include "pcsed.h"
70#include "pcqueue.h"
71#include "pcpkt.h"
72#include "pcdbug.h"
73#include "netaddr.h"
74#include "syslog2.h"
75#include "pcdns.h"
76#include "bsdname.h"
77#include "bsddbug.h"
78#include "ip4_frag.h"
79#include "ip6_in.h"
80#include "printk.h"
81#include "sock_ini.h"
82
83#if (DOSX & PHARLAP)
84#include <mw/exc.h>
85#endif
86
87#if defined(USE_TFTP)
88#include "tftp.h"
89#endif
90
91#if defined(USE_BSD_API)
92#include "socket.h"
93#include "get_xby.h"
94#endif
95
96#if defined(USE_BIND)
97#include "resolver.h"
98#endif
99
100#if defined(USE_ECHO_DISC)
101#include "echo.h"
102#endif
103
104#if defined(USE_PPPOE)
105#include "pppoe.h"
106#endif
107
108#if defined(USE_IDNA)
109#include "idna.h"
110#endif
111
112#if defined(USE_DYNIP_CLI)
113#include "dynip.h"
114#endif
115
116#if defined(WIN32)
117#include "winpkt.h"
118#endif
119
120#if defined(__HIGHC__) /* Metaware's HighC have SIGBREAK == SIGQUIT */
121#undef SIGBREAK
122#endif
123
124#include "nochkstk.h"
125
126typedef void (MS_CDECL *_signal_handler) (int);
127typedef void (MS_CDECL *_atexit_handler) (void);
128
129BOOL _bootp_on = FALSE;
130BOOL _dhcp_on = FALSE;
131BOOL _dhcp6_on = FALSE;
132BOOL _rarp_on = FALSE;
133BOOL _do_mask_req = FALSE;
134BOOL _watt_no_config = FALSE;
136BOOL _watt_do_exit = TRUE;
138WattUserConfigFunc _watt_user_config_fn = NULL;
139
140BOOL survive_eth = 0;
145#if defined(USE_DHCP)
146 BOOL survive_bootp = TRUE;
147#else
148 BOOL survive_bootp = FALSE;
149#endif
150
151#if defined(USE_RARP)
152 BOOL survive_dhcp = TRUE;
153#else
154 BOOL survive_dhcp = FALSE;
155#endif
156
157BOOL survive_rarp = FALSE;
158BOOL _watt_is_init = FALSE;
160static BOOL tcp_is_init = FALSE;
161static int old_break = -1;
200WattUserConfigFunc W32_CALL _watt_user_config (WattUserConfigFunc fn)
201{
202 WattUserConfigFunc old_fn = _watt_user_config_fn;
203
204 _watt_user_config_fn = fn;
205 return (old_fn);
206}
207
212static int do_exit (int code)
213{
214 if (_watt_do_exit)
215 exit (code);
216 return (code);
217}
218
222static BOOL use_except = TRUE;
223
224#if (DOSX & (DOS4GW|X32VM))
225
226static jmp_buf exc_jmp;
227static struct FAULT_STRUC exc_buf;
228
229static void pre_except_handler (const struct FAULT_STRUC *exc)
230{
231 exc_buf = *exc;
232 longjmp (exc_jmp, SIGSEGV);
233}
234
235#if !defined(__BORLANDC__)
236static void do_traceback (void)
237{
238 _printk_safe = TRUE;
239 _printk ("\r\nException %d at %04X:%08X\r\n",
240 exc_buf.fault_num, exc_buf.cs, exc_buf.eip);
241
242 _printk (" EAX %08X EBX %08X ECX %08X EDX %08X\r\n",
243 exc_buf.eax, exc_buf.ebx, exc_buf.ecx, exc_buf.edx);
244
245 _printk (" ESI %08X EDI %08X EBP %08X ESP %08X\r\n",
246 exc_buf.esi, exc_buf.edi, exc_buf.ebp, exc_buf.esp);
247
248 _printk (" DS %04X ES %04X FS %04X GS %04X SS %04X EFLAGS %08X\r\n",
249 exc_buf.ds, exc_buf.es, exc_buf.fs, exc_buf.gs, exc_buf.ss,
250 exc_buf.eflags);
251
252 _printk_flush();
253
254 if (!exc_buf.mode) /* exception in protected mode */
255 {
256 stack_rewind (exc_buf.eip, exc_buf.ebp);
257 _printk_flush();
258 }
259}
260#endif /* !__BORLANDC__ */
261#endif /* DOS4GW|X32VM */
262
263
264#if defined(__DJGPP__)
265static void except_handler (int sig)
266{
267 static BOOL been_here = FALSE;
268 static jmp_buf exc_buf;
269
270 _watt_fatal_error = TRUE;
271
272 if (been_here)
273 {
274 been_here = FALSE;
275 signal (sig, SIG_DFL);
276 __djgpp_exception_state_ptr = &exc_buf;
277 }
278 else /* save exception context in case of reentry */
279 {
280 memcpy (&exc_buf, __djgpp_exception_state_ptr, sizeof(exc_buf));
281 been_here = TRUE;
282 psignal (sig, "TCP/IP shutdown");
283 rundown_run();
284
285#if 0
289 StackWalk (exc_buf[0].__eip, exc_buf[0].__ebp);
290#endif
291 }
292 raise (SIGABRT);
293}
294
295#elif (DOSX & PHARLAP)
296static void except_handler (excReg *regs)
297{
298 _watt_fatal_error = TRUE;
299 rundown_run();
300 _exit (-1);
301 ARGSUSED (regs);
302}
303
304#else
305/*
306 * Note: Watcom's extension to SIGFPE is undocumented.
307 * This is dead code on Windows since except_handler()
308 * isn't installed yet.
309 */
310static void except_handler (int sig, int code)
311{
312#if defined(__WATCOMC__) && !defined(W32_NO_8087)
313 if (sig == SIGFPE && code == FPE_IOVERFLOW)
314 {
315 _fpreset();
316 outsnl (_LANG("Ignoring SIGFPE (FPE_IOVERFLOW)"));
317 return;
318 }
319#endif
320
321#if defined(__MSDOS__)
322 /* Take extra care only under MSDOS.
323 */
324 _watt_fatal_error = TRUE;
325#endif
326
327#if defined(SIGFPE)
328 if (sig == SIGFPE)
329 {
330#if defined(__WATCOMC__)
331 outs (_LANG("Trapping SIGFPE code 0x"));
332 outhex (code);
333#else
334 outsnl (_LANG("Trapping SIGFPE."));
335#endif
336 }
337 else
338#endif
339
340#if defined(SIGSEGV)
341 if (sig == SIGSEGV)
342 {
343 outsnl (_LANG("Trapping SIGSEGV"));
344#if (DOSX & (DOS4GW|X32VM)) && !defined(__BORLANDC__)
345 do_traceback();
346#endif
347 }
348#endif
349
350 rundown_run();
351
352#if (DOSX) /* don't pull in iob for small/large */
353 fflush (stdout);
354 fflush (stderr);
355#endif
356
357 ARGSUSED (code);
358#if defined(__POCC__)
359 exit (-1);
360#else
361 _exit (-1);
362#endif
363}
364#endif /* __DJGPP__ */
365
366
371static void setup_sig_handlers (void)
372{
373#if (DOSX & (DOS4GW|X32VM))
374 volatile int sig;
375#endif
376
377#if defined(WIN32) /* no need for a special exc-handler (yet?) */
378 use_except = FALSE;
379#else
380 if (getenv("WATT32-NOEXC") || /* don't trap exceptions */
381 getenv("WATT32-NOEXCEPT"))
382 use_except = FALSE;
383#endif
384
385 if (!use_except)
386 return;
387
388#if (DOSX & PHARLAP)
389 InstallExcHandler (except_handler);
390
391#elif (DOSX & X32VM)
392 _printk_init (2000, NULL);
393 _x32_fault_intercept (pre_except_handler);
394 sig = setjmp (exc_jmp);
395 if (sig)
396 except_handler (sig, 0);
397
398#elif (DOSX & DOS4GW)
399 signal (SIGSEGV, (void(*)(int))except_handler);
400 signal (SIGFPE, (void(*)(int))except_handler);
401
402 _printk_init (2000, NULL);
403 dpmi_except_handler (pre_except_handler); /* Only effective for Causeway */
404 sig = setjmp (exc_jmp);
405 if (sig)
406 except_handler (sig, 0);
407
408#elif defined(__DJGPP__)
409 signal (SIGSEGV, except_handler);
410 signal (SIGTRAP, except_handler);
411 signal (SIGFPE, except_handler);
412 signal (SIGILL, except_handler);
413
414#else
415 /*
416 * SIGSEGV may not be effective under all environments.
417 * PowerPak definetly supports SIGSEGV.
418 */
419 #ifdef SIGSEGV
420 signal (SIGSEGV, (_signal_handler)except_handler);
421 #endif
422 #ifdef SIGFPE
423 signal (SIGFPE, (_signal_handler)except_handler);
424 #endif
425#endif
426}
427
428static void W32_CALL restore_sig_handlers (void)
429{
430 if (!_watt_cbroke)
431 signal (SIGINT, SIG_DFL);
432
433 if (old_break >= 0)
434 set_cbreak (old_break);
435
436 if (!use_except)
437 return;
438
439#if (DOSX & DOS4GW)
440 signal (SIGSEGV, SIG_DFL);
441 signal (SIGFPE, SIG_DFL);
442
443#elif defined(__DJGPP__)
444 signal (SIGSEGV, SIG_DFL);
445 signal (SIGTRAP, SIG_DFL);
446 signal (SIGFPE, SIG_DFL);
447 signal (SIGILL, SIG_DFL);
448
449#elif defined(__BORLANDC__) && defined(SIGSEGV) && defined(SIGFPE)
450 signal (SIGSEGV, SIG_DFL);
451 signal (SIGFPE, SIG_DFL);
452#endif
453}
454
459static void tcp_shutdown (void)
460{
461 if (!tcp_is_init)
462 return;
463
464#if !defined(USE_UDP_ONLY)
465 while (_tcp_allsocs)
466 TCP_ABORT (_tcp_allsocs); /* Sends RST if needed */
467 _tcp_allsocs = NULL;
468#endif
469 _udp_allsocs = NULL;
470
471#if defined(USE_DHCP)
472 /*
473 * If DHCP-config saved to disk and remaining lease is above min.,
474 * do nothing. Otherwise be nice and release our address
475 */
476 DHCP_release (FALSE);
477#endif
478
479#if defined(USE_PPPOE)
480 pppoe_exit();
481#endif
482
483 tcp_is_init = FALSE;
484}
485
486
496static int tcp_init (void)
497{
498 int rc = WERR_NO_DRIVER;
499
500 if (!tcp_is_init)
501 {
502 tcp_is_init = TRUE;
503 rc = _eth_init(); /* initialize LAN-card */
504
505 if (rc == WERR_NO_ERROR)
506 {
507 last_nameserver = 0; /* reset the nameserver table */
508 last_cookie = 0; /* eat all remaining crumbs */
509
510 if (!init_localport()) /* clear local ports in-use */
511 return (WERR_NO_MEM);
512
513 /* I not already set, try asking a DOS network extension
514 * for a host-name.
515 */
516 if (!strcmp(hostname,"random-pc"))
517 _get_machine_name (hostname, sizeof(hostname));
518 }
519 }
520 return (rc);
521}
522
526static void tcp_post_init (void)
527{
528 int MTU;
529
530 if (!tcp_is_init) /* tcp_init() not called */
531 return;
532
533 memdbg_post_init();
534
535#if defined(USE_BSD_API)
536 ReadEthersFile(); /* requires gethostbyname() */
537#endif
538
539#if defined(USE_PROFILER)
540 if (profile_enable)
541 profile_init();
542#endif
543
544#if defined(USE_IPV6)
545 _ip6_post_init();
546#endif
547
548#if defined(USE_DEBUG)
549 if (debug_on >= 3)
550 rundown_dump();
551#endif
552
553 MTU = pkt_get_mtu(); /* driver knows correct MTU (includes MAC-header) */
554 if (MTU > 0)
555 _mtu = MTU;
556
557 if (_mtu > ETH_MAX_DATA)
558 _mtu = ETH_MAX_DATA;
559
560 if (_mss > MSS_MAX)
561 _mss = MSS_MAX;
562
563#if defined(__MSDOS__) && !defined(USE_UDP_ONLY)
564 {
565 DWORD max_rwin;
566
567 /* Work around a limitation of NDIS3PKT. It only allocates 6 buffers
568 * per VDD (DOS-box). Thus receiving a burts of RWIN/MSS packets, they
569 * could all get lost. Clamp our advertised RWIN. Hence, it's adviced
570 * to use SwsVpkt in a Windows DOS-box.
571 *
572 * Note: bandwidth <= 1.3 * MTU / (RTT * sqrt(Loss))
573 */
574 max_rwin = 6 * _mss;
575
576 if (_eth_ndis3pkt && tcp_recv_win > max_rwin)
577 tcp_recv_win = max_rwin;
578 }
579#endif
580
581 if (usr_post_init) /* tell hook(s) we're done */
582 (*usr_post_init)();
583}
584
591static int tcp_do_bootp (BOOL try_bootp, BOOL try_dhcp, BOOL try_rarp)
592{
593 if (try_bootp)
594 {
595#if defined(USE_BOOTP)
596 if (BOOTP_do_boot())
597 return (0);
598
599 outsnl (_LANG("failed"));
600 if (!survive_bootp)
601 return (WERR_BOOTP_FAIL);
602#else
603 outsnl ("BOOTP needed, but library was not built with \"USE_BOOTP\"");
604#endif
605
606#if defined(USE_DHCP)
607 try_dhcp = TRUE;
608#endif
609
610#if defined(USE_RARP)
611 try_rarp = TRUE;
612#endif
613 }
614
615 if (try_dhcp)
616 {
617#if defined(USE_DHCP)
618 if (DHCP_do_boot())
619 return (0);
620
621 outsnl (_LANG("failed"));
622 if (!survive_dhcp)
623 return (WERR_DHCP_FAIL);
624#else
625 outsnl ("DHCP needed, but library was not built with \"USE_DHCP\"");
626#endif
627
628#if defined(USE_RARP)
629 try_rarp = TRUE;
630#endif
631 }
632
633 if (try_rarp)
634 {
635#if defined(USE_RARP)
636 if (_dorarp())
637 return (0);
638
639 outsnl (_LANG("failed"));
640 if (!survive_rarp)
641 return (WERR_RARP_FAIL);
642#else
643 outsnl ("RARP needed, but library was not built with \"USE_RARP\"");
644#endif
645 }
646 return (WERR_NO_IPADDR); /* all attempts failed */
647}
648
649
650#if defined(USE_DEBUG)
651/*
652 * A guard against this common error; The wattlib user forgot to rebuild
653 * using the latest <tcp.h>.
654 *
655 * \todo: test this in a GUI program.
656 */
657static void check_sock_sizes (size_t tcp_Sock_size, size_t udp_Sock_size)
658{
659 char buf[100];
660 char *p = buf;
661
662 if (tcp_Sock_size > 0 && tcp_Sock_size < sizeof(_tcp_Socket))
663 p += sprintf (p, " sizeof(_tcp_Socket) in <tcp.h> too small (%u bytes)."
664 " %d bytes needed\r\n", (int)tcp_Sock_size, SIZEOF(_tcp_Socket));
665
666 if (udp_Sock_size > 0 && udp_Sock_size < sizeof(_udp_Socket))
667 p += sprintf (p, " sizeof(_udp_Socket) in <tcp.h> too small (%u bytes)."
668 " %d bytes needed\r\n", (int)udp_Sock_size, SIZEOF(_udp_Socket));
669 if (p != buf)
670 {
671 (*_printf) ("Watt-32 development error:\r\n%s", buf);
672 exit (-1);
673 }
674}
675
676static void check_time_t (size_t time_t_size)
677{
678#if 0
679 /*
680 * I'm not sure a 32-bit 'time_t' is needed for ABI compatibility (?).
681 * \note: a 'long' is still 32-bit on Win64.
682 */
683 if (time_t_size && time_t_size != sizeof(long))
684 {
685 (*_printf) ("Size mismatch in 'time_t'. Your application may break in "
686 "mysterious ways.\n"
687#if defined(_MSC_VER) || defined(__MINGW32__)
688 "Build with \"-D_USE_32BIT_TIME_T\"\n"
689#endif
690 );
691 }
692#endif
693 (void) time_t_size;
694}
695#endif /* USE_DEBUG */
696
697#if defined(__MINGW32__)
698/*
699 * Try to detect the situation where the 'MinGW32.mak' file was
700 * erroneously used to build a 64-bit Watt-32 DLL. Since in MinGW-w64
701 * or TDM-gcc, 'gcc' w/o '-m32', will generate 64-bit code, the result from
702 * 'MinGW32.mak' is '../bin/watt-32.dll'. And not '../bin/watt-32_64.dll'
703 * as was my intention behind the 'MinGW*.mak' namings.
704 */
705static void check_mingw (void)
706{
707 return; /* \todo: Find a clever way to detect the above error. */
708}
709#endif
710
711/*
712 * Return error text for watt_sock_init() result.
713 */
714const char *W32_CALL sock_init_err (int rc)
715{
716 enum eth_init_result rc2 = rc;
717
718 switch (rc2)
719 {
720 case WERR_ILL_DOSX:
721 return _LANG ("Illegal DOS-extender and library combination");
722
723 case WERR_NO_MEM:
724 return _LANG ("No memory for buffers");
725
726 case WERR_PKT_ERROR:
727 return _LANG ("Error in " PKTDRVR_STR " interface");
728
729 case WERR_NO_DRIVER:
730 return _LANG ("No " PKTDRVR_STR " found");
731
732 case WERR_BOOTP_FAIL:
733 return _LANG ("BOOTP protocol failed");
734
735 case WERR_DHCP_FAIL:
736 return _LANG ("DHCP protocol failed");
737
738 case WERR_RARP_FAIL:
739 return _LANG ("RARP protocol failed");
740
741 case WERR_NO_IPADDR:
742 return _LANG ("Failed to get an IP-address");
743
744 case WERR_PPPOE_DISC:
745 return _LANG ("Timeout in PPPoE discovery");
746
747 case WERR_NO_ERROR:
748 break;
749 }
750 return _LANG ("No error");
751}
752
753/*
754 * Since 'RUNDOWN_ADD()' functions MUST be cdecl, call 'daemon_clear()'
755 * (potentially '__fastcall') via this 'daemon_clear_cdecl()'.
756 */
757static void W32_CALL daemon_clear_cdecl (void)
758{
759 daemon_clear();
760}
761
767static BOOL sock_init_called = FALSE;
768
769int W32_CALL watt_sock_init (size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
770{
771 static int rc = 0;
772
773 if (sock_init_called) /* return previous result */
774 return (rc);
775
776 sock_init_called = TRUE;
777
778 memdbg_init(); /* Init Fortify or CrtDbg; a possible no-op */
779
780#if defined(USE_DEBUG)
781 _printf = printf;
782#endif
783
784#if defined(WIN32)
785 /* Nothing to do here */
786
787#elif defined(__HIGHC__)
788 if (_mwenv != PL_ENV)
789 {
790 outsnl (_LANG("\7Only Pharlap DOS extender supported"));
791 return do_exit (rc = WERR_ILL_DOSX);
792 }
793#elif defined(WATCOM386)
794 if (!dpmi_init())
795 return do_exit (rc = WERR_ILL_DOSX);
796#endif
797
798#if (DOSX & POWERPAK)
799 if (!powerpak_init())
800 {
801 puts ("\7PowerPak initialisation failed");
802 return do_exit (rc = WERR_ILL_DOSX);
803 }
804#endif
805
806#if defined(__MINGW32__)
807 check_mingw();
808#endif
809
810#if defined(USE_DEBUG)
811 check_sock_sizes (tcp_Sock_size, udp_Sock_size);
812 check_time_t (time_t_size);
813#else
814 ARGSUSED (tcp_Sock_size);
815 ARGSUSED (udp_Sock_size);
816 ARGSUSED (time_t_size);
817#endif
818
819 /* DOSX: Set DOS far-ptr, get CPU type, use BSWAP
820 * instruction on 486+CPUs, setup DOS transfer buffer.
821 * ALL: Find DOS/Win-version, init timers etc.
822 */
823 init_misc();
824
825 setup_sig_handlers();
826
827 /* Init PKTDRVR/WinPcap/SwsVpkt, get ether-addr, set
828 * config-hook for parsing TCP-values.
829 */
830 rc = tcp_init();
831
832 if (rc && !survive_eth) /* if survive we pretend all is ok and go on */
833 return do_exit (rc); /* else failed */
834
835 _watt_is_init = TRUE;
836
837 /* UPDATE: 26FEB2006 psuggs@pobox.com
838 * Add a shutdown method to remove and clear the daemons so that
839 * we can reinitialize cleanly.
840 */
841 RUNDOWN_ADD (daemon_clear_cdecl, 1000);
842
843 /* Setup the ARP daemon, GvB 2002-09
844 */
845 _arp_init();
846
847 /* Prepare to parse WATTCP.CFG config options related
848 * to DHCP, SYSLOG, BIND, TFTP, ECHO/DISCARD clients, PPPoE and IPv6.
849 */
850#if defined(USE_DHCP)
851 DHCP_init();
852#endif
853
854#if defined(USE_BSD_API)
855 syslog_init();
856#endif
857
858#if defined(USE_BIND)
859 res_init0();
860#endif
861
862#if defined(USE_TFTP)
863 tftp_init();
864#endif
865
866#if defined(USE_ECHO_DISC)
867 echo_discard_init();
868#endif
869
870#if defined(USE_PPPOE)
871 pppoe_init();
872#endif
873
874#if defined(USE_DYNIP_CLI)
875 dynip_init();
876#endif
877
878#if defined(USE_IPV6)
879 _ip6_init();
880#endif
881
882#if defined(USE_IDNA)
883 iconv_init (0);
884#endif
885
886 old_break = tcp_cbreak (0x10);
887
888 /* The one and only atexit() handler.
889 */
890 atexit (sock_exit);
891
892 RUNDOWN_ADD (restore_sig_handlers, 3);
893
894 if (_watt_no_config && !_watt_user_config_fn)
895 {
896 if (!my_ip_addr)
897 {
898#if defined(USE_BOOTP)
899 _bootp_on = TRUE; /* if no fixed IP, try BOOTP/DHCP/RARP */
900#endif
901#if defined(USE_DHCP)
902 _dhcp_on = TRUE;
903#endif
904#if defined(USE_RARP)
905 _rarp_on = TRUE;
906#endif
907 }
908 else if (debug_on)
909 outsnl (_LANG("Fixed IP configuration."));
910 }
911
912 else if (!tcp_config(NULL))
913 {
914#if defined(USE_BOOTP)
915 _bootp_on = TRUE; /* if no config file try BOOTP/DHCP/RARP */
916#endif
917#if defined(USE_DHCP)
918 _dhcp_on = TRUE;
919#endif
920#if defined(USE_RARP)
921 _rarp_on = TRUE;
922#endif
923 }
924
925#if defined(USE_DEBUG)
926 if (debug_xmit) /* if dbug_init() called */
927 {
928 dbug_open();
929#if defined(USE_BSD_API)
930 _sock_dbug_open();
931#endif
932 }
933#endif
934
935#if defined(USE_DHCP)
936 /*
937 * If we read previously configured values okay, skip the below booting.
938 */
939 if (_dhcp_on && DHCP_read_config())
940 {
941 _dhcp_on = FALSE;
942 _bootp_on = FALSE;
943 _rarp_on = FALSE;
944 }
945#endif
946
947 /* Test and fix configured values
948 */
949 tcp_post_init();
950
951 if (_bootp_on || _dhcp_on || _rarp_on)
952 {
953 rc = tcp_do_bootp (_bootp_on, _dhcp_on, _rarp_on);
954 if (rc && !survive_eth)
955 return do_exit (rc);
956 }
957
958#if defined(USE_PPPOE)
959 if (!pppoe_start())
960 {
961 outsnl (_LANG("Timeout waiting for PADS/PADO"));
962 rc = WERR_PPPOE_DISC;
963 if (!survive_eth)
964 return do_exit (rc);
965 }
966#endif
967
968 if (!my_ip_addr) /* all boot attempts failed */
969 {
970 outsnl (_LANG("All attempt (config-file/DHCP/BOOTP/RARP) to get "
971 "a IP-address failed.\r\n"
972 "Check your configuration."));
973
976 rc = WERR_NO_IPADDR;
977 if (!survive_eth)
978 return do_exit (rc);
979 }
980
981 if (_pkt_inf) /* Warn only if we have a pktdrvr/WinPcap instance */
982 {
983#if defined(WIN32)
984 if (my_ip_addr && !pkt_check_address(my_ip_addr))
985 (*_printf) ("Warning: using same IP-address (%s) as Winsock.\n\7",
986 _inet_ntoa(NULL,my_ip_addr));
987#endif
988
989#if defined(USE_DEBUG)
990 if (sin_mask == 0)
991 outsnl ("Warning: \"NETMASK\" is 0.0.0.0 !");
992
993 if (_arp_check_gateways() == 0)
994 outsnl ("Warning: no default gateway!");
995#endif
996 }
997
998 if (dynamic_host && !reverse_lookup_myip())
999 outsnl (_LANG("Cannot reverse resolve local IP-address. "
1000 "Set \"DYNAMIC_HOST\" = 0."));
1001
1002#if defined(USE_MULTICAST)
1003 if (_multicast_on)
1004 {
1005 /* all multicast level 2 systems must join at startup
1006 */
1007 join_mcast_group (MCAST_ALL_SYST);
1008 }
1009#endif
1010
1011#if defined(USE_FRAGMENTS)
1012 /* Initialise IPv4 fragment handling.
1013 */
1014 ip4_frag_init();
1015#endif
1016
1017 /* if "ICMP_MASK_REQ = 1" in wattcp.cfg, send an ICMP_MASK_REQ.
1018 */
1019 if (_do_mask_req)
1020 icmp_send_mask_req();
1021
1022#if defined(USE_TFTP)
1023 /*
1024 * If application supplied a tftp_writer hook, try to load
1025 * the specified BOOT-file.
1026 */
1027 if (_tftp_write)
1028 tftp_boot_load();
1029#endif
1030
1031#if defined(USE_ECHO_DISC)
1032 echo_discard_start(); /* start echo/discard services */
1033#endif
1034
1035#if defined(USE_DYNIP_CLI)
1036 dynip_exec();
1037#endif
1038
1039 return (rc);
1040}
1041
1042/*
1043 * Old compatibility (if user didn't include <tcp.h>
1044 */
1045#undef sock_init
1046int W32_CALL sock_init (void);
1047int W32_CALL sock_init (void)
1048{
1049 return watt_sock_init (0, 0, sizeof(time_t));
1050}
1051
1052
1058void MS_CDECL sock_exit (void)
1059{
1060 if (_watt_is_init || sock_init_called)
1061 {
1062 _watt_is_init = sock_init_called = FALSE;
1063
1064 if (!_watt_fatal_error)
1065 tcp_shutdown();
1066
1067 /* Closed the PKTDRVR/WinPcap etc. No effect if already done.
1068 */
1069 rundown_run();
1070 }
1071}
1072
1076void W32_CALL sock_sig_exit (const char *msg, int sig)
1077{
1078#if defined(SIGBREAK)
1079 if (sig == SIGBREAK) /* should only happen for Watcom (from signal.c) */
1080 sig = SIGINT;
1081#endif
1082
1083 if (sig == SIGINT)
1084 _watt_cbroke++;
1085
1086 sock_exit(); /* calls registered rundown functions */
1087
1088 if (msg)
1089 outsnl (msg);
1090
1091#if (DOSX) /* don't pull in _streams[] for SMALL/LARGE model */
1092 fflush (stdout);
1093 fflush (stderr);
1094#endif
1095
1096
1097#if defined(__HIGHC__)
1098 /*
1099 * If "#pragma on(check_stack)" is in effect somewhere, we're sure
1100 * to crash in an atexit() function. It's not nice, but bypass them
1101 * by calling _exit(). Application should hook SIGINT itself to clean
1102 * itself up. Same applies for djgpp apps.
1103 */
1104 sig = 0; /* calls exit() */
1105
1106#elif defined(__DJGPP__)
1107 /*
1108 * Some error (in Watt-32 or djgpp's crt?) causes the INT 1B
1109 * vector not always to be restored when running with CWSDPMI. This
1110 * causes a page fault in CWSDPMI. Not nice, but circumvent this by
1111 * calling _exit(). Not sure if toggling the exceptions will help, so
1112 * leave them alone. NTVDM doesn't seem to mind we calling _exit()...
1113 */
1114/* __djgpp_exception_toggle(); */
1115 sig = 0;
1116
1117#elif !defined(__WATCOMC__)
1118 sig = 0;
1119#endif
1120
1121#if (defined(__BORLANDC__) || defined(__TURBOC__)) && !defined(__FLAT__) && !defined(WIN32)
1122 if (_stklen < 0x1000)
1123 _stklen = 0x1000; /* avoid stack-overflow during exit() */
1124#endif
1125
1126#if !defined(__POCC__)
1127 if (sig == SIGINT)
1128 _exit (-1);
1129 else
1130#endif
1131 exit (-1);
1132}
1133
1134/*
1135 * Make sure user links the correct C-libs.
1136 */
1137#if defined(_MSC_VER) && (_MSC_VER >= 1200) && 0
1138 #if defined(_DEBUG)
1139 #pragma comment (library, "wattcpvc_imp_d.lib")
1140 #else
1141 #pragma comment (library, "wattcpvc_imp.lib")
1142 #endif
1143
1144#elif defined(_MSC_VER) && (_MSC_VER >= 700) && 0
1145 #if defined(__SMALL__)
1146 #pragma comment (library, "wattcpMS.lib")
1147 #elif defined(__LARGE__)
1148 #pragma comment (library, "wattcpML.lib")
1149 #elif defined(__386__)
1150 #pragma comment (library, "wattcpMF.lib")
1151 #endif
1152#endif
bsddbug.h
_get_machine_name
int _get_machine_name(char *buf, int size)
Try asking a LAN extension of DOS for a host-name.
Definition: bsdname.c:350
bsdname.h
copyrigh.h
dynip.h
echo_discard_init
void echo_discard_init(void)
Called from watt_sock_init(): Setup config-file parser for "echo..." and "discard....
Definition: echo.c:117
echo.h
get_xby.h
ReadEthersFile
W32_FUNC void W32_CALL ReadEthersFile(void)
Read the /etc/ethers file.
Definition: geteth.c:101
idna.h
ip4_frag.h
ip6_in.h
language.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
init_misc
void W32_CALL init_misc(void)
Initialise various stuff.
Definition: misc.c:345
misc.h
set_cbreak
int set_cbreak(int want_brk)
Sets normal and extended BREAK mode.
Definition: pc_cbrk.c:130
_watt_cbroke
volatile int _watt_cbroke
Definition: pc_cbrk.c:48
misc_str.h
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
netaddr.h
nochkstk.h
tcp_cbreak
int W32_CALL tcp_cbreak(int mode)
Sets our break mode.
Definition: pc_cbrk.c:208
_arp_init
void W32_CALL _arp_init(void)
Setup config-table parse function and add background ARP deamon.
Definition: pcarp.c:1546
_arp_check_gateways
int W32_CALL _arp_check_gateways(void)
Return number of default gateways.
Definition: pcarp.c:1751
pcarp.h
BOOTP_do_boot
int BOOTP_do_boot(void)
Main BOOTP initialisation.
Definition: pcbootp.c:60
pcbootp.h
pcconfig.h
pcdbug.h
DHCP_release
void W32_CALL DHCP_release(BOOL force)
Possibly send a DHCP release.
Definition: pcdhcp.c:732
DHCP_init
void DHCP_init(void)
Initialises the DHCP config-parser.
Definition: pcdhcp.c:1431
DHCP_read_config
int W32_CALL DHCP_read_config(void)
Called from watt_sock_init() after "\c WATTCP.CFG" has been parsed.
Definition: pcdhcp.c:1826
DHCP_do_boot
int DHCP_do_boot(void)
Our first time DHCP handler.
Definition: pcdhcp.c:1085
pcdhcp.h
pcdns.h
reverse_lookup_myip
int reverse_lookup_myip(void)
Do a reverse lookup on ‘my_ip_addr’.
Definition: udp_rev.c:176
pcicmp.h
pcigmp.h
pkt_get_mtu
int pkt_get_mtu(void)
Return PKTDRVR maximum-transmit-units (MTU).
Definition: pcpkt.c:488
_pkt_inf
struct pkt_info * _pkt_inf
module data that will be locked
Definition: pcpkt.c:61
pcpkt.h
pcqueue.h
pcrarp.h
_eth_ndis3pkt
BOOL _eth_ndis3pkt
for DOS-programs only
Definition: pcsed.c:56
_eth_init
int W32_CALL _eth_init(void)
Initialize the network driver interface.
Definition: pcsed.c:634
pcsed.h
tcp_recv_win
DWORD tcp_recv_win
RWIN for BSD sockets only.
Definition: pctcp.c:138
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
_udp_allsocs
_udp_Socket * _udp_allsocs
list of udp-sockets
Definition: pctcp.c:72
hostname
char hostname[MAX_HOSTLEN+1]
Our configured hostname.
Definition: pctcp.c:58
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
_tcp_allsocs
_tcp_Socket * _tcp_allsocs
list of tcp-sockets
Definition: pctcp.c:140
pctcp.h
init_localport
WORD init_localport(void)
Allocate the "lport_inuse" bit-array from heap.
Definition: ports.c:51
powerpak.h
pppoe_init
void pppoe_init(void)
Set config-parser hook and initial values.
Definition: pppoe.c:166
pppoe_exit
void pppoe_exit(void)
Close down PPPoE by sending a PADT.
Definition: pppoe.c:209
pppoe_start
int pppoe_start(void)
Start PPPoE by doing a Discovery.
Definition: pppoe.c:184
pppoe.h
_printk_safe
int _printk_safe
Definition: printk.c:55
printk.h
profile.h
resolver.h
_bootp_on
BOOL _bootp_on
Try booting using BOOTP ?
Definition: sock_ini.c:129
tcp_shutdown
static void tcp_shutdown(void)
Abort all TCP sockets, release DHCP lease and restore signal handlers.
Definition: sock_ini.c:459
tcp_post_init
static void tcp_post_init(void)
Initialise stuff based on configured values.
Definition: sock_ini.c:526
_rarp_on
BOOL _rarp_on
Try booting using RARP ?
Definition: sock_ini.c:132
_watt_is_init
BOOL _watt_is_init
watt_sock_init() done (but with possible failed boot)
Definition: sock_ini.c:158
use_except
static BOOL use_except
Some target dependent functions.
Definition: sock_ini.c:222
sock_init_called
static BOOL sock_init_called
The main initialisation routine.
Definition: sock_ini.c:767
_watt_no_config
BOOL _watt_no_config
run with no config file (embedded/diskless)
Definition: sock_ini.c:134
_do_mask_req
BOOL _do_mask_req
do an "ICMP Mask Request" when configured
Definition: sock_ini.c:133
sock_sig_exit
void W32_CALL sock_sig_exit(const char *msg, int sig)
Exit handler for unhandled signals.
Definition: sock_ini.c:1076
survive_bootp
BOOL survive_bootp
Survive a failed BOOTP attempt.
Definition: sock_ini.c:146
tcp_init
static int tcp_init(void)
Initialise the PKTDRVR or WinPcap driver (calls _eth_init()).
Definition: sock_ini.c:496
survive_eth
BOOL survive_eth
GvB 2002-09, allows us to survive without a (working) packet driver at all - in cases where life stil...
Definition: sock_ini.c:140
do_exit
static int do_exit(int code)
Exit application if _watt_do_exit is TRUE (the default).
Definition: sock_ini.c:212
old_break
static int old_break
Original state of DOS's BREAK handler.
Definition: sock_ini.c:161
tcp_is_init
static BOOL tcp_is_init
tcp_init() called okay.
Definition: sock_ini.c:160
_dhcp_on
BOOL _dhcp_on
Try booting using DHCP ?
Definition: sock_ini.c:130
sock_exit
void MS_CDECL sock_exit(void)
Our only atexit() handler.
Definition: sock_ini.c:1058
_watt_user_config
WattUserConfigFunc W32_CALL _watt_user_config(WattUserConfigFunc fn)
A user application may call the ‘_watt_user_config()’ function prior to calling sock_init() to inject...
Definition: sock_ini.c:200
_dhcp6_on
BOOL _dhcp6_on
Try booting using DHCP6 ?
Definition: sock_ini.c:131
setup_sig_handlers
static void setup_sig_handlers(void)
Install signal-handlers for fatal errors; SIGSEGV, SIGILL, SIGTRAP, SIGFPE etc.
Definition: sock_ini.c:371
watt_sock_init
int W32_CALL watt_sock_init(size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
Definition: sock_ini.c:769
survive_dhcp
BOOL survive_dhcp
Survive a failed DHCP attempt.
Definition: sock_ini.c:152
survive_rarp
BOOL survive_rarp
Don't survive a failed RARP attempt.
Definition: sock_ini.c:157
tcp_do_bootp
static int tcp_do_bootp(BOOL try_bootp, BOOL try_dhcp, BOOL try_rarp)
Try to boot-up the stack using BOOTP, DHCP or RARP.
Definition: sock_ini.c:591
_watt_do_exit
BOOL _watt_do_exit
exit program when all boot attempts failed
Definition: sock_ini.c:136
except_handler
static void except_handler(int sig)
Definition: sock_ini.c:265
sock_ini.h
FAULT_STRUC
Definition: wdpmi.h:15
code
Definition: zinftree.h:24
tcp_Socket
Definition: wattcp.h:584
syslog2.h
tftp_init
int tftp_init(void)
Initialize config-hook for TFTP protocol.
Definition: tftp.c:577
tftp_boot_load
int tftp_boot_load(void)
Load the BOOT-file from TFTP server.
Definition: tftp.c:474
timer.h
wattcp.h
Core definitions.
wdpmi.h
winpkt.h
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/sock_ini.h Source File

  • src
sock_ini.h
Go to the documentation of this file.
1
3#ifndef _w32_SOCK_INI_H
4#define _w32_SOCK_INI_H
5
6enum eth_init_result { /* pass to sock_init_err() */
7 WERR_NO_ERROR,
8 WERR_ILL_DOSX, /* Watcom/HighC: illegal DOS-extender */
9 WERR_NO_MEM, /* All: No memory for misc. buffers */
10 WERR_NO_DRIVER, /* All: No network driver found (PKTDRVR/WinPcap) */
11 WERR_PKT_ERROR, /* All: General error in PKTDRVR/WinPcap interface */
12 WERR_BOOTP_FAIL, /* All: BOOTP protocol failed */
13 WERR_DHCP_FAIL, /* All: DHCP protocol failed */
14 WERR_RARP_FAIL, /* All: RARP protocol failed */
15 WERR_NO_IPADDR, /* All: Failed to find an IP-address */
16 WERR_PPPOE_DISC /* All: PPPoE discovery failed (timeout) */
17 };
18
19#define _bootp_on W32_NAMESPACE (_bootp_on)
20#define _dhcp_on W32_NAMESPACE (_dhcp_on)
21#define _dhcp6_on W32_NAMESPACE (_dhcp6_on)
22#define _rarp_on W32_NAMESPACE (_rarp_on)
23#define _do_mask_req W32_NAMESPACE (_do_mask_req)
24
25#define survive_eth W32_NAMESPACE (survive_eth)
26#define survive_bootp W32_NAMESPACE (survive_bootp)
27#define survive_dhcp W32_NAMESPACE (survive_dhcp)
28#define survive_rarp W32_NAMESPACE (survive_rarp)
29
30extern int _bootp_on; /* boot-up through BOOTP and/or DHCP */
31extern int _dhcp_on;
32extern int _dhcp6_on;
33extern int _rarp_on;
34extern BOOL _do_mask_req;
35extern BOOL _watt_is_init;
36
37W32_DATA BOOL _watt_do_exit;
38
39extern BOOL survive_eth, survive_bootp;
40extern BOOL survive_dhcp, survive_rarp;
41
42extern WattUserConfigFunc _watt_user_config_fn;
43
44#if !defined(sock_init) && defined(TEST_PROG)
45 #define sock_init() watt_sock_init (0, 0, sizeof(time_t))
46#endif
47
48#if defined(SWIG)
49 #undef sock_init
50 static int sock_init (void)
51 {
52 return watt_sock_init (0, 0, sizeof(time_t));
53 }
54#endif
55
56#endif
survive_bootp
BOOL survive_bootp
Survive a failed BOOTP attempt.
Definition: sock_ini.c:146
watt_sock_init
int W32_CALL watt_sock_init(size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
Definition: sock_ini.c:769
survive_rarp
BOOL survive_rarp
Don't survive a failed RARP attempt.
Definition: sock_ini.c:157
_watt_do_exit
BOOL _watt_do_exit
exit program when all boot attempts failed
Definition: sock_ini.c:136
_dhcp_on
int _dhcp_on
Try booting using DHCP ?
Definition: sock_ini.c:130
_watt_is_init
BOOL _watt_is_init
watt_sock_init() done (but with possible failed boot)
Definition: sock_ini.c:158
_do_mask_req
BOOL _do_mask_req
do an "ICMP Mask Request" when configured
Definition: sock_ini.c:133
survive_eth
BOOL survive_eth
GvB 2002-09, allows us to survive without a (working) packet driver at all - in cases where life stil...
Definition: sock_ini.c:140
_bootp_on
int _bootp_on
Try booting using BOOTP ?
Definition: sock_ini.c:129
_rarp_on
int _rarp_on
Try booting using RARP ?
Definition: sock_ini.c:132
survive_dhcp
BOOL survive_dhcp
Survive a failed DHCP attempt.
Definition: sock_ini.c:152
_dhcp6_on
int _dhcp6_on
Try booting using DHCP6 ?
Definition: sock_ini.c:131


Watt-32 tcp/ip: E:/WATT/src/sock_io.c Source File

  • src
sock_io.c
Go to the documentation of this file.
1
7#include <stdio.h>
8#include <stdlib.h>
9#include <string.h>
10
11#include "copyrigh.h"
12#include "wattcp.h"
13#include "misc.h"
14#include "misc_str.h"
15#include "pcconfig.h"
16#include "pctcp.h"
17
18/*
19 * sock_putc - put a character
20 * - no expansion but flushes on CR/LF
21 * - returns character
22 */
23BYTE W32_CALL sock_putc (sock_type *s, BYTE c)
24{
25#if !defined(USE_UDP_ONLY)
26 if (c == '\n' || c == '\r')
27 sock_flushnext (s);
28#endif
29 sock_write (s, &c, 1);
30 return (c);
31}
32
33
34/*
35 * sock_puts - does not append carriage return in binary mode
36 * - returns length.
37 * - only accepts ASCII strings.
38 */
39int W32_CALL sock_puts (sock_type *s, const BYTE *data)
40{
41 int len;
42
43#if defined(USE_BSD_API)
44 if (s->raw.ip_type == IP4_TYPE)
45 return (0); /* not supported yet */
46#endif
47
48 len = strlen ((const char*)data);
49
50 if (!(s->tcp.sockmode & SOCK_MODE_BINARY)) /* udp/tcp ASCII mode */
51 {
52 BYTE tmp [MAX_IP4_DATA];
54 if (len > 0) /* merge in a newline */
55 {
56 len = min (len, SIZEOF(tmp)-2); /* May truncate, tough luck */
57 memcpy (&tmp, data, len);
58 tmp [len++] = '\r';
59 tmp [len++] = '\n';
60 data = tmp;
61 }
62 else
63 {
64 data = (const BYTE*) "\r\n";
65 len = 2;
66 }
67 len = sock_write (s, data, len);
68 }
69 else
70 {
71#if !defined(USE_UDP_ONLY)
72 sock_flushnext (s);
73#endif
74 len = sock_write (s, data, len);
75 }
76 return (len);
77}
78
79
80/*
81 * sock_gets - read a {\r|\n} terminated string from a UDP/TCP socket.
82 * - return length of returned string
83 * - removes end of line terminator(s)
84 * - Quentin Smart and Mark Phillips fixed some problems
85 *
86 * BIG WARNING: Don't use sock_gets() for packetised protocols like
87 * SSH. Only suitable for ASCII orientented protocols
88 * like POP3/SMTP/NNTP etc.
89 */
90WORD W32_CALL sock_gets (sock_type *s, BYTE *data, int bmax)
91{
92 int len = 0, frag = 0;
93 BYTE *nl_p, *cr_p, eol;
94
95#if defined(USE_BSD_API)
96 if (s->raw.ip_type == IP4_TYPE)
97 return (0); /* raw sockets not supported */
98#endif
99
100#if !defined(USE_UDP_ONLY)
101 if (s->udp.ip_type == TCP_PROTO &&
102 s->tcp.missed_seq[0] != s->tcp.missed_seq[1])
103 frag = s->tcp.missed_seq[1] - s->tcp.recv_next;
104#endif
105
106 if (s->tcp.sockmode & SOCK_MODE_SAWCR)
107 {
108 s->tcp.sockmode &= ~SOCK_MODE_SAWCR;
109 if (s->tcp.rx_datalen > 0 &&
110 (*s->tcp.rx_data == '\n' || *s->tcp.rx_data == '\0'))
111 {
112 memmove (s->tcp.rx_data, s->tcp.rx_data + 1, frag + s->tcp.rx_datalen);
113 s->tcp.rx_datalen--;
114 }
115 }
116
117 /* Return if there is nothing in the buffer.
118 */
119 if (s->tcp.rx_datalen == 0)
120 return (0);
121
122 /* If there is space for all the data, then copy all of it,
123 * otherwise, only copy what the space will allow (taking
124 * care to reserve space for the null terminator.
125 */
126 --bmax;
127 if (bmax > s->tcp.rx_datalen)
128 bmax = s->tcp.rx_datalen;
129 memcpy (data, s->tcp.rx_data, bmax);
130 data [bmax] = '\0';
131
132 /* At this point, data is a null-terminated string,
133 * containing as much of the data as is possible.
134 */
135 len = bmax;
136
137 /* Because we are in ASCII mode, we assume that the
138 * sender will be consistent in which kind of CRLF is
139 * sent (e.g. one and only one of \r\n, \r0, \r, or \n).
140 * So if both \r and \n are found, we assume that they
141 * are always next to each other, and \n\r is invalid.
142 */
143
144 /* Zero the first occurance of \r and \n in data.
145 */
146 cr_p = (BYTE*) memchr (data, '\r', bmax);
147 if (cr_p)
148 *cr_p = '\0';
149
150 nl_p = (BYTE*) memchr (data, '\n', bmax);
151 if (nl_p)
152 *nl_p = '\0';
153
154#if !defined(USE_UDP_ONLY)
155 /*
156 * Handle flushed end of strings EE 02.02.28
157 */
158 if (s->tcp.ip_type == TCP_PROTO)
159 {
160 if ((s->tcp.locflags & LF_GOT_PUSH) && !cr_p)
161 {
162 cr_p = data + bmax;
163 s->tcp.locflags &= ~LF_GOT_PUSH;
164 }
165
166 /* Return if we did not find '\r' or '\n' yet, but still had room,
167 * *and* the connection can get more data!
168 */
169 if (!cr_p && !nl_p &&
170 (bmax > s->tcp.rx_datalen) &&
171 ((UINT)s->tcp.rx_datalen < s->tcp.max_rx_data) &&
172 (s->tcp.state != tcp_StateLASTACK) &&
173 (s->tcp.state != tcp_StateCLOSED))
174 {
175 *data = '\0';
176 return (0);
177 }
178 }
179#endif
180
181 /* If we did find a terminator, then stop there.
182 */
183 if (cr_p || nl_p)
184 {
185 /* Find the length of the first line of data in 'data'.
186 */
187 len = (int) (nl_p == NULL ? (char*)cr_p - (char*)data :
188 cr_p == NULL ? (char*)nl_p - (char*)data :
189 nl_p < cr_p ? (char*)nl_p - (char*)data :
190 (char*)cr_p - (char*)data);
191
192 /* We found a terminator character ...
193 */
194 bmax = len + 1;
195
196 /* If '\r' at end of data, might get a '\0' or '\n' in next packet
197 */
198 if (cr_p && s->tcp.rx_datalen == bmax)
199 s->tcp.sockmode |= SOCK_MODE_SAWCR;
200
201 /* ... and it could have been "\r\0" or "\r\n".
202 */
203 eol = s->tcp.rx_data [bmax];
204 if ((s->tcp.rx_datalen > bmax) &&
205 (eol == '\0' || (cr_p && eol == '\n')))
206 bmax++;
207 }
208
209 /* Remove the first line from the buffer.
210 */
211 s->tcp.rx_datalen -= bmax;
212 if (frag || s->tcp.rx_datalen > 0)
213 memmove (s->tcp.rx_data, s->tcp.rx_data + bmax, frag + s->tcp.rx_datalen);
214
215#if !defined(USE_UDP_ONLY)
216 /*
217 * Update window if less than MSS/2 free in receive buffer
218 */
219 if (s->tcp.ip_type == TCP_PROTO &&
220 s->tcp.state != tcp_StateCLOSED &&
221 (s->tcp.max_rx_data - s->tcp.rx_datalen) < s->tcp.max_seg/2)
222 TCP_SENDSOON (&s->tcp);
223#endif
224
225 return (len);
226}
227
228/*
229 * Return a single character.
230 * Returns EOF on fail (no data or connection closed).
231 */
232int W32_CALL sock_getc (sock_type *s)
233{
234 BYTE ch = 0;
235 return (sock_read (s, &ch, 1) < 1 ? EOF : ch);
236}
237
246WORD W32_CALL sock_dataready (sock_type *s)
247{
248 char *p;
249 int len = s->tcp.rx_datalen;
250
251#if defined(USE_BSD_API)
252 if (s->raw.ip_type == IP4_TYPE)
253 return (0); /* not supported yet */
254#endif
255
256 if (len && !(s->tcp.sockmode & SOCK_MODE_BINARY)) /* ASCII mode */
257 {
258 p = (char*)s->tcp.rx_data;
259
260 if (s->tcp.sockmode & SOCK_MODE_SAWCR) /* !! S. Lawson */
261 {
262 s->tcp.sockmode &= ~SOCK_MODE_SAWCR;
263 if (*p == '\n' || *p == '\0')
264 {
265 s->tcp.rx_datalen = --len;
266 memmove (p, p+1, s->tcp.rx_datalen);
267 if (!len)
268 return (0);
269 }
270 }
271
272 if ((UINT)len == s->tcp.max_rx_data)
273 return (len);
274
275 if (s->tcp.ip_type == TCP_PROTO) /* GV 99.12.02 */
276 {
277 if (s->tcp.state == tcp_StateLASTACK) /* EE 99.07.02 */
278 return (len);
279
280 /* S. Lawson - happens if final ACK arrives before app reads data
281 */
282 if (s->tcp.state == tcp_StateCLOSED)
283 return (len);
284 }
285
286 /* check for terminating `\r' and/or `\n'
287 */
288 if (memchr(p, '\r', len))
289 return (len);
290 if (memchr(p, '\n', len)) /* EE added 99/04/30 */
291 return (len);
292 return (0);
293 }
294 return (len);
295}
296
297#ifdef NOT_YET
301int W32_CALL sock_putcw (sock_type *s, wchar_t ch)
302{
303}
304
308int W32_CALL sock_putsw (sock_type *s, const wchar_t *data)
309{
310}
311
315int W32_CALL sock_getsw (sock_type *s, wchar_t *data, int n)
316{
317}
318
322wchar_t W32_CALL sock_getcw (sock_type *s)
323{
324}
325#endif
326
copyrigh.h
misc.h
misc_str.h
pcconfig.h
pctcp.h
sock_getsw
int W32_CALL sock_getsw(sock_type *s, wchar_t *data, int n)
Definition: sock_io.c:315
sock_putsw
int W32_CALL sock_putsw(sock_type *s, const wchar_t *data)
Definition: sock_io.c:308
sock_getcw
wchar_t W32_CALL sock_getcw(sock_type *s)
Definition: sock_io.c:322
sock_putcw
int W32_CALL sock_putcw(sock_type *s, wchar_t ch)
Definition: sock_io.c:301
sock_dataready
WORD W32_CALL sock_dataready(sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
Definition: sock_io.c:246
sock_puts
int W32_CALL sock_puts(sock_type *s, const BYTE *data)
Definition: sock_io.c:39
_raw_Socket::ip_type
WORD ip_type
same ofs as for udp/tcp Socket
Definition: wattcp.h:667
tcp_Socket::max_seg
UINT max_seg
MSS for this connection.
Definition: wattcp.h:630
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
tcp_Socket::missed_seq
DWORD missed_seq[2]
S.
Definition: wattcp.h:637
tcp_Socket::recv_next
DWORD recv_next
SEQ number we expect to receive.
Definition: wattcp.h:595
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/sock_prn.c Source File

  • src
sock_prn.c
Go to the documentation of this file.
1
4#include <stdio.h>
5#include <stdarg.h>
6#include <string.h>
7
8#include "copyrigh.h"
9#include "wattcp.h"
10#include "misc_str.h"
11#include "language.h"
12#include "pcconfig.h"
13#include "pctcp.h"
14
15int MS_CDECL sock_printf (sock_type *s, const char *fmt, ...)
16{
17 char buf [tcp_MaxBufSize];
18 int len;
19 va_list args;
20
21 va_start (args, fmt);
22
23#if defined(VSNPRINTF)
24 len = VSNPRINTF (buf, sizeof(buf)-1, fmt, args);
25
26 /* Some versions of snprintf return -1 if they'd truncate
27 * the output. Others return <buf_size> or greater.
28 */
29 if (len < 0 || len >= SIZEOF(buf)-1)
30 {
31 outsnl (_LANG("ERROR: sock_printf() overrun"));
32 len = sizeof(buf)-1;
33 buf [len] = '\0';
34 }
35#else
36 len = vsprintf (buf, fmt, args);
37 if (len > SIZEOF(buf))
38 {
39 outsnl (_LANG("ERROR: sock_printf() overrun"));
40 return (0);
41 }
42#endif
43
44 sock_puts (s, (const BYTE*)buf);
45
46 va_end (args);
47 return (len);
48}
49
copyrigh.h
language.h
misc_str.h
pcconfig.h
pctcp.h
sock_puts
int W32_CALL sock_puts(sock_type *s, const BYTE *data)
Definition: sock_io.c:39
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/sock_scn.c Source File

  • src
sock_scn.c
Go to the documentation of this file.
1
5#include <stdio.h>
6#include <stdarg.h>
7#include <string.h>
8
9#include "copyrigh.h"
10#include "wattcp.h"
11#include "misc.h"
12#include "pctcp.h"
13
14#if defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(__WATCOMC__)
15 #define HAVE_VSSCANF
16#endif
17
18#if defined(_MSC_VER) && (_MSC_VER >= 1700) /* VS-Express 2013, cl 18.x */
19 #define HAVE_VSSCANF
20#endif
21
22#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x0700) /* CBuilder (bcc32c v 7.0) */
23 #define HAVE_VSSCANF
24#endif
25
26#if defined(_MSC_VER) && defined(WIN32) && !defined(_M_X64) /* Not for 64-bit compilers */
27/*
28 * Converted to MSVC-asm by Gisle Vanem.
29 * Originally written for gcc-asm:
30 * By aaronwl 2003-01-28 for mingw-msvcrt.
31 * Public domain: all copyrights disclaimed, absolutely no warranties.
32 */
33__declspec(naked) static int vsscanf_msvc_asm (const char *s, const char *format, va_list arg)
34{
35#if 0
36 int ret;
37
38 __asm__(
39
40 // allocate stack (esp += frame - arg3 - (8[arg1,2] + 12))
41 "movl %%esp, %%ebx\n\t"
42 "lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t"
43 "subl %5, %%esp\n\t"
44
45 // set up stack
46 "movl %1, 0xC(%%esp)\n\t" // s
47 "movl %2, 0x10(%%esp)\n\t" // format
48 "lea 0x14(%%esp), %%edi\n\t"
49 "movl %%edi, (%%esp)\n\t" // memcpy dest
50 "movl %5, 0x4(%%esp)\n\t" // memcpy src
51 "movl %5, 0x8(%%esp)\n\t"
52 "subl %6, 0x8(%%esp)\n\t" // memcpy len
53 "call _memcpy\n\t"
54 "addl $12, %%esp\n\t"
55
56 "call _sscanf\n\t"
57
58 "movl %%ebx, %%esp\n\t" // restore stack
59
60 : "=a"(ret), "=c"(s), "=d"(format)
61 : "1"(s), "2"(format), "S"(arg),
62 "a"(&ret)
63 : "ebx");
64
65 return ret;
66
67#else
68 _asm {
69 mov ebx, esp
70 lea esp, [esp+6-24]
71 sub esp, 5
72
73 mov eax, [ebx+4]
74 mov [esp+0Ch], eax // s
75 mov eax, [ebx+8]
76 mov [esp+10h], eax // format
77
78 }
79#endif
80}
81#endif /* _MSC_VER && WIN32 && !_M_X64 */
82
83
84/*
85 * MSC/DMC/DJGPP 2.01 doesn't have vsscanf().
86 * On Windows (MSVC) there's nothing to be done yet :-(
87 */
88#if defined(WIN32) && !defined(HAVE_VSSCANF)
89 static int vsscanf (const char *buf, const char *fmt, va_list arglist)
90 {
91 #if defined(_MSC_VER) && 0
92 return vsscanf_msvc_asm (buf, fmt, arglist);
93 #else
94 ARGSUSED (buf);
95 ARGSUSED (fmt);
96 ARGSUSED (arglist);
97 UNIMPLEMENTED();
98 return (0);
99 #endif
100 }
101#elif defined(__DJGPP__) && (DJGPP_MINOR < 2)
102 static int vsscanf (const char *buf, const char *fmt, va_list arglist)
103 {
104 FILE *fil = stdin;
105 fil->_ptr = (char*) buf;
106 return _doscan (fil, fmt, arglist);
107 }
108 /* MSVC (on DOS) or DMC (on any) */
109#elif (defined(_MSC_VER) && defined(__MSDOS__)) || defined(__DMC__)
110 static int vsscanf (const char *buf, const char *fmt, va_list arglist)
111 {
112 extern _input (FILE*, const char*, va_list);
113 FILE *fil = stdin;
114 fil->_ptr = (char*) buf;
115 return _input (fil, fmt, arglist);
116 }
117#endif
118
119/*
120 * sock_scanf - Read a line and return number of fields matched.
121 *
122 * BIG WARNING: Don't use this for packetised protocols like
123 * SSH. Only suitable for ASCII orientented protocols
124 * like POP3/SMTP/NNTP etc.
125 *
126 * NOTE: Don't use {\r\n} in 'fmt' (it's stripped in sock_gets).
127 */
128int MS_CDECL sock_scanf (sock_type *s, const char *fmt, ...)
129{
130 char buf [tcp_MaxBufSize];
131 int fields = 0;
132 int status, len;
133
134 while ((status = sock_dataready(s)) == 0)
135 {
136 if (status == -1)
137 return (-1);
138
139 len = sock_gets (s, (BYTE*)buf, sizeof(buf));
140 if (len > 0)
141 {
142 va_list args;
143 va_start (args, fmt);
144 fields = vsscanf (buf, fmt, args);
145 va_end (args);
146 break;
147 }
148 }
149 return (fields);
150}
151
copyrigh.h
misc.h
pctcp.h
sock_dataready
WORD W32_CALL sock_dataready(sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
Definition: sock_io.c:246
esp
Definition: esp.h:44
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/sock_sel.c Source File

  • src
sock_sel.c
Go to the documentation of this file.
1
4#include <stdio.h>
5
6#include "copyrigh.h"
7#include "wattcp.h"
8#include "pcbuf.h"
9#include "pctcp.h"
10
11/*
12 * sock_sselect - returns one of several constants indicating
13 * SOCKESTABLISHED - tcp connection has been established
14 * SOCKDATAREAY - tcp/udp data ready for reading
15 * SOCKCLOSED - socket has been closed
16 */
17int W32_CALL sock_sselect (const sock_type *s, int waitstate)
18{
19 /* are we connected ?
20 */
21 if (waitstate == SOCKDATAREADY && s->tcp.rx_datalen > 0)
22 return (SOCKDATAREADY);
23
24 if (s->tcp.ip_type == 0)
25 return (SOCKCLOSED);
26
27 if (waitstate == SOCKESTABLISHED)
28 {
29 if (s->tcp.ip_type == UDP_PROTO ||
30 s->tcp.state == tcp_StateESTAB ||
31 s->tcp.state == tcp_StateESTCL ||
32 s->tcp.state == tcp_StateCLOSWT)
33 return (SOCKESTABLISHED);
34 }
35 return (0);
36}
37
38/*
39 * Returns 'simplified' enum telling what state the tcp socket is currently
40 * in, GvB 2002-09
41 */
42enum TCP_SIMPLE_STATE W32_CALL tcp_simple_state (const _tcp_Socket *s)
43{
44 if (s->ip_type != TCP_PROTO ||
45 s->state == tcp_StateCLOSED)
46 return (TCP_CLOSED);
47
48 if (s->state == tcp_StateLISTEN)
49 return (TCP_LISTENING);
50
51 if (s->state < tcp_StateESTAB)
52 return (TCP_OPENING);
53
54 if (s->state == tcp_StateESTAB)
55 return (TCP_OPEN);
56
57 return (TCP_CLOSING);
58}
59
copyrigh.h
pcbuf.h
pctcp.h
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/socket.c Source File

  • src
socket.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP.
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 * 0.6 : Aug 06, 2002 : G. Vanem - added AF_INET6 support
37 */
38
39#include "socket.h"
40#include "pcdbug.h"
41#include "pcicmp6.h"
42#include "pcdns.h"
43
44#if defined(USE_BSD_API) /* rest of file */
45
46static int sk_block = 0; /* sock_daemon() semaphore */
47static int sk_last = SK_FIRST+1; /* highest socket number + 1 */
48static Socket *sk_list = NULL;
49static DWORD raw_seq = 0;
50
51static int (*tcp_syn_hook) (_tcp_Socket **tcp) = NULL;
52static int (*ip4_raw_hook) (const in_Header *ip) = NULL;
53
54#if defined(USE_IPV6)
55static int (*ip6_raw_hook) (const in6_Header *ip) = NULL;
56#endif
57
62#define SOCK_HASH_SIZE 64 /* must be 2^n */
63
64static Socket *sk_hashes [SOCK_HASH_SIZE];
65
66#if 0
67 static __inline Socket *sock_hash_get (int fd)
68 {
69 return sk_hashes [fd & (SOCK_HASH_SIZE-1)];
70 }
71 static __inline void sock_hash_add (int fd, Socket *sock)
72 {
73 sk_hashes [fd & (SOCK_HASH_SIZE-1)] = sock;
74 }
75#else
76 #define sock_hash_get(fd) sk_list
77 #define sock_hash_add(fd,sock) ((void)0)
78#endif
79
83void *_sock_calloc (size_t size, const char *file, unsigned line)
84{
85 void *ptr;
86
87#if defined(WATCOM386) && 0 /* find DOS4GW bug! */
88 int rc = _heapset (0xCC);
89
90 if (rc != _HEAPOK && rc != _HEAPEMPTY)
91 SOCK_FATAL (("%s (%u) Fatal: heap corrupt\n", file, line));
92#endif
93
94#if defined(_CRTDBG_MAP_ALLOC) /* MSVC _DEBUG */
95 ptr = _calloc_dbg (size, 1, _NORMAL_BLOCK, file, (int)line);
96#else
97 ptr = calloc (size, 1);
98#endif
99
100 if (!ptr)
101 {
102#if defined(WATCOM386) && 0 /* find DOS4GW bug! */
103 struct _heapinfo hi;
104 _heapwalk (&hi);
105#endif
106 SOCK_FATAL (("%s (%u) Fatal: Allocation failed\n", file, line));
107 }
108
109 ARGSUSED (file);
110 ARGSUSED (line);
111 return (ptr);
112}
113
128static fd_set inuse [NUM_SOCK_FDSETS]; /* MAX_SOCKETS/8 = 625 bytes */
129
130static int sock_alloc_fd (char **err)
131{
132 int fd;
133
134 *err = NULL;
135
136#if defined(__DJGPP__) && defined(USE_FSEXT)
137 {
138 static char err_buf[100];
139
140 err_buf[0] = '\0';
141 fd = __FSEXT_alloc_fd (_fsext_demux);
142
143 if (fd < 0)
144 {
145 sprintf (err_buf, "FSEXT_alloc_fd() failed; %s", strerror(errno));
146 *err = err_buf;
147 return (-1);
148 }
149
150 if (FD_ISSET(fd, &inuse[0]))
151 {
152 sprintf (err_buf, "Reusing existing socket %d", fd);
153 *err = err_buf;
154 return (-1);
155 }
156 }
157
158#if (DJGPP_MINOR >= 4) && 0
159 {
160 char dev_name[20];
161
162 snprintf (dev_name, sizeof(dev_name), "/dev/socket/%d", fd);
163 __set_fd_properties (fd, dev_name, 0); /* last arg? */
164 __set_fd_flags (fd, FILE_DESC_TEMPORARY); /* auto close socket */
165 }
166#endif
167
168#else /* __DJGPP__ && USE_FSEXT */
169
170 for (fd = SK_FIRST; fd < sk_last; fd++)
171 if (!FD_ISSET(fd, &inuse[0]) && /* not marked as in-use */
172 !_socklist_find(fd)) /* don't use a dying socket */
173 break;
174
175#endif /* __DJGPP__ && USE_FSEXT */
176
177 if (fd < MAX_SOCKETS)
178 {
179 if (fd == sk_last)
180 sk_last++;
181
182 FD_SET (fd, &inuse[0]);
183 return (fd);
184 }
185
186 /* No vacant bits in 'inuse' array. djgpp (and DOS) could theoretically
187 * return a file-handle > 'MAX_SOCKETS-1'.
188 */
189 *err = (char*) "No more sockets";
190 return (-1);
191}
192
202BOOL _sock_dos_fd (int s)
203{
204 if (s >= fileno(stdin) && s <= fileno(stderr)) /* 0..2 (redirected) */
205 return (TRUE);
206
207 if (s > fileno(stderr) && isatty(s))
208 return (TRUE);
209
210#if defined(WIN32)
211 {
212 HANDLE hnd = (s > 0 ? (HANDLE)_get_osfhandle (s) : INVALID_HANDLE_VALUE);
213 if (hnd != INVALID_HANDLE_VALUE)
214 {
215 CloseHandle (hnd);
216 return (TRUE);
217 }
218 }
219#endif
220
221 return (FALSE);
222}
223
232int _sock_set_rcv_buf (sock_type *s, size_t len)
233{
234 len = min (len+8,USHRT_MAX); /* add room for head/tail markers */
235 return sock_setbuf (s, (BYTE*)malloc(len), len);
236
237 /* Note: the ret-val from above malloc() is freed below.
238 * Normally via tcp_daemon(). The freeing can take some time.
239 * Hence reports about memory leaks (from e.g. MSVC debug-builds)
240 * are not so important.
241 */
242}
243
247void _sock_free_rcv_buf (sock_type *s)
248{
249 if (s->tcp.rx_data && /* if xx_open() called */
250 s->tcp.rx_data != &s->tcp.rx_buf[0])
251 {
252 *(DWORD*)(s->tcp.rx_data-4) = 0; /* clear marker */
253 free (s->tcp.rx_data-4);
254 s->tcp.rx_data = &s->tcp.rx_buf[0];
255 s->tcp.rx_datalen = 0;
256 }
257}
258
264static __inline Socket *sk_list_del (int s)
265{
266 Socket *sock, *last, *next;
267
268 for (sock = last = sock_hash_get(s); sock; last = sock, sock = next)
269 {
270 next = sock->next;
271 if (sock->fd != s)
272 continue;
273
274 if (sock == sk_list)
275 sk_list = next;
276 else last->next = next;
277 sock_hash_add (s, NULL);
278 free (sock);
279 return (next);
280 }
281 return (NULL);
282}
283
288const sock_type *__get_sock_from_s (int s, int proto)
289{
290 Socket *sock = _socklist_find (s);
291
292 if (!sock)
293 return (NULL);
294
295 if (proto == UDP_PROTO)
296 return (sock_type*) sock->udp_sock;
297
298 if (proto == TCP_PROTO)
299 return (sock_type*) sock->tcp_sock;
300
301 if (proto == IPPROTO_IP)
302 return (sock_type*) sock->raw_sock;
303
304 return (NULL);
305}
306
311static __inline BOOL other_tcp_listeners (const Socket *_this)
312{
313 const Socket *sock;
314
315 for (sock = sk_list; sock; sock = sock->next)
316 if (sock->so_type == SOCK_STREAM &&
317 (sock->so_options & SO_ACCEPTCONN) &&
318 sock != _this)
319 return (TRUE);
320 return (FALSE);
321}
322
323void _sock_set_syn_hook (int (*func)(_tcp_Socket**))
324{
325 tcp_syn_hook = func;
326}
327
332static __inline BOOL other_raw_socks (const Socket *_this)
333{
334 const Socket *sock;
335
336 for (sock = sk_list; sock; sock = sock->next)
337 if (sock->so_type == SOCK_RAW && sock != _this)
338 return (TRUE);
339 return (FALSE);
340}
341
346static BOOL mcast_set = FALSE;
347static BOOL promis_set = FALSE;
348
349BOOL _sock_set_normal_rx_mode (const Socket *_this)
350{
351 const Socket *sock;
352 BOOL rc = TRUE;
353
354#if defined(USE_MULTICAST)
355 if (num_mcast_active() > 0)
356 return (rc);
357#endif
358
359 for (sock = sk_list; sock; sock = sock->next)
360 if (sock != _this &&
361 (sock->so_family == AF_INET6 || sock->so_type == SOCK_PACKET))
362 break;
363
364 if (!sock)
365 {
366 rc = pkt_set_rcv_mode (RXMODE_BROADCAST);
367 if (!rc)
368 SOCK_DEBUGF (("\n setting normal rx-mode failed; %s",
369 pkt_strerror(_pkt_errno)));
370 _pkt_forced_rxmode = RXMODE_BROADCAST;
371 mcast_set = FALSE;
372 }
373 return (rc);
374}
375
376BOOL _sock_set_mcast_rx_mode (void)
377{
378 BOOL rc = TRUE;
379
380 if (!mcast_set)
381 {
382#if defined(USE_IPV6)
383 rc = _ip6_pkt_init();
384#else
385 rc = pkt_set_rcv_mode (RXMODE_MULTICAST2);
386#endif
387 }
388
389 mcast_set = TRUE;
390 return (rc);
391}
392
393BOOL _sock_set_promisc_rx_mode (void)
394{
395 BOOL rc = TRUE;
396
397 if (!promis_set)
398 rc = pkt_set_rcv_mode (RXMODE_PROMISCOUS);
399 promis_set = TRUE;
400 return (rc);
401}
402
406static void sock_raw_del (Socket *sock)
407{
408#if defined(USE_IPV6)
409 if (sock->so_family == AF_INET6)
410 {
411 _raw6_Socket *raw, *next;
412
413 if (!other_raw_socks(sock))
414 ip6_raw_hook = NULL;
415
416 for (raw = sock->raw6_sock; raw; raw = next)
417 {
418 raw->ip_type = 0;
419 next = raw->next;
420 free (raw);
421 }
422 sock->raw6_sock = NULL;
423 }
424 else
425#endif
426 {
427 _raw_Socket *raw, *next;
428
429 if (!other_raw_socks(sock))
430 ip4_raw_hook = NULL;
431
432 for (raw = sock->raw_sock; raw; raw = next)
433 {
434 raw->ip_type = 0;
435 next = raw->next;
436 free (raw);
437 }
438 sock->raw_sock = NULL;
439 }
440}
441
445static BOOL sock_packet_add (Socket *sock)
446{
447 sock_packet_pool *p = SOCK_CALLOC (sizeof(*p));
448
449 sock->packet_pool = p;
450 if (!sock->packet_pool)
451 return (FALSE);
452 pktq_init (&p->queue, sizeof(p->buf[0]), DIM(p->buf), (char*)p->buf);
453 return (TRUE);
454}
455
456static void sock_packet_del (Socket *sock)
457{
458 if (sock->packet_pool)
459 {
460 /* SOCK_DEBUGF ((", num-drops %lu", sock->packet_pool->queue.num_drop); */
461 free (sock->packet_pool);
462 }
463 sock->packet_pool = NULL;
464 _eth_recv_peek = sock->old_eth_peek;
465}
466
467/*
468 * Receiver for SOCK_PACKET sockets
469 */
470static int W32_CALL sock_packet_peek (const union link_Packet *pkt)
471{
472 Socket *sock, *last = NULL;
473
474 for (sock = sk_list; sock; sock = sock->next)
475 if (sock->so_type == SOCK_PACKET && sock->packet_pool)
476 {
477 struct pkt_ringbuf *q = &sock->packet_pool->queue;
478 struct sock_packet_buf *rx;
479 size_t len;
480
481#if defined(USE_DEBUG)
482 if (!pktq_check(q))
483 {
484 TRACE_CONSOLE (0, "fd=%d: SOCK_PACKET queue munged\n", sock->fd);
485 pktq_clear (q);
486 continue;
487 }
488#endif
489 if (pktq_in_index(q) == q->out_index) /* no room */
490 {
491 q->num_drop++;
492 TRACE_CONSOLE (0, "fd=%d: SOCK_PACKET drops %lu\n", sock->fd, (u_long)q->num_drop);
493 continue;
494 }
495
496 rx = (struct sock_packet_buf*) pktq_in_buf (q);
497
498 if (_eth_last.rx.size > 0) /* Only for Win32 or USE_FAST_PKT */
499 len = _eth_last.rx.size;
500 else len = sizeof(rx->rx_buf) - 4;
501
502 memcpy (rx->rx_buf, pkt, len);
503 rx->rx_len = len;
504 pktq_inc_in (q);
505 last = sock;
506 }
507
508 if (last && last->old_eth_peek && last->old_eth_peek != _eth_recv_peek)
509 return (*last->old_eth_peek) ((void*)pkt);
510 return (1);
511}
512
516static char get_pkt_type_eth (const eth_Header *eth)
517{
518 if (!memcmp(&_eth_addr, &eth->destination, _eth_mac_len))
519 return (PACKET_HOST);
520 if (!memcmp(&_eth_addr, &eth->source, _eth_mac_len))
521 return (PACKET_OUTGOING);
522 if (!memcmp(&eth->destination, &_eth_brdcast, _eth_mac_len))
523 return (PACKET_BROADCAST);
524 if ((eth->destination[0] & 1) == 1)
525 return (PACKET_MULTICAST);
526 return (PACKET_OTHERHOST); /* To someone else */
527}
528
529static char get_pkt_type_fddi (const fddi_Header *fddi)
530{
531 if (!memcmp(&_eth_addr, &fddi->destination, _eth_mac_len))
532 return (PACKET_HOST);
533 if (!memcmp(&_eth_addr, &fddi->source, _eth_mac_len))
534 return (PACKET_OUTGOING);
535 if (!memcmp(&fddi->destination, &_eth_brdcast, _eth_mac_len))
536 return (PACKET_BROADCAST);
537 if ((fddi->destination[0] & 1) == 1)
538 return (PACKET_MULTICAST);
539 return (PACKET_OTHERHOST); /* To someone else */
540}
541
542static char get_pkt_type_tok (const tok_Header *tok)
543{
544 if (!memcmp(&_eth_addr, &tok->destination, _eth_mac_len))
545 return (PACKET_HOST);
546 if (!memcmp(&_eth_addr, &tok->source, _eth_mac_len))
547 return (PACKET_OUTGOING);
548 if (!memcmp(&tok->destination, &_eth_brdcast, _eth_mac_len))
549 return (PACKET_BROADCAST);
550 if ((tok->destination[0] & 1) == 1)
551 return (PACKET_MULTICAST);
552 return (PACKET_OTHERHOST); /* To someone else */
553}
554
555static char get_pkt_type_arc (const arcnet_Header *arc)
556{
557 ARGSUSED (arc);
558 return (PACKET_HOST);
559}
560
561static char get_pkt_type (const union link_Packet *pkt)
562{
563 switch (_pktdevclass)
564 {
565 case PDCLASS_TOKEN:
566 return get_pkt_type_tok (&pkt->tok.head);
567 case PDCLASS_FDDI:
568 return get_pkt_type_fddi (&pkt->fddi.head);
569 case PDCLASS_ARCNET:
570 return get_pkt_type_arc (&pkt->arc.head);
571 case PDCLASS_ETHER:
572 return get_pkt_type_eth (&pkt->eth.head);
573 default:
574 return (PACKET_HOST); /* to us (assuming PPP/SLIP) */
575 }
576}
577
582unsigned sock_packet_receive (Socket *sock, void *buf, unsigned len,
583 struct sockaddr *from, size_t *fromlen)
584{
585 struct pkt_ringbuf *q;
586 struct sock_packet_buf *rx;
587
588 if (!sock->packet_pool)
589 return (0);
590
591 q = &sock->packet_pool->queue;
592 if (q->in_index == q->out_index) /* no elements */
593 return (0);
594
595 rx = (struct sock_packet_buf*) pktq_out_buf (q);
596 len = min (len, rx->rx_len);
597 memcpy (buf, rx->rx_buf, len);
598
599 if (from && fromlen)
600 {
601 struct sockaddr_ll *sa = (struct sockaddr_ll*) from;
602 BYTE hw_type, hw_len;
603
604 _eth_get_hwtype (&hw_type, &hw_len);
605 memset (from, 0, sizeof(*sa));
606 sa->sll_halen = hw_len;
607 sa->sll_hatype = hw_type;
608 sa->sll_protocol = *(WORD*) ((char*)buf+_pkt_ip_ofs-2);
609 sa->sll_ifindex = 1;
610 sa->sll_family = AF_PACKET;
611 sa->sll_pkttype = get_pkt_type ((const union link_Packet*)buf);
612 *fromlen = sizeof (*sa);
613 }
614 pktq_inc_out (q);
615 return (len);
616}
617
618/*
619 * Needed by select_s().
620 */
621unsigned sock_packet_rbused (Socket *sock)
622{
623 if (!sock->packet_pool)
624 return (0);
625 return pktq_queued (&sock->packet_pool->queue);
626}
627
628unsigned sock_packet_transmit (Socket *socket, const void *buf, unsigned len,
629 const struct sockaddr *to, int tolen)
630{
631 const struct sockaddr_ll *sa = (const struct sockaddr_ll*) to;
632 BYTE *tx;
633 int rc;
634
635 if (len <= _pkt_ip_ofs)
636 {
637 SOCK_ERRNO (EINVAL);
638 return (unsigned) -1;
639 }
640 tx = _eth_formatpacket (sa ? &sa->sll_addr : NULL,
641 sa ? sa->sll_protocol : 0);
642 tx -= _pkt_ip_ofs;
643 len = min (len, sizeof(union link_Packet));
644 memcpy (tx, buf, len);
645 rc = _eth_send (len - _pkt_ip_ofs, NULL, __FILE__, __LINE__);
646 if (rc <= 0)
647 return (unsigned) -1;
648
649 ARGSUSED (socket);
650 ARGSUSED (tolen); /* already checked by caller */
651 return (rc + _pkt_ip_ofs);
652}
653
654/*
655 * Clear 'fd' from the inuse array. For djgpp only:
656 * Free the socket from File-System Extension system.
657 * Free the duplicated handle from DOS's System File Table.
658 */
659static void sock_close_fd (int fd)
660{
661 if (fd >= SK_FIRST && fd < MAX_SOCKETS)
662 {
663 FD_CLR (fd, &inuse[0]);
664 if (fd == sk_last-1)
665 sk_last--;
666 }
667
668#if defined(__DJGPP__) && defined(USE_FSEXT)
669 __FSEXT_set_function (fd, NULL);
670 if (fd >= SK_FIRST && _close(fd) < 0)
671 SOCK_DEBUGF ((" _close() failed; %s", strerror(errno)));
672#endif
673}
674
681 Socket *_sock_del_fd (int fd, const char *file, unsigned line)
682{
683 Socket *sock, *next = NULL;
684 sock_type *sk;
685
686 SOCK_DEBUGF (("\n _sock_del_fd:%d", fd));
687
688 if (fd < SK_FIRST || fd >= sk_last || !FD_ISSET(fd, &inuse[0]))
689 {
690 SOCK_FATAL (("%s (%u) Fatal: socket %d not inuse\n", file, line, fd));
691 return (NULL);
692 }
693
694 sock = _socklist_find (fd);
695 if (!sock)
696 {
697 SOCK_FATAL (("%s (%u) Fatal: socket %d not in list\n", file, line, fd));
698 goto not_inuse;
699 }
700
701 if (sock->cookie != SAFETY_TCP) /* Aaarg! marker destroyed */
702 {
703 SOCK_FATAL (("%s (%u) fatal: socket %d (%p) overwritten\n",
704 file, line, fd, sock));
705 goto not_inuse;
706 }
707
708 switch (sock->so_type)
709 {
710 case SOCK_STREAM:
711 sk = (sock_type*) sock->tcp_sock;
712 if (sk)
713 {
714 reuse_localport (sk->tcp.myport); /* clear 'lport_inuse' bit now */
715 TCP_ABORT (&sk->tcp);
716 _sock_free_rcv_buf (sk);
717 }
718 DO_FREE (sock->tcp_sock);
719 if (!other_tcp_listeners(sock))
720 _sock_set_syn_hook (NULL);
721 break;
722
723 case SOCK_DGRAM:
724 sk = (sock_type*) sock->udp_sock;
725 if (sk)
726 {
727 reuse_localport (sk->udp.myport); /* redundant? */
728 sock_abort (sk);
729 _sock_free_rcv_buf (sk);
730 }
731 DO_FREE (sock->udp_sock);
732 break;
733
734 case SOCK_RAW:
735 sock_raw_del (sock);
736 break;
737
738 case SOCK_PACKET:
739 sock_packet_del (sock);
740 break;
741
742 default:
743 SOCK_DEBUGF (("\n _sock_del_fd:%d: unknown type %d",
744 fd, sock->so_type));
745 break;
746 }
747
748 DO_FREE (sock->local_addr);
749 DO_FREE (sock->remote_addr);
750 DO_FREE (sock->ip_opt);
751 DO_FREE (sock->bcast_pool);
752 DO_FREE (sock->packet_pool);
753
754 /* Check for any remaining IPv6/PACKET sockets.
755 */
756 if ((sock->so_family == AF_INET6 || sock->so_type == SOCK_PACKET) &&
757 _pkt_rxmode > RXMODE_BROADCAST && /* current Rx-mode not broadcast */
758 _pkt_forced_rxmode < 0) /* we didn't force a specific mode */
759 _sock_set_normal_rx_mode (sock); /* Then set normal Rx-mode */
760
761 next = sk_list_del (fd); /* delete socket from linked list */
762
763 if (sk_list == NULL) /* no more sockets, hook not needed */
764 _bsd_socket_hook = NULL;
765
766not_inuse:
767 sock_close_fd (fd);
768 ARGSUSED (file);
769 ARGSUSED (line);
770 return (next);
771}
772
773#ifdef NOT_USED
778static int sock_find_fd (const Socket *socket)
779{
780 const Socket *sock;
781
782 for (sock = sock_hash_get(socket->fd); sock; sock = sock->next)
783 if (sock == socket)
784 return (sock->fd);
785 return (-1);
786}
787
792static Socket *sock_find_udp (const _udp_Socket *udp)
793{
794 Socket *sock;
795
796 for (sock = sk_list; sock; sock = sock->next)
797 if (sock->udp_sock == udp)
798 return (sock);
799 return (NULL);
800}
801#endif /* NOT_USED */
802
806static void *sock_find_tcp (const _tcp_Socket *tcp)
807{
808 Socket *sock;
809
810 for (sock = sk_list; sock; sock = sock->next)
811 if (sock->tcp_sock == tcp)
812 return (void*)sock;
813 return (NULL);
814}
815
819int _sock_chk_sockaddr (Socket *socket, const struct sockaddr *sa, socklen_t len)
820{
821 socklen_t sa_len = (socket->so_family == AF_INET6) ? sizeof(struct sockaddr_in6) :
822 sizeof(struct sockaddr_in);
823 if (!sa || len < sa_len)
824 {
825 SOCK_DEBUGF ((", EINVAL"));
826 SOCK_ERRNO (EINVAL);
827 return (-1);
828 }
829
830 if (socket->so_type == SOCK_PACKET)
831 {
832 SOCK_DEBUGF ((", SOCK_PACKET, EAFNOSUPPORT"));
833 SOCK_ERRNO (EAFNOSUPPORT);
834 return (-1);
835 }
836
837 /* Easy way to reconnect a UDP socket.
838 */
839 if (sa->sa_family == AF_UNSPEC && socket->so_type == SOCK_DGRAM)
840 {
841 socket->so_state &= ~(SS_ISDISCONNECTING | SS_CANTSENDMORE);
842 socket->udp_sock->rx_datalen = 0; /* flush recv buf */
843 if (socket->remote_addr)
844 free (socket->remote_addr);
845 socket->remote_addr = NULL;
846
847 SOCK_DEBUGF ((", AF_UNSPEC, EAFNOSUPPORT"));
848 SOCK_ERRNO (EAFNOSUPPORT);
849 return (-1);
850 }
851
852 if (sa->sa_family != socket->so_family)
853 {
854 SOCK_DEBUGF ((", different families"));
855 SOCK_ERRNO (EAFNOSUPPORT);
856 return (-1);
857 }
858
859 VERIFY_RW (sa, len);
860 return (0);
861}
862
866static struct _raw_Socket *find_free_raw_sock (Socket *sock)
867{
868 struct _raw_Socket *raw;
869
870 if (!sock->raw_sock)
871 SOCK_FATAL (("find_raw_sock() called for non-raw sock, so_type %d\n",
872 sock->so_type));
873
874 for (raw = sock->raw_sock; raw; raw = raw->next)
875 if (!raw->used)
876 return (raw);
877 return (NULL);
878}
879
880#if defined(USE_IPV6)
881static struct _raw6_Socket *find_free_raw6_sock (Socket *sock)
882{
883 struct _raw6_Socket *raw;
884
885 if (!sock->raw6_sock)
886 SOCK_FATAL (("find_raw6_sock() called for non-raw sock, so_type %d\n",
887 sock->so_type));
888
889 for (raw = sock->raw6_sock; raw; raw = raw->next)
890 if (!raw->used)
891 return (raw);
892 return (NULL);
893}
894#endif
895
905static int sock_raw4_recv (const in_Header *ip)
906{
907 Socket *sock;
908 _raw_Socket *raw;
909 int num_enqueued = 0;
910 size_t len = ntohs (ip->length);
911
912 /* Early drop; jumbo packets won't match any raw-sockets
913 */
914 if (len > sizeof(sock->raw_sock->rx_data))
915 return (0);
916
917 /* Should SOCK_RAW allow packets not destined to us *and* not
918 * broadcast? Yes for now.
919 */
920#if 0
921 {
922 DWORD ip_dst = ntohl (ip->destination);
923
924 /* Not addressed to us or not (limited) broadcast
925 */
926 if (!_ip4_is_local_addr(ip_dst) && !_ip4_is_ip_brdcast(ip))
927 return (0);
928 }
929#endif
930
931 for (sock = sk_list; sock; sock = sock->next)
932 {
933 if (sock->so_type != SOCK_RAW)
934 continue;
935
936 if (sock->so_proto == IPPROTO_IP)
937 goto enqueue; /* socket matches every IP-protocol, enqueue */
938
939 if (ip->proto != sock->so_proto) /* isn't what we want */
940 continue;
941
942 enqueue:
943 raw = find_free_raw_sock (sock);
944 if (!raw)
945 {
946#if 1 /* Maybe user didn't bother to read it. Ignore it. */
947 SOCK_DEBUGF (("\n socket:%d, dropped raw (IP4), proto %d, id %04X",
948 sock->fd, ip->proto, ntohs(ip->identification)));
949#endif
950 continue;
951 }
952
953 /* Copy IP-header to raw_sock.ip
954 */
955 memcpy (&raw->ip, ip, sizeof(*ip));
956
957 /* Copy any options and rest of IP-packet
958 */
959 memcpy (&raw->rx_data[0], ip+1, min(len,sizeof(raw->rx_data)));
960 raw->used = TRUE;
961 raw->seq_num = ++raw_seq;
962 num_enqueued++;
963
964 if (sock->so_options & SO_DEBUG)
965 {
966 /*\todo Add SOCK_RAW debug */
967 }
968 }
969 return (num_enqueued);
970}
971
972#if defined(USE_IPV6)
973static int sock_raw6_recv (const in6_Header *ip)
974{
975 Socket *sock;
976 _raw6_Socket *raw;
977 int num_enqueued = 0;
978 int num_dropped = 0;
979 const void *dest = &ip->destination[0];
980 size_t len = ntohs (ip->len);
981
982 /* Jumbo packets won't match any raw-sockets
983 */
984 if (len > sizeof(sock->raw6_sock->rx_data))
985 return (0);
986
987 /* Not addressed to us or not multicast
988 */
989 if (memcmp(&in6addr_my_ip,dest,sizeof(in6addr_my_ip)) &&
990 !IN6_IS_ADDR_MULTICAST(dest))
991 return (0);
992
993 for (sock = sk_list; sock; sock = sock->next)
994 {
995 if (ip->next_hdr == IPPROTO_TCP && sock->so_type == SOCK_STREAM)
996 continue;
997
998 if (ip->next_hdr == IPPROTO_UDP && sock->so_type == SOCK_DGRAM)
999 continue;
1000
1001 if (sock->so_type != SOCK_RAW ||
1002 (ip->next_hdr != sock->so_proto && sock->so_proto != IPPROTO_IP))
1003 continue;
1004
1005 raw = find_free_raw6_sock (sock);
1006 if (!raw)
1007 {
1008 num_dropped++;
1009 SOCK_DEBUGF (("\n socket:%d, dropped raw (IP6), proto %d",
1010 sock->fd, ip->next_hdr));
1011 }
1012 else
1013 {
1014 /* Copy IP-header to raw6_sock.ip
1015 */
1016 memcpy (&raw->ip6, ip, sizeof(*ip));
1017
1018 /* Copy rest of IP-packet (no optios)
1019 */
1020 memcpy (&raw->rx_data[0], ip+1, min(len,sizeof(raw->rx_data)));
1021 raw->used = TRUE;
1022 raw->seq_num = ++raw_seq;
1023 num_enqueued++;
1024
1025 if (sock->so_options & SO_DEBUG)
1026 {
1027 /*\todo Add SOCK_RAW debug */
1028 }
1029 }
1030 }
1031
1032 if (num_dropped > 0)
1033 STAT (ip4stats.ips_idropped++);
1034
1035 return (num_enqueued);
1036}
1037#endif /* USE_IPV6 */
1038
1043static void do_keepalive (Socket *sock)
1044{
1045 if (sock->keepalive == 0)
1046 {
1047 if (tcp_keep_idle)
1048 sock->keepalive = set_timeout (1000 * tcp_keep_idle);
1049 }
1050 else if (sock->tcp_sock->locflags & LF_KEEPALIVE)
1051 {
1052 sock->keepalive = 0UL;
1053 }
1054 else if (chk_timeout(sock->keepalive))
1055 {
1056 _tcp_keepalive (sock->tcp_sock);
1057 SOCK_DEBUGF (("\n sock_keepalive:%d", sock->fd));
1058 sock->keepalive = 0UL;
1059 }
1060}
1061
1066static void * MS_CDECL socket_op_demux (enum BSD_SOCKET_OPS op, ...)
1067{
1068 const _tcp_Socket *tcp;
1069 void *rc = NULL;
1070 Socket *sock;
1071 va_list args;
1072
1073 va_start (args, op);
1074
1075 switch (op)
1076 {
1077 case BSO_FIND_SOCK: /* return a 'Socket*' from '_tcp_Socket*' */
1078 tcp = va_arg (args, const _tcp_Socket*);
1079 if (tcp->ip_type == TCP_PROTO)
1080 rc = sock_find_tcp (tcp);
1081 else rc = NULL;
1082 break;
1083
1084 case BSO_RST_CALLBACK: /* RST received in _tcp_handler() */
1085 tcp = va_arg (args, const _tcp_Socket*);
1086 sock = sock_find_tcp (tcp);
1087 if (sock)
1088 {
1089 sock->so_error = ECONNRESET;
1090 SOCK_DEBUGF (("\n TCP-reset:%d", sock->fd));
1091 if (tcp->rx_datalen == 0)
1092 {
1093 sock->so_state |= (SS_CONN_REFUSED | SS_CANTSENDMORE | SS_CANTRCVMORE);
1094 sock->close_time = time (NULL);
1095 sock->linger_time = TCP_LINGERTIME/40; /* 3 sec */
1096 }
1097 }
1098 else
1099 SOCK_DEBUGF (("\n TCP-reset for unknown socket??"));
1100 break;
1101
1102 case BSO_SYN_CALLBACK: /* filtering SYNs in _sock_append() */
1103 if (tcp_syn_hook)
1104 rc = IntToPtr ((*tcp_syn_hook) (va_arg(args,_tcp_Socket**)));
1105 else rc = IntToPtr (1); /* ret-val doesn't matter */
1106 break;
1107
1108 case BSO_IP4_RAW:
1109 if (ip4_raw_hook)
1110 rc = IntToPtr ((*ip4_raw_hook) (va_arg(args,const in_Header*)));
1111 break;
1112
1113 case BSO_IP6_RAW:
1114#if defined(USE_IPV6)
1115 if (ip6_raw_hook)
1116 rc = IntToPtr ((*ip6_raw_hook) (va_arg(args,const in6_Header*)));
1117#endif
1118 break;
1119
1120 case BSO_DEBUG: /* \todo trace the in/out state etc. */
1121#if 0
1122 sk = va_arg (args, const sock_type*);
1123 if (sk->tcp.ip_type == TCP_PROTO)
1124 {
1125 UINT st_in = va_arg (args, UINT);
1126 UINT st_out = va_arg (args, UINT);
1127 (*_printf) ("TCP: %s -> %s\n", st_in, st_out);
1128 }
1129 socket_debugdump (sk);
1130#endif
1131 break;
1132
1133 default:
1134 SOCK_FATAL (("%s (%u) Fatal: Unknown op-code %d\n",
1135 __FILE__, __LINE__, op));
1136 break;
1137 }
1138 va_end (args);
1139 return (rc);
1140}
1141
1149static Socket *tcp_sock_daemon (Socket *sock)
1150{
1151 Socket *next = sock->next;
1152 _tcp_Socket *tcp = sock->tcp_sock;
1153 int s = sock->fd;
1154 int state = tcp->state;
1155
1156 if (sock->so_options & SO_KEEPALIVE)
1157 do_keepalive (sock);
1158
1159 if (state >= tcp_StateTIMEWT) /* dying tcp session */
1160 {
1161 sock_type *sk = (sock_type*)tcp;
1162 BOOL closing = (sock->so_state & (SS_ISDISCONNECTING | SS_CANTSENDMORE));
1163
1164 sock->so_state &= ~(SS_ISCONNECTED | SS_ISCONNECTING);
1165 DO_FREE (sock->ip_opt);
1166
1167 if (sock->close_time && (sock->so_state & SS_CANTRCVMORE))
1168 {
1169 /* Flush any remaining Rx data received after shutdown(0) called.
1170 */
1171 sock_fastread (sk, NULL, -1);
1172 }
1173
1174 if (closing && sk->tcp.ip_type == 0) /* fully closed, refused or aborted */
1175 {
1176 BOOL expired = FALSE;
1177
1178 if (!sock_rbused(sk))
1179 _sock_free_rcv_buf (sk); /* free memory not needed anymore */
1180
1181 if (sock->close_time) /* close_s() called */
1182 expired = (time(NULL) - sock->close_time >= (time_t)sock->linger_time);
1183
1184 /* If linger-period expired and fully closed, delete the TCB
1185 */
1186 if (expired && state == tcp_StateCLOSED)
1187 {
1188 SOCK_DEBUGF (("\n tcp_sock_daemon del:%d, lport %d", s, tcp->myport));
1189 next = SOCK_DEL_FD (s);
1190 }
1191 }
1192 }
1193 return (next);
1194}
1195
1196
1206static Socket *udp_sock_daemon (Socket *sock)
1207{
1208 Socket *next = sock->next;
1209 _udp_Socket *udp = sock->udp_sock;
1210
1211 if ((sock->so_state & (SS_ISDISCONNECTING | SS_CANTSENDMORE)) &&
1212 (udp->rx_datalen == 0 || udp->ip_type == 0))
1213 {
1214 SOCK_DEBUGF (("\n udp_sock_daemon del:%d", sock->fd));
1215 next = SOCK_DEL_FD (sock->fd);
1216 }
1217 return (next);
1218}
1219
1226static void W32_CALL sock_daemon (void)
1227{
1228 Socket *sock, *next = NULL;
1229
1230 /* If we're in a critical region (e.g. connect() or select_s()) where
1231 * we don't want our socket-list to change, do this later.
1232 */
1233 if (sk_block)
1234 return;
1235
1236 for (sock = sk_list; sock; sock = next)
1237 {
1238 next = sock->next;
1239
1240 if (!FD_ISSET(sock->fd, &inuse[0]))
1241 continue;
1242
1243 if (sock->local_addr == NULL) /* not bound to anything yet */
1244 continue;
1245
1246 switch (sock->so_type)
1247 {
1248 case SOCK_STREAM:
1249 if (sock->tcp_sock)
1250 next = tcp_sock_daemon (sock);
1251 break;
1252 case SOCK_DGRAM:
1253 if (sock->udp_sock)
1254 next = udp_sock_daemon (sock);
1255 break;
1256 }
1257 }
1258}
1259
1260
1266void _sock_crit_start (void)
1267{
1268 if (sk_block < INT_MAX)
1269 ++sk_block;
1270}
1271
1276void _sock_crit_stop (void)
1277{
1278 if (sk_block > 0)
1279 {
1280 --sk_block;
1281
1282#ifdef SIGALRM
1283#endif
1284
1285 if (sk_block == 0)
1286 sock_daemon(); /* run blocked sock_daemon() */
1287 }
1288}
1289
1290/*
1291 * With MSVC using the 'Univeral CRT', the <errno.h> is in the Windows SDK.
1292 * Then there should be no relationship between 'ERRNO_VENDOR_VERSION' and
1293 * errno-values.
1294 */
1295#if defined(_VCRUNTIME_H)
1296#undef ERRNO_VENDOR_VERSION
1297#endif
1298
1299#if defined(USE_DEBUG) && defined(ERRNO_VENDOR_VERSION)
1307static const char *vendor_version (const char **vendor, const char **err_file)
1308{
1309 static char buf[10];
1310 const char *v = NULL;
1311 const char *e = NULL;
1312
1313#if defined(__DJGPP__)
1314 sprintf (buf, "%d.%02d", __DJGPP__, __DJGPP_MINOR__);
1315 v = "__DJGPP__";
1316 e = "djgpp.err";
1317
1318#elif defined(__DMC__)
1319 sprintf (buf, "%X.%X", __DMC__ >> 8, __DMC__ & 0xFF);
1320 v = "__DMC__";
1321 e = "digmars.err";
1322
1323#elif defined(__HIGHC__)
1324 buf[0] = '\0'; /* No way to get the version */
1325 v = "__HIGHC__";
1326 e = "highc.err";
1327
1328#elif defined(__POCC__)
1329 sprintf (buf, "%d.%d", __POCC__/100, __POCC__ % 100);
1330 v = "__PELLESC__";
1331 e = "pellesc.err";
1332
1333#elif defined(__WATCOMC__)
1334 sprintf (buf, "%d.%d", __WATCOMC__/100, __WATCOMC__ % 100);
1335 v = "__WATCOMC__";
1336 e = "watcom.err";
1337
1338#elif defined(__BORLANDC__)
1339 sprintf (buf, "%X.%X", __BORLANDC__ >> 8, __BORLANDC__ & 0xFF);
1340 v = "__BORLANDC__";
1341 e = "borlandc.err";
1342
1343#elif defined(__TURBOC__)
1344 sprintf (buf, "%X.%X", (__TURBOC__ >> 8) - 1, __TURBOC__ & 0xFF);
1345 v = "__TURBOC__";
1346 e = "turboc.err";
1347
1348#elif defined(__clang__)
1349 sprintf (buf, "%d.%d", __clang_major__, __clang_minor__);
1350 v = "__clang__";
1351 e = "clang.err";
1352
1353#elif defined(_MSC_VER)
1354 sprintf (buf, "%d.%d", _MSC_VER/100, _MSC_VER % 100);
1355 v = "_MSC_VER";
1356 e = "visualc.err";
1357
1358#elif defined(__MINGW32__) && defined(__MINGW64_VERSION_MAJOR)
1359 /* __MINGW64_VERSION_[MAJOR|MINOR] is defined through _mingw.h in MinGW-W64 */
1360 sprintf (buf, "%d.%d", __MINGW64_VERSION_MAJOR, __MINGW64_VERSION_MINOR);
1361 v = "__MINGW64__";
1362 e = "mingw64.err";
1363
1364#elif defined(__MINGW32__) /* mingw.org MinGW. MinGW-RT-4+ defines '__MINGW_MAJOR_VERSION' */
1365 #if defined(__MINGW_MAJOR_VERSION)
1366 sprintf (buf, "%d.%d", __MINGW_MAJOR_VERSION, __MINGW_MINOR_VERSION);
1367 #else
1368 sprintf (buf, "%d.%d", __MINGW32_MAJOR_VERSION, __MINGW32_MINOR_VERSION);
1369 #endif
1370 v = "__MINGW32__";
1371 e = "mingw32.err";
1372
1373#elif defined(__CYGWIN__) /* this should be dead code for CygWin */
1374 sprintf (buf, "%d.%d", CYGWIN_VERSION_DLL_MAJOR, CYGWIN_VERSION_DLL_MINOR);
1375 v = "__CYGWIN__";
1376 e = "";
1377
1378#else
1379 buf[0] = '\0';
1380#endif
1381
1382 if (vendor)
1383 *vendor = v;
1384 if (err_file)
1385 *err_file = e;
1386 return (buf);
1387}
1388
1389#ifdef WIN32
1390 #define ERR_PROG "\\win32\\*_err.exe"
1391#else
1392 #define ERR_PROG "*_err.exe"
1393#endif
1394
1400static void check_errno_version (void)
1401{
1402 const char *err_file;
1403 const char *ven, *ver = vendor_version (&ven, &err_file);
1404
1405 if (*ver && strcmp(ver, ERRNO_VENDOR_VERSION))
1406 {
1407 (*_printf) ("\nWarning: %%WATT_ROOT%%\\inc\\sys\\%s was created "
1408 "with a different compiler\nversion (%s vs %s, %s). "
1409 "Rebuilt the corresponding %%WATT_ROOT%%\\util\\%s and "
1410 "Watt-32 library to avoid subtle bugs.\n",
1411 err_file, ERRNO_VENDOR_VERSION, ver, ven, ERR_PROG);
1412 BEEP();
1413 }
1414}
1415#endif /* USE_DEBUG && ERRNO_VENDOR_VERSION */
1416
1417
1427static BOOL init_sockets (void)
1428{
1429 static int sk_result = -1;
1430
1431 if (sk_result >= 0)
1432 return (sk_result);
1433
1434 /* Hack to make linker pull in our strerror().
1435 */
1436 pull_neterr_module = 0;
1437
1438 _watt_do_exit = 0;
1439 sk_result = (watt_sock_init(0,0,0) == 0);
1440 if (!sk_result)
1441 return (FALSE);
1442
1443#if defined(USE_DEBUG) && defined(ERRNO_VENDOR_VERSION)
1444 check_errno_version();
1445#endif
1446
1447#ifdef __DJGPP__
1448 {
1449 struct rlimit r;
1450
1451 getrlimit (RLIMIT_NOFILE, &r);
1452 r.rlim_max = MAX_SOCKETS; /* We don't know this before we try it */
1453 setrlimit (RLIMIT_NOFILE, &r);
1454 }
1455 sk_last = MAX_SOCKETS;
1456#else
1457 sk_last = SK_FIRST+1;
1458#endif /* __DJGPP__ */
1459
1460 sk_list = NULL;
1461 memset (&inuse[0], 0, sizeof(inuse));
1462 memset (&sk_hashes, 0, sizeof(sk_hashes));
1463
1464 DAEMON_ADD (sock_daemon);
1465
1466 return (TRUE);
1467}
1468
1473 Socket *_socklist_find (int s)
1474{
1475 Socket *sock;
1476
1477 if (!init_sockets())
1478 return (NULL);
1479
1480 for (sock = sock_hash_get(s); sock; sock = sock->next)
1481 if (sock->fd == s)
1482 return (sock);
1483 return (NULL);
1484}
1485
1489static BOOL sock_raw_add (Socket *sock, int family)
1490{
1491 int i;
1492
1493#if defined(USE_IPV6)
1494 if (family == AF_INET6)
1495 {
1496 for (i = 0; i < MAX_RAW6_BUFS; i++)
1497 {
1498 _raw6_Socket *raw6 = SOCK_CALLOC (sizeof(*raw6));
1499
1500 if (!raw6)
1501 {
1502 if (i == 0) /* Failing to allocate 1 buffer is fatal */
1503 return (FALSE);
1504
1505 if (i > 0)
1506 break;
1507 }
1508 raw6->ip_type = IP6_TYPE;
1509 raw6->next = sock->raw6_sock;
1510 sock->raw6_sock = raw6;
1511 }
1512 return (TRUE);
1513 }
1514#endif
1515 if (family == AF_INET)
1516 {
1517 for (i = 0; i < MAX_RAW_BUFS; i++)
1518 {
1519 _raw_Socket *raw = SOCK_CALLOC (sizeof(*raw));
1520
1521 if (!raw)
1522 {
1523 if (i == 0)
1524 return (FALSE);
1525
1526 if (i > 0)
1527 break;
1528 }
1529 raw->ip_type = IP4_TYPE;
1530 raw->next = sock->raw_sock;
1531 sock->raw_sock = raw;
1532 }
1533 return (TRUE);
1534 }
1535 return (FALSE);
1536}
1537
1541static Socket *socklist_add (int s, int type, int proto, int family)
1542{
1543 Socket *sock = SOCK_CALLOC (sizeof(*sock));
1544 void *proto_sk;
1545 BOOL okay;
1546
1547 if (!sock)
1548 return (NULL);
1549
1550 switch (proto)
1551 {
1552 case IPPROTO_TCP:
1553 /* Only tcp times out on inactivity
1554 */
1555 sock->timeout = sock_delay;
1556 sock->linger_time = TCP_LINGERTIME;
1557 sock->tcp_sock = SOCK_CALLOC (sizeof(*sock->tcp_sock));
1558 proto_sk = sock->tcp_sock;
1559 if (!sock->tcp_sock)
1560 goto fail;
1561 break;
1562
1563 case IPPROTO_UDP:
1564 sock->udp_sock = SOCK_CALLOC (sizeof(*sock->udp_sock));
1565 proto_sk = sock->udp_sock;
1566 if (!sock->udp_sock)
1567 goto fail;
1568 break;
1569
1570 default: /* type == SOCK_RAW/SOCK_PACKET */
1571 proto_sk = NULL;
1572 if (type == SOCK_PACKET)
1573 okay = sock_packet_add (sock);
1574 else okay = sock_raw_add (sock, family);
1575 if (!okay)
1576 goto fail;
1577 break;
1578 }
1579
1580#if defined(__DJGPP__) && defined(USE_FSEXT)
1581 if (!__FSEXT_set_data(s,sock))
1582 {
1583 SOCK_FATAL (("%s (%d) Fatal: cannot grow FSEXT table\n",
1584 __FILE__, __LINE__));
1585 goto fail;
1586 }
1587#else
1588 ARGSUSED (proto_sk);
1589#endif
1590
1591 /* Link 'sock' into the 'sk_list'
1592 */
1593 sock->next = sk_list;
1594 sk_list = sock;
1595 sock_hash_add (s, sock);
1596
1597 sock->fd = s;
1598 sock->so_type = type;
1599 sock->so_proto = proto;
1600 sock->so_family = family;
1601 sock->so_state = SS_UNCONNECTED;
1602 sock->send_lowat = DEFAULT_SEND_LOWAT;
1603 sock->recv_lowat = DEFAULT_RECV_LOWAT;
1604 sock->ip_ttl = IPDEFTTL;
1605 sock->ip_tos = 0;
1606 sock->cookie = SAFETY_TCP;
1607 return (sock);
1608
1609fail:
1610 if (proto_sk)
1611 free (proto_sk);
1612 else if (type == SOCK_PACKET)
1613 sock_packet_del (sock);
1614 else
1615 sock_raw_del (sock);
1616
1617 free (sock);
1618 return (NULL);
1619}
1620
1624static int set_proto (int type, BOOL is_ip6, int *proto)
1625{
1626#if defined(USE_IPV6)
1627 if (is_ip6 && !_sock_set_mcast_rx_mode())
1628 {
1629 SOCK_ERRNO (ENETDOWN);
1630 SOCK_DEBUGF (("\nsocket: ENETDOWN; %s", pkt_strerror(_pkt_errno)));
1631 return (-1);
1632 }
1633#endif
1634
1635 if (type == SOCK_STREAM)
1636 {
1637 if (*proto == 0)
1638 *proto = IPPROTO_TCP;
1639
1640 else if (*proto != IPPROTO_TCP)
1641 {
1642 SOCK_ERRNO (EPROTONOSUPPORT);
1643 SOCK_DEBUGF (("\nsocket: invalid STREAM protocol (%d)", *proto));
1644 return (-1);
1645 }
1646 }
1647 else if (type == SOCK_DGRAM)
1648 {
1649 if (*proto == 0)
1650 *proto = IPPROTO_UDP;
1651
1652 else if (*proto != IPPROTO_UDP)
1653 {
1654 SOCK_ERRNO (EPROTONOSUPPORT);
1655 SOCK_DEBUGF (("\nsocket: invalid DGRAM protocol (%d)", *proto));
1656 return (-1);
1657 }
1658 }
1659 else if (type == SOCK_RAW)
1660 {
1661 if (*proto == IPPROTO_RAW) /* match all IP-protocols */
1662 *proto = IPPROTO_IP;
1663
1664#if defined(USE_IPV6)
1665 if (is_ip6)
1666 ip6_raw_hook = sock_raw6_recv; /* hook for _ip6_handler() */
1667 else
1668#endif
1669 ip4_raw_hook = sock_raw4_recv; /* hook for _ip4_handler() */
1670 }
1671 else if (type == SOCK_PACKET)
1672 {
1673 *proto = 0;
1674 if (!_sock_set_promisc_rx_mode())
1675 {
1676 SOCK_ERRNO (ENETDOWN);
1677 SOCK_DEBUGF (("\nsocket: ENETDOWN; %s", pkt_strerror(_pkt_errno)));
1678 return (-1);
1679 }
1680 }
1681 ARGSUSED (is_ip6);
1682 return (0);
1683}
1684
1685/*
1686 * Return a friendly name for 'proto'.
1687 */
1688#if defined(USE_DEBUG)
1689static const char *proto_name (int proto)
1690{
1691 static const struct search_list proto_names[] = {
1692 { IPPROTO_IP, "IPPROTO_IP" },
1693 { IPPROTO_ICMP, "IPPROTO_ICMP" },
1694 { IPPROTO_IGMP, "IPPROTO_IGMP" },
1695 { IPPROTO_GGP, "IPPROTO_GGP" },
1696 { IPPROTO_IPIP, "IPPROTO_IPIP" },
1697 { IPPROTO_TCP, "IPPROTO_TCP" },
1698 { IPPROTO_EGP, "IPPROTO_EGP" },
1699 { IPPROTO_IGRP, "IPPROTO_IGRP" },
1700 { IPPROTO_PUP, "IPPROTO_PUP" },
1701 { IPPROTO_UDP, "IPPROTO_UDP" },
1702 { IPPROTO_IDP, "IPPROTO_IDP" },
1703 { IPPROTO_TP, "IPPROTO_TP" },
1704 { IPPROTO_XTP, "IPPROTO_XTP" },
1705 { IPPROTO_RSVP, "IPPROTO_RSVP" },
1706 { IPPROTO_ESP, "IPPROTO_ESP" },
1707 { IPPROTO_AH, "IPPROTO_AH" },
1708 { IPPROTO_ICMPV6, "IPPROTO_ICMPV6" },
1709 { IPPROTO_NONE, "IPPROTO_NONE" },
1710 { IPPROTO_EON, "IPPROTO_EON" },
1711 { IPPROTO_ENCAP, "IPPROTO_ENCAP" },
1712 { IPPROTO_PIM, "IPPROTO_PIM" },
1713 { IPPROTO_VRRP, "IPPROTO_VRRP" },
1714 { IPPROTO_SCTP, "IPPROTO_SCTP" },
1715 { IPPROTO_DIVERT, "IPPROTO_DIVERT" },
1716 { IPPROTO_RAW, "IPPROTO_RAW" },
1717 { IPPROTO_MAX, "IPPROTO_MAX" },
1718 };
1719 return list_lookup (proto, proto_names, DIM(proto_names));
1720}
1721#endif
1722
1733int W32_CALL socket (int family, int type, int protocol)
1734{
1735 Socket *sock = NULL;
1736 char *err = NULL;
1737 const char *fam;
1738 int s;
1739 BOOL is_ip6;
1740
1741 if (!init_sockets())
1742 {
1743 SOCK_ERRNO (ENETDOWN);
1744 return (-1);
1745 }
1746
1747 if (family != AF_UNSPEC &&
1748 family != AF_INET &&
1749 family != AF_PACKET
1750#if defined(USE_IPV6)
1751 && family != AF_INET6
1752#endif
1753 )
1754 {
1755 SOCK_DEBUGF (("\nsocket: invalid family (%d)", family));
1756 SOCK_ERRNO (EAFNOSUPPORT);
1757 return (-1);
1758 }
1759
1760 if (type != SOCK_STREAM &&
1761 type != SOCK_DGRAM &&
1762 type != SOCK_PACKET &&
1763 type != SOCK_RAW)
1764 {
1765 SOCK_DEBUGF (("\nsocket: invalid type (%d)", type));
1766 SOCK_ERRNO (ESOCKTNOSUPPORT);
1767 return (-1);
1768 }
1769
1770 if (family == AF_PACKET)
1771 {
1772 type = SOCK_PACKET;
1773 family = AF_UNSPEC; /* !! is this correct? */
1774 /* protocol ignored; could be ETH_P_ALL */
1775 }
1776
1777 if (type == SOCK_RAW && (protocol < IPPROTO_IP || protocol >= IPPROTO_MAX))
1778 {
1779 SOCK_DEBUGF (("\nsocket: invalid SOCK_RAW proto (%d)", protocol));
1780 SOCK_ERRNO (EINVAL);
1781 return (-1);
1782 }
1783
1784 is_ip6 = (family == AF_INET6);
1785 fam = (is_ip6 ? "6" : "");
1786
1787 if (set_proto(type, is_ip6, &protocol) < 0)
1788 return (-1);
1789
1790 s = sock_alloc_fd (&err);
1791 if (s >= 0)
1792 sock = socklist_add (s, type, protocol, family);
1793
1794 switch (type)
1795 {
1796 case SOCK_STREAM:
1797 SOCK_DEBUGF (("\nsocket: fam:AF_INET%s type:STREAM, proto %s, %d",
1798 fam, proto_name(protocol), s));
1799 break;
1800 case SOCK_DGRAM:
1801 SOCK_DEBUGF (("\nsocket: fam:AF_INET%s type:DGRAM, proto %s, %d",
1802 fam, proto_name(protocol), s));
1803 break;
1804 case SOCK_RAW:
1805 SOCK_DEBUGF (("\nsocket: fam:AF_INET%s type:RAW, proto %s, %d",
1806 fam, proto_name(protocol), s));
1807 break;
1808 case SOCK_PACKET:
1809 SOCK_DEBUGF (("\nsocket: fam:AF_UNSPEC type:PACKET, %d", s));
1810 break;
1811 }
1812
1813 if (err) /* sock_alloc_fd() failed */
1814 {
1815 SOCK_DEBUGF ((", EMFILE; %s", err));
1816 SOCK_ERRNO (EMFILE);
1817 return (-1);
1818 }
1819
1820 if (!sock) /* socklist_add() failed */
1821 {
1822 if (s >= 0)
1823 sock_close_fd (s);
1824 SOCK_DEBUGF ((", ENOMEM"));
1825 SOCK_ERRNO (ENOMEM);
1826 return (-1);
1827 }
1828
1829 if (type == SOCK_PACKET)
1830 {
1831 sock->old_eth_peek = _eth_recv_peek;
1832 _eth_recv_peek = (int (W32_CALL*)(void*)) sock_packet_peek;
1833 }
1834
1835 _bsd_socket_hook = socket_op_demux;
1836 ARGSUSED (fam);
1837 return (s);
1838}
1839
1851static int stream_cancel (const _tcp_Socket *tcp, BYTE icmp_type, int error)
1852{
1853 Socket *socket;
1854 BOOL should_drop = (icmp_type == ICMP_UNREACH &&
1855 tcp->stress >= tcp->rigid) ||
1856 (tcp->ip_type == 0); /* already aborted */
1857
1858 for (socket = sk_list; socket; socket = socket->next)
1859 if (socket->so_type == SOCK_STREAM &&
1860 tcp == socket->tcp_sock && should_drop)
1861 {
1862 socket->so_state |= SS_CONN_REFUSED;
1863 socket->so_error = error;
1864 return (1);
1865 }
1866 return (0);
1867}
1868
1869static int dgram_cancel (const _udp_Socket *udp, BYTE icmp_type, int error)
1870{
1871 Socket *socket;
1872 int num = 0;
1873
1874 for (socket = sk_list; socket; socket = socket->next)
1875 if (socket->so_type == SOCK_DGRAM && udp == socket->udp_sock)
1876 {
1877 socket->so_state |= SS_CONN_REFUSED;
1878 socket->so_error = error;
1879 num++;
1880 }
1881 ARGSUSED (icmp_type);
1882 return (num);
1883}
1884
1885#if defined(USE_DEBUG)
1886static __inline const char *ip_proto_str (WORD prot)
1887{
1888 switch (prot)
1889 {
1890 case UDP_PROTO:
1891 return ("UDP");
1892 case TCP_PROTO:
1893 return ("TCP");
1894 case ICMP_PROTO:
1895 return ("ICMP");
1896 case IGMP_PROTO:
1897 return ("IGMP");
1898 default:
1899 return ("unknown");
1900 }
1901}
1902#endif
1903
1904/*
1905 * Handler for lower layer ICMP messages/errors.
1906 * Return number of BSD-sockets the ICMP-event matched
1907 * (retval not used yet).
1908 */
1909static int icmp_callback (sock_type *s, BYTE icmp_type, BYTE icmp_code)
1910{
1911 const char *type_str = "??";
1912 int error;
1913
1914 if (icmp_type == ICMP_UNREACH)
1915 error = (icmp_code == ICMP_UNREACH_NET ||
1916 icmp_code == ICMP_UNREACH_NET_UNKNOWN ||
1917 icmp_code == ICMP_UNREACH_NET_PROHIB) ?
1918 ENETUNREACH : EHOSTUNREACH;
1919 else error = ECONNREFUSED;
1920
1921 if (icmp_type < DIM(icmp_type_str))
1922 type_str = icmp_type_str [icmp_type];
1923
1924 SOCK_DEBUGF (("\n icmp_callback (s=%" ADDR_FMT ", IP-proto %s, %s, code %d)",
1925 ADDR_CAST(s), ip_proto_str(s->udp.ip_type), type_str, icmp_code));
1926
1927 if (icmp_type == ICMP_UNREACH || icmp_type == ICMP_PARAMPROB)
1928 {
1929 if (s->udp.ip_type == UDP_PROTO)
1930 return dgram_cancel (&s->udp, icmp_type, error);
1931
1932 if (s->udp.ip_type == TCP_PROTO)
1933 return stream_cancel (&s->tcp, icmp_type, error);
1934 }
1935 ARGSUSED (type_str);
1936 return (0);
1937}
1938
1942int _UDP_open (Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
1943{
1944 DWORD ip = ntohl (host.s_addr);
1945
1946 loc_port = ntohs (loc_port);
1947 rem_port = ntohs (rem_port);
1948
1949 if (!_udp_open (socket->udp_sock, loc_port, ip, rem_port))
1950 return (0);
1951
1952 if (!socket->udp_sock->rx_data)
1953 _sock_set_rcv_buf ((sock_type*)socket->udp_sock, DEFAULT_UDP_SIZE);
1954
1955 socket->udp_sock->icmp_callb = (icmp_upcall) icmp_callback;
1956 return (1);
1957}
1958
1959#if defined(__WATCOMC__)
1960 /*
1961 * Warning! W201: Unreachable code. Due to SOCK_FATAL().
1962 */
1963 #pragma disable_message (201)
1964#endif
1965
1966
1967int _UDP_listen (Socket *socket, struct in_addr host, WORD port)
1968{
1969 _udp_Socket *udp = socket->udp_sock;
1970 DWORD addr;
1971
1972 port = ntohs (port);
1973
1974 if (socket->so_state & SS_PRIV)
1975 {
1976 int size = sizeof(recv_buf) * MAX_DGRAMS;
1977 void *pool = malloc (size);
1978
1979 if (!pool)
1980 {
1981 SOCK_FATAL (("%s (%d) Fatal: Allocation failed\n",
1982 __FILE__, __LINE__));
1983 SOCK_ERRNO (ENOMEM);
1984 return (-1);
1985 }
1986 socket->bcast_pool = (recv_buf**) pool;
1987 socket->pool_size = size;
1988
1989 /* Mapping `INADDR_ANY' to `INADDR_BROADCAST' causes udp_demux()
1990 * to demux to the correct watt-socket; s->hisaddr = IP_BCAST_ADDR in
1991 * passive socket demux loop.
1992 */
1993 if (host.s_addr == INADDR_ANY)
1994 addr = INADDR_BROADCAST;
1995 else addr = ntohl (host.s_addr);
1996
1997 udp_listen (udp, port, addr, 0, NULL);
1998
1999 /* Setup _recvdaemon() to enqueue broadcast/"unconnected" messages
2000 */
2001 sock_recv_init ((sock_type*)udp, pool, size);
2002 }
2003 else
2004 {
2005 addr = ntohl (host.s_addr);
2006 udp_listen (udp, port, addr, 0, NULL);
2007 }
2008 udp->icmp_callb = (icmp_upcall) icmp_callback;
2009 return (1);
2010}
2011
2015int _TCP_open (Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
2016{
2017 DWORD dest = ntohl (host.s_addr);
2018
2019 loc_port = ntohs (loc_port);
2020 rem_port = ntohs (rem_port);
2021
2022 if (!tcp_open (socket->tcp_sock, loc_port, dest, rem_port, NULL))
2023 return (0);
2024
2025 if (socket->so_state & SS_NBIO)
2026 socket->tcp_sock->locflags |= LF_NOCLOSE;
2027
2040 /* Advertise a large rcv-win from the next ACK on.
2041 */
2042 _sock_set_rcv_buf ((sock_type*)socket->tcp_sock, tcp_recv_win);
2043 socket->tcp_sock->icmp_callb = (icmp_upcall) icmp_callback;
2044 return (1);
2045}
2046
2047int _TCP_listen (Socket *socket, struct in_addr host, WORD port)
2048{
2049 DWORD addr = ntohl (host.s_addr);
2050 WORD loc_port = ntohs (port);
2051
2052 tcp_listen (socket->tcp_sock, loc_port, addr, 0, NULL, 0);
2053 socket->tcp_sock->icmp_callb = (icmp_upcall) icmp_callback;
2054 return (1);
2055}
2056
2057#if defined(USE_IPV6)
2058int _TCP6_open (Socket *socket, const void *dst, WORD loc_port, WORD rem_port)
2059{
2060 _tcp_Socket *tcp = socket->tcp_sock;
2061 UINT rtt;
2062
2063 WATT_LARGE_CHECK (tcp, sizeof(*tcp));
2064 _tcp_unthread (tcp, FALSE); /* just in case not totally closed */
2065
2066 memset (tcp, 0, sizeof(*tcp));
2067 tcp->state = tcp_StateCLOSED; /* otherwise is tcp_StateLISTEN on failure */
2068
2069 if (!_eth_is_init) /* GvB 2002-09, Lets us survive without a working eth */
2070 {
2071 SOCK_ERRNO (ENETDOWN);
2072 tcp->err_msg = _LANG (_eth_not_init);
2073 return (0);
2074 }
2075
2076 if (IN6_ARE_ADDR_EQUAL(dst,&in6addr_any) || IN6_IS_ADDR_MULTICAST(dst))
2077 {
2078 SOCK_ERRNO (EINVAL);
2079 sprintf (tcp->err_buf, _LANG("Illegal destination (%s)"), _inet6_ntoa(dst));
2080 tcp->err_msg = tcp->err_buf;
2081 return (0);
2082 }
2083
2084 if (!icmp6_neigh_solic (dst, &tcp->his_ethaddr)) /* This blocks! */
2085 {
2086 SOCK_ERRNO (EHOSTUNREACH);
2087 strcpy (tcp->err_buf, _LANG("Neighbor Solic failed "));
2088 strcat (tcp->err_buf, _inet6_ntoa(dst));
2089 tcp->err_msg = tcp->err_buf;
2090 STAT (ip6stats.ip6s_noroute++);
2091 return (0);
2092 }
2093
2094 _sock_set_rcv_buf ((sock_type*)tcp, tcp_recv_win);
2095
2096 memcpy (&tcp->my6addr, &in6addr_my_ip, sizeof(tcp->my6addr));
2097 memcpy (&tcp->his6addr, dst, sizeof(tcp->his6addr));
2098
2099 loc_port = ntohs (loc_port);
2100 rem_port = ntohs (rem_port);
2101
2102 tcp->is_ip6 = TRUE;
2103 tcp->icmp_callb = (icmp_upcall) icmp_callback;
2104 tcp->state = tcp_StateSYNSENT;
2105 tcp->ip_type = TCP_PROTO;
2106 tcp->max_seg = _mss;
2107 tcp->cwindow = 1;
2108 tcp->wwindow = 0; /* slow start VJ algorithm */
2109 tcp->vj_sa = INIT_VJSA;
2110 tcp->rto = tcp_OPEN_TO; /* added 14-Dec 1999, GV */
2111 tcp->myaddr = my_ip_addr;
2112 tcp->myport = find_free_port (loc_port,1); /* get a nonzero port val */
2113 tcp->locflags = LF_LINGER; /* close via TIMEWT state */
2114 tcp->ttl = _default_ttl;
2115 tcp->hisport = rem_port;
2116 tcp->send_next = INIT_SEQ();
2117 tcp->flags = tcp_FlagSYN;
2118 tcp->unhappy = TRUE;
2119 tcp->protoHandler = NULL;
2120 tcp->usr_yield = NULL;
2121
2122 tcp->safetysig = SAFETY_TCP; /* marker signatures */
2123 tcp->safetytcp = SAFETY_TCP;
2124 tcp->next = _tcp_allsocs; /* insert into chain */
2125
2126/* sock_yield (tcp, tcp6_yield); */
2128 _tcp_allsocs = tcp;
2129
2132 if (tcp_nagle)
2133 tcp->sockmode = SOCK_MODE_NAGLE;
2134 tcp->sockmode |= SOCK_MODE_BINARY;
2135
2136 tcp->timeout = set_timeout (tcp_LONGTIMEOUT);
2137
2138 TCP_SEND (tcp); /* send opening SYN */
2139
2140 /* find previous RTT replacing RTT set in tcp_send() above
2141 */
2142 if (tcp_rtt_get(tcp, &rtt, NULL))
2143 tcp->rtt_time = set_timeout (rtt);
2144 else tcp->rtt_time = set_timeout (tcp_OPEN_TO);
2145 return (1);
2146}
2147
2148int _TCP6_listen (Socket *socket, const void *host, WORD loc_port)
2149{
2151 ARGSUSED (socket);
2152 ARGSUSED (host);
2153 ARGSUSED (loc_port);
2154 return (0);
2155}
2156
2157int _UDP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port)
2158{
2161 if (!socket->udp_sock->rx_data)
2162 _sock_set_rcv_buf ((sock_type*)socket->udp_sock, DEFAULT_UDP_SIZE);
2163
2164 socket->udp_sock->icmp_callb = (icmp_upcall) icmp_callback;
2165 ARGSUSED (host);
2166 ARGSUSED (loc_port);
2167 ARGSUSED (rem_port);
2168 return (0);
2169}
2170
2171int _UDP6_listen (Socket *socket, const void *host, WORD port)
2172{
2174 ARGSUSED (socket);
2175 ARGSUSED (host);
2176 ARGSUSED (port);
2177 return (0);
2178}
2179#endif /* USE_IPV6 */
2180
2186BOOL _sock_pending_connect (Socket *socket)
2187{
2188 if (socket->tcp_sock->state == tcp_StateESTAB)
2189 {
2190 socket->so_state &= ~(SS_ISCONNECTING | SS_UNCONNECTED);
2191 socket->so_state |= SS_ISCONNECTED;
2192 WATT_ASSERT (socket->so_error == 0);
2193 return (FALSE);
2194 }
2195
2196 if (socket->so_error != 0)
2197 {
2198 /* Caught an ICMP reject or TCP RST.
2199 */
2200 socket->so_state &= ~SS_ISCONNECTING;
2201 return (FALSE);
2202 }
2203
2204 if (chk_timeout (socket->nb_timer))
2205 {
2206 socket->so_state &= ~SS_ISCONNECTING;
2207 socket->so_error = ETIMEDOUT;
2208 return (FALSE);
2209 }
2210
2211 if (socket->tcp_sock->state > tcp_StateESTAB)
2212 {
2213 /* We forgot to set SO_ERROR somewhere.
2214 */
2215 SOCK_FATAL (("%s (%d) Fatal: Unhandled non-block event\n",
2216 __FILE__, __LINE__));
2217 socket->so_state &= ~SS_ISCONNECTING;
2218 socket->so_error = ECONNREFUSED;
2219 return (FALSE);
2220 }
2221
2222 /* Don't let tcp_Retransmitter() timeout this socket
2223 * (unless there is a ARP timeout etc.)
2224 */
2225 socket->tcp_sock->timeout = 0;
2226
2227 /* Still connecting.
2228 */
2229 return (TRUE);
2230}
2231
2232#ifdef NOT_USED
2238int _sock_half_open (const _tcp_Socket *s)
2239{
2240 if (!s || s->ip_type != TCP_PROTO)
2241 return (0);
2242
2243 return (s->state >= tcp_StateFINWT1 &&
2244 s->state <= tcp_StateCLOSED);
2245}
2246#endif
2247
2248#if 0 /* not finished and seldom needed */
2253int W32_CALL socketpair (int family, int type, int protocol, int usockvec[2])
2254{
2255 Socket *sock1, *sock2;
2256 int s1, s2;
2257
2258 if ((s1 = socket (family, type, protocol)) < 0)
2259 return (-errno);
2260
2261 sock1 = socklist_find (s1);
2262
2263 /* Now grab another socket and try to connect the two together.
2264 */
2265 if ((s2 = socket (family, type, protocol)) < 0)
2266 {
2267 int err = -errno;
2268
2269 close_s (s1);
2270 return (err);
2271 }
2272
2273 sock2 = socklist_find (s2);
2274
2275 sock1->conn = sock2;
2276 sock2->conn = sock1;
2277 sock1->so_state = SS_CONNECTED;
2278 sock2->so_state = SS_CONNECTED;
2279
2280 usockvec[0] = s1;
2281 usockvec[1] = s2;
2282 return (0);
2283}
2284#endif
2285
2286#endif /* USE_BSD_API */
_default_ttl
int _default_ttl
Definition: ip4_out.c:54
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
strerror
char *MS_CDECL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207
pcdbug.h
pcdns.h
icmp6_neigh_solic
int icmp6_neigh_solic(const void *addr, eth_address *eth)
Definition: pcicmp6.c:177
pcicmp6.h
_pkt_ip_ofs
WORD _pkt_ip_ofs
ofs from link-layer head to ip
Definition: pcpkt.c:49
_pkt_rxmode
int _pkt_rxmode
active receive mode
Definition: pcpkt.c:53
_pkt_errno
int _pkt_errno
error code set in pcpkt.c API
Definition: pcpkt.c:55
pkt_strerror
const char *W32_CALL pkt_strerror(int code)
Return textual error representing error-code.
Definition: pcpkt.c:216
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
pkt_set_rcv_mode
int pkt_set_rcv_mode(int mode)
Sets the receive mode of the interface.
Definition: pcpkt.c:1953
RXMODE_PROMISCOUS
@ RXMODE_PROMISCOUS
receive all packets on network
Definition: pcpkt.h:114
RXMODE_BROADCAST
@ RXMODE_BROADCAST
DIRECT + broadcast packets
Definition: pcpkt.h:111
RXMODE_MULTICAST2
@ RXMODE_MULTICAST2
BROADCAST + all multicast
Definition: pcpkt.h:113
_eth_is_init
BOOL _eth_is_init
we are initialised
Definition: pcsed.c:54
_eth_last
struct _eth_last_info _eth_last
Sizes and timestamps of last packet recv/sent.
Definition: pcsed.c:67
_eth_send
int W32_CALL _eth_send(WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
Definition: pcsed.c:301
_eth_addr
mac_address _eth_addr
Local link-layer source address.
Definition: pcsed.c:49
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
_eth_get_hwtype
BYTE W32_CALL _eth_get_hwtype(BYTE *hwtype, BYTE *hwlen)
Fill in hardware address type/length for BOOTP/DHCP packets.
Definition: pcsed.c:730
_eth_mac_len
BYTE _eth_mac_len
Size of a MAC address.
Definition: pcsed.c:53
_eth_brdcast
mac_address _eth_brdcast
Link-layer broadcast address.
Definition: pcsed.c:50
tcp_recv_win
DWORD tcp_recv_win
RWIN for BSD sockets only.
Definition: pctcp.c:138
tcp_OPEN_TO
unsigned tcp_OPEN_TO
TCP timer values.
Definition: pctcp.c:116
tcp_nagle
BOOL tcp_nagle
Misc TCP values.
Definition: pctcp.c:134
tcp_listen
int W32_CALL tcp_listen(_tcp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler, WORD timeout)
Passively opens TCP a connection.
Definition: pctcp.c:407
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
udp_listen
int W32_CALL udp_listen(_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP passive open.
Definition: pctcp.c:190
tcp_open
int W32_CALL tcp_open(_tcp_Socket *s, WORD lport, DWORD ip, WORD rport, ProtoHandler handler)
Actively open a TCP connection.
Definition: pctcp.c:328
_tcp_allsocs
_tcp_Socket * _tcp_allsocs
list of tcp-sockets
Definition: pctcp.c:140
_tcp_unthread
_tcp_Socket * _tcp_unthread(_tcp_Socket *ds, BOOL free_tx)
Unthread a socket from the tcp socket list, if it's there.
Definition: pctcp.c:602
_udp_open
int _udp_open(_udp_Socket *s, WORD lport, DWORD ip, WORD port)
Implementation for udp_open(), also used by BSD connect().
Definition: pctcp.c:214
tcp_keep_idle
unsigned tcp_keep_idle
idle time before sending keepalive
Definition: pctcp.c:135
watt_sock_init
int W32_CALL watt_sock_init(size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
Definition: sock_ini.c:769
_watt_do_exit
BOOL _watt_do_exit
exit program when all boot attempts failed
Definition: sock_ini.c:136
find_free_raw_sock
static struct _raw_Socket * find_free_raw_sock(Socket *sock)
Search in sock->raw?_sock list for an unused raw-buffer.
Definition: socket.c:866
sock_raw_add
static BOOL sock_raw_add(Socket *sock, int family)
Allocate raw?_Socket buffers for a SOCK_RAW socket.
Definition: socket.c:1489
_sock_half_open
int _sock_half_open(const _tcp_Socket *s)
_sock_half_open - Return true if peer closed his side.
Definition: socket.c:2238
_UDP6_open
int _UDP6_open(Socket *socket, const void *host, WORD loc_port, WORD rem_port)
Definition: socket.c:2157
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
init_sockets
static BOOL init_sockets(void)
Main initialisation routine for the BSD socket API.
Definition: socket.c:1427
get_pkt_type_eth
static char get_pkt_type_eth(const eth_Header *eth)
Return correct PACKET_xx type.
Definition: socket.c:516
sock_daemon
static void W32_CALL sock_daemon(void)
A daemon called from tcp_tick().
Definition: socket.c:1226
_sock_set_rcv_buf
int _sock_set_rcv_buf(sock_type *s, size_t len)
Setup a bigger receive buffer, the default in Wattcp is only 2k.
Definition: socket.c:232
vendor_version
static const char * vendor_version(const char **vendor, const char **err_file)
Return version string of current compiler and the '../inc/sys/xx.err' file.
Definition: socket.c:1307
_sock_free_rcv_buf
void _sock_free_rcv_buf(sock_type *s)
Free receive buffer associated with udp/tcp sockets.
Definition: socket.c:247
_sock_calloc
void * _sock_calloc(size_t size, const char *file, unsigned line)
Memory allocation; print some info if allocation fails.
Definition: socket.c:83
other_tcp_listeners
static __inline BOOL other_tcp_listeners(const Socket *_this)
Traverse socket-list to find other SOCK_STREAM sockets besides '_this' which are also listening.
Definition: socket.c:311
do_keepalive
static void do_keepalive(Socket *sock)
Handle keepalive on STREAM socket.
Definition: socket.c:1043
sock_packet_add
static BOOL sock_packet_add(Socket *sock)
Allocate ringbuffer and rx-buffers for a SOCK_PACKET socket.
Definition: socket.c:445
sock_find_tcp
static void * sock_find_tcp(const _tcp_Socket *tcp)
Finds the 'Socket*' associated with tcp-socket '*tcp'.
Definition: socket.c:806
_sock_chk_sockaddr
int _sock_chk_sockaddr(Socket *socket, const struct sockaddr *sa, socklen_t len)
Check ‘sockaddr*’ passed to bind/connect.
Definition: socket.c:819
udp_sock_daemon
static Socket * udp_sock_daemon(Socket *sock)
Called by sock_daemon() for SOCK_DGRAM sockets.
Definition: socket.c:1206
tcp_sock_daemon
static Socket * tcp_sock_daemon(Socket *sock)
Called by sock_daemon() to handle SOCK_STREAM sockets.
Definition: socket.c:1149
__get_sock_from_s
const sock_type * __get_sock_from_s(int s, int proto)
Hack function if user application needs to use Wattcp core functions for BSD sockets.
Definition: socket.c:288
mcast_set
static BOOL mcast_set
Switch back to normal rx-mode (RXMODE_BROADCAST) if no multicasts active and no more IPv6/SOCK_PACKET...
Definition: socket.c:346
_TCP6_open
int _TCP6_open(Socket *socket, const void *dst, WORD loc_port, WORD rem_port)
Definition: socket.c:2058
_sock_pending_connect
BOOL _sock_pending_connect(Socket *socket)
Check progress on a non-blocking SOCK_STREAM socket that has SS_ISCONNECTING set.
Definition: socket.c:2186
other_raw_socks
static __inline BOOL other_raw_socks(const Socket *_this)
Traverse socket-list to find other SOCK_RAW sockets besides '_this'.
Definition: socket.c:332
sock_packet_receive
unsigned sock_packet_receive(Socket *sock, void *buf, unsigned len, struct sockaddr *from, size_t *fromlen)
Called from receive.c for AF_PACKET sockets.
Definition: socket.c:582
socketpair
int W32_CALL socketpair(int family, int type, int protocol, int usockvec[2])
socketpair() - Create a pair of connected sockets.
Definition: socket.c:2253
sk_list_del
static __inline Socket * sk_list_del(int s)
Deletes the list element associated with a socket.
Definition: socket.c:264
inuse
static fd_set inuse[NUM_SOCK_FDSETS]
‘inuse[]’ has a non-zero bit for each socket-descriptor in use.
Definition: socket.c:128
_sock_dos_fd
BOOL _sock_dos_fd(int s)
_sock_dos_fd - Return TRUE if ‘s’ is a valid DOS/Win32 handle.
Definition: socket.c:202
_UDP6_listen
int _UDP6_listen(Socket *socket, const void *host, WORD port)
Definition: socket.c:2171
_sock_crit_start
void _sock_crit_start(void)
Start a critical region.
Definition: socket.c:1266
_sock_crit_stop
void _sock_crit_stop(void)
Mark the end of a critical region.
Definition: socket.c:1276
check_errno_version
static void check_errno_version(void)
Check that '.
Definition: socket.c:1400
sock_find_udp
static Socket * sock_find_udp(const _udp_Socket *udp)
Finds the 'Socket' associated with udp-socket 'udp'.
Definition: socket.c:792
sock_raw4_recv
static int sock_raw4_recv(const in_Header *ip)
Called from _ip4_handler() via ‘_bsd_socket_hook’.
Definition: socket.c:905
socket_op_demux
static void *MS_CDECL socket_op_demux(enum BSD_SOCKET_OPS op,...)
The demultiplexer for callback operations called via '_bsd_socket_hook' from functions in the core Wa...
Definition: socket.c:1066
stream_cancel
static int stream_cancel(const _tcp_Socket *tcp, BYTE icmp_type, int error)
Callback handlers for "ICMP Port/Host/Network Unreachable" or "ICMP Parameter Problem" issued by lowe...
Definition: socket.c:1851
socklist_add
static Socket * socklist_add(int s, int type, int proto, int family)
Adds a new socket to the sk_list.
Definition: socket.c:1541
sock_find_fd
static int sock_find_fd(const Socket *socket)
Finds the 'fd' associated with pointer 'socket'.
Definition: socket.c:778
_UDP_open
int _UDP_open(Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
Open and listen routines for SOCK_DGRAM at the socket-level.
Definition: socket.c:1942
_TCP6_listen
int _TCP6_listen(Socket *socket, const void *host, WORD loc_port)
Definition: socket.c:2148
set_proto
static int set_proto(int type, BOOL is_ip6, int *proto)
Select (and check) a suitable protocol for socket-type.
Definition: socket.c:1624
sock_raw_del
static void sock_raw_del(Socket *sock)
Free buffers and hooks used by a SOCK_RAW socket.
Definition: socket.c:406
_sock_del_fd
Socket * _sock_del_fd(int fd, const char *file, unsigned line)
Delete the socket from ‘inuse’ array and all memory associated with it.
Definition: socket.c:681
_TCP_open
int _TCP_open(Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
Open and listen routines for SOCK_STREAM at the socket-level.
Definition: socket.c:2015
_raw6_Socket
Definition: wattcp.h:679
_raw_Socket
Definition: wattcp.h:665
_raw_Socket::used
BOOL used
used flag; packet not read yet
Definition: wattcp.h:668
_raw_Socket::seq_num
DWORD seq_num
counter for finding oldest pkt
Definition: wattcp.h:669
_raw_Socket::ip_type
WORD ip_type
same ofs as for udp/tcp Socket
Definition: wattcp.h:667
_raw_Socket::rx_data
BYTE rx_data[MAX_FRAG_SIZE]
room for 1 jumbo IP packet
Definition: wattcp.h:671
Socket
Definition: socket.h:158
arcnet_Header
Definition: pcsed.h:180
eth_Header
Definition: pcsed.h:20
fd_set
Definition: wtypes.h:256
fddi_Header
Definition: pcsed.h:149
in6_Header
Definition: wattcp.h:381
in_Header
Definition: wattcp.h:329
in_addr
Definition: in.h:143
pkt_ringbuf
FIFO style ring-buffer.
Definition: pcqueue.h:81
pkt_ringbuf::num_drop
volatile DWORD num_drop
number of dropped pkts
Definition: pcqueue.h:86
pkt_ringbuf::out_index
WORD out_index
index of buffer pulled out
Definition: pcqueue.h:83
pkt_ringbuf::in_index
volatile WORD in_index
index ahead of last buffer put
Definition: pcqueue.h:82
recv_buf
Definition: pcrecv.h:16
search_list
Definition: misc.h:131
sock_packet_buf
Definition: socket.h:148
sock_packet_pool
Definition: socket.h:153
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
sockaddr_ll
Definition: if_packe.h:16
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::vj_sa
DWORD vj_sa
VJ's alg, standard average (SRTT)
Definition: wattcp.h:615
tcp_Socket::safetytcp
DWORD safetytcp
extra magic marker
Definition: wattcp.h:657
tcp_Socket::rto
UINT rto
retransmission timeout
Definition: wattcp.h:618
tcp_Socket::wwindow
BYTE wwindow
Van Jacobson's algorithm.
Definition: wattcp.h:612
tcp_Socket::max_seg
UINT max_seg
MSS for this connection.
Definition: wattcp.h:630
tcp_Socket::cwindow
BYTE cwindow
Congestion window.
Definition: wattcp.h:611
tcp_Socket::rtt_time
DWORD rtt_time
Round Trip Time value.
Definition: wattcp.h:623
tcp_Socket::unhappy
BYTE unhappy
flag, indicates retransmitting segt's
Definition: wattcp.h:604
tcp_Socket::timeout
DWORD timeout
timer for retrans etc.
Definition: wattcp.h:603
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
tcp_Socket::next
struct tcp_Socket * next
link to next tcp-socket
Definition: wattcp.h:585
tcp_Socket::safetysig
DWORD safetysig
magic marker
Definition: wattcp.h:656
tcp_Socket::rx_buf
BYTE rx_buf[tcp_MaxBufSize+1]
received data buffer
Definition: wattcp.h:588
tcp_Socket::his6addr
ip6_address his6addr
peer's IPv6 address
Definition: wattcp.h:592
tcp_Socket::send_next
DWORD send_next
SEQ we send but not ACK-ed by peer.
Definition: wattcp.h:596
tcp_Socket::my6addr
ip6_address my6addr
our IPv6 address
Definition: wattcp.h:591
tcp_Socket::flags
WORD flags
TCP flags used in next Tx.
Definition: wattcp.h:606
tok_Header
Definition: pcsed.h:70
tok
Definition: oui-generated.c:13
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
link_Packet
Definition: pcsed.h:247
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/src/sockopt.c Source File

  • src
sockopt.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 * 0.6 : Apr 07, 2000 : Added multicast options IP_ADD_MEMBERSHIP and
37 * IP_DROP_MEMBERSHIP. Vlad Erochine <vlad@paragon.ru>
38 * 0.7 : Jun 06, 2000 : Added support for SO_SNDLOWAT and SO_RCVLOWAT
39 */
40
41#include "socket.h"
42
43#if defined(USE_BSD_API)
44
45static int set_sol_opt (Socket *s, int opt, const void *val, unsigned len);
46static int set_raw_opt (Socket *s, int opt, const void *val, int len);
47static int get_sol_opt (Socket *s, int opt, void *val, int *len);
48static int get_raw_opt (Socket *s, int opt, void *val, int *len);
49
50static int set_tcp_opt (_tcp_Socket *tcp, int opt, const void *val, int len);
51static int set_udp_opt (_udp_Socket *udp, int opt, const void *val, int len);
52static int get_tcp_opt (_tcp_Socket *tcp, int opt, void *val, int *len);
53static int get_udp_opt (_udp_Socket *udp, int opt, void *val, int *len);
54
55static int set_recv_buf (sock_type *s, DWORD size, BOOL is_tcp);
56static int set_xmit_buf (sock_type *s, DWORD size, BOOL is_tcp);
57static int raw_rx_buf (_raw_Socket *raw, DWORD size);
58static int raw_tx_buf (_raw_Socket *raw, DWORD size);
59static int raw6_rx_buf (_raw6_Socket *raw, DWORD size);
60static int raw6_tx_buf (_raw6_Socket *raw, DWORD size);
61
62static int set_tx_lowat (Socket *s, unsigned size);
63static int set_rx_lowat (Socket *s, unsigned size);
64static int get_tx_lowat (const Socket *s, unsigned *size);
65static int get_rx_lowat (const Socket *s, unsigned *size);
66
67#if defined(USE_DEBUG)
68static const char *sockopt_name (int level, int option);
69#endif
70
71int W32_CALL setsockopt (int s, int level, int option, const void *optval, socklen_t optlen)
72{
73 Socket *socket = _socklist_find (s);
74 int rc;
75
76 SOCK_DEBUGF (("\nsetsockopt:%d, %s", s, sockopt_name(level,option)));
77
78 if (!socket)
79 {
80 if (_sock_dos_fd(s))
81 {
82 SOCK_DEBUGF ((", ENOTSOCK"));
83 SOCK_ERRNO (ENOTSOCK);
84 return (-1);
85 }
86 SOCK_DEBUGF ((", EBADF"));
87 SOCK_ERRNO (EBADF);
88 return (-1);
89 }
90
91 VERIFY_RW (optval, optlen);
92
93 if ((WORD)level == SOL_SOCKET)
94 rc = set_sol_opt (socket, option, optval, optlen);
95
96#if 0
97 else if ((WORD)level == SOL_PACKET)
98 rc = set_packet_opt (socket, option, optval, optlen);
99#endif
100
101 else if (level == socket->so_proto && level == IPPROTO_TCP)
102 rc = set_tcp_opt (socket->tcp_sock, option, optval, optlen);
103
104 else if (level == socket->so_proto && level == IPPROTO_UDP)
105 rc = set_udp_opt (socket->udp_sock, option, optval, optlen);
106
107 else if ((level == socket->so_proto && level == IPPROTO_IP) ||
108 (level == socket->so_proto && level == IPPROTO_ICMP) ||
109 socket->so_proto == IPPROTO_UDP ||
110 socket->so_proto == IPPROTO_ICMP)
111 rc = set_raw_opt (socket, option, optval, optlen);
112
113 else
114 {
115 SOCK_ERRNO (ENOPROTOOPT);
116 rc = -1;
117 }
118
119 if (rc < 0)
120 SOCK_DEBUGF ((", %s", short_strerror(_w32_errno)));
121
122 return (rc);
123}
124
125int W32_CALL getsockopt (int s, int level, int option, void *optval, socklen_t *optlen)
126{
127 Socket *socket = _socklist_find (s);
128 int rc;
129
130 SOCK_DEBUGF (("\ngetsockopt:%d, %s", s, sockopt_name(level,option)));
131
132 if (!socket)
133 {
134 if (_sock_dos_fd(s))
135 {
136 SOCK_DEBUGF ((", ENOTSOCK"));
137 SOCK_ERRNO (ENOTSOCK);
138 return (-1);
139 }
140 SOCK_DEBUGF ((", EBADF"));
141 SOCK_ERRNO (EBADF);
142 return (-1);
143 }
144
145 VERIFY_RW (optlen, sizeof(u_long));
146 VERIFY_RW (optval, *optlen);
147
148 if ((WORD)level == SOL_SOCKET)
149 rc = get_sol_opt (socket, option, optval, optlen);
150
151#if 0
152 else if ((WORD)level == SOL_PACKET)
153 rc = get_packet_opt (socket, option, optval, optlen);
154#endif
155
156 else if (level == socket->so_proto && level == IPPROTO_TCP)
157 rc = get_tcp_opt (socket->tcp_sock, option, optval, optlen);
158
159 else if (level == socket->so_proto && level == IPPROTO_UDP)
160 rc = get_udp_opt (socket->udp_sock, option, optval, optlen);
161
162 else if ((level == socket->so_proto && level == IPPROTO_IP) ||
163 (level == socket->so_proto && level == IPPROTO_ICMP) ||
164 socket->so_proto == IPPROTO_UDP)
165 rc = get_raw_opt (socket, option, optval, optlen);
166
167 else
168 {
169 SOCK_ERRNO (ENOPROTOOPT);
170 rc = -1;
171 }
172
173 if (rc < 0)
174 SOCK_DEBUGF ((", %s", short_strerror(_w32_errno)));
175
176 return (rc);
177}
178
179
180static int set_sol_opt (Socket *s, int opt, const void *val, unsigned len)
181{
182 struct timeval *tv = (struct timeval*) val;
183 int on = *(int*) val;
184 DWORD size = (len >= 4) ? *(DWORD*)val :
185 (len >= 2) ? *(WORD*)val :
186 (len >= 1) ? *(BYTE*)val : 0U;
187 switch (opt)
188 {
189 case SO_DEBUG:
190 case SO_ACCEPTCONN:
191 if (on)
192 s->so_options |= opt;
193 else s->so_options &= ~opt;
194 SOCK_DEBUGF ((" %d", s->so_options & opt));
195 break;
196
197 case SO_RCVTIMEO:
198 if (len != sizeof(*tv) || tv->tv_usec < 0)
199 {
200 SOCK_ERRNO (EINVAL);
201 return (-1);
202 }
203 if (tv->tv_sec == 0) /* i.e. use system default */
204 s->timeout = sock_delay;
205 else s->timeout = (DWORD)tv->tv_sec + tv->tv_usec/1000000UL;
206 SOCK_DEBUGF ((" %d", s->timeout));
207 break;
208
209 case SO_SNDTIMEO: /* Don't think we need this */
210 break;
211
212 /*
213 * SO_REUSEADDR enables local address reuse. E.g. used to bind
214 * multiple sockets to the same port but with different ip-addr.
215 */
216 case SO_REUSEADDR:
217 if (s->tcp_sock && s->so_proto == IPPROTO_TCP)
218 {
219 /* This is meaningless unless a local port is bound.
220 * myport is 0 before a connect() is done.
221 */
222 reuse_localport (s->tcp_sock->myport);
223 return (0);
224 }
225 if (s->udp_sock && s->so_proto == IPPROTO_UDP)
226 {
227 reuse_localport (s->udp_sock->myport);
228 return (0);
229 }
230 SOCK_ERRNO (ENOPROTOOPT);
231 return (-1);
232
233 /*
234 * SO_REUSEPORT enables duplicate address and port bindings
235 * ie, one can bind multiple socks to the same <ip_addr.port> pair
236 */
237/* case SO_REUSEPORT: missing in BSD? */
238 case SO_DONTROUTE:
239 case SO_BROADCAST:
240 case SO_USELOOPBACK:
241 case SO_OOBINLINE:
242 break;
243
244 case SO_DONTLINGER:
245 s->linger_time = 0;
246 s->linger_on = 0;
247 s->tcp_sock->locflags &= ~LF_LINGER;
248 break;
249
250 case SO_KEEPALIVE:
251 if (on)
252 s->so_options |= SO_KEEPALIVE;
253 else s->so_options &= ~SO_KEEPALIVE;
254 SOCK_DEBUGF ((" %d", s->so_options & SO_KEEPALIVE));
255 break;
256
257 case SO_SNDLOWAT:
258 return set_tx_lowat (s, size);
259
260 case SO_RCVLOWAT:
261 return set_rx_lowat (s, size);
262
263 case SO_RCVBUF:
264 if (size == 0)
265 {
266 SOCK_ERRNO (EINVAL);
267 return (-1);
268 }
269 if (s->udp_sock && s->so_proto == IPPROTO_UDP)
270 return set_recv_buf ((sock_type*)s->udp_sock, size, FALSE);
271
272 if (s->tcp_sock && s->so_proto == IPPROTO_TCP)
273 return set_recv_buf ((sock_type*)s->tcp_sock, size, TRUE);
274
275 if (s->raw_sock)
276 return raw_rx_buf (s->raw_sock, size);
277
278 if (s->raw6_sock)
279 return raw6_rx_buf (s->raw6_sock, size);
280
281 SOCK_ERRNO (ENOPROTOOPT);
282 return (-1);
283
284 case SO_SNDBUF:
285 if (size == 0)
286 {
287 SOCK_ERRNO (EINVAL);
288 return (-1);
289 }
290 if (s->udp_sock && s->so_proto == IPPROTO_UDP)
291 return set_xmit_buf ((sock_type*)s->udp_sock, size, FALSE);
292
293 if (s->tcp_sock && s->so_proto == IPPROTO_TCP)
294 return set_xmit_buf ((sock_type*)s->tcp_sock, size, TRUE);
295
296 if (s->raw_sock)
297 return raw_tx_buf (s->raw_sock, size);
298
299 if (s->raw6_sock)
300 return raw6_tx_buf (s->raw6_sock, size);
301
302 SOCK_ERRNO (ENOPROTOOPT);
303 return (-1);
304
305 case SO_LINGER:
306 {
307 struct linger *linger = (struct linger*) val;
308
309 if (len < sizeof(*linger))
310 {
311 SOCK_ERRNO (EINVAL);
312 return (-1);
313 }
314
315 if (s->so_type != SOCK_STREAM || !s->tcp_sock)
316 {
317 SOCK_ERRNO (ENOPROTOOPT);
318 return (-1);
319 }
320
321 if (linger->l_onoff == 0 && linger->l_linger == 0)
322 {
323 s->linger_time = 0;
324 s->linger_on = 0;
325 s->tcp_sock->locflags &= ~LF_LINGER;
326 }
327 else if (linger->l_onoff /* && linger->l_linger > 0 */ )
328 {
329 unsigned sec = TCP_LINGERTIME;
330
331 if (linger->l_linger < 100 * TCP_LINGERTIME)
332 sec = linger->l_linger / 100; /* in 10ms units */
333
334 s->linger_time = sec;
335 s->linger_on = 1;
336 s->tcp_sock->locflags |= LF_LINGER;
337 }
338 s->so_options |= SO_LINGER;
339 }
340 break;
341
342 default:
343 SOCK_ERRNO (ENOPROTOOPT);
344 return (-1);
345 }
346 return (0);
347}
348
349
350static int get_sol_opt (Socket *s, int opt, void *val, int *len)
351{
352 struct timeval *tv;
353 unsigned *size = (unsigned*)val;
354
355 switch (opt)
356 {
357 case SO_DEBUG:
358 case SO_ACCEPTCONN:
359 *(int*)val = (s->so_options & opt);
360 *len = sizeof(int);
361 break;
362#if 0
363 case SO_OOBINLINE:
364 if (!s->tcp_sock || s->so_proto != IPPROTO_TCP)
365 {
366 SOCK_ERRNO (ENOPROTOOPT);
367 return (-1);
368 }
369 if (s->so_options & SO_OOBINLINE)
370 *(int*)val = urgent_data ((sock_type*)s->tcp_sock);
371 else *(int*)val = 0;
372 break;
373#endif
374
377 case SO_REUSEADDR:
378 case SO_DONTROUTE:
379 case SO_BROADCAST:
380 case SO_USELOOPBACK:
381 break;
382
383 case SO_DONTLINGER:
384 *(int*)val = !(s->tcp_sock->locflags & LF_LINGER);
385 break;
386
387 case SO_KEEPALIVE:
388 if (s->so_options & SO_KEEPALIVE)
389 {
390 *(int*)val = tcp_keep_idle;
391 *len = sizeof(tcp_keep_idle);
392 }
393 else
394 {
395 *(int*)val = 0;
396 *len = 0;
397 }
398 break;
399
400 case SO_SNDLOWAT:
401 return get_tx_lowat (s, size);
402
403 case SO_RCVLOWAT:
404 return get_rx_lowat (s, size);
405
406 case SO_RCVBUF:
407 if (s->udp_sock && s->so_proto == IPPROTO_UDP)
408 {
409 *(int*)val = sock_rbsize ((sock_type*)s->udp_sock);
410 return (0);
411 }
412 if (s->tcp_sock && s->so_proto == IPPROTO_TCP)
413 {
414 *(int*)val = sock_rbsize ((sock_type*)s->tcp_sock);
415 return (0);
416 }
417 if (s->raw_sock)
418 {
419 *(size_t*)val = sizeof (s->raw_sock->rx_data);
420 return (0);
421 }
422 SOCK_ERRNO (ENOPROTOOPT);
423 return (-1);
424
425 case SO_SNDBUF:
426 if (s->udp_sock && s->so_proto == IPPROTO_UDP)
427 {
428 *(unsigned*)val = 0; /* UDP doesn't have a Tx-buffer */
429 return (0);
430 }
431 if (s->tcp_sock && s->so_proto == IPPROTO_TCP)
432 {
433 *(unsigned*)val = sock_tbsize ((sock_type*)s->tcp_sock);
434 return (0);
435 }
436 if (s->raw_sock)
437 {
438 *(unsigned*)val = _mtu;
439 return (0);
440 }
441 SOCK_ERRNO (ENOPROTOOPT);
442 return (-1);
443
444 case SO_LINGER:
445 {
446 struct linger *linger = (struct linger*) val;
447
448 if (!len || *len < SIZEOF(*linger))
449 {
450 SOCK_ERRNO (EINVAL);
451 return (-1);
452 }
453 if (s->so_type != SOCK_STREAM || !s->tcp_sock)
454 {
455 SOCK_ERRNO (ENOPROTOOPT);
456 return (-1);
457 }
458 *len = SIZEOF(*linger);
459 linger->l_onoff = (s->tcp_sock->locflags & LF_LINGER) ? 1 : 0;
460 linger->l_linger = 100 * s->linger_time;
461 SOCK_DEBUGF ((", linger %d, %s",
462 linger->l_linger, linger->l_onoff ? "on" : "off"));
463 }
464 break;
465
466 case SO_SNDTIMEO:
467 break;
468
469 case SO_RCVTIMEO:
470 if (*len < SIZEOF(*tv))
471 {
472 SOCK_ERRNO (EINVAL);
473 return (-1);
474 }
475 tv = (struct timeval*)val;
476 if (s->timeout == 0)
477 {
478 tv->tv_usec = LONG_MAX;
479 tv->tv_sec = LONG_MAX;
480 }
481 else
482 {
483 tv->tv_usec = 0;
484 tv->tv_sec = s->timeout;
485 }
486 SOCK_DEBUGF ((", timeout %lu.%06ld", (u_long)tv->tv_sec, tv->tv_usec));
487 break;
488
489 case SO_ERROR:
490 *(int*)val = s->so_error;
491 *len = SIZEOF(s->so_error);
492 SOCK_DEBUGF ((", val %d=%s",
493 s->so_error, short_strerror(s->so_error)));
494 s->so_error = 0; /* Linux man-page states we should clear this */
495 break;
496
497 /* case SO_STYLE: GNU libc name */
498 case SO_TYPE:
499 *(int*)val = s->so_type;
500 *len = SIZEOF(s->so_type);
501 SOCK_DEBUGF ((", type %d", s->so_type));
502 break;
503
504 default:
505 SOCK_ERRNO (ENOPROTOOPT);
506 return (-1);
507 }
508 SOCK_ERRNO (0);
509 return (0);
510}
511
512/*
513 * set/get TCP-layer options
514 */
515static int set_tcp_opt (_tcp_Socket *tcp, int opt, const void *val, int len)
516{
517 BOOL on = *(BOOL*)val;
518 UINT MSS;
519
520 switch (opt)
521 {
522 case TCP_NODELAY:
523 if (on) /* disable Nagle's algorithm */
524 tcp->sockmode &= ~SOCK_MODE_NAGLE;
525 else tcp->sockmode |= SOCK_MODE_NAGLE;
526 break;
527
528 case TCP_MAXSEG:
529 MSS = *(DWORD*)val;
530 MSS = max (MSS, MSS_MIN);
531 MSS = min (MSS, MSS_MAX);
532 tcp->max_seg = MSS;
533 break;
534
535 case TCP_NOPUSH:
536 if (on)
537 tcp->locflags |= LF_NOPUSH;
538 else tcp->locflags &= ~LF_NOPUSH;
539 break;
540
541 case TCP_NOOPT:
542 if (on)
543 tcp->locflags |= LF_NOOPT;
544 else tcp->locflags &= ~LF_NOOPT;
545 break;
546
547 default:
548 SOCK_ERRNO (ENOPROTOOPT);
549 return (-1);
550 }
551 ARGSUSED (len);
552 return (0);
553}
554
555static int get_tcp_opt (_tcp_Socket *tcp, int opt, void *val, int *len)
556{
557 switch (opt)
558 {
559 case TCP_NODELAY:
560 if (tcp->sockmode & SOCK_MODE_NAGLE)
561 *(int*)val = 0;
562 else *(int*)val = TCP_NODELAY;
563 *len = SIZEOF(int);
564 break;
565
566 case TCP_MAXSEG:
567 *(int*)val = tcp->max_seg;
568 *len = SIZEOF(int);
569 break;
570
571 case TCP_NOPUSH:
572 *(int*)val = (tcp->locflags & LF_NOPUSH);
573 *len = SIZEOF(tcp->locflags);
574 break;
575
576 case TCP_NOOPT:
577 *(int*)val = (tcp->locflags & LF_NOOPT);
578 *len = SIZEOF(tcp->locflags);
579 break;
580
581 default:
582 SOCK_ERRNO (ENOPROTOOPT);
583 return (-1);
584 }
585 return (0);
586}
587
588/*
589 * set/get UDP-layer options
590 */
591static int set_udp_opt (_udp_Socket *udp, int opt, const void *val, int len)
592{
593 ARGSUSED (udp); /* no udp option support yet */
594 ARGSUSED (opt);
595 ARGSUSED (val);
596 ARGSUSED (len);
597 SOCK_ERRNO (ENOPROTOOPT);
598 return (-1);
599}
600
601
602static int get_udp_opt (_udp_Socket *udp, int opt, void *val, int *len)
603{
604 ARGSUSED (udp); /* no udp option support yet */
605 ARGSUSED (opt);
606 ARGSUSED (val);
607 ARGSUSED (len);
608 SOCK_ERRNO (ENOPROTOOPT);
609 return (-1);
610}
611
612/*
613 * set/get IP/ICMP-layer (raw/multicast) options
614 */
615static int set_raw_opt (Socket *s, int opt, const void *val, int len)
616{
617#ifdef USE_MULTICAST
618 struct ip_mreq *mc_req;
619 DWORD ip;
620#endif
621 BOOL on = *(BOOL*)val;
622
623 switch (opt)
624 {
625 case IP_OPTIONS:
626 if (!s->ip_opt &&
627 (s->ip_opt = SOCK_CALLOC (sizeof(*s->ip_opt))) == NULL)
628 {
629 SOCK_ERRNO (ENOMEM);
630 return (-1);
631 }
632 if (len == 0 && s->ip_opt)
633 {
634 free (s->ip_opt);
635 s->ip_opt = NULL;
636 s->ip_opt_len = 0;
637 }
638 else
639 {
640 s->ip_opt_len = min ((unsigned)len, sizeof(*s->ip_opt));
641 if (len > 0)
642 memcpy (&s->ip_opt->IP_opts[0], val, s->ip_opt_len);
643 }
644 break;
645
646 case IP_HDRINCL:
647 if (on)
648 s->inp_flags |= INP_HDRINCL;
649 else s->inp_flags &= ~INP_HDRINCL;
650 break;
651
652 case IP_TOS:
653 s->ip_tos = *(int*)val;
654 if (s->tcp_sock)
655 s->tcp_sock->tos = s->ip_tos;
656 else if (s->raw_sock)
657 s->raw_sock->ip.tos = s->ip_tos;
658 break;
659
660 case IP_TTL:
661 case IP_MULTICAST_TTL:
662 s->ip_ttl = *(BYTE*)val;
663 s->ip_ttl = max (1, s->ip_ttl);
664 if (s->udp_sock)
665 s->udp_sock->ttl = s->ip_ttl;
666 else if (s->tcp_sock)
667 s->tcp_sock->ttl = s->ip_ttl;
668 else if (s->raw_sock)
669 s->raw_sock->ip.ttl = s->ip_ttl;
670 break;
671
672 case IP_ADD_MEMBERSHIP:
673 case IP_DROP_MEMBERSHIP:
674#ifdef USE_MULTICAST
675 _multicast_on = TRUE;
676 mc_req = (struct ip_mreq*)val;
677 if (!mc_req || len < SIZEOF(*mc_req))
678 {
679 SOCK_ERRNO (EINVAL);
680 return (-1);
681 }
682 ip = ntohl (mc_req->imr_multiaddr.s_addr);
683 if (!_ip4_is_multicast(ip))
684 {
685 SOCK_ERRNO (EINVAL);
686 return (-1);
687 }
688 if (opt == IP_ADD_MEMBERSHIP && !join_mcast_group(ip))
689 {
690 SOCK_ERRNO (ENOBUFS); /* !!correct errno? */
691 return (-1);
692 }
693 if (opt == IP_DROP_MEMBERSHIP && !leave_mcast_group(ip))
694 {
695 SOCK_ERRNO (EADDRNOTAVAIL); /* !!correct errno? */
696 return (-1);
697 }
698#endif
699 break;
700
701 case IP_MULTICAST_IF:
702 case IP_MULTICAST_LOOP:
703 case IP_MULTICAST_VIF:
704 _multicast_on = TRUE;
705 break;
706
707 case IP_RECVOPTS:
708 case IP_RECVRETOPTS:
709 case IP_RECVDSTADDR:
710 case IP_RETOPTS:
711 case IP_RSVP_ON:
712 case IP_RSVP_OFF:
713 case IP_RSVP_VIF_ON:
714 case IP_RSVP_VIF_OFF:
715 case IP_PORTRANGE:
716 case IP_RECVIF:
717 break;
718
719 default:
720 SOCK_ERRNO (ENOPROTOOPT);
721 return (-1);
722 }
723 return (0);
724}
725
726static int get_raw_opt (Socket *s, int opt, void *val, int *len)
727{
728 switch (opt)
729 {
730 case IP_OPTIONS:
731 if (s->ip_opt)
732 {
733 *len = (int)s->ip_opt_len;
734 memcpy (val, &s->ip_opt->IP_opts[0], *len);
735 }
736 else
737 {
738 memset (val, 0, *len);
739 *len = 0;
740 }
741 break;
742
743 case IP_HDRINCL:
744 *(int*)val = (s->inp_flags & INP_HDRINCL);
745 *len = sizeof(int);
746 break;
747
748 case IP_TOS:
749 *(int*)val = s->ip_tos;
750 *len = sizeof(int);
751 break;
752
753 case IP_TTL:
754 case IP_MULTICAST_TTL:
755 *(BYTE*)val = s->ip_ttl;
756 *len = 1;
757 break;
758
759 case IP_RECVOPTS:
760 case IP_RECVRETOPTS:
761 case IP_RECVDSTADDR:
762 case IP_RETOPTS:
763 case IP_RSVP_ON:
764 case IP_RSVP_OFF:
765 case IP_RSVP_VIF_ON:
766 case IP_RSVP_VIF_OFF:
767 case IP_PORTRANGE:
768 case IP_RECVIF:
769 break;
770
771 case IP_ADD_MEMBERSHIP:
772 case IP_DROP_MEMBERSHIP:
773 case IP_MULTICAST_IF:
774 _multicast_on = TRUE;
775 break;
776
777 case IP_MULTICAST_LOOP:
778 _multicast_on = TRUE;
779 *(BYTE*)val = 0;
780 *len = 1;
781 break;
782
783 case IP_MULTICAST_VIF:
784 _multicast_on = TRUE;
785 break;
786
787 default:
788 SOCK_ERRNO (ENOPROTOOPT);
789 return (-1);
790 }
791 return (0);
792}
793
794/*
795 * Set receive buffer size for UDP/TCP. Since sock_setbuf() handles
796 * maxiumum 64kB, we do the same here.
797 * Maximum size accepted for TCP is '64k * (2 << TCP_MAX_WINSHIFT)' = 1MByte.
798 * Minimum size is 1 byte.
799 */
800static int set_recv_buf (sock_type *s, DWORD size, BOOL is_tcp)
801{
802 BYTE *buf;
803 DWORD len;
804 DWORD max = is_tcp ? MAX_TCP_RECV_BUF : MAX_UDP_RECV_BUF;
805
806 if (s->tcp.rx_data == &s->tcp.rx_buf[0])
807 buf = NULL;
808 else buf = s->tcp.rx_data-4;
809
810 size = min (size, max); /* 64kB/1MB */
811 buf = (BYTE*) realloc (buf, size+8);
812 if (!buf)
813 {
814 SOCK_ERRNO (ENOMEM);
815 return (-1);
816 }
817
818 /* Copy the data to new buffer. Data might be overlapping
819 * hence using memmove(). Add front/back markers.
820 */
821 if (s->tcp.rx_datalen > 0)
822 {
823 len = min ((long)size-8, s->tcp.rx_datalen);
824 memmove (buf+4, s->tcp.rx_data, len);
825 }
826 *(DWORD*)buf = SAFETY_TCP;
827 *(DWORD*)(buf+4+size) = SAFETY_TCP;
828 s->tcp.rx_data = buf + 4;
829 s->tcp.max_rx_data = size - 1;
830
831 if (is_tcp && size > USHRT_MAX)
832 s->tcp.tx_wscale = (BYTE) (size >> 16); /* not yet */
833
834 SOCK_DEBUGF ((" %lu", (u_long)size));
835 return (0);
836}
837
838/*
839 * Set transmit buffer size for UDP/TCP.
840 * Max size accepted is 'max'.
841 * size == 0 is legal, but how should we handle that?
842 */
843static int set_xmit_buf (sock_type *s, DWORD size, BOOL is_tcp)
844{
845#if 0 /* not yet */
846 BYTE *buf;
847 DWORD max = is_tcp ? MAX_TCP_SEND_BUF : MAX_UDP_SEND_BUF;
848 size_t len;
849
850 size = min (size, max);
851 buf = realloc (s->tcp.tx_data, size);
852 if (!buf)
853 {
854 SOCK_ERRNO (ENOMEM);
855 return (-1);
856 }
857
858 /* Copy current data to new buffer. Data might be overlapping
859 * hence using memmove(). Add front/back markers.
860 */
861 if (s->tcp.tx_datalen > 0)
862 {
863 len = min ((long)size-8, s->tcp.tx_datalen);
864 memmove (buf+4, s->tcp.tx_data, len);
865 }
866 *(DWORD*)buf = SAFETY_TCP;
867 *(DWORD*)(buf+size-4) = SAFETY_TCP;
868 s->tcp.tx_data = buf + 4;
869 s->tcp.maxdatalen = size - (4+4+1);
870 SOCK_DEBUGF ((" %lu", size));
871#else
872 ARGSUSED (s);
873 ARGSUSED (size);
874 ARGSUSED (is_tcp);
875#endif
876 return (0);
877}
878
879/*
880 * Set receive buffer size for RAW socket
881 */
882static int raw_rx_buf (_raw_Socket *raw, DWORD size)
883{
885 SOCK_DEBUGF ((" %lu unsupported", (u_long)size));
886 ARGSUSED (raw);
887 ARGSUSED (size);
888 return (0);
889}
890
891static int raw_tx_buf (_raw_Socket *raw, DWORD size)
892{
894 SOCK_DEBUGF ((" %lu unsupported", (u_long)size));
895 ARGSUSED (raw);
896 ARGSUSED (size);
897 return (0);
898}
899
900static int raw6_rx_buf (_raw6_Socket *raw, DWORD size)
901{
903 SOCK_DEBUGF ((" %lu unsupported", (u_long)size));
904 ARGSUSED (raw);
905 ARGSUSED (size);
906 return (0);
907}
908
909static int raw6_tx_buf (_raw6_Socket *raw, DWORD size)
910{
912 SOCK_DEBUGF ((" %lu unsupported", (u_long)size));
913 ARGSUSED (raw);
914 ARGSUSED (size);
915 return (0);
916}
917
918/*
919 * Set send buffer "low water marks"; x >= 0, x < send-size.
920 */
921static int set_tx_lowat (Socket *sock, unsigned size)
922{
923 switch (sock->so_type)
924 {
925 case SOCK_STREAM:
926 sock->send_lowat = min (size, MAX_TCP_SEND_BUF-1);
927 break;
928 case SOCK_DGRAM:
929 sock->send_lowat = min (size, MAX_UDP_SEND_BUF-1);
930 break;
931 case SOCK_RAW:
932 sock->send_lowat = min (size, _mtu);
933 break;
934 default:
935 SOCK_ERRNO (ENOPROTOOPT);
936 return (-1);
937 }
938 return (0);
939}
940
941/*
942 * Set receive buffer "low water marks"; x >= 0, x < recv-size.
943 */
944static int set_rx_lowat (Socket *sock, unsigned size)
945{
946 switch (sock->so_type)
947 {
948 case SOCK_STREAM:
949 if (sock->tcp_sock)
950 sock->recv_lowat = min (size, sock->tcp_sock->max_rx_data-1);
951 break;
952 case SOCK_DGRAM:
953 if (sock->udp_sock)
954 sock->recv_lowat = min (size, sock->udp_sock->max_rx_data-1);
955 break;
956 case SOCK_RAW:
957 sock->recv_lowat = min (size, sizeof(sock->raw_sock->rx_data)-1);
958 break;
959 default:
960 SOCK_ERRNO (ENOPROTOOPT);
961 return (-1);
962 }
963 return (0);
964}
965
966/*
967 * Get receive/transmit buffer "low water marks"
968 */
969static int get_tx_lowat (const Socket *sock, unsigned *size)
970{
971 if (sock->so_type == SOCK_STREAM ||
972 sock->so_type == SOCK_DGRAM ||
973 sock->so_type == SOCK_RAW)
974 {
975 *size = sock->send_lowat;
976 return (0);
977 }
978 SOCK_ERRNO (ENOPROTOOPT);
979 return (-1);
980}
981
982static int get_rx_lowat (const Socket *sock, unsigned *size)
983{
984 if (sock->so_type == SOCK_STREAM ||
985 sock->so_type == SOCK_DGRAM ||
986 sock->so_type == SOCK_RAW)
987 {
988 *size = sock->recv_lowat;
989 return (0);
990 }
991 SOCK_ERRNO (ENOPROTOOPT);
992 return (-1);
993}
994
995#if defined(USE_DEBUG)
996/*
997 * Handle printing of option names
998 */
999static const struct search_list sol_options[] = {
1000 { SO_DEBUG, "SO_DEBUG" },
1001 { SO_ACCEPTCONN, "SO_ACCEPTCONN" },
1002 { SO_REUSEADDR, "SO_REUSEADDR" },
1003 { SO_KEEPALIVE, "SO_KEEPALIVE" },
1004 { SO_DONTROUTE, "SO_DONTROUTE" },
1005 { SO_BROADCAST, "SO_BROADCAST" },
1006 { SO_USELOOPBACK, "SO_USELOOPBACK" },
1007 { SO_LINGER, "SO_LINGER" },
1008 { SO_OOBINLINE, "SO_OOBINLINE" },
1009 { SO_SNDBUF, "SO_SNDBUF" },
1010 { SO_RCVBUF, "SO_RCVBUF" },
1011 { SO_SNDLOWAT, "SO_SNDLOWAT" },
1012 { SO_RCVLOWAT, "SO_RCVLOWAT" },
1013 { SO_SNDTIMEO, "SO_SNDTIMEO" },
1014 { SO_RCVTIMEO, "SO_RCVTIMEO" },
1015 { SO_ERROR, "SO_ERROR" },
1016 { SO_TYPE, "SO_TYPE" }
1017 };
1018
1019static const struct search_list tcp_options[] = {
1020 { TCP_NODELAY, "TCP_NODELAY" },
1021 { TCP_MAXSEG, "TCP_MAXSEG" },
1022 { TCP_NOPUSH, "TCP_NOPUSH" },
1023 { TCP_NOOPT, "TCP_NOOPT" }
1024 };
1025
1026static const struct search_list ip_options[] = {
1027 { IP_OPTIONS, "IP_OPTIONS" },
1028 { IP_HDRINCL, "IP_HDRINCL" },
1029 { IP_TOS, "IP_TOS" },
1030 { IP_TTL, "IP_TTL" },
1031 { IP_RECVOPTS, "IP_RECVOPTS" },
1032 { IP_RECVRETOPTS, "IP_RECVRETOPTS" },
1033 { IP_RECVDSTADDR, "IP_RECVDSTADDR" },
1034 { IP_RETOPTS, "IP_RETOPTS" },
1035 { IP_MULTICAST_IF, "IP_MULTICAST_IF" },
1036 { IP_MULTICAST_TTL, "IP_MULTICAST_TTL" },
1037 { IP_MULTICAST_LOOP, "IP_MULTICAST_LOOP" },
1038 { IP_ADD_MEMBERSHIP, "IP_ADD_MEMBERSHIP" },
1039 { IP_DROP_MEMBERSHIP,"IP_DROP_MEMBERSHIP" },
1040 { IP_MULTICAST_VIF, "IP_MULTICAST_VIF" },
1041 { IP_RSVP_ON, "IP_RSVP_ON" },
1042 { IP_RSVP_OFF, "IP_RSVP_OFF" },
1043 { IP_RSVP_VIF_ON, "IP_RSVP_VIF_ON" },
1044 { IP_RSVP_VIF_OFF, "IP_RSVP_VIF_OFF" },
1045 { IP_PORTRANGE, "IP_PORTRANGE" },
1046 { IP_RECVIF, "IP_RECVIF" },
1047 { IP_FW_ADD, "IP_FW_ADD" },
1048 { IP_FW_DEL, "IP_FW_DEL" },
1049 { IP_FW_FLUSH, "IP_FW_FLUSH" },
1050 { IP_FW_ZERO, "IP_FW_ZERO" },
1051 { IP_FW_GET, "IP_FW_GET" },
1052 { IP_NAT, "IP_NAT" }
1053 };
1054
1055
1056static const char *sockopt_name (int level, int option)
1057{
1058 switch ((DWORD)level)
1059 {
1060 case SOL_SOCKET:
1061 return list_lookup (option, sol_options, DIM(sol_options));
1062
1063 case IPPROTO_UDP:
1064 return ("udp option!?");
1065
1066 case IPPROTO_TCP:
1067 return list_lookup (option, tcp_options, DIM(tcp_options));
1068
1069 case IPPROTO_IP:
1070 case IPPROTO_ICMP:
1071 return list_lookup (option, ip_options, DIM(ip_options));
1072
1073 default:
1074 return ("invalid level?");
1075 }
1076}
1077#endif /* USE_DEBUG */
1078#endif /* USE_BSD_API */
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
tcp_keep_idle
unsigned tcp_keep_idle
idle time before sending keepalive
Definition: pctcp.c:135
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
_sock_dos_fd
BOOL _sock_dos_fd(int s)
_sock_dos_fd - Return TRUE if ‘s’ is a valid DOS/Win32 handle.
Definition: socket.c:202
raw_tx_buf
static int raw_tx_buf(_raw_Socket *raw, DWORD size)
Definition: sockopt.c:891
raw_rx_buf
static int raw_rx_buf(_raw_Socket *raw, DWORD size)
Definition: sockopt.c:882
raw6_tx_buf
static int raw6_tx_buf(_raw6_Socket *raw, DWORD size)
Definition: sockopt.c:909
raw6_rx_buf
static int raw6_rx_buf(_raw6_Socket *raw, DWORD size)
Definition: sockopt.c:900
get_sol_opt
static int get_sol_opt(Socket *s, int opt, void *val, int *len)
Definition: sockopt.c:350
_raw6_Socket
Definition: wattcp.h:679
_raw_Socket
Definition: wattcp.h:665
_raw_Socket::rx_data
BYTE rx_data[MAX_FRAG_SIZE]
room for 1 jumbo IP packet
Definition: wattcp.h:671
Socket
Definition: socket.h:158
ip_mreq
Definition: in.h:317
search_list
Definition: misc.h:131
socket
Definition: if.h:82
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::tx_wscale
BYTE tx_wscale
Definition: wattcp.h:647
tcp_Socket::tx_datalen
UINT tx_datalen
number of bytes of data to send
Definition: wattcp.h:652
tcp_Socket::max_seg
UINT max_seg
MSS for this connection.
Definition: wattcp.h:630
tcp_Socket::tos
BYTE tos
TOS from IP-header.
Definition: wattcp.h:620
tcp_Socket::tx_data
BYTE * tx_data
Tx data buffer (default tx_buf[])
Definition: wattcp.h:654
tcp_Socket::rx_buf
BYTE rx_buf[tcp_MaxBufSize+1]
received data buffer
Definition: wattcp.h:588
timeval
Definition: wtime.h:30
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/src/split.c Source File

  • src
split.c
Go to the documentation of this file.
1
6/* Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Gisle Vanem
19 * Bergen, Norway.
20 *
21 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 * G. Vanem <gvanem@yahoo.no> 2002
33 */
34
35#include <stdio.h>
36#include <stdlib.h>
37
38#include "wattcp.h"
39#include "pcsed.h"
40#include "pcpkt.h"
41#include "pppoe.h"
42#include "ppp.h"
43#include "misc.h"
44#include "misc_str.h"
45#include "bsddbug.h"
46#include "ip6_in.h"
47#include "split.h"
48
49#if defined(NEED_PKT_SPLIT)
50
51#define MARKER 0xDEAFABBA
52#define MAX_SPLITS 10
53
54static struct pkt_split split_list_in [MAX_SPLITS];
55static struct pkt_split split_list_out[MAX_SPLITS];
56
57static void split_mac (struct pkt_split *, const void *);
58static void split_ip4 (struct pkt_split *, const in_Header *);
59static void split_ip6 (struct pkt_split *, const in6_Header *);
60
61const struct pkt_split *pkt_get_split_in (void)
62{
63 WATT_ASSERT (*(DWORD*)&split_list_in[MAX_SPLITS-1] == MARKER);
64 return (&split_list_in[0]);
65}
66
67const struct pkt_split *pkt_get_split_out (void)
68{
69 WATT_ASSERT (*(DWORD*)&split_list_out[MAX_SPLITS-1] == MARKER);
70 return (&split_list_out[0]);
71}
72
73const struct pkt_split *pkt_get_type_in (enum Components type)
74{
75 const struct pkt_split *ps;
76
77 for (ps = pkt_get_split_in(); ps->data; ps++)
78 if (type == ps->type)
79 return (ps);
80 return (NULL);
81}
82
83const struct pkt_split *pkt_get_type_out (enum Components type)
84{
85 const struct pkt_split *ps;
86
87 for (ps = pkt_get_split_out(); ps->data; ps++)
88 if (type == ps->type)
89 return (ps);
90 return (NULL);
91}
92
93const struct pkt_split *pkt_split_mac_in (const void *ptr)
94{
95 *(DWORD*) &split_list_in[MAX_SPLITS-1] = MARKER;
96 split_mac (&split_list_in[0], ptr);
97 return (&split_list_in[0]);
98}
99
100const struct pkt_split *pkt_split_mac_out (const void *ptr)
101{
102 *(DWORD*) &split_list_out[MAX_SPLITS-1] = MARKER;
103 split_mac (&split_list_out[0], ptr);
104 return (&split_list_out[0]);
105}
106
107static void split_mac (struct pkt_split *ps, const void *ptr)
108{
109 const link_Packet *pkt = (const link_Packet*) ptr;
110 const in_Header *ip = NULL;
111 WORD type = 0;
112
113 if (_pktserial) /* SLIP/PPP/AX25 doesn't have MAC header */
114 {
115 ip = &pkt->ip.head;
116 if (ip->ver == 6)
117 split_ip6 (ps, (const in6_Header*)ip);
118 else split_ip4 (ps, ip);
119 return;
120 }
121
122 if (_pktdevclass == PDCLASS_TOKEN)
123 {
124 const tok_Packet *tr = &pkt->tok;
125
126 ps->type = TYPE_TOKEN_HEAD;
127 ps->data = pkt;
128 ps->len = sizeof(tok_Header);
129
130 ip = (const in_Header*) &tr->data[0];
131 type = tr->head.type;
132 }
133 else if (_pktdevclass == PDCLASS_FDDI)
134 {
135 const fddi_Packet *fddi = &pkt->fddi;
136
137 ps->type = TYPE_FDDI_HEAD;
138 ps->data = pkt;
139 ps->len = sizeof(fddi_Header);
140
141 ip = (const in_Header*) &fddi->data[0];
142 type = fddi->head.type;
143 }
144 else if (_pktdevclass == PDCLASS_ARCNET)
145 {
146 const arcnet_Packet *arc = &pkt->arc;
147
148 ps->type = TYPE_ARCNET_HEAD;
149 ps->data = pkt;
150 ps->len = ARC_HDRLEN;
151
152 ip = (const in_Header*) ((BYTE*)arc + ARC_HDRLEN);
153 type = arc->head.type;
154 }
155 else if (_pktdevclass == PDCLASS_ETHER)
156 {
157 ps->type = TYPE_ETHER_HEAD;
158 ps->data = pkt;
159 ps->len = sizeof(eth_Header);
160
161 ip = (const in_Header*) &pkt->eth.data[0];
162 type = pkt->eth.head.type;
163 }
164
165 if (type == IP4_TYPE)
166 {
167 ps++;
168 split_ip4 (ps, ip);
169 return;
170 }
171
172 if (type == IP6_TYPE)
173 {
174 ps++;
175 split_ip6 (ps, (const in6_Header*)ip);
176 return;
177 }
178
179 if (type == ARP_TYPE)
180 {
181 ps++;
182 ps->type = TYPE_ARP;
183 ps->data = &pkt->eth.data[0];
184 ps->len = sizeof(arp_Header);
185 }
186 else if (type == RARP_TYPE)
187 {
188 ps++;
189 ps->type = TYPE_RARP;
190 ps->data = &pkt->eth.data[0];
191 ps->len = sizeof(rarp_Header);
192 }
193 else if (type == PPPOE_DISC_TYPE)
194 {
195 pppoe_Packet *pppoe = (pppoe_Packet*) &pkt->eth.data[0];
196
197 ps++;
198 ps->type = TYPE_PPPOE_DISC;
199 ps->data = pppoe;
200 ps->len = intel16 (pppoe->head.length);
201 }
202 else if (type == PPPOE_SESS_TYPE)
203 {
204 const pppoe_Packet *pppoe = (const pppoe_Packet*) &pkt->eth.data[0];
205 WORD proto = intel16 (*(WORD*)&pppoe->data[0]);
206
207 ps++;
208 ps->type = TYPE_PPPOE_SESS;
209 ps->data = pppoe;
210 ps->len = PPPOE_HDR_SIZE;
211 if (proto == intel16(PPP_IP))
212 {
213 ip = (const in_Header*) &pppoe->data[2];
214 split_ip4 (++ps, ip);
215 return;
216 }
217 if (proto == PPP_LCP)
218 {
219 const char *bp = (const char*) &pppoe->data[2];
220 ps++;
221 ps->type = TYPE_PPP_LCP;
222 ps->data = bp;
223 ps->len = intel16 (*(WORD*)(bp+2));
224 }
225 else if (proto == PPP_IPCP)
226 {
227 const char *bp = (const char*) &pppoe->data[2];
228 ps++;
229 ps->type = TYPE_PPP_IPCP;
230 ps->data = bp;
231 ps->len = intel16 (*(WORD*)(bp+2));
232 }
233 }
234 else if (intel16(type) < ETH_MAX_DATA) /* LLC unsupported */
235 {
236 ps++;
237 ps->type = TYPE_LLC_HEAD;
238 ps->len = intel16 (type);
239 ps->data = &pkt->eth.data[0];
240 }
241
242 ps++;
243 ps->data = NULL;
244}
245
246static void split_ip4 (struct pkt_split *ps, const in_Header *ip4)
247{
248 unsigned ip_len, ip_ofs, head_len;
249 int opt_len;
250
251 head_len = in_GetHdrLen (ip4);
252 opt_len = head_len - sizeof(*ip4);
253 ip_ofs = intel16 (ip4->frag_ofs);
254 ip_ofs = (ip_ofs & IP_OFFMASK) << 3; /* 0 <= ip_ofs <= 65536-8 */
255
256 if (head_len < sizeof(*ip4))
257 goto quit;
258
259 ps->type = TYPE_IP4;
260 ps->len = head_len;
261 ps->data = ip4;
262
263 if (opt_len > 0)
264 {
265 ps++;
266 ps->type = TYPE_IP4_OPTIONS;
267 ps->data = (ip4 + 1);
268 ps->len = opt_len;
269 }
270
271 if (ip_ofs)
272 {
273 ps++;
274 ps->type = TYPE_IP4_FRAG;
275 ps->data = (BYTE*)ip4 + head_len;
276 ps->len = intel16 (ip4->length) - head_len;
277 goto quit;
278 }
279
280 if (ip4->proto == ICMP_PROTO)
281 {
282 ps++;
283 ps->type = TYPE_ICMP;
284 ps->data = (BYTE*)ip4 + head_len;
285 ps->len = intel16 (ip4->length) - head_len;
286 }
287
288 else if (ip4->proto == IGMP_PROTO)
289 {
290 ps++;
291 ps->type = TYPE_IGMP;
292 ps->data = (BYTE*)ip4 + head_len;
293 ps->len = intel16 (ip4->length) - head_len;
294 }
295
296 else if (ip4->proto == UDP_PROTO)
297 {
298 const udp_Header *udp = (const udp_Header*) ((BYTE*)ip4 + head_len);
299 unsigned len = intel16 (udp->length) - sizeof(*udp);
300
301 ps++;
302 ps->type = TYPE_UDP_HEAD;
303 ps->data = (BYTE*)ip4 + head_len;
304 ps->len = sizeof (*udp);
305 ps++;
306 ps->type = TYPE_UDP_DATA;
307 ps->data = (BYTE*)ip4 + head_len + sizeof(*udp);
308 ps->len = min (len, intel16(ip4->length) - head_len - sizeof(*udp));
309 }
310
311 else if (ip4->proto == TCP_PROTO)
312 {
313 const tcp_Header *tcp = (const tcp_Header*) ((BYTE*)ip4 + head_len);
314 unsigned ofs = tcp->offset << 2;
315 unsigned dlen;
316
317 ip_len = intel16 (ip4->length) - sizeof(*ip4);
318 ps++;
319 ps->type = TYPE_TCP_HEAD;
320 ps->data = tcp;
321 ps->len = sizeof (*tcp);
322 if (ofs - sizeof(*tcp) > 0)
323 {
324 ps++;
325 ps->type = TYPE_TCP_OPTIONS;
326 ps->data = tcp + 1;
327 ps->len = ofs - sizeof(*tcp);
328 }
329 dlen = intel16 (ip4->length) - head_len - ofs;
330 dlen = min (dlen, ip_len);
331 ps++;
332 ps->type = TYPE_TCP_DATA;
333 ps->data = (const char*)tcp + ofs;
334 ps->len = dlen; /* may be 0 */
335 }
336
337quit:
338 ps++;
339 ps->data = NULL;
340}
341
342static void split_ip6 (struct pkt_split *ps, const in6_Header *ip6)
343{
344#if defined(USE_IPV6)
345 const tcp_Header *tcp;
346 const ip6_RouteHdr *rh;
347 const BYTE *bp = (const BYTE*)ip6;
348 WORD ip_len = intel16 (ip6->len);
349 BYTE nxt_hd = ip6->next_hdr;
350 int ofs, len;
351
352 ps->type = TYPE_IP6;
353 ps->len = sizeof(*ip6);
354 ps->data = ip6;
355 ps++;
356
357 while (nxt_hd && (bp < (const BYTE*)ip6 + ip_len))
358 {
359 switch (nxt_hd)
360 {
361 case IP6_NEXT_TCP:
362 tcp = (const tcp_Header*) (ip6 + 1);
363 ofs = tcp->offset << 2;
364 ps->type = TYPE_TCP_HEAD;
365 ps->data = tcp;
366 ps->len = sizeof (*tcp);
367 if (ofs - sizeof(*tcp) > 0)
368 {
369 ps++;
370 ps->type = TYPE_TCP_OPTIONS;
371 ps->data = tcp + 1;
372 ps->len = ofs - sizeof(*tcp);
373 }
374 nxt_hd = 0; /* no next headers allowed */
375 break;
376
377 case IP6_NEXT_UDP:
378 ps->type = TYPE_UDP_HEAD;
379 ps->data = ip6 + 1;
380 ps->len = sizeof (udp_Header);
381 nxt_hd = 0; /* no next headers allowed */
382 break;
383
384 case IP6_NEXT_HOP:
385 rh = (struct ip6_RouteHdr*) (ip6 + 1);
386 len = (rh->hdrlen + 1) << 3;
387 ps->type = TYPE_IP6_HOP;
388 ps->data = rh;
389 ps->len = len;
390 bp += len;
391 nxt_hd = *bp;
392 break;
393
394 case IP6_NEXT_ROUTING:
395 rh = (struct ip6_RouteHdr*) (ip6 + 1);
396 len = (rh->hdrlen + 1) << 3;
397 ps->type = TYPE_IP6_ROUTING;
398 ps->data = rh;
399 ps->len = len;
400 bp += len;
401 nxt_hd = *bp;
402 break;
403
404 case IP6_NEXT_DEST:
405 rh = (struct ip6_RouteHdr*) (ip6 + 1);
406 len = (rh->hdrlen + 1) << 3;
407 ps->type = TYPE_IP6_DEST;
408 ps->data = rh;
409 ps->len = len;
410 bp += len;
411 nxt_hd = *bp;
412 break;
413
414 case IP6_NEXT_ICMP:
415 rh = (struct ip6_RouteHdr*) (ip6 + 1);
416 len = (rh->hdrlen + 1) << 3;
417 ps->type = TYPE_IP6_ICMP;
418 ps->data = rh;
419 ps->len = len;
420 bp += len;
421 nxt_hd = 0;
422 break;
423
424 case IP6_NEXT_NONE:
425 ps->type = TYPE_IP6_NONE;
426 ps->data = NULL;
427 ps->len = 0;
428 nxt_hd = 0;
429 break;
430
432 case IP6_NEXT_FRAGMENT:
433 case IP6_NEXT_ESP:
434 case IP6_NEXT_AUTH:
435 case IP6_NEXT_IPV6:
436 rh = (struct ip6_RouteHdr*) (ip6 + 1);
437 len = (rh->hdrlen + 1) << 3;
438 ps->type = TYPE_IP6_UNSUPP;
439 ps->data = NULL;
440 ps->len = 0;
441 bp += len;
442 nxt_hd = *bp;
443 break;
444
445 case IP6_NEXT_COMP:
446 default:
447 ps->type = TYPE_IP6_UNSUPP;
448 ps->data = NULL;
449 ps->len = 0;
450 nxt_hd = 0;
451 break;
452 }
453 ps++;
454 }
455#else
456 ARGSUSED (ip6);
457#endif /* USE_IPV6 */
458
459 ps->data = NULL;
460}
461
462#if defined(USE_DEBUG)
463#if defined(USE_BSD_API)
464
465static const struct search_list names[] = {
466 { TYPE_TOKEN_HEAD, "token" },
467 { TYPE_FDDI_HEAD, "fddi" },
468 { TYPE_ETHER_HEAD, "ether" },
469 { TYPE_ARP, "arp" },
470 { TYPE_RARP, "rarp" },
471 { TYPE_PPPOE_DISC, "pppoe-disc" },
472 { TYPE_PPPOE_SESS, "pppoe-sess" },
473 { TYPE_PPP_LCP, "lcp" },
474 { TYPE_PPP_IPCP, "ipcp" },
475 { TYPE_LLC_HEAD, "llc" },
476 { TYPE_IP4, "ip4" },
477 { TYPE_IP4_OPTIONS, "ip4-opt" },
478 { TYPE_IP4_FRAG, "ip4-frag" },
479 { TYPE_ICMP, "icmp" },
480 { TYPE_IGMP, "igmp" },
481 { TYPE_UDP_HEAD, "udp" },
482 { TYPE_UDP_DATA, "udp-data" },
483 { TYPE_TCP_HEAD, "tcp" },
484 { TYPE_TCP_OPTIONS, "tcp-opt" },
485 { TYPE_TCP_DATA, "tcp-data" },
486 { TYPE_IP6, "ip6" },
487 { TYPE_IP6_HOP, "ip6-hop" },
488 { TYPE_IP6_IPV6, "ip6-ip6" },
489 { TYPE_IP6_ROUTING, "ip6-route" },
490 { TYPE_IP6_FRAGMENT,"ip6-frag" },
491 { TYPE_IP6_ESP, "ip6-esp" },
492 { TYPE_IP6_AUTH, "ip6-auth" },
493 { TYPE_IP6_ICMP, "icmp6" },
494 { TYPE_IP6_DEST, "ip6-dest" },
495 { TYPE_IP6_NONE, "ip6-none" },
496 { TYPE_IP6_UNSUPP, "ip6-unsupp" }
497 };
498#endif
499
500void pkt_print_split_in (void)
501{
502 const struct pkt_split *ps;
503
504 SOCK_DEBUGF (("\nRx:\n"));
505 for (ps = pkt_get_split_in(); ps->data; ps++)
506 SOCK_DEBUGF (("%10s: %5u bytes\n",
507 list_lookup(ps->type, names, DIM(names)), ps->len));
508}
509
510void pkt_print_split_out (void)
511{
512 const struct pkt_split *ps;
513
514 SOCK_DEBUGF (("\nTx:\n"));
515 for (ps = pkt_get_split_out(); ps->data; ps++)
516 SOCK_DEBUGF (("%10s: %5u bytes\n",
517 list_lookup(ps->type, names, DIM(names)), ps->len));
518}
519#endif /* USE_DEBUG */
520#endif /* NEED_PKT_SPLIT */
bsddbug.h
ip6_in.h
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
misc.h
misc_str.h
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
pcpkt.h
pcsed.h
ppp.h
pppoe.h
split_ip6
static void split_ip6(struct pkt_split *, const in6_Header *)
Definition: split.c:342
split.h
arcnet_Packet
Definition: pcsed.h:201
arp_Header
Definition: wattcp.h:476
eth_Header
Definition: pcsed.h:20
fddi_Header
Definition: pcsed.h:149
fddi_Packet
Definition: pcsed.h:164
in6_Header
Definition: wattcp.h:381
in_Header
Definition: wattcp.h:329
ip6_RouteHdr
Definition: ip6_in.h:23
pkt_split
Definition: split.h:46
pppoe_Packet
Definition: pcsed.h:237
search_list
Definition: misc.h:131
tcp_Header
Definition: wattcp.h:418
tok_Header
Definition: pcsed.h:70
tok_Packet
Definition: pcsed.h:98
udp_Header
Definition: wattcp.h:406
link_Packet
Definition: pcsed.h:247
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/split.h Source File

  • src
split.h
Go to the documentation of this file.
1
3#ifndef _w32_SPLIT_H
4#define _w32_SPLIT_H
5
6#if defined(USE_STATISTICS) || defined(USE_DEBUG) || defined(USE_IPV6)
7#define NEED_PKT_SPLIT
8#endif
9
10enum Components {
11 TYPE_TOKEN_HEAD = 1,
12 TYPE_FDDI_HEAD,
13 TYPE_ETHER_HEAD,
14 TYPE_ARCNET_HEAD,
15 TYPE_ARP,
16 TYPE_RARP,
17 TYPE_PPPOE_DISC,
18 TYPE_PPPOE_SESS,
19 TYPE_PPP_LCP,
20 TYPE_PPP_IPCP,
21 TYPE_LLC_HEAD,
22 TYPE_IP4,
23 TYPE_IP4_OPTIONS,
24 TYPE_IP4_FRAG,
25 TYPE_ICMP,
26 TYPE_IGMP,
27 TYPE_UDP_HEAD,
28 TYPE_UDP_DATA,
29 TYPE_TCP_HEAD,
30 TYPE_TCP_OPTIONS,
31 TYPE_TCP_DATA,
32 TYPE_IP6,
33 TYPE_IP6_HOP,
34 TYPE_IP6_IPV6,
35 TYPE_IP6_ROUTING,
36 TYPE_IP6_FRAGMENT,
37 TYPE_IP6_ESP,
38 TYPE_IP6_AUTH,
39 TYPE_IP6_ICMP,
40 TYPE_IP6_DEST,
41 TYPE_IP6_NONE,
42 TYPE_IP6_UNSUPP,
43 TYPE_MAX
44 };
45
46struct pkt_split {
47 enum Components type;
48 const void *data;
49 unsigned len;
50 };
51
52extern const struct pkt_split *pkt_split_mac_in (const void *link_pkt);
53extern const struct pkt_split *pkt_split_mac_out (const void *link_pkt);
54extern const struct pkt_split *pkt_get_split_in (void);
55extern const struct pkt_split *pkt_get_split_out (void);
56extern const struct pkt_split *pkt_get_type_in (enum Components type);
57extern const struct pkt_split *pkt_get_type_out (enum Components type);
58
59extern void pkt_print_split_in (void);
60extern void pkt_print_split_out (void);
61
62#endif
pkt_split
Definition: split.h:46


Watt-32 tcp/ip: E:/WATT/src/socket.h Source File

  • src
socket.h
Go to the documentation of this file.
1
4/*
5 * BSD sockets functionality for Waterloo TCP/IP.
6 *
7 * by G. Vanem 1997
8 */
9
10#ifndef _w32_SOCKET_H
11#define _w32_SOCKET_H
12
13#if defined(__TURBOC__) && (__TURBOC__ <= 0x301)
14 /*
15 * Prevent tcc <= 2.01 from even looking at this.
16 */
17 #define BOOL int
18#else /* rest of file */
19
20#if defined(__CYGWIN__)
21 #include "wattcp.h"
22#endif
23
24#include <stdio.h>
25#include <stdlib.h>
26#include <stdarg.h>
27#include <stddef.h>
28#include <string.h>
29#include <signal.h>
30#include <setjmp.h>
31#include <ctype.h>
32#include <time.h>
33#include <limits.h>
34#include <fcntl.h>
35#include <io.h>
36
37#include <sys/socket.h>
38#include <sys/ioctl.h>
39#include <sys/syslog.h>
40
41#include <net/if.h>
42#include <net/if_dl.h>
43#include <net/if_arp.h>
44#include <net/if_ether.h>
45#include <net/if_packe.h>
46#include <net/route.h>
47
48#include <netinet/in.h>
49#include <netinet/in_systm.h>
50#include <netinet/ip.h>
51#include <netinet/ip_var.h>
52#include <netinet/ip_icmp.h>
53#include <netinet/in_pcb.h>
54#include <netinet/in_var.h>
55#include <netinet/tcp.h>
56#include <netinet/tcpip.h>
57#include <netinet/ip6.h>
58#include <netinet/tcp_time.h>
59
60#include <arpa/inet.h>
61#include <arpa/nameser.h>
62#include <arpa/tftp.h>
63#include <netdb.h>
64#include <resolv.h>
65
66#include "wattcp.h"
67#include "chksum.h"
68#include "wdpmi.h"
69#include "misc.h"
70#include "misc_str.h"
71#include "run.h"
72#include "timer.h"
73#include "sock_ini.h"
74#include "language.h"
75#include "pcconfig.h"
76#include "pcqueue.h"
77#include "pcdbug.h"
78#include "pcsed.h"
79#include "pcpkt.h"
80#include "pcstat.h"
81#include "pcigmp.h"
82#include "pctcp.h"
83#include "pcbuf.h"
84#include "pcicmp.h"
85#include "pcarp.h"
86#include "pcrecv.h"
87#include "printk.h"
88#include "netaddr.h"
89#include "ip4_in.h"
90#include "ip4_out.h"
91#include "ip6_in.h"
92#include "ip6_out.h"
93#include "bsddbug.h"
94#include "bsdname.h"
95#include "gettod.h"
96
97#if defined(__DJGPP__)
98 #include <sys/resource.h>
99 #include <sys/fsext.h>
100 #include <unistd.h>
101 #if (DJGPP_MINOR >= 4)
102 #include <libc/fd_props.h>
103 #endif
104
105 /* in fsext.c */
106 extern int _fsext_demux (__FSEXT_Fnumber func, int *rv, va_list _args);
107
108 /* in select.c */
109 extern int _fsext_ready (int fd);
110
111#elif defined(__CYGWIN__)
112 #include <cygwin/version.h>
113
114 extern long _get_osfhandle (int); /* in cygwin1.dll (no prototype) */
115#endif
116
117/*
118 * Various sizes
119 */
120#if defined (TARGET_IS_32BIT)
121 #define MAX_DGRAMS 5 /* # of datagrams for broadcast */
122 #define MAX_RAW_BUFS 5 /* # of _raw_Socket in list */
123 #define MAX_RAW6_BUFS 5 /* # of _raw6_Socket in list */
124 #define MAX_PACKET_BUFS 10
125 #define MAX_SOCKETS 5000 /* # of sockets to handle */
126 #define MAX_TCP_RECV_BUF (1024*1024-1) /* Max size for SO_RCVBUF */
127#else
128 #define MAX_DGRAMS 2
129 #define MAX_RAW_BUFS 2
130 #define MAX_RAW6_BUFS 2
131 #define MAX_PACKET_BUFS 5
132 #define MAX_SOCKETS 512
133 #define MAX_TCP_RECV_BUF (USHRT_MAX-1)
134#endif
135
136#define MAX_TCP_SEND_BUF (USHRT_MAX-1) /* for SO_SNDLOWAT/SO_RCVLOWAT */
137#define MAX_UDP_RECV_BUF (USHRT_MAX-1)
138#define MAX_UDP_SEND_BUF (USHRT_MAX-1)
139#define MAX_RAW_RECV_BUF (USHRT_MAX-1)
140#define MAX_RAW_SEND_BUF (USHRT_MAX-1)
141
142#define DEFAULT_SEND_LOWAT 0
143#define DEFAULT_RECV_LOWAT 0
144#define DEFAULT_UDP_SIZE (8*1024)
145
146/* Buffer types for AF_PACKET sockets
147 */
148struct sock_packet_buf {
149 WORD rx_len;
150 char rx_buf [ETH_MAX+4]; /* add room for end marker */
151 };
152
153typedef struct sock_packet_pool {
154 struct pkt_ringbuf queue;
155 struct sock_packet_buf buf [MAX_PACKET_BUFS];
156 } sock_packet_pool;
157
158typedef struct Socket {
159 int fd;
160 struct Socket *next;
161 struct sockaddr_in *local_addr;
162 struct sockaddr_in *remote_addr;
163
164 int timeout;
165 int inp_flags; /* misc. IP-protocol options */
166 BYTE ip_tos;
167 BYTE ip_ttl;
168
169 struct ip_opts *ip_opt; /* for setsockopt(s, IP_OPTION, ...) */
170 unsigned ip_opt_len; /* output IP-option length */
171
172 int so_options; /* SO_KEEPALIVE, SO_ACCEPTCONN etc. */
173 int so_proto; /* IPPROTO_UDP, IPPROTO_TCP etc. */
174 int so_type; /* SOCK_STREAM, SOCK_DGRAM etc. */
175 int so_family; /* address family AF_INET/AF_INET6 */
176 int so_state; /* internal state, ref SS_* below */
177 int so_error; /* internal socket errno */
178 time_t close_time; /* we closed at (SOCK_STREAM) */
179 BOOL linger_on; /* user specified lingering */
180 unsigned linger_time; /* linger-time (SOCK_STREAM) */
181 unsigned fd_duped; /* FSEXT reference counting */
182 DWORD keepalive; /* keepalive timeout */
183 DWORD nb_timer; /* non-block timer */
184 _udp_Socket *udp_sock; /* actual state and Rx/Tx data is in */
185 _tcp_Socket *tcp_sock; /* one of these pointers */
186 _raw_Socket *raw_sock; /* points to 1st in linked-list */
187 _raw6_Socket *raw6_sock;
188 recv_buf **bcast_pool; /* buffers for INADDR_ANY sockets */
189 unsigned pool_size; /* size of above buffer */
190
191 /* For SOCK_PACKET sockets.
192 */
193 sock_packet_pool *packet_pool;
194 int (W32_CALL *old_eth_peek) (void *pkt);
195
196 /* listen-queue for incoming tcp connections
197 */
198 int backlog;
199 _tcp_Socket *listen_queue [SOMAXCONN];
200 DWORD syn_timestamp[SOMAXCONN]; /* got SYN at [msec] */
201
202 unsigned send_lowat; /* low-water Tx marks */
203 unsigned recv_lowat; /* low-water Rx marks */
204 BOOL msg_nosig; /* don't raise SIGPIPE */
205 DWORD cookie; /* memory cookie / marker */
206
207 } Socket;
208
209
210/*
211 * Let first socket start at 3 in order not to
212 * confuse sockets with stdin/stdout/stderr handles.
213 * First socket will always be >= 3 on djgpp thanks to FS-extensions.
214 */
215#define SK_FIRST 3
216
217/*
218 * Number of 'fd_set' required to hold MAX_SOCKETS.
219 */
220#define NUM_SOCK_FDSETS ((MAX_SOCKETS+sizeof(fd_set)-1) / sizeof(fd_set))
221
222/*
223 * Misc. defines
224 */
225#ifndef SIGIO /* for asynchronous I/O support (not yet) */
226#define SIGIO SIGUSR1
227#endif
228
229#ifndef IPPORT_ANY
230#define IPPORT_ANY 0
231#endif
232
233/*
234 * Socket state bits (in so_state).
235 */
236#define SS_NOFDREF 0x0001 /* no file table ref any more */
237#define SS_UNCONNECTED SS_NOFDREF /* or just created socket */
238#define SS_ISCONNECTED 0x0002 /* socket connected to a peer */
239#define SS_ISCONNECTING 0x0004 /* in process of connecting */
240#define SS_ISDISCONNECTING 0x0008 /* in process of disconnecting */
241#define SS_CANTSENDMORE 0x0010 /* can't send more data */
242#define SS_CANTRCVMORE 0x0020 /* can't receive more data */
243#define SS_RCVATMARK 0x0040 /* at mark on input (no used) */
244
245#define SS_PRIV 0x0080 /* privileged for broadcast */
246#define SS_NBIO 0x0100 /* non-blocking operations */
247#define SS_ASYNC 0x0200 /* async I/O notify (not used) */
248#define SS_ISCONFIRMING 0x0400 /* accepting connection req */
249#define SS_ISLISTENING SS_ISCONFIRMING /* non standard */
250
251#define SS_LOCAL_ADDR 0x0800 /* has local address/port (not used) */
252#define SS_REMOTE_ADDR 0x1000 /* has remote address/port (not used) */
253#define SS_CONN_REFUSED 0x2000 /* connection refused (ICMP_UNREACH etc) */
254
255
256/*
257 * Socket macros
258 */
259#define SOCK_CALLOC(sz) _sock_calloc (sz, __FILE__, __LINE__)
260#define SOCK_DEL_FD(fd) _sock_del_fd (fd, __FILE__, __LINE__)
261
262/*
263 * Prologue code starting most BSD-socket functions
264 */
265#define SOCK_PROLOGUE(socket, fmt, fd) \
266 do { \
267 SOCK_DEBUGF ((fmt, fd)); \
268 if (!socket) { \
269 if (_sock_dos_fd(fd)) { \
270 SOCK_DEBUGF ((", ENOTSOCK")); \
271 SOCK_ERRNO (ENOTSOCK); \
272 return (-1); \
273 } \
274 SOCK_DEBUGF ((", EBADF")); \
275 SOCK_ERRNO (EBADF); \
276 return (-1); \
277 } \
278 } while (0)
279
280#if defined(TARGET_IS_32BIT)
281 #define VERIFY_RW(ptr, len) \
282 do { \
283 if (0 && !valid_addr(ptr, len)) { \
284 SOCK_DEBUGF ((", EFAULT " \
285 "(buf %" ADDR_FMT ", len %d)", \
286 ADDR_CAST(ptr), (int)(len))); \
287 SOCK_ERRNO (EFAULT); \
288 return (-1); \
289 } \
290 } while (0)
291#else
292 #define VERIFY_RW(ptr, len) ((void)0)
293#endif
294
295/*
296 * Print error and exit at critical places. Should not be used
297 * in "production quality" code.
298 */
299#if defined(USE_BSD_FATAL)
300 #define SOCK_FATAL(arg) do { \
301 (*_printf) arg; \
302 fflush (stdout); \
303 /* _watt_fatal_error = 1; */ \
304 exit (-1); \
305 } while (0)
306#else
307 #define SOCK_FATAL(arg) ((void)0)
308#endif
309
310/*
311 * Only djgpp/DMC have (some of) the <fcntl.h> F_?? commands.
312 * For others, we define some dummy values.
313 */
314#define W32_FCNTL_BASE 100
315
316#ifndef F_DUPFD
317#define F_DUPFD (W32_FCNTL_BASE+0)
318#endif
319
320#ifndef F_GETFL
321#define F_GETFL (W32_FCNTL_BASE+1)
322#endif
323
324#ifndef F_SETFL
325#define F_SETFL (W32_FCNTL_BASE+2)
326#endif
327
328#ifndef F_GETFD
329#define F_GETFD (W32_FCNTL_BASE+3)
330#endif
331
332#ifndef F_SETFD
333#define F_SETFD (W32_FCNTL_BASE+4)
334#endif
335
336#ifndef F_GETLK
337#define F_GETLK (W32_FCNTL_BASE+5)
338#endif
339
340#ifndef F_SETLK
341#define F_SETLK (W32_FCNTL_BASE+6)
342#endif
343
344#ifndef F_SETLKW
345#define F_SETLKW (W32_FCNTL_BASE+7)
346#endif
347
348#ifndef F_GETOWN
349#define F_GETOWN (W32_FCNTL_BASE+8)
350#endif
351
352#ifndef F_SETOWN
353#define F_SETOWN (W32_FCNTL_BASE+9)
354#endif
355
356/*
357 * Setup trapping of signals and critical sections around loops.
358 */
359extern int _sock_sig_setup (void);
360extern int _sock_sig_restore (void);
361extern int _sock_sig_pending (void);
362extern int _sock_sig_epipe (const Socket *s);
363
364extern void _sock_crit_start (void);
365extern void _sock_crit_stop (void);
366
367/*
368 * Timing of "kernel" times for some socket calls.
369 */
370extern void _sock_start_timer (void);
371extern void _sock_stop_timer (void);
372
373/*
374 * Things for SOCK_PACKET sockets.
375 */
376extern unsigned sock_packet_transmit (Socket *sock, const void *buf,
377 unsigned len, const struct sockaddr *to,
378 int tolen);
379
380extern unsigned sock_packet_receive (Socket *sock, void *buf, unsigned len,
381 struct sockaddr *from, size_t *fromlen);
382
383extern unsigned sock_packet_rbused (Socket *sock);
384
385/*
386 * Allocation, `sk_list' stuff etc.
387 */
388extern void *_sock_calloc (size_t size, const char *file, unsigned line);
389extern Socket *_sock_del_fd (int sock, const char *file, unsigned line);
390extern Socket *_socklist_find (int s);
391extern BOOL _sock_dos_fd (int s);
392extern int _sock_half_open (const _tcp_Socket *tcp);
393extern int _sock_append (_tcp_Socket **tcp);
394extern int _sock_set_rcv_buf (sock_type *s, size_t len);
395extern void _sock_free_rcv_buf (sock_type *s);
396extern void _sock_set_syn_hook (int (*func)(_tcp_Socket **));
397extern BOOL _sock_set_promisc_rx_mode (void);
398extern BOOL _sock_set_mcast_rx_mode (void);
399extern BOOL _sock_set_normal_rx_mode (const Socket *_this);
400
401/*
402 * Interface naming stuff.
403 */
404extern const sock_type *__get_sock_from_s (int s, int proto);
405extern void __get_ifname (char *if_name);
406extern void __set_ifname (const char *if_name);
407extern int __scope_ascii_to_id (const char *str);
408extern int __scope_id_to_ascii (int scope);
409
410
411/*
412 * Check `sockaddr*' passed to bind()/connect().
413 */
414extern int _sock_chk_sockaddr (Socket *socket, const struct sockaddr *sa, int len);
415
416/*
417 * Handle UDP/TCP connect()/listen() calls.
418 */
419extern int _TCP_open (Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port);
420extern int _UDP_open (Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port);
421extern int _TCP_listen (Socket *socket, struct in_addr host, WORD loc_port);
422extern int _UDP_listen (Socket *socket, struct in_addr host, WORD port);
423
424extern int _TCP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port);
425extern int _UDP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port);
426extern int _TCP6_listen(Socket *socket, const void *host, WORD loc_port);
427extern int _UDP6_listen(Socket *socket, const void *host, WORD port);
428
429/*
430 * Check progress on a non-blocking connect().
431 */
432extern BOOL _sock_pending_connect (Socket *socket);
433
434#endif /* old __TURBOC__ */
435#endif /* _w32_SOCKET_H */
436
bsddbug.h
bsdname.h
chksum.h
gettod.h
if.h
if_arp.h
if_dl.h
if_packe.h
in.h
in_pcb.h
in_systm.h
in_var.h
tftp.h
socket.h
inet.h
ioctl.h
ip4_in.h
ip4_out.h
ip6.h
ip6_in.h
ip6_out.h
ip.h
ip_icmp.h
ip_var.h
language.h
misc.h
misc_str.h
nameser.h
netaddr.h
netdb.h
tcp.h
pcarp.h
pcbuf.h
pcconfig.h
pcdbug.h
pcicmp.h
pcigmp.h
pcpkt.h
pcqueue.h
pcrecv.h
pcsed.h
pcstat.h
pctcp.h
printk.h
resolv.h
route.h
sock_ini.h
_UDP6_open
int _UDP6_open(Socket *socket, const void *host, WORD loc_port, WORD rem_port)
Definition: socket.c:2157
_TCP6_open
int _TCP6_open(Socket *socket, const void *host, WORD loc_port, WORD rem_port)
Definition: socket.c:2058
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
_sock_chk_sockaddr
int _sock_chk_sockaddr(Socket *socket, const struct sockaddr *sa, int len)
Check ‘sockaddr*’ passed to bind/connect.
Definition: socket.c:819
_sock_del_fd
Socket * _sock_del_fd(int sock, const char *file, unsigned line)
Delete the socket from ‘inuse’ array and all memory associated with it.
Definition: socket.c:681
_sock_set_rcv_buf
int _sock_set_rcv_buf(sock_type *s, size_t len)
Setup a bigger receive buffer, the default in Wattcp is only 2k.
Definition: socket.c:232
_sock_free_rcv_buf
void _sock_free_rcv_buf(sock_type *s)
Free receive buffer associated with udp/tcp sockets.
Definition: socket.c:247
_sock_calloc
void * _sock_calloc(size_t size, const char *file, unsigned line)
Memory allocation; print some info if allocation fails.
Definition: socket.c:83
_sock_append
int _sock_append(_tcp_Socket **tcp)
Called from tcp_fsm.c / tcp_listen_state() (via _bsd_socket_hook) to append a new connection to the l...
Definition: accept.c:426
__get_sock_from_s
const sock_type * __get_sock_from_s(int s, int proto)
Hack function if user application needs to use Wattcp core functions for BSD sockets.
Definition: socket.c:288
_sock_pending_connect
BOOL _sock_pending_connect(Socket *socket)
Check progress on a non-blocking SOCK_STREAM socket that has SS_ISCONNECTING set.
Definition: socket.c:2186
sock_packet_receive
unsigned sock_packet_receive(Socket *sock, void *buf, unsigned len, struct sockaddr *from, size_t *fromlen)
Called from receive.c for AF_PACKET sockets.
Definition: socket.c:582
_sock_dos_fd
BOOL _sock_dos_fd(int s)
_sock_dos_fd - Return TRUE if ‘s’ is a valid DOS/Win32 handle.
Definition: socket.c:202
_UDP6_listen
int _UDP6_listen(Socket *socket, const void *host, WORD port)
Definition: socket.c:2171
_sock_crit_start
void _sock_crit_start(void)
Start a critical region.
Definition: socket.c:1266
_sock_half_open
int _sock_half_open(const _tcp_Socket *tcp)
_sock_half_open - Return true if peer closed his side.
Definition: socket.c:2238
_sock_crit_stop
void _sock_crit_stop(void)
Mark the end of a critical region.
Definition: socket.c:1276
_UDP_open
int _UDP_open(Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
Open and listen routines for SOCK_DGRAM at the socket-level.
Definition: socket.c:1942
_TCP6_listen
int _TCP6_listen(Socket *socket, const void *host, WORD loc_port)
Definition: socket.c:2148
_TCP_open
int _TCP_open(Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port)
Open and listen routines for SOCK_STREAM at the socket-level.
Definition: socket.c:2015
_raw6_Socket
Definition: wattcp.h:679
_raw_Socket
Definition: wattcp.h:665
Socket
Definition: socket.h:158
in_addr
Definition: in.h:143
ip_opts
Definition: in.h:270
pkt_ringbuf
FIFO style ring-buffer.
Definition: pcqueue.h:81
recv_buf
Definition: pcrecv.h:16
sock_packet_buf
Definition: socket.h:148
sock_packet_pool
Definition: socket.h:153
sockaddr_in
Definition: in.h:224
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
tcp_Socket
Definition: wattcp.h:584
syslog.h
tcp_time.h
tcpip.h
timer.h
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.
wdpmi.h


Watt-32 tcp/ip: E:/WATT/src/tftp.h Source File

  • src
tftp.h
Go to the documentation of this file.
1
24#ifndef _w32_TFTP_H
25#define _w32_TFTP_H
26
27extern int tftp_init (void);
28extern int tftp_boot_load (void);
29
30extern char *tftp_set_server (const char *name, int len);
31extern char *tftp_set_boot_fname (const char *name, int len);
32
33#endif
tftp_set_server
char * tftp_set_server(const char *name, int len)
Set the name of TFTP server.
Definition: tftp.c:381
tftp_set_boot_fname
char * tftp_set_boot_fname(const char *name, int len)
Set the name of remote/local file to load from TFTP server.
Definition: tftp.c:392
tftp_init
int tftp_init(void)
Initialize config-hook for TFTP protocol.
Definition: tftp.c:577
tftp_boot_load
int tftp_boot_load(void)
Load the BOOT-file from TFTP server.
Definition: tftp.c:474


Watt-32 tcp/ip: E:/WATT/src/stream.c Source File

  • src
stream.c
Go to the documentation of this file.
1
37#include "socket.h"
38
39#if defined(USE_BSD_API)
40
41/*
42 * How does this fit in with djgpp's FSextensions ?
43 * Does it support fdopen() ?
44 */
45
46int sock_fgets (char *buf, int max, FILE *stream)
47{
48 int rc, s = fileno (stream);
49 Socket *sock = _socklist_find (s);
50 sock_type *sk = NULL;
51
52 SOCK_PROLOGUE (sock, "\nsock_fgets:%d", s);
53
54 if (sock->tcp_sock)
55 sk = (sock_type*) sock->tcp_sock;
56 else if (sock->udp_sock)
57 sk = (sock_type*) sock->udp_sock;
58
59 rc = sk ? sock_gets (sk, (BYTE*)buf, max) : -1;
60
61 SOCK_DEBUGF ((", rc %d", rc));
62 return (rc);
63}
64
65int sock_fputs (const char *text, FILE *stream)
66{
67 int s = fileno (stream);
68 Socket *sock = _socklist_find (s);
69
70 SOCK_PROLOGUE (sock, "\nsock_fputs:%d", s);
71 return write_s (s, text, strlen(text));
72}
73
74#endif /* USE_BSD_API */
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
Socket
Definition: socket.h:158
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/inc/rpc/svc.h Source File

  • inc
  • rpc
svc.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * svc.h, Server-side remote procedure call interface.
36 *
37 * Copyright (C) 1984, Sun Microsystems, Inc.
38 */
39
40#ifndef __RPC_SVC_H
41#define __RPC_SVC_H
42
43#ifndef __SYS_W32API_H
44#include <sys/w32api.h>
45#endif
46
47#ifndef __SYS_WTYPES_H
48#include <sys/wtypes.h>
49#endif
50
51#ifndef __SYS_CDEFS_H
52#include <sys/cdefs.h>
53#endif
54
55#include <rpc/auth.h>
56
57/*
58 * This interface must manage two items concerning remote procedure calling:
59 *
60 * 1) An arbitrary number of transport connections upon which rpc requests
61 * are received. The two most notable transports are TCP and UDP; they are
62 * created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
63 * they in turn call xprt_register and xprt_unregister.
64 *
65 * 2) An arbitrary number of locally registered services. Services are
66 * described by the following four data: program number, version number,
67 * "service dispatch" function, a transport handle, and a boolean that
68 * indicates whether or not the exported program should be registered with a
69 * local binder service; if true the program's number and version and the
70 * port number from the transport handle are registered with the binder.
71 * These data are registered with the rpc svc system via svc_register.
72 *
73 * A service's dispatch function is called whenever an rpc request comes in
74 * on a transport. The request's program and version numbers must match
75 * those of the registered service. The dispatch function is passed two
76 * parameters, struct svc_req * and SVCXPRT *, defined below.
77 */
78
79enum xprt_stat {
80 XPRT_DIED,
81 XPRT_MOREREQS,
82 XPRT_IDLE
83 };
84
85/*
86 * Server side transport handle
87 */
88typedef struct {
89 int xp_sock;
90 u_short xp_port; /* associated port number */
91 struct xp_ops {
92 bool_t (*xp_recv)(); /* receive incoming requests */
93 enum xprt_stat (*xp_stat)(); /* get transport status */
94 bool_t (*xp_getargs)(); /* get arguments */
95 bool_t (*xp_reply)(); /* send reply */
96 bool_t (*xp_freeargs)(); /* free mem allocated for args */
97 void (*xp_destroy)(); /* destroy this struct */
98 } *xp_ops;
99 int xp_addrlen; /* length of remote address */
100 struct sockaddr_in xp_raddr; /* remote address */
101 struct opaque_auth xp_verf; /* raw response verifier */
102 caddr_t xp_p1; /* private */
103 caddr_t xp_p2; /* private */
104 } SVCXPRT;
105
106/*
107 * Approved way of getting address of caller
108 */
109#define svc_getcaller(x) (&(x)->xp_raddr)
110
111/*
112 * Operations defined on an SVCXPRT handle
113 *
114 * SVCXPRT *xprt;
115 * struct rpc_msg *msg;
116 * xdrproc_t xargs;
117 * caddr_t argsp;
118 */
119#define SVC_RECV(xprt, msg) \
120 (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
121
122#define svc_recv(xprt, msg) \
123 (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
124
125#define SVC_STAT(xprt) \
126 (*(xprt)->xp_ops->xp_stat)(xprt)
127
128#define svc_stat(xprt) \
129 (*(xprt)->xp_ops->xp_stat)(xprt)
130
131#define SVC_GETARGS(xprt, xargs, argsp) \
132 (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
133
134#define svc_getargs(xprt, xargs, argsp) \
135 (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
136
137#define SVC_REPLY(xprt, msg) \
138 (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
139
140#define svc_reply(xprt, msg) \
141 (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
142
143#define SVC_FREEARGS(xprt, xargs, argsp) \
144 (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
145
146#define svc_freeargs(xprt, xargs, argsp) \
147 (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
148
149#define SVC_DESTROY(xprt) \
150 (*(xprt)->xp_ops->xp_destroy)(xprt)
151
152#define svc_destroy(xprt) \
153 (*(xprt)->xp_ops->xp_destroy)(xprt)
154
155
156/*
157 * Service request
158 */
159struct svc_req {
160 u_long rq_prog; /* service program number */
161 u_long rq_vers; /* service protocol version */
162 u_long rq_proc; /* the desired procedure */
163 struct opaque_auth rq_cred; /* raw creds from the wire */
164 caddr_t rq_clntcred; /* read only cooked cred */
165 SVCXPRT *rq_xprt; /* associated transport */
166 };
167
168__BEGIN_DECLS
169
170/*
171 * Service registration
172 *
173 * svc_register(xprt, prog, vers, dispatch, protocol)
174 * SVCXPRT *xprt;
175 * u_long prog;
176 * u_long vers;
177 * void (*dispatch)();
178 * int protocol; // like TCP or UDP, zero means do not register
179 */
180W32_FUNC bool_t W32_CALL svc_register (SVCXPRT *, u_long, u_long, void (*)(), int);
181
182/*
183 * Service un-registration
184 *
185 * svc_unregister(prog, vers)
186 * u_long prog;
187 * u_long vers;
188 */
189W32_FUNC void W32_CALL svc_unregister (u_long, u_long);
190
191/*
192 * Transport registration.
193 *
194 * xprt_register(xprt)
195 * SVCXPRT *xprt;
196 */
197W32_FUNC void W32_CALL xprt_register (SVCXPRT *);
198
199/*
200 * Transport un-register
201 *
202 * xprt_unregister(xprt)
203 * SVCXPRT *xprt;
204 */
205W32_FUNC void W32_CALL xprt_unregister (SVCXPRT *);
206
207
208
209/*
210 * When the service routine is called, it must first check to see if it
211 * knows about the procedure; if not, it should call svcerr_noproc
212 * and return. If so, it should deserialize its arguments via
213 * SVC_GETARGS (defined above). If the deserialization does not work,
214 * svcerr_decode should be called followed by a return. Successful
215 * decoding of the arguments should be followed the execution of the
216 * procedure's code and a call to svc_sendreply.
217 *
218 * Also, if the service refuses to execute the procedure due to too-
219 * weak authentication parameters, svcerr_weakauth should be called.
220 * Note: do not confuse access-control failure with weak authentication!
221 *
222 * NB: In pure implementations of rpc, the caller always waits for a reply
223 * msg. This message is sent when svc_sendreply is called.
224 * Therefore pure service implementations should always call
225 * svc_sendreply even if the function logically returns void; use
226 * xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows
227 * for the abuse of pure rpc via batched calling or pipelining. In the
228 * case of a batched call, svc_sendreply should NOT be called since
229 * this would send a return message, which is what batching tries to avoid.
230 * It is the service/protocol writer's responsibility to know which calls are
231 * batched and which are not. Warning: responding to batch calls may
232 * deadlock the caller and server processes!
233 */
234
235W32_FUNC bool_t W32_CALL svc_sendreply (SVCXPRT *, xdrproc_t, char *);
236W32_FUNC void W32_CALL svcerr_decode (SVCXPRT *);
237W32_FUNC void W32_CALL svcerr_weakauth (SVCXPRT *);
238W32_FUNC void W32_CALL svcerr_noproc (SVCXPRT *);
239W32_FUNC void W32_CALL svcerr_progvers (SVCXPRT *, u_long, u_long);
240W32_FUNC void W32_CALL svcerr_auth (SVCXPRT *, enum auth_stat);
241W32_FUNC void W32_CALL svcerr_noprog (SVCXPRT *);
242W32_FUNC void W32_CALL svcerr_systemerr(SVCXPRT *);
243
244/*
245 * Lowest level dispatching -OR- who owns this process anyway.
246 * Somebody has to wait for incoming requests and then call the correct
247 * service routine. The routine svc_run does infinite waiting; i.e.,
248 * svc_run never returns.
249 * Since another (co-existant) package may wish to selectively wait for
250 * incoming calls or other events outside of the rpc architecture, the
251 * routine svc_getreq is provided. It must be passed readfds, the
252 * "in-place" results of a select system call (see select, section 2).
253 */
254
255/*
256 * Global keeper of rpc service descriptors in use
257 * dynamic; must be inspected before each call to select
258 */
259#ifdef FD_SETSIZE
260 W32_FUNC void svc_getreqset (fd_set *);
261 W32_DATA fd_set svc_fdset;
262 #define svc_fds svc_fdset.fds_bits[0] /* compatibility */
263#else
264 W32_DATA int svc_fds;
265#endif
266
267/*
268 * a small program implemented by the svc_rpc implementation itself;
269 * also see clnt.h for protocol numbers.
270 */
271W32_FUNC void W32_CALL rpctest_service();
272W32_FUNC void W32_CALL svc_getreq (int);
273W32_FUNC void W32_CALL svc_run (void);
274
275/*
276 * Socket to use on svcxxx_create call to get default socket
277 */
278#define RPC_ANYSOCK -1
279
280/*
281 * These are the existing service side transport implementations
282 */
283
284/*
285 * Memory based rpc for testing and timing.
286 */
287W32_FUNC SVCXPRT * W32_CALL svcraw_create (void);
288
289
290/*
291 * Udp based rpc.
292 */
293W32_FUNC SVCXPRT * W32_CALL svcudp_create (int);
294W32_FUNC SVCXPRT * W32_CALL svcudp_bufcreate (int, u_int, u_int);
295
296/*
297 * Tcp based rpc.
298 */
299W32_FUNC SVCXPRT * W32_CALL svctcp_create (int, u_int, u_int);
300
301__END_DECLS
302
303#endif
auth.h
cdefs.h
SVCXPRT::xp_ops
Definition: svc.h:91
SVCXPRT
Definition: svc.h:88
fd_set
Definition: wtypes.h:256
opaque_auth
Definition: auth.h:99
sockaddr_in
Definition: in.h:224
svc_req
Definition: svc.h:159
w32api.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/rpc/svc_auth.h Source File

  • inc
  • rpc
svc_auth.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * svc_auth.h, Service side of rpc authentication.
36 *
37 * Copyright (C) 1984, Sun Microsystems, Inc.
38 */
39
40#ifndef __RPC_SVC_AUTH_H
41#define __RPC_SVC_AUTH_H
42
43#include <rpc/rpc_msg.h>
44#include <rpc/svc.h>
45
46/*
47 * Server side authenticator
48 */
49__BEGIN_DECLS
50
51extern enum auth_stat _authenticate (struct svc_req *, struct rpc_msg *);
52
53__END_DECLS
54
55#endif
rpc_msg.h
rpc_msg
Definition: rpc_msg.h:156
svc_req
Definition: svc.h:159
svc.h


Watt-32 tcp/ip: E:/WATT/inc/sys/swap.h Source File

  • inc
  • sys
swap.h
Go to the documentation of this file.
1
6#ifndef __SYS_SWAP_BYTES_H
7#define __SYS_SWAP_BYTES_H
8
9#ifndef __SYS_W32API_H
10#include <sys/w32api.h>
11#endif
12
13#ifndef __SYS_CDEFS_H
14#include <sys/cdefs.h>
15#endif
16
17#ifndef __NETINET_IN_H
18#include <netinet/in.h>
19#endif
20
21#ifndef __SYS_WHIDE_H
22#include <sys/whide.h> /* hide publics inside W32_NAMESPACE() */
23#endif
24
25#if defined(__dj_include_netinet_in_h_)
26#error "You are using the wrong version of <netinet/in.h>. Ref. Note in point 9 of the INSTALL file"
27#endif
28
29__BEGIN_DECLS
30
31#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
32 /*
33 * Provide some real versions too
34 */
35 W32_FUNC unsigned short W32_CALL ntohs (unsigned short);
36 W32_FUNC unsigned short W32_CALL htons (unsigned short);
37 W32_FUNC unsigned long W32_CALL ntohl (unsigned long);
38 W32_FUNC unsigned long W32_CALL htonl (unsigned long);
39#endif
40
41W32_FUNC unsigned long W32_CDECL _w32_intel (unsigned long x);
42W32_FUNC unsigned short W32_CDECL _w32_intel16 (unsigned short x);
43
44#undef ntohs
45#undef htons
46#undef ntohl
47#undef htonl
48#define ntohs(x) intel16(x)
49#define htons(x) intel16(x)
50#define ntohl(x) intel(x)
51#define htonl(x) intel(x)
52
53#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
54 /*
55 * The below AT&T syntax breaks any code compiled with 'gcc -masm=intel'
56 * Ref: https://github.com/gvanem/Watt-32/issues/61
57 */
58 #define intel(x) __builtin_bswap32 (x)
59 #define intel16(x) __builtin_bswap16 (x)
60 #define W32_GCC_USING_BSWAP /* for 'src/oldstuff.c' */
61
62#elif defined(__GNUC__) && defined(__i386__) && !defined(__NO_INLINE__) /* gcc -O0 on 'x86' */
63 #define intel(x) __NtoHL(x)
64 #define intel16(x) __NtoHS(x)
65
66 /*
67 * Ripped (and adapted) from <linux/include/asm-386/byteorder.h>
68 */
69 /*@unused@*/ W32_GCC_INLINE unsigned long __NtoHL (unsigned long x)
70 {
71 __asm__ __volatile (
72 "xchgb %b0, %h0\n\t" /* swap lower bytes */
73 "rorl $16, %0\n\t" /* swap words */
74 "xchgb %b0, %h0" /* swap higher bytes */
75 : "=q" (x) : "0" (x));
76 return (x);
77 }
78
79 /*@unused@*/ W32_GCC_INLINE unsigned short __NtoHS (unsigned short x)
80 {
81 __asm__ __volatile__ (
82 "xchgb %b0, %h0" /* swap bytes */
83 : "=q" (x) : "0" (x));
84 return (x);
85 }
86
87#elif defined(__GNUC__) && defined(__x86_64__) && !defined(__NO_INLINE__) /* gcc -O0 on 'x64' */
88 #define intel(x) __NtoHL(x)
89 #define intel16(x) __NtoHS(x)
90
91 /*@unused@*/ W32_GCC_INLINE unsigned short __NtoHS (unsigned short x)
92 {
93 x = ((x & 0x00FF) << 8) | ((x & 0xFF00) >> 8);
94 return (x);
95 }
96
97 /*@unused@*/ W32_GCC_INLINE unsigned long __NtoHL (unsigned long x)
98 {
99 x = ((x & 0x000000FF) << 24) |
100 ((x & 0x0000FF00) << 8) |
101 ((x & 0x00FF0000) >> 8) |
102 ((x & 0xFF000000) >> 24);
103 return (x);
104 }
105
106#elif defined(__POCC__) && 0 && !defined(_M_X64) /* PellesC 32-bit */
107 #define intel(x) __NtoHL(x)
108 #define intel16(x) __NtoHS(x)
109
110 __declspec(naked) static unsigned short __fastcall __NtoHS (unsigned short x) /* MSVC form */
111 {
112 __asm xchg cl, ch /* 'x' is in ecx */
113 __asm movzx eax, cx
114 __asm ret
115 }
116
117 __declspec(naked) static unsigned long __fastcall __NtoHL (unsigned long x) /* MSVC form */
118 {
119 __asm xchg cl, ch /* 'x' is in ecx */
120 __asm ror ecx, 16
121 __asm xchg cl, ch
122 __asm mov eax, ecx
123 __asm ret
124 }
125
126#elif (defined(_MSC_VER) && (_MSC_VER >= 1200)) && /* MSVC 6+ */ \
127 !defined(__POCC__) && /* "pocc -Ze" sets _MSC_VER */ \
128 !defined(_M_X64) && /* Not for 64-bit compilers */ \
129 !defined(__clang__) /* Disable this for Clang until problem spotted */
130
131 #define intel(x) __NtoHL(x)
132 #define intel16(x) __NtoHS(x)
133
134 /*
135 * Clang has problems with __fastcall, so use __cdecl.
136 */
137 #if defined(__clang__)
138 __declspec(naked) static unsigned short __cdecl __NtoHS (unsigned short x)
139 {
140 __asm mov ax, [esp+4]
141 __asm xchg al, ah
142 __asm ret
143 }
144
145 __declspec(naked) static unsigned long __cdecl __NtoHL (unsigned long x)
146 {
147 __asm mov eax, [esp+4]
148 __asm xchg al, ah
149 __asm ror eax, 16
150 __asm xchg al, ah
151 __asm ret
152 }
153
154 #else
155 __declspec(naked) static unsigned short __fastcall __NtoHS (unsigned short x)
156 {
157 __asm xchg cl, ch /* 'x' is in ecx */
158 __asm movzx eax, cx
159 __asm ret
160 }
161
162 __declspec(naked) static unsigned long __fastcall __NtoHL (unsigned long x)
163 {
164 __asm xchg cl, ch /* 'x' is in ecx */
165 __asm ror ecx, 16
166 __asm xchg cl, ch
167 __asm mov eax, ecx
168 __asm ret
169 }
170 #endif
171
172#elif defined(__WATCOMC__) && defined(__386__) /* Watcom 32-bit */
173 #define intel(x) __NtoHL(x)
174 #define intel16(x) __NtoHS(x)
175
176 extern unsigned long __NtoHL (unsigned long x);
177 #pragma aux __NtoHL = \
178 "xchg al, ah" \
179 "ror eax, 16" \
180 "xchg al, ah" \
181 __parm [__eax] \
182 __modify [__eax];
183
184 extern unsigned short __NtoHS (unsigned short x);
185 #pragma aux __NtoHS = \
186 "xchg al, ah" \
187 __parm [__ax] \
188 __modify [__ax];
189
190#elif defined(__WATCOMC__) && defined(__I86__) /* Watcom 16-bit */
191 #define intel(x) __NtoHL(x)
192 #define intel16(x) __NtoHS(x)
193
194 extern unsigned long __NtoHL (unsigned long x);
195 #pragma aux __NtoHL = \
196 "xchg al, dh" \
197 "xchg ah, dl" \
198 __parm [__dx __ax] \
199 __modify [__dx __ax];
200
201 extern unsigned short __NtoHS (unsigned short x);
202 #pragma aux __NtoHS = \
203 "xchg al, ah" \
204 __parm [__ax] \
205 __modify [__ax];
206
207#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x0700)
208 /*
209 * The LLVM based bcc32c compiler for Win32 have no
210 * pseudo-registers (_EAX) and inline assembly.
211 */
212 #if !defined(WATT32_NO_NAMESPACE)
213 #define intel W32_NAMESPACE (intel)
214 #define intel16 W32_NAMESPACE (intel16)
215 #endif
216
217 #define WATT32_NO_INLINE_INTEL
218
219 W32_FUNC unsigned long W32_CDECL intel (unsigned long x);
220 W32_FUNC unsigned short W32_CDECL intel16 (unsigned short x);
221
222#elif (defined(__BORLANDC__) && defined(__FLAT__)) || /* bcc32 (flat/win32) */ \
223 (defined(__DMC__) && (__INTSIZE==4)) /* dmc -mx */
224
225 /* From Borland's <dos.h>:
226 * The prototype for __emit__ has been removed from DOS.H. __emit__ is
227 * still supported, but is now automatically recognized by the compiler ...
228 */
229 #if !(defined(__BORLANDC__) && defined(WIN32))
230 #include <dos.h>
231 #endif
232
233 #define intel(x) __NtoHL(x)
234 #define intel16(x) __NtoHS(x)
235
236 #define __NtoHS(x) (_AX = x, \
237 __emit__(0x86, 0xC4), /* xchg ah, al */ \
238 _AX)
239
240 #define __NtoHL(x) (_EAX = x, \
241 __emit__(0x86, 0xC4), /* xchg ah, al */ \
242 __emit__(0xC1, 0xC8, 0x10), /* ror eax, 16 */ \
243 __emit__(0x86, 0xC4), /* xchg ah, al */ \
244 _EAX)
245
246#else /* no inlining possible (or worth the effort) */
247
248 #if !defined(WATT32_NO_NAMESPACE)
249 #define intel W32_NAMESPACE (intel)
250 #define intel16 W32_NAMESPACE (intel16)
251 #endif
252
253 #define WATT32_NO_INLINE_INTEL
254
255 W32_FUNC unsigned long W32_CDECL intel (unsigned long x);
256 W32_FUNC unsigned short W32_CDECL intel16 (unsigned short x);
257#endif
258
259__END_DECLS
260
261#endif /* __SYS_SWAP_BYTES_H */
cdefs.h
in.h
ah
Definition: ah.h:45
esp
Definition: esp.h:44
_w32_intel16
W32_FUNC unsigned short W32_CDECL _w32_intel16(unsigned short x)
Convert 16-bit big-endian (network order) to intel (host order) format.
Definition: misc.c:183
_w32_intel
W32_FUNC unsigned long W32_CDECL _w32_intel(unsigned long x)
Convert 32-bit big-endian (network order) to intel (host order) format.
Definition: misc.c:171
w32api.h
whide.h


Watt-32 tcp/ip: E:/WATT/src/swsvpkt.h Source File

  • src
swsvpkt.h
Go to the documentation of this file.
1
5#ifndef _w32_SWSVPKT_H
6#define _w32_SWSVPKT_H
7
8#include <winioctl.h>
9
10/* Win32 accessible device. Adapters have 0..31 appended */
11#define IOCTL_DEVICE "SwsVpkt"
12
13/* Device type */
14#define IOCTL_TYPE 0xA50C /* Microsoft uses 0 - 0x7FFF, OEMs use 0x8000 - 0xFFFF */
15#define IOCTL_FCMIN 0x900 /* Microsoft uses function codes 0-0x7FF, OEM's use 0x800 - 0xFFF */
16
17#define IOCTL_GETMACADDR \
18 CTL_CODE (IOCTL_TYPE, (IOCTL_FCMIN + 0), METHOD_BUFFERED, FILE_READ_ACCESS)
19 /* lpvOutBuffer -> 6 BYTE MAC address */
20
21#define IOCTL_SETMULTICASTLIST \
22 CTL_CODE (IOCTL_TYPE, (IOCTL_FCMIN + 1), METHOD_BUFFERED, FILE_WRITE_ACCESS)
23 /* lpvInBuffer -> Multicast list */
24
25#define IOCTL_SETPROMISCUITY \
26 CTL_CODE (IOCTL_TYPE, (IOCTL_FCMIN + 2), METHOD_BUFFERED, FILE_WRITE_ACCESS)
27 /* lpvInBuffer -> BYTE, !0= enable promiscuous mode */
28
29#define IOCTL_WRITE_SCATTER \
30 CTL_CODE (IOCTL_TYPE, (IOCTL_FCMIN + 3), METHOD_OUT_DIRECT, FILE_WRITE_ACCESS)
31 /* lpvInBuffer -> array of IOCTL_BUFFER's */
32
33typedef struct IOCTL_BUFFER {
34 void *pv;
35 DWORD dwLen;
36 } IOCTL_BUFFER;
37
38#define IOCTL_GETINFO \
39 CTL_CODE (IOCTL_TYPE, (IOCTL_FCMIN + 4), METHOD_BUFFERED, FILE_READ_ACCESS)
40 /* lpvOutBuffer -> IOCTL_INFO */
41
42typedef struct IOCTL_INFO {
43 BOOL bPowerOn;
44 BOOL bMediaDisconnected;
45 BOOL bWan; /* Adapter is a WAN */
46 BOOL bWanDown; /* WAN is not connected */
47 } IOCTL_INFO;
48
49#define IOCTL_GETMULTICASTLIST \
50 CTL_CODE (IOCTL_TYPE, (IOCTL_FCMIN + 5), METHOD_BUFFERED, FILE_READ_ACCESS)
51 /* lpvOutBuffer -> Multicast list */
52
53#define IOCTL_GETDESC \
54 CTL_CODE (IOCTL_TYPE, (IOCTL_FCMIN + 6), METHOD_BUFFERED, FILE_READ_ACCESS)
55 /* lpvOutBuffer -> ASCIIZ string */
56
57/* Get a ptr to the start of a struct given a ptr to a field within it
58 */
59#define SWS_CONTAINER(ptr, type, field) \
60 (type*) ((char*)(ptr) - offsetof(type, field))
61
62
63/* Receive buffer
64 */
65struct SRxBuffer {
66 OVERLAPPED overlap;
67#define OVL2RXBUF(p) SWS_CONTAINER (p, struct SRxBuffer, overlap)
68 unsigned char buffer [1514];
69 };
70
71struct SwsVpktUsr;
72
73/* Rx frame callback */
74typedef void SwsVpktRxFn (
75 struct SwsVpktUsr *, /* IN: Handle */
76 const void *, /* IN: Frame data */
77 unsigned); /* IN: Frame length */
78
79/* Interface instance
80 */
81struct SwsVpktUsr {
82 HANDLE hDevice; /* Packet protocol driver */
83 OVERLAPPED txOverlap; /* For write requests */
84 HANDLE hWorker; /* Worker thread handle */
85 int iWorkerExit; /* Worker thread is exiting */
86 SwsVpktRxFn *pfnRx; /* Rx frame callback */
87 unsigned uRxBufs;
88 struct SRxBuffer rxBuffer[1]; /* VLA of Rx buffers */
89 };
90
91struct SwsVpktOpenInfo {
92 SwsVpktRxFn *pfnRx; /* Rx frame callback */
93 unsigned uRxBufs; /* No. receive buffers */
94 };
95
96struct SwsVpktAdapterState {
97 unsigned int isPowerOn : 1;
98 unsigned int isMediaConnected : 1;
99 unsigned int isWan : 1;
100 unsigned int isWanDown : 1;
101 };
102
103extern struct SwsVpktUsr *SwsVpktOpen ( /* retuns NULL on error */
104 const char *, /* IN: Adapter name; \\.\SwsVpkt0..31 */
105 const struct SwsVpktOpenInfo *); /* IN: Open info */
106
107extern BOOL SwsVpktClose (struct SwsVpktUsr *usr);
108
109extern BOOL SwsVpktGetAdapterState (const struct SwsVpktUsr *usr,
110 struct SwsVpktAdapterState *state);
111
112extern BOOL SwsVpktGetStatistics (const struct SwsVpktUsr *usr,
113 struct PktStats *stats);
114
115extern UINT SwsVpktSend (struct SwsVpktUsr *usr,
116 const void *buf,
117 UINT buf_len);
118
119extern BOOL SwsVpktGetMacAddress (const struct SwsVpktUsr *usr,
120 mac_address *addr);
121
122extern BOOL SwsVpktGetDescription (const struct SwsVpktUsr *usr,
123 char *descr, size_t descr_len);
124
125extern BOOL SwsVpktGetNDISversion (const struct SwsVpktUsr *usr,
126 DWORD *ver);
127
128extern const char *SwsVpktGetDriverVersion (void);
129
130extern BOOL SwsVpktDeviceRequest2 (HANDLE hDevice,
131 DWORD dwIoControlCode,
132 const void *lpInBuffer,
133 DWORD nInBufferSize,
134 void *lpOutBuffer,
135 DWORD nOutBufferSize,
136 DWORD *lpBytesReturned,
137 const char *file,
138 unsigned line);
139
140#define SwsVpktDeviceRequest(dev, code, in_buf, in_size, out_buf, out_size, bytes_ret) \
141 SwsVpktDeviceRequest2 (dev, code, in_buf, in_size, out_buf, out_size, bytes_ret, \
142 __FILE__, __LINE__)
143
144#endif
145
IOCTL_BUFFER
Definition: swsvpkt.h:33
IOCTL_INFO
Definition: swsvpkt.h:42
PktStats
Definition: tcp.h:806
SRxBuffer
Definition: swsvpkt.h:65
SwsVpktAdapterState
Definition: swsvpkt.h:96
SwsVpktOpenInfo
Definition: swsvpkt.h:91
SwsVpktUsr
Definition: swsvpkt.h:81


Watt-32 tcp/ip: E:/WATT/inc/sys/poll.h Source File

  • inc
  • sys
poll.h
Go to the documentation of this file.
1
4#ifndef __SYS_POLL_H
5#define __SYS_POLL_H
6
7#include <sys/cdefs.h>
8#include <sys/w32api.h> /* W32_FUNC, W32_DATA etc. */
9
10#define POLLIN 0x0001
11#define POLLPRI 0x0002 /* not used */
12#define POLLOUT 0x0004
13#define POLLERR 0x0008
14#define POLLHUP 0x0010
15#define POLLNVAL 0x0020
16
17struct pollfd {
18 int fd;
19 int events; /* in param: what to poll for */
20 int revents; /* out param: what events occured */
21 };
22
23__BEGIN_DECLS
24
25W32_FUNC int W32_CALL poll (struct pollfd *p, int num, int timeout);
26
27__END_DECLS
28
29#endif
cdefs.h
pollfd
Definition: poll.h:17
w32api.h


Watt-32 tcp/ip: E:/WATT/inc/sys/syslog.h Source File

  • inc
  • sys
syslog.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1988, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __SYS_SYSLOG_H
39#define __SYS_SYSLOG_H
40
41#include <stdarg.h>
42
43#ifndef __SYS_W32API_H
44#include <sys/w32api.h>
45#endif
46
47#ifndef __SYS_CDEFS_H
48#include <sys/cdefs.h>
49#endif
50
51#ifndef _PATH_LOG
52#define _PATH_LOG "/var/run/log"
53#endif
54
55#ifndef _PATH_OLDLOG
56#define _PATH_OLDLOG "/dev/log" /* backward compatibility */
57#endif
58
59/*
60 * priorities/facilities are encoded into a single 32-bit quantity, where the
61 * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
62 * (0-big number). Both the priorities and the facilities map roughly
63 * one-to-one to strings in the syslogd(8) source code. This mapping is
64 * included in this file.
65 *
66 * priorities (these are ordered)
67 */
68#define LOG_EMERG 0 /* system is unusable */
69#define LOG_ALERT 1 /* action must be taken immediately */
70#define LOG_CRIT 2 /* critical conditions */
71#define LOG_ERR 3 /* error conditions */
72#define LOG_WARNING 4 /* warning conditions */
73#define LOG_NOTICE 5 /* normal but significant condition */
74#define LOG_INFO 6 /* informational */
75#define LOG_DEBUG 7 /* debug-level messages */
76
77#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
78 /* extract priority */
79#define LOG_PRI(p) ((p) & LOG_PRIMASK)
80#define LOG_MAKEPRI(fac, pri) ((fac) | (pri))
81
82#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
83 /* mark "facility" */
84#define INTERNAL_MARK LOG_MAKEPRI ((LOG_NFACILITIES << 3), 0)
85
86typedef struct _code {
87 unsigned long c_val;
88 const char *c_name;
89 } CODE;
90
91W32_DATA CODE prioritynames [13];
92
93/* facility codes */
94#define LOG_KERN (0<<3) /* kernel messages */
95#define LOG_USER (1<<3) /* random user-level messages */
96#define LOG_MAIL (2<<3) /* mail system */
97#define LOG_DAEMON (3<<3) /* system daemons */
98#define LOG_AUTH (4<<3) /* security/authorization messages */
99#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
100#define LOG_LPR (6<<3) /* line printer subsystem */
101#define LOG_NEWS (7<<3) /* network news subsystem */
102#define LOG_UUCP (8<<3) /* UUCP subsystem */
103#define LOG_CRON (9<<3) /* clock daemon */
104#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
105 /* Facility #10 clashes in DEC UNIX, where */
106 /* it's defined as LOG_MEGASAFE for AdvFS */
107 /* event logging. */
108#define LOG_FTP (11<<3) /* ftp daemon */
109#define LOG_NTP (12<<3) /* NTP subsystem */
110
111 /* other codes through 15 reserved for system use */
112#define LOG_LOCAL0 (16<<3) /* reserved for local use */
113#define LOG_LOCAL1 (17<<3) /* reserved for local use */
114#define LOG_LOCAL2 (18<<3) /* reserved for local use */
115#define LOG_LOCAL3 (19<<3) /* reserved for local use */
116#define LOG_LOCAL4 (20<<3) /* reserved for local use */
117#define LOG_LOCAL5 (21<<3) /* reserved for local use */
118#define LOG_LOCAL6 (22<<3) /* reserved for local use */
119#define LOG_LOCAL7 (23<<3) /* reserved for local use */
120
121#define LOG_NFACILITIES 24 /* current number of facilities */
122#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
123 /* facility of pri */
124#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
125
126W32_DATA CODE facilitynames [24];
127
128/*
129 * arguments to setlogmask.
130 */
131#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
132#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
133
134/*
135 * Option flags for openlog.
136 *
137 * LOG_ODELAY no longer does anything.
138 * LOG_NDELAY is the inverse of what it used to be.
139 */
140#define LOG_PID 0x01 /* log the pid with each message */
141#define LOG_CONS 0x02 /* log on the console if errors in sending */
142#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
143#define LOG_NDELAY 0x08 /* don't delay open */
144#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
145#define LOG_PERROR 0x20 /* log to stderr as well */
146
147__BEGIN_DECLS
148
149W32_FUNC void W32_CALL closelog (void);
150W32_FUNC void W32_CALL openlog (const char *, int, int);
151W32_FUNC int W32_CALL setlogmask (int);
152W32_FUNC char *W32_CALL setlogtag (char *new_tag); /* non-standard */
153W32_FUNC void MS_CDECL syslog (int, const char *, ...);
154W32_FUNC void W32_CALL vsyslog (int, const char *, va_list);
155
156__END_DECLS
157
158#endif
cdefs.h
_code
Definition: syslog.h:86
w32api.h


Watt-32 tcp/ip: E:/WATT/src/syslog2.c Source File

  • src
syslog2.c
Go to the documentation of this file.
1
35#include <stdio.h>
36#include <stdlib.h>
37#include <stdarg.h>
38#include <sys/syslog.h>
39#include <errno.h>
40#include <fcntl.h>
41#include <string.h>
42#include <time.h>
43
44#include "wattcp.h"
45#include "printk.h"
46#include "pcconfig.h"
47#include "misc_str.h"
48#include "syslog2.h"
49
50#if defined(USE_BSD_API)
51
52static void (W32_CALL *prev_hook) (const char*, const char*) = NULL;
53
54char syslog_file_name [MAX_NAMELEN] = ""; /* name of logfile */
55char syslog_host_name [MAX_HOSTLEN] = ""; /* name of loghost */
56WORD syslog_port = 514; /* udp port to use */
57int syslog_mask = LOG_UPTO(-1); /* log everything */
58
59static int get_log_mask (const char *value)
60{
61 int mask = 0;
62
63 if (!strcmp(value, "all"))
64 return (LOG_PRIMASK); /* LOG_UPTO (LOG_EMERG); */
65
66 if (strstr(value, "emerg")) mask |= LOG_EMERG;
67 if (strstr(value, "alert")) mask |= LOG_ALERT;
68 if (strstr(value, "crit")) mask |= LOG_CRIT;
69 if (strstr(value, "error")) mask |= LOG_ERR;
70 if (strstr(value, "warn")) mask |= LOG_WARNING;
71 if (strstr(value, "notice")) mask |= LOG_NOTICE;
72 if (strstr(value, "info")) mask |= LOG_INFO;
73 if (strstr(value, "debug")) mask |= LOG_DEBUG;
74 return (mask);
75}
76
77static void set_syslog_mask (const char *value)
78{
79 char val[100];
80
81 _strlcpy (val, value, sizeof(val));
82 strlwr (val);
83 syslog_mask = get_log_mask (val);
84}
85
86static void W32_CALL syslog2_init (const char *name, const char *value)
87{
88 static const struct config_table syslog_cfg[] = {
89 { "FILE", ARG_STRCPY, (void*)&syslog_file_name },
90 { "HOST", ARG_STRCPY, (void*)&syslog_host_name },
91 { "PORT", ARG_ATOW, (void*)&syslog_port },
92 { "LEVEL", ARG_FUNC, (void*)set_syslog_mask },
93 { NULL, 0, NULL }
94 };
95 if (!parse_config_table(&syslog_cfg[0], "SYSLOG.", name, value) && prev_hook)
96 (*prev_hook) (name, value);
97}
98
99void syslog_init (void)
100{
101 prev_hook = usr_init;
102 usr_init = syslog2_init;
103}
104#endif /* USE_BSD_API */
errno.h
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
pcconfig.h
printk.h
config_table
Definition: tcp.h:461
syslog.h
syslog2.h
ARG_STRCPY
@ ARG_STRCPY
copy string value
Definition: tcp.h:456
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
ARG_ATOW
@ ARG_ATOW
convert to 16-bit word
Definition: tcp.h:450
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/syslog2.h Source File

  • src
syslog2.h
Go to the documentation of this file.
1
3#ifndef _w32_SYSLOG2_H
4#define _w32_SYSLOG2_H
5
6extern char syslog_file_name [MAX_NAMELEN];
7extern char syslog_host_name [MAX_HOSTLEN];
8extern WORD syslog_port;
9extern int syslog_mask;
10
11extern void syslog_init (void);
12
13#endif


Watt-32 tcp/ip: E:/WATT/src/syslog.c Source File

  • src
syslog.c
Go to the documentation of this file.
1
19#include <stdio.h>
20#include <stdlib.h>
21#include <stdarg.h>
22#include <string.h>
23#include <sys/syslog.h>
24#include <sys/socket.h>
25#include <fcntl.h>
26#include <time.h>
27#include <netdb.h>
28
29#include "wattcp.h"
30#include "misc.h"
31#include "misc_str.h"
32#include "run.h"
33#include "printk.h"
34#include "pctcp.h"
35#include "pcsed.h"
36#include "pcstat.h"
37#include "pcbuf.h"
38#include "pcdbug.h"
39#include "pcconfig.h"
40#include "netaddr.h"
41#include "sock_ini.h"
42#include "syslog2.h"
43
44#if defined(USE_BSD_API)
45
46#define INTERNALLOG (LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID)
47
48static sock_type *log_sock = NULL; /* UDP socket for log */
49static FILE *log_file = NULL; /* FILE* for log */
50static DWORD log_host = 0UL; /* IP-address of host (host order) */
51static BOOL log_opened = FALSE; /* have called openlog() (error or not) */
52static int log_stat = 0; /* status bits, set by openlog() */
53static char *log_tag = NULL; /* string to tag the entry with */
54static int log_mask = LOG_INFO; /* default is LOG_EMERG - LOGINFO */
55static DWORD log_facil = LOG_USER; /* default facility */
56
57/* These arrays used to be pulled in from <sys/syslog.h> when SYSLOG_NAMES
58 * was defined, but caused "multiple defined" problems.
59 */
60 CODE prioritynames[] = {
61 { LOG_ALERT, "alert" },
62 { LOG_CRIT, "crit" },
63 { LOG_DEBUG, "debug" },
64 { LOG_EMERG, "emerg" },
65 { LOG_ERR, "err" },
66 { LOG_ERR, "error" }, /* DEPRECATED */
67 { LOG_INFO, "info" },
68 { INTERNAL_NOPRI, "none" }, /* INTERNAL */
69 { LOG_NOTICE, "notice" },
70 { LOG_EMERG, "panic" }, /* DEPRECATED */
71 { LOG_WARNING, "warn" }, /* DEPRECATED */
72 { LOG_WARNING, "warning" },
73 { (u_long) -1, NULL }
74 };
75
76 CODE facilitynames[] = {
77 { LOG_AUTH, "auth" },
78 { LOG_AUTHPRIV, "authpriv" },
79 { LOG_CRON, "cron" },
80 { LOG_DAEMON, "daemon" },
81 { LOG_FTP, "ftp" },
82 { LOG_KERN, "kern" },
83 { LOG_LPR, "lpr" },
84 { LOG_MAIL, "mail" },
85 { INTERNAL_MARK, "mark" }, /* INTERNAL */
86 { LOG_NEWS, "news" },
87 { LOG_NTP, "ntp" },
88 { LOG_AUTH, "security" }, /* DEPRECATED */
89 { LOG_SYSLOG, "syslog" },
90 { LOG_USER, "user" },
91 { LOG_UUCP, "uucp" },
92 { LOG_LOCAL0, "local0" },
93 { LOG_LOCAL1, "local1" },
94 { LOG_LOCAL2, "local2" },
95 { LOG_LOCAL3, "local3" },
96 { LOG_LOCAL4, "local4" },
97 { LOG_LOCAL5, "local5" },
98 { LOG_LOCAL6, "local6" },
99 { LOG_LOCAL7, "local7" },
100 { (u_long) -1, NULL }
101 };
102
103/*
104 * syslog, vsyslog --
105 * print message on log file; output is intended for syslogd(8).
106 */
107void MS_CDECL syslog (int pri, const char *fmt, ...)
108{
109 va_list args;
110 va_start (args, fmt);
111 vsyslog (pri, fmt, args);
112 va_end (args);
113}
114
115void W32_CALL vsyslog (int pri, const char *fmt, va_list ap)
116{
117#if defined(USE_DEBUG)
118 const char *pri_name = "?";
119 const char *fac_name = "?";
120#endif
121 const char *pri_end;
122 char *p, ct_buf[30];
123 char tbuffer [2048];
124 int left = sizeof(tbuffer);
125 int saved_errno = errno;
126 time_t t;
127
128#if 0
129 /* Check for invalid bits
130 */
131 if (pri & ~(LOG_PRIMASK|LOG_FACMASK))
132 {
133 syslog (INTERNALLOG, "syslog: unknown priority: %d", pri);
134 pri &= (LOG_PRIMASK | LOG_FACMASK);
135 }
136#endif
137
138 /* Set default facility if none specified
139 */
140 if (!(pri & LOG_FACMASK))
141 pri |= log_facil;
142
143#if defined(USE_DEBUG)
144 pri_name = list_lookup (LOG_PRI(pri),
145 (const struct search_list*)prioritynames,
146 DIM(prioritynames)-1);
147
148 fac_name = list_lookup (LOG_FACMASK & pri,
149 (const struct search_list*)facilitynames,
150 DIM(facilitynames)-1);
151#endif
152
153 /* Check priority against setlogmask() values.
154 * Note: higher priorities are lower values !!
155 */
156 if (LOG_PRI(pri) > LOG_PRI(log_mask))
157 {
158#if defined(USE_DEBUG)
159 if (debug_on >= 2)
160 (*_printf) ("syslog: Dropping %s (%d) priority message, "
161 "facility %s (%d), pri 0x%04X\n",
162 pri_name, LOG_PRI(pri),
163 fac_name, LOG_FAC(pri), pri);
164#endif
165 return;
166 }
167
168#if defined(USE_DEBUG)
169 if (debug_on >= 2)
170 (*_printf) ("syslog: Accepting %s (%d) priority message, "
171 "facility %s (%d), pri 0x%04X\n",
172 pri_name, LOG_PRI(pri),
173 fac_name, LOG_FAC(pri), pri);
174#endif
175
176 /* Build the message
177 */
178 time (&t);
179 p = tbuffer;
180 p += _snprintk (p, left, "<%3d>%.15s ", pri, ctime_r(&t,ct_buf)+4);
181 left -= p - tbuffer;
182 pri_end = 1 + strchr (tbuffer, '>');
183
184 if (log_tag)
185 {
186 p += _snprintk (p, left, "%s", log_tag);
187 left -= p - tbuffer;
188 }
189 if (log_stat & LOG_PID)
190 {
191 p += _snprintk (p, left, "[%d]", getpid());
192 left -= p - tbuffer;
193 }
194 if (log_tag)
195 {
196 p += _snprintk (p, left, ": ");
197 left -= p - tbuffer;
198 }
199
200 SOCK_ERRNO (saved_errno);
201 p += _vsnprintk (p, left, fmt, ap);
202 if (*(p-1) != '\n')
203 {
204 *p++ = '\n';
205 *p = '\0';
206 }
207
208 if (!log_opened)
209 openlog (log_tag, log_stat | LOG_NDELAY, log_facil);
210
211 if (log_file)
212 _fputsk (pri_end, log_file);
213
214 if ((log_stat & LOG_PERROR) ||
215 ((pri & LOG_PRIMASK) == LOG_ERR && (log_stat & LOG_CONS)))
216 _fputsk (pri_end, stdout);
217
218 if (log_sock)
219 {
220 int len = strlen (tbuffer);
221 char *err;
222
223 len = sock_write (log_sock, (const BYTE*)tbuffer, len);
224 err = (char*) sockerr (log_sock);
225
226 if (len <= 0 || err)
227 {
228 err = strdup (err);
229 sock_close (log_sock);
230 free (log_sock);
231 log_sock = NULL;
232 syslog (log_stat | LOG_ERR, "UDP write failed: %s\n", err);
233 if (err)
234 free (err);
235 }
236 }
237}
238
239
240static const char *getlogname (void)
241{
242 const char *name = get_argv0();
243 char *dot;
244 static char buf [MAX_PATHLEN];
245
246 if (name && name[0])
247 {
248 name = _strlcpy (buf, name, sizeof(buf));
249 dot = strrchr (name, '.');
250 if (dot && (!strnicmp(dot,".exe",4) || !strnicmp(dot,".exp",4)))
251 {
252 strcpy (dot, ".log");
253 return (name);
254 }
255 }
256 return ("$unknown.log");
257}
258
259static int openloghost (char **errbuf)
260{
261 struct servent *sp;
262 struct hostent *hp;
263 static char buf [200];
264
265 *errbuf = NULL;
266
267 if (log_sock) /* reopen UDP connection */
268 {
269 sock_close (log_sock);
270 log_sock = NULL;
271 }
272
273 sp = getservbyname ("syslog", "udp");
274 if (sp)
275 syslog_port = htons (sp->s_port);
276
277 log_host = _inet_addr (syslog_host_name);
278 if (!log_host)
279 {
280 hp = gethostbyname (syslog_host_name);
281 if (!hp)
282 {
283 sprintf (buf, "unknown host `%s'", syslog_host_name);
284 *errbuf = buf;
285 return (0);
286 }
287 log_host = ntohl (*(DWORD*)hp->h_addr);
288 }
289
290 if (!log_sock)
291 {
292 log_sock = (sock_type*) malloc (sizeof(_udp_Socket));
293 if (!log_sock)
294 {
295 _strlcpy (buf, strerror(errno), sizeof(buf));
296 *errbuf = buf;
297 return (0);
298 }
299 }
300
301 if (!udp_open(&log_sock->udp, 0, log_host, syslog_port, NULL))
302 {
303 _strlcpy (buf, sockerr(log_sock), sizeof(buf));
304 *errbuf = buf;
305 sock_close (log_sock);
306 free (log_sock);
307 log_sock = NULL;
308 return (0);
309 }
310 return (1);
311}
312
313static void W32_CALL _closelog (void)
314{
315 closelog();
316}
317
318void W32_CALL openlog (const char *ident, int logstat, int logfac)
319{
320 static BOOL done = FALSE;
321 BOOL fail = FALSE;
322 char *error = NULL;
323
324 if (ident)
325 log_tag = (char*)ident;
326 log_stat = logstat;
327
328 if (logfac && !(logfac & ~LOG_FACMASK)) /* legal facility */
329 log_facil = logfac;
330
331 if (!syslog_file_name[0]) /* not set in wattcp.cfg */
332 _strlcpy (syslog_file_name, getlogname(), sizeof(syslog_file_name));
333
334 if (syslog_mask)
335 {
336 TRACE_CONSOLE (2, "setlogmask(0x%04X)\n", syslog_mask);
337 setlogmask (syslog_mask);
338 }
339
340 /* Open immediately
341 * !! fix-me: the LOG_NDELAY flag is really for the network connection
342 */
343 if (syslog_file_name[0] && (log_stat & LOG_NDELAY))
344 {
345 if (log_file) /* reopen */
346 fclose (log_file);
347
348 log_opened = TRUE;
349
350 log_file = fopen (syslog_file_name, "at");
351 if (!log_file || fputs("\n",log_file) == EOF)
352 {
353 log_file = NULL;
354 error = strerror (errno);
355 fail = TRUE;
356 }
357#if !defined(__BORLANDC__) /* buggy output with this */
358 else
359 {
360 static char fbuf [256];
361 setvbuf (log_file, fbuf, _IOLBF, sizeof(fbuf)); /* line-buffered */
362 }
363#endif
364 }
365
366 if (syslog_host_name[0] && !openloghost(&error))
367 fail = TRUE;
368
369 _printk_file = log_file;
370
371 if (!done)
372 {
373 RUNDOWN_ADD (_closelog, 110);
374 _printk_init (2000, NULL);
375 done = TRUE;
376 if (log_sock)
377 {
378 syslog (LOG_INFO, "syslog client at %I started", htonl(my_ip_addr));
379 if (_inet_addr(syslog_host_name))
380 syslog (LOG_INFO, "Logging to host %s", syslog_host_name);
381 else syslog (LOG_INFO, "Logging to host %s (%I)",
382 syslog_host_name, htonl(log_host));
383 }
384 }
385
386 if (fail && (log_stat & LOG_CONS))
387 fprintf (stdout, "syslog: %s\n", error);
388}
389
390
391int W32_CALL setlogmask (int new_mask)
392{
393 int old = log_mask;
394 if (new_mask)
395 log_mask = new_mask;
396 return (old);
397}
398
399
400char * W32_CALL setlogtag (char *new_tag)
401{
402 char *old = log_tag;
403 log_tag = new_tag;
404 return (old);
405}
406
407#include "nochkstk.h"
408
409void W32_CALL closelog (void)
410{
411 if (!_watt_fatal_error)
412 {
413 if (log_file)
414 fclose (log_file);
415
416 if (log_sock)
417 {
418 sock_close (log_sock);
419 free (log_sock);
420 }
421 }
422 log_sock = NULL;
423 log_file = NULL;
424 log_opened = FALSE;
425}
426#endif /* USE_BSD_API */
427
428
429#if defined(TEST_PROG)
430
431#include "sock_ini.h"
432#include "pcdbug.h"
433
434int main (void)
435{
436 dbug_init();
437 sock_init();
438 debug_on = 2;
439
440 openlog ("test", LOG_PID, LOG_LOCAL2);
441
442 syslog (LOG_NOTICE, "NOTICE: time now %t. file %s at line %d\n",
443 __FILE__, __LINE__);
444
445 SOCK_ERRNO (ENOMEM);
446 syslog (LOG_ERR | LOG_LOCAL0, "ERR: Allocation failed; %m");
447
448 syslog (LOG_DEBUG, "DEBUG: my_ip_addr = %I", htonl(my_ip_addr));
449
450 SOCK_ERRNO (ENETDOWN);
451 syslog (LOG_ALERT, "ALERT: Connection failed; %m");
452
453 syslog (LOG_EMERG, "EMERG: Coffee mug empty");
454
455 syslog (LOG_CRIT|LOG_KERN, "CRIT: Kernel message: General error reading disk.");
456
457 SOCK_ERRNO (EILSEQ);
458 syslog (LOG_WARNING, "WARNING: Multibyte error; %m");
459
460 syslog (LOG_INFO, "INFO: Leaving main()");
461
462 printf ("Done. ");
463 if (log_file)
464 printf ("Look at `%s'", syslog_file_name);
465
466 closelog();
467 return (0);
468}
469#endif /* TEST_PROG */
socket.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
ctime_r
char * ctime_r(const time_t *t, char *res)
A reentrant ctime().
Definition: misc.c:887
misc.h
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
_inet_addr
DWORD W32_CALL _inet_addr(const char *s)
Convert a string into an IP-address.
Definition: netaddr.c:70
netaddr.h
netdb.h
strerror
char *MS_CDECL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207
nochkstk.h
pcbuf.h
get_argv0
const char * get_argv0(void)
Return argv[0] as passed to main().
Definition: pcconfig.c:671
pcconfig.h
pcdbug.h
pcsed.h
pcstat.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
udp_open
int W32_CALL udp_open(_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP active open.
Definition: pctcp.c:262
pctcp.h
_printk_file
FILE * _printk_file
Definition: printk.c:58
printk.h
sock_ini.h
_code
Definition: syslog.h:86
hostent
Definition: netdb.h:104
search_list
Definition: misc.h:131
servent
Definition: netdb.h:124
syslog.h
syslog2.h
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/inc/syslog.h Source File

  • inc
syslog.h
Go to the documentation of this file.
1
4/*
5 * POSIX requires (AFAIK) this file in a base-dir
6 */
7#ifndef __SYS_SYSLOG_H
8#include <sys/syslog.h>
9#endif
syslog.h


Watt-32 tcp/ip: E:/WATT/inc/protocol/talkd.h Source File

  • inc
  • protocol
talkd.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1983 Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __PROTOCOL_TALKD_H
39#define __PROTOCOL_TALKD_H
40
41#include <sys/wtypes.h>
42
43/*
44 * This describes the protocol used by the talk server and clients.
45 *
46 * The talk server acts a repository of invitations, responding to
47 * requests by clients wishing to rendezvous for the purpose of
48 * holding a conversation. In normal operation, a client, the caller,
49 * initiates a rendezvous by sending a CTL_MSG to the server of
50 * type LOOK_UP. This causes the server to search its invitation
51 * tables to check if an invitation currently exists for the caller
52 * (to speak to the callee specified in the message). If the lookup
53 * fails, the caller then sends an ANNOUNCE message causing the server
54 * to broadcast an announcement on the callee's login ports requesting
55 * contact. When the callee responds, the local server uses the
56 * recorded invitation to respond with the appropriate rendezvous
57 * address and the caller and callee client programs establish a
58 * stream connection through which the conversation takes place.
59 */
60
61#include <sys/pack_on.h>
62
63/*
64 * Client->server request message format.
65 */
66typedef struct {
67 u_char vers; /* protocol version */
68 u_char type; /* request type, see below */
69 u_char answer; /* not used */
70 u_char pad;
71 u_int32_t id_num; /* message id */
72 struct osockaddr addr; /* old (4.3) style */
73 struct osockaddr ctl_addr; /* old (4.3) style */
74 int32_t pid; /* caller's process id */
75#define NAME_SIZE 12
76 char l_name[NAME_SIZE]; /* caller's name */
77 char r_name[NAME_SIZE]; /* callee's name */
78#define TTY_SIZE 16
79 char r_tty[TTY_SIZE]; /* callee's tty name */
80} CTL_MSG;
81
82/*
83 * Server->client response message format.
84 */
85typedef struct {
86 u_char vers; /* protocol version */
87 u_char type; /* type of request message, see below */
88 u_char answer; /* respose to request message, see below */
89 u_char pad;
90 u_int32_t id_num; /* message id */
91 struct osockaddr addr; /* address for establishing conversation */
92} CTL_RESPONSE;
93
94#include <sys/pack_off.h>
95
96#define TALK_VERSION 1 /* protocol version */
97
98/* message type values */
99#define LEAVE_INVITE 0 /* leave invitation with server */
100#define LOOK_UP 1 /* check for invitation by callee */
101#undef DELETE
102#define DELETE 2 /* delete invitation by caller */
103#define ANNOUNCE 3 /* announce invitation by caller */
104
105/* answer values */
106#undef SUCCESS
107#define SUCCESS 0 /* operation completed properly */
108#define NOT_HERE 1 /* callee not logged in */
109#undef FAILED
110#define FAILED 2 /* operation failed for unexplained reason */
111#define MACHINE_UNKNOWN 3 /* caller's machine name unknown */
112#define PERMISSION_DENIED 4 /* callee's tty doesn't permit announce */
113#define UNKNOWN_REQUEST 5 /* request has invalid type value */
114#define BADVERSION 6 /* request has invalid protocol version */
115#define BADADDR 7 /* request has invalid addr value */
116#define BADCTLADDR 8 /* request has invalid ctl_addr value */
117
118/*
119 * Operational parameters.
120 */
121#define MAX_LIFE 60 /* max time daemon saves invitations */
122
123/* RING_WAIT should be 10's of seconds less than MAX_LIFE */
124#define RING_WAIT 30 /* time to wait before resending invitation */
125
126#endif
pack_off.h
pack_on.h
CTL_MSG
Definition: talkd.h:66
CTL_RESPONSE
Definition: talkd.h:85
osockaddr
Definition: wtypes.h:394
wtypes.h


Watt-32 tcp/ip: E:/WATT/src/target.h Source File

  • src
target.h
Go to the documentation of this file.
1#ifndef _w32_TARGET_H
2#define _w32_TARGET_H
3
11#ifndef _w32_WATTCP_H
12#error TARGET.H must be included inside or after WATTCP.H
13#endif
14
15#define DOS4GW 1
16#define DJGPP 2
17#define PHARLAP 4
18#define PHAR286 8
19#define POWERPAK 16
20#define X32VM 32
21#define WINWATT 64
22#define ATMEL 128
23#define PHARLAP_DLL (0x80|PHARLAP)
24#define DOS4GW_DLL (0x80|DOS4GW)
25#define DJGPP_DXE (0x80|DJGPP)
27/*
28 * Notes:
29 *
30 * (1) Most 32-bit DOS compilers (Borland/Watcom/Microsoft/HighC/DMC)
31 * will work with this DOS extender. Some compilers support far
32 * pointers (48-bits), some don't. And even worse, some of those who
33 * do, have bugs in their segment register handling!
34 * Add `-DBUGGY_FARPTR=1' to your makefile's CFLAGS if you experience
35 * this or crashes in weird places (generate .asm listing to find out).
36 *
37 * The problem is present in:
38 * - Metaware's HighC v3.1 at -O3 or above (for sure).
39 * - BCC32 v4, Some rumours say far-ptrs in combination with FPU-ops.
40 *
41 * (2) Several DOS-extenders supports Watcom-386. DOS4GW (from Tenberry)
42 * is a DPMI 0.9 host with limited API. Other compatible DOS-extenders
43 * can also be used without modifying Watt-32. These are:
44 * DOS4GW Pro, DOS4G, Pmode/W, CauseWay, DOS32A, EDOS, WDOSX, HX-DOS and
45 * Zurenava. Watcom-386 with FlashTek's X-32 hasn't been tested.
46 *
47 */
48
49/*
50 * explicitly configure DOS Extender from make file
51 * for compilers which support multiple DOS Extenders
52 */
53#if defined(DOSX_DOS4GW)
54 #define DOSX DOS4GW
55#elif defined(DOSX_X32VM)
56 #define DOSX X32VM
57#elif defined(DOSX_PHARLAP)
58 #define DOSX PHARLAP
59#endif
60
61#ifndef BUGGY_FARPTR
62#define BUGGY_FARPTR 0 /* Assume no compilers have fp-bugs, duh! */
63#endif
64
65#if defined(_MSC_VER) && defined(M_I86SM) /* Microsoft doesn't have */
66 #define __SMALL__ /* __SMALL__, __LARGE__ */
67#endif
68
69#if defined(_MSC_VER) && defined(M_I86LM)
70 #define __LARGE__
71#endif
72
73#if defined(__TINY__) || defined(__COMPACT__) || defined(__MEDIUM__) || defined(__HUGE__)
74 #error Unsupported memory model (tiny/compact/medium/huge)
75#endif
76
77#if defined(M_I86TM) || defined(M_I86CM) || defined(M_I86MM) || defined(M_I86HM)
78 #error Unsupported memory model (tiny/compact/medium/huge)
79#endif
80
81#if defined(_M_I86MM) || defined(_M_I86MH)
82 #error Unsupported memory model (medium/huge)
83#endif
84
85/*
86 * djgpp 2.x with GNU C 2.7 or later.
87 */
88#if defined(__DJGPP__) && defined(__GNUC__)
89 #ifndef DOSX
90 #define DOSX DJGPP
91 #endif
92#endif
93
94/*
95 * Watcom 11.x or OpenWatcom 1.x.
96 */
97#if defined(__WATCOMC__) && defined(__386__)
98 #ifndef DOSX /* If not set in watcom_*.mak file */
99 #define DOSX DOS4GW /* may be DOS4GW, X32VM, PHARLAP or WINWATT */
100 #endif
101 #define WATCOM386
102#endif
103
104/*
105 * Digital Mars Compiler 8.30+
106 */
107#if defined(__DMC__) && (__INTSIZE==4)
108 #ifndef DOSX /* If not set in dmars_*.mak file */
109 #define DOSX PHARLAP /* may be X32VM, DOS4GW or PHARLAP */
110 #endif
111 #define DMC386
112#endif
113
114/*
115 * PellesC works with Win32 only.
116 * Note: "pocc -Ze" sets _MSC_VER. Hence the #undef (would cause
117 * troubles otherwise).
118 */
119#if defined(__POCC__)
120 #if !defined(__POCC__OLDNAMES)
121 #error Use the "pocc -Go" option.
122 #endif
123
124 /*
125 * Lots of these:
126 * warning #2116: Local '(no name)' is used without being initialized.
127 */
128 #pragma warn (disable: 2116)
129
130 #ifndef DOSX
131 #define DOSX WINWATT
132 #endif
133 #undef _MSC_VER
134#endif
135
136/*
137 * Microsoft Visual-C 32-bit. Really not supported with PharLap,
138 * but works with Win32 as target.
139 */
140#if defined(_MSC_VER) && (_M_IX86 >= 300)
141 #ifndef DOSX
142 #define DOSX WINWATT /* VC 2.0 can use PHARLAP too */
143 #endif
144 #define MSC386
145#endif
146
147/*
148 * Metaware's High-C 3.x.
149 */
150#if defined(__HIGHC__)
151 #if !defined(_I386) || (_I386 == 0)
152 #error What CPU are you for?
153 #endif
154 #if !defined(__i386__)
155 #define __i386__
156 #endif
157
158 #ifndef DOSX
159 #define DOSX PHARLAP /* Is DOS4GW possible? */
160 #endif
161#endif
162
163/*
164 * Borland 32-bit PowerPak compiler (v4.x, v5.x untested)
165 */
166#if defined(__BORLANDC__) && defined(__FLAT__) && defined(__DPMI32__)
167 #define BORLAND386
168 #ifndef DOSX
169 #define DOSX POWERPAK /* may also be DOS4GW (for WDOSX targets) */
170 /* or PHARLAP (not yet) */
171 #endif
172#endif
173
174/*
175 * Build for Windows (dll and static lib).
176 */
177#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(__CYGWIN__)
178 #undef DOSX
179 #define DOSX WINWATT
180#endif
181
182#if (defined(__SMALL__) || defined(__LARGE__))
183 #ifndef DOSX
184 #define DOSX 0
185 #endif
186#endif
187
188#if defined(__AVR__)
189 #define DOSX ATMEL
190#endif
191
192#if defined(__CYGWIN__) && defined(_REENT_ONLY) && defined(WATT32_BUILD)
193 #error "CygWin with _REENT_ONLY is not supported."
194#endif
195
196#if !defined(DOSX)
197 #error DOSX target not defined
198#endif
199
200#if (defined(MSDOS) || defined(_MSDOS)) && !defined(__MSDOS__)
201#define __MSDOS__ /* dmc etc. defines only MSDOS+_MSDOS */
202#endif
203
204#if (DOSX == 0) && !defined(__MSDOS__)
205 #error __MSDOS__ not defined for a real-mode DOS compiler!?
206#endif
207
208#if (DOSX & (ATMEL | WINWATT)) == 0 && !defined(__MSDOS__)
209 #define __MSDOS__
210#endif
211
212
213/*
214 * Macros and hacks depending on target (i.e. DOS-extender or Windows).
215 */
216
217#if (DOSX & PHARLAP)
218 #include <stdio.h>
219 #include <pharlap.h>
220 #undef FP_OFF
221 #include <dos.h>
222
223 #ifdef WATCOM386
224 #include <i86.h>
225 #endif
226
227 extern REALPTR _watt_dosTbr; /* Location and size of DOS transfer buffer */
228 extern DWORD _watt_dosTbSize;
229
230 #if !defined(DMC386) && /* It supports far-ptr, but don't use them */ \
231 (!BUGGY_FARPTR) && /* Trust the compiler to handle far-ptr ? */ \
232 (__CMPLR_FEATURES__ & __FEATURE_FARPTR__) /* compilers with far-ptrs */
233 #define HAVE_FARPPTR48 /* i.e. HighC, Watcom386 */
234 extern FARPTR _watt_dosFp;
235
236 #define DOSMEM(s,o,t) *(t _far*)(_watt_dosFp + (DWORD)((o)|(s)<<4))
237 #define PEEKB(s,o) DOSMEM(s,o,BYTE)
238 #define PEEKW(s,o) DOSMEM(s,o,WORD)
239 #define PEEKL(s,o) DOSMEM(s,o,DWORD)
240 #define POKEB(s,o,x) DOSMEM(s,o,BYTE) = (BYTE)(x)
241 #define POKEW(s,o,x) DOSMEM(s,o,WORD) = (WORD)(x)
242 #define POKEL(s,o,x) DOSMEM(s,o,DWORD) = (DWORD)(x)
243 #else
244 #define PEEKB(s,o) PeekRealByte (((s) << 16) + (o))
245 #define PEEKW(s,o) PeekRealWord (((s) << 16) + (o))
246 #define PEEKL(s,o) PeekRealDWord(((s) << 16) + (o))
247 #define POKEB(s,o,x) PokeRealByte (((s) << 16) + (o), (x))
248 #define POKEW(s,o,x) PokeRealWord (((s) << 16) + (o), (x))
249 #define POKEL(s,o,x) PokeRealDWord(((s) << 16) + (o), (x))
250 #endif
251
252#elif (DOSX & PHAR286) /* 16-bit protected mode */
253 #include <stdio.h>
254 #include <phapi.h>
255
256 #error Pharlap Lite not supported yet
257
258#elif (DOSX & DJGPP)
259 #include <dos.h>
260 #include <dpmi.h>
261 #include <go32.h>
262 #include <sys/farptr.h>
263
264 #define PEEKB(s,o) _farpeekb (_dos_ds, (o)+((s)<<4))
265 #define PEEKW(s,o) _farpeekw (_dos_ds, (o)+((s)<<4))
266 #define PEEKL(s,o) _farpeekl (_dos_ds, (o)+((s)<<4))
267 #define POKEB(s,o,x) _farpokeb (_dos_ds, (o)+((s)<<4), x)
268 #define POKEW(s,o,x) _farpokew (_dos_ds, (o)+((s)<<4), x)
269 #define POKEL(s,o,x) _farpokel (_dos_ds, (o)+((s)<<4), x)
270 #define BOOL int
271
272#elif (DOSX & DOS4GW) /* Watcom targets normally uses this section */
273 #if defined(__DJGPP__)
274 #include <dpmi.h>
275 #include <go32.h>
276 #endif
277
278 #include <dos.h>
279
280 extern WORD _watt_dosTbSeg;
281 extern DWORD _watt_dosTbSize;
282
283 #define DOSMEM(s,o,t) *(volatile t *) (((s) << 4) | (o))
284 #define PEEKB(s,o) DOSMEM(s,o,BYTE)
285 #define PEEKW(s,o) DOSMEM(s,o,WORD)
286 #define PEEKL(s,o) DOSMEM(s,o,DWORD)
287 #define POKEB(s,o,x) DOSMEM(s,o,BYTE) = (BYTE)(x)
288 #define POKEW(s,o,x) DOSMEM(s,o,WORD) = (WORD)(x)
289 #define POKEL(s,o,x) DOSMEM(s,o,DWORD) = (DWORD)(x)
290 #undef BOOL
291 #define BOOL int
292
293#elif (DOSX & X32VM)
294 #include <x32.h>
295
296 #if defined(DMC386) || defined(WATCOM386)
297 #define HAVE_FARPTR48
298 typedef BYTE _far *FARPTR;
299 extern FARPTR _watt_dosFp;
300 #endif
301
302 extern DWORD _watt_dosTbr, _watt_dosTbSize;
303
304 #ifdef DMC386
305 #define DOSMEM(s,o,t) (t*)((DWORD)_x386_zero_base_ptr + (DWORD)((o)|(s)<<4))
306 #define PEEKB(s,o) *DOSMEM(s,o,BYTE)
307 #define PEEKW(s,o) *DOSMEM(s,o,WORD)
308 #define PEEKL(s,o) *DOSMEM(s,o,DWORD)
309 #define POKEB(s,o,x) *DOSMEM(s,o,BYTE) = (BYTE)(x)
310 #define POKEW(s,o,x) *DOSMEM(s,o,WORD) = (WORD)(x)
311 #define POKEL(s,o,x) *DOSMEM(s,o,DWORD) = (DWORD)(x)
312 #else
313 #define PEEKB(s,o) PeekRealByte (((s) << 16) + (o))
314 #define PEEKW(s,o) PeekRealWord (((s) << 16) + (o))
315 #define PEEKL(s,o) PeekRealDWord(((s) << 16) + (o))
316 #define POKEB(s,o,x) PokeRealByte (((s) << 16) + (o), x)
317 #define POKEW(s,o,x) PokeRealWord (((s) << 16) + (o), x)
318 #define POKEL(s,o,x) PokeRealDWord(((s) << 16) + (o), x)
319 #endif
320
321 #undef BOOL
322 #define BOOL int
323
324#elif (DOSX & POWERPAK) /* Borland 32-bit DOS normally uses this section */
325 #include <dos.h>
326
327 extern WORD _watt_dosTbSeg, _watt_dos_ds;
328 extern DWORD _watt_dosTbr, _watt_dosTbSize;
329
330 #define PEEKB(s,o) _farpeekb (_watt_dos_ds, (o)+((s)<<4))
331 #define PEEKW(s,o) _farpeekw (_watt_dos_ds, (o)+((s)<<4))
332 #define PEEKL(s,o) _farpeekl (_watt_dos_ds, (o)+((s)<<4))
333 #define POKEB(s,o,x) _farpokeb (_watt_dos_ds, (o)+((s)<<4), x)
334 #define POKEW(s,o,x) _farpokew (_watt_dos_ds, (o)+((s)<<4), x)
335 #define POKEL(s,o,x) _farpokel (_watt_dos_ds, (o)+((s)<<4), x)
336 #undef BOOL
337 #define BOOL int
338
339#elif (DOSX & ATMEL) /* ATX &/ ATmel MCU targets */
340 /*
341 * todo
342 */
343
344#elif !(DOSX & WINWATT) /* All real-mode and non-Windows targets */
345 #include <dos.h>
346 #define BOOL int
347
348 #if defined(__WATCOMC__) || defined(_MSC_VER)
349 #define PEEKB(s,o) (*((BYTE __far*) MK_FP(s,o)))
350 #define PEEKW(s,o) (*((WORD __far*) MK_FP(s,o)))
351 #define PEEKL(s,o) (*((DWORD __far*) MK_FP(s,o)))
352 #define POKEB(s,o,x) (*((BYTE __far*) MK_FP(s,o)) = (BYTE)(x))
353 #define POKEW(s,o,x) (*((WORD __far*) MK_FP(s,o)) = (WORD)(x))
354 #define POKEL(s,o,x) (*((DWORD __far*) MK_FP(s,o)) = (DWORD)(x))
355 #else
356 #define PEEKB(s,o) peekb(s,o)
357 #define PEEKW(s,o) (WORD) peek(s,o)
358 #define PEEKL(s,o) (*((DWORD far*) MK_FP(s,o)))
359 #define POKEB(s,o,x) pokeb (s,o,x)
360 #define POKEW(s,o,x) poke (s,o,x)
361 #define POKEL(s,o,x) (*((DWORD far*) MK_FP(s,o)) = (DWORD)(x))
362 #endif
363#endif
364
365
366/* Use Pharlap's definition of a DOS-memory address;
367 * segment in upper 16-bits, offset in lower 16-bits.
368 */
369#if !(DOSX & PHARLAP) && !defined(REALPTR) && defined(__MSDOS__)
370 #define REALPTR DWORD
371#endif
372
373#if (DOSX)
374 #define FARCODE
375 #define FARDATA
376#else
377 #define FARCODE far
378 #define FARDATA far
379#endif
380
381/*
382 * Macros and hacks depending on compiler.
383 */
384
385#if defined(__POCC__) || defined(__AVR__)
386 #include <string.h>
387 #include <stdlib.h>
388
389#else
390 #include <stdlib.h>
391 #include <memory.h>
392 #include <malloc.h>
393#endif
394
395#if defined(__HIGHC__)
396 #include <string.h>
397
398 #define max(a,b) _max (a,b) /* intrinsic functions */
399 #define min(a,b) _min (a,b)
400 #define ENABLE() _inline (0xFB) /* sti */
401 #define DISABLE() _inline (0xFA) /* cli */
402#endif
403
404/*
405 * This section also includes support "clang-cl" with some exceptions.
406 */
407#if defined(_MSC_VER) && !defined(__POCC__) /* "cl" and not "pocc -Ze" */
408 #if (DOSX) && (DOSX != WINWATT) && (DOSX != PHARLAP)
409 #error Microsoft-C and non-Win32 or non-Pharlap targets not supported
410 #endif
411
412 #if !(defined(_M_IX86) || defined(_M_IA64) || defined(_M_X64) || defined(_M_AMD64))
413 #error Unsupported CPU-target
414 #endif
415
416 #undef cdecl
417
418 #if (_MSC_VER <= 600) /* A few exceptions for Quick-C <= 6.0 */
419 #define NO_INLINE_ASM /* doesn't have built-in assembler */
420 #define ENABLE() _enable()
421 #define DISABLE() _disable()
422 #define cdecl _cdecl
423 #else
424 /* #pragma warning (disable:4103 4113 4229) */
425 /* #pragma warning (disable:4024 4047 4761 4791) */
426
427 /*
428 * 4244: "'function': convertion from '__w64' to 'int', possible
429 * loss of data".
430 * 4267: "'=': convertion from 'size_t' to 'int', possible
431 * loss of data".
432 * 4312: 'type cast' : conversion from 'int' to 'void *' of greater size.
433 * 4996: "The POSIX name for this item is deprecated. Instead, use
434 * the ISO C++ conformant name...".
435 */
436 #if (_MSC_VER >= 1500) /* VC9+ */
437 #pragma warning (disable:4090 4244 4267 4312 4996)
438 #ifndef _USE_32BIT_TIME_T
439/* !! #error Need to define "_USE_32BIT_TIME_T" for ABI compatability. No need? */
440 #endif
441 #endif
442
443 #if !defined(__cplusplus) /* Included via stkwalk.cpp */
444 #define ENABLE() __asm sti
445 #define DISABLE() __asm cli
446 #define asm __asm
447 #define cdecl __cdecl
448 #endif
449 #endif
450
451 /* Select what compiler built-in instructions to enable.
452 */
453 #if (_MSC_VER >= 800)
454 #pragma intrinsic (abs, memcmp, memcpy, memset)
455 #pragma intrinsic (strcat, strcmp, strcpy, strlen)
456 #if (DOSX == 0)
457 #pragma intrinsic (_fmemcpy)
458
459 #elif (_MSC_VER >= 1500) && !defined(__clang__)
460 #include <intrin.h>
461
462 #pragma intrinsic (__cpuid)
463 #pragma intrinsic (_mm_popcnt_u32)
464 #define HAVE_POPCOUNT
465
466 #if defined(_M_X64) /* 64-bit compiler */
467 #pragma intrinsic (_mm_popcnt_u64)
468 #endif
469 #endif
470 #endif
471
472 #if !defined(__i386__) && defined(_M_IX86)
473 #define __i386__
474 #endif
475
476 #if (DOSX == 0)
477 #define interrupt _interrupt far
478 #define getvect(a) _dos_getvect (a)
479 #define setvect(a,b) _dos_setvect (a, b)
480 #undef MK_FP
481 #define MK_FP(s,o) (void _far*) (((DWORD)(s) << 16) + (DWORD)(o))
482 #endif
483#endif /* _MSC_VER && !__POCC__ */
484
485
486#if defined(__TURBOC__) || defined(__BORLANDC__)
487 #if defined(__DPMI16__)
488 #error 16-bit DPMI version not supported
489 #endif
490
491 #include <string.h>
492
493 #if !defined(WIN32)
494 #define ENABLE() __emit__(0xFB)
495 #define DISABLE() __emit__(0xFA)
496 #endif
497
498 #pragma warn -bbf- /* "Bitfields must be signed or unsigned int" warning */
499 #pragma warn -sig- /* "Conversion may loose significant digits" warning */
500 #pragma warn -cln- /* "Constant is long" warning */
501
502 #if defined(__DPMI32__)
503 #pragma warn -stu- /* structure undefined */
504 #pragma warn -aus- /* assigned a value that is never used */
505 #endif
506
507 /* make string/memory functions inline (but not for DPMI32/WIN32)
508 */
509 #if defined(__BORLANDC__) && !defined(__DPMI32__) && !defined(WIN32)
510 #define strlen __strlen__
511 #define strncpy __strncpy__
512 #define strrchr __strrchr__
513 #define strncmp __strncmp__
514 #define memset __memset__
515 #define memcpy __memcpy__
516 #define memcmp __memcmp__
517 #define memchr __memchr__
518 #endif
519#endif /* __TURBOC__ || __BORLANDC__ */
520
521
522#if defined(__GNUC__)
523 #if (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1))
524 #error I need GCC 3.1 or later
525 #endif
526 #include <string.h>
527
528 #ifndef __fastcall
529 #define __fastcall __attribute__((__fastcall__)) /* unsupported in gcc/djgpp */
530 #endif
531
532 #ifndef _fastcall
533 #define _fastcall __attribute__((__fastcall__))
534 #endif
535
536 #if !(DOSX & WINWATT)
537 #define ENABLE() __asm__ __volatile__ ("sti")
538 #define DISABLE() __asm__ __volatile__ ("cli")
539 #endif
540#endif
541
542#if defined(__WATCOMC__)
543 #include <dos.h>
544 #include <string.h>
545
546 #if !defined(_M_IX86)
547 #error Only Watcom x86 supported
548 #endif
549
550 /* Code inside "W32_NO_8087" is meant to be excluded on a 8086 PC.
551 * Since they don't have a math processor, we should prevent the math
552 * emulation library to be linked in. The define "__SW_0" is set by
553 * "wcc -0".
554 */
555 #if defined(__SW_0) && !defined(__SW_FPI87)
556 #define W32_NO_8087
557 #endif
558
559 #pragma intrinsic (strcmp, memset)
560
561 #if defined(__MSDOS__)
562 #define getvect(a) _dos_getvect (a)
563 #define setvect(a,b) _dos_setvect (a, b)
564 #define BOOL int
565
566 extern void ENABLE (void);
567 extern void DISABLE (void);
568 #pragma aux ENABLE = 0xFB;
569 #pragma aux DISABLE = 0xFA;
570 #endif
571#endif
572
573#if defined(WIN32) || defined(WIN64)
574 extern CRITICAL_SECTION _watt_crit_sect;
575
576 #define ENTER_CRIT() EnterCriticalSection (&_watt_crit_sect)
577 #define LEAVE_CRIT() LeaveCriticalSection (&_watt_crit_sect)
578
579 #undef DISABLE
580 #undef ENABLE
581 #define DISABLE() ENTER_CRIT()
582 #define ENABLE() LEAVE_CRIT()
583
584#else
585
586 #if defined(__DMC__)
587 #include <dos.h>
588 #include <dpmi.h>
589 #include <string.h>
590
591 #define ENABLE() enable()
592 #define DISABLE() disable()
593 #endif
594
595 #define ENTER_CRIT() ((void)0)
596 #define LEAVE_CRIT() ((void)0)
597#endif /* WIN32 || WIN64 */
598
599
600#if !defined(cdecl) && defined(__GNUC__) && (defined(__MINGW32__) || defined(__CYGWIN__))
601#define cdecl __attribute__((__cdecl__))
602#endif
603
604#ifndef cdecl
605#define cdecl
606#endif
607
608#if (DOSX & (DOS4GW|X32VM))
609#define HAVE_DOS_NEAR_PTR /* Can use 32-ptr to access DOS-mem directly */
610#endif
611
612#ifndef max
613#define max(a,b) (((a) > (b)) ? (a) : (b))
614#endif
615
616#ifndef min
617#define min(a,b) (((a) < (b)) ? (a) : (b))
618#endif
619
620#if (W32_GCC_VERSION >= 40410)
621 #define HAVE_POPCOUNT
622#endif
623
624#if !defined(_MSC_VER) && !defined(__BORLANDC__)
625 #define HAVE_UNISTD_H
626#endif
627
628/*
629 * C-99 (?) __FUNCTION__
630 */
631#if defined(__POCC__)
632 #define __FUNCTION__ __func__
633
634#elif (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__DMC__)
635 /* __FUNCTION__ is built-in */
636
637#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
638 #define __FUNCTION__ __func__
639
640#elif !defined(__GNUC__) && !defined(__WATCOMC__)
641 #define __FUNCTION__ "func?"
642#endif
643
644/*
645 * Some checks for Borland on Windows
646 */
647#if defined(__DOS_H) && defined(__BORLANDC__) && defined(WIN32)
648 #error Do not include <dos.h> for Borland/WIN32
649#endif
650
651#endif /* _w32_TARGET_H */


Watt-32 tcp/ip: E:/WATT/inc/netinet6/tcp6_var.h Source File

  • inc
  • netinet6
tcp6_var.h
Go to the documentation of this file.
1
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * Copyright (c) 1982, 1986, 1993, 1994, 1995
35 * The Regents of the University of California. All rights reserved.
36 *
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
39 * are met:
40 * 1. Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * 2. Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in the
44 * documentation and/or other materials provided with the distribution.
45 * 3. All advertising materials mentioning features or use of this software
46 * must display the following acknowledgement:
47 * This product includes software developed by the University of
48 * California, Berkeley and its contributors.
49 * 4. Neither the name of the University nor the names of its contributors
50 * may be used to endorse or promote products derived from this software
51 * without specific prior written permission.
52 *
53 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
54 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
57 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * SUCH DAMAGE.
64 */
65
66#ifndef _NETINET_TCP6_VAR_H_
67#define _NETINET_TCP6_VAR_H_
68
69#ifdef _KERNEL
70#ifdef SYSCTL_DECL
71SYSCTL_DECL(_net_inet6_tcp6);
72#endif
73
74extern int tcp_v6mssdflt; /* XXX */
75
76struct ip6_hdr;
77void tcp6_ctlinput (int, struct sockaddr *, void *);
78void tcp6_init (void);
79int tcp6_input (struct mbuf **, int *, int);
80struct rtentry *tcp_rtlookup6(struct in_conninfo *);
81
82extern struct pr_usrreqs tcp6_usrreqs;
83#endif /* _KERNEL */
84
85#endif /* _NETINET_TCP6_VAR_H_ */
mbuf
Definition: mbuf.h:6
rtentry
Definition: route.h:97
sockaddr
Definition: socket.h:181


Watt-32 tcp/ip: E:/WATT/inc/tcp.h Source File

  • inc
tcp.h
Go to the documentation of this file.
1
6/*
7 * Waterloo TCP
8 *
9 * Copyright (c) 1990-1993 Erick Engelke
10 *
11 * Portions copyright others, see copyright.h for details.
12 *
13 * This library is free software; you can use it or redistribute under
14 * the terms of the license included in LICENSE.H.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * file LICENSE.H for more details.
20 *
21 */
22
23#ifndef __WATT_TCP_H
24#define __WATT_TCP_H
25
26/*
27 * Version (major.minor.dev-rel), 8-bit each.
28 */
29#define WATTCP_MAJOR_VER 2
30#define WATTCP_MINOR_VER 2
31#define WATTCP_DEVEL_REL 11
32
33#define WATTCP_VER ((WATTCP_MAJOR_VER << 16) + \
34 (WATTCP_MINOR_VER << 8) + \
35 WATTCP_DEVEL_REL)
36
37#define WATTCP_VER_STRING "2.2.11"
38
39#if !defined(RC_INVOKED) /* rest of file */
40
41#include <stdio.h>
42#include <sys/w32api.h> /* W32_FUNC, W32_DATA etc. */
43#include <sys/wtypes.h> /* fd_set, iovec */
44#include <sys/wtime.h> /* <time.h>, struct timeval */
45#include <sys/whide.h> /* hide publics inside W32_NAMESPACE() */
46#include <sys/cdefs.h> /* MS_CDECL etc. */
47#include <sys/swap.h> /* intel(), intel16() */
48
49#ifdef __WATCOMC__
50#pragma read_only_directory;
51#endif
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
57W32_DATA const char *wattcpCopyright; /* "See COPYRIGHT.H for details" */
58
59W32_FUNC const char *W32_CALL wattcpVersion (void); /* Watt-32 target version/date */
60W32_FUNC const char *W32_CALL wattcpCapabilities (void); /* what features was been compiled in */
61W32_FUNC const char *W32_CALL wattcpBuildCC (void); /* what is the compiler __VENDOR__ nane */
62W32_FUNC const char *W32_CALL wattcpBuildCCexe (void); /* what is the compiler name */
63W32_FUNC const char *W32_CALL wattcpBuildCflags (void); /* what CFLAGS were used */
64
65#if defined(_M_X64) || defined(_M_IA64) || defined(_M_AMD64) || defined(__x86_64__)
66 #define W32_UNDOC_TCP_SOCKET_SIZE 4520
67 #define W32_UNDOC_UDP_SOCKET_SIZE 1780
68#else
69 #define W32_UNDOC_TCP_SOCKET_SIZE 4470
70 #define W32_UNDOC_UDP_SOCKET_SIZE 1740
71#endif
72
73#if !defined(WATT32_BUILD)
74 /*
75 * Hide the details of these structures when using Watt-32.
76 * In 64-bit mode, these structures are a bit higher.
77 */
78 typedef void sock_type;
79 typedef void in_Header;
80 typedef void udp_Header;
81 typedef void tcp_Header;
82
83 typedef struct {
84 BYTE undoc [W32_UNDOC_TCP_SOCKET_SIZE];
85 } tcp_Socket;
86
87 typedef struct {
88 BYTE undoc [W32_UNDOC_UDP_SOCKET_SIZE];
89 } udp_Socket;
90
91#else
92
93 #if !defined(_w32_WATTCP_H)
94 #error "<wattcp.h> MUST be included before <tcp.h>"
95 #endif
96
97 #define tcp_Socket struct tcp_Socket /* in wattcp.h */
98 #define udp_Socket struct udp_Socket /* in wattcp.h */
99 #define sock_type union sock_type /* in wattcp.h */
100
101 W32_COMPILE_TIME_ASSERT (tcp_Socket, sizeof(tcp_Socket) <= W32_UNDOC_TCP_SOCKET_SIZE);
102 W32_COMPILE_TIME_ASSERT (udp_Socket, sizeof(udp_Socket) <= W32_UNDOC_UDP_SOCKET_SIZE);
103
104#endif /* WATT32_BUILD */
105
106#define MAX_COOKIES 10
107#define MAX_NAMESERVERS 10
108#define MAX_HOSTLEN 80
109
110/* Modes for sock_mode()
111 */
112#define TCP_MODE_BINARY 0x01 /* deprecated */
113#define TCP_MODE_ASCII 0x02 /* deprecated */
114#define SOCK_MODE_BINARY 0x01 /* new name */
115#define SOCK_MODE_ASCII 0x02 /* new name */
116#define UDP_MODE_CHK 0x04 /* defaults to checksum */
117#define UDP_MODE_NOCHK 0x08
118#define TCP_MODE_NAGLE 0x10 /* Nagle's algorithm */
119#define TCP_MODE_NONAGLE 0x20
120
121/* wait-states for sock_sselect()
122 */
123#define SOCKESTABLISHED 1
124#define SOCKDATAREADY 2
125#define SOCKCLOSED 4
126
127#undef sock_init
128#define sock_init() watt_sock_init (sizeof(tcp_Socket), sizeof(udp_Socket), sizeof(time_t))
129
130W32_FUNC int W32_CALL watt_sock_init (size_t tcp_Sock_size,
131 size_t udp_Sock_size,
132 size_t time_t_size);
133
134W32_FUNC const char *W32_CALL sock_init_err (int rc);
135
136W32_FUNC void MS_CDECL sock_exit (void);
137W32_FUNC void W32_CALL dbug_init (void); /* effective if compiled with `USE_DEBUG' */
138W32_FUNC void W32_CALL init_misc (void); /* may be called before sock_init() */
139W32_FUNC void W32_CALL sock_sig_exit (const char *msg, int sigint);
140
141W32_FUNC void W32_CALL assert_fail_test (void);
142W32_FUNC void W32_CALL abort_test (void);
143W32_FUNC void W32_CALL leak_test (void);
144W32_FUNC void W32_CALL except_test (void);
145
146/*
147 * `s' is the pointer to a udp or tcp socket
148 */
149W32_FUNC int W32_CALL sock_read (sock_type *s, BYTE *dp, size_t len);
150W32_FUNC int W32_CALL sock_preread (const sock_type *s, BYTE *dp, int len);
151W32_FUNC int W32_CALL sock_fastread (sock_type *s, BYTE *dp, int len);
152W32_FUNC int W32_CALL sock_write (sock_type *s, const BYTE *dp, int len);
153W32_FUNC int W32_CALL sock_enqueue (sock_type *s, const BYTE *dp, int len);
154W32_FUNC int W32_CALL sock_fastwrite (sock_type *s, const BYTE *dp, int len);
155W32_FUNC size_t W32_CALL sock_setbuf (sock_type *s, BYTE *buf, size_t len);
156W32_FUNC void W32_CALL sock_flush (sock_type *s);
157W32_FUNC void W32_CALL sock_noflush (sock_type *s);
158W32_FUNC void W32_CALL sock_flushnext (sock_type *s);
159W32_FUNC int W32_CALL sock_puts (sock_type *s, const BYTE *dp);
160W32_FUNC WORD W32_CALL sock_gets (sock_type *s, BYTE *dp, int n);
161W32_FUNC BYTE W32_CALL sock_putc (sock_type *s, BYTE c);
162W32_FUNC int W32_CALL sock_getc (sock_type *s);
163W32_FUNC WORD W32_CALL sock_dataready (sock_type *s);
164W32_FUNC int W32_CALL sock_established(sock_type *s);
165W32_FUNC int W32_CALL sock_close (sock_type *s);
166W32_FUNC int W32_CALL sock_abort (sock_type *s);
167W32_FUNC WORD W32_CALL sock_mode (sock_type *s, WORD mode);
168W32_FUNC int W32_CALL sock_sselect (const sock_type *s, int waitstate);
169W32_FUNC int W32_CALL sock_timeout (sock_type *s, int seconds);
170W32_FUNC int W32_CALL sock_recv (sock_type *s, void *buf, unsigned len);
171W32_FUNC int W32_CALL sock_recv_init (sock_type *s, void *buf, unsigned len);
172W32_FUNC int W32_CALL sock_recv_from (sock_type *s, DWORD *ip, WORD *port, void *buf, unsigned len, int peek);
173W32_FUNC int W32_CALL sock_recv_used (const sock_type *s);
174W32_FUNC int W32_CALL sock_keepalive (sock_type *s);
175
176W32_FUNC size_t W32_CALL sock_rbsize (const sock_type *s);
177W32_FUNC size_t W32_CALL sock_rbused (const sock_type *s);
178W32_FUNC size_t W32_CALL sock_rbleft (const sock_type *s);
179W32_FUNC size_t W32_CALL sock_tbsize (const sock_type *s);
180W32_FUNC size_t W32_CALL sock_tbused (const sock_type *s);
181W32_FUNC size_t W32_CALL sock_tbleft (const sock_type *s);
182
183/* These 2 needs 'USE_BSD_API':
184 */
185W32_FUNC int W32_CALL sock_fgets (char *buf, int max, FILE *stream);
186W32_FUNC int W32_CALL sock_fputs (const char *text, FILE *stream);
187
188W32_FUNC VoidProc W32_CALL sock_yield (tcp_Socket *s, VoidProc fn);
189
190W32_FUNC int MS_CDECL sock_printf (sock_type *s, _Printf_format_string_ const char *fmt, ...) W32_ATTR_PRINTF(2, 3);
191
192W32_FUNC int MS_CDECL sock_scanf (sock_type *s, _Scanf_format_string_ const char *fmt, ...) W32_ATTR_SCANF(2, 3);
193
194/*
195 * TCP or UDP specific stuff, must be used for open's and listens, but
196 * sock stuff above is used for everything else
197 */
198W32_FUNC int W32_CALL udp_open (udp_Socket *s, WORD lport, DWORD ina, WORD port, ProtoHandler handler);
199W32_FUNC int W32_CALL tcp_open (tcp_Socket *s, WORD lport, DWORD ina, WORD port, ProtoHandler handler);
200W32_FUNC int W32_CALL udp_listen (udp_Socket *s, WORD lport, DWORD ina, WORD port, ProtoHandler handler);
201W32_FUNC int W32_CALL tcp_listen (tcp_Socket *s, WORD lport, DWORD ina, WORD port, ProtoHandler handler, WORD timeout);
202W32_FUNC int W32_CALL tcp_established (const tcp_Socket *s);
203
204/*
205 * Less general functions
206 */
207W32_FUNC int W32_CALL tcp_cbreak (int mode);
208W32_FUNC char *W32_CALL rip (char *s);
209W32_FUNC int W32_CALL watt_kbhit (void);
210W32_FUNC long W32_CALL watt_filelength (int fd);
211W32_FUNC int W32_CALL priv_addr (DWORD ip);
212
216W32_FUNC int W32_CALL tcp_cbrk (int mode);
217W32_FUNC unsigned long W32_CALL set_ttimeout (unsigned ticks);
218W32_FUNC WORD W32_CALL inchksum (const void *ptr, int len);
219
220/*
221 * Set MD5 secret for TCP option 19 (RFC-2385).
222 * Only if built with USE_TCP_MD5.
223 */
224W32_FUNC const char *W32_CALL tcp_md5_secret (tcp_Socket *s, const char *secret);
225
226W32_FUNC void W32_CALL make_md5_signature (const in_Header *ip,
227 const tcp_Header *tcp,
228 WORD datalen,
229 const char *secret,
230 BYTE *buf);
231
232W32_FUNC BOOL W32_CALL check_md5_signature (const tcp_Socket *s,
233 const in_Header *ip);
234
235/*
236 * timers
237 */
238W32_FUNC DWORD W32_CALL set_timeout (DWORD msec);
239W32_FUNC int W32_CALL chk_timeout (DWORD value);
240W32_FUNC int W32_CALL cmp_timers (DWORD t1, DWORD t2);
241W32_FUNC int W32_CALL set_timediff (long msec);
242W32_FUNC long W32_CALL get_timediff (DWORD now, DWORD t);
243W32_FUNC int W32_CALL hires_timer (int on);
244
245W32_FUNC double W32_CALL timeval_diff (const struct timeval *a, const struct timeval *b);
246W32_FUNC struct timeval W32_CALL timeval_diff2 (struct timeval *a, struct timeval *b);
247
248/* OpenWatcom (small/large) doesn't seems to define '__MSDOS__'.
249 */
250#if defined(__MSDOS__) || (defined(__WATCOMC__) && defined(MSDOS))
251 W32_FUNC void W32_CALL init_timer_isr (void);
252 W32_FUNC void W32_CALL exit_timer_isr (void);
253#endif
254
255W32_FUNC void W32_CALL init_userSuppliedTimerTick (void);
256W32_FUNC void W32_CALL userTimerTick (DWORD);
257
258W32_FUNC void W32_CALL ip_timer_init (sock_type *s, unsigned delayseconds);
259W32_FUNC int W32_CALL ip_timer_expired (const sock_type *s);
260
261/*
262 * TCP/IP system variables
263 */
264W32_DATA DWORD my_ip_addr;
265W32_DATA DWORD sin_mask; /* eg. 0xFFFFFE00L */
266W32_DATA int sock_delay;
267W32_DATA int sock_inactive;
268W32_DATA int sock_data_timeout;
269W32_DATA WORD multihomes;
270
271W32_DATA int block_tcp;
272W32_DATA int block_udp;
273W32_DATA int block_icmp;
274W32_DATA int block_ip;
275W32_DATA WORD last_cookie;
276W32_DATA DWORD Cookies [MAX_COOKIES];
277
278W32_DATA BOOL _watt_do_exit;
279W32_DATA BOOL survive_eth;
280W32_DATA BOOL survive_bootp;
281W32_DATA BOOL survive_dhcp;
282W32_DATA BOOL survive_rarp;
283
284W32_DATA unsigned tcp_OPEN_TO;
285W32_DATA unsigned tcp_CLOSE_TO;
286W32_DATA unsigned tcp_RTO_ADD;
287W32_DATA unsigned tcp_RTO_BASE;
288W32_DATA unsigned tcp_RTO_SCALE;
289W32_DATA unsigned tcp_RST_TIME;
290W32_DATA unsigned tcp_RETRAN_TIME;
291W32_DATA unsigned tcp_MAX_VJSA;
292W32_DATA unsigned tcp_MAX_VJSD;
293W32_DATA DWORD tcp_recv_win;
294
295W32_DATA int (W32_CALL *loopback_handler) (in_Header *ip);
296
297/*
298 * things you probably won't need to know about
299 */
300
301/*
302 * sock_debugdump
303 * - dump some socket control block parameters
304 * used for testing the kernal, not recommended
305 */
306W32_FUNC void W32_CALL sock_debugdump (const sock_type *s);
307
308/*
309 * tcp_config - read a configuration file
310 * - if special path desired, call after sock_init()
311 * - NULL reads path WATTCP.CFG env-var or from program's path
312 * see sock_init();
313 */
314W32_FUNC long W32_CALL tcp_config (const char *path);
315
316/*
317 * tcp_config_name - return name of configuration file.
318 */
319W32_FUNC int W32_CALL tcp_config_name (char *name, int max);
320
321/*
322 * tcp_tick - must be called periodically by user application.
323 * - returns NULL when our socket closes
324 */
325W32_FUNC WORD W32_CALL tcp_tick (sock_type *s);
326
327/*
328 * tcp_set_debug_state - set to 1,2 or reset 0
329 */
330W32_FUNC void W32_CALL tcp_set_debug_state (WORD x);
331
332
333/*
334 * name domain constants, etc.
335 */
336W32_DATA WORD dns_timeout;
337W32_DATA BOOL dns_recurse;
338W32_DATA WORD _watt_handle_cbreak; /* ^C/^Break handle mode */
339W32_DATA volatile int _watt_cbroke; /* ^C/^Break occured */
340W32_DATA unsigned _mtu, _mss;
341W32_DATA int ctrace_on;
342W32_DATA int debug_on;
343W32_DATA int has_rdtsc;
344W32_DATA DWORD clocks_per_usec;
345W32_DATA unsigned tcp_keep_idle;
346W32_DATA unsigned tcp_keep_intvl;
347W32_DATA unsigned tcp_max_idle;
348
349#if !defined(WATT32_NO_OLDIES)
350 /*
351 * Old compatibility stuff:
352 */
353 #define wathndlcbrk _watt_handle_cbreak
354 #define watcbroke _watt_cbroke
355
356 #if !defined(WATT32_BUILD)
357 #define inchksum(buf, len) in_checksum (buf, len)
358 #define tcp_cbrk(mode) tcp_cbreak (mode)
359 #endif
360#endif
361
362/*
363 * DNS stuff
364 */
365W32_DATA int (W32_CALL *_resolve_hook)(void);
366W32_DATA BOOL _resolve_exit;
367W32_DATA BOOL _resolve_timeout;
368
369W32_DATA char defaultdomain [MAX_HOSTLEN+1];
370W32_DATA char *def_domain;
371W32_DATA DWORD def_nameservers [MAX_NAMESERVERS];
372W32_DATA WORD last_nameserver;
373W32_DATA int dom_errno;
374
375W32_FUNC DWORD W32_CALL resolve (const char *name);
376W32_FUNC int W32_CALL resolve_ip (DWORD ip, char *name, int len);
377W32_FUNC int W32_CALL resolve_ip6 (const char *name, void *addr);
378W32_FUNC DWORD W32_CALL lookup_host (const char *host, char *ip_str);
379W32_FUNC const char *W32_CALL dom_strerror (int err);
380W32_FUNC char *W32_CALL dom_remove_dot(char *name);
381
382/*
383 * sock_wait_ .. macros
384 */
385
386/*
387 * sock_wait_established()
388 * - Waits until connected or aborts if timeout etc.
389 *
390 * sock_wait_input()
391 * - Waits for received input on socket 's'.
392 * - May not be valid input for sock_gets().. check returned length.
393 *
394 * sock_tick()
395 * - Do tick and jump on abort.
396 *
397 * sock_wait_closed()
398 * - Close socket and wait until fully closed.
399 * Discards all received data.
400 *
401 * All these macros jump to label sock_err with contents of *statusptr
402 * set to
403 * 1 on closed normally.
404 * -1 on error, call sockerr(s) for cause.
405 *
406 */
407W32_FUNC int W32_CALL _ip_delay0 (sock_type *s, int sec, UserHandler fn, int *statusptr);
408W32_FUNC int W32_CALL _ip_delay1 (sock_type *s, int sec, UserHandler fn, int *statusptr);
409W32_FUNC int W32_CALL _ip_delay2 (sock_type *s, int sec, UserHandler fn, int *statusptr);
410
411
412#define sock_wait_established(s, seconds, fn, statusptr) \
413 do { \
414 if (_ip_delay0 (s, seconds, fn, statusptr)) \
415 goto sock_err; \
416 } while (0)
417
418#define sock_wait_input(s, seconds, fn, statusptr) \
419 do { \
420 if (_ip_delay1 (s, seconds, fn, statusptr)) \
421 goto sock_err; \
422 } while (0)
423
424#define sock_tick(s, statusptr) \
425 do { \
426 if (!tcp_tick(s)) { \
427 if (statusptr) *statusptr = -1; \
428 goto sock_err; \
429 } \
430 } while (0)
431
432#define sock_wait_closed(s, seconds, fn, statusptr) \
433 do { \
434 if (_ip_delay2(s, seconds, fn, statusptr)) \
435 goto sock_err; \
436 } while (0)
437
438/*
439 * User hook for WATTCP.CFG initialisation file.
440 */
441W32_DATA void (W32_CALL *usr_init) (const char *keyword, const char *value);
442W32_DATA void (W32_CALL *usr_post_init) (void);
443
447enum config_tab_types {
448 ARG_ATOI,
449 ARG_ATOB,
450 ARG_ATOW,
451 ARG_ATOIP,
452 ARG_ATOX_B,
453 ARG_ATOX_W,
454 ARG_ATOX_D,
455 ARG_STRDUP,
456 ARG_STRCPY,
457 ARG_RESOLVE,
458 ARG_FUNC
459 };
460
461struct config_table {
462 const char *keyword;
463 enum config_tab_types type;
464 void *arg_func;
465 };
466
467
468W32_FUNC int W32_CALL parse_config_table (
469 const struct config_table *tab,
470 const char *section,
471 const char *name,
472 const char *value);
473
474/*
475 * Run with no config file (embedded/diskless)
476 */
477W32_DATA int _watt_no_config;
478
479W32_FUNC void W32_CALL tcp_inject_config (
480 const struct config_table *cfg,
481 const char *key,
482 const char *value);
483
484typedef long (W32_CALL * WattUserConfigFunc) (int pass, const struct config_table *cfg);
485
486W32_FUNC WattUserConfigFunc W32_CALL _watt_user_config (WattUserConfigFunc fn);
487
488
489/*
490 * Bypass standard handling of DHCP transient configuration
491 */
492W32_CLANG_PACK_WARN_OFF()
493
494#include <sys/pack_on.h>
495
496struct DHCP_config {
497 DWORD my_ip;
498 DWORD netmask;
499 DWORD gateway;
500 DWORD nameserver;
501 DWORD server;
502 DWORD iplease;
503 DWORD renewal;
504 DWORD rebind;
505 DWORD tcp_keep_intvl;
506 BYTE default_ttl;
507 char _hostname [MAX_HOSTLEN+1];
508 char domain [MAX_HOSTLEN+1];
509 char loghost [MAX_HOSTLEN+1]; /* Only used if USE_BSD_FUNC defined */
510 };
511
512#include <sys/pack_off.h>
513
514W32_CLANG_PACK_WARN_DEF()
515
516enum DHCP_config_op {
517 DHCP_OP_READ = 0,
518 DHCP_OP_WRITE = 1,
519 DHCP_OP_ERASE = 2
520 };
521
522W32_DATA BOOL DHCP_did_gratuitous_arp;
523
524typedef int (W32_CALL * WattDHCPConfigFunc) (enum DHCP_config_op op,
525 struct DHCP_config *cfg);
526
527W32_FUNC WattDHCPConfigFunc W32_CALL DHCP_set_config_func (WattDHCPConfigFunc fn);
528
529W32_FUNC void W32_CALL DHCP_release (BOOL force);
530W32_FUNC int W32_CALL DHCP_read_config (void);
531W32_FUNC DWORD W32_CALL DHCP_get_server (void);
532
533/*
534 * Various function-pointer hooks etc.
535 */
536W32_DATA int (MS_CDECL *_printf) (_Printf_format_string_ const char *, ...) W32_ATTR_PRINTF(1, 2);
537
538W32_DATA int (W32_CALL *_outch) (char c);
539W32_DATA void (W32_CALL *wintr_chain) (void);
540W32_DATA int (W32_CALL *_tftp_write) (const void *buf, size_t length);
541W32_DATA int (W32_CALL *_tftp_close) (void);
542
543W32_FUNC void W32_CALL outs (const char *s);
544W32_FUNC void W32_CALL outsnl (const char *s);
545W32_FUNC void W32_CALL outsn (const char *s, int n);
546W32_FUNC void W32_CALL outhexes(const char *s, int n);
547W32_FUNC void W32_CALL outhex (char ch);
548
549W32_FUNC int W32_CALL wintr_enable (void);
550W32_FUNC void W32_CALL wintr_disable (void);
551W32_FUNC void W32_CALL wintr_shutdown (void);
552W32_FUNC void W32_CALL wintr_init (void);
553
554W32_FUNC int W32_CALL _ping (DWORD host, DWORD num, const BYTE *pattern, size_t len);
555W32_FUNC DWORD W32_CALL _chk_ping (DWORD host, DWORD *ping_num);
556W32_FUNC void W32_CALL add_ping (DWORD host, DWORD tim, DWORD number);
557
558W32_FUNC int W32_CALL _eth_init (void);
559W32_FUNC void W32_CALL _eth_release (void);
560W32_FUNC void *W32_CALL _eth_formatpacket (const void *eth_dest, WORD eth_type);
561W32_FUNC void W32_CALL _eth_free (const void *buf);
562W32_FUNC void *W32_CALL _eth_arrived (WORD *type, BOOL *brdcast);
563W32_FUNC int W32_CALL _eth_send (WORD len, const void *sock, const char *file, unsigned line);
564W32_FUNC int W32_CALL _eth_set_addr (const void *addr);
565W32_FUNC BYTE W32_CALL _eth_get_hwtype (BYTE *hwtype, BYTE *hwlen);
566
567W32_DATA void *(W32_CALL *_eth_recv_hook) (WORD *type);
568W32_DATA int (W32_CALL *_eth_recv_peek) (void *mac_buf);
569W32_DATA int (W32_CALL *_eth_xmit_hook) (const void *buf, unsigned len);
570
571W32_FUNC WORD W32_CALL in_checksum (const void *buf, unsigned len);
572
573/*
574 * Some applications (tracert.c) may need pcarp.c functions.
575 */
576W32_FUNC BOOL W32_CALL _arp_resolve (DWORD ina, eth_address *eth);
577
578/*
579 * Stuff for Windows only
580 */
581#if defined(WATT32_ON_WINDOWS)
582 W32_FUNC int MS_CDECL gui_printf (const char *fmt, ...);
583 W32_FUNC char * W32_CALL win_strerror (DWORD err);
584
585 W32_FUNC int W32_CALL pkt_win_set_verbose_level (int level);
586 W32_FUNC int W32_CALL pkt_win_get_verbose_level (void);
587
588 W32_FUNC int W32_CALL pkt_win_print_GetIfTable (void);
589 W32_FUNC int W32_CALL pkt_win_print_GetIfTable2 (void);
590 W32_FUNC int W32_CALL pkt_win_print_GetIfTable2Ex (void);
591 W32_FUNC int W32_CALL pkt_win_print_GetIpNetTable (void);
592 W32_FUNC int W32_CALL pkt_win_print_GetIpNetTable2 (void);
593 W32_FUNC int W32_CALL pkt_win_print_GetIpAddrTable (void);
594 W32_FUNC int W32_CALL pkt_win_print_GetIpForwardTable2 (void);
595 W32_FUNC int W32_CALL pkt_win_print_GetAdaptersAddresses (void);
596 W32_FUNC int W32_CALL pkt_win_print_GetAdapterOrderMap (void);
597 W32_FUNC int W32_CALL pkt_win_print_GetNetworkParams (void);
598
599 W32_FUNC int W32_CALL pkt_win_print_RasEnumConnections (void);
600 W32_FUNC int W32_CALL pkt_win_print_WlanEnumInterfaces (void);
601 W32_FUNC int W32_CALL pkt_win_print_WSALookupServices (void);
602#endif
603
604/*
605 * BSD-socket similarities.
606 * Refer <sys/socket.h> for the real thing.
607 */
608
609struct watt_sockaddr { /* for _getpeername, _getsockname */
610 WORD s_type;
611 WORD s_port;
612 DWORD s_ip;
613 BYTE s_spares[6]; /* unused */
614 };
615
616enum CHK_SOCKET_VAL { /* ret-vals from _chk_socket() */
617 VALID_UDP = 1,
618 VALID_TCP,
619 VALID_IP4,
620 VALID_IP6
621 };
622
623W32_FUNC DWORD W32_CALL _gethostid (void);
624W32_FUNC DWORD W32_CALL _sethostid (DWORD ip);
625W32_FUNC int W32_CALL _getsockname (const sock_type *s, void *dest, int *len);
626W32_FUNC int W32_CALL _getpeername (const sock_type *s, void *dest, int *len);
627
628W32_FUNC int W32_CALL _chk_socket (const sock_type *s);
629W32_FUNC void W32_CALL psocket (const sock_type *s);
630W32_FUNC void W32_CALL sock_sturdy (sock_type *s, int level);
631W32_FUNC const char * W32_CALL sockerr (const sock_type *s); /* UDP / TCP */
632W32_FUNC void W32_CALL sockerr_clear(sock_type *s); /* UDP / TCP */
633W32_FUNC const char * W32_CALL sockstate (const sock_type *s); /* UDP / TCP / Raw */
634
635/*
636 * Reduce internal states to "user-easy" states, GvB 2002-09
637 */
638enum TCP_SIMPLE_STATE {
639 TCP_CLOSED,
640 TCP_LISTENING,
641 TCP_OPENING,
642 TCP_OPEN,
643 TCP_CLOSING
644 };
645
646W32_FUNC enum TCP_SIMPLE_STATE W32_CALL tcp_simple_state (const tcp_Socket *s);
647
648W32_FUNC char *W32_CALL _inet_ntoa (char *s, DWORD x);
649W32_FUNC DWORD W32_CALL _inet_addr (const char *name);
650W32_FUNC DWORD W32_CALL aton (const char *name);
651W32_FUNC int W32_CALL isaddr (const char *name);
652W32_FUNC DWORD W32_CALL aton_dotless (const char *str);
653W32_FUNC BOOL W32_CALL isaddr_dotless (const char *str, DWORD *ip);
654
655W32_FUNC int W32_CALL addwattcpd (VoidProc p);
656W32_FUNC int W32_CALL delwattcpd (VoidProc p);
657W32_FUNC void W32_CALL stopwattcpd (void);
658
659/*
660 * BSD functions for read/write/select
661 */
662W32_FUNC int W32_CALL close_s (int s);
663W32_FUNC int W32_CALL write_s (int s, const char *buf, int nbyte);
664W32_FUNC int W32_CALL read_s (int s, char *buf, int nbyte);
665W32_FUNC int W32_CALL writev_s (int s, const struct iovec *vector, size_t count);
666W32_FUNC int W32_CALL readv_s (int s, const struct iovec *vector, size_t count);
667
668W32_FUNC int W32_CALL select_s (int num_sockets,
669 fd_set *read_events,
670 fd_set *write_events,
671 fd_set *except_events,
672 struct timeval *timeout);
673
674/* Some BSD/Winsock replacements.
675 * Normally belongs in djgpp's <unistd.h>.
676 *
677 * When compiling ../src/winadif.c, these prototypes conflicts with the
678 * one in <winsock*.h>.
679 *
680 * Note: gethostname() is also in <sys/socket.h>
681 */
682#if !defined(__DJGPP__) && !defined(WATT32_COMPILING_WINADINF_C)
683 W32_FUNC int W32_CALL select (int num_sockets,
684 fd_set *read_events,
685 fd_set *write_events,
686 fd_set *except_events,
687 struct timeval *timeout);
688#endif
689
690#if defined(__DJGPP__)
691 W32_FUNC int W32_CALL gethostname (char *name, int len);
692
693#elif !defined(WATT32_COMPILING_WINADINF_C)
694 W32_FUNC int W32_CALL gethostname (char *name, size_t len);
695#endif
696
697#if defined(__CYGWIN__)
698 /* CygWin's <unistd.h> doesn't agree with other vendors here.
699 */
700 W32_FUNC long W32_CALL gethostid (void);
701 W32_FUNC long W32_CALL sethostid (u_long ip);
702 W32_FUNC int W32_CALL sethostname (const char *name, size_t len);
703#else
704 W32_FUNC u_long W32_CALL gethostid (void);
705 W32_FUNC u_long W32_CALL sethostid (u_long ip);
706 W32_FUNC int W32_CALL sethostname (const char *name, int len);
707#endif
708
709/*
710 * Multicast stuff (if built with `USE_MULTICAST')
711 */
712W32_DATA int _multicast_on, _multicast_intvl;
713
714W32_FUNC int W32_CALL join_mcast_group (DWORD ip);
715W32_FUNC int W32_CALL leave_mcast_group (DWORD ip);
716W32_FUNC int W32_CALL multi_to_eth (DWORD ip, eth_address *eth);
717W32_FUNC int W32_CALL udp_SetTTL (udp_Socket *s, BYTE ttl);
718W32_FUNC int W32_CALL num_mcast_active (void);
719
720/*
721 * Commandline parsing.
722 *
723 * The tricky part is that all the below headers declare getopt().
724 * So we fall back to the watt_getopt() in Watt-32 for others who doesn't
725 * have it. But we must allways export / define getopt.c functions and
726 * data.
727 */
728#if defined(__DJGPP__)
729 #include <unistd.h>
730 #include <dos.h> /* struct time */
731 #define WATT32_NO_GETOPT
732
733#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1250) /* OW 1.5+ */
734 #include <unistd.h>
735 #define WATT32_NO_GETOPT
736
737#elif defined(__MINGW32__) || defined(__CYGWIN__)
738 #include <unistd.h>
739 #include <getopt.h>
740 #define WATT32_NO_GETOPT
741#endif
742
743enum _watt_optmode {
744 GETOPT_UNIX, /* options at start of argument list (default) */
745 GETOPT_ANY, /* move non-options to the end */
746 GETOPT_KEEP /* return options in order */
747 };
748
749W32_DATA char *watt_optarg; /* argument of current option */
750W32_DATA int watt_optind; /* index of next argument; default=0: initialize */
751W32_DATA int watt_opterr; /* 0=disable error messages; default=1: enable */
752W32_DATA int watt_optopt; /* option char returned from getopt() */
753W32_DATA char *watt_optswchar; /* characters introducing options; default="-" */
754
755W32_FUNC int W32_CALL watt_getopt (int argc, char *const *argv, const char *opt_str);
756
757#if !defined(WATT32_NO_GETOPT)
758 #define optarg watt_optarg
759 #define optind watt_optind
760 #define opterr watt_opterr
761 #define optopt watt_optopt
762 #define optswchar watt_optswchar
763 #define getopt watt_getopt
764#endif
765
766#if defined(WATT32_ON_WINDOWS)
770 W32_DATA wchar_t * _w_watt_optarg;
771 W32_DATA wchar_t * _w_watt_optswchar;
772 W32_FUNC int W32_CALL _w_watt_getopt (int argc, wchar_t *const *argv, const wchar_t *opt_str);
773#endif
774
775/*
776 * Statistics printing
777 */
778W32_FUNC void W32_CALL print_mac_stats (void);
779W32_FUNC void W32_CALL print_pkt_stats (void);
780W32_FUNC void W32_CALL print_vjc_stats (void);
781W32_FUNC void W32_CALL print_arp_stats (void);
782W32_FUNC void W32_CALL print_pppoe_stats(void);
783W32_FUNC void W32_CALL print_ip4_stats (void);
784W32_FUNC void W32_CALL print_ip6_stats (void);
785W32_FUNC void W32_CALL print_icmp_stats (void);
786W32_FUNC void W32_CALL print_igmp_stats (void);
787W32_FUNC void W32_CALL print_udp_stats (void);
788W32_FUNC void W32_CALL print_tcp_stats (void);
789W32_FUNC void W32_CALL print_cache_stats(void);
790W32_FUNC void W32_CALL print_rarp_stats (void);
791W32_FUNC void W32_CALL print_icmp6_stats(void);
792W32_FUNC void W32_CALL print_all_stats (void);
793W32_FUNC void W32_CALL reset_stats (void);
794
795W32_FUNC int W32_CALL sock_stats (sock_type *s, DWORD *days, WORD *inactive,
796 WORD *cwindow, DWORD *avg, DWORD *sd);
797
798/*
799 * PktDrvr/WinPcap interface
800 */
801
802/*\struct PktStats
803 *
804 * Driver statistics.
805 */
806struct PktStats {
807 DWORD in_packets; /* # of packets received */
808 DWORD out_packets; /* # of packets transmitted */
809 DWORD in_bytes; /* # of bytes received */
810 DWORD out_bytes; /* # of bytes transmitted */
811 DWORD in_errors; /* # of reception errors */
812 DWORD out_errors; /* # of transmission errors */
813 DWORD lost; /* # of packets lost (RX) */
814 };
815
816#if defined(WATT32_ON_WINDOWS)
820 #define PDCLASS_ETHER 0
821 #define PDCLASS_TOKEN 1
822 #define PDCLASS_FDDI 2
823 #define PDCLASS_ARCNET 6
824 #define PDCLASS_SLIP 0xFF01
825 #define PDCLASS_AX25 0xFF02
826 #define PDCLASS_TOKEN_RIF 0xFF03
827 #define PDCLASS_PPP 0xFF04
828 #define PDCLASS_UNKNOWN 0xFFFF
829
830 struct PktParameters {
831 int dummy; /* To be defined */
832 };
833#else
834
838 #define PDCLASS_ETHER 1
839 #define PDCLASS_TOKEN 3
840 #define PDCLASS_SLIP 6
841 #define PDCLASS_ARCNET 8
842 #define PDCLASS_AX25 9
843 #define PDCLASS_FDDI 12
844 #define PDCLASS_TOKEN_RIF 17
845 #define PDCLASS_PPP 18
846 #define PDCLASS_UNKNOWN 0xFFFF
847
848 #include <sys/pack_on.h> /* cstate, slcompress etc. must be packed */
849
850 /*\struct PktParameters
851 *
852 * PKTDRVR parameters.
853 */
854 struct PktParameters {
855 BYTE major_rev; /* Revision of Packet Driver spec */
856 BYTE minor_rev; /* this driver conforms to. */
857 BYTE length; /* Length of structure in bytes */
858 BYTE addr_len; /* Length of a MAC-layer address */
859 WORD mtu; /* MTU, including MAC headers */
860 WORD multicast_avail; /* Buffer size for multicast addr */
861 WORD rcv_bufs; /* (# of back-to-back MTU rcvs) - 1 */
862 WORD xmt_bufs; /* (# of successive xmits) - 1 */
863 WORD int_num; /* interrupt for post-EOI processing */
864 };
865
866 #include <sys/pack_off.h>
867#endif
868
869W32_FUNC int W32_CALL pkt_eth_init (mac_address *eth);
870W32_FUNC int W32_CALL pkt_release (void);
871W32_FUNC int W32_CALL pkt_reset_handle (WORD handle);
872W32_FUNC int W32_CALL pkt_send (const void *tx, int length);
873W32_FUNC int W32_CALL pkt_buf_wipe (void);
874W32_FUNC void W32_CALL pkt_free_pkt (const void *pkt);
875W32_FUNC int W32_CALL pkt_waiting (void);
876W32_FUNC int W32_CALL pkt_set_addr (const void *eth);
877W32_FUNC int W32_CALL pkt_get_addr (mac_address *eth);
878W32_FUNC int W32_CALL pkt_get_mtu (void);
879W32_FUNC int W32_CALL pkt_get_drvr_ver (WORD *major, WORD *minor, WORD *unused, WORD *build);
880W32_FUNC int W32_CALL pkt_get_api_ver (WORD *ver);
881W32_FUNC int W32_CALL pkt_set_rcv_mode (int mode);
882W32_FUNC int W32_CALL pkt_get_rcv_mode (void);
883W32_FUNC BOOL W32_CALL pkt_check_address (DWORD my_ip);
884W32_FUNC BOOL W32_CALL pkt_is_init (void);
885W32_FUNC int W32_CALL pkt_get_params (struct PktParameters *params);
886W32_FUNC int W32_CALL pkt_get_stats (struct PktStats *stats, struct PktStats *total);
887W32_FUNC DWORD W32_CALL pkt_dropped (void);
888W32_FUNC int W32_CALL pkt_get_vector (void);
889
890W32_FUNC const char * W32_CALL pkt_strerror (int code);
891W32_FUNC const char * W32_CALL pkt_get_device_name (void); /* "\Device\NPF_{..." */
892W32_FUNC const char * W32_CALL pkt_get_drvr_name (void); /* NPF.SYS/SwsVpkt.sys/airpcap.sys etc. */
893W32_FUNC const char * W32_CALL pkt_get_drvr_descr (void); /* Driver description */
894W32_FUNC WORD W32_CALL pkt_get_drvr_class (void); /* Driver class */
895
896/*
897 * Controlling timer interrupt handler for background processing.
898 * Not recommended, little tested and not for Windows.
899 */
900W32_FUNC void W32_CALL backgroundon (void);
901W32_FUNC void W32_CALL backgroundoff (void);
902W32_FUNC void W32_CALL backgroundfn (VoidProc func);
903
904/*
905 * Misc internal or deprecated functions:
906 */
907W32_FUNC int W32_CALL _w32_kbhit (void);
908W32_FUNC int W32_CALL _w32_getch (void);
909W32_FUNC char * W32_CALL _w32_itoa (int value, char *buf, int radix);
910W32_FUNC const char *W32_CALL _w32_inet_ntop (int af, const void *src, char *dst, size_t size);
911W32_FUNC int W32_CALL _w32_inet_pton (int af, const char *src, void *dst);
912W32_FUNC WORD W32_CALL _w32_inchksum (const void *ptr, int len);
913W32_FUNC const char *W32_CALL _w32_ExpandVarStr (const char *str);
914W32_FUNC int W32_CALL _w32_ffs (int i);
915
916#if !defined(__DJGPP__) && !defined(__CYGWIN__) && \
917 !(defined(__WATCOMC__) && (__WATCOMC__ >= 1240))
918 W32_FUNC int W32_CALL ffs (int mask);
919#endif
920
921#if defined(__HIGHC__)
922 W32_FUNC int W32_CALL system (const char *cmd);
923 pragma Alias (system, "_mw_watt_system");
924#endif
925
926#if defined(__HIGHC__) || (defined(__DMC__) && defined(__MSDOS__))
927 W32_FUNC void W32_CALL delay (unsigned int msec);
928#endif
929
930#if defined(__DJGPP__) || defined(__DMC__)
931 W32_FUNC time_t W32_CALL dostounix (const struct date *d, const struct time *t);
932 W32_FUNC void W32_CALL unixtodos (time_t time, struct date *d, struct time *t);
933#endif
934
935W32_FUNC unsigned W32_CALL Random (unsigned a, unsigned b);
936W32_FUNC void W32_CALL RandomWait (unsigned a, unsigned b);
937
938#ifdef __cplusplus
939}
940#endif
941
942#endif /* RC_INVOKED */
943#endif /* __WATT_TCP_H */
sethostname
int W32_CALL sethostname(const char *fqdn, SETHOSTNAME_ARG2 len)
BSD-style: Expects a "Fully Qualified Domain Name" in ‘fqdn’.
Definition: bsdname.c:292
cdefs.h
pack_off.h
pack_on.h
defaultdomain
char defaultdomain[MAX_HOSTLEN+1]
The 2 next variables are loaded from WATTCP.CFG file.
Definition: pcdns.c:71
_eth_recv_hook
void *W32_CALL * _eth_recv_hook(WORD *type)
Pointer to functions that when set changes the behaviour of polling and send functions _eth_arrived()...
tcp_recv_win
DWORD tcp_recv_win
RWIN for BSD sockets only.
Definition: pctcp.c:138
block_ip
BOOL block_ip
when application handles IP itself
Definition: pctcp.c:67
tcp_OPEN_TO
unsigned tcp_OPEN_TO
TCP timer values.
Definition: pctcp.c:116
tcp_max_idle
unsigned tcp_max_idle
max idle time before kill
Definition: pctcp.c:137
tcp_CLOSE_TO
unsigned tcp_CLOSE_TO
Default close timeout.
Definition: pctcp.c:117
block_udp
BOOL block_udp
when application handles UDP itself
Definition: pctcp.c:65
tcp_RST_TIME
unsigned tcp_RST_TIME
Don't generate RST too often.
Definition: pctcp.c:121
tcp_RETRAN_TIME
unsigned tcp_RETRAN_TIME
Default retransmission time.
Definition: pctcp.c:122
block_icmp
BOOL block_icmp
when application handles ICMP itself
Definition: pctcp.c:66
tcp_keep_intvl
unsigned tcp_keep_intvl
time between keepalive probes
Definition: pctcp.c:136
tcp_MAX_VJSA
unsigned tcp_MAX_VJSA
Default max VJ std.
Definition: pctcp.c:123
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
tcp_RTO_SCALE
unsigned tcp_RTO_SCALE
Scaling used in RTO calculation.
Definition: pctcp.c:120
tcp_RTO_BASE
unsigned tcp_RTO_BASE
Base time for RTO calculation.
Definition: pctcp.c:119
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
tcp_RTO_ADD
unsigned tcp_RTO_ADD
Time added in RTO calculation.
Definition: pctcp.c:118
block_tcp
BOOL block_tcp
when application handles TCP itself
Definition: pctcp.c:64
tcp_MAX_VJSD
unsigned tcp_MAX_VJSD
Default max VJ std.
Definition: pctcp.c:124
udp_SetTTL
int W32_CALL udp_SetTTL(_udp_Socket *s, BYTE ttl)
Set the TTL on an outgoing UDP datagram.
Definition: pctcp.c:309
tcp_keep_idle
unsigned tcp_keep_idle
idle time before sending keepalive
Definition: pctcp.c:135
_watt_no_config
BOOL _watt_no_config
run with no config file (embedded/diskless)
Definition: sock_ini.c:134
survive_bootp
BOOL survive_bootp
Survive a failed BOOTP attempt.
Definition: sock_ini.c:146
survive_rarp
BOOL survive_rarp
Don't survive a failed RARP attempt.
Definition: sock_ini.c:157
_watt_do_exit
BOOL _watt_do_exit
exit program when all boot attempts failed
Definition: sock_ini.c:136
PktParameters
Definition: tcp.h:830
PktStats
Definition: tcp.h:806
code
Definition: zinftree.h:24
config_table
Definition: tcp.h:461
fd_set
Definition: wtypes.h:256
in_Header
Definition: wattcp.h:329
iovec
Definition: wtypes.h:222
rip
Definition: routed.h:111
tcp_Header
Definition: wattcp.h:418
tcp_Socket
Definition: wattcp.h:584
timeval
Definition: wtime.h:30
udp_Header
Definition: wattcp.h:406
udp_Socket
ARP definitions.
Definition: tcp.h:87
watt_sockaddr
Definition: tcp.h:609
swap.h
survive_eth
W32_DATA BOOL survive_eth
GvB 2002-09, allows us to survive without a (working) packet driver at all - in cases where life stil...
Definition: tcp.h:279
tcp_cbreak
W32_FUNC int W32_CALL tcp_cbreak(int mode)
Sets our break mode.
Definition: pc_cbrk.c:208
add_ping
W32_FUNC void W32_CALL add_ping(DWORD host, DWORD tim, DWORD number)
Add an ICMP echo reply to the ping-cache.
Definition: pcping.c:147
_arp_resolve
W32_FUNC BOOL W32_CALL _arp_resolve(DWORD ina, eth_address *eth)
The blocking lookup function visible to higher functions.
Definition: pcarp.c:1278
survive_dhcp
W32_DATA BOOL survive_dhcp
Survive a failed DHCP attempt.
Definition: tcp.h:281
parse_config_table
W32_FUNC int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
sock_exit
W32_FUNC void MS_CDECL sock_exit(void)
Our only atexit() handler.
Definition: sock_ini.c:1058
_watt_handle_cbreak
W32_DATA WORD _watt_handle_cbreak
Turn off stack-checking here because stack may be out of bounds.
Definition: tcp.h:338
cmp_timers
W32_FUNC int W32_CALL cmp_timers(DWORD t1, DWORD t2)
Compare two timers with expirary at 't1' and 't2'.
Definition: timer.c:358
set_timediff
W32_FUNC int W32_CALL set_timediff(long msec)
Must be called by user right before or after a time change occurs.
Definition: timer.c:606
DHCP_set_config_func
W32_FUNC WattDHCPConfigFunc W32_CALL DHCP_set_config_func(WattDHCPConfigFunc fn)
Sets up an application hook for doing DHCP operations (DHCP_config_op)
Definition: pcdhcp.c:1865
aton
W32_FUNC DWORD W32_CALL aton(const char *name)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
Definition: netaddr.c:86
DHCP_get_server
W32_FUNC DWORD W32_CALL DHCP_get_server(void)
Return current DHCP server address.
Definition: pcdhcp.c:764
pkt_get_mtu
W32_FUNC int W32_CALL pkt_get_mtu(void)
Return PKTDRVR maximum-transmit-units (MTU).
Definition: pcpkt.c:488
pkt_release
W32_FUNC int W32_CALL pkt_release(void)
Definition: pcpkt.c:837
_getpeername
W32_FUNC int W32_CALL _getpeername(const sock_type *s, void *dest, int *len)
Core-style: Return 'watt_sockaddr' for peer in a UDP/TCP connection.
Definition: bsdname.c:112
_eth_formatpacket
W32_FUNC void *W32_CALL _eth_formatpacket(const void *eth_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
set_ttimeout
W32_FUNC unsigned long W32_CALL set_ttimeout(unsigned ticks)
Definition: oldstuff.c:36
wattcpBuildCCexe
W32_FUNC const char *W32_CALL wattcpBuildCCexe(void)
Return the the name if the compiler used.
Definition: version.c:543
Random
W32_FUNC unsigned W32_CALL Random(unsigned a, unsigned b)
Returns a random integer in range [a..b].
Definition: misc.c:743
sock_puts
W32_FUNC int W32_CALL sock_puts(sock_type *s, const BYTE *dp)
Definition: sock_io.c:39
pkt_set_rcv_mode
W32_FUNC int W32_CALL pkt_set_rcv_mode(int mode)
Sets the receive mode of the interface.
Definition: pcpkt.c:1953
pkt_send
W32_FUNC int W32_CALL pkt_send(const void *tx, int length)
Send a link-layer frame.
Definition: pcpkt.c:1087
isaddr_dotless
W32_FUNC BOOL W32_CALL isaddr_dotless(const char *str, DWORD *ip)
Check if 'str' is a dotless ip address.
Definition: netaddr.c:148
_watt_user_config
W32_FUNC WattUserConfigFunc W32_CALL _watt_user_config(WattUserConfigFunc fn)
A user application may call the ‘_watt_user_config()’ function prior to calling sock_init() to inject...
Definition: sock_ini.c:200
sethostid
W32_FUNC long W32_CALL sethostid(u_long ip)
BSD-style: Sets local IPv4-address.
Definition: bsdname.c:79
pkt_get_vector
W32_FUNC int W32_CALL pkt_get_vector(void)
Return PKTDRVR vector.
Definition: pcpkt.c:545
win_strerror
W32_FUNC char *W32_CALL win_strerror(DWORD err)
Return err-number and string for 'err'.
Definition: winmisc.c:208
timeval_diff
W32_FUNC double W32_CALL timeval_diff(const struct timeval *a, const struct timeval *b)
Return difference (in micro-sec) between timevals *newer and *older.
Definition: timer.c:638
config_tab_types
config_tab_types
Convert 'arg_func' below to this type.
Definition: tcp.h:447
ARG_RESOLVE
@ ARG_RESOLVE
resolve host to IPv4-address
Definition: tcp.h:457
ARG_STRCPY
@ ARG_STRCPY
copy string value
Definition: tcp.h:456
ARG_STRDUP
@ ARG_STRDUP
duplicate string value
Definition: tcp.h:455
ARG_ATOX_D
@ ARG_ATOX_D
convert to hex-dword
Definition: tcp.h:454
ARG_ATOIP
@ ARG_ATOIP
convert to ip-address (host order)
Definition: tcp.h:451
ARG_ATOX_W
@ ARG_ATOX_W
convert to hex-word
Definition: tcp.h:453
ARG_ATOB
@ ARG_ATOB
convert to 8-bit byte
Definition: tcp.h:449
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
ARG_ATOW
@ ARG_ATOW
convert to 16-bit word
Definition: tcp.h:450
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
ARG_ATOX_B
@ ARG_ATOX_B
convert to hex-byte
Definition: tcp.h:452
pkt_get_api_ver
W32_FUNC int W32_CALL pkt_get_api_ver(WORD *ver)
Return version of spec.
Definition: pcpkt.c:518
pkt_get_addr
W32_FUNC int W32_CALL pkt_get_addr(mac_address *eth)
Return the MAC address.
Definition: pcpkt.c:1156
pkt_dropped
W32_FUNC DWORD W32_CALL pkt_dropped(void)
Return number of packets dropped.
Definition: pcpkt.c:1391
priv_addr
W32_FUNC int W32_CALL priv_addr(DWORD ip)
Definition: netaddr.c:516
_sethostid
W32_FUNC DWORD W32_CALL _sethostid(DWORD ip)
Core-style: Sets local IPv4-address.
Definition: bsdname.c:58
pkt_get_rcv_mode
W32_FUNC int W32_CALL pkt_get_rcv_mode(void)
Gets the receive mode of the interface (can never be mode 0).
Definition: pcpkt.c:1997
tcp_listen
W32_FUNC int W32_CALL tcp_listen(tcp_Socket *s, WORD lport, DWORD ina, WORD port, ProtoHandler handler, WORD timeout)
Passively opens TCP a connection.
Definition: pctcp.c:407
get_timediff
W32_FUNC long W32_CALL get_timediff(DWORD now, DWORD t)
Return time difference between timers now and tim.
Definition: timer.c:620
dom_strerror
W32_FUNC const char *W32_CALL dom_strerror(int err)
Return text for error code (dom_errno).
Definition: pcdns.c:742
tcp_open
W32_FUNC int W32_CALL tcp_open(tcp_Socket *s, WORD lport, DWORD ina, WORD port, ProtoHandler handler)
Actively open a TCP connection.
Definition: pctcp.c:328
pkt_reset_handle
W32_FUNC int W32_CALL pkt_reset_handle(WORD handle)
Reset the driver-state associated with handle.
Definition: pcpkt.c:726
_eth_send
W32_FUNC int W32_CALL _eth_send(WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
Definition: pcsed.c:301
hires_timer
W32_FUNC int W32_CALL hires_timer(int on)
Control use of high-resolution timer.
Definition: timer.c:377
gethostid
W32_FUNC long W32_CALL gethostid(void)
BSD style: returns local IPv4-address.
Definition: bsdname.c:68
pkt_buf_wipe
W32_FUNC int W32_CALL pkt_buf_wipe(void)
Clear the receive queue.
Definition: pcpkt.c:1331
isaddr
W32_FUNC int W32_CALL isaddr(const char *name)
Check if 'str' is simply an ip address.
Definition: netaddr.c:128
_eth_set_addr
W32_FUNC int W32_CALL _eth_set_addr(const void *addr)
Sets a new MAC address for our interface.
Definition: pcsed.c:712
_w_watt_optarg
W32_DATA wchar_t * _w_watt_optarg
Definition: tcp.h:770
init_misc
W32_FUNC void W32_CALL init_misc(void)
Initialise various stuff.
Definition: misc.c:345
_inet_addr
W32_FUNC DWORD W32_CALL _inet_addr(const char *name)
Convert a string into an IP-address.
Definition: netaddr.c:70
select_s
W32_FUNC int W32_CALL select_s(int num_sockets, fd_set *read_events, fd_set *write_events, fd_set *except_events, struct timeval *timeout)
The select_s() function.
Definition: select.c:107
_inet_ntoa
W32_FUNC char *W32_CALL _inet_ntoa(char *s, DWORD x)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
sock_sig_exit
W32_FUNC void W32_CALL sock_sig_exit(const char *msg, int sigint)
Exit handler for unhandled signals.
Definition: sock_ini.c:1076
_getsockname
W32_FUNC int W32_CALL _getsockname(const sock_type *s, void *dest, int *len)
Core-style: Return 'watt_sockaddr' for our side of a UDP/TCP connection.
Definition: bsdname.c:147
pkt_free_pkt
W32_FUNC void W32_CALL pkt_free_pkt(const void *pkt)
Release a packet from the receive queue.
Definition: pcpkt.c:1346
RandomWait
W32_FUNC void W32_CALL RandomWait(unsigned a, unsigned b)
Wait for a random period in range [a..b] millisec.
Definition: misc.c:760
in_checksum
W32_FUNC WORD W32_CALL in_checksum(const void *buf, unsigned len)
This checksum routine is now used for all targets since in_checksum_fast() was removed.
Definition: chksum.c:24
wattcpVersion
W32_FUNC const char *W32_CALL wattcpVersion(void)
Return string for Watt-32 version.
Definition: version.c:77
sock_sturdy
W32_FUNC void W32_CALL sock_sturdy(sock_type *s, int level)
Keep the socket open inspite of receiving "ICMP Unreachable" For UDP or TCP socket.
Definition: oldstuff.c:71
_eth_free
W32_FUNC void W32_CALL _eth_free(const void *buf)
Free an input buffer once it is no longer needed.
Definition: pcsed.c:769
_ping
W32_FUNC int W32_CALL _ping(DWORD host, DWORD num, const BYTE *pattern, size_t len)
Format and send an ICMP echo request (ping).
Definition: pcping.c:45
sock_dataready
W32_FUNC WORD W32_CALL sock_dataready(sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
Definition: sock_io.c:246
DHCP_release
W32_FUNC void W32_CALL DHCP_release(BOOL force)
Possibly send a DHCP release.
Definition: pcdhcp.c:732
_eth_release
W32_FUNC void W32_CALL _eth_release(void)
Release the hardware driver.
Definition: pcsed.c:1349
pkt_eth_init
W32_FUNC int W32_CALL pkt_eth_init(mac_address *eth)
Initialise Packet driver interface.
Definition: pcpkt.c:1446
watt_sock_init
W32_FUNC int W32_CALL watt_sock_init(size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
Definition: sock_ini.c:769
_gethostid
W32_FUNC DWORD W32_CALL _gethostid(void)
Core style: Returns local IPv4-address.
Definition: bsdname.c:49
tcp_cbrk
W32_FUNC int W32_CALL tcp_cbrk(int mode)
Some deprecated functions.
Definition: oldstuff.c:27
chk_timeout
W32_FUNC int W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
tcp_inject_config
W32_FUNC void W32_CALL tcp_inject_config(const struct config_table *cfg, const char *key, const char *value)
Callable from a user application to inject config values before the normal WATTCP....
Definition: pcconfig.c:897
_chk_ping
W32_FUNC DWORD W32_CALL _chk_ping(DWORD host, DWORD *ping_num)
Check for ICMP echo reply in ping-cache.
Definition: pcping.c:169
tcp_established
W32_FUNC int W32_CALL tcp_established(const tcp_Socket *s)
Returns 1 if TCP connection is established.
Definition: pctcp.c:639
pkt_waiting
W32_FUNC int W32_CALL pkt_waiting(void)
Return number of packets waiting in queue.
Definition: pcpkt.c:1375
userTimerTick
W32_FUNC void W32_CALL userTimerTick(DWORD)
Provide timer-ticks from an application.
Definition: timer.c:198
pkt_set_addr
W32_FUNC int W32_CALL pkt_set_addr(const void *eth)
Set a new MAC source address.
Definition: pcpkt.c:1195
resolve_ip
W32_FUNC int W32_CALL resolve_ip(DWORD ip, char *name, int len)
Resolve an IP-address to a name.
Definition: oldstuff.c:81
_eth_init
W32_FUNC int W32_CALL _eth_init(void)
Initialize the network driver interface.
Definition: pcsed.c:634
resolve
W32_FUNC DWORD W32_CALL resolve(const char *name)
Convert host name to an address.
Definition: pcdns.c:771
_watt_cbroke
W32_DATA volatile int _watt_cbroke
Definition: tcp.h:339
wattcpBuildCC
W32_FUNC const char *W32_CALL wattcpBuildCC(void)
Return the target/compiler.
Definition: version.c:556
wattcpCapabilities
W32_FUNC const char *W32_CALL wattcpCapabilities(void)
Return compiled-in capabilities and features.
Definition: version.c:743
set_timeout
W32_FUNC DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
watt_filelength
W32_FUNC long W32_CALL watt_filelength(int fd)
filelength() is needed in pcconfig.c and some applications.
Definition: misc.c:946
pkt_get_drvr_ver
W32_FUNC int W32_CALL pkt_get_drvr_ver(WORD *major, WORD *minor, WORD *unused, WORD *build)
Return version of PKTDRVR.
Definition: pcpkt.c:531
watt_kbhit
W32_FUNC int W32_CALL watt_kbhit(void)
A less CPU hogging kbhit().
Definition: misc.c:917
aton_dotless
W32_FUNC DWORD W32_CALL aton_dotless(const char *str)
Converts ‘[dotless]’ or ‘dotless’ to 32 bit long (host order)
Definition: netaddr.c:115
pkt_get_params
W32_FUNC int W32_CALL pkt_get_params(struct PktParameters *params)
Get PKTDRVR parameters (MTU, version etc.)
Definition: pcpkt.c:465
_eth_arrived
W32_FUNC void *W32_CALL _eth_arrived(WORD *type, BOOL *brdcast)
Poll for arrival of new packets (IP/ARP/RARP/PPPoE protocol).
Definition: pcsed.c:996
pkt_get_stats
W32_FUNC int W32_CALL pkt_get_stats(struct PktStats *stats, struct PktStats *total)
Get PKTDRVR statistics.
Definition: pcpkt.c:1240
tcp_set_debug_state
W32_FUNC void W32_CALL tcp_set_debug_state(WORD x)
Old comptibility function.
Definition: pcconfig.c:856
pkt_strerror
W32_FUNC const char *W32_CALL pkt_strerror(int code)
Return textual error representing error-code.
Definition: pcpkt.c:216
_eth_get_hwtype
W32_FUNC BYTE W32_CALL _eth_get_hwtype(BYTE *hwtype, BYTE *hwlen)
Fill in hardware address type/length for BOOTP/DHCP packets.
Definition: pcsed.c:730
init_userSuppliedTimerTick
W32_FUNC void W32_CALL init_userSuppliedTimerTick(void)
init_userSuppliedTimerTick() - setup timer handling for programs that are already running a periodic ...
Definition: timer.c:169
DHCP_read_config
W32_FUNC int W32_CALL DHCP_read_config(void)
Called from watt_sock_init() after "\c WATTCP.CFG" has been parsed.
Definition: pcdhcp.c:1826
clocks_per_usec
DWORD clocks_per_usec
Measured CPU speed (MHz)
Definition: timer.c:64
has_rdtsc
BOOL has_rdtsc
Never set in Watt-32.
Definition: timer.c:54
sock_type
Definition: wattcp.h:692
w32api.h
whide.h
wtime.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_debu.h Source File

  • inc
  • netinet
tcp_debu.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_TCP_DEBUG_H
39#define __NETINET_TCP_DEBUG_H
40
41#include <netinet/in_systm.h>
42#include <netinet/tcp_var.h>
43
44struct tcp_debug {
45 n_time td_time;
46 short td_act;
47 short td_ostate;
48 caddr_t td_tcb;
49 struct tcpiphdr td_ti;
50 short td_req;
51 struct tcpcb td_cb;
52 };
53
54#define TA_INPUT 0
55#define TA_OUTPUT 1
56#define TA_USER 2
57#define TA_RESPOND 3
58#define TA_DROP 4
59
60#ifdef TANAMES
61static char *tanames[] = {
62 "input", "output", "user", "respond", "drop"
63 };
64#endif
65
66#define TCP_NDEBUG 100
67
68#ifdef TCP_AUTO_DEBUG
69#include <sys/wtime.h>
70
71/* The following table is used as a circular buffer in which TCP
72 * autotuning statistics can be kept.
73 * It is intended that these statistics will be periodically read
74 * by a debugging application using kvm.
75 */
76
77#define TAD_ENTRIES 1024 /* number of entries in monitor_table */
78
79struct tad_entry {
80 u_long seq_no; /* tad entry number */
81 struct timeval time; /* time of entry */
82 u_long snd_cwnd; /* congestion window */
83 u_long sb_hiwat; /* send socket buffer hi water mark */
84 u_long sb_target_hiwat; /* target for same */
85 u_long sb_cc; /* space used in send socket buf */
86 u_long m_clused; /* m_clusters - m_clfree */
87 u_short lport; /* local port number */
88 u_short rport; /* remote port number */
89 u_long debug; /* used for debugging */
90 tcp_seq snd_max; /* highest sequence number sent */
91 } tad_table[TAD_ENTRIES];
92
93extern struct tad_entry *tad_index; /* insert point */
94extern u_long tad_seq;
95extern u_long tad_debug;
96
97/* increment the index into the table
98 */
99#define TAD_INDEX_INCR tad_index = (struct tad_entry*)((u_long)tad_index + \
100 sizeof(struct tad_entry)); \
101 if ((u_long) tad_index >= \
102 (u_long) &tad_table[TAD_ENTRIES]) \
103 tad_index = tad_table;
104
105/* add a log entry to the table
106 */
107#define TAD_SNAPSHOT(tp, so) tad_index->seq_no = tad_seq++; \
108 microtime(&(tad_index->time)); \
109 tad_index->snd_cwnd = tp->snd_cwnd; \
110 tad_index->sb_hiwat = so->so_snd.sb_hiwat; \
111 tad_index->sb_target_hiwat = so->so_snd.sb_net_target; \
112 tad_index->sb_cc = so->so_snd.sb_cc; \
113 tad_index->m_clused = mbstat.m_clusters - mbstat.m_clfree;\
114 tad_index->lport = tp->t_inpcb->inp_lport; \
115 tad_index->rport = tp->t_inpcb->inp_fport; \
116 tad_index->debug = tad_debug; \
117 tad_index->snd_max = tp->snd_max; \
118 TAD_INDEX_INCR;
119
120#endif /* TCP_AUTO_DEBUG */
121
122#endif /* __NETINET_TCP_DEBUG_H */
in_systm.h
tad_entry
Definition: tcp_debu.h:79
tcp_debug
Definition: tcp_debu.h:44
tcpcb
Definition: tcp_var.h:81
timeval
Definition: wtime.h:30
tcp_var.h
wtime.h


Watt-32 tcp/ip: E:/WATT/src/tcp_fsm.c Source File

  • src
tcp_fsm.c
Go to the documentation of this file.
1
7#include <stdio.h>
8#include <stdlib.h>
9#include <string.h>
10#include <limits.h>
11
12#include "copyrigh.h"
13#include "wattcp.h"
14#include "chksum.h"
15#include "misc.h"
16#include "misc_str.h"
17#include "timer.h"
18#include "sock_ini.h"
19#include "language.h"
20#include "pcconfig.h"
21#include "pcqueue.h"
22#include "pcsed.h"
23#include "pcpkt.h"
24#include "ip4_out.h"
25#include "ip6_out.h"
26#include "ip6_in.h"
27#include "split.h"
28#include "pcdbug.h"
29#include "pcstat.h"
30#include "pctcp.h"
31
32#if !defined(USE_UDP_ONLY)
33
34#define flag_SYN_ACK (tcp_FlagSYN | tcp_FlagACK)
35#define flag_FIN_ACK (tcp_FlagFIN | tcp_FlagACK)
36
37typedef int (*tcp_StateProc) (_tcp_Socket**, /* in/out: TCP socket, can change on output */
38 const in_Header*, /* in: IP header */
39 tcp_Header*, /* in: TCP header */
40 int); /* in: TCP flags */
41
42static int tcp_listen_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
43static int tcp_resolve_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
44static int tcp_synsent_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
45static int tcp_synrec_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
46static int tcp_estab_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
47static int tcp_estcl_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
48static int tcp_finwt1_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
49static int tcp_finwt2_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
50static int tcp_closewt_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
51static int tcp_closing_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
52static int tcp_lastack_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
53static int tcp_timewt_state (_tcp_Socket**, const in_Header*, tcp_Header*, int);
54
55static int tcp_process_data (_tcp_Socket *s, const tcp_Header *tcp, int len, int *flags);
56static void tcp_set_window (_tcp_Socket *s, const tcp_Header *tcp);
57static int tcp_process_ACK (_tcp_Socket *s, long *unack);
58
59static tcp_StateProc tcp_state_tab [] = {
60 tcp_listen_state, /* tcp_StateLISTEN : listening for connection */
61 tcp_resolve_state, /* tcp_StateRESOLVE : resolving IP, waiting on ARP reply */
62 tcp_synsent_state, /* tcp_StateSYNSENT : SYN sent, active open */
63 tcp_synrec_state, /* tcp_StateSYNREC : SYN received, SYN+ACK sent (listen TCB) */
64 tcp_estab_state, /* tcp_StateESTAB : established */
65 tcp_estcl_state, /* tcp_StateESTCL : established, but will FIN */
66 tcp_finwt1_state, /* tcp_StateFINWT1 : sent FIN */
67 tcp_finwt2_state, /* tcp_StateFINWT2 : sent FIN, received FIN+ACK */
68 tcp_closewt_state, /* tcp_StateCLOSWT : received FIN waiting for close */
69 tcp_closing_state, /* tcp_StateCLOSING : sent FIN, received FIN (waiting for FIN+ACK) */
70 tcp_lastack_state, /* tcp_StateLASTACK : FIN received, ACK+FIN sent */
71 tcp_timewt_state, /* tcp_StateTIMEWT : dally after sending final FIN+ACK */
72 };
73
74static BOOL is_ip4; /* TRUE: input packet is IPv4, else IPv6 */
75static DWORD acknum, seqnum; /* ACK/SEQ of current segment */
76
77#if defined(USE_NEW_TCP_REASM) /* not yet */
78
79#define MAX_REASM_SEG 10
80
81static int tcp_reassemble (_tcp_Socket *s, const tcp_Header *tcp,
82 UINT len, int flags);
83struct tcp_reasm {
84 struct {
85 DWORD left;
86 DWORD right;
87 } edge [MAX_REASM_SEG];
88 int idx;
89 };
90#endif
91
92
93/*
94 * _tcp_fsm - Our TCP-input state-machine.
95 *
96 * Returns 1 to tcp_handler() if a retransmission is required
97 * immediately or when RTO expires.
98 */
99int _tcp_fsm (_tcp_Socket **sp, const in_Header *ip)
100{
101 tcp_Header *tcp;
102 _tcp_Socket *s = *sp;
103 BYTE flags;
104 int rc;
105 UINT in_state = s->state;
106
107 if (s->state >= tcp_StateCLOSED)
108 return (0);
109
110#if defined(NEED_SPLIT)
111 tcp = (tcp_Header*) pkt_get_type_in (TYPE_TCP_HEAD)->data;
112 is_ip4 = (ip->ver == 4);
113#else
114 tcp = (tcp_Header*) ((BYTE*)ip + in_GetHdrLen (ip));
115 is_ip4 = TRUE; /* assume IPv4 */
116#endif
117
118 acknum = intel (tcp->acknum);
119 seqnum = intel (tcp->seqnum);
120
121 flags = tcp->flags & tcp_FlagMASK;
122 rc = (*tcp_state_tab[s->state]) (sp, ip, tcp, flags);
123 s = *sp;
124
125#if defined(USE_DEBUG)
126 if (debug_on >= 3 && in_state != s->state)
127 {
128 const char *st_in = tcpStateName (in_state);
129 const char *st_out = tcpStateName (s->state);
130
131 TRACE_CONSOLE (3, "tcp-state: %s -> %s\n", st_in, st_out);
132 }
133#endif
134
135#if defined(USE_BSD_API)
136 if (_bsd_socket_hook)
137 (*_bsd_socket_hook) (BSO_DEBUG, s, in_state, s->state);
138#endif
139
140 ARGSUSED (in_state);
141 return (rc);
142}
143
144/*
145 * LISTEN state
146 */
147static int tcp_listen_state (_tcp_Socket **sp, const in_Header *ip,
148 tcp_Header *tcp, int flags)
149{
150 _tcp_Socket *s = *sp;
151
152 SET_PEER_MAC_ADDR (s, ip); /* save his ethernet address */
153
154 if ((flags & tcp_FlagSYN) == tcp_FlagSYN)
155 {
156#if defined(USE_BSD_API)
157 /*
158 * Append the TCB `s' to the listen-queue. The new TCB on output
159 * from `_bsd_socket_hook' is the clone of `s' on input unless the
160 * listen-queue is full.
161 */
162 if (_bsd_socket_hook && !(*_bsd_socket_hook)(BSO_SYN_CALLBACK,&s))
163 {
164 /* Append failed due to queue full or (temporary) memory shortage.
165 * Silently discard SYN. TCB `s' is unchanged.
166 */
167 CLR_PEER_MAC_ADDR (s);
168 return (0);
169 }
170#endif
171
172 if (is_ip4 && ip->tos > s->tos)
173 s->tos = ip->tos;
174
175 s->recv_next = seqnum + 1;
176 s->flags = flag_SYN_ACK;
177 s->state = tcp_StateSYNREC;
178 s->unhappy = TRUE;
179 TCP_SEND (s); /* respond immediately */
180
181 s->timeout = set_timeout (tcp_TIMEOUT);
182 STAT (tcpstats.tcps_accepts++);
183 }
184 else
185 {
186 TCP_SEND_RESET (s, ip, tcp);
187 STAT (tcpstats.tcps_conndrops++);
188 CLR_PEER_MAC_ADDR (s);
189 }
190 return (0);
191}
192
193/*
194 * RESOLVE state, GvB 2002-09 'inserted'
195 * Nothing done here, the action is in pctcp.c / tcp_Retransmitter()
196 */
197static int tcp_resolve_state (_tcp_Socket **sp, const in_Header *ip,
198 tcp_Header *tcp, int flags)
199{
200 ARGSUSED (sp);
201 ARGSUSED (ip);
202 ARGSUSED (tcp);
203 ARGSUSED (flags);
204 return (1);
205}
206
207/*
208 * SYNSENT state
209 */
210static int tcp_synsent_state (_tcp_Socket **sp, const in_Header *ip,
211 tcp_Header *tcp, int flags)
212{
213 _tcp_Socket *s = *sp;
214
215 if (flags & tcp_FlagSYN)
216 {
217 if (is_ip4 && ip->tos > s->tos)
218 s->tos = ip->tos;
219
220 s->flags &= tcp_FlagPUSH;
221 s->flags |= tcp_FlagACK;
222 s->timeout = set_timeout (tcp_TIMEOUT);
223
224 /* SYN+ACK means connection established, else SYNREC
225 */
226 if (flags & tcp_FlagACK)
227 {
228 /* Check the ACK value
229 */
230 if (acknum == s->send_next + 1)
231 {
232 int len;
233 const in6_Header *ip6 = (const in6_Header*) ip;
234
235 if (is_ip4)
236 len = intel16 (ip->length) - in_GetHdrLen (ip);
237 else len = intel16 (ip6->len);
238
239 s->state = tcp_StateESTAB;
240 s->send_next++;
241 s->recv_next = seqnum + 1;
242
243 /* Should be no data in SYN+ACK, but..
244 */
245 tcp_process_data (s, tcp, len, &flags);
246
247 /* Prevent retrans on no tx-data
248 */
249 s->unhappy = s->tx_datalen > 0 ? TRUE : FALSE;
250
251 /* !! Maybe use TCP_SENDSOON() to merge application data into ACK
252 */
253 TCP_SEND (s);
254 }
255 else
256 {
257 /* Wrong ACK, force a RST and resend SYN now
258 */
259 s->flags = tcp_FlagRST;
260 s->unhappy = TRUE;
261 TCP_SEND (s);
262
263 s->send_next = INIT_SEQ(); /* !! should we set a new seq-num? */
264 s->flags = tcp_FlagSYN;
265
266#if defined(USE_DEBUG)
267 s->last_seqnum[0] = 0UL;
268 s->last_seqnum[1] = 0UL;
269#endif
270 TCP_SENDSOON (s);
271 }
272
275 }
276 else
277 {
278 s->recv_next++;
279 s->state = tcp_StateSYNREC; /* resend SYN in tcp_Retransmitter() */
280 return (1);
281 }
282 }
283 else /* didn't get a SYN back. Reset it */
284 {
285 TCP_SEND_RESET (s, ip, tcp);
286 return (0);
287 }
288 return (1);
289}
290
291/*
292 * SYNREC state (intermediate state for LISTEN to ESTABLISHED state).
293 */
294static int tcp_synrec_state (_tcp_Socket **sp, const in_Header *ip,
295 tcp_Header *tcp, int flags)
296{
297 _tcp_Socket *s = *sp;
298
299 if (flags & tcp_FlagSYN) /* retransmitted SYN */
300 {
301 s->flags = flag_SYN_ACK;
302 s->unhappy = TRUE;
303 TCP_SEND (s);
304 s->timeout = set_timeout (tcp_TIMEOUT);
305 return (0);
306 }
307
308 if ((flags & tcp_FlagACK) && acknum == (s->send_next + 1))
309 {
310 tcp_set_window (s, tcp); /* Allocate Tx-buffer based on peer's window */
311 STAT (tcpstats.tcps_connects++);
312 s->send_next++;
313 s->flags = tcp_FlagACK;
314 s->state = tcp_StateESTAB;
315 s->timeout = 0UL; /* never timeout now */
316 s->unhappy = FALSE;
317 return (0);
318 }
319 ARGSUSED (ip);
320 return (1);
321}
322
323/*
324 * ESTABLISHED state
325 */
326static int tcp_estab_state (_tcp_Socket **sp, const in_Header *ip,
327 tcp_Header *tcp, int flags)
328{
329 const in6_Header *ip6 = (const in6_Header*) ip;
330 _tcp_Socket *s = *sp;
331 int len;
332 long ldiff; /* how much still ACK'ed */
333 BOOL did_tx;
334
335 /* handle lost SYN
336 */
337 if ((flags & tcp_FlagSYN) && (flags & tcp_FlagACK))
338 {
339 /* !! should check if data and process it */
340 TCP_SEND (s);
341 return (0);
342 }
343
344 if (!(flags & tcp_FlagACK)) /* must ACK something */
345 return (0);
346
347 s->timeout = 0UL; /* we do not timeout at this point */
348
349 if (!tcp_process_ACK(s,&ldiff))
350 {
351 TRACE_CONSOLE (2, "_tcp_fsm() confused so set unacked "
352 "back to 0 from %ld\n", s->send_una);
353 STAT (tcpstats.tcps_persistdrop++); /* !! a better counter? */
354 s->send_una = 0;
355 }
356
357 if (s->send_una < 0)
358 s->send_una = 0;
359
360 s->flags &= tcp_FlagPUSH;
361 s->flags |= tcp_FlagACK;
362
363 if (is_ip4)
364 len = intel16 (ip->length) - in_GetHdrLen (ip);
365 else len = intel16 (ip6->len);
366
367 if (tcp_process_data (s, tcp, len, &flags) < 0)
368 {
369 TCP_SEND (s); /* An out-of-order or missing segment; do fast ACK */
370 return (1);
371 }
372
373 did_tx = FALSE;
374
375 if (s->state != tcp_StateCLOSWT &&
376 (flags & tcp_FlagFIN) &&
377 SEQ_GEQ(s->recv_next,seqnum) &&
378 SEQ_LT(s->recv_next,seqnum+s->adv_win))
379 {
380 if (s->missed_seq[0] == s->missed_seq[1])
381 {
382 s->recv_next++;
383 SET_ERR_MSG (s, _LANG("Connection closed by peer"));
384
385 /* Implied CLOSE-WAIT -> LAST-ACK transition here
386 */
387 TCP_SEND (s);
388 did_tx = TRUE;
389
390 TRACE_CONSOLE (2, "tcp_estab_state(): got FIN\n");
391
392 s->locflags |= LF_GOT_FIN;
393 s->flags |= tcp_FlagFIN; /* for tcp_Retransmitter() */
394 s->unhappy = TRUE;
395 s->timeout = set_timeout (tcp_LASTACK_TIME); /* Added AGW 6 Jan 2001 */
396 s->state = tcp_StateLASTACK;
397 }
398 else
399 {
400 s->unhappy = TRUE;
401 TCP_SEND (s); /* force a retransmit, no state change */
402 did_tx = TRUE;
403 }
404 }
405
406 /*
407 * Eliminate the spurious ACK messages bug.
408 * For the window update, the length should be the
409 * data length only, so exclude the TCP header size
410 * -- Joe <jdhagen@itis.com>
411 */
412 len -= (tcp->offset << 2);
413
414 /* Peer ACKed some of our data, continue sending more.
415 */
416 if (ldiff > 0 && s->tx_datalen > (unsigned long)s->send_una)
417 goto send_now;
418
419 /* Send ACK for received data.
420 */
421 if (len > 0)
422 {
423 /* Need to ACK and update window, but how urgent ??
424 * We need a better criteria for doing Fast-ACK.
425 */
426 if (s->adv_win < s->max_seg)
427 {
428 send_now:
429 TRACE_FILE ("tcp_estab_state (%u): FastACK: ldiff %ld, "
430 "UNA %ld, MS-right %ld\n",
431 __LINE__, ldiff, s->send_una,
432 s->missed_seq[0] != s->missed_seq[1] ?
433 (u_long)(s->missed_seq[0] - s->recv_next) : 0);
434 s->karn_count = 0;
435 TCP_SEND (s);
436 did_tx = TRUE;
437
438 if (s->adv_win == 0) /* need to open closed window in retransmitter */
439 {
440 s->locflags |= LF_WINUPDATE;
441 s->unhappy = TRUE;
442 }
443 }
444 else
445 {
446 TCP_SENDSOON (s); /* delayed ACK */
447 did_tx = TRUE;
448 }
449 }
450
451 /* Check if we need to reply to keep-alive segment
452 */
453 if (!did_tx && (len == 0) && (seqnum == s->recv_next-1) &&
454 ((flags & tcp_FlagACK) == tcp_FlagACK) && /* ACK only */
455 (s->state == tcp_StateESTAB))
456 {
457 s->locflags |= LF_KEEPALIVE;
458 TRACE_FILE ("tcp_process_ACK(): Got keepalive ACK\n");
459 TCP_SEND (s);
460 }
461 return (0);
462}
463
464/*
465 * ESTAB_CLOSE state
466 */
467static int tcp_estcl_state (_tcp_Socket **sp, const in_Header *ip,
468 tcp_Header *tcp, int flags)
469{
470 tcp_estab_state (sp, ip, tcp, flags);
471 _tcp_close (*sp);
472 return (0);
473}
474
475/*
476 * CLOSE_WAIT state
477 */
478static int tcp_closewt_state (_tcp_Socket **sp, const in_Header *ip,
479 tcp_Header *tcp, int flags)
480{
481 return tcp_estab_state (sp, ip, tcp, flags);
482}
483
484/*
485 * FIN_WAIT1 state
486 */
487static int tcp_finwt1_state (_tcp_Socket **sp, const in_Header *ip,
488 tcp_Header *tcp, int flags)
489{
490 const in6_Header *ip6 = (const in6_Header*) ip;
491 _tcp_Socket *s = *sp;
492 long ldiff;
493 int len;
494
495 if (is_ip4)
496 len = intel16 (ip->length) - in_GetHdrLen (ip);
497 else len = intel16 (ip6->len);
498
499 /* Peer may not have read all the data yet, we
500 * must still supply it as requested
501 */
502 if (tcp_process_ACK(s,&ldiff))
503 {
504 if (ldiff == 0 || s->send_una < 0)
505 s->send_una = 0;
506 }
507
508 /* They may still be transmitting data, we must read it
509 */
510 tcp_process_data (s, tcp, len, &flags);
511
512 /* Check if peer TCP has ACK'ed all sent data and
513 * is ready to change states. No missing segment and got FIN+ACK.
514 */
515 if (s->missed_seq[0] == s->missed_seq[1] &&
516 (flags & flag_FIN_ACK) == flag_FIN_ACK)
517 {
518 if (seqnum == s->recv_next)
519 {
520 s->recv_next++; /* we must ACK their FIN! */
521
522 if (SEQ_GEQ(acknum, s->send_next+1))
523 {
524 /* Not simultaneous close (they've ACKed our FIN)
525 * We need to ACK their FIN and move to TIME_WAIT
526 */
527 s->send_next++;
528 s->timeout = set_timeout (tcp_TIMEWT_TO);
529 s->state = tcp_StateTIMEWT;
530 }
531 else
532 {
533 /* Simultaneous close (haven't ACKed our FIN yet)
534 * We need to ACK their FIN and move to CLOSING
535 */
536 s->timeout = set_timeout (tcp_TIMEOUT); /* !! S. Lawson, added 12.Nov 1999 */
537 s->state = tcp_StateCLOSING;
538 }
539 s->flags = tcp_FlagACK;
540 s->unhappy = FALSE;
541 TCP_SEND (s);
542 }
543 }
544 else if (flags & tcp_FlagACK)
545 {
546 /* other side is legitimately ACKing our FIN
547 */
548 if ((acknum == s->send_next + 1) &&
549 (seqnum == s->recv_next) &&
550 (s->tx_datalen == 0))
551 {
552 if (!(s->locflags & LF_LINGER))
553 {
554 _tcp_unthread (s, TRUE); /* enters tcp_StateCLOSED */
555 return (0);
556 }
557 s->send_next++;
558 s->state = tcp_StateFINWT2;
559 s->unhappy = FALSE; /* we don't send anything */
560 s->timeout = set_timeout (tcp_TIMEOUT);
561 }
562 else if ((acknum == s->send_next + 1) && (seqnum == s->recv_next + 1))
563 {
564 /* !! added 30-Aug 1999 GV
565 * Try to stop that annoying retransmission bug/feature(?)
566 * from FreeBSD 4.x which increments both SEQ and ACK.
567 */
568 s->send_next++;
569 s->recv_next++;
570 s->flags = tcp_FlagRST;
571 s->unhappy = FALSE;
572 s->karn_count = 0;
573 s->tx_datalen = 0;
574 TCP_SEND (s);
575 _tcp_unthread (s, TRUE);
576 return (0);
577 }
578 }
579 return (1);
580}
581
582/*
583 * FIN_WAIT2 state
584 */
585static int tcp_finwt2_state (_tcp_Socket **sp, const in_Header *ip,
586 tcp_Header *tcp, int flags)
587{
588 const in6_Header *ip6 = (const in6_Header*) ip;
589 _tcp_Socket *s = *sp;
590 int len;
591
592 if (is_ip4)
593 len = intel16 (ip->length) - in_GetHdrLen (ip);
594 else len = intel16 (ip6->len);
595
596 /* They may still be transmitting data, we must read it
597 */
598 tcp_process_data (s, tcp, len, &flags);
599
600 if (s->missed_seq[0] != s->missed_seq[1])
601 {
602 /* peer must retransmit to get all data */
603 return (1);
604 }
605
606 if (flags & tcp_FlagFIN)
607 {
608 TRACE_CONSOLE (2, "tcp_finwt2_state(): got FIN\n");
609 s->locflags |= LF_GOT_FIN;
610 }
611
612 if ((flags & tcp_FlagACK) &&
613 acknum == s->send_next &&
614 seqnum == s->recv_next)
615 {
616 s->recv_next++;
617 s->flags = tcp_FlagACK;
618 s->unhappy = FALSE;
619 s->state = tcp_StateTIMEWT;
620 s->timeout = set_timeout (tcp_TIMEWT_TO);
621 TCP_SEND (s);
622 return (0);
623 }
624 return (1);
625}
626
627
628/*
629 * CLOSING state
630 */
631static int tcp_closing_state (_tcp_Socket **sp, const in_Header *ip,
632 tcp_Header *tcp, int flags)
633{
634 _tcp_Socket *s = *sp;
635
636 if ((flags & (tcp_FlagACK|tcp_FlagFIN)) == tcp_FlagACK) /* ACK, no FIN */
637 {
638 /* Per FINWT1 above, acknum should be 's->send_next+1',
639 * which should cause us to bump 's->send_next' to match.
640 */
641 if (SEQ_GT(acknum,s->send_next) && /* AGW - 6th Jan 2001 */
642 seqnum == s->recv_next)
643 {
644 s->send_next++;
645 s->state = tcp_StateTIMEWT;
646 s->unhappy = FALSE;
647 s->timeout = set_timeout (tcp_TIMEWT_TO);
648 }
649 }
650 ARGSUSED (ip);
651 ARGSUSED (tcp);
652 return (1);
653}
654
655/*
656 * LASTACK state
657 */
658static int tcp_lastack_state (_tcp_Socket **sp, const in_Header *ip,
659 tcp_Header *tcp, int flags)
660{
661 _tcp_Socket *s = *sp;
662
663 if (flags & tcp_FlagFIN)
664 {
665 /* they lost our two packets, back up
666 */
667 TRACE_CONSOLE (2, "tcp_lastack_state(): got FIN\n");
668
669 s->locflags |= LF_GOT_FIN;
670 s->flags = flag_FIN_ACK;
671 TCP_SEND (s);
672 s->unhappy = TRUE;
673 return (0);
674 }
675
676 if (SEQ_GT(acknum,s->send_next) && /* AGW allow for any later acks 6th Jan 2001 */
677 seqnum == s->recv_next)
678 {
679 s->state = tcp_StateCLOSED; /* no 2*MSL necessary */
680 s->unhappy = FALSE; /* we're done */
681 return (0);
682 }
683 ARGSUSED (ip);
684 ARGSUSED (tcp);
685 return (1);
686}
687
688/*
689 * TIMEWAIT state
690 */
691static int tcp_timewt_state (_tcp_Socket **sp, const in_Header *ip,
692 tcp_Header *tcp, int flags)
693{
694 _tcp_Socket *s = *sp;
695
696 if (flags & tcp_FlagACK)
697 {
698 /* our peer needs an FIN-ACK which is sent by tcp_Retransmitter().
699 */
700 s->flags = tcp_FlagACK;
701 s->unhappy = FALSE;
702 s->state = tcp_StateCLOSED; /* support 2 MSL in RST code */
703 TCP_SEND (s);
704 }
705 ARGSUSED (ip);
706 ARGSUSED (tcp);
707 return (1);
708}
709
710
714static void tcp_process_options (_tcp_Socket *s, const tcp_Header *tcp,
715 const BYTE *tcp_data, int flags)
716{
717 const BYTE *opt = (const BYTE*)(tcp+1);
718 WORD max_seg;
719 int num = 0;
720
721 /* Default to not sending timestamp
722 */
723 s->locflags &= ~LF_USE_TSTAMP;
724
725 /* Clamp # of options to prevent DoS-attack from 0-sized
726 * unknown options.
727 */
728 while (opt < tcp_data && num++ < 10)
729 {
730 switch (*opt)
731 {
732 case TCPOPT_EOL:
733 return;
734
735 case TCPOPT_NOP:
736 opt++;
737 break;
738
739 case TCPOPT_MAXSEG: /* we are very liberal on MSS stuff */
740 if (flags & tcp_FlagSYN)
741 {
742 max_seg = intel16 (*(WORD*)(opt+2));
743 if (!s->max_seg || max_seg < s->max_seg)
744 {
745 TRACE_CONSOLE (2, "Setting MSS %u\n", max_seg);
746 s->max_seg = max_seg;
747 }
748 }
749 opt += 4;
750 break;
751
752 case TCPOPT_TIMESTAMP:
753 /* Use TS values only if SEQ is for new data.
754 */
755 if ((flags & tcp_FlagSYN) ||
756 ((flags & tcp_FlagACK) &&
757 (long)(seqnum - s->recv_next)))
758 {
759 s->ts_recent = intel (*(DWORD*)(opt+2)); /* echo this back */
760 s->ts_echo = intel (*(DWORD*)(opt+6)); /* use in RTT calc */
761 s->locflags |= LF_USE_TSTAMP; /* peer has this */
762 }
763 opt += 10;
764 break;
765
766 case TCPOPT_WINDOW:
767 if (flags & tcp_FlagSYN)
768 {
769 s->rx_wscale = min (TCP_MAX_WINSHIFT, *(opt+2));
770 s->locflags |= LF_RCVD_SCALE;
771 }
772 opt += 3;
773 break;
774
775 case TCPOPT_SACK_PERM:
776 if (flags & tcp_FlagSYN)
777 s->locflags |= LF_SACK_PERMIT; /* no effect yet */
778 opt += 2;
779 break;
780
781 case TCPOPT_CHKSUM_REQ:
782 opt += 3;
783 break;
784
785 case TCPOPT_CHKSUM_DAT:
786 opt += *(opt+1);
787 break;
788
789 default: /* unknown options; type,length,... */
790 opt += *(opt+1);
791 break;
792 }
793 }
794}
795
796
797/*
798 * TCP segment processsing:
799 *
800 * In the tcp_Socket structure:
801 *
802 * - 'rx_datalen' is the index in the receive buffer where the next
803 * in-order data should be written.
804 *
805 * - 'recv_next' is the TCP sequence number of the start of the next
806 * in-order data.
807 *
808 * - 'missed_seq[0]' is the TCP sequence number of the first octet of
809 * the buffered out-of-order data.
810 *
811 * - 'missed_seq[1]' is the TCP sequence number of the first octet
812 * following the buffered out-of-order data. If missed_seq[0] and
813 * missed_seq[1] are equal, there is no buffered out-of-order data.
814 *
815 * 'ldiff' is the difference between the received sequence number and
816 * the expected sequence number. If 'ldiff' is zero or positive, and
817 * 'ldiff' is less than the length of the packet, data can be appended
818 * to the receive buffer. If 'ldiff' is negative, data may be prepended
819 * and/or appended to the buffered out-of-order data.
820 *
821 * Packets are discarded without processing if the *end* of the packet
822 * is before 'recv_next', in which case we've already processed the
823 * data, or after the advertised receive window ('s->adv_win').
824 *
825 * For 'ldiff >= 0', there are four cases to handle:
826 *
827 * 1) No out-of-order buffer: append the packet data and add the
828 * length to 'recv_next'.
829 *
830 * 2) No overlap with out-of-order buffer: same as (1).
831 *
832 * 3) New data reaches but doesn't extend out-of-order buffer:
833 * copy up to buffer, set 'recv_next' to 'missed_seq[1]', and
834 * clear 'missed_seq[0]' and 'missed_seq[1]'.
835 *
836 * 4) New data extends past out-of-order buffer: same as (1),
837 * also clearing 'missed_seq[0]' and 'missed_seq[1]'.
838 *
839 * For 'ldiff < 0', there are four further cases to handle:
840 *
841 * 5) No out-of-order buffer: copy the packet data and set
842 * 'missed_seq[0]' and 'missed_seq[1]'.
843 *
844 * 6) Data starts at 'missed_seq[1]': append to out-of-order buffer
845 * and update 'missed_seq[1]'.
846 *
847 * 7) Data extends start: copy new data and update 'missed_seq[0]'.
848 *
849 * 8) Data extends end: copy new data and updated 'missed_seq[1]'.
850 *
851 * Case 7 and case 8 are not exclusive.
852 *
853 * When an out-of-order packet is received, -1 is returned so that a
854 * duplicate acknowledgement will be sent immediately, signalling the
855 * peer to use fast retransmit to resend the missing data.
856 */
857
858/*
859 * Add data at 'rx_datalen', updating 'rx_datalen' and 'recv_next'.
860 */
861static void
862copy_in_order (_tcp_Socket *s, const BYTE *data, unsigned len)
863{
864 TRACE_FILE ("copy_in_order (%u): Append %u bytes at %u-%u\n",
865 __LINE__, len, s->rx_datalen, s->rx_datalen + len);
866 memcpy (s->rx_data + s->rx_datalen, data, len);
867 s->recv_next += len;
868 s->rx_datalen += len;
869}
870
871/*
872 * Handle any new data that increments the 'recv_next' index.
873 * 'ldiff >= 0'.
874 */
875static void
876data_in_order (_tcp_Socket *s, const BYTE *data, unsigned len, unsigned diff)
877{
878 /* Skip data before recv_next. We must be left with some data or
879 * we wouldn't have been called.
880 */
881 data += diff;
882 len -= diff;
883
884 if (s->protoHandler)
885 {
886 s->recv_next += (*s->protoHandler) (s, data, len, NULL, NULL);
887 }
888 else if (s->missed_seq[0] == s->missed_seq[1] ||
889 s->recv_next + len < s->missed_seq[0])
890 {
891 /* (1) Normal case: just copy all the data to the buffer.
892 * (2) Received in-order doesn't catch up to buffered out-of-order.
893 */
894 copy_in_order (s, data, len);
895 }
896 else
897 {
898 /* (3) Received data catches up to saved out-of-order data.
899 * (4) Received data extends beyond saved out-of-order data.
900 */
901 unsigned ms_end = s->missed_seq[1] - s->recv_next;
902
903 copy_in_order (s, data, s->missed_seq[0] - s->recv_next);
904
905 /* Update offset and length to incorporate out-of-order data.
906 */
907 TRACE_FILE ("data_in_order (%u): Use %lu out-of-order bytes\n",
908 __LINE__, (u_long)(s->missed_seq[1] - s->missed_seq[0]));
909 s->rx_datalen += (s->missed_seq[1] - s->missed_seq[0]);
910 s->recv_next = s->missed_seq[1];
911 s->missed_seq[0] = s->missed_seq[1] = 0;
912
913 if (len > ms_end)
914 {
915 /* (4) Extend out-of-order data, if received past end.
916 */
917 copy_in_order (s, data + ms_end, len - ms_end);
918 }
919 }
920
921 TRACE_FILE ("data_in_order (%u): edges %lu/%lu, recv.next %lu\n",
922 __LINE__, (u_long)s->missed_seq[0], (u_long)s->missed_seq[1],
923 (u_long)s->recv_next);
924
925 TRACE_FILE ("data_in_order (%u): new data now ends at %u\n",
926 __LINE__, s->rx_datalen);
927}
928
929/*
930 * Add data before 'missed_seq[0]', updating its value.
931 */
932static void
933prepend_out_of_order (_tcp_Socket *s, const BYTE *data, unsigned len)
934{
935 unsigned start = s->missed_seq[0] - s->recv_next + s->rx_datalen - len;
936
937 TRACE_FILE ("prepend_out_of_order (%u): Prepend %u bytes at %u-%u\n",
938 __LINE__, len, start, start + len);
939 memcpy (s->rx_data + start, data, len);
940 s->missed_seq[0] -= len;
941}
942
943/*
944 * Add data after 'missed_seq[1]', updating its value.
945 */
946static void
947append_out_of_order (_tcp_Socket *s, const BYTE *data, unsigned len)
948{
949 unsigned start = s->missed_seq[1] - s->recv_next + s->rx_datalen;
950
951 TRACE_FILE ("append_out_of_order (%u): Append %u bytes at %u-%u\n",
952 __LINE__, len, start, start + len);
953 memcpy (s->rx_data + start, data, len);
954 s->missed_seq[1] += len;
955}
956
957/*
958 * Handle one out-of-segment packet (ldiff < 0)
959 */
960static void
961data_out_of_order (_tcp_Socket *s, const BYTE *data, unsigned len, unsigned diff)
962{
963 if (s->missed_seq[0] == s->missed_seq[1])
964 {
965 /* (5) First out-of-order data.
966 */
967 s->missed_seq[0] = s->missed_seq[1] = seqnum;
968 append_out_of_order (s, data, len);
969 }
970 else if (seqnum == s->missed_seq[1])
971 {
972 /* (6) Common case: immediately following last out-of-order packet.
973 */
974 append_out_of_order (s, data, len);
975 }
976 else
977 {
978 /* Offsets from recv_next:
979 * - diff is offset to start of received data;
980 * - diff + len is offset to after received data;
981 * - left is offset to start of saved out-of-order data;
982 * - right is offset to after saved out-of-order data.
983 */
984 unsigned left = s->missed_seq[0] - s->recv_next;
985 unsigned right = s->missed_seq[1] - s->recv_next;
986
987 if (diff < left && left <= diff + len)
988 {
989 /* (7) Data extending start. */
990 prepend_out_of_order (s, data, left - diff);
991 }
992
993 if (diff <= right && right < diff + len)
994 {
995 /* (8) Data extending end. */
996 append_out_of_order (s, data - diff + right, diff + len - right);
997 }
998 }
999
1000 TRACE_FILE ("data_out_of_order (%u): edges %lu/%lu, recv.next %lu\n",
1001 __LINE__, (u_long)s->missed_seq[0], (u_long)s->missed_seq[1], (u_long)s->recv_next);
1002}
1003
1009static int tcp_process_data (_tcp_Socket *s, const tcp_Header *tcp,
1010 int len, int *flags)
1011{
1012 long ldiff;
1013 int data_ofs;
1014 const BYTE *data;
1015
1016 if (s->stress > 0)
1017 s->stress--;
1018
1019 tcp_set_window (s, tcp); /* this one should be redundant */
1020
1021 ldiff = (long) (s->recv_next - seqnum);
1022
1023 if (*flags & tcp_FlagSYN)
1024 ldiff--; /* back up to 0 */
1025
1026 /* find the data portion
1027 */
1028 data_ofs = tcp->offset << 2; /* dword to byte offset */
1029 data = (const BYTE*)tcp + data_ofs;
1030
1031 if (data_ofs - sizeof(*tcp) > 0)
1032 tcp_process_options (s, tcp, data, *flags);
1033
1034 if (len - data_ofs < 0)
1035 {
1036 STAT (tcpstats.tcps_rcvbadoff++);
1037 len = 0;
1038 }
1039 else
1040 len -= data_ofs; /* remove the header length */
1041
1042 TRACE_FILE ("tcp_process_data (%u): len %u, ldiff %ld\n", __LINE__, len, ldiff);
1043
1046#if 0
1047 if ((*flags & tcp_FlagURG) && tcp->urgent && intel16(tcp->urgent) < len)
1048 {
1049 intel16 (tcp->urgent) + seq;
1050 }
1051#endif
1052
1053 /*
1054 * SYN/RST segments shouldn't carry any data.
1055 * But SYN-ACK can (?)
1056 */
1057 if (*flags & (tcp_FlagSYN | tcp_FlagRST))
1058 return (0);
1059
1060 if (ldiff) /* Out-of-Sequence data */
1061 {
1062 STAT (tcpstats.tcps_rcvoopack++);
1063 STAT (tcpstats.tcps_rcvoobyte += len);
1064 }
1065 else
1066 {
1067 STAT (tcpstats.tcps_rcvpack++);
1068 STAT (tcpstats.tcps_rcvbyte += len);
1069 }
1070
1071 /* No TCP data, so nothing more to do
1072 */
1073 if (len == 0)
1074 return (0);
1075
1076 /* Check that *end* of packet is valid, i.e. will fit in advertised receive
1077 * window ('adv_win'). If it's before 'recv_next', we've seen it all before;
1078 * if it's after then the peer (or someone else) sent more than we said we
1079 * could take.
1080 */
1081
1082 /*
1083 * Thanks to Mikulas Patocka <mikulas@twibright.com> for finding a problem
1084 * with the previous 'if-test':
1085 * if we receive a sequence of packets, all the packets are checked
1086 * against 's->adv_win', but 's->adv_win' is not decreased as the packets are
1087 * received, it remains the same. Consequently a packet that is out of window
1088 * is errorneously accepted and corrupts memory.
1089 *
1090 * Hence this 'if-test' is used instead:
1091 */
1092
1093 /* First patch by Mikulas Patocka:
1094 * checks that end of packet does not land above the TCP window
1095 */
1096 if ( ((unsigned)len - ldiff > s->max_rx_data - s->rx_datalen) ||
1097 /*
1098 * Second patch by Mateusz Viste:
1099 * checks that end of packet does not land below the TCP window
1100 * (legitimate case when remote peer retransmits an already-received
1101 * segment that Watt-32 did not acquit due to delayed ack).
1102 *
1103 * Details at https://github.com/gvanem/Watt-32/issues/2
1104 */
1105 (ldiff > len) )
1106 {
1107 TRACE_FILE ("tcp_process_data (%u): packet ends outside %lu/%lu\n",
1108 __LINE__, (u_long)s->recv_next, (u_long)(s->recv_next + s->adv_win));
1109 STAT (tcpstats.tcps_rcvpackafterwin++);
1110 return (0);
1111 }
1112
1113 /* Handle any new data that increments the 'recv_next' index.
1114 */
1115
1116 if (ldiff >= 0)
1117 {
1118 data_in_order (s, data, len, ldiff);
1119 s->unhappy = (s->tx_datalen > 0);
1120 return (0);
1121 }
1122
1123 STAT (tcpstats.tcps_rcvduppack++); /* increment dup-ACK count */
1124 STAT (tcpstats.tcps_rcvdupbyte += len);
1125
1126 /* No out-of-sequence processing of FIN flag - S. Lawson
1127 */
1128 if (*flags & tcp_FlagFIN)
1129 {
1130 TRACE_FILE ("tcp_process_data (%u): clearing FIN\n", __LINE__);
1131 *flags &= ~tcp_FlagFIN;
1132 }
1133
1134 data_out_of_order (s, data, len, -ldiff);
1135 s->unhappy = TRUE;
1136 return (-1);
1137}
1138
1139
1140/*
1141 * Process the ACK value in received packet, but only if it falls within
1142 * current window. Discard queued Tx-data that has been acknowledged.
1143 */
1144static int tcp_process_ACK (_tcp_Socket *s, long *unacked)
1145{
1146 long ldiff = (long) (acknum - s->send_next);
1147 int diff = (int) ldiff;
1148
1149 if (unacked)
1150 *unacked = ldiff;
1151
1152#if 0
1153 if (ldiff > s->window) /* peer ACK'd data not sent yet */
1154 {
1155 TCP_SEND (s);
1156 STAT (tcpstats.tcps_rcvacktoomuch++);
1157 return (1);
1158 }
1159#endif
1160
1161 if (ldiff >= 0 && (unsigned)diff <= s->tx_datalen)
1162 {
1163 if (s->tx_queuelen)
1164 {
1165 s->tx_queue += diff;
1166 s->tx_queuelen -= diff;
1167 }
1168 else if ((unsigned)diff < s->tx_datalen && diff > 0)
1169 {
1170 memmove (s->tx_data, s->tx_data+diff, s->tx_datalen-diff);
1171 }
1172
1173 diff = min (diff, (long)s->tx_datalen); /* protect against "nastygrams" */
1174 s->tx_datalen -= diff;
1175 s->send_una -= diff;
1176 s->send_next += ldiff;
1177
1178 /* If peer ACK'ed everything and all queued data sent,
1179 * stop RTT-timer
1180 */
1181 if (s->send_una == 0 && s->tx_datalen == 0)
1182 s->rtt_time = 0UL;
1183
1184 STAT (tcpstats.tcps_rcvackpack++);
1185 STAT (tcpstats.tcps_rcvackbyte += ldiff);
1186 return (1);
1187 }
1188 return (0);
1189}
1190
1196static void tcp_set_window (_tcp_Socket *s, const tcp_Header *tcp)
1197{
1198 s->window = intel16 (tcp->window);
1199 if (s->window > MAX_WINDOW)
1200 s->window = MAX_WINDOW;
1201
1202#if 0
1203 if (s->send_ssthresh == 0)
1204 s->send_ssthresh = s->window;
1205#endif
1206
1207 if (s->tx_data == &s->tx_buf[0] && /* Tx-data in _tcp_Socket */
1208 s->window > s->max_tx_data) /* His window > our Tx-size */
1209 {
1210 WORD window = s->window;
1211 size_t size;
1212 BYTE *buf;
1213
1214#if defined(__MSDOS__)
1215 if (_eth_ndis3pkt) /* limit NDIS3PKT's in-transit bytes */
1216 window = min (window, 6*_mss);
1217#endif
1218
1219 size = window + 8; /* add size for markers */
1220 buf = malloc (size);
1221
1222 TRACE_FILE ("tcp_set_window (%u): buf %p, size %lu, datalen %u\n",
1223 __LINE__, buf, (u_long)size, s->tx_datalen);
1224 if (!buf)
1225 return;
1226
1227 *(DWORD*)buf = SAFETY_TCP;
1228 *(DWORD*)(buf+size-4) = SAFETY_TCP;
1229 if (s->tx_datalen)
1230 memcpy (buf+4, s->tx_data, s->tx_datalen); /* copy to new buf */
1231 s->tx_data = buf + 4;
1232 s->max_tx_data = window - 1;
1233 }
1234}
1235
1240#if defined(USE_NEW_TCP_REASM)
1241
1242static int tcp_reassemble (_tcp_Socket *s, const tcp_Header *tcp,
1243 const BYTE *data, UINT len, int *flags)
1244{
1245 DWORD left_edge, right_edge;
1246 long size, ofs;
1247
1248 if (len == 0)
1249 return (0);
1250
1251 if (SEQ_EQ(seqnum, s->recv_next))
1252 {
1253 /* normal enqueue */
1254 return (0);
1255 }
1256
1257 left_edge = s->recv_next - s->rx_datalen;
1258#if 0
1259 right_edge = s->recv_next + s->adv_win;
1260#else
1261 right_edge = s->recv_next + s->max_rx_data - s->rx_datalen;
1262#endif
1263
1264 /* segment is left of expected recv-window
1265 */
1266 if (SEQ_LEQ(seqnum, left_edge) &&
1267 SEQ_LEQ(seqnum + len, left_edge))
1268 {
1269 return (0);
1270 }
1271
1272 /* Some of the segment is left of expected recv-window
1273 */
1274 if (SEQ_LEQ(seqnum, left_edge) &&
1275 SEQ_BETWEEN(seqnum + len, left_edge+1, right_edge))
1276 {
1277 size = seqnum + len - left_edge;
1278 ofs = left_edge - seqnum;
1279 memcpy (s->rx_data + s->rx_datalen, data + ofs, size);
1280 return (0);
1281 }
1282
1283 /* The normal case
1284 */
1285 if (SEQ_BETWEEN(seqnum,left_edge,right_edge-1) &&
1286 SEQ_GT(seqnum+len,right_edge))
1287 {
1288 size = len;
1289 ofs = seqnum - left_edge;
1290 memcpy (s->rx_data + s->rx_datalen + ofs, data, size);
1291 s->rx_datalen += len;
1292 s->recv_next = seqnum + len;
1293 return (0);
1294 }
1295
1296 if (SEQ_GT(seqnum,right_edge))
1297 {
1298 return (0);
1299 }
1300 return (-1); /* unexpected case */
1301}
1302#endif /* USE_NEW_TCP_REASM */
1303
1304#endif /* !USE_UDP_ONLY */
1305
chksum.h
copyrigh.h
ip4_out.h
ip6_in.h
ip6_out.h
language.h
misc.h
misc_str.h
pcconfig.h
pcdbug.h
pcpkt.h
pcqueue.h
_eth_ndis3pkt
BOOL _eth_ndis3pkt
for DOS-programs only
Definition: pcsed.c:56
pcsed.h
pcstat.h
_tcp_close
void _tcp_close(_tcp_Socket *s)
Close a TCP connection.
Definition: pctcp.c:471
_tcp_unthread
_tcp_Socket * _tcp_unthread(_tcp_Socket *ds, BOOL free_tx)
Unthread a socket from the tcp socket list, if it's there.
Definition: pctcp.c:602
pctcp.h
sock_ini.h
split.h
in6_Header
Definition: wattcp.h:381
in_Header
Definition: wattcp.h:329
tcp_Header
Definition: wattcp.h:418
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::window
UINT window
other guy's window
Definition: wattcp.h:608
tcp_Socket::tx_queuelen
UINT tx_queuelen
optional Tx queue length
Definition: wattcp.h:649
tcp_Socket::tx_datalen
UINT tx_datalen
number of bytes of data to send
Definition: wattcp.h:652
tcp_Socket::max_seg
UINT max_seg
MSS for this connection.
Definition: wattcp.h:630
tcp_Socket::tos
BYTE tos
TOS from IP-header.
Definition: wattcp.h:620
tcp_Socket::karn_count
BYTE karn_count
count of packets
Definition: wattcp.h:619
tcp_Socket::rtt_time
DWORD rtt_time
Round Trip Time value.
Definition: wattcp.h:623
tcp_Socket::unhappy
BYTE unhappy
flag, indicates retransmitting segt's
Definition: wattcp.h:604
tcp_Socket::timeout
DWORD timeout
timer for retrans etc.
Definition: wattcp.h:603
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
tcp_Socket::tx_data
BYTE * tx_data
Tx data buffer (default tx_buf[])
Definition: wattcp.h:654
tcp_Socket::last_seqnum
DWORD last_seqnum[2]
increments
Definition: wattcp.h:601
tcp_Socket::ts_echo
DWORD ts_echo
last TimeStamp echo received
Definition: wattcp.h:628
tcp_Socket::adv_win
UINT adv_win
our last advertised window
Definition: wattcp.h:609
tcp_Socket::missed_seq
DWORD missed_seq[2]
S.
Definition: wattcp.h:637
tcp_Socket::tx_buf
BYTE tx_buf[tcp_MaxTxBufSize+1]
data for transmission
Definition: wattcp.h:655
tcp_Socket::send_una
long send_una
unacked send data, must be signed
Definition: wattcp.h:597
tcp_Socket::ts_recent
DWORD ts_recent
last TimeStamp value received
Definition: wattcp.h:627
tcp_Socket::send_next
DWORD send_next
SEQ we send but not ACK-ed by peer.
Definition: wattcp.h:596
tcp_Socket::max_tx_data
UINT max_tx_data
Last index for tx_data[].
Definition: wattcp.h:653
tcp_Socket::recv_next
DWORD recv_next
SEQ number we expect to receive.
Definition: wattcp.h:595
tcp_Socket::flags
WORD flags
TCP flags used in next Tx.
Definition: wattcp.h:606
tcp_reasm
Definition: tcp_fsm.c:83
tcp_synsent_state
static int tcp_synsent_state(_tcp_Socket **, const in_Header *, tcp_Header *, int)
Definition: tcp_fsm.c:210
tcp_process_options
static void tcp_process_options(_tcp_Socket *s, const tcp_Header *tcp, const BYTE *tcp_data, int flags)
Process TCP options in segment.
Definition: tcp_fsm.c:714
tcp_set_window
static void tcp_set_window(_tcp_Socket *s, const tcp_Header *tcp)
Allocate a Tx-buffer based on peer's advertised window.
Definition: tcp_fsm.c:1196
tcp_process_data
static int tcp_process_data(_tcp_Socket *s, const tcp_Header *tcp, int len, int *flags)
Process the data in an incoming segment.
Definition: tcp_fsm.c:1009
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
timer.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_fsm.h Source File

  • inc
  • netinet
tcp_fsm.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_TCP_FSM_H
39#define __NETINET_TCP_FSM_H
40
41/*
42 * TCP FSM state definitions.
43 * Per RFC793, September, 1981.
44 */
45
46#define TCP_NSTATES 11
47
48#define TCPS_CLOSED 0 /* closed */
49#define TCPS_LISTEN 1 /* listening for connection */
50#define TCPS_SYN_SENT 2 /* active, have sent syn */
51#define TCPS_SYN_RECEIVED 3 /* have send and received syn */
52/* states < TCPS_ESTABLISHED are those where connections not established */
53#define TCPS_ESTABLISHED 4 /* established */
54#define TCPS_CLOSE_WAIT 5 /* rcvd fin, waiting for close */
55/* states > TCPS_CLOSE_WAIT are those where user has closed */
56#define TCPS_FIN_WAIT_1 6 /* have closed, sent fin */
57#define TCPS_CLOSING 7 /* closed xchd FIN; await FIN ACK */
58#define TCPS_LAST_ACK 8 /* had fin and close; await FIN ACK */
59/* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */
60#define TCPS_FIN_WAIT_2 9 /* have closed, fin is acked */
61#define TCPS_TIME_WAIT 10 /* in 2*msl quiet wait after close */
62
63#define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED)
64#define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED)
65#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT)
66
67#ifdef TCPOUTFLAGS
68/*
69 * Flags used when sending segments in tcp_output.
70 * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally
71 * determined by state, with the proviso that TH_FIN is sent only
72 * if all data queued for output is included in the segment.
73 */
74static u_char tcp_outflags[TCP_NSTATES] = {
75 TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK,
76 TH_ACK, TH_ACK,
77 TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK,
78};
79#endif
80
81#ifdef KPROF
82int tcp_acounts[TCP_NSTATES][PRU_NREQ];
83#endif
84
85#ifdef TCPSTATES
86char *tcpstates[] = {
87 "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD",
88 "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING",
89 "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT",
90};
91#endif
92
93#endif


Watt-32 tcp/ip: E:/WATT/src/tcp_md5.c Source File

  • src
tcp_md5.c
Go to the documentation of this file.
1
38#include <stdio.h>
39#include <stdarg.h>
40#include <stdlib.h>
41#include <string.h>
42
43#include "wattcp.h"
44#include "chksum.h"
45#include "misc.h"
46#include "misc_str.h"
47#include "pctcp.h"
48
49#if defined(USE_TCP_MD5)
50
51/* MD5 context.
52 */
53typedef struct {
54 DWORD state [4]; /* state (ABCD) */
55 DWORD count [2]; /* number of bits, modulo 2^64 (LSB first) */
56 BYTE buffer [64]; /* input buffer */
57 } MD5_CTX;
58
59static void MD5_Init (MD5_CTX *context);
60static void MD5_Update (MD5_CTX *context, const void *buffer, size_t length);
61static void MD5_Final (BYTE result[16], MD5_CTX *context);
62
63const char *W32_CALL tcp_md5_secret (_tcp_Socket *sock, const char *secret)
64{
65 char *old = sock->secret;
66
67 if (old)
68 free (old);
69 sock->secret = secret ? strdup (secret) : NULL;
70 return (old);
71}
72
73/*
74 * Used to insert the MD5 signature *after* we've built the complete
75 * TCP packet.
76 */
77void W32_CALL make_md5_signature (const in_Header *ip, const tcp_Header *tcp,
78 WORD datalen, const char *secret, BYTE *buf)
79{
80 struct tcp_PseudoHeader ph;
81 struct tcp_Header tcp_copy;
82 const BYTE *data = (const BYTE*)tcp + (tcp->offset << 2);
83 MD5_CTX ctx;
84
85 MD5_Init (&ctx);
86
87 /* Step 1: Update MD5 hash with IP pseudo-header.
88 */
89 memset (&ph, 0, sizeof(ph));
90 ph.src = ip->source;
91 ph.dst = ip->destination;
92 ph.protocol = ip->proto;
93 ph.length = intel16 (datalen);
94
95 MD5_Update (&ctx, &ph.src, sizeof(ph.src));
96 MD5_Update (&ctx, &ph.dst, sizeof(ph.dst));
97 MD5_Update (&ctx, &ph.mbz, sizeof(ph.mbz));
98 MD5_Update (&ctx, &ph.protocol, sizeof(ph.protocol));
99 MD5_Update (&ctx, &ph.length, sizeof(ph.length));
100
101 /* Step 2: Update MD5 hash with TCP header, excluding options.
102 * The TCP checksum must be set to zero.
103 */
104 memcpy (&tcp_copy, tcp, sizeof(tcp_copy));
105 tcp_copy.checksum = 0;
106 MD5_Update (&ctx, &tcp_copy, sizeof(tcp_copy));
107
108 /* Step 3: Update MD5 hash with TCP segment data, if present.
109 */
110 if (datalen > 0)
111 MD5_Update (&ctx, data, datalen);
112
113 /* Step 4: Update MD5 hash with shared secret.
114 */
115 MD5_Update (&ctx, secret, strlen(secret));
116 MD5_Final (buf, &ctx);
117}
118
119/*
120 * Check incoming TCP segment for MD5 option.
121 */
122BOOL W32_CALL check_md5_signature (const _tcp_Socket *s, const in_Header *ip)
123{
124 const struct tcp_Header *tcp;
125 const BYTE *recv_sign, *data, *opt;
126 struct tcp_PseudoHeader ph;
127 struct tcp_Header tcp_copy;
128
129 BYTE signature [16];
130 MD5_CTX ctx;
131 WORD len;
132
133 if (!s->secret)
134 return (FALSE);
135
136 WATT_ASSERT (ip->ver == 4);
137
138 tcp = (tcp_Header*) ((BYTE*)ip + in_GetHdrLen (ip));
139
140 len = intel16 (ip->length) - in_GetHdrLen (ip);
141 len -= (tcp->offset << 2);
142 data = (const BYTE*)tcp + (tcp->offset << 2);
143
144 /* find the TCPOPT_SIGNATURE signature
145 */
146 recv_sign = NULL;
147 for (opt = (const BYTE*)(tcp+1); opt < data; )
148 {
149 if (*opt == TCPOPT_SIGNATURE)
150 {
151 recv_sign = opt + 2;
152 break;
153 }
154 if (*opt == TCPOPT_EOL)
155 break;
156
157 if (*opt == TCPOPT_NOP)
158 opt++;
159 else opt += *(opt+1);
160 }
161
162 if (!recv_sign || opt[1] != TCPOPT_SIGN_LEN)
163 return (FALSE);
164
165 MD5_Init (&ctx);
166
167 /* Step 1: Update MD5 hash with IP pseudo-header.
168 */
169 memset (&ph, 0, sizeof(ph));
170 ph.src = ip->source;
171 ph.dst = ip->destination;
172 ph.protocol = ip->proto;
173 ph.length = intel16 (len);
174
175 MD5_Update (&ctx, &ph.src, sizeof(ph.src));
176 MD5_Update (&ctx, &ph.dst, sizeof(ph.dst));
177 MD5_Update (&ctx, &ph.mbz, sizeof(ph.mbz));
178 MD5_Update (&ctx, &ph.protocol, sizeof(ph.protocol));
179 MD5_Update (&ctx, &ph.length, sizeof(ph.length));
180
181 /* Step 2: Update MD5 hash with TCP header, excluding options.
182 * The TCP checksum must be set to zero.
183 */
184 memcpy (&tcp_copy, tcp, sizeof(tcp_copy));
185 tcp_copy.checksum = 0;
186 MD5_Update (&ctx, &tcp_copy, sizeof(tcp_copy));
187
188 /* Step 3: Update MD5 hash with TCP segment data, if present.
189 */
190 if (len > 0)
191 MD5_Update (&ctx, data, len);
192
193 /* Step 4: Update MD5 hash with shared secret.
194 */
195 MD5_Update (&ctx, s->secret, strlen(s->secret));
196 MD5_Final (signature, &ctx);
197
198 if (!memcmp(recv_sign, signature, sizeof(signature)))
199 return (TRUE);
200 return (FALSE);
201}
202
203/*
204 * taken from RFC-1321/Appendix A.3
205 * MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
206 */
207
208/*
209 * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights
210 * reserved.
211 *
212 * License to copy and use this software is granted provided that it is
213 * identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm"
214 * in all material mentioning or referencing this software or this function.
215 *
216 * License is also granted to make and use derivative works provided that such
217 * works are identified as "derived from the RSA Data Security, Inc. MD5
218 * Message-Digest Algorithm" in all material mentioning or referencing the
219 * derived work.
220 *
221 * RSA Data Security, Inc. makes no representations concerning either the
222 * merchantability of this software or the suitability of this software for
223 * any particular purpose. It is provided "as is" without express or implied
224 * warranty of any kind.
225 *
226 * These notices must be retained in any copies of any part of this
227 * documentation and/or software.
228 */
229
230/*
231 * Constants for MD5Transform routine.
232 */
233#define S11 7
234#define S12 12
235#define S13 17
236#define S14 22
237#define S21 5
238#define S22 9
239#define S23 14
240#define S24 20
241#define S31 4
242#define S32 11
243#define S33 16
244#define S34 23
245#define S41 6
246#define S42 10
247#define S43 15
248#define S44 21
249
250static void Transform (DWORD[4], const BYTE *);
251static void Encode (BYTE *, const DWORD *, size_t);
252static void Decode (DWORD *, const BYTE *, size_t);
253
254static BYTE padding[64] = {
255 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
256 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
257 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
258 0, 0
259 };
260
261/*
262 * F, G, H and I are basic MD5 functions.
263 */
264#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
265#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
266#define H(x, y, z) ((x) ^ (y) ^ (z))
267#define I(x, y, z) ((y) ^ ((x) | (~z)))
268
269/*
270 * ROTATE_LEFT rotates x left n bits.
271 */
272#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
273
274/*
275 * FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. Rotation is
276 * separate from addition to prevent recomputation.
277 */
278#define FF(a, b, c, d, x, s, ac) { \
279 (a) += F ((b), (c), (d)) + (x) + (DWORD)(ac); \
280 (a) = ROTATE_LEFT ((a), (s)); \
281 (a) += (b); \
282 }
283#define GG(a, b, c, d, x, s, ac) { \
284 (a) += G ((b), (c), (d)) + (x) + (DWORD)(ac); \
285 (a) = ROTATE_LEFT ((a), (s)); \
286 (a) += (b); \
287 }
288#define HH(a, b, c, d, x, s, ac) { \
289 (a) += H ((b), (c), (d)) + (x) + (DWORD)(ac); \
290 (a) = ROTATE_LEFT ((a), (s)); \
291 (a) += (b); \
292 }
293#define II(a, b, c, d, x, s, ac) { \
294 (a) += I ((b), (c), (d)) + (x) + (DWORD)(ac); \
295 (a) = ROTATE_LEFT ((a), (s)); \
296 (a) += (b); \
297 }
298
299/*
300 * MD5 initialization. Begins an MD5 operation, writing a new context.
301 */
302static void MD5_Init (MD5_CTX *context)
303{
304 context->count[0] = context->count[1] = 0;
305
306 /* Load magic initialization constants.
307 */
308 context->state[0] = 0x67452301;
309 context->state[1] = 0xefcdab89;
310 context->state[2] = 0x98badcfe;
311 context->state[3] = 0x10325476;
312}
313
314/*
315 * MD5 block update operation. Continues an MD5 message-digest operation,
316 * processing another message block, and updating the context.
317 */
318static void MD5_Update (MD5_CTX *context, /* context */
319 const void *input, /* input block */
320 size_t inputLen) /* length of input block */
321{
322 DWORD i, index, partLen;
323
324 /* Compute number of bytes mod 64 */
325 index = (DWORD) ((context->count[0] >> 3) & 0x3F);
326
327 /* Update number of bits */
328 if ((context->count[0] += ((DWORD)inputLen << 3)) < ((DWORD)inputLen << 3))
329 context->count[1]++;
330 context->count[1] += ((DWORD)inputLen >> 29);
331
332 partLen = 64 - index;
333
334 /* Transform as many times as possible.
335 */
336 if (inputLen >= partLen)
337 {
338 memcpy (&context->buffer[index], input, partLen);
339 Transform (context->state, context->buffer);
340
341 for (i = partLen; i + 63 < inputLen; i += 64)
342 Transform (context->state, (const BYTE*)input+i);
343 index = 0;
344 }
345 else
346 i = 0;
347
348 /* Buffer remaining input */
349 memcpy (&context->buffer[index], (const char*)input+i, inputLen-i);
350}
351
352/*
353 * MD5 finalization. Ends an MD5 message-digest operation, writing the
354 * message digest and zeroizing the context.
355 */
356static void MD5_Final (BYTE digest[16], /* message digest */
357 MD5_CTX *context) /* context */
358{
359 BYTE bits[8];
360 DWORD index, padLen;
361
362 /* Save number of bits */
363 Encode (bits, context->count, 8);
364
365 /* Pad out to 56 mod 64. */
366 index = (DWORD) ((context->count[0] >> 3) & 0x3f);
367 padLen = (index < 56) ? (56 - index) : (120 - index);
368 MD5_Update (context, padding, padLen);
369
370 /* Append length (before padding) */
371 MD5_Update (context, bits, 8);
372
373 /* Store state in digest */
374 Encode (digest, context->state, 16);
375
376 /* Zeroize sensitive information. */
377 memset (context, 0, sizeof(*context));
378}
379
380/*
381 * MD5 basic transformation. Transforms state based on block.
382 */
383static void Transform (DWORD state[4], const BYTE *block)
384{
385 DWORD a = state[0];
386 DWORD b = state[1];
387 DWORD c = state[2];
388 DWORD d = state[3];
389 DWORD x[16];
390
391 Decode (x, block, 64);
392
393 /* Round 1 */
394 FF (a, b, c, d, x[0], S11, 0xd76aa478); /* 1 */
395 FF (d, a, b, c, x[1], S12, 0xe8c7b756); /* 2 */
396 FF (c, d, a, b, x[2], S13, 0x242070db); /* 3 */
397 FF (b, c, d, a, x[3], S14, 0xc1bdceee); /* 4 */
398 FF (a, b, c, d, x[4], S11, 0xf57c0faf); /* 5 */
399 FF (d, a, b, c, x[5], S12, 0x4787c62a); /* 6 */
400 FF (c, d, a, b, x[6], S13, 0xa8304613); /* 7 */
401 FF (b, c, d, a, x[7], S14, 0xfd469501); /* 8 */
402 FF (a, b, c, d, x[8], S11, 0x698098d8); /* 9 */
403 FF (d, a, b, c, x[9], S12, 0x8b44f7af); /* 10 */
404 FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
405 FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
406 FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
407 FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
408 FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
409 FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
410
411 /* Round 2 */
412 GG (a, b, c, d, x[1], S21, 0xf61e2562); /* 17 */
413 GG (d, a, b, c, x[6], S22, 0xc040b340); /* 18 */
414 GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
415 GG (b, c, d, a, x[0], S24, 0xe9b6c7aa); /* 20 */
416 GG (a, b, c, d, x[5], S21, 0xd62f105d); /* 21 */
417 GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */
418 GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
419 GG (b, c, d, a, x[4], S24, 0xe7d3fbc8); /* 24 */
420 GG (a, b, c, d, x[9], S21, 0x21e1cde6); /* 25 */
421 GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
422 GG (c, d, a, b, x[3], S23, 0xf4d50d87); /* 27 */
423 GG (b, c, d, a, x[8], S24, 0x455a14ed); /* 28 */
424 GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
425 GG (d, a, b, c, x[2], S22, 0xfcefa3f8); /* 30 */
426 GG (c, d, a, b, x[7], S23, 0x676f02d9); /* 31 */
427 GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
428
429 /* Round 3 */
430 HH (a, b, c, d, x[5], S31, 0xfffa3942); /* 33 */
431 HH (d, a, b, c, x[8], S32, 0x8771f681); /* 34 */
432 HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
433 HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
434 HH (a, b, c, d, x[1], S31, 0xa4beea44); /* 37 */
435 HH (d, a, b, c, x[4], S32, 0x4bdecfa9); /* 38 */
436 HH (c, d, a, b, x[7], S33, 0xf6bb4b60); /* 39 */
437 HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
438 HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
439 HH (d, a, b, c, x[0], S32, 0xeaa127fa); /* 42 */
440 HH (c, d, a, b, x[3], S33, 0xd4ef3085); /* 43 */
441 HH (b, c, d, a, x[6], S34, 0x4881d05); /* 44 */
442 HH (a, b, c, d, x[9], S31, 0xd9d4d039); /* 45 */
443 HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
444 HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
445 HH (b, c, d, a, x[2], S34, 0xc4ac5665); /* 48 */
446
447 /* Round 4 */
448 II (a, b, c, d, x[0], S41, 0xf4292244); /* 49 */
449 II (d, a, b, c, x[7], S42, 0x432aff97); /* 50 */
450 II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
451 II (b, c, d, a, x[5], S44, 0xfc93a039); /* 52 */
452 II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
453 II (d, a, b, c, x[3], S42, 0x8f0ccc92); /* 54 */
454 II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
455 II (b, c, d, a, x[1], S44, 0x85845dd1); /* 56 */
456 II (a, b, c, d, x[8], S41, 0x6fa87e4f); /* 57 */
457 II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
458 II (c, d, a, b, x[6], S43, 0xa3014314); /* 59 */
459 II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
460 II (a, b, c, d, x[4], S41, 0xf7537e82); /* 61 */
461 II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
462 II (c, d, a, b, x[2], S43, 0x2ad7d2bb); /* 63 */
463 II (b, c, d, a, x[9], S44, 0xeb86d391); /* 64 */
464
465 state[0] += a;
466 state[1] += b;
467 state[2] += c;
468 state[3] += d;
469
470 /* Zeroize sensitive information. */
471 memset (&x, 0, sizeof(x));
472}
473
474/*
475 * Encodes input (DWORD) into output (BYTE). Assumes len is a
476 * multiple of 4.
477 */
478static void Encode (BYTE *output, const DWORD *input, size_t len)
479{
480 size_t i, j;
481
482 for (i = 0, j = 0; j < len; i++, j += 4)
483 {
484#if 0
485 output[j] = (BYTE) (input[i] & 0xff);
486 output[j+1] = (BYTE) ((input[i] >> 8) & 0xff);
487 output[j+2] = (BYTE) ((input[i] >> 16) & 0xff);
488 output[j+3] = (BYTE) ((input[i] >> 24) & 0xff);
489#else
490 *(DWORD*) (output+j) = intel (input[i]);
491#endif
492 }
493}
494
495/*
496 * Decodes input (BYTE) into output (DWORD). Assumes len is a
497 * multiple of 4.
498 */
499static void Decode (DWORD *output, const BYTE *input, size_t len)
500{
501 size_t i, j;
502
503 for (i = 0, j = 0; j < len; i++, j += 4)
504#if 0
505 output[i] = ((DWORD)input[j]) |
506 (((DWORD)input[j+1]) << 8) |
507 (((DWORD)input[j+2]) << 16) |
508 (((DWORD)input[j+3]) << 24);
509#else
510 output[i] = intel (*(DWORD*)(input+j));
511#endif
512}
513
514#endif /* USE_TCP_MD5 */
chksum.h
misc.h
misc_str.h
pctcp.h
MD5_CTX
Definition: tcp_md5.c:53
in_Header
Definition: wattcp.h:329
tcp_Header
Definition: wattcp.h:418
tcp_PseudoHeader
Definition: wattcp.h:449
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::secret
char * secret
< linked-list of frags; not yet
Definition: wattcp.h:641
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_scor.h Source File

  • inc
  • netinet
tcp_scor.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1997, Pittsburgh Supercomputing Center,
7 * Jamshid Mahdavi, Matt Mathis, Jeffrey Semke
8 * All rights reserved.
9 *
10 * Permission to use, copy, modify, and distribute this software and
11 * its documentation for any purpose and without fee is hereby granted,
12 * provided that the above copyright notice appear in all copies and
13 * that both that copyright notice and this permission notice appear
14 * in supporting documentation.
15 *
16 * This is experimental software under active development and may
17 * potentially contain bugs. Use at your own risk.
18 */
19
20#ifndef __NETINET_TCP_SCOREBOARD_H
21#define __NETINET_TCP_SCOREBOARD_H
22
23#include <netinet/tcp.h>
24#include <sys/queue.h>
25
26/**********************************************************************
27 *
28 * Scoreboard module headers:
29 *
30 **********************************************************************/
31
32/* Initialize the scoreboard
33 */
34#define scrb_init(tp) { LIST_INIT(&((tp)->scrb.head)); \
35 (tp)->scrb.last_ack=(tp)->snd_una; \
36 (tp)->snd_retran_data = 0; }
37
38/*
39 * Check to see if the scoreboard is empty
40 * scrb_isempty(struct tcpcp *tp)
41 */
42#define scrb_isempty(tp) (! ((tp)->scrb.scrb_head))
43
44/* This macro quickly takes care of the common case of an empty
45 * scoreboard. Otherwise it called scrb_getnextretran_func to hunt
46 * through the scoreboard and return the next block of data to be
47 * retransmitted. The start and end of the block are filled in to
48 * start_ptr and end_ptr, and the length of the block is returned. A
49 * zero return value indicates that there is no data to be
50 * retransmitted at this time. Note that end_ptr actually points to
51 * the first byte of data which is NOT to be retransmitted (or the
52 * first byte following the data to be retransmitted) similar in
53 * fashion to the rest of this code.
54 *
55 * scrb_getnextretran(struct tcpcp *tp, tcp_seq *start, tcp_seq *end)
56 */
57
58#define scrb_getnextretran(tp,start,end) \
59 (scrb_isempty(tp) ? \
60 (int)((tcp_seq*)*start = (tcp_seq*)*end = \
61 (tcp_seq*)0) \
62 : scrb_getnextretran_func(tp,start,end))
63
64
65/* sender side -- tracks packets sent that WERE selectively acknowledged
66 * by the other end.
67 * Each sb_entry represents a hole (missing data) followed by
68 * consecutive received data.
69 */
70struct scrb_entry {
71 LIST_ENTRY(scrb_entry) ptrs; /* Next/Prev structure pointers */
72 tcp_seq start; /* Start of received data block */
73 tcp_seq end; /* End of received data block */
74 tcp_seq retran; /* End of subsequent data
75 retransmitted */
76 tcp_seq snd_max; /* Value of snd_max at the time of
77 retransmission */
78 int sack_cnt; /* FACK ONLY: Number of reports for
79 this hole */
80};
81
82#define scrb_next ptrs.le_next /* next element */
83#define scrb_prev ptrs.le_prev /* previous element */
84
85
86/* sender side -- tracks packets sent that were selectively
87 * acknowledged by the other end
88 */
89struct scoreboard {
90 tcp_seq last_ack; /* This value replicates snd_una,
91 but is needed for internal
92 scoreboard state. */
93 LIST_HEAD(scrb_head_internal, scrb_entry) head; /* Scoreboard list */
94};
95
96#define scrb_head head.lh_first /* first element of scoreboard */
97
98/* return codes from routines that might have to clear the scoreboard
99 */
100#define E_SCRB_CLEAR -1
101#define E_SCRB_NOERR 0
102
103/* reason parameters for scrb_clear
104 */
105#define SCRB_INIT 0
106#define SCRB_RENEGE 1
107#define SCRB_NOMEM 2
108#define SCRB_TIMEOUT 3
109
110#endif /* __NETINET_TCP_SCOREBOARD_H */
tcp.h
queue.h
scoreboard
Definition: tcp_scor.h:89
scrb_entry
Definition: tcp_scor.h:70


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_seq.h Source File

  • inc
  • netinet
tcp_seq.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993, 1995
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_TCP_SEQ_H
39#define __NETINET_TCP_SEQ_H
40
41/*
42 * TCP sequence numbers are 32 bit integers operated
43 * on with modular arithmetic. These macros can be
44 * used to compare such integers.
45 */
46#define SEQ_LT(a,b) ((long)((a)-(b)) < 0)
47#define SEQ_LEQ(a,b) ((long)((a)-(b)) <= 0)
48#define SEQ_GT(a,b) ((long)((a)-(b)) > 0)
49#define SEQ_GEQ(a,b) ((long)((a)-(b)) >= 0)
50
51/* for modulo comparisons of timestamps */
52#define TSTMP_LT(a,b) ((long)((a)-(b)) < 0)
53#define TSTMP_GEQ(a,b) ((long)((a)-(b)) >= 0)
54
55/*
56 * TCP connection counts are 32 bit integers operated
57 * on with modular arithmetic. These macros can be
58 * used to compare such integers.
59 */
60#define CC_LT(a,b) ((long)((a)-(b)) < 0)
61#define CC_LEQ(a,b) ((long)((a)-(b)) <= 0)
62#define CC_GT(a,b) ((long)((a)-(b)) > 0)
63#define CC_GEQ(a,b) ((long)((a)-(b)) >= 0)
64
65/* Macro to increment a CC: skip 0 which has a special meaning */
66#define CC_INC(c) (++(c) == 0 ? ++(c) : (c))
67
68/*
69 * Macros to initialize tcp sequence numbers for
70 * send and receive from initial send and receive
71 * sequence numbers.
72 */
73#define tcp_rcvseqinit(tp) \
74 (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1
75
76#if defined(TCP_SACK)
77#define tcp_sendseqinit(tp) \
78 (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
79 (tp)->recover = (tp)->sb.last_ack = (tp)->iss
80
81#elif defined(TCP_FACK)
82#define tcp_sendseqinit(tp) \
83 (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
84 (tp)->recover = (tp)->scrb.last_ack = (tp)->snd_fack = (tp)->iss
85
86#else
87#define tcp_sendseqinit(tp) \
88 (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
89 (tp)->iss
90#endif
91
92#define TCP_PAWS_IDLE (24 * 24 * 60 * 60 * PR_SLOWHZ)
93 /* timestamp wrap-around time */
94
95#define TCP_ISSINCR (125*1024) /* increment for tcp_iss each second */
96
97#ifdef _KERNEL
98tcp_seq tcp_iss; /* tcp initial send seq # */
99#endif
100
101#endif


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_time.h Source File

  • inc
  • netinet
tcp_time.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_TCP_TIMER_H
39#define __NETINET_TCP_TIMER_H
40
41/*
42 * Definitions of the TCP timers. These timers are counted
43 * down PR_SLOWHZ times a second.
44 */
45#define TCPT_NTIMERS 4
46
47#define TCPT_REXMT 0 /* retransmit */
48#define TCPT_PERSIST 1 /* retransmit persistence */
49#define TCPT_KEEP 2 /* keep alive */
50#define TCPT_2MSL 3 /* 2*msl quiet time timer */
51
52/*
53 * The TCPT_REXMT timer is used to force retransmissions.
54 * The TCP has the TCPT_REXMT timer set whenever segments
55 * have been sent for which ACKs are expected but not yet
56 * received. If an ACK is received which advances tp->snd_una,
57 * then the retransmit timer is cleared (if there are no more
58 * outstanding segments) or reset to the base value (if there
59 * are more ACKs expected). Whenever the retransmit timer goes off,
60 * we retransmit one unacknowledged segment, and do a backoff
61 * on the retransmit timer.
62 *
63 * The TCPT_PERSIST timer is used to keep window size information
64 * flowing even if the window goes shut. If all previous transmissions
65 * have been acknowledged (so that there are no retransmissions in progress),
66 * and the window is too small to bother sending anything, then we start
67 * the TCPT_PERSIST timer. When it expires, if the window is nonzero,
68 * we go to transmit state. Otherwise, at intervals send a single byte
69 * into the peer's window to force him to update our window information.
70 * We do this at most as often as TCPT_PERSMIN time intervals,
71 * but no more frequently than the current estimate of round-trip
72 * packet time. The TCPT_PERSIST timer is cleared whenever we receive
73 * a window update from the peer.
74 *
75 * The TCPT_KEEP timer is used to keep connections alive. If an
76 * connection is idle (no segments received) for TCPTV_KEEP_INIT amount of time,
77 * but not yet established, then we drop the connection. Once the connection
78 * is established, if the connection is idle for TCPTV_KEEP_IDLE time
79 * (and keepalives have been enabled on the socket), we begin to probe
80 * the connection. We force the peer to send us a segment by sending:
81 * <SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK>
82 * This segment is (deliberately) outside the window, and should elicit
83 * an ack segment in response from the peer. If, despite the TCPT_KEEP
84 * initiated segments we cannot elicit a response from a peer in TCPT_MAXIDLE
85 * amount of time probing, then we drop the connection.
86 */
87
88/*
89 * Time constants.
90 */
91#define TCPTV_MSL ( 30*PR_SLOWHZ) /* max seg lifetime (hah!) */
92#define TCPTV_SRTTBASE 0 /* base roundtrip time;
93 if 0, no idea yet */
94#define TCPTV_RTOBASE ( 3*PR_SLOWHZ) /* assumed RTO if no info */
95#define TCPTV_SRTTDFLT ( 3*PR_SLOWHZ) /* assumed RTT if no info */
96
97#define TCPTV_PERSMIN ( 5*PR_SLOWHZ) /* retransmit persistence */
98#define TCPTV_PERSMAX ( 60*PR_SLOWHZ) /* maximum persist interval */
99
100#define TCPTV_KEEP_INIT ( 75*PR_SLOWHZ) /* initial connect keep alive */
101#define TCPTV_KEEP_IDLE (120*60*PR_SLOWHZ) /* dflt time before probing */
102#define TCPTV_KEEPINTVL ( 75*PR_SLOWHZ) /* default probe interval */
103#define TCPTV_KEEPCNT 8 /* max probes before drop */
104
105#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */
106#define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */
107
108#define TCPTV_TWTRUNC 8 /* RTO factor to truncate TW */
109
110#define TCP_LINGERTIME 120 /* linger at most 2 minutes */
111
112#define TCP_MAXRXTSHIFT 12 /* maximum retransmits */
113
114#ifdef TCPTIMERS
115static char *tcptimers[] =
116 { "REXMT", "PERSIST", "KEEP", "2MSL" };
117#endif
118
119/*
120 * Force a time value to be in a certain range.
121 */
122#define TCPT_RANGESET(tv, value, tvmin, tvmax) { \
123 (tv) = (value); \
124 if ((u_long)(tv) < (u_long)(tvmin)) \
125 (tv) = (tvmin); \
126 else if ((u_long)(tv) > (u_long)(tvmax)) \
127 (tv) = (tvmax); \
128 }
129
130#endif


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcp_var.h Source File

  • inc
  • netinet
tcp_var.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993, 1994, 1995
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_TCP_VAR_H
39#define __NETINET_TCP_VAR_H
40
41#ifndef __SYS_MBUF_H
42#include <sys/mbuf.h>
43#endif
44
45#ifndef __NETINET_TCP_TIMER_H
46#include <netinet/tcp_time.h>
47#endif
48
49#include <netinet/tcpip.h>
50
51/*
52 * Kernel variables for tcp.
53 */
54
55#ifdef TCP_AUTO
56 /* AUTO_RCV_HITHRESH flush reassembly queue, drop incoming packets
57 */
58 #define AUTO_RCV_HITHRESH (u_long)(0.95 * NMBCLUSTERS)
59
60 /* AUTO_RCV_LOWTHRESH drop incoming packets
61 */
62 #define AUTO_RCV_LOWTHRESH (u_long)(0.9 * NMBCLUSTERS)
63
64 /* AUTO_SND_THRESH reduce so_snd.sb_hiwat by acked
65 */
66 #define AUTO_SND_THRESH (u_long)(0.50 * NMBCLUSTERS)
67#endif
68
69#if defined(TCP_SACK) || defined(TCP_FACK)
70#include <netinet/tcp_scor.h>
71
72struct sackblock {
73 tcp_seq start;
74 tcp_seq end;
75 };
76#endif
77
78/*
79 * Tcp control block, one per tcp; fields:
80 */
81struct tcpcb {
82 struct tcpiphdr *seg_next; /* sequencing queue */
83 struct tcpiphdr *seg_prev;
84 /* !! struct ipqehead segq; */ /* sequencing queue */
85 int t_state; /* state of this connection */
86 int t_timer[TCPT_NTIMERS]; /* tcp timers */
87 int t_rxtshift; /* log(2) of rexmt exp. backoff */
88 int t_rxtcur; /* current retransmit value */
89#ifdef TCP_FACK
90 short t_padd; /* filler to preserve alignment */
91#else
92 short t_dupacks; /* consecutive dup acks recd */
93#endif
94 u_int t_maxseg; /* maximum segment size */
95 u_int t_maxopd; /* mss plus options */
96 int t_force; /* 1 if forcing out a byte */
97 u_int t_flags;
98#define TF_ACKNOW 0x0001 /* ack peer immediately */
99#define TF_DELACK 0x0002 /* ack, but try to delay it */
100#define TF_NODELAY 0x0004 /* don't delay packets to coalesce */
101#define TF_NOOPT 0x0008 /* don't use tcp options */
102#define TF_SENTFIN 0x0010 /* have sent FIN */
103#define TF_REQ_SCALE 0x0020 /* have/will request window scaling */
104#define TF_RCVD_SCALE 0x0040 /* other side has requested scaling */
105#define TF_REQ_TSTMP 0x0080 /* have/will request timestamps */
106#define TF_RCVD_TSTMP 0x0100 /* a timestamp was received in SYN */
107#define TF_SACK_PERMIT 0x0200 /* other side said I could SACK */
108#define TF_NEEDSYN 0x0400 /* send SYN (implicit state) */
109#define TF_NEEDFIN 0x0800 /* send FIN (implicit state) */
110#define TF_NOPUSH 0x1000 /* don't push */
111#define TF_REQ_CC 0x2000 /* have/will request CC */
112#define TF_RCVD_CC 0x4000 /* a CC was received in SYN */
113#define TF_SENDCCNEW 0x8000 /* send CCnew instead of CC in SYN */
114
115 struct tcpiphdr *t_template; /* skeletal packet for transmit */
116 struct inpcb *t_inpcb; /* back pointer to internet pcb */
117/*
118 * The following fields are used as in the protocol specification.
119 * See RFC783, Dec. 1981, page 21.
120 */
121/* send sequence variables */
122 tcp_seq snd_una; /* send unacknowledged */
123 tcp_seq snd_nxt; /* send next */
124 tcp_seq snd_up; /* send urgent pointer */
125 tcp_seq snd_wl1; /* window update seg seq number */
126 tcp_seq snd_wl2; /* window update seg ack number */
127 tcp_seq iss; /* initial send sequence number */
128 u_long snd_wnd; /* send window */
129/* receive sequence variables */
130 u_long rcv_wnd; /* receive window */
131 tcp_seq rcv_nxt; /* receive next */
132 tcp_seq rcv_up; /* receive urgent pointer */
133 tcp_seq irs; /* initial receive sequence number */
134/*
135 * Additional variables for this implementation.
136 */
137/* receive variables */
138 tcp_seq rcv_adv; /* advertised window */
139/* retransmit variables */
140 tcp_seq snd_max; /* highest sequence number sent;
141 * used to recognize retransmits
142 */
143/* congestion control (for slow start, source quench, retransmit after loss) */
144 u_long snd_cwnd; /* congestion-controlled window */
145 u_long snd_ssthresh; /* snd_cwnd size threshold for
146 * for slow start exponential to
147 * linear switch
148 */
149/*
150 * transmit timing stuff. See below for scale of srtt and rttvar.
151 * "Variance" is actually smoothed difference.
152 */
153 u_int t_idle; /* inactivity time */
154 int t_rtt; /* round trip time */
155 tcp_seq t_rtseq; /* sequence number being timed */
156 int t_srtt; /* smoothed round-trip time */
157 int t_rttvar; /* variance in round-trip time */
158 u_int t_rttmin; /* minimum rtt allowed */
159 u_long max_sndwnd; /* largest window peer has offered */
160
161/* out-of-band data */
162 char t_oobflags; /* have some */
163 char t_iobc; /* input character */
164#define TCPOOB_HAVEDATA 0x01
165#define TCPOOB_HADDATA 0x02
166 int t_softerror; /* possible error not yet reported */
167
168/* RFC 1323 variables */
169 u_char snd_scale; /* window scaling for send window */
170 u_char rcv_scale; /* window scaling for recv window */
171 u_char request_r_scale; /* pending window scaling */
172 u_char requested_s_scale;
173 u_long ts_recent; /* timestamp echo data */
174 u_long ts_recent_age; /* when last updated */
175 tcp_seq last_ack_sent;
176/* RFC 1644 variables */
177 tcp_cc cc_send; /* send connection count */
178 tcp_cc cc_recv; /* receive connection count */
179 u_long t_duration; /* connection duration */
180
181/* TUBA stuff */
182 caddr_t t_tuba_pcb; /* next level down pcb for TCP over z */
183/* More RTT stuff */
184 u_long t_rttupdated; /* number of times rtt sampled */
185
186#if defined(TCP_FACK) || defined(TCP_AUTO)
187 u_short t_alt_flags; /* experimental flags */
188#define TAF_SACK_SEEN 0x0001 /* other side can send SACKs */
189#define TAF_RECOVERY 0x0002 /* We are recovering from a lost segment */
190#define TAF_RATEHALF 0x0004 /* We are reducing the window during recovery */
191#define TAF_REPAIRED 0x0008 /* We have retransmitted something */
192#define TAF_WHOLD 0x0010 /* we are in the window hold state */
193#define TAF_TOGGLE 0x0020 /* divide by 2 toggle */
194#define TAF_AUTO_OFF 0x0040 /* autotuning is forced off */
195#endif
196
197#if defined(TCP_SACK) || defined(TCP_FACK)
198#define SACK_LIST_LEN 10
199
200/* Needed for SACK and FACK: */
201 struct sackblock sack_list[SACK_LIST_LEN]; /* Hack, keep 5 most recent SACKs */
202 struct scoreboard scrb;
203 int snd_retran_data;
204 tcp_seq recover;
205#endif
206#ifdef TCP_SACK
207 int pipe;
208#endif
209#ifdef TCP_FACK
210 tcp_seq snd_fack;
211#define TCP_FACK_REXMTTHRESH 3 /* number of SACKs before retransmitting a block */
212 u_long lothresh; /* recovery window floor */
213 u_long hithresh; /* maximum window following recovery */
214#endif
215};
216
217/*
218 * Structure to hold TCP options that are only used during segment
219 * processing (in tcp_input), but not held in the tcpcb.
220 * It's basically used to reduce the number of parameters
221 * to tcp_dooptions.
222 */
223struct tcpopt {
224 u_long to_flag; /* which options are present */
225#define TOF_TS 0x0001 /* timestamp */
226#define TOF_CC 0x0002 /* CC and CCnew are exclusive */
227#define TOF_CCNEW 0x0004
228#define TOF_CCECHO 0x0008
229 u_long to_tsval;
230 u_long to_tsecr;
231 tcp_cc to_cc; /* holds CC or CCnew */
232 tcp_cc to_ccecho;
233};
234
235/*
236 * The TAO cache entry which is stored in the protocol family specific
237 * portion of the route metrics.
238 */
239struct rmxp_tao {
240 tcp_cc tao_cc; /* latest CC in valid SYN */
241 tcp_cc tao_ccsent; /* latest CC sent to peer */
242 u_short tao_mssopt; /* peer's cached MSS */
243#ifdef notyet
244 u_short tao_flags; /* cache status flags */
245#define TAOF_DONT 0x0001 /* peer doesn't understand rfc1644 */
246#define TAOF_OK 0x0002 /* peer does understand rfc1644 */
247#define TAOF_UNDEF 0 /* we don't know yet */
248#endif /* notyet */
249};
250#define rmx_taop(r) ((struct rmxp_tao *)(r).rmx_filler)
251
252#define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb)
253#define sototcpcb(so) (intotcpcb(sotoinpcb(so)))
254
255/*
256 * The smoothed round-trip time and estimated variance
257 * are stored as fixed point numbers scaled by the values below.
258 * For convenience, these scales are also used in smoothing the average
259 * (smoothed = (1/scale)sample + ((scale-1)/scale)smoothed).
260 * With these scales, srtt has 3 bits to the right of the binary point,
261 * and thus an "ALPHA" of 0.875. rttvar has 2 bits to the right of the
262 * binary point, and is smoothed with an ALPHA of 0.75.
263 */
264#define TCP_RTT_SCALE 32 /* multiplier for srtt; 3 bits frac. */
265#define TCP_RTT_SHIFT 5 /* shift for srtt; 3 bits frac. */
266#define TCP_RTTVAR_SCALE 16 /* multiplier for rttvar; 2 bits */
267#define TCP_RTTVAR_SHIFT 4 /* shift for rttvar; 2 bits */
268#define TCP_DELTA_SHIFT 2 /* see tcp_input.c */
269
270/*
271 * The initial retransmission should happen at rtt + 4 * rttvar.
272 * Because of the way we do the smoothing, srtt and rttvar
273 * will each average +1/2 tick of bias. When we compute
274 * the retransmit timer, we want 1/2 tick of rounding and
275 * 1 extra tick because of +-1/2 tick uncertainty in the
276 * firing of the timer. The bias will give us exactly the
277 * 1.5 tick we need. But, because the bias is
278 * statistical, we have to test that we don't drop below
279 * the minimum feasible timer (which is 2 ticks).
280 * This version of the macro adapted from a paper by Lawrence
281 * Brakmo and Larry Peterson which outlines a problem caused
282 * by insufficient precision in the original implementation,
283 * which results in inappropriately large RTO values for very
284 * fast networks.
285 */
286#define TCP_REXMTVAL(tp) \
287 ((((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \
288 + (tp)->t_rttvar) >> TCP_DELTA_SHIFT)
289
290/* XXX
291 * We want to avoid doing m_pullup on incoming packets but that
292 * means avoiding dtom on the tcp reassembly code. That in turn means
293 * keeping an mbuf pointer in the reassembly queue (since we might
294 * have a cluster). As a quick hack, the source & destination
295 * port numbers (which are no longer needed once we've located the
296 * tcpcb) are overlayed with an mbuf pointer.
297 */
298#define REASS_MBUF(ti) (*(struct mbuf **)&((ti)->ti_t))
299
300/*
301 * TCP statistics.
302 * Many of these should be kept per connection,
303 * but that's inconvenient at the moment.
304 */
305struct tcpstat {
306 u_long tcps_connattempt; /* connections initiated */
307 u_long tcps_accepts; /* connections accepted */
308 u_long tcps_connects; /* connections established */
309 u_long tcps_drops; /* connections dropped */
310 u_long tcps_conndrops; /* embryonic connections dropped */
311 u_long tcps_closed; /* conn. closed (includes drops) */
312 u_long tcps_segstimed; /* segs where we tried to get rtt */
313 u_long tcps_rttupdated; /* times we succeeded */
314 u_long tcps_delack; /* delayed acks sent */
315 u_long tcps_timeoutdrop; /* conn. dropped in rxmt timeout */
316 u_long tcps_rexmttimeo; /* retransmit timeouts */
317 u_long tcps_persisttimeo; /* persist timeouts */
318 u_long tcps_keeptimeo; /* keepalive timeouts */
319 u_long tcps_keepprobe; /* keepalive probes sent */
320 u_long tcps_keepdrops; /* connections dropped in keepalive */
321
322 u_long tcps_sndtotal; /* total packets sent */
323 u_long tcps_sndpack; /* data packets sent */
324 u_long tcps_sndbyte; /* data bytes sent */
325 u_long tcps_sndrexmitpack; /* data packets retransmitted */
326 u_long tcps_sndrexmitbyte; /* data bytes retransmitted */
327 u_long tcps_sndacks; /* ack-only packets sent */
328 u_long tcps_sndprobe; /* window probes sent */
329 u_long tcps_sndurg; /* packets sent with URG only */
330 u_long tcps_sndwinup; /* window update-only packets sent */
331 u_long tcps_sndctrl; /* control (SYN|FIN|RST) packets sent */
332
333 u_long tcps_rcvtotal; /* total packets received */
334 u_long tcps_rcvpack; /* packets received in sequence */
335 u_long tcps_rcvbyte; /* bytes received in sequence */
336 u_long tcps_rcvbadsum; /* packets received with ccksum errs */
337 u_long tcps_rcvbadoff; /* packets received with bad offset */
338 u_long tcps_rcvshort; /* packets received too short */
339 u_long tcps_rcvduppack; /* duplicate-only packets received */
340 u_long tcps_rcvdupbyte; /* duplicate-only bytes received */
341 u_long tcps_rcvpartduppack; /* packets with some duplicate data */
342 u_long tcps_rcvpartdupbyte; /* dup. bytes in part-dup. packets */
343 u_long tcps_rcvoopack; /* out-of-order packets received */
344 u_long tcps_rcvoobyte; /* out-of-order bytes received */
345 u_long tcps_rcvpackafterwin; /* packets with data after window */
346 u_long tcps_rcvbyteafterwin; /* bytes rcvd after window */
347 u_long tcps_rcvafterclose; /* packets rcvd after "close" */
348 u_long tcps_rcvwinprobe; /* rcvd window probe packets */
349 u_long tcps_rcvdupack; /* rcvd duplicate acks */
350 u_long tcps_rcvacktoomuch; /* rcvd acks for unsent data */
351 u_long tcps_rcvackpack; /* rcvd ack packets */
352 u_long tcps_rcvackbyte; /* bytes acked by rcvd acks */
353 u_long tcps_rcvwinupd; /* rcvd window update packets */
354 u_long tcps_pawsdrop; /* segments dropped due to PAWS */
355 u_long tcps_predack; /* times hdr predict ok for acks */
356 u_long tcps_preddat; /* times hdr predict ok for data pkts */
357 u_long tcps_pcbcachemiss;
358 u_long tcps_cachedrtt; /* times cached RTT in route updated */
359 u_long tcps_cachedrttvar; /* times cached rttvar updated */
360 u_long tcps_cachedssthresh; /* times cached ssthresh updated */
361 u_long tcps_usedrtt; /* times RTT initialized from route */
362 u_long tcps_usedrttvar; /* times RTTVAR initialized from rt */
363 u_long tcps_usedssthresh; /* times ssthresh initialized from rt*/
364 u_long tcps_persistdrop; /* timeout in persist state */
365 u_long tcps_badsyn; /* bogus SYN, e.g. premature ACK */
366 u_long tcps_mturesent; /* resends due to MTU discovery */
367 u_long tcps_listendrop; /* listen queue overflows */
368
369#ifdef TCP_FACK
370 /* NOTE: This may break some programs that rely on this structure
371 * being fixed length.
372 */
373 u_long tcps_fack_recovery; /* fack: recovery episodes */
374 u_long tcps_fack_sndpack; /* fack: data packets sent */
375 u_long tcps_fack_sndbyte; /* fack: data bytes sent */
376 u_long tcps_fack_sndrexmitpack;/* fack: data packets retransmitted */
377 u_long tcps_fack_sndrexmitbyte;/* fack: data bytes retransmitted */
378#endif
379};
380
381/*
382 * Names for TCP sysctl objects
383 */
384#define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */
385#define TCPCTL_DO_RFC1644 2 /* use RFC-1644 extensions */
386#define TCPCTL_MSSDFLT 3 /* MSS default */
387#define TCPCTL_STATS 4 /* statistics (read-only) */
388#define TCPCTL_RTTDFLT 5 /* default RTT estimate */
389#define TCPCTL_KEEPIDLE 6 /* keepalive idle timer */
390#define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */
391#define TCPCTL_SENDSPACE 8 /* send buffer space */
392#define TCPCTL_RECVSPACE 9 /* receive buffer space */
393#define TCPCTL_KEEPINIT 10 /* receive buffer space */
394#define TCPCTL_MAXID 11
395
396#define TCPCTL_NAMES { \
397 { 0, 0 }, \
398 { "rfc1323", CTLTYPE_INT }, \
399 { "rfc1644", CTLTYPE_INT }, \
400 { "mssdflt", CTLTYPE_INT }, \
401 { "stats", CTLTYPE_STRUCT }, \
402 { "rttdflt", CTLTYPE_INT }, \
403 { "keepidle", CTLTYPE_INT }, \
404 { "keepintvl", CTLTYPE_INT }, \
405 { "sendspace", CTLTYPE_INT }, \
406 { "recvspace", CTLTYPE_INT }, \
407 { "keepinit", CTLTYPE_INT }, \
408}
409
410#endif
inpcb
Definition: in_pcb.h:61
rmxp_tao
Definition: tcp_var.h:239
sackblock
Definition: tcp_var.h:72
scoreboard
Definition: tcp_scor.h:89
tcpcb
Definition: tcp_var.h:81
tcpopt
Definition: tcp_var.h:223
tcpstat
Definition: tcp_var.h:305
tcp_scor.h
tcp_time.h
tcpip.h


Watt-32 tcp/ip: E:/WATT/inc/netinet/tcpip.h Source File

  • inc
  • netinet
tcpip.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_TCPIP_H
39#define __NETINET_TCPIP_H
40
41#include <netinet/tcp.h>
42#include <netinet/ip_var.h>
43
44W32_CLANG_PACK_WARN_OFF()
45
46#include <sys/pack_on.h>
47
48/*
49 * Tcp+ip header, after ip options removed.
50 */
51struct tcpiphdr {
52 struct ipovly ti_i; /* overlaid ip structure */
53 struct tcphdr ti_t; /* tcp header */
54};
55
56#ifdef notyet
57/*
58 * Tcp+ip header, after ip options removed but including TCP options.
59 */
60struct full_tcpiphdr {
61 struct ipovly ti_i; /* overlaid ip structure */
62 struct tcphdr ti_t; /* tcp header */
63 char ti_o[TCP_MAXOLEN]; /* space for tcp options */
64};
65#endif /* notyet */
66
67#include <sys/pack_off.h>
68
69W32_CLANG_PACK_WARN_DEF()
70
71#define ti_next ti_i.ih_next
72#define ti_prev ti_i.ih_prev
73#define ti_x1 ti_i.ih_x1
74#define ti_pr ti_i.ih_pr
75#define ti_len ti_i.ih_len
76#define ti_src ti_i.ih_src
77#define ti_dst ti_i.ih_dst
78#define ti_sport ti_t.th_sport
79#define ti_dport ti_t.th_dport
80#define ti_seq ti_t.th_seq
81#define ti_ack ti_t.th_ack
82#define ti_x2 ti_t.th_x2
83#define ti_off ti_t.th_off
84#define ti_flags ti_t.th_flags
85#define ti_win ti_t.th_win
86#define ti_sum ti_t.th_sum
87#define ti_urp ti_t.th_urp
88
89#endif
ip_var.h
tcp.h
pack_off.h
full_tcpiphdr
Definition: tcpip.h:60


Watt-32 tcp/ip: E:/WATT/inc/arpa/telnet.h Source File

  • inc
  • arpa
telnet.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1983, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __ARPA_TELNET_H
39#define __ARPA_TELNET_H
40
41#ifndef __SYS_W32API_H
42#include <sys/w32api.h>
43#endif
44
45/*
46 * Definitions for the TELNET protocol.
47 */
48#define IAC 255 /* interpret as command: */
49#define DONT 254 /* you are not to use option */
50#define DO 253 /* please, you use option */
51#define WONT 252 /* I won't use option */
52#define WILL 251 /* I will use option */
53#define SB 250 /* interpret as subnegotiation */
54#define GA 249 /* you may reverse the line */
55#define EL 248 /* erase the current line */
56#define EC 247 /* erase the current character */
57#define AYT 246 /* are you there */
58#define AO 245 /* abort output--but let prog finish */
59#define IP 244 /* interrupt process--permanently */
60#define BREAK 243 /* break */
61#define DM 242 /* data mark--for connect. cleaning */
62#define NOP 241 /* nop */
63#define SE 240 /* end sub negotiation */
64#define EOR 239 /* end of record (transparent mode) */
65#define ABORT 238 /* Abort process */
66#define SUSP 237 /* Suspend process */
67#define xEOF 236 /* End of file: EOF is already used... */
68
69#define SYNCH 242 /* for telfunc calls */
70
71#ifdef TELCMDS
72 const char *telcmds[] = {
73 "EOF", "SUSP", "ABORT", "EOR",
74 "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
75 "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0
76 };
77#else
78 W32_DATA const char *telcmds[];
79#endif
80
81#define TELCMD_FIRST xEOF
82#define TELCMD_LAST IAC
83#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
84 (unsigned int)(x) >= TELCMD_FIRST)
85#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
86
87/* telnet options
88 */
89#define TELOPT_BINARY 0 /* 8-bit data path */
90#define TELOPT_ECHO 1 /* echo */
91#define TELOPT_RCP 2 /* prepare to reconnect */
92#define TELOPT_SGA 3 /* suppress go ahead */
93#define TELOPT_NAMS 4 /* approximate message size */
94#define TELOPT_STATUS 5 /* give status */
95#define TELOPT_TM 6 /* timing mark */
96#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
97#define TELOPT_NAOL 8 /* negotiate about output line width */
98#define TELOPT_NAOP 9 /* negotiate about output page size */
99#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
100#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
101#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
102#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
103#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
104#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
105#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
106#define TELOPT_XASCII 17 /* extended ascic character set */
107#define TELOPT_LOGOUT 18 /* force logout */
108#define TELOPT_BM 19 /* byte macro */
109#define TELOPT_DET 20 /* data entry terminal */
110#define TELOPT_SUPDUP 21 /* supdup protocol */
111#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
112#define TELOPT_SNDLOC 23 /* send location */
113#define TELOPT_TTYPE 24 /* terminal type */
114#define TELOPT_EOR 25 /* end or record */
115#define TELOPT_TUID 26 /* TACACS user identification */
116#define TELOPT_OUTMRK 27 /* output marking */
117#define TELOPT_TTYLOC 28 /* terminal location number */
118#define TELOPT_3270REGIME 29 /* 3270 regime */
119#define TELOPT_X3PAD 30 /* X.3 PAD */
120#define TELOPT_NAWS 31 /* window size */
121#define TELOPT_TSPEED 32 /* terminal speed */
122#define TELOPT_LFLOW 33 /* remote flow control */
123#define TELOPT_LINEMODE 34 /* Linemode option */
124#define TELOPT_XDISPLOC 35 /* X Display Location */
125#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
126#define TELOPT_AUTHENTICATION 37 /* Authenticate */
127#define TELOPT_ENCRYPT 38 /* Encryption option */
128#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
129#define TELOPT_EXOPL 255 /* extended-options-list */
130
131#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
132
133#ifdef TELOPTS
134 const char *telopts[NTELOPTS+1] = {
135 "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
136 "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
137 "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
138 "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
139 "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
140 "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
141 "TACACS UID", "OUTPUT MARKING", "TTYLOC",
142 "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
143 "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
144 "ENCRYPT", "NEW-ENVIRON", 0
145 };
146 #define TELOPT_FIRST TELOPT_BINARY
147 #define TELOPT_LAST TELOPT_NEW_ENVIRON
148 #define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
149 #define TELOPT(x) telopts[(x)-TELOPT_FIRST]
150#endif
151
152/* sub-option qualifiers
153 */
154#define TELQUAL_IS 0 /* option is... */
155#define TELQUAL_SEND 1 /* send option */
156#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
157#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
158#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
159
160#define LFLOW_OFF 0 /* Disable remote flow control */
161#define LFLOW_ON 1 /* Enable remote flow control */
162#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
163#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
164
165/* LINEMODE suboptions
166 */
167#define LM_MODE 1
168#define LM_FORWARDMASK 2
169#define LM_SLC 3
170
171#define MODE_EDIT 0x01
172#define MODE_TRAPSIG 0x02
173#define MODE_ACK 0x04
174#define MODE_SOFT_TAB 0x08
175#define MODE_LIT_ECHO 0x10
176
177#define MODE_MASK 0x1f
178
179/* Not part of protocol, but needed to simplify things...
180 */
181#define MODE_FLOW 0x0100
182#define MODE_ECHO 0x0200
183#define MODE_INBIN 0x0400
184#define MODE_OUTBIN 0x0800
185#define MODE_FORCE 0x1000
186
187#define SLC_SYNCH 1
188#define SLC_BRK 2
189#define SLC_IP 3
190#define SLC_AO 4
191#define SLC_AYT 5
192#define SLC_EOR 6
193#define SLC_ABORT 7
194#define SLC_EOF 8
195#define SLC_SUSP 9
196#define SLC_EC 10
197#define SLC_EL 11
198#define SLC_EW 12
199#define SLC_RP 13
200#define SLC_LNEXT 14
201#define SLC_XON 15
202#define SLC_XOFF 16
203#define SLC_FORW1 17
204#define SLC_FORW2 18
205#define SLC_MCL 19
206#define SLC_MCR 20
207#define SLC_MCWL 21
208#define SLC_MCWR 22
209#define SLC_MCBOL 23
210#define SLC_MCEOL 24
211#define SLC_INSRT 25
212#define SLC_OVER 26
213#define SLC_ECR 27
214#define SLC_EWR 28
215#define SLC_EBOL 29
216#define SLC_EEOL 30
217
218#define NSLC 30
219
220/*
221 * For backwards compatability, we define SLC_NAMES to be the
222 * list of names if SLC_NAMES is not defined.
223 */
224#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
225 "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
226 "LNEXT", "XON", "XOFF", "FORW1", "FORW2", \
227 "MCL", "MCR", "MCWL", "MCWR", "MCBOL", \
228 "MCEOL", "INSRT", "OVER", "ECR", "EWR", \
229 "EBOL", "EEOL", \
230 0
231#ifdef SLC_NAMES
232 const char *slc_names[] = { SLC_NAMELIST };
233#else
234 W32_DATA const char *slc_names[];
235 #define SLC_NAMES SLC_NAMELIST
236#endif
237
238#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
239#define SLC_NAME(x) slc_names[x]
240
241#define SLC_NOSUPPORT 0
242#define SLC_CANTCHANGE 1
243#define SLC_VARIABLE 2
244#define SLC_DEFAULT 3
245#define SLC_LEVELBITS 0x03
246
247#define SLC_FUNC 0
248#define SLC_FLAGS 1
249#define SLC_VALUE 2
250
251#define SLC_ACK 0x80
252#define SLC_FLUSHIN 0x40
253#define SLC_FLUSHOUT 0x20
254
255#define OLD_ENV_VAR 1
256#define OLD_ENV_VALUE 0
257#define NEW_ENV_VAR 0
258#define NEW_ENV_VALUE 1
259#define ENV_ESC 2
260#define ENV_USERVAR 3
261
262/*
263 * AUTHENTICATION suboptions
264 */
265
266/* Who is authenticating who ...
267 */
268#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
269#define AUTH_WHO_SERVER 1 /* Server authenticating client */
270#define AUTH_WHO_MASK 1
271
272/* Amount of authentication done
273 */
274#define AUTH_HOW_ONE_WAY 0
275#define AUTH_HOW_MUTUAL 2
276#define AUTH_HOW_MASK 2
277
278#define AUTHTYPE_NULL 0
279#define AUTHTYPE_KERBEROS_V4 1
280#define AUTHTYPE_KERBEROS_V5 2
281#define AUTHTYPE_SPX 3
282#define AUTHTYPE_MINK 4
283#define AUTHTYPE_SRP 5
284#define AUTHTYPE_CNT 6
285
286#define AUTHTYPE_TEST 99
287
288#ifdef AUTH_NAMES
289 const char *authtype_names[] = {
290 "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", "SRP", 0
291 };
292#else
293 W32_DATA const char *authtype_names[];
294#endif
295
296#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
297#define AUTHTYPE_NAME(x) authtype_names[x]
298
299/*
300 * ENCRYPTion suboptions
301 */
302#define ENCRYPT_IS 0 /* I pick encryption type ... */
303#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
304#define ENCRYPT_REPLY 2 /* Initial setup response */
305#define ENCRYPT_START 3 /* Am starting to send encrypted */
306#define ENCRYPT_END 4 /* Am ending encrypted */
307#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
308#define ENCRYPT_REQEND 6 /* Request you send encrypting */
309#define ENCRYPT_ENC_KEYID 7
310#define ENCRYPT_DEC_KEYID 8
311#define ENCRYPT_CNT 9
312
313#define ENCTYPE_ANY 0
314#define ENCTYPE_DES_CFB64 1
315#define ENCTYPE_DES_OFB64 2
316#define ENCTYPE_CAST5_40_CFB64 8
317#define ENCTYPE_CAST5_40_OFB64 9
318#define ENCTYPE_CAST128_CFB64 10
319#define ENCTYPE_CAST128_OFB64 11
320#define ENCTYPE_CNT 12
321
322#ifdef ENCRYPT_NAMES
323 const char *encrypt_names[] = {
324 "IS", "SUPPORT", "REPLY", "START", "END",
325 "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
326 0
327 };
328 const char *enctype_names[] = {
329 "ANY", "DES_CFB64", "DES_OFB64", "UNKNOWN", "UNKNOWN", "UNKNOWN",
330 "UNKNOWN", "UNKNOWN", "CAST5_40_CFB64", "CAST5_40_OFB64",
331 "CAST128_CFB64", "CAST128_OFB64", 0,
332 };
333#else
334 W32_DATA const char *encrypt_names[];
335 W32_DATA const char *enctype_names[];
336#endif
337
338
339#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
340#define ENCRYPT_NAME(x) encrypt_names[x]
341
342#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
343#define ENCTYPE_NAME(x) enctype_names[x]
344
345#endif
w32api.h


Watt-32 tcp/ip: E:/WATT/src/teredo64.h Source File

  • src
teredo64.h
Go to the documentation of this file.
1
3#ifndef _w32_TEREDO64_H
4#define _w32_TEREDO64_H
5
6#endif


Watt-32 tcp/ip: E:/WATT/src/tftp.c Source File

  • src
tftp.c
Go to the documentation of this file.
1
37#include "socket.h"
38#include "pcdns.h"
39#include "run.h"
40#include "tftp.h"
41
42#if defined(USE_TFTP)
43
44#if defined(USE_DEBUG)
45 #define TRACE(x) (*_printf) x
46#else
47 #define TRACE(x) ((void)0)
48#endif
49
50/*
51 * Error codes private to this file:
52 */
53#define ERR_INV 1 /* invalid packet size */
54#define ERR_ERR 2 /* error packet received */
55#define ERR_OP 3 /* invalid opcode */
56#define ERR_BLOCK 4 /* invalid block number */
57#define ERR_TIMEOUT 5 /* timeout while receiving */
58#define ERR_UNKNOWN 6 /* unknown error */
59
60/*
61 * Various definitions:
62 */
63#define TFTP_RETRY 5 /* Maximum number of retries */
64#define TFTP_TIMEOUT 8 /* Default 8 seconds timeout */
65#define TFTP_HEADSIZE 4 /* th_opcode/th_block size */
66#define TFTP_PORT_LOW 1024 /* lowest legal local port */
67#define TFTP_PORT_HIGH USHRT_MAX /* higest legal local port */
68#define OCTET_STR "octet" /* name for 8-bit raw format */
69#define NETASCII_STR "netascii" /* name for netascii format */
70#define MAIL_STR "mail" /* name for mail format */
71
72/*
73 * Public data
74 */
75int (W32_CALL *_tftp_write) (const void*, size_t) = NULL;
76int (W32_CALL *_tftp_close) (void) = NULL;
77
78/*
79 * Local variables
80 */
81static struct tftphdr *inbuf; /* TFTP input buffer */
82static struct tftphdr *outbuf; /* TFTP output buffer */
83static sock_type *sock; /* Socket for UDP recv/xmit */
84
85static DWORD currblock; /* Current data block */
86static int blocksize; /* Server's block size */
87static int ibuflen; /* Size of data in input buffer */
88static int isopen; /* TRUE if connection is open */
89
90static int tftp_errno = 0;
91static DWORD tftp_server = 0;
92static int tftp_timeout = TFTP_TIMEOUT;
93static int tftp_retry = TFTP_RETRY;
94static int tftp_lport = 0;
95
96static char tftp_server_name[MAX_HOSTLEN] = "";
97static char tftp_xfer_mode [MAX_VALUELEN] = OCTET_STR;
98static char *tftp_boot_remote_file = NULL;
99static char *tftp_boot_local_file = NULL;
100static char *tftp_openmode = NULL;
101
105static void send_req (char request, const char *fname)
106{
107 char *cp, *mode;
108 int len;
109 int fnamlen = strlen (fname);
110
111 /* The output buffer is setup with the request code, the file name,
112 * and the name of the data format.
113 */
114 memset (outbuf, 0, sizeof(*outbuf));
115 outbuf->th_opcode = intel16 (request);
116 len = SEGSIZE - sizeof(outbuf->th_opcode) - strlen(tftp_xfer_mode) - 1;
117 cp = (char*) &outbuf->th_stuff[0];
118
119 for ( ; *fname && len > 0 && fnamlen > 0; len--, fnamlen--)
120 *cp++ = *fname++;
121 *cp++ = '\0';
122
123 for (mode = tftp_xfer_mode; *mode; )
124 *cp++ = *mode++;
125 *cp++ = '\0';
126
127 /* Finally send the request
128 */
129 len = (int) (cp - (char*)outbuf);
130 sock_fastwrite (sock, (BYTE*)outbuf, len);
131}
132
136static void send_ack (WORD block)
137{
138 struct tftphdr ack;
139
140 ack.th_opcode = intel16 (ACK);
141 ack.th_block = intel16 (block);
142 sock_fastwrite (sock, (BYTE*)&ack, TFTP_HEADSIZE);
143}
144
145#if defined(USE_DEBUG)
149static const char *tftp_strerror (int code)
150{
151 static const char *err_tab[] = {
152 "EUNDEF",
153 "ENOTFOUND",
154 "EACCESS",
155 "ENOSPACE",
156 "EBADOP",
157 "EBADID",
158 "EEXISTS",
159 "ENOUSER",
160 "EOPTNEG"
161 };
162 if (code < 0 || code >= DIM(err_tab))
163 return ("?");
164 return (err_tab[code]);
165}
166#endif
167
171static void udp_callback (_udp_Socket *s, int icmp_type, int icmp_code)
172{
173 if (s->ip_type == UDP_PROTO && s == (_udp_Socket*)sock &&
174 (s->locflags & LF_GOT_ICMP) && icmp_type == ICMP_UNREACH)
175 {
176 /* In lack of a better way, pretend we got a FIN.
177 * This causes sock_wait_input() below to break it's loop.
178 */
179 s->locflags |= LF_GOT_FIN;
180 s->err_msg = icmp_type_str [ICMP_UNREACH];
181 }
182 ARGSUSED (icmp_code);
183}
184
188static int recv_packet (DWORD block)
189{
190 int len, status = 0;
191
192 /* Use a callback since first block sent might cause a "ICMP
193 * port unreachable" to be sent back. Note that the normal mechanism
194 * of detecting ICMP errors (through _udp_cancel) doesn't work since
195 * we did set 'sock->udp.hisaddr = 0'.
196 *
197 * Note: 'block' is 32-bit, but 16-bit in tftp-header.
198 * We allow the header block-counter to wrap (allowing > 32MB files).
199 *
200 * And make gcc 8+ shut up about this warning:
201 * tftp.c:201:31: warning: cast between incompatible function types from
202 * 'void (*)(_udp_Socket *, int, int)' {aka 'void (*)(struct udp_Socket *,
203 * int, int)'} to 'int (*)(void *, BYTE, BYTE)' {aka 'int (*)(void *, unsigned char, unsigned char)'}
204 * [-Wcast-function-type]
205 * 201 | sock->udp.icmp_callb = (icmp_upcall) udp_callback;
206 * | ^
207 */
208 W32_GCC_FUNC_TYPE_WARN_OFF()
209
210 if (block == 1UL)
211 sock->udp.icmp_callb = (icmp_upcall) udp_callback;
212 else sock->udp.icmp_callb = NULL;
213
214 W32_GCC_FUNC_TYPE_WARN_DEF()
215
216 /* Read packet with timeout
217 */
218 sock_wait_input (sock, tftp_timeout, NULL, &status);
219
220 len = sock_fastread (sock, (BYTE*)inbuf, TFTP_HEADSIZE+SEGSIZE);
221
222 /* Check that the packet has a correct length
223 */
224 len -= TFTP_HEADSIZE;
225 if (len < 0 || len > SEGSIZE)
226 {
227 TRACE (("tftp: Invalid packet, len = %d\n", len));
228 tftp_errno = ERR_INV;
229 return (-1);
230 }
231
232 /* Check if we got an error packet
233 */
234 if (intel16(inbuf->th_opcode) == ERROR)
235 {
236#if defined(USE_DEBUG)
237 int code = intel16 (inbuf->th_code);
238 const char *str = tftp_strerror (code);
239
240 TRACE (("tftp: Error: %s (%d): %.*s\n",
241 str, code, SEGSIZE, inbuf->th_data));
242#endif
243 tftp_errno = ERR_ERR;
244 return (-1);
245 }
246
247 /* Check if we got a valid data packet at all
248 */
249 if (intel16(inbuf->th_opcode) != DATA)
250 {
251 TRACE (("tftp: Invalid opcode %d\n", intel16(inbuf->th_opcode)));
252 tftp_errno = ERR_OP;
253 return (-1);
254 }
255
256 /* Check if the block number of the data packet is correct
257 */
258 if (intel16(inbuf->th_block) != (WORD)block)
259 {
260 TRACE (("tftp: Block %u != %u\n", intel16(inbuf->th_block), (WORD)block));
261 tftp_errno = ERR_BLOCK;
262 return (-1);
263 }
264
265 tftp_errno = 0;
266 if (debug_on)
267 (*_outch) ('#'); /* Write 1 hash-mark per block */
268
269 return (len);
270
271sock_err:
272 if (status == -1)
273 {
274 if (debug_on)
275 outs ("Timeout");
276
277 tftp_errno = ERR_TIMEOUT;
278 return (-1);
279 }
280
281 /* most likely "Port unreachable"
282 */
283 TRACE (("tftp: %s\n", sockerr(sock)));
284 tftp_errno = ERR_UNKNOWN;
285 return (-1);
286}
287
292static int tftp_open (DWORD server, const char *fname)
293{
294 int retry;
295 WORD port = 69;
296
297#if defined(USE_BSD_API)
298 struct servent *sp = getservbyname ("tftp", "udp");
299
300 if (sp)
301 port = intel16 ((WORD)sp->s_port);
302#endif
303
304 currblock = 0UL;
305 blocksize = 0;
306
307 for (retry = 0; retry < tftp_retry; retry++)
308 {
309 WORD our_tid; /* our transaction ID (local port) */
310
311 if (tftp_lport && tftp_lport < TFTP_PORT_LOW)
312 outsnl (_LANG("tftp: Illegal local port."));
313
314 if (tftp_lport >= TFTP_PORT_LOW)
315 our_tid = tftp_lport;
316 else our_tid = Random (TFTP_PORT_LOW, TFTP_PORT_HIGH);
317
318 /* Try to open a TFTP connection to the server
319 */
320 if (!udp_open(&sock->udp, our_tid, server, port, NULL))
321 {
322 TRACE (("tftp: %s\n", sockerr(sock)));
323 return (0);
324 }
325 sock->udp.locflags |= LF_NOCLOSE; /* don't close socket on timeout */
326
327 /* Send the file request block, and then wait for the first data
328 * block. If there is no response to the query, retry it with
329 * another transaction ID (local port), so that all old packets get
330 * discarded automatically.
331 */
332 send_req (RRQ, fname);
333
334 /* This hack makes it work because the response is sent back on
335 * a source-port different from port 69; i.e. the server TID
336 * uses a random port. Force the response packet to match a passive
337 * socket in udp_handler().
338 */
339 sock->udp.hisaddr = 0;
340
341 ibuflen = recv_packet (1);
342 if (ibuflen >= 0)
343 {
344 blocksize = ibuflen;
345 isopen = TRUE;
346 send_ack (1);
347 return (1);
348 }
349
350 /* If an error (except timeout) occurred, retries are useless
351 */
352 if (tftp_errno == ERR_ERR || tftp_errno == ERR_UNKNOWN)
353 break;
354 }
355 return (0);
356}
357
361static void tftp_close (void)
362{
363 if (_tftp_close)
364 (*_tftp_close)();
365
366 if (debug_on)
367 outs ("\n");
368
369 if (sock)
370 {
371 sock_close (sock);
372 DO_FREE (sock);
373 }
374 DO_FREE (inbuf);
375 DO_FREE (outbuf);
376}
377
381char *tftp_set_server (const char *name, int len)
382{
383 len = min (len+1, SIZEOF(tftp_server_name));
384 return _strlcpy (tftp_server_name, name, len);
385}
386
392char *tftp_set_boot_fname (const char *name, int len)
393{
394 char *p, buf [MAX_PATHLEN];
395
396 len = min (len+1, SIZEOF(buf));
397 _strlcpy (buf, name, len);
398 tftp_boot_remote_file = strdup (buf);
399 tftp_boot_local_file = tftp_boot_remote_file;
400
401 if (tftp_boot_local_file)
402 {
403 p = strchr (tftp_boot_local_file, ' ');
404 if (p)
405 {
406 *p++ = '\0';
407 tftp_boot_local_file = p;
408 }
409 }
410 return (tftp_boot_remote_file);
411}
412
416static char *tftp_set_xfer_mode (const char *name)
417{
418 return _strlcpy (tftp_xfer_mode, name, sizeof(tftp_xfer_mode));
419}
420
424static int tftp_get_block (const char **buf)
425{
426 int retry;
427
428 /* Don't do anything if no TFTP connection is active.
429 */
430 if (!isopen)
431 return (0);
432
433 /* If the block number is 0 then we are still dealing with the first
434 * data block after opening a connection. If the data size is smaller
435 * than 'blocksize' just close the connection again.
436 */
437 if (currblock == 0UL)
438 {
439 currblock++;
440 if (ibuflen < blocksize)
441 isopen = FALSE;
442 *buf = (const char*) &inbuf->th_data[0];
443 return (ibuflen);
444 }
445
446 /* Wait for the next data packet. If no data packet is coming in,
447 * resend the ACK for the last packet to restart the sender. Maybe
448 * he didn't get our first ACK.
449 */
450 for (retry = 0; retry < tftp_retry; retry++)
451 {
452 ibuflen = recv_packet (currblock+1);
453 if (ibuflen >= 0)
454 {
455 currblock++;
456 send_ack ((WORD)currblock);
457 if (ibuflen < blocksize) /* last block received */
458 isopen = FALSE;
459 *buf = (const char*) &inbuf->th_data[0];
460 return (ibuflen);
461 }
462 if (tftp_errno == ERR_ERR || tftp_errno == ERR_UNKNOWN)
463 break;
464
465 send_ack ((WORD)currblock);
466 }
467 isopen = FALSE;
468 return (-1);
469}
470
474int tftp_boot_load (void)
475{
476 int rc = 0;
477
478 /* Allocate socket and buffers
479 */
480 sock = malloc (sizeof(sock->udp));
481 inbuf = malloc (TFTP_HEADSIZE+SEGSIZE);
482 outbuf = malloc (TFTP_HEADSIZE+SEGSIZE);
483
484 if (!sock || !inbuf || !outbuf)
485 {
486 outsnl (_LANG("No memory for TFTP boot."));
487 return (0);
488 }
489
490 if (!tftp_boot_remote_file)
491 {
492 outsnl (_LANG("No remote TFTP boot filename defined."));
493 return (0);
494 }
495
496 if (tftp_server_name[0] && !tftp_server)
497 tftp_server = resolve (tftp_server_name);
498
499 if (!tftp_server)
500 {
501 outsnl (_LANG("Cannot resolve TFTP-server "));
502 return (0);
503 }
504
505 if (debug_on)
506 outs (_LANG("Doing TFTP boot load..."));
507
508 /* Open connection and request file
509 */
510 if (!tftp_open(tftp_server, tftp_boot_remote_file))
511 {
512 tftp_close();
513 return (0);
514 }
515
516 while (1)
517 {
518 const char *buf;
519 int size = tftp_get_block (&buf);
520
521 if (size < 0) /* error in transfer */
522 {
523 rc = 0;
524 break;
525 }
526 if (size > 0 && (*_tftp_write)(buf, size) < 0)
527 {
528 rc = -1; /* writer failed, errno set */
529 break;
530 }
531 if (size < blocksize) /* got last block */
532 {
533 rc = 1;
534 break;
535 }
536 }
537 tftp_close();
538 return (rc);
539}
540
544static void (W32_CALL *prev_hook) (const char*, const char*) = NULL;
545
546static void W32_CALL tftp_cfg_hook (const char *name, const char *value)
547{
548 static const struct config_table tftp_cfg[] = {
549 { "BOOT_FILE", ARG_FUNC, (void*)tftp_set_boot_fname },
550 { "SERVER", ARG_RESOLVE, (void*)&tftp_server },
551 { "TIMEOUT", ARG_ATOI, (void*)&tftp_timeout },
552 { "RETRY", ARG_ATOI, (void*)&tftp_retry },
553 { "MODE", ARG_FUNC, (void*)tftp_set_xfer_mode },
554 { "OPENMODE", ARG_STRDUP, (void*)&tftp_openmode },
555 { "PORT", ARG_ATOI, (void*)&tftp_lport },
556 { NULL, 0, NULL }
557 };
558 if (!parse_config_table(tftp_cfg, "TFTP.", name, value) && prev_hook)
559 (*prev_hook) (name, value);
560}
561
565static void W32_CALL tftp_exit (void)
566{
567 if (!_watt_fatal_error)
568 {
569 DO_FREE (tftp_boot_remote_file);
570 DO_FREE (tftp_openmode);
571 }
572}
573
577int tftp_init (void)
578{
579 prev_hook = usr_init;
580 usr_init = tftp_cfg_hook;
581 RUNDOWN_ADD (tftp_exit, 261);
582 return (TRUE);
583}
584#endif /* USE_TFTP */
585
586/*
587 * A small test program.
588 */
589#if defined(TEST_PROG)
590#if !defined(USE_TFTP)
591int main (void)
592{
593 puts ("This program needs '#define USE_TFTP' (and '#define USE_BSD_API')");
594 return (1);
595}
596#else /* rest of file */
597
598#if defined(HAVE_UNISTD_H)
599#include <unistd.h>
600#endif
601
602#include "netaddr.h"
603#include "pcdbug.h"
604#include "pcarp.h"
605
606static FILE *file;
607static char *fname;
608static DWORD tot_size;
609static time_t start;
610
611static int W32_CALL close_func (void)
612{
613 if (file && fname)
614 {
615 time_t now = time (NULL);
616 double speed;
617
618 if (now == start)
619 now++;
620 speed = (double)tot_size / (double)(now - start);
621 fprintf (stderr, "closing `%s' (%.2f kB/s)\n", fname, speed/1024.0);
622 fclose (file);
623 file = NULL;
624 return (1);
625 }
626 return (0);
627}
628
629static int W32_CALL write_func (const void *buf, size_t length)
630{
631 static DWORD block = 0;
632
633 if (debug_on < 2)
634 debug_on = 2;
635
636 if (block == 0)
637 {
638 tot_size = 0UL;
639 start = time (NULL);
640 fname = tftp_boot_local_file;
641 fprintf (stderr, "opening `%s'\n", fname);
642 file = fopen (fname, tftp_openmode ? tftp_openmode : "wb");
643 }
644 if (!file)
645 {
646 perror (fname);
647 return (-1);
648 }
649
650#if defined(__DJGPP__) && 0
651 /*
652 * Look for optional Watt-32 stubinfo in block 4.
653 * If .exe file isn't newer, kill the connection
654 */
655 if (block == 4 && is_exe && check_timestamp(buf) < our_timestamp)
656 {
657 close_func();
658 return (-1);
659 }
660#endif
661
662 if (fwrite (buf, 1, length, file) < length)
663 return (-1);
664 tot_size += length;
665 block++;
666 return (0);
667}
668
669void usage (const char *argv0)
670{
671 printf ("Usage: %s [[-d] [-n] [-a] [-h host] [-f file]\n"
672 "\t\t [-i ip] [-m mask]] [-t timeout] [-r retry]\n"
673 "\t -d enable WATTCP.DBG file\n"
674 "\t -n run with no config file\n"
675 "\t -a add random MAC address for tftp host\n"
676 "\t -h specify tftp host\n"
677 "\t -f specify remote file to load\n"
678 "\t -i specify ip-address (default 192.168.0.1)\n"
679 "\t -m specify network mask (default 255.255.0.0)\n"
680 "\t -t specify total timeout (default %d)\n"
681 "\t -r specify retry count (default %d)\n",
682 argv0, tftp_timeout, tftp_retry);
683 exit (-1);
684}
685
686int main (int argc, char **argv)
687{
688 eth_address eth = { 1, 2, 3, 4, 5, 6 };
689 int a_flag = 0;
690 int h_flag = 0;
691 int i_flag = 0;
692 int f_flag = 0;
693 int n_flag = 0;
694 int m_flag = 0;
695 int d_flag = 0;
696 int ch;
697
698 while ((ch = getopt(argc, argv, "adn?h:i:f:m:t:r:")) != EOF)
699 switch (ch)
700 {
701 case 'a':
702 a_flag = 1;
703 break;
704 case 'd':
705 d_flag = 1;
706 break;
707 case 'n':
708 n_flag = 1;
709 break;
710 case 'h':
711 h_flag = 1;
712 tftp_server = aton (optarg);
713 break;
714 case 'i':
715 i_flag = 1;
716 my_ip_addr = aton (optarg);
717 break;
718 case 'f':
719 f_flag = 1;
720 tftp_set_boot_fname (optarg, strlen(optarg));
721 break;
722 case 'm':
723 m_flag = 1;
724 sin_mask = aton (optarg);
725 break;
726 case 't':
727 tftp_timeout = atoi (optarg);
728 break;
729 case 'r':
730 tftp_retry = atoi (optarg);
731 break;
732 case '?':
733 default:
734 usage (argv[0]);
735 }
736
737 if (n_flag) /* Demonstrate running with no config file */
738 {
739 _watt_no_config = 1;
740 dbg_mode_all = 1;
741 dbg_print_stat = 1;
742 debug_on = 3;
743
744 if (!m_flag)
745 sin_mask = aton ("255.255.0.0");
746 if (!i_flag)
747 my_ip_addr = aton ("192.168.0.1");
748 if (!h_flag)
749 tftp_server = aton ("192.168.0.2");
750 if (!f_flag)
751 tftp_set_boot_fname ("test.fil", 8);
752 if (a_flag)
753 _arp_cache_add (tftp_server, (const eth_address*)&eth, FALSE);
754 }
755 else if (m_flag || i_flag || h_flag || f_flag || a_flag)
756 {
757 puts ("This option requires the `-n' flag");
758 return (-1);
759 }
760
761 if (d_flag)
762 dbug_init();
763
764 if (n_flag)
765 dbug_open();
766
767 /* Must set our hook first
768 */
769 _tftp_write = write_func;
770 _tftp_close = close_func;
771
772 sock_init();
773
774#ifdef WIN32
775 Sleep (1000); /* drain network buffers */
776#else
777 sleep (1);
778#endif
779 tcp_tick (NULL);
780 return (0);
781}
782#endif /* USE_TFTP */
783#endif /* TEST_PROG */
W32_GCC_FUNC_TYPE_WARN_DEF
W32_GCC_FUNC_TYPE_WARN_DEF() static void W32_CALL echo_discard_daemon(void)
"background" process handling echo + discard TCP sockets.
Definition: echo.c:191
W32_GCC_FUNC_TYPE_WARN_OFF
W32_GCC_FUNC_TYPE_WARN_OFF() void echo_discard_start(void)
Make gcc 8+ shut up about this warning: echo.c:143:19: warning: cast between incompatible function ty...
Definition: echo.c:135
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
Random
unsigned W32_CALL Random(unsigned a, unsigned b)
Returns a random integer in range [a..b].
Definition: misc.c:743
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
aton
DWORD W32_CALL aton(const char *str)
Converts [a.b.c.d] or a.b.c.d to 32 bit IPv4 address.
Definition: netaddr.c:86
netaddr.h
_arp_cache_add
BOOL W32_CALL _arp_cache_add(DWORD ip, const void *eth, BOOL expires)
Add given IP/Ether address to ARP-cache.
Definition: pcarp.c:1351
pcarp.h
parse_config_table
int W32_CALL parse_config_table(const struct config_table *tab, const char *section, const char *name, const char *value)
Parse the config-table and if a match is found for ('section'+'.
Definition: pcconfig.c:382
dbg_mode_all
BOOL dbg_mode_all
These are public so they can be set by application if running without a config-file.
Definition: pcdbug.c:199
pcdbug.h
resolve
DWORD W32_CALL resolve(const char *name)
Convert host name to an address.
Definition: pcdns.c:771
pcdns.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
sin_mask
DWORD sin_mask
our net-mask, 255.255.255.0
Definition: pctcp.c:70
udp_open
int W32_CALL udp_open(_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP active open.
Definition: pctcp.c:262
_watt_no_config
BOOL _watt_no_config
run with no config file (embedded/diskless)
Definition: sock_ini.c:134
code
Definition: zinftree.h:24
config_table
Definition: tcp.h:461
servent
Definition: netdb.h:124
ARG_RESOLVE
@ ARG_RESOLVE
resolve host to IPv4-address
Definition: tcp.h:457
ARG_STRDUP
@ ARG_STRDUP
duplicate string value
Definition: tcp.h:455
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
tftp_set_server
char * tftp_set_server(const char *name, int len)
Set the name of TFTP server.
Definition: tftp.c:381
recv_packet
static int recv_packet(DWORD block)
Receive a TFTP data packet.
Definition: tftp.c:188
send_req
static void send_req(char request, const char *fname)
Send a tftp request packet.
Definition: tftp.c:105
tftp_exit
static void W32_CALL tftp_exit(void)
Free allocated memory.
Definition: tftp.c:565
tftp_get_block
static int tftp_get_block(const char **buf)
Read the next data packet from a TFTP connection.
Definition: tftp.c:424
tftp_set_xfer_mode
static char * tftp_set_xfer_mode(const char *name)
Set the mode used for transfer.
Definition: tftp.c:416
tftp_open
static int tftp_open(DWORD server, const char *fname)
Open a TFTP connection on a random local port (our transaction ID).
Definition: tftp.c:292
udp_callback
static void udp_callback(_udp_Socket *s, int icmp_type, int icmp_code)
Watch out for "ICMP port unreachable".
Definition: tftp.c:171
send_ack
static void send_ack(WORD block)
Send a tftp acknowledge packet.
Definition: tftp.c:136
tftp_set_boot_fname
char * tftp_set_boot_fname(const char *name, int len)
Set the name of remote/local file to load from TFTP server.
Definition: tftp.c:392
tftp_close
static void tftp_close(void)
Close the TFTP connection.
Definition: tftp.c:361
tftp_strerror
static const char * tftp_strerror(int code)
Return error string for 'th_code'.
Definition: tftp.c:149
tftp_init
int tftp_init(void)
Initialize config-hook for TFTP protocol.
Definition: tftp.c:577
tftp_boot_load
int tftp_boot_load(void)
Load the BOOT-file from TFTP server.
Definition: tftp.c:474
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/inc/protocol/timed.h Source File

  • inc
  • protocol
timed.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1983 Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __PROTOCOL_TIMED_H
39#define __PROTOCOL_TIMED_H
40
41#include <sys/wtypes.h>
42#include <sys/param.h>
43
44/*
45 * Time Synchronization Protocol
46 */
47
48#define TSPVERSION 1
49#define ANYADDR NULL
50
51#include <sys/pack_on.h>
52
53struct tsp {
54 u_int8_t tsp_type;
55 u_int8_t tsp_vers;
56 u_int16_t tsp_seq;
57 union {
58 struct {
59 int32_t tv_sec;
60 int32_t tv_usec;
61 } tspu_time;
62 char tspu_hopcnt;
63 } tsp_u;
64 char tsp_name[MAXHOSTNAMELEN];
65};
66
67#include <sys/pack_off.h>
68
69#define tsp_time tsp_u.tspu_time
70#define tsp_hopcnt tsp_u.tspu_hopcnt
71
72/*
73 * Command types.
74 */
75#define TSP_ANY 0 /* match any types */
76#define TSP_ADJTIME 1 /* send adjtime */
77#define TSP_ACK 2 /* generic acknowledgement */
78#define TSP_MASTERREQ 3 /* ask for master's name */
79#define TSP_MASTERACK 4 /* acknowledge master request */
80#define TSP_SETTIME 5 /* send network time */
81#define TSP_MASTERUP 6 /* inform slaves that master is up */
82#define TSP_SLAVEUP 7 /* slave is up but not polled */
83#define TSP_ELECTION 8 /* advance candidature for master */
84#define TSP_ACCEPT 9 /* support candidature of master */
85#define TSP_REFUSE 10 /* reject candidature of master */
86#define TSP_CONFLICT 11 /* two or more masters present */
87#define TSP_RESOLVE 12 /* masters' conflict resolution */
88#define TSP_QUIT 13 /* reject candidature if master is up */
89#define TSP_DATE 14 /* reset the time (date command) */
90#define TSP_DATEREQ 15 /* remote request to reset the time */
91#define TSP_DATEACK 16 /* acknowledge time setting */
92#define TSP_TRACEON 17 /* turn tracing on */
93#define TSP_TRACEOFF 18 /* turn tracing off */
94#define TSP_MSITE 19 /* find out master's site */
95#define TSP_MSITEREQ 20 /* remote master's site request */
96#define TSP_TEST 21 /* for testing election algo */
97#define TSP_SETDATE 22 /* New from date command */
98#define TSP_SETDATEREQ 23 /* New remote for above */
99#define TSP_LOOP 24 /* loop detection packet */
100
101#define TSPTYPENUMBER 25
102
103#ifdef TSPTYPES
104char *tsptype[TSPTYPENUMBER] = {
105 "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP",
106 "SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT",
107 "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ",
108 "TEST", "SETDATE", "SETDATEREQ", "LOOP"
109 };
110#endif
111
112#endif
pack_off.h
pack_on.h
param.h
tsp
Definition: timed.h:53
wtypes.h


Watt-32 tcp/ip: E:/WATT/src/timer.c Source File

  • src
timer.c
Go to the documentation of this file.
1
18#include <stdio.h>
19#include <stdlib.h>
20#include <limits.h>
21#include <signal.h>
22#include <time.h>
23#include <math.h>
24#include <errno.h>
25#include <sys/wtime.h>
26
27#include "wattcp.h"
28#include "ioport.h"
29#include "gettod.h"
30#include "pcdbug.h"
31#include "pcqueue.h"
32#include "language.h"
33#include "cpumodel.h"
34#include "powerpak.h"
35#include "wdpmi.h"
36#include "x32vm.h"
37#include "misc.h"
38#include "misc_str.h"
39#include "run.h"
40#include "timer.h"
41
42#if (DOSX & PHARLAP)
43#include <mw/exc.h> /* _dx_alloc_rmode_wrapper_iret() */
44#endif
45
46DWORD start_time = 0;
47DWORD start_day = 0;
49#if defined(WIN32)
50 #if defined(__WATCOMC__)
51 WINBASEAPI VOID WINAPI GetNativeSystemInfo (LPSYSTEM_INFO);
52 #endif
53
54 BOOL has_rdtsc = TRUE;
55 BOOL use_rdtsc = TRUE;
57#else
58 BOOL has_8254 = FALSE;
59 BOOL has_rdtsc = FALSE;
60 BOOL use_rdtsc = FALSE;
61 BOOL using_int8 = FALSE;
62#endif
63
64DWORD clocks_per_usec = 0L;
65time_t user_tick_base = 0UL; /* time() when user-tick started */
66DWORD user_tick_msec = 0UL; /* milli-sec user-tick counter */
67BOOL user_tick_active = FALSE;
68unsigned num_cpus = 1;
69
70static DWORD date = 0;
71static DWORD date_ms = 0;
72
73/*
74 * Things for the user installable timer ISR.
75 */
76#if !(DOSX & DJGPP)
77 #define TIMER_ISR_PERIOD 10UL /* 10 msec between interrupts */
78 #define TIMER_INTR 8
79#endif
80
81#if (DOSX == 0) || (DOSX & DOS4GW)
82 #define HAVE_TIMER_ISR
83
84 static W32_IntrHandler old_int_8 = NULL;
85
86#elif (DOSX & (PHARLAP|X32VM))
87 #define HAVE_TIMER_ISR
88
89 static REALPTR old_int_8, int8_cback;
90/*static FARPTR old_int_8_pm; */
91 static RMC_BLK rmBlock_int8;
92
93#elif (DOSX & DJGPP)
94 #define HAVE_TIMER_ISR
95
96 static DWORD itimer_resolution = 0UL; /* in usec */
97 static void (*old_sigalrm)(int);
98 static struct itimerval old_itimer;
99#endif
100
101#if defined(HAVE_TIMER_ISR) && !(DOSX & DJGPP)
102 static DWORD tick_timer_8254 = 0UL;
103
104 /* 1193181 = 4.77MHz/4 pulses per sec.
105 */
106 #define TIMER_8254_COUNT ((1193181UL * TIMER_ISR_PERIOD) / 1000UL)
107#endif
108
109
114void init_timers (void)
115{
116#if defined(WIN32)
117 SYSTEM_INFO sys_info;
118
119 memset (&sys_info, 0, sizeof(sys_info));
120
121#if !defined(WIN64) && (_WIN32_WINNT >= 0x0501)
122 if (_watt_is_wow64)
123 GetNativeSystemInfo (&sys_info);
124 else
125#endif
126 GetSystemInfo (&sys_info);
127
128 if (sys_info.dwNumberOfProcessors == 0) /* The above could fail for some reason */
129 sys_info.dwNumberOfProcessors = 1;
130
131 num_cpus = sys_info.dwNumberOfProcessors;
132 clocks_per_usec = (DWORD) (get_cpu_speed() / S64_SUFFIX(1000000));
133
134#else
135 #if (DOSX) /* problems using 64-bit types in small/large models */
136 hires_timer (TRUE);
138 #if defined(HAVE_UINT64)
139 if (use_rdtsc && has_rdtsc)
140 {
141 clocks_per_usec = (DWORD) (get_cpu_speed() / S64_SUFFIX(1000000));
142 if (clocks_per_usec == 0UL)
143 {
144 outsnl ("CPU speed is 0?");
145 use_rdtsc = FALSE;
146 has_rdtsc = FALSE;
147 }
148 }
149 set_utc_offset(); /* don't pull in gettod.c unneccesary */
150 #endif
151 #endif /* DOSX */
152#endif
153
154 chk_timeout (0UL); /* init 'date' variables */
155
156 start_time = set_timeout (0);
157 start_day = get_day_num();
158}
159
169void W32_CALL init_userSuppliedTimerTick (void)
170{
171 user_tick_active = TRUE;
172 user_tick_base = time (NULL);
173#ifdef __MSDOS__
174 has_8254 = FALSE;
175#endif
176}
177
178/*
179 * Disable stack-checking here
180 */
181#if defined(__HIGHC__)
182 #pragma off(Call_trace)
183 #pragma off(Prolog_trace)
184 #pragma off(Epilog_trace)
185#endif
186
187#include "nochkstk.h"
188
198void W32_CALL userTimerTick (DWORD elapsed_time_msec)
199{
200 user_tick_msec += elapsed_time_msec;
201}
202
203#if defined(HAVE_TIMER_ISR)
207#if (DOSX & (DJGPP|PHARLAP|X32VM))
208 static void new_int_8 (void) /* not really an intr-handler */
209#else
210 static INTR_PROTOTYPE new_int_8 (void)
211#endif
212{
213#if !(DOSX & DJGPP)
214 tick_timer_8254 += TIMER_8254_COUNT;
215
216 if (tick_timer_8254 >= 0x10000)
217 {
218 tick_timer_8254 -= 0x10000;
219
220#if (DOSX & (PHARLAP|X32VM))
221 _dx_call_real (old_int_8, &rmBlock_int8, 1);
222#elif defined(__WATCOMC__)
223 _chain_intr (old_int_8); /* chain now */
224#else
225 (*old_int_8)();
226#endif
227 }
228 else
229 _outportb (0x20, 0x60); /* specific EOI for IRQ 0 */
230
231 userTimerTick (TIMER_ISR_PERIOD);
232
233#else
234 userTimerTick (itimer_resolution / 1000UL);
235#endif /* !(DOSX & DJGPP) */
236
237#if (DOSX & DJGPP)
238 /* BEEP(); */ /* !! test */
239#endif
240}
241
242void exit_timer_isr (void)
243{
244 if (!using_int8)
245 return;
246
247#if (DOSX & DJGPP)
248 signal (SIGALRM, old_sigalrm);
249 setitimer (ITIMER_REAL, &old_itimer, NULL);
250#else
251 if (old_int_8)
252 {
253 _outportb (0x43, 0x34); /* restore default timer rate */
254 _outportb (0x40, 0);
255 _outportb (0x40, 0);
256
257 PUSHF_CLI();
258
259#if (DOSX & (PHARLAP|X32VM))
260 _dx_rmiv_set (TIMER_INTR, old_int_8);
261 if (int8_cback)
262 _dx_free_rmode_wrapper (int8_cback);
263 old_int_8 = 0;
264 int8_cback = 0;
265#else
266 _dos_setvect (TIMER_INTR, old_int_8);
267 old_int_8 = NULL;
268#endif
269
270 POPF();
271 }
272#endif /* DJGPP */
273
274 /* This causes timeout calculations for timers started earlier
275 * to go wrong.
276 */
277 user_tick_active = FALSE;
278 using_int8 = FALSE;
279}
280
281/*
282 * DOS/djgpp: Hook INT 8 and modify rate of timer channel 0 for 55 msec period.
283 * DOS/others: Hook INT 8 and modify rate of timer channel 0 for 10 msec period.
284 * Win32: N/A.
285 */
286void init_timer_isr (void)
287{
288 /* Caller must do exit_timer_isr() before doing this again
289 */
290 if (using_int8)
291 return;
292
293#if (DOSX & DJGPP)
294 {
295 struct itimerval tim;
296
297 memset (&tim, 0, sizeof(tim));
298 tim.it_interval.tv_usec = 1;
299 setitimer (ITIMER_REAL, &tim, NULL);
300 setitimer (ITIMER_REAL, NULL, &tim);
301 itimer_resolution = 1000000UL * tim.it_interval.tv_sec + /* should become 55000 */
302 tim.it_interval.tv_usec;
303 tim.it_value.tv_sec = tim.it_interval.tv_sec;
304 tim.it_value.tv_usec = tim.it_interval.tv_usec;
305
306 memset (&old_itimer, 0, sizeof(old_itimer));
307 old_sigalrm = signal (SIGALRM, (W32_IntrHandler)new_int_8);
308 setitimer (ITIMER_REAL, &tim, &old_itimer);
309 }
310
311#elif (DOSX & (PHARLAP|X32VM))
312 #if 1
313 int8_cback = _dx_alloc_rmode_wrapper_iret ((pmodeHook)new_int_8, 256);
314 if (!int8_cback)
315 {
316 outsnl (_LANG("Cannot allocate real-mode timer callback"));
317 return;
318 }
319 _dx_rmiv_get (8, &old_int_8);
320 _dx_rmiv_set (8, int8_cback);
321 #else
322 {
323 FARPTR fp;
324 FP_SET (fp, new_int_8, MY_CS());
325 _dx_pmiv_get (8, &old_int_8_pm);
326 _dx_apmiv_set (8, fp);
327 }
328 #endif
329#else
330 old_int_8 = _dos_getvect (8);
331 _dos_setvect (8, new_int_8);
332#endif
333
334#if !(DOSX & DJGPP)
335 _outportb (0x43, 0x34);
336 _outportb (0x40, loBYTE(TIMER_8254_COUNT));
337 _outportb (0x40, hiBYTE(TIMER_8254_COUNT));
338#endif
339
340 init_userSuppliedTimerTick();
341 using_int8 = TRUE;
342
343 /* release it very early
344 */
345 RUNDOWN_ADD (exit_timer_isr, -2);
346}
347#endif /* HAVE_TIMER_ISR */
348
358int W32_CALL cmp_timers (DWORD t1, DWORD t2)
359{
360 if (t1 == t2)
361 return (0);
362 return (t1 < t2 ? -1 : +1);
363}
364
365#if defined(__MSDOS__)
366
377int hires_timer (int on)
378{
379 int old = has_8254;
380
381 has_8254 = on;
382 chk_timeout (0UL);
383 return (old);
384}
385
409DWORD clockbits (void)
410{
411 static VOLATILE DWORD count; /* static because of PUSHF_CLI() */
412
413#if 1
414 /*
415 * The following version was suggested by Andrew Paulsen
416 * <andrew.paulsen@ndsu.nodak.edu>. Seem to work fine.
417 */
418 static BOOL started = FALSE;
419
420 PUSHF_CLI();
421
422 if (!started) /* Initialize once, it is periodic */
423 {
424 _outportb (0x43, 0x34); /* Set timer 0, mode 2 */
425 _outportb (0x40, 0x00); /* Count is decremented, then compared to 0 */
426 _outportb (0x40, 0x00); /* so set count to 0 to get 65536 */
427 started = TRUE;
428 }
429
430 _outportb (0x43, 0x04); /* Latch present counter value command */
431 count = _inportb (0x40); /* LSB of count */
432 count |= _inportb (0x40) << 8; /* MSB of count */
433
434 POPF();
435
436 return (count);
437
438#else
439 static VOLATILE DWORD stat, count; /* static because of PUSHF_CLI() */
440
441 do
442 {
443 PUSHF_CLI();
444 _outportb (0x43, 0xC2); /* Read Back Command (timer 0, 8254 only) */
445 stat = _inportb (0x40); /* get status of timer 0 */
446 count = _inportb (0x40); /* LSB of count */
447 count |= _inportb (0x40) << 8; /* MSB of count */
448 POPF();
449 }
450 while (stat & 0x40); /* reread if NULL COUNT bit set */
451
452 stat = (stat & 0x80) << 8; /* Shift OUTPUT to MSB of 16-bit word */
453 count >>= 1; /* count = count/2 */
454 if (count == 0)
455 return (stat ^ 0x8000UL); /* return complement of OUTPUT bit */
456 return (count | stat); /* Combine OUTPUT with counter */
457#endif
458}
459
460#if !defined(W32_NO_8087)
474DWORD millisec_clock (void)
475{
476 DWORD hi;
477 WORD lo;
478 double x;
479
480 do
481 {
482 hi = PEEKL (0, BIOS_CLK);
483 lo = clockbits();
484 }
485 while (hi != PEEKL(0, BIOS_CLK)); /* tick count changed, try again */
486 lo = 0 - lo;
487
488 /* Emulating this would be slow. We'd better have a math-processor
489 */
490 x = ldexp ((double)hi, 16) + (double)lo; /* x = hi*2^16 + lo */
491 return (DWORD) (x * 4.0 / 4770.0);
492}
493#endif /* !W32_NO_8087 */
494#endif /* __MSDOS__ */
495
496
501DWORD W32_CALL set_timeout (DWORD msec)
502{
503 DWORD ret;
504
505 if (user_tick_active) /* using timer ISR or user-timer */
506 {
507 ret = user_tick_msec + msec;
508 }
509#if defined(HAVE_UINT64) /* CPU-clock, 8254 PIT or 55msec ticks */ || \
510 defined(WIN32) /* GetSystemTimeAsFileTime() */
511 else
512 {
513 struct timeval now;
514
515 gettimeofday2 (&now, NULL);
516 ret = msec + 1000 * (DWORD)now.tv_sec + (DWORD)(now.tv_usec / 1000);
517 }
518#else
519
520#if !defined(W32_NO_8087)
521 else if (has_8254) /* high-resolution PIT */
522 {
523 ret = msec + date_ms + millisec_clock();
524 }
525#endif
526 else /* fallback to 55msec ticks */
527 {
528 DWORD ticks = 1;
529
530 if (msec > 55)
531 ticks = msec / 55UL;
532 /* ret = ticks + ms_clock(); !!!! try this */
533 ret = ticks + date + PEEKL (0,BIOS_CLK);
534 }
535#endif /* HAVE_UINT64 || WIN32 */
536
537 return (ret == 0 ? 1 : ret);
538}
539
545BOOL W32_CALL chk_timeout (DWORD value)
546{
547 if (user_tick_active) /* using timer ISR or user-timer */
548 {
549 if (value == 0)
550 return (0);
551 return (user_tick_msec >= value);
552 }
553
554#if defined(HAVE_UINT64) || defined(WIN32)
555 if (value == 0UL)
556 return (0);
557 return (set_timeout(0) >= value);
558
559#else
560 {
561 static char oldHour = -1;
562#if !defined(W32_NO_8087)
563 static DWORD now_ms;
564#endif
565 static DWORD now;
566 char hour;
567
568 now = (DWORD) PEEKL (0, BIOS_CLK);
569#if 1
570 hour = (char)(now >> 16U);
571#else
572 hour = (char)(now/65543.33496093); /* Jan De Geeter 17.12.01 */
573#endif
574
575 if (hour != oldHour)
576 {
577 if (hour < oldHour) /* midnight passed */
578 {
579#define CORR 290UL /* experimental correction */
580 date += 1572750UL + CORR; /* Update date (0x1800B0UL) */
581 date_ms += 3600UL*24UL*1000UL; /* ~2^26 */
582 }
583 oldHour = hour;
584 }
585
586 if (value == 0L) /* timer not initialised */
587 return (0); /* (or stopped) */
588
589#if !defined(W32_NO_8087)
590 if (has_8254)
591 {
592 now_ms = millisec_clock();
593 return (now_ms + date_ms >= value);
594 }
595#endif
596 now += date; /* date extend current time */
597 return (now >= value); /* return true if expired */
598 }
599#endif /* HAVE_UINT64 || WIN32 */
600}
601
606int W32_CALL set_timediff (long msec)
607{
608 date_ms -= msec;
609 date -= msec/55;
610 return (0);
611}
612
620long W32_CALL get_timediff (DWORD now, DWORD tim)
621{
622#if defined(HAVE_UINT64) || defined(WIN32)
623 return (long)(now - tim);
624#else
625 long dt = (long)(now - tim);
626
627 if (has_8254)
628 dt = dt % (3600L*24L*1000L);
629 else dt = dt % (1572750L + CORR);
630 return (dt);
631#endif
632}
633
634#if !defined(W32_NO_8087)
638double W32_CALL timeval_diff (const struct timeval *newer, const struct timeval *older)
639{
640 long d_sec = (long)newer->tv_sec - (long)older->tv_sec;
641 long d_usec = newer->tv_usec - older->tv_usec;
642
643 while (d_usec < 0)
644 {
645 d_usec += 1000000L;
646 d_sec -= 1;
647 }
648 return ((1E6 * (double)d_sec) + (double)d_usec);
649}
650#endif
651
652struct timeval W32_CALL timeval_diff2 (struct timeval *ta, struct timeval *tb)
653{
654 struct timeval tv;
655
656 if (tb->tv_usec > ta->tv_usec)
657 {
658 ta->tv_sec--;
659 ta->tv_usec += 1000000L;
660 }
661 tv.tv_sec = ta->tv_sec - tb->tv_sec;
662 tv.tv_usec = ta->tv_usec - tb->tv_usec;
663 if (tv.tv_usec >= 1000000L)
664 {
665 tv.tv_usec -= 1000000L;
666 tv.tv_sec++;
667 }
668 return (tv);
669}
670
671#if defined(USE_DEBUG)
680const char *time_str (DWORD val)
681{
682 static char buf[30];
683 char fmt[6];
684 double flt_val;
685
686#if defined(WIN32)
687 flt_val = (double)val / 1000.0F;
688 strcpy (fmt, "%.3f");
689
690#else
691
692 if (has_8254 || has_rdtsc || user_tick_active)
693 {
694 flt_val = (double)val / 1000.0F;
695 strcpy (fmt, "%.3f");
696 }
697 else
698 {
699 flt_val = (double)val / 18.2F;
700 strcpy (fmt, "%.2f");
701 }
702#endif
703
704#if defined(SNPRINTF)
705 SNPRINTF (buf, sizeof(buf), fmt, flt_val);
706#else
707 sprintf (buf, fmt, flt_val);
708#endif
709 return (buf);
710}
711
715const char *hms_str (DWORD sec)
716{
717 static char buf[30];
718 WORD hour = (WORD) (sec / 3600UL);
719 WORD min = (WORD) (sec / 60) - (60 * hour);
720
721 sprintf (buf, "%02u:%02u:%02u", hour, min, (UINT)(sec % 60UL));
722 return (buf);
723}
724
729const char *elapsed_str (DWORD val)
730{
731 static char buf[30];
732 WORD hour, min, msec;
733 DWORD sec;
734 BOOL msec_clock = 1;
735
736#ifdef __MSDOS__
737 msec_clock = (has_8254 || has_rdtsc);
738#endif
739
740 if (val == 0UL)
741 return ("00:00:00.000");
742
743#if 0
744 if (!user_tick_active && val < start_time) /* wrapped? */
745 val = ULONG_MAX - val + start_time;
746#endif
747
748 /* If user-ticks is used, 'val' should be correct msec count
749 * since init_userSuppliedTimerTick() was called.
750 */
751 if (user_tick_active)
752 {
753 sec = val / 1000UL;
754 msec = (WORD) (val % 1000UL);
755 }
756 else if (msec_clock)
757 {
758 val -= start_time;
759 sec = val / 1000UL;
760 msec = (WORD) (val % 1000UL);
761 }
762 else
763 {
764 val -= start_time;
765 sec = val / 18;
766 msec = 55 * (WORD)(val % 18UL);
767 }
768
769 hour = (WORD) (sec / 3600UL);
770 min = (WORD) (sec / 60UL) - 60 * hour;
771 sec = sec % 60UL;
772 sprintf (buf, "%02u:%02u:%02lu.%03u", hour, min, (u_long)sec, msec);
773 return (buf);
774}
775#endif /* USE_DEBUG */
776
777
778#if defined(__MSDOS__)
779/*
780 * The following was contributed by
781 * "Alain" <alainm@pobox.com>
782 */
783#define TICKS_DAY 1573067UL /* Number of ticks in one day */
784
785DWORD ms_clock (void)
786{
787 static DWORD lastTick, tickOffset;
788 static char firstTime = 1;
789 DWORD tick = PEEKL (0, 0x46C);
790
791 if (firstTime)
792 {
793 firstTime = 0;
794 lastTick = tickOffset = tick;
795 return (0);
796 }
797 if (lastTick > tick) /* day changed */
798 tickOffset -= TICKS_DAY;
799 lastTick = tick;
800 return (tick - tickOffset);
801}
802
803#if defined(__HIGHC__) || defined(__DMC__)
804void delay (unsigned int msec)
805{
806 for (; msec; msec--)
807 {
808 DWORD now = ms_clock();
809 while (ms_clock() == now) /* wait 1msec */
810 ;
811 }
812}
813#endif
814
815#if (DOSX) && defined(HAVE_UINT64)
816/*
817 * Wait for BIOS timer-tick to change 'num' times.
818 */
819static void Wait_N_ticks (int num)
820{
821 while (num--)
822 {
823 DWORD time = PEEKL (0, BIOS_CLK);
824
825 while (time == PEEKL(0,BIOS_CLK))
826 {
827#ifdef __DJGPP__
828 ENABLE(); /* CWSDPMI requires this! */
829#else
830 ((void)0);
831#endif
832 }
833 }
834}
835
839 uint64 get_cpu_speed (void)
840{
841 #define NUM_SAMPLES 3
842 #define WAIT_TICKS 2
843
844 uint64 speed;
845 uint64 sample [NUM_SAMPLES];
846 int i;
847
848 Wait_N_ticks (1);
849
850 for (i = 0; i < NUM_SAMPLES; i++)
851 {
852 uint64 start = GET_RDTSC();
853
854 Wait_N_ticks (WAIT_TICKS);
855 sample[i] = 1000 * (GET_RDTSC() - start) / (WAIT_TICKS*55);
856 }
857
858 speed = 0;
859 for (i = 0; i < NUM_SAMPLES; i++)
860 speed += sample[i];
861 return (speed / NUM_SAMPLES);
862}
863#endif /* DOSX && HAVE_UINT64 */
864
865#elif defined(WIN32)
866
870#if defined(__GNUC__) && defined(__NO_INLINE__) /* -O0 */
871 #if defined(__i386__)
872 uint64 _w32_get_rdtsc (void)
873 {
874 register uint64 tsc;
875 __asm__ __volatile__ (
876 ".byte 0x0F, 0x31;" /* rdtsc opcode */
877 : "=A" (tsc) );
878 return (tsc);
879 }
880
881 #elif defined(__x86_64__)
882 uint64 _w32_get_rdtsc (void)
883 {
884 unsigned hi, lo;
885 __asm__ __volatile__ (
886 "rdtsc" : "=a" (lo), "=d" (hi) );
887 return ( (uint64)lo) | ( ((uint64)hi) << 32 );
888 }
889 #else
890 #error What kind of CPU is this?
891 #endif
892#endif /* __GNUC__ && __NO_INLINE__ */
893
894
895#if 0
896/*
897 * Wait for timer-ticks to change `num` times.
898 */
899static void Wait_N_ticks (int num)
900{
901 DWORD tim;
902
903 while (num--)
904 {
905 tim = GetTickCount() + 55;
906 while (GetTickCount() < tim)
907 Sleep (0);
908 }
909}
910#endif
911
912static BOOL get_processor_freq (uint64 *Hz)
913{
914 BOOL rc = FALSE;
915 DWORD MHz, size = sizeof(MHz);
916 HKEY key = NULL;
917 LONG status = RegOpenKeyEx (HKEY_LOCAL_MACHINE,
918 "HARDWARE\\DESCRIPTION\\System\\"
919 "CentralProcessor\\0", 0, KEY_READ, &key);
920
921 if (status != ERROR_SUCCESS)
922 return (FALSE);
923
924 status = RegQueryValueEx (key, "~MHz", NULL, NULL, (BYTE*)&MHz, &size);
925 if (status == ERROR_SUCCESS)
926 {
927 *Hz = MHz * U64_SUFFIX(1000000);
928 rc = TRUE;
929 }
930 if (key)
931 RegCloseKey (key);
932 return (rc);
933}
934
941 uint64 get_cpu_speed (void)
942{
943 static LARGE_INTEGER qpc;
944 static uint64 Hz;
945 static BOOL done = FALSE;
946 static uint64 rc = U64_SUFFIX(0);
947
948 if (done)
949 return (rc);
950
951 if (num_cpus > 1)
952 rc = get_processor_freq(&Hz) ? Hz : U64_SUFFIX(0);
953 else if (QueryPerformanceFrequency(&qpc))
954 rc = qpc.QuadPart;
955 else rc = U64_SUFFIX(0);
956 done = TRUE;
957 return (rc);
958}
959
960 uint64 win_get_perf_count (void)
961{
962 LARGE_INTEGER rc;
963 DWORD mask = 0UL;
964 HANDLE cthread = INVALID_HANDLE_VALUE;
965
966 if (num_cpus > 1)
967 {
968 cthread = GetCurrentThread();
969 mask = SetThreadAffinityMask (cthread, 1);
970 }
971 QueryPerformanceCounter (&rc);
972
973 if (num_cpus > 1 && mask)
974 SetThreadAffinityMask (cthread, mask);
975 return (rc.QuadPart);
976}
977
978/*
979 * Make sure RDTSC is returned from the 1st CPU on a
980 * multi (or hyper-threading) CPU system.
981 */
982 uint64 win_get_rdtsc (void)
983{
984 DWORD mask = 0UL;
985 HANDLE cthread = INVALID_HANDLE_VALUE;
986 uint64 rc;
987
988 if (num_cpus > 1)
989 {
990 cthread = GetCurrentThread();
991 mask = SetThreadAffinityMask (cthread, 1);
992 }
993
994#if defined(__BORLANDC__) || defined(__WATCOMC__)
995 rc = get_rdtsc();
996#else
997 rc = __rdtsc();
998#endif
999
1000 if (num_cpus > 1 && mask)
1001 SetThreadAffinityMask (cthread, mask);
1002 return (rc);
1003}
1004#endif /* __MSDOS__ */
1005
cpumodel.h
errno.h
set_utc_offset
void set_utc_offset(void)
Called from init_timers() once.
Definition: gettod.c:173
gettod.h
ioport.h
language.h
get_day_num
DWORD get_day_num(void)
Simplified method of getting days since 1970-01-01.
Definition: misc.c:222
misc.h
misc_str.h
nochkstk.h
pcdbug.h
pcqueue.h
powerpak.h
RMC_BLK
Definition: x32vm.h:30
itimerval
Definition: wtime.h:75
timeval
Definition: wtime.h:30
clockbits
DWORD clockbits(void)
The following 2 routines are modified versions from KA9Q NOS by Phil Karn.
Definition: timer.c:409
hires_timer
int hires_timer(int on)
Control use of high-resolution timer.
Definition: timer.c:377
cmp_timers
int W32_CALL cmp_timers(DWORD t1, DWORD t2)
Compare two timers with expirary at 't1' and 't2'.
Definition: timer.c:358
start_day
DWORD start_day
Start-day of watt_sock_init()
Definition: timer.c:47
clocks_per_usec
DWORD clocks_per_usec
Measured CPU speed (MHz)
Definition: timer.c:64
hms_str
const char * hms_str(DWORD sec)
Return string "HH:MM:SS" for a time in seconds.
Definition: timer.c:715
millisec_clock
DWORD millisec_clock(void)
Return hardware time-of-day in milliseconds.
Definition: timer.c:474
userTimerTick
void W32_CALL userTimerTick(DWORD elapsed_time_msec)
Provide timer-ticks from an application.
Definition: timer.c:198
time_str
const char * time_str(DWORD val)
Return string x.xx for timeout value.
Definition: timer.c:680
timeval_diff
double W32_CALL timeval_diff(const struct timeval *newer, const struct timeval *older)
Return difference (in micro-sec) between timevals *newer and *older.
Definition: timer.c:638
init_userSuppliedTimerTick
void W32_CALL init_userSuppliedTimerTick(void)
init_userSuppliedTimerTick() - setup timer handling for programs that are already running a periodic ...
Definition: timer.c:169
_w32_get_rdtsc
uint64 _w32_get_rdtsc(void)
Another hackery section for gcc -O0 -fgnu89-inline:
Definition: timer.c:872
use_rdtsc
BOOL use_rdtsc
Ditto.
Definition: timer.c:55
get_timediff
long W32_CALL get_timediff(DWORD now, DWORD tim)
Return time difference between timers now and tim.
Definition: timer.c:620
init_timers
void init_timers(void)
Setup timer stuff and measure CPU speed.
Definition: timer.c:114
has_8254
BOOL has_8254
Do we have a working 8254 timer chip?
Definition: timer.c:58
using_int8
BOOL using_int8
init_timer_isr() called
Definition: timer.c:61
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
get_cpu_speed
uint64 get_cpu_speed(void)
Return estimated CPU speed in Hz.
Definition: timer.c:839
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
new_int_8
static void new_int_8(void)
User defined 10 (or 55) milli-sec counter ISR.
Definition: timer.c:208
elapsed_str
const char * elapsed_str(DWORD val)
Return string "xx:xx" for time elapsed since started.
Definition: timer.c:729
has_rdtsc
BOOL has_rdtsc
Never set in Watt-32.
Definition: timer.c:54
set_timediff
int W32_CALL set_timediff(long msec)
Must be called by user right before or after a time change occurs.
Definition: timer.c:606
start_time
DWORD start_time
Start-time of watt_sock_init() (in msec)
Definition: timer.c:46
timer.h
wattcp.h
Core definitions.
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65
wdpmi.h
wtime.h
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/timer.h Source File

  • src
timer.h
Go to the documentation of this file.
1
3#ifndef _w32_TIMER_H
4#define _w32_TIMER_H
5
6#ifndef __SYS_WTIME_H
7#include <sys/wtime.h> /* struct timeval */
8#endif
9
10#define user_tick_active W32_NAMESPACE (user_tick_active)
11#define user_tick_base W32_NAMESPACE (user_tick_base)
12#define user_tick_msec W32_NAMESPACE (user_tick_msec)
13#define clocks_per_usec W32_NAMESPACE (clocks_per_usec)
14#define num_cpus W32_NAMESPACE (num_cpus)
15#define millisec_clock W32_NAMESPACE (millisec_clock)
16#define start_time W32_NAMESPACE (start_time)
17#define start_day W32_NAMESPACE (start_day)
18#define init_timers W32_NAMESPACE (init_timers)
19
20#define time_str W32_NAMESPACE (time_str)
21#define hms_str W32_NAMESPACE (hms_str)
22#define elapsed_str W32_NAMESPACE (elapsed_str)
23
24#define has_rdtsc W32_NAMESPACE (has_rdtsc)
25#define use_rdtsc W32_NAMESPACE (use_rdtsc)
26
27#if defined(WIN32)
28 #define init_timer_isr() ((void)0)
29 #define exit_timer_isr() ((void)0)
30 #define win_get_perf_count W32_NAMESPACE (win_get_perf_count)
31
32 W32_DATA BOOL has_rdtsc, use_rdtsc;
33 extern uint64 win_get_perf_count (void);
34
35#else
36 /*
37 * System clock at BIOS location 40:6C (dword). Counts upwards.
38 */
39 #define BIOS_CLK 0x46C
40
41 #define init_timer_isr W32_NAMESPACE (init_timer_isr)
42 #define exit_timer_isr W32_NAMESPACE (exit_timer_isr)
43 #define has_8254 W32_NAMESPACE (has_8254)
44 #define using_int8 W32_NAMESPACE (using_int8)
45 #define clockbits W32_NAMESPACE (clockbits)
46 #define ms_clock W32_NAMESPACE (ms_clock)
47 #define hires_timer W32_NAMESPACE (hires_timer)
48
49 extern BOOL has_8254, using_int8;
50 extern BOOL has_rdtsc, use_rdtsc;
51
52 extern DWORD clockbits (void);
53 extern int hires_timer (int on);
54 extern DWORD ms_clock (void);
55 extern void init_timer_isr (void);
56 extern void exit_timer_isr (void);
57#endif
58
59W32_DATA BOOL user_tick_active;
60W32_DATA DWORD clocks_per_usec, user_tick_msec;
61W32_DATA time_t user_tick_base;
62W32_DATA DWORD start_time, start_day;
63W32_DATA unsigned num_cpus;
64
65extern void init_timers (void);
66extern DWORD millisec_clock (void);
67
68extern const char *time_str (DWORD val);
69extern const char *hms_str (DWORD sec);
70extern const char *elapsed_str(DWORD val);
71
72#if defined(__HIGHC__) || (defined(__DMC__) && defined(__MSDOS__))
73 #define delay W32_NAMESPACE (delay)
74
75 extern void delay (unsigned int msec);
76#endif
77
78#if defined(WIN32) || defined(HAVE_UINT64)
79 #define get_cpu_speed W32_NAMESPACE (get_cpu_speed)
80
81 extern uint64 get_cpu_speed (void);
82#endif
83
84#endif
85
start_day
DWORD start_day
Start-day of watt_sock_init()
Definition: timer.c:47
clocks_per_usec
DWORD clocks_per_usec
Measured CPU speed (MHz)
Definition: timer.c:64
use_rdtsc
BOOL use_rdtsc
Ditto.
Definition: timer.c:55
using_int8
BOOL using_int8
init_timer_isr() called
Definition: timer.c:61
has_rdtsc
BOOL has_rdtsc
Never set in Watt-32.
Definition: timer.c:54
start_time
DWORD start_time
Start-time of watt_sock_init() (in msec)
Definition: timer.c:46
clockbits
DWORD clockbits(void)
The following 2 routines are modified versions from KA9Q NOS by Phil Karn.
Definition: timer.c:409
hires_timer
int hires_timer(int on)
Control use of high-resolution timer.
Definition: timer.c:377
hms_str
const char * hms_str(DWORD sec)
Return string "HH:MM:SS" for a time in seconds.
Definition: timer.c:715
millisec_clock
DWORD millisec_clock(void)
Return hardware time-of-day in milliseconds.
Definition: timer.c:474
time_str
const char * time_str(DWORD val)
Return string x.xx for timeout value.
Definition: timer.c:680
init_timers
void init_timers(void)
Setup timer stuff and measure CPU speed.
Definition: timer.c:114
has_8254
BOOL has_8254
Do we have a working 8254 timer chip?
Definition: timer.c:58
get_cpu_speed
uint64 get_cpu_speed(void)
Return estimated CPU speed in Hz.
Definition: timer.c:839
elapsed_str
const char * elapsed_str(DWORD val)
Return string "xx:xx" for time elapsed since started.
Definition: timer.c:729
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65
wtime.h


Watt-32 tcp/ip: E:/WATT/src/transmit.c Source File

  • src
transmit.c
Go to the documentation of this file.
1
5/* BSD sockets functionality for Watt-32 TCP/IP
6 *
7 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Gisle Vanem
20 * Bergen, Norway.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
26 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Version
34 *
35 * 0.5 : Dec 18, 1997 : G. Vanem - created
36 */
37
38#include "socket.h"
39#include "pcicmp6.h"
40
41#if defined(USE_BSD_API)
42
43static int raw_transmit (Socket *socket, const void *buf, unsigned len);
44static int udp_transmit (Socket *socket, const void *buf, unsigned len);
45static int tcp_transmit (Socket *socket, const void *buf, unsigned len, int flags);
46static int setup_udp_raw (Socket *socket, const struct sockaddr *to, int tolen);
47
48static int transmit (const char *func, int s, const void *buf, unsigned len,
49 int flags, const struct sockaddr *to, int tolen,
50 BOOL have_remote_addr);
51
52int W32_CALL sendto (int s, const void *buf, int len, int flags,
53 const struct sockaddr *to, socklen_t tolen)
54{
55 return transmit ("sendto", s, buf, len, flags, to, tolen, TRUE);
56}
57
58int W32_CALL send (int s, const void *buf, int len, int flags)
59{
60 return transmit ("send", s, buf, len, flags, NULL, 0, FALSE);
61}
62
63int W32_CALL write_s (int s, const char *buf, int nbyte)
64{
65 return transmit ("write_s", s, buf, nbyte, 0, NULL, 0, FALSE);
66}
67
68int W32_CALL writev_s (int s, const struct iovec *vector, size_t count)
69{
70 int len, bytes = 0;
71 size_t i, max = 0;
72
73 SOCK_DEBUGF (("\nwritev_s:%d, iovecs=%lu", s, (u_long)count));
74
75 for (i = 0; i < count; ++i)
76 {
77#if (DOSX)
78 if (!valid_addr(vector[i].iov_base, vector[i].iov_len))
79 {
80 SOCK_DEBUGF ((", EFAULT (iovec[%lu] = %p, len %lu)",
81 (unsigned long)i, vector[i].iov_base,
82 (unsigned long)vector[i].iov_len));
83 SOCK_ERRNO (EFAULT);
84 return (-1);
85 }
86#endif
87
88 if (vector[i].iov_len > (unsigned)INT_MAX)
89 {
90 SOCK_DEBUGF ((", EINVAL (iovec[%lu]: len %lu > INT_MAX)",
91 (unsigned long)i, (unsigned long)vector[i].iov_len));
92 SOCK_ERRNO (EINVAL);
93 return (-1);
94 }
95
96 max += vector[i].iov_len;
97 if (max > (unsigned)INT_MAX)
98 {
99 SOCK_DEBUGF ((", EINVAL (max > INT_MAX)"));
100 SOCK_ERRNO (EINVAL);
101 return (-1);
102 }
103 }
104
105 for (i = 0; i < count; i++)
106 {
107 int flags = (i + 1 == count ? 0 : MSG_MORE);
108
109 len = transmit (NULL, s, vector[i].iov_base, vector[i].iov_len,
110 flags, NULL, 0, FALSE);
111 if (len < 0)
112 {
113 if (bytes == 0)
114 bytes = -1;
115 break;
116 }
117 bytes += len;
118 if ((unsigned)len != vector[i].iov_len)
119 break;
120 }
121
122 SOCK_DEBUGF ((", total %d", bytes)); /* writing 0 byte is not an error */
123 return (bytes);
124}
125
126/*
127 * sendmsg():
128 */
129int W32_CALL sendmsg (int s, const struct msghdr *msg, int flags)
130{
131 const struct iovec *iov;
132 int count = msg->msg_iovlen;
133 int i, bytes, len;
134 size_t max = 0;
135
136 SOCK_DEBUGF (("\nsendmsg:%d, iovecs=%d", s, count));
137
138 iov = msg->msg_iov;
139 if (!iov)
140 {
141 SOCK_DEBUGF ((", EFAULT"));
142 SOCK_ERRNO (EFAULT);
143 return (-1);
144 }
145
146 for (i = 0; i < count; ++i)
147 {
148#if (DOSX)
149 if (!valid_addr(iov[i].iov_base, iov[i].iov_len))
150 {
151 SOCK_DEBUGF ((", EFAULT (iovec[%d] = %p/%lu)",
152 i, iov[i].iov_base, (unsigned long)iov[i].iov_len));
153 SOCK_ERRNO (EFAULT);
154 return (-1);
155 }
156#endif
157
158 if (iov[i].iov_len > (unsigned)INT_MAX)
159 {
160 SOCK_DEBUGF ((", EINVAL (iovec[%d]: len %lu > INT_MAX)",
161 i, (unsigned long)iov[i].iov_len));
162 SOCK_ERRNO (EINVAL);
163 return (-1);
164 }
165
166 max += iov[i].iov_len;
167 if (max > (unsigned)INT_MAX)
168 {
169 SOCK_DEBUGF ((", EINVAL (max > INT_MAX)"));
170 SOCK_ERRNO (EINVAL);
171 return (-1);
172 }
173 }
174
175 for (i = bytes = 0; i < count; i++)
176 {
177 int flags2 = flags | (i + 1 == count ? 0 : MSG_MORE);
178
179 len = transmit (NULL, s, iov[i].iov_base, iov[i].iov_len,
180 flags2, (struct sockaddr*)msg->msg_name,
181 msg->msg_namelen, TRUE);
182 if (len < 0)
183 {
184 if (bytes == 0)
185 bytes = -1;
186 break;
187 }
188 bytes += len;
189 if ((unsigned)len != iov[i].iov_len)
190 break;
191 }
192 SOCK_DEBUGF ((", total %d", bytes));
193 return (bytes);
194}
195
196/*
197 * Close socket if MSG_EOR specified in flags.
198 */
199static __inline void msg_eor_close (Socket *socket)
200{
201 switch (socket->so_type)
202 {
203 case SOCK_STREAM:
204 socket->so_state |= SS_CANTSENDMORE;
205 sock_close ((sock_type*)socket->tcp_sock);
206 break;
207 case SOCK_DGRAM:
208 socket->so_state |= SS_CANTSENDMORE;
209 sock_close ((sock_type*)socket->udp_sock);
210 break;
211 case SOCK_RAW:
212 socket->so_state |= SS_CANTSENDMORE;
213 break;
214 }
215}
216
217/*
218 * transmit() flags:
219 * MSG_DONTROUTE (not supported)
220 * MSG_EOR Close sending side after data sent
221 * MSG_TRUNC (not supported)
222 * MSG_CTRUNC (not supported)
223 * MSG_OOB (not supported)
224 * MSG_WAITALL Wait till room in tx-buffer (not supported)
225 * MSG_NOSIGNAL ?? (not supported)
226 * MSG_MORE Avoid flushing, don't set PUSH bit
227 */
228static int transmit (const char *func, int s, const void *buf, unsigned len,
229 int flags, const struct sockaddr *to, int tolen,
230 BOOL have_remote_addr) /* for sendto() and sendmsg() */
231{
232 Socket *socket = _socklist_find (s);
233 int rc;
234
235 if (func)
236 {
237 SOCK_DEBUGF (("\n%s:%d, len=%d", func, s, len));
238 if (flags)
239 SOCK_DEBUGF ((", flags 0x%X", flags));
240 }
241
242 if (!socket)
243 {
244 if (_sock_dos_fd(s))
245 {
246 SOCK_DEBUGF ((", ENOTSOCK"));
247 SOCK_ERRNO (ENOTSOCK);
248 return (-1);
249 }
250 SOCK_DEBUGF ((", EBADF"));
251 SOCK_ERRNO (EBADF);
252 return (-1);
253 }
254
255 if (flags & MSG_NOSIGNAL) /* Don't do 'raise(SIGPIPE)' */
256 socket->msg_nosig = TRUE;
257
258 if (socket->so_type == SOCK_STREAM || /* TCP-socket or */
259 (socket->so_state & SS_ISCONNECTED)) /* "connected" udp/raw */
260 {
261 /* Note: SOCK_RAW doesn't really need a local address/port, but
262 * makes the code more similar for all socket-types.
263 * Disadvantage is that SOCK_RAW ties up a local port and a bit
264 * more memory.
265 */
266
267 if (!socket->local_addr)
268 {
269 SOCK_DEBUGF ((", no local_addr"));
270 SOCK_ERRNO (ENOTCONN);
271 return (-1);
272 }
273
274 if (!socket->remote_addr)
275 {
276 SOCK_DEBUGF ((", no remote_addr"));
277 SOCK_ERRNO (ENOTCONN);
278 return (-1);
279 }
280
281 if (socket->so_state & SS_ISCONNECTING)
282 {
283 while (1)
284 {
285 tcp_tick (NULL);
286
287 if (!_sock_pending_connect (socket))
288 break;
289
290 if (socket->so_state & SS_NBIO)
291 {
292 SOCK_DEBUGF ((", EAGAIN"));
293 SOCK_ERRNO (EAGAIN);
294 return (-1);
295 }
296
297 if (socket->tcp_sock->usr_yield)
298 (*socket->tcp_sock->usr_yield) ();
299 else WATT_YIELD ();
300 }
301 }
302
303 if (socket->so_error != 0)
304 {
305 SOCK_DEBUGF ((", SO_ERROR: %s", short_strerror (socket->so_error)));
306 SOCK_ERRNO (socket->so_error);
307 socket->so_error = 0;
308 return (-1);
309 }
310
311 if (socket->so_state & SS_CONN_REFUSED)
312 {
313 SOCK_DEBUGF ((", ECONNREFUSED"));
314 SOCK_ERRNO (ECONNREFUSED);
315 return (-1);
316 }
317 }
318
319 /* connectionless protocol setup.
320 * SOCK_PACKET sockets go pretty much unchecked.
321 */
322 if (socket->so_type == SOCK_DGRAM ||
323 socket->so_type == SOCK_RAW)
324 {
325 size_t sa_len = (socket->so_family == AF_INET6) ?
326 sizeof(struct sockaddr_in6) :
327 (socket->so_family == AF_PACKET) ?
328 sizeof(struct sockaddr_ll) :
329 sizeof(struct sockaddr_in);
330
331 if (!have_remote_addr)
332 {
333 to = (const struct sockaddr*) socket->remote_addr;
334 tolen = sa_len;
335 }
336 if (!to || tolen < (int)sa_len)
337 {
338 SOCK_DEBUGF ((", illegal to-addr (tolen = %d, sa_len %d)",
339 tolen, (int)sa_len));
340 SOCK_ERRNO (EINVAL);
341 return (-1);
342 }
343 if (socket->so_type != SOCK_PACKET &&
344 setup_udp_raw(socket,to,tolen) < 0)
345 return (-1);
346 }
347
348 if (len > 0)
349 VERIFY_RW (buf, len);
350
351 if (socket->so_type != SOCK_DGRAM && (!buf || len == 0))
352 {
353 SOCK_DEBUGF ((", EINVAL"));
354 SOCK_ERRNO (EINVAL);
355 return (-1);
356 }
357
358 if (_sock_sig_setup() < 0)
359 {
360 SOCK_ERRNO (EINTR);
361 return (-1);
362 }
363
364 switch (socket->so_type)
365 {
366 case SOCK_DGRAM:
367 rc = udp_transmit (socket, buf, len);
368 break;
369
370 case SOCK_STREAM:
371 rc = tcp_transmit (socket, buf, len, flags);
372 break;
373
374 case SOCK_RAW:
375 rc = raw_transmit (socket, buf, len);
376 break;
377
378 case SOCK_PACKET:
379 rc = sock_packet_transmit (socket, buf, len, to, tolen);
380 break;
381
382 default:
383 SOCK_DEBUGF ((", EPROTONOSUPPORT"));
384 SOCK_ERRNO (EPROTONOSUPPORT);
385 rc = -1;
386 break;
387 }
388
389 if (rc >= 0 && (flags & MSG_EOR))
390 msg_eor_close (socket);
391
392 _sock_sig_restore();
393 return (rc);
394}
395
396
397/*
398 * Setup remote_addr for SOCK_RAW/SOCK_DGRAM (connectionless) protocols.
399 * Must "reconnect" socket if 'remote_addr' or 'to' address are different.
400 * I.e we're sending to another host/port than last time.
401 */
402static int setup_udp_raw (Socket *socket, const struct sockaddr *to, int tolen)
403{
404 DWORD keepalive = socket->keepalive;
405 int rc;
406
407 /* For SOCK_DGRAM, udp_close() will be called when (re)opening socket.
408 */
409 SOCK_ENTER_SCOPE();
410 rc = connect (socket->fd, to, tolen);
411 SOCK_LEAVE_SCOPE();
412
413 if (rc < 0)
414 return (-1);
415
416 /* restore keepalive timer changed in connect()
417 */
418 socket->keepalive = keepalive;
419 return (1);
420}
421
422/*
423 * Check for enough room in Tx-buffer for a non-blocking socket
424 * to transmit without waiting. Only called for SOCK_DGRAM/SOCK_STREAM
425 * sockets.
426 *
427 * If '*len > room', modify '*len' on output to 'room' (the size of
428 * bytes left in Tx-buf).
429 */
430static __inline BOOL check_non_block_tx (Socket *socket, unsigned *len)
431{
432 sock_type *sk;
433 unsigned room;
434
435 if (socket->so_type == SOCK_DGRAM)
436 sk = (sock_type*) socket->udp_sock;
437 else sk = (sock_type*) socket->tcp_sock;
438
439 room = sock_tbleft (sk);
440 if (*len <= room)
441 return (TRUE); /* okay, enough room, '*len' unmodified */
442
443#if 0
444 WATT_YIELD(); /* a small delay to clear up things */
445 tcp_tick (sk);
446
447 room = sock_tbleft (sk);
448 if (*len <= room)
449 return (TRUE);
450#endif
451
452 /* Still no room, but cannot split up datagrams (only in IP-fragments)
453 */
454 if (socket->so_type == SOCK_DGRAM)
455 return (FALSE);
456
457 /* Stream: Tx room below (or equal) low-water mark is failure.
458 */
459 if (*len > 0 && room <= socket->send_lowat)
460 return (FALSE);
461
462 /* Streams may be split up, modify '*len'
463 */
464 *len = room;
465 return (TRUE);
466}
467
468/*
469 * TCP transmitter.
470 */
471static int tcp_transmit (Socket *socket, const void *buf, unsigned len,
472 int flags)
473{
474 sock_type *sk = (sock_type*)socket->tcp_sock;
475 int rc;
476
477 /* Don't timeout BSD sockets on inactivity (not sending)
478 */
479 sk->tcp.datatimer = 0;
480
481 tcp_tick (sk);
482 tcp_Retransmitter (TRUE);
483
486 if (sk->tcp.state < tcp_StateESTAB || sk->tcp.state >= tcp_StateLASTACK)
487 {
488 socket->so_state |= SS_CANTSENDMORE;
489 SOCK_DEBUGF ((", EPIPE"));
490 SOCK_ERRNO (EPIPE); /* !! was ENOTCONN */
491 return (-1);
492 }
493
494 if (socket->so_state & SS_NBIO)
495 {
496 unsigned in_len = len;
497
498 if (!check_non_block_tx(socket,&len))
499 {
500 SOCK_DEBUGF ((", EWOULDBLOCK"));
501 SOCK_ERRNO (EWOULDBLOCK);
502 return (-1);
503 }
504 if (in_len != len)
505 {
506 sk->tcp.sockmode |= SOCK_MODE_LOCAL; /* don't set push bit yet */
507 SOCK_DEBUGF ((" [%u]", len)); /* trace "len=x [y]" */
508 }
509 }
510
511 if ((flags & MSG_MORE) || (sk->tcp.locflags & LF_NOPUSH))
512 sk->tcp.sockmode |= SOCK_MODE_LOCAL;
513
514#if defined(USE_IPV6)
515 if (socket->so_family == AF_INET6)
516 {
517 struct sockaddr_in6 *ra = (struct sockaddr_in6*) socket->remote_addr;
518
519 SOCK_DEBUGF ((", %s (%d) / TCP",
520 _inet6_ntoa(&ra->sin6_addr),
521 ntohs(socket->remote_addr->sin_port)));
522 ARGSUSED (ra);
523 }
524 else
525#endif
526 SOCK_DEBUGF ((", %s (%d) / TCP",
527 inet_ntoa(socket->remote_addr->sin_addr),
528 ntohs(socket->remote_addr->sin_port)));
529
530#if 0
531 if (len > sizof(sk->tcp.max_tx_data) - 1)
532 {
533 unsigned total = len;
534 BYTE *buffer = (BYTE*)buf;
535
536 while (1)
537 {
538 if (sock_tbused(sk) == 0) /* Tx buffer empty */
539 {
540 unsigned bytes = min (sk->tcp.max_tx_data, total);
541
542 if (bytes > 0)
543 {
544 buffer += sock_enqueue (sk, buffer, bytes);
545 total -= bytes;
546 }
547 else
548 break;
549 }
550 if (!tcp_tick(sk))
551 break;
552 }
553 rc = buffer - (BYTE*)buf;
554 }
555 else
556#endif
557 rc = sock_write (sk, (const BYTE*)buf, len);
558
559 socket->keepalive = 0UL;
560
561 if (rc <= 0) /* error in tcp_write() */
562 {
563 if (socket->so_error != 0)
564 {
565 SOCK_DEBUGF ((", SO_ERROR: %s", short_strerror (socket->so_error)));
566 SOCK_ERRNO (socket->so_error);
567 socket->so_error = 0;
568 }
569 else if (sk->tcp.state != tcp_StateESTAB)
570 {
571 SOCK_DEBUGF ((", EPIPE"));
572 SOCK_ERRNO (EPIPE); /* !! was ENOTCONN */
573 }
574 else
575 {
576 SOCK_DEBUGF ((", ENETDOWN"));
577 SOCK_ERRNO (ENETDOWN);
578 }
579 return (-1);
580 }
581 ARGSUSED (flags);
582 return (rc);
583}
584
585
586/*
587 * UDP transmitter
588 */
589static int udp_transmit (Socket *socket, const void *buf, unsigned len)
590{
591 sock_type *sk = (sock_type*) socket->udp_sock;
592 BOOL is_ip6 = (socket->so_family == AF_INET6);
593 BOOL is_bcast, is_mcast;
594 unsigned tx_room;
595 int rc;
596 const void *dest;
597
598 if (!tcp_tick(sk))
599 {
600 socket->so_state |= SS_CANTSENDMORE;
601 SOCK_DEBUGF ((", EPIPE (can't send)"));
602 SOCK_ERRNO (EPIPE); /* !! was ENOTCONN */
603 return (-1);
604 }
605
606 tcp_Retransmitter (TRUE);
607
608 if ((socket->so_state & SS_NBIO) &&
609 !check_non_block_tx(socket,&len))
610 {
611 SOCK_DEBUGF ((", EWOULDBLOCK"));
612 SOCK_ERRNO (EWOULDBLOCK);
613 return (-1);
614 }
615
616#if defined(USE_IPV6)
617 if (is_ip6)
618 {
619 const struct sockaddr_in6 *ra = (const struct sockaddr_in6*)socket->remote_addr;
620
621 dest = &ra->sin6_addr.s6_addr[0];
622 is_bcast = IN6_IS_ADDR_MC_GLOBAL (dest);
623 is_mcast = IN6_IS_ADDR_MULTICAST (dest);
624
625 SOCK_DEBUGF ((", %s (%d) / UDP %s", _inet6_ntoa(dest),
626 ntohs(socket->remote_addr->sin_port),
627 is_mcast ? "(mcast)" : ""));
628 }
629 else
630#endif
631 {
632 dest = &socket->remote_addr->sin_addr.s_addr;
633 is_bcast = (*(DWORD*)dest == INADDR_BROADCAST ||
634 *(DWORD*)dest == INADDR_ANY);
635 is_mcast = IN_MULTICAST (ntohl(*(DWORD*)dest));
636
637 SOCK_DEBUGF ((", %s (%d) / UDP %s",
638 inet_ntoa(*(struct in_addr*)dest),
639 ntohs(socket->remote_addr->sin_port),
640 is_mcast ? "(mcast)" : ""));
641 }
642
643 if (len == 0) /* 0-byte probe packet */
644 return raw_transmit (socket, NULL, 0);
645
646 tx_room = sock_tbleft (sk); /* always MTU-28 */
647
648 /* Special tests for broadcast messages
649 */
650 if (is_bcast)
651 {
652 if (len > tx_room) /* no room, fragmented broadcasts not allowed */
653 {
654 SOCK_DEBUGF ((", EMSGSIZE"));
655 SOCK_ERRNO (EMSGSIZE);
656 goto drop;
657 }
658 if (_pktserial) /* Link-layer doesn't allow broadcast */
659 {
660 SOCK_DEBUGF ((", EADDRNOTAVAIL"));
661 SOCK_ERRNO (EADDRNOTAVAIL);
662 goto drop;
663 }
664 }
665
666 /* set new TTL if setsockopt() used before sending to Class-D socket
667 */
668 if (is_mcast)
669 udp_SetTTL (socket->udp_sock, socket->ip_ttl);
670
671#if defined(USE_FRAGMENTS)
672 if (len > USHRT_MAX - sizeof(udp_Header))
673 {
674 SOCK_DEBUGF ((", EMSGSIZE"));
675 SOCK_ERRNO (EMSGSIZE);
676 if (!is_ip6)
677 STAT (ip4stats.ips_toolong++);
678 return (-1);
679 }
680
681 if (!is_ip6 && len > tx_room)
682 return _IP4_SEND_FRAGMENTS (sk, UDP_PROTO, *(DWORD*)dest, buf, len);
683#endif
684
685 sk->udp.hisaddr = ntohl (socket->remote_addr->sin_addr.s_addr);
686 sk->udp.hisport = ntohs (socket->remote_addr->sin_port);
687
688 rc = sock_write (sk, (BYTE*)buf, len);
689
690 /* Patch hisaddr/hisport so that udp_demux() will handle further
691 * traffic as broadcast.
692 */
693 if (socket->so_state & SS_PRIV)
694 {
695 sk->udp.hisaddr = INADDR_BROADCAST;
696 sk->udp.hisport = IPPORT_ANY;
697 }
698
699 if (rc <= 0) /* error in udp_write() */
700 {
701 if (socket->so_error != 0)
702 {
703 SOCK_DEBUGF ((", SO_ERROR: %s", short_strerror (socket->so_error)));
704 SOCK_ERRNO (socket->so_error);
705 socket->so_error = 0;
706 }
707 else
708 {
709 SOCK_DEBUGF ((", ENETDOWN"));
710 SOCK_ERRNO (ENETDOWN);
711 }
712 return (-1);
713 }
714 return (rc);
715
716drop:
717 if (is_ip6)
718 STAT (ip6stats.ip6s_odropped++);
719 else STAT (ip4stats.ips_odropped++);
720 return (-1);
721}
722
729static int ip4_transmit (Socket *socket, const void *tx, unsigned len)
730{
731 eth_address eth;
732 u_long dest;
733 unsigned tx_len, tx_room;
734 sock_type *sk = (sock_type*) socket->raw_sock;
735 struct ip *ip = (struct ip*) tx;
736 const BYTE *buf = (const BYTE*) tx;
737 UINT h_len, o_len;
738
739 if (ip) /* NULL if called from udp_transmit() */
740 {
741 if ((socket->so_state & SS_NBIO) &&
742 sock_tbleft(sk) < (len + socket->send_lowat))
743 {
744 SOCK_DEBUGF ((", EWOULDBLOCK"));
745 SOCK_ERRNO (EWOULDBLOCK);
746 return (-1);
747 }
748 }
749
750 SOCK_DEBUGF ((", %s / Raw", inet_ntoa(socket->remote_addr->sin_addr)));
751
752 if (ip && (socket->inp_flags & INP_HDRINCL))
753 {
754 dest = ip->ip_dst.s_addr;
755 tx_len = len;
756 tx_room = _mtu;
757 }
758 else
759 {
760 dest = socket->remote_addr->sin_addr.s_addr;
761 tx_len = len + sizeof (*ip);
762 tx_room = _mtu + sizeof (*ip);
763 }
764
765 if (socket->ip_opt &&
766 socket->ip_opt->ip_dst.s_addr) /* using source routing */
767 dest = socket->ip_opt->ip_dst.s_addr;
768
769 if (!dest)
770 {
771 SOCK_DEBUGF ((", no dest"));
772 SOCK_ERRNO (EHOSTUNREACH);
773 STAT (ip4stats.ips_noroute++);
774 return (-1);
775 }
776
777 if (!_arp_resolve(ntohl(dest),&eth))
778 {
779 SOCK_DEBUGF ((", no route"));
780 SOCK_ERRNO (EHOSTUNREACH);
781 return (-1);
782 }
783
784 if (socket->inp_flags & INP_HDRINCL) /* IP-header included */
785 {
786 DWORD offset = ntohs (ip->ip_off);
787 WORD flags = (WORD) (offset & ~IP_OFFMASK);
788
789 offset = (offset & IP_OFFMASK) << 3; /* 0 <= ip_ofs <= 65536-8 */
790
791 if ((flags & IP_DF) && /* DF requested */
792 tx_len > tx_room) /* tx-size above MTU */
793 {
794 SOCK_DEBUGF ((", EMSGSIZE"));
795 SOCK_ERRNO (EMSGSIZE);
796 STAT (ip4stats.ips_toolong++);
797 return (-1);
798 }
799 }
800 else if (tx_len + socket->ip_opt_len > tx_room) /* tx-size above MTU */
801#if defined(USE_FRAGMENTS)
802 {
803 if (socket->ip_opt_len > 0)
804 ((void)0);
805 return _IP4_SEND_FRAGMENTS (sk, socket->so_proto, dest, buf, len);
806 }
807#else
808 {
809 SOCK_DEBUGF ((", EMSGSIZE"));
810 SOCK_ERRNO (EMSGSIZE);
811 STAT (ip4stats.ips_toolong++);
812 return (-1);
813 }
814#endif
815
816
817 /* "Normal" small (tx_len < MTU) IPv4 packets are sent below
818 */
819 ip = (struct ip*) _eth_formatpacket (&eth, IP4_TYPE);
820
821 if (socket->inp_flags & INP_HDRINCL) /* caller provided IP-header */
822 {
823 memcpy (ip, buf, len); /* SOCK_RAW can never have 0 length */
824 if (ip->ip_src.s_addr == 0)
825 {
826 ip->ip_src.s_addr = gethostid();
827 ip->ip_sum = 0;
828 ip->ip_sum = ~CHECKSUM ((void*)ip, ip->ip_hl << 2);
829 }
830 if (ip->ip_sum == 0) /* add header checksum if needed */
831 ip->ip_sum = ~CHECKSUM ((void*)ip, ip->ip_hl << 2);
832 }
833 else
834 {
835 if (socket->ip_opt && socket->ip_opt_len > 0)
836 {
837 BYTE *data;
838
839 o_len = min (socket->ip_opt_len, sizeof(socket->ip_opt->IP_opts));
840 h_len = sizeof(*ip) + o_len;
841 data = (BYTE*)ip + h_len;
842 memcpy (ip+1, &socket->ip_opt->IP_opts[0], o_len);
843 if (buf && len > 0)
844 memcpy (data, buf, len);
845 tx_len += o_len;
846 }
847 else
848 {
849 if (buf && len > 0)
850 memcpy (ip+1, buf, len);
851 h_len = sizeof (*ip);
852 }
853
854 ip->ip_v = IPVERSION;
855 ip->ip_hl = h_len >> 2;
856 ip->ip_tos = socket->ip_tos;
857 ip->ip_len = htons (tx_len);
858 ip->ip_id = _get_ip4_id();
859 ip->ip_off = 0;
860 ip->ip_ttl = socket->ip_ttl;
861 ip->ip_p = socket->so_proto;
862
863 ip->ip_src.s_addr = gethostid();
864 ip->ip_dst.s_addr = dest;
865
866 ip->ip_sum = 0;
867 ip->ip_sum = ~CHECKSUM (ip, h_len);
868 }
869
870 if (!_eth_send (tx_len, NULL, __FILE__, __LINE__))
871 {
872 SOCK_DEBUGF ((", ENETDOWN"));
873 SOCK_ERRNO (ENETDOWN);
874 return (-1);
875 }
876 return (len);
877}
878
879#if defined(USE_IPV6)
886static int ip6_transmit (Socket *socket, const void *tx, unsigned len)
887{
888 eth_address eth;
889 ip6_address dest;
890 unsigned tx_len, tx_room;
891
892 sock_type *sk = (sock_type*) socket->raw_sock;
893 struct in6_Header *ip6 = (struct in6_Header*) tx;
894 struct sockaddr_in6 *ra = (struct sockaddr_in6*) socket->remote_addr;
895 const BYTE *buf = (const BYTE*) tx;
896
897 if ((socket->so_state & SS_NBIO) &&
898 sock_tbleft(sk) < (len + socket->send_lowat))
899 {
900 SOCK_DEBUGF ((", EWOULDBLOCK"));
901 SOCK_ERRNO (EWOULDBLOCK);
902 return (-1);
903 }
904
905 SOCK_DEBUGF ((", %s / Raw", _inet6_ntoa(&ra->sin6_addr)));
906
907 if (ip6 && (socket->inp_flags & INP_HDRINCL))
908 {
909 memcpy (dest, &ip6->destination[0], sizeof(dest));
910 tx_len = len;
911 tx_room = _mtu;
912 }
913 else
914 {
915 memcpy (dest, &ra->sin6_addr, sizeof(dest));
916 tx_len = len + sizeof (*ip6);
917 tx_room = _mtu + sizeof (*ip6);
918 }
919
920 if (IN6_IS_ADDR_UNSPECIFIED(&dest) || !icmp6_neigh_solic(&dest,&eth))
921 {
922 SOCK_DEBUGF ((", no route"));
923 SOCK_ERRNO (EHOSTUNREACH);
924 STAT (ip6stats.ip6s_noroute++);
925 return (-1);
926 }
927
928 if (!(socket->inp_flags & INP_HDRINCL) &&
929 tx_len + socket->ip_opt_len > tx_room)
930 {
931 SOCK_DEBUGF ((", EMSGSIZE"));
932 SOCK_ERRNO (EMSGSIZE);
933 STAT (ip6stats.ip6s_odropped++);
934 return (-1);
935 }
936
937 ip6 = (struct in6_Header*) _eth_formatpacket (&eth, IP6_TYPE);
938
939 if (socket->inp_flags & INP_HDRINCL)
940 {
941 if (buf && len > 0)
942 memcpy (ip6, buf, len);
943 if (IN6_IS_ADDR_UNSPECIFIED(&ip6->source))
944 memcpy (&ip6->source[0], _gethostid6(), sizeof(ip6->source));
945 }
946 else
947 {
948#if 0 /* option header not yet supported */
949 if (socket->ip_opt && socket->ip_opt_len > 0)
950 {
951 BYTE *data;
952 int h_len;
953
954 o_len = min (socket->ip_opt_len, sizeof(socket->ip_opt->ip_opts));
955 h_len = sizeof(*ip) + o_len;
956 data = (BYTE*)ip + h_len;
957 memcpy (ip+1, &socket->ip_opt->ip_opts, o_len);
958 if (buf && len > 0)
959 memcpy (data, buf, len);
960 tx_len += o_len;
961 if (socket->ip_opt->ip_dst.s_addr) /* using source routing */
962 dest = socket->ip_opt->ip_dst.s_addr;
963 }
964 else
965#endif
966 {
967 if (buf && len > 0)
968 memcpy (ip6+1, buf, len);
969 }
970 ip6->pri = 0;
971 ip6->ver = 6;
972 ip6->len = htons (len);
973 ip6->next_hdr = socket->so_proto;
974 ip6->hop_limit = _default_ttl;
975
976 memset (&ip6->flow_lbl[0], 0, sizeof(ip6->flow_lbl));
977 memcpy (&ip6->source[0], _gethostid6(), sizeof(ip6->source));
978 memcpy (&ip6->destination[0], dest, sizeof(ip6->destination));
979 }
980
981 if (!_eth_send (tx_len, NULL, __FILE__, __LINE__))
982 {
983 SOCK_DEBUGF ((", ENETDOWN"));
984 SOCK_ERRNO (ENETDOWN);
985 return (-1);
986 }
987 return (len);
988}
989#endif /* USE_IPV6 */
990
991
992static int raw_transmit (Socket *socket, const void *buf, unsigned len)
993{
994#if 0
995 SOCK_ENTER_SCOPE();
996 tcp_tick (NULL); /* process other TCBs too */
997 tcp_Retransmitter (TRUE);
998 SOCK_LEAVE_SCOPE();
999#endif
1000
1001#if defined(USE_IPV6)
1002 if (socket->so_family == AF_INET6)
1003 return ip6_transmit (socket, buf, len);
1004#endif
1005
1006 if (socket->so_family == AF_INET)
1007 return ip4_transmit (socket, buf, len);
1008
1009 SOCK_DEBUGF ((", EAFNOSUPPORT "));
1010 SOCK_ERRNO (EAFNOSUPPORT );
1011 return (-1);
1012}
1013#endif /* USE_BSD_API */
_gethostid6
const void * _gethostid6(void)
Core-style: Returns local IPv6-address.
Definition: bsdname.c:91
gethostid
XHOSTID_RETV W32_CALL gethostid(void)
BSD style: returns local IPv4-address.
Definition: bsdname.c:68
_default_ttl
int _default_ttl
Definition: ip4_out.c:54
_get_ip4_id
WORD _get_ip4_id(void)
Increment IPv4-identifier before returning it.
Definition: ip4_out.c:65
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
_arp_resolve
BOOL W32_CALL _arp_resolve(DWORD ip, eth_address *eth)
The blocking lookup function visible to higher functions.
Definition: pcarp.c:1278
icmp6_neigh_solic
int icmp6_neigh_solic(const void *addr, eth_address *eth)
Definition: pcicmp6.c:177
pcicmp6.h
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
_eth_send
int W32_CALL _eth_send(WORD len, const void *sock, const char *file, unsigned line)
_eth_send() does the actual transmission once we are complete with filling the buffer.
Definition: pcsed.c:301
_eth_formatpacket
void *W32_CALL _eth_formatpacket(const void *mac_dest, WORD eth_type)
_eth_format_packet() places the next packet to be transmitted into the above link-layer output packet...
Definition: pcsed.c:134
tcp_Retransmitter
void tcp_Retransmitter(BOOL force)
Called periodically to perform retransmissions.
Definition: pctcp.c:1218
udp_SetTTL
int W32_CALL udp_SetTTL(_udp_Socket *s, BYTE ttl)
Set the TTL on an outgoing UDP datagram.
Definition: pctcp.c:309
_socklist_find
Socket * _socklist_find(int s)
Returns a pointer to the Socket structure associated with socket 's'.
Definition: socket.c:1473
_sock_pending_connect
BOOL _sock_pending_connect(Socket *socket)
Check progress on a non-blocking SOCK_STREAM socket that has SS_ISCONNECTING set.
Definition: socket.c:2186
_sock_dos_fd
BOOL _sock_dos_fd(int s)
_sock_dos_fd - Return TRUE if ‘s’ is a valid DOS/Win32 handle.
Definition: socket.c:202
Socket
Definition: socket.h:158
in6_Header
Definition: wattcp.h:381
in_addr
Definition: in.h:143
iovec
Definition: wtypes.h:222
msghdr
Definition: socket.h:258
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
sockaddr_ll
Definition: if_packe.h:16
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
tcp_Socket::datatimer
DWORD datatimer
inactive timer (no Tx data)
Definition: wattcp.h:644
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
tcp_Socket::max_tx_data
UINT max_tx_data
Last index for tx_data[].
Definition: wattcp.h:653
udp_Header
Definition: wattcp.h:406
ip6_transmit
static int ip6_transmit(Socket *socket, const void *tx, unsigned len)
Raw IPv6 transmitter.
Definition: transmit.c:886
tcp_transmit
static int tcp_transmit(Socket *socket, const void *buf, unsigned len, int flags)
Definition: transmit.c:471
ip4_transmit
static int ip4_transmit(Socket *socket, const void *tx, unsigned len)
Raw IPv4 transmitter.
Definition: transmit.c:729
sock_type
Definition: wattcp.h:692


Watt-32 tcp/ip: E:/WATT/inc/rpc/types.h Source File

  • inc
  • rpc
types.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * RPC additions to <sys/wtypes.h>
36 */
37#ifndef __RPC_TYPES_H
38#define __RPC_TYPES_H
39
40#define bool_t int
41#define enum_t int
42
43#ifndef FALSE
44#define FALSE (0)
45#endif
46
47#ifndef TRUE
48#define TRUE (1)
49#endif
50
51#define mem_alloc(bsize) malloc (bsize)
52#define mem_free(ptr, bsize) free (ptr)
53
54#include <sys/wtypes.h>
55#include <sys/wtime.h>
56#include <netinet/in.h>
57
58#ifndef INADDR_LOOPBACK
59#define INADDR_LOOPBACK (u_long)0x7F000001
60#endif
61
62#ifndef MAXHOSTNAMELEN
63#define MAXHOSTNAMELEN 64
64#endif
65
66#endif
in.h
wtime.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/netinet6/udp6_var.h Source File

  • inc
  • netinet6
udp6_var.h
Go to the documentation of this file.
1
5/*
6 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34/*
35 * Copyright (c) 1982, 1986, 1989, 1993
36 * The Regents of the University of California. All rights reserved.
37 *
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
41 * 1. Redistributions of source code must retain the above copyright
42 * notice, this list of conditions and the following disclaimer.
43 * 2. Redistributions in binary form must reproduce the above copyright
44 * notice, this list of conditions and the following disclaimer in the
45 * documentation and/or other materials provided with the distribution.
46 * 3. All advertising materials mentioning features or use of this software
47 * must display the following acknowledgement:
48 * This product includes software developed by the University of
49 * California, Berkeley and its contributors.
50 * 4. Neither the name of the University nor the names of its contributors
51 * may be used to endorse or promote products derived from this software
52 * without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
55 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE.
65 */
66
67#ifndef _NETINET6_UDP6_VAR_H_
68#define _NETINET6_UDP6_VAR_H_
69
70#ifdef _KERNEL
71SYSCTL_DECL(_net_inet6_udp6);
72
73extern struct pr_usrreqs udp6_usrreqs;
74
75void udp6_ctlinput (int, struct sockaddr *, void *);
76int udp6_input (struct mbuf **, int *, int);
77int udp6_output (struct inpcb *inp, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct thread *td);
78#endif
79
80#endif /*_NETINET6_UDP6_VAR_H_ */
inpcb
Definition: in_pcb.h:61
mbuf
Definition: mbuf.h:6
sockaddr
Definition: socket.h:181


Watt-32 tcp/ip: E:/WATT/inc/netinet/udp.h Source File

  • inc
  • netinet
udp.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef _NETINET_UDP_H_
39#define _NETINET_UDP_H_
40
41#include <sys/wtypes.h>
42
43/*
44 * Udp protocol header.
45 * Per RFC 768, September, 1981.
46 */
47struct udphdr {
48 u_short uh_sport; /* source port */
49 u_short uh_dport; /* destination port */
50 u_short uh_ulen; /* udp length */
51 u_short uh_sum; /* udp checksum */
52};
53
54#endif
udphdr
Definition: udp.h:47
wtypes.h


Watt-32 tcp/ip: E:/WATT/src/udp_rev.c Source File

  • src
udp_rev.c
Go to the documentation of this file.
1
5/*
6 * Reverse IPv4/IPv6 lookup functions
7 *
8 * Copyright (c) 1997-2002 Gisle Vanem <gvanem@yahoo.no>
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Gisle Vanem
21 * Bergen, Norway.
22 *
23 * THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS''
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 * \version 0.2
35 */
36
37#include <stdio.h>
38#include <stdlib.h>
39#include <string.h>
40
41#include "wattcp.h"
42#include "misc.h"
43#include "misc_str.h"
44#include "timer.h"
45#include "language.h"
46#include "netaddr.h"
47#include "pctcp.h"
48#include "pcdbug.h"
49#include "pcconfig.h"
50#include "idna.h"
51#include "bsdname.h"
52#include "pcdns.h"
53
54static BOOL read_response (sock_type *s, char *name, size_t size);
55static BYTE *dns_labels (BYTE *bp, BYTE *p, BYTE *ep, char *result);
56static BYTE *dns_resource (WORD req_qtype, BYTE *bp, BYTE *p,
57 BYTE *ep, char *result);
58
63static size_t query_init_ip4 (struct DNS_query *q, DWORD ip)
64{
65 char *c;
66 BYTE i, x;
67
68 q->head.ident = set_timeout (0UL) & 0xFFFF; /* Random ID */
69 q->head.flags = intel16 (DRD); /* Query, Recursion desired */
70 q->head.qdcount = intel16 (1);
71 q->head.ancount = 0;
72 q->head.nscount = 0;
73 q->head.arcount = 0;
74
75 c = (char*) &q->body[0];
76 ip = ntohl (ip);
77 for (i = 0; i < sizeof(ip); i++)
78 {
79 x = ip & 255;
80 ip >>= 8;
81 *c = (x < 10) ? 1 : (x < 100) ? 2 : 3;
82 itoa (x, c+1, 10);
83 c += *c + 1;
84 }
85 strcpy (c, "\7in-addr\4arpa");
86 c += 14;
87 *(WORD*) c = intel16 (DTYPE_PTR);
88 c += sizeof(WORD);
89 *(WORD*) c = intel16 (DIN);
90 c += sizeof(WORD);
91
92 return (c - (char*)q);
93}
94
95
100static BOOL reverse_lookup (const struct DNS_query *q, size_t qlen,
101 char *name, size_t size, DWORD nameserver)
102{
103 BOOL ret;
104 BOOL ready = FALSE;
105 BOOL quit = FALSE;
106 WORD sec;
107 DWORD timer;
108 _udp_Socket dom_sock;
109 sock_type *sock = NULL;
110
111 if (!nameserver) /* no nameserver, give up */
112 {
113 dom_errno = DNS_CLI_NOSERV;
114 outsnl (dom_strerror(dom_errno));
115 return (FALSE);
116 }
117
118 if (!udp_open(&dom_sock, DOM_SRC_PORT, nameserver, DOM_DST_PORT, NULL))
119 {
120 dom_errno = DNS_CLI_SYSTEM;
121 return (FALSE);
122 }
123
124 timer = set_timeout (1000 * dns_timeout); /* overall expiry (for all servers) */
125
126 for (sec = 2; sec < dns_timeout-1 && !quit && !_resolve_exit; sec *= 2)
127 {
128 sock = (sock_type*)&dom_sock;
129 sock_write (sock, (const BYTE*)q, qlen);
130 ip_timer_init (sock, sec); /* per server expiry */
131
132 do
133 {
134 tcp_tick (sock);
135
136 if (_watt_cbroke || (_resolve_hook && (*_resolve_hook)() == 0))
137 {
138 _resolve_exit = 1; /* terminate do_reverse_resolve() */
139 dom_errno = DNS_CLI_USERQUIT;
140 quit = TRUE;
141 ready = FALSE;
142 break;
143 }
144 if (sock_dataready(sock))
145 {
146 quit = TRUE;
147 ready = TRUE;
148 }
149 else if (ip_timer_expired(sock) || chk_timeout(timer))
150 {
151 dom_errno = DNS_CLI_TIMEOUT;
152 ready = FALSE;
153 _resolve_timeout = 1;
154 break; /* retry */
155 }
156 if (sock->udp.usr_yield)
157 (*sock->udp.usr_yield)();
158 else WATT_YIELD();
159 }
160 while (!quit);
161 }
162
163 if (ready && sock)
164 ret = read_response (sock, name, size);
165 else ret = FALSE;
166
167 if (sock) /* if we ran the above for-loop */
168 sock_close (sock);
169 return (ret);
170}
171
176int reverse_lookup_myip (void)
177{
178 char name [MAX_HOSTLEN];
179
180 if (!reverse_resolve_ip4(htonl(my_ip_addr),name,sizeof(name)))
181 return (0);
182
183 if (debug_on >= 1)
184 {
185 outs (_LANG("My FQDN: "));
186 outsnl (name);
187 }
188 if (sethostname(name,sizeof(name)) < 0)
189 return (0);
190 return (1);
191}
192
193/*------------------------------------------------------------------*/
194
195static int do_reverse_resolve (const struct DNS_query *q, size_t qlen,
196 char *result, size_t size)
197{
198 WORD brk_mode;
199 int i;
200
201 if (dns_timeout == 0)
202 dns_timeout = (UINT)sock_delay << 2;
203
204 NEW_BREAK_MODE (brk_mode, 1);
205
206 _resolve_exit = _resolve_timeout = 0;
207
208 *result = '\0';
209 dom_cname[0] = '\0';
210
211 for (i = 0; i < last_nameserver; ++i)
212 if (reverse_lookup(q,qlen,result,size,def_nameservers[i]) ||
213 _resolve_exit)
214 break;
215
216 OLD_BREAK_MODE (brk_mode);
217 return (*result != '\0');
218}
219
220/*------------------------------------------------------------------*/
221
222int reverse_resolve_ip4 (DWORD ip, char *result, size_t size)
223{
224 struct DNS_query q;
225 size_t len = query_init_ip4 (&q, ip);
226
227 memset (&dom_a4list, 0, sizeof(dom_a4list));
228
229#if defined(WIN32)
230 if (WinDnsQuery_PTR4(ip, result, size))
231 return (1);
232#endif
233 return do_reverse_resolve (&q, len, result, size);
234}
235
236#if defined(USE_IPV6)
237
238#define USE_IP6_BITSTRING 0 /* RFC-2673 */
239
245static size_t query_init_ip6 (struct DNS_query *q, const void *addr)
246{
247 const BYTE *ip = (const BYTE*) addr;
248 char *c;
249 int i;
250
251 q->head.ident = set_timeout (0UL) & 0xFFFF; /* Random ID */
252 q->head.flags = intel16 (DRD); /* Query, Recursion desired */
253 q->head.qdcount = intel16 (1); /* 1 query */
254 q->head.ancount = 0;
255 q->head.nscount = 0;
256 q->head.arcount = 0;
257
258 c = (char*) &q->body[0];
259
260#if USE_IP6_BITSTRING
261 strcpy (c, "\3\\[x");
262 c += 4;
263 for (i = 0; i < SIZEOF(ip6_address); i++)
264 {
265 int hi = ip[i] >> 4;
266 int lo = ip[i] & 15;
267
268 if (i == SIZEOF(ip6_address) - 1)
269 *c++ = 5;
270 else *c++ = 4;
271 *c++ = hex_chars_lower [hi];
272 *c++ = hex_chars_lower [lo];
273 }
274 strcpy (c, "]\3ip6\4arpa");
275 c += 11;
276
277#else
278 for (i = sizeof(ip6_address)-1; i >= 0; i--)
279 {
280 int hi = ip[i] >> 4;
281 int lo = ip[i] & 15;
282
283 *c++ = 2;
284 *c++ = hex_chars_lower [hi];
285 *c++ = hex_chars_lower [lo];
286 }
287 strcpy (c, "\3ip6\4arpa");
288 c += 10;
289#endif
290
291 *(WORD*) c = intel16 (DTYPE_PTR);
292 c += sizeof(WORD);
293 *(WORD*) c = intel16 (DIN);
294 c += sizeof(WORD);
295
296 return (c - (char*)q);
297}
298
299int reverse_resolve_ip6 (const void *addr, char *result, size_t size)
300{
301 struct DNS_query q;
302 size_t len = query_init_ip6 (&q, addr);
303
304 memset (&dom_a6list, 0, sizeof(dom_a6list));
305
306#if defined(WIN32)
307 if (WinDnsQuery_PTR6(addr, result, size))
308 return (1);
309#endif
310 return do_reverse_resolve (&q, len, result, size);
311}
312#endif /* USE_IPV6 */
313
314
315static BOOL read_response (sock_type *s, char *name, size_t size)
316{
317 struct {
318 struct DNS_Header head;
319 BYTE body [DOMSIZE];
320 } response;
321
322 struct DNS_Header *dns = &response.head;
323 int len, num_q, num_ans;
324 BYTE *bp, *body, *end_p;
325 char result [DOMSIZE];
326
327 #define CHECK_SHORT(p) if ((p) > len+(BYTE*)&response) goto short_resp
328
329 memset (&response, 0, sizeof(response));
330 len = sock_fastread (s, (BYTE*)&response, sizeof(response));
331 bp = (BYTE*) &response;
332 body = (BYTE*) &response.body;
333 end_p = (BYTE*) &response + len;
334
335 CHECK_SHORT (body);
336
337 num_q = intel16 (dns->dns_num_q);
338 num_ans = intel16 (dns->dns_num_ans);
339 if (dns->dns_fl_rcode != DNS_SRV_OK || num_ans == 0)
340 goto no_name;
341
342 /* Go past the question part of the packet.
343 */
344 while (num_q > 0)
345 {
346 body = dns_labels (bp, body, end_p, result);
347 CHECK_SHORT (body);
348 body += 4; /* skip Qtype and Qclass */
349 num_q--;
350 }
351
352 /* Parse the resource records for the answers
353 */
354 while (num_ans > 0)
355 {
356 memset (&result, '\0', sizeof(result));
357 body = dns_resource (DTYPE_PTR, bp, body, end_p, result);
358 CHECK_SHORT (body);
359 num_ans--;
360 if (result[0])
361 {
362#if defined(USE_IDNA)
363 if (dns_do_idna && !IDNA_convert_from_ACE(result,&size))
364 {
365 dom_errno = DNS_CLI_ILL_IDNA;
366 return (FALSE);
367 }
368#endif
369 dom_errno = DNS_SRV_OK;
370 _strlcpy (name, dom_remove_dot(result), size);
371 return (TRUE);
372 }
373 }
374
375no_name:
376 dom_errno = dns->dns_fl_rcode;
377 return (FALSE);
378
379short_resp:
380 dom_errno = DNS_CLI_ILL_RESP;
381 return (FALSE);
382}
383
384/*
385 * Recursively parse a label entry in a DNS packet
386 * 'bp' points to a beginning of DNS header.
387 * 'p' points to a DNS label.
388 */
389static BYTE *dns_labels (BYTE *bp, BYTE *p, BYTE *ep, char *result)
390{
391 while (1)
392 {
393 BYTE count = *p++;
394 WORD offset;
395
396 if (count >= 0xC0)
397 {
398 /* There's a pointer (rel to 'bp' start) in this label.
399 * Let's grab the 14 low-order bits and run with them.
400 */
401 count -= 0xC0;
402 offset = (WORD) (((unsigned)(count) << 8) + *p++);
403
404 dns_labels (bp, bp+offset, ep, result);
405 return (p);
406 }
407 if (count == 0)
408 break;
409
410 while (count > 0)
411 {
412 if (p <= ep)
413 {
414 *result++ = *p++;
415 count--;
416 }
417 else
418 return (p); /* Packet length exceeded */
419 }
420 *result++ = '.';
421 *result = '\0'; /* 0-terminate incase this is the last label */
422 }
423 return (p);
424}
425
426/*
427 * Return the given resource record.
428 */
429static BYTE *dns_resource (WORD req_qtype, BYTE *bp, BYTE *p, BYTE *ep, char *result)
430{
431 DWORD ttl;
432 WORD qtype, qclass, reslen;
433 char dummy [DOMSIZE];
434
435 p = dns_labels (bp, p, ep, dummy);
436
437 /* Do query type, class, ttl and resource length
438 */
439 qtype = intel16 (*(WORD*)p); p += sizeof(qtype);
440 qclass = intel16 (*(WORD*)p); p += sizeof(qclass);
441 ttl = intel (*(DWORD*)p); p += sizeof(ttl);
442 reslen = intel16 (*(WORD*)p); p += sizeof(reslen);
443
444 /* Do resource data.
445 */
446 if (qclass == DIN && qtype == req_qtype)
447 {
448 p = dns_labels (bp, p, ep, result);
449 dom_ttl = ttl;
450 }
451 else
452 p += reslen;
453
454 return (p);
455}
456
sethostname
int W32_CALL sethostname(const char *fqdn, SETHOSTNAME_ARG2 len)
BSD-style: Expects a "Fully Qualified Domain Name" in ‘fqdn’.
Definition: bsdname.c:292
bsdname.h
idna.h
language.h
misc.h
_watt_cbroke
volatile int _watt_cbroke
Definition: pc_cbrk.c:48
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
netaddr.h
pcconfig.h
pcdbug.h
dom_strerror
const char *W32_CALL dom_strerror(int err)
Return text for error code (dom_errno).
Definition: pcdns.c:742
read_response
static int read_response(const struct DNS_query *q, int len, WORD qtype, void *addr)
Extract the IPv4/v6 address from a response message (A or AAAA record).
Definition: pcdns.c:365
pcdns.h
my_ip_addr
DWORD my_ip_addr
our IP address
Definition: pctcp.c:69
udp_open
int W32_CALL udp_open(_udp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler)
UDP active open.
Definition: pctcp.c:262
pctcp.h
sock_dataready
WORD W32_CALL sock_dataready(sock_type *s)
sock_dataready - returns number of bytes waiting to be read.
Definition: sock_io.c:246
DNS_Header
Another definition of 'struct DNS_head'.
Definition: pcdns.h:96
DNS_query
Definition: pcdns.h:187
set_timeout
DWORD W32_CALL set_timeout(DWORD msec)
Return time for when given timeout (msec) expires.
Definition: timer.c:501
chk_timeout
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:545
timer.h
query_init_ip6
static size_t query_init_ip6(struct DNS_query *q, const void *addr)
Fill in the reverse lookup question packet.
Definition: udp_rev.c:245
reverse_lookup
static BOOL reverse_lookup(const struct DNS_query *q, size_t qlen, char *name, size_t size, DWORD nameserver)
Translate an IPv4/IPv6 address into a host name.
Definition: udp_rev.c:100
reverse_lookup_myip
int reverse_lookup_myip(void)
Do a reverse lookup on ‘my_ip_addr’.
Definition: udp_rev.c:176
query_init_ip4
static size_t query_init_ip4(struct DNS_query *q, DWORD ip)
Fill in the reverse lookup question packet.
Definition: udp_rev.c:63
sock_type
Definition: wattcp.h:692
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/inc/netinet/udp_var.h Source File

  • inc
  • netinet
udp_var.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1982, 1986, 1989, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#ifndef __NETINET_UDP_VAR_H
39#define __NETINET_UDP_VAR_H
40
41#include <sys/wtypes.h>
42
43/*
44 * UDP kernel structures and variables.
45 */
46#ifdef NOT_NEEDED
47 W32_CLANG_PACK_WARN_OFF()
48
49 #include <sys/pack_on.h>
50
51 struct udpiphdr {
52 struct ipovly ui_i; /* overlaid ip structure */
53 struct udphdr ui_u; /* udp header */
54 };
55
56 #include <sys/pack_off.h>
57
58 W32_CLANG_PACK_WARN_DEF()
59
60 #define ui_next ui_i.ih_next
61 #define ui_prev ui_i.ih_prev
62 #define ui_x1 ui_i.ih_x1
63 #define ui_pr ui_i.ih_pr
64 #define ui_len ui_i.ih_len
65 #define ui_src ui_i.ih_src
66 #define ui_dst ui_i.ih_dst
67 #define ui_sport ui_u.uh_sport
68 #define ui_dport ui_u.uh_dport
69 #define ui_ulen ui_u.uh_ulen
70 #define ui_sum ui_u.uh_sum
71#endif
72
73struct udpstat {
74 /* input statistics: */
75 u_long udps_ipackets; /* total input packets */
76 u_long udps_hdrops; /* packet shorter than header */
77 u_long udps_badsum; /* checksum error */
78 u_long udps_badlen; /* data length larger than packet */
79 u_long udps_noport; /* no socket on port */
80 u_long udps_noportbcast; /* of above, arrived as broadcast */
81 u_long udps_fullsock; /* not delivered, input socket full */
82 u_long udpps_pcbcachemiss; /* input packets missing pcb cache */
83 u_long udpps_pcbhashmiss; /* input packets not for hashed pcb */
84 /* output statistics: */
85 u_long udps_opackets; /* total output packets */
86};
87
88/*
89 * Names for UDP sysctl objects
90 */
91#define UDPCTL_CHECKSUM 1 /* checksum UDP packets */
92#define UDPCTL_STATS 2 /* statistics (read-only) */
93#define UDPCTL_MAXDGRAM 3 /* max datagram size */
94#define UDPCTL_RECVSPACE 4 /* default receive buffer space */
95#define UDPCTL_MAXID 5
96
97#define UDPCTL_NAMES { \
98 { 0, 0 }, \
99 { "checksum", CTLTYPE_INT }, \
100 { "stats", CTLTYPE_STRUCT }, \
101 { "maxdgram", CTLTYPE_INT }, \
102 { "recvspace", CTLTYPE_INT }, \
103}
104
105#endif
pack_off.h
udphdr
Definition: udp.h:47
W32_CLANG_PACK_WARN_DEF
W32_CLANG_PACK_WARN_DEF() struct udpstat
This hook is to prevent the BSD-socket API being linked in by default.
Definition: udp_var.h:58
wtypes.h


Watt-32 tcp/ip: E:/WATT/inc/sys/uio.h Source File

  • inc
  • sys
uio.h
Go to the documentation of this file.
1
5#ifndef __SYS_UIO_H
6#define __SYS_UIO_H
7
8/* This dummy header is required while building e.g. tcpdump
9 */
10
11#endif
12
13#if defined(__DJGPP__)
14 #include_next <sys/uio.h>
15#endif


Watt-32 tcp/ip: E:/WATT/inc/sys/un.h Source File

  • inc
  • sys
un.h
Go to the documentation of this file.
1
8#ifndef __SYS_UN_H
9#define __SYS_UN_H
10
11#include <string.h> /* for strlen */
12
13#ifndef __SYS_SOCKET_H
14#include <sys/socket.h> /* for sa_family_t */
15#endif
16
17/* POSIX requires only at least 100 bytes
18 */
19#ifndef UNIX_PATH_MAX
20#define UNIX_PATH_MAX 108
21#endif
22
23struct sockaddr_un {
24 sa_family_t sun_family; /* address family AF_LOCAL/AF_UNIX */
25 char sun_path [UNIX_PATH_MAX]; /* room for socket address */
26 };
27
28/* Evaluates the actual length of "sockaddr_un" structure.
29 */
30#define SUN_LEN(p) ( (size_t) (((struct sockaddr_un*) NULL)->sun_path) + strlen((p)->sun_path) )
31
32#endif
socket.h
sockaddr_un
Definition: un.h:23


Watt-32 tcp/ip: E:/WATT/src/version.c Source File

  • src
version.c
Go to the documentation of this file.
1
5#include <stdio.h>
6#include <string.h>
7
8#ifdef __CYGWIN__
9#include <cygwin/version.h>
10#endif
11
12#include "wattcp.h"
13#include "wdpmi.h"
14#include "misc.h"
15#include "misc_str.h"
16
17#if defined(_WIN32) /* This includes '_WIN64' too */
18 #if defined(_DEBUG)
19 #define DBG_RELEASE "debug" /* MSVC / clang-cl only */
20 #else
21 #define DBG_RELEASE "release"
22 #endif
23#endif
24
25#if defined(_WIN64)
26 #define VARIANT " Win64"
27
28#elif defined(_WIN32) || defined(WIN32)
29 #define VARIANT " Win32"
30
31#else
32 #define VARIANT ""
33#endif
34
35#undef CC_DEFINE
36#undef CFLAGS
37#undef CFLAGS_BUF
38
39const char *wattcpCopyright = "See COPYRIGHT.H for details";
40
41#if defined(__GNUC__)
42 const char *gcc_get_cpu_tune (void);
43
44#elif defined(_MSC_VER) && (_MSC_VER >= 1000) /* Visual-C 4+ */
45 static const char *msvc_check_fastcall (void);
46 static const char *msvc_get_patch_build (void);
47#endif
48
49/*
50 * Only possible with '__clang__' or '_MSC_VER >= 1839'?
51 * (some Visual Studio 2022 version)
52 */
53#if defined(USE_ASAN)
54 #define ASAN_COMPILED ", ASAN"
55#else
56 #define ASAN_COMPILED ""
57#endif
58
59#if defined(USE_UBSAN)
60 #define UBSAN_COMPILED ", UBSAN"
61#else
62 #define UBSAN_COMPILED ""
63#endif
64
65
77const char * W32_CALL wattcpVersion (void)
78{
79 static char buf[100];
80 char *p = buf;
81
82#if defined(WATTCP_DEVEL_REL) && (WATTCP_DEVEL_REL > 0)
83 p += sprintf (p, "Watt-32 (%d.%d.%d",
84 WATTCP_MAJOR_VER, WATTCP_MINOR_VER, WATTCP_DEVEL_REL);
85#else
86 p += sprintf (p, "Watt-32 (%d.%d",
87 WATTCP_MAJOR_VER, WATTCP_MINOR_VER);
88#endif
89
90 p += sprintf (p, "%s), ", VARIANT);
91
92#if defined(__GNUC__)
93 p += sprintf (p, "GNU-C %d.%d", __GNUC__, __GNUC_MINOR__);
94
95 #if defined(__GNUC_PATCHLEVEL__) && (__GNUC_PATCHLEVEL__ > 0)
96 p += sprintf (p, ".%d", __GNUC_PATCHLEVEL__);
97 #endif
98
99 strcpy (p, gcc_get_cpu_tune());
100
101#elif defined(__HIGHC__)
102 p += sprintf (p, "Metaware High-C, "); /* no way to get version */
103
104#elif defined(__POCC__)
105 p += sprintf (p, "PellesC %d.%d, ", __POCC__/100, __POCC__ % 100);
106
107#elif defined(__WATCOMC__)
108 #if (__WATCOMC__ >= 1200)
109 p += sprintf (p, "OpenWatcom %d.%d",
110 (__WATCOMC__/100) - 11, (__WATCOMC__ % 100) / 10);
111 #else
112 p += sprintf (p, "Watcom C %d.%d", __WATCOMC__/100, __WATCOMC__ % 100);
113 #endif
114
115 #if !defined(__FLAT__)
116 #if defined(__I86__)
117 strcpy (p, " (16-bit");
118 #else
119 strcpy (p, " (32-bit");
120 #endif
121 p += 8;
122 #if defined(__SMALL__)
123 strcpy (p, " small model),");
124 p += 14;
125 #elif defined(__LARGE__)
126 strcpy (p, " large model),");
127 p += 14;
128 #else
129 strcpy (p, "),");
130 p += 2;
131 #endif
132 #endif
133 #if (_M_IX86 >= 600) /* 32-bit can be >= 300 only */
134 strcpy (p, " (686");
135 #elif (_M_IX86 >= 500)
136 strcpy (p, " (586");
137 #elif (_M_IX86 >= 400)
138 strcpy (p, " (486");
139 #elif (_M_IX86 >= 300)
140 strcpy (p, " (386");
141 #elif (_M_IX86 >= 200)
142 strcpy (p, " (286");
143 #elif (_M_IX86 >= 100)
144 strcpy (p, " (186");
145 #else
146 strcpy (p, " (8086");
147 p++;
148 #endif
149 p += 5;
150 #if defined(__I86__) /* 16-bit Register based calls only */
151 strcpy (p, "), ");
152 #elif defined(__SW_3S) /* 32-bit Stack based calls */
153 strcpy (p, "S), ");
154 #else
155 strcpy (p, "R), "); /* 32-bit Register based calls is default */
156 #endif
157
158#elif defined(__BORLANDC__)
159 #if defined(__CODEGEARC_VERSION__)
160 /*
161 * http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Predefined_Macros
162 */
163 p += sprintf (p, "C++Builder %X.%X.%d",
164 ((__CODEGEARC_VERSION__ & 0xFF000000) >> 24),
165 ((__CODEGEARC_VERSION__ & 0x00FF0000) >> 16),
166 (__CODEGEARC_VERSION__ & 0x0000FFFF) );
167
168 #elif (__BORLANDC__ >= 0x0700)
169 p += sprintf (p, "Embarcadero %X.%X", __BORLANDC__ & >> 8, __BORLANDC__ & 0xFF);
170
171 #else
172 p += sprintf (p, "Borland C %X.%X", __BORLANDC__ >> 8, __BORLANDC__ & 0xFF);
173 #endif
174
175 #if defined(__SMALL__)
176 strcpy (p, " (small model), ");
177 #elif defined(__LARGE__)
178 strcpy (p, " (large model), ");
179 #else
180 strcpy (p, ", ");
181 #endif
182
183#elif defined(__TURBOC__)
184 p += sprintf (p, "Turbo C %X.%X", (__TURBOC__ >> 8) - 1, __TURBOC__ & 0xFF);
185
186 #if defined(__SMALL__)
187 strcpy (p, " (small model), ");
188 #elif defined(__LARGE__)
189 strcpy (p, " (large model), ");
190 #else
191 strcpy (p, ", ");
192 #endif
193
194#elif defined(__clang__)
195 p += sprintf (p, "clang %d.%d.%d (%s), ",
196 __clang_major__, __clang_minor__, __clang_patchlevel__, DBG_RELEASE ASAN_COMPILED UBSAN_COMPILED);
197
198#elif defined(_MSC_VER)
199 /*
200 * Really is:
201 *
202 * #if (_MSC_VER == 1910)
203 * p += sprintf (p, "Microsoft Visual Studio 2017 (%s), ", DBG_RELEASE);
204 * #elif (_MSC_VER == 1900)
205 * p += sprintf (p, "Microsoft Visual Studio 2015 (%s), ", DBG_RELEASE);
206 * #elif (_MSC_VER == 1800)
207 * p += sprintf (p, "Microsoft Visual Studio 2013 (%s), ", DBG_RELEASE);
208 * #elif (_MSC_VER == 1700)
209 * p += sprintf (p, "Microsoft Visual Studio 2012 (%s), ", DBG_RELEASE);
210 * #elif (_MSC_VER == 1600)
211 * p += sprintf (p, "Microsoft Visual Studio 2010 (%s), ", DBG_RELEASE);
212 * #elif (_MSC_VER == 1500)
213 * p += sprintf (p, "Microsoft Visual Studio 2008 (%s), ", DBG_RELEASE);
214 * #elif (_MSC_VER == 1400)
215 * p += sprintf (p, "Microsoft Visual Studio 2005 (%s), ", DBG_RELEASE);
216 * #elif (_MSC_VER == 1310)
217 * p += sprintf (p, "Microsoft Visual Studio 2003 (%s), ", DBG_RELEASE);
218 * #elif (_MSC_VER == 1300)
219 * p += sprintf (p, "Microsoft Visual Studio 2002 (%s), ", DBG_RELEASE);
220 */
221 #if (_MSC_VER >= 1000) /* Visual-C 4+ */
222 p += sprintf (p, "Microsoft Visual-C %d.%d%s (%s, %s), ",
223 (_MSC_VER / 100), _MSC_VER % 100, msvc_get_patch_build(),
224 DBG_RELEASE ASAN_COMPILED UBSAN_COMPILED, msvc_check_fastcall());
225
226 #else /* DOS only */
227 p += sprintf (p, "Microsoft Quick-C %d.%d",
228 _MSC_VER / 100, _MSC_VER % 100);
229
230 #if defined(__SMALL__)
231 strcpy (p, " (small model), ");
232 #elif defined(__LARGE__)
233 strcpy (p, " (large model), ");
234 #else
235 strcpy (p, ", ");
236 #endif
237 #endif
238
239#elif defined(__DMC__)
240 p += sprintf (p, "Digital Mars C %X.%X", __DMC__ >> 8, __DMC__ & 0xFF);
241
242 #if defined(DOS386)
243 strcpy (p, " (32-bit), ");
244 #elif defined(__SMALL__)
245 strcpy (p, " (small model), ");
246 #elif defined(__LARGE__)
247 strcpy (p, " (large model), ");
248 #else
249 strcpy (p, ", ");
250 #endif
251
252#elif defined(__ORANGEC__) /* https://orangec.readthedocs.io/en/latest/occ/OCC%20Defining%20Macros/ */
253 sprintf (buf, "Orange-C %s", __VERSION__);
254
255#elif defined(__ICC__)
256 /*
257 * The old ICC Intel compiler is completely untested.
258 */
259 p += sprintf (p, "Intel C %d.%d, ", __ICC__/100, __ICC__ % 100);
260
261#elif defined(__INTEL_COMPILER__)
262 /*
263 * The more recent Intel compiler is also completely untested.
264 * (costs a lot of money).
265 */
266 p += sprintf (p, "Intel C %d.%d.%d, ",
267 __INTEL_COMPILER / 100,
268 __INTEL_COMPILER % 100,
269 __INTEL_COMPILER_UPDATE);
270#endif
271
272 p = strchr (buf, '\0');
273
274 /* '__MINGW32__' is defined by BOTH mingw.org and by the MinGW-w64
275 * project [1], because both can target Win32. '__MINGW64__' is defined
276 * only when targeting Win64 (__x86_64__).
277 *
278 * [1] http://mingw-w64.sourceforge.net/
279 */
280#if defined(__MINGW32__) && defined(__MINGW64_VERSION_MAJOR)
281 p += sprintf (p, "MinGW-w64 %d.%d (%s), ",
282 __MINGW64_VERSION_MAJOR, __MINGW64_VERSION_MINOR, __MINGW64_VERSION_STATE);
283
284#elif defined(__MINGW32__) /* mingw.org MinGW. MinGW-RT-4+ defines '__MINGW_MAJOR_VERSION' */
285 #if defined(__MINGW_MAJOR_VERSION)
286 p += sprintf (p, "MinGW %d.%d, ", __MINGW_MAJOR_VERSION, __MINGW_MINOR_VERSION);
287 #else
288 p += sprintf (p, "MinGW %d.%d, ", __MINGW32_MAJOR_VERSION, __MINGW32_MINOR_VERSION);
289 #endif
290
291#elif defined(__CYGWIN__)
292 p += sprintf (p, "CygWin %d.%d.%d, ", CYGWIN_VERSION_DLL_MAJOR/1000,
293 CYGWIN_VERSION_DLL_MAJOR % 1000, CYGWIN_VERSION_DLL_MINOR);
294
295#elif (DOSX == DJGPP)
296 p += sprintf (p, "djgpp %d.%02d, ", __DJGPP__, __DJGPP_MINOR__);
297
298#elif (DOSX == DOS4GW)
299 {
300 const char *extender = dos_extender_name();
301 p += sprintf (p, "%s, ", extender ? extender : "unknown");
302 }
303
304#elif (DOSX == PHARLAP)
305 p += sprintf (p, "Pharlap, ");
306
307#elif (DOSX == X32VM)
308 p += sprintf (p, "X32VM, ");
309
310#elif (DOSX == POWERPAK)
311 p += sprintf (p, "PowerPak, ");
312#endif
313
314#if defined(WIN32)
315 if (_watt_is_wow64)
316 p += sprintf (p, "WOW64, ");
317#endif
318
319 strcpy (p, __DATE__);
320 return (buf);
321}
322
323/*
324 * Since plain DOS is limited to 8+3 files, the 'cflags_buf.h' files
325 * were renamed to 'cflagsbf.h'.
326 */
327#if defined(__DJGPP__)
328 #define CC_DEFINE "__DJGPP__"
329 #define CC_PROG "gcc"
330 #define CFLAGS "build/djgpp/cflags.h"
331
332#elif defined(__BORLANDC__) || defined(__CODEGEARC_VERSION__)
333 #define CC_DEFINE "__BORLANDC__"
334
335 #if defined(WIN32)
336 #define CFLAGS "build/borland/win32/cflags.h"
337 #define CFLAGS_BUF "build/borland/win32/cflagsbf.h"
338 #define CC_PROG "bcc32"
339
340 #elif defined(__FLAT__)
341 #define CFLAGS "build/borland/flat/cflags.h"
342 #define CFLAGS_BUF "build/borland/flat/cflagsbf.h"
343 #define CC_PROG "bcc32"
344
345 #elif defined(__LARGE__)
346 #define CFLAGS "build/borland/large/cflags.h"
347 #define CFLAGS_BUF "build/borland/large/cflagsbf.h"
348 #define CC_PROG "bcc"
349
350 #elif defined(__SMALL__)
351 #define CFLAGS "build/borland/small/cflags.h"
352 #define CFLAGS_BUF "build/borland/small/cflagsbf.h"
353 #define CC_PROG "bcc"
354 #endif
355
356#elif defined(__TURBOC__) /* No longer supported */
357 #define CC_DEFINE "__TURBOC__"
358 #define CC_PROG "tcc"
359
360 #if defined(__SMALL__)
361 #define CFLAGS "build/turboc/small/cflags.h"
362 #elif defined(__LARGE__)
363 #define CFLAGS "build/turboc/large/cflags.h"
364 #endif
365
366#elif defined(__DMC__)
367 #define CC_DEFINE "__DMC__"
368 #define CC_PROG "dmc"
369
370 #if defined(__SMALL__)
371 #define CFLAGS "build/digmars/small/cflags.h"
372 #define CFLAGS_BUF "build/digmars/small/cflags.h"
373
374 #elif defined(__LARGE__)
375 #define CFLAGS "build/digmars/large/cflags.h"
376 #define CFLAGS_BUF "build/digmars/large/cflagsbf.h"
377
378 #elif defined(WIN32)
379 #define CFLAGS "build/digmars/win32/cflags.h"
380 #define CFLAGS_BUF "build/digmars/win32/cflagsbf.h"
381
382 #elif (DOSX == PHARLAP)
383 #define CFLAGS "build/digmars/phar/cflags.h"
384 #define CFLAGS_BUF "build/digmars/phar/cflagsbf.h"
385
386 #elif (DOSX == X32VM)
387 #define CFLAGS "build/digmars/x32vm/cflags.h"
388 #define CFLAGS_BUF "build/digmars/x32vm/cflagsbf.h"
389
390 #else
391 #error "What!?"
392 #endif
393
394#elif defined(__POCC__) /* Win32 only */
395 #define CC_DEFINE "__POCC__"
396 #define CC_PROG "pocc"
397
398 #if defined(WIN64) || defined(_M_X64)
399 #define CFLAGS "build/pellesc/64bit/cflags.h"
400 #define CFLAGS_BUF "build/pellesc/64bit/cflagsbf.h"
401 #else
402 #define CFLAGS "build/pellesc/32bit/cflags.h"
403 #define CFLAGS_BUF "build/pellesc/32bit/cflagsbf.h"
404 #endif
405
406#elif defined(__ICC__) /* Not yet */
407 #define CC_DEFINE "__ICC__"
408 #define CC_PROG "icc"
409 #define CFLAGS "build/intel/cflags.h"
410
411#elif defined(__clang__)
412 #define CC_DEFINE "__clang__"
413 #define CC_PROG "clang-cl"
414
415 #if defined(_DEBUG)
416 #if defined(_WIN64)
417 #define CFLAGS "build/clang/64bit/debug/cflags.h"
418 #define CFLAGS_BUF "build/clang/64bit/debug/cflagsbf.h"
419 #else
420 #define CFLAGS "build/clang/32bit/debug/cflags.h"
421 #define CFLAGS_BUF "build/clang/32bit/debug/cflagsbf.h"
422 #endif
423 #else
424 #if defined(_WIN64)
425 #define CFLAGS "build/clang/64bit/release/cflags.h"
426 #define CFLAGS_BUF "build/clang/64bit/release/cflagsbf.h"
427 #else
428 #define CFLAGS "build/clang/32bit/release/cflags.h"
429 #define CFLAGS_BUF "build/clang/32bit/release/cflagsbf.h"
430 #endif
431 #endif
432
433#elif defined(__ORANGEC__) /* Win32 only */
434 #define CC_DEFINE "__ORANGEC__"
435 #define CC_PROG "occ"
436 #define CFLAGS "build/orangec/cflags.h"
437 #define CFLAGS_BUF "build/orangec/cflagsbf.h"
438
439#elif defined(__HIGHC__) /* Pharlap only */
440 #define CC_DEFINE "__HIGHC__"
441 #define CC_PROG "hc386"
442 #define CFLAGS "build/HighC/cflags.h"
443
444#elif defined(__WATCOMC__)
445 #define CC_DEFINE "__WATCOMC__"
446
447 #if defined(__I86__)
448 #define CC_PROG "wcc"
449 #if defined(__SMALL__)
450 #define CFLAGS "build/watcom/small/cflags.h"
451 #define CFLAGS_BUF "build/watcom/small/cflagsbf.h"
452 #elif defined(__LARGE__)
453 #define CFLAGS "build/watcom/large/cflags.h"
454 #define CFLAGS_BUF "build/watcom/large/cflagsbf.h"
455 #endif
456
457 #elif defined(__386__)
458 #define CC_PROG "wcc386"
459 #if defined(WIN32)
460 #define CFLAGS "build/watcom/win32/cflags.h"
461 #define CFLAGS_BUF "build/watcom/win32/cflagsbf.h"
462 #elif defined(__FLAT__)
463 #if (DOSX == X32VM)
464 #define CFLAGS "build/watcom/x32vm/cflags.h"
465 #define CFLAGS_BUF "build/watcom/x32vm/cflagsbf.h"
466 #elif (DOSX == PHARLAP)
467 #define CFLAGS "build/watcom/phar/cflags.h"
468 #define CFLAGS_BUF "build/watcom/phar/cflagsbf.h"
469 #else
470 #define CFLAGS "build/watcom/flat/cflags.h"
471 #define CFLAGS_BUF "build/watcom/flat/cflagsbf.h"
472 #endif
473 #elif defined(__SMALL__)
474 #define CFLAGS "build/watcom/small32/cflags.h"
475 #define CFLAGS_BUF "build/watcom/small32/cflagsbf.h"
476 #endif
477 #endif
478
479 /* Both these combos can be true for the "MinGW-w64" project [1].
480 * Depending on '-m64' or not. '-m64' is targeting Win64 native code
481 * and this sets '__MINGW64__' and 'WIN64'.
482 */
483#elif defined(__MINGW64__) && defined(__MINGW64_VERSION_MAJOR)
484 #define CC_DEFINE "__MINGW64__"
485 #define CC_PROG "gcc"
486 #define CFLAGS "build/MinGW64/64bit/cflags.h"
487 #define CFLAGS_BUF "build/MinGW64/64bit/cflagsbf.h"
488
489#elif defined(__MINGW32__) && defined(__MINGW64_VERSION_MAJOR)
490 #define CC_DEFINE "__MINGW32__"
491 #define CC_PROG "gcc"
492 #define CFLAGS "build/MinGW64/32bit/cflags.h"
493 #define CFLAGS_BUF "build/MinGW64/32bit/cflagsbf.h"
494
495#elif defined(__MINGW32__) /* The old-school MinGW from <mingw.org> */
496 #define CC_DEFINE "__MINGW32__"
497 #define CC_PROG "gcc"
498 #define CFLAGS "build/MinGW32/cflags.h"
499 #define CFLAGS_BUF "build/MinGW32/cflagsbf.h"
500
501#elif defined(__CYGWIN__)
502 #define CC_DEFINE "__CYGWIN__"
503 #define CC_PROG "gcc"
504
505 #if defined(__x86_64__)
506 #define CFLAGS "build/CygWin/64bit/cflags.h"
507 #else
508 #define CFLAGS "build/CygWin/32bit/cflags.h"
509 #endif
510
511#elif defined(_MSC_VER)
512 #define CC_DEFINE "_MSC_VER"
513 #define CC_PROG "cl"
514
515 #if defined(__SMALL__) || defined(__LARGE__)
516 #error "Quick-C small/large model no longer supported."
517
518 #elif (_MSC_VER >= 1000) /* Visual-C 4+ (debug/release) */
519 #if defined(_DEBUG)
520 #if defined(_WIN64)
521 #define CFLAGS "build/visualc/64bit/debug/cflags.h"
522 #define CFLAGS_BUF "build/visualc/64bit/debug/cflagsbf.h"
523 #else
524 #define CFLAGS "build/visualc/32bit/debug/cflags.h"
525 #define CFLAGS_BUF "build/visualc/32bit/debug/cflagsbf.h"
526 #endif
527 #else
528 #if defined(_WIN64)
529 #define CFLAGS "build/visualc/64bit/release/cflags.h"
530 #define CFLAGS_BUF "build/visualc/64bit/release/cflagsbf.h"
531 #else
532 #define CFLAGS "build/visualc/32bit/release/cflags.h"
533 #define CFLAGS_BUF "build/visualc/32bit/release/cflagsbf.h"
534 #endif
535 #endif
536 #endif
537#endif
538
543const char * W32_CALL wattcpBuildCCexe (void)
544{
545#ifdef CC_PROG
546 return (CC_PROG);
547#else
548 return ("Unknown");
549#endif
550}
551
556const char * W32_CALL wattcpBuildCC (void)
557{
558#ifdef CC_DEFINE
559 return (CC_DEFINE);
560#else
561 return ("Unknown");
562#endif
563}
564
572#if defined(CFLAGS_BUF)
573 /*
574 * Generated array for CFLAGS.
575 * Ref: cflagsbf.h rules in respective makefile.
576 *
577 * Since the makefiles contains "\xx" for some targets (except gcc),
578 * the below '#include CFLAGS' is mishandled by the C-preprocessor;
579 * The "\xx" are interpreted as an ESC-sequences. But the below array
580 * is left as-is.
581 */
582 char w32_cflags2[] = {
583 #include CFLAGS_BUF
584 0
585 };
586
587 const char * W32_CALL wattcpBuildCflags (void)
588 {
589 static char buf [sizeof(w32_cflags2)+1];
590 static int done = 0;
591
592 if (!done)
593 {
594#if 0
595 char *to = buf;
596 const char *from = w32_cflags2;
597 size_t i;
598
599 for (i = 0; i < sizeof(w32_cflags2); i++)
600 {
601 if (*from == '\r' || *from == '\n' || *from == '\0')
602 continue;
603 if (*from == '\\')
604 *to++ = '/';
605 else *to++ = *from;
606 from++;
607 }
608 *to = '\0';
609#else
610 strreplace ('\n', 0, w32_cflags2);
611 strreplace ('\\','/', w32_cflags2);
612 strtrim (w32_cflags2, buf, sizeof(w32_cflags2));
613#endif
614 done = 1;
615 }
616 return (buf);
617 }
618
619#else
620
621 #if defined(CFLAGS)
622 #include CFLAGS
623 #endif
624
625 const char * W32_CALL wattcpBuildCflags (void)
626 {
627 #if defined(CFLAGS)
628 static char buf [400]; /* should be enough for High-C */
629
630 _strlcpy (buf, w32_cflags, sizeof(buf));
631 return (buf);
632 #else
633 return ("Unknown");
634 #endif /* CFLAGS */
635 }
636#endif /* CFLAGS_BUF */
637
638
639static const char *capabilities[] = {
640#if defined(USE_DEBUG)
641 "debug",
642#endif
643#if defined(USE_MULTICAST)
644 "mcast",
645#endif
646#if defined(USE_BIND)
647 "bind",
648#endif
649#if defined(USE_BSD_API)
650 "BSDsock",
651#endif
652#if defined(USE_BSD_FATAL)
653 "BSDfatal",
654#endif
655#if defined(USE_BOOTP)
656 "bootp",
657#endif
658#if defined(USE_DHCP)
659 "dhcp",
660#endif
661#if defined(USE_RARP)
662 "rarp",
663#endif
664#if defined(USE_LANGUAGE)
665 "lang",
666#endif
667#if defined(USE_FRAGMENTS)
668 "frag",
669#endif
670#if defined(USE_STATISTICS)
671 "stat",
672#endif
673#if defined(USE_CRTDBG)
674 "crt-dbg",
675#endif
676#if defined(USE_STACKWALKER)
677 "stkwalker",
678#endif
679#if defined(USE_FSEXT)
680 "fsext",
681#endif
682#if defined(USE_LOOPBACK)
683 "loopback",
684#endif
685#if defined(USE_EMBEDDED)
686 "embedded",
687#endif
688#if defined(USE_TFTP)
689 "tftp",
690#endif
691#if defined(USE_TCP_SACK)
692 "sack",
693#endif
694#if defined(USE_UDP_ONLY)
695 "udp-only",
696#endif
697#if defined(USE_ECHO_DISC)
698 "echo",
699#endif
700#if defined(USE_PPPOE)
701 "PPPoE",
702#endif
703#if defined(USE_IPV6)
704 "IPv6",
705#endif
706#if defined(USE_DEAD_GWD)
707 "dead-gw",
708#endif
709#if defined(USE_GZIP)
710 "gzip",
711#endif
712#if defined(USE_TCP_MD5)
713 "TCP-MD5",
714#endif
715#if defined(USE_DYNIP_CLI)
716 "DynIP",
717#endif
718#if defined(USE_PROFILER)
719 "profiler",
720#endif
721#if defined(USE_FAST_PKT)
722 "fast-pkt",
723#elif defined(__MSDOS__)
724 "slow-RMCB",
725#endif
726#if defined(USE_SCTP)
727 "SCTP",
728#endif
729#if defined(USE_ASAN)
730 "ASAN",
731#endif
732#if defined(USE_UBSAN)
733 "UBSAN",
734#endif
735 NULL
736 };
737
743const char * W32_CALL wattcpCapabilities (void)
744{
745 static char buf [240];
746 char *p = buf;
747 int i;
748
749 for (i = 0; capabilities[i]; i++)
750 {
751 *p++ = '/';
752 if (p + strlen(capabilities[i]) - 2 >= buf + sizeof(buf))
753 {
754 *p++ = '.';
755 *p++ = '.';
756 break;
757 }
758 strcpy (p, capabilities[i]);
759 p += strlen (capabilities[i]);
760 }
761 *p = '\0';
762 return (buf);
763}
764
765#if defined(__GNUC__)
766/*
767 * The builtin `__tune_xx__' defines were introduced in gcc 2.95.1 (?)
768 *
769 * 'gcc -v --help'. Look for '=mtune=CPU':
770 *
771 * -mtune=CPU optimize for CPU, CPU is one of:
772 * generic32, generic64, i8086, i186, i286, i386, i486,
773 * i586, i686, pentium, pentiumpro, pentiumii,
774 * pentiumiii, pentium4, prescott, nocona, core, core2,
775 * corei7, l1om, k1om, k6, k6_2, athlon, opteron, k8,
776 * amdfam10, bdver1, bdver2, bdver3, btver1, btver2
777 */
778const char *gcc_get_cpu_tune (void)
779{
780 static char ret[20];
781 const char *p = NULL;
782
783#if defined(__x86_64__) /* -m64 (MinGW64, AMD) */
784 p = "x86-64";
785#endif
786
787#if defined(__tune_i386__) /* -mtune=i386 (default for -m32) */
788 p = "386";
789#endif
790
791#if defined(__tune_i486__) /* -mtune=i486 */
792 p = "486";
793#endif
794
795#if defined(__tune_i586__) /* -mtune=i586 */
796 p = "586";
797#endif
798
799#if defined(__tune_i686__) /* -mtune=pentiumpro */
800 p = "686";
801#endif
802
803#if defined(__tune_pentium__) /* -mtune=pentium */
804 p = "Pent";
805#endif
806
807#if defined(__tune_pentium3__) /* -mtune=pentium3 */
808 p = "Pent3";
809#endif
810
811#if defined(__tune_pentium4__) /* -mtune=pentium4 */
812 p = "Pent4";
813#endif
814
815#if defined(__tune_pentiumpro__) /* -mtune=pentiumpro */
816 p = "PentPro";
817#endif
818
819#if defined(__tune_nocona__) /* -mtune=nocona,prescott */
820 p = "nocona";
821#endif
822
823#if defined(__tune_core2__) /* -mtune=core2 */
824 p = "Core2";
825#endif
826
827#if defined(__tune_corei7__) /* -mtune=corei7 */
828 p = "CoreI7";
829#endif
830
831#if defined(__tune_k6__) /* -mtune=k6 */
832 p = "K6";
833#endif
834
835#if defined(__tune_athlon__) /* -mtune=athlon */
836 p = "Athlon";
837#endif
838
839#if defined(__tune_k8__) /* -mtune=k8,opteron */
840 p = "K8";
841#endif
842
843#if defined(__tune_amdfam10__) /* -mtune=amdfam10 */
844 p = "K8";
845#endif
846
847#if defined(__tune_bdver1__) /* -mtune=bdver1 */
848 p = "BDv1";
849#endif
850
851#if defined(__tune_bdver2__) /* -mtune=bdver2 */
852 p = "BDv2";
853#endif
854
855#if defined(__tune_btver1__) /* -mtune=btver1 */
856 p = "BTv1";
857#endif
858
859 if (!p)
860 return (", ");
861
862#if defined(SNPRINTF)
863 SNPRINTF (ret, sizeof(ret), " (%s), ", p);
864#else
865 sprintf (ret, " (%s), ", p);
866#endif
867
868 return (ret);
869}
870#endif
871
872#if defined(_MSC_VER) && (_MSC_VER >= 1000) /* Visual-C 4+ */
873#if !defined(_M_X64)
874 /*
875 * cl/x64 doesn't support reg-calls. Does any other 64-bit compilers do that?
876 * If compiled as fastcall (-Gr), the 1st argument is in ECX.
877 */
878 _declspec(naked) static DWORD echo_1st_arg_Gr (DWORD arg)
879 {
880 __asm mov eax, ecx
881 __asm ret
882 }
883#endif
884
885static const char *msvc_check_fastcall (void)
886{
887#if !defined(_M_X64)
888 if (echo_1st_arg_Gr(0xDEAFBABE) == 0xDEAFBABE)
889 return ("fastcall");
890#endif
891 return ("cdecl");
892}
893
894/*
895 * Ref. http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.120).aspx
896 * https://sourceforge.net/p/predef/wiki/Compilers/
897 *
898 * E.g. "cl /?" prints:
899 * Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x86
900 * = _MSC_FULL_VER - 180000000 ^----
901 *
902 * It can also have a trailing build number:
903 * Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25507.1 for x86
904 * _MSC_BUILD ^
905 */
906static const char *msvc_get_patch_build (void)
907{
908 static char buf[20]; /* room for "19.11.25507.1" = VV.RR.PPPPP.B\0 */
909 char *end;
910 DWORD patch = 0;
911
912 buf[0] = '\0';
913
914#if defined(_MSC_FULL_VER)
915 buf[0] = '.';
916 patch = _MSC_FULL_VER % 100000;
917#endif /* _MSC_FULL_VER */
918
919 if (patch)
920 _ultoa (patch, buf+1, 10);
921
922#if defined(_MSC_BUILD)
923 end = strrchr (buf, '\0');
924 *end++ = '.';
925 _ultoa (_MSC_BUILD, end, 10);
926#endif
927
928 return (buf);
929}
930#endif /* _MSC_VER && _MSC_VER >= 1000 */
931
932
misc.h
strtrim
char * strtrim(const char *orig, char *dest, size_t len)
Copy a string (to 'dest') with all excessive blanks (space/tab) removed.
Definition: misc_str.c:287
strreplace
char * strreplace(int ch1, int ch2, char *str)
Replace 'ch1' to 'ch2' in string 'str'.
Definition: misc_str.c:212
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
wattcpVersion
const char *W32_CALL wattcpVersion(void)
Return string for Watt-32 version.
Definition: version.c:77
wattcpCapabilities
const char *W32_CALL wattcpCapabilities(void)
Return compiled-in capabilities and features.
Definition: version.c:743
wattcpBuildCC
const char *W32_CALL wattcpBuildCC(void)
Return the target/compiler.
Definition: version.c:556
w32_cflags2
char w32_cflags2[]
Return the used.
Definition: version.c:582
wattcpBuildCCexe
const char *W32_CALL wattcpBuildCCexe(void)
Return the the name if the compiler used.
Definition: version.c:543
wattcp.h
Core definitions.
wdpmi.h


Watt-32 tcp/ip: E:/WATT/src/w32_ndis.h Source File

  • src
w32_ndis.h
Go to the documentation of this file.
1
25#ifndef _w32_NTDDNDIS_H
26#define _w32_NTDDNDIS_H
27
28//
29// Device Name - this string is the name of the device. It is the name
30// that should be passed to NtOpenFile when accessing the device.
31//
32// Note: For devices that support multiple units, it should be suffixed
33// with the Ascii representation of the unit number.
34//
35#define DD_NDIS_DEVICE_NAME "\\Device\\UNKNOWN"
36
37//
38// NtDeviceIoControlFile IoControlCode values for this device.
39//
40// Warning: Remember that the low two bits of the code specify how the
41// buffers are passed to the driver!
42//
43#define _NDIS_CONTROL_CODE(request,method) \
44 CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD, request, method, FILE_ANY_ACCESS)
45#define IOCTL_NDIS_QUERY_GLOBAL_STATS _NDIS_CONTROL_CODE (0, METHOD_OUT_DIRECT)
46#define IOCTL_NDIS_QUERY_ALL_STATS _NDIS_CONTROL_CODE (1, METHOD_OUT_DIRECT)
47#define IOCTL_NDIS_ADD_DEVICE _NDIS_CONTROL_CODE (2, METHOD_BUFFERED)
48#define IOCTL_NDIS_DELETE_DEVICE _NDIS_CONTROL_CODE (3, METHOD_BUFFERED)
49#define IOCTL_NDIS_TRANSLATE_NAME _NDIS_CONTROL_CODE (4, METHOD_BUFFERED)
50#define IOCTL_NDIS_ADD_TDI_DEVICE _NDIS_CONTROL_CODE (5, METHOD_BUFFERED)
51#define IOCTL_NDIS_NOTIFY_PROTOCOL _NDIS_CONTROL_CODE (6, METHOD_BUFFERED)
52#define IOCTL_NDIS_GET_LOG_DATA _NDIS_CONTROL_CODE (7, METHOD_OUT_DIRECT)
53
54//
55// NtDeviceIoControlFile InputBuffer/OutputBuffer record structures for
56// this device.
57//
58//
59// This is the type of an NDIS OID value.
60//
61typedef ULONG NDIS_OID, *PNDIS_OID;
62
63//
64// IOCTL_NDIS_QUERY_ALL_STATS returns a sequence of these, packed
65// together (no padding is required since statistics all have
66// four or eight bytes of data).
67//
68typedef struct _NDIS_STATISTICS_VALUE {
69 NDIS_OID Oid;
70 ULONG DataLength;
71 UCHAR Data[1]; // variable length
72} NDIS_STATISTICS_VALUE, *PNDIS_STATISTICS_VALUE;
73
74//
75// Structure used by TRANSLATE_NAME IOCTL
76//
77typedef struct _NET_PNP_ID {
78 ULONG ClassId;
79 ULONG Token;
80} NET_PNP_ID, *PNET_PNP_ID;
81
82typedef struct _NET_PNP_TRANSLATE_LIST {
83 ULONG BytesNeeded;
84 NET_PNP_ID IdArray[ANYSIZE_ARRAY];
85} NET_PNP_TRANSLATE_LIST, *PNET_PNP_TRANSLATE_LIST;
86
87//
88// Structure used to define a self-contained variable data structure
89//
90typedef struct _NDIS_VAR_DATA_DESC {
91 USHORT Length; // # of octects of data
92 USHORT MaximumLength; // # of octects available
93 LONG Offset; // Offset of data relative to the descriptor
94} NDIS_VAR_DATA_DESC, *PNDIS_VAR_DATA_DESC;
95
96
97//
98// Object Identifiers used by NdisRequest Query/Set Information
99//
100//
101// General Objects
102//
103#define OID_GEN_SUPPORTED_LIST 0x00010101
104#define OID_GEN_HARDWARE_STATUS 0x00010102
105#define OID_GEN_MEDIA_SUPPORTED 0x00010103
106#define OID_GEN_MEDIA_IN_USE 0x00010104
107#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105
108#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106
109#define OID_GEN_LINK_SPEED 0x00010107
110#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108
111#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109
112#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A
113#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B
114#define OID_GEN_VENDOR_ID 0x0001010C
115#define OID_GEN_VENDOR_DESCRIPTION 0x0001010D
116#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E
117#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F
118#define OID_GEN_DRIVER_VERSION 0x00010110
119#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111
120#define OID_GEN_PROTOCOL_OPTIONS 0x00010112
121#define OID_GEN_MAC_OPTIONS 0x00010113
122#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114
123#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115
124#define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116
125#define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118
126#define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119
127#define OID_GEN_MEDIA_CAPABILITIES 0x00010201
128#define OID_GEN_PHYSICAL_MEDIUM 0x00010202
129#define OID_GEN_PHYSICAL_MEDIUM_EX 0x00010203
130#define OID_GEN_VLAN_ID 0x0001021C
131#define OID_GEN_XMIT_OK 0x00020101
132#define OID_GEN_RCV_OK 0x00020102
133#define OID_GEN_XMIT_ERROR 0x00020103
134#define OID_GEN_RCV_ERROR 0x00020104
135#define OID_GEN_RCV_NO_BUFFER 0x00020105
136#define OID_GEN_DIRECTED_BYTES_XMIT 0x00020201
137#define OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202
138#define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203
139#define OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204
140#define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205
141#define OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206
142#define OID_GEN_DIRECTED_BYTES_RCV 0x00020207
143#define OID_GEN_DIRECTED_FRAMES_RCV 0x00020208
144#define OID_GEN_MULTICAST_BYTES_RCV 0x00020209
145#define OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A
146#define OID_GEN_BROADCAST_BYTES_RCV 0x0002020B
147#define OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C
148#define OID_GEN_RCV_CRC_ERROR 0x0002020D
149#define OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E
150#define OID_GEN_GET_TIME_CAPS 0x0002020F
151#define OID_GEN_GET_NETCARD_TIME 0x00020210
152
153//
154// These are connection-oriented general OIDs.
155// These replace the above OIDs for connection-oriented media.
156//
157#define OID_GEN_CO_SUPPORTED_LIST 0x00010101
158#define OID_GEN_CO_HARDWARE_STATUS 0x00010102
159#define OID_GEN_CO_MEDIA_SUPPORTED 0x00010103
160#define OID_GEN_CO_MEDIA_IN_USE 0x00010104
161#define OID_GEN_CO_LINK_SPEED 0x00010105
162#define OID_GEN_CO_VENDOR_ID 0x00010106
163#define OID_GEN_CO_VENDOR_DESCRIPTION 0x00010107
164#define OID_GEN_CO_DRIVER_VERSION 0x00010108
165#define OID_GEN_CO_PROTOCOL_OPTIONS 0x00010109
166#define OID_GEN_CO_MAC_OPTIONS 0x0001010A
167#define OID_GEN_CO_MEDIA_CONNECT_STATUS 0x0001010B
168#define OID_GEN_CO_VENDOR_DRIVER_VERSION 0x0001010C
169#define OID_GEN_CO_MINIMUM_LINK_SPEED 0x0001010D
170#define OID_GEN_CO_GET_TIME_CAPS 0x00010201
171#define OID_GEN_CO_GET_NETCARD_TIME 0x00020210
172#define OID_GEN_BYTES_RCV 0x00020219
173#define OID_GEN_BYTES_XMIT 0x0002021A
174#define OID_GEN_RCV_DISCARDS 0x0002021B
175
176//
177// These are connection-oriented statistics OIDs.
178//
179#define OID_GEN_CO_XMIT_PDUS_OK 0x00020101
180#define OID_GEN_CO_RCV_PDUS_OK 0x00020102
181#define OID_GEN_CO_XMIT_PDUS_ERROR 0x00020103
182#define OID_GEN_CO_RCV_PDUS_ERROR 0x00020104
183#define OID_GEN_CO_RCV_PDUS_NO_BUFFER 0x00020105
184#define OID_GEN_CO_RCV_CRC_ERROR 0x00020201
185#define OID_GEN_CO_TRANSMIT_QUEUE_LENGTH 0x00020202
186#define OID_GEN_CO_BYTES_XMIT 0x00020203
187#define OID_GEN_CO_BYTES_RCV 0x00020204
188#define OID_GEN_CO_BYTES_XMIT_OUTSTANDING 0x00020205
189#define OID_GEN_CO_NETCARD_LOAD 0x00020206
190
191//
192// These are objects for Connection-oriented media call-managers and are not
193// valid for ndis drivers. Under construction.
194//
195#define OID_CO_ADD_PVC 0xFF000001
196#define OID_CO_DELETE_PVC 0xFF000002
197#define OID_CO_GET_CALL_INFORMATION 0xFF000003
198#define OID_CO_ADD_ADDRESS 0xFF000004
199#define OID_CO_DELETE_ADDRESS 0xFF000005
200#define OID_CO_GET_ADDRESSES 0xFF000006
201#define OID_CO_ADDRESS_CHANGE 0xFF000007
202#define OID_CO_SIGNALING_ENABLED 0xFF000008
203#define OID_CO_SIGNALING_DISABLED 0xFF000009
204
205//
206// 802.3 Objects (Ethernet)
207//
208#define OID_802_3_PERMANENT_ADDRESS 0x01010101
209#define OID_802_3_CURRENT_ADDRESS 0x01010102
210#define OID_802_3_MULTICAST_LIST 0x01010103
211#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104
212#define OID_802_3_MAC_OPTIONS 0x01010105
213
214#define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001
215#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101
216#define OID_802_3_XMIT_ONE_COLLISION 0x01020102
217#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103
218#define OID_802_3_XMIT_DEFERRED 0x01020201
219#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202
220#define OID_802_3_RCV_OVERRUN 0x01020203
221#define OID_802_3_XMIT_UNDERRUN 0x01020204
222#define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205
223#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206
224#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207
225
226//
227// 802.5 Objects (Token-Ring)
228//
229#define OID_802_5_PERMANENT_ADDRESS 0x02010101
230#define OID_802_5_CURRENT_ADDRESS 0x02010102
231#define OID_802_5_CURRENT_FUNCTIONAL 0x02010103
232#define OID_802_5_CURRENT_GROUP 0x02010104
233#define OID_802_5_LAST_OPEN_STATUS 0x02010105
234#define OID_802_5_CURRENT_RING_STATUS 0x02010106
235#define OID_802_5_CURRENT_RING_STATE 0x02010107
236#define OID_802_5_LINE_ERRORS 0x02020101
237#define OID_802_5_LOST_FRAMES 0x02020102
238#define OID_802_5_BURST_ERRORS 0x02020201
239#define OID_802_5_AC_ERRORS 0x02020202
240#define OID_802_5_ABORT_DELIMETERS 0x02020203
241#define OID_802_5_FRAME_COPIED_ERRORS 0x02020204
242#define OID_802_5_FREQUENCY_ERRORS 0x02020205
243#define OID_802_5_TOKEN_ERRORS 0x02020206
244#define OID_802_5_INTERNAL_ERRORS 0x02020207
245
246//
247// FDDI Objects
248//
249#define OID_FDDI_LONG_PERMANENT_ADDR 0x03010101
250#define OID_FDDI_LONG_CURRENT_ADDR 0x03010102
251#define OID_FDDI_LONG_MULTICAST_LIST 0x03010103
252#define OID_FDDI_LONG_MAX_LIST_SIZE 0x03010104
253#define OID_FDDI_SHORT_PERMANENT_ADDR 0x03010105
254#define OID_FDDI_SHORT_CURRENT_ADDR 0x03010106
255#define OID_FDDI_SHORT_MULTICAST_LIST 0x03010107
256#define OID_FDDI_SHORT_MAX_LIST_SIZE 0x03010108
257#define OID_FDDI_ATTACHMENT_TYPE 0x03020101
258#define OID_FDDI_UPSTREAM_NODE_LONG 0x03020102
259#define OID_FDDI_DOWNSTREAM_NODE_LONG 0x03020103
260#define OID_FDDI_FRAME_ERRORS 0x03020104
261#define OID_FDDI_FRAMES_LOST 0x03020105
262#define OID_FDDI_RING_MGT_STATE 0x03020106
263#define OID_FDDI_LCT_FAILURES 0x03020107
264#define OID_FDDI_LEM_REJECTS 0x03020108
265#define OID_FDDI_LCONNECTION_STATE 0x03020109
266#define OID_FDDI_SMT_STATION_ID 0x03030201
267#define OID_FDDI_SMT_OP_VERSION_ID 0x03030202
268#define OID_FDDI_SMT_HI_VERSION_ID 0x03030203
269#define OID_FDDI_SMT_LO_VERSION_ID 0x03030204
270#define OID_FDDI_SMT_MANUFACTURER_DATA 0x03030205
271#define OID_FDDI_SMT_USER_DATA 0x03030206
272#define OID_FDDI_SMT_MIB_VERSION_ID 0x03030207
273#define OID_FDDI_SMT_MAC_CT 0x03030208
274#define OID_FDDI_SMT_NON_MASTER_CT 0x03030209
275#define OID_FDDI_SMT_MASTER_CT 0x0303020A
276#define OID_FDDI_SMT_AVAILABLE_PATHS 0x0303020B
277#define OID_FDDI_SMT_CONFIG_CAPABILITIES 0x0303020C
278#define OID_FDDI_SMT_CONFIG_POLICY 0x0303020D
279#define OID_FDDI_SMT_CONNECTION_POLICY 0x0303020E
280#define OID_FDDI_SMT_T_NOTIFY 0x0303020F
281#define OID_FDDI_SMT_STAT_RPT_POLICY 0x03030210
282#define OID_FDDI_SMT_TRACE_MAX_EXPIRATION 0x03030211
283#define OID_FDDI_SMT_PORT_INDEXES 0x03030212
284#define OID_FDDI_SMT_MAC_INDEXES 0x03030213
285#define OID_FDDI_SMT_BYPASS_PRESENT 0x03030214
286#define OID_FDDI_SMT_ECM_STATE 0x03030215
287#define OID_FDDI_SMT_CF_STATE 0x03030216
288#define OID_FDDI_SMT_HOLD_STATE 0x03030217
289#define OID_FDDI_SMT_REMOTE_DISCONNECT_FLAG 0x03030218
290#define OID_FDDI_SMT_STATION_STATUS 0x03030219
291#define OID_FDDI_SMT_PEER_WRAP_FLAG 0x0303021A
292#define OID_FDDI_SMT_MSG_TIME_STAMP 0x0303021B
293#define OID_FDDI_SMT_TRANSITION_TIME_STAMP 0x0303021C
294#define OID_FDDI_SMT_SET_COUNT 0x0303021D
295#define OID_FDDI_SMT_LAST_SET_STATION_ID 0x0303021E
296#define OID_FDDI_SMT_STATION_ACTION 0x03030277
297#define OID_FDDI_MAC_FRAME_STATUS_FUNCTIONS 0x0303021F
298#define OID_FDDI_MAC_BRIDGE_FUNCTIONS 0x03030220
299#define OID_FDDI_MAC_T_MAX_CAPABILITY 0x03030221
300#define OID_FDDI_MAC_TVX_CAPABILITY 0x03030222
301#define OID_FDDI_MAC_AVAILABLE_PATHS 0x03030223
302#define OID_FDDI_MAC_CURRENT_PATH 0x03030224
303#define OID_FDDI_MAC_UPSTREAM_NBR 0x03030225
304#define OID_FDDI_MAC_DOWNSTREAM_NBR 0x03030226
305#define OID_FDDI_MAC_OLD_UPSTREAM_NBR 0x03030227
306#define OID_FDDI_MAC_OLD_DOWNSTREAM_NBR 0x03030228
307#define OID_FDDI_MAC_DUP_ADDRESS_TEST 0x03030229
308#define OID_FDDI_MAC_REQUESTED_PATHS 0x0303022A
309#define OID_FDDI_MAC_DOWNSTREAM_PORT_TYPE 0x0303022B
310#define OID_FDDI_MAC_INDEX 0x0303022C
311#define OID_FDDI_MAC_SMT_ADDRESS 0x0303022D
312#define OID_FDDI_MAC_LONG_GRP_ADDRESS 0x0303022E
313#define OID_FDDI_MAC_SHORT_GRP_ADDRESS 0x0303022F
314#define OID_FDDI_MAC_T_REQ 0x03030230
315#define OID_FDDI_MAC_T_NEG 0x03030231
316#define OID_FDDI_MAC_T_MAX 0x03030232
317#define OID_FDDI_MAC_TVX_VALUE 0x03030233
318#define OID_FDDI_MAC_T_PRI0 0x03030234
319#define OID_FDDI_MAC_T_PRI1 0x03030235
320#define OID_FDDI_MAC_T_PRI2 0x03030236
321#define OID_FDDI_MAC_T_PRI3 0x03030237
322#define OID_FDDI_MAC_T_PRI4 0x03030238
323#define OID_FDDI_MAC_T_PRI5 0x03030239
324#define OID_FDDI_MAC_T_PRI6 0x0303023A
325#define OID_FDDI_MAC_FRAME_CT 0x0303023B
326#define OID_FDDI_MAC_COPIED_CT 0x0303023C
327#define OID_FDDI_MAC_TRANSMIT_CT 0x0303023D
328#define OID_FDDI_MAC_TOKEN_CT 0x0303023E
329#define OID_FDDI_MAC_ERROR_CT 0x0303023F
330#define OID_FDDI_MAC_LOST_CT 0x03030240
331#define OID_FDDI_MAC_TVX_EXPIRED_CT 0x03030241
332#define OID_FDDI_MAC_NOT_COPIED_CT 0x03030242
333#define OID_FDDI_MAC_LATE_CT 0x03030243
334#define OID_FDDI_MAC_RING_OP_CT 0x03030244
335#define OID_FDDI_MAC_FRAME_ERROR_THRESHOLD 0x03030245
336#define OID_FDDI_MAC_FRAME_ERROR_RATIO 0x03030246
337#define OID_FDDI_MAC_NOT_COPIED_THRESHOLD 0x03030247
338#define OID_FDDI_MAC_NOT_COPIED_RATIO 0x03030248
339#define OID_FDDI_MAC_RMT_STATE 0x03030249
340#define OID_FDDI_MAC_DA_FLAG 0x0303024A
341#define OID_FDDI_MAC_UNDA_FLAG 0x0303024B
342#define OID_FDDI_MAC_FRAME_ERROR_FLAG 0x0303024C
343#define OID_FDDI_MAC_NOT_COPIED_FLAG 0x0303024D
344#define OID_FDDI_MAC_MA_UNITDATA_AVAILABLE 0x0303024E
345#define OID_FDDI_MAC_HARDWARE_PRESENT 0x0303024F
346#define OID_FDDI_MAC_MA_UNITDATA_ENABLE 0x03030250
347#define OID_FDDI_PATH_INDEX 0x03030251
348#define OID_FDDI_PATH_RING_LATENCY 0x03030252
349#define OID_FDDI_PATH_TRACE_STATUS 0x03030253
350#define OID_FDDI_PATH_SBA_PAYLOAD 0x03030254
351#define OID_FDDI_PATH_SBA_OVERHEAD 0x03030255
352#define OID_FDDI_PATH_CONFIGURATION 0x03030256
353#define OID_FDDI_PATH_T_R_MODE 0x03030257
354#define OID_FDDI_PATH_SBA_AVAILABLE 0x03030258
355#define OID_FDDI_PATH_TVX_LOWER_BOUND 0x03030259
356#define OID_FDDI_PATH_T_MAX_LOWER_BOUND 0x0303025A
357#define OID_FDDI_PATH_MAX_T_REQ 0x0303025B
358#define OID_FDDI_PORT_MY_TYPE 0x0303025C
359#define OID_FDDI_PORT_NEIGHBOR_TYPE 0x0303025D
360#define OID_FDDI_PORT_CONNECTION_POLICIES 0x0303025E
361#define OID_FDDI_PORT_MAC_INDICATED 0x0303025F
362#define OID_FDDI_PORT_CURRENT_PATH 0x03030260
363#define OID_FDDI_PORT_REQUESTED_PATHS 0x03030261
364#define OID_FDDI_PORT_MAC_PLACEMENT 0x03030262
365#define OID_FDDI_PORT_AVAILABLE_PATHS 0x03030263
366#define OID_FDDI_PORT_MAC_LOOP_TIME 0x03030264
367#define OID_FDDI_PORT_PMD_CLASS 0x03030265
368#define OID_FDDI_PORT_CONNECTION_CAPABILITIES 0x03030266
369#define OID_FDDI_PORT_INDEX 0x03030267
370#define OID_FDDI_PORT_MAINT_LS 0x03030268
371#define OID_FDDI_PORT_BS_FLAG 0x03030269
372#define OID_FDDI_PORT_PC_LS 0x0303026A
373#define OID_FDDI_PORT_EB_ERROR_CT 0x0303026B
374#define OID_FDDI_PORT_LCT_FAIL_CT 0x0303026C
375#define OID_FDDI_PORT_LER_ESTIMATE 0x0303026D
376#define OID_FDDI_PORT_LEM_REJECT_CT 0x0303026E
377#define OID_FDDI_PORT_LEM_CT 0x0303026F
378#define OID_FDDI_PORT_LER_CUTOFF 0x03030270
379#define OID_FDDI_PORT_LER_ALARM 0x03030271
380#define OID_FDDI_PORT_CONNNECT_STATE 0x03030272
381#define OID_FDDI_PORT_PCM_STATE 0x03030273
382#define OID_FDDI_PORT_PC_WITHHOLD 0x03030274
383#define OID_FDDI_PORT_LER_FLAG 0x03030275
384#define OID_FDDI_PORT_HARDWARE_PRESENT 0x03030276
385#define OID_FDDI_PORT_ACTION 0x03030278
386#define OID_FDDI_IF_DESCR 0x03030279
387#define OID_FDDI_IF_TYPE 0x0303027A
388#define OID_FDDI_IF_MTU 0x0303027B
389#define OID_FDDI_IF_SPEED 0x0303027C
390#define OID_FDDI_IF_PHYS_ADDRESS 0x0303027D
391#define OID_FDDI_IF_ADMIN_STATUS 0x0303027E
392#define OID_FDDI_IF_OPER_STATUS 0x0303027F
393#define OID_FDDI_IF_LAST_CHANGE 0x03030280
394#define OID_FDDI_IF_IN_OCTETS 0x03030281
395#define OID_FDDI_IF_IN_UCAST_PKTS 0x03030282
396#define OID_FDDI_IF_IN_NUCAST_PKTS 0x03030283
397#define OID_FDDI_IF_IN_DISCARDS 0x03030284
398#define OID_FDDI_IF_IN_ERRORS 0x03030285
399#define OID_FDDI_IF_IN_UNKNOWN_PROTOS 0x03030286
400#define OID_FDDI_IF_OUT_OCTETS 0x03030287
401#define OID_FDDI_IF_OUT_UCAST_PKTS 0x03030288
402#define OID_FDDI_IF_OUT_NUCAST_PKTS 0x03030289
403#define OID_FDDI_IF_OUT_DISCARDS 0x0303028A
404#define OID_FDDI_IF_OUT_ERRORS 0x0303028B
405#define OID_FDDI_IF_OUT_QLEN 0x0303028C
406#define OID_FDDI_IF_SPECIFIC 0x0303028D
407
408//
409// WAN objects
410//
411#define OID_WAN_PERMANENT_ADDRESS 0x04010101
412#define OID_WAN_CURRENT_ADDRESS 0x04010102
413#define OID_WAN_QUALITY_OF_SERVICE 0x04010103
414#define OID_WAN_PROTOCOL_TYPE 0x04010104
415#define OID_WAN_MEDIUM_SUBTYPE 0x04010105
416#define OID_WAN_HEADER_FORMAT 0x04010106
417#define OID_WAN_GET_INFO 0x04010107
418#define OID_WAN_SET_LINK_INFO 0x04010108
419#define OID_WAN_GET_LINK_INFO 0x04010109
420#define OID_WAN_LINE_COUNT 0x0401010A
421#define OID_WAN_GET_BRIDGE_INFO 0x0401020A
422#define OID_WAN_SET_BRIDGE_INFO 0x0401020B
423#define OID_WAN_GET_COMP_INFO 0x0401020C
424#define OID_WAN_SET_COMP_INFO 0x0401020D
425#define OID_WAN_GET_STATS_INFO 0x0401020E
426
427//
428// LocalTalk objects
429//
430#define OID_LTALK_CURRENT_NODE_ID 0x05010102
431#define OID_LTALK_IN_BROADCASTS 0x05020101
432#define OID_LTALK_IN_LENGTH_ERRORS 0x05020102
433#define OID_LTALK_OUT_NO_HANDLERS 0x05020201
434#define OID_LTALK_COLLISIONS 0x05020202
435#define OID_LTALK_DEFERS 0x05020203
436#define OID_LTALK_NO_DATA_ERRORS 0x05020204
437#define OID_LTALK_RANDOM_CTS_ERRORS 0x05020205
438#define OID_LTALK_FCS_ERRORS 0x05020206
439
440//
441// Arcnet objects
442//
443#define OID_ARCNET_PERMANENT_ADDRESS 0x06010101
444#define OID_ARCNET_CURRENT_ADDRESS 0x06010102
445#define OID_ARCNET_RECONFIGURATIONS 0x06020201
446
447//
448// TAPI objects
449//
450#define OID_TAPI_ACCEPT 0x07030101
451#define OID_TAPI_ANSWER 0x07030102
452#define OID_TAPI_CLOSE 0x07030103
453#define OID_TAPI_CLOSE_CALL 0x07030104
454#define OID_TAPI_CONDITIONAL_MEDIA_DETECTION 0x07030105
455#define OID_TAPI_CONFIG_DIALOG 0x07030106
456#define OID_TAPI_DEV_SPECIFIC 0x07030107
457#define OID_TAPI_DIAL 0x07030108
458#define OID_TAPI_DROP 0x07030109
459#define OID_TAPI_GET_ADDRESS_CAPS 0x0703010A
460#define OID_TAPI_GET_ADDRESS_ID 0x0703010B
461#define OID_TAPI_GET_ADDRESS_STATUS 0x0703010C
462#define OID_TAPI_GET_CALL_ADDRESS_ID 0x0703010D
463#define OID_TAPI_GET_CALL_INFO 0x0703010E
464#define OID_TAPI_GET_CALL_STATUS 0x0703010F
465#define OID_TAPI_GET_DEV_CAPS 0x07030110
466#define OID_TAPI_GET_DEV_CONFIG 0x07030111
467#define OID_TAPI_GET_EXTENSION_ID 0x07030112
468#define OID_TAPI_GET_ID 0x07030113
469#define OID_TAPI_GET_LINE_DEV_STATUS 0x07030114
470#define OID_TAPI_MAKE_CALL 0x07030115
471#define OID_TAPI_NEGOTIATE_EXT_VERSION 0x07030116
472#define OID_TAPI_OPEN 0x07030117
473#define OID_TAPI_PROVIDER_INITIALIZE 0x07030118
474#define OID_TAPI_PROVIDER_SHUTDOWN 0x07030119
475#define OID_TAPI_SECURE_CALL 0x0703011A
476#define OID_TAPI_SELECT_EXT_VERSION 0x0703011B
477#define OID_TAPI_SEND_USER_USER_INFO 0x0703011C
478#define OID_TAPI_SET_APP_SPECIFIC 0x0703011D
479#define OID_TAPI_SET_CALL_PARAMS 0x0703011E
480#define OID_TAPI_SET_DEFAULT_MEDIA_DETECTION 0x0703011F
481#define OID_TAPI_SET_DEV_CONFIG 0x07030120
482#define OID_TAPI_SET_MEDIA_MODE 0x07030121
483#define OID_TAPI_SET_STATUS_MESSAGES 0x07030122
484#define OID_TAPI_GATHER_DIGITS 0x07030123
485#define OID_TAPI_MONITOR_DIGITS 0x07030124
486
487//
488// ATM Connection Oriented Ndis
489//
490#define OID_ATM_SUPPORTED_VC_RATES 0x08010101
491#define OID_ATM_SUPPORTED_SERVICE_CATEGORY 0x08010102
492#define OID_ATM_SUPPORTED_AAL_TYPES 0x08010103
493#define OID_ATM_HW_CURRENT_ADDRESS 0x08010104
494#define OID_ATM_MAX_ACTIVE_VCS 0x08010105
495#define OID_ATM_MAX_ACTIVE_VCI_BITS 0x08010106
496#define OID_ATM_MAX_ACTIVE_VPI_BITS 0x08010107
497#define OID_ATM_MAX_AAL0_PACKET_SIZE 0x08010108
498#define OID_ATM_MAX_AAL1_PACKET_SIZE 0x08010109
499#define OID_ATM_MAX_AAL34_PACKET_SIZE 0x0801010A
500#define OID_ATM_MAX_AAL5_PACKET_SIZE 0x0801010B
501#define OID_ATM_SIGNALING_VPIVCI 0x08010201
502#define OID_ATM_ASSIGNED_VPI 0x08010202
503#define OID_ATM_ACQUIRE_ACCESS_NET_RESOURCES 0x08010203
504#define OID_ATM_RELEASE_ACCESS_NET_RESOURCES 0x08010204
505#define OID_ATM_ILMI_VPIVCI 0x08010205
506#define OID_ATM_DIGITAL_BROADCAST_VPIVCI 0x08010206
507#define OID_ATM_GET_NEAREST_FLOW 0x08010207
508#define OID_ATM_ALIGNMENT_REQUIRED 0x08010208
509
510//
511// ATM specific statistics OIDs.
512//
513#define OID_ATM_RCV_CELLS_OK 0x08020101
514#define OID_ATM_XMIT_CELLS_OK 0x08020102
515#define OID_ATM_RCV_CELLS_DROPPED 0x08020103
516#define OID_ATM_RCV_INVALID_VPI_VCI 0x08020201
517#define OID_ATM_CELLS_HEC_ERROR 0x08020202
518#define OID_ATM_RCV_REASSEMBLY_ERROR 0x08020203
519
520//
521// PCCA (Wireless) object
522//
523//
524// All WirelessWAN devices must support the following OIDs
525//
526#define OID_WW_GEN_NETWORK_TYPES_SUPPORTED 0x09010101
527#define OID_WW_GEN_NETWORK_TYPE_IN_USE 0x09010102
528#define OID_WW_GEN_HEADER_FORMATS_SUPPORTED 0x09010103
529#define OID_WW_GEN_HEADER_FORMAT_IN_USE 0x09010104
530#define OID_WW_GEN_INDICATION_REQUEST 0x09010105
531#define OID_WW_GEN_DEVICE_INFO 0x09010106
532#define OID_WW_GEN_OPERATION_MODE 0x09010107
533#define OID_WW_GEN_LOCK_STATUS 0x09010108
534#define OID_WW_GEN_DISABLE_TRANSMITTER 0x09010109
535#define OID_WW_GEN_NETWORK_ID 0x0901010A
536#define OID_WW_GEN_PERMANENT_ADDRESS 0x0901010B
537#define OID_WW_GEN_CURRENT_ADDRESS 0x0901010C
538#define OID_WW_GEN_SUSPEND_DRIVER 0x0901010D
539#define OID_WW_GEN_BASESTATION_ID 0x0901010E
540#define OID_WW_GEN_CHANNEL_ID 0x0901010F
541#define OID_WW_GEN_ENCRYPTION_SUPPORTED 0x09010110
542#define OID_WW_GEN_ENCRYPTION_IN_USE 0x09010111
543#define OID_WW_GEN_ENCRYPTION_STATE 0x09010112
544#define OID_WW_GEN_CHANNEL_QUALITY 0x09010113
545#define OID_WW_GEN_REGISTRATION_STATUS 0x09010114
546#define OID_WW_GEN_RADIO_LINK_SPEED 0x09010115
547#define OID_WW_GEN_LATENCY 0x09010116
548#define OID_WW_GEN_BATTERY_LEVEL 0x09010117
549#define OID_WW_GEN_EXTERNAL_POWER 0x09010118
550
551//
552// Network Dependent OIDs - Mobitex:
553//
554#define OID_WW_MBX_SUBADDR 0x09050101
555
556#define OID_WW_MBX_FLEXLIST 0x09050103
557#define OID_WW_MBX_GROUPLIST 0x09050104
558#define OID_WW_MBX_TRAFFIC_AREA 0x09050105
559#define OID_WW_MBX_LIVE_DIE 0x09050106
560#define OID_WW_MBX_TEMP_DEFAULTLIST 0x09050107
561
562//
563// Network Dependent OIDs - Pinpoint:
564//
565#define OID_WW_PIN_LOC_AUTHORIZE 0x09090101
566#define OID_WW_PIN_LAST_LOCATION 0x09090102
567#define OID_WW_PIN_LOC_FIX 0x09090103
568
569//
570// Network Dependent - CDPD:
571//
572#define OID_WW_CDPD_SPNI 0x090D0101
573#define OID_WW_CDPD_WASI 0x090D0102
574#define OID_WW_CDPD_AREA_COLOR 0x090D0103
575#define OID_WW_CDPD_TX_POWER_LEVEL 0x090D0104
576#define OID_WW_CDPD_EID 0x090D0105
577#define OID_WW_CDPD_HEADER_COMPRESSION 0x090D0106
578#define OID_WW_CDPD_DATA_COMPRESSION 0x090D0107
579#define OID_WW_CDPD_CHANNEL_SELECT 0x090D0108
580#define OID_WW_CDPD_CHANNEL_STATE 0x090D0109
581#define OID_WW_CDPD_NEI 0x090D010A
582#define OID_WW_CDPD_NEI_STATE 0x090D010B
583#define OID_WW_CDPD_SERVICE_PROVIDER_IDENTIFIER 0x090D010C
584#define OID_WW_CDPD_SLEEP_MODE 0x090D010D
585#define OID_WW_CDPD_CIRCUIT_SWITCHED 0x090D010E
586#define OID_WW_CDPD_TEI 0x090D010F
587#define OID_WW_CDPD_RSSI 0x090D0110
588
589//
590// Network Dependent - Ardis:
591//
592#define OID_WW_ARD_SNDCP 0x09110101
593#define OID_WW_ARD_TMLY_MSG 0x09110102
594#define OID_WW_ARD_DATAGRAM 0x09110103
595
596//
597// Network Dependent - DataTac:
598//
599#define OID_WW_TAC_COMPRESSION 0x09150101
600#define OID_WW_TAC_SET_CONFIG 0x09150102
601#define OID_WW_TAC_GET_STATUS 0x09150103
602#define OID_WW_TAC_USER_HEADER 0x09150104
603
604//
605// Network Dependent - Metricom:
606//
607#define OID_WW_MET_FUNCTION 0x09190101
608
609//
610// IRDA objects
611//
612#define OID_IRDA_RECEIVING 0x0A010100
613#define OID_IRDA_TURNAROUND_TIME 0x0A010101
614#define OID_IRDA_SUPPORTED_SPEEDS 0x0A010102
615#define OID_IRDA_LINK_SPEED 0x0A010103
616#define OID_IRDA_MEDIA_BUSY 0x0A010104
617#define OID_IRDA_EXTRA_RCV_BOFS 0x0A010200
618#define OID_IRDA_RATE_SNIFF 0x0A010201
619#define OID_IRDA_UNICAST_LIST 0x0A010202
620#define OID_IRDA_MAX_UNICAST_LIST_SIZE 0x0A010203
621#define OID_IRDA_MAX_RECEIVE_WINDOW_SIZE 0x0A010204
622#define OID_IRDA_MAX_SEND_WINDOW_SIZE 0x0A010205
623
624/*
625 * Copied and adapted from WiresShark:
626 */
627
628/* 802.11 OIDs */
629#define OID_802_11_BSSID 0x0D010101
630#define OID_802_11_SSID 0x0D010102
631#define OID_802_11_NETWORK_TYPES_SUPPORTED 0x0D010203
632#define OID_802_11_NETWORK_TYPE_IN_USE 0x0D010204
633#define OID_802_11_TX_POWER_LEVEL 0x0D010205
634#define OID_802_11_RSSI 0x0D010206
635#define OID_802_11_RSSI_TRIGGER 0x0D010207
636#define OID_802_11_INFRASTRUCTURE_MODE 0x0D010108
637#define OID_802_11_FRAGMENTATION_THRESHOLD 0x0D010209
638#define OID_802_11_RTS_THRESHOLD 0x0D01020A
639#define OID_802_11_NUMBER_OF_ANTENNAS 0x0D01020B
640#define OID_802_11_RX_ANTENNA_SELECTED 0x0D01020C
641#define OID_802_11_TX_ANTENNA_SELECTED 0x0D01020D
642#define OID_802_11_SUPPORTED_RATES 0x0D01020E
643#define OID_802_11_DESIRED_RATES 0x0D010210
644#define OID_802_11_CONFIGURATION 0x0D010211
645#define OID_802_11_STATISTICS 0x0D020212
646#define OID_802_11_ADD_WEP 0x0D010113
647#define OID_802_11_REMOVE_WEP 0x0D010114
648#define OID_802_11_DISASSOCIATE 0x0D010115
649#define OID_802_11_POWER_MODE 0x0D010216
650#define OID_802_11_BSSID_LIST 0x0D010217
651#define OID_802_11_AUTHENTICATION_MODE 0x0D010118
652#define OID_802_11_PRIVACY_FILTER 0x0D010119
653#define OID_802_11_BSSID_LIST_SCAN 0x0D01011A
654#define OID_802_11_WEP_STATUS 0x0D01011B
655
656#define OID_802_11_ENCRYPTION_STATUS OID_802_11_WEP_STATUS
657#define OID_802_11_RELOAD_DEFAULTS 0x0D01011C
658#define OID_802_11_ADD_KEY 0x0D01011D
659#define OID_802_11_REMOVE_KEY 0x0D01011E
660#define OID_802_11_ASSOCIATION_INFORMATION 0x0D01011F
661#define OID_802_11_TEST 0x0D010120
662#define OID_802_11_CAPABILITY 0x0D010122
663#define OID_802_11_PMKID 0x0D010123
664
665/* PnP and power management OIDs */
666#define OID_PNP_CAPABILITIES 0xFD010100
667#define OID_PNP_SET_POWER 0xFD010101
668#define OID_PNP_QUERY_POWER 0xFD010102
669#define OID_PNP_ADD_WAKE_UP_PATTERN 0xFD010103
670#define OID_PNP_REMOVE_WAKE_UP_PATTERN 0xFD010104
671#define OID_PNP_WAKE_UP_PATTERN_LIST 0xFD010105
672#define OID_PNP_ENABLE_WAKE_UP 0xFD010106
673
674/* TCP/IP OIDs */
675#define OID_TCP_TASK_OFFLOAD 0xFC010201
676#define OID_TCP_TASK_IPSEC_ADD_SA 0xFC010202
677#define OID_TCP_TASK_IPSEC_DELETE_SA 0xFC010203
678#define OID_TCP_SAN_SUPPORT 0xFC010204
679#define OID_TCP_TASK_IPSEC_ADD_UDPESP_SA 0xFC010205
680#define OID_TCP_TASK_IPSEC_DELETE_UDPESP_SA 0xFC010206
681#define OID_TCP4_OFFLOAD_STATS 0xFC010207
682#define OID_TCP6_OFFLOAD_STATS 0xFC010208
683#define OID_IP4_OFFLOAD_STATS 0xFC010209
684#define OID_IP6_OFFLOAD_STATS 0xFC01020A
685
686//
687// Medium the Ndis Driver is running on (OID_GEN_MEDIA_SUPPORTED/
688// OID_GEN_MEDIA_IN_USE).
689//
690typedef enum _NDIS_MEDIUM {
691 NdisMedium802_3,
692 NdisMedium802_5,
693 NdisMediumFddi,
694 NdisMediumWan,
695 NdisMediumLocalTalk,
696 NdisMediumDix, // defined for convenience, not a real medium
697 NdisMediumArcnetRaw,
698 NdisMediumArcnet878_2,
699 NdisMediumAtm,
700 NdisMediumWirelessWan,
701 NdisMediumIrda,
702 NdisMediumBpc,
703 NdisMediumCoWan,
704 NdisMedium1394,
705 NdisMediumInfiniBand,
706 NdisMediumTunnel,
707 NdisMediumNative802_11,
708 NdisMediumLoopback,
709 NdisMediumWiMAX,
710 NdisMediumIP,
711 NdisMediumCHDLC,
712 NdisMediumPPPSerial,
713 NdisMediumMax // Not a real medium, defined as an upper-bound
714} NDIS_MEDIUM, *PNDIS_MEDIUM;
715
716//
717// Hardware status codes (OID_GEN_HARDWARE_STATUS).
718//
719typedef enum _NDIS_HARDWARE_STATUS {
720 NdisHardwareStatusReady,
721 NdisHardwareStatusInitializing,
722 NdisHardwareStatusReset,
723 NdisHardwareStatusClosing,
724 NdisHardwareStatusNotReady
725} NDIS_HARDWARE_STATUS, *PNDIS_HARDWARE_STATUS;
726
727//
728// this is the type passed in the OID_GEN_GET_TIME_CAPS request
729//
730typedef struct _GEN_GET_TIME_CAPS {
731 ULONG Flags; // Bits defined below
732 ULONG ClockPrecision;
733} GEN_GET_TIME_CAPS, *PGEN_GET_TIME_CAPS;
734
735#define READABLE_LOCAL_CLOCK 0x000000001
736#define CLOCK_NETWORK_DERIVED 0x000000002
737#define CLOCK_PRECISION 0x000000004
738#define RECEIVE_TIME_INDICATION_CAPABLE 0x000000008
739#define TIMED_SEND_CAPABLE 0x000000010
740#define TIME_STAMP_CAPABLE 0x000000020
741
742//
743// this is the type passed in the OID_GEN_GET_NETCARD_TIME request
744//
745typedef struct _GEN_GET_NETCARD_TIME {
746 ULONG ReadTime;
747} GEN_GET_NETCARD_TIME, *PGEN_GET_NETCARD_TIME;
748
749//
750// Defines the attachment types for FDDI (OID_FDDI_ATTACHMENT_TYPE).
751//
752typedef enum _NDIS_FDDI_ATTACHMENT_TYPE {
753 NdisFddiTypeIsolated = 1,
754 NdisFddiTypeLocalA,
755 NdisFddiTypeLocalB,
756 NdisFddiTypeLocalAB,
757 NdisFddiTypeLocalS,
758 NdisFddiTypeWrapA,
759 NdisFddiTypeWrapB,
760 NdisFddiTypeWrapAB,
761 NdisFddiTypeWrapS,
762 NdisFddiTypeCWrapA,
763 NdisFddiTypeCWrapB,
764 NdisFddiTypeCWrapS,
765 NdisFddiTypeThrough
766} NDIS_FDDI_ATTACHMENT_TYPE, *PNDIS_FDDI_ATTACHMENT_TYPE;
767
768//
769// Defines the ring management states for FDDI (OID_FDDI_RING_MGT_STATE).
770//
771typedef enum _NDIS_FDDI_RING_MGT_STATE {
772 NdisFddiRingIsolated = 1,
773 NdisFddiRingNonOperational,
774 NdisFddiRingOperational,
775 NdisFddiRingDetect,
776 NdisFddiRingNonOperationalDup,
777 NdisFddiRingOperationalDup,
778 NdisFddiRingDirected,
779 NdisFddiRingTrace
780} NDIS_FDDI_RING_MGT_STATE, *PNDIS_FDDI_RING_MGT_STATE;
781
782//
783// Defines the Lconnection state for FDDI (OID_FDDI_LCONNECTION_STATE).
784//
785typedef enum _NDIS_FDDI_LCONNECTION_STATE {
786 NdisFddiStateOff = 1,
787 NdisFddiStateBreak,
788 NdisFddiStateTrace,
789 NdisFddiStateConnect,
790 NdisFddiStateNext,
791 NdisFddiStateSignal,
792 NdisFddiStateJoin,
793 NdisFddiStateVerify,
794 NdisFddiStateActive,
795 NdisFddiStateMaintenance
796} NDIS_FDDI_LCONNECTION_STATE, *PNDIS_FDDI_LCONNECTION_STATE;
797
798//
799// Defines the medium subtypes for WAN medium (OID_WAN_MEDIUM_SUBTYPE).
800//
801typedef enum _NDIS_WAN_MEDIUM_SUBTYPE {
802 NdisWanMediumHub,
803 NdisWanMediumX_25,
804 NdisWanMediumIsdn,
805 NdisWanMediumSerial,
806 NdisWanMediumFrameRelay,
807 NdisWanMediumAtm,
808 NdisWanMediumSonet,
809 NdisWanMediumSW56K
810} NDIS_WAN_MEDIUM_SUBTYPE, *PNDIS_WAN_MEDIUM_SUBTYPE;
811
812//
813// Defines the header format for WAN medium (OID_WAN_HEADER_FORMAT).
814//
815typedef enum _NDIS_WAN_HEADER_FORMAT {
816 NdisWanHeaderNative, // src/dest based on subtype, followed by NLPID
817 NdisWanHeaderEthernet // emulation of ethernet header
818} NDIS_WAN_HEADER_FORMAT, *PNDIS_WAN_HEADER_FORMAT;
819
820//
821// Defines the line quality on a WAN line (OID_WAN_QUALITY_OF_SERVICE).
822//
823typedef enum _NDIS_WAN_QUALITY {
824 NdisWanRaw,
825 NdisWanErrorControl,
826 NdisWanReliable
827} NDIS_WAN_QUALITY, *PNDIS_WAN_QUALITY;
828
829//
830// Defines the state of a token-ring adapter (OID_802_5_CURRENT_RING_STATE).
831//
832typedef enum _NDIS_802_5_RING_STATE {
833 NdisRingStateOpened = 1,
834 NdisRingStateClosed,
835 NdisRingStateOpening,
836 NdisRingStateClosing,
837 NdisRingStateOpenFailure,
838 NdisRingStateRingFailure
839} NDIS_802_5_RING_STATE, *PNDIS_802_5_RING_STATE;
840
841//
842// Defines the state of the LAN media
843//
844typedef enum _NDIS_MEDIA_STATE {
845 NdisMediaStateConnected,
846 NdisMediaStateDisconnected
847} NDIS_MEDIA_STATE, *PNDIS_MEDIA_STATE;
848
849//
850// The following is set on a per-packet basis as OOB data with NdisClass802_3Priority
851//
852typedef ULONG Priority_802_3; // 0-7 priority levels
853
854//
855// The following structure is used to query OID_GEN_CO_LINK_SPEED and
856// OID_GEN_CO_MINIMUM_LINK_SPEED. The first OID will return the current
857// link speed of the adapter. The second will return the minimum link speed
858// the adapter is capable of.
859//
860typedef struct _NDIS_CO_LINK_SPEED {
861 ULONG Outbound;
862 ULONG Inbound;
863} NDIS_CO_LINK_SPEED, *PNDIS_CO_LINK_SPEED;
864
865//
866// Ndis Packet Filter Bits (OID_GEN_CURRENT_PACKET_FILTER).
867//
868#define NDIS_PACKET_TYPE_DIRECTED 0x0001
869#define NDIS_PACKET_TYPE_MULTICAST 0x0002
870#define NDIS_PACKET_TYPE_ALL_MULTICAST 0x0004
871#define NDIS_PACKET_TYPE_BROADCAST 0x0008
872#define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x0010
873#define NDIS_PACKET_TYPE_PROMISCUOUS 0x0020
874#define NDIS_PACKET_TYPE_SMT 0x0040
875#define NDIS_PACKET_TYPE_ALL_LOCAL 0x0080
876#define NDIS_PACKET_TYPE_MAC_FRAME 0x8000
877#define NDIS_PACKET_TYPE_FUNCTIONAL 0x4000
878#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x2000
879#define NDIS_PACKET_TYPE_GROUP 0x1000
880
881//
882// Ndis Token-Ring Ring Status Codes (OID_802_5_CURRENT_RING_STATUS).
883//
884#define NDIS_RING_SIGNAL_LOSS 0x00008000
885#define NDIS_RING_HARD_ERROR 0x00004000
886#define NDIS_RING_SOFT_ERROR 0x00002000
887#define NDIS_RING_TRANSMIT_BEACON 0x00001000
888#define NDIS_RING_LOBE_WIRE_FAULT 0x00000800
889#define NDIS_RING_AUTO_REMOVAL_ERROR 0x00000400
890#define NDIS_RING_REMOVE_RECEIVED 0x00000200
891#define NDIS_RING_COUNTER_OVERFLOW 0x00000100
892#define NDIS_RING_SINGLE_STATION 0x00000080
893#define NDIS_RING_RING_RECOVERY 0x00000040
894
895//
896// Ndis protocol option bits (OID_GEN_PROTOCOL_OPTIONS).
897//
898#define NDIS_PROT_OPTION_ESTIMATED_LENGTH 0x00000001
899#define NDIS_PROT_OPTION_NO_LOOPBACK 0x00000002
900#define NDIS_PROT_OPTION_NO_RSVD_ON_RCVPKT 0x00000004
901
902//
903// Ndis MAC option bits (OID_GEN_MAC_OPTIONS).
904//
905#define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA 0x00000001
906#define NDIS_MAC_OPTION_RECEIVE_SERIALIZED 0x00000002
907#define NDIS_MAC_OPTION_TRANSFERS_NOT_PEND 0x00000004
908#define NDIS_MAC_OPTION_NO_LOOPBACK 0x00000008
909#define NDIS_MAC_OPTION_FULL_DUPLEX 0x00000010
910#define NDIS_MAC_OPTION_EOTX_INDICATION 0x00000020
911#define NDIS_MAC_OPTION_RESERVED 0x80000000
912
913//
914// NDIS MAC option bits for OID_GEN_CO_MAC_OPTIONS.
915//
916#define NDIS_CO_MAC_OPTION_DYNAMIC_LINK_SPEED 0x00000001
917
918//
919// The following is set on a per-packet basis as OOB data with NdisClassIrdaPacketInfo
920// This is the per-packet info specified on a per-packet basis
921//
922typedef struct _NDIS_IRDA_PACKET_INFO {
923 UINT ExtraBOFs;
924 UINT MinTurnAroundTime;
925} NDIS_IRDA_PACKET_INFO, *PNDIS_IRDA_PACKET_INFO;
926
927#endif /* _w32_NTDDNDIS_H */
928
_GEN_GET_NETCARD_TIME
Definition: w32_ndis.h:745
_GEN_GET_TIME_CAPS
Definition: w32_ndis.h:730
_NDIS_CO_LINK_SPEED
Definition: w32_ndis.h:860
_NDIS_IRDA_PACKET_INFO
Definition: w32_ndis.h:922
_NDIS_STATISTICS_VALUE
Definition: w32_ndis.h:68
_NDIS_VAR_DATA_DESC
Definition: w32_ndis.h:90
_NET_PNP_ID
Definition: w32_ndis.h:77
_NET_PNP_TRANSLATE_LIST
Definition: w32_ndis.h:82


Watt-32 tcp/ip: E:/WATT/inc/sys/w32api.h Source File

  • inc
  • sys
w32api.h
Go to the documentation of this file.
1
5#ifndef __SYS_W32API_H
6#define __SYS_W32API_H
7
8#if !defined(_WATT32_FAKE_WINSOCK_H) && (defined(_WINSOCK_H) || defined(_WINSOCKAPI_))
9 #error Never include the real <winsock.h> in Watt-32 programs.
10 #error Change your include-path so the fake <winsock.h> gets included first.
11 #error E.g. add "-I$(WATT_ROOT)/inc -I$(WATT_ROOT)/inc/w32-fakes" to your CFLAGS.
12#endif
13
14#if !defined(_WATT32_FAKE_WINSOCK2_H) && (defined(_WINSOCK2_H) || defined(_WINSOCK2API_))
15 #error Never include the real <winsock2.h> in Watt-32 programs.
16 #error Change your include-path so the fake <winsock2.h> gets included first.
17 #error E.g. add "-I$(WATT_ROOT)/inc -I$(WATT_ROOT)/inc/w32-fakes" to your CFLAGS.
18#endif
19
20#if !defined(_WATT32_FAKE_WS2TCPIP_H) && defined(_WS2TCPIP_H)
21 #error Never include the real <ws2tcpip.h> in Watt-32 programs.
22 #error Change your include-path so the fake <ws2tcpip.h> gets included first.
23 #error E.g. add "-I$(WATT_ROOT)/inc -I$(WATT_ROOT)/inc/w32-fakes" to your CFLAGS.
24#endif
25
32#if defined(WATT32_NO_NAMESPACE)
33 #undef W32_NAMESPACE
34 #define W32_NAMESPACE(x) x
35#else
36 #ifndef W32_NAMESPACE
37 #define W32_NAMESPACE(x) _w32_ ## x
38 #endif
39#endif
40
41/*
42 * A C preprocess test using TDM-gcc with djgpp headers.
43 */
44#if defined(WATT32_DJGPP_MINGW) && 0
45 #undef WIN32
46 #undef _WIN32
47 #undef WIN64
48 #undef _WIN64
49
50 #undef __MINGW32__
51 #undef __MINGW32_VERSION
52 #undef __MINGW32_MAJOR_VERSION
53 #undef __MINGW32_MINOR_VERSION
54 #undef __MINGW64_VERSION_MAJOR
55 #undef __MINGW64_VERSION_MINOR
56#endif
57
58/*
59 * Watt-32 should never assume WIN32/WIN64 (or _WIN32/_WIN64) is set for
60 * CygWin. It is not defined unless you include <windows.h> first (which
61 * we only do in 1 place. See below).
62 */
63#if (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)) || \
64 defined(__CYGWIN__)
65
66 #if defined(__DJGPP__)
67 // #error WIN32 defined for Djgpp?
68 #endif
69
70 /* Don't include the real <winsock*.h>
71 */
72 #define _WINSOCKAPI_ /* MSVC/DMC/Watcom/Borland/CygWin header guard names */
73 #define _WINSOCK2API_
74 #define _WINSOCK_H /* MinGW header guard names */
75 #define _WINSOCK2_H
76
77 #ifndef WATT32_ON_WINDOWS
78 #define WATT32_ON_WINDOWS
79 #endif
80
81 /* Needed here since CygWin's <errno.h> gets included in <windows.h> below.
82 * Otherwise the shadow "../inc/errno.h" would cause 'W32_DATA' etc. never
83 * to be defined before use in "../inc/werrno.h". A bit of a mess, but
84 * needed since CygWin's errnos must be handled specially. I.e. CygWin
85 * have all needed errnos we need. Thus there is no need for a special
86 * '../util/cygwin_err.exe' program or a '$(WATT_ROOT)/inc/sys/cygwin.err'
87 * file.
88 */
89 #if defined(__CYGWIN__)
90 #include_next <sys/errno.h>
91 #endif
92#endif
93
94
95/*
96 * For all Windows targets, we export functions and data prefixed with
97 * 'W32_FUNC' or 'W32_DATA'. Unless we use the static Watt-32 library
98 * (./lib/libwatt32.a). Using the static lib requires that the user to
99 * add '-DWATT32_STATIC' to the CFLAGS.
100 *
101 * For non-Win32 targets the .\util\mkimp program (a small C-preprocessor)
102 * is meant to search all headers for W32_FUNC/W32_DATA prefixes. All
103 * functions with a W32_FUNC prefix will produce an export stub function.
104 * See dj_dxe.mak. Very experimental at the moment.
105 *
106 * \note: only a small subset of the Winsock extensions are implemented in
107 * watt-32.dll (hardly any WSA*() functions yet).
108 *
109 * \note: 'W32_CALL' is something else. It defines calling-convention
110 * Ref. <sys/cdefs.h>.
111 */
112#if defined(WATT32_ON_WINDOWS) && !defined(WATT32_STATIC)
113 #if defined(WATT32_BUILD)
114 #define W32_FUNC extern __declspec(dllexport)
115 #define W32_DATA extern __declspec(dllexport)
116 #else
117 #define W32_FUNC extern __declspec(dllimport)
118 #define W32_DATA extern __declspec(dllimport)
119 #endif
120#else
121 #define W32_FUNC extern
122 #define W32_DATA extern
123#endif
124
125/*
126 * W32_CALL is defined to `__cdecl' to ease the interface
127 * to OpenWatcom which uses register calls (-3r) as default.
128 *
129 * So it should be possible to use e.g. a MSVC linked watt-32.dll
130 * with a Watcom / MinGW / CygWin compiled program.
131 */
132#if defined(WATT32_ON_WINDOWS)
133 #define W32_CALL __cdecl
134#else
135 #define W32_CALL
136#endif
137
138#if defined(WATT32_ON_WINDOWS)
139 /*
140 * This should be the only place <windows.h> is included for Windows targets.
141 * Due to the organisation of the CygWin headers, <windows.h> must be here.
142 */
143 #include <windows.h>
144#endif
145
146/*
147 * CygWin hacks:
148 * Seems no longer a need for this.
149 */
150#if defined(__CYGWIN__) && defined(WATT32_BUILD) && 0
151 #if !defined(WIN32) && defined(__i386__)
152 #error "WIN32 should only be defined in wattcp.h included before this point."
153
154 #elif !defined(WIN64) && defined(__x86_64__)
155 #error "WIN64 should only be defined in wattcp.h included before this point."
156 #endif
157
158 #include <sys/time.h>
159#endif
160
161#endif /* __SYS_W32API_H */
162


Watt-32 tcp/ip: E:/WATT/src/wattcp.c Source File

  • src
wattcp.c
Go to the documentation of this file.
1
4#ifdef __HIGHC__
5
6#if __HIGHC__ <= 0x0331
7#include <language.cf>
8#endif
9
10#include "wattcp.h"
11#include "misc.h"
12#include "misc_str.h"
13
14#pragma Calling_convention(PASCAL)
15#define DLL_PROCESS_DETACH 0
16#define DLL_PROCESS_ATTACH 1
17
18/*
19 * For imported data, we redefine the imported name with the
20 * -import switch when linking, and then use a macro to dereference
21 * the imported name to get to the real variable.
22 */
23
24#define IMP_PREFIX(name) __imp_##name
25#define IMPVAR(name,type) (***(type ***)((BYTE*)(&IMP_PREFIX(name))+2))
26
27DWORD DllEntryPoint (void *hDll, DWORD reason, void *reserved)
28{
29#if defined(USE_DEBUG)
30 if (reason == DLL_PROCESS_ATTACH)
31 outs ("WATTCP.DLL: Process attach\n"); /* cannot use _LANG() here */
32#endif
33 ARGSUSED (hDll);
34 ARGSUSED (reserved);
35 return (1);
36}
37
38#endif /* __HIGHC__ */
misc.h
misc_str.h
wattcp.h
Core definitions.


Watt-32 tcp/ip: E:/WATT/src/wattcp.h Source File

  • src
wattcp.h
Go to the documentation of this file.
1#ifndef _w32_WATTCP_H
2#define _w32_WATTCP_H
3
16#if defined(WIN64) || defined(_WIN64)
17 #undef WIN64
18 #undef _WIN64
19 #define WIN64 1
20 #define _WIN64 1
21
22#elif defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
23 #undef WIN32
24 #undef _WIN32
25 #define WIN32 1
26 #define _WIN32 1
27#endif
28
29#if defined(__CYGWIN__) && defined(__x86_64__)
30 #define WIN64 1
31 #define _WIN64 1
32#endif
33
34#if defined(WIN32) || defined(WIN64)
35 /*
36 * This must come before "target.h".
37 * Prevent including <winsock*.h> and other seldom used headers.
38 */
39 #ifndef WIN32_LEAN_AND_MEAN
40 #define WIN32_LEAN_AND_MEAN 1
41 #endif
42
43 /*
44 * Required for bsdname.c, winpkt.c and timer.c
45 */
46 #if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0501)
47 #undef _WIN32_WINNT
48 #define _WIN32_WINNT 0x0501
49 #endif
50
51 #define WATT32_ON_WINDOWS
52#endif
53
54#ifndef WATT32_BUILD
55#define WATT32_BUILD
56#endif
57
58#include <sys/w32api.h>
59#include <sys/wtypes.h>
60#include <sys/wtime.h>
64#if defined(__HIGHC__) || defined(__GNUC__) || defined(__POCC__) || defined(__ORANGEC__)
65 typedef unsigned long long uint64;
66 typedef long long int64;
67 #define HAVE_UINT64
69#elif defined(__DMC__) && (__INTSIZE == 4)
70 typedef unsigned long long uint64;
71 typedef long long int64;
72 #define HAVE_UINT64
73
74#elif defined(__WATCOMC__) && defined(__WATCOM_INT64__)
75 typedef unsigned __int64 uint64;
76 typedef __int64 int64;
77 #define HAVE_UINT64
78
79#elif defined(_MSC_VER) && (_MSC_VER >= 900)
80 typedef unsigned __int64 uint64;
81 typedef __int64 int64;
82 #define HAVE_UINT64
83
84#elif defined(__BORLANDC__) && defined(WIN32)
85 typedef unsigned __int64 uint64;
86 typedef __int64 int64;
87 #define HAVE_UINT64
88#endif
89
90struct ulong_long {
91 DWORD lo;
92 DWORD hi;
93 };
94
95/* On Win32/VC9+: typedef __w64 LONG DWORD_PTR;
96 */
97#if !defined(WIN32) && !defined(WIN64)
98 #define DWORD_PTR DWORD
99 #define IntToPtr(i) ((void*)(unsigned)(i))
100#endif
101
102#if defined(__DMC__)
103 #if !defined(ULONG_PTR)
104 #ifdef _WIN64
105 #define ULONG_PTR unsigned long long
106 #else
107 #define ULONG_PTR unsigned long
108 #endif
109 #endif
110
111 #if !defined(DWORD_PTR)
112 #define DWORD_PTR ULONG_PTR
113 #endif
114
115 #if !defined(ULONG64)
116 #define ULONG64 ULONG_PTR
117 #endif
118#endif
119
120
121/* Compiling with "cl -RTCc" causes "Run-Time Check Failure" -
122 * A cast to a smaller data type has caused a loss of data. If this
123 * was intentional, you should mask the source of the cast with the appropriate bitmask.
124 *
125 * Hence these macros does that. But don't use '-RTCc' in release mode (-MD).
126 */
127
128#if defined(_MSC_VER) && defined(_DEBUG)
129 #define loBYTE(w) (BYTE)((w) & 0xFF)
130 #define hiBYTE(w) (BYTE)((WORD)((w) & 0xFF00) >> 8)
131 #define loWORD(x) (WORD)((x) & 0xFFFF)
132 #define hiWORD(x) ((WORD)((x) & 0xFFFF0000) >> 16)
133
134#else
135 #define loBYTE(w) (BYTE)(w)
136 #define hiBYTE(w) (BYTE)((WORD)(w) >> 8)
137 #define loWORD(x) (WORD)(x)
138 #define hiWORD(x) (WORD)((WORD)(w) >> 16)
139#endif
140
141#define DIM(x) (int) (sizeof(x) / sizeof((x)[0]))
142#define SIZEOF(x) (int) sizeof(x)
143
144#define ARGSUSED(foo) (void)foo
145#define ATOI(x) atoi (x)
146#define ATOL(x) atol (x)
147
151#include "target.h"
152#include "config.h"
154#if defined(SWIG) && defined(USE_IPV6)
155 #error "Swig and 'USE_IPV6' does not work at the moment. Edit $(WATT_ROOT)/config.h to NOT define USE_IPV6"
156#endif
157
158#if (DOSX)
159 #define TARGET_IS_32BIT
160#endif
161
162#if defined(USE_CRTDBG)
163 #define _CRTDBG_MAP_ALLOC
164 #undef _malloca /* Avoid MSVC-9 <malloc.h>/<crtdbg.h> name-clash */
165 #include <crtdbg.h>
166#endif
167
168#ifndef FALSE
169#define FALSE 0
170#endif
171
172#ifndef TRUE
173#define TRUE (!FALSE)
174#endif
175
176
180#define ETH_MAX_DATA 1500
181#define ETH_MIN 60
182#define ETH_MAX (ETH_MAX_DATA + sizeof(eth_Header)) /* == 1514 */
183
184#define TOK_MAX_DATA ETH_MAX_DATA /* could be much larger */
185#define TOK_MIN sizeof(tok_Header) /* == 22 */
186#define TOK_MAX (TOK_MAX_DATA + sizeof(tok_Header)) /* == 1522 */
187
188#define FDDI_MAX_DATA ETH_MAX_DATA /* really is 4470 */
189#define FDDI_MIN (3 + sizeof(fddi_Header)) /* == 24 */
190#define FDDI_MAX (FDDI_MAX_DATA + sizeof(fddi_Header)) /* == 1521 */
191
192#define ARCNET_MAX_DATA 512 /* Long frame or Exception frame */
193#define ARCNET_MIN 257
194#define ARCNET_MAX (ARCNET_MAX_DATA + sizeof(arcnet_Header)) /* == 522 */
195
196#define AX25_MAX_DATA ETH_MAX_DATA
197#define AX25_MIN sizeof(ax25_Header) /* == 70 */
198#define AX25_MAX (AX25_MAX_DATA + sizeof(ax25_Header)) /* == 1570 */
199
200#define PPPOE_MAX_DATA (ETH_MAX_DATA - 8)
201#define PPPOE_MIN sizeof(pppoe_Header) /* == 6 */
202#define PPPOE_MAX (PPPOE_MAX_DATA + sizeof(pppoe_Header))
203
204#define VLAN_MAX_DATA (ETH_MAX_DATA - 4)
205#define VLAN_MAX (VLAN_MAX_DATA + sizeof(vlan_Header))
206#define VLAN_MIN sizeof(vlan_Header)
207
208#define TCP_OVERHEAD (sizeof(in_Header) + sizeof(tcp_Header))
209#define UDP_OVERHEAD (sizeof(in_Header) + sizeof(udp_Header))
210
211
215#define IP4_TYPE 0x0008
216#define IP6_TYPE 0xDD86
217#define IEEE802_1Q_TYPE 0x0081 /* Virtual LAN */
218#define ARP_TYPE 0x0608
219#define RARP_TYPE 0x3580
220#define PPPOE_DISC_TYPE 0x6388
221#define PPPOE_SESS_TYPE 0x6488
222#define LLDP_TYPE 0xCC88
223
227#define ARCNET_DP_BOOT 0
228#define ARCNET_DP_MOUNT 1
229#define ARCNET_PL_BEACON 8
230#define ARCNET_PL_BEACON2 243
231
232#define ARCNET_DIAG 128
233#define ARCNET_IP6 196
234#define ARCNET_BACNET 205
235#define ARCNET_IP_1201 212
236#define ARCNET_ARP_1201 213
237#define ARCNET_RARP_1201 214
238#define ARCNET_ATALK 221
239#define ARCNET_ETHER 232
240#define ARCNET_NOVELL 236
241#define ARCNET_IP_1051 240
242#define ARCNET_ARP_1051 241
243#define ARCNET_BANYAN 247
244#define ARCNET_IPX 250
245#define ARCNET_LANSOFT 251
246
247#if (DOSX & ATMEL) /* An 8-bit MCU is highly limited on data */
248 #define MAX_FRAGMENTS 1UL
249 #define MAX_WINDOW (32*1024U)
250#elif (DOSX)
251 #define MAX_FRAGMENTS 45UL
252 #define MAX_WINDOW (64*1024U)
253#else
254 #define MAX_FRAGMENTS 30UL
255 #define MAX_WINDOW (32*1024U)
256#endif
257
260#define MAX_IP4_DATA (ETH_MAX_DATA - sizeof(in_Header))
261#define MAX_IP6_DATA (ETH_MAX_DATA - sizeof(in6_Header))
262#define MAX_FRAG_SIZE (MAX_FRAGMENTS * MAX_IP4_DATA)
263
264#define MAX_ADDRESSES 10
265#define MAX_NAMELEN 80
266#define MAX_VALUELEN 80
268#if defined(WIN32) || defined(WIN64)
269 #define MAX_PATHLEN MAX_PATH /* 260 from <windef.h> */
270#else
271 #define MAX_PATHLEN 256
272#endif
273
274#define SAFETY_TCP 0x538F25A3L
275#define SAFETY_UDP 0x3E45E154L
276
280#define UDP_PROTO 17
281#define TCP_PROTO 6
282#define ICMP_PROTO 1
283#define IGMP_PROTO 2
284#define IPCOMP_PROTO 108
285#define SCTP_PROTO 132
286
290#define SOCK_MODE_BINARY 0x01
291#define SOCK_MODE_UDPCHK 0x02
292#define SOCK_MODE_NAGLE 0x04
293#define SOCK_MODE_LOCAL 0x08
294#define SOCK_MODE_SAWCR 0x10
295#define SOCK_MODE_MASK 0x07
302#define LF_WINUPDATE 0x00001
303#define LF_NOPUSH 0x00002
304#define LF_NOOPT 0x00004
305#define LF_REUSEADDR 0x00008
306#define LF_KEEPALIVE 0x00010
307#define LF_LINGER 0x00020
308#define LF_NOCLOSE 0x00040
309#define LF_NO_IPFRAGS 0x00080
310#define LF_OOBINLINE 0x00100
311#define LF_SNDTIMEO 0x00200
312#define LF_RCVTIMEO 0x00400
313#define LF_GOT_FIN 0x00800
314#define LF_GOT_PUSH 0x01000
315#define LF_GOT_ICMP 0x02000
316#define LF_USE_TSTAMP 0x04000
317#define LF_RCVD_SCALE 0x08000
318#define LF_IS_SERVER 0x10000
319#define LF_SACK_PERMIT 0x20000
320
325#define SOCKESTABLISHED 1
326#define SOCKDATAREADY 2
327#define SOCKCLOSED 4
328
329W32_CLANG_PACK_WARN_OFF()
330
331#include <sys/pack_on.h>
337typedef struct in_Header {
338 BYTE hdrlen : 4; /* Watcom _requires_ BYTE here */
339 BYTE ver : 4;
340 BYTE tos;
341 WORD length;
342 WORD identification;
343 WORD frag_ofs;
344 BYTE ttl;
345 BYTE proto;
346 WORD checksum;
347 DWORD source;
348 DWORD destination;
349
350 /* IP options may come here
351 */
352 } in_Header;
353
356#define IP_CE 0x8000
357#define IP_DF 0x4000
358#define IP_MF 0x2000
359#define IP_OFFMASK 0x1FFF
363#define IP_MINCOST 0x02
364#define IP_RELIABILITY 0x04
365#define IP_THROUGHPUT 0x08
366#define IP_LOWDELAY 0x10
367#define IP_TOSMASK (IP_MINCOST|IP_RELIABILITY|IP_THROUGHPUT|IP_LOWDELAY)
368
369#define in_GetHdrLen(ip) ((ip)->hdrlen << 2)
371#define IP_BCAST_ADDR 0xFFFFFFFFUL
372#define CLASS_A_ADDR 0xFF000000UL
373#define CLASS_B_ADDR 0xFFFFFE00UL /* minimal class B */
374#define CLASS_C_ADDR 0xFFFFFF00UL
375
376
381typedef struct in6_Header {
382 BYTE pri : 4;
383 BYTE ver : 4;
384 BYTE flow_lbl[3];
385 WORD len;
386 BYTE next_hdr;
387 BYTE hop_limit;
388 ip6_address source;
389 ip6_address destination;
390 } in6_Header;
391
396typedef struct ip_Packet {
397 in_Header head;
398 BYTE data [MAX_IP4_DATA];
399 } ip_Packet;
400
401
406typedef struct udp_Header {
407 WORD srcPort;
408 WORD dstPort;
409 WORD length;
410 WORD checksum;
411 } udp_Header;
412
413
418typedef struct tcp_Header {
419 WORD srcPort;
420 WORD dstPort;
421 DWORD seqnum;
422 DWORD acknum;
423
424 BYTE unused : 4; /* Watcom _requires_ BYTE here */
425 BYTE offset : 4;
426 BYTE flags;
427 WORD window;
428 WORD checksum;
429 WORD urgent;
430 } tcp_Header;
431
435#define tcp_FlagFIN 0x01
436#define tcp_FlagSYN 0x02
437#define tcp_FlagRST 0x04
438#define tcp_FlagPUSH 0x08
439#define tcp_FlagACK 0x10
440#define tcp_FlagURG 0x20
441#define tcp_FlagECN 0x40 /* ECN-Echo */
442#define tcp_FlagCWR 0x80 /* congestion window reduced */
443#define tcp_FlagMASK 0x3F /* ignore ECN/CWR for now */
444
449typedef struct tcp_PseudoHeader {
450 DWORD src;
451 DWORD dst;
452 BYTE mbz;
453 BYTE protocol;
454 WORD length;
455 WORD checksum;
456 } tcp_PseudoHeader;
457
458
463typedef struct tcp_PseudoHeader6 {
464 ip6_address src;
465 ip6_address dst;
466 WORD length;
467 BYTE zero[3];
468 BYTE next_hdr;
469 } tcp_PseudoHeader6;
470
471
476typedef struct arp_Header {
477 WORD hwType;
478 WORD protType;
479 BYTE hwAddrLen;
480 BYTE protoAddrLen;
481 WORD opcode;
482 eth_address srcEthAddr;
483 DWORD srcIPAddr;
484 eth_address dstEthAddr;
485 DWORD dstIPAddr;
486 } arp_Header;
487
488
489#include <sys/pack_off.h>
491W32_CLANG_PACK_WARN_DEF()
492
493#define rarp_Header arp_Header
494
498#define ARP_REQUEST 0x0100
499#define ARP_REPLY 0x0200
500#define RARP_REQUEST 0x0300
501#define RARP_REPLY 0x0400
502
503
511#define tcp_StateLISTEN 0 /* listening for connection */
512#define tcp_StateRESOLVE 1 /* resolving IP, waiting on ARP reply */
513#define tcp_StateSYNSENT 2 /* SYN sent, active open */
514#define tcp_StateSYNREC 3 /* SYN received, ACK+SYN sent. */
515#define tcp_StateESTAB 4 /* established */
516#define tcp_StateESTCL 5 /* established, but will FIN */
517#define tcp_StateFINWT1 6 /* sent FIN */
518#define tcp_StateFINWT2 7 /* sent FIN, received FINACK */
519#define tcp_StateCLOSWT 8 /* received FIN waiting for close */
520#define tcp_StateCLOSING 9 /* sent FIN, received FIN (waiting for FINACK) */
521#define tcp_StateLASTACK 10 /* FIN received, FINACK+FIN sent */
522#define tcp_StateTIMEWT 11 /* dally after sending final FINACK */
523#define tcp_StateCLOSED 12 /* FIN+ACK received */
524
525#define tcp_MaxBufSize 2048 /* maximum bytes to buffer on input */
526#define udp_MaxBufSize 1520
527#define tcp_MaxTxBufSize tcp_MaxBufSize /* and on tcp output */
528
536#define UDP_TCP_COMMON \
537 WORD ip_type; /* UDP_PROTO,TCP_PROTO or IPx_TYPE */ \
538 BYTE ttl; /* Time To Live */ \
539 BYTE fill_1; \
540 const char *err_msg; /* NULL when all is okay */ \
541 char err_buf [100]; /* room for error message */ \
542 void (W32_CALL *usr_yield) (void); /* yield while waiting */ \
543 icmp_upcall icmp_callb; /* socket-layer callback (icmp) */ \
544 BYTE rigid; \
545 BYTE stress; \
546 WORD sockmode; /* a logical OR of bits */ \
547 WORD fill_2; \
548 DWORD usertimer; /* ip_timer_set, ip_timer_timeout */ \
549 ProtoHandler protoHandler; /* called with incoming data */ \
550 eth_address his_ethaddr; /* peer's ethernet address */ \
551 \
552 DWORD myaddr; /* my IPv4-address */ \
553 DWORD hisaddr; /* peer's IPv4 address */ \
554 WORD hisport; /* peer's source port */ \
555 WORD myport; /* my source port */ \
556 DWORD locflags; /* local option flags */ \
557 BOOL is_ip6; /* TRUE if IPv6 socket */ \
558 int rx_datalen; /* Rx length, must be signed */ \
559 UINT max_rx_data; /* Last index for rx_data[] */ \
560 BYTE *rx_data /* Rx data buffer (default rx_buf[]) */
561
566typedef struct udp_Socket {
567 struct udp_Socket *next;
568 UDP_TCP_COMMON;
569 BYTE rx_buf [udp_MaxBufSize+1];
571#if defined(USE_IPV6)
572 ip6_address my6addr;
573 ip6_address his6addr;
574#endif
575 DWORD safetysig;
576 } _udp_Socket;
577
578
579
584typedef struct tcp_Socket {
585 struct tcp_Socket *next;
586 UDP_TCP_COMMON;
587
588 BYTE rx_buf [tcp_MaxBufSize+1];
590#if defined(USE_IPV6)
591 ip6_address my6addr;
592 ip6_address his6addr;
593#endif
594 UINT state;
595 DWORD recv_next;
596 DWORD send_next;
597 long send_una;
599#if defined(USE_DEBUG)
600 DWORD last_acknum [2];
601 DWORD last_seqnum [2];
602#endif
603 DWORD timeout;
604 BYTE unhappy;
605 BYTE recent;
606 WORD flags;
608 UINT window;
609 UINT adv_win;
611 BYTE cwindow;
612 BYTE wwindow;
613 WORD fill_4;
614
615 DWORD vj_sa;
616 DWORD vj_sd;
617 DWORD vj_last;
618 UINT rto;
619 BYTE karn_count;
620 BYTE tos;
621 WORD fill_5;
622
623 DWORD rtt_time;
624 DWORD rtt_lasttran;
626 DWORD ts_sent;
627 DWORD ts_recent;
628 DWORD ts_echo;
630 UINT max_seg;
637 DWORD missed_seq [2];
638 /* void *reasm_buf; */
640#if defined(USE_TCP_MD5)
641 char *secret;
642#endif
643 DWORD inactive_to;
644 DWORD datatimer;
645 /* int sock_delay; ?? */
646
647 BYTE tx_wscale;
648 BYTE rx_wscale;
649 UINT tx_queuelen;
650 const BYTE *tx_queue;
651
652 UINT tx_datalen;
653 UINT max_tx_data;
654 BYTE *tx_data;
655 BYTE tx_buf [tcp_MaxTxBufSize+1];
656 DWORD safetysig;
657 DWORD safetytcp;
658 } _tcp_Socket;
659
660
665typedef struct _raw_Socket {
666 struct _raw_Socket *next;
667 WORD ip_type;
668 BOOL used;
669 DWORD seq_num;
670 struct in_Header ip;
671 BYTE rx_data [MAX_FRAG_SIZE];
672 } _raw_Socket;
673
674
679typedef struct _raw6_Socket {
680 struct _raw6_Socket *next;
681 WORD ip_type;
682 BOOL used;
683 DWORD seq_num;
684 struct in6_Header ip6;
685 BYTE rx_data [MAX_IP6_DATA];
686 } _raw6_Socket;
687
692typedef union sock_type {
693 _udp_Socket udp;
694 _tcp_Socket tcp;
695 _raw_Socket raw;
696 _raw6_Socket raw6;
697 } sock_type;
698
699/* Prototype some more internal functions:
700 */
701extern int _tcp_fsm (_tcp_Socket **s, const in_Header *ip);
702
703extern const char *i486model (unsigned int nr);
704extern const char *i586model (unsigned int nr);
705extern const char *Cx86model (void);
706extern const char *i686model (unsigned int nr);
707extern const char *AMDmodel (void);
708
709#include "../inc/tcp.h"
710
711#endif /* _w32_WATTCP_H */
712
config.h
pack_off.h
_raw6_Socket
Definition: wattcp.h:679
_raw_Socket
Definition: wattcp.h:665
_raw_Socket::used
BOOL used
used flag; packet not read yet
Definition: wattcp.h:668
_raw_Socket::seq_num
DWORD seq_num
counter for finding oldest pkt
Definition: wattcp.h:669
_raw_Socket::ip_type
WORD ip_type
same ofs as for udp/tcp Socket
Definition: wattcp.h:667
_raw_Socket::rx_data
BYTE rx_data[MAX_FRAG_SIZE]
room for 1 jumbo IP packet
Definition: wattcp.h:671
arp_Header
Definition: wattcp.h:476
arp_Header::hwAddrLen
BYTE hwAddrLen
MAC addr.
Definition: wattcp.h:479
arp_Header::protoAddrLen
BYTE protoAddrLen
IP addr.
Definition: wattcp.h:480
in6_Header
Definition: wattcp.h:381
in_Header
Definition: wattcp.h:329
ip_Packet
Definition: wattcp.h:396
tcp_Header
Definition: wattcp.h:418
tcp_PseudoHeader6
Definition: wattcp.h:463
tcp_PseudoHeader
Definition: wattcp.h:449
tcp_Socket
Definition: wattcp.h:584
tcp_Socket::window
UINT window
other guy's window
Definition: wattcp.h:608
tcp_Socket::tx_queuelen
UINT tx_queuelen
optional Tx queue length
Definition: wattcp.h:649
tcp_Socket::datatimer
DWORD datatimer
inactive timer (no Tx data)
Definition: wattcp.h:644
tcp_Socket::tx_wscale
BYTE tx_wscale
Definition: wattcp.h:647
tcp_Socket::vj_sa
DWORD vj_sa
VJ's alg, standard average (SRTT)
Definition: wattcp.h:615
tcp_Socket::safetytcp
DWORD safetytcp
extra magic marker
Definition: wattcp.h:657
tcp_Socket::rtt_lasttran
DWORD rtt_lasttran
RTT at last transmission.
Definition: wattcp.h:624
tcp_Socket::recent
BYTE recent
1 if recently transmitted
Definition: wattcp.h:605
tcp_Socket::rto
UINT rto
retransmission timeout
Definition: wattcp.h:618
tcp_Socket::tx_datalen
UINT tx_datalen
number of bytes of data to send
Definition: wattcp.h:652
tcp_Socket::wwindow
BYTE wwindow
Van Jacobson's algorithm.
Definition: wattcp.h:612
tcp_Socket::last_acknum
DWORD last_acknum[2]
for pcdbug.c; to follow SEQ/ACK
Definition: wattcp.h:600
tcp_Socket::max_seg
UINT max_seg
MSS for this connection.
Definition: wattcp.h:630
tcp_Socket::ts_sent
DWORD ts_sent
last TimeStamp value sent
Definition: wattcp.h:626
tcp_Socket::tos
BYTE tos
TOS from IP-header.
Definition: wattcp.h:620
tcp_Socket::cwindow
BYTE cwindow
Congestion window.
Definition: wattcp.h:611
tcp_Socket::karn_count
BYTE karn_count
count of packets
Definition: wattcp.h:619
tcp_Socket::rtt_time
DWORD rtt_time
Round Trip Time value.
Definition: wattcp.h:623
tcp_Socket::unhappy
BYTE unhappy
flag, indicates retransmitting segt's
Definition: wattcp.h:604
tcp_Socket::vj_last
DWORD vj_last
last transmit time
Definition: wattcp.h:617
tcp_Socket::timeout
DWORD timeout
timer for retrans etc.
Definition: wattcp.h:603
tcp_Socket::state
UINT state
tcp connection state
Definition: wattcp.h:594
tcp_Socket::tx_data
BYTE * tx_data
Tx data buffer (default tx_buf[])
Definition: wattcp.h:654
tcp_Socket::last_seqnum
DWORD last_seqnum[2]
increments
Definition: wattcp.h:601
tcp_Socket::ts_echo
DWORD ts_echo
last TimeStamp echo received
Definition: wattcp.h:628
tcp_Socket::next
struct tcp_Socket * next
link to next tcp-socket
Definition: wattcp.h:585
tcp_Socket::safetysig
DWORD safetysig
magic marker
Definition: wattcp.h:656
tcp_Socket::adv_win
UINT adv_win
our last advertised window
Definition: wattcp.h:609
tcp_Socket::missed_seq
DWORD missed_seq[2]
S.
Definition: wattcp.h:637
tcp_Socket::rx_buf
BYTE rx_buf[tcp_MaxBufSize+1]
received data buffer
Definition: wattcp.h:588
tcp_Socket::tx_buf
BYTE tx_buf[tcp_MaxTxBufSize+1]
data for transmission
Definition: wattcp.h:655
tcp_Socket::send_una
long send_una
unacked send data, must be signed
Definition: wattcp.h:597
tcp_Socket::ts_recent
DWORD ts_recent
last TimeStamp value received
Definition: wattcp.h:627
tcp_Socket::vj_sd
DWORD vj_sd
VJ's alg, standard deviation (RTTVAR)
Definition: wattcp.h:616
tcp_Socket::his6addr
ip6_address his6addr
peer's IPv6 address
Definition: wattcp.h:592
tcp_Socket::send_next
DWORD send_next
SEQ we send but not ACK-ed by peer.
Definition: wattcp.h:596
tcp_Socket::my6addr
ip6_address my6addr
our IPv6 address
Definition: wattcp.h:591
tcp_Socket::max_tx_data
UINT max_tx_data
Last index for tx_data[].
Definition: wattcp.h:653
tcp_Socket::inactive_to
DWORD inactive_to
inactive timer (no Rx data)
Definition: wattcp.h:643
tcp_Socket::secret
char * secret
< linked-list of frags; not yet
Definition: wattcp.h:641
tcp_Socket::recv_next
DWORD recv_next
SEQ number we expect to receive.
Definition: wattcp.h:595
tcp_Socket::flags
WORD flags
TCP flags used in next Tx.
Definition: wattcp.h:606
udp_Header
Definition: wattcp.h:406
udp_Socket
ARP definitions.
Definition: tcp.h:87
ulong_long
Definition: wattcp.h:90
target.h
sock_type
Definition: wattcp.h:692
w32api.h
int64
long long int64
our signed "long long" type
Definition: wattcp.h:66
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65
wtime.h
wtypes.h


Watt-32 tcp/ip: E:/WATT/src/wdpmi.c Source File

  • src
wdpmi.c
Go to the documentation of this file.
1
19#include <stdio.h>
20#include <stdlib.h>
21#include <string.h>
22
23#include "wattcp.h"
24#include "language.h"
25#include "pcsed.h"
26#include "printk.h"
27#include "sock_ini.h"
28#include "cpumodel.h"
29#include "misc.h"
30#include "misc_str.h"
31#include "wdpmi.h"
32
33#if defined(__MSDOS__) /* rest of file */
34
35/* Don't put this in config.h, but define to 1 here when it works.
36 */
37#undef USE_EXCEPT_HANDLER
38
39#if defined(WATCOM386)
40 /*
41 * Values for '_Extender'
42 */
43 #define DOSX_ERGO 0
44 #define DOSX_RATIONAL 1 /* DOS4Gxx, WDOSX, Pmode/W, CauseWay, EDOS */
45 #define DOSX_PHAR_V2 2
46 #define DOSX_PHAR_V3 3
47 #define DOSX_PHAR_V4 4
48 #define DOSX_PHAR_V5 5
49 #define DOSX_PHAR_V6 6
50 #define DOSX_PHAR_V7 7
51 #define DOSX_PHAR_V8 8
52 #define DOSX_INTEL 9 /* Intel C-Builder */
53 #define DOSX_WIN386 10 /* Windows 3.11+ */
54
55 /*
56 * Values for '_ExtenderSubtype'
57 */
58 #define XS_NONE 0
59 #define XS_RATIONAL_ZEROBASE 0
60 #define XS_RATIONAL_NONZEROBASE 1 /* Only in DOS4G Pro */
61
62 extern void cdecl cstart_ (void);
63 extern char _Extender;
64 extern char _ExtenderSubtype;
65#endif
66
67#if defined(DMC386)
68 #define int386 int86_real
69 #define int386x int86x_real
70 #define AX_REG(r) r.x.ax
71 #define BX_REG(r) r.x.bx
72 #define CX_REG(r) r.x.cx
73 #define DX_REG(r) r.x.dx
74 #define EAX_REG(r) r.e.eax
75 #define EBX_REG(r) r.e.ebx
76 #define ECX_REG(r) r.e.ecx
77 #define EDX_REG(r) r.e.edx
78 #define ESI_REG(r) r.e.esi
79 #define EDI_REG(r) r.e.edi
80 #define CARRY(r) (r.x.cflag & 1)
81
82#else
83 #define AX_REG(r) r.w.ax
84 #define BX_REG(r) r.w.bx
85 #define CX_REG(r) r.w.cx
86 #define DX_REG(r) r.w.dx
87 #define EAX_REG(r) r.x.eax
88 #define EBX_REG(r) r.x.ebx
89 #define ECX_REG(r) r.x.ecx
90 #define EDX_REG(r) r.x.edx
91 #define ESI_REG(r) r.x.esi
92 #define EDI_REG(r) r.x.edi
93 #define CARRY(r) (r.w.cflag & 1)
94#endif
95
96#if (DOSX & (DOS4GW|POWERPAK))
97
98#if defined(__CCDL__)
99#define int386 _int386
100#endif
101
102WORD __dpmi_errno = 0; /* last DPMI error */
103
104#if (!(DOSX & POWERPAK))
105
106WORD causeway_ver = 0; /* major=MSB, minor=LSB */
107BOOL dos32a_nullptr_chk = 0; /* NULL-ptr traps active */
108
109#define DOS32A_SIGN (('I' << 24) + ('D' << 16) + ('3' << 8) + ('2' << 0))
110#define PMODEW_SIGN (('P' << 24) + ('M' << 16) + ('D' << 8) + ('W' << 0))
111#define WDOSX_SIGN (('W' << 24) + ('D' << 16) + ('S' << 8) + ('X' << 0))
112
113#if (DOSX & DOS4GW) && defined(WATCOM386) && defined(USE_EXCEPT_HANDLER)
114 static struct FAULT_STRUC exc_struct;
115 static exceptionHook user_exc_hook = NULL;
116
117 static void far __loadds exception_main (void);
118#endif
119
120/*
121 * WDOSX and Pmode/W uses same detect function with
122 * unique signatures.
123 */
124static BOOL is_wdosx_or_pmodew (DWORD sign)
125{
126 union REGS reg;
127
128#ifdef __DJGPP__
129 reg.x.eax = 0xEEFF;
130 int86 (0x31, &reg, &reg);
131#else
132 EAX_REG(reg) = 0xEEFF;
133 int386 (0x31, &reg, &reg);
134#endif
135 return (EAX_REG(reg) == sign);
136}
137
138BOOL dpmi_is_wdosx (void)
139{
140 return is_wdosx_or_pmodew (WDOSX_SIGN);
141}
142
143BOOL dpmi_is_pmodew (void)
144{
145 return is_wdosx_or_pmodew (PMODEW_SIGN);
146}
147
148BOOL dpmi_is_dos32a (void)
149{
150 union REGS reg;
151
152#ifdef __DJGPP__
153 reg.x.eax = 0xFF89; /* Get configuation info */
154 int86 (0x21, &reg);
155#else
156 EAX_REG(reg) = 0xFF89;
157 int386 (0x21, &reg, &reg);
158#endif
159
160 if (EAX_REG(reg) == DOS32A_SIGN)
161 {
162 dos32a_nullptr_chk = (EDX_REG(reg) & 0x80);
163 return (TRUE);
164 }
165 return (FALSE);
166}
167
168BOOL dpmi_is_dos4gw (void)
169{
170 union REGS reg;
171
172#ifdef __DJGPP__ /* I doubt DOS4GW and djgpp is possible */
173 reg.x.eax = 0xFF00;
174 reg.x.edx = 0x78;
175 int86 (0x21, &reg);
176#else
177 EAX_REG(reg) = 0xFF00;
178 EDX_REG(reg) = 0x78;
179 int386 (0x21, &reg, &reg);
180#endif
181 return (EAX_REG(reg) == 0xFFFF3447);
182}
183
184BOOL dpmi_is_causeway (void)
185{
186#if defined(__DJGPP__)
187 union REGS r;
188 struct SREGS s;
189 DWORD rp;
190 char sign[10];
191
192 s.ds = s.es = _my_ds();
193 r.x.eax = 0x3531;
194 int86x (0x21, &r, &r, &s);
195 if (s.es == 0 || !SelReadable(s.es) ||
196 __dpmi_get_segment_limit(s.es) < r.x.ebx)
197 return (FALSE);
198
199 movedata (s.es, r.x.ebx, _my_ds(), (unsigned)&sign, sizeof(sign));
200 if (!memcmp(sign, "CAUSEWAY", 8))
201 {
202 causeway_ver = (sign[8] << 8) + sign[9];
203 return (TRUE);
204 }
205
206#elif defined(__CCDL__)
207 /* !! to-do */
208
209#elif defined(__WATCOMC__)
210 union REGS r;
211 struct SREGS s;
212 BYTE _far *rp;
213
214 EAX_REG(r) = 0x3531;
215 segread (&s);
216 int386x (0x21, &r, &r, &s);
217
218 rp = MK_FP (s.es, EBX_REG(r) - 10);
219
220 if (s.es && SelReadable(s.es) &&
221 EAX_REG(r) < GET_LIMIT(s.es) &&
222 !_fstrncmp(rp, "CAUSEWAY", 8))
223 {
224 rp += 8;
225 causeway_ver = (rp[0] << 8) + rp[1];
226 return (TRUE);
227 }
228#endif
229 return (FALSE);
230}
231
232BOOL dpmi_is_hxdos (void)
233{
234 union REGS reg;
235 char buf[128] = { '\0' };
236
237#ifdef __DJGPP__
238 reg.x.eax = 0x401;
239 reg.x.edi = (DWORD) &buf;
240 int86 (0x31, &reg, &reg);
241#else
242 EAX_REG(reg) = 0x401;
243 EDI_REG(reg) = (DWORD) &buf;
244 int386 (0x31, &reg, &reg);
245#endif
246 return (strncmp(buf + 2, "HDPMI", 5) == 0);
247}
248
249/*
250 * Return true name of "DOS4GW-type" extenders.
251 */
252const char *dos4gw_extender_name (void)
253{
254 if (dpmi_is_causeway())
255 return ("CAUSEWAY");
256
257 if (dpmi_is_wdosx())
258 return ("WDOSX");
259
260 if (dpmi_is_pmodew())
261 return ("PMODEW");
262
263 if (dpmi_is_hxdos())
264 return ("HXDOS");
265
266 if (dpmi_is_dos32a())
267 return ("DOS32A");
268
269 if (dpmi_is_dos4gw())
270 return ("DOS4GW");
271
272 return ("DOS4GW"); /* assume the rest are DOS4GW compatible */
273}
274
275/*
276 * Exception handler for Causeway stubbed programs.
277 * Setup to call 'exc_func' when exception occurs.
278 */
279int dpmi_except_handler (exceptionHook exc_func)
280{
281#if defined(WATCOM386) && defined(USE_EXCEPT_HANDLER)
282 union REGS r;
283 struct SREGS s;
284
285 if (!dpmi_is_causeway())
286 {
287 __dpmi_errno = 0x8001;
288 return (0);
289 }
290
291 __dpmi_errno = 0;
292 segread (&s);
293 s.ds = FP_SEG (exception_main); /* vector address */
294 r.x.esi = FP_OFF (exception_main);
295 s.es = FP_SEG (&exc_struct); /* info dump address */
296 r.x.edi = FP_OFF (&exc_struct);
297 r.h.cl = 1; /* 32-bit routine */
298 r.w.ax = 0xFF31; /* USER_ERR_TERM */
299 int386x (0x31, &r, &r, &s);
300 if (CARRY(r))
301 {
302 __dpmi_errno = AX_REG(r);
303 return (0);
304 }
305 r.w.ax = 0xFF30; /* SetDump */
306 r.h.cl = 0;
307 int386 (0x31, &r, &r);
308
309 user_exc_hook = exc_func;
310 memset (&exc_struct, '\0', sizeof(exc_struct));
311 dpmi_lock_region ((void*)&exc_struct, sizeof(exc_struct));
312 dpmi_lock_region ((void*)exception_main, 100);
313 return (1);
314#else
315 ARGSUSED (exc_func);
316 __dpmi_errno = 0x8001;
317 return (0);
318#endif
319}
320#endif /* !(DOSX & POWERPAK) */
321
322void *dpmi_get_real_vector (int intr)
323{
324 union REGS r;
325
326 __dpmi_errno = 0;
327 EAX_REG(r) = 0x200;
328 EBX_REG(r) = (DWORD) intr;
329 int386 (0x31, &r, &r);
330 return SEG_OFS_TO_LIN (CX_REG(r), DX_REG(r));
331}
332
333int dpmi_get_base_address (WORD sel, DWORD *base)
334{
335 union REGS r;
336
337 __dpmi_errno = 0;
338 EAX_REG(r) = 0x06;
339 EBX_REG(r) = sel;
340 int386 (0x31, &r, &r);
341 if (CARRY(r))
342 {
343 __dpmi_errno = AX_REG(r);
344 return (0);
345 }
346 *base = (CX_REG(r) << 16) + DX_REG(r);
347 return (1);
348}
349
350WORD dpmi_real_malloc (WORD size, WORD *selector)
351{
352 union REGS r;
353
354 __dpmi_errno = 0;
355 EAX_REG(r) = 0x0100; /* DPMI allocate DOS memory */
356 EBX_REG(r) = (size + 15) / 16; /* Number of paragraphs requested */
357 int386 (0x31, &r, &r);
358 if (CARRY(r))
359 {
360 __dpmi_errno = AX_REG(r);
361 return (0);
362 }
363 *selector = DX_REG(r); /* Return selector */
364 return AX_REG(r); /* Return segment address */
365}
366
367int dpmi_real_free (WORD selector)
368{
369 union REGS r;
370
371 __dpmi_errno = 0;
372 EAX_REG(r) = 0x101; /* DPMI free DOS memory */
373 EBX_REG(r) = selector; /* Selector to free */
374 int386 (0x31, &r, &r);
375 if (CARRY(r))
376 {
377 __dpmi_errno = AX_REG(r);
378 return (0);
379 }
380 return (1);
381}
382
383int dpmi_lock_region (void *address, unsigned length)
384{
385 union REGS r;
386 DWORD base, linear;
387
388 if (!dpmi_get_base_address(MY_CS(), &base))
389 return (0);
390
391 linear = base + (DWORD)address;
392 __dpmi_errno = 0;
393
394 EAX_REG(r) = 0x600; /* DPMI Lock Linear Region */
395 EBX_REG(r) = (linear >> 16); /* Linear address in BX:CX */
396 ECX_REG(r) = (linear & 0xFFFF);
397 ESI_REG(r) = (length >> 16); /* Length in SI:DI */
398 EDI_REG(r) = (length & 0xFFFF);
399 int386 (0x31, &r, &r);
400 if (CARRY(r))
401 {
402 __dpmi_errno = AX_REG(r);
403 return (0);
404 }
405 return (1);
406}
407
408int dpmi_unlock_region (void *address, unsigned length)
409{
410 union REGS r;
411 DWORD base, linear;
412
413 if (!dpmi_get_base_address(MY_CS(), &base))
414 return (0);
415
416 linear = base + (DWORD)address;
417 __dpmi_errno = 0;
418
419 EAX_REG(r) = 0x601; /* DPMI Unlock Linear Region */
420 EBX_REG(r) = (linear >> 16); /* Linear address in BX:CX */
421 ECX_REG(r) = (linear & 0xFFFF);
422 ESI_REG(r) = (length >> 16); /* Length in SI:DI */
423 EDI_REG(r) = (length & 0xFFFF);
424 int386 (0x31, &r, &r);
425 if (CARRY(r))
426 {
427 __dpmi_errno = AX_REG(r);
428 return (0);
429 }
430 return (1);
431}
432
433#if !defined(__CCDL__)
434int dpmi_real_interrupt (int intr, IREGS *reg)
435{
436 union REGS r;
437 struct SREGS s;
438
439 __dpmi_errno = 0;
440 memset (&r, '\0', sizeof(r));
441 segread (&s);
442 EAX_REG(r) = 0x300;
443 EBX_REG(r) = intr;
444 ECX_REG(r) = 0;
445 s.es = FP_SEG (reg);
446 EDI_REG(r) = FP_OFF (reg);
447 reg->r_flags = 0;
448 reg->r_ss = reg->r_sp = 0; /* DPMI host provides stack */
449
450 int386x (0x31, &r, &r, &s);
451 if (CARRY(r))
452 {
453 reg->r_flags |= 1;
454 __dpmi_errno = AX_REG(r);
455 return (0);
456 }
457 return (1);
458}
459#endif
460
461int dpmi_real_call_retf (IREGS *reg)
462{
463 union REGS r;
464 struct SREGS s;
465
466 __dpmi_errno = 0;
467 memset (&r, '\0', sizeof(r));
468 segread (&s);
469 EAX_REG(r) = 0x301;
470 EBX_REG(r) = 0;
471 ECX_REG(r) = 0;
472 s.es = FP_SEG (reg);
473 EDI_REG(r) = FP_OFF (reg);
474 reg->r_flags = 0;
475 reg->r_ss = reg->r_sp = 0; /* DPMI host provides stack */
476
477 int386x (0x31, &r, &r, &s);
478 if (CARRY(r))
479 {
480 reg->r_flags |= 1;
481 __dpmi_errno = AX_REG(r);
482 return (0);
483 }
484 return (1);
485}
486
487/*
488 * PowerPak already have int386().
489 */
490#if (defined(DMC386) || defined(MSC386) || defined(BORLAND386)) && \
491 !(DOSX & POWERPAK)
492static int real_interrupt (int intr, IREGS *reg)
493{
494 __asm {
495 push ebx
496 push edi
497 mov edi, reg /* es:edi -> reg */
498 mov edx, esp /* save esp */
499 mov ebx, intr
500 mov eax, 300h /* simulate real-int */
501 int 31h
502 mov esp, edx
503 xor eax, eax /* assume ok */
504 pop edi
505 pop ebx
506 jc fail
507 pop ebp
508 ret
509 }
510fail:
511 return (-1);
512}
513
514int int386 (int intno, union REGS *ireg, union REGS *oreg)
515{
516 struct SREGS sreg;
517
518 segread (&sreg);
519 return int386x (intno, ireg, oreg, &sreg);
520}
521
522int int386x (int intno, union REGS *ireg, union REGS *oreg, struct SREGS *sreg)
523{
524 static IREGS rm_reg;
525
526 rm_reg.r_ss = rm_reg.r_sp = rm_reg.r_flags = 0;
527 rm_reg.r_ax = ireg->x.eax;
528 rm_reg.r_bx = ireg->x.ebx;
529 rm_reg.r_cx = ireg->x.ecx;
530 rm_reg.r_dx = ireg->x.edx;
531 rm_reg.r_si = ireg->x.esi;
532 rm_reg.r_di = ireg->x.edi;
533 rm_reg.r_ds = sreg->ds;
534 rm_reg.r_es = sreg->es;
535 rm_reg.r_gs = 0; /* needed? */
536 rm_reg.r_fs = 0; /* needed? */
537
538 if (real_interrupt(intno, &rm_reg) < 0)
539 {
540 oreg->x.cflag |= 1; /* Set carry bit */
541 return (-1);
542 }
543 oreg->x.eax = rm_reg.r_ax;
544 oreg->x.ebx = rm_reg.r_bx;
545 oreg->x.ecx = rm_reg.r_cx;
546 oreg->x.edx = rm_reg.r_dx;
547 oreg->x.esi = rm_reg.r_si;
548 oreg->x.edi = rm_reg.r_di;
549 oreg->x.flags = rm_reg.r_flags;
550 return (int)rm_reg.r_ax;
551}
552
553void segread (struct SREGS *sreg)
554{
555 sreg->ds = MY_DS();
556 sreg->es = MY_ES();
557 sreg->ss = MY_SS();
558 sreg->cs = MY_CS();
559}
560#endif /* (DMC386 || MSC386 || BORLAND386) && !(DOSX & POWERPAK) */
561
562
563#if (DOSX & DOS4GW) && defined(WATCOM386)
564
565#if defined(USE_EXCEPT_HANDLER)
566
567extern int _STACKTOP; /* internal variable, top of Watcom stack */
568
569/*
570 * Various contortions necessary to set CauseWay internal stack to
571 * Watcom DGROUP-based stack and to keep the unknown number of stack
572 * parameters relative to register EBP unchanged.
573 */
574extern void SS_TO_DGROUP (void);
575#pragma aux SS_TO_DGROUP = \
576 "sub ebp, esp" \
577 "xor eax, eax" \
578 "mov ax, ss" \
579 "mov es, ax" \
580 "mov ebx, esp" \
581 "mov edx, _STACKTOP" \
582 "mov cx, ds" \
583 "mov ss, cx" \
584 "mov esp, edx" \
585 "mov edx, esi" \
586 "mov edi, esi" \
587 "sub edi, ebx" \
588 "sub edx, 2" \
589 "looper: mov cx, es:[edx]" \
590 "sub esp, 2" \
591 "mov ss:[esp], cx" \
592 "sub edx, 2" \
593 "sub edi, 2" \
594 "jg looper" \
595 "add ebp, esp" \
596 "push eax" \
597 "push esi" \
598 __modify [__eax __ebx __ecx __edx __edi];
599
600extern void RESTORE_SS_AND_GO (void);
601#pragma aux RESTORE_SS_AND_GO = \
602 "pop esi" \
603 "pop eax" \
604 "sub esi, 8" \
605 "mov ss, ax" \
606 "mov esp, esi" \
607 "retf";
608
609/*
610 * Termination routine MUST NOT have stack-checking enabled.
611 * If virtual memory is in use, this routine and all code and data called
612 * or used by the routine (including Watcom runtime library functions)
613 * must be locked in memory.
614 */
615#include "nochkstk.h"
616
617static void far __loadds exception_main (void)
618{
619 SS_TO_DGROUP();
620
621 exc_struct.mode = (exc_struct.cs != MY_CS());
622
623 if (user_exc_hook)
624 (*user_exc_hook) (&exc_struct);
625 else _printk ("Exception %d at CS:EIP %04X:%08X\n)",
626 exc_struct.fault_num, exc_struct.cs, exc_struct.eip);
627 RESTORE_SS_AND_GO();
628}
629#endif /* USE_EXCEPT_HANDLER */
630
631
634static DWORD exc_app_start = 4096UL;
635
636/*
637 * Perform a stack trace back to CRT. Function arguments printed only
638 * for stack-based calls (-3s).
639 *
640 * \todo Merge this function with the one in x32vm.c.
641 */
642void stack_rewind (DWORD start, DWORD base)
643{
644 int loop = 10; /* print max 10 stack frames */
645 DWORD eip = start;
646 DWORD limit = get_cs_limit();
647 const DWORD *context = (const DWORD*) base; /* EBP increases as we rewind */
648 BOOL reg_calls = FALSE;
649
650#if defined(__SW_3R)
651 reg_calls = TRUE;
652#endif
653
654 _printk ("Stack trace:\r\n");
655
656 while (context >= (DWORD*)base && ((DWORD)context & 3) == 0 && --loop)
657 {
658 const DWORD *next;
659
660 if ((DWORD)context >= limit - 4 || eip >= limit ||
661 (DWORD)context <= exc_app_start || eip <= exc_app_start)
662 break;
663
664 _printk (" %08X ", eip);
665
666 next = (const DWORD*) *context; /* get ESP stack value from context */
667
668 /* Compute number of args to display
669 */
670 if (next == NULL || /* we're rewound back to CRT */
671 next <= (const DWORD*)exc_app_start || reg_calls)
672 _printk ("( *** )");
673
674 else
675 {
676 const DWORD *argv;
677 DWORD argc = next - context - 2;
678
679 argc = (argc > 5) ? 5 : argc;
680 _printk ("(");
681
682 argv = context + 2; /* Args start after saved EBP and return address */
683 while (argc--)
684 {
685 if (argc == 0)
686 _printk ("%04X)\r\n", *argv++);
687 else _printk ("%04X ", *argv++);
688 }
689 }
690 eip = *(context + 1); /* get next return address */
691 context = next;
692 }
693 _printk ("\r\n");
694}
695#endif /* (DOSX & DOS4GW) && WATCOM386 */
696#endif /* DOSX & (DOS4GW|POWERPAK) */
697
698
699#if defined(WATCOM386)
700BOOL dpmi_init (void)
701{
702 switch (_Extender)
703 {
704 case DOSX_PHAR_V2: /* Test for Pharlap extenders */
705 case DOSX_PHAR_V3:
706 case DOSX_PHAR_V4:
707 case DOSX_PHAR_V5:
708 case DOSX_PHAR_V6:
709 case DOSX_PHAR_V7:
710 case DOSX_PHAR_V8:
711#if (DOSX & PHARLAP)
712 return (TRUE);
713#else
714 outsnl (_LANG("\7The Watt-32 library was not compiled for Pharlap."));
715 return (FALSE);
716
717 case DOSX_RATIONAL:
718 if (_ExtenderSubtype & XS_RATIONAL_NONZEROBASE)
719 {
720 outsnl (_LANG("\7Only zero-based DOS4GW applications supported."));
721 return (FALSE);
722 }
723 break; /* okay */
724#endif
725
726 default:
727#if (DOSX & PHARLAP)
728 outsnl (_LANG("\7Only Pharlap extenders supported"));
729#else
730 outsnl (_LANG("\7Only DOS4GW style extenders supported"));
731#endif
732 return (FALSE);
733 }
734 return (TRUE);
735}
736#endif /* WATCOM386 */
737#endif /* __MSDOS__ */
738
cpumodel.h
language.h
misc.h
misc_str.h
nochkstk.h
pcsed.h
printk.h
sock_ini.h
FAULT_STRUC
Definition: wdpmi.h:15
IREGS
Definition: misc.h:610
esp
Definition: esp.h:44
wattcp.h
Core definitions.
exc_app_start
static DWORD exc_app_start
Definition: wdpmi.c:634
wdpmi.h


Watt-32 tcp/ip: E:/WATT/src/wdpmi.h Source File

  • src
wdpmi.h
Go to the documentation of this file.
1
3#ifndef _w32_WDPMI_H
4#define _w32_WDPMI_H
5
6#if defined(WATCOM386)
7 extern BOOL dpmi_init (void);
8#endif
9
10#if (DOSX & (DOS4GW|POWERPAK))
11
12 #include "misc.h" /* IREGS */
13 #include <sys/pack_on.h>
14
15 struct FAULT_STRUC { /* Exception structure (only used by CauseWay) */
16 DWORD ebp, edi, esi, edx, ecx, ebx, eax;
17 WORD gs, fs, es, ds;
18 DWORD eip;
19 WORD cs, reserved1;
20 DWORD eflags, esp;
21 WORD ss, reserved2;
22 WORD tr;
23 DWORD cr0, cr1, cr2, cr3;
24 DWORD csAddr;
25 DWORD dsAddr;
26 DWORD esAddr;
27 DWORD fsAddr;
28 DWORD gsAddr;
29 DWORD ssAddr;
30 WORD fault_num;
31 DWORD code;
32 BOOL mode; /* 0: exception in pmode, 1: real-mode */
33 };
34
35 #include <sys/pack_off.h>
36
37 #define SEG_OFS_TO_LIN(seg,ofs) (void*)(((WORD)(seg) << 4) + (WORD)(ofs))
38
39 extern WORD __dpmi_errno;
40
41 extern WORD dpmi_real_malloc (WORD size, WORD *sel);
42 extern int dpmi_real_free (WORD selector);
43 extern int dpmi_get_base_address(WORD sel, DWORD *base);
44 extern int dpmi_lock_region (void *address, unsigned length);
45 extern int dpmi_unlock_region (void *address, unsigned length);
46 extern void *dpmi_get_real_vector (int intr);
47 extern int dpmi_real_interrupt (int intr, IREGS *reg);
48 extern int dpmi_real_call_retf (IREGS *reg);
49#endif
50
51#if (DOSX & DOS4GW)
52 extern BOOL dpmi_is_wdosx (void);
53 extern BOOL dpmi_is_pmodew (void);
54 extern BOOL dpmi_is_dos32a (void);
55 extern BOOL dpmi_is_dos4gw (void);
56 extern BOOL dpmi_is_causeway (void);
57 extern BOOL dpmi_is_hxdos (void);
58
59 typedef void (*exceptionHook) (const struct FAULT_STRUC *);
60
61 extern int dpmi_except_handler (exceptionHook exc_func);
62 extern const char *dos4gw_extender_name (void);
63
64 #define stack_rewind W32_NAMESPACE (stack_rewind)
65 extern void stack_rewind (DWORD start, DWORD base);
66#endif
67
68#endif /* !_w32_WDPMI_H */
69
misc.h
pack_off.h
pack_on.h
FAULT_STRUC
Definition: wdpmi.h:15
IREGS
Definition: misc.h:610
code
Definition: zinftree.h:24
esp
Definition: esp.h:44
cr0
Definition: register.h:172
eflags
Definition: register.h:129


Watt-32 tcp/ip: E:/WATT/inc/sys/werrno.h Source File

  • inc
  • sys
werrno.h
Go to the documentation of this file.
1
9#ifndef __SYS_WERRNO_H
10#define __SYS_WERRNO_H
11
12#ifndef __SYS_W32API_H
13#include <sys/w32api.h>
14#endif
15
16#ifndef __SYS_CDEFS_H
17#include <sys/cdefs.h>
18#endif
19
20/* When doing "gcc -MM" with gcc 3.0 we must include <sys/version.h>
21 * (via stdio.h) in order for '__DJGPP__' to be defined
22 */
23#include <stdio.h>
24#include <errno.h>
25
26#if defined(W32_NEW_ERRNO)
27 #include <sys/werrno2.h>
28
29#else /* rest of file */
30
31/* Hack: fix for compiling with djgpp 2.04, but
32 * ./util/dj_err.exe was compiled with 2.03
33 */
34#if defined(MIXING_DJGPP_203_AND_204)
35#undef ELOOP
36#endif
37
38#if defined(__CYGWIN__)
39 /*
40 * Since CygWin's <sys/errno.h> provides all the errno-values
41 * we need, there is no need to use 'util/errnos.c' to create new
42 * ones for CygWin. Simply pull in '<sys/errno.h>'. Done by
43 * '#include_next <sys/errno.h>' in our '<sys/errno.h>'.
44 */
45
46#elif defined(__AVR__)
50 #ifndef ESOCKTNOSUPPORT
51 #define ESOCKTNOSUPPORT 54
52 #endif
53
54#elif defined(WATT32_DJGPP_MINGW)
55 /*
56 * Just a C preprocess test using TDM-gcc with djgpp headers.
57 */
58 #ifndef __DJGPP__
59 #define __DJGPP__ 2
60 #endif
61 #include <sys/djgpp.err>
62
63#elif defined(__MINGW64_VERSION_MAJOR) || defined(__MINGW64__)
64 /*
65 * '__MINGW32__' is defined by BOTH mingw.org and by the MinGW-w64
66 * projects [1,2], because both can target Win32.
67 *
68 * '__MINGW64__' is defined only when targeting Win64 (__x86_64__,
69 * or option '-m64').
70 *
71 * [1] http://mingw-w64.sourceforge.net/
72 * [2] http://tdm-gcc.tdragon.net/
73 *
74 * Hopefully both Win32 and Win64 targets define the same range of
75 * errnos. Hence we use the one generated for '__MINGW64__'.
76 */
77 #undef EDEADLOCK
78 #undef ETXTBSY /* gcc 7.2+ defines this */
79 #include <sys/mingw64.err>
80
81#elif defined(__MINGW32__) /* Original from mingw.org */
82 #include <sys/mingw32.err>
83
84#elif defined(__HIGHC__)
85 #undef EDEADLK
86 #undef EDEADLOCK
87 #include <sys/highc.err>
88
89#elif defined(__BORLANDC__)
90 #ifdef __FLAT__
91 #undef ENAMETOOLONG /* bcc32 4.0 */
92 #endif
93 #ifdef _WIN32
94 #undef ENOTEMPTY
95 #endif
96 #include <sys/borlandc.err>
97
98#elif defined(__TURBOC__)
99 #include <sys/turboc.err>
100
101#elif defined(__WATCOMC__)
102 #include <sys/watcom.err>
103
104#elif defined(__DJGPP__)
105 #include <sys/djgpp.err>
106
107#elif defined(__DMC__) /* Digital Mars Compiler */
108 #include <sys/digmars.err>
109
110#elif defined(__clang__)
111 /*
112 * MUST be include before '_MSC_VER' section since 'clang-cl'
113 * emulates 'cl.
114 */
115 #undef EDEADLOCK
116 #include <sys/clang.err>
117
118#elif defined(_MSC_VER) && (_MSC_VER > 800) /* Visual C on Windows */
119 #undef EDEADLOCK
120 #include <sys/visualc.err>
121
122#elif defined(__ORANGEC__) /* David Lindauer's OrangeC compiler (father of LadSoft) */
123 #undef EDEADLK
124 #include <sys/orangec.err>
125
126#elif defined(__POCC__)
127 #include <sys/pellesc.err>
128
129#else
130 #error Unknown target in <sys/werrno.h>.
131#endif
132
133/*
134 * Ugly hack ahead. Someone tell me a better way, but
135 * 'errno' and friends are macros on Windows. Redefine them
136 * to point to our variables.
137 *
138 * On Windows, the usual 'errno' is a macro "(*_errno)()" that
139 * is problematic to use as a lvalue.
140 * On other platforms we modify the global 'errno' variable directly.
141 * (see 'SOCK_ERRNO()' in 'src/misc.h').
142 * Hence no need to redefine it in any way.
143 */
144
145W32_DATA int _w32_errno;
146W32_DATA int _w32_sys_nerr;
147W32_DATA char *_w32_sys_errlist[];
148
149#if defined(__DJGPP__)
150 #undef sys_errlist
151 #define sys_errlist _w32_sys_errlist
152#endif
153
154#if 0
155 #undef sys_nerr
156 #define sys_nerr _w32_sys_nerr
157
158 #undef _sys_nerr
159 #define _sys_nerr _w32_sys_nerr
160
161 #undef __sys_nerr
162 #define __sys_nerr _w32_sys_nerr
163
164 #undef sys_errlist
165 #define sys_errlist _w32_sys_errlist
166
167 #undef _sys_errlist
168 #define _sys_errlist _w32_sys_errlist
169
170 #undef __sys_errlist
171 #define __sys_errlist _w32_sys_errlist
172#endif
173
174/*
175 * Incase you have trouble with duplicate defined symbols,
176 * make sure the "*_s()" versions are referenced before normal
177 * perror() and strerror() in your C-library.
178 *
179 * The Windows SDK already have a 'strerror_s()'.
180 * Hence the 'strerror_s_()'.
181 */
182W32_FUNC void W32_CALL perror_s (const char *str);
183W32_FUNC char *W32_CALL strerror_s_ (int errnum);
184
185#if defined(__cplusplus)
186 #include <stdlib.h>
187 #include <string.h>
188
189#elif !defined(_MSC_VER) && !defined(WIN32) && !defined(__WATCOMC__)
190 #if !defined(_INC_STDLIB) && !defined(_STDLIB_H_) && !defined(_STDIO_H)
191 #undef perror
192 W32_FUNC void W32_CALL perror (const char *str);
193 #endif
194
195 #if !defined(_INC_STRING) && !defined(_STRING_H) && !defined(_STRING_H_)
196 #undef strerror
197 W32_FUNC char *W32_CALL strerror (int errnum);
198 #endif
199#endif
200
201#if defined(WATT32_ON_WINDOWS)
202 W32_FUNC int __stdcall WSAGetLastError (void);
203 W32_FUNC void __stdcall WSASetLastError (int err);
204#endif
205
206#endif /* W32_NEW_ERRNO */
207#endif /* __SYS_WERRNO_H */
208
cdefs.h
errno.h
w32api.h
strerror
W32_FUNC char *W32_CALL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207


Watt-32 tcp/ip: E:/WATT/inc/sys/whide.h Source File

  • inc
  • sys
whide.h
Go to the documentation of this file.
1
9#ifndef __SYS_WHIDE_H
10#define __SYS_WHIDE_H
11
12#ifndef __SYS_W32API_H
13#include <sys/w32api.h>
14#endif
15
16#ifndef __SYS_CDEFS_H
17#include <sys/cdefs.h>
18#endif
19
20#if !defined(WATT32_NO_NAMESPACE)
21
22#define init_misc W32_NAMESPACE (init_misc)
23#define Random W32_NAMESPACE (Random)
24#define RandomWait W32_NAMESPACE (RandomWait)
25#define set_timeout W32_NAMESPACE (set_timeout)
26#define chk_timeout W32_NAMESPACE (chk_timeout)
27#define cmp_timers W32_NAMESPACE (cmp_timers)
28#define hires_timer W32_NAMESPACE (hires_timer)
29#define set_timediff W32_NAMESPACE (set_timediff)
30#define get_timediff W32_NAMESPACE (get_timediff)
31#define timeval_diff W32_NAMESPACE (timeval_diff)
32#define timeval_diff2 W32_NAMESPACE (timeval_diff2)
33#define tcp_OPEN_TO W32_NAMESPACE (tcp_OPEN_TO)
34#define tcp_CLOSE_TO W32_NAMESPACE (tcp_CLOSE_TO)
35#define tcp_RTO_ADD W32_NAMESPACE (tcp_RTO_ADD)
36#define tcp_RTO_BASE W32_NAMESPACE (tcp_RTO_BASE)
37#define tcp_RTO_SCALE W32_NAMESPACE (tcp_RTO_SCALE)
38#define tcp_RST_TIME W32_NAMESPACE (tcp_RST_TIME)
39#define tcp_RETRAN_TIME W32_NAMESPACE (tcp_RETRAN_TIME)
40#define tcp_MAX_VJSA W32_NAMESPACE (tcp_MAX_VJSA)
41#define tcp_MAX_VJSD W32_NAMESPACE (tcp_MAX_VJSD)
42#define tcp_recv_win W32_NAMESPACE (tcp_recv_win)
43#define tcp_config W32_NAMESPACE (tcp_config)
44#define tcp_config_name W32_NAMESPACE (tcp_config_name)
45#define tcp_inject_config W32_NAMESPACE (tcp_inject_config)
46#define tcp_established W32_NAMESPACE (tcp_established)
47#define tcp_listen W32_NAMESPACE (tcp_listen)
48#define tcp_open W32_NAMESPACE (tcp_open)
49#define tcp_set_debug_state W32_NAMESPACE (tcp_set_debug_state)
50#define tcp_simple_state W32_NAMESPACE (tcp_simple_state)
51#define tcp_tick W32_NAMESPACE (tcp_tick)
52#define udp_listen W32_NAMESPACE (udp_listen)
53#define udp_open W32_NAMESPACE (udp_open)
54#define my_ip_addr W32_NAMESPACE (my_ip_addr)
55#define sin_mask W32_NAMESPACE (sin_mask)
56#define sock_delay W32_NAMESPACE (sock_delay)
57#define sock_inactive W32_NAMESPACE (sock_inactive)
58#define sock_data_timeout W32_NAMESPACE (sock_data_timeout)
59#define multihomes W32_NAMESPACE (multihomes)
60#define block_tcp W32_NAMESPACE (block_tcp)
61#define block_udp W32_NAMESPACE (block_udp)
62#define block_ip W32_NAMESPACE (block_ip)
63#define block_icmp W32_NAMESPACE (block_icmp)
64#define last_cookie W32_NAMESPACE (last_cookie)
65#define Cookies W32_NAMESPACE (Cookies)
66#define survive_eth W32_NAMESPACE (survive_eth)
67#define survive_bootp W32_NAMESPACE (survive_bootp)
68#define survive_dhcp W32_NAMESPACE (survive_dhcp)
69#define survive_rarp W32_NAMESPACE (survive_rarp)
70#define loopback_handler W32_NAMESPACE (loopback_handler)
71#define usr_init W32_NAMESPACE (usr_init)
72#define usr_post_init W32_NAMESPACE (usr_post_init)
73#define in_checksum W32_NAMESPACE (in_checksum)
74#define aton W32_NAMESPACE (aton)
75#define aton_dotless W32_NAMESPACE (aton_dotless)
76#define isaddr W32_NAMESPACE (isaddr)
77#define isaddr_dotless W32_NAMESPACE (isaddr_dotless)
78#define priv_addr W32_NAMESPACE (priv_addr)
79#define tcp_cbreak W32_NAMESPACE (tcp_cbreak)
80#define _outch W32_NAMESPACE (_outch)
81#define outs W32_NAMESPACE (outs)
82#define outsnl W32_NAMESPACE (outsnl)
83#define outsn W32_NAMESPACE (outsn)
84#define outhexes W32_NAMESPACE (outhexes)
85#define outhex W32_NAMESPACE (outhex)
86#define rip W32_NAMESPACE (rip)
87#define parse_config_table W32_NAMESPACE (parse_config_table)
88#define _ping W32_NAMESPACE (_ping)
89#define _chk_ping W32_NAMESPACE (_chk_ping)
90#define add_ping W32_NAMESPACE (add_ping)
91#define _tftp_write W32_NAMESPACE (_tftp_write)
92#define _tftp_close W32_NAMESPACE (_tftp_close)
93#define addwattcpd W32_NAMESPACE (addwattcpd)
94#define delwattcpd W32_NAMESPACE (delwattcpd)
95#define stopwattcpd W32_NAMESPACE (stopwattcpd)
96#define dbug_init W32_NAMESPACE (dbug_init)
97#define init_userSuppliedTimerTick W32_NAMESPACE (init_userSuppliedTimerTick)
98#define userTimerTick W32_NAMESPACE (userTimerTick)
99#define ip_timer_init W32_NAMESPACE (ip_timer_init)
100#define ip_timer_expired W32_NAMESPACE (ip_timer_expired)
101#define join_mcast_group W32_NAMESPACE (join_mcast_group)
102#define leave_mcast_group W32_NAMESPACE (leave_mcast_group)
103#define multi_to_eth W32_NAMESPACE (multi_to_eth)
104#define tcp_md5_secret W32_NAMESPACE (tcp_md5_secret)
105#define make_md5_signature W32_NAMESPACE (make_md5_signature)
106#define check_md5_signature W32_NAMESPACE (check_md5_signature)
107#define def_domain W32_NAMESPACE (def_domain)
108#define def_nameservers W32_NAMESPACE (def_nameservers)
109#define dns_timeout W32_NAMESPACE (dns_timeout)
110#define dns_recurse W32_NAMESPACE (dns_recurse)
111#define dom_errno W32_NAMESPACE (dom_errno)
112#define last_nameserver W32_NAMESPACE (last_nameserver)
113#define _mtu W32_NAMESPACE (_mtu)
114#define _mss W32_NAMESPACE (_mss)
115#define tcp_keep_idle W32_NAMESPACE (tcp_keep_idle)
116#define tcp_keep_intvl W32_NAMESPACE (tcp_keep_intvl)
117#define tcp_max_idle W32_NAMESPACE (tcp_max_idle)
118#define ctrace_on W32_NAMESPACE (ctrace_on)
119#define debug_on W32_NAMESPACE (debug_on)
120#define has_rdtsc W32_NAMESPACE (has_rdtsc)
121#define clocks_per_usec W32_NAMESPACE (clocks_per_usec)
122#define psocket W32_NAMESPACE (psocket)
123#define _chk_socket W32_NAMESPACE (_chk_socket)
124#define sock_sturdy W32_NAMESPACE (sock_sturdy)
125#define sock_stats W32_NAMESPACE (sock_stats)
126#define _inet_ntoa W32_NAMESPACE (_inet_ntoa)
127#define _inet_addr W32_NAMESPACE (_inet_addr)
128#define inet_ntop W32_NAMESPACE (inet_ntop)
129#define inet_pton W32_NAMESPACE (inet_pton)
130#define defaultdomain W32_NAMESPACE (defaultdomain)
131#define dns_do_idna W32_NAMESPACE (dns_do_idna)
132#define dns_do_ipv6 W32_NAMESPACE (dns_do_ipv6)
133#define dns_windns W32_NAMESPACE (dns_windns)
134#define dom_ttl W32_NAMESPACE (dom_ttl)
135#define dom_cname W32_NAMESPACE (dom_cname)
136#define dom_a4list W32_NAMESPACE (dom_a4list)
137#define dom_a6list W32_NAMESPACE (dom_a6list)
138#define dom_strerror W32_NAMESPACE (dom_strerror)
139#define dom_remove_dot W32_NAMESPACE (dom_remove_dot)
140#define lookup_host W32_NAMESPACE (lookup_host)
141#define DHCP_did_gratuitous_arp W32_NAMESPACE (DHCP_did_gratuitous_arp)
142#define DHCP_set_config_func W32_NAMESPACE (DHCP_set_config_func)
143#define DHCP_release W32_NAMESPACE (DHCP_release)
144#define DHCP_read_config W32_NAMESPACE (DHCP_read_config)
145#define DHCP_get_server W32_NAMESPACE (DHCP_get_server)
146#define _printf W32_NAMESPACE (_printf)
147#define gui_printf W32_NAMESPACE (gui_printf)
148#define win_strerror W32_NAMESPACE (win_strerror)
149#define assert_fail_test W32_NAMESPACE (assert_fail_test)
150#define abort_test W32_NAMESPACE (abort_test)
151#define leak_test W32_NAMESPACE (leak_test)
152#define except_test W32_NAMESPACE (except_test)
153#define _multicast_on W32_NAMESPACE (_multicast_on)
154#define _multicast_intvl W32_NAMESPACE (_multicast_intvl)
155#define _ip_delay0 W32_NAMESPACE (_ip_delay0)
156#define _ip_delay1 W32_NAMESPACE (_ip_delay1)
157#define _ip_delay2 W32_NAMESPACE (_ip_delay2)
158#define _eth_init W32_NAMESPACE (_eth_init)
159#define _eth_release W32_NAMESPACE (_eth_release)
160#define _eth_formatpacket W32_NAMESPACE (_eth_formatpacket)
161#define _eth_free W32_NAMESPACE (_eth_free)
162#define _eth_arrived W32_NAMESPACE (_eth_arrived)
163#define _eth_send W32_NAMESPACE (_eth_send)
164#define _eth_set_addr W32_NAMESPACE (_eth_set_addr)
165#define _eth_get_hwtype W32_NAMESPACE (_eth_get_hwtype)
166#define _resolve_hook W32_NAMESPACE (_resolve_hook)
167#define _resolve_exit W32_NAMESPACE (_resolve_exit)
168#define _resolve_timeout W32_NAMESPACE (_resolve_timeout)
169#define udp_SetTTL W32_NAMESPACE (udp_SetTTL)
170#define num_mcast_active W32_NAMESPACE (num_mcast_active)
171#define print_mac_stats W32_NAMESPACE (print_mac_stats)
172#define print_pkt_stats W32_NAMESPACE (print_pkt_stats)
173#define print_vjc_stats W32_NAMESPACE (print_vjc_stats)
174#define print_arp_stats W32_NAMESPACE (print_arp_stats)
175#define print_pppoe_stats W32_NAMESPACE (print_pppoe_stats)
176#define print_ip4_stats W32_NAMESPACE (print_ip4_stats)
177#define print_ip6_stats W32_NAMESPACE (print_ip6_stats)
178#define print_icmp_stats W32_NAMESPACE (print_icmp_stats)
179#define print_igmp_stats W32_NAMESPACE (print_igmp_stats)
180#define print_udp_stats W32_NAMESPACE (print_udp_stats)
181#define print_tcp_stats W32_NAMESPACE (print_tcp_stats)
182#define print_all_stats W32_NAMESPACE (print_all_stats)
183#define reset_stats W32_NAMESPACE (reset_stats)
184#define pkt_eth_init W32_NAMESPACE (pkt_eth_init)
185#define pkt_release W32_NAMESPACE (pkt_release)
186#define pkt_reset_handle W32_NAMESPACE (pkt_reset_handle)
187#define pkt_send W32_NAMESPACE (pkt_send)
188#define pkt_buf_wipe W32_NAMESPACE (pkt_buf_wipe)
189#define pkt_free_pkt W32_NAMESPACE (pkt_free_pkt)
190#define pkt_waiting W32_NAMESPACE (pkt_waiting)
191#define pkt_set_addr W32_NAMESPACE (pkt_set_addr)
192#define pkt_get_addr W32_NAMESPACE (pkt_get_addr)
193#define pkt_get_mtu W32_NAMESPACE (pkt_get_mtu)
194#define pkt_get_drvr_ver W32_NAMESPACE (pkt_get_drvr_ver)
195#define pkt_get_api_ver W32_NAMESPACE (pkt_get_api_ver)
196#define pkt_get_vector W32_NAMESPACE (pkt_get_vector)
197#define pkt_set_rcv_mode W32_NAMESPACE (pkt_set_rcv_mode)
198#define pkt_get_rcv_mode W32_NAMESPACE (pkt_get_rcv_mode)
199#define pkt_check_address W32_NAMESPACE (pkt_check_address)
200#define pkt_get_stats W32_NAMESPACE (pkt_get_stats)
201#define pkt_strerror W32_NAMESPACE (pkt_strerror)
202#define pkt_dropped W32_NAMESPACE (pkt_dropped)
203#define pkt_get_drvr_name W32_NAMESPACE (pkt_get_drvr_name)
204#define pkt_get_drvr_desc W32_NAMESPACE (pkt_get_drvr_desc)
205#define pkt_get_drvr_class W32_NAMESPACE (pkt_get_drvr_class)
206#define pkt_get_device_name W32_NAMESPACE (pkt_get_device_name)
207#define pkt_get_drvr_descr W32_NAMESPACE (pkt_get_drvr_descr)
208#define pkt_is_init W32_NAMESPACE (pkt_is_init)
209#define resolve W32_NAMESPACE (resolve)
210#define resolve_ip W32_NAMESPACE (resolve_ip)
211#define resolve_ip6 W32_NAMESPACE (resolve_ip6)
212#define sock_abort W32_NAMESPACE (sock_abort)
213#define sock_close W32_NAMESPACE (sock_close)
214#define sock_dataready W32_NAMESPACE (sock_dataready)
215#define sock_debugdump W32_NAMESPACE (sock_debugdump)
216#define sock_enqueue W32_NAMESPACE (sock_enqueue)
217#define sock_established W32_NAMESPACE (sock_established)
218#define sock_exit W32_NAMESPACE (sock_exit)
219#define sock_fastread W32_NAMESPACE (sock_fastread)
220#define sock_fastwrite W32_NAMESPACE (sock_fastwrite)
221#define sock_flush W32_NAMESPACE (sock_flush)
222#define sock_flushnext W32_NAMESPACE (sock_flushnext)
223#define sock_getc W32_NAMESPACE (sock_getc)
224#define sock_gets W32_NAMESPACE (sock_gets)
225#define sock_init_err W32_NAMESPACE (sock_init_err)
226#define sock_keepalive W32_NAMESPACE (sock_keepalive)
227#define sock_mode W32_NAMESPACE (sock_mode)
228#define sock_noflush W32_NAMESPACE (sock_noflush)
229#define sock_preread W32_NAMESPACE (sock_preread)
230#define sock_printf W32_NAMESPACE (sock_printf)
231#define sock_putc W32_NAMESPACE (sock_putc)
232#define sock_puts W32_NAMESPACE (sock_puts)
233#define sock_rbleft W32_NAMESPACE (sock_rbleft)
234#define sock_rbsize W32_NAMESPACE (sock_rbsize)
235#define sock_rbused W32_NAMESPACE (sock_rbused)
236#define sock_read W32_NAMESPACE (sock_read)
237#define sock_recv W32_NAMESPACE (sock_recv)
238#define sock_recv_from W32_NAMESPACE (sock_recv_from)
239#define sock_recv_init W32_NAMESPACE (sock_recv_init)
240#define sock_recv_used W32_NAMESPACE (sock_recv_used)
241#define sock_scanf W32_NAMESPACE (sock_scanf)
242#define sock_setbuf W32_NAMESPACE (sock_setbuf)
243#define sock_sig_exit W32_NAMESPACE (sock_sig_exit)
244#define sock_sselect W32_NAMESPACE (sock_sselect)
245#define sock_tbleft W32_NAMESPACE (sock_tbleft)
246#define sock_tbsize W32_NAMESPACE (sock_tbsize)
247#define sock_tbused W32_NAMESPACE (sock_tbused)
248#define sock_timeout W32_NAMESPACE (sock_timeout)
249#define sock_write W32_NAMESPACE (sock_write)
250#define sock_yield W32_NAMESPACE (sock_yield)
251#define sockerr W32_NAMESPACE (sockerr)
252#define sockerr_clear W32_NAMESPACE (sockerr_clear)
253#define sockstate W32_NAMESPACE (sockstate)
254#define _getsockname W32_NAMESPACE (_getsockname)
255#define _getpeername W32_NAMESPACE (_getpeername)
256
257/* OpenWatcom (small/large) doesn't seems to define '__MSDOS__'.
258 */
259#if defined(__MSDOS__) || defined(MSDOS)
260 #define init_timer_isr W32_NAMESPACE (init_timer_isr)
261 #define exit_timer_isr W32_NAMESPACE (exit_timer_isr)
262#endif
263
264#if !defined(__DJGPP__) && !defined(__CYGWIN__) && \
265 !(defined(__WATCOMC__) && (__WATCOMC__ >= 1240))
266 #define ffs W32_NAMESPACE (ffs)
267#endif
268
269#if defined(__HIGHC__) || (defined(__DMC__) && defined(__MSDOS__))
270 #define delay W32_NAMESPACE (delay)
271#endif
272
273#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__DJGPP__)
274 #define gettimeofday W32_NAMESPACE (gettimeofday)
275#endif
276
277/* Hide private sumbols while building Watt-32.
278 */
279#if defined(WATT32_BUILD)
280 #define do_checksum W32_NAMESPACE (do_checksum)
281#endif
282
283#endif /* WATT32_NO_NAMESPACE */
284
285#endif
cdefs.h
w32api.h


Watt-32 tcp/ip: E:/WATT/src/win_dll.c Source File

  • src
win_dll.c
Go to the documentation of this file.
1
32#include "wattcp.h"
33#include "misc.h"
34#include "misc_str.h"
35#include "pcdbug.h"
36
37#if defined(WIN32) /* Rest of file */
38
39#include "packet32.h"
40#include "win_dll.h"
41
42/* Function-ptr for functions in these DLLs:
43 */
44func_GetComputerNameExA p_GetComputerNameExA; /* Kernel32.dll, >= Win-2000 Pro */
45func_GetFileVersionInfoSizeA p_GetFileVersionInfoSizeA; /* version.dll */
46func_GetFileVersionInfoA p_GetFileVersionInfoA; /* version.dll */
47func_GetFileVersionInfoExA p_GetFileVersionInfoExA; /* version.dll, >= Win-Vista (NOT USED) */
48func_VerQueryValueA p_VerQueryValueA; /* version.dll, >= Win-2000 Pro */
49func_QueryThreadCycleTime p_QueryThreadCycleTime; /* kernel32.dll, >= Win-Vista */
50func_RtlGetVersion p_RtlGetVersion; /* ntdll.dll, >= Win-2000 */
51func_NtQueryInformationThread p_NtQueryInformationThread; /* ntdll.dll, >= Win-2003 */
52func_NtQuerySystemInformation p_NtQuerySystemInformation; /* ntdll.dll, >= Win-2003 */
53func_IsWow64Process p_IsWow64Process; /* Kernel32.dll, >= Win-XP SP2 */
54func_GetThreadInformation p_GetThreadInformation; /* Kernel32.dll, >= Win-8 */
55func_GetSystemTimePreciseAsFileTime p_GetSystemTimePreciseAsFileTime; /* Kernel32.dll, >= Win-8 */
56
57/* Function-ptr for functions in WinPacket.dll:
58 * (the WinPcap low-level NetMon wrapper library)
59 */
60func_WanPacketSetBpfFilter p_WanPacketSetBpfFilter = NULL;
61func_WanPacketOpenAdapter p_WanPacketOpenAdapter = NULL;
62func_WanPacketCloseAdapter p_WanPacketCloseAdapter = NULL;
63func_WanPacketSetBufferSize p_WanPacketSetBufferSize = NULL;
64func_WanPacketReceivePacket p_WanPacketReceivePacket = NULL;
65func_WanPacketSetMinToCopy p_WanPacketSetMinToCopy = NULL;
66func_WanPacketGetStats p_WanPacketGetStats = NULL;
67func_WanPacketSetReadTimeout p_WanPacketSetReadTimeout = NULL;
68func_WanPacketSetMode p_WanPacketSetMode = NULL;
69func_WanPacketGetReadEvent p_WanPacketGetReadEvent = NULL;
70func_WanPacketTestAdapter p_WanPacketTestAdapter = NULL;
71
72#if defined(HAVE_WINDNS_H)
73 func_DnsFree p_DnsFree = NULL;
74 func_DnsQuery_A p_DnsQuery_A = NULL;
75 func_DnsModifyRecordsInSet_A p_DnsModifyRecordsInSet_A = NULL;
76#endif
77
78#if defined(USE_BUGTRAP)
79 func_BT_InstallSehFilter p_BT_InstallSehFilter = NULL;
80 func_BT_SetPreErrHandler p_BT_SetPreErrHandler = NULL;
81 func_BT_SetAppVersion p_BT_SetAppVersion = NULL;
82 func_BT_SetAppName p_BT_SetAppName = NULL;
83 func_BT_SetReportFormat p_BT_SetReportFormat = NULL;
84 func_BT_SetSupportEMail p_BT_SetSupportEMail = NULL;
85 func_BT_SetFlags p_BT_SetFlags = NULL;
86 func_BT_SetLogSizeInEntries p_BT_SetLogSizeInEntries = NULL;
87 func_BT_SetLogFlags p_BT_SetLogFlags = NULL;
88 func_BT_SetLogEchoMode p_BT_SetLogEchoMode = NULL;
89 func_BT_InsLogEntryF p_BT_InsLogEntryF = NULL;
90 func_BT_OpenLogFile p_BT_OpenLogFile = NULL;
91 func_BT_CloseLogFile p_BT_CloseLogFile = NULL;
92 func_BT_AddLogFile p_BT_AddLogFile = NULL;
93#endif
94
95#define ADD_VALUE(dll, func) { NULL, dll, #func, (void**)&p_##func }
96
97/*
98 * The DLL names must be grouped together for load_dynamic_table() to work.
99 */
100struct LoadTable dyn_funcs [] = {
101 ADD_VALUE ("kernel32.dll", QueryThreadCycleTime),
102 ADD_VALUE ("kernel32.dll", GetComputerNameExA),
103 ADD_VALUE ("kernel32.dll", IsWow64Process),
104 ADD_VALUE ("kernel32.dll", GetThreadInformation),
105 ADD_VALUE ("kernel32.dll", GetSystemTimePreciseAsFileTime),
106 ADD_VALUE ("version.dll", GetFileVersionInfoSizeA),
107 ADD_VALUE ("version.dll", GetFileVersionInfoA),
108 ADD_VALUE ("version.dll", GetFileVersionInfoExA),
109 ADD_VALUE ("version.dll", VerQueryValueA),
110 ADD_VALUE ("ntdll.dll", NtQueryInformationThread),
111 ADD_VALUE ("ntdll.dll", NtQuerySystemInformation),
112 ADD_VALUE ("ntdll.dll", RtlGetVersion),
113 ADD_VALUE ("WanPacket.dll", WanPacketSetBpfFilter),
114 ADD_VALUE ("WanPacket.dll", WanPacketOpenAdapter),
115 ADD_VALUE ("WanPacket.dll", WanPacketCloseAdapter),
116 ADD_VALUE ("WanPacket.dll", WanPacketSetBufferSize),
117 ADD_VALUE ("WanPacket.dll", WanPacketReceivePacket),
118 ADD_VALUE ("WanPacket.dll", WanPacketSetMinToCopy),
119 ADD_VALUE ("WanPacket.dll", WanPacketGetStats),
120 ADD_VALUE ("WanPacket.dll", WanPacketSetReadTimeout),
121 ADD_VALUE ("WanPacket.dll", WanPacketSetMode),
122 ADD_VALUE ("WanPacket.dll", WanPacketGetReadEvent),
123 ADD_VALUE ("WanPacket.dll", WanPacketTestAdapter),
124#if defined(HAVE_WINDNS_H)
125 ADD_VALUE ("dnsapi.dll", DnsQuery_A),
126 ADD_VALUE ("dnsapi.dll", DnsFree),
127 ADD_VALUE ("dnsapi.dll", DnsModifyRecordsInSet_A),
128#endif
129#if defined(USE_BUGTRAP)
130 ADD_VALUE ("BugTrap.dll", BT_InstallSehFilter),
131 ADD_VALUE ("BugTrap.dll", BT_SetPreErrHandler),
132 ADD_VALUE ("BugTrap.dll", BT_SetAppVersion),
133 ADD_VALUE ("BugTrap.dll", BT_SetAppName),
134 ADD_VALUE ("BugTrap.dll", BT_SetReportFormat),
135 ADD_VALUE ("BugTrap.dll", BT_SetSupportEMail),
136 ADD_VALUE ("BugTrap.dll", BT_SetFlags),
137 ADD_VALUE ("BugTrap.dll", BT_SetLogSizeInEntries),
138 ADD_VALUE ("BugTrap.dll", BT_SetLogFlags),
139 ADD_VALUE ("BugTrap.dll", BT_SetLogEchoMode),
140 ADD_VALUE ("BugTrap.dll", BT_InsLogEntryF),
141 ADD_VALUE ("BugTrap.dll", BT_OpenLogFile),
142 ADD_VALUE ("BugTrap.dll", BT_CloseLogFile),
143 ADD_VALUE ("BugTrap.dll", BT_AddLogFile)
144#endif
145 };
146
147size_t dyn_funcs_num = DIM (dyn_funcs);
148
149/*
150 * Handling of dynamic loading and unloading of DLLs and their functions.
151 */
152int load_dynamic_table (struct LoadTable *tab, int tab_size)
153{
154 int i;
155
156 for (i = 0; i < tab_size; tab++, i++)
157 {
158 HINSTANCE mod_handle;
159
160 if (!_watt_use_bugtrap && !stricmp(tab->mod_name,"BugTrap.dll"))
161 continue;
162
163 if (i > 0 && !stricmp(tab->mod_name, (tab-1)->mod_name))
164 mod_handle = (tab-1)->mod_handle;
165 else mod_handle = LoadLibrary (tab->mod_name);
166
167 if (mod_handle && mod_handle != INVALID_HANDLE_VALUE)
168 {
169 FARPROC addr = GetProcAddress (mod_handle, tab->func_name);
170
171 if (!addr)
172 TRACE_CONSOLE (4, "Function \"%s\" not found in %s.\n",
173 tab->func_name, tab->mod_name);
174 *tab->func_addr = addr;
175 }
176 tab->mod_handle = mod_handle;
177
178 TRACE_CONSOLE (4, "%2d: Module 0x%08lX/%s, func \"%s\" -> 0x%" ADDR_FMT ".\n",
179 i, (u_long)HandleToUlong(tab->mod_handle), tab->mod_name, tab->func_name,
180 ADDR_CAST(*tab->func_addr));
181 }
182 return (i);
183}
184
185int unload_dynamic_table (struct LoadTable *tab, int tab_size)
186{
187 int i;
188
189 for (i = 0; i < tab_size; tab++, i++)
190 {
191 int m_unload = 0;
192 int f_unload = 0;
193
194 if (tab->mod_handle && tab->mod_handle != INVALID_HANDLE_VALUE)
195 {
196 FreeLibrary (tab->mod_handle);
197 m_unload = 1;
198 }
199 tab->mod_handle = INVALID_HANDLE_VALUE;
200
201 if (*tab->func_addr)
202 f_unload = 1;
203 *tab->func_addr = NULL;
204
205 TRACE_CONSOLE (4, "%2d: function \"%s\" %s. Module \"%s\" %s.\n",
206 i, tab->func_name, f_unload ? "freed" : "not used",
207 tab->mod_name, m_unload ? "unloaded" : "not used");
208 }
209 return (i);
210}
211#endif /* WIN32 */
212
misc.h
misc_str.h
pcdbug.h
LoadTable
Definition: win_dll.h:12
wattcp.h
Core definitions.
win_dll.h


Watt-32 tcp/ip: E:/WATT/src/win_dll.h Source File

  • src
win_dll.h
Go to the documentation of this file.
1
5#ifndef _w32_WIN_DLL_H
6#define _w32_WIN_DLL_H
7
8#if defined(WIN32) /* Rest of file */
9
10/* Generic table for loading DLLs and functions from them.
11 */
12struct LoadTable {
13 HINSTANCE mod_handle;
14 const TCHAR *mod_name;
15 const char *func_name;
16 void **func_addr;
17 };
18
19extern struct LoadTable dyn_funcs[];
20extern size_t dyn_funcs_num;
21
22extern int load_dynamic_table (struct LoadTable *tab, int tab_size);
23extern int unload_dynamic_table (struct LoadTable *tab, int tab_size);
24
25#ifndef IN
26#define IN
27#endif
28
29#ifndef OUT
30#define OUT
31#endif
32
33#ifndef OPTIONAL
34#define OPTIONAL
35#endif
36
37/*
38 * Instead of including <NtDDK.h> here, we define undocumented stuff
39 * needed for NtQueryInformationThread() here:
40 */
41typedef LONG NTSTATUS;
42
43typedef enum _THREADINFOCLASS {
44 ThreadBasicInformation,
45 ThreadTimes,
46 ThreadPriority,
47 ThreadBasePriority,
48 ThreadAffinityMask,
49 ThreadImpersonationToken,
50 ThreadDescriptorTableEntry,
51 ThreadEnableAlignmentFaultFixup,
52 ThreadEventPair_Reusable,
53 ThreadQuerySetWin32StartAddress,
54 ThreadZeroTlsCell,
55 ThreadPerformanceCount,
56 ThreadAmILastThread,
57 ThreadIdealProcessor,
58 ThreadPriorityBoost,
59 ThreadSetTlsArrayAddress,
60 ThreadIsIoPending,
61 MaxThreadInfoClass
62 } THREADINFOCLASS;
63
64/* end <NTddk.h> stuff */
65
66/*
67 * All function typedefs and function pointers are declared below
68 * so that load_dynamic_table() can see the function pointers.
69 */
70
71typedef BOOL (WINAPI *func_QueryThreadCycleTime) (
72 IN HANDLE thread_handle,
73 OUT ULONG64 *cycle_time);
74
75typedef NTSTATUS (WINAPI *func_NtQueryInformationThread) (
76 IN HANDLE thread_handle,
77 IN THREADINFOCLASS thread_information_class,
78 IN OUT void *thread_information,
79 IN ULONG thread_information_length,
80 OUT ULONG *return_length OPTIONAL);
81
82typedef NTSTATUS (WINAPI *func_NtQuerySystemInformation) (
83 IN ULONG system_information_class,
84 OUT void *system_information,
85 IN ULONG system_information_length,
86 OUT ULONG *return_length);
87
88typedef NTSTATUS (WINAPI *func_RtlGetVersion) (
89 OUT OSVERSIONINFOW *ver_info);
90
91
92/*
93 * MSDN forgot to tell us what values are in the 'THREAD_INFORMATION_CLASS'
94 * enum type. According [1], the only suported value is 'ThreadMemoryPriority'.
95 * Will figure out this later.
96 *
97 * When using 'p_GetThreadInformation()', cast 2nd parameter
98 * [1] http://msdn.microsoft.com/en-us/library/windows/desktop/hh448382(v=vs.85).aspx
99 */
100typedef BOOL (WINAPI *func_GetThreadInformation) (
101 IN HANDLE thread_handle,
102 IN int thread_information_class, /* Really is 'THREAD_INFORMATION_CLASS' */
103 IN OUT void *thread_information,
104 IN DWORD thread_information_length);
105
106typedef DWORD (WINAPI *func_GetFileVersionInfoSizeA) (char *, DWORD*);
107typedef BOOL (WINAPI *func_GetFileVersionInfoA) (char *, DWORD, DWORD, void *);
108typedef BOOL (WINAPI *func_GetFileVersionInfoExA) (DWORD, LPCTSTR, DWORD, DWORD, void*);
109typedef BOOL (WINAPI *func_VerQueryValueA) (const void **, char *, void **, UINT *);
110typedef BOOL (WINAPI *func_GetComputerNameExA) (int, char*, DWORD*);
111typedef BOOL (WINAPI *func_IsWow64Process) (HANDLE, BOOL*);
112typedef void (WINAPI *func_GetSystemTimePreciseAsFileTime) (FILETIME *);
113
114extern func_GetFileVersionInfoSizeA p_GetFileVersionInfoSizeA;
115extern func_GetFileVersionInfoA p_GetFileVersionInfoA;
116extern func_GetFileVersionInfoExA p_GetFileVersionInfoExA;
117extern func_VerQueryValueA p_VerQueryValueA;
118extern func_QueryThreadCycleTime p_QueryThreadCycleTime;
119extern func_NtQueryInformationThread p_NtQueryInformationThread;
120extern func_NtQuerySystemInformation p_NtQuerySystemInformation;
121extern func_RtlGetVersion p_RtlGetVersion;
122extern func_GetComputerNameExA p_GetComputerNameExA;
123extern func_IsWow64Process p_IsWow64Process;
124extern func_GetSystemTimePreciseAsFileTime p_GetSystemTimePreciseAsFileTime;
125
126#if defined(HAVE_WINDNS_H)
127 /*
128 * DnsApi.dll is used dynamically. So we need the function pointers below.
129 * <windns.h> should be part of the "Windows Platform SDK".
130 */
131 #include <windns.h>
132
133 typedef DNS_STATUS (WINAPI *func_DnsQuery_A) (
134 IN const char *name,
135 IN WORD wType,
136 IN DWORD options,
137 IN IP4_ARRAY *aipServers,
138 IN OUT DNS_RECORD **queryResults,
139 IN OUT void **reserved);
140
141 typedef DNS_STATUS (WINAPI *func_DnsModifyRecordsInSet_A) (
142 IN DNS_RECORD *addRecords,
143 IN DNS_RECORD *deleteRecords,
144 IN DWORD options,
145 IN HANDLE context, OPTIONAL
146 IN IP4_ARRAY *serverList, OPTIONAL
147 IN void *reserved);
148
149 typedef void (WINAPI *func_DnsFree) (
150 IN OUT void *data,
151 IN DNS_FREE_TYPE freeType);
152
153 extern func_DnsFree p_DnsFree;
154 extern func_DnsQuery_A p_DnsQuery_A;
155 extern func_DnsModifyRecordsInSet_A p_DnsModifyRecordsInSet_A;
156#endif
157
158#if 1
159 #include "packet32.h"
160#else
161 typedef void WAN_ADAPTER; /* The details of this struct is not important to us.
162 * Ref. WAN_ADAPTER_INT in WanPacket.cpp (from CACE Technologies)
163 */
164 struct bpf_stat; /* Forward. Defined in packet32.h */
165#endif
166
167/* "func_": WanPacket-function typedefs.
168 * These are *not* WINAPI, but cdecl.
169 */
170typedef BOOL (cdecl *func_WanPacketSetBpfFilter) (WAN_ADAPTER *, PUCHAR, DWORD);
171typedef WAN_ADAPTER *(cdecl *func_WanPacketOpenAdapter) (void);
172typedef BOOL (cdecl *func_WanPacketCloseAdapter) (WAN_ADAPTER *);
173typedef BOOL (cdecl *func_WanPacketSetBufferSize)(WAN_ADAPTER *, DWORD);
174typedef DWORD (cdecl *func_WanPacketReceivePacket) (WAN_ADAPTER *, PUCHAR, DWORD);
175typedef BOOL (cdecl *func_WanPacketSetMinToCopy) (WAN_ADAPTER *, DWORD);
176typedef BOOL (cdecl *func_WanPacketGetStats) (WAN_ADAPTER *, struct bpf_stat *);
177typedef BOOL (cdecl *func_WanPacketSetReadTimeout) (WAN_ADAPTER *, DWORD);
178typedef BOOL (cdecl *func_WanPacketSetMode) (WAN_ADAPTER *, DWORD);
179typedef HANDLE (cdecl *func_WanPacketGetReadEvent) (WAN_ADAPTER *);
180typedef BOOL (cdecl *func_WanPacketTestAdapter) (void);
181
182extern func_WanPacketSetBpfFilter p_WanPacketSetBpfFilter;
183extern func_WanPacketOpenAdapter p_WanPacketOpenAdapter;
184extern func_WanPacketCloseAdapter p_WanPacketCloseAdapter;
185extern func_WanPacketSetBufferSize p_WanPacketSetBufferSize;
186extern func_WanPacketReceivePacket p_WanPacketReceivePacket;
187extern func_WanPacketSetMinToCopy p_WanPacketSetMinToCopy;
188extern func_WanPacketGetStats p_WanPacketGetStats;
189extern func_WanPacketSetReadTimeout p_WanPacketSetReadTimeout;
190extern func_WanPacketSetMode p_WanPacketSetMode;
191extern func_WanPacketGetReadEvent p_WanPacketGetReadEvent;
192extern func_WanPacketTestAdapter p_WanPacketTestAdapter;
193
194#if defined(USE_BUGTRAP)
195 /*
196 * Dynamically load the BugTrap DLL.
197 * Ref: http://www.intellesoft.net/default.shtml and/or
198 * https://github.com/bchavez/BugTrap
199 *
200 * The 1st URL seems broken now.
201 * 'APIENTRY' is '__stdcall'
202 */
203 #include "bugtrap.h"
204
205 #define EXC_FUN LPTOP_LEVEL_EXCEPTION_FILTER
206
207 typedef EXC_FUN (APIENTRY *func_BT_InstallSehFilter) (void);
208 typedef void (APIENTRY *func_BT_SetPreErrHandler) (BT_ErrHandler, INT_PTR);
209 typedef void (APIENTRY *func_BT_SetAppVersion) (const char *appVersion);
210 typedef void (APIENTRY *func_BT_SetAppName) (const char *appName);
211 typedef void (APIENTRY *func_BT_SetReportFormat) (BUGTRAP_REPORTFORMAT format);
212 typedef void (APIENTRY *func_BT_SetSupportEMail) (const char *supportEmail);
213 typedef INT_PTR (APIENTRY *func_BT_OpenLogFile) (const char *logFileName, BUGTRAP_LOGFORMAT logFormat);
214 typedef void (APIENTRY *func_BT_SetFlags) (DWORD dwFlags);
215 typedef BOOL (APIENTRY *func_BT_SetLogSizeInEntries) (INT_PTR handle, DWORD logSizeInEntries);
216 typedef BOOL (APIENTRY *func_BT_SetLogFlags) (INT_PTR handle, DWORD flags);
217 typedef BOOL (APIENTRY *func_BT_SetLogEchoMode) (INT_PTR handle, DWORD logEchoMode);
218 typedef BOOL (APIENTRY *func_BT_InsLogEntryF) (INT_PTR handle, BUGTRAP_LOGLEVEL logLevel, LPCTSTR format, ...);
219 typedef BOOL (APIENTRY *func_BT_CloseLogFile) (INT_PTR handle);
220 typedef void (APIENTRY *func_BT_AddLogFile) (const char *logFile);
221
222 extern func_BT_InstallSehFilter p_BT_InstallSehFilter;
223 extern func_BT_SetPreErrHandler p_BT_SetPreErrHandler;
224 extern func_BT_SetAppVersion p_BT_SetAppVersion;
225 extern func_BT_SetAppName p_BT_SetAppName;
226 extern func_BT_SetReportFormat p_BT_SetReportFormat;
227 extern func_BT_SetSupportEMail p_BT_SetSupportEMail;
228 extern func_BT_SetFlags p_BT_SetFlags;
229 extern func_BT_SetLogSizeInEntries p_BT_SetLogSizeInEntries;
230 extern func_BT_SetLogFlags p_BT_SetLogFlags;
231 extern func_BT_SetLogEchoMode p_BT_SetLogEchoMode;
232 extern func_BT_InsLogEntryF p_BT_InsLogEntryF;
233 extern func_BT_OpenLogFile p_BT_OpenLogFile;
234 extern func_BT_CloseLogFile p_BT_CloseLogFile;
235 extern func_BT_AddLogFile p_BT_AddLogFile;
236
237#endif /* USE_BUGTRAP */
238#endif /* WIN32 */
239#endif /* _w32_WIN_DLL_H */
240
LoadTable
Definition: win_dll.h:12
bpf_stat
Definition: packet32.h:251


Watt-32 tcp/ip: E:/WATT/src/winadinf.c Source File

  • src
winadinf.c
Go to the documentation of this file.
1
38#define _SYS_SELECT_H /* For CygWin's <sys/select.h> */
39
40#include <stdio.h>
41#include <stdlib.h>
42#include <assert.h>
43#include <wchar.h>
44
45//#define OLE2ANSI /* Use ASCII from Ole32.dll functions */
46
51#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
52
53#define INSIDE_WINADINF_C /* Pull in private stuff in "winadinf.h" */
54
55#include "winadinf.h"
56#include "wattcp.h"
57#include "pcdbug.h"
58#include "packet32.h"
59#include "misc.h"
60#include "misc_str.h"
61#include "run.h"
62#include "gettod.h"
63#include "timer.h"
64#include "win_dll.h"
65
66/*
67 * If 'COMPILE_WINADINF_C' was defined in "winadinf.h", then the rest of this file
68 * is code for MSVC, OpenWatcom, MinGW/MinGW-w64 or a recent __BORLANDC__ compiler.
69 *
70 * But Orange-C is not even able to parse 'winadinf.h'.
71 */
72#if defined(COMPILE_WINADINF_C)
73
74/* If on Windows NT 3.5 or on early Windows 95 betas, this is defined
75 */
76#ifdef WINNT35COMPATIBLE
77#error "Win-NT 3.5 compatible!!??"
78#endif
79
80#define NA_STR "<N/A>"
81#define NONE_STR "<None>"
82#define NONE_STR_W L"<None>"
83#define _w32_AF_INET 2
84#define _w32_AF_INET6 24
85
86#define PRINT_RAS_ERROR(spaces, ret) \
87 (*_printf) ("%s%s(%u): error: %s\n", spaces, __FILE__, __LINE__, ras_strerror(ret))
88
89#define TRACE(level, ...) do { \
90 if (verbose_level >= level) { \
91 printf ("%s(%u): ", __FILE__, __LINE__); \
92 printf (__VA_ARGS__); \
93 } \
94 } while (0)
95
96#ifndef __in
97#define __in
98#endif
99
100#ifndef __inout
101#define __inout
102#endif
103
104#ifndef __in_opt
105#define __in_opt
106#endif
107
108#ifndef __out
109#define __out
110#endif
111
112#ifndef __out_opt
113#define __out_opt
114#endif
115
116#ifndef __deref_out
117#define __deref_out
118#endif
119
120#ifndef __reserved
121#define __reserved
122#endif
123
124W32_GCC_PRAGMA (GCC diagnostic push)
125W32_GCC_PRAGMA (GCC diagnostic ignored "-Wformat")
126W32_GCC_PRAGMA (GCC diagnostic ignored "-Wformat-extra-args")
127
128
138#define DEF_FUNC(ret, f, args) typedef ret (WINAPI *func_##f) args; \
139 static func_##f p_##f = NULL
140
141/* From "ws2_32.dll"
142 */
143DEF_FUNC (int, WSAStartup, (__in WORD version,
144 __inout WSADATA *data));
145
146DEF_FUNC (int, WSACleanup, (void));
147DEF_FUNC (int, WSAGetLastError, (void));
148
149DEF_FUNC (INT, WSAAddressToStringA,
150 (__in SOCKADDR *lpsaAddress,
151 __in DWORD dwAddressLength,
152 __in_opt WSAPROTOCOL_INFO *lpProtocolInfo,
153 __inout CHAR *lpszAddressString,
154 __inout DWORD *lpdwAddressStringLength));
155
156DEF_FUNC (INT, WSALookupServiceBeginA,
157 (__in WSAQUERYSETA *lpqsRestrictions,
158 __in DWORD dwControlFlags,
159 __out HANDLE *lphLookup));
160
161DEF_FUNC (INT, WSALookupServiceEnd,
162 (__in HANDLE lphLookup));
163
164DEF_FUNC (INT, WSALookupServiceNextA,
165 (__in HANDLE hLookup,
166 __in DWORD dwControlFlags,
167 __inout DWORD *lpdwBufferLength,
168 __out WSAQUERYSETA *lpqsResults));
169
170/* From "iphlpapi.dll"
171 */
172DEF_FUNC (ULONG, GetAdaptersAddresses,
173 (__in ULONG Family,
174 __in ULONG Flags,
175 __in void *Reserved,
176 __out IP_ADAPTER_ADDRESSES *AdapterAddresses,
177 __inout ULONG *outBufLen));
178
179DEF_FUNC (IP_ADAPTER_ORDER_MAP *, GetAdapterOrderMap, (void));
180
181DEF_FUNC (DWORD, GetIfTable,
182 (__out MIB_IFTABLE *pIfTable,
183 __inout ULONG *pdwSize,
184 __in BOOL bOrder));
185
186DEF_FUNC (DWORD, GetIfTable2, (__out MIB_IF_TABLE2 **table));
187DEF_FUNC (DWORD, GetIpInterfaceEntry, (__inout MIB_IPINTERFACE_ROW *row));
188
189DEF_FUNC (DWORD, GetIfTable2Ex, (__in MIB_IF_TABLE_LEVEL level,
190 __out MIB_IF_TABLE2 **table));
191
192DEF_FUNC (DWORD, GetIpNetTable,
193 (__out MIB_IPNETTABLE *table,
194 __inout ULONG *size,
195 __in BOOL sort));
196
197DEF_FUNC (DWORD, GetIpNetTable2,
198 (__in u_short family,
199 __out MIB_IPNET_TABLE2 **table));
200
201DEF_FUNC (void, FreeMibTable, (__in void *mem));
202
203DEF_FUNC (DWORD, GetIpAddrTable,
204 (__out MIB_IPADDRTABLE *table,
205 __inout ULONG *size,
206 __in BOOL order));
207
208DEF_FUNC (DWORD, GetBestRoute,
209 (__in DWORD dest_addr,
210 __in DWORD source_addr,
211 __out MIB_IPFORWARDROW *best_route));
212
213DEF_FUNC (DWORD, GetBestRoute2,
214 (__in_opt NET_LUID *interface_Luid,
215 __in NET_IFINDEX interface_index,
216 __in const SOCKADDR_INET *source_address,
217 __in const SOCKADDR_INET *destination_address,
218 __in ULONG address_sort_options,
219 __out MIB_IPFORWARD_ROW2 *best_route,
220 __out SOCKADDR_INET *best_source_address));
221
222DEF_FUNC (DWORD, GetIpForwardTable2,
223 (__in WORD family,
224 __out MIB_IPFORWARD_TABLE2 **table));
225
226DEF_FUNC (BOOL, GetIpForwardEntry2,
227 (__inout MIB_IPFORWARD_ROW2 *row));
228
229DEF_FUNC (DWORD, ConvertInterfaceLuidToIndex,
230 (__in const NET_LUID *luid,
231 __out NET_IFINDEX *index));
232
233DEF_FUNC (DWORD, ConvertInterfaceLuidToNameA,
234 (__in const NET_LUID *luid,
235 __out char *if_name,
236 __in size_t length));
237
238DEF_FUNC (DWORD, GetIfEntry, (__inout MIB_IFROW *if_row));
239
240DEF_FUNC (BOOL, GetIpNetworkConnectionBandwidthEstimates,
241 (__in NET_IFINDEX index,
242 __in ADDRESS_FAMILY family,
243 __out MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES *bw_estimates));
244
245DEF_FUNC (DWORD, GetNetworkParams,
246 (__inout FIXED_INFO *fixed_info,
247 __inout DWORD *size));
248
249/* From "rasapi32.dll"
250 */
251DEF_FUNC (DWORD, RasEnumConnectionsA,
252 (__inout RASCONN *lprasconn,
253 __inout DWORD *lpcb,
254 __out DWORD *lpcConnections));
255
256DEF_FUNC (DWORD, RasGetConnectionStatistics,
257 (__in HRASCONN hRasConn,
258 __inout RAS_STATS *lpStatistics));
259
260DEF_FUNC (DWORD, RasGetErrorStringA,
261 (__in UINT err,
262 __out CHAR *err_str,
263 __in DWORD size));
264
265DEF_FUNC (DWORD, RasGetProjectionInfoA,
266 (__in HRASCONN hrasconn,
267 __in RASPROJECTION rasprojection,
268 __out void *lpprojection,
269 __inout DWORD *lpcb));
270
271/* From "wlanapi.dll"
272 */
273DEF_FUNC (DWORD, WlanOpenHandle,
274 (__in DWORD dwClientVersion,
275 __reserved void *pReserved,
276 __out DWORD *pdwNegotiatedVersion,
277 __out HANDLE *phClientHandle));
278
279DEF_FUNC (DWORD, WlanCloseHandle,
280 (__in HANDLE dwClientHandle,
281 __reserved void *pReserved));
282
283DEF_FUNC (DWORD, WlanEnumInterfaces,
284 (__in HANDLE hClientHandle,
285 __reserved void *pReserved,
286 __deref_out WLAN_INTERFACE_INFO_LIST **ppInterfaceList));
287
288DEF_FUNC (DWORD, WlanQueryInterface,
289 (__in HANDLE hClientHandle,
290 __in const GUID *pInterfaceGuid,
291 __in WLAN_INTF_OPCODE OpCode,
292 __reserved void *pReserved,
293 __out DWORD *pdwDataSize,
294 __out void **ppData,
295 __out_opt WLAN_OPCODE_VALUE_TYPE *pWlanOpcodeValueType));
296
297DEF_FUNC (DWORD, WlanGetAvailableNetworkList,
298 (__in HANDLE hClientHandle,
299 __in const GUID *pInterfaceGuid,
300 __in DWORD dwFlags,
301 __reserved void *pReserved,
302 __out WLAN_AVAILABLE_NETWORK_LIST **AvailableNetworks));
303
304DEF_FUNC (DWORD, WlanGetNetworkBssList,
305 (__in HANDLE hClientHandle,
306 __in const GUID *pInterfaceGuid,
307 __in_opt const DOT11_SSID *pDot11Ssid,
308 __in DOT11_BSS_TYPE dot11BssType,
309 __in BOOL bSecurityEnabled,
310 __reserved void *pReserved,
311 __out WLAN_BSS_LIST **WlanBssList));
312
313DEF_FUNC (DWORD, WlanReasonCodeToString,
314 (__in DWORD dwReasonCode,
315 __in DWORD dwBufferSize,
316 __in WCHAR *pStringBuffer,
317 __reserved void *pReserved));
318
319DEF_FUNC (DWORD, WlanGetInterfaceCapability,
320 (__in HANDLE hClientHandle,
321 __in const GUID *pInterfaceGuid,
322 __reserved void *pReserved,
323 __out WLAN_INTERFACE_CAPABILITY **ppCapability));
324
325DEF_FUNC (DWORD, WlanGetSupportedDeviceServices,
326 (__in HANDLE hClientHandle,
327 __in const GUID *pInterfaceGuid,
328 __out WLAN_DEVICE_SERVICE_GUID_LIST2 **svc_guid_list));
329
330DEF_FUNC (void, WlanFreeMemory, (__in void *memory));
331
332/* From "ole32.dll"
333 */
334DEF_FUNC (int, StringFromGUID2,
335 (__in REFGUID rguid,
336 __out LPOLESTR lpsz,
337 __in int cchMax));
338
339struct one_addr {
340 char addr [MAX_IP6_SZ];
341 int family; /* AF_INET or AF_INET6 */
342 };
343
344typedef char address_buf [MAX_IP6_SZ+1];
345
346W32_DATA int _w32_errno;
347W32_FUNC unsigned long W32_CDECL _w32_intel (unsigned long x);
348W32_FUNC unsigned short W32_CDECL _w32_intel16 (unsigned short x);
349W32_FUNC const char *W32_CALL _w32_inet_ntop (int af, const void *src,
350 char *dst, size_t size);
351/*
352 * Some of the values under the Registry key
353 * HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\000x
354 */
355struct setup_info_st {
356 char *NetCfgInstanceId;
357 char *MatchingDeviceId;
358 char *DriverDate;
359 char *DriverVersion;
360 char *ComponentId;
361 char *DeviceInstanceID;
362 ULONGLONG NetworkInterfaceInstallTimestamp;
363 unsigned IfTypePreStart; /* 'IF_TYPE_xx' values from <ipifcons.h> */
364 struct setup_info_st *next;
365 };
366
367/* 50 elements should be plenty
368 */
369static struct setup_info_st setup_info [50];
370
371static void setup_info_get (void);
372static int setup_info_populate (const char *key_name, struct setup_info_st *info);
373static void setup_info_dump (void);
374static void setup_info_adapter_print (const char *adapter_name);
375static void setup_info_free (void);
376static const char *convert_ch_to_freq (int ch);
377static const char *get_if_type (DWORD if_type);
378
379static BOOL ipv4_only_iface = TRUE;
380static char work_buf [10000];
381static int verbose_level = 0;
382
383static void print_wlan_bss_list (const WLAN_BSS_LIST *bss_list);
384
385#define ADD_VALUE(dll, func) { NULL, dll, #func, (void**)&p_##func }
386
387static struct LoadTable dyn_funcs2[] = {
388 ADD_VALUE ("ws2_32.dll", WSAStartup),
389 ADD_VALUE ("ws2_32.dll", WSACleanup),
390 ADD_VALUE ("ws2_32.dll", WSAAddressToStringA),
391 ADD_VALUE ("ws2_32.dll", WSAGetLastError),
392 ADD_VALUE ("ws2_32.dll", WSALookupServiceBeginA),
393 ADD_VALUE ("ws2_32.dll", WSALookupServiceEnd),
394 ADD_VALUE ("ws2_32.dll", WSALookupServiceNextA),
395 ADD_VALUE ("ole32.dll", StringFromGUID2),
396 ADD_VALUE ("iphlpapi.dll", GetAdaptersAddresses),
397 ADD_VALUE ("iphlpapi.dll", GetAdapterOrderMap),
398 ADD_VALUE ("iphlpapi.dll", GetIfTable),
399 ADD_VALUE ("iphlpapi.dll", GetIfTable2),
400 ADD_VALUE ("iphlpapi.dll", GetIfTable2Ex),
401 ADD_VALUE ("iphlpapi.dll", GetIpInterfaceEntry),
402 ADD_VALUE ("iphlpapi.dll", GetIpNetTable),
403 ADD_VALUE ("iphlpapi.dll", GetIpNetTable2),
404 ADD_VALUE ("iphlpapi.dll", FreeMibTable),
405 ADD_VALUE ("iphlpapi.dll", GetIpAddrTable),
406 ADD_VALUE ("iphlpapi.dll", GetBestRoute),
407 ADD_VALUE ("iphlpapi.dll", GetBestRoute2),
408 ADD_VALUE ("iphlpapi.dll", GetIpForwardTable2),
409 ADD_VALUE ("iphlpapi.dll", GetIpForwardEntry2),
410 ADD_VALUE ("iphlpapi.dll", ConvertInterfaceLuidToIndex),
411 ADD_VALUE ("iphlpapi.dll", ConvertInterfaceLuidToNameA),
412 ADD_VALUE ("iphlpapi.dll", GetIpNetworkConnectionBandwidthEstimates),
413 ADD_VALUE ("iphlpapi.dll", GetNetworkParams),
414 ADD_VALUE ("rasapi32.dll", RasEnumConnectionsA),
415 ADD_VALUE ("rasapi32.dll", RasGetConnectionStatistics),
416 ADD_VALUE ("rasapi32.dll", RasGetErrorStringA),
417 ADD_VALUE ("rasapi32.dll", RasGetProjectionInfoA),
418 ADD_VALUE ("wlanapi.dll" , WlanOpenHandle),
419 ADD_VALUE ("wlanapi.dll" , WlanCloseHandle),
420 ADD_VALUE ("wlanapi.dll" , WlanEnumInterfaces),
421 ADD_VALUE ("wlanapi.dll" , WlanFreeMemory),
422 ADD_VALUE ("wlanapi.dll" , WlanGetAvailableNetworkList),
423 ADD_VALUE ("wlanapi.dll" , WlanGetNetworkBssList),
424 ADD_VALUE ("wlanapi.dll" , WlanQueryInterface),
425 ADD_VALUE ("wlanapi.dll" , WlanReasonCodeToString),
426 ADD_VALUE ("wlanapi.dll" , WlanGetInterfaceCapability),
427 ADD_VALUE ("wlanapi.dll" , WlanGetSupportedDeviceServices)
428 };
429
430/*
431 * Load the above DLLs, set func-ptrs and
432 * call the real WSAStartup().
433 */
434static BOOL load_dlls (void)
435{
436 BOOL rc;
437 WORD ver = MAKEWORD (2,2);
438 WSADATA data = { 0 };
439
440 rc = load_dynamic_table (dyn_funcs2, DIM(dyn_funcs2));
441 if (rc)
442 {
443 int err = (*p_WSAStartup) (ver, &data); /* Required for WSAAddressToStringA() etc. */
444 TRACE (3, "WSAStartup() -> err: %s\n"
445 " ver: %u.%u, high-ver: %u.%u, "
446 "description: \"%s\", status: \"%s\"\n",
447 err ? win_strerror ((*p_WSAGetLastError)()) : NONE_STR,
448 loBYTE(data.wVersion), hiBYTE(data.wVersion),
449 loBYTE(data.wHighVersion), hiBYTE(data.wHighVersion),
450 data.szDescription, data.szSystemStatus);
451 rc = (err == 0);
452 }
453 TRACE (3, "load_dlls(): %s.\n", rc ? "okay" : "failed");
454 return (rc);
455}
456
457/*
458 * The 'rundown()' (atexit()) handler for this module.
459 */
460static void W32_CALL pkt_win_exit (void)
461{
462 setup_info_free();
463 convert_ch_to_freq (-1); /* free the 'freq_to_ch_mapping' memory */
464
465 if (p_WSACleanup)
466 (*p_WSACleanup)();
467 unload_dynamic_table (dyn_funcs2, DIM(dyn_funcs2));
468}
469
470/*
471 * Main initializer for this module. Do this once:
472 * *) load DLLs.
473 * *) set func-ptrs.
474 * *) call the real WSAStartup().
475 */
476static BOOL pkt_win_init (void)
477{
478 static BOOL rc = FALSE;
479 static BOOL done = FALSE;
480
481 if (!done)
482 {
483 setup_info_get();
484 if (verbose_level >= 2)
485 setup_info_dump();
486 rc = load_dlls();
487 RUNDOWN_ADD (pkt_win_exit, 300);
488 }
489 done = TRUE;
490 return (rc);
491}
492
497static const char *_list_lookup (DWORD value, const struct search_list *list, int num)
498{
499 static char buf [sizeof("_IF_TYPE_DIGITAL_WRAPPER_OVERHEAD_CHANNEL")+1]; /* Longest return */
500
501 while (num > 0 && list->name)
502 {
503 if (list->type == value)
504 return (list->name);
505 num--;
506 list++;
507 }
508 sprintf (buf, "?%lu", (u_long)value);
509 return (buf);
510}
511
512#if defined(NOT_USED)
513static const struct search_list wsock_err_tab[] = {
514 { 10004, "Call interrupted" }, /* WSAEINTR */
515 };
516
517static const char *get_wsock_err (void)
518{
519 static char buf [100];
520 int err;
521
522 if (!p_WSAGetLastError)
523 return ("WS2_32.DLL not loaded");
524
525 err = (*p_WSAGetLastError)();
526
527 SNPRINTF (buf, sizeof(buf), "%s", err ?
528 _list_lookup(err, wsock_err_tab, DIM(wsock_err_tab)) : NONE_STR);
529 return (buf);
530}
531#endif
532
533static const char *get_guid_str (const GUID *guid)
534{
535 char *out;
536 const BYTE *bytes;
537 BYTE v, hi_nibble, lo_nibble;
538 GUID guid_copy = *guid;
539 int i, j;
540 static const char mask[] = "12345678-1234-1234-1234-123456789012";
541
542 /* The GUID is the "data-structure from hell": the 1st 64-bit are on
543 * big-endian format. But the rest are little endian. Go figure!
544 */
545 guid_copy.Data1 = _w32_intel (guid_copy.Data1);
546 guid_copy.Data2 = _w32_intel16 (guid_copy.Data2);
547 guid_copy.Data3 = _w32_intel16 (guid_copy.Data3);
548
549 /* E.g. guid: {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
550 */
551 bytes = (const BYTE*) &guid_copy;
552 out = work_buf;
553 *out++ = '{';
554
555 for (i = j = 0; i < sizeof(guid_copy); i++)
556 {
557 v = *bytes++;
558 lo_nibble = v % 16;
559 hi_nibble = v >> 4;
560 *out++ = hex_chars_upper [(int)hi_nibble];
561 *out++ = hex_chars_upper [(int)lo_nibble];
562 if (i == 3 || i == 5 || i == 7 || i == 9)
563 *out++ = '-';
564 assert (j < sizeof(mask)-1);
565 }
566 *out++ = '}';
567 *out++ = '\0';
568 return (work_buf);
569}
570
571/*
572 * Terminate a string 'buf' if 'ch' is found at the end.
573 */
574static char *strip_end (char *buf, char ch)
575{
576 char *p = buf + strlen(buf) - 1;
577
578 if (*p == ch)
579 *p = '\0';
580 return (buf);
581}
582
583/*
584 * Return TRUE if block at 'p' (with legnth 'len') contains only '0' bytes.
585 */
586static BOOL all_zeroes (const void *p, size_t len)
587{
588 const BYTE *x = (const BYTE*)p;
589 size_t i;
590
591 for (i = 0; i < len; i++, x++)
592 if (*x)
593 return (FALSE);
594 return (TRUE);
595}
596
597/*
598 * Function that prints the line argument while limiting it
599 * to at most 'MAX_CHARS_PER_LINE'. An appropriate number
600 * of spaces are added on subsequent lines.
601 *
602 * Stolen from Wget (main.c) and simplified.
603 */
604#define MAX_CHARS_PER_LINE 80
605
606static const char *format_line (const char *line, int indent)
607{
608 char *p, *p_max, *token, *line_dup = strdup (line);
609 int remaining_chars = MAX_CHARS_PER_LINE + indent;
610
611 p = work_buf;
612 p_max = p + sizeof(work_buf) - 1;
613
614 /* We break on commas.
615 */
616 token = strtok (line_dup, ",");
617 while (token && p < p_max)
618 {
619 /* If a token is much larger than the maximum
620 * line length, we print the token on the next line.
621 */
622 if (remaining_chars <= (int)strlen(token))
623 {
624 p += sprintf (p, "\n%*c", indent, ' ');
625 remaining_chars = MAX_CHARS_PER_LINE - indent;
626 }
627 p += sprintf (p, "%s,", token);
628 remaining_chars -= strlen (token) + 1; /* account for "," */
629 token = strtok (NULL, ",");
630 }
631 free (line_dup);
632 return strip_end (work_buf, ',');
633}
634
640static const char *dword_string (DWORD val)
641{
642 static char buf[8][20];
643 static int idx = 0;
644 char tmp[20];
645 char *rc = buf [idx++];
646
647 if (val < 1000UL)
648 {
649 sprintf (rc, "%lu", (u_long)val);
650 }
651 else if (val < 1000000UL) /* 1E6 */
652 {
653 sprintf (rc, "%lu.%03lu", (u_long)(val/1000UL), (u_long)(val % 1000UL));
654 }
655 else if (val < 1000000000UL) /* 1E9 */
656 {
657 sprintf (tmp, "%9lu", (u_long)val);
658 sprintf (rc, "%.3s.%.3s.%.3s", tmp, tmp+3, tmp+6);
659 }
660 else /* >= 1E9 */
661 {
662 sprintf (tmp, "%12lu", (u_long)val);
663 sprintf (rc, "%.3s.%.3s.%.3s.%.3s", tmp, tmp+3, tmp+6, tmp+9);
664 }
665 idx &= 7;
666 return strltrim (rc);
667}
668
674static const char *speed_string (DWORD val, char *buf)
675{
676 char suffix = '\0';
677 double fl_val;
678
679 if (val == 0UL)
680 return strcpy (buf, "0 B/s");
681
682 fl_val = (double) (val+1);
683 if (fl_val >= 1E9)
684 {
685 suffix = 'G';
686 fl_val /= 1E9;
687 }
688 else if (fl_val >= 1E6)
689 {
690 suffix = 'M';
691 fl_val /= 1E6;
692 }
693 else if (fl_val >= 1E3)
694 {
695 suffix = 'k';
696 fl_val /= 1E3;
697 }
698 sprintf (buf, "%.0f %cB/s", fl_val, suffix);
699 return (buf);
700}
701
702#if defined(ON_WIN_VISTA)
709static const char *speed64_string (ULONG64 val, char *buf)
710{
711 char suffix = '\0';
712 double fl_val;
713
714 if (val <= 1000000000ULL)
715 return speed_string ((DWORD)val, buf);
716
717 fl_val = (double) (val+1);
718 if (fl_val >= 1E12)
719 {
720 suffix = 'T';
721 fl_val /= 1E12;
722 }
723 else if (fl_val >= 1E9)
724 {
725 suffix = 'G';
726 fl_val /= 1E9;
727 }
728 sprintf (buf, "%.0f %cB/s", fl_val, suffix);
729 return (buf);
730}
731#endif
732
733/*
734 * Return string "<days> HH:MM:SS.MS" for a time in milli-seconds.
735 */
736static const char *duration_string (DWORD msec)
737{
738 static char buf[60];
739 DWORD sec = msec / 1000;
740 WORD hours = (WORD) (sec / 3600UL);
741 WORD mins = (WORD) (sec / 60) - (60 * hours);
742 WORD days = 0;
743 char *p = buf;
744
745 while (hours >= 24)
746 {
747 hours -= 24;
748 days++;
749 }
750 if (days > 1)
751 p += sprintf (p, "%ud ", days);
752
753 sprintf (p, "%02u:%02u:%02u.%lu", hours, mins, (UINT)(sec % 60UL), (u_long)(msec % sec));
754 return (buf);
755}
756
767#define KEY_NAME "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
768
769static void setup_info_get (void)
770{
771 struct setup_info_st *inf, *prev = NULL;
772 HKEY key = NULL;
773 int num;
774 DWORD rc = RegOpenKeyEx (HKEY_LOCAL_MACHINE, KEY_NAME, 0, KEY_READ, &key);
775
776 memset (&setup_info, '\0', sizeof(setup_info));
777 inf = setup_info + 0;
778
779 TRACE (3, "RegOpenKeyEx (HKEY_LOCAL_MACHINE\\%s, KEY_READ): %lu\n", KEY_NAME, rc);
780
781 for (num = 0; rc == ERROR_SUCCESS; num++)
782 {
783 char sub_key [700]; /* Full key name for this leaf */
784 char new_key [512]; /* The current leaf we're at now */
785 DWORD size = sizeof(new_key);
786
787 rc = RegEnumKeyEx (key, num, new_key, &size, NULL, NULL, NULL, NULL);
788 if (rc == ERROR_NO_MORE_ITEMS)
789 break;
790
791 SNPRINTF (sub_key, sizeof(sub_key), "%s\\%s", KEY_NAME, new_key);
792 TRACE (3, " RegOpenKeyEx (HKEY_LOCAL_MACHINE\\%s):\n", sub_key);
793 if (new_key[0] != '0')
794 {
795 TRACE (3, " Ignoring the rest of the leafs: %s\n", new_key);
796 break;
797 }
798 if (num >= DIM(setup_info)-1)
799 {
800 TRACE (3, " Too many leafs: %s\n", new_key);
801 break;
802 }
803 if (setup_info_populate(sub_key, inf) > 0)
804 {
805 inf->next = inf + 1;
806 prev = inf;
807 inf++;
808 }
809 }
810 if (prev)
811 prev->next = NULL;
812 if (key)
813 RegCloseKey (key);
814}
815
816static void setup_info_dump (void)
817{
818 struct setup_info_st *inf = setup_info + 0;
819 int i;
820
821 (*_printf) ("\nFrom setup_info:\n");
822 for (i = 0; inf; inf = inf->next, i++)
823 {
824 (*_printf) (" %2d: NetCfgInstanceId: %s\n"
825 " DriverDate: %s\n"
826 " DriverVersion: %s\n"
827 " ComponentId: %s\n"
828 " DeviceInstanceID: %s\n"
829 " IfTypePreStart: %s (%lu)\n"
830 " next: %p\n\n",
831 i,
832 inf->NetCfgInstanceId,
833 inf->DriverDate,
834 inf->DriverVersion,
835 inf->ComponentId,
836 inf->DeviceInstanceID,
837 get_if_type(inf->IfTypePreStart), inf->IfTypePreStart,
838 inf->next);
839 }
840}
841
851static void setup_info_adapter_print (const char *adapter_name)
852{
853 const struct setup_info_st *inf;
854 const char *DriverDate = "<unknown>";
855 const char *DriverVersion = "<unknown>";
856 const char *ComponentId = "<unknown>";
857 const char *DeviceInstanceID = "<unknown>";
858 const char *InstallTimeStamp = "<unknown>";
859 unsigned IfTypePreStart = 0;
860
861 for (inf = setup_info + 0; inf; inf = inf->next)
862 {
863 if (!inf->NetCfgInstanceId || strcmp(inf->NetCfgInstanceId, adapter_name))
864 continue;
865
866 IfTypePreStart = inf->IfTypePreStart;
867 DriverDate = inf->DriverDate ? inf->DriverDate : "<none>";
868 DriverVersion = inf->DriverVersion ? inf->DriverVersion : "<none>";
869 ComponentId = inf->ComponentId ? inf->ComponentId : "<none>";
870 DeviceInstanceID = inf->DeviceInstanceID ? inf->DeviceInstanceID : "<none>";
871 InstallTimeStamp = inf->NetworkInterfaceInstallTimestamp ?
872 ULONGLONG_to_ctime(inf->NetworkInterfaceInstallTimestamp) :
873 "<none>";
874 break;
875 }
876 (*_printf) (" From setup_info:\n");
877 (*_printf) (" InstallTimeStamp: %s\n", InstallTimeStamp);
878 (*_printf) (" DriverDate: %s\n", DriverDate);
879 (*_printf) (" DriverVersion: %s\n", DriverVersion);
880 (*_printf) (" ComponentId: %s\n", ComponentId);
881 (*_printf) (" DeviceInstanceID: %s\n", DeviceInstanceID);
882 (*_printf) (" IfTypePreStart: %s (%lu)\n", get_if_type(IfTypePreStart), IfTypePreStart);
883}
884
885static void setup_info_free (void)
886{
887 struct setup_info_st *inf;
888
889 for (inf = setup_info + 0 ; inf; inf = inf->next)
890 {
891 if (inf->NetCfgInstanceId)
892 free (inf->NetCfgInstanceId);
893 if (inf->MatchingDeviceId)
894 free (inf->MatchingDeviceId);
895 if (inf->DriverDate)
896 free (inf->DriverDate);
897 if (inf->DriverVersion)
898 free (inf->DriverVersion);
899 if (inf->ComponentId)
900 free (inf->ComponentId);
901 if (inf->DeviceInstanceID)
902 free (inf->DeviceInstanceID);
903 }
904 setup_info[0].next = NULL;
905}
906
907static const char *reg_type_name (DWORD type)
908{
909 return (type == REG_NONE ? "REG_NONE" :
910 type == REG_SZ ? "REG_SZ" :
911 type == REG_MULTI_SZ ? "REG_MULTI_SZ" :
912 type == REG_LINK ? "REG_LINK" :
913 type == REG_BINARY ? "REG_BINARY" :
914 type == REG_DWORD ? "REG_DWORD" :
915 type == REG_QWORD ? "REG_QWORD" :
916 type == REG_EXPAND_SZ ? "REG_EXPAND_SZ" :
917 type == REG_RESOURCE_LIST ? "REG_RESOURCE_LIST" :
918 type == REG_DWORD_BIG_ENDIAN ? "REG_DWORD_BIG_ENDIAN" : "?");
919}
920
921static int setup_info_populate (const char *key_name, struct setup_info_st *info)
922{
923 HKEY key = NULL;
924 DWORD num, rc = RegOpenKeyEx (HKEY_LOCAL_MACHINE, key_name, 0, KEY_READ, &key);
925 int added = 0;
926
927 if (rc != ERROR_SUCCESS)
928 {
929 (*_printf) (" Error opening registry key \"HKEY_LOCAL_MACHINE\\%s\", rc=%lu\n",
930 key_name, (u_long)rc);
931 return (0);
932 }
933
934 for (num = 0; rc == ERROR_SUCCESS; num++)
935 {
936 char value [512] = "\0";
937 char data [512] = "\0";
938 DWORD value_size = sizeof(value);
939 DWORD data_size = sizeof(data);
940 DWORD type = REG_NONE;
941 DWORD val32;
942 LONG64 val64;
943 const char *t_val = "";
944
945 rc = RegEnumValue (key, num, value, &value_size, NULL, &type, (LPBYTE)&data, &data_size);
946 if (rc == ERROR_NO_MORE_ITEMS)
947 break;
948
949 val32 = *(DWORD*) &data[0];
950 val64 = *(LONG64*) &data[0];
951
952 switch (type)
953 {
954 case REG_SZ:
955 TRACE (3, " %2lu: %-12s %-35s -> %s\n",
956 num, reg_type_name(type),
957 value[0] ? value : "(no value)",
958 data[0] ? data : "(no data)");
959
960 if (!strcmp(value, "NetCfgInstanceId"))
961 {
962 info->NetCfgInstanceId = strdup (data);
963 added++;
964 }
965 else if (!strcmp(value, "MatchingDeviceId"))
966 {
967 info->MatchingDeviceId = strdup (data);
968 added++;
969 }
970 else if (!strcmp(value, "DriverDate"))
971 {
972 info->DriverDate = strdup (data);
973 added++;
974 }
975 else if (!strcmp(value, "DriverVersion"))
976 {
977 info->DriverVersion = strdup (data);
978 added++;
979 }
980 else if (!strcmp(value, "DeviceInstanceID"))
981 {
982 info->DeviceInstanceID = strdup (data);
983 added++;
984 }
985 else if (!strcmp(value, "ComponentId"))
986 {
987 info->ComponentId = strdup (data);
988 added++;
989 }
990 break;
991
992 case REG_DWORD:
993 if (!strcmp(value, "IfTypePreStart"))
994 {
995 info->IfTypePreStart = val32;
996 added++;
997 }
998 TRACE (3, " %2lu: %-12s %-35s -> %lu\n",
999 num, reg_type_name(type), value[0] ? value : "(no value)", (u_long)val32);
1000 break;
1001
1002 case REG_QWORD:
1003 if (!strcmp(value, "NetworkInterfaceInstallTimestamp"))
1004 {
1005 info->NetworkInterfaceInstallTimestamp = (ULONGLONG)val64;
1006 t_val = ULONGLONG_to_ctime (info->NetworkInterfaceInstallTimestamp);
1007 added++;
1008 }
1009 TRACE (3, " %2lu: %-12s %-35s -> %" S64_FMT " %s\n",
1010 num, reg_type_name(type), value[0] ? value : "(no value)", val64, t_val);
1011 break;
1012
1013 default:
1014 TRACE (3, " %2lu: %-12s %-35s -> <ignored>\n",
1015 num, reg_type_name(type), value[0] ? value : "(no value)");
1016 break;
1017 }
1018 }
1019 TRACE (3, "\n");
1020 if (key)
1021 RegCloseKey (key);
1022 return (added);
1023}
1024
1025/*
1026 * Return a printable address from a 'SOCKADDR_INET*' union.
1027 * Use 4 buffers in round-robin.
1028 */
1029static const char *get_sockaddr_inet_str (const SOCKADDR_INET *sa)
1030{
1031 static address_buf abuf[4];
1032 static int idx = 0;
1033 char *rc = abuf [idx++];
1034
1035 strcpy (rc, "?");
1036
1037 if (sa->si_family == AF_INET)
1038 _w32_inet_ntop (_w32_AF_INET, &sa->Ipv4.sin_addr, rc, sizeof(abuf[0]));
1039
1040#if defined(USE_IPV6)
1041 else if (sa->si_family == AF_INET6)
1042 _w32_inet_ntop (_w32_AF_INET6, &sa->Ipv6.sin6_addr, rc, sizeof(abuf[0]));
1043#endif
1044
1045 idx &= 3;
1046 return (rc);
1047}
1048
1049/*
1050 * Print the count of ifaces not printed due to:
1051 * 1) verbose_level too low.
1052 * 2) not up
1053 * 3) filtered; name ends in "-000X".
1054 */
1055static int num_ifaces_skipped = 0;
1056static int num_ifaces_not_up = 0;
1057static int num_ifaces_filtered = 0;
1058
1059static void print_skipped (void)
1060{
1061 int sum = num_ifaces_skipped + num_ifaces_not_up + num_ifaces_filtered;
1062
1063 if (verbose_level >= 1 && sum > 0)
1064 (*_printf) ("** Skipped %d interfaces due to verbose level (%d not up, %d filtered)**.\n",
1065 sum, num_ifaces_not_up, num_ifaces_filtered);
1066
1067 num_ifaces_skipped = 0;
1068 num_ifaces_not_up = 0;
1069 num_ifaces_filtered = 0;
1070}
1071
1072static BOOL skip_this_iface (const IP_ADAPTER_ADDRESSES *addr, const MIB_IFROW *if_row, const void *_if_row2)
1073{
1074 if (verbose_level >= 2)
1075 return (FALSE);
1076
1077 if ((addr && addr->OperStatus != IfOperStatusUp) ||
1078 (if_row && if_row->dwSpeed == 0UL))
1079 num_ifaces_not_up++;
1080
1081 if (addr)
1082 {
1083#if defined(ON_WIN_VISTA)
1084 if (addr->ReceiveLinkSpeed == 0ULL || addr->TransmitLinkSpeed == 0ULL)
1085 return (TRUE);
1086#endif
1087 if (addr->OperStatus == IfOperStatusDown)
1088 return (TRUE);
1089 }
1090 else if (if_row)
1091 {
1092 if (if_row->dwSpeed == 0UL)
1093 return (TRUE);
1094 }
1095 else if (_if_row2)
1096 {
1097#if defined(ON_WIN_VISTA)
1098 const MIB_IF_ROW2 *if_row2 = (const MIB_IF_ROW2*) _if_row2;
1099
1100 if (if_row2->ReceiveLinkSpeed == 0ULL || if_row2->TransmitLinkSpeed == 0ULL)
1101 return (TRUE);
1102#endif
1103 }
1104 return (FALSE);
1105}
1106
1107/*
1108 * Skip interfaces that has a description ending in "-000x".
1109 * Handle both ASCII and UNICODE descriptions.
1110 */
1111static BOOL skip_filter_iface (const BYTE *descr_a, const wchar_t *descr_w)
1112{
1113 const char *end_a;
1114 const wchar_t *end_w;
1115
1116 if (verbose_level >= 2)
1117 return (FALSE);
1118
1119 if (descr_w)
1120 {
1121 end_w = wcschr (descr_w, L'\0') - 5;
1122// printf ("end_w: '%" WIDESTR_FMT "'\n", end_w);
1123 return (memcmp(end_w, (const void*)L"-000", 2*4) == 0);
1124 }
1125
1126 end_a = strchr ((const char*)descr_a, '\0') - 5;
1127//printf ("end_a: '%s'\n", end_a);
1128 return (memcmp(end_a, (const void*)"-000", 4) == 0);
1129}
1130
1131#undef ADD_VALUE
1132#define ADD_VALUE(v) { v, #v }
1133
1134static const struct search_list if_types[] = {
1135 { _IF_TYPE_OTHER, "Other type" },
1136 { _IF_TYPE_ETHERNET_CSMACD, "Ethernet" },
1137 { _IF_TYPE_ISO88025_TOKENRING, "Token Ring" },
1138 { _IF_TYPE_FDDI, "FDDI" },
1139 { _IF_TYPE_PPP, "Point-to-Point" },
1140 { _IF_TYPE_SOFTWARE_LOOPBACK, "Loopback" },
1141 { _IF_TYPE_ATM, "ATM" },
1142 { _IF_TYPE_IEEE80211, "IEEE 802.11 wireless" },
1143 { _IF_TYPE_TUNNEL, "Tunnel" },
1144 { _IF_TYPE_PROP_VIRTUAL, "Virtual" },
1145 { _IF_TYPE_IEEE1394, "IEEE 1394 (Firewire)" },
1146 { _IF_TYPE_IEEE80216_WMAN, "WiMax broadband" },
1147 { _IF_TYPE_WWANPP, "GSM mobile" },
1148 { _IF_TYPE_WWANPP2, "CDMA mobile" },
1149 { _IF_TYPE_REGULAR_1822, "Regular 1822" },
1150 { _IF_TYPE_HDH_1822, "HDH 1822" },
1151 { _IF_TYPE_DDN_X25, "DDN X25" },
1152 { _IF_TYPE_RFC877_X25, "RFC877 X25" },
1153 { _IF_TYPE_IS088023_CSMACD, "IS088023 CSMACD" },
1154 { _IF_TYPE_ISO88024_TOKENBUS, "ISO88024 TokenBus" },
1155 { _IF_TYPE_ISO88026_MAN, "ISO88026 MAN" },
1156 { _IF_TYPE_STARLAN, "StarLAN" },
1157 { _IF_TYPE_PROTEON_10MBIT, "Proteon 10MBit" },
1158 { _IF_TYPE_PROTEON_80MBIT, "Proteon 80MBit" },
1159 { _IF_TYPE_HYPERCHANNEL, "HyperChannel" },
1160 { _IF_TYPE_LAP_B, "LAP-B" },
1161 { _IF_TYPE_SDLC, "SDLC" },
1162 { _IF_TYPE_DS1, "DS1-MIB" },
1163 { _IF_TYPE_E1, "E1" },
1164 ADD_VALUE (_IF_TYPE_BASIC_ISDN),
1165 ADD_VALUE (_IF_TYPE_PRIMARY_ISDN),
1166 ADD_VALUE (_IF_TYPE_PROP_POINT2POINT_SERIAL),
1167 ADD_VALUE (_IF_TYPE_EON),
1168 ADD_VALUE (_IF_TYPE_ETHERNET_3MBIT),
1169 ADD_VALUE (_IF_TYPE_NSIP),
1170 ADD_VALUE (_IF_TYPE_SLIP),
1171 ADD_VALUE (_IF_TYPE_ULTRA),
1172 ADD_VALUE (_IF_TYPE_DS3),
1173 ADD_VALUE (_IF_TYPE_SIP),
1174 ADD_VALUE (_IF_TYPE_FRAMERELAY),
1175 ADD_VALUE (_IF_TYPE_RS232),
1176 ADD_VALUE (_IF_TYPE_PARA),
1177 ADD_VALUE (_IF_TYPE_ARCNET),
1178 ADD_VALUE (_IF_TYPE_ARCNET_PLUS),
1179 ADD_VALUE (_IF_TYPE_MIO_X25),
1180 ADD_VALUE (_IF_TYPE_SONET),
1181 ADD_VALUE (_IF_TYPE_X25_PLE),
1182 ADD_VALUE (_IF_TYPE_ISO88022_LLC),
1183 ADD_VALUE (_IF_TYPE_LOCALTALK),
1184 ADD_VALUE (_IF_TYPE_SMDS_DXI),
1185 ADD_VALUE (_IF_TYPE_FRAMERELAY_SERVICE),
1186 ADD_VALUE (_IF_TYPE_V35),
1187 ADD_VALUE (_IF_TYPE_HSSI),
1188 ADD_VALUE (_IF_TYPE_HIPPI),
1189 ADD_VALUE (_IF_TYPE_MODEM),
1190 ADD_VALUE (_IF_TYPE_AAL5),
1191 ADD_VALUE (_IF_TYPE_SONET_PATH),
1192 ADD_VALUE (_IF_TYPE_SONET_VT),
1193 ADD_VALUE (_IF_TYPE_SMDS_ICIP),
1194 ADD_VALUE (_IF_TYPE_PROP_MULTIPLEXOR),
1195 ADD_VALUE (_IF_TYPE_IEEE80212),
1196 ADD_VALUE (_IF_TYPE_FIBRECHANNEL),
1197 ADD_VALUE (_IF_TYPE_HIPPIINTERFACE),
1198 ADD_VALUE (_IF_TYPE_FRAMERELAY_INTERCONNECT),
1199 ADD_VALUE (_IF_TYPE_AFLANE_8023),
1200 ADD_VALUE (_IF_TYPE_AFLANE_8025),
1201 ADD_VALUE (_IF_TYPE_CCTEMUL),
1202 ADD_VALUE (_IF_TYPE_FASTETHER),
1203 ADD_VALUE (_IF_TYPE_ISDN),
1204 ADD_VALUE (_IF_TYPE_V11),
1205 ADD_VALUE (_IF_TYPE_V36),
1206 ADD_VALUE (_IF_TYPE_G703_64K),
1207 ADD_VALUE (_IF_TYPE_G703_2MB),
1208 ADD_VALUE (_IF_TYPE_QLLC),
1209 ADD_VALUE (_IF_TYPE_FASTETHER_FX),
1210 ADD_VALUE (_IF_TYPE_CHANNEL),
1211 ADD_VALUE (_IF_TYPE_IBM370PARCHAN),
1212 ADD_VALUE (_IF_TYPE_ESCON),
1213 ADD_VALUE (_IF_TYPE_DLSW),
1214 ADD_VALUE (_IF_TYPE_ISDN_S),
1215 ADD_VALUE (_IF_TYPE_ISDN_U),
1216 ADD_VALUE (_IF_TYPE_LAP_D),
1217 ADD_VALUE (_IF_TYPE_IPSWITCH),
1218 ADD_VALUE (_IF_TYPE_RSRB),
1219 ADD_VALUE (_IF_TYPE_ATM_LOGICAL),
1220 ADD_VALUE (_IF_TYPE_DS0),
1221 ADD_VALUE (_IF_TYPE_DS0_BUNDLE),
1222 ADD_VALUE (_IF_TYPE_BSC),
1223 ADD_VALUE (_IF_TYPE_ASYNC),
1224 ADD_VALUE (_IF_TYPE_CNR),
1225 ADD_VALUE (_IF_TYPE_ISO88025R_DTR),
1226 ADD_VALUE (_IF_TYPE_EPLRS),
1227 ADD_VALUE (_IF_TYPE_ARAP),
1228 ADD_VALUE (_IF_TYPE_PROP_CNLS),
1229 ADD_VALUE (_IF_TYPE_HOSTPAD),
1230 ADD_VALUE (_IF_TYPE_TERMPAD),
1231 ADD_VALUE (_IF_TYPE_FRAMERELAY_MPI),
1232 ADD_VALUE (_IF_TYPE_X213),
1233 ADD_VALUE (_IF_TYPE_ADSL),
1234 ADD_VALUE (_IF_TYPE_RADSL),
1235 ADD_VALUE (_IF_TYPE_SDSL),
1236 ADD_VALUE (_IF_TYPE_VDSL),
1237 ADD_VALUE (_IF_TYPE_ISO88025_CRFPRINT),
1238 ADD_VALUE (_IF_TYPE_MYRINET),
1239 ADD_VALUE (_IF_TYPE_VOICE_EM),
1240 ADD_VALUE (_IF_TYPE_VOICE_FXO),
1241 ADD_VALUE (_IF_TYPE_VOICE_FXS),
1242 ADD_VALUE (_IF_TYPE_VOICE_ENCAP),
1243 ADD_VALUE (_IF_TYPE_VOICE_OVERIP),
1244 ADD_VALUE (_IF_TYPE_ATM_DXI),
1245 ADD_VALUE (_IF_TYPE_ATM_FUNI),
1246 ADD_VALUE (_IF_TYPE_ATM_IMA),
1247 ADD_VALUE (_IF_TYPE_PPPMULTILINKBUNDLE),
1248 ADD_VALUE (_IF_TYPE_IPOVER_CDLC),
1249 ADD_VALUE (_IF_TYPE_IPOVER_CLAW),
1250 ADD_VALUE (_IF_TYPE_STACKTOSTACK),
1251 ADD_VALUE (_IF_TYPE_VIRTUALIPADDRESS),
1252 ADD_VALUE (_IF_TYPE_MPC),
1253 ADD_VALUE (_IF_TYPE_IPOVER_ATM),
1254 ADD_VALUE (_IF_TYPE_ISO88025_FIBER),
1255 ADD_VALUE (_IF_TYPE_TDLC),
1256 ADD_VALUE (_IF_TYPE_GIGABITETHERNET),
1257 ADD_VALUE (_IF_TYPE_HDLC),
1258 ADD_VALUE (_IF_TYPE_LAP_F),
1259 ADD_VALUE (_IF_TYPE_V37),
1260 ADD_VALUE (_IF_TYPE_X25_MLP),
1261 ADD_VALUE (_IF_TYPE_X25_HUNTGROUP),
1262 ADD_VALUE (_IF_TYPE_TRANSPHDLC),
1263 ADD_VALUE (_IF_TYPE_INTERLEAVE),
1264 ADD_VALUE (_IF_TYPE_FAST),
1265 ADD_VALUE (_IF_TYPE_IP),
1266 ADD_VALUE (_IF_TYPE_DOCSCABLE_MACLAYER),
1267 ADD_VALUE (_IF_TYPE_DOCSCABLE_DOWNSTREAM),
1268 ADD_VALUE (_IF_TYPE_DOCSCABLE_UPSTREAM),
1269 ADD_VALUE (_IF_TYPE_A12MPPSWITCH),
1270 ADD_VALUE (_IF_TYPE_COFFEE),
1271 ADD_VALUE (_IF_TYPE_CES),
1272 ADD_VALUE (_IF_TYPE_ATM_SUBINTERFACE),
1273 ADD_VALUE (_IF_TYPE_L2_VLAN),
1274 ADD_VALUE (_IF_TYPE_L3_IPVLAN),
1275 ADD_VALUE (_IF_TYPE_L3_IPXVLAN),
1276 ADD_VALUE (_IF_TYPE_DIGITALPOWERLINE),
1277 ADD_VALUE (_IF_TYPE_MEDIAMAILOVERIP),
1278 ADD_VALUE (_IF_TYPE_DTM),
1279 ADD_VALUE (_IF_TYPE_DCN),
1280 ADD_VALUE (_IF_TYPE_IPFORWARD),
1281 ADD_VALUE (_IF_TYPE_MSDSL),
1282 ADD_VALUE (_IF_TYPE_IF_GSN),
1283 ADD_VALUE (_IF_TYPE_DVBRCC_MACLAYER),
1284 ADD_VALUE (_IF_TYPE_DVBRCC_DOWNSTREAM),
1285 ADD_VALUE (_IF_TYPE_DVBRCC_UPSTREAM),
1286 ADD_VALUE (_IF_TYPE_ATM_VIRTUAL),
1287 ADD_VALUE (_IF_TYPE_MPLS_TUNNEL),
1288 ADD_VALUE (_IF_TYPE_SRP),
1289 ADD_VALUE (_IF_TYPE_VOICEOVERATM),
1290 ADD_VALUE (_IF_TYPE_VOICEOVERFRAMERELAY),
1291 ADD_VALUE (_IF_TYPE_IDSL),
1292 ADD_VALUE (_IF_TYPE_COMPOSITELINK),
1293 ADD_VALUE (_IF_TYPE_SS7_SIGLINK),
1294 ADD_VALUE (_IF_TYPE_PROP_WIRELESS_P2P),
1295 ADD_VALUE (_IF_TYPE_FR_FORWARD),
1296 ADD_VALUE (_IF_TYPE_RFC1483),
1297 ADD_VALUE (_IF_TYPE_USB),
1298 ADD_VALUE (_IF_TYPE_IEEE8023AD_LAG),
1299 ADD_VALUE (_IF_TYPE_BGP_POLICY_ACCOUNTING),
1300 ADD_VALUE (_IF_TYPE_FRF16_MFR_BUNDLE),
1301 ADD_VALUE (_IF_TYPE_H323_GATEKEEPER),
1302 ADD_VALUE (_IF_TYPE_H323_PROXY),
1303 ADD_VALUE (_IF_TYPE_MPLS),
1304 ADD_VALUE (_IF_TYPE_MF_SIGLINK),
1305 ADD_VALUE (_IF_TYPE_HDSL2),
1306 ADD_VALUE (_IF_TYPE_SHDSL),
1307 ADD_VALUE (_IF_TYPE_DS1_FDL),
1308 ADD_VALUE (_IF_TYPE_POS),
1309 ADD_VALUE (_IF_TYPE_DVB_ASI_IN),
1310 ADD_VALUE (_IF_TYPE_DVB_ASI_OUT),
1311 ADD_VALUE (_IF_TYPE_PLC),
1312 ADD_VALUE (_IF_TYPE_NFAS),
1313 ADD_VALUE (_IF_TYPE_TR008),
1314 ADD_VALUE (_IF_TYPE_GR303_RDT),
1315 ADD_VALUE (_IF_TYPE_GR303_IDT),
1316 ADD_VALUE (_IF_TYPE_ISUP),
1317 ADD_VALUE (_IF_TYPE_PROP_DOCS_WIRELESS_MACLAYER),
1318 ADD_VALUE (_IF_TYPE_PROP_DOCS_WIRELESS_DOWNSTREAM),
1319 ADD_VALUE (_IF_TYPE_PROP_DOCS_WIRELESS_UPSTREAM),
1320 ADD_VALUE (_IF_TYPE_HIPERLAN2),
1321 ADD_VALUE (_IF_TYPE_PROP_BWA_P2MP),
1322 ADD_VALUE (_IF_TYPE_SONET_OVERHEAD_CHANNEL),
1323 ADD_VALUE (_IF_TYPE_DIGITAL_WRAPPER_OVERHEAD_CHANNEL),
1324 ADD_VALUE (_IF_TYPE_AAL2),
1325 ADD_VALUE (_IF_TYPE_RADIO_MAC),
1326 ADD_VALUE (_IF_TYPE_ATM_RADIO),
1327 ADD_VALUE (_IF_TYPE_IMT),
1328 ADD_VALUE (_IF_TYPE_MVL),
1329 ADD_VALUE (_IF_TYPE_REACH_DSL),
1330 ADD_VALUE (_IF_TYPE_FR_DLCI_ENDPT),
1331 ADD_VALUE (_IF_TYPE_ATM_VCI_ENDPT),
1332 ADD_VALUE (_IF_TYPE_OPTICAL_CHANNEL),
1333 ADD_VALUE (_IF_TYPE_OPTICAL_TRANSPORT),
1334 ADD_VALUE (_IF_TYPE_IEEE802154),
1335 ADD_VALUE (_IF_TYPE_XBOX_WIRELESS)
1336 };
1337
1338static const struct search_list mib_oper_status[] = {
1339 { IF_OPER_STATUS_NON_OPERATIONAL, "disabled" },
1340 { IF_OPER_STATUS_UNREACHABLE, "WAN not connected" },
1341 { IF_OPER_STATUS_DISCONNECTED, "disconnected/no carrier" },
1342 { IF_OPER_STATUS_CONNECTING, "WAN connecting" },
1343 { IF_OPER_STATUS_CONNECTED, "WAN connected" },
1344 { IF_OPER_STATUS_OPERATIONAL, "LAN okay" }
1345 };
1346
1347static const struct search_list oper_status[] = {
1348 { IfOperStatusUp, "Up" },
1349 { IfOperStatusDown, "Down" },
1350 { IfOperStatusTesting, "Testing" },
1351 { IfOperStatusUnknown, "Unknown" },
1352 { IfOperStatusDormant, "Dormant" },
1353 { IfOperStatusNotPresent, "Not present" },
1354 { IfOperStatusLowerLayerDown, "Lower layer down" }
1355 };
1356
1357static const struct search_list arp_types[] = {
1358 { MIB_IPNET_TYPE_OTHER, "Other" },
1359 { MIB_IPNET_TYPE_INVALID, "Invalid" },
1360 { MIB_IPNET_TYPE_DYNAMIC, "Dynamic" },
1361 { MIB_IPNET_TYPE_STATIC, "Static" }
1362 };
1363
1364static const struct search_list neighbour_states[] = {
1365 { NlnsUnreachable, "Unreachable" },
1366 { NlnsIncomplete, "Incomplete" },
1367 { NlnsProbe, "Probe" },
1368 { NlnsDelay, "Delay" },
1369 /*
1370 * A typo in Watcom's <nt/nldef.h> calls this 'NlnsState'
1371 */
1372 { 4, "Stale" },
1373 { NlnsReachable, "Reachable" },
1374 { NlnsPermanent, "Permanent" }
1375 };
1376
1377#if defined(ON_WIN_VISTA_SP1)
1378 static const struct search_list conn_type[] = {
1379 { 0, "Unknown" },
1380 { NET_IF_CONNECTION_DEDICATED, "Dedicated" },
1381 { NET_IF_CONNECTION_PASSIVE, "Passive" },
1382 { NET_IF_CONNECTION_DEMAND, "Demand" }
1383 };
1384#endif
1385
1386#if defined(ON_WIN_VISTA) && defined(HAVE_NETIOAPI_H)
1387
1388#if (WINVER < 0x0601)
1389 #define NdisMediumWiMAX (NdisMediumMax-2)
1390 #define NdisMediumIP (NdisMediumMax-1)
1391#endif
1392
1393 static const struct search_list tunnel_types[] = {
1394 { TUNNEL_TYPE_NONE, "None" },
1395 { TUNNEL_TYPE_OTHER, "Other" },
1396 { TUNNEL_TYPE_DIRECT, "Direct" },
1397 { TUNNEL_TYPE_6TO4, "6to4" },
1398 { TUNNEL_TYPE_ISATAP, "ISATAP" },
1399 { TUNNEL_TYPE_TEREDO, "Teredo" }
1400 };
1401
1402 static const struct search_list media_types[] = {
1403 { NdisMedium802_3, "Ethernet 802.3" },
1404 { NdisMedium802_5, "TokenRing" },
1405 { NdisMediumFddi, "FDDI" },
1406 { NdisMediumWan, "WAN" },
1407 { NdisMediumLocalTalk, "LocalTalk" },
1408 { NdisMediumDix, "DIX" },
1409 { NdisMediumArcnetRaw, "ARCNET" },
1410 { NdisMediumArcnet878_2, "ARCNET (878.2)" },
1411 { NdisMediumAtm, "ATM" },
1412 { NdisMediumWirelessWan, "WWAN" },
1413 { NdisMediumIrda, "IrDA" },
1414 { NdisMediumBpc, "Broadcast PC" },
1415 { NdisMediumCoWan, "CoWan" },
1416 { NdisMedium1394, "IEEE 1394" },
1417 { NdisMediumInfiniBand, "InfiniBand" },
1418 { NdisMediumTunnel, "Tunnel" },
1419 { NdisMediumNative802_11, "IEEE 802.11" },
1420 { NdisMediumLoopback, "Loopback" },
1421 { NdisMediumWiMAX, "WiMax" },
1422 { NdisMediumIP, "IP" }
1423 };
1424
1425 static const struct search_list access_types[] = {
1426 { NET_IF_ACCESS_LOOPBACK, "Loopback" },
1427 { NET_IF_ACCESS_BROADCAST, "Broadcast" },
1428 { NET_IF_ACCESS_POINT_TO_POINT, "Point-to-point" },
1429 { NET_IF_ACCESS_POINT_TO_MULTI_POINT, "Point-to-Multipoint" }
1430 };
1431#endif
1432
1433#define SMI_IETF 0
1434
1435#if defined(HAVE_OUI_GENERATED_C)
1436 #include "oui-generated.c"
1437#endif
1438
1439static const char *get_phys_address (const void *a, ULONG len, BOOL show_manuf)
1440{
1441 const UCHAR *addr = (const UCHAR*) a;
1442 char *p, *p_max = work_buf + sizeof(work_buf) - 4;
1443 ULONG i;
1444
1445 ARGSUSED (show_manuf);
1446
1447 len = min (IF_MAX_PHYS_ADDRESS_LENGTH, len);
1448 if (len == 0)
1449 return (NONE_STR);
1450
1451 p = work_buf;
1452 for (i = 0; i < len && p < p_max; i++)
1453 {
1454 UCHAR b = addr [i];
1455
1456 *p++ = hex_chars_upper [b >> 4];
1457 *p++ = hex_chars_upper [b & 0xf];
1458 if (i < len-1)
1459 *p++ = ':';
1460 else *p = '\0';
1461 }
1462
1463#if defined(HAVE_OUI_GENERATED_C)
1480 if (show_manuf)
1481 {
1482 DWORD oui = (addr[0] << 16) + (addr[1] << 8) + addr[2];
1483 const char *comment = "";
1484 const char *rc = oui_val_to_name (oui);
1485
1486 if (!strcmp(rc, "Unknown OUI"))
1487 {
1488 oui = ((addr[0] & ~2) << 16) + (addr[1] << 8) + addr[2];
1489 rc = oui_val_to_name (oui);
1490 if (strcmp(rc, "Unknown OUI")) /* found it */
1491 comment = ", Locally Administered";
1492 }
1493 snprintf (p, p_max - p, " (%s%s)", rc, comment);
1494 }
1495#endif
1496 return (work_buf);
1497}
1498
1499static const char *get_address_flags (DWORD flags)
1500{
1501 char *p = work_buf;
1502
1503 *p = '\0';
1504
1505 if (flags == 0)
1506 return (NONE_STR);
1507
1508 if (flags & IP_ADAPTER_DDNS_ENABLED)
1509 p += sprintf (p, "Dynamic DNS enabled, ");
1510
1511 if (flags & IP_ADAPTER_REGISTER_ADAPTER_SUFFIX)
1512 p += sprintf (p, "Register DNS suffix, ");
1513
1514 if (flags & IP_ADAPTER_DHCP_ENABLED)
1515 p += sprintf (p, "DHCP enabled, ");
1516
1517 if (flags & IP_ADAPTER_RECEIVE_ONLY)
1518 p += sprintf (p, "Rx only, ");
1519
1520 if (flags & IP_ADAPTER_NO_MULTICAST)
1521 p += sprintf (p, "No multicast, ");
1522
1523 if (flags & IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG)
1524 p += sprintf (p, "IPv6 stateful config, ");
1525
1526 if (flags & IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED)
1527 p += sprintf (p, "NetBIOS over tcp/ip, ");
1528
1529 if (flags & IP_ADAPTER_IPV4_ENABLED)
1530 p += sprintf (p, "IPv4 enabled, ");
1531
1532 if (flags & IP_ADAPTER_IPV6_ENABLED)
1533 p += sprintf (p, "IPv6 enabled, ");
1534
1535 if (p > work_buf)
1536 *(p -= 2) = '\0';
1537
1538 assert (p < work_buf + sizeof(work_buf));
1539 return (work_buf);
1540}
1541
1542static const char *get_addr_common (int num, const address_buf *abuf)
1543{
1544 char *p = work_buf;
1545 int i;
1546
1547 *p = '\0';
1548 if (num == 0)
1549 return (NONE_STR);
1550
1551 for (i = 0; i < num; i++)
1552 {
1553 strncat (p, abuf[i], sizeof(abuf[0])-1);
1554 p += strlen (p);
1555 if (i < num - 1)
1556 {
1557 strcat (p, ", ");
1558 p += 2;
1559 }
1560 else
1561 break;
1562 }
1563 return strupr (work_buf);
1564}
1565
1566#if defined(ON_WIN_VISTA)
1567static const char *socket_addr_str (const SOCKET_ADDRESS *addr)
1568{
1569 static address_buf abuf;
1570 DWORD size = sizeof(abuf);
1571
1572 if (addr->iSockaddrLength == 0)
1573 {
1574 strcpy (abuf, NONE_STR);
1575 return (abuf);
1576 }
1577 if ((*p_WSAAddressToStringA) ((SOCKADDR*)&addr->lpSockaddr,
1578 addr->iSockaddrLength, NULL, abuf, &size))
1579 {
1580 sprintf (work_buf, "WSAAddressToString(): %s",
1581 win_strerror((*p_WSAGetLastError)()));
1582 return (work_buf);
1583 }
1584 return (abuf);
1585}
1586#endif
1587
1588#ifdef NOT_USED
1589static const char *socket_addr_str2 (const SOCKET_ADDRESS *addr)
1590{
1591 if (addr->iSockaddrLength == 0)
1592 strcpy (work_buf, NONE_STR);
1593 else
1594 {
1595 int af = addr->lpSockaddr->sa_family;
1596
1597 if (af != AF_INET && af != AF_INET6)
1598 sprintf (work_buf, "Unknown AF %d", af);
1599 else
1600 {
1601 address_buf abuf;
1602
1603 if (af == AF_INET6)
1604 af = _w32_AF_INET6;
1605
1606 if (!_w32_inet_ntop(af, &addr->lpSockaddr->sa_data, abuf, sizeof(abuf)))
1607 sprintf (work_buf, "inet_ntop(); error %d", _w32_errno);
1608 else strcpy (work_buf, abuf);
1609 }
1610 }
1611 return (work_buf);
1612}
1613#endif
1614
1615static const char *get_netmask_prefix (const IP_ADAPTER_PREFIX *pf)
1616{
1617 address_buf abuf;
1618 const SOCKET_ADDRESS *sa = &pf->Address;
1619 int af = sa->lpSockaddr->sa_family;
1620
1621 union {
1622 struct sockaddr_in sa4;
1623 struct sockaddr_in6 sa6;
1624 } addr;
1625
1626 if (sa->iSockaddrLength == 0)
1627 return strcpy (work_buf, NONE_STR);
1628
1629 memset (&addr, '\0', sizeof(addr));
1630 memcpy (&addr, sa->lpSockaddr, sa->iSockaddrLength);
1631
1632 if (af == AF_INET)
1633 {
1634 if (!_w32_inet_ntop(AF_INET, &addr.sa4.sin_addr, abuf, sizeof(abuf)))
1635 sprintf (work_buf, "inet_ntop(AF_INET); error %d", _w32_errno);
1636 else strcpy (work_buf, abuf);
1637 }
1638 else if (af == AF_INET6)
1639 {
1640#if defined(USE_IPV6)
1641 if (!_w32_inet_ntop(_w32_AF_INET6, &addr.sa6.sin6_addr, abuf, sizeof(abuf)))
1642 sprintf (work_buf, "inet_ntop(_w32_AF_INET6); error %d", _w32_errno);
1643 else
1644 {
1645 int scope = addr.sa6.sin6_scope_id;
1646 char *p;
1647
1648 strcpy (work_buf, abuf);
1649 if (scope > 0 && scope <= 15)
1650 {
1651 p = strchr (work_buf, '\0');
1652 *p++ = SCOPE_DELIMITER;
1653 *p++ = hex_chars_upper [scope];
1654 *p = '\0';
1655 }
1656 }
1657#else
1658 strcpy (work_buf, "AF_INET6 (USE_IPV6 not defined)");
1659#endif
1660 }
1661 else
1662 {
1663 sprintf (work_buf, "Unknown AF %d", af);
1664 }
1665 return (work_buf);
1666}
1667
1668#define GET_ONE_ADDR(addr, alen, buf, buf_sz) \
1669 if ((*p_WSAAddressToStringA) (addr, alen, NULL, buf, &buf_sz)) \
1670 { \
1671 (*_printf) (" WSAAddressToString(): %s\n", \
1672 win_strerror((*p_WSAGetLastError)())); \
1673 break; \
1674 }
1675 /* Or use 'getnameinfo (addr, alen, buf, buf_sz, NULL ,0, NI_NUMERICHOST)' ?? */
1676
1677#define GET_ADDRESSES(func, type, var) \
1678 static const char * func (const type * var) \
1679 { \
1680 address_buf abuf[10]; /* todo 'struct one_addr[10]' */ \
1681 int i; \
1682 \
1683 for (i = 0; var && i < DIM(abuf); i++) \
1684 { \
1685 SOCKADDR *addr = var->Address.lpSockaddr; \
1686 DWORD alen = var->Address.iSockaddrLength; \
1687 DWORD asize = sizeof(abuf[i]); \
1688 \
1689 if (addr->sa_family != AF_INET) \
1690 ipv4_only_iface = FALSE; \
1691 strcpy (abuf[i], "??"); \
1692 GET_ONE_ADDR (addr, alen, abuf[i], asize); \
1693 var = var->Next; \
1694 } \
1695 return get_addr_common (i, (const address_buf*)&abuf); \
1696 }
1697
1698 GET_ADDRESSES (get_unicast_addrs, IP_ADAPTER_UNICAST_ADDRESS, uca)
1699 GET_ADDRESSES (get_anycast_addrs, IP_ADAPTER_ANYCAST_ADDRESS, aca)
1700 GET_ADDRESSES (get_multicast_addrs, IP_ADAPTER_MULTICAST_ADDRESS, mca)
1701 GET_ADDRESSES (get_dns_server_addrs, IP_ADAPTER_DNS_SERVER_ADDRESS, dns)
1702
1703#if defined(ON_WIN_VISTA)
1704 GET_ADDRESSES (get_wins_addrs, IP_ADAPTER_WINS_SERVER_ADDRESS, wins)
1705 GET_ADDRESSES (get_gateway_addrs, IP_ADAPTER_GATEWAY_ADDRESS, gw)
1706
1707
1720 typedef struct luid_metrics {
1721 ULONG64 luid_value;
1722 ULONG metric;
1723 int family;
1724 } luid_metrics;
1725
1726 static struct luid_metrics metrics_cache [40];
1727
1728 static BOOL iface_store_metric (const NET_LUID *luid, DWORD metric, int family)
1729 {
1730 luid_metrics *lm = metrics_cache + 0;
1731 int i;
1732
1733 for (i = 0; i < DIM(metrics_cache); i++, lm++)
1734 {
1735 if (lm->luid_value == 0)
1736 {
1737 lm->luid_value = luid->Value;
1738 lm->metric = metric;
1739 lm->family = family;
1740 return (TRUE);
1741 }
1742 }
1743 return (FALSE); /* All buckets full */
1744 }
1745
1746 static DWORD iface_lookup_metric (const NET_LUID *luid, int family)
1747 {
1748 const luid_metrics *lm = metrics_cache + 0;
1749 int i;
1750
1751 for (i = 0; i < DIM(metrics_cache); i++, lm++)
1752 {
1753 if (lm->luid_value == luid->Value && lm->family == family)
1754 return (lm->metric);
1755 }
1756 return (0); /* not found!? */
1757 }
1758#endif /* ON_WIN_VISTA */
1759
1769static void dump_data (const void *data_p, UINT datalen, const char *indent)
1770{
1771 const BYTE *data = (const BYTE*) data_p;
1772 UINT ofs;
1773
1774 if (!indent)
1775 indent = "";
1776
1777 for (ofs = 0; ofs < datalen; ofs += 16)
1778 {
1779 UINT j;
1780
1781 if (ofs == 0)
1782 (*_printf) ("%s%u:%s%04X: ", indent, datalen,
1783 datalen > 9999 ? " " :
1784 datalen > 999 ? " " :
1785 datalen > 99 ? " " :
1786 datalen > 9 ? " " :
1787 " ",
1788 ofs);
1789 else (*_printf) ("%s %04X: ", indent, ofs);
1790
1791 for (j = 0; j < 16 && j+ofs < datalen; j++)
1792 (*_printf) ("%02X%c", (unsigned)data[j+ofs],
1793 j == 7 ? '-' : ' '); /* no beeps */
1794
1795 for ( ; j < 16; j++) /* pad line to 16 positions */
1796 (*_printf) (" ");
1797
1798 for (j = 0; j < 16 && j+ofs < datalen; j++)
1799 {
1800 int ch = data[j+ofs];
1801
1802 (*_printf) ("%c", ch < ' ' ? '.' : ch);
1803 }
1804 (*_printf) ("\n");
1805 }
1806 (*_printf) ("\n");
1807}
1808
1809/*
1810 * Use GetIfTable() and dump information from MIB.
1811 */
1812static int _pkt_win_print_GetIfTable (void)
1813{
1814 MIB_IFTABLE *if_table = NULL;
1815 ULONG out_len = 0;
1816 DWORD rc = 0;
1817 UINT i = 0;
1818
1819 if (!pkt_win_init())
1820 return (0);
1821
1822 (*_printf) ("\nFrom GetIfTable():\n");
1823
1824 if (!p_GetIfTable)
1825 {
1826 (*_printf) ("This function not available on this OS.");
1827 return (0);
1828 }
1829
1830 (*p_GetIfTable) (if_table, &out_len, TRUE);
1831 if_table = alloca (out_len);
1832 rc = (*p_GetIfTable) (if_table, &out_len, TRUE);
1833 if (rc != NO_ERROR)
1834 {
1835 (*_printf) ("error: %s\n", win_strerror(rc));
1836 return (0);
1837 }
1838
1839 (*_printf) (" Number of MIB entries: %ld\n", (long)if_table->dwNumEntries);
1840
1841 for (i = 0; i < if_table->dwNumEntries; i++)
1842 {
1843 const MIB_IFROW *if_row = (const MIB_IFROW*) (if_table->table + i);
1844
1845 if (skip_this_iface(NULL, if_row, NULL))
1846 {
1847 num_ifaces_skipped++;
1848 continue;
1849 }
1850 if (skip_filter_iface(if_row->bDescr, NULL))
1851 {
1852 num_ifaces_filtered++;
1853 continue;
1854 }
1855
1856 print_mib_if_row (i, if_row);
1857 }
1858 return (1);
1859}
1860
1861/*
1862 * Use GetIfTable2() and dump information from MIB.
1863 */
1864static int _pkt_win_print_GetIfTable2 (void)
1865{
1866#if !defined(ON_WIN_VISTA) || !defined(HAVE_NETIOAPI_H)
1867 (*_printf) ("%s(%u): MIB_IF_TABLE2 not available with this compiler/SDK.",
1868 __FILE__, __LINE__);
1869 return (0);
1870
1871#else
1872 MIB_IF_TABLE2 *if_table2 = NULL;
1873 BOOL rc;
1874 ULONG i;
1875
1876 if (!pkt_win_init())
1877 return (0);
1878
1879 (*_printf) ("\nFrom GetIfTable2():\n");
1880
1881 if (!p_GetIfTable2 || !p_FreeMibTable)
1882 {
1883 (*_printf) ("This function not available on this OS.");
1884 return (0);
1885 }
1886
1887 rc = (*p_GetIfTable2) (&if_table2);
1888 if (rc != NO_ERROR)
1889 {
1890 (*_printf) ("error: %s\n", win_strerror(rc));
1891 return (0);
1892 }
1893
1894 (*_printf) (" Number of MIB entries: %ld\n", if_table2->NumEntries);
1895
1896 for (i = 0; i < if_table2->NumEntries; i++)
1897 {
1898 const MIB_IF_ROW2 *if_row2 = if_table2->Table + i;
1899
1900 if (skip_this_iface(NULL, NULL, if_row2))
1901 {
1902 num_ifaces_skipped++;
1903 continue;
1904 }
1905 if (skip_filter_iface(NULL, if_row2->Description))
1906 {
1907 num_ifaces_filtered++;
1908 continue;
1909 }
1910
1911 print_mib_if_row2 (i, if_row2);
1912 if (i < if_table2->NumEntries-1)
1913 (*_printf) ("\n");
1914 }
1915 (*p_FreeMibTable) (if_table2);
1916 return (1);
1917#endif
1918}
1919
1920static void print_mib_if_row (DWORD index, const MIB_IFROW *row)
1921{
1922 char speed[30];
1923
1924 ARGSUSED (index);
1925
1926 /* Note: The 'row->wszName' may *not* have the same GUID
1927 * as returned in 'GetAdapteraddresses()' despite it's the same
1928 * interface. To verify same interface, we can compare the
1929 * descriptions from the 2 API functions.
1930 */
1931 (*_printf) (" Interface name: %.*s\n", MAX_INTERFACE_NAME_LEN, wstring_utf8(row->wszName));
1932 (*_printf) (" Description: %.*s\n", MAXLEN_IFDESCR, row->bDescr);
1933
1934 (*_printf) (" MTU: %lu\n", (u_long)row->dwMtu);
1935 (*_printf) (" Speed: %s\n", speed_string(row->dwSpeed,speed));
1936 (*_printf) (" Status: %s\n",
1937 _list_lookup(row->dwOperStatus, mib_oper_status, DIM(mib_oper_status)));
1938
1939 #define COLUMN_FORMAT "%13.13s %13.13s %13.13s %13.13s %13.13s %13.13s\n"
1940
1941 (*_printf) (" " COLUMN_FORMAT,
1942 "Bytes", "Unicasts", "Non-unicasts", "Discarded", "Errors", "Unk Proto");
1943
1944 (*_printf) (" In: " COLUMN_FORMAT,
1945 dword_string(row->dwInOctets), dword_string(row->dwInUcastPkts),
1946 dword_string(row->dwInNUcastPkts), dword_string(row->dwInDiscards),
1947 dword_string(row->dwInErrors), dword_string(row->dwInUnknownProtos));
1948
1949 (*_printf) (" Out: " COLUMN_FORMAT "\n",
1950 dword_string(row->dwOutOctets), dword_string(row->dwOutUcastPkts),
1951 dword_string(row->dwOutNUcastPkts), dword_string(row->dwOutDiscards),
1952 dword_string(row->dwOutErrors), NA_STR);
1953}
1954
1955#if defined(ON_WIN_VISTA) && defined(HAVE_NETIOAPI_H)
1956static void print_ip_interface_details (const NET_LUID *luid, int family, int indent)
1957{
1958#if defined(__WATCOMC__)
1959 (*_printf) ("Not for Watcom.\n");
1960
1961#else
1962 MIB_IPINTERFACE_ROW row;
1963 DWORD rc;
1964
1965 if (!p_GetIpInterfaceEntry)
1966 {
1967 (*_printf) ("p_GetIpInterfaceEntry == NULL\n");
1968 return;
1969 }
1970
1971 memset (&row, '\0', sizeof(row));
1972 memcpy (&row.InterfaceLuid, luid, sizeof(*luid));
1973 row.Family = family;
1974
1975 rc = (*p_GetIpInterfaceEntry) (&row);
1976 if (rc != NO_ERROR)
1977 {
1978 if (rc == ERROR_NOT_FOUND)
1979 (*_printf) ("NOT_FOUND\n");
1980 else (*_printf) ("error: %s\n", win_strerror(rc));
1981 return;
1982 }
1983
1984 #define IF_PRINT0(fmt, what) (*_printf) ("%s:%*s" fmt "\n", \
1985 #what, (int)(44-strlen(#what)), "", \
1986 row.what)
1987
1988 #define IF_PRINT(fmt, what) (*_printf) ("%*s%s:%*s" fmt "\n", \
1989 indent, "", #what, (int)(44-strlen(#what)), "", \
1990 row.what)
1991 IF_PRINT0("%d", Family);
1992 IF_PRINT ("%lu", InterfaceIndex);
1993 IF_PRINT ("%d", ForwardingEnabled);
1994 IF_PRINT ("%d", WeakHostSend);
1995 IF_PRINT ("%d", WeakHostReceive);
1996 IF_PRINT ("%d", UseAutomaticMetric);
1997 IF_PRINT ("%d", UseNeighborUnreachabilityDetection);
1998 IF_PRINT ("%d", ManagedAddressConfigurationSupported);
1999 IF_PRINT ("%d", OtherStatefulConfigurationSupported);
2000 IF_PRINT ("%d", AdvertiseDefaultRoute);
2001 IF_PRINT ("%d", RouterDiscoveryBehavior);
2002 IF_PRINT ("%lu", DadTransmits);
2003 IF_PRINT ("%lu", BaseReachableTime);
2004 IF_PRINT ("%lu", RetransmitTime);
2005 IF_PRINT ("%lu", PathMtuDiscoveryTimeout);
2006 IF_PRINT ("%d", LinkLocalAddressBehavior);
2007 IF_PRINT ("%lu", LinkLocalAddressTimeout);
2008 IF_PRINT ("%lu", SitePrefixLength);
2009 IF_PRINT ("%lu", Metric);
2010 IF_PRINT ("%lu", NlMtu);
2011 IF_PRINT ("%d", SupportsWakeUpPatterns);
2012 IF_PRINT ("%d", SupportsNeighborDiscovery);
2013 IF_PRINT ("%d", SupportsRouterDiscovery);
2014 IF_PRINT ("%lu", ReachableTime);
2015 IF_PRINT ("%lu", MinRouterAdvertisementInterval);
2016 IF_PRINT ("%lu", MaxRouterAdvertisementInterval);
2017 IF_PRINT ("%d", Connected);
2018
2019 IF_PRINT ("%d", TransmitOffload.NlChecksumSupported);
2020 IF_PRINT ("%d", TransmitOffload.NlOptionsSupported);
2021 IF_PRINT ("%d", TransmitOffload.TlDatagramChecksumSupported);
2022 IF_PRINT ("%d", TransmitOffload.TlStreamChecksumSupported);
2023 IF_PRINT ("%d", TransmitOffload.TlStreamOptionsSupported);
2024 IF_PRINT ("%d", TransmitOffload.FastPathCompatible);
2025 IF_PRINT ("%d", TransmitOffload.TlLargeSendOffloadSupported);
2026 IF_PRINT ("%d", TransmitOffload.TlGiantSendOffloadSupported);
2027
2028 IF_PRINT ("%d", ReceiveOffload.NlChecksumSupported);
2029 IF_PRINT ("%d", ReceiveOffload.NlOptionsSupported);
2030 IF_PRINT ("%d", ReceiveOffload.TlDatagramChecksumSupported);
2031 IF_PRINT ("%d", ReceiveOffload.TlStreamChecksumSupported);
2032 IF_PRINT ("%d", ReceiveOffload.TlStreamOptionsSupported);
2033 IF_PRINT ("%d", ReceiveOffload.FastPathCompatible);
2034 IF_PRINT ("%d", ReceiveOffload.TlLargeSendOffloadSupported);
2035 IF_PRINT ("%d", ReceiveOffload.TlGiantSendOffloadSupported);
2036
2037 #undef IF_PRINT
2038#endif /* __WATCOMC__ */
2039}
2040
2041static const char *get_if_type (DWORD if_type)
2042{
2043 const char *ret = _list_lookup (if_type, if_types, DIM(if_types));
2044
2045 if (!strncmp(ret, "_IF_TYPE_", 9))
2046 ret += 9;
2047 return (ret);
2048}
2049
2050static void print_mib_if_row2 (DWORD index, const MIB_IF_ROW2 *row)
2051{
2052 char speed [30];
2053 BOOL is_teredo = (row->Type == _IF_TYPE_TUNNEL &&
2054 wcsncmp(row->Alias, L"Teredo", 6) == 0);
2055
2056 (*_printf) (" GUID: %s\n", get_guid_str(&row->InterfaceGuid));
2057 (*_printf) (" Alias: %.*" WIDESTR_FMT "\n", IF_MAX_STRING_SIZE, row->Alias);
2058 (*_printf) (" Description: %.*" WIDESTR_FMT "\n", IF_MAX_STRING_SIZE, row->Description);
2059 (*_printf) (" MAC-address: %s\n", is_teredo ? NONE_STR "?" : get_phys_address(&row->PhysicalAddress, row->PhysicalAddressLength, TRUE));
2060 (*_printf) (" MTU: %lu\n", row->Mtu);
2061 (*_printf) (" Type: %s (%lu)\n", get_if_type(row->Type), row->Type);
2062
2063 if (row->Type == _IF_TYPE_TUNNEL)
2064 (*_printf) (" Tunnel type: %s (%d)\n",
2065 _list_lookup(row->TunnelType, tunnel_types, DIM(tunnel_types)), row->TunnelType);
2066
2067 (*_printf) (" Media type: %s (%d)\n",
2068 _list_lookup(row->MediaType, media_types, DIM(media_types)), row->MediaType);
2069
2070 (*_printf) (" Access type: %s (%d)\n",
2071 _list_lookup(row->AccessType, access_types, DIM(access_types)), row->AccessType);
2072
2073 (*_printf) (" Tx speed: %s\n", speed64_string(row->TransmitLinkSpeed, speed));
2074 (*_printf) (" Rx speed: %s\n", speed64_string(row->ReceiveLinkSpeed, speed));
2075
2076 if (verbose_level >= 1)
2077 {
2078 int indent = sizeof (" LUID: ") - 1;
2079
2080 (*_printf) (" LUID: ");
2081 print_net_luid (&row->InterfaceLuid, indent);
2082
2083 if (verbose_level >= 2)
2084 {
2085 (*_printf) (" Entry (AF_INET): ");
2086 indent = sizeof (" Entry (AF_INET): ") - 1;
2087 print_ip_interface_details (&row->InterfaceLuid, AF_INET, indent);
2088
2089 (*_printf) (" Entry (AF_INET6): ");
2090 indent = sizeof (" Entry (AF_INET6): ") - 1;
2091 print_ip_interface_details (&row->InterfaceLuid, AF_INET6, indent);
2092 }
2093 }
2094}
2095
2096#else
2097static const char *get_if_type (DWORD if_type)
2098{
2099 static char buf [10];
2100
2101 return itoa ((int)if_type, buf, 10);
2102}
2103#endif /* ON_WIN_VISTA && HAVE_NETIOAPI_H */
2104
2105/*
2106 * Use GetIfTable2Ex() and dump information from MIB.
2107 */
2108static int _pkt_win_print_GetIfTable2Ex (void)
2109{
2110#if !defined(ON_WIN_VISTA) || !defined(HAVE_NETIOAPI_H)
2111 (*_printf) ("%s(%u): MIB_IF_TABLE2 not available with this compiler/SDK.",
2112 __FILE__, __LINE__);
2113 return (0);
2114#else
2115 MIB_IF_TABLE2 *if_table2 = NULL;
2116 BOOL rc;
2117 ULONG i;
2118
2119 if (!pkt_win_init())
2120 return (0);
2121
2122 (*_printf) ("\nFrom GetIfTable2Ex():\n");
2123
2124 if (!p_GetIfTable2Ex || !p_FreeMibTable)
2125 {
2126 (*_printf) ("This function not available on this OS.");
2127 return (0);
2128 }
2129
2130 rc = (*p_GetIfTable2Ex) (MibIfTableRaw, &if_table2);
2131 if (rc != NO_ERROR)
2132 {
2133 (*_printf) ("error: %s\n", win_strerror(rc));
2134 return (0);
2135 }
2136
2137 (*_printf) (" Number of MIB entries: %ld\n", if_table2->NumEntries);
2138
2139 for (i = 0; i < if_table2->NumEntries; i++)
2140 {
2141 const MIB_IF_ROW2 *if_row2 = if_table2->Table + i;
2142
2143 if (skip_this_iface(NULL, NULL, if_row2))
2144 {
2145 num_ifaces_skipped++;
2146 continue;
2147 }
2148 if (skip_filter_iface(NULL, if_row2->Description))
2149 {
2150 num_ifaces_filtered++;
2151 continue;
2152 }
2153
2154 print_mib_if_row2 (i, if_row2);
2155 if (i < if_table2->NumEntries-1)
2156 (*_printf) ("\n");
2157 }
2158
2159 (*p_FreeMibTable) (if_table2);
2160 return (1);
2161#endif
2162}
2163
2164/*
2165 * Use GetIpNetTable() and dump ARP information from MIB.
2166 * IPv4 addresses only.
2167 * Sort on Type ('arp_types[]') then on dwAddr.
2168 */
2169static int _pkt_win_print_GetIpNetTable (void)
2170{
2171 MIB_IPNETTABLE *table;
2172 DWORD i, rc, len = 0;
2173
2174 if (!pkt_win_init() || !p_GetIpNetTable)
2175 return (0);
2176
2177 (*_printf) ("\nFrom GetIpNetTable():\n");
2178
2179 rc = (*p_GetIpNetTable) (NULL, &len, FALSE);
2180 if (rc == ERROR_INSUFFICIENT_BUFFER)
2181 table = alloca (len);
2182 else
2183 {
2184 (*_printf) (" Error: %s\n", win_strerror(rc));
2185 return (0);
2186 }
2187
2188 rc = (*p_GetIpNetTable) (table, &len, TRUE);
2189 if (rc != NO_ERROR && rc != ERROR_NO_DATA)
2190 {
2191 (*_printf) (" Error: %s\n", win_strerror(rc));
2192 return (0);
2193 }
2194
2195 qsort (table->table, table->dwNumEntries, sizeof(MIB_IPNETROW), compare_ipnetrow);
2196
2197 for (i = 0; i < table->dwNumEntries; i++)
2198 print_mib_ipnetrow (i, table->table + i);
2199 return (0);
2200}
2201
2202/*
2203 * Use GetIpNetTable2() and dump ARP information from MIB.
2204 * IPv4 + IPv6 addresses.
2205 * Sort on State (neighbour_state) and then on
2206 * 'row->ReachabilityTime.LastReachable'.
2207 */
2208static int _pkt_win_print_GetIpNetTable2 (void)
2209{
2210 MIB_IPNET_TABLE2 *table = NULL;
2211 DWORD i, rc;
2212
2213 if (!pkt_win_init() || !p_GetIpNetTable2 || !p_FreeMibTable)
2214 return (0);
2215
2216 (*_printf) ("\nFrom GetIpNetTable2():\n");
2217
2218 rc = (*p_GetIpNetTable2) (AF_UNSPEC, &table);
2219 if (rc != NO_ERROR && rc != ERROR_NOT_FOUND)
2220 {
2221 (*_printf) (" Error: %s\n", win_strerror(rc));
2222 return (0);
2223 }
2224
2225 qsort (table->Table, table->NumEntries, sizeof(MIB_IPNET_ROW2), compare_ipnetrow2);
2226
2227 for (i = 0; i < table->NumEntries; i++)
2228 print_mib_ipnet_row2 (i, table->Table + i);
2229
2230 (*p_FreeMibTable) (table);
2231 return (0);
2232}
2233
2234/*
2235 * Use GetIpAddrTable().
2236 */
2237static int _pkt_win_print_GetIpAddrTable (void)
2238{
2239 /* \todo */
2240 (*_printf) ("\nFrom GetIpAddrTable(): <not implemented>\n");
2241 return (0);
2242}
2243
2244static int _pkt_win_print_GetNetworkParams (void)
2245{
2246#if defined(__WATCOMC__)
2247 (*_printf) ("\nFrom GetNetworkParams():\n Not for Watcom.\n");
2248 return (0);
2249
2250#else
2251 static const struct search_list node_types[] = {
2252 { BROADCAST_NODETYPE, "Broadcast node" },
2253 { PEER_TO_PEER_NODETYPE, "Peer-to-peer node" },
2254 { MIXED_NODETYPE, "Mixed node" },
2255 { HYBRID_NODETYPE, "Hybrid node" }
2256 };
2257
2258 FIXED_INFO *fi = alloca (sizeof(*fi));
2259 DWORD size = 0;
2260 IP_ADDR_STRING *ip;
2261 int i;
2262
2263 (*_printf) ("\nFrom GetNetworkParams():\n");
2264
2265 if (!p_GetNetworkParams)
2266 {
2267 (*_printf) (" This function not available on this OS.");
2268 return (0);
2269 }
2270
2271 if ((*p_GetNetworkParams)(fi, &size) != ERROR_BUFFER_OVERFLOW)
2272 {
2273 (*_printf) (" error: %s\n", win_strerror ((*p_WSAGetLastError)()));
2274 return (0);
2275 }
2276
2277 fi = alloca (size);
2278 if ((*p_GetNetworkParams)(fi, &size) != ERROR_SUCCESS)
2279 {
2280 (*_printf) (" error: %s\n", win_strerror ((*p_WSAGetLastError)()));
2281 return (0);
2282 }
2283
2284 (*_printf) (" Host Name: %s\n", fi->HostName);
2285 (*_printf) (" Domain Name: %s\n", fi->DomainName[0] ? fi->DomainName : NONE_STR);
2286 (*_printf) (" DNS Servers: %-15s (primary)\n", fi->DnsServerList.IpAddress.String);
2287
2288 for (i = 1, ip = fi->DnsServerList.Next; ip; ip = ip->Next, i++)
2289 (*_printf) (" %-15s (secondary %d)\n", ip->IpAddress.String, i);
2290
2291 (*_printf) (" Node Type: %s\n", _list_lookup(fi->NodeType, node_types, DIM(node_types)));
2292 (*_printf) (" DHCP scope: %s\n", fi->ScopeId[0] ? fi->ScopeId : NONE_STR);
2293 (*_printf) (" Routing: %s\n", fi->EnableRouting ? "Enabled" : "Disabled");
2294 (*_printf) (" ARP proxy: %s\n", fi->EnableProxy ? "Enabled" : "Disabled");
2295 (*_printf) (" DNS enabled: %s\n", fi->EnableDns ? "Yes" : "No");
2296 return (1);
2297#endif
2298}
2299
2300/*
2301 * Use GetAdaptersAddresses and dump information on all IPv4/IPv6 adapters;
2302 * use AF_UNSPEC to get info on all.
2303 *
2304 * Rewritten from an MSDN example:
2305 * http://msdn.microsoft.com/en-us/library/aa366058(v=vs.85).aspx
2306 *
2307 * Also refer these:
2308 * http://www.ipv6style.jp/files/ipv6/en/apps/20060320_2/GetAdaptersAddresses-EN.c
2309 * https://code.woboq.org/qt5/qtbase/src/plugins/bearer/nativewifi/qnativewifiengine.cpp.html
2310 */
2311static int _pkt_win_print_GetAdaptersAddresses (void)
2312{
2313 DWORD rc = 0;
2314 UINT num, num_pfx, i = 0;
2315 ULONG family = AF_UNSPEC;
2316 ULONG out_len = 0;
2317 ULONG flags = GAA_FLAG_INCLUDE_PREFIX |
2318 GAA_FLAG_INCLUDE_ALL_INTERFACES |
2319 GAA_FLAG_INCLUDE_WINS_INFO |
2320 GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER |
2321 GAA_FLAG_INCLUDE_GATEWAYS;
2322
2323 IP_ADAPTER_ADDRESSES *addr = NULL;
2324 IP_ADAPTER_ADDRESSES *old_addr = NULL;
2325 IP_ADAPTER_PREFIX *prefix = NULL;
2326
2327//flags |= GAA_FLAG_SKIP_FRIENDLY_NAME;
2328
2329 if (!pkt_win_init())
2330 return (0);
2331
2332 (*_printf) ("\nFrom GetAdaptersAddresses():\n");
2333
2334 /* Make an initial call to GetAdaptersAddresses() to get the
2335 * size needed into the out_len variable.
2336 */
2337 rc = (*p_GetAdaptersAddresses) (family, flags, NULL, NULL, &out_len);
2338 if (rc != ERROR_BUFFER_OVERFLOW)
2339 {
2340 (*_printf) (" Error: %s\n", win_strerror(rc));
2341 return (0);
2342 }
2343
2344 addr = alloca (out_len);
2345
2346 /* Make a second call to GetAdaptersAddresses() to get the
2347 * actual data we want
2348 */
2349 rc = (*p_GetAdaptersAddresses) (family, flags, NULL, addr, &out_len);
2350 if (rc != NO_ERROR)
2351 {
2352 (*_printf) (" Error: %s\n", win_strerror(rc));
2353 return (0);
2354 }
2355
2356 old_addr = addr;
2357 for (num = 0; addr; addr = addr->Next)
2358 num++;
2359 (*_printf) (" Number of adapter entries: %u\n", num);
2360 addr = old_addr;
2361 num = 0;
2362
2363 while (addr)
2364 {
2365 const char *prefix_fmt;
2366 const char *extra_indent;
2367
2368 ipv4_only_iface = TRUE;
2369 num++;
2370
2371 if (skip_this_iface(addr, NULL, NULL))
2372 {
2373 addr = addr->Next;
2374 num_ifaces_skipped++;
2375 continue;
2376 }
2377
2378 if (skip_filter_iface(NULL, addr->Description))
2379 {
2380 addr = addr->Next;
2381 num_ifaces_filtered++;
2382 continue;
2383 }
2384
2385 (*_printf) (" Adapter name: %s (number %u)\n", addr->AdapterName, num);
2386 (*_printf) (" Description: %s\n", wstring_utf8(addr->Description));
2387
2388 /* With IPv6 enabled, this is typical list for the 'Unicast Addresses:
2389 *
2390 * Unicast Addresses: 2002:6DBD:2078:1:94F3:7B8:2773:8B31, 6DBD:2078 = IPv4 address 109.189.32.120
2391 * 2002:6DBD:2078:1:69A9:4995:5BB8:A863, -- ditto --
2392 * 2002:6DBD:2078:1:99E6:3289:3A70:6B45, -- ditto --
2393 * FE80::94F3:7B8:2773:8B31%5, 10.0.0.10
2394 *
2395 * IPv6-addresses seems to be listed first (preferred?). And 'ipconfig /all' calls these
2396 * "Temporary IPv6 Address."
2397 *
2398 * And the last one above is this printed as:
2399 * Link-local IPv6 Address . . . . . : fe80::94f3:7b8:2773:8b31%5(Preferred)
2400 */
2401 (*_printf) (" Unicast Addresses: %s\n", get_unicast_addrs(addr->FirstUnicastAddress));
2402 (*_printf) (" Anycast Addresses: %s\n", get_anycast_addrs(addr->FirstAnycastAddress));
2403 (*_printf) (" Multicast Addresses: %s\n", get_multicast_addrs(addr->FirstMulticastAddress));
2404 (*_printf) (" DNS Servers: %s\n", format_line(get_dns_server_addrs(addr->FirstDnsServerAddress), 24));
2405 (*_printf) (" DNS Suffix: %" WIDESTR_FMT "\n", addr->DnsSuffix[0] ? addr->DnsSuffix : NONE_STR_W);
2406
2407#if defined(ON_WIN_VISTA)
2408 if (addr->Flags & IP_ADAPTER_IPV6_ENABLED)
2409 iface_store_metric (&addr->Luid, addr->Ipv6Metric, AF_INET6);
2410 else if (addr->Flags & IP_ADAPTER_IPV4_ENABLED)
2411 iface_store_metric (&addr->Luid, addr->Ipv4Metric, AF_INET);
2412
2413 if (_watt_os_ver < 0x0601)
2414 (*_printf) (" Not Win-Vista SP1+\n");
2415 else
2416 {
2417 const IP_ADAPTER_DNS_SERVER_ADDRESS *dns = addr->FirstDnsServerAddress;
2418 int dns_num;
2419
2420 if (addr->FirstDnsSuffix)
2421 (*_printf) (" 1st DNS Suffix: %" WIDESTR_FMT "\n",
2422 addr->FirstDnsSuffix->String[0] ? addr->FirstDnsSuffix->String : NONE_STR_W);
2423
2424 if (verbose_level >= 1)
2425 {
2426 for (dns_num = 1; dns ; dns = dns->Next, dns_num++)
2427 {
2428 SOCKADDR_INET sa;
2429
2430 (*_printf) (" GetBestRoute2() for DNS %d: ", dns_num);
2431
2432 if (addr->OperStatus != IfOperStatusUp)
2433 {
2434 (*_printf) ("iface is not up.\n");
2435 }
2436 else
2437 {
2438 memset (&sa, '\0', sizeof(sa));
2439 memcpy (&sa, &dns->Address.lpSockaddr->sa_data, sizeof(sa));
2440 sa.si_family = dns->Address.lpSockaddr->sa_family;
2441 (*_printf) ("%s\n", get_best_route2(&addr->Luid, &sa));
2442 }
2443 }
2444 }
2445 }
2446#endif
2447
2448 if (!(flags & GAA_FLAG_SKIP_FRIENDLY_NAME))
2449 (*_printf) (" Friendly name: %s\n", wstring_utf8(addr->FriendlyName));
2450 (*_printf) (" MAC-address: %s\n", get_phys_address(&addr->PhysicalAddress, addr->PhysicalAddressLength, TRUE));
2451 (*_printf) (" Flags: %s\n", get_address_flags(addr->Flags));
2452 (*_printf) (" MTU: %s\n", dword_str(addr->Mtu));
2453
2454#if defined(ON_WIN_VISTA)
2455 {
2456 char speed [30];
2457
2458 (*_printf) (" Tx speed: %s\n", speed64_string(addr->TransmitLinkSpeed, speed));
2459 (*_printf) (" Rx speed: %s\n", speed64_string(addr->ReceiveLinkSpeed, speed));
2460 (*_printf) (" WINS servers: %s\n", get_wins_addrs(addr->FirstWinsServerAddress));
2461 (*_printf) (" Gateways: %s\n", get_gateway_addrs(addr->FirstGatewayAddress));
2462 }
2463
2464 if (addr->Flags & IP_ADAPTER_IPV4_ENABLED)
2465 {
2466 (*_printf) (" IPv4 metric: %lu\n", addr->Ipv4Metric);
2467 if (addr->Flags & IP_ADAPTER_DHCP_ENABLED)
2468 (*_printf) (" DHCP v4 addr: %s\n", socket_addr_str(&addr->Dhcpv4Server));
2469 }
2470 if (addr->Flags & IP_ADAPTER_IPV6_ENABLED)
2471 {
2472 (*_printf) (" IPv6 metric: %lu\n", addr->Ipv6Metric);
2473 if (addr->Flags & IP_ADAPTER_DHCP_ENABLED)
2474 (*_printf) (" DHCP v6 addr: %s\n", socket_addr_str(&addr->Dhcpv6Server));
2475 }
2476#endif
2477
2478 (*_printf) (" IfType: %s (%lu)\n",
2479 _list_lookup(addr->IfType, if_types, DIM(if_types)),
2480 (u_long)addr->IfType);
2481
2482 (*_printf) (" OperStatus: %s (%u)\n",
2483 _list_lookup(addr->OperStatus, oper_status, DIM(oper_status)),
2484 addr->OperStatus);
2485
2486 (*_printf) (" Ipv6IfIndex: %ld\n", (long)addr->Ipv6IfIndex);
2487
2488#if defined(ON_WIN_VISTA_SP1)
2489 (*_printf) (" Connection type: %s (%d)\n",
2490 _list_lookup(addr->ConnectionType, conn_type, DIM(conn_type)),
2491 addr->ConnectionType);
2492#endif
2493
2494 (*_printf) (" ZoneIndices: ");
2495 for (i = 0; i < 16; i++)
2496 (*_printf) ("%lX ", (u_long)addr->ZoneIndices[i]);
2497 (*_printf) ("\n");
2498
2499 prefix = addr->FirstPrefix;
2500 for (i = 0; prefix; i++)
2501 prefix = prefix->Next;
2502
2503 num_pfx = i;
2504 extra_indent = (num_pfx >= 10 ? " " : "");
2505
2506 prefix_fmt = (ipv4_only_iface ? "%s%15s / %-2d":
2507 "%s%46s / %-3d");
2508
2509 (*_printf) (" Num Prefix entries: %d:\n", num_pfx);
2510
2511 for (i = 0, prefix = addr->FirstPrefix; prefix; prefix = prefix->Next, i++)
2512 {
2513 (*_printf) (" Prefix[%d]: ", i);
2514 (*_printf) (prefix_fmt, extra_indent, get_netmask_prefix(prefix), (int)prefix->PrefixLength);
2515
2516 if (_watt_os_ver >= 0x0601)
2517 {
2518 /*
2519 * From https://msdn.microsoft.com/en-us/library/windows/desktop/aa366058(v=vs.85).aspx
2520 *
2521 * On Windows Vista and later, the linked IP_ADAPTER_PREFIX structures pointed to by the
2522 * FirstPrefix member include three IP adapter prefixes for each IP address assigned to the
2523 * adapter. These include the
2524 * 1) host IP address prefix,
2525 * 2) the subnet IP address prefix, and the
2526 * 3) subnet broadcast IP address prefix.
2527 *
2528 * In addition, for each adapter there is a multicast
2529 * address prefix and a broadcast address prefix.
2530 */
2531 if (i == 0)
2532 (*_printf) (" (Host)");
2533 else if (i == 1)
2534 (*_printf) (" (Subnet)");
2535 else if (i == 2)
2536 (*_printf) (" (Broadcast)");
2537 else if (i == 3)
2538 (*_printf) (" (Multicast)");
2539 else if (i == num_pfx-1)
2540 (*_printf) (" (All Broadcast)");
2541 }
2542 (*_printf) ("\n");
2543 }
2544
2545 setup_info_adapter_print (addr->AdapterName);
2546
2547 addr = addr->Next;
2548 if (addr)
2549 (*_printf) ("\n");
2550 }
2551 return (1);
2552}
2553
2554static int _pkt_win_print_GetAdapterOrderMap (void)
2555{
2556 IP_ADAPTER_ORDER_MAP *order = NULL;
2557
2558 if (!pkt_win_init() || !p_GetAdapterOrderMap)
2559 return (0);
2560
2561 (*_printf) ("\nFrom GetAdapterOrderMap():\n");
2562
2563 order = (*p_GetAdapterOrderMap)();
2564 if (order)
2565 {
2566 ULONG i;
2567
2568 (*_printf) (" NumAdapters: %lu\n", order->NumAdapters);
2569 for (i = 0; i < order->NumAdapters; i++)
2570 {
2571 (*_printf) (" Adapter: %2lu, order: %2lu", i, order->AdapterOrder[i]);
2572 if (order->AdapterOrder[i] == 1)
2573 (*_printf) (" << --");
2574 (*_printf) ("\n");
2575 }
2576 LocalFree (order);
2577 }
2578 return (1);
2579}
2580
2581/*
2582 * From libdnet-stripped/src/route-win32.c
2583 */
2584#if defined(HAVE_NETIOAPI_H)
2585static const char *get_route_origin (enum _NL_ROUTE_ORIGIN origin)
2586{
2587 #undef ADD_VALUE
2588 #define ADD_VALUE(v) { v, #v }
2589 static const struct search_list route_origins[] = {
2590 ADD_VALUE (NlroManual),
2591 ADD_VALUE (NlroWellKnown),
2592 ADD_VALUE (NlroDHCP),
2593 ADD_VALUE (NlroRouterAdvertisement),
2594 ADD_VALUE (Nlro6to4)
2595 };
2596 return _list_lookup ((DWORD)origin, route_origins, DIM(route_origins));
2597}
2598
2599static const char *get_route_protocol (DWORD protocol)
2600{
2601 static const struct search_list route_protocols[] = {
2602 { 1, "MIB_IPPROTO_OTHER" },
2603 { 2, "MIB_IPPROTO_LOCAL" },
2604 { 3, "MIB_IPPROTO_NETMGMT" },
2605 { 4, "MIB_IPPROTO_ICMP" },
2606 { 5, "MIB_IPPROTO_EGP" },
2607 { 6, "MIB_IPPROTO_GGP" },
2608 { 7, "MIB_IPPROTO_HELLO" },
2609 { 8, "MIB_IPPROTO_RIP" },
2610 { 9, "MIB_IPPROTO_IS_IS" },
2611 { 10, "MIB_IPPROTO_ES_IS" },
2612 { 11, "MIB_IPPROTO_CISCO" },
2613 { 12, "MIB_IPPROTO_BBN" },
2614 { 13, "MIB_IPPROTO_OSPF" },
2615 { 14, "MIB_IPPROTO_BGP" },
2616 { 10002, "MIB_IPPROTO_NT_AUTOSTATIC" },
2617 { 10006, "MIB_IPPROTO_NT_STATIC" },
2618 { 10007, "MIB_IPPROTO_NT_STATIC_NON_DOD" }
2619 };
2620 return _list_lookup (protocol, route_protocols, DIM(route_protocols));
2621}
2622
2623static void print_mib_ipforward_row2 (DWORD index, const MIB_IPFORWARD_ROW2 *row, int family)
2624{
2625 const char *common_fmt, *header_fmt;
2626 const char *luid = " LUID: ";
2627 const IP_ADDRESS_PREFIX *prefix = &row->DestinationPrefix;
2628 int size = (family == AF_INET) ? 15 : 35;
2629 DWORD true_metric = row->Metric;
2630
2631#if defined(ON_WIN_VISTA)
2632 true_metric += iface_lookup_metric (&row->InterfaceLuid, family);
2633#endif
2634
2635 common_fmt = " %2lu %2lu %3lu %-3s %-3s %-3s %10s %d ";
2636 header_fmt = " %s %s %s %s %s %s %s %s %-*s %-*s\n";
2637 if (index == 0)
2638 {
2639 (*_printf) (header_fmt,
2640 "idx",
2641 "iface",
2642 "Metric",
2643 "Loopback",
2644 "Auto",
2645 "Publ",
2646 "Age",
2647 "Orig" ,
2648 size, "NextHop",
2649 size, "Prefix");
2650
2651 (*_printf) (" ----------------------------------------------"
2652 "------------------------------------------------");
2653 if (family == AF_INET6)
2654 (*_printf) ("--------------------------------------------\n");
2655 else (*_printf) ("\n");
2656 }
2657
2658 (*_printf) (common_fmt,
2659 index,
2660 row->InterfaceIndex,
2661 true_metric,
2662 row->Loopback ? "YES" : "NO",
2663 row->AutoconfigureAddress ? "YES" : "NO",
2664 row->Publish ? "YES" : "NO",
2665 hms_str(row->Age),
2666 (int)row->Origin);
2667
2668 (*_printf) ("%-*s %s/%d\n",
2669 size, get_sockaddr_inet_str(&row->NextHop),
2670 get_sockaddr_inet_str(&prefix->Prefix), prefix->PrefixLength );
2671
2672 if (verbose_level >= 2)
2673 {
2674 if (row->ValidLifetime == 0xFFFFFFFF)
2675 (*_printf) (" Lifetime: <infinite>\n");
2676 else (*_printf) (" Lifetime: %lu\n", row->ValidLifetime);
2677
2678 if (row->PreferredLifetime == 0xFFFFFFFF)
2679 (*_printf) (" Pref Lifetime: <infinite>\n");
2680 else (*_printf) (" Pref Lifetime: %lu\n", row->PreferredLifetime);
2681
2682 (*_printf) (" Protocol: %s (%lu)\n", get_route_protocol(row->Protocol), row->Protocol);
2683 (*_printf) (" Immortal: %s\n", row->Immortal ? "YES" : "NO");
2684 (*_printf) (" Origin: %s (%d)\n", get_route_origin(row->Origin), (int)row->Origin);
2685
2686 (*_printf) (luid);
2687
2688#if defined(ON_WIN_VISTA) && defined(HAVE_NETIOAPI_H)
2689 print_net_luid (&row->InterfaceLuid, strlen(luid));
2690#endif
2691 (*_printf) ("\n");
2692 }
2693}
2694
2695static ULONG internal_print_GetIpForwardTable2 (int family)
2696{
2697 MIB_IPFORWARD_TABLE2 *table2 = NULL;
2698 ULONG i, rc = (*p_GetIpForwardTable2) (family, &table2);
2699
2700 if (rc != NO_ERROR)
2701 (*_printf) (" Error: %s\n", win_strerror(rc));
2702 else
2703 {
2704 for (i = 0; table2 && i < table2->NumEntries; i++)
2705 print_mib_ipforward_row2 (i, table2->Table + i, family);
2706 }
2707 if (table2)
2708 (*p_FreeMibTable) (table2);
2709 return (rc);
2710}
2711
2712static int _pkt_win_print_GetIpForwardTable2 (void)
2713{
2714 ULONG rc1, rc2;
2715
2716 if (!pkt_win_init() || !p_GetIpForwardTable2 || !p_FreeMibTable)
2717 return (0);
2718
2719 (*_printf) ("\nFrom GetIpForwardTable2(), AF_INET:\n");
2720 rc1 = internal_print_GetIpForwardTable2 (AF_INET);
2721
2722 (*_printf) ("\nFrom GetIpForwardTable2(), AF_INET6:\n");
2723 rc2 = internal_print_GetIpForwardTable2 (AF_INET6);
2724
2725 /* From:
2726 * https://docs.microsoft.com/en-gb/windows/desktop/api/netioapi/ns-netioapi-_mib_ipforward_row2
2727 */
2728 if (rc1 == NO_ERROR || rc2 == NO_ERROR)
2729 (*_printf) ("\n"
2730 "Orig 0: A result of manual configuration.\n"
2731 " 1: A well-known route.\n"
2732 " 2: A result of DHCP configuration.\n"
2733 " 3: The result of router advertisement.\n"
2734 " 4: A result of 6to4 tunneling.\n");
2735 return ((rc1 == NO_ERROR || rc2 == NO_ERROR) ? 1 : 0);
2736}
2737
2738#else
2739static int _pkt_win_print_GetIpForwardTable2 (void)
2740{
2741 unimplemented ("_pkt_win_print_GetIpForwardTable2", __FILE__, __LINE__);
2742 return (0);
2743}
2744#endif
2745
2746/*
2747 * Return err-number+string for 'err' returned from a RAS function.
2748 * Remove trailing [\r\n.]
2749 */
2750static const char *ras_strerror (DWORD err)
2751{
2752 char err_buf[512], *p;
2753
2754 err_buf[0] = '\0';
2755 if (!p_RasGetErrorStringA ||
2756 (*p_RasGetErrorStringA) (err,err_buf,sizeof(err_buf)) != ERROR_SUCCESS)
2757 strcpy (err_buf, "Unknown error");
2758
2759 SNPRINTF (work_buf, sizeof(work_buf), "%lu/0x%lX %s", (u_long)err, (u_long)err, err_buf);
2760 rip (work_buf);
2761 p = strrchr (work_buf, '.');
2762 if (p && p[1] == '\0')
2763 *p = '\0';
2764 return (work_buf);
2765}
2766
2767static const struct search_list auth_proto[] = {
2768 { 0, NONE_STR },
2769 { RASLCPAP_PAP, "PAP" },
2770 { RASLCPAP_SPAP, "Shiva" },
2771 { RASLCPAP_CHAP, "CHAP" },
2772 { RASLCPAP_EAP, "EAP" }
2773 };
2774
2775static const struct search_list auth_data[] = {
2776 { 0, NONE_STR },
2777 { RASLCPAD_CHAP_MD5, "CHAP MD5" },
2778 { RASLCPAD_CHAP_MS, "Microsoft CHAP" },
2779 { RASLCPAD_CHAP_MSV2, "Microsoft CHAP v2" }
2780 };
2781
2782static const struct search_list compression[] = {
2783 { 0, "<None>" },
2784 { RASCCPCA_MPPC, "MPPC" },
2785 { RASCCPCA_STAC, "STAC" }
2786 };
2787/*
2788 * Return description of "PPP Compression Control Protocol (CCP)" option
2789 * flags. Server or client side.
2790 */
2791static const char *get_ccp_flags (DWORD flags)
2792{
2793 char *p = work_buf;
2794
2795 *p = '\0';
2796
2797 if (flags == 0)
2798 return (NONE_STR);
2799
2800 if (flags & RASCCPO_Compression)
2801 p += sprintf (p, "Compression/No encryption, ");
2802
2803 if (flags & RASCCPO_HistoryLess)
2804 p += sprintf (p, "MPPE stateless, ");
2805
2806 if (flags & RASCCPO_Encryption40bit)
2807 p += sprintf (p, "MPPE compression (40 bit keys), ");
2808
2809 if (flags & RASCCPO_Encryption56bit)
2810 p += sprintf (p, "MPPE compression (56 bit keys), ");
2811
2812 if (flags & RASCCPO_Encryption128bit)
2813 p += sprintf (p, "MPPE compression (128 bit keys), ");
2814
2815 if (p > work_buf)
2816 *(p -= 2) = '\0';
2817 assert (p < work_buf + sizeof(work_buf));
2818 return (work_buf);
2819}
2820
2821/*
2822 * Return description of "PPP Link Control Protocol (LCP)" option
2823 * flags. Server or client side.
2824 */
2825static const char *get_lcp_flags (DWORD flags)
2826{
2827 char *p = work_buf;
2828
2829 *p = '\0';
2830
2831 if (flags == 0)
2832 return (NONE_STR);
2833
2834 if (flags & RASLCPO_PFC)
2835 p += sprintf (p, "PF compr., ");
2836
2837 if (flags & RASLCPO_ACFC)
2838 p += sprintf (p, "ACF compr., ");
2839
2840 if (flags & RASLCPO_SSHF)
2841 p += sprintf (p, "Short sequence num. header format, ");
2842
2843 if (flags & RASLCPO_DES_56)
2844 p += sprintf (p, "DES encr., ");
2845
2846 if (flags & RASLCPO_3_DES)
2847 p += sprintf (p, "3DES encr., ");
2848
2849 if (flags & RASLCPO_AES_128)
2850 p += sprintf (p, "AES 128-bit encr., "); /* Win7+ */
2851
2852 if (flags & RASLCPO_AES_256)
2853 p += sprintf (p, "AES 256-bit encr., "); /* Win7+ */
2854
2855 if (p > work_buf)
2856 *(p -= 2) = '\0';
2857
2858 assert (p < work_buf + sizeof(work_buf));
2859 return (work_buf);
2860}
2861
2862#if defined(ON_WIN_VISTA)
2863static const char *get_best_route2 (NET_LUID *luid, const SOCKADDR_INET *dest)
2864{
2865 MIB_IPFORWARD_ROW2 row;
2866 SOCKADDR_INET src;
2867 DWORD rc;
2868 DWORD sort_opt = 0;
2869 char *p = work_buf;
2870 size_t left = sizeof(work_buf);
2871
2872 if (!p_GetBestRoute2)
2873 return ("<N/A>");
2874
2875 memset (&row, '\0', sizeof(row));
2876 memset (&src, '\0', sizeof(src));
2877
2878 p += SNPRINTF (p, left, "(fam:%d), ", dest->si_family);
2879 left -= (p - work_buf);
2880
2881 /* Contrary to the comment in <netioapi.h> the 'SourceAddress' can be NULL.
2882 * Except maybe for an IPv6-address.
2883 */
2884 if (dest->si_family == AF_INET6)
2885 rc = (*p_GetBestRoute2) (luid, 0, dest, dest, sort_opt, &row, &src);
2886 else rc = (*p_GetBestRoute2) (luid, 0, NULL, dest, sort_opt, &row, &src);
2887
2888 if (rc == ERROR_NETWORK_UNREACHABLE)
2889 SNPRINTF (p, left, "failed: ERROR_NETWORK_UNREACHABLE");
2890 else if (rc != NO_ERROR)
2891 SNPRINTF (p, left, "failed: %s", win_strerror(rc));
2892 else SNPRINTF (p, left, "%s -> %s",
2893 get_sockaddr_inet_str(&src),
2894 get_sockaddr_inet_str(&row.NextHop));
2895 return (work_buf);
2896}
2897#endif
2898
2899static int _pkt_win_print_RasEnumConnections (void)
2900{
2901 DWORD i, ret;
2902 DWORD len = 0, num_conn = 0;
2903 RASCONN *ras_conn = alloca (len);
2904
2905 if (!pkt_win_init() || !p_RasEnumConnectionsA)
2906 return (0);
2907
2908 (*_printf) ("\nFrom RasEnumConnections():\n");
2909
2910 /* RasEnumConnections returns the handles of the current active RAS connections
2911 */
2912 ret = (*p_RasEnumConnectionsA) (NULL, &len, &num_conn);
2913 if (num_conn == 0)
2914 {
2915 (*_printf) (" No active RAS connections:\n");
2916 return (0);
2917 }
2918 if (ret != ERROR_BUFFER_TOO_SMALL)
2919 {
2920 PRINT_RAS_ERROR (" ", ret);
2921 return (0);
2922 }
2923 ras_conn = alloca (len);
2924 ras_conn->dwSize = sizeof(RASCONN);
2925 ret = (*p_RasEnumConnectionsA) (ras_conn, &len, &num_conn);
2926 if (ret != ERROR_SUCCESS)
2927 {
2928 PRINT_RAS_ERROR (" ", ret);
2929 return (0);
2930 }
2931
2932 for (i = 0; i < num_conn; i++, ras_conn++)
2933 {
2934 RAS_STATS stats;
2935 RASPPPIPA pppIp;
2936 RASPPPCCP pppCcp;
2937 RASPPPLCP pppLcp;
2938 char speed [30];
2939
2940 memset (&stats, 0, sizeof(stats));
2941 stats.dwSize = sizeof(stats);
2942
2943 ret = (*p_RasGetConnectionStatistics) (ras_conn->hrasconn, &stats);
2944 if (ret != ERROR_SUCCESS)
2945 {
2946 PRINT_RAS_ERROR (" ", ret);
2947 continue;
2948 }
2949 (*_printf) (" Statistics for connection \"%s\":\n", ras_conn->szEntryName);
2950 (*_printf) (" Bytes Xmited: %s\n", dword_string(stats.dwBytesXmited));
2951 (*_printf) (" Bytes Received: %s\n", dword_string(stats.dwBytesRcved));
2952 (*_printf) (" Frames Xmited: %s\n", dword_string(stats.dwFramesXmited));
2953 (*_printf) (" Frames Received: %s\n", dword_string(stats.dwFramesRcved));
2954 (*_printf) (" CRC Error: %s\n", dword_string(stats.dwCrcErr));
2955 (*_printf) (" Timeout Error: %s\n", dword_string(stats.dwTimeoutErr));
2956 (*_printf) (" Alignment Error: %s\n", dword_string(stats.dwAlignmentErr));
2957 (*_printf) (" Hardware Overrun Error: %s\n", dword_string(stats.dwHardwareOverrunErr));
2958 (*_printf) (" Framing Error: %s\n", dword_string(stats.dwFramingErr));
2959 (*_printf) (" Buffer Overrun Error: %s\n", dword_string(stats.dwBufferOverrunErr));
2960 (*_printf) (" Compression Ratio [In]: %lu%%\n", (u_long)stats.dwCompressionRatioIn);
2961 (*_printf) (" Compression Ratio [Out]: %lu%%\n", (u_long)stats.dwCompressionRatioOut);
2962 (*_printf) (" Speed: %s\n", speed_string(stats.dwBps,speed));
2963 (*_printf) (" Connection Duration: %s\n", duration_string(stats.dwConnectDuration));
2964
2965#if 1
2966 (*_printf) (" From RasGetProjectionInfo() (PPP_IP):\n");
2967 memset (&pppIp, 0, sizeof(pppIp));
2968 len = pppIp.dwSize = sizeof(pppIp);
2969 ret = (*p_RasGetProjectionInfoA) (ras_conn->hrasconn, RASP_PppIp, &pppIp, &len);
2970 if (ret != ERROR_SUCCESS)
2971 PRINT_RAS_ERROR (" ", ret);
2972 else
2973 {
2974 (*_printf) (" Client IP-address: %s\n", pppIp.szIpAddress);
2975 (*_printf) (" Server IP-address: %s\n", pppIp.szServerIpAddress);
2976 (*_printf) (" PPP-negotiation error: %lu\n", (u_long)pppIp.dwError);
2977 (*_printf) (" IP Client options: %lu\n", (u_long)pppIp.dwOptions);
2978 (*_printf) (" IP Server options: %lu\n", (u_long)pppIp.dwServerOptions);
2979 }
2980
2981 (*_printf) (" From RasGetProjectionInfo() (PPP_CCP):\n");
2982 memset (&pppCcp, 0, sizeof(pppCcp));
2983 len = pppCcp.dwSize = sizeof(pppCcp);
2984 ret = (*p_RasGetProjectionInfoA) (ras_conn->hrasconn, RASP_PppCcp, &pppCcp, &len);
2985 if (ret != ERROR_SUCCESS)
2986 PRINT_RAS_ERROR (" ", ret);
2987 else
2988 {
2989 (*_printf) (" Client compression: %s\n", _list_lookup(pppCcp.dwCompressionAlgorithm, compression, DIM(compression)));
2990 (*_printf) (" Server compression: %s\n", _list_lookup(pppCcp.dwServerCompressionAlgorithm, compression, DIM(compression)));
2991 (*_printf) (" CCP client options: %s\n", get_ccp_flags(pppCcp.dwOptions));
2992 (*_printf) (" CCP server options: %s\n", get_ccp_flags(pppCcp.dwServerOptions));
2993 }
2994
2995 (*_printf) (" From RasGetProjectionInfo() (PPP_LCP):\n");
2996 memset (&pppLcp, 0, sizeof(pppLcp));
2997 len = pppLcp.dwSize = sizeof(pppLcp);
2998 ret = (*p_RasGetProjectionInfoA) (ras_conn->hrasconn, RASP_PppLcp, &pppLcp, &len);
2999 if (ret != ERROR_SUCCESS)
3000 PRINT_RAS_ERROR (" ", ret);
3001 else
3002 {
3003 (*_printf) (" Multilink: %s\n", pppLcp.dwSize && pppLcp.fBundled ? "Yes" : "No");
3004 (*_printf) (" Negotiation error: %lu\n", (u_long)pppLcp.dwError);
3005 (*_printf) (" Client Auth protocol: %s\n", _list_lookup(pppLcp.dwAuthenticationProtocol, auth_proto, DIM(auth_proto)));
3006 (*_printf) (" Server Auth protocol: %s\n", _list_lookup(pppLcp.dwServerAuthenticationProtocol, auth_proto, DIM(auth_proto)));
3007 (*_printf) (" Client Auth data: %s\n", _list_lookup(pppLcp.dwAuthenticationData, auth_data, DIM(auth_data)));
3008 (*_printf) (" Server Auth data: %s\n", _list_lookup(pppLcp.dwServerAuthenticationData, auth_data, DIM(auth_data)));
3009 (*_printf) (" Authentication message: %s\n", pppLcp.szReplyMessage[0] ? pppLcp.szReplyMessage : NONE_STR);
3010
3011 (*_printf) (" EAP type: %s\n", pppLcp.dwServerAuthenticationProtocol == RASLCPAP_EAP ?
3012 itoa(pppLcp.dwServerEapTypeId,work_buf,10) : NA_STR);
3013 (*_printf) (" LCP client options: %s\n", get_lcp_flags(pppLcp.dwOptions));
3014 (*_printf) (" LCP server options: %s\n", get_lcp_flags(pppLcp.dwServerOptions));
3015 }
3016#endif
3017 }
3018 return (1);
3019}
3020
3021static const struct search_list wlan_intf_state[] = { /* table for 'WLAN_INTERFACE_STATE' */
3022 { wlan_interface_state_not_ready, "Not ready" },
3023 { wlan_interface_state_connected, "Connected" },
3024 { wlan_interface_state_ad_hoc_network_formed, "First node in a Ad Hoc network" },
3025 { wlan_interface_state_disconnecting, "Disconnecting" },
3026 { wlan_interface_state_disconnected, "Disconnected" },
3027 { wlan_interface_state_associating, "Attempting to associate with a network" },
3028 { wlan_interface_state_discovering, "Auto configuration is discovering settings for the network" },
3029 { wlan_interface_state_authenticating, "Authenticating in process" },
3030 };
3031
3032static const struct search_list wlan_conn_mode[] = { /* table for 'WLAN_CONNECTION_MODE' */
3033 { wlan_connection_mode_profile, "Profile" },
3034 { wlan_connection_mode_temporary_profile, "Temporary profile" },
3035 { wlan_connection_mode_discovery_secure, "Secure discovery" },
3036 { wlan_connection_mode_discovery_unsecure, "Unsecure discovery" },
3037 { wlan_connection_mode_auto, "Auto" },
3038 { wlan_connection_mode_invalid, "N/A" }
3039 };
3040
3041static const struct search_list wlan_radio_states[] = {
3042 { dot11_radio_state_unknown, "Unknown" },
3043 { dot11_radio_state_on, "On" },
3044 { dot11_radio_state_off, "Off" }
3045 };
3046
3047/*
3048 * Some of the MS docs [1] on the op-codes used in WlanQueryInterface(), seems wrong.
3049 * This .AU3 Basic-language reference seems to do it correct:
3050 * https://github.com/RIEI/Vistumbler/blob/master/VistumblerMDB/UDFs/NativeWifi.au3
3051 *
3052 * [1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms706765(v=vs.85).aspx
3053 */
3054static BOOL wlan_query (HANDLE client,
3055 const GUID *guid,
3056 WLAN_INTF_OPCODE opcode,
3057 size_t data_size,
3058 void *data)
3059{
3060 void *p = &p;
3061 DWORD res;
3062 ULONG size = (ULONG)data_size;
3063 ULONG p_size = sizeof(p);
3064
3065 assert (size > 0);
3066 memset (data, '\0', size);
3067 res = (*p_WlanQueryInterface) (client, guid, opcode, NULL, &p_size, p, NULL);
3068 if (res != ERROR_SUCCESS || !p_size || !p)
3069 {
3070 (*_printf) ("WlanQueryInterface() op-code: 0x%08X (size: %lu) failed: %lu\n",
3071 opcode, size, res);
3072 return (FALSE);
3073 }
3074
3075 p_size = min (data_size, p_size);
3076 memcpy (data, p, (size_t)p_size);
3077 (*p_WlanFreeMemory) (p);
3078
3079 (void) &p_GetIfEntry; /* Turn off some warnings */
3080 (void) &p_WlanGetInterfaceCapability;
3081 return (TRUE);
3082}
3083
3084#ifdef NOT_YET
3085static void print_wlan_svc_guid_list (const WLAN_DEVICE_SERVICE_GUID_LIST2 *list)
3086{
3087 (*_printf) ("list->dwNumberOfItems: %lu\n", list->dwNumberOfItems);
3088}
3089#endif
3090
3091static int _pkt_win_print_WlanEnumInterfaces (void)
3092{
3093 WLAN_INTERFACE_INFO_LIST *if_list = NULL;
3094 HANDLE client = NULL;
3095 DWORD cli_ver, cur_version = 0;
3096 DWORD res = 0;
3097 int i;
3098
3099 if (!pkt_win_init())
3100 return (0);
3101
3102 (*_printf) ("\nFrom WlanEnumInterfaces():\n");
3103
3104 if (_watt_os_ver <= _WIN32_WINNT_WS03) /* = 0x0502, Win-XP SP3 */
3105 cli_ver = 1;
3106 else cli_ver = 2;
3107
3108 res = (*p_WlanOpenHandle) (cli_ver, NULL, &cur_version, &client);
3109 if (res != ERROR_SUCCESS)
3110 {
3111 (*_printf) (" WlanOpenHandle() failed: %s\n", win_strerror(res));
3112 (*p_WlanCloseHandle) (client, NULL);
3113 return (0);
3114 }
3115
3116 (*_printf) (" Current Version: %lu\n", cur_version);
3117
3118 res = (*p_WlanEnumInterfaces) (client, NULL, &if_list);
3119 if (res != ERROR_SUCCESS)
3120 {
3121 (*_printf) (" WlanEnumInterfaces() failed: %s\n", win_strerror(res));
3122 (*p_WlanCloseHandle) (client, NULL);
3123 return (0);
3124 }
3125
3126 for (i = 0; i < (int)if_list->dwNumberOfItems; i++)
3127 {
3128 const WLAN_INTERFACE_INFO *if_info = (const WLAN_INTERFACE_INFO*) &if_list->InterfaceInfo[i];
3129 const GUID *guid = &if_info->InterfaceGuid;
3130 WLAN_AVAILABLE_NETWORK_LIST *network_list = NULL;
3131 WLAN_BSS_LIST *bss_list = NULL;
3132#ifdef NOT_YET
3133 WLAN_DEVICE_SERVICE_GUID_LIST2 *svc_guid_list = NULL;
3134#endif
3135 BOOL auto_conf;
3136 BOOL bkg_scan;
3137 BOOL str_mode;
3138 BOOL safe_mode;
3139 ULONG ch_number, op_mode, rssi;
3140 WLAN_RADIO_STATE radio_state;
3141 WLAN_STATISTICS wlan_stats;
3142 WLAN_CONNECTION_ATTRIBUTES conn_attr;
3143 WLAN_AUTH_CIPHER_PAIR_LIST2 auth_pairs;
3144
3145 (*_printf) (" Index: %d\n", i);
3146 (*_printf) (" Description: %" WIDESTR_FMT "\n", if_info->strInterfaceDescription);
3147 (*_printf) (" GUID: %s\n", get_guid_str(guid));
3148 (*_printf) (" State: %s\n", _list_lookup(if_info->isState, wlan_intf_state, DIM(wlan_intf_state)));
3149
3150 if (if_info->isState == wlan_interface_state_connected &&
3151 wlan_query(client, guid, wlan_intf_opcode_current_connection, sizeof(conn_attr), &conn_attr))
3152 print_wlan_current_connection (&conn_attr, 4);
3153
3154 (*_printf) (" Autoconf: ");
3155 if (wlan_query(client, guid, wlan_intf_opcode_autoconf_enabled, sizeof(auto_conf), &auto_conf))
3156 (*_printf) ("%s\n", auto_conf ? "Yes" : "No");
3157
3158 (*_printf) (" Background scan: ");
3159 if (wlan_query(client, guid, wlan_intf_opcode_background_scan_enabled, sizeof(bkg_scan), &bkg_scan))
3160 (*_printf) ("%s\n", bkg_scan ? "Yes" : "No");
3161
3162 (*_printf) (" Radio state: ");
3163 if (wlan_query(client, guid, wlan_intf_opcode_radio_state, sizeof(radio_state), &radio_state))
3164 print_radio_state (&radio_state, sizeof(" Radio state: ")-1);
3165
3166 (*_printf) (" Statistics: ");
3167 if (if_info->isState != wlan_interface_state_connected)
3168 (*_printf) ("%s\n", NONE_STR);
3169 else
3170 if (wlan_query(client, guid, wlan_intf_opcode_statistics, sizeof(wlan_stats), &wlan_stats))
3171 print_wlan_stats (&wlan_stats, sizeof(" Statistics: ")-1);
3172
3173 (*_printf) (" Channel number: ");
3174 if (if_info->isState != wlan_interface_state_connected)
3175 (*_printf) ("%s\n", NONE_STR);
3176 else
3177 if (wlan_query(client, guid, wlan_intf_opcode_channel_number, sizeof(ch_number), &ch_number))
3178 (*_printf) ("%lu (%s MHz)\n", ch_number, convert_ch_to_freq(ch_number));
3179
3180 (*_printf) (" Streaming mode: ");
3181 if (wlan_query(client, guid, wlan_intf_opcode_media_streaming_mode, sizeof(str_mode), &str_mode))
3182 (*_printf) ("%s\n", str_mode ? "Yes" : "No");
3183
3184 (*_printf) (" Safe mode: ");
3185 if (wlan_query(client, guid, wlan_intf_opcode_supported_safe_mode, sizeof(safe_mode), &safe_mode))
3186 (*_printf) ("%s\n", safe_mode ? "Yes" : "No");
3187
3188 (*_printf) (" Cert safe: ");
3189 if (wlan_query(client, guid, wlan_intf_opcode_certified_safe_mode, sizeof(safe_mode), &safe_mode))
3190 (*_printf) ("%s\n", safe_mode ? "Yes" : "No");
3191
3192 /*
3193 * \todo: Use some of this code:
3194 * https://github.com/nmap/npcap/blob/1329082e00a57846823f20c1b4edcdb3ae9b2701/packetWin7/WlanHelper/WlanHelper/Tool.cpp#L673
3195 */
3196 (*_printf) (" Operation mode: ");
3197 if (wlan_query(client, guid, wlan_intf_opcode_current_operation_mode, sizeof(op_mode), &op_mode))
3198 {
3199 sprintf (work_buf, "0x%08lX", op_mode);
3200 (*_printf) ("%s\n",
3201 (op_mode == DOT11_OPERATION_MODE_EXTENSIBLE_STATION ? "Extensible station" :
3202 op_mode == DOT11_OPERATION_MODE_NETWORK_MONITOR ? "Network monitor" : work_buf));
3203 }
3204
3205 (*_printf) (" RSSI: ");
3206 if (wlan_query(client, guid, wlan_intf_opcode_rssi, sizeof(rssi), &rssi))
3207 (*_printf) ("%ld dBm\n", (long)rssi);
3208
3209 (*_printf) (" AuthCipher pairs: ");
3210 if (wlan_query(client, guid, wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs, sizeof(auth_pairs), &auth_pairs))
3211 print_auth_pairs (&auth_pairs, sizeof(" AuthCipher pairs: ")-1);
3212
3213 (*_printf) (" Ad-hocs pairs: ");
3214 if (wlan_query(client, guid, wlan_intf_opcode_supported_adhoc_auth_cipher_pairs, sizeof(auth_pairs), &auth_pairs))
3215 print_auth_pairs (&auth_pairs, sizeof(" Ad-hocs pairs: ")-1);
3216
3217 (*_printf) (" \nFrom WlanGetAvailableNetworkList():\n");
3218
3219 res = (*p_WlanGetAvailableNetworkList) (client, guid,
3220 WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_ADHOC_PROFILES |
3221 WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES,
3222 NULL, &network_list);
3223 if (res == ERROR_SUCCESS && network_list)
3224 print_wlan_networklist (network_list);
3225 else (*_printf) (" error: %s\n", win_strerror(res));
3226
3227 if (network_list)
3228 (*p_WlanFreeMemory) (network_list);
3229
3230 (*_printf) (" \n From WlanGetNetworkBssList():\n");
3231
3232 res = (*p_WlanGetNetworkBssList) (client, guid, NULL, dot11_BSS_type_any, FALSE, NULL, &bss_list);
3233
3234 if (res == ERROR_SUCCESS && bss_list)
3235 print_wlan_bss_list (bss_list);
3236 else (*_printf) (" error: %s\n", win_strerror(res));
3237
3238 if (bss_list)
3239 (*p_WlanFreeMemory) (bss_list);
3240
3241#ifdef NOT_YET /* Does not work */
3242 (*_printf) (" \n From WlanGetSupportedDeviceServices():\n");
3243
3244 res = (*p_WlanGetSupportedDeviceServices) (client, guid, &svc_guid_list);
3245 if (res == ERROR_SUCCESS && svc_guid_list)
3246 print_wlan_svc_guid_list (svc_guid_list);
3247 else (*_printf) (" error: %s\n", win_strerror(res));
3248
3249 if (svc_guid_list)
3250 (*p_WlanFreeMemory) (svc_guid_list);
3251#endif
3252 }
3253
3254 if (if_list)
3255 (*p_WlanFreeMemory) (if_list);
3256
3257 (*p_WlanCloseHandle) (client, NULL);
3258 return (1);
3259}
3260
3261static const struct search_list dot11_auth_algo[] = {
3262 { DOT11_AUTH_ALGO_80211_OPEN, "802.11 Open" },
3263 { DOT11_AUTH_ALGO_80211_SHARED_KEY, "802.11 Shared" },
3264 { DOT11_AUTH_ALGO_WPA, "WPA" },
3265 { DOT11_AUTH_ALGO_WPA_PSK, "WPA-PSK" },
3266 { DOT11_AUTH_ALGO_WPA_NONE, "WPA-None" },
3267 { DOT11_AUTH_ALGO_RSNA, "RSNA" },
3268 { DOT11_AUTH_ALGO_RSNA_PSK, "RSNA with PSK (WEP2)" }
3269 };
3270
3271static const struct search_list dot11_cipher_algo[] = {
3272 { DOT11_CIPHER_ALGO_NONE, "None" },
3273 { DOT11_CIPHER_ALGO_WEP40, "WEP-40" },
3274 { DOT11_CIPHER_ALGO_TKIP, "TKIP" },
3275 { DOT11_CIPHER_ALGO_CCMP, "CCMP" },
3276 { DOT11_CIPHER_ALGO_WEP104, "WEP-104" },
3277 { DOT11_CIPHER_ALGO_WPA_USE_GROUP, "WPA-Group" },
3278 { DOT11_CIPHER_ALGO_RSN_USE_GROUP, "RSN-Group" },
3279 { DOT11_CIPHER_ALGO_WEP, "WEP" }
3280 };
3281
3282static const struct search_list bss_types[] = {
3283 { dot11_BSS_type_infrastructure, "Infrastructure" },
3284 { dot11_BSS_type_independent, "Ad-hoc" }
3285 };
3286
3287static const struct search_list dot11_phy_types[] = {
3288 { dot11_phy_type_any , "ANY" },
3289 { dot11_phy_type_fhss, "FHSS" },
3290 { dot11_phy_type_dsss, "DSSS" },
3291 { dot11_phy_type_irbaseband, "Infrared" },
3292 { dot11_phy_type_ofdm, "OFDM" },
3293 { dot11_phy_type_hrdsss, "HRDSSS" },
3294 { dot11_phy_type_erp, "802.11g" },
3295 { dot11_phy_type_ht, "802.11n" },
3296 { 8, "802.11ac" } /* 'dot11_phy_type_vht'. Added in SDK 8.1? */
3297 };
3298
3299static const char *get_phy_types (DWORD num, const DOT11_PHY_TYPE *phy)
3300{
3301 char *p = work_buf;
3302 char *end = p + sizeof(work_buf) - 1;
3303 DWORD i;
3304
3305 *p = '\0';
3306 if (num == 0)
3307 return (NONE_STR);
3308
3309 for (i = 0; i < num && i < WLAN_MAX_PHY_TYPE_NUMBER; i++, phy++)
3310 {
3311 const char *str = _list_lookup (*phy, dot11_phy_types, DIM(dot11_phy_types));
3312
3313 if (p + strlen(str) > end)
3314 break;
3315 p += sprintf (p, "%s, ", str);
3316 }
3317 if (p > work_buf)
3318 *(p -= 2) = '\0';
3319
3320 if (num > WLAN_MAX_PHY_TYPE_NUMBER && p < end-4)
3321 strcat (p, "...");
3322 return (work_buf);
3323}
3324
3325static const char *get_ssid (const DOT11_SSID *ssid)
3326{
3327 if (ssid->uSSIDLength == 0 || !isprint(ssid->ucSSID[0]))
3328 strncpy (work_buf, "<none>", sizeof(work_buf));
3329 else SNPRINTF (work_buf, sizeof(work_buf), "%.*s", (int)ssid->uSSIDLength, ssid->ucSSID);
3330 return (work_buf);
3331}
3332
3333static const char *get_dot11_auth (enum _DOT11_AUTH_ALGORITHM auth)
3334{
3335 if (auth >= DOT11_AUTH_ALGO_IHV_START && auth <= DOT11_AUTH_ALGO_IHV_END)
3336 {
3337 auth -= DOT11_AUTH_ALGO_IHV_START;
3338 SNPRINTF (work_buf, sizeof(work_buf), "proprietary %lu", (unsigned long)auth);
3339 return (work_buf);
3340 }
3341 return _list_lookup (auth,dot11_auth_algo,DIM(dot11_auth_algo));
3342}
3343
3344static const char *get_dot11_cipher (enum _DOT11_CIPHER_ALGORITHM cipher)
3345{
3346 if (cipher >= DOT11_CIPHER_ALGO_IHV_START && cipher <= DOT11_CIPHER_ALGO_IHV_END)
3347 {
3348 cipher -= DOT11_CIPHER_ALGO_IHV_START;
3349 SNPRINTF (work_buf, sizeof(work_buf), "proprietary %lu", (unsigned long)cipher);
3350 return (work_buf);
3351 }
3352 return _list_lookup (cipher,dot11_cipher_algo,DIM(dot11_cipher_algo));
3353}
3354
3355static void print_wlan_networklist (const WLAN_AVAILABLE_NETWORK_LIST *wlist)
3356{
3357 DWORD i;
3358
3359 for (i = 0; i < wlist->dwNumberOfItems; i++)
3360 {
3361 const WLAN_AVAILABLE_NETWORK *bss = (const WLAN_AVAILABLE_NETWORK*) wlist->Network + i;
3362 int dBm;
3363
3364 (*_printf) (" Profile Name[%lu]: %s%" WIDESTR_FMT "\n",
3365 (u_long)i, i >= 10 ? " " : " ", bss->strProfileName[0] ? bss->strProfileName : L"<Not connected>");
3366
3367 (*_printf) (" SSID: %s\n", get_ssid(&bss->dot11Ssid));
3368 (*_printf) (" BSS Network type: %s\n",
3369 _list_lookup(bss->dot11BssType, bss_types, DIM(bss_types)));
3370
3371 (*_printf) (" Number of BSSIDs: %lu\n", (u_long)bss->uNumberOfBssids);
3372 (*_printf) (" Connectable: ");
3373 if (bss->bNetworkConnectable)
3374 (*_printf) ("Yes\n");
3375 else (*_printf) ("No: not connectable. WLAN_REASON_CODE value: %lu\n",
3376 (u_long)bss->wlanNotConnectableReason);
3377
3378 (*_printf) (" # Phy types supported: %lu: %s\n",
3379 (u_long)bss->uNumberOfPhyTypes,
3380 get_phy_types(bss->uNumberOfPhyTypes,bss->dot11PhyTypes));
3381
3382 if (bss->wlanSignalQuality == 0)
3383 dBm = -100;
3384 else if (bss->wlanSignalQuality == 100)
3385 dBm = -50;
3386 else dBm = -100 + (bss->wlanSignalQuality/2);
3387
3388 (*_printf) (" Signal Quality: %lu (RSSI: %d dBm)\n",
3389 (u_long)bss->wlanSignalQuality, dBm);
3390
3391 (*_printf) (" Security Enabled: %s\n",
3392 bss->bSecurityEnabled ? "Yes" : "No");
3393
3394 (*_printf) (" Def AuthAlgorithm: %s\n",
3395 get_dot11_auth(bss->dot11DefaultAuthAlgorithm));
3396
3397 (*_printf) (" Def CipherAlgorithm: %s\n",
3398 get_dot11_cipher(bss->dot11DefaultCipherAlgorithm));
3399
3400 (*_printf) (" Flags: 0x%08lX", (u_long)bss->dwFlags);
3401
3402 if (bss->dwFlags & WLAN_AVAILABLE_NETWORK_CONNECTED)
3403 (*_printf) (" - Currently connected");
3404 if (bss->dwFlags & WLAN_AVAILABLE_NETWORK_HAS_PROFILE)
3405 (*_printf) (" - Has profile");
3406
3407 (*_printf) ("\n");
3408 if (i < wlist->dwNumberOfItems-1)
3409 (*_printf) ("\n");
3410 }
3411}
3412
3413static void print_wlan_current_connection (const WLAN_CONNECTION_ATTRIBUTES *attr, int indent)
3414{
3415 const WLAN_ASSOCIATION_ATTRIBUTES *assoc = &attr->wlanAssociationAttributes;
3416 const WLAN_SECURITY_ATTRIBUTES *sec = &attr->wlanSecurityAttributes;
3417 char speed [30];
3418 int dBm;
3419
3420 if (assoc->wlanSignalQuality == 0)
3421 dBm = -100;
3422 else if (assoc->wlanSignalQuality == 100)
3423 dBm = -50;
3424 else dBm = -100 + (assoc->wlanSignalQuality/2);
3425
3426 (*_printf) ("%*sInterface state: %s\n",
3427 indent, "", _list_lookup(attr->isState, wlan_intf_state, DIM(wlan_intf_state)));
3428
3429 (*_printf) ("%*sConnection mode: %s\n",
3430 indent, "", _list_lookup(attr->wlanConnectionMode, wlan_conn_mode, DIM(wlan_conn_mode)));
3431
3432 (*_printf) ("%*sProfile name: %" WIDESTR_FMT "\n",
3433 indent, "", attr->strProfileName);
3434
3435 (*_printf) ("%*sAssoc SSID: %s\n",
3436 indent, "", get_ssid(&assoc->dot11Ssid));
3437
3438 (*_printf) ("%*sBSS Network type: %s\n",
3439 indent, "", _list_lookup(assoc->dot11BssType, bss_types, DIM(bss_types)));
3440
3441 (*_printf) ("%*sBSSID: %s\n",
3442 indent, "", get_phys_address(&assoc->dot11Bssid, DIM(assoc->dot11Bssid), TRUE));
3443
3444 (*_printf) ("%*sPhysical type: %s\n",
3445 indent, "", _list_lookup(assoc->dot11PhyType, dot11_phy_types, DIM(dot11_phy_types)));
3446
3447 (*_printf) ("%*sSignal Quality: %lu (RSSI: %d dBm)\n",
3448 indent, "", (u_long)assoc->wlanSignalQuality, dBm);
3449
3450 (*_printf) ("%*sRx rate: %s\n",
3451 indent, "", speed_string(1000*assoc->ulRxRate,speed));
3452
3453 (*_printf) ("%*sTx rate: %s\n",
3454 indent, "", speed_string(1000*assoc->ulTxRate,speed));
3455
3456 (*_printf) ("%*sSecurity on: %s\n",
3457 indent, "", sec->bSecurityEnabled ? "Yes" : "No");
3458
3459 (*_printf) ("%*s802.1X on: %s\n",
3460 indent, "", sec->bOneXEnabled ? "Yes" : "No");
3461
3462 (*_printf) ("%*sAuth algo: %s\n",
3463 indent, "", get_dot11_auth(sec->dot11AuthAlgorithm));
3464
3465 (*_printf) ("%*sCipher algo: %s\n",
3466 indent, "", get_dot11_cipher(sec->dot11CipherAlgorithm));
3467}
3468
3469static void print_wlan_stats (const WLAN_STATISTICS *stats, int indent)
3470{
3471 int i;
3472
3473 (*_printf) ("4-way failures: %s\n", qword_str(stats->ullFourWayHandshakeFailures));
3474 (*_printf) ("%*sTKIP countermeasures: %s\n", indent, "", qword_str(stats->ullTKIPCounterMeasuresInvoked));
3475
3476 for (i = 0; i <= 1; i++)
3477 {
3478 const WLAN_MAC_FRAME_STATISTICS *s = (i == 0) ? &stats->MacUcastCounters : &stats->MacMcastCounters;
3479 const char *which = (i == 0) ? "Unicast " : "Mcast ";
3480 const char *filler = " ";
3481
3482 (*_printf) ("%*s%sMAC Tx: %s\n", indent, "", which, qword_str(s->ullTransmittedFrameCount));
3483 (*_printf) ("%*s%sMAC Rx: %s\n", indent, "", filler, qword_str(s->ullReceivedFrameCount));
3484 (*_printf) ("%*s%sWEP discarded: %s\n", indent, "", filler, qword_str(s->ullWEPExcludedCount));
3485 (*_printf) ("%*s%sTKIP failures: %s\n", indent, "", filler, qword_str(s->ullTKIPLocalMICFailures));
3486 (*_printf) ("%*s%sTKIP replay errors: %s\n", indent, "", filler, qword_str(s->ullTKIPReplays));
3487 (*_printf) ("%*s%sTKIP decrypt errors: %s\n", indent, "", filler, qword_str(s->ullTKIPICVErrorCount));
3488 }
3489
3490#if 0
3491 for (i = 0; i < (int)stats->dwNumberOfPhys; i++)
3492 {
3493 const WLAN_PHY_FRAME_STATISTICS *phy = stats->PhyCounters + i;
3494 }
3495#endif
3496}
3497
3498#if defined(NOT_USED)
3499/*
3500 * Return FILETIME in seconds as a double.
3501 */
3502static double filetime_sec (const FILETIME *filetime)
3503{
3504 const LARGE_INTEGER *ft = (const LARGE_INTEGER*) filetime;
3505 long double rc = (long double) ft->QuadPart;
3506
3507 return (double) (rc/1E7); /* from 100 nano-sec periods to sec */
3508}
3509#endif /* NOT_USED */
3510
3511/*
3512 * Convert a frequency in the 2.4GHz band to a channel number.
3513 * Return -1 for an unknown channel.
3514
3515 * 2.4GHz: https://en.wikipedia.org/wiki/List_of_WLAN_channels#2.4_GHz_(802.11b/g/n/ax)
3516 * 5GHz: https://en.wikipedia.org/wiki/List_of_WLAN_channels#5_GHz_(802.11a/h/j/n/ac/ax)
3517 */
3518static const struct search_list ch_mapping24[] = {
3519 { 2412, "1", },
3520 { 2417, "2", },
3521 { 2422, "3", },
3522 { 2427, "4", },
3523 { 2432, "5", },
3524 { 2437, "6", },
3525 { 2442, "7", },
3526 { 2447, "8", },
3527 { 2452, "9", },
3528 { 2457, "10", },
3529 { 2462, "11", },
3530 { 2467, "12", },
3531 { 2472, "13", },
3532 { 2484, "14" }
3533 };
3534static const struct search_list ch_mapping50[] = {
3535 { 5035, "7" },
3536 { 5040, "8" },
3537 { 5045, "9" },
3538 { 5055, "11" },
3539 { 5060, "12" },
3540 { 5080, "16" },
3541 { 5160, "32" },
3542 { 5170, "34" },
3543 { 5180, "36" },
3544 { 5190, "38" },
3545 { 5200, "40" },
3546 { 5210, "42" },
3547 { 5220, "44" },
3548 { 5230, "46" },
3549 { 5240, "48" },
3550 { 5250, "50" },
3551 { 5260, "52" },
3552 { 5270, "54" },
3553 { 5280, "56" },
3554 { 5290, "58" },
3555 { 5300, "60" },
3556 { 5310, "62" },
3557 { 5320, "64" },
3558 { 5340, "68" },
3559 { 5480, "96" },
3560 { 5500, "100" },
3561 { 5510, "102" },
3562 { 5520, "104" },
3563 { 5530, "106" },
3564 { 5540, "108" },
3565 { 5550, "110" },
3566 { 5560, "112" },
3567 { 5570, "114" },
3568 { 5580, "116" },
3569 { 5590, "118" },
3570 { 5600, "120" },
3571 { 5610, "122" },
3572 { 5620, "124" },
3573 { 5630, "126" },
3574 { 5640, "128" },
3575 { 5660, "132" },
3576 { 5670, "134" },
3577 { 5680, "136" },
3578 { 5690, "138" },
3579 { 5700, "140" },
3580 { 5710, "142" },
3581 { 5720, "144" },
3582 { 5745, "149" },
3583 { 5755, "151" },
3584 { 5765, "153" },
3585 { 5775, "155" },
3586 { 5785, "157" },
3587 { 5795, "159" },
3588 { 5805, "161" },
3589 { 5825, "165" },
3590 { 5845, "169" },
3591 { 5865, "173" },
3592 { 4915, "183" },
3593 { 4920, "184" },
3594 { 4925, "185" },
3595 { 4935, "187" },
3596 { 4940, "188" },
3597 { 4945, "189" },
3598 { 4960, "192" },
3599 { 4980, "196" }
3600 };
3601
3602static const char *convert_freq_to_ch (DWORD freq)
3603{
3604 char *ret;
3605
3606 if (freq >= 2400 && freq <= 2500)
3607 ret = (char*) _list_lookup (freq, ch_mapping24, DIM(ch_mapping24));
3608 else if (freq >= 4980 && freq <= 5865)
3609 ret = (char*) _list_lookup (freq, ch_mapping50, DIM(ch_mapping50));
3610 else ret = (char*) "??";
3611
3612 if (ret[0] == '?')
3613 ret[1] = '\0';
3614 return (ret);
3615}
3616
3617static struct search_list *create_freq_to_ch_mapping (size_t *num_p)
3618{
3619 struct search_list *dst_list;
3620 char freq[7]; /* need 4 digits, but add some slack */
3621 char *freq_start;
3622 int chan;
3623 size_t i, j, num = DIM(ch_mapping24) + DIM(ch_mapping50);
3624 size_t size = num * (sizeof(*dst_list) + sizeof(freq));
3625
3626 *num_p = 0;
3627 dst_list = malloc (size);
3628 if (!dst_list)
3629 return (NULL);
3630
3631 freq_start = (char*)dst_list + (num * sizeof(*dst_list)); /* Put all 'freq' after the 'dst_list[]' */
3632
3633 for (i = j = 0; i < num; i++, j++)
3634 {
3635 const struct search_list *src_list = (i < DIM(ch_mapping24)) ? ch_mapping24 + 0 : ch_mapping50 + 0;
3636
3637 src_list += j;
3638 if (i == DIM(ch_mapping24)) /* switch to 'ch_mapping50[]' */
3639 j = 0;
3640
3641 itoa (src_list->type, freq, 10);
3642 chan = ATOI (src_list->name);
3643 dst_list[i].type = chan;
3644 dst_list[i].name = strcpy (freq_start, freq);
3645 freq_start += sizeof(freq);
3646 }
3647 *num_p = num;
3648 return (dst_list);
3649}
3650
3651/*
3652 * The inverse of the above. Return the freq in MHz units.
3653 * But this is not reliable since e.g. ch 7 is in both 2.4 GHz and the 5 GHz band.
3654 * So we really need to know the band too.
3655 */
3656static const char *convert_ch_to_freq (int ch)
3657{
3658 static struct search_list *freq_to_ch_mapping = NULL;
3659 static size_t freq_to_ch_num = 0;
3660
3661 if (ch < 0)
3662 {
3663 if (freq_to_ch_mapping)
3664 free (freq_to_ch_mapping);
3665 freq_to_ch_mapping = NULL;
3666 freq_to_ch_num = 0;
3667 return (NULL);
3668 }
3669
3670 if (!freq_to_ch_mapping)
3671 freq_to_ch_mapping = create_freq_to_ch_mapping (&freq_to_ch_num);
3672
3673 if (!freq_to_ch_mapping)
3674 return ("?");
3675 return _list_lookup (ch, freq_to_ch_mapping, freq_to_ch_num);
3676}
3677
3678/*
3679 * Print the information in a list of Basic Service Set (BSS).
3680 */
3681static void print_wlan_bss_list (const WLAN_BSS_LIST *bss_list)
3682{
3683 DWORD i;
3684
3685 for (i = 0; i < bss_list->dwNumberOfItems; i++)
3686 {
3687 const WLAN_BSS_ENTRY *bss = bss_list->wlanBssEntries + i;
3688 const char *chan;
3689 int dBm;
3690 DWORD MHz;
3691
3692 if (bss->uLinkQuality == 0)
3693 dBm = -100;
3694 else if (bss->uLinkQuality == 100)
3695 dBm = -50;
3696 else dBm = -100 + (bss->uLinkQuality/2);
3697
3698 (*_printf) (" %2lu: SSID: %s\n"
3699 " Quality: %d dBm\n",
3700 i, get_ssid(&bss->dot11Ssid), dBm);
3701
3702 (*_printf) (" MAC-address: %s\n",
3703 get_phys_address(&bss->dot11Bssid, DIM(bss->dot11Bssid), TRUE));
3704
3705 (*_printf) (" Phy: %lu\n"
3706 " BSS Network type: %s\n",
3707 bss->uPhyId, _list_lookup(bss->dot11BssType, bss_types, DIM(bss_types)));
3708
3709 (*_printf) (" Phy type: %s\n"
3710 " Capability: 0x%04X\n"
3711 " Beacon-period: %u ms, Time-stamp: %" U64_FMT "\n",
3712 get_phy_types(1,&bss->dot11BssPhyType),
3713 bss->usCapabilityInformation,
3714 (bss->usBeaconPeriod*1024)/1000,
3715 bss->ullTimestamp/1024);
3716
3717 MHz = bss->ulChCenterFrequency / 1000; /* kHz -> MHz */
3718 chan = convert_freq_to_ch (MHz);
3719
3720 (*_printf) (" Host time-stamp: %s\n"
3721 " Freq: %lu MHz (ch: %s)\n",
3722 ULONGLONG_to_ctime(bss->ullHostTimestamp), MHz, chan);
3723
3724#if 0
3725 rate_in_mbps = (bss->wlanRateSet[i] & 0x7FFF) * 0.5;
3726 (*_printf) (" Rates: %s\n", get_wlan_rates(bss->uRateSetLength, bss->wlanRateSet));
3727
3728 /* Information element blobs
3729 */
3730 ie_start = (const BYTE*)bss + bss->ulIeOffset;
3731 ie_end = ie_start + bss->ulIeSize;
3732 print_wlan_elements (ie_start, ie_end);
3733#endif
3734 (*_printf) ("\n");
3735 }
3736}
3737
3738static void print_auth_pairs (const WLAN_AUTH_CIPHER_PAIR_LIST2 *auth_list, int indent)
3739{
3740 DWORD i;
3741
3742 for (i = 0; i < auth_list->dwNumberOfItems && i < DIM(auth_list->pAuthCipherPairList); i++)
3743 {
3744 const DOT11_AUTH_CIPHER_PAIR *auth = auth_list->pAuthCipherPairList + i;
3745
3746 (*_printf) ("%*sauth: %-20.20s ", i > 0 ? indent : 0, "", get_dot11_auth(auth->AuthAlgoId));
3747 (*_printf) ("cipher: %-20.20s\n", get_dot11_cipher(auth->CipherAlgoId));
3748 }
3749 if (i == 0)
3750 (*_printf) ("%s\n", NONE_STR);
3751}
3752
3753static void print_radio_state (const WLAN_RADIO_STATE *rs, int indent)
3754{
3755 DWORD i;
3756
3757 for (i = 0; i < rs->dwNumberOfPhys && i < DIM(rs->PhyRadioState); i++)
3758 {
3759 const WLAN_PHY_RADIO_STATE *phy = rs->PhyRadioState + i;
3760
3761 (*_printf) ("%*sPHY[%lu]: SW: %-7.7s",
3762 i > 0 ? indent : 0, "", i,
3763 _list_lookup(phy->dot11SoftwareRadioState, wlan_radio_states, DIM(wlan_radio_states)));
3764
3765 (*_printf) ("HW: %s\n",
3766 _list_lookup(phy->dot11HardwareRadioState, wlan_radio_states, DIM(wlan_radio_states)));
3767 }
3768 if (i == 0)
3769 (*_printf) ("%*s%s\n", indent, "", NONE_STR);
3770}
3771
3772/*
3773 * Helper functions for GetIpNetTable() and GetIpNetTable2().
3774 */
3775static void print_mib_ipnetrow (DWORD index, const MIB_IPNETROW *row)
3776{
3777 address_buf abuf = "?";
3778 ULONG len = min (row->dwPhysAddrLen, MAXLEN_PHYSADDR);
3779
3780 if (index == 0)
3781 (*_printf) (" IPv4 MAC-addr Type\n"
3782 " --------------------------------------------\n");
3783
3784 _w32_inet_ntop (_w32_AF_INET, &row->dwAddr, abuf, sizeof(abuf));
3785 (*_printf) (" %-15.15s %-17s %s\n",
3786 abuf, get_phys_address(&row->bPhysAddr, len, FALSE),
3787 _list_lookup(row->dwType, arp_types, DIM(arp_types)));
3788}
3789
3790static void print_mib_ipnet_row2 (DWORD index, const MIB_IPNET_ROW2 *row)
3791{
3792 ULONG sec, len = min (row->PhysicalAddressLength, IF_MAX_PHYS_ADDRESS_LENGTH);
3793 const char *mac_addr, *nw_addr;
3794 const char *last_reach;
3795
3796 nw_addr = get_sockaddr_inet_str (&row->Address);
3797
3798 if (row->IsUnreachable)
3799 mac_addr = NONE_STR;
3800 else if (all_zeroes(&row->PhysicalAddress, len))
3801 mac_addr = "00:...00";
3802 else mac_addr = get_phys_address (&row->PhysicalAddress, len, FALSE);
3803
3804 sec = (DWORD)(row->ReachabilityTime.LastReachable/1000.0);
3805 if (sec >= 100*3600)
3806 last_reach = "> 10h";
3807 else last_reach = hms_str (sec);
3808
3809 if (index == 0)
3810 (*_printf) (" Iface IsRouter LastReachable IP-addr MAC-addr State\n"
3811 " ----------------------------------------------------------------------------------------------------\n");
3812
3813 if (row->State != NlnsUnreachable)
3814 {
3815 (*_printf) (" %2lu %d %-10s %-36.36s", row->InterfaceIndex, row->IsRouter, last_reach, nw_addr);
3816 (*_printf) (" %-17.17s %s\n", mac_addr, _list_lookup(row->State, neighbour_states, DIM(neighbour_states)));
3817 }
3818}
3819
3820/*
3821 * Problem with pulling in 'struct hostent' on CygWin.
3822 */
3823#if defined(__CYGWIN__)
3824 #define print_blob(blob)
3825#else
3826/*
3827 * Example rewritten from:
3828 * https://www.winsocketdotnetworkprogramming.com/winsock2programming/winsock2advancednsrnr8d.html
3829 */
3830static void FixList (char ***list, const char *base)
3831{
3832 if (*list)
3833 {
3834 char **addr = *list = (char**) ((ULONG_PTR)*list + base);
3835
3836 while (*addr)
3837 {
3838 *addr = (char*)(((ULONG_PTR)*addr + base));
3839 addr++;
3840 }
3841 }
3842}
3843
3844static void UnpackHostEnt (struct hostent *hostent)
3845{
3846 const char *p = (char*) hostent;
3847
3848 if (hostent->h_name)
3849 hostent->h_name = (char*) ((ULONG_PTR)hostent->h_name + p);
3850
3851 FixList (&hostent->h_aliases, p);
3852 FixList (&hostent->h_addr_list, p);
3853}
3854
3855static void print_blob (const BLOB *blob)
3856{
3857 struct hostent *hp = alloca (blob->cbSize);
3858 int i;
3859
3860 memcpy (hp, blob->pBlobData, blob->cbSize);
3861
3862 UnpackHostEnt (hp);
3863
3864 /* Print out the addresses
3865 */
3866 for (i = 0; hp->h_addr_list[i]; i++)
3867 {
3868 address_buf buf = { "?" };
3869 DWORD ipv4 = *(DWORD*) hp->h_addr_list[i];
3870
3871 _w32_inet_ntop (_w32_AF_INET, &ipv4, buf, sizeof(buf));
3872 (*_printf) (" IP: %s\n", buf);
3873 }
3874 for (i = 0; hp->h_aliases[i] ;i++)
3875 (*_printf) (" Alias: %s\n", hp->h_aliases[i]);
3876}
3877#endif /* __CYGWIN__ */
3878
3879/*
3880 * From Windows' SDK <SvcGuid.h>:
3881 */
3882#define _SVCID_HOSTNAME { 0x0002a800, 0, 0, { 0xC0,0,0,0,0,0,0,0x46 } }
3883#define _SVCID_INET_HOSTADDRBYNAME { 0x0002a803, 0, 0, { 0xC0,0,0,0,0,0,0,0x46 } }
3884
3885static int _pkt_win_print_WSALookupServices (void)
3886{
3887 WSAQUERYSETA q;
3888 DWORD flags;
3889 HANDLE h = INVALID_HANDLE_VALUE;
3890 BOOL get_bth = FALSE;
3891 BOOL get_NLA = FALSE;
3892 GUID guid = _SVCID_HOSTNAME;
3893 GUID HostnameGuid = _SVCID_INET_HOSTADDRBYNAME;
3894 int err = 0;
3895 AFPROTOCOLS afproto[2] = { { AF_INET, IPPROTO_UDP },
3896 { AF_INET, IPPROTO_TCP }
3897 };
3898
3899 (*_printf) ("\nFrom %s():\n", __FUNCTION__);
3900
3901 if (!p_WSALookupServiceBeginA || !p_WSALookupServiceEnd || !p_WSALookupServiceNextA)
3902 {
3903 (*_printf) ("Some needed 'WSALookupService*()' functions not found in 'ws2_32.dll'\n");
3904 return (0);
3905 }
3906
3907 memset (&q, '\0', sizeof(q));
3908 q.dwSize = sizeof(q);
3909
3910 if (get_bth)
3911 {
3912 q.dwNameSpace = NS_BTH;
3913 flags = LUP_CONTAINERS;
3914 }
3915 else if (get_NLA) /* this will return a BLOB for each adapter connected (detected by the NLA) */
3916 {
3917 q.dwNameSpace = NS_NLA;
3918 flags = LUP_RETURN_ALL | LUP_RETURN_NAME | LUP_RETURN_COMMENT | LUP_DEEP;
3919 }
3920 else
3921 {
3922 q.dwNameSpace = NS_ALL;
3923 q.lpServiceClassId = &guid;
3924 q.lpServiceClassId = &HostnameGuid;
3925 q.lpszServiceInstanceName = "www.microsoft.com";
3926 q.dwNumberOfProtocols = DIM(afproto);
3927 q.lpafpProtocols = afproto;
3928 flags = LUP_RETURN_ADDR | LUP_RETURN_BLOB;
3929 }
3930
3931 if ((*p_WSALookupServiceBeginA)(&q, flags, &h) != 0)
3932 {
3933 err = (*p_WSAGetLastError)();
3934 (*_printf) ("WSALookupServiceBegin() failed: %s\n", win_strerror(err));
3935 goto quit;
3936 }
3937
3938 while (1)
3939 {
3940 DWORD len = sizeof(WSAQUERYSETA) + 5000; /* should be plenty */
3941 WSAQUERYSETA *q_ret = alloca (len);
3942 const BLOB *blob;
3943
3944 memset (q_ret, '\0', len);
3945 q_ret->dwSize = sizeof(*q_ret);
3946
3947 if ((*p_WSALookupServiceNextA)(h, 0, &len, q_ret) != NO_ERROR)
3948 {
3949 err = (*p_WSAGetLastError)();
3950
3951 if (err == WSAEFAULT)
3952 (*_printf) ("WSALookupServiceNext(): q_ret too small; %lu needed.\n", len);
3953
3954 else if (err != WSAENOMORE && err != WSA_E_NO_MORE)
3955 (*_printf) ("WSALookupServiceNext(): %s\n", win_strerror(err));
3956 break;
3957 }
3958
3959 if (q_ret->lpszComment)
3960 (*_printf) (" Comment: %s\n", q_ret->lpszComment);
3961
3962 if (q_ret->lpszContext)
3963 (*_printf) (" Context: %s\n", q_ret->lpszContext);
3964
3965 (*_printf) (" Service instance name: '%s'\n", q_ret->lpszServiceInstanceName);
3966 (*_printf) (" Name-space num: %lu\n", q_ret->dwNameSpace);
3967 (*_printf) (" Number of protocols: %lu\n", q_ret->dwNumberOfProtocols);
3968
3969 if (q_ret->lpVersion)
3970 (*_printf) (" Version: %u.%u\n",
3971 HIWORD(q_ret->lpVersion->dwVersion),
3972 LOWORD(q_ret->lpVersion->dwVersion));
3973 else (*_printf) (" Version: ?.?\n");
3974
3975 if (q_ret->lpBlob)
3976 {
3977 blob = q_ret->lpBlob;
3978 (*_printf) ("\nBLOB:\n");
3979
3980 dump_data (&blob->pBlobData, blob->cbSize, " ");
3981
3982 if (!get_bth && !get_NLA)
3983 print_blob (blob);
3984 }
3985 }
3986
3987quit:
3988 if (h != INVALID_HANDLE_VALUE)
3989 (*p_WSALookupServiceEnd) (h);
3990 return (err == 0);
3991}
3992
3993#if defined(ON_WIN_VISTA) && defined(HAVE_NETIOAPI_H)
3994 /*
3995 * Print a speed value from the 'NL_BANDWIDTH_INFORMATION' record.
3996 */
3997 static void print_bw_estimate (const char *what, LONG64 Bps, int indent)
3998 {
3999 char speed[30];
4000
4001 (*_printf) ("%*s%s: %s", indent, "", what, speed64_string(Bps, speed));
4002 }
4003
4004 /*
4005 * Print a NET_LUID union:
4006 *
4007 * typedef union _NET_LUID {
4008 * ULONG64 Value;
4009 * struct { // bitfield with 64 bit types.
4010 * ULONG64 Reserved : 24;
4011 * ULONG64 NetLuidIndex : 24;
4012 * ULONG64 IfType : 16;
4013 * } Info;
4014 * } NET_LUID;
4015 *
4016 */
4017 static void print_net_luid (const NET_LUID *luid, int indent)
4018 {
4019 NET_IFINDEX idx = 0;
4020 char idx_str [20] = { "?" };
4021 char if_name [NDIS_IF_MAX_STRING_SIZE+1] = { "?" };
4022
4023 (*_printf) ("value: 0x%016" X64_FMT "\n"
4024 "%*sInfo.NetLuidIndex: %" U64_FMT "\n"
4025 "%*sInfo.IfType: %s (%" U64_FMT ")\n",
4026 luid->Value,
4027 indent, "", (uint64)luid->Info.NetLuidIndex,
4028 indent, "", _list_lookup(luid->Info.IfType, if_types, DIM(if_types)),
4029 (uint64)luid->Info.IfType);
4030
4031 if (p_ConvertInterfaceLuidToIndex && (*p_ConvertInterfaceLuidToIndex)(luid,&idx) == NO_ERROR)
4032 itoa (idx, idx_str, 10);
4033 (*_printf) ("%*sindex: %s\n", indent, "", idx_str);
4034
4035 if (p_ConvertInterfaceLuidToNameA)
4036 (*p_ConvertInterfaceLuidToNameA) (luid, if_name, sizeof(if_name));
4037 (*_printf) ("%*sif-name: %s\n", indent, "", if_name);
4038
4039 /* Get the network bandwidth rate for the adapter. A Win-8+ function.
4040 */
4041 if (idx && p_GetIpNetworkConnectionBandwidthEstimates)
4042 {
4043 MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES bw_estimates;
4044 DWORD rc;
4045
4046 memset (&bw_estimates, '\0', sizeof(bw_estimates));
4047 rc = (*p_GetIpNetworkConnectionBandwidthEstimates)(idx, AF_INET, &bw_estimates);
4048 if (rc == NO_ERROR)
4049 {
4050 print_bw_estimate ("In Bandwidth", bw_estimates.InboundBandwidthInformation.Bandwidth, indent);
4051 print_bw_estimate (", Instability", bw_estimates.InboundBandwidthInformation.Instability, 0);
4052 (*_printf) ("\n");
4053
4054 print_bw_estimate ("Out Bandwidth", bw_estimates.OutboundBandwidthInformation.Bandwidth, indent);
4055 print_bw_estimate (", Instability", bw_estimates.OutboundBandwidthInformation.Instability, 0);
4056 (*_printf) ("\n");
4057 }
4058 else
4059 (*_printf) ("%*sGetIpNetworkConnectionBandwidthEstimates(): %s\n",
4060 indent, "", win_strerror(rc));
4061 }
4062 }
4063#endif /* ON_WIN_VISTA && HAVE_NETIOAPI_H */
4064
4065static int compare_ipnetrow (const void *_a, const void *_b)
4066{
4067 const MIB_IPNETROW *a = (const MIB_IPNETROW*)_a;
4068 const MIB_IPNETROW *b = (const MIB_IPNETROW*)_b;
4069
4070 if (a->dwType == b->dwType)
4071 return (int)(_w32_intel(a->dwAddr) - _w32_intel(b->dwAddr));
4072
4073 return (int) (a->dwType - b->dwType);
4074}
4075
4076static int compare_ipnetrow2 (const void *_a, const void *_b)
4077{
4078 const MIB_IPNET_ROW2 *a = (const MIB_IPNET_ROW2*)_a;
4079 const MIB_IPNET_ROW2 *b = (const MIB_IPNET_ROW2*)_b;
4080
4081 if (a->State == b->State)
4082 {
4083 if (a->ReachabilityTime.LastReachable < b->ReachabilityTime.LastReachable)
4084 return (-1);
4085 return (1);
4086 }
4087 return (a->State - b->State);
4088}
4089
4090#define DEFINE_FUNC(func) \
4091 int W32_CALL func (void) \
4092 { \
4093 int rc = _##func(); \
4094 print_skipped(); \
4095 return (rc); \
4096 }
4097
4098#else
4099#define DEFINE_FUNC(func) \
4100 int W32_CALL func (void) \
4101 { \
4102 unimplemented ("_w32_" #func, \
4103 __FILE__, __LINE__); \
4104 return (0); \
4105 }
4106#endif /* COMPILE_WINADINF_C */
4107
4108/*
4109 * Maybe these functions can be interfaced into something like:
4110 * int size;
4111 * struct kinfo_ndd *nddp;
4112 * ...
4113 * getkerninfo (KINFO_NDD, nddp, &size, 0);
4114 */
4115
4116DEFINE_FUNC (pkt_win_print_GetIfTable)
4117DEFINE_FUNC (pkt_win_print_GetIfTable2)
4118DEFINE_FUNC (pkt_win_print_GetIfTable2Ex)
4119DEFINE_FUNC (pkt_win_print_GetIpNetTable)
4120DEFINE_FUNC (pkt_win_print_GetIpNetTable2)
4121DEFINE_FUNC (pkt_win_print_GetIpAddrTable)
4122DEFINE_FUNC (pkt_win_print_GetIpForwardTable2)
4123DEFINE_FUNC (pkt_win_print_GetAdaptersAddresses)
4124DEFINE_FUNC (pkt_win_print_GetAdapterOrderMap)
4125DEFINE_FUNC (pkt_win_print_GetNetworkParams)
4126DEFINE_FUNC (pkt_win_print_RasEnumConnections)
4127DEFINE_FUNC (pkt_win_print_WlanEnumInterfaces)
4128DEFINE_FUNC (pkt_win_print_WSALookupServices)
4129
4130int W32_CALL pkt_win_set_verbose_level (int level)
4131{
4132#if defined(COMPILE_WINADINF_C)
4133 int old = verbose_level;
4134
4135 verbose_level = level;
4136 return (old);
4137#else
4138 return (0);
4139#endif
4140}
4141
4142int W32_CALL pkt_win_get_verbose_level (void)
4143{
4144#if defined(COMPILE_WINADINF_C)
4145 return (verbose_level);
4146#else
4147 return (0);
4148#endif
4149}
4150#endif /* WIN32 || _WIN32 */
4151
gettod.h
_watt_os_ver
WORD _watt_os_ver
Definition: misc.c:74
qword_str
const char * qword_str(uint64 val)
The same as above.
Definition: misc.c:1053
dword_str
const char * dword_str(DWORD val)
Return nicely formatted string "xx,xxx,xxx" with thousand separators (left adjusted).
Definition: misc.c:1022
misc.h
strltrim
char * strltrim(char *s)
Return pointer to first non-blank (space/tab) in a string.
Definition: misc_str.c:250
misc_str.h
pcdbug.h
_DOT11_AUTH_CIPHER_PAIR
Definition: winadinf.h:577
_DOT11_SSID
Definition: winadinf.h:361
_MIB_IF_ROW2
Definition: winadinf.h:282
_MIB_IF_TABLE2
Definition: winadinf.h:336
_MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES
Definition: winadinf.h:1074
_MIB_IPFORWARD_ROW2
Definition: winadinf.h:1054
_MIB_IPFORWARD_TABLE2
Definition: winadinf.h:1063
_MIB_IPINTERFACE_ROW
Definition: winadinf.h:1050
_MIB_IPNET_ROW2
Definition: winadinf.h:1030
_MIB_IPNET_TABLE2
Definition: winadinf.h:1058
_WLAN_ASSOCIATION_ATTRIBUTES
Definition: winadinf.h:551
_WLAN_AVAILABLE_NETWORK_LIST
Definition: winadinf.h:620
_WLAN_AVAILABLE_NETWORK
Definition: winadinf.h:596
_WLAN_BSS_ENTRY
Definition: winadinf.h:626
_WLAN_BSS_LIST
Definition: winadinf.h:645
_WLAN_CONNECTION_ATTRIBUTES
Definition: winadinf.h:588
_WLAN_DEVICE_SERVICE_GUID_LIST2
Definition: winadinf.h:1019
_WLAN_INTERFACE_CAPABILITY
Definition: winadinf.h:435
_WLAN_INTERFACE_INFO_LIST
Definition: winadinf.h:461
_WLAN_INTERFACE_INFO
Definition: winadinf.h:455
_WLAN_MAC_FRAME_STATISTICS
Definition: winadinf.h:467
_WLAN_PHY_FRAME_STATISTICS
Definition: winadinf.h:482
_WLAN_PHY_RADIO_STATE
Definition: winadinf.h:1085
_WLAN_RADIO_STATE
Definition: winadinf.h:1091
_WLAN_SECURITY_ATTRIBUTES
Definition: winadinf.h:562
_WLAN_STATISTICS
Definition: winadinf.h:503
_WSAQuerySetA
Definition: winadinf.h:654
LoadTable
Definition: win_dll.h:12
MIB_IPNETROW
Definition: winadinf.h:260
MIB_IPNETTABLE
Definition: winadinf.h:268
WLAN_AUTH_CIPHER_PAIR_LIST2
Definition: winadinf.h:1011
hostent
Definition: netdb.h:104
one_addr
Definition: winadinf.c:339
rip
Definition: routed.h:111
search_list
Definition: misc.h:131
setup_info_st
Definition: winadinf.c:355
sockaddr_in6
Definition: in.h:231
sockaddr_in
Definition: in.h:224
token
Definition: pcdbug.c:1473
hms_str
const char * hms_str(DWORD sec)
Return string "HH:MM:SS" for a time in seconds.
Definition: timer.c:715
timer.h
wattcp.h
Core definitions.
uint64
unsigned long long uint64
our unsigned "long long" type
Definition: wattcp.h:65
win_dll.h
GET_ADDRESSES
GET_ADDRESSES(get_unicast_addrs, IP_ADAPTER_UNICAST_ADDRESS, uca)
We need the row.Metric from print_ip_interface_details() to get the true Metric for the route.
Definition: winadinf.c:1698
speed_string
static const char * speed_string(DWORD val, char *buf)
Return a number with suffix for a link-speed 32-bit value.
Definition: winadinf.c:674
setup_info_adapter_print
static void setup_info_adapter_print(const char *adapter_name)
Walk the 'setup_info' array looking for a 'inf->NetCfgInstanceId == adapter_name' (there can be only ...
Definition: winadinf.c:851
dword_string
static const char * dword_string(DWORD val)
Return nicely formatted string "xx.xxx.xxx" with thousand separators (left adjusted).
Definition: winadinf.c:640
_list_lookup
static const char * _list_lookup(DWORD value, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: winadinf.c:497
dump_data
static void dump_data(const void *data_p, UINT datalen, const char *indent)
Definition: winadinf.c:1769
get_phys_address
static const char * get_phys_address(const void *a, ULONG len, BOOL show_manuf)
Definition: winadinf.c:1439
_w32_intel16
W32_FUNC unsigned short W32_CDECL _w32_intel16(unsigned short x)
Convert 16-bit big-endian (network order) to intel (host order) format.
Definition: misc.c:183
_w32_intel
W32_FUNC unsigned long W32_CDECL _w32_intel(unsigned long x)
Convert 32-bit big-endian (network order) to intel (host order) format.
Definition: misc.c:171
speed64_string
static const char * speed64_string(ULONG64 val, char *buf)
Return a number with a suitable suffix for a link-speed of a 64-bit value.
Definition: winadinf.c:709
winadinf.h
win_strerror
char *W32_CALL win_strerror(DWORD err)
Return err-number and string for 'err'.
Definition: winmisc.c:208


Watt-32 tcp/ip: E:/WATT/src/winadinf.h Source File

  • src
winadinf.h
Go to the documentation of this file.
1
19#ifndef _w32_WINADINF_H
20#define _w32_WINADINF_H
21
22#if (defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)) && !defined(__DMC__) && !defined(__ORANGEC__)
23
24#define __NETINET_IN_H /* Don't pull in these in "../inc/" */
25#define __SYS_SOCKET_H
26#define __SYS_WERRNO_H
27#define __SYS_WTIME_H
28#define __SYS_SWAP_BYTES_H
29
30#define _WATT32_FAKE_WINSOCK_H /* Suppress errors from <w32api.h> */
31#define _WATT32_FAKE_WINSOCK2_H
32#define _WATT32_FAKE_WS2TCPIP_H
33#define USE_SYS_TYPES_FD_SET /* Shutup CygWin */
34
35#define WATT32_COMPILING_WINADINF_C
36
37/* We're now ready to pull in the real Winsock headers needed.
38 */
39
40#define WIN32_LEAN_AND_MEAN
41
42/*
43 * Change this for your MinGW.
44 * '-D_WIN32_WINNT' is now set in the generated 'MinGW*.mak' files.
45 */
46#if defined(__MINGW64_VERSION_MAJOR) && 0
47 #undef _WIN32_WINNT
48 #define _WIN32_WINNT 0x0601
49 #undef WINVER
50 #define WINVER _WIN32_WINNT
51#endif
52
53/*
54 * OpenWatcom have rather limited Vista+ support.
55 * So just leave it; fallback to Win-XP SP1+ below.
56 */
57#if defined(__WATCOMC__) && 0
58 #undef _WIN32_WINNT
59 #define _WIN32_WINNT 0x0601
60 #undef WINVER
61 #define WINVER _WIN32_WINNT
62#endif
63
64/*
65 * If wanted SDK version is not set, defaults to 'Win-XP SP1+'
66 */
67#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0501)
68 #undef _WIN32_WINNT
69 #define _WIN32_WINNT 0x0501
70 #undef WINVER
71 #define WINVER _WIN32_WINNT
72#endif
73
74/*
75 * Ditto for 'WINVER' value.
76 */
77#if !defined(WINVER) || (WINVER < 0x0501)
78 #undef WINVER
79 #define WINVER _WIN32_WINNT /* Required for OpenWatcom */
80 #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(WINVER)
81#endif
82
83#include <windows.h>
84#include <windowsx.h>
85#include <winsock2.h>
86
87/*
88 * Get the maximum features out of the local "ws2tcpip.h", "iphlpapi.h" etc. headers.
89 * Maybe not such a good idea.
90 */
91#if defined(_WIN32_MAXVER) && (_WIN32_MAXVER > _WIN32_WINNT) && 0
92 #undef _WIN32_WINNT
93 #define _WIN32_WINNT _WIN32_MAXVER
94#endif
95
96#undef ON_WIN_VISTA
97#undef ON_WIN_VISTA_SP1
98
99#if defined(__BORLANDC__)
100 /*
101 * Turn off warnings:
102 * 'IN6_IS_ADDR_X()' is declared but never used.
103 *
104 * (since these are inlined in <ws2tcpip.h>).
105 */
106 #pragma warn -use-
107
108 /* Borland's <ws2tcpip.h> seems to require that '_MSC_VER' is defined ?!
109 */
110 #if !defined(_MSC_VER)
111 #define _MSC_VER 0x1200
112 #endif
113#endif
114
115#include <ws2tcpip.h>
116
117#if defined(__BORLANDC__) || defined(__POCC__)
118 #undef _MSC_VER /* A built-in in PellesC */
119#else
120 #include <specstrings.h>
121#endif
122
123#if defined(__MINGW64_VERSION_MAJOR) && (_WIN32_WINNT >= 0x0601) && !defined(__DPAPI_H__)
124 /*
125 * This seems to be missing and required for '_WIN32_WINNT >= 0x0601' on MinGW64 and TDM-gcc.
126 */
127 #include <dpapi.h>
128#endif
129
130#include <objbase.h>
131#include <iptypes.h>
132#include <iphlpapi.h>
133#include <ipifcons.h>
134#include <ras.h>
135#include <raserror.h>
136
137#include <sys/cdefs.h>
138
139/* clang-cl implicitly defines '_MSC_VER'. Just make it more clear.
140 */
141#if defined(_MSC_VER) || defined(__clang__)
142 #define _STR2(x) #x
143 #define _STR(x) _STR2(x)
144
145 #pragma message (__FILE__ "(" _STR(__LINE__) "): MSVC: WINVER=" _STR(WINVER))
146
147 #if (NTDDI_VERSION >= NTDDI_VISTASP1)
148 #define ON_WIN_VISTA
149 #define ON_WIN_VISTA_SP1
150 #pragma message (__FILE__ "(" _STR(__LINE__) "): MSVC: Using WinVista SP1+ SDK")
151
152 #elif (NTDDI_VERSION >= NTDDI_VISTA)
153 #define ON_WIN_VISTA
154 #pragma message (__FILE__ "(" _STR(__LINE__) "): MSVC: Using WinVista SDK")
155 #endif
156
157#elif defined(_WIN32_WINNT)
158 #define _STR2(x) #x
159 #define _STR(x) _STR2(x)
160
161 #if (_WIN32_WINNT >= 0x0601) /* Is this right? */
162 #define ON_WIN_VISTA
163 #define ON_WIN_VISTA_SP1
164
165 #elif (_WIN32_WINNT >= 0x0600)
166 #define ON_WIN_VISTA
167 #endif
168#endif
169
170/*
171 * I didn't make this compile using cl 16 and the v7.0 SDK.
172 * So just don't compile it.
173 */
174#if defined(_MSC_VER) && (_MSC_VER >= 1700)
175
176 #include <wtypes.h>
177 #include <wlanapi.h>
178 #include <windot11.h>
179 #include <netioapi.h>
180
181 #define HAVE_NETIOAPI_H
182 #define HAVE_WINDOT11_H
183 #define HAVE_WLANAPI_H
184 #define HAVE_WSAQuerySetA
185 #define COMPILE_WINADINF_C /* We have all stuff need to compile winadinf.c */
186
187#elif defined(__POCC__)
188 #include <wtypes.h>
189 #include <windot11.h>
190 #include <netioapi.h>
191
192 #define HAVE_NETIOAPI_H
193 #define HAVE_WINDOT11_H
194 #define HAVE_WSAQuerySetA
195 #define COMPILE_WINADINF_C
196
197#elif defined(__WATCOMC__)
198 #include <wtypes.h>
199 #include <wlantype.h>
200 #include <windot11.h>
201
202 #define HAVE_WINDOT11_H
203 #define HAVE_WSAQuerySetA
204 #define COMPILE_WINADINF_C
205
206 #undef FIXED_INFO
207 #define FIXED_INFO void /* Fails to compile _pkt_win_print_GetNetworkParams() */
208
209#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x0700)
210 /*
211 * A recent version (__BORLANDC__ >= 0x0700?) of CodeGearC or Embarcadero
212 * should be able to compile winadinf.c.
213 */
214 #include <wtypes.h>
215 #include <wlanapi.h>
216 #include <windot11.h>
217 #include <netioapi.h>
218
219 #define HAVE_NETIOAPI_H
220 #define HAVE_WINDOT11_H
221 #define HAVE_WLANAPI_H
222 #define HAVE_WSAQuerySetA
223 #define COMPILE_WINADINF_C
224
225#elif defined(__MINGW64_VERSION_MAJOR) /* MinGW64 / TDM-gcc */
226 #include <wtypes.h>
227 #include <wlanapi.h>
228 #include <windot11.h>
229 #include <netioapi.h>
230
231 #define HAVE_NETIOAPI_H
232 #define HAVE_WLANAPI_H
233 #define HAVE_WINDOT11_H
234 #define HAVE_WSAQuerySetA
235 #define COMPILE_WINADINF_C
236
237#elif defined(__MINGW32__) /* old-school MinGW */
238 #define COMPILE_WINADINF_C
239
240#elif defined(__CYGWIN__) /* CygWin 32/64-bit */
241 #include <cygwin/version.h>
242
243 #if (CYGWIN_VERSION_DLL_MAJOR >= 3002) /* Not sure about the version */
244 #define HAVE_NETIOAPI_H
245 #define HAVE_WLANAPI_H
246 #define HAVE_WINDOT11_H
247 #define HAVE_WSAQuerySetA
248 #endif
249
250 #define COMPILE_WINADINF_C
251#endif
252
253/* Assume for now, that all compilers have 'MIB_IPNETTABLE'.
254 */
255#define HAVE_MIB_IPNETTABLE
256
257/* For GetIpNetTable():
258 */
259#if !defined(HAVE_MIB_IPNETTABLE)
260 typedef struct {
261 DWORD dwIndex;
262 DWORD dwPhysAddrLen;
263 BYTE bPhysAddr [MAXLEN_PHYSADDR]; /* =8, not 6 for EtherNet */
264 DWORD dwAddr;
265 DWORD dwType;
266 } MIB_IPNETROW;
267
268 typedef struct {
269 DWORD dwNumEntries;
270 MIB_IPNETROW table [1];
271 } MIB_IPNETTABLE;
272#endif
273
274/* For GetIpNetTable2() + GetIpNetTable2Ex():
275 */
276#if !defined(HAVE_NETIOAPI_H) && defined(COMPILE_WINADINF_C)
277 typedef enum MIB_IF_TABLE_LEVEL {
278 MibIfTableNormal,
279 MibIfTableRaw
280 } MIB_IF_TABLE_LEVEL;
281
282 typedef struct _MIB_IF_ROW2 {
283 NET_LUID InterfaceLuid;
284 NET_IFINDEX InterfaceIndex;
285 GUID InterfaceGuid;
286 WCHAR Alias [IF_MAX_STRING_SIZE + 1];
287 WCHAR Description [IF_MAX_STRING_SIZE + 1];
288 ULONG PhysicalAddressLength;
289 UCHAR PhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH];
290 UCHAR PermanentPhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH];
291 ULONG Mtu;
292 IFTYPE Type;
293 TUNNEL_TYPE TunnelType;
294 NDIS_MEDIUM MediaType;
295 NDIS_PHYSICAL_MEDIUM PhysicalMediumType;
296 NET_IF_ACCESS_TYPE AccessType;
297 NET_IF_DIRECTION_TYPE DirectionType;
298 struct {
299 BOOLEAN HardwareInterface : 1;
300 BOOLEAN FilterInterface : 1;
301 BOOLEAN ConnectorPresent : 1;
302 BOOLEAN NotAuthenticated : 1;
303 BOOLEAN NotMediaConnected : 1;
304 BOOLEAN Paused : 1;
305 BOOLEAN LowPower : 1;
306 BOOLEAN EndPointInterface : 1;
307 } InterfaceAndOperStatusFlags;
308
309 IF_OPER_STATUS OperStatus;
310 NET_IF_ADMIN_STATUS AdminStatus;
311 NET_IF_MEDIA_CONNECT_STATE MediaConnectState;
312 NET_IF_NETWORK_GUID NetworkGuid;
313 NET_IF_CONNECTION_TYPE ConnectionType;
314 ULONG64 TransmitLinkSpeed;
315 ULONG64 ReceiveLinkSpeed;
316 ULONG64 InOctets;
317 ULONG64 InUcastPkts;
318 ULONG64 InNUcastPkts;
319 ULONG64 InDiscards;
320 ULONG64 InErrors;
321 ULONG64 InUnknownProtos;
322 ULONG64 InUcastOctets;
323 ULONG64 InMulticastOctets;
324 ULONG64 InBroadcastOctets;
325 ULONG64 OutOctets;
326 ULONG64 OutUcastPkts;
327 ULONG64 OutNUcastPkts;
328 ULONG64 OutDiscards;
329 ULONG64 OutErrors;
330 ULONG64 OutUcastOctets;
331 ULONG64 OutMulticastOctets;
332 ULONG64 OutBroadcastOctets;
333 ULONG64 OutQLen;
334 } MIB_IF_ROW2;
335
336 typedef struct _MIB_IF_TABLE2 {
337 ULONG NumEntries;
338 MIB_IF_ROW2 Table [1];
339 } MIB_IF_TABLE2;
340
341 #if !defined(__WATCOMC__)
342 typedef enum _NL_NEIGHBOR_STATE {
343 NlnsUnreachable,
344 NlnsIncomplete,
345 NlnsProbe,
346 NlnsDelay,
347 NlnsStale,
348 NlnsReachable,
349 NlnsPermanent,
350 NlnsMaximum,
351 } NL_NEIGHBOR_STATE;
352 #endif
353#endif
354
355#if !defined(HAVE_WINDOT11_H) && defined(COMPILE_WINADINF_C)
356 /*
357 * The DOT11 stuff ripped from OpenWatcom's <wlantype.h> and <windot11.h>.
358 */
359 #define DOT11_SSID_MAX_LENGTH 32 /* 802.11 SSID maximum length */
360
361 typedef struct _DOT11_SSID { /* 802.11 SSID */
362 ULONG uSSIDLength;
363 UCHAR ucSSID [DOT11_SSID_MAX_LENGTH];
364 } DOT11_SSID;
365
366 typedef enum _DOT11_PHY_TYPE { /* 802.11 physical types */
367 dot11_phy_type_unknown = 0,
368 dot11_phy_type_any = dot11_phy_type_unknown,
369 dot11_phy_type_fhss = 1,
370 dot11_phy_type_dsss = 2,
371 dot11_phy_type_irbaseband = 3,
372 dot11_phy_type_ofdm = 4,
373 dot11_phy_type_hrdsss = 5,
374 dot11_phy_type_erp = 6,
375 dot11_phy_type_ht = 7,
376 dot11_phy_type_vht = 8,
377 dot11_phy_type_IHV_start = 0x80000000,
378 dot11_phy_type_IHV_end = 0xFFFFFFFF
379 } DOT11_PHY_TYPE;
380
381 typedef enum _DOT11_BSS_TYPE { /* 802.11 BSS types */
382 dot11_BSS_type_infrastructure = 1,
383 dot11_BSS_type_independent = 2,
384 dot11_BSS_type_any = 3
385 } DOT11_BSS_TYPE;
386
387 typedef enum _DOT11_AUTH_ALGORITHM { /* 802.11 authentication algorithms */
388 DOT11_AUTH_ALGO_80211_OPEN = 1,
389 DOT11_AUTH_ALGO_80211_SHARED_KEY = 2,
390 DOT11_AUTH_ALGO_WPA = 3,
391 DOT11_AUTH_ALGO_WPA_PSK = 4,
392 DOT11_AUTH_ALGO_WPA_NONE = 5,
393 DOT11_AUTH_ALGO_WPA_RSNA = 6,
394 DOT11_AUTH_ALGO_WPA_RSNA_PSK = 7,
395 DOT11_AUTH_ALGO_IHV_START = 0x80000000,
396 DOT11_AUTH_ALGO_IHV_END = 0xFFFFFFFF
397 } DOT11_AUTH_ALGORITHM;
398
399 typedef enum _DOT11_CIPHER_ALGORITHM { /* 802.11 cipher algorithms */
400 DOT11_CIPHER_ALGO_NONE = 0x00000000,
401 DOT11_CIPHER_ALGO_WEP40 = 0x00000001,
402 DOT11_CIPHER_ALGO_TKIP = 0x00000002,
403 DOT11_CIPHER_ALGO_CCMP = 0x00000004,
404 DOT11_CIPHER_ALGO_WEP104 = 0x00000005,
405 DOT11_CIPHER_ALGO_WPA_USE_GROUP = 0x00000100,
406 DOT11_CIPHER_ALGO_RSN_USE_GROUP = 0x00000100,
407 DOT11_CIPHER_ALGO_WEP = 0x00000101,
408 DOT11_CIPHER_ALGO_IHV_START = 0x80000000,
409 DOT11_CIPHER_ALGO_IHV_END = 0xFFFFFFFF
410 } DOT11_CIPHER_ALGORITHM;
411
412 typedef UCHAR DOT11_MAC_ADDRESS [6]; /* 802.11 MAC address */
413#endif
414
415#if !defined(HAVE_WLANAPI_H) && defined(COMPILE_WINADINF_C)
416 #define WLAN_MAX_PHY_TYPE_NUMBER 8
417 #define WLAN_MAX_NAME_LENGTH 256
418 #define WLAN_MAX_PHY_INDEX 64 /* max # of PHYs supported by a NIC */
419
420 typedef enum _WLAN_CONNECTION_MODE {
421 wlan_connection_mode_profile = 0,
422 wlan_connection_mode_temporary_profile,
423 wlan_connection_mode_discovery_secure,
424 wlan_connection_mode_discovery_unsecure,
425 wlan_connection_mode_auto,
426 wlan_connection_mode_invalid
427 } WLAN_CONNECTION_MODE;
428
429 typedef enum _WLAN_INTERFACE_TYPE {
430 wlan_interface_type_emulated_802_11 = 0,
431 wlan_interface_type_native_802_11,
432 wlan_interface_type_invalid
433 } WLAN_INTERFACE_TYPE;
434
435 typedef struct _WLAN_INTERFACE_CAPABILITY {
436 WLAN_INTERFACE_TYPE interfaceType;
437 BOOL bDot11DSupported;
438 DWORD dwMaxDesiredSsidListSize;
439 DWORD dwMaxDesiredBssidListSize;
440 DWORD dwNumberOfSupportedPhys;
441 DOT11_PHY_TYPE dot11PhyTypes [WLAN_MAX_PHY_INDEX];
442 } WLAN_INTERFACE_CAPABILITY;
443
444 typedef enum _WLAN_INTERFACE_STATE {
445 wlan_interface_state_not_ready,
446 wlan_interface_state_connected,
447 wlan_interface_state_ad_hoc_network_formed,
448 wlan_interface_state_disconnecting,
449 wlan_interface_state_disconnected,
450 wlan_interface_state_associating,
451 wlan_interface_state_discovering,
452 wlan_interface_state_authenticating
453 } WLAN_INTERFACE_STATE;
454
455 typedef struct _WLAN_INTERFACE_INFO {
456 GUID InterfaceGuid;
457 WCHAR strInterfaceDescription [WLAN_MAX_NAME_LENGTH];
458 WLAN_INTERFACE_STATE isState;
459 } WLAN_INTERFACE_INFO;
460
461 typedef struct _WLAN_INTERFACE_INFO_LIST {
462 DWORD dwNumberOfItems;
463 DWORD dwIndex;
464 WLAN_INTERFACE_INFO InterfaceInfo [1];
465 } WLAN_INTERFACE_INFO_LIST;
466
467 typedef struct _WLAN_MAC_FRAME_STATISTICS {
468 ULONGLONG ullTransmittedFrameCount;
469 ULONGLONG ullReceivedFrameCount;
470 ULONGLONG ullWEPExcludedCount;
471 ULONGLONG ullTKIPLocalMICFailures;
472 ULONGLONG ullTKIPReplays;
473 ULONGLONG ullTKIPICVErrorCount;
474 ULONGLONG ullCCMPReplays;
475 ULONGLONG ullCCMPDecryptErrors;
476 ULONGLONG ullWEPUndecryptableCount;
477 ULONGLONG ullWEPICVErrorCount;
478 ULONGLONG ullDecryptSuccessCount;
479 ULONGLONG ullDecryptFailureCount;
480 } WLAN_MAC_FRAME_STATISTICS;
481
482 typedef struct _WLAN_PHY_FRAME_STATISTICS {
483 ULONGLONG ullTransmittedFrameCount;
484 ULONGLONG ullMulticastTransmittedFrameCount;
485 ULONGLONG ullFailedCount;
486 ULONGLONG ullRetryCount;
487 ULONGLONG ullMultipleRetryCount;
488 ULONGLONG ullMaxTXLifetimeExceededCount;
489 ULONGLONG ullTransmittedFragmentCount;
490 ULONGLONG ullRTSSuccessCount;
491 ULONGLONG ullRTSFailureCount;
492 ULONGLONG ullACKFailureCount;
493 ULONGLONG ullReceivedFrameCount;
494 ULONGLONG ullMulticastReceivedFrameCount;
495 ULONGLONG ullPromiscuousReceivedFrameCount;
496 ULONGLONG ullMaxRXLifetimeExceededCount;
497 ULONGLONG ullFrameDuplicateCount;
498 ULONGLONG ullReceivedFragmentCount;
499 ULONGLONG ullPromiscuousReceivedFragmentCount;
500 ULONGLONG ullFCSErrorCount;
501 } WLAN_PHY_FRAME_STATISTICS;
502
503 typedef struct _WLAN_STATISTICS {
504 ULONGLONG ullFourWayHandshakeFailures;
505 ULONGLONG ullTKIPCounterMeasuresInvoked;
506 ULONGLONG ullReserved;
507 WLAN_MAC_FRAME_STATISTICS MacUcastCounters;
508 WLAN_MAC_FRAME_STATISTICS MacMcastCounters;
509 DWORD dwNumberOfPhys;
510 WLAN_PHY_FRAME_STATISTICS PhyCounters [1];
511 } WLAN_STATISTICS;
512
513 typedef enum _WLAN_INTF_OPCODE {
514 wlan_intf_opcode_autoconf_start = 0x000000000,
515 wlan_intf_opcode_autoconf_enabled,
516 wlan_intf_opcode_background_scan_enabled,
517 wlan_intf_opcode_media_streaming_mode,
518 wlan_intf_opcode_radio_state,
519 wlan_intf_opcode_bss_type,
520 wlan_intf_opcode_interface_state,
521 wlan_intf_opcode_current_connection,
522 wlan_intf_opcode_channel_number,
523 wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs,
524 wlan_intf_opcode_supported_adhoc_auth_cipher_pairs,
525 wlan_intf_opcode_supported_country_or_region_string_list,
526 wlan_intf_opcode_current_operation_mode,
527 wlan_intf_opcode_supported_safe_mode,
528 wlan_intf_opcode_certified_safe_mode,
529 wlan_intf_opcode_hosted_network_capable,
530 wlan_intf_opcode_autoconf_end = 0x0FFFFFFF,
531 wlan_intf_opcode_msm_start = 0x10000100,
532 wlan_intf_opcode_statistics,
533 wlan_intf_opcode_rssi,
534 wlan_intf_opcode_msm_end = 0x1FFFFFFF,
535 wlan_intf_opcode_security_start = 0x20010000,
536 wlan_intf_opcode_security_end = 0x2FFFFFFF,
537 wlan_intf_opcode_ihv_start = 0x30000000,
538 wlan_intf_opcode_ihv_end = 0x3FFFFFFF
539 } WLAN_INTF_OPCODE;
540
541 typedef enum _WLAN_OPCODE_VALUE_TYPE {
542 wlan_opcode_value_type_query_only = 0,
543 wlan_opcode_value_type_set_by_group_policy,
544 wlan_opcode_value_type_set_by_user,
545 wlan_opcode_value_type_invalid
546 } WLAN_OPCODE_VALUE_TYPE;
547
548 /* Structure WLAN_ASSOCIATION_ATTRIBUTES defines attributes of a wireless
549 * association. The unit for Rx/Tx rate is Kbits/second.
550 */
551 typedef struct _WLAN_ASSOCIATION_ATTRIBUTES {
552 DOT11_SSID dot11Ssid;
553 DOT11_BSS_TYPE dot11BssType;
554 DOT11_MAC_ADDRESS dot11Bssid;
555 DOT11_PHY_TYPE dot11PhyType;
556 ULONG uDot11PhyIndex;
557 ULONG wlanSignalQuality;
558 ULONG ulRxRate;
559 ULONG ulTxRate;
560 } WLAN_ASSOCIATION_ATTRIBUTES;
561
562 typedef struct _WLAN_SECURITY_ATTRIBUTES {
563 BOOL bSecurityEnabled;
564 BOOL bOneXEnabled;
565 DOT11_AUTH_ALGORITHM dot11AuthAlgorithm;
566 DOT11_CIPHER_ALGORITHM dot11CipherAlgorithm;
567 } WLAN_SECURITY_ATTRIBUTES;
568
569 #if defined(__WATCOMC__)
570 #define DOT11_RATE_SET_MAX_LENGTH 126
571
572 typedef struct _WLAN_RATE_SET {
573 ULONG uRateSetLength;
574 USHORT usRateSet [DOT11_RATE_SET_MAX_LENGTH];
575 } WLAN_RATE_SET;
576 #else
577 typedef struct _DOT11_AUTH_CIPHER_PAIR {
578 DOT11_AUTH_ALGORITHM AuthAlgoId;
579 DOT11_CIPHER_ALGORITHM CipherAlgoId;
580 } DOT11_AUTH_CIPHER_PAIR;
581 #endif
582
583 typedef struct _WLAN_AUTH_CIPHER_PAIR_LIST {
584 DWORD dwNumberOfItems;
585 DOT11_AUTH_CIPHER_PAIR pAuthCipherPairList;
586 } WLAN_AUTH_CIPHER_PAIR_LIST;
587
588 typedef struct _WLAN_CONNECTION_ATTRIBUTES {
589 WLAN_INTERFACE_STATE isState;
590 WLAN_CONNECTION_MODE wlanConnectionMode;
591 WCHAR strProfileName [WLAN_MAX_NAME_LENGTH];
592 WLAN_ASSOCIATION_ATTRIBUTES wlanAssociationAttributes;
593 WLAN_SECURITY_ATTRIBUTES wlanSecurityAttributes;
594 } WLAN_CONNECTION_ATTRIBUTES;
595
596 typedef struct _WLAN_AVAILABLE_NETWORK {
597 WCHAR strProfileName[WLAN_MAX_NAME_LENGTH];
598 DOT11_SSID dot11Ssid;
599 DOT11_BSS_TYPE dot11BssType;
600 ULONG uNumberOfBssids;
601 BOOL bNetworkConnectable;
602 DWORD wlanNotConnectableReason;
603 ULONG uNumberOfPhyTypes;
604 DOT11_PHY_TYPE dot11PhyTypes[WLAN_MAX_PHY_TYPE_NUMBER];
605
606 /* bMorePhyTypes is set to TRUE if the PHY types for the network
607 * exceeds WLAN_MAX_PHY_TYPE_NUMBER.
608 * In this case, uNumerOfPhyTypes is WLAN_MAX_PHY_TYPE_NUMBER and the
609 * first WLAN_MAX_PHY_TYPE_NUMBER PHY types are returned.
610 */
611 BOOL bMorePhyTypes;
612 ULONG wlanSignalQuality;
613 BOOL bSecurityEnabled;
614 DOT11_AUTH_ALGORITHM dot11DefaultAuthAlgorithm;
615 DOT11_CIPHER_ALGORITHM dot11DefaultCipherAlgorithm;
616 DWORD dwFlags;
617 DWORD dwReserved;
618 } WLAN_AVAILABLE_NETWORK;
619
620 typedef struct _WLAN_AVAILABLE_NETWORK_LIST {
621 DWORD dwNumberOfItems;
622 DWORD dwIndex;
623 WLAN_AVAILABLE_NETWORK Network [1];
624 } WLAN_AVAILABLE_NETWORK_LIST;
625
626 typedef struct _WLAN_BSS_ENTRY {
627 DOT11_SSID dot11Ssid;
628 ULONG uPhyId;
629 DOT11_MAC_ADDRESS dot11Bssid;
630 DOT11_BSS_TYPE dot11BssType;
631 DOT11_PHY_TYPE dot11BssPhyType;
632 LONG lRssi;
633 ULONG uLinkQuality;
634 BOOLEAN bInRegDomain;
635 USHORT usBeaconPeriod;
636 ULONGLONG ullTimestamp;
637 ULONGLONG ullHostTimestamp;
638 USHORT usCapabilityInformation;
639 ULONG ulChCenterFrequency;
640 WLAN_RATE_SET wlanRateSet;
641 ULONG ulIeOffset;
642 ULONG ulIeSize;
643 } WLAN_BSS_ENTRY;
644
645 typedef struct _WLAN_BSS_LIST {
646 DWORD dwTotalSize;
647 DWORD dwNumberOfItems;
648 WLAN_BSS_ENTRY wlanBssEntries [1];
649 } WLAN_BSS_LIST;
650#endif /* HAVE_WLANAPI_H) && COMPILE_WINADINF_C */
651
652
653#if !defined(HAVE_WSAQuerySetA) && defined(COMPILE_WINADINF_C)
654 typedef struct _WSAQuerySetA {
655 DWORD dwSize;
656 char *lpszServiceInstanceName;
657 GUID *lpServiceClassId;
658 WSAVERSION *lpVersion;
659 char *lpszComment;
660 DWORD dwNameSpace;
661 GUID *lpNSProviderId;
662 char *lpszContext;
663 DWORD dwNumberOfProtocols;
664 AFPROTOCOLS *lpafpProtocols;
665 char *lpszQueryString;
666 DWORD dwNumberOfCsAddrs;
667 CSADDR_INFO *lpcsaBuffer;
668 DWORD dwOutputFlags;
669 BLOB *lpBlob;
670 } WSAQUERYSETA;
671#endif
672
673/*
674 * Flags that control the list returned by WlanGetAvailableNetworkList
675 * include all ad hoc network profiles in the available network list,
676 * regardless they are visible or not
677 */
678#ifndef WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_ADHOC_PROFILES
679#define WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_ADHOC_PROFILES 0x00000001
680#endif
681
682/*
683 * Include all hidden network profiles in the available network list,
684 * regardless they are visible or not
685 */
686#ifndef WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES
687#define WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES 0x00000002
688#endif
689
690/*
691 * WLAN_AVAILABLE_NETWORK::dwFlags
692 */
693#ifndef WLAN_AVAILABLE_NETWORK_CONNECTED
694#define WLAN_AVAILABLE_NETWORK_CONNECTED 0x00000001
695#endif
696
697#ifndef WLAN_AVAILABLE_NETWORK_HAS_PROFILE
698#define WLAN_AVAILABLE_NETWORK_HAS_PROFILE 0x00000002
699#endif
700
701#ifndef WLAN_AVAILABLE_NETWORK_CONSOLE_USER_PROFILE
702#define WLAN_AVAILABLE_NETWORK_CONSOLE_USER_PROFILE 0x00000004
703#endif
704
705#ifndef IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED
706#define IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED 0x0040
707#endif
708
709#ifndef IP_ADAPTER_IPV4_ENABLED
710#define IP_ADAPTER_IPV4_ENABLED 0x0080
711#endif
712
713#ifndef IP_ADAPTER_IPV6_ENABLED
714#define IP_ADAPTER_IPV6_ENABLED 0x0100
715#endif
716
717#ifndef GAA_FLAG_INCLUDE_ALL_INTERFACES
718#define GAA_FLAG_INCLUDE_ALL_INTERFACES 0x0100L
719#endif
720
721#ifndef GAA_FLAG_INCLUDE_WINS_INFO
722#define GAA_FLAG_INCLUDE_WINS_INFO 0x0040L
723#endif
724
725#ifndef GAA_FLAG_INCLUDE_GATEWAYS
726#define GAA_FLAG_INCLUDE_GATEWAYS 0x0080L
727#endif
728
729#ifndef GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER
730#define GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER 0x0400L
731#endif
732
733#ifndef DOT11_AUTH_ALGO_RSNA
734#define DOT11_AUTH_ALGO_RSNA 6
735#endif
736
737#ifndef DOT11_AUTH_ALGO_RSNA_PSK
738#define DOT11_AUTH_ALGO_RSNA_PSK 7
739#endif
740
741#ifndef DOT11_AUTH_ALGO_WPA_NONE
742#define DOT11_AUTH_ALGO_WPA_NONE 5
743#endif
744
745#ifndef DOT11_OPERATION_MODE_EXTENSIBLE_STATION
746#define DOT11_OPERATION_MODE_EXTENSIBLE_STATION 0x00000004
747#endif
748
749#ifndef DOT11_OPERATION_MODE_NETWORK_MONITOR
750#define DOT11_OPERATION_MODE_NETWORK_MONITOR 0x80000000
751#endif
752
753#ifndef RASLCPO_AES_128
754#define RASLCPO_AES_128 0x00000020
755#endif
756
757#ifndef RASLCPO_AES_256
758#define RASLCPO_AES_256 0x00000040
759#endif
760
761#ifndef MAX_INTERFACE_NAME_LEN
762#define MAX_INTERFACE_NAME_LEN 256
763#endif
764
765#ifndef MAXLEN_IFDESCR
766#define MAXLEN_IFDESCR 256
767#endif
768
769/* Create all these as '_IF_TYPE_x' to avoid all the '#ifndef IF_TYPE_x' statements.
770 * From: "grep 'define IF_TYPE_' ipifcons.h"
771 */
772#define _IF_TYPE_OTHER 1
773#define _IF_TYPE_REGULAR_1822 2
774#define _IF_TYPE_HDH_1822 3
775#define _IF_TYPE_DDN_X25 4
776#define _IF_TYPE_RFC877_X25 5
777#define _IF_TYPE_ETHERNET_CSMACD 6
778#define _IF_TYPE_IS088023_CSMACD 7
779#define _IF_TYPE_ISO88024_TOKENBUS 8
780#define _IF_TYPE_ISO88025_TOKENRING 9
781#define _IF_TYPE_ISO88026_MAN 10
782#define _IF_TYPE_STARLAN 11
783#define _IF_TYPE_PROTEON_10MBIT 12
784#define _IF_TYPE_PROTEON_80MBIT 13
785#define _IF_TYPE_HYPERCHANNEL 14
786#define _IF_TYPE_FDDI 15
787#define _IF_TYPE_LAP_B 16
788#define _IF_TYPE_SDLC 17
789#define _IF_TYPE_DS1 18
790#define _IF_TYPE_E1 19
791#define _IF_TYPE_BASIC_ISDN 20
792#define _IF_TYPE_PRIMARY_ISDN 21
793#define _IF_TYPE_PROP_POINT2POINT_SERIAL 22
794#define _IF_TYPE_PPP 23
795#define _IF_TYPE_SOFTWARE_LOOPBACK 24
796#define _IF_TYPE_EON 25
797#define _IF_TYPE_ETHERNET_3MBIT 26
798#define _IF_TYPE_NSIP 27
799#define _IF_TYPE_SLIP 28
800#define _IF_TYPE_ULTRA 29
801#define _IF_TYPE_DS3 30
802#define _IF_TYPE_SIP 31
803#define _IF_TYPE_FRAMERELAY 32
804#define _IF_TYPE_RS232 33
805#define _IF_TYPE_PARA 34
806#define _IF_TYPE_ARCNET 35
807#define _IF_TYPE_ARCNET_PLUS 36
808#define _IF_TYPE_ATM 37
809#define _IF_TYPE_MIO_X25 38
810#define _IF_TYPE_SONET 39
811#define _IF_TYPE_X25_PLE 40
812#define _IF_TYPE_ISO88022_LLC 41
813#define _IF_TYPE_LOCALTALK 42
814#define _IF_TYPE_SMDS_DXI 43
815#define _IF_TYPE_FRAMERELAY_SERVICE 44
816#define _IF_TYPE_V35 45
817#define _IF_TYPE_HSSI 46
818#define _IF_TYPE_HIPPI 47
819#define _IF_TYPE_MODEM 48
820#define _IF_TYPE_AAL5 49
821#define _IF_TYPE_SONET_PATH 50
822#define _IF_TYPE_SONET_VT 51
823#define _IF_TYPE_SMDS_ICIP 52
824#define _IF_TYPE_PROP_VIRTUAL 53
825#define _IF_TYPE_PROP_MULTIPLEXOR 54
826#define _IF_TYPE_IEEE80212 55
827#define _IF_TYPE_FIBRECHANNEL 56
828#define _IF_TYPE_HIPPIINTERFACE 57
829#define _IF_TYPE_FRAMERELAY_INTERCONNECT 58
830#define _IF_TYPE_AFLANE_8023 59
831#define _IF_TYPE_AFLANE_8025 60
832#define _IF_TYPE_CCTEMUL 61
833#define _IF_TYPE_FASTETHER 62
834#define _IF_TYPE_ISDN 63
835#define _IF_TYPE_V11 64
836#define _IF_TYPE_V36 65
837#define _IF_TYPE_G703_64K 66
838#define _IF_TYPE_G703_2MB 67
839#define _IF_TYPE_QLLC 68
840#define _IF_TYPE_FASTETHER_FX 69
841#define _IF_TYPE_CHANNEL 70
842#define _IF_TYPE_IEEE80211 71
843#define _IF_TYPE_IBM370PARCHAN 72
844#define _IF_TYPE_ESCON 73
845#define _IF_TYPE_DLSW 74
846#define _IF_TYPE_ISDN_S 75
847#define _IF_TYPE_ISDN_U 76
848#define _IF_TYPE_LAP_D 77
849#define _IF_TYPE_IPSWITCH 78
850#define _IF_TYPE_RSRB 79
851#define _IF_TYPE_ATM_LOGICAL 80
852#define _IF_TYPE_DS0 81
853#define _IF_TYPE_DS0_BUNDLE 82
854#define _IF_TYPE_BSC 83
855#define _IF_TYPE_ASYNC 84
856#define _IF_TYPE_CNR 85
857#define _IF_TYPE_ISO88025R_DTR 86
858#define _IF_TYPE_EPLRS 87
859#define _IF_TYPE_ARAP 88
860#define _IF_TYPE_PROP_CNLS 89
861#define _IF_TYPE_HOSTPAD 90
862#define _IF_TYPE_TERMPAD 91
863#define _IF_TYPE_FRAMERELAY_MPI 92
864#define _IF_TYPE_X213 93
865#define _IF_TYPE_ADSL 94
866#define _IF_TYPE_RADSL 95
867#define _IF_TYPE_SDSL 96
868#define _IF_TYPE_VDSL 97
869#define _IF_TYPE_ISO88025_CRFPRINT 98
870#define _IF_TYPE_MYRINET 99
871#define _IF_TYPE_VOICE_EM 100
872#define _IF_TYPE_VOICE_FXO 101
873#define _IF_TYPE_VOICE_FXS 102
874#define _IF_TYPE_VOICE_ENCAP 103
875#define _IF_TYPE_VOICE_OVERIP 104
876#define _IF_TYPE_ATM_DXI 105
877#define _IF_TYPE_ATM_FUNI 106
878#define _IF_TYPE_ATM_IMA 107
879#define _IF_TYPE_PPPMULTILINKBUNDLE 108
880#define _IF_TYPE_IPOVER_CDLC 109
881#define _IF_TYPE_IPOVER_CLAW 110
882#define _IF_TYPE_STACKTOSTACK 111
883#define _IF_TYPE_VIRTUALIPADDRESS 112
884#define _IF_TYPE_MPC 113
885#define _IF_TYPE_IPOVER_ATM 114
886#define _IF_TYPE_ISO88025_FIBER 115
887#define _IF_TYPE_TDLC 116
888#define _IF_TYPE_GIGABITETHERNET 117
889#define _IF_TYPE_HDLC 118
890#define _IF_TYPE_LAP_F 119
891#define _IF_TYPE_V37 120
892#define _IF_TYPE_X25_MLP 121
893#define _IF_TYPE_X25_HUNTGROUP 122
894#define _IF_TYPE_TRANSPHDLC 123
895#define _IF_TYPE_INTERLEAVE 124
896#define _IF_TYPE_FAST 125
897#define _IF_TYPE_IP 126
898#define _IF_TYPE_DOCSCABLE_MACLAYER 127
899#define _IF_TYPE_DOCSCABLE_DOWNSTREAM 128
900#define _IF_TYPE_DOCSCABLE_UPSTREAM 129
901#define _IF_TYPE_A12MPPSWITCH 130
902#define _IF_TYPE_TUNNEL 131
903#define _IF_TYPE_COFFEE 132
904#define _IF_TYPE_CES 133
905#define _IF_TYPE_ATM_SUBINTERFACE 134
906#define _IF_TYPE_L2_VLAN 135
907#define _IF_TYPE_L3_IPVLAN 136
908#define _IF_TYPE_L3_IPXVLAN 137
909#define _IF_TYPE_DIGITALPOWERLINE 138
910#define _IF_TYPE_MEDIAMAILOVERIP 139
911#define _IF_TYPE_DTM 140
912#define _IF_TYPE_DCN 141
913#define _IF_TYPE_IPFORWARD 142
914#define _IF_TYPE_MSDSL 143
915#define _IF_TYPE_IEEE1394 144
916#define _IF_TYPE_IF_GSN 145
917#define _IF_TYPE_DVBRCC_MACLAYER 146
918#define _IF_TYPE_DVBRCC_DOWNSTREAM 147
919#define _IF_TYPE_DVBRCC_UPSTREAM 148
920#define _IF_TYPE_ATM_VIRTUAL 149
921#define _IF_TYPE_MPLS_TUNNEL 150
922#define _IF_TYPE_SRP 151
923#define _IF_TYPE_VOICEOVERATM 152
924#define _IF_TYPE_VOICEOVERFRAMERELAY 153
925#define _IF_TYPE_IDSL 154
926#define _IF_TYPE_COMPOSITELINK 155
927#define _IF_TYPE_SS7_SIGLINK 156
928#define _IF_TYPE_PROP_WIRELESS_P2P 157
929#define _IF_TYPE_FR_FORWARD 158
930#define _IF_TYPE_RFC1483 159
931#define _IF_TYPE_USB 160
932#define _IF_TYPE_IEEE8023AD_LAG 161
933#define _IF_TYPE_BGP_POLICY_ACCOUNTING 162
934#define _IF_TYPE_FRF16_MFR_BUNDLE 163
935#define _IF_TYPE_H323_GATEKEEPER 164
936#define _IF_TYPE_H323_PROXY 165
937#define _IF_TYPE_MPLS 166
938#define _IF_TYPE_MF_SIGLINK 167
939#define _IF_TYPE_HDSL2 168
940#define _IF_TYPE_SHDSL 169
941#define _IF_TYPE_DS1_FDL 170
942#define _IF_TYPE_POS 171
943#define _IF_TYPE_DVB_ASI_IN 172
944#define _IF_TYPE_DVB_ASI_OUT 173
945#define _IF_TYPE_PLC 174
946#define _IF_TYPE_NFAS 175
947#define _IF_TYPE_TR008 176
948#define _IF_TYPE_GR303_RDT 177
949#define _IF_TYPE_GR303_IDT 178
950#define _IF_TYPE_ISUP 179
951#define _IF_TYPE_PROP_DOCS_WIRELESS_MACLAYER 180
952#define _IF_TYPE_PROP_DOCS_WIRELESS_DOWNSTREAM 181
953#define _IF_TYPE_PROP_DOCS_WIRELESS_UPSTREAM 182
954#define _IF_TYPE_HIPERLAN2 183
955#define _IF_TYPE_PROP_BWA_P2MP 184
956#define _IF_TYPE_SONET_OVERHEAD_CHANNEL 185
957#define _IF_TYPE_DIGITAL_WRAPPER_OVERHEAD_CHANNEL 186
958#define _IF_TYPE_AAL2 187
959#define _IF_TYPE_RADIO_MAC 188
960#define _IF_TYPE_ATM_RADIO 189
961#define _IF_TYPE_IMT 190
962#define _IF_TYPE_MVL 191
963#define _IF_TYPE_REACH_DSL 192
964#define _IF_TYPE_FR_DLCI_ENDPT 193
965#define _IF_TYPE_ATM_VCI_ENDPT 194
966#define _IF_TYPE_OPTICAL_CHANNEL 195
967#define _IF_TYPE_OPTICAL_TRANSPORT 196
968#define _IF_TYPE_IEEE80216_WMAN 237
969#define _IF_TYPE_WWANPP 243
970#define _IF_TYPE_WWANPP2 244
971#define _IF_TYPE_IEEE802154 259
972#define _IF_TYPE_XBOX_WIRELESS 281
973
974#ifndef IF_MAX_PHYS_ADDRESS_LENGTH
975#define IF_MAX_PHYS_ADDRESS_LENGTH 32
976#endif
977
978#ifndef NDIS_IF_MAX_STRING_SIZE
979#define NDIS_IF_MAX_STRING_SIZE 256
980#endif
981
982/* Missing in Watcom's <nspapi.h>
983 */
984#ifndef NS_BTH
985#define NS_BTH 16
986#endif
987
988#ifndef IP_ADAPTER_RECEIVE_ONLY
989#define IP_ADAPTER_RECEIVE_ONLY 0x00000008
990#endif
991
992#ifndef IP_ADAPTER_NO_MULTICAST
993#define IP_ADAPTER_NO_MULTICAST 0x00000010
994#endif
995
996#ifndef SCOPE_DELIMITER
997#define SCOPE_DELIMITER '%'
998#endif
999
1000#ifndef MAX_IP6_SZ
1001#define MAX_IP6_SZ sizeof("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:255.255.255.255")
1002#endif
1003
1004#if defined(INSIDE_WINADINF_C) && defined(COMPILE_WINADINF_C)
1005 /*
1006 * TDM-MinGW and MinGW64 got this structure wrong since the MSDN docs are
1007 * wrong too.
1008 * But since 'wlan_query()' needs to copy a complete 'WLAN_AUTH_CIPHER_PAIR_LIST2'
1009 * back to the caller and not simply pass a pointer back, we use this for all targets.
1010 */
1011 typedef struct {
1012 DWORD dwNumberOfItems;
1013 DOT11_AUTH_CIPHER_PAIR pAuthCipherPairList [16];
1014 } WLAN_AUTH_CIPHER_PAIR_LIST2;
1015
1016 /*
1017 * Hard to check the precence of this typedef in all SDKs. Hence just fake a '2' version.
1018 */
1019 typedef struct _WLAN_DEVICE_SERVICE_GUID_LIST2 {
1020 DWORD dwNumberOfItems;
1021 DWORD dwIndex;
1022 GUID *DeviceService[1];
1023 } WLAN_DEVICE_SERVICE_GUID_LIST2;
1024
1025 #if defined(HAVE_WLANAPI_H) && defined(_STATIC_ASSERT)
1026 // _STATIC_ASSERT (sizeof(WLAN_AUTH_CIPHER_PAIR_LIST2) == sizeof(WLAN_AUTH_CIPHER_PAIR_LIST));
1027 #endif
1028
1029 #if defined(__WATCOMC__)
1030 typedef struct _MIB_IPNET_ROW2 {
1031 SOCKADDR_INET Address;
1032 NET_IFINDEX InterfaceIndex;
1033 NET_LUID InterfaceLuid;
1034 UCHAR PhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH];
1035 ULONG PhysicalAddressLength;
1036 NL_NEIGHBOR_STATE State;
1037 union {
1038 struct {
1039 BOOLEAN IsRouter : 1;
1040 BOOLEAN IsUnreachable : 1;
1041 };
1042 UCHAR Flags;
1043 };
1044 union {
1045 ULONG LastReachable;
1046 ULONG LastUnreachable;
1047 } ReachabilityTime;
1048 } MIB_IPNET_ROW2;
1049
1050 typedef struct _MIB_IPINTERFACE_ROW {
1051 char InterfaceLuid [1]; /* fake it */
1052 } MIB_IPINTERFACE_ROW;
1053
1054 typedef struct _MIB_IPFORWARD_ROW2 {
1055 char InterfaceLuid [1]; /* fake it */
1056 } MIB_IPFORWARD_ROW2;
1057
1058 typedef struct _MIB_IPNET_TABLE2 {
1059 ULONG NumEntries;
1060 MIB_IPNET_ROW2 Table [1];
1061 } MIB_IPNET_TABLE2;
1062
1063 typedef struct _MIB_IPFORWARD_TABLE2 {
1064 ULONG NumEntries;
1065 MIB_IPFORWARD_ROW2 Table [1];
1066 } MIB_IPFORWARD_TABLE2;
1067
1068 typedef struct _NL_BANDWIDTH_INFORMATION { /* For Win-SDK, this is in <shared/nldef.h> */
1069 ULONG64 Bandwidth;
1070 ULONG64 Instability;
1071 BOOLEAN BandwidthPeaked;
1072 } NL_BANDWIDTH_INFORMATION;
1073
1074 typedef struct _MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES {
1075 NL_BANDWIDTH_INFORMATION InboundBandwidthInformation;
1076 NL_BANDWIDTH_INFORMATION OutboundBandwidthInformation;
1077 } MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES;
1078
1079 typedef enum _DOT11_RADIO_STATE {
1080 dot11_radio_state_unknown,
1081 dot11_radio_state_on,
1082 dot11_radio_state_off
1083 } DOT11_RADIO_STATE;
1084
1085 typedef struct _WLAN_PHY_RADIO_STATE {
1086 DWORD dwPhyIndex;
1087 DOT11_RADIO_STATE dot11SoftwareRadioState;
1088 DOT11_RADIO_STATE dot11HardwareRadioState;
1089 } WLAN_PHY_RADIO_STATE;
1090
1091 typedef struct _WLAN_RADIO_STATE {
1092 DWORD dwNumberOfPhys;
1093 WLAN_PHY_RADIO_STATE PhyRadioState [64];
1094 } WLAN_RADIO_STATE;
1095
1096 #if (_WIN32_WINNT < 0x0601)
1097 #define IP_ADAPTER_UNICAST_ADDRESS IP_ADAPTER_UNICAST_ADDRESS_XP
1098 #define IP_ADAPTER_ANYCAST_ADDRESS IP_ADAPTER_ANYCAST_ADDRESS_XP
1099 #define IP_ADAPTER_MULTICAST_ADDRESS IP_ADAPTER_MULTICAST_ADDRESS_XP
1100 #define IP_ADAPTER_DNS_SERVER_ADDRESS IP_ADAPTER_DNS_SERVER_ADDRESS_XP
1101 #define IP_ADAPTER_PREFIX IP_ADAPTER_PREFIX_XP
1102 #endif
1103 #endif /* __WATCOMC__ */
1104
1105 extern int __scope_id_to_ascii (int scope);
1106
1107 static void print_wlan_networklist (const WLAN_AVAILABLE_NETWORK_LIST *wlist);
1108 static void print_wlan_current_connection (const WLAN_CONNECTION_ATTRIBUTES *conn_attr, int indent);
1109 static void print_wlan_stats (const WLAN_STATISTICS *stats, int indent);
1110 static void print_radio_state (const WLAN_RADIO_STATE *rs, int indent);
1111 static void print_auth_pairs (const WLAN_AUTH_CIPHER_PAIR_LIST2 *auth, int indent);
1112
1113 static void print_mib_ipnetrow (DWORD index, const MIB_IPNETROW *row);
1114 static void print_mib_ipnet_row2 (DWORD index, const MIB_IPNET_ROW2 *row);
1115 static void print_mib_ipforward_row2 (DWORD index, const MIB_IPFORWARD_ROW2 *row, int family);
1116
1117 static int compare_ipnetrow (const void *_a, const void *_b);
1118 static int compare_ipnetrow2 (const void *_a, const void *_b);
1119
1120 static void print_mib_if_row (DWORD index, const MIB_IFROW *row);
1121
1122 #if defined(ON_WIN_VISTA)
1123 #if defined(HAVE_NETIOAPI_H)
1124 static void print_mib_if_row2 (DWORD index, const MIB_IF_ROW2 *row);
1125 static void print_net_luid (const NET_LUID *luid, int indent);
1126 #endif
1127
1128 static const char *get_best_route2 (IF_LUID *luid, const SOCKADDR_INET *dest);
1129 #endif
1130
1131#endif /* INSIDE_WINADINF_C && COMPILE_WINADINF_C */
1132#endif /* (WIN32 || _WIN32 || __CYGWIN__) && !__DMC__ && !__ORANGEC__ */
1133#endif /* _w32_WINADINF_H */
cdefs.h
_DOT11_AUTH_CIPHER_PAIR
Definition: winadinf.h:577
_DOT11_SSID
Definition: winadinf.h:361
_MIB_IF_ROW2
Definition: winadinf.h:282
_MIB_IF_TABLE2
Definition: winadinf.h:336
_MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES
Definition: winadinf.h:1074
_MIB_IPFORWARD_ROW2
Definition: winadinf.h:1054
_MIB_IPFORWARD_TABLE2
Definition: winadinf.h:1063
_MIB_IPINTERFACE_ROW
Definition: winadinf.h:1050
_MIB_IPNET_ROW2
Definition: winadinf.h:1030
_MIB_IPNET_TABLE2
Definition: winadinf.h:1058
_NL_BANDWIDTH_INFORMATION
Definition: winadinf.h:1068
_WLAN_ASSOCIATION_ATTRIBUTES
Definition: winadinf.h:551
_WLAN_AUTH_CIPHER_PAIR_LIST
Definition: winadinf.h:583
_WLAN_AVAILABLE_NETWORK_LIST
Definition: winadinf.h:620
_WLAN_AVAILABLE_NETWORK
Definition: winadinf.h:596
_WLAN_BSS_ENTRY
Definition: winadinf.h:626
_WLAN_BSS_LIST
Definition: winadinf.h:645
_WLAN_CONNECTION_ATTRIBUTES
Definition: winadinf.h:588
_WLAN_DEVICE_SERVICE_GUID_LIST2
Definition: winadinf.h:1019
_WLAN_INTERFACE_CAPABILITY
Definition: winadinf.h:435
_WLAN_INTERFACE_INFO_LIST
Definition: winadinf.h:461
_WLAN_INTERFACE_INFO
Definition: winadinf.h:455
_WLAN_MAC_FRAME_STATISTICS
Definition: winadinf.h:467
_WLAN_PHY_FRAME_STATISTICS
Definition: winadinf.h:482
_WLAN_PHY_RADIO_STATE
Definition: winadinf.h:1085
_WLAN_RADIO_STATE
Definition: winadinf.h:1091
_WLAN_RATE_SET
Definition: winadinf.h:572
_WLAN_SECURITY_ATTRIBUTES
Definition: winadinf.h:562
_WLAN_STATISTICS
Definition: winadinf.h:503
_WSAQuerySetA
Definition: winadinf.h:654
MIB_IPNETROW
Definition: winadinf.h:260
MIB_IPNETTABLE
Definition: winadinf.h:268
WLAN_AUTH_CIPHER_PAIR_LIST2
Definition: winadinf.h:1011
wtypes.h


Watt-32 tcp/ip: E:/WATT/src/winmisc.c Source File

  • src
winmisc.c
Go to the documentation of this file.
1
32#include "socket.h"
33#include "pcdns.h"
34#include "get_xby.h"
35#include "cpumodel.h"
36#include "run.h"
37#include "misc.h"
38
39#if defined(WIN32) || defined(WIN64) /* rest of file */
40
41#include "packet32.h"
42#include "win_dll.h"
43
44#include <w32-fakes/winsock2.h>
45
46#define STATUS_SUCCESS 0
47
48CRITICAL_SECTION _watt_crit_sect;
49BOOL _watt_is_win9x = FALSE;
50BOOL _watt_is_wow64 = FALSE;
51BOOL _watt_use_bugtrap = TRUE;
52BOOL _watt_is_gui_app = FALSE;
53
54HANDLE stdin_hnd = INVALID_HANDLE_VALUE;
55HANDLE stdout_hnd = INVALID_HANDLE_VALUE;
56
57CONSOLE_SCREEN_BUFFER_INFO console_info;
58
59#if defined(USE_STACKWALKER)
60static void (MS_CDECL *orig_abort_handler)(int) = NULL;
61#endif
62
63/* WinBase.h (SDK) stuff added for Windows 7.
64 */
65#ifndef BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE
66#define BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE 0x1
67#endif
68
69#ifndef BASE_SEARCH_PATH_PERMANENT
70#define BASE_SEARCH_PATH_PERMANENT 0x8000
71#endif
72
73/*
74 * 'dns_windns' bits.
75 */
76#define WINDNS_QUERY_A4 0x0001
77#define WINDNS_QUERY_A6 0x0002
78#define WINDNS_QUERY_PTR4 0x0004
79#define WINDNS_QUERY_PTR6 0x0008
80#define WINDNS_CACHEPUT_A4 0x0100
81#define WINDNS_CACHEPUT_A6 0x0200
82
83#ifndef DNS_TYPE_AAAA
84#define DNS_TYPE_AAAA 0x001C
85#endif
86
87#ifndef DNS_ERROR_RESPONSE_CODES_BASE
88#define DNS_ERROR_RESPONSE_CODES_BASE 9000
89#endif
90
91#ifndef DNS_ERROR_RCODE_LAST
92#define DNS_ERROR_RCODE_LAST 9018
93#endif
94
95#if defined(__MINGW32__) /* Missing in <winnt.h>, but is in libkernel32.a */
96 __declspec(dllimport) void WINAPI RtlCaptureContext (CONTEXT *ContextRecord);
97#endif
98
99/*
100 * Various stuff to initialise.
101 */
102static BOOL get_win_version (WORD *ver, BOOL *is_win9x)
103{
104 OSVERSIONINFO ovi;
105 DWORD os_ver = GetVersion();
106 DWORD major_ver = LOBYTE (LOWORD(os_ver));
107 BOOL rc = FALSE;
108
109 *is_win9x = (os_ver >= 0x80000000 && major_ver >= 4);
110
111 memset (&ovi, '\0', sizeof(ovi));
112 ovi.dwOSVersionInfoSize = sizeof(ovi);
113
114 /* We only support Win-NT style OSes.
115 */
116 if (!GetVersionEx(&ovi) || ovi.dwPlatformId != VER_PLATFORM_WIN32_NT)
117 rc = FALSE;
118 else
119 {
120 *ver = (WORD)(ovi.dwMajorVersion << 8) + (WORD)ovi.dwMinorVersion;
121 rc = TRUE;
122 }
123
124#if 0
125 (*_printf) ("rc: %d, dwMajorVersion: 0x%04X, dwMinorVersion: 0x%04X\n",
126 rc, ovi.dwMajorVersion, ovi.dwMinorVersion);
127#endif
128
129 return (rc);
130}
131
132/*
133 * Check if program is a GUI app with no stdout handle.
134 */
135static BOOL is_gui_app (void)
136{
137 const IMAGE_DOS_HEADER *dos;
138 const IMAGE_NT_HEADERS *nt;
139 HMODULE mod = GetModuleHandle (NULL);
140 HANDLE hnd;
141
142 if (!mod)
143 return (FALSE);
144
145 /* A GUI app should have no stdout handle.
146 */
147 hnd = GetStdHandle (STD_OUTPUT_HANDLE);
148 if (hnd != INVALID_HANDLE_VALUE && GetFileType(hnd) != FILE_TYPE_UNKNOWN)
149 return (FALSE);
150
151 dos = (const IMAGE_DOS_HEADER*) mod;
152 nt = (const IMAGE_NT_HEADERS*) ((const BYTE*)mod + dos->e_lfanew);
153 return (nt->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI);
154}
155
156/*
157 * \todo: make a GUI list-control with "Abort, Show-stack" etc.
158 * mimicking the normal console.
159 */
160int MS_CDECL gui_printf (const char *fmt, ...)
161{
162 char buf [1024];
163 int len;
164 char *prog_name, *s;
165 DWORD mb_flags;
166 va_list args;
167
168 va_start (args, fmt);
169 len = VSNPRINTF (buf, sizeof(buf), fmt, args);
170
171 s = (char*) get_argv0();
172#if 0
173 if ((prog_name = strrchr(s, '\\')) == NULL &&
174 (prog_name = strrchr(s, ':')) == NULL)
175 prog_name = s;
176 else prog_name++;
177#else
178 prog_name = s; /* Show the full program-name */
179#endif
180
181 mb_flags = MB_ICONSTOP | MB_SETFOREGROUND;
182 mb_flags |= _watt_is_win9x ? MB_SYSTEMMODAL : MB_TASKMODAL;
183 MessageBoxA (NULL, buf, prog_name, mb_flags);
184
185 va_end (args);
186 return (len);
187}
188
189static void W32_CALL win32_exit (void)
190{
191 stdin_hnd = INVALID_HANDLE_VALUE;
192 stdout_hnd = INVALID_HANDLE_VALUE;
193
194 unload_dynamic_table (dyn_funcs, dyn_funcs_num);
195
196 DeleteCriticalSection (&_watt_crit_sect);
197
198#if !defined(__ORANGEC__)
199 _watt_crit_sect.SpinCount = (ULONG_PTR) -1;
200#endif
201}
202
208char * W32_CALL win_strerror (DWORD err)
209{
210 static char buf [512+30];
211 char err_buf [512], *p;
212
213 if (!FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
214 LANG_NEUTRAL, err_buf, sizeof(err_buf)-1, NULL))
215 strcpy (err_buf, "Unknown error");
216 SNPRINTF (buf, sizeof(buf), "%lu/0x%lX: %s", (u_long)err, (u_long)err, err_buf);
217 rip (buf);
218 p = strrchr (buf, '.');
219 if (p && p[1] == '\0')
220 *p = '\0';
221 return (buf);
222}
223
227BOOL get_file_version (const char *file_name,
228 char *version_buf,
229 size_t version_buf_len)
230{
231 DWORD ver_info_size; /* Size of version information block */
232 DWORD err, ver_hnd = 0; /* An 'ignored' parameter, always '0' */
233 UINT bytes_read;
234 char sub_block[64];
235 void *res_buf, *vff_info;
236
237 const struct LANG_AND_CODEPAGE {
238 WORD language;
239 WORD code_page;
240 } *lang_info;
241 void *lang_info_ptr;
242
243 if (!p_GetFileVersionInfoSizeA || !p_GetFileVersionInfoA || !p_VerQueryValueA)
244 {
245 TRACE_CONSOLE (2, "Missing functions from version.dll\n");
246 return (FALSE);
247 }
248
249 /* Pull out the version information
250 */
251 ver_info_size = (*p_GetFileVersionInfoSizeA) ((char*)file_name, &ver_hnd);
252 TRACE_CONSOLE (2, "file %s, ver-size %lu\n", file_name, (u_long)ver_info_size);
253
254 if (!ver_info_size)
255 {
256 err = GetLastError();
257 TRACE_CONSOLE (2, "failed to call GetFileVersionInfoSizeA; %s\n", win_strerror(err));
258 return (FALSE);
259 }
260
261 vff_info = alloca (ver_info_size);
262
263 if (!(*p_GetFileVersionInfoA) ((char*)file_name, ver_hnd,
264 ver_info_size, vff_info))
265 {
266 err = GetLastError();
267 TRACE_CONSOLE (2, "failed to call GetFileVersionInfoA; %s\n", win_strerror(err));
268 return (FALSE);
269 }
270
271 /* Read the list of languages and code pages.
272 */
273 if (!(*p_VerQueryValueA) (vff_info, "\\VarFileInfo\\Translation",
274 &lang_info_ptr, &bytes_read) ||
275 bytes_read < sizeof(*lang_info))
276 {
277 err = GetLastError();
278 TRACE_CONSOLE (2, "failed to call VerQueryValueA; %s\n", win_strerror(err));
279 return (FALSE);
280 }
281
282 lang_info = (const struct LANG_AND_CODEPAGE*) lang_info_ptr;
283
284 /* Create the file version string for the first (i.e. the only
285 * one) language.
286 */
287 sprintf (sub_block, "\\StringFileInfo\\%04x%04x\\FileVersion",
288 lang_info->language, lang_info->code_page);
289
290 /* Retrieve the file version string for the language. 'res_buf' will
291 * point into 'vff_info'. Hence it doesn't have to be freed.
292 */
293 if (!(*p_VerQueryValueA) (vff_info, sub_block, &res_buf, &bytes_read))
294 {
295 err = GetLastError();
296 TRACE_CONSOLE (2, "failed to call VerQueryValueA; %s\n", win_strerror(err));
297 return (FALSE);
298 }
299
300 TRACE_CONSOLE (2, "sub-block '%s' -> '%.*s'\n",
301 sub_block, bytes_read, (const char*)res_buf);
302
303 if (strlen(res_buf) >= version_buf_len)
304 {
305 TRACE_CONSOLE (2, "GetFileVersionA(): input buffer too small\n");
306 return (FALSE);
307 }
308 strcpy (version_buf, res_buf);
309 return (TRUE);
310}
311
312
313#if defined(USE_STACKWALKER)
314
315#include "stkwalk.h"
316
317static void MS_CDECL new_abort_handler (int sig)
318{
319 CONTEXT ctx;
320
321 memset (&ctx, '\0', sizeof(ctx));
322 ctx.ContextFlags = CONTEXT_FULL;
323 RtlCaptureContext (&ctx);
324
329 TRACE_CONSOLE (0, "\nabort() called. Backtrace:\n");
330 ShowStack (GetCurrentThread(), &ctx, NULL);
331
332 if (orig_abort_handler)
333 (*orig_abort_handler) (sig);
334 _exit (-1);
335}
336#endif
337
338static void init_win_abort (void)
339{
340#if defined(USE_STACKWALKER)
341 if (!IsDebuggerPresent())
342 {
343 orig_abort_handler = signal (SIGABRT, new_abort_handler);
344#ifdef _MSC_VER
345 _set_abort_behavior (0, _WRITE_ABORT_MSG);
346#endif
347 }
348#endif
349}
350
351#if defined(USE_BUGTRAP)
352
353static void CALLBACK pre_err_handler (INT_PTR arg)
354{
355 INT_PTR handle = arg;
356
357 if (!handle)
358 return;
359
360 (*p_BT_InsLogEntryF) (handle, BTLL_INFO, "Starting Watt-32 crash-report:");
361
362 if (_watt_assert_buf[0])
363 (*p_BT_InsLogEntryF) (handle, BTLL_IMPORTANT, _watt_assert_buf);
364 (*p_BT_CloseLogFile) (handle);
365}
366
367static int init_win_bugtrap (void)
368{
369 BUGTRAP_LOGECHOTYPE bt_log_mode = 0;
370 INT_PTR bt_log_handle = 0;
371
372 if (!p_BT_SetAppName || !p_BT_InstallSehFilter ||
373 !p_BT_SetFlags || !p_BT_SetLogFlags ||
374 !p_BT_SetReportFormat || !p_BT_OpenLogFile ||
375 !p_BT_SetLogSizeInEntries || !p_BT_SetLogEchoMode ||
376 !p_BT_AddLogFile)
377 return (0);
378
379 (*p_BT_SetAppName) ("Watt-32_library");
380//(*p_BT_SetSupportEMail) ("gvanem@yahoo.no");
381
382 (*p_BT_InstallSehFilter)();
383 (*p_BT_SetFlags) (BTF_DETAILEDMODE | BTF_ATTACHREPORT);
384 (*p_BT_SetReportFormat) (BTRF_TEXT);
385
386 bt_log_handle = (*p_BT_OpenLogFile) ("watt-32.dll.log", BTLF_TEXT);
387 (*p_BT_SetLogSizeInEntries) (bt_log_handle, 100);
388 (*p_BT_SetLogFlags) (bt_log_handle, BTLF_SHOWTIMESTAMP);
389
390 bt_log_mode = BTLE_DBGOUT;
391 if (!_watt_is_gui_app)
392 bt_log_mode |= BTLE_STDERR;
393 (*p_BT_SetLogEchoMode) (bt_log_handle, bt_log_mode);
394
395#if 0
396 PCTSTR pszLogFileName = (*p_BT_GetLogFileName) (bt_log_handle);
397 (*p_BT_AddLogFile) (pszLogFileName);
398#endif
399
400 (*p_BT_SetPreErrHandler) (pre_err_handler, bt_log_handle);
401
402 return (1);
403}
404#endif /* USE_BUGTRAP */
405
406
407/*
408 * Called from init_misc() to initialise Win32/win64 specific things.
409 */
410BOOL init_win_misc (void)
411{
412 char env[20];
413 BOOL wow64 = FALSE;
414 BOOL rc = FALSE;
415
416 InitializeCriticalSection (&_watt_crit_sect);
417
418 env[0] = '\0';
419 if (GetEnvironmentVariableA("WATT32-NOEXC", env, sizeof(env)) ||
420 GetEnvironmentVariableA("WATT32-NOEXCEPT", env, sizeof(env)))
421 {
422 if (env[0] != '0')
423 _watt_use_bugtrap = FALSE;
424 }
425
426 _watt_is_gui_app = is_gui_app();
427
428 _watt_os_ver = 0x0400; /* defaults to Win-NT 4.0 */
429 get_win_version (&_watt_os_ver, &_watt_is_win9x);
430
431 if (!_watt_is_gui_app)
432 {
433 stdin_hnd = GetStdHandle (STD_INPUT_HANDLE);
434 stdout_hnd = GetStdHandle (STD_OUTPUT_HANDLE);
435 GetConsoleScreenBufferInfo (stdout_hnd, &console_info);
436 }
437
438 load_dynamic_table (dyn_funcs, dyn_funcs_num);
439
440#if !defined(WIN64)
441 if (p_IsWow64Process)
442 {
443 rc = (*p_IsWow64Process) (GetCurrentProcess(), &wow64);
444 if (rc)
445 _watt_is_wow64 = wow64;
446 }
447#endif
448
449 TRACE_CONSOLE (2, "IsWow64Process(): rc: %d, wow64: %d.\n", rc, wow64);
450
451 if (_watt_use_bugtrap)
452 {
453#if defined(USE_BUGTRAP)
454 init_win_bugtrap();
455#endif
456 init_win_abort();
457 }
458
459 RUNDOWN_ADD (win32_exit, 310);
460 ARGSUSED (rc);
461 return (TRUE);
462}
463
464#if defined(HAVE_WINDNS_H)
465/*
466 * Perform a query on the WinDns cache. We ask only for
467 * 'type'; An address (A/AAAA records) or a name (PTR record).
468 */
469static BOOL WinDnsQueryCommon (WORD type, const void *what,
470 void *result, size_t size)
471{
472 DNS_RECORD *rr, *dr = NULL;
473 DNS_STATUS rc;
474 BOOL found;
475 DWORD opt = DNS_QUERY_NO_WIRE_QUERY | /* query the cache only */
476 DNS_QUERY_NO_NETBT | /* no NetBT names */
477 DNS_QUERY_NO_HOSTS_FILE; /* no Winsock hosts file */
478
479 from_windns = FALSE;
480
481 if (!p_DnsQuery_A || !p_DnsFree)
482 return (FALSE);
483
484 rc = (*p_DnsQuery_A) ((const char*)what, type, opt, NULL, &dr, NULL);
485
486 TRACE_CONSOLE (2, "DnsQuery_A: type %d, dr %p: %s\n", type, dr, win_strerror(rc));
487
488 if (rc != ERROR_SUCCESS || !dr)
489 return (FALSE);
490
491 dom_ttl = dr->dwTtl;
492 found = FALSE;
493
494 for (rr = dr; rr; rr = rr->pNext)
495 {
496 TRACE_CONSOLE (2, "RR-type: %d: ", rr->wType);
497
498 /* Use only 1st A/AAAA record
499 */
500 if (rr->wType == DNS_TYPE_A && type == DNS_TYPE_A)
501 {
502 DWORD ip = ntohl (rr->Data.A.IpAddress);
503
504 TRACE_CONSOLE (2, "A: %s, ttl %lus\n",
505 _inet_ntoa(NULL,ip), (u_long)rr->dwTtl);
506 if (!found)
507 *(DWORD*) result = ip;
508 found = TRUE;
509 }
510
511#if defined(USE_BSD_API) || defined(USE_IPV6)
512 else if (rr->wType == DNS_TYPE_AAAA && type == DNS_TYPE_AAAA)
513 {
514 const void *ip6 = &rr->Data.AAAA.Ip6Address.IP6Dword[0];
515
516 TRACE_CONSOLE (2, "AAAA: %s\n", _inet6_ntoa(ip6));
517 if (!found)
518 memcpy (result, ip6, size);
519 found = TRUE;
520 }
521#endif
522
523 else if (rr->wType == DNS_TYPE_PTR && type == DNS_TYPE_PTR)
524 {
525 _strlcpy (result, dr->Data.PTR.pNameHost, size);
526 TRACE_CONSOLE (2, "PTR: %s\n", (const char*)result);
527 }
528 else if (rr->wType == DNS_TYPE_CNAME)
529 {
530 _strlcpy (dom_cname, dr->Data.CNAME.pNameHost, sizeof(dom_cname));
531 TRACE_CONSOLE (2, "CNAME: %s\n", dom_cname);
532 }
533 else
534 TRACE_CONSOLE (2, "\n");
535 }
536 (*p_DnsFree) (dr, DnsFreeRecordList);
537 from_windns = found;
538 return (TRUE);
539}
540#endif /* HAVE_WINDNS_H */
541
542
543BOOL WinDnsQuery_A4 (const char *name, DWORD *ip)
544{
545#if defined(HAVE_WINDNS_H)
546 if (!(dns_windns & WINDNS_QUERY_A4))
547 return (FALSE);
548 return WinDnsQueryCommon (DNS_TYPE_A, name, ip, sizeof(*ip));
549#else
550 ARGSUSED (name);
551 ARGSUSED (ip);
552 return (FALSE);
553#endif
554}
555
556BOOL WinDnsQuery_A6 (const char *name, void *ip)
557{
558#if defined(HAVE_WINDNS_H)
559 if (!(dns_windns & WINDNS_QUERY_A6))
560 return (FALSE);
561 return WinDnsQueryCommon (DNS_TYPE_AAAA, name, ip, sizeof(ip6_address));
562#else
563 ARGSUSED (name);
564 ARGSUSED (ip);
565 return (FALSE);
566#endif
567}
568
569BOOL WinDnsQuery_PTR4 (DWORD ip, TCHAR *name, size_t size)
570{
571#if defined(HAVE_WINDNS_H)
572 if (!(dns_windns & WINDNS_QUERY_PTR4))
573 return (FALSE);
574 return WinDnsQueryCommon (DNS_TYPE_PTR, &ip, name, size);
575#else
576 ARGSUSED (ip);
577 ARGSUSED (name);
578 ARGSUSED (size);
579 return (FALSE);
580#endif
581}
582
583BOOL WinDnsQuery_PTR6 (const void *ip, TCHAR *name, size_t size)
584{
585#if defined(HAVE_WINDNS_H)
586 if (!(dns_windns & WINDNS_QUERY_PTR6))
587 return (FALSE);
588 return WinDnsQueryCommon (DNS_TYPE_PTR, &ip, name, size);
589#else
590 ARGSUSED (ip);
591 ARGSUSED (name);
592 ARGSUSED (size);
593 return (FALSE);
594#endif
595}
596
597/*
598 * This doesn't seem to simply put a name/IP pair in the
599 * local cache, but do a complete registration with the
600 * Winsock registered DNS server(s). Hence off by default.
601 */
602BOOL WinDnsCachePut_A4 (const char *name, DWORD ip4)
603{
604#if defined(HAVE_WINDNS_H)
605 DNS_RECORD rr;
606 DNS_STATUS rc;
607 DWORD opt = DNS_UPDATE_SECURITY_OFF |
608 DNS_UPDATE_CACHE_SECURITY_CONTEXT;
609
610 if (!p_DnsModifyRecordsInSet_A ||
611 !(dns_windns & WINDNS_CACHEPUT_A4))
612 return (FALSE);
613
614 memset (&rr, '\0', sizeof(rr));
615 rr.pName = strdup (name);
616
617 rr.wType = DNS_TYPE_A;
618 rr.Data.A.IpAddress = htonl (ip4);
619 rr.wDataLength = sizeof(rr.Data.A);
620#ifdef USE_BSD_API
621 rr.dwTtl = netdbCacheLife;
622#else
623 rr.dwTtl = MAX_CACHE_LIFE;
624#endif
625
626 rc = (*p_DnsModifyRecordsInSet_A) (&rr, NULL, opt,
627 NULL, NULL, NULL);
628 DO_FREE (rr.pName);
629
630 TRACE_CONSOLE (2, "DnsModifyRecordsInSet_A: %s ", win_strerror(rc));
631
632 if (rc >= DNS_ERROR_RESPONSE_CODES_BASE && rc <= DNS_ERROR_RCODE_LAST)
633 dns_windns &= ~WINDNS_CACHEPUT_A4; /* don't do this again */
634 return (rc == ERROR_SUCCESS);
635#else
636 ARGSUSED (name);
637 ARGSUSED (ip4);
638 return (FALSE);
639#endif /* HAVE_WINDNS_H */
640}
641
642BOOL WinDnsCachePut_A6 (const char *name, const void *ip6)
643{
644 if (!(dns_windns & WINDNS_CACHEPUT_A6))
645 return (FALSE);
646 ARGSUSED (name);
647 ARGSUSED (ip6);
648 return (FALSE);
649}
650
651
652int __stdcall WSAStartup (WORD version_required, WSADATA *wsa_data)
653{
654 WORD max_ver = MAKEWORD (2,2);
655 int rc;
656
657 if (version_required > max_ver)
658 return (EINVAL); /* we don't have WSAVERNOTSUPPORTED */
659
660 _watt_do_exit = 0;
661 rc = watt_sock_init (0, 0, 0);
662
663 wsa_data->wVersion = version_required;
664 wsa_data->wHighVersion = 2;
665 wsa_data->iMaxSockets = MAX_SOCKETS;
666 wsa_data->iMaxUdpDg = MAX_SOCKETS;
667 wsa_data->lpVendorInfo = NULL;
668 wsa_data->szSystemStatus[0] = '\0';
669 strcpy (wsa_data->szDescription, "Watt-32 tcp/ip");
670 return (rc);
671}
672
673int __stdcall WSACleanup (void)
674{
675 sock_exit();
676 return (0);
677}
678
679int __stdcall __WSAFDIsSet (int s, winsock_fd_set *fd)
680{
681 UNFINISHED();
682 ARGSUSED (s);
683 ARGSUSED (fd);
684 return (0);
685}
686
687/*
688 * Add these with an extra leading '_' too.
689 */
690W32_FUNC int __stdcall _WSAStartup (WORD version_required, WSADATA *wsa_data);
691W32_FUNC int __stdcall _WSACleanup (void);
692W32_FUNC int __stdcall ___WSAFDIsSet (int s, winsock_fd_set *fd);
693
694int __stdcall _WSAStartup (WORD version_required, WSADATA *wsa_data)
695{
696 return WSAStartup (version_required, wsa_data);
697}
698
699int __stdcall _WSACleanup (void)
700{
701 return WSACleanup();
702}
703
704int __stdcall ___WSAFDIsSet (int s, winsock_fd_set *fd)
705{
706 return __WSAFDIsSet (s, fd);
707}
708
709#ifdef NOT_USED
710static BOOL CALLBACK callback (LPSTR cp)
711{
712 printf ("\t callback(): cp: \"%s\", valid: %d\n",
713 cp, IsValidCodePage(atoi(cp)));
714 return (TRUE);
715}
716
717static void enum_codepages (void)
718{
719 puts ("\nEnumerating codepages");
720 EnumSystemCodePages (callback, CP_INSTALLED);
721
722 if (IsValidCodePage(65001))
723 SetConsoleCP (65001);
724 else puts ("CP=65001 (UTF-8) is not valid");
725}
726#endif /* NOT_USED */
727
728
729#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(NOT_USED)
730__declspec(naked) unsigned __int64 _ftol2 (double x)
731{
732 _asm {
733 push ebp
734 mov ebp,esp
735 sub esp,0x00000020
736 and esp,0xfffffff0
737 fld st
738 fst dword ptr 0x18[esp]
739 fistp qword ptr 0x10[esp]
740 fild qword ptr 0x10[esp]
741 mov edx,dword ptr 0x18[esp]
742 mov eax,dword ptr 0x10[esp]
743 test eax,eax
744 je integer_QnaN_or_zero
745arg_is_not_integer_QnaN:
746 fsubp st(1),st
747 test edx,edx
748 jns positive
749 fstp dword ptr [esp]
750 mov ecx,dword ptr [esp]
751 xor ecx,0x80000000
752 add ecx,0x7fffffff
753 adc eax,0x00000000
754 mov edx,dword ptr 0x14[esp]
755 adc edx,0x00000000
756 jmp localexit
757positive:
758 fstp dword ptr [esp]
759 mov ecx,dword ptr [esp]
760 add ecx,0x7fffffff
761 sbb eax,0x00000000
762 mov edx,dword ptr 0x14[esp]
763 sbb edx,0x00000000
764 jmp localexit
765integer_QnaN_or_zero:
766 mov edx,dword ptr 0x14[esp]
767 test edx,0x7fffffff
768 jne arg_is_not_integer_QnaN
769 fstp dword ptr 0x18[esp]
770 fstp dword ptr 0x18[esp]
771localexit:
772 leave
773 ret
774 }
775}
776
777__declspec(naked) unsigned __int64 _aulldvrm (void)
778{
779 _asm {
780 push esi
781 mov eax,dword ptr 0x14[esp]
782 or eax,eax
783 jne L1
784 mov ecx,dword ptr 0x10[esp]
785 mov eax,dword ptr 0xc[esp]
786 xor edx,edx
787 div ecx
788 mov ebx,eax
789 mov eax,dword ptr 0x8[esp]
790 div ecx
791 mov esi,eax
792 mov eax,ebx
793 mul dword ptr 0x10[esp]
794 mov ecx,eax
795 mov eax,esi
796 mul dword ptr 0x10[esp]
797 add edx,ecx
798 jmp L2
799L1:
800 mov ecx,eax
801 mov ebx,dword ptr 0x10[esp]
802 mov edx,dword ptr 0xc[esp]
803 mov eax,dword ptr 0x8[esp]
804L3:
805 shr ecx,0x01
806 rcr ebx,0x01
807 shr edx,0x01
808 rcr eax,0x01
809 or ecx,ecx
810 jne L3
811 div ebx
812 mov esi,eax
813 mul dword ptr 0x14[esp]
814 mov ecx,eax
815 mov eax,dword ptr 0x10[esp]
816 mul esi
817 add edx,ecx
818 jb L4
819 cmp edx,dword ptr 0xc[esp]
820 ja L4
821 jb L5
822 cmp eax,dword ptr 0x8[esp]
823 jbe L5
824L4:
825 dec esi
826 sub eax,dword ptr 0x10[esp]
827 sbb edx,dword ptr 0x14[esp]
828L5:
829 xor ebx,ebx
830L2:
831 sub eax,dword ptr 0x8[esp]
832 sbb edx,dword ptr 0xc[esp]
833 neg edx
834 neg eax
835 sbb edx,0x00000000
836 mov ecx,edx
837 mov edx,ebx
838 mov ebx,ecx
839 mov ecx,eax
840 mov eax,esi
841 pop esi
842 ret 0x0010
843 }
844}
845#endif /* _MSC_VER && NOT_USED */
846
847/*
848 * From the Open Watcom Project
849 *
850 * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
851 */
852static int is_real_key (const INPUT_RECORD *k)
853{
854 if (k->EventType != KEY_EVENT)
855 return (0);
856
857 if (k->Event.KeyEvent.bKeyDown)
858 {
859 switch (k->Event.KeyEvent.wVirtualKeyCode)
860 {
861 case VK_SHIFT:
862 case VK_CONTROL:
863 case VK_MENU: /* Alt */
864 return (0);
865 }
866 return (1);
867 }
868 return (0);
869}
870
871/*
872 * CygWin doesn't even have <conio.h>. Let alone a simple kbhit()
873 * and getch(). Hence we make them for all Win32 targets here
874 * (but prefixed with '_w32_').
875 */
876int W32_NAMESPACE(kbhit) (void)
877{
878 INPUT_RECORD r;
879 DWORD num;
880
881 if (stdin_hnd == INVALID_HANDLE_VALUE)
882 return (0);
883
884 while (1)
885 {
886 PeekConsoleInput (stdin_hnd, &r, 1, &num);
887 if (num == 0)
888 break;
889 if (is_real_key(&r))
890 break;
891 ReadConsoleInput (stdin_hnd, &r, 1, &num); /* flush out mouse, window, and key up events */
892 }
893 return (num);
894}
895
896static int do_getch (HANDLE h)
897{
898 while (1)
899 {
900 INPUT_RECORD ir;
901 DWORD num;
902 int ch;
903
904 if (!ReadConsoleInput(h, &ir, 1, &num))
905 break;
906 if (!is_real_key(&ir))
907 continue;
908 ch = ir.Event.KeyEvent.uChar.AsciiChar;
909 if ((ir.Event.KeyEvent.dwControlKeyState & ENHANCED_KEY) || ch == 0)
910 ch = 0;
911 return (ch);
912 }
913 return (EOF);
914}
915
916int W32_NAMESPACE(getch) (void)
917{
918 DWORD mode;
919 int c;
920
921 if (stdin_hnd == INVALID_HANDLE_VALUE)
922 return (0);
923
924 GetConsoleMode (stdin_hnd, &mode);
925 if (!tcp_cbreak_off()) /* if not ignoring ^C */
926 SetConsoleMode (stdin_hnd, 0); /* binary; ignores ^C */
927 c = do_getch (stdin_hnd);
928 SetConsoleMode (stdin_hnd, mode);
929 return (c);
930}
931
932/*
933 * itoa(): convert 'value' and put into 'buf'
934 */
935#if 0
936
937char *W32_NAMESPACE(itoa) (int value, char *buf, int radix)
938{
939 WATT_ASSERT (radix == 8 || radix == 10);
940 sprintf (buf, (radix == 8) ? "%o" : "%d", value);
941 return (buf);
942}
943
944#else
945
946/* This version should be a lot faster. Ref:
947 * http://stackoverflow.com/questions/190229/where-is-the-itoa-function-in-linux
948 */
949char *W32_NAMESPACE(itoa) (int value, char *buf, int radix)
950{
951 int sign, i = 0;
952
953 WATT_ASSERT (radix == 10);
954 sign = value;
955
956 if (sign < 0) /* record sign */
957 value = -value; /* make 'value' positive */
958
959 do /* generate digits in reverse order */
960 {
961 buf[i++] = (value % 10) + '0';
962 }
963 while ((value /= 10) > 0);
964
965 if (sign < 0)
966 buf [i++] = '-';
967 buf [i] = '\0';
968 return strreverse (buf);
969}
970#endif /* 0 */
971
972/*
973 * Return FILETIME in seconds as a double.
974 */
975static double filetime_sec (const FILETIME *filetime)
976{
977 const LARGE_INTEGER *ft = (const LARGE_INTEGER*) filetime;
978 long double rc = (long double) ft->QuadPart;
979
980 return (double) (rc/1E7); /* from 100 nano-sec periods to sec */
981}
982
983/*
984 * Print some times (and CPU cycle counts) for a thread.
985 * I.e. the WinPcap receiver thread.
986 */
987void print_thread_times (HANDLE thread)
988{
989 FILETIME ctime, etime, ktime, utime;
990
991 if (!GetThreadTimes(thread, &ctime, &etime, &ktime, &utime))
992 {
993 DWORD err = GetLastError();
994 TRACE_CONSOLE (2, " GetThreadTimes() %s, ", win_strerror(err));
995 }
996 TRACE_CONSOLE (2, " kernel-time: %.6fs, user-time: %.6fs, life-span: %.6fs",
997 filetime_sec(&ktime), filetime_sec(&utime),
998 filetime_sec(&etime) - filetime_sec(&ctime));
999
1000 if (p_QueryThreadCycleTime)
1001 {
1002 ULONG64 cycle_time;
1003 if (!(*p_QueryThreadCycleTime) (thread, &cycle_time))
1004 TRACE_CONSOLE (2, ", cycle-time: <failed>");
1005 else TRACE_CONSOLE (2, ", cycle-time: %s clocks", qword_str(cycle_time));
1006 }
1007
1008 if (p_NtQueryInformationThread)
1009 {
1010 LARGE_INTEGER perf_count;
1011 NTSTATUS rc = (*p_NtQueryInformationThread) (thread, ThreadPerformanceCount,
1012 &perf_count, sizeof(perf_count),
1013 NULL);
1014 if (rc != STATUS_SUCCESS)
1015 TRACE_CONSOLE (2, ", perf-count: <fail %ld>", (long)rc);
1016 else TRACE_CONSOLE (2, ", perf-count: %s", qword_str(perf_count.QuadPart));
1017 }
1018 TRACE_CONSOLE (2, "\n");
1019}
1020
1021/*
1022 * Print some times for a process.
1023 */
1024void print_process_times (void)
1025{
1026#if 0 /* \todo */
1027 HANDLE proc = OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
1028 FALSE, GetCurrentProcessId());
1029
1030 FILETIME ctime, etime, ktime, utime;
1031 PERFORMANCE_INFORMATION perf_info;
1032 PROCESS_MEMORY_COUNTERS ctrs;
1033
1034 if (GetProcessTimes(proc, &ctime, &etime.ft, &ktime, &utime))
1035 {
1036 /* The units returned by GetProcessTimes are 100 nanoseconds */
1037 u_time.lt = (u_time.lt + 5) / 10;
1038 s_time.lt = (s_time.lt + 5) / 10;
1039
1040 usage->ru_utime.tv_sec = (long)(u_time.lt / 1000000ll);
1041 usage->ru_stime.tv_sec = (long)(s_time.lt / 1000000ll);
1042 usage->ru_utime.tv_usec = (long)(u_time.lt % 1000000ll);
1043 usage->ru_stime.tv_usec = (long)(s_time.lt % 1000000ll);
1044
1045 if (GetProcessMemoryInfo(proc, &ctrs, sizeof(ctrs)))
1046 {
1047 GetPerformanceInfo (&perf_info, sizeof(perf_info));
1048 usage->ru_maxrss = (DWORD) (ctrs.WorkingSetSize / perf_info.PageSize);
1049 usage->ru_majflt = ctrs.PageFaultCount;
1050 }
1051 }
1052 CloseHandle (proc);
1053#endif
1054}
1055
1056/*
1057 * Taken from NetPerf's netcpu_ntperf.c:
1058 * http://www.netperf.org/netperf
1059 *
1060 * System CPU time information class.
1061 * Used to get CPU time information.
1062 *
1063 * SDK\inc\ntexapi.h
1064 * Function x8: SystemProcessorPerformanceInformation
1065 * DataStructure: SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
1066 */
1067#define SystemProcessorPerformanceInformation 0x08
1068
1069typedef struct {
1070 LARGE_INTEGER IdleTime;
1071 LARGE_INTEGER KernelTime;
1072 LARGE_INTEGER UserTime;
1073 LARGE_INTEGER DpcTime;
1074 LARGE_INTEGER InterruptTime;
1075 LONG InterruptCount;
1076 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
1077
1078#define MAX_CPUS 256
1079
1080/* \todo:
1081 * Store the counters before and after to get the delta-times.
1082 */
1083void print_perf_times (void)
1084{
1085 SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info [MAX_CPUS];
1086 DWORD i, ret_len, ret_num_CPUs;
1087 NTSTATUS rc;
1088
1089 if (!p_NtQuerySystemInformation || num_cpus == 0)
1090 {
1091 TRACE_CONSOLE (2, " p_NtQuerySystemInformation = NULL!\n");
1092 return;
1093 }
1094
1095 /* Get the current CPUTIME information.
1096 */
1097 rc = (*p_NtQuerySystemInformation) (SystemProcessorPerformanceInformation,
1098 &info, sizeof(info), &ret_len);
1099 if (rc != 0)
1100 {
1101 DWORD err = GetLastError();
1102 TRACE_CONSOLE (2, " NtQuerySystemInformation() %s, ", win_strerror(err));
1103 return;
1104 }
1105
1106 /* Validate that NtQuery returned a reasonable amount of data
1107 */
1108 if ((ret_len % sizeof(info[0])) != 0)
1109 {
1110 TRACE_CONSOLE (1, "NtQuery didn't return expected amount of data\n"
1111 "Expected a multiple of %u, returned %lu\n",
1112 SIZEOF(info[0]), (u_long)ret_len);
1113 return;
1114 }
1115
1116 ret_num_CPUs = ret_len / sizeof(info[0]);
1117 if (ret_num_CPUs != num_cpus)
1118 {
1119 TRACE_CONSOLE (1, "NtQuery didn't return expected amount of data\n"
1120 "Expected data for %i CPUs, returned %lu\n",
1121 num_cpus, (u_long)ret_num_CPUs);
1122 return;
1123 }
1124
1125 /* Print total all of the CPUs:
1126 * KernelTime needs to be fixed-up; it includes both idle & true kernel time.
1127 */
1128 for (i = 0; i < ret_num_CPUs; i++)
1129 {
1130 ULONG64 x;
1131
1132 TRACE_CONSOLE (2, "CPU %lu:%s", (u_long)i, (i == 0) ? "\t\t\t CPU clocks\n" : "\n");
1133
1134 x = info[i].KernelTime.QuadPart - info[i].IdleTime.QuadPart;
1135 TRACE_CONSOLE (2, " KernelTime: %18s\n", qword_str(x));
1136
1137 x = info[i].IdleTime.QuadPart;
1138 TRACE_CONSOLE (2, " IdleTime: %18s\n", qword_str(x));
1139
1140 x = info[i].UserTime.QuadPart;
1141 TRACE_CONSOLE (2, " UserTime: %18s\n", qword_str(x));
1142
1143 x = info[i].DpcTime.QuadPart;
1144 TRACE_CONSOLE (2, " DpcTime: %18s\n", qword_str(x));
1145
1146 x = info[i].InterruptTime.QuadPart;
1147 TRACE_CONSOLE (2, " InterruptTime: %18s\n", qword_str(x));
1148 TRACE_CONSOLE (2, " InterruptCount: %18s\n", dword_str(info[i].InterruptCount));
1149 }
1150}
1151#endif /* WIN32 || WIN64 */
1152
cpumodel.h
get_xby.h
_watt_os_ver
WORD _watt_os_ver
Definition: misc.c:74
_watt_assert_buf
char _watt_assert_buf[256]
Definition: misc.c:75
qword_str
const char * qword_str(uint64 val)
The same as above.
Definition: misc.c:1053
dword_str
const char * dword_str(DWORD val)
Return nicely formatted string "xx,xxx,xxx" with thousand separators (left adjusted).
Definition: misc.c:1022
misc.h
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
_inet6_ntoa
const char * _inet6_ntoa(const void *ip)
Convert an IPv6-address 'ip' into a string.
Definition: netaddr.c:401
_inet_ntoa
char *W32_CALL _inet_ntoa(char *s, DWORD ip)
Convert an IP-address 'ip' into a string.
Definition: netaddr.c:44
get_argv0
const char * get_argv0(void)
Return argv[0] as passed to main().
Definition: pcconfig.c:671
pcdns.h
sock_exit
void MS_CDECL sock_exit(void)
Our only atexit() handler.
Definition: sock_ini.c:1058
watt_sock_init
int W32_CALL watt_sock_init(size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
Definition: sock_ini.c:769
_watt_do_exit
BOOL _watt_do_exit
exit program when all boot attempts failed
Definition: sock_ini.c:136
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
Definition: winmisc.c:1069
esp
Definition: esp.h:44
proc
Definition: if.h:81
rip
Definition: routed.h:111
winsock_fd_set
Definition: winsock.h:50
win_dll.h
_watt_is_win9x
BOOL _watt_is_win9x
Definition: winmisc.c:49
get_file_version
BOOL get_file_version(const char *file_name, char *version_buf, size_t version_buf_len)
Returns the version of a PE image (.sys, .dll or .exe).
Definition: winmisc.c:227
new_abort_handler
static void MS_CDECL new_abort_handler(int sig)
Definition: winmisc.c:317
win_strerror
char *W32_CALL win_strerror(DWORD err)
Return err-number and string for 'err'.
Definition: winmisc.c:208
_watt_is_wow64
BOOL _watt_is_wow64
Definition: winmisc.c:50


Watt-32 tcp/ip: E:/WATT/src/winpkt.c Source File

  • src
winpkt.c
Go to the documentation of this file.
1
32#include <process.h>
33#include <arpa/inet.h>
34
35#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
36#include <windowsx.h>
37
38#include "wattcp.h"
39#include "misc.h"
40#include "misc_str.h"
41#include "timer.h"
42#include "profile.h"
43#include "sock_ini.h"
44#include "language.h"
45#include "pcconfig.h"
46#include "pcdbug.h"
47#include "pcstat.h"
48#include "pcpkt.h"
49
50#include "win_dll.h"
51#include "winpkt.h"
52#include "w32_ndis.h"
53#include "packet32.h"
54#include "swsvpkt.h"
55
56#if (defined(_DLL) && !defined(_MT))
57#error "This file must be compiled for threads"
58#endif
59
60#define AIR_ADAPTER ADAPTER /* for the time being */
61
62/* Rewritten from <ntddndis.h>
63 */
64#define ND_PHY_Unspecified 0
65#define ND_PHY_WirelessLan 1
66#define ND_PHY_CableModem 2
67#define ND_PHY_PhoneLine 3
68#define ND_PHY_PowerLine 4
69#define ND_PHY_DSL 5
70#define ND_PHY_FibreChannel 6
71#define ND_PHY_1394 7
72#define ND_PHY_WirelessWan 8
73#define ND_PHY_Native802_11 9
74#define ND_PHY_Bluetooth 10
75#define ND_PHY_Infiniband 11
76#define ND_PHY_WiMax 12
77#define ND_PHY_UWB 13
78#define ND_PHY_802_3 14
79#define ND_PHY_802_5 15
80#define ND_PHY_Irda 16
81#define ND_PHY_WiredWAN 17
82#define ND_PHY_WiredCoWan 18
83#define ND_PHY_Other 19
84
85WORD _pktdevclass = PDCLASS_UNKNOWN;
86WORD _pkt_ip_ofs = 0;
87BOOL _pktserial = FALSE;
88int _pkt_errno = 0;
89int _pkt_rxmode = RXMODE_DEFAULT;
90int _pkt_rxmode0 = -1;
91int _pkt_forced_rxmode = -1;
92char _pktdrvrname [MAX_VALUELEN+1] = "";
93char _pktdrvr_descr [MAX_VALUELEN+1] = "";
94
95struct pkt_info *_pkt_inf = NULL;
96
97/* Determines size of work buffers of NPF kernel and PacketReceivePacket().
98 * It doesn't influence the size of thread queue yet.
99 */
100static int pkt_num_rx_bufs = RX_BUFS;
101
102/* WinPcap/SwsVpkt doesn't keep a count of transmitted packets and errors.
103 * So we maintain these counters locally.
104 */
105static DWORD num_tx_pkt = 0UL;
106static DWORD num_tx_bytes = 0UL;
107static DWORD num_tx_errors = 0UL;
108static DWORD num_rx_pkt = 0UL;
109static DWORD num_rx_bytes = 0UL;
110static DWORD pkt_drop_cnt = 0UL;
111static int pkt_txretries = 2;
112static int thr_realtime = 0;
113static BOOL thr_stopped = FALSE;
114static BOOL config_pass_1_done = FALSE;
115static char dump_fname [MAX_PATHLEN] = "$(TEMP)\\winpkt_dump.txt";
116
117#define NdisMediumNull -1
118
119static const struct search_list logical_media[] = {
120 { (DWORD) NdisMediumNull, "Unknown?" },
121 { NdisMedium802_3, "802.3" },
122 { NdisMedium802_5, "802.5" },
123 { NdisMediumFddi, "FDDI" },
124 { NdisMediumWan, "WAN" },
125 { NdisMediumLocalTalk, "LocalTalk" },
126 { NdisMediumDix, "DIX" },
127 { NdisMediumArcnetRaw, "ArcNet (raw)" },
128 { NdisMediumArcnet878_2, "ArcNet (878.2)" },
129 { NdisMediumAtm, "ATM" },
130 { NdisMediumWirelessWan, "WiFi" },
131 { NdisMediumIrda, "IrDA" },
132 { NdisMediumBpc, "BPC" }, // 11
133 { NdisMediumCoWan, "CoWan" }, // 12
134 { NdisMedium1394, "1394 FW" }, // 13
135 { NdisMediumInfiniBand, "Inf-band" }, // 14
136 { NdisMediumTunnel, "Tunnel" },
137 { NdisMediumNative802_11, "Native 802.11" },
138 { NdisMediumLoopback, "Loopback" },
139 { NdisMediumWiMAX, "WiMax" },
140 { NdisMediumIP, "IP" },
141 { NdisMediumCHDLC, "CHDLC" }, // -2 (Custom linktype)
142 { NdisMediumPPPSerial, "PPP-ser" }
143 };
144
145static const struct search_list phys_media[] = {
146 { ND_PHY_WirelessLan, "Wireless LAN" },
147 { ND_PHY_CableModem, "Cable" },
148 { ND_PHY_PhoneLine, "Phone" },
149 { ND_PHY_PowerLine, "PowerLine" },
150 { ND_PHY_DSL, "DSL" },
151 { ND_PHY_FibreChannel, "Fibre" },
152 { ND_PHY_1394, "IEEE1394" },
153 { ND_PHY_WirelessWan, "Wireless WAN" },
154 { ND_PHY_Native802_11, "802.11" },
155 { ND_PHY_Bluetooth, "Bluetooth" },
156 { ND_PHY_Infiniband, "Infiniband" },
157 { ND_PHY_WiMax, "Wi-Max" },
158 { ND_PHY_UWB, "UWB" },
159 { ND_PHY_802_3, "802.3" },
160 { ND_PHY_802_5, "80.25" },
161 { ND_PHY_Irda, "Irda" },
162 { ND_PHY_WiredWAN, "Wired WAN" },
163 { ND_PHY_WiredCoWan, "Wired CoWan" },
164 { ND_PHY_Other, "Other?" }
165 };
166
167static enum eth_init_result open_winpcap_adapter (const char *name);
168static enum eth_init_result open_npcap_adapter (const char *name);
169static enum eth_init_result open_win10pcap_adapter (const char *name);
170static enum eth_init_result open_wanpacket_adapter (const char *name);
171static enum eth_init_result open_swsvpkt_adapter (const char *name);
172
173static BOOL get_if_stat_swsvpkt (const void *u, BOOL *is_up);
174static BOOL get_perm_mac_address (void *mac);
175static BOOL get_interface_mtu (DWORD *mtu);
176static void show_link_details (void);
177static void set_txmode (const char *value);
178
179static void swsvpkt_callback (struct SwsVpktUsr *, const void *, unsigned);
180static DWORD __stdcall winpcap_recv_thread (void *arg);
181
182const char *winpkt_trace_func; /* the function being traced */
183const char *winpkt_trace_file; /* .. and in which source file */
184UINT winpkt_trace_line; /* .. and at what line */
185UINT winpkt_trace_level = 0;
186
187#if defined(USE_DEBUG)
188 static FILE *trace_file;
189
190 void winpkt_trace (const char *fmt, ...)
191 {
192 static DWORD start_tick = 0UL;
193 time_t now;
194 va_list args;
195
196 WATT_ASSERT (config_pass_1_done);
197
198 if (!trace_file)
199 return;
200
201 if (!start_tick)
202 {
203 now = time (NULL);
204 fprintf (trace_file, "Trace started at %s", ctime(&now));
205 fputs ("dT [ms] File Line Function etc.\n---------------------------"
206 "----------------------------------------------------------\n", trace_file);
207 start_tick = GetTickCount();
208 }
209 ENTER_CRIT();
210
211 fprintf (trace_file, "%6lu %-10s %4u %s(): ",
212 (u_long)(GetTickCount() - start_tick),
213 winpkt_trace_file, winpkt_trace_line, winpkt_trace_func);
214
215 va_start (args, fmt);
216 vfprintf (trace_file, fmt, args);
217 fflush (trace_file);
218 if (ferror(trace_file))
219 {
220 TRACE_CONSOLE (1, "error writing dump file %s; %s\n", dump_fname, strerror(errno));
221 winpkt_trace_fclose();
222 }
223 LEAVE_CRIT();
224 va_end (args);
225 }
226
227 void winpkt_trace_fclose (void)
228 {
229 if (trace_file && trace_file != stdout)
230 fclose (trace_file);
231 trace_file = NULL;
232 }
233#endif
234
238static BOOL parse_config_pass_1 (void)
239{
240 static const struct config_table pkt_init_cfg[] = {
241 { "WINPKT.DEVICE", ARG_STRCPY, (void*)&_pktdrvrname },
242 { "WINPKT.DUMPFILE", ARG_STRCPY, (void*)&dump_fname },
243 { "WINPKT.TRACE", ARG_ATOI, (void*)&winpkt_trace_level },
244 { "WINPKT.TXRETRIES",ARG_ATOB, (void*)&pkt_txretries },
245 { "WINPKT.TXMODE", ARG_FUNC, (void*)set_txmode },
246 { "WINPKT.RXMODE", ARG_ATOX_W, (void*)&_pkt_forced_rxmode },
247 { "WINPKT.RXBUFS", ARG_ATOI, (void*)&pkt_num_rx_bufs },
248 { "WINPKT.HIGHPRIO", ARG_ATOI, (void*)&thr_realtime },
249 { NULL, 0, NULL }
250 };
251 const struct config_table *cfg_save = watt_init_cfg;
252 void (W32_CALL *init_save) (const char*, const char*) = usr_init;
253 int rc;
254
255 watt_init_cfg = pkt_init_cfg;
256 usr_init = NULL; /* only pkt_init_cfg[] gets parsed */
257 rc = tcp_config (NULL);
258 usr_init = init_save;
259 watt_init_cfg = cfg_save;
260 config_pass_1_done = 1;
261 return (rc > 0);
262}
263
268static BOOL find_winpcap_adapter (char *aname, size_t size)
269{
270 const ADAPTER_INFO *ai;
271 int i;
272
273 for (ai = PacketGetAdInfo(); ai; ai = ai->Next)
274 {
275 for (i = 0; i < ai->NNetworkAddresses; i++)
276 {
277 const npf_if_addr *if_addr = ai->NetworkAddresses + i;
278 const struct sockaddr_in *ip_addr = (const struct sockaddr_in*) &if_addr->IPAddress;
279
280 if (ip_addr->sin_family == AF_INET)
281 {
282 _strlcpy (aname, ai->Name, size);
283 return (TRUE);
284 }
285 }
286 }
287 return (FALSE);
288}
289
290/*
291 * Loop through "\\.\SwsVpkt<0-31>" and return TRUE on 1st available
292 * device.
293 */
294static BOOL find_swsvpkt_adapter (char *aname, size_t size)
295{
296 char name [sizeof("\\\\.\\SwsVpkt") + 11];
297 BOOL found;
298 int i;
299
300 for (i = 0, found = FALSE; i <= 31 && !found; i++)
301 {
302 struct SwsVpktUsr *sw_usr;
303 struct SwsVpktOpenInfo sw_open;
304 struct SwsVpktAdapterState sw_state;
305
306 memset (&sw_state,'\0', sizeof(sw_state));
307 SNPRINTF (name, sizeof(name), "\\\\.\\SwsVpkt%d", i);
308 sw_open.uRxBufs = pkt_num_rx_bufs;
309 sw_open.pfnRx = swsvpkt_callback;
310 sw_usr = SwsVpktOpen (name, &sw_open);
311 if (sw_usr)
312 {
313 get_if_stat_swsvpkt (sw_usr, &found);
314 SwsVpktClose (sw_usr);
315 }
316 }
317 if (found)
318 _strlcpy (aname, name, size);
319 return (found);
320}
321
327static BOOL find_adapter (char *aname, size_t size)
328{
329 BOOL rc;
330
331 rc = find_winpcap_adapter (aname, size);
332 if (rc)
333 {
334 _eth_winpcap = TRUE;
335 return (TRUE);
336 }
337#if 0 /* \to-do */
338 rc = find_win10pcap_adapter (aname, size);
339 if (rc)
340 {
341 _eth_win10pcap = TRUE;
342 return (TRUE);
343 }
344#endif
345 rc = find_swsvpkt_adapter (aname, size);
346 if (rc)
347 {
348 _eth_SwsVpkt = TRUE;
349 return (TRUE);
350 }
351 return (rc);
352}
353
358static BOOL legal_recv_mode (WORD bits)
359{
360 if (bits & RXMODE_OFF)
361 bits &= ~RXMODE_OFF;
362
363 if (bits & RXMODE_DIRECT)
364 bits &= ~RXMODE_DIRECT;
365
366 if (bits & RXMODE_MULTICAST1)
367 bits &= ~RXMODE_MULTICAST1;
368
369 if (bits & RXMODE_MULTICAST2)
370 bits &= ~RXMODE_MULTICAST2;
371
372 if (bits & RXMODE_BROADCAST)
373 bits &= ~RXMODE_BROADCAST;
374
375 if (bits & RXMODE_PROMISCOUS)
376 bits &= ~RXMODE_PROMISCOUS;
377
378 if (bits & RXMODE_ALL_LOCAL)
379 bits &= ~RXMODE_ALL_LOCAL;
380
381 return (bits == 0);
382}
383
388int W32_CALL pkt_eth_init (mac_address *mac_addr)
389{
390 enum eth_init_result rc;
391 DWORD thread_id;
392 BOOL is_up, unknown_driver;
393 char descr [512];
394
395 if (_watt_is_win9x)
396 {
397 (*_printf) (_LANG("Only Win-NT+ is supported.\n"));
398 _pkt_errno = PDERR_GEN_FAIL;
399 return (WERR_ILL_DOSX);
400 }
401
402 if (!_watt_no_config || _watt_user_config_fn)
403 parse_config_pass_1();
404
405 _pkt_inf = _aligned_malloc (sizeof(*_pkt_inf), sizeof(DWORD));
406 if (!_pkt_inf)
407 {
408 (*_printf) (_LANG("Failed to allocate DRIVER data.\n"));
409 _pkt_errno = PDERR_GEN_FAIL;
410 return (WERR_NO_MEM);
411 }
412
413 memset (_pkt_inf, '\0', sizeof(*_pkt_inf));
414#if defined(USE_DEBUG)
415 if (winpkt_trace_level > 0 && dump_fname[0])
416 {
417 const char *file = expand_var_str (dump_fname);
418
419 if (file != dump_fname) /* not overlapping data */
420 _strlcpy (dump_fname, file, sizeof(dump_fname));
421 if (!strcmp(dump_fname, "-"))
422 trace_file = stdout;
423 else trace_file = fopen_excl (file, "w+t");
424 }
425#endif
426
427 /* If no 'winpkt.device' specified, call 'PacketInitModule()' regardless.
428 */
429 unknown_driver = (_pktdrvrname[0] == '\0');
430
431 _eth_SwsVpkt = (strnicmp(_pktdrvrname, "\\\\.\\SwsVpkt", 11) == 0);
432 _eth_winpcap = (strnicmp(_pktdrvrname, "\\Device\\NPF_{", 13) == 0);
433 _eth_win10pcap = (strnicmp(_pktdrvrname, "\\Device\\WTCAP_A_{", 15) == 0);
434 _eth_wanpacket = (strnicmp(_pktdrvrname, "\\Device\\NPF_Generic", 19) == 0);
435
436 if ((_eth_winpcap || _eth_win10pcap || unknown_driver) && !PacketInitModule())
437 {
438 (*_printf) (_LANG("Failed to initialise WinPcap.\n"));
439 pkt_release();
440 _pkt_errno = PDERR_NO_DRIVER;
441 return (WERR_PKT_ERROR);
442 }
443
444 if (!_pktdrvrname[0] && !find_adapter(_pktdrvrname, sizeof(_pktdrvrname)))
445 {
446 const char *problem = "";
447 BOOL env_ok = (getenv("WATTCP.CFG") || getenv("WATTCP_CFG"));
448
449 if (!env_ok)
450 problem = "Seems you have not defined a valid %WATTCP.CFG%. Check the INSTALL instructions.\n";
451 (*_printf) (_LANG("No WinPcap, NPcap or SwsVpkt driver found.\n%s"), problem);
452
453 _pkt_errno = PDERR_NO_DRIVER;
454 return (WERR_NO_DRIVER);
455 }
456
457 TRACE_CONSOLE (2, "device %s\n", _pktdrvrname);
458
459 rc = _eth_SwsVpkt ? open_swsvpkt_adapter (_pktdrvrname) :
460 _eth_wanpacket ? open_wanpacket_adapter (_pktdrvrname) :
461 _eth_win10pcap ? open_win10pcap_adapter (_pktdrvrname) :
462 open_winpcap_adapter (_pktdrvrname);
463
464 if (rc != WERR_NO_ERROR)
465 {
466 pkt_release();
467 return (rc);
468 }
469
470 if (_pkt_inf->get_descr_op &&
471 (*_pkt_inf->get_descr_op)(_pkt_inf->adapter, descr, sizeof(descr)))
472 _strlcpy (_pktdrvr_descr, strrtrim(descr), sizeof(_pktdrvr_descr));
473
474 if (!_pkt_inf->get_if_type_op ||
475 !(*_pkt_inf->get_if_type_op) (_pkt_inf->adapter, &_pktdevclass))
476 {
477 (*_printf) (_LANG("Failed to get interface type.\n"));
478 pkt_release();
479 return (WERR_PKT_ERROR);
480 }
481
482 if (_pkt_inf->get_if_stat_op &&
483 (*_pkt_inf->get_if_stat_op) (_pkt_inf->adapter, &is_up) && !is_up)
484 (*_printf) (_LANG("Warning: the adapter %s is down\n"), _pktdrvrname);
485
486 switch (_pktdevclass)
487 {
488 case PDCLASS_TOKEN:
489 _pkt_ip_ofs = sizeof(tok_Header);
490 break;
491 case PDCLASS_ETHER:
492 _pkt_ip_ofs = sizeof(eth_Header);
493 break;
494 case PDCLASS_FDDI:
495 _pkt_ip_ofs = sizeof(fddi_Header);
496 break;
497 case PDCLASS_ARCNET:
498 _pkt_ip_ofs = ARC_HDRLEN;
499 break;
500 default:
501 pkt_release();
502 (*_printf) (_LANG("WinPkt-ERROR: Unsupported driver class %dh\n"),
503 _pktdevclass);
504 _pkt_errno = PDERR_NO_CLASS;
505 return (WERR_PKT_ERROR);
506 }
507
508 if (!pkt_get_addr(mac_addr)) /* get our MAC address */
509 {
510 pkt_release();
511 return (WERR_PKT_ERROR);
512 }
513
514 pktq_init (&_pkt_inf->pkt_queue,
515 sizeof(_pkt_inf->rx_buf[0]), /* RX_SIZE */
516 DIM(_pkt_inf->rx_buf), /* RX_BUFS */
517 (char*)&_pkt_inf->rx_buf);
518
519 if (_eth_winpcap || _eth_win10pcap) /* to-do: do this in 'open_XX_adapter' */
520 {
521 _pkt_inf->npf_buf_size = RX_SIZE * pkt_num_rx_bufs;
522 _pkt_inf->npf_buf = malloc (_pkt_inf->npf_buf_size);
523 if (!_pkt_inf->npf_buf)
524 {
525 (*_printf) (_LANG("Failed to allocate %d byte Rx buffer.\n"),
526 _pkt_inf->npf_buf_size);
527 pkt_release();
528 _pkt_errno = PDERR_GEN_FAIL;
529 return (WERR_NO_MEM);
530 }
531
532 PacketSetLoopbackBehavior (_pkt_inf->adapter, NPF_DISABLE_LOOPBACK);
533 PacketSetMode (_pkt_inf->adapter, PACKET_MODE_CAPT);
534 PacketSetBuff (_pkt_inf->adapter, _pkt_inf->npf_buf_size);
535 PacketSetMinToCopy (_pkt_inf->adapter, ETH_MIN);
536
537 /* PacketReceivePacket() blocks until something is received
538 */
539 PacketSetReadTimeout ((ADAPTER*)_pkt_inf->adapter, 0);
540 }
541
542 /* Check Rx-mode from config-file.
543 */
544 if (_pkt_forced_rxmode != -1)
545 {
546 _pkt_forced_rxmode &= 0xFFFF; /* clear bits not set via ARG_ATOX_W */
547 if (_pkt_forced_rxmode == 0 || !legal_recv_mode(_pkt_forced_rxmode))
548 {
549 TRACE_CONSOLE (1, "Illegal Rx-mode (0x%02X) specified. Forcing default mode (0x%02X).\n",
550 _pkt_forced_rxmode, RXMODE_DEFAULT);
551 _pkt_forced_rxmode = RXMODE_DEFAULT;
552 }
553 }
554
555 if (pkt_get_rcv_mode())
556 _pkt_rxmode0 = _pkt_rxmode;
557
558 /* Set Rx-mode; default or forced via config.
559 */
560 if (_pkt_forced_rxmode != -1)
561 pkt_set_rcv_mode (_pkt_forced_rxmode);
562 else pkt_set_rcv_mode (RXMODE_DEFAULT);
563
564 if (_eth_winpcap || _eth_win10pcap) /* to-do: do this in 'open_XX_adapter' */
565 {
566 _pkt_inf->recv_thread = CreateThread (NULL, 2048, winpcap_recv_thread,
567 NULL, 0, &thread_id);
568 if (!_pkt_inf->recv_thread)
569 {
570 (*_printf) (_LANG("Failed to create receiver thread; %s\n"),
571 win_strerror(GetLastError()));
572 pkt_release();
573 _pkt_errno = PDERR_GEN_FAIL;
574 return (WERR_PKT_ERROR);
575 }
576
577#if defined(__CYGWIN__) && 0
578 TRACE_CONSOLE (2, "bp->bh_caplen at ofs: %ld\n", offsetof(struct bpf_hdr, bh_caplen));
579 TRACE_CONSOLE (2, "bp->bh_datalen at ofs: %ld\n", offsetof(struct bpf_hdr, bh_datalen));
580 TRACE_CONSOLE (2, "bp->bh_bh_hdrlen at ofs: %ld\n", offsetof(struct bpf_hdr, bh_hdrlen));
581#endif
582
583 if (thr_realtime)
584 SetThreadPriority (_pkt_inf->recv_thread,
585 THREAD_PRIORITY_TIME_CRITICAL);
586
587 TRACE_CONSOLE (2, "capture thread-id %lu\n", (u_long)thread_id);
588 }
589
590#if defined(USE_DEBUG)
591 if (winpkt_trace_level >= 3)
592 {
593 (*_printf) ("link-details:\n");
594 show_link_details();
595 }
596#endif
597
598 return (0);
599}
600
601int W32_CALL pkt_release (void)
602{
603 ADAPTER *adapter;
604 DWORD status = 1;
605
606 if (!_pkt_inf || _watt_fatal_error)
607 return (0);
608
609 adapter = (ADAPTER*) _pkt_inf->adapter;
610
611 TRACE_CONSOLE (2, "pkt_release(): adapter 0x%" ADDR_FMT "\n", ADDR_CAST(adapter));
612
613 if (adapter && adapter != INVALID_HANDLE_VALUE)
614 {
615 /* Don't close the adapter before telling the thread about it.
616 * Only WinPcap devices have a receiver thread here.
617 */
618 if (_pkt_inf->recv_thread)
619 {
620 _pkt_inf->stop_thread = TRUE;
621 SetEvent (adapter->ReadEvent);
622 Sleep (50);
623
624 GetExitCodeThread (_pkt_inf->recv_thread, &status);
625 if (status == STILL_ACTIVE)
626 TRACE_CONSOLE (2, "pkt_release(): killing thread.\n");
627 else TRACE_CONSOLE (2, "pkt_release(): thread exit code %lu.\n", (u_long)status);
628
629 if (debug_on >= 2)
630 {
631 print_thread_times (_pkt_inf->recv_thread);
632 print_perf_times();
633 }
634
635 TerminateThread (_pkt_inf->recv_thread, 1);
636 CloseHandle (_pkt_inf->recv_thread);
637 }
638
639 (*_pkt_inf->close_op) ((void*)_pkt_inf->adapter);
640 _pkt_inf->adapter = NULL;
641 }
642
643 if (_eth_winpcap || _eth_win10pcap)
644 DO_FREE (_pkt_inf->npf_buf);
645
646 if (_pkt_inf)
647 _aligned_free (_pkt_inf);
648 _pkt_inf = NULL;
649
650 if (_eth_winpcap || _eth_win10pcap)
651 PacketExitModule();
652
653#if defined(USE_DEBUG)
654 winpkt_trace_fclose();
655#endif
656
657 return (int) status;
658}
659
660/*
661 * Return the MAC address.
662 */
663int W32_CALL pkt_get_addr (mac_address *eth)
664{
665 mac_address mac;
666
667 if (get_perm_mac_address(&mac))
668 {
669 memcpy (eth, &mac, sizeof(*eth));
670 return (1);
671 }
672 TRACE_CONSOLE (2, "Failed to get our MAC address; %s\n", win_strerror(GetLastError()));
673 return (0);
674}
675
676int W32_CALL pkt_set_addr (const void *eth)
677{
678 ARGSUSED (eth);
679 return (0);
680}
681
682/* Return TRUE is adapter is up.
683 */
684BOOL W32_CALL pkt_is_init (void)
685{
686 return (_pkt_inf != NULL);
687}
688
689/*
690 * Check 'my_ip' against the IPv4 address(es) Winsock is using for
691 * this adapter. Only applies to WinPcap adapters.
692 */
693BOOL W32_CALL pkt_check_address (DWORD my_ip)
694{
695 const ADAPTER_INFO *ai;
696 int i;
697
698 if (!_pkt_inf || !_pkt_inf->adapter_info)
699 return (TRUE);
700
701 ai = (const ADAPTER_INFO*) _pkt_inf->adapter_info;
702
703 for (i = 0; i < ai->NNetworkAddresses; i++)
704 {
705 const npf_if_addr *if_addr = ai->NetworkAddresses + i;
706 const struct sockaddr_in *ip_addr = (const struct sockaddr_in*) &if_addr->IPAddress;
707
708 if (ntohl(ip_addr->sin_addr.s_addr) == my_ip)
709 return (FALSE);
710 }
711 return (TRUE); /* Okay, no possible conflict */
712}
713
714
715int W32_CALL pkt_buf_wipe (void)
716{
717 if (_pkt_inf)
718 pktq_clear (&_pkt_inf->pkt_queue);
719 return (1);
720}
721
722int W32_CALL pkt_waiting (void)
723{
724 if (_pkt_inf)
725 return pktq_queued (&_pkt_inf->pkt_queue);
726 return (-1);
727}
728
729void W32_CALL pkt_free_pkt (const void *pkt)
730{
731 struct pkt_ringbuf *q;
732 const char *q_tail;
733 int delta;
734
735 if (!_pkt_inf || !pkt)
736 return;
737
738 q = &_pkt_inf->pkt_queue;
739 pkt_drop_cnt = q->num_drop;
740
741#ifdef __ORANGEC__ /* Problem with 'offsetof()' ? */
742 #undef RX_ELEMENT_HEAD_SIZE
743 #define RX_ELEMENT_HEAD_SIZE (2*8+2)
744#endif
745
746 q_tail = (const char*)pkt - _pkt_ip_ofs - RX_ELEMENT_HEAD_SIZE;
747 delta = q_tail - pktq_out_buf (q);
748 if (delta)
749 {
750 TRACE_CONSOLE (0, "%s: freeing illegal packet 0x%p, delta %d.\n", __FILE__, pkt, delta);
751 pktq_clear (q);
752 }
753 else
754 pktq_inc_out (q);
755}
756
760static void set_txmode (const char *value)
761{
762 ARGSUSED (value);
763}
764
787static DWORD __stdcall winpcap_recv_thread (void *arg)
788{
789 int rc = 0;
790
791 while (1)
792 {
793 const struct bpf_hdr *bp;
794 BYTE *pkt, *pkt_end;
795 size_t pkt_len, cap_len, hdr_len;
796 UINT total_len, chunk;
797
798 if (!_pkt_inf || _pkt_inf->stop_thread) /* this signals closure */
799 {
800 rc = 1;
801 break;
802 }
803
804 pkt_len = _pkt_inf->npf_buf_size;
805 pkt = _pkt_inf->npf_buf;
806
807 total_len = (*_pkt_inf->recv_op) (_pkt_inf->adapter, pkt, pkt_len);
808 if (total_len <= sizeof(*bp))
809 {
810 rc = 2;
811 break;
812 }
813
814 ENTER_CRIT();
815
816 for (pkt_end = pkt + total_len, chunk = 1;
817 pkt < pkt_end;
818 pkt += Packet_WORDALIGN(cap_len+hdr_len), chunk++)
819 {
820 struct pkt_ringbuf *q;
821
822 q = &_pkt_inf->pkt_queue;
823 bp = (const struct bpf_hdr*) pkt;
824
825 cap_len = bp->bh_caplen;
826 hdr_len = bp->bh_hdrlen;
827
828 TRACE_CONSOLE (2, "winpcap_recv_thread(): total_len %d, "
829 "chunk %d, cap_len %d, hdr_len %d, in-idx %d\n",
830 total_len, chunk, (int)cap_len, (int)hdr_len,
831 q->in_index);
832
833 num_rx_bytes += total_len - sizeof(*bp);
834 num_rx_pkt++;
835
836 if (cap_len > ETH_MAX)
837 {
838 _pkt_inf->error = "Large size";
839 STAT (macstats.num_too_large++);
840 }
841 else if (pktq_in_index(q) == q->out_index) /* queue is full, drop it */
842 q->num_drop++;
843 else
844 {
845 struct pkt_rx_element *head;
846 int pad_len, buf_max;
847
848 head = (struct pkt_rx_element*) pktq_in_buf (q);
849 memcpy (head->rx_buf, pkt + hdr_len, cap_len);
850
851 /* The NPF.SYS timestamp is very unrealiable. So we simply use
852 * QueryPerformanceCounter() as it is now.
853 */
854 head->tstamp_put = win_get_perf_count();
855 head->rx_length = cap_len;
856
857 /* zero-pad up to ETH_MAX (don't destroy marker at end)
858 */
859 buf_max = q->buf_size - RX_ELEMENT_HEAD_SIZE - 4;
860 pad_len = min (ETH_MAX, buf_max - cap_len);
861 if (pad_len > 0)
862 memset (&head->rx_buf[cap_len], 0, pad_len);
863 pktq_inc_in (q);
864 }
865 }
866 LEAVE_CRIT();
867 }
868
869 TRACE_CONSOLE (2, "winpcap_recv_thread(): rc %d\n", rc);
870 fflush (stdout);
871 ARGSUSED (arg);
872 thr_stopped = TRUE;
873 return (rc);
874}
875
879static void swsvpkt_callback (struct SwsVpktUsr *usr, const void *buf, unsigned len)
880{
881 struct pkt_ringbuf *q;
882 struct pkt_rx_element *head;
883
884 q = &_pkt_inf->pkt_queue;
885
886 ENTER_CRIT();
887
888 TRACE_CONSOLE (2, "swsvpkt_callback(): len %d, in-idx %d\n", len, q->in_index);
889
890 if (len > ETH_MAX)
891 {
892 _pkt_inf->error = "Large size";
893 STAT (macstats.num_too_large++);
894 }
895 else if (pktq_in_index(q) == q->out_index) /* queue is full, drop it */
896 {
897 q->num_drop++;
898 TRACE_CONSOLE (2, "swsvpkt_callback(): num_drop %lu\n", (u_long)q->num_drop);
899 }
900 else
901 {
902 int pad_len, buf_max;
903
904 head = (struct pkt_rx_element*) pktq_in_buf (q);
905 memcpy (head->rx_buf, buf, len);
906 head->rx_length = len;
907 head->tstamp_put = win_get_perf_count();
908
909 /* zero-pad up to ETH_MAX (don't destroy marker at end)
910 */
911 buf_max = q->buf_size - RX_ELEMENT_HEAD_SIZE - 4;
912 pad_len = min (ETH_MAX, buf_max - len);
913 if (pad_len > 0)
914 memset (&head->rx_buf[len], 0, pad_len);
915 pktq_inc_in (q);
916 }
917 ARGSUSED (usr);
918 LEAVE_CRIT();
919}
920
921/*
922 * Poll the tail of queue
923 */
924struct pkt_rx_element *pkt_poll_recv (void)
925{
926 struct pkt_ringbuf *q;
927 struct pkt_rx_element *rc = NULL;
928 const char *out;
929 BOOL empty;
930
931 if (!_pkt_inf)
932 return (NULL);
933
934#if defined(_DEBUG) || defined(USE_ASAN)
935 /*
936 * Some strange issue sometimes causes
937 * winpcap_recv_thread() to return prematurely.
938 */
939 DWORD status = 0;
940
941 GetExitCodeThread (_pkt_inf->recv_thread, &status);
942 if (status != STILL_ACTIVE && !thr_stopped)
943 {
944 TRACE_CONSOLE (1, "winpcap_recv_thread() is dead. status: %lXh\n", status);
945 _pkt_inf->thread_stopped = 1;
946 Sleep (100);
947 }
948#endif
949
950 ENTER_CRIT();
951
952 q = &_pkt_inf->pkt_queue;
953 out = pktq_out_buf (q);
954 empty = (q->in_index == q->out_index);
955
956 LEAVE_CRIT();
957
958 if (!empty)
959 {
960 rc = (struct pkt_rx_element*) out;
961 rc->tstamp_get = win_get_perf_count();
962 }
963 return (rc);
964}
965
966/*
967 * Our WinPcap/SwsVpkt send function.
968 * Not sure if partial writes are possible with NPF. Retry if rc != length.
969 */
970int W32_CALL pkt_send (const void *tx, int length)
971{
972 int tx_cnt, rc = 0;
973
974 ASSERT_PKT_INF (0);
975
976 PROFILE_START ("pkt_send");
977
978 for (tx_cnt = 1 + pkt_txretries; tx_cnt > 0; tx_cnt--)
979 {
980#if 1
981 WATT_ASSERT (_pkt_inf->send_op);
982 rc = (*_pkt_inf->send_op) (_pkt_inf->adapter, tx, length);
983 if (rc == length)
984 break;
985#else
986 struct SwsVpktUsr *sws_usr = (struct SwsVpktUsr*) _pkt_inf->adapter;
987 const ADAPTER *adapter = (const ADAPTER*) _pkt_inf->adapter;
988
989 if (_eth_SwsVpkt ? SwsVpktSend(sws_usr, tx, length) :
990 PacketSendPacket(adapter, tx, length))
991 {
992 rc = length;
993 break;
994 }
995#endif
996 STAT (macstats.num_tx_retry++);
997 }
998
999 if (rc == length)
1000 {
1001 num_tx_pkt++;
1002 num_tx_bytes += length;
1003 }
1004 else
1005 {
1006 num_tx_errors++; /* local copy */
1007 STAT (macstats.num_tx_err++);
1008 }
1009 PROFILE_STOP();
1010 return (rc);
1011}
1012
1013/*
1014 * Sets the receive mode of the WinPcap interface.
1015 */
1016int W32_CALL pkt_set_rcv_mode (int mode)
1017{
1018 struct {
1019 PACKET_OID_DATA oidData;
1020 DWORD filter;
1021 } oid;
1022 BOOL rc;
1023 const ADAPTER *adapter;
1024
1025 if (!_pkt_inf || _eth_SwsVpkt)
1026 return (0);
1027
1028 adapter = (const ADAPTER*) _pkt_inf->adapter;
1029
1030 memset (&oid, 0, sizeof(oid));
1031 oid.oidData.Oid = OID_GEN_CURRENT_PACKET_FILTER;
1032 oid.oidData.Length = sizeof(oid.filter);
1033 *(DWORD*)oid.oidData.Data = mode;
1034 rc = PacketRequest (adapter, TRUE, &oid.oidData);
1035 if (rc)
1036 _pkt_rxmode = mode;
1037 else _pkt_errno = GetLastError();
1038
1039 TRACE_CONSOLE (2, "pkt_set_rcv_mode(); mode 0x%02X, rc %d; %s\n",
1040 mode, rc, !rc ? win_strerror(GetLastError()) : "okay");
1041 return (rc);
1042}
1043
1044/*
1045 * Gets the receive mode of the WinPcap interface.
1046 * \retval !0 Okay - _pkt_errno = 0, _pkt_rxmode and retval is current mode.
1047 * \retval 0 Error - _pkt_errno = GetLastError().
1048 */
1049int W32_CALL pkt_get_rcv_mode (void)
1050{
1051 struct {
1052 PACKET_OID_DATA oidData;
1053 DWORD filter;
1054 } oid;
1055 DWORD mode;
1056 BOOL rc;
1057 const ADAPTER *adapter;
1058
1059 if (!_pkt_inf || _eth_SwsVpkt)
1060 return (0);
1061
1062 adapter = (const ADAPTER*) _pkt_inf->adapter;
1063
1064 memset (&oid, 0, sizeof(oid));
1065 oid.oidData.Oid = OID_GEN_CURRENT_PACKET_FILTER;
1066 oid.oidData.Length = sizeof(oid.filter);
1067 rc = PacketRequest (adapter, FALSE, &oid.oidData);
1068 mode = *(DWORD*)oid.oidData.Data;
1069 if (rc)
1070 _pkt_rxmode = mode;
1071 else _pkt_errno = GetLastError();
1072 return (rc);
1073}
1074
1075static BOOL get_stats_pcap (const void *a,
1076 struct PktStats *stats,
1077 struct PktStats *total)
1078{
1079 const ADAPTER *adapter = a;
1080 struct {
1081 PACKET_OID_DATA oidData;
1082 DWORD value;
1083 } oid;
1084 struct bpf_stat b_stats;
1085 DWORD count[4];
1086
1087 memset (total, 0, sizeof(*total)); /* we don't know yet */
1088 memset (&count, 0, sizeof(count));
1089
1090 if (!PacketGetStatsEx(adapter,&b_stats))
1091 return (FALSE);
1092
1093 /* Query: OID_GEN_RCV_OK, OID_GEN_RCV_ERROR
1094 * OID_GEN_XMIT_OK, OID_GEN_XMIT_ERROR
1095 */
1096 memset (&oid, 0, sizeof(oid));
1097 oid.oidData.Oid = OID_GEN_RCV_OK;
1098 oid.oidData.Length = sizeof(oid.value);
1099 if (!PacketRequest(adapter, FALSE, &oid.oidData))
1100 goto no_total;
1101 count[0] = *(DWORD*) &oid.oidData.Data;
1102
1103 memset (&oid, 0, sizeof(oid));
1104 oid.oidData.Oid = OID_GEN_XMIT_OK;
1105 oid.oidData.Length = sizeof(oid.value);
1106 if (!PacketRequest(adapter, FALSE, &oid.oidData))
1107 goto no_total;
1108 count[1] = *(DWORD*) &oid.oidData.Data;
1109
1110 memset (&oid, 0, sizeof(oid));
1111 oid.oidData.Oid = OID_GEN_RCV_ERROR;
1112 oid.oidData.Length = sizeof(oid.value);
1113 if (!PacketRequest(adapter, FALSE, &oid.oidData))
1114 goto no_total;
1115 count[2] = *(DWORD*) &oid.oidData.Data;
1116
1117 memset (&oid, 0, sizeof(oid));
1118 oid.oidData.Oid = OID_GEN_XMIT_ERROR;
1119 oid.oidData.Length = sizeof(oid.value);
1120 if (!PacketRequest (adapter, FALSE, &oid.oidData))
1121 goto no_total;
1122 count[3] = *(DWORD*) &oid.oidData.Data;
1123
1124no_total:
1125 total->in_packets = count[0];
1126 total->out_packets = count[1];
1127 total->in_errors = count[2];
1128 total->out_errors = count[3];
1129
1130 stats->in_packets = num_rx_pkt; /* !! b_stats.bs_recv */
1131 stats->in_bytes = num_rx_bytes;
1132 stats->out_packets = num_tx_pkt;
1133 stats->out_bytes = num_tx_bytes;
1134 stats->in_errors = 0UL;
1135 stats->out_errors = num_tx_errors;
1136 stats->lost = b_stats.bs_drop + b_stats.ps_ifdrop;
1137 return (TRUE);
1138}
1139
1140static BOOL get_stats_swsvpkt (const void *usr,
1141 struct PktStats *stats,
1142 struct PktStats *total)
1143{
1144 memset (stats, 0, sizeof(*stats));
1145 memset (total, 0, sizeof(*total)); /* not known */
1146 return SwsVpktGetStatistics ((const struct SwsVpktUsr*)usr, stats);
1147}
1148
1149/*
1150 * Return traffic statistics since started (stats) and
1151 * total since adapter was opened (total).
1152 *
1153 * \note 'stats' only count traffic we received and transmitted.
1154 */
1155int W32_CALL pkt_get_stats (struct PktStats *stats, struct PktStats *total)
1156{
1157 if (!_pkt_inf || !_pkt_inf->get_stats_op)
1158 return (0);
1159 return (*_pkt_inf->get_stats_op) (_pkt_inf->adapter, stats, total);
1160}
1161
1162DWORD W32_CALL pkt_dropped (void)
1163{
1164 if (_pkt_inf)
1165 return (_pkt_inf->pkt_queue.num_drop);
1166 return (pkt_drop_cnt); /* return last known value */
1167}
1168
1169int W32_CALL pkt_get_mtu (void)
1170{
1171 DWORD MTU;
1172
1173 if (get_interface_mtu(&MTU))
1174 return (MTU);
1175 return (0);
1176}
1177
1178const char * W32_CALL pkt_strerror (int code)
1179{
1180 ARGSUSED (code);
1181
1191 return (NULL);
1192}
1193
1194#if defined(USE_MULTICAST)
1195/*
1196 * Don't think we need to support this since we can use promiscous mode
1197 */
1198int pkt_get_multicast_list (mac_address *listbuf, int *len)
1199{
1200 _pkt_errno = PDERR_NO_MULTICAST;
1201 *len = 0;
1202 ARGSUSED (listbuf);
1203 ARGSUSED (len);
1204 return (0);
1205}
1206
1207int pkt_set_multicast_list (const void *listbuf, int len)
1208{
1209 _pkt_errno = PDERR_NO_MULTICAST;
1210 ARGSUSED (listbuf);
1211 ARGSUSED (len);
1212 return (0);
1213}
1214#endif
1215
1216
1217/*
1218 * Low-level NDIS/Mini-driver functions.
1219 */
1220static BOOL get_perm_mac_address (void *mac)
1221{
1222 if (!_pkt_inf || !_pkt_inf->get_mac_op)
1223 return (FALSE);
1224 memset (mac, '\0', sizeof(mac_address));
1225 return (*_pkt_inf->get_mac_op) (_pkt_inf->adapter, mac);
1226}
1227
1228static BOOL get_if_mtu_pcap (const void *a, DWORD *mtu)
1229{
1230 const ADAPTER *adapter = a;
1231 struct {
1232 PACKET_OID_DATA oidData;
1233 DWORD mtu;
1234 } oid;
1235
1236 memset (&oid, 0, sizeof(oid));
1237 oid.oidData.Oid = OID_GEN_MAXIMUM_TOTAL_SIZE;
1238 oid.oidData.Length = sizeof(oid.mtu);
1239
1240 if (!PacketRequest(adapter, FALSE, &oid.oidData))
1241 return (FALSE);
1242 *mtu = *(DWORD*) &oid.oidData.Data;
1243 return (TRUE);
1244}
1245
1246static BOOL get_if_mtu_generic (const void *a, DWORD *mtu)
1247{
1248 const void *adapter = a;
1249 *mtu = ETH_MAX;
1250 ARGSUSED (adapter);
1251 return (TRUE);
1252}
1253
1254static BOOL get_interface_mtu (DWORD *mtu)
1255{
1256 if (!_pkt_inf || !_pkt_inf->get_if_mtu_op)
1257 return (FALSE);
1258 return (*_pkt_inf->get_if_mtu_op) (_pkt_inf->adapter, mtu);
1259}
1260
1261static BOOL get_if_type_pcap (const void *a, WORD *type)
1262{
1263 const ADAPTER *adapter = a;
1264 struct {
1265 PACKET_OID_DATA oidData;
1266 DWORD link;
1267 } oid;
1268
1269 memset (&oid, 0, sizeof(oid));
1270 oid.oidData.Oid = OID_GEN_MEDIA_IN_USE;
1271 oid.oidData.Length = sizeof(oid.link);
1272
1273 if (!PacketRequest(adapter, FALSE, &oid.oidData))
1274 return (FALSE);
1275 *type = *(WORD*) &oid.oidData.Data;
1276 return (TRUE);
1277}
1278
1279static BOOL get_if_type_swsvpkt (const void *u, WORD *type)
1280{
1281 const struct SwsVpktUsr *usr = u;
1282
1283 *type = PDCLASS_ETHER;
1284 ARGSUSED (u);
1285 ARGSUSED (usr);
1286 return (TRUE);
1287}
1288
1289/* Query the NIC driver for the adapter description
1290 */
1291static BOOL get_descr_pcap (const void *a, char *buf, size_t max)
1292{
1293 const ADAPTER *adapter = a;
1294 struct {
1295 PACKET_OID_DATA oidData;
1296 char descr[512];
1297 } oid;
1298
1299 memset (&oid, 0, sizeof(oid));
1300 oid.oidData.Oid = OID_GEN_VENDOR_DESCRIPTION;
1301 oid.oidData.Length = sizeof(oid.descr);
1302
1303 if (!PacketRequest(adapter, FALSE, &oid.oidData))
1304 return (FALSE);
1305 strncpy (buf, (const char*)&oid.oidData.Data, max);
1306 return (TRUE);
1307}
1308
1309static BOOL get_descr_swsvpkt (const void *u, char *buf, size_t max)
1310{
1311 return SwsVpktGetDescription ((const struct SwsVpktUsr*) u, buf, max);
1312}
1313
1314static BOOL get_if_speed_pcap (const void *a, DWORD *Mbit_s)
1315{
1316 const ADAPTER *adapter = a;
1317 struct {
1318 PACKET_OID_DATA oidData;
1319 DWORD speed;
1320 } oid;
1321
1322 memset (&oid, 0, sizeof(oid));
1323 oid.oidData.Oid = OID_GEN_LINK_SPEED;
1324 oid.oidData.Length = sizeof(oid.speed);
1325
1326 if (!PacketRequest(adapter, FALSE, &oid.oidData))
1327 return (FALSE);
1328
1329 *Mbit_s = (*(DWORD*)&oid.oidData.Data) / 10000;
1330 return (TRUE);
1331}
1332
1333#if defined(USE_DEBUG)
1334static BOOL get_interface_speed (DWORD *speed)
1335{
1336 if (!_pkt_inf || !_pkt_inf->get_if_speed_op)
1337 return (FALSE);
1338 return (*_pkt_inf->get_if_speed_op) (_pkt_inf->adapter, speed);
1339}
1340
1341static BOOL get_phys_media (int *media)
1342{
1343 struct {
1344 PACKET_OID_DATA oidData;
1345 DWORD media;
1346 } oid;
1347 const ADAPTER *adapter;
1348
1349 if (!_pkt_inf || _eth_SwsVpkt)
1350 return (FALSE);
1351
1352 adapter = (const ADAPTER*) _pkt_inf->adapter;
1353 memset (&oid, 0, sizeof(oid));
1354 oid.oidData.Oid = OID_GEN_PHYSICAL_MEDIUM;
1355 oid.oidData.Length = sizeof(oid.media);
1356
1357 if (!PacketRequest(adapter, FALSE, &oid.oidData))
1358 return (FALSE);
1359 *media = *(int*) &oid.oidData.Data;
1360 return (TRUE);
1361}
1362#endif
1363
1364static BOOL get_if_stat_pcap (const void *a, BOOL *is_up)
1365{
1366 const ADAPTER *adapter = a;
1367 struct {
1368 PACKET_OID_DATA oidData;
1369 DWORD connected;
1370 } oid;
1371
1372 memset (&oid, 0, sizeof(oid));
1373 oid.oidData.Oid = OID_GEN_MEDIA_CONNECT_STATUS;
1374 oid.oidData.Length = sizeof(oid.connected);
1375
1376 if (!PacketRequest(adapter, FALSE, &oid.oidData))
1377 return (FALSE);
1378 *is_up = (*(DWORD*)&oid.oidData.Data == NdisMediaStateConnected);
1379 return (TRUE);
1380}
1381
1382static BOOL get_if_stat_swsvpkt (const void *u, BOOL *is_up)
1383{
1384 const struct SwsVpktUsr *usr = u;
1385 struct SwsVpktAdapterState state;
1386
1387 memset (&state, '\0', sizeof(state));
1388 if (!SwsVpktGetAdapterState(usr, &state))
1389 return (FALSE);
1390
1391 *is_up = (state.isMediaConnected) || (state.isWan && !state.isWanDown);
1392 return (TRUE);
1393}
1394
1395#ifdef NOT_USED
1396/*
1397 * NDIS has the annoying feature (?) of looping packets we send in
1398 * NDIS_PACKET_TYPE_ALL_LOCAL mode (the default?). Disable it, but
1399 * doesn't seem to have any effect yet. Maybe need to use a BPF filter?
1400 *
1401 * No need when using RXMODE_DEFAULT (9).
1402 */
1403static BOOL ndis_set_loopback (BOOL enable)
1404{
1405 struct {
1406 PACKET_OID_DATA oidData;
1407 DWORD options;
1408 } oid;
1409 const ADAPTER *adapter;
1410 BOOL rc;
1411 DWORD options;
1412 DWORD gen_oid = OID_GEN_MAC_OPTIONS;
1413 DWORD opt_bit = NDIS_MAC_OPTION_NO_LOOPBACK;
1414
1415 if (!_pkt_inf || _eth_SwsVpkt)
1416 return (FALSE);
1417
1418 adapter = (const ADAPTER*) _pkt_inf->adapter;
1419 memset (&oid, 0, sizeof(oid));
1420 oid.oidData.Oid = gen_oid;
1421 oid.oidData.Length = sizeof(oid.options);
1422
1423 /* Get current MAC/protocol options
1424 */
1425 rc = PacketRequest (adapter, FALSE, &oid.oidData);
1426 options = *(DWORD*) &oid.oidData.Data;
1427
1428 TRACE_CONSOLE (2, "ndis_set_loopback(); rc %d, options 0x%02lX; %s\n",
1429 rc, options, !rc ? win_strerror(GetLastError()) : "okay");
1430 if (enable)
1431 options &= ~opt_bit;
1432 else options |= opt_bit;
1433
1434 /* Set it back
1435 */
1436 memset (&oid, 0, sizeof(oid));
1437 oid.oidData.Oid = gen_oid;
1438 oid.oidData.Length = sizeof(oid.options);
1439 *(DWORD*) &oid.oidData.Data = options;
1440 rc = PacketRequest (adapter, TRUE, &oid.oidData);
1441
1442 TRACE_CONSOLE (2, "ndis_set_loopback(); rc %d; %s\n",
1443 rc, !rc ? win_strerror(GetLastError()) : "okay");
1444 return (rc);
1445}
1446#endif /* NOT_USED */
1447
1448
1449/*
1450 * Return NDIS version as MSB.LSB.
1451 */
1452int W32_CALL pkt_get_api_ver (WORD *ver_p)
1453{
1454 BOOL rc = FALSE;
1455
1456 if (!_pkt_inf)
1457 return (0);
1458
1459 if (_eth_SwsVpkt)
1460 {
1461 const struct SwsVpktUsr *sw_usr = _pkt_inf->adapter;
1462 DWORD ver = 0;
1463
1464 rc = SwsVpktGetNDISversion (sw_usr, &ver); /* This IOCTL always seems to fail */
1465 if (rc)
1466 *ver_p = (WORD)ver;
1467 }
1468 else if (_eth_winpcap || _eth_win10pcap)
1469 {
1470 struct {
1471 PACKET_OID_DATA oidData;
1472 DWORD version;
1473 } oid;
1474 const ADAPTER *adapter = (const ADAPTER*) _pkt_inf->adapter;
1475
1476 memset (&oid, 0, sizeof(oid));
1477 oid.oidData.Length = sizeof(oid.version);
1478 oid.oidData.Oid = OID_GEN_DRIVER_VERSION;
1479
1480 rc = PacketRequest (adapter, FALSE, &oid.oidData);
1481 if (rc)
1482 {
1483 WORD ver = *(WORD*) &oid.oidData.Data; /* There's only 16-bit valid in version */
1484 *ver_p = ver;
1485 }
1486 }
1487 return (rc);
1488}
1489
1490/*
1491 * Returns NPF.SYS/SwsVpkt.sys version as "major,minor,0,build" or
1492 * "major.minor.0.build" (8 bits each).
1493 */
1494int W32_CALL pkt_get_drvr_ver (WORD *major, WORD *minor, WORD *unused, WORD *build)
1495{
1496 const char *ver = (_pkt_inf && _pkt_inf->get_drv_ver_op) ?
1497 (*_pkt_inf->get_drv_ver_op)() : NULL;
1498 if (!ver)
1499 return (0);
1500
1501 if (sscanf(ver, "%hu,%hu,%hu,%hu", major, minor, unused, build) == 4 ||
1502 sscanf(ver, "%hu.%hu.%hu.%hu", major, minor, unused, build) == 4)
1503 return (1);
1504 return (0);
1505}
1506
1507/*
1508 * Returns name of driver; NPF.SYS, SwsVpkt.sys etc.
1509 */
1510const char * W32_CALL pkt_get_drvr_name (void)
1511{
1512 if (_pkt_inf)
1513 return (_pkt_inf->sys_drvr_name);
1514 return (NULL);
1515}
1516
1517/*
1518 * Returns low-level device-name of driver; "\Device\NPF_{..."
1519 */
1520const char * W32_CALL pkt_get_device_name (void)
1521{
1522 return (_pktdrvrname);
1523}
1524
1525/*
1526 * Return driver description
1527 */
1528const char * W32_CALL pkt_get_drvr_descr (void)
1529{
1530 return (_pktdrvr_descr);
1531}
1532
1533/*
1534 * Return driver class
1535 */
1536W32_FUNC WORD W32_CALL pkt_get_drvr_class (void)
1537{
1538 return (_pktdevclass);
1539}
1540
1544static enum eth_init_result open_winpcap_adapter (const char *name)
1545{
1546 const ADAPTER *adapter = PacketOpenAdapter (name);
1547
1548 if (!adapter)
1549 {
1550 (*_printf) (_LANG("PacketOpenAdapter (\"%s\") failed:\n %s.\n"),
1551 name, win_strerror(GetLastError()));
1552 _pkt_errno = PDERR_NO_DRIVER;
1553 return (WERR_NO_DRIVER);
1554 }
1555
1556 _pkt_inf->adapter = adapter;
1557 _pkt_inf->adapter_info = PacketFindAdInfo (name);
1558 _pkt_inf->init_op = PacketInitModule;
1559 _pkt_inf->close_op = (func_close) PacketCloseAdapter;
1560 _pkt_inf->send_op = (func_send) PacketSendPacket;
1561 _pkt_inf->recv_op = (func_recv) PacketReceivePacket;
1562 _pkt_inf->get_mac_op = (func_get_mac) PacketGetMacAddress;
1563 _pkt_inf->get_stats_op = get_stats_pcap;
1564 _pkt_inf->get_if_stat_op = get_if_stat_pcap;
1565 _pkt_inf->get_if_type_op = get_if_type_pcap;
1566 _pkt_inf->get_if_speed_op = get_if_speed_pcap;
1567 _pkt_inf->get_if_mtu_op = get_if_mtu_pcap;
1568 _pkt_inf->get_descr_op = get_descr_pcap;
1569 _pkt_inf->get_drv_ver_op = PacketGetDriverVersion;
1570 _pkt_inf->api_name = "WinPcap";
1571 _pkt_inf->sys_drvr_name = "NPF.sys";
1572
1573 return (WERR_NO_ERROR);
1574}
1575
1579static enum eth_init_result open_npcap_adapter (const char *name)
1580{
1581 const ADAPTER *adapter = PacketOpenAdapter (name);
1582
1583 if (!adapter)
1584 {
1585 (*_printf) (_LANG("PacketOpenAdapter (\"%s\") failed:\n %s.\n"),
1586 name, win_strerror(GetLastError()));
1587 _pkt_errno = PDERR_NO_DRIVER;
1588 return (WERR_NO_DRIVER);
1589 }
1590
1591 _pkt_inf->adapter = adapter;
1592 _pkt_inf->adapter_info = PacketFindAdInfo (name);
1593 _pkt_inf->init_op = PacketInitModule;
1594 _pkt_inf->close_op = (func_close) PacketCloseAdapter;
1595 _pkt_inf->send_op = (func_send) PacketSendPacket;
1596 _pkt_inf->recv_op = (func_recv) PacketReceivePacket;
1597 _pkt_inf->get_mac_op = (func_get_mac) PacketGetMacAddress;
1598 _pkt_inf->get_stats_op = get_stats_pcap;
1599 _pkt_inf->get_if_stat_op = get_if_stat_pcap;
1600 _pkt_inf->get_if_type_op = get_if_type_pcap;
1601 _pkt_inf->get_if_speed_op = get_if_speed_pcap;
1602 _pkt_inf->get_if_mtu_op = get_if_mtu_pcap;
1603 _pkt_inf->get_descr_op = get_descr_pcap;
1604 _pkt_inf->get_drv_ver_op = PacketGetDriverVersion;
1605 _pkt_inf->api_name = "NPcap";
1606 _pkt_inf->sys_drvr_name = "NPCAP.sys";
1607
1608 return (WERR_NO_ERROR);
1609}
1610
1614static enum eth_init_result open_win10pcap_adapter (const char *name)
1615{
1616 const ADAPTER *adapter = PacketOpenAdapter (name);
1617
1618 if (!adapter)
1619 {
1620 (*_printf) (_LANG("PacketOpenAdapter (\"%s\") failed:\n %s.\n"),
1621 name, win_strerror(GetLastError()));
1622 _pkt_errno = PDERR_NO_DRIVER;
1623 return (WERR_NO_DRIVER);
1624 }
1625
1626 _pkt_inf->adapter = adapter;
1627 _pkt_inf->adapter_info = PacketFindAdInfo (name);
1628 _pkt_inf->init_op = PacketInitModule;
1629 _pkt_inf->close_op = (func_close) PacketCloseAdapter;
1630 _pkt_inf->send_op = (func_send) PacketSendPacket;
1631 _pkt_inf->recv_op = (func_recv) PacketReceivePacket;
1632 _pkt_inf->get_mac_op = (func_get_mac) PacketGetMacAddress;
1633 _pkt_inf->get_stats_op = get_stats_pcap;
1634 _pkt_inf->get_if_stat_op = get_if_stat_pcap;
1635 _pkt_inf->get_if_type_op = get_if_type_pcap;
1636 _pkt_inf->get_if_speed_op = get_if_speed_pcap;
1637 _pkt_inf->get_if_mtu_op = get_if_mtu_pcap;
1638 _pkt_inf->get_descr_op = get_descr_pcap;
1639 _pkt_inf->get_drv_ver_op = PacketGetDriverVersion;
1640 _pkt_inf->api_name = "Win10Pcap";
1641 _pkt_inf->sys_drvr_name = "Win10Pcap.sys";
1642
1643 return (WERR_NO_ERROR);
1644}
1645
1649static enum eth_init_result open_wanpacket_adapter (const char *name)
1650{
1651 WAN_ADAPTER *ad;
1652
1654 (*_printf) ("adapter-name: %s\n", name);
1655
1656 ad = WanPacketOpenAdapter();
1657 if (!ad)
1658 {
1659 _pkt_errno = PDERR_NO_DRIVER;
1660 return (WERR_PKT_ERROR);
1661 }
1662
1663 UNFINISHED();
1664
1665#if 0 // !!
1666 if (ad)
1667 ad->flags = INFO_FLAG_NDISWAN_ADAPTER;
1668#endif
1669
1670 _pkt_inf->get_if_mtu_op = get_if_mtu_generic;
1671 _pkt_inf->get_drv_ver_op = NULL;
1672 _pkt_inf->api_name = "WanPacket";
1673 _pkt_inf->sys_drvr_name = "wanpacket.dll";
1674
1675 return (WERR_NO_ERROR);
1676}
1677
1681static enum eth_init_result open_swsvpkt_adapter (const char *name)
1682{
1683 struct SwsVpktOpenInfo sw_open;
1684 const struct SwsVpktUsr *sw_usr;
1685
1686 sw_open.uRxBufs = pkt_num_rx_bufs;
1687 sw_open.pfnRx = swsvpkt_callback;
1688 sw_usr = SwsVpktOpen (name, &sw_open);
1689 if (!sw_usr)
1690 {
1691 (*_printf) (_LANG("SwsVpktOpen (\"%s\") failed:\n %s.\n"),
1692 name, win_strerror(GetLastError()));
1693 _pkt_errno = PDERR_NO_DRIVER;
1694 return (WERR_NO_DRIVER);
1695 }
1696 _pkt_inf->adapter = sw_usr;
1697 _pkt_inf->send_op = (func_send) SwsVpktSend;
1698 _pkt_inf->close_op = (func_close) SwsVpktClose;
1699 _pkt_inf->get_mac_op = (func_get_mac) SwsVpktGetMacAddress;
1700 _pkt_inf->get_descr_op = get_descr_swsvpkt;
1701 _pkt_inf->get_stats_op = get_stats_swsvpkt;
1702 _pkt_inf->get_if_mtu_op = get_if_mtu_generic;
1703 _pkt_inf->get_if_type_op = get_if_type_swsvpkt;
1704 _pkt_inf->get_if_stat_op = get_if_stat_swsvpkt;
1705 _pkt_inf->get_drv_ver_op = SwsVpktGetDriverVersion;
1706 _pkt_inf->api_name = "SwsVpkt";
1707 _pkt_inf->sys_drvr_name = "SwsVpkt.sys";
1708
1709 return (WERR_NO_ERROR);
1710}
1711
1712/*
1713 * Show some WinPcap adapter details.
1714 * The IP-address, netmask etc. are what Winsock uses. We ignore
1715 * them and use what WATTCP.CFG specifies.
1716 */
1717static void show_link_details (void)
1718{
1719#if defined(USE_DEBUG)
1720 const ADAPTER_INFO *ai;
1721 int i, phy;
1722 BOOL is_up;
1723 DWORD MTU, speed;
1724 WORD ver;
1725 mac_address mac;
1726
1727 if (!_pkt_inf || !_pkt_inf->adapter_info)
1728 return;
1729
1730 ai = (const ADAPTER_INFO*) _pkt_inf->adapter_info;
1731 if (!ai)
1732 {
1733 (*_printf) (" not available\n");
1734 return;
1735 }
1736
1737 (*_printf) (" %d network address%s:\n",
1738 ai->NNetworkAddresses, ai->NNetworkAddresses > 1 ? "es" : "");
1739
1740 for (i = 0; i < ai->NNetworkAddresses; i++)
1741 {
1742 const npf_if_addr *if_addr = ai->NetworkAddresses + i;
1743 const struct sockaddr_in *ip_addr = (const struct sockaddr_in*) &if_addr->IPAddress;
1744 const struct sockaddr_in *netmask = (const struct sockaddr_in*) &if_addr->SubnetMask;
1745 const struct sockaddr_in *brdcast = (const struct sockaddr_in*) &if_addr->Broadcast;
1746
1747 (*_printf) (" IP-addr %s", inet_ntoa(ip_addr->sin_addr));
1748 (*_printf) (", netmask %s", inet_ntoa(netmask->sin_addr));
1749 (*_printf) (", broadcast %s\n", inet_ntoa(brdcast->sin_addr));
1750 }
1751 if (ai->NNetworkAddresses <= 0)
1752 (*_printf) ("\n");
1753
1754 if (get_perm_mac_address(&mac))
1755 (*_printf) (" MAC-addr %s, ", MAC_address(&mac));
1756
1757 if (get_interface_mtu(&MTU))
1758 (*_printf) ("MTU %lu, ", (u_long)MTU);
1759
1760 (*_printf) ("link-type %s, ",
1761 list_lookup(_pktdevclass, logical_media, DIM(logical_media)));
1762
1763 if (get_phys_media(&phy))
1764 (*_printf) (" over %s, ", list_lookup(phy, phys_media, DIM(phys_media)));
1765
1766 if (_pkt_inf->get_if_stat_op &&
1767 (*_pkt_inf->get_if_stat_op) (_pkt_inf->adapter, &is_up))
1768 (*_printf) ("%s, ", is_up ? "UP" : "DOWN");
1769
1770 if (get_interface_speed(&speed))
1771 (*_printf) ("%luMb/s, ", (u_long)speed);
1772
1773 if (pkt_get_api_ver(&ver))
1774 (*_printf) ("NDIS %u.%u", hiBYTE(ver), loBYTE(ver));
1775 (*_printf) ("\n");
1776#endif
1777}
1778#endif /* WIN32 || _WIN32 || __CYGWIN__ */
1779
inet.h
language.h
_watt_fatal_error
BOOL _watt_fatal_error
Definition: misc.c:73
fopen_excl
FILE * fopen_excl(const char *file, const char *mode)
WIN32: Open an existing file (or create) in share-mode but deny other processes to write to the file.
Definition: misc.c:453
MAC_address
const char * MAC_address(const void *addr)
Return hexa-decimal string for an 6/7 byte MAC-address.
Definition: misc.c:997
list_lookup
const char * list_lookup(DWORD type, const struct search_list *list, int num)
Search 'list' for 'type' and return it's name.
Definition: misc.c:963
misc.h
_watt_is_win9x
BOOL _watt_is_win9x
Definition: winmisc.c:49
strrtrim
char * strrtrim(char *s)
Return pointer to string with trailing blanks (space/tab) removed.
Definition: misc_str.c:262
_strlcpy
char * _strlcpy(char *dst, const char *src, size_t len)
Similar to strncpy(), but always returns 'dst' with 0-termination.
Definition: misc_str.c:230
misc_str.h
strerror
char *MS_CDECL strerror(int errnum)
For Win32/Win64, this doesn't replace the strerror() in the Runtime Library, but replacing sys_nerr (...
Definition: neterr.c:207
expand_var_str
const char * expand_var_str(const char *str)
Return a string with a environment variable expanded (only one).
Definition: pcconfig.c:234
pcconfig.h
pcdbug.h
_pktserial
BOOL _pktserial
using serial driver, SLIP/PPP
Definition: pcpkt.c:51
_pkt_ip_ofs
WORD _pkt_ip_ofs
ofs from link-layer head to ip
Definition: pcpkt.c:49
_pkt_errno
int _pkt_errno
error code set in pcpkt.c API
Definition: pcpkt.c:55
_pktdevclass
WORD _pktdevclass
Ethernet, Token, FDDI etc.
Definition: pcpkt.c:48
pcpkt.h
RXMODE_OFF
@ RXMODE_OFF
turn off receiver
Definition: pcpkt.h:109
RXMODE_PROMISCOUS
@ RXMODE_PROMISCOUS
receive all packets on network
Definition: pcpkt.h:114
RXMODE_DIRECT
@ RXMODE_DIRECT
receive only to this interface
Definition: pcpkt.h:110
RXMODE_BROADCAST
@ RXMODE_BROADCAST
DIRECT + broadcast packets
Definition: pcpkt.h:111
RXMODE_MULTICAST2
@ RXMODE_MULTICAST2
BROADCAST + all multicast
Definition: pcpkt.h:113
RXMODE_MULTICAST1
@ RXMODE_MULTICAST1
BROADCAST + limited multicast
Definition: pcpkt.h:112
_eth_win10pcap
BOOL _eth_win10pcap
for Win32 using an Win10Pcap adapter
Definition: pcsed.c:59
_eth_wanpacket
BOOL _eth_wanpacket
for Win32 using an WanPacket adapter
Definition: pcsed.c:58
_eth_winpcap
BOOL _eth_winpcap
for Win32 using an WinPcap or NPcap adapter (default)
Definition: pcsed.c:60
_eth_SwsVpkt
BOOL _eth_SwsVpkt
for DOS and Win32 programs
Definition: pcsed.c:57
pcstat.h
profile.h
_watt_no_config
BOOL _watt_no_config
run with no config file (embedded/diskless)
Definition: sock_ini.c:134
sock_ini.h
ADAPTER_INFO
Contains some information about a network adapter.
Definition: packet32.h:184
ADAPTER
Describes an opened network adapter.
Definition: packet32.h:194
PACKET_OID_DATA
Structure containing an OID request.
Definition: packet32.h:218
PktStats
Definition: tcp.h:806
SwsVpktAdapterState
Definition: swsvpkt.h:96
SwsVpktOpenInfo
Definition: swsvpkt.h:91
SwsVpktUsr
Definition: swsvpkt.h:81
bpf_hdr
Berkeley Packet Filter header.
Definition: packet32.h:241
bpf_stat
Definition: packet32.h:251
code
Definition: zinftree.h:24
config_table
Definition: tcp.h:461
eth_Header
Definition: pcsed.h:20
fddi_Header
Definition: pcsed.h:149
npf_if_addr
Addresses of a network adapter.
Definition: packet32.h:168
pkt_info
Placeholder for vital data accessed by capture thread.
Definition: pcpkt.h:206
pkt_ringbuf
FIFO style ring-buffer.
Definition: pcqueue.h:81
pkt_ringbuf::num_drop
volatile DWORD num_drop
number of dropped pkts
Definition: pcqueue.h:86
pkt_ringbuf::out_index
WORD out_index
index of buffer pulled out
Definition: pcqueue.h:83
pkt_ringbuf::in_index
volatile WORD in_index
index ahead of last buffer put
Definition: pcqueue.h:82
pkt_ringbuf::buf_size
WORD buf_size
size of each buffer
Definition: pcqueue.h:84
pkt_rx_element
Definition: pcqueue.h:54
search_list
Definition: misc.h:131
sockaddr_in
Definition: in.h:224
tok_Header
Definition: pcsed.h:70
swsvpkt.h
ARG_STRCPY
@ ARG_STRCPY
copy string value
Definition: tcp.h:456
ARG_ATOX_W
@ ARG_ATOX_W
convert to hex-word
Definition: tcp.h:453
ARG_ATOB
@ ARG_ATOB
convert to 8-bit byte
Definition: tcp.h:449
ARG_FUNC
@ ARG_FUNC
call convertion function
Definition: tcp.h:458
ARG_ATOI
@ ARG_ATOI
convert to int
Definition: tcp.h:448
timer.h
w32_ndis.h
wattcp.h
Core definitions.
win_dll.h
win_strerror
char *W32_CALL win_strerror(DWORD err)
Return err-number and string for 'err'.
Definition: winmisc.c:208
open_npcap_adapter
static enum eth_init_result open_npcap_adapter(const char *name)
Open the NPcap device by 'name'.
Definition: winpkt.c:1579
pkt_release
int W32_CALL pkt_release(void)
Definition: winpkt.c:601
legal_recv_mode
static BOOL legal_recv_mode(WORD bits)
Check receive-mode 'bits' for an illegal bit by turning all legal bits off.
Definition: winpkt.c:358
set_txmode
static void set_txmode(const char *value)
Select async (overlapping) tx-mode.
Definition: winpkt.c:760
find_winpcap_adapter
static BOOL find_winpcap_adapter(char *aname, size_t size)
Traverse 'adapters_list' and select 1st device with an IPv4 address.
Definition: winpkt.c:268
open_winpcap_adapter
static enum eth_init_result open_winpcap_adapter(const char *name)
Open the WinPcap or NPcap device by 'name'.
Definition: winpkt.c:1544
open_swsvpkt_adapter
static enum eth_init_result open_swsvpkt_adapter(const char *name)
Open the named SwsVpkt device.
Definition: winpkt.c:1681
get_if_type_swsvpkt
static BOOL get_if_type_swsvpkt(const void *u, WORD *type)
Definition: winpkt.c:1279
_pkt_rxmode0
int _pkt_rxmode0
startup receive mode
Definition: winpkt.c:90
open_wanpacket_adapter
static enum eth_init_result open_wanpacket_adapter(const char *name)
Open the named WanPacket device.
Definition: winpkt.c:1649
pkt_dropped
DWORD W32_CALL pkt_dropped(void)
Return number of packets dropped.
Definition: winpkt.c:1162
pkt_get_multicast_list
int pkt_get_multicast_list(mac_address *listbuf, int *len)
Gets the current list of multicast addresses from the PKTDRVR.
Definition: winpkt.c:1198
pkt_get_addr
int W32_CALL pkt_get_addr(mac_address *eth)
Return the MAC address.
Definition: winpkt.c:663
pkt_eth_init
int W32_CALL pkt_eth_init(mac_address *mac_addr)
Initialise one of WinPcap, SwsVpkt, Win10Pcap, NPcap or WanPacket and return our MAC address.
Definition: winpkt.c:388
pkt_get_mtu
int W32_CALL pkt_get_mtu(void)
Return PKTDRVR maximum-transmit-units (MTU).
Definition: winpkt.c:1169
pkt_waiting
int W32_CALL pkt_waiting(void)
Return number of packets waiting in queue.
Definition: winpkt.c:722
_pkt_inf
struct pkt_info * _pkt_inf
module data that will be locked
Definition: winpkt.c:95
pkt_set_multicast_list
int pkt_set_multicast_list(const void *listbuf, int len)
Sets the list of multicast addresses for which the PKTDRVR is responsible.
Definition: winpkt.c:1207
_pkt_rxmode
int _pkt_rxmode
active receive mode
Definition: winpkt.c:89
pkt_free_pkt
void W32_CALL pkt_free_pkt(const void *pkt)
Release a packet from the receive queue.
Definition: winpkt.c:729
pkt_get_rcv_mode
int W32_CALL pkt_get_rcv_mode(void)
Gets the receive mode of the interface (can never be mode 0).
Definition: winpkt.c:1049
_pkt_forced_rxmode
int _pkt_forced_rxmode
wattcp.cfg receive mode
Definition: winpkt.c:91
pkt_set_rcv_mode
int W32_CALL pkt_set_rcv_mode(int mode)
Sets the receive mode of the interface.
Definition: winpkt.c:1016
swsvpkt_callback
static void swsvpkt_callback(struct SwsVpktUsr *, const void *, unsigned)
Our low-level SwsVpkt receive callback.
Definition: winpkt.c:879
pkt_get_api_ver
int W32_CALL pkt_get_api_ver(WORD *ver_p)
Return version of spec.
Definition: winpkt.c:1452
open_win10pcap_adapter
static enum eth_init_result open_win10pcap_adapter(const char *name)
Open the Win10Pcap device by 'name'.
Definition: winpkt.c:1614
pkt_get_stats
int W32_CALL pkt_get_stats(struct PktStats *stats, struct PktStats *total)
Get PKTDRVR statistics.
Definition: winpkt.c:1155
pkt_strerror
const char *W32_CALL pkt_strerror(int code)
Return textual error representing error-code.
Definition: winpkt.c:1178
winpcap_recv_thread
static DWORD __stdcall winpcap_recv_thread(void *arg)
Our low-level WinPcap capture thread.
Definition: winpkt.c:787
pkt_buf_wipe
int W32_CALL pkt_buf_wipe(void)
Clear the receive queue.
Definition: winpkt.c:715
pkt_get_drvr_ver
int W32_CALL pkt_get_drvr_ver(WORD *major, WORD *minor, WORD *unused, WORD *build)
Return version of PKTDRVR.
Definition: winpkt.c:1494
pkt_set_addr
int W32_CALL pkt_set_addr(const void *eth)
Set a new MAC source address.
Definition: winpkt.c:676
parse_config_pass_1
static BOOL parse_config_pass_1(void)
WATTCP.CFG parser for "WINPKT." keywords in WATTCP.CFG.
Definition: winpkt.c:238
find_adapter
static BOOL find_adapter(char *aname, size_t size)
Search for the first proper WinPcap or SwsVpkt device.
Definition: winpkt.c:327
pkt_send
int W32_CALL pkt_send(const void *tx, int length)
Send a link-layer frame.
Definition: winpkt.c:970
winpkt.h
RXMODE_ALL_LOCAL
@ RXMODE_ALL_LOCAL
NDIS_PACKET_TYPE_ALL_LOCAL (direct+bc+mc1)
Definition: winpkt.h:30


Watt-32 tcp/ip: E:/WATT/src/winpkt.h Source File

  • src
winpkt.h
Go to the documentation of this file.
1
5#ifndef _w32_WINPKT_H
6#define _w32_WINPKT_H
7
8#if !defined(_w32_PCPKT_H)
9#error Include this file inside or after pcpkt.h only.
10#endif
11
17#define PDERR_GEN_FAIL -1
18#define PDERR_NO_DRIVER -2
19#define PDERR_NO_CLASS -3
20#define PDERR_NO_MULTICAST -4
21#define PDERR_NO_SPACE -5
22
23enum ReceiveModes {
24 RXMODE_OFF = 0x00,
25 RXMODE_DIRECT = 0x01,
26 RXMODE_MULTICAST1 = 0x02,
27 RXMODE_MULTICAST2 = 0x04,
28 RXMODE_BROADCAST = 0x08,
29 RXMODE_PROMISCOUS = 0x20,
30 RXMODE_ALL_LOCAL = 0x80
31 /* we have no use for the other NDIS_PACKET_TYPE defs */
32 };
33
34/* NPF defaults to mode 0 after openening adapter.
35 */
36#define RXMODE_DEFAULT (RXMODE_DIRECT | RXMODE_BROADCAST)
37
38extern struct pkt_rx_element *pkt_poll_recv (void);
39
40#if defined(USE_MULTICAST)
41 extern int pkt_get_multicast_list (mac_address *listbuf, int *len);
42 extern int pkt_set_multicast_list (const void *listbuf, int len);
43#endif
44
45typedef BOOL (*func_init) (void);
46typedef void *(*func_open) (const char *name, ...);
47typedef BOOL (*func_close) (void *a);
48typedef UINT (*func_send) (const void *a, const void *buf, UINT buf_len); /* returns length of buf sent */
49typedef BOOL (*func_get_mac) (const void *a, const void *mac);
50typedef BOOL (*func_get_stats) (const void *a, struct PktStats *stats, struct PktStats *total);
51typedef BOOL (*func_get_if_stat) (const void *a, BOOL *up);
52typedef BOOL (*func_get_if_type) (const void *a, WORD *type);
53typedef BOOL (*func_get_if_mtu) (const void *a, DWORD *Mbit_s);
54typedef BOOL (*func_get_if_speed)(const void *a, DWORD *Mbit_s);
55typedef BOOL (*func_get_descr) (const void *a, char *descr, size_t max);
56typedef const char *(*func_get_drv_ver) (void);
57
58/* This func-ptr is used in 'winpcap_recv_thread()' outside of the
59 * critical region. Hence we force a 'cdecl' on MSVC since registers
60 * doesn't always seems to be preserved across thread-switches.
61 * See '\note' in 'winpcap_recv_thread()' docs.
62 */
63typedef UINT (MS_CDECL *func_recv) (const void *a, void *buf, UINT buf_len); /* returns length of buf received */
64
69struct pkt_info {
70 const void *adapter_info; /* opaque ADAPTER_INFO object (WinPcap only) */
71 const void *adapter; /* opaque ADAPTER or SwsVpktUsr object */
72 void *npf_buf; /* WinPcap: buffer for ReadFile() */
73 int npf_buf_size; /* WinPcap: size of above buffer */
74 HANDLE recv_thread; /* WinPcap: thread for capturing */
75 WORD pkt_ip_ofs; /* store length of MAC-header */
76 WORD pkt_type_ofs; /* offset to MAC-type */
77 volatile BOOL stop_thread; /* signal thread to stop */
78 volatile BOOL thread_stopped; /* did it stop gracefully? */
79
80 const char *api_name; /* "WinPcap", "SwsVpkt" etc. */
81 const char *sys_drvr_name; /* "NPF.sys", "SwsVpkt.sys" etc. */
82
83 /* Function pointers to transmit(), recv() etc. Depending
84 * on the type of low-level driver we use (NPF/SwsVpkt/WanPacket).
85 */
86 func_init init_op;
87 func_open open_op;
88 func_close close_op;
89 func_send send_op;
90 func_recv recv_op;
91 func_get_mac get_mac_op;
92 func_get_stats get_stats_op;
93 func_get_if_stat get_if_stat_op;
94 func_get_if_type get_if_type_op;
95 func_get_if_mtu get_if_mtu_op;
96 func_get_if_speed get_if_speed_op;
97 func_get_descr get_descr_op;
98 func_get_drv_ver get_drv_ver_op;
99
100 const char *error; /* Last error (NULL if none) */
101 struct pkt_ringbuf pkt_queue; /* Ring-struct for enqueueing */
102 struct pkt_rx_element rx_buf [RX_BUFS]; /* the receive buffer */
103 };
104
105extern char _pktdrvr_descr[];
106
107extern struct pkt_info *_pkt_inf;
108
109extern const char *winpkt_trace_func;
110extern const char *winpkt_trace_file;
111extern UINT winpkt_trace_line;
112extern UINT winpkt_trace_level;
113
114#if defined(USE_DEBUG)
115 /*
116 * Trace to file specified by 'winpkt.dumpfile'.
117 * I.e. above 'winpkt_trace_file'.
118 */
119 #define WINPKT_TRACE(args, ...) \
120 do { \
121 winpkt_trace_file = __FILE__; \
122 winpkt_trace_line = __LINE__; \
123 winpkt_trace (args, ## __VA_ARGS__); \
124 } while (0)
125
126 extern void winpkt_trace (_Printf_format_string_
127 const char *fmt, ...) W32_ATTR_PRINTF (1, 2);
128 extern void winpkt_trace_fclose (void);
129
130#else
131 #define WINPKT_TRACE(args, ...) ((void)0)
132#endif /* USE_DEBUG */
133
134#endif /* _w32_WINPKT_H */
ReceiveModes
ReceiveModes
Definition: pcpkt.h:108
PktStats
Definition: tcp.h:806
pkt_info
Placeholder for vital data accessed by capture thread.
Definition: pcpkt.h:206
pkt_ringbuf
FIFO style ring-buffer.
Definition: pcqueue.h:81
pkt_rx_element
Definition: pcqueue.h:54
pkt_get_multicast_list
int pkt_get_multicast_list(mac_address *listbuf, int *len)
Gets the current list of multicast addresses from the PKTDRVR.
Definition: pcpkt.c:2035
RXMODE_ALL_LOCAL
@ RXMODE_ALL_LOCAL
NDIS_PACKET_TYPE_ALL_LOCAL (direct+bc+mc1)
Definition: winpkt.h:30
RXMODE_OFF
@ RXMODE_OFF
possible to turn off?
Definition: winpkt.h:24
RXMODE_PROMISCOUS
@ RXMODE_PROMISCOUS
NDIS_PACKET_TYPE_PROMISCUOUS.
Definition: winpkt.h:29
RXMODE_DIRECT
@ RXMODE_DIRECT
NDIS_PACKET_TYPE_DIRECTED.
Definition: winpkt.h:25
RXMODE_BROADCAST
@ RXMODE_BROADCAST
NDIS_PACKET_TYPE_BROADCAST.
Definition: winpkt.h:28
RXMODE_MULTICAST2
@ RXMODE_MULTICAST2
NDIS_PACKET_TYPE_ALL_MULTICAST.
Definition: winpkt.h:27
RXMODE_MULTICAST1
@ RXMODE_MULTICAST1
NDIS_PACKET_TYPE_MULTICAST.
Definition: winpkt.h:26
_pkt_inf
struct pkt_info * _pkt_inf
module data that will be locked
Definition: pcpkt.c:61
pkt_set_multicast_list
int pkt_set_multicast_list(const void *listbuf, int len)
Sets the list of multicast addresses for which the PKTDRVR is responsible.
Definition: pcpkt.c:2082


Watt-32 tcp/ip: E:/WATT/inc/sys/wtime.h Source File

  • inc
  • sys
wtime.h
Go to the documentation of this file.
1
6#ifndef __SYS_WTIME_H
7#define __SYS_WTIME_H
8
9/*
10 * The naming <sys/wtime.h> is required for those compilers that
11 * have <sys/time.h> in the usual place but doesn't define
12 * the following.
13 */
14
15#include <time.h>
16
17#if defined(__HIGHC__) || defined(__BORLANDC__) || defined(_CRT_BEGIN_C_HEADER)
18#undef timezone /* a macro in HigHC, bcc 5+ or Win-Kit */
19#endif
20
21#if defined(__DJGPP__) || defined(__CYGWIN__)
22 #include <sys/time.h>
23 #include <sys/times.h>
24 #include <sys/types.h>
25
26#elif defined(__MINGW32__)
27 #include <sys/time.h>
28
29#else
30 struct timeval {
31 long tv_sec;
32 long tv_usec;
33 };
34 #define STRUCT_TIMEVAL_DEFINED
35#endif
36
37#ifndef __SYS_W32API_H
38#include <sys/w32api.h>
39#endif
40
41#ifndef __SYS_CDEFS_H
42#include <sys/cdefs.h>
43#endif
44
45#ifndef __SYS_WHIDE_H
46#include <sys/whide.h>
47#endif
48
49#ifdef __WATCOMC__
50#include <signal.h> /* Latest OpenWatcom has 'struct timespec' defined in <signal.h> */
51#endif
52
53#if !defined(__DJGPP__) && !defined(__CYGWIN__)
54 #if !defined(__MINGW32__)
55 struct timezone { /* Added in MinGW 3.1 */
56 int tz_minuteswest;
57 int tz_dsttime;
58 };
59 #endif
60
61 struct tms {
62 unsigned long tms_utime;
63 unsigned long tms_cstime;
64 unsigned long tms_cutime;
65 unsigned long tms_stime;
66 };
67 #define STRUCT_TIMEZONE_DEFINED
68 #define STRUCT_TMS_DEFINED
69
70 __BEGIN_DECLS
71
72 #define ITIMER_REAL 0
73 #define ITIMER_PROF 1
74
75 struct itimerval {
76 struct timeval it_interval; /* timer interval */
77 struct timeval it_value; /* current value */
78 };
79
80 W32_FUNC int W32_CALL getitimer (int, struct itimerval *);
81 W32_FUNC int W32_CALL setitimer (int, struct itimerval *, struct itimerval *);
82
83 #if !defined(__MINGW32__) /* Added in MinGW 3.1 */
84 W32_FUNC int W32_CALL gettimeofday (struct timeval *, struct timezone *);
85 #else
86 W32_FUNC int W32_CALL _w32_gettimeofday (struct timeval *, struct timezone *);
87 #endif
88
89 __END_DECLS
90
91#endif /* !__DJGPP__ && !__CYGWIN__ */
92
93/* 'struct timespec' hacks
94 */
95#if defined(_STRUCT_TIMESPEC) || defined(_TIMESPEC_DEFINED)
96 #define W32_HAVE_STRUCT_TIMESPEC
97
98#elif (defined(_MSC_VER) && _MSC_VER >= 1900) /* VC 2015 uclib */
99 #define W32_HAVE_STRUCT_TIMESPEC
100
101#elif (defined(__clang__) && _MSC_VER >= 1800) /* clang-cl 5.0+? */
102 #define W32_HAVE_STRUCT_TIMESPEC
103
104#elif defined(__POCC__) && ( __POCC_STDC_VERSION__ >= 201101L) /* PellesC */
105 #define W32_HAVE_STRUCT_TIMESPEC
106
107#elif defined(_pthread_signal_h) || defined(__CYGWIN__)
108 #define W32_HAVE_STRUCT_TIMESPEC
109
110#elif defined(__MINGW32__) /* MinGW 3.21 + */
111 #define W32_HAVE_STRUCT_TIMESPEC
112
113#elif defined(__ORANGEC__) /* Orange-C */
114 #define W32_HAVE_STRUCT_TIMESPEC
115#endif
116
117#if !defined(W32_HAVE_STRUCT_TIMESPEC)
118 #define _STRUCT_TIMESPEC
119 #define __struct_timespec_defined /* For MinGW 3.21+ */
120
121 struct timespec {
122 long tv_sec;
123 long tv_nsec;
124 };
125#endif
126
127#ifndef HZ
128#define HZ 18.2F
129#endif
130
131__BEGIN_DECLS
132
133W32_FUNC unsigned long W32_CALL net_times (struct tms *buffer);
134W32_FUNC int W32_CALL gettimeofday2 (struct timeval *, struct timezone *);
135
136__END_DECLS
137
138/*
139 * Operations on timevals.
140 *
141 * NB: timercmp does not work for >= or <=.
142 */
143#if !defined(timerisset)
144 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
145
146 #define timercmp(tvp, uvp, cmp) ((tvp)->tv_sec cmp (uvp)->tv_sec || \
147 ((tvp)->tv_sec == (uvp)->tv_sec && \
148 (tvp)->tv_usec cmp (uvp)->tv_usec))
149
150 #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
151#endif
152
153#endif /* !__SYS_WTIME_H */
cdefs.h
itimerval
Definition: wtime.h:75
timespec
Definition: wtime.h:121
timeval
Definition: wtime.h:30
timezone
Definition: wtime.h:55
tms
Definition: wtime.h:61
w32api.h
whide.h


Watt-32 tcp/ip: E:/WATT/inc/sys/wtypes.h Source File

  • inc
  • sys
wtypes.h
Go to the documentation of this file.
1
5/*-
6 * Copyright (c) 1982, 1986, 1991 The Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38/*
39 * the naming <sys/wtypes.h> is required for those compilers that
40 * have <sys/types.h> in the usual place but doesn't define
41 * the following types. This file is included from <sys/socket.h>,
42 * <tcp.h> etc.
43 *
44 * Our basic types (BYTE, WORD, etc.) are defined in the bottom.
45 */
46
47#ifndef __SYS_WTYPES_H
48#define __SYS_WTYPES_H
49
50#ifndef __SYS_W32API_H
51#include <sys/w32api.h>
52#endif
53
54#undef __need_size_t
55#define __need_size_t
56#include <stddef.h>
57
58#if defined(__DJGPP__) || defined(__DMC__) || \
59 defined(__MINGW32__) || defined(__CYGWIN__) || defined(__POCC__)
60 #include <sys/types.h>
61#endif
62
63#if defined(__DJGPP__) && !defined(WATT32_DJGPP_MINGW)
64 #include <machine/endian.h>
65 #include <sys/version.h> /* for DJGPP_MINOR */
66#endif
67
68#if defined(__DJGPP__) && !defined(WATT32_DJGPP_MINGW)
69 #include <sys/uio.h> /* for struct iovec */
70 #define IOVEC_DEFINED
71#endif
72
73#if defined(__MINGW32__) || (defined(__DJGPP__) && DJGPP_MINOR >= 4) || \
74 (defined(__WATCOMC__) && __WATCOMC__ >= 1230) || /* OW 1.3+ */ \
75 defined(__POCC__) || /* PellesC */ \
76 defined(__ORANGEC__) || /* Orange-C */ \
77 defined(__AVR__) /* Atmel gcc */
78 #undef W32_HAVE_STDINT_H
79 #define W32_HAVE_STDINT_H 1
80 #include <stdint.h> /* doesn't define 'u_char' etc. */
81#endif
82
83/* MSVC 16+ do have <stdint.h> with 'int32_t' etc.
84 */
85#if defined(_MSC_VER) && (_MSC_VER >= 1600)
86 #undef W32_HAVE_STDINT_H
87 #define W32_HAVE_STDINT_H 1
88 #include <stdint.h> /* doesn't define 'u_char' etc. */
89
90 #if (_MSC_VER >= 1800)
91 #include <inttypes.h>
92 #endif
93#endif
94
95/* Borland/CodeGearC/CBuilder do have <stdint.h> with 'int32_t' etc.
96 * Not sure about the '0x0700' value.
97 */
98#if defined(__BORLANDC__)
99 #undef W32_HAVE_STDINT_H
100
101 #if (__BORLANDC__ >= 0x0700) || defined(__CODEGEARC__)
102 #define W32_HAVE_STDINT_H 1
103 #include <stdint.h>
104 #endif
105#endif
106
107#if !defined(HAVE_U_INT64_T) && !defined(u_int64_t)
108 #if defined(__CYGWIN__)
109 #undef HAVE_U_INT32_T
110 #define HAVE_U_INT32_T
111
112 #undef HAVE_U_INT64_T
113 #define HAVE_U_INT64_T
114
115 #undef HAVE_CADDR_T
116 #define HAVE_CADDR_T
117
118 #elif defined(__HIGHC__) || defined(__GNUC__) || defined(__POCC__)
119 typedef unsigned long long u_int64_t;
120 #define HAVE_U_INT64_T
121
122 #elif defined(__DMC__) && (__INTSIZE == 4)
123 typedef unsigned long long u_int64_t;
124 #define HAVE_U_INT64_T
125
126 #elif defined(__WATCOMC__) && defined(__WATCOM_INT64__) && \
127 !(defined(__SMALL__) || defined(__LARGE__))
128 typedef unsigned __int64 u_int64_t;
129 #define HAVE_U_INT64_T
130
131 #elif defined(_MSC_VER) && (_MSC_VER >= 900)
132 typedef unsigned __int64 u_int64_t;
133 #define HAVE_U_INT64_T
134
135 #elif defined(__BORLANDC__) && defined(WIN32)
136 typedef unsigned __int64 u_int64_t;
137 #define HAVE_U_INT64_T
138 #endif
139#endif
140
141#if !defined(HAVE_U_CHAR) && !defined(u_char) && !defined(__u_char_defined)
142 typedef unsigned char u_char;
143 #define HAVE_U_CHAR
144 #define __u_char_defined
145#endif
146
147#if !defined(HAVE_U_SHORT) && !defined(u_short) && !defined(__u_short_defined)
148 typedef unsigned short u_short;
149 #define HAVE_U_SHORT
150 #define __u_short_defined
151#endif
152
153#if !defined(HAVE_USHORT) && !defined(ushort)
154 typedef unsigned short ushort; /* SysV compatibility */
155 #define HAVE_USHORT
156#endif
157
158#if !defined(HAVE_U_LONG) && !defined(u_long) && !defined(__u_long_defined)
159 typedef unsigned long u_long;
160 #define HAVE_U_LONG
161 #define __u_long_defined
162#endif
163
164#if !defined(HAVE_U_INT) && !defined(u_int) && !defined(__u_int_defined)
165 #if defined(__SMALL__) || defined(__LARGE__)
166 typedef unsigned long u_int; /* too many headers assumes u_int is >=32-bit */
167 #else
168 typedef unsigned int u_int;
169 #endif
170 #define HAVE_U_INT
171 #define __u_int_defined
172#endif
173
174#if !defined(HAVE_CADDR_T) && !defined(caddr_t) && !defined(__caddr_t_defined)
175 /* !! typedef unsigned long caddr_t; */
176 typedef char *caddr_t;
177 #define HAVE_CADDR_T
178 #define __caddr_t_defined
179#endif
180
181#if !defined(HAVE_DADDR_T) && !defined(daddr_t) && !defined(__daddr_t_defined)
182 typedef long daddr_t;
183 #define HAVE_DADDR_T
184 #define __daddr_t_defined
185#endif
186
187#if !defined(HAVE_U_INT8_T) && !defined(u_int8_t)
188 typedef unsigned char u_int8_t;
189#endif
190
191#if !defined(HAVE_U_INT16_T) && !defined(u_int16_t)
192 typedef unsigned short u_int16_t;
193#endif
194
195#if !defined(HAVE_U_INT32_T) && !defined(u_int32_t) && !defined(__u_int32_t_defined)
196 typedef unsigned long u_int32_t;
197#endif
198
199#if !defined(W32_HAVE_STDINT_H)
200 #if !defined(HAVE_INT16_T) && !defined(int16_t)
201 typedef short int16_t;
202 #define HAVE_INT16_T
203 #endif
204
205 #if !defined(HAVE_INT32_T) && !defined(int32_t) && !defined(__CYGWIN__)
206 typedef long int32_t;
207 #define HAVE_INT32_T
208 #endif
209#endif
210
211#if !defined(HAVE_U_QUAD_T) && !defined(u_quad_t)
212 #define HAVE_U_QUAD_T
213 #ifdef HAVE_U_INT64_T
214 #define u_quad_t u_int64_t
215 #else
216 #define u_quad_t unsigned long
217 #endif
218#endif
219
220#if !defined(IOVEC_DEFINED)
221 #define IOVEC_DEFINED
222 struct iovec {
223 void *iov_base;
224 size_t iov_len;
225 };
226#endif
227
228#if !defined(socklen_t)
229 typedef int socklen_t;
230 #define socklen_t socklen_t
231#endif
232
233#if !defined(sa_family_t)
234 typedef unsigned short sa_family_t;
235 #define sa_family_t sa_family_t
236#endif
237
238#if defined(_BSD_SA_FAMILY_T_)
239 typedef _BSD_SA_FAMILY_T_ sa_family_t;
240 #undef _BSD_SA_FAMILY_T_
241#endif
242
243
244#ifndef __BIT_TYPES_DEFINED__
245#define __BIT_TYPES_DEFINED__
246#endif
247
248#if !defined(FD_SET) /* not djgpp */
249 #undef FD_SETSIZE
250 #define FD_SETSIZE 512
251 #define FD_SET(n, p) ( (p)->fd_bits [(n)/8] |= (1 << ((n) & 7)) )
252 #define FD_CLR(n, p) ( (p)->fd_bits [(n)/8] &= ~(1 << ((n) & 7)) )
253 #define FD_ISSET(n,p) ( (p)->fd_bits [(n)/8] & (1 << ((n) & 7)) )
254 #define FD_ZERO(p) memset ((void*)(p), 0, sizeof(*(p)))
255
256 typedef struct fd_set {
257 unsigned char fd_bits [(FD_SETSIZE+7)/8];
258 } fd_set;
259#endif
260
261#if defined(__CYGWIN__)
262 #include <endian.h>
263#else
264
265 #ifndef LITTLE_ENDIAN
266 #define LITTLE_ENDIAN 1234
267 #endif
268
269 #ifndef BIG_ENDIAN
270 #define BIG_ENDIAN 4321
271 #endif
272
273 #define BYTE_ORDER LITTLE_ENDIAN
274#endif /* __CYGWIN__ */
275
276/*
277 * Pull in Watt-32 basic types.
278 */
279#if !defined(WATT32_ON_WINDOWS)
280 typedef unsigned char BYTE;
281 typedef unsigned short WORD;
282 typedef unsigned long DWORD;
283 typedef unsigned int UINT;
285 /* Hack for building Lynx; it defines BOOL to BOOLEAN (char)
286 * in it's HTUtils.h.
287 */
288 #if !defined(BOOLEAN_DEFINED) && !defined(BOOL)
289 typedef int BOOL;
290 #endif
291#endif
292
293/*
294 * Old compatibility
295 */
296#if !defined(WATT32_NO_OLDIES)
297 #ifndef byte
298 #define byte unsigned char
299 #endif
300
301 #ifndef word
302 #define word unsigned short
303 #endif
304
305 #ifndef dword
306 #define dword unsigned long
307 #endif
308
309 #ifndef longword
310 #define longword unsigned long
311 #endif
312#endif
313
314/* Link/network-layer address types
315 */
316typedef BYTE eth_address[6];
317typedef BYTE tok_address[6];
318typedef BYTE fddi_address[6];
319typedef BYTE ax25_address[7];
320typedef BYTE arcnet_address;
321typedef BYTE ip6_address[16];
323#define mac_address eth_address /* !!fix-me: breaks AX25 drivers */
324
325/*
326 * Function-ptr types
327 */
328
331typedef int (W32_CALL *ProtoHandler) (void *sock, const BYTE *data, unsigned len,
332 const void *tcp_phdr, const void *udp_hdr);
333
337typedef int (W32_CALL *UserHandler) (void *sock);
338
342typedef void (W32_CALL *VoidProc) (void);
343
347typedef int (W32_CALL *icmp_upcall) (void *socket, BYTE icmp_type, BYTE icmp_code);
348
349/*
350 * The following defines and structures are needed in some BSD
351 * or WIDE project headers.
352 */
353#ifndef NBBY
354#define NBBY 8
355#endif
356
357#if !defined(HAVE_STRUCT_SELINFO) && !defined(STRUCT_SELINFO_DEFINED)
358 #define STRUCT_SELINFO_DEFINED
359
360 /*
361 * Used to maintain information about processes that wish to be
362 * notified when I/O becomes possible.
363 */
364 struct selinfo {
365 /* struct klist si_note; */ /* kernel note list */
366 int si_seltid; /* thread to be notified */
367 short si_flags; /* see below */
368 };
369#endif
370
371#if defined(STRUCT_IFPREFIX_NEEDED) && !defined(HAVE_STRUCT_IFPREFIX) && !defined(STRUCT_IFPREFIX_DEFINED)
372 #define STRUCT_IFPREFIX_DEFINED
373 #include <sys/queue.h>
374
375 /*
376 * The prefix structure contains information about one prefix
377 * of an interface. They are maintained by the different address families,
378 * are allocated and attached when an prefix or an address is set,
379 * and are linked together so all prefixes for an interface can be located.
380 */
381 struct ifnet;
382
383 struct ifprefix {
384 struct sockaddr *ifpr_prefix; /* prefix of interface */
385 struct ifnet *ifpr_ifp; /* back-pointer to interface */
386 TAILQ_ENTRY(ifprefix) ifpr_list; /* queue macro glue */
387 u_char ifpr_plen; /* prefix length in bits */
388 u_char ifpr_type; /* protocol dependent prefix type */
389 };
390#endif
391
392#if !defined(HAVE_STRUCT_OSOCKADDR) && !defined(STRUCT_OSOCKADDR_DEFINED)
393 #define STRUCT_OSOCKADDR_DEFINED
394 struct osockaddr {
395 char sa_data[14];
396 unsigned short sa_family;
397 };
398#endif
399
400#if !defined(HAVE_STRUCT_CALLOUT) && !defined(STRUCT_CALLOUT_DEFINED)
401 #define STRUCT_CALLOUT_DEFINED
402 struct callout {
403 struct callout *c_next; /* next callout in queue */
404 void *c_arg; /* function argument */
405 void (*c_func) (void *); /* function to call */
406 int c_time; /* ticks to the event */
407 };
408#endif
409
410#endif /* __SYS_WTYPES_H */
queue.h
callout
Definition: wtypes.h:402
fd_set
Definition: wtypes.h:256
ifnet
Definition: if.h:136
ifprefix
Definition: wtypes.h:383
iovec
Definition: wtypes.h:222
osockaddr
Definition: wtypes.h:394
selinfo
Definition: wtypes.h:364
sockaddr
Definition: socket.h:181
socket
Definition: if.h:82
uio.h
w32api.h


Watt-32 tcp/ip: E:/WATT/src/x32vm.c Source File

  • src
x32vm.c
Go to the documentation of this file.
1
11#include <stdio.h>
12#include <stdlib.h>
13#include <string.h>
14
15#include "wattcp.h"
16#include "printk.h"
17#include "misc.h"
18#include "misc_str.h"
19#include "cpumodel.h"
20#include "x32vm.h"
21
22#if (DOSX & X32VM) /* rest of file */
23
24#define MAX_WRAPPERS 32
25#define MARKER 0xDEADBEEF
26#define SEG_OFS_TO_LIN(s,o) ((DWORD)_x386_zero_base_ptr + \
27 (DWORD)(o) + ((DWORD)(s) << 4))
28
29typedef struct RMCB_record {
30 SWI_REGS rm_reg;
31 REALPTR dos_real;
32 REALPTR dos_para_addr;
33 UINT stack_size;
34 UINT *stack_bottom;
35 UINT *stack_top;
36 pmodeHook callback;
37 DWORD marker;
38 } RMCB_record;
39
40typedef enum {
41 RETF = 0xCB, /* far return */
42 IRET = 0xCF /* interrupt return */
43 } ReturnType;
44
45static char num_wrappers = 0;
46static DWORD exc_app_start = 4096;
47static struct RMCB_record rmcb [MAX_WRAPPERS];
48
49#if defined(DMC386)
50
51static void __far PmodeGlue (int taskIndex);
52static void PmGlueEnd (void);
53
54void _dx_rmiv_get (int int_no, REALPTR *handler)
55{
56 __asm {
57 mov eax, 2503h
58 mov ecx, int_no
59 int 21h
60 mov eax, handler
61 mov [eax], ebx
62 }
63}
64
65void _dx_rmiv_set (int int_no, REALPTR handler)
66{
67 __asm {
68 push ebx
69 mov eax, 2505h
70 mov ebx, handler
71 mov ecx, int_no
72 int 21h
73 pop ebx
74 }
75}
76
77void _dx_pmiv_get (int int_no, FARPTR *handler)
78{
79 __asm {
80 push es
81 push ebx
82 mov eax, 2502h
83 mov ecx, int_no
84 int 21h
85 mov eax, handler
86 mov [eax], ebx
87 mov [eax+4], es
88 pop ebx
89 pop es
90 }
91}
92
93void _dx_apmiv_set (int int_no, FARPTR handler)
94{
95 __asm {
96 push ds
97 mov edx, dword ptr handler[0]
98 mov ax, word ptr handler[2]
99 mov ds, ax
100 mov eax, 2506h
101 mov ecx, int_no
102 int 21h
103 pop ds
104 }
105}
106
107void _dx_real_int (int int_no, SWI_REGS *regs)
108{
109 RMI_BLK rmi;
110
111 __asm {
112 push ebx
113 push esi
114 push edi
115 mov eax, int_no
116 mov rmi.inum, ax /* rmi.inum = int_no */
117
118 mov eax, regs
119 mov cx, word ptr [eax].r_ds
120 mov rmi.ds_reg, cx /* rmi.ds_reg = regs->r_ds */
121
122 mov cx, word ptr [eax].r_es
123 mov rmi.es_reg, cx /* rmi.es_reg = regs->r_es */
124
125 mov ecx, [eax].r_ax
126 mov rmi.eax_reg, ecx /* rmi.eax_reg = regs->r_ax */
127
128 mov ecx, [eax].r_dx
129 mov rmi.edx_reg, ecx /* rmi.edx_reg = regs->r_dx */
130
131 mov ebx, [eax].r_bx
132 mov ecx, [eax].r_cx
133 mov edi, [eax].r_di
134 mov esi, [eax].r_si
135 mov eax, 2511h
136 lea edx, rmi
137 push ebp
138 int 21h /* X32VM function 2511h */
139 pop ebp
140
141 push eax
142 mov eax, [regs]
143 pushfd
144 pop [eax].r_flags
145 mov [eax].r_bx, ebx
146 mov [eax].r_cx, ecx
147 mov [eax].r_di, edi
148 mov [eax].r_si, esi
149 pop [eax].r_ax
150 pop edi
151 pop esi
152 pop ebx
153 }
154 regs->r_ds = rmi.ds_reg;
155 regs->r_es = rmi.es_reg;
156 regs->r_dx = rmi.edx_reg;
157}
158
159/*
160 * !! Doesn't work yet (only needed in pcintr.c which isn't tested).
161 */
162int _dx_call_real (REALPTR proc, RMC_BLK *rm_reg, DWORD count, ...)
163{
164 __asm {
165 push esi
166 push edi
167 push ebx
168 mov eax, 250Eh
169 mov ebx, proc
170 mov ecx, count
171 int 21h
172 pop ebx
173 pop edi
174 pop esi
175 jc fail
176 }
177 ARGSUSED (rm_reg);
178 return (1);
179fail:
180 return (0);
181}
182
183void _dx_rmlink_get (REALPTR *cback, REALPTR *rm_cbuf,
184 DWORD *rm_cbuf_size, void _far **pm_cbuf)
185{
186 __asm {
187 push es
188 push esi
189 push ebx
190 mov ax, 250Dh
191 int 21h
192 mov esi, [cback]
193 mov [esi], eax
194 mov esi, [rm_cbuf]
195 mov [esi], ebx
196 mov esi, [rm_cbuf_size]
197 mov [esi], ecx
198 mov ebx, [pm_cbuf]
199 mov [ebx], edx
200 mov [ebx+4], es
201 pop ebx
202 pop esi
203 pop es
204 }
205}
206
207/*
208 * A simplified version of Pharlap's 2537h function.
209 * - Allocate conventional memory above DOS data buffer.
210 */
211int _dx_real_above (int para_count, WORD *para, WORD *largest)
212{
213 REALPTR rp = _x32_real_alloc (16*para_count);
214
215 if (largest)
216 *largest = 0;
217 if (!rp)
218 return (-1);
219 *para = RP_SEG (rp);
220 return (0);
221}
222
223int _dx_real_free (WORD seg)
224{
225 _x32_real_free (seg << 16);
226 return (0);
227}
228
229/*
230 * A simplified version of Pharlap's 25C0h function.
231 * - Allocate conventional memory.
232 */
233int _dx_real_alloc (int para_count, WORD *para, WORD *largest)
234{
235 WORD seg = _x32_real_alloc (16*para_count);
236
237 if (!seg)
238 return (-1);
239 *para = seg;
240 *largest = 0;
241 return (0);
242}
243
244#elif defined(WATCOM386)
245
246extern void __far PmodeGlue (int task_index);
247extern void PmGlueEnd (void);
248
250#endif
251
252int _dx_lock_pgs (const void _far *addr, int len)
253{
254 return _x386_memlock ((void _far*)addr, len);
255}
256
257int _dx_lock_pgsn (const void *addr, int len) /* addr must not be on stack */
258{
259 return _x386_memlock (MK_FP(MY_DS(),addr), len);
260}
261
262int _dx_ulock_pgsn (const void *addr, int len)
263{
264 return _x386_memunlock (MK_FP(MY_DS(),addr), len);
265}
266
267void ReadRealMem (void *buf, REALPTR rp, unsigned len)
268{
269 const BYTE *src = (const BYTE*) SEG_OFS_TO_LIN (RP_SEG(rp), RP_OFF(rp));
270 memcpy (buf, src, len);
271}
272
273void WriteRealMem (REALPTR rp, const void *src, int len)
274{
275 BYTE *dest = (BYTE*) SEG_OFS_TO_LIN (RP_SEG(rp), RP_OFF(rp));
276 memcpy (dest, src, len);
277}
278
279void FillRealMem (REALPTR rp, char val, int len)
280{
281 BYTE *dest = (BYTE*) SEG_OFS_TO_LIN (RP_SEG(rp), RP_OFF(rp));
282 memset (dest, val, len);
283}
284
285void PokeRealWord (REALPTR rp, WORD val)
286{
287 WORD *dest = (WORD*) SEG_OFS_TO_LIN (RP_SEG(rp), RP_OFF(rp));
288 *dest = val;
289}
290
291#ifdef __SW_3R
292#error !? Cannot use this with reg-calls.
293#endif
294
295void stack_rewind (DWORD start, DWORD base)
296{
297 int loop = 10; /* print max 10 stack frames */
298 DWORD eip = start;
299 DWORD *context = (DWORD*) base; /* EBP increases as we rewind */
300 DWORD limit = get_cs_limit();
301
302 _printk ("Stack trace:\r\n");
303
304 while (context >= (DWORD*)base && ((DWORD)context & 3) == 0 && --loop)
305 {
306 DWORD *next;
307
308 if ((DWORD)context >= limit - 4 || eip >= limit ||
309 (DWORD)context <= exc_app_start || eip <= exc_app_start)
310 break;
311
312 _printk (" %08X ", eip);
313
314 next = (DWORD*)*context; /* get ESP stack value from context */
315
316 /* Compute number of args to display
317 */
318 if (next == NULL || /* we're rewound back to CRT */
319 next <= (DWORD*)exc_app_start)
320 _printk ("( *** )");
321
322 else
323 {
324 DWORD *argv;
325 DWORD argc = next - context - 2;
326
327 argc = (argc > 5) ? 5 : argc;
328 _printk ("(");
329
330 argv = context + 2; /* Args start after saved EBP and return address */
331 while (argc--)
332 {
333 if (argc == 0)
334 _printk ("%04X)\r\n", *argv++);
335 else _printk ("%04X ", *argv++);
336 }
337 }
338 eip = *(context+1); /* get next return address */
339 context = next;
340 }
341 _printk ("\r\n");
342}
343
344
345/*
346 * Take a seg-x:ofs REALPTR and return a normalized seg-y:0 REALPTR
347 */
348static REALPTR normalize (REALPTR rp)
349{
350 WORD seg = RP_SEG (rp);
351 WORD ofs = RP_OFF (rp);
352 seg += (ofs >> 4);
353 if (ofs & 0xF)
354 seg++;
355 RP_SET (rp, 0, seg);
356 return (rp);
357}
358
359static REALPTR _dx_alloc_rmode_wrapper (pmodeHook pmHook,
360 int len, int stack_size,
361 ReturnType returnType)
362{
363 #define DOFS 0x22 /* offset of data section (tiny model) */
364 #define DSIZE 12 /* sizeof data section at wrapper end */
365
366 static BYTE rm_wrapper[] =
367 {
368 0x06, /* 00 push es */
369 0x1E, /* 01 push ds */
370 0x0E, /* 02 push cs */
371 0x1F, /* 03 pop ds ; DS = CS */
372 0x66,0x60, /* 04 pushad */
373 0x66,0xFF,0x36,DOFS+8,0, /* 06 push dword ptr task_ptr */
374 0x66,0x6A,0, /* 0B push dword ptr 0 ; use default selectors */
375 0x6A,0, /* 0E push word ptr 0 ; */
376 0x66,0xFF,0x36,DOFS,0, /* 10 push dword ptr prot_glue */
377 0xFF,0x1E,DOFS+4,0, /* 15 call r2p_addr */
378 0x83,0xC4,14, /* 19 add sp,14 ; discard used stack */
379 0x66,0x61, /* 1C popad */
380 0x1F, /* 1E pop ds */
381 0x07, /* 1F pop es */
382 0xCB, /* 20 retf */
383 0x90, /* 21 nop */
384 0,0,0,0, /* 22+0 prot_glue dd ? */
385 0,0,0,0, /* 22+4 r2p_addr dd ? */
386 0,0,0,0 /* 22+8 task_ptr dd ? */
387 };
388
389 BYTE _far *fp_wrapper;
390 UINT *stack, i;
391 REALPTR dos_real; /* allocated DOS memory */
392 REALPTR r2p_addr; /* address of real to pmode switch */
393 REALPTR dos_tb_real; /* rmode-address of transfer buffer */
394 void _far *dos_tb_addr; /* ditto for pmode */
395 DWORD dos_tb_size; /* size of transfer buffer */
396
397 WATT_ASSERT (sizeof(rm_wrapper) == DOFS+DSIZE);
398
399 if (!pmHook || num_wrappers == MAX_WRAPPERS)
400 return (0);
401
402 stack_size += sizeof(UINT) + 3; /* add one for marker and round up */
403 stack_size &= ~3;
404 stack = malloc (stack_size);
405 if (!stack)
406 return (0);
407
408 len += sizeof(rm_wrapper) + 16;
409 dos_real = _x32_real_alloc (len);
410 if (!dos_real)
411 {
412 free (stack);
413 return (0);
414 }
415
416 _dx_rmlink_get (&r2p_addr, &dos_tb_real, &dos_tb_size, &dos_tb_addr);
417
418 for (i = 0; i < MAX_WRAPPERS; i++)
419 if (!rmcb[i].dos_real)
420 break;
421
422 *(DWORD*) (rm_wrapper+DOFS+0) = (DWORD)&PmodeGlue; /* pmode helper */
423 *(DWORD*) (rm_wrapper+DOFS+4) = r2p_addr; /* rm->pm addr */
424 *(DWORD*) (rm_wrapper+DOFS+8) = (DWORD)(rmcb + i); /* task_ptr */
425 rm_wrapper [0x20] = returnType; /* RETF or IRET */
426
427 /* lock pages used by callback
428 */
429 fp_wrapper = MK_FP (_x32_zero_base_selector, RP_SEG(dos_real) << 4);
430 _dx_lock_pgs (fp_wrapper, len);
431 _dx_lock_pgsn ((void*)&PmodeGlue, (UINT)&PmGlueEnd - (UINT)&PmodeGlue);
432 _dx_lock_pgsn ((void*)stack, stack_size);
433
434 rmcb [i].dos_real = dos_real;
435 rmcb [i].callback = pmHook;
436 rmcb [i].stack_bottom = stack;
437 rmcb [i].stack_size = stack_size;
438 rmcb [i].stack_top = stack + stack_size/sizeof(UINT) - sizeof(UINT);
439 rmcb [i].stack_top[1] = MARKER;
440 rmcb [i].marker = MARKER;
441 rmcb [i].dos_para_addr = normalize (dos_real);
442 WriteRealMem (rmcb[i].dos_para_addr, &rm_wrapper, sizeof(rm_wrapper));
443
444#if 0
445 printf ("dos_real %08lX, r2p-addr %08lX, stack %08X\n",
446 dos_real, r2p_addr, stack);
447#endif
448
449 num_wrappers++;
450 return (rmcb[i].dos_para_addr);
451}
452
453void _dx_free_rmode_wrapper (REALPTR dos_addr)
454{
455 int i;
456
457 for (i = 0; i < MAX_WRAPPERS; i++)
458 {
459 struct RMCB_record *tr = rmcb + i;
460
461 if (!rmcb[i].dos_real || rmcb[i].dos_para_addr != dos_addr)
462 continue;
463
464 if (tr->marker == MARKER)
465 _x32_real_free (tr->dos_real);
466
467 if (tr->stack_top[1] == MARKER)
468 free (tr->stack_bottom);
469 memset (tr, 0, sizeof(*tr));
470 }
471}
472
473REALPTR _dx_alloc_rmode_wrapper_retf (pmodeHook pmHook, rmodeHook rmHook,
474 int len, int stack_size)
475{
476 ARGSUSED (rmHook);
477 return _dx_alloc_rmode_wrapper (pmHook, len, stack_size, RETF);
478}
479
480REALPTR _dx_alloc_rmode_wrapper_iret (pmodeHook pmHook, int stack_size)
481{
482 return _dx_alloc_rmode_wrapper (pmHook, 0, stack_size, IRET);
483}
484
485#if defined(DMC386)
486
487static void __far PmodeGlue (struct RMCB_record *task_ptr)
488{
489/*
490 * We need an assembly language "glue" routine on the protected mode side
491 * to deal with several things:
492 * 1. It gets called with a FAR procedure call.
493 * 2. Copy all real-mode registers into the 'rm_reg' structure of the
494 * correct task-index.
495 * 3. Switch back to a stack in the data segment.
496 * 4. Call the HLL prot-mode callback with '&rm_reg' on stack.
497 * 5. Switch back to the stack DOSX has allocated for us.
498 * 6. Copy 'rm_reg' back onto the stack.
499 *
500 * Doesn't store ESP/EBP/FS/GS to SWI_REGS (not needed in Watt-32)
501 */
502
503 __asm {
504 mov ebx, task_ptr
505 pushfd
506 push gs
507 push fs
508
509/*
510 * fill the 'rm_reg' struct based on the "pushad" instruction and the
511 * "push ds/es" of the wrapper. Registers that haven't changed are
512 * stored as-is.
513 *
514 * in wrapper: PUSH ES */ #define REG_ES [ebp+50]
515/* PUSH DS */ #define REG_DS [ebp+48]
516/* (PUSHAD) PUSH EAX */ #define REG_EAX [ebp+44]
517/* PUSH ECX */ #define REG_ECX [ebp+40]
518/* PUSH EDX */ #define REG_EDX [ebp+36]
519/* PUSH EBX */ #define REG_EBX [ebp+32]
520/* PUSH ESP */ #define REG_ESP [ebp+28]
521/* PUSH EBP */ #define REG_EBP [ebp+24]
522/* PUSH ESI */ #define REG_ESI [ebp+20]
523/* PUSH EDI */ #define REG_EDI [ebp+16]
524/* */
525/* PUSH dword ptr task_ptr */
526/* PUSH dword ptr 0 */
527/* PUSH word ptr 0 */
528/* PUSH dword ptr prot_glue */
529
530 mov [ebx].r_ax, eax
531 mov [ebx].r_cx, ecx
532 mov [ebx].r_dx, edx
533 mov [ebx].r_si, esi
534 mov [ebx].r_di, edi
535
536#if 0 /* test */
537 movzx eax, word ptr REG_DS
538 push eax
539 call dhex4int /* print DS */
540 add esp, 4
541
542 movzx eax, word ptr REG_ES
543 push eax
544 call dhex4int /* print ES */
545 add esp, 4
546
547 mov ax, ss
548 movzx eax, ax
549 push eax
550 call dhex4int /* print SS */
551 add esp, 4
552#endif
553
554 pushfd
555 pop eax
556 mov [ebx].r_flags, eax
557
558 mov eax, REG_EBX
559 mov [ebx].r_bx, eax
560
561 mov eax, REG_DS
562 mov [ebx].r_ds, ax
563
564 mov eax, REG_ES
565 mov [ebx].r_es, ax
566
567 mov eax, [ebx].stack_bottom
568 push _x386_stacklow
569 mov _x386_stacklow, eax /* set new stack-low value */
570
571 mov dx, ss
572 mov esi, esp /* DX:ESI = current SS:ESP */
573 mov ax, ds
574 mov ss, ax
575 mov esp, [ebx].stack_top /* new SS:ESP = DS:top-of-task-stack */
576
577 push edx /* save old stack pointer on top */
578 push esi /* of new stack */
579
580 push ebx /* because rm_reg is first in the structure */
581 cld /* C code need direction flag off */
582 call [ebx].callback /* call the C handler function */
583 lss esp, [esp+4] /* switch back to original stack */
584 pop _x386_stacklow
585
586/* fill stack with the rm_reg struct based on the "popad" instruction
587 * and the "pop ds/es" of the wrapper.
588 */
589 mov ax, [ebx].r_es
590 mov REG_ES, ax
591
592 mov ax, [ebx].r_ds
593 mov REG_DS, ax
594
595 mov eax, [ebx].r_ax
596 mov REG_EAX, eax
597
598 mov eax, [ebx].r_cx
599 mov REG_ECX, eax
600
601 mov eax, [ebx].r_dx
602 mov REG_EDX, eax
603
604 mov eax, [ebx].r_bx
605 mov REG_EBX, eax
606
607 mov eax, [ebx].r_si
608 mov REG_ESI, eax
609
610 mov eax, [ebx].r_di
611 mov REG_EDI, eax
612
613 pop fs
614 pop gs
615 popfd
616 }
617}
618
619static void PmGlueEnd (void) /* end of area to lock */
620{
621}
622#endif /* DMC386 */
623#endif /* DOSX & X32VM */
624
cpumodel.h
misc.h
misc_str.h
printk.h
RMC_BLK
Definition: x32vm.h:30
RMCB_record
Definition: x32vm.c:29
RMI_BLK
Definition: x32vm.h:41
SWI_REGS
Definition: x32vm.h:16
esp
Definition: esp.h:44
proc
Definition: if.h:81
wattcp.h
Core definitions.
rmcb
static struct RMCB_record rmcb[MAX_WRAPPERS]
Definition: x32vm.c:47
PmGlueEnd
static void PmGlueEnd(void)
Definition: x32vm.c:619
_dx_real_alloc
int _dx_real_alloc(int para_count, WORD *para, WORD *largest)
Definition: x32vm.c:233
x32vm.h


Watt-32 tcp/ip: E:/WATT/src/x32vm.h Source File

  • src
x32vm.h
Go to the documentation of this file.
1
3#ifndef _w32_X32VM_H
4#define _w32_X32VM_H
5
6#if (DOSX & X32VM) /* FlashTek's X32 extender */
7
8#undef REALPTR
9#define REALPTR DWORD /* segment in upper 16 bits */
10#define RP_SET(rp,ofs,seg) (rp = ((DWORD)(seg) << 16) + (ofs))
11#define RP_OFF(rp) (WORD)((DWORD)(rp) & 0xFFFF)
12#define RP_SEG(rp) (WORD)((DWORD)(rp) >> 16)
13
14#include <sys/pack_on.h>
15
16typedef struct SWI_REGS {
17 DWORD r_ax;
18 DWORD r_bx;
19 DWORD r_cx;
20 DWORD r_dx;
21 DWORD r_si;
22 DWORD r_di;
23 WORD r_ds;
24 WORD r_es;
25 WORD r_fs;
26 WORD r_gs;
27 DWORD r_flags;
28 } SWI_REGS;
29
30typedef struct RMC_BLK {
31 WORD ds;
32 WORD es;
33 WORD fs;
34 WORD gs;
35 DWORD eax;
36 DWORD ebx;
37 DWORD ecx;
38 DWORD edx;
39 } RMC_BLK;
40
41typedef struct {
42 WORD inum;
43 WORD ds_reg, es_reg;
44 WORD fs_reg, gs_reg;
45 DWORD eax_reg, edx_reg;
46 } RMI_BLK;
47
48typedef void (*pmodeHook) (SWI_REGS *);
49typedef void (*rmodeHook) (void);
50
51#include <sys/pack_off.h>
52
53#define _dx_rmiv_get W32_NAMESPACE (_dx_rmiv_get)
54#define _dx_rmiv_set W32_NAMESPACE (_dx_rmiv_set)
55#define _dx_real_int W32_NAMESPACE (_dx_real_int)
56#define _dx_real_free W32_NAMESPACE (_dx_real_free)
57#define _dx_real_above W32_NAMESPACE (_dx_real_above)
58#define _dx_real_alloc W32_NAMESPACE (_dx_real_alloc)
59#define _dx_call_real W32_NAMESPACE (_dx_call_real)
60#define _dx_lock_pgs W32_NAMESPACE (_dx_lock_pgs)
61#define _dx_lock_pgsn W32_NAMESPACE (_dx_lock_pgsn)
62#define _dx_ulock_pgsn W32_NAMESPACE (_dx_ulock_pgsn)
63#define _dx_rmlink_get W32_NAMESPACE (_dx_rmlink_get)
64
65#define ReadRealMem W32_NAMESPACE (ReadRealMem)
66#define WriteRealMem W32_NAMESPACE (WriteRealMem)
67#define PokeRealWord W32_NAMESPACE (PokeRealWord)
68#define PeekRealWord W32_NAMESPACE (PeekRealWord)
69#define PeekRealDWord W32_NAMESPACE (PeekRealDWord)
70#define stack_rewind W32_NAMESPACE (stack_rewind)
71
72#define _dx_alloc_rmode_wrapper_retf W32_NAMESPACE (_dx_alloc_rmode_wrapper_retf)
73#define _dx_alloc_rmode_wrapper_iret W32_NAMESPACE (_dx_alloc_rmode_wrapper_iret)
74#define _dx_free_rmode_wrapper W32_NAMESPACE (_dx_free_rmode_wrapper)
75
76extern void _dx_rmiv_get (int int_no, REALPTR *handler);
77extern void _dx_rmiv_set (int int_no, REALPTR handler);
78extern void _dx_pmiv_get (int int_no, FARPTR *handler);
79extern void _dx_apmiv_set (int int_no, FARPTR handler);
80extern void _dx_real_int (int int_no, SWI_REGS *regs);
81extern int _dx_real_free (WORD segment);
82extern int _dx_real_above(int paras, WORD *para, WORD *largest);
83extern int _dx_real_alloc(int paras, WORD *para, WORD *largest);
84extern int _dx_call_real (REALPTR proc, RMC_BLK *rm_reg, DWORD count, ...);
85
86extern int _dx_lock_pgs (const void _far *addr, int len);
87extern int _dx_lock_pgsn (const void *addr, int len);
88extern int _dx_ulock_pgsn (const void *addr, int len);
89
90extern void _dx_rmlink_get (REALPTR *cback, REALPTR *rm_cbuf,
91 DWORD *rm_cbuf_size, void _far **pm_cbuf);
92
93extern REALPTR _dx_alloc_rmode_wrapper_retf (pmodeHook pmHook,
94 rmodeHook rmHook,
95 int len, int stack_size);
96
97extern REALPTR _dx_alloc_rmode_wrapper_iret (pmodeHook pmHook,
98 int stack_size);
99
100extern void _dx_free_rmode_wrapper (REALPTR dosAddr);
101
102extern void ReadRealMem (void *buf, REALPTR rp, unsigned len);
103extern void WriteRealMem (REALPTR rp, const void *src, int size);
104extern void PokeRealWord (REALPTR rp, WORD val);
105extern WORD PeekRealWord (REALPTR rp);
106extern DWORD PeekRealDWord(REALPTR rp);
107extern void stack_rewind (DWORD start, DWORD base);
108
109extern UINT cdecl _x386_stacklow; /* in FlashTek's x32.lib */
110
111#endif /* DOSX & X32VM */
112#endif /* _w32_X32VM_H */
113
pack_off.h
pack_on.h
RMC_BLK
Definition: x32vm.h:30
RMI_BLK
Definition: x32vm.h:41
SWI_REGS
Definition: x32vm.h:16
proc
Definition: if.h:81
_dx_real_alloc
int _dx_real_alloc(int paras, WORD *para, WORD *largest)
Definition: x32vm.c:233


Watt-32 tcp/ip: E:/WATT/inc/rpc/xdr.h Source File

  • inc
  • rpc
xdr.h
Go to the documentation of this file.
1
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part. Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California 94043
32 */
33
34/*
35 * xdr.h, External Data Representation Serialization Routines.
36 *
37 * Copyright (C) 1984, Sun Microsystems, Inc.
38 */
39
40#ifndef __RPC_XDR_H
41#define __RPC_XDR_H
42
43#ifndef __SYS_CDEFS_H
44#include <sys/cdefs.h>
45#endif
46
47#ifndef __RPC_TYPES_H
48#include <rpc/types.h>
49#endif
50
51/*
52 * XDR provides a conventional way for converting between C data
53 * types and an external bit-string representation. Library supplied
54 * routines provide for the conversion on built-in C data types. These
55 * routines and utility routines defined here are used to help implement
56 * a type encode/decode routine for each user-defined type.
57 *
58 * Each data type provides a single procedure which takes two arguments:
59 *
60 * bool_t
61 * xdrproc(xdrs, argresp)
62 * XDR *xdrs;
63 * <type> *argresp;
64 *
65 * xdrs is an instance of a XDR handle, to which or from which the data
66 * type is to be converted. argresp is a pointer to the structure to be
67 * converted. The XDR handle contains an operation field which indicates
68 * which of the operations (ENCODE, DECODE * or FREE) is to be performed.
69 *
70 * XDR_DECODE may allocate space if the pointer argresp is null. This
71 * data can be freed with the XDR_FREE operation.
72 *
73 * We write only one procedure per data type to make it easy
74 * to keep the encode and decode procedures for a data type consistent.
75 * In many cases the same code performs all operations on a user defined type,
76 * because all the hard work is done in the component type routines.
77 * decode as a series of calls on the nested data types.
78 */
79
80/*
81 * Xdr operations. XDR_ENCODE causes the type to be encoded into the
82 * stream. XDR_DECODE causes the type to be extracted from the stream.
83 * XDR_FREE can be used to release the space allocated by an XDR_DECODE
84 * request.
85 */
86enum xdr_op {
87 XDR_ENCODE = 0,
88 XDR_DECODE = 1,
89 XDR_FREE = 2
90 };
91
92/*
93 * This is the number of bytes per unit of external data.
94 */
95#define BYTES_PER_XDR_UNIT (4)
96#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \
97 * BYTES_PER_XDR_UNIT)
98
99/*
100 * A xdrproc_t exists for each data type which is to be encoded or decoded.
101 *
102 * The second argument to the xdrproc_t is a pointer to an opaque pointer.
103 * The opaque pointer generally points to a structure of the data type
104 * to be decoded. If this pointer is 0, then the type routines should
105 * allocate dynamic storage of the appropriate size and return it.
106 * bool_t (*xdrproc_t)(XDR *, caddr_t *);
107 */
108typedef bool_t (*xdrproc_t)();
109
110/*
111 * The XDR handle.
112 * Contains operation which is being applied to the stream,
113 * an operations vector for the particular implementation (e.g. see xdr_mem.c),
114 * and two private fields for the use of the particular implementation.
115 */
116typedef struct {
117 enum xdr_op x_op; /* operation; fast additional param */
118 struct xdr_ops {
119 bool_t (*x_getlong)(); /* get a long from underlying stream */
120 bool_t (*x_putlong)(); /* put a long to " */
121 bool_t (*x_getbytes)(); /* get some bytes from " */
122 bool_t (*x_putbytes)(); /* put some bytes to " */
123 u_int (*x_getpostn)(); /* returns bytes off from beginning */
124 bool_t (*x_setpostn)(); /* lets you reposition the stream */
125 long * (*x_inline)(); /* buf quick ptr to buffered data */
126 void (*x_destroy)(); /* free privates of this xdr_stream */
127 } *x_ops;
128 caddr_t x_public; /* users' data */
129 caddr_t x_private; /* pointer to private data */
130 caddr_t x_base; /* private used for position info */
131 int x_handy; /* extra private word */
132} XDR;
133
134/*
135 * Operations defined on a XDR handle
136 *
137 * XDR *xdrs;
138 * long *longp;
139 * caddr_t addr;
140 * u_int len;
141 * u_int pos;
142 */
143#define XDR_GETLONG(xdrs, longp) \
144 (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
145
146#define xdr_getlong(xdrs, longp) \
147 (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
148
149#define XDR_PUTLONG(xdrs, longp) \
150 (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
151
152#define xdr_putlong(xdrs, longp) \
153 (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
154
155#define XDR_GETBYTES(xdrs, addr, len) \
156 (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
157
158#define xdr_getbytes(xdrs, addr, len) \
159 (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
160
161#define XDR_PUTBYTES(xdrs, addr, len) \
162 (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
163
164#define xdr_putbytes(xdrs, addr, len) \
165 (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
166
167#define XDR_GETPOS(xdrs) \
168 (*(xdrs)->x_ops->x_getpostn)(xdrs)
169
170#define xdr_getpos(xdrs) \
171 (*(xdrs)->x_ops->x_getpostn)(xdrs)
172
173#define XDR_SETPOS(xdrs, pos) \
174 (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
175
176#define xdr_setpos(xdrs, pos) \
177 (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
178
179#define XDR_INLINE(xdrs, len) \
180 (*(xdrs)->x_ops->x_inline)(xdrs, len)
181
182#define xdr_inline(xdrs, len) \
183 (*(xdrs)->x_ops->x_inline)(xdrs, len)
184
185#define XDR_DESTROY(xdrs) \
186 do { \
187 if ((xdrs)->x_ops->x_destroy) \
188 (*(xdrs)->x_ops->x_destroy)(xdrs); \
189 } while (0)
190
191#define xdr_destroy(xdrs) \
192 do { \
193 if ((xdrs)->x_ops->x_destroy) \
194 (*(xdrs)->x_ops->x_destroy)(xdrs); \
195 } while (0)
196
197/*
198 * Support struct for discriminated unions.
199 * You create an array of xdrdiscrim structures, terminated with
200 * a entry with a null procedure pointer. The xdr_union routine gets
201 * the discriminant value and then searches the array of structures
202 * for a matching value. If a match is found the associated xdr routine
203 * is called to handle that part of the union. If there is
204 * no match, then a default routine may be called.
205 * If there is no match and no default routine it is an error.
206 */
207#define NULL_xdrproc_t ((xdrproc_t)0L)
208
209struct xdr_discrim {
210 int value;
211 xdrproc_t proc;
212 };
213
214/*
215 * In-line routines for fast encode/decode of primitive data types.
216 * Caveat emptor: these use single memory cycles to get the
217 * data from the underlying buffer, and will fail to operate
218 * properly if the data is not aligned. The standard way to use these
219 * is to say:
220 * if ((buf = XDR_INLINE(xdrs, count)) == NULL)
221 * return (FALSE);
222 * <<< macro calls >>>
223 * where ``count'' is the number of bytes of data occupied
224 * by the primitive data types.
225 *
226 * N.B. and frozen for all time: each data type here uses 4 bytes
227 * of external representation.
228 */
229#define IXDR_GET_LONG(buf) ((long)ntohl((u_long)*(buf)++))
230#define IXDR_PUT_LONG(buf, v) (*(buf)++ = (long)htonl((u_long)v))
231
232#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
233#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
234#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
235#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf))
236#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_LONG(buf))
237
238#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
239#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
240#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
241#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
242#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
243
244/*
245 * These are the "generic" xdr routines.
246 */
247
248__BEGIN_DECLS
249
250extern bool_t xdr_void (XDR *, caddr_t);
251extern bool_t xdr_int (XDR *, int *);
252extern bool_t xdr_u_int (XDR *, u_int *);
253extern bool_t xdr_long (XDR *, long *);
254extern bool_t xdr_u_long (XDR *, u_long *);
255extern bool_t xdr_short (XDR *, short *);
256extern bool_t xdr_u_short (XDR *, u_short *);
257extern bool_t xdr_bool (XDR *, bool_t *);
258extern bool_t xdr_enum (XDR *, enum_t *);
259extern bool_t xdr_array (XDR *, char **, u_int *, u_int, u_int, xdrproc_t);
260extern bool_t xdr_bytes (XDR *, char **, u_int *, u_int);
261extern bool_t __xdr_opaque (XDR *, caddr_t, u_int);
262extern bool_t xdr_string (XDR *, char **, u_int);
263extern bool_t xdr_union (XDR *, enum_t *, char *, struct xdr_discrim *, xdrproc_t);
264extern bool_t xdr_char (XDR *, char *);
265extern bool_t xdr_u_char (XDR *, char *);
266extern bool_t xdr_vector (XDR *, char *, u_int, u_int, xdrproc_t);
267extern bool_t xdr_float (XDR *, float *);
268extern bool_t xdr_double (XDR *, double *);
269extern bool_t xdr_reference (XDR *, caddr_t *, u_int, xdrproc_t);
270extern bool_t xdr_pointer (XDR *, caddr_t *, u_int, xdrproc_t);
271extern bool_t xdr_wrapstring (XDR *, char **);
272extern void xdr_free (xdrproc_t, char *);
273
274/*
275 * Hack to avoid missing typecast from rpcgen when
276 * producing xdr_opaque()
277 */
278#define xdr_opaque(xdr,obj,size) __xdr_opaque(xdr,(caddr_t)obj,size)
279
280__END_DECLS
281
282/*
283 * Common opaque bytes objects used by many rpc protocols;
284 * declared here due to commonality.
285 */
286#define MAX_NETOBJ_SZ 1024
287
288struct netobj {
289 u_int n_len;
290 char *n_bytes;
291 };
292typedef struct netobj netobj;
293
294/*
295 * These are the public routines for the various implementations of
296 * xdr streams.
297 */
298
299__BEGIN_DECLS
300
301extern bool_t xdr_netobj (XDR *, struct netobj *);
302
303/* XDR using memory buffers */
304extern void xdrmem_create (XDR *, char *, u_int, enum xdr_op);
305
306#if defined(__STDIO_H) || defined(_STDIO_H) || defined(__dj_include_stdio_h_)
307 /* XDR using stdio library */
308 extern void xdrstdio_create (XDR *, FILE *, enum xdr_op);
309#endif
310
311/* XDR pseudo records for tcp */
312extern void xdrrec_create (XDR *, u_int, u_int, char *, int (*)(), int (*)());
313
314/* make end of xdr record */
315extern bool_t xdrrec_endofrecord (XDR *, int);
316
317/* move to beginning of next record */
318extern bool_t xdrrec_skiprecord (XDR *);
319
320/* true if no more input */
321extern bool_t xdrrec_eof (XDR *);
322
323__END_DECLS
324
325#endif
cdefs.h
XDR::xdr_ops
Definition: xdr.h:118
XDR
Definition: xdr.h:116
netobj
Definition: xdr.h:288
proc
Definition: if.h:81
xdr_discrim
Definition: xdr.h:209
types.h


Watt-32 tcp/ip: E:/WATT/inc/rpcsvc/yp_prot.h Source File

  • inc
  • rpcsvc
yp_prot.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. The name of the author may not be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
22 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef __RPCSVC_YP_PROT_H
35#define __RPCSVC_YP_PROT_H
36
37#include <rpc/clnt.h>
38
39/*
40 * YPSERV PROTOCOL:
41 *
42 * ypserv supports the following procedures:
43 *
44 * YPPROC_NULL takes (void), returns (void).
45 * called to check if server is alive.
46 * YPPROC_DOMAIN takes (char *), returns (bool_t).
47 * true if ypserv serves the named domain.
48 * YPPROC_DOMAIN_NOACK takes (char *), returns (bool_t).
49 * true if ypserv serves the named domain.
50 * used for broadcasts, does not ack if ypserv
51 * doesn't handle named domain.
52 * YPPROC_MATCH takes (struct ypreq_key), returns (struct ypresp_val)
53 * does a lookup.
54 * YPPROC_FIRST takes (struct ypreq_nokey) returns (ypresp_key_val).
55 * gets the first key/datum from the map.
56 * YPPROC_NEXT takes (struct ypreq_key) returns (ypresp_key_val).
57 * gets the next key/datum from the map.
58 * YPPROC_XFR takes (struct ypreq_xfr), returns (void).
59 * tells ypserv to check if there is a new version of
60 * the map.
61 * YPPROC_CLEAR takes (void), returns (void).
62 * tells ypserv to flush it's file cache, so that
63 * newly transferred files will get read.
64 * YPPROC_ALL takes (struct ypreq_nokey), returns (bool_t and
65 * struct ypresp_key_val).
66 * returns an array of data, with the bool_t being
67 * false on the last datum. read the source, it's
68 * convoluted.
69 * YPPROC_MASTER takes (struct ypreq_nokey), returns (ypresp_master).
70 * YPPROC_ORDER takes (struct ypreq_nokey), returns (ypresp_order).
71 * YPPROC_MAPLIST takes (char *), returns (struct ypmaplist *).
72 */
73
74#if !defined(BOOL_DEFINED) && !defined(__cplusplus)
75typedef u_int bool;
76#define BOOL_DEFINED
77#endif
78
79bool_t xdr_datum();
80bool_t xdr_ypdomain_wrap_string();
81bool_t xdr_ypmap_wrap_string();
82bool_t xdr_ypreq_key();
83bool_t xdr_ypreq_nokey();
84bool_t xdr_ypreq_xfr();
85bool_t xdr_ypresp_val();
86bool_t xdr_ypresp_key_val();
87bool_t xdr_ypbind_resp();
88bool_t xdr_ypbind_setdom();
89bool_t xdr_yp_inaddr();
90bool_t xdr_ypmap_parms();
91bool_t xdr_ypowner_wrap_string();
92bool_t xdr_yppushresp_xfr();
93bool_t xdr_ypresp_order();
94bool_t xdr_ypresp_master();
95bool_t xdr_ypall();
96bool_t xdr_ypresp_maplist();
97
98/* Program and version symbols, magic numbers */
99
100#define YPPROG ((u_long)100004)
101#define YPVERS ((u_long)2)
102#define YPVERS_ORIG ((u_long)1)
103#define YPMAXRECORD ((u_long)1024)
104#define YPMAXDOMAIN ((u_long)64)
105#define YPMAXMAP ((u_long)64)
106#define YPMAXPEER ((u_long)256)
107
108/*
109 * I don't know if anything of sun's depends on this, or if they
110 * simply defined it so that their own code wouldn't try to send
111 * packets over the ethernet MTU. This YP code doesn't use it.
112 */
113#define YPMSGSZ 1600
114
115#ifndef DATUM
116typedef struct {
117 char *dptr;
118 int dsize;
119} datum;
120#define DATUM
121#endif
122
123struct ypmap_parms {
124 char *domain;
125 char *map;
126 u_long ordernum;
127 char *owner;
128};
129
130struct ypreq_key {
131 char *domain;
132 char *map;
133 datum keydat;
134};
135
136struct ypreq_nokey {
137 char *domain;
138 char *map;
139};
140
141struct ypreq_xfr {
142 struct ypmap_parms map_parms;
143 u_long transid;
144 u_long proto;
145 u_short port;
146};
147#define ypxfr_domain map_parms.domain
148#define ypxfr_map map_parms.map
149#define ypxfr_ordernum map_parms.ordernum
150#define ypxfr_owner map_parms.owner
151
152struct ypresp_val {
153 u_long status;
154 datum valdat;
155};
156
157struct ypresp_key_val {
158 u_long status;
159 datum keydat;
160 datum valdat;
161};
162
163struct ypresp_master {
164 u_long status;
165 char *master;
166};
167
168struct ypresp_order {
169 u_long status;
170 u_long ordernum;
171};
172
173struct ypmaplist {
174 char ypml_name[YPMAXMAP + 1];
175 struct ypmaplist *ypml_next;
176};
177
178struct ypresp_maplist {
179 u_long status;
180 struct ypmaplist *list;
181};
182
183/* ypserv procedure numbers */
184#define YPPROC_NULL ((u_long)0)
185#define YPPROC_DOMAIN ((u_long)1)
186#define YPPROC_DOMAIN_NONACK ((u_long)2)
187#define YPPROC_MATCH ((u_long)3)
188#define YPPROC_FIRST ((u_long)4)
189#define YPPROC_NEXT ((u_long)5)
190#define YPPROC_XFR ((u_long)6)
191#define YPPROC_CLEAR ((u_long)7)
192#define YPPROC_ALL ((u_long)8)
193#define YPPROC_MASTER ((u_long)9)
194#define YPPROC_ORDER ((u_long)10)
195#define YPPROC_MAPLIST ((u_long)11)
196
197/* ypserv procedure return status values */
198#define YP_TRUE ((long)1) /* general purpose success code */
199#define YP_NOMORE ((long)2) /* no more entries in map */
200#define YP_FALSE ((long)0) /* general purpose failure code */
201#define YP_NOMAP ((long)-1) /* no such map in domain */
202#define YP_NODOM ((long)-2) /* domain not supported */
203#define YP_NOKEY ((long)-3) /* no such key in map */
204#define YP_BADOP ((long)-4) /* invalid operation */
205#define YP_BADDB ((long)-5) /* server data base is bad */
206#define YP_YPERR ((long)-6) /* YP server error */
207#define YP_BADARGS ((long)-7) /* request arguments bad */
208#define YP_VERS ((long)-8) /* YP server version mismatch */
209
210/*
211 * Sun's header file says:
212 * "Domain binding data structure, used by ypclnt package and ypserv modules.
213 * Users of the ypclnt package (or of this protocol) don't HAVE to know about
214 * it, but it must be available to users because _yp_dobind is a public
215 * interface."
216 *
217 * This is totally bogus! Nowhere else does Sun state that _yp_dobind() is
218 * a public interface, and I don't know any reason anyone would want to call
219 * it. But, just in case anyone does actually expect it to be available..
220 * we provide this.. exactly as Sun wants it.
221 */
222struct dom_binding {
223 struct dom_binding *dom_pnext;
224 char dom_domain[YPMAXDOMAIN + 1];
225 struct sockaddr_in dom_server_addr;
226 u_short dom_server_port;
227 int dom_socket;
228 CLIENT *dom_client;
229 u_short dom_local_port;
230 long dom_vers;
231};
232
233/*
234 * YPBIND PROTOCOL:
235 *
236 * ypbind supports the following procedures:
237 *
238 * YPBINDPROC_NULL takes (void), returns (void).
239 * to check if ypbind is running.
240 * YPBINDPROC_DOMAIN takes (char *), returns (struct ypbind_resp).
241 * requests that ypbind start to serve the
242 * named domain (if it doesn't already)
243 * YPBINDPROC_SETDOM takes (struct ypbind_setdom), returns (void).
244 * used by ypset.
245 */
246
247#define YPBINDPROG ((u_long)100007)
248#define YPBINDVERS ((u_long)2)
249#define YPBINDVERS_ORIG ((u_long)1)
250
251/* ypbind procedure numbers */
252#define YPBINDPROC_NULL ((u_long)0)
253#define YPBINDPROC_DOMAIN ((u_long)1)
254#define YPBINDPROC_SETDOM ((u_long)2)
255
256/* error code in ypbind_resp.ypbind_status */
257enum ypbind_resptype {
258 YPBIND_SUCC_VAL = 1,
259 YPBIND_FAIL_VAL = 2
260};
261
262/* network order, of course */
263struct ypbind_binding {
264 struct in_addr ypbind_binding_addr;
265 u_short ypbind_binding_port;
266 };
267
268struct ypbind_resp {
269 enum ypbind_resptype ypbind_status;
270 union {
271 u_long ypbind_error;
272 struct ypbind_binding ypbind_bindinfo;
273 } ypbind_respbody;
274 };
275
276/* error code in ypbind_resp.ypbind_respbody.ypbind_error */
277#define YPBIND_ERR_ERR 1 /* internal error */
278#define YPBIND_ERR_NOSERV 2 /* no bound server for passed domain */
279#define YPBIND_ERR_RESC 3 /* system resource allocation failure */
280
281/*
282 * Request data structure for ypbind "Set domain" procedure.
283 */
284struct ypbind_setdom {
285 char ypsetdom_domain[YPMAXDOMAIN + 1];
286 struct ypbind_binding ypsetdom_binding;
287 u_short ypsetdom_vers;
288};
289#define ypsetdom_addr ypsetdom_binding.ypbind_binding_addr
290#define ypsetdom_port ypsetdom_binding.ypbind_binding_port
291
292/*
293 * YPPUSH PROTOCOL:
294 *
295 * Sun says:
296 * "Protocol between clients (ypxfr, only) and yppush
297 * yppush speaks a protocol in the transient range, which
298 * is supplied to ypxfr as a command-line parameter when it
299 * is activated by ypserv."
300 *
301 * This protocol is not implemented, naturally, because this YP
302 * implementation only does the client side.
303 */
304#define YPPUSHVERS ((u_long)1)
305#define YPPUSHVERS_ORIG ((u_long)1)
306
307/* yppush procedure numbers */
308#define YPPUSHPROC_NULL ((u_long)0)
309#define YPPUSHPROC_XFRRESP ((u_long)1)
310
311struct yppushresp_xfr {
312 u_long transid;
313 u_long status;
314};
315
316/* yppush status value in yppushresp_xfr.status */
317#define YPPUSH_SUCC ((long)1) /* Success */
318#define YPPUSH_AGE ((long)2) /* Master's version not newer */
319#define YPPUSH_NOMAP ((long)-1) /* Can't find server for map */
320#define YPPUSH_NODOM ((long)-2) /* Domain not supported */
321#define YPPUSH_RSRC ((long)-3) /* Local resource alloc failure */
322#define YPPUSH_RPC ((long)-4) /* RPC failure talking to server */
323#define YPPUSH_MADDR ((long)-5) /* Can't get master address */
324#define YPPUSH_YPERR ((long)-6) /* YP server/map db error */
325#define YPPUSH_BADARGS ((long)-7) /* Request arguments bad */
326#define YPPUSH_DBM ((long)-8) /* Local dbm operation failed */
327#define YPPUSH_FILE ((long)-9) /* Local file I/O operation failed */
328#define YPPUSH_SKEW ((long)-10) /* Map version skew during transfer */
329#define YPPUSH_CLEAR ((long)-11) /* Can't send "Clear" req to local ypserv */
330#define YPPUSH_FORCE ((long)-12) /* No local order number in map - use -f */
331#define YPPUSH_XFRERR ((long)-13) /* ypxfr error */
332#define YPPUSH_REFUSED ((long)-14) /* Transfer request refused by ypserv */
333
334#endif
clnt.h
CLIENT
Definition: clnt.h:120
datum
Definition: yp_prot.h:116
dom_binding
Definition: yp_prot.h:222
in_addr
Definition: in.h:143
sockaddr_in
Definition: in.h:224
ypbind_binding
Definition: yp_prot.h:263
ypbind_resp
Definition: yp_prot.h:268
ypbind_setdom
Definition: yp_prot.h:284
ypmap_parms
Definition: yp_prot.h:123
ypmaplist
Definition: yp_prot.h:173
yppushresp_xfr
Definition: yp_prot.h:311
ypreq_key
Definition: yp_prot.h:130
ypreq_nokey
Definition: yp_prot.h:136
ypreq_xfr
Definition: yp_prot.h:141
ypresp_key_val
Definition: yp_prot.h:157
ypresp_maplist
Definition: yp_prot.h:178
ypresp_master
Definition: yp_prot.h:163
ypresp_order
Definition: yp_prot.h:168
ypresp_val
Definition: yp_prot.h:152


Watt-32 tcp/ip: E:/WATT/inc/rpcsvc/ypclnt.h Source File

  • inc
  • rpcsvc
ypclnt.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. The name of the author may not be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
22 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef __RPCSVC_YPCLNT_H
35#define __RPCSVC_YPCLNT_H
36
37#include <rpcsvc/yp_prot.h>
38
39#define YPERR_BADARGS 1 /* args to function are bad */
40#define YPERR_RPC 2 /* RPC failure */
41#define YPERR_DOMAIN 3 /* can't bind to a server for domain */
42#define YPERR_MAP 4 /* no such map in server's domain */
43#define YPERR_KEY 5 /* no such key in map */
44#define YPERR_YPERR 6 /* some internal YP server or client error */
45#define YPERR_RESRC 7 /* local resource allocation failure */
46#define YPERR_NOMORE 8 /* no more records in map database */
47#define YPERR_PMAP 9 /* can't communicate with portmapper */
48#define YPERR_YPBIND 10 /* can't communicate with ypbind */
49#define YPERR_YPSERV 11 /* can't communicate with ypserv */
50#define YPERR_NODOM 12 /* local domain name not set */
51#define YPERR_BADDB 13 /* YP data base is bad */
52#define YPERR_VERS 14 /* YP version mismatch */
53#define YPERR_ACCESS 15 /* access violation */
54#define YPERR_BUSY 16 /* database is busy */
55
56/*
57 * Types of update operations
58 */
59#define YPOP_CHANGE 1 /* change, do not add */
60#define YPOP_INSERT 2 /* add, do not change */
61#define YPOP_DELETE 3 /* delete this entry */
62#define YPOP_STORE 4 /* add, or change */
63
64struct ypall_callback {
65 int (*foreach)(); /* return non-0 to stop getting called */
66 char *data; /* opaque pointer for use of callback fn */
67 };
68
69int yp_get_default_domain (char **domp);
70int yp_bind (char *dom);
71int _yp_dobind (char *dom, struct dom_binding **ypdb);
72void yp_unbind (char *dom);
73int yp_match (char *indomain, char *inmap, const char *inkey,
74 int inkeylen, char **outval, int *outvallen);
75int yp_first (char *indomain, char *inmap, char **outkey,
76 int *outkeylen, char **outval, int *outvallen);
77int yp_next (char *indomain, char *inmap, char *inkey, int inkeylen,
78 char **outkey, int *outkeylen, char **outval, int *outvallen);
79int yp_master (char *indomain, char *inmap, char **outname);
80int yp_order (char *indomain, char *inmap, int *outorder);
81int yp_all (char *indomain, char *inmap, struct ypall_callback *incallback);
82int yp_invalid_domain (char *dom);
83char *yperr_string (int incode);
84char *ypbinderr_string(int incode);
85int ypprot_err (unsigned int incode);
86
87#endif
88
dom_binding
Definition: yp_prot.h:222
ypall_callback
Definition: ypclnt.h:64
yp_prot.h