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

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

?? dhcp.h

?? 嵌入式操作系統ECOS的網絡開發包
?? 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;
//                }
//            }
//        }
//    }
//
// ------------------------------------------------------------------------

#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一区二区三区免费野_久草精品视频
成人久久18免费网站麻豆 | 国产精品成人一区二区艾草| 亚洲精品视频在线看| 狠狠色综合色综合网络| 色噜噜狠狠成人网p站| 久久精品网站免费观看| 日本不卡1234视频| 在线看一区二区| 国产精品三级久久久久三级| 久久精品国产99久久6| 欧美日韩卡一卡二| 一区二区三区成人| 成人精品鲁一区一区二区| 91精品国产一区二区三区| 一区二区在线观看免费 | 一区二区高清视频在线观看| 国产成人a级片| 欧美成人三级在线| 免费看黄色91| 欧美一区二区免费观在线| 亚洲成av人**亚洲成av**| 91美女片黄在线| 国产精品大尺度| 成人18视频在线播放| 国产欧美一区二区三区在线看蜜臀 | 欧美三级午夜理伦三级中视频| 国产精品护士白丝一区av| 国产成人亚洲综合色影视| 久久久久久免费| 国产福利视频一区二区三区| 国产三级一区二区| 不卡一区二区在线| 中文字幕一区二区三区在线播放 | 亚洲r级在线视频| 欧美性猛交xxxxxx富婆| 天天综合色天天| 欧美精品久久久久久久久老牛影院| 五月天亚洲精品| 91精品国产综合久久久久| 免费观看在线色综合| 日韩欧美高清一区| 国产成人8x视频一区二区| 国产精品国产三级国产aⅴ无密码| 99国产精品视频免费观看| **网站欧美大片在线观看| 在线视频欧美精品| 午夜精品在线看| 精品av综合导航| 成人手机电影网| 亚洲精品国产品国语在线app| 欧美日韩一二三区| 韩国女主播成人在线| 中文乱码免费一区二区| 日本乱人伦aⅴ精品| 天堂av在线一区| 久久综合久久鬼色中文字| 99久久久久久| 午夜一区二区三区在线观看| 精品日韩在线观看| 不卡视频一二三四| 日精品一区二区三区| 久久蜜桃香蕉精品一区二区三区| av色综合久久天堂av综合| 亚洲成人先锋电影| 2017欧美狠狠色| 色综合激情五月| 五月天久久比比资源色| 中文字幕乱码亚洲精品一区| 欧美日韩视频专区在线播放| 国产精品 日产精品 欧美精品| 亚洲女同ⅹxx女同tv| 日韩欧美国产不卡| 91九色最新地址| 国产精品 日产精品 欧美精品| 夜夜操天天操亚洲| 国产午夜精品福利| 欧美精品成人一区二区三区四区| 国产成人av一区| 午夜精品久久久久久久久久久| 国产精品卡一卡二| 日韩精品一区二区三区在线| 色综合亚洲欧洲| 国产精品资源在线看| 午夜久久久久久| 亚洲精品老司机| 久久蜜桃av一区精品变态类天堂 | 亚洲一二三区视频在线观看| 日韩免费观看2025年上映的电影 | 丝瓜av网站精品一区二区| 国产农村妇女毛片精品久久麻豆| 欧美亚洲国产一区二区三区va | 亚洲乱码国产乱码精品精可以看 | av不卡在线播放| 黄色资源网久久资源365| 亚洲成在人线免费| 亚洲欧洲国产专区| 欧美国产一区二区在线观看| 26uuu色噜噜精品一区| 日韩三级.com| 欧美群妇大交群的观看方式| 欧美午夜视频网站| 色av综合在线| 色综合久久88色综合天天6| 国产精品亚洲а∨天堂免在线| 国产一区二区三区久久悠悠色av| 一区二区三区国产精华| 国产精品九色蝌蚪自拍| 日本一区二区成人| 久久免费午夜影院| 2023国产精品自拍| xfplay精品久久| 国产亚洲美州欧州综合国| www久久精品| 久久久久久亚洲综合| 国产女人18水真多18精品一级做| 国产亚洲精品免费| 国产精品视频九色porn| 中文字幕一区二区三区精华液| 国产精品久久二区二区| 亚洲视频一区二区在线观看| 亚洲卡通动漫在线| 亚洲午夜在线电影| 石原莉奈在线亚洲二区| 青青国产91久久久久久| 精品亚洲欧美一区| 成人综合婷婷国产精品久久| av在线免费不卡| 欧美日韩免费高清一区色橹橹| 欧美高清视频一二三区| 欧美第一区第二区| 国产视频911| 一区二区三区四区在线免费观看| 天堂在线亚洲视频| 激情综合网最新| 91网站最新地址| 欧美日韩亚洲综合在线| 精品不卡在线视频| 成人免费在线观看入口| 一区二区三区**美女毛片| 蓝色福利精品导航| 99精品1区2区| 欧美一卡在线观看| 国产精品福利电影一区二区三区四区| 18成人在线视频| 美女视频免费一区| 91蝌蚪国产九色| 91精品婷婷国产综合久久 | 日本不卡一区二区三区| 国产乱码字幕精品高清av| 91在线你懂得| 欧美不卡在线视频| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 天堂av在线一区| 国产精品亚洲а∨天堂免在线| 91国产免费看| 久久综合九色综合97婷婷女人| 亚洲女同女同女同女同女同69| 久久精品国产第一区二区三区| 99国产精品久久久久久久久久 | 成人aaaa免费全部观看| 欧美一级艳片视频免费观看| **网站欧美大片在线观看| 美腿丝袜一区二区三区| 色综合欧美在线视频区| 国产日韩在线不卡| 日韩电影在线免费看| 96av麻豆蜜桃一区二区| 久久综合五月天婷婷伊人| 亚洲综合色自拍一区| 国产成人自拍在线| 欧美va日韩va| 亚洲成人三级小说| 色婷婷精品大在线视频| 日本一区二区三区dvd视频在线| 日韩电影在线观看电影| 欧美亚洲国产一区在线观看网站 | 91蜜桃在线观看| 日本一区二区三区四区| 激情综合色播激情啊| 欧美一区二区黄色| 石原莉奈一区二区三区在线观看| 色吧成人激情小说| 亚洲图片你懂的| 成人免费黄色大片| 国产清纯白嫩初高生在线观看91 | 91成人免费在线| 国产精品二三区| www.av精品| 亚洲欧美综合网| 91女人视频在线观看| 国产精品久久久99| 99精品一区二区三区| 亚洲国产成人自拍| 成人丝袜视频网| 亚洲色欲色欲www| 欧美亚洲禁片免费| 日韩精品电影在线观看| 91麻豆精品国产91久久久久久| 亚洲一区二区三区三| 欧美日本一区二区|