1 /* SPDX-License-Identifier: GPL-2.0+ */
5 * Header file for logging tests
8 #ifndef __SYSLOG_TEST_H
9 #define __SYSLOG_TEST_H
12 * struct sb_log_env - private data for sandbox ethernet driver
14 * This structure is used for the private data of the sandbox ethernet
17 * @expected: string expected to be written by the syslog driver
18 * @uts: unit test state
22 struct unit_test_state *uts;
26 * sb_log_tx_handler() - transmit callback function
28 * This callback function is invoked when a network package is sent using the
29 * sandbox Ethernet driver. The private data of the driver holds a sb_log_env
30 * structure with the unit test state and the expected UDP payload.
32 * The following checks are executed:
34 * * the Ethernet packet indicates a IP broadcast message
35 * * the IP header is for a local UDP broadcast message to port 514
36 * * the UDP payload matches the expected string
38 * After testing the pointer to the expected string is set to NULL to signal
39 * that the callback function has been called.
41 * @dev: sandbox ethernet device
42 * @packet: Ethernet packet
43 * @len: length of Ethernet packet
46 int sb_log_tx_handler(struct udevice *dev, void *packet, unsigned int len);
49 * syslog_test_setup() - Enable syslog logging ready for tests
52 * Return: 0 if OK, -ENOENT if the syslog log driver is not found
54 int syslog_test_setup(struct unit_test_state *uts);
57 * syslog_test_finish() - Disable syslog logging after tests
60 * Return: 0 if OK, -ENOENT if the syslog log driver is not found
62 int syslog_test_finish(struct unit_test_state *uts);