UDP Support Functions

These are the functions required by the PXE standard to support UDP.

pxenv_udp_open()

This function opens the UDP connection. There can only be one open UDP connection at a time.

pxenv_ret_code_t pxenv_udp_open(struct pxenv_udp_open_s udpopen);

udpopen

This is a pointer to a pre-initialized pxenv_udp_open_s structure.

These are the fields in the pxenv_udp_open_s structure that get set by this function before returning.

udpopen.status

The exit status of this function. This is set to one of the PXENV_STATUS_xxx constants.

udpopen.src_ip

The IP number of this node.

These are all the fields of the pxenv_udp_open_s structure.


      typedef struct pxenv_udp_open_s {
          pxenv_status_t status;
	  ip4_t src_ip;
      } pxenv_udp_open_t;

      

pxenv_udp_close()

This function closes the currently open UDP connection.

pxenv_ret_code_t pxenv_udp_close(struct pxenv_udp_close_s udpclose);

udpclose

This is a pointer to a pre-initialized pxenv_udp_close_s structure.

These are the fields in the pxenv_udp_close_s structure that get set by this function before returning.

udpclose.status

The exit status of this function. This is set to one of the PXENV_STATUS_xxx constants.

These are all the fields of the pxenv_udp_close_s structure.


      typedef struct pxenv_udp_close_s {
          pxenv_status_t status;
      } pxenv_udp_close_t;
      
      

pxenv_udp_read()

This function reads one packet using an already opened UDP connection.

pxenv_ret_code_t pxenv_udp_read(struct pxenv_udp_read_s udpread);

udpread

This is a pointer to a pre-initialized pxenv_udp_read_s structure. The IP address of the boot server, the UDP port being used, and the number of bytes in the packet's buffer.

These are the fields in the pxenv_udp_read_s structure that must be set before calling this function.

udpread.dest_ip

the IP number of the destination.

udpread.gw_ip

the ip number of the gateway.

udpread.src_port

the UDP port of the sendor, defaults to 2069 if this flag is zero.

udpread.dest_port

the UDP port of the destination.

udpread.buffer_size

size of the transmit buffer.

udpread.buffer

the buffer address in offset:segment format.

These are the fields in the pxenv_udp_open_s structure that get set by this function before returning.

udpread.status

The exit status of this function. This is set to one of the PXENV_STATUS_xxx constants.

These are all the fields of the pxenv_udp_open_s structure.


      typedef struct pxenv_udp_read_s {
          pxenv_status_t status;
	  ip4_t src_ip;
	  ip4_t dest_ip;
	  udp_port_t s_port;
	  udp_port_t d_port;
	  u_int16_t buffer_size;
	  segoff16_t buffer;
      } pxenv_udp_read_t;

      

pxenv_udp_write()

This function writes one packet to the requested UDP port using an already opened UDP connection.

pxenv_ret_code_t pxenv_udp_write(struct pxenv_udp_write_s updwrite);

updwrite

This is a pointer to a pre-initialized pxenv_udp_write_s structure.

These are the fields in the pxenv_udp_write_s structure that must be set before calling this function.

udpread.dest_ip

the IP number of the destination.

udpread.gw_ip

the ip number of the gateway.

udpread.src_port

the UDP port of the sendor, defaults to 2069 if this flag is zero.

udpread.dest_port

the UDP port of the destination.

udpread.buffer_size

size of the transmit buffer.

udpread.buffer

the buffer address in offset:segment format.

These are the fields in the pxenv_udp_write_s structure that get set by this function before returning.

udwrite.status

The exit status of this function. This is set to one of the PXENV_STATUS_xxx constants.

These are all the fields of the pxenv_udp_write_s structure.


      typedef struct pxenv_udp_write_s {
          pxenv_status_t status;
	  ip4_t dest_ip;
	  ip4_t gw_ip;
	  udp_port_t src_port;
	  udp_port_t dest_port;
	  u_int16_t buffer_size;
	  segoff16_t buffer;
      } pxenv_udp_write_t;