Differences From Artifact [685346fedf]:
- File src/socket.m — part of check-in [4a5822e7c0] at 2020-04-25 23:02:16 on branch trunk — Add OFIPXSocket (user: js, size: 19913) [annotate] [blame] [check-ins using]
To Artifact [b25bff7c1b]:
- File
src/socket.m
— part of check-in
[2ff4218405]
at
2020-04-26 10:56:11
on branch trunk
— Replace of_socket_address_ipx_get()
Instead, provide getters and setters for the various address parts. (user: js, size: 20756) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
778 779 780 781 782 783 784 785 786 787 788 789 790 791 | switch (address->family) { case OF_SOCKET_ADDRESS_FAMILY_IPV4: address->sockaddr.in.sin_port = OF_BSWAP16_IF_LE(port); break; case OF_SOCKET_ADDRESS_FAMILY_IPV6: address->sockaddr.in6.sin6_port = OF_BSWAP16_IF_LE(port); break; default: @throw [OFInvalidArgumentException exception]; } } uint16_t of_socket_address_get_port(const of_socket_address_t *address) | > > > | 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 | switch (address->family) { case OF_SOCKET_ADDRESS_FAMILY_IPV4: address->sockaddr.in.sin_port = OF_BSWAP16_IF_LE(port); break; case OF_SOCKET_ADDRESS_FAMILY_IPV6: address->sockaddr.in6.sin6_port = OF_BSWAP16_IF_LE(port); break; case OF_SOCKET_ADDRESS_FAMILY_IPX: address->sockaddr.ipx.sipx_port = OF_BSWAP16_IF_LE(port); break; default: @throw [OFInvalidArgumentException exception]; } } uint16_t of_socket_address_get_port(const of_socket_address_t *address) |
︙ | ︙ | |||
799 800 801 802 803 804 805 | return OF_BSWAP16_IF_LE(address->sockaddr.ipx.sipx_port); default: @throw [OFInvalidArgumentException exception]; } } void | > > > > > > > > > > > > | > > > > > > > > > > > > > | | > | > > > > > > > < | 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 | return OF_BSWAP16_IF_LE(address->sockaddr.ipx.sipx_port); default: @throw [OFInvalidArgumentException exception]; } } void of_socket_address_set_ipx_network(of_socket_address_t *address, uint32_t network) { if (address->family != OF_SOCKET_ADDRESS_FAMILY_IPX) @throw [OFInvalidArgumentException exception]; network = OF_BSWAP32_IF_LE(network); memcpy(&address->sockaddr.ipx.sipx_network, &network, sizeof(address->sockaddr.ipx.sipx_network)); } uint32_t of_socket_address_get_ipx_network(const of_socket_address_t *address) { uint32_t network; if (address->family != OF_SOCKET_ADDRESS_FAMILY_IPX) @throw [OFInvalidArgumentException exception]; memcpy(&network, &address->sockaddr.ipx.sipx_network, sizeof(network)); return OF_BSWAP32_IF_LE(network); } void of_socket_address_set_ipx_node(of_socket_address_t *address, const unsigned char node[IPX_NODE_LEN]) { if (address->family != OF_SOCKET_ADDRESS_FAMILY_IPX) @throw [OFInvalidArgumentException exception]; memcpy(address->sockaddr.ipx.sipx_node, node, IPX_NODE_LEN); } void of_socket_address_get_ipx_node(const of_socket_address_t *address, unsigned char node[IPX_NODE_LEN]) { if (address->family != OF_SOCKET_ADDRESS_FAMILY_IPX) @throw [OFInvalidArgumentException exception]; memcpy(node, address->sockaddr.ipx.sipx_node, IPX_NODE_LEN); } |