Home |
Function xn_add_host_table_entry Function xn_delete_host_table_entry Function xn_interface_open_config Function xn_interface_ethernet_statistics Function xn_interface_statistics Function xn_send_ethernet_frame Function cb_wr_screen_string_fnc Function cb_rs232_connection_lost_fnc Function cb_raw_mode_in_char_fnc Function cb_packetin_isr |
Function cb_packetin_isrThis callback is called by the Ethernet driver's hardware interrupt handler when a data packet has been received: int cb_packetin_isr(int interface, byte * data, int length, int buffer_size); ParametersinterfaceInterface number (as returned by xn_interface_open or xn_interface_open_config) on which the new packet came in. dataPointer to the packet's data. lengthNumber of bytes pointed to by parameter data. buffer_sizeNumber of bytes the buffer pointed to by data can hold. buffer_size will always be >= length. return valueNumber of bytes RTIP-32 should process at *data. If 0 is returned, RTIP-32 will discard this packet. This callback can be used to intercept incoming packets at a very early stage and in real time. The callback function may modify the data pointed to by parameter data, if desired. It must return the number of bytes RTIP-32 should process. If the packet data is not modified and RTIP-32 should continue normal processing, return parameter length. To discard the data, return 0. Since this callback is called from a hardware interrupt handler, it should be short and consume very little stack space. It may not call any functions which may cause a blocking task switch (e.g., malloc, etc). To intercept less time critical packets, use cb_packetin_task instead. Please see cb_packetin_task for a complete example.
|