Example: lrs_get_user_buffer

In the following example, lrs_get_user_buffer retrieves the contents of the user buffer, "buf10", received on "socket1", containing "\x17\x01X-AUTHENTICATION-1".

char *UserBuf, *StrToLog;
int LenOfUserBuf;
lrs_get_static_buffer("socket1", "buf10", 0, -1, NULL);
UserBuf = lrs_get_user_buffer("socket1");
LenOfUserBuf = lrs_get_user_buffer_size("socket1");
StrToLog = (char*)malloc(LenOfUserBuf + 1);
/* copy user buffer and skip two unprintable characters at the beginning */
strncpy(StrToLog, UserBuf+2, LenOfUserBuf-2); 
lr_output_message("UserBuf = \"%s\"", StrToLog);
The output generated by the above code, as seen in the VuGen Execution log is:
Message from run.c(52): UserBuf = "X-AUTHENTICATION-1"