Browse Source

hoffmeis: Preparations for syslog support (LOGSERVER in DHCP, linewise

output buffering defintions and the like)
tags/v0.9.3
Anselm Martin Hoffmeister 17 years ago
parent
commit
ed7dc02a95
5 changed files with 26 additions and 3 deletions
  1. 4
    0
      src/core/config.c
  2. 13
    2
      src/include/console.h
  3. 3
    0
      src/include/gpxe/dhcp.h
  4. 1
    1
      src/net/udp/dhcp.c
  5. 5
    0
      src/usr/dhcpmgmt.c

+ 4
- 0
src/core/config.c View File

74
 REQUIRE_OBJECT ( pc_kbd );
74
 REQUIRE_OBJECT ( pc_kbd );
75
 #endif
75
 #endif
76
 
76
 
77
+#ifdef CONSOLE_SYSLOG
78
+REQUIRE_OBJECT ( syslog );
79
+#endif
80
+
77
 /*
81
 /*
78
  * Drag in all requested protocols
82
  * Drag in all requested protocols
79
  *
83
  *

+ 13
- 2
src/include/console.h View File

30
 struct console_driver {
30
 struct console_driver {
31
 	/** Console is disabled.
31
 	/** Console is disabled.
32
 	 *
32
 	 *
33
-	 * The console's putchar(), getchar() and iskey() methods will
34
-	 * not be called while #disabled==1.  Typically the
33
+	 * The console's putchar(), putline(), getchar() and iskey()
34
+	 * methods will not be called while #disabled==1. Typically the
35
 	 * console's initialisation functions (called via INIT_FN())
35
 	 * console's initialisation functions (called via INIT_FN())
36
 	 * will set #disabled=0 upon completion.
36
 	 * will set #disabled=0 upon completion.
37
 	 *
37
 	 *
47
 	 */
47
 	 */
48
 	void ( *putchar ) ( int character );
48
 	void ( *putchar ) ( int character );
49
 
49
 
50
+	/** Write an entire line to the console.
51
+	 * This is intended to be used by line-oriented output media,
52
+	 * like system logging facilities or line printers.
53
+	 * Line output will not contain non-printable characters.
54
+	 *
55
+	 * @v linebuffer	Pointer to the \0-terminated line
56
+	 * @ret None		-
57
+	 * @err None		-
58
+	 */
59
+	void ( * putline ) ( unsigned char * linebuffer );
60
+
50
 	/** Read a character from the console.
61
 	/** Read a character from the console.
51
 	 *
62
 	 *
52
 	 * @v None		-
63
 	 * @v None		-

+ 3
- 0
src/include/gpxe/dhcp.h View File

60
 /** DNS servers */
60
 /** DNS servers */
61
 #define DHCP_DNS_SERVERS 6
61
 #define DHCP_DNS_SERVERS 6
62
 
62
 
63
+/** Syslog servers */
64
+#define DHCP_LOG_SERVERS 7
65
+
63
 /** Host name */
66
 /** Host name */
64
 #define DHCP_HOST_NAME 12
67
 #define DHCP_HOST_NAME 12
65
 
68
 

+ 1
- 1
src/net/udp/dhcp.c View File

54
 	DHCP_VENDOR_CLASS_ID,
54
 	DHCP_VENDOR_CLASS_ID,
55
 	DHCP_STRING (  'E', 't', 'h', 'e', 'r', 'b', 'o', 'o', 't' ),
55
 	DHCP_STRING (  'E', 't', 'h', 'e', 'r', 'b', 'o', 'o', 't' ),
56
 	DHCP_PARAMETER_REQUEST_LIST,
56
 	DHCP_PARAMETER_REQUEST_LIST,
57
-	DHCP_OPTION ( DHCP_SUBNET_MASK, DHCP_ROUTERS, DHCP_DNS_SERVERS,
57
+	DHCP_OPTION ( DHCP_SUBNET_MASK, DHCP_ROUTERS, DHCP_DNS_SERVERS, DHCP_LOG_SERVERS,
58
 		      DHCP_HOST_NAME, DHCP_DOMAIN_NAME, DHCP_ROOT_PATH,
58
 		      DHCP_HOST_NAME, DHCP_DOMAIN_NAME, DHCP_ROOT_PATH,
59
 		      DHCP_VENDOR_ENCAP, DHCP_TFTP_SERVER_NAME,
59
 		      DHCP_VENDOR_ENCAP, DHCP_TFTP_SERVER_NAME,
60
 		      DHCP_BOOTFILE_NAME, DHCP_EB_ENCAP,
60
 		      DHCP_BOOTFILE_NAME, DHCP_EB_ENCAP,

+ 5
- 0
src/usr/dhcpmgmt.c View File

37
 /* Avoid dragging in dns.o */
37
 /* Avoid dragging in dns.o */
38
 struct in_addr nameserver;
38
 struct in_addr nameserver;
39
 
39
 
40
+/* Avoid dragging in syslog.o */
41
+struct in_addr syslogserver;
42
+
40
 /**
43
 /**
41
  * Configure network device via DHCP
44
  * Configure network device via DHCP
42
  *
45
  *
97
 	/* Retrieve other DHCP options that we care about */
100
 	/* Retrieve other DHCP options that we care about */
98
 	find_dhcp_ipv4_option ( dhcp_options, DHCP_DNS_SERVERS,
101
 	find_dhcp_ipv4_option ( dhcp_options, DHCP_DNS_SERVERS,
99
 				&nameserver );
102
 				&nameserver );
103
+	find_dhcp_ipv4_option ( dhcp_options, DHCP_LOG_SERVERS,
104
+				&syslogserver );
100
 
105
 
101
 	return 0;
106
 	return 0;
102
 }
107
 }

Loading…
Cancel
Save