-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Added input_netif to the stored data #7004
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dd068d2
Added input_netif to the stored data
ec904d6
2. Try
a6c22bf
3. Try, reinserted the UDP message omitting code
8e7970b
Fixed lwip 1.4 error
8136d9c
Fixed LWIP 1.4 issue
58e965a
Merge branch 'master' into LEA_UdpContext
LaborEtArs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,6 +167,26 @@ class UdpContext | |
|
||
#endif // !LWIP_IPV6 | ||
|
||
/* | ||
* Add a netif (by its index) as the multicast interface | ||
*/ | ||
void setMulticastInterface(netif* p_pNetIf) | ||
{ | ||
#if LWIP_VERSION_MAJOR == 1 | ||
udp_set_multicast_netif_addr(_pcb, (p_pNetIf ? ip_2_ip4(p_pNetIf->ip_addr) : ip_addr_any)); | ||
#else | ||
udp_set_multicast_netif_index(_pcb, (p_pNetIf ? netif_get_index(p_pNetIf) : 0)); | ||
#endif | ||
} | ||
|
||
/* | ||
* Allow access to pcb to change eg. options | ||
*/ | ||
udp_pcb* pcb(void) | ||
{ | ||
return _pcb; | ||
} | ||
|
||
void setMulticastTTL(int ttl) | ||
{ | ||
#ifdef LWIP_MAYBE_XCC | ||
|
@@ -205,6 +225,11 @@ class UdpContext | |
return (pos <= _rx_buf->len); | ||
} | ||
|
||
netif* getInputNetif() const | ||
{ | ||
return _currentAddr.input_netif; | ||
} | ||
|
||
CONST IPAddress& getRemoteAddress() CONST | ||
{ | ||
return _currentAddr.srcaddr; | ||
|
@@ -265,7 +290,6 @@ class UdpContext | |
// ref'ing it to prevent release from the below pbuf_free(deleteme) | ||
pbuf_ref(_rx_buf); | ||
} | ||
// remove the already-consumed head of the chain | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps it has to be replaced by |
||
pbuf_free(deleteme); | ||
|
||
_rx_buf_offset = 0; | ||
|
@@ -457,8 +481,10 @@ class UdpContext | |
|
||
d-a-v marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#if LWIP_VERSION_MAJOR == 1 | ||
#define TEMPDSTADDR (¤t_iphdr_dest) | ||
#define TEMPINPUTNETIF (current_netif) | ||
#else | ||
#define TEMPDSTADDR (ip_current_dest_addr()) | ||
#define TEMPINPUTNETIF (ip_current_input_netif()) | ||
#endif | ||
|
||
// chain this helper pbuf first | ||
|
@@ -486,7 +512,7 @@ class UdpContext | |
return; | ||
} | ||
// construct in place | ||
new(PBUF_ALIGNER(pb_helper->payload)) AddrHelper(srcaddr, TEMPDSTADDR, srcport); | ||
new(PBUF_ALIGNER(pb_helper->payload)) AddrHelper(srcaddr, TEMPDSTADDR, srcport, TEMPINPUTNETIF); | ||
pb_helper->flags = PBUF_HELPER_FLAG; // mark helper pbuf | ||
// chain it | ||
pbuf_cat(_rx_buf, pb_helper); | ||
|
@@ -500,6 +526,7 @@ class UdpContext | |
_currentAddr.srcaddr = srcaddr; | ||
_currentAddr.dstaddr = TEMPDSTADDR; | ||
_currentAddr.srcport = srcport; | ||
_currentAddr.input_netif = TEMPINPUTNETIF; | ||
|
||
DEBUGV(":urn %d\r\n", pb->tot_len); | ||
_first_buf_taken = false; | ||
|
@@ -512,6 +539,7 @@ class UdpContext | |
} | ||
|
||
#undef TEMPDSTADDR | ||
#undef TEMPINPUTNETIF | ||
|
||
} | ||
|
||
|
@@ -539,10 +567,11 @@ class UdpContext | |
{ | ||
IPAddress srcaddr, dstaddr; | ||
int16_t srcport; | ||
netif* input_netif; | ||
|
||
AddrHelper() { } | ||
AddrHelper(const ip_addr_t* src, const ip_addr_t* dst, uint16_t srcport): | ||
srcaddr(src), dstaddr(dst), srcport(srcport) { } | ||
AddrHelper(const ip_addr_t* src, const ip_addr_t* dst, uint16_t srcport, netif* input_netif): | ||
srcaddr(src), dstaddr(dst), srcport(srcport), input_netif(input_netif) { } | ||
}; | ||
AddrHelper _currentAddr; | ||
|
||
|
Submodule littlefs
updated
from ce2c01 to 6b6573
Submodule SoftwareSerial
updated
12 files
+0 −502 | LICENSE | |
+35 −41 | examples/loopback/loopback.ino | |
+48 −95 | examples/repeater/repeater.ino | |
+1 −1 | library.json | |
+1 −1 | library.properties | |
+78 −136 | src/SoftwareSerial.cpp | |
+29 −37 | src/SoftwareSerial.h | |
+0 −1,786 | src/circular_queue/Delegate.h | |
+0 −503 | src/circular_queue/MultiDelegate.h | |
+32 −32 | src/circular_queue/circular_queue.h | |
+37 −37 | src/circular_queue/circular_queue_mp.h | |
+4 −16 | src/circular_queue/ghostl.h |
Submodule bearssl
updated
6 files
+1 −1 | inc/bearssl_ec.h | |
+1 −1 | inc/bearssl_ssl.h | |
+4 −0 | src/ec/ec_c25519_m64.c | |
+1 −1 | src/ec/ec_p256_m62.c | |
+1 −1 | src/x509/x509_minimal.t0 | |
+1 −1 | tools/sslio.c |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ip_2_ip4()
is useless with lwIP-1.4Arduino/cores/esp8266/IPAddress.h
Line 33 in 00440cd