utility functions for the Commotion daemon More...
#include <stdlib.h>
#include <stdint.h>
Go to the source code of this file.
Typedefs | |
typedef int(* | file_iter )(const char *path, const char *filename) |
Functions | |
size_t | strlcat (char *dst, const char *src, const size_t size) |
concatenates two strings More... | |
size_t | strlcpy (char *dest, const char *src, const size_t size) |
copies a string More... | |
size_t | snprintfcat (char *str, size_t size, const char *format,...) |
prints output from string "str" in a specified format More... | |
size_t | strstrip (const char *s, char *out, const size_t outlen) |
removes white space from a given string (to parse for arguments) More... | |
int | compare_version (const char *aver, const char *bver) |
compares version numbers of two software releases More... | |
int | process_files (const char *dir_path, file_iter loader) |
processes file paths More... | |
int | string_to_argv (const char *input, char **argv, int *argc, const size_t max) |
parses a string and converts into a set of arguments More... | |
int | argv_to_string (char **argv, const int argc, char *output, const size_t max) |
converts argument vectors to a single string More... | |
void | mac_string_to_bytes (char *macstr, unsigned char mac[6]) |
converts a MAC address from a string to individual bytes More... | |
void | print_mac (unsigned char mac[6]) |
prints MAC address from MAC array More... | |
int | wifi_freq (const int channel) |
sets Wi-Fi frequency corresponding to specified channel More... | |
int | wifi_chan (const int frequency) |
sets Wi-Fi channel corresponding to specified freuency More... | |
void | get_bssid (const char *essid, const unsigned int channel, char *bssid) |
generates a BSSID from hash of ESSID and channel More... | |
void | hexdump (void *mem, unsigned int len) |
prints a raw byte array in hex and ascii output More... | |
Detailed Description
utility functions for the Commotion daemon
Function Documentation
int argv_to_string | ( | char ** | argv, |
const int | argc, | ||
char * | output, | ||
const size_t | max | ||
) |
converts argument vectors to a single string
- Parameters
-
argv pointer to argument list argc number of arguments output concatenated string of arguments max maximum length of the string
References strlcat().
int compare_version | ( | const char * | aver, |
const char * | bver | ||
) |
compares version numbers of two software releases
- Parameters
-
aver version number for software 'a' bver version number for software 'b'
void get_bssid | ( | const char * | essid, |
const unsigned int | channel, | ||
char * | bssid | ||
) |
generates a BSSID from hash of ESSID and channel
- Parameters
-
essid The ESSID to hash channel an integer of the channel bbsid The returned 6-byte BSSID
void hexdump | ( | void * | mem, |
unsigned int | len | ||
) |
prints a raw byte array in hex and ascii output
- Parameters
-
mem the byte array to print len length of the byte array
References HEXDUMP_COLS.
void mac_string_to_bytes | ( | char * | macstr, |
unsigned char | mac[6] | ||
) |
void print_mac | ( | unsigned char | mac[6] | ) |
int process_files | ( | const char * | dir_path, |
file_iter | loader | ||
) |
processes file paths
- Parameters
-
dir_path string of the directory path loader number of directories in the file path
Referenced by co_plugins_load(), and co_profile_import_files().
size_t snprintfcat | ( | char * | str, |
size_t | size, | ||
const char * | format, | ||
... | |||
) |
prints output from string "str" in a specified format
- Parameters
-
str string to be printed size size of string format output format
int string_to_argv | ( | const char * | input, |
char ** | argv, | ||
int * | argc, | ||
const size_t | max | ||
) |
parses a string and converts into a set of arguments
- Parameters
-
input the string to be parsed argv pointer to argument list argc number of arguments read from the string max maximum length of string
size_t strlcat | ( | char * | dst, |
const char * | src, | ||
const size_t | size | ||
) |
concatenates two strings
- Parameters
-
dst destination for new string src string to be added to size size of combined strings
Referenced by argv_to_string().
size_t strlcpy | ( | char * | dest, |
const char * | src, | ||
const size_t | size | ||
) |
copies a string
- Parameters
-
dst destination for new string src string to be copied size size of string
Referenced by co_iface_add(), and strstrip().
size_t strstrip | ( | const char * | s, |
char * | out, | ||
const size_t | outlen | ||
) |
removes white space from a given string (to parse for arguments)
- Parameters
-
s string to parse out output from the string (with white space removed) outlen length of the output
References strlcpy().
int wifi_chan | ( | const int | frequency | ) |
sets Wi-Fi channel corresponding to specified freuency
- Parameters
-
frequency specified frequency
int wifi_freq | ( | const int | channel | ) |
sets Wi-Fi frequency corresponding to specified channel
- Parameters
-
channel specified channel
Generated on Fri Jun 6 2014 13:22:06 for commotiond by 1.8.7