forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for enable and init DHCPv6 Relay agent instance. Server and relay cant work same time Relay instance have own socket callback which support to forward data mesages between client and server Server support Relay reply message build Change-Id: Ia9f53d8b2e40d0560d73090bd539cfc20f65e35b
- Loading branch information
Juha Heiskanen
committed
Oct 11, 2018
1 parent
62812ab
commit 08155b1
Showing
6 changed files
with
722 additions
and
7 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* Copyright (c) 2018, Arm Limited and affiliates. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef DHCPV6_CLIENT_API_H_ | ||
#define DHCPV6_CLIENT_API_H_ | ||
#include <ns_types.h> | ||
|
||
/* DHCP client implementation. | ||
* | ||
* Responsibilities of this module are: | ||
* - handle Global address queries and refresh inside network. | ||
* | ||
*/ | ||
|
||
/* Initialize dhcp client. | ||
* | ||
* This instance needs to bee initialized once for each network interface. | ||
* if only one thread instance is supported this is needed to call only once. | ||
* | ||
* /param interface interface id of this instance. | ||
* | ||
*/ | ||
|
||
void dhcp_client_init(int8_t interface); | ||
|
||
/* Delete dhcp client. | ||
* | ||
* When this is called all addressed assigned by this module are removed from stack. | ||
*/ | ||
void dhcp_client_delete(int8_t interface); | ||
|
||
/* Global address handler. | ||
* | ||
* This module updates the addresses from dhcp server and sets them in stack. | ||
* this module makes refresh of address when needed. | ||
* | ||
*/ | ||
|
||
|
||
/* give dhcp server and prefix for global address assignment | ||
* | ||
* /param interface interface where address is got | ||
* /param dhcp_addr dhcp server ML16 address where address is registered. | ||
* /param prefix dhcp server ML16 address where address is registered. | ||
* /param mac64 64 bit mac address for identifieng client. | ||
* /param error_cb error callback that is called if address cannot be created or becomes invalid. | ||
* /param register_status true if address registered. | ||
* | ||
*/ | ||
typedef void (dhcp_client_global_adress_cb)(int8_t interface, uint8_t dhcp_addr[static 16], uint8_t prefix[static 16], bool register_status); | ||
|
||
int dhcp_client_get_global_address(int8_t interface, uint8_t dhcp_addr[static 16], uint8_t prefix[static 16], uint8_t mac64[static 8], dhcp_client_global_adress_cb *error_cb); | ||
|
||
/* Renew all leased adddresses might be used when short address changes | ||
* | ||
* /param interface interface where address is got | ||
*/ | ||
void dhcp_client_global_address_renew(int8_t interface); | ||
|
||
/* Delete address from device | ||
* if prefix is NULL all are deleted | ||
* | ||
* /param interface interface where address is got | ||
* /param prefix dhcp server ML16 address where address is registered. | ||
* | ||
*/ | ||
void dhcp_client_global_address_delete(int8_t interface, uint8_t dhcp_addr[static 16], uint8_t prefix[static 16]); | ||
|
||
|
||
|
||
#endif /* DHCPV6_CLIENT_API_H_ */ |
Oops, something went wrong.