/[dynamips]/trunk/cisco_eeprom.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/cisco_eeprom.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.6-RC1/cisco_eeprom.h revision 2 by dpavlin, Sat Oct 6 16:03:58 2007 UTC trunk/cisco_eeprom.h revision 12 by dpavlin, Sat Oct 6 16:45:40 2007 UTC
# Line 1  Line 1 
1  /*    /*  
2   * Cisco C7200 (Predator) simulation platform.   * Cisco router simulation platform.
3   * Copyright (c) 2006 Christophe Fillot.  All rights reserved.   * Copyright (c) 2006 Christophe Fillot.  All rights reserved.
4   *   *
5   * Cisco EEPROM manipulation functions.   * Cisco EEPROM manipulation functions.
# Line 10  Line 10 
10    
11  #include "utils.h"  #include "utils.h"
12    
13    /* Cisco EEPROM */
14    struct cisco_eeprom {
15       char *name;
16       m_uint16_t *data;
17       size_t len;
18    };
19    
20    /* Find a NM EEPROM */
21    const struct cisco_eeprom *cisco_eeprom_find_nm(char *name);
22    
23    /* Find a PA EEPROM */
24    const struct cisco_eeprom *cisco_eeprom_find_pa(char *name);
25    
26    /* Find a WIC EEPROM */
27    const struct cisco_eeprom *cisco_eeprom_find_wic(char *name);
28    
29    /* Find a C6k EEPROM */
30    const struct cisco_eeprom *cisco_eeprom_find_c6k(char *name);
31    
32    /* Find an EEPROM in the specified EEPROM array */
33    const struct cisco_eeprom *
34    cisco_eeprom_find(const struct cisco_eeprom *eeproms,char *name);
35    
36    /* Copy an EEPROM */
37    int cisco_eeprom_copy(struct cisco_eeprom *dst,const struct cisco_eeprom *src);
38    
39    /* Free resources used by an EEPROM */
40    void cisco_eeprom_free(struct cisco_eeprom *eeprom);
41    
42    /* Return TRUE if the specified EEPROM contains usable data */
43    int cisco_eeprom_valid(struct cisco_eeprom *eeprom);
44    
45  /* Get a byte from an EEPROM */  /* Get a byte from an EEPROM */
46  int cisco_eeprom_get_byte(m_uint16_t *eeprom,size_t eeprom_len,  int cisco_eeprom_get_byte(struct cisco_eeprom *eeprom,
47                            size_t offset,m_uint8_t *val);                            size_t offset,m_uint8_t *val);
48    
49  /* Set a byte to an EEPROM */  /* Set a byte to an EEPROM */
50  int cisco_eeprom_set_byte(m_uint16_t *eeprom,size_t eeprom_len,  int cisco_eeprom_set_byte(struct cisco_eeprom *eeprom,
51                            size_t offset,m_uint8_t val);                            size_t offset,m_uint8_t val);
52    
53  /* Get an EEPROM region */  /* Get an EEPROM region */
54  int cisco_eeprom_get_region(m_uint16_t *eeprom,size_t eeprom_len,  int cisco_eeprom_get_region(struct cisco_eeprom *eeprom,size_t offset,
55                              size_t offset,m_uint8_t *data,size_t data_len);                              m_uint8_t *data,size_t data_len);
56    
57  /* Set an EEPROM region */  /* Set an EEPROM region */
58  int cisco_eeprom_set_region(m_uint16_t *eeprom,size_t eeprom_len,  int cisco_eeprom_set_region(struct cisco_eeprom *eeprom,size_t offset,
59                              size_t offset,m_uint8_t *data,size_t data_len);                              m_uint8_t *data,size_t data_len);
60    
61    /* Get a field of a Cisco EEPROM v4 */
62    int cisco_eeprom_v4_get_field(struct cisco_eeprom *eeprom,m_uint8_t *type,
63                                  m_uint8_t *len,size_t *offset);
64    
65  /* Dump a Cisco EEPROM with format version 4 */  /* Dump a Cisco EEPROM with format version 4 */
66  void cisco_eeprom_v4_dump(m_uint16_t *eeprom,size_t eeprom_len);  void cisco_eeprom_v4_dump(struct cisco_eeprom *eeprom);
67    
68  /* Returns the offset of the specified field */  /* Returns the offset of the specified field */
69  int cisco_eeprom_v4_find_field(m_uint16_t *eeprom,size_t eeprom_len,  int cisco_eeprom_v4_find_field(struct cisco_eeprom *eeprom,
70                                 m_uint8_t field_type,size_t *field_offset);                                 m_uint8_t field_type,
71                                   size_t *field_offset);
72    
73  #endif  #endif
74    

Legend:
Removed from v.2  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.26