Sample Code

This section lists a sample code that will help you get started in using the ArubaOS XML API interface. These codes have been tested in a controlled environment. We recommend that you test this code in a non-production environment before using it for actual user management tasks.

Using XML API in C Language

The example script is written in the C language. The example script (auth.c) sends an authentication request from your authentication server to the controller.

NOTE: This is an example code and is provided for illustration purposes. If you plan to use this code in your environment, ensure that the code meets your IT guidelines. Also create an error free executable to successfully execute the script.

Figure 357: Authentication Script Listing

#####auth.c listing

#####Authentication Script Example -- Start -- #include <stdio.h>

#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <getopt.h>

char *command, *ipaddr, *macaddr; char *name, *password, *role; char *tout, *secret;

char *auth, *key, enchashbuf[41]; unsigned char hashbuf[20];

char *version;

char post[4096], cmdbuf[512], encbuf[1024];

#define DEBUG #ifdef DEBUG

#define debug(x...) fprintf(stderr, x) #else

#define debug(x...) #endif

extern int cgi_escape_url(char *t, int tl, char *s, int sl, int b_newline); static void encode_message_digest (unsigned char *md, int mdlen, char *output);

static void usage (void)

{

fprintf(stderr, "Usage: ecp [options] <switch> <command> [<secret>]\n");

fprintf(stderr, "

\n");

Switch IP address.\n");

fprintf(stderr, "

<switch>

fprintf(stderr, "

<command>

One of add, del, or authenticate.\n");

fprintf(stderr, "

<secret>

Shared secret.\n");

fprintf(stderr, "

\n");

 

fprintf(stderr, "

-i ipaddr

User IP address in A.B.C.D format.\n");

fprintf(stderr, "

-m macaddr

User MAC address in aa:bb:cc:dd:ee:ff format.\n");

fprintf(stderr, "

-n name

User name.\n");

fprintf(stderr, "

-p passwd

User password.\n");

fprintf(stderr, "

-r role

User role.\n");

fprintf(stderr, "

-t timeout

User session timeout.\n");

fprintf(stderr, "

-v version

API version number. Default is 1.0\n");

Dell PowerConnect W-Series ArubaOS 6.2 User Guide

External User Management 784

Page 784
Image 784
Dell 6.2 manual Sample Code, Using XML API in C Language

6.2 specifications

Dell 6.2 is an advanced enterprise solution that caters to the needs of businesses seeking robust performance and efficiency. As a part of Dell's commitment to innovation, the 6.2 series combines cutting-edge technologies and features that enhance productivity and deliver reliable computing experiences.

One of the standout features of the Dell 6.2 is its impressive processing power. Equipped with the latest Intel processors, it offers exceptional speed and multitasking capabilities. This allows businesses to run demanding applications effortlessly, making it ideal for data-intensive tasks such as data analysis, software development, and virtualization. The series also supports substantial RAM configurations, enabling users to manage extensive workloads without experiencing slowdowns.

In terms of storage, the Dell 6.2 line includes advanced SSD options that significantly boost data access speeds compared to traditional hard drives. This rapid access to information is vital for businesses that require quick retrieval of large datasets. Furthermore, the devices support RAID configurations, which enhances data redundancy and security, protecting critical business information from loss.

Connectivity is another critical aspect of the Dell 6.2 series. It includes multiple USB ports, HDMI outputs, and high-speed Ethernet options, ensuring that users can easily connect to various peripherals and networks. The integration of Wi-Fi 6 technology enables faster wireless connections, resulting in improved internet speeds and bandwidth efficiency, which is crucial in today’s increasingly connected workplaces.

Dell has also prioritized security in the 6.2 series. It features enhanced biometric authentication and advanced encryption methods, safeguarding sensitive data from unauthorized access. Additionally, the system's BIOS protection and automatic updates provide an added layer of security, ensuring that the device remains safe from emerging threats.

The design of the Dell 6.2 is not only sleek and modern but also built for durability. Its robust chassis is engineered to withstand the rigors of daily use, making it suitable for various business environments. This durability ensures that the investment in Dell 6.2 will last for years while maintaining performance integrity.

In summary, the Dell 6.2 series embodies a blend of speed, storage efficiency, connectivity, and security, making it a top choice for enterprises looking to enhance their computing capabilities. With its modern features and durable design, Dell 6.2 is positioned as a reliable partner in driving business success.