4 * All client applications which want to use NgAdmin must include this file.
14 #include <arpa/inet.h>
16 #include <netinet/ether.h>
20 #define EXPORT __attribute__((visibility("default")))
28 * Maximum size of product string.
30 #define PRODUCT_SIZE 64
33 * Maximum size of name string.
38 * Maximum size of firmware version string.
40 #define FIRMWARE_SIZE 64
46 * This enum lists all the error codes the library can return to user.
49 ERR_OK = 0, /**< no error */
50 ERR_NET = -1, /**< network error */
51 ERR_NOTLOG = -2, /**< not logged */
52 ERR_DENIED = -3, /**< access denied */
53 ERR_BADPASS = -4, /**< bad password */
54 ERR_BADID = -5, /**< bad switch id */
55 ERR_INVARG = -6, /**< invalid argument */
56 ERR_TIMEOUT = -7, /**< timeout */
57 ERR_MEM = -8, /**< out of memory */
58 ERR_NOTIMPL = -9 /**< not implemented */
65 * This enum lists all the speeds a port can have.
68 SPEED_UNK = -1, /**< unknown status */
69 SPEED_DOWN = 0, /**< link down */
70 SPEED_10 = 1, /**< 10 Mb/s */
71 SPEED_100 = 4, /**< 100 Mb/s */
72 SPEED_1000 = 5 /**< 1000 Mb/s */
79 * This enum lists all the VLAN types available
82 VLAN_DISABLED = 0, /**< VLAN disabled */
83 VLAN_PORT_BASIC = 1, /**< port basic */
84 VLAN_PORT_ADV = 2, /**< port advanced */
85 VLAN_DOT_BASIC = 3, /**< 802.1q basic */
86 VLAN_DOT_ADV = 4 /**< 802.1q advanced */
91 * VLAN port specification.
92 * This enum lists all the VLAN specifications a port can have.
95 VLAN_UNSPEC = 0xFF, /**< unspecified */
96 VLAN_NO = 0, /**< not present */
97 VLAN_UNTAGGED = 1, /**< present, untagged */
98 VLAN_TAGGED = 2 /**< present, tagged */
109 * Maximum 802.1q VLAN id.
111 #define VLAN_DOT_MAX 4093
114 * Maximum port VLAN id.
116 #define VLAN_PORT_MAX 9
121 * This enum lists all the availables QoS modes.
124 QOS_PORT = 1, /**< port based */
125 QOS_DOT = 2 /**< 802.1p based */
131 * This enum lists all the priorities a port can have.
134 PRIO_UNSPEC = -1, /**< unspecified */
135 PRIO_HIGH = 1, /**< high */
136 PRIO_MED = 2, /**< medium */
137 PRIO_NORM = 3, /**< normal */
138 PRIO_LOW = 4 /**< low */
146 * This enum lists all the available bitrates.
149 BITRATE_UNSPEC = -1, /**< unspecified */
150 BITRATE_NOLIMIT = 0, /**< unlimited */
151 BITRATE_512K = 1, /**< 512 Kb/s */
152 BITRATE_1M = 2, /**< 1 Mb/s */
153 BITRATE_2M = 3, /**< 2 Mb/s */
154 BITRATE_4M = 4, /**< 4 Mb/s */
155 BITRATE_8M = 5, /**< 8 Mb/s */
156 BITRATE_16M = 6, /**< 16 Mb/s */
157 BITRATE_32M = 7, /**< 32 Mb/s */
158 BITRATE_64M = 8, /**< 64 Mb/s */
159 BITRATE_128M = 9, /**< 128 Mb/s */
160 BITRATE_256M = 10, /**< 256 Mb/s */
161 BITRATE_512M = 11 /**< 512 Mb/s */
168 * NgAdmin library main structure.
169 * The structure content is hidden to clients to prevent them to manually
170 * change data and mess up things.
177 * Network configuration.
178 * Represents the network configuration of a switch.
181 struct in_addr ip; /**< IP */
182 struct in_addr netmask; /**< netmask */
183 struct in_addr gw; /**< gateway IP */
184 bool dhcp; /**< DHCP enabled */
189 * Switch characteristics.
190 * Represents the main characteristics of a switch.
193 char product[PRODUCT_SIZE]; /**< product name (eg.\ GS108EV1) */
194 char name[NAME_SIZE]; /**< custom name */
195 char firmware[FIRMWARE_SIZE]; /**< firmware version string */
196 unsigned char ports; /**< number of ports */
197 struct ether_addr mac; /**< MAC address */
198 struct net_conf nc; /**< network configuration */
204 * Represents statistics of a particular port.
207 unsigned long long recv; /**< packets received */
208 unsigned long long sent; /**< packets sent */
209 unsigned long long crc; /**< CRC errors */
214 * IGMP snooping configuration.
215 * Represents the IGMP snooping configuration of a switch.
218 bool enable; /**< IGMP snooping enabled */
219 unsigned short vlan; /**< VLAN on which IGMP snooping is done */
220 bool validate; /**< validate IGMPv3 headers */
221 bool block; /**< block unknown multicast addresses */
229 char port; /**< port */
230 int v1; /**< raw value 1 */
231 int v2; /**< raw value 2 */
242 * Initialize NgAdmin library.
243 * This function initializes the NgAdmin library. You must call it before any
245 * @param iface The network interface to use.
246 * @return A pointer to a ngadmin structure, or NULL if an error occurred.
248 struct ngadmin* ngadmin_init (const char *iface) EXPORT;
252 * Close NgAdmin library.
253 * This function frees the resources used by the library. You really should
254 * call this when you are done using the library.
255 * @param nga A pointer to the ngadmin structure.
256 * @return ERR_OK when everything is well or an error code otherwise.
258 int ngadmin_close (struct ngadmin *nga) EXPORT;
262 * Force the use of the interface.
263 * This function allows to solve two problems:
264 * - When you have multiple network interfaces, sending to the global broadcast
265 * address may not send the packet on the interface you want. \n
266 * This function forces the packet to go on the interface you specified at
267 * the library initialization.
268 * - When the switch is not in your network range, because DHCP is disabled or
269 * you started the DHCP server after the switch. \n
270 * This function allows you to ignore the routing table and consider every
271 * address is directly reachable on the interface. \n
272 * An alternative is to use ngadmin_setKeepBroadcasting, or simply add a route.
274 * @warning Requires root priviledges.
275 * @see ngadmin_setKeepBroadcasting()
276 * @param nga A pointer to the ngadmin structure.
277 * @return ERR_OK when everything is well or an error code otherwise.
279 int ngadmin_forceInterface (struct ngadmin *nga) EXPORT;
283 * Keep broadcasting even when talking with a particular switch.
284 * By default, once you login on a switch, NgAdmin talks with it using unicast.
285 * This prevents the password from being sent to all your network. \n
286 * The switch still replies using broadcast, but the password is not included
288 * This function allows you to disable this feature and do like the official
289 * Windows application that always use broadcast packets. \n
290 * This also allows to configure a switch which is not on your network range
291 * without forcing the interface. \n
292 * When you enable this option, you must be aware that on every parameter
293 * change you make on the switch, your password is broadcasted in cleartext
294 * to all your network.
295 * @see ngadmin_forceInterface()
296 * @param nga A pointer to the ngadmin structure.
297 * @param value Enable or disable the systematic use of broadcast packets.
298 * @return ERR_OK when everything is well or an error code otherwise.
300 int ngadmin_setKeepBroadcasting (struct ngadmin *nga, bool value) EXPORT;
304 * Use global broadcast address.
305 * By default, NgAdmin uses the interface broadcast address.
306 * This option forces the lib to use the global broadcast address
307 * (255.255.255.255) instead.
308 * @warning If you have multiple interfaces, enabling this may cause problems.
309 * @see ngadmin_forceInterface()
310 * @param nga A pointer to the ngadmin structure.
311 * @param value Enable or disable the use of the global broadcast address.
312 * @return ERR_OK when everything is well or an error code otherwise.
314 int ngadmin_useGlobalBroadcast (struct ngadmin *nga, bool value) EXPORT;
318 * Specify the password to use to login.
319 * Sets the password to use to login on switches.
320 * @param nga A pointer to the ngadmin structure.
321 * @param pass The password string to use.
322 * @return ERR_OK when everything is well or an error code otherwise.
324 int ngadmin_setPassword (struct ngadmin *nga, const char *pass) EXPORT;
328 * Set timeout for networking.
329 * Sets the timeout when waiting for network packets.
330 * @param nga A pointer to the ngadmin structure.
331 * @param tv A pointer to a timeval structure.
332 * @return ERR_OK when everything is well or an error code otherwise.
334 int ngadmin_setTimeout (struct ngadmin *nga, const struct timeval *tv) EXPORT;
338 * Scan the network for switches.
339 * This function scans the network for Netgear switches that use NSDP.
340 * @warning Systematically blocks for the timeout value.
341 * @note If you are logged on a switch, calling this function will delog you.
342 * @param nga A pointer to the ngadmin structure.
343 * @return ERR_OK when everything is well or an error code otherwise.
345 int ngadmin_scan (struct ngadmin *nga) EXPORT;
349 * Get the list of detected switches.
350 * This function allows you gou get the list of all last detected switchs.
351 * @note When a scan is done, this array is no more valid.
352 * @param nga A pointer to the ngadmin structure.
353 * @param nb A pointer to an integer which will receive the number of switches.
354 * @return A pointer to an array of switch characteristics.
356 const struct swi_attr* ngadmin_getSwitchTab (struct ngadmin *nga, int *nb) EXPORT;
360 * Get the switch on which you are logged.
361 * This function allows you to get the switch on which you are logged.
362 * @param nga A pointer to the ngadmin structure.
363 * @return A pointer the switch characteristics or NULL if you are not logged.
365 const struct swi_attr* ngadmin_getCurrentSwitch (struct ngadmin *nga) EXPORT;
370 * Upgrade the switch firmware.
371 * This function allows you to upgrade the switch firmware.
372 * @warning Currently not implemented.
373 * @note You must be logged on a switch.
374 * @param nga A pointer to the ngadmin structure.
375 * @param filename A path to the file of the new firmware to send.
376 * @return ERR_NOTIMPL
378 int ngadmin_upgradeFirmware (struct ngadmin *nga, const char *filename) EXPORT;
383 * This function permits to login on a switch.
384 * @note If you are already logged, this function delogs you whatever the new
385 * login attempt is successfull or not.
386 * @see ngadmin_setPassword()
387 * @param nga A pointer to the ngadmin structure.
388 * @param id The id (position in the switch array) of the switch you want to login to.
389 * @return ERR_OK when everything is well or an error code otherwise.
391 int ngadmin_login (struct ngadmin *nga, int id) EXPORT;
395 * Get the ports speed status.
396 * This functions retrieves the ports speed status.
397 * @note You must be logged on a switch.
398 * @param nga A pointer to the ngadmin structure.
399 * @param ports A pointer to an array of ports which will receive ports status.
400 * Must not be NULL. The array size must be ports_count*sizeof(unsigned char).
401 * @return ERR_OK when everything is well or an error code otherwise.
403 int ngadmin_getPortsStatus (struct ngadmin *nga, unsigned char *ports) EXPORT;
407 * Change the name of a switch.
408 * This changes the name of a switch.
409 * @note You must be logged on a switch.
410 * @param nga A pointer to the ngadmin structure.
411 * @param name The name string to use. A NULL value clears the name.
412 * @return ERR_OK when everything is well or an error code otherwise.
414 int ngadmin_setName (struct ngadmin *nga, const char *name) EXPORT;
418 * Get the ports statistics.
419 * Retrieves the ports packet statistics.
420 * @note You must be logged on a switch.
421 * @param nga A pointer to the ngadmin structure.
422 * @param ps A pointer to an array of port_stats structures. Must not be NULL.
423 * The array size must be ports_count*sizeof(struct port_stats).
424 * @return ERR_OK when everything is well or an error code otherwise.
426 int ngadmin_getPortsStatistics (struct ngadmin *nga, struct port_stats *ps) EXPORT;
430 * Reset the ports statistics.
431 * This resets the ports packet statistics.
432 * @note You must be logged on a switch.
433 * @param nga A pointer to the ngadmin structure.
434 * @return ERR_OK when everything is well or an error code otherwise.
436 int ngadmin_resetPortsStatistics (struct ngadmin *nga) EXPORT;
440 * Change the password of a switch.
441 * This changes the password of a switch. On success, automatically updates
442 * local password so you do not have to relog.
443 * @note You must be logged on a switch.
444 * @param nga A pointer to the ngadmin structure.
445 * @param pass The new password string to use.
446 * @return ERR_OK when everything is well or an error code otherwise.
448 int ngadmin_changePassword (struct ngadmin *nga, const char* pass) EXPORT;
452 * Get the broadcast storm filtering state.
453 * Retrieves the broadcast storm filtering state.
454 * @note You must be logged on a switch.
455 * @param nga A pointer to the ngadmin structure.
456 * @param s A pointer to an integer which will receive 0 or 1.
457 * @return ERR_OK when everything is well or an error code otherwise.
459 int ngadmin_getStormFilterState (struct ngadmin *nga, int *s) EXPORT;
463 * Set the broadcast storm filtering state.
464 * Changes the broadcast storm filtering state.
465 * @note You must be logged on a switch.
466 * @param nga A pointer to the ngadmin structure.
467 * @param s An integer with value 0 or 1.
468 * @return ERR_OK when everything is well or an error code otherwise.
470 int ngadmin_setStormFilterState (struct ngadmin *nga, int s) EXPORT;
474 * Get the broadcast storm bitrates.
475 * Retrieves the broadcast storm filtering bitrates.
476 * @note You must be logged on a switch.
477 * @param nga A pointer to the ngadmin structure.
478 * @param ports A pointer to an array of integers. Must not be NULL.
479 * The array size must be ports_count*sizeof(int).
480 * @return ERR_OK when everything is well or an error code otherwise.
482 int ngadmin_getStormFilterValues (struct ngadmin *nga, int *ports) EXPORT;
486 * Set the broadcast storm bitrates.
487 * Changes the broadcast storm filtering values.
488 * @note You must be logged on a switch.
489 * @param nga A pointer to the ngadmin structure.
490 * @param ports A pointer to an array of integers. Must not be NULL.
491 * The array size must be ports_count*sizeof(int).
492 * @return ERR_OK when everything is well or an error code otherwise.
494 int ngadmin_setStormFilterValues (struct ngadmin *nga, const int *ports) EXPORT;
498 * Get the bitrates limits.
499 * Retrieves the bitrates limits of each port.
500 * @note You must be logged on a switch.
501 * @param nga A pointer to the ngadmin structure.
502 * @param ports A pointer to an array of integers. Must not be NULL.
503 * The array size must be ports_count*sizeof(int).
504 * @return ERR_OK when everything is well or an error code otherwise.
506 int ngadmin_getBitrateLimits (struct ngadmin *nga, int *ports) EXPORT;
510 * Set the bitrates limits.
511 * Changes the bitrates limits of each port.
512 * @note You must be logged on a switch.
513 * @param nga A pointer to the ngadmin structure.
514 * @param ports A pointer to an array of integers. Must not be NULL.
515 * The array size must be ports_count*sizeof(int).
516 * @return ERR_OK when everything is well or an error code otherwise.
518 int ngadmin_setBitrateLimits (struct ngadmin *nga, const int *ports) EXPORT;
523 * Retrieves the QoS mode.
524 * @note You must be logged on a switch.
525 * @param nga A pointer to the ngadmin structure.
526 * @param s A pointer to an integer. Must not be NULL.
527 * @return ERR_OK when everything is well or an error code otherwise.
529 int ngadmin_getQOSMode (struct ngadmin *nga, int *s) EXPORT;
534 * Changes the QoS mode.
535 * @note You must be logged on a switch.
536 * @param nga A pointer to the ngadmin structure.
537 * @param s An integer with the new mode.
538 * @return ERR_OK when everything is well or an error code otherwise.
540 int ngadmin_setQOSMode (struct ngadmin *nga, int s) EXPORT;
544 * Get the QoS values.
545 * Retrieves the QoS priority values for all the ports.
546 * @note You must be logged on a switch.
547 * @note The switch QoS mode should be port based to use this function.
548 * @param nga A pointer to the ngadmin structure.
549 * @param ports A pointer to an array of chars. Must not be NULL.
550 The array size must be ports_count*sizeof(ports).
551 * @return ERR_OK when everything is well or an error code otherwise.
553 int ngadmin_getQOSValues (struct ngadmin *nga, char *ports) EXPORT;
557 * Set the QoS values.
558 * Changes the QoS priority values for all the ports.
559 * @note You must be logged on a switch.
560 * @note The switch QoS mode should be port based to use this function.
561 * @param nga A pointer to the ngadmin structure.
562 * @param ports A pointer to an array of chars. Must not be NULL.
563 The array size must be ports_count*sizeof(ports).
564 * @return ERR_OK when everything is well or an error code otherwise.
566 int ngadmin_setQOSValues (struct ngadmin *nga, const char *ports) EXPORT;
570 * Restart the switch.
571 * Restarts the switch.
572 * @note You must be logged on a switch.
573 * @note If successfull, you should wait a few seconds while the switch
574 effectively restarts.
575 * @param nga A pointer to the ngadmin structure.
576 * @return ERR_OK when everything is well or an error code otherwise.
578 int ngadmin_restart (struct ngadmin *nga) EXPORT;
582 * Restore the switch default parameters.
583 * Restores the switch default parameters and restarts it.
584 * @note You must be logged on a switch.
585 * @note If successfull, you will be delogged and the switch list will be
586 cleared. You should wait a few seconds while the switch effectively restarts.
587 * @param nga A pointer to the ngadmin structure.
588 * @return ERR_OK when everything is well or an error code otherwise.
590 int ngadmin_defaults (struct ngadmin *nga) EXPORT;
594 * Get the port mirroring values.
595 * Retrieves the port mirrorring values.
596 * @note The switch QoS mode should be port based to use this function.
597 * @note You must be logged on a switch.
598 * @param nga A pointer to the ngadmin structure.
599 * @param ports A pointer to an array of chars. Must not be NULL. \n
600 The first element of the array is the output port (or 0 if port
601 mirroring is disabled), followed by 0 or 1 values for each port
602 if it is present or not. \n
603 The array size must be (1+ports_count)*sizeof(char).
604 * @return ERR_OK when everything is well or an error code otherwise.
606 int ngadmin_getMirror (struct ngadmin *nga, char *ports) EXPORT;
610 * Set the port mirroring values.
611 * Changes the port mirroring values.
612 * @note The switch QoS mode should be port based to use this function.
613 * @param nga A pointer to the ngadmin structure.
614 * @param ports A pointer to an array of chars. It as the same format as in
615 ngadmin_getMirror. \n
616 If it is NULL, port mirroring is disabled.
617 * @return ERR_OK when everything is well or an error code otherwise.
619 int ngadmin_setMirror (struct ngadmin *nga, const char *ports) EXPORT;
623 * Get the IGMP configuration.
624 * Retrieves the IGMP & multicast configuration.
625 * @note You must be logged on a switch.
626 * @param nga A pointer to the ngadmin structure.
627 * @param ic A pointer to an igmp_conf structure. Must not be NULL.
628 * @return ERR_OK when everything is well or an error code otherwise.
630 int ngadmin_getIGMPConf (struct ngadmin *nga, struct igmp_conf *ic) EXPORT;
634 * Set the IGMP configuration.
635 * Changes the IGMP configuration.
636 * @note You must be logged on a switch.
637 * @param nga A pointer to the ngadmin structure.
638 * @param ic A pointer to an igmp_conf structure. Must not be NULL.
639 * @return ERR_OK when everything is well or an error code otherwise.
641 int ngadmin_setIGMPConf (struct ngadmin *nga, const struct igmp_conf *ic) EXPORT;
645 * Perform a cable test.
646 * Performs a cable test on one ore more ports.
647 * @note Results are still raw values.
648 * @note This function takes a very long time.
649 * @note You must be logged on a switch.
650 * @param nga A pointer to the ngadmin structure.
651 * @param ct A pointer to an array of cabletest structures. Must not be NULL.
652 * @param nb The number of elements in the array.
653 * @return ERR_OK when everything is well or an error code otherwise.
655 int ngadmin_cabletest (struct ngadmin *nga, struct cabletest *ct, int nb) EXPORT;
659 * Set the network configuration.
660 * Changes the network configuration.
661 * @note You must be logged on a switch.
662 * @param nga A pointer to the ngadmin structure.
663 * @param nc A pointer to a net_conf structure. Must not be NULL. \n
664 Only non-zero fields of the structure are taken into account.
665 * @return ERR_OK when everything is well or an error code otherwise.
667 int ngadmin_setNetConf (struct ngadmin *nga, const struct net_conf *nc) EXPORT;
672 * Retrieves the VLAN type.
673 * @note You must be logged on a switch.
674 * @param nga A pointer to the ngadmin structure.
675 * @param t A pointer to an integer which will receive the VLAN type. Must not be NULL.
676 * @return ERR_OK when everything is well or an error code otherwise.
678 int ngadmin_getVLANType (struct ngadmin *nga, int *t) EXPORT;
683 * Changes the VLAN type.
684 * @note You must be logged on a switch.
685 * @param nga A pointer to the ngadmin structure.
686 * @param t An integer which contains the new VLAN type.
687 * @return ERR_OK when everything is well or an error code otherwise.
689 int ngadmin_setVLANType (struct ngadmin *nga, int t) EXPORT;
693 * Get the ports VLANs in port mode.
694 * Retrieves the associated VLAN of ports in port mode.
695 * @note The switch should be in port mode.
696 * @note You must be logged on a switch.
697 * @param nga A pointer to the ngadmin structure.
698 * @param ports A pointer to an array of integers which will receive the
699 number of associated VLAN. Must not be NULL.
700 * @return ERR_OK when everything is well or an error code otherwise.
702 int ngadmin_getVLANPortConf (struct ngadmin *nga, unsigned char *ports) EXPORT;
706 * Set the ports VLAN in port mode.
707 * Changes the associated VLAN of ports in port mode.
708 * @note The switch should be in port mode.
709 * @note You must be logged on a switch.
710 * @param nga A pointer to the ngadmin structure.
711 * @param ports A pointer to an array of integers which contain the
712 number of associated VLAN. Must not be NULL.
713 * @return ERR_OK when everything is well or an error code otherwise.
715 int ngadmin_setVLANPortConf (struct ngadmin *nga, const unsigned char *ports) EXPORT;
719 * Get all the 802.1q VLAN configuration.
720 * Retrieves all the VLAN configuration in 802.1q mode.
721 * @note The switch should be in 802.1q mode.
722 * @note You must be logged on a switch.
723 * @param nga A pointer to the ngadmin structure.
724 * @param vlans A pointer to an array of unsigned shorts which will receive
725 * VLAN ids. Must not be NULL. \n
726 * The array size must be sizeof(unsigned short)*(*nb).
727 * @param ports A pointer to an array of unsigned chars which will receive the
728 802.1q configuration for each VLAN. Must not be NULL. \n
729 The array size must be sizeof(unsigned char)*ports_count*(*nb).
730 * @param nb A pointer to an integer which contains the maximum number of
731 elements allowed in the array. Must not be NULL. \n
732 It will receive the actual number of VLAN written in the arrays.
733 * @return ERR_OK when everything is well or an error code otherwise.
735 int ngadmin_getVLANDotAllConf (struct ngadmin *nga, unsigned short *vlans, unsigned char *ports, int *nb) EXPORT;
739 * Get the configuration of a VLAN in 802.1q mode.
740 * Retrieves the configuration of a particular VLAN in 802.1q mode.
741 * @note The switch should be in 802.1q mode.
742 * @note You must be logged on a switch.
743 * @param nga A pointer to the ngadmin structure.
744 * @param vlan The VLAN you want to get the configuration.
745 * @param ports A pointer to an array of integers which will receive the
746 configuration. Must not be NULL.
747 * @return ERR_OK when everything is well or an error code otherwise.
749 int ngadmin_getVLANDotConf (struct ngadmin *nga, unsigned short vlan, unsigned char *ports) EXPORT;
753 * Set the configuration if a VLAN in 802.1q mode.
754 * Changes the configuration of a particular VLAN in 802.1q mode.
755 * @note The switch should be in 802.1q mode.
756 * @note You must be logged on a switch.
757 * @param nga A pointer to the ngadmin structure.
758 * @param vlan The VLAN you want to change the configuration.
759 * @param ports A pointer to an array of integers which contain the
760 configuration. Must not be NULL.
761 * @return ERR_OK when everything is well or an error code otherwise.
763 int ngadmin_setVLANDotConf (struct ngadmin *nga, unsigned short vlan, const unsigned char *ports) EXPORT;
767 * Destroy a VLAN in 802.1q mode.
768 * Destroys a particular VLAN in 802.1q mode.
769 * @note The switch should be in 802.1q mode.
770 * @note You must be logged on a switch.
771 * @param nga A pointer to the ngadmin structure.
772 * @param vlan The VLAN you want to destroy.
773 * @return ERR_OK when everything is well or an error code otherwise.
775 int ngadmin_VLANDestroy (struct ngadmin *nga, unsigned short vlan) EXPORT;
779 * Get the PVID values.
780 * Retrieves the PVID values of all the ports.
781 * @note You must be logged on a switch.
782 * @param nga A pointer to the ngadmin structure.
783 * @param ports A pointer to an array of unsigned shorts which will receive the
784 * PVID values. Must not be NULL. \n
785 * The array size must be sizeof(unsigned short)*ports_count.
786 * @return ERR_OK when everything is well or an error code otherwise.
788 int ngadmin_getAllPVID (struct ngadmin *nga, unsigned short *ports) EXPORT;
792 * Set the PVID of one port.
793 * Changes the PVID of one port.
794 * @note You must be logged on a switch.
795 * @param nga A pointer to the ngadmin structure.
796 * @param port The port you want to change PVID.
797 * @param vlan The new PVID value.
798 * @return ERR_OK when everything is well or an error code otherwise.
800 int ngadmin_setPVID (struct ngadmin *nga, unsigned char port, unsigned short vlan) EXPORT;