1 /*
2  * ipmi_lanparm.h
3  *
4  * Routines for setting up a connection to an IPMI LAN interface.
5  *
6  * Author: MontaVista Software, Inc.
7  *         Corey Minyard <minyard@mvista.com>
8  *         source@mvista.com
9  *
10  * Copyright 2004 MontaVista Software Inc.
11  *
12  *  This program is free software; you can redistribute it and/or
13  *  modify it under the terms of the GNU Lesser General Public License
14  *  as published by the Free Software Foundation; either version 2 of
15  *  the License, or (at your option) any later version.
16  *
17  *
18  *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
19  *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21  *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
24  *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25  *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
26  *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
27  *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  *
29  *  You should have received a copy of the GNU Lesser General Public
30  *  License along with this program; if not, write to the Free
31  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32  */
33 
34 #ifndef OPENIPMI_LANPARM_H
35 #define OPENIPMI_LANPARM_H
36 
37 #include <OpenIPMI/ipmi_types.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /* The abstract type for lanparm. */
44 typedef struct ipmi_lanparm_s ipmi_lanparm_t;
45 
46 
47 /* Generic callback used to tell when a LANPARM operation is done. */
48 typedef void (*ipmi_lanparm_done_cb)(ipmi_lanparm_t *lanparm,
49 				     int            err,
50 				     void           *cb_data);
51 
52 /* Generic callback for iterating. */
53 typedef void (*ipmi_lanparm_ptr_cb)(ipmi_lanparm_t *lanparm,
54 				    void           *cb_data);
55 
56 /* Allocate a LANPARM. */
57 int ipmi_lanparm_alloc(ipmi_mc_t      *mc,
58 		       unsigned int   channel,
59 		       ipmi_lanparm_t **new_lanparm);
60 
61 /* Destroy a LANPARM. */
62 int ipmi_lanparm_destroy(ipmi_lanparm_t       *lanparm,
63 			 ipmi_lanparm_done_cb handler,
64 			 void                 *cb_data);
65 
66 /* Used to track references to a lanparm.  You can use this instead of
67    ipmi_lanparm_destroy, but use of the destroy function is
68    recommended.  This is primarily here to help reference-tracking
69    garbage collection systems like what is in Perl to be able to
70    automatically destroy lanparms when they are done. */
71 void ipmi_lanparm_ref(ipmi_lanparm_t *lanparm);
72 void ipmi_lanparm_deref(ipmi_lanparm_t *lanparm);
73 
74 void ipmi_lanparm_iterate_lanparms(ipmi_domain_t       *domain,
75 				   ipmi_lanparm_ptr_cb handler,
76 				   void                *cb_data);
77 
78 ipmi_mcid_t ipmi_lanparm_get_mc_id(ipmi_lanparm_t *lanparm);
79 unsigned int ipmi_lanparm_get_channel(ipmi_lanparm_t *lanparm);
80 
81 #define IPMI_LANPARM_NAME_LEN 64
82 int ipmi_lanparm_get_name(ipmi_lanparm_t *lanparm, char *name, int length);
83 
84 
85 
86 /* Fetch a parameter value from the LANPARM.  The "set" and "block"
87    parameters are the set selector and block selectors.  If those are
88    not relevant for the given parm, then set them to zero.  Note that
89    on the return data, the first byte (byte 0) is the revision number,
90    the data starts in the second byte. */
91 typedef void (*ipmi_lanparm_get_cb)(ipmi_lanparm_t    *lanparm,
92 				    int               err,
93 				    unsigned char     *data,
94 				    unsigned int      data_len,
95 				    void              *cb_data);
96 int ipmi_lanparm_get_parm(ipmi_lanparm_t      *lanparm,
97 			  unsigned int        parm,
98 			  unsigned int        set,
99 			  unsigned int        block,
100 			  ipmi_lanparm_get_cb done,
101 			  void                *cb_data);
102 
103 /* Set the parameter value in the LANPARM to the given data. */
104 int ipmi_lanparm_set_parm(ipmi_lanparm_t       *lanparm,
105 			  unsigned int         parm,
106 			  unsigned char        *data,
107 			  unsigned int         data_len,
108 			  ipmi_lanparm_done_cb done,
109 			  void                 *cb_data);
110 
111 /* The various LAN config parms. */
112 #define IPMI_LANPARM_SET_IN_PROGRESS		0
113 #define IPMI_LANPARM_AUTH_TYPE_SUPPORT		1
114 #define IPMI_LANPARM_AUTH_TYPE_ENABLES		2
115 #define IPMI_LANPARM_IP_ADDRESS			3
116 #define IPMI_LANPARM_IP_ADDRESS_SRC		4
117 #define IPMI_LANPARM_MAC_ADDRESS		5
118 #define IPMI_LANPARM_SUBNET_MASK		6
119 #define IPMI_LANPARM_IPV4_HDR_PARMS		7
120 #define IPMI_LANPARM_PRIMARY_RMCP_PORT		8
121 #define IPMI_LANPARM_SECONDARY_RMCP_PORT	9
122 #define IPMI_LANPARM_BMC_GENERATED_ARP_CNTL	10
123 #define IPMI_LANPARM_GRATUIDOUS_ARP_INTERVAL	11
124 #define IPMI_LANPARM_DEFAULT_GATEWAY_ADDR	12
125 #define IPMI_LANPARM_DEFAULT_GATEWAY_MAC_ADDR	13
126 #define IPMI_LANPARM_BACKUP_GATEWAY_ADDR	14
127 #define IPMI_LANPARM_BACKUP_GATEWAY_MAC_ADDR	15
128 #define IPMI_LANPARM_COMMUNITY_STRING		16
129 #define IPMI_LANPARM_NUM_DESTINATIONS		17
130 #define IPMI_LANPARM_DEST_TYPE			18
131 #define IPMI_LANPARM_DEST_ADDR			19
132 #define IPMI_LANPARM_VLAN_ID			20
133 #define IPMI_LANPARM_VLAN_PRIORITY		21
134 #define IPMI_LANPARM_NUM_CIPHER_SUITE_ENTRIES	22
135 #define IPMI_LANPARM_CIPHER_SUITE_ENTRY_SUPPORT	23
136 #define IPMI_LANPARM_CIPHER_SUITE_ENTRY_PRIV	24
137 #define IPMI_LANPARM_DEST_VLAN_TAG		25
138 
139 #define IPMI_LANPARM_IP_ADDR_SRC_STATIC		1
140 #define IPMI_LANPARM_IP_ADDR_SRC_DHCP		2
141 #define IPMI_LANPARM_IP_ADDR_SRC_BIOS		3
142 #define IPMI_LANPARM_IP_ADDR_SRC_OTHER		4
143 
144 /* A full LAN configuration.  Note that you cannot allocate one of
145    these, you can only fetch them, modify them, set them, and free
146    them. */
147 typedef struct ipmi_lan_config_s ipmi_lan_config_t;
148 
149 /* Get the full LAN configuration and lock the LAN.  Note that if the
150    LAN is locked by another, you will get an EAGAIN error in the
151    callback.  You can retry the operation, or if you are sure that it
152    is free, you can call ipmi_lan_clear_lock() before retrying.  Note
153    that the config in the callback *must* be freed by you. */
154 typedef void (*ipmi_lan_get_config_cb)(ipmi_lanparm_t    *lanparm,
155 				       int               err,
156 				       ipmi_lan_config_t *config,
157 				       void              *cb_data);
158 int ipmi_lan_get_config(ipmi_lanparm_t         *lanparm,
159 			ipmi_lan_get_config_cb done,
160 			void                   *cb_data);
161 
162 /* Set the full LAN configuration.  The config *MUST* be locked and
163    the lanparm must match the LAN that it was fetched with.  Note that
164    a copy is made of the configuration, so you are free to do whatever
165    you like with it after this.  Note that this unlocks the config, so
166    it cannot be used for future set operations. */
167 int ipmi_lan_set_config(ipmi_lanparm_t       *lanparm,
168 			ipmi_lan_config_t    *config,
169 			ipmi_lanparm_done_cb done,
170 			void                 *cb_data);
171 
172 /* Clear the lock on a LAN.  If the LAN config is non-NULL, then it's
173    lock is also cleared. */
174 int ipmi_lan_clear_lock(ipmi_lanparm_t       *lanparm,
175 			ipmi_lan_config_t    *lanc,
176 			ipmi_lanparm_done_cb done,
177 			void                 *cb_data);
178 
179 /* Free a LAN config. */
180 void ipmi_lan_free_config(ipmi_lan_config_t *config);
181 
182 /*
183  * Boatloads of data from the LAN config.  Note that all IP addresses,
184  * ports, etc. are in network order.
185  */
186 
187 /* This interface lets you fetch and set the data values by parm
188    num. Note that the parm nums *DO NOT* correspond to the
189    IPMI_LANPARM_xxx values above. */
190 
191 enum ipmi_lanconf_val_type_e { IPMI_LANCONFIG_INT, IPMI_LANCONFIG_BOOL,
192 			       IPMI_LANCONFIG_DATA,
193 			       IPMI_LANCONFIG_IP, IPMI_LANCONFIG_MAC };
194 /* When getting the value, the valtype will be set to int or data.  If
195    it is int or bool, the value is returned in ival and the dval is
196    not used.  If it is data, ip, or mac, the data will be returned in
197    an allocated array in dval and the length set in dval_len.  The
198    data must be freed with ipmi_lanconfig_data_free().  The is used
199    for some data items (the priv level for authentication type, the
200    destination for alerts and destination addresses); for other items
201    it is ignored.  The index should point to the value to fetch
202    (starting at zero), it will be updated to the next value or -1 if
203    no more are left.  The index will be unchanged if the parm does not
204    support an index.
205 
206    The string name is returned in the name field, if it is not NULL.
207 
208    Note that when fetching a value, if the passed in pointer is NULL
209    the data will not be filled in (except for index, which must always
210    be present).  That lets you get the value type without getting the
211    data, for instance. */
212 int ipmi_lanconfig_get_val(ipmi_lan_config_t *lanc,
213 			   unsigned int      parm,
214 			   const char        **name,
215 			   int               *index,
216 			   enum ipmi_lanconf_val_type_e *valtype,
217 			   unsigned int      *ival,
218 			   unsigned char     **dval,
219 			   unsigned int      *dval_len);
220   /* Set a value in the lan config.  You must know ahead of time the
221      actual value type and set the proper one. */
222 int ipmi_lanconfig_set_val(ipmi_lan_config_t *lanc,
223 			   unsigned int      parm,
224 			   int               index,
225 			   unsigned int      ival,
226 			   unsigned char     *dval,
227 			   unsigned int      dval_len);
228 /* If the value is an integer, this can be used to determine if it is
229    an enumeration and what the values are.  If the parm is not an
230    enumeration, this will return ENOSYS for the parm.  Otherwise, if
231    you pass in zero, you will get either the first enumeration value,
232    or EINVAL if zero is not a valid enumeration, but there are others.
233    If this returns EINVAL or 0, nval will be set to the next valid
234    enumeration value, or -1 if val is the last or past the last
235    enumeration value.  If this returns 0, val will be set to the
236    string value for the enumeration. */
237 int ipmi_lanconfig_enum_val(unsigned int parm, int val, int *nval,
238 			    const char **sval);
239 /* Sometimes array indexes may be enumerations.  This allows the user
240    to detect if a specific parm's array index is an enumeration, and
241    to get the enumeration values.  */
242 int ipmi_lanconfig_enum_idx(unsigned int parm, int idx, const char **sval);
243 /* Free data from ipmi_lanconfig_get_val(). */
244 void ipmi_lanconfig_data_free(void *data);
245 /* Convert a string to a lanconfig parm number.  Returns -1 if the
246    string is invalid. */
247 unsigned int ipmi_lanconfig_str_to_parm(char *name);
248 /* Convert the parm to a string name. */
249 const char *ipmi_lanconfig_parm_to_str(unsigned int parm);
250 /* Get the type of a specific parm. */
251 int ipmi_lanconfig_parm_to_type(unsigned int                 parm,
252 				enum ipmi_lanconf_val_type_e *valtype);
253 
254 
255 /* The first set of parameters here must be present, so they are
256    returned directly, no errors for getting.  Setting returns an
257    error. */
258 
259 /* Supported authentication types. This is read-only. */
260 unsigned int ipmi_lanconfig_get_support_auth_oem(ipmi_lan_config_t *lanc);
261 unsigned int ipmi_lanconfig_get_support_auth_straight(ipmi_lan_config_t *lanc);
262 unsigned int ipmi_lanconfig_get_support_auth_md5(ipmi_lan_config_t *lanc);
263 unsigned int ipmi_lanconfig_get_support_auth_md2(ipmi_lan_config_t *lanc);
264 unsigned int ipmi_lanconfig_get_support_auth_none(ipmi_lan_config_t *lanc);
265 
266 /* Various IP-related information. */
267 unsigned int ipmi_lanconfig_get_ip_addr_source(ipmi_lan_config_t *lanc);
268 int ipmi_lanconfig_set_ip_addr_source(ipmi_lan_config_t *lanc,
269 				      unsigned int      val);
270 
271 /* Number of allowed alert destinations.  This is read-only.  Note
272    that this is *not* the value returned from the config, it is one
273    more than the value, so it is the actual number of alert
274    destinations (including the volatile destination 0). */
275 unsigned int ipmi_lanconfig_get_num_alert_destinations(ipmi_lan_config_t *c);
276 
277 
278 /* Everything else below returns an error. */
279 int ipmi_lanconfig_get_ipv4_ttl(ipmi_lan_config_t *lanc,
280 				unsigned int      *val);
281 int ipmi_lanconfig_set_ipv4_ttl(ipmi_lan_config_t *lanc,
282 				unsigned int      val);
283 int ipmi_lanconfig_get_ipv4_flags(ipmi_lan_config_t *lanc,
284 				  unsigned int      *val);
285 int ipmi_lanconfig_set_ipv4_flags(ipmi_lan_config_t *lanc,
286 				  unsigned int      val);
287 int ipmi_lanconfig_get_ipv4_precedence(ipmi_lan_config_t *lanc,
288 				       unsigned int      *val);
289 int ipmi_lanconfig_set_ipv4_precedence(ipmi_lan_config_t *lanc,
290 				       unsigned int      val);
291 int ipmi_lanconfig_get_ipv4_tos(ipmi_lan_config_t *lanc,
292 				unsigned int      *val);
293 int ipmi_lanconfig_set_ipv4_tos(ipmi_lan_config_t *lanc,
294 				unsigned int      val);
295 
296 /* Authorization enables for the various authentication levels. */
297 int ipmi_lanconfig_get_enable_auth_oem(ipmi_lan_config_t *lanc,
298 				       unsigned int      user,
299 				       unsigned int      *val);
300 int ipmi_lanconfig_get_enable_auth_straight(ipmi_lan_config_t *lanc,
301 					    unsigned int      user,
302 					    unsigned int      *val);
303 int ipmi_lanconfig_get_enable_auth_md5(ipmi_lan_config_t *lanc,
304 				       unsigned int      user,
305 				       unsigned int      *val);
306 int ipmi_lanconfig_get_enable_auth_md2(ipmi_lan_config_t *lanc,
307 				       unsigned int      user,
308 				       unsigned int      *val);
309 int ipmi_lanconfig_get_enable_auth_none(ipmi_lan_config_t *lanc,
310 					unsigned int      user,
311 					unsigned int      *val);
312 int ipmi_lanconfig_set_enable_auth_oem(ipmi_lan_config_t *lanc,
313 				       unsigned int      user,
314 				       unsigned int      val);
315 int ipmi_lanconfig_set_enable_auth_straight(ipmi_lan_config_t *lanc,
316 					    unsigned int      user,
317 					    unsigned int      val);
318 int ipmi_lanconfig_set_enable_auth_md5(ipmi_lan_config_t *lanc,
319 				       unsigned int      user,
320 				       unsigned int      val);
321 int ipmi_lanconfig_set_enable_auth_md2(ipmi_lan_config_t *lanc,
322 				       unsigned int      user,
323 				       unsigned int      val);
324 int ipmi_lanconfig_set_enable_auth_none(ipmi_lan_config_t *lanc,
325 					unsigned int      user,
326 					unsigned int      val);
327 
328 /* Addressing for the BMC. */
329 int ipmi_lanconfig_get_ip_addr(ipmi_lan_config_t *lanc,
330 			       unsigned char     *data,
331 			       unsigned int      *data_len);
332 int ipmi_lanconfig_set_ip_addr(ipmi_lan_config_t *lanc,
333 			       unsigned char     *data,
334 			       unsigned int      data_len);
335 
336 int ipmi_lanconfig_get_mac_addr(ipmi_lan_config_t *lanc,
337 				unsigned char     *data,
338 				unsigned int      *data_len);
339 int ipmi_lanconfig_set_mac_addr(ipmi_lan_config_t *lanc,
340 				unsigned char     *data,
341 				unsigned int      data_len);
342 
343 int ipmi_lanconfig_get_subnet_mask(ipmi_lan_config_t *lanc,
344 				   unsigned char     *data,
345 				   unsigned int      *data_len);
346 int ipmi_lanconfig_set_subnet_mask(ipmi_lan_config_t *lanc,
347 				   unsigned char     *data,
348 				   unsigned int      data_len);
349 
350 int ipmi_lanconfig_get_primary_rmcp_port(ipmi_lan_config_t *lanc,
351 					 unsigned char     *data,
352 					 unsigned int      *data_len);
353 int ipmi_lanconfig_set_primary_rmcp_port(ipmi_lan_config_t *lanc,
354 					 unsigned char     *data,
355 					 unsigned int      data_len);
356 int ipmi_lanconfig_get_port_rmcp_primary(ipmi_lan_config_t *lanc,
357 					 unsigned int      *val);
358 int ipmi_lanconfig_set_port_rmcp_primary(ipmi_lan_config_t *lanc,
359 					 unsigned int      val);
360 int ipmi_lanconfig_get_secondary_rmcp_port(ipmi_lan_config_t *lanc,
361 					   unsigned char     *data,
362 					   unsigned int      *data_len);
363 int ipmi_lanconfig_set_secondary_rmcp_port(ipmi_lan_config_t *lanc,
364 					   unsigned char     *data,
365 					   unsigned int      data_len);
366 int ipmi_lanconfig_get_port_rmcp_secondary(ipmi_lan_config_t *lanc,
367 					   unsigned int      *val);
368 int ipmi_lanconfig_set_port_rmcp_secondary(ipmi_lan_config_t *lanc,
369 					   unsigned int      val);
370 
371 /* Control of ARP-ing.  These are optional and so may return errors. */
372 int ipmi_lanconfig_get_bmc_generated_arps(ipmi_lan_config_t *lanc,
373 					  unsigned int      *val);
374 int ipmi_lanconfig_set_bmc_generated_arps(ipmi_lan_config_t *lanc,
375 					  unsigned int      val);
376 int ipmi_lanconfig_get_bmc_generated_garps(ipmi_lan_config_t *lanc,
377 					   unsigned int      *val);
378 int ipmi_lanconfig_set_bmc_generated_garps(ipmi_lan_config_t *lanc,
379 					   unsigned int      val);
380 int ipmi_lanconfig_get_garp_interval(ipmi_lan_config_t *lanc,
381 				     unsigned int      *val);
382 int ipmi_lanconfig_set_garp_interval(ipmi_lan_config_t *lanc,
383 				     unsigned int      val);
384 
385 /* Gateway handling */
386 int ipmi_lanconfig_get_default_gateway_ip_addr(ipmi_lan_config_t *lanc,
387 					       unsigned char     *data,
388 					       unsigned int      *data_len);
389 int ipmi_lanconfig_set_default_gateway_ip_addr(ipmi_lan_config_t *lanc,
390 					       unsigned char     *data,
391 					       unsigned int      data_len);
392 int ipmi_lanconfig_get_default_gateway_mac_addr(ipmi_lan_config_t *lanc,
393 						unsigned char     *data,
394 						unsigned int      *data_len);
395 int ipmi_lanconfig_set_default_gateway_mac_addr(ipmi_lan_config_t *lanc,
396 						unsigned char     *data,
397 						unsigned int      data_len);
398 int ipmi_lanconfig_get_backup_gateway_ip_addr(ipmi_lan_config_t *lanc,
399 					      unsigned char     *data,
400 					      unsigned int      *data_len);
401 int ipmi_lanconfig_set_backup_gateway_ip_addr(ipmi_lan_config_t *lanc,
402 					      unsigned char     *data,
403 					      unsigned int      data_len);
404 int ipmi_lanconfig_get_backup_gateway_mac_addr(ipmi_lan_config_t *lanc,
405 					       unsigned char     *data,
406 					       unsigned int      *data_len);
407 int ipmi_lanconfig_set_backup_gateway_mac_addr(ipmi_lan_config_t *lanc,
408 					       unsigned char     *data,
409 					       unsigned int      data_len);
410 
411 /* The community string for SNMP traps sent. */
412 int ipmi_lanconfig_get_community_string(ipmi_lan_config_t *lanc,
413 					unsigned char     *data,
414 					unsigned int      *data_len);
415 int ipmi_lanconfig_set_community_string(ipmi_lan_config_t *lanc,
416 					unsigned char     *data,
417 					unsigned int      data_len);
418 
419 /* Everthing else is part of the LAN Alert destination table and is
420    addressed on a per-destination basis. */
421 int ipmi_lanconfig_get_alert_ack(ipmi_lan_config_t *lanc,
422 				 unsigned int      dest,
423 				 unsigned int      *val);
424 int ipmi_lanconfig_set_alert_ack(ipmi_lan_config_t *lanc,
425 				 unsigned int      dest,
426 				 unsigned int      val);
427 int ipmi_lanconfig_get_dest_type(ipmi_lan_config_t *lanc,
428 				 unsigned int      dest,
429 				 unsigned int      *val);
430 int ipmi_lanconfig_set_dest_type(ipmi_lan_config_t *lanc,
431 				 unsigned int      dest,
432 				 unsigned int      val);
433 int ipmi_lanconfig_get_alert_retry_interval(ipmi_lan_config_t *lanc,
434 					    unsigned int      dest,
435 					    unsigned int      *val);
436 int ipmi_lanconfig_set_alert_retry_interval(ipmi_lan_config_t *lanc,
437 					    unsigned int      dest,
438 					    unsigned int      val);
439 int ipmi_lanconfig_get_max_alert_retries(ipmi_lan_config_t *lanc,
440 					 unsigned int      dest,
441 					 unsigned int      *val);
442 int ipmi_lanconfig_set_max_alert_retries(ipmi_lan_config_t *lanc,
443 					 unsigned int      dest,
444 					 unsigned int      val);
445 int ipmi_lanconfig_get_dest_format(ipmi_lan_config_t *lanc,
446 				   unsigned int      dest,
447 				   unsigned int      *val);
448 int ipmi_lanconfig_set_dest_format(ipmi_lan_config_t *lanc,
449 				   unsigned int      dest,
450 				   unsigned int      val);
451 int ipmi_lanconfig_get_gw_to_use(ipmi_lan_config_t *lanc,
452 				 unsigned int      dest,
453 				 unsigned int      *val);
454 int ipmi_lanconfig_set_gw_to_use(ipmi_lan_config_t *lanc,
455 				 unsigned int      dest,
456 				 unsigned int      val);
457 int ipmi_lanconfig_get_dest_ip_addr(ipmi_lan_config_t *lanc,
458 				    unsigned int      dest,
459 				    unsigned char     *data,
460 				    unsigned int      *data_len);
461 int ipmi_lanconfig_set_dest_ip_addr(ipmi_lan_config_t *lanc,
462 				    unsigned int      dest,
463 				    unsigned char     *data,
464 				    unsigned int      data_len);
465 int ipmi_lanconfig_get_dest_mac_addr(ipmi_lan_config_t *lanc,
466 				     unsigned int      dest,
467 				     unsigned char     *data,
468 				     unsigned int      *data_len);
469 int ipmi_lanconfig_set_dest_mac_addr(ipmi_lan_config_t *lanc,
470 				     unsigned int      dest,
471 				     unsigned char     *data,
472 				     unsigned int      data_len);
473 int ipmi_lanconfig_get_dest_vlan_tag_type(ipmi_lan_config_t *lanc,
474 					  unsigned int      dest,
475 					  unsigned int      *val);
476 int ipmi_lanconfig_set_dest_vlan_tag_type(ipmi_lan_config_t *lanc,
477 					  unsigned int      dest,
478 					  unsigned int      val);
479 int ipmi_lanconfig_get_dest_vlan_tag(ipmi_lan_config_t *lanc,
480 				     unsigned int      dest,
481 				     unsigned int      *val);
482 int ipmi_lanconfig_set_dest_vlan_tag(ipmi_lan_config_t *lanc,
483 				     unsigned int      dest,
484 				     unsigned int      val);
485 
486 /* VLAN support */
487 int ipmi_lanconfig_get_vlan_id(ipmi_lan_config_t *lanc,
488 			       unsigned int      *val);
489 int ipmi_lanconfig_set_vlan_id(ipmi_lan_config_t *lanc,
490 			       unsigned int      val);
491 int ipmi_lanconfig_get_vlan_id_enable(ipmi_lan_config_t *lanc,
492 				      unsigned int      *val);
493 int ipmi_lanconfig_set_vlan_id_enable(ipmi_lan_config_t *lanc,
494 				      unsigned int      val);
495 int ipmi_lanconfig_get_vlan_priority(ipmi_lan_config_t *lanc,
496 				     unsigned int      *val);
497 int ipmi_lanconfig_set_vlan_priority(ipmi_lan_config_t *lanc,
498 				     unsigned int      val);
499 
500 /* Cipher Suites */
501 unsigned int ipmi_lanconfig_get_num_cipher_suites(ipmi_lan_config_t *lanc);
502 
503 int ipmi_lanconfig_get_cipher_suite_entry(ipmi_lan_config_t *lanc,
504 					  unsigned int      entry,
505 					  unsigned int      *val);
506 int ipmi_lanconfig_set_cipher_suite_entry(ipmi_lan_config_t *lanc,
507 					  unsigned int      entry,
508 					  unsigned int      val);
509 int ipmi_lanconfig_get_max_priv_for_cipher_suite(ipmi_lan_config_t *lanc,
510 						 unsigned int      entry,
511 						 unsigned int      *val);
512 int ipmi_lanconfig_set_max_priv_for_cipher_suite(ipmi_lan_config_t *lanc,
513 						 unsigned int      entry,
514 						 unsigned int      val);
515 
516 #ifdef __cplusplus
517 }
518 #endif
519 
520 #endif /* OPENIPMI_LANPARM_H */
521