⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nif.h

📁 motorola 针对coldfire 5275 评估板的Dbug bootloader源程序
💻 H
字号:
/*
 * File:        nif.h
 * Purpose:     Definition of a Network InterFace.
 *
 * Notes:
 */

#ifndef _NIF_H
#define _NIF_H

/********************************************************************/

/* 
 * Maximum number of supported protoocls: IP, ARP, RARP 
 */
#define MAX_SUP_PROTO   (3)

typedef struct NIF_t
{
    ETH_ADDR    hwa;        /* ethernet card hardware address */
    ETH_ADDR    broadcast;  /* broadcast address */
    int         mtu;        /* hardware maximum transmission unit */
    int         ch;         /* ethernet channel associated with this NIF */

    struct SUP_PROTO_t
    {
        uint16  protocol;
        void    (*handler)(struct NIF_t *, NBUF *);
        void    *info;
    } protocol[MAX_SUP_PROTO];

    unsigned short  num_protocol;

    int     (*send)(struct NIF_t *, uint8 *, uint8 *, uint16, NBUF *);

    unsigned int    f_rx;
    unsigned int    f_tx;
    unsigned int    f_rx_err;
    unsigned int    f_tx_err;
    unsigned int    f_err;
} NIF;

/********************************************************************/

NIF *
nif_init (NIF *);

int
nif_protocol_exist (NIF *, uint16);

void
nif_protocol_handler (NIF *, uint16, NBUF *);

void *
nif_get_protocol_info (NIF *, uint16);

int
nif_bind_protocol (NIF *, uint16, void (*)(NIF *, NBUF *), void *);

/********************************************************************/

#endif /* _NIF_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -