[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [task #14283] Add more detailed status callback
From: |
Joel Cunningham |
Subject: |
[lwip-devel] [task #14283] Add more detailed status callback |
Date: |
Tue, 14 Feb 2017 17:45:14 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/602.4.8 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8 |
Follow-up Comment #5, task #14283 (project lwip):
Dirk,
I took a look over the API and it looks like a great improvement over the
other callbacks, especially providing the old IP address for some of the
notifications.
My only feedback is I wonder if the num/arg can be improved. If I understood
correctly, num is really just a second arg that is not a pointer, so you have
two possible arguments which the application has to interpret from the
documentation
Would something like a union allocated on the stack and then passing a pointer
to maybe be easier for applications to work with (also allow future growth in
parameters)? For callbacks that don't pass any data, they could send NULL. I
mocked this up:
union netif_nsc_reason_data {
/* Valid for LWIP_NSC_LINK_CHANGED
LWIP_NSC_STATUS_CHANGED */
u8_t state; /* 1 for up, 0 for down */
/* Valid for: LWIP_NSC_IPV4_ADDRESS_CHANGED
LWIP_NSC_IPV4_GATEWAY_CHANGED
LWIP_NSC_IPV4_NETMASK_CHANGED */
ip_addr_t* old address;
/* Valid for: LWIP_NSC_IPV6_SET
LWIP_NSC_IPV6_ADDR_STATE_CHANGED */
struct {
u8_t index;
ip_addr_t* old address;
} ipv6;
}
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/task/?14283>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/