Skip to content

Netsocket: Introduce set_ip_address and get_dns_server APIs #12606

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

Merged
merged 3 commits into from
Apr 15, 2020
Merged

Netsocket: Introduce set_ip_address and get_dns_server APIs #12606

merged 3 commits into from
Apr 15, 2020

Conversation

kivaisan
Copy link
Contributor

Summary of changes

set_ip_address API can be used to set a static IPv4 address or IPv6 link-local address to network stack. This is needed for example in cellular use cases where device gets multiple IP addresses from cellular context.

With get_dns_server DNS servers can be queried from NetworkInterface object

Impact of changes

Migration actions required

Documentation


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[X] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@ARMmbed/mbed-os-ipcore


@mergify mergify bot added the needs: work label Mar 10, 2020
@ciarmcom ciarmcom requested review from a team March 10, 2020 10:00
@ciarmcom
Copy link
Member

@kivaisan, thank you for your changes.
@ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

@kivaisan
Copy link
Contributor Author

Fixed astyle.

@kivaisan
Copy link
Contributor Author

@AnttiKauppila @mikaleppanen Could you please review this?


int conv_ip = 1;

#if LWIP_IPV4

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If both LWIP_IPV4 & 6 are enabled, can you still set IPv6 address? inet_aton returns NULL in case of wrong format? Maybe a comment would be needed here to make it clear?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you can. In one of our projects we set up static IPv4 address using set_ip_address API and then give link-local IPv6 address in bringup. And bringup internally uses the same set_ip_address to set IPv6 address.

AnttiKauppila
AnttiKauppila previously approved these changes Mar 13, 2020
* @param interface_name Network interface name
* @return NSAPI_ERROR_OK on success, negative error code on failure
*/
virtual nsapi_error_t get_dns_server(int index, SocketAddress *address, const char *interface_name = NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the file, it was already changed to contain "override" rather than "virtual", please review the other methods and update this one as well

cc @kjbracey-arm was the design Mbed OS guidance updated and team as well to follow the latest changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a base class declaration so this needs to be virtual.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, I had to opened a different file , can;t find it now.

@mergify mergify bot added needs: work and removed needs: CI labels Mar 16, 2020
0xc0170
0xc0170 previously approved these changes Mar 19, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Mar 19, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Mar 19, 2020

Test run: FAILED

Summary: 1 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM

@adbridge
Copy link
Contributor

Looks possibly CI related so restarting

@mbed-ci
Copy link

mbed-ci commented Mar 27, 2020

Test run: FAILED

Summary: 1 of 3 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM

@kivaisan
Copy link
Contributor Author

kivaisan commented Mar 30, 2020

Build seems to fail to EMW3166 ARMC6 WICED binary. @tymoteuszblochmobica was it just recently updated or is it missing something as GCC_ARM build succeeds(?) ?

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 3, 2020

Build seems to fail to EMW3166 ARMC6 WICED binary. @tymoteuszblochmobica was it just recently updated or is it missing something as GCC_ARM build succeeds(?) ?

@tymoteuszblochmobica Please review

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 9, 2020

@kivaisan Is there anyone else besides @tymoteuszblochmobica who could help to progress here?

@mergify mergify bot dismissed stale reviews from AnttiKauppila and 0xc0170 April 14, 2020 06:56

Pull request has been modified.

@mergify
Copy link

mergify bot commented Apr 14, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

Kimmo Vaisanen added 3 commits April 14, 2020 12:04
set_ip_address API can be used to set a static IPv4 address or IPv6 link-local
address to network stack.

This is needed for example in cellular use cases where device gets multiple IP
addresses from cellular context.
With get_dns_server DNS servers can be queried from NetworkInterface object
@kivaisan
Copy link
Contributor Author

I rebuilt WICED binaries and included them in this PR and it fixes the build issue with EMW3166.

@mergify mergify bot added needs: CI and removed needs: work labels Apr 14, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 14, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 14, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 3
Build artifacts

@0xc0170 0xc0170 merged commit 4c444ae into ARMmbed:master Apr 15, 2020
@mergify mergify bot removed the ready for merge label Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants