OpenCores
URL https://opencores.org/ocsvn/amber/amber/trunk

Subversion Repositories amber

[/] [amber/] [trunk/] [sw/] [boot-loader-ethmac/] [packet.h] - Diff between revs 61 and 80

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 61 Rev 80
Line 158... Line 158...
    unsigned int    telnet_payload_len;
    unsigned int    telnet_payload_len;
} packet_t;
} packet_t;
 
 
 
 
 
 
typedef struct {
 
 
 
    packet_buffer_t** tcp_buf;
 
    int          tcp_current_buf;
 
 
 
    /* Telnet rx and tx line buffers */
 
    line_buf_t*  telnet_rxbuf;
 
    line_buf_t*  telnet_txbuf;
 
 
 
    int          telnet_sent_opening_message;
 
    int          telnet_echo_mode;
 
    int          telnet_connection_state;
 
    int          telnet_options_sent;
 
 
 
    int          packets_sent;
 
    int          packets_received;
 
    int          packets_resent;
 
 
 
    int          tcp_connection_state;
 
    int          tcp_reset;
 
    int          tcp_disconnect;
 
    int          tcp_seq;            /* should be random initial seq number for tcp */
 
    int          tcp_last_seq;
 
    unsigned int tcp_last_ack;
 
 
 
    int          id;
 
 
 
    packet_t*    rx_packet;  /* Header info from last packet received */
 
} socket_t;
 
 
 
 
 
 
 
/* Enumerated types */
/* Enumerated types */
enum mdi_ctrl {
enum mdi_ctrl {
        mdi_write = 0x04000000,
        mdi_write = 0x04000000,
        mdi_read  = 0x08000000,
        mdi_read  = 0x08000000,
        mdi_ready = 0x10000000,
        mdi_ready = 0x10000000,
Line 207... Line 175...
};
};
 
 
 
 
/* Global Variables */
/* Global Variables */
extern mac_ip_t    self_g;
extern mac_ip_t    self_g;
extern packet_t*   rx_packet_g;
 
extern socket_t*   socket0_g;
 
extern socket_t*   socket1_g;
 
 
 
 
 
/* Functions */
/* Functions */
void            init_packet_buffers     (socket_t*);
void            init_packet             ();
unsigned short  header_checksum16       (unsigned char *buf, unsigned short len, unsigned int sum);
unsigned short  header_checksum16       (unsigned char *buf, unsigned short len, unsigned int sum);
 
 
void            arp_reply               (char *buf, mac_ip_t*);
void            arp_reply               (char *buf, mac_ip_t*);
void            ping_reply              (packet_t* packet0, int ping_id, int ping_seq, char * rx_buf);
void            ping_reply              (packet_t* packet0, int ping_id, int ping_seq, char * rx_buf);
 
 
Line 227... Line 192...
void            parse_rx_packet         (char*, packet_t*);
void            parse_rx_packet         (char*, packet_t*);
void            parse_arp_packet        (char*);
void            parse_arp_packet        (char*);
void            parse_ip_packet         (char*, packet_t*);
void            parse_ip_packet         (char*, packet_t*);
void            parse_ping_packet       (char*, packet_t*);
void            parse_ping_packet       (char*, packet_t*);
 
 
socket_t*       init_socket             (int);
 
 
 
 
 
 
 
 
 
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.