Advertisement
Guest User

Untitled

a guest
Dec 6th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. From fb84a5774bcc32a6cbabad16d6c16b16008688c1 Mon Sep 17 00:00:00 2001
  2. From: Memphiz <memphis@machzwo.de>
  3. Date: Thu, 6 Dec 2012 22:29:22 +0100
  4. Subject: [PATCH] [osx/ios] - implement
  5. CNetworkInterfaceLinux::GetHostMacAddress (get a mac adr
  6. from an ip by looking it up in the arp cache)
  7.  
  8. ---
  9. xbmc/network/osx/ioshacks.h | 70 +++++++++++++++++++++++++++++++++++++++++++
  10. 1 file changed, 70 insertions(+)
  11. create mode 100644 xbmc/network/osx/ioshacks.h
  12.  
  13. diff --git a/xbmc/network/osx/ioshacks.h b/xbmc/network/osx/ioshacks.h
  14. new file mode 100644
  15. index 0000000..5cc687e
  16. --- /dev/null
  17. +++ b/xbmc/network/osx/ioshacks.h
  18. @@ -0,0 +1,70 @@
  19. +/*
  20. + * Copyright (C) 2005-2012 Team XBMC
  21. + * http://www.xbmc.org
  22. + *
  23. + * This Program is free software; you can redistribute it and/or modify
  24. + * it under the terms of the GNU General Public License as published by
  25. + * the Free Software Foundation; either version 2, or (at your option)
  26. + * any later version.
  27. + *
  28. + * This Program is distributed in the hope that it will be useful,
  29. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  30. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  31. + * GNU General Public License for more details.
  32. + *
  33. + * You should have received a copy of the GNU General Public License
  34. + * along with XBMC; see the file COPYING. If not, see
  35. + * <http://www.gnu.org/licenses/>.
  36. + *
  37. + */
  38. +
  39. +// needed for CNetworkInterfaceLinux::GetHostMacAddress and taken from osx sdk
  40. +// net/if_types.h net/route.h netinet/if_ether.h
  41. +
  42. +/*
  43. + * These numbers are used by reliable protocols for determining
  44. + * retransmission behavior and are included in the routing structure.
  45. + */
  46. +struct rt_metrics {
  47. + u_int32_t rmx_locks; /* Kernel must leave these values alone */
  48. + u_int32_t rmx_mtu; /* MTU for this path */
  49. + u_int32_t rmx_hopcount; /* max hops expected */
  50. + int32_t rmx_expire; /* lifetime for route, e.g. redirect */
  51. + u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */
  52. + u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */
  53. + u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */
  54. + u_int32_t rmx_rtt; /* estimated round trip time */
  55. + u_int32_t rmx_rttvar; /* estimated rtt variance */
  56. + u_int32_t rmx_pksent; /* packets sent using this route */
  57. + u_int32_t rmx_filler[4]; /* will be used for T/TCP later */
  58. +};
  59. +
  60. +/*
  61. + * Structures for routing messages.
  62. + */
  63. +struct rt_msghdr {
  64. + u_short rtm_msglen; /* to skip over non-understood messages */
  65. + u_char rtm_version; /* future binary compatibility */
  66. + u_char rtm_type; /* message type */
  67. + u_short rtm_index; /* index for associated ifp */
  68. + int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
  69. + int rtm_addrs; /* bitmask identifying sockaddrs in msg */
  70. + pid_t rtm_pid; /* identify sender */
  71. + int rtm_seq; /* for sender to identify action */
  72. + int rtm_errno; /* why failed */
  73. + int rtm_use; /* from rtentry */
  74. + u_int32_t rtm_inits; /* which metrics we are initializing */
  75. + struct rt_metrics rtm_rmx; /* metrics themselves */
  76. +};
  77. +struct sockaddr_inarp {
  78. + u_char sin_len;
  79. + u_char sin_family;
  80. + u_short sin_port;
  81. + struct in_addr sin_addr;
  82. + struct in_addr sin_srcaddr;
  83. + u_short sin_tos;
  84. + u_short sin_other;
  85. +#define SIN_PROXY 1
  86. +};
  87. +#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */
  88. +// --- END
  89. --
  90. 1.7.10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement