User's Manual

1032 | External User Management Dell Networking W-Series ArubaOS 6.4.x| User Guide
"%s",
argv[1], strlen(encbuf), encbuf);
inet_aton(argv[1], &sa.sin_addr);
sa.sin_family = AF_INET;
sa.sin_port = htons(80);
fd = socket(AF_INET, SOCK_STREAM, 0);
if (fd < 0) {
perror("socket");
exit(1);
}
if (connect(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
perror("connect");
exit(1);
}
if (write(fd, post, postlen) != postlen) {
perror("write");
exit(1);
}
while ((len = read(fd, post, sizeof(post))) > 0)
write(1, post, len);
close(fd);
exit(0);
}
static void encode_message_digest (unsigned char *md, int mdlen, char *output)
{
int i;
for (i=0; i<mdlen; i++) {
sprintf(output, "%02x", md[i]);
output += 2;
}
}
}
##### Authentication Script Example -- END --
Understanding Request and Response
The controller processes the authentication task and sends a response to the authentication server in the XML
format to the authentication server. The XML response contains the status of the request and a code in case of
an error. The example script is listed in Figure 243.
Request format: <script_name> [options] <controller-ip> <command> <secret_key>
Understanding XML API Request Parameters
The Table 227list all parameter that you can use in a request.