Skip to content

Instantly share code, notes, and snippets.

@kev009
Created November 15, 2010 00:42
Show Gist options
  • Save kev009/676268 to your computer and use it in GitHub Desktop.
Save kev009/676268 to your computer and use it in GitHub Desktop.
handshake
/* pid 0x02 */
struct packet_handshake
{
uint8_t pid;
int16_t ulen;
char *username;
};
/* Use a non-authenticating handshake for now */
struct packet_handshake s_hs;
bzero(&s_hs, sizeof(s_hs));
s_hs.pid = 0x02;
s_hs.ulen = 1;
s_hs.username = (char *) malloc(1);
bzero(s_hs.username, 1);
strncpy(s_hs.username, "-", 1);
evbuffer_add(output, &s_hs, sizeof(s_hs));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment