亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dhcp.h

?? ecos下的gui開發源代碼
?? H
字號:
#ifndef CYGONCE_NET_TCPIP_DHCP_H
#define CYGONCE_NET_TCPIP_DHCP_H

//==========================================================================
//
//      include/dhcp.h
//
//      DHCP protocol support
//
//==========================================================================
//####BSDCOPYRIGHTBEGIN####
//
// -------------------------------------------
//
// Portions of this software may have been derived from OpenBSD or other sources,
// and are covered by the appropriate copyright disclaimers included herein.
//
// -------------------------------------------
//
//####BSDCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s):    hmt
// Contributors: gthomas
// Date:         2000-07-01
// Purpose:      Support DHCP initialization in eCos TCPIP stack
// Description:  
//              
//
//####DESCRIPTIONEND####
//
//==========================================================================

// 
// DHCP.  RFC2131, RFC1533, RFC1534
// See also bootp.h
// 

#include <pkgconf/system.h>
#include <pkgconf/net.h>

#ifdef CYGPKG_NET_DHCP

#include <machine/types.h>

#include <cyg/kernel/kapi.h>

#include <bootp.h>

// DHCP messages; these are sent in the tag TAG_DHCP_MESS_TYPE already
// defined in bootp.h

#define DHCPDISCOVER	1
#define DHCPOFFER	2
#define DHCPREQUEST	3
#define DHCPDECLINE	4
#define DHCPACK		5
#define DHCPNAK		6
#define DHCPRELEASE	7

// DHCP interface state machine states; these are published so that app
// code can know what to do... (see page 35 of RFC2131)

// These we will use in the normal course of events
#define DHCPSTATE_INIT		   1
#define DHCPSTATE_SELECTING	   2 // wait for replies to b/c DISCOVER
#define DHCPSTATE_REQUESTING	   3
#define DHCPSTATE_REQUEST_RECV	   4 // wait for replies to b/c REQUEST
#define DHCPSTATE_BOUND		   5
#define DHCPSTATE_RENEWING	   6 // wait for replies to u/c REQUEST
#define DHCPSTATE_RENEW_RECV	   7
#define DHCPSTATE_REBINDING	   8 // wait for replies to b/c REQUEST
#define DHCPSTATE_REBIND_RECV      9
#define DHCPSTATE_BOOTP_FALLBACK  10 // fall back to plain bootp
#define DHCPSTATE_NOTBOUND        11 // To let app tidy up
#define DHCPSTATE_FAILED          12 // Net is down
#define DHCPSTATE_DO_RELEASE      13 // Force release of the current lease
// These we don't use
//#define DHCPSTATE_INITREBOOT
//#define DHCPSTATE_REBOOTING

// These are to let the app inspect the state of the interfaces when
// managing them itself, by analogy with eth0_up &c; eth0_bootp_data and so
// on will still be used with DHCP.
#ifdef CYGHWR_NET_DRIVER_ETH0
extern cyg_uint8   eth0_dhcpstate;
#endif
#ifdef CYGHWR_NET_DRIVER_ETH1
extern cyg_uint8   eth1_dhcpstate;
#endif

// This is public so the app can wait on it or poll it when managing DHCP
// itself.  It will be zero while the app should wait, and posted when a
// call to do_dhcp() is needed.  If, instead, the app wishes to manage DHCP
// with a thread per interface somehow, then separate semaphores may be used.
// See the dhcp_lease structure definition below.
extern cyg_sem_t dhcp_needs_attention;

// This routine is used at startup time, and after relinquishing leases or
// after a lease timeout: it does DHCP or bootp or static setup according
// to configuration.
extern void init_all_network_interfaces(void);

// This routine does the work of renewing leases &c.
// return value: 1 => everything OK, no change.
// 0 => close your connections, then call do_dhcp_halt() to halt the
// interface(s) in question (it knows because the state will be NOTBOUND).
// After that you can return to the start and use
// init_all_network_interfaces() as usual.
extern int dhcp_bind( void );

// Shutdown any interface which is not already shut down - whether
// initialized by DHCP or not.  Reason: because of the broadcast-while-not-
// -fully-initialized nature of the DHCP conversation, all other interfaces
// must be shut down during that.  So one down, all down, is required.
extern int dhcp_halt( void );

// Release (and set state to DHCPSTATE_NOTBOUND) all interfaces - we are
// closing down.  (unlikely but useful for testing)
// Interfaces are left up; use dhcp_halt() to bring them right down, then
// call init_all_network_interfaces() as usual to restart all.
extern int dhcp_release( void );

// The intent with this API is that a simple DHCP client thread, which
// maintains the state of the interfaces, can go as follows:
// (after init_all_networks is called from elsewhere)
//
//    while ( 1 ) {
//        while ( 1 ) {
//            cyg_semaphore_wait( &dhcp_needs_attention );
//            if ( ! dhcp_bind() ) // a lease expired
//                break; // If we need to re-bind
//        }
//        dhcp_halt(); // tear everything down
//        init_all_network_interfaces(); // re-initialize
//    }
//
// and if the application does not want to suffer the overhead of a
// separate thread and its stack for this, this functionality can be placed
// in the app's server loop in an obvious fashion.  That is the goal of
// breaking out these internal elements.  For example, some server might
// be arranged to poll DHCP from time to time like this:
//
//    while ( 1 ) {
//        init_all_network_interfaces();
//        open-my-listen-sockets();
//        while ( 1 ) {
//            serve-one-request();
//            // sleeps if no connections, but not forever; so this loop is
//            // polled a few times a minute...
//            if ( cyg_semaphore_trywait( &dhcp_needs_attention )) {
//                if ( ! dhcp_bind() ) {
//                    close-my-listen-sockets();
//                    dhcp_halt();
//                    break;
//                }
//            }
//        }
//    }
//
// ------------------------------------------------------------------------

// Set hostname to be used with the DHCP TAG_HOST_NAME option.
// Call this before calling init_all_network_interfaces() to
// set the hostname value.
#ifdef CYGOPT_NET_DHCP_OPTION_HOST_NAME
extern void dhcp_set_hostname(char *hostname);
#else
#define dhcp_set_hostname(hostname)        CYG_EMPTY_STATEMENT
#endif

#ifdef CYGOPT_NET_DHCP_DHCP_THREAD
// Then we provide such a thread...

// Provide a separate thread to renew DHCP leases; otherwise the
// application MUST periodically examine the semaphore dhcp_needs_attention
// and call dhcp_bind() if it is signalled.  If enabled, this thread does
// all that for you.  Independent of this option, initialization of the
// interfaces still occurs in init_all_network_interfaces() and your
// startup code must call that.  It will start the DHCP management thread
// if necessary.  If a lease fails to be renewed, the management thread
// will shut down all interfaces and attempt to initialize all the
// interfaces again from scratch.  This may cause chaos in the app, which
// is why managing the DHCP state in an application aware thread is
// actually better, just far less convenient for testing.

extern cyg_handle_t dhcp_mgt_thread_h; // To allow its external manipulation.
extern cyg_thread   dhcp_mgt_thread;   // The object itself

extern void dhcp_start_dhcp_mgt_thread( void );

#endif

// The function is provided unconditionally so that the app can put it in a
// thread of its own.  If the parameter is true, it loops forever; if
// false, the call returns if a lease expires, and the caller must tidy up
// or reboot the whole machine.
extern cyg_thread_entry_t dhcp_mgt_entry;
extern void dhcp_mgt_entry( cyg_addrword_t loop_on_failure ); // the function

// ---------------------------------------------------------------------------
// These are rather more internal routines, internal to the protocol engine
// in dhcp_prot.c - those above are in dhcp_support.c

#define DHCP_LEASE_T1 1
#define DHCP_LEASE_T2 2
#define DHCP_LEASE_EX 4

struct dhcp_lease {
    // Client settable: Semaphore to signal when attention is needed:
    cyg_sem_t          *needs_attention;
    // Initialize all the rest to zero:
    cyg_tick_count_t    t1, t2, expiry;
    volatile cyg_uint8  next;
    volatile cyg_uint8  which;
    cyg_handle_t        alarm;
    // except this one, which is just some space:
    cyg_alarm           alarm_obj;
};

// These dhcp_lease objects are initialized to use
//         extern cyg_sem_t dhcp_needs_attention;
// for the semaphore.
#ifdef CYGHWR_NET_DRIVER_ETH0
extern struct dhcp_lease eth0_lease;
#endif
#ifdef CYGHWR_NET_DRIVER_ETH1
extern struct dhcp_lease eth1_lease;
#endif

extern int
do_dhcp(const char *interface, struct bootp *res,
        cyg_uint8 *pstate, struct dhcp_lease *lease);
// NB *res and *pstate and *lease are all INOUT; *res must point to a valid
// record from "last time".

extern int
do_dhcp_down_net(const char *intf, struct bootp *res,
        cyg_uint8 *pstate, struct dhcp_lease *lease);

extern int
do_dhcp_release(const char *intf, struct bootp *res,
        cyg_uint8 *pstate, struct dhcp_lease *lease);

#endif // CYGPKG_NET_DHCP

#endif // CYGONCE_NET_TCPIP_DHCP_H
// EOF dhcp.h

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久综合| 精品一区二区免费在线观看| 久久只精品国产| 日本一区二区免费在线观看视频| 国产精品乱人伦| 一级中文字幕一区二区| 开心九九激情九九欧美日韩精美视频电影| 国产高清在线精品| 精品视频免费在线| 久久久欧美精品sm网站| 亚洲综合清纯丝袜自拍| 久久97超碰国产精品超碰| 91在线小视频| 欧美成人女星排行榜| 亚洲女性喷水在线观看一区| 免费精品视频在线| 91麻豆6部合集magnet| 日韩精品一区二区三区视频在线观看| 国产精品少妇自拍| 青青草国产精品亚洲专区无| 99久久综合国产精品| 日韩精品影音先锋| 伊人性伊人情综合网| 国产一区二区伦理| 欧美人动与zoxxxx乱| 国产精品剧情在线亚洲| 麻豆精品蜜桃视频网站| 国产成人免费网站| 亚洲乱码国产乱码精品精98午夜 | 国内精品久久久久影院薰衣草| thepron国产精品| 日韩你懂的电影在线观看| 亚洲色图欧洲色图| 国产精品一区二区视频| 欧美视频在线播放| 中文字幕一区三区| 国产一区二区在线观看视频| 欧美日韩精品电影| 亚洲欧美色综合| 成人一区在线看| 欧美不卡视频一区| 日韩专区一卡二卡| 欧美视频你懂的| 亚洲色欲色欲www在线观看| 国产成人免费av在线| 欧美一区二区日韩| 亚洲成人av免费| 欧洲精品一区二区三区在线观看| 国产精品午夜在线| 国产一区二三区| 欧美大片顶级少妇| 日韩av网站免费在线| 欧美制服丝袜第一页| 亚洲精品videosex极品| 99视频一区二区| 成+人+亚洲+综合天堂| 久久精品国产一区二区| 色综合中文综合网| 色综合久久天天综合网| 国产精品日韩精品欧美在线| 国内精品国产成人| 3atv在线一区二区三区| 亚洲国产另类av| 欧美日韩综合色| 亚洲成av人**亚洲成av**| 在线观看一区二区视频| 国产精品私人影院| 波多野结衣的一区二区三区| 欧美高清在线视频| 国产+成+人+亚洲欧洲自线| 久久久久久久性| 国产精品一二三区在线| 国产欧美一区二区精品久导航 | 中文字幕免费不卡在线| 高清视频一区二区| 国产精品久久久久久久岛一牛影视 | 蜜臀av在线播放一区二区三区| 欧美日韩一区在线| 午夜精品久久一牛影视| 91精品综合久久久久久| 免费看黄色91| 亚洲精品一区二区三区在线观看| 国产乱码精品一区二区三区忘忧草 | 久久精品免费观看| 久久―日本道色综合久久| 国产精品白丝av| 最新国产精品久久精品| 在线免费精品视频| 亚洲成人激情综合网| 日韩欧美高清一区| 国产成人午夜精品影院观看视频 | 欧美日韩一区二区在线观看| 亚洲图片欧美综合| 91麻豆精品国产自产在线观看一区 | 亚洲国产精品一区二区尤物区| 欧美撒尿777hd撒尿| 午夜精品免费在线观看| 欧美tk丨vk视频| 成人免费的视频| 一区二区三区中文字幕在线观看| 777精品伊人久久久久大香线蕉| 免费视频一区二区| 欧美国产亚洲另类动漫| 欧洲中文字幕精品| 国产主播一区二区三区| 亚洲欧美一区二区三区久本道91| 欧美性猛交一区二区三区精品| 蜜臀av一区二区在线观看| 中文一区二区在线观看| 欧美日韩在线亚洲一区蜜芽| 久久不见久久见免费视频7| 中文字幕一区二区三区色视频| 日本道在线观看一区二区| 激情欧美日韩一区二区| 亚洲人成在线播放网站岛国| 91精品国产色综合久久不卡电影| 国产a视频精品免费观看| 一区二区免费视频| 欧美精品一区二区三区很污很色的| 91在线免费播放| 精品一区二区在线观看| 亚洲欧美日韩国产另类专区| 精品国产百合女同互慰| 色婷婷av一区二区三区大白胸| 蜜桃视频在线观看一区| 中文字幕精品一区二区精品绿巨人| 国产精品一区二区91| 亚洲人精品午夜| 欧美videos大乳护士334| 色女孩综合影院| 国产综合久久久久影院| 亚洲成人av在线电影| 欧美激情综合在线| 日韩欧美自拍偷拍| 日本韩国一区二区三区视频| 国内精品在线播放| 三级亚洲高清视频| 亚洲蜜臀av乱码久久精品| 久久男人中文字幕资源站| 欧美日韩美女一区二区| 99在线视频精品| 久久精品久久99精品久久| 亚洲国产精品视频| 综合在线观看色| 国产欧美精品日韩区二区麻豆天美| 欧美巨大另类极品videosbest | 亚洲人成伊人成综合网小说| 26uuu精品一区二区在线观看| 欧美美女bb生活片| 色一情一伦一子一伦一区| 国产精品一线二线三线精华| 日韩精品电影一区亚洲| 国产乱码精品1区2区3区| 亚洲精品中文在线观看| 欧美国产禁国产网站cc| 欧美va在线播放| 欧美精品一级二级| 欧美亚洲尤物久久| 色先锋久久av资源部| 成人免费黄色大片| 懂色av一区二区三区蜜臀| 免费看精品久久片| 奇米影视一区二区三区小说| 五月天婷婷综合| 亚洲午夜精品一区二区三区他趣| 综合久久国产九一剧情麻豆| 日本一区二区久久| 久久久久99精品一区| 久久久久久久久蜜桃| 26uuu国产一区二区三区| 日韩久久久精品| 精品日韩欧美在线| 日韩精品一区二区三区视频 | 青青草成人在线观看| 亚洲国产日韩a在线播放 | 欧美日韩国产欧美日美国产精品| 91蝌蚪porny九色| 色综合久久天天| 日本黄色一区二区| 欧美色综合网站| 欧美日韩免费电影| 制服丝袜激情欧洲亚洲| 日韩一区二区三区视频在线 | 日本高清不卡视频| 99久久久久免费精品国产 | 亚洲国产精品视频| 亚洲高清视频的网址| 午夜在线电影亚洲一区| 日韩和欧美一区二区三区| 免费成人av资源网| 精品一区免费av| 高清成人在线观看| 99久久久久久99| 欧美天天综合网| 欧美一区二视频| www激情久久| 国产精品第五页| 亚洲成人www| 六月婷婷色综合| 国产成人免费视频精品含羞草妖精|