| /** |
| * @file netapi.h |
| * @brief Public APIs of Sanechips, linux network external interface |
| * |
| * Copyright (C) 2017 Sanechips Technology Co., Ltd. |
| * @author Linxu Gebin |
| * |
| * This program is free software; you can redistribute it and/or modify |
| * it under the terms of the GNU General Public License version 2 as |
| * published by the Free Software Foundation. |
| * |
| ************************************************************************ |
| */ |
| |
| #ifndef __NETAPI_H__ |
| #define __NETAPI_H__ |
| |
| /******************************************************************************* |
| * Include header files * |
| ******************************************************************************/ |
| #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| /******************************************************************************* |
| * Macro definitions * |
| ******************************************************************************/ |
| /** |
| * @brief NVÖµµÄ³¤¶È£¬ÎªÁ˽Úʡջ¿Õ¼äʹÓÃÕâ¸öºê£¬ÈôʹÓÃNV_MAX_KEY_LENÓпÉÄÜ»áÔì³ÉÕ»Ô½½ç |
| */ |
| #define NV_NAME_LEN 30 |
| |
| #define RJ45_ALL_OUT 0x00 |
| #define RJ45_LAN_IN 0x01 |
| #define RJ45_WAN_IN 0x02 |
| #define RJ45_ALL_IN 0x03 |
| |
| #define USB_LAN_OUT 0x00 |
| #define USB_LAN_IN 0x01 |
| |
| |
| |
| /** |
| * @brief ¹©atÏà¹ØÓ¦Óýø³Ìµ÷ÓÃÍøÂç½Ó¿Úʱ¸³Öµ£¬Ö¸Ê¾PDP ¼¤»îµÄ·¢ÆðλÖ㬽ø¶ø¹©ÍøÂçÄÚ²¿½øÐв»Í¬×éÍøºÍ·ÓÉÅäÖà |
| * @param PDP_LOCAL ±íʾÊDZ¾µØÓ¦Ó÷¢ÆðµÄPDP¼¤»î£¬Èç²ÊÐÅ¡¢VoLTEµÈ |
| * @param PDP_EXT ±íʾÊÇÓɷDZ¾ºËÄÚ·¢ÆðµÄATÃüÁîÁ÷³Ì£¬Èç´ó°å·¢ÆðµÄATÃüÁÎÒÃǺËÄÚ½ö×÷͸´«£¬´ËʱÐèÒª¶ÔÍø¿Ú½øÐÐÖ±Á¬£» |
| * @param PDP_NORMAL ±íʾÊDZ¾ºËµÄatserver·¢ÆðµÄPDP¼¤»î£¬ÓÃÓÚNATת»»µÄÍâÍø¿Ú |
| * @param PDP_PPP ±íʾÊDZ¾ºËµÄPPPÏà¹ØµÄPDP¼¤»î£¬³£¼ûÓÚÄ£¿éµÄPPP¹¦ÄÜÐèÇó |
| */ |
| #define PDP_LOCAL 0 |
| #define PDP_EXT 1 |
| #define PDP_NORMAL 2 |
| #define PDP_PPP 3 |
| |
| #define NONE_AUTH 0 |
| #define PAP_AUTH 1 |
| #define CHAP_AUTH 2 |
| #define PAP_CHAP_AUTH 3 |
| #define PPP_NONE_AUTH 4 |
| #define PPP_CHAP_AUTH 5 |
| #define PPP_PAP_AUTH PAP_AUTH |
| |
| /** |
| * @brief IPV4µØÖ·³¤¶ÈÉÏÏÞ |
| */ |
| #define IPV4ADDLEN_MAX 16 |
| |
| /** |
| * @brief IPV6µØÖ·³¤¶ÈÉÏÏÞ |
| */ |
| #define IPV6ADDLEN_MAX 46 |
| |
| /** |
| * @brief MACµØÖ·³¤¶ÈÉÏÏÞ |
| */ |
| #define MAX_MACADDR_LEN 14 |
| |
| /** |
| * @brief MACµØÖ·³¤¶È |
| */ |
| #define MAC_ADDR_LEN 18 |
| |
| /** |
| * @brief Ö÷»úÃû³¤¶È |
| */ |
| #define HOSTNAME_LEN 150 |
| |
| /** |
| * @brief ÍøÖ·³¤¶È |
| */ |
| #define SITE_LEN 400 |
| |
| |
| /** |
| * @brief PPPDʹÓõĺ궨Òå |
| * @param NUM_PPPD_AUTH Ò»¸öppp½ø³ÌÖ§³ÖµÄÓû§ÊýÁ¿ |
| * @param USER_MAX Óû§Ãû»òÕßÌôÕ½idµÄ³¤¶ÈÉÏÏÞ |
| * @param PW_MAX ÃÜÂëµÄ³¤¶ÈÉÏÏÞ |
| * @param CHALLENGE_MAX ÌôÕ½»ØÓ¦ÉÏÏÞ |
| */ |
| #define NUM_PPPD_AUTH 1 |
| #define USER_MAX 50 |
| #define PW_MAX 50 |
| #define CHALLENGE_MAX 50 |
| |
| |
| /** |
| * @brief ¶¨ÒåPDP¼¤»îÀàÐÍ |
| * @param V4V6_INVALID ³õʼֵ£¬²»½øÐÐÈκβÙ×÷ |
| * @param V4_VALID ¶ÔV4½øÐвÙ×÷£¬°üÀ¨¼¤»îºÍÈ¥»î |
| * @param V6_VALID ¶ÔV6½øÐвÙ×÷£¬°üÀ¨¼¤»îºÍÈ¥»î |
| * @param V46_VALID ¶ÔV4ºÍV6½øÐвÙ×÷£¬°üÀ¨¼¤»îºÍÈ¥»î |
| */ |
| enum ipv4v6_flag { |
| V4V6_INVALID = 0x00, |
| V4_VALID, |
| V6_VALID, |
| V46_VALID, |
| }; |
| |
| /** |
| * @brief ¶¨ÒåÍø¿Ú״̬ |
| * @param DEV_STATE_IDLE ÍøÂçÉ豸´¦ÓÚ¿ÕÏÐ״̬ |
| * @param DEV_STATE_CONNECT ÍøÂçÉ豸´¦ÓÚ»ñÈ¡µØÖ·×´Ì¬ |
| * @param DEV_STATE_WORKING ÍøÂçÉ豸»ñÈ¡µØÖ·Íê³É£¬´¦ÓÚ¹¤×÷״̬ |
| * @param DEV_STATE_DEAD ÍøÂçÉ豸´¦ÓÚÍøÂçÁ¬½Ó¶Ï¿ª×´Ì¬ |
| */ |
| enum emDev_State { |
| DEV_STATE_IDLE, |
| DEV_STATE_CONNECT, |
| DEV_STATE_WORKING, |
| DEV_STATE_DEAD, |
| }; |
| |
| /** |
| * brief ¶¨ÒåËùÓеÄÄÚÍâÍø¿Ú¡¢¼¶ÁªµÈÍøÂçÉ豸IDºêÖµ |
| * @param PS_NET_DEV PS ÍøÂçÉ豸±êʶ£¬µ±ÔËÐÐÔÚAPºËʱ£¬Æä¶ÔÓ¦µÄÍøÂçÉ豸ΪUSB¡¢DDRNETµÈÐéÄâ³öµÄÍøÂçÉ豸 |
| * @param PS_EXT_DEV1 ÓëPS¼¶ÁªµÄÍøÂçÉ豸£¬³£¼ûÓÚÊý¾Ý¿¨ÐÎ̬£¬Ò»°ãΪUSBÎïÀíͨµÀ£¬Ò²¿ÉÄÜÊǹ²ÏíDDRµÈͨµÀ£¬µ«¹²ÏíDDRͨµÀÎÞÈȲå°ÎʼþÉϱ¨ |
| * @param PS_EXT_DEV2 Ŀǰ֧³Ö1-8µÄCID¹ØÁª |
| * @param PS_EXT_DEV3 Ŀǰ֧³Ö1-8µÄCID¹ØÁª |
| * @param PS_EXT_DEV4 Ŀǰ֧³Ö1-8µÄCID¹ØÁª |
| * @param PS_EXT_DEV5 Ŀǰ֧³Ö1-8µÄCID¹ØÁª |
| * @param PS_EXT_DEV6 Ŀǰ֧³Ö1-8µÄCID¹ØÁª |
| * @param PS_EXT_DEV7 Ŀǰ֧³Ö1-8µÄCID¹ØÁª |
| * @param PS_EXT_DEV8 Ŀǰ֧³Ö1-8µÄCID¹ØÁª |
| * @param RJ45_WAN_DEV RJ45ÍâÍø¿ÚÉ豸±êʶ£¬Ïà¶ÔÓÚRJ45_LAN_DEV£¬ÓÅÏÈʶ±ð£¬ÒòΪÍâÍø¿ÚÖ§³ÖÄÚÍâÍø×Ô¶¯Çл» |
| * @param RJ45_LAN_DEV RJ45ÄÚÍø¿ÚÉ豸±êʶ£¬½öÓÃÓÚRJ45ÄÚÍâÍø¿Úͬʱ´æÔÚ³¡¾° |
| * @param SW_WAN_DEV Realtek switch ÍâÍø¿ÚÉ豸±êʶ£¬Ö§³ÖÈȲå°Î |
| * @param SW_LAN_DEV Realtek switch ÍâÍø¿ÚÉ豸±êʶ£¬Ö§³ÖÈȲå°Î |
| * @param WIFI_WAN_DEV stationÍâÍø¿ÚÉ豸±êʶ |
| * @param WIFI_LAN_DEV stationÄÚÍø¿ÚÉ豸±êʶ |
| * @param USB_LAN_DEV USBÄÚÍø¿ÚÉ豸±êʶ |
| * @param NO_DEV ȱʡÍâÍø¿ÚΪ¿Õʱºò±êʶ |
| */ |
| enum dev_ID { |
| PS_NET_DEV, |
| PS_EXT_DEV1, |
| PS_EXT_DEV2, |
| PS_EXT_DEV3, |
| PS_EXT_DEV4, |
| PS_EXT_DEV5, |
| PS_EXT_DEV6, |
| PS_EXT_DEV7, |
| PS_EXT_DEV8, |
| RJ45_WAN_DEV, |
| RJ45_LAN_DEV, |
| SW_WAN_DEV, |
| SW_LAN_DEV, |
| WIFI_WAN_DEV, |
| WIFI_LAN_DEV, |
| USB_LAN_DEV, |
| NO_DEV, |
| }; |
| |
| /** |
| * @brief ÍâÍø¿ÚÁªÍøÊ§°ÜµÄÔÒòIDºêÖµ |
| * @param TIME_OUT Á¬½Ó³¬Ê± |
| */ |
| enum dialfail_reason_ID { |
| TIME_OUT = 0, |
| }; |
| |
| /** |
| * @brief Íø¿ÚµÄip46µÈµØÖ·ÐÅÏ¢ |
| * @param ip46flag ipv4/ipv6 ±ê־λ |
| * @param ip ipv4µØÖ· |
| * @param gateway Íø¹ØµØÖ· |
| * @param netmask ÑÚÂë |
| * @param pri_dns Ê×Ñ¡dnsµØÖ· |
| * @param sec_dns ´ÎÑ¡dnsµØÖ· |
| * @param ip6 ipv6 µØÖ· |
| * @param gateway6 ipv6 Íø¹ØµØÖ· |
| * @param pri_dns6 ipv6 Ê×Ñ¡dnsµØÖ· |
| * @param sec_dns6 ipv6 ´ÎÑ¡dnsµØÖ· |
| * @note ip46flag µÄȡֵ²Î¿¼V46_VALIDµÈºêÖµ |
| */ |
| struct netdev_act_info { |
| unsigned char ip46flag; |
| char ip[IPV4ADDLEN_MAX]; |
| char gateway[IPV4ADDLEN_MAX]; |
| char netmask[IPV4ADDLEN_MAX]; |
| char pri_dns[IPV4ADDLEN_MAX]; |
| char sec_dns[IPV4ADDLEN_MAX]; |
| char ip6[IPV6ADDLEN_MAX]; |
| char gateway6[IPV6ADDLEN_MAX]; |
| char pri_dns6[IPV6ADDLEN_MAX]; |
| char sec_dns6[IPV6ADDLEN_MAX]; |
| }; |
| |
| /** |
| * @brief ½á¹¹Ìå˵Ã÷:PDP¼¤»îÐÅÏ¢£¬×¨ÓÃÓÚPSÍâÍø¿Ú£¬ÆäÖÐcidÓÃÓÚʶ±ð²»Í¬µÄPSÍâÍø¿Ú |
| * @param c_id PDPΨһ±êʶ |
| * @param pdp_type pdp ¼¤»îÀàÐÍ |
| * @param act_info Íø¿ÚµØÖ·µÈÐÅÏ¢ |
| * @note pdp type µÄȡֵ²Î¼ûPDP_LOCALµÈºêÖµ |
| */ |
| struct pdp_active_info { |
| int c_id; |
| unsigned char pdp_type; |
| struct netdev_act_info act_info; |
| }; |
| |
| /** |
| * @brief macµØÖ·ºÍ¶ÔÓ¦Ö÷»úÃûÐÅÏ¢ |
| * @param mac macµØÖ· |
| * @param hostname macµØÖ·¶ÔÓ¦µÄÖ÷»úÃû |
| */ |
| struct mac_hostname_info { |
| char mac[MAC_ADDR_LEN]; |
| char hostname[HOSTNAME_LEN]; |
| }; |
| |
| /** |
| * @brief ¾²Ì¬mac ipµØÖ·ÐÅÏ¢ |
| * @param mac mac µØÖ· |
| * @param ip macµØÖ·°ó¶¨µÄ¾²Ì¬ipµØÖ· |
| */ |
| struct static_macip_info { |
| char mac[32]; |
| char ip[32]; |
| }; |
| |
| /** |
| * @brief ¼Ò³¤Ä£Ê½°×Ãûµ¥ÍøÕ¾ÐÅÏ¢ |
| * @param name ÍøÕ¾Ãû³Æ |
| * @param site ÍøÕ¾ÍøÖ· |
| */ |
| struct white_site_info { |
| char name[HOSTNAME_LEN]; |
| char site[SITE_LEN]; |
| }; |
| |
| /** |
| * @brief ȱʡÍâÍø¿ÚÐÅÏ¢ |
| * @param p46flag ipv4/ipv6±ê־λ |
| * @param dev_id É豸idºÅ |
| */ |
| struct default_dev_info { |
| unsigned char ip46flag; |
| unsigned char dev_id; |
| }; |
| |
| /** |
| * @brief Á÷Á¿¿ØÖÆÐÅÏ¢ |
| * @param c_id PDPΨһ±êʶ£¬ucÊý¾Ý¿¨Ä£Ê½ÐèÒª´«È룬ufiģʽ²»ÐèÒª |
| * @param tc_downlink ÏÂÐÐÁ÷Á¿¿ØÖÆÖµ£¬µ¥Î»:±ÈÌØ |
| * @param tc_uplink ÏÂÐÐÁ÷Á¿¿ØÖÆÖµ£¬µ¥Î»:±ÈÌØ |
| * @note tc_downlink/tc_uplink 0 ±íʾ²»ÐèÒªÁ÷¿Ø£¬Òòlinux±ê×¼ÃüÁîÊǶÔ×Ö½Ú´¦Àí£¬ËùÒÔ×îÖÕÅäÖÃÖµ»áÕû³ý8 |
| */ |
| struct tc_control_info { |
| int c_id; |
| unsigned int tc_downlink; |
| unsigned int tc_uplink; |
| }; |
| |
| /** |
| * @brief ÁªÍøÊ§°ÜʱµÄÏà¹ØÅäÖÃÏî½á¹¹Ìå |
| * @param ip46flag ipv4/ipv6 ±ê־λ |
| * @param dev_id É豸id |
| * @param dialfail_reason ÁªÍøÊ§°ÜÔÒò |
| * @note dialfail_reasonȡֵ²Î¼ûTIME_OUTµÈºêÖµ |
| */ |
| struct dialfail_dev_info { |
| unsigned char ip46flag; |
| unsigned char dev_id; |
| unsigned char dialfail_reason; |
| }; |
| |
| |
| /** |
| * @brief PDPÈ¥¼¤»îÐÅÏ¢£¬×¨ÓÃÓÚPSÍâÍø¿Ú |
| * @param c_id PDP Ψһ±êʶ |
| * @param ip46flag ipv4/ipv6 ±êÖ¾ |
| * @note c_id ÓÃÓÚʶ±ð²»Í¬µÄPSÍâÍø¿Ú |
| */ |
| struct pdp_deactive_info { |
| int c_id; |
| unsigned char ip46flag; |
| }; |
| |
| #if 0 |
| typedef struct { |
| int result; |
| int cid; |
| char v6_addr[46]; |
| } V6ADDR_INFORM; |
| #endif |
| |
| /** |
| * @brief PPPD·¢ËÍPDP¼¤»îÏûÏ¢ÐÅÏ¢ |
| * @param auth_type ÈÏÖ¤·½Ê½0´ú±íPAP£¬1´ú±íCHAP |
| * @param user_len Óû§Ãû ³¤¶È |
| * @param user Óû§Ãû£¬ÔÚCHAP·½Ê½Ï¸ÃÖµÖÃΪÌôÕ½idºÅ |
| * @param pw_len ÃÜÂ볤¶È |
| * @param pw ÃÜÂ룬ֻÓÃÓÚPAP·½Ê½ |
| * @param chg_len ÌôÕ½³¤¶È |
| * @param challenge ÌôÕ½id£¬ÓÃÓÚCHAP·½Ê½ |
| */ |
| typedef struct pppd_auth { |
| int auth_type; |
| int user_len; |
| char user[USER_MAX]; |
| int pw_len; |
| char pw[PW_MAX]; |
| int chg_len; |
| char challenge[CHALLENGE_MAX]; |
| } pppd_auth; |
| |
| typedef union |
| { |
| u_int8_t e8[8]; |
| u_int16_t e16[4]; |
| u_int32_t e32[2]; |
| } netapi_eui64_t; |
| |
| /******************************************************************************* |
| * Global function declarations * |
| ******************************************************************************/ |
| |
| |
| |
| |
| /** |
| * @brief ¸ù¾ÝÍøÂçÉ豸Ãû»ñÈ¡¶ÔÓ¦µÄÉ豸ID,°´ÕÕÓÅÏȼ¶ÓëNVÖеÄÉ豸Ãû½øÐÐÆ¥Åä |
| * @param dev_name ÍøÂçÉ豸Ãû |
| * @return ʧ°Ü·µ»Ø-1 |
| */ |
| int getDevId_byname(char *dev_name); |
| |
| |
| /** |
| * @brief PSÍøÂçÉ豸¼¤»î½Ó¿Ú |
| * @param actinfo pdp ¼¤»îÐÅÏ¢ |
| * @param src_id µ÷Óô˽ӿڵĽø³Ìid |
| * @return ³É¹¦ ·µ»Ø 0, ʧ°Ü ·µ»Ø -1 |
| * @note atÏà¹ØÓ¦Óýø³Ìµ÷Óã¬Èçatserver¡¢pcserver¡¢VoLTE¡¢²ÊÐŵÈÓ¦Óýø³Ì |
| */ |
| int pdp_act_proc(struct pdp_active_info *actinfo, int src_id); |
| |
| |
| /** |
| * @brief PPPÍøÂçÉ豸¼¤»î½Ó¿Ú |
| * @param ttyname tty É豸Ãû |
| * @return ³É¹¦ ·µ»Ø 0, ʧ°Ü ·µ»Ø -1 |
| */ |
| int ppp_act_proc(char *ttyname); |
| |
| /** |
| * @brief PSÍøÂçÉ豸ȥ»î½Ó¿Ú |
| * @param c_id PDP¼¤»îc_id |
| * @param ip46flag ip4/ipv6±êÖ¾ |
| * @param src_id µ÷Óô˽ӿڵĽø³Ìid |
| * @return ³É¹¦ ·µ»Ø 0, ʧ°Ü ·µ»Ø -1 |
| * @note atÏà¹ØÓ¦Óýø³Ìµ÷Óã¬Èçatserver¡¢pcserver¡¢VoLTE¡¢²ÊÐŵÈÓ¦Óýø³Ì |
| */ |
| int pdp_deact_proc(int c_id, unsigned char ip46flag, int src_id); |
| |
| |
| /** |
| * @brief ÈȲå°ÎÉ豸²åÈë,½Ó¿ÚÄÚ²¿¼ì²âÊÇ·ñÐèÒª½øÐв¦ºÅ£¬ÈçÐèÒª£¬Ö´ÐеØÖ··ÖÅä¡¢×éÍøµÈÁ÷³Ì |
| * @param netdev_id É豸idºÅ |
| * @param src_id µ÷Óô˽ӿڵĽø³Ìid |
| * @return ³É¹¦ ·µ»Ø 0, ʧ°Ü ·µ»Ø -1 |
| * @note É豸Ö÷¿Øµ÷Óô˽ӿÚʱ£¬±íÃ÷¸ÃÍøÂçÉ豸ÎïÀíͨ·ÒÑͨ£¬¿ÉÒÔ½øÐÐIPÊý¾Ý°üµÄÊÕ·¢ÁË£» |
| * Ö÷¿Ø½ø³ÌÐèÒª±£Ö¤ÈȲå°Îʼþ²»»áÖØ¸´µ÷Óøýӿڣ¬·ñÔòÍøÂçÄÚ²¿»áƵ·±½øÐÐÖØ¸´µÄÖØÅäÖÃIPµØÖ·µÄÁ÷³Ì |
| */ |
| int netdev_plugin_proc(unsigned char netdev_id, int src_id); |
| |
| /** |
| * @brief ÈȲå°ÎÉ豸°Î³ö,½Ó¿ÚÄÚ²¿½øÐÐifconfig down£¬²¢É±µôÏàÓ¦µÄµØÖ··ÖÅä½ø³Ì |
| * @param netdev_id É豸idºÅ |
| * @param src_id µ÷Óô˽ӿڵĽø³Ìid |
| * @return ³É¹¦ ·µ»Ø 0, ʧ°Ü ·µ»Ø -1 |
| * @note É豸Ö÷¿Øµ÷Óô˽ӿÚʱ£¬±íÃ÷¸ÃÍøÂçÉ豸ÎïÀíͨ·ÒѶϣ¬²»ÒªÔÙ½øÐÐIPÊý¾Ý°üÊÕ·¢ |
| */ |
| int netdev_plugout_proc(unsigned char netdev_id, int src_id); |
| |
| |
| /** |
| * @brief webui·¢Ë͵ÄÁ¬½ÓÇëÇó,½Ó¿ÚÄÚ²¿½øÐÐifconfig up£¬²¢Æô¶¯ÏàÓ¦µÄµØÖ··ÖÅä½ø³Ì |
| * @param netdev_id É豸idºÅ |
| * @param src_id µ÷Óô˽ӿڵĽø³Ìid |
| * @return ³É¹¦ ·µ»Ø 0, ʧ°Ü ·µ»Ø -1 |
| * @note É豸Ö÷¿ØÄ£¿éµ÷Óô˽ӿÚǰ£¬ÐèÒª¼ì²âµ±Ç°É豸ÎïÀíͨ·ÒÑͨ£¬·ñÔò²»Ó¦¸Ãµ÷ÓÃ´Ë½Ó¿Ú |
| */ |
| int netdev_connect_internet(unsigned char netdev_id, int src_id); |
| |
| |
| /** |
| * @brief webui·¢Ë͵ĶϿªÁ¬½ÓÇëÇó,½Ó¿ÚÄÚ²¿½øÐÐifconfig down£¬²¢É±µôÏàÓ¦µÄµØÖ··ÖÅä½ø³Ì |
| * @param netdev_id É豸idºÅ |
| * @param src_id µ÷Óô˽ӿڵĽø³Ìid |
| * @return ³É¹¦ ·µ»Ø 0, ʧ°Ü ·µ»Ø -1 |
| * @note É豸Ö÷¿ØÄ£¿éµ÷ÓÃ´Ë½Ó¿Ú |
| */ |
| int netdev_disconnect_internet(unsigned char netdev_id, int src_id); |
| |
| |
| /** |
| * @brief Á÷Á¿¿ØÖÆ |
| * @param tcinfo Á÷Á¿¿ØÖÆÐÅÏ¢£¬ÐèÒªÁ÷Á¿¼à¿ØµÄÉÏÏÂÐÐÁ¿ |
| * @param src_id Ô´½ø³ÌidºÅ |
| * @return ²Ù×÷³É¹¦·µ»Ø1£¬Ê§°Ü·µ»Ø0 |
| * @note ¸øÐèÒªÁ÷Á¿¿ØÖƵÄÓ¦Óõ÷Óã¬ÈçÉÏÐÐÐèÒªÁ÷¿Ø£¬ÇëµÈÄÜÉÏÍâÍøºóÔÙµ÷Ó㬷ñÔòÎÞ·¨»ñÈ¡ÍâÍø¿Ú½øÐÐÁ÷¿Ø |
| * Õý³£¹Ø»úÖØÐ¿ª»ú£¬Ö®Ç°ÉèÖõÄÁ÷¿ØÒÀÈ»ÓÐЧ |
| */ |
| int tc_control(struct tc_control_info *tcinfo, int src_id); |
| |
| |
| /** |
| * @brief ÈȲå°ÎÉ豸²åÈë,½Ó¿ÚÄÚ²¿¼ì²âÊÇ·ñÐèÒª½øÐÐ×Ô¶¯²¦ºÅ£¬ÈçÐèÒª£¬Ö´ÐеØÖ··ÖÅä¡¢×éÍøµÈÁ÷³Ì |
| * @param netdev_name ÍøÂçÉ豸Ãû |
| * @param src_id Ô´½ø³Ì id ºÅ |
| * @return ²Ù×÷³É¹¦·µ»Ø1£¬Ê§°Ü·µ»Ø0 |
| * @note É豸Ö÷¿Øµ÷Óô˽ӿÚʱ£¬±íÃ÷¸ÃÍøÂçÉ豸ÎïÀíͨ·ÒÑͨ£¬¿ÉÒÔ½øÐÐIPÊý¾Ý°üµÄÊÕ·¢ÁË |
| */ |
| int netdev_plugin_proc_byname(char *netdev_name, int src_id); |
| |
| |
| /** |
| * @brief ÈȲå°ÎÉ豸°Î³ö,½Ó¿ÚÄÚ²¿½øÐÐifconfig down£¬²¢É±µôÏàÓ¦µÄµØÖ··ÖÅä½ø³Ì |
| * @param netdev_name ÍøÂçÉ豸Ãû |
| * @param src_id Ô´½ø³Ì id ºÅ |
| * @return ²Ù×÷³É¹¦·µ»Ø1£¬Ê§°Ü·µ»Ø0 |
| * @note É豸Ö÷¿Øµ÷Óô˽ӿÚʱ£¬±íÃ÷¸ÃÍøÂçÉ豸ÎïÀíͨ·ÒѶϣ¬²»ÒªÔÙ½øÐÐIPÊý¾Ý°üÊÕ·¢ |
| */ |
| int netdev_plugout_proc_byname(char *netdev_name, int src_id); |
| |
| |
| /** |
| * @brief »Ö¸´³ö³§ÉèÖÃʱɾ³ý³ÌÐòÔËÐÐÖÐÉú³ÉµÄÎļþ |
| * @param ÎÞ |
| * @return ÎÞ |
| */ |
| void tcpip_reset_configure(); |
| |
| /** |
| * @brief ÉèÖÃswitchÉ豸eth0.200Íø¿Ú¶ÔÓ¦µÄport3Ϊwan¿Ú»¹ÊÇlan¿Ú |
| * @param mode:1 => wan¿Ú£¬0 => lan¿Ú |
| * @return ÎÞ |
| */ |
| void set_ethwan_port_mode(int mode); |
| |
| int netapi_ether_to_eui64(const char *dev_name, netapi_eui64_t *p_eui64); |
| |
| #endif |
| |
| /******************************************************************************* |
| * Global function implementations * |
| ******************************************************************************/ |
| |
| #endif/* __NETAPI__ */ |