Skip to content

Commit

Permalink
Added INADDR_LOOPBACK and INADDR_NONE defines. (#40)
Browse files Browse the repository at this point in the history
* Added INADDR_LOOPBACK and INADDR_NONE defines.

* Fix sockaddr_in tabulation.
  • Loading branch information
Rinnegatamante authored and frangarcj committed Jul 22, 2021
1 parent 2bbfac4 commit 7b970c7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions newlib/libc/sys/vita/include/netinet/in.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include <psp2/net/net.h>

#define IPPROTO_IP SCE_NET_IPPROTO_IP
#define IPPROTO_ICMP SCE_NET_IPPROTO_ICMP
#define IPPROTO_IGMP SCE_NET_IPPROTO_IGMP
#define IPPROTO_ICMP SCE_NET_IPPROTO_ICMP
#define IPPROTO_IGMP SCE_NET_IPPROTO_IGMP
#define IPPROTO_TCP SCE_NET_IPPROTO_TCP
#define IPPROTO_UDP SCE_NET_IPPROTO_UDP

Expand All @@ -50,7 +50,7 @@ struct sockaddr_in {
uint8_t sin_len;
sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
struct in_addr sin_addr;
in_port_t sin_vport;
char sin_zero[6];
} sockaddr_in;
Expand All @@ -61,6 +61,9 @@ struct sockaddr_in {
/* Address to send to all hosts. */
#define INADDR_BROADCAST ((in_addr_t) 0xffffffff)

#define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) // 127.0.0.1
#define INADDR_NONE ((in_addr_t) 0xffffffff)

#define ntohs __builtin_bswap16
#define htons __builtin_bswap16
#define ntohl __builtin_bswap32
Expand Down

0 comments on commit 7b970c7

Please sign in to comment.