4 * All client applications which want to use NgAdmin must include this file.
14 #include <arpa/inet.h>
16 #include <netinet/ether.h>
21 * Maximum size of product string.
23 #define PRODUCT_SIZE 64
26 * Maximum size of name string.
31 * Maximum size of firmware version string.
33 #define FIRMWARE_SIZE 64
39 * This enum lists all the error codes the library can return to user.
42 ERR_OK = 0, /**< no error */
43 ERR_NET = -1, /**< network error */
44 ERR_NOTLOG = -2, /**< not logged */
45 ERR_DENIED = -3, /**< access denied */
46 ERR_BADPASS = -4, /**< bad password */
47 ERR_BADID = -5, /**< bad switch id */
48 ERR_INVARG = -6, /**< invalid argument */
49 ERR_TIMEOUT = -7, /**< timeout */
50 ERR_MEM = -8, /**< out of memory */
51 ERR_NOTIMPL = -9, /**< not implemented */
52 ERR_BADREPLY = -10, /**< bad reply */
53 ERR_INVOP = -11, /**< invalid operation */
54 ERR_UNKNOWN = -12 /**< unknown error */
61 * This enum lists all the speeds a port can have.
64 SPEED_UNK = -1, /**< unknown status */
65 SPEED_DOWN = 0, /**< link down */
66 SPEED_10_HD = 1, /**< 10 Mb/s half duplex */
67 SPEED_10_FD = 2, /**< 10 Mb/s full duplex */
68 SPEED_100_HD = 3, /**< 100 Mb/s half duplex */
69 SPEED_100_FD = 4, /**< 100 Mb/s full duplex */
70 SPEED_1000_FD = 5 /**< 1000 Mb/s full duplex */
77 * This enum lists all the VLAN types available
80 VLAN_DISABLED = 0, /**< VLAN disabled */
81 VLAN_PORT_BASIC = 1, /**< port basic */
82 VLAN_PORT_ADV = 2, /**< port advanced */
83 VLAN_DOT_BASIC = 3, /**< 802.1q basic */
84 VLAN_DOT_ADV = 4 /**< 802.1q advanced */
89 * VLAN port specification.
90 * This enum lists all the VLAN specifications a port can have.
93 VLAN_UNSPEC = 0xFF, /**< unspecified */
94 VLAN_NO = 0, /**< not present */
95 VLAN_UNTAGGED = 1, /**< present, untagged */
96 VLAN_TAGGED = 2 /**< present, tagged */
107 * Maximum 802.1q VLAN id.
109 #define VLAN_DOT_MAX 4093
112 * Maximum port VLAN id.
114 #define VLAN_PORT_MAX 9
119 * This enum lists all the availables QoS modes.
122 QOS_PORT = 1, /**< port based */
123 QOS_DOT = 2 /**< 802.1p based */
129 * This enum lists all the priorities a port can have.
132 PRIO_UNSPEC = -1, /**< unspecified */
133 PRIO_HIGH = 1, /**< high */
134 PRIO_MED = 2, /**< medium */
135 PRIO_NORM = 3, /**< normal */
136 PRIO_LOW = 4 /**< low */
144 * This enum lists all the available bitrates.
147 BITRATE_UNSPEC = -1, /**< unspecified */
148 BITRATE_NOLIMIT = 0, /**< unlimited */
149 BITRATE_512K = 1, /**< 512 Kb/s */
150 BITRATE_1M = 2, /**< 1 Mb/s */
151 BITRATE_2M = 3, /**< 2 Mb/s */
152 BITRATE_4M = 4, /**< 4 Mb/s */
153 BITRATE_8M = 5, /**< 8 Mb/s */
154 BITRATE_16M = 6, /**< 16 Mb/s */
155 BITRATE_32M = 7, /**< 32 Mb/s */
156 BITRATE_64M = 8, /**< 64 Mb/s */
157 BITRATE_128M = 9, /**< 128 Mb/s */
158 BITRATE_256M = 10, /**< 256 Mb/s */
159 BITRATE_512M = 11 /**< 512 Mb/s */
166 * NgAdmin library main structure.
167 * The structure content is hidden to clients to prevent them to manually
168 * change data and mess up things.
175 * Network configuration.
176 * Represents the network configuration of a switch.
179 struct in_addr ip; /**< IP */
180 struct in_addr netmask; /**< netmask */
181 struct in_addr gw; /**< gateway IP */
182 bool dhcp; /**< DHCP enabled */
187 * Switch characteristics.
188 * Represents the main characteristics of a switch.
191 char product[PRODUCT_SIZE]; /**< product name (eg.\ GS108EV1) */
192 char name[NAME_SIZE]; /**< custom name */
193 char firmware[FIRMWARE_SIZE]; /**< firmware version string */
194 unsigned char ports; /**< number of ports */
195 struct ether_addr mac; /**< MAC address */
196 struct net_conf nc; /**< network configuration */
202 * Represents statistics of a particular port.
205 unsigned long long recv; /**< packets received */
206 unsigned long long sent; /**< packets sent */
207 unsigned long long crc; /**< CRC errors */
212 * IGMP snooping configuration.
213 * Represents the IGMP snooping configuration of a switch.
216 bool enable; /**< IGMP snooping enabled */
217 unsigned short vlan; /**< VLAN on which IGMP snooping is done */
218 bool validate; /**< validate IGMPv3 headers */
219 bool block; /**< block unknown multicast addresses */
227 char port; /**< port */
228 int v1; /**< raw value 1 */
229 int v2; /**< raw value 2 */
240 * Initialize NgAdmin library.
241 * This function initializes the NgAdmin library. You must call it before any
243 * @param iface The network interface to use.
244 * @return A pointer to a ngadmin structure, or NULL if an error occurred.
246 struct ngadmin* ngadmin_init (const char *iface);
250 * Convert error to string.
251 * This function returns a string corresponding to the numerical error code.
252 * @param error The numerical error code to convert.
253 * @return A pointer to a static string or NULL if the error code is invalid.
255 const char* ngadmin_errorStr (int error);
259 * Close NgAdmin library.
260 * This function frees the resources used by the library. You really should
261 * call this when you are done using the library.
262 * @param nga A pointer to the ngadmin structure.
263 * @return ERR_OK when everything is well or an error code otherwise.
265 int ngadmin_close (struct ngadmin *nga);
269 * Force the use of the interface.
270 * This function allows to solve two problems:
271 * - When you have multiple network interfaces, sending to the global broadcast
272 * address may not send the packet on the interface you want. \n
273 * This function forces the packet to go on the interface you specified at
274 * the library initialization.
275 * - When the switch is not in your network range, because DHCP is disabled or
276 * you started the DHCP server after the switch. \n
277 * This function allows you to ignore the routing table and consider every
278 * address is directly reachable on the interface. \n
279 * An alternative is to use ngadmin_setKeepBroadcasting, or simply add a route.
281 * @warning Requires root priviledges.
282 * @see ngadmin_setKeepBroadcasting()
283 * @param nga A pointer to the ngadmin structure.
284 * @return ERR_OK when everything is well or an error code otherwise.
286 int ngadmin_forceInterface (struct ngadmin *nga);
290 * Keep broadcasting even when talking with a particular switch.
291 * By default, once you login on a switch, NgAdmin talks with it using unicast.
292 * This prevents the password from being sent to all your network. \n
293 * The switch still replies using broadcast, but the password is not included
295 * This function allows you to disable this feature and do like the official
296 * Windows application that always use broadcast packets. \n
297 * This also allows to configure a switch which is not on your network range
298 * without forcing the interface. \n
299 * When you enable this option, you must be aware that on every parameter
300 * change you make on the switch, your password is broadcasted in cleartext
301 * to all your network.
302 * @see ngadmin_forceInterface()
303 * @param nga A pointer to the ngadmin structure.
304 * @param value Enable or disable the systematic use of broadcast packets.
305 * @return ERR_OK when everything is well or an error code otherwise.
307 int ngadmin_setKeepBroadcasting (struct ngadmin *nga, bool value);
311 * Use global broadcast address.
312 * By default, NgAdmin uses the interface broadcast address.
313 * This option forces the lib to use the global broadcast address
314 * (255.255.255.255) instead.
315 * @warning If you have multiple interfaces, enabling this may cause problems.
316 * @see ngadmin_forceInterface()
317 * @param nga A pointer to the ngadmin structure.
318 * @param value Enable or disable the use of the global broadcast address.
319 * @return ERR_OK when everything is well or an error code otherwise.
321 int ngadmin_useGlobalBroadcast (struct ngadmin *nga, bool value);
325 * Specify the password to use to login.
326 * Sets the password to use to login on switches.
327 * @param nga A pointer to the ngadmin structure.
328 * @param pass The password string to use.
329 * @return ERR_OK when everything is well or an error code otherwise.
331 int ngadmin_setPassword (struct ngadmin *nga, const char *pass);
335 * Set timeout for networking.
336 * Sets the timeout when waiting for network packets.
337 * @param nga A pointer to the ngadmin structure.
338 * @param tv A pointer to a timeval structure.
339 * @return ERR_OK when everything is well or an error code otherwise.
341 int ngadmin_setTimeout (struct ngadmin *nga, const struct timeval *tv);
345 * Scan the network for switches.
346 * This function scans the network for Netgear switches that use NSDP.
347 * @warning Systematically blocks for the timeout value.
348 * @note If you are logged on a switch, calling this function will delog you.
349 * @param nga A pointer to the ngadmin structure.
350 * @return ERR_OK when everything is well or an error code otherwise.
352 int ngadmin_scan (struct ngadmin *nga);
356 * Get the list of detected switches.
357 * This function allows you gou get the list of all last detected switchs.
358 * @note When a scan is done, this array is no more valid.
359 * @param nga A pointer to the ngadmin structure.
360 * @param nb A pointer to an integer which will receive the number of switches.
361 * @return A pointer to an array of switch characteristics.
363 const struct swi_attr* ngadmin_getSwitchTab (struct ngadmin *nga, int *nb);
367 * Get the switch on which you are logged.
368 * This function allows you to get the switch on which you are logged.
369 * @param nga A pointer to the ngadmin structure.
370 * @return A pointer the switch characteristics or NULL if you are not logged.
372 const struct swi_attr* ngadmin_getCurrentSwitch (struct ngadmin *nga);
377 * Upgrade the switch firmware.
378 * This function allows you to upgrade the switch firmware.
379 * @warning Currently not implemented.
380 * @note You must be logged on a switch.
381 * @param nga A pointer to the ngadmin structure.
382 * @param filename A path to the file of the new firmware to send.
383 * @return ERR_NOTIMPL
385 int ngadmin_upgradeFirmware (struct ngadmin *nga, const char *filename);
390 * This function permits to login on a switch.
391 * @note If you are already logged, this function delogs you whatever the new
392 * login attempt is successfull or not.
393 * @see ngadmin_setPassword()
394 * @param nga A pointer to the ngadmin structure.
395 * @param id The id (position in the switch array) of the switch you want to login to.
396 * @return ERR_OK when everything is well or an error code otherwise.
398 int ngadmin_login (struct ngadmin *nga, int id);
402 * Get the ports speed status.
403 * This functions retrieves the ports speed status.
404 * @note You must be logged on a switch.
405 * @param nga A pointer to the ngadmin structure.
406 * @param ports A pointer to an array of ports which will receive ports status.
407 * Must not be NULL. The array size must be ports_count*sizeof(unsigned char).
408 * @return ERR_OK when everything is well or an error code otherwise.
410 int ngadmin_getPortsStatus (struct ngadmin *nga, unsigned char *ports);
414 * Change the name of a switch.
415 * This changes the name of a switch.
416 * @note You must be logged on a switch.
417 * @param nga A pointer to the ngadmin structure.
418 * @param name The name string to use. A NULL value clears the name.
419 * @return ERR_OK when everything is well or an error code otherwise.
421 int ngadmin_setName (struct ngadmin *nga, const char *name);
425 * Get the ports statistics.
426 * Retrieves the ports packet statistics.
427 * @note You must be logged on a switch.
428 * @param nga A pointer to the ngadmin structure.
429 * @param ps A pointer to an array of port_stats structures. Must not be NULL.
430 * The array size must be ports_count*sizeof(struct port_stats).
431 * @return ERR_OK when everything is well or an error code otherwise.
433 int ngadmin_getPortsStatistics (struct ngadmin *nga, struct port_stats *ps);
437 * Reset the ports statistics.
438 * This resets the ports packet statistics.
439 * @note You must be logged on a switch.
440 * @param nga A pointer to the ngadmin structure.
441 * @return ERR_OK when everything is well or an error code otherwise.
443 int ngadmin_resetPortsStatistics (struct ngadmin *nga);
447 * Change the password of a switch.
448 * This changes the password of a switch. On success, automatically updates
449 * local password so you do not have to relog.
450 * @note You must be logged on a switch.
451 * @param nga A pointer to the ngadmin structure.
452 * @param pass The new password string to use.
453 * @return ERR_OK when everything is well or an error code otherwise.
455 int ngadmin_changePassword (struct ngadmin *nga, const char* pass);
459 * Get the broadcast storm filtering state.
460 * Retrieves the broadcast storm filtering state.
461 * @note You must be logged on a switch.
462 * @param nga A pointer to the ngadmin structure.
463 * @param s A pointer to an integer which will receive 0 or 1.
464 * @return ERR_OK when everything is well or an error code otherwise.
466 int ngadmin_getStormFilterState (struct ngadmin *nga, int *s);
470 * Set the broadcast storm filtering state.
471 * Changes the broadcast storm filtering state.
472 * @note You must be logged on a switch.
473 * @param nga A pointer to the ngadmin structure.
474 * @param s An integer with value 0 or 1.
475 * @return ERR_OK when everything is well or an error code otherwise.
477 int ngadmin_setStormFilterState (struct ngadmin *nga, int s);
481 * Get the broadcast storm bitrates.
482 * Retrieves the broadcast storm filtering bitrates.
483 * @note You must be logged on a switch.
484 * @param nga A pointer to the ngadmin structure.
485 * @param ports A pointer to an array of integers. Must not be NULL.
486 * The array size must be ports_count*sizeof(int).
487 * @return ERR_OK when everything is well or an error code otherwise.
489 int ngadmin_getStormFilterValues (struct ngadmin *nga, int *ports);
493 * Set the broadcast storm bitrates.
494 * Changes the broadcast storm filtering values.
495 * @note You must be logged on a switch.
496 * @param nga A pointer to the ngadmin structure.
497 * @param ports A pointer to an array of integers. Must not be NULL.
498 * The array size must be ports_count*sizeof(int).
499 * @return ERR_OK when everything is well or an error code otherwise.
501 int ngadmin_setStormFilterValues (struct ngadmin *nga, const int *ports);
505 * Get the bitrates limits.
506 * Retrieves the bitrates limits of each port.
507 * @note You must be logged on a switch.
508 * @param nga A pointer to the ngadmin structure.
509 * @param ports A pointer to an array of integers. Must not be NULL.
510 * The array size must be ports_count*sizeof(int).
511 * @return ERR_OK when everything is well or an error code otherwise.
513 int ngadmin_getBitrateLimits (struct ngadmin *nga, int *ports);
517 * Set the bitrates limits.
518 * Changes the bitrates limits of each port.
519 * @note You must be logged on a switch.
520 * @param nga A pointer to the ngadmin structure.
521 * @param ports A pointer to an array of integers. Must not be NULL.
522 * The array size must be ports_count*sizeof(int).
523 * @return ERR_OK when everything is well or an error code otherwise.
525 int ngadmin_setBitrateLimits (struct ngadmin *nga, const int *ports);
530 * Retrieves the QoS mode.
531 * @note You must be logged on a switch.
532 * @param nga A pointer to the ngadmin structure.
533 * @param s A pointer to an integer. Must not be NULL.
534 * @return ERR_OK when everything is well or an error code otherwise.
536 int ngadmin_getQOSMode (struct ngadmin *nga, int *s);
541 * Changes the QoS mode.
542 * @note You must be logged on a switch.
543 * @param nga A pointer to the ngadmin structure.
544 * @param s An integer with the new mode.
545 * @return ERR_OK when everything is well or an error code otherwise.
547 int ngadmin_setQOSMode (struct ngadmin *nga, int s);
551 * Get the QoS values.
552 * Retrieves the QoS priority values for all the ports.
553 * @note You must be logged on a switch.
554 * @note The switch QoS mode should be port based to use this function.
555 * @param nga A pointer to the ngadmin structure.
556 * @param ports A pointer to an array of chars. Must not be NULL.
557 The array size must be ports_count*sizeof(ports).
558 * @return ERR_OK when everything is well or an error code otherwise.
560 int ngadmin_getQOSValues (struct ngadmin *nga, char *ports);
564 * Set the QoS values.
565 * Changes the QoS priority values for all the ports.
566 * @note You must be logged on a switch.
567 * @note The switch QoS mode should be port based to use this function.
568 * @param nga A pointer to the ngadmin structure.
569 * @param ports A pointer to an array of chars. Must not be NULL.
570 The array size must be ports_count*sizeof(ports).
571 * @return ERR_OK when everything is well or an error code otherwise.
573 int ngadmin_setQOSValues (struct ngadmin *nga, const char *ports);
577 * Restart the switch.
578 * Restarts the switch.
579 * @note You must be logged on a switch.
580 * @note If successfull, you should wait a few seconds while the switch
581 effectively restarts.
582 * @param nga A pointer to the ngadmin structure.
583 * @return ERR_OK when everything is well or an error code otherwise.
585 int ngadmin_restart (struct ngadmin *nga);
589 * Restore the switch default parameters.
590 * Restores the switch default parameters and restarts it.
591 * @note You must be logged on a switch.
592 * @note If successfull, you will be delogged and the switch list will be
593 cleared. You should wait a few seconds while the switch effectively restarts.
594 * @param nga A pointer to the ngadmin structure.
595 * @return ERR_OK when everything is well or an error code otherwise.
597 int ngadmin_defaults (struct ngadmin *nga);
601 * Get the port mirroring values.
602 * Retrieves the port mirrorring values.
603 * @note The switch QoS mode should be port based to use this function.
604 * @note You must be logged on a switch.
605 * @param nga A pointer to the ngadmin structure.
606 * @param ports A pointer to an array of chars. Must not be NULL. \n
607 The first element of the array is the output port (or 0 if port
608 mirroring is disabled), followed by 0 or 1 values for each port
609 if it is present or not. \n
610 The array size must be (1+ports_count)*sizeof(char).
611 * @return ERR_OK when everything is well or an error code otherwise.
613 int ngadmin_getMirror (struct ngadmin *nga, char *ports);
617 * Set the port mirroring values.
618 * Changes the port mirroring values.
619 * @note The switch QoS mode should be port based to use this function.
620 * @param nga A pointer to the ngadmin structure.
621 * @param ports A pointer to an array of chars. It as the same format as in
622 ngadmin_getMirror. \n
623 If it is NULL, port mirroring is disabled.
624 * @return ERR_OK when everything is well or an error code otherwise.
626 int ngadmin_setMirror (struct ngadmin *nga, const char *ports);
630 * Get the IGMP configuration.
631 * Retrieves the IGMP & multicast configuration.
632 * @note You must be logged on a switch.
633 * @param nga A pointer to the ngadmin structure.
634 * @param ic A pointer to an igmp_conf structure. Must not be NULL.
635 * @return ERR_OK when everything is well or an error code otherwise.
637 int ngadmin_getIGMPConf (struct ngadmin *nga, struct igmp_conf *ic);
641 * Set the IGMP configuration.
642 * Changes the IGMP configuration.
643 * @note You must be logged on a switch.
644 * @param nga A pointer to the ngadmin structure.
645 * @param ic A pointer to an igmp_conf structure. Must not be NULL.
646 * @return ERR_OK when everything is well or an error code otherwise.
648 int ngadmin_setIGMPConf (struct ngadmin *nga, const struct igmp_conf *ic);
652 * Perform a cable test.
653 * Performs a cable test on one ore more ports.
654 * @note Results are still raw values.
655 * @note This function takes a very long time.
656 * @note You must be logged on a switch.
657 * @param nga A pointer to the ngadmin structure.
658 * @param ct A pointer to an array of cabletest structures. Must not be NULL.
659 * @param nb The number of elements in the array.
660 * @return ERR_OK when everything is well or an error code otherwise.
662 int ngadmin_cabletest (struct ngadmin *nga, struct cabletest *ct, int nb);
666 * Set the network configuration.
667 * Changes the network configuration.
668 * @note You must be logged on a switch.
669 * @param nga A pointer to the ngadmin structure.
670 * @param nc A pointer to a net_conf structure. Must not be NULL. \n
671 Only non-zero fields of the structure are taken into account.
672 * @return ERR_OK when everything is well or an error code otherwise.
674 int ngadmin_setNetConf (struct ngadmin *nga, const struct net_conf *nc);
679 * Retrieves the VLAN type.
680 * @note You must be logged on a switch.
681 * @param nga A pointer to the ngadmin structure.
682 * @param t A pointer to an integer which will receive the VLAN type. Must not be NULL.
683 * @return ERR_OK when everything is well or an error code otherwise.
685 int ngadmin_getVLANType (struct ngadmin *nga, int *t);
690 * Changes the VLAN type.
691 * @note You must be logged on a switch.
692 * @param nga A pointer to the ngadmin structure.
693 * @param t An integer which contains the new VLAN type.
694 * @return ERR_OK when everything is well or an error code otherwise.
696 int ngadmin_setVLANType (struct ngadmin *nga, int t);
700 * Get the ports VLANs in port mode.
701 * Retrieves the associated VLAN of ports in port mode.
702 * @note The switch should be in port mode.
703 * @note You must be logged on a switch.
704 * @param nga A pointer to the ngadmin structure.
705 * @param ports A pointer to an array of integers which will receive the
706 number of associated VLAN. Must not be NULL.
707 * @return ERR_OK when everything is well or an error code otherwise.
709 int ngadmin_getVLANPortConf (struct ngadmin *nga, unsigned char *ports);
713 * Set the ports VLAN in port mode.
714 * Changes the associated VLAN of ports in port mode.
715 * @note The switch should be in port mode.
716 * @note You must be logged on a switch.
717 * @param nga A pointer to the ngadmin structure.
718 * @param ports A pointer to an array of integers which contain the
719 number of associated VLAN. Must not be NULL.
720 * @return ERR_OK when everything is well or an error code otherwise.
722 int ngadmin_setVLANPortConf (struct ngadmin *nga, const unsigned char *ports);
726 * Get all the 802.1q VLAN configuration.
727 * Retrieves all the VLAN configuration in 802.1q mode.
728 * @note The switch should be in 802.1q mode.
729 * @note You must be logged on a switch.
730 * @param nga A pointer to the ngadmin structure.
731 * @param vlans A pointer to an array of unsigned shorts which will receive
732 * VLAN ids. Must not be NULL. \n
733 * The array size must be sizeof(unsigned short)*(*nb).
734 * @param ports A pointer to an array of unsigned chars which will receive the
735 802.1q configuration for each VLAN. Must not be NULL. \n
736 The array size must be sizeof(unsigned char)*ports_count*(*nb).
737 * @param nb A pointer to an integer which contains the maximum number of
738 elements allowed in the array. Must not be NULL. \n
739 It will receive the actual number of VLAN written in the arrays.
740 * @return ERR_OK when everything is well or an error code otherwise.
742 int ngadmin_getVLANDotAllConf (struct ngadmin *nga, unsigned short *vlans, unsigned char *ports, int *nb);
746 * Get the configuration of a VLAN in 802.1q mode.
747 * Retrieves the configuration of a particular VLAN in 802.1q mode.
748 * @note The switch should be in 802.1q mode.
749 * @note You must be logged on a switch.
750 * @param nga A pointer to the ngadmin structure.
751 * @param vlan The VLAN you want to get the configuration.
752 * @param ports A pointer to an array of integers which will receive the
753 configuration. Must not be NULL.
754 * @return ERR_OK when everything is well or an error code otherwise.
756 int ngadmin_getVLANDotConf (struct ngadmin *nga, unsigned short vlan, unsigned char *ports);
760 * Set the configuration if a VLAN in 802.1q mode.
761 * Changes the configuration of a particular VLAN in 802.1q mode.
762 * @note The switch should be in 802.1q mode.
763 * @note You must be logged on a switch.
764 * @param nga A pointer to the ngadmin structure.
765 * @param vlan The VLAN you want to change the configuration.
766 * @param ports A pointer to an array of integers which contain the
767 configuration. Must not be NULL.
768 * @return ERR_OK when everything is well or an error code otherwise.
770 int ngadmin_setVLANDotConf (struct ngadmin *nga, unsigned short vlan, const unsigned char *ports);
774 * Destroy a VLAN in 802.1q mode.
775 * Destroys a particular VLAN in 802.1q mode.
776 * @note The switch should be in 802.1q mode.
777 * @note You must be logged on a switch.
778 * @param nga A pointer to the ngadmin structure.
779 * @param vlan The VLAN you want to destroy.
780 * @return ERR_OK when everything is well or an error code otherwise.
782 int ngadmin_VLANDestroy (struct ngadmin *nga, unsigned short vlan);
786 * Get the PVID values.
787 * Retrieves the PVID values of all the ports.
788 * @note You must be logged on a switch.
789 * @param nga A pointer to the ngadmin structure.
790 * @param ports A pointer to an array of unsigned shorts which will receive the
791 * PVID values. Must not be NULL. \n
792 * The array size must be sizeof(unsigned short)*ports_count.
793 * @return ERR_OK when everything is well or an error code otherwise.
795 int ngadmin_getAllPVID (struct ngadmin *nga, unsigned short *ports);
799 * Set the PVID of one port.
800 * Changes the PVID of one port.
801 * @note You must be logged on a switch.
802 * @param nga A pointer to the ngadmin structure.
803 * @param port The port you want to change PVID.
804 * @param vlan The new PVID value.
805 * @return ERR_OK when everything is well or an error code otherwise.
807 int ngadmin_setPVID (struct ngadmin *nga, unsigned char port, unsigned short vlan);