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,6 +74,10 @@ REQUIRE_OBJECT ( btext );
74 74
 REQUIRE_OBJECT ( pc_kbd );
75 75
 #endif
76 76
 
77
+#ifdef CONSOLE_SYSLOG
78
+REQUIRE_OBJECT ( syslog );
79
+#endif
80
+
77 81
 /*
78 82
  * Drag in all requested protocols
79 83
  *

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

@@ -30,8 +30,8 @@
30 30
 struct console_driver {
31 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 35
 	 * console's initialisation functions (called via INIT_FN())
36 36
 	 * will set #disabled=0 upon completion.
37 37
 	 *
@@ -47,6 +47,17 @@ struct console_driver {
47 47
 	 */
48 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 61
 	/** Read a character from the console.
51 62
 	 *
52 63
 	 * @v None		-

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

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

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

@@ -54,7 +54,7 @@ static uint8_t dhcp_request_options_data[] = {
54 54
 	DHCP_VENDOR_CLASS_ID,
55 55
 	DHCP_STRING (  'E', 't', 'h', 'e', 'r', 'b', 'o', 'o', 't' ),
56 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 58
 		      DHCP_HOST_NAME, DHCP_DOMAIN_NAME, DHCP_ROOT_PATH,
59 59
 		      DHCP_VENDOR_ENCAP, DHCP_TFTP_SERVER_NAME,
60 60
 		      DHCP_BOOTFILE_NAME, DHCP_EB_ENCAP,

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

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

Loading…
Cancel
Save