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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? bclient.c

?? 這是單板上DPRAM的驅(qū)動(dòng)程序
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*  @(#) pSOSystem PowerPC/V2.2.2: drivers/bclient.c (&U&) 2.7 97/11/04 17:08:09 */
/***********************************************************************/
/*                                                                     */
/*   MODULE:  drivers/bootp/bclient.c                                  */
/*   DATE:    97/11/04                                                 */
/*   PURPOSE: Contains routines that implement the BOOTP protocol.     */
/*                                                                     */
/*---------------------------------------------------------------------*/
/*                                                                     */
/*           Copyright 1991 - 1996, Integrated Systems, Inc.           */
/*                      ALL RIGHTS RESERVED                            */
/*                                                                     */
/*   Permission is hereby granted to licensees of Integrated Systems,  */
/*   Inc. products to use or abstract this computer program for the    */
/*   sole purpose of implementing a product based on Integrated        */
/*   Systems, Inc. products.   No other rights to reproduce, use,      */
/*   or disseminate this computer program, whether in part or in       */
/*   whole, are granted.                                               */
/*                                                                     */
/*   Integrated Systems, Inc. makes no representation or warranties    */
/*   with respect to the performance of this computer program, and     */
/*   specifically disclaims any responsibility for any damages,        */
/*   special or consequential, connected with the use of this program. */
/*                                                                     */
/*---------------------------------------------------------------------*/
/*                                                                     */
/*                                                                     */
/*                                                                     */
/***********************************************************************/
#include <psos.h>
#include "bsp.h"
#include <pna.h>
#include <pna_mib.h>
#include <bspfuncs.h>
#include <ip_udp.h>
#include <bootp.h>
#include <configs.h>
#include <types.h>
 
/*---------------------------------------------------------------------*/
/* The node anchor address is a pointer to the node configuration      */
/* table, which in turn points to the pSOS+ configuration table.  This */
/* driver will look in the pSOS+ configuration table to see how many   */
/* ticks per second are specified, and thus how many interrupts per    */
/* second to generate.                                                 */
/*---------------------------------------------------------------------*/
extern NODE_CT *anchor;

/*---------------------------------------------------------------------*/
/* This code can be compiled for use with either a zero-copy LAN       */
/* driver or a non-zero-copy LAN driver.                               */
/*---------------------------------------------------------------------*/
#define NI_RAWMEM (BSP_LAN1_FLAGS & IFF_RAWMEM)

/***********************************************************************/
/* NI interface for Bootp                                              */
/***********************************************************************/
#define BOOTP_IFNUM 188

/***********************************************************************/
/* IP header for BOOTP packet                                          */
/***********************************************************************/
static USHORT ip_id = 1000000 & 0xFFFF;      /* IP header id */

/***********************************************************************/
/* Initial transaction ID for BOOTP packet                             */
/***********************************************************************/
static ULONG InitialXid = -1000000;            

/***********************************************************************/
/* PsosUp indicates if pSOS is up when get_bootp_params is called      */
/***********************************************************************/
static ULONG PsosUp;                         

/***********************************************************************/
/* Seconds elapsed since first BOOTP packet was sent out               */
/***********************************************************************/
static USHORT SecsSinceStart;               

static char Bootp_Replied;
static UCHAR *EthAddrPtr;
static bootppkt_t BootpReplyPkt;
static char BootpServerName[64];
static char BootpFileName[128];
static char BootpBuf[IP_SZ + UDP_SZ + BOOTP_SZ];
static ULONG BootpXid;
static long (*MyNiLan)(ULONG, union nientry *);

/***********************************************************************/
/* Functions used                                                      */
/***********************************************************************/
static ULONG process_bootp(int type, char *buff_addr);
static ULONG broadcast_bootp(long (*NiLanPtr)());
static ULONG extract_bootpkt(bootppkt_t *bootp, bootpparms_t *retp);
static USHORT in_cksum(UCHAR *addr, int count);
static void bootp_ip_packet(char *bootpbuf); 
static void strcpy(UCHAR *src, UCHAR *dst);
static void bmemset(UCHAR *ptr, register UCHAR fill, register ULONG count);
static void bmemcpy(UCHAR *src, UCHAR *dest, ULONG nbytes);
static void sleep(int count);

extern char *strncpy(char *, const char *, unsigned char);

#if NI_RAWMEM
#define NR_MBLKS 20

/*---------------------------------------------------------------------*/
/* We will maintain a list of mblks which will be allocated and freed  */
/* by besballoc() and bfreemsg().                                      */
/*---------------------------------------------------------------------*/
static mblk_t *bm_freelist; /* head of free list of message blocks */
static mblk_t bm[NR_MBLKS]; /* message blocks */
static dblk_t db[NR_MBLKS]; /* associated data blocks */

/***********************************************************************/
/*     ballocb: Allocate a message block                               */
/*      bfreeb: Free a message block                                   */
/*                                                                     */
/*        NOTE: These are unimplemented                                */
/*                                                                     */
/***********************************************************************/
static mblk_t *ballocb(long size, long pri) {return NULL;}
static void bfreeb(mblk_t *bp) {}


/***********************************************************************/
/*  init_bmbuf: Initialize the mblk free list                          */
/*                                                                     */
/*        NOTE: Each mblk gets a data block attached to it.  The mblks */
/*              are linked together in the "free" list, using the      */
/*              b_next field.                                          */
/***********************************************************************/
static void init_bmbuf(void)
{
int i;
 
for (i = 0; i < NR_MBLKS; i++) 
    {
    bmemset((unsigned char *)&bm[i], 0, sizeof(mblk_t));
    bmemset((unsigned char *)&db[i], 0, sizeof(dblk_t));
    bm[i].b_datap = &db[i];           /* attach data block */
    bm[i].b_next = &bm[i+1];
    }
bm[NR_MBLKS - 1].b_next = 0;

bm_freelist = &bm[0];
}

/***********************************************************************/
/*   besballoc: Attach a message block to a buffer                     */
/*                                                                     */
/*      INPUTS: base: ptr to buffer                                    */
/*              size: length of buffer in bytes                        */
/*              pri: ignored                                           */
/*              frtn: ptr to struct describing routine to be called    */
/*                    when buffer is to be freed                       */
/*                                                                     */
/*     RETURNS: ptr to msg block                                       */
/*                                                                     */
/***********************************************************************/
static mblk_t *besballoc(UCHAR *base, int size, int pri, frtn_t *frtn)
{
register mblk_t *pmblk;
register unsigned long om;
 
if (base == NULL || frtn == NULL)
    return(NULL);
 
/*---------------------------------------------------------------------*/
/* Get a msg block from the free list (if one is available)            */
/*---------------------------------------------------------------------*/
om = splx(MAX_ILEV);
if (pmblk = bm_freelist) 
    {
    bm_freelist = bm_freelist->b_next;
    pmblk->b_next = 0;
    }
else 
    {
    splx(om);
    return(NULL);
    }
splx(om);
 
/*---------------------------------------------------------------------*/
/* Fill in the msg block and its associated data block                 */
/*---------------------------------------------------------------------*/
pmblk->b_rptr = base;
pmblk->b_wptr = base;
pmblk->b_datap->db_base = base;
pmblk->b_datap->db_lim = (UCHAR *)(base + size + 1);
pmblk->b_datap->db_ref = 1;
pmblk->b_datap->db_frtn = *frtn;

return(pmblk);
}
 
/***********************************************************************/
/*    bfreemsg: Free a message block and its associated buffer, if     */
/*              there is one.                                          */
/*                                                                     */
/*      INPUTS: mp: ptr to message block triplet                       */
/*                                                                     */
/*     RETURNS:                                                        */
/*     OUTPUTS:                                                        */
/*     NOTE(S):                                                        */
/*                                                                     */
/***********************************************************************/
static void bfreemsg(mblk_t *mp)
{
unsigned long om;
 
om = splx(MAX_ILEV);
if (mp->b_datap->db_frtn.free_func)
    (mp->b_datap->db_frtn.free_func)(mp->b_datap->db_frtn.free_arg);
mp->b_next = bm_freelist;
bm_freelist = mp;
splx(om);
}

#endif /* NI_RAWMEM */

/***********************************************************************/
/*                                                                     */
/*   get_bootp_params: Obtain BOOTP reply packet for a specified       */
/*                     NI interface.                                   */
/*                                                                     */
/***********************************************************************/
ULONG get_bootp_params(long (*ni_entry)(ULONG, union nientry *),
                       char *bootp_file_name,
                       char *bootp_server_name,
                       int num_retries,
                       int flags,
                       char *ret_params)
{
union nientry init_ni, poll_ni;
int wait_count;               
int next_retry = 1;
struct ni_funcs NiFuncs;
unsigned long retval;

/*---------------------------------------------------------------------*/
/* Initialize the "mbuf manager"                                       */
/*---------------------------------------------------------------------*/
#if NI_RAWMEM
init_bmbuf();
#endif

/*---------------------------------------------------------------------*/
/* Get Pointer to NI interface used to RARP and initialize that NI.    */
/*---------------------------------------------------------------------*/
MyNiLan = (long (*)())ni_entry;

/*---------------------------------------------------------------------*/
/* Set niinit.ap_addr to "process_rarp" the function that the network  */
/* interface (driver) will call to process incoming packets.           */
/*---------------------------------------------------------------------*/
init_ni.niinit.ap_addr = (long(*)()) process_bootp;
init_ni.niinit.if_num = BOOTP_IFNUM;   /* My interface number */
init_ni.niinit.ip_addr = 0;            /* Redundant but needed */

#if NI_RAWMEM
init_ni.niinit.funcs = &NiFuncs;
NiFuncs.allocb = ballocb;
NiFuncs.freeb = bfreeb;
NiFuncs.freemsg = bfreemsg;
NiFuncs.esballoc = besballoc;
#endif

/*---------------------------------------------------------------------*/
/* Call network interface initialization function.  It will return the */
/* hardware address of this interface.                                 */
/*---------------------------------------------------------------------*/
EthAddrPtr = (UCHAR *)(*ni_entry)(NI_INIT, &init_ni);

/*---------------------------------------------------------------------*/
/* Check to see if the NI init failed, don't continue if it has.       */
/*---------------------------------------------------------------------*/
if (EthAddrPtr == (UCHAR *)-1)
    return 0xffffffff;

poll_ni.nipoll.if_num = BOOTP_IFNUM;
if (num_retries == 0)
    num_retries = BOOTP_RETRIES;
Bootp_Replied = FALSE;
bmemset((UCHAR *)BootpServerName, 0, sizeof(BootpServerName));
bmemset((UCHAR *)BootpFileName, 0, sizeof(BootpFileName));

if (bootp_server_name)
    strcpy((UCHAR *)bootp_server_name, (UCHAR *)BootpServerName); 
if (bootp_file_name)
    strcpy((UCHAR *)bootp_file_name, (UCHAR *)BootpFileName);

SecsSinceStart = 0;

if ((flags & PSOSUP) == PSOSUP)
    PsosUp = 1;
else
    PsosUp = 0;

#if NI_RAWMEM
bootp_ip_packet(BootpBuf);
#endif
/*---------------------------------------------------------------------*/
/* Send a BOOTP request, poll the NI, and check if the poll caused a   */
/* RARP response to occur. This sequence is repeated "retry" times.    */
/* During each retry, two NI polls are done, 1 second apart to give    */
/* the RARP server a chance to reply.                                  */
/*---------------------------------------------------------------------*/
while (num_retries && !Bootp_Replied)
    {

    if (broadcast_bootp((long (*)())ni_entry) != 0)
        return (0xffffffff);
    wait_count = next_retry;
    while (!Bootp_Replied && wait_count) {
        (*ni_entry)(NI_POLL, &poll_ni);
        --wait_count;
        sleep(1);
        };

    SecsSinceStart += next_retry;
    if (next_retry < 60) 
        next_retry *= 2;
        --num_retries;
    };

/*---------------------------------------------------------------------*/
/* We've fallen through the loop, if there was BOOTP reply then return */
/* the IP address for this board, else return a 0.  The LanStop()      */
/* routine is always called to prevent further BOOTP responses from    */
/* being delivered (and DMAed into memory).                            */
/*---------------------------------------------------------------------*/

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区日本| 7799精品视频| 欧美性生交片4| 亚洲综合一区二区三区| 日韩精品一区二区三区在线 | 欧美xxx久久| 国产亚洲美州欧州综合国| 久久众筹精品私拍模特| 欧美成人高清电影在线| 精品福利一二区| 中文字幕亚洲电影| 岛国一区二区三区| 亚洲午夜电影在线观看| 制服丝袜亚洲网站| 国产一区二区三区不卡在线观看| 国产精品一区二区在线观看不卡| 久久精品一区蜜桃臀影院| 欧美国产日韩精品免费观看| 色婷婷狠狠综合| 国产精品白丝jk黑袜喷水| 国产99一区视频免费| 欧美在线一区二区三区| 日韩欧美一二三四区| 一区二区三区精品在线观看| 精品综合久久久久久8888| 欧美最猛黑人xxxxx猛交| 久久精品一区二区| 美女脱光内衣内裤视频久久影院| 国产精品原创巨作av| 日韩西西人体444www| 国产欧美一区二区三区鸳鸯浴 | 中文字幕免费一区| 成人免费毛片app| 韩国精品在线观看| 久久噜噜亚洲综合| 91亚洲男人天堂| 日本视频一区二区| 中文字幕不卡的av| 欧美精品日韩一本| jlzzjlzz亚洲女人18| 亚洲综合在线视频| 国产亚洲精品免费| 91精品国产麻豆国产自产在线| 懂色av一区二区三区免费观看 | 亚洲人被黑人高潮完整版| 欧美日韩国产高清一区二区三区 | 久久久亚洲欧洲日产国码αv| 久久伊人中文字幕| 九九国产精品视频| 中文字幕乱码久久午夜不卡| 精品一区二区在线播放| 日韩欧美的一区| 狠狠色丁香久久婷婷综| 亚洲欧美综合网| 欧美日韩一区精品| 激情久久五月天| 亚洲欧美日韩国产另类专区| 欧美视频一区二区三区在线观看| 免费精品视频在线| 中文字幕一区三区| 欧美mv和日韩mv国产网站| 色域天天综合网| 国产一区二区在线免费观看| 亚洲色图.com| 欧美一区二区三区公司| 96av麻豆蜜桃一区二区| 免费看欧美美女黄的网站| 国产精品免费丝袜| 91精品国产综合久久小美女| 成人一区在线看| 日本aⅴ免费视频一区二区三区| 九九国产精品视频| 国产欧美精品一区二区色综合| 91国偷自产一区二区开放时间| 国产亚洲欧美日韩在线一区| 毛片不卡一区二区| 精品日本一线二线三线不卡| 国产一区日韩二区欧美三区| 日本伊人色综合网| 久久久久99精品一区| 欧美视频一区二区三区在线观看| 韩国一区二区在线观看| 久久福利资源站| 午夜精品123| 免费高清在线一区| 婷婷久久综合九色综合伊人色| 亚洲欧洲日韩一区二区三区| 日韩视频国产视频| 久久精品一区四区| 国产精品毛片a∨一区二区三区| 国产亚洲视频系列| 欧美激情一二三区| 亚洲欧美日韩国产综合| 成人免费在线观看入口| 国产精品第四页| 婷婷成人激情在线网| 精久久久久久久久久久| eeuss鲁片一区二区三区在线观看| 风间由美一区二区av101| 91啪亚洲精品| 精品裸体舞一区二区三区| 久久精品一区二区三区不卡牛牛| 欧美激情一区二区三区在线| 洋洋av久久久久久久一区| 日韩电影免费在线| 波多野结衣精品在线| 欧美一区二区私人影院日本| 国产欧美日韩三区| 天堂资源在线中文精品| 成人免费视频免费观看| 91.成人天堂一区| 亚洲精品亚洲人成人网| 免费人成精品欧美精品| 欧美在线看片a免费观看| 欧美r级在线观看| 石原莉奈在线亚洲二区| 91在线观看成人| 国产日韩精品久久久| 国产一区二区福利视频| 宅男噜噜噜66一区二区66| 亚洲欧美国产毛片在线| av一区二区久久| 国产精品理伦片| 99视频精品全部免费在线| 久久精品视频免费观看| 国产福利91精品一区| 久久午夜老司机| 国产福利一区二区| 欧美国产亚洲另类动漫| 久久99久久精品欧美| 7777精品伊人久久久大香线蕉经典版下载| 中文字幕日本乱码精品影院| 国产精品一二一区| 国产精品美女一区二区| 国产91高潮流白浆在线麻豆| 国产精品久久久久影院亚瑟 | 欧美情侣在线播放| 毛片av中文字幕一区二区| 精品日韩一区二区三区免费视频| 麻豆久久久久久久| 久久久精品免费网站| zzijzzij亚洲日本少妇熟睡| 一区二区三区在线看| 欧美日韩电影在线播放| 国产精品一区二区无线| 亚洲色图视频网站| 日韩欧美成人一区| 91在线观看地址| 国产在线不卡一区| 亚洲欧洲一区二区三区| 91麻豆精品国产91久久久资源速度 | 精品国一区二区三区| 国产.欧美.日韩| 免费不卡在线观看| 亚洲视频在线一区| 欧美精品一区视频| 欧美性猛片xxxx免费看久爱| 国产九色sp调教91| 日韩精品五月天| 亚洲乱码国产乱码精品精98午夜 | 国内精品自线一区二区三区视频| 国产精品无人区| 精品人伦一区二区色婷婷| 欧美性大战xxxxx久久久| bt7086福利一区国产| 福利电影一区二区| 国内久久精品视频| 美腿丝袜亚洲三区| 欧美a级理论片| 秋霞电影网一区二区| 亚洲一二三四区不卡| 亚洲最色的网站| 亚洲综合色自拍一区| 亚洲欧美成人一区二区三区| 中文字幕一区在线观看视频| 久久久不卡网国产精品一区| 日韩一级片在线观看| 欧美日韩成人综合在线一区二区| 成人动漫精品一区二区| 国产精品12区| 成人动漫一区二区| 91小视频在线免费看| 欧美日韩在线亚洲一区蜜芽| 欧美性xxxxxx少妇| 欧美变态口味重另类| 国产校园另类小说区| 一区二区三区四区视频精品免费| 亚洲在线视频免费观看| 日韩成人精品视频| 久久99国产精品久久99果冻传媒| 国产成人在线视频网站| 欧美亚洲国产一区在线观看网站| 欧美日韩国产高清一区二区 | www.亚洲色图.com| 欧美人成免费网站| 一色桃子久久精品亚洲| 婷婷夜色潮精品综合在线| 国产伦精品一区二区三区免费| 日本韩国一区二区三区视频| 精品国产三级电影在线观看|