Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From fb84a5774bcc32a6cbabad16d6c16b16008688c1 Mon Sep 17 00:00:00 2001
- From: Memphiz <memphis@machzwo.de>
- Date: Thu, 6 Dec 2012 22:29:22 +0100
- Subject: [PATCH] [osx/ios] - implement
- CNetworkInterfaceLinux::GetHostMacAddress (get a mac adr
- from an ip by looking it up in the arp cache)
- ---
- xbmc/network/osx/ioshacks.h | 70 +++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 70 insertions(+)
- create mode 100644 xbmc/network/osx/ioshacks.h
- diff --git a/xbmc/network/osx/ioshacks.h b/xbmc/network/osx/ioshacks.h
- new file mode 100644
- index 0000000..5cc687e
- --- /dev/null
- +++ b/xbmc/network/osx/ioshacks.h
- @@ -0,0 +1,70 @@
- +/*
- + * Copyright (C) 2005-2012 Team XBMC
- + * http://www.xbmc.org
- + *
- + * 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, or (at your option)
- + * 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 XBMC; see the file COPYING. If not, see
- + * <http://www.gnu.org/licenses/>.
- + *
- + */
- +
- +// needed for CNetworkInterfaceLinux::GetHostMacAddress and taken from osx sdk
- +// net/if_types.h net/route.h netinet/if_ether.h
- +
- +/*
- + * These numbers are used by reliable protocols for determining
- + * retransmission behavior and are included in the routing structure.
- + */
- +struct rt_metrics {
- + u_int32_t rmx_locks; /* Kernel must leave these values alone */
- + u_int32_t rmx_mtu; /* MTU for this path */
- + u_int32_t rmx_hopcount; /* max hops expected */
- + int32_t rmx_expire; /* lifetime for route, e.g. redirect */
- + u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */
- + u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */
- + u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */
- + u_int32_t rmx_rtt; /* estimated round trip time */
- + u_int32_t rmx_rttvar; /* estimated rtt variance */
- + u_int32_t rmx_pksent; /* packets sent using this route */
- + u_int32_t rmx_filler[4]; /* will be used for T/TCP later */
- +};
- +
- +/*
- + * Structures for routing messages.
- + */
- +struct rt_msghdr {
- + u_short rtm_msglen; /* to skip over non-understood messages */
- + u_char rtm_version; /* future binary compatibility */
- + u_char rtm_type; /* message type */
- + u_short rtm_index; /* index for associated ifp */
- + int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
- + int rtm_addrs; /* bitmask identifying sockaddrs in msg */
- + pid_t rtm_pid; /* identify sender */
- + int rtm_seq; /* for sender to identify action */
- + int rtm_errno; /* why failed */
- + int rtm_use; /* from rtentry */
- + u_int32_t rtm_inits; /* which metrics we are initializing */
- + struct rt_metrics rtm_rmx; /* metrics themselves */
- +};
- +struct sockaddr_inarp {
- + u_char sin_len;
- + u_char sin_family;
- + u_short sin_port;
- + struct in_addr sin_addr;
- + struct in_addr sin_srcaddr;
- + u_short sin_tos;
- + u_short sin_other;
- +#define SIN_PROXY 1
- +};
- +#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */
- +// --- END
- --
- 1.7.10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement