Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lwip_stack.h Source File

lwip_stack.h

00001 /* LWIP implementation of NetworkInterfaceAPI
00002  * Copyright (c) 2015 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef LWIP_STACK_H
00018 #define LWIP_STACK_H
00019 
00020 #include "nsapi.h"
00021 #include "emac_api.h"
00022 #include "lwip/opt.h"
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 // Access to lwip through the nsapi - be wary of API changes as external 1st-generation EMAC
00028 // drivers attach through these.
00029 nsapi_error_t mbed_lwip_init(emac_interface_t *emac);
00030 nsapi_error_t mbed_lwip_emac_init(emac_interface_t *emac);
00031 nsapi_error_t mbed_lwip_bringup(bool dhcp, const char *ip, const char *netmask, const char *gw);
00032 nsapi_error_t mbed_lwip_bringup_2(bool dhcp, bool ppp, const char *ip, const char *netmask, const char *gw, const nsapi_ip_stack_t stack);
00033 nsapi_error_t mbed_lwip_bringdown(void);
00034 nsapi_error_t mbed_lwip_bringdown_2(bool ppp);
00035 
00036 const char *mbed_lwip_get_mac_address(void);
00037 char *mbed_lwip_get_ip_address(char *buf, nsapi_size_t buflen);
00038 char *mbed_lwip_get_netmask(char *buf, nsapi_size_t buflen);
00039 char *mbed_lwip_get_gateway(char *buf, nsapi_size_t buflen);
00040 
00041 extern nsapi_stack_t lwip_stack;
00042 
00043 #ifdef __cplusplus
00044 }
00045 #endif
00046 
00047 #endif