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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bclient.c

?? 這是單板上DPRAM的驅(qū)動程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*  @(#) 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).                            */
/*---------------------------------------------------------------------*/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本一区二区三区在线观看| 久久影院午夜片一区| 久久99国产精品麻豆| 综合色中文字幕| 国产精品白丝av| 亚洲成人免费影院| 天天色天天操综合| 亚洲日本成人在线观看| 26uuu精品一区二区在线观看| 欧美唯美清纯偷拍| 99久久精品国产观看| 国精产品一区一区三区mba视频| 亚洲一本大道在线| 亚洲乱码中文字幕| 中文字幕av资源一区| 国产91色综合久久免费分享| 日韩福利视频网| 亚洲精品国产第一综合99久久| 久久久91精品国产一区二区精品 | 日韩精品午夜视频| 亚洲色欲色欲www在线观看| 91丨九色porny丨蝌蚪| 国产乱码字幕精品高清av| 美女尤物国产一区| 三级在线观看一区二区| 亚洲国产人成综合网站| 亚洲女同一区二区| 中文字幕国产一区| 国产偷v国产偷v亚洲高清| 精品免费一区二区三区| 91精品视频网| 国产综合色在线| 经典三级视频一区| 国产毛片一区二区| 国产综合久久久久久鬼色| 麻豆成人综合网| 久久精品国产亚洲一区二区三区| 三级精品在线观看| 午夜精品一区二区三区电影天堂 | 国产亚洲欧洲一区高清在线观看| 欧美一区二区三区免费| 欧美一区二区视频在线观看2022 | youjizz国产精品| 国产成人aaaa| 成人精品高清在线| 成人黄色在线看| 99久久精品国产精品久久| 91在线视频观看| 在线亚洲高清视频| 欧洲精品中文字幕| 欧美日韩免费一区二区三区| 欧美精品一二三区| 欧美一区二区美女| 欧美精品一区二区精品网| 国产视频一区在线观看| 日本一区免费视频| 中文字幕一区二区三中文字幕| 亚洲欧美视频在线观看| 亚洲午夜精品网| 日韩黄色免费网站| 久久国产综合精品| 粉嫩一区二区三区性色av| 91老师片黄在线观看| 欧美吞精做爰啪啪高潮| 在线观看91精品国产麻豆| 日韩欧美国产高清| 国产欧美一区二区精品性色 | 欧美日韩高清一区二区三区| 7777精品久久久大香线蕉| 日韩女优电影在线观看| 国产三级精品在线| 夜色激情一区二区| 日日噜噜夜夜狠狠视频欧美人| 久久国产夜色精品鲁鲁99| 成人黄色小视频| 精品在线播放午夜| 91美女片黄在线观看91美女| 9191成人精品久久| 日本一区二区视频在线| 亚洲无人区一区| 成人欧美一区二区三区白人| 亚洲成av人片一区二区| 国产一区二区剧情av在线| 色国产综合视频| 精品国产一区a| 一区二区在线看| 精品夜夜嗨av一区二区三区| 91免费观看在线| 日韩免费看网站| 亚洲女爱视频在线| 久久综合九色综合欧美98| 又紧又大又爽精品一区二区| 国产一区二区美女诱惑| 欧美日韩色综合| 国产精品国产三级国产aⅴ原创 | 日韩欧美中文字幕公布| 中文字幕日本不卡| 久久99久久99| 麻豆极品一区二区三区| 91麻豆成人久久精品二区三区| 日韩精品中文字幕在线一区| 中文字幕五月欧美| 国产精品69久久久久水密桃 | 国产视频一区二区在线| 亚洲高清在线精品| 成人av高清在线| 欧美成人a∨高清免费观看| 亚洲愉拍自拍另类高清精品| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 粉嫩一区二区三区性色av| 欧美一区二区三区思思人| 亚洲欧洲日韩av| 91麻豆精品国产91久久久| 蜜臀精品一区二区三区在线观看| 日韩av一级片| 91亚洲永久精品| 亚洲国产成人在线| 国产美女主播视频一区| 91精品国产综合久久婷婷香蕉| 一区二区三区欧美日韩| jiyouzz国产精品久久| 久久久影院官网| 久久99久久久久久久久久久| 欧美精品乱码久久久久久按摩| 亚洲精品视频在线观看网站| 不卡欧美aaaaa| 国产欧美一区二区在线观看| 狠狠色丁香久久婷婷综合_中| 欧美丰满美乳xxx高潮www| 亚洲成人资源网| 欧美主播一区二区三区| 亚洲宅男天堂在线观看无病毒| 一本久道久久综合中文字幕| 最新中文字幕一区二区三区 | 成人免费高清视频| 久久精品日韩一区二区三区| 国产一区二区三区在线观看精品| 日韩欧美国产电影| 麻豆久久一区二区| 精品国产乱码久久久久久久| 蜜臀久久99精品久久久久久9| 日韩亚洲电影在线| 免费看欧美女人艹b| 高清在线不卡av| 国产精品色在线观看| 成人免费av在线| 国产精品久久久久国产精品日日 | 国产精品污网站| 一本色道久久综合精品竹菊| 亚洲激情一二三区| 欧美影视一区二区三区| 亚洲综合免费观看高清完整版| 欧美午夜精品久久久| 日韩国产成人精品| 久久综合久久鬼色中文字| 成人av免费在线| 一区二区三区成人在线视频| 制服丝袜亚洲色图| 激情国产一区二区| 中文字幕精品一区| 欧美在线一区二区| 久久国产视频网| 国产精品天天摸av网| 色国产精品一区在线观看| 天天影视色香欲综合网老头| 精品国产伦一区二区三区观看方式 | 国产精品美女久久久久久久| 91婷婷韩国欧美一区二区| 亚洲国产精品久久久男人的天堂| 欧美电视剧免费全集观看| 国产ts人妖一区二区| 亚洲国产视频a| 久久久久久9999| 日本道精品一区二区三区| 免费观看日韩电影| 中文字幕中文乱码欧美一区二区| 欧美性xxxxxxxx| 国产主播一区二区三区| 亚洲黄色av一区| 久久人人超碰精品| 欧美日韩亚洲丝袜制服| 黄页网站大全一区二区| 国产精品国产三级国产aⅴ中文| 欧美视频完全免费看| 韩国女主播一区二区三区| 亚洲欧美日韩中文播放| 欧美一区二区三区免费在线看| 99久久精品99国产精品| 欧美aaaaaa午夜精品| 中文字幕一区二区5566日韩| 欧美大尺度电影在线| 在线看国产一区二区| 国产精品资源在线观看| 亚洲chinese男男1069| 亚洲国产精品激情在线观看| 欧美一级久久久| 91影院在线观看| 国产.欧美.日韩| 麻豆视频观看网址久久| 亚洲图片欧美综合|