Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICMP6 Router Advertisement feature #439

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ LOCAL_SRC_FILES := \
src/wpantund/NCPInstance.cpp \
src/wpantund/NCPInstanceBase.cpp \
src/wpantund/FirmwareUpgrade.cpp \
src/wpantund/ICMP6RouterAdvertiser.cpp \
src/wpantund/StatCollector.cpp \
src/wpantund/RunawayResetBackoffManager.cpp \
src/wpantund/NCPInstanceBase-NetInterface.cpp \
Expand Down
343 changes: 343 additions & 0 deletions doc/router-advert-feature-guide.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/ncp-spinel/SpinelNCPInstance-Protothreads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,18 @@ SpinelNCPInstance::vprocess_init(int event, va_list args)
int
SpinelNCPInstance::vprocess_event(int event, va_list args)
{
va_list args_tmp;

if (get_ncp_state() == FAULT) {
// We perform no processing in the fault state.
PT_INIT(&mControlPT);
return 0;
}

va_copy(args_tmp, args);
NCPInstanceBase::vprocess_event(event, args_tmp);
va_end(args_tmp);

while (!mTaskQueue.empty()) {
va_list tmp;
boost::shared_ptr<SpinelNCPTask> current_task(mTaskQueue.front());
Expand Down
21 changes: 21 additions & 0 deletions src/util/netif-mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,3 +532,24 @@ netif_mgmt_leave_ipv6_multicast_address(int reqfd, const char* if_name, const ui
bail:
return ret;
}

int
netif_mgmt_get_hw_address(int fd, const char* if_name, uint8_t addr[6])
{
int ret = -1;

#ifdef SIOCGIFHWADDR
struct ifreq ifr;

memset(&ifr, 0, sizeof(struct ifreq));
strlcpy(ifr.ifr_name, if_name, sizeof(ifr.ifr_name));

ret = ioctl(fd, SIOCGIFHWADDR, &ifr);

if (ret >= 0) {
memcpy(addr, ifr.ifr_hwaddr.sa_data, 6);
}
#endif

return ret;
}
2 changes: 2 additions & 0 deletions src/util/netif-mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ extern int netif_mgmt_remove_ipv6_route(int fd, const char* if_name, const uint8
extern int netif_mgmt_join_ipv6_multicast_address(int reqfd, const char* if_name, const uint8_t addr[16]);
extern int netif_mgmt_leave_ipv6_multicast_address(int reqfd, const char* if_name, const uint8_t addr[16]);

extern int netif_mgmt_get_hw_address(int fd, const char* if_name, uint8_t hw_addr[6]);

#if defined(__cplusplus)
}
#endif
Expand Down
Loading