Skip to content

Commit

Permalink
Merge pull request #1075 from Dennisbonke/libndp
Browse files Browse the repository at this point in the history
options/posix: Add more defines and structs for libndp
  • Loading branch information
Geertiebear authored Jun 5, 2024
2 parents 1580691 + bfadfa0 commit f42f0b6
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions abis/linux/limits.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#define IOV_MAX 1024
#define LOGIN_NAME_MAX 256
#define HOST_NAME_MAX 64
#define NAME_MAX 255
#define OPEN_MAX 256

Expand Down
2 changes: 2 additions & 0 deletions options/glibc/include/resolv.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#define MAXNS 3
#define MAXDNSRCH 6

#define _PATH_RESCONF "/etc/resolv.conf"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
24 changes: 24 additions & 0 deletions options/posix/include/netinet/icmp6.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,30 @@ struct nd_opt_mtu {
uint32_t nd_opt_mtu_mtu;
};

struct nd_neighbor_solicit {
struct icmp6_hdr nd_ns_hdr;
struct in6_addr nd_ns_target;
};

struct nd_neighbor_advert {
struct icmp6_hdr nd_na_hdr;
struct in6_addr nd_na_target;
};
#define nd_na_type nd_na_hdr.icmp6_type
#define nd_na_code nd_na_hdr.icmp6_code
#define nd_na_cksum nd_na_hdr.icmp6_cksum
#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]

struct nd_redirect {
struct icmp6_hdr nd_rd_hdr;
struct in6_addr nd_rd_target;
struct in6_addr nd_rd_dst;
};

#define ND_NA_FLAG_OVERRIDE 0x00000020
#define ND_NA_FLAG_SOLICITED 0x00000040
#define ND_NA_FLAG_ROUTER 0x00000080

#ifdef __cplusplus
}
#endif
Expand Down
5 changes: 5 additions & 0 deletions options/posix/include/netinet/if_ether.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,10 @@ struct ether_arp {
uint8_t arp_tha[ETH_ALEN];
uint8_t arp_tpa[4];
};
#define arp_hrd ea_hdr.ar_hrd
#define arp_pro ea_hdr.ar_pro
#define arp_hln ea_hdr.ar_hln
#define arp_pln ea_hdr.ar_pln
#define arp_op ea_hdr.ar_op

#endif //_NETINET_IF_ETHER_H
1 change: 1 addition & 0 deletions options/posix/include/netinet/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ extern "C" {
#define IPTOS_RELIABILITY 0x04
#define IPTOS_LOWCOST 0x02
#define IPTOS_MINCOST IPTOS_LOWCOST
#define IPTOS_CLASS_CS0 0x00
#define IPTOS_CLASS_CS4 0x80
#define IPTOS_CLASS_CS6 0xC0

Expand Down
1 change: 0 additions & 1 deletion options/posix/include/sys/param.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// Report the same value as Linux here.
#define MAXNAMLEN 255
#define MAXPATHLEN 4096
#define HOST_NAME_MAX 64
#define MAXSYMLINKS 20
#define MAXHOSTNAMELEN HOST_NAME_MAX

Expand Down

0 comments on commit f42f0b6

Please sign in to comment.