netswitch.h 498 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef __NETSWITCH_Hx__
  2. #define __NETSWITCH_Hx__
  3. #include <stdint.h>
  4. #include "common.h"
  5. enum {
  6. EVT_NONE=0,
  7. EVT_CAB_IN,
  8. EVT_CAB_OUT,
  9. EVT_IP_CHG,
  10. EVT_MAC_CHG,
  11. };
  12. typedef struct {
  13. uint8_t cab; //cable
  14. uint8_t dev; //device connect to the port
  15. }netswitch_evt_t;
  16. typedef struct {
  17. netswitch_evt_t evt[SW_PORT_MAX];
  18. }netswitch_evts_t;
  19. int netswitch_init(void);
  20. int netswitch_deinit(void);
  21. int netswitch_get(netswitch_info_t *info);
  22. #endif